diff --git a/dist/LICENSE b/dist/LICENSE index 62c0727e..037d4ee8 100644 --- a/dist/LICENSE +++ b/dist/LICENSE @@ -16970,28 +16970,29 @@ SOFTWARE. mime-db MIT +(The MIT License) -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong me@jongleberry.com +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2015-2022 Douglas Christopher Wilson -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: +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 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. +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. mime-types diff --git a/dist/index.js b/dist/index.js index dff2cde0..a49567b9 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,11 +1,7 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; /******/ var __webpack_modules__ = ({ -<<<<<<< HEAD -/***/ 4941: -======= -/***/ 33529: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 81962: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -31,11 +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__(22037)); -<<<<<<< HEAD -const utils_1 = __nccwpck_require__(19847); -======= -const utils_1 = __nccwpck_require__(38445); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const utils_1 = __nccwpck_require__(36961); /** * Commands * @@ -107,11 +99,7 @@ function escapeProperty(s) { /***/ }), -<<<<<<< HEAD -/***/ 47514: -======= -/***/ 69902: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 42704: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -145,21 +133,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.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; -<<<<<<< HEAD -const command_1 = __nccwpck_require__(4941); -const file_command_1 = __nccwpck_require__(32109); -const utils_1 = __nccwpck_require__(19847); +const command_1 = __nccwpck_require__(81962); +const file_command_1 = __nccwpck_require__(458); +const utils_1 = __nccwpck_require__(36961); const os = __importStar(__nccwpck_require__(22037)); const path = __importStar(__nccwpck_require__(71017)); -const oidc_utils_1 = __nccwpck_require__(80466); -======= -const command_1 = __nccwpck_require__(33529); -const file_command_1 = __nccwpck_require__(49582); -const utils_1 = __nccwpck_require__(38445); -const os = __importStar(__nccwpck_require__(22037)); -const path = __importStar(__nccwpck_require__(71017)); -const oidc_utils_1 = __nccwpck_require__(20663); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const oidc_utils_1 = __nccwpck_require__(48804); /** * The code to exit an action */ @@ -444,29 +423,17 @@ exports.getIDToken = getIDToken; /** * Summary exports */ -<<<<<<< HEAD -var summary_1 = __nccwpck_require__(82505); -======= -var summary_1 = __nccwpck_require__(52184); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var summary_1 = __nccwpck_require__(18495); Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); /** * @deprecated use core.summary */ -<<<<<<< HEAD -var summary_2 = __nccwpck_require__(82505); -======= -var summary_2 = __nccwpck_require__(52184); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var summary_2 = __nccwpck_require__(18495); Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); /** * Path exports */ -<<<<<<< HEAD -var path_utils_1 = __nccwpck_require__(32599); -======= -var path_utils_1 = __nccwpck_require__(2531); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var path_utils_1 = __nccwpck_require__(49285); 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; } })); @@ -474,11 +441,7 @@ Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: funct /***/ }), -<<<<<<< HEAD -/***/ 32109: -======= -/***/ 49582: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 458: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -508,13 +471,8 @@ exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; /* eslint-disable @typescript-eslint/no-explicit-any */ const fs = __importStar(__nccwpck_require__(57147)); const os = __importStar(__nccwpck_require__(22037)); -<<<<<<< HEAD -const uuid_1 = __nccwpck_require__(13472); -const utils_1 = __nccwpck_require__(19847); -======= -const uuid_1 = __nccwpck_require__(49360); -const utils_1 = __nccwpck_require__(38445); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const uuid_1 = __nccwpck_require__(48398); +const utils_1 = __nccwpck_require__(36961); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { @@ -547,16 +505,9 @@ exports.prepareKeyValueMessage = prepareKeyValueMessage; /***/ }), -<<<<<<< HEAD -/***/ 80466: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -======= -/***/ 20663: +/***/ 48804: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } @@ -569,15 +520,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OidcClient = void 0; -<<<<<<< HEAD -const http_client_1 = __nccwpck_require__(15477); -const auth_1 = __nccwpck_require__(13735); -const core_1 = __nccwpck_require__(47514); -======= -const http_client_1 = __nccwpck_require__(9915); -const auth_1 = __nccwpck_require__(81339); -const core_1 = __nccwpck_require__(69902); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const http_client_1 = __nccwpck_require__(16616); +const auth_1 = __nccwpck_require__(58320); +const core_1 = __nccwpck_require__(42704); class OidcClient { static createHttpClient(allowRetry = true, maxRetry = 10) { const requestOptions = { @@ -609,11 +554,7 @@ class OidcClient { .catch(error => { throw new Error(`Failed to get ID Token. \n Error Code : ${error.statusCode}\n -<<<<<<< HEAD Error Message: ${error.message}`); -======= - Error Message: ${error.result.message}`); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { @@ -647,16 +588,9 @@ exports.OidcClient = OidcClient; /***/ }), -<<<<<<< HEAD -/***/ 32599: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -======= -/***/ 2531: +/***/ 49285: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -718,16 +652,9 @@ exports.toPlatformPath = toPlatformPath; /***/ }), -<<<<<<< HEAD -/***/ 82505: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -======= -/***/ 52184: +/***/ 18495: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } @@ -1014,11 +941,7 @@ exports.summary = _summary; /***/ }), -<<<<<<< HEAD -/***/ 19847: -======= -/***/ 38445: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 36961: /***/ ((__unused_webpack_module, exports) => { @@ -1064,11 +987,7 @@ exports.toCommandProperties = toCommandProperties; /***/ }), -<<<<<<< HEAD -/***/ 8725: -======= -/***/ 65174: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 91055: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -1129,11 +1048,7 @@ exports.Context = Context; /***/ }), -<<<<<<< HEAD -/***/ 29592: -======= -/***/ 91890: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 53266: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -1162,13 +1077,8 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getOctokit = exports.context = void 0; -<<<<<<< HEAD -const Context = __importStar(__nccwpck_require__(8725)); -const utils_1 = __nccwpck_require__(8037); -======= -const Context = __importStar(__nccwpck_require__(65174)); -const utils_1 = __nccwpck_require__(56260); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const Context = __importStar(__nccwpck_require__(91055)); +const utils_1 = __nccwpck_require__(29597); exports.context = new Context.Context(); /** * Returns a hydrated octokit ready to use for GitHub Actions @@ -1178,22 +1088,14 @@ exports.context = new Context.Context(); */ function getOctokit(token, options, ...additionalPlugins) { const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins); -<<<<<<< HEAD return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options)); -======= - return new GitHubWithPlugins(utils_1.getOctokitOptions(token, options)); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 } exports.getOctokit = getOctokit; //# sourceMappingURL=github.js.map /***/ }), -<<<<<<< HEAD -/***/ 31161: -======= -/***/ 54357: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 7195: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -1230,14 +1132,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0; -const httpClient = __importStar(__nccwpck_require__(15477)); -const undici_1 = __nccwpck_require__(40992); -======= -exports.getApiBaseUrl = exports.getProxyAgent = exports.getAuthString = void 0; -const httpClient = __importStar(__nccwpck_require__(9915)); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const httpClient = __importStar(__nccwpck_require__(16616)); +const undici_1 = __nccwpck_require__(20394); function getAuthString(token, options) { if (!token && !options.auth) { throw new Error('Parameter token or opts.auth is required'); @@ -1274,11 +1171,7 @@ exports.getApiBaseUrl = getApiBaseUrl; /***/ }), -<<<<<<< HEAD -/***/ 8037: -======= -/***/ 56260: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 29597: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -1307,21 +1200,12 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0; -<<<<<<< HEAD -const Context = __importStar(__nccwpck_require__(8725)); -const Utils = __importStar(__nccwpck_require__(31161)); -// octokit + plugins -const core_1 = __nccwpck_require__(62556); -const plugin_rest_endpoint_methods_1 = __nccwpck_require__(56855); -const plugin_paginate_rest_1 = __nccwpck_require__(47383); -======= -const Context = __importStar(__nccwpck_require__(65174)); -const Utils = __importStar(__nccwpck_require__(54357)); +const Context = __importStar(__nccwpck_require__(91055)); +const Utils = __importStar(__nccwpck_require__(7195)); // octokit + plugins -const core_1 = __nccwpck_require__(85354); -const plugin_rest_endpoint_methods_1 = __nccwpck_require__(94335); -const plugin_paginate_rest_1 = __nccwpck_require__(58601); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const core_1 = __nccwpck_require__(96680); +const plugin_rest_endpoint_methods_1 = __nccwpck_require__(28933); +const plugin_paginate_rest_1 = __nccwpck_require__(9253); exports.context = new Context.Context(); const baseUrl = Utils.getApiBaseUrl(); exports.defaults = { @@ -1352,15 +1236,8 @@ exports.getOctokitOptions = getOctokitOptions; /***/ }), -<<<<<<< HEAD -/***/ 80157: +/***/ 42038: /***/ ((module) => { -======= -/***/ 94335: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 var __defProp = Object.defineProperty; @@ -1443,7 +1320,7 @@ var createTokenAuth = function createTokenAuth2(token) { /***/ }), -/***/ 62556: +/***/ 96680: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -1471,11 +1348,11 @@ __export(dist_src_exports, { Octokit: () => Octokit }); module.exports = __toCommonJS(dist_src_exports); -var import_universal_user_agent = __nccwpck_require__(60031); -var import_before_after_hook = __nccwpck_require__(65997); -var import_request = __nccwpck_require__(90468); -var import_graphql = __nccwpck_require__(12510); -var import_auth_token = __nccwpck_require__(80157); +var import_universal_user_agent = __nccwpck_require__(89637); +var import_before_after_hook = __nccwpck_require__(63491); +var import_request = __nccwpck_require__(5619); +var import_graphql = __nccwpck_require__(89065); +var import_auth_token = __nccwpck_require__(42038); // pkg/dist-src/version.js var VERSION = "5.0.2"; @@ -1611,7 +1488,7 @@ var Octokit = class { /***/ }), -/***/ 13223: +/***/ 2659: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -1641,7 +1518,7 @@ __export(dist_src_exports, { module.exports = __toCommonJS(dist_src_exports); // pkg/dist-src/defaults.js -var import_universal_user_agent = __nccwpck_require__(60031); +var import_universal_user_agent = __nccwpck_require__(89637); // pkg/dist-src/version.js var VERSION = "9.0.4"; @@ -1994,7 +1871,7 @@ var endpoint = withDefaults(null, DEFAULTS); /***/ }), -/***/ 47383: +/***/ 9253: /***/ ((module) => { @@ -2392,7 +2269,7 @@ paginateRest.VERSION = VERSION; /***/ }), -/***/ 56855: +/***/ 28933: /***/ ((module) => { @@ -2428,7 +2305,6 @@ var VERSION = "10.2.0"; // pkg/dist-src/generated/endpoints.js var Endpoints = { actions: { -<<<<<<< HEAD addCustomLabelsToSelfHostedRunnerForOrg: [ "POST /orgs/{org}/actions/runners/{runner_id}/labels" ], @@ -2453,14 +2329,6 @@ var Endpoints = { createOrUpdateEnvironmentSecret: [ "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}" ], -======= - addCustomLabelsToSelfHostedRunnerForOrg: ["POST /orgs/{org}/actions/runners/{runner_id}/labels"], - addCustomLabelsToSelfHostedRunnerForRepo: ["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], - addSelectedRepoToOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], - approveWorkflowRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"], - cancelWorkflowRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"], - createOrUpdateEnvironmentSecret: ["PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"], createOrUpdateRepoSecret: [ "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}" @@ -2473,7 +2341,6 @@ var Endpoints = { "POST /repos/{owner}/{repo}/actions/runners/registration-token" ], createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"], -<<<<<<< HEAD createRemoveTokenForRepo: [ "POST /repos/{owner}/{repo}/actions/runners/remove-token" ], @@ -2496,14 +2363,6 @@ var Endpoints = { deleteEnvironmentVariable: [ "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}" ], -======= - createRemoveTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/remove-token"], - createWorkflowDispatch: ["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"], - deleteActionsCacheById: ["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"], - deleteActionsCacheByKey: ["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"], - deleteArtifact: ["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], - deleteEnvironmentSecret: ["DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"], deleteRepoSecret: [ @@ -2519,7 +2378,6 @@ var Endpoints = { "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}" ], deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"], -<<<<<<< HEAD deleteWorkflowRunLogs: [ "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs" ], @@ -2590,32 +2448,6 @@ var Endpoints = { getGithubActionsPermissionsRepository: [ "GET /repos/{owner}/{repo}/actions/permissions" ], -======= - deleteWorkflowRunLogs: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], - disableSelectedRepositoryGithubActionsOrganization: ["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"], - disableWorkflow: ["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"], - downloadArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"], - downloadJobLogsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"], - downloadWorkflowRunAttemptLogs: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"], - downloadWorkflowRunLogs: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], - enableSelectedRepositoryGithubActionsOrganization: ["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"], - enableWorkflow: ["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"], - getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"], - getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"], - getActionsCacheUsageByRepoForOrg: ["GET /orgs/{org}/actions/cache/usage-by-repository"], - getActionsCacheUsageForEnterprise: ["GET /enterprises/{enterprise}/actions/cache/usage"], - getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"], - getAllowedActionsOrganization: ["GET /orgs/{org}/actions/permissions/selected-actions"], - getAllowedActionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"], - getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], - getEnvironmentPublicKey: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"], - getEnvironmentSecret: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], - getGithubActionsDefaultWorkflowPermissionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/workflow"], - getGithubActionsDefaultWorkflowPermissionsOrganization: ["GET /orgs/{org}/actions/permissions/workflow"], - getGithubActionsDefaultWorkflowPermissionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions/workflow"], - getGithubActionsPermissionsOrganization: ["GET /orgs/{org}/actions/permissions"], - getGithubActionsPermissionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"], getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"], @@ -2639,7 +2471,6 @@ var Endpoints = { "GET /repos/{owner}/{repo}/actions/runners/{runner_id}" ], getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"], -<<<<<<< HEAD getWorkflowAccessToRepository: [ "GET /repos/{owner}/{repo}/actions/permissions/access" ], @@ -2672,19 +2503,6 @@ var Endpoints = { listLabelsForSelfHostedRunnerForRepo: [ "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" ], -======= - getWorkflowAccessToRepository: ["GET /repos/{owner}/{repo}/actions/permissions/access"], - getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"], - getWorkflowRunAttempt: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"], - getWorkflowRunUsage: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"], - getWorkflowUsage: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"], - listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"], - listEnvironmentSecrets: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets"], - listJobsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"], - listJobsForWorkflowRunAttempt: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"], - listLabelsForSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}/labels"], - listLabelsForSelfHostedRunnerForRepo: ["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 listOrgSecrets: ["GET /orgs/{org}/actions/secrets"], listOrgVariables: ["GET /orgs/{org}/actions/variables"], listRepoOrganizationSecrets: [ @@ -2718,7 +2536,6 @@ var Endpoints = { "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs" ], listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"], -<<<<<<< HEAD reRunJobForWorkflowRun: [ "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun" ], @@ -2793,29 +2610,6 @@ var Endpoints = { updateRepoVariable: [ "PATCH /repos/{owner}/{repo}/actions/variables/{name}" ] -======= - reRunJobForWorkflowRun: ["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"], - reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"], - reRunWorkflowFailedJobs: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"], - removeAllCustomLabelsFromSelfHostedRunnerForOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"], - removeAllCustomLabelsFromSelfHostedRunnerForRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], - removeCustomLabelFromSelfHostedRunnerForOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"], - removeCustomLabelFromSelfHostedRunnerForRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"], - removeSelectedRepoFromOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], - reviewPendingDeploymentsForRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"], - setAllowedActionsOrganization: ["PUT /orgs/{org}/actions/permissions/selected-actions"], - setAllowedActionsRepository: ["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"], - setCustomLabelsForSelfHostedRunnerForOrg: ["PUT /orgs/{org}/actions/runners/{runner_id}/labels"], - setCustomLabelsForSelfHostedRunnerForRepo: ["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], - setGithubActionsDefaultWorkflowPermissionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/workflow"], - setGithubActionsDefaultWorkflowPermissionsOrganization: ["PUT /orgs/{org}/actions/permissions/workflow"], - setGithubActionsDefaultWorkflowPermissionsRepository: ["PUT /repos/{owner}/{repo}/actions/permissions/workflow"], - setGithubActionsPermissionsOrganization: ["PUT /orgs/{org}/actions/permissions"], - setGithubActionsPermissionsRepository: ["PUT /repos/{owner}/{repo}/actions/permissions"], - setSelectedReposForOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"], - setSelectedRepositoriesEnabledGithubActionsOrganization: ["PUT /orgs/{org}/actions/permissions/repositories"], - setWorkflowAccessToRepository: ["PUT /repos/{owner}/{repo}/actions/permissions/access"] ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 }, activity: { checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], @@ -2863,7 +2657,6 @@ var Endpoints = { unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"] }, apps: { -<<<<<<< HEAD addRepoToInstallation: [ "PUT /user/installations/{installation_id}/repositories/{repository_id}", {}, @@ -2872,12 +2665,6 @@ var Endpoints = { addRepoToInstallationForAuthenticatedUser: [ "PUT /user/installations/{installation_id}/repositories/{repository_id}" ], -======= - addRepoToInstallation: ["PUT /user/installations/{installation_id}/repositories/{repository_id}", {}, { - renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] - }], - addRepoToInstallationForAuthenticatedUser: ["PUT /user/installations/{installation_id}/repositories/{repository_id}"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 checkToken: ["POST /applications/{client_id}/token"], createFromManifest: ["POST /app-manifests/{code}/conversions"], createInstallationAccessToken: [ @@ -2916,7 +2703,6 @@ var Endpoints = { listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"], listReposAccessibleToInstallation: ["GET /installation/repositories"], listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"], -<<<<<<< HEAD listSubscriptionsForAuthenticatedUserStubbed: [ "GET /user/marketplace_purchases/stubbed" ], @@ -2932,15 +2718,6 @@ var Endpoints = { removeRepoFromInstallationForAuthenticatedUser: [ "DELETE /user/installations/{installation_id}/repositories/{repository_id}" ], -======= - listSubscriptionsForAuthenticatedUserStubbed: ["GET /user/marketplace_purchases/stubbed"], - listWebhookDeliveries: ["GET /app/hook/deliveries"], - redeliverWebhookDelivery: ["POST /app/hook/deliveries/{delivery_id}/attempts"], - removeRepoFromInstallation: ["DELETE /user/installations/{installation_id}/repositories/{repository_id}", {}, { - renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] - }], - removeRepoFromInstallationForAuthenticatedUser: ["DELETE /user/installations/{installation_id}/repositories/{repository_id}"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 resetToken: ["PATCH /applications/{client_id}/token"], revokeInstallationAccessToken: ["DELETE /installation/token"], scopeToken: ["POST /applications/{client_id}/token/scoped"], @@ -2952,15 +2729,9 @@ var Endpoints = { }, billing: { getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], -<<<<<<< HEAD getGithubActionsBillingUser: [ "GET /users/{username}/settings/billing/actions" ], -======= - getGithubActionsBillingUser: ["GET /users/{username}/settings/billing/actions"], - getGithubAdvancedSecurityBillingGhe: ["GET /enterprises/{enterprise}/settings/billing/advanced-security"], - getGithubAdvancedSecurityBillingOrg: ["GET /orgs/{org}/settings/billing/advanced-security"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"], getGithubPackagesBillingUser: [ "GET /users/{username}/settings/billing/packages" @@ -2985,7 +2756,6 @@ var Endpoints = { "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs" ], listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"], -<<<<<<< HEAD rerequestRun: [ "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest" ], @@ -2995,11 +2765,6 @@ var Endpoints = { setSuitesPreferences: [ "PATCH /repos/{owner}/{repo}/check-suites/preferences" ], -======= - rerequestRun: ["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"], - rerequestSuite: ["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"], - setSuitesPreferences: ["PATCH /repos/{owner}/{repo}/check-suites/preferences"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"] }, codeScanning: { @@ -3019,13 +2784,9 @@ var Endpoints = { ], getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"], getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"], -<<<<<<< HEAD listAlertInstances: [ "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances" ], -======= - listAlertInstances: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"], listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"], listAlertsInstances: [ @@ -3048,67 +2809,6 @@ var Endpoints = { codesOfConduct: { getAllCodesOfConduct: ["GET /codes_of_conduct"], getConductCode: ["GET /codes_of_conduct/{key}"] -<<<<<<< HEAD -======= - }, - codespaces: { - addRepositoryForSecretForAuthenticatedUser: ["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"], - codespaceMachinesForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}/machines"], - createForAuthenticatedUser: ["POST /user/codespaces"], - createOrUpdateRepoSecret: ["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"], - createOrUpdateSecretForAuthenticatedUser: ["PUT /user/codespaces/secrets/{secret_name}"], - createWithPrForAuthenticatedUser: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"], - createWithRepoForAuthenticatedUser: ["POST /repos/{owner}/{repo}/codespaces"], - deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"], - deleteFromOrganization: ["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"], - deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"], - deleteSecretForAuthenticatedUser: ["DELETE /user/codespaces/secrets/{secret_name}"], - exportForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/exports"], - getExportDetailsForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}/exports/{export_id}"], - getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"], - getPublicKeyForAuthenticatedUser: ["GET /user/codespaces/secrets/public-key"], - getRepoPublicKey: ["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"], - getRepoSecret: ["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"], - getSecretForAuthenticatedUser: ["GET /user/codespaces/secrets/{secret_name}"], - listDevcontainersInRepositoryForAuthenticatedUser: ["GET /repos/{owner}/{repo}/codespaces/devcontainers"], - listForAuthenticatedUser: ["GET /user/codespaces"], - listInOrganization: ["GET /orgs/{org}/codespaces", {}, { - renamedParameters: { - org_id: "org" - } - }], - listInRepositoryForAuthenticatedUser: ["GET /repos/{owner}/{repo}/codespaces"], - listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"], - listRepositoriesForSecretForAuthenticatedUser: ["GET /user/codespaces/secrets/{secret_name}/repositories"], - listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"], - removeRepositoryForSecretForAuthenticatedUser: ["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"], - repoMachinesForAuthenticatedUser: ["GET /repos/{owner}/{repo}/codespaces/machines"], - setRepositoriesForSecretForAuthenticatedUser: ["PUT /user/codespaces/secrets/{secret_name}/repositories"], - startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"], - stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"], - stopInOrganization: ["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"], - updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"] - }, - dependabot: { - addSelectedRepoToOrgSecret: ["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"], - createOrUpdateOrgSecret: ["PUT /orgs/{org}/dependabot/secrets/{secret_name}"], - createOrUpdateRepoSecret: ["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"], - deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"], - deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"], - getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"], - getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"], - getRepoPublicKey: ["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"], - getRepoSecret: ["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"], - listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"], - listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"], - listSelectedReposForOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"], - removeSelectedRepoFromOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"], - setSelectedReposForOrgSecret: ["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"] - }, - dependencyGraph: { - createRepositorySnapshot: ["POST /repos/{owner}/{repo}/dependency-graph/snapshots"], - diffRange: ["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"] ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 }, codespaces: { addRepositoryForSecretForAuthenticatedUser: [ @@ -3223,7 +2923,6 @@ var Endpoints = { ], updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"] }, -<<<<<<< HEAD copilot: { addCopilotForBusinessSeatsForTeams: [ "POST /orgs/{org}/copilot/billing/selected_teams" @@ -3242,23 +2941,6 @@ var Endpoints = { "GET /orgs/{org}/members/{username}/copilot" ], listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"] -======= - enterpriseAdmin: { - addCustomLabelsToSelfHostedRunnerForEnterprise: ["POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], - disableSelectedOrganizationGithubActionsEnterprise: ["DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}"], - enableSelectedOrganizationGithubActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}"], - getAllowedActionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/selected-actions"], - getGithubActionsPermissionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions"], - getServerStatistics: ["GET /enterprise-installation/{enterprise_or_org}/server-statistics"], - listLabelsForSelfHostedRunnerForEnterprise: ["GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], - listSelectedOrganizationsEnabledGithubActionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/organizations"], - removeAllCustomLabelsFromSelfHostedRunnerForEnterprise: ["DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], - removeCustomLabelFromSelfHostedRunnerForEnterprise: ["DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name}"], - setAllowedActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/selected-actions"], - setCustomLabelsForSelfHostedRunnerForEnterprise: ["PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], - setGithubActionsPermissionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions"], - setSelectedOrganizationsEnabledGithubActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/organizations"] ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 }, dependabot: { addSelectedRepoToOrgSecret: [ @@ -3415,13 +3097,9 @@ var Endpoints = { listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"], listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"], listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"], -<<<<<<< HEAD listEventsForTimeline: [ "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline" ], -======= - listEventsForTimeline: ["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 listForAuthenticatedUser: ["GET /user/issues"], listForOrg: ["GET /orgs/{org}/issues"], listForRepo: ["GET /repos/{owner}/{repo}/issues"], @@ -3472,7 +3150,6 @@ var Endpoints = { root: ["GET /"] }, migrations: { -<<<<<<< HEAD cancelImport: [ "DELETE /repos/{owner}/{repo}/import", {}, @@ -3513,21 +3190,10 @@ var Endpoints = { deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files" } ], -======= - cancelImport: ["DELETE /repos/{owner}/{repo}/import"], - deleteArchiveForAuthenticatedUser: ["DELETE /user/migrations/{migration_id}/archive"], - deleteArchiveForOrg: ["DELETE /orgs/{org}/migrations/{migration_id}/archive"], - downloadArchiveForOrg: ["GET /orgs/{org}/migrations/{migration_id}/archive"], - getArchiveForAuthenticatedUser: ["GET /user/migrations/{migration_id}/archive"], - getCommitAuthors: ["GET /repos/{owner}/{repo}/import/authors"], - getImportStatus: ["GET /repos/{owner}/{repo}/import"], - getLargeFiles: ["GET /repos/{owner}/{repo}/import/large_files"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"], getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"], listForAuthenticatedUser: ["GET /user/migrations"], listForOrg: ["GET /orgs/{org}/migrations"], -<<<<<<< HEAD listReposForAuthenticatedUser: [ "GET /user/migrations/{migration_id}/repositories" ], @@ -3573,21 +3239,6 @@ var Endpoints = { deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import" } ] -======= - listReposForAuthenticatedUser: ["GET /user/migrations/{migration_id}/repositories"], - listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"], - listReposForUser: ["GET /user/migrations/{migration_id}/repositories", {}, { - renamed: ["migrations", "listReposForAuthenticatedUser"] - }], - mapCommitAuthor: ["PATCH /repos/{owner}/{repo}/import/authors/{author_id}"], - setLfsPreference: ["PATCH /repos/{owner}/{repo}/import/lfs"], - startForAuthenticatedUser: ["POST /user/migrations"], - startForOrg: ["POST /orgs/{org}/migrations"], - startImport: ["PUT /repos/{owner}/{repo}/import"], - unlockRepoForAuthenticatedUser: ["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"], - unlockRepoForOrg: ["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"], - updateImport: ["PATCH /repos/{owner}/{repo}/import"] ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 }, orgs: { addSecurityManagerTeam: [ @@ -3624,7 +3275,6 @@ var Endpoints = { getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], -<<<<<<< HEAD getWebhookDelivery: [ "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}" ], @@ -3632,13 +3282,6 @@ var Endpoints = { listAppInstallations: ["GET /orgs/{org}/installations"], listBlockedUsers: ["GET /orgs/{org}/blocks"], listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"], -======= - getWebhookDelivery: ["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"], - list: ["GET /organizations"], - listAppInstallations: ["GET /orgs/{org}/installations"], - listBlockedUsers: ["GET /orgs/{org}/blocks"], - listCustomRoles: ["GET /organizations/{organization_id}/custom_roles"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 listFailedInvitations: ["GET /orgs/{org}/failed_invitations"], listForAuthenticatedUser: ["GET /user/orgs"], listForUser: ["GET /users/{username}/orgs"], @@ -3656,7 +3299,6 @@ var Endpoints = { listPatGrants: ["GET /orgs/{org}/personal-access-tokens"], listPendingInvitations: ["GET /orgs/{org}/invitations"], listPublicMembers: ["GET /orgs/{org}/public_members"], -<<<<<<< HEAD listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"], listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], listWebhooks: ["GET /orgs/{org}/hooks"], @@ -3667,12 +3309,6 @@ var Endpoints = { removeCustomProperty: [ "DELETE /orgs/{org}/properties/schema/{custom_property_name}" ], -======= - listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], - listWebhooks: ["GET /orgs/{org}/hooks"], - pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], - redeliverWebhookDelivery: ["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 removeMember: ["DELETE /orgs/{org}/members/{username}"], removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"], removeOutsideCollaborator: [ @@ -3705,7 +3341,6 @@ var Endpoints = { updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"] }, packages: { -<<<<<<< HEAD deletePackageForAuthenticatedUser: [ "DELETE /user/packages/{package_type}/{package_name}" ], @@ -3796,38 +3431,6 @@ var Endpoints = { restorePackageVersionForUser: [ "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" ] -======= - deletePackageForAuthenticatedUser: ["DELETE /user/packages/{package_type}/{package_name}"], - deletePackageForOrg: ["DELETE /orgs/{org}/packages/{package_type}/{package_name}"], - deletePackageForUser: ["DELETE /users/{username}/packages/{package_type}/{package_name}"], - deletePackageVersionForAuthenticatedUser: ["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"], - deletePackageVersionForOrg: ["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"], - deletePackageVersionForUser: ["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"], - getAllPackageVersionsForAPackageOwnedByAnOrg: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions", {}, { - renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] - }], - getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions", {}, { - renamed: ["packages", "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"] - }], - getAllPackageVersionsForPackageOwnedByAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions"], - getAllPackageVersionsForPackageOwnedByOrg: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"], - getAllPackageVersionsForPackageOwnedByUser: ["GET /users/{username}/packages/{package_type}/{package_name}/versions"], - getPackageForAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}"], - getPackageForOrganization: ["GET /orgs/{org}/packages/{package_type}/{package_name}"], - getPackageForUser: ["GET /users/{username}/packages/{package_type}/{package_name}"], - getPackageVersionForAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"], - getPackageVersionForOrganization: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"], - getPackageVersionForUser: ["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"], - listPackagesForAuthenticatedUser: ["GET /user/packages"], - listPackagesForOrganization: ["GET /orgs/{org}/packages"], - listPackagesForUser: ["GET /users/{username}/packages"], - restorePackageForAuthenticatedUser: ["POST /user/packages/{package_type}/{package_name}/restore{?token}"], - restorePackageForOrg: ["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"], - restorePackageForUser: ["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"], - restorePackageVersionForAuthenticatedUser: ["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"], - restorePackageVersionForOrg: ["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"], - restorePackageVersionForUser: ["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"] ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 }, projects: { addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"], @@ -3842,13 +3445,9 @@ var Endpoints = { get: ["GET /projects/{project_id}"], getCard: ["GET /projects/columns/cards/{card_id}"], getColumn: ["GET /projects/columns/{column_id}"], -<<<<<<< HEAD getPermissionForUser: [ "GET /projects/{project_id}/collaborators/{username}/permission" ], -======= - getPermissionForUser: ["GET /projects/{project_id}/collaborators/{username}/permission"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 listCards: ["GET /projects/columns/{column_id}/cards"], listCollaborators: ["GET /projects/{project_id}/collaborators"], listColumns: ["GET /projects/{project_id}/columns"], @@ -3857,13 +3456,9 @@ var Endpoints = { listForUser: ["GET /users/{username}/projects"], moveCard: ["POST /projects/columns/cards/{card_id}/moves"], moveColumn: ["POST /projects/columns/{column_id}/moves"], -<<<<<<< HEAD removeCollaborator: [ "DELETE /projects/{project_id}/collaborators/{username}" ], -======= - removeCollaborator: ["DELETE /projects/{project_id}/collaborators/{username}"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 update: ["PATCH /projects/{project_id}"], updateCard: ["PATCH /projects/columns/cards/{card_id}"], updateColumn: ["PATCH /projects/columns/{column_id}"] @@ -3917,7 +3512,6 @@ var Endpoints = { "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events" ], update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"], -<<<<<<< HEAD updateBranch: [ "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch" ], @@ -3927,18 +3521,9 @@ var Endpoints = { updateReviewComment: [ "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}" ] -======= - updateBranch: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"], - updateReview: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], - updateReviewComment: ["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"] - }, - rateLimit: { - get: ["GET /rate_limit"] ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 }, rateLimit: { get: ["GET /rate_limit"] }, reactions: { -<<<<<<< HEAD createForCommitComment: [ "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions" ], @@ -4015,38 +3600,6 @@ var Endpoints = { {}, { mapToData: "apps" } ], -======= - createForCommitComment: ["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"], - createForIssue: ["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"], - createForIssueComment: ["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"], - createForPullRequestReviewComment: ["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"], - createForRelease: ["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"], - createForTeamDiscussionCommentInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"], - createForTeamDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"], - deleteForCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"], - deleteForIssue: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"], - deleteForIssueComment: ["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"], - deleteForPullRequestComment: ["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"], - deleteForRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"], - deleteForTeamDiscussion: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"], - deleteForTeamDiscussionComment: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"], - listForCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"], - listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"], - listForIssueComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"], - listForPullRequestReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"], - listForRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"], - listForTeamDiscussionCommentInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"], - listForTeamDiscussionInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"] - }, - repos: { - acceptInvitation: ["PATCH /user/repository_invitations/{invitation_id}", {}, { - renamed: ["repos", "acceptInvitationForAuthenticatedUser"] - }], - acceptInvitationForAuthenticatedUser: ["PATCH /user/repository_invitations/{invitation_id}"], - addAppAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { - mapToData: "apps" - }], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"], addStatusCheckContexts: [ "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", @@ -4067,7 +3620,6 @@ var Endpoints = { "GET /repos/{owner}/{repo}/automated-security-fixes" ], checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"], -<<<<<<< HEAD checkVulnerabilityAlerts: [ "GET /repos/{owner}/{repo}/vulnerability-alerts" ], @@ -4083,15 +3635,6 @@ var Endpoints = { createCommitSignatureProtection: [ "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" ], -======= - checkVulnerabilityAlerts: ["GET /repos/{owner}/{repo}/vulnerability-alerts"], - codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"], - compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], - compareCommitsWithBasehead: ["GET /repos/{owner}/{repo}/compare/{basehead}"], - createAutolink: ["POST /repos/{owner}/{repo}/autolinks"], - createCommitComment: ["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"], - createCommitSignatureProtection: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"], createDeployKey: ["POST /repos/{owner}/{repo}/keys"], createDeployment: ["POST /repos/{owner}/{repo}/deployments"], @@ -4112,7 +3655,6 @@ var Endpoints = { "PUT /repos/{owner}/{repo}/environments/{environment_name}" ], createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], -<<<<<<< HEAD createOrgRuleset: ["POST /orgs/{org}/rulesets"], createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployment"], createPagesSite: ["POST /repos/{owner}/{repo}/pages"], @@ -4149,25 +3691,6 @@ var Endpoints = { deleteCommitSignatureProtection: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" ], -======= - createPagesSite: ["POST /repos/{owner}/{repo}/pages"], - createRelease: ["POST /repos/{owner}/{repo}/releases"], - createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"], - createUsingTemplate: ["POST /repos/{template_owner}/{template_repo}/generate"], - createWebhook: ["POST /repos/{owner}/{repo}/hooks"], - declineInvitation: ["DELETE /user/repository_invitations/{invitation_id}", {}, { - renamed: ["repos", "declineInvitationForAuthenticatedUser"] - }], - declineInvitationForAuthenticatedUser: ["DELETE /user/repository_invitations/{invitation_id}"], - delete: ["DELETE /repos/{owner}/{repo}"], - deleteAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"], - deleteAdminBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], - deleteAnEnvironment: ["DELETE /repos/{owner}/{repo}/environments/{environment_name}"], - deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"], - deleteBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"], - deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"], - deleteCommitSignatureProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"], deleteDeployment: [ "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}" @@ -4176,7 +3699,6 @@ var Endpoints = { "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" ], deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"], -<<<<<<< HEAD deleteInvitation: [ "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}" ], @@ -4225,27 +3747,6 @@ var Endpoints = { generateReleaseNotes: [ "POST /repos/{owner}/{repo}/releases/generate-notes" ], -======= - deleteInvitation: ["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"], - deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"], - deletePullRequestReviewProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], - deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"], - deleteReleaseAsset: ["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"], - deleteTagProtection: ["DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"], - deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"], - disableAutomatedSecurityFixes: ["DELETE /repos/{owner}/{repo}/automated-security-fixes"], - disableLfsForRepo: ["DELETE /repos/{owner}/{repo}/lfs"], - disableVulnerabilityAlerts: ["DELETE /repos/{owner}/{repo}/vulnerability-alerts"], - downloadArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}", {}, { - renamed: ["repos", "downloadZipballArchive"] - }], - downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"], - downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"], - enableAutomatedSecurityFixes: ["PUT /repos/{owner}/{repo}/automated-security-fixes"], - enableLfsForRepo: ["PUT /repos/{owner}/{repo}/lfs"], - enableVulnerabilityAlerts: ["PUT /repos/{owner}/{repo}/vulnerability-alerts"], - generateReleaseNotes: ["POST /repos/{owner}/{repo}/releases/generate-notes"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 get: ["GET /repos/{owner}/{repo}"], getAccessRestrictions: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions" @@ -4257,7 +3758,6 @@ var Endpoints = { "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules" ], getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"], -<<<<<<< HEAD getAllStatusCheckContexts: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" ], @@ -4265,11 +3765,6 @@ var Endpoints = { getAppsWithAccessToProtectedBranch: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" ], -======= - getAllStatusCheckContexts: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"], - getAllTopics: ["GET /repos/{owner}/{repo}/topics"], - getAppsWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"], getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"], getBranchProtection: [ @@ -4285,13 +3780,9 @@ var Endpoints = { getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"], getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"], getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"], -<<<<<<< HEAD getCommitSignatureProtection: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" ], -======= - getCommitSignatureProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"], getContent: ["GET /repos/{owner}/{repo}/contents/{path}"], getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"], @@ -4348,7 +3839,6 @@ var Endpoints = { ], getViews: ["GET /repos/{owner}/{repo}/traffic/views"], getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"], -<<<<<<< HEAD getWebhookConfigForRepo: [ "GET /repos/{owner}/{repo}/hooks/{hook_id}/config" ], @@ -4361,13 +3851,6 @@ var Endpoints = { listBranchesForHeadCommit: [ "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head" ], -======= - getWebhookConfigForRepo: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"], - getWebhookDelivery: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"], - listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"], - listBranches: ["GET /repos/{owner}/{repo}/branches"], - listBranchesForHeadCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"], listCommentsForCommit: [ "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments" @@ -4398,33 +3881,23 @@ var Endpoints = { listLanguages: ["GET /repos/{owner}/{repo}/languages"], listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"], listPublic: ["GET /repositories"], -<<<<<<< HEAD listPullRequestsAssociatedWithCommit: [ "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls" ], listReleaseAssets: [ "GET /repos/{owner}/{repo}/releases/{release_id}/assets" ], -======= - listPullRequestsAssociatedWithCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"], - listReleaseAssets: ["GET /repos/{owner}/{repo}/releases/{release_id}/assets"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 listReleases: ["GET /repos/{owner}/{repo}/releases"], listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"], listTags: ["GET /repos/{owner}/{repo}/tags"], listTeams: ["GET /repos/{owner}/{repo}/teams"], -<<<<<<< HEAD listWebhookDeliveries: [ "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries" ], -======= - listWebhookDeliveries: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 listWebhooks: ["GET /repos/{owner}/{repo}/hooks"], merge: ["POST /repos/{owner}/{repo}/merges"], mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"], pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"], -<<<<<<< HEAD redeliverWebhookDelivery: [ "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" ], @@ -4454,23 +3927,6 @@ var Endpoints = { {}, { mapToData: "users" } ], -======= - redeliverWebhookDelivery: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"], - removeAppAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { - mapToData: "apps" - }], - removeCollaborator: ["DELETE /repos/{owner}/{repo}/collaborators/{username}"], - removeStatusCheckContexts: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { - mapToData: "contexts" - }], - removeStatusCheckProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], - removeTeamAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { - mapToData: "teams" - }], - removeUserAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { - mapToData: "users" - }], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"], replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"], requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"], @@ -4547,7 +4003,6 @@ var Endpoints = { users: ["GET /search/users"] }, secretScanning: { -<<<<<<< HEAD getAlert: [ "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}" ], @@ -4600,21 +4055,6 @@ var Endpoints = { checkPermissionsForRepoInOrg: [ "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" ], -======= - getAlert: ["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"], - listAlertsForEnterprise: ["GET /enterprises/{enterprise}/secret-scanning/alerts"], - listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"], - listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"], - listLocationsForAlert: ["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"], - updateAlert: ["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"] - }, - teams: { - addOrUpdateMembershipForUserInOrg: ["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"], - addOrUpdateProjectPermissionsInOrg: ["PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"], - addOrUpdateRepoPermissionsInOrg: ["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], - checkPermissionsForProjectInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"], - checkPermissionsForRepoInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 create: ["POST /orgs/{org}/teams"], createDiscussionCommentInOrg: [ "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments" @@ -4645,13 +4085,9 @@ var Endpoints = { listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"], listForAuthenticatedUser: ["GET /user/teams"], listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"], -<<<<<<< HEAD listPendingInvitationsInOrg: [ "GET /orgs/{org}/teams/{team_slug}/invitations" ], -======= - listPendingInvitationsInOrg: ["GET /orgs/{org}/teams/{team_slug}/invitations"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"], listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"], removeMembershipForUserInOrg: [ @@ -4672,7 +4108,6 @@ var Endpoints = { updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"] }, users: { -<<<<<<< HEAD addEmailForAuthenticated: [ "POST /user/emails", {}, @@ -4680,17 +4115,10 @@ var Endpoints = { ], addEmailForAuthenticatedUser: ["POST /user/emails"], addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"], -======= - addEmailForAuthenticated: ["POST /user/emails", {}, { - renamed: ["users", "addEmailForAuthenticatedUser"] - }], - addEmailForAuthenticatedUser: ["POST /user/emails"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 block: ["PUT /user/blocks/{username}"], checkBlocked: ["GET /user/blocks/{username}"], checkFollowingForUser: ["GET /users/{username}/following/{target_user}"], checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"], -<<<<<<< HEAD createGpgKeyForAuthenticated: [ "POST /user/gpg_keys", {}, @@ -4726,33 +4154,10 @@ var Endpoints = { deleteSshSigningKeyForAuthenticatedUser: [ "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}" ], -======= - createGpgKeyForAuthenticated: ["POST /user/gpg_keys", {}, { - renamed: ["users", "createGpgKeyForAuthenticatedUser"] - }], - createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"], - createPublicSshKeyForAuthenticated: ["POST /user/keys", {}, { - renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] - }], - createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"], - deleteEmailForAuthenticated: ["DELETE /user/emails", {}, { - renamed: ["users", "deleteEmailForAuthenticatedUser"] - }], - deleteEmailForAuthenticatedUser: ["DELETE /user/emails"], - deleteGpgKeyForAuthenticated: ["DELETE /user/gpg_keys/{gpg_key_id}", {}, { - renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] - }], - deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"], - deletePublicSshKeyForAuthenticated: ["DELETE /user/keys/{key_id}", {}, { - renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] - }], - deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 follow: ["PUT /user/following/{username}"], getAuthenticated: ["GET /user"], getByUsername: ["GET /users/{username}"], getContextForUser: ["GET /users/{username}/hovercard"], -<<<<<<< HEAD getGpgKeyForAuthenticated: [ "GET /user/gpg_keys/{gpg_key_id}", {}, @@ -4786,33 +4191,10 @@ var Endpoints = { {}, { renamed: ["users", "listFollowedByAuthenticatedUser"] } ], -======= - getGpgKeyForAuthenticated: ["GET /user/gpg_keys/{gpg_key_id}", {}, { - renamed: ["users", "getGpgKeyForAuthenticatedUser"] - }], - getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"], - getPublicSshKeyForAuthenticated: ["GET /user/keys/{key_id}", {}, { - renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] - }], - getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"], - list: ["GET /users"], - listBlockedByAuthenticated: ["GET /user/blocks", {}, { - renamed: ["users", "listBlockedByAuthenticatedUser"] - }], - listBlockedByAuthenticatedUser: ["GET /user/blocks"], - listEmailsForAuthenticated: ["GET /user/emails", {}, { - renamed: ["users", "listEmailsForAuthenticatedUser"] - }], - listEmailsForAuthenticatedUser: ["GET /user/emails"], - listFollowedByAuthenticated: ["GET /user/following", {}, { - renamed: ["users", "listFollowedByAuthenticatedUser"] - }], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 listFollowedByAuthenticatedUser: ["GET /user/following"], listFollowersForAuthenticatedUser: ["GET /user/followers"], listFollowersForUser: ["GET /users/{username}/followers"], listFollowingForUser: ["GET /users/{username}/following"], -<<<<<<< HEAD listGpgKeysForAuthenticated: [ "GET /user/gpg_keys", {}, @@ -4845,26 +4227,6 @@ var Endpoints = { setPrimaryEmailVisibilityForAuthenticatedUser: [ "PATCH /user/email/visibility" ], -======= - listGpgKeysForAuthenticated: ["GET /user/gpg_keys", {}, { - renamed: ["users", "listGpgKeysForAuthenticatedUser"] - }], - listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"], - listGpgKeysForUser: ["GET /users/{username}/gpg_keys"], - listPublicEmailsForAuthenticated: ["GET /user/public_emails", {}, { - renamed: ["users", "listPublicEmailsForAuthenticatedUser"] - }], - listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"], - listPublicKeysForUser: ["GET /users/{username}/keys"], - listPublicSshKeysForAuthenticated: ["GET /user/keys", {}, { - renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] - }], - listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"], - setPrimaryEmailVisibilityForAuthenticated: ["PATCH /user/email/visibility", {}, { - renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] - }], - setPrimaryEmailVisibilityForAuthenticatedUser: ["PATCH /user/email/visibility"], ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 unblock: ["DELETE /user/blocks/{username}"], unfollow: ["DELETE /user/following/{username}"], updateAuthenticated: ["PATCH /user"] @@ -4872,7 +4234,6 @@ var Endpoints = { }; var endpoints_default = Endpoints; -<<<<<<< HEAD // pkg/dist-src/endpoints-to-methods.js var endpointMethodsMap = /* @__PURE__ */ new Map(); for (const [scope, endpoints] of Object.entries(endpoints_default)) { @@ -4881,18 +4242,6 @@ for (const [scope, endpoints] of Object.entries(endpoints_default)) { const [method, url] = route.split(/ /); const endpointDefaults = Object.assign( { -======= -const VERSION = "5.16.2"; - -function endpointsToMethods(octokit, endpointsMap) { - const newMethods = {}; - - for (const [scope, endpoints] of Object.entries(endpointsMap)) { - for (const [methodName, endpoint] of Object.entries(endpoints)) { - const [route, defaults, decorations] = endpoint; - const [method, url] = route.split(/ /); - const endpointDefaults = Object.assign({ ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 method, url }, @@ -5030,16 +4379,10 @@ legacyRestEndpointMethods.VERSION = VERSION; /***/ }), -<<<<<<< HEAD -/***/ 63571: +/***/ 88693: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -======= -/***/ 81339: -/***/ (function(__unused_webpack_module, exports) { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -<<<<<<< HEAD var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; @@ -5074,8 +4417,8 @@ __export(dist_src_exports, { RequestError: () => RequestError }); module.exports = __toCommonJS(dist_src_exports); -var import_deprecation = __nccwpck_require__(40454); -var import_once = __toESM(__nccwpck_require__(56939)); +var import_deprecation = __nccwpck_require__(45862); +var import_once = __toESM(__nccwpck_require__(79816)); var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation)); var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation)); var RequestError = class extends Error { @@ -5133,7 +4476,7 @@ var RequestError = class extends Error { /***/ }), -/***/ 90468: +/***/ 5619: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -5161,8 +4504,8 @@ __export(dist_src_exports, { request: () => request }); module.exports = __toCommonJS(dist_src_exports); -var import_endpoint = __nccwpck_require__(13223); -var import_universal_user_agent = __nccwpck_require__(60031); +var import_endpoint = __nccwpck_require__(2659); +var import_universal_user_agent = __nccwpck_require__(89637); // pkg/dist-src/version.js var VERSION = "8.1.6"; @@ -5181,7 +4524,7 @@ function isPlainObject(value) { } // pkg/dist-src/fetch-wrapper.js -var import_request_error = __nccwpck_require__(63571); +var import_request_error = __nccwpck_require__(88693); // pkg/dist-src/get-buffer-response.js function getBufferResponse(response) { @@ -5355,12 +4698,10 @@ var request = withDefaults(import_endpoint.endpoint, { /***/ }), -/***/ 13735: +/***/ 58320: /***/ (function(__unused_webpack_module, exports) { -======= ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 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) { @@ -5444,29 +4785,18 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ }), -<<<<<<< HEAD -/***/ 15477: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -======= -/***/ 9915: +/***/ 16616: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 /* eslint-disable @typescript-eslint/no-explicit-any */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; -<<<<<<< HEAD var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); -======= - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -5479,11 +4809,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; -<<<<<<< HEAD if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); -======= - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 __setModuleDefault(result, mod); return result; }; @@ -5500,14 +4826,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; const http = __importStar(__nccwpck_require__(13685)); const https = __importStar(__nccwpck_require__(95687)); -<<<<<<< HEAD -const pm = __importStar(__nccwpck_require__(39659)); -const tunnel = __importStar(__nccwpck_require__(62098)); -const undici_1 = __nccwpck_require__(40992); -======= -const pm = __importStar(__nccwpck_require__(9810)); -const tunnel = __importStar(__nccwpck_require__(16563)); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const pm = __importStar(__nccwpck_require__(76992)); +const tunnel = __importStar(__nccwpck_require__(12469)); +const undici_1 = __nccwpck_require__(20394); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; @@ -5595,7 +4916,6 @@ class HttpClientResponse { resolve(output.toString()); }); })); -<<<<<<< HEAD }); } readBodyBuffer() { @@ -5609,8 +4929,6 @@ class HttpClientResponse { resolve(Buffer.concat(chunks)); }); })); -======= ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 }); } } @@ -6026,7 +5344,6 @@ class HttpClient { } return agent; } -<<<<<<< HEAD _getProxyAgentDispatcher(parsedUrl, proxyUrl) { let proxyAgent; if (this._keepAlive) { @@ -6051,8 +5368,6 @@ class HttpClient { } return proxyAgent; } -======= ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 _performExponentialBackoff(retryNumber) { return __awaiter(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); @@ -6132,11 +5447,7 @@ const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCa /***/ }), -<<<<<<< HEAD -/***/ 39659: -======= -/***/ 9810: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 76992: /***/ ((__unused_webpack_module, exports) => { @@ -6156,7 +5467,6 @@ function getProxyUrl(reqUrl) { } })(); if (proxyVar) { -<<<<<<< HEAD try { return new URL(proxyVar); } @@ -6164,9 +5474,6 @@ function getProxyUrl(reqUrl) { if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) return new URL(`http://${proxyVar}`); } -======= - return new URL(proxyVar); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 } else { return undefined; @@ -6177,13 +5484,10 @@ function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; } -<<<<<<< HEAD const reqHost = reqUrl.hostname; if (isLoopbackAddress(reqHost)) { return true; } -======= ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; if (!noProxy) { return false; @@ -6220,7 +5524,6 @@ function checkBypass(reqUrl) { return false; } exports.checkBypass = checkBypass; -<<<<<<< HEAD function isLoopbackAddress(host) { const hostLower = host.toLowerCase(); return (hostLower === 'localhost' || @@ -6228,17 +5531,11 @@ function isLoopbackAddress(host) { hostLower.startsWith('[::1]') || hostLower.startsWith('[0:0:0:0:0:0:0:1]')); } -======= ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 //# sourceMappingURL=proxy.js.map /***/ }), -<<<<<<< HEAD -/***/ 84181: -======= -/***/ 63088: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 27503: /***/ ((__unused_webpack_module, exports) => { @@ -6662,11 +5959,7 @@ exports.demangle = demangle; /***/ }), -<<<<<<< HEAD -/***/ 47962: -======= -/***/ 18943: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 21161: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6674,15 +5967,9 @@ exports.demangle = demangle; // SPDX-License-Identifier: Apache-2.0 Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AwsCrc32 = void 0; -<<<<<<< HEAD -var tslib_1 = __nccwpck_require__(30228); -var util_1 = __nccwpck_require__(7919); -var index_1 = __nccwpck_require__(30343); -======= -var tslib_1 = __nccwpck_require__(39385); -var util_1 = __nccwpck_require__(27211); -var index_1 = __nccwpck_require__(51224); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var tslib_1 = __nccwpck_require__(78057); +var util_1 = __nccwpck_require__(41691); +var index_1 = __nccwpck_require__(95736); var AwsCrc32 = /** @class */ (function () { function AwsCrc32() { this.crc32 = new index_1.Crc32(); @@ -6709,23 +5996,14 @@ exports.AwsCrc32 = AwsCrc32; /***/ }), -<<<<<<< HEAD -/***/ 30343: -======= -/***/ 51224: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 95736: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AwsCrc32 = exports.Crc32 = exports.crc32 = void 0; -<<<<<<< HEAD -var tslib_1 = __nccwpck_require__(30228); -var util_1 = __nccwpck_require__(7919); -======= -var tslib_1 = __nccwpck_require__(39385); -var util_1 = __nccwpck_require__(27211); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var tslib_1 = __nccwpck_require__(78057); +var util_1 = __nccwpck_require__(41691); function crc32(data) { return new Crc32().update(data).digest(); } @@ -6826,21 +6104,13 @@ var a_lookUpTable = [ 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D, ]; var lookupTable = (0, util_1.uint32ArrayFrom)(a_lookUpTable); -<<<<<<< HEAD -var aws_crc32_1 = __nccwpck_require__(47962); -======= -var aws_crc32_1 = __nccwpck_require__(18943); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var aws_crc32_1 = __nccwpck_require__(21161); Object.defineProperty(exports, "AwsCrc32", ({ enumerable: true, get: function () { return aws_crc32_1.AwsCrc32; } })); //# sourceMappingURL=index.js.map /***/ }), -<<<<<<< HEAD -/***/ 30228: -======= -/***/ 39385: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 78057: /***/ ((module) => { /*! ***************************************************************************** @@ -7131,11 +6401,7 @@ var __createBinding; /***/ }), -<<<<<<< HEAD -/***/ 4353: -======= -/***/ 95651: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 48932: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -7143,15 +6409,9 @@ var __createBinding; // SPDX-License-Identifier: Apache-2.0 Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AwsCrc32c = void 0; -<<<<<<< HEAD -var tslib_1 = __nccwpck_require__(35315); -var util_1 = __nccwpck_require__(7919); -var index_1 = __nccwpck_require__(21256); -======= -var tslib_1 = __nccwpck_require__(22850); -var util_1 = __nccwpck_require__(27211); -var index_1 = __nccwpck_require__(47003); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var tslib_1 = __nccwpck_require__(98090); +var util_1 = __nccwpck_require__(41691); +var index_1 = __nccwpck_require__(90042); var AwsCrc32c = /** @class */ (function () { function AwsCrc32c() { this.crc32c = new index_1.Crc32c(); @@ -7178,11 +6438,7 @@ exports.AwsCrc32c = AwsCrc32c; /***/ }), -<<<<<<< HEAD -/***/ 21256: -======= -/***/ 47003: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 90042: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -7190,13 +6446,8 @@ exports.AwsCrc32c = AwsCrc32c; // SPDX-License-Identifier: Apache-2.0 Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AwsCrc32c = exports.Crc32c = exports.crc32c = void 0; -<<<<<<< HEAD -var tslib_1 = __nccwpck_require__(35315); -var util_1 = __nccwpck_require__(7919); -======= -var tslib_1 = __nccwpck_require__(22850); -var util_1 = __nccwpck_require__(27211); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var tslib_1 = __nccwpck_require__(98090); +var util_1 = __nccwpck_require__(41691); function crc32c(data) { return new Crc32c().update(data).digest(); } @@ -7265,21 +6516,13 @@ var a_lookupTable = [ 0x79B737BA, 0x8BDCB4B9, 0x988C474D, 0x6AE7C44E, 0xBE2DA0A5, 0x4C4623A6, 0x5F16D052, 0xAD7D5351, ]; var lookupTable = (0, util_1.uint32ArrayFrom)(a_lookupTable); -<<<<<<< HEAD -var aws_crc32c_1 = __nccwpck_require__(4353); -======= -var aws_crc32c_1 = __nccwpck_require__(95651); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var aws_crc32c_1 = __nccwpck_require__(48932); Object.defineProperty(exports, "AwsCrc32c", ({ enumerable: true, get: function () { return aws_crc32c_1.AwsCrc32c; } })); //# sourceMappingURL=index.js.map /***/ }), -<<<<<<< HEAD -/***/ 35315: -======= -/***/ 22850: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 98090: /***/ ((module) => { /*! ***************************************************************************** @@ -7570,11 +6813,7 @@ var __createBinding; /***/ }), -<<<<<<< HEAD -/***/ 46096: -======= -/***/ 41523: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 58952: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -7582,11 +6821,7 @@ var __createBinding; // SPDX-License-Identifier: Apache-2.0 Object.defineProperty(exports, "__esModule", ({ value: true })); exports.convertToBuffer = void 0; -<<<<<<< HEAD -var util_utf8_browser_1 = __nccwpck_require__(77296); -======= -var util_utf8_browser_1 = __nccwpck_require__(83288); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var util_utf8_browser_1 = __nccwpck_require__(32628); // Quick polyfill var fromUtf8 = typeof Buffer !== "undefined" && Buffer.from ? function (input) { return Buffer.from(input, "utf8"); } @@ -7608,11 +6843,7 @@ exports.convertToBuffer = convertToBuffer; /***/ }), -<<<<<<< HEAD -/***/ 7919: -======= -/***/ 27211: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 41691: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -7620,33 +6851,19 @@ exports.convertToBuffer = convertToBuffer; // SPDX-License-Identifier: Apache-2.0 Object.defineProperty(exports, "__esModule", ({ value: true })); exports.uint32ArrayFrom = exports.numToUint8 = exports.isEmptyData = exports.convertToBuffer = void 0; -<<<<<<< HEAD -var convertToBuffer_1 = __nccwpck_require__(46096); +var convertToBuffer_1 = __nccwpck_require__(58952); Object.defineProperty(exports, "convertToBuffer", ({ enumerable: true, get: function () { return convertToBuffer_1.convertToBuffer; } })); -var isEmptyData_1 = __nccwpck_require__(21970); +var isEmptyData_1 = __nccwpck_require__(82207); Object.defineProperty(exports, "isEmptyData", ({ enumerable: true, get: function () { return isEmptyData_1.isEmptyData; } })); -var numToUint8_1 = __nccwpck_require__(49155); +var numToUint8_1 = __nccwpck_require__(20966); Object.defineProperty(exports, "numToUint8", ({ enumerable: true, get: function () { return numToUint8_1.numToUint8; } })); -var uint32ArrayFrom_1 = __nccwpck_require__(3166); -======= -var convertToBuffer_1 = __nccwpck_require__(41523); -Object.defineProperty(exports, "convertToBuffer", ({ enumerable: true, get: function () { return convertToBuffer_1.convertToBuffer; } })); -var isEmptyData_1 = __nccwpck_require__(84783); -Object.defineProperty(exports, "isEmptyData", ({ enumerable: true, get: function () { return isEmptyData_1.isEmptyData; } })); -var numToUint8_1 = __nccwpck_require__(71944); -Object.defineProperty(exports, "numToUint8", ({ enumerable: true, get: function () { return numToUint8_1.numToUint8; } })); -var uint32ArrayFrom_1 = __nccwpck_require__(30129); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var uint32ArrayFrom_1 = __nccwpck_require__(17926); Object.defineProperty(exports, "uint32ArrayFrom", ({ enumerable: true, get: function () { return uint32ArrayFrom_1.uint32ArrayFrom; } })); //# sourceMappingURL=index.js.map /***/ }), -<<<<<<< HEAD -/***/ 21970: -======= -/***/ 84783: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 82207: /***/ ((__unused_webpack_module, exports) => { @@ -7665,11 +6882,7 @@ exports.isEmptyData = isEmptyData; /***/ }), -<<<<<<< HEAD -/***/ 49155: -======= -/***/ 71944: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 20966: /***/ ((__unused_webpack_module, exports) => { @@ -7690,11 +6903,7 @@ exports.numToUint8 = numToUint8; /***/ }), -<<<<<<< HEAD -/***/ 3166: -======= -/***/ 30129: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 17926: /***/ ((__unused_webpack_module, exports) => { @@ -7720,110 +6929,109 @@ exports.uint32ArrayFrom = uint32ArrayFrom; /***/ }), -<<<<<<< HEAD -/***/ 99700: +/***/ 20347: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.S3 = void 0; -const smithy_client_1 = __nccwpck_require__(33218); -const AbortMultipartUploadCommand_1 = __nccwpck_require__(54745); -const CompleteMultipartUploadCommand_1 = __nccwpck_require__(48394); -const CopyObjectCommand_1 = __nccwpck_require__(47241); -const CreateBucketCommand_1 = __nccwpck_require__(37648); -const CreateMultipartUploadCommand_1 = __nccwpck_require__(51963); -const CreateSessionCommand_1 = __nccwpck_require__(47209); -const DeleteBucketAnalyticsConfigurationCommand_1 = __nccwpck_require__(26373); -const DeleteBucketCommand_1 = __nccwpck_require__(40235); -const DeleteBucketCorsCommand_1 = __nccwpck_require__(12335); -const DeleteBucketEncryptionCommand_1 = __nccwpck_require__(13305); -const DeleteBucketIntelligentTieringConfigurationCommand_1 = __nccwpck_require__(87902); -const DeleteBucketInventoryConfigurationCommand_1 = __nccwpck_require__(4642); -const DeleteBucketLifecycleCommand_1 = __nccwpck_require__(56903); -const DeleteBucketMetricsConfigurationCommand_1 = __nccwpck_require__(70617); -const DeleteBucketOwnershipControlsCommand_1 = __nccwpck_require__(96947); -const DeleteBucketPolicyCommand_1 = __nccwpck_require__(24789); -const DeleteBucketReplicationCommand_1 = __nccwpck_require__(14412); -const DeleteBucketTaggingCommand_1 = __nccwpck_require__(89218); -const DeleteBucketWebsiteCommand_1 = __nccwpck_require__(36069); -const DeleteObjectCommand_1 = __nccwpck_require__(84529); -const DeleteObjectsCommand_1 = __nccwpck_require__(17735); -const DeleteObjectTaggingCommand_1 = __nccwpck_require__(87937); -const DeletePublicAccessBlockCommand_1 = __nccwpck_require__(8063); -const GetBucketAccelerateConfigurationCommand_1 = __nccwpck_require__(95005); -const GetBucketAclCommand_1 = __nccwpck_require__(59650); -const GetBucketAnalyticsConfigurationCommand_1 = __nccwpck_require__(5689); -const GetBucketCorsCommand_1 = __nccwpck_require__(43088); -const GetBucketEncryptionCommand_1 = __nccwpck_require__(53637); -const GetBucketIntelligentTieringConfigurationCommand_1 = __nccwpck_require__(39216); -const GetBucketInventoryConfigurationCommand_1 = __nccwpck_require__(69553); -const GetBucketLifecycleConfigurationCommand_1 = __nccwpck_require__(30426); -const GetBucketLocationCommand_1 = __nccwpck_require__(60074); -const GetBucketLoggingCommand_1 = __nccwpck_require__(5152); -const GetBucketMetricsConfigurationCommand_1 = __nccwpck_require__(97986); -const GetBucketNotificationConfigurationCommand_1 = __nccwpck_require__(31857); -const GetBucketOwnershipControlsCommand_1 = __nccwpck_require__(90940); -const GetBucketPolicyCommand_1 = __nccwpck_require__(46067); -const GetBucketPolicyStatusCommand_1 = __nccwpck_require__(77093); -const GetBucketReplicationCommand_1 = __nccwpck_require__(36675); -const GetBucketRequestPaymentCommand_1 = __nccwpck_require__(98115); -const GetBucketTaggingCommand_1 = __nccwpck_require__(61300); -const GetBucketVersioningCommand_1 = __nccwpck_require__(90894); -const GetBucketWebsiteCommand_1 = __nccwpck_require__(58382); -const GetObjectAclCommand_1 = __nccwpck_require__(8732); -const GetObjectAttributesCommand_1 = __nccwpck_require__(65852); -const GetObjectCommand_1 = __nccwpck_require__(70184); -const GetObjectLegalHoldCommand_1 = __nccwpck_require__(7017); -const GetObjectLockConfigurationCommand_1 = __nccwpck_require__(87797); -const GetObjectRetentionCommand_1 = __nccwpck_require__(18426); -const GetObjectTaggingCommand_1 = __nccwpck_require__(28754); -const GetObjectTorrentCommand_1 = __nccwpck_require__(66888); -const GetPublicAccessBlockCommand_1 = __nccwpck_require__(22223); -const HeadBucketCommand_1 = __nccwpck_require__(93946); -const HeadObjectCommand_1 = __nccwpck_require__(61280); -const ListBucketAnalyticsConfigurationsCommand_1 = __nccwpck_require__(88519); -const ListBucketIntelligentTieringConfigurationsCommand_1 = __nccwpck_require__(34871); -const ListBucketInventoryConfigurationsCommand_1 = __nccwpck_require__(7739); -const ListBucketMetricsConfigurationsCommand_1 = __nccwpck_require__(87086); -const ListBucketsCommand_1 = __nccwpck_require__(23261); -const ListDirectoryBucketsCommand_1 = __nccwpck_require__(38902); -const ListMultipartUploadsCommand_1 = __nccwpck_require__(20678); -const ListObjectsCommand_1 = __nccwpck_require__(30494); -const ListObjectsV2Command_1 = __nccwpck_require__(57262); -const ListObjectVersionsCommand_1 = __nccwpck_require__(95992); -const ListPartsCommand_1 = __nccwpck_require__(68740); -const PutBucketAccelerateConfigurationCommand_1 = __nccwpck_require__(52582); -const PutBucketAclCommand_1 = __nccwpck_require__(18785); -const PutBucketAnalyticsConfigurationCommand_1 = __nccwpck_require__(23562); -const PutBucketCorsCommand_1 = __nccwpck_require__(68524); -const PutBucketEncryptionCommand_1 = __nccwpck_require__(95647); -const PutBucketIntelligentTieringConfigurationCommand_1 = __nccwpck_require__(53359); -const PutBucketInventoryConfigurationCommand_1 = __nccwpck_require__(15119); -const PutBucketLifecycleConfigurationCommand_1 = __nccwpck_require__(37659); -const PutBucketLoggingCommand_1 = __nccwpck_require__(64879); -const PutBucketMetricsConfigurationCommand_1 = __nccwpck_require__(36122); -const PutBucketNotificationConfigurationCommand_1 = __nccwpck_require__(23762); -const PutBucketOwnershipControlsCommand_1 = __nccwpck_require__(27055); -const PutBucketPolicyCommand_1 = __nccwpck_require__(23598); -const PutBucketReplicationCommand_1 = __nccwpck_require__(42596); -const PutBucketRequestPaymentCommand_1 = __nccwpck_require__(12265); -const PutBucketTaggingCommand_1 = __nccwpck_require__(22745); -const PutBucketVersioningCommand_1 = __nccwpck_require__(44671); -const PutBucketWebsiteCommand_1 = __nccwpck_require__(27890); -const PutObjectAclCommand_1 = __nccwpck_require__(83533); -const PutObjectCommand_1 = __nccwpck_require__(84520); -const PutObjectLegalHoldCommand_1 = __nccwpck_require__(57296); -const PutObjectLockConfigurationCommand_1 = __nccwpck_require__(15905); -const PutObjectRetentionCommand_1 = __nccwpck_require__(90936); -const PutObjectTaggingCommand_1 = __nccwpck_require__(13844); -const PutPublicAccessBlockCommand_1 = __nccwpck_require__(52786); -const RestoreObjectCommand_1 = __nccwpck_require__(15426); -const SelectObjectContentCommand_1 = __nccwpck_require__(26808); -const UploadPartCommand_1 = __nccwpck_require__(64325); -const UploadPartCopyCommand_1 = __nccwpck_require__(72251); -const WriteGetObjectResponseCommand_1 = __nccwpck_require__(15173); -const S3Client_1 = __nccwpck_require__(34692); +const smithy_client_1 = __nccwpck_require__(42584); +const AbortMultipartUploadCommand_1 = __nccwpck_require__(78016); +const CompleteMultipartUploadCommand_1 = __nccwpck_require__(97814); +const CopyObjectCommand_1 = __nccwpck_require__(70231); +const CreateBucketCommand_1 = __nccwpck_require__(66922); +const CreateMultipartUploadCommand_1 = __nccwpck_require__(85669); +const CreateSessionCommand_1 = __nccwpck_require__(2556); +const DeleteBucketAnalyticsConfigurationCommand_1 = __nccwpck_require__(88525); +const DeleteBucketCommand_1 = __nccwpck_require__(58086); +const DeleteBucketCorsCommand_1 = __nccwpck_require__(57021); +const DeleteBucketEncryptionCommand_1 = __nccwpck_require__(41793); +const DeleteBucketIntelligentTieringConfigurationCommand_1 = __nccwpck_require__(86344); +const DeleteBucketInventoryConfigurationCommand_1 = __nccwpck_require__(82045); +const DeleteBucketLifecycleCommand_1 = __nccwpck_require__(91051); +const DeleteBucketMetricsConfigurationCommand_1 = __nccwpck_require__(28487); +const DeleteBucketOwnershipControlsCommand_1 = __nccwpck_require__(6859); +const DeleteBucketPolicyCommand_1 = __nccwpck_require__(31794); +const DeleteBucketReplicationCommand_1 = __nccwpck_require__(49991); +const DeleteBucketTaggingCommand_1 = __nccwpck_require__(30265); +const DeleteBucketWebsiteCommand_1 = __nccwpck_require__(11644); +const DeleteObjectCommand_1 = __nccwpck_require__(33195); +const DeleteObjectsCommand_1 = __nccwpck_require__(9733); +const DeleteObjectTaggingCommand_1 = __nccwpck_require__(93360); +const DeletePublicAccessBlockCommand_1 = __nccwpck_require__(19183); +const GetBucketAccelerateConfigurationCommand_1 = __nccwpck_require__(77914); +const GetBucketAclCommand_1 = __nccwpck_require__(16009); +const GetBucketAnalyticsConfigurationCommand_1 = __nccwpck_require__(91903); +const GetBucketCorsCommand_1 = __nccwpck_require__(33400); +const GetBucketEncryptionCommand_1 = __nccwpck_require__(30530); +const GetBucketIntelligentTieringConfigurationCommand_1 = __nccwpck_require__(48344); +const GetBucketInventoryConfigurationCommand_1 = __nccwpck_require__(84929); +const GetBucketLifecycleConfigurationCommand_1 = __nccwpck_require__(73162); +const GetBucketLocationCommand_1 = __nccwpck_require__(92099); +const GetBucketLoggingCommand_1 = __nccwpck_require__(16092); +const GetBucketMetricsConfigurationCommand_1 = __nccwpck_require__(64711); +const GetBucketNotificationConfigurationCommand_1 = __nccwpck_require__(87118); +const GetBucketOwnershipControlsCommand_1 = __nccwpck_require__(36655); +const GetBucketPolicyCommand_1 = __nccwpck_require__(32504); +const GetBucketPolicyStatusCommand_1 = __nccwpck_require__(50321); +const GetBucketReplicationCommand_1 = __nccwpck_require__(50656); +const GetBucketRequestPaymentCommand_1 = __nccwpck_require__(73192); +const GetBucketTaggingCommand_1 = __nccwpck_require__(84276); +const GetBucketVersioningCommand_1 = __nccwpck_require__(91859); +const GetBucketWebsiteCommand_1 = __nccwpck_require__(56490); +const GetObjectAclCommand_1 = __nccwpck_require__(89030); +const GetObjectAttributesCommand_1 = __nccwpck_require__(88738); +const GetObjectCommand_1 = __nccwpck_require__(30878); +const GetObjectLegalHoldCommand_1 = __nccwpck_require__(46039); +const GetObjectLockConfigurationCommand_1 = __nccwpck_require__(78947); +const GetObjectRetentionCommand_1 = __nccwpck_require__(79113); +const GetObjectTaggingCommand_1 = __nccwpck_require__(94764); +const GetObjectTorrentCommand_1 = __nccwpck_require__(76662); +const GetPublicAccessBlockCommand_1 = __nccwpck_require__(76694); +const HeadBucketCommand_1 = __nccwpck_require__(74430); +const HeadObjectCommand_1 = __nccwpck_require__(65482); +const ListBucketAnalyticsConfigurationsCommand_1 = __nccwpck_require__(71284); +const ListBucketIntelligentTieringConfigurationsCommand_1 = __nccwpck_require__(62643); +const ListBucketInventoryConfigurationsCommand_1 = __nccwpck_require__(15824); +const ListBucketMetricsConfigurationsCommand_1 = __nccwpck_require__(34324); +const ListBucketsCommand_1 = __nccwpck_require__(5258); +const ListDirectoryBucketsCommand_1 = __nccwpck_require__(41730); +const ListMultipartUploadsCommand_1 = __nccwpck_require__(23308); +const ListObjectsCommand_1 = __nccwpck_require__(84211); +const ListObjectsV2Command_1 = __nccwpck_require__(14116); +const ListObjectVersionsCommand_1 = __nccwpck_require__(27720); +const ListPartsCommand_1 = __nccwpck_require__(65560); +const PutBucketAccelerateConfigurationCommand_1 = __nccwpck_require__(59008); +const PutBucketAclCommand_1 = __nccwpck_require__(16314); +const PutBucketAnalyticsConfigurationCommand_1 = __nccwpck_require__(3819); +const PutBucketCorsCommand_1 = __nccwpck_require__(16377); +const PutBucketEncryptionCommand_1 = __nccwpck_require__(39608); +const PutBucketIntelligentTieringConfigurationCommand_1 = __nccwpck_require__(50906); +const PutBucketInventoryConfigurationCommand_1 = __nccwpck_require__(31396); +const PutBucketLifecycleConfigurationCommand_1 = __nccwpck_require__(5959); +const PutBucketLoggingCommand_1 = __nccwpck_require__(63127); +const PutBucketMetricsConfigurationCommand_1 = __nccwpck_require__(28041); +const PutBucketNotificationConfigurationCommand_1 = __nccwpck_require__(94627); +const PutBucketOwnershipControlsCommand_1 = __nccwpck_require__(67602); +const PutBucketPolicyCommand_1 = __nccwpck_require__(82059); +const PutBucketReplicationCommand_1 = __nccwpck_require__(35612); +const PutBucketRequestPaymentCommand_1 = __nccwpck_require__(6787); +const PutBucketTaggingCommand_1 = __nccwpck_require__(69549); +const PutBucketVersioningCommand_1 = __nccwpck_require__(28788); +const PutBucketWebsiteCommand_1 = __nccwpck_require__(35621); +const PutObjectAclCommand_1 = __nccwpck_require__(15864); +const PutObjectCommand_1 = __nccwpck_require__(17747); +const PutObjectLegalHoldCommand_1 = __nccwpck_require__(77531); +const PutObjectLockConfigurationCommand_1 = __nccwpck_require__(86480); +const PutObjectRetentionCommand_1 = __nccwpck_require__(7427); +const PutObjectTaggingCommand_1 = __nccwpck_require__(52400); +const PutPublicAccessBlockCommand_1 = __nccwpck_require__(213); +const RestoreObjectCommand_1 = __nccwpck_require__(99112); +const SelectObjectContentCommand_1 = __nccwpck_require__(37945); +const UploadPartCommand_1 = __nccwpck_require__(28330); +const UploadPartCopyCommand_1 = __nccwpck_require__(56237); +const WriteGetObjectResponseCommand_1 = __nccwpck_require__(12915); +const S3Client_1 = __nccwpck_require__(26625); const commands = { AbortMultipartUploadCommand: AbortMultipartUploadCommand_1.AbortMultipartUploadCommand, CompleteMultipartUploadCommand: CompleteMultipartUploadCommand_1.CompleteMultipartUploadCommand, @@ -7921,499 +7129,6 @@ const commands = { UploadPartCopyCommand: UploadPartCopyCommand_1.UploadPartCopyCommand, WriteGetObjectResponseCommand: WriteGetObjectResponseCommand_1.WriteGetObjectResponseCommand, }; -======= -/***/ 3969: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AbortController = void 0; -const AbortSignal_1 = __nccwpck_require__(63589); -class AbortController { - constructor() { - this.signal = new AbortSignal_1.AbortSignal(); - } - abort() { - this.signal.abort(); - } -} -exports.AbortController = AbortController; - - -/***/ }), - -/***/ 63589: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AbortSignal = void 0; -class AbortSignal { - constructor() { - this.onabort = null; - this._aborted = false; - Object.defineProperty(this, "_aborted", { - value: false, - writable: true, - }); - } - get aborted() { - return this._aborted; - } - abort() { - this._aborted = true; - if (this.onabort) { - this.onabort(this); - this.onabort = null; - } - } -} -exports.AbortSignal = AbortSignal; - - -/***/ }), - -/***/ 13391: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(94513); -tslib_1.__exportStar(__nccwpck_require__(3969), exports); -tslib_1.__exportStar(__nccwpck_require__(63589), exports); - - -/***/ }), - -/***/ 94513: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); - - -/***/ }), - -/***/ 10223: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.S3 = void 0; -const AbortMultipartUploadCommand_1 = __nccwpck_require__(18605); -const CompleteMultipartUploadCommand_1 = __nccwpck_require__(90130); -const CopyObjectCommand_1 = __nccwpck_require__(14578); -const CreateBucketCommand_1 = __nccwpck_require__(84579); -const CreateMultipartUploadCommand_1 = __nccwpck_require__(80369); -const DeleteBucketAnalyticsConfigurationCommand_1 = __nccwpck_require__(20325); -const DeleteBucketCommand_1 = __nccwpck_require__(41253); -const DeleteBucketCorsCommand_1 = __nccwpck_require__(68989); -const DeleteBucketEncryptionCommand_1 = __nccwpck_require__(35734); -const DeleteBucketIntelligentTieringConfigurationCommand_1 = __nccwpck_require__(17837); -const DeleteBucketInventoryConfigurationCommand_1 = __nccwpck_require__(27350); -const DeleteBucketLifecycleCommand_1 = __nccwpck_require__(93386); -const DeleteBucketMetricsConfigurationCommand_1 = __nccwpck_require__(14002); -const DeleteBucketOwnershipControlsCommand_1 = __nccwpck_require__(75145); -const DeleteBucketPolicyCommand_1 = __nccwpck_require__(72768); -const DeleteBucketReplicationCommand_1 = __nccwpck_require__(59847); -const DeleteBucketTaggingCommand_1 = __nccwpck_require__(54231); -const DeleteBucketWebsiteCommand_1 = __nccwpck_require__(35795); -const DeleteObjectCommand_1 = __nccwpck_require__(13135); -const DeleteObjectsCommand_1 = __nccwpck_require__(49810); -const DeleteObjectTaggingCommand_1 = __nccwpck_require__(40054); -const DeletePublicAccessBlockCommand_1 = __nccwpck_require__(33680); -const GetBucketAccelerateConfigurationCommand_1 = __nccwpck_require__(74750); -const GetBucketAclCommand_1 = __nccwpck_require__(44423); -const GetBucketAnalyticsConfigurationCommand_1 = __nccwpck_require__(84379); -const GetBucketCorsCommand_1 = __nccwpck_require__(88954); -const GetBucketEncryptionCommand_1 = __nccwpck_require__(30882); -const GetBucketIntelligentTieringConfigurationCommand_1 = __nccwpck_require__(5604); -const GetBucketInventoryConfigurationCommand_1 = __nccwpck_require__(90152); -const GetBucketLifecycleConfigurationCommand_1 = __nccwpck_require__(51601); -const GetBucketLocationCommand_1 = __nccwpck_require__(8212); -const GetBucketLoggingCommand_1 = __nccwpck_require__(94953); -const GetBucketMetricsConfigurationCommand_1 = __nccwpck_require__(86801); -const GetBucketNotificationConfigurationCommand_1 = __nccwpck_require__(96677); -const GetBucketOwnershipControlsCommand_1 = __nccwpck_require__(94801); -const GetBucketPolicyCommand_1 = __nccwpck_require__(92799); -const GetBucketPolicyStatusCommand_1 = __nccwpck_require__(54619); -const GetBucketReplicationCommand_1 = __nccwpck_require__(31593); -const GetBucketRequestPaymentCommand_1 = __nccwpck_require__(42641); -const GetBucketTaggingCommand_1 = __nccwpck_require__(82404); -const GetBucketVersioningCommand_1 = __nccwpck_require__(37097); -const GetBucketWebsiteCommand_1 = __nccwpck_require__(68163); -const GetObjectAclCommand_1 = __nccwpck_require__(24410); -const GetObjectAttributesCommand_1 = __nccwpck_require__(61105); -const GetObjectCommand_1 = __nccwpck_require__(5846); -const GetObjectLegalHoldCommand_1 = __nccwpck_require__(99937); -const GetObjectLockConfigurationCommand_1 = __nccwpck_require__(67846); -const GetObjectRetentionCommand_1 = __nccwpck_require__(13037); -const GetObjectTaggingCommand_1 = __nccwpck_require__(41222); -const GetObjectTorrentCommand_1 = __nccwpck_require__(65068); -const GetPublicAccessBlockCommand_1 = __nccwpck_require__(68639); -const HeadBucketCommand_1 = __nccwpck_require__(6005); -const HeadObjectCommand_1 = __nccwpck_require__(49553); -const ListBucketAnalyticsConfigurationsCommand_1 = __nccwpck_require__(85121); -const ListBucketIntelligentTieringConfigurationsCommand_1 = __nccwpck_require__(24956); -const ListBucketInventoryConfigurationsCommand_1 = __nccwpck_require__(78015); -const ListBucketMetricsConfigurationsCommand_1 = __nccwpck_require__(73116); -const ListBucketsCommand_1 = __nccwpck_require__(85333); -const ListMultipartUploadsCommand_1 = __nccwpck_require__(28427); -const ListObjectsCommand_1 = __nccwpck_require__(1702); -const ListObjectsV2Command_1 = __nccwpck_require__(33259); -const ListObjectVersionsCommand_1 = __nccwpck_require__(29049); -const ListPartsCommand_1 = __nccwpck_require__(83080); -const PutBucketAccelerateConfigurationCommand_1 = __nccwpck_require__(28257); -const PutBucketAclCommand_1 = __nccwpck_require__(90276); -const PutBucketAnalyticsConfigurationCommand_1 = __nccwpck_require__(21754); -const PutBucketCorsCommand_1 = __nccwpck_require__(78085); -const PutBucketEncryptionCommand_1 = __nccwpck_require__(12713); -const PutBucketIntelligentTieringConfigurationCommand_1 = __nccwpck_require__(10561); -const PutBucketInventoryConfigurationCommand_1 = __nccwpck_require__(74588); -const PutBucketLifecycleConfigurationCommand_1 = __nccwpck_require__(99247); -const PutBucketLoggingCommand_1 = __nccwpck_require__(71745); -const PutBucketMetricsConfigurationCommand_1 = __nccwpck_require__(62260); -const PutBucketNotificationConfigurationCommand_1 = __nccwpck_require__(19700); -const PutBucketOwnershipControlsCommand_1 = __nccwpck_require__(89352); -const PutBucketPolicyCommand_1 = __nccwpck_require__(22417); -const PutBucketReplicationCommand_1 = __nccwpck_require__(94943); -const PutBucketRequestPaymentCommand_1 = __nccwpck_require__(94483); -const PutBucketTaggingCommand_1 = __nccwpck_require__(90815); -const PutBucketVersioningCommand_1 = __nccwpck_require__(77437); -const PutBucketWebsiteCommand_1 = __nccwpck_require__(54229); -const PutObjectAclCommand_1 = __nccwpck_require__(33492); -const PutObjectCommand_1 = __nccwpck_require__(8000); -const PutObjectLegalHoldCommand_1 = __nccwpck_require__(15); -const PutObjectLockConfigurationCommand_1 = __nccwpck_require__(77692); -const PutObjectRetentionCommand_1 = __nccwpck_require__(33946); -const PutObjectTaggingCommand_1 = __nccwpck_require__(84707); -const PutPublicAccessBlockCommand_1 = __nccwpck_require__(69104); -const RestoreObjectCommand_1 = __nccwpck_require__(43661); -const SelectObjectContentCommand_1 = __nccwpck_require__(84142); -const UploadPartCommand_1 = __nccwpck_require__(52667); -const UploadPartCopyCommand_1 = __nccwpck_require__(57045); -const WriteGetObjectResponseCommand_1 = __nccwpck_require__(63803); -const S3Client_1 = __nccwpck_require__(17824); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 class S3 extends S3Client_1.S3Client { } exports.S3 = S3; @@ -8422,52 +7137,30 @@ exports.S3 = S3; /***/ }), -<<<<<<< HEAD -/***/ 34692: -======= -/***/ 17824: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 26625: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.S3Client = exports.__Client = void 0; -const middleware_expect_continue_1 = __nccwpck_require__(17335); -const middleware_host_header_1 = __nccwpck_require__(23213); -const middleware_logger_1 = __nccwpck_require__(45288); -const middleware_recursion_detection_1 = __nccwpck_require__(13807); -const middleware_sdk_s3_1 = __nccwpck_require__(52776); -const middleware_signing_1 = __nccwpck_require__(25050); -const middleware_user_agent_1 = __nccwpck_require__(3549); -const config_resolver_1 = __nccwpck_require__(66041); -const eventstream_serde_config_resolver_1 = __nccwpck_require__(33299); -const middleware_content_length_1 = __nccwpck_require__(38959); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_retry_1 = __nccwpck_require__(54801); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_expect_continue_1 = __nccwpck_require__(38433); +const middleware_host_header_1 = __nccwpck_require__(29368); +const middleware_logger_1 = __nccwpck_require__(11810); +const middleware_recursion_detection_1 = __nccwpck_require__(65185); +const middleware_sdk_s3_1 = __nccwpck_require__(39069); +const middleware_signing_1 = __nccwpck_require__(1223); +const middleware_user_agent_1 = __nccwpck_require__(7524); +const config_resolver_1 = __nccwpck_require__(36407); +const eventstream_serde_config_resolver_1 = __nccwpck_require__(41350); +const middleware_content_length_1 = __nccwpck_require__(48468); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_retry_1 = __nccwpck_require__(73739); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "__Client", ({ enumerable: true, get: function () { return smithy_client_1.Client; } })); -const CreateSessionCommand_1 = __nccwpck_require__(47209); -const EndpointParameters_1 = __nccwpck_require__(28409); -const runtimeConfig_1 = __nccwpck_require__(12909); -const runtimeExtensions_1 = __nccwpck_require__(89243); -======= -exports.S3Client = void 0; -const config_resolver_1 = __nccwpck_require__(95406); -const eventstream_serde_config_resolver_1 = __nccwpck_require__(41237); -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_content_length_1 = __nccwpck_require__(96962); -const middleware_expect_continue_1 = __nccwpck_require__(57411); -const middleware_host_header_1 = __nccwpck_require__(18127); -const middleware_logger_1 = __nccwpck_require__(67662); -const middleware_recursion_detection_1 = __nccwpck_require__(34755); -const middleware_retry_1 = __nccwpck_require__(9352); -const middleware_sdk_s3_1 = __nccwpck_require__(60444); -const middleware_signing_1 = __nccwpck_require__(33233); -const middleware_user_agent_1 = __nccwpck_require__(54738); -const smithy_client_1 = __nccwpck_require__(26351); -const runtimeConfig_1 = __nccwpck_require__(94382); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const CreateSessionCommand_1 = __nccwpck_require__(2556); +const EndpointParameters_1 = __nccwpck_require__(95570); +const runtimeConfig_1 = __nccwpck_require__(1350); +const runtimeExtensions_1 = __nccwpck_require__(24582); class S3Client extends smithy_client_1.Client { constructor(...[configuration]) { const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {}); @@ -8504,31 +7197,18 @@ exports.S3Client = S3Client; /***/ }), -<<<<<<< HEAD -/***/ 54745: -======= -/***/ 18605: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 78016: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.AbortMultipartUploadCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.AbortMultipartUploadCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class AbortMultipartUploadCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -8583,36 +7263,21 @@ exports.AbortMultipartUploadCommand = AbortMultipartUploadCommand; /***/ }), -<<<<<<< HEAD -/***/ 48394: -======= -/***/ 90130: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 97814: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.CompleteMultipartUploadCommand = exports.$Command = void 0; -const middleware_sdk_s3_1 = __nccwpck_require__(52776); -const middleware_ssec_1 = __nccwpck_require__(33563); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_sdk_s3_1 = __nccwpck_require__(39069); +const middleware_ssec_1 = __nccwpck_require__(20484); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(22729); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.CompleteMultipartUploadCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_sdk_s3_1 = __nccwpck_require__(60444); -const middleware_serde_1 = __nccwpck_require__(44695); -const middleware_ssec_1 = __nccwpck_require__(58483); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(2384); +const Aws_restXml_1 = __nccwpck_require__(45028); class CompleteMultipartUploadCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -8669,36 +7334,21 @@ exports.CompleteMultipartUploadCommand = CompleteMultipartUploadCommand; /***/ }), -<<<<<<< HEAD -/***/ 47241: -======= -/***/ 14578: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 70231: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.CopyObjectCommand = exports.$Command = void 0; -const middleware_sdk_s3_1 = __nccwpck_require__(52776); -const middleware_ssec_1 = __nccwpck_require__(33563); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_sdk_s3_1 = __nccwpck_require__(39069); +const middleware_ssec_1 = __nccwpck_require__(20484); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(22729); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.CopyObjectCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_sdk_s3_1 = __nccwpck_require__(60444); -const middleware_serde_1 = __nccwpck_require__(44695); -const middleware_ssec_1 = __nccwpck_require__(58483); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(2384); +const Aws_restXml_1 = __nccwpck_require__(45028); class CopyObjectCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -8754,32 +7404,19 @@ exports.CopyObjectCommand = CopyObjectCommand; /***/ }), -<<<<<<< HEAD -/***/ 37648: -======= -/***/ 84579: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 66922: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.CreateBucketCommand = exports.$Command = void 0; -const middleware_location_constraint_1 = __nccwpck_require__(0); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_location_constraint_1 = __nccwpck_require__(52499); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.CreateBucketCommand = void 0; -const middleware_location_constraint_1 = __nccwpck_require__(13882); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class CreateBucketCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -8836,34 +7473,20 @@ exports.CreateBucketCommand = CreateBucketCommand; /***/ }), -<<<<<<< HEAD -/***/ 51963: -======= -/***/ 80369: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 85669: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.CreateMultipartUploadCommand = exports.$Command = void 0; -const middleware_ssec_1 = __nccwpck_require__(33563); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_ssec_1 = __nccwpck_require__(20484); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(22729); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.CreateMultipartUploadCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const middleware_ssec_1 = __nccwpck_require__(58483); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(2384); +const Aws_restXml_1 = __nccwpck_require__(45028); class CreateMultipartUploadCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -8919,24 +7542,19 @@ exports.CreateMultipartUploadCommand = CreateMultipartUploadCommand; /***/ }), -<<<<<<< HEAD -/***/ 47209: -======= -/***/ 20325: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 2556: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.CreateSessionCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(22729); -const Aws_restXml_1 = __nccwpck_require__(70395); +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(2384); +const Aws_restXml_1 = __nccwpck_require__(45028); class CreateSessionCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -8953,15 +7571,6 @@ class CreateSessionCommand extends smithy_client_1.Command { UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, }; } -======= -exports.DeleteBucketAnalyticsConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); -class DeleteBucketAnalyticsConfigurationCommand extends smithy_client_1.Command { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 constructor(input) { super(); this.input = input; @@ -8999,18 +7608,18 @@ exports.CreateSessionCommand = CreateSessionCommand; /***/ }), -/***/ 26373: +/***/ 88525: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DeleteBucketAnalyticsConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class DeleteBucketAnalyticsConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -9065,30 +7674,18 @@ exports.DeleteBucketAnalyticsConfigurationCommand = DeleteBucketAnalyticsConfigu /***/ }), -<<<<<<< HEAD -/***/ 40235: -======= -/***/ 41253: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 58086: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.DeleteBucketCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.DeleteBucketCommand = void 0; -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class DeleteBucketCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -9143,31 +7740,18 @@ exports.DeleteBucketCommand = DeleteBucketCommand; /***/ }), -<<<<<<< HEAD -/***/ 12335: -======= -/***/ 68989: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 57021: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.DeleteBucketCorsCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.DeleteBucketCorsCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class DeleteBucketCorsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -9222,31 +7806,18 @@ exports.DeleteBucketCorsCommand = DeleteBucketCorsCommand; /***/ }), -<<<<<<< HEAD -/***/ 13305: -======= -/***/ 35734: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 41793: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.DeleteBucketEncryptionCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.DeleteBucketEncryptionCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class DeleteBucketEncryptionCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -9301,31 +7872,18 @@ exports.DeleteBucketEncryptionCommand = DeleteBucketEncryptionCommand; /***/ }), -<<<<<<< HEAD -/***/ 87902: -======= -/***/ 17837: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 86344: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.DeleteBucketIntelligentTieringConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.DeleteBucketIntelligentTieringConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class DeleteBucketIntelligentTieringConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -9380,31 +7938,18 @@ exports.DeleteBucketIntelligentTieringConfigurationCommand = DeleteBucketIntelli /***/ }), -<<<<<<< HEAD -/***/ 4642: -======= -/***/ 27350: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 82045: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.DeleteBucketInventoryConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.DeleteBucketInventoryConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class DeleteBucketInventoryConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -9459,31 +8004,18 @@ exports.DeleteBucketInventoryConfigurationCommand = DeleteBucketInventoryConfigu /***/ }), -<<<<<<< HEAD -/***/ 56903: -======= -/***/ 93386: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 91051: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.DeleteBucketLifecycleCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.DeleteBucketLifecycleCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class DeleteBucketLifecycleCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -9538,31 +8070,18 @@ exports.DeleteBucketLifecycleCommand = DeleteBucketLifecycleCommand; /***/ }), -<<<<<<< HEAD -/***/ 70617: -======= -/***/ 14002: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 28487: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.DeleteBucketMetricsConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.DeleteBucketMetricsConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class DeleteBucketMetricsConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -9617,31 +8136,18 @@ exports.DeleteBucketMetricsConfigurationCommand = DeleteBucketMetricsConfigurati /***/ }), -<<<<<<< HEAD -/***/ 96947: -======= -/***/ 75145: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 6859: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.DeleteBucketOwnershipControlsCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.DeleteBucketOwnershipControlsCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class DeleteBucketOwnershipControlsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -9696,31 +8202,18 @@ exports.DeleteBucketOwnershipControlsCommand = DeleteBucketOwnershipControlsComm /***/ }), -<<<<<<< HEAD -/***/ 24789: -======= -/***/ 72768: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 31794: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.DeleteBucketPolicyCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.DeleteBucketPolicyCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class DeleteBucketPolicyCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -9775,31 +8268,18 @@ exports.DeleteBucketPolicyCommand = DeleteBucketPolicyCommand; /***/ }), -<<<<<<< HEAD -/***/ 14412: -======= -/***/ 59847: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 49991: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.DeleteBucketReplicationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.DeleteBucketReplicationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class DeleteBucketReplicationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -9854,31 +8334,18 @@ exports.DeleteBucketReplicationCommand = DeleteBucketReplicationCommand; /***/ }), -<<<<<<< HEAD -/***/ 89218: -======= -/***/ 54231: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 30265: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.DeleteBucketTaggingCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.DeleteBucketTaggingCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class DeleteBucketTaggingCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -9933,31 +8400,18 @@ exports.DeleteBucketTaggingCommand = DeleteBucketTaggingCommand; /***/ }), -<<<<<<< HEAD -/***/ 36069: -======= -/***/ 35795: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 11644: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.DeleteBucketWebsiteCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.DeleteBucketWebsiteCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class DeleteBucketWebsiteCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -10012,31 +8466,18 @@ exports.DeleteBucketWebsiteCommand = DeleteBucketWebsiteCommand; /***/ }), -<<<<<<< HEAD -/***/ 84529: -======= -/***/ 13135: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 33195: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.DeleteObjectCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.DeleteObjectCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class DeleteObjectCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -10091,31 +8532,18 @@ exports.DeleteObjectCommand = DeleteObjectCommand; /***/ }), -<<<<<<< HEAD -/***/ 87937: -======= -/***/ 40054: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 93360: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.DeleteObjectTaggingCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.DeleteObjectTaggingCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class DeleteObjectTaggingCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -10169,33 +8597,19 @@ exports.DeleteObjectTaggingCommand = DeleteObjectTaggingCommand; /***/ }), -<<<<<<< HEAD -/***/ 17735: -======= -/***/ 49810: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 9733: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.DeleteObjectsCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.DeleteObjectsCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class DeleteObjectsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -10254,31 +8668,18 @@ exports.DeleteObjectsCommand = DeleteObjectsCommand; /***/ }), -<<<<<<< HEAD -/***/ 8063: -======= -/***/ 33680: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 19183: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.DeletePublicAccessBlockCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.DeletePublicAccessBlockCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class DeletePublicAccessBlockCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -10333,31 +8734,18 @@ exports.DeletePublicAccessBlockCommand = DeletePublicAccessBlockCommand; /***/ }), -<<<<<<< HEAD -/***/ 95005: -======= -/***/ 74750: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 77914: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketAccelerateConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketAccelerateConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketAccelerateConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -10412,31 +8800,18 @@ exports.GetBucketAccelerateConfigurationCommand = GetBucketAccelerateConfigurati /***/ }), -<<<<<<< HEAD -/***/ 59650: -======= -/***/ 44423: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 16009: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketAclCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketAclCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketAclCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -10491,31 +8866,18 @@ exports.GetBucketAclCommand = GetBucketAclCommand; /***/ }), -<<<<<<< HEAD -/***/ 5689: -======= -/***/ 84379: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 91903: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketAnalyticsConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketAnalyticsConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketAnalyticsConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -10570,31 +8932,18 @@ exports.GetBucketAnalyticsConfigurationCommand = GetBucketAnalyticsConfiguration /***/ }), -<<<<<<< HEAD -/***/ 43088: -======= -/***/ 88954: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 33400: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketCorsCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketCorsCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketCorsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -10649,32 +8998,19 @@ exports.GetBucketCorsCommand = GetBucketCorsCommand; /***/ }), -<<<<<<< HEAD -/***/ 53637: -======= -/***/ 30882: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 30530: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketEncryptionCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(22729); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketEncryptionCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(2384); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketEncryptionCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -10729,31 +9065,18 @@ exports.GetBucketEncryptionCommand = GetBucketEncryptionCommand; /***/ }), -<<<<<<< HEAD -/***/ 39216: -======= -/***/ 5604: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 48344: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketIntelligentTieringConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketIntelligentTieringConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketIntelligentTieringConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -10808,32 +9131,19 @@ exports.GetBucketIntelligentTieringConfigurationCommand = GetBucketIntelligentTi /***/ }), -<<<<<<< HEAD -/***/ 69553: -======= -/***/ 90152: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 84929: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketInventoryConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(22729); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketInventoryConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(2384); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketInventoryConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -10888,31 +9198,18 @@ exports.GetBucketInventoryConfigurationCommand = GetBucketInventoryConfiguration /***/ }), -<<<<<<< HEAD -/***/ 30426: -======= -/***/ 51601: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 73162: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketLifecycleConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketLifecycleConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketLifecycleConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -10967,31 +9264,18 @@ exports.GetBucketLifecycleConfigurationCommand = GetBucketLifecycleConfiguration /***/ }), -<<<<<<< HEAD -/***/ 60074: -======= -/***/ 8212: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 92099: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketLocationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketLocationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketLocationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -11046,31 +9330,18 @@ exports.GetBucketLocationCommand = GetBucketLocationCommand; /***/ }), -<<<<<<< HEAD -/***/ 5152: -======= -/***/ 94953: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 16092: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketLoggingCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketLoggingCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketLoggingCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -11125,31 +9396,18 @@ exports.GetBucketLoggingCommand = GetBucketLoggingCommand; /***/ }), -<<<<<<< HEAD -/***/ 97986: -======= -/***/ 86801: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 64711: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketMetricsConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketMetricsConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketMetricsConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -11204,31 +9462,18 @@ exports.GetBucketMetricsConfigurationCommand = GetBucketMetricsConfigurationComm /***/ }), -<<<<<<< HEAD -/***/ 31857: -======= -/***/ 96677: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 87118: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketNotificationConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketNotificationConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketNotificationConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -11283,31 +9528,18 @@ exports.GetBucketNotificationConfigurationCommand = GetBucketNotificationConfigu /***/ }), -<<<<<<< HEAD -/***/ 90940: -======= -/***/ 94801: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 36655: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketOwnershipControlsCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketOwnershipControlsCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketOwnershipControlsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -11362,31 +9594,18 @@ exports.GetBucketOwnershipControlsCommand = GetBucketOwnershipControlsCommand; /***/ }), -<<<<<<< HEAD -/***/ 46067: -======= -/***/ 92799: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 32504: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketPolicyCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketPolicyCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketPolicyCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -11441,31 +9660,18 @@ exports.GetBucketPolicyCommand = GetBucketPolicyCommand; /***/ }), -<<<<<<< HEAD -/***/ 77093: -======= -/***/ 54619: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 50321: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketPolicyStatusCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketPolicyStatusCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketPolicyStatusCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -11520,31 +9726,18 @@ exports.GetBucketPolicyStatusCommand = GetBucketPolicyStatusCommand; /***/ }), -<<<<<<< HEAD -/***/ 36675: -======= -/***/ 31593: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 50656: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketReplicationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketReplicationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketReplicationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -11599,31 +9792,18 @@ exports.GetBucketReplicationCommand = GetBucketReplicationCommand; /***/ }), -<<<<<<< HEAD -/***/ 98115: -======= -/***/ 42641: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 73192: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketRequestPaymentCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketRequestPaymentCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketRequestPaymentCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -11678,31 +9858,18 @@ exports.GetBucketRequestPaymentCommand = GetBucketRequestPaymentCommand; /***/ }), -<<<<<<< HEAD -/***/ 61300: -======= -/***/ 82404: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 84276: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketTaggingCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketTaggingCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketTaggingCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -11757,31 +9924,18 @@ exports.GetBucketTaggingCommand = GetBucketTaggingCommand; /***/ }), -<<<<<<< HEAD -/***/ 90894: -======= -/***/ 37097: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 91859: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketVersioningCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketVersioningCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketVersioningCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -11836,31 +9990,18 @@ exports.GetBucketVersioningCommand = GetBucketVersioningCommand; /***/ }), -<<<<<<< HEAD -/***/ 58382: -======= -/***/ 68163: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 56490: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetBucketWebsiteCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetBucketWebsiteCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetBucketWebsiteCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -11915,31 +10056,18 @@ exports.GetBucketWebsiteCommand = GetBucketWebsiteCommand; /***/ }), -<<<<<<< HEAD -/***/ 8732: -======= -/***/ 24410: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 89030: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetObjectAclCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetObjectAclCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetObjectAclCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -11994,34 +10122,20 @@ exports.GetObjectAclCommand = GetObjectAclCommand; /***/ }), -<<<<<<< HEAD -/***/ 65852: -======= -/***/ 61105: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 88738: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetObjectAttributesCommand = exports.$Command = void 0; -const middleware_ssec_1 = __nccwpck_require__(33563); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_ssec_1 = __nccwpck_require__(20484); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(22729); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetObjectAttributesCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const middleware_ssec_1 = __nccwpck_require__(58483); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(2384); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetObjectAttributesCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -12076,36 +10190,21 @@ exports.GetObjectAttributesCommand = GetObjectAttributesCommand; /***/ }), -<<<<<<< HEAD -/***/ 70184: -======= -/***/ 5846: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 30878: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetObjectCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_ssec_1 = __nccwpck_require__(33563); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_ssec_1 = __nccwpck_require__(20484); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(22729); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetObjectCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const middleware_ssec_1 = __nccwpck_require__(58483); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(2384); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetObjectCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -12167,31 +10266,18 @@ exports.GetObjectCommand = GetObjectCommand; /***/ }), -<<<<<<< HEAD -/***/ 7017: -======= -/***/ 99937: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 46039: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetObjectLegalHoldCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetObjectLegalHoldCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetObjectLegalHoldCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -12245,31 +10331,18 @@ exports.GetObjectLegalHoldCommand = GetObjectLegalHoldCommand; /***/ }), -<<<<<<< HEAD -/***/ 87797: -======= -/***/ 67846: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 78947: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetObjectLockConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetObjectLockConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetObjectLockConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -12323,31 +10396,18 @@ exports.GetObjectLockConfigurationCommand = GetObjectLockConfigurationCommand; /***/ }), -<<<<<<< HEAD -/***/ 18426: -======= -/***/ 13037: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 79113: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetObjectRetentionCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetObjectRetentionCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetObjectRetentionCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -12401,31 +10461,18 @@ exports.GetObjectRetentionCommand = GetObjectRetentionCommand; /***/ }), -<<<<<<< HEAD -/***/ 28754: -======= -/***/ 41222: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 94764: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetObjectTaggingCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetObjectTaggingCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetObjectTaggingCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -12479,32 +10526,19 @@ exports.GetObjectTaggingCommand = GetObjectTaggingCommand; /***/ }), -<<<<<<< HEAD -/***/ 66888: -======= -/***/ 65068: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 76662: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetObjectTorrentCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(22729); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetObjectTorrentCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(2384); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetObjectTorrentCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -12558,31 +10592,18 @@ exports.GetObjectTorrentCommand = GetObjectTorrentCommand; /***/ }), -<<<<<<< HEAD -/***/ 22223: -======= -/***/ 68639: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 76694: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetPublicAccessBlockCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.GetPublicAccessBlockCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class GetPublicAccessBlockCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -12637,31 +10658,18 @@ exports.GetPublicAccessBlockCommand = GetPublicAccessBlockCommand; /***/ }), -<<<<<<< HEAD -/***/ 93946: -======= -/***/ 6005: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 74430: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.HeadBucketCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.HeadBucketCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class HeadBucketCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -12715,34 +10723,20 @@ exports.HeadBucketCommand = HeadBucketCommand; /***/ }), -<<<<<<< HEAD -/***/ 61280: -======= -/***/ 49553: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 65482: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.HeadObjectCommand = exports.$Command = void 0; -const middleware_ssec_1 = __nccwpck_require__(33563); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_ssec_1 = __nccwpck_require__(20484); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(22729); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.HeadObjectCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const middleware_ssec_1 = __nccwpck_require__(58483); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(2384); +const Aws_restXml_1 = __nccwpck_require__(45028); class HeadObjectCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -12798,31 +10792,18 @@ exports.HeadObjectCommand = HeadObjectCommand; /***/ }), -<<<<<<< HEAD -/***/ 88519: -======= -/***/ 85121: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 71284: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.ListBucketAnalyticsConfigurationsCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.ListBucketAnalyticsConfigurationsCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class ListBucketAnalyticsConfigurationsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -12877,31 +10858,18 @@ exports.ListBucketAnalyticsConfigurationsCommand = ListBucketAnalyticsConfigurat /***/ }), -<<<<<<< HEAD -/***/ 34871: -======= -/***/ 24956: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 62643: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.ListBucketIntelligentTieringConfigurationsCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.ListBucketIntelligentTieringConfigurationsCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class ListBucketIntelligentTieringConfigurationsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -12956,32 +10924,19 @@ exports.ListBucketIntelligentTieringConfigurationsCommand = ListBucketIntelligen /***/ }), -<<<<<<< HEAD -/***/ 7739: -======= -/***/ 78015: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 15824: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.ListBucketInventoryConfigurationsCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(22729); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.ListBucketInventoryConfigurationsCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(2384); +const Aws_restXml_1 = __nccwpck_require__(45028); class ListBucketInventoryConfigurationsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -13036,31 +10991,18 @@ exports.ListBucketInventoryConfigurationsCommand = ListBucketInventoryConfigurat /***/ }), -<<<<<<< HEAD -/***/ 87086: -======= -/***/ 73116: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 34324: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.ListBucketMetricsConfigurationsCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.ListBucketMetricsConfigurationsCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class ListBucketMetricsConfigurationsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -13114,30 +11056,18 @@ exports.ListBucketMetricsConfigurationsCommand = ListBucketMetricsConfigurations /***/ }), -<<<<<<< HEAD -/***/ 23261: -======= -/***/ 85333: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 5258: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.ListBucketsCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.ListBucketsCommand = void 0; -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class ListBucketsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -13190,23 +11120,18 @@ exports.ListBucketsCommand = ListBucketsCommand; /***/ }), -<<<<<<< HEAD -/***/ 38902: -======= -/***/ 28427: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 41730: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.ListDirectoryBucketsCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class ListDirectoryBucketsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -13223,15 +11148,6 @@ class ListDirectoryBucketsCommand extends smithy_client_1.Command { UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, }; } -======= -exports.ListMultipartUploadsCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); -class ListMultipartUploadsCommand extends smithy_client_1.Command { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 constructor(input) { super(); this.input = input; @@ -13269,18 +11185,18 @@ exports.ListDirectoryBucketsCommand = ListDirectoryBucketsCommand; /***/ }), -/***/ 20678: +/***/ 23308: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ListMultipartUploadsCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class ListMultipartUploadsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -13335,31 +11251,18 @@ exports.ListMultipartUploadsCommand = ListMultipartUploadsCommand; /***/ }), -<<<<<<< HEAD -/***/ 95992: -======= -/***/ 29049: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 27720: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.ListObjectVersionsCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.ListObjectVersionsCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class ListObjectVersionsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -13414,31 +11317,18 @@ exports.ListObjectVersionsCommand = ListObjectVersionsCommand; /***/ }), -<<<<<<< HEAD -/***/ 30494: -======= -/***/ 1702: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 84211: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.ListObjectsCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.ListObjectsCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class ListObjectsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -13493,31 +11383,18 @@ exports.ListObjectsCommand = ListObjectsCommand; /***/ }), -<<<<<<< HEAD -/***/ 57262: -======= -/***/ 33259: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 14116: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.ListObjectsV2Command = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.ListObjectsV2Command = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class ListObjectsV2Command extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -13572,34 +11449,20 @@ exports.ListObjectsV2Command = ListObjectsV2Command; /***/ }), -<<<<<<< HEAD -/***/ 68740: -======= -/***/ 83080: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 65560: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.ListPartsCommand = exports.$Command = void 0; -const middleware_ssec_1 = __nccwpck_require__(33563); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_ssec_1 = __nccwpck_require__(20484); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(22729); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.ListPartsCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const middleware_ssec_1 = __nccwpck_require__(58483); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(2384); +const Aws_restXml_1 = __nccwpck_require__(45028); class ListPartsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -13655,33 +11518,19 @@ exports.ListPartsCommand = ListPartsCommand; /***/ }), -<<<<<<< HEAD -/***/ 52582: -======= -/***/ 28257: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 59008: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutBucketAccelerateConfigurationCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutBucketAccelerateConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutBucketAccelerateConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -13741,33 +11590,19 @@ exports.PutBucketAccelerateConfigurationCommand = PutBucketAccelerateConfigurati /***/ }), -<<<<<<< HEAD -/***/ 18785: -======= -/***/ 90276: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 16314: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutBucketAclCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutBucketAclCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutBucketAclCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -13827,31 +11662,18 @@ exports.PutBucketAclCommand = PutBucketAclCommand; /***/ }), -<<<<<<< HEAD -/***/ 23562: -======= -/***/ 21754: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 3819: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutBucketAnalyticsConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutBucketAnalyticsConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutBucketAnalyticsConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -13906,33 +11728,19 @@ exports.PutBucketAnalyticsConfigurationCommand = PutBucketAnalyticsConfiguration /***/ }), -<<<<<<< HEAD -/***/ 68524: -======= -/***/ 78085: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 16377: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutBucketCorsCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutBucketCorsCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutBucketCorsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -13992,34 +11800,20 @@ exports.PutBucketCorsCommand = PutBucketCorsCommand; /***/ }), -<<<<<<< HEAD -/***/ 95647: -======= -/***/ 12713: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 39608: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutBucketEncryptionCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(22729); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutBucketEncryptionCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(2384); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutBucketEncryptionCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -14079,31 +11873,18 @@ exports.PutBucketEncryptionCommand = PutBucketEncryptionCommand; /***/ }), -<<<<<<< HEAD -/***/ 53359: -======= -/***/ 10561: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 50906: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutBucketIntelligentTieringConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutBucketIntelligentTieringConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutBucketIntelligentTieringConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -14158,32 +11939,19 @@ exports.PutBucketIntelligentTieringConfigurationCommand = PutBucketIntelligentTi /***/ }), -<<<<<<< HEAD -/***/ 15119: -======= -/***/ 74588: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 31396: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutBucketInventoryConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(22729); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutBucketInventoryConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(2384); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutBucketInventoryConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -14238,33 +12006,19 @@ exports.PutBucketInventoryConfigurationCommand = PutBucketInventoryConfiguration /***/ }), -<<<<<<< HEAD -/***/ 37659: -======= -/***/ 99247: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 5959: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutBucketLifecycleConfigurationCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutBucketLifecycleConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutBucketLifecycleConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -14324,33 +12078,19 @@ exports.PutBucketLifecycleConfigurationCommand = PutBucketLifecycleConfiguration /***/ }), -<<<<<<< HEAD -/***/ 64879: -======= -/***/ 71745: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 63127: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutBucketLoggingCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutBucketLoggingCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutBucketLoggingCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -14410,31 +12150,18 @@ exports.PutBucketLoggingCommand = PutBucketLoggingCommand; /***/ }), -<<<<<<< HEAD -/***/ 36122: -======= -/***/ 62260: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 28041: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutBucketMetricsConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutBucketMetricsConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutBucketMetricsConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -14489,31 +12216,18 @@ exports.PutBucketMetricsConfigurationCommand = PutBucketMetricsConfigurationComm /***/ }), -<<<<<<< HEAD -/***/ 23762: -======= -/***/ 19700: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 94627: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutBucketNotificationConfigurationCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutBucketNotificationConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutBucketNotificationConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -14568,33 +12282,19 @@ exports.PutBucketNotificationConfigurationCommand = PutBucketNotificationConfigu /***/ }), -<<<<<<< HEAD -/***/ 27055: -======= -/***/ 89352: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 67602: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutBucketOwnershipControlsCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutBucketOwnershipControlsCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutBucketOwnershipControlsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -14650,33 +12350,19 @@ exports.PutBucketOwnershipControlsCommand = PutBucketOwnershipControlsCommand; /***/ }), -<<<<<<< HEAD -/***/ 23598: -======= -/***/ 22417: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 82059: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutBucketPolicyCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutBucketPolicyCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutBucketPolicyCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -14736,33 +12422,19 @@ exports.PutBucketPolicyCommand = PutBucketPolicyCommand; /***/ }), -<<<<<<< HEAD -/***/ 42596: -======= -/***/ 94943: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 35612: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutBucketReplicationCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutBucketReplicationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutBucketReplicationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -14822,33 +12494,19 @@ exports.PutBucketReplicationCommand = PutBucketReplicationCommand; /***/ }), -<<<<<<< HEAD -/***/ 12265: -======= -/***/ 94483: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 6787: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutBucketRequestPaymentCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutBucketRequestPaymentCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutBucketRequestPaymentCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -14908,33 +12566,19 @@ exports.PutBucketRequestPaymentCommand = PutBucketRequestPaymentCommand; /***/ }), -<<<<<<< HEAD -/***/ 22745: -======= -/***/ 90815: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 69549: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutBucketTaggingCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutBucketTaggingCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutBucketTaggingCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -14994,33 +12638,19 @@ exports.PutBucketTaggingCommand = PutBucketTaggingCommand; /***/ }), -<<<<<<< HEAD -/***/ 44671: -======= -/***/ 77437: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 28788: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutBucketVersioningCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutBucketVersioningCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutBucketVersioningCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -15080,33 +12710,19 @@ exports.PutBucketVersioningCommand = PutBucketVersioningCommand; /***/ }), -<<<<<<< HEAD -/***/ 27890: -======= -/***/ 54229: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 35621: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutBucketWebsiteCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutBucketWebsiteCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutBucketWebsiteCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -15166,33 +12782,19 @@ exports.PutBucketWebsiteCommand = PutBucketWebsiteCommand; /***/ }), -<<<<<<< HEAD -/***/ 83533: -======= -/***/ 33492: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 15864: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutObjectAclCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutObjectAclCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutObjectAclCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -15252,38 +12854,22 @@ exports.PutObjectAclCommand = PutObjectAclCommand; /***/ }), -<<<<<<< HEAD -/***/ 84520: -======= -/***/ 8000: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 17747: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutObjectCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_sdk_s3_1 = __nccwpck_require__(52776); -const middleware_ssec_1 = __nccwpck_require__(33563); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_sdk_s3_1 = __nccwpck_require__(39069); +const middleware_ssec_1 = __nccwpck_require__(20484); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_1_1 = __nccwpck_require__(71767); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutObjectCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_sdk_s3_1 = __nccwpck_require__(60444); -const middleware_serde_1 = __nccwpck_require__(44695); -const middleware_ssec_1 = __nccwpck_require__(58483); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_1_1 = __nccwpck_require__(5281); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutObjectCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -15345,33 +12931,19 @@ exports.PutObjectCommand = PutObjectCommand; /***/ }), -<<<<<<< HEAD -/***/ 57296: -======= -/***/ 15: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 77531: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutObjectLegalHoldCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutObjectLegalHoldCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutObjectLegalHoldCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -15430,33 +13002,19 @@ exports.PutObjectLegalHoldCommand = PutObjectLegalHoldCommand; /***/ }), -<<<<<<< HEAD -/***/ 15905: -======= -/***/ 77692: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 86480: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutObjectLockConfigurationCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutObjectLockConfigurationCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(30991); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutObjectLockConfigurationCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -15515,33 +13073,19 @@ exports.PutObjectLockConfigurationCommand = PutObjectLockConfigurationCommand; /***/ }), -<<<<<<< HEAD -/***/ 90936: -======= -/***/ 33946: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 7427: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutObjectRetentionCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutObjectRetentionCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_1_1 = __nccwpck_require__(43228); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutObjectRetentionCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -15600,33 +13144,19 @@ exports.PutObjectRetentionCommand = PutObjectRetentionCommand; /***/ }), -<<<<<<< HEAD -/***/ 13844: -======= -/***/ 84707: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 52400: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutObjectTaggingCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutObjectTaggingCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_1_1 = __nccwpck_require__(43228); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutObjectTaggingCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -15685,33 +13215,19 @@ exports.PutObjectTaggingCommand = PutObjectTaggingCommand; /***/ }), -<<<<<<< HEAD -/***/ 52786: -======= -/***/ 69104: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 213: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.PutPublicAccessBlockCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.PutPublicAccessBlockCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_1_1 = __nccwpck_require__(43228); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_restXml_1 = __nccwpck_require__(45028); class PutPublicAccessBlockCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -15771,34 +13287,20 @@ exports.PutPublicAccessBlockCommand = PutPublicAccessBlockCommand; /***/ }), -<<<<<<< HEAD -/***/ 15426: -======= -/***/ 43661: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 99112: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.RestoreObjectCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_1_1 = __nccwpck_require__(71767); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.RestoreObjectCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_1_1 = __nccwpck_require__(43228); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_1_1 = __nccwpck_require__(5281); +const Aws_restXml_1 = __nccwpck_require__(45028); class RestoreObjectCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -15857,34 +13359,20 @@ exports.RestoreObjectCommand = RestoreObjectCommand; /***/ }), -<<<<<<< HEAD -/***/ 26808: -======= -/***/ 84142: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 37945: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.SelectObjectContentCommand = exports.$Command = void 0; -const middleware_ssec_1 = __nccwpck_require__(33563); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_ssec_1 = __nccwpck_require__(20484); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_1_1 = __nccwpck_require__(71767); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.SelectObjectContentCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_serde_1 = __nccwpck_require__(44695); -const middleware_ssec_1 = __nccwpck_require__(58483); -const smithy_client_1 = __nccwpck_require__(26351); -const models_1_1 = __nccwpck_require__(43228); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_1_1 = __nccwpck_require__(5281); +const Aws_restXml_1 = __nccwpck_require__(45028); class SelectObjectContentCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -15942,36 +13430,21 @@ exports.SelectObjectContentCommand = SelectObjectContentCommand; /***/ }), -<<<<<<< HEAD -/***/ 64325: -======= -/***/ 52667: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 28330: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.UploadPartCommand = exports.$Command = void 0; -const middleware_flexible_checksums_1 = __nccwpck_require__(53106); -const middleware_ssec_1 = __nccwpck_require__(33563); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_flexible_checksums_1 = __nccwpck_require__(89119); +const middleware_ssec_1 = __nccwpck_require__(20484); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_1_1 = __nccwpck_require__(71767); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.UploadPartCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_flexible_checksums_1 = __nccwpck_require__(77389); -const middleware_serde_1 = __nccwpck_require__(44695); -const middleware_ssec_1 = __nccwpck_require__(58483); -const smithy_client_1 = __nccwpck_require__(26351); -const models_1_1 = __nccwpck_require__(43228); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_1_1 = __nccwpck_require__(5281); +const Aws_restXml_1 = __nccwpck_require__(45028); class UploadPartCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -16032,36 +13505,21 @@ exports.UploadPartCommand = UploadPartCommand; /***/ }), -<<<<<<< HEAD -/***/ 72251: -======= -/***/ 57045: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 56237: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.UploadPartCopyCommand = exports.$Command = void 0; -const middleware_sdk_s3_1 = __nccwpck_require__(52776); -const middleware_ssec_1 = __nccwpck_require__(33563); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_sdk_s3_1 = __nccwpck_require__(39069); +const middleware_ssec_1 = __nccwpck_require__(20484); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_1_1 = __nccwpck_require__(71767); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.UploadPartCopyCommand = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_sdk_s3_1 = __nccwpck_require__(60444); -const middleware_serde_1 = __nccwpck_require__(44695); -const middleware_ssec_1 = __nccwpck_require__(58483); -const smithy_client_1 = __nccwpck_require__(26351); -const models_1_1 = __nccwpck_require__(43228); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_1_1 = __nccwpck_require__(5281); +const Aws_restXml_1 = __nccwpck_require__(45028); class UploadPartCopyCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -16117,32 +13575,19 @@ exports.UploadPartCopyCommand = UploadPartCopyCommand; /***/ }), -<<<<<<< HEAD -/***/ 15173: -======= -/***/ 63803: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 12915: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.WriteGetObjectResponseCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_1_1 = __nccwpck_require__(71767); -const Aws_restXml_1 = __nccwpck_require__(70395); -======= -exports.WriteGetObjectResponseCommand = void 0; -const middleware_sdk_s3_1 = __nccwpck_require__(60444); -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_1_1 = __nccwpck_require__(43228); -const Aws_restXml_1 = __nccwpck_require__(75255); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_1_1 = __nccwpck_require__(5281); +const Aws_restXml_1 = __nccwpck_require__(45028); class WriteGetObjectResponseCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -16196,223 +13641,116 @@ exports.WriteGetObjectResponseCommand = WriteGetObjectResponseCommand; /***/ }), -<<<<<<< HEAD -/***/ 3749: -======= -/***/ 96823: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 51131: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(78016), exports); +tslib_1.__exportStar(__nccwpck_require__(97814), exports); +tslib_1.__exportStar(__nccwpck_require__(70231), exports); +tslib_1.__exportStar(__nccwpck_require__(66922), exports); +tslib_1.__exportStar(__nccwpck_require__(85669), exports); +tslib_1.__exportStar(__nccwpck_require__(2556), exports); +tslib_1.__exportStar(__nccwpck_require__(88525), exports); +tslib_1.__exportStar(__nccwpck_require__(58086), exports); +tslib_1.__exportStar(__nccwpck_require__(57021), exports); +tslib_1.__exportStar(__nccwpck_require__(41793), exports); +tslib_1.__exportStar(__nccwpck_require__(86344), exports); +tslib_1.__exportStar(__nccwpck_require__(82045), exports); +tslib_1.__exportStar(__nccwpck_require__(91051), exports); +tslib_1.__exportStar(__nccwpck_require__(28487), exports); +tslib_1.__exportStar(__nccwpck_require__(6859), exports); +tslib_1.__exportStar(__nccwpck_require__(31794), exports); +tslib_1.__exportStar(__nccwpck_require__(49991), exports); +tslib_1.__exportStar(__nccwpck_require__(30265), exports); +tslib_1.__exportStar(__nccwpck_require__(11644), exports); +tslib_1.__exportStar(__nccwpck_require__(33195), exports); +tslib_1.__exportStar(__nccwpck_require__(93360), exports); +tslib_1.__exportStar(__nccwpck_require__(9733), exports); +tslib_1.__exportStar(__nccwpck_require__(19183), exports); +tslib_1.__exportStar(__nccwpck_require__(77914), exports); +tslib_1.__exportStar(__nccwpck_require__(16009), exports); +tslib_1.__exportStar(__nccwpck_require__(91903), exports); +tslib_1.__exportStar(__nccwpck_require__(33400), exports); +tslib_1.__exportStar(__nccwpck_require__(30530), exports); +tslib_1.__exportStar(__nccwpck_require__(48344), exports); +tslib_1.__exportStar(__nccwpck_require__(84929), exports); +tslib_1.__exportStar(__nccwpck_require__(73162), exports); +tslib_1.__exportStar(__nccwpck_require__(92099), exports); +tslib_1.__exportStar(__nccwpck_require__(16092), exports); +tslib_1.__exportStar(__nccwpck_require__(64711), exports); +tslib_1.__exportStar(__nccwpck_require__(87118), exports); +tslib_1.__exportStar(__nccwpck_require__(36655), exports); +tslib_1.__exportStar(__nccwpck_require__(32504), exports); +tslib_1.__exportStar(__nccwpck_require__(50321), exports); +tslib_1.__exportStar(__nccwpck_require__(50656), exports); +tslib_1.__exportStar(__nccwpck_require__(73192), exports); +tslib_1.__exportStar(__nccwpck_require__(84276), exports); +tslib_1.__exportStar(__nccwpck_require__(91859), exports); +tslib_1.__exportStar(__nccwpck_require__(56490), exports); +tslib_1.__exportStar(__nccwpck_require__(89030), exports); +tslib_1.__exportStar(__nccwpck_require__(88738), exports); +tslib_1.__exportStar(__nccwpck_require__(30878), exports); +tslib_1.__exportStar(__nccwpck_require__(46039), exports); +tslib_1.__exportStar(__nccwpck_require__(78947), exports); +tslib_1.__exportStar(__nccwpck_require__(79113), exports); +tslib_1.__exportStar(__nccwpck_require__(94764), exports); +tslib_1.__exportStar(__nccwpck_require__(76662), exports); +tslib_1.__exportStar(__nccwpck_require__(76694), exports); +tslib_1.__exportStar(__nccwpck_require__(74430), exports); +tslib_1.__exportStar(__nccwpck_require__(65482), exports); +tslib_1.__exportStar(__nccwpck_require__(71284), exports); +tslib_1.__exportStar(__nccwpck_require__(62643), exports); +tslib_1.__exportStar(__nccwpck_require__(15824), exports); +tslib_1.__exportStar(__nccwpck_require__(34324), exports); +tslib_1.__exportStar(__nccwpck_require__(5258), exports); +tslib_1.__exportStar(__nccwpck_require__(41730), exports); +tslib_1.__exportStar(__nccwpck_require__(23308), exports); +tslib_1.__exportStar(__nccwpck_require__(27720), exports); +tslib_1.__exportStar(__nccwpck_require__(84211), exports); +tslib_1.__exportStar(__nccwpck_require__(14116), exports); +tslib_1.__exportStar(__nccwpck_require__(65560), exports); +tslib_1.__exportStar(__nccwpck_require__(59008), exports); +tslib_1.__exportStar(__nccwpck_require__(16314), exports); +tslib_1.__exportStar(__nccwpck_require__(3819), exports); +tslib_1.__exportStar(__nccwpck_require__(16377), exports); +tslib_1.__exportStar(__nccwpck_require__(39608), exports); +tslib_1.__exportStar(__nccwpck_require__(50906), exports); +tslib_1.__exportStar(__nccwpck_require__(31396), exports); +tslib_1.__exportStar(__nccwpck_require__(5959), exports); +tslib_1.__exportStar(__nccwpck_require__(63127), exports); +tslib_1.__exportStar(__nccwpck_require__(28041), exports); +tslib_1.__exportStar(__nccwpck_require__(94627), exports); +tslib_1.__exportStar(__nccwpck_require__(67602), exports); +tslib_1.__exportStar(__nccwpck_require__(82059), exports); +tslib_1.__exportStar(__nccwpck_require__(35612), exports); +tslib_1.__exportStar(__nccwpck_require__(6787), exports); +tslib_1.__exportStar(__nccwpck_require__(69549), exports); +tslib_1.__exportStar(__nccwpck_require__(28788), exports); +tslib_1.__exportStar(__nccwpck_require__(35621), exports); +tslib_1.__exportStar(__nccwpck_require__(15864), exports); +tslib_1.__exportStar(__nccwpck_require__(17747), exports); +tslib_1.__exportStar(__nccwpck_require__(77531), exports); +tslib_1.__exportStar(__nccwpck_require__(86480), exports); +tslib_1.__exportStar(__nccwpck_require__(7427), exports); +tslib_1.__exportStar(__nccwpck_require__(52400), exports); +tslib_1.__exportStar(__nccwpck_require__(213), exports); +tslib_1.__exportStar(__nccwpck_require__(99112), exports); +tslib_1.__exportStar(__nccwpck_require__(37945), exports); +tslib_1.__exportStar(__nccwpck_require__(28330), exports); +tslib_1.__exportStar(__nccwpck_require__(56237), exports); +tslib_1.__exportStar(__nccwpck_require__(12915), exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(91685); -tslib_1.__exportStar(__nccwpck_require__(54745), exports); -tslib_1.__exportStar(__nccwpck_require__(48394), exports); -tslib_1.__exportStar(__nccwpck_require__(47241), exports); -tslib_1.__exportStar(__nccwpck_require__(37648), exports); -tslib_1.__exportStar(__nccwpck_require__(51963), exports); -tslib_1.__exportStar(__nccwpck_require__(47209), exports); -tslib_1.__exportStar(__nccwpck_require__(26373), exports); -tslib_1.__exportStar(__nccwpck_require__(40235), exports); -tslib_1.__exportStar(__nccwpck_require__(12335), exports); -tslib_1.__exportStar(__nccwpck_require__(13305), exports); -tslib_1.__exportStar(__nccwpck_require__(87902), exports); -tslib_1.__exportStar(__nccwpck_require__(4642), exports); -tslib_1.__exportStar(__nccwpck_require__(56903), exports); -tslib_1.__exportStar(__nccwpck_require__(70617), exports); -tslib_1.__exportStar(__nccwpck_require__(96947), exports); -tslib_1.__exportStar(__nccwpck_require__(24789), exports); -tslib_1.__exportStar(__nccwpck_require__(14412), exports); -tslib_1.__exportStar(__nccwpck_require__(89218), exports); -tslib_1.__exportStar(__nccwpck_require__(36069), exports); -tslib_1.__exportStar(__nccwpck_require__(84529), exports); -tslib_1.__exportStar(__nccwpck_require__(87937), exports); -tslib_1.__exportStar(__nccwpck_require__(17735), exports); -tslib_1.__exportStar(__nccwpck_require__(8063), exports); -tslib_1.__exportStar(__nccwpck_require__(95005), exports); -tslib_1.__exportStar(__nccwpck_require__(59650), exports); -tslib_1.__exportStar(__nccwpck_require__(5689), exports); -tslib_1.__exportStar(__nccwpck_require__(43088), exports); -tslib_1.__exportStar(__nccwpck_require__(53637), exports); -tslib_1.__exportStar(__nccwpck_require__(39216), exports); -tslib_1.__exportStar(__nccwpck_require__(69553), exports); -tslib_1.__exportStar(__nccwpck_require__(30426), exports); -tslib_1.__exportStar(__nccwpck_require__(60074), exports); -tslib_1.__exportStar(__nccwpck_require__(5152), exports); -tslib_1.__exportStar(__nccwpck_require__(97986), exports); -tslib_1.__exportStar(__nccwpck_require__(31857), exports); -tslib_1.__exportStar(__nccwpck_require__(90940), exports); -tslib_1.__exportStar(__nccwpck_require__(46067), exports); -tslib_1.__exportStar(__nccwpck_require__(77093), exports); -tslib_1.__exportStar(__nccwpck_require__(36675), exports); -tslib_1.__exportStar(__nccwpck_require__(98115), exports); -tslib_1.__exportStar(__nccwpck_require__(61300), exports); -tslib_1.__exportStar(__nccwpck_require__(90894), exports); -tslib_1.__exportStar(__nccwpck_require__(58382), exports); -tslib_1.__exportStar(__nccwpck_require__(8732), exports); -tslib_1.__exportStar(__nccwpck_require__(65852), exports); -tslib_1.__exportStar(__nccwpck_require__(70184), exports); -tslib_1.__exportStar(__nccwpck_require__(7017), exports); -tslib_1.__exportStar(__nccwpck_require__(87797), exports); -tslib_1.__exportStar(__nccwpck_require__(18426), exports); -tslib_1.__exportStar(__nccwpck_require__(28754), exports); -tslib_1.__exportStar(__nccwpck_require__(66888), exports); -tslib_1.__exportStar(__nccwpck_require__(22223), exports); -tslib_1.__exportStar(__nccwpck_require__(93946), exports); -tslib_1.__exportStar(__nccwpck_require__(61280), exports); -tslib_1.__exportStar(__nccwpck_require__(88519), exports); -tslib_1.__exportStar(__nccwpck_require__(34871), exports); -tslib_1.__exportStar(__nccwpck_require__(7739), exports); -tslib_1.__exportStar(__nccwpck_require__(87086), exports); -tslib_1.__exportStar(__nccwpck_require__(23261), exports); -tslib_1.__exportStar(__nccwpck_require__(38902), exports); -tslib_1.__exportStar(__nccwpck_require__(20678), exports); -tslib_1.__exportStar(__nccwpck_require__(95992), exports); -tslib_1.__exportStar(__nccwpck_require__(30494), exports); -tslib_1.__exportStar(__nccwpck_require__(57262), exports); -tslib_1.__exportStar(__nccwpck_require__(68740), exports); -tslib_1.__exportStar(__nccwpck_require__(52582), exports); -tslib_1.__exportStar(__nccwpck_require__(18785), exports); -tslib_1.__exportStar(__nccwpck_require__(23562), exports); -tslib_1.__exportStar(__nccwpck_require__(68524), exports); -tslib_1.__exportStar(__nccwpck_require__(95647), exports); -tslib_1.__exportStar(__nccwpck_require__(53359), exports); -tslib_1.__exportStar(__nccwpck_require__(15119), exports); -tslib_1.__exportStar(__nccwpck_require__(37659), exports); -tslib_1.__exportStar(__nccwpck_require__(64879), exports); -tslib_1.__exportStar(__nccwpck_require__(36122), exports); -tslib_1.__exportStar(__nccwpck_require__(23762), exports); -tslib_1.__exportStar(__nccwpck_require__(27055), exports); -tslib_1.__exportStar(__nccwpck_require__(23598), exports); -tslib_1.__exportStar(__nccwpck_require__(42596), exports); -tslib_1.__exportStar(__nccwpck_require__(12265), exports); -tslib_1.__exportStar(__nccwpck_require__(22745), exports); -tslib_1.__exportStar(__nccwpck_require__(44671), exports); -tslib_1.__exportStar(__nccwpck_require__(27890), exports); -tslib_1.__exportStar(__nccwpck_require__(83533), exports); -tslib_1.__exportStar(__nccwpck_require__(84520), exports); -tslib_1.__exportStar(__nccwpck_require__(57296), exports); -tslib_1.__exportStar(__nccwpck_require__(15905), exports); -tslib_1.__exportStar(__nccwpck_require__(90936), exports); -tslib_1.__exportStar(__nccwpck_require__(13844), exports); -tslib_1.__exportStar(__nccwpck_require__(52786), exports); -tslib_1.__exportStar(__nccwpck_require__(15426), exports); -tslib_1.__exportStar(__nccwpck_require__(26808), exports); -tslib_1.__exportStar(__nccwpck_require__(64325), exports); -tslib_1.__exportStar(__nccwpck_require__(72251), exports); -tslib_1.__exportStar(__nccwpck_require__(15173), exports); -======= -const tslib_1 = __nccwpck_require__(73563); -tslib_1.__exportStar(__nccwpck_require__(18605), exports); -tslib_1.__exportStar(__nccwpck_require__(90130), exports); -tslib_1.__exportStar(__nccwpck_require__(14578), exports); -tslib_1.__exportStar(__nccwpck_require__(84579), exports); -tslib_1.__exportStar(__nccwpck_require__(80369), exports); -tslib_1.__exportStar(__nccwpck_require__(20325), exports); -tslib_1.__exportStar(__nccwpck_require__(41253), exports); -tslib_1.__exportStar(__nccwpck_require__(68989), exports); -tslib_1.__exportStar(__nccwpck_require__(35734), exports); -tslib_1.__exportStar(__nccwpck_require__(17837), exports); -tslib_1.__exportStar(__nccwpck_require__(27350), exports); -tslib_1.__exportStar(__nccwpck_require__(93386), exports); -tslib_1.__exportStar(__nccwpck_require__(14002), exports); -tslib_1.__exportStar(__nccwpck_require__(75145), exports); -tslib_1.__exportStar(__nccwpck_require__(72768), exports); -tslib_1.__exportStar(__nccwpck_require__(59847), exports); -tslib_1.__exportStar(__nccwpck_require__(54231), exports); -tslib_1.__exportStar(__nccwpck_require__(35795), exports); -tslib_1.__exportStar(__nccwpck_require__(13135), exports); -tslib_1.__exportStar(__nccwpck_require__(40054), exports); -tslib_1.__exportStar(__nccwpck_require__(49810), exports); -tslib_1.__exportStar(__nccwpck_require__(33680), exports); -tslib_1.__exportStar(__nccwpck_require__(74750), exports); -tslib_1.__exportStar(__nccwpck_require__(44423), exports); -tslib_1.__exportStar(__nccwpck_require__(84379), exports); -tslib_1.__exportStar(__nccwpck_require__(88954), exports); -tslib_1.__exportStar(__nccwpck_require__(30882), exports); -tslib_1.__exportStar(__nccwpck_require__(5604), exports); -tslib_1.__exportStar(__nccwpck_require__(90152), exports); -tslib_1.__exportStar(__nccwpck_require__(51601), exports); -tslib_1.__exportStar(__nccwpck_require__(8212), exports); -tslib_1.__exportStar(__nccwpck_require__(94953), exports); -tslib_1.__exportStar(__nccwpck_require__(86801), exports); -tslib_1.__exportStar(__nccwpck_require__(96677), exports); -tslib_1.__exportStar(__nccwpck_require__(94801), exports); -tslib_1.__exportStar(__nccwpck_require__(92799), exports); -tslib_1.__exportStar(__nccwpck_require__(54619), exports); -tslib_1.__exportStar(__nccwpck_require__(31593), exports); -tslib_1.__exportStar(__nccwpck_require__(42641), exports); -tslib_1.__exportStar(__nccwpck_require__(82404), exports); -tslib_1.__exportStar(__nccwpck_require__(37097), exports); -tslib_1.__exportStar(__nccwpck_require__(68163), exports); -tslib_1.__exportStar(__nccwpck_require__(24410), exports); -tslib_1.__exportStar(__nccwpck_require__(61105), exports); -tslib_1.__exportStar(__nccwpck_require__(5846), exports); -tslib_1.__exportStar(__nccwpck_require__(99937), exports); -tslib_1.__exportStar(__nccwpck_require__(67846), exports); -tslib_1.__exportStar(__nccwpck_require__(13037), exports); -tslib_1.__exportStar(__nccwpck_require__(41222), exports); -tslib_1.__exportStar(__nccwpck_require__(65068), exports); -tslib_1.__exportStar(__nccwpck_require__(68639), exports); -tslib_1.__exportStar(__nccwpck_require__(6005), exports); -tslib_1.__exportStar(__nccwpck_require__(49553), exports); -tslib_1.__exportStar(__nccwpck_require__(85121), exports); -tslib_1.__exportStar(__nccwpck_require__(24956), exports); -tslib_1.__exportStar(__nccwpck_require__(78015), exports); -tslib_1.__exportStar(__nccwpck_require__(73116), exports); -tslib_1.__exportStar(__nccwpck_require__(85333), exports); -tslib_1.__exportStar(__nccwpck_require__(28427), exports); -tslib_1.__exportStar(__nccwpck_require__(29049), exports); -tslib_1.__exportStar(__nccwpck_require__(1702), exports); -tslib_1.__exportStar(__nccwpck_require__(33259), exports); -tslib_1.__exportStar(__nccwpck_require__(83080), exports); -tslib_1.__exportStar(__nccwpck_require__(28257), exports); -tslib_1.__exportStar(__nccwpck_require__(90276), exports); -tslib_1.__exportStar(__nccwpck_require__(21754), exports); -tslib_1.__exportStar(__nccwpck_require__(78085), exports); -tslib_1.__exportStar(__nccwpck_require__(12713), exports); -tslib_1.__exportStar(__nccwpck_require__(10561), exports); -tslib_1.__exportStar(__nccwpck_require__(74588), exports); -tslib_1.__exportStar(__nccwpck_require__(99247), exports); -tslib_1.__exportStar(__nccwpck_require__(71745), exports); -tslib_1.__exportStar(__nccwpck_require__(62260), exports); -tslib_1.__exportStar(__nccwpck_require__(19700), exports); -tslib_1.__exportStar(__nccwpck_require__(89352), exports); -tslib_1.__exportStar(__nccwpck_require__(22417), exports); -tslib_1.__exportStar(__nccwpck_require__(94943), exports); -tslib_1.__exportStar(__nccwpck_require__(94483), exports); -tslib_1.__exportStar(__nccwpck_require__(90815), exports); -tslib_1.__exportStar(__nccwpck_require__(77437), exports); -tslib_1.__exportStar(__nccwpck_require__(54229), exports); -tslib_1.__exportStar(__nccwpck_require__(33492), exports); -tslib_1.__exportStar(__nccwpck_require__(8000), exports); -tslib_1.__exportStar(__nccwpck_require__(15), exports); -tslib_1.__exportStar(__nccwpck_require__(77692), exports); -tslib_1.__exportStar(__nccwpck_require__(33946), exports); -tslib_1.__exportStar(__nccwpck_require__(84707), exports); -tslib_1.__exportStar(__nccwpck_require__(69104), exports); -tslib_1.__exportStar(__nccwpck_require__(43661), exports); -tslib_1.__exportStar(__nccwpck_require__(84142), exports); -tslib_1.__exportStar(__nccwpck_require__(52667), exports); -tslib_1.__exportStar(__nccwpck_require__(57045), exports); -tslib_1.__exportStar(__nccwpck_require__(63803), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - -/***/ }), - -<<<<<<< HEAD -/***/ 28409: +/***/ }), + +/***/ 95570: /***/ ((__unused_webpack_module, exports) => { -======= -/***/ 41178: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.resolveClientEndpointParameters = void 0; const resolveClientEndpointParameters = (options) => { return { @@ -16425,340 +13763,20 @@ const resolveClientEndpointParameters = (options) => { disableMultiregionAccessPoints: options.disableMultiregionAccessPoints ?? false, defaultSigningName: "s3", }; -======= -exports.defaultRegionInfoProvider = void 0; -const config_resolver_1 = __nccwpck_require__(95406); -const regionHash = { - "af-south-1": { - variants: [ - { - hostname: "s3.dualstack.af-south-1.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "ap-east-1": { - variants: [ - { - hostname: "s3.dualstack.ap-east-1.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "ap-northeast-1": { - variants: [ - { - hostname: "s3.ap-northeast-1.amazonaws.com", - tags: [], - }, - { - hostname: "s3.dualstack.ap-northeast-1.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "ap-northeast-2": { - variants: [ - { - hostname: "s3.dualstack.ap-northeast-2.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "ap-northeast-3": { - variants: [ - { - hostname: "s3.dualstack.ap-northeast-3.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "ap-south-1": { - variants: [ - { - hostname: "s3.dualstack.ap-south-1.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "ap-southeast-1": { - variants: [ - { - hostname: "s3.ap-southeast-1.amazonaws.com", - tags: [], - }, - { - hostname: "s3.dualstack.ap-southeast-1.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "ap-southeast-2": { - variants: [ - { - hostname: "s3.ap-southeast-2.amazonaws.com", - tags: [], - }, - { - hostname: "s3.dualstack.ap-southeast-2.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "ap-southeast-3": { - variants: [ - { - hostname: "s3.dualstack.ap-southeast-3.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "aws-global": { - variants: [ - { - hostname: "s3.amazonaws.com", - tags: [], - }, - ], - signingRegion: "us-east-1", - }, - "ca-central-1": { - variants: [ - { - hostname: "s3-fips.ca-central-1.amazonaws.com", - tags: ["fips"], - }, - { - hostname: "s3-fips.dualstack.ca-central-1.amazonaws.com", - tags: ["dualstack", "fips"], - }, - { - hostname: "s3.dualstack.ca-central-1.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "cn-north-1": { - variants: [ - { - hostname: "s3.dualstack.cn-north-1.amazonaws.com.cn", - tags: ["dualstack"], - }, - ], - }, - "cn-northwest-1": { - variants: [ - { - hostname: "s3.dualstack.cn-northwest-1.amazonaws.com.cn", - tags: ["dualstack"], - }, - ], - }, - "eu-central-1": { - variants: [ - { - hostname: "s3.dualstack.eu-central-1.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "eu-north-1": { - variants: [ - { - hostname: "s3.dualstack.eu-north-1.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "eu-south-1": { - variants: [ - { - hostname: "s3.dualstack.eu-south-1.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "eu-west-1": { - variants: [ - { - hostname: "s3.eu-west-1.amazonaws.com", - tags: [], - }, - { - hostname: "s3.dualstack.eu-west-1.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "eu-west-2": { - variants: [ - { - hostname: "s3.dualstack.eu-west-2.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "eu-west-3": { - variants: [ - { - hostname: "s3.dualstack.eu-west-3.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "me-south-1": { - variants: [ - { - hostname: "s3.dualstack.me-south-1.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "s3-external-1": { - variants: [ - { - hostname: "s3-external-1.amazonaws.com", - tags: [], - }, - ], - signingRegion: "us-east-1", - }, - "sa-east-1": { - variants: [ - { - hostname: "s3.sa-east-1.amazonaws.com", - tags: [], - }, - { - hostname: "s3.dualstack.sa-east-1.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "us-east-1": { - variants: [ - { - hostname: "s3.us-east-1.amazonaws.com", - tags: [], - }, - { - hostname: "s3-fips.dualstack.us-east-1.amazonaws.com", - tags: ["dualstack", "fips"], - }, - { - hostname: "s3-fips.us-east-1.amazonaws.com", - tags: ["fips"], - }, - { - hostname: "s3.dualstack.us-east-1.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "us-east-2": { - variants: [ - { - hostname: "s3-fips.dualstack.us-east-2.amazonaws.com", - tags: ["dualstack", "fips"], - }, - { - hostname: "s3-fips.us-east-2.amazonaws.com", - tags: ["fips"], - }, - { - hostname: "s3.dualstack.us-east-2.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "us-gov-east-1": { - variants: [ - { - hostname: "s3.us-gov-east-1.amazonaws.com", - tags: [], - }, - { - hostname: "s3-fips.us-gov-east-1.amazonaws.com", - tags: ["fips"], - }, - { - hostname: "s3.dualstack.us-gov-east-1.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "us-gov-west-1": { - variants: [ - { - hostname: "s3.us-gov-west-1.amazonaws.com", - tags: [], - }, - { - hostname: "s3-fips.us-gov-west-1.amazonaws.com", - tags: ["fips"], - }, - { - hostname: "s3.dualstack.us-gov-west-1.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "us-west-1": { - variants: [ - { - hostname: "s3.us-west-1.amazonaws.com", - tags: [], - }, - { - hostname: "s3-fips.dualstack.us-west-1.amazonaws.com", - tags: ["dualstack", "fips"], - }, - { - hostname: "s3-fips.us-west-1.amazonaws.com", - tags: ["fips"], - }, - { - hostname: "s3.dualstack.us-west-1.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, - "us-west-2": { - variants: [ - { - hostname: "s3.us-west-2.amazonaws.com", - tags: [], - }, - { - hostname: "s3-fips.dualstack.us-west-2.amazonaws.com", - tags: ["dualstack", "fips"], - }, - { - hostname: "s3-fips.us-west-2.amazonaws.com", - tags: ["fips"], - }, - { - hostname: "s3.dualstack.us-west-2.amazonaws.com", - tags: ["dualstack"], - }, - ], - }, ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 }; exports.resolveClientEndpointParameters = resolveClientEndpointParameters; /***/ }), -<<<<<<< HEAD -/***/ 87873: +/***/ 27414: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.defaultEndpointResolver = void 0; -const util_endpoints_1 = __nccwpck_require__(34548); -const ruleset_1 = __nccwpck_require__(15330); +const util_endpoints_1 = __nccwpck_require__(34863); +const ruleset_1 = __nccwpck_require__(89421); const defaultEndpointResolver = (endpointParams, context = {}) => { return (0, util_endpoints_1.resolveEndpoint)(ruleset_1.ruleSet, { endpointParams: endpointParams, @@ -16770,7 +13788,7 @@ exports.defaultEndpointResolver = defaultEndpointResolver; /***/ }), -/***/ 15330: +/***/ 89421: /***/ ((__unused_webpack_module, exports) => { @@ -16784,57 +13802,34 @@ exports.ruleSet = _data; /***/ }), -/***/ 23371: -======= -/***/ 60382: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 63419: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.S3ServiceException = void 0; -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(91685); -tslib_1.__exportStar(__nccwpck_require__(34692), exports); -tslib_1.__exportStar(__nccwpck_require__(99700), exports); -tslib_1.__exportStar(__nccwpck_require__(3749), exports); -tslib_1.__exportStar(__nccwpck_require__(2714), exports); -tslib_1.__exportStar(__nccwpck_require__(98423), exports); -tslib_1.__exportStar(__nccwpck_require__(56244), exports); -__nccwpck_require__(60698); -var S3ServiceException_1 = __nccwpck_require__(67895); -======= -const tslib_1 = __nccwpck_require__(73563); -tslib_1.__exportStar(__nccwpck_require__(10223), exports); -tslib_1.__exportStar(__nccwpck_require__(17824), exports); -tslib_1.__exportStar(__nccwpck_require__(96823), exports); -tslib_1.__exportStar(__nccwpck_require__(9993), exports); -tslib_1.__exportStar(__nccwpck_require__(28743), exports); -tslib_1.__exportStar(__nccwpck_require__(40655), exports); -var S3ServiceException_1 = __nccwpck_require__(60929); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(26625), exports); +tslib_1.__exportStar(__nccwpck_require__(20347), exports); +tslib_1.__exportStar(__nccwpck_require__(51131), exports); +tslib_1.__exportStar(__nccwpck_require__(556), exports); +tslib_1.__exportStar(__nccwpck_require__(46649), exports); +tslib_1.__exportStar(__nccwpck_require__(5640), exports); +__nccwpck_require__(68503); +var S3ServiceException_1 = __nccwpck_require__(33881); Object.defineProperty(exports, "S3ServiceException", ({ enumerable: true, get: function () { return S3ServiceException_1.S3ServiceException; } })); /***/ }), -<<<<<<< HEAD -/***/ 67895: -======= -/***/ 60929: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 33881: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.S3ServiceException = exports.__ServiceException = void 0; -const smithy_client_1 = __nccwpck_require__(33218); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "__ServiceException", ({ enumerable: true, get: function () { return smithy_client_1.ServiceException; } })); -======= -exports.S3ServiceException = void 0; -const smithy_client_1 = __nccwpck_require__(26351); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 class S3ServiceException extends smithy_client_1.ServiceException { constructor(options) { super(options); @@ -16846,58 +13841,33 @@ exports.S3ServiceException = S3ServiceException; /***/ }), -<<<<<<< HEAD -/***/ 56244: -======= -/***/ 9993: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 5640: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(91685); -tslib_1.__exportStar(__nccwpck_require__(22729), exports); -tslib_1.__exportStar(__nccwpck_require__(71767), exports); -======= -const tslib_1 = __nccwpck_require__(73563); -tslib_1.__exportStar(__nccwpck_require__(30991), exports); -tslib_1.__exportStar(__nccwpck_require__(43228), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(2384), exports); +tslib_1.__exportStar(__nccwpck_require__(5281), exports); /***/ }), -<<<<<<< HEAD -/***/ 22729: -======= -/***/ 30991: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 2384: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.SseKmsEncryptedObjectsStatus = exports.ReplicaModificationsStatus = exports.ReplicationRuleFilter = exports.ExistingObjectReplicationStatus = exports.ReplicationTimeStatus = exports.MetricsStatus = exports.DeleteMarkerReplicationStatus = exports.FilterRuleName = exports.Event = exports.MetricsFilter = exports.PartitionDateSource = exports.BucketLogsPermission = exports.ExpirationStatus = exports.TransitionStorageClass = exports.LifecycleRuleFilter = exports.InventoryFrequency = exports.InventoryOptionalField = exports.InventoryIncludedObjectVersions = exports.InventoryFormat = exports.IntelligentTieringAccessTier = exports.IntelligentTieringStatus = exports.StorageClassAnalysisSchemaVersion = exports.AnalyticsS3ExportFileFormat = exports.AnalyticsFilter = exports.NoSuchBucket = exports.SessionMode = exports.ObjectOwnership = exports.BucketLocationConstraint = exports.LocationType = exports.BucketType = exports.DataRedundancy = exports.BucketCannedACL = exports.BucketAlreadyOwnedByYou = exports.BucketAlreadyExists = exports.ObjectNotInActiveTierError = exports.TaggingDirective = exports.StorageClass = exports.ObjectLockMode = exports.ObjectLockLegalHoldStatus = exports.MetadataDirective = exports.ChecksumAlgorithm = exports.ObjectCannedACL = exports.ServerSideEncryption = exports.OwnerOverride = exports.Permission = exports.Type = exports.BucketAccelerateStatus = exports.NoSuchUpload = exports.RequestPayer = exports.RequestCharged = void 0; exports.PutBucketInventoryConfigurationRequestFilterSensitiveLog = exports.PutBucketEncryptionRequestFilterSensitiveLog = exports.ListPartsRequestFilterSensitiveLog = exports.ListBucketInventoryConfigurationsOutputFilterSensitiveLog = exports.HeadObjectRequestFilterSensitiveLog = exports.HeadObjectOutputFilterSensitiveLog = exports.GetObjectTorrentOutputFilterSensitiveLog = exports.GetObjectAttributesRequestFilterSensitiveLog = exports.GetObjectRequestFilterSensitiveLog = exports.GetObjectOutputFilterSensitiveLog = exports.GetBucketInventoryConfigurationOutputFilterSensitiveLog = exports.InventoryConfigurationFilterSensitiveLog = exports.InventoryDestinationFilterSensitiveLog = exports.InventoryS3BucketDestinationFilterSensitiveLog = exports.InventoryEncryptionFilterSensitiveLog = exports.SSEKMSFilterSensitiveLog = exports.GetBucketEncryptionOutputFilterSensitiveLog = exports.ServerSideEncryptionConfigurationFilterSensitiveLog = exports.ServerSideEncryptionRuleFilterSensitiveLog = exports.ServerSideEncryptionByDefaultFilterSensitiveLog = exports.CreateSessionOutputFilterSensitiveLog = exports.SessionCredentialsFilterSensitiveLog = exports.CreateMultipartUploadRequestFilterSensitiveLog = exports.CreateMultipartUploadOutputFilterSensitiveLog = exports.CopyObjectRequestFilterSensitiveLog = exports.CopyObjectOutputFilterSensitiveLog = exports.CompleteMultipartUploadRequestFilterSensitiveLog = exports.CompleteMultipartUploadOutputFilterSensitiveLog = exports.ObjectVersionStorageClass = exports.OptionalObjectAttributes = exports.ObjectStorageClass = exports.EncodingType = exports.ArchiveStatus = exports.NotFound = exports.ObjectLockRetentionMode = exports.ObjectLockEnabled = exports.ObjectAttributes = exports.NoSuchKey = exports.InvalidObjectState = exports.ChecksumMode = exports.ReplicationStatus = exports.Protocol = exports.BucketVersioningStatus = exports.MFADeleteStatus = exports.Payer = exports.ReplicationRuleStatus = void 0; -const smithy_client_1 = __nccwpck_require__(33218); -const S3ServiceException_1 = __nccwpck_require__(67895); +const smithy_client_1 = __nccwpck_require__(42584); +const S3ServiceException_1 = __nccwpck_require__(33881); exports.RequestCharged = { requester: "requester", }; exports.RequestPayer = { requester: "requester", }; -======= -exports.DeleteObjectOutputFilterSensitiveLog = exports.DeleteBucketWebsiteRequestFilterSensitiveLog = exports.DeleteBucketTaggingRequestFilterSensitiveLog = exports.DeleteBucketReplicationRequestFilterSensitiveLog = exports.DeleteBucketPolicyRequestFilterSensitiveLog = exports.DeleteBucketOwnershipControlsRequestFilterSensitiveLog = exports.DeleteBucketMetricsConfigurationRequestFilterSensitiveLog = exports.DeleteBucketLifecycleRequestFilterSensitiveLog = exports.DeleteBucketInventoryConfigurationRequestFilterSensitiveLog = exports.DeleteBucketIntelligentTieringConfigurationRequestFilterSensitiveLog = exports.DeleteBucketEncryptionRequestFilterSensitiveLog = exports.DeleteBucketCorsRequestFilterSensitiveLog = exports.DeleteBucketAnalyticsConfigurationRequestFilterSensitiveLog = exports.DeleteBucketRequestFilterSensitiveLog = exports.CreateMultipartUploadRequestFilterSensitiveLog = exports.CreateMultipartUploadOutputFilterSensitiveLog = exports.CreateBucketRequestFilterSensitiveLog = exports.CreateBucketConfigurationFilterSensitiveLog = exports.CreateBucketOutputFilterSensitiveLog = exports.CopyObjectRequestFilterSensitiveLog = exports.CopyObjectOutputFilterSensitiveLog = exports.CopyObjectResultFilterSensitiveLog = exports.CompleteMultipartUploadRequestFilterSensitiveLog = exports.CompletedMultipartUploadFilterSensitiveLog = exports.CompletedPartFilterSensitiveLog = exports.CompleteMultipartUploadOutputFilterSensitiveLog = exports.AccessControlTranslationFilterSensitiveLog = exports.AccessControlPolicyFilterSensitiveLog = exports.OwnerFilterSensitiveLog = exports.GrantFilterSensitiveLog = exports.GranteeFilterSensitiveLog = exports.AccelerateConfigurationFilterSensitiveLog = exports.AbortMultipartUploadRequestFilterSensitiveLog = exports.AbortMultipartUploadOutputFilterSensitiveLog = exports.AbortIncompleteMultipartUploadFilterSensitiveLog = exports.NoSuchBucket = exports.NotFound = exports.ObjectAttributes = exports.NoSuchKey = exports.InvalidObjectState = exports.ChecksumMode = exports.ReplicationRuleFilter = exports.MetricsFilter = exports.LifecycleRuleFilter = exports.AnalyticsFilter = exports.BucketAlreadyOwnedByYou = exports.BucketAlreadyExists = exports.ObjectNotInActiveTierError = exports.ChecksumAlgorithm = exports.NoSuchUpload = void 0; -exports.LifecycleRuleAndOperatorFilterSensitiveLog = exports.LifecycleExpirationFilterSensitiveLog = exports.GetBucketInventoryConfigurationRequestFilterSensitiveLog = exports.GetBucketInventoryConfigurationOutputFilterSensitiveLog = exports.InventoryConfigurationFilterSensitiveLog = exports.InventoryScheduleFilterSensitiveLog = exports.InventoryFilterFilterSensitiveLog = exports.InventoryDestinationFilterSensitiveLog = exports.InventoryS3BucketDestinationFilterSensitiveLog = exports.InventoryEncryptionFilterSensitiveLog = exports.SSES3FilterSensitiveLog = exports.SSEKMSFilterSensitiveLog = exports.GetBucketIntelligentTieringConfigurationRequestFilterSensitiveLog = exports.GetBucketIntelligentTieringConfigurationOutputFilterSensitiveLog = exports.IntelligentTieringConfigurationFilterSensitiveLog = exports.TieringFilterSensitiveLog = exports.IntelligentTieringFilterFilterSensitiveLog = exports.IntelligentTieringAndOperatorFilterSensitiveLog = exports.GetBucketEncryptionRequestFilterSensitiveLog = exports.GetBucketEncryptionOutputFilterSensitiveLog = exports.ServerSideEncryptionConfigurationFilterSensitiveLog = exports.ServerSideEncryptionRuleFilterSensitiveLog = exports.ServerSideEncryptionByDefaultFilterSensitiveLog = exports.GetBucketCorsRequestFilterSensitiveLog = exports.GetBucketCorsOutputFilterSensitiveLog = exports.CORSRuleFilterSensitiveLog = exports.GetBucketAnalyticsConfigurationRequestFilterSensitiveLog = exports.GetBucketAnalyticsConfigurationOutputFilterSensitiveLog = exports.AnalyticsConfigurationFilterSensitiveLog = exports.StorageClassAnalysisFilterSensitiveLog = exports.StorageClassAnalysisDataExportFilterSensitiveLog = exports.AnalyticsExportDestinationFilterSensitiveLog = exports.AnalyticsS3BucketDestinationFilterSensitiveLog = exports.AnalyticsFilterFilterSensitiveLog = exports.AnalyticsAndOperatorFilterSensitiveLog = exports.TagFilterSensitiveLog = exports.GetBucketAclRequestFilterSensitiveLog = exports.GetBucketAclOutputFilterSensitiveLog = exports.GetBucketAccelerateConfigurationRequestFilterSensitiveLog = exports.GetBucketAccelerateConfigurationOutputFilterSensitiveLog = exports.DeletePublicAccessBlockRequestFilterSensitiveLog = exports.DeleteObjectTaggingRequestFilterSensitiveLog = exports.DeleteObjectTaggingOutputFilterSensitiveLog = exports.DeleteObjectsRequestFilterSensitiveLog = exports.DeleteFilterSensitiveLog = exports.ObjectIdentifierFilterSensitiveLog = exports.DeleteObjectsOutputFilterSensitiveLog = exports._ErrorFilterSensitiveLog = exports.DeletedObjectFilterSensitiveLog = exports.DeleteObjectRequestFilterSensitiveLog = void 0; -exports.ReplicationConfigurationFilterSensitiveLog = exports.ReplicationRuleFilterSensitiveLog = exports.SourceSelectionCriteriaFilterSensitiveLog = exports.SseKmsEncryptedObjectsFilterSensitiveLog = exports.ReplicaModificationsFilterSensitiveLog = exports.ReplicationRuleFilterFilterSensitiveLog = exports.ReplicationRuleAndOperatorFilterSensitiveLog = exports.ExistingObjectReplicationFilterSensitiveLog = exports.DestinationFilterSensitiveLog = exports.ReplicationTimeFilterSensitiveLog = exports.MetricsFilterSensitiveLog = exports.ReplicationTimeValueFilterSensitiveLog = exports.EncryptionConfigurationFilterSensitiveLog = exports.DeleteMarkerReplicationFilterSensitiveLog = exports.GetBucketPolicyStatusRequestFilterSensitiveLog = exports.GetBucketPolicyStatusOutputFilterSensitiveLog = exports.PolicyStatusFilterSensitiveLog = exports.GetBucketPolicyRequestFilterSensitiveLog = exports.GetBucketPolicyOutputFilterSensitiveLog = exports.GetBucketOwnershipControlsRequestFilterSensitiveLog = exports.GetBucketOwnershipControlsOutputFilterSensitiveLog = exports.OwnershipControlsFilterSensitiveLog = exports.OwnershipControlsRuleFilterSensitiveLog = exports.NotificationConfigurationFilterSensitiveLog = exports.TopicConfigurationFilterSensitiveLog = exports.QueueConfigurationFilterSensitiveLog = exports.LambdaFunctionConfigurationFilterSensitiveLog = exports.NotificationConfigurationFilterFilterSensitiveLog = exports.S3KeyFilterFilterSensitiveLog = exports.FilterRuleFilterSensitiveLog = exports.EventBridgeConfigurationFilterSensitiveLog = exports.GetBucketNotificationConfigurationRequestFilterSensitiveLog = exports.GetBucketMetricsConfigurationRequestFilterSensitiveLog = exports.GetBucketMetricsConfigurationOutputFilterSensitiveLog = exports.MetricsConfigurationFilterSensitiveLog = exports.MetricsFilterFilterSensitiveLog = exports.MetricsAndOperatorFilterSensitiveLog = exports.GetBucketLoggingRequestFilterSensitiveLog = exports.GetBucketLoggingOutputFilterSensitiveLog = exports.LoggingEnabledFilterSensitiveLog = exports.TargetGrantFilterSensitiveLog = exports.GetBucketLocationRequestFilterSensitiveLog = exports.GetBucketLocationOutputFilterSensitiveLog = exports.GetBucketLifecycleConfigurationRequestFilterSensitiveLog = exports.GetBucketLifecycleConfigurationOutputFilterSensitiveLog = exports.LifecycleRuleFilterSensitiveLog = exports.TransitionFilterSensitiveLog = exports.NoncurrentVersionTransitionFilterSensitiveLog = exports.NoncurrentVersionExpirationFilterSensitiveLog = exports.LifecycleRuleFilterFilterSensitiveLog = void 0; -exports.ListBucketIntelligentTieringConfigurationsRequestFilterSensitiveLog = exports.ListBucketIntelligentTieringConfigurationsOutputFilterSensitiveLog = exports.ListBucketAnalyticsConfigurationsRequestFilterSensitiveLog = exports.ListBucketAnalyticsConfigurationsOutputFilterSensitiveLog = exports.HeadObjectRequestFilterSensitiveLog = exports.HeadObjectOutputFilterSensitiveLog = exports.HeadBucketRequestFilterSensitiveLog = exports.GetPublicAccessBlockRequestFilterSensitiveLog = exports.GetPublicAccessBlockOutputFilterSensitiveLog = exports.PublicAccessBlockConfigurationFilterSensitiveLog = exports.GetObjectTorrentRequestFilterSensitiveLog = exports.GetObjectTorrentOutputFilterSensitiveLog = exports.GetObjectTaggingRequestFilterSensitiveLog = exports.GetObjectTaggingOutputFilterSensitiveLog = exports.GetObjectRetentionRequestFilterSensitiveLog = exports.GetObjectRetentionOutputFilterSensitiveLog = exports.ObjectLockRetentionFilterSensitiveLog = exports.GetObjectLockConfigurationRequestFilterSensitiveLog = exports.GetObjectLockConfigurationOutputFilterSensitiveLog = exports.ObjectLockConfigurationFilterSensitiveLog = exports.ObjectLockRuleFilterSensitiveLog = exports.DefaultRetentionFilterSensitiveLog = exports.GetObjectLegalHoldRequestFilterSensitiveLog = exports.GetObjectLegalHoldOutputFilterSensitiveLog = exports.ObjectLockLegalHoldFilterSensitiveLog = exports.GetObjectAttributesRequestFilterSensitiveLog = exports.GetObjectAttributesOutputFilterSensitiveLog = exports.GetObjectAttributesPartsFilterSensitiveLog = exports.ObjectPartFilterSensitiveLog = exports.ChecksumFilterSensitiveLog = exports.GetObjectAclRequestFilterSensitiveLog = exports.GetObjectAclOutputFilterSensitiveLog = exports.GetObjectRequestFilterSensitiveLog = exports.GetObjectOutputFilterSensitiveLog = exports.GetBucketWebsiteRequestFilterSensitiveLog = exports.GetBucketWebsiteOutputFilterSensitiveLog = exports.RoutingRuleFilterSensitiveLog = exports.RedirectFilterSensitiveLog = exports.ConditionFilterSensitiveLog = exports.RedirectAllRequestsToFilterSensitiveLog = exports.IndexDocumentFilterSensitiveLog = exports.ErrorDocumentFilterSensitiveLog = exports.GetBucketVersioningRequestFilterSensitiveLog = exports.GetBucketVersioningOutputFilterSensitiveLog = exports.GetBucketTaggingRequestFilterSensitiveLog = exports.GetBucketTaggingOutputFilterSensitiveLog = exports.GetBucketRequestPaymentRequestFilterSensitiveLog = exports.GetBucketRequestPaymentOutputFilterSensitiveLog = exports.GetBucketReplicationRequestFilterSensitiveLog = exports.GetBucketReplicationOutputFilterSensitiveLog = void 0; -exports.PutObjectRequestFilterSensitiveLog = exports.PutObjectOutputFilterSensitiveLog = exports.PutBucketWebsiteRequestFilterSensitiveLog = exports.WebsiteConfigurationFilterSensitiveLog = exports.PutBucketVersioningRequestFilterSensitiveLog = exports.VersioningConfigurationFilterSensitiveLog = exports.PutBucketTaggingRequestFilterSensitiveLog = exports.TaggingFilterSensitiveLog = exports.PutBucketRequestPaymentRequestFilterSensitiveLog = exports.RequestPaymentConfigurationFilterSensitiveLog = exports.PutBucketReplicationRequestFilterSensitiveLog = exports.PutBucketPolicyRequestFilterSensitiveLog = exports.PutBucketOwnershipControlsRequestFilterSensitiveLog = exports.PutBucketNotificationConfigurationRequestFilterSensitiveLog = exports.PutBucketMetricsConfigurationRequestFilterSensitiveLog = exports.PutBucketLoggingRequestFilterSensitiveLog = exports.BucketLoggingStatusFilterSensitiveLog = exports.PutBucketLifecycleConfigurationRequestFilterSensitiveLog = exports.BucketLifecycleConfigurationFilterSensitiveLog = exports.PutBucketInventoryConfigurationRequestFilterSensitiveLog = exports.PutBucketIntelligentTieringConfigurationRequestFilterSensitiveLog = exports.PutBucketEncryptionRequestFilterSensitiveLog = exports.PutBucketCorsRequestFilterSensitiveLog = exports.CORSConfigurationFilterSensitiveLog = exports.PutBucketAnalyticsConfigurationRequestFilterSensitiveLog = exports.PutBucketAclRequestFilterSensitiveLog = exports.PutBucketAccelerateConfigurationRequestFilterSensitiveLog = exports.ListPartsRequestFilterSensitiveLog = exports.ListPartsOutputFilterSensitiveLog = exports.PartFilterSensitiveLog = exports.ListObjectVersionsRequestFilterSensitiveLog = exports.ListObjectVersionsOutputFilterSensitiveLog = exports.ObjectVersionFilterSensitiveLog = exports.DeleteMarkerEntryFilterSensitiveLog = exports.ListObjectsV2RequestFilterSensitiveLog = exports.ListObjectsV2OutputFilterSensitiveLog = exports.ListObjectsRequestFilterSensitiveLog = exports.ListObjectsOutputFilterSensitiveLog = exports._ObjectFilterSensitiveLog = exports.ListMultipartUploadsRequestFilterSensitiveLog = exports.ListMultipartUploadsOutputFilterSensitiveLog = exports.MultipartUploadFilterSensitiveLog = exports.InitiatorFilterSensitiveLog = exports.CommonPrefixFilterSensitiveLog = exports.ListBucketsOutputFilterSensitiveLog = exports.BucketFilterSensitiveLog = exports.ListBucketMetricsConfigurationsRequestFilterSensitiveLog = exports.ListBucketMetricsConfigurationsOutputFilterSensitiveLog = exports.ListBucketInventoryConfigurationsRequestFilterSensitiveLog = exports.ListBucketInventoryConfigurationsOutputFilterSensitiveLog = void 0; -exports.PutObjectLockConfigurationRequestFilterSensitiveLog = exports.PutObjectLockConfigurationOutputFilterSensitiveLog = exports.PutObjectLegalHoldRequestFilterSensitiveLog = exports.PutObjectLegalHoldOutputFilterSensitiveLog = exports.PutObjectAclRequestFilterSensitiveLog = exports.PutObjectAclOutputFilterSensitiveLog = void 0; -const smithy_client_1 = __nccwpck_require__(26351); -const S3ServiceException_1 = __nccwpck_require__(60929); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 class NoSuchUpload extends S3ServiceException_1.S3ServiceException { constructor(opts) { super({ @@ -17537,28 +14507,18 @@ exports.PutBucketInventoryConfigurationRequestFilterSensitiveLog = PutBucketInve /***/ }), -<<<<<<< HEAD -/***/ 71767: -======= -/***/ 43228: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 5281: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.WriteGetObjectResponseRequestFilterSensitiveLog = exports.UploadPartCopyRequestFilterSensitiveLog = exports.UploadPartCopyOutputFilterSensitiveLog = exports.UploadPartRequestFilterSensitiveLog = exports.UploadPartOutputFilterSensitiveLog = exports.SelectObjectContentRequestFilterSensitiveLog = exports.SelectObjectContentOutputFilterSensitiveLog = exports.SelectObjectContentEventStreamFilterSensitiveLog = exports.RestoreObjectRequestFilterSensitiveLog = exports.RestoreRequestFilterSensitiveLog = exports.OutputLocationFilterSensitiveLog = exports.S3LocationFilterSensitiveLog = exports.EncryptionFilterSensitiveLog = exports.PutObjectRequestFilterSensitiveLog = exports.PutObjectOutputFilterSensitiveLog = exports.SelectObjectContentEventStream = exports.RestoreRequestType = exports.QuoteFields = exports.JSONType = exports.FileHeaderInfo = exports.CompressionType = exports.ExpressionType = exports.Tier = exports.ObjectAlreadyInActiveTierError = exports.MFADelete = void 0; -const smithy_client_1 = __nccwpck_require__(33218); -const S3ServiceException_1 = __nccwpck_require__(67895); +const smithy_client_1 = __nccwpck_require__(42584); +const S3ServiceException_1 = __nccwpck_require__(33881); exports.MFADelete = { Disabled: "Disabled", Enabled: "Enabled", }; -======= -exports.WriteGetObjectResponseRequestFilterSensitiveLog = exports.UploadPartCopyRequestFilterSensitiveLog = exports.UploadPartCopyOutputFilterSensitiveLog = exports.CopyPartResultFilterSensitiveLog = exports.UploadPartRequestFilterSensitiveLog = exports.UploadPartOutputFilterSensitiveLog = exports.SelectObjectContentRequestFilterSensitiveLog = exports.ScanRangeFilterSensitiveLog = exports.RequestProgressFilterSensitiveLog = exports.SelectObjectContentOutputFilterSensitiveLog = exports.SelectObjectContentEventStreamFilterSensitiveLog = exports.StatsEventFilterSensitiveLog = exports.StatsFilterSensitiveLog = exports.RecordsEventFilterSensitiveLog = exports.ProgressEventFilterSensitiveLog = exports.ProgressFilterSensitiveLog = exports.EndEventFilterSensitiveLog = exports.ContinuationEventFilterSensitiveLog = exports.RestoreObjectRequestFilterSensitiveLog = exports.RestoreRequestFilterSensitiveLog = exports.SelectParametersFilterSensitiveLog = exports.OutputSerializationFilterSensitiveLog = exports.JSONOutputFilterSensitiveLog = exports.CSVOutputFilterSensitiveLog = exports.InputSerializationFilterSensitiveLog = exports.ParquetInputFilterSensitiveLog = exports.JSONInputFilterSensitiveLog = exports.CSVInputFilterSensitiveLog = exports.OutputLocationFilterSensitiveLog = exports.S3LocationFilterSensitiveLog = exports.MetadataEntryFilterSensitiveLog = exports.EncryptionFilterSensitiveLog = exports.GlacierJobParametersFilterSensitiveLog = exports.RestoreObjectOutputFilterSensitiveLog = exports.PutPublicAccessBlockRequestFilterSensitiveLog = exports.PutObjectTaggingRequestFilterSensitiveLog = exports.PutObjectTaggingOutputFilterSensitiveLog = exports.PutObjectRetentionRequestFilterSensitiveLog = exports.PutObjectRetentionOutputFilterSensitiveLog = exports.SelectObjectContentEventStream = exports.RestoreRequestType = exports.QuoteFields = exports.JSONType = exports.FileHeaderInfo = exports.ObjectAlreadyInActiveTierError = void 0; -const smithy_client_1 = __nccwpck_require__(26351); -const S3ServiceException_1 = __nccwpck_require__(60929); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 class ObjectAlreadyInActiveTierError extends S3ServiceException_1.S3ServiceException { constructor(opts) { super({ @@ -17710,11 +14670,7 @@ exports.WriteGetObjectResponseRequestFilterSensitiveLog = WriteGetObjectResponse /***/ }), -<<<<<<< HEAD -/***/ 56895: -======= -/***/ 41811: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 42546: /***/ ((__unused_webpack_module, exports) => { @@ -17723,199 +14679,84 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -<<<<<<< HEAD -/***/ 19931: +/***/ 34157: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.paginateListDirectoryBuckets = void 0; -const core_1 = __nccwpck_require__(53938); -const ListDirectoryBucketsCommand_1 = __nccwpck_require__(38902); -const S3Client_1 = __nccwpck_require__(34692); +const core_1 = __nccwpck_require__(41911); +const ListDirectoryBucketsCommand_1 = __nccwpck_require__(41730); +const S3Client_1 = __nccwpck_require__(26625); exports.paginateListDirectoryBuckets = (0, core_1.createPaginator)(S3Client_1.S3Client, ListDirectoryBucketsCommand_1.ListDirectoryBucketsCommand, "ContinuationToken", "ContinuationToken", "MaxDirectoryBuckets"); /***/ }), -/***/ 8142: -======= -/***/ 26867: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 87685: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.paginateListObjectsV2 = void 0; -<<<<<<< HEAD -const core_1 = __nccwpck_require__(53938); -const ListObjectsV2Command_1 = __nccwpck_require__(57262); -const S3Client_1 = __nccwpck_require__(34692); +const core_1 = __nccwpck_require__(41911); +const ListObjectsV2Command_1 = __nccwpck_require__(14116); +const S3Client_1 = __nccwpck_require__(26625); exports.paginateListObjectsV2 = (0, core_1.createPaginator)(S3Client_1.S3Client, ListObjectsV2Command_1.ListObjectsV2Command, "ContinuationToken", "NextContinuationToken", "MaxKeys"); -======= -const ListObjectsV2Command_1 = __nccwpck_require__(33259); -const S3_1 = __nccwpck_require__(10223); -const S3Client_1 = __nccwpck_require__(17824); -const makePagedClientRequest = async (client, input, ...args) => { - return await client.send(new ListObjectsV2Command_1.ListObjectsV2Command(input), ...args); -}; -const makePagedRequest = async (client, input, ...args) => { - return await client.listObjectsV2(input, ...args); -}; -async function* paginateListObjectsV2(config, input, ...additionalArguments) { - let token = config.startingToken || undefined; - let hasNext = true; - let page; - while (hasNext) { - input.ContinuationToken = token; - input["MaxKeys"] = config.pageSize; - if (config.client instanceof S3_1.S3) { - page = await makePagedRequest(config.client, input, ...additionalArguments); - } - else if (config.client instanceof S3Client_1.S3Client) { - page = await makePagedClientRequest(config.client, input, ...additionalArguments); - } - else { - throw new Error("Invalid client, expected S3 | S3Client"); - } - yield page; - const prevToken = token; - token = page.NextContinuationToken; - hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); - } - return undefined; -} -exports.paginateListObjectsV2 = paginateListObjectsV2; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 /***/ }), -<<<<<<< HEAD -/***/ 5379: -======= -/***/ 94827: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 26286: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.paginateListParts = void 0; -<<<<<<< HEAD -const core_1 = __nccwpck_require__(53938); -const ListPartsCommand_1 = __nccwpck_require__(68740); -const S3Client_1 = __nccwpck_require__(34692); +const core_1 = __nccwpck_require__(41911); +const ListPartsCommand_1 = __nccwpck_require__(65560); +const S3Client_1 = __nccwpck_require__(26625); exports.paginateListParts = (0, core_1.createPaginator)(S3Client_1.S3Client, ListPartsCommand_1.ListPartsCommand, "PartNumberMarker", "NextPartNumberMarker", "MaxParts"); -======= -const ListPartsCommand_1 = __nccwpck_require__(83080); -const S3_1 = __nccwpck_require__(10223); -const S3Client_1 = __nccwpck_require__(17824); -const makePagedClientRequest = async (client, input, ...args) => { - return await client.send(new ListPartsCommand_1.ListPartsCommand(input), ...args); -}; -const makePagedRequest = async (client, input, ...args) => { - return await client.listParts(input, ...args); -}; -async function* paginateListParts(config, input, ...additionalArguments) { - let token = config.startingToken || undefined; - let hasNext = true; - let page; - while (hasNext) { - input.PartNumberMarker = token; - input["MaxParts"] = config.pageSize; - if (config.client instanceof S3_1.S3) { - page = await makePagedRequest(config.client, input, ...additionalArguments); - } - else if (config.client instanceof S3Client_1.S3Client) { - page = await makePagedClientRequest(config.client, input, ...additionalArguments); - } - else { - throw new Error("Invalid client, expected S3 | S3Client"); - } - yield page; - const prevToken = token; - token = page.NextPartNumberMarker; - hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); - } - return undefined; -} -exports.paginateListParts = paginateListParts; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 /***/ }), -<<<<<<< HEAD -/***/ 2714: -======= -/***/ 28743: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 556: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(91685); -tslib_1.__exportStar(__nccwpck_require__(56895), exports); -tslib_1.__exportStar(__nccwpck_require__(19931), exports); -tslib_1.__exportStar(__nccwpck_require__(8142), exports); -tslib_1.__exportStar(__nccwpck_require__(5379), exports); -======= -const tslib_1 = __nccwpck_require__(73563); -tslib_1.__exportStar(__nccwpck_require__(41811), exports); -tslib_1.__exportStar(__nccwpck_require__(26867), exports); -tslib_1.__exportStar(__nccwpck_require__(94827), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(42546), exports); +tslib_1.__exportStar(__nccwpck_require__(34157), exports); +tslib_1.__exportStar(__nccwpck_require__(87685), exports); +tslib_1.__exportStar(__nccwpck_require__(26286), exports); /***/ }), -<<<<<<< HEAD -/***/ 70395: -======= -/***/ 75255: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 45028: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.se_GetObjectTaggingCommand = exports.se_GetObjectRetentionCommand = exports.se_GetObjectLockConfigurationCommand = exports.se_GetObjectLegalHoldCommand = exports.se_GetObjectAttributesCommand = exports.se_GetObjectAclCommand = exports.se_GetObjectCommand = exports.se_GetBucketWebsiteCommand = exports.se_GetBucketVersioningCommand = exports.se_GetBucketTaggingCommand = exports.se_GetBucketRequestPaymentCommand = exports.se_GetBucketReplicationCommand = exports.se_GetBucketPolicyStatusCommand = exports.se_GetBucketPolicyCommand = exports.se_GetBucketOwnershipControlsCommand = exports.se_GetBucketNotificationConfigurationCommand = exports.se_GetBucketMetricsConfigurationCommand = exports.se_GetBucketLoggingCommand = exports.se_GetBucketLocationCommand = exports.se_GetBucketLifecycleConfigurationCommand = exports.se_GetBucketInventoryConfigurationCommand = exports.se_GetBucketIntelligentTieringConfigurationCommand = exports.se_GetBucketEncryptionCommand = exports.se_GetBucketCorsCommand = exports.se_GetBucketAnalyticsConfigurationCommand = exports.se_GetBucketAclCommand = exports.se_GetBucketAccelerateConfigurationCommand = exports.se_DeletePublicAccessBlockCommand = exports.se_DeleteObjectTaggingCommand = exports.se_DeleteObjectsCommand = exports.se_DeleteObjectCommand = exports.se_DeleteBucketWebsiteCommand = exports.se_DeleteBucketTaggingCommand = exports.se_DeleteBucketReplicationCommand = exports.se_DeleteBucketPolicyCommand = exports.se_DeleteBucketOwnershipControlsCommand = exports.se_DeleteBucketMetricsConfigurationCommand = exports.se_DeleteBucketLifecycleCommand = exports.se_DeleteBucketInventoryConfigurationCommand = exports.se_DeleteBucketIntelligentTieringConfigurationCommand = exports.se_DeleteBucketEncryptionCommand = exports.se_DeleteBucketCorsCommand = exports.se_DeleteBucketAnalyticsConfigurationCommand = exports.se_DeleteBucketCommand = exports.se_CreateSessionCommand = exports.se_CreateMultipartUploadCommand = exports.se_CreateBucketCommand = exports.se_CopyObjectCommand = exports.se_CompleteMultipartUploadCommand = exports.se_AbortMultipartUploadCommand = void 0; exports.de_CreateMultipartUploadCommand = exports.de_CreateBucketCommand = exports.de_CopyObjectCommand = exports.de_CompleteMultipartUploadCommand = exports.de_AbortMultipartUploadCommand = exports.se_WriteGetObjectResponseCommand = exports.se_UploadPartCopyCommand = exports.se_UploadPartCommand = exports.se_SelectObjectContentCommand = exports.se_RestoreObjectCommand = exports.se_PutPublicAccessBlockCommand = exports.se_PutObjectTaggingCommand = exports.se_PutObjectRetentionCommand = exports.se_PutObjectLockConfigurationCommand = exports.se_PutObjectLegalHoldCommand = exports.se_PutObjectAclCommand = exports.se_PutObjectCommand = exports.se_PutBucketWebsiteCommand = exports.se_PutBucketVersioningCommand = exports.se_PutBucketTaggingCommand = exports.se_PutBucketRequestPaymentCommand = exports.se_PutBucketReplicationCommand = exports.se_PutBucketPolicyCommand = exports.se_PutBucketOwnershipControlsCommand = exports.se_PutBucketNotificationConfigurationCommand = exports.se_PutBucketMetricsConfigurationCommand = exports.se_PutBucketLoggingCommand = exports.se_PutBucketLifecycleConfigurationCommand = exports.se_PutBucketInventoryConfigurationCommand = exports.se_PutBucketIntelligentTieringConfigurationCommand = exports.se_PutBucketEncryptionCommand = exports.se_PutBucketCorsCommand = exports.se_PutBucketAnalyticsConfigurationCommand = exports.se_PutBucketAclCommand = exports.se_PutBucketAccelerateConfigurationCommand = exports.se_ListPartsCommand = exports.se_ListObjectVersionsCommand = exports.se_ListObjectsV2Command = exports.se_ListObjectsCommand = exports.se_ListMultipartUploadsCommand = exports.se_ListDirectoryBucketsCommand = exports.se_ListBucketsCommand = exports.se_ListBucketMetricsConfigurationsCommand = exports.se_ListBucketInventoryConfigurationsCommand = exports.se_ListBucketIntelligentTieringConfigurationsCommand = exports.se_ListBucketAnalyticsConfigurationsCommand = exports.se_HeadObjectCommand = exports.se_HeadBucketCommand = exports.se_GetPublicAccessBlockCommand = exports.se_GetObjectTorrentCommand = void 0; exports.de_ListBucketAnalyticsConfigurationsCommand = exports.de_HeadObjectCommand = exports.de_HeadBucketCommand = exports.de_GetPublicAccessBlockCommand = exports.de_GetObjectTorrentCommand = exports.de_GetObjectTaggingCommand = exports.de_GetObjectRetentionCommand = exports.de_GetObjectLockConfigurationCommand = exports.de_GetObjectLegalHoldCommand = exports.de_GetObjectAttributesCommand = exports.de_GetObjectAclCommand = exports.de_GetObjectCommand = exports.de_GetBucketWebsiteCommand = exports.de_GetBucketVersioningCommand = exports.de_GetBucketTaggingCommand = exports.de_GetBucketRequestPaymentCommand = exports.de_GetBucketReplicationCommand = exports.de_GetBucketPolicyStatusCommand = exports.de_GetBucketPolicyCommand = exports.de_GetBucketOwnershipControlsCommand = exports.de_GetBucketNotificationConfigurationCommand = exports.de_GetBucketMetricsConfigurationCommand = exports.de_GetBucketLoggingCommand = exports.de_GetBucketLocationCommand = exports.de_GetBucketLifecycleConfigurationCommand = exports.de_GetBucketInventoryConfigurationCommand = exports.de_GetBucketIntelligentTieringConfigurationCommand = exports.de_GetBucketEncryptionCommand = exports.de_GetBucketCorsCommand = exports.de_GetBucketAnalyticsConfigurationCommand = exports.de_GetBucketAclCommand = exports.de_GetBucketAccelerateConfigurationCommand = exports.de_DeletePublicAccessBlockCommand = exports.de_DeleteObjectTaggingCommand = exports.de_DeleteObjectsCommand = exports.de_DeleteObjectCommand = exports.de_DeleteBucketWebsiteCommand = exports.de_DeleteBucketTaggingCommand = exports.de_DeleteBucketReplicationCommand = exports.de_DeleteBucketPolicyCommand = exports.de_DeleteBucketOwnershipControlsCommand = exports.de_DeleteBucketMetricsConfigurationCommand = exports.de_DeleteBucketLifecycleCommand = exports.de_DeleteBucketInventoryConfigurationCommand = exports.de_DeleteBucketIntelligentTieringConfigurationCommand = exports.de_DeleteBucketEncryptionCommand = exports.de_DeleteBucketCorsCommand = exports.de_DeleteBucketAnalyticsConfigurationCommand = exports.de_DeleteBucketCommand = exports.de_CreateSessionCommand = void 0; exports.de_WriteGetObjectResponseCommand = exports.de_UploadPartCopyCommand = exports.de_UploadPartCommand = exports.de_SelectObjectContentCommand = exports.de_RestoreObjectCommand = exports.de_PutPublicAccessBlockCommand = exports.de_PutObjectTaggingCommand = exports.de_PutObjectRetentionCommand = exports.de_PutObjectLockConfigurationCommand = exports.de_PutObjectLegalHoldCommand = exports.de_PutObjectAclCommand = exports.de_PutObjectCommand = exports.de_PutBucketWebsiteCommand = exports.de_PutBucketVersioningCommand = exports.de_PutBucketTaggingCommand = exports.de_PutBucketRequestPaymentCommand = exports.de_PutBucketReplicationCommand = exports.de_PutBucketPolicyCommand = exports.de_PutBucketOwnershipControlsCommand = exports.de_PutBucketNotificationConfigurationCommand = exports.de_PutBucketMetricsConfigurationCommand = exports.de_PutBucketLoggingCommand = exports.de_PutBucketLifecycleConfigurationCommand = exports.de_PutBucketInventoryConfigurationCommand = exports.de_PutBucketIntelligentTieringConfigurationCommand = exports.de_PutBucketEncryptionCommand = exports.de_PutBucketCorsCommand = exports.de_PutBucketAnalyticsConfigurationCommand = exports.de_PutBucketAclCommand = exports.de_PutBucketAccelerateConfigurationCommand = exports.de_ListPartsCommand = exports.de_ListObjectVersionsCommand = exports.de_ListObjectsV2Command = exports.de_ListObjectsCommand = exports.de_ListMultipartUploadsCommand = exports.de_ListDirectoryBucketsCommand = exports.de_ListBucketsCommand = exports.de_ListBucketMetricsConfigurationsCommand = exports.de_ListBucketInventoryConfigurationsCommand = exports.de_ListBucketIntelligentTieringConfigurationsCommand = void 0; -const xml_builder_1 = __nccwpck_require__(63131); -const core_1 = __nccwpck_require__(53938); -const protocol_http_1 = __nccwpck_require__(45311); -const smithy_client_1 = __nccwpck_require__(33218); -const fast_xml_parser_1 = __nccwpck_require__(6714); -const models_0_1 = __nccwpck_require__(22729); -const models_1_1 = __nccwpck_require__(71767); -const S3ServiceException_1 = __nccwpck_require__(67895); +const xml_builder_1 = __nccwpck_require__(3518); +const core_1 = __nccwpck_require__(41911); +const protocol_http_1 = __nccwpck_require__(76232); +const smithy_client_1 = __nccwpck_require__(42584); +const fast_xml_parser_1 = __nccwpck_require__(64992); +const models_0_1 = __nccwpck_require__(2384); +const models_1_1 = __nccwpck_require__(5281); +const S3ServiceException_1 = __nccwpck_require__(33881); const se_AbortMultipartUploadCommand = async (input, context) => { const b = (0, core_1.requestBuilder)(input, context); const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, { [_xarp]: input[_RP], [_xaebo]: input[_EBO], -======= -exports.serializeAws_restXmlGetObjectTorrentCommand = exports.serializeAws_restXmlGetObjectTaggingCommand = exports.serializeAws_restXmlGetObjectRetentionCommand = exports.serializeAws_restXmlGetObjectLockConfigurationCommand = exports.serializeAws_restXmlGetObjectLegalHoldCommand = exports.serializeAws_restXmlGetObjectAttributesCommand = exports.serializeAws_restXmlGetObjectAclCommand = exports.serializeAws_restXmlGetObjectCommand = exports.serializeAws_restXmlGetBucketWebsiteCommand = exports.serializeAws_restXmlGetBucketVersioningCommand = exports.serializeAws_restXmlGetBucketTaggingCommand = exports.serializeAws_restXmlGetBucketRequestPaymentCommand = exports.serializeAws_restXmlGetBucketReplicationCommand = exports.serializeAws_restXmlGetBucketPolicyStatusCommand = exports.serializeAws_restXmlGetBucketPolicyCommand = exports.serializeAws_restXmlGetBucketOwnershipControlsCommand = exports.serializeAws_restXmlGetBucketNotificationConfigurationCommand = exports.serializeAws_restXmlGetBucketMetricsConfigurationCommand = exports.serializeAws_restXmlGetBucketLoggingCommand = exports.serializeAws_restXmlGetBucketLocationCommand = exports.serializeAws_restXmlGetBucketLifecycleConfigurationCommand = exports.serializeAws_restXmlGetBucketInventoryConfigurationCommand = exports.serializeAws_restXmlGetBucketIntelligentTieringConfigurationCommand = exports.serializeAws_restXmlGetBucketEncryptionCommand = exports.serializeAws_restXmlGetBucketCorsCommand = exports.serializeAws_restXmlGetBucketAnalyticsConfigurationCommand = exports.serializeAws_restXmlGetBucketAclCommand = exports.serializeAws_restXmlGetBucketAccelerateConfigurationCommand = exports.serializeAws_restXmlDeletePublicAccessBlockCommand = exports.serializeAws_restXmlDeleteObjectTaggingCommand = exports.serializeAws_restXmlDeleteObjectsCommand = exports.serializeAws_restXmlDeleteObjectCommand = exports.serializeAws_restXmlDeleteBucketWebsiteCommand = exports.serializeAws_restXmlDeleteBucketTaggingCommand = exports.serializeAws_restXmlDeleteBucketReplicationCommand = exports.serializeAws_restXmlDeleteBucketPolicyCommand = exports.serializeAws_restXmlDeleteBucketOwnershipControlsCommand = exports.serializeAws_restXmlDeleteBucketMetricsConfigurationCommand = exports.serializeAws_restXmlDeleteBucketLifecycleCommand = exports.serializeAws_restXmlDeleteBucketInventoryConfigurationCommand = exports.serializeAws_restXmlDeleteBucketIntelligentTieringConfigurationCommand = exports.serializeAws_restXmlDeleteBucketEncryptionCommand = exports.serializeAws_restXmlDeleteBucketCorsCommand = exports.serializeAws_restXmlDeleteBucketAnalyticsConfigurationCommand = exports.serializeAws_restXmlDeleteBucketCommand = exports.serializeAws_restXmlCreateMultipartUploadCommand = exports.serializeAws_restXmlCreateBucketCommand = exports.serializeAws_restXmlCopyObjectCommand = exports.serializeAws_restXmlCompleteMultipartUploadCommand = exports.serializeAws_restXmlAbortMultipartUploadCommand = void 0; -exports.deserializeAws_restXmlDeleteBucketAnalyticsConfigurationCommand = exports.deserializeAws_restXmlDeleteBucketCommand = exports.deserializeAws_restXmlCreateMultipartUploadCommand = exports.deserializeAws_restXmlCreateBucketCommand = exports.deserializeAws_restXmlCopyObjectCommand = exports.deserializeAws_restXmlCompleteMultipartUploadCommand = exports.deserializeAws_restXmlAbortMultipartUploadCommand = exports.serializeAws_restXmlWriteGetObjectResponseCommand = exports.serializeAws_restXmlUploadPartCopyCommand = exports.serializeAws_restXmlUploadPartCommand = exports.serializeAws_restXmlSelectObjectContentCommand = exports.serializeAws_restXmlRestoreObjectCommand = exports.serializeAws_restXmlPutPublicAccessBlockCommand = exports.serializeAws_restXmlPutObjectTaggingCommand = exports.serializeAws_restXmlPutObjectRetentionCommand = exports.serializeAws_restXmlPutObjectLockConfigurationCommand = exports.serializeAws_restXmlPutObjectLegalHoldCommand = exports.serializeAws_restXmlPutObjectAclCommand = exports.serializeAws_restXmlPutObjectCommand = exports.serializeAws_restXmlPutBucketWebsiteCommand = exports.serializeAws_restXmlPutBucketVersioningCommand = exports.serializeAws_restXmlPutBucketTaggingCommand = exports.serializeAws_restXmlPutBucketRequestPaymentCommand = exports.serializeAws_restXmlPutBucketReplicationCommand = exports.serializeAws_restXmlPutBucketPolicyCommand = exports.serializeAws_restXmlPutBucketOwnershipControlsCommand = exports.serializeAws_restXmlPutBucketNotificationConfigurationCommand = exports.serializeAws_restXmlPutBucketMetricsConfigurationCommand = exports.serializeAws_restXmlPutBucketLoggingCommand = exports.serializeAws_restXmlPutBucketLifecycleConfigurationCommand = exports.serializeAws_restXmlPutBucketInventoryConfigurationCommand = exports.serializeAws_restXmlPutBucketIntelligentTieringConfigurationCommand = exports.serializeAws_restXmlPutBucketEncryptionCommand = exports.serializeAws_restXmlPutBucketCorsCommand = exports.serializeAws_restXmlPutBucketAnalyticsConfigurationCommand = exports.serializeAws_restXmlPutBucketAclCommand = exports.serializeAws_restXmlPutBucketAccelerateConfigurationCommand = exports.serializeAws_restXmlListPartsCommand = exports.serializeAws_restXmlListObjectVersionsCommand = exports.serializeAws_restXmlListObjectsV2Command = exports.serializeAws_restXmlListObjectsCommand = exports.serializeAws_restXmlListMultipartUploadsCommand = exports.serializeAws_restXmlListBucketsCommand = exports.serializeAws_restXmlListBucketMetricsConfigurationsCommand = exports.serializeAws_restXmlListBucketInventoryConfigurationsCommand = exports.serializeAws_restXmlListBucketIntelligentTieringConfigurationsCommand = exports.serializeAws_restXmlListBucketAnalyticsConfigurationsCommand = exports.serializeAws_restXmlHeadObjectCommand = exports.serializeAws_restXmlHeadBucketCommand = exports.serializeAws_restXmlGetPublicAccessBlockCommand = void 0; -exports.deserializeAws_restXmlListBucketMetricsConfigurationsCommand = exports.deserializeAws_restXmlListBucketInventoryConfigurationsCommand = exports.deserializeAws_restXmlListBucketIntelligentTieringConfigurationsCommand = exports.deserializeAws_restXmlListBucketAnalyticsConfigurationsCommand = exports.deserializeAws_restXmlHeadObjectCommand = exports.deserializeAws_restXmlHeadBucketCommand = exports.deserializeAws_restXmlGetPublicAccessBlockCommand = exports.deserializeAws_restXmlGetObjectTorrentCommand = exports.deserializeAws_restXmlGetObjectTaggingCommand = exports.deserializeAws_restXmlGetObjectRetentionCommand = exports.deserializeAws_restXmlGetObjectLockConfigurationCommand = exports.deserializeAws_restXmlGetObjectLegalHoldCommand = exports.deserializeAws_restXmlGetObjectAttributesCommand = exports.deserializeAws_restXmlGetObjectAclCommand = exports.deserializeAws_restXmlGetObjectCommand = exports.deserializeAws_restXmlGetBucketWebsiteCommand = exports.deserializeAws_restXmlGetBucketVersioningCommand = exports.deserializeAws_restXmlGetBucketTaggingCommand = exports.deserializeAws_restXmlGetBucketRequestPaymentCommand = exports.deserializeAws_restXmlGetBucketReplicationCommand = exports.deserializeAws_restXmlGetBucketPolicyStatusCommand = exports.deserializeAws_restXmlGetBucketPolicyCommand = exports.deserializeAws_restXmlGetBucketOwnershipControlsCommand = exports.deserializeAws_restXmlGetBucketNotificationConfigurationCommand = exports.deserializeAws_restXmlGetBucketMetricsConfigurationCommand = exports.deserializeAws_restXmlGetBucketLoggingCommand = exports.deserializeAws_restXmlGetBucketLocationCommand = exports.deserializeAws_restXmlGetBucketLifecycleConfigurationCommand = exports.deserializeAws_restXmlGetBucketInventoryConfigurationCommand = exports.deserializeAws_restXmlGetBucketIntelligentTieringConfigurationCommand = exports.deserializeAws_restXmlGetBucketEncryptionCommand = exports.deserializeAws_restXmlGetBucketCorsCommand = exports.deserializeAws_restXmlGetBucketAnalyticsConfigurationCommand = exports.deserializeAws_restXmlGetBucketAclCommand = exports.deserializeAws_restXmlGetBucketAccelerateConfigurationCommand = exports.deserializeAws_restXmlDeletePublicAccessBlockCommand = exports.deserializeAws_restXmlDeleteObjectTaggingCommand = exports.deserializeAws_restXmlDeleteObjectsCommand = exports.deserializeAws_restXmlDeleteObjectCommand = exports.deserializeAws_restXmlDeleteBucketWebsiteCommand = exports.deserializeAws_restXmlDeleteBucketTaggingCommand = exports.deserializeAws_restXmlDeleteBucketReplicationCommand = exports.deserializeAws_restXmlDeleteBucketPolicyCommand = exports.deserializeAws_restXmlDeleteBucketOwnershipControlsCommand = exports.deserializeAws_restXmlDeleteBucketMetricsConfigurationCommand = exports.deserializeAws_restXmlDeleteBucketLifecycleCommand = exports.deserializeAws_restXmlDeleteBucketInventoryConfigurationCommand = exports.deserializeAws_restXmlDeleteBucketIntelligentTieringConfigurationCommand = exports.deserializeAws_restXmlDeleteBucketEncryptionCommand = exports.deserializeAws_restXmlDeleteBucketCorsCommand = void 0; -exports.deserializeAws_restXmlWriteGetObjectResponseCommand = exports.deserializeAws_restXmlUploadPartCopyCommand = exports.deserializeAws_restXmlUploadPartCommand = exports.deserializeAws_restXmlSelectObjectContentCommand = exports.deserializeAws_restXmlRestoreObjectCommand = exports.deserializeAws_restXmlPutPublicAccessBlockCommand = exports.deserializeAws_restXmlPutObjectTaggingCommand = exports.deserializeAws_restXmlPutObjectRetentionCommand = exports.deserializeAws_restXmlPutObjectLockConfigurationCommand = exports.deserializeAws_restXmlPutObjectLegalHoldCommand = exports.deserializeAws_restXmlPutObjectAclCommand = exports.deserializeAws_restXmlPutObjectCommand = exports.deserializeAws_restXmlPutBucketWebsiteCommand = exports.deserializeAws_restXmlPutBucketVersioningCommand = exports.deserializeAws_restXmlPutBucketTaggingCommand = exports.deserializeAws_restXmlPutBucketRequestPaymentCommand = exports.deserializeAws_restXmlPutBucketReplicationCommand = exports.deserializeAws_restXmlPutBucketPolicyCommand = exports.deserializeAws_restXmlPutBucketOwnershipControlsCommand = exports.deserializeAws_restXmlPutBucketNotificationConfigurationCommand = exports.deserializeAws_restXmlPutBucketMetricsConfigurationCommand = exports.deserializeAws_restXmlPutBucketLoggingCommand = exports.deserializeAws_restXmlPutBucketLifecycleConfigurationCommand = exports.deserializeAws_restXmlPutBucketInventoryConfigurationCommand = exports.deserializeAws_restXmlPutBucketIntelligentTieringConfigurationCommand = exports.deserializeAws_restXmlPutBucketEncryptionCommand = exports.deserializeAws_restXmlPutBucketCorsCommand = exports.deserializeAws_restXmlPutBucketAnalyticsConfigurationCommand = exports.deserializeAws_restXmlPutBucketAclCommand = exports.deserializeAws_restXmlPutBucketAccelerateConfigurationCommand = exports.deserializeAws_restXmlListPartsCommand = exports.deserializeAws_restXmlListObjectVersionsCommand = exports.deserializeAws_restXmlListObjectsV2Command = exports.deserializeAws_restXmlListObjectsCommand = exports.deserializeAws_restXmlListMultipartUploadsCommand = exports.deserializeAws_restXmlListBucketsCommand = void 0; -const protocol_http_1 = __nccwpck_require__(35712); -const smithy_client_1 = __nccwpck_require__(26351); -const xml_builder_1 = __nccwpck_require__(78161); -const entities_1 = __nccwpck_require__(78677); -const fast_xml_parser_1 = __nccwpck_require__(65460); -const models_0_1 = __nccwpck_require__(30991); -const models_1_1 = __nccwpck_require__(43228); -const S3ServiceException_1 = __nccwpck_require__(60929); -const serializeAws_restXmlAbortMultipartUploadCommand = async (input, context) => { - const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); - const headers = map({}, isSerializableHeaderValue, { - "x-amz-request-payer": input.RequestPayer, - "x-amz-expected-bucket-owner": input.ExpectedBucketOwner, ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 }); b.bp("/{Key+}"); b.p("Bucket", () => input.Bucket, "{Bucket}", false); @@ -26868,61 +23709,33 @@ const loadRestXmlErrorCode = (output, data) => { /***/ }), -<<<<<<< HEAD -/***/ 12909: -======= -/***/ 94382: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 1350: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getRuntimeConfig = void 0; -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(91685); -const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(50677)); -const client_sts_1 = __nccwpck_require__(89456); -const core_1 = __nccwpck_require__(5236); -const credential_provider_node_1 = __nccwpck_require__(6497); -const middleware_bucket_endpoint_1 = __nccwpck_require__(24602); -const middleware_sdk_s3_1 = __nccwpck_require__(52776); -const util_user_agent_node_1 = __nccwpck_require__(61876); -const config_resolver_1 = __nccwpck_require__(66041); -const eventstream_serde_node_1 = __nccwpck_require__(6293); -const hash_node_1 = __nccwpck_require__(86775); -const hash_stream_node_1 = __nccwpck_require__(70516); -const middleware_retry_1 = __nccwpck_require__(54801); -const node_config_provider_1 = __nccwpck_require__(13079); -const node_http_handler_1 = __nccwpck_require__(54065); -const util_body_length_node_1 = __nccwpck_require__(87693); -const util_retry_1 = __nccwpck_require__(13744); -const runtimeConfig_shared_1 = __nccwpck_require__(39179); -const smithy_client_1 = __nccwpck_require__(33218); -const util_defaults_mode_node_1 = __nccwpck_require__(6061); -const smithy_client_2 = __nccwpck_require__(33218); -======= -const tslib_1 = __nccwpck_require__(73563); +const tslib_1 = __nccwpck_require__(47754); const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(50677)); -const client_sts_1 = __nccwpck_require__(64761); -const config_resolver_1 = __nccwpck_require__(95406); -const credential_provider_node_1 = __nccwpck_require__(96911); -const eventstream_serde_node_1 = __nccwpck_require__(97771); -const hash_node_1 = __nccwpck_require__(5541); -const hash_stream_node_1 = __nccwpck_require__(30785); -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const middleware_retry_1 = __nccwpck_require__(9352); -const node_config_provider_1 = __nccwpck_require__(15071); -const node_http_handler_1 = __nccwpck_require__(51062); -const util_base64_node_1 = __nccwpck_require__(7147); -const util_body_length_node_1 = __nccwpck_require__(19989); -const util_stream_node_1 = __nccwpck_require__(10286); -const util_user_agent_node_1 = __nccwpck_require__(7494); -const util_utf8_node_1 = __nccwpck_require__(1266); -const runtimeConfig_shared_1 = __nccwpck_require__(60976); -const smithy_client_1 = __nccwpck_require__(26351); -const util_defaults_mode_node_1 = __nccwpck_require__(64664); -const smithy_client_2 = __nccwpck_require__(26351); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const client_sts_1 = __nccwpck_require__(62077); +const core_1 = __nccwpck_require__(91295); +const credential_provider_node_1 = __nccwpck_require__(52963); +const middleware_bucket_endpoint_1 = __nccwpck_require__(29915); +const middleware_sdk_s3_1 = __nccwpck_require__(39069); +const util_user_agent_node_1 = __nccwpck_require__(22004); +const config_resolver_1 = __nccwpck_require__(36407); +const eventstream_serde_node_1 = __nccwpck_require__(99697); +const hash_node_1 = __nccwpck_require__(3127); +const hash_stream_node_1 = __nccwpck_require__(94420); +const middleware_retry_1 = __nccwpck_require__(73739); +const node_config_provider_1 = __nccwpck_require__(86711); +const node_http_handler_1 = __nccwpck_require__(48195); +const util_body_length_node_1 = __nccwpck_require__(92711); +const util_retry_1 = __nccwpck_require__(20774); +const runtimeConfig_shared_1 = __nccwpck_require__(59905); +const smithy_client_1 = __nccwpck_require__(42584); +const util_defaults_mode_node_1 = __nccwpck_require__(3147); +const smithy_client_2 = __nccwpck_require__(42584); const getRuntimeConfig = (config) => { (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); @@ -26963,29 +23776,19 @@ exports.getRuntimeConfig = getRuntimeConfig; /***/ }), -<<<<<<< HEAD -/***/ 39179: -======= -/***/ 60976: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 59905: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getRuntimeConfig = void 0; -<<<<<<< HEAD -const signature_v4_multi_region_1 = __nccwpck_require__(8149); -const smithy_client_1 = __nccwpck_require__(33218); -const url_parser_1 = __nccwpck_require__(98245); -const util_base64_1 = __nccwpck_require__(14478); -const util_stream_1 = __nccwpck_require__(55844); -const util_utf8_1 = __nccwpck_require__(38134); -const endpointResolver_1 = __nccwpck_require__(87873); -======= -const signature_v4_multi_region_1 = __nccwpck_require__(96037); -const url_parser_1 = __nccwpck_require__(13797); -const endpoints_1 = __nccwpck_require__(41178); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const signature_v4_multi_region_1 = __nccwpck_require__(43081); +const smithy_client_1 = __nccwpck_require__(42584); +const url_parser_1 = __nccwpck_require__(45013); +const util_base64_1 = __nccwpck_require__(74339); +const util_stream_1 = __nccwpck_require__(6981); +const util_utf8_1 = __nccwpck_require__(97788); +const endpointResolver_1 = __nccwpck_require__(27414); const getRuntimeConfig = (config) => { return { apiVersion: "2006-03-01", @@ -27011,20 +23814,15 @@ exports.getRuntimeConfig = getRuntimeConfig; /***/ }), -<<<<<<< HEAD -/***/ 89243: -======= -/***/ 40655: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 24582: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.resolveRuntimeExtensions = void 0; -const region_config_resolver_1 = __nccwpck_require__(35657); -const protocol_http_1 = __nccwpck_require__(45311); -const smithy_client_1 = __nccwpck_require__(33218); +const region_config_resolver_1 = __nccwpck_require__(61732); +const protocol_http_1 = __nccwpck_require__(76232); +const smithy_client_1 = __nccwpck_require__(42584); const asPartial = (t) => t; const resolveRuntimeExtensions = (runtimeConfig, extensions) => { const extensionConfiguration = { @@ -27041,48 +23839,32 @@ const resolveRuntimeExtensions = (runtimeConfig, extensions) => { }; }; exports.resolveRuntimeExtensions = resolveRuntimeExtensions; -======= -const tslib_1 = __nccwpck_require__(73563); -tslib_1.__exportStar(__nccwpck_require__(50807), exports); -tslib_1.__exportStar(__nccwpck_require__(88066), exports); -tslib_1.__exportStar(__nccwpck_require__(93117), exports); -tslib_1.__exportStar(__nccwpck_require__(14103), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 /***/ }), -<<<<<<< HEAD -/***/ 98423: +/***/ 46649: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(91685); -tslib_1.__exportStar(__nccwpck_require__(37060), exports); -tslib_1.__exportStar(__nccwpck_require__(88578), exports); -tslib_1.__exportStar(__nccwpck_require__(36551), exports); -tslib_1.__exportStar(__nccwpck_require__(29874), exports); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(65921), exports); +tslib_1.__exportStar(__nccwpck_require__(43058), exports); +tslib_1.__exportStar(__nccwpck_require__(5507), exports); +tslib_1.__exportStar(__nccwpck_require__(14818), exports); /***/ }), -/***/ 37060: -======= -/***/ 50807: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 65921: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.waitUntilBucketExists = exports.waitForBucketExists = void 0; -<<<<<<< HEAD -const util_waiter_1 = __nccwpck_require__(32406); -const HeadBucketCommand_1 = __nccwpck_require__(93946); -======= -const util_waiter_1 = __nccwpck_require__(20327); -const HeadBucketCommand_1 = __nccwpck_require__(6005); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const util_waiter_1 = __nccwpck_require__(47620); +const HeadBucketCommand_1 = __nccwpck_require__(74430); const checkState = async (client, input) => { let reason; try { @@ -27113,23 +23895,14 @@ exports.waitUntilBucketExists = waitUntilBucketExists; /***/ }), -<<<<<<< HEAD -/***/ 88578: -======= -/***/ 88066: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 43058: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.waitUntilBucketNotExists = exports.waitForBucketNotExists = void 0; -<<<<<<< HEAD -const util_waiter_1 = __nccwpck_require__(32406); -const HeadBucketCommand_1 = __nccwpck_require__(93946); -======= -const util_waiter_1 = __nccwpck_require__(20327); -const HeadBucketCommand_1 = __nccwpck_require__(6005); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const util_waiter_1 = __nccwpck_require__(47620); +const HeadBucketCommand_1 = __nccwpck_require__(74430); const checkState = async (client, input) => { let reason; try { @@ -27159,23 +23932,14 @@ exports.waitUntilBucketNotExists = waitUntilBucketNotExists; /***/ }), -<<<<<<< HEAD -/***/ 36551: -======= -/***/ 93117: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 5507: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.waitUntilObjectExists = exports.waitForObjectExists = void 0; -<<<<<<< HEAD -const util_waiter_1 = __nccwpck_require__(32406); -const HeadObjectCommand_1 = __nccwpck_require__(61280); -======= -const util_waiter_1 = __nccwpck_require__(20327); -const HeadObjectCommand_1 = __nccwpck_require__(49553); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const util_waiter_1 = __nccwpck_require__(47620); +const HeadObjectCommand_1 = __nccwpck_require__(65482); const checkState = async (client, input) => { let reason; try { @@ -27206,23 +23970,14 @@ exports.waitUntilObjectExists = waitUntilObjectExists; /***/ }), -<<<<<<< HEAD -/***/ 29874: -======= -/***/ 14103: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 14818: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.waitUntilObjectNotExists = exports.waitForObjectNotExists = void 0; -<<<<<<< HEAD -const util_waiter_1 = __nccwpck_require__(32406); -const HeadObjectCommand_1 = __nccwpck_require__(61280); -======= -const util_waiter_1 = __nccwpck_require__(20327); -const HeadObjectCommand_1 = __nccwpck_require__(49553); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const util_waiter_1 = __nccwpck_require__(47620); +const HeadObjectCommand_1 = __nccwpck_require__(65482); const checkState = async (client, input) => { let reason; try { @@ -27252,468 +24007,24 @@ exports.waitUntilObjectNotExists = waitUntilObjectNotExists; /***/ }), -<<<<<<< HEAD -/***/ 91685: -======= -/***/ 73563: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -<<<<<<< HEAD -/***/ 85368: -======= -/***/ 36603: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 5590: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SSO = void 0; -<<<<<<< HEAD -const smithy_client_1 = __nccwpck_require__(33218); -const GetRoleCredentialsCommand_1 = __nccwpck_require__(86371); -const ListAccountRolesCommand_1 = __nccwpck_require__(66932); -const ListAccountsCommand_1 = __nccwpck_require__(16772); -const LogoutCommand_1 = __nccwpck_require__(99815); -const SSOClient_1 = __nccwpck_require__(7531); +const smithy_client_1 = __nccwpck_require__(42584); +const GetRoleCredentialsCommand_1 = __nccwpck_require__(67162); +const ListAccountRolesCommand_1 = __nccwpck_require__(52478); +const ListAccountsCommand_1 = __nccwpck_require__(53752); +const LogoutCommand_1 = __nccwpck_require__(78756); +const SSOClient_1 = __nccwpck_require__(92532); const commands = { GetRoleCredentialsCommand: GetRoleCredentialsCommand_1.GetRoleCredentialsCommand, ListAccountRolesCommand: ListAccountRolesCommand_1.ListAccountRolesCommand, ListAccountsCommand: ListAccountsCommand_1.ListAccountsCommand, LogoutCommand: LogoutCommand_1.LogoutCommand, }; -======= -const GetRoleCredentialsCommand_1 = __nccwpck_require__(34986); -const ListAccountRolesCommand_1 = __nccwpck_require__(46552); -const ListAccountsCommand_1 = __nccwpck_require__(60292); -const LogoutCommand_1 = __nccwpck_require__(78571); -const SSOClient_1 = __nccwpck_require__(58166); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 class SSO extends SSOClient_1.SSOClient { } exports.SSO = SSO; @@ -27722,42 +24033,25 @@ exports.SSO = SSO; /***/ }), -<<<<<<< HEAD -/***/ 7531: -======= -/***/ 58166: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 92532: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.SSOClient = exports.__Client = void 0; -const middleware_host_header_1 = __nccwpck_require__(23213); -const middleware_logger_1 = __nccwpck_require__(45288); -const middleware_recursion_detection_1 = __nccwpck_require__(13807); -const middleware_user_agent_1 = __nccwpck_require__(3549); -const config_resolver_1 = __nccwpck_require__(66041); -const middleware_content_length_1 = __nccwpck_require__(38959); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_retry_1 = __nccwpck_require__(54801); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_host_header_1 = __nccwpck_require__(29368); +const middleware_logger_1 = __nccwpck_require__(11810); +const middleware_recursion_detection_1 = __nccwpck_require__(65185); +const middleware_user_agent_1 = __nccwpck_require__(7524); +const config_resolver_1 = __nccwpck_require__(36407); +const middleware_content_length_1 = __nccwpck_require__(48468); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_retry_1 = __nccwpck_require__(73739); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "__Client", ({ enumerable: true, get: function () { return smithy_client_1.Client; } })); -const EndpointParameters_1 = __nccwpck_require__(3494); -const runtimeConfig_1 = __nccwpck_require__(56587); -const runtimeExtensions_1 = __nccwpck_require__(91833); -======= -exports.SSOClient = void 0; -const config_resolver_1 = __nccwpck_require__(95406); -const middleware_content_length_1 = __nccwpck_require__(96962); -const middleware_host_header_1 = __nccwpck_require__(18127); -const middleware_logger_1 = __nccwpck_require__(67662); -const middleware_recursion_detection_1 = __nccwpck_require__(34755); -const middleware_retry_1 = __nccwpck_require__(9352); -const middleware_user_agent_1 = __nccwpck_require__(54738); -const smithy_client_1 = __nccwpck_require__(26351); -const runtimeConfig_1 = __nccwpck_require__(44325); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const EndpointParameters_1 = __nccwpck_require__(76540); +const runtimeConfig_1 = __nccwpck_require__(28268); +const runtimeExtensions_1 = __nccwpck_require__(51376); class SSOClient extends smithy_client_1.Client { constructor(...[configuration]) { const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {}); @@ -27786,31 +24080,19 @@ exports.SSOClient = SSOClient; /***/ }), -<<<<<<< HEAD -/***/ 86371: -======= -/***/ 34986: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 67162: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetRoleCredentialsCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(78153); -const Aws_restJson1_1 = __nccwpck_require__(5363); -======= -exports.GetRoleCredentialsCommand = void 0; -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(2895); -const Aws_restJson1_1 = __nccwpck_require__(25931); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(54802); +const Aws_restJson1_1 = __nccwpck_require__(27773); class GetRoleCredentialsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -27857,31 +24139,19 @@ exports.GetRoleCredentialsCommand = GetRoleCredentialsCommand; /***/ }), -<<<<<<< HEAD -/***/ 66932: -======= -/***/ 46552: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 52478: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.ListAccountRolesCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(78153); -const Aws_restJson1_1 = __nccwpck_require__(5363); -======= -exports.ListAccountRolesCommand = void 0; -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(2895); -const Aws_restJson1_1 = __nccwpck_require__(25931); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(54802); +const Aws_restJson1_1 = __nccwpck_require__(27773); class ListAccountRolesCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -27928,31 +24198,19 @@ exports.ListAccountRolesCommand = ListAccountRolesCommand; /***/ }), -<<<<<<< HEAD -/***/ 16772: -======= -/***/ 60292: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 53752: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.ListAccountsCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(78153); -const Aws_restJson1_1 = __nccwpck_require__(5363); -======= -exports.ListAccountsCommand = void 0; -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(2895); -const Aws_restJson1_1 = __nccwpck_require__(25931); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(54802); +const Aws_restJson1_1 = __nccwpck_require__(27773); class ListAccountsCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -27999,31 +24257,19 @@ exports.ListAccountsCommand = ListAccountsCommand; /***/ }), -<<<<<<< HEAD -/***/ 99815: -======= -/***/ 78571: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 78756: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.LogoutCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(78153); -const Aws_restJson1_1 = __nccwpck_require__(5363); -======= -exports.LogoutCommand = void 0; -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(2895); -const Aws_restJson1_1 = __nccwpck_require__(25931); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(54802); +const Aws_restJson1_1 = __nccwpck_require__(27773); class LogoutCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -28070,43 +24316,25 @@ exports.LogoutCommand = LogoutCommand; /***/ }), -<<<<<<< HEAD -/***/ 49454: -======= -/***/ 23218: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 37404: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(58896); -tslib_1.__exportStar(__nccwpck_require__(86371), exports); -tslib_1.__exportStar(__nccwpck_require__(66932), exports); -tslib_1.__exportStar(__nccwpck_require__(16772), exports); -tslib_1.__exportStar(__nccwpck_require__(99815), exports); -======= -const tslib_1 = __nccwpck_require__(93717); -tslib_1.__exportStar(__nccwpck_require__(34986), exports); -tslib_1.__exportStar(__nccwpck_require__(46552), exports); -tslib_1.__exportStar(__nccwpck_require__(60292), exports); -tslib_1.__exportStar(__nccwpck_require__(78571), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(67162), exports); +tslib_1.__exportStar(__nccwpck_require__(52478), exports); +tslib_1.__exportStar(__nccwpck_require__(53752), exports); +tslib_1.__exportStar(__nccwpck_require__(78756), exports); /***/ }), -<<<<<<< HEAD -/***/ 3494: +/***/ 76540: /***/ ((__unused_webpack_module, exports) => { -======= -/***/ 68540: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.resolveClientEndpointParameters = void 0; const resolveClientEndpointParameters = (options) => { return { @@ -28115,215 +24343,20 @@ const resolveClientEndpointParameters = (options) => { useFipsEndpoint: options.useFipsEndpoint ?? false, defaultSigningName: "awsssoportal", }; -======= -exports.defaultRegionInfoProvider = void 0; -const config_resolver_1 = __nccwpck_require__(95406); -const regionHash = { - "ap-east-1": { - variants: [ - { - hostname: "portal.sso.ap-east-1.amazonaws.com", - tags: [], - }, - ], - signingRegion: "ap-east-1", - }, - "ap-northeast-1": { - variants: [ - { - hostname: "portal.sso.ap-northeast-1.amazonaws.com", - tags: [], - }, - ], - signingRegion: "ap-northeast-1", - }, - "ap-northeast-2": { - variants: [ - { - hostname: "portal.sso.ap-northeast-2.amazonaws.com", - tags: [], - }, - ], - signingRegion: "ap-northeast-2", - }, - "ap-northeast-3": { - variants: [ - { - hostname: "portal.sso.ap-northeast-3.amazonaws.com", - tags: [], - }, - ], - signingRegion: "ap-northeast-3", - }, - "ap-south-1": { - variants: [ - { - hostname: "portal.sso.ap-south-1.amazonaws.com", - tags: [], - }, - ], - signingRegion: "ap-south-1", - }, - "ap-southeast-1": { - variants: [ - { - hostname: "portal.sso.ap-southeast-1.amazonaws.com", - tags: [], - }, - ], - signingRegion: "ap-southeast-1", - }, - "ap-southeast-2": { - variants: [ - { - hostname: "portal.sso.ap-southeast-2.amazonaws.com", - tags: [], - }, - ], - signingRegion: "ap-southeast-2", - }, - "ca-central-1": { - variants: [ - { - hostname: "portal.sso.ca-central-1.amazonaws.com", - tags: [], - }, - ], - signingRegion: "ca-central-1", - }, - "eu-central-1": { - variants: [ - { - hostname: "portal.sso.eu-central-1.amazonaws.com", - tags: [], - }, - ], - signingRegion: "eu-central-1", - }, - "eu-north-1": { - variants: [ - { - hostname: "portal.sso.eu-north-1.amazonaws.com", - tags: [], - }, - ], - signingRegion: "eu-north-1", - }, - "eu-south-1": { - variants: [ - { - hostname: "portal.sso.eu-south-1.amazonaws.com", - tags: [], - }, - ], - signingRegion: "eu-south-1", - }, - "eu-west-1": { - variants: [ - { - hostname: "portal.sso.eu-west-1.amazonaws.com", - tags: [], - }, - ], - signingRegion: "eu-west-1", - }, - "eu-west-2": { - variants: [ - { - hostname: "portal.sso.eu-west-2.amazonaws.com", - tags: [], - }, - ], - signingRegion: "eu-west-2", - }, - "eu-west-3": { - variants: [ - { - hostname: "portal.sso.eu-west-3.amazonaws.com", - tags: [], - }, - ], - signingRegion: "eu-west-3", - }, - "me-south-1": { - variants: [ - { - hostname: "portal.sso.me-south-1.amazonaws.com", - tags: [], - }, - ], - signingRegion: "me-south-1", - }, - "sa-east-1": { - variants: [ - { - hostname: "portal.sso.sa-east-1.amazonaws.com", - tags: [], - }, - ], - signingRegion: "sa-east-1", - }, - "us-east-1": { - variants: [ - { - hostname: "portal.sso.us-east-1.amazonaws.com", - tags: [], - }, - ], - signingRegion: "us-east-1", - }, - "us-east-2": { - variants: [ - { - hostname: "portal.sso.us-east-2.amazonaws.com", - tags: [], - }, - ], - signingRegion: "us-east-2", - }, - "us-gov-east-1": { - variants: [ - { - hostname: "portal.sso.us-gov-east-1.amazonaws.com", - tags: [], - }, - ], - signingRegion: "us-gov-east-1", - }, - "us-gov-west-1": { - variants: [ - { - hostname: "portal.sso.us-gov-west-1.amazonaws.com", - tags: [], - }, - ], - signingRegion: "us-gov-west-1", - }, - "us-west-2": { - variants: [ - { - hostname: "portal.sso.us-west-2.amazonaws.com", - tags: [], - }, - ], - signingRegion: "us-west-2", - }, ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 }; exports.resolveClientEndpointParameters = resolveClientEndpointParameters; /***/ }), -<<<<<<< HEAD -/***/ 94655: +/***/ 52467: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.defaultEndpointResolver = void 0; -const util_endpoints_1 = __nccwpck_require__(34548); -const ruleset_1 = __nccwpck_require__(66242); +const util_endpoints_1 = __nccwpck_require__(34863); +const ruleset_1 = __nccwpck_require__(82348); const defaultEndpointResolver = (endpointParams, context = {}) => { return (0, util_endpoints_1.resolveEndpoint)(ruleset_1.ruleSet, { endpointParams: endpointParams, @@ -28335,7 +24368,7 @@ exports.defaultEndpointResolver = defaultEndpointResolver; /***/ }), -/***/ 66242: +/***/ 82348: /***/ ((__unused_webpack_module, exports) => { @@ -28349,55 +24382,33 @@ exports.ruleSet = _data; /***/ }), -/***/ 62764: -======= -/***/ 2394: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 79736: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SSOServiceException = void 0; -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(58896); -tslib_1.__exportStar(__nccwpck_require__(7531), exports); -tslib_1.__exportStar(__nccwpck_require__(85368), exports); -tslib_1.__exportStar(__nccwpck_require__(49454), exports); -tslib_1.__exportStar(__nccwpck_require__(59289), exports); -tslib_1.__exportStar(__nccwpck_require__(32297), exports); -__nccwpck_require__(60698); -var SSOServiceException_1 = __nccwpck_require__(36989); -======= -const tslib_1 = __nccwpck_require__(93717); -tslib_1.__exportStar(__nccwpck_require__(36603), exports); -tslib_1.__exportStar(__nccwpck_require__(58166), exports); -tslib_1.__exportStar(__nccwpck_require__(23218), exports); -tslib_1.__exportStar(__nccwpck_require__(72297), exports); -tslib_1.__exportStar(__nccwpck_require__(59161), exports); -var SSOServiceException_1 = __nccwpck_require__(74691); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(92532), exports); +tslib_1.__exportStar(__nccwpck_require__(5590), exports); +tslib_1.__exportStar(__nccwpck_require__(37404), exports); +tslib_1.__exportStar(__nccwpck_require__(8296), exports); +tslib_1.__exportStar(__nccwpck_require__(19574), exports); +__nccwpck_require__(68503); +var SSOServiceException_1 = __nccwpck_require__(36418); Object.defineProperty(exports, "SSOServiceException", ({ enumerable: true, get: function () { return SSOServiceException_1.SSOServiceException; } })); /***/ }), -<<<<<<< HEAD -/***/ 36989: -======= -/***/ 74691: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 36418: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.SSOServiceException = exports.__ServiceException = void 0; -const smithy_client_1 = __nccwpck_require__(33218); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "__ServiceException", ({ enumerable: true, get: function () { return smithy_client_1.ServiceException; } })); -======= -exports.SSOServiceException = void 0; -const smithy_client_1 = __nccwpck_require__(26351); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 class SSOServiceException extends smithy_client_1.ServiceException { constructor(options) { super(options); @@ -28409,44 +24420,25 @@ exports.SSOServiceException = SSOServiceException; /***/ }), -<<<<<<< HEAD -/***/ 32297: -======= -/***/ 72297: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 19574: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(58896); -tslib_1.__exportStar(__nccwpck_require__(78153), exports); -======= -const tslib_1 = __nccwpck_require__(93717); -tslib_1.__exportStar(__nccwpck_require__(2895), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(54802), exports); /***/ }), -<<<<<<< HEAD -/***/ 78153: -======= -/***/ 2895: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 54802: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.LogoutRequestFilterSensitiveLog = exports.ListAccountsRequestFilterSensitiveLog = exports.ListAccountRolesRequestFilterSensitiveLog = exports.GetRoleCredentialsResponseFilterSensitiveLog = exports.RoleCredentialsFilterSensitiveLog = exports.GetRoleCredentialsRequestFilterSensitiveLog = exports.UnauthorizedException = exports.TooManyRequestsException = exports.ResourceNotFoundException = exports.InvalidRequestException = void 0; -const smithy_client_1 = __nccwpck_require__(33218); -const SSOServiceException_1 = __nccwpck_require__(36989); -======= -exports.LogoutRequestFilterSensitiveLog = exports.ListAccountsResponseFilterSensitiveLog = exports.ListAccountsRequestFilterSensitiveLog = exports.ListAccountRolesResponseFilterSensitiveLog = exports.RoleInfoFilterSensitiveLog = exports.ListAccountRolesRequestFilterSensitiveLog = exports.GetRoleCredentialsResponseFilterSensitiveLog = exports.RoleCredentialsFilterSensitiveLog = exports.GetRoleCredentialsRequestFilterSensitiveLog = exports.AccountInfoFilterSensitiveLog = exports.UnauthorizedException = exports.TooManyRequestsException = exports.ResourceNotFoundException = exports.InvalidRequestException = void 0; -const smithy_client_1 = __nccwpck_require__(26351); -const SSOServiceException_1 = __nccwpck_require__(74691); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const smithy_client_1 = __nccwpck_require__(42584); +const SSOServiceException_1 = __nccwpck_require__(36418); class InvalidRequestException extends SSOServiceException_1.SSOServiceException { constructor(opts) { super({ @@ -28534,11 +24526,7 @@ exports.LogoutRequestFilterSensitiveLog = LogoutRequestFilterSensitiveLog; /***/ }), -<<<<<<< HEAD -/***/ 56658: -======= -/***/ 69074: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 68897: /***/ ((__unused_webpack_module, exports) => { @@ -28547,168 +24535,61 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -<<<<<<< HEAD -/***/ 95223: -======= -/***/ 35597: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 32863: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.paginateListAccountRoles = void 0; -<<<<<<< HEAD -const core_1 = __nccwpck_require__(53938); -const ListAccountRolesCommand_1 = __nccwpck_require__(66932); -const SSOClient_1 = __nccwpck_require__(7531); +const core_1 = __nccwpck_require__(41911); +const ListAccountRolesCommand_1 = __nccwpck_require__(52478); +const SSOClient_1 = __nccwpck_require__(92532); exports.paginateListAccountRoles = (0, core_1.createPaginator)(SSOClient_1.SSOClient, ListAccountRolesCommand_1.ListAccountRolesCommand, "nextToken", "nextToken", "maxResults"); -======= -const ListAccountRolesCommand_1 = __nccwpck_require__(46552); -const SSO_1 = __nccwpck_require__(36603); -const SSOClient_1 = __nccwpck_require__(58166); -const makePagedClientRequest = async (client, input, ...args) => { - return await client.send(new ListAccountRolesCommand_1.ListAccountRolesCommand(input), ...args); -}; -const makePagedRequest = async (client, input, ...args) => { - return await client.listAccountRoles(input, ...args); -}; -async function* paginateListAccountRoles(config, input, ...additionalArguments) { - let token = config.startingToken || undefined; - let hasNext = true; - let page; - while (hasNext) { - input.nextToken = token; - input["maxResults"] = config.pageSize; - if (config.client instanceof SSO_1.SSO) { - page = await makePagedRequest(config.client, input, ...additionalArguments); - } - else if (config.client instanceof SSOClient_1.SSOClient) { - page = await makePagedClientRequest(config.client, input, ...additionalArguments); - } - else { - throw new Error("Invalid client, expected SSO | SSOClient"); - } - yield page; - const prevToken = token; - token = page.nextToken; - hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); - } - return undefined; -} -exports.paginateListAccountRoles = paginateListAccountRoles; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 /***/ }), -<<<<<<< HEAD -/***/ 45417: -======= -/***/ 25634: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 79216: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.paginateListAccounts = void 0; -<<<<<<< HEAD -const core_1 = __nccwpck_require__(53938); -const ListAccountsCommand_1 = __nccwpck_require__(16772); -const SSOClient_1 = __nccwpck_require__(7531); +const core_1 = __nccwpck_require__(41911); +const ListAccountsCommand_1 = __nccwpck_require__(53752); +const SSOClient_1 = __nccwpck_require__(92532); exports.paginateListAccounts = (0, core_1.createPaginator)(SSOClient_1.SSOClient, ListAccountsCommand_1.ListAccountsCommand, "nextToken", "nextToken", "maxResults"); -======= -const ListAccountsCommand_1 = __nccwpck_require__(60292); -const SSO_1 = __nccwpck_require__(36603); -const SSOClient_1 = __nccwpck_require__(58166); -const makePagedClientRequest = async (client, input, ...args) => { - return await client.send(new ListAccountsCommand_1.ListAccountsCommand(input), ...args); -}; -const makePagedRequest = async (client, input, ...args) => { - return await client.listAccounts(input, ...args); -}; -async function* paginateListAccounts(config, input, ...additionalArguments) { - let token = config.startingToken || undefined; - let hasNext = true; - let page; - while (hasNext) { - input.nextToken = token; - input["maxResults"] = config.pageSize; - if (config.client instanceof SSO_1.SSO) { - page = await makePagedRequest(config.client, input, ...additionalArguments); - } - else if (config.client instanceof SSOClient_1.SSOClient) { - page = await makePagedClientRequest(config.client, input, ...additionalArguments); - } - else { - throw new Error("Invalid client, expected SSO | SSOClient"); - } - yield page; - const prevToken = token; - token = page.nextToken; - hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); - } - return undefined; -} -exports.paginateListAccounts = paginateListAccounts; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 /***/ }), -<<<<<<< HEAD -/***/ 59289: -======= -/***/ 59161: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 8296: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(58896); -tslib_1.__exportStar(__nccwpck_require__(56658), exports); -tslib_1.__exportStar(__nccwpck_require__(95223), exports); -tslib_1.__exportStar(__nccwpck_require__(45417), exports); -======= -const tslib_1 = __nccwpck_require__(93717); -tslib_1.__exportStar(__nccwpck_require__(69074), exports); -tslib_1.__exportStar(__nccwpck_require__(35597), exports); -tslib_1.__exportStar(__nccwpck_require__(25634), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - -/***/ }), - -<<<<<<< HEAD -/***/ 5363: -======= -/***/ 25931: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(68897), exports); +tslib_1.__exportStar(__nccwpck_require__(32863), exports); +tslib_1.__exportStar(__nccwpck_require__(79216), exports); + + +/***/ }), + +/***/ 27773: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.de_LogoutCommand = exports.de_ListAccountsCommand = exports.de_ListAccountRolesCommand = exports.de_GetRoleCredentialsCommand = exports.se_LogoutCommand = exports.se_ListAccountsCommand = exports.se_ListAccountRolesCommand = exports.se_GetRoleCredentialsCommand = void 0; -const core_1 = __nccwpck_require__(53938); -const smithy_client_1 = __nccwpck_require__(33218); -const models_0_1 = __nccwpck_require__(78153); -const SSOServiceException_1 = __nccwpck_require__(36989); +const core_1 = __nccwpck_require__(41911); +const smithy_client_1 = __nccwpck_require__(42584); +const models_0_1 = __nccwpck_require__(54802); +const SSOServiceException_1 = __nccwpck_require__(36418); const se_GetRoleCredentialsCommand = async (input, context) => { const b = (0, core_1.requestBuilder)(input, context); const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, { [_xasbt]: input[_aT], -======= -exports.deserializeAws_restJson1LogoutCommand = exports.deserializeAws_restJson1ListAccountsCommand = exports.deserializeAws_restJson1ListAccountRolesCommand = exports.deserializeAws_restJson1GetRoleCredentialsCommand = exports.serializeAws_restJson1LogoutCommand = exports.serializeAws_restJson1ListAccountsCommand = exports.serializeAws_restJson1ListAccountRolesCommand = exports.serializeAws_restJson1GetRoleCredentialsCommand = void 0; -const protocol_http_1 = __nccwpck_require__(35712); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(2895); -const SSOServiceException_1 = __nccwpck_require__(74691); -const serializeAws_restJson1GetRoleCredentialsCommand = async (input, context) => { - const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); - const headers = map({}, isSerializableHeaderValue, { - "x-amz-sso_bearer_token": input.accessToken, ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 }); b.bp("/federation/credentials"); const query = (0, smithy_client_1.map)({ @@ -29048,49 +24929,27 @@ const loadRestJsonErrorCode = (output, data) => { /***/ }), -<<<<<<< HEAD -/***/ 56587: -======= -/***/ 44325: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 28268: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getRuntimeConfig = void 0; -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(58896); -const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(91092)); -const core_1 = __nccwpck_require__(5236); -const util_user_agent_node_1 = __nccwpck_require__(61876); -const config_resolver_1 = __nccwpck_require__(66041); -const hash_node_1 = __nccwpck_require__(86775); -const middleware_retry_1 = __nccwpck_require__(54801); -const node_config_provider_1 = __nccwpck_require__(13079); -const node_http_handler_1 = __nccwpck_require__(54065); -const util_body_length_node_1 = __nccwpck_require__(87693); -const util_retry_1 = __nccwpck_require__(13744); -const runtimeConfig_shared_1 = __nccwpck_require__(6536); -const smithy_client_1 = __nccwpck_require__(33218); -const util_defaults_mode_node_1 = __nccwpck_require__(6061); -const smithy_client_2 = __nccwpck_require__(33218); -======= -const tslib_1 = __nccwpck_require__(93717); +const tslib_1 = __nccwpck_require__(47754); const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(91092)); -const config_resolver_1 = __nccwpck_require__(95406); -const hash_node_1 = __nccwpck_require__(5541); -const middleware_retry_1 = __nccwpck_require__(9352); -const node_config_provider_1 = __nccwpck_require__(15071); -const node_http_handler_1 = __nccwpck_require__(51062); -const util_base64_node_1 = __nccwpck_require__(7147); -const util_body_length_node_1 = __nccwpck_require__(19989); -const util_user_agent_node_1 = __nccwpck_require__(7494); -const util_utf8_node_1 = __nccwpck_require__(1266); -const runtimeConfig_shared_1 = __nccwpck_require__(97570); -const smithy_client_1 = __nccwpck_require__(26351); -const util_defaults_mode_node_1 = __nccwpck_require__(64664); -const smithy_client_2 = __nccwpck_require__(26351); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const core_1 = __nccwpck_require__(91295); +const util_user_agent_node_1 = __nccwpck_require__(22004); +const config_resolver_1 = __nccwpck_require__(36407); +const hash_node_1 = __nccwpck_require__(3127); +const middleware_retry_1 = __nccwpck_require__(73739); +const node_config_provider_1 = __nccwpck_require__(86711); +const node_http_handler_1 = __nccwpck_require__(48195); +const util_body_length_node_1 = __nccwpck_require__(92711); +const util_retry_1 = __nccwpck_require__(20774); +const runtimeConfig_shared_1 = __nccwpck_require__(33155); +const smithy_client_1 = __nccwpck_require__(42584); +const util_defaults_mode_node_1 = __nccwpck_require__(3147); +const smithy_client_2 = __nccwpck_require__(42584); const getRuntimeConfig = (config) => { (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); @@ -29124,26 +24983,17 @@ exports.getRuntimeConfig = getRuntimeConfig; /***/ }), -<<<<<<< HEAD -/***/ 6536: -======= -/***/ 97570: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 33155: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getRuntimeConfig = void 0; -<<<<<<< HEAD -const smithy_client_1 = __nccwpck_require__(33218); -const url_parser_1 = __nccwpck_require__(98245); -const util_base64_1 = __nccwpck_require__(14478); -const util_utf8_1 = __nccwpck_require__(38134); -const endpointResolver_1 = __nccwpck_require__(94655); -======= -const url_parser_1 = __nccwpck_require__(13797); -const endpoints_1 = __nccwpck_require__(68540); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const smithy_client_1 = __nccwpck_require__(42584); +const url_parser_1 = __nccwpck_require__(45013); +const util_base64_1 = __nccwpck_require__(74339); +const util_utf8_1 = __nccwpck_require__(97788); +const endpointResolver_1 = __nccwpck_require__(52467); const getRuntimeConfig = (config) => { return { apiVersion: "2019-06-10", @@ -29164,20 +25014,15 @@ exports.getRuntimeConfig = getRuntimeConfig; /***/ }), -<<<<<<< HEAD -/***/ 91833: +/***/ 51376: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -======= -/***/ 93717: -/***/ ((module) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 Object.defineProperty(exports, "__esModule", ({ value: true })); exports.resolveRuntimeExtensions = void 0; -const region_config_resolver_1 = __nccwpck_require__(35657); -const protocol_http_1 = __nccwpck_require__(45311); -const smithy_client_1 = __nccwpck_require__(33218); +const region_config_resolver_1 = __nccwpck_require__(61732); +const protocol_http_1 = __nccwpck_require__(76232); +const smithy_client_1 = __nccwpck_require__(42584); const asPartial = (t) => t; const resolveRuntimeExtensions = (runtimeConfig, extensions) => { const extensionConfiguration = { @@ -29198,455 +25043,22 @@ exports.resolveRuntimeExtensions = resolveRuntimeExtensions; /***/ }), -<<<<<<< HEAD -/***/ 58896: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 57038: -======= -/***/ 86582: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 24326: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.STS = void 0; -<<<<<<< HEAD -const smithy_client_1 = __nccwpck_require__(33218); -const AssumeRoleCommand_1 = __nccwpck_require__(74605); -const AssumeRoleWithSAMLCommand_1 = __nccwpck_require__(96513); -const AssumeRoleWithWebIdentityCommand_1 = __nccwpck_require__(31785); -const DecodeAuthorizationMessageCommand_1 = __nccwpck_require__(31204); -const GetAccessKeyInfoCommand_1 = __nccwpck_require__(89270); -const GetCallerIdentityCommand_1 = __nccwpck_require__(26200); -const GetFederationTokenCommand_1 = __nccwpck_require__(28153); -const GetSessionTokenCommand_1 = __nccwpck_require__(83008); -const STSClient_1 = __nccwpck_require__(4722); +const smithy_client_1 = __nccwpck_require__(42584); +const AssumeRoleCommand_1 = __nccwpck_require__(69298); +const AssumeRoleWithSAMLCommand_1 = __nccwpck_require__(93686); +const AssumeRoleWithWebIdentityCommand_1 = __nccwpck_require__(38381); +const DecodeAuthorizationMessageCommand_1 = __nccwpck_require__(24609); +const GetAccessKeyInfoCommand_1 = __nccwpck_require__(91570); +const GetCallerIdentityCommand_1 = __nccwpck_require__(75343); +const GetFederationTokenCommand_1 = __nccwpck_require__(17855); +const GetSessionTokenCommand_1 = __nccwpck_require__(11596); +const STSClient_1 = __nccwpck_require__(28307); const commands = { AssumeRoleCommand: AssumeRoleCommand_1.AssumeRoleCommand, AssumeRoleWithSAMLCommand: AssumeRoleWithSAMLCommand_1.AssumeRoleWithSAMLCommand, @@ -29657,17 +25069,6 @@ const commands = { GetFederationTokenCommand: GetFederationTokenCommand_1.GetFederationTokenCommand, GetSessionTokenCommand: GetSessionTokenCommand_1.GetSessionTokenCommand, }; -======= -const AssumeRoleCommand_1 = __nccwpck_require__(94561); -const AssumeRoleWithSAMLCommand_1 = __nccwpck_require__(94498); -const AssumeRoleWithWebIdentityCommand_1 = __nccwpck_require__(59354); -const DecodeAuthorizationMessageCommand_1 = __nccwpck_require__(85251); -const GetAccessKeyInfoCommand_1 = __nccwpck_require__(24862); -const GetCallerIdentityCommand_1 = __nccwpck_require__(68498); -const GetFederationTokenCommand_1 = __nccwpck_require__(73985); -const GetSessionTokenCommand_1 = __nccwpck_require__(8424); -const STSClient_1 = __nccwpck_require__(45029); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 class STS extends STSClient_1.STSClient { } exports.STS = STS; @@ -29676,45 +25077,27 @@ exports.STS = STS; /***/ }), -<<<<<<< HEAD -/***/ 4722: -======= -/***/ 45029: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 28307: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.STSClient = exports.__Client = void 0; -const middleware_host_header_1 = __nccwpck_require__(23213); -const middleware_logger_1 = __nccwpck_require__(45288); -const middleware_recursion_detection_1 = __nccwpck_require__(13807); -const middleware_user_agent_1 = __nccwpck_require__(3549); -const config_resolver_1 = __nccwpck_require__(66041); -const core_1 = __nccwpck_require__(53938); -const middleware_content_length_1 = __nccwpck_require__(38959); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_retry_1 = __nccwpck_require__(54801); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_host_header_1 = __nccwpck_require__(29368); +const middleware_logger_1 = __nccwpck_require__(11810); +const middleware_recursion_detection_1 = __nccwpck_require__(65185); +const middleware_user_agent_1 = __nccwpck_require__(7524); +const config_resolver_1 = __nccwpck_require__(36407); +const core_1 = __nccwpck_require__(41911); +const middleware_content_length_1 = __nccwpck_require__(48468); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_retry_1 = __nccwpck_require__(73739); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "__Client", ({ enumerable: true, get: function () { return smithy_client_1.Client; } })); -const httpAuthSchemeProvider_1 = __nccwpck_require__(71613); -const EndpointParameters_1 = __nccwpck_require__(96118); -const runtimeConfig_1 = __nccwpck_require__(81144); -const runtimeExtensions_1 = __nccwpck_require__(86860); -======= -exports.STSClient = void 0; -const config_resolver_1 = __nccwpck_require__(95406); -const middleware_content_length_1 = __nccwpck_require__(96962); -const middleware_host_header_1 = __nccwpck_require__(18127); -const middleware_logger_1 = __nccwpck_require__(67662); -const middleware_recursion_detection_1 = __nccwpck_require__(34755); -const middleware_retry_1 = __nccwpck_require__(9352); -const middleware_sdk_sts_1 = __nccwpck_require__(42055); -const middleware_user_agent_1 = __nccwpck_require__(54738); -const smithy_client_1 = __nccwpck_require__(26351); -const runtimeConfig_1 = __nccwpck_require__(88739); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const httpAuthSchemeProvider_1 = __nccwpck_require__(64738); +const EndpointParameters_1 = __nccwpck_require__(74425); +const runtimeConfig_1 = __nccwpck_require__(35481); +const runtimeExtensions_1 = __nccwpck_require__(2249); class STSClient extends smithy_client_1.Client { getDefaultHttpAuthSchemeParametersProvider() { return httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeParametersProvider; @@ -29757,17 +25140,11 @@ exports.STSClient = STSClient; /***/ }), -<<<<<<< HEAD -/***/ 43037: +/***/ 40530: /***/ ((__unused_webpack_module, exports) => { -======= -/***/ 94561: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.resolveHttpAuthRuntimeConfig = exports.getHttpAuthExtensionConfiguration = void 0; const getHttpAuthExtensionConfiguration = (runtimeConfig) => { const _httpAuthSchemes = runtimeConfig.httpAuthSchemes; @@ -29813,15 +25190,15 @@ exports.resolveHttpAuthRuntimeConfig = resolveHttpAuthRuntimeConfig; /***/ }), -/***/ 71613: +/***/ 64738: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.resolveHttpAuthSchemeConfig = exports.resolveStsAuthConfig = exports.defaultSTSHttpAuthSchemeProvider = exports.defaultSTSHttpAuthSchemeParametersProvider = void 0; -const core_1 = __nccwpck_require__(5236); -const util_middleware_1 = __nccwpck_require__(81243); -const STSClient_1 = __nccwpck_require__(4722); +const core_1 = __nccwpck_require__(91295); +const util_middleware_1 = __nccwpck_require__(3626); +const STSClient_1 = __nccwpck_require__(28307); const defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => { return { operation: (0, util_middleware_1.getSmithyContext)(context).operation, @@ -29887,27 +25264,19 @@ exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; /***/ }), -/***/ 74605: +/***/ 69298: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AssumeRoleCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(74034); -const Aws_query_1 = __nccwpck_require__(53984); -======= -exports.AssumeRoleCommand = void 0; -const middleware_serde_1 = __nccwpck_require__(44695); -const middleware_signing_1 = __nccwpck_require__(33233); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(65438); -const Aws_query_1 = __nccwpck_require__(42924); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(21754); +const Aws_query_1 = __nccwpck_require__(20021); class AssumeRoleCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -29955,31 +25324,19 @@ exports.AssumeRoleCommand = AssumeRoleCommand; /***/ }), -<<<<<<< HEAD -/***/ 96513: -======= -/***/ 94498: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 93686: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.AssumeRoleWithSAMLCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(74034); -const Aws_query_1 = __nccwpck_require__(53984); -======= -exports.AssumeRoleWithSAMLCommand = void 0; -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(65438); -const Aws_query_1 = __nccwpck_require__(42924); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(21754); +const Aws_query_1 = __nccwpck_require__(20021); class AssumeRoleWithSAMLCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -30027,31 +25384,19 @@ exports.AssumeRoleWithSAMLCommand = AssumeRoleWithSAMLCommand; /***/ }), -<<<<<<< HEAD -/***/ 31785: -======= -/***/ 59354: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 38381: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.AssumeRoleWithWebIdentityCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(74034); -const Aws_query_1 = __nccwpck_require__(53984); -======= -exports.AssumeRoleWithWebIdentityCommand = void 0; -const middleware_serde_1 = __nccwpck_require__(44695); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(65438); -const Aws_query_1 = __nccwpck_require__(42924); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(21754); +const Aws_query_1 = __nccwpck_require__(20021); class AssumeRoleWithWebIdentityCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -30099,31 +25444,18 @@ exports.AssumeRoleWithWebIdentityCommand = AssumeRoleWithWebIdentityCommand; /***/ }), -<<<<<<< HEAD -/***/ 31204: -======= -/***/ 85251: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 24609: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.DecodeAuthorizationMessageCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_query_1 = __nccwpck_require__(53984); -======= -exports.DecodeAuthorizationMessageCommand = void 0; -const middleware_serde_1 = __nccwpck_require__(44695); -const middleware_signing_1 = __nccwpck_require__(33233); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(65438); -const Aws_query_1 = __nccwpck_require__(42924); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_query_1 = __nccwpck_require__(20021); class DecodeAuthorizationMessageCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -30171,31 +25503,18 @@ exports.DecodeAuthorizationMessageCommand = DecodeAuthorizationMessageCommand; /***/ }), -<<<<<<< HEAD -/***/ 89270: -======= -/***/ 24862: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 91570: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetAccessKeyInfoCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_query_1 = __nccwpck_require__(53984); -======= -exports.GetAccessKeyInfoCommand = void 0; -const middleware_serde_1 = __nccwpck_require__(44695); -const middleware_signing_1 = __nccwpck_require__(33233); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(65438); -const Aws_query_1 = __nccwpck_require__(42924); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_query_1 = __nccwpck_require__(20021); class GetAccessKeyInfoCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -30243,31 +25562,18 @@ exports.GetAccessKeyInfoCommand = GetAccessKeyInfoCommand; /***/ }), -<<<<<<< HEAD -/***/ 26200: -======= -/***/ 68498: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 75343: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetCallerIdentityCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const Aws_query_1 = __nccwpck_require__(53984); -======= -exports.GetCallerIdentityCommand = void 0; -const middleware_serde_1 = __nccwpck_require__(44695); -const middleware_signing_1 = __nccwpck_require__(33233); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(65438); -const Aws_query_1 = __nccwpck_require__(42924); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const Aws_query_1 = __nccwpck_require__(20021); class GetCallerIdentityCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -30315,32 +25621,19 @@ exports.GetCallerIdentityCommand = GetCallerIdentityCommand; /***/ }), -<<<<<<< HEAD -/***/ 28153: -======= -/***/ 73985: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 17855: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetFederationTokenCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(74034); -const Aws_query_1 = __nccwpck_require__(53984); -======= -exports.GetFederationTokenCommand = void 0; -const middleware_serde_1 = __nccwpck_require__(44695); -const middleware_signing_1 = __nccwpck_require__(33233); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(65438); -const Aws_query_1 = __nccwpck_require__(42924); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(21754); +const Aws_query_1 = __nccwpck_require__(20021); class GetFederationTokenCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -30388,32 +25681,19 @@ exports.GetFederationTokenCommand = GetFederationTokenCommand; /***/ }), -<<<<<<< HEAD -/***/ 83008: -======= -/***/ 8424: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 11596: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetSessionTokenCommand = exports.$Command = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_1 = __nccwpck_require__(33218); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "$Command", ({ enumerable: true, get: function () { return smithy_client_1.Command; } })); -const types_1 = __nccwpck_require__(75751); -const models_0_1 = __nccwpck_require__(74034); -const Aws_query_1 = __nccwpck_require__(53984); -======= -exports.GetSessionTokenCommand = void 0; -const middleware_serde_1 = __nccwpck_require__(44695); -const middleware_signing_1 = __nccwpck_require__(33233); -const smithy_client_1 = __nccwpck_require__(26351); -const models_0_1 = __nccwpck_require__(65438); -const Aws_query_1 = __nccwpck_require__(42924); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const types_1 = __nccwpck_require__(21438); +const models_0_1 = __nccwpck_require__(21754); +const Aws_query_1 = __nccwpck_require__(20021); class GetSessionTokenCommand extends smithy_client_1.Command { static getEndpointParameterInstructions() { return { @@ -30461,53 +25741,32 @@ exports.GetSessionTokenCommand = GetSessionTokenCommand; /***/ }), -<<<<<<< HEAD -/***/ 45327: -======= -/***/ 24553: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 51619: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(69393); -tslib_1.__exportStar(__nccwpck_require__(74605), exports); -tslib_1.__exportStar(__nccwpck_require__(96513), exports); -tslib_1.__exportStar(__nccwpck_require__(31785), exports); -tslib_1.__exportStar(__nccwpck_require__(31204), exports); -tslib_1.__exportStar(__nccwpck_require__(89270), exports); -tslib_1.__exportStar(__nccwpck_require__(26200), exports); -tslib_1.__exportStar(__nccwpck_require__(28153), exports); -tslib_1.__exportStar(__nccwpck_require__(83008), exports); -======= -const tslib_1 = __nccwpck_require__(75706); -tslib_1.__exportStar(__nccwpck_require__(94561), exports); -tslib_1.__exportStar(__nccwpck_require__(94498), exports); -tslib_1.__exportStar(__nccwpck_require__(59354), exports); -tslib_1.__exportStar(__nccwpck_require__(85251), exports); -tslib_1.__exportStar(__nccwpck_require__(24862), exports); -tslib_1.__exportStar(__nccwpck_require__(68498), exports); -tslib_1.__exportStar(__nccwpck_require__(73985), exports); -tslib_1.__exportStar(__nccwpck_require__(8424), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - -/***/ }), - -<<<<<<< HEAD -/***/ 43950: -======= -/***/ 80298: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(69298), exports); +tslib_1.__exportStar(__nccwpck_require__(93686), exports); +tslib_1.__exportStar(__nccwpck_require__(38381), exports); +tslib_1.__exportStar(__nccwpck_require__(24609), exports); +tslib_1.__exportStar(__nccwpck_require__(91570), exports); +tslib_1.__exportStar(__nccwpck_require__(75343), exports); +tslib_1.__exportStar(__nccwpck_require__(17855), exports); +tslib_1.__exportStar(__nccwpck_require__(11596), exports); + + +/***/ }), + +/***/ 73498: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.decorateDefaultCredentialProvider = exports.getDefaultRoleAssumerWithWebIdentity = exports.getDefaultRoleAssumer = void 0; -<<<<<<< HEAD -const defaultStsRoleAssumers_1 = __nccwpck_require__(52359); -const STSClient_1 = __nccwpck_require__(4722); +const defaultStsRoleAssumers_1 = __nccwpck_require__(11016); +const STSClient_1 = __nccwpck_require__(28307); const getCustomizableStsClientCtor = (baseCtor, customizations) => { if (!customizations) return baseCtor; @@ -30522,11 +25781,6 @@ const getCustomizableStsClientCtor = (baseCtor, customizations) => { }; }; const getDefaultRoleAssumer = (stsOptions = {}, stsPlugins) => (0, defaultStsRoleAssumers_1.getDefaultRoleAssumer)(stsOptions, getCustomizableStsClientCtor(STSClient_1.STSClient, stsPlugins)); -======= -const defaultStsRoleAssumers_1 = __nccwpck_require__(17678); -const STSClient_1 = __nccwpck_require__(45029); -const getDefaultRoleAssumer = (stsOptions = {}) => (0, defaultStsRoleAssumers_1.getDefaultRoleAssumer)(stsOptions, STSClient_1.STSClient); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 exports.getDefaultRoleAssumer = getDefaultRoleAssumer; const getDefaultRoleAssumerWithWebIdentity = (stsOptions = {}, stsPlugins) => (0, defaultStsRoleAssumers_1.getDefaultRoleAssumerWithWebIdentity)(stsOptions, getCustomizableStsClientCtor(STSClient_1.STSClient, stsPlugins)); exports.getDefaultRoleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity; @@ -30540,23 +25794,14 @@ exports.decorateDefaultCredentialProvider = decorateDefaultCredentialProvider; /***/ }), -<<<<<<< HEAD -/***/ 52359: -======= -/***/ 17678: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 11016: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.decorateDefaultCredentialProvider = exports.getDefaultRoleAssumerWithWebIdentity = exports.getDefaultRoleAssumer = void 0; -<<<<<<< HEAD -const AssumeRoleCommand_1 = __nccwpck_require__(74605); -const AssumeRoleWithWebIdentityCommand_1 = __nccwpck_require__(31785); -======= -const AssumeRoleCommand_1 = __nccwpck_require__(94561); -const AssumeRoleWithWebIdentityCommand_1 = __nccwpck_require__(59354); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const AssumeRoleCommand_1 = __nccwpck_require__(69298); +const AssumeRoleWithWebIdentityCommand_1 = __nccwpck_require__(38381); const ASSUME_ROLE_DEFAULT_REGION = "us-east-1"; const decorateDefaultRegion = (region) => { if (typeof region !== "function") { @@ -30632,17 +25877,11 @@ exports.decorateDefaultCredentialProvider = decorateDefaultCredentialProvider; /***/ }), -<<<<<<< HEAD -/***/ 96118: +/***/ 74425: /***/ ((__unused_webpack_module, exports) => { -======= -/***/ 11006: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.resolveClientEndpointParameters = void 0; const resolveClientEndpointParameters = (options) => { return { @@ -30652,83 +25891,20 @@ const resolveClientEndpointParameters = (options) => { useGlobalEndpoint: options.useGlobalEndpoint ?? false, defaultSigningName: "sts", }; -======= -exports.defaultRegionInfoProvider = void 0; -const config_resolver_1 = __nccwpck_require__(95406); -const regionHash = { - "aws-global": { - variants: [ - { - hostname: "sts.amazonaws.com", - tags: [], - }, - ], - signingRegion: "us-east-1", - }, - "us-east-1": { - variants: [ - { - hostname: "sts-fips.us-east-1.amazonaws.com", - tags: ["fips"], - }, - ], - }, - "us-east-2": { - variants: [ - { - hostname: "sts-fips.us-east-2.amazonaws.com", - tags: ["fips"], - }, - ], - }, - "us-gov-east-1": { - variants: [ - { - hostname: "sts.us-gov-east-1.amazonaws.com", - tags: ["fips"], - }, - ], - }, - "us-gov-west-1": { - variants: [ - { - hostname: "sts.us-gov-west-1.amazonaws.com", - tags: ["fips"], - }, - ], - }, - "us-west-1": { - variants: [ - { - hostname: "sts-fips.us-west-1.amazonaws.com", - tags: ["fips"], - }, - ], - }, - "us-west-2": { - variants: [ - { - hostname: "sts-fips.us-west-2.amazonaws.com", - tags: ["fips"], - }, - ], - }, ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 }; exports.resolveClientEndpointParameters = resolveClientEndpointParameters; /***/ }), -<<<<<<< HEAD -/***/ 28878: +/***/ 92928: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.defaultEndpointResolver = void 0; -const util_endpoints_1 = __nccwpck_require__(34548); -const ruleset_1 = __nccwpck_require__(42882); +const util_endpoints_1 = __nccwpck_require__(34863); +const ruleset_1 = __nccwpck_require__(96337); const defaultEndpointResolver = (endpointParams, context = {}) => { return (0, util_endpoints_1.resolveEndpoint)(ruleset_1.ruleSet, { endpointParams: endpointParams, @@ -30740,7 +25916,7 @@ exports.defaultEndpointResolver = defaultEndpointResolver; /***/ }), -/***/ 42882: +/***/ 96337: /***/ ((__unused_webpack_module, exports) => { @@ -30754,55 +25930,33 @@ exports.ruleSet = _data; /***/ }), -/***/ 89456: -======= -/***/ 64761: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 62077: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.STSServiceException = void 0; -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(69393); -tslib_1.__exportStar(__nccwpck_require__(4722), exports); -tslib_1.__exportStar(__nccwpck_require__(57038), exports); -tslib_1.__exportStar(__nccwpck_require__(45327), exports); -tslib_1.__exportStar(__nccwpck_require__(42272), exports); -__nccwpck_require__(60698); -tslib_1.__exportStar(__nccwpck_require__(43950), exports); -var STSServiceException_1 = __nccwpck_require__(37599); -======= -const tslib_1 = __nccwpck_require__(75706); -tslib_1.__exportStar(__nccwpck_require__(86582), exports); -tslib_1.__exportStar(__nccwpck_require__(45029), exports); -tslib_1.__exportStar(__nccwpck_require__(24553), exports); -tslib_1.__exportStar(__nccwpck_require__(80298), exports); -tslib_1.__exportStar(__nccwpck_require__(68597), exports); -var STSServiceException_1 = __nccwpck_require__(1524); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(28307), exports); +tslib_1.__exportStar(__nccwpck_require__(24326), exports); +tslib_1.__exportStar(__nccwpck_require__(51619), exports); +tslib_1.__exportStar(__nccwpck_require__(70275), exports); +__nccwpck_require__(68503); +tslib_1.__exportStar(__nccwpck_require__(73498), exports); +var STSServiceException_1 = __nccwpck_require__(64903); Object.defineProperty(exports, "STSServiceException", ({ enumerable: true, get: function () { return STSServiceException_1.STSServiceException; } })); /***/ }), -<<<<<<< HEAD -/***/ 37599: -======= -/***/ 1524: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 64903: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.STSServiceException = exports.__ServiceException = void 0; -const smithy_client_1 = __nccwpck_require__(33218); +const smithy_client_1 = __nccwpck_require__(42584); Object.defineProperty(exports, "__ServiceException", ({ enumerable: true, get: function () { return smithy_client_1.ServiceException; } })); -======= -exports.STSServiceException = void 0; -const smithy_client_1 = __nccwpck_require__(26351); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 class STSServiceException extends smithy_client_1.ServiceException { constructor(options) { super(options); @@ -30814,43 +25968,25 @@ exports.STSServiceException = STSServiceException; /***/ }), -<<<<<<< HEAD -/***/ 42272: -======= -/***/ 68597: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 70275: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(69393); -tslib_1.__exportStar(__nccwpck_require__(74034), exports); -======= -const tslib_1 = __nccwpck_require__(75706); -tslib_1.__exportStar(__nccwpck_require__(65438), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(21754), exports); /***/ }), -<<<<<<< HEAD -/***/ 74034: -======= -/***/ 65438: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 21754: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.GetSessionTokenResponseFilterSensitiveLog = exports.GetFederationTokenResponseFilterSensitiveLog = exports.AssumeRoleWithWebIdentityResponseFilterSensitiveLog = exports.AssumeRoleWithWebIdentityRequestFilterSensitiveLog = exports.AssumeRoleWithSAMLResponseFilterSensitiveLog = exports.AssumeRoleWithSAMLRequestFilterSensitiveLog = exports.AssumeRoleResponseFilterSensitiveLog = exports.CredentialsFilterSensitiveLog = exports.InvalidAuthorizationMessageException = exports.IDPCommunicationErrorException = exports.InvalidIdentityTokenException = exports.IDPRejectedClaimException = exports.RegionDisabledException = exports.PackedPolicyTooLargeException = exports.MalformedPolicyDocumentException = exports.ExpiredTokenException = void 0; -const smithy_client_1 = __nccwpck_require__(33218); -const STSServiceException_1 = __nccwpck_require__(37599); -======= -exports.GetSessionTokenResponseFilterSensitiveLog = exports.GetSessionTokenRequestFilterSensitiveLog = exports.GetFederationTokenResponseFilterSensitiveLog = exports.FederatedUserFilterSensitiveLog = exports.GetFederationTokenRequestFilterSensitiveLog = exports.GetCallerIdentityResponseFilterSensitiveLog = exports.GetCallerIdentityRequestFilterSensitiveLog = exports.GetAccessKeyInfoResponseFilterSensitiveLog = exports.GetAccessKeyInfoRequestFilterSensitiveLog = exports.DecodeAuthorizationMessageResponseFilterSensitiveLog = exports.DecodeAuthorizationMessageRequestFilterSensitiveLog = exports.AssumeRoleWithWebIdentityResponseFilterSensitiveLog = exports.AssumeRoleWithWebIdentityRequestFilterSensitiveLog = exports.AssumeRoleWithSAMLResponseFilterSensitiveLog = exports.AssumeRoleWithSAMLRequestFilterSensitiveLog = exports.AssumeRoleResponseFilterSensitiveLog = exports.CredentialsFilterSensitiveLog = exports.AssumeRoleRequestFilterSensitiveLog = exports.TagFilterSensitiveLog = exports.PolicyDescriptorTypeFilterSensitiveLog = exports.AssumedRoleUserFilterSensitiveLog = exports.InvalidAuthorizationMessageException = exports.IDPCommunicationErrorException = exports.InvalidIdentityTokenException = exports.IDPRejectedClaimException = exports.RegionDisabledException = exports.PackedPolicyTooLargeException = exports.MalformedPolicyDocumentException = exports.ExpiredTokenException = void 0; -const STSServiceException_1 = __nccwpck_require__(1524); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const smithy_client_1 = __nccwpck_require__(42584); +const STSServiceException_1 = __nccwpck_require__(64903); class ExpiredTokenException extends STSServiceException_1.STSServiceException { constructor(opts) { super({ @@ -30999,37 +26135,19 @@ exports.GetSessionTokenResponseFilterSensitiveLog = GetSessionTokenResponseFilte /***/ }), -<<<<<<< HEAD -/***/ 53984: -======= -/***/ 42924: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 20021: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD exports.de_GetSessionTokenCommand = exports.de_GetFederationTokenCommand = exports.de_GetCallerIdentityCommand = exports.de_GetAccessKeyInfoCommand = exports.de_DecodeAuthorizationMessageCommand = exports.de_AssumeRoleWithWebIdentityCommand = exports.de_AssumeRoleWithSAMLCommand = exports.de_AssumeRoleCommand = exports.se_GetSessionTokenCommand = exports.se_GetFederationTokenCommand = exports.se_GetCallerIdentityCommand = exports.se_GetAccessKeyInfoCommand = exports.se_DecodeAuthorizationMessageCommand = exports.se_AssumeRoleWithWebIdentityCommand = exports.se_AssumeRoleWithSAMLCommand = exports.se_AssumeRoleCommand = void 0; -const protocol_http_1 = __nccwpck_require__(45311); -const smithy_client_1 = __nccwpck_require__(33218); -const fast_xml_parser_1 = __nccwpck_require__(6714); -const models_0_1 = __nccwpck_require__(74034); -const STSServiceException_1 = __nccwpck_require__(37599); +const protocol_http_1 = __nccwpck_require__(76232); +const smithy_client_1 = __nccwpck_require__(42584); +const fast_xml_parser_1 = __nccwpck_require__(64992); +const models_0_1 = __nccwpck_require__(21754); +const STSServiceException_1 = __nccwpck_require__(64903); const se_AssumeRoleCommand = async (input, context) => { const headers = SHARED_HEADERS; -======= -exports.deserializeAws_queryGetSessionTokenCommand = exports.deserializeAws_queryGetFederationTokenCommand = exports.deserializeAws_queryGetCallerIdentityCommand = exports.deserializeAws_queryGetAccessKeyInfoCommand = exports.deserializeAws_queryDecodeAuthorizationMessageCommand = exports.deserializeAws_queryAssumeRoleWithWebIdentityCommand = exports.deserializeAws_queryAssumeRoleWithSAMLCommand = exports.deserializeAws_queryAssumeRoleCommand = exports.serializeAws_queryGetSessionTokenCommand = exports.serializeAws_queryGetFederationTokenCommand = exports.serializeAws_queryGetCallerIdentityCommand = exports.serializeAws_queryGetAccessKeyInfoCommand = exports.serializeAws_queryDecodeAuthorizationMessageCommand = exports.serializeAws_queryAssumeRoleWithWebIdentityCommand = exports.serializeAws_queryAssumeRoleWithSAMLCommand = exports.serializeAws_queryAssumeRoleCommand = void 0; -const protocol_http_1 = __nccwpck_require__(35712); -const smithy_client_1 = __nccwpck_require__(26351); -const entities_1 = __nccwpck_require__(78677); -const fast_xml_parser_1 = __nccwpck_require__(65460); -const models_0_1 = __nccwpck_require__(65438); -const STSServiceException_1 = __nccwpck_require__(1524); -const serializeAws_queryAssumeRoleCommand = async (input, context) => { - const headers = { - "content-type": "application/x-www-form-urlencoded", - }; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 let body; body = buildFormUrlencodedString({ ...se_AssumeRoleRequest(input, context), @@ -32108,54 +27226,30 @@ const loadQueryErrorCode = (output, data) => { /***/ }), -<<<<<<< HEAD -/***/ 81144: -======= -/***/ 88739: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 35481: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getRuntimeConfig = void 0; -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(69393); -const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(7947)); -const defaultStsRoleAssumers_1 = __nccwpck_require__(52359); -const core_1 = __nccwpck_require__(5236); -const credential_provider_node_1 = __nccwpck_require__(6497); -const util_user_agent_node_1 = __nccwpck_require__(61876); -const config_resolver_1 = __nccwpck_require__(66041); -const core_2 = __nccwpck_require__(53938); -const hash_node_1 = __nccwpck_require__(86775); -const middleware_retry_1 = __nccwpck_require__(54801); -const node_config_provider_1 = __nccwpck_require__(13079); -const node_http_handler_1 = __nccwpck_require__(54065); -const util_body_length_node_1 = __nccwpck_require__(87693); -const util_retry_1 = __nccwpck_require__(13744); -const runtimeConfig_shared_1 = __nccwpck_require__(55388); -const smithy_client_1 = __nccwpck_require__(33218); -const util_defaults_mode_node_1 = __nccwpck_require__(6061); -const smithy_client_2 = __nccwpck_require__(33218); -======= -const tslib_1 = __nccwpck_require__(75706); +const tslib_1 = __nccwpck_require__(47754); const package_json_1 = tslib_1.__importDefault(__nccwpck_require__(7947)); -const defaultStsRoleAssumers_1 = __nccwpck_require__(17678); -const config_resolver_1 = __nccwpck_require__(95406); -const credential_provider_node_1 = __nccwpck_require__(96911); -const hash_node_1 = __nccwpck_require__(5541); -const middleware_retry_1 = __nccwpck_require__(9352); -const node_config_provider_1 = __nccwpck_require__(15071); -const node_http_handler_1 = __nccwpck_require__(51062); -const util_base64_node_1 = __nccwpck_require__(7147); -const util_body_length_node_1 = __nccwpck_require__(19989); -const util_user_agent_node_1 = __nccwpck_require__(7494); -const util_utf8_node_1 = __nccwpck_require__(1266); -const runtimeConfig_shared_1 = __nccwpck_require__(7180); -const smithy_client_1 = __nccwpck_require__(26351); -const util_defaults_mode_node_1 = __nccwpck_require__(64664); -const smithy_client_2 = __nccwpck_require__(26351); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const defaultStsRoleAssumers_1 = __nccwpck_require__(11016); +const core_1 = __nccwpck_require__(91295); +const credential_provider_node_1 = __nccwpck_require__(52963); +const util_user_agent_node_1 = __nccwpck_require__(22004); +const config_resolver_1 = __nccwpck_require__(36407); +const core_2 = __nccwpck_require__(41911); +const hash_node_1 = __nccwpck_require__(3127); +const middleware_retry_1 = __nccwpck_require__(73739); +const node_config_provider_1 = __nccwpck_require__(86711); +const node_http_handler_1 = __nccwpck_require__(48195); +const util_body_length_node_1 = __nccwpck_require__(92711); +const util_retry_1 = __nccwpck_require__(20774); +const runtimeConfig_shared_1 = __nccwpck_require__(66100); +const smithy_client_1 = __nccwpck_require__(42584); +const util_defaults_mode_node_1 = __nccwpck_require__(3147); +const smithy_client_2 = __nccwpck_require__(42584); const getRuntimeConfig = (config) => { (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); @@ -32203,29 +27297,20 @@ exports.getRuntimeConfig = getRuntimeConfig; /***/ }), -<<<<<<< HEAD -/***/ 55388: -======= -/***/ 7180: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 66100: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getRuntimeConfig = void 0; -<<<<<<< HEAD -const core_1 = __nccwpck_require__(5236); -const core_2 = __nccwpck_require__(53938); -const smithy_client_1 = __nccwpck_require__(33218); -const url_parser_1 = __nccwpck_require__(98245); -const util_base64_1 = __nccwpck_require__(14478); -const util_utf8_1 = __nccwpck_require__(38134); -const httpAuthSchemeProvider_1 = __nccwpck_require__(71613); -const endpointResolver_1 = __nccwpck_require__(28878); -======= -const url_parser_1 = __nccwpck_require__(13797); -const endpoints_1 = __nccwpck_require__(11006); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const core_1 = __nccwpck_require__(91295); +const core_2 = __nccwpck_require__(41911); +const smithy_client_1 = __nccwpck_require__(42584); +const url_parser_1 = __nccwpck_require__(45013); +const util_base64_1 = __nccwpck_require__(74339); +const util_utf8_1 = __nccwpck_require__(97788); +const httpAuthSchemeProvider_1 = __nccwpck_require__(64738); +const endpointResolver_1 = __nccwpck_require__(92928); const getRuntimeConfig = (config) => { return { apiVersion: "2011-06-15", @@ -32259,17 +27344,16 @@ exports.getRuntimeConfig = getRuntimeConfig; /***/ }), -<<<<<<< HEAD -/***/ 86860: +/***/ 2249: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.resolveRuntimeExtensions = void 0; -const region_config_resolver_1 = __nccwpck_require__(35657); -const protocol_http_1 = __nccwpck_require__(45311); -const smithy_client_1 = __nccwpck_require__(33218); -const httpAuthExtensionConfiguration_1 = __nccwpck_require__(43037); +const region_config_resolver_1 = __nccwpck_require__(61732); +const protocol_http_1 = __nccwpck_require__(76232); +const smithy_client_1 = __nccwpck_require__(42584); +const httpAuthExtensionConfiguration_1 = __nccwpck_require__(40530); const asPartial = (t) => t; const resolveRuntimeExtensions = (runtimeConfig, extensions) => { const extensionConfiguration = { @@ -32292,737 +27376,7 @@ exports.resolveRuntimeExtensions = resolveRuntimeExtensions; /***/ }), -/***/ 69393: -======= -/***/ 75706: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -<<<<<<< HEAD -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); -======= -/***/ }), - -/***/ 10547: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = exports.DEFAULT_USE_DUALSTACK_ENDPOINT = exports.CONFIG_USE_DUALSTACK_ENDPOINT = exports.ENV_USE_DUALSTACK_ENDPOINT = void 0; -const util_config_provider_1 = __nccwpck_require__(46522); -exports.ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT"; -exports.CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint"; -exports.DEFAULT_USE_DUALSTACK_ENDPOINT = false; -exports.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => (0, util_config_provider_1.booleanSelector)(env, exports.ENV_USE_DUALSTACK_ENDPOINT, util_config_provider_1.SelectorType.ENV), - configFileSelector: (profile) => (0, util_config_provider_1.booleanSelector)(profile, exports.CONFIG_USE_DUALSTACK_ENDPOINT, util_config_provider_1.SelectorType.CONFIG), - default: false, -}; - - -/***/ }), - -/***/ 60279: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = exports.DEFAULT_USE_FIPS_ENDPOINT = exports.CONFIG_USE_FIPS_ENDPOINT = exports.ENV_USE_FIPS_ENDPOINT = void 0; -const util_config_provider_1 = __nccwpck_require__(46522); -exports.ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT"; -exports.CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint"; -exports.DEFAULT_USE_FIPS_ENDPOINT = false; -exports.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => (0, util_config_provider_1.booleanSelector)(env, exports.ENV_USE_FIPS_ENDPOINT, util_config_provider_1.SelectorType.ENV), - configFileSelector: (profile) => (0, util_config_provider_1.booleanSelector)(profile, exports.CONFIG_USE_FIPS_ENDPOINT, util_config_provider_1.SelectorType.CONFIG), - default: false, -}; - - -/***/ }), - -/***/ 74187: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(63300); -tslib_1.__exportStar(__nccwpck_require__(10547), exports); -tslib_1.__exportStar(__nccwpck_require__(60279), exports); -tslib_1.__exportStar(__nccwpck_require__(50622), exports); -tslib_1.__exportStar(__nccwpck_require__(22692), exports); - - -/***/ }), - -/***/ 50622: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveCustomEndpointsConfig = void 0; -const util_middleware_1 = __nccwpck_require__(23837); -const resolveCustomEndpointsConfig = (input) => { - var _a; - const { endpoint, urlParser } = input; - return { - ...input, - tls: (_a = input.tls) !== null && _a !== void 0 ? _a : true, - endpoint: (0, util_middleware_1.normalizeProvider)(typeof endpoint === "string" ? urlParser(endpoint) : endpoint), - isCustomEndpoint: true, - useDualstackEndpoint: (0, util_middleware_1.normalizeProvider)(input.useDualstackEndpoint), - }; -}; -exports.resolveCustomEndpointsConfig = resolveCustomEndpointsConfig; - - -/***/ }), - -/***/ 22692: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveEndpointsConfig = void 0; -const util_middleware_1 = __nccwpck_require__(23837); -const getEndpointFromRegion_1 = __nccwpck_require__(44333); -const resolveEndpointsConfig = (input) => { - var _a; - const useDualstackEndpoint = (0, util_middleware_1.normalizeProvider)(input.useDualstackEndpoint); - const { endpoint, useFipsEndpoint, urlParser } = input; - return { - ...input, - tls: (_a = input.tls) !== null && _a !== void 0 ? _a : true, - endpoint: endpoint - ? (0, util_middleware_1.normalizeProvider)(typeof endpoint === "string" ? urlParser(endpoint) : endpoint) - : () => (0, getEndpointFromRegion_1.getEndpointFromRegion)({ ...input, useDualstackEndpoint, useFipsEndpoint }), - isCustomEndpoint: endpoint ? true : false, - useDualstackEndpoint, - }; -}; -exports.resolveEndpointsConfig = resolveEndpointsConfig; - - -/***/ }), - -/***/ 44333: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEndpointFromRegion = void 0; -const getEndpointFromRegion = async (input) => { - var _a; - const { tls = true } = input; - const region = await input.region(); - const dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); - if (!dnsHostRegex.test(region)) { - throw new Error("Invalid region in client config"); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } -<<<<<<< HEAD - else { - factory(createExporter(root)); -======= - return input.urlParser(`${tls ? "https:" : "http:"}//${hostname}`); -}; -exports.getEndpointFromRegion = getEndpointFromRegion; - - -/***/ }), - -/***/ 95406: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(63300); -tslib_1.__exportStar(__nccwpck_require__(74187), exports); -tslib_1.__exportStar(__nccwpck_require__(61418), exports); -tslib_1.__exportStar(__nccwpck_require__(62777), exports); - - -/***/ }), - -/***/ 4823: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_REGION_CONFIG_FILE_OPTIONS = exports.NODE_REGION_CONFIG_OPTIONS = exports.REGION_INI_NAME = exports.REGION_ENV_NAME = void 0; -exports.REGION_ENV_NAME = "AWS_REGION"; -exports.REGION_INI_NAME = "region"; -exports.NODE_REGION_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[exports.REGION_ENV_NAME], - configFileSelector: (profile) => profile[exports.REGION_INI_NAME], - default: () => { - throw new Error("Region is missing"); - }, -}; -exports.NODE_REGION_CONFIG_FILE_OPTIONS = { - preferredFile: "credentials", -}; - - -/***/ }), - -/***/ 2386: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRealRegion = void 0; -const isFipsRegion_1 = __nccwpck_require__(83230); -const getRealRegion = (region) => (0, isFipsRegion_1.isFipsRegion)(region) - ? ["fips-aws-global", "aws-fips"].includes(region) - ? "us-east-1" - : region.replace(/fips-(dkr-|prod-)?|-fips/, "") - : region; -exports.getRealRegion = getRealRegion; - - -/***/ }), - -/***/ 61418: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(63300); -tslib_1.__exportStar(__nccwpck_require__(4823), exports); -tslib_1.__exportStar(__nccwpck_require__(20026), exports); - - -/***/ }), - -/***/ 83230: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isFipsRegion = void 0; -const isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")); -exports.isFipsRegion = isFipsRegion; - - -/***/ }), - -/***/ 20026: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveRegionConfig = void 0; -const getRealRegion_1 = __nccwpck_require__(2386); -const isFipsRegion_1 = __nccwpck_require__(83230); -const resolveRegionConfig = (input) => { - const { region, useFipsEndpoint } = input; - if (!region) { - throw new Error("Region is missing"); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } -<<<<<<< HEAD - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; -======= - return typeof useFipsEndpoint === "boolean" ? Promise.resolve(useFipsEndpoint) : useFipsEndpoint(); - }, - }; -}; -exports.resolveRegionConfig = resolveRegionConfig; - - -/***/ }), - -/***/ 31411: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 6410: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 9884: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getHostnameFromVariants = void 0; -const getHostnameFromVariants = (variants = [], { useFipsEndpoint, useDualstackEndpoint }) => { - var _a; - return (_a = variants.find(({ tags }) => useFipsEndpoint === tags.includes("fips") && useDualstackEndpoint === tags.includes("dualstack"))) === null || _a === void 0 ? void 0 : _a.hostname; -}; -exports.getHostnameFromVariants = getHostnameFromVariants; - - -/***/ }), - -/***/ 27342: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRegionInfo = void 0; -const getHostnameFromVariants_1 = __nccwpck_require__(9884); -const getResolvedHostname_1 = __nccwpck_require__(33330); -const getResolvedPartition_1 = __nccwpck_require__(33996); -const getResolvedSigningRegion_1 = __nccwpck_require__(70198); -const getRegionInfo = (region, { useFipsEndpoint = false, useDualstackEndpoint = false, signingService, regionHash, partitionHash, }) => { - var _a, _b, _c, _d, _e, _f; - const partition = (0, getResolvedPartition_1.getResolvedPartition)(region, { partitionHash }); - const resolvedRegion = region in regionHash ? region : (_b = (_a = partitionHash[partition]) === null || _a === void 0 ? void 0 : _a.endpoint) !== null && _b !== void 0 ? _b : region; - const hostnameOptions = { useFipsEndpoint, useDualstackEndpoint }; - const regionHostname = (0, getHostnameFromVariants_1.getHostnameFromVariants)((_c = regionHash[resolvedRegion]) === null || _c === void 0 ? void 0 : _c.variants, hostnameOptions); - const partitionHostname = (0, getHostnameFromVariants_1.getHostnameFromVariants)((_d = partitionHash[partition]) === null || _d === void 0 ? void 0 : _d.variants, hostnameOptions); - const hostname = (0, getResolvedHostname_1.getResolvedHostname)(resolvedRegion, { regionHostname, partitionHostname }); - if (hostname === undefined) { - throw new Error(`Endpoint resolution failed for: ${{ resolvedRegion, useFipsEndpoint, useDualstackEndpoint }}`); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 6759: +/***/ 79818: /***/ ((__unused_webpack_module, exports) => { @@ -33046,26 +27400,26 @@ exports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion; /***/ }), -/***/ 33326: +/***/ 99868: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(61162); -tslib_1.__exportStar(__nccwpck_require__(6759), exports); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(79818), exports); /***/ }), -/***/ 33608: +/***/ 99212: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AWSSDKSigV4Signer = void 0; -const protocol_http_1 = __nccwpck_require__(45311); -const utils_1 = __nccwpck_require__(15026); -const throwAWSSDKSigningPropertyError_1 = __nccwpck_require__(20945); +const protocol_http_1 = __nccwpck_require__(76232); +const utils_1 = __nccwpck_require__(44800); +const throwAWSSDKSigningPropertyError_1 = __nccwpck_require__(41508); const validateSigningProperties = async (signingProperties) => { var _a, _b, _c; const context = (0, throwAWSSDKSigningPropertyError_1.throwAWSSDKSigningPropertyError)("context", signingProperties.context); @@ -33082,7 +27436,6 @@ const validateSigningProperties = async (signingProperties) => { signingName, }; }; -<<<<<<< HEAD class AWSSDKSigV4Signer { async sign(httpRequest, identity, signingProperties) { if (!protocol_http_1.HttpRequest.isInstance(httpRequest)) { @@ -33095,53 +27448,6 @@ class AWSSDKSigV4Signer { signingService: signingName, }); return signedRequest; -======= -exports.getRegionInfo = getRegionInfo; - - -/***/ }), - -/***/ 33330: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getResolvedHostname = void 0; -const getResolvedHostname = (resolvedRegion, { regionHostname, partitionHostname }) => regionHostname - ? regionHostname - : partitionHostname - ? partitionHostname.replace("{region}", resolvedRegion) - : undefined; -exports.getResolvedHostname = getResolvedHostname; - - -/***/ }), - -/***/ 33996: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getResolvedPartition = void 0; -const getResolvedPartition = (region, { partitionHash }) => { var _a; return (_a = Object.keys(partitionHash || {}).find((key) => partitionHash[key].regions.includes(region))) !== null && _a !== void 0 ? _a : "aws"; }; -exports.getResolvedPartition = getResolvedPartition; - - -/***/ }), - -/***/ 70198: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getResolvedSigningRegion = void 0; -const getResolvedSigningRegion = (hostname, { signingRegion, regionRegex, useFipsEndpoint }) => { - if (signingRegion) { - return signingRegion; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 } errorHandler(signingProperties) { return (error) => { @@ -33167,38 +27473,26 @@ exports.AWSSDKSigV4Signer = AWSSDKSigV4Signer; /***/ }), -<<<<<<< HEAD -/***/ 48173: -======= -/***/ 62777: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 38245: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(61162); -tslib_1.__exportStar(__nccwpck_require__(33608), exports); -tslib_1.__exportStar(__nccwpck_require__(31976), exports); -======= -const tslib_1 = __nccwpck_require__(63300); -tslib_1.__exportStar(__nccwpck_require__(31411), exports); -tslib_1.__exportStar(__nccwpck_require__(6410), exports); -tslib_1.__exportStar(__nccwpck_require__(27342), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(99212), exports); +tslib_1.__exportStar(__nccwpck_require__(19978), exports); /***/ }), -<<<<<<< HEAD -/***/ 31976: +/***/ 19978: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.resolveAWSSDKSigV4Config = void 0; -const core_1 = __nccwpck_require__(53938); -const signature_v4_1 = __nccwpck_require__(91116); +const core_1 = __nccwpck_require__(41911); +const signature_v4_1 = __nccwpck_require__(32686); const resolveAWSSDKSigV4Config = (config) => { let normalizedCreds; if (config.credentials) { @@ -33279,7 +27573,7 @@ exports.resolveAWSSDKSigV4Config = resolveAWSSDKSigV4Config; /***/ }), -/***/ 20945: +/***/ 41508: /***/ ((__unused_webpack_module, exports) => { @@ -33296,31 +27590,31 @@ exports.throwAWSSDKSigningPropertyError = throwAWSSDKSigningPropertyError; /***/ }), -/***/ 92396: +/***/ 11899: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(61162); -tslib_1.__exportStar(__nccwpck_require__(48173), exports); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(38245), exports); /***/ }), -/***/ 48537: +/***/ 84441: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getDateHeader = void 0; -const protocol_http_1 = __nccwpck_require__(45311); +const protocol_http_1 = __nccwpck_require__(76232); const getDateHeader = (response) => { var _a, _b, _c; return protocol_http_1.HttpResponse.isInstance(response) ? (_b = (_a = response.headers) === null || _a === void 0 ? void 0 : _a.date) !== null && _b !== void 0 ? _b : (_c = response.headers) === null || _c === void 0 ? void 0 : _c.Date : undefined; }; exports.getDateHeader = getDateHeader; /***/ }), -/***/ 26276: +/***/ 18841: /***/ ((__unused_webpack_module, exports) => { @@ -33332,13 +27626,13 @@ exports.getSkewCorrectedDate = getSkewCorrectedDate; /***/ }), -/***/ 566: +/***/ 92586: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getUpdatedSystemClockOffset = void 0; -const isClockSkewed_1 = __nccwpck_require__(27114); +const isClockSkewed_1 = __nccwpck_require__(58540); const getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => { const clockTimeInMs = Date.parse(clockTime); if ((0, isClockSkewed_1.isClockSkewed)(clockTimeInMs, currentSystemClockOffset)) { @@ -33351,46 +27645,46 @@ exports.getUpdatedSystemClockOffset = getUpdatedSystemClockOffset; /***/ }), -/***/ 15026: +/***/ 44800: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(61162); -tslib_1.__exportStar(__nccwpck_require__(48537), exports); -tslib_1.__exportStar(__nccwpck_require__(26276), exports); -tslib_1.__exportStar(__nccwpck_require__(566), exports); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(84441), exports); +tslib_1.__exportStar(__nccwpck_require__(18841), exports); +tslib_1.__exportStar(__nccwpck_require__(92586), exports); /***/ }), -/***/ 27114: +/***/ 58540: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isClockSkewed = void 0; -const getSkewCorrectedDate_1 = __nccwpck_require__(26276); +const getSkewCorrectedDate_1 = __nccwpck_require__(18841); const isClockSkewed = (clockTime, systemClockOffset) => Math.abs((0, getSkewCorrectedDate_1.getSkewCorrectedDate)(systemClockOffset).getTime() - clockTime) >= 300000; exports.isClockSkewed = isClockSkewed; /***/ }), -/***/ 5236: +/***/ 91295: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(61162); -tslib_1.__exportStar(__nccwpck_require__(33326), exports); -tslib_1.__exportStar(__nccwpck_require__(92396), exports); -tslib_1.__exportStar(__nccwpck_require__(14956), exports); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(99868), exports); +tslib_1.__exportStar(__nccwpck_require__(11899), exports); +tslib_1.__exportStar(__nccwpck_require__(72403), exports); /***/ }), -/***/ 28887: +/***/ 18799: /***/ ((__unused_webpack_module, exports) => { @@ -33456,25 +27750,25 @@ exports._toNum = _toNum; /***/ }), -/***/ 14956: +/***/ 72403: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(61162); -tslib_1.__exportStar(__nccwpck_require__(28887), exports); -tslib_1.__exportStar(__nccwpck_require__(54564), exports); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(18799), exports); +tslib_1.__exportStar(__nccwpck_require__(25553), exports); /***/ }), -/***/ 54564: +/***/ 25553: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.awsExpectUnion = void 0; -const smithy_client_1 = __nccwpck_require__(33218); +const smithy_client_1 = __nccwpck_require__(42584); const awsExpectUnion = (value) => { if (value == null) { return undefined; @@ -33489,95024 +27783,24441 @@ exports.awsExpectUnion = awsExpectUnion; /***/ }), -/***/ 61162: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. +/***/ 96805: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fromEnv = exports.ENV_EXPIRATION = exports.ENV_SESSION = exports.ENV_SECRET = exports.ENV_KEY = void 0; +const property_provider_1 = __nccwpck_require__(60846); +exports.ENV_KEY = "AWS_ACCESS_KEY_ID"; +exports.ENV_SECRET = "AWS_SECRET_ACCESS_KEY"; +exports.ENV_SESSION = "AWS_SESSION_TOKEN"; +exports.ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION"; +const fromEnv = () => async () => { + const accessKeyId = process.env[exports.ENV_KEY]; + const secretAccessKey = process.env[exports.ENV_SECRET]; + const sessionToken = process.env[exports.ENV_SESSION]; + const expiry = process.env[exports.ENV_EXPIRATION]; + if (accessKeyId && secretAccessKey) { + return { + accessKeyId, + secretAccessKey, + ...(sessionToken && { sessionToken }), + ...(expiry && { expiration: new Date(expiry) }), + }; } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; + throw new property_provider_1.CredentialsProviderError("Unable to find environment variable credentials."); +}; +exports.fromEnv = fromEnv; - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; +/***/ }), - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +/***/ 92433: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(96805), exports); - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; +/***/ }), - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; +/***/ 77455: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __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()); - }); - }; - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fromIni = void 0; +const shared_ini_file_loader_1 = __nccwpck_require__(53013); +const resolveProfileData_1 = __nccwpck_require__(1083); +const fromIni = (init = {}) => async () => { + const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init); + return (0, resolveProfileData_1.resolveProfileData)((0, shared_ini_file_loader_1.getProfileName)(init), profiles, init); +}; +exports.fromIni = fromIni; - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +/***/ }), - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; +/***/ 3926: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(77455), exports); - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; +/***/ }), - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; +/***/ 35242: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.resolveAssumeRoleCredentials = exports.isAssumeRoleProfile = void 0; +const property_provider_1 = __nccwpck_require__(60846); +const shared_ini_file_loader_1 = __nccwpck_require__(53013); +const resolveCredentialSource_1 = __nccwpck_require__(56501); +const resolveProfileData_1 = __nccwpck_require__(1083); +const isAssumeRoleProfile = (arg) => Boolean(arg) && + typeof arg === "object" && + typeof arg.role_arn === "string" && + ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 && + ["undefined", "string"].indexOf(typeof arg.external_id) > -1 && + ["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 && + (isAssumeRoleWithSourceProfile(arg) || isAssumeRoleWithProviderProfile(arg)); +exports.isAssumeRoleProfile = isAssumeRoleProfile; +const isAssumeRoleWithSourceProfile = (arg) => typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined"; +const isAssumeRoleWithProviderProfile = (arg) => typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined"; +const resolveAssumeRoleCredentials = async (profileName, profiles, options, visitedProfiles = {}) => { + const data = profiles[profileName]; + if (!options.roleAssumer) { + throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} requires a role to be assumed, but no role assumption callback was provided.`, false); + } + const { source_profile } = data; + if (source_profile && source_profile in visitedProfiles) { + throw new property_provider_1.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile` + + ` ${(0, shared_ini_file_loader_1.getProfileName)(options)}. Profiles visited: ` + + Object.keys(visitedProfiles).join(", "), false); + } + const sourceCredsProvider = source_profile + ? (0, resolveProfileData_1.resolveProfileData)(source_profile, profiles, options, { + ...visitedProfiles, + [source_profile]: true, + }) + : (0, resolveCredentialSource_1.resolveCredentialSource)(data.credential_source, profileName)(); + const params = { + RoleArn: data.role_arn, + RoleSessionName: data.role_session_name || `aws-sdk-js-${Date.now()}`, + ExternalId: data.external_id, + DurationSeconds: parseInt(data.duration_seconds || "3600", 10), }; + const { mfa_serial } = data; + if (mfa_serial) { + if (!options.mfaCodeProvider) { + throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, false); + } + params.SerialNumber = mfa_serial; + params.TokenCode = await options.mfaCodeProvider(mfa_serial); + } + const sourceCreds = await sourceCredsProvider; + return options.roleAssumer(sourceCreds, params); +}; +exports.resolveAssumeRoleCredentials = resolveAssumeRoleCredentials; - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +/***/ }), - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; +/***/ 56501: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.resolveCredentialSource = void 0; +const credential_provider_env_1 = __nccwpck_require__(92433); +const credential_provider_imds_1 = __nccwpck_require__(95815); +const property_provider_1 = __nccwpck_require__(60846); +const resolveCredentialSource = (credentialSource, profileName) => { + const sourceProvidersMap = { + EcsContainer: credential_provider_imds_1.fromContainerMetadata, + Ec2InstanceMetadata: credential_provider_imds_1.fromInstanceMetadata, + Environment: credential_provider_env_1.fromEnv, }; + if (credentialSource in sourceProvidersMap) { + return sourceProvidersMap[credentialSource](); + } + else { + throw new property_provider_1.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, ` + + `expected EcsContainer or Ec2InstanceMetadata or Environment.`); + } +}; +exports.resolveCredentialSource = resolveCredentialSource; - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +/***/ }), - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; +/***/ 84867: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.resolveProcessCredentials = exports.isProcessProfile = void 0; +const credential_provider_process_1 = __nccwpck_require__(31312); +const isProcessProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string"; +exports.isProcessProfile = isProcessProfile; +const resolveProcessCredentials = async (options, profile) => (0, credential_provider_process_1.fromProcess)({ + ...options, + profile, +})(); +exports.resolveProcessCredentials = resolveProcessCredentials; - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); -======= -/***/ 63300: -/***/ ((module) => { +/***/ }), -/****************************************************************************** -Copyright (c) Microsoft Corporation. +/***/ 1083: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.resolveProfileData = void 0; +const property_provider_1 = __nccwpck_require__(60846); +const resolveAssumeRoleCredentials_1 = __nccwpck_require__(35242); +const resolveProcessCredentials_1 = __nccwpck_require__(84867); +const resolveSsoCredentials_1 = __nccwpck_require__(34606); +const resolveStaticCredentials_1 = __nccwpck_require__(17225); +const resolveWebIdentityCredentials_1 = __nccwpck_require__(49172); +const resolveProfileData = async (profileName, profiles, options, visitedProfiles = {}) => { + const data = profiles[profileName]; + if (Object.keys(visitedProfiles).length > 0 && (0, resolveStaticCredentials_1.isStaticCredsProfile)(data)) { + return (0, resolveStaticCredentials_1.resolveStaticCredentials)(data); } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); + if ((0, resolveAssumeRoleCredentials_1.isAssumeRoleProfile)(data)) { + return (0, resolveAssumeRoleCredentials_1.resolveAssumeRoleCredentials)(profileName, profiles, options, visitedProfiles); } - else { - factory(createExporter(root)); + if ((0, resolveStaticCredentials_1.isStaticCredsProfile)(data)) { + return (0, resolveStaticCredentials_1.resolveStaticCredentials)(data); } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + if ((0, resolveWebIdentityCredentials_1.isWebIdentityProfile)(data)) { + return (0, resolveWebIdentityCredentials_1.resolveWebIdentityCredentials)(data, options); } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; + if ((0, resolveProcessCredentials_1.isProcessProfile)(data)) { + return (0, resolveProcessCredentials_1.resolveProcessCredentials)(options, profileName); + } + if ((0, resolveSsoCredentials_1.isSsoProfile)(data)) { + return (0, resolveSsoCredentials_1.resolveSsoCredentials)(data); + } + throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} could not be found or parsed in shared credentials file.`); +}; +exports.resolveProfileData = resolveProfileData; - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; +/***/ }), - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +/***/ 34606: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - __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.resolveSsoCredentials = exports.isSsoProfile = void 0; +const credential_provider_sso_1 = __nccwpck_require__(15054); +var credential_provider_sso_2 = __nccwpck_require__(15054); +Object.defineProperty(exports, "isSsoProfile", ({ enumerable: true, get: function () { return credential_provider_sso_2.isSsoProfile; } })); +const resolveSsoCredentials = (data) => { + const { sso_start_url, sso_account_id, sso_session, sso_region, sso_role_name } = (0, credential_provider_sso_1.validateSsoProfile)(data); + return (0, credential_provider_sso_1.fromSSO)({ + ssoStartUrl: sso_start_url, + ssoAccountId: sso_account_id, + ssoSession: sso_session, + ssoRegion: sso_region, + ssoRoleName: sso_role_name, + })(); +}; +exports.resolveSsoCredentials = resolveSsoCredentials; - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +/***/ }), - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +/***/ 17225: +/***/ ((__unused_webpack_module, exports) => { - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.resolveStaticCredentials = exports.isStaticCredsProfile = void 0; +const isStaticCredsProfile = (arg) => Boolean(arg) && + typeof arg === "object" && + typeof arg.aws_access_key_id === "string" && + typeof arg.aws_secret_access_key === "string" && + ["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1; +exports.isStaticCredsProfile = isStaticCredsProfile; +const resolveStaticCredentials = (profile) => Promise.resolve({ + accessKeyId: profile.aws_access_key_id, + secretAccessKey: profile.aws_secret_access_key, + sessionToken: profile.aws_session_token, +}); +exports.resolveStaticCredentials = resolveStaticCredentials; - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +/***/ }), - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; +/***/ 49172: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.resolveWebIdentityCredentials = exports.isWebIdentityProfile = void 0; +const credential_provider_web_identity_1 = __nccwpck_require__(61478); +const isWebIdentityProfile = (arg) => Boolean(arg) && + typeof arg === "object" && + typeof arg.web_identity_token_file === "string" && + typeof arg.role_arn === "string" && + ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1; +exports.isWebIdentityProfile = isWebIdentityProfile; +const resolveWebIdentityCredentials = async (profile, options) => (0, credential_provider_web_identity_1.fromTokenFile)({ + webIdentityTokenFile: profile.web_identity_token_file, + roleArn: profile.role_arn, + roleSessionName: profile.role_session_name, + roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity, +})(); +exports.resolveWebIdentityCredentials = resolveWebIdentityCredentials; - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; +/***/ }), - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +/***/ 89476: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.defaultProvider = void 0; +const credential_provider_env_1 = __nccwpck_require__(92433); +const credential_provider_ini_1 = __nccwpck_require__(3926); +const credential_provider_process_1 = __nccwpck_require__(31312); +const credential_provider_sso_1 = __nccwpck_require__(15054); +const credential_provider_web_identity_1 = __nccwpck_require__(61478); +const property_provider_1 = __nccwpck_require__(60846); +const shared_ini_file_loader_1 = __nccwpck_require__(53013); +const remoteProvider_1 = __nccwpck_require__(96044); +const defaultProvider = (init = {}) => (0, property_provider_1.memoize)((0, property_provider_1.chain)(...(init.profile || process.env[shared_ini_file_loader_1.ENV_PROFILE] ? [] : [(0, credential_provider_env_1.fromEnv)()]), (0, credential_provider_sso_1.fromSSO)(init), (0, credential_provider_ini_1.fromIni)(init), (0, credential_provider_process_1.fromProcess)(init), (0, credential_provider_web_identity_1.fromTokenFile)(init), (0, remoteProvider_1.remoteProvider)(init), async () => { + throw new property_provider_1.CredentialsProviderError("Could not load credentials from any providers", false); +}), (credentials) => credentials.expiration !== undefined && credentials.expiration.getTime() - Date.now() < 300000, (credentials) => credentials.expiration !== undefined); +exports.defaultProvider = defaultProvider; - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; +/***/ }), - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +/***/ 52963: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(89476), exports); /***/ }), -<<<<<<< HEAD -/***/ 67375: -======= -/***/ 69125: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 96044: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromEnv = exports.ENV_EXPIRATION = exports.ENV_SESSION = exports.ENV_SECRET = exports.ENV_KEY = void 0; -<<<<<<< HEAD -const property_provider_1 = __nccwpck_require__(12955); -======= -const property_provider_1 = __nccwpck_require__(68655); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -exports.ENV_KEY = "AWS_ACCESS_KEY_ID"; -exports.ENV_SECRET = "AWS_SECRET_ACCESS_KEY"; -exports.ENV_SESSION = "AWS_SESSION_TOKEN"; -exports.ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION"; -const fromEnv = () => async () => { - const accessKeyId = process.env[exports.ENV_KEY]; - const secretAccessKey = process.env[exports.ENV_SECRET]; - const sessionToken = process.env[exports.ENV_SESSION]; - const expiry = process.env[exports.ENV_EXPIRATION]; - if (accessKeyId && secretAccessKey) { - return { - accessKeyId, - secretAccessKey, - ...(sessionToken && { sessionToken }), - ...(expiry && { expiration: new Date(expiry) }), +exports.remoteProvider = exports.ENV_IMDS_DISABLED = void 0; +const credential_provider_imds_1 = __nccwpck_require__(95815); +const property_provider_1 = __nccwpck_require__(60846); +exports.ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; +const remoteProvider = (init) => { + if (process.env[credential_provider_imds_1.ENV_CMDS_RELATIVE_URI] || process.env[credential_provider_imds_1.ENV_CMDS_FULL_URI]) { + return (0, credential_provider_imds_1.fromContainerMetadata)(init); + } + if (process.env[exports.ENV_IMDS_DISABLED]) { + return async () => { + throw new property_provider_1.CredentialsProviderError("EC2 Instance Metadata Service access disabled"); }; } - throw new property_provider_1.CredentialsProviderError("Unable to find environment variable credentials."); + return (0, credential_provider_imds_1.fromInstanceMetadata)(init); }; -exports.fromEnv = fromEnv; +exports.remoteProvider = remoteProvider; /***/ }), -<<<<<<< HEAD -/***/ 66048: -======= -/***/ 40096: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 29377: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(47449); -tslib_1.__exportStar(__nccwpck_require__(67375), exports); -======= -const tslib_1 = __nccwpck_require__(58880); -tslib_1.__exportStar(__nccwpck_require__(69125), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - -/***/ }), - -<<<<<<< HEAD -/***/ 47449: -======= -/***/ 58880: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -<<<<<<< HEAD -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); -======= -/***/ }), - -/***/ 22794: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Endpoint = void 0; -var Endpoint; -(function (Endpoint) { - Endpoint["IPv4"] = "http://169.254.169.254"; - Endpoint["IPv6"] = "http://[fd00:ec2::254]"; -})(Endpoint = exports.Endpoint || (exports.Endpoint = {})); +exports.fromProcess = void 0; +const shared_ini_file_loader_1 = __nccwpck_require__(53013); +const resolveProcessCredentials_1 = __nccwpck_require__(7239); +const fromProcess = (init = {}) => async () => { + const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init); + return (0, resolveProcessCredentials_1.resolveProcessCredentials)((0, shared_ini_file_loader_1.getProfileName)(init), profiles); +}; +exports.fromProcess = fromProcess; /***/ }), -/***/ 46750: +/***/ 56014: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ENDPOINT_CONFIG_OPTIONS = exports.CONFIG_ENDPOINT_NAME = exports.ENV_ENDPOINT_NAME = void 0; -exports.ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT"; -exports.CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint"; -exports.ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[exports.ENV_ENDPOINT_NAME], - configFileSelector: (profile) => profile[exports.CONFIG_ENDPOINT_NAME], - default: undefined, +exports.getValidatedProcessCredentials = void 0; +const getValidatedProcessCredentials = (profileName, data) => { + if (data.Version !== 1) { + throw Error(`Profile ${profileName} credential_process did not return Version 1.`); + } + if (data.AccessKeyId === undefined || data.SecretAccessKey === undefined) { + throw Error(`Profile ${profileName} credential_process returned invalid credentials.`); + } + if (data.Expiration) { + const currentTime = new Date(); + const expireTime = new Date(data.Expiration); + if (expireTime < currentTime) { + throw Error(`Profile ${profileName} credential_process returned expired credentials.`); + } + } + return { + accessKeyId: data.AccessKeyId, + secretAccessKey: data.SecretAccessKey, + ...(data.SessionToken && { sessionToken: data.SessionToken }), + ...(data.Expiration && { expiration: new Date(data.Expiration) }), + }; }; +exports.getValidatedProcessCredentials = getValidatedProcessCredentials; /***/ }), -/***/ 60868: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointMode = void 0; -var EndpointMode; -(function (EndpointMode) { - EndpointMode["IPv4"] = "IPv4"; - EndpointMode["IPv6"] = "IPv6"; -})(EndpointMode = exports.EndpointMode || (exports.EndpointMode = {})); - - -/***/ }), - -/***/ 88500: +/***/ 31312: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ENDPOINT_MODE_CONFIG_OPTIONS = exports.CONFIG_ENDPOINT_MODE_NAME = exports.ENV_ENDPOINT_MODE_NAME = void 0; -const EndpointMode_1 = __nccwpck_require__(60868); -exports.ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE"; -exports.CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode"; -exports.ENDPOINT_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[exports.ENV_ENDPOINT_MODE_NAME], - configFileSelector: (profile) => profile[exports.CONFIG_ENDPOINT_MODE_NAME], - default: EndpointMode_1.EndpointMode.IPv4, -}; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(29377), exports); /***/ }), -/***/ 97318: +/***/ 7239: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromContainerMetadata = exports.ENV_CMDS_AUTH_TOKEN = exports.ENV_CMDS_RELATIVE_URI = exports.ENV_CMDS_FULL_URI = void 0; -const property_provider_1 = __nccwpck_require__(68655); -const url_1 = __nccwpck_require__(57310); -const httpRequest_1 = __nccwpck_require__(45425); -const ImdsCredentials_1 = __nccwpck_require__(23314); -const RemoteProviderInit_1 = __nccwpck_require__(80199); -const retry_1 = __nccwpck_require__(54754); -exports.ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; -exports.ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; -exports.ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; -const fromContainerMetadata = (init = {}) => { - const { timeout, maxRetries } = (0, RemoteProviderInit_1.providerConfigFromInit)(init); - return () => (0, retry_1.retry)(async () => { - const requestOptions = await getCmdsUri(); - const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions)); - if (!(0, ImdsCredentials_1.isImdsCredentials)(credsResponse)) { - throw new property_provider_1.CredentialsProviderError("Invalid response received from instance metadata service."); +exports.resolveProcessCredentials = void 0; +const property_provider_1 = __nccwpck_require__(60846); +const child_process_1 = __nccwpck_require__(32081); +const util_1 = __nccwpck_require__(73837); +const getValidatedProcessCredentials_1 = __nccwpck_require__(56014); +const resolveProcessCredentials = async (profileName, profiles) => { + const profile = profiles[profileName]; + if (profiles[profileName]) { + const credentialProcess = profile["credential_process"]; + if (credentialProcess !== undefined) { + const execPromise = (0, util_1.promisify)(child_process_1.exec); + try { + const { stdout } = await execPromise(credentialProcess); + let data; + try { + data = JSON.parse(stdout.trim()); + } + catch (_a) { + throw Error(`Profile ${profileName} credential_process returned invalid JSON.`); + } + return (0, getValidatedProcessCredentials_1.getValidatedProcessCredentials)(profileName, data); + } + catch (error) { + throw new property_provider_1.CredentialsProviderError(error.message); + } + } + else { + throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`); } - return (0, ImdsCredentials_1.fromImdsCredentials)(credsResponse); - }, maxRetries); -}; -exports.fromContainerMetadata = fromContainerMetadata; -const requestFromEcsImds = async (timeout, options) => { - if (process.env[exports.ENV_CMDS_AUTH_TOKEN]) { - options.headers = { - ...options.headers, - Authorization: process.env[exports.ENV_CMDS_AUTH_TOKEN], - }; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); } else { - factory(createExporter(root)); + throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`); } -<<<<<<< HEAD - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); -======= - throw new property_provider_1.CredentialsProviderError("The container metadata credential provider cannot be used unless" + - ` the ${exports.ENV_CMDS_RELATIVE_URI} or ${exports.ENV_CMDS_FULL_URI} environment` + - " variable is set", false); }; +exports.resolveProcessCredentials = resolveProcessCredentials; /***/ }), -/***/ 8910: +/***/ 23980: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromInstanceMetadata = void 0; -const property_provider_1 = __nccwpck_require__(68655); -const httpRequest_1 = __nccwpck_require__(45425); -const ImdsCredentials_1 = __nccwpck_require__(23314); -const RemoteProviderInit_1 = __nccwpck_require__(80199); -const retry_1 = __nccwpck_require__(54754); -const getInstanceMetadataEndpoint_1 = __nccwpck_require__(30186); -const staticStabilityProvider_1 = __nccwpck_require__(77101); -const IMDS_PATH = "/latest/meta-data/iam/security-credentials/"; -const IMDS_TOKEN_PATH = "/latest/api/token"; -const fromInstanceMetadata = (init = {}) => (0, staticStabilityProvider_1.staticStabilityProvider)(getInstanceImdsProvider(init), { logger: init.logger }); -exports.fromInstanceMetadata = fromInstanceMetadata; -const getInstanceImdsProvider = (init) => { - let disableFetchToken = false; - const { timeout, maxRetries } = (0, RemoteProviderInit_1.providerConfigFromInit)(init); - const getCredentials = async (maxRetries, options) => { - const profile = (await (0, retry_1.retry)(async () => { - let profile; - try { - profile = await getProfile(options); - } - catch (err) { - if (err.statusCode === 401) { - disableFetchToken = false; - } - throw err; - } - return profile; - }, maxRetries)).trim(); - return (0, retry_1.retry)(async () => { - let creds; - try { - creds = await getCredentialsFromProfile(profile, options); - } - catch (err) { - if (err.statusCode === 401) { - disableFetchToken = false; - } - throw err; - } - return creds; - }, maxRetries); - }; - return async () => { - const endpoint = await (0, getInstanceMetadataEndpoint_1.getInstanceMetadataEndpoint)(); - if (disableFetchToken) { - return getCredentials(maxRetries, { ...endpoint, timeout }); +exports.fromSSO = void 0; +const property_provider_1 = __nccwpck_require__(60846); +const shared_ini_file_loader_1 = __nccwpck_require__(53013); +const isSsoProfile_1 = __nccwpck_require__(88579); +const resolveSSOCredentials_1 = __nccwpck_require__(63603); +const validateSsoProfile_1 = __nccwpck_require__(70051); +const fromSSO = (init = {}) => async () => { + const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, ssoSession } = init; + const profileName = (0, shared_ini_file_loader_1.getProfileName)(init); + if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { + const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init); + const profile = profiles[profileName]; + if (!profile) { + throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} was not found.`); } - else { - let token; - try { - token = (await getMetadataToken({ ...endpoint, timeout })).toString(); + if (!(0, isSsoProfile_1.isSsoProfile)(profile)) { + throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`); + } + if (profile === null || profile === void 0 ? void 0 : profile.sso_session) { + const ssoSessions = await (0, shared_ini_file_loader_1.loadSsoSessionData)(init); + const session = ssoSessions[profile.sso_session]; + const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`; + if (ssoRegion && ssoRegion !== session.sso_region) { + throw new property_provider_1.CredentialsProviderError(`Conflicting SSO region` + conflictMsg, false); } - catch (error) { - if ((error === null || error === void 0 ? void 0 : error.statusCode) === 400) { - throw Object.assign(error, { - message: "EC2 Metadata token request returned error", - }); - } - else if (error.message === "TimeoutError" || [403, 404, 405].includes(error.statusCode)) { - disableFetchToken = true; - } - return getCredentials(maxRetries, { ...endpoint, timeout }); + if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) { + throw new property_provider_1.CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, false); } - return getCredentials(maxRetries, { - ...endpoint, - headers: { - "x-aws-ec2-metadata-token": token, - }, - timeout, - }); + profile.sso_region = session.sso_region; + profile.sso_start_url = session.sso_start_url; } - }; -}; -const getMetadataToken = async (options) => (0, httpRequest_1.httpRequest)({ - ...options, - path: IMDS_TOKEN_PATH, - method: "PUT", - headers: { - "x-aws-ec2-metadata-token-ttl-seconds": "21600", - }, -}); -const getProfile = async (options) => (await (0, httpRequest_1.httpRequest)({ ...options, path: IMDS_PATH })).toString(); -const getCredentialsFromProfile = async (profile, options) => { - const credsResponse = JSON.parse((await (0, httpRequest_1.httpRequest)({ - ...options, - path: IMDS_PATH + profile, - })).toString()); - if (!(0, ImdsCredentials_1.isImdsCredentials)(credsResponse)) { - throw new property_provider_1.CredentialsProviderError("Invalid response received from instance metadata service."); + const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = (0, validateSsoProfile_1.validateSsoProfile)(profile); + return (0, resolveSSOCredentials_1.resolveSSOCredentials)({ + ssoStartUrl: sso_start_url, + ssoSession: sso_session, + ssoAccountId: sso_account_id, + ssoRegion: sso_region, + ssoRoleName: sso_role_name, + ssoClient: ssoClient, + profile: profileName, + }); + } + else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) { + throw new property_provider_1.CredentialsProviderError("Incomplete configuration. The fromSSO() argument hash must include " + + '"ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"'); + } + else { + return (0, resolveSSOCredentials_1.resolveSSOCredentials)({ + ssoStartUrl, + ssoSession, + ssoAccountId, + ssoRegion, + ssoRoleName, + ssoClient, + profile: profileName, + }); } - return (0, ImdsCredentials_1.fromImdsCredentials)(credsResponse); }; +exports.fromSSO = fromSSO; /***/ }), -/***/ 56369: +/***/ 15054: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getInstanceMetadataEndpoint = exports.httpRequest = void 0; -const tslib_1 = __nccwpck_require__(95022); -tslib_1.__exportStar(__nccwpck_require__(97318), exports); -tslib_1.__exportStar(__nccwpck_require__(8910), exports); -tslib_1.__exportStar(__nccwpck_require__(80199), exports); -tslib_1.__exportStar(__nccwpck_require__(28112), exports); -var httpRequest_1 = __nccwpck_require__(45425); -Object.defineProperty(exports, "httpRequest", ({ enumerable: true, get: function () { return httpRequest_1.httpRequest; } })); -var getInstanceMetadataEndpoint_1 = __nccwpck_require__(30186); -Object.defineProperty(exports, "getInstanceMetadataEndpoint", ({ enumerable: true, get: function () { return getInstanceMetadataEndpoint_1.getInstanceMetadataEndpoint; } })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(23980), exports); +tslib_1.__exportStar(__nccwpck_require__(88579), exports); +tslib_1.__exportStar(__nccwpck_require__(5831), exports); +tslib_1.__exportStar(__nccwpck_require__(70051), exports); /***/ }), -/***/ 23314: +/***/ 88579: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromImdsCredentials = exports.isImdsCredentials = void 0; -const isImdsCredentials = (arg) => Boolean(arg) && - typeof arg === "object" && - typeof arg.AccessKeyId === "string" && - typeof arg.SecretAccessKey === "string" && - typeof arg.Token === "string" && - typeof arg.Expiration === "string"; -exports.isImdsCredentials = isImdsCredentials; -const fromImdsCredentials = (creds) => ({ - accessKeyId: creds.AccessKeyId, - secretAccessKey: creds.SecretAccessKey, - sessionToken: creds.Token, - expiration: new Date(creds.Expiration), -}); -exports.fromImdsCredentials = fromImdsCredentials; +exports.isSsoProfile = void 0; +const isSsoProfile = (arg) => arg && + (typeof arg.sso_start_url === "string" || + typeof arg.sso_account_id === "string" || + typeof arg.sso_session === "string" || + typeof arg.sso_region === "string" || + typeof arg.sso_role_name === "string"); +exports.isSsoProfile = isSsoProfile; /***/ }), -/***/ 80199: -/***/ ((__unused_webpack_module, exports) => { +/***/ 63603: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.providerConfigFromInit = exports.DEFAULT_MAX_RETRIES = exports.DEFAULT_TIMEOUT = void 0; -exports.DEFAULT_TIMEOUT = 1000; -exports.DEFAULT_MAX_RETRIES = 0; -const providerConfigFromInit = ({ maxRetries = exports.DEFAULT_MAX_RETRIES, timeout = exports.DEFAULT_TIMEOUT, }) => ({ maxRetries, timeout }); -exports.providerConfigFromInit = providerConfigFromInit; +exports.resolveSSOCredentials = void 0; +const client_sso_1 = __nccwpck_require__(79736); +const token_providers_1 = __nccwpck_require__(30395); +const property_provider_1 = __nccwpck_require__(60846); +const shared_ini_file_loader_1 = __nccwpck_require__(53013); +const SHOULD_FAIL_CREDENTIAL_CHAIN = false; +const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, profile, }) => { + let token; + const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`; + if (ssoSession) { + try { + const _token = await (0, token_providers_1.fromSso)({ profile })(); + token = { + accessToken: _token.token, + expiresAt: new Date(_token.expiration).toISOString(), + }; + } + catch (e) { + throw new property_provider_1.CredentialsProviderError(e.message, SHOULD_FAIL_CREDENTIAL_CHAIN); + } + } + else { + try { + token = await (0, shared_ini_file_loader_1.getSSOTokenFromFile)(ssoStartUrl); + } + catch (e) { + throw new property_provider_1.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, SHOULD_FAIL_CREDENTIAL_CHAIN); + } + } + if (new Date(token.expiresAt).getTime() - Date.now() <= 0) { + throw new property_provider_1.CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, SHOULD_FAIL_CREDENTIAL_CHAIN); + } + const { accessToken } = token; + const sso = ssoClient || new client_sso_1.SSOClient({ region: ssoRegion }); + let ssoResp; + try { + ssoResp = await sso.send(new client_sso_1.GetRoleCredentialsCommand({ + accountId: ssoAccountId, + roleName: ssoRoleName, + accessToken, + })); + } + catch (e) { + throw property_provider_1.CredentialsProviderError.from(e, SHOULD_FAIL_CREDENTIAL_CHAIN); + } + const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration } = {} } = ssoResp; + if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) { + throw new property_provider_1.CredentialsProviderError("SSO returns an invalid temporary credential.", SHOULD_FAIL_CREDENTIAL_CHAIN); + } + return { accessKeyId, secretAccessKey, sessionToken, expiration: new Date(expiration) }; +}; +exports.resolveSSOCredentials = resolveSSOCredentials; /***/ }), -/***/ 45425: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 5831: +/***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.httpRequest = void 0; -const property_provider_1 = __nccwpck_require__(68655); -const buffer_1 = __nccwpck_require__(14300); -const http_1 = __nccwpck_require__(13685); -function httpRequest(options) { - return new Promise((resolve, reject) => { - var _a; - const req = (0, http_1.request)({ - method: "GET", - ...options, - hostname: (_a = options.hostname) === null || _a === void 0 ? void 0 : _a.replace(/^\[(.+)\]$/, "$1"), - }); - req.on("error", (err) => { - reject(Object.assign(new property_provider_1.ProviderError("Unable to connect to instance metadata service"), err)); - req.destroy(); - }); - req.on("timeout", () => { - reject(new property_provider_1.ProviderError("TimeoutError from instance metadata service")); - req.destroy(); - }); - req.on("response", (res) => { - const { statusCode = 400 } = res; - if (statusCode < 200 || 300 <= statusCode) { - reject(Object.assign(new property_provider_1.ProviderError("Error response received from instance metadata service"), { statusCode })); - req.destroy(); - } - const chunks = []; - res.on("data", (chunk) => { - chunks.push(chunk); - }); - res.on("end", () => { - resolve(buffer_1.Buffer.concat(chunks)); - req.destroy(); - }); - }); - req.end(); - }); -} -exports.httpRequest = httpRequest; /***/ }), -/***/ 54754: -/***/ ((__unused_webpack_module, exports) => { +/***/ 70051: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.retry = void 0; -const retry = (toRetry, maxRetries) => { - let promise = toRetry(); - for (let i = 0; i < maxRetries; i++) { - promise = promise.catch(toRetry); +exports.validateSsoProfile = void 0; +const property_provider_1 = __nccwpck_require__(60846); +const validateSsoProfile = (profile) => { + const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile; + if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) { + throw new property_provider_1.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", ` + + `"sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(profile).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, false); } - return promise; + return profile; }; -exports.retry = retry; +exports.validateSsoProfile = validateSsoProfile; /***/ }), -/***/ 28112: -/***/ ((__unused_webpack_module, exports) => { +/***/ 98173: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fromTokenFile = void 0; +const property_provider_1 = __nccwpck_require__(60846); +const fs_1 = __nccwpck_require__(57147); +const fromWebToken_1 = __nccwpck_require__(86011); +const ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE"; +const ENV_ROLE_ARN = "AWS_ROLE_ARN"; +const ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME"; +const fromTokenFile = (init = {}) => async () => { + var _a, _b, _c; + const webIdentityTokenFile = (_a = init === null || init === void 0 ? void 0 : init.webIdentityTokenFile) !== null && _a !== void 0 ? _a : process.env[ENV_TOKEN_FILE]; + const roleArn = (_b = init === null || init === void 0 ? void 0 : init.roleArn) !== null && _b !== void 0 ? _b : process.env[ENV_ROLE_ARN]; + const roleSessionName = (_c = init === null || init === void 0 ? void 0 : init.roleSessionName) !== null && _c !== void 0 ? _c : process.env[ENV_ROLE_SESSION_NAME]; + if (!webIdentityTokenFile || !roleArn) { + throw new property_provider_1.CredentialsProviderError("Web identity configuration not specified"); + } + return (0, fromWebToken_1.fromWebToken)({ + ...init, + webIdentityToken: (0, fs_1.readFileSync)(webIdentityTokenFile, { encoding: "ascii" }), + roleArn, + roleSessionName, + })(); +}; +exports.fromTokenFile = fromTokenFile; /***/ }), -/***/ 61575: -/***/ ((__unused_webpack_module, exports) => { +/***/ 86011: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getExtendedInstanceMetadataCredentials = void 0; -const STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60; -const STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60; -const STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html"; -const getExtendedInstanceMetadataCredentials = (credentials, logger) => { - var _a; - const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + - Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS); - const newExpiration = new Date(Date.now() + refreshInterval * 1000); - logger.warn("Attempting credential expiration extension due to a credential service availability issue. A refresh of these " + - "credentials will be attempted after ${new Date(newExpiration)}.\nFor more information, please visit: " + - STATIC_STABILITY_DOC_URL); - const originalExpiration = (_a = credentials.originalExpiration) !== null && _a !== void 0 ? _a : credentials.expiration; - return { - ...credentials, - ...(originalExpiration ? { originalExpiration } : {}), - expiration: newExpiration, - }; +exports.fromWebToken = void 0; +const property_provider_1 = __nccwpck_require__(60846); +const fromWebToken = (init) => () => { + const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds, roleAssumerWithWebIdentity, } = init; + if (!roleAssumerWithWebIdentity) { + throw new property_provider_1.CredentialsProviderError(`Role Arn '${roleArn}' needs to be assumed with web identity,` + + ` but no role assumption callback was provided.`, false); + } + return roleAssumerWithWebIdentity({ + RoleArn: roleArn, + RoleSessionName: roleSessionName !== null && roleSessionName !== void 0 ? roleSessionName : `aws-sdk-js-session-${Date.now()}`, + WebIdentityToken: webIdentityToken, + ProviderId: providerId, + PolicyArns: policyArns, + Policy: policy, + DurationSeconds: durationSeconds, + }); }; -exports.getExtendedInstanceMetadataCredentials = getExtendedInstanceMetadataCredentials; +exports.fromWebToken = fromWebToken; /***/ }), -/***/ 30186: +/***/ 61478: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getInstanceMetadataEndpoint = void 0; -const node_config_provider_1 = __nccwpck_require__(15071); -const url_parser_1 = __nccwpck_require__(13797); -const Endpoint_1 = __nccwpck_require__(22794); -const EndpointConfigOptions_1 = __nccwpck_require__(46750); -const EndpointMode_1 = __nccwpck_require__(60868); -const EndpointModeConfigOptions_1 = __nccwpck_require__(88500); -const getInstanceMetadataEndpoint = async () => (0, url_parser_1.parseUrl)((await getFromEndpointConfig()) || (await getFromEndpointModeConfig())); -exports.getInstanceMetadataEndpoint = getInstanceMetadataEndpoint; -const getFromEndpointConfig = async () => (0, node_config_provider_1.loadConfig)(EndpointConfigOptions_1.ENDPOINT_CONFIG_OPTIONS)(); -const getFromEndpointModeConfig = async () => { - const endpointMode = await (0, node_config_provider_1.loadConfig)(EndpointModeConfigOptions_1.ENDPOINT_MODE_CONFIG_OPTIONS)(); - switch (endpointMode) { - case EndpointMode_1.EndpointMode.IPv4: - return Endpoint_1.Endpoint.IPv4; - case EndpointMode_1.EndpointMode.IPv6: - return Endpoint_1.Endpoint.IPv6; - default: - throw new Error(`Unsupported endpoint mode: ${endpointMode}.` + ` Select from ${Object.values(EndpointMode_1.EndpointMode)}`); - } -}; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(98173), exports); +tslib_1.__exportStar(__nccwpck_require__(86011), exports); /***/ }), -/***/ 77101: +/***/ 20679: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.staticStabilityProvider = void 0; -const getExtendedInstanceMetadataCredentials_1 = __nccwpck_require__(61575); -const staticStabilityProvider = (provider, options = {}) => { - const logger = (options === null || options === void 0 ? void 0 : options.logger) || console; - let pastCredentials; - return async () => { - let credentials; - try { - credentials = await provider(); - if (credentials.expiration && credentials.expiration.getTime() < Date.now()) { - credentials = (0, getExtendedInstanceMetadataCredentials_1.getExtendedInstanceMetadataCredentials)(credentials, logger); +exports.Upload = void 0; +const client_s3_1 = __nccwpck_require__(63419); +const abort_controller_1 = __nccwpck_require__(93251); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const smithy_client_1 = __nccwpck_require__(42584); +const events_1 = __nccwpck_require__(82361); +const bytelength_1 = __nccwpck_require__(56512); +const chunker_1 = __nccwpck_require__(38244); +const MIN_PART_SIZE = 1024 * 1024 * 5; +class Upload extends events_1.EventEmitter { + constructor(options) { + var _a; + super(); + this.MAX_PARTS = 10000; + this.queueSize = 4; + this.partSize = MIN_PART_SIZE; + this.leavePartsOnError = false; + this.tags = []; + this.concurrentUploaders = []; + this.uploadedParts = []; + this.isMultiPart = true; + this.queueSize = options.queueSize || this.queueSize; + this.partSize = options.partSize || this.partSize; + this.leavePartsOnError = options.leavePartsOnError || this.leavePartsOnError; + this.tags = options.tags || this.tags; + this.client = options.client; + this.params = options.params; + this.__validateInput(); + this.totalBytes = (0, bytelength_1.byteLength)(this.params.Body); + this.bytesUploadedSoFar = 0; + this.abortController = (_a = options.abortController) !== null && _a !== void 0 ? _a : new abort_controller_1.AbortController(); + } + async abort() { + this.abortController.abort(); + } + async done() { + return await Promise.race([this.__doMultipartUpload(), this.__abortTimeout(this.abortController.signal)]); + } + on(event, listener) { + this.uploadEvent = event; + return super.on(event, listener); + } + async __uploadUsingPut(dataPart) { + var _a; + this.isMultiPart = false; + const params = { ...this.params, Body: dataPart.data }; + const clientConfig = this.client.config; + const requestHandler = clientConfig.requestHandler; + const eventEmitter = requestHandler instanceof events_1.EventEmitter ? requestHandler : null; + const uploadEventListener = (event) => { + this.bytesUploadedSoFar = event.loaded; + this.totalBytes = event.total; + this.__notifyProgress({ + loaded: this.bytesUploadedSoFar, + total: this.totalBytes, + part: dataPart.partNumber, + Key: this.params.Key, + Bucket: this.params.Bucket, + }); + }; + if (eventEmitter !== null) { + eventEmitter.on("xhr.upload.progress", uploadEventListener); + } + const resolved = await Promise.all([this.client.send(new client_s3_1.PutObjectCommand(params)), (_a = clientConfig === null || clientConfig === void 0 ? void 0 : clientConfig.endpoint) === null || _a === void 0 ? void 0 : _a.call(clientConfig)]); + const putResult = resolved[0]; + let endpoint = resolved[1]; + if (!endpoint) { + endpoint = (0, middleware_endpoint_1.toEndpointV1)(await (0, middleware_endpoint_1.getEndpointFromInstructions)(params, client_s3_1.PutObjectCommand, { + ...clientConfig, + })); + } + if (!endpoint) { + throw new Error('Could not resolve endpoint from S3 "client.config.endpoint()" nor EndpointsV2.'); + } + if (eventEmitter !== null) { + eventEmitter.off("xhr.upload.progress", uploadEventListener); + } + const locationKey = this.params + .Key.split("/") + .map((segment) => (0, smithy_client_1.extendedEncodeURIComponent)(segment)) + .join("/"); + const locationBucket = (0, smithy_client_1.extendedEncodeURIComponent)(this.params.Bucket); + const Location = (() => { + const endpointHostnameIncludesBucket = endpoint.hostname.startsWith(`${locationBucket}.`); + const forcePathStyle = this.client.config.forcePathStyle; + if (forcePathStyle) { + return `${endpoint.protocol}//${endpoint.hostname}/${locationBucket}/${locationKey}`; } + if (endpointHostnameIncludesBucket) { + return `${endpoint.protocol}//${endpoint.hostname}/${locationKey}`; + } + return `${endpoint.protocol}//${locationBucket}.${endpoint.hostname}/${locationKey}`; + })(); + this.singleUploadResult = { + ...putResult, + Bucket: this.params.Bucket, + Key: this.params.Key, + Location, + }; + const totalSize = (0, bytelength_1.byteLength)(dataPart.data); + this.__notifyProgress({ + loaded: totalSize, + total: totalSize, + part: 1, + Key: this.params.Key, + Bucket: this.params.Bucket, + }); + } + async __createMultipartUpload() { + if (!this.createMultiPartPromise) { + const createCommandParams = { ...this.params, Body: undefined }; + this.createMultiPartPromise = this.client.send(new client_s3_1.CreateMultipartUploadCommand(createCommandParams)); } - catch (e) { - if (pastCredentials) { - logger.warn("Credential renew failed: ", e); - credentials = (0, getExtendedInstanceMetadataCredentials_1.getExtendedInstanceMetadataCredentials)(pastCredentials, logger); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + return this.createMultiPartPromise; + } + async __doConcurrentUpload(dataFeeder) { + for await (const dataPart of dataFeeder) { + if (this.uploadedParts.length > this.MAX_PARTS) { + throw new Error(`Exceeded ${this.MAX_PARTS} as part of the upload to ${this.params.Key} and ${this.params.Bucket}.`); } - else { - exports.__esModule = true; + try { + if (this.abortController.signal.aborted) { + return; + } + if (dataPart.partNumber === 1 && dataPart.lastPart) { + return await this.__uploadUsingPut(dataPart); + } + if (!this.uploadId) { + const { UploadId } = await this.__createMultipartUpload(); + this.uploadId = UploadId; + if (this.abortController.signal.aborted) { + return; + } + } + const partSize = (0, bytelength_1.byteLength)(dataPart.data) || 0; + const requestHandler = this.client.config.requestHandler; + const eventEmitter = requestHandler instanceof events_1.EventEmitter ? requestHandler : null; + let lastSeenBytes = 0; + const uploadEventListener = (event, request) => { + const requestPartSize = Number(request.query["partNumber"]) || -1; + if (requestPartSize !== dataPart.partNumber) { + return; + } + if (event.total && partSize) { + this.bytesUploadedSoFar += event.loaded - lastSeenBytes; + lastSeenBytes = event.loaded; + } + this.__notifyProgress({ + loaded: this.bytesUploadedSoFar, + total: this.totalBytes, + part: dataPart.partNumber, + Key: this.params.Key, + Bucket: this.params.Bucket, + }); + }; + if (eventEmitter !== null) { + eventEmitter.on("xhr.upload.progress", uploadEventListener); + } + const partResult = await this.client.send(new client_s3_1.UploadPartCommand({ + ...this.params, + UploadId: this.uploadId, + Body: dataPart.data, + PartNumber: dataPart.partNumber, + })); + if (eventEmitter !== null) { + eventEmitter.off("xhr.upload.progress", uploadEventListener); + } + if (this.abortController.signal.aborted) { + return; + } + if (!partResult.ETag) { + throw new Error(`Part ${dataPart.partNumber} is missing ETag in UploadPart response. Missing Bucket CORS configuration for ETag header?`); + } + this.uploadedParts.push({ + PartNumber: dataPart.partNumber, + ETag: partResult.ETag, + ...(partResult.ChecksumCRC32 && { ChecksumCRC32: partResult.ChecksumCRC32 }), + ...(partResult.ChecksumCRC32C && { ChecksumCRC32C: partResult.ChecksumCRC32C }), + ...(partResult.ChecksumSHA1 && { ChecksumSHA1: partResult.ChecksumSHA1 }), + ...(partResult.ChecksumSHA256 && { ChecksumSHA256: partResult.ChecksumSHA256 }), + }); + if (eventEmitter === null) { + this.bytesUploadedSoFar += partSize; + } + this.__notifyProgress({ + loaded: this.bytesUploadedSoFar, + total: this.totalBytes, + part: dataPart.partNumber, + Key: this.params.Key, + Bucket: this.params.Bucket, + }); + } + catch (e) { + if (!this.uploadId) { + throw e; + } + if (this.leavePartsOnError) { + throw e; + } } } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + async __doMultipartUpload() { + const dataFeeder = (0, chunker_1.getChunk)(this.params.Body, this.partSize); + for (let index = 0; index < this.queueSize; index++) { + const currentUpload = this.__doConcurrentUpload(dataFeeder); + this.concurrentUploaders.push(currentUpload); } - return t; - }; + await Promise.all(this.concurrentUploaders); + if (this.abortController.signal.aborted) { + throw Object.assign(new Error("Upload aborted."), { name: "AbortError" }); + } + let result; + if (this.isMultiPart) { + this.uploadedParts.sort((a, b) => a.PartNumber - b.PartNumber); + const uploadCompleteParams = { + ...this.params, + Body: undefined, + UploadId: this.uploadId, + MultipartUpload: { + Parts: this.uploadedParts, + }, + }; + result = await this.client.send(new client_s3_1.CompleteMultipartUploadCommand(uploadCompleteParams)); + } + else { + result = this.singleUploadResult; + } + if (this.tags.length) { + await this.client.send(new client_s3_1.PutObjectTaggingCommand({ + ...this.params, + Tagging: { + TagSet: this.tags, + }, + })); + } + return result; + } + __notifyProgress(progress) { + if (this.uploadEvent) { + this.emit(this.uploadEvent, progress); + } + } + async __abortTimeout(abortSignal) { + return new Promise((resolve, reject) => { + abortSignal.onabort = () => { + const abortError = new Error("Upload aborted."); + abortError.name = "AbortError"; + reject(abortError); + }; + }); + } + __validateInput() { + if (!this.params) { + throw new Error(`InputError: Upload requires params to be passed to upload.`); + } + if (!this.client) { + throw new Error(`InputError: Upload requires a AWS client to do uploads with.`); + } + if (this.partSize < MIN_PART_SIZE) { + throw new Error(`EntityTooSmall: Your proposed upload partsize [${this.partSize}] is smaller than the minimum allowed size [${MIN_PART_SIZE}] (5MB)`); + } + if (this.queueSize < 1) { + throw new Error(`Queue size: Must have at least one uploading queue.`); + } + } +} +exports.Upload = Upload; - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; +/***/ }), - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +/***/ 56512: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.byteLength = void 0; +const runtimeConfig_1 = __nccwpck_require__(99738); +const byteLength = (input) => { + if (input === null || input === undefined) + return 0; + if (typeof input === "string") + input = Buffer.from(input); + if (typeof input.byteLength === "number") { + return input.byteLength; + } + else if (typeof input.length === "number") { + return input.length; + } + else if (typeof input.size === "number") { + return input.size; + } + else if (typeof input.path === "string") { + try { + return runtimeConfig_1.ClientDefaultValues.lstatSync(input.path).size; } - return useValue ? value : void 0; - }; + catch (error) { + return undefined; + } + } + return undefined; +}; +exports.byteLength = byteLength; - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; +/***/ }), - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; +/***/ 38244: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __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()); - }); - }; - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getChunk = void 0; +const buffer_1 = __nccwpck_require__(14300); +const stream_1 = __nccwpck_require__(12781); +const getChunkBuffer_1 = __nccwpck_require__(32150); +const getChunkStream_1 = __nccwpck_require__(90598); +const getDataReadable_1 = __nccwpck_require__(19833); +const getDataReadableStream_1 = __nccwpck_require__(16272); +const getChunk = (data, partSize) => { + if (data instanceof buffer_1.Buffer) { + return (0, getChunkBuffer_1.getChunkBuffer)(data, partSize); + } + else if (data instanceof stream_1.Readable) { + return (0, getChunkStream_1.getChunkStream)(data, partSize, getDataReadable_1.getDataReadable); + } + else if (data instanceof String || typeof data === "string" || data instanceof Uint8Array) { + return (0, getChunkBuffer_1.getChunkBuffer)(buffer_1.Buffer.from(data), partSize); + } + if (typeof data.stream === "function") { + return (0, getChunkStream_1.getChunkStream)(data.stream(), partSize, getDataReadableStream_1.getDataReadableStream); + } + else if (data instanceof ReadableStream) { + return (0, getChunkStream_1.getChunkStream)(data, partSize, getDataReadableStream_1.getDataReadableStream); + } + else { + throw new Error("Body Data is unsupported format, expected data to be one of: string | Uint8Array | Buffer | Readable | ReadableStream | Blob;."); + } +}; +exports.getChunk = getChunk; - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +/***/ }), - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } +/***/ 32150: +/***/ ((__unused_webpack_module, exports) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getChunkBuffer = void 0; +async function* getChunkBuffer(data, partSize) { + let partNumber = 1; + let startByte = 0; + let endByte = partSize; + while (endByte < data.byteLength) { + yield { + partNumber, + data: data.slice(startByte, endByte), }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + partNumber += 1; + startByte = endByte; + endByte = startByte + partSize; + } + yield { + partNumber, + data: data.slice(startByte), + lastPart: true, }; +} +exports.getChunkBuffer = getChunkBuffer; - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +/***/ }), - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +/***/ 90598: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getChunkStream = void 0; +const buffer_1 = __nccwpck_require__(14300); +async function* getChunkStream(data, partSize, getNextData) { + let partNumber = 1; + const currentBuffer = { chunks: [], length: 0 }; + for await (const datum of getNextData(data)) { + currentBuffer.chunks.push(datum); + currentBuffer.length += datum.length; + while (currentBuffer.length >= partSize) { + const dataChunk = currentBuffer.chunks.length > 1 ? buffer_1.Buffer.concat(currentBuffer.chunks) : currentBuffer.chunks[0]; + yield { + partNumber, + data: dataChunk.slice(0, partSize), + }; + currentBuffer.chunks = [dataChunk.slice(partSize)]; + currentBuffer.length = currentBuffer.chunks[0].length; + partNumber += 1; } - return to.concat(ar || Array.prototype.slice.call(from)); + } + yield { + partNumber, + data: buffer_1.Buffer.concat(currentBuffer.chunks), + lastPart: true, }; +} +exports.getChunkStream = getChunkStream; - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; +/***/ }), - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; +/***/ 19833: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getDataReadable = void 0; +const buffer_1 = __nccwpck_require__(14300); +async function* getDataReadable(data) { + for await (const chunk of data) { + yield buffer_1.Buffer.from(chunk); + } +} +exports.getDataReadable = getDataReadable; /***/ }), -<<<<<<< HEAD -/***/ 62119: -======= -/***/ 95022: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. +/***/ 16272: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getDataReadableStream = void 0; +const buffer_1 = __nccwpck_require__(14300); +async function* getDataReadableStream(data) { + const reader = data.getReader(); + try { + while (true) { + const { done, value } = await reader.read(); + if (done) + return; + yield buffer_1.Buffer.from(value); + } } - else { - factory(createExporter(root)); + catch (e) { + throw e; } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + finally { + reader.releaseLock(); } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; +} +exports.getDataReadableStream = getDataReadableStream; - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; +/***/ }), - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +/***/ 38957: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - __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 tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(20679), exports); +tslib_1.__exportStar(__nccwpck_require__(70332), exports); - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +/***/ }), - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +/***/ 99738: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ClientDefaultValues = void 0; +const fs_1 = __nccwpck_require__(57147); +const runtimeConfig_shared_1 = __nccwpck_require__(55047); +exports.ClientDefaultValues = { + ...runtimeConfig_shared_1.ClientSharedValues, + runtime: "node", + lstatSync: fs_1.lstatSync, +}; - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +/***/ }), - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; +/***/ 55047: +/***/ ((__unused_webpack_module, exports) => { - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ClientSharedValues = void 0; +exports.ClientSharedValues = { + lstatSync: () => { }, +}; - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; +/***/ }), - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +/***/ 70332: +/***/ ((__unused_webpack_module, exports) => { - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; +/***/ }), - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +/***/ 39592: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NODE_DISABLE_MULTIREGION_ACCESS_POINT_CONFIG_OPTIONS = exports.NODE_DISABLE_MULTIREGION_ACCESS_POINT_INI_NAME = exports.NODE_DISABLE_MULTIREGION_ACCESS_POINT_ENV_NAME = void 0; +const util_config_provider_1 = __nccwpck_require__(54822); +exports.NODE_DISABLE_MULTIREGION_ACCESS_POINT_ENV_NAME = "AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS"; +exports.NODE_DISABLE_MULTIREGION_ACCESS_POINT_INI_NAME = "s3_disable_multiregion_access_points"; +exports.NODE_DISABLE_MULTIREGION_ACCESS_POINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => (0, util_config_provider_1.booleanSelector)(env, exports.NODE_DISABLE_MULTIREGION_ACCESS_POINT_ENV_NAME, util_config_provider_1.SelectorType.ENV), + configFileSelector: (profile) => (0, util_config_provider_1.booleanSelector)(profile, exports.NODE_DISABLE_MULTIREGION_ACCESS_POINT_INI_NAME, util_config_provider_1.SelectorType.CONFIG), + default: false, +}; /***/ }), -/***/ 92829: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 53253: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromIni = void 0; -<<<<<<< HEAD -const shared_ini_file_loader_1 = __nccwpck_require__(67097); -const resolveProfileData_1 = __nccwpck_require__(95090); -======= -const shared_ini_file_loader_1 = __nccwpck_require__(93378); -const resolveProfileData_1 = __nccwpck_require__(12817); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const fromIni = (init = {}) => async () => { - const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init); - return (0, resolveProfileData_1.resolveProfileData)((0, shared_ini_file_loader_1.getProfileName)(init), profiles, init); +exports.NODE_USE_ARN_REGION_CONFIG_OPTIONS = exports.NODE_USE_ARN_REGION_INI_NAME = exports.NODE_USE_ARN_REGION_ENV_NAME = void 0; +const util_config_provider_1 = __nccwpck_require__(54822); +exports.NODE_USE_ARN_REGION_ENV_NAME = "AWS_S3_USE_ARN_REGION"; +exports.NODE_USE_ARN_REGION_INI_NAME = "s3_use_arn_region"; +exports.NODE_USE_ARN_REGION_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => (0, util_config_provider_1.booleanSelector)(env, exports.NODE_USE_ARN_REGION_ENV_NAME, util_config_provider_1.SelectorType.ENV), + configFileSelector: (profile) => (0, util_config_provider_1.booleanSelector)(profile, exports.NODE_USE_ARN_REGION_INI_NAME, util_config_provider_1.SelectorType.CONFIG), + default: false, }; -exports.fromIni = fromIni; /***/ }), -<<<<<<< HEAD -/***/ 97228: -======= -/***/ 20357: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 38445: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(4108); -tslib_1.__exportStar(__nccwpck_require__(62119), exports); -======= -const tslib_1 = __nccwpck_require__(96181); -tslib_1.__exportStar(__nccwpck_require__(92829), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +exports.getBucketEndpointPlugin = exports.bucketEndpointMiddlewareOptions = exports.bucketEndpointMiddleware = void 0; +const util_arn_parser_1 = __nccwpck_require__(46107); +const protocol_http_1 = __nccwpck_require__(76232); +const bucketHostname_1 = __nccwpck_require__(94633); +const bucketEndpointMiddleware = (options) => (next, context) => async (args) => { + const { Bucket: bucketName } = args.input; + let replaceBucketInPath = options.bucketEndpoint; + const request = args.request; + if (protocol_http_1.HttpRequest.isInstance(request)) { + if (options.bucketEndpoint) { + request.hostname = bucketName; + } + else if ((0, util_arn_parser_1.validate)(bucketName)) { + const bucketArn = (0, util_arn_parser_1.parse)(bucketName); + const clientRegion = await options.region(); + const useDualstackEndpoint = await options.useDualstackEndpoint(); + const useFipsEndpoint = await options.useFipsEndpoint(); + const { partition, signingRegion = clientRegion } = (await options.regionInfoProvider(clientRegion, { useDualstackEndpoint, useFipsEndpoint })) || {}; + const useArnRegion = await options.useArnRegion(); + const { hostname, bucketEndpoint, signingRegion: modifiedSigningRegion, signingService, } = (0, bucketHostname_1.bucketHostname)({ + bucketName: bucketArn, + baseHostname: request.hostname, + accelerateEndpoint: options.useAccelerateEndpoint, + dualstackEndpoint: useDualstackEndpoint, + fipsEndpoint: useFipsEndpoint, + pathStyleEndpoint: options.forcePathStyle, + tlsCompatible: request.protocol === "https:", + useArnRegion, + clientPartition: partition, + clientSigningRegion: signingRegion, + clientRegion: clientRegion, + isCustomEndpoint: options.isCustomEndpoint, + disableMultiregionAccessPoints: await options.disableMultiregionAccessPoints(), + }); + if (modifiedSigningRegion && modifiedSigningRegion !== signingRegion) { + context["signing_region"] = modifiedSigningRegion; + } + if (signingService && signingService !== "s3") { + context["signing_service"] = signingService; + } + request.hostname = hostname; + replaceBucketInPath = bucketEndpoint; + } + else { + const clientRegion = await options.region(); + const dualstackEndpoint = await options.useDualstackEndpoint(); + const fipsEndpoint = await options.useFipsEndpoint(); + const { hostname, bucketEndpoint } = (0, bucketHostname_1.bucketHostname)({ + bucketName, + clientRegion, + baseHostname: request.hostname, + accelerateEndpoint: options.useAccelerateEndpoint, + dualstackEndpoint, + fipsEndpoint, + pathStyleEndpoint: options.forcePathStyle, + tlsCompatible: request.protocol === "https:", + isCustomEndpoint: options.isCustomEndpoint, + }); + request.hostname = hostname; + replaceBucketInPath = bucketEndpoint; + } + if (replaceBucketInPath) { + request.path = request.path.replace(/^(\/)?[^\/]+/, ""); + if (request.path === "") { + request.path = "/"; + } + } + } + return next({ ...args, request }); +}; +exports.bucketEndpointMiddleware = bucketEndpointMiddleware; +exports.bucketEndpointMiddlewareOptions = { + tags: ["BUCKET_ENDPOINT"], + name: "bucketEndpointMiddleware", + relation: "before", + toMiddleware: "hostHeaderMiddleware", + override: true, +}; +const getBucketEndpointPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo((0, exports.bucketEndpointMiddleware)(options), exports.bucketEndpointMiddlewareOptions); + }, +}); +exports.getBucketEndpointPlugin = getBucketEndpointPlugin; /***/ }), -<<<<<<< HEAD -/***/ 4738: -======= -/***/ 18288: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 94633: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveAssumeRoleCredentials = exports.isAssumeRoleProfile = void 0; -<<<<<<< HEAD -const property_provider_1 = __nccwpck_require__(12955); -const shared_ini_file_loader_1 = __nccwpck_require__(67097); -const resolveCredentialSource_1 = __nccwpck_require__(66011); -const resolveProfileData_1 = __nccwpck_require__(95090); -======= -const property_provider_1 = __nccwpck_require__(68655); -const shared_ini_file_loader_1 = __nccwpck_require__(93378); -const resolveCredentialSource_1 = __nccwpck_require__(3774); -const resolveProfileData_1 = __nccwpck_require__(12817); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const isAssumeRoleProfile = (arg) => Boolean(arg) && - typeof arg === "object" && - typeof arg.role_arn === "string" && - ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 && - ["undefined", "string"].indexOf(typeof arg.external_id) > -1 && - ["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 && - (isAssumeRoleWithSourceProfile(arg) || isAssumeRoleWithProviderProfile(arg)); -exports.isAssumeRoleProfile = isAssumeRoleProfile; -const isAssumeRoleWithSourceProfile = (arg) => typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined"; -const isAssumeRoleWithProviderProfile = (arg) => typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined"; -const resolveAssumeRoleCredentials = async (profileName, profiles, options, visitedProfiles = {}) => { - const data = profiles[profileName]; - if (!options.roleAssumer) { - throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} requires a role to be assumed, but no role assumption callback was provided.`, false); +exports.bucketHostname = void 0; +const bucketHostnameUtils_1 = __nccwpck_require__(1602); +const bucketHostname = (options) => { + (0, bucketHostnameUtils_1.validateCustomEndpoint)(options); + return (0, bucketHostnameUtils_1.isBucketNameOptions)(options) + ? + getEndpointFromBucketName(options) + : + getEndpointFromArn(options); +}; +exports.bucketHostname = bucketHostname; +const getEndpointFromBucketName = ({ accelerateEndpoint = false, clientRegion: region, baseHostname, bucketName, dualstackEndpoint = false, fipsEndpoint = false, pathStyleEndpoint = false, tlsCompatible = true, isCustomEndpoint = false, }) => { + const [clientRegion, hostnameSuffix] = isCustomEndpoint ? [region, baseHostname] : (0, bucketHostnameUtils_1.getSuffix)(baseHostname); + if (pathStyleEndpoint || !(0, bucketHostnameUtils_1.isDnsCompatibleBucketName)(bucketName) || (tlsCompatible && bucketHostnameUtils_1.DOT_PATTERN.test(bucketName))) { + return { + bucketEndpoint: false, + hostname: dualstackEndpoint ? `s3.dualstack.${clientRegion}.${hostnameSuffix}` : baseHostname, + }; } - const { source_profile } = data; - if (source_profile && source_profile in visitedProfiles) { - throw new property_provider_1.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile` + - ` ${(0, shared_ini_file_loader_1.getProfileName)(options)}. Profiles visited: ` + - Object.keys(visitedProfiles).join(", "), false); + if (accelerateEndpoint) { + baseHostname = `s3-accelerate${dualstackEndpoint ? ".dualstack" : ""}.${hostnameSuffix}`; } - const sourceCredsProvider = source_profile - ? (0, resolveProfileData_1.resolveProfileData)(source_profile, profiles, options, { - ...visitedProfiles, - [source_profile]: true, - }) - : (0, resolveCredentialSource_1.resolveCredentialSource)(data.credential_source, profileName)(); - const params = { - RoleArn: data.role_arn, - RoleSessionName: data.role_session_name || `aws-sdk-js-${Date.now()}`, - ExternalId: data.external_id, - DurationSeconds: parseInt(data.duration_seconds || "3600", 10), + else if (dualstackEndpoint) { + baseHostname = `s3.dualstack.${clientRegion}.${hostnameSuffix}`; + } + return { + bucketEndpoint: true, + hostname: `${bucketName}.${baseHostname}`, }; - const { mfa_serial } = data; - if (mfa_serial) { - if (!options.mfaCodeProvider) { - throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, false); - } - params.SerialNumber = mfa_serial; - params.TokenCode = await options.mfaCodeProvider(mfa_serial); +}; +const getEndpointFromArn = (options) => { + const { isCustomEndpoint, baseHostname, clientRegion } = options; + const hostnameSuffix = isCustomEndpoint ? baseHostname : (0, bucketHostnameUtils_1.getSuffixForArnEndpoint)(baseHostname)[1]; + const { pathStyleEndpoint, accelerateEndpoint = false, fipsEndpoint = false, tlsCompatible = true, bucketName, clientPartition = "aws", } = options; + (0, bucketHostnameUtils_1.validateArnEndpointOptions)({ pathStyleEndpoint, accelerateEndpoint, tlsCompatible }); + const { service, partition, accountId, region, resource } = bucketName; + (0, bucketHostnameUtils_1.validateService)(service); + (0, bucketHostnameUtils_1.validatePartition)(partition, { clientPartition }); + (0, bucketHostnameUtils_1.validateAccountId)(accountId); + const { accesspointName, outpostId } = (0, bucketHostnameUtils_1.getArnResources)(resource); + if (service === "s3-object-lambda") { + return getEndpointFromObjectLambdaArn({ ...options, tlsCompatible, bucketName, accesspointName, hostnameSuffix }); } - const sourceCreds = await sourceCredsProvider; - return options.roleAssumer(sourceCreds, params); + if (region === "") { + return getEndpointFromMRAPArn({ ...options, clientRegion, mrapAlias: accesspointName, hostnameSuffix }); + } + if (outpostId) { + return getEndpointFromOutpostArn({ ...options, clientRegion, outpostId, accesspointName, hostnameSuffix }); + } + return getEndpointFromAccessPointArn({ ...options, clientRegion, accesspointName, hostnameSuffix }); +}; +const getEndpointFromObjectLambdaArn = ({ dualstackEndpoint = false, fipsEndpoint = false, tlsCompatible = true, useArnRegion, clientRegion, clientSigningRegion = clientRegion, accesspointName, bucketName, hostnameSuffix, }) => { + const { accountId, region, service } = bucketName; + (0, bucketHostnameUtils_1.validateRegionalClient)(clientRegion); + (0, bucketHostnameUtils_1.validateRegion)(region, { + useArnRegion, + clientRegion, + clientSigningRegion, + allowFipsRegion: true, + useFipsEndpoint: fipsEndpoint, + }); + (0, bucketHostnameUtils_1.validateNoDualstack)(dualstackEndpoint); + const DNSHostLabel = `${accesspointName}-${accountId}`; + (0, bucketHostnameUtils_1.validateDNSHostLabel)(DNSHostLabel, { tlsCompatible }); + const endpointRegion = useArnRegion ? region : clientRegion; + const signingRegion = useArnRegion ? region : clientSigningRegion; + return { + bucketEndpoint: true, + hostname: `${DNSHostLabel}.${service}${fipsEndpoint ? "-fips" : ""}.${endpointRegion}.${hostnameSuffix}`, + signingRegion, + signingService: service, + }; +}; +const getEndpointFromMRAPArn = ({ disableMultiregionAccessPoints, dualstackEndpoint = false, isCustomEndpoint, mrapAlias, hostnameSuffix, }) => { + if (disableMultiregionAccessPoints === true) { + throw new Error("SDK is attempting to use a MRAP ARN. Please enable to feature."); + } + (0, bucketHostnameUtils_1.validateMrapAlias)(mrapAlias); + (0, bucketHostnameUtils_1.validateNoDualstack)(dualstackEndpoint); + return { + bucketEndpoint: true, + hostname: `${mrapAlias}${isCustomEndpoint ? "" : `.accesspoint.s3-global`}.${hostnameSuffix}`, + signingRegion: "*", + }; +}; +const getEndpointFromOutpostArn = ({ useArnRegion, clientRegion, clientSigningRegion = clientRegion, bucketName, outpostId, dualstackEndpoint = false, fipsEndpoint = false, tlsCompatible = true, accesspointName, isCustomEndpoint, hostnameSuffix, }) => { + (0, bucketHostnameUtils_1.validateRegionalClient)(clientRegion); + (0, bucketHostnameUtils_1.validateRegion)(bucketName.region, { useArnRegion, clientRegion, clientSigningRegion, useFipsEndpoint: fipsEndpoint }); + const DNSHostLabel = `${accesspointName}-${bucketName.accountId}`; + (0, bucketHostnameUtils_1.validateDNSHostLabel)(DNSHostLabel, { tlsCompatible }); + const endpointRegion = useArnRegion ? bucketName.region : clientRegion; + const signingRegion = useArnRegion ? bucketName.region : clientSigningRegion; + (0, bucketHostnameUtils_1.validateOutpostService)(bucketName.service); + (0, bucketHostnameUtils_1.validateDNSHostLabel)(outpostId, { tlsCompatible }); + (0, bucketHostnameUtils_1.validateNoDualstack)(dualstackEndpoint); + (0, bucketHostnameUtils_1.validateNoFIPS)(fipsEndpoint); + const hostnamePrefix = `${DNSHostLabel}.${outpostId}`; + return { + bucketEndpoint: true, + hostname: `${hostnamePrefix}${isCustomEndpoint ? "" : `.s3-outposts.${endpointRegion}`}.${hostnameSuffix}`, + signingRegion, + signingService: "s3-outposts", + }; +}; +const getEndpointFromAccessPointArn = ({ useArnRegion, clientRegion, clientSigningRegion = clientRegion, bucketName, dualstackEndpoint = false, fipsEndpoint = false, tlsCompatible = true, accesspointName, isCustomEndpoint, hostnameSuffix, }) => { + (0, bucketHostnameUtils_1.validateRegionalClient)(clientRegion); + (0, bucketHostnameUtils_1.validateRegion)(bucketName.region, { + useArnRegion, + clientRegion, + clientSigningRegion, + allowFipsRegion: true, + useFipsEndpoint: fipsEndpoint, + }); + const hostnamePrefix = `${accesspointName}-${bucketName.accountId}`; + (0, bucketHostnameUtils_1.validateDNSHostLabel)(hostnamePrefix, { tlsCompatible }); + const endpointRegion = useArnRegion ? bucketName.region : clientRegion; + const signingRegion = useArnRegion ? bucketName.region : clientSigningRegion; + (0, bucketHostnameUtils_1.validateS3Service)(bucketName.service); + return { + bucketEndpoint: true, + hostname: `${hostnamePrefix}${isCustomEndpoint + ? "" + : `.s3-accesspoint${fipsEndpoint ? "-fips" : ""}${dualstackEndpoint ? ".dualstack" : ""}.${endpointRegion}`}.${hostnameSuffix}`, + signingRegion, + }; }; -exports.resolveAssumeRoleCredentials = resolveAssumeRoleCredentials; /***/ }), -<<<<<<< HEAD -/***/ 66011: -======= -/***/ 3774: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 1602: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveCredentialSource = void 0; -<<<<<<< HEAD -const credential_provider_env_1 = __nccwpck_require__(66048); -const credential_provider_imds_1 = __nccwpck_require__(34673); -const property_provider_1 = __nccwpck_require__(12955); -======= -const credential_provider_env_1 = __nccwpck_require__(40096); -const credential_provider_imds_1 = __nccwpck_require__(56369); -const property_provider_1 = __nccwpck_require__(68655); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const resolveCredentialSource = (credentialSource, profileName) => { - const sourceProvidersMap = { - EcsContainer: credential_provider_imds_1.fromContainerMetadata, - Ec2InstanceMetadata: credential_provider_imds_1.fromInstanceMetadata, - Environment: credential_provider_env_1.fromEnv, - }; - if (credentialSource in sourceProvidersMap) { - return sourceProvidersMap[credentialSource](); +exports.validateMrapAlias = exports.validateNoFIPS = exports.validateNoDualstack = exports.getArnResources = exports.validateCustomEndpoint = exports.validateDNSHostLabel = exports.validateAccountId = exports.validateRegionalClient = exports.validateRegion = exports.validatePartition = exports.validateOutpostService = exports.validateS3Service = exports.validateService = exports.validateArnEndpointOptions = exports.getSuffixForArnEndpoint = exports.getSuffix = exports.isDnsCompatibleBucketName = exports.isBucketNameOptions = exports.S3_HOSTNAME_PATTERN = exports.DOT_PATTERN = void 0; +const DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; +const IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; +const DOTS_PATTERN = /\.\./; +exports.DOT_PATTERN = /\./; +exports.S3_HOSTNAME_PATTERN = /^(.+\.)?s3(-fips)?(\.dualstack)?[.-]([a-z0-9-]+)\./; +const S3_US_EAST_1_ALTNAME_PATTERN = /^s3(-external-1)?\.amazonaws\.com$/; +const AWS_PARTITION_SUFFIX = "amazonaws.com"; +const isBucketNameOptions = (options) => typeof options.bucketName === "string"; +exports.isBucketNameOptions = isBucketNameOptions; +const isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName); +exports.isDnsCompatibleBucketName = isDnsCompatibleBucketName; +const getRegionalSuffix = (hostname) => { + const parts = hostname.match(exports.S3_HOSTNAME_PATTERN); + return [parts[4], hostname.replace(new RegExp(`^${parts[0]}`), "")]; +}; +const getSuffix = (hostname) => S3_US_EAST_1_ALTNAME_PATTERN.test(hostname) ? ["us-east-1", AWS_PARTITION_SUFFIX] : getRegionalSuffix(hostname); +exports.getSuffix = getSuffix; +const getSuffixForArnEndpoint = (hostname) => S3_US_EAST_1_ALTNAME_PATTERN.test(hostname) + ? [hostname.replace(`.${AWS_PARTITION_SUFFIX}`, ""), AWS_PARTITION_SUFFIX] + : getRegionalSuffix(hostname); +exports.getSuffixForArnEndpoint = getSuffixForArnEndpoint; +const validateArnEndpointOptions = (options) => { + if (options.pathStyleEndpoint) { + throw new Error("Path-style S3 endpoint is not supported when bucket is an ARN"); + } + if (options.accelerateEndpoint) { + throw new Error("Accelerate endpoint is not supported when bucket is an ARN"); + } + if (!options.tlsCompatible) { + throw new Error("HTTPS is required when bucket is an ARN"); + } +}; +exports.validateArnEndpointOptions = validateArnEndpointOptions; +const validateService = (service) => { + if (service !== "s3" && service !== "s3-outposts" && service !== "s3-object-lambda") { + throw new Error("Expect 's3' or 's3-outposts' or 's3-object-lambda' in ARN service component"); + } +}; +exports.validateService = validateService; +const validateS3Service = (service) => { + if (service !== "s3") { + throw new Error("Expect 's3' in Accesspoint ARN service component"); + } +}; +exports.validateS3Service = validateS3Service; +const validateOutpostService = (service) => { + if (service !== "s3-outposts") { + throw new Error("Expect 's3-posts' in Outpost ARN service component"); + } +}; +exports.validateOutpostService = validateOutpostService; +const validatePartition = (partition, options) => { + if (partition !== options.clientPartition) { + throw new Error(`Partition in ARN is incompatible, got "${partition}" but expected "${options.clientPartition}"`); + } +}; +exports.validatePartition = validatePartition; +const validateRegion = (region, options) => { + if (region === "") { + throw new Error("ARN region is empty"); + } + if (options.useFipsEndpoint) { + if (!options.allowFipsRegion) { + throw new Error("FIPS region is not supported"); + } + else if (!isEqualRegions(region, options.clientRegion)) { + throw new Error(`Client FIPS region ${options.clientRegion} doesn't match region ${region} in ARN`); + } + } + if (!options.useArnRegion && + !isEqualRegions(region, options.clientRegion || "") && + !isEqualRegions(region, options.clientSigningRegion || "")) { + throw new Error(`Region in ARN is incompatible, got ${region} but expected ${options.clientRegion}`); + } +}; +exports.validateRegion = validateRegion; +const validateRegionalClient = (region) => { + if (["s3-external-1", "aws-global"].includes(region)) { + throw new Error(`Client region ${region} is not regional`); + } +}; +exports.validateRegionalClient = validateRegionalClient; +const isEqualRegions = (regionA, regionB) => regionA === regionB; +const validateAccountId = (accountId) => { + if (!/[0-9]{12}/.exec(accountId)) { + throw new Error("Access point ARN accountID does not match regex '[0-9]{12}'"); + } +}; +exports.validateAccountId = validateAccountId; +const validateDNSHostLabel = (label, options = { tlsCompatible: true }) => { + if (label.length >= 64 || + !/^[a-z0-9][a-z0-9.-]*[a-z0-9]$/.test(label) || + /(\d+\.){3}\d+/.test(label) || + /[.-]{2}/.test(label) || + ((options === null || options === void 0 ? void 0 : options.tlsCompatible) && exports.DOT_PATTERN.test(label))) { + throw new Error(`Invalid DNS label ${label}`); + } +}; +exports.validateDNSHostLabel = validateDNSHostLabel; +const validateCustomEndpoint = (options) => { + if (options.isCustomEndpoint) { + if (options.dualstackEndpoint) + throw new Error("Dualstack endpoint is not supported with custom endpoint"); + if (options.accelerateEndpoint) + throw new Error("Accelerate endpoint is not supported with custom endpoint"); + } +}; +exports.validateCustomEndpoint = validateCustomEndpoint; +const getArnResources = (resource) => { + const delimiter = resource.includes(":") ? ":" : "/"; + const [resourceType, ...rest] = resource.split(delimiter); + if (resourceType === "accesspoint") { + if (rest.length !== 1 || rest[0] === "") { + throw new Error(`Access Point ARN should have one resource accesspoint${delimiter}{accesspointname}`); + } + return { accesspointName: rest[0] }; + } + else if (resourceType === "outpost") { + if (!rest[0] || rest[1] !== "accesspoint" || !rest[2] || rest.length !== 3) { + throw new Error(`Outpost ARN should have resource outpost${delimiter}{outpostId}${delimiter}accesspoint${delimiter}{accesspointName}`); + } + const [outpostId, _, accesspointName] = rest; + return { outpostId, accesspointName }; } else { - throw new property_provider_1.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, ` + - `expected EcsContainer or Ec2InstanceMetadata or Environment.`); + throw new Error(`ARN resource should begin with 'accesspoint${delimiter}' or 'outpost${delimiter}'`); } }; -exports.resolveCredentialSource = resolveCredentialSource; +exports.getArnResources = getArnResources; +const validateNoDualstack = (dualstackEndpoint) => { + if (dualstackEndpoint) + throw new Error("Dualstack endpoint is not supported with Outpost or Multi-region Access Point ARN."); +}; +exports.validateNoDualstack = validateNoDualstack; +const validateNoFIPS = (useFipsEndpoint) => { + if (useFipsEndpoint) + throw new Error(`FIPS region is not supported with Outpost.`); +}; +exports.validateNoFIPS = validateNoFIPS; +const validateMrapAlias = (name) => { + try { + name.split(".").forEach((label) => { + (0, exports.validateDNSHostLabel)(label); + }); + } + catch (e) { + throw new Error(`"${name}" is not a DNS compatible name.`); + } +}; +exports.validateMrapAlias = validateMrapAlias; /***/ }), -<<<<<<< HEAD -/***/ 4834: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 21731: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveProcessCredentials = exports.isProcessProfile = void 0; -const credential_provider_process_1 = __nccwpck_require__(61695); -const isProcessProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string"; -exports.isProcessProfile = isProcessProfile; -const resolveProcessCredentials = async (options, profile) => (0, credential_provider_process_1.fromProcess)({ - ...options, - profile, -})(); -exports.resolveProcessCredentials = resolveProcessCredentials; +exports.resolveBucketEndpointConfig = void 0; +function resolveBucketEndpointConfig(input) { + const { bucketEndpoint = false, forcePathStyle = false, useAccelerateEndpoint = false, useArnRegion = false, disableMultiregionAccessPoints = false, } = input; + return { + ...input, + bucketEndpoint, + forcePathStyle, + useAccelerateEndpoint, + useArnRegion: typeof useArnRegion === "function" ? useArnRegion : () => Promise.resolve(useArnRegion), + disableMultiregionAccessPoints: typeof disableMultiregionAccessPoints === "function" + ? disableMultiregionAccessPoints + : () => Promise.resolve(disableMultiregionAccessPoints), + }; +} +exports.resolveBucketEndpointConfig = resolveBucketEndpointConfig; /***/ }), -/***/ 95090: -======= -/***/ 12817: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 29915: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveProfileData = void 0; -<<<<<<< HEAD -const property_provider_1 = __nccwpck_require__(12955); -const resolveAssumeRoleCredentials_1 = __nccwpck_require__(4738); -const resolveProcessCredentials_1 = __nccwpck_require__(4834); -const resolveSsoCredentials_1 = __nccwpck_require__(3955); -const resolveStaticCredentials_1 = __nccwpck_require__(38232); -const resolveWebIdentityCredentials_1 = __nccwpck_require__(99864); -======= -const property_provider_1 = __nccwpck_require__(68655); -const resolveAssumeRoleCredentials_1 = __nccwpck_require__(18288); -const resolveSsoCredentials_1 = __nccwpck_require__(41772); -const resolveStaticCredentials_1 = __nccwpck_require__(63393); -const resolveWebIdentityCredentials_1 = __nccwpck_require__(91652); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const resolveProfileData = async (profileName, profiles, options, visitedProfiles = {}) => { - const data = profiles[profileName]; - if (Object.keys(visitedProfiles).length > 0 && (0, resolveStaticCredentials_1.isStaticCredsProfile)(data)) { - return (0, resolveStaticCredentials_1.resolveStaticCredentials)(data); - } - if ((0, resolveAssumeRoleCredentials_1.isAssumeRoleProfile)(data)) { - return (0, resolveAssumeRoleCredentials_1.resolveAssumeRoleCredentials)(profileName, profiles, options, visitedProfiles); - } - if ((0, resolveStaticCredentials_1.isStaticCredsProfile)(data)) { - return (0, resolveStaticCredentials_1.resolveStaticCredentials)(data); - } - if ((0, resolveWebIdentityCredentials_1.isWebIdentityProfile)(data)) { - return (0, resolveWebIdentityCredentials_1.resolveWebIdentityCredentials)(data, options); - } - if ((0, resolveProcessCredentials_1.isProcessProfile)(data)) { - return (0, resolveProcessCredentials_1.resolveProcessCredentials)(options, profileName); - } - if ((0, resolveSsoCredentials_1.isSsoProfile)(data)) { - return (0, resolveSsoCredentials_1.resolveSsoCredentials)(data); - } - throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} could not be found or parsed in shared credentials file.`); -}; -exports.resolveProfileData = resolveProfileData; +exports.validateNoFIPS = exports.validateNoDualstack = exports.validateDNSHostLabel = exports.validateRegion = exports.validateAccountId = exports.validatePartition = exports.validateOutpostService = exports.getSuffixForArnEndpoint = exports.getArnResources = void 0; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(39592), exports); +tslib_1.__exportStar(__nccwpck_require__(53253), exports); +tslib_1.__exportStar(__nccwpck_require__(38445), exports); +tslib_1.__exportStar(__nccwpck_require__(94633), exports); +tslib_1.__exportStar(__nccwpck_require__(21731), exports); +var bucketHostnameUtils_1 = __nccwpck_require__(1602); +Object.defineProperty(exports, "getArnResources", ({ enumerable: true, get: function () { return bucketHostnameUtils_1.getArnResources; } })); +Object.defineProperty(exports, "getSuffixForArnEndpoint", ({ enumerable: true, get: function () { return bucketHostnameUtils_1.getSuffixForArnEndpoint; } })); +Object.defineProperty(exports, "validateOutpostService", ({ enumerable: true, get: function () { return bucketHostnameUtils_1.validateOutpostService; } })); +Object.defineProperty(exports, "validatePartition", ({ enumerable: true, get: function () { return bucketHostnameUtils_1.validatePartition; } })); +Object.defineProperty(exports, "validateAccountId", ({ enumerable: true, get: function () { return bucketHostnameUtils_1.validateAccountId; } })); +Object.defineProperty(exports, "validateRegion", ({ enumerable: true, get: function () { return bucketHostnameUtils_1.validateRegion; } })); +Object.defineProperty(exports, "validateDNSHostLabel", ({ enumerable: true, get: function () { return bucketHostnameUtils_1.validateDNSHostLabel; } })); +Object.defineProperty(exports, "validateNoDualstack", ({ enumerable: true, get: function () { return bucketHostnameUtils_1.validateNoDualstack; } })); +Object.defineProperty(exports, "validateNoFIPS", ({ enumerable: true, get: function () { return bucketHostnameUtils_1.validateNoFIPS; } })); /***/ }), -<<<<<<< HEAD -/***/ 3955: -======= -/***/ 41772: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 38433: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveSsoCredentials = exports.isSsoProfile = void 0; -<<<<<<< HEAD -const credential_provider_sso_1 = __nccwpck_require__(82419); -var credential_provider_sso_2 = __nccwpck_require__(82419); -======= -const credential_provider_sso_1 = __nccwpck_require__(23666); -var credential_provider_sso_2 = __nccwpck_require__(23666); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -Object.defineProperty(exports, "isSsoProfile", ({ enumerable: true, get: function () { return credential_provider_sso_2.isSsoProfile; } })); -const resolveSsoCredentials = (data) => { - const { sso_start_url, sso_account_id, sso_session, sso_region, sso_role_name } = (0, credential_provider_sso_1.validateSsoProfile)(data); - return (0, credential_provider_sso_1.fromSSO)({ - ssoStartUrl: sso_start_url, - ssoAccountId: sso_account_id, - ssoSession: sso_session, - ssoRegion: sso_region, - ssoRoleName: sso_role_name, - })(); +exports.getAddExpectContinuePlugin = exports.addExpectContinueMiddlewareOptions = exports.addExpectContinueMiddleware = void 0; +const protocol_http_1 = __nccwpck_require__(76232); +function addExpectContinueMiddleware(options) { + return (next) => async (args) => { + const { request } = args; + if (protocol_http_1.HttpRequest.isInstance(request) && request.body && options.runtime === "node") { + request.headers = { + ...request.headers, + Expect: "100-continue", + }; + } + return next({ + ...args, + request, + }); + }; +} +exports.addExpectContinueMiddleware = addExpectContinueMiddleware; +exports.addExpectContinueMiddlewareOptions = { + step: "build", + tags: ["SET_EXPECT_HEADER", "EXPECT_HEADER"], + name: "addExpectContinueMiddleware", + override: true, }; -exports.resolveSsoCredentials = resolveSsoCredentials; +const getAddExpectContinuePlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(addExpectContinueMiddleware(options), exports.addExpectContinueMiddlewareOptions); + }, +}); +exports.getAddExpectContinuePlugin = getAddExpectContinuePlugin; /***/ }), -<<<<<<< HEAD -/***/ 38232: -======= -/***/ 63393: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 16707: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveStaticCredentials = exports.isStaticCredsProfile = void 0; -const isStaticCredsProfile = (arg) => Boolean(arg) && - typeof arg === "object" && - typeof arg.aws_access_key_id === "string" && - typeof arg.aws_secret_access_key === "string" && - ["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1; -exports.isStaticCredsProfile = isStaticCredsProfile; -const resolveStaticCredentials = (profile) => Promise.resolve({ - accessKeyId: profile.aws_access_key_id, - secretAccessKey: profile.aws_secret_access_key, - sessionToken: profile.aws_session_token, -}); -exports.resolveStaticCredentials = resolveStaticCredentials; - +exports.S3_EXPRESS_DEFAULT_CHECKSUM_ALGORITHM = exports.DEFAULT_CHECKSUM_ALGORITHM = exports.ChecksumLocation = exports.ChecksumAlgorithm = void 0; +var ChecksumAlgorithm; +(function (ChecksumAlgorithm) { + ChecksumAlgorithm["MD5"] = "MD5"; + ChecksumAlgorithm["CRC32"] = "CRC32"; + ChecksumAlgorithm["CRC32C"] = "CRC32C"; + ChecksumAlgorithm["SHA1"] = "SHA1"; + ChecksumAlgorithm["SHA256"] = "SHA256"; +})(ChecksumAlgorithm = exports.ChecksumAlgorithm || (exports.ChecksumAlgorithm = {})); +var ChecksumLocation; +(function (ChecksumLocation) { + ChecksumLocation["HEADER"] = "header"; + ChecksumLocation["TRAILER"] = "trailer"; +})(ChecksumLocation = exports.ChecksumLocation || (exports.ChecksumLocation = {})); +exports.DEFAULT_CHECKSUM_ALGORITHM = ChecksumAlgorithm.MD5; +exports.S3_EXPRESS_DEFAULT_CHECKSUM_ALGORITHM = ChecksumAlgorithm.CRC32; + /***/ }), -<<<<<<< HEAD -/***/ 99864: -======= -/***/ 91652: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 30789: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveWebIdentityCredentials = exports.isWebIdentityProfile = void 0; -<<<<<<< HEAD -const credential_provider_web_identity_1 = __nccwpck_require__(92087); -======= -const credential_provider_web_identity_1 = __nccwpck_require__(62017); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const isWebIdentityProfile = (arg) => Boolean(arg) && - typeof arg === "object" && - typeof arg.web_identity_token_file === "string" && - typeof arg.role_arn === "string" && - ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1; -exports.isWebIdentityProfile = isWebIdentityProfile; -const resolveWebIdentityCredentials = async (profile, options) => (0, credential_provider_web_identity_1.fromTokenFile)({ - webIdentityTokenFile: profile.web_identity_token_file, - roleArn: profile.role_arn, - roleSessionName: profile.role_session_name, - roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity, -})(); -exports.resolveWebIdentityCredentials = resolveWebIdentityCredentials; +exports.flexibleChecksumsMiddleware = exports.flexibleChecksumsMiddlewareOptions = void 0; +const protocol_http_1 = __nccwpck_require__(76232); +const getChecksumAlgorithmForRequest_1 = __nccwpck_require__(30125); +const getChecksumLocationName_1 = __nccwpck_require__(20138); +const hasHeader_1 = __nccwpck_require__(18287); +const isStreaming_1 = __nccwpck_require__(52574); +const selectChecksumAlgorithmFunction_1 = __nccwpck_require__(6054); +const stringHasher_1 = __nccwpck_require__(6683); +exports.flexibleChecksumsMiddlewareOptions = { + name: "flexibleChecksumsMiddleware", + step: "build", + tags: ["BODY_CHECKSUM"], + override: true, +}; +const flexibleChecksumsMiddleware = (config, middlewareConfig) => (next, context) => async (args) => { + if (!protocol_http_1.HttpRequest.isInstance(args.request)) { + return next(args); + } + const { request } = args; + const { body: requestBody, headers } = request; + const { base64Encoder, streamHasher } = config; + const { input, requestChecksumRequired, requestAlgorithmMember } = middlewareConfig; + const checksumAlgorithm = (0, getChecksumAlgorithmForRequest_1.getChecksumAlgorithmForRequest)(input, { + requestChecksumRequired, + requestAlgorithmMember, + }, !!context.isS3ExpressBucket); + let updatedBody = requestBody; + let updatedHeaders = headers; + if (checksumAlgorithm) { + const checksumLocationName = (0, getChecksumLocationName_1.getChecksumLocationName)(checksumAlgorithm); + const checksumAlgorithmFn = (0, selectChecksumAlgorithmFunction_1.selectChecksumAlgorithmFunction)(checksumAlgorithm, config); + if ((0, isStreaming_1.isStreaming)(requestBody)) { + const { getAwsChunkedEncodingStream, bodyLengthChecker } = config; + updatedBody = getAwsChunkedEncodingStream(requestBody, { + base64Encoder, + bodyLengthChecker, + checksumLocationName, + checksumAlgorithmFn, + streamHasher, + }); + updatedHeaders = { + ...headers, + "content-encoding": headers["content-encoding"] + ? `${headers["content-encoding"]},aws-chunked` + : "aws-chunked", + "transfer-encoding": "chunked", + "x-amz-decoded-content-length": headers["content-length"], + "x-amz-content-sha256": "STREAMING-UNSIGNED-PAYLOAD-TRAILER", + "x-amz-trailer": checksumLocationName, + }; + delete updatedHeaders["content-length"]; + } + else if (!(0, hasHeader_1.hasHeader)(checksumLocationName, headers)) { + const rawChecksum = await (0, stringHasher_1.stringHasher)(checksumAlgorithmFn, requestBody); + updatedHeaders = { + ...headers, + [checksumLocationName]: base64Encoder(rawChecksum), + }; + } + } + const result = await next({ + ...args, + request: { + ...request, + headers: updatedHeaders, + body: updatedBody, + }, + }); + return result; +}; +exports.flexibleChecksumsMiddleware = flexibleChecksumsMiddleware; /***/ }), -<<<<<<< HEAD -/***/ 4108: -======= -/***/ 96181: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. +/***/ 58703: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.flexibleChecksumsResponseMiddleware = exports.flexibleChecksumsResponseMiddlewareOptions = void 0; +const protocol_http_1 = __nccwpck_require__(76232); +const getChecksumAlgorithmListForResponse_1 = __nccwpck_require__(99512); +const getChecksumLocationName_1 = __nccwpck_require__(20138); +const isChecksumWithPartNumber_1 = __nccwpck_require__(72858); +const isStreaming_1 = __nccwpck_require__(52574); +const create_read_stream_on_buffer_1 = __nccwpck_require__(88668); +const validateChecksumFromResponse_1 = __nccwpck_require__(45676); +exports.flexibleChecksumsResponseMiddlewareOptions = { + name: "flexibleChecksumsResponseMiddleware", + toMiddleware: "deserializerMiddleware", + relation: "after", + tags: ["BODY_CHECKSUM"], + override: true, +}; +const flexibleChecksumsResponseMiddleware = (config, middlewareConfig) => (next, context) => async (args) => { + if (!protocol_http_1.HttpRequest.isInstance(args.request)) { + return next(args); } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } + const input = args.input; + const result = await next(args); + const response = result.response; + let collectedStream = undefined; + const { requestValidationModeMember, responseAlgorithms } = middlewareConfig; + if (requestValidationModeMember && input[requestValidationModeMember] === "ENABLED") { + const { clientName, commandName } = context; + const isS3WholeObjectMultipartGetResponseChecksum = clientName === "S3Client" && + commandName === "GetObjectCommand" && + (0, getChecksumAlgorithmListForResponse_1.getChecksumAlgorithmListForResponse)(responseAlgorithms).every((algorithm) => { + const responseHeader = (0, getChecksumLocationName_1.getChecksumLocationName)(algorithm); + const checksumFromResponse = response.headers[responseHeader]; + return !checksumFromResponse || (0, isChecksumWithPartNumber_1.isChecksumWithPartNumber)(checksumFromResponse); + }); + if (isS3WholeObjectMultipartGetResponseChecksum) { + return result; + } + const isStreamingBody = (0, isStreaming_1.isStreaming)(response.body); + if (isStreamingBody) { + collectedStream = await config.streamCollector(response.body); + response.body = (0, create_read_stream_on_buffer_1.createReadStreamOnBuffer)(collectedStream); + } + await (0, validateChecksumFromResponse_1.validateChecksumFromResponse)(result.response, { + config, + responseAlgorithms, + }); + if (isStreamingBody && collectedStream) { + response.body = (0, create_read_stream_on_buffer_1.createReadStreamOnBuffer)(collectedStream); } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; + return result; +}; +exports.flexibleChecksumsResponseMiddleware = flexibleChecksumsResponseMiddleware; - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; +/***/ }), - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; +/***/ 26090: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getChecksum = void 0; +const isStreaming_1 = __nccwpck_require__(52574); +const stringHasher_1 = __nccwpck_require__(6683); +const getChecksum = async (body, { streamHasher, checksumAlgorithmFn, base64Encoder }) => { + const digest = (0, isStreaming_1.isStreaming)(body) ? streamHasher(checksumAlgorithmFn, body) : (0, stringHasher_1.stringHasher)(checksumAlgorithmFn, body); + return base64Encoder(await digest); +}; +exports.getChecksum = getChecksum; - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; +/***/ }), - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; +/***/ 30125: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - __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.getChecksumAlgorithmForRequest = void 0; +const constants_1 = __nccwpck_require__(16707); +const types_1 = __nccwpck_require__(85072); +const getChecksumAlgorithmForRequest = (input, { requestChecksumRequired, requestAlgorithmMember }, isS3Express) => { + const defaultAlgorithm = isS3Express ? constants_1.S3_EXPRESS_DEFAULT_CHECKSUM_ALGORITHM : constants_1.DEFAULT_CHECKSUM_ALGORITHM; + if (!requestAlgorithmMember || !input[requestAlgorithmMember]) { + return requestChecksumRequired ? defaultAlgorithm : undefined; + } + const checksumAlgorithm = input[requestAlgorithmMember]; + if (!types_1.CLIENT_SUPPORTED_ALGORITHMS.includes(checksumAlgorithm)) { + throw new Error(`The checksum algorithm "${checksumAlgorithm}" is not supported by the client.` + + ` Select one of ${types_1.CLIENT_SUPPORTED_ALGORITHMS}.`); + } + return checksumAlgorithm; +}; +exports.getChecksumAlgorithmForRequest = getChecksumAlgorithmForRequest; - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +/***/ }), - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +/***/ 99512: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getChecksumAlgorithmListForResponse = void 0; +const types_1 = __nccwpck_require__(85072); +const getChecksumAlgorithmListForResponse = (responseAlgorithms = []) => { + const validChecksumAlgorithms = []; + for (const algorithm of types_1.PRIORITY_ORDER_ALGORITHMS) { + if (!responseAlgorithms.includes(algorithm) || !types_1.CLIENT_SUPPORTED_ALGORITHMS.includes(algorithm)) { + continue; } - return ar; - }; + validChecksumAlgorithms.push(algorithm); + } + return validChecksumAlgorithms; +}; +exports.getChecksumAlgorithmListForResponse = getChecksumAlgorithmListForResponse; - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +/***/ }), - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; +/***/ 20138: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getChecksumLocationName = void 0; +const constants_1 = __nccwpck_require__(16707); +const getChecksumLocationName = (algorithm) => algorithm === constants_1.ChecksumAlgorithm.MD5 ? "content-md5" : `x-amz-checksum-${algorithm.toLowerCase()}`; +exports.getChecksumLocationName = getChecksumLocationName; - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; +/***/ }), - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +/***/ 13714: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getFlexibleChecksumsPlugin = void 0; +const flexibleChecksumsMiddleware_1 = __nccwpck_require__(30789); +const flexibleChecksumsResponseMiddleware_1 = __nccwpck_require__(58703); +const getFlexibleChecksumsPlugin = (config, middlewareConfig) => ({ + applyToStack: (clientStack) => { + clientStack.add((0, flexibleChecksumsMiddleware_1.flexibleChecksumsMiddleware)(config, middlewareConfig), flexibleChecksumsMiddleware_1.flexibleChecksumsMiddlewareOptions); + clientStack.addRelativeTo((0, flexibleChecksumsResponseMiddleware_1.flexibleChecksumsResponseMiddleware)(config, middlewareConfig), flexibleChecksumsResponseMiddleware_1.flexibleChecksumsResponseMiddlewareOptions); + }, +}); +exports.getFlexibleChecksumsPlugin = getFlexibleChecksumsPlugin; - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; +/***/ }), - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +/***/ 18287: +/***/ ((__unused_webpack_module, exports) => { - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.hasHeader = void 0; +const hasHeader = (header, headers) => { + const soughtHeader = header.toLowerCase(); + for (const headerName of Object.keys(headers)) { + if (soughtHeader === headerName.toLowerCase()) { + return true; } - return value; - }; + } + return false; +}; +exports.hasHeader = hasHeader; - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } +/***/ }), + +/***/ 89119: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(16707), exports); +tslib_1.__exportStar(__nccwpck_require__(30789), exports); +tslib_1.__exportStar(__nccwpck_require__(13714), exports); + + +/***/ }), + +/***/ 72858: +/***/ ((__unused_webpack_module, exports) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isChecksumWithPartNumber = void 0; +const isChecksumWithPartNumber = (checksum) => { + const lastHyphenIndex = checksum.lastIndexOf("-"); + if (lastHyphenIndex !== -1) { + const numberPart = checksum.slice(lastHyphenIndex + 1); + if (!numberPart.startsWith("0")) { + const number = parseInt(numberPart, 10); + if (!isNaN(number) && number >= 1 && number <= 10000) { + return true; } - if (env.hasError) throw env.error; } - return next(); - }; + } + return false; +}; +exports.isChecksumWithPartNumber = isChecksumWithPartNumber; - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); + +/***/ }), + +/***/ 52574: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isStreaming = void 0; +const is_array_buffer_1 = __nccwpck_require__(52807); +const isStreaming = (body) => body !== undefined && typeof body !== "string" && !ArrayBuffer.isView(body) && !(0, is_array_buffer_1.isArrayBuffer)(body); +exports.isStreaming = isStreaming; /***/ }), -<<<<<<< HEAD -/***/ 13378: -======= -/***/ 51909: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 6054: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultProvider = void 0; -<<<<<<< HEAD -const credential_provider_env_1 = __nccwpck_require__(66048); -const credential_provider_ini_1 = __nccwpck_require__(97228); -const credential_provider_process_1 = __nccwpck_require__(61695); -const credential_provider_sso_1 = __nccwpck_require__(82419); -const credential_provider_web_identity_1 = __nccwpck_require__(92087); -const property_provider_1 = __nccwpck_require__(12955); -const shared_ini_file_loader_1 = __nccwpck_require__(67097); -const remoteProvider_1 = __nccwpck_require__(30575); -======= -const credential_provider_env_1 = __nccwpck_require__(40096); -const credential_provider_ini_1 = __nccwpck_require__(20357); -const credential_provider_process_1 = __nccwpck_require__(5758); -const credential_provider_sso_1 = __nccwpck_require__(23666); -const credential_provider_web_identity_1 = __nccwpck_require__(62017); -const property_provider_1 = __nccwpck_require__(68655); -const shared_ini_file_loader_1 = __nccwpck_require__(93378); -const remoteProvider_1 = __nccwpck_require__(75786); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const defaultProvider = (init = {}) => (0, property_provider_1.memoize)((0, property_provider_1.chain)(...(init.profile || process.env[shared_ini_file_loader_1.ENV_PROFILE] ? [] : [(0, credential_provider_env_1.fromEnv)()]), (0, credential_provider_sso_1.fromSSO)(init), (0, credential_provider_ini_1.fromIni)(init), (0, credential_provider_process_1.fromProcess)(init), (0, credential_provider_web_identity_1.fromTokenFile)(init), (0, remoteProvider_1.remoteProvider)(init), async () => { - throw new property_provider_1.CredentialsProviderError("Could not load credentials from any providers", false); -}), (credentials) => credentials.expiration !== undefined && credentials.expiration.getTime() - Date.now() < 300000, (credentials) => credentials.expiration !== undefined); -exports.defaultProvider = defaultProvider; +exports.selectChecksumAlgorithmFunction = void 0; +const crc32_1 = __nccwpck_require__(95736); +const crc32c_1 = __nccwpck_require__(90042); +const constants_1 = __nccwpck_require__(16707); +const selectChecksumAlgorithmFunction = (checksumAlgorithm, config) => ({ + [constants_1.ChecksumAlgorithm.MD5]: config.md5, + [constants_1.ChecksumAlgorithm.CRC32]: crc32_1.AwsCrc32, + [constants_1.ChecksumAlgorithm.CRC32C]: crc32c_1.AwsCrc32c, + [constants_1.ChecksumAlgorithm.SHA1]: config.sha1, + [constants_1.ChecksumAlgorithm.SHA256]: config.sha256, +}[checksumAlgorithm]); +exports.selectChecksumAlgorithmFunction = selectChecksumAlgorithmFunction; /***/ }), -<<<<<<< HEAD -/***/ 6497: -======= -/***/ 96911: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 88668: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(79035); -tslib_1.__exportStar(__nccwpck_require__(13378), exports); -======= -const tslib_1 = __nccwpck_require__(17787); -tslib_1.__exportStar(__nccwpck_require__(51909), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +exports.createReadStreamOnBuffer = void 0; +const stream_1 = __nccwpck_require__(12781); +function createReadStreamOnBuffer(buffer) { + const stream = new stream_1.Transform(); + stream.push(buffer); + stream.push(null); + return stream; +} +exports.createReadStreamOnBuffer = createReadStreamOnBuffer; /***/ }), -<<<<<<< HEAD -/***/ 30575: -======= -/***/ 75786: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 6683: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.remoteProvider = exports.ENV_IMDS_DISABLED = void 0; -<<<<<<< HEAD -const credential_provider_imds_1 = __nccwpck_require__(34673); -const property_provider_1 = __nccwpck_require__(12955); -======= -const credential_provider_imds_1 = __nccwpck_require__(56369); -const property_provider_1 = __nccwpck_require__(68655); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -exports.ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; -const remoteProvider = (init) => { - if (process.env[credential_provider_imds_1.ENV_CMDS_RELATIVE_URI] || process.env[credential_provider_imds_1.ENV_CMDS_FULL_URI]) { - return (0, credential_provider_imds_1.fromContainerMetadata)(init); - } - if (process.env[exports.ENV_IMDS_DISABLED]) { - return async () => { - throw new property_provider_1.CredentialsProviderError("EC2 Instance Metadata Service access disabled"); - }; - } - return (0, credential_provider_imds_1.fromInstanceMetadata)(init); +exports.stringHasher = void 0; +const util_utf8_1 = __nccwpck_require__(97788); +const stringHasher = (checksumAlgorithmFn, body) => { + const hash = new checksumAlgorithmFn(); + hash.update((0, util_utf8_1.toUint8Array)(body || "")); + return hash.digest(); }; -exports.remoteProvider = remoteProvider; +exports.stringHasher = stringHasher; /***/ }), -<<<<<<< HEAD -/***/ 79035: -======= -/***/ 17787: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { +/***/ 85072: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/****************************************************************************** -Copyright (c) Microsoft Corporation. -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PRIORITY_ORDER_ALGORITHMS = exports.CLIENT_SUPPORTED_ALGORITHMS = void 0; +const constants_1 = __nccwpck_require__(16707); +exports.CLIENT_SUPPORTED_ALGORITHMS = [ + constants_1.ChecksumAlgorithm.CRC32, + constants_1.ChecksumAlgorithm.CRC32C, + constants_1.ChecksumAlgorithm.SHA1, + constants_1.ChecksumAlgorithm.SHA256, +]; +exports.PRIORITY_ORDER_ALGORITHMS = [ + constants_1.ChecksumAlgorithm.CRC32, + constants_1.ChecksumAlgorithm.CRC32C, + constants_1.ChecksumAlgorithm.SHA1, + constants_1.ChecksumAlgorithm.SHA256, +]; -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; + +/***/ }), + +/***/ 45676: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.validateChecksumFromResponse = void 0; +const getChecksum_1 = __nccwpck_require__(26090); +const getChecksumAlgorithmListForResponse_1 = __nccwpck_require__(99512); +const getChecksumLocationName_1 = __nccwpck_require__(20138); +const selectChecksumAlgorithmFunction_1 = __nccwpck_require__(6054); +const validateChecksumFromResponse = async (response, { config, responseAlgorithms }) => { + const checksumAlgorithms = (0, getChecksumAlgorithmListForResponse_1.getChecksumAlgorithmListForResponse)(responseAlgorithms); + const { body: responseBody, headers: responseHeaders } = response; + for (const algorithm of checksumAlgorithms) { + const responseHeader = (0, getChecksumLocationName_1.getChecksumLocationName)(algorithm); + const checksumFromResponse = responseHeaders[responseHeader]; + if (checksumFromResponse) { + const checksumAlgorithmFn = (0, selectChecksumAlgorithmFunction_1.selectChecksumAlgorithmFunction)(algorithm, config); + const { streamHasher, base64Encoder } = config; + const checksum = await (0, getChecksum_1.getChecksum)(responseBody, { streamHasher, checksumAlgorithmFn, base64Encoder }); + if (checksum === checksumFromResponse) { + break; } + throw new Error(`Checksum mismatch: expected "${checksum}" but received "${checksumFromResponse}"` + + ` in response header "${responseHeader}".`); } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; +}; +exports.validateChecksumFromResponse = validateChecksumFromResponse; - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; +/***/ }), - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; +/***/ 29368: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getHostHeaderPlugin = exports.hostHeaderMiddlewareOptions = exports.hostHeaderMiddleware = exports.resolveHostHeaderConfig = void 0; +const protocol_http_1 = __nccwpck_require__(76232); +function resolveHostHeaderConfig(input) { + return input; +} +exports.resolveHostHeaderConfig = resolveHostHeaderConfig; +const hostHeaderMiddleware = (options) => (next) => async (args) => { + if (!protocol_http_1.HttpRequest.isInstance(args.request)) + return next(args); + const { request } = args; + const { handlerProtocol = "" } = options.requestHandler.metadata || {}; + if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) { + delete request.headers["host"]; + request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : ""); + } + else if (!request.headers["host"]) { + let host = request.hostname; + if (request.port != null) + host += `:${request.port}`; + request.headers["host"] = host; + } + return next(args); +}; +exports.hostHeaderMiddleware = hostHeaderMiddleware; +exports.hostHeaderMiddlewareOptions = { + name: "hostHeaderMiddleware", + step: "build", + priority: "low", + tags: ["HOST"], + override: true, +}; +const getHostHeaderPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add((0, exports.hostHeaderMiddleware)(options), exports.hostHeaderMiddlewareOptions); + }, +}); +exports.getHostHeaderPlugin = getHostHeaderPlugin; - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; +/***/ }), - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; +/***/ 52499: +/***/ ((__unused_webpack_module, exports) => { - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getLocationConstraintPlugin = exports.locationConstraintMiddlewareOptions = exports.locationConstraintMiddleware = void 0; +function locationConstraintMiddleware(options) { + return (next) => async (args) => { + const { CreateBucketConfiguration } = args.input; + const region = await options.region(); + if (!(CreateBucketConfiguration === null || CreateBucketConfiguration === void 0 ? void 0 : CreateBucketConfiguration.LocationConstraint) && !(CreateBucketConfiguration === null || CreateBucketConfiguration === void 0 ? void 0 : CreateBucketConfiguration.Location)) { + args = { + ...args, + input: { + ...args.input, + CreateBucketConfiguration: region === "us-east-1" ? undefined : { LocationConstraint: region }, + }, + }; + } + return next(args); }; +} +exports.locationConstraintMiddleware = locationConstraintMiddleware; +exports.locationConstraintMiddlewareOptions = { + step: "initialize", + tags: ["LOCATION_CONSTRAINT", "CREATE_BUCKET_CONFIGURATION"], + name: "locationConstraintMiddleware", + override: true, +}; +const getLocationConstraintPlugin = (config) => ({ + applyToStack: (clientStack) => { + clientStack.add(locationConstraintMiddleware(config), exports.locationConstraintMiddlewareOptions); + }, +}); +exports.getLocationConstraintPlugin = getLocationConstraintPlugin; - __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()); - }); - }; - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; +/***/ }), - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +/***/ 11810: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(12105), exports); - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +/***/ }), - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +/***/ 12105: +/***/ ((__unused_webpack_module, exports) => { - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getLoggerPlugin = exports.loggerMiddlewareOptions = exports.loggerMiddleware = void 0; +const loggerMiddleware = () => (next, context) => async (args) => { + var _a, _b; + try { + const response = await next(args); + const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context; + const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions; + const inputFilterSensitiveLog = overrideInputFilterSensitiveLog !== null && overrideInputFilterSensitiveLog !== void 0 ? overrideInputFilterSensitiveLog : context.inputFilterSensitiveLog; + const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog !== null && overrideOutputFilterSensitiveLog !== void 0 ? overrideOutputFilterSensitiveLog : context.outputFilterSensitiveLog; + const { $metadata, ...outputWithoutMetadata } = response.output; + (_a = logger === null || logger === void 0 ? void 0 : logger.info) === null || _a === void 0 ? void 0 : _a.call(logger, { + clientName, + commandName, + input: inputFilterSensitiveLog(args.input), + output: outputFilterSensitiveLog(outputWithoutMetadata), + metadata: $metadata, + }); + return response; + } + catch (error) { + const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context; + const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions; + const inputFilterSensitiveLog = overrideInputFilterSensitiveLog !== null && overrideInputFilterSensitiveLog !== void 0 ? overrideInputFilterSensitiveLog : context.inputFilterSensitiveLog; + (_b = logger === null || logger === void 0 ? void 0 : logger.error) === null || _b === void 0 ? void 0 : _b.call(logger, { + clientName, + commandName, + input: inputFilterSensitiveLog(args.input), + error, + metadata: error.$metadata, + }); + throw error; + } +}; +exports.loggerMiddleware = loggerMiddleware; +exports.loggerMiddlewareOptions = { + name: "loggerMiddleware", + tags: ["LOGGER"], + step: "initialize", + override: true, +}; +const getLoggerPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add((0, exports.loggerMiddleware)(), exports.loggerMiddlewareOptions); + }, +}); +exports.getLoggerPlugin = getLoggerPlugin; - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; +/***/ }), - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +/***/ 65185: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getRecursionDetectionPlugin = exports.addRecursionDetectionMiddlewareOptions = exports.recursionDetectionMiddleware = void 0; +const protocol_http_1 = __nccwpck_require__(76232); +const TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id"; +const ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME"; +const ENV_TRACE_ID = "_X_AMZN_TRACE_ID"; +const recursionDetectionMiddleware = (options) => (next) => async (args) => { + const { request } = args; + if (!protocol_http_1.HttpRequest.isInstance(request) || + options.runtime !== "node" || + request.headers.hasOwnProperty(TRACE_ID_HEADER_NAME)) { + return next(args); + } + const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME]; + const traceId = process.env[ENV_TRACE_ID]; + const nonEmptyString = (str) => typeof str === "string" && str.length > 0; + if (nonEmptyString(functionName) && nonEmptyString(traceId)) { + request.headers[TRACE_ID_HEADER_NAME] = traceId; + } + return next({ + ...args, + request, + }); +}; +exports.recursionDetectionMiddleware = recursionDetectionMiddleware; +exports.addRecursionDetectionMiddlewareOptions = { + step: "build", + tags: ["RECURSION_DETECTION"], + name: "recursionDetectionMiddleware", + override: true, + priority: "low", +}; +const getRecursionDetectionPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add((0, exports.recursionDetectionMiddleware)(options), exports.addRecursionDetectionMiddlewareOptions); + }, +}); +exports.getRecursionDetectionPlugin = getRecursionDetectionPlugin; - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; +/***/ }), - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; +/***/ 96979: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getCheckContentLengthHeaderPlugin = exports.checkContentLengthHeaderMiddlewareOptions = exports.checkContentLengthHeader = void 0; +const protocol_http_1 = __nccwpck_require__(76232); +const smithy_client_1 = __nccwpck_require__(42584); +const CONTENT_LENGTH_HEADER = "content-length"; +function checkContentLengthHeader() { + return (next, context) => async (args) => { + var _a; + const { request } = args; + if (protocol_http_1.HttpRequest.isInstance(request)) { + if (!request.headers[CONTENT_LENGTH_HEADER]) { + const message = `Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.`; + if (typeof ((_a = context === null || context === void 0 ? void 0 : context.logger) === null || _a === void 0 ? void 0 : _a.warn) === "function" && !(context.logger instanceof smithy_client_1.NoOpLogger)) { + context.logger.warn(message); } - catch (e) { - fail(e); + else { + console.warn(message); } } - if (env.hasError) throw env.error; } - return next(); + return next({ ...args }); }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); +} +exports.checkContentLengthHeader = checkContentLengthHeader; +exports.checkContentLengthHeaderMiddlewareOptions = { + step: "finalizeRequest", + tags: ["CHECK_CONTENT_LENGTH_HEADER"], + name: "getCheckContentLengthHeaderPlugin", + override: true, +}; +const getCheckContentLengthHeaderPlugin = (unused) => ({ + applyToStack: (clientStack) => { + clientStack.add(checkContentLengthHeader(), exports.checkContentLengthHeaderMiddlewareOptions); + }, }); +exports.getCheckContentLengthHeaderPlugin = getCheckContentLengthHeaderPlugin; /***/ }), -<<<<<<< HEAD -/***/ 67867: -======= -/***/ 92941: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 39069: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromProcess = void 0; -<<<<<<< HEAD -const shared_ini_file_loader_1 = __nccwpck_require__(67097); -const resolveProcessCredentials_1 = __nccwpck_require__(66243); -======= -const shared_ini_file_loader_1 = __nccwpck_require__(93378); -const resolveProcessCredentials_1 = __nccwpck_require__(85811); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const fromProcess = (init = {}) => async () => { - const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init); - return (0, resolveProcessCredentials_1.resolveProcessCredentials)((0, shared_ini_file_loader_1.getProfileName)(init), profiles); -}; -exports.fromProcess = fromProcess; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(96979), exports); +tslib_1.__exportStar(__nccwpck_require__(29009), exports); +tslib_1.__exportStar(__nccwpck_require__(22804), exports); +tslib_1.__exportStar(__nccwpck_require__(54761), exports); +tslib_1.__exportStar(__nccwpck_require__(61320), exports); +tslib_1.__exportStar(__nccwpck_require__(68271), exports); +tslib_1.__exportStar(__nccwpck_require__(12320), exports); /***/ }), -<<<<<<< HEAD -/***/ 37841: -======= -/***/ 5343: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 29009: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getValidatedProcessCredentials = void 0; -const getValidatedProcessCredentials = (profileName, data) => { - if (data.Version !== 1) { - throw Error(`Profile ${profileName} credential_process did not return Version 1.`); - } - if (data.AccessKeyId === undefined || data.SecretAccessKey === undefined) { - throw Error(`Profile ${profileName} credential_process returned invalid credentials.`); - } - if (data.Expiration) { - const currentTime = new Date(); - const expireTime = new Date(data.Expiration); - if (expireTime < currentTime) { - throw Error(`Profile ${profileName} credential_process returned expired credentials.`); +exports.regionRedirectEndpointMiddlewareOptions = exports.regionRedirectEndpointMiddleware = void 0; +const regionRedirectEndpointMiddleware = (config) => { + return (next, context) => async (args) => { + const originalRegion = await config.region(); + const regionProviderRef = config.region; + if (context.__s3RegionRedirect) { + config.region = async () => { + config.region = regionProviderRef; + return context.__s3RegionRedirect; + }; } - } - return { - accessKeyId: data.AccessKeyId, - secretAccessKey: data.SecretAccessKey, - ...(data.SessionToken && { sessionToken: data.SessionToken }), - ...(data.Expiration && { expiration: new Date(data.Expiration) }), + const result = await next(args); + if (context.__s3RegionRedirect) { + const region = await config.region(); + if (originalRegion !== region) { + throw new Error("Region was not restored following S3 region redirect."); + } + } + return result; }; }; -exports.getValidatedProcessCredentials = getValidatedProcessCredentials; - - -/***/ }), - -<<<<<<< HEAD -/***/ 61695: -======= -/***/ 5758: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(72460); -tslib_1.__exportStar(__nccwpck_require__(67867), exports); -======= -const tslib_1 = __nccwpck_require__(91407); -tslib_1.__exportStar(__nccwpck_require__(92941), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +exports.regionRedirectEndpointMiddleware = regionRedirectEndpointMiddleware; +exports.regionRedirectEndpointMiddlewareOptions = { + tags: ["REGION_REDIRECT", "S3"], + name: "regionRedirectEndpointMiddleware", + override: true, + relation: "before", + toMiddleware: "endpointV2Middleware", +}; /***/ }), -<<<<<<< HEAD -/***/ 66243: -======= -/***/ 85811: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 22804: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveProcessCredentials = void 0; -<<<<<<< HEAD -const property_provider_1 = __nccwpck_require__(12955); -const child_process_1 = __nccwpck_require__(32081); -const util_1 = __nccwpck_require__(73837); -const getValidatedProcessCredentials_1 = __nccwpck_require__(37841); -======= -const property_provider_1 = __nccwpck_require__(68655); -const child_process_1 = __nccwpck_require__(32081); -const util_1 = __nccwpck_require__(73837); -const getValidatedProcessCredentials_1 = __nccwpck_require__(5343); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const resolveProcessCredentials = async (profileName, profiles) => { - const profile = profiles[profileName]; - if (profiles[profileName]) { - const credentialProcess = profile["credential_process"]; - if (credentialProcess !== undefined) { - const execPromise = (0, util_1.promisify)(child_process_1.exec); - try { - const { stdout } = await execPromise(credentialProcess); - let data; +exports.getRegionRedirectMiddlewarePlugin = exports.regionRedirectMiddlewareOptions = exports.regionRedirectMiddleware = void 0; +const region_redirect_endpoint_middleware_1 = __nccwpck_require__(29009); +function regionRedirectMiddleware(clientConfig) { + return (next, context) => async (args) => { + var _a, _b; + try { + return await next(args); + } + catch (err) { + if (clientConfig.followRegionRedirects && + ((_a = err === null || err === void 0 ? void 0 : err.$metadata) === null || _a === void 0 ? void 0 : _a.httpStatusCode) === 301) { try { - data = JSON.parse(stdout.trim()); + const actualRegion = err.$response.headers["x-amz-bucket-region"]; + (_b = context.logger) === null || _b === void 0 ? void 0 : _b.debug(`Redirecting from ${await clientConfig.region()} to ${actualRegion}`); + context.__s3RegionRedirect = actualRegion; } - catch (_a) { - throw Error(`Profile ${profileName} credential_process returned invalid JSON.`); + catch (e) { + throw new Error("Region redirect failed: " + e); } - return (0, getValidatedProcessCredentials_1.getValidatedProcessCredentials)(profileName, data); + return next(args); } - catch (error) { - throw new property_provider_1.CredentialsProviderError(error.message); + else { + throw err; } } - else { - throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`); - } - } - else { - throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`); - } + }; +} +exports.regionRedirectMiddleware = regionRedirectMiddleware; +exports.regionRedirectMiddlewareOptions = { + step: "initialize", + tags: ["REGION_REDIRECT", "S3"], + name: "regionRedirectMiddleware", + override: true, }; -exports.resolveProcessCredentials = resolveProcessCredentials; +const getRegionRedirectMiddlewarePlugin = (clientConfig) => ({ + applyToStack: (clientStack) => { + clientStack.add(regionRedirectMiddleware(clientConfig), exports.regionRedirectMiddlewareOptions); + clientStack.addRelativeTo((0, region_redirect_endpoint_middleware_1.regionRedirectEndpointMiddleware)(clientConfig), region_redirect_endpoint_middleware_1.regionRedirectEndpointMiddlewareOptions); + }, +}); +exports.getRegionRedirectMiddlewarePlugin = getRegionRedirectMiddlewarePlugin; /***/ }), -<<<<<<< HEAD -/***/ 72460: -======= -/***/ 91407: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. +/***/ 52376: +/***/ ((__unused_webpack_module, exports) => { -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.S3ExpressIdentityCache = void 0; +class S3ExpressIdentityCache { + constructor(data = {}) { + this.data = data; + this.lastPurgeTime = Date.now(); } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); + get(key) { + const entry = this.data[key]; + if (!entry) { + return; + } + return entry; } - else { - factory(createExporter(root)); + set(key, entry) { + this.data[key] = entry; + return entry; } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; + delete(key) { + delete this.data[key]; + } + async purgeExpired() { + const now = Date.now(); + if (this.lastPurgeTime + S3ExpressIdentityCache.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS > now) { + return; + } + for (const key in this.data) { + const entry = this.data[key]; + if (!entry.isRefreshing) { + const credential = await entry.identity; + if (credential.expiration) { + if (credential.expiration.getTime() < now) { + delete this.data[key]; + } + } } } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; +} +exports.S3ExpressIdentityCache = S3ExpressIdentityCache; +S3ExpressIdentityCache.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS = 30000; - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; +/***/ }), - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +/***/ 93227: +/***/ ((__unused_webpack_module, exports) => { - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.S3ExpressIdentityCacheEntry = void 0; +class S3ExpressIdentityCacheEntry { + constructor(_identity, isRefreshing = false, accessed = Date.now()) { + this._identity = _identity; + this.isRefreshing = isRefreshing; + this.accessed = accessed; + } + get identity() { + this.accessed = Date.now(); + return this._identity; + } +} +exports.S3ExpressIdentityCacheEntry = S3ExpressIdentityCacheEntry; - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; +/***/ }), - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; +/***/ 53261: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __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()); - }); - }; - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.S3ExpressIdentityProviderImpl = void 0; +const S3ExpressIdentityCache_1 = __nccwpck_require__(52376); +const S3ExpressIdentityCacheEntry_1 = __nccwpck_require__(93227); +class S3ExpressIdentityProviderImpl { + constructor(createSessionFn, cache = new S3ExpressIdentityCache_1.S3ExpressIdentityCache()) { + this.createSessionFn = createSessionFn; + this.cache = cache; + } + async getS3ExpressIdentity(awsIdentity, identityProperties) { + const key = identityProperties.Bucket; + const { cache } = this; + const entry = cache.get(key); + if (entry) { + return entry.identity.then((identity) => { + var _a, _b, _c, _d; + const isExpired = ((_b = (_a = identity.expiration) === null || _a === void 0 ? void 0 : _a.getTime()) !== null && _b !== void 0 ? _b : 0) < Date.now(); + if (isExpired) { + return cache.set(key, new S3ExpressIdentityCacheEntry_1.S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity; } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + const isExpiringSoon = ((_d = (_c = identity.expiration) === null || _c === void 0 ? void 0 : _c.getTime()) !== null && _d !== void 0 ? _d : 0) < Date.now() + S3ExpressIdentityProviderImpl.REFRESH_WINDOW_MS; + if (isExpiringSoon && !entry.isRefreshing) { + entry.isRefreshing = true; + this.getIdentity(key).then((id) => { + cache.set(key, new S3ExpressIdentityCacheEntry_1.S3ExpressIdentityCacheEntry(Promise.resolve(id))); + }); + } + return identity; + }); } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; + return cache.set(key, new S3ExpressIdentityCacheEntry_1.S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity; + } + async getIdentity(key) { + var _a, _b; + await this.cache.purgeExpired().catch((error) => { + console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n" + error); + }); + const session = await this.createSessionFn(key); + if (!((_a = session.Credentials) === null || _a === void 0 ? void 0 : _a.AccessKeyId) || !((_b = session.Credentials) === null || _b === void 0 ? void 0 : _b.SecretAccessKey)) { + throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey."); } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } + const identity = { + accessKeyId: session.Credentials.AccessKeyId, + secretAccessKey: session.Credentials.SecretAccessKey, + sessionToken: session.Credentials.SessionToken, + expiration: session.Credentials.Expiration ? new Date(session.Credentials.Expiration) : undefined, }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; + return identity; + } +} +exports.S3ExpressIdentityProviderImpl = S3ExpressIdentityProviderImpl; +S3ExpressIdentityProviderImpl.REFRESH_WINDOW_MS = 60000; - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +/***/ }), - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +/***/ 90077: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SignatureV4S3Express = void 0; +const signature_v4_1 = __nccwpck_require__(32686); +const constants_1 = __nccwpck_require__(75106); +class SignatureV4S3Express extends signature_v4_1.SignatureV4 { + async signWithCredentials(requestToSign, credentials, options) { + const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials); + requestToSign.headers[constants_1.SESSION_TOKEN_HEADER] = credentials.sessionToken; + const privateAccess = this; + setSingleOverride(privateAccess, credentialsWithoutSessionToken); + return privateAccess.signRequest(requestToSign, options !== null && options !== void 0 ? options : {}); + } + async presignWithCredentials(requestToSign, credentials, options) { + var _a; + const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials); + delete requestToSign.headers[constants_1.SESSION_TOKEN_HEADER]; + requestToSign.headers[constants_1.SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken; + requestToSign.query = (_a = requestToSign.query) !== null && _a !== void 0 ? _a : {}; + requestToSign.query[constants_1.SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken; + const privateAccess = this; + setSingleOverride(privateAccess, credentialsWithoutSessionToken); + return this.presign(requestToSign, options); + } +} +exports.SignatureV4S3Express = SignatureV4S3Express; +function getCredentialsWithoutSessionToken(credentials) { + const credentialsWithoutSessionToken = { + accessKeyId: credentials.accessKeyId, + secretAccessKey: credentials.secretAccessKey, + expiration: credentials.expiration, }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + return credentialsWithoutSessionToken; +} +function setSingleOverride(privateAccess, credentialsWithoutSessionToken) { + const id = setTimeout(() => { + throw new Error("SignatureV4S3Express credential override was created but not called."); + }, 10); + const currentCredentialProvider = privateAccess.credentialProvider; + const overrideCredentialsProviderOnce = () => { + clearTimeout(id); + privateAccess.credentialProvider = currentCredentialProvider; + return Promise.resolve(credentialsWithoutSessionToken); }; + privateAccess.credentialProvider = overrideCredentialsProviderOnce; +} - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; +/***/ }), - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +/***/ 75106: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME = exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME = exports.SESSION_TOKEN_HEADER = exports.SESSION_TOKEN_QUERY_PARAM = exports.S3_EXPRESS_AUTH_SCHEME = exports.S3_EXPRESS_BACKEND = exports.S3_EXPRESS_BUCKET_TYPE = void 0; +const util_config_provider_1 = __nccwpck_require__(54822); +exports.S3_EXPRESS_BUCKET_TYPE = "Directory"; +exports.S3_EXPRESS_BACKEND = "S3Express"; +exports.S3_EXPRESS_AUTH_SCHEME = "sigv4-s3express"; +exports.SESSION_TOKEN_QUERY_PARAM = "X-Amz-S3session-Token"; +exports.SESSION_TOKEN_HEADER = exports.SESSION_TOKEN_QUERY_PARAM.toLowerCase(); +exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME = "AWS_S3_DISABLE_EXPRESS_SESSION_AUTH"; +exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME = "s3_disable_express_session_auth"; +exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = { + environmentVariableSelector: (env) => (0, util_config_provider_1.booleanSelector)(env, exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME, util_config_provider_1.SelectorType.ENV), + configFileSelector: (profile) => (0, util_config_provider_1.booleanSelector)(profile, exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME, util_config_provider_1.SelectorType.CONFIG), + default: false, +}; - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; +/***/ }), - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +/***/ 86745: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getS3ExpressPlugin = exports.s3ExpressMiddlewareOptions = exports.s3ExpressMiddleware = void 0; +const protocol_http_1 = __nccwpck_require__(76232); +const constants_1 = __nccwpck_require__(75106); +const s3ExpressMiddleware = (options) => { + return (next, context) => async (args) => { + var _a, _b, _c, _d, _e; + if (context.endpointV2) { + const endpoint = context.endpointV2; + const isS3ExpressAuth = ((_c = (_b = (_a = endpoint.properties) === null || _a === void 0 ? void 0 : _a.authSchemes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.name) === constants_1.S3_EXPRESS_AUTH_SCHEME; + const isS3ExpressBucket = ((_d = endpoint.properties) === null || _d === void 0 ? void 0 : _d.backend) === constants_1.S3_EXPRESS_BACKEND || + ((_e = endpoint.properties) === null || _e === void 0 ? void 0 : _e.bucketType) === constants_1.S3_EXPRESS_BUCKET_TYPE; + if (isS3ExpressBucket) { + context.isS3ExpressBucket = true; } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); + if (isS3ExpressAuth) { + const requestBucket = args.input.Bucket; + if (requestBucket) { + const s3ExpressIdentity = await options.s3ExpressIdentityProvider.getS3ExpressIdentity(await options.credentials(), { + Bucket: requestBucket, + }); + context.s3ExpressIdentity = s3ExpressIdentity; + if (protocol_http_1.HttpRequest.isInstance(args.request) && s3ExpressIdentity.sessionToken) { + args.request.headers[constants_1.SESSION_TOKEN_HEADER] = s3ExpressIdentity.sessionToken; + } } } - if (env.hasError) throw env.error; } - return next(); + return next(args); }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); +}; +exports.s3ExpressMiddleware = s3ExpressMiddleware; +exports.s3ExpressMiddlewareOptions = { + name: "s3ExpressMiddleware", + step: "build", + tags: ["S3", "S3_EXPRESS"], + override: true, +}; +const getS3ExpressPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add((0, exports.s3ExpressMiddleware)(options), exports.s3ExpressMiddlewareOptions); + }, }); +exports.getS3ExpressPlugin = getS3ExpressPlugin; /***/ }), -<<<<<<< HEAD -/***/ 65765: -======= -/***/ 16796: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 54761: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromSSO = void 0; -<<<<<<< HEAD -const property_provider_1 = __nccwpck_require__(12955); -const shared_ini_file_loader_1 = __nccwpck_require__(67097); -const isSsoProfile_1 = __nccwpck_require__(70821); -const resolveSSOCredentials_1 = __nccwpck_require__(74782); -const validateSsoProfile_1 = __nccwpck_require__(47314); -======= -const property_provider_1 = __nccwpck_require__(68655); -const shared_ini_file_loader_1 = __nccwpck_require__(93378); -const isSsoProfile_1 = __nccwpck_require__(74538); -const resolveSSOCredentials_1 = __nccwpck_require__(27369); -const validateSsoProfile_1 = __nccwpck_require__(63501); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const fromSSO = (init = {}) => async () => { - const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, ssoSession } = init; - const profileName = (0, shared_ini_file_loader_1.getProfileName)(init); - if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { - const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init); - const profile = profiles[profileName]; - if (!profile) { - throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} was not found.`); - } - if (!(0, isSsoProfile_1.isSsoProfile)(profile)) { - throw new property_provider_1.CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`); - } - if (profile === null || profile === void 0 ? void 0 : profile.sso_session) { - const ssoSessions = await (0, shared_ini_file_loader_1.loadSsoSessionData)(init); - const session = ssoSessions[profile.sso_session]; - const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`; - if (ssoRegion && ssoRegion !== session.sso_region) { - throw new property_provider_1.CredentialsProviderError(`Conflicting SSO region` + conflictMsg, false); - } - if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) { - throw new property_provider_1.CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, false); - } - profile.sso_region = session.sso_region; - profile.sso_start_url = session.sso_start_url; - } - const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = (0, validateSsoProfile_1.validateSsoProfile)(profile); - return (0, resolveSSOCredentials_1.resolveSSOCredentials)({ - ssoStartUrl: sso_start_url, - ssoSession: sso_session, - ssoAccountId: sso_account_id, - ssoRegion: sso_region, - ssoRoleName: sso_role_name, - ssoClient: ssoClient, - profile: profileName, - }); - } - else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) { - throw new property_provider_1.CredentialsProviderError("Incomplete configuration. The fromSSO() argument hash must include " + - '"ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"'); - } - else { - return (0, resolveSSOCredentials_1.resolveSSOCredentials)({ - ssoStartUrl, - ssoSession, - ssoAccountId, - ssoRegion, - ssoRoleName, - ssoClient, - profile: profileName, - }); - } -}; -exports.fromSSO = fromSSO; +exports.s3ExpressMiddlewareOptions = exports.s3ExpressMiddleware = exports.getS3ExpressPlugin = exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = exports.SignatureV4S3Express = exports.S3ExpressIdentityProviderImpl = exports.S3ExpressIdentityCacheEntry = exports.S3ExpressIdentityCache = void 0; +var S3ExpressIdentityCache_1 = __nccwpck_require__(52376); +Object.defineProperty(exports, "S3ExpressIdentityCache", ({ enumerable: true, get: function () { return S3ExpressIdentityCache_1.S3ExpressIdentityCache; } })); +var S3ExpressIdentityCacheEntry_1 = __nccwpck_require__(93227); +Object.defineProperty(exports, "S3ExpressIdentityCacheEntry", ({ enumerable: true, get: function () { return S3ExpressIdentityCacheEntry_1.S3ExpressIdentityCacheEntry; } })); +var S3ExpressIdentityProviderImpl_1 = __nccwpck_require__(53261); +Object.defineProperty(exports, "S3ExpressIdentityProviderImpl", ({ enumerable: true, get: function () { return S3ExpressIdentityProviderImpl_1.S3ExpressIdentityProviderImpl; } })); +var SignatureV4S3Express_1 = __nccwpck_require__(90077); +Object.defineProperty(exports, "SignatureV4S3Express", ({ enumerable: true, get: function () { return SignatureV4S3Express_1.SignatureV4S3Express; } })); +var constants_1 = __nccwpck_require__(75106); +Object.defineProperty(exports, "NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS", ({ enumerable: true, get: function () { return constants_1.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS; } })); +var s3ExpressMiddleware_1 = __nccwpck_require__(86745); +Object.defineProperty(exports, "getS3ExpressPlugin", ({ enumerable: true, get: function () { return s3ExpressMiddleware_1.getS3ExpressPlugin; } })); +Object.defineProperty(exports, "s3ExpressMiddleware", ({ enumerable: true, get: function () { return s3ExpressMiddleware_1.s3ExpressMiddleware; } })); +Object.defineProperty(exports, "s3ExpressMiddlewareOptions", ({ enumerable: true, get: function () { return s3ExpressMiddleware_1.s3ExpressMiddlewareOptions; } })); /***/ }), -<<<<<<< HEAD -/***/ 82419: -======= -/***/ 23666: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 61320: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(2635); -tslib_1.__exportStar(__nccwpck_require__(65765), exports); -tslib_1.__exportStar(__nccwpck_require__(70821), exports); -tslib_1.__exportStar(__nccwpck_require__(66675), exports); -tslib_1.__exportStar(__nccwpck_require__(47314), exports); -======= -const tslib_1 = __nccwpck_require__(9439); -tslib_1.__exportStar(__nccwpck_require__(16796), exports); -tslib_1.__exportStar(__nccwpck_require__(74538), exports); -tslib_1.__exportStar(__nccwpck_require__(87714), exports); -tslib_1.__exportStar(__nccwpck_require__(63501), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - -/***/ }), - -<<<<<<< HEAD -/***/ 70821: -======= -/***/ 74538: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isSsoProfile = void 0; -const isSsoProfile = (arg) => arg && - (typeof arg.sso_start_url === "string" || - typeof arg.sso_account_id === "string" || - typeof arg.sso_session === "string" || - typeof arg.sso_region === "string" || - typeof arg.sso_role_name === "string"); -exports.isSsoProfile = isSsoProfile; +exports.resolveS3Config = void 0; +const s3_express_1 = __nccwpck_require__(54761); +const resolveS3Config = (input, { session, }) => { + var _a, _b, _c, _d, _e; + const [s3ClientProvider, CreateSessionCommandCtor] = session; + return { + ...input, + forcePathStyle: (_a = input.forcePathStyle) !== null && _a !== void 0 ? _a : false, + useAccelerateEndpoint: (_b = input.useAccelerateEndpoint) !== null && _b !== void 0 ? _b : false, + disableMultiregionAccessPoints: (_c = input.disableMultiregionAccessPoints) !== null && _c !== void 0 ? _c : false, + followRegionRedirects: (_d = input.followRegionRedirects) !== null && _d !== void 0 ? _d : false, + s3ExpressIdentityProvider: (_e = input.s3ExpressIdentityProvider) !== null && _e !== void 0 ? _e : new s3_express_1.S3ExpressIdentityProviderImpl(async (key) => s3ClientProvider().send(new CreateSessionCommandCtor({ + Bucket: key, + SessionMode: "ReadWrite", + }))), + }; +}; +exports.resolveS3Config = resolveS3Config; /***/ }), -<<<<<<< HEAD -/***/ 74782: -======= -/***/ 27369: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 68271: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveSSOCredentials = void 0; -<<<<<<< HEAD -const client_sso_1 = __nccwpck_require__(62764); -const token_providers_1 = __nccwpck_require__(64260); -const property_provider_1 = __nccwpck_require__(12955); -const shared_ini_file_loader_1 = __nccwpck_require__(67097); -======= -const client_sso_1 = __nccwpck_require__(2394); -const property_provider_1 = __nccwpck_require__(68655); -const shared_ini_file_loader_1 = __nccwpck_require__(93378); -const EXPIRE_WINDOW_MS = 15 * 60 * 1000; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const SHOULD_FAIL_CREDENTIAL_CHAIN = false; -const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, profile, }) => { - let token; - const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`; - if (ssoSession) { - try { - const _token = await (0, token_providers_1.fromSso)({ profile })(); - token = { - accessToken: _token.token, - expiresAt: new Date(_token.expiration).toISOString(), - }; - } - catch (e) { - throw new property_provider_1.CredentialsProviderError(e.message, SHOULD_FAIL_CREDENTIAL_CHAIN); - } - } - else { - try { - token = await (0, shared_ini_file_loader_1.getSSOTokenFromFile)(ssoStartUrl); - } - catch (e) { - throw new property_provider_1.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, SHOULD_FAIL_CREDENTIAL_CHAIN); - } - } - if (new Date(token.expiresAt).getTime() - Date.now() <= 0) { - throw new property_provider_1.CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, SHOULD_FAIL_CREDENTIAL_CHAIN); - } - const { accessToken } = token; - const sso = ssoClient || new client_sso_1.SSOClient({ region: ssoRegion }); - let ssoResp; - try { - ssoResp = await sso.send(new client_sso_1.GetRoleCredentialsCommand({ - accountId: ssoAccountId, - roleName: ssoRoleName, - accessToken, - })); +exports.getThrow200ExceptionsPlugin = exports.throw200ExceptionsMiddlewareOptions = exports.throw200ExceptionsMiddleware = void 0; +const protocol_http_1 = __nccwpck_require__(76232); +const throw200ExceptionsMiddleware = (config) => (next) => async (args) => { + const result = await next(args); + const { response } = result; + if (!protocol_http_1.HttpResponse.isInstance(response)) + return result; + const { statusCode, body } = response; + if (statusCode < 200 || statusCode >= 300) + return result; + const bodyBytes = await collectBody(body, config); + const bodyString = await collectBodyString(bodyBytes, config); + if (bodyBytes.length === 0) { + const err = new Error("S3 aborted request"); + err.name = "InternalError"; + throw err; } - catch (e) { - throw property_provider_1.CredentialsProviderError.from(e, SHOULD_FAIL_CREDENTIAL_CHAIN); + if (bodyString && bodyString.match("")) { + response.statusCode = 400; } - const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration } = {} } = ssoResp; - if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) { - throw new property_provider_1.CredentialsProviderError("SSO returns an invalid temporary credential.", SHOULD_FAIL_CREDENTIAL_CHAIN); + response.body = bodyBytes; + return result; +}; +exports.throw200ExceptionsMiddleware = throw200ExceptionsMiddleware; +const collectBody = (streamBody = new Uint8Array(), context) => { + if (streamBody instanceof Uint8Array) { + return Promise.resolve(streamBody); } - return { accessKeyId, secretAccessKey, sessionToken, expiration: new Date(expiration) }; + return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); }; -exports.resolveSSOCredentials = resolveSSOCredentials; +const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); +exports.throw200ExceptionsMiddlewareOptions = { + relation: "after", + toMiddleware: "deserializerMiddleware", + tags: ["THROW_200_EXCEPTIONS", "S3"], + name: "throw200ExceptionsMiddleware", + override: true, +}; +const getThrow200ExceptionsPlugin = (config) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo((0, exports.throw200ExceptionsMiddleware)(config), exports.throw200ExceptionsMiddlewareOptions); + }, +}); +exports.getThrow200ExceptionsPlugin = getThrow200ExceptionsPlugin; /***/ }), -<<<<<<< HEAD -/***/ 66675: -======= -/***/ 87714: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { +/***/ 12320: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getValidateBucketNamePlugin = exports.validateBucketNameMiddlewareOptions = exports.validateBucketNameMiddleware = void 0; +const util_arn_parser_1 = __nccwpck_require__(46107); +function validateBucketNameMiddleware() { + return (next) => async (args) => { + const { input: { Bucket }, } = args; + if (typeof Bucket === "string" && !(0, util_arn_parser_1.validate)(Bucket) && Bucket.indexOf("/") >= 0) { + const err = new Error(`Bucket name shouldn't contain '/', received '${Bucket}'`); + err.name = "InvalidBucketName"; + throw err; + } + return next({ ...args }); + }; +} +exports.validateBucketNameMiddleware = validateBucketNameMiddleware; +exports.validateBucketNameMiddlewareOptions = { + step: "initialize", + tags: ["VALIDATE_BUCKET_NAME"], + name: "validateBucketNameMiddleware", + override: true, +}; +const getValidateBucketNamePlugin = (unused) => ({ + applyToStack: (clientStack) => { + clientStack.add(validateBucketNameMiddleware(), exports.validateBucketNameMiddlewareOptions); + }, +}); +exports.getValidateBucketNamePlugin = getValidateBucketNamePlugin; /***/ }), -<<<<<<< HEAD -/***/ 47314: -======= -/***/ 63501: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 56121: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.validateSsoProfile = void 0; -<<<<<<< HEAD -const property_provider_1 = __nccwpck_require__(12955); -======= -const property_provider_1 = __nccwpck_require__(68655); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const validateSsoProfile = (profile) => { - const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile; - if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) { - throw new property_provider_1.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", ` + - `"sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(profile).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, false); +exports.resolveSigV4AuthConfig = exports.resolveAwsAuthConfig = void 0; +const property_provider_1 = __nccwpck_require__(60846); +const signature_v4_1 = __nccwpck_require__(32686); +const util_middleware_1 = __nccwpck_require__(3626); +const CREDENTIAL_EXPIRE_WINDOW = 300000; +const resolveAwsAuthConfig = (input) => { + const normalizedCreds = input.credentials + ? normalizeCredentialProvider(input.credentials) + : input.credentialDefaultProvider(input); + const { signingEscapePath = true, systemClockOffset = input.systemClockOffset || 0, sha256 } = input; + let signer; + if (input.signer) { + signer = (0, util_middleware_1.normalizeProvider)(input.signer); } - return profile; + else if (input.regionInfoProvider) { + signer = () => (0, util_middleware_1.normalizeProvider)(input.region)() + .then(async (region) => [ + (await input.regionInfoProvider(region, { + useFipsEndpoint: await input.useFipsEndpoint(), + useDualstackEndpoint: await input.useDualstackEndpoint(), + })) || {}, + region, + ]) + .then(([regionInfo, region]) => { + const { signingRegion, signingService } = regionInfo; + input.signingRegion = input.signingRegion || signingRegion || region; + input.signingName = input.signingName || signingService || input.serviceId; + const params = { + ...input, + credentials: normalizedCreds, + region: input.signingRegion, + service: input.signingName, + sha256, + uriEscapePath: signingEscapePath, + }; + const SignerCtor = input.signerConstructor || signature_v4_1.SignatureV4; + return new SignerCtor(params); + }); + } + else { + signer = async (authScheme) => { + authScheme = Object.assign({}, { + name: "sigv4", + signingName: input.signingName || input.defaultSigningName, + signingRegion: await (0, util_middleware_1.normalizeProvider)(input.region)(), + properties: {}, + }, authScheme); + const signingRegion = authScheme.signingRegion; + const signingService = authScheme.signingName; + input.signingRegion = input.signingRegion || signingRegion; + input.signingName = input.signingName || signingService || input.serviceId; + const params = { + ...input, + credentials: normalizedCreds, + region: input.signingRegion, + service: input.signingName, + sha256, + uriEscapePath: signingEscapePath, + }; + const SignerCtor = input.signerConstructor || signature_v4_1.SignatureV4; + return new SignerCtor(params); + }; + } + return { + ...input, + systemClockOffset, + signingEscapePath, + credentials: normalizedCreds, + signer, + }; +}; +exports.resolveAwsAuthConfig = resolveAwsAuthConfig; +const resolveSigV4AuthConfig = (input) => { + const normalizedCreds = input.credentials + ? normalizeCredentialProvider(input.credentials) + : input.credentialDefaultProvider(input); + const { signingEscapePath = true, systemClockOffset = input.systemClockOffset || 0, sha256 } = input; + let signer; + if (input.signer) { + signer = (0, util_middleware_1.normalizeProvider)(input.signer); + } + else { + signer = (0, util_middleware_1.normalizeProvider)(new signature_v4_1.SignatureV4({ + credentials: normalizedCreds, + region: input.region, + service: input.signingName, + sha256, + uriEscapePath: signingEscapePath, + })); + } + return { + ...input, + systemClockOffset, + signingEscapePath, + credentials: normalizedCreds, + signer, + }; +}; +exports.resolveSigV4AuthConfig = resolveSigV4AuthConfig; +const normalizeCredentialProvider = (credentials) => { + if (typeof credentials === "function") { + return (0, property_provider_1.memoize)(credentials, (credentials) => credentials.expiration !== undefined && + credentials.expiration.getTime() - Date.now() < CREDENTIAL_EXPIRE_WINDOW, (credentials) => credentials.expiration !== undefined); + } + return (0, util_middleware_1.normalizeProvider)(credentials); }; -exports.validateSsoProfile = validateSsoProfile; /***/ }), -<<<<<<< HEAD -/***/ 2635: -======= -/***/ 9439: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. +/***/ 99526: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getSigV4AuthPlugin = exports.getAwsAuthPlugin = exports.awsAuthMiddlewareOptions = exports.awsAuthMiddleware = void 0; +const protocol_http_1 = __nccwpck_require__(76232); +const getSkewCorrectedDate_1 = __nccwpck_require__(43025); +const getUpdatedSystemClockOffset_1 = __nccwpck_require__(10965); +const awsAuthMiddleware = (options) => (next, context) => async function (args) { + var _a, _b, _c, _d; + if (!protocol_http_1.HttpRequest.isInstance(args.request)) + return next(args); + const authScheme = (_c = (_b = (_a = context.endpointV2) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.authSchemes) === null || _c === void 0 ? void 0 : _c[0]; + const multiRegionOverride = (authScheme === null || authScheme === void 0 ? void 0 : authScheme.name) === "sigv4a" ? (_d = authScheme === null || authScheme === void 0 ? void 0 : authScheme.signingRegionSet) === null || _d === void 0 ? void 0 : _d.join(",") : undefined; + const signer = await options.signer(authScheme); + let signedRequest; + const signingOptions = { + signingDate: (0, getSkewCorrectedDate_1.getSkewCorrectedDate)(options.systemClockOffset), + signingRegion: multiRegionOverride || context["signing_region"], + signingService: context["signing_service"], + }; + if (context.s3ExpressIdentity) { + const sigV4MultiRegion = signer; + signedRequest = await sigV4MultiRegion.signWithCredentials(args.request, context.s3ExpressIdentity, signingOptions); + if (signedRequest.headers["X-Amz-Security-Token"] || signedRequest.headers["x-amz-security-token"]) { + throw new Error("X-Amz-Security-Token must not be set for s3-express requests."); + } } else { - factory(createExporter(root)); + signedRequest = await signer.sign(args.request, signingOptions); } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } + const output = await next({ + ...args, + request: signedRequest, + }).catch((error) => { + var _a; + const serverTime = (_a = error.ServerTime) !== null && _a !== void 0 ? _a : getDateHeader(error.$response); + if (serverTime) { + options.systemClockOffset = (0, getUpdatedSystemClockOffset_1.getUpdatedSystemClockOffset)(serverTime, options.systemClockOffset); } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + throw error; + }); + const dateHeader = getDateHeader(output.response); + if (dateHeader) { + options.systemClockOffset = (0, getUpdatedSystemClockOffset_1.getUpdatedSystemClockOffset)(dateHeader, options.systemClockOffset); } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return output; +}; +exports.awsAuthMiddleware = awsAuthMiddleware; +const getDateHeader = (response) => { var _a, _b, _c; return protocol_http_1.HttpResponse.isInstance(response) ? (_b = (_a = response.headers) === null || _a === void 0 ? void 0 : _a.date) !== null && _b !== void 0 ? _b : (_c = response.headers) === null || _c === void 0 ? void 0 : _c.Date : undefined; }; +exports.awsAuthMiddlewareOptions = { + name: "awsAuthMiddleware", + tags: ["SIGNATURE", "AWSAUTH"], + relation: "after", + toMiddleware: "retryMiddleware", + override: true, +}; +const getAwsAuthPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo((0, exports.awsAuthMiddleware)(options), exports.awsAuthMiddlewareOptions); + }, +}); +exports.getAwsAuthPlugin = getAwsAuthPlugin; +exports.getSigV4AuthPlugin = exports.getAwsAuthPlugin; - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; +/***/ }), - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; +/***/ 1223: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(56121), exports); +tslib_1.__exportStar(__nccwpck_require__(99526), exports); - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; +/***/ }), - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; +/***/ 43025: +/***/ ((__unused_webpack_module, exports) => { - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getSkewCorrectedDate = void 0; +const getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset); +exports.getSkewCorrectedDate = getSkewCorrectedDate; - __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()); - }); - }; - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; +/***/ }), - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +/***/ 10965: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getUpdatedSystemClockOffset = void 0; +const isClockSkewed_1 = __nccwpck_require__(12899); +const getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => { + const clockTimeInMs = Date.parse(clockTime); + if ((0, isClockSkewed_1.isClockSkewed)(clockTimeInMs, currentSystemClockOffset)) { + return clockTimeInMs - Date.now(); + } + return currentSystemClockOffset; +}; +exports.getUpdatedSystemClockOffset = getUpdatedSystemClockOffset; - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +/***/ }), - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +/***/ 12899: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isClockSkewed = void 0; +const getSkewCorrectedDate_1 = __nccwpck_require__(43025); +const isClockSkewed = (clockTime, systemClockOffset) => Math.abs((0, getSkewCorrectedDate_1.getSkewCorrectedDate)(systemClockOffset).getTime() - clockTime) >= 300000; +exports.isClockSkewed = isClockSkewed; + + +/***/ }), + +/***/ 20484: +/***/ ((__unused_webpack_module, exports) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getSsecPlugin = exports.ssecMiddlewareOptions = exports.ssecMiddleware = void 0; +function ssecMiddleware(options) { + return (next) => async (args) => { + let input = { ...args.input }; + const properties = [ + { + target: "SSECustomerKey", + hash: "SSECustomerKeyMD5", + }, + { + target: "CopySourceSSECustomerKey", + hash: "CopySourceSSECustomerKeyMD5", + }, + ]; + for (const prop of properties) { + const value = input[prop.target]; + if (value) { + const valueView = ArrayBuffer.isView(value) + ? new Uint8Array(value.buffer, value.byteOffset, value.byteLength) + : typeof value === "string" + ? options.utf8Decoder(value) + : new Uint8Array(value); + const encoded = options.base64Encoder(valueView); + const hash = new options.md5(); + hash.update(valueView); + input = { + ...input, + [prop.target]: encoded, + [prop.hash]: options.base64Encoder(await hash.digest()), + }; } } - return to.concat(ar || Array.prototype.slice.call(from)); + return next({ + ...args, + input, + }); }; +} +exports.ssecMiddleware = ssecMiddleware; +exports.ssecMiddlewareOptions = { + name: "ssecMiddleware", + step: "initialize", + tags: ["SSE"], + override: true, +}; +const getSsecPlugin = (config) => ({ + applyToStack: (clientStack) => { + clientStack.add(ssecMiddleware(config), exports.ssecMiddlewareOptions); + }, +}); +exports.getSsecPlugin = getSsecPlugin; - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +/***/ }), - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; +/***/ 22414: +/***/ ((__unused_webpack_module, exports) => { - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.resolveUserAgentConfig = void 0; +function resolveUserAgentConfig(input) { + return { + ...input, + customUserAgent: typeof input.customUserAgent === "string" ? [[input.customUserAgent]] : input.customUserAgent, }; +} +exports.resolveUserAgentConfig = resolveUserAgentConfig; - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +/***/ }), - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; +/***/ 64683: +/***/ ((__unused_webpack_module, exports) => { - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.UA_ESCAPE_CHAR = exports.UA_VALUE_ESCAPE_REGEX = exports.UA_NAME_ESCAPE_REGEX = exports.UA_NAME_SEPARATOR = exports.SPACE = exports.X_AMZ_USER_AGENT = exports.USER_AGENT = void 0; +exports.USER_AGENT = "user-agent"; +exports.X_AMZ_USER_AGENT = "x-amz-user-agent"; +exports.SPACE = " "; +exports.UA_NAME_SEPARATOR = "/"; +exports.UA_NAME_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g; +exports.UA_VALUE_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g; +exports.UA_ESCAPE_CHAR = "-"; - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; +/***/ }), - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; +/***/ 7524: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(22414), exports); +tslib_1.__exportStar(__nccwpck_require__(81816), exports); /***/ }), -<<<<<<< HEAD -/***/ 49580: -======= -/***/ 13481: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 81816: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromTokenFile = void 0; -<<<<<<< HEAD -const property_provider_1 = __nccwpck_require__(12955); -const fs_1 = __nccwpck_require__(57147); -const fromWebToken_1 = __nccwpck_require__(46289); -======= -const property_provider_1 = __nccwpck_require__(68655); -const fs_1 = __nccwpck_require__(57147); -const fromWebToken_1 = __nccwpck_require__(68715); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE"; -const ENV_ROLE_ARN = "AWS_ROLE_ARN"; -const ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME"; -const fromTokenFile = (init = {}) => async () => { - var _a, _b, _c; - const webIdentityTokenFile = (_a = init === null || init === void 0 ? void 0 : init.webIdentityTokenFile) !== null && _a !== void 0 ? _a : process.env[ENV_TOKEN_FILE]; - const roleArn = (_b = init === null || init === void 0 ? void 0 : init.roleArn) !== null && _b !== void 0 ? _b : process.env[ENV_ROLE_ARN]; - const roleSessionName = (_c = init === null || init === void 0 ? void 0 : init.roleSessionName) !== null && _c !== void 0 ? _c : process.env[ENV_ROLE_SESSION_NAME]; - if (!webIdentityTokenFile || !roleArn) { - throw new property_provider_1.CredentialsProviderError("Web identity configuration not specified"); +exports.getUserAgentPlugin = exports.getUserAgentMiddlewareOptions = exports.userAgentMiddleware = void 0; +const util_endpoints_1 = __nccwpck_require__(68503); +const protocol_http_1 = __nccwpck_require__(76232); +const constants_1 = __nccwpck_require__(64683); +const userAgentMiddleware = (options) => (next, context) => async (args) => { + var _a, _b; + const { request } = args; + if (!protocol_http_1.HttpRequest.isInstance(request)) + return next(args); + const { headers } = request; + const userAgent = ((_a = context === null || context === void 0 ? void 0 : context.userAgent) === null || _a === void 0 ? void 0 : _a.map(escapeUserAgent)) || []; + const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent); + const customUserAgent = ((_b = options === null || options === void 0 ? void 0 : options.customUserAgent) === null || _b === void 0 ? void 0 : _b.map(escapeUserAgent)) || []; + const prefix = (0, util_endpoints_1.getUserAgentPrefix)(); + const sdkUserAgentValue = (prefix ? [prefix] : []) + .concat([...defaultUserAgent, ...userAgent, ...customUserAgent]) + .join(constants_1.SPACE); + const normalUAValue = [ + ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")), + ...customUserAgent, + ].join(constants_1.SPACE); + if (options.runtime !== "browser") { + if (normalUAValue) { + headers[constants_1.X_AMZ_USER_AGENT] = headers[constants_1.X_AMZ_USER_AGENT] + ? `${headers[constants_1.USER_AGENT]} ${normalUAValue}` + : normalUAValue; + } + headers[constants_1.USER_AGENT] = sdkUserAgentValue; } - return (0, fromWebToken_1.fromWebToken)({ - ...init, - webIdentityToken: (0, fs_1.readFileSync)(webIdentityTokenFile, { encoding: "ascii" }), - roleArn, - roleSessionName, - })(); + else { + headers[constants_1.X_AMZ_USER_AGENT] = sdkUserAgentValue; + } + return next({ + ...args, + request, + }); }; -exports.fromTokenFile = fromTokenFile; +exports.userAgentMiddleware = userAgentMiddleware; +const escapeUserAgent = (userAgentPair) => { + var _a; + const name = userAgentPair[0] + .split(constants_1.UA_NAME_SEPARATOR) + .map((part) => part.replace(constants_1.UA_NAME_ESCAPE_REGEX, constants_1.UA_ESCAPE_CHAR)) + .join(constants_1.UA_NAME_SEPARATOR); + const version = (_a = userAgentPair[1]) === null || _a === void 0 ? void 0 : _a.replace(constants_1.UA_VALUE_ESCAPE_REGEX, constants_1.UA_ESCAPE_CHAR); + const prefixSeparatorIndex = name.indexOf(constants_1.UA_NAME_SEPARATOR); + const prefix = name.substring(0, prefixSeparatorIndex); + let uaName = name.substring(prefixSeparatorIndex + 1); + if (prefix === "api") { + uaName = uaName.toLowerCase(); + } + return [prefix, uaName, version] + .filter((item) => item && item.length > 0) + .reduce((acc, item, index) => { + switch (index) { + case 0: + return item; + case 1: + return `${acc}/${item}`; + default: + return `${acc}#${item}`; + } + }, ""); +}; +exports.getUserAgentMiddlewareOptions = { + name: "getUserAgentMiddleware", + step: "build", + priority: "low", + tags: ["SET_USER_AGENT", "USER_AGENT"], + override: true, +}; +const getUserAgentPlugin = (config) => ({ + applyToStack: (clientStack) => { + clientStack.add((0, exports.userAgentMiddleware)(config), exports.getUserAgentMiddlewareOptions); + }, +}); +exports.getUserAgentPlugin = getUserAgentPlugin; /***/ }), -<<<<<<< HEAD -/***/ 46289: -======= -/***/ 68715: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 6801: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromWebToken = void 0; -<<<<<<< HEAD -const property_provider_1 = __nccwpck_require__(12955); -======= -const property_provider_1 = __nccwpck_require__(68655); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const fromWebToken = (init) => () => { - const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds, roleAssumerWithWebIdentity, } = init; - if (!roleAssumerWithWebIdentity) { - throw new property_provider_1.CredentialsProviderError(`Role Arn '${roleArn}' needs to be assumed with web identity,` + - ` but no role assumption callback was provided.`, false); - } - return roleAssumerWithWebIdentity({ - RoleArn: roleArn, - RoleSessionName: roleSessionName !== null && roleSessionName !== void 0 ? roleSessionName : `aws-sdk-js-session-${Date.now()}`, - WebIdentityToken: webIdentityToken, - ProviderId: providerId, - PolicyArns: policyArns, - Policy: policy, - DurationSeconds: durationSeconds, - }); +exports.resolveAwsRegionExtensionConfiguration = exports.getAwsRegionExtensionConfiguration = void 0; +const getAwsRegionExtensionConfiguration = (runtimeConfig) => { + let runtimeConfigRegion = async () => { + if (runtimeConfig.region === undefined) { + throw new Error("Region is missing from runtimeConfig"); + } + const region = runtimeConfig.region; + if (typeof region === "string") { + return region; + } + return region(); + }; + return { + setRegion(region) { + runtimeConfigRegion = region; + }, + region() { + return runtimeConfigRegion; + }, + }; }; -exports.fromWebToken = fromWebToken; +exports.getAwsRegionExtensionConfiguration = getAwsRegionExtensionConfiguration; +const resolveAwsRegionExtensionConfiguration = (awsRegionExtensionConfiguration) => { + return { + region: awsRegionExtensionConfiguration.region(), + }; +}; +exports.resolveAwsRegionExtensionConfiguration = resolveAwsRegionExtensionConfiguration; /***/ }), -<<<<<<< HEAD -/***/ 92087: -======= -/***/ 62017: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 61732: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(97436); -tslib_1.__exportStar(__nccwpck_require__(49580), exports); -tslib_1.__exportStar(__nccwpck_require__(46289), exports); -======= -const tslib_1 = __nccwpck_require__(75319); -tslib_1.__exportStar(__nccwpck_require__(13481), exports); -tslib_1.__exportStar(__nccwpck_require__(68715), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(6801), exports); +tslib_1.__exportStar(__nccwpck_require__(87218), exports); /***/ }), -<<<<<<< HEAD -/***/ 97436: -======= -/***/ 75319: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { +/***/ 81467: +/***/ ((__unused_webpack_module, exports) => { -/****************************************************************************** -Copyright (c) Microsoft Corporation. -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NODE_REGION_CONFIG_FILE_OPTIONS = exports.NODE_REGION_CONFIG_OPTIONS = exports.REGION_INI_NAME = exports.REGION_ENV_NAME = void 0; +exports.REGION_ENV_NAME = "AWS_REGION"; +exports.REGION_INI_NAME = "region"; +exports.NODE_REGION_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[exports.REGION_ENV_NAME], + configFileSelector: (profile) => profile[exports.REGION_INI_NAME], + default: () => { + throw new Error("Region is missing"); + }, +}; +exports.NODE_REGION_CONFIG_FILE_OPTIONS = { + preferredFile: "credentials", +}; + -<<<<<<< HEAD -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); -======= /***/ }), -/***/ 78219: +/***/ 42250: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EventStreamCodec = void 0; -const crc32_1 = __nccwpck_require__(51224); -const HeaderMarshaller_1 = __nccwpck_require__(67144); -const splitMessage_1 = __nccwpck_require__(28356); -class EventStreamCodec { - constructor(toUtf8, fromUtf8) { - this.headerMarshaller = new HeaderMarshaller_1.HeaderMarshaller(toUtf8, fromUtf8); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } -<<<<<<< HEAD - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; -======= - formatHeaders(rawHeaders) { - return this.headerMarshaller.format(rawHeaders); - } -} -exports.EventStreamCodec = EventStreamCodec; +exports.getRealRegion = void 0; +const isFipsRegion_1 = __nccwpck_require__(63743); +const getRealRegion = (region) => (0, isFipsRegion_1.isFipsRegion)(region) + ? ["fips-aws-global", "aws-fips"].includes(region) + ? "us-east-1" + : region.replace(/fips-(dkr-|prod-)?|-fips/, "") + : region; +exports.getRealRegion = getRealRegion; /***/ }), -/***/ 67144: +/***/ 87218: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HeaderMarshaller = void 0; -const util_hex_encoding_1 = __nccwpck_require__(34180); -const Int64_1 = __nccwpck_require__(19701); -class HeaderMarshaller { - constructor(toUtf8, fromUtf8) { - this.toUtf8 = toUtf8; - this.fromUtf8 = fromUtf8; - } - format(headers) { - const chunks = []; - for (const headerName of Object.keys(headers)) { - const bytes = this.fromUtf8(headerName); - chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName])); - } - const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0)); - let position = 0; - for (const chunk of chunks) { - out.set(chunk, position); - position += chunk.byteLength; - } - return out; - } - formatHeaderValue(header) { - switch (header.type) { - case "boolean": - return Uint8Array.from([header.value ? 0 : 1]); - case "byte": - return Uint8Array.from([2, header.value]); - case "short": - const shortView = new DataView(new ArrayBuffer(3)); - shortView.setUint8(0, 3); - shortView.setInt16(1, header.value, false); - return new Uint8Array(shortView.buffer); - case "integer": - const intView = new DataView(new ArrayBuffer(5)); - intView.setUint8(0, 4); - intView.setInt32(1, header.value, false); - return new Uint8Array(intView.buffer); - case "long": - const longBytes = new Uint8Array(9); - longBytes[0] = 5; - longBytes.set(header.value.bytes, 1); - return longBytes; - case "binary": - const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength)); - binView.setUint8(0, 6); - binView.setUint16(1, header.value.byteLength, false); - const binBytes = new Uint8Array(binView.buffer); - binBytes.set(header.value, 3); - return binBytes; - case "string": - const utf8Bytes = this.fromUtf8(header.value); - const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength)); - strView.setUint8(0, 7); - strView.setUint16(1, utf8Bytes.byteLength, false); - const strBytes = new Uint8Array(strView.buffer); - strBytes.set(utf8Bytes, 3); - return strBytes; - case "timestamp": - const tsBytes = new Uint8Array(9); - tsBytes[0] = 8; - tsBytes.set(Int64_1.Int64.fromNumber(header.value.valueOf()).bytes, 1); - return tsBytes; - case "uuid": - if (!UUID_PATTERN.test(header.value)) { - throw new Error(`Invalid UUID received: ${header.value}`); - } - const uuidBytes = new Uint8Array(17); - uuidBytes[0] = 9; - uuidBytes.set((0, util_hex_encoding_1.fromHex)(header.value.replace(/\-/g, "")), 1); - return uuidBytes; - } - } - parse(headers) { - const out = {}; - let position = 0; - while (position < headers.byteLength) { - const nameLength = headers.getUint8(position++); - const name = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength)); - position += nameLength; - switch (headers.getUint8(position++)) { - case 0: - out[name] = { - type: BOOLEAN_TAG, - value: true, - }; - break; - case 1: - out[name] = { - type: BOOLEAN_TAG, - value: false, - }; - break; - case 2: - out[name] = { - type: BYTE_TAG, - value: headers.getInt8(position++), - }; - break; - case 3: - out[name] = { - type: SHORT_TAG, - value: headers.getInt16(position, false), - }; - position += 2; - break; - case 4: - out[name] = { - type: INT_TAG, - value: headers.getInt32(position, false), - }; - position += 4; - break; - case 5: - out[name] = { - type: LONG_TAG, - value: new Int64_1.Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)), - }; - position += 8; - break; - case 6: - const binaryLength = headers.getUint16(position, false); - position += 2; - out[name] = { - type: BINARY_TAG, - value: new Uint8Array(headers.buffer, headers.byteOffset + position, binaryLength), - }; - position += binaryLength; - break; - case 7: - const stringLength = headers.getUint16(position, false); - position += 2; - out[name] = { - type: STRING_TAG, - value: this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, stringLength)), - }; - position += stringLength; - break; - case 8: - out[name] = { - type: TIMESTAMP_TAG, - value: new Date(new Int64_1.Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf()), - }; - position += 8; - break; - case 9: - const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16); - position += 16; - out[name] = { - type: UUID_TAG, - value: `${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(0, 4))}-${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(4, 6))}-${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(6, 8))}-${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(8, 10))}-${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(10))}`, - }; - break; - default: - throw new Error(`Unrecognized header type tag`); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - -<<<<<<< HEAD - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -======= - -/***/ }), - -/***/ 19701: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Int64 = void 0; -const util_hex_encoding_1 = __nccwpck_require__(34180); -class Int64 { - constructor(bytes) { - this.bytes = bytes; - if (bytes.byteLength !== 8) { - throw new Error("Int64 buffers must be exactly 8 bytes"); - } - } - static fromNumber(number) { - if (number > 9223372036854776000 || number < -9223372036854776000) { - throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`); - } - const bytes = new Uint8Array(8); - for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) { - bytes[i] = remaining; - } - if (number < 0) { - negate(bytes); - } - return new Int64(bytes); - } - valueOf() { - const bytes = this.bytes.slice(0); - const negative = bytes[0] & 0b10000000; - if (negative) { - negate(bytes); - } - return parseInt((0, util_hex_encoding_1.toHex)(bytes), 16) * (negative ? -1 : 1); - } - toString() { - return String(this.valueOf()); - } -} -exports.Int64 = Int64; -function negate(bytes) { - for (let i = 0; i < 8; i++) { - bytes[i] ^= 0xff; - } - for (let i = 7; i > -1; i--) { - bytes[i]++; - if (bytes[i] !== 0) - break; - } -} +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(81467), exports); +tslib_1.__exportStar(__nccwpck_require__(15637), exports); /***/ }), -/***/ 85118: +/***/ 63743: /***/ ((__unused_webpack_module, exports) => { -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 43474: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(56680); -tslib_1.__exportStar(__nccwpck_require__(78219), exports); -tslib_1.__exportStar(__nccwpck_require__(19701), exports); -tslib_1.__exportStar(__nccwpck_require__(85118), exports); +exports.isFipsRegion = void 0; +const isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")); +exports.isFipsRegion = isFipsRegion; /***/ }), -/***/ 28356: +/***/ 15637: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.splitMessage = void 0; -const crc32_1 = __nccwpck_require__(51224); -const PRELUDE_MEMBER_LENGTH = 4; -const PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2; -const CHECKSUM_LENGTH = 4; -const MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2; -function splitMessage({ byteLength, byteOffset, buffer }) { - if (byteLength < MINIMUM_MESSAGE_LENGTH) { - throw new Error("Provided message too short to accommodate event stream message overhead"); - } - const view = new DataView(buffer, byteOffset, byteLength); - const messageLength = view.getUint32(0, false); - if (byteLength !== messageLength) { - throw new Error("Reported message length does not match received message length"); - } - const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false); - const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false); - const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false); - const checksummer = new crc32_1.Crc32().update(new Uint8Array(buffer, byteOffset, PRELUDE_LENGTH)); - if (expectedPreludeChecksum !== checksummer.digest()) { - throw new Error(`The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digest()})`); - } - checksummer.update(new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH, byteLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH))); - if (expectedMessageChecksum !== checksummer.digest()) { - throw new Error(`The message checksum (${checksummer.digest()}) did not match the expected value of ${expectedMessageChecksum}`); +exports.resolveRegionConfig = void 0; +const getRealRegion_1 = __nccwpck_require__(42250); +const isFipsRegion_1 = __nccwpck_require__(63743); +const resolveRegionConfig = (input) => { + const { region, useFipsEndpoint } = input; + if (!region) { + throw new Error("Region is missing"); } return { - headers: new DataView(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH, headerLength), - body: new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH + headerLength, messageLength - headerLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH + CHECKSUM_LENGTH)), ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - -<<<<<<< HEAD - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; -======= -/***/ 56680: -/***/ ((module) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); + ...input, + region: async () => { + if (typeof region === "string") { + return (0, getRealRegion_1.getRealRegion)(region); } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; + const providedRegion = await region(); + return (0, getRealRegion_1.getRealRegion)(providedRegion); + }, + useFipsEndpoint: async () => { + const providedRegion = typeof region === "string" ? region : await region(); + if ((0, isFipsRegion_1.isFipsRegion)(providedRegion)) { + return true; } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - -<<<<<<< HEAD - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; -======= -/***/ 47793: -/***/ ((__unused_webpack_module, exports) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); + }, }; +}; +exports.resolveRegionConfig = resolveRegionConfig; -<<<<<<< HEAD - __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()); -======= /***/ }), -/***/ 41237: +/***/ 10375: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(58822); -tslib_1.__exportStar(__nccwpck_require__(47793), exports); - - -/***/ }), - -/***/ 58822: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); +exports.SignatureV4MultiRegion = void 0; +const middleware_sdk_s3_1 = __nccwpck_require__(39069); +const signature_v4_crt_container_1 = __nccwpck_require__(28561); +class SignatureV4MultiRegion { + constructor(options) { + this.sigv4Signer = new middleware_sdk_s3_1.SignatureV4S3Express(options); + this.signerOptions = options; } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } + async sign(requestToSign, options = {}) { + if (options.signingRegion === "*") { + if (this.signerOptions.runtime !== "node") + throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js"); + return this.getSigv4aSigner().sign(requestToSign, options); } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + return this.sigv4Signer.sign(requestToSign, options); } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + async signWithCredentials(requestToSign, credentials, options = {}) { + if (options.signingRegion === "*") { + if (this.signerOptions.runtime !== "node") + throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js"); + return this.getSigv4aSigner().signWithCredentials(requestToSign, credentials, options); } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; + return this.sigv4Signer.signWithCredentials(requestToSign, credentials, options); + } + async presign(originalRequest, options = {}) { + if (options.signingRegion === "*") { + if (this.signerOptions.runtime !== "node") + throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js"); + return this.getSigv4aSigner().presign(originalRequest, options); } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + return this.sigv4Signer.presign(originalRequest, options); + } + async presignWithCredentials(originalRequest, credentials, options = {}) { + if (options.signingRegion === "*") { + throw new Error("Method presignWithCredentials is not supported for [signingRegion=*]."); } - catch (error) { e = { error: error }; } - finally { + return this.sigv4Signer.presignWithCredentials(originalRequest, credentials, options); + } + getSigv4aSigner() { + if (!this.sigv4aSigner) { + let CrtSignerV4 = null; try { - if (r && !r.done && (m = i["return"])) m.call(i); + CrtSignerV4 = signature_v4_crt_container_1.signatureV4CrtContainer.CrtSignerV4; + if (typeof CrtSignerV4 !== "function") + throw new Error(); } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; + catch (e) { + e.message = + `${e.message}\n` + + `Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. \n` + + `You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] ` + + `or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. \n` + + "For more information please go to " + + "https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt"; + throw e; } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); - - -/***/ }), - -/***/ 58180: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EventStreamMarshaller = void 0; -const eventstream_serde_universal_1 = __nccwpck_require__(45711); -const stream_1 = __nccwpck_require__(12781); -const utils_1 = __nccwpck_require__(21196); -class EventStreamMarshaller { - constructor({ utf8Encoder, utf8Decoder }) { - this.universalMarshaller = new eventstream_serde_universal_1.EventStreamMarshaller({ - utf8Decoder, - utf8Encoder, ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -<<<<<<< HEAD - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; -======= - else { - const iterator = serializedIterable[Symbol.asyncIterator](); - const serializedStream = new stream_1.Readable({ - autoDestroy: true, - objectMode: true, - async read() { - iterator - .next() - .then(({ done, value }) => { - if (done) { - this.push(null); - } - else { - this.push(value); - } - }) - .catch((err) => { - this.destroy(err); - }); - }, - }); - serializedStream.on("error", () => { - serializedStream.destroy(); - }); - serializedStream.on("end", () => { - serializedStream.destroy(); + this.sigv4aSigner = new CrtSignerV4({ + ...this.signerOptions, + signingAlgorithm: 1, }); - return serializedStream; } + return this.sigv4aSigner; } } -exports.EventStreamMarshaller = EventStreamMarshaller; - - -/***/ }), - -/***/ 97771: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(59638); -tslib_1.__exportStar(__nccwpck_require__(58180), exports); -tslib_1.__exportStar(__nccwpck_require__(38428), exports); +exports.SignatureV4MultiRegion = SignatureV4MultiRegion; /***/ }), -/***/ 38428: +/***/ 43081: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.eventStreamSerdeProvider = void 0; -const EventStreamMarshaller_1 = __nccwpck_require__(58180); -const eventStreamSerdeProvider = (options) => new EventStreamMarshaller_1.EventStreamMarshaller(options); -exports.eventStreamSerdeProvider = eventStreamSerdeProvider; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(10375), exports); +tslib_1.__exportStar(__nccwpck_require__(28561), exports); /***/ }), -/***/ 21196: +/***/ 28561: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.readabletoIterable = void 0; -async function* readabletoIterable(readStream) { - let streamEnded = false; - let generationEnded = false; - const records = new Array(); - readStream.on("error", (err) => { - if (!streamEnded) { - streamEnded = true; - } - if (err) { - throw err; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +exports.signatureV4CrtContainer = void 0; +exports.signatureV4CrtContainer = { + CrtSignerV4: null, +}; -<<<<<<< HEAD - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; -======= /***/ }), -/***/ 59638: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +/***/ 10264: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.UnsupportedGrantTypeException = exports.UnauthorizedClientException = exports.SlowDownException = exports.SSOOIDCClient = exports.InvalidScopeException = exports.InvalidRequestException = exports.InvalidClientException = exports.InternalServerException = exports.ExpiredTokenException = exports.CreateTokenCommand = exports.AuthorizationPendingException = exports.AccessDeniedException = void 0; +const middleware_host_header_1 = __nccwpck_require__(29368); +const middleware_logger_1 = __nccwpck_require__(11810); +const middleware_recursion_detection_1 = __nccwpck_require__(65185); +const middleware_user_agent_1 = __nccwpck_require__(7524); +const config_resolver_1 = __nccwpck_require__(36407); +const middleware_content_length_1 = __nccwpck_require__(48468); +const middleware_endpoint_1 = __nccwpck_require__(9848); +const middleware_retry_1 = __nccwpck_require__(73739); +const smithy_client_1 = __nccwpck_require__(42584); +var resolveClientEndpointParameters = (options) => { + var _a, _b; + return { + ...options, + useDualstackEndpoint: (_a = options.useDualstackEndpoint) !== null && _a !== void 0 ? _a : false, + useFipsEndpoint: (_b = options.useFipsEndpoint) !== null && _b !== void 0 ? _b : false, + defaultSigningName: "awsssooidc", }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +}; +var package_default = { version: "3.429.0" }; +const util_user_agent_node_1 = __nccwpck_require__(22004); +const config_resolver_2 = __nccwpck_require__(36407); +const hash_node_1 = __nccwpck_require__(3127); +const middleware_retry_2 = __nccwpck_require__(73739); +const node_config_provider_1 = __nccwpck_require__(86711); +const node_http_handler_1 = __nccwpck_require__(48195); +const util_body_length_node_1 = __nccwpck_require__(92711); +const util_retry_1 = __nccwpck_require__(20774); +const smithy_client_2 = __nccwpck_require__(42584); +const url_parser_1 = __nccwpck_require__(45013); +const util_base64_1 = __nccwpck_require__(74339); +const util_utf8_1 = __nccwpck_require__(97788); +const util_endpoints_1 = __nccwpck_require__(34863); +var s = "required"; +var t = "fn"; +var u = "argv"; +var v = "ref"; +var a = "isSet"; +var b = "tree"; +var c = "error"; +var d = "endpoint"; +var e = "PartitionResult"; +var f = "getAttr"; +var g = { [s]: false, type: "String" }; +var h = { [s]: true, default: false, type: "Boolean" }; +var i = { [v]: "Endpoint" }; +var j = { [t]: "booleanEquals", [u]: [{ [v]: "UseFIPS" }, true] }; +var k = { [t]: "booleanEquals", [u]: [{ [v]: "UseDualStack" }, true] }; +var l = {}; +var m = { [t]: "booleanEquals", [u]: [true, { [t]: f, [u]: [{ [v]: e }, "supportsFIPS"] }] }; +var n = { [v]: e }; +var o = { [t]: "booleanEquals", [u]: [true, { [t]: f, [u]: [n, "supportsDualStack"] }] }; +var p = [j]; +var q = [k]; +var r = [{ [v]: "Region" }]; +var _data = { + version: "1.0", + parameters: { Region: g, UseDualStack: h, UseFIPS: h, Endpoint: g }, + rules: [ + { + conditions: [{ [t]: a, [u]: [i] }], + type: b, + rules: [ + { conditions: p, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, + { conditions: q, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, + { endpoint: { url: i, properties: l, headers: l }, type: d }, + ], + }, + { + conditions: [{ [t]: a, [u]: r }], + type: b, + rules: [ + { + conditions: [{ [t]: "aws.partition", [u]: r, assign: e }], + type: b, + rules: [ + { + conditions: [j, k], + type: b, + rules: [ + { + conditions: [m, o], + type: b, + rules: [ + { + endpoint: { + url: "https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + properties: l, + headers: l, + }, + type: d, + }, + ], + }, + { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: c }, + ], + }, + { + conditions: p, + type: b, + rules: [ + { + conditions: [m], + type: b, + rules: [ + { + conditions: [{ [t]: "stringEquals", [u]: ["aws-us-gov", { [t]: f, [u]: [n, "name"] }] }], + endpoint: { url: "https://oidc.{Region}.amazonaws.com", properties: l, headers: l }, + type: d, + }, + { + endpoint: { + url: "https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}", + properties: l, + headers: l, + }, + type: d, + }, + ], + }, + { error: "FIPS is enabled but this partition does not support FIPS", type: c }, + ], + }, + { + conditions: q, + type: b, + rules: [ + { + conditions: [o], + type: b, + rules: [ + { + endpoint: { + url: "https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}", + properties: l, + headers: l, + }, + type: d, + }, + ], + }, + { error: "DualStack is enabled but this partition does not support DualStack", type: c }, + ], + }, + { + endpoint: { url: "https://oidc.{Region}.{PartitionResult#dnsSuffix}", properties: l, headers: l }, + type: d, + }, + ], + }, + ], + }, + { error: "Invalid Configuration: Missing Region", type: c }, + ], +}; +var ruleSet = _data; +var defaultEndpointResolver = (endpointParams, context = {}) => { + return (0, util_endpoints_1.resolveEndpoint)(ruleSet, { + endpointParams, + logger: context.logger, + }); +}; +var getRuntimeConfig = (config) => { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; + return ({ + apiVersion: "2019-06-10", + base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : util_base64_1.fromBase64, + base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : util_base64_1.toBase64, + disableHostPrefix: (_c = config === null || config === void 0 ? void 0 : config.disableHostPrefix) !== null && _c !== void 0 ? _c : false, + endpointProvider: (_d = config === null || config === void 0 ? void 0 : config.endpointProvider) !== null && _d !== void 0 ? _d : defaultEndpointResolver, + extensions: (_e = config === null || config === void 0 ? void 0 : config.extensions) !== null && _e !== void 0 ? _e : [], + logger: (_f = config === null || config === void 0 ? void 0 : config.logger) !== null && _f !== void 0 ? _f : new smithy_client_2.NoOpLogger(), + serviceId: (_g = config === null || config === void 0 ? void 0 : config.serviceId) !== null && _g !== void 0 ? _g : "SSO OIDC", + urlParser: (_h = config === null || config === void 0 ? void 0 : config.urlParser) !== null && _h !== void 0 ? _h : url_parser_1.parseUrl, + utf8Decoder: (_j = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _j !== void 0 ? _j : util_utf8_1.fromUtf8, + utf8Encoder: (_k = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _k !== void 0 ? _k : util_utf8_1.toUtf8, + }); +}; +const smithy_client_3 = __nccwpck_require__(42584); +const util_defaults_mode_node_1 = __nccwpck_require__(3147); +const smithy_client_4 = __nccwpck_require__(42584); +var getRuntimeConfig2 = (config) => { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; + (0, smithy_client_4.emitWarningIfUnsupportedVersion)(process.version); + const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); + const defaultConfigProvider = () => defaultsMode().then(smithy_client_3.loadConfigsForDefaultMode); + const clientSharedValues = getRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + bodyLengthChecker: (_a = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _a !== void 0 ? _a : util_body_length_node_1.calculateBodyLength, + defaultUserAgentProvider: (_b = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _b !== void 0 ? _b : (0, util_user_agent_node_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_default.version }), + maxAttempts: (_c = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _c !== void 0 ? _c : (0, node_config_provider_1.loadConfig)(middleware_retry_2.NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: (_d = config === null || config === void 0 ? void 0 : config.region) !== null && _d !== void 0 ? _d : (0, node_config_provider_1.loadConfig)(config_resolver_2.NODE_REGION_CONFIG_OPTIONS, config_resolver_2.NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: (_e = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _e !== void 0 ? _e : new node_http_handler_1.NodeHttpHandler(defaultConfigProvider), + retryMode: (_f = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _f !== void 0 ? _f : (0, node_config_provider_1.loadConfig)({ + ...middleware_retry_2.NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE, + }), + sha256: (_g = config === null || config === void 0 ? void 0 : config.sha256) !== null && _g !== void 0 ? _g : hash_node_1.Hash.bind(null, "sha256"), + streamCollector: (_h = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _h !== void 0 ? _h : node_http_handler_1.streamCollector, + useDualstackEndpoint: (_j = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _j !== void 0 ? _j : (0, node_config_provider_1.loadConfig)(config_resolver_2.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), + useFipsEndpoint: (_k = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _k !== void 0 ? _k : (0, node_config_provider_1.loadConfig)(config_resolver_2.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +}; +const region_config_resolver_1 = __nccwpck_require__(61732); +const protocol_http_1 = __nccwpck_require__(76232); +const smithy_client_5 = __nccwpck_require__(42584); +var asPartial = (t2) => t2; +var resolveRuntimeExtensions = (runtimeConfig, extensions) => { + const extensionConfiguration = { + ...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)), + ...asPartial((0, smithy_client_5.getDefaultExtensionConfiguration)(runtimeConfig)), + ...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)), }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + return { + ...runtimeConfig, + ...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), + ...(0, smithy_client_5.resolveDefaultRuntimeConfig)(extensionConfiguration), + ...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); - - -/***/ }), - -/***/ 58060: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EventStreamMarshaller = void 0; -const eventstream_codec_1 = __nccwpck_require__(43474); -const getChunkedStream_1 = __nccwpck_require__(14034); -const getUnmarshalledStream_1 = __nccwpck_require__(51761); -class EventStreamMarshaller { - constructor({ utf8Encoder, utf8Decoder }) { - this.eventStreamCodec = new eventstream_codec_1.EventStreamCodec(utf8Encoder, utf8Decoder); - this.utfEncoder = utf8Encoder; +}; +var SSOOIDCClient = class extends smithy_client_1.Client { + constructor(...[configuration]) { + const _config_0 = getRuntimeConfig2(configuration || {}); + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = (0, config_resolver_1.resolveRegionConfig)(_config_1); + const _config_3 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_2); + const _config_4 = (0, middleware_retry_1.resolveRetryConfig)(_config_3); + const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4); + const _config_6 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_5); + const _config_7 = resolveRuntimeExtensions(_config_6, (configuration === null || configuration === void 0 ? void 0 : configuration.extensions) || []); + super(_config_7); + this.config = _config_7; + this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config)); + this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config)); + this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config)); + this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config)); + this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config)); + this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config)); } - deserialize(body, deserializer) { - const chunkedStream = (0, getChunkedStream_1.getChunkedStream)(body); - const unmarshalledStream = (0, getUnmarshalledStream_1.getUnmarshalledStream)(chunkedStream, { - eventStreamCodec: this.eventStreamCodec, - deserializer, - toUtf8: this.utfEncoder, - }); - return unmarshalledStream; + destroy() { + super.destroy(); } - serialize(input, serializer) { - const self = this; - const serializedIterator = async function* () { - for await (const chunk of input) { - const payloadBuf = self.eventStreamCodec.encode(serializer(chunk)); - yield payloadBuf; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - }; -<<<<<<< HEAD - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -======= - return { - [Symbol.asyncIterator]: serializedIterator, - }; +}; +exports.SSOOIDCClient = SSOOIDCClient; +const smithy_client_6 = __nccwpck_require__(42584); +const middleware_endpoint_2 = __nccwpck_require__(9848); +const middleware_serde_1 = __nccwpck_require__(44036); +const smithy_client_7 = __nccwpck_require__(42584); +const types_1 = __nccwpck_require__(21438); +const protocol_http_2 = __nccwpck_require__(76232); +const smithy_client_8 = __nccwpck_require__(42584); +const smithy_client_9 = __nccwpck_require__(42584); +var SSOOIDCServiceException = class _SSOOIDCServiceException extends smithy_client_9.ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, _SSOOIDCServiceException.prototype); } -} -exports.EventStreamMarshaller = EventStreamMarshaller; - - -/***/ }), - -/***/ 14034: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getChunkedStream = void 0; -function getChunkedStream(source) { - let currentMessageTotalLength = 0; - let currentMessagePendingLength = 0; - let currentMessage = null; - let messageLengthBuffer = null; - const allocateMessage = (size) => { - if (typeof size !== "number") { - throw new Error("Attempted to allocate an event message where size was not a number: " + size); - } - currentMessageTotalLength = size; - currentMessagePendingLength = 4; - currentMessage = new Uint8Array(size); - const currentMessageView = new DataView(currentMessage.buffer); - currentMessageView.setUint32(0, size, false); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - }; - -<<<<<<< HEAD - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; -======= - -/***/ }), - -/***/ 51761: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getUnmarshalledStream = void 0; -function getUnmarshalledStream(source, options) { - return { - [Symbol.asyncIterator]: async function* () { - for await (const chunk of source) { - const message = options.eventStreamCodec.decode(chunk); - const { value: messageType } = message.headers[":message-type"]; - if (messageType === "error") { - const unmodeledError = new Error(message.headers[":error-message"].value || "UnknownError"); - unmodeledError.name = message.headers[":error-code"].value; - throw unmodeledError; - } - else if (messageType === "exception") { - const code = message.headers[":exception-type"].value; - const exception = { [code]: message }; - const deserializedException = await options.deserializer(exception); - if (deserializedException.$unknown) { - const error = new Error(options.toUtf8(message.body)); - error.name = code; - throw error; - } - throw deserializedException[code]; - } - else if (messageType === "event") { - const event = { - [message.headers[":event-type"].value]: message, - }; - const deserialized = await options.deserializer(event); - if (deserialized.$unknown) - continue; - yield deserialized; - } - else { - throw Error(`Unrecognizable event type: ${message.headers[":event-type"].value}`); - } - } - }, - }; -} -exports.getUnmarshalledStream = getUnmarshalledStream; - - -/***/ }), - -/***/ 45711: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(55098); -tslib_1.__exportStar(__nccwpck_require__(58060), exports); -tslib_1.__exportStar(__nccwpck_require__(24059), exports); - - -/***/ }), - -/***/ 24059: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.eventStreamSerdeProvider = void 0; -const EventStreamMarshaller_1 = __nccwpck_require__(58060); -const eventStreamSerdeProvider = (options) => new EventStreamMarshaller_1.EventStreamMarshaller(options); -exports.eventStreamSerdeProvider = eventStreamSerdeProvider; - - -/***/ }), - -/***/ 55098: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); +}; +var AccessDeniedException = class _AccessDeniedException extends SSOOIDCServiceException { + constructor(opts) { + super({ + name: "AccessDeniedException", + $fault: "client", + ...opts, + }); + this.name = "AccessDeniedException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _AccessDeniedException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); +}; +exports.AccessDeniedException = AccessDeniedException; +var AuthorizationPendingException = class _AuthorizationPendingException extends SSOOIDCServiceException { + constructor(opts) { + super({ + name: "AuthorizationPendingException", + $fault: "client", + ...opts, + }); + this.name = "AuthorizationPendingException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _AuthorizationPendingException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; } - else { - factory(createExporter(root)); +}; +exports.AuthorizationPendingException = AuthorizationPendingException; +var ExpiredTokenException = class _ExpiredTokenException extends SSOOIDCServiceException { + constructor(opts) { + super({ + name: "ExpiredTokenException", + $fault: "client", + ...opts, + }); + this.name = "ExpiredTokenException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _ExpiredTokenException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; +}; +exports.ExpiredTokenException = ExpiredTokenException; +var InternalServerException = class _InternalServerException extends SSOOIDCServiceException { + constructor(opts) { + super({ + name: "InternalServerException", + $fault: "server", + ...opts, + }); + this.name = "InternalServerException"; + this.$fault = "server"; + Object.setPrototypeOf(this, _InternalServerException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); +}; +exports.InternalServerException = InternalServerException; +var InvalidClientException = class _InvalidClientException extends SSOOIDCServiceException { + constructor(opts) { + super({ + name: "InvalidClientException", + $fault: "client", + ...opts, }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); - - -/***/ }), - -/***/ 5541: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Hash = void 0; -const util_buffer_from_1 = __nccwpck_require__(87048); -const buffer_1 = __nccwpck_require__(14300); -const crypto_1 = __nccwpck_require__(6113); -class Hash { - constructor(algorithmIdentifier, secret) { - this.hash = secret ? (0, crypto_1.createHmac)(algorithmIdentifier, castSourceData(secret)) : (0, crypto_1.createHash)(algorithmIdentifier); + this.name = "InvalidClientException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidClientException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; } - update(toHash, encoding) { - this.hash.update(castSourceData(toHash, encoding)); +}; +exports.InvalidClientException = InvalidClientException; +var InvalidGrantException = class _InvalidGrantException extends SSOOIDCServiceException { + constructor(opts) { + super({ + name: "InvalidGrantException", + $fault: "client", + ...opts, + }); + this.name = "InvalidGrantException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidGrantException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; } - digest() { - return Promise.resolve(this.hash.digest()); +}; +var InvalidRequestException = class _InvalidRequestException extends SSOOIDCServiceException { + constructor(opts) { + super({ + name: "InvalidRequestException", + $fault: "client", + ...opts, + }); + this.name = "InvalidRequestException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidRequestException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; } -} -exports.Hash = Hash; -function castSourceData(toCast, encoding) { - if (buffer_1.Buffer.isBuffer(toCast)) { - return toCast; +}; +exports.InvalidRequestException = InvalidRequestException; +var InvalidScopeException = class _InvalidScopeException extends SSOOIDCServiceException { + constructor(opts) { + super({ + name: "InvalidScopeException", + $fault: "client", + ...opts, + }); + this.name = "InvalidScopeException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidScopeException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; } - if (typeof toCast === "string") { - return (0, util_buffer_from_1.fromString)(toCast, encoding); +}; +exports.InvalidScopeException = InvalidScopeException; +var SlowDownException = class _SlowDownException extends SSOOIDCServiceException { + constructor(opts) { + super({ + name: "SlowDownException", + $fault: "client", + ...opts, + }); + this.name = "SlowDownException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _SlowDownException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; } - if (ArrayBuffer.isView(toCast)) { - return (0, util_buffer_from_1.fromArrayBuffer)(toCast.buffer, toCast.byteOffset, toCast.byteLength); +}; +exports.SlowDownException = SlowDownException; +var UnauthorizedClientException = class _UnauthorizedClientException extends SSOOIDCServiceException { + constructor(opts) { + super({ + name: "UnauthorizedClientException", + $fault: "client", + ...opts, + }); + this.name = "UnauthorizedClientException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _UnauthorizedClientException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; } - return (0, util_buffer_from_1.fromArrayBuffer)(toCast); -} - - -/***/ }), - -/***/ 79087: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HashCalculator = void 0; -const stream_1 = __nccwpck_require__(12781); -class HashCalculator extends stream_1.Writable { - constructor(hash, options) { - super(options); - this.hash = hash; +}; +exports.UnauthorizedClientException = UnauthorizedClientException; +var UnsupportedGrantTypeException = class _UnsupportedGrantTypeException extends SSOOIDCServiceException { + constructor(opts) { + super({ + name: "UnsupportedGrantTypeException", + $fault: "client", + ...opts, + }); + this.name = "UnsupportedGrantTypeException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _UnsupportedGrantTypeException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; } - _write(chunk, encoding, callback) { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; +}; +exports.UnsupportedGrantTypeException = UnsupportedGrantTypeException; +var InvalidClientMetadataException = class _InvalidClientMetadataException extends SSOOIDCServiceException { + constructor(opts) { + super({ + name: "InvalidClientMetadataException", + $fault: "client", + ...opts, + }); + this.name = "InvalidClientMetadataException"; + this.$fault = "client"; + Object.setPrototypeOf(this, _InvalidClientMetadataException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } +}; +var se_CreateTokenCommand = async (input, context) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers = { + "content-type": "application/json", }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; + const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}/token`; + let body; + body = JSON.stringify((0, smithy_client_8.take)(input, { + clientId: [], + clientSecret: [], + code: [], + deviceCode: [], + grantType: [], + redirectUri: [], + refreshToken: [], + scope: (_) => (0, smithy_client_8._json)(_), + })); + return new protocol_http_2.HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; +var se_RegisterClientCommand = async (input, context) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers = { + "content-type": "application/json", }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; + const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}/client/register`; + let body; + body = JSON.stringify((0, smithy_client_8.take)(input, { + clientName: [], + clientType: [], + scopes: (_) => (0, smithy_client_8._json)(_), + })); + return new protocol_http_2.HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; +var se_StartDeviceAuthorizationCommand = async (input, context) => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers = { + "content-type": "application/json", }; - -<<<<<<< HEAD - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); + const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}/device_authorization`; + let body; + body = JSON.stringify((0, smithy_client_8.take)(input, { + clientId: [], + clientSecret: [], + startUrl: [], + })); + return new protocol_http_2.HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; +var de_CreateTokenCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CreateTokenCommandError(output, context); + } + const contents = (0, smithy_client_8.map)({ + $metadata: deserializeMetadata(output), + }); + const data = (0, smithy_client_8.expectNonNull)((0, smithy_client_8.expectObject)(await parseBody(output.body, context)), "body"); + const doc = (0, smithy_client_8.take)(data, { + accessToken: smithy_client_8.expectString, + expiresIn: smithy_client_8.expectInt32, + idToken: smithy_client_8.expectString, + refreshToken: smithy_client_8.expectString, + tokenType: smithy_client_8.expectString, + }); + Object.assign(contents, doc); + return contents; +}; +var de_CreateTokenCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), }; -======= -/***/ 76896: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.ssooidc#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "AuthorizationPendingException": + case "com.amazonaws.ssooidc#AuthorizationPendingException": + throw await de_AuthorizationPendingExceptionRes(parsedOutput, context); + case "ExpiredTokenException": + case "com.amazonaws.ssooidc#ExpiredTokenException": + throw await de_ExpiredTokenExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.ssooidc#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "InvalidClientException": + case "com.amazonaws.ssooidc#InvalidClientException": + throw await de_InvalidClientExceptionRes(parsedOutput, context); + case "InvalidGrantException": + case "com.amazonaws.ssooidc#InvalidGrantException": + throw await de_InvalidGrantExceptionRes(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.ssooidc#InvalidRequestException": + throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "InvalidScopeException": + case "com.amazonaws.ssooidc#InvalidScopeException": + throw await de_InvalidScopeExceptionRes(parsedOutput, context); + case "SlowDownException": + case "com.amazonaws.ssooidc#SlowDownException": + throw await de_SlowDownExceptionRes(parsedOutput, context); + case "UnauthorizedClientException": + case "com.amazonaws.ssooidc#UnauthorizedClientException": + throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); + case "UnsupportedGrantTypeException": + case "com.amazonaws.ssooidc#UnsupportedGrantTypeException": + throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; +var de_RegisterClientCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_RegisterClientCommandError(output, context); + } + const contents = (0, smithy_client_8.map)({ + $metadata: deserializeMetadata(output), + }); + const data = (0, smithy_client_8.expectNonNull)((0, smithy_client_8.expectObject)(await parseBody(output.body, context)), "body"); + const doc = (0, smithy_client_8.take)(data, { + authorizationEndpoint: smithy_client_8.expectString, + clientId: smithy_client_8.expectString, + clientIdIssuedAt: smithy_client_8.expectLong, + clientSecret: smithy_client_8.expectString, + clientSecretExpiresAt: smithy_client_8.expectLong, + tokenEndpoint: smithy_client_8.expectString, + }); + Object.assign(contents, doc); + return contents; +}; +var de_RegisterClientCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), }; - -<<<<<<< HEAD - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.ssooidc#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "InvalidClientMetadataException": + case "com.amazonaws.ssooidc#InvalidClientMetadataException": + throw await de_InvalidClientMetadataExceptionRes(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.ssooidc#InvalidRequestException": + throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "InvalidScopeException": + case "com.amazonaws.ssooidc#InvalidScopeException": + throw await de_InvalidScopeExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; +var de_StartDeviceAuthorizationCommand = async (output, context) => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_StartDeviceAuthorizationCommandError(output, context); + } + const contents = (0, smithy_client_8.map)({ + $metadata: deserializeMetadata(output), + }); + const data = (0, smithy_client_8.expectNonNull)((0, smithy_client_8.expectObject)(await parseBody(output.body, context)), "body"); + const doc = (0, smithy_client_8.take)(data, { + deviceCode: smithy_client_8.expectString, + expiresIn: smithy_client_8.expectInt32, + interval: smithy_client_8.expectInt32, + userCode: smithy_client_8.expectString, + verificationUri: smithy_client_8.expectString, + verificationUriComplete: smithy_client_8.expectString, + }); + Object.assign(contents, doc); + return contents; +}; +var de_StartDeviceAuthorizationCommandError = async (output, context) => { + const parsedOutput = { + ...output, + body: await parseErrorBody(output.body, context), }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.ssooidc#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "InvalidClientException": + case "com.amazonaws.ssooidc#InvalidClientException": + throw await de_InvalidClientExceptionRes(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.ssooidc#InvalidRequestException": + throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "SlowDownException": + case "com.amazonaws.ssooidc#SlowDownException": + throw await de_SlowDownExceptionRes(parsedOutput, context); + case "UnauthorizedClientException": + case "com.amazonaws.ssooidc#UnauthorizedClientException": + throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; +var throwDefaultError = (0, smithy_client_8.withBaseException)(SSOOIDCServiceException); +var de_AccessDeniedExceptionRes = async (parsedOutput, context) => { + const contents = (0, smithy_client_8.map)({}); + const data = parsedOutput.body; + const doc = (0, smithy_client_8.take)(data, { + error: smithy_client_8.expectString, + error_description: smithy_client_8.expectString, + }); + Object.assign(contents, doc); + const exception = new AccessDeniedException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); +}; +var de_AuthorizationPendingExceptionRes = async (parsedOutput, context) => { + const contents = (0, smithy_client_8.map)({}); + const data = parsedOutput.body; + const doc = (0, smithy_client_8.take)(data, { + error: smithy_client_8.expectString, + error_description: smithy_client_8.expectString, + }); + Object.assign(contents, doc); + const exception = new AuthorizationPendingException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); +}; +var de_ExpiredTokenExceptionRes = async (parsedOutput, context) => { + const contents = (0, smithy_client_8.map)({}); + const data = parsedOutput.body; + const doc = (0, smithy_client_8.take)(data, { + error: smithy_client_8.expectString, + error_description: smithy_client_8.expectString, + }); + Object.assign(contents, doc); + const exception = new ExpiredTokenException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); +}; +var de_InternalServerExceptionRes = async (parsedOutput, context) => { + const contents = (0, smithy_client_8.map)({}); + const data = parsedOutput.body; + const doc = (0, smithy_client_8.take)(data, { + error: smithy_client_8.expectString, + error_description: smithy_client_8.expectString, + }); + Object.assign(contents, doc); + const exception = new InternalServerException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); +}; +var de_InvalidClientExceptionRes = async (parsedOutput, context) => { + const contents = (0, smithy_client_8.map)({}); + const data = parsedOutput.body; + const doc = (0, smithy_client_8.take)(data, { + error: smithy_client_8.expectString, + error_description: smithy_client_8.expectString, + }); + Object.assign(contents, doc); + const exception = new InvalidClientException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); +}; +var de_InvalidClientMetadataExceptionRes = async (parsedOutput, context) => { + const contents = (0, smithy_client_8.map)({}); + const data = parsedOutput.body; + const doc = (0, smithy_client_8.take)(data, { + error: smithy_client_8.expectString, + error_description: smithy_client_8.expectString, + }); + Object.assign(contents, doc); + const exception = new InvalidClientMetadataException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); +}; +var de_InvalidGrantExceptionRes = async (parsedOutput, context) => { + const contents = (0, smithy_client_8.map)({}); + const data = parsedOutput.body; + const doc = (0, smithy_client_8.take)(data, { + error: smithy_client_8.expectString, + error_description: smithy_client_8.expectString, + }); + Object.assign(contents, doc); + const exception = new InvalidGrantException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); +}; +var de_InvalidRequestExceptionRes = async (parsedOutput, context) => { + const contents = (0, smithy_client_8.map)({}); + const data = parsedOutput.body; + const doc = (0, smithy_client_8.take)(data, { + error: smithy_client_8.expectString, + error_description: smithy_client_8.expectString, + }); + Object.assign(contents, doc); + const exception = new InvalidRequestException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); +}; +var de_InvalidScopeExceptionRes = async (parsedOutput, context) => { + const contents = (0, smithy_client_8.map)({}); + const data = parsedOutput.body; + const doc = (0, smithy_client_8.take)(data, { + error: smithy_client_8.expectString, + error_description: smithy_client_8.expectString, + }); + Object.assign(contents, doc); + const exception = new InvalidScopeException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); +}; +var de_SlowDownExceptionRes = async (parsedOutput, context) => { + const contents = (0, smithy_client_8.map)({}); + const data = parsedOutput.body; + const doc = (0, smithy_client_8.take)(data, { + error: smithy_client_8.expectString, + error_description: smithy_client_8.expectString, + }); + Object.assign(contents, doc); + const exception = new SlowDownException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); +}; +var de_UnauthorizedClientExceptionRes = async (parsedOutput, context) => { + const contents = (0, smithy_client_8.map)({}); + const data = parsedOutput.body; + const doc = (0, smithy_client_8.take)(data, { + error: smithy_client_8.expectString, + error_description: smithy_client_8.expectString, + }); + Object.assign(contents, doc); + const exception = new UnauthorizedClientException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); +}; +var de_UnsupportedGrantTypeExceptionRes = async (parsedOutput, context) => { + const contents = (0, smithy_client_8.map)({}); + const data = parsedOutput.body; + const doc = (0, smithy_client_8.take)(data, { + error: smithy_client_8.expectString, + error_description: smithy_client_8.expectString, + }); + Object.assign(contents, doc); + const exception = new UnsupportedGrantTypeException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); +}; +var deserializeMetadata = (output) => { + var _a, _b; + return ({ + httpStatusCode: output.statusCode, + requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], + }); +}; +var collectBodyString = (streamBody, context) => (0, smithy_client_8.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)); +var parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + return JSON.parse(encoded); + } + return {}; +}); +var parseErrorBody = async (errorBody, context) => { + var _a; + const value = await parseBody(errorBody, context); + value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message; + return value; +}; +var loadRestJsonErrorCode = (output, data) => { + const findKey = (object, key) => Object.keys(object).find((k2) => k2.toLowerCase() === key.toLowerCase()); + const sanitizeErrorCode = (rawValue) => { + let cleanValue = rawValue; + if (typeof cleanValue === "number") { + cleanValue = cleanValue.toString(); + } + if (cleanValue.indexOf(",") >= 0) { + cleanValue = cleanValue.split(",")[0]; + } + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; }; + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== void 0) { + return sanitizeErrorCode(output.headers[headerKey]); + } + if (data.code !== void 0) { + return sanitizeErrorCode(data.code); + } + if (data["__type"] !== void 0) { + return sanitizeErrorCode(data["__type"]); + } +}; +var CreateTokenCommand = class _CreateTokenCommand extends smithy_client_7.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_2.getEndpointPlugin)(configuration, _CreateTokenCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "SSOOIDCClient"; + const commandName = "CreateTokenCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_) => _, + outputFilterSensitiveLog: (_) => _, + [types_1.SMITHY_CONTEXT_KEY]: { + service: "AWSSSOOIDCService", + operation: "CreateToken", + }, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return se_CreateTokenCommand(input, context); + } + deserialize(output, context) { + return de_CreateTokenCommand(output, context); + } +}; +exports.CreateTokenCommand = CreateTokenCommand; +const middleware_endpoint_3 = __nccwpck_require__(9848); +const middleware_serde_2 = __nccwpck_require__(44036); +const smithy_client_10 = __nccwpck_require__(42584); +const types_2 = __nccwpck_require__(21438); +var RegisterClientCommand = class _RegisterClientCommand extends smithy_client_10.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_2.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_3.getEndpointPlugin)(configuration, _RegisterClientCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "SSOOIDCClient"; + const commandName = "RegisterClientCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_) => _, + outputFilterSensitiveLog: (_) => _, + [types_2.SMITHY_CONTEXT_KEY]: { + service: "AWSSSOOIDCService", + operation: "RegisterClient", + }, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return se_RegisterClientCommand(input, context); + } + deserialize(output, context) { + return de_RegisterClientCommand(output, context); + } +}; +const middleware_endpoint_4 = __nccwpck_require__(9848); +const middleware_serde_3 = __nccwpck_require__(44036); +const smithy_client_11 = __nccwpck_require__(42584); +const types_3 = __nccwpck_require__(21438); +var StartDeviceAuthorizationCommand = class _StartDeviceAuthorizationCommand extends smithy_client_11.Command { + constructor(input) { + super(); + this.input = input; + } + static getEndpointParameterInstructions() { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + resolveMiddleware(clientStack, configuration, options) { + this.middlewareStack.use((0, middleware_serde_3.getSerdePlugin)(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use((0, middleware_endpoint_4.getEndpointPlugin)(configuration, _StartDeviceAuthorizationCommand.getEndpointParameterInstructions())); + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const clientName = "SSOOIDCClient"; + const commandName = "StartDeviceAuthorizationCommand"; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_) => _, + outputFilterSensitiveLog: (_) => _, + [types_3.SMITHY_CONTEXT_KEY]: { + service: "AWSSSOOIDCService", + operation: "StartDeviceAuthorization", + }, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + serialize(input, context) { + return se_StartDeviceAuthorizationCommand(input, context); + } + deserialize(output, context) { + return de_StartDeviceAuthorizationCommand(output, context); + } +}; +var commands = { + CreateTokenCommand, + RegisterClientCommand, + StartDeviceAuthorizationCommand, +}; +var SSOOIDC = class extends SSOOIDCClient { +}; +(0, smithy_client_6.createAggregatedClient)(commands, SSOOIDC); - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +/***/ }), - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; +/***/ 75741: +/***/ ((__unused_webpack_module, exports) => { - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.REFRESH_MESSAGE = exports.EXPIRE_WINDOW_MS = void 0; +exports.EXPIRE_WINDOW_MS = 5 * 60 * 1000; +exports.REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`; - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +/***/ }), - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; +/***/ 13257: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fromSso = void 0; +const property_provider_1 = __nccwpck_require__(60846); +const shared_ini_file_loader_1 = __nccwpck_require__(53013); +const constants_1 = __nccwpck_require__(75741); +const getNewSsoOidcToken_1 = __nccwpck_require__(78289); +const validateTokenExpiry_1 = __nccwpck_require__(15014); +const validateTokenKey_1 = __nccwpck_require__(8077); +const writeSSOTokenToFile_1 = __nccwpck_require__(53739); +const lastRefreshAttemptTime = new Date(0); +const fromSso = (init = {}) => async () => { + const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init); + const profileName = (0, shared_ini_file_loader_1.getProfileName)(init); + const profile = profiles[profileName]; + if (!profile) { + throw new property_provider_1.TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false); + } + else if (!profile["sso_session"]) { + throw new property_provider_1.TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`); + } + const ssoSessionName = profile["sso_session"]; + const ssoSessions = await (0, shared_ini_file_loader_1.loadSsoSessionData)(init); + const ssoSession = ssoSessions[ssoSessionName]; + if (!ssoSession) { + throw new property_provider_1.TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false); + } + for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) { + if (!ssoSession[ssoSessionRequiredKey]) { + throw new property_provider_1.TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false); } - else if (async) { - env.stack.push({ async: true }); + } + const ssoStartUrl = ssoSession["sso_start_url"]; + const ssoRegion = ssoSession["sso_region"]; + let ssoToken; + try { + ssoToken = await (0, shared_ini_file_loader_1.getSSOTokenFromFile)(ssoSessionName); + } + catch (e) { + throw new property_provider_1.TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${constants_1.REFRESH_MESSAGE}`, false); + } + (0, validateTokenKey_1.validateTokenKey)("accessToken", ssoToken.accessToken); + (0, validateTokenKey_1.validateTokenKey)("expiresAt", ssoToken.expiresAt); + const { accessToken, expiresAt } = ssoToken; + const existingToken = { token: accessToken, expiration: new Date(expiresAt) }; + if (existingToken.expiration.getTime() - Date.now() > constants_1.EXPIRE_WINDOW_MS) { + return existingToken; + } + if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1000) { + (0, validateTokenExpiry_1.validateTokenExpiry)(existingToken); + return existingToken; + } + (0, validateTokenKey_1.validateTokenKey)("clientId", ssoToken.clientId, true); + (0, validateTokenKey_1.validateTokenKey)("clientSecret", ssoToken.clientSecret, true); + (0, validateTokenKey_1.validateTokenKey)("refreshToken", ssoToken.refreshToken, true); + try { + lastRefreshAttemptTime.setTime(Date.now()); + const newSsoOidcToken = await (0, getNewSsoOidcToken_1.getNewSsoOidcToken)(ssoToken, ssoRegion); + (0, validateTokenKey_1.validateTokenKey)("accessToken", newSsoOidcToken.accessToken); + (0, validateTokenKey_1.validateTokenKey)("expiresIn", newSsoOidcToken.expiresIn); + const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1000); + try { + await (0, writeSSOTokenToFile_1.writeSSOTokenToFile)(ssoSessionName, { + ...ssoToken, + accessToken: newSsoOidcToken.accessToken, + expiresAt: newTokenExpiration.toISOString(), + refreshToken: newSsoOidcToken.refreshToken, + }); } - return value; - }; + catch (error) { + } + return { + token: newSsoOidcToken.accessToken, + expiration: newTokenExpiration, + }; + } + catch (error) { + (0, validateTokenExpiry_1.validateTokenExpiry)(existingToken); + return existingToken; + } +}; +exports.fromSso = fromSso; - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; +/***/ }), + +/***/ 65362: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -======= Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fileStreamHasher = void 0; -const fs_1 = __nccwpck_require__(57147); -const HashCalculator_1 = __nccwpck_require__(79087); -const fileStreamHasher = (hashCtor, fileStream) => new Promise((resolve, reject) => { - if (!isReadStream(fileStream)) { - reject(new Error("Unable to calculate hash for non-file streams.")); - return; +exports.fromStatic = void 0; +const property_provider_1 = __nccwpck_require__(60846); +const fromStatic = ({ token }) => async () => { + if (!token || !token.token) { + throw new property_provider_1.TokenProviderError(`Please pass a valid token to fromStatic`, false); } - const fileStreamTee = (0, fs_1.createReadStream)(fileStream.path, { - start: fileStream.start, - end: fileStream.end, - }); - const hash = new hashCtor(); - const hashCalculator = new HashCalculator_1.HashCalculator(hash); - fileStreamTee.pipe(hashCalculator); - fileStreamTee.on("error", (err) => { - hashCalculator.end(); - reject(err); - }); - hashCalculator.on("error", reject); - hashCalculator.on("finish", function () { - hash.digest().then(resolve).catch(reject); - }); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -}); + return token; +}; +exports.fromStatic = fromStatic; /***/ }), -<<<<<<< HEAD -/***/ 31941: +/***/ 78289: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Upload = void 0; -const client_s3_1 = __nccwpck_require__(23371); -const abort_controller_1 = __nccwpck_require__(82655); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const smithy_client_1 = __nccwpck_require__(33218); -const events_1 = __nccwpck_require__(82361); -const bytelength_1 = __nccwpck_require__(55076); -const chunker_1 = __nccwpck_require__(91330); -======= -/***/ 30785: +exports.getNewSsoOidcToken = void 0; +const client_sso_oidc_node_1 = __nccwpck_require__(10264); +const getSsoOidcClient_1 = __nccwpck_require__(2401); +const getNewSsoOidcToken = (ssoToken, ssoRegion) => { + const ssoOidcClient = (0, getSsoOidcClient_1.getSsoOidcClient)(ssoRegion); + return ssoOidcClient.send(new client_sso_oidc_node_1.CreateTokenCommand({ + clientId: ssoToken.clientId, + clientSecret: ssoToken.clientSecret, + refreshToken: ssoToken.refreshToken, + grantType: "refresh_token", + })); +}; +exports.getNewSsoOidcToken = getNewSsoOidcToken; + + +/***/ }), + +/***/ 2401: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(51396); -tslib_1.__exportStar(__nccwpck_require__(76896), exports); -tslib_1.__exportStar(__nccwpck_require__(33498), exports); +exports.getSsoOidcClient = void 0; +const client_sso_oidc_node_1 = __nccwpck_require__(10264); +const ssoOidcClientsHash = {}; +const getSsoOidcClient = (ssoRegion) => { + if (ssoOidcClientsHash[ssoRegion]) { + return ssoOidcClientsHash[ssoRegion]; + } + const ssoOidcClient = new client_sso_oidc_node_1.SSOOIDCClient({ region: ssoRegion }); + ssoOidcClientsHash[ssoRegion] = ssoOidcClient; + return ssoOidcClient; +}; +exports.getSsoOidcClient = getSsoOidcClient; /***/ }), -/***/ 33498: +/***/ 30395: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.readableStreamHasher = void 0; -const HashCalculator_1 = __nccwpck_require__(79087); -const readableStreamHasher = (hashCtor, readableStream) => { - if (readableStream.readableFlowing !== null) { - throw new Error("Unable to calculate hash for flowing readable stream"); - } - const hash = new hashCtor(); - const hashCalculator = new HashCalculator_1.HashCalculator(hash); - readableStream.pipe(hashCalculator); - return new Promise((resolve, reject) => { - readableStream.on("error", (err) => { - hashCalculator.end(); - reject(err); - }); - hashCalculator.on("error", reject); - hashCalculator.on("finish", () => { - hash.digest().then(resolve).catch(reject); - }); - }); -}; -exports.readableStreamHasher = readableStreamHasher; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(10264), exports); +tslib_1.__exportStar(__nccwpck_require__(13257), exports); +tslib_1.__exportStar(__nccwpck_require__(65362), exports); +tslib_1.__exportStar(__nccwpck_require__(43935), exports); /***/ }), -/***/ 51396: -/***/ ((module) => { +/***/ 43935: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/****************************************************************************** -Copyright (c) Microsoft Corporation. -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.nodeProvider = void 0; +const property_provider_1 = __nccwpck_require__(60846); +const fromSso_1 = __nccwpck_require__(13257); +const nodeProvider = (init = {}) => (0, property_provider_1.memoize)((0, property_provider_1.chain)((0, fromSso_1.fromSso)(init), async () => { + throw new property_provider_1.TokenProviderError("Could not load token from any providers", false); +}), (token) => token.expiration !== undefined && token.expiration.getTime() - Date.now() < 300000, (token) => token.expiration !== undefined); +exports.nodeProvider = nodeProvider; -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); + +/***/ }), + +/***/ 15014: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.validateTokenExpiry = void 0; +const property_provider_1 = __nccwpck_require__(60846); +const constants_1 = __nccwpck_require__(75741); +const validateTokenExpiry = (token) => { + if (token.expiration && token.expiration.getTime() < Date.now()) { + throw new property_provider_1.TokenProviderError(`Token is expired. ${constants_1.REFRESH_MESSAGE}`, false); } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; +}; +exports.validateTokenExpiry = validateTokenExpiry; + + +/***/ }), + +/***/ 8077: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.validateTokenKey = void 0; +const property_provider_1 = __nccwpck_require__(60846); +const constants_1 = __nccwpck_require__(75741); +const validateTokenKey = (key, value, forRefresh = false) => { + if (typeof value === "undefined") { + throw new property_provider_1.TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${constants_1.REFRESH_MESSAGE}`, false); } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; +}; +exports.validateTokenKey = validateTokenKey; - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; +/***/ }), - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; +/***/ 53739: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.writeSSOTokenToFile = void 0; +const shared_ini_file_loader_1 = __nccwpck_require__(53013); +const fs_1 = __nccwpck_require__(57147); +const { writeFile } = fs_1.promises; +const writeSSOTokenToFile = (id, ssoToken) => { + const tokenFilepath = (0, shared_ini_file_loader_1.getSSOTokenFilepath)(id); + const tokenString = JSON.stringify(ssoToken, null, 2); + return writeFile(tokenFilepath, tokenString); +}; +exports.writeSSOTokenToFile = writeSSOTokenToFile; - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - __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()); - }); - }; +/***/ }), - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +/***/ 46107: +/***/ ((__unused_webpack_module, exports) => { - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.build = exports.parse = exports.validate = void 0; +const validate = (str) => typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6; +exports.validate = validate; +const parse = (arn) => { + const segments = arn.split(":"); + if (segments.length < 6 || segments[0] !== "arn") + throw new Error("Malformed ARN"); + const [, partition, service, region, accountId, ...resource] = segments; + return { + partition, + service, + region, + accountId, + resource: resource.join(":"), }; +}; +exports.parse = parse; +const build = (arnObject) => { + const { partition = "aws", service, region, accountId, resource } = arnObject; + if ([service, region, accountId, resource].some((segment) => typeof segment !== "string")) { + throw new Error("Input ARN object is invalid"); + } + return `arn:${partition}:${service}:${region}:${accountId}:${resource}`; +}; +exports.build = build; - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +/***/ }), - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; +/***/ 72263: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const util_endpoints_1 = __nccwpck_require__(34863); +const isVirtualHostableS3Bucket_1 = __nccwpck_require__(38741); +const parseArn_1 = __nccwpck_require__(74991); +const partition_1 = __nccwpck_require__(57940); +const awsEndpointFunctions = { + isVirtualHostableS3Bucket: isVirtualHostableS3Bucket_1.isVirtualHostableS3Bucket, + parseArn: parseArn_1.parseArn, + partition: partition_1.partition, +}; +util_endpoints_1.customEndpointFunctions.aws = awsEndpointFunctions; - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; +/***/ }), - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +/***/ 68503: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(72263), exports); +tslib_1.__exportStar(__nccwpck_require__(57940), exports); +tslib_1.__exportStar(__nccwpck_require__(68882), exports); +tslib_1.__exportStar(__nccwpck_require__(85969), exports); +tslib_1.__exportStar(__nccwpck_require__(12287), exports); - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; +/***/ }), - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +/***/ 38741: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isVirtualHostableS3Bucket = void 0; +const util_endpoints_1 = __nccwpck_require__(34863); +const isIpAddress_1 = __nccwpck_require__(68882); +const isVirtualHostableS3Bucket = (value, allowSubDomains = false) => { + if (allowSubDomains) { + for (const label of value.split(".")) { + if (!(0, exports.isVirtualHostableS3Bucket)(label)) { + return false; + } + } + return true; + } + if (!(0, util_endpoints_1.isValidHostLabel)(value)) { + return false; + } + if (value.length < 3 || value.length > 63) { + return false; + } + if (value !== value.toLowerCase()) { + return false; + } + if ((0, isIpAddress_1.isIpAddress)(value)) { + return false; + } + return true; +}; +exports.isVirtualHostableS3Bucket = isVirtualHostableS3Bucket; /***/ }), -/***/ 1627: +/***/ 74991: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isArrayBuffer = void 0; -const isArrayBuffer = (arg) => (typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer) || - Object.prototype.toString.call(arg) === "[object ArrayBuffer]"; -exports.isArrayBuffer = isArrayBuffer; +exports.parseArn = void 0; +const parseArn = (value) => { + const segments = value.split(":"); + if (segments.length < 6) + return null; + const [arn, partition, service, region, accountId, ...resourceId] = segments; + if (arn !== "arn" || partition === "" || service === "" || resourceId[0] === "") + return null; + return { + partition, + service, + region, + accountId, + resourceId: resourceId[0].includes("/") ? resourceId[0].split("/") : resourceId, + }; +}; +exports.parseArn = parseArn; /***/ }), -/***/ 47984: +/***/ 57940: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Upload = void 0; -const abort_controller_1 = __nccwpck_require__(13391); -const client_s3_1 = __nccwpck_require__(60382); -const smithy_client_1 = __nccwpck_require__(26351); -const events_1 = __nccwpck_require__(82361); -const bytelength_1 = __nccwpck_require__(12295); -const chunker_1 = __nccwpck_require__(60198); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const MIN_PART_SIZE = 1024 * 1024 * 5; -class Upload extends events_1.EventEmitter { - constructor(options) { - var _a; - super(); - this.MAX_PARTS = 10000; - this.queueSize = 4; - this.partSize = MIN_PART_SIZE; - this.leavePartsOnError = false; - this.tags = []; - this.concurrentUploaders = []; - this.uploadedParts = []; - this.isMultiPart = true; - this.queueSize = options.queueSize || this.queueSize; - this.partSize = options.partSize || this.partSize; - this.leavePartsOnError = options.leavePartsOnError || this.leavePartsOnError; - this.tags = options.tags || this.tags; - this.client = options.client; - this.params = options.params; - this.__validateInput(); - this.totalBytes = (0, bytelength_1.byteLength)(this.params.Body); - this.bytesUploadedSoFar = 0; - this.abortController = (_a = options.abortController) !== null && _a !== void 0 ? _a : new abort_controller_1.AbortController(); - } - async abort() { - this.abortController.abort(); - } - async done() { - return await Promise.race([this.__doMultipartUpload(), this.__abortTimeout(this.abortController.signal)]); - } - on(event, listener) { - this.uploadEvent = event; - return super.on(event, listener); - } - async __uploadUsingPut(dataPart) { - var _a; - this.isMultiPart = false; - const params = { ...this.params, Body: dataPart.data }; - const clientConfig = this.client.config; - const requestHandler = clientConfig.requestHandler; - const eventEmitter = requestHandler instanceof events_1.EventEmitter ? requestHandler : null; - const uploadEventListener = (event) => { - this.bytesUploadedSoFar = event.loaded; - this.totalBytes = event.total; - this.__notifyProgress({ - loaded: this.bytesUploadedSoFar, - total: this.totalBytes, - part: dataPart.partNumber, - Key: this.params.Key, - Bucket: this.params.Bucket, - }); - }; - if (eventEmitter !== null) { - eventEmitter.on("xhr.upload.progress", uploadEventListener); - } - const resolved = await Promise.all([this.client.send(new client_s3_1.PutObjectCommand(params)), (_a = clientConfig === null || clientConfig === void 0 ? void 0 : clientConfig.endpoint) === null || _a === void 0 ? void 0 : _a.call(clientConfig)]); - const putResult = resolved[0]; - let endpoint = resolved[1]; - if (!endpoint) { - endpoint = (0, middleware_endpoint_1.toEndpointV1)(await (0, middleware_endpoint_1.getEndpointFromInstructions)(params, client_s3_1.PutObjectCommand, { - ...clientConfig, - })); - } - if (!endpoint) { - throw new Error('Could not resolve endpoint from S3 "client.config.endpoint()" nor EndpointsV2.'); - } - if (eventEmitter !== null) { - eventEmitter.off("xhr.upload.progress", uploadEventListener); - } - const locationKey = this.params - .Key.split("/") - .map((segment) => (0, smithy_client_1.extendedEncodeURIComponent)(segment)) - .join("/"); - const locationBucket = (0, smithy_client_1.extendedEncodeURIComponent)(this.params.Bucket); - const Location = (() => { - const endpointHostnameIncludesBucket = endpoint.hostname.startsWith(`${locationBucket}.`); - const forcePathStyle = this.client.config.forcePathStyle; - if (forcePathStyle) { - return `${endpoint.protocol}//${endpoint.hostname}/${locationBucket}/${locationKey}`; - } - if (endpointHostnameIncludesBucket) { - return `${endpoint.protocol}//${endpoint.hostname}/${locationKey}`; - } - return `${endpoint.protocol}//${locationBucket}.${endpoint.hostname}/${locationKey}`; - })(); - this.singleUploadResult = { - ...putResult, - Bucket: this.params.Bucket, - Key: this.params.Key, - Location, - }; - const totalSize = (0, bytelength_1.byteLength)(dataPart.data); - this.__notifyProgress({ - loaded: totalSize, - total: totalSize, - part: 1, - Key: this.params.Key, - Bucket: this.params.Bucket, - }); - } - async __createMultipartUpload() { - if (!this.createMultiPartPromise) { - const createCommandParams = { ...this.params, Body: undefined }; - this.createMultiPartPromise = this.client.send(new client_s3_1.CreateMultipartUploadCommand(createCommandParams)); - } - return this.createMultiPartPromise; - } - async __doConcurrentUpload(dataFeeder) { - for await (const dataPart of dataFeeder) { - if (this.uploadedParts.length > this.MAX_PARTS) { - throw new Error(`Exceeded ${this.MAX_PARTS} as part of the upload to ${this.params.Key} and ${this.params.Bucket}.`); - } - try { - if (this.abortController.signal.aborted) { - return; - } - if (dataPart.partNumber === 1 && dataPart.lastPart) { - return await this.__uploadUsingPut(dataPart); - } - if (!this.uploadId) { - const { UploadId } = await this.__createMultipartUpload(); - this.uploadId = UploadId; - if (this.abortController.signal.aborted) { - return; - } - } - const partSize = (0, bytelength_1.byteLength)(dataPart.data) || 0; - const requestHandler = this.client.config.requestHandler; - const eventEmitter = requestHandler instanceof events_1.EventEmitter ? requestHandler : null; - let lastSeenBytes = 0; - const uploadEventListener = (event, request) => { - const requestPartSize = Number(request.query["partNumber"]) || -1; - if (requestPartSize !== dataPart.partNumber) { - return; - } - if (event.total && partSize) { - this.bytesUploadedSoFar += event.loaded - lastSeenBytes; - lastSeenBytes = event.loaded; - } - this.__notifyProgress({ - loaded: this.bytesUploadedSoFar, - total: this.totalBytes, - part: dataPart.partNumber, - Key: this.params.Key, - Bucket: this.params.Bucket, - }); +exports.getUserAgentPrefix = exports.useDefaultPartitionInfo = exports.setPartitionInfo = exports.partition = void 0; +const tslib_1 = __nccwpck_require__(47754); +const partitions_json_1 = tslib_1.__importDefault(__nccwpck_require__(95367)); +let selectedPartitionsInfo = partitions_json_1.default; +let selectedUserAgentPrefix = ""; +const partition = (value) => { + const { partitions } = selectedPartitionsInfo; + for (const partition of partitions) { + const { regions, outputs } = partition; + for (const [region, regionData] of Object.entries(regions)) { + if (region === value) { + return { + ...outputs, + ...regionData, }; - if (eventEmitter !== null) { - eventEmitter.on("xhr.upload.progress", uploadEventListener); - } - const partResult = await this.client.send(new client_s3_1.UploadPartCommand({ - ...this.params, - UploadId: this.uploadId, - Body: dataPart.data, - PartNumber: dataPart.partNumber, - })); - if (eventEmitter !== null) { - eventEmitter.off("xhr.upload.progress", uploadEventListener); - } - if (this.abortController.signal.aborted) { - return; - } - if (!partResult.ETag) { - throw new Error(`Part ${dataPart.partNumber} is missing ETag in UploadPart response. Missing Bucket CORS configuration for ETag header?`); - } - this.uploadedParts.push({ - PartNumber: dataPart.partNumber, - ETag: partResult.ETag, - ...(partResult.ChecksumCRC32 && { ChecksumCRC32: partResult.ChecksumCRC32 }), - ...(partResult.ChecksumCRC32C && { ChecksumCRC32C: partResult.ChecksumCRC32C }), - ...(partResult.ChecksumSHA1 && { ChecksumSHA1: partResult.ChecksumSHA1 }), - ...(partResult.ChecksumSHA256 && { ChecksumSHA256: partResult.ChecksumSHA256 }), - }); - if (eventEmitter === null) { - this.bytesUploadedSoFar += partSize; - } - this.__notifyProgress({ - loaded: this.bytesUploadedSoFar, - total: this.totalBytes, - part: dataPart.partNumber, - Key: this.params.Key, - Bucket: this.params.Bucket, - }); - } - catch (e) { - if (!this.uploadId) { - throw e; - } - if (this.leavePartsOnError) { - throw e; - } } } } - async __doMultipartUpload() { - const dataFeeder = (0, chunker_1.getChunk)(this.params.Body, this.partSize); - for (let index = 0; index < this.queueSize; index++) { - const currentUpload = this.__doConcurrentUpload(dataFeeder); - this.concurrentUploaders.push(currentUpload); - } - await Promise.all(this.concurrentUploaders); - if (this.abortController.signal.aborted) { - throw Object.assign(new Error("Upload aborted."), { name: "AbortError" }); - } - let result; - if (this.isMultiPart) { - this.uploadedParts.sort((a, b) => a.PartNumber - b.PartNumber); - const uploadCompleteParams = { - ...this.params, - Body: undefined, - UploadId: this.uploadId, - MultipartUpload: { - Parts: this.uploadedParts, - }, + for (const partition of partitions) { + const { regionRegex, outputs } = partition; + if (new RegExp(regionRegex).test(value)) { + return { + ...outputs, }; - result = await this.client.send(new client_s3_1.CompleteMultipartUploadCommand(uploadCompleteParams)); - } - else { - result = this.singleUploadResult; - } - if (this.tags.length) { - await this.client.send(new client_s3_1.PutObjectTaggingCommand({ - ...this.params, - Tagging: { - TagSet: this.tags, - }, - })); - } - return result; - } - __notifyProgress(progress) { - if (this.uploadEvent) { - this.emit(this.uploadEvent, progress); } } - async __abortTimeout(abortSignal) { - return new Promise((resolve, reject) => { - abortSignal.onabort = () => { - const abortError = new Error("Upload aborted."); - abortError.name = "AbortError"; - reject(abortError); - }; - }); - } - __validateInput() { - if (!this.params) { - throw new Error(`InputError: Upload requires params to be passed to upload.`); - } - if (!this.client) { - throw new Error(`InputError: Upload requires a AWS client to do uploads with.`); - } - if (this.partSize < MIN_PART_SIZE) { - throw new Error(`EntityTooSmall: Your proposed upload partsize [${this.partSize}] is smaller than the minimum allowed size [${MIN_PART_SIZE}] (5MB)`); - } - if (this.queueSize < 1) { - throw new Error(`Queue size: Must have at least one uploading queue.`); - } + const DEFAULT_PARTITION = partitions.find((partition) => partition.id === "aws"); + if (!DEFAULT_PARTITION) { + throw new Error("Provided region was not found in the partition array or regex," + + " and default partition with id 'aws' doesn't exist."); } -} -exports.Upload = Upload; + return { + ...DEFAULT_PARTITION.outputs, + }; +}; +exports.partition = partition; +const setPartitionInfo = (partitionsInfo, userAgentPrefix = "") => { + selectedPartitionsInfo = partitionsInfo; + selectedUserAgentPrefix = userAgentPrefix; +}; +exports.setPartitionInfo = setPartitionInfo; +const useDefaultPartitionInfo = () => { + (0, exports.setPartitionInfo)(partitions_json_1.default, ""); +}; +exports.useDefaultPartitionInfo = useDefaultPartitionInfo; +const getUserAgentPrefix = () => selectedUserAgentPrefix; +exports.getUserAgentPrefix = getUserAgentPrefix; /***/ }), -<<<<<<< HEAD -/***/ 55076: -======= -/***/ 12295: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 68882: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.byteLength = void 0; -<<<<<<< HEAD -const runtimeConfig_1 = __nccwpck_require__(33900); -======= -const runtimeConfig_1 = __nccwpck_require__(35754); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const byteLength = (input) => { - if (input === null || input === undefined) - return 0; - if (typeof input === "string") - input = Buffer.from(input); - if (typeof input.byteLength === "number") { - return input.byteLength; - } - else if (typeof input.length === "number") { - return input.length; - } - else if (typeof input.size === "number") { - return input.size; - } - else if (typeof input.path === "string") { - try { - return runtimeConfig_1.ClientDefaultValues.lstatSync(input.path).size; - } - catch (error) { - return undefined; - } - } - return undefined; -}; -exports.byteLength = byteLength; +exports.isIpAddress = void 0; +var util_endpoints_1 = __nccwpck_require__(34863); +Object.defineProperty(exports, "isIpAddress", ({ enumerable: true, get: function () { return util_endpoints_1.isIpAddress; } })); /***/ }), -<<<<<<< HEAD -/***/ 91330: -======= -/***/ 60198: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 85969: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getChunk = void 0; -const buffer_1 = __nccwpck_require__(14300); -const stream_1 = __nccwpck_require__(12781); -<<<<<<< HEAD -const getChunkBuffer_1 = __nccwpck_require__(10598); -const getChunkStream_1 = __nccwpck_require__(67487); -const getDataReadable_1 = __nccwpck_require__(5412); -const getDataReadableStream_1 = __nccwpck_require__(19935); -======= -const getChunkBuffer_1 = __nccwpck_require__(92746); -const getChunkStream_1 = __nccwpck_require__(67436); -const getDataReadable_1 = __nccwpck_require__(65213); -const getDataReadableStream_1 = __nccwpck_require__(76728); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const getChunk = (data, partSize) => { - if (data instanceof buffer_1.Buffer) { - return (0, getChunkBuffer_1.getChunkBuffer)(data, partSize); - } - else if (data instanceof stream_1.Readable) { - return (0, getChunkStream_1.getChunkStream)(data, partSize, getDataReadable_1.getDataReadable); - } - else if (data instanceof String || typeof data === "string" || data instanceof Uint8Array) { - return (0, getChunkBuffer_1.getChunkBuffer)(buffer_1.Buffer.from(data), partSize); - } - if (typeof data.stream === "function") { - return (0, getChunkStream_1.getChunkStream)(data.stream(), partSize, getDataReadableStream_1.getDataReadableStream); - } - else if (data instanceof ReadableStream) { - return (0, getChunkStream_1.getChunkStream)(data, partSize, getDataReadableStream_1.getDataReadableStream); - } - else { - throw new Error("Body Data is unsupported format, expected data to be one of: string | Uint8Array | Buffer | Readable | ReadableStream | Blob;."); - } -}; -exports.getChunk = getChunk; +exports.resolveEndpoint = void 0; +var util_endpoints_1 = __nccwpck_require__(34863); +Object.defineProperty(exports, "resolveEndpoint", ({ enumerable: true, get: function () { return util_endpoints_1.resolveEndpoint; } })); /***/ }), -<<<<<<< HEAD -/***/ 10598: -======= -/***/ 92746: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { +/***/ 4101: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getChunkBuffer = void 0; -async function* getChunkBuffer(data, partSize) { - let partNumber = 1; - let startByte = 0; - let endByte = partSize; - while (endByte < data.byteLength) { - yield { - partNumber, - data: data.slice(startByte, endByte), - }; - partNumber += 1; - startByte = endByte; - endByte = startByte + partSize; - } - yield { - partNumber, - data: data.slice(startByte), - lastPart: true, - }; -} -exports.getChunkBuffer = getChunkBuffer; +exports.EndpointError = void 0; +var util_endpoints_1 = __nccwpck_require__(34863); +Object.defineProperty(exports, "EndpointError", ({ enumerable: true, get: function () { return util_endpoints_1.EndpointError; } })); /***/ }), -<<<<<<< HEAD -/***/ 67487: -======= -/***/ 67436: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 20258: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getChunkStream = void 0; -const buffer_1 = __nccwpck_require__(14300); -async function* getChunkStream(data, partSize, getNextData) { - let partNumber = 1; - const currentBuffer = { chunks: [], length: 0 }; - for await (const datum of getNextData(data)) { - currentBuffer.chunks.push(datum); - currentBuffer.length += datum.length; - while (currentBuffer.length >= partSize) { - const dataChunk = currentBuffer.chunks.length > 1 ? buffer_1.Buffer.concat(currentBuffer.chunks) : currentBuffer.chunks[0]; - yield { - partNumber, - data: dataChunk.slice(0, partSize), - }; - currentBuffer.chunks = [dataChunk.slice(partSize)]; - currentBuffer.length = currentBuffer.chunks[0].length; - partNumber += 1; - } - } - yield { - partNumber, - data: buffer_1.Buffer.concat(currentBuffer.chunks), - lastPart: true, - }; -} -exports.getChunkStream = getChunkStream; /***/ }), -<<<<<<< HEAD -/***/ 5412: -======= -/***/ 65213: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 24597: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getDataReadable = void 0; -const buffer_1 = __nccwpck_require__(14300); -async function* getDataReadable(data) { - for await (const chunk of data) { - yield buffer_1.Buffer.from(chunk); - } -} -exports.getDataReadable = getDataReadable; /***/ }), -<<<<<<< HEAD -/***/ 19935: -======= -/***/ 76728: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 76256: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getDataReadableStream = void 0; -const buffer_1 = __nccwpck_require__(14300); -async function* getDataReadableStream(data) { - const reader = data.getReader(); - try { - while (true) { - const { done, value } = await reader.read(); - if (done) - return; - yield buffer_1.Buffer.from(value); - } - } - catch (e) { - throw e; - } - finally { - reader.releaseLock(); - } -} -exports.getDataReadableStream = getDataReadableStream; /***/ }), -<<<<<<< HEAD -/***/ 20488: -======= -/***/ 13436: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 54819: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(69389); -tslib_1.__exportStar(__nccwpck_require__(31941), exports); -tslib_1.__exportStar(__nccwpck_require__(94543), exports); -======= -const tslib_1 = __nccwpck_require__(42135); -tslib_1.__exportStar(__nccwpck_require__(47984), exports); -tslib_1.__exportStar(__nccwpck_require__(71498), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 /***/ }), -<<<<<<< HEAD -/***/ 33900: -======= -/***/ 35754: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 12287: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ClientDefaultValues = void 0; -const fs_1 = __nccwpck_require__(57147); -<<<<<<< HEAD -const runtimeConfig_shared_1 = __nccwpck_require__(41541); -======= -const runtimeConfig_shared_1 = __nccwpck_require__(67836); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -exports.ClientDefaultValues = { - ...runtimeConfig_shared_1.ClientSharedValues, - runtime: "node", - lstatSync: fs_1.lstatSync, -}; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(4101), exports); +tslib_1.__exportStar(__nccwpck_require__(20258), exports); +tslib_1.__exportStar(__nccwpck_require__(24597), exports); +tslib_1.__exportStar(__nccwpck_require__(76256), exports); +tslib_1.__exportStar(__nccwpck_require__(54819), exports); +tslib_1.__exportStar(__nccwpck_require__(5469), exports); /***/ }), -<<<<<<< HEAD -/***/ 41541: -======= -/***/ 67836: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 5469: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ClientSharedValues = void 0; -exports.ClientSharedValues = { - lstatSync: () => { }, -}; /***/ }), -<<<<<<< HEAD -/***/ 94543: -======= -/***/ 71498: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 95051: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.crtAvailability = void 0; +exports.crtAvailability = { + isCrtAvailable: false, +}; /***/ }), -<<<<<<< HEAD -/***/ 69389: -======= -/***/ 42135: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. +/***/ 22004: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.defaultUserAgent = exports.UA_APP_ID_INI_NAME = exports.UA_APP_ID_ENV_NAME = exports.crtAvailability = void 0; +const node_config_provider_1 = __nccwpck_require__(86711); +const os_1 = __nccwpck_require__(22037); +const process_1 = __nccwpck_require__(77282); +const is_crt_available_1 = __nccwpck_require__(59909); +var crt_availability_1 = __nccwpck_require__(95051); +Object.defineProperty(exports, "crtAvailability", ({ enumerable: true, get: function () { return crt_availability_1.crtAvailability; } })); +exports.UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID"; +exports.UA_APP_ID_INI_NAME = "sdk-ua-app-id"; +const defaultUserAgent = ({ serviceId, clientVersion }) => { + const sections = [ + ["aws-sdk-js", clientVersion], + ["ua", "2.0"], + [`os/${(0, os_1.platform)()}`, (0, os_1.release)()], + ["lang/js"], + ["md/nodejs", `${process_1.versions.node}`], + ]; + const crtAvailable = (0, is_crt_available_1.isCrtAvailable)(); + if (crtAvailable) { + sections.push(crtAvailable); } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); + if (serviceId) { + sections.push([`api/${serviceId}`, clientVersion]); } - else { - factory(createExporter(root)); + if (process_1.env.AWS_EXECUTION_ENV) { + sections.push([`exec-env/${process_1.env.AWS_EXECUTION_ENV}`]); } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } + const appIdPromise = (0, node_config_provider_1.loadConfig)({ + environmentVariableSelector: (env) => env[exports.UA_APP_ID_ENV_NAME], + configFileSelector: (profile) => profile[exports.UA_APP_ID_INI_NAME], + default: undefined, + })(); + let resolvedUserAgent = undefined; + return async () => { + if (!resolvedUserAgent) { + const appId = await appIdPromise; + resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections]; } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + return resolvedUserAgent; }; +}; +exports.defaultUserAgent = defaultUserAgent; - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; +/***/ }), - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; +/***/ 59909: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isCrtAvailable = void 0; +const crt_availability_1 = __nccwpck_require__(95051); +const isCrtAvailable = () => { + if (crt_availability_1.crtAvailability.isCrtAvailable) { + return ["md/crt-avail"]; + } + return null; +}; +exports.isCrtAvailable = isCrtAvailable; - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; +/***/ }), - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; +/***/ 32628: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - __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.toUtf8 = exports.fromUtf8 = void 0; +const pureJs_1 = __nccwpck_require__(90600); +const whatwgEncodingApi_1 = __nccwpck_require__(84157); +const fromUtf8 = (input) => typeof TextEncoder === "function" ? (0, whatwgEncodingApi_1.fromUtf8)(input) : (0, pureJs_1.fromUtf8)(input); +exports.fromUtf8 = fromUtf8; +const toUtf8 = (input) => typeof TextDecoder === "function" ? (0, whatwgEncodingApi_1.toUtf8)(input) : (0, pureJs_1.toUtf8)(input); +exports.toUtf8 = toUtf8; - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +/***/ }), - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +/***/ 90600: +/***/ ((__unused_webpack_module, exports) => { - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toUtf8 = exports.fromUtf8 = void 0; +const fromUtf8 = (input) => { + const bytes = []; + for (let i = 0, len = input.length; i < len; i++) { + const value = input.charCodeAt(i); + if (value < 0x80) { + bytes.push(value); } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } + else if (value < 0x800) { + bytes.push((value >> 6) | 0b11000000, (value & 0b111111) | 0b10000000); } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } + else if (i + 1 < input.length && (value & 0xfc00) === 0xd800 && (input.charCodeAt(i + 1) & 0xfc00) === 0xdc00) { + const surrogatePair = 0x10000 + ((value & 0b1111111111) << 10) + (input.charCodeAt(++i) & 0b1111111111); + bytes.push((surrogatePair >> 18) | 0b11110000, ((surrogatePair >> 12) & 0b111111) | 0b10000000, ((surrogatePair >> 6) & 0b111111) | 0b10000000, (surrogatePair & 0b111111) | 0b10000000); } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); + else { + bytes.push((value >> 12) | 0b11100000, ((value >> 6) & 0b111111) | 0b10000000, (value & 0b111111) | 0b10000000); } - else if (async) { - env.stack.push({ async: true }); + } + return Uint8Array.from(bytes); +}; +exports.fromUtf8 = fromUtf8; +const toUtf8 = (input) => { + let decoded = ""; + for (let i = 0, len = input.length; i < len; i++) { + const byte = input[i]; + if (byte < 0x80) { + decoded += String.fromCharCode(byte); } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; + else if (0b11000000 <= byte && byte < 0b11100000) { + const nextByte = input[++i]; + decoded += String.fromCharCode(((byte & 0b11111) << 6) | (nextByte & 0b111111)); } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; + else if (0b11110000 <= byte && byte < 0b101101101) { + const surrogatePair = [byte, input[++i], input[++i], input[++i]]; + const encoded = "%" + surrogatePair.map((byteValue) => byteValue.toString(16)).join("%"); + decoded += decodeURIComponent(encoded); } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -<<<<<<< HEAD -/***/ 78879: -======= -/***/ 10179: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_DISABLE_MULTIREGION_ACCESS_POINT_CONFIG_OPTIONS = exports.NODE_DISABLE_MULTIREGION_ACCESS_POINT_INI_NAME = exports.NODE_DISABLE_MULTIREGION_ACCESS_POINT_ENV_NAME = void 0; -<<<<<<< HEAD -const util_config_provider_1 = __nccwpck_require__(32617); -======= -const util_config_provider_1 = __nccwpck_require__(46522); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -exports.NODE_DISABLE_MULTIREGION_ACCESS_POINT_ENV_NAME = "AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS"; -exports.NODE_DISABLE_MULTIREGION_ACCESS_POINT_INI_NAME = "s3_disable_multiregion_access_points"; -exports.NODE_DISABLE_MULTIREGION_ACCESS_POINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => (0, util_config_provider_1.booleanSelector)(env, exports.NODE_DISABLE_MULTIREGION_ACCESS_POINT_ENV_NAME, util_config_provider_1.SelectorType.ENV), - configFileSelector: (profile) => (0, util_config_provider_1.booleanSelector)(profile, exports.NODE_DISABLE_MULTIREGION_ACCESS_POINT_INI_NAME, util_config_provider_1.SelectorType.CONFIG), - default: false, + else { + decoded += String.fromCharCode(((byte & 0b1111) << 12) | ((input[++i] & 0b111111) << 6) | (input[++i] & 0b111111)); + } + } + return decoded; }; +exports.toUtf8 = toUtf8; /***/ }), -<<<<<<< HEAD -/***/ 87018: -======= -/***/ 73033: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 84157: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_USE_ARN_REGION_CONFIG_OPTIONS = exports.NODE_USE_ARN_REGION_INI_NAME = exports.NODE_USE_ARN_REGION_ENV_NAME = void 0; -<<<<<<< HEAD -const util_config_provider_1 = __nccwpck_require__(32617); -======= -const util_config_provider_1 = __nccwpck_require__(46522); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -exports.NODE_USE_ARN_REGION_ENV_NAME = "AWS_S3_USE_ARN_REGION"; -exports.NODE_USE_ARN_REGION_INI_NAME = "s3_use_arn_region"; -exports.NODE_USE_ARN_REGION_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => (0, util_config_provider_1.booleanSelector)(env, exports.NODE_USE_ARN_REGION_ENV_NAME, util_config_provider_1.SelectorType.ENV), - configFileSelector: (profile) => (0, util_config_provider_1.booleanSelector)(profile, exports.NODE_USE_ARN_REGION_INI_NAME, util_config_provider_1.SelectorType.CONFIG), - default: false, -}; +exports.toUtf8 = exports.fromUtf8 = void 0; +function fromUtf8(input) { + return new TextEncoder().encode(input); +} +exports.fromUtf8 = fromUtf8; +function toUtf8(input) { + return new TextDecoder("utf-8").decode(input); +} +exports.toUtf8 = toUtf8; /***/ }), -<<<<<<< HEAD -/***/ 58207: -======= -/***/ 42221: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 96573: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getBucketEndpointPlugin = exports.bucketEndpointMiddlewareOptions = exports.bucketEndpointMiddleware = void 0; -<<<<<<< HEAD -const util_arn_parser_1 = __nccwpck_require__(84122); -const protocol_http_1 = __nccwpck_require__(45311); -const bucketHostname_1 = __nccwpck_require__(40339); -======= -const protocol_http_1 = __nccwpck_require__(35712); -const util_arn_parser_1 = __nccwpck_require__(1679); -const bucketHostname_1 = __nccwpck_require__(28226); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const bucketEndpointMiddleware = (options) => (next, context) => async (args) => { - const { Bucket: bucketName } = args.input; - let replaceBucketInPath = options.bucketEndpoint; - const request = args.request; - if (protocol_http_1.HttpRequest.isInstance(request)) { - if (options.bucketEndpoint) { - request.hostname = bucketName; +exports.XmlNode = void 0; +const escape_attribute_1 = __nccwpck_require__(35988); +const XmlText_1 = __nccwpck_require__(62990); +class XmlNode { + static of(name, childText, withName) { + const node = new XmlNode(name); + if (childText !== undefined) { + node.addChildNode(new XmlText_1.XmlText(childText)); } - else if ((0, util_arn_parser_1.validate)(bucketName)) { - const bucketArn = (0, util_arn_parser_1.parse)(bucketName); - const clientRegion = await options.region(); - const useDualstackEndpoint = await options.useDualstackEndpoint(); - const useFipsEndpoint = await options.useFipsEndpoint(); - const { partition, signingRegion = clientRegion } = (await options.regionInfoProvider(clientRegion, { useDualstackEndpoint, useFipsEndpoint })) || {}; - const useArnRegion = await options.useArnRegion(); - const { hostname, bucketEndpoint, signingRegion: modifiedSigningRegion, signingService, } = (0, bucketHostname_1.bucketHostname)({ - bucketName: bucketArn, - baseHostname: request.hostname, - accelerateEndpoint: options.useAccelerateEndpoint, - dualstackEndpoint: useDualstackEndpoint, - fipsEndpoint: useFipsEndpoint, - pathStyleEndpoint: options.forcePathStyle, - tlsCompatible: request.protocol === "https:", - useArnRegion, - clientPartition: partition, - clientSigningRegion: signingRegion, - clientRegion: clientRegion, - isCustomEndpoint: options.isCustomEndpoint, - disableMultiregionAccessPoints: await options.disableMultiregionAccessPoints(), + if (withName !== undefined) { + node.withName(withName); + } + return node; + } + constructor(name, children = []) { + this.name = name; + this.children = children; + this.attributes = {}; + } + withName(name) { + this.name = name; + return this; + } + addAttribute(name, value) { + this.attributes[name] = value; + return this; + } + addChildNode(child) { + this.children.push(child); + return this; + } + removeAttribute(name) { + delete this.attributes[name]; + return this; + } + n(name) { + this.name = name; + return this; + } + c(child) { + this.children.push(child); + return this; + } + a(name, value) { + if (value != null) { + this.attributes[name] = value; + } + return this; + } + cc(input, field, withName = field) { + if (input[field] != null) { + const node = XmlNode.of(field, input[field]).withName(withName); + this.c(node); + } + } + l(input, listName, memberName, valueProvider) { + if (input[listName] != null) { + const nodes = valueProvider(); + nodes.map((node) => { + node.withName(memberName); + this.c(node); }); - if (modifiedSigningRegion && modifiedSigningRegion !== signingRegion) { - context["signing_region"] = modifiedSigningRegion; - } - if (signingService && signingService !== "s3") { - context["signing_service"] = signingService; - } - request.hostname = hostname; - replaceBucketInPath = bucketEndpoint; } - else { - const clientRegion = await options.region(); - const dualstackEndpoint = await options.useDualstackEndpoint(); - const fipsEndpoint = await options.useFipsEndpoint(); - const { hostname, bucketEndpoint } = (0, bucketHostname_1.bucketHostname)({ - bucketName, - clientRegion, - baseHostname: request.hostname, - accelerateEndpoint: options.useAccelerateEndpoint, - dualstackEndpoint, - fipsEndpoint, - pathStyleEndpoint: options.forcePathStyle, - tlsCompatible: request.protocol === "https:", - isCustomEndpoint: options.isCustomEndpoint, + } + lc(input, listName, memberName, valueProvider) { + if (input[listName] != null) { + const nodes = valueProvider(); + const containerNode = new XmlNode(memberName); + nodes.map((node) => { + containerNode.c(node); }); - request.hostname = hostname; - replaceBucketInPath = bucketEndpoint; + this.c(containerNode); } - if (replaceBucketInPath) { - request.path = request.path.replace(/^(\/)?[^\/]+/, ""); - if (request.path === "") { - request.path = "/"; + } + toString() { + const hasChildren = Boolean(this.children.length); + let xmlText = `<${this.name}`; + const attributes = this.attributes; + for (const attributeName of Object.keys(attributes)) { + const attribute = attributes[attributeName]; + if (attribute != null) { + xmlText += ` ${attributeName}="${(0, escape_attribute_1.escapeAttribute)("" + attribute)}"`; } } + return (xmlText += !hasChildren ? "/>" : `>${this.children.map((c) => c.toString()).join("")}`); } - return next({ ...args, request }); -}; -exports.bucketEndpointMiddleware = bucketEndpointMiddleware; -exports.bucketEndpointMiddlewareOptions = { - tags: ["BUCKET_ENDPOINT"], - name: "bucketEndpointMiddleware", - relation: "before", - toMiddleware: "hostHeaderMiddleware", - override: true, -}; -const getBucketEndpointPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo((0, exports.bucketEndpointMiddleware)(options), exports.bucketEndpointMiddlewareOptions); - }, -}); -exports.getBucketEndpointPlugin = getBucketEndpointPlugin; +} +exports.XmlNode = XmlNode; /***/ }), -<<<<<<< HEAD -/***/ 40339: -======= -/***/ 28226: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 62990: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.bucketHostname = void 0; -<<<<<<< HEAD -const bucketHostnameUtils_1 = __nccwpck_require__(58189); -======= -const bucketHostnameUtils_1 = __nccwpck_require__(79495); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const bucketHostname = (options) => { - (0, bucketHostnameUtils_1.validateCustomEndpoint)(options); - return (0, bucketHostnameUtils_1.isBucketNameOptions)(options) - ? - getEndpointFromBucketName(options) - : - getEndpointFromArn(options); -}; -exports.bucketHostname = bucketHostname; -const getEndpointFromBucketName = ({ accelerateEndpoint = false, clientRegion: region, baseHostname, bucketName, dualstackEndpoint = false, fipsEndpoint = false, pathStyleEndpoint = false, tlsCompatible = true, isCustomEndpoint = false, }) => { - const [clientRegion, hostnameSuffix] = isCustomEndpoint ? [region, baseHostname] : (0, bucketHostnameUtils_1.getSuffix)(baseHostname); - if (pathStyleEndpoint || !(0, bucketHostnameUtils_1.isDnsCompatibleBucketName)(bucketName) || (tlsCompatible && bucketHostnameUtils_1.DOT_PATTERN.test(bucketName))) { - return { - bucketEndpoint: false, - hostname: dualstackEndpoint ? `s3.dualstack.${clientRegion}.${hostnameSuffix}` : baseHostname, - }; - } - if (accelerateEndpoint) { - baseHostname = `s3-accelerate${dualstackEndpoint ? ".dualstack" : ""}.${hostnameSuffix}`; - } - else if (dualstackEndpoint) { - baseHostname = `s3.dualstack.${clientRegion}.${hostnameSuffix}`; - } - return { - bucketEndpoint: true, - hostname: `${bucketName}.${baseHostname}`, - }; -}; -const getEndpointFromArn = (options) => { - const { isCustomEndpoint, baseHostname, clientRegion } = options; - const hostnameSuffix = isCustomEndpoint ? baseHostname : (0, bucketHostnameUtils_1.getSuffixForArnEndpoint)(baseHostname)[1]; - const { pathStyleEndpoint, accelerateEndpoint = false, fipsEndpoint = false, tlsCompatible = true, bucketName, clientPartition = "aws", } = options; - (0, bucketHostnameUtils_1.validateArnEndpointOptions)({ pathStyleEndpoint, accelerateEndpoint, tlsCompatible }); - const { service, partition, accountId, region, resource } = bucketName; - (0, bucketHostnameUtils_1.validateService)(service); - (0, bucketHostnameUtils_1.validatePartition)(partition, { clientPartition }); - (0, bucketHostnameUtils_1.validateAccountId)(accountId); - const { accesspointName, outpostId } = (0, bucketHostnameUtils_1.getArnResources)(resource); - if (service === "s3-object-lambda") { - return getEndpointFromObjectLambdaArn({ ...options, tlsCompatible, bucketName, accesspointName, hostnameSuffix }); - } - if (region === "") { - return getEndpointFromMRAPArn({ ...options, clientRegion, mrapAlias: accesspointName, hostnameSuffix }); - } - if (outpostId) { - return getEndpointFromOutpostArn({ ...options, clientRegion, outpostId, accesspointName, hostnameSuffix }); +exports.XmlText = void 0; +const escape_element_1 = __nccwpck_require__(45845); +class XmlText { + constructor(value) { + this.value = value; } - return getEndpointFromAccessPointArn({ ...options, clientRegion, accesspointName, hostnameSuffix }); -}; -const getEndpointFromObjectLambdaArn = ({ dualstackEndpoint = false, fipsEndpoint = false, tlsCompatible = true, useArnRegion, clientRegion, clientSigningRegion = clientRegion, accesspointName, bucketName, hostnameSuffix, }) => { - const { accountId, region, service } = bucketName; - (0, bucketHostnameUtils_1.validateRegionalClient)(clientRegion); - (0, bucketHostnameUtils_1.validateRegion)(region, { - useArnRegion, - clientRegion, - clientSigningRegion, - allowFipsRegion: true, - useFipsEndpoint: fipsEndpoint, - }); - (0, bucketHostnameUtils_1.validateNoDualstack)(dualstackEndpoint); - const DNSHostLabel = `${accesspointName}-${accountId}`; - (0, bucketHostnameUtils_1.validateDNSHostLabel)(DNSHostLabel, { tlsCompatible }); - const endpointRegion = useArnRegion ? region : clientRegion; - const signingRegion = useArnRegion ? region : clientSigningRegion; - return { - bucketEndpoint: true, - hostname: `${DNSHostLabel}.${service}${fipsEndpoint ? "-fips" : ""}.${endpointRegion}.${hostnameSuffix}`, - signingRegion, - signingService: service, - }; -}; -const getEndpointFromMRAPArn = ({ disableMultiregionAccessPoints, dualstackEndpoint = false, isCustomEndpoint, mrapAlias, hostnameSuffix, }) => { - if (disableMultiregionAccessPoints === true) { - throw new Error("SDK is attempting to use a MRAP ARN. Please enable to feature."); + toString() { + return (0, escape_element_1.escapeElement)("" + this.value); } - (0, bucketHostnameUtils_1.validateMrapAlias)(mrapAlias); - (0, bucketHostnameUtils_1.validateNoDualstack)(dualstackEndpoint); - return { - bucketEndpoint: true, - hostname: `${mrapAlias}${isCustomEndpoint ? "" : `.accesspoint.s3-global`}.${hostnameSuffix}`, - signingRegion: "*", - }; -}; -const getEndpointFromOutpostArn = ({ useArnRegion, clientRegion, clientSigningRegion = clientRegion, bucketName, outpostId, dualstackEndpoint = false, fipsEndpoint = false, tlsCompatible = true, accesspointName, isCustomEndpoint, hostnameSuffix, }) => { - (0, bucketHostnameUtils_1.validateRegionalClient)(clientRegion); - (0, bucketHostnameUtils_1.validateRegion)(bucketName.region, { useArnRegion, clientRegion, clientSigningRegion, useFipsEndpoint: fipsEndpoint }); - const DNSHostLabel = `${accesspointName}-${bucketName.accountId}`; - (0, bucketHostnameUtils_1.validateDNSHostLabel)(DNSHostLabel, { tlsCompatible }); - const endpointRegion = useArnRegion ? bucketName.region : clientRegion; - const signingRegion = useArnRegion ? bucketName.region : clientSigningRegion; - (0, bucketHostnameUtils_1.validateOutpostService)(bucketName.service); - (0, bucketHostnameUtils_1.validateDNSHostLabel)(outpostId, { tlsCompatible }); - (0, bucketHostnameUtils_1.validateNoDualstack)(dualstackEndpoint); - (0, bucketHostnameUtils_1.validateNoFIPS)(fipsEndpoint); - const hostnamePrefix = `${DNSHostLabel}.${outpostId}`; - return { - bucketEndpoint: true, - hostname: `${hostnamePrefix}${isCustomEndpoint ? "" : `.s3-outposts.${endpointRegion}`}.${hostnameSuffix}`, - signingRegion, - signingService: "s3-outposts", - }; -}; -const getEndpointFromAccessPointArn = ({ useArnRegion, clientRegion, clientSigningRegion = clientRegion, bucketName, dualstackEndpoint = false, fipsEndpoint = false, tlsCompatible = true, accesspointName, isCustomEndpoint, hostnameSuffix, }) => { - (0, bucketHostnameUtils_1.validateRegionalClient)(clientRegion); - (0, bucketHostnameUtils_1.validateRegion)(bucketName.region, { - useArnRegion, - clientRegion, - clientSigningRegion, - allowFipsRegion: true, - useFipsEndpoint: fipsEndpoint, - }); - const hostnamePrefix = `${accesspointName}-${bucketName.accountId}`; - (0, bucketHostnameUtils_1.validateDNSHostLabel)(hostnamePrefix, { tlsCompatible }); - const endpointRegion = useArnRegion ? bucketName.region : clientRegion; - const signingRegion = useArnRegion ? bucketName.region : clientSigningRegion; - (0, bucketHostnameUtils_1.validateS3Service)(bucketName.service); - return { - bucketEndpoint: true, - hostname: `${hostnamePrefix}${isCustomEndpoint - ? "" - : `.s3-accesspoint${fipsEndpoint ? "-fips" : ""}${dualstackEndpoint ? ".dualstack" : ""}.${endpointRegion}`}.${hostnameSuffix}`, - signingRegion, - }; -}; +} +exports.XmlText = XmlText; /***/ }), -<<<<<<< HEAD -/***/ 58189: -======= -/***/ 79495: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 35988: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.validateMrapAlias = exports.validateNoFIPS = exports.validateNoDualstack = exports.getArnResources = exports.validateCustomEndpoint = exports.validateDNSHostLabel = exports.validateAccountId = exports.validateRegionalClient = exports.validateRegion = exports.validatePartition = exports.validateOutpostService = exports.validateS3Service = exports.validateService = exports.validateArnEndpointOptions = exports.getSuffixForArnEndpoint = exports.getSuffix = exports.isDnsCompatibleBucketName = exports.isBucketNameOptions = exports.S3_HOSTNAME_PATTERN = exports.DOT_PATTERN = void 0; -const DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; -const IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; -const DOTS_PATTERN = /\.\./; -exports.DOT_PATTERN = /\./; -exports.S3_HOSTNAME_PATTERN = /^(.+\.)?s3(-fips)?(\.dualstack)?[.-]([a-z0-9-]+)\./; -const S3_US_EAST_1_ALTNAME_PATTERN = /^s3(-external-1)?\.amazonaws\.com$/; -const AWS_PARTITION_SUFFIX = "amazonaws.com"; -const isBucketNameOptions = (options) => typeof options.bucketName === "string"; -exports.isBucketNameOptions = isBucketNameOptions; -const isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName); -exports.isDnsCompatibleBucketName = isDnsCompatibleBucketName; -const getRegionalSuffix = (hostname) => { - const parts = hostname.match(exports.S3_HOSTNAME_PATTERN); - return [parts[4], hostname.replace(new RegExp(`^${parts[0]}`), "")]; -}; -const getSuffix = (hostname) => S3_US_EAST_1_ALTNAME_PATTERN.test(hostname) ? ["us-east-1", AWS_PARTITION_SUFFIX] : getRegionalSuffix(hostname); -exports.getSuffix = getSuffix; -const getSuffixForArnEndpoint = (hostname) => S3_US_EAST_1_ALTNAME_PATTERN.test(hostname) - ? [hostname.replace(`.${AWS_PARTITION_SUFFIX}`, ""), AWS_PARTITION_SUFFIX] - : getRegionalSuffix(hostname); -exports.getSuffixForArnEndpoint = getSuffixForArnEndpoint; -const validateArnEndpointOptions = (options) => { - if (options.pathStyleEndpoint) { - throw new Error("Path-style S3 endpoint is not supported when bucket is an ARN"); - } - if (options.accelerateEndpoint) { - throw new Error("Accelerate endpoint is not supported when bucket is an ARN"); - } - if (!options.tlsCompatible) { - throw new Error("HTTPS is required when bucket is an ARN"); - } -}; -exports.validateArnEndpointOptions = validateArnEndpointOptions; -const validateService = (service) => { - if (service !== "s3" && service !== "s3-outposts" && service !== "s3-object-lambda") { - throw new Error("Expect 's3' or 's3-outposts' or 's3-object-lambda' in ARN service component"); - } -}; -exports.validateService = validateService; -const validateS3Service = (service) => { - if (service !== "s3") { - throw new Error("Expect 's3' in Accesspoint ARN service component"); - } -}; -exports.validateS3Service = validateS3Service; -const validateOutpostService = (service) => { - if (service !== "s3-outposts") { - throw new Error("Expect 's3-posts' in Outpost ARN service component"); - } -}; -exports.validateOutpostService = validateOutpostService; -const validatePartition = (partition, options) => { - if (partition !== options.clientPartition) { - throw new Error(`Partition in ARN is incompatible, got "${partition}" but expected "${options.clientPartition}"`); - } -}; -exports.validatePartition = validatePartition; -const validateRegion = (region, options) => { - if (region === "") { - throw new Error("ARN region is empty"); - } - if (options.useFipsEndpoint) { - if (!options.allowFipsRegion) { - throw new Error("FIPS region is not supported"); - } - else if (!isEqualRegions(region, options.clientRegion)) { - throw new Error(`Client FIPS region ${options.clientRegion} doesn't match region ${region} in ARN`); - } - } - if (!options.useArnRegion && - !isEqualRegions(region, options.clientRegion || "") && - !isEqualRegions(region, options.clientSigningRegion || "")) { - throw new Error(`Region in ARN is incompatible, got ${region} but expected ${options.clientRegion}`); - } -}; -exports.validateRegion = validateRegion; -const validateRegionalClient = (region) => { - if (["s3-external-1", "aws-global"].includes(region)) { - throw new Error(`Client region ${region} is not regional`); - } -}; -exports.validateRegionalClient = validateRegionalClient; -const isEqualRegions = (regionA, regionB) => regionA === regionB; -const validateAccountId = (accountId) => { - if (!/[0-9]{12}/.exec(accountId)) { - throw new Error("Access point ARN accountID does not match regex '[0-9]{12}'"); - } -}; -exports.validateAccountId = validateAccountId; -const validateDNSHostLabel = (label, options = { tlsCompatible: true }) => { - if (label.length >= 64 || - !/^[a-z0-9][a-z0-9.-]*[a-z0-9]$/.test(label) || - /(\d+\.){3}\d+/.test(label) || - /[.-]{2}/.test(label) || - ((options === null || options === void 0 ? void 0 : options.tlsCompatible) && exports.DOT_PATTERN.test(label))) { - throw new Error(`Invalid DNS label ${label}`); - } -}; -exports.validateDNSHostLabel = validateDNSHostLabel; -const validateCustomEndpoint = (options) => { - if (options.isCustomEndpoint) { - if (options.dualstackEndpoint) - throw new Error("Dualstack endpoint is not supported with custom endpoint"); - if (options.accelerateEndpoint) - throw new Error("Accelerate endpoint is not supported with custom endpoint"); - } -}; -exports.validateCustomEndpoint = validateCustomEndpoint; -const getArnResources = (resource) => { - const delimiter = resource.includes(":") ? ":" : "/"; - const [resourceType, ...rest] = resource.split(delimiter); - if (resourceType === "accesspoint") { - if (rest.length !== 1 || rest[0] === "") { - throw new Error(`Access Point ARN should have one resource accesspoint${delimiter}{accesspointname}`); - } - return { accesspointName: rest[0] }; - } - else if (resourceType === "outpost") { - if (!rest[0] || rest[1] !== "accesspoint" || !rest[2] || rest.length !== 3) { - throw new Error(`Outpost ARN should have resource outpost${delimiter}{outpostId}${delimiter}accesspoint${delimiter}{accesspointName}`); - } - const [outpostId, _, accesspointName] = rest; - return { outpostId, accesspointName }; - } - else { - throw new Error(`ARN resource should begin with 'accesspoint${delimiter}' or 'outpost${delimiter}'`); - } -}; -exports.getArnResources = getArnResources; -const validateNoDualstack = (dualstackEndpoint) => { - if (dualstackEndpoint) - throw new Error("Dualstack endpoint is not supported with Outpost or Multi-region Access Point ARN."); -}; -exports.validateNoDualstack = validateNoDualstack; -const validateNoFIPS = (useFipsEndpoint) => { - if (useFipsEndpoint) - throw new Error(`FIPS region is not supported with Outpost.`); -}; -exports.validateNoFIPS = validateNoFIPS; -const validateMrapAlias = (name) => { - try { - name.split(".").forEach((label) => { - (0, exports.validateDNSHostLabel)(label); - }); - } - catch (e) { - throw new Error(`"${name}" is not a DNS compatible name.`); - } -}; -exports.validateMrapAlias = validateMrapAlias; +exports.escapeAttribute = void 0; +function escapeAttribute(value) { + return value.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """); +} +exports.escapeAttribute = escapeAttribute; /***/ }), -<<<<<<< HEAD -/***/ 46000: -======= -/***/ 86006: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 45845: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveBucketEndpointConfig = void 0; -function resolveBucketEndpointConfig(input) { - const { bucketEndpoint = false, forcePathStyle = false, useAccelerateEndpoint = false, useArnRegion = false, disableMultiregionAccessPoints = false, } = input; - return { - ...input, - bucketEndpoint, - forcePathStyle, - useAccelerateEndpoint, - useArnRegion: typeof useArnRegion === "function" ? useArnRegion : () => Promise.resolve(useArnRegion), - disableMultiregionAccessPoints: typeof disableMultiregionAccessPoints === "function" - ? disableMultiregionAccessPoints - : () => Promise.resolve(disableMultiregionAccessPoints), - }; +exports.escapeElement = void 0; +function escapeElement(value) { + return value + .replace(/&/g, "&") + .replace(/"/g, """) + .replace(/'/g, "'") + .replace(//g, ">") + .replace(/\r/g, " ") + .replace(/\n/g, " ") + .replace(/\u0085/g, "…") + .replace(/\u2028/, "
"); } -exports.resolveBucketEndpointConfig = resolveBucketEndpointConfig; +exports.escapeElement = escapeElement; /***/ }), -<<<<<<< HEAD -/***/ 24602: -======= -/***/ 98228: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 3518: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.validateNoFIPS = exports.validateNoDualstack = exports.validateDNSHostLabel = exports.validateRegion = exports.validateAccountId = exports.validatePartition = exports.validateOutpostService = exports.getSuffixForArnEndpoint = exports.getArnResources = void 0; -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(51367); -tslib_1.__exportStar(__nccwpck_require__(78879), exports); -tslib_1.__exportStar(__nccwpck_require__(87018), exports); -tslib_1.__exportStar(__nccwpck_require__(58207), exports); -tslib_1.__exportStar(__nccwpck_require__(40339), exports); -tslib_1.__exportStar(__nccwpck_require__(46000), exports); -var bucketHostnameUtils_1 = __nccwpck_require__(58189); -======= -const tslib_1 = __nccwpck_require__(10845); -tslib_1.__exportStar(__nccwpck_require__(10179), exports); -tslib_1.__exportStar(__nccwpck_require__(73033), exports); -tslib_1.__exportStar(__nccwpck_require__(42221), exports); -tslib_1.__exportStar(__nccwpck_require__(28226), exports); -tslib_1.__exportStar(__nccwpck_require__(86006), exports); -var bucketHostnameUtils_1 = __nccwpck_require__(79495); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -Object.defineProperty(exports, "getArnResources", ({ enumerable: true, get: function () { return bucketHostnameUtils_1.getArnResources; } })); -Object.defineProperty(exports, "getSuffixForArnEndpoint", ({ enumerable: true, get: function () { return bucketHostnameUtils_1.getSuffixForArnEndpoint; } })); -Object.defineProperty(exports, "validateOutpostService", ({ enumerable: true, get: function () { return bucketHostnameUtils_1.validateOutpostService; } })); -Object.defineProperty(exports, "validatePartition", ({ enumerable: true, get: function () { return bucketHostnameUtils_1.validatePartition; } })); -Object.defineProperty(exports, "validateAccountId", ({ enumerable: true, get: function () { return bucketHostnameUtils_1.validateAccountId; } })); -Object.defineProperty(exports, "validateRegion", ({ enumerable: true, get: function () { return bucketHostnameUtils_1.validateRegion; } })); -Object.defineProperty(exports, "validateDNSHostLabel", ({ enumerable: true, get: function () { return bucketHostnameUtils_1.validateDNSHostLabel; } })); -Object.defineProperty(exports, "validateNoDualstack", ({ enumerable: true, get: function () { return bucketHostnameUtils_1.validateNoDualstack; } })); -Object.defineProperty(exports, "validateNoFIPS", ({ enumerable: true, get: function () { return bucketHostnameUtils_1.validateNoFIPS; } })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(96573), exports); +tslib_1.__exportStar(__nccwpck_require__(62990), exports); /***/ }), -<<<<<<< HEAD -/***/ 51367: -======= -/***/ 10845: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { +/***/ 62888: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/****************************************************************************** -Copyright (c) Microsoft Corporation. +var __webpack_unused_export__; -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. -<<<<<<< HEAD -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; -======= -/***/ }), +__webpack_unused_export__ = ({ + value: true +}); +Object.defineProperty(exports, "zR", ({ + enumerable: true, + get: function () { + return _nil.default; + } +})); +Object.defineProperty(exports, "Qc", ({ + enumerable: true, + get: function () { + return _parse.default; + } +})); +Object.defineProperty(exports, "Pz", ({ + enumerable: true, + get: function () { + return _stringify.default; + } +})); +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, "Gu", ({ + enumerable: true, + get: function () { + return _validate.default; + } +})); +Object.defineProperty(exports, "i8", ({ + enumerable: true, + get: function () { + return _version.default; + } +})); -/***/ 96962: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +var _v = _interopRequireDefault(__nccwpck_require__(27463)); -"use strict"; +var _v2 = _interopRequireDefault(__nccwpck_require__(99494)); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getContentLengthPlugin = exports.contentLengthMiddlewareOptions = exports.contentLengthMiddleware = void 0; -const protocol_http_1 = __nccwpck_require__(35712); -const CONTENT_LENGTH_HEADER = "content-length"; -function contentLengthMiddleware(bodyLengthChecker) { - return (next) => async (args) => { - const request = args.request; - if (protocol_http_1.HttpRequest.isInstance(request)) { - const { body, headers } = request; - if (body && - Object.keys(headers) - .map((str) => str.toLowerCase()) - .indexOf(CONTENT_LENGTH_HEADER) === -1) { - try { - const length = bodyLengthChecker(body); - request.headers = { - ...request.headers, - [CONTENT_LENGTH_HEADER]: String(length), - }; - } - catch (error) { - } ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; +var _v3 = _interopRequireDefault(__nccwpck_require__(89313)); - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; +var _v4 = _interopRequireDefault(__nccwpck_require__(40498)); - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; +var _nil = _interopRequireDefault(__nccwpck_require__(56147)); - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; +var _version = _interopRequireDefault(__nccwpck_require__(18523)); - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; +var _validate = _interopRequireDefault(__nccwpck_require__(96248)); - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +var _stringify = _interopRequireDefault(__nccwpck_require__(64811)); - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; +var _parse = _interopRequireDefault(__nccwpck_require__(28773)); - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; +/***/ }), - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; +/***/ 50349: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - __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()); - }); - }; - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; +function md5(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; + return _crypto.default.createHash('md5').update(bytes).digest(); +} - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +var _default = md5; +exports["default"] = _default; - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +/***/ }), - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; +/***/ 19824: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; +var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; +var _default = { + randomUUID: _crypto.default.randomUUID +}; +exports["default"] = _default; - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +/***/ }), - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; +/***/ 56147: +/***/ ((__unused_webpack_module, exports) => { - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = '00000000-0000-0000-0000-000000000000'; +exports["default"] = _default; - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; +/***/ }), - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; +/***/ 28773: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; -/***/ }), +var _validate = _interopRequireDefault(__nccwpck_require__(96248)); -<<<<<<< HEAD -/***/ 17335: -======= -/***/ 57411: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function parse(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError('Invalid UUID'); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getAddExpectContinuePlugin = exports.addExpectContinueMiddlewareOptions = exports.addExpectContinueMiddleware = void 0; -<<<<<<< HEAD -const protocol_http_1 = __nccwpck_require__(45311); -======= -const protocol_http_1 = __nccwpck_require__(35712); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -function addExpectContinueMiddleware(options) { - return (next) => async (args) => { - const { request } = args; - if (protocol_http_1.HttpRequest.isInstance(request) && request.body && options.runtime === "node") { - request.headers = { - ...request.headers, - Expect: "100-continue", - }; - } - return next({ - ...args, - request, - }); - }; + 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; } -exports.addExpectContinueMiddleware = addExpectContinueMiddleware; -exports.addExpectContinueMiddlewareOptions = { - step: "build", - tags: ["SET_EXPECT_HEADER", "EXPECT_HEADER"], - name: "addExpectContinueMiddleware", - override: true, -}; -const getAddExpectContinuePlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add(addExpectContinueMiddleware(options), exports.addExpectContinueMiddlewareOptions); - }, -}); -exports.getAddExpectContinuePlugin = getAddExpectContinuePlugin; +var _default = parse; +exports["default"] = _default; /***/ }), -<<<<<<< HEAD -/***/ 62058: -======= -/***/ 62339: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 95914: /***/ ((__unused_webpack_module, exports) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.S3_EXPRESS_DEFAULT_CHECKSUM_ALGORITHM = exports.DEFAULT_CHECKSUM_ALGORITHM = exports.ChecksumLocation = exports.ChecksumAlgorithm = void 0; -var ChecksumAlgorithm; -(function (ChecksumAlgorithm) { - ChecksumAlgorithm["MD5"] = "MD5"; - ChecksumAlgorithm["CRC32"] = "CRC32"; - ChecksumAlgorithm["CRC32C"] = "CRC32C"; - ChecksumAlgorithm["SHA1"] = "SHA1"; - ChecksumAlgorithm["SHA256"] = "SHA256"; -})(ChecksumAlgorithm = exports.ChecksumAlgorithm || (exports.ChecksumAlgorithm = {})); -var ChecksumLocation; -(function (ChecksumLocation) { - ChecksumLocation["HEADER"] = "header"; - ChecksumLocation["TRAILER"] = "trailer"; -})(ChecksumLocation = exports.ChecksumLocation || (exports.ChecksumLocation = {})); -exports.DEFAULT_CHECKSUM_ALGORITHM = ChecksumAlgorithm.MD5; -exports.S3_EXPRESS_DEFAULT_CHECKSUM_ALGORITHM = ChecksumAlgorithm.CRC32; +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; /***/ }), -<<<<<<< HEAD -/***/ 68300: -======= -/***/ 8914: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 49997: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -exports.flexibleChecksumsMiddleware = exports.flexibleChecksumsMiddlewareOptions = void 0; -const protocol_http_1 = __nccwpck_require__(45311); -const getChecksumAlgorithmForRequest_1 = __nccwpck_require__(29372); -const getChecksumLocationName_1 = __nccwpck_require__(94642); -const hasHeader_1 = __nccwpck_require__(61513); -const isStreaming_1 = __nccwpck_require__(44558); -const selectChecksumAlgorithmFunction_1 = __nccwpck_require__(62671); -const stringHasher_1 = __nccwpck_require__(81763); -exports.flexibleChecksumsMiddlewareOptions = { - name: "flexibleChecksumsMiddleware", - step: "build", - tags: ["BODY_CHECKSUM"], - override: true, -}; -const flexibleChecksumsMiddleware = (config, middlewareConfig) => (next, context) => async (args) => { -======= -exports.flexibleChecksumsMiddleware = void 0; -const protocol_http_1 = __nccwpck_require__(35712); -const getChecksumAlgorithmForRequest_1 = __nccwpck_require__(91039); -const getChecksumLocationName_1 = __nccwpck_require__(38235); -const hasHeader_1 = __nccwpck_require__(80851); -const isStreaming_1 = __nccwpck_require__(7424); -const selectChecksumAlgorithmFunction_1 = __nccwpck_require__(95991); -const stringHasher_1 = __nccwpck_require__(83826); -const validateChecksumFromResponse_1 = __nccwpck_require__(33742); -const flexibleChecksumsMiddleware = (config, middlewareConfig) => (next) => async (args) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - if (!protocol_http_1.HttpRequest.isInstance(args.request)) { - return next(args); - } - const { request } = args; - const { body: requestBody, headers } = request; - const { base64Encoder, streamHasher } = config; - const { input, requestChecksumRequired, requestAlgorithmMember } = middlewareConfig; - const checksumAlgorithm = (0, getChecksumAlgorithmForRequest_1.getChecksumAlgorithmForRequest)(input, { - requestChecksumRequired, - requestAlgorithmMember, - }, !!context.isS3ExpressBucket); - let updatedBody = requestBody; - let updatedHeaders = headers; - if (checksumAlgorithm) { - const checksumLocationName = (0, getChecksumLocationName_1.getChecksumLocationName)(checksumAlgorithm); - const checksumAlgorithmFn = (0, selectChecksumAlgorithmFunction_1.selectChecksumAlgorithmFunction)(checksumAlgorithm, config); - if ((0, isStreaming_1.isStreaming)(requestBody)) { - const { getAwsChunkedEncodingStream, bodyLengthChecker } = config; - updatedBody = getAwsChunkedEncodingStream(requestBody, { - base64Encoder, - bodyLengthChecker, - checksumLocationName, - checksumAlgorithmFn, - streamHasher, - }); - updatedHeaders = { - ...headers, - "content-encoding": headers["content-encoding"] - ? `${headers["content-encoding"]},aws-chunked` - : "aws-chunked", - "transfer-encoding": "chunked", - "x-amz-decoded-content-length": headers["content-length"], - "x-amz-content-sha256": "STREAMING-UNSIGNED-PAYLOAD-TRAILER", - "x-amz-trailer": checksumLocationName, - }; - delete updatedHeaders["content-length"]; - } - else if (!(0, hasHeader_1.hasHeader)(checksumLocationName, headers)) { - const rawChecksum = await (0, stringHasher_1.stringHasher)(checksumAlgorithmFn, requestBody); - updatedHeaders = { - ...headers, - [checksumLocationName]: base64Encoder(rawChecksum), - }; - } - } - const result = await next({ - ...args, - request: { - ...request, - headers: updatedHeaders, - body: updatedBody, - }, - }); - return result; -}; -exports.flexibleChecksumsMiddleware = flexibleChecksumsMiddleware; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = rng; -/***/ }), +var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); -<<<<<<< HEAD -/***/ 58608: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.flexibleChecksumsResponseMiddleware = exports.flexibleChecksumsResponseMiddlewareOptions = void 0; -const protocol_http_1 = __nccwpck_require__(45311); -const getChecksumAlgorithmListForResponse_1 = __nccwpck_require__(27358); -const getChecksumLocationName_1 = __nccwpck_require__(94642); -const isChecksumWithPartNumber_1 = __nccwpck_require__(42726); -const isStreaming_1 = __nccwpck_require__(44558); -const create_read_stream_on_buffer_1 = __nccwpck_require__(31327); -const validateChecksumFromResponse_1 = __nccwpck_require__(79295); -exports.flexibleChecksumsResponseMiddlewareOptions = { - name: "flexibleChecksumsResponseMiddleware", - toMiddleware: "deserializerMiddleware", - relation: "after", - tags: ["BODY_CHECKSUM"], - override: true, -}; -const flexibleChecksumsResponseMiddleware = (config, middlewareConfig) => (next, context) => async (args) => { - if (!protocol_http_1.HttpRequest.isInstance(args.request)) { - return next(args); - } - const input = args.input; - const result = await next(args); - const response = result.response; - let collectedStream = undefined; - const { requestValidationModeMember, responseAlgorithms } = middlewareConfig; - if (requestValidationModeMember && input[requestValidationModeMember] === "ENABLED") { - const { clientName, commandName } = context; - const isS3WholeObjectMultipartGetResponseChecksum = clientName === "S3Client" && - commandName === "GetObjectCommand" && - (0, getChecksumAlgorithmListForResponse_1.getChecksumAlgorithmListForResponse)(responseAlgorithms).every((algorithm) => { - const responseHeader = (0, getChecksumLocationName_1.getChecksumLocationName)(algorithm); - const checksumFromResponse = response.headers[responseHeader]; - return !checksumFromResponse || (0, isChecksumWithPartNumber_1.isChecksumWithPartNumber)(checksumFromResponse); - }); - if (isS3WholeObjectMultipartGetResponseChecksum) { - return result; - } - const isStreamingBody = (0, isStreaming_1.isStreaming)(response.body); - if (isStreamingBody) { - collectedStream = await config.streamCollector(response.body); - response.body = (0, create_read_stream_on_buffer_1.createReadStreamOnBuffer)(collectedStream); - } - await (0, validateChecksumFromResponse_1.validateChecksumFromResponse)(result.response, { - config, - responseAlgorithms, - }); - if (isStreamingBody && collectedStream) { - response.body = (0, create_read_stream_on_buffer_1.createReadStreamOnBuffer)(collectedStream); - } - } - return result; -}; -exports.flexibleChecksumsResponseMiddleware = flexibleChecksumsResponseMiddleware; +let poolPtr = rnds8Pool.length; + +function rng() { + if (poolPtr > rnds8Pool.length - 16) { + _crypto.default.randomFillSync(rnds8Pool); + + poolPtr = 0; + } + return rnds8Pool.slice(poolPtr, poolPtr += 16); +} /***/ }), -/***/ 14094: -======= -/***/ 32202: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 16609: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getChecksum = void 0; -<<<<<<< HEAD -const isStreaming_1 = __nccwpck_require__(44558); -const stringHasher_1 = __nccwpck_require__(81763); -======= -const isStreaming_1 = __nccwpck_require__(7424); -const stringHasher_1 = __nccwpck_require__(83826); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const getChecksum = async (body, { streamHasher, checksumAlgorithmFn, base64Encoder }) => { - const digest = (0, isStreaming_1.isStreaming)(body) ? streamHasher(checksumAlgorithmFn, body) : (0, stringHasher_1.stringHasher)(checksumAlgorithmFn, body); - return base64Encoder(await digest); -}; -exports.getChecksum = getChecksum; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; -/***/ }), +var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); -<<<<<<< HEAD -/***/ 29372: -======= -/***/ 91039: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +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'); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getChecksumAlgorithmForRequest = void 0; -<<<<<<< HEAD -const constants_1 = __nccwpck_require__(62058); -const types_1 = __nccwpck_require__(83364); -const getChecksumAlgorithmForRequest = (input, { requestChecksumRequired, requestAlgorithmMember }, isS3Express) => { - const defaultAlgorithm = isS3Express ? constants_1.S3_EXPRESS_DEFAULT_CHECKSUM_ALGORITHM : constants_1.DEFAULT_CHECKSUM_ALGORITHM; -======= -const constants_1 = __nccwpck_require__(62339); -const types_1 = __nccwpck_require__(39967); -const getChecksumAlgorithmForRequest = (input, { requestChecksumRequired, requestAlgorithmMember }) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - if (!requestAlgorithmMember || !input[requestAlgorithmMember]) { - return requestChecksumRequired ? defaultAlgorithm : undefined; - } - const checksumAlgorithm = input[requestAlgorithmMember]; - if (!types_1.CLIENT_SUPPORTED_ALGORITHMS.includes(checksumAlgorithm)) { - throw new Error(`The checksum algorithm "${checksumAlgorithm}" is not supported by the client.` + - ` Select one of ${types_1.CLIENT_SUPPORTED_ALGORITHMS}.`); - } - return checksumAlgorithm; -}; -exports.getChecksumAlgorithmForRequest = getChecksumAlgorithmForRequest; + return _crypto.default.createHash('sha1').update(bytes).digest(); +} +var _default = sha1; +exports["default"] = _default; /***/ }), -<<<<<<< HEAD -/***/ 27358: -======= -/***/ 45618: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 64811: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getChecksumAlgorithmListForResponse = void 0; -<<<<<<< HEAD -const types_1 = __nccwpck_require__(83364); -======= -const types_1 = __nccwpck_require__(39967); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const getChecksumAlgorithmListForResponse = (responseAlgorithms = []) => { - const validChecksumAlgorithms = []; - for (const algorithm of types_1.PRIORITY_ORDER_ALGORITHMS) { - if (!responseAlgorithms.includes(algorithm) || !types_1.CLIENT_SUPPORTED_ALGORITHMS.includes(algorithm)) { - continue; - } - validChecksumAlgorithms.push(algorithm); - } - return validChecksumAlgorithms; -}; -exports.getChecksumAlgorithmListForResponse = getChecksumAlgorithmListForResponse; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +exports.unsafeStringify = unsafeStringify; -/***/ }), +var _validate = _interopRequireDefault(__nccwpck_require__(96248)); -<<<<<<< HEAD -/***/ 94642: -======= -/***/ 38235: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +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 = []; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getChecksumLocationName = void 0; -<<<<<<< HEAD -const constants_1 = __nccwpck_require__(62058); -======= -const constants_1 = __nccwpck_require__(62339); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const getChecksumLocationName = (algorithm) => algorithm === constants_1.ChecksumAlgorithm.MD5 ? "content-md5" : `x-amz-checksum-${algorithm.toLowerCase()}`; -exports.getChecksumLocationName = getChecksumLocationName; +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).slice(1)); +} + +function unsafeStringify(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 + return 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]]; +} + +function stringify(arr, offset = 0) { + const uuid = unsafeStringify(arr, offset); // 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; /***/ }), -<<<<<<< HEAD -/***/ 83578: -======= -/***/ 48743: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 27463: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -exports.getFlexibleChecksumsPlugin = void 0; -const flexibleChecksumsMiddleware_1 = __nccwpck_require__(68300); -const flexibleChecksumsResponseMiddleware_1 = __nccwpck_require__(58608); -======= -exports.getFlexibleChecksumsPlugin = exports.flexibleChecksumsMiddlewareOptions = void 0; -const flexibleChecksumsMiddleware_1 = __nccwpck_require__(8914); -exports.flexibleChecksumsMiddlewareOptions = { - name: "flexibleChecksumsMiddleware", - step: "build", - tags: ["BODY_CHECKSUM"], - override: true, -}; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const getFlexibleChecksumsPlugin = (config, middlewareConfig) => ({ - applyToStack: (clientStack) => { - clientStack.add((0, flexibleChecksumsMiddleware_1.flexibleChecksumsMiddleware)(config, middlewareConfig), flexibleChecksumsMiddleware_1.flexibleChecksumsMiddlewareOptions); - clientStack.addRelativeTo((0, flexibleChecksumsResponseMiddleware_1.flexibleChecksumsResponseMiddleware)(config, middlewareConfig), flexibleChecksumsResponseMiddleware_1.flexibleChecksumsResponseMiddlewareOptions); - }, -}); -exports.getFlexibleChecksumsPlugin = getFlexibleChecksumsPlugin; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; -/***/ }), +var _rng = _interopRequireDefault(__nccwpck_require__(49997)); -<<<<<<< HEAD -/***/ 61513: -======= -/***/ 80851: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { +var _stringify = __nccwpck_require__(64811); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hasHeader = void 0; -const hasHeader = (header, headers) => { - const soughtHeader = header.toLowerCase(); - for (const headerName of Object.keys(headers)) { - if (soughtHeader === headerName.toLowerCase()) { - return true; - } - } - return false; -}; -exports.hasHeader = hasHeader; +// **`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 -/***/ }), -<<<<<<< HEAD -/***/ 53106: -======= -/***/ 77389: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +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 -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(17819); -tslib_1.__exportStar(__nccwpck_require__(62058), exports); -tslib_1.__exportStar(__nccwpck_require__(68300), exports); -tslib_1.__exportStar(__nccwpck_require__(83578), exports); -======= -const tslib_1 = __nccwpck_require__(42379); -tslib_1.__exportStar(__nccwpck_require__(62339), exports); -tslib_1.__exportStar(__nccwpck_require__(8914), exports); -tslib_1.__exportStar(__nccwpck_require__(48743), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + 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. -<<<<<<< HEAD -/***/ 42726: -/***/ ((__unused_webpack_module, exports) => { + 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 -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isChecksumWithPartNumber = void 0; -const isChecksumWithPartNumber = (checksum) => { - const lastHyphenIndex = checksum.lastIndexOf("-"); - if (lastHyphenIndex !== -1) { - const numberPart = checksum.slice(lastHyphenIndex + 1); - if (!numberPart.startsWith("0")) { - const number = parseInt(numberPart, 10); - if (!isNaN(number) && number >= 1 && number <= 10000) { - return true; - } - } - } - return false; -}; -exports.isChecksumWithPartNumber = isChecksumWithPartNumber; + 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 -/***/ 44558: -======= -/***/ 7424: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } // Per 4.2.1.2 Throw error if too many uuids are requested -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isStreaming = void 0; -<<<<<<< HEAD -const is_array_buffer_1 = __nccwpck_require__(80743); -======= -const is_array_buffer_1 = __nccwpck_require__(1627); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const isStreaming = (body) => body !== undefined && typeof body !== "string" && !ArrayBuffer.isView(body) && !(0, is_array_buffer_1.isArrayBuffer)(body); -exports.isStreaming = isStreaming; + 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 -<<<<<<< HEAD -/***/ 62671: -======= -/***/ 95991: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + 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` -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.selectChecksumAlgorithmFunction = void 0; -<<<<<<< HEAD -const crc32_1 = __nccwpck_require__(30343); -const crc32c_1 = __nccwpck_require__(21256); -const constants_1 = __nccwpck_require__(62058); -======= -const crc32_1 = __nccwpck_require__(51224); -const crc32c_1 = __nccwpck_require__(47003); -const constants_1 = __nccwpck_require__(62339); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const selectChecksumAlgorithmFunction = (checksumAlgorithm, config) => ({ - [constants_1.ChecksumAlgorithm.MD5]: config.md5, - [constants_1.ChecksumAlgorithm.CRC32]: crc32_1.AwsCrc32, - [constants_1.ChecksumAlgorithm.CRC32C]: crc32c_1.AwsCrc32c, - [constants_1.ChecksumAlgorithm.SHA1]: config.sha1, - [constants_1.ChecksumAlgorithm.SHA256]: config.sha256, -}[checksumAlgorithm]); -exports.selectChecksumAlgorithmFunction = selectChecksumAlgorithmFunction; + 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) -<<<<<<< HEAD -/***/ 31327: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` + b[i++] = clockseq & 0xff; // `node` -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createReadStreamOnBuffer = void 0; -const stream_1 = __nccwpck_require__(12781); -function createReadStreamOnBuffer(buffer) { - const stream = new stream_1.Transform(); - stream.push(buffer); - stream.push(null); - return stream; + for (let n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + + return buf || (0, _stringify.unsafeStringify)(b); } -exports.createReadStreamOnBuffer = createReadStreamOnBuffer; +var _default = v1; +exports["default"] = _default; /***/ }), -/***/ 81763: +/***/ 99494: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -======= -/***/ 83826: -/***/ ((__unused_webpack_module, exports) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.stringHasher = void 0; -const util_utf8_1 = __nccwpck_require__(38134); -const stringHasher = (checksumAlgorithmFn, body) => { - const hash = new checksumAlgorithmFn(); - hash.update((0, util_utf8_1.toUint8Array)(body || "")); - return hash.digest(); -}; -exports.stringHasher = stringHasher; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _v = _interopRequireDefault(__nccwpck_require__(87724)); + +var _md = _interopRequireDefault(__nccwpck_require__(50349)); + +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; /***/ }), -<<<<<<< HEAD -/***/ 83364: -======= -/***/ 39967: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 87724: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PRIORITY_ORDER_ALGORITHMS = exports.CLIENT_SUPPORTED_ALGORITHMS = void 0; -<<<<<<< HEAD -const constants_1 = __nccwpck_require__(62058); -======= -const constants_1 = __nccwpck_require__(62339); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -exports.CLIENT_SUPPORTED_ALGORITHMS = [ - constants_1.ChecksumAlgorithm.CRC32, - constants_1.ChecksumAlgorithm.CRC32C, - constants_1.ChecksumAlgorithm.SHA1, - constants_1.ChecksumAlgorithm.SHA256, -]; -exports.PRIORITY_ORDER_ALGORITHMS = [ - constants_1.ChecksumAlgorithm.CRC32, - constants_1.ChecksumAlgorithm.CRC32C, - constants_1.ChecksumAlgorithm.SHA1, - constants_1.ChecksumAlgorithm.SHA256, -]; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.URL = exports.DNS = void 0; +exports["default"] = v35; -/***/ }), +var _stringify = __nccwpck_require__(64811); -<<<<<<< HEAD -/***/ 79295: -======= -/***/ 33742: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +var _parse = _interopRequireDefault(__nccwpck_require__(28773)); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.validateChecksumFromResponse = void 0; -<<<<<<< HEAD -const getChecksum_1 = __nccwpck_require__(14094); -const getChecksumAlgorithmListForResponse_1 = __nccwpck_require__(27358); -const getChecksumLocationName_1 = __nccwpck_require__(94642); -const selectChecksumAlgorithmFunction_1 = __nccwpck_require__(62671); -======= -const getChecksum_1 = __nccwpck_require__(32202); -const getChecksumAlgorithmListForResponse_1 = __nccwpck_require__(45618); -const getChecksumLocationName_1 = __nccwpck_require__(38235); -const selectChecksumAlgorithmFunction_1 = __nccwpck_require__(95991); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const validateChecksumFromResponse = async (response, { config, responseAlgorithms }) => { - const checksumAlgorithms = (0, getChecksumAlgorithmListForResponse_1.getChecksumAlgorithmListForResponse)(responseAlgorithms); - const { body: responseBody, headers: responseHeaders } = response; - for (const algorithm of checksumAlgorithms) { - const responseHeader = (0, getChecksumLocationName_1.getChecksumLocationName)(algorithm); - const checksumFromResponse = responseHeaders[responseHeader]; - if (checksumFromResponse) { - const checksumAlgorithmFn = (0, selectChecksumAlgorithmFunction_1.selectChecksumAlgorithmFunction)(algorithm, config); - const { streamHasher, base64Encoder } = config; - const checksum = await (0, getChecksum_1.getChecksum)(responseBody, { streamHasher, checksumAlgorithmFn, base64Encoder }); - if (checksum === checksumFromResponse) { - break; - } - throw new Error(`Checksum mismatch: expected "${checksum}" but received "${checksumFromResponse}"` + - ` in response header "${responseHeader}".`); - } - } -}; -exports.validateChecksumFromResponse = validateChecksumFromResponse; +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape + const bytes = []; -/***/ }), + for (let i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); + } -<<<<<<< HEAD -/***/ 17819: -======= -/***/ 42379: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { + return bytes; +} -/****************************************************************************** -Copyright (c) Microsoft Corporation. +const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +exports.DNS = DNS; +const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +exports.URL = URL; -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. +function v35(name, version, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + var _namespace; -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); + if (typeof value === 'string') { + value = stringToBytes(value); } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + + if (typeof namespace === 'string') { + namespace = (0, _parse.default)(namespace); } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; + if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _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])` - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; + 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; - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; + if (buf) { + offset = offset || 0; - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; + return buf; + } - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; + return (0, _stringify.unsafeStringify)(bytes); + } // Function#name is not settable on some platforms (#270) - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; + try { + generateUUID.name = name; // eslint-disable-next-line no-empty + } catch (err) {} // For CommonJS default export support - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - __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()); - }); - }; + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; +} - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; +/***/ }), - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +/***/ 89313: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +var _native = _interopRequireDefault(__nccwpck_require__(19824)); - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +var _rng = _interopRequireDefault(__nccwpck_require__(49997)); - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; +var _stringify = __nccwpck_require__(64811); - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +function v4(options, buf, offset) { + if (_native.default.randomUUID && !buf && !options) { + return _native.default.randomUUID(); + } - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; + options = options || {}; - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; + const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; + rnds[6] = rnds[6] & 0x0f | 0x40; + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; + if (buf) { + offset = offset || 0; - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; + return buf; + } - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; + return (0, _stringify.unsafeStringify)(rnds); +} - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; +var _default = v4; +exports["default"] = _default; - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; +/***/ }), - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; +/***/ 40498: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _v = _interopRequireDefault(__nccwpck_require__(87724)); + +var _sha = _interopRequireDefault(__nccwpck_require__(16609)); + +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; /***/ }), -<<<<<<< HEAD -/***/ 23213: -======= -/***/ 18127: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 96248: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getHostHeaderPlugin = exports.hostHeaderMiddlewareOptions = exports.hostHeaderMiddleware = exports.resolveHostHeaderConfig = void 0; -<<<<<<< HEAD -const protocol_http_1 = __nccwpck_require__(45311); -======= -const protocol_http_1 = __nccwpck_require__(35712); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -function resolveHostHeaderConfig(input) { - return input; -} -exports.resolveHostHeaderConfig = resolveHostHeaderConfig; -const hostHeaderMiddleware = (options) => (next) => async (args) => { - if (!protocol_http_1.HttpRequest.isInstance(args.request)) - return next(args); - const { request } = args; - const { handlerProtocol = "" } = options.requestHandler.metadata || {}; - if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) { - delete request.headers["host"]; - request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : ""); - } - else if (!request.headers["host"]) { - let host = request.hostname; - if (request.port != null) - host += `:${request.port}`; - request.headers["host"] = host; - } - return next(args); -}; -exports.hostHeaderMiddleware = hostHeaderMiddleware; -exports.hostHeaderMiddlewareOptions = { - name: "hostHeaderMiddleware", - step: "build", - priority: "low", - tags: ["HOST"], - override: true, -}; -const getHostHeaderPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add((0, exports.hostHeaderMiddleware)(options), exports.hostHeaderMiddlewareOptions); - }, -}); -exports.getHostHeaderPlugin = getHostHeaderPlugin; - -/***/ }), +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; -<<<<<<< HEAD -/***/ 0: -======= -/***/ 13882: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { +var _regex = _interopRequireDefault(__nccwpck_require__(95914)); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getLocationConstraintPlugin = exports.locationConstraintMiddlewareOptions = exports.locationConstraintMiddleware = void 0; -function locationConstraintMiddleware(options) { - return (next) => async (args) => { - const { CreateBucketConfiguration } = args.input; - const region = await options.region(); - if (!(CreateBucketConfiguration === null || CreateBucketConfiguration === void 0 ? void 0 : CreateBucketConfiguration.LocationConstraint) && !(CreateBucketConfiguration === null || CreateBucketConfiguration === void 0 ? void 0 : CreateBucketConfiguration.Location)) { - args = { - ...args, - input: { - ...args.input, - CreateBucketConfiguration: region === "us-east-1" ? undefined : { LocationConstraint: region }, - }, - }; - } - return next(args); - }; +function validate(uuid) { + return typeof uuid === 'string' && _regex.default.test(uuid); } -exports.locationConstraintMiddleware = locationConstraintMiddleware; -exports.locationConstraintMiddlewareOptions = { - step: "initialize", - tags: ["LOCATION_CONSTRAINT", "CREATE_BUCKET_CONFIGURATION"], - name: "locationConstraintMiddleware", - override: true, -}; -const getLocationConstraintPlugin = (config) => ({ - applyToStack: (clientStack) => { - clientStack.add(locationConstraintMiddleware(config), exports.locationConstraintMiddlewareOptions); - }, -}); -exports.getLocationConstraintPlugin = getLocationConstraintPlugin; +var _default = validate; +exports["default"] = _default; /***/ }), -<<<<<<< HEAD -/***/ 45288: -======= -/***/ 67662: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 18523: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(39680); -tslib_1.__exportStar(__nccwpck_require__(70104), exports); -======= -const tslib_1 = __nccwpck_require__(1885); -tslib_1.__exportStar(__nccwpck_require__(12764), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; -/***/ }), +var _validate = _interopRequireDefault(__nccwpck_require__(96248)); -<<<<<<< HEAD -/***/ 70104: -======= -/***/ 12764: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function version(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError('Invalid UUID'); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getLoggerPlugin = exports.loggerMiddlewareOptions = exports.loggerMiddleware = void 0; -const loggerMiddleware = () => (next, context) => async (args) => { - var _a, _b; - try { - const response = await next(args); - const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context; - const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions; - const inputFilterSensitiveLog = overrideInputFilterSensitiveLog !== null && overrideInputFilterSensitiveLog !== void 0 ? overrideInputFilterSensitiveLog : context.inputFilterSensitiveLog; - const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog !== null && overrideOutputFilterSensitiveLog !== void 0 ? overrideOutputFilterSensitiveLog : context.outputFilterSensitiveLog; - const { $metadata, ...outputWithoutMetadata } = response.output; - (_a = logger === null || logger === void 0 ? void 0 : logger.info) === null || _a === void 0 ? void 0 : _a.call(logger, { - clientName, - commandName, - input: inputFilterSensitiveLog(args.input), - output: outputFilterSensitiveLog(outputWithoutMetadata), - metadata: $metadata, - }); - return response; - } - catch (error) { - const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context; - const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions; - const inputFilterSensitiveLog = overrideInputFilterSensitiveLog !== null && overrideInputFilterSensitiveLog !== void 0 ? overrideInputFilterSensitiveLog : context.inputFilterSensitiveLog; - (_b = logger === null || logger === void 0 ? void 0 : logger.error) === null || _b === void 0 ? void 0 : _b.call(logger, { - clientName, - commandName, - input: inputFilterSensitiveLog(args.input), - error, - metadata: error.$metadata, - }); - throw error; - } -}; -exports.loggerMiddleware = loggerMiddleware; -exports.loggerMiddlewareOptions = { - name: "loggerMiddleware", - tags: ["LOGGER"], - step: "initialize", - override: true, -}; -const getLoggerPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add((0, exports.loggerMiddleware)(), exports.loggerMiddlewareOptions); - }, -}); -exports.getLoggerPlugin = getLoggerPlugin; + return parseInt(uuid.slice(14, 15), 16); +} +var _default = version; +exports["default"] = _default; /***/ }), -<<<<<<< HEAD -/***/ 39680: -======= -/***/ 1885: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 40011: /***/ ((module) => { -/****************************************************************************** -Copyright (c) Microsoft Corporation. +module.exports = read -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. +var MSB = 0x80 + , REST = 0x7F -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; +function read(buf, offset) { + var res = 0 + , offset = offset || 0 + , shift = 0 + , counter = offset + , b + , l = buf.length + + do { + if (counter >= l || shift > 49) { + read.bytes = 0 + throw new RangeError('Could not decode varint') } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + b = buf[counter++] + res += shift < 28 + ? (b & REST) << shift + : (b & REST) * Math.pow(2, shift) + shift += 7 + } while (b >= MSB) - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; + read.bytes = counter - offset - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; + return res +} - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; +/***/ }), - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +/***/ 346: +/***/ ((module) => { - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; +module.exports = encode - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; +var MSB = 0x80 + , REST = 0x7F + , MSBALL = ~REST + , INT = Math.pow(2, 31) - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; +function encode(num, out, offset) { + if (Number.MAX_SAFE_INTEGER && num > Number.MAX_SAFE_INTEGER) { + encode.bytes = 0 + throw new RangeError('Could not encode varint') + } + out = out || [] + offset = offset || 0 + var oldOffset = offset - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; + while(num >= INT) { + out[offset++] = (num & 0xFF) | MSB + num /= 128 + } + while(num & MSBALL) { + out[offset++] = (num & 0xFF) | MSB + num >>>= 7 + } + out[offset] = num | 0 + + encode.bytes = offset - oldOffset + 1 + + return out +} - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - __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()); - }); - }; +/***/ }), - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; +/***/ 6668: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +module.exports = { + encode: __nccwpck_require__(346) + , decode: __nccwpck_require__(40011) + , encodingLength: __nccwpck_require__(78615) +} - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; +/***/ }), - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; +/***/ 78615: +/***/ ((module) => { - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +var N1 = Math.pow(2, 7) +var N2 = Math.pow(2, 14) +var N3 = Math.pow(2, 21) +var N4 = Math.pow(2, 28) +var N5 = Math.pow(2, 35) +var N6 = Math.pow(2, 42) +var N7 = Math.pow(2, 49) +var N8 = Math.pow(2, 56) +var N9 = Math.pow(2, 63) - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; +module.exports = function (value) { + 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 + ) +} - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +/***/ }), - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; +/***/ 22422: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; +var balanced = __nccwpck_require__(11808); - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +module.exports = expandTop; - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; + var parts = []; + var m = balanced('{', '}', str); - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; + if (!m) + return str.split(','); - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + parts.push.apply(parts, p); -/***/ }), + return parts; +} -<<<<<<< HEAD -/***/ 13807: -======= -/***/ 34755: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +function expandTop(str) { + if (!str) + return []; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRecursionDetectionPlugin = exports.addRecursionDetectionMiddlewareOptions = exports.recursionDetectionMiddleware = void 0; -<<<<<<< HEAD -const protocol_http_1 = __nccwpck_require__(45311); -======= -const protocol_http_1 = __nccwpck_require__(35712); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id"; -const ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME"; -const ENV_TRACE_ID = "_X_AMZN_TRACE_ID"; -const recursionDetectionMiddleware = (options) => (next) => async (args) => { - const { request } = args; - if (!protocol_http_1.HttpRequest.isInstance(request) || - options.runtime !== "node" || - request.headers.hasOwnProperty(TRACE_ID_HEADER_NAME)) { - return next(args); + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m) return [str]; + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + if (/\$$/.test(m.pre)) { + for (var k = 0; k < post.length; k++) { + var expansion = pre+ '{' + m.body + '}' + post[k]; + expansions.push(expansion); } - const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME]; - const traceId = process.env[ENV_TRACE_ID]; - const nonEmptyString = (str) => typeof str === "string" && str.length > 0; - if (nonEmptyString(functionName) && nonEmptyString(traceId)) { - request.headers[TRACE_ID_HEADER_NAME] = traceId; + } else { + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; } - return next({ - ...args, - request, - }); -}; -exports.recursionDetectionMiddleware = recursionDetectionMiddleware; -exports.addRecursionDetectionMiddlewareOptions = { - step: "build", - tags: ["RECURSION_DETECTION"], - name: "recursionDetectionMiddleware", - override: true, - priority: "low", -}; -const getRecursionDetectionPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add((0, exports.recursionDetectionMiddleware)(options), exports.addRecursionDetectionMiddlewareOptions); - }, -}); -exports.getRecursionDetectionPlugin = getRecursionDetectionPlugin; - -/***/ }), + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } -<<<<<<< HEAD -/***/ 10397: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + var N; + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getCheckContentLengthHeaderPlugin = exports.checkContentLengthHeaderMiddlewareOptions = exports.checkContentLengthHeader = void 0; -const protocol_http_1 = __nccwpck_require__(45311); -const smithy_client_1 = __nccwpck_require__(33218); -======= -/***/ 24720: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + N = []; -"use strict"; + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = []; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AdaptiveRetryStrategy = void 0; -const config_1 = __nccwpck_require__(92171); -const DefaultRateLimiter_1 = __nccwpck_require__(60129); -const StandardRetryStrategy_1 = __nccwpck_require__(80731); -class AdaptiveRetryStrategy extends StandardRetryStrategy_1.StandardRetryStrategy { - constructor(maxAttemptsProvider, options) { - const { rateLimiter, ...superOptions } = options !== null && options !== void 0 ? options : {}; - super(maxAttemptsProvider, superOptions); - this.rateLimiter = rateLimiter !== null && rateLimiter !== void 0 ? rateLimiter : new DefaultRateLimiter_1.DefaultRateLimiter(); - this.mode = config_1.RETRY_MODES.ADAPTIVE; + for (var j = 0; j < n.length; j++) { + N.push.apply(N, expand(n[j], false)); + } } - async retry(next, args) { - return super.retry(next, args, { - beforeRequest: async () => { - return this.rateLimiter.getSendToken(); - }, - afterRequest: (response) => { - this.rateLimiter.updateClientSendingRate(response); - }, - }); + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } } + } + + return expansions; } -exports.AdaptiveRetryStrategy = AdaptiveRetryStrategy; + /***/ }), -/***/ 60129: +/***/ 67862: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; +/*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DefaultRateLimiter = void 0; -const service_error_classification_1 = __nccwpck_require__(18300); -class DefaultRateLimiter { - constructor(options) { - var _a, _b, _c, _d, _e; - this.currentCapacity = 0; - this.enabled = false; - this.lastMaxRate = 0; - this.measuredTxRate = 0; - this.requestCount = 0; - this.lastTimestamp = 0; - this.timeWindow = 0; - this.beta = (_a = options === null || options === void 0 ? void 0 : options.beta) !== null && _a !== void 0 ? _a : 0.7; - this.minCapacity = (_b = options === null || options === void 0 ? void 0 : options.minCapacity) !== null && _b !== void 0 ? _b : 1; - this.minFillRate = (_c = options === null || options === void 0 ? void 0 : options.minFillRate) !== null && _c !== void 0 ? _c : 0.5; - this.scaleConstant = (_d = options === null || options === void 0 ? void 0 : options.scaleConstant) !== null && _d !== void 0 ? _d : 0.4; - this.smooth = (_e = options === null || options === void 0 ? void 0 : options.smooth) !== null && _e !== void 0 ? _e : 0.8; - const currentTimeInSeconds = this.getCurrentTimeInSeconds(); - this.lastThrottleTime = currentTimeInSeconds; - this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds()); - this.fillRate = this.minFillRate; - this.maxCapacity = this.minCapacity; - } - getCurrentTimeInSeconds() { - return Date.now() / 1000; - } - async getSendToken() { - return this.acquireTokenBucket(1); - } - async acquireTokenBucket(amount) { - if (!this.enabled) { - return; +exports.utils = exports.curve25519 = exports.getSharedSecret = exports.sync = exports.verify = exports.sign = exports.getPublicKey = exports.Signature = exports.Point = exports.RistrettoPoint = exports.ExtendedPoint = exports.CURVE = void 0; +const nodeCrypto = __nccwpck_require__(6113); +const _0n = BigInt(0); +const _1n = BigInt(1); +const _2n = BigInt(2); +const _8n = BigInt(8); +const CU_O = BigInt('7237005577332262213973186563042994240857116359379907606001950938285454250989'); +const CURVE = Object.freeze({ + a: BigInt(-1), + d: BigInt('37095705934669439343138083508754565189542113879843219016388785533085940283555'), + P: BigInt('57896044618658097711785492504343953926634992332820282019728792003956564819949'), + l: CU_O, + n: CU_O, + h: BigInt(8), + Gx: BigInt('15112221349535400772501151409588531511454012693041857206046113283949847762202'), + Gy: BigInt('46316835694926478169428394003475163141307993866256225615783033603165251855960'), +}); +exports.CURVE = CURVE; +const POW_2_256 = BigInt('0x10000000000000000000000000000000000000000000000000000000000000000'); +const SQRT_M1 = BigInt('19681161376707505956807079304988542015446066515923890162744021073123829784752'); +const SQRT_D = BigInt('6853475219497561581579357271197624642482790079785650197046958215289687604742'); +const SQRT_AD_MINUS_ONE = BigInt('25063068953384623474111414158702152701244531502492656460079210482610430750235'); +const INVSQRT_A_MINUS_D = BigInt('54469307008909316920995813868745141605393597292927456921205312896311721017578'); +const ONE_MINUS_D_SQ = BigInt('1159843021668779879193775521855586647937357759715417654439879720876111806838'); +const D_MINUS_ONE_SQ = BigInt('40440834346308536858101042469323190826248399146238708352240133220865137265952'); +class ExtendedPoint { + constructor(x, y, z, t) { + this.x = x; + this.y = y; + this.z = z; + this.t = t; + } + static fromAffine(p) { + if (!(p instanceof Point)) { + throw new TypeError('ExtendedPoint#fromAffine: expected Point'); } - this.refillTokenBucket(); - if (amount > this.currentCapacity) { - const delay = ((amount - this.currentCapacity) / this.fillRate) * 1000; - await new Promise((resolve) => setTimeout(resolve, delay)); + if (p.equals(Point.ZERO)) + return ExtendedPoint.ZERO; + return new ExtendedPoint(p.x, p.y, _1n, mod(p.x * p.y)); + } + static toAffineBatch(points) { + const toInv = invertBatch(points.map((p) => p.z)); + return points.map((p, i) => p.toAffine(toInv[i])); + } + static normalizeZ(points) { + return this.toAffineBatch(points).map(this.fromAffine); + } + equals(other) { + assertExtPoint(other); + const { x: X1, y: Y1, z: Z1 } = this; + const { x: X2, y: Y2, z: Z2 } = other; + const X1Z2 = mod(X1 * Z2); + const X2Z1 = mod(X2 * Z1); + const Y1Z2 = mod(Y1 * Z2); + const Y2Z1 = mod(Y2 * Z1); + return X1Z2 === X2Z1 && Y1Z2 === Y2Z1; + } + negate() { + return new ExtendedPoint(mod(-this.x), this.y, this.z, mod(-this.t)); + } + double() { + const { x: X1, y: Y1, z: Z1 } = this; + const { a } = CURVE; + const A = mod(X1 * X1); + const B = mod(Y1 * Y1); + const C = mod(_2n * mod(Z1 * Z1)); + const D = mod(a * A); + const x1y1 = X1 + Y1; + const E = mod(mod(x1y1 * x1y1) - A - B); + const G = D + B; + const F = G - C; + const H = D - B; + const X3 = mod(E * F); + const Y3 = mod(G * H); + const T3 = mod(E * H); + const Z3 = mod(F * G); + return new ExtendedPoint(X3, Y3, Z3, T3); + } + add(other) { + assertExtPoint(other); + const { x: X1, y: Y1, z: Z1, t: T1 } = this; + const { x: X2, y: Y2, z: Z2, t: T2 } = other; + const A = mod((Y1 - X1) * (Y2 + X2)); + const B = mod((Y1 + X1) * (Y2 - X2)); + const F = mod(B - A); + if (F === _0n) + return this.double(); + const C = mod(Z1 * _2n * T2); + const D = mod(T1 * _2n * Z2); + const E = D + C; + const G = B + A; + const H = D - C; + const X3 = mod(E * F); + const Y3 = mod(G * H); + const T3 = mod(E * H); + const Z3 = mod(F * G); + return new ExtendedPoint(X3, Y3, Z3, T3); + } + subtract(other) { + return this.add(other.negate()); + } + precomputeWindow(W) { + const windows = 1 + 256 / W; + const points = []; + let p = this; + let base = p; + for (let window = 0; window < windows; window++) { + base = p; + points.push(base); + for (let i = 1; i < 2 ** (W - 1); i++) { + base = base.add(p); + points.push(base); + } + p = base.double(); } - this.currentCapacity = this.currentCapacity - amount; + return points; } - refillTokenBucket() { - const timestamp = this.getCurrentTimeInSeconds(); - if (!this.lastTimestamp) { - this.lastTimestamp = timestamp; - return; + wNAF(n, affinePoint) { + if (!affinePoint && this.equals(ExtendedPoint.BASE)) + affinePoint = Point.BASE; + const W = (affinePoint && affinePoint._WINDOW_SIZE) || 1; + if (256 % W) { + throw new Error('Point#wNAF: Invalid precomputation window, must be power of 2'); } - const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate; - this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount); - this.lastTimestamp = timestamp; + let precomputes = affinePoint && pointPrecomputes.get(affinePoint); + if (!precomputes) { + precomputes = this.precomputeWindow(W); + if (affinePoint && W !== 1) { + precomputes = ExtendedPoint.normalizeZ(precomputes); + pointPrecomputes.set(affinePoint, precomputes); + } + } + let p = ExtendedPoint.ZERO; + let f = ExtendedPoint.BASE; + const windows = 1 + 256 / W; + const windowSize = 2 ** (W - 1); + const mask = BigInt(2 ** W - 1); + const maxNumber = 2 ** W; + const shiftBy = BigInt(W); + for (let window = 0; window < windows; window++) { + const offset = window * windowSize; + let wbits = Number(n & mask); + n >>= shiftBy; + if (wbits > windowSize) { + wbits -= maxNumber; + n += _1n; + } + const offset1 = offset; + const offset2 = offset + Math.abs(wbits) - 1; + const cond1 = window % 2 !== 0; + const cond2 = wbits < 0; + if (wbits === 0) { + f = f.add(constTimeNegate(cond1, precomputes[offset1])); + } + else { + p = p.add(constTimeNegate(cond2, precomputes[offset2])); + } + } + return ExtendedPoint.normalizeZ([p, f])[0]; } - updateClientSendingRate(response) { - let calculatedRate; - this.updateMeasuredRate(); - if ((0, service_error_classification_1.isThrottlingError)(response)) { - const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate); - this.lastMaxRate = rateToUse; - this.calculateTimeWindow(); - this.lastThrottleTime = this.getCurrentTimeInSeconds(); - calculatedRate = this.cubicThrottle(rateToUse); - this.enableTokenBucket(); + multiply(scalar, affinePoint) { + return this.wNAF(normalizeScalar(scalar, CURVE.l), affinePoint); + } + multiplyUnsafe(scalar) { + let n = normalizeScalar(scalar, CURVE.l, false); + const G = ExtendedPoint.BASE; + const P0 = ExtendedPoint.ZERO; + if (n === _0n) + return P0; + if (this.equals(P0) || n === _1n) + return this; + if (this.equals(G)) + return this.wNAF(n); + let p = P0; + let d = this; + while (n > _0n) { + if (n & _1n) + p = p.add(d); + d = d.double(); + n >>= _1n; + } + return p; + } + isSmallOrder() { + return this.multiplyUnsafe(CURVE.h).equals(ExtendedPoint.ZERO); + } + isTorsionFree() { + let p = this.multiplyUnsafe(CURVE.l / _2n).double(); + if (CURVE.l % _2n) + p = p.add(this); + return p.equals(ExtendedPoint.ZERO); + } + toAffine(invZ) { + const { x, y, z } = this; + const is0 = this.equals(ExtendedPoint.ZERO); + if (invZ == null) + invZ = is0 ? _8n : invert(z); + const ax = mod(x * invZ); + const ay = mod(y * invZ); + const zz = mod(z * invZ); + if (is0) + return Point.ZERO; + if (zz !== _1n) + throw new Error('invZ was invalid'); + return new Point(ax, ay); + } + fromRistrettoBytes() { + legacyRist(); + } + toRistrettoBytes() { + legacyRist(); + } + fromRistrettoHash() { + legacyRist(); + } +} +exports.ExtendedPoint = ExtendedPoint; +ExtendedPoint.BASE = new ExtendedPoint(CURVE.Gx, CURVE.Gy, _1n, mod(CURVE.Gx * CURVE.Gy)); +ExtendedPoint.ZERO = new ExtendedPoint(_0n, _1n, _1n, _0n); +function constTimeNegate(condition, item) { + const neg = item.negate(); + return condition ? neg : item; +} +function assertExtPoint(other) { + if (!(other instanceof ExtendedPoint)) + throw new TypeError('ExtendedPoint expected'); +} +function assertRstPoint(other) { + if (!(other instanceof RistrettoPoint)) + throw new TypeError('RistrettoPoint expected'); +} +function legacyRist() { + throw new Error('Legacy method: switch to RistrettoPoint'); +} +class RistrettoPoint { + constructor(ep) { + this.ep = ep; + } + static calcElligatorRistrettoMap(r0) { + const { d } = CURVE; + const r = mod(SQRT_M1 * r0 * r0); + const Ns = mod((r + _1n) * ONE_MINUS_D_SQ); + let c = BigInt(-1); + const D = mod((c - d * r) * mod(r + d)); + let { isValid: Ns_D_is_sq, value: s } = uvRatio(Ns, D); + let s_ = mod(s * r0); + if (!edIsNegative(s_)) + s_ = mod(-s_); + if (!Ns_D_is_sq) + s = s_; + if (!Ns_D_is_sq) + c = r; + const Nt = mod(c * (r - _1n) * D_MINUS_ONE_SQ - D); + const s2 = s * s; + const W0 = mod((s + s) * D); + const W1 = mod(Nt * SQRT_AD_MINUS_ONE); + const W2 = mod(_1n - s2); + const W3 = mod(_1n + s2); + return new ExtendedPoint(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2)); + } + static hashToCurve(hex) { + hex = ensureBytes(hex, 64); + const r1 = bytes255ToNumberLE(hex.slice(0, 32)); + const R1 = this.calcElligatorRistrettoMap(r1); + const r2 = bytes255ToNumberLE(hex.slice(32, 64)); + const R2 = this.calcElligatorRistrettoMap(r2); + return new RistrettoPoint(R1.add(R2)); + } + static fromHex(hex) { + hex = ensureBytes(hex, 32); + const { a, d } = CURVE; + const emsg = 'RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint'; + const s = bytes255ToNumberLE(hex); + if (!equalBytes(numberTo32BytesLE(s), hex) || edIsNegative(s)) + throw new Error(emsg); + const s2 = mod(s * s); + const u1 = mod(_1n + a * s2); + const u2 = mod(_1n - a * s2); + const u1_2 = mod(u1 * u1); + const u2_2 = mod(u2 * u2); + const v = mod(a * d * u1_2 - u2_2); + const { isValid, value: I } = invertSqrt(mod(v * u2_2)); + const Dx = mod(I * u2); + const Dy = mod(I * Dx * v); + let x = mod((s + s) * Dx); + if (edIsNegative(x)) + x = mod(-x); + const y = mod(u1 * Dy); + const t = mod(x * y); + if (!isValid || edIsNegative(t) || y === _0n) + throw new Error(emsg); + return new RistrettoPoint(new ExtendedPoint(x, y, _1n, t)); + } + toRawBytes() { + let { x, y, z, t } = this.ep; + const u1 = mod(mod(z + y) * mod(z - y)); + const u2 = mod(x * y); + const u2sq = mod(u2 * u2); + const { value: invsqrt } = invertSqrt(mod(u1 * u2sq)); + const D1 = mod(invsqrt * u1); + const D2 = mod(invsqrt * u2); + const zInv = mod(D1 * D2 * t); + let D; + if (edIsNegative(t * zInv)) { + let _x = mod(y * SQRT_M1); + let _y = mod(x * SQRT_M1); + x = _x; + y = _y; + D = mod(D1 * INVSQRT_A_MINUS_D); } else { - this.calculateTimeWindow(); - calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds()); + D = D2; } - const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate); - this.updateTokenBucketRate(newRate); + if (edIsNegative(x * zInv)) + y = mod(-y); + let s = mod((z - y) * D); + if (edIsNegative(s)) + s = mod(-s); + return numberTo32BytesLE(s); } - calculateTimeWindow() { - this.timeWindow = this.getPrecise(Math.pow((this.lastMaxRate * (1 - this.beta)) / this.scaleConstant, 1 / 3)); + toHex() { + return bytesToHex(this.toRawBytes()); } - cubicThrottle(rateToUse) { - return this.getPrecise(rateToUse * this.beta); + toString() { + return this.toHex(); } - cubicSuccess(timestamp) { - return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate); + equals(other) { + assertRstPoint(other); + const a = this.ep; + const b = other.ep; + const one = mod(a.x * b.y) === mod(a.y * b.x); + const two = mod(a.y * b.y) === mod(a.x * b.x); + return one || two; } - enableTokenBucket() { - this.enabled = true; + add(other) { + assertRstPoint(other); + return new RistrettoPoint(this.ep.add(other.ep)); } - updateTokenBucketRate(newRate) { - this.refillTokenBucket(); - this.fillRate = Math.max(newRate, this.minFillRate); - this.maxCapacity = Math.max(newRate, this.minCapacity); - this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity); + subtract(other) { + assertRstPoint(other); + return new RistrettoPoint(this.ep.subtract(other.ep)); } - updateMeasuredRate() { - const t = this.getCurrentTimeInSeconds(); - const timeBucket = Math.floor(t * 2) / 2; - this.requestCount++; - if (timeBucket > this.lastTxRateBucket) { - const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket); - this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth)); - this.requestCount = 0; - this.lastTxRateBucket = timeBucket; - } + multiply(scalar) { + return new RistrettoPoint(this.ep.multiply(scalar)); } - getPrecise(num) { - return parseFloat(num.toFixed(8)); + multiplyUnsafe(scalar) { + return new RistrettoPoint(this.ep.multiplyUnsafe(scalar)); } } -exports.DefaultRateLimiter = DefaultRateLimiter; - - -/***/ }), - -/***/ 80731: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.StandardRetryStrategy = void 0; -const protocol_http_1 = __nccwpck_require__(35712); -const service_error_classification_1 = __nccwpck_require__(18300); -const uuid_1 = __nccwpck_require__(49360); -const config_1 = __nccwpck_require__(92171); -const constants_1 = __nccwpck_require__(57505); -const defaultRetryQuota_1 = __nccwpck_require__(76139); -const delayDecider_1 = __nccwpck_require__(6292); -const retryDecider_1 = __nccwpck_require__(15839); -class StandardRetryStrategy { - constructor(maxAttemptsProvider, options) { - var _a, _b, _c; - this.maxAttemptsProvider = maxAttemptsProvider; - this.mode = config_1.RETRY_MODES.STANDARD; - this.retryDecider = (_a = options === null || options === void 0 ? void 0 : options.retryDecider) !== null && _a !== void 0 ? _a : retryDecider_1.defaultRetryDecider; - this.delayDecider = (_b = options === null || options === void 0 ? void 0 : options.delayDecider) !== null && _b !== void 0 ? _b : delayDecider_1.defaultDelayDecider; - this.retryQuota = (_c = options === null || options === void 0 ? void 0 : options.retryQuota) !== null && _c !== void 0 ? _c : (0, defaultRetryQuota_1.getDefaultRetryQuota)(constants_1.INITIAL_RETRY_TOKENS); +exports.RistrettoPoint = RistrettoPoint; +RistrettoPoint.BASE = new RistrettoPoint(ExtendedPoint.BASE); +RistrettoPoint.ZERO = new RistrettoPoint(ExtendedPoint.ZERO); +const pointPrecomputes = new WeakMap(); +class Point { + constructor(x, y) { + this.x = x; + this.y = y; } - shouldRetry(error, attempts, maxAttempts) { - return attempts < maxAttempts && this.retryDecider(error) && this.retryQuota.hasRetryTokens(error); + _setWindowSize(windowSize) { + this._WINDOW_SIZE = windowSize; + pointPrecomputes.delete(this); } - async getMaxAttempts() { - let maxAttempts; - try { - maxAttempts = await this.maxAttemptsProvider(); + static fromHex(hex, strict = true) { + const { d, P } = CURVE; + hex = ensureBytes(hex, 32); + const normed = hex.slice(); + normed[31] = hex[31] & ~0x80; + const y = bytesToNumberLE(normed); + if (strict && y >= P) + throw new Error('Expected 0 < hex < P'); + if (!strict && y >= POW_2_256) + throw new Error('Expected 0 < hex < 2**256'); + const y2 = mod(y * y); + const u = mod(y2 - _1n); + const v = mod(d * y2 + _1n); + let { isValid, value: x } = uvRatio(u, v); + if (!isValid) + throw new Error('Point.fromHex: invalid y coordinate'); + const isXOdd = (x & _1n) === _1n; + const isLastByteOdd = (hex[31] & 0x80) !== 0; + if (isLastByteOdd !== isXOdd) { + x = mod(-x); } - catch (error) { - maxAttempts = config_1.DEFAULT_MAX_ATTEMPTS; + return new Point(x, y); + } + static async fromPrivateKey(privateKey) { + return (await getExtendedPublicKey(privateKey)).point; + } + toRawBytes() { + const bytes = numberTo32BytesLE(this.y); + bytes[31] |= this.x & _1n ? 0x80 : 0; + return bytes; + } + toHex() { + return bytesToHex(this.toRawBytes()); + } + toX25519() { + const { y } = this; + const u = mod((_1n + y) * invert(_1n - y)); + return numberTo32BytesLE(u); + } + isTorsionFree() { + return ExtendedPoint.fromAffine(this).isTorsionFree(); + } + equals(other) { + return this.x === other.x && this.y === other.y; + } + negate() { + return new Point(mod(-this.x), this.y); + } + add(other) { + return ExtendedPoint.fromAffine(this).add(ExtendedPoint.fromAffine(other)).toAffine(); + } + subtract(other) { + return this.add(other.negate()); + } + multiply(scalar) { + return ExtendedPoint.fromAffine(this).multiply(scalar, this).toAffine(); + } +} +exports.Point = Point; +Point.BASE = new Point(CURVE.Gx, CURVE.Gy); +Point.ZERO = new Point(_0n, _1n); +class Signature { + constructor(r, s) { + this.r = r; + this.s = s; + this.assertValidity(); + } + static fromHex(hex) { + const bytes = ensureBytes(hex, 64); + const r = Point.fromHex(bytes.slice(0, 32), false); + const s = bytesToNumberLE(bytes.slice(32, 64)); + return new Signature(r, s); + } + assertValidity() { + const { r, s } = this; + if (!(r instanceof Point)) + throw new Error('Expected Point instance'); + normalizeScalar(s, CURVE.l, false); + return this; + } + toRawBytes() { + const u8 = new Uint8Array(64); + u8.set(this.r.toRawBytes()); + u8.set(numberTo32BytesLE(this.s), 32); + return u8; + } + toHex() { + return bytesToHex(this.toRawBytes()); + } +} +exports.Signature = Signature; +function concatBytes(...arrays) { + if (!arrays.every((a) => a instanceof Uint8Array)) + throw new Error('Expected Uint8Array list'); + if (arrays.length === 1) + return arrays[0]; + const length = arrays.reduce((a, arr) => a + arr.length, 0); + const result = new Uint8Array(length); + for (let i = 0, pad = 0; i < arrays.length; i++) { + const arr = arrays[i]; + result.set(arr, pad); + pad += arr.length; + } + return result; +} +const hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, '0')); +function bytesToHex(uint8a) { + if (!(uint8a instanceof Uint8Array)) + throw new Error('Uint8Array expected'); + let hex = ''; + for (let i = 0; i < uint8a.length; i++) { + hex += hexes[uint8a[i]]; + } + return hex; +} +function hexToBytes(hex) { + if (typeof hex !== 'string') { + throw new TypeError('hexToBytes: expected string, got ' + typeof hex); + } + if (hex.length % 2) + throw new Error('hexToBytes: received invalid unpadded hex'); + const array = new Uint8Array(hex.length / 2); + for (let i = 0; i < array.length; i++) { + const j = i * 2; + const hexByte = hex.slice(j, j + 2); + const byte = Number.parseInt(hexByte, 16); + if (Number.isNaN(byte) || byte < 0) + throw new Error('Invalid byte sequence'); + array[i] = byte; + } + return array; +} +function numberTo32BytesBE(num) { + const length = 32; + const hex = num.toString(16).padStart(length * 2, '0'); + return hexToBytes(hex); +} +function numberTo32BytesLE(num) { + return numberTo32BytesBE(num).reverse(); +} +function edIsNegative(num) { + return (mod(num) & _1n) === _1n; +} +function bytesToNumberLE(uint8a) { + if (!(uint8a instanceof Uint8Array)) + throw new Error('Expected Uint8Array'); + return BigInt('0x' + bytesToHex(Uint8Array.from(uint8a).reverse())); +} +const MAX_255B = BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); +function bytes255ToNumberLE(bytes) { + return mod(bytesToNumberLE(bytes) & MAX_255B); +} +function mod(a, b = CURVE.P) { + const res = a % b; + return res >= _0n ? res : b + res; +} +function invert(number, modulo = CURVE.P) { + if (number === _0n || modulo <= _0n) { + throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`); + } + let a = mod(number, modulo); + let b = modulo; + let x = _0n, y = _1n, u = _1n, v = _0n; + while (a !== _0n) { + const q = b / a; + const r = b % a; + const m = x - u * q; + const n = y - v * q; + b = a, a = r, x = u, y = v, u = m, v = n; + } + const gcd = b; + if (gcd !== _1n) + throw new Error('invert: does not exist'); + return mod(x, modulo); +} +function invertBatch(nums, p = CURVE.P) { + const tmp = new Array(nums.length); + const lastMultiplied = nums.reduce((acc, num, i) => { + if (num === _0n) + return acc; + tmp[i] = acc; + return mod(acc * num, p); + }, _1n); + const inverted = invert(lastMultiplied, p); + nums.reduceRight((acc, num, i) => { + if (num === _0n) + return acc; + tmp[i] = mod(acc * tmp[i], p); + return mod(acc * num, p); + }, inverted); + return tmp; +} +function pow2(x, power) { + const { P } = CURVE; + let res = x; + while (power-- > _0n) { + res *= res; + res %= P; + } + return res; +} +function pow_2_252_3(x) { + const { P } = CURVE; + const _5n = BigInt(5); + const _10n = BigInt(10); + const _20n = BigInt(20); + const _40n = BigInt(40); + const _80n = BigInt(80); + const x2 = (x * x) % P; + const b2 = (x2 * x) % P; + const b4 = (pow2(b2, _2n) * b2) % P; + const b5 = (pow2(b4, _1n) * x) % P; + const b10 = (pow2(b5, _5n) * b5) % P; + const b20 = (pow2(b10, _10n) * b10) % P; + const b40 = (pow2(b20, _20n) * b20) % P; + const b80 = (pow2(b40, _40n) * b40) % P; + const b160 = (pow2(b80, _80n) * b80) % P; + const b240 = (pow2(b160, _80n) * b80) % P; + const b250 = (pow2(b240, _10n) * b10) % P; + const pow_p_5_8 = (pow2(b250, _2n) * x) % P; + return { pow_p_5_8, b2 }; +} +function uvRatio(u, v) { + const v3 = mod(v * v * v); + const v7 = mod(v3 * v3 * v); + const pow = pow_2_252_3(u * v7).pow_p_5_8; + let x = mod(u * v3 * pow); + const vx2 = mod(v * x * x); + const root1 = x; + const root2 = mod(x * SQRT_M1); + const useRoot1 = vx2 === u; + const useRoot2 = vx2 === mod(-u); + const noRoot = vx2 === mod(-u * SQRT_M1); + if (useRoot1) + x = root1; + if (useRoot2 || noRoot) + x = root2; + if (edIsNegative(x)) + x = mod(-x); + return { isValid: useRoot1 || useRoot2, value: x }; +} +function invertSqrt(number) { + return uvRatio(_1n, number); +} +function modlLE(hash) { + return mod(bytesToNumberLE(hash), CURVE.l); +} +function equalBytes(b1, b2) { + if (b1.length !== b2.length) { + return false; + } + for (let i = 0; i < b1.length; i++) { + if (b1[i] !== b2[i]) { + return false; } - return maxAttempts; } - async retry(next, args, options) { - let retryTokenAmount; - let attempts = 0; - let totalDelay = 0; - const maxAttempts = await this.getMaxAttempts(); - const { request } = args; - if (protocol_http_1.HttpRequest.isInstance(request)) { - request.headers[constants_1.INVOCATION_ID_HEADER] = (0, uuid_1.v4)(); + return true; +} +function ensureBytes(hex, expectedLength) { + const bytes = hex instanceof Uint8Array ? Uint8Array.from(hex) : hexToBytes(hex); + if (typeof expectedLength === 'number' && bytes.length !== expectedLength) + throw new Error(`Expected ${expectedLength} bytes`); + return bytes; +} +function normalizeScalar(num, max, strict = true) { + if (!max) + throw new TypeError('Specify max value'); + if (typeof num === 'number' && Number.isSafeInteger(num)) + num = BigInt(num); + if (typeof num === 'bigint' && num < max) { + if (strict) { + if (_0n < num) + return num; } - while (true) { - try { - if (protocol_http_1.HttpRequest.isInstance(request)) { - request.headers[constants_1.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; - } - if (options === null || options === void 0 ? void 0 : options.beforeRequest) { - await options.beforeRequest(); - } - const { response, output } = await next(args); - if (options === null || options === void 0 ? void 0 : options.afterRequest) { - options.afterRequest(response); - } - this.retryQuota.releaseRetryTokens(retryTokenAmount); - output.$metadata.attempts = attempts + 1; - output.$metadata.totalRetryDelay = totalDelay; - return { response, output }; - } - catch (e) { - const err = asSdkError(e); - attempts++; - if (this.shouldRetry(err, attempts, maxAttempts)) { - retryTokenAmount = this.retryQuota.retrieveRetryTokens(err); - const delay = this.delayDecider((0, service_error_classification_1.isThrottlingError)(err) ? constants_1.THROTTLING_RETRY_DELAY_BASE : constants_1.DEFAULT_RETRY_DELAY_BASE, attempts); - totalDelay += delay; - await new Promise((resolve) => setTimeout(resolve, delay)); - continue; - } - if (!err.$metadata) { - err.$metadata = {}; - } - err.$metadata.attempts = attempts; - err.$metadata.totalRetryDelay = totalDelay; - throw err; - } + else { + if (_0n <= num) + return num; } } + throw new TypeError('Expected valid scalar: 0 < scalar < max'); } -exports.StandardRetryStrategy = StandardRetryStrategy; -const asSdkError = (error) => { - if (error instanceof Error) - return error; - if (error instanceof Object) - return Object.assign(new Error(), error); - if (typeof error === "string") - return new Error(error); - return new Error(`AWS SDK error wrapper for ${error}`); +function adjustBytes25519(bytes) { + bytes[0] &= 248; + bytes[31] &= 127; + bytes[31] |= 64; + return bytes; +} +function decodeScalar25519(n) { + return bytesToNumberLE(adjustBytes25519(ensureBytes(n, 32))); +} +function checkPrivateKey(key) { + key = + typeof key === 'bigint' || typeof key === 'number' + ? numberTo32BytesBE(normalizeScalar(key, POW_2_256)) + : ensureBytes(key); + if (key.length !== 32) + throw new Error(`Expected 32 bytes`); + return key; +} +function getKeyFromHash(hashed) { + const head = adjustBytes25519(hashed.slice(0, 32)); + const prefix = hashed.slice(32, 64); + const scalar = modlLE(head); + const point = Point.BASE.multiply(scalar); + const pointBytes = point.toRawBytes(); + return { head, prefix, scalar, point, pointBytes }; +} +let _sha512Sync; +function sha512s(...m) { + if (typeof _sha512Sync !== 'function') + throw new Error('utils.sha512Sync must be set to use sync methods'); + return _sha512Sync(...m); +} +async function getExtendedPublicKey(key) { + return getKeyFromHash(await exports.utils.sha512(checkPrivateKey(key))); +} +function getExtendedPublicKeySync(key) { + return getKeyFromHash(sha512s(checkPrivateKey(key))); +} +async function getPublicKey(privateKey) { + return (await getExtendedPublicKey(privateKey)).pointBytes; +} +exports.getPublicKey = getPublicKey; +function getPublicKeySync(privateKey) { + return getExtendedPublicKeySync(privateKey).pointBytes; +} +async function sign(message, privateKey) { + message = ensureBytes(message); + const { prefix, scalar, pointBytes } = await getExtendedPublicKey(privateKey); + const r = modlLE(await exports.utils.sha512(prefix, message)); + const R = Point.BASE.multiply(r); + const k = modlLE(await exports.utils.sha512(R.toRawBytes(), pointBytes, message)); + const s = mod(r + k * scalar, CURVE.l); + return new Signature(R, s).toRawBytes(); +} +exports.sign = sign; +function signSync(message, privateKey) { + message = ensureBytes(message); + const { prefix, scalar, pointBytes } = getExtendedPublicKeySync(privateKey); + const r = modlLE(sha512s(prefix, message)); + const R = Point.BASE.multiply(r); + const k = modlLE(sha512s(R.toRawBytes(), pointBytes, message)); + const s = mod(r + k * scalar, CURVE.l); + return new Signature(R, s).toRawBytes(); +} +function prepareVerification(sig, message, publicKey) { + message = ensureBytes(message); + if (!(publicKey instanceof Point)) + publicKey = Point.fromHex(publicKey, false); + const { r, s } = sig instanceof Signature ? sig.assertValidity() : Signature.fromHex(sig); + const SB = ExtendedPoint.BASE.multiplyUnsafe(s); + return { r, s, SB, pub: publicKey, msg: message }; +} +function finishVerification(publicKey, r, SB, hashed) { + const k = modlLE(hashed); + const kA = ExtendedPoint.fromAffine(publicKey).multiplyUnsafe(k); + const RkA = ExtendedPoint.fromAffine(r).add(kA); + return RkA.subtract(SB).multiplyUnsafe(CURVE.h).equals(ExtendedPoint.ZERO); +} +async function verify(sig, message, publicKey) { + const { r, SB, msg, pub } = prepareVerification(sig, message, publicKey); + const hashed = await exports.utils.sha512(r.toRawBytes(), pub.toRawBytes(), msg); + return finishVerification(pub, r, SB, hashed); +} +exports.verify = verify; +function verifySync(sig, message, publicKey) { + const { r, SB, msg, pub } = prepareVerification(sig, message, publicKey); + const hashed = sha512s(r.toRawBytes(), pub.toRawBytes(), msg); + return finishVerification(pub, r, SB, hashed); +} +exports.sync = { + getExtendedPublicKey: getExtendedPublicKeySync, + getPublicKey: getPublicKeySync, + sign: signSync, + verify: verifySync, }; +async function getSharedSecret(privateKey, publicKey) { + const { head } = await getExtendedPublicKey(privateKey); + const u = Point.fromHex(publicKey).toX25519(); + return exports.curve25519.scalarMult(head, u); +} +exports.getSharedSecret = getSharedSecret; +Point.BASE._setWindowSize(8); +function cswap(swap, x_2, x_3) { + const dummy = mod(swap * (x_2 - x_3)); + x_2 = mod(x_2 - dummy); + x_3 = mod(x_3 + dummy); + return [x_2, x_3]; +} +function montgomeryLadder(pointU, scalar) { + const { P } = CURVE; + const u = normalizeScalar(pointU, P); + const k = normalizeScalar(scalar, P); + const a24 = BigInt(121665); + const x_1 = u; + let x_2 = _1n; + let z_2 = _0n; + let x_3 = u; + let z_3 = _1n; + let swap = _0n; + let sw; + for (let t = BigInt(255 - 1); t >= _0n; t--) { + const k_t = (k >> t) & _1n; + swap ^= k_t; + sw = cswap(swap, x_2, x_3); + x_2 = sw[0]; + x_3 = sw[1]; + sw = cswap(swap, z_2, z_3); + z_2 = sw[0]; + z_3 = sw[1]; + swap = k_t; + const A = x_2 + z_2; + const AA = mod(A * A); + const B = x_2 - z_2; + const BB = mod(B * B); + const E = AA - BB; + const C = x_3 + z_3; + const D = x_3 - z_3; + const DA = mod(D * A); + const CB = mod(C * B); + const dacb = DA + CB; + const da_cb = DA - CB; + x_3 = mod(dacb * dacb); + z_3 = mod(x_1 * mod(da_cb * da_cb)); + x_2 = mod(AA * BB); + z_2 = mod(E * (AA + mod(a24 * E))); + } + sw = cswap(swap, x_2, x_3); + x_2 = sw[0]; + x_3 = sw[1]; + sw = cswap(swap, z_2, z_3); + z_2 = sw[0]; + z_3 = sw[1]; + const { pow_p_5_8, b2 } = pow_2_252_3(z_2); + const xp2 = mod(pow2(pow_p_5_8, BigInt(3)) * b2); + return mod(x_2 * xp2); +} +function encodeUCoordinate(u) { + return numberTo32BytesLE(mod(u, CURVE.P)); +} +function decodeUCoordinate(uEnc) { + const u = ensureBytes(uEnc, 32); + u[31] &= 127; + return bytesToNumberLE(u); +} +exports.curve25519 = { + BASE_POINT_U: '0900000000000000000000000000000000000000000000000000000000000000', + scalarMult(privateKey, publicKey) { + const u = decodeUCoordinate(publicKey); + const p = decodeScalar25519(privateKey); + const pu = montgomeryLadder(u, p); + if (pu === _0n) + throw new Error('Invalid private or public key received'); + return encodeUCoordinate(pu); + }, + scalarMultBase(privateKey) { + return exports.curve25519.scalarMult(privateKey, exports.curve25519.BASE_POINT_U); + }, +}; +const crypto = { + node: nodeCrypto, + web: typeof self === 'object' && 'crypto' in self ? self.crypto : undefined, +}; +exports.utils = { + bytesToHex, + hexToBytes, + concatBytes, + getExtendedPublicKey, + mod, + invert, + TORSION_SUBGROUP: [ + '0100000000000000000000000000000000000000000000000000000000000000', + 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a', + '0000000000000000000000000000000000000000000000000000000000000080', + '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05', + 'ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f', + '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85', + '0000000000000000000000000000000000000000000000000000000000000000', + 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa', + ], + hashToPrivateScalar: (hash) => { + hash = ensureBytes(hash); + if (hash.length < 40 || hash.length > 1024) + throw new Error('Expected 40-1024 bytes of private key as per FIPS 186'); + return mod(bytesToNumberLE(hash), CURVE.l - _1n) + _1n; + }, + randomBytes: (bytesLength = 32) => { + if (crypto.web) { + return crypto.web.getRandomValues(new Uint8Array(bytesLength)); + } + else if (crypto.node) { + const { randomBytes } = crypto.node; + return new Uint8Array(randomBytes(bytesLength).buffer); + } + else { + throw new Error("The environment doesn't have randomBytes function"); + } + }, + randomPrivateKey: () => { + return exports.utils.randomBytes(32); + }, + sha512: async (...messages) => { + const message = concatBytes(...messages); + if (crypto.web) { + const buffer = await crypto.web.subtle.digest('SHA-512', message.buffer); + return new Uint8Array(buffer); + } + else if (crypto.node) { + return Uint8Array.from(crypto.node.createHash('sha512').update(message).digest()); + } + else { + throw new Error("The environment doesn't have sha512 function"); + } + }, + precompute(windowSize = 8, point = Point.BASE) { + const cached = point.equals(Point.BASE) ? point : new Point(point.x, point.y); + cached._setWindowSize(windowSize); + cached.multiply(_2n); + return cached; + }, + sha512Sync: undefined, +}; +Object.defineProperties(exports.utils, { + sha512Sync: { + configurable: false, + get() { + return _sha512Sync; + }, + set(val) { + if (!_sha512Sync) + _sha512Sync = val; + }, + }, +}); /***/ }), -/***/ 92171: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DEFAULT_RETRY_MODE = exports.DEFAULT_MAX_ATTEMPTS = exports.RETRY_MODES = void 0; -var RETRY_MODES; -(function (RETRY_MODES) { - RETRY_MODES["STANDARD"] = "standard"; - RETRY_MODES["ADAPTIVE"] = "adaptive"; -})(RETRY_MODES = exports.RETRY_MODES || (exports.RETRY_MODES = {})); -exports.DEFAULT_MAX_ATTEMPTS = 3; -exports.DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD; - - -/***/ }), - -/***/ 40372: +/***/ 74813: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; +/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_RETRY_MODE_CONFIG_OPTIONS = exports.CONFIG_RETRY_MODE = exports.ENV_RETRY_MODE = exports.resolveRetryConfig = exports.NODE_MAX_ATTEMPT_CONFIG_OPTIONS = exports.CONFIG_MAX_ATTEMPTS = exports.ENV_MAX_ATTEMPTS = void 0; -const util_middleware_1 = __nccwpck_require__(23837); -const AdaptiveRetryStrategy_1 = __nccwpck_require__(24720); -const config_1 = __nccwpck_require__(92171); -const StandardRetryStrategy_1 = __nccwpck_require__(80731); -exports.ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; -exports.CONFIG_MAX_ATTEMPTS = "max_attempts"; -exports.NODE_MAX_ATTEMPT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => { - const value = env[exports.ENV_MAX_ATTEMPTS]; - if (!value) - return undefined; - const maxAttempt = parseInt(value); - if (Number.isNaN(maxAttempt)) { - throw new Error(`Environment variable ${exports.ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`); - } - return maxAttempt; - }, - configFileSelector: (profile) => { - const value = profile[exports.CONFIG_MAX_ATTEMPTS]; - if (!value) - return undefined; - const maxAttempt = parseInt(value); - if (Number.isNaN(maxAttempt)) { - throw new Error(`Shared config file entry ${exports.CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`); +exports.utils = exports.schnorr = exports.verify = exports.signSync = exports.sign = exports.getSharedSecret = exports.recoverPublicKey = exports.getPublicKey = exports.Signature = exports.Point = exports.CURVE = void 0; +const nodeCrypto = __nccwpck_require__(6113); +const _0n = BigInt(0); +const _1n = BigInt(1); +const _2n = BigInt(2); +const _3n = BigInt(3); +const _8n = BigInt(8); +const CURVE = Object.freeze({ + a: _0n, + b: BigInt(7), + P: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'), + n: BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'), + h: _1n, + Gx: BigInt('55066263022277343669578718895168534326250603453777594175500187360389116729240'), + Gy: BigInt('32670510020758816978083085130507043184471273380659243275938904335757337482424'), + beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'), +}); +exports.CURVE = CURVE; +const divNearest = (a, b) => (a + b / _2n) / b; +const endo = { + beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'), + splitScalar(k) { + const { n } = CURVE; + const a1 = BigInt('0x3086d221a7d46bcde86c90e49284eb15'); + const b1 = -_1n * BigInt('0xe4437ed6010e88286f547fa90abfe4c3'); + const a2 = BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8'); + const b2 = a1; + const POW_2_128 = BigInt('0x100000000000000000000000000000000'); + const c1 = divNearest(b2 * k, n); + const c2 = divNearest(-b1 * k, n); + let k1 = mod(k - c1 * a1 - c2 * a2, n); + let k2 = mod(-c1 * b1 - c2 * b2, n); + const k1neg = k1 > POW_2_128; + const k2neg = k2 > POW_2_128; + if (k1neg) + k1 = n - k1; + if (k2neg) + k2 = n - k2; + if (k1 > POW_2_128 || k2 > POW_2_128) { + throw new Error('splitScalarEndo: Endomorphism failed, k=' + k); } - return maxAttempt; + return { k1neg, k1, k2neg, k2 }; }, - default: config_1.DEFAULT_MAX_ATTEMPTS, -}; -const resolveRetryConfig = (input) => { - var _a; - const maxAttempts = (0, util_middleware_1.normalizeProvider)((_a = input.maxAttempts) !== null && _a !== void 0 ? _a : config_1.DEFAULT_MAX_ATTEMPTS); - return { - ...input, - maxAttempts, - retryStrategy: async () => { - if (input.retryStrategy) { - return input.retryStrategy; - } - const retryMode = await (0, util_middleware_1.normalizeProvider)(input.retryMode)(); - if (retryMode === config_1.RETRY_MODES.ADAPTIVE) { - return new AdaptiveRetryStrategy_1.AdaptiveRetryStrategy(maxAttempts); - } - return new StandardRetryStrategy_1.StandardRetryStrategy(maxAttempts); - }, - }; -}; -exports.resolveRetryConfig = resolveRetryConfig; -exports.ENV_RETRY_MODE = "AWS_RETRY_MODE"; -exports.CONFIG_RETRY_MODE = "retry_mode"; -exports.NODE_RETRY_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[exports.ENV_RETRY_MODE], - configFileSelector: (profile) => profile[exports.CONFIG_RETRY_MODE], - default: config_1.DEFAULT_RETRY_MODE, }; - - -/***/ }), - -/***/ 57505: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.REQUEST_HEADER = exports.INVOCATION_ID_HEADER = exports.NO_RETRY_INCREMENT = exports.TIMEOUT_RETRY_COST = exports.RETRY_COST = exports.INITIAL_RETRY_TOKENS = exports.THROTTLING_RETRY_DELAY_BASE = exports.MAXIMUM_RETRY_DELAY = exports.DEFAULT_RETRY_DELAY_BASE = void 0; -exports.DEFAULT_RETRY_DELAY_BASE = 100; -exports.MAXIMUM_RETRY_DELAY = 20 * 1000; -exports.THROTTLING_RETRY_DELAY_BASE = 500; -exports.INITIAL_RETRY_TOKENS = 500; -exports.RETRY_COST = 5; -exports.TIMEOUT_RETRY_COST = 10; -exports.NO_RETRY_INCREMENT = 1; -exports.INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; -exports.REQUEST_HEADER = "amz-sdk-request"; - - -/***/ }), - -/***/ 76139: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getDefaultRetryQuota = void 0; -const constants_1 = __nccwpck_require__(57505); -const getDefaultRetryQuota = (initialRetryTokens, options) => { - var _a, _b, _c; - const MAX_CAPACITY = initialRetryTokens; - const noRetryIncrement = (_a = options === null || options === void 0 ? void 0 : options.noRetryIncrement) !== null && _a !== void 0 ? _a : constants_1.NO_RETRY_INCREMENT; - const retryCost = (_b = options === null || options === void 0 ? void 0 : options.retryCost) !== null && _b !== void 0 ? _b : constants_1.RETRY_COST; - const timeoutRetryCost = (_c = options === null || options === void 0 ? void 0 : options.timeoutRetryCost) !== null && _c !== void 0 ? _c : constants_1.TIMEOUT_RETRY_COST; - let availableCapacity = initialRetryTokens; - const getCapacityAmount = (error) => (error.name === "TimeoutError" ? timeoutRetryCost : retryCost); - const hasRetryTokens = (error) => getCapacityAmount(error) <= availableCapacity; - const retrieveRetryTokens = (error) => { - if (!hasRetryTokens(error)) { - throw new Error("No retry token available"); +const fieldLen = 32; +const groupLen = 32; +const hashLen = 32; +const compressedLen = fieldLen + 1; +const uncompressedLen = 2 * fieldLen + 1; +function weierstrass(x) { + const { a, b } = CURVE; + const x2 = mod(x * x); + const x3 = mod(x2 * x); + return mod(x3 + a * x + b); +} +const USE_ENDOMORPHISM = CURVE.a === _0n; +class ShaError extends Error { + constructor(message) { + super(message); + } +} +function assertJacPoint(other) { + if (!(other instanceof JacobianPoint)) + throw new TypeError('JacobianPoint expected'); +} +class JacobianPoint { + constructor(x, y, z) { + this.x = x; + this.y = y; + this.z = z; + } + static fromAffine(p) { + if (!(p instanceof Point)) { + throw new TypeError('JacobianPoint#fromAffine: expected Point'); } - const capacityAmount = getCapacityAmount(error); - availableCapacity -= capacityAmount; - return capacityAmount; - }; - const releaseRetryTokens = (capacityReleaseAmount) => { - availableCapacity += capacityReleaseAmount !== null && capacityReleaseAmount !== void 0 ? capacityReleaseAmount : noRetryIncrement; - availableCapacity = Math.min(availableCapacity, MAX_CAPACITY); - }; - return Object.freeze({ - hasRetryTokens, - retrieveRetryTokens, - releaseRetryTokens, - }); -}; -exports.getDefaultRetryQuota = getDefaultRetryQuota; - - -/***/ }), - -/***/ 6292: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultDelayDecider = void 0; -const constants_1 = __nccwpck_require__(57505); -const defaultDelayDecider = (delayBase, attempts) => Math.floor(Math.min(constants_1.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); -exports.defaultDelayDecider = defaultDelayDecider; - - -/***/ }), - -/***/ 9352: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(8441); -tslib_1.__exportStar(__nccwpck_require__(24720), exports); -tslib_1.__exportStar(__nccwpck_require__(60129), exports); -tslib_1.__exportStar(__nccwpck_require__(80731), exports); -tslib_1.__exportStar(__nccwpck_require__(92171), exports); -tslib_1.__exportStar(__nccwpck_require__(40372), exports); -tslib_1.__exportStar(__nccwpck_require__(6292), exports); -tslib_1.__exportStar(__nccwpck_require__(47216), exports); -tslib_1.__exportStar(__nccwpck_require__(15839), exports); -tslib_1.__exportStar(__nccwpck_require__(36857), exports); -tslib_1.__exportStar(__nccwpck_require__(54352), exports); - - -/***/ }), - -/***/ 47216: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getOmitRetryHeadersPlugin = exports.omitRetryHeadersMiddlewareOptions = exports.omitRetryHeadersMiddleware = void 0; -const protocol_http_1 = __nccwpck_require__(35712); -const constants_1 = __nccwpck_require__(57505); -const omitRetryHeadersMiddleware = () => (next) => async (args) => { - const { request } = args; - if (protocol_http_1.HttpRequest.isInstance(request)) { - delete request.headers[constants_1.INVOCATION_ID_HEADER]; - delete request.headers[constants_1.REQUEST_HEADER]; + if (p.equals(Point.ZERO)) + return JacobianPoint.ZERO; + return new JacobianPoint(p.x, p.y, _1n); } - return next(args); -}; -exports.omitRetryHeadersMiddleware = omitRetryHeadersMiddleware; -exports.omitRetryHeadersMiddlewareOptions = { - name: "omitRetryHeadersMiddleware", - tags: ["RETRY", "HEADERS", "OMIT_RETRY_HEADERS"], - relation: "before", - toMiddleware: "awsAuthMiddleware", - override: true, -}; -const getOmitRetryHeadersPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo((0, exports.omitRetryHeadersMiddleware)(), exports.omitRetryHeadersMiddlewareOptions); - }, -}); -exports.getOmitRetryHeadersPlugin = getOmitRetryHeadersPlugin; - - -/***/ }), - -/***/ 15839: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultRetryDecider = void 0; -const service_error_classification_1 = __nccwpck_require__(18300); -const defaultRetryDecider = (error) => { - if (!error) { - return false; + static toAffineBatch(points) { + const toInv = invertBatch(points.map((p) => p.z)); + return points.map((p, i) => p.toAffine(toInv[i])); } - return (0, service_error_classification_1.isRetryableByTrait)(error) || (0, service_error_classification_1.isClockSkewError)(error) || (0, service_error_classification_1.isThrottlingError)(error) || (0, service_error_classification_1.isTransientError)(error); -}; -exports.defaultRetryDecider = defaultRetryDecider; - - -/***/ }), - -/***/ 36857: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRetryPlugin = exports.retryMiddlewareOptions = exports.retryMiddleware = void 0; -const retryMiddleware = (options) => (next, context) => async (args) => { - const retryStrategy = await options.retryStrategy(); - if (retryStrategy === null || retryStrategy === void 0 ? void 0 : retryStrategy.mode) - context.userAgent = [...(context.userAgent || []), ["cfg/retry-mode", retryStrategy.mode]]; - return retryStrategy.retry(next, args); -}; -exports.retryMiddleware = retryMiddleware; -exports.retryMiddlewareOptions = { - name: "retryMiddleware", - tags: ["RETRY"], - step: "finalizeRequest", - priority: "high", - override: true, -}; -const getRetryPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add((0, exports.retryMiddleware)(options), exports.retryMiddlewareOptions); - }, -}); -exports.getRetryPlugin = getRetryPlugin; - - -/***/ }), - -/***/ 54352: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 8441: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + static normalizeZ(points) { + return JacobianPoint.toAffineBatch(points).map(JacobianPoint.fromAffine); } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); + equals(other) { + assertJacPoint(other); + const { x: X1, y: Y1, z: Z1 } = this; + const { x: X2, y: Y2, z: Z2 } = other; + const Z1Z1 = mod(Z1 * Z1); + const Z2Z2 = mod(Z2 * Z2); + const U1 = mod(X1 * Z2Z2); + const U2 = mod(X2 * Z1Z1); + const S1 = mod(mod(Y1 * Z2) * Z2Z2); + const S2 = mod(mod(Y2 * Z1) * Z1Z1); + return U1 === U2 && S1 === S2; } - else { - factory(createExporter(root)); + negate() { + return new JacobianPoint(this.x, mod(-this.y), this.z); } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); + double() { + const { x: X1, y: Y1, z: Z1 } = this; + const A = mod(X1 * X1); + const B = mod(Y1 * Y1); + const C = mod(B * B); + const x1b = X1 + B; + const D = mod(_2n * (mod(x1b * x1b) - A - C)); + const E = mod(_3n * A); + const F = mod(E * E); + const X3 = mod(F - _2n * D); + const Y3 = mod(E * (D - X3) - _8n * C); + const Z3 = mod(_2n * Y1 * Z1); + return new JacobianPoint(X3, Y3, Z3); + } + add(other) { + assertJacPoint(other); + const { x: X1, y: Y1, z: Z1 } = this; + const { x: X2, y: Y2, z: Z2 } = other; + if (X2 === _0n || Y2 === _0n) + return this; + if (X1 === _0n || Y1 === _0n) + return other; + const Z1Z1 = mod(Z1 * Z1); + const Z2Z2 = mod(Z2 * Z2); + const U1 = mod(X1 * Z2Z2); + const U2 = mod(X2 * Z1Z1); + const S1 = mod(mod(Y1 * Z2) * Z2Z2); + const S2 = mod(mod(Y2 * Z1) * Z1Z1); + const H = mod(U2 - U1); + const r = mod(S2 - S1); + if (H === _0n) { + if (r === _0n) { + return this.double(); } else { - exports.__esModule = true; + return JacobianPoint.ZERO; } } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + const HH = mod(H * H); + const HHH = mod(H * HH); + const V = mod(U1 * HH); + const X3 = mod(r * r - HHH - _2n * V); + const Y3 = mod(r * (V - X3) - S1 * HHH); + const Z3 = mod(Z1 * Z2 * H); + return new JacobianPoint(X3, Y3, Z3); } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; + subtract(other) { + return this.add(other.negate()); + } + multiplyUnsafe(scalar) { + const P0 = JacobianPoint.ZERO; + if (typeof scalar === 'bigint' && scalar === _0n) + return P0; + let n = normalizeScalar(scalar); + if (n === _1n) + return this; + if (!USE_ENDOMORPHISM) { + let p = P0; + let d = this; + while (n > _0n) { + if (n & _1n) + p = p.add(d); + d = d.double(); + n >>= _1n; } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; + return p; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); + let k1p = P0; + let k2p = P0; + let d = this; + while (k1 > _0n || k2 > _0n) { + if (k1 & _1n) + k1p = k1p.add(d); + if (k2 & _1n) + k2p = k2p.add(d); + d = d.double(); + k1 >>= _1n; + k2 >>= _1n; } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); + if (k1neg) + k1p = k1p.negate(); + if (k2neg) + k2p = k2p.negate(); + k2p = new JacobianPoint(mod(k2p.x * endo.beta), k2p.y, k2p.z); + return k1p.add(k2p); + } + precomputeWindow(W) { + const windows = USE_ENDOMORPHISM ? 128 / W + 1 : 256 / W + 1; + const points = []; + let p = this; + let base = p; + for (let window = 0; window < windows; window++) { + base = p; + points.push(base); + for (let i = 1; i < 2 ** (W - 1); i++) { + base = base.add(p); + points.push(base); } - finally { if (e) throw e.error; } + p = base.double(); } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } + return points; + } + wNAF(n, affinePoint) { + if (!affinePoint && this.equals(JacobianPoint.BASE)) + affinePoint = Point.BASE; + const W = (affinePoint && affinePoint._WINDOW_SIZE) || 1; + if (256 % W) { + throw new Error('Point#wNAF: Invalid precomputation window, must be power of 2'); } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); - - -/***/ }), - -/***/ 95408: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getCheckContentLengthHeaderPlugin = exports.checkContentLengthHeaderMiddlewareOptions = exports.checkContentLengthHeader = void 0; -const protocol_http_1 = __nccwpck_require__(35712); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const CONTENT_LENGTH_HEADER = "content-length"; -function checkContentLengthHeader() { - return (next, context) => async (args) => { - var _a; - const { request } = args; - if (protocol_http_1.HttpRequest.isInstance(request)) { - if (!request.headers[CONTENT_LENGTH_HEADER]) { - const message = `Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.`; - if (typeof ((_a = context === null || context === void 0 ? void 0 : context.logger) === null || _a === void 0 ? void 0 : _a.warn) === "function" && !(context.logger instanceof smithy_client_1.NoOpLogger)) { - context.logger.warn(message); - } - else { - console.warn(message); - } + let precomputes = affinePoint && pointPrecomputes.get(affinePoint); + if (!precomputes) { + precomputes = this.precomputeWindow(W); + if (affinePoint && W !== 1) { + precomputes = JacobianPoint.normalizeZ(precomputes); + pointPrecomputes.set(affinePoint, precomputes); } } - return next({ ...args }); - }; -} -exports.checkContentLengthHeader = checkContentLengthHeader; -exports.checkContentLengthHeaderMiddlewareOptions = { - step: "finalizeRequest", - tags: ["CHECK_CONTENT_LENGTH_HEADER"], - name: "getCheckContentLengthHeaderPlugin", - override: true, -}; -const getCheckContentLengthHeaderPlugin = (unused) => ({ - applyToStack: (clientStack) => { - clientStack.add(checkContentLengthHeader(), exports.checkContentLengthHeaderMiddlewareOptions); - }, -}); -exports.getCheckContentLengthHeaderPlugin = getCheckContentLengthHeaderPlugin; - - -/***/ }), - -<<<<<<< HEAD -/***/ 52776: -======= -/***/ 60444: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(85591); -tslib_1.__exportStar(__nccwpck_require__(10397), exports); -tslib_1.__exportStar(__nccwpck_require__(46928), exports); -tslib_1.__exportStar(__nccwpck_require__(98385), exports); -tslib_1.__exportStar(__nccwpck_require__(74219), exports); -tslib_1.__exportStar(__nccwpck_require__(41215), exports); -tslib_1.__exportStar(__nccwpck_require__(80110), exports); -tslib_1.__exportStar(__nccwpck_require__(42758), exports); -======= -const tslib_1 = __nccwpck_require__(66576); -tslib_1.__exportStar(__nccwpck_require__(95408), exports); -tslib_1.__exportStar(__nccwpck_require__(93265), exports); -tslib_1.__exportStar(__nccwpck_require__(86327), exports); -tslib_1.__exportStar(__nccwpck_require__(62014), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - -/***/ }), - -<<<<<<< HEAD -/***/ 46928: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.regionRedirectEndpointMiddlewareOptions = exports.regionRedirectEndpointMiddleware = void 0; -const regionRedirectEndpointMiddleware = (config) => { - return (next, context) => async (args) => { - const originalRegion = await config.region(); - const regionProviderRef = config.region; - if (context.__s3RegionRedirect) { - config.region = async () => { - config.region = regionProviderRef; - return context.__s3RegionRedirect; - }; - } - const result = await next(args); - if (context.__s3RegionRedirect) { - const region = await config.region(); - if (originalRegion !== region) { - throw new Error("Region was not restored following S3 region redirect."); + let p = JacobianPoint.ZERO; + let f = JacobianPoint.BASE; + const windows = 1 + (USE_ENDOMORPHISM ? 128 / W : 256 / W); + const windowSize = 2 ** (W - 1); + const mask = BigInt(2 ** W - 1); + const maxNumber = 2 ** W; + const shiftBy = BigInt(W); + for (let window = 0; window < windows; window++) { + const offset = window * windowSize; + let wbits = Number(n & mask); + n >>= shiftBy; + if (wbits > windowSize) { + wbits -= maxNumber; + n += _1n; } - } - return result; - }; -}; -exports.regionRedirectEndpointMiddleware = regionRedirectEndpointMiddleware; -exports.regionRedirectEndpointMiddlewareOptions = { - tags: ["REGION_REDIRECT", "S3"], - name: "regionRedirectEndpointMiddleware", - override: true, - relation: "before", - toMiddleware: "endpointV2Middleware", -}; - - -/***/ }), - -/***/ 98385: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRegionRedirectMiddlewarePlugin = exports.regionRedirectMiddlewareOptions = exports.regionRedirectMiddleware = void 0; -const region_redirect_endpoint_middleware_1 = __nccwpck_require__(46928); -function regionRedirectMiddleware(clientConfig) { - return (next, context) => async (args) => { - var _a, _b; - try { - return await next(args); - } - catch (err) { - if (clientConfig.followRegionRedirects && - ((_a = err === null || err === void 0 ? void 0 : err.$metadata) === null || _a === void 0 ? void 0 : _a.httpStatusCode) === 301) { - try { - const actualRegion = err.$response.headers["x-amz-bucket-region"]; - (_b = context.logger) === null || _b === void 0 ? void 0 : _b.debug(`Redirecting from ${await clientConfig.region()} to ${actualRegion}`); - context.__s3RegionRedirect = actualRegion; - } - catch (e) { - throw new Error("Region redirect failed: " + e); - } - return next(args); + const offset1 = offset; + const offset2 = offset + Math.abs(wbits) - 1; + const cond1 = window % 2 !== 0; + const cond2 = wbits < 0; + if (wbits === 0) { + f = f.add(constTimeNegate(cond1, precomputes[offset1])); } else { - throw err; + p = p.add(constTimeNegate(cond2, precomputes[offset2])); } } - }; -} -exports.regionRedirectMiddleware = regionRedirectMiddleware; -exports.regionRedirectMiddlewareOptions = { - step: "initialize", - tags: ["REGION_REDIRECT", "S3"], - name: "regionRedirectMiddleware", - override: true, -}; -const getRegionRedirectMiddlewarePlugin = (clientConfig) => ({ - applyToStack: (clientStack) => { - clientStack.add(regionRedirectMiddleware(clientConfig), exports.regionRedirectMiddlewareOptions); - clientStack.addRelativeTo((0, region_redirect_endpoint_middleware_1.regionRedirectEndpointMiddleware)(clientConfig), region_redirect_endpoint_middleware_1.regionRedirectEndpointMiddlewareOptions); - }, -}); -exports.getRegionRedirectMiddlewarePlugin = getRegionRedirectMiddlewarePlugin; - - -/***/ }), - -/***/ 47502: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.S3ExpressIdentityCache = void 0; -class S3ExpressIdentityCache { - constructor(data = {}) { - this.data = data; - this.lastPurgeTime = Date.now(); - } - get(key) { - const entry = this.data[key]; - if (!entry) { - return; - } - return entry; - } - set(key, entry) { - this.data[key] = entry; - return entry; - } - delete(key) { - delete this.data[key]; + return { p, f }; } - async purgeExpired() { - const now = Date.now(); - if (this.lastPurgeTime + S3ExpressIdentityCache.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS > now) { - return; + multiply(scalar, affinePoint) { + let n = normalizeScalar(scalar); + let point; + let fake; + if (USE_ENDOMORPHISM) { + const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); + let { p: k1p, f: f1p } = this.wNAF(k1, affinePoint); + let { p: k2p, f: f2p } = this.wNAF(k2, affinePoint); + k1p = constTimeNegate(k1neg, k1p); + k2p = constTimeNegate(k2neg, k2p); + k2p = new JacobianPoint(mod(k2p.x * endo.beta), k2p.y, k2p.z); + point = k1p.add(k2p); + fake = f1p.add(f2p); } - for (const key in this.data) { - const entry = this.data[key]; - if (!entry.isRefreshing) { - const credential = await entry.identity; - if (credential.expiration) { - if (credential.expiration.getTime() < now) { - delete this.data[key]; - } - } - } + else { + const { p, f } = this.wNAF(n, affinePoint); + point = p; + fake = f; } + return JacobianPoint.normalizeZ([point, fake])[0]; + } + toAffine(invZ) { + const { x, y, z } = this; + const is0 = this.equals(JacobianPoint.ZERO); + if (invZ == null) + invZ = is0 ? _8n : invert(z); + const iz1 = invZ; + const iz2 = mod(iz1 * iz1); + const iz3 = mod(iz2 * iz1); + const ax = mod(x * iz2); + const ay = mod(y * iz3); + const zz = mod(z * iz1); + if (is0) + return Point.ZERO; + if (zz !== _1n) + throw new Error('invZ was invalid'); + return new Point(ax, ay); } } -exports.S3ExpressIdentityCache = S3ExpressIdentityCache; -S3ExpressIdentityCache.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS = 30000; - - -/***/ }), - -/***/ 70483: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.S3ExpressIdentityCacheEntry = void 0; -class S3ExpressIdentityCacheEntry { - constructor(_identity, isRefreshing = false, accessed = Date.now()) { - this._identity = _identity; - this.isRefreshing = isRefreshing; - this.accessed = accessed; +JacobianPoint.BASE = new JacobianPoint(CURVE.Gx, CURVE.Gy, _1n); +JacobianPoint.ZERO = new JacobianPoint(_0n, _1n, _0n); +function constTimeNegate(condition, item) { + const neg = item.negate(); + return condition ? neg : item; +} +const pointPrecomputes = new WeakMap(); +class Point { + constructor(x, y) { + this.x = x; + this.y = y; } - get identity() { - this.accessed = Date.now(); - return this._identity; + _setWindowSize(windowSize) { + this._WINDOW_SIZE = windowSize; + pointPrecomputes.delete(this); } -} -exports.S3ExpressIdentityCacheEntry = S3ExpressIdentityCacheEntry; - - -/***/ }), - -/***/ 46610: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.S3ExpressIdentityProviderImpl = void 0; -const S3ExpressIdentityCache_1 = __nccwpck_require__(47502); -const S3ExpressIdentityCacheEntry_1 = __nccwpck_require__(70483); -class S3ExpressIdentityProviderImpl { - constructor(createSessionFn, cache = new S3ExpressIdentityCache_1.S3ExpressIdentityCache()) { - this.createSessionFn = createSessionFn; - this.cache = cache; + hasEvenY() { + return this.y % _2n === _0n; } - async getS3ExpressIdentity(awsIdentity, identityProperties) { - const key = identityProperties.Bucket; - const { cache } = this; - const entry = cache.get(key); - if (entry) { - return entry.identity.then((identity) => { - var _a, _b, _c, _d; - const isExpired = ((_b = (_a = identity.expiration) === null || _a === void 0 ? void 0 : _a.getTime()) !== null && _b !== void 0 ? _b : 0) < Date.now(); - if (isExpired) { - return cache.set(key, new S3ExpressIdentityCacheEntry_1.S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity; - } - const isExpiringSoon = ((_d = (_c = identity.expiration) === null || _c === void 0 ? void 0 : _c.getTime()) !== null && _d !== void 0 ? _d : 0) < Date.now() + S3ExpressIdentityProviderImpl.REFRESH_WINDOW_MS; - if (isExpiringSoon && !entry.isRefreshing) { - entry.isRefreshing = true; - this.getIdentity(key).then((id) => { - cache.set(key, new S3ExpressIdentityCacheEntry_1.S3ExpressIdentityCacheEntry(Promise.resolve(id))); - }); - } - return identity; - }); + static fromCompressedHex(bytes) { + const isShort = bytes.length === 32; + const x = bytesToNumber(isShort ? bytes : bytes.subarray(1)); + if (!isValidFieldElement(x)) + throw new Error('Point is not on curve'); + const y2 = weierstrass(x); + let y = sqrtMod(y2); + const isYOdd = (y & _1n) === _1n; + if (isShort) { + if (isYOdd) + y = mod(-y); } - return cache.set(key, new S3ExpressIdentityCacheEntry_1.S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity; - } - async getIdentity(key) { - var _a, _b; - await this.cache.purgeExpired().catch((error) => { - console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n" + error); - }); - const session = await this.createSessionFn(key); - if (!((_a = session.Credentials) === null || _a === void 0 ? void 0 : _a.AccessKeyId) || !((_b = session.Credentials) === null || _b === void 0 ? void 0 : _b.SecretAccessKey)) { - throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey."); + else { + const isFirstByteOdd = (bytes[0] & 1) === 1; + if (isFirstByteOdd !== isYOdd) + y = mod(-y); } - const identity = { - accessKeyId: session.Credentials.AccessKeyId, - secretAccessKey: session.Credentials.SecretAccessKey, - sessionToken: session.Credentials.SessionToken, - expiration: session.Credentials.Expiration ? new Date(session.Credentials.Expiration) : undefined, - }; - return identity; + const point = new Point(x, y); + point.assertValidity(); + return point; } -} -exports.S3ExpressIdentityProviderImpl = S3ExpressIdentityProviderImpl; -S3ExpressIdentityProviderImpl.REFRESH_WINDOW_MS = 60000; - - -/***/ }), - -/***/ 33534: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SignatureV4S3Express = void 0; -const signature_v4_1 = __nccwpck_require__(91116); -const constants_1 = __nccwpck_require__(33695); -class SignatureV4S3Express extends signature_v4_1.SignatureV4 { - async signWithCredentials(requestToSign, credentials, options) { - const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials); - requestToSign.headers[constants_1.SESSION_TOKEN_HEADER] = credentials.sessionToken; - const privateAccess = this; - setSingleOverride(privateAccess, credentialsWithoutSessionToken); - return privateAccess.signRequest(requestToSign, options !== null && options !== void 0 ? options : {}); + static fromUncompressedHex(bytes) { + const x = bytesToNumber(bytes.subarray(1, fieldLen + 1)); + const y = bytesToNumber(bytes.subarray(fieldLen + 1, fieldLen * 2 + 1)); + const point = new Point(x, y); + point.assertValidity(); + return point; } - async presignWithCredentials(requestToSign, credentials, options) { - var _a; - const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials); - delete requestToSign.headers[constants_1.SESSION_TOKEN_HEADER]; - requestToSign.headers[constants_1.SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken; - requestToSign.query = (_a = requestToSign.query) !== null && _a !== void 0 ? _a : {}; - requestToSign.query[constants_1.SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken; - const privateAccess = this; - setSingleOverride(privateAccess, credentialsWithoutSessionToken); - return this.presign(requestToSign, options); + static fromHex(hex) { + const bytes = ensureBytes(hex); + const len = bytes.length; + const header = bytes[0]; + if (len === fieldLen) + return this.fromCompressedHex(bytes); + if (len === compressedLen && (header === 0x02 || header === 0x03)) { + return this.fromCompressedHex(bytes); + } + if (len === uncompressedLen && header === 0x04) + return this.fromUncompressedHex(bytes); + throw new Error(`Point.fromHex: received invalid point. Expected 32-${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes, not ${len}`); + } + static fromPrivateKey(privateKey) { + return Point.BASE.multiply(normalizePrivateKey(privateKey)); + } + static fromSignature(msgHash, signature, recovery) { + const { r, s } = normalizeSignature(signature); + if (![0, 1, 2, 3].includes(recovery)) + throw new Error('Cannot recover: invalid recovery bit'); + const h = truncateHash(ensureBytes(msgHash)); + const { n } = CURVE; + const radj = recovery === 2 || recovery === 3 ? r + n : r; + const rinv = invert(radj, n); + const u1 = mod(-h * rinv, n); + const u2 = mod(s * rinv, n); + const prefix = recovery & 1 ? '03' : '02'; + const R = Point.fromHex(prefix + numTo32bStr(radj)); + const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); + if (!Q) + throw new Error('Cannot recover signature: point at infinify'); + Q.assertValidity(); + return Q; + } + toRawBytes(isCompressed = false) { + return hexToBytes(this.toHex(isCompressed)); + } + toHex(isCompressed = false) { + const x = numTo32bStr(this.x); + if (isCompressed) { + const prefix = this.hasEvenY() ? '02' : '03'; + return `${prefix}${x}`; + } + else { + return `04${x}${numTo32bStr(this.y)}`; + } + } + toHexX() { + return this.toHex(true).slice(2); + } + toRawX() { + return this.toRawBytes(true).slice(1); + } + assertValidity() { + const msg = 'Point is not on elliptic curve'; + const { x, y } = this; + if (!isValidFieldElement(x) || !isValidFieldElement(y)) + throw new Error(msg); + const left = mod(y * y); + const right = weierstrass(x); + if (mod(left - right) !== _0n) + throw new Error(msg); + } + equals(other) { + return this.x === other.x && this.y === other.y; + } + negate() { + return new Point(this.x, mod(-this.y)); + } + double() { + return JacobianPoint.fromAffine(this).double().toAffine(); + } + add(other) { + return JacobianPoint.fromAffine(this).add(JacobianPoint.fromAffine(other)).toAffine(); + } + subtract(other) { + return this.add(other.negate()); + } + multiply(scalar) { + return JacobianPoint.fromAffine(this).multiply(scalar, this).toAffine(); + } + multiplyAndAddUnsafe(Q, a, b) { + const P = JacobianPoint.fromAffine(this); + const aP = a === _0n || a === _1n || this !== Point.BASE ? P.multiplyUnsafe(a) : P.multiply(a); + const bQ = JacobianPoint.fromAffine(Q).multiplyUnsafe(b); + const sum = aP.add(bQ); + return sum.equals(JacobianPoint.ZERO) ? undefined : sum.toAffine(); } } -exports.SignatureV4S3Express = SignatureV4S3Express; -function getCredentialsWithoutSessionToken(credentials) { - const credentialsWithoutSessionToken = { - accessKeyId: credentials.accessKeyId, - secretAccessKey: credentials.secretAccessKey, - expiration: credentials.expiration, - }; - return credentialsWithoutSessionToken; +exports.Point = Point; +Point.BASE = new Point(CURVE.Gx, CURVE.Gy); +Point.ZERO = new Point(_0n, _0n); +function sliceDER(s) { + return Number.parseInt(s[0], 16) >= 8 ? '00' + s : s; } -function setSingleOverride(privateAccess, credentialsWithoutSessionToken) { - const id = setTimeout(() => { - throw new Error("SignatureV4S3Express credential override was created but not called."); - }, 10); - const currentCredentialProvider = privateAccess.credentialProvider; - const overrideCredentialsProviderOnce = () => { - clearTimeout(id); - privateAccess.credentialProvider = currentCredentialProvider; - return Promise.resolve(credentialsWithoutSessionToken); - }; - privateAccess.credentialProvider = overrideCredentialsProviderOnce; +function parseDERInt(data) { + if (data.length < 2 || data[0] !== 0x02) { + throw new Error(`Invalid signature integer tag: ${bytesToHex(data)}`); + } + const len = data[1]; + const res = data.subarray(2, len + 2); + if (!len || res.length !== len) { + throw new Error(`Invalid signature integer: wrong length`); + } + if (res[0] === 0x00 && res[1] <= 0x7f) { + throw new Error('Invalid signature integer: trailing length'); + } + return { data: bytesToNumber(res), left: data.subarray(len + 2) }; } - - -/***/ }), - -/***/ 33695: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME = exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME = exports.SESSION_TOKEN_HEADER = exports.SESSION_TOKEN_QUERY_PARAM = exports.S3_EXPRESS_AUTH_SCHEME = exports.S3_EXPRESS_BACKEND = exports.S3_EXPRESS_BUCKET_TYPE = void 0; -const util_config_provider_1 = __nccwpck_require__(32617); -exports.S3_EXPRESS_BUCKET_TYPE = "Directory"; -exports.S3_EXPRESS_BACKEND = "S3Express"; -exports.S3_EXPRESS_AUTH_SCHEME = "sigv4-s3express"; -exports.SESSION_TOKEN_QUERY_PARAM = "X-Amz-S3session-Token"; -exports.SESSION_TOKEN_HEADER = exports.SESSION_TOKEN_QUERY_PARAM.toLowerCase(); -exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME = "AWS_S3_DISABLE_EXPRESS_SESSION_AUTH"; -exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME = "s3_disable_express_session_auth"; -exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = { - environmentVariableSelector: (env) => (0, util_config_provider_1.booleanSelector)(env, exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME, util_config_provider_1.SelectorType.ENV), - configFileSelector: (profile) => (0, util_config_provider_1.booleanSelector)(profile, exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME, util_config_provider_1.SelectorType.CONFIG), - default: false, -}; - - -/***/ }), - -/***/ 50076: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getS3ExpressPlugin = exports.s3ExpressMiddlewareOptions = exports.s3ExpressMiddleware = void 0; -const protocol_http_1 = __nccwpck_require__(45311); -const constants_1 = __nccwpck_require__(33695); -const s3ExpressMiddleware = (options) => { - return (next, context) => async (args) => { - var _a, _b, _c, _d, _e; - if (context.endpointV2) { - const endpoint = context.endpointV2; - const isS3ExpressAuth = ((_c = (_b = (_a = endpoint.properties) === null || _a === void 0 ? void 0 : _a.authSchemes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.name) === constants_1.S3_EXPRESS_AUTH_SCHEME; - const isS3ExpressBucket = ((_d = endpoint.properties) === null || _d === void 0 ? void 0 : _d.backend) === constants_1.S3_EXPRESS_BACKEND || - ((_e = endpoint.properties) === null || _e === void 0 ? void 0 : _e.bucketType) === constants_1.S3_EXPRESS_BUCKET_TYPE; - if (isS3ExpressBucket) { - context.isS3ExpressBucket = true; - } - if (isS3ExpressAuth) { - const requestBucket = args.input.Bucket; - if (requestBucket) { - const s3ExpressIdentity = await options.s3ExpressIdentityProvider.getS3ExpressIdentity(await options.credentials(), { - Bucket: requestBucket, - }); - context.s3ExpressIdentity = s3ExpressIdentity; - if (protocol_http_1.HttpRequest.isInstance(args.request) && s3ExpressIdentity.sessionToken) { - args.request.headers[constants_1.SESSION_TOKEN_HEADER] = s3ExpressIdentity.sessionToken; - } - } - } - } - return next(args); - }; -}; -exports.s3ExpressMiddleware = s3ExpressMiddleware; -exports.s3ExpressMiddlewareOptions = { - name: "s3ExpressMiddleware", - step: "build", - tags: ["S3", "S3_EXPRESS"], - override: true, -}; -const getS3ExpressPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add((0, exports.s3ExpressMiddleware)(options), exports.s3ExpressMiddlewareOptions); - }, -}); -exports.getS3ExpressPlugin = getS3ExpressPlugin; - - -/***/ }), - -/***/ 74219: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.s3ExpressMiddlewareOptions = exports.s3ExpressMiddleware = exports.getS3ExpressPlugin = exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = exports.SignatureV4S3Express = exports.S3ExpressIdentityProviderImpl = exports.S3ExpressIdentityCacheEntry = exports.S3ExpressIdentityCache = void 0; -var S3ExpressIdentityCache_1 = __nccwpck_require__(47502); -Object.defineProperty(exports, "S3ExpressIdentityCache", ({ enumerable: true, get: function () { return S3ExpressIdentityCache_1.S3ExpressIdentityCache; } })); -var S3ExpressIdentityCacheEntry_1 = __nccwpck_require__(70483); -Object.defineProperty(exports, "S3ExpressIdentityCacheEntry", ({ enumerable: true, get: function () { return S3ExpressIdentityCacheEntry_1.S3ExpressIdentityCacheEntry; } })); -var S3ExpressIdentityProviderImpl_1 = __nccwpck_require__(46610); -Object.defineProperty(exports, "S3ExpressIdentityProviderImpl", ({ enumerable: true, get: function () { return S3ExpressIdentityProviderImpl_1.S3ExpressIdentityProviderImpl; } })); -var SignatureV4S3Express_1 = __nccwpck_require__(33534); -Object.defineProperty(exports, "SignatureV4S3Express", ({ enumerable: true, get: function () { return SignatureV4S3Express_1.SignatureV4S3Express; } })); -var constants_1 = __nccwpck_require__(33695); -Object.defineProperty(exports, "NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS", ({ enumerable: true, get: function () { return constants_1.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS; } })); -var s3ExpressMiddleware_1 = __nccwpck_require__(50076); -Object.defineProperty(exports, "getS3ExpressPlugin", ({ enumerable: true, get: function () { return s3ExpressMiddleware_1.getS3ExpressPlugin; } })); -Object.defineProperty(exports, "s3ExpressMiddleware", ({ enumerable: true, get: function () { return s3ExpressMiddleware_1.s3ExpressMiddleware; } })); -Object.defineProperty(exports, "s3ExpressMiddlewareOptions", ({ enumerable: true, get: function () { return s3ExpressMiddleware_1.s3ExpressMiddlewareOptions; } })); - - -/***/ }), - -/***/ 41215: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveS3Config = void 0; -const s3_express_1 = __nccwpck_require__(74219); -const resolveS3Config = (input, { session, }) => { - var _a, _b, _c, _d, _e; - const [s3ClientProvider, CreateSessionCommandCtor] = session; - return { - ...input, - forcePathStyle: (_a = input.forcePathStyle) !== null && _a !== void 0 ? _a : false, - useAccelerateEndpoint: (_b = input.useAccelerateEndpoint) !== null && _b !== void 0 ? _b : false, - disableMultiregionAccessPoints: (_c = input.disableMultiregionAccessPoints) !== null && _c !== void 0 ? _c : false, - followRegionRedirects: (_d = input.followRegionRedirects) !== null && _d !== void 0 ? _d : false, - s3ExpressIdentityProvider: (_e = input.s3ExpressIdentityProvider) !== null && _e !== void 0 ? _e : new s3_express_1.S3ExpressIdentityProviderImpl(async (key) => s3ClientProvider().send(new CreateSessionCommandCtor({ - Bucket: key, - SessionMode: "ReadWrite", - }))), - }; -}; -exports.resolveS3Config = resolveS3Config; - - -/***/ }), - -/***/ 80110: -======= -/***/ 93265: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getThrow200ExceptionsPlugin = exports.throw200ExceptionsMiddlewareOptions = exports.throw200ExceptionsMiddleware = void 0; -<<<<<<< HEAD -const protocol_http_1 = __nccwpck_require__(45311); -======= -const protocol_http_1 = __nccwpck_require__(35712); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const throw200ExceptionsMiddleware = (config) => (next) => async (args) => { - const result = await next(args); - const { response } = result; - if (!protocol_http_1.HttpResponse.isInstance(response)) - return result; - const { statusCode, body } = response; - if (statusCode < 200 || statusCode >= 300) - return result; - const bodyBytes = await collectBody(body, config); - const bodyString = await collectBodyString(bodyBytes, config); - if (bodyBytes.length === 0) { - const err = new Error("S3 aborted request"); - err.name = "InternalError"; - throw err; +function parseDERSignature(data) { + if (data.length < 2 || data[0] != 0x30) { + throw new Error(`Invalid signature tag: ${bytesToHex(data)}`); } - if (bodyString && bodyString.match("")) { - response.statusCode = 400; + if (data[1] !== data.length - 2) { + throw new Error('Invalid signature: incorrect length'); } - response.body = bodyBytes; - return result; -}; -exports.throw200ExceptionsMiddleware = throw200ExceptionsMiddleware; -const collectBody = (streamBody = new Uint8Array(), context) => { - if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + const { data: r, left: sBytes } = parseDERInt(data.subarray(2)); + const { data: s, left: rBytesLeft } = parseDERInt(sBytes); + if (rBytesLeft.length) { + throw new Error(`Invalid signature: left bytes after parsing: ${bytesToHex(rBytesLeft)}`); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); -}; -const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); -exports.throw200ExceptionsMiddlewareOptions = { - relation: "after", - toMiddleware: "deserializerMiddleware", - tags: ["THROW_200_EXCEPTIONS", "S3"], - name: "throw200ExceptionsMiddleware", - override: true, -}; -const getThrow200ExceptionsPlugin = (config) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo((0, exports.throw200ExceptionsMiddleware)(config), exports.throw200ExceptionsMiddlewareOptions); - }, -}); -exports.getThrow200ExceptionsPlugin = getThrow200ExceptionsPlugin; - - -/***/ }), - -<<<<<<< HEAD -/***/ 42758: -======= -/***/ 86327: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getValidateBucketNamePlugin = exports.validateBucketNameMiddlewareOptions = exports.validateBucketNameMiddleware = void 0; -<<<<<<< HEAD -const util_arn_parser_1 = __nccwpck_require__(84122); -======= -const util_arn_parser_1 = __nccwpck_require__(1679); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -function validateBucketNameMiddleware() { - return (next) => async (args) => { - const { input: { Bucket }, } = args; - if (typeof Bucket === "string" && !(0, util_arn_parser_1.validate)(Bucket) && Bucket.indexOf("/") >= 0) { - const err = new Error(`Bucket name shouldn't contain '/', received '${Bucket}'`); - err.name = "InvalidBucketName"; - throw err; - } - return next({ ...args }); - }; + return { r, s }; } -exports.validateBucketNameMiddleware = validateBucketNameMiddleware; -exports.validateBucketNameMiddlewareOptions = { - step: "initialize", - tags: ["VALIDATE_BUCKET_NAME"], - name: "validateBucketNameMiddleware", - override: true, -}; -const getValidateBucketNamePlugin = (unused) => ({ - applyToStack: (clientStack) => { - clientStack.add(validateBucketNameMiddleware(), exports.validateBucketNameMiddlewareOptions); - }, -}); -exports.getValidateBucketNamePlugin = getValidateBucketNamePlugin; - - -/***/ }), - -<<<<<<< HEAD -/***/ 85591: -======= -/***/ 62014: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getWriteGetObjectResponseEndpointPlugin = exports.writeGetObjectResponseEndpointMiddlewareOptions = exports.writeGetObjectResponseEndpointMiddleware = void 0; -const middleware_bucket_endpoint_1 = __nccwpck_require__(98228); -const protocol_http_1 = __nccwpck_require__(35712); -const writeGetObjectResponseEndpointMiddleware = (config) => (next, context) => async (args) => { - const { region: regionProvider, isCustomEndpoint, disableHostPrefix } = config; - const region = await regionProvider(); - const { request, input } = args; - if (!protocol_http_1.HttpRequest.isInstance(request)) - return next({ ...args }); - let hostname = request.hostname; - if (hostname.endsWith("s3.amazonaws.com") || hostname.endsWith("s3-external-1.amazonaws.com")) { - return next({ ...args }); +class Signature { + constructor(r, s) { + this.r = r; + this.s = s; + this.assertValidity(); } - if (!isCustomEndpoint) { - const [, suffix] = (0, middleware_bucket_endpoint_1.getSuffixForArnEndpoint)(request.hostname); - hostname = `s3-object-lambda.${region}.${suffix}`; + static fromCompact(hex) { + const arr = hex instanceof Uint8Array; + const name = 'Signature.fromCompact'; + if (typeof hex !== 'string' && !arr) + throw new TypeError(`${name}: Expected string or Uint8Array`); + const str = arr ? bytesToHex(hex) : hex; + if (str.length !== 128) + throw new Error(`${name}: Expected 64-byte hex`); + return new Signature(hexToNumber(str.slice(0, 64)), hexToNumber(str.slice(64, 128))); } - if (!disableHostPrefix && input.RequestRoute) { - hostname = `${input.RequestRoute}.${hostname}`; + static fromDER(hex) { + const arr = hex instanceof Uint8Array; + if (typeof hex !== 'string' && !arr) + throw new TypeError(`Signature.fromDER: Expected string or Uint8Array`); + const { r, s } = parseDERSignature(arr ? hex : hexToBytes(hex)); + return new Signature(r, s); } - request.hostname = hostname; - context["signing_service"] = "s3-object-lambda"; - if (config.runtime === "node" && !request.headers["content-length"]) { - request.headers["transfer-encoding"] = "chunked"; + static fromHex(hex) { + return this.fromDER(hex); } - return next({ ...args }); -}; -exports.writeGetObjectResponseEndpointMiddleware = writeGetObjectResponseEndpointMiddleware; -exports.writeGetObjectResponseEndpointMiddlewareOptions = { - relation: "after", - toMiddleware: "contentLengthMiddleware", - tags: ["WRITE_GET_OBJECT_RESPONSE", "S3", "ENDPOINT"], - name: "writeGetObjectResponseEndpointMiddleware", - override: true, -}; -const getWriteGetObjectResponseEndpointPlugin = (config) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo((0, exports.writeGetObjectResponseEndpointMiddleware)(config), exports.writeGetObjectResponseEndpointMiddlewareOptions); - }, -}); -exports.getWriteGetObjectResponseEndpointPlugin = getWriteGetObjectResponseEndpointPlugin; - - -/***/ }), - -/***/ 66576: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -<<<<<<< HEAD -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); -======= -/***/ }), - -/***/ 42055: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveStsAuthConfig = void 0; -const middleware_signing_1 = __nccwpck_require__(33233); -const resolveStsAuthConfig = (input, { stsClientCtor }) => (0, middleware_signing_1.resolveAwsAuthConfig)({ - ...input, - stsClientCtor, -}); -exports.resolveStsAuthConfig = resolveStsAuthConfig; - - -/***/ }), - -/***/ 75967: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.deserializerMiddleware = void 0; -const deserializerMiddleware = (options, deserializer) => (next, context) => async (args) => { - const { response } = await next(args); - try { - const parsed = await deserializer(response, options); - return { - response, - output: parsed, - }; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + assertValidity() { + const { r, s } = this; + if (!isWithinCurveOrder(r)) + throw new Error('Invalid Signature: r must be 0 < r < n'); + if (!isWithinCurveOrder(s)) + throw new Error('Invalid Signature: s must be 0 < s < n'); } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); + hasHighS() { + const HALF = CURVE.n >> _1n; + return this.s > HALF; } - else { - factory(createExporter(root)); + normalizeS() { + return this.hasHighS() ? new Signature(this.r, mod(-this.s, CURVE.n)) : this; } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + toDERRawBytes() { + return hexToBytes(this.toDERHex()); } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - -<<<<<<< HEAD - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -======= - -/***/ }), - -/***/ 44695: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(73332); -tslib_1.__exportStar(__nccwpck_require__(75967), exports); -tslib_1.__exportStar(__nccwpck_require__(62110), exports); -tslib_1.__exportStar(__nccwpck_require__(65370), exports); - - -/***/ }), - -/***/ 62110: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSerdePlugin = exports.serializerMiddlewareOption = exports.deserializerMiddlewareOption = void 0; -const deserializerMiddleware_1 = __nccwpck_require__(75967); -const serializerMiddleware_1 = __nccwpck_require__(65370); -exports.deserializerMiddlewareOption = { - name: "deserializerMiddleware", - step: "deserialize", - tags: ["DESERIALIZER"], - override: true, -}; -exports.serializerMiddlewareOption = { - name: "serializerMiddleware", - step: "serialize", - tags: ["SERIALIZER"], - override: true, -}; -function getSerdePlugin(config, serializer, deserializer) { - return { - applyToStack: (commandStack) => { - commandStack.add((0, deserializerMiddleware_1.deserializerMiddleware)(config, deserializer), exports.deserializerMiddlewareOption); - commandStack.add((0, serializerMiddleware_1.serializerMiddleware)(config, serializer), exports.serializerMiddlewareOption); - }, ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - -<<<<<<< HEAD - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; -======= -/***/ 65370: -/***/ ((__unused_webpack_module, exports) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -<<<<<<< HEAD -/***/ 95179: -======= -/***/ 73332: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + toDERHex() { + const sHex = sliceDER(numberToHexUnpadded(this.s)); + const rHex = sliceDER(numberToHexUnpadded(this.r)); + const sHexL = sHex.length / 2; + const rHexL = rHex.length / 2; + const sLen = numberToHexUnpadded(sHexL); + const rLen = numberToHexUnpadded(rHexL); + const length = numberToHexUnpadded(rHexL + sHexL + 4); + return `30${length}02${rLen}${rHex}02${sLen}${sHex}`; } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); + toRawBytes() { + return this.toDERRawBytes(); } - else { - factory(createExporter(root)); + toHex() { + return this.toDERHex(); } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + toCompactRawBytes() { + return hexToBytes(this.toCompactHex()); } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + toCompactHex() { + return numTo32bStr(this.r) + numTo32bStr(this.s); + } +} +exports.Signature = Signature; +function concatBytes(...arrays) { + if (!arrays.every((b) => b instanceof Uint8Array)) + throw new Error('Uint8Array list expected'); + if (arrays.length === 1) + return arrays[0]; + const length = arrays.reduce((a, arr) => a + arr.length, 0); + const result = new Uint8Array(length); + for (let i = 0, pad = 0; i < arrays.length; i++) { + const arr = arrays[i]; + result.set(arr, pad); + pad += arr.length; + } + return result; +} +const hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, '0')); +function bytesToHex(uint8a) { + if (!(uint8a instanceof Uint8Array)) + throw new Error('Expected Uint8Array'); + let hex = ''; + for (let i = 0; i < uint8a.length; i++) { + hex += hexes[uint8a[i]]; + } + return hex; +} +const POW_2_256 = BigInt('0x10000000000000000000000000000000000000000000000000000000000000000'); +function numTo32bStr(num) { + if (typeof num !== 'bigint') + throw new Error('Expected bigint'); + if (!(_0n <= num && num < POW_2_256)) + throw new Error('Expected number 0 <= n < 2^256'); + return num.toString(16).padStart(64, '0'); +} +function numTo32b(num) { + const b = hexToBytes(numTo32bStr(num)); + if (b.length !== 32) + throw new Error('Error: expected 32 bytes'); + return b; +} +function numberToHexUnpadded(num) { + const hex = num.toString(16); + return hex.length & 1 ? `0${hex}` : hex; +} +function hexToNumber(hex) { + if (typeof hex !== 'string') { + throw new TypeError('hexToNumber: expected string, got ' + typeof hex); + } + return BigInt(`0x${hex}`); +} +function hexToBytes(hex) { + if (typeof hex !== 'string') { + throw new TypeError('hexToBytes: expected string, got ' + typeof hex); + } + if (hex.length % 2) + throw new Error('hexToBytes: received invalid unpadded hex' + hex.length); + const array = new Uint8Array(hex.length / 2); + for (let i = 0; i < array.length; i++) { + const j = i * 2; + const hexByte = hex.slice(j, j + 2); + const byte = Number.parseInt(hexByte, 16); + if (Number.isNaN(byte) || byte < 0) + throw new Error('Invalid byte sequence'); + array[i] = byte; + } + return array; +} +function bytesToNumber(bytes) { + return hexToNumber(bytesToHex(bytes)); +} +function ensureBytes(hex) { + return hex instanceof Uint8Array ? Uint8Array.from(hex) : hexToBytes(hex); +} +function normalizeScalar(num) { + if (typeof num === 'number' && Number.isSafeInteger(num) && num > 0) + return BigInt(num); + if (typeof num === 'bigint' && isWithinCurveOrder(num)) + return num; + throw new TypeError('Expected valid private scalar: 0 < scalar < curve.n'); +} +function mod(a, b = CURVE.P) { + const result = a % b; + return result >= _0n ? result : b + result; +} +function pow2(x, power) { + const { P } = CURVE; + let res = x; + while (power-- > _0n) { + res *= res; + res %= P; + } + return res; +} +function sqrtMod(x) { + const { P } = CURVE; + const _6n = BigInt(6); + const _11n = BigInt(11); + const _22n = BigInt(22); + const _23n = BigInt(23); + const _44n = BigInt(44); + const _88n = BigInt(88); + const b2 = (x * x * x) % P; + const b3 = (b2 * b2 * x) % P; + const b6 = (pow2(b3, _3n) * b3) % P; + const b9 = (pow2(b6, _3n) * b3) % P; + const b11 = (pow2(b9, _2n) * b2) % P; + const b22 = (pow2(b11, _11n) * b11) % P; + const b44 = (pow2(b22, _22n) * b22) % P; + const b88 = (pow2(b44, _44n) * b44) % P; + const b176 = (pow2(b88, _88n) * b88) % P; + const b220 = (pow2(b176, _44n) * b44) % P; + const b223 = (pow2(b220, _3n) * b3) % P; + const t1 = (pow2(b223, _23n) * b22) % P; + const t2 = (pow2(t1, _6n) * b2) % P; + const rt = pow2(t2, _2n); + const xc = (rt * rt) % P; + if (xc !== x) + throw new Error('Cannot find square root'); + return rt; +} +function invert(number, modulo = CURVE.P) { + if (number === _0n || modulo <= _0n) { + throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`); + } + let a = mod(number, modulo); + let b = modulo; + let x = _0n, y = _1n, u = _1n, v = _0n; + while (a !== _0n) { + const q = b / a; + const r = b % a; + const m = x - u * q; + const n = y - v * q; + b = a, a = r, x = u, y = v, u = m, v = n; + } + const gcd = b; + if (gcd !== _1n) + throw new Error('invert: does not exist'); + return mod(x, modulo); +} +function invertBatch(nums, p = CURVE.P) { + const scratch = new Array(nums.length); + const lastMultiplied = nums.reduce((acc, num, i) => { + if (num === _0n) + return acc; + scratch[i] = acc; + return mod(acc * num, p); + }, _1n); + const inverted = invert(lastMultiplied, p); + nums.reduceRight((acc, num, i) => { + if (num === _0n) + return acc; + scratch[i] = mod(acc * scratch[i], p); + return mod(acc * num, p); + }, inverted); + return scratch; +} +function bits2int_2(bytes) { + const delta = bytes.length * 8 - groupLen * 8; + const num = bytesToNumber(bytes); + return delta > 0 ? num >> BigInt(delta) : num; +} +function truncateHash(hash, truncateOnly = false) { + const h = bits2int_2(hash); + if (truncateOnly) + return h; + const { n } = CURVE; + return h >= n ? h - n : h; +} +let _sha256Sync; +let _hmacSha256Sync; +class HmacDrbg { + constructor(hashLen, qByteLen) { + this.hashLen = hashLen; + this.qByteLen = qByteLen; + if (typeof hashLen !== 'number' || hashLen < 2) + throw new Error('hashLen must be a number'); + if (typeof qByteLen !== 'number' || qByteLen < 2) + throw new Error('qByteLen must be a number'); + this.v = new Uint8Array(hashLen).fill(1); + this.k = new Uint8Array(hashLen).fill(0); + this.counter = 0; + } + hmac(...values) { + return exports.utils.hmacSha256(this.k, ...values); + } + hmacSync(...values) { + return _hmacSha256Sync(this.k, ...values); + } + checkSync() { + if (typeof _hmacSha256Sync !== 'function') + throw new ShaError('hmacSha256Sync needs to be set'); + } + incr() { + if (this.counter >= 1000) + throw new Error('Tried 1,000 k values for sign(), all were invalid'); + this.counter += 1; + } + async reseed(seed = new Uint8Array()) { + this.k = await this.hmac(this.v, Uint8Array.from([0x00]), seed); + this.v = await this.hmac(this.v); + if (seed.length === 0) + return; + this.k = await this.hmac(this.v, Uint8Array.from([0x01]), seed); + this.v = await this.hmac(this.v); + } + reseedSync(seed = new Uint8Array()) { + this.checkSync(); + this.k = this.hmacSync(this.v, Uint8Array.from([0x00]), seed); + this.v = this.hmacSync(this.v); + if (seed.length === 0) + return; + this.k = this.hmacSync(this.v, Uint8Array.from([0x01]), seed); + this.v = this.hmacSync(this.v); + } + async generate() { + this.incr(); + let len = 0; + const out = []; + while (len < this.qByteLen) { + this.v = await this.hmac(this.v); + const sl = this.v.slice(); + out.push(sl); + len += this.v.length; } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; + return concatBytes(...out); + } + generateSync() { + this.checkSync(); + this.incr(); + let len = 0; + const out = []; + while (len < this.qByteLen) { + this.v = this.hmacSync(this.v); + const sl = this.v.slice(); + out.push(sl); + len += this.v.length; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + return concatBytes(...out); + } +} +function isWithinCurveOrder(num) { + return _0n < num && num < CURVE.n; +} +function isValidFieldElement(num) { + return _0n < num && num < CURVE.P; +} +function kmdToSig(kBytes, m, d, lowS = true) { + const { n } = CURVE; + const k = truncateHash(kBytes, true); + if (!isWithinCurveOrder(k)) + return; + const kinv = invert(k, n); + const q = Point.BASE.multiply(k); + const r = mod(q.x, n); + if (r === _0n) + return; + const s = mod(kinv * mod(m + d * r, n), n); + if (s === _0n) + return; + let sig = new Signature(r, s); + let recovery = (q.x === sig.r ? 0 : 2) | Number(q.y & _1n); + if (lowS && sig.hasHighS()) { + sig = sig.normalizeS(); + recovery ^= 1; + } + return { sig, recovery }; +} +function normalizePrivateKey(key) { + let num; + if (typeof key === 'bigint') { + num = key; + } + else if (typeof key === 'number' && Number.isSafeInteger(key) && key > 0) { + num = BigInt(key); + } + else if (typeof key === 'string') { + if (key.length !== 2 * groupLen) + throw new Error('Expected 32 bytes of private key'); + num = hexToNumber(key); + } + else if (key instanceof Uint8Array) { + if (key.length !== groupLen) + throw new Error('Expected 32 bytes of private key'); + num = bytesToNumber(key); + } + else { + throw new TypeError('Expected valid private key'); + } + if (!isWithinCurveOrder(num)) + throw new Error('Expected private key: 0 < key < n'); + return num; +} +function normalizePublicKey(publicKey) { + if (publicKey instanceof Point) { + publicKey.assertValidity(); + return publicKey; + } + else { + return Point.fromHex(publicKey); + } +} +function normalizeSignature(signature) { + if (signature instanceof Signature) { + signature.assertValidity(); + return signature; + } + try { + return Signature.fromDER(signature); + } + catch (error) { + return Signature.fromCompact(signature); + } +} +function getPublicKey(privateKey, isCompressed = false) { + return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed); +} +exports.getPublicKey = getPublicKey; +function recoverPublicKey(msgHash, signature, recovery, isCompressed = false) { + return Point.fromSignature(msgHash, signature, recovery).toRawBytes(isCompressed); +} +exports.recoverPublicKey = recoverPublicKey; +function isProbPub(item) { + const arr = item instanceof Uint8Array; + const str = typeof item === 'string'; + const len = (arr || str) && item.length; + if (arr) + return len === compressedLen || len === uncompressedLen; + if (str) + return len === compressedLen * 2 || len === uncompressedLen * 2; + if (item instanceof Point) + return true; + return false; +} +function getSharedSecret(privateA, publicB, isCompressed = false) { + if (isProbPub(privateA)) + throw new TypeError('getSharedSecret: first arg must be private key'); + if (!isProbPub(publicB)) + throw new TypeError('getSharedSecret: second arg must be public key'); + const b = normalizePublicKey(publicB); + b.assertValidity(); + return b.multiply(normalizePrivateKey(privateA)).toRawBytes(isCompressed); +} +exports.getSharedSecret = getSharedSecret; +function bits2int(bytes) { + const slice = bytes.length > fieldLen ? bytes.slice(0, fieldLen) : bytes; + return bytesToNumber(slice); +} +function bits2octets(bytes) { + const z1 = bits2int(bytes); + const z2 = mod(z1, CURVE.n); + return int2octets(z2 < _0n ? z1 : z2); +} +function int2octets(num) { + return numTo32b(num); +} +function initSigArgs(msgHash, privateKey, extraEntropy) { + if (msgHash == null) + throw new Error(`sign: expected valid message hash, not "${msgHash}"`); + const h1 = ensureBytes(msgHash); + const d = normalizePrivateKey(privateKey); + const seedArgs = [int2octets(d), bits2octets(h1)]; + if (extraEntropy != null) { + if (extraEntropy === true) + extraEntropy = exports.utils.randomBytes(fieldLen); + const e = ensureBytes(extraEntropy); + if (e.length !== fieldLen) + throw new Error(`sign: Expected ${fieldLen} bytes of extra data`); + seedArgs.push(e); + } + const seed = concatBytes(...seedArgs); + const m = bits2int(h1); + return { seed, m, d }; +} +function finalizeSig(recSig, opts) { + const { sig, recovery } = recSig; + const { der, recovered } = Object.assign({ canonical: true, der: true }, opts); + const hashed = der ? sig.toDERRawBytes() : sig.toCompactRawBytes(); + return recovered ? [hashed, recovery] : hashed; +} +async function sign(msgHash, privKey, opts = {}) { + const { seed, m, d } = initSigArgs(msgHash, privKey, opts.extraEntropy); + const drbg = new HmacDrbg(hashLen, groupLen); + await drbg.reseed(seed); + let sig; + while (!(sig = kmdToSig(await drbg.generate(), m, d, opts.canonical))) + await drbg.reseed(); + return finalizeSig(sig, opts); +} +exports.sign = sign; +function signSync(msgHash, privKey, opts = {}) { + const { seed, m, d } = initSigArgs(msgHash, privKey, opts.extraEntropy); + const drbg = new HmacDrbg(hashLen, groupLen); + drbg.reseedSync(seed); + let sig; + while (!(sig = kmdToSig(drbg.generateSync(), m, d, opts.canonical))) + drbg.reseedSync(); + return finalizeSig(sig, opts); +} +exports.signSync = signSync; +const vopts = { strict: true }; +function verify(signature, msgHash, publicKey, opts = vopts) { + let sig; + try { + sig = normalizeSignature(signature); + msgHash = ensureBytes(msgHash); + } + catch (error) { + return false; + } + const { r, s } = sig; + if (opts.strict && sig.hasHighS()) + return false; + const h = truncateHash(msgHash); + let P; + try { + P = normalizePublicKey(publicKey); + } + catch (error) { + return false; + } + const { n } = CURVE; + const sinv = invert(s, n); + const u1 = mod(h * sinv, n); + const u2 = mod(r * sinv, n); + const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2); + if (!R) + return false; + const v = mod(R.x, n); + return v === r; +} +exports.verify = verify; +function schnorrChallengeFinalize(ch) { + return mod(bytesToNumber(ch), CURVE.n); +} +class SchnorrSignature { + constructor(r, s) { + this.r = r; + this.s = s; + this.assertValidity(); + } + static fromHex(hex) { + const bytes = ensureBytes(hex); + if (bytes.length !== 64) + throw new TypeError(`SchnorrSignature.fromHex: expected 64 bytes, not ${bytes.length}`); + const r = bytesToNumber(bytes.subarray(0, 32)); + const s = bytesToNumber(bytes.subarray(32, 64)); + return new SchnorrSignature(r, s); + } + assertValidity() { + const { r, s } = this; + if (!isValidFieldElement(r) || !isWithinCurveOrder(s)) + throw new Error('Invalid signature'); + } + toHex() { + return numTo32bStr(this.r) + numTo32bStr(this.s); + } + toRawBytes() { + return hexToBytes(this.toHex()); + } +} +function schnorrGetPublicKey(privateKey) { + return Point.fromPrivateKey(privateKey).toRawX(); +} +class InternalSchnorrSignature { + constructor(message, privateKey, auxRand = exports.utils.randomBytes()) { + if (message == null) + throw new TypeError(`sign: Expected valid message, not "${message}"`); + this.m = ensureBytes(message); + const { x, scalar } = this.getScalar(normalizePrivateKey(privateKey)); + this.px = x; + this.d = scalar; + this.rand = ensureBytes(auxRand); + if (this.rand.length !== 32) + throw new TypeError('sign: Expected 32 bytes of aux randomness'); + } + getScalar(priv) { + const point = Point.fromPrivateKey(priv); + const scalar = point.hasEvenY() ? priv : CURVE.n - priv; + return { point, scalar, x: point.toRawX() }; + } + initNonce(d, t0h) { + return numTo32b(d ^ bytesToNumber(t0h)); + } + finalizeNonce(k0h) { + const k0 = mod(bytesToNumber(k0h), CURVE.n); + if (k0 === _0n) + throw new Error('sign: Creation of signature failed. k is zero'); + const { point: R, x: rx, scalar: k } = this.getScalar(k0); + return { R, rx, k }; + } + finalizeSig(R, k, e, d) { + return new SchnorrSignature(R.x, mod(k + e * d, CURVE.n)).toRawBytes(); + } + error() { + throw new Error('sign: Invalid signature produced'); + } + async calc() { + const { m, d, px, rand } = this; + const tag = exports.utils.taggedHash; + const t = this.initNonce(d, await tag(TAGS.aux, rand)); + const { R, rx, k } = this.finalizeNonce(await tag(TAGS.nonce, t, px, m)); + const e = schnorrChallengeFinalize(await tag(TAGS.challenge, rx, px, m)); + const sig = this.finalizeSig(R, k, e, d); + if (!(await schnorrVerify(sig, m, px))) + this.error(); + return sig; + } + calcSync() { + const { m, d, px, rand } = this; + const tag = exports.utils.taggedHashSync; + const t = this.initNonce(d, tag(TAGS.aux, rand)); + const { R, rx, k } = this.finalizeNonce(tag(TAGS.nonce, t, px, m)); + const e = schnorrChallengeFinalize(tag(TAGS.challenge, rx, px, m)); + const sig = this.finalizeSig(R, k, e, d); + if (!schnorrVerifySync(sig, m, px)) + this.error(); + return sig; + } +} +async function schnorrSign(msg, privKey, auxRand) { + return new InternalSchnorrSignature(msg, privKey, auxRand).calc(); +} +function schnorrSignSync(msg, privKey, auxRand) { + return new InternalSchnorrSignature(msg, privKey, auxRand).calcSync(); +} +function initSchnorrVerify(signature, message, publicKey) { + const raw = signature instanceof SchnorrSignature; + const sig = raw ? signature : SchnorrSignature.fromHex(signature); + if (raw) + sig.assertValidity(); + return { + ...sig, + m: ensureBytes(message), + P: normalizePublicKey(publicKey), }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; +} +function finalizeSchnorrVerify(r, P, s, e) { + const R = Point.BASE.multiplyAndAddUnsafe(P, normalizePrivateKey(s), mod(-e, CURVE.n)); + if (!R || !R.hasEvenY() || R.x !== r) + return false; + return true; +} +async function schnorrVerify(signature, message, publicKey) { + try { + const { r, s, m, P } = initSchnorrVerify(signature, message, publicKey); + const e = schnorrChallengeFinalize(await exports.utils.taggedHash(TAGS.challenge, numTo32b(r), P.toRawX(), m)); + return finalizeSchnorrVerify(r, P, s, e); + } + catch (error) { + return false; + } +} +function schnorrVerifySync(signature, message, publicKey) { + try { + const { r, s, m, P } = initSchnorrVerify(signature, message, publicKey); + const e = schnorrChallengeFinalize(exports.utils.taggedHashSync(TAGS.challenge, numTo32b(r), P.toRawX(), m)); + return finalizeSchnorrVerify(r, P, s, e); + } + catch (error) { + if (error instanceof ShaError) + throw error; + return false; + } +} +exports.schnorr = { + Signature: SchnorrSignature, + getPublicKey: schnorrGetPublicKey, + sign: schnorrSign, + verify: schnorrVerify, + signSync: schnorrSignSync, + verifySync: schnorrVerifySync, +}; +Point.BASE._setWindowSize(8); +const crypto = { + node: nodeCrypto, + web: typeof self === 'object' && 'crypto' in self ? self.crypto : undefined, +}; +const TAGS = { + challenge: 'BIP0340/challenge', + aux: 'BIP0340/aux', + nonce: 'BIP0340/nonce', +}; +const TAGGED_HASH_PREFIXES = {}; +exports.utils = { + bytesToHex, + hexToBytes, + concatBytes, + mod, + invert, + isValidPrivateKey(privateKey) { try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + normalizePrivateKey(privateKey); + return true; } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } + catch (error) { + return false; } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } + }, + _bigintTo32Bytes: numTo32b, + _normalizePrivateKey: normalizePrivateKey, + hashToPrivateKey: (hash) => { + hash = ensureBytes(hash); + const minLen = groupLen + 8; + if (hash.length < minLen || hash.length > 1024) { + throw new Error(`Expected valid bytes of private key as per FIPS 186`); } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; + const num = mod(bytesToNumber(hash), CURVE.n - _1n) + _1n; + return numTo32b(num); + }, + randomBytes: (bytesLength = 32) => { + if (crypto.web) { + return crypto.web.getRandomValues(new Uint8Array(bytesLength)); + } + else if (crypto.node) { + const { randomBytes } = crypto.node; + return Uint8Array.from(randomBytes(bytesLength)); + } + else { + throw new Error("The environment doesn't have randomBytes function"); + } + }, + randomPrivateKey: () => exports.utils.hashToPrivateKey(exports.utils.randomBytes(groupLen + 8)), + precompute(windowSize = 8, point = Point.BASE) { + const cached = point === Point.BASE ? point : new Point(point.x, point.y); + cached._setWindowSize(windowSize); + cached.multiply(_3n); + return cached; + }, + sha256: async (...messages) => { + if (crypto.web) { + const buffer = await crypto.web.subtle.digest('SHA-256', concatBytes(...messages)); + return new Uint8Array(buffer); + } + else if (crypto.node) { + const { createHash } = crypto.node; + const hash = createHash('sha256'); + messages.forEach((m) => hash.update(m)); + return Uint8Array.from(hash.digest()); + } + else { + throw new Error("The environment doesn't have sha256 function"); + } + }, + hmacSha256: async (key, ...messages) => { + if (crypto.web) { + const ckey = await crypto.web.subtle.importKey('raw', key, { name: 'HMAC', hash: { name: 'SHA-256' } }, false, ['sign']); + const message = concatBytes(...messages); + const buffer = await crypto.web.subtle.sign('HMAC', ckey, message); + return new Uint8Array(buffer); + } + else if (crypto.node) { + const { createHmac } = crypto.node; + const hash = createHmac('sha256', key); + messages.forEach((m) => hash.update(m)); + return Uint8Array.from(hash.digest()); + } + else { + throw new Error("The environment doesn't have hmac-sha256 function"); + } + }, + sha256Sync: undefined, + hmacSha256Sync: undefined, + taggedHash: async (tag, ...messages) => { + let tagP = TAGGED_HASH_PREFIXES[tag]; + if (tagP === undefined) { + const tagH = await exports.utils.sha256(Uint8Array.from(tag, (c) => c.charCodeAt(0))); + tagP = concatBytes(tagH, tagH); + TAGGED_HASH_PREFIXES[tag] = tagP; + } + return exports.utils.sha256(tagP, ...messages); + }, + taggedHashSync: (tag, ...messages) => { + if (typeof _sha256Sync !== 'function') + throw new ShaError('sha256Sync is undefined, you need to set it'); + let tagP = TAGGED_HASH_PREFIXES[tag]; + if (tagP === undefined) { + const tagH = _sha256Sync(Uint8Array.from(tag, (c) => c.charCodeAt(0))); + tagP = concatBytes(tagH, tagH); + TAGGED_HASH_PREFIXES[tag] = tagP; + } + return _sha256Sync(tagP, ...messages); + }, + _JacobianPoint: JacobianPoint, +}; +Object.defineProperties(exports.utils, { + sha256Sync: { + configurable: false, + get() { + return _sha256Sync; + }, + set(val) { + if (!_sha256Sync) + _sha256Sync = val; + }, + }, + hmacSha256Sync: { + configurable: false, + get() { + return _hmacSha256Sync; + }, + set(val) { + if (!_hmacSha256Sync) + _hmacSha256Sync = val; + }, + }, +}); - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; +/***/ }), - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; +/***/ 89065: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); +// pkg/dist-src/index.js +var dist_src_exports = {}; +__export(dist_src_exports, { + GraphqlResponseError: () => GraphqlResponseError, + graphql: () => graphql2, + withCustomRequest: () => withCustomRequest }); +module.exports = __toCommonJS(dist_src_exports); +var import_request3 = __nccwpck_require__(18291); +var import_universal_user_agent = __nccwpck_require__(89637); +// pkg/dist-src/version.js +var VERSION = "7.0.2"; -/***/ }), +// pkg/dist-src/with-defaults.js +var import_request2 = __nccwpck_require__(18291); -/***/ 24276: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// pkg/dist-src/graphql.js +var import_request = __nccwpck_require__(18291); +// pkg/dist-src/error.js +function _buildMessageForResponseErrors(data) { + return `Request failed due to following response errors: +` + data.errors.map((e) => ` - ${e.message}`).join("\n"); +} +var GraphqlResponseError = class extends Error { + constructor(request2, headers, response) { + super(_buildMessageForResponseErrors(response)); + this.request = request2; + this.headers = headers; + this.response = response; + this.name = "GraphqlResponseError"; + this.errors = response.errors; + this.data = response.data; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + } +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveSigV4AuthConfig = exports.resolveAwsAuthConfig = void 0; -<<<<<<< HEAD -const property_provider_1 = __nccwpck_require__(12955); -const signature_v4_1 = __nccwpck_require__(91116); -const util_middleware_1 = __nccwpck_require__(81243); -======= -const property_provider_1 = __nccwpck_require__(68655); -const signature_v4_1 = __nccwpck_require__(30849); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const CREDENTIAL_EXPIRE_WINDOW = 300000; -const resolveAwsAuthConfig = (input) => { - const normalizedCreds = input.credentials - ? normalizeCredentialProvider(input.credentials) - : input.credentialDefaultProvider(input); - const { signingEscapePath = true, systemClockOffset = input.systemClockOffset || 0, sha256 } = input; - let signer; - if (input.signer) { - signer = (0, util_middleware_1.normalizeProvider)(input.signer); +// pkg/dist-src/graphql.js +var NON_VARIABLE_OPTIONS = [ + "method", + "baseUrl", + "url", + "headers", + "request", + "query", + "mediaType" +]; +var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"]; +var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; +function graphql(request2, query, options) { + if (options) { + if (typeof query === "string" && "query" in options) { + return Promise.reject( + new Error(`[@octokit/graphql] "query" cannot be used as variable name`) + ); } - else if (input.regionInfoProvider) { - signer = () => (0, util_middleware_1.normalizeProvider)(input.region)() - .then(async (region) => [ - (await input.regionInfoProvider(region, { - useFipsEndpoint: await input.useFipsEndpoint(), - useDualstackEndpoint: await input.useDualstackEndpoint(), - })) || {}, - region, - ]) - .then(([regionInfo, region]) => { - const { signingRegion, signingService } = regionInfo; - input.signingRegion = input.signingRegion || signingRegion || region; - input.signingName = input.signingName || signingService || input.serviceId; - const params = { - ...input, - credentials: normalizedCreds, - region: input.signingRegion, - service: input.signingName, - sha256, - uriEscapePath: signingEscapePath, - }; - const SignerCtor = input.signerConstructor || signature_v4_1.SignatureV4; - return new SignerCtor(params); - }); + for (const key in options) { + if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) + continue; + return Promise.reject( + new Error( + `[@octokit/graphql] "${key}" cannot be used as variable name` + ) + ); } - else { - signer = async (authScheme) => { - authScheme = Object.assign({}, { - name: "sigv4", - signingName: input.signingName || input.defaultSigningName, - signingRegion: await (0, util_middleware_1.normalizeProvider)(input.region)(), - properties: {}, - }, authScheme); - const signingRegion = authScheme.signingRegion; - const signingService = authScheme.signingName; - input.signingRegion = input.signingRegion || signingRegion; - input.signingName = input.signingName || signingService || input.serviceId; - const params = { - ...input, - credentials: normalizedCreds, - region: input.signingRegion, - service: input.signingName, - sha256, - uriEscapePath: signingEscapePath, - }; - const SignerCtor = input.signerConstructor || signature_v4_1.SignatureV4; - return new SignerCtor(params); - }; - } - return { - ...input, - systemClockOffset, - signingEscapePath, - credentials: normalizedCreds, - signer, - }; -}; -exports.resolveAwsAuthConfig = resolveAwsAuthConfig; -const resolveSigV4AuthConfig = (input) => { - const normalizedCreds = input.credentials - ? normalizeCredentialProvider(input.credentials) - : input.credentialDefaultProvider(input); - const { signingEscapePath = true, systemClockOffset = input.systemClockOffset || 0, sha256 } = input; - let signer; - if (input.signer) { - signer = (0, util_middleware_1.normalizeProvider)(input.signer); + } + const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query; + const requestOptions = Object.keys( + parsedOptions + ).reduce((result, key) => { + if (NON_VARIABLE_OPTIONS.includes(key)) { + result[key] = parsedOptions[key]; + return result; } - else { - signer = (0, util_middleware_1.normalizeProvider)(new signature_v4_1.SignatureV4({ - credentials: normalizedCreds, - region: input.region, - service: input.signingName, - sha256, - uriEscapePath: signingEscapePath, - })); + if (!result.variables) { + result.variables = {}; } - return { - ...input, - systemClockOffset, - signingEscapePath, - credentials: normalizedCreds, - signer, - }; -}; -exports.resolveSigV4AuthConfig = resolveSigV4AuthConfig; -const normalizeCredentialProvider = (credentials) => { - if (typeof credentials === "function") { - return (0, property_provider_1.memoize)(credentials, (credentials) => credentials.expiration !== undefined && - credentials.expiration.getTime() - Date.now() < CREDENTIAL_EXPIRE_WINDOW, (credentials) => credentials.expiration !== undefined); + result.variables[key] = parsedOptions[key]; + return result; + }, {}); + const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl; + if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) { + requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); + } + return request2(requestOptions).then((response) => { + if (response.data.errors) { + const headers = {}; + for (const key of Object.keys(response.headers)) { + headers[key] = response.headers[key]; + } + throw new GraphqlResponseError( + requestOptions, + headers, + response.data + ); } - return (0, util_middleware_1.normalizeProvider)(credentials); -}; + return response.data.data; + }); +} + +// pkg/dist-src/with-defaults.js +function withDefaults(request2, newDefaults) { + const newRequest = request2.defaults(newDefaults); + const newApi = (query, options) => { + return graphql(newRequest, query, options); + }; + return Object.assign(newApi, { + defaults: withDefaults.bind(null, newRequest), + endpoint: newRequest.endpoint + }); +} + +// pkg/dist-src/index.js +var graphql2 = withDefaults(import_request3.request, { + headers: { + "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}` + }, + method: "POST", + url: "/graphql" +}); +function withCustomRequest(customRequest) { + return withDefaults(customRequest, { + method: "POST", + url: "/graphql" + }); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (0); /***/ }), -<<<<<<< HEAD -/***/ 60044: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 99228: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSigV4AuthPlugin = exports.getAwsAuthPlugin = exports.awsAuthMiddlewareOptions = exports.awsAuthMiddleware = void 0; -const protocol_http_1 = __nccwpck_require__(45311); -const getSkewCorrectedDate_1 = __nccwpck_require__(8095); -const getUpdatedSystemClockOffset_1 = __nccwpck_require__(52474); -======= -/***/ 33233: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -"use strict"; +// pkg/dist-src/index.js +var dist_src_exports = {}; +__export(dist_src_exports, { + endpoint: () => endpoint +}); +module.exports = __toCommonJS(dist_src_exports); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(15406); -tslib_1.__exportStar(__nccwpck_require__(24276), exports); -tslib_1.__exportStar(__nccwpck_require__(43678), exports); +// pkg/dist-src/defaults.js +var import_universal_user_agent = __nccwpck_require__(89637); +// pkg/dist-src/version.js +var VERSION = "9.0.4"; -/***/ }), +// pkg/dist-src/defaults.js +var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`; +var DEFAULTS = { + method: "GET", + baseUrl: "https://api.github.com", + headers: { + accept: "application/vnd.github.v3+json", + "user-agent": userAgent + }, + mediaType: { + format: "" + } +}; -/***/ 43678: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// pkg/dist-src/util/lowercase-keys.js +function lowercaseKeys(object) { + if (!object) { + return {}; + } + return Object.keys(object).reduce((newObj, key) => { + newObj[key.toLowerCase()] = object[key]; + return newObj; + }, {}); +} -"use strict"; +// pkg/dist-src/util/is-plain-object.js +function isPlainObject(value) { + if (typeof value !== "object" || value === null) + return false; + if (Object.prototype.toString.call(value) !== "[object Object]") + return false; + const proto = Object.getPrototypeOf(value); + if (proto === null) + return true; + const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor; + return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSigV4AuthPlugin = exports.getAwsAuthPlugin = exports.awsAuthMiddlewareOptions = exports.awsAuthMiddleware = void 0; -const protocol_http_1 = __nccwpck_require__(35712); -const getSkewCorrectedDate_1 = __nccwpck_require__(14274); -const getUpdatedSystemClockOffset_1 = __nccwpck_require__(26354); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const awsAuthMiddleware = (options) => (next, context) => async function (args) { - var _a, _b, _c, _d; - if (!protocol_http_1.HttpRequest.isInstance(args.request)) - return next(args); - const authScheme = (_c = (_b = (_a = context.endpointV2) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.authSchemes) === null || _c === void 0 ? void 0 : _c[0]; - const multiRegionOverride = (authScheme === null || authScheme === void 0 ? void 0 : authScheme.name) === "sigv4a" ? (_d = authScheme === null || authScheme === void 0 ? void 0 : authScheme.signingRegionSet) === null || _d === void 0 ? void 0 : _d.join(",") : undefined; - const signer = await options.signer(authScheme); - let signedRequest; - const signingOptions = { - signingDate: (0, getSkewCorrectedDate_1.getSkewCorrectedDate)(options.systemClockOffset), - signingRegion: multiRegionOverride || context["signing_region"], - signingService: context["signing_service"], - }; - if (context.s3ExpressIdentity) { - const sigV4MultiRegion = signer; - signedRequest = await sigV4MultiRegion.signWithCredentials(args.request, context.s3ExpressIdentity, signingOptions); - if (signedRequest.headers["X-Amz-Security-Token"] || signedRequest.headers["x-amz-security-token"]) { - throw new Error("X-Amz-Security-Token must not be set for s3-express requests."); - } - } - else { - signedRequest = await signer.sign(args.request, signingOptions); - } - const output = await next({ - ...args, - request: signedRequest, - }).catch((error) => { - var _a; - const serverTime = (_a = error.ServerTime) !== null && _a !== void 0 ? _a : getDateHeader(error.$response); - if (serverTime) { - options.systemClockOffset = (0, getUpdatedSystemClockOffset_1.getUpdatedSystemClockOffset)(serverTime, options.systemClockOffset); - } - throw error; - }); - const dateHeader = getDateHeader(output.response); - if (dateHeader) { - options.systemClockOffset = (0, getUpdatedSystemClockOffset_1.getUpdatedSystemClockOffset)(dateHeader, options.systemClockOffset); +// pkg/dist-src/util/merge-deep.js +function mergeDeep(defaults, options) { + const result = Object.assign({}, defaults); + Object.keys(options).forEach((key) => { + if (isPlainObject(options[key])) { + if (!(key in defaults)) + Object.assign(result, { [key]: options[key] }); + else + result[key] = mergeDeep(defaults[key], options[key]); + } else { + Object.assign(result, { [key]: options[key] }); } - return output; -}; -exports.awsAuthMiddleware = awsAuthMiddleware; -const getDateHeader = (response) => { var _a, _b, _c; return protocol_http_1.HttpResponse.isInstance(response) ? (_b = (_a = response.headers) === null || _a === void 0 ? void 0 : _a.date) !== null && _b !== void 0 ? _b : (_c = response.headers) === null || _c === void 0 ? void 0 : _c.Date : undefined; }; -exports.awsAuthMiddlewareOptions = { - name: "awsAuthMiddleware", - tags: ["SIGNATURE", "AWSAUTH"], - relation: "after", - toMiddleware: "retryMiddleware", - override: true, -}; -const getAwsAuthPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo((0, exports.awsAuthMiddleware)(options), exports.awsAuthMiddlewareOptions); - }, -}); -exports.getAwsAuthPlugin = getAwsAuthPlugin; -exports.getSigV4AuthPlugin = exports.getAwsAuthPlugin; + }); + return result; +} +// pkg/dist-src/util/remove-undefined-properties.js +function removeUndefinedProperties(obj) { + for (const key in obj) { + if (obj[key] === void 0) { + delete obj[key]; + } + } + return obj; +} -/***/ }), +// pkg/dist-src/merge.js +function merge(defaults, route, options) { + if (typeof route === "string") { + let [method, url] = route.split(" "); + options = Object.assign(url ? { method, url } : { url: method }, options); + } else { + options = Object.assign({}, route); + } + options.headers = lowercaseKeys(options.headers); + removeUndefinedProperties(options); + removeUndefinedProperties(options.headers); + const mergedOptions = mergeDeep(defaults || {}, options); + if (options.url === "/graphql") { + if (defaults && defaults.mediaType.previews?.length) { + mergedOptions.mediaType.previews = defaults.mediaType.previews.filter( + (preview) => !mergedOptions.mediaType.previews.includes(preview) + ).concat(mergedOptions.mediaType.previews); + } + mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, "")); + } + return mergedOptions; +} -<<<<<<< HEAD -/***/ 25050: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// pkg/dist-src/util/add-query-parameters.js +function addQueryParameters(url, parameters) { + const separator = /\?/.test(url) ? "&" : "?"; + const names = Object.keys(parameters); + if (names.length === 0) { + return url; + } + return url + separator + names.map((name) => { + if (name === "q") { + return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); + } + return `${name}=${encodeURIComponent(parameters[name])}`; + }).join("&"); +} +// pkg/dist-src/util/extract-url-variable-names.js +var urlVariableRegex = /\{[^}]+\}/g; +function removeNonChars(variableName) { + return variableName.replace(/^\W+|\W+$/g, "").split(/,/); +} +function extractUrlVariableNames(url) { + const matches = url.match(urlVariableRegex); + if (!matches) { + return []; + } + return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(7430); -tslib_1.__exportStar(__nccwpck_require__(95179), exports); -tslib_1.__exportStar(__nccwpck_require__(60044), exports); +// pkg/dist-src/util/omit.js +function omit(object, keysToOmit) { + const result = { __proto__: null }; + for (const key of Object.keys(object)) { + if (keysToOmit.indexOf(key) === -1) { + result[key] = object[key]; + } + } + return result; +} +// pkg/dist-src/util/url-template.js +function encodeReserved(str) { + return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) { + if (!/%[0-9A-Fa-f]/.test(part)) { + part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]"); + } + return part; + }).join(""); +} +function encodeUnreserved(str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function(c) { + return "%" + c.charCodeAt(0).toString(16).toUpperCase(); + }); +} +function encodeValue(operator, value, key) { + value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value); + if (key) { + return encodeUnreserved(key) + "=" + value; + } else { + return value; + } +} +function isDefined(value) { + return value !== void 0 && value !== null; +} +function isKeyOperator(operator) { + return operator === ";" || operator === "&" || operator === "?"; +} +function getValues(context, operator, key, modifier) { + var value = context[key], result = []; + if (isDefined(value) && value !== "") { + if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { + value = value.toString(); + if (modifier && modifier !== "*") { + value = value.substring(0, parseInt(modifier, 10)); + } + result.push( + encodeValue(operator, value, isKeyOperator(operator) ? key : "") + ); + } else { + if (modifier === "*") { + if (Array.isArray(value)) { + value.filter(isDefined).forEach(function(value2) { + result.push( + encodeValue(operator, value2, isKeyOperator(operator) ? key : "") + ); + }); + } else { + Object.keys(value).forEach(function(k) { + if (isDefined(value[k])) { + result.push(encodeValue(operator, value[k], k)); + } + }); + } + } else { + const tmp = []; + if (Array.isArray(value)) { + value.filter(isDefined).forEach(function(value2) { + tmp.push(encodeValue(operator, value2)); + }); + } else { + Object.keys(value).forEach(function(k) { + if (isDefined(value[k])) { + tmp.push(encodeUnreserved(k)); + tmp.push(encodeValue(operator, value[k].toString())); + } + }); + } + if (isKeyOperator(operator)) { + result.push(encodeUnreserved(key) + "=" + tmp.join(",")); + } else if (tmp.length !== 0) { + result.push(tmp.join(",")); + } + } + } + } else { + if (operator === ";") { + if (isDefined(value)) { + result.push(encodeUnreserved(key)); + } + } else if (value === "" && (operator === "&" || operator === "?")) { + result.push(encodeUnreserved(key) + "="); + } else if (value === "") { + result.push(""); + } + } + return result; +} +function parseUrl(template) { + return { + expand: expand.bind(null, template) + }; +} +function expand(template, context) { + var operators = ["+", "#", ".", "/", ";", "?", "&"]; + template = template.replace( + /\{([^\{\}]+)\}|([^\{\}]+)/g, + function(_, expression, literal) { + if (expression) { + let operator = ""; + const values = []; + if (operators.indexOf(expression.charAt(0)) !== -1) { + operator = expression.charAt(0); + expression = expression.substr(1); + } + expression.split(/,/g).forEach(function(variable) { + var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); + values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3])); + }); + if (operator && operator !== "+") { + var separator = ","; + if (operator === "?") { + separator = "&"; + } else if (operator !== "#") { + separator = operator; + } + return (values.length !== 0 ? operator : "") + values.join(separator); + } else { + return values.join(","); + } + } else { + return encodeReserved(literal); + } + } + ); + if (template === "/") { + return template; + } else { + return template.replace(/\/$/, ""); + } +} -/***/ }), +// pkg/dist-src/parse.js +function parse(options) { + let method = options.method.toUpperCase(); + let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); + let headers = Object.assign({}, options.headers); + let body; + let parameters = omit(options, [ + "method", + "baseUrl", + "url", + "headers", + "request", + "mediaType" + ]); + const urlVariableNames = extractUrlVariableNames(url); + url = parseUrl(url).expand(parameters); + if (!/^http/.test(url)) { + url = options.baseUrl + url; + } + const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl"); + const remainingParameters = omit(parameters, omittedParameters); + const isBinaryRequest = /application\/octet-stream/i.test(headers.accept); + if (!isBinaryRequest) { + if (options.mediaType.format) { + headers.accept = headers.accept.split(/,/).map( + (format) => format.replace( + /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, + `application/vnd$1$2.${options.mediaType.format}` + ) + ).join(","); + } + if (url.endsWith("/graphql")) { + if (options.mediaType.previews?.length) { + const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || []; + headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => { + const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; + return `application/vnd.github.${preview}-preview${format}`; + }).join(","); + } + } + } + if (["GET", "HEAD"].includes(method)) { + url = addQueryParameters(url, remainingParameters); + } else { + if ("data" in remainingParameters) { + body = remainingParameters.data; + } else { + if (Object.keys(remainingParameters).length) { + body = remainingParameters; + } + } + } + if (!headers["content-type"] && typeof body !== "undefined") { + headers["content-type"] = "application/json; charset=utf-8"; + } + if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { + body = ""; + } + return Object.assign( + { method, url, headers }, + typeof body !== "undefined" ? { body } : null, + options.request ? { request: options.request } : null + ); +} -/***/ 8095: -======= -/***/ 14274: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { +// pkg/dist-src/endpoint-with-defaults.js +function endpointWithDefaults(defaults, route, options) { + return parse(merge(defaults, route, options)); +} +// pkg/dist-src/with-defaults.js +function withDefaults(oldDefaults, newDefaults) { + const DEFAULTS2 = merge(oldDefaults, newDefaults); + const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2); + return Object.assign(endpoint2, { + DEFAULTS: DEFAULTS2, + defaults: withDefaults.bind(null, DEFAULTS2), + merge: merge.bind(null, DEFAULTS2), + parse + }); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSkewCorrectedDate = void 0; -const getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset); -exports.getSkewCorrectedDate = getSkewCorrectedDate; +// pkg/dist-src/index.js +var endpoint = withDefaults(null, DEFAULTS); +// Annotate the CommonJS export names for ESM import in node: +0 && (0); /***/ }), -<<<<<<< HEAD -/***/ 52474: -======= -/***/ 26354: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 28311: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getUpdatedSystemClockOffset = void 0; -<<<<<<< HEAD -const isClockSkewed_1 = __nccwpck_require__(22984); -======= -const isClockSkewed_1 = __nccwpck_require__(38373); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => { - const clockTimeInMs = Date.parse(clockTime); - if ((0, isClockSkewed_1.isClockSkewed)(clockTimeInMs, currentSystemClockOffset)) { - return clockTimeInMs - Date.now(); +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// pkg/dist-src/index.js +var dist_src_exports = {}; +__export(dist_src_exports, { + RequestError: () => RequestError +}); +module.exports = __toCommonJS(dist_src_exports); +var import_deprecation = __nccwpck_require__(45862); +var import_once = __toESM(__nccwpck_require__(79816)); +var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation)); +var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation)); +var RequestError = class extends Error { + constructor(message, statusCode, options) { + super(message); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); } - return currentSystemClockOffset; + this.name = "HttpError"; + this.status = statusCode; + let headers; + if ("headers" in options && typeof options.headers !== "undefined") { + headers = options.headers; + } + if ("response" in options) { + this.response = options.response; + headers = options.response.headers; + } + const requestCopy = Object.assign({}, options.request); + if (options.request.headers.authorization) { + requestCopy.headers = Object.assign({}, options.request.headers, { + authorization: options.request.headers.authorization.replace( + / .*$/, + " [REDACTED]" + ) + }); + } + requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"); + this.request = requestCopy; + Object.defineProperty(this, "code", { + get() { + logOnceCode( + new import_deprecation.Deprecation( + "[@octokit/request-error] `error.code` is deprecated, use `error.status`." + ) + ); + return statusCode; + } + }); + Object.defineProperty(this, "headers", { + get() { + logOnceHeaders( + new import_deprecation.Deprecation( + "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`." + ) + ); + return headers || {}; + } + }); + } }; -exports.getUpdatedSystemClockOffset = getUpdatedSystemClockOffset; +// Annotate the CommonJS export names for ESM import in node: +0 && (0); /***/ }), -<<<<<<< HEAD -/***/ 22984: -======= -/***/ 38373: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 18291: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isClockSkewed = void 0; -<<<<<<< HEAD -const getSkewCorrectedDate_1 = __nccwpck_require__(8095); -======= -const getSkewCorrectedDate_1 = __nccwpck_require__(14274); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const isClockSkewed = (clockTime, systemClockOffset) => Math.abs((0, getSkewCorrectedDate_1.getSkewCorrectedDate)(systemClockOffset).getTime() - clockTime) >= 300000; -exports.isClockSkewed = isClockSkewed; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +// pkg/dist-src/index.js +var dist_src_exports = {}; +__export(dist_src_exports, { + request: () => request +}); +module.exports = __toCommonJS(dist_src_exports); +var import_endpoint = __nccwpck_require__(99228); +var import_universal_user_agent = __nccwpck_require__(89637); -/***/ }), +// pkg/dist-src/version.js +var VERSION = "8.1.6"; -<<<<<<< HEAD -/***/ 7430: -======= -/***/ 15406: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { +// pkg/dist-src/is-plain-object.js +function isPlainObject(value) { + if (typeof value !== "object" || value === null) + return false; + if (Object.prototype.toString.call(value) !== "[object Object]") + return false; + const proto = Object.getPrototypeOf(value); + if (proto === null) + return true; + const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor; + return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value); +} -/****************************************************************************** -Copyright (c) Microsoft Corporation. +// pkg/dist-src/fetch-wrapper.js +var import_request_error = __nccwpck_require__(28311); -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. +// pkg/dist-src/get-buffer-response.js +function getBufferResponse(response) { + return response.arrayBuffer(); +} -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); +// pkg/dist-src/fetch-wrapper.js +function fetchWrapper(requestOptions) { + var _a, _b, _c; + const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; + const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false; + if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { + requestOptions.body = JSON.stringify(requestOptions.body); + } + let headers = {}; + let status; + let url; + let { fetch } = globalThis; + if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) { + fetch = requestOptions.request.fetch; + } + if (!fetch) { + throw new Error( + "fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing" + ); + } + return fetch(requestOptions.url, { + method: requestOptions.method, + body: requestOptions.body, + headers: requestOptions.headers, + signal: (_c = requestOptions.request) == null ? void 0 : _c.signal, + // duplex must be set if request.body is ReadableStream or Async Iterables. + // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex. + ...requestOptions.body && { duplex: "half" } + }).then(async (response) => { + url = response.url; + status = response.status; + for (const keyAndValue of response.headers) { + headers[keyAndValue[0]] = keyAndValue[1]; } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); + if ("deprecation" in headers) { + const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/); + const deprecationLink = matches && matches.pop(); + log.warn( + `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}` + ); } - else { - factory(createExporter(root)); + if (status === 204 || status === 205) { + return; } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + if (requestOptions.method === "HEAD") { + if (status < 400) { + return; + } + throw new import_request_error.RequestError(response.statusText, status, { + response: { + url, + status, + headers, + data: void 0 + }, + request: requestOptions + }); } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; + if (status === 304) { + throw new import_request_error.RequestError("Not modified", status, { + response: { + url, + status, + headers, + data: await getResponseData(response) + }, + request: requestOptions + }); + } + if (status >= 400) { + const data = await getResponseData(response); + const error = new import_request_error.RequestError(toErrorMessage(data), status, { + response: { + url, + status, + headers, + data + }, + request: requestOptions + }); + throw error; + } + return parseSuccessResponseBody ? await getResponseData(response) : response.body; + }).then((data) => { + return { + status, + url, + headers, + data }; + }).catch((error) => { + if (error instanceof import_request_error.RequestError) + throw error; + else if (error.name === "AbortError") + throw error; + let message = error.message; + if (error.name === "TypeError" && "cause" in error) { + if (error.cause instanceof Error) { + message = error.cause.message; + } else if (typeof error.cause === "string") { + message = error.cause; + } + } + throw new import_request_error.RequestError(message, 500, { + request: requestOptions + }); + }); +} +async function getResponseData(response) { + const contentType = response.headers.get("content-type"); + if (/application\/json/.test(contentType)) { + return response.json().catch(() => response.text()).catch(() => ""); + } + if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { + return response.text(); + } + return getBufferResponse(response); +} +function toErrorMessage(data) { + if (typeof data === "string") + return data; + if ("message" in data) { + if (Array.isArray(data.errors)) { + return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`; + } + return data.message; + } + return `Unknown error: ${JSON.stringify(data)}`; +} - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; +// pkg/dist-src/with-defaults.js +function withDefaults(oldEndpoint, newDefaults) { + const endpoint2 = oldEndpoint.defaults(newDefaults); + const newApi = function(route, parameters) { + const endpointOptions = endpoint2.merge(route, parameters); + if (!endpointOptions.request || !endpointOptions.request.hook) { + return fetchWrapper(endpoint2.parse(endpointOptions)); + } + const request2 = (route2, parameters2) => { + return fetchWrapper( + endpoint2.parse(endpoint2.merge(route2, parameters2)) + ); }; + Object.assign(request2, { + endpoint: endpoint2, + defaults: withDefaults.bind(null, endpoint2) + }); + return endpointOptions.request.hook(request2, endpointOptions); + }; + return Object.assign(newApi, { + endpoint: endpoint2, + defaults: withDefaults.bind(null, endpoint2) + }); +} - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; +// pkg/dist-src/index.js +var request = withDefaults(import_endpoint.endpoint, { + headers: { + "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}` + } +}); +// Annotate the CommonJS export names for ESM import in node: +0 && (0); - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; +/***/ }), - __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()); - }); - }; +/***/ 56402: +/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) { - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; +(function webpackUniversalModuleDefinition(root, factory) { + if(true) + module.exports = factory(); + else {} +})(typeof self !== 'undefined' ? self : this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __nested_webpack_require_594__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_594__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nested_webpack_require_594__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __nested_webpack_require_594__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __nested_webpack_require_594__.d = function(exports, name, getter) { +/******/ if(!__nested_webpack_require_594__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __nested_webpack_require_594__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __nested_webpack_require_594__.t = function(value, mode) { +/******/ if(mode & 1) value = __nested_webpack_require_594__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __nested_webpack_require_594__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_594__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nested_webpack_require_594__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __nested_webpack_require_594__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __nested_webpack_require_594__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __nested_webpack_require_594__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __nested_webpack_require_594__(__nested_webpack_require_594__.s = 0); +/******/ }) +/************************************************************************/ +/******/ ({ - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +/***/ "./node_modules/asynckit/index.js": +/*!****************************************!*\ + !*** ./node_modules/asynckit/index.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_4261__) { - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +module.exports = +{ + parallel : __nested_webpack_require_4261__(/*! ./parallel.js */ "./node_modules/asynckit/parallel.js"), + serial : __nested_webpack_require_4261__(/*! ./serial.js */ "./node_modules/asynckit/serial.js"), + serialOrdered : __nested_webpack_require_4261__(/*! ./serialOrdered.js */ "./node_modules/asynckit/serialOrdered.js") +}; - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; +/***/ }), - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +/***/ "./node_modules/asynckit/lib/abort.js": +/*!********************************************!*\ + !*** ./node_modules/asynckit/lib/abort.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +// API +module.exports = abort; - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; +/** + * Aborts leftover active jobs + * + * @param {object} state - current state object + */ +function abort(state) +{ + Object.keys(state.jobs).forEach(clean.bind(state)); - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; + // reset leftover jobs + state.jobs = {}; +} - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +/** + * Cleans up leftover job by invoking abort function for the provided job id + * + * @this state + * @param {string|number} key - job id to abort + */ +function clean(key) +{ + if (typeof this.jobs[key] == 'function') + { + this.jobs[key](); + } +} - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; +/***/ }), - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +/***/ "./node_modules/asynckit/lib/async.js": +/*!********************************************!*\ + !*** ./node_modules/asynckit/lib/async.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_5653__) { - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; +var defer = __nested_webpack_require_5653__(/*! ./defer.js */ "./node_modules/asynckit/lib/defer.js"); - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +// API +module.exports = async; - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; +/** + * Runs provided callback asynchronously + * even if callback itself is not + * + * @param {function} callback - callback to invoke + * @returns {function} - augmented callback + */ +function async(callback) +{ + var isAsync = false; - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; + // check if async happened + defer(function() { isAsync = true; }); - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; + return function async_callback(err, result) + { + if (isAsync) + { + callback(err, result); + } + else + { + defer(function nextTick_callback() + { + callback(err, result); + }); + } + }; +} - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; +/***/ }), - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; +/***/ "./node_modules/asynckit/lib/defer.js": +/*!********************************************!*\ + !*** ./node_modules/asynckit/lib/defer.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; +module.exports = defer; - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); +/** + * Runs provided function on next iteration of the event loop + * + * @param {function} fn - function to run + */ +function defer(fn) +{ + var nextTick = typeof setImmediate == 'function' + ? setImmediate + : ( + typeof process == 'object' && typeof process.nextTick == 'function' + ? process.nextTick + : null + ); + + if (nextTick) + { + nextTick(fn); + } + else + { + setTimeout(fn, 0); + } +} /***/ }), -<<<<<<< HEAD -/***/ 33563: -======= -/***/ 58483: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/asynckit/lib/iterate.js": +/*!**********************************************!*\ + !*** ./node_modules/asynckit/lib/iterate.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_7328__) { +var async = __nested_webpack_require_7328__(/*! ./async.js */ "./node_modules/asynckit/lib/async.js") + , abort = __nested_webpack_require_7328__(/*! ./abort.js */ "./node_modules/asynckit/lib/abort.js") + ; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSsecPlugin = exports.ssecMiddlewareOptions = exports.ssecMiddleware = void 0; -function ssecMiddleware(options) { - return (next) => async (args) => { - let input = { ...args.input }; - const properties = [ - { - target: "SSECustomerKey", - hash: "SSECustomerKeyMD5", - }, - { - target: "CopySourceSSECustomerKey", - hash: "CopySourceSSECustomerKeyMD5", - }, - ]; - for (const prop of properties) { - const value = input[prop.target]; - if (value) { - const valueView = ArrayBuffer.isView(value) - ? new Uint8Array(value.buffer, value.byteOffset, value.byteLength) - : typeof value === "string" - ? options.utf8Decoder(value) - : new Uint8Array(value); - const encoded = options.base64Encoder(valueView); - const hash = new options.md5(); - hash.update(valueView); - input = { - ...input, - [prop.target]: encoded, - [prop.hash]: options.base64Encoder(await hash.digest()), - }; - } - } - return next({ - ...args, - input, - }); - }; -} -exports.ssecMiddleware = ssecMiddleware; -exports.ssecMiddlewareOptions = { - name: "ssecMiddleware", - step: "initialize", - tags: ["SSE"], - override: true, -}; -const getSsecPlugin = (config) => ({ - applyToStack: (clientStack) => { - clientStack.add(ssecMiddleware(config), exports.ssecMiddlewareOptions); - }, -}); -exports.getSsecPlugin = getSsecPlugin; +// API +module.exports = iterate; +/** + * Iterates over each job object + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {object} state - current job status + * @param {function} callback - invoked when all elements processed + */ +function iterate(list, iterator, state, callback) +{ + // store current index + var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; -/***/ }), + state.jobs[key] = runJob(iterator, key, list[key], function(error, output) + { + // don't repeat yourself + // skip secondary callbacks + if (!(key in state.jobs)) + { + return; + } -<<<<<<< HEAD -/***/ 24543: -/***/ ((__unused_webpack_module, exports) => { + // clean up jobs + delete state.jobs[key]; -======= -/***/ 74191: -/***/ ((__unused_webpack_module, exports) => { + if (error) + { + // don't process rest of the results + // stop still active jobs + // and reset the list + abort(state); + } + else + { + state.results[key] = output; + } -"use strict"; + // return salvaged results + callback(error, state.results); + }); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.constructStack = void 0; -const constructStack = () => { - let absoluteEntries = []; - let relativeEntries = []; - const entriesNameSet = new Set(); - const sort = (entries) => entries.sort((a, b) => stepWeights[b.step] - stepWeights[a.step] || - priorityWeights[b.priority || "normal"] - priorityWeights[a.priority || "normal"]); - const removeByName = (toRemove) => { - let isRemoved = false; - const filterCb = (entry) => { - if (entry.name && entry.name === toRemove) { - isRemoved = true; - entriesNameSet.delete(toRemove); - return false; - } - return true; - }; - absoluteEntries = absoluteEntries.filter(filterCb); - relativeEntries = relativeEntries.filter(filterCb); - return isRemoved; - }; - const removeByReference = (toRemove) => { - let isRemoved = false; - const filterCb = (entry) => { - if (entry.middleware === toRemove) { - isRemoved = true; - if (entry.name) - entriesNameSet.delete(entry.name); - return false; - } - return true; - }; - absoluteEntries = absoluteEntries.filter(filterCb); - relativeEntries = relativeEntries.filter(filterCb); - return isRemoved; - }; - const cloneTo = (toStack) => { - absoluteEntries.forEach((entry) => { - toStack.add(entry.middleware, { ...entry }); - }); - relativeEntries.forEach((entry) => { - toStack.addRelativeTo(entry.middleware, { ...entry }); - }); - return toStack; - }; - const expandRelativeMiddlewareList = (from) => { - const expandedMiddlewareList = []; - from.before.forEach((entry) => { - if (entry.before.length === 0 && entry.after.length === 0) { - expandedMiddlewareList.push(entry); - } - else { - expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); - } - }); - expandedMiddlewareList.push(from); - from.after.reverse().forEach((entry) => { - if (entry.before.length === 0 && entry.after.length === 0) { - expandedMiddlewareList.push(entry); - } - else { - expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); - } - }); - return expandedMiddlewareList; - }; - const getMiddlewareList = () => { - const normalizedAbsoluteEntries = []; - const normalizedRelativeEntries = []; - const normalizedEntriesNameMap = {}; - absoluteEntries.forEach((entry) => { - const normalizedEntry = { - ...entry, - before: [], - after: [], - }; - if (normalizedEntry.name) - normalizedEntriesNameMap[normalizedEntry.name] = normalizedEntry; - normalizedAbsoluteEntries.push(normalizedEntry); - }); - relativeEntries.forEach((entry) => { - const normalizedEntry = { - ...entry, - before: [], - after: [], - }; - if (normalizedEntry.name) - normalizedEntriesNameMap[normalizedEntry.name] = normalizedEntry; - normalizedRelativeEntries.push(normalizedEntry); - }); - normalizedRelativeEntries.forEach((entry) => { - if (entry.toMiddleware) { - const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware]; - if (toMiddleware === undefined) { - throw new Error(`${entry.toMiddleware} is not found when adding ${entry.name || "anonymous"} middleware ${entry.relation} ${entry.toMiddleware}`); - } - if (entry.relation === "after") { - toMiddleware.after.push(entry); - } - if (entry.relation === "before") { - toMiddleware.before.push(entry); - } - } - }); - const mainChain = sort(normalizedAbsoluteEntries) - .map(expandRelativeMiddlewareList) - .reduce((wholeList, expendedMiddlewareList) => { - wholeList.push(...expendedMiddlewareList); - return wholeList; - }, []); - return mainChain.map((entry) => entry.middleware); - }; - const stack = { - add: (middleware, options = {}) => { - const { name, override } = options; - const entry = { - step: "initialize", - priority: "normal", - middleware, - ...options, - }; - if (name) { - if (entriesNameSet.has(name)) { - if (!override) - throw new Error(`Duplicate middleware name '${name}'`); - const toOverrideIndex = absoluteEntries.findIndex((entry) => entry.name === name); - const toOverride = absoluteEntries[toOverrideIndex]; - if (toOverride.step !== entry.step || toOverride.priority !== entry.priority) { - throw new Error(`"${name}" middleware with ${toOverride.priority} priority in ${toOverride.step} step cannot be ` + - `overridden by same-name middleware with ${entry.priority} priority in ${entry.step} step.`); - } - absoluteEntries.splice(toOverrideIndex, 1); - } - entriesNameSet.add(name); - } - absoluteEntries.push(entry); - }, - addRelativeTo: (middleware, options) => { - const { name, override } = options; - const entry = { - middleware, - ...options, - }; - if (name) { - if (entriesNameSet.has(name)) { - if (!override) - throw new Error(`Duplicate middleware name '${name}'`); - const toOverrideIndex = relativeEntries.findIndex((entry) => entry.name === name); - const toOverride = relativeEntries[toOverrideIndex]; - if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) { - throw new Error(`"${name}" middleware ${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden ` + - `by same-name middleware ${entry.relation} "${entry.toMiddleware}" middleware.`); - } - relativeEntries.splice(toOverrideIndex, 1); - } - entriesNameSet.add(name); - } - relativeEntries.push(entry); - }, - clone: () => cloneTo((0, exports.constructStack)()), - use: (plugin) => { - plugin.applyToStack(stack); - }, - remove: (toRemove) => { - if (typeof toRemove === "string") - return removeByName(toRemove); - else - return removeByReference(toRemove); - }, - removeByTag: (toRemove) => { - let isRemoved = false; - const filterCb = (entry) => { - const { tags, name } = entry; - if (tags && tags.includes(toRemove)) { - if (name) - entriesNameSet.delete(name); - isRemoved = true; - return false; - } - return true; - }; - absoluteEntries = absoluteEntries.filter(filterCb); - relativeEntries = relativeEntries.filter(filterCb); - return isRemoved; - }, - concat: (from) => { - const cloned = cloneTo((0, exports.constructStack)()); - cloned.use(from); - return cloned; - }, - applyToStack: cloneTo, - resolve: (handler, context) => { - for (const middleware of getMiddlewareList().reverse()) { - handler = middleware(handler, context); - } - return handler; - }, - }; - return stack; -}; -exports.constructStack = constructStack; -const stepWeights = { - initialize: 5, - serialize: 4, - build: 3, - finalizeRequest: 2, - deserialize: 1, -}; -const priorityWeights = { - high: 3, - normal: 2, - low: 1, -}; +/** + * Runs iterator over provided job element + * + * @param {function} iterator - iterator to invoke + * @param {string|number} key - key/index of the element in the list of jobs + * @param {mixed} item - job description + * @param {function} callback - invoked after iterator is done with the job + * @returns {function|mixed} - job abort function or something else + */ +function runJob(iterator, key, item, callback) +{ + var aborter; + + // allow shortcut if iterator expects only two arguments + if (iterator.length == 2) + { + aborter = iterator(item, async(callback)); + } + // otherwise go with full three arguments + else + { + aborter = iterator(item, key, async(callback)); + } + + return aborter; +} /***/ }), -/***/ 32551: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/asynckit/lib/state.js": +/*!********************************************!*\ + !*** ./node_modules/asynckit/lib/state.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -"use strict"; +// API +module.exports = state; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(27705); -tslib_1.__exportStar(__nccwpck_require__(74191), exports); +/** + * Creates initial state object + * for iteration over list + * + * @param {array|object} list - list to iterate over + * @param {function|null} sortMethod - function to use for keys sort, + * or `null` to keep them as is + * @returns {object} - initial state object + */ +function state(list, sortMethod) +{ + var isNamedList = !Array.isArray(list) + , initState = + { + index : 0, + keyedList: isNamedList || sortMethod ? Object.keys(list) : null, + jobs : {}, + results : isNamedList ? {} : [], + size : isNamedList ? Object.keys(list).length : list.length + } + ; + + if (sortMethod) + { + // sort array keys based on it's values + // sort object's keys just on own merit + initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) + { + return sortMethod(list[a], list[b]); + }); + } + + return initState; +} /***/ }), -/***/ 27705: -/***/ ((module) => { +/***/ "./node_modules/asynckit/lib/terminator.js": +/*!*************************************************!*\ + !*** ./node_modules/asynckit/lib/terminator.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_10766__) { -/****************************************************************************** -Copyright (c) Microsoft Corporation. +var abort = __nested_webpack_require_10766__(/*! ./abort.js */ "./node_modules/asynckit/lib/abort.js") + , async = __nested_webpack_require_10766__(/*! ./async.js */ "./node_modules/asynckit/lib/async.js") + ; -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. +// API +module.exports = terminator; -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; +/** + * Terminates jobs in the attached state context + * + * @this AsyncKitState# + * @param {function} callback - final callback to invoke after termination + */ +function terminator(callback) +{ + if (!Object.keys(this.jobs).length) + { + return; + } - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; + // fast forward iteration index + this.index = this.size; - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; + // abort jobs + abort(this); - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; + // send back results we have so far + async(callback)(null, this.results); +} - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +/***/ }), - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; +/***/ "./node_modules/asynckit/parallel.js": +/*!*******************************************!*\ + !*** ./node_modules/asynckit/parallel.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_11703__) { - __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()); - }); - }; +var iterate = __nested_webpack_require_11703__(/*! ./lib/iterate.js */ "./node_modules/asynckit/lib/iterate.js") + , initState = __nested_webpack_require_11703__(/*! ./lib/state.js */ "./node_modules/asynckit/lib/state.js") + , terminator = __nested_webpack_require_11703__(/*! ./lib/terminator.js */ "./node_modules/asynckit/lib/terminator.js") + ; - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; +// Public API +module.exports = parallel; - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +/** + * Runs iterator over provided array elements in parallel + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function parallel(list, iterator, callback) +{ + var state = initState(list); - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; + while (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, function(error, result) + { + if (error) + { + callback(error, result); + return; + } + + // looks like it's the last one + if (Object.keys(state.jobs).length === 0) + { + callback(null, state.results); + return; + } }); - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; + state.index++; + } - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; + return terminator.bind(state, callback); +} - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +/***/ }), - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; +/***/ "./node_modules/asynckit/serial.js": +/*!*****************************************!*\ + !*** ./node_modules/asynckit/serial.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_13179__) { - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; +var serialOrdered = __nested_webpack_require_13179__(/*! ./serialOrdered.js */ "./node_modules/asynckit/serialOrdered.js"); - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +// Public API +module.exports = serial; - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; +/** + * Runs iterator over provided array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serial(list, iterator, callback) +{ + return serialOrdered(list, iterator, null, callback); +} - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +/***/ }), - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; +/***/ "./node_modules/asynckit/serialOrdered.js": +/*!************************************************!*\ + !*** ./node_modules/asynckit/serialOrdered.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_14052__) { - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +var iterate = __nested_webpack_require_14052__(/*! ./lib/iterate.js */ "./node_modules/asynckit/lib/iterate.js") + , initState = __nested_webpack_require_14052__(/*! ./lib/state.js */ "./node_modules/asynckit/lib/state.js") + , terminator = __nested_webpack_require_14052__(/*! ./lib/terminator.js */ "./node_modules/asynckit/lib/terminator.js") + ; - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; +// Public API +module.exports = serialOrdered; +// sorting helpers +module.exports.ascending = ascending; +module.exports.descending = descending; - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; +/** + * Runs iterator over provided sorted array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serialOrdered(list, iterator, sortMethod, callback) +{ + var state = initState(list, sortMethod); - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; + iterate(list, iterator, state, function iteratorHandler(error, result) + { + if (error) + { + callback(error, result); + return; + } - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; + state.index++; - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); + // are we there yet? + if (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, iteratorHandler); + return; + } + // done here + callback(null, state.results); + }); -/***/ }), + return terminator.bind(state, callback); +} -/***/ 44291: -/***/ ((__unused_webpack_module, exports) => { +/* + * -- Sort methods + */ -"use strict"; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/** + * sort helper to sort array elements in ascending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function ascending(a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveUserAgentConfig = void 0; -function resolveUserAgentConfig(input) { - return { - ...input, - customUserAgent: typeof input.customUserAgent === "string" ? [[input.customUserAgent]] : input.customUserAgent, - }; +/** + * sort helper to sort array elements in descending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function descending(a, b) +{ + return -1 * ascending(a, b); } -exports.resolveUserAgentConfig = resolveUserAgentConfig; /***/ }), -<<<<<<< HEAD -/***/ 42579: -======= -/***/ 30348: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/axios/index.js": +/*!*************************************!*\ + !*** ./node_modules/axios/index.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_16246__) { +module.exports = __nested_webpack_require_16246__(/*! ./lib/axios */ "./node_modules/axios/lib/axios.js"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UA_ESCAPE_CHAR = exports.UA_VALUE_ESCAPE_REGEX = exports.UA_NAME_ESCAPE_REGEX = exports.UA_NAME_SEPARATOR = exports.SPACE = exports.X_AMZ_USER_AGENT = exports.USER_AGENT = void 0; -exports.USER_AGENT = "user-agent"; -exports.X_AMZ_USER_AGENT = "x-amz-user-agent"; -exports.SPACE = " "; -exports.UA_NAME_SEPARATOR = "/"; -exports.UA_NAME_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g; -exports.UA_VALUE_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g; -exports.UA_ESCAPE_CHAR = "-"; +/***/ }), +/***/ "./node_modules/axios/lib/adapters/http.js": +/*!*************************************************!*\ + !*** ./node_modules/axios/lib/adapters/http.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_16655__) { -/***/ }), +"use strict"; -<<<<<<< HEAD -/***/ 3549: -======= -/***/ 54738: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +var utils = __nested_webpack_require_16655__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); +var settle = __nested_webpack_require_16655__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js"); +var buildFullPath = __nested_webpack_require_16655__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js"); +var buildURL = __nested_webpack_require_16655__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); +var http = __nested_webpack_require_16655__(/*! http */ "http"); +var https = __nested_webpack_require_16655__(/*! https */ "https"); +var httpFollow = __nested_webpack_require_16655__(/*! follow-redirects */ "./node_modules/follow-redirects/index.js").http; +var httpsFollow = __nested_webpack_require_16655__(/*! follow-redirects */ "./node_modules/follow-redirects/index.js").https; +var url = __nested_webpack_require_16655__(/*! url */ "url"); +var zlib = __nested_webpack_require_16655__(/*! zlib */ "zlib"); +var pkg = __nested_webpack_require_16655__(/*! ./../../package.json */ "./node_modules/axios/package.json"); +var createError = __nested_webpack_require_16655__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js"); +var enhanceError = __nested_webpack_require_16655__(/*! ../core/enhanceError */ "./node_modules/axios/lib/core/enhanceError.js"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(98905); -tslib_1.__exportStar(__nccwpck_require__(24543), exports); -tslib_1.__exportStar(__nccwpck_require__(7958), exports); -======= -const tslib_1 = __nccwpck_require__(3190); -tslib_1.__exportStar(__nccwpck_require__(44291), exports); -tslib_1.__exportStar(__nccwpck_require__(88493), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var isHttps = /https:?/; +/** + * + * @param {http.ClientRequestArgs} options + * @param {AxiosProxyConfig} proxy + * @param {string} location + */ +function setProxy(options, proxy, location) { + options.hostname = proxy.host; + options.host = proxy.host; + options.port = proxy.port; + options.path = location; -/***/ }), + // Basic proxy authorization + if (proxy.auth) { + var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); + options.headers['Proxy-Authorization'] = 'Basic ' + base64; + } -<<<<<<< HEAD -/***/ 7958: -======= -/***/ 88493: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + // If a proxy is used, any redirects must also pass through the proxy + options.beforeRedirect = function beforeRedirect(redirection) { + redirection.headers.host = redirection.host; + setProxy(redirection, proxy, redirection.href); + }; +} +/*eslint consistent-return:0*/ +module.exports = function httpAdapter(config) { + return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { + var resolve = function resolve(value) { + resolvePromise(value); + }; + var reject = function reject(value) { + rejectPromise(value); + }; + var data = config.data; + var headers = config.headers; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getUserAgentPlugin = exports.getUserAgentMiddlewareOptions = exports.userAgentMiddleware = void 0; -<<<<<<< HEAD -const util_endpoints_1 = __nccwpck_require__(60698); -const protocol_http_1 = __nccwpck_require__(45311); -const constants_1 = __nccwpck_require__(42579); -======= -const protocol_http_1 = __nccwpck_require__(35712); -const constants_1 = __nccwpck_require__(30348); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const userAgentMiddleware = (options) => (next, context) => async (args) => { - var _a, _b; - const { request } = args; - if (!protocol_http_1.HttpRequest.isInstance(request)) - return next(args); - const { headers } = request; - const userAgent = ((_a = context === null || context === void 0 ? void 0 : context.userAgent) === null || _a === void 0 ? void 0 : _a.map(escapeUserAgent)) || []; - const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent); - const customUserAgent = ((_b = options === null || options === void 0 ? void 0 : options.customUserAgent) === null || _b === void 0 ? void 0 : _b.map(escapeUserAgent)) || []; - const prefix = (0, util_endpoints_1.getUserAgentPrefix)(); - const sdkUserAgentValue = (prefix ? [prefix] : []) - .concat([...defaultUserAgent, ...userAgent, ...customUserAgent]) - .join(constants_1.SPACE); - const normalUAValue = [ - ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")), - ...customUserAgent, - ].join(constants_1.SPACE); - if (options.runtime !== "browser") { - if (normalUAValue) { - headers[constants_1.X_AMZ_USER_AGENT] = headers[constants_1.X_AMZ_USER_AGENT] - ? `${headers[constants_1.USER_AGENT]} ${normalUAValue}` - : normalUAValue; - } - headers[constants_1.USER_AGENT] = sdkUserAgentValue; + // Set User-Agent (required by some servers) + // Only set header if it hasn't been set in config + // See https://github.com/axios/axios/issues/69 + if (!headers['User-Agent'] && !headers['user-agent']) { + headers['User-Agent'] = 'axios/' + pkg.version; } - else { - headers[constants_1.X_AMZ_USER_AGENT] = sdkUserAgentValue; + + if (data && !utils.isStream(data)) { + if (Buffer.isBuffer(data)) { + // Nothing to do... + } else if (utils.isArrayBuffer(data)) { + data = Buffer.from(new Uint8Array(data)); + } else if (utils.isString(data)) { + data = Buffer.from(data, 'utf-8'); + } else { + return reject(createError( + 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', + config + )); + } + + // Add Content-Length header if data exists + headers['Content-Length'] = data.length; } - return next({ - ...args, - request, - }); -}; -exports.userAgentMiddleware = userAgentMiddleware; -const escapeUserAgent = (userAgentPair) => { - var _a; - const name = userAgentPair[0] - .split(constants_1.UA_NAME_SEPARATOR) - .map((part) => part.replace(constants_1.UA_NAME_ESCAPE_REGEX, constants_1.UA_ESCAPE_CHAR)) - .join(constants_1.UA_NAME_SEPARATOR); - const version = (_a = userAgentPair[1]) === null || _a === void 0 ? void 0 : _a.replace(constants_1.UA_VALUE_ESCAPE_REGEX, constants_1.UA_ESCAPE_CHAR); - const prefixSeparatorIndex = name.indexOf(constants_1.UA_NAME_SEPARATOR); - const prefix = name.substring(0, prefixSeparatorIndex); - let uaName = name.substring(prefixSeparatorIndex + 1); - if (prefix === "api") { - uaName = uaName.toLowerCase(); + + // HTTP basic authentication + var auth = undefined; + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + auth = username + ':' + password; } - return [prefix, uaName, version] - .filter((item) => item && item.length > 0) - .reduce((acc, item, index) => { - switch (index) { - case 0: - return item; - case 1: - return `${acc}/${item}`; - default: - return `${acc}#${item}`; - } - }, ""); -}; -exports.getUserAgentMiddlewareOptions = { - name: "getUserAgentMiddleware", - step: "build", - priority: "low", - tags: ["SET_USER_AGENT", "USER_AGENT"], - override: true, -}; -const getUserAgentPlugin = (config) => ({ - applyToStack: (clientStack) => { - clientStack.add((0, exports.userAgentMiddleware)(config), exports.getUserAgentMiddlewareOptions); - }, -}); -exports.getUserAgentPlugin = getUserAgentPlugin; + // Parse url + var fullPath = buildFullPath(config.baseURL, config.url); + var parsed = url.parse(fullPath); + var protocol = parsed.protocol || 'http:'; -/***/ }), + if (!auth && parsed.auth) { + var urlAuth = parsed.auth.split(':'); + var urlUsername = urlAuth[0] || ''; + var urlPassword = urlAuth[1] || ''; + auth = urlUsername + ':' + urlPassword; + } -<<<<<<< HEAD -/***/ 98905: -======= -/***/ 3190: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { + if (auth) { + delete headers.Authorization; + } -/****************************************************************************** -Copyright (c) Microsoft Corporation. + var isHttpsRequest = isHttps.test(protocol); + var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. + var options = { + path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''), + method: config.method.toUpperCase(), + headers: headers, + agent: agent, + agents: { http: config.httpAgent, https: config.httpsAgent }, + auth: auth + }; -<<<<<<< HEAD -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + if (config.socketPath) { + options.socketPath = config.socketPath; + } else { + options.hostname = parsed.hostname; + options.port = parsed.port; } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); -======= -/***/ }), -/***/ 67180: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + var proxy = config.proxy; + if (!proxy && proxy !== false) { + var proxyEnv = protocol.slice(0, -1) + '_proxy'; + var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()]; + if (proxyUrl) { + var parsedProxyUrl = url.parse(proxyUrl); + var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY; + var shouldProxy = true; -"use strict"; + if (noProxyEnv) { + var noProxy = noProxyEnv.split(',').map(function trim(s) { + return s.trim(); + }); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.loadConfig = void 0; -const property_provider_1 = __nccwpck_require__(68655); -const fromEnv_1 = __nccwpck_require__(19462); -const fromSharedConfigFiles_1 = __nccwpck_require__(94816); -const fromStatic_1 = __nccwpck_require__(56157); -const loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => (0, property_provider_1.memoize)((0, property_provider_1.chain)((0, fromEnv_1.fromEnv)(environmentVariableSelector), (0, fromSharedConfigFiles_1.fromSharedConfigFiles)(configFileSelector, configuration), (0, fromStatic_1.fromStatic)(defaultValue))); -exports.loadConfig = loadConfig; + shouldProxy = !noProxy.some(function proxyMatch(proxyElement) { + if (!proxyElement) { + return false; + } + if (proxyElement === '*') { + return true; + } + if (proxyElement[0] === '.' && + parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) { + return true; + } + return parsed.hostname === proxyElement; + }); + } -/***/ }), + if (shouldProxy) { + proxy = { + host: parsedProxyUrl.hostname, + port: parsedProxyUrl.port, + protocol: parsedProxyUrl.protocol + }; -/***/ 19462: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (parsedProxyUrl.auth) { + var proxyUrlAuth = parsedProxyUrl.auth.split(':'); + proxy.auth = { + username: proxyUrlAuth[0], + password: proxyUrlAuth[1] + }; + } + } + } + } -"use strict"; + if (proxy) { + options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : ''); + setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromEnv = void 0; -const property_provider_1 = __nccwpck_require__(68655); -const fromEnv = (envVarSelector) => async () => { - try { - const config = envVarSelector(process.env); - if (config === undefined) { - throw new Error(); - } - return config; + var transport; + var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true); + if (config.transport) { + transport = config.transport; + } else if (config.maxRedirects === 0) { + transport = isHttpsProxy ? https : http; + } else { + if (config.maxRedirects) { + options.maxRedirects = config.maxRedirects; + } + transport = isHttpsProxy ? httpsFollow : httpFollow; } - catch (e) { - throw new property_provider_1.CredentialsProviderError(e.message || `Cannot load config from environment variables with getter: ${envVarSelector}`); + + if (config.maxBodyLength > -1) { + options.maxBodyLength = config.maxBodyLength; } -}; -exports.fromEnv = fromEnv; + // Create the request + var req = transport.request(options, function handleResponse(res) { + if (req.aborted) return; + + // uncompress the response body transparently if required + var stream = res; -/***/ }), + // return the last request in case of redirects + var lastRequest = res.req || req; -/***/ 94816: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; + // if no content, is HEAD request or decompress disabled we should not decompress + if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) { + switch (res.headers['content-encoding']) { + /*eslint default-case:0*/ + case 'gzip': + case 'compress': + case 'deflate': + // add the unzipper to the body stream processing pipeline + stream = stream.pipe(zlib.createUnzip()); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromSharedConfigFiles = void 0; -const property_provider_1 = __nccwpck_require__(68655); -const shared_ini_file_loader_1 = __nccwpck_require__(93378); -const fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => { - const profile = (0, shared_ini_file_loader_1.getProfileName)(init); - const { configFile, credentialsFile } = await (0, shared_ini_file_loader_1.loadSharedConfigFiles)(init); - const profileFromCredentials = credentialsFile[profile] || {}; - const profileFromConfig = configFile[profile] || {}; - const mergedProfile = preferredFile === "config" - ? { ...profileFromCredentials, ...profileFromConfig } - : { ...profileFromConfig, ...profileFromCredentials }; - try { - const configValue = configSelector(mergedProfile); - if (configValue === undefined) { - throw new Error(); + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; } - return configValue; + } + + var response = { + status: res.statusCode, + statusText: res.statusMessage, + headers: res.headers, + config: config, + request: lastRequest + }; + + if (config.responseType === 'stream') { + response.data = stream; + settle(resolve, reject, response); + } else { + var responseBuffer = []; + stream.on('data', function handleStreamData(chunk) { + responseBuffer.push(chunk); + + // make sure the content length is not over the maxContentLength if specified + if (config.maxContentLength > -1 && Buffer.concat(responseBuffer).length > config.maxContentLength) { + stream.destroy(); + reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded', + config, null, lastRequest)); + } + }); + + stream.on('error', function handleStreamError(err) { + if (req.aborted) return; + reject(enhanceError(err, config, null, lastRequest)); + }); + + stream.on('end', function handleStreamEnd() { + var responseData = Buffer.concat(responseBuffer); + if (config.responseType !== 'arraybuffer') { + responseData = responseData.toString(config.responseEncoding); + if (!config.responseEncoding || config.responseEncoding === 'utf8') { + responseData = utils.stripBOM(responseData); + } + } + + response.data = responseData; + settle(resolve, reject, response); + }); + } + }); + + // Handle errors + req.on('error', function handleRequestError(err) { + if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return; + reject(enhanceError(err, config, null, req)); + }); + + // Handle request timeout + if (config.timeout) { + // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. + // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. + // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. + // And then these socket which be hang up will devoring CPU little by little. + // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. + req.setTimeout(config.timeout, function handleRequestTimeout() { + req.abort(); + reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', req)); + }); } - catch (e) { - throw new property_provider_1.CredentialsProviderError(e.message || - `Cannot load config for profile ${profile} in SDK configuration files with getter: ${configSelector}`); + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (req.aborted) return; + + req.abort(); + reject(cancel); + }); + } + + // Send the request + if (utils.isStream(data)) { + data.on('error', function handleStreamError(err) { + reject(enhanceError(err, config, null, req)); + }).pipe(req); + } else { + req.end(data); } + }); }; -exports.fromSharedConfigFiles = fromSharedConfigFiles; /***/ }), -/***/ 56157: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/axios/lib/adapters/xhr.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/adapters/xhr.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_27727__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromStatic = void 0; -const property_provider_1 = __nccwpck_require__(68655); -const isFunction = (func) => typeof func === "function"; -const fromStatic = (defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : (0, property_provider_1.fromStatic)(defaultValue); -exports.fromStatic = fromStatic; +var utils = __nested_webpack_require_27727__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); +var settle = __nested_webpack_require_27727__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js"); +var cookies = __nested_webpack_require_27727__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js"); +var buildURL = __nested_webpack_require_27727__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); +var buildFullPath = __nested_webpack_require_27727__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js"); +var parseHeaders = __nested_webpack_require_27727__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js"); +var isURLSameOrigin = __nested_webpack_require_27727__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js"); +var createError = __nested_webpack_require_27727__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js"); -/***/ }), +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; -/***/ 15071: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } -"use strict"; + var request = new XMLHttpRequest(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(77015); -tslib_1.__exportStar(__nccwpck_require__(67180), exports); + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + var fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); -/***/ }), + // Set the request timeout in MS + request.timeout = config.timeout; -/***/ 77015: -/***/ ((module) => { + // Listen for ready state + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } -/****************************************************************************** -Copyright (c) Microsoft Corporation. + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + settle(resolve, reject, response); - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + // Clean up request + request = null; }; - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; + reject(createError('Request aborted', config, 'ECONNABORTED', request)); - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; + // Clean up request + request = null; }; - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + // Clean up request + request = null; }; - __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()); - }); - }; + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(createError(timeoutErrorMessage, config, 'ECONNABORTED', + request)); - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } + // Clean up request + request = null; }; - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); + }); + } - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } + // Add responseType to request if needed + if (config.responseType) { + try { + request.responseType = config.responseType; + } catch (e) { + // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2. + // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function. + if (config.responseType !== 'json') { + throw e; } - return ar; - }; + } + } - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; + request.abort(); + reject(cancel); + // Clean up request + request = null; + }); + } - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; + if (!requestData) { + requestData = null; + } - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; + // Send the request + request.send(requestData); + }); +}; - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; +/***/ }), - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +/***/ "./node_modules/axios/lib/axios.js": +/*!*****************************************!*\ + !*** ./node_modules/axios/lib/axios.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_34389__) { - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; +"use strict"; - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +var utils = __nested_webpack_require_34389__(/*! ./utils */ "./node_modules/axios/lib/utils.js"); +var bind = __nested_webpack_require_34389__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); +var Axios = __nested_webpack_require_34389__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js"); +var mergeConfig = __nested_webpack_require_34389__(/*! ./core/mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js"); +var defaults = __nested_webpack_require_34389__(/*! ./defaults */ "./node_modules/axios/lib/defaults.js"); - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context); + // Copy context to instance + utils.extend(instance, context); -/***/ }), + return instance; +} -/***/ 53526: -/***/ ((__unused_webpack_module, exports) => { +// Create the default instance to be exported +var axios = createInstance(defaults); -"use strict"; +// Expose Axios class to allow class inheritance +axios.Axios = Axios; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODEJS_TIMEOUT_ERROR_CODES = void 0; -exports.NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; +// Factory for creating new instances +axios.create = function create(instanceConfig) { + return createInstance(mergeConfig(axios.defaults, instanceConfig)); +}; +// Expose Cancel & CancelToken +axios.Cancel = __nested_webpack_require_34389__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); +axios.CancelToken = __nested_webpack_require_34389__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js"); +axios.isCancel = __nested_webpack_require_34389__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); -/***/ }), +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = __nested_webpack_require_34389__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js"); -/***/ 54225: -/***/ ((__unused_webpack_module, exports) => { +// Expose isAxiosError +axios.isAxiosError = __nested_webpack_require_34389__(/*! ./helpers/isAxiosError */ "./node_modules/axios/lib/helpers/isAxiosError.js"); -"use strict"; +module.exports = axios; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getTransformedHeaders = void 0; -const getTransformedHeaders = (headers) => { - const transformedHeaders = {}; - for (const name of Object.keys(headers)) { - const headerValues = headers[name]; - transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; - } - return transformedHeaders; -}; -exports.getTransformedHeaders = getTransformedHeaders; +// Allow use of default import syntax in TypeScript +module.exports.default = axios; /***/ }), -/***/ 51062: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/axios/lib/cancel/Cancel.js": +/*!*************************************************!*\ + !*** ./node_modules/axios/lib/cancel/Cancel.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(72766); -tslib_1.__exportStar(__nccwpck_require__(94850), exports); -tslib_1.__exportStar(__nccwpck_require__(28845), exports); -tslib_1.__exportStar(__nccwpck_require__(5346), exports); - -/***/ }), +/** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function Cancel(message) { + this.message = message; +} -/***/ 94850: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); +}; -"use strict"; +Cancel.prototype.__CANCEL__ = true; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttpHandler = void 0; -const protocol_http_1 = __nccwpck_require__(35712); -const querystring_builder_1 = __nccwpck_require__(27974); -const http_1 = __nccwpck_require__(13685); -const https_1 = __nccwpck_require__(95687); -const constants_1 = __nccwpck_require__(53526); -const get_transformed_headers_1 = __nccwpck_require__(54225); -const set_connection_timeout_1 = __nccwpck_require__(4814); -const set_socket_timeout_1 = __nccwpck_require__(3568); -const write_request_body_1 = __nccwpck_require__(41007); -class NodeHttpHandler { - constructor(options) { - this.metadata = { handlerProtocol: "http/1.1" }; - this.configProvider = new Promise((resolve, reject) => { - if (typeof options === "function") { - options() - .then((_options) => { - resolve(this.resolveDefaultConfig(_options)); - }) - .catch(reject); - } - else { - resolve(this.resolveDefaultConfig(options)); - } - }); - } - resolveDefaultConfig(options) { - const { connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; - const keepAlive = true; - const maxSockets = 50; - return { - connectionTimeout, - socketTimeout, - httpAgent: httpAgent || new http_1.Agent({ keepAlive, maxSockets }), - httpsAgent: httpsAgent || new https_1.Agent({ keepAlive, maxSockets }), - }; - } - destroy() { - var _a, _b, _c, _d; - (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.httpAgent) === null || _b === void 0 ? void 0 : _b.destroy(); - (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.httpsAgent) === null || _d === void 0 ? void 0 : _d.destroy(); - } - async handle(request, { abortSignal } = {}) { - if (!this.config) { - this.config = await this.configProvider; - } - return new Promise((resolve, reject) => { - if (!this.config) { - throw new Error("Node HTTP request handler config is not resolved"); - } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - return; - } - const isSSL = request.protocol === "https:"; - const queryString = (0, querystring_builder_1.buildQueryString)(request.query || {}); - const nodeHttpsOptions = { - headers: request.headers, - host: request.hostname, - method: request.method, - path: queryString ? `${request.path}?${queryString}` : request.path, - port: request.port, - agent: isSSL ? this.config.httpsAgent : this.config.httpAgent, - }; - const requestFunc = isSSL ? https_1.request : http_1.request; - const req = requestFunc(nodeHttpsOptions, (res) => { - const httpResponse = new protocol_http_1.HttpResponse({ - statusCode: res.statusCode || -1, - headers: (0, get_transformed_headers_1.getTransformedHeaders)(res.headers), - body: res, - }); - resolve({ response: httpResponse }); - }); - req.on("error", (err) => { - if (constants_1.NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { - reject(Object.assign(err, { name: "TimeoutError" })); - } - else { - reject(err); - } - }); - (0, set_connection_timeout_1.setConnectionTimeout)(req, reject, this.config.connectionTimeout); - (0, set_socket_timeout_1.setSocketTimeout)(req, reject, this.config.socketTimeout); - if (abortSignal) { - abortSignal.onabort = () => { - req.abort(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - }; - } - (0, write_request_body_1.writeRequestBody)(req, request); - }); - } -} -exports.NodeHttpHandler = NodeHttpHandler; +module.exports = Cancel; /***/ }), -/***/ 28845: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/axios/lib/cancel/CancelToken.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/cancel/CancelToken.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_37542__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2Handler = void 0; -const protocol_http_1 = __nccwpck_require__(35712); -const querystring_builder_1 = __nccwpck_require__(27974); -const http2_1 = __nccwpck_require__(85158); -const get_transformed_headers_1 = __nccwpck_require__(54225); -const write_request_body_1 = __nccwpck_require__(41007); -class NodeHttp2Handler { - constructor(options) { - this.metadata = { handlerProtocol: "h2" }; - this.configProvider = new Promise((resolve, reject) => { - if (typeof options === "function") { - options() - .then((opts) => { - resolve(opts || {}); - }) - .catch(reject); - } - else { - resolve(options || {}); - } - }); - this.sessionCache = new Map(); - } - destroy() { - for (const sessions of this.sessionCache.values()) { - sessions.forEach((session) => this.destroySession(session)); - } - this.sessionCache.clear(); - } - async handle(request, { abortSignal } = {}) { - if (!this.config) { - this.config = await this.configProvider; - } - const { requestTimeout, disableConcurrentStreams } = this.config; - return new Promise((resolve, rejectOriginal) => { - let fulfilled = false; - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - fulfilled = true; - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - rejectOriginal(abortError); - return; - } - const { hostname, method, port, protocol, path, query } = request; - const authority = `${protocol}//${hostname}${port ? `:${port}` : ""}`; - const session = this.getSession(authority, disableConcurrentStreams || false); - const reject = (err) => { - if (disableConcurrentStreams) { - this.destroySession(session); - } - fulfilled = true; - rejectOriginal(err); - }; - const queryString = (0, querystring_builder_1.buildQueryString)(query || {}); - const req = session.request({ - ...request.headers, - [http2_1.constants.HTTP2_HEADER_PATH]: queryString ? `${path}?${queryString}` : path, - [http2_1.constants.HTTP2_HEADER_METHOD]: method, - }); - session.ref(); - req.on("response", (headers) => { - const httpResponse = new protocol_http_1.HttpResponse({ - statusCode: headers[":status"] || -1, - headers: (0, get_transformed_headers_1.getTransformedHeaders)(headers), - body: req, - }); - fulfilled = true; - resolve({ response: httpResponse }); - if (disableConcurrentStreams) { - session.close(); - this.deleteSessionFromCache(authority, session); - } - }); - if (requestTimeout) { - req.setTimeout(requestTimeout, () => { - req.close(); - const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); - timeoutError.name = "TimeoutError"; - reject(timeoutError); - }); - } - if (abortSignal) { - abortSignal.onabort = () => { - req.close(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - }; - } - req.on("frameError", (type, code, id) => { - reject(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code}.`)); - }); - req.on("error", reject); - req.on("aborted", () => { - reject(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${req.rstCode}.`)); - }); - req.on("close", () => { - session.unref(); - if (disableConcurrentStreams) { - session.destroy(); - } - if (!fulfilled) { - reject(new Error("Unexpected error: http2 request did not get a response")); - } - }); - (0, write_request_body_1.writeRequestBody)(req, request); - }); - } - getSession(authority, disableConcurrentStreams) { - var _a; - const sessionCache = this.sessionCache; - const existingSessions = sessionCache.get(authority) || []; - if (existingSessions.length > 0 && !disableConcurrentStreams) - return existingSessions[0]; - const newSession = (0, http2_1.connect)(authority); - newSession.unref(); - const destroySessionCb = () => { - this.destroySession(newSession); - this.deleteSessionFromCache(authority, newSession); - }; - newSession.on("goaway", destroySessionCb); - newSession.on("error", destroySessionCb); - newSession.on("frameError", destroySessionCb); - newSession.on("close", () => this.deleteSessionFromCache(authority, newSession)); - if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.sessionTimeout) { - newSession.setTimeout(this.config.sessionTimeout, destroySessionCb); - } - existingSessions.push(newSession); - sessionCache.set(authority, existingSessions); - return newSession; - } - destroySession(session) { - if (!session.destroyed) { - session.destroy(); - } - } - deleteSessionFromCache(authority, session) { - const existingSessions = this.sessionCache.get(authority) || []; - if (!existingSessions.includes(session)) { - return; - } - this.sessionCache.set(authority, existingSessions.filter((s) => s !== session)); - } -} -exports.NodeHttp2Handler = NodeHttp2Handler; - -/***/ }), +var Cancel = __nested_webpack_require_37542__(/*! ./Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); -/***/ 4814: -/***/ ((__unused_webpack_module, exports) => { +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ +function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } -"use strict"; + var resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setConnectionTimeout = void 0; -const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { - if (!timeoutInMs) { - return; + var token = this; + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; } - request.on("socket", (socket) => { - if (socket.connecting) { - const timeoutId = setTimeout(() => { - request.destroy(); - reject(Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { - name: "TimeoutError", - })); - }, timeoutInMs); - socket.on("connect", () => { - clearTimeout(timeoutId); - }); - } - }); -}; -exports.setConnectionTimeout = setConnectionTimeout; - -/***/ }), - -/***/ 3568: -/***/ ((__unused_webpack_module, exports) => { + token.reason = new Cancel(message); + resolvePromise(token.reason); + }); +} -"use strict"; +/** + * Throws a `Cancel` if cancellation has been requested. + */ +CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setSocketTimeout = void 0; -const setSocketTimeout = (request, reject, timeoutInMs = 0) => { - request.setTimeout(timeoutInMs, () => { - request.destroy(); - reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); - }); +/** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ +CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; }; -exports.setSocketTimeout = setSocketTimeout; + +module.exports = CancelToken; /***/ }), -/***/ 76282: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/axios/lib/cancel/isCancel.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/cancel/isCancel.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Collector = void 0; -const stream_1 = __nccwpck_require__(12781); -class Collector extends stream_1.Writable { - constructor() { - super(...arguments); - this.bufferedBytes = []; - } - _write(chunk, encoding, callback) { - this.bufferedBytes.push(chunk); - callback(); - } -} -exports.Collector = Collector; + +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; /***/ }), -/***/ 5346: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/axios/lib/core/Axios.js": +/*!**********************************************!*\ + !*** ./node_modules/axios/lib/core/Axios.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_39575__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.streamCollector = void 0; -const collector_1 = __nccwpck_require__(76282); -const streamCollector = (stream) => new Promise((resolve, reject) => { - const collector = new collector_1.Collector(); - stream.pipe(collector); - stream.on("error", (err) => { - collector.end(); - reject(err); - }); - collector.on("error", reject); - collector.on("finish", function () { - const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); - resolve(bytes); - }); -}); -exports.streamCollector = streamCollector; +var utils = __nested_webpack_require_39575__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); +var buildURL = __nested_webpack_require_39575__(/*! ../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); +var InterceptorManager = __nested_webpack_require_39575__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js"); +var dispatchRequest = __nested_webpack_require_39575__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js"); +var mergeConfig = __nested_webpack_require_39575__(/*! ./mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js"); -/***/ }), +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ +function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} -/***/ 41007: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ +Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof config === 'string') { + config = arguments[1] || {}; + config.url = arguments[0]; + } else { + config = config || {}; + } -"use strict"; + config = mergeConfig(this.defaults, config); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.writeRequestBody = void 0; -const stream_1 = __nccwpck_require__(12781); -function writeRequestBody(httpRequest, request) { - const expect = request.headers["Expect"] || request.headers["expect"]; - if (expect === "100-continue") { - httpRequest.on("continue", () => { - writeBody(httpRequest, request.body); - }); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - else { - factory(createExporter(root)); - } -<<<<<<< HEAD - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } -======= -} -exports.writeRequestBody = writeRequestBody; -function writeBody(httpRequest, body) { - if (body instanceof stream_1.Readable) { - body.pipe(httpRequest); - } - else if (body) { - httpRequest.end(Buffer.from(body)); - } - else { - httpRequest.end(); - } -} + // Set config.method + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } + // Hook up interceptors middleware + var chain = [dispatchRequest, undefined]; + var promise = Promise.resolve(config); -/***/ }), + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + chain.unshift(interceptor.fulfilled, interceptor.rejected); + }); -/***/ 72766: -/***/ ((module) => { + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + chain.push(interceptor.fulfilled, interceptor.rejected); + }); -/****************************************************************************** -Copyright (c) Microsoft Corporation. + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. + return promise; +}; -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; +Axios.prototype.getUri = function getUri(config) { + config = mergeConfig(this.defaults, config); + return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); +}; - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: (config || {}).data + })); + }; +}); - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: data + })); + }; +}); - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; +module.exports = Axios; - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +/***/ }), - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; +/***/ "./node_modules/axios/lib/core/InterceptorManager.js": +/*!***********************************************************!*\ + !*** ./node_modules/axios/lib/core/InterceptorManager.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_42900__) { - __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()); - }); - }; +"use strict"; - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +var utils = __nested_webpack_require_42900__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +function InterceptorManager() { + this.handlers = []; +} - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; +/** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ +InterceptorManager.prototype.use = function use(fulfilled, rejected) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected + }); + return this.handlers.length - 1; +}; - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; +/** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ +InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } +}; - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +/** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); +}; - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +module.exports = InterceptorManager; - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; +/***/ }), - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +/***/ "./node_modules/axios/lib/core/buildFullPath.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/core/buildFullPath.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_44541__) { - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; +"use strict"; - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +var isAbsoluteURL = __nested_webpack_require_44541__(/*! ../helpers/isAbsoluteURL */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js"); +var combineURLs = __nested_webpack_require_44541__(/*! ../helpers/combineURLs */ "./node_modules/axios/lib/helpers/combineURLs.js"); - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * @returns {string} The combined full path + */ +module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +}; - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; +/***/ }), - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; +/***/ "./node_modules/axios/lib/core/createError.js": +/*!****************************************************!*\ + !*** ./node_modules/axios/lib/core/createError.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_45701__) { - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +"use strict"; - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); +var enhanceError = __nested_webpack_require_45701__(/*! ./enhanceError */ "./node_modules/axios/lib/core/enhanceError.js"); + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); +}; /***/ }), -/***/ 3076: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/axios/lib/core/dispatchRequest.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/core/dispatchRequest.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_46736__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CredentialsProviderError = void 0; -const ProviderError_1 = __nccwpck_require__(36955); -class CredentialsProviderError extends ProviderError_1.ProviderError { - constructor(message, tryNextLink = true) { - super(message, tryNextLink); - this.tryNextLink = tryNextLink; - this.name = "CredentialsProviderError"; - Object.setPrototypeOf(this, CredentialsProviderError.prototype); - } -} -exports.CredentialsProviderError = CredentialsProviderError; - -/***/ }), - -/***/ 36955: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +var utils = __nested_webpack_require_46736__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); +var transformData = __nested_webpack_require_46736__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js"); +var isCancel = __nested_webpack_require_46736__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); +var defaults = __nested_webpack_require_46736__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProviderError = void 0; -class ProviderError extends Error { - constructor(message, tryNextLink = true) { - super(message); - this.tryNextLink = tryNextLink; - this.name = "ProviderError"; - Object.setPrototypeOf(this, ProviderError.prototype); - } - static from(error, tryNextLink = true) { - return Object.assign(new this(error.message, tryNextLink), error); - } +/** + * Throws a `Cancel` if cancellation has been requested. + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } } -exports.ProviderError = ProviderError; +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ +module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); -/***/ }), + // Ensure headers exist + config.headers = config.headers || {}; -/***/ 62305: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + // Transform request data + config.data = transformData( + config.data, + config.headers, + config.transformRequest + ); -"use strict"; + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers + ); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.chain = void 0; -const ProviderError_1 = __nccwpck_require__(36955); -function chain(...providers) { - return () => { - let promise = Promise.reject(new ProviderError_1.ProviderError("No providers in chain")); - for (const provider of providers) { - promise = promise.catch((err) => { - if (err === null || err === void 0 ? void 0 : err.tryNextLink) { - return provider(); - } - throw err; - }); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + ); - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; + var adapter = config.adapter || defaults.adapter; -<<<<<<< HEAD - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; -======= + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); -/***/ }), + // Transform response data + response.data = transformData( + response.data, + response.headers, + config.transformResponse + ); -/***/ 33248: -/***/ ((__unused_webpack_module, exports) => { + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); -"use strict"; + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData( + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromStatic = void 0; -const fromStatic = (staticValue) => () => Promise.resolve(staticValue); -exports.fromStatic = fromStatic; + return Promise.reject(reason); + }); +}; /***/ }), -/***/ 68655: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/axios/lib/core/enhanceError.js": +/*!*****************************************************!*\ + !*** ./node_modules/axios/lib/core/enhanceError.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(80770); -tslib_1.__exportStar(__nccwpck_require__(3076), exports); -tslib_1.__exportStar(__nccwpck_require__(36955), exports); -tslib_1.__exportStar(__nccwpck_require__(62305), exports); -tslib_1.__exportStar(__nccwpck_require__(33248), exports); -tslib_1.__exportStar(__nccwpck_require__(60479), exports); - -/***/ }), - -/***/ 60479: -/***/ ((__unused_webpack_module, exports) => { +/** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ +module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } -"use strict"; + error.request = request; + error.response = response; + error.isAxiosError = true; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.memoize = void 0; -const memoize = (provider, isExpired, requiresRefresh) => { - let resolved; - let pending; - let hasResult; - let isConstant = false; - const coalesceProvider = async () => { - if (!pending) { - pending = provider(); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - return t; + error.toJSON = function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: this.config, + code: this.code }; + }; + return error; +}; - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; +/***/ }), - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +/***/ "./node_modules/axios/lib/core/mergeConfig.js": +/*!****************************************************!*\ + !*** ./node_modules/axios/lib/core/mergeConfig.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_50619__) { - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; +"use strict"; - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; +var utils = __nested_webpack_require_50619__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * @returns {Object} New object resulting from merging config2 to config1 + */ +module.exports = function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; + var valueFromConfig2Keys = ['url', 'method', 'data']; + var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; + var defaultToConfig2Keys = [ + 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', + 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', + 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', + 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', + 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' + ]; + var directMergeKeys = ['validateStatus']; - __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()); - }); - }; + function getMergedValue(target, source) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge(target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; + function mergeDeepProperties(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + } - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; + utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } + }); - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); + utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; + utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; + utils.forEach(directMergeKeys, function merge(prop) { + if (prop in config2) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (prop in config1) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; + var axiosKeys = valueFromConfig2Keys + .concat(mergeDeepPropertiesKeys) + .concat(defaultToConfig2Keys) + .concat(directMergeKeys); - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; + var otherKeys = Object + .keys(config1) + .concat(Object.keys(config2)) + .filter(function filterAxiosKeys(key) { + return axiosKeys.indexOf(key) === -1; + }); - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; + utils.forEach(otherKeys, mergeDeepProperties); - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; + return config; +}; - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; +/***/ }), - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; +/***/ "./node_modules/axios/lib/core/settle.js": +/*!***********************************************!*\ + !*** ./node_modules/axios/lib/core/settle.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_53876__) { - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +"use strict"; - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +var createError = __nested_webpack_require_53876__(/*! ./createError */ "./node_modules/axios/lib/core/createError.js"); - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ +module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError( + 'Request failed with status code ' + response.status, + response.config, + null, + response.request, + response + )); + } +}; - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +/***/ }), - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; +/***/ "./node_modules/axios/lib/core/transformData.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/core/transformData.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_54983__) { - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; +"use strict"; - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; +var utils = __nested_webpack_require_54983__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn(data, headers); + }); + + return data; +}; /***/ }), -/***/ 57842: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/axios/lib/defaults.js": +/*!********************************************!*\ + !*** ./node_modules/axios/lib/defaults.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_55883__) { +"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveAwsRegionExtensionConfiguration = exports.getAwsRegionExtensionConfiguration = void 0; -const getAwsRegionExtensionConfiguration = (runtimeConfig) => { - let runtimeConfigRegion = async () => { - if (runtimeConfig.region === undefined) { - throw new Error("Region is missing from runtimeConfig"); - } - const region = runtimeConfig.region; - if (typeof region === "string") { - return region; - } - return region(); - }; - return { - setRegion(region) { - runtimeConfigRegion = region; - }, - region() { - return runtimeConfigRegion; - }, - }; -}; -exports.getAwsRegionExtensionConfiguration = getAwsRegionExtensionConfiguration; -const resolveAwsRegionExtensionConfiguration = (awsRegionExtensionConfiguration) => { - return { - region: awsRegionExtensionConfiguration.region(), - }; -}; -exports.resolveAwsRegionExtensionConfiguration = resolveAwsRegionExtensionConfiguration; +var utils = __nested_webpack_require_55883__(/*! ./utils */ "./node_modules/axios/lib/utils.js"); +var normalizeHeaderName = __nested_webpack_require_55883__(/*! ./helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js"); -/***/ }), +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; -<<<<<<< HEAD -/***/ 35657: -======= -/***/ 80770: -/***/ ((module) => { +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} -/****************************************************************************** -Copyright (c) Microsoft Corporation. +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = __nested_webpack_require_55883__(/*! ./adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js"); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = __nested_webpack_require_55883__(/*! ./adapters/http */ "./node_modules/axios/lib/adapters/http.js"); + } + return adapter; +} -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. +var defaults = { + adapter: getDefaultAdapter(), -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Accept'); + normalizeHeaderName(headers, 'Content-Type'); + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); + if (utils.isArrayBufferView(data)) { + return data.buffer; } - else { - factory(createExporter(root)); + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + if (utils.isObject(data)) { + setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); + return JSON.stringify(data); } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return data; + }], - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; + transformResponse: [function transformResponse(data) { + /*eslint no-param-reassign:0*/ + if (typeof data === 'string') { + try { + data = JSON.parse(data); + } catch (e) { /* Ignore */ } + } + return data; + }], - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; + maxContentLength: -1, + maxBodyLength: -1, - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } +}; - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; +defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } +}; - __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()); - }); - }; +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +module.exports = defaults; - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; +/***/ }), - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; +/***/ "./node_modules/axios/lib/helpers/bind.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/helpers/bind.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +"use strict"; - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +/***/ }), - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; +/***/ "./node_modules/axios/lib/helpers/buildURL.js": +/*!****************************************************!*\ + !*** ./node_modules/axios/lib/helpers/buildURL.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_59593__) { - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; +"use strict"; - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; +var utils = __nested_webpack_require_59593__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); -/***/ }), + serializedParams = parts.join('&'); + } -/***/ 42053: -/***/ ((__unused_webpack_module, exports) => { + if (serializedParams) { + var hashmarkIndex = url.indexOf('#'); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } -"use strict"; + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + return url; +}; /***/ }), -/***/ 39203: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/axios/lib/helpers/combineURLs.js": +/*!*******************************************************!*\ + !*** ./node_modules/axios/lib/helpers/combineURLs.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpRequest = void 0; -class HttpRequest { - constructor(options) { - this.method = options.method || "GET"; - this.hostname = options.hostname || "localhost"; - this.port = options.port; - this.query = options.query || {}; - this.headers = options.headers || {}; - this.body = options.body; - this.protocol = options.protocol - ? options.protocol.slice(-1) !== ":" - ? `${options.protocol}:` - : options.protocol - : "https:"; - this.path = options.path ? (options.path.charAt(0) !== "/" ? `/${options.path}` : options.path) : "/"; - } - static isInstance(request) { - if (!request) - return false; - const req = request; - return ("method" in req && - "protocol" in req && - "hostname" in req && - "path" in req && - typeof req["query"] === "object" && - typeof req["headers"] === "object"); - } - clone() { - const cloned = new HttpRequest({ - ...this, - headers: { ...this.headers }, - }); - if (cloned.query) - cloned.query = cloneQuery(cloned.query); - return cloned; - } -} -exports.HttpRequest = HttpRequest; -function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param, - }; - }, {}); -} + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; /***/ }), -/***/ 18411: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/axios/lib/helpers/cookies.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/helpers/cookies.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_62336__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpResponse = void 0; -class HttpResponse { - constructor(options) { - this.statusCode = options.statusCode; - this.headers = options.headers || {}; - this.body = options.body; - } - static isInstance(response) { - if (!response) - return false; - const resp = response; - return typeof resp.statusCode === "number" && typeof resp.headers === "object"; - } -} -exports.HttpResponse = HttpResponse; +var utils = __nested_webpack_require_62336__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); -/***/ }), +module.exports = ( + utils.isStandardBrowserEnv() ? -/***/ 35712: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(41816); -tslib_1.__exportStar(__nccwpck_require__(57842), exports); -tslib_1.__exportStar(__nccwpck_require__(34868), exports); -======= -const tslib_1 = __nccwpck_require__(70690); -tslib_1.__exportStar(__nccwpck_require__(42053), exports); -tslib_1.__exportStar(__nccwpck_require__(39203), exports); -tslib_1.__exportStar(__nccwpck_require__(18411), exports); -tslib_1.__exportStar(__nccwpck_require__(20158), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - -/***/ }), - -<<<<<<< HEAD -/***/ 66491: -======= -/***/ 20158: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { + if (utils.isString(path)) { + cookie.push('path=' + path); + } + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_REGION_CONFIG_FILE_OPTIONS = exports.NODE_REGION_CONFIG_OPTIONS = exports.REGION_INI_NAME = exports.REGION_ENV_NAME = void 0; -exports.REGION_ENV_NAME = "AWS_REGION"; -exports.REGION_INI_NAME = "region"; -exports.NODE_REGION_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[exports.REGION_ENV_NAME], - configFileSelector: (profile) => profile[exports.REGION_INI_NAME], - default: () => { - throw new Error("Region is missing"); - }, -}; -exports.NODE_REGION_CONFIG_FILE_OPTIONS = { - preferredFile: "credentials", -}; + if (secure === true) { + cookie.push('secure'); + } + document.cookie = cookie.join('; '); + }, -/***/ }), + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, -<<<<<<< HEAD -/***/ 55962: -======= -/***/ 70690: -/***/ ((module) => { + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : -/****************************************************************************** -Copyright (c) Microsoft Corporation. + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; +/***/ }), - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; +/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": +/*!*********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; +"use strict"; - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); +}; - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; +/***/ }), - __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()); - }); - }; +/***/ "./node_modules/axios/lib/helpers/isAxiosError.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isAxiosError.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; +"use strict"; - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +module.exports = function isAxiosError(payload) { + return (typeof payload === 'object') && (payload.isAxiosError === true); +}; - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; +/***/ }), - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": +/*!***********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_65781__) { - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +"use strict"; - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; +var utils = __nested_webpack_require_65781__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +module.exports = ( + utils.isStandardBrowserEnv() ? - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; + urlParsingNode.setAttribute('href', href); - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; + originURL = resolveURL(window.location.href); - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); +/***/ }), +/***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js": +/*!***************************************************************!*\ + !*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_68512__) { -/***/ }), +"use strict"; -/***/ 27974: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +var utils = __nested_webpack_require_68512__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -exports.getRealRegion = void 0; -const isFipsRegion_1 = __nccwpck_require__(5615); -const getRealRegion = (region) => (0, isFipsRegion_1.isFipsRegion)(region) - ? ["fips-aws-global", "aws-fips"].includes(region) - ? "us-east-1" - : region.replace(/fips-(dkr-|prod-)?|-fips/, "") - : region; -exports.getRealRegion = getRealRegion; -======= -exports.buildQueryString = void 0; -const util_uri_escape_1 = __nccwpck_require__(15592); -function buildQueryString(query) { - const parts = []; - for (let key of Object.keys(query).sort()) { - const value = query[key]; - key = (0, util_uri_escape_1.escapeUri)(key); - if (Array.isArray(value)) { - for (let i = 0, iLen = value.length; i < iLen; i++) { - parts.push(`${key}=${(0, util_uri_escape_1.escapeUri)(value[i])}`); - } - } - else { - let qsEntry = key; - if (value || typeof value === "string") { - qsEntry += `=${(0, util_uri_escape_1.escapeUri)(value)}`; - } - parts.push(qsEntry); - } +module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; } - return parts.join("&"); -} -exports.buildQueryString = buildQueryString; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + }); +}; /***/ }), -<<<<<<< HEAD -/***/ 34868: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -======= -/***/ 59634: -/***/ ((__unused_webpack_module, exports) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ "./node_modules/axios/lib/helpers/parseHeaders.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_69267__) { +"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(41816); -tslib_1.__exportStar(__nccwpck_require__(66491), exports); -tslib_1.__exportStar(__nccwpck_require__(76646), exports); +var utils = __nested_webpack_require_69267__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); -/***/ }), +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; -/***/ 5615: -/***/ ((__unused_webpack_module, exports) => { +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ +module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + if (!headers) { return parsed; } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isFipsRegion = void 0; -const isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")); -exports.isFipsRegion = isFipsRegion; + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); + + return parsed; +}; /***/ }), -/***/ 76646: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/axios/lib/helpers/spread.js": +/*!**************************************************!*\ + !*** ./node_modules/axios/lib/helpers/spread.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { +"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveRegionConfig = void 0; -const getRealRegion_1 = __nccwpck_require__(55962); -const isFipsRegion_1 = __nccwpck_require__(5615); -const resolveRegionConfig = (input) => { - const { region, useFipsEndpoint } = input; - if (!region) { - throw new Error("Region is missing"); - } - return { - ...input, - region: async () => { - if (typeof region === "string") { - return (0, getRealRegion_1.getRealRegion)(region); - } - const providedRegion = await region(); - return (0, getRealRegion_1.getRealRegion)(providedRegion); - }, - useFipsEndpoint: async () => { - const providedRegion = typeof region === "string" ? region : await region(); - if ((0, isFipsRegion_1.isFipsRegion)(providedRegion)) { - return true; - } - return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); - }, - }; + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; }; -exports.resolveRegionConfig = resolveRegionConfig; /***/ }), -/***/ 41816: -/***/ ((module) => { +/***/ "./node_modules/axios/lib/utils.js": +/*!*****************************************!*\ + !*** ./node_modules/axios/lib/utils.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_71883__) { -/****************************************************************************** -Copyright (c) Microsoft Corporation. +"use strict"; -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; +var bind = __nested_webpack_require_71883__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; +/*global toString:true*/ - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; +// utils is a library of generic helper functions non-specific to axios -<<<<<<< HEAD - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; -======= -/***/ 31338: -/***/ ((__unused_webpack_module, exports) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var toString = Object.prototype.toString; - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return toString.call(val) === '[object Array]'; +} - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; +/** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +} - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; +/** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; +} -<<<<<<< HEAD - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; -======= -/***/ 18300: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(val) { + return (typeof FormData !== 'undefined') && (val instanceof FormData); +} - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + } + return result; +} -<<<<<<< HEAD - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; -======= -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isTransientError = exports.isThrottlingError = exports.isClockSkewError = exports.isRetryableByTrait = void 0; -const constants_1 = __nccwpck_require__(31338); -const isRetryableByTrait = (error) => error.$retryable !== undefined; -exports.isRetryableByTrait = isRetryableByTrait; -const isClockSkewError = (error) => constants_1.CLOCK_SKEW_ERROR_CODES.includes(error.name); -exports.isClockSkewError = isClockSkewError; -const isThrottlingError = (error) => { - var _a, _b; - return ((_a = error.$metadata) === null || _a === void 0 ? void 0 : _a.httpStatusCode) === 429 || - constants_1.THROTTLING_ERROR_CODES.includes(error.name) || - ((_b = error.$retryable) === null || _b === void 0 ? void 0 : _b.throttling) == true; -}; -exports.isThrottlingError = isThrottlingError; -const isTransientError = (error) => { - var _a; - return constants_1.TRANSIENT_ERROR_CODES.includes(error.name) || - constants_1.TRANSIENT_ERROR_STATUS_CODES.includes(((_a = error.$metadata) === null || _a === void 0 ? void 0 : _a.httpStatusCode) || 0); -}; -exports.isTransientError = isTransientError; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - __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()); - }); - }; +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} -<<<<<<< HEAD - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; -======= -/***/ 25327: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +/** + * Determine if a value is a plain Object + * + * @param {Object} val The value to test + * @return {boolean} True if value is a plain Object, otherwise false + */ +function isPlainObject(val) { + if (toString.call(val) !== '[object Object]') { + return false; + } -<<<<<<< HEAD - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; -======= -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getConfigFilepath = exports.ENV_CONFIG_PATH = void 0; -const path_1 = __nccwpck_require__(71017); -const getHomeDir_1 = __nccwpck_require__(42713); -exports.ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; -const getConfigFilepath = () => process.env[exports.ENV_CONFIG_PATH] || (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "config"); -exports.getConfigFilepath = getConfigFilepath; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + var prototype = Object.getPrototypeOf(val); + return prototype === null || prototype === Object.prototype; +} - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; +/** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +function isDate(val) { + return toString.call(val) === '[object Date]'; +} - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +/** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +function isFile(val) { + return toString.call(val) === '[object File]'; +} -<<<<<<< HEAD - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; -======= -/***/ 92054: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +function isBlob(val) { + return toString.call(val) === '[object Blob]'; +} - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} -<<<<<<< HEAD - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; -======= -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getCredentialsFilepath = exports.ENV_CREDENTIALS_PATH = void 0; -const path_1 = __nccwpck_require__(71017); -const getHomeDir_1 = __nccwpck_require__(42713); -exports.ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; -const getCredentialsFilepath = () => process.env[exports.ENV_CREDENTIALS_PATH] || (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "credentials"); -exports.getCredentialsFilepath = getCredentialsFilepath; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +/** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; +} - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.replace(/^\s*/, '').replace(/\s*$/, ''); +} -<<<<<<< HEAD - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; -======= -/***/ 42713: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || + navigator.product === 'NativeScript' || + navigator.product === 'NS')) { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (isPlainObject(result[key]) && isPlainObject(val)) { + result[key] = merge(result[key], val); + } else if (isPlainObject(val)) { + result[key] = merge({}, val); + } else if (isArray(val)) { + result[key] = val.slice(); + } else { + result[key] = val; + } + } -<<<<<<< HEAD - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; -======= -/***/ 47238: -/***/ ((__unused_webpack_module, exports) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * @return {string} content value without BOM + */ +function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isPlainObject: isPlainObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim, + stripBOM: stripBOM +}; - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; +/***/ }), - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); +/***/ "./node_modules/axios/package.json": +/*!*****************************************!*\ + !*** ./node_modules/axios/package.json ***! + \*****************************************/ +/*! exports provided: _args, _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _spec, _where, author, browser, bugs, bundlesize, dependencies, description, devDependencies, homepage, jsdelivr, keywords, license, main, name, repository, scripts, typings, unpkg, version, default */ +/***/ (function(module) { +module.exports = JSON.parse("{\"_args\":[[\"axios@0.21.1\",\"/Users/mattober/Repos/ipfs/pinata/open-source-tools/Pinata-SDK\"]],\"_from\":\"axios@0.21.1\",\"_id\":\"axios@0.21.1\",\"_inBundle\":false,\"_integrity\":\"sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==\",\"_location\":\"/axios\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"version\",\"registry\":true,\"raw\":\"axios@0.21.1\",\"name\":\"axios\",\"escapedName\":\"axios\",\"rawSpec\":\"0.21.1\",\"saveSpec\":null,\"fetchSpec\":\"0.21.1\"},\"_requiredBy\":[\"/\"],\"_resolved\":\"https://registry.npmjs.org/axios/-/axios-0.21.1.tgz\",\"_spec\":\"0.21.1\",\"_where\":\"/Users/mattober/Repos/ipfs/pinata/open-source-tools/Pinata-SDK\",\"author\":{\"name\":\"Matt Zabriskie\"},\"browser\":{\"./lib/adapters/http.js\":\"./lib/adapters/xhr.js\"},\"bugs\":{\"url\":\"https://github.com/axios/axios/issues\"},\"bundlesize\":[{\"path\":\"./dist/axios.min.js\",\"threshold\":\"5kB\"}],\"dependencies\":{\"follow-redirects\":\"^1.10.0\"},\"description\":\"Promise based HTTP client for the browser and node.js\",\"devDependencies\":{\"bundlesize\":\"^0.17.0\",\"coveralls\":\"^3.0.0\",\"es6-promise\":\"^4.2.4\",\"grunt\":\"^1.0.2\",\"grunt-banner\":\"^0.6.0\",\"grunt-cli\":\"^1.2.0\",\"grunt-contrib-clean\":\"^1.1.0\",\"grunt-contrib-watch\":\"^1.0.0\",\"grunt-eslint\":\"^20.1.0\",\"grunt-karma\":\"^2.0.0\",\"grunt-mocha-test\":\"^0.13.3\",\"grunt-ts\":\"^6.0.0-beta.19\",\"grunt-webpack\":\"^1.0.18\",\"istanbul-instrumenter-loader\":\"^1.0.0\",\"jasmine-core\":\"^2.4.1\",\"karma\":\"^1.3.0\",\"karma-chrome-launcher\":\"^2.2.0\",\"karma-coverage\":\"^1.1.1\",\"karma-firefox-launcher\":\"^1.1.0\",\"karma-jasmine\":\"^1.1.1\",\"karma-jasmine-ajax\":\"^0.1.13\",\"karma-opera-launcher\":\"^1.0.0\",\"karma-safari-launcher\":\"^1.0.0\",\"karma-sauce-launcher\":\"^1.2.0\",\"karma-sinon\":\"^1.0.5\",\"karma-sourcemap-loader\":\"^0.3.7\",\"karma-webpack\":\"^1.7.0\",\"load-grunt-tasks\":\"^3.5.2\",\"minimist\":\"^1.2.0\",\"mocha\":\"^5.2.0\",\"sinon\":\"^4.5.0\",\"typescript\":\"^2.8.1\",\"url-search-params\":\"^0.10.0\",\"webpack\":\"^1.13.1\",\"webpack-dev-server\":\"^1.14.1\"},\"homepage\":\"https://github.com/axios/axios\",\"jsdelivr\":\"dist/axios.min.js\",\"keywords\":[\"xhr\",\"http\",\"ajax\",\"promise\",\"node\"],\"license\":\"MIT\",\"main\":\"index.js\",\"name\":\"axios\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/axios/axios.git\"},\"scripts\":{\"build\":\"NODE_ENV=production grunt build\",\"coveralls\":\"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\"examples\":\"node ./examples/server.js\",\"fix\":\"eslint --fix lib/**/*.js\",\"postversion\":\"git push && git push --tags\",\"preversion\":\"npm test\",\"start\":\"node ./sandbox/server.js\",\"test\":\"grunt test && bundlesize\",\"version\":\"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\"},\"typings\":\"./index.d.ts\",\"unpkg\":\"dist/axios.min.js\",\"version\":\"0.21.1\"}"); /***/ }), -<<<<<<< HEAD -/***/ 51846: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/babel-polyfill/lib/index.js": +/*!**************************************************!*\ + !*** ./node_modules/babel-polyfill/lib/index.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_84831__) { +"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SignatureV4MultiRegion = void 0; -const middleware_sdk_s3_1 = __nccwpck_require__(52776); -const signature_v4_crt_container_1 = __nccwpck_require__(8312); -======= -/***/ 61870: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +__nested_webpack_require_84831__(/*! core-js/shim */ "./node_modules/core-js/shim.js"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getProfileName = exports.DEFAULT_PROFILE = exports.ENV_PROFILE = void 0; -exports.ENV_PROFILE = "AWS_PROFILE"; -exports.DEFAULT_PROFILE = "default"; -const getProfileName = (init) => init.profile || process.env[exports.ENV_PROFILE] || exports.DEFAULT_PROFILE; -exports.getProfileName = getProfileName; +__nested_webpack_require_84831__(/*! regenerator-runtime/runtime */ "./node_modules/regenerator-runtime/runtime.js"); + +__nested_webpack_require_84831__(/*! core-js/fn/regexp/escape */ "./node_modules/core-js/fn/regexp/escape.js"); + +if (global._babelPolyfill) { + throw new Error("only one instance of babel-polyfill is allowed"); +} +global._babelPolyfill = true; + +var DEFINE_PROPERTY = "defineProperty"; +function define(O, key, value) { + O[key] || Object[DEFINE_PROPERTY](O, key, { + writable: true, + configurable: true, + value: value + }); +} + +define(String.prototype, "padLeft", "".padStart); +define(String.prototype, "padRight", "".padEnd); +"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function (key) { + [][key] && define(Array, key, Function.call.bind([][key])); +}); /***/ }), -/***/ 18490: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/base-path-converter/index.js": +/*!***************************************************!*\ + !*** ./node_modules/base-path-converter/index.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -"use strict"; +function convertFilePathToBaseDirectoryPath(sourcePath, filePath) { + let newString = (sourcePath.startsWith('./') ? sourcePath.substring(2) : sourcePath); + //make sure there isn't a dangling / to throw a false positive into the mix + const lastIndexOfDirectory = newString.lastIndexOf('/'); + if(lastIndexOfDirectory === -1) { + return filePath; + } + const lengthOfSource = sourcePath.length; + //only trim if the / is the last character in the string + if (lastIndexOfDirectory === (lengthOfSource - 1)) { + newString = sourcePath.slice(0,-1); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSSOTokenFilepath = void 0; -const crypto_1 = __nccwpck_require__(6113); -const path_1 = __nccwpck_require__(71017); -const getHomeDir_1 = __nccwpck_require__(42713); -const getSSOTokenFilepath = (ssoStartUrl) => { - const hasher = (0, crypto_1.createHash)("sha1"); - const cacheName = hasher.update(ssoStartUrl).digest("hex"); - return (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "sso", "cache", `${cacheName}.json`); -}; -exports.getSSOTokenFilepath = getSSOTokenFilepath; + //now that we're sure of no false positive, let's check and see where the "root" directory is + const newLastIndex = newString.lastIndexOf('/'); + if ( newLastIndex === -1) { + return newString; + } else { + const pathGarbage = newString.substring(0, newLastIndex + 1); + newString = filePath.split(pathGarbage)[1]; + } + + return newString; +} +module.exports = convertFilePathToBaseDirectoryPath /***/ }), -/***/ 57892: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/base-x/src/index.js": +/*!******************************************!*\ + !*** ./node_modules/base-x/src/index.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_87443__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSSOTokenFromFile = void 0; -const fs_1 = __nccwpck_require__(57147); -const getSSOTokenFilepath_1 = __nccwpck_require__(18490); -const { readFile } = fs_1.promises; -const getSSOTokenFromFile = async (ssoStartUrl) => { - const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(ssoStartUrl); - const ssoTokenText = await readFile(ssoTokenFilepath, "utf8"); - return JSON.parse(ssoTokenText); -}; -exports.getSSOTokenFromFile = getSSOTokenFromFile; +// base-x encoding / decoding +// Copyright (c) 2018 base-x contributors +// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) +// Distributed under the MIT software license, see the accompanying +// file LICENSE or http://www.opensource.org/licenses/mit-license.php. +// @ts-ignore +var _Buffer = __nested_webpack_require_87443__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer +function base (ALPHABET) { + if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } + var BASE_MAP = new Uint8Array(256) + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255 + } + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i) + var xc = x.charCodeAt(0) + if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') } + BASE_MAP[xc] = i + } + var BASE = ALPHABET.length + var LEADER = ALPHABET.charAt(0) + var FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up + var iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up + function encode (source) { + if (Array.isArray(source) || source instanceof Uint8Array) { source = _Buffer.from(source) } + if (!_Buffer.isBuffer(source)) { throw new TypeError('Expected Buffer') } + if (source.length === 0) { return '' } + // Skip & count leading zeroes. + var zeroes = 0 + var length = 0 + var pbegin = 0 + var pend = source.length + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++ + zeroes++ + } + // Allocate enough space in big-endian base58 representation. + var size = ((pend - pbegin) * iFACTOR + 1) >>> 0 + var b58 = new Uint8Array(size) + // Process the bytes. + while (pbegin !== pend) { + var carry = source[pbegin] + // Apply "b58 = b58 * 256 + ch". + var i = 0 + for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { + carry += (256 * b58[it1]) >>> 0 + b58[it1] = (carry % BASE) >>> 0 + carry = (carry / BASE) >>> 0 + } + if (carry !== 0) { throw new Error('Non-zero carry') } + length = i + pbegin++ + } + // Skip leading zeroes in base58 result. + var it2 = size - length + while (it2 !== size && b58[it2] === 0) { + it2++ + } + // Translate the result into a string. + var str = LEADER.repeat(zeroes) + for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]) } + return str + } + function decodeUnsafe (source) { + if (typeof source !== 'string') { throw new TypeError('Expected String') } + if (source.length === 0) { return _Buffer.alloc(0) } + var psz = 0 + // Skip leading spaces. + if (source[psz] === ' ') { return } + // Skip and count leading '1's. + var zeroes = 0 + var length = 0 + while (source[psz] === LEADER) { + zeroes++ + psz++ + } + // Allocate enough space in big-endian base256 representation. + var size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up. + var b256 = new Uint8Array(size) + // Process the characters. + while (source[psz]) { + // Decode character + var carry = BASE_MAP[source.charCodeAt(psz)] + // Invalid character + if (carry === 255) { return } + var i = 0 + for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { + carry += (BASE * b256[it3]) >>> 0 + b256[it3] = (carry % 256) >>> 0 + carry = (carry / 256) >>> 0 + } + if (carry !== 0) { throw new Error('Non-zero carry') } + length = i + psz++ + } + // Skip trailing spaces. + if (source[psz] === ' ') { return } + // Skip leading zeroes in b256. + var it4 = size - length + while (it4 !== size && b256[it4] === 0) { + it4++ + } + var vch = _Buffer.allocUnsafe(zeroes + (size - it4)) + vch.fill(0x00, 0, zeroes) + var j = zeroes + while (it4 !== size) { + vch[j++] = b256[it4++] + } + return vch + } + function decode (string) { + var buffer = decodeUnsafe(string) + if (buffer) { return buffer } + throw new Error('Non-base' + BASE + ' character') + } + return { + encode: encode, + decodeUnsafe: decodeUnsafe, + decode: decode + } +} +module.exports = base /***/ }), -/***/ 93378: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/bs58/index.js": +/*!************************************!*\ + !*** ./node_modules/bs58/index.js ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_91968__) { -"use strict"; +var basex = __nested_webpack_require_91968__(/*! base-x */ "./node_modules/base-x/src/index.js") +var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(16642); -tslib_1.__exportStar(__nccwpck_require__(42713), exports); -tslib_1.__exportStar(__nccwpck_require__(61870), exports); -tslib_1.__exportStar(__nccwpck_require__(18490), exports); -tslib_1.__exportStar(__nccwpck_require__(57892), exports); -tslib_1.__exportStar(__nccwpck_require__(81669), exports); -tslib_1.__exportStar(__nccwpck_require__(54638), exports); -tslib_1.__exportStar(__nccwpck_require__(39765), exports); +module.exports = basex(ALPHABET) /***/ }), -/***/ 81669: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/cids/src/cid-util.js": +/*!*******************************************!*\ + !*** ./node_modules/cids/src/cid-util.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_92454__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.loadSharedConfigFiles = void 0; -const getConfigFilepath_1 = __nccwpck_require__(25327); -const getCredentialsFilepath_1 = __nccwpck_require__(92054); -const getProfileData_1 = __nccwpck_require__(47238); -const parseIni_1 = __nccwpck_require__(66130); -const slurpFile_1 = __nccwpck_require__(9900); -const swallowError = () => ({}); -const loadSharedConfigFiles = async (init = {}) => { - const { filepath = (0, getCredentialsFilepath_1.getCredentialsFilepath)(), configFilepath = (0, getConfigFilepath_1.getConfigFilepath)() } = init; - const parsedFiles = await Promise.all([ - (0, slurpFile_1.slurpFile)(configFilepath).then(parseIni_1.parseIni).then(getProfileData_1.getProfileData).catch(swallowError), - (0, slurpFile_1.slurpFile)(filepath).then(parseIni_1.parseIni).catch(swallowError), - ]); - return { - configFile: parsedFiles[0], - credentialsFile: parsedFiles[1], - }; -}; -exports.loadSharedConfigFiles = loadSharedConfigFiles; +const mh = __nested_webpack_require_92454__(/*! multihashes */ "./node_modules/multihashes/src/index.js") -/***/ }), +var CIDUtil = { + /** + * Test if the given input is a valid CID object. + * Returns an error message if it is not. + * Returns undefined if it is a valid CID. + * + * @param {any} other + * @returns {string} + */ + checkCIDComponents: function (other) { + if (other == null) { + return 'null values are not valid CIDs' + } -/***/ 66130: -/***/ ((__unused_webpack_module, exports) => { + if (!(other.version === 0 || other.version === 1)) { + return 'Invalid version, must be a number equal to 1 or 0' + } -"use strict"; + if (typeof other.codec !== 'string') { + return 'codec must be string' + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseIni = void 0; -const profileNameBlockList = ["__proto__", "profile __proto__"]; -const parseIni = (iniData) => { - const map = {}; - let currentSection; - for (let line of iniData.split(/\r?\n/)) { - line = line.split(/(^|\s)[;#]/)[0].trim(); - const isSection = line[0] === "[" && line[line.length - 1] === "]"; - if (isSection) { - currentSection = line.substring(1, line.length - 1); - if (profileNameBlockList.includes(currentSection)) { - throw new Error(`Found invalid profile name "${currentSection}"`); - } - } - else if (currentSection) { - const indexOfEqualsSign = line.indexOf("="); - const start = 0; - const end = line.length - 1; - const isAssignment = indexOfEqualsSign !== -1 && indexOfEqualsSign !== start && indexOfEqualsSign !== end; - if (isAssignment) { - const [name, value] = [ - line.substring(0, indexOfEqualsSign).trim(), - line.substring(indexOfEqualsSign + 1).trim(), - ]; - map[currentSection] = map[currentSection] || {}; - map[currentSection][name] = value; - } - } + if (other.version === 0) { + if (other.codec !== 'dag-pb') { + return "codec must be 'dag-pb' for CIDv0" + } + if (other.multibaseName !== 'base58btc') { + return "multibaseName must be 'base58btc' for CIDv0" + } } - return map; -}; -exports.parseIni = parseIni; + + if (!Buffer.isBuffer(other.multihash)) { + return 'multihash must be a Buffer' + } + + try { + mh.validate(other.multihash) + } catch (err) { + let errorMsg = err.message + if (!errorMsg) { // Just in case mh.validate() throws an error with empty error message + errorMsg = 'Multihash validation failed' + } + return errorMsg + } + } +} + +module.exports = CIDUtil /***/ }), -/***/ 54638: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/cids/src/index.js": +/*!****************************************!*\ + !*** ./node_modules/cids/src/index.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_94054__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseKnownFiles = void 0; -const loadSharedConfigFiles_1 = __nccwpck_require__(81669); -const parseKnownFiles = async (init) => { - const parsedFiles = await (0, loadSharedConfigFiles_1.loadSharedConfigFiles)(init); - return { - ...parsedFiles.configFile, - ...parsedFiles.credentialsFile, - }; -}; -exports.parseKnownFiles = parseKnownFiles; +const mh = __nested_webpack_require_94054__(/*! multihashes */ "./node_modules/multihashes/src/index.js") +const multibase = __nested_webpack_require_94054__(/*! multibase */ "./node_modules/multibase/src/index.js") +const multicodec = __nested_webpack_require_94054__(/*! multicodec */ "./node_modules/multicodec/src/index.js") +const codecs = __nested_webpack_require_94054__(/*! multicodec/src/base-table.json */ "./node_modules/multicodec/src/base-table.json") +const CIDUtil = __nested_webpack_require_94054__(/*! ./cid-util */ "./node_modules/cids/src/cid-util.js") +const withIs = __nested_webpack_require_94054__(/*! class-is */ "./node_modules/class-is/index.js") -/***/ }), +/** + * @typedef {Object} SerializedCID + * @param {string} codec + * @param {number} version + * @param {Buffer} multihash + */ -/***/ 9900: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/** + * Test if the given input is a CID. + * @function isCID + * @memberof CID + * @static + * @param {any} other + * @returns {bool} + */ -"use strict"; +/** + * Class representing a CID `` + * , as defined in [ipld/cid](https://github.com/multiformats/cid). + * @class CID + */ +class CID { + /** + * Create a new CID. + * + * The algorithm for argument input is roughly: + * ``` + * if (cid) + * -> create a copy + * else if (str) + * if (1st char is on multibase table) -> CID String + * else -> bs58 encoded multihash + * else if (Buffer) + * if (1st byte is 0 or 1) -> CID + * else -> multihash + * else if (Number) + * -> construct CID by parts + * ``` + * + * @param {string|Buffer|CID} version + * @param {string} [codec] + * @param {Buffer} [multihash] + * @param {string} [multibaseName] + * + * @example + * new CID(, , , ) + * new CID() + * new CID() + * new CID() + * new CID() + * new CID() + */ + constructor (version, codec, multihash, multibaseName) { + if (_CID.isCID(version)) { + // version is an exising CID instance + const cid = version + this.version = cid.version + this.codec = cid.codec + this.multihash = Buffer.from(cid.multihash) + // Default guard for when a CID < 0.7 is passed with no multibaseName + this.multibaseName = cid.multibaseName || (cid.version === 0 ? 'base58btc' : 'base32') + return + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.slurpFile = void 0; -const fs_1 = __nccwpck_require__(57147); -const { readFile } = fs_1.promises; -const filePromisesHash = {}; -const slurpFile = (path) => { - if (!filePromisesHash[path]) { - filePromisesHash[path] = readFile(path, "utf8"); + if (typeof version === 'string') { + // e.g. 'base32' or false + const baseName = multibase.isEncoded(version) + if (baseName) { + // version is a CID String encoded with multibase, so v1 + const cid = multibase.decode(version) + this.version = parseInt(cid.slice(0, 1).toString('hex'), 16) + this.codec = multicodec.getCodec(cid.slice(1)) + this.multihash = multicodec.rmPrefix(cid.slice(1)) + this.multibaseName = baseName + } else { + // version is a base58btc string multihash, so v0 + this.version = 0 + this.codec = 'dag-pb' + this.multihash = mh.fromB58String(version) + this.multibaseName = 'base58btc' + } + CID.validateCID(this) + Object.defineProperty(this, 'string', { value: version }) + return } - return filePromisesHash[path]; -}; -exports.slurpFile = slurpFile; + if (Buffer.isBuffer(version)) { + const firstByte = version.slice(0, 1) + const v = parseInt(firstByte.toString('hex'), 16) + if (v === 1) { + // version is a CID buffer + const cid = version + this.version = v + this.codec = multicodec.getCodec(cid.slice(1)) + this.multihash = multicodec.rmPrefix(cid.slice(1)) + this.multibaseName = 'base32' + } else { + // version is a raw multihash buffer, so v0 + this.version = 0 + this.codec = 'dag-pb' + this.multihash = version + this.multibaseName = 'base58btc' + } + CID.validateCID(this) + return + } -/***/ }), + // otherwise, assemble the CID from the parameters -/***/ 39765: -/***/ ((__unused_webpack_module, exports) => { + /** + * @type {number} + */ + this.version = version -"use strict"; + /** + * @type {string} + */ + this.codec = codec -Object.defineProperty(exports, "__esModule", ({ value: true })); + /** + * @type {Buffer} + */ + this.multihash = multihash + /** + * @type {string} + */ + this.multibaseName = multibaseName || (version === 0 ? 'base58btc' : 'base32') -/***/ }), + CID.validateCID(this) + } -/***/ 16642: -/***/ ((module) => { + /** + * The CID as a `Buffer` + * + * @return {Buffer} + * @readonly + * + * @memberOf CID + */ + get buffer () { + let buffer = this._buffer -/****************************************************************************** -Copyright (c) Microsoft Corporation. + if (!buffer) { + if (this.version === 0) { + buffer = this.multihash + } else if (this.version === 1) { + buffer = Buffer.concat([ + Buffer.from('01', 'hex'), + multicodec.getCodeVarint(this.codec), + this.multihash + ]) + } else { + throw new Error('unsupported version') + } -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. + // Cache this buffer so it doesn't have to be recreated + Object.defineProperty(this, '_buffer', { value: buffer }) + } -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + return buffer + } + + /** + * Get the prefix of the CID. + * + * @returns {Buffer} + * @readonly + */ + get prefix () { + return Buffer.concat([ + Buffer.from(`0${this.version}`, 'hex'), + multicodec.getCodeVarint(this.codec), + mh.prefix(this.multihash) + ]) + } + + /** + * Convert to a CID of version `0`. + * + * @returns {CID} + */ + toV0 () { + if (this.codec !== 'dag-pb') { + throw new Error('Cannot convert a non dag-pb CID to CIDv0') } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); + + const { name, length } = mh.decode(this.multihash) + + if (name !== 'sha2-256') { + throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') } - else { - factory(createExporter(root)); + + if (length !== 32) { + throw new Error('Cannot convert non 32 byte multihash CID to CIDv0') } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + + return new _CID(0, this.codec, this.multihash) + } + + /** + * Convert to a CID of version `1`. + * + * @returns {CID} + */ + toV1 () { + return new _CID(1, this.codec, this.multihash) + } + + /** + * Encode the CID into a string. + * + * @param {string} [base=this.multibaseName] - Base encoding to use. + * @returns {string} + */ + toBaseEncodedString (base = this.multibaseName) { + if (this.string && base === this.multibaseName) { + return this.string } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + let str = null + if (this.version === 0) { + if (base !== 'base58btc') { + throw new Error('not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()') + } + str = mh.toB58String(this.multihash) + } else if (this.version === 1) { + str = multibase.encode(base, this.buffer).toString() + } else { + throw new Error('unsupported version') + } + if (base === this.multibaseName) { + // cache the string value + Object.defineProperty(this, 'string', { value: str }) + } + return str + } - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; + toString (base) { + return this.toBaseEncodedString(base) + } - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; + /** + * Serialize to a plain object. + * + * @returns {SerializedCID} + */ + toJSON () { + return { + codec: this.codec, + version: this.version, + hash: this.multihash + } + } - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; + /** + * Compare equality with another CID. + * + * @param {CID} other + * @returns {bool} + */ + equals (other) { + return this.codec === other.codec && + this.version === other.version && + this.multihash.equals(other.multihash) + } - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; + /** + * Test if the given input is a valid CID object. + * Throws if it is not. + * + * @param {any} other + * @returns {void} + */ + static validateCID (other) { + const errorMsg = CIDUtil.checkCIDComponents(other) + if (errorMsg) { + throw new Error(errorMsg) + } + } +} - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +const _CID = withIs(CID, { + className: 'CID', + symbolName: '@ipld/js-cid/CID' +}) - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; +_CID.codecs = codecs - __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()); - }); - }; +module.exports = _CID - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +/***/ }), - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +/***/ "./node_modules/class-is/index.js": +/*!****************************************!*\ + !*** ./node_modules/class-is/index.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; +"use strict"; - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +function withIs(Class, { className, symbolName }) { + const symbol = Symbol.for(symbolName); - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; + const ClassIsWrapper = { + // The code below assigns the class wrapper to an object to trick + // JavaScript engines to show the name of the extended class when + // logging an instances. + // We are assigning an anonymous class (class wrapper) to the object + // with key `className` to keep the correct name. + // If this is not supported it falls back to logging `ClassIsWrapper`. + [className]: class extends Class { + constructor(...args) { + super(...args); + Object.defineProperty(this, symbol, { value: true }); + } - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; + get [Symbol.toStringTag]() { + return className; } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; + }, + }[className]; - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; + ClassIsWrapper[`is${className}`] = (obj) => !!(obj && obj[symbol]); - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; + return ClassIsWrapper; +} - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; +function withIsProto(Class, { className, symbolName, withoutNew }) { + const symbol = Symbol.for(symbolName); - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; + /* eslint-disable object-shorthand */ + const ClassIsWrapper = { + [className]: function (...args) { + if (withoutNew && !(this instanceof ClassIsWrapper)) { + return new ClassIsWrapper(...args); + } - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; + const _this = Class.call(this, ...args) || this; - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; + if (_this && !_this[symbol]) { + Object.defineProperty(_this, symbol, { value: true }); + } - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; + return _this; + }, + }[className]; + /* eslint-enable object-shorthand */ - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; + ClassIsWrapper.prototype = Object.create(Class.prototype); + ClassIsWrapper.prototype.constructor = ClassIsWrapper; - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; + Object.defineProperty(ClassIsWrapper.prototype, Symbol.toStringTag, { + get() { + return className; + }, + }); - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; + ClassIsWrapper[`is${className}`] = (obj) => !!(obj && obj[symbol]); - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; + return ClassIsWrapper; +} - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); +module.exports = withIs; +module.exports.proto = withIsProto; /***/ }), -/***/ 54583: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/combined-stream/lib/combined_stream.js": +/*!*************************************************************!*\ + !*** ./node_modules/combined-stream/lib/combined_stream.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_104270__) { -"use strict"; +var util = __nested_webpack_require_104270__(/*! util */ "util"); +var Stream = __nested_webpack_require_104270__(/*! stream */ "stream").Stream; +var DelayedStream = __nested_webpack_require_104270__(/*! delayed-stream */ "./node_modules/delayed-stream/lib/delayed_stream.js"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SignatureV4MultiRegion = void 0; -const signature_v4_1 = __nccwpck_require__(30849); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -class SignatureV4MultiRegion { - constructor(options) { - this.sigv4Signer = new middleware_sdk_s3_1.SignatureV4S3Express(options); - this.signerOptions = options; - } - async sign(requestToSign, options = {}) { - if (options.signingRegion === "*") { - if (this.signerOptions.runtime !== "node") - throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js"); - return this.getSigv4aSigner().sign(requestToSign, options); - } - return this.sigv4Signer.sign(requestToSign, options); - } - async signWithCredentials(requestToSign, credentials, options = {}) { - if (options.signingRegion === "*") { - if (this.signerOptions.runtime !== "node") - throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js"); - return this.getSigv4aSigner().signWithCredentials(requestToSign, credentials, options); - } - return this.sigv4Signer.signWithCredentials(requestToSign, credentials, options); - } - async presign(originalRequest, options = {}) { - if (options.signingRegion === "*") { - if (this.signerOptions.runtime !== "node") - throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js"); - return this.getSigv4aSigner().presign(originalRequest, options); - } - return this.sigv4Signer.presign(originalRequest, options); - } - async presignWithCredentials(originalRequest, credentials, options = {}) { - if (options.signingRegion === "*") { - throw new Error("Method presignWithCredentials is not supported for [signingRegion=*]."); - } - return this.sigv4Signer.presignWithCredentials(originalRequest, credentials, options); - } - getSigv4aSigner() { - if (!this.sigv4aSigner) { - let CrtSignerV4 = null; - try { -<<<<<<< HEAD - CrtSignerV4 = signature_v4_crt_container_1.signatureV4CrtContainer.CrtSignerV4; -======= - CrtSignerV4 = true && (__nccwpck_require__(35949).CrtSignerV4); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - if (typeof CrtSignerV4 !== "function") - throw new Error(); - } - catch (e) { - e.message = - `${e.message}\n` + - `Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. \n` + - `You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] ` + - `or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. \n` + - "For more information please go to " + - "https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt"; - throw e; - } - this.sigv4aSigner = new CrtSignerV4({ - ...this.signerOptions, - signingAlgorithm: 1, - }); - } - return this.sigv4aSigner; - } -} -exports.SignatureV4MultiRegion = SignatureV4MultiRegion; +module.exports = CombinedStream; +function CombinedStream() { + this.writable = false; + this.readable = true; + this.dataSize = 0; + this.maxDataSize = 2 * 1024 * 1024; + this.pauseStreams = true; + this._released = false; + this._streams = []; + this._currentStream = null; + this._insideLoop = false; + this._pendingNext = false; +} +util.inherits(CombinedStream, Stream); -/***/ }), +CombinedStream.create = function(options) { + var combinedStream = new this(); -<<<<<<< HEAD -/***/ 8149: -======= -/***/ 96037: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + options = options || {}; + for (var option in options) { + combinedStream[option] = options[option]; + } + return combinedStream; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(13752); -tslib_1.__exportStar(__nccwpck_require__(51846), exports); -tslib_1.__exportStar(__nccwpck_require__(8312), exports); -======= -const tslib_1 = __nccwpck_require__(43571); -tslib_1.__exportStar(__nccwpck_require__(54583), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +CombinedStream.isStreamLike = function(stream) { + return (typeof stream !== 'function') + && (typeof stream !== 'string') + && (typeof stream !== 'boolean') + && (typeof stream !== 'number') + && (!Buffer.isBuffer(stream)); +}; +CombinedStream.prototype.append = function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); -/***/ }), + if (isStreamLike) { + if (!(stream instanceof DelayedStream)) { + var newStream = DelayedStream.create(stream, { + maxDataSize: Infinity, + pauseStream: this.pauseStreams, + }); + stream.on('data', this._checkDataSize.bind(this)); + stream = newStream; + } -<<<<<<< HEAD -/***/ 8312: -/***/ ((__unused_webpack_module, exports) => { + this._handleErrors(stream); + if (this.pauseStreams) { + stream.pause(); + } + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.signatureV4CrtContainer = void 0; -exports.signatureV4CrtContainer = { - CrtSignerV4: null, + this._streams.push(stream); + return this; }; +CombinedStream.prototype.pipe = function(dest, options) { + Stream.prototype.pipe.call(this, dest, options); + this.resume(); + return dest; +}; -/***/ }), +CombinedStream.prototype._getNext = function() { + this._currentStream = null; -/***/ 13752: -======= -/***/ 43571: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { + if (this._insideLoop) { + this._pendingNext = true; + return; // defer call + } -/****************************************************************************** -Copyright (c) Microsoft Corporation. + this._insideLoop = true; + try { + do { + this._pendingNext = false; + this._realGetNext(); + } while (this._pendingNext); + } finally { + this._insideLoop = false; + } +}; -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. +CombinedStream.prototype._realGetNext = function() { + var stream = this._streams.shift(); -<<<<<<< HEAD -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); -======= -/***/ }), -/***/ 84562: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (typeof stream == 'undefined') { + this.end(); + return; + } -"use strict"; + if (typeof stream !== 'function') { + this._pipeNext(stream); + return; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SignatureV4 = void 0; -const util_hex_encoding_1 = __nccwpck_require__(34180); -const util_middleware_1 = __nccwpck_require__(23837); -const constants_1 = __nccwpck_require__(4047); -const credentialDerivation_1 = __nccwpck_require__(65194); -const getCanonicalHeaders_1 = __nccwpck_require__(1450); -const getCanonicalQuery_1 = __nccwpck_require__(26169); -const getPayloadHash_1 = __nccwpck_require__(16176); -const headerUtil_1 = __nccwpck_require__(80586); -const moveHeadersToQuery_1 = __nccwpck_require__(59993); -const prepareRequest_1 = __nccwpck_require__(15495); -const utilDate_1 = __nccwpck_require__(98472); -class SignatureV4 { - constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true, }) { - this.service = service; - this.sha256 = sha256; - this.uriEscapePath = uriEscapePath; - this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true; - this.regionProvider = (0, util_middleware_1.normalizeProvider)(region); - this.credentialProvider = (0, util_middleware_1.normalizeProvider)(credentials); - } - async presign(originalRequest, options = {}) { - const { signingDate = new Date(), expiresIn = 3600, unsignableHeaders, unhoistableHeaders, signableHeaders, signingRegion, signingService, } = options; - const credentials = await this.credentialProvider(); - const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); - const { longDate, shortDate } = formatDate(signingDate); - if (expiresIn > constants_1.MAX_PRESIGNED_TTL) { - return Promise.reject("Signature version 4 presigned URLs" + " must have an expiration date less than one week in" + " the future"); - } - const scope = (0, credentialDerivation_1.createScope)(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service); - const request = (0, moveHeadersToQuery_1.moveHeadersToQuery)((0, prepareRequest_1.prepareRequest)(originalRequest), { unhoistableHeaders }); - if (credentials.sessionToken) { - request.query[constants_1.TOKEN_QUERY_PARAM] = credentials.sessionToken; - } - request.query[constants_1.ALGORITHM_QUERY_PARAM] = constants_1.ALGORITHM_IDENTIFIER; - request.query[constants_1.CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`; - request.query[constants_1.AMZ_DATE_QUERY_PARAM] = longDate; - request.query[constants_1.EXPIRES_QUERY_PARAM] = expiresIn.toString(10); - const canonicalHeaders = (0, getCanonicalHeaders_1.getCanonicalHeaders)(request, unsignableHeaders, signableHeaders); - request.query[constants_1.SIGNED_HEADERS_QUERY_PARAM] = getCanonicalHeaderList(canonicalHeaders); - request.query[constants_1.SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, await (0, getPayloadHash_1.getPayloadHash)(originalRequest, this.sha256))); - return request; - } - async sign(toSign, options) { - if (typeof toSign === "string") { - return this.signString(toSign, options); - } - else if (toSign.headers && toSign.payload) { - return this.signEvent(toSign, options); - } - else { - return this.signRequest(toSign, options); - } - } - async signEvent({ headers, payload }, { signingDate = new Date(), priorSignature, signingRegion, signingService }) { - const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); - const { shortDate, longDate } = formatDate(signingDate); - const scope = (0, credentialDerivation_1.createScope)(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service); - const hashedPayload = await (0, getPayloadHash_1.getPayloadHash)({ headers: {}, body: payload }, this.sha256); - const hash = new this.sha256(); - hash.update(headers); - const hashedHeaders = (0, util_hex_encoding_1.toHex)(await hash.digest()); - const stringToSign = [ - constants_1.EVENT_ALGORITHM_IDENTIFIER, - longDate, - scope, - priorSignature, - hashedHeaders, - hashedPayload, - ].join("\n"); - return this.signString(stringToSign, { signingDate, signingRegion: region, signingService }); - } - async signString(stringToSign, { signingDate = new Date(), signingRegion, signingService } = {}) { - const credentials = await this.credentialProvider(); - const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); - const { shortDate } = formatDate(signingDate); - const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService)); - hash.update(stringToSign); - return (0, util_hex_encoding_1.toHex)(await hash.digest()); - } - async signRequest(requestToSign, { signingDate = new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService, } = {}) { - const credentials = await this.credentialProvider(); - const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); - const request = (0, prepareRequest_1.prepareRequest)(requestToSign); - const { longDate, shortDate } = formatDate(signingDate); - const scope = (0, credentialDerivation_1.createScope)(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service); - request.headers[constants_1.AMZ_DATE_HEADER] = longDate; - if (credentials.sessionToken) { - request.headers[constants_1.TOKEN_HEADER] = credentials.sessionToken; - } - const payloadHash = await (0, getPayloadHash_1.getPayloadHash)(request, this.sha256); - if (!(0, headerUtil_1.hasHeader)(constants_1.SHA256_HEADER, request.headers) && this.applyChecksum) { - request.headers[constants_1.SHA256_HEADER] = payloadHash; - } - const canonicalHeaders = (0, getCanonicalHeaders_1.getCanonicalHeaders)(request, unsignableHeaders, signableHeaders); - const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, payloadHash)); - request.headers[constants_1.AUTH_HEADER] = - `${constants_1.ALGORITHM_IDENTIFIER} ` + - `Credential=${credentials.accessKeyId}/${scope}, ` + - `SignedHeaders=${getCanonicalHeaderList(canonicalHeaders)}, ` + - `Signature=${signature}`; - return request; + var getStream = stream; + getStream(function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('data', this._checkDataSize.bind(this)); + this._handleErrors(stream); } - createCanonicalRequest(request, canonicalHeaders, payloadHash) { - const sortedHeaders = Object.keys(canonicalHeaders).sort(); - return `${request.method} -${this.getCanonicalPath(request)} -${(0, getCanonicalQuery_1.getCanonicalQuery)(request)} -${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")} -${sortedHeaders.join(";")} -${payloadHash}`; - } - async createStringToSign(longDate, credentialScope, canonicalRequest) { - const hash = new this.sha256(); - hash.update(canonicalRequest); - const hashedRequest = await hash.digest(); - return `${constants_1.ALGORITHM_IDENTIFIER} -${longDate} -${credentialScope} -${(0, util_hex_encoding_1.toHex)(hashedRequest)}`; - } - getCanonicalPath({ path }) { - if (this.uriEscapePath) { - const normalizedPathSegments = []; - for (const pathSegment of path.split("/")) { - if ((pathSegment === null || pathSegment === void 0 ? void 0 : pathSegment.length) === 0) - continue; - if (pathSegment === ".") - continue; - if (pathSegment === "..") { - normalizedPathSegments.pop(); - } - else { - normalizedPathSegments.push(pathSegment); - } - } - const normalizedPath = `${(path === null || path === void 0 ? void 0 : path.startsWith("/")) ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && (path === null || path === void 0 ? void 0 : path.endsWith("/")) ? "/" : ""}`; - const doubleEncoded = encodeURIComponent(normalizedPath); - return doubleEncoded.replace(/%2F/g, "/"); - } - return path; - } - async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) { - const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest); - const hash = new this.sha256(await keyPromise); - hash.update(stringToSign); - return (0, util_hex_encoding_1.toHex)(await hash.digest()); - } - getSigningKey(credentials, region, shortDate, service) { - return (0, credentialDerivation_1.getSigningKey)(this.sha256, credentials, shortDate, region, service || this.service); - } -} -exports.SignatureV4 = SignatureV4; -const formatDate = (now) => { - const longDate = (0, utilDate_1.iso8601)(now).replace(/[\-:]/g, ""); - return { - longDate, - shortDate: longDate.slice(0, 8), - }; + this._pipeNext(stream); + }.bind(this)); }; -const getCanonicalHeaderList = (headers) => Object.keys(headers).sort().join(";"); +CombinedStream.prototype._pipeNext = function(stream) { + this._currentStream = stream; -/***/ }), + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('end', this._getNext.bind(this)); + stream.pipe(this, {end: false}); + return; + } -/***/ 49141: -/***/ ((__unused_webpack_module, exports) => { + var value = stream; + this.write(value); + this._getNext(); +}; -"use strict"; +CombinedStream.prototype._handleErrors = function(stream) { + var self = this; + stream.on('error', function(err) { + self._emitError(err); + }); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.cloneQuery = exports.cloneRequest = void 0; -const cloneRequest = ({ headers, query, ...rest }) => ({ - ...rest, - headers: { ...headers }, - query: query ? (0, exports.cloneQuery)(query) : undefined, -}); -exports.cloneRequest = cloneRequest; -const cloneQuery = (query) => Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param, - }; -}, {}); -exports.cloneQuery = cloneQuery; +CombinedStream.prototype.write = function(data) { + this.emit('data', data); +}; +CombinedStream.prototype.pause = function() { + if (!this.pauseStreams) { + return; + } -/***/ }), + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); + this.emit('pause'); +}; -/***/ 4047: -/***/ ((__unused_webpack_module, exports) => { +CombinedStream.prototype.resume = function() { + if (!this._released) { + this._released = true; + this.writable = true; + this._getNext(); + } -"use strict"; + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); + this.emit('resume'); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MAX_PRESIGNED_TTL = exports.KEY_TYPE_IDENTIFIER = exports.MAX_CACHE_SIZE = exports.UNSIGNED_PAYLOAD = exports.EVENT_ALGORITHM_IDENTIFIER = exports.ALGORITHM_IDENTIFIER_V4A = exports.ALGORITHM_IDENTIFIER = exports.UNSIGNABLE_PATTERNS = exports.SEC_HEADER_PATTERN = exports.PROXY_HEADER_PATTERN = exports.ALWAYS_UNSIGNABLE_HEADERS = exports.HOST_HEADER = exports.TOKEN_HEADER = exports.SHA256_HEADER = exports.SIGNATURE_HEADER = exports.GENERATED_HEADERS = exports.DATE_HEADER = exports.AMZ_DATE_HEADER = exports.AUTH_HEADER = exports.REGION_SET_PARAM = exports.TOKEN_QUERY_PARAM = exports.SIGNATURE_QUERY_PARAM = exports.EXPIRES_QUERY_PARAM = exports.SIGNED_HEADERS_QUERY_PARAM = exports.AMZ_DATE_QUERY_PARAM = exports.CREDENTIAL_QUERY_PARAM = exports.ALGORITHM_QUERY_PARAM = void 0; -exports.ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; -exports.CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; -exports.AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; -exports.SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; -exports.EXPIRES_QUERY_PARAM = "X-Amz-Expires"; -exports.SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; -exports.TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; -exports.REGION_SET_PARAM = "X-Amz-Region-Set"; -exports.AUTH_HEADER = "authorization"; -exports.AMZ_DATE_HEADER = exports.AMZ_DATE_QUERY_PARAM.toLowerCase(); -exports.DATE_HEADER = "date"; -exports.GENERATED_HEADERS = [exports.AUTH_HEADER, exports.AMZ_DATE_HEADER, exports.DATE_HEADER]; -exports.SIGNATURE_HEADER = exports.SIGNATURE_QUERY_PARAM.toLowerCase(); -exports.SHA256_HEADER = "x-amz-content-sha256"; -exports.TOKEN_HEADER = exports.TOKEN_QUERY_PARAM.toLowerCase(); -exports.HOST_HEADER = "host"; -exports.ALWAYS_UNSIGNABLE_HEADERS = { - authorization: true, - "cache-control": true, - connection: true, - expect: true, - from: true, - "keep-alive": true, - "max-forwards": true, - pragma: true, - referer: true, - te: true, - trailer: true, - "transfer-encoding": true, - upgrade: true, - "user-agent": true, - "x-amzn-trace-id": true, +CombinedStream.prototype.end = function() { + this._reset(); + this.emit('end'); }; -exports.PROXY_HEADER_PATTERN = /^proxy-/; -exports.SEC_HEADER_PATTERN = /^sec-/; -exports.UNSIGNABLE_PATTERNS = [/^proxy-/i, /^sec-/i]; -exports.ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; -exports.ALGORITHM_IDENTIFIER_V4A = "AWS4-ECDSA-P256-SHA256"; -exports.EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; -exports.UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; -exports.MAX_CACHE_SIZE = 50; -exports.KEY_TYPE_IDENTIFIER = "aws4_request"; -exports.MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7; +CombinedStream.prototype.destroy = function() { + this._reset(); + this.emit('close'); +}; -/***/ }), +CombinedStream.prototype._reset = function() { + this.writable = false; + this._streams = []; + this._currentStream = null; +}; -/***/ 65194: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +CombinedStream.prototype._checkDataSize = function() { + this._updateDataSize(); + if (this.dataSize <= this.maxDataSize) { + return; + } -"use strict"; + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; + this._emitError(new Error(message)); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.clearCredentialCache = exports.getSigningKey = exports.createScope = void 0; -const util_hex_encoding_1 = __nccwpck_require__(34180); -const constants_1 = __nccwpck_require__(4047); -const signingKeyCache = {}; -const cacheQueue = []; -const createScope = (shortDate, region, service) => `${shortDate}/${region}/${service}/${constants_1.KEY_TYPE_IDENTIFIER}`; -exports.createScope = createScope; -const getSigningKey = async (sha256Constructor, credentials, shortDate, region, service) => { - const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId); - const cacheKey = `${shortDate}:${region}:${service}:${(0, util_hex_encoding_1.toHex)(credsHash)}:${credentials.sessionToken}`; - if (cacheKey in signingKeyCache) { - return signingKeyCache[cacheKey]; - } - cacheQueue.push(cacheKey); - while (cacheQueue.length > constants_1.MAX_CACHE_SIZE) { - delete signingKeyCache[cacheQueue.shift()]; - } - let key = `AWS4${credentials.secretAccessKey}`; - for (const signable of [shortDate, region, service, constants_1.KEY_TYPE_IDENTIFIER]) { - key = await hmac(sha256Constructor, key, signable); +CombinedStream.prototype._updateDataSize = function() { + this.dataSize = 0; + + var self = this; + this._streams.forEach(function(stream) { + if (!stream.dataSize) { + return; } - return (signingKeyCache[cacheKey] = key); -}; -exports.getSigningKey = getSigningKey; -const clearCredentialCache = () => { - cacheQueue.length = 0; - Object.keys(signingKeyCache).forEach((cacheKey) => { - delete signingKeyCache[cacheKey]; - }); + + self.dataSize += stream.dataSize; + }); + + if (this._currentStream && this._currentStream.dataSize) { + this.dataSize += this._currentStream.dataSize; + } }; -exports.clearCredentialCache = clearCredentialCache; -const hmac = (ctor, secret, data) => { - const hash = new ctor(secret); - hash.update(data); - return hash.digest(); + +CombinedStream.prototype._emitError = function(err) { + this._reset(); + this.emit('error', err); }; /***/ }), -/***/ 1450: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/fn/regexp/escape.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/fn/regexp/escape.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_109398__) { -"use strict"; +__nested_webpack_require_109398__(/*! ../../modules/core.regexp.escape */ "./node_modules/core-js/modules/core.regexp.escape.js"); +module.exports = __nested_webpack_require_109398__(/*! ../../modules/_core */ "./node_modules/core-js/modules/_core.js").RegExp.escape; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getCanonicalHeaders = void 0; -const constants_1 = __nccwpck_require__(4047); -const getCanonicalHeaders = ({ headers }, unsignableHeaders, signableHeaders) => { - const canonical = {}; - for (const headerName of Object.keys(headers).sort()) { - if (headers[headerName] == undefined) { - continue; - } - const canonicalHeaderName = headerName.toLowerCase(); - if (canonicalHeaderName in constants_1.ALWAYS_UNSIGNABLE_HEADERS || - (unsignableHeaders === null || unsignableHeaders === void 0 ? void 0 : unsignableHeaders.has(canonicalHeaderName)) || - constants_1.PROXY_HEADER_PATTERN.test(canonicalHeaderName) || - constants_1.SEC_HEADER_PATTERN.test(canonicalHeaderName)) { - if (!signableHeaders || (signableHeaders && !signableHeaders.has(canonicalHeaderName))) { - continue; - } - } - canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " "); - } - return canonical; + +/***/ }), + +/***/ "./node_modules/core-js/modules/_a-function.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_a-function.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; }; -exports.getCanonicalHeaders = getCanonicalHeaders; /***/ }), -/***/ 26169: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ "./node_modules/core-js/modules/_a-number-value.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/_a-number-value.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_110421__) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getCanonicalQuery = void 0; -const util_uri_escape_1 = __nccwpck_require__(15592); -const constants_1 = __nccwpck_require__(4047); -const getCanonicalQuery = ({ query = {} }) => { - const keys = []; - const serialized = {}; - for (const key of Object.keys(query).sort()) { - if (key.toLowerCase() === constants_1.SIGNATURE_HEADER) { - continue; - } - keys.push(key); - const value = query[key]; - if (typeof value === "string") { - serialized[key] = `${(0, util_uri_escape_1.escapeUri)(key)}=${(0, util_uri_escape_1.escapeUri)(value)}`; - } - else if (Array.isArray(value)) { - serialized[key] = value - .slice(0) - .sort() - .reduce((encoded, value) => encoded.concat([`${(0, util_uri_escape_1.escapeUri)(key)}=${(0, util_uri_escape_1.escapeUri)(value)}`]), []) - .join("&"); - } - } - return keys - .map((key) => serialized[key]) - .filter((serialized) => serialized) - .join("&"); +var cof = __nested_webpack_require_110421__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); +module.exports = function (it, msg) { + if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg); + return +it; }; -exports.getCanonicalQuery = getCanonicalQuery; /***/ }), -/***/ 16176: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ "./node_modules/core-js/modules/_add-to-unscopables.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/_add-to-unscopables.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_111001__) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getPayloadHash = void 0; -const is_array_buffer_1 = __nccwpck_require__(1627); -const util_hex_encoding_1 = __nccwpck_require__(34180); -const constants_1 = __nccwpck_require__(4047); -const getPayloadHash = async ({ headers, body }, hashConstructor) => { - for (const headerName of Object.keys(headers)) { - if (headerName.toLowerCase() === constants_1.SHA256_HEADER) { - return headers[headerName]; - } - } - if (body == undefined) { - return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; - } - else if (typeof body === "string" || ArrayBuffer.isView(body) || (0, is_array_buffer_1.isArrayBuffer)(body)) { - const hashCtor = new hashConstructor(); - hashCtor.update(body); - return (0, util_hex_encoding_1.toHex)(await hashCtor.digest()); - } - return constants_1.UNSIGNED_PAYLOAD; +// 22.1.3.31 Array.prototype[@@unscopables] +var UNSCOPABLES = __nested_webpack_require_111001__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('unscopables'); +var ArrayProto = Array.prototype; +if (ArrayProto[UNSCOPABLES] == undefined) __nested_webpack_require_111001__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js")(ArrayProto, UNSCOPABLES, {}); +module.exports = function (key) { + ArrayProto[UNSCOPABLES][key] = true; }; -exports.getPayloadHash = getPayloadHash; /***/ }), -/***/ 80586: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/_advance-string-index.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/_advance-string-index.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_111787__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.deleteHeader = exports.getHeaderValue = exports.hasHeader = void 0; -const hasHeader = (soughtHeader, headers) => { - soughtHeader = soughtHeader.toLowerCase(); - for (const headerName of Object.keys(headers)) { - if (soughtHeader === headerName.toLowerCase()) { - return true; - } - } - return false; -}; -exports.hasHeader = hasHeader; -const getHeaderValue = (soughtHeader, headers) => { - soughtHeader = soughtHeader.toLowerCase(); - for (const headerName of Object.keys(headers)) { - if (soughtHeader === headerName.toLowerCase()) { - return headers[headerName]; - } - } - return undefined; -}; -exports.getHeaderValue = getHeaderValue; -const deleteHeader = (soughtHeader, headers) => { - soughtHeader = soughtHeader.toLowerCase(); - for (const headerName of Object.keys(headers)) { - if (soughtHeader === headerName.toLowerCase()) { - delete headers[headerName]; - } - } +var at = __nested_webpack_require_111787__(/*! ./_string-at */ "./node_modules/core-js/modules/_string-at.js")(true); + + // `AdvanceStringIndex` abstract operation +// https://tc39.github.io/ecma262/#sec-advancestringindex +module.exports = function (S, index, unicode) { + return index + (unicode ? at(S, index).length : 1); }; -exports.deleteHeader = deleteHeader; /***/ }), -/***/ 30849: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_an-instance.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_an-instance.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -"use strict"; +module.exports = function (it, Constructor, name, forbiddenField) { + if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { + throw TypeError(name + ': incorrect invocation!'); + } return it; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.prepareRequest = exports.moveHeadersToQuery = exports.getPayloadHash = exports.getCanonicalQuery = exports.getCanonicalHeaders = void 0; -const tslib_1 = __nccwpck_require__(18145); -tslib_1.__exportStar(__nccwpck_require__(84562), exports); -var getCanonicalHeaders_1 = __nccwpck_require__(1450); -Object.defineProperty(exports, "getCanonicalHeaders", ({ enumerable: true, get: function () { return getCanonicalHeaders_1.getCanonicalHeaders; } })); -var getCanonicalQuery_1 = __nccwpck_require__(26169); -Object.defineProperty(exports, "getCanonicalQuery", ({ enumerable: true, get: function () { return getCanonicalQuery_1.getCanonicalQuery; } })); -var getPayloadHash_1 = __nccwpck_require__(16176); -Object.defineProperty(exports, "getPayloadHash", ({ enumerable: true, get: function () { return getPayloadHash_1.getPayloadHash; } })); -var moveHeadersToQuery_1 = __nccwpck_require__(59993); -Object.defineProperty(exports, "moveHeadersToQuery", ({ enumerable: true, get: function () { return moveHeadersToQuery_1.moveHeadersToQuery; } })); -var prepareRequest_1 = __nccwpck_require__(15495); -Object.defineProperty(exports, "prepareRequest", ({ enumerable: true, get: function () { return prepareRequest_1.prepareRequest; } })); -tslib_1.__exportStar(__nccwpck_require__(65194), exports); + +/***/ }), + +/***/ "./node_modules/core-js/modules/_an-object.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_an-object.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_112994__) { + +var isObject = __nested_webpack_require_112994__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +module.exports = function (it) { + if (!isObject(it)) throw TypeError(it + ' is not an object!'); + return it; +}; /***/ }), -/***/ 59993: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_array-copy-within.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/_array-copy-within.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_113572__) { "use strict"; +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.moveHeadersToQuery = void 0; -const cloneRequest_1 = __nccwpck_require__(49141); -const moveHeadersToQuery = (request, options = {}) => { - var _a; - const { headers, query = {} } = typeof request.clone === "function" ? request.clone() : (0, cloneRequest_1.cloneRequest)(request); - for (const name of Object.keys(headers)) { - const lname = name.toLowerCase(); - if (lname.slice(0, 6) === "x-amz-" && !((_a = options.unhoistableHeaders) === null || _a === void 0 ? void 0 : _a.has(lname))) { - query[name] = headers[name]; - delete headers[name]; - } - } - return { - ...request, - headers, - query, - }; +var toObject = __nested_webpack_require_113572__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toAbsoluteIndex = __nested_webpack_require_113572__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); +var toLength = __nested_webpack_require_113572__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); + +module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { + var O = toObject(this); + var len = toLength(O.length); + var to = toAbsoluteIndex(target, len); + var from = toAbsoluteIndex(start, len); + var end = arguments.length > 2 ? arguments[2] : undefined; + var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); + var inc = 1; + if (from < to && to < from + count) { + inc = -1; + from += count - 1; + to += count - 1; + } + while (count-- > 0) { + if (from in O) O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } return O; }; -exports.moveHeadersToQuery = moveHeadersToQuery; /***/ }), -/***/ 15495: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_array-fill.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_array-fill.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_114981__) { "use strict"; +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.prepareRequest = void 0; -const cloneRequest_1 = __nccwpck_require__(49141); -const constants_1 = __nccwpck_require__(4047); -const prepareRequest = (request) => { - request = typeof request.clone === "function" ? request.clone() : (0, cloneRequest_1.cloneRequest)(request); - for (const headerName of Object.keys(request.headers)) { - if (constants_1.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) { - delete request.headers[headerName]; - } - } - return request; +var toObject = __nested_webpack_require_114981__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toAbsoluteIndex = __nested_webpack_require_114981__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); +var toLength = __nested_webpack_require_114981__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +module.exports = function fill(value /* , start = 0, end = @length */) { + var O = toObject(this); + var length = toLength(O.length); + var aLen = arguments.length; + var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); + var end = aLen > 2 ? arguments[2] : undefined; + var endPos = end === undefined ? length : toAbsoluteIndex(end, length); + while (endPos > index) O[index++] = value; + return O; }; -exports.prepareRequest = prepareRequest; /***/ }), -/***/ 98472: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/_array-from-iterable.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/_array-from-iterable.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_116193__) { -"use strict"; +var forOf = __nested_webpack_require_116193__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toDate = exports.iso8601 = void 0; -const iso8601 = (time) => (0, exports.toDate)(time) - .toISOString() - .replace(/\.\d{3}Z$/, "Z"); -exports.iso8601 = iso8601; -const toDate = (time) => { - if (typeof time === "number") { - return new Date(time * 1000); - } - if (typeof time === "string") { - if (Number(time)) { - return new Date(Number(time) * 1000); - } - return new Date(time); - } - return time; +module.exports = function (iter, ITERATOR) { + var result = []; + forOf(iter, false, result.push, result, ITERATOR); + return result; }; -exports.toDate = toDate; /***/ }), -/***/ 18145: -/***/ ((module) => { +/***/ "./node_modules/core-js/modules/_array-includes.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/_array-includes.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_116774__) { -/****************************************************************************** -Copyright (c) Microsoft Corporation. +// false -> Array#indexOf +// true -> Array#includes +var toIObject = __nested_webpack_require_116774__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var toLength = __nested_webpack_require_116774__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var toAbsoluteIndex = __nested_webpack_require_116774__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); +module.exports = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = toIObject($this); + var length = toLength(O.length); + var index = toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (;length > index; index++) if (IS_INCLUDES || index in O) { + if (O[index] === el) return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; +/***/ }), + +/***/ "./node_modules/core-js/modules/_array-methods.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_array-methods.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_118243__) { + +// 0 -> Array#forEach +// 1 -> Array#map +// 2 -> Array#filter +// 3 -> Array#some +// 4 -> Array#every +// 5 -> Array#find +// 6 -> Array#findIndex +var ctx = __nested_webpack_require_118243__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var IObject = __nested_webpack_require_118243__(/*! ./_iobject */ "./node_modules/core-js/modules/_iobject.js"); +var toObject = __nested_webpack_require_118243__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toLength = __nested_webpack_require_118243__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var asc = __nested_webpack_require_118243__(/*! ./_array-species-create */ "./node_modules/core-js/modules/_array-species-create.js"); +module.exports = function (TYPE, $create) { + var IS_MAP = TYPE == 1; + var IS_FILTER = TYPE == 2; + var IS_SOME = TYPE == 3; + var IS_EVERY = TYPE == 4; + var IS_FIND_INDEX = TYPE == 6; + var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; + var create = $create || asc; + return function ($this, callbackfn, that) { + var O = toObject($this); + var self = IObject(O); + var f = ctx(callbackfn, that, 3); + var length = toLength(self.length); + var index = 0; + var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; + var val, res; + for (;length > index; index++) if (NO_HOLES || index in self) { + val = self[index]; + res = f(val, index, O); + if (TYPE) { + if (IS_MAP) result[index] = res; // map + else if (res) switch (TYPE) { + case 3: return true; // some + case 5: return val; // find + case 6: return index; // findIndex + case 2: result.push(val); // filter + } else if (IS_EVERY) return false; // every + } } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; + }; +}; - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; +/***/ }), - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; +/***/ "./node_modules/core-js/modules/_array-reduce.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/_array-reduce.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_120400__) { - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; +var aFunction = __nested_webpack_require_120400__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var toObject = __nested_webpack_require_120400__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var IObject = __nested_webpack_require_120400__(/*! ./_iobject */ "./node_modules/core-js/modules/_iobject.js"); +var toLength = __nested_webpack_require_120400__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +module.exports = function (that, callbackfn, aLen, memo, isRight) { + aFunction(callbackfn); + var O = toObject(that); + var self = IObject(O); + var length = toLength(O.length); + var index = isRight ? length - 1 : 0; + var i = isRight ? -1 : 1; + if (aLen < 2) for (;;) { + if (index in self) { + memo = self[index]; + index += i; + break; + } + index += i; + if (isRight ? index < 0 : length <= index) { + throw TypeError('Reduce of empty array with no initial value'); + } + } + for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { + memo = callbackfn(memo, self[index], index, O); + } + return memo; +}; - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - __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()); - }); - }; +/***/ }), - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; +/***/ "./node_modules/core-js/modules/_array-species-constructor.js": +/*!********************************************************************!*\ + !*** ./node_modules/core-js/modules/_array-species-constructor.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_121868__) { - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +var isObject = __nested_webpack_require_121868__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var isArray = __nested_webpack_require_121868__(/*! ./_is-array */ "./node_modules/core-js/modules/_is-array.js"); +var SPECIES = __nested_webpack_require_121868__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('species'); - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +module.exports = function (original) { + var C; + if (isArray(original)) { + C = original.constructor; + // cross-realm fallback + if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; + if (isObject(C)) { + C = C[SPECIES]; + if (C === null) C = undefined; + } + } return C === undefined ? Array : C; +}; - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; +/***/ }), - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +/***/ "./node_modules/core-js/modules/_array-species-create.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/_array-species-create.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_122900__) { - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +// 9.4.2.3 ArraySpeciesCreate(originalArray, length) +var speciesConstructor = __nested_webpack_require_122900__(/*! ./_array-species-constructor */ "./node_modules/core-js/modules/_array-species-constructor.js"); - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; +module.exports = function (original, length) { + return new (speciesConstructor(original))(length); +}; - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +/***/ }), - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; +/***/ "./node_modules/core-js/modules/_bind.js": +/*!***********************************************!*\ + !*** ./node_modules/core-js/modules/_bind.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_123511__) { - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; +"use strict"; - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +var aFunction = __nested_webpack_require_123511__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var isObject = __nested_webpack_require_123511__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var invoke = __nested_webpack_require_123511__(/*! ./_invoke */ "./node_modules/core-js/modules/_invoke.js"); +var arraySlice = [].slice; +var factories = {}; - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; +var construct = function (F, len, args) { + if (!(len in factories)) { + for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; + // eslint-disable-next-line no-new-func + factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); + } return factories[len](F, args); +}; - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +module.exports = Function.bind || function bind(that /* , ...args */) { + var fn = aFunction(this); + var partArgs = arraySlice.call(arguments, 1); + var bound = function (/* args... */) { + var args = partArgs.concat(arraySlice.call(arguments)); + return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); + }; + if (isObject(fn.prototype)) bound.prototype = fn.prototype; + return bound; +}; - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; +/***/ }), - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +/***/ "./node_modules/core-js/modules/_classof.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/_classof.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_124925__) { - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = __nested_webpack_require_124925__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); +var TAG = __nested_webpack_require_124925__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('toStringTag'); +// ES3 wrong here +var ARG = cof(function () { return arguments; }()) == 'Arguments'; - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); +// fallback for IE11 Script Access Denied error +var tryGet = function (it, key) { + try { + return it[key]; + } catch (e) { /* empty */ } +}; + +module.exports = function (it) { + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; +}; /***/ }), -/***/ 67624: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_cof.js": +/*!**********************************************!*\ + !*** ./node_modules/core-js/modules/_cof.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -"use strict"; +var toString = {}.toString; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Client = void 0; -const middleware_stack_1 = __nccwpck_require__(32551); -class Client { - constructor(config) { - this.middlewareStack = (0, middleware_stack_1.constructStack)(); - this.config = config; - } - send(command, optionsOrCb, cb) { - const options = typeof optionsOrCb !== "function" ? optionsOrCb : undefined; - const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb; - const handler = command.resolveMiddleware(this.middlewareStack, this.config, options); - if (callback) { - handler(command) - .then((result) => callback(null, result.output), (err) => callback(err)) - .catch(() => { }); - } - else { - return handler(command).then((result) => result.output); - } - } - destroy() { - if (this.config.requestHandler.destroy) - this.config.requestHandler.destroy(); - } -} -exports.Client = Client; +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; /***/ }), -/***/ 90280: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_collection-strong.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/_collection-strong.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_126508__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Command = void 0; -const middleware_stack_1 = __nccwpck_require__(32551); -class Command { - constructor() { - this.middlewareStack = (0, middleware_stack_1.constructStack)(); - } -} -exports.Command = Command; +var dP = __nested_webpack_require_126508__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +var create = __nested_webpack_require_126508__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js"); +var redefineAll = __nested_webpack_require_126508__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); +var ctx = __nested_webpack_require_126508__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var anInstance = __nested_webpack_require_126508__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); +var forOf = __nested_webpack_require_126508__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); +var $iterDefine = __nested_webpack_require_126508__(/*! ./_iter-define */ "./node_modules/core-js/modules/_iter-define.js"); +var step = __nested_webpack_require_126508__(/*! ./_iter-step */ "./node_modules/core-js/modules/_iter-step.js"); +var setSpecies = __nested_webpack_require_126508__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js"); +var DESCRIPTORS = __nested_webpack_require_126508__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); +var fastKey = __nested_webpack_require_126508__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").fastKey; +var validate = __nested_webpack_require_126508__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); +var SIZE = DESCRIPTORS ? '_s' : 'size'; +var getEntry = function (that, key) { + // fast case + var index = fastKey(key); + var entry; + if (index !== 'F') return that._i[index]; + // frozen object case + for (entry = that._f; entry; entry = entry.n) { + if (entry.k == key) return entry; + } +}; -/***/ }), +module.exports = { + getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + anInstance(that, C, NAME, '_i'); + that._t = NAME; // collection type + that._i = create(null); // index + that._f = undefined; // first entry + that._l = undefined; // last entry + that[SIZE] = 0; // size + if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear() { + for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) { + entry.r = true; + if (entry.p) entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function (key) { + var that = validate(this, NAME); + var entry = getEntry(that, key); + if (entry) { + var next = entry.n; + var prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if (prev) prev.n = next; + if (next) next.p = prev; + if (that._f == entry) that._f = next; + if (that._l == entry) that._l = prev; + that[SIZE]--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /* , that = undefined */) { + validate(this, NAME); + var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + var entry; + while (entry = entry ? entry.n : this._f) { + f(entry.v, entry.k, this); + // revert to the last existing entry + while (entry && entry.r) entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key) { + return !!getEntry(validate(this, NAME), key); + } + }); + if (DESCRIPTORS) dP(C.prototype, 'size', { + get: function () { + return validate(this, NAME)[SIZE]; + } + }); + return C; + }, + def: function (that, key, value) { + var entry = getEntry(that, key); + var prev, index; + // change existing entry + if (entry) { + entry.v = value; + // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), // <- index + k: key, // <- key + v: value, // <- value + p: prev = that._l, // <- previous entry + n: undefined, // <- next entry + r: false // <- removed + }; + if (!that._f) that._f = entry; + if (prev) prev.n = entry; + that[SIZE]++; + // add to index + if (index !== 'F') that._i[index] = entry; + } return that; + }, + getEntry: getEntry, + setStrong: function (C, NAME, IS_MAP) { + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + $iterDefine(C, NAME, function (iterated, kind) { + this._t = validate(iterated, NAME); // target + this._k = kind; // kind + this._l = undefined; // previous + }, function () { + var that = this; + var kind = that._k; + var entry = that._l; + // revert to the last existing entry + while (entry && entry.r) entry = entry.p; + // get next entry + if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { + // or finish the iteration + that._t = undefined; + return step(1); + } + // return step by kind + if (kind == 'keys') return step(0, entry.k); + if (kind == 'values') return step(0, entry.v); + return step(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); -/***/ 95863: -/***/ ((__unused_webpack_module, exports) => { + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(NAME); + } +}; -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SENSITIVE_STRING = void 0; -exports.SENSITIVE_STRING = "***SensitiveInformation***"; +/***/ }), + +/***/ "./node_modules/core-js/modules/_collection-to-json.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/_collection-to-json.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_132671__) { + +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var classof = __nested_webpack_require_132671__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); +var from = __nested_webpack_require_132671__(/*! ./_array-from-iterable */ "./node_modules/core-js/modules/_array-from-iterable.js"); +module.exports = function (NAME) { + return function toJSON() { + if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); + return from(this); + }; +}; /***/ }), -/***/ 2749: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_collection-weak.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/_collection-weak.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_133476__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseEpochTimestamp = exports.parseRfc7231DateTime = exports.parseRfc3339DateTime = exports.dateToUtcString = void 0; -const parse_utils_1 = __nccwpck_require__(81853); -const DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; -const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; -function dateToUtcString(date) { - const year = date.getUTCFullYear(); - const month = date.getUTCMonth(); - const dayOfWeek = date.getUTCDay(); - const dayOfMonthInt = date.getUTCDate(); - const hoursInt = date.getUTCHours(); - const minutesInt = date.getUTCMinutes(); - const secondsInt = date.getUTCSeconds(); - const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`; - const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`; - const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`; - const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`; - return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year} ${hoursString}:${minutesString}:${secondsString} GMT`; -} -exports.dateToUtcString = dateToUtcString; -const RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/); -const parseRfc3339DateTime = (value) => { - if (value === null || value === undefined) { - return undefined; - } - if (typeof value !== "string") { - throw new TypeError("RFC-3339 date-times must be expressed as strings"); - } - const match = RFC3339.exec(value); - if (!match) { - throw new TypeError("Invalid RFC-3339 date-time value"); - } - const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match; - const year = (0, parse_utils_1.strictParseShort)(stripLeadingZeroes(yearStr)); - const month = parseDateValue(monthStr, "month", 1, 12); - const day = parseDateValue(dayStr, "day", 1, 31); - return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds }); +var redefineAll = __nested_webpack_require_133476__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); +var getWeak = __nested_webpack_require_133476__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").getWeak; +var anObject = __nested_webpack_require_133476__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var isObject = __nested_webpack_require_133476__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var anInstance = __nested_webpack_require_133476__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); +var forOf = __nested_webpack_require_133476__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); +var createArrayMethod = __nested_webpack_require_133476__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js"); +var $has = __nested_webpack_require_133476__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var validate = __nested_webpack_require_133476__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); +var arrayFind = createArrayMethod(5); +var arrayFindIndex = createArrayMethod(6); +var id = 0; + +// fallback for uncaught frozen keys +var uncaughtFrozenStore = function (that) { + return that._l || (that._l = new UncaughtFrozenStore()); }; -exports.parseRfc3339DateTime = parseRfc3339DateTime; -const IMF_FIXDATE = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/); -const RFC_850_DATE = new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/); -const ASC_TIME = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/); -const parseRfc7231DateTime = (value) => { - if (value === null || value === undefined) { - return undefined; - } - if (typeof value !== "string") { - throw new TypeError("RFC-7231 date-times must be expressed as strings"); - } - let match = IMF_FIXDATE.exec(value); - if (match) { - const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; - return buildDate((0, parse_utils_1.strictParseShort)(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); - } - match = RFC_850_DATE.exec(value); - if (match) { - const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; - return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { - hours, - minutes, - seconds, - fractionalMilliseconds, - })); - } - match = ASC_TIME.exec(value); - if (match) { - const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match; - return buildDate((0, parse_utils_1.strictParseShort)(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr.trimLeft(), "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); - } - throw new TypeError("Invalid RFC-7231 date-time value"); +var UncaughtFrozenStore = function () { + this.a = []; }; -exports.parseRfc7231DateTime = parseRfc7231DateTime; -const parseEpochTimestamp = (value) => { - if (value === null || value === undefined) { - return undefined; - } - let valueAsDouble; - if (typeof value === "number") { - valueAsDouble = value; - } - else if (typeof value === "string") { - valueAsDouble = (0, parse_utils_1.strictParseDouble)(value); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - else { - factory(createExporter(root)); +var findUncaughtFrozen = function (store, key) { + return arrayFind(store.a, function (it) { + return it[0] === key; + }); +}; +UncaughtFrozenStore.prototype = { + get: function (key) { + var entry = findUncaughtFrozen(this, key); + if (entry) return entry[1]; + }, + has: function (key) { + return !!findUncaughtFrozen(this, key); + }, + set: function (key, value) { + var entry = findUncaughtFrozen(this, key); + if (entry) entry[1] = value; + else this.a.push([key, value]); + }, + 'delete': function (key) { + var index = arrayFindIndex(this.a, function (it) { + return it[0] === key; + }); + if (~index) this.a.splice(index, 1); + return !!~index; + } +}; + +module.exports = { + getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + anInstance(that, C, NAME, '_i'); + that._t = NAME; // collection type + that._i = id++; // collection id + that._l = undefined; // leak store for uncaught frozen objects + if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.3.3.2 WeakMap.prototype.delete(key) + // 23.4.3.3 WeakSet.prototype.delete(value) + 'delete': function (key) { + if (!isObject(key)) return false; + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key); + return data && $has(data, this._i) && delete data[this._i]; + }, + // 23.3.3.4 WeakMap.prototype.has(key) + // 23.4.3.4 WeakSet.prototype.has(value) + has: function has(key) { + if (!isObject(key)) return false; + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key); + return data && $has(data, this._i); + } + }); + return C; + }, + def: function (that, key, value) { + var data = getWeak(anObject(key), true); + if (data === true) uncaughtFrozenStore(that).set(key, value); + else data[that._i] = value; + return that; + }, + ufstore: uncaughtFrozenStore +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_collection.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_collection.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_137178__) { + +"use strict"; + +var global = __nested_webpack_require_137178__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var $export = __nested_webpack_require_137178__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var redefine = __nested_webpack_require_137178__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var redefineAll = __nested_webpack_require_137178__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); +var meta = __nested_webpack_require_137178__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js"); +var forOf = __nested_webpack_require_137178__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); +var anInstance = __nested_webpack_require_137178__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); +var isObject = __nested_webpack_require_137178__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var fails = __nested_webpack_require_137178__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var $iterDetect = __nested_webpack_require_137178__(/*! ./_iter-detect */ "./node_modules/core-js/modules/_iter-detect.js"); +var setToStringTag = __nested_webpack_require_137178__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js"); +var inheritIfRequired = __nested_webpack_require_137178__(/*! ./_inherit-if-required */ "./node_modules/core-js/modules/_inherit-if-required.js"); + +module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { + var Base = global[NAME]; + var C = Base; + var ADDER = IS_MAP ? 'set' : 'add'; + var proto = C && C.prototype; + var O = {}; + var fixMethod = function (KEY) { + var fn = proto[KEY]; + redefine(proto, KEY, + KEY == 'delete' ? function (a) { + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'has' ? function has(a) { + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'get' ? function get(a) { + return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; } + : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; } + ); + }; + if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { + new C().entries().next(); + }))) { + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + redefineAll(C.prototype, methods); + meta.NEED = true; + } else { + var instance = new C(); + // early implementations not supports chaining + var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); + // most early implementations doesn't supports iterables, most modern - not close it correctly + var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new + // for early implementations -0 and +0 not the same + var BUGGY_ZERO = !IS_WEAK && fails(function () { + // V8 ~ Chromium 42- fails only with 5+ elements + var $instance = new C(); + var index = 5; + while (index--) $instance[ADDER](index, index); + return !$instance.has(-0); + }); + if (!ACCEPT_ITERABLES) { + C = wrapper(function (target, iterable) { + anInstance(target, C, NAME); + var that = inheritIfRequired(new Base(), target, C); + if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); + return that; + }); + C.prototype = proto; + proto.constructor = C; } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); + // weak collections should not contains .clear method + if (IS_WEAK && proto.clear) delete proto.clear; + } - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; + setToStringTag(C, NAME); - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; + O[NAME] = C; + $export($export.G + $export.W + $export.F * (C != Base), O); - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; + if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; + return C; +}; - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; +/***/ }), - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; +/***/ "./node_modules/core-js/modules/_core.js": +/*!***********************************************!*\ + !*** ./node_modules/core-js/modules/_core.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; +var core = module.exports = { version: '2.6.11' }; +if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; +/***/ }), - __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()); - }); - }; +/***/ "./node_modules/core-js/modules/_create-property.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/_create-property.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_142022__) { - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; +"use strict"; - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +var $defineProperty = __nested_webpack_require_142022__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); +var createDesc = __nested_webpack_require_142022__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +module.exports = function (object, index, value) { + if (index in object) $defineProperty.f(object, index, createDesc(0, value)); + else object[index] = value; +}; - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; +/***/ }), - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +/***/ "./node_modules/core-js/modules/_ctx.js": +/*!**********************************************!*\ + !*** ./node_modules/core-js/modules/_ctx.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_142730__) { - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; +// optional / simple context binding +var aFunction = __nested_webpack_require_142730__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +module.exports = function (fn, that, length) { + aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 1: return function (a) { + return fn.call(that, a); }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); + case 2: return function (a, b) { + return fn.call(that, a, b); }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; +}; - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; +/***/ }), - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; +/***/ "./node_modules/core-js/modules/_date-to-iso-string.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/_date-to-iso-string.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_143679__) { - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +"use strict"; - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; +// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() +var fails = __nested_webpack_require_143679__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var getTime = Date.prototype.getTime; +var $toISOString = Date.prototype.toISOString; - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +var lz = function (num) { + return num > 9 ? num : '0' + num; +}; - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; +// PhantomJS / old WebKit has a broken implementations +module.exports = (fails(function () { + return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; +}) || !fails(function () { + $toISOString.call(new Date(NaN)); +})) ? function toISOString() { + if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); + var d = this; + var y = d.getUTCFullYear(); + var m = d.getUTCMilliseconds(); + var s = y < 0 ? '-' : y > 9999 ? '+' : ''; + return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; +} : $toISOString; - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +/***/ }), - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; +/***/ "./node_modules/core-js/modules/_date-to-primitive.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/_date-to-primitive.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_145096__) { - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; +"use strict"; - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; +var anObject = __nested_webpack_require_145096__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var toPrimitive = __nested_webpack_require_145096__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); +var NUMBER = 'number'; - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; +module.exports = function (hint) { + if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint'); + return toPrimitive(anObject(this), hint != NUMBER); +}; - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); + +/***/ }), + +/***/ "./node_modules/core-js/modules/_defined.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/_defined.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; /***/ }), -<<<<<<< HEAD -/***/ 7559: -======= -/***/ 21733: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_descriptors.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_descriptors.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_146342__) { +// Thank's IE8 for his funny defineProperty +module.exports = !__nested_webpack_require_146342__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -exports.UnsupportedGrantTypeException = exports.UnauthorizedClientException = exports.SlowDownException = exports.SSOOIDCClient = exports.InvalidScopeException = exports.InvalidRequestException = exports.InvalidClientException = exports.InternalServerException = exports.ExpiredTokenException = exports.CreateTokenCommand = exports.AuthorizationPendingException = exports.AccessDeniedException = void 0; -const middleware_host_header_1 = __nccwpck_require__(23213); -const middleware_logger_1 = __nccwpck_require__(45288); -const middleware_recursion_detection_1 = __nccwpck_require__(13807); -const middleware_user_agent_1 = __nccwpck_require__(3549); -const config_resolver_1 = __nccwpck_require__(66041); -const middleware_content_length_1 = __nccwpck_require__(38959); -const middleware_endpoint_1 = __nccwpck_require__(24916); -const middleware_retry_1 = __nccwpck_require__(54801); -const smithy_client_1 = __nccwpck_require__(33218); -var resolveClientEndpointParameters = (options) => { - var _a, _b; - return { - ...options, - useDualstackEndpoint: (_a = options.useDualstackEndpoint) !== null && _a !== void 0 ? _a : false, - useFipsEndpoint: (_b = options.useFipsEndpoint) !== null && _b !== void 0 ? _b : false, - defaultSigningName: "awsssooidc", - }; -======= -exports.throwDefaultError = void 0; -const exceptions_1 = __nccwpck_require__(41948); -const throwDefaultError = ({ output, parsedBody, exceptionCtor, errorCode }) => { - const $metadata = deserializeMetadata(output); - const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined; - const response = new exceptionCtor({ - name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError", - $fault: "client", - $metadata, - }); - throw (0, exceptions_1.decorateServiceException)(response, parsedBody); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + +/***/ }), + +/***/ "./node_modules/core-js/modules/_dom-create.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_dom-create.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_146918__) { + +var isObject = __nested_webpack_require_146918__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var document = __nested_webpack_require_146918__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").document; +// typeof document.createElement is 'object' in old IE +var is = isObject(document) && isObject(document.createElement); +module.exports = function (it) { + return is ? document.createElement(it) : {}; }; -var package_default = { version: "3.429.0" }; -const util_user_agent_node_1 = __nccwpck_require__(61876); -const config_resolver_2 = __nccwpck_require__(66041); -const hash_node_1 = __nccwpck_require__(86775); -const middleware_retry_2 = __nccwpck_require__(54801); -const node_config_provider_1 = __nccwpck_require__(13079); -const node_http_handler_1 = __nccwpck_require__(54065); -const util_body_length_node_1 = __nccwpck_require__(87693); -const util_retry_1 = __nccwpck_require__(13744); -const smithy_client_2 = __nccwpck_require__(33218); -const url_parser_1 = __nccwpck_require__(98245); -const util_base64_1 = __nccwpck_require__(14478); -const util_utf8_1 = __nccwpck_require__(38134); -const util_endpoints_1 = __nccwpck_require__(34548); -var s = "required"; -var t = "fn"; -var u = "argv"; -var v = "ref"; -var a = "isSet"; -var b = "tree"; -var c = "error"; -var d = "endpoint"; -var e = "PartitionResult"; -var f = "getAttr"; -var g = { [s]: false, type: "String" }; -var h = { [s]: true, default: false, type: "Boolean" }; -var i = { [v]: "Endpoint" }; -var j = { [t]: "booleanEquals", [u]: [{ [v]: "UseFIPS" }, true] }; -var k = { [t]: "booleanEquals", [u]: [{ [v]: "UseDualStack" }, true] }; -var l = {}; -var m = { [t]: "booleanEquals", [u]: [true, { [t]: f, [u]: [{ [v]: e }, "supportsFIPS"] }] }; -var n = { [v]: e }; -var o = { [t]: "booleanEquals", [u]: [true, { [t]: f, [u]: [n, "supportsDualStack"] }] }; -var p = [j]; -var q = [k]; -var r = [{ [v]: "Region" }]; -var _data = { - version: "1.0", - parameters: { Region: g, UseDualStack: h, UseFIPS: h, Endpoint: g }, - rules: [ - { - conditions: [{ [t]: a, [u]: [i] }], - type: b, - rules: [ - { conditions: p, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, - { conditions: q, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, - { endpoint: { url: i, properties: l, headers: l }, type: d }, - ], - }, - { - conditions: [{ [t]: a, [u]: r }], - type: b, - rules: [ - { - conditions: [{ [t]: "aws.partition", [u]: r, assign: e }], - type: b, - rules: [ - { - conditions: [j, k], - type: b, - rules: [ - { - conditions: [m, o], - type: b, - rules: [ - { - endpoint: { - url: "https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - properties: l, - headers: l, - }, - type: d, - }, - ], - }, - { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: c }, - ], - }, - { - conditions: p, - type: b, - rules: [ - { - conditions: [m], - type: b, - rules: [ - { - conditions: [{ [t]: "stringEquals", [u]: ["aws-us-gov", { [t]: f, [u]: [n, "name"] }] }], - endpoint: { url: "https://oidc.{Region}.amazonaws.com", properties: l, headers: l }, - type: d, - }, - { - endpoint: { - url: "https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}", - properties: l, - headers: l, - }, - type: d, - }, - ], - }, - { error: "FIPS is enabled but this partition does not support FIPS", type: c }, - ], - }, - { - conditions: q, - type: b, - rules: [ - { - conditions: [o], - type: b, - rules: [ - { - endpoint: { - url: "https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}", - properties: l, - headers: l, - }, - type: d, - }, - ], - }, - { error: "DualStack is enabled but this partition does not support DualStack", type: c }, - ], - }, - { - endpoint: { url: "https://oidc.{Region}.{PartitionResult#dnsSuffix}", properties: l, headers: l }, - type: d, - }, - ], - }, - ], - }, - { error: "Invalid Configuration: Missing Region", type: c }, - ], + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_enum-bug-keys.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_enum-bug-keys.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_enum-keys.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_enum-keys.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_148143__) { + +// all enumerable object keys, includes symbols +var getKeys = __nested_webpack_require_148143__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); +var gOPS = __nested_webpack_require_148143__(/*! ./_object-gops */ "./node_modules/core-js/modules/_object-gops.js"); +var pIE = __nested_webpack_require_148143__(/*! ./_object-pie */ "./node_modules/core-js/modules/_object-pie.js"); +module.exports = function (it) { + var result = getKeys(it); + var getSymbols = gOPS.f; + if (getSymbols) { + var symbols = getSymbols(it); + var isEnum = pIE.f; + var i = 0; + var key; + while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); + } return result; }; -var ruleSet = _data; -var defaultEndpointResolver = (endpointParams, context = {}) => { - return (0, util_endpoints_1.resolveEndpoint)(ruleSet, { - endpointParams, - logger: context.logger, - }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_export.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/_export.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_149125__) { + +var global = __nested_webpack_require_149125__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var core = __nested_webpack_require_149125__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); +var hide = __nested_webpack_require_149125__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var redefine = __nested_webpack_require_149125__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var ctx = __nested_webpack_require_149125__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var PROTOTYPE = 'prototype'; + +var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; + var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); + var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); + var key, own, out, exp; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // extend global + if (target) redefine(target, key, out, type & $export.U); + // export + if (exports[key] != out) hide(exports, key, exp); + if (IS_PROTO && expProto[key] != out) expProto[key] = out; + } }; -var getRuntimeConfig = (config) => { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; - return ({ - apiVersion: "2019-06-10", - base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : util_base64_1.fromBase64, - base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : util_base64_1.toBase64, - disableHostPrefix: (_c = config === null || config === void 0 ? void 0 : config.disableHostPrefix) !== null && _c !== void 0 ? _c : false, - endpointProvider: (_d = config === null || config === void 0 ? void 0 : config.endpointProvider) !== null && _d !== void 0 ? _d : defaultEndpointResolver, - extensions: (_e = config === null || config === void 0 ? void 0 : config.extensions) !== null && _e !== void 0 ? _e : [], - logger: (_f = config === null || config === void 0 ? void 0 : config.logger) !== null && _f !== void 0 ? _f : new smithy_client_2.NoOpLogger(), - serviceId: (_g = config === null || config === void 0 ? void 0 : config.serviceId) !== null && _g !== void 0 ? _g : "SSO OIDC", - urlParser: (_h = config === null || config === void 0 ? void 0 : config.urlParser) !== null && _h !== void 0 ? _h : url_parser_1.parseUrl, - utf8Decoder: (_j = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _j !== void 0 ? _j : util_utf8_1.fromUtf8, - utf8Encoder: (_k = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _k !== void 0 ? _k : util_utf8_1.toUtf8, - }); +global.core = core; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_fails-is-regexp.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/_fails-is-regexp.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_151378__) { + +var MATCH = __nested_webpack_require_151378__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('match'); +module.exports = function (KEY) { + var re = /./; + try { + '/./'[KEY](re); + } catch (e) { + try { + re[MATCH] = false; + return !'/./'[KEY](re); + } catch (f) { /* empty */ } + } return true; }; -const smithy_client_3 = __nccwpck_require__(33218); -const util_defaults_mode_node_1 = __nccwpck_require__(6061); -const smithy_client_4 = __nccwpck_require__(33218); -var getRuntimeConfig2 = (config) => { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; - (0, smithy_client_4.emitWarningIfUnsupportedVersion)(process.version); - const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); - const defaultConfigProvider = () => defaultsMode().then(smithy_client_3.loadConfigsForDefaultMode); - const clientSharedValues = getRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - defaultsMode, - bodyLengthChecker: (_a = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _a !== void 0 ? _a : util_body_length_node_1.calculateBodyLength, - defaultUserAgentProvider: (_b = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _b !== void 0 ? _b : (0, util_user_agent_node_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_default.version }), - maxAttempts: (_c = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _c !== void 0 ? _c : (0, node_config_provider_1.loadConfig)(middleware_retry_2.NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: (_d = config === null || config === void 0 ? void 0 : config.region) !== null && _d !== void 0 ? _d : (0, node_config_provider_1.loadConfig)(config_resolver_2.NODE_REGION_CONFIG_OPTIONS, config_resolver_2.NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: (_e = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _e !== void 0 ? _e : new node_http_handler_1.NodeHttpHandler(defaultConfigProvider), - retryMode: (_f = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _f !== void 0 ? _f : (0, node_config_provider_1.loadConfig)({ - ...middleware_retry_2.NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE, - }), - sha256: (_g = config === null || config === void 0 ? void 0 : config.sha256) !== null && _g !== void 0 ? _g : hash_node_1.Hash.bind(null, "sha256"), - streamCollector: (_h = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _h !== void 0 ? _h : node_http_handler_1.streamCollector, - useDualstackEndpoint: (_j = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _j !== void 0 ? _j : (0, node_config_provider_1.loadConfig)(config_resolver_2.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: (_k = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _k !== void 0 ? _k : (0, node_config_provider_1.loadConfig)(config_resolver_2.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - }; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_fails.js": +/*!************************************************!*\ + !*** ./node_modules/core-js/modules/_fails.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } }; -const region_config_resolver_1 = __nccwpck_require__(35657); -const protocol_http_1 = __nccwpck_require__(45311); -const smithy_client_5 = __nccwpck_require__(33218); -var asPartial = (t2) => t2; -var resolveRuntimeExtensions = (runtimeConfig, extensions) => { - const extensionConfiguration = { - ...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)), - ...asPartial((0, smithy_client_5.getDefaultExtensionConfiguration)(runtimeConfig)), - ...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)), - }; - extensions.forEach((extension) => extension.configure(extensionConfiguration)); - return { - ...runtimeConfig, - ...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), - ...(0, smithy_client_5.resolveDefaultRuntimeConfig)(extensionConfiguration), - ...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), - }; -}; -var SSOOIDCClient = class extends smithy_client_1.Client { - constructor(...[configuration]) { - const _config_0 = getRuntimeConfig2(configuration || {}); - const _config_1 = resolveClientEndpointParameters(_config_0); - const _config_2 = (0, config_resolver_1.resolveRegionConfig)(_config_1); - const _config_3 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_2); - const _config_4 = (0, middleware_retry_1.resolveRetryConfig)(_config_3); - const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4); - const _config_6 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_5); - const _config_7 = resolveRuntimeExtensions(_config_6, (configuration === null || configuration === void 0 ? void 0 : configuration.extensions) || []); - super(_config_7); - this.config = _config_7; - this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config)); - this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config)); - this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config)); - this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config)); - this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config)); - this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config)); - } - destroy() { - super.destroy(); - } -}; -exports.SSOOIDCClient = SSOOIDCClient; -const smithy_client_6 = __nccwpck_require__(33218); -const middleware_endpoint_2 = __nccwpck_require__(24916); -const middleware_serde_1 = __nccwpck_require__(4247); -const smithy_client_7 = __nccwpck_require__(33218); -const types_1 = __nccwpck_require__(75751); -const protocol_http_2 = __nccwpck_require__(45311); -const smithy_client_8 = __nccwpck_require__(33218); -const smithy_client_9 = __nccwpck_require__(33218); -var SSOOIDCServiceException = class _SSOOIDCServiceException extends smithy_client_9.ServiceException { - constructor(options) { - super(options); - Object.setPrototypeOf(this, _SSOOIDCServiceException.prototype); - } -}; -var AccessDeniedException = class _AccessDeniedException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "AccessDeniedException", - $fault: "client", - ...opts, - }); - this.name = "AccessDeniedException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _AccessDeniedException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.AccessDeniedException = AccessDeniedException; -var AuthorizationPendingException = class _AuthorizationPendingException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "AuthorizationPendingException", - $fault: "client", - ...opts, - }); - this.name = "AuthorizationPendingException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _AuthorizationPendingException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.AuthorizationPendingException = AuthorizationPendingException; -var ExpiredTokenException = class _ExpiredTokenException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "ExpiredTokenException", - $fault: "client", - ...opts, - }); - this.name = "ExpiredTokenException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _ExpiredTokenException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.ExpiredTokenException = ExpiredTokenException; -var InternalServerException = class _InternalServerException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "InternalServerException", - $fault: "server", - ...opts, - }); - this.name = "InternalServerException"; - this.$fault = "server"; - Object.setPrototypeOf(this, _InternalServerException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.InternalServerException = InternalServerException; -var InvalidClientException = class _InvalidClientException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "InvalidClientException", - $fault: "client", - ...opts, - }); - this.name = "InvalidClientException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _InvalidClientException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.InvalidClientException = InvalidClientException; -var InvalidGrantException = class _InvalidGrantException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "InvalidGrantException", - $fault: "client", - ...opts, - }); - this.name = "InvalidGrantException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _InvalidGrantException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -var InvalidRequestException = class _InvalidRequestException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "InvalidRequestException", - $fault: "client", - ...opts, - }); - this.name = "InvalidRequestException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _InvalidRequestException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.InvalidRequestException = InvalidRequestException; -var InvalidScopeException = class _InvalidScopeException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "InvalidScopeException", - $fault: "client", - ...opts, - }); - this.name = "InvalidScopeException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _InvalidScopeException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.InvalidScopeException = InvalidScopeException; -var SlowDownException = class _SlowDownException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "SlowDownException", - $fault: "client", - ...opts, - }); - this.name = "SlowDownException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _SlowDownException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.SlowDownException = SlowDownException; -var UnauthorizedClientException = class _UnauthorizedClientException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "UnauthorizedClientException", - $fault: "client", - ...opts, - }); - this.name = "UnauthorizedClientException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _UnauthorizedClientException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.UnauthorizedClientException = UnauthorizedClientException; -var UnsupportedGrantTypeException = class _UnsupportedGrantTypeException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "UnsupportedGrantTypeException", - $fault: "client", - ...opts, - }); - this.name = "UnsupportedGrantTypeException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _UnsupportedGrantTypeException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -exports.UnsupportedGrantTypeException = UnsupportedGrantTypeException; -var InvalidClientMetadataException = class _InvalidClientMetadataException extends SSOOIDCServiceException { - constructor(opts) { - super({ - name: "InvalidClientMetadataException", - $fault: "client", - ...opts, - }); - this.name = "InvalidClientMetadataException"; - this.$fault = "client"; - Object.setPrototypeOf(this, _InvalidClientMetadataException.prototype); - this.error = opts.error; - this.error_description = opts.error_description; - } -}; -var se_CreateTokenCommand = async (input, context) => { - const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); - const headers = { - "content-type": "application/json", - }; - const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}/token`; - let body; - body = JSON.stringify((0, smithy_client_8.take)(input, { - clientId: [], - clientSecret: [], - code: [], - deviceCode: [], - grantType: [], - redirectUri: [], - refreshToken: [], - scope: (_) => (0, smithy_client_8._json)(_), - })); - return new protocol_http_2.HttpRequest({ - protocol, - hostname, - port, - method: "POST", - headers, - path: resolvedPath, - body, - }); -}; -var se_RegisterClientCommand = async (input, context) => { - const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); - const headers = { - "content-type": "application/json", - }; - const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}/client/register`; - let body; - body = JSON.stringify((0, smithy_client_8.take)(input, { - clientName: [], - clientType: [], - scopes: (_) => (0, smithy_client_8._json)(_), - })); - return new protocol_http_2.HttpRequest({ - protocol, - hostname, - port, - method: "POST", - headers, - path: resolvedPath, - body, - }); -}; -var se_StartDeviceAuthorizationCommand = async (input, context) => { - const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); - const headers = { - "content-type": "application/json", - }; - const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}/device_authorization`; - let body; - body = JSON.stringify((0, smithy_client_8.take)(input, { - clientId: [], - clientSecret: [], - startUrl: [], - })); - return new protocol_http_2.HttpRequest({ - protocol, - hostname, - port, - method: "POST", - headers, - path: resolvedPath, - body, - }); -}; -var de_CreateTokenCommand = async (output, context) => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTokenCommandError(output, context); - } - const contents = (0, smithy_client_8.map)({ - $metadata: deserializeMetadata(output), - }); - const data = (0, smithy_client_8.expectNonNull)((0, smithy_client_8.expectObject)(await parseBody(output.body, context)), "body"); - const doc = (0, smithy_client_8.take)(data, { - accessToken: smithy_client_8.expectString, - expiresIn: smithy_client_8.expectInt32, - idToken: smithy_client_8.expectString, - refreshToken: smithy_client_8.expectString, - tokenType: smithy_client_8.expectString, - }); - Object.assign(contents, doc); - return contents; -}; -var de_CreateTokenCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssooidc#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationPendingException": - case "com.amazonaws.ssooidc#AuthorizationPendingException": - throw await de_AuthorizationPendingExceptionRes(parsedOutput, context); - case "ExpiredTokenException": - case "com.amazonaws.ssooidc#ExpiredTokenException": - throw await de_ExpiredTokenExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssooidc#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidClientException": - case "com.amazonaws.ssooidc#InvalidClientException": - throw await de_InvalidClientExceptionRes(parsedOutput, context); - case "InvalidGrantException": - case "com.amazonaws.ssooidc#InvalidGrantException": - throw await de_InvalidGrantExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ssooidc#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidScopeException": - case "com.amazonaws.ssooidc#InvalidScopeException": - throw await de_InvalidScopeExceptionRes(parsedOutput, context); - case "SlowDownException": - case "com.amazonaws.ssooidc#SlowDownException": - throw await de_SlowDownExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.ssooidc#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - case "UnsupportedGrantTypeException": - case "com.amazonaws.ssooidc#UnsupportedGrantTypeException": - throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -var de_RegisterClientCommand = async (output, context) => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterClientCommandError(output, context); - } - const contents = (0, smithy_client_8.map)({ - $metadata: deserializeMetadata(output), - }); - const data = (0, smithy_client_8.expectNonNull)((0, smithy_client_8.expectObject)(await parseBody(output.body, context)), "body"); - const doc = (0, smithy_client_8.take)(data, { - authorizationEndpoint: smithy_client_8.expectString, - clientId: smithy_client_8.expectString, - clientIdIssuedAt: smithy_client_8.expectLong, - clientSecret: smithy_client_8.expectString, - clientSecretExpiresAt: smithy_client_8.expectLong, - tokenEndpoint: smithy_client_8.expectString, - }); - Object.assign(contents, doc); - return contents; -}; -var de_RegisterClientCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ssooidc#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidClientMetadataException": - case "com.amazonaws.ssooidc#InvalidClientMetadataException": - throw await de_InvalidClientMetadataExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ssooidc#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidScopeException": - case "com.amazonaws.ssooidc#InvalidScopeException": - throw await de_InvalidScopeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -var de_StartDeviceAuthorizationCommand = async (output, context) => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartDeviceAuthorizationCommandError(output, context); - } - const contents = (0, smithy_client_8.map)({ - $metadata: deserializeMetadata(output), - }); - const data = (0, smithy_client_8.expectNonNull)((0, smithy_client_8.expectObject)(await parseBody(output.body, context)), "body"); - const doc = (0, smithy_client_8.take)(data, { - deviceCode: smithy_client_8.expectString, - expiresIn: smithy_client_8.expectInt32, - interval: smithy_client_8.expectInt32, - userCode: smithy_client_8.expectString, - verificationUri: smithy_client_8.expectString, - verificationUriComplete: smithy_client_8.expectString, - }); - Object.assign(contents, doc); - return contents; -}; -var de_StartDeviceAuthorizationCommandError = async (output, context) => { - const parsedOutput = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ssooidc#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidClientException": - case "com.amazonaws.ssooidc#InvalidClientException": - throw await de_InvalidClientExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ssooidc#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "SlowDownException": - case "com.amazonaws.ssooidc#SlowDownException": - throw await de_SlowDownExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.ssooidc#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; -var throwDefaultError = (0, smithy_client_8.withBaseException)(SSOOIDCServiceException); -var de_AccessDeniedExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_8.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_8.take)(data, { - error: smithy_client_8.expectString, - error_description: smithy_client_8.expectString, - }); - Object.assign(contents, doc); - const exception = new AccessDeniedException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents, - }); - return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); -}; -var de_AuthorizationPendingExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_8.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_8.take)(data, { - error: smithy_client_8.expectString, - error_description: smithy_client_8.expectString, - }); - Object.assign(contents, doc); - const exception = new AuthorizationPendingException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents, - }); - return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); -}; -var de_ExpiredTokenExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_8.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_8.take)(data, { - error: smithy_client_8.expectString, - error_description: smithy_client_8.expectString, - }); - Object.assign(contents, doc); - const exception = new ExpiredTokenException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents, - }); - return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); -}; -var de_InternalServerExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_8.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_8.take)(data, { - error: smithy_client_8.expectString, - error_description: smithy_client_8.expectString, - }); - Object.assign(contents, doc); - const exception = new InternalServerException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents, - }); - return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); -}; -var de_InvalidClientExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_8.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_8.take)(data, { - error: smithy_client_8.expectString, - error_description: smithy_client_8.expectString, - }); - Object.assign(contents, doc); - const exception = new InvalidClientException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents, - }); - return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); -}; -var de_InvalidClientMetadataExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_8.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_8.take)(data, { - error: smithy_client_8.expectString, - error_description: smithy_client_8.expectString, - }); - Object.assign(contents, doc); - const exception = new InvalidClientMetadataException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents, - }); - return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); -}; -var de_InvalidGrantExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_8.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_8.take)(data, { - error: smithy_client_8.expectString, - error_description: smithy_client_8.expectString, - }); - Object.assign(contents, doc); - const exception = new InvalidGrantException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents, - }); - return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); -}; -var de_InvalidRequestExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_8.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_8.take)(data, { - error: smithy_client_8.expectString, - error_description: smithy_client_8.expectString, - }); - Object.assign(contents, doc); - const exception = new InvalidRequestException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents, - }); - return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); -}; -var de_InvalidScopeExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_8.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_8.take)(data, { - error: smithy_client_8.expectString, - error_description: smithy_client_8.expectString, - }); - Object.assign(contents, doc); - const exception = new InvalidScopeException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents, - }); - return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); -}; -var de_SlowDownExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_8.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_8.take)(data, { - error: smithy_client_8.expectString, - error_description: smithy_client_8.expectString, - }); - Object.assign(contents, doc); - const exception = new SlowDownException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents, - }); - return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); -}; -var de_UnauthorizedClientExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_8.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_8.take)(data, { - error: smithy_client_8.expectString, - error_description: smithy_client_8.expectString, - }); - Object.assign(contents, doc); - const exception = new UnauthorizedClientException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents, - }); - return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); -}; -var de_UnsupportedGrantTypeExceptionRes = async (parsedOutput, context) => { - const contents = (0, smithy_client_8.map)({}); - const data = parsedOutput.body; - const doc = (0, smithy_client_8.take)(data, { - error: smithy_client_8.expectString, - error_description: smithy_client_8.expectString, - }); - Object.assign(contents, doc); - const exception = new UnsupportedGrantTypeException({ - $metadata: deserializeMetadata(parsedOutput), - ...contents, - }); - return (0, smithy_client_8.decorateServiceException)(exception, parsedOutput.body); -}; -var deserializeMetadata = (output) => { - var _a, _b; - return ({ - httpStatusCode: output.statusCode, - requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"], - extendedRequestId: output.headers["x-amz-id-2"], - cfId: output.headers["x-amz-cf-id"], - }); -}; -<<<<<<< HEAD -var collectBodyString = (streamBody, context) => (0, smithy_client_8.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)); -var parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { - if (encoded.length) { - return JSON.parse(encoded); - } - return {}; -}); -var parseErrorBody = async (errorBody, context) => { - var _a; - const value = await parseBody(errorBody, context); - value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message; -======= /***/ }), -/***/ 38867: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/_fix-re-wks.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_fix-re-wks.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_152414__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.loadConfigsForDefaultMode = void 0; -const loadConfigsForDefaultMode = (mode) => { - switch (mode) { - case "standard": - return { - retryMode: "standard", - connectionTimeout: 3100, - }; - case "in-region": - return { - retryMode: "standard", - connectionTimeout: 1100, - }; - case "cross-region": - return { - retryMode: "standard", - connectionTimeout: 3100, - }; - case "mobile": - return { - retryMode: "standard", - connectionTimeout: 30000, - }; - default: - return {}; - } -}; -exports.loadConfigsForDefaultMode = loadConfigsForDefaultMode; +__nested_webpack_require_152414__(/*! ./es6.regexp.exec */ "./node_modules/core-js/modules/es6.regexp.exec.js"); +var redefine = __nested_webpack_require_152414__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var hide = __nested_webpack_require_152414__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var fails = __nested_webpack_require_152414__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var defined = __nested_webpack_require_152414__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +var wks = __nested_webpack_require_152414__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js"); +var regexpExec = __nested_webpack_require_152414__(/*! ./_regexp-exec */ "./node_modules/core-js/modules/_regexp-exec.js"); +var SPECIES = wks('species'); -/***/ }), +var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { + // #replace needs built-in support for named groups. + // #match works fine because it just return the exec results, even if it has + // a "grops" property. + var re = /./; + re.exec = function () { + var result = []; + result.groups = { a: '7' }; + return result; + }; + return ''.replace(re, '$') !== '7'; +}); -/***/ 86794: -/***/ ((__unused_webpack_module, exports) => { +var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () { + // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec + var re = /(?:)/; + var originalExec = re.exec; + re.exec = function () { return originalExec.apply(this, arguments); }; + var result = 'ab'.split(re); + return result.length === 2 && result[0] === 'a' && result[1] === 'b'; +})(); -"use strict"; +module.exports = function (KEY, length, exec) { + var SYMBOL = wks(KEY); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.emitWarningIfUnsupportedVersion = void 0; -let warningEmitted = false; -const emitWarningIfUnsupportedVersion = (version) => { - if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 14) { - warningEmitted = true; - process.emitWarning(`The AWS SDK for JavaScript (v3) will\n` + - `no longer support Node.js ${version} on November 1, 2022.\n\n` + - `To continue receiving updates to AWS services, bug fixes, and security\n` + - `updates please upgrade to Node.js 14.x or later.\n\n` + - `For details, please refer our blog post: https://a.co/48dbdYz`, `NodeDeprecationWarning`); + var DELEGATES_TO_SYMBOL = !fails(function () { + // String methods call symbol-named RegEp methods + var O = {}; + O[SYMBOL] = function () { return 7; }; + return ''[KEY](O) != 7; + }); + + var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () { + // Symbol-named RegExp methods call .exec + var execCalled = false; + var re = /a/; + re.exec = function () { execCalled = true; return null; }; + if (KEY === 'split') { + // RegExp[@@split] doesn't call the regex's exec method, but first creates + // a new one. We need to return the patched regex when creating the new one. + re.constructor = {}; + re.constructor[SPECIES] = function () { return re; }; } + re[SYMBOL](''); + return !execCalled; + }) : undefined; + + if ( + !DELEGATES_TO_SYMBOL || + !DELEGATES_TO_EXEC || + (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) || + (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) + ) { + var nativeRegExpMethod = /./[SYMBOL]; + var fns = exec( + defined, + SYMBOL, + ''[KEY], + function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) { + if (regexp.exec === regexpExec) { + if (DELEGATES_TO_SYMBOL && !forceStringMethod) { + // The native String method already delegates to @@method (this + // polyfilled function), leasing to infinite recursion. + // We avoid it by directly calling the native @@method method. + return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) }; + } + return { done: true, value: nativeMethod.call(str, regexp, arg2) }; + } + return { done: false }; + } + ); + var strfn = fns[0]; + var rxfn = fns[1]; + + redefine(String.prototype, KEY, strfn); + hide(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function (string, arg) { return rxfn.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function (string) { return rxfn.call(string, this); } + ); + } }; -exports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion; /***/ }), -/***/ 41948: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/_flags.js": +/*!************************************************!*\ + !*** ./node_modules/core-js/modules/_flags.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_156497__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.decorateServiceException = exports.ServiceException = void 0; -class ServiceException extends Error { - constructor(options) { - super(options.message); - Object.setPrototypeOf(this, ServiceException.prototype); - this.name = options.name; - this.$fault = options.$fault; - this.$metadata = options.$metadata; - } -} -exports.ServiceException = ServiceException; -const decorateServiceException = (exception, additions = {}) => { - Object.entries(additions) - .filter(([, v]) => v !== undefined) - .forEach(([k, v]) => { - if (exception[k] == undefined || exception[k] === "") { - exception[k] = v; - } - }); - const message = exception.message || exception.Message || "UnknownError"; - exception.message = message; - delete exception.Message; - return exception; +// 21.2.5.3 get RegExp.prototype.flags +var anObject = __nested_webpack_require_156497__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +module.exports = function () { + var that = anObject(this); + var result = ''; + if (that.global) result += 'g'; + if (that.ignoreCase) result += 'i'; + if (that.multiline) result += 'm'; + if (that.unicode) result += 'u'; + if (that.sticky) result += 'y'; + return result; }; -exports.decorateServiceException = decorateServiceException; /***/ }), -/***/ 93542: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/_flatten-into-array.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/_flatten-into-array.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_157296__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.extendedEncodeURIComponent = void 0; -function extendedEncodeURIComponent(str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { - return "%" + c.charCodeAt(0).toString(16).toUpperCase(); - }); +// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray +var isArray = __nested_webpack_require_157296__(/*! ./_is-array */ "./node_modules/core-js/modules/_is-array.js"); +var isObject = __nested_webpack_require_157296__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var toLength = __nested_webpack_require_157296__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var ctx = __nested_webpack_require_157296__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var IS_CONCAT_SPREADABLE = __nested_webpack_require_157296__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('isConcatSpreadable'); + +function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) { + var targetIndex = start; + var sourceIndex = 0; + var mapFn = mapper ? ctx(mapper, thisArg, 3) : false; + var element, spreadable; + + while (sourceIndex < sourceLen) { + if (sourceIndex in source) { + element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; + + spreadable = false; + if (isObject(element)) { + spreadable = element[IS_CONCAT_SPREADABLE]; + spreadable = spreadable !== undefined ? !!spreadable : isArray(element); + } + + if (spreadable && depth > 0) { + targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; + } else { + if (targetIndex >= 0x1fffffffffffff) throw TypeError(); + target[targetIndex] = element; + } + + targetIndex++; + } + sourceIndex++; + } + return targetIndex; } -exports.extendedEncodeURIComponent = extendedEncodeURIComponent; + +module.exports = flattenIntoArray; /***/ }), -/***/ 41797: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +/***/ "./node_modules/core-js/modules/_for-of.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/_for-of.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_159206__) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getArrayIfSingleItem = void 0; -const getArrayIfSingleItem = (mayBeArray) => Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray]; -exports.getArrayIfSingleItem = getArrayIfSingleItem; +var ctx = __nested_webpack_require_159206__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var call = __nested_webpack_require_159206__(/*! ./_iter-call */ "./node_modules/core-js/modules/_iter-call.js"); +var isArrayIter = __nested_webpack_require_159206__(/*! ./_is-array-iter */ "./node_modules/core-js/modules/_is-array-iter.js"); +var anObject = __nested_webpack_require_159206__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var toLength = __nested_webpack_require_159206__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var getIterFn = __nested_webpack_require_159206__(/*! ./core.get-iterator-method */ "./node_modules/core-js/modules/core.get-iterator-method.js"); +var BREAK = {}; +var RETURN = {}; +var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { + var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); + var f = ctx(fn, that, entries ? 2 : 1); + var index = 0; + var length, step, iterator, result; + if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { + result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + if (result === BREAK || result === RETURN) return result; + } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { + result = call(iterator, f, step.value, entries); + if (result === BREAK || result === RETURN) return result; + } +}; +exports.BREAK = BREAK; +exports.RETURN = RETURN; /***/ }), -/***/ 99707: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/_function-to-string.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/_function-to-string.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_161142__) { -"use strict"; +module.exports = __nested_webpack_require_161142__(/*! ./_shared */ "./node_modules/core-js/modules/_shared.js")('native-function-to-string', Function.toString); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getValueFromTextNode = void 0; -const getValueFromTextNode = (obj) => { - const textNodeName = "#text"; - for (const key in obj) { - if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== undefined) { - obj[key] = obj[key][textNodeName]; - } - else if (typeof obj[key] === "object" && obj[key] !== null) { - obj[key] = (0, exports.getValueFromTextNode)(obj[key]); - } - } - return obj; -}; -exports.getValueFromTextNode = getValueFromTextNode; + +/***/ }), + +/***/ "./node_modules/core-js/modules/_global.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/_global.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')(); +if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef /***/ }), -/***/ 26351: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_has.js": +/*!**********************************************!*\ + !*** ./node_modules/core-js/modules/_has.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -"use strict"; +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(45945); -tslib_1.__exportStar(__nccwpck_require__(67624), exports); -tslib_1.__exportStar(__nccwpck_require__(90280), exports); -tslib_1.__exportStar(__nccwpck_require__(95863), exports); -tslib_1.__exportStar(__nccwpck_require__(2749), exports); -tslib_1.__exportStar(__nccwpck_require__(21733), exports); -tslib_1.__exportStar(__nccwpck_require__(38867), exports); -tslib_1.__exportStar(__nccwpck_require__(86794), exports); -tslib_1.__exportStar(__nccwpck_require__(41948), exports); -tslib_1.__exportStar(__nccwpck_require__(93542), exports); -tslib_1.__exportStar(__nccwpck_require__(41797), exports); -tslib_1.__exportStar(__nccwpck_require__(99707), exports); -tslib_1.__exportStar(__nccwpck_require__(71175), exports); -tslib_1.__exportStar(__nccwpck_require__(65044), exports); -tslib_1.__exportStar(__nccwpck_require__(81853), exports); -tslib_1.__exportStar(__nccwpck_require__(20556), exports); -tslib_1.__exportStar(__nccwpck_require__(5823), exports); -tslib_1.__exportStar(__nccwpck_require__(20335), exports); - - -/***/ }), - -/***/ 71175: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +/***/ }), -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LazyJsonString = exports.StringWrapper = void 0; -const StringWrapper = function () { - const Class = Object.getPrototypeOf(this).constructor; - const Constructor = Function.bind.apply(String, [null, ...arguments]); - const instance = new Constructor(); - Object.setPrototypeOf(instance, Class.prototype); - return instance; +/***/ "./node_modules/core-js/modules/_hide.js": +/*!***********************************************!*\ + !*** ./node_modules/core-js/modules/_hide.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_162665__) { + +var dP = __nested_webpack_require_162665__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); +var createDesc = __nested_webpack_require_162665__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); +module.exports = __nested_webpack_require_162665__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") ? function (object, key, value) { + return dP.f(object, key, createDesc(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; }; -exports.StringWrapper = StringWrapper; -exports.StringWrapper.prototype = Object.create(String.prototype, { - constructor: { - value: exports.StringWrapper, - enumerable: false, - writable: true, - configurable: true, - }, -}); -Object.setPrototypeOf(exports.StringWrapper, String); -class LazyJsonString extends exports.StringWrapper { - deserializeJSON() { - return JSON.parse(super.toString()); - } - toJSON() { - return super.toString(); - } - static fromObject(object) { - if (object instanceof LazyJsonString) { - return object; - } - else if (object instanceof String || typeof object === "string") { - return new LazyJsonString(object); - } - return new LazyJsonString(JSON.stringify(object)); - } -} -exports.LazyJsonString = LazyJsonString; /***/ }), -/***/ 65044: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/_html.js": +/*!***********************************************!*\ + !*** ./node_modules/core-js/modules/_html.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_163457__) { -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.convertMap = exports.map = void 0; -function map(arg0, arg1, arg2) { - let target; - let filter; - let instructions; - if (typeof arg1 === "undefined" && typeof arg2 === "undefined") { - target = {}; - instructions = arg0; - } - else { - target = arg0; - if (typeof arg1 === "function") { - filter = arg1; - instructions = arg2; - return mapWithFilter(target, filter, instructions); - } - else { - instructions = arg1; - } - } - for (const key of Object.keys(instructions)) { - if (!Array.isArray(instructions[key])) { - target[key] = instructions[key]; - continue; - } - let [filter, value] = instructions[key]; - if (typeof value === "function") { - let _value; - const defaultFilterPassed = filter === undefined && (_value = value()) != null; - const customFilterPassed = (typeof filter === "function" && !!filter(void 0)) || (typeof filter !== "function" && !!filter); - if (defaultFilterPassed) { - target[key] = _value; - } - else if (customFilterPassed) { - target[key] = value(); - } - } - else { - const defaultFilterPassed = filter === undefined && value != null; - const customFilterPassed = (typeof filter === "function" && !!filter(value)) || (typeof filter !== "function" && !!filter); - if (defaultFilterPassed || customFilterPassed) { - target[key] = value; - } - } - } - return target; -} -exports.map = map; -const convertMap = (target) => { - const output = {}; - for (const [k, v] of Object.entries(target || {})) { - output[k] = [, v]; - } - return output; -}; -exports.convertMap = convertMap; -const mapWithFilter = (target, filter, instructions) => { - return map(target, Object.entries(instructions).reduce((_instructions, [key, value]) => { - if (Array.isArray(value)) { - _instructions[key] = value; - } - else { - if (typeof value === "function") { - _instructions[key] = [filter, value()]; - } - else { - _instructions[key] = [filter, value]; - } - } - return _instructions; - }, {})); -}; +var document = __nested_webpack_require_163457__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").document; +module.exports = document && document.documentElement; /***/ }), -/***/ 81853: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/_ie8-dom-define.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/_ie8-dom-define.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_163967__) { -"use strict"; +module.exports = !__nested_webpack_require_163967__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && !__nested_webpack_require_163967__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + return Object.defineProperty(__nested_webpack_require_163967__(/*! ./_dom-create */ "./node_modules/core-js/modules/_dom-create.js")('div'), 'a', { get: function () { return 7; } }).a != 7; +}); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.strictParseByte = exports.strictParseShort = exports.strictParseInt32 = exports.strictParseInt = exports.strictParseLong = exports.limitedParseFloat32 = exports.limitedParseFloat = exports.handleFloat = exports.limitedParseDouble = exports.strictParseFloat32 = exports.strictParseFloat = exports.strictParseDouble = exports.expectUnion = exports.expectString = exports.expectObject = exports.expectNonNull = exports.expectByte = exports.expectShort = exports.expectInt32 = exports.expectInt = exports.expectLong = exports.expectFloat32 = exports.expectNumber = exports.expectBoolean = exports.parseBoolean = void 0; -const parseBoolean = (value) => { - switch (value) { - case "true": - return true; - case "false": - return false; - default: - throw new Error(`Unable to parse boolean value "${value}"`); - } -}; -exports.parseBoolean = parseBoolean; -const expectBoolean = (value) => { - if (value === null || value === undefined) { - return undefined; - } - if (typeof value === "boolean") { - return value; - } - throw new TypeError(`Expected boolean, got ${typeof value}`); -}; -exports.expectBoolean = expectBoolean; -const expectNumber = (value) => { - if (value === null || value === undefined) { - return undefined; - } - if (typeof value === "number") { - return value; - } - throw new TypeError(`Expected number, got ${typeof value}`); -}; -exports.expectNumber = expectNumber; -const MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23)); -const expectFloat32 = (value) => { - const expected = (0, exports.expectNumber)(value); - if (expected !== undefined && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) { - if (Math.abs(expected) > MAX_FLOAT) { - throw new TypeError(`Expected 32-bit float, got ${value}`); - } - } - return expected; -}; -exports.expectFloat32 = expectFloat32; -const expectLong = (value) => { - if (value === null || value === undefined) { - return undefined; - } - if (Number.isInteger(value) && !Number.isNaN(value)) { - return value; - } - throw new TypeError(`Expected integer, got ${typeof value}`); -}; -exports.expectLong = expectLong; -exports.expectInt = exports.expectLong; -const expectInt32 = (value) => expectSizedInt(value, 32); -exports.expectInt32 = expectInt32; -const expectShort = (value) => expectSizedInt(value, 16); -exports.expectShort = expectShort; -const expectByte = (value) => expectSizedInt(value, 8); -exports.expectByte = expectByte; -const expectSizedInt = (value, size) => { - const expected = (0, exports.expectLong)(value); - if (expected !== undefined && castInt(expected, size) !== expected) { - throw new TypeError(`Expected ${size}-bit integer, got ${value}`); - } - return expected; -}; -const castInt = (value, size) => { - switch (size) { - case 32: - return Int32Array.of(value)[0]; - case 16: - return Int16Array.of(value)[0]; - case 8: - return Int8Array.of(value)[0]; - } -}; -const expectNonNull = (value, location) => { - if (value === null || value === undefined) { - if (location) { - throw new TypeError(`Expected a non-null value for ${location}`); - } - throw new TypeError("Expected a non-null value"); - } ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - return value; -}; -var loadRestJsonErrorCode = (output, data) => { - const findKey = (object, key) => Object.keys(object).find((k2) => k2.toLowerCase() === key.toLowerCase()); - const sanitizeErrorCode = (rawValue) => { - let cleanValue = rawValue; - if (typeof cleanValue === "number") { - cleanValue = cleanValue.toString(); - } - if (cleanValue.indexOf(",") >= 0) { - cleanValue = cleanValue.split(",")[0]; - } - if (cleanValue.indexOf(":") >= 0) { - cleanValue = cleanValue.split(":")[0]; - } - if (cleanValue.indexOf("#") >= 0) { - cleanValue = cleanValue.split("#")[1]; - } - return cleanValue; - }; - const headerKey = findKey(output.headers, "x-amzn-errortype"); - if (headerKey !== void 0) { - return sanitizeErrorCode(output.headers[headerKey]); - } - if (data.code !== void 0) { - return sanitizeErrorCode(data.code); - } - if (data["__type"] !== void 0) { - return sanitizeErrorCode(data["__type"]); - } -}; -var CreateTokenCommand = class _CreateTokenCommand extends smithy_client_7.Command { - constructor(input) { - super(); - this.input = input; - } - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_2.getEndpointPlugin)(configuration, _CreateTokenCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "SSOOIDCClient"; - const commandName = "CreateTokenCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_1.SMITHY_CONTEXT_KEY]: { - service: "AWSSSOOIDCService", - operation: "CreateToken", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return se_CreateTokenCommand(input, context); - } - deserialize(output, context) { - return de_CreateTokenCommand(output, context); - } -}; -exports.CreateTokenCommand = CreateTokenCommand; -const middleware_endpoint_3 = __nccwpck_require__(24916); -const middleware_serde_2 = __nccwpck_require__(4247); -const smithy_client_10 = __nccwpck_require__(33218); -const types_2 = __nccwpck_require__(75751); -var RegisterClientCommand = class _RegisterClientCommand extends smithy_client_10.Command { - constructor(input) { - super(); - this.input = input; - } - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_2.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_3.getEndpointPlugin)(configuration, _RegisterClientCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "SSOOIDCClient"; - const commandName = "RegisterClientCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_2.SMITHY_CONTEXT_KEY]: { - service: "AWSSSOOIDCService", - operation: "RegisterClient", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return se_RegisterClientCommand(input, context); - } - deserialize(output, context) { - return de_RegisterClientCommand(output, context); - } -}; -const middleware_endpoint_4 = __nccwpck_require__(24916); -const middleware_serde_3 = __nccwpck_require__(4247); -const smithy_client_11 = __nccwpck_require__(33218); -const types_3 = __nccwpck_require__(75751); -var StartDeviceAuthorizationCommand = class _StartDeviceAuthorizationCommand extends smithy_client_11.Command { - constructor(input) { - super(); - this.input = input; - } - static getEndpointParameterInstructions() { - return { - UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, - Endpoint: { type: "builtInParams", name: "endpoint" }, - Region: { type: "builtInParams", name: "region" }, - UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, - }; - } - resolveMiddleware(clientStack, configuration, options) { - this.middlewareStack.use((0, middleware_serde_3.getSerdePlugin)(configuration, this.serialize, this.deserialize)); - this.middlewareStack.use((0, middleware_endpoint_4.getEndpointPlugin)(configuration, _StartDeviceAuthorizationCommand.getEndpointParameterInstructions())); - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const clientName = "SSOOIDCClient"; - const commandName = "StartDeviceAuthorizationCommand"; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog: (_) => _, - outputFilterSensitiveLog: (_) => _, - [types_3.SMITHY_CONTEXT_KEY]: { - service: "AWSSSOOIDCService", - operation: "StartDeviceAuthorization", - }, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } - serialize(input, context) { - return se_StartDeviceAuthorizationCommand(input, context); - } - deserialize(output, context) { - return de_StartDeviceAuthorizationCommand(output, context); - } -}; -var commands = { - CreateTokenCommand, - RegisterClientCommand, - StartDeviceAuthorizationCommand, -}; -var SSOOIDC = class extends SSOOIDCClient { + +/***/ }), + +/***/ "./node_modules/core-js/modules/_inherit-if-required.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/_inherit-if-required.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_164725__) { + +var isObject = __nested_webpack_require_164725__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var setPrototypeOf = __nested_webpack_require_164725__(/*! ./_set-proto */ "./node_modules/core-js/modules/_set-proto.js").set; +module.exports = function (that, target, C) { + var S = target.constructor; + var P; + if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { + setPrototypeOf(that, P); + } return that; }; -(0, smithy_client_6.createAggregatedClient)(commands, SSOOIDC); /***/ }), -<<<<<<< HEAD -/***/ 49026: -/***/ ((__unused_webpack_module, exports) => { - +/***/ "./node_modules/core-js/modules/_invoke.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/_invoke.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.REFRESH_MESSAGE = exports.EXPIRE_WINDOW_MS = void 0; -exports.EXPIRE_WINDOW_MS = 5 * 60 * 1000; -exports.REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`; +// fast apply, http://jsperf.lnkit.com/fast-apply/5 +module.exports = function (fn, args, that) { + var un = that === undefined; + switch (args.length) { + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); +}; /***/ }), -/***/ 40821: -======= -/***/ 20556: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - +/***/ "./node_modules/core-js/modules/_iobject.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/_iobject.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_166506__) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -exports.fromSso = void 0; -const property_provider_1 = __nccwpck_require__(12955); -const shared_ini_file_loader_1 = __nccwpck_require__(67097); -const constants_1 = __nccwpck_require__(49026); -const getNewSsoOidcToken_1 = __nccwpck_require__(57291); -const validateTokenExpiry_1 = __nccwpck_require__(11503); -const validateTokenKey_1 = __nccwpck_require__(61684); -const writeSSOTokenToFile_1 = __nccwpck_require__(73631); -const lastRefreshAttemptTime = new Date(0); -const fromSso = (init = {}) => async () => { - const profiles = await (0, shared_ini_file_loader_1.parseKnownFiles)(init); - const profileName = (0, shared_ini_file_loader_1.getProfileName)(init); - const profile = profiles[profileName]; - if (!profile) { - throw new property_provider_1.TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false); - } - else if (!profile["sso_session"]) { - throw new property_provider_1.TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`); - } - const ssoSessionName = profile["sso_session"]; - const ssoSessions = await (0, shared_ini_file_loader_1.loadSsoSessionData)(init); - const ssoSession = ssoSessions[ssoSessionName]; - if (!ssoSession) { - throw new property_provider_1.TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false); - } - for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) { - if (!ssoSession[ssoSessionRequiredKey]) { - throw new property_provider_1.TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false); -======= -exports.resolvedPath = void 0; -const extended_encode_uri_component_1 = __nccwpck_require__(93542); -const resolvedPath = (resolvedPath, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => { - if (input != null && input[memberName] !== undefined) { - const labelValue = labelValueProvider(); - if (labelValue.length <= 0) { - throw new Error("Empty value provided for input HTTP label: " + memberName + "."); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - } - const ssoStartUrl = ssoSession["sso_start_url"]; - const ssoRegion = ssoSession["sso_region"]; - let ssoToken; - try { - ssoToken = await (0, shared_ini_file_loader_1.getSSOTokenFromFile)(ssoSessionName); - } -<<<<<<< HEAD - catch (e) { - throw new property_provider_1.TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${constants_1.REFRESH_MESSAGE}`, false); -======= - return resolvedPath; +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = __nested_webpack_require_166506__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); +// eslint-disable-next-line no-prototype-builtins +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return cof(it) == 'String' ? it.split('') : Object(it); }; -exports.resolvedPath = resolvedPath; /***/ }), -/***/ 5823: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/_is-array-iter.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_is-array-iter.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_167197__) { -"use strict"; +// check on default Array iterator +var Iterators = __nested_webpack_require_167197__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); +var ITERATOR = __nested_webpack_require_167197__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'); +var ArrayProto = Array.prototype; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.serializeFloat = void 0; -const serializeFloat = (value) => { - if (value !== value) { - return "NaN"; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - (0, validateTokenKey_1.validateTokenKey)("accessToken", ssoToken.accessToken); - (0, validateTokenKey_1.validateTokenKey)("expiresAt", ssoToken.expiresAt); - const { accessToken, expiresAt } = ssoToken; - const existingToken = { token: accessToken, expiration: new Date(expiresAt) }; - if (existingToken.expiration.getTime() - Date.now() > constants_1.EXPIRE_WINDOW_MS) { - return existingToken; - } - if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1000) { - (0, validateTokenExpiry_1.validateTokenExpiry)(existingToken); - return existingToken; - } - (0, validateTokenKey_1.validateTokenKey)("clientId", ssoToken.clientId, true); - (0, validateTokenKey_1.validateTokenKey)("clientSecret", ssoToken.clientSecret, true); - (0, validateTokenKey_1.validateTokenKey)("refreshToken", ssoToken.refreshToken, true); - try { - lastRefreshAttemptTime.setTime(Date.now()); - const newSsoOidcToken = await (0, getNewSsoOidcToken_1.getNewSsoOidcToken)(ssoToken, ssoRegion); - (0, validateTokenKey_1.validateTokenKey)("accessToken", newSsoOidcToken.accessToken); - (0, validateTokenKey_1.validateTokenKey)("expiresIn", newSsoOidcToken.expiresIn); - const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1000); - try { - await (0, writeSSOTokenToFile_1.writeSSOTokenToFile)(ssoSessionName, { - ...ssoToken, - accessToken: newSsoOidcToken.accessToken, - expiresAt: newTokenExpiration.toISOString(), - refreshToken: newSsoOidcToken.refreshToken, - }); - } - catch (error) { - } - return { - token: newSsoOidcToken.accessToken, - expiration: newTokenExpiration, - }; - } - catch (error) { - (0, validateTokenExpiry_1.validateTokenExpiry)(existingToken); - return existingToken; - } +module.exports = function (it) { + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); }; -exports.fromSso = fromSso; /***/ }), -<<<<<<< HEAD -/***/ 83767: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -======= -/***/ 20335: -/***/ ((__unused_webpack_module, exports) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - +/***/ "./node_modules/core-js/modules/_is-array.js": +/*!***************************************************!*\ + !*** ./node_modules/core-js/modules/_is-array.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_167922__) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromStatic = void 0; -const property_provider_1 = __nccwpck_require__(12955); -const fromStatic = ({ token }) => async () => { - if (!token || !token.token) { - throw new property_provider_1.TokenProviderError(`Please pass a valid token to fromStatic`, false); - } - return token; +// 7.2.2 IsArray(argument) +var cof = __nested_webpack_require_167922__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); +module.exports = Array.isArray || function isArray(arg) { + return cof(arg) == 'Array'; }; -exports.fromStatic = fromStatic; /***/ }), -<<<<<<< HEAD -/***/ 57291: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - +/***/ "./node_modules/core-js/modules/_is-integer.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_is-integer.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_168459__) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getNewSsoOidcToken = void 0; -const client_sso_oidc_node_1 = __nccwpck_require__(7559); -const getSsoOidcClient_1 = __nccwpck_require__(18314); -const getNewSsoOidcToken = (ssoToken, ssoRegion) => { - const ssoOidcClient = (0, getSsoOidcClient_1.getSsoOidcClient)(ssoRegion); - return ssoOidcClient.send(new client_sso_oidc_node_1.CreateTokenCommand({ - clientId: ssoToken.clientId, - clientSecret: ssoToken.clientSecret, - refreshToken: ssoToken.refreshToken, - grantType: "refresh_token", - })); +// 20.1.2.3 Number.isInteger(number) +var isObject = __nested_webpack_require_168459__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var floor = Math.floor; +module.exports = function isInteger(it) { + return !isObject(it) && isFinite(it) && floor(it) === it; }; -exports.getNewSsoOidcToken = getNewSsoOidcToken; /***/ }), -/***/ 18314: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - +/***/ "./node_modules/core-js/modules/_is-object.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_is-object.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSsoOidcClient = void 0; -const client_sso_oidc_node_1 = __nccwpck_require__(7559); -const ssoOidcClientsHash = {}; -const getSsoOidcClient = (ssoRegion) => { - if (ssoOidcClientsHash[ssoRegion]) { - return ssoOidcClientsHash[ssoRegion]; - } - const ssoOidcClient = new client_sso_oidc_node_1.SSOOIDCClient({ region: ssoRegion }); - ssoOidcClientsHash[ssoRegion] = ssoOidcClient; - return ssoOidcClient; +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; }; -exports.getSsoOidcClient = getSsoOidcClient; /***/ }), -/***/ 64260: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_is-regexp.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_is-regexp.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_169474__) { + +// 7.2.8 IsRegExp(argument) +var isObject = __nested_webpack_require_169474__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var cof = __nested_webpack_require_169474__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); +var MATCH = __nested_webpack_require_169474__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('match'); +module.exports = function (it) { + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(4578); -tslib_1.__exportStar(__nccwpck_require__(7559), exports); -tslib_1.__exportStar(__nccwpck_require__(40821), exports); -tslib_1.__exportStar(__nccwpck_require__(83767), exports); -tslib_1.__exportStar(__nccwpck_require__(49273), exports); +/***/ }), + +/***/ "./node_modules/core-js/modules/_iter-call.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_iter-call.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_170271__) { + +// call something on iterator step with safe closing on error +var anObject = __nested_webpack_require_170271__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +module.exports = function (iterator, fn, value, entries) { + try { + return entries ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch (e) { + var ret = iterator['return']; + if (ret !== undefined) anObject(ret.call(iterator)); + throw e; + } +}; /***/ }), -/***/ 49273: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_iter-create.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_iter-create.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_171081__) { +"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.nodeProvider = void 0; -const property_provider_1 = __nccwpck_require__(12955); -const fromSso_1 = __nccwpck_require__(40821); -const nodeProvider = (init = {}) => (0, property_provider_1.memoize)((0, property_provider_1.chain)((0, fromSso_1.fromSso)(init), async () => { - throw new property_provider_1.TokenProviderError("Could not load token from any providers", false); -}), (token) => token.expiration !== undefined && token.expiration.getTime() - Date.now() < 300000, (token) => token.expiration !== undefined); -exports.nodeProvider = nodeProvider; +var create = __nested_webpack_require_171081__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js"); +var descriptor = __nested_webpack_require_171081__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); +var setToStringTag = __nested_webpack_require_171081__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js"); +var IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +__nested_webpack_require_171081__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js")(IteratorPrototype, __nested_webpack_require_171081__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'), function () { return this; }); + +module.exports = function (Constructor, NAME, next) { + Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); + setToStringTag(Constructor, NAME + ' Iterator'); +}; /***/ }), -/***/ 11503: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_iter-define.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_iter-define.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_172269__) { +"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.validateTokenExpiry = void 0; -const property_provider_1 = __nccwpck_require__(12955); -const constants_1 = __nccwpck_require__(49026); -const validateTokenExpiry = (token) => { - if (token.expiration && token.expiration.getTime() < Date.now()) { - throw new property_provider_1.TokenProviderError(`Token is expired. ${constants_1.REFRESH_MESSAGE}`, false); +var LIBRARY = __nested_webpack_require_172269__(/*! ./_library */ "./node_modules/core-js/modules/_library.js"); +var $export = __nested_webpack_require_172269__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var redefine = __nested_webpack_require_172269__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var hide = __nested_webpack_require_172269__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var Iterators = __nested_webpack_require_172269__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); +var $iterCreate = __nested_webpack_require_172269__(/*! ./_iter-create */ "./node_modules/core-js/modules/_iter-create.js"); +var setToStringTag = __nested_webpack_require_172269__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js"); +var getPrototypeOf = __nested_webpack_require_172269__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var ITERATOR = __nested_webpack_require_172269__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'); +var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` +var FF_ITERATOR = '@@iterator'; +var KEYS = 'keys'; +var VALUES = 'values'; + +var returnThis = function () { return this; }; + +module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { + $iterCreate(Constructor, NAME, next); + var getMethod = function (kind) { + if (!BUGGY && kind in proto) return proto[kind]; + switch (kind) { + case KEYS: return function keys() { return new Constructor(this, kind); }; + case VALUES: return function values() { return new Constructor(this, kind); }; + } return function entries() { return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator'; + var DEF_VALUES = DEFAULT == VALUES; + var VALUES_BUG = false; + var proto = Base.prototype; + var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; + var $default = $native || getMethod(DEFAULT); + var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; + var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; + var methods, key, IteratorPrototype; + // Fix native + if ($anyNative) { + IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); + if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if (DEF_VALUES && $native && $native.name !== VALUES) { + VALUES_BUG = true; + $default = function values() { return $native.call(this); }; + } + // Define iterator + if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if (DEFAULT) { + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if (FORCED) for (key in methods) { + if (!(key in proto)) redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; }; -exports.validateTokenExpiry = validateTokenExpiry; /***/ }), -/***/ 61684: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_iter-detect.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_iter-detect.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_175955__) { +var ITERATOR = __nested_webpack_require_175955__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'); +var SAFE_CLOSING = false; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.validateTokenKey = void 0; -const property_provider_1 = __nccwpck_require__(12955); -const constants_1 = __nccwpck_require__(49026); -const validateTokenKey = (key, value, forRefresh = false) => { - if (typeof value === "undefined") { - throw new property_provider_1.TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${constants_1.REFRESH_MESSAGE}`, false); - } +try { + var riter = [7][ITERATOR](); + riter['return'] = function () { SAFE_CLOSING = true; }; + // eslint-disable-next-line no-throw-literal + Array.from(riter, function () { throw 2; }); +} catch (e) { /* empty */ } + +module.exports = function (exec, skipClosing) { + if (!skipClosing && !SAFE_CLOSING) return false; + var safe = false; + try { + var arr = [7]; + var iter = arr[ITERATOR](); + iter.next = function () { return { done: safe = true }; }; + arr[ITERATOR] = function () { return iter; }; + exec(arr); + } catch (e) { /* empty */ } + return safe; }; -exports.validateTokenKey = validateTokenKey; /***/ }), -/***/ 73631: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - +/***/ "./node_modules/core-js/modules/_iter-step.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_iter-step.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.writeSSOTokenToFile = void 0; -const shared_ini_file_loader_1 = __nccwpck_require__(67097); -const fs_1 = __nccwpck_require__(57147); -const { writeFile } = fs_1.promises; -const writeSSOTokenToFile = (id, ssoToken) => { - const tokenFilepath = (0, shared_ini_file_loader_1.getSSOTokenFilepath)(id); - const tokenString = JSON.stringify(ssoToken, null, 2); - return writeFile(tokenFilepath, tokenString); +module.exports = function (done, value) { + return { value: value, done: !!done }; }; -exports.writeSSOTokenToFile = writeSSOTokenToFile; /***/ }), -/***/ 4578: -======= -/***/ 45945: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { +/***/ "./node_modules/core-js/modules/_iterators.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_iterators.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -/****************************************************************************** -Copyright (c) Microsoft Corporation. +module.exports = {}; -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. -<<<<<<< HEAD -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); -======= /***/ }), -/***/ 13797: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_library.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/_library.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -"use strict"; +module.exports = false; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseUrl = void 0; -const querystring_parser_1 = __nccwpck_require__(59634); -const parseUrl = (url) => { - const { hostname, pathname, port, protocol, search } = new URL(url); - let query; - if (search) { - query = (0, querystring_parser_1.parseQueryString)(search); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; +/***/ }), - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; +/***/ "./node_modules/core-js/modules/_math-expm1.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_math-expm1.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; +// 20.2.2.14 Math.expm1(x) +var $expm1 = Math.expm1; +module.exports = (!$expm1 + // Old FF bug + || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 + // Tor Browser bug + || $expm1(-2e-17) != -2e-17 +) ? function expm1(x) { + return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; +} : $expm1; - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +/***/ }), - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; +/***/ "./node_modules/core-js/modules/_math-fround.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_math-fround.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_178692__) { - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; +// 20.2.2.16 Math.fround(x) +var sign = __nested_webpack_require_178692__(/*! ./_math-sign */ "./node_modules/core-js/modules/_math-sign.js"); +var pow = Math.pow; +var EPSILON = pow(2, -52); +var EPSILON32 = pow(2, -23); +var MAX32 = pow(2, 127) * (2 - EPSILON32); +var MIN32 = pow(2, -126); - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; +var roundTiesToEven = function (n) { + return n + 1 / EPSILON - 1 / EPSILON; +}; - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; +module.exports = Math.fround || function fround(x) { + var $abs = Math.abs(x); + var $sign = sign(x); + var a, result; + if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; + a = (1 + EPSILON32 / EPSILON) * $abs; + result = a - (a - $abs); + // eslint-disable-next-line no-self-compare + if (result > MAX32 || result != result) return $sign * Infinity; + return $sign * result; +}; - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - __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()); - }); - }; +/***/ }), - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; +/***/ "./node_modules/core-js/modules/_math-log1p.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_math-log1p.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +// 20.2.2.20 Math.log1p(x) +module.exports = Math.log1p || function log1p(x) { + return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); +}; - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; +/***/ }), - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +/***/ "./node_modules/core-js/modules/_math-scale.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_math-scale.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +// https://rwaldron.github.io/proposal-math-extensions/ +module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { + if ( + arguments.length === 0 + // eslint-disable-next-line no-self-compare + || x != x + // eslint-disable-next-line no-self-compare + || inLow != inLow + // eslint-disable-next-line no-self-compare + || inHigh != inHigh + // eslint-disable-next-line no-self-compare + || outLow != outLow + // eslint-disable-next-line no-self-compare + || outHigh != outHigh + ) return NaN; + if (x === Infinity || x === -Infinity) return x; + return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; +}; - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; +/***/ }), - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +/***/ "./node_modules/core-js/modules/_math-sign.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_math-sign.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; +// 20.2.2.28 Math.sign(x) +module.exports = Math.sign || function sign(x) { + // eslint-disable-next-line no-self-compare + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; +}; - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +/***/ }), - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; +/***/ "./node_modules/core-js/modules/_meta.js": +/*!***********************************************!*\ + !*** ./node_modules/core-js/modules/_meta.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_181726__) { - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +var META = __nested_webpack_require_181726__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js")('meta'); +var isObject = __nested_webpack_require_181726__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var has = __nested_webpack_require_181726__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var setDesc = __nested_webpack_require_181726__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +var id = 0; +var isExtensible = Object.isExtensible || function () { + return true; +}; +var FREEZE = !__nested_webpack_require_181726__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + return isExtensible(Object.preventExtensions({})); +}); +var setMeta = function (it) { + setDesc(it, META, { value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + } }); +}; +var fastKey = function (it, create) { + // return primitive with prefix + if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if (!has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return 'F'; + // not necessary to add metadata + if (!create) return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; +}; +var getWeak = function (it, create) { + if (!has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return true; + // not necessary to add metadata + if (!create) return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; +}; +// add metadata on freeze-family methods calling +var onFreeze = function (it) { + if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); + return it; +}; +var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze +}; - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; +/***/ }), - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +/***/ "./node_modules/core-js/modules/_metadata.js": +/*!***************************************************!*\ + !*** ./node_modules/core-js/modules/_metadata.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_183912__) { - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; +var Map = __nested_webpack_require_183912__(/*! ./es6.map */ "./node_modules/core-js/modules/es6.map.js"); +var $export = __nested_webpack_require_183912__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var shared = __nested_webpack_require_183912__(/*! ./_shared */ "./node_modules/core-js/modules/_shared.js")('metadata'); +var store = shared.store || (shared.store = new (__nested_webpack_require_183912__(/*! ./es6.weak-map */ "./node_modules/core-js/modules/es6.weak-map.js"))()); - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; +var getOrCreateMetadataMap = function (target, targetKey, create) { + var targetMetadata = store.get(target); + if (!targetMetadata) { + if (!create) return undefined; + store.set(target, targetMetadata = new Map()); + } + var keyMetadata = targetMetadata.get(targetKey); + if (!keyMetadata) { + if (!create) return undefined; + targetMetadata.set(targetKey, keyMetadata = new Map()); + } return keyMetadata; +}; +var ordinaryHasOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? false : metadataMap.has(MetadataKey); +}; +var ordinaryGetOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); +}; +var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) { + getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); +}; +var ordinaryOwnMetadataKeys = function (target, targetKey) { + var metadataMap = getOrCreateMetadataMap(target, targetKey, false); + var keys = []; + if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); }); + return keys; +}; +var toMetaKey = function (it) { + return it === undefined || typeof it == 'symbol' ? it : String(it); +}; +var exp = function (O) { + $export($export.S, 'Reflect', O); +}; - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; +module.exports = { + store: store, + map: getOrCreateMetadataMap, + has: ordinaryHasOwnMetadata, + get: ordinaryGetOwnMetadata, + set: ordinaryDefineOwnMetadata, + keys: ordinaryOwnMetadataKeys, + key: toMetaKey, + exp: exp +}; - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); +/***/ }), +/***/ "./node_modules/core-js/modules/_microtask.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_microtask.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_186292__) { -/***/ }), +var global = __nested_webpack_require_186292__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var macrotask = __nested_webpack_require_186292__(/*! ./_task */ "./node_modules/core-js/modules/_task.js").set; +var Observer = global.MutationObserver || global.WebKitMutationObserver; +var process = global.process; +var Promise = global.Promise; +var isNode = __nested_webpack_require_186292__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js")(process) == 'process'; -<<<<<<< HEAD -/***/ 84122: -======= -/***/ 1679: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { +module.exports = function () { + var head, last, notify; + var flush = function () { + var parent, fn; + if (isNode && (parent = process.domain)) parent.exit(); + while (head) { + fn = head.fn; + head = head.next; + try { + fn(); + } catch (e) { + if (head) notify(); + else last = undefined; + throw e; + } + } last = undefined; + if (parent) parent.enter(); + }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.build = exports.parse = exports.validate = void 0; -const validate = (str) => typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6; -exports.validate = validate; -const parse = (arn) => { - const segments = arn.split(":"); - if (segments.length < 6 || segments[0] !== "arn") - throw new Error("Malformed ARN"); - const [, partition, service, region, accountId, ...resource] = segments; - return { - partition, - service, - region, - accountId, - resource: resource.join(":"), + // Node.js + if (isNode) { + notify = function () { + process.nextTick(flush); }; + // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 + } else if (Observer && !(global.navigator && global.navigator.standalone)) { + var toggle = true; + var node = document.createTextNode(''); + new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new + notify = function () { + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if (Promise && Promise.resolve) { + // Promise.resolve without an argument throws an error in LG WebOS 2 + var promise = Promise.resolve(undefined); + notify = function () { + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function () { + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + return function (fn) { + var task = { fn: fn, next: undefined }; + if (last) last.next = task; + if (!head) { + head = task; + notify(); + } last = task; + }; }; -exports.parse = parse; -const build = (arnObject) => { - const { partition = "aws", service, region, accountId, resource } = arnObject; - if ([service, region, accountId, resource].some((segment) => typeof segment !== "string")) { - throw new Error("Input ARN object is invalid"); - } - return `arn:${partition}:${service}:${region}:${accountId}:${resource}`; -}; -exports.build = build; /***/ }), -<<<<<<< HEAD -/***/ 47480: -======= -/***/ 7147: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_new-promise-capability.js": +/*!*****************************************************************!*\ + !*** ./node_modules/core-js/modules/_new-promise-capability.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_188832__) { +"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const util_endpoints_1 = __nccwpck_require__(34548); -const isVirtualHostableS3Bucket_1 = __nccwpck_require__(22209); -const parseArn_1 = __nccwpck_require__(42880); -const partition_1 = __nccwpck_require__(88088); -const awsEndpointFunctions = { - isVirtualHostableS3Bucket: isVirtualHostableS3Bucket_1.isVirtualHostableS3Bucket, - parseArn: parseArn_1.parseArn, - partition: partition_1.partition, -======= -exports.toBase64 = exports.fromBase64 = void 0; -const util_buffer_from_1 = __nccwpck_require__(87048); -const BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/; -function fromBase64(input) { - if ((input.length * 3) % 4 !== 0) { - throw new TypeError(`Incorrect padding on base64 string.`); - } - if (!BASE64_REGEX.exec(input)) { - throw new TypeError(`Invalid base64 string.`); - } - const buffer = (0, util_buffer_from_1.fromString)(input, "base64"); - return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); -} -exports.fromBase64 = fromBase64; -function toBase64(input) { - return (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("base64"); +// 25.4.1.5 NewPromiseCapability(C) +var aFunction = __nested_webpack_require_188832__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); + +function PromiseCapability(C) { + var resolve, reject; + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); } -exports.toBase64 = toBase64; + +module.exports.f = function (C) { + return new PromiseCapability(C); +}; /***/ }), -/***/ 96869: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_object-assign.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_object-assign.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_189746__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.calculateBodyLength = void 0; -const fs_1 = __nccwpck_require__(57147); -const calculateBodyLength = (body) => { - if (!body) { - return 0; - } - if (typeof body === "string") { - return Buffer.from(body).length; - } - else if (typeof body.byteLength === "number") { - return body.byteLength; - } - else if (typeof body.size === "number") { - return body.size; - } - else if (typeof body.path === "string" || Buffer.isBuffer(body.path)) { - return (0, fs_1.lstatSync)(body.path).size; - } - else if (typeof body.fd === "number") { - return (0, fs_1.fstatSync)(body.fd).size; +// 19.1.2.1 Object.assign(target, source, ...) +var DESCRIPTORS = __nested_webpack_require_189746__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); +var getKeys = __nested_webpack_require_189746__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); +var gOPS = __nested_webpack_require_189746__(/*! ./_object-gops */ "./node_modules/core-js/modules/_object-gops.js"); +var pIE = __nested_webpack_require_189746__(/*! ./_object-pie */ "./node_modules/core-js/modules/_object-pie.js"); +var toObject = __nested_webpack_require_189746__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var IObject = __nested_webpack_require_189746__(/*! ./_iobject */ "./node_modules/core-js/modules/_iobject.js"); +var $assign = Object.assign; + +// should work with symbols and should have deterministic property order (V8 bug) +module.exports = !$assign || __nested_webpack_require_189746__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + var A = {}; + var B = {}; + // eslint-disable-next-line no-undef + var S = Symbol(); + var K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function (k) { B[k] = k; }); + return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; +}) ? function assign(target, source) { // eslint-disable-line no-unused-vars + var T = toObject(target); + var aLen = arguments.length; + var index = 1; + var getSymbols = gOPS.f; + var isEnum = pIE.f; + while (aLen > index) { + var S = IObject(arguments[index++]); + var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); + var length = keys.length; + var j = 0; + var key; + while (length > j) { + key = keys[j++]; + if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key]; } - throw new Error(`Body Length computation failed for ${body}`); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -}; -util_endpoints_1.customEndpointFunctions.aws = awsEndpointFunctions; + } return T; +} : $assign; /***/ }), -<<<<<<< HEAD -/***/ 60698: -======= -/***/ 19989: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_object-create.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_object-create.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_191821__) { + +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = __nested_webpack_require_191821__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var dPs = __nested_webpack_require_191821__(/*! ./_object-dps */ "./node_modules/core-js/modules/_object-dps.js"); +var enumBugKeys = __nested_webpack_require_191821__(/*! ./_enum-bug-keys */ "./node_modules/core-js/modules/_enum-bug-keys.js"); +var IE_PROTO = __nested_webpack_require_191821__(/*! ./_shared-key */ "./node_modules/core-js/modules/_shared-key.js")('IE_PROTO'); +var Empty = function () { /* empty */ }; +var PROTOTYPE = 'prototype'; +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var createDict = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = __nested_webpack_require_191821__(/*! ./_dom-create */ "./node_modules/core-js/modules/_dom-create.js")('iframe'); + var i = enumBugKeys.length; + var lt = '<'; + var gt = '>'; + var iframeDocument; + iframe.style.display = 'none'; + __nested_webpack_require_191821__(/*! ./_html */ "./node_modules/core-js/modules/_html.js").appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(27208); -tslib_1.__exportStar(__nccwpck_require__(47480), exports); -tslib_1.__exportStar(__nccwpck_require__(88088), exports); -tslib_1.__exportStar(__nccwpck_require__(30287), exports); -tslib_1.__exportStar(__nccwpck_require__(4389), exports); -tslib_1.__exportStar(__nccwpck_require__(56159), exports); -======= -const tslib_1 = __nccwpck_require__(59799); -tslib_1.__exportStar(__nccwpck_require__(96869), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +module.exports = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + Empty[PROTOTYPE] = anObject(O); + result = new Empty(); + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); +}; /***/ }), -<<<<<<< HEAD -/***/ 22209: -======= -/***/ 59799: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. +/***/ "./node_modules/core-js/modules/_object-dp.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_object-dp.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_194040__) { -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. +var anObject = __nested_webpack_require_194040__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var IE8_DOM_DEFINE = __nested_webpack_require_194040__(/*! ./_ie8-dom-define */ "./node_modules/core-js/modules/_ie8-dom-define.js"); +var toPrimitive = __nested_webpack_require_194040__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); +var dP = Object.defineProperty; -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; +exports.f = __nested_webpack_require_194040__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") ? Object.defineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; +/***/ }), - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; +/***/ "./node_modules/core-js/modules/_object-dps.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_object-dps.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_195238__) { - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; +var dP = __nested_webpack_require_195238__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); +var anObject = __nested_webpack_require_195238__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var getKeys = __nested_webpack_require_195238__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +module.exports = __nested_webpack_require_195238__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") ? Object.defineProperties : function defineProperties(O, Properties) { + anObject(O); + var keys = getKeys(Properties); + var length = keys.length; + var i = 0; + var P; + while (length > i) dP.f(O, P = keys[i++], Properties[P]); + return O; +}; - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - __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()); - }); - }; +/***/ }), - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; +/***/ "./node_modules/core-js/modules/_object-forced-pam.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/_object-forced-pam.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_196262__) { - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +"use strict"; - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +// Forced replacement prototype accessors methods +module.exports = __nested_webpack_require_196262__(/*! ./_library */ "./node_modules/core-js/modules/_library.js") || !__nested_webpack_require_196262__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + var K = Math.random(); + // In FF throws only define methods + // eslint-disable-next-line no-undef, no-useless-call + __defineSetter__.call(null, K, function () { /* empty */ }); + delete __nested_webpack_require_196262__(/*! ./_global */ "./node_modules/core-js/modules/_global.js")[K]; +}); - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; +/***/ }), - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +/***/ "./node_modules/core-js/modules/_object-gopd.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_object-gopd.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_197143__) { - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +var pIE = __nested_webpack_require_197143__(/*! ./_object-pie */ "./node_modules/core-js/modules/_object-pie.js"); +var createDesc = __nested_webpack_require_197143__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); +var toIObject = __nested_webpack_require_197143__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var toPrimitive = __nested_webpack_require_197143__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); +var has = __nested_webpack_require_197143__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var IE8_DOM_DEFINE = __nested_webpack_require_197143__(/*! ./_ie8-dom-define */ "./node_modules/core-js/modules/_ie8-dom-define.js"); +var gOPD = Object.getOwnPropertyDescriptor; - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; +exports.f = __nested_webpack_require_197143__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") ? gOPD : function getOwnPropertyDescriptor(O, P) { + O = toIObject(O); + P = toPrimitive(P, true); + if (IE8_DOM_DEFINE) try { + return gOPD(O, P); + } catch (e) { /* empty */ } + if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); +}; - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +/***/ }), - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; +/***/ "./node_modules/core-js/modules/_object-gopn-ext.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/_object-gopn-ext.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_198530__) { - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +var toIObject = __nested_webpack_require_198530__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var gOPN = __nested_webpack_require_198530__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f; +var toString = {}.toString; - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; +var getWindowNames = function (it) { + try { + return gOPN(it); + } catch (e) { + return windowNames.slice(); + } +}; - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +module.exports.f = function getOwnPropertyNames(it) { + return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); +}; - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; +/***/ }), - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +/***/ "./node_modules/core-js/modules/_object-gopn.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_object-gopn.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_199601__) { - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = __nested_webpack_require_199601__(/*! ./_object-keys-internal */ "./node_modules/core-js/modules/_object-keys-internal.js"); +var hiddenKeys = __nested_webpack_require_199601__(/*! ./_enum-bug-keys */ "./node_modules/core-js/modules/_enum-bug-keys.js").concat('length', 'prototype'); - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return $keys(O, hiddenKeys); +}; /***/ }), -/***/ 87048: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - +/***/ "./node_modules/core-js/modules/_object-gops.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_object-gops.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -exports.isVirtualHostableS3Bucket = void 0; -const util_endpoints_1 = __nccwpck_require__(34548); -const isIpAddress_1 = __nccwpck_require__(30287); -const isVirtualHostableS3Bucket = (value, allowSubDomains = false) => { - if (allowSubDomains) { - for (const label of value.split(".")) { - if (!(0, exports.isVirtualHostableS3Bucket)(label)) { - return false; - } - } -======= -exports.fromString = exports.fromArrayBuffer = void 0; -const is_array_buffer_1 = __nccwpck_require__(1627); -const buffer_1 = __nccwpck_require__(14300); -const fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => { - if (!(0, is_array_buffer_1.isArrayBuffer)(input)) { - throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); - } - return buffer_1.Buffer.from(input, offset, length); -}; -exports.fromArrayBuffer = fromArrayBuffer; -const fromString = (input, encoding) => { - if (typeof input !== "string") { - throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`); - } - return encoding ? buffer_1.Buffer.from(input, encoding) : buffer_1.Buffer.from(input); -}; -exports.fromString = fromString; +exports.f = Object.getOwnPropertySymbols; /***/ }), -/***/ 95176: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.booleanSelector = exports.SelectorType = void 0; -var SelectorType; -(function (SelectorType) { - SelectorType["ENV"] = "env"; - SelectorType["CONFIG"] = "shared config entry"; -})(SelectorType = exports.SelectorType || (exports.SelectorType = {})); -const booleanSelector = (obj, key, type) => { - if (!(key in obj)) - return undefined; - if (obj[key] === "true") ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - return true; - } - if (!(0, util_endpoints_1.isValidHostLabel)(value)) { - return false; - } - if (value.length < 3 || value.length > 63) { - return false; - } - if (value !== value.toLowerCase()) { - return false; - } - if ((0, isIpAddress_1.isIpAddress)(value)) { - return false; - } - return true; +/***/ "./node_modules/core-js/modules/_object-gpo.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_object-gpo.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_200721__) { + +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) +var has = __nested_webpack_require_200721__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var toObject = __nested_webpack_require_200721__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var IE_PROTO = __nested_webpack_require_200721__(/*! ./_shared-key */ "./node_modules/core-js/modules/_shared-key.js")('IE_PROTO'); +var ObjectProto = Object.prototype; + +module.exports = Object.getPrototypeOf || function (O) { + O = toObject(O); + if (has(O, IE_PROTO)) return O[IE_PROTO]; + if (typeof O.constructor == 'function' && O instanceof O.constructor) { + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; }; -exports.isVirtualHostableS3Bucket = isVirtualHostableS3Bucket; /***/ }), -<<<<<<< HEAD -/***/ 42880: -======= -/***/ 46522: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_object-keys-internal.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/_object-keys-internal.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_201773__) { -"use strict"; +var has = __nested_webpack_require_201773__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var toIObject = __nested_webpack_require_201773__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var arrayIndexOf = __nested_webpack_require_201773__(/*! ./_array-includes */ "./node_modules/core-js/modules/_array-includes.js")(false); +var IE_PROTO = __nested_webpack_require_201773__(/*! ./_shared-key */ "./node_modules/core-js/modules/_shared-key.js")('IE_PROTO'); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(45121); -tslib_1.__exportStar(__nccwpck_require__(95176), exports); +module.exports = function (object, names) { + var O = toIObject(object); + var i = 0; + var result = []; + var key; + for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while (names.length > i) if (has(O, key = names[i++])) { + ~arrayIndexOf(result, key) || result.push(key); + } + return result; +}; /***/ }), -/***/ 45121: -/***/ ((module) => { +/***/ "./node_modules/core-js/modules/_object-keys.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_object-keys.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_202903__) { -/****************************************************************************** -Copyright (c) Microsoft Corporation. +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = __nested_webpack_require_202903__(/*! ./_object-keys-internal */ "./node_modules/core-js/modules/_object-keys-internal.js"); +var enumBugKeys = __nested_webpack_require_202903__(/*! ./_enum-bug-keys */ "./node_modules/core-js/modules/_enum-bug-keys.js"); -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. +module.exports = Object.keys || function keys(O) { + return $keys(O, enumBugKeys); +}; -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; +/***/ }), - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; +/***/ "./node_modules/core-js/modules/_object-pie.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_object-pie.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; +exports.f = {}.propertyIsEnumerable; - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +/***/ }), - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; +/***/ "./node_modules/core-js/modules/_object-sap.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_object-sap.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_203948__) { - __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()); - }); - }; +// most Object methods by ES6 should accept primitives +var $export = __nested_webpack_require_203948__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var core = __nested_webpack_require_203948__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); +var fails = __nested_webpack_require_203948__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +module.exports = function (KEY, exec) { + var fn = (core.Object || {})[KEY] || Object[KEY]; + var exp = {}; + exp[KEY] = exec(fn); + $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); +}; - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +/***/ }), - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +/***/ "./node_modules/core-js/modules/_object-to-array.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/_object-to-array.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_204850__) { - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; +var DESCRIPTORS = __nested_webpack_require_204850__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); +var getKeys = __nested_webpack_require_204850__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); +var toIObject = __nested_webpack_require_204850__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var isEnum = __nested_webpack_require_204850__(/*! ./_object-pie */ "./node_modules/core-js/modules/_object-pie.js").f; +module.exports = function (isEntries) { + return function (it) { + var O = toIObject(it); + var keys = getKeys(O); + var length = keys.length; + var i = 0; + var result = []; + var key; + while (length > i) { + key = keys[i++]; + if (!DESCRIPTORS || isEnum.call(O, key)) { + result.push(isEntries ? [key, O[key]] : O[key]); + } + } + return result; + }; +}; - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +/***/ }), - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +/***/ "./node_modules/core-js/modules/_own-keys.js": +/*!***************************************************!*\ + !*** ./node_modules/core-js/modules/_own-keys.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_205998__) { - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; +// all object keys, includes non-enumerable and symbols +var gOPN = __nested_webpack_require_205998__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js"); +var gOPS = __nested_webpack_require_205998__(/*! ./_object-gops */ "./node_modules/core-js/modules/_object-gops.js"); +var anObject = __nested_webpack_require_205998__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var Reflect = __nested_webpack_require_205998__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").Reflect; +module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { + var keys = gOPN.f(anObject(it)); + var getSymbols = gOPS.f; + return getSymbols ? keys.concat(getSymbols(it)) : keys; +}; - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +/***/ }), - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; +/***/ "./node_modules/core-js/modules/_parse-float.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_parse-float.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_207000__) { - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; +var $parseFloat = __nested_webpack_require_207000__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").parseFloat; +var $trim = __nested_webpack_require_207000__(/*! ./_string-trim */ "./node_modules/core-js/modules/_string-trim.js").trim; - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +module.exports = 1 / $parseFloat(__nested_webpack_require_207000__(/*! ./_string-ws */ "./node_modules/core-js/modules/_string-ws.js") + '-0') !== -Infinity ? function parseFloat(str) { + var string = $trim(String(str), 3); + var result = $parseFloat(string); + return result === 0 && string.charAt(0) == '-' ? -0 : result; +} : $parseFloat; - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +/***/ }), - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; +/***/ "./node_modules/core-js/modules/_parse-int.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_parse-int.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_207878__) { - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; +var $parseInt = __nested_webpack_require_207878__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").parseInt; +var $trim = __nested_webpack_require_207878__(/*! ./_string-trim */ "./node_modules/core-js/modules/_string-trim.js").trim; +var ws = __nested_webpack_require_207878__(/*! ./_string-ws */ "./node_modules/core-js/modules/_string-ws.js"); +var hex = /^[-+]?0[xX]/; - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { + var string = $trim(String(str), 3); + return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); +} : $parseInt; - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); +/***/ }), + +/***/ "./node_modules/core-js/modules/_perform.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/_perform.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return { e: false, v: exec() }; + } catch (e) { + return { e: true, v: e }; + } +}; /***/ }), -/***/ 44196: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/_promise-resolve.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/_promise-resolve.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_209242__) { +var anObject = __nested_webpack_require_209242__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var isObject = __nested_webpack_require_209242__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var newPromiseCapability = __nested_webpack_require_209242__(/*! ./_new-promise-capability */ "./node_modules/core-js/modules/_new-promise-capability.js"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -exports.parseArn = void 0; -const parseArn = (value) => { - const segments = value.split(":"); - if (segments.length < 6) - return null; - const [arn, partition, service, region, accountId, ...resourceId] = segments; - if (arn !== "arn" || partition === "" || service === "" || resourceId[0] === "") - return null; - return { - partition, - service, - region, - accountId, - resourceId: resourceId[0].includes("/") ? resourceId[0].split("/") : resourceId, -======= -exports.IMDS_REGION_PATH = exports.DEFAULTS_MODE_OPTIONS = exports.ENV_IMDS_DISABLED = exports.AWS_DEFAULT_REGION_ENV = exports.AWS_REGION_ENV = exports.AWS_EXECUTION_ENV = void 0; -exports.AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV"; -exports.AWS_REGION_ENV = "AWS_REGION"; -exports.AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION"; -exports.ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; -exports.DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"]; -exports.IMDS_REGION_PATH = "/latest/meta-data/placement/region"; +module.exports = function (C, x) { + anObject(C); + if (isObject(x) && x.constructor === C) return x; + var promiseCapability = newPromiseCapability.f(C); + var resolve = promiseCapability.resolve; + resolve(x); + return promiseCapability.promise; +}; /***/ }), -/***/ 92123: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/_property-desc.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_property-desc.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -"use strict"; +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_DEFAULTS_MODE_CONFIG_OPTIONS = void 0; -const AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE"; -const AWS_DEFAULTS_MODE_CONFIG = "defaults_mode"; -exports.NODE_DEFAULTS_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => { - return env[AWS_DEFAULTS_MODE_ENV]; - }, - configFileSelector: (profile) => { - return profile[AWS_DEFAULTS_MODE_CONFIG]; - }, - default: "legacy", + +/***/ }), + +/***/ "./node_modules/core-js/modules/_redefine-all.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/_redefine-all.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_210680__) { + +var redefine = __nested_webpack_require_210680__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +module.exports = function (target, src, safe) { + for (var key in src) redefine(target, key, src[key], safe); + return target; }; /***/ }), -/***/ 64664: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_redefine.js": +/*!***************************************************!*\ + !*** ./node_modules/core-js/modules/_redefine.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_211236__) { -"use strict"; +var global = __nested_webpack_require_211236__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var hide = __nested_webpack_require_211236__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var has = __nested_webpack_require_211236__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var SRC = __nested_webpack_require_211236__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js")('src'); +var $toString = __nested_webpack_require_211236__(/*! ./_function-to-string */ "./node_modules/core-js/modules/_function-to-string.js"); +var TO_STRING = 'toString'; +var TPL = ('' + $toString).split(TO_STRING); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(72298); -tslib_1.__exportStar(__nccwpck_require__(93385), exports); +__nested_webpack_require_211236__(/*! ./_core */ "./node_modules/core-js/modules/_core.js").inspectSource = function (it) { + return $toString.call(it); +}; + +(module.exports = function (O, key, val, safe) { + var isFunction = typeof val == 'function'; + if (isFunction) has(val, 'name') || hide(val, 'name', key); + if (O[key] === val) return; + if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); + if (O === global) { + O[key] = val; + } else if (!safe) { + delete O[key]; + hide(O, key, val); + } else if (O[key]) { + O[key] = val; + } else { + hide(O, key, val); + } +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative +})(Function.prototype, TO_STRING, function toString() { + return typeof this == 'function' && this[SRC] || $toString.call(this); +}); /***/ }), -/***/ 93385: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_regexp-exec-abstract.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/_regexp-exec-abstract.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_213026__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultsModeConfig = void 0; -const config_resolver_1 = __nccwpck_require__(95406); -const credential_provider_imds_1 = __nccwpck_require__(56369); -const node_config_provider_1 = __nccwpck_require__(15071); -const property_provider_1 = __nccwpck_require__(68655); -const constants_1 = __nccwpck_require__(44196); -const defaultsModeConfig_1 = __nccwpck_require__(92123); -const resolveDefaultsModeConfig = ({ region = (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS), defaultsMode = (0, node_config_provider_1.loadConfig)(defaultsModeConfig_1.NODE_DEFAULTS_MODE_CONFIG_OPTIONS), } = {}) => (0, property_provider_1.memoize)(async () => { - const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode; - switch (mode === null || mode === void 0 ? void 0 : mode.toLowerCase()) { - case "auto": - return resolveNodeDefaultsModeAuto(region); - case "in-region": - case "cross-region": - case "mobile": - case "standard": - case "legacy": - return Promise.resolve(mode === null || mode === void 0 ? void 0 : mode.toLocaleLowerCase()); - case undefined: - return Promise.resolve("legacy"); - default: - throw new Error(`Invalid parameter for "defaultsMode", expect ${constants_1.DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`); - } -}); -exports.resolveDefaultsModeConfig = resolveDefaultsModeConfig; -const resolveNodeDefaultsModeAuto = async (clientRegion) => { - if (clientRegion) { - const resolvedRegion = typeof clientRegion === "function" ? await clientRegion() : clientRegion; - const inferredRegion = await inferPhysicalRegion(); - if (!inferredRegion) { - return "standard"; - } - if (resolvedRegion === inferredRegion) { - return "in-region"; - } - else { - return "cross-region"; - } - } - return "standard"; -}; -const inferPhysicalRegion = async () => { - var _a; - if (process.env[constants_1.AWS_EXECUTION_ENV] && (process.env[constants_1.AWS_REGION_ENV] || process.env[constants_1.AWS_DEFAULT_REGION_ENV])) { - return (_a = process.env[constants_1.AWS_REGION_ENV]) !== null && _a !== void 0 ? _a : process.env[constants_1.AWS_DEFAULT_REGION_ENV]; - } - if (!process.env[constants_1.ENV_IMDS_DISABLED]) { - try { - const endpoint = await (0, credential_provider_imds_1.getInstanceMetadataEndpoint)(); - return (await (0, credential_provider_imds_1.httpRequest)({ ...endpoint, path: constants_1.IMDS_REGION_PATH })).toString(); - } - catch (e) { - } + +var classof = __nested_webpack_require_213026__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); +var builtinExec = RegExp.prototype.exec; + + // `RegExpExec` abstract operation +// https://tc39.github.io/ecma262/#sec-regexpexec +module.exports = function (R, S) { + var exec = R.exec; + if (typeof exec === 'function') { + var result = exec.call(R, S); + if (typeof result !== 'object') { + throw new TypeError('RegExp exec method returned something other than an Object or null'); } + return result; + } + if (classof(R) !== 'RegExp') { + throw new TypeError('RegExp#exec called on incompatible receiver'); + } + return builtinExec.call(R, S); }; /***/ }), -/***/ 72298: -/***/ ((module) => { +/***/ "./node_modules/core-js/modules/_regexp-exec.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_regexp-exec.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_214040__) { -/****************************************************************************** -Copyright (c) Microsoft Corporation. +"use strict"; -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; +var regexpFlags = __nested_webpack_require_214040__(/*! ./_flags */ "./node_modules/core-js/modules/_flags.js"); - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; +var nativeExec = RegExp.prototype.exec; +// This always refers to the native implementation, because the +// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, +// which loads this file before patching the method. +var nativeReplace = String.prototype.replace; - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; +var patchedExec = nativeExec; - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; +var LAST_INDEX = 'lastIndex'; - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; +var UPDATES_LAST_INDEX_WRONG = (function () { + var re1 = /a/, + re2 = /b*/g; + nativeExec.call(re1, 'a'); + nativeExec.call(re2, 'a'); + return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0; +})(); - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +// nonparticipating capturing group, copied from es5-shim's String#split patch. +var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; +var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED; - __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()); - }); - }; +if (PATCH) { + patchedExec = function exec(str) { + var re = this; + var lastIndex, reCopy, match, i; - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; + if (NPCG_INCLUDED) { + reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re)); + } + if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX]; - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; + match = nativeExec.call(re, str); - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; + if (UPDATES_LAST_INDEX_WRONG && match) { + re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex; + } + if (NPCG_INCLUDED && match && match.length > 1) { + // Fix browsers whose `exec` methods don't consistently return `undefined` + // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ + // eslint-disable-next-line no-loop-func + nativeReplace.call(match[0], reCopy, function () { + for (i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undefined) match[i] = undefined; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; + }); + } - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; + return match; + }; +} - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +module.exports = patchedExec; - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; +/***/ }), - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; +/***/ "./node_modules/core-js/modules/_replacer.js": +/*!***************************************************!*\ + !*** ./node_modules/core-js/modules/_replacer.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +module.exports = function (regExp, replace) { + var replacer = replace === Object(replace) ? function (part) { + return replace[part]; + } : replace; + return function (it) { + return String(it).replace(regExp, replacer); + }; +}; - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; +/***/ }), - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +/***/ "./node_modules/core-js/modules/_same-value.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_same-value.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; +// 7.2.9 SameValue(x, y) +module.exports = Object.is || function is(x, y) { + // eslint-disable-next-line no-self-compare + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; +}; - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; +/***/ }), - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; +/***/ "./node_modules/core-js/modules/_set-collection-from.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/_set-collection-from.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_217247__) { - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +"use strict"; - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; +// https://tc39.github.io/proposal-setmap-offrom/ +var $export = __nested_webpack_require_217247__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var aFunction = __nested_webpack_require_217247__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var ctx = __nested_webpack_require_217247__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var forOf = __nested_webpack_require_217247__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); +module.exports = function (COLLECTION) { + $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) { + var mapFn = arguments[1]; + var mapping, A, n, cb; + aFunction(this); + mapping = mapFn !== undefined; + if (mapping) aFunction(mapFn); + if (source == undefined) return new this(); + A = []; + if (mapping) { + n = 0; + cb = ctx(mapFn, arguments[2], 2); + forOf(source, false, function (nextItem) { + A.push(cb(nextItem, n++)); + }); + } else { + forOf(source, false, A.push, A); + } + return new this(A); + } }); +}; /***/ }), -/***/ 34180: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/_set-collection-of.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/_set-collection-of.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_218655__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toHex = exports.fromHex = void 0; -const SHORT_TO_HEX = {}; -const HEX_TO_SHORT = {}; -for (let i = 0; i < 256; i++) { - let encodedByte = i.toString(16).toLowerCase(); - if (encodedByte.length === 1) { - encodedByte = `0${encodedByte}`; - } - SHORT_TO_HEX[i] = encodedByte; - HEX_TO_SHORT[encodedByte] = i; -} -function fromHex(encoded) { - if (encoded.length % 2 !== 0) { - throw new Error("Hex encoded strings must have an even number length"); - } - const out = new Uint8Array(encoded.length / 2); - for (let i = 0; i < encoded.length; i += 2) { - const encodedByte = encoded.slice(i, i + 2).toLowerCase(); - if (encodedByte in HEX_TO_SHORT) { - out[i / 2] = HEX_TO_SHORT[encodedByte]; - } - else { - throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`); - } - } - return out; -} -exports.fromHex = fromHex; -function toHex(bytes) { - let out = ""; - for (let i = 0; i < bytes.byteLength; i++) { - out += SHORT_TO_HEX[bytes[i]]; - } - return out; -} -exports.toHex = toHex; +// https://tc39.github.io/proposal-setmap-offrom/ +var $export = __nested_webpack_require_218655__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +module.exports = function (COLLECTION) { + $export($export.S, COLLECTION, { of: function of() { + var length = arguments.length; + var A = new Array(length); + while (length--) A[length] = arguments[length]; + return new this(A); + } }); +}; /***/ }), -/***/ 23837: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ "./node_modules/core-js/modules/_set-proto.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_set-proto.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_219395__) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(71089); -tslib_1.__exportStar(__nccwpck_require__(71599), exports); +// Works with __proto__ only. Old v8 can't work with null proto objects. +/* eslint-disable no-proto */ +var isObject = __nested_webpack_require_219395__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var anObject = __nested_webpack_require_219395__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var check = function (O, proto) { + anObject(O); + if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); +}; +module.exports = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function (test, buggy, set) { + try { + set = __nested_webpack_require_219395__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js")(Function.call, __nested_webpack_require_219395__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js").f(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch (e) { buggy = true; } + return function setPrototypeOf(O, proto) { + check(O, proto); + if (buggy) O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check +}; /***/ }), -/***/ 71599: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/_set-species.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_set-species.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_220889__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.normalizeProvider = void 0; -const normalizeProvider = (input) => { - if (typeof input === "function") - return input; - const promisified = Promise.resolve(input); - return () => promisified; +var global = __nested_webpack_require_220889__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var dP = __nested_webpack_require_220889__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); +var DESCRIPTORS = __nested_webpack_require_220889__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); +var SPECIES = __nested_webpack_require_220889__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('species'); + +module.exports = function (KEY) { + var C = global[KEY]; + if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { + configurable: true, + get: function () { return this; } + }); }; -exports.normalizeProvider = normalizeProvider; /***/ }), -/***/ 71089: -/***/ ((module) => { +/***/ "./node_modules/core-js/modules/_set-to-string-tag.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/_set-to-string-tag.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_221858__) { -/****************************************************************************** -Copyright (c) Microsoft Corporation. +var def = __nested_webpack_require_221858__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +var has = __nested_webpack_require_221858__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var TAG = __nested_webpack_require_221858__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('toStringTag'); -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. +module.exports = function (it, tag, stat) { + if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); +}; -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; +/***/ }), - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; +/***/ "./node_modules/core-js/modules/_shared-key.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_shared-key.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_222632__) { - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; +var shared = __nested_webpack_require_222632__(/*! ./_shared */ "./node_modules/core-js/modules/_shared.js")('keys'); +var uid = __nested_webpack_require_222632__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js"); +module.exports = function (key) { + return shared[key] || (shared[key] = uid(key)); +}; - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +/***/ }), - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; +/***/ "./node_modules/core-js/modules/_shared.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/_shared.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_223226__) { - __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()); - }); - }; +var core = __nested_webpack_require_223226__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); +var global = __nested_webpack_require_223226__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var SHARED = '__core-js_shared__'; +var store = global[SHARED] || (global[SHARED] = {}); - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; +(module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); +})('versions', []).push({ + version: core.version, + mode: __nested_webpack_require_223226__(/*! ./_library */ "./node_modules/core-js/modules/_library.js") ? 'pure' : 'global', + copyright: '© 2019 Denis Pushkarev (zloirock.ru)' +}); - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +/***/ }), - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; +/***/ "./node_modules/core-js/modules/_species-constructor.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/_species-constructor.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_224203__) { - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; +// 7.3.20 SpeciesConstructor(O, defaultConstructor) +var anObject = __nested_webpack_require_224203__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var aFunction = __nested_webpack_require_224203__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var SPECIES = __nested_webpack_require_224203__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('species'); +module.exports = function (O, D) { + var C = anObject(O).constructor; + var S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); +}; - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +/***/ }), - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; +/***/ "./node_modules/core-js/modules/_strict-method.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_strict-method.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_225082__) { - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; +"use strict"; - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +var fails = __nested_webpack_require_225082__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; +module.exports = function (method, arg) { + return !!method && fails(function () { + // eslint-disable-next-line no-useless-call + arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); + }); +}; - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +/***/ }), - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; +/***/ "./node_modules/core-js/modules/_string-at.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_string-at.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_225740__) { - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; +var toInteger = __nested_webpack_require_225740__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var defined = __nested_webpack_require_225740__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +// true -> String#at +// false -> String#codePointAt +module.exports = function (TO_STRING) { + return function (that, pos) { + var s = String(defined(that)); + var i = toInteger(pos); + var l = s.length; + var a, b; + if (i < 0 || i >= l) return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; +}; - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; +/***/ }), - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +/***/ "./node_modules/core-js/modules/_string-context.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/_string-context.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_226835__) { - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; +// helper for String#{startsWith, endsWith, includes} +var isRegExp = __nested_webpack_require_226835__(/*! ./_is-regexp */ "./node_modules/core-js/modules/_is-regexp.js"); +var defined = __nested_webpack_require_226835__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); +module.exports = function (that, searchString, NAME) { + if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); + return String(defined(that)); +}; /***/ }), -/***/ 91093: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ "./node_modules/core-js/modules/_string-html.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_string-html.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_227611__) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getAwsChunkedEncodingStream = void 0; -const stream_1 = __nccwpck_require__(12781); -const getAwsChunkedEncodingStream = (readableStream, options) => { - const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options; - const checksumRequired = base64Encoder !== undefined && - checksumAlgorithmFn !== undefined && - checksumLocationName !== undefined && - streamHasher !== undefined; - const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : undefined; - const awsChunkedEncodingStream = new stream_1.Readable({ read: () => { } }); - readableStream.on("data", (data) => { - awsChunkedEncodingStream.push(`${(bodyLengthChecker(data) || 0).toString(16)}\r\n${data.toString()}\r\n`); - }); - readableStream.on("end", async () => { - awsChunkedEncodingStream.push(`0\r\n`); - if (checksumRequired) { - const checksum = base64Encoder(await digest); - awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r\n`); - awsChunkedEncodingStream.push(`\r\n`); - } - awsChunkedEncodingStream.push(null); - }); - return awsChunkedEncodingStream; +var $export = __nested_webpack_require_227611__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var fails = __nested_webpack_require_227611__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var defined = __nested_webpack_require_227611__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +var quot = /"/g; +// B.2.3.2.1 CreateHTML(string, tag, attribute, value) +var createHTML = function (string, tag, attribute, value) { + var S = String(defined(string)); + var p1 = '<' + tag; + if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; + return p1 + '>' + S + ''; +}; +module.exports = function (NAME, exec) { + var O = {}; + O[NAME] = exec(createHTML); + $export($export.P + $export.F * fails(function () { + var test = ''[NAME]('"'); + return test !== test.toLowerCase() || test.split('"').length > 3; + }), 'String', O); }; -exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream; /***/ }), -/***/ 10286: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_string-pad.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_string-pad.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_228828__) { -"use strict"; +// https://github.com/tc39/proposal-string-pad-start-end +var toLength = __nested_webpack_require_228828__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var repeat = __nested_webpack_require_228828__(/*! ./_string-repeat */ "./node_modules/core-js/modules/_string-repeat.js"); +var defined = __nested_webpack_require_228828__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(71069); -tslib_1.__exportStar(__nccwpck_require__(91093), exports); -tslib_1.__exportStar(__nccwpck_require__(3575), exports); +module.exports = function (that, maxLength, fillString, left) { + var S = String(defined(that)); + var stringLength = S.length; + var fillStr = fillString === undefined ? ' ' : String(fillString); + var intMaxLength = toLength(maxLength); + if (intMaxLength <= stringLength || fillStr == '') return S; + var fillLen = intMaxLength - stringLength; + var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); + if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); + return left ? stringFiller + S : S + stringFiller; +}; /***/ }), -/***/ 3575: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_string-repeat.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_string-repeat.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_230110__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.sdkStreamMixin = void 0; -const node_http_handler_1 = __nccwpck_require__(51062); -const util_buffer_from_1 = __nccwpck_require__(87048); -const stream_1 = __nccwpck_require__(12781); -const ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; -const sdkStreamMixin = (stream) => { - var _a, _b; - if (!(stream instanceof stream_1.Readable)) { - const name = ((_b = (_a = stream === null || stream === void 0 ? void 0 : stream.__proto__) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name) || stream; - throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`); - } - let transformed = false; - const transformToByteArray = async () => { - if (transformed) { - throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); - } - transformed = true; - return await (0, node_http_handler_1.streamCollector)(stream); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - }; +var toInteger = __nested_webpack_require_230110__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var defined = __nested_webpack_require_230110__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); + +module.exports = function repeat(count) { + var str = String(defined(this)); + var res = ''; + var n = toInteger(count); + if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); + for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; + return res; }; -exports.parseArn = parseArn; /***/ }), -<<<<<<< HEAD -/***/ 88088: -======= -/***/ 71069: -/***/ ((module) => { +/***/ "./node_modules/core-js/modules/_string-trim.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_string-trim.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_230947__) { -/****************************************************************************** -Copyright (c) Microsoft Corporation. +var $export = __nested_webpack_require_230947__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var defined = __nested_webpack_require_230947__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +var fails = __nested_webpack_require_230947__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var spaces = __nested_webpack_require_230947__(/*! ./_string-ws */ "./node_modules/core-js/modules/_string-ws.js"); +var space = '[' + spaces + ']'; +var non = '\u200b\u0085'; +var ltrim = RegExp('^' + space + space + '*'); +var rtrim = RegExp(space + space + '*$'); -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. +var exporter = function (KEY, exec, ALIAS) { + var exp = {}; + var FORCE = fails(function () { + return !!spaces[KEY]() || non[KEY]() != non; + }); + var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; + if (ALIAS) exp[ALIAS] = fn; + $export($export.P + $export.F * FORCE, 'String', exp); +}; -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; +// 1 -> String#trimLeft +// 2 -> String#trimRight +// 3 -> String#trim +var trim = exporter.trim = function (string, TYPE) { + string = String(defined(string)); + if (TYPE & 1) string = string.replace(ltrim, ''); + if (TYPE & 2) string = string.replace(rtrim, ''); + return string; +}; - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; +module.exports = exporter; - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; +/***/ }), - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; +/***/ "./node_modules/core-js/modules/_string-ws.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_string-ws.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - __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()); - }); - }; +/***/ }), - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; +/***/ "./node_modules/core-js/modules/_task.js": +/*!***********************************************!*\ + !*** ./node_modules/core-js/modules/_task.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_232878__) { - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); +var ctx = __nested_webpack_require_232878__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var invoke = __nested_webpack_require_232878__(/*! ./_invoke */ "./node_modules/core-js/modules/_invoke.js"); +var html = __nested_webpack_require_232878__(/*! ./_html */ "./node_modules/core-js/modules/_html.js"); +var cel = __nested_webpack_require_232878__(/*! ./_dom-create */ "./node_modules/core-js/modules/_dom-create.js"); +var global = __nested_webpack_require_232878__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var process = global.process; +var setTask = global.setImmediate; +var clearTask = global.clearImmediate; +var MessageChannel = global.MessageChannel; +var Dispatch = global.Dispatch; +var counter = 0; +var queue = {}; +var ONREADYSTATECHANGE = 'onreadystatechange'; +var defer, channel, port; +var run = function () { + var id = +this; + // eslint-disable-next-line no-prototype-builtins + if (queue.hasOwnProperty(id)) { + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; +var listener = function (event) { + run.call(event.data); +}; +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if (!setTask || !clearTask) { + setTask = function setImmediate(fn) { + var args = []; + var i = 1; + while (arguments.length > i) args.push(arguments[i++]); + queue[++counter] = function () { + // eslint-disable-next-line no-new-func + invoke(typeof fn == 'function' ? fn : Function(fn), args); }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id) { + delete queue[id]; + }; + // Node.js 0.8- + if (__nested_webpack_require_232878__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js")(process) == 'process') { + defer = function (id) { + process.nextTick(ctx(run, id, 1)); }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(ctx(run, id, 1)); }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; + // Browsers with MessageChannel, includes WebWorkers + } else if (MessageChannel) { + channel = new MessageChannel(); + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { + defer = function (id) { + global.postMessage(id + '', '*'); }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; + global.addEventListener('message', listener, false); + // IE8- + } else if (ONREADYSTATECHANGE in cel('script')) { + defer = function (id) { + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { + html.removeChild(this); + run.call(id); + }; }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); + // Rest old browsers + } else { + defer = function (id) { + setTimeout(ctx(run, id, 1), 0); }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); -}); + } +} +module.exports = { + set: setTask, + clear: clearTask +}; /***/ }), -/***/ 37945: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - +/***/ "./node_modules/core-js/modules/_to-absolute-index.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/_to-absolute-index.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_236084__) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -exports.getUserAgentPrefix = exports.useDefaultPartitionInfo = exports.setPartitionInfo = exports.partition = void 0; -const tslib_1 = __nccwpck_require__(27208); -const partitions_json_1 = tslib_1.__importDefault(__nccwpck_require__(95367)); -let selectedPartitionsInfo = partitions_json_1.default; -let selectedUserAgentPrefix = ""; -const partition = (value) => { - const { partitions } = selectedPartitionsInfo; - for (const partition of partitions) { - const { regions, outputs } = partition; - for (const [region, regionData] of Object.entries(regions)) { - if (region === value) { - return { - ...outputs, - ...regionData, - }; - } - } - } - for (const partition of partitions) { - const { regionRegex, outputs } = partition; - if (new RegExp(regionRegex).test(value)) { - return { - ...outputs, - }; - } - } - const DEFAULT_PARTITION = partitions.find((partition) => partition.id === "aws"); - if (!DEFAULT_PARTITION) { - throw new Error("Provided region was not found in the partition array or regex," + - " and default partition with id 'aws' doesn't exist."); - } - return { - ...DEFAULT_PARTITION.outputs, - }; -}; -exports.partition = partition; -const setPartitionInfo = (partitionsInfo, userAgentPrefix = "") => { - selectedPartitionsInfo = partitionsInfo; - selectedUserAgentPrefix = userAgentPrefix; -}; -exports.setPartitionInfo = setPartitionInfo; -const useDefaultPartitionInfo = () => { - (0, exports.setPartitionInfo)(partitions_json_1.default, ""); +var toInteger = __nested_webpack_require_236084__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var max = Math.max; +var min = Math.min; +module.exports = function (index, length) { + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); }; -exports.useDefaultPartitionInfo = useDefaultPartitionInfo; -const getUserAgentPrefix = () => selectedUserAgentPrefix; -exports.getUserAgentPrefix = getUserAgentPrefix; -======= -exports.escapeUriPath = void 0; -const escape_uri_1 = __nccwpck_require__(20954); -const escapeUriPath = (uri) => uri.split("/").map(escape_uri_1.escapeUri).join("/"); -exports.escapeUriPath = escapeUriPath; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 /***/ }), -<<<<<<< HEAD -/***/ 30287: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - +/***/ "./node_modules/core-js/modules/_to-index.js": +/*!***************************************************!*\ + !*** ./node_modules/core-js/modules/_to-index.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_236696__) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isIpAddress = void 0; -var util_endpoints_1 = __nccwpck_require__(34548); -Object.defineProperty(exports, "isIpAddress", ({ enumerable: true, get: function () { return util_endpoints_1.isIpAddress; } })); +// https://tc39.github.io/ecma262/#sec-toindex +var toInteger = __nested_webpack_require_236696__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var toLength = __nested_webpack_require_236696__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +module.exports = function (it) { + if (it === undefined) return 0; + var number = toInteger(it); + var length = toLength(number); + if (number !== length) throw RangeError('Wrong length!'); + return length; +}; /***/ }), -/***/ 4389: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - +/***/ "./node_modules/core-js/modules/_to-integer.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_to-integer.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveEndpoint = void 0; -var util_endpoints_1 = __nccwpck_require__(34548); -Object.defineProperty(exports, "resolveEndpoint", ({ enumerable: true, get: function () { return util_endpoints_1.resolveEndpoint; } })); +// 7.1.4 ToInteger +var ceil = Math.ceil; +var floor = Math.floor; +module.exports = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; /***/ }), -/***/ 22736: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - +/***/ "./node_modules/core-js/modules/_to-iobject.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_to-iobject.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_237968__) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointError = void 0; -var util_endpoints_1 = __nccwpck_require__(34548); -Object.defineProperty(exports, "EndpointError", ({ enumerable: true, get: function () { return util_endpoints_1.EndpointError; } })); +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = __nested_webpack_require_237968__(/*! ./_iobject */ "./node_modules/core-js/modules/_iobject.js"); +var defined = __nested_webpack_require_237968__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +module.exports = function (it) { + return IObject(defined(it)); +}; /***/ }), -/***/ 25809: -======= -/***/ 20954: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { - +/***/ "./node_modules/core-js/modules/_to-length.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_to-length.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_238637__) { -Object.defineProperty(exports, "__esModule", ({ value: true })); +// 7.1.15 ToLength +var toInteger = __nested_webpack_require_238637__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var min = Math.min; +module.exports = function (it) { + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; /***/ }), -<<<<<<< HEAD -/***/ 26960: -/***/ ((__unused_webpack_module, exports) => { - +/***/ "./node_modules/core-js/modules/_to-object.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_to-object.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_239245__) { -Object.defineProperty(exports, "__esModule", ({ value: true })); +// 7.1.13 ToObject(argument) +var defined = __nested_webpack_require_239245__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +module.exports = function (it) { + return Object(defined(it)); +}; /***/ }), -/***/ 50309: -/***/ ((__unused_webpack_module, exports) => { - +/***/ "./node_modules/core-js/modules/_to-primitive.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/_to-primitive.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_239779__) { -Object.defineProperty(exports, "__esModule", ({ value: true })); +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = __nested_webpack_require_239779__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function (it, S) { + if (!isObject(it)) return it; + var fn, val; + if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; + if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + throw TypeError("Can't convert object to primitive value"); +}; /***/ }), -/***/ 38664: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ "./node_modules/core-js/modules/_typed-array.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_typed-array.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_240834__) { +"use strict"; -/***/ }), +if (__nested_webpack_require_240834__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js")) { + var LIBRARY = __nested_webpack_require_240834__(/*! ./_library */ "./node_modules/core-js/modules/_library.js"); + var global = __nested_webpack_require_240834__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); + var fails = __nested_webpack_require_240834__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); + var $export = __nested_webpack_require_240834__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + var $typed = __nested_webpack_require_240834__(/*! ./_typed */ "./node_modules/core-js/modules/_typed.js"); + var $buffer = __nested_webpack_require_240834__(/*! ./_typed-buffer */ "./node_modules/core-js/modules/_typed-buffer.js"); + var ctx = __nested_webpack_require_240834__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); + var anInstance = __nested_webpack_require_240834__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); + var propertyDesc = __nested_webpack_require_240834__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); + var hide = __nested_webpack_require_240834__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); + var redefineAll = __nested_webpack_require_240834__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); + var toInteger = __nested_webpack_require_240834__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); + var toLength = __nested_webpack_require_240834__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); + var toIndex = __nested_webpack_require_240834__(/*! ./_to-index */ "./node_modules/core-js/modules/_to-index.js"); + var toAbsoluteIndex = __nested_webpack_require_240834__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); + var toPrimitive = __nested_webpack_require_240834__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); + var has = __nested_webpack_require_240834__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); + var classof = __nested_webpack_require_240834__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); + var isObject = __nested_webpack_require_240834__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); + var toObject = __nested_webpack_require_240834__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); + var isArrayIter = __nested_webpack_require_240834__(/*! ./_is-array-iter */ "./node_modules/core-js/modules/_is-array-iter.js"); + var create = __nested_webpack_require_240834__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js"); + var getPrototypeOf = __nested_webpack_require_240834__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); + var gOPN = __nested_webpack_require_240834__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f; + var getIterFn = __nested_webpack_require_240834__(/*! ./core.get-iterator-method */ "./node_modules/core-js/modules/core.get-iterator-method.js"); + var uid = __nested_webpack_require_240834__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js"); + var wks = __nested_webpack_require_240834__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js"); + var createArrayMethod = __nested_webpack_require_240834__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js"); + var createArrayIncludes = __nested_webpack_require_240834__(/*! ./_array-includes */ "./node_modules/core-js/modules/_array-includes.js"); + var speciesConstructor = __nested_webpack_require_240834__(/*! ./_species-constructor */ "./node_modules/core-js/modules/_species-constructor.js"); + var ArrayIterators = __nested_webpack_require_240834__(/*! ./es6.array.iterator */ "./node_modules/core-js/modules/es6.array.iterator.js"); + var Iterators = __nested_webpack_require_240834__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); + var $iterDetect = __nested_webpack_require_240834__(/*! ./_iter-detect */ "./node_modules/core-js/modules/_iter-detect.js"); + var setSpecies = __nested_webpack_require_240834__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js"); + var arrayFill = __nested_webpack_require_240834__(/*! ./_array-fill */ "./node_modules/core-js/modules/_array-fill.js"); + var arrayCopyWithin = __nested_webpack_require_240834__(/*! ./_array-copy-within */ "./node_modules/core-js/modules/_array-copy-within.js"); + var $DP = __nested_webpack_require_240834__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); + var $GOPD = __nested_webpack_require_240834__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js"); + var dP = $DP.f; + var gOPD = $GOPD.f; + var RangeError = global.RangeError; + var TypeError = global.TypeError; + var Uint8Array = global.Uint8Array; + var ARRAY_BUFFER = 'ArrayBuffer'; + var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; + var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; + var PROTOTYPE = 'prototype'; + var ArrayProto = Array[PROTOTYPE]; + var $ArrayBuffer = $buffer.ArrayBuffer; + var $DataView = $buffer.DataView; + var arrayForEach = createArrayMethod(0); + var arrayFilter = createArrayMethod(2); + var arraySome = createArrayMethod(3); + var arrayEvery = createArrayMethod(4); + var arrayFind = createArrayMethod(5); + var arrayFindIndex = createArrayMethod(6); + var arrayIncludes = createArrayIncludes(true); + var arrayIndexOf = createArrayIncludes(false); + var arrayValues = ArrayIterators.values; + var arrayKeys = ArrayIterators.keys; + var arrayEntries = ArrayIterators.entries; + var arrayLastIndexOf = ArrayProto.lastIndexOf; + var arrayReduce = ArrayProto.reduce; + var arrayReduceRight = ArrayProto.reduceRight; + var arrayJoin = ArrayProto.join; + var arraySort = ArrayProto.sort; + var arraySlice = ArrayProto.slice; + var arrayToString = ArrayProto.toString; + var arrayToLocaleString = ArrayProto.toLocaleString; + var ITERATOR = wks('iterator'); + var TAG = wks('toStringTag'); + var TYPED_CONSTRUCTOR = uid('typed_constructor'); + var DEF_CONSTRUCTOR = uid('def_constructor'); + var ALL_CONSTRUCTORS = $typed.CONSTR; + var TYPED_ARRAY = $typed.TYPED; + var VIEW = $typed.VIEW; + var WRONG_LENGTH = 'Wrong length!'; -/***/ 56159: -======= -/***/ 15592: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + var $map = createArrayMethod(1, function (O, length) { + return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); + }); + var LITTLE_ENDIAN = fails(function () { + // eslint-disable-next-line no-undef + return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; + }); -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(27208); -tslib_1.__exportStar(__nccwpck_require__(22736), exports); -tslib_1.__exportStar(__nccwpck_require__(25809), exports); -tslib_1.__exportStar(__nccwpck_require__(26960), exports); -tslib_1.__exportStar(__nccwpck_require__(50309), exports); -tslib_1.__exportStar(__nccwpck_require__(38664), exports); -tslib_1.__exportStar(__nccwpck_require__(77967), exports); -======= -const tslib_1 = __nccwpck_require__(65539); -tslib_1.__exportStar(__nccwpck_require__(20954), exports); -tslib_1.__exportStar(__nccwpck_require__(37945), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { + new Uint8Array(1).set({}); + }); + var toOffset = function (it, BYTES) { + var offset = toInteger(it); + if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); + return offset; + }; -/***/ }), + var validate = function (it) { + if (isObject(it) && TYPED_ARRAY in it) return it; + throw TypeError(it + ' is not a typed array!'); + }; -<<<<<<< HEAD -/***/ 77967: -/***/ ((__unused_webpack_module, exports) => { + var allocate = function (C, length) { + if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { + throw TypeError('It is not a typed array constructor!'); + } return new C(length); + }; + var speciesFromList = function (O, list) { + return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); + }; -Object.defineProperty(exports, "__esModule", ({ value: true })); + var fromList = function (C, list) { + var index = 0; + var length = list.length; + var result = allocate(C, length); + while (length > index) result[index] = list[index++]; + return result; + }; + var addGetter = function (it, key, internal) { + dP(it, key, { get: function () { return this._d[internal]; } }); + }; -/***/ }), + var $from = function from(source /* , mapfn, thisArg */) { + var O = toObject(source); + var aLen = arguments.length; + var mapfn = aLen > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var iterFn = getIterFn(O); + var i, length, values, result, step, iterator; + if (iterFn != undefined && !isArrayIter(iterFn)) { + for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { + values.push(step.value); + } O = values; + } + if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); + for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { + result[i] = mapping ? mapfn(O[i], i) : O[i]; + } + return result; + }; -/***/ 27208: -======= -/***/ 65539: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { + var $of = function of(/* ...items */) { + var index = 0; + var length = arguments.length; + var result = allocate(this, length); + while (length > index) result[index] = arguments[index++]; + return result; + }; -/****************************************************************************** -Copyright (c) Microsoft Corporation. + // iOS Safari 6.x fails here + var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. + var $toLocaleString = function toLocaleString() { + return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); + }; -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + var proto = { + copyWithin: function copyWithin(target, start /* , end */) { + return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); + }, + every: function every(callbackfn /* , thisArg */) { + return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars + return arrayFill.apply(validate(this), arguments); + }, + filter: function filter(callbackfn /* , thisArg */) { + return speciesFromList(this, arrayFilter(validate(this), callbackfn, + arguments.length > 1 ? arguments[1] : undefined)); + }, + find: function find(predicate /* , thisArg */) { + return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + findIndex: function findIndex(predicate /* , thisArg */) { + return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + forEach: function forEach(callbackfn /* , thisArg */) { + arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + indexOf: function indexOf(searchElement /* , fromIndex */) { + return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + includes: function includes(searchElement /* , fromIndex */) { + return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + join: function join(separator) { // eslint-disable-line no-unused-vars + return arrayJoin.apply(validate(this), arguments); + }, + lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars + return arrayLastIndexOf.apply(validate(this), arguments); + }, + map: function map(mapfn /* , thisArg */) { + return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); + }, + reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars + return arrayReduce.apply(validate(this), arguments); + }, + reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars + return arrayReduceRight.apply(validate(this), arguments); + }, + reverse: function reverse() { + var that = this; + var length = validate(that).length; + var middle = Math.floor(length / 2); + var index = 0; + var value; + while (index < middle) { + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } return that; + }, + some: function some(callbackfn /* , thisArg */) { + return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + sort: function sort(comparefn) { + return arraySort.call(validate(this), comparefn); + }, + subarray: function subarray(begin, end) { + var O = validate(this); + var length = O.length; + var $begin = toAbsoluteIndex(begin, length); + return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( + O.buffer, + O.byteOffset + $begin * O.BYTES_PER_ELEMENT, + toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) + ); } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + }; - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; + var $slice = function slice(start, end) { + return speciesFromList(this, arraySlice.call(validate(this), start, end)); + }; - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; + var $set = function set(arrayLike /* , offset */) { + validate(this); + var offset = toOffset(arguments[1], 1); + var length = this.length; + var src = toObject(arrayLike); + var len = toLength(src.length); + var index = 0; + if (len + offset > length) throw RangeError(WRONG_LENGTH); + while (index < len) this[offset + index] = src[index++]; + }; - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; + var $iterators = { + entries: function entries() { + return arrayEntries.call(validate(this)); + }, + keys: function keys() { + return arrayKeys.call(validate(this)); + }, + values: function values() { + return arrayValues.call(validate(this)); + } + }; - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; + var isTAIndex = function (target, key) { + return isObject(target) + && target[TYPED_ARRAY] + && typeof key != 'symbol' + && key in target + && String(+key) == String(key); + }; + var $getDesc = function getOwnPropertyDescriptor(target, key) { + return isTAIndex(target, key = toPrimitive(key, true)) + ? propertyDesc(2, target[key]) + : gOPD(target, key); + }; + var $setDesc = function defineProperty(target, key, desc) { + if (isTAIndex(target, key = toPrimitive(key, true)) + && isObject(desc) + && has(desc, 'value') + && !has(desc, 'get') + && !has(desc, 'set') + // TODO: add validation descriptor w/o calling accessors + && !desc.configurable + && (!has(desc, 'writable') || desc.writable) + && (!has(desc, 'enumerable') || desc.enumerable) + ) { + target[key] = desc.value; + return target; + } return dP(target, key, desc); + }; - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; + if (!ALL_CONSTRUCTORS) { + $GOPD.f = $getDesc; + $DP.f = $setDesc; + } - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; + $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { + getOwnPropertyDescriptor: $getDesc, + defineProperty: $setDesc + }); - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; + if (fails(function () { arrayToString.call({}); })) { + arrayToString = arrayToLocaleString = function toString() { + return arrayJoin.call(this); }; + } - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; + var $TypedArrayPrototype$ = redefineAll({}, proto); + redefineAll($TypedArrayPrototype$, $iterators); + hide($TypedArrayPrototype$, ITERATOR, $iterators.values); + redefineAll($TypedArrayPrototype$, { + slice: $slice, + set: $set, + constructor: function () { /* noop */ }, + toString: arrayToString, + toLocaleString: $toLocaleString + }); + addGetter($TypedArrayPrototype$, 'buffer', 'b'); + addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); + addGetter($TypedArrayPrototype$, 'byteLength', 'l'); + addGetter($TypedArrayPrototype$, 'length', 'e'); + dP($TypedArrayPrototype$, TAG, { + get: function () { return this[TYPED_ARRAY]; } + }); - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); + // eslint-disable-next-line max-statements + module.exports = function (KEY, BYTES, wrapper, CLAMPED) { + CLAMPED = !!CLAMPED; + var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; + var GETTER = 'get' + KEY; + var SETTER = 'set' + KEY; + var TypedArray = global[NAME]; + var Base = TypedArray || {}; + var TAC = TypedArray && getPrototypeOf(TypedArray); + var FORCED = !TypedArray || !$typed.ABV; + var O = {}; + var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; + var getter = function (that, index) { + var data = that._d; + return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + var setter = function (that, index, value) { + var data = that._d; + if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; + data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); }; - - __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()); - }); + var addElement = function (that, index) { + dP(that, index, { + get: function () { + return getter(this, index); + }, + set: function (value) { + return setter(this, index, value); + }, + enumerable: true + }); }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + if (FORCED) { + TypedArray = wrapper(function (that, data, $offset, $length) { + anInstance(that, TypedArray, NAME, '_d'); + var index = 0; + var offset = 0; + var buffer, byteLength, length, klass; + if (!isObject(data)) { + length = toIndex(data); + byteLength = length * BYTES; + buffer = new $ArrayBuffer(byteLength); + } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { + buffer = data; + offset = toOffset($offset, BYTES); + var $len = data.byteLength; + if ($length === undefined) { + if ($len % BYTES) throw RangeError(WRONG_LENGTH); + byteLength = $len - offset; + if (byteLength < 0) throw RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if (TYPED_ARRAY in data) { + return fromList(TypedArray, data); + } else { + return $from.call(TypedArray, data); } - }; + hide(that, '_d', { + b: buffer, + o: offset, + l: byteLength, + e: length, + v: new $DataView(buffer) + }); + while (index < length) addElement(that, index++); + }); + TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); + hide(TypedArrayPrototype, 'constructor', TypedArray); + } else if (!fails(function () { + TypedArray(1); + }) || !fails(function () { + new TypedArray(-1); // eslint-disable-line no-new + }) || !$iterDetect(function (iter) { + new TypedArray(); // eslint-disable-line no-new + new TypedArray(null); // eslint-disable-line no-new + new TypedArray(1.5); // eslint-disable-line no-new + new TypedArray(iter); // eslint-disable-line no-new + }, true)) { + TypedArray = wrapper(function (that, data, $offset, $length) { + anInstance(that, TypedArray, NAME); + var klass; + // `ws` module bug, temporarily remove validation length for Uint8Array + // https://github.com/websockets/ws/pull/645 + if (!isObject(data)) return new Base(toIndex(data)); + if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { + return $length !== undefined + ? new Base(data, toOffset($offset, BYTES), $length) + : $offset !== undefined + ? new Base(data, toOffset($offset, BYTES)) + : new Base(data); + } + if (TYPED_ARRAY in data) return fromList(TypedArray, data); + return $from.call(TypedArray, data); + }); + arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { + if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); + }); + TypedArray[PROTOTYPE] = TypedArrayPrototype; + if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; + } + var $nativeIterator = TypedArrayPrototype[ITERATOR]; + var CORRECT_ITER_NAME = !!$nativeIterator + && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); + var $iterator = $iterators.values; + hide(TypedArray, TYPED_CONSTRUCTOR, true); + hide(TypedArrayPrototype, TYPED_ARRAY, NAME); + hide(TypedArrayPrototype, VIEW, true); + hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; + if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { + dP(TypedArrayPrototype, TAG, { + get: function () { return NAME; } + }); + } - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); + O[NAME] = TypedArray; - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; + $export($export.G + $export.W + $export.F * (TypedArray != Base), O); - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; + $export($export.S, NAME, { + BYTES_PER_ELEMENT: BYTES + }); - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; + $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { + from: $from, + of: $of + }); - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; + if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; + $export($export.P, NAME, proto); - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; + setSpecies(NAME); - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; + $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; + $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; + if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; + $export($export.P + $export.F * fails(function () { + new TypedArray(1).slice(); + }), NAME, { slice: $slice }); - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; + $export($export.P + $export.F * (fails(function () { + return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); + }) || !fails(function () { + TypedArrayPrototype.toLocaleString.call([1, 2]); + })), NAME, { toLocaleString: $toLocaleString }); - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; + Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; + if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); + }; +} else module.exports = function () { /* empty */ }; - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; +/***/ }), - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +/***/ "./node_modules/core-js/modules/_typed-buffer.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/_typed-buffer.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_262002__) { - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; +"use strict"; - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; +var global = __nested_webpack_require_262002__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var DESCRIPTORS = __nested_webpack_require_262002__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); +var LIBRARY = __nested_webpack_require_262002__(/*! ./_library */ "./node_modules/core-js/modules/_library.js"); +var $typed = __nested_webpack_require_262002__(/*! ./_typed */ "./node_modules/core-js/modules/_typed.js"); +var hide = __nested_webpack_require_262002__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var redefineAll = __nested_webpack_require_262002__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); +var fails = __nested_webpack_require_262002__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var anInstance = __nested_webpack_require_262002__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); +var toInteger = __nested_webpack_require_262002__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var toLength = __nested_webpack_require_262002__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var toIndex = __nested_webpack_require_262002__(/*! ./_to-index */ "./node_modules/core-js/modules/_to-index.js"); +var gOPN = __nested_webpack_require_262002__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f; +var dP = __nested_webpack_require_262002__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +var arrayFill = __nested_webpack_require_262002__(/*! ./_array-fill */ "./node_modules/core-js/modules/_array-fill.js"); +var setToStringTag = __nested_webpack_require_262002__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js"); +var ARRAY_BUFFER = 'ArrayBuffer'; +var DATA_VIEW = 'DataView'; +var PROTOTYPE = 'prototype'; +var WRONG_LENGTH = 'Wrong length!'; +var WRONG_INDEX = 'Wrong index!'; +var $ArrayBuffer = global[ARRAY_BUFFER]; +var $DataView = global[DATA_VIEW]; +var Math = global.Math; +var RangeError = global.RangeError; +// eslint-disable-next-line no-shadow-restricted-names +var Infinity = global.Infinity; +var BaseBuffer = $ArrayBuffer; +var abs = Math.abs; +var pow = Math.pow; +var floor = Math.floor; +var log = Math.log; +var LN2 = Math.LN2; +var BUFFER = 'buffer'; +var BYTE_LENGTH = 'byteLength'; +var BYTE_OFFSET = 'byteOffset'; +var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; +var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; +var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; +// IEEE754 conversions based on https://github.com/feross/ieee754 +function packIEEE754(value, mLen, nBytes) { + var buffer = new Array(nBytes); + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; + var i = 0; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + var e, m, c; + value = abs(value); + // eslint-disable-next-line no-self-compare + if (value != value || value === Infinity) { + // eslint-disable-next-line no-self-compare + m = value != value ? 1 : 0; + e = eMax; + } else { + e = floor(log(value) / LN2); + if (value * (c = pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * pow(2, mLen); + e = e + eBias; + } else { + m = value * pow(2, eBias - 1) * pow(2, mLen); + e = 0; + } + } + for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); + e = e << mLen | m; + eLen += mLen; + for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); + buffer[--i] |= s * 128; + return buffer; +} +function unpackIEEE754(buffer, mLen, nBytes) { + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = eLen - 7; + var i = nBytes - 1; + var s = buffer[i--]; + var e = s & 127; + var m; + s >>= 7; + for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : s ? -Infinity : Infinity; + } else { + m = m + pow(2, mLen); + e = e - eBias; + } return (s ? -1 : 1) * m * pow(2, e - mLen); +} - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; +function unpackI32(bytes) { + return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; +} +function packI8(it) { + return [it & 0xff]; +} +function packI16(it) { + return [it & 0xff, it >> 8 & 0xff]; +} +function packI32(it) { + return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; +} +function packF64(it) { + return packIEEE754(it, 52, 8); +} +function packF32(it) { + return packIEEE754(it, 23, 4); +} - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); +function addGetter(C, key, internal) { + dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } }); +} + +function get(view, bytes, index, isLittleEndian) { + var numIndex = +index; + var intIndex = toIndex(numIndex); + if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b; + var start = intIndex + view[$OFFSET]; + var pack = store.slice(start, start + bytes); + return isLittleEndian ? pack : pack.reverse(); +} +function set(view, bytes, index, conversion, value, isLittleEndian) { + var numIndex = +index; + var intIndex = toIndex(numIndex); + if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b; + var start = intIndex + view[$OFFSET]; + var pack = conversion(+value); + for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; +} + +if (!$typed.ABV) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer, ARRAY_BUFFER); + var byteLength = toIndex(length); + this._b = arrayFill.call(new Array(byteLength), 0); + this[$LENGTH] = byteLength; + }; + + $DataView = function DataView(buffer, byteOffset, byteLength) { + anInstance(this, $DataView, DATA_VIEW); + anInstance(buffer, $ArrayBuffer, DATA_VIEW); + var bufferLength = buffer[$LENGTH]; + var offset = toInteger(byteOffset); + if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); + if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); + this[$BUFFER] = buffer; + this[$OFFSET] = offset; + this[$LENGTH] = byteLength; + }; + + if (DESCRIPTORS) { + addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); + addGetter($DataView, BUFFER, '_b'); + addGetter($DataView, BYTE_LENGTH, '_l'); + addGetter($DataView, BYTE_OFFSET, '_o'); + } + + redefineAll($DataView[PROTOTYPE], { + getInt8: function getInt8(byteOffset) { + return get(this, 1, byteOffset)[0] << 24 >> 24; + }, + getUint8: function getUint8(byteOffset) { + return get(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments[1]); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments[1]); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset /* , littleEndian */) { + return unpackI32(get(this, 4, byteOffset, arguments[1])); + }, + getUint32: function getUint32(byteOffset /* , littleEndian */) { + return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; + }, + getFloat32: function getFloat32(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); + }, + getFloat64: function getFloat64(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); + }, + setInt8: function setInt8(byteOffset, value) { + set(this, 1, byteOffset, packI8, value); + }, + setUint8: function setUint8(byteOffset, value) { + set(this, 1, byteOffset, packI8, value); + }, + setInt16: function setInt16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setUint16: function setUint16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setInt32: function setInt32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setUint32: function setUint32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packF32, value, arguments[2]); + }, + setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { + set(this, 8, byteOffset, packF64, value, arguments[2]); + } + }); +} else { + if (!fails(function () { + $ArrayBuffer(1); + }) || !fails(function () { + new $ArrayBuffer(-1); // eslint-disable-line no-new + }) || fails(function () { + new $ArrayBuffer(); // eslint-disable-line no-new + new $ArrayBuffer(1.5); // eslint-disable-line no-new + new $ArrayBuffer(NaN); // eslint-disable-line no-new + return $ArrayBuffer.name != ARRAY_BUFFER; + })) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer); + return new BaseBuffer(toIndex(length)); + }; + var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; + for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { + if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); + } + if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; + } + // iOS Safari 7.x bug + var view = new $DataView(new $ArrayBuffer(2)); + var $setInt8 = $DataView[PROTOTYPE].setInt8; + view.setInt8(0, 2147483648); + view.setInt8(1, 2147483649); + if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { + setInt8: function setInt8(byteOffset, value) { + $setInt8.call(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint8(byteOffset, value) { + $setInt8.call(this, byteOffset, value << 24 >> 24); + } + }, true); +} +setToStringTag($ArrayBuffer, ARRAY_BUFFER); +setToStringTag($DataView, DATA_VIEW); +hide($DataView[PROTOTYPE], $typed.VIEW, true); +exports[ARRAY_BUFFER] = $ArrayBuffer; +exports[DATA_VIEW] = $DataView; /***/ }), -<<<<<<< HEAD -/***/ 78749: -/***/ ((__unused_webpack_module, exports) => { -======= -/***/ 7494: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ "./node_modules/core-js/modules/_typed.js": +/*!************************************************!*\ + !*** ./node_modules/core-js/modules/_typed.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_272754__) { +var global = __nested_webpack_require_272754__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var hide = __nested_webpack_require_272754__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var uid = __nested_webpack_require_272754__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js"); +var TYPED = uid('typed_array'); +var VIEW = uid('view'); +var ABV = !!(global.ArrayBuffer && global.DataView); +var CONSTR = ABV; +var i = 0; +var l = 9; +var Typed; -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -exports.crtAvailability = void 0; -exports.crtAvailability = { - isCrtAvailable: false, +var TypedArrayConstructors = ( + 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' +).split(','); + +while (i < l) { + if (Typed = global[TypedArrayConstructors[i++]]) { + hide(Typed.prototype, TYPED, true); + hide(Typed.prototype, VIEW, true); + } else CONSTR = false; +} + +module.exports = { + ABV: ABV, + CONSTR: CONSTR, + TYPED: TYPED, + VIEW: VIEW }; /***/ }), -/***/ 61876: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - +/***/ "./node_modules/core-js/modules/_uid.js": +/*!**********************************************!*\ + !*** ./node_modules/core-js/modules/_uid.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultUserAgent = exports.UA_APP_ID_INI_NAME = exports.UA_APP_ID_ENV_NAME = exports.crtAvailability = void 0; -const node_config_provider_1 = __nccwpck_require__(13079); -const os_1 = __nccwpck_require__(22037); -const process_1 = __nccwpck_require__(77282); -const is_crt_available_1 = __nccwpck_require__(7593); -var crt_availability_1 = __nccwpck_require__(78749); -Object.defineProperty(exports, "crtAvailability", ({ enumerable: true, get: function () { return crt_availability_1.crtAvailability; } })); -======= -exports.defaultUserAgent = exports.UA_APP_ID_INI_NAME = exports.UA_APP_ID_ENV_NAME = void 0; -const node_config_provider_1 = __nccwpck_require__(15071); -const os_1 = __nccwpck_require__(22037); -const process_1 = __nccwpck_require__(77282); -const is_crt_available_1 = __nccwpck_require__(48763); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -exports.UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID"; -exports.UA_APP_ID_INI_NAME = "sdk-ua-app-id"; -const defaultUserAgent = ({ serviceId, clientVersion }) => { - const sections = [ - ["aws-sdk-js", clientVersion], - ["ua", "2.0"], - [`os/${(0, os_1.platform)()}`, (0, os_1.release)()], - ["lang/js"], - ["md/nodejs", `${process_1.versions.node}`], - ]; - const crtAvailable = (0, is_crt_available_1.isCrtAvailable)(); - if (crtAvailable) { - sections.push(crtAvailable); - } - if (serviceId) { - sections.push([`api/${serviceId}`, clientVersion]); - } - if (process_1.env.AWS_EXECUTION_ENV) { - sections.push([`exec-env/${process_1.env.AWS_EXECUTION_ENV}`]); - } - const appIdPromise = (0, node_config_provider_1.loadConfig)({ - environmentVariableSelector: (env) => env[exports.UA_APP_ID_ENV_NAME], - configFileSelector: (profile) => profile[exports.UA_APP_ID_INI_NAME], - default: undefined, - })(); - let resolvedUserAgent = undefined; - return async () => { - if (!resolvedUserAgent) { - const appId = await appIdPromise; - resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections]; - } - return resolvedUserAgent; - }; +var id = 0; +var px = Math.random(); +module.exports = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; -exports.defaultUserAgent = defaultUserAgent; /***/ }), -<<<<<<< HEAD -/***/ 7593: -======= -/***/ 48763: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_user-agent.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_user-agent.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_274383__) { + +var global = __nested_webpack_require_274383__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var navigator = global.navigator; +module.exports = navigator && navigator.userAgent || ''; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isCrtAvailable = void 0; -const crt_availability_1 = __nccwpck_require__(78749); -const isCrtAvailable = () => { -<<<<<<< HEAD - if (crt_availability_1.crtAvailability.isCrtAvailable) { - return ["md/crt-avail"]; -======= - try { - if ( true && __nccwpck_require__(84332)) { - return ["md/crt-avail"]; - } - return null; - } - catch (e) { - return null; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - return null; + +/***/ }), + +/***/ "./node_modules/core-js/modules/_validate-collection.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/_validate-collection.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_274939__) { + +var isObject = __nested_webpack_require_274939__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +module.exports = function (it, TYPE) { + if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); + return it; }; -exports.isCrtAvailable = isCrtAvailable; /***/ }), -<<<<<<< HEAD -/***/ 77296: -======= -/***/ 83288: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/_wks-define.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_wks-define.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_275535__) { +var global = __nested_webpack_require_275535__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var core = __nested_webpack_require_275535__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); +var LIBRARY = __nested_webpack_require_275535__(/*! ./_library */ "./node_modules/core-js/modules/_library.js"); +var wksExt = __nested_webpack_require_275535__(/*! ./_wks-ext */ "./node_modules/core-js/modules/_wks-ext.js"); +var defineProperty = __nested_webpack_require_275535__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +module.exports = function (name) { + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toUtf8 = exports.fromUtf8 = void 0; -<<<<<<< HEAD -const pureJs_1 = __nccwpck_require__(92341); -const whatwgEncodingApi_1 = __nccwpck_require__(51506); -======= -const pureJs_1 = __nccwpck_require__(97088); -const whatwgEncodingApi_1 = __nccwpck_require__(38874); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const fromUtf8 = (input) => typeof TextEncoder === "function" ? (0, whatwgEncodingApi_1.fromUtf8)(input) : (0, pureJs_1.fromUtf8)(input); -exports.fromUtf8 = fromUtf8; -const toUtf8 = (input) => typeof TextDecoder === "function" ? (0, whatwgEncodingApi_1.toUtf8)(input) : (0, pureJs_1.toUtf8)(input); -exports.toUtf8 = toUtf8; + +/***/ }), + +/***/ "./node_modules/core-js/modules/_wks-ext.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/_wks-ext.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_276580__) { + +exports.f = __nested_webpack_require_276580__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js"); /***/ }), -<<<<<<< HEAD -/***/ 92341: -======= -/***/ 97088: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/_wks.js": +/*!**********************************************!*\ + !*** ./node_modules/core-js/modules/_wks.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_276973__) { +var store = __nested_webpack_require_276973__(/*! ./_shared */ "./node_modules/core-js/modules/_shared.js")('wks'); +var uid = __nested_webpack_require_276973__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js"); +var Symbol = __nested_webpack_require_276973__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").Symbol; +var USE_SYMBOL = typeof Symbol == 'function'; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toUtf8 = exports.fromUtf8 = void 0; -const fromUtf8 = (input) => { - const bytes = []; - for (let i = 0, len = input.length; i < len; i++) { - const value = input.charCodeAt(i); - if (value < 0x80) { - bytes.push(value); - } - else if (value < 0x800) { - bytes.push((value >> 6) | 0b11000000, (value & 0b111111) | 0b10000000); - } - else if (i + 1 < input.length && (value & 0xfc00) === 0xd800 && (input.charCodeAt(i + 1) & 0xfc00) === 0xdc00) { - const surrogatePair = 0x10000 + ((value & 0b1111111111) << 10) + (input.charCodeAt(++i) & 0b1111111111); - bytes.push((surrogatePair >> 18) | 0b11110000, ((surrogatePair >> 12) & 0b111111) | 0b10000000, ((surrogatePair >> 6) & 0b111111) | 0b10000000, (surrogatePair & 0b111111) | 0b10000000); - } - else { - bytes.push((value >> 12) | 0b11100000, ((value >> 6) & 0b111111) | 0b10000000, (value & 0b111111) | 0b10000000); - } - } - return Uint8Array.from(bytes); +var $exports = module.exports = function (name) { + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); }; -exports.fromUtf8 = fromUtf8; -const toUtf8 = (input) => { - let decoded = ""; - for (let i = 0, len = input.length; i < len; i++) { - const byte = input[i]; - if (byte < 0x80) { - decoded += String.fromCharCode(byte); - } - else if (0b11000000 <= byte && byte < 0b11100000) { - const nextByte = input[++i]; - decoded += String.fromCharCode(((byte & 0b11111) << 6) | (nextByte & 0b111111)); - } - else if (0b11110000 <= byte && byte < 0b101101101) { - const surrogatePair = [byte, input[++i], input[++i], input[++i]]; - const encoded = "%" + surrogatePair.map((byteValue) => byteValue.toString(16)).join("%"); - decoded += decodeURIComponent(encoded); - } - else { - decoded += String.fromCharCode(((byte & 0b1111) << 12) | ((input[++i] & 0b111111) << 6) | (input[++i] & 0b111111)); - } - } - return decoded; + +$exports.store = store; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/core.get-iterator-method.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/core.get-iterator-method.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_277895__) { + +var classof = __nested_webpack_require_277895__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); +var ITERATOR = __nested_webpack_require_277895__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'); +var Iterators = __nested_webpack_require_277895__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); +module.exports = __nested_webpack_require_277895__(/*! ./_core */ "./node_modules/core-js/modules/_core.js").getIteratorMethod = function (it) { + if (it != undefined) return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; }; -exports.toUtf8 = toUtf8; /***/ }), -<<<<<<< HEAD -/***/ 51506: -======= -/***/ 38874: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/core.regexp.escape.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/core.regexp.escape.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_278795__) { +// https://github.com/benjamingr/RexExp.escape +var $export = __nested_webpack_require_278795__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $re = __nested_webpack_require_278795__(/*! ./_replacer */ "./node_modules/core-js/modules/_replacer.js")(/[\\^$*+?.()|[\]{}]/g, '\\$&'); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toUtf8 = exports.fromUtf8 = void 0; -function fromUtf8(input) { - return new TextEncoder().encode(input); -} -exports.fromUtf8 = fromUtf8; -function toUtf8(input) { - return new TextDecoder("utf-8").decode(input); -} -exports.toUtf8 = toUtf8; +$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } }); /***/ }), -<<<<<<< HEAD -/***/ 71299: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - +/***/ "./node_modules/core-js/modules/es6.array.copy-within.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.copy-within.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_279523__) { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.XmlNode = void 0; -const escape_attribute_1 = __nccwpck_require__(35335); -const XmlText_1 = __nccwpck_require__(45306); -======= -/***/ 1266: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) +var $export = __nested_webpack_require_279523__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -"use strict"; +$export($export.P, 'Array', { copyWithin: __nested_webpack_require_279523__(/*! ./_array-copy-within */ "./node_modules/core-js/modules/_array-copy-within.js") }); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toUtf8 = exports.fromUtf8 = void 0; -const util_buffer_from_1 = __nccwpck_require__(87048); -const fromUtf8 = (input) => { - const buf = (0, util_buffer_from_1.fromString)(input, "utf8"); - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT); -}; -exports.fromUtf8 = fromUtf8; -const toUtf8 = (input) => (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("utf8"); -exports.toUtf8 = toUtf8; +__nested_webpack_require_279523__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")('copyWithin'); /***/ }), -/***/ 41722: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.array.every.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.every.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_280314__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createWaiter = void 0; -const poller_1 = __nccwpck_require__(16947); -const utils_1 = __nccwpck_require__(20436); -const waiter_1 = __nccwpck_require__(59141); -const abortTimeout = async (abortSignal) => { - return new Promise((resolve) => { - abortSignal.onabort = () => resolve({ state: waiter_1.WaiterState.ABORTED }); - }); -}; -const createWaiter = async (options, input, acceptorChecks) => { - const params = { - ...waiter_1.waiterServiceDefaults, - ...options, - }; - (0, utils_1.validateWaiterOptions)(params); - const exitConditions = [(0, poller_1.runPolling)(params, input, acceptorChecks)]; - if (options.abortController) { - exitConditions.push(abortTimeout(options.abortController.signal)); - } - if (options.abortSignal) { - exitConditions.push(abortTimeout(options.abortSignal)); - } - return Promise.race(exitConditions); -}; -exports.createWaiter = createWaiter; +var $export = __nested_webpack_require_280314__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $every = __nested_webpack_require_280314__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(4); + +$export($export.P + $export.F * !__nested_webpack_require_280314__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].every, true), 'Array', { + // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) + every: function every(callbackfn /* , thisArg */) { + return $every(this, callbackfn, arguments[1]); + } +}); /***/ }), -/***/ 20327: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.array.fill.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.fill.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_281226__) { -"use strict"; +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) +var $export = __nested_webpack_require_281226__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(64258); -tslib_1.__exportStar(__nccwpck_require__(41722), exports); -tslib_1.__exportStar(__nccwpck_require__(59141), exports); +$export($export.P, 'Array', { fill: __nested_webpack_require_281226__(/*! ./_array-fill */ "./node_modules/core-js/modules/_array-fill.js") }); + +__nested_webpack_require_281226__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")('fill'); /***/ }), -/***/ 16947: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.array.filter.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.filter.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_281992__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.runPolling = void 0; -const sleep_1 = __nccwpck_require__(19983); -const waiter_1 = __nccwpck_require__(59141); -const exponentialBackoffWithJitter = (minDelay, maxDelay, attemptCeiling, attempt) => { - if (attempt > attemptCeiling) - return maxDelay; - const delay = minDelay * 2 ** (attempt - 1); - return randomInRange(minDelay, delay); -}; -const randomInRange = (min, max) => min + Math.random() * (max - min); -const runPolling = async ({ minDelay, maxDelay, maxWaitTime, abortController, client, abortSignal }, input, acceptorChecks) => { - var _a; - const { state } = await acceptorChecks(client, input); - if (state !== waiter_1.WaiterState.RETRY) { - return { state }; - } - let currentAttempt = 1; - const waitUntil = Date.now() + maxWaitTime * 1000; - const attemptCeiling = Math.log(maxDelay / minDelay) / Math.log(2) + 1; - while (true) { - if (((_a = abortController === null || abortController === void 0 ? void 0 : abortController.signal) === null || _a === void 0 ? void 0 : _a.aborted) || (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted)) { - return { state: waiter_1.WaiterState.ABORTED }; - } - const delay = exponentialBackoffWithJitter(minDelay, maxDelay, attemptCeiling, currentAttempt); - if (Date.now() + delay * 1000 > waitUntil) { - return { state: waiter_1.WaiterState.TIMEOUT }; - } - await (0, sleep_1.sleep)(delay); - const { state } = await acceptorChecks(client, input); - if (state !== waiter_1.WaiterState.RETRY) { - return { state }; - } - currentAttempt += 1; - } -}; -exports.runPolling = runPolling; +var $export = __nested_webpack_require_281992__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $filter = __nested_webpack_require_281992__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(2); + +$export($export.P + $export.F * !__nested_webpack_require_281992__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].filter, true), 'Array', { + // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) + filter: function filter(callbackfn /* , thisArg */) { + return $filter(this, callbackfn, arguments[1]); + } +}); /***/ }), -/***/ 20436: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.array.find-index.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.find-index.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_282934__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(64258); -tslib_1.__exportStar(__nccwpck_require__(19983), exports); -tslib_1.__exportStar(__nccwpck_require__(58333), exports); +// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) +var $export = __nested_webpack_require_282934__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $find = __nested_webpack_require_282934__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(6); +var KEY = 'findIndex'; +var forced = true; +// Shouldn't skip holes +if (KEY in []) Array(1)[KEY](function () { forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + findIndex: function findIndex(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +__nested_webpack_require_282934__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")(KEY); /***/ }), -/***/ 19983: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/es6.array.find.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.find.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_284028__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.sleep = void 0; -const sleep = (seconds) => { - return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); -}; -exports.sleep = sleep; +// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) +var $export = __nested_webpack_require_284028__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $find = __nested_webpack_require_284028__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(5); +var KEY = 'find'; +var forced = true; +// Shouldn't skip holes +if (KEY in []) Array(1)[KEY](function () { forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + find: function find(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +__nested_webpack_require_284028__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")(KEY); /***/ }), -/***/ 58333: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/es6.array.for-each.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.for-each.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_285118__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.validateWaiterOptions = void 0; -const validateWaiterOptions = (options) => { - if (options.maxWaitTime < 1) { - throw new Error(`WaiterConfiguration.maxWaitTime must be greater than 0`); - } - else if (options.minDelay < 1) { - throw new Error(`WaiterConfiguration.minDelay must be greater than 0`); - } - else if (options.maxDelay < 1) { - throw new Error(`WaiterConfiguration.maxDelay must be greater than 0`); - } - else if (options.maxWaitTime <= options.minDelay) { - throw new Error(`WaiterConfiguration.maxWaitTime [${options.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${options.minDelay}] for this waiter`); - } - else if (options.maxDelay < options.minDelay) { - throw new Error(`WaiterConfiguration.maxDelay [${options.maxDelay}] must be greater than WaiterConfiguration.minDelay [${options.minDelay}] for this waiter`); - } -}; -exports.validateWaiterOptions = validateWaiterOptions; +var $export = __nested_webpack_require_285118__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $forEach = __nested_webpack_require_285118__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(0); +var STRICT = __nested_webpack_require_285118__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].forEach, true); + +$export($export.P + $export.F * !STRICT, 'Array', { + // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) + forEach: function forEach(callbackfn /* , thisArg */) { + return $forEach(this, callbackfn, arguments[1]); + } +}); /***/ }), -/***/ 59141: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/es6.array.from.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.from.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_286064__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.checkExceptions = exports.WaiterState = exports.waiterServiceDefaults = void 0; -exports.waiterServiceDefaults = { - minDelay: 2, - maxDelay: 120, -}; -var WaiterState; -(function (WaiterState) { - WaiterState["ABORTED"] = "ABORTED"; - WaiterState["FAILURE"] = "FAILURE"; - WaiterState["SUCCESS"] = "SUCCESS"; - WaiterState["RETRY"] = "RETRY"; - WaiterState["TIMEOUT"] = "TIMEOUT"; -})(WaiterState = exports.WaiterState || (exports.WaiterState = {})); -const checkExceptions = (result) => { - if (result.state === WaiterState.ABORTED) { - const abortError = new Error(`${JSON.stringify({ - ...result, - reason: "Request was aborted", - })}`); - abortError.name = "AbortError"; - throw abortError; - } - else if (result.state === WaiterState.TIMEOUT) { - const timeoutError = new Error(`${JSON.stringify({ - ...result, - reason: "Waiter has timed out", - })}`); - timeoutError.name = "TimeoutError"; - throw timeoutError; - } - else if (result.state !== WaiterState.SUCCESS) { - throw new Error(`${JSON.stringify({ result })}`); +var ctx = __nested_webpack_require_286064__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var $export = __nested_webpack_require_286064__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toObject = __nested_webpack_require_286064__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var call = __nested_webpack_require_286064__(/*! ./_iter-call */ "./node_modules/core-js/modules/_iter-call.js"); +var isArrayIter = __nested_webpack_require_286064__(/*! ./_is-array-iter */ "./node_modules/core-js/modules/_is-array-iter.js"); +var toLength = __nested_webpack_require_286064__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var createProperty = __nested_webpack_require_286064__(/*! ./_create-property */ "./node_modules/core-js/modules/_create-property.js"); +var getIterFn = __nested_webpack_require_286064__(/*! ./core.get-iterator-method */ "./node_modules/core-js/modules/core.get-iterator-method.js"); + +$export($export.S + $export.F * !__nested_webpack_require_286064__(/*! ./_iter-detect */ "./node_modules/core-js/modules/_iter-detect.js")(function (iter) { Array.from(iter); }), 'Array', { + // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) + from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { + var O = toObject(arrayLike); + var C = typeof this == 'function' ? this : Array; + var aLen = arguments.length; + var mapfn = aLen > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var index = 0; + var iterFn = getIterFn(O); + var length, result, step, iterator; + if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); + // if object isn't iterable or it's array with default iterator - use simple case + if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) { + for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { + createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); + } + } else { + length = toLength(O.length); + for (result = new C(length); length > index; index++) { + createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + } } + result.length = index; return result; -}; -exports.checkExceptions = checkExceptions; + } +}); /***/ }), -/***/ 64258: -/***/ ((module) => { +/***/ "./node_modules/core-js/modules/es6.array.index-of.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.index-of.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_288653__) { -/****************************************************************************** -Copyright (c) Microsoft Corporation. +"use strict"; -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. +var $export = __nested_webpack_require_288653__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $indexOf = __nested_webpack_require_288653__(/*! ./_array-includes */ "./node_modules/core-js/modules/_array-includes.js")(false); +var $native = [].indexOf; +var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; +$export($export.P + $export.F * (NEGATIVE_ZERO || !__nested_webpack_require_288653__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")($native)), 'Array', { + // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) + indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { + return NEGATIVE_ZERO + // convert -0 to +0 + ? $native.apply(this, arguments) || 0 + : $indexOf(this, searchElement, arguments[1]); + } +}); - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; +/***/ }), - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; +/***/ "./node_modules/core-js/modules/es6.array.is-array.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.is-array.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_289806__) { - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; +// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) +var $export = __nested_webpack_require_289806__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; +$export($export.S, 'Array', { isArray: __nested_webpack_require_289806__(/*! ./_is-array */ "./node_modules/core-js/modules/_is-array.js") }); - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; +/***/ }), - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); +/***/ "./node_modules/core-js/modules/es6.array.iterator.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.iterator.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_290435__) { - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; +"use strict"; - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; +var addToUnscopables = __nested_webpack_require_290435__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js"); +var step = __nested_webpack_require_290435__(/*! ./_iter-step */ "./node_modules/core-js/modules/_iter-step.js"); +var Iterators = __nested_webpack_require_290435__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); +var toIObject = __nested_webpack_require_290435__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; +// 22.1.3.4 Array.prototype.entries() +// 22.1.3.13 Array.prototype.keys() +// 22.1.3.29 Array.prototype.values() +// 22.1.3.30 Array.prototype[@@iterator]() +module.exports = __nested_webpack_require_290435__(/*! ./_iter-define */ "./node_modules/core-js/modules/_iter-define.js")(Array, 'Array', function (iterated, kind) { + this._t = toIObject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind +// 22.1.5.2.1 %ArrayIteratorPrototype%.next() +}, function () { + var O = this._t; + var kind = this._k; + var index = this._i++; + if (!O || index >= O.length) { + this._t = undefined; + return step(1); + } + if (kind == 'keys') return step(0, index); + if (kind == 'values') return step(0, O[index]); + return step(0, [index, O[index]]); +}, 'values'); - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; +// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) +Iterators.Arguments = Iterators.Array; - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; +addToUnscopables('keys'); +addToUnscopables('values'); +addToUnscopables('entries'); - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; +/***/ }), - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; +/***/ "./node_modules/core-js/modules/es6.array.join.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.join.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_292228__) { - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; +"use strict"; - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; +// 22.1.3.13 Array.prototype.join(separator) +var $export = __nested_webpack_require_292228__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toIObject = __nested_webpack_require_292228__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var arrayJoin = [].join; - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; +// fallback for not array-like strings +$export($export.P + $export.F * (__nested_webpack_require_292228__(/*! ./_iobject */ "./node_modules/core-js/modules/_iobject.js") != Object || !__nested_webpack_require_292228__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")(arrayJoin)), 'Array', { + join: function join(separator) { + return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); + } +}); - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; +/***/ }), - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; +/***/ "./node_modules/core-js/modules/es6.array.last-index-of.js": +/*!*****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.last-index-of.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_293318__) { - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +"use strict"; - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; +var $export = __nested_webpack_require_293318__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toIObject = __nested_webpack_require_293318__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var toInteger = __nested_webpack_require_293318__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var toLength = __nested_webpack_require_293318__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var $native = [].lastIndexOf; +var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); +$export($export.P + $export.F * (NEGATIVE_ZERO || !__nested_webpack_require_293318__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")($native)), 'Array', { + // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) + lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { + // convert -0 to +0 + if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0; + var O = toIObject(this); + var length = toLength(O.length); + var index = length - 1; + if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1])); + if (index < 0) index = length + index; + for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0; + return -1; + } }); /***/ }), -/***/ 65234: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.array.map.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.map.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_294946__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.XmlNode = void 0; -const escape_attribute_1 = __nccwpck_require__(13706); -const XmlText_1 = __nccwpck_require__(36652); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -class XmlNode { - static of(name, childText, withName) { - const node = new XmlNode(name); - if (childText !== undefined) { - node.addChildNode(new XmlText_1.XmlText(childText)); - } - if (withName !== undefined) { - node.withName(withName); - } - return node; - } - constructor(name, children = []) { - this.name = name; - this.children = children; - this.attributes = {}; - } - withName(name) { - this.name = name; - return this; - } - addAttribute(name, value) { - this.attributes[name] = value; - return this; - } - addChildNode(child) { - this.children.push(child); - return this; - } - removeAttribute(name) { - delete this.attributes[name]; - return this; - } - n(name) { - this.name = name; - return this; - } - c(child) { - this.children.push(child); - return this; - } - a(name, value) { - if (value != null) { - this.attributes[name] = value; - } - return this; - } - cc(input, field, withName = field) { - if (input[field] != null) { - const node = XmlNode.of(field, input[field]).withName(withName); - this.c(node); - } - } - l(input, listName, memberName, valueProvider) { - if (input[listName] != null) { - const nodes = valueProvider(); - nodes.map((node) => { - node.withName(memberName); - this.c(node); - }); - } - } - lc(input, listName, memberName, valueProvider) { - if (input[listName] != null) { - const nodes = valueProvider(); - const containerNode = new XmlNode(memberName); - nodes.map((node) => { - containerNode.c(node); - }); - this.c(containerNode); - } - } - toString() { - const hasChildren = Boolean(this.children.length); - let xmlText = `<${this.name}`; - const attributes = this.attributes; - for (const attributeName of Object.keys(attributes)) { - const attribute = attributes[attributeName]; - if (attribute != null) { - xmlText += ` ${attributeName}="${(0, escape_attribute_1.escapeAttribute)("" + attribute)}"`; - } - } - return (xmlText += !hasChildren ? "/>" : `>${this.children.map((c) => c.toString()).join("")}`); - } -} -exports.XmlNode = XmlNode; +var $export = __nested_webpack_require_294946__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $map = __nested_webpack_require_294946__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(1); + +$export($export.P + $export.F * !__nested_webpack_require_294946__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].map, true), 'Array', { + // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) + map: function map(callbackfn /* , thisArg */) { + return $map(this, callbackfn, arguments[1]); + } +}); /***/ }), -<<<<<<< HEAD -/***/ 45306: -======= -/***/ 36652: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.array.of.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.of.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_295839__) { +"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.XmlText = void 0; -<<<<<<< HEAD -const escape_element_1 = __nccwpck_require__(89522); -======= -const escape_element_1 = __nccwpck_require__(90020); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -class XmlText { - constructor(value) { - this.value = value; - } - toString() { - return (0, escape_element_1.escapeElement)("" + this.value); - } -} -exports.XmlText = XmlText; +var $export = __nested_webpack_require_295839__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var createProperty = __nested_webpack_require_295839__(/*! ./_create-property */ "./node_modules/core-js/modules/_create-property.js"); + +// WebKit Array.of isn't generic +$export($export.S + $export.F * __nested_webpack_require_295839__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + function F() { /* empty */ } + return !(Array.of.call(F) instanceof F); +}), 'Array', { + // 22.1.2.3 Array.of( ...items) + of: function of(/* ...args */) { + var index = 0; + var aLen = arguments.length; + var result = new (typeof this == 'function' ? this : Array)(aLen); + while (aLen > index) createProperty(result, index, arguments[index++]); + result.length = aLen; + return result; + } +}); /***/ }), -<<<<<<< HEAD -/***/ 35335: -======= -/***/ 13706: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/es6.array.reduce-right.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.reduce-right.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_297019__) { +"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeAttribute = void 0; -function escapeAttribute(value) { - return value.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """); -} -exports.escapeAttribute = escapeAttribute; +var $export = __nested_webpack_require_297019__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $reduce = __nested_webpack_require_297019__(/*! ./_array-reduce */ "./node_modules/core-js/modules/_array-reduce.js"); + +$export($export.P + $export.F * !__nested_webpack_require_297019__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].reduceRight, true), 'Array', { + // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) + reduceRight: function reduceRight(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments[1], true); + } +}); /***/ }), -<<<<<<< HEAD -/***/ 89522: -======= -/***/ 90020: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/es6.array.reduce.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.reduce.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_297995__) { +"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeElement = void 0; -function escapeElement(value) { - return value - .replace(/&/g, "&") - .replace(/"/g, """) - .replace(/'/g, "'") - .replace(//g, ">") - .replace(/\r/g, " ") - .replace(/\n/g, " ") - .replace(/\u0085/g, "…") - .replace(/\u2028/, "
"); -} -exports.escapeElement = escapeElement; +var $export = __nested_webpack_require_297995__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $reduce = __nested_webpack_require_297995__(/*! ./_array-reduce */ "./node_modules/core-js/modules/_array-reduce.js"); + +$export($export.P + $export.F * !__nested_webpack_require_297995__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].reduce, true), 'Array', { + // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) + reduce: function reduce(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments[1], false); + } +}); /***/ }), -<<<<<<< HEAD -/***/ 63131: -======= -/***/ 78161: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.array.slice.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.slice.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_298948__) { +"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const tslib_1 = __nccwpck_require__(72433); -tslib_1.__exportStar(__nccwpck_require__(71299), exports); -tslib_1.__exportStar(__nccwpck_require__(45306), exports); -======= -const tslib_1 = __nccwpck_require__(42386); -tslib_1.__exportStar(__nccwpck_require__(65234), exports); -tslib_1.__exportStar(__nccwpck_require__(36652), exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var $export = __nested_webpack_require_298948__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var html = __nested_webpack_require_298948__(/*! ./_html */ "./node_modules/core-js/modules/_html.js"); +var cof = __nested_webpack_require_298948__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); +var toAbsoluteIndex = __nested_webpack_require_298948__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); +var toLength = __nested_webpack_require_298948__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var arraySlice = [].slice; + +// fallback for not array-like ES3 strings and DOM objects +$export($export.P + $export.F * __nested_webpack_require_298948__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + if (html) arraySlice.call(html); +}), 'Array', { + slice: function slice(begin, end) { + var len = toLength(this.length); + var klass = cof(this); + end = end === undefined ? len : end; + if (klass == 'Array') return arraySlice.call(this, begin, end); + var start = toAbsoluteIndex(begin, len); + var upTo = toAbsoluteIndex(end, len); + var size = toLength(upTo - start); + var cloned = new Array(size); + var i = 0; + for (; i < size; i++) cloned[i] = klass == 'String' + ? this.charAt(start + i) + : this[start + i]; + return cloned; + } +}); /***/ }), -<<<<<<< HEAD -/***/ 72433: -======= -/***/ 42386: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { +/***/ "./node_modules/core-js/modules/es6.array.some.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.some.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_300600__) { -/****************************************************************************** -Copyright (c) Microsoft Corporation. +"use strict"; -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. +var $export = __nested_webpack_require_300600__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $some = __nested_webpack_require_300600__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(3); -<<<<<<< HEAD -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); -======= -/***/ }), +$export($export.P + $export.F * !__nested_webpack_require_300600__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].some, true), 'Array', { + // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) + some: function some(callbackfn /* , thisArg */) { + return $some(this, callbackfn, arguments[1]); + } +}); -/***/ 30158: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; +/***/ }), +/***/ "./node_modules/core-js/modules/es6.array.sort.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.sort.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_301507__) { -Object.defineProperty(exports, "__esModule", ({ value: true })); +"use strict"; -var cborg = __nccwpck_require__(12085); -var cid = __nccwpck_require__(24247); +var $export = __nested_webpack_require_301507__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var aFunction = __nested_webpack_require_301507__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var toObject = __nested_webpack_require_301507__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var fails = __nested_webpack_require_301507__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var $sort = [].sort; +var test = [1, 2, 3]; -function _interopNamespace(e) { - if (e && e.__esModule) return e; - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); +$export($export.P + $export.F * (fails(function () { + // IE8- + test.sort(undefined); +}) || !fails(function () { + // V8 bug + test.sort(null); + // Old WebKit +}) || !__nested_webpack_require_301507__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")($sort)), 'Array', { + // 22.1.3.25 Array.prototype.sort(comparefn) + sort: function sort(comparefn) { + return comparefn === undefined + ? $sort.call(toObject(this)) + : $sort.call(toObject(this), aFunction(comparefn)); } - n["default"] = e; - return Object.freeze(n); -} +}); -var cborg__namespace = /*#__PURE__*/_interopNamespace(cborg); -const CID_CBOR_TAG = 42; -function cidEncoder(obj) { - if (obj.asCID !== obj) { - return null; - } - const cid$1 = cid.CID.asCID(obj); - if (!cid$1) { - return null; - } - const bytes = new Uint8Array(cid$1.bytes.byteLength + 1); - bytes.set(cid$1.bytes, 1); - return [ - new cborg__namespace.Token(cborg__namespace.Type.tag, CID_CBOR_TAG), - new cborg__namespace.Token(cborg__namespace.Type.bytes, bytes) - ]; -} -function undefinedEncoder() { - throw new Error('`undefined` is not supported by the IPLD Data Model and cannot be encoded'); -} -function numberEncoder(num) { - if (Number.isNaN(num)) { - throw new Error('`NaN` is not supported by the IPLD Data Model and cannot be encoded'); - } - if (num === Infinity || num === -Infinity) { - throw new Error('`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded'); - } - return null; -} -const encodeOptions = { - float64: true, - typeEncoders: { - Object: cidEncoder, - undefined: undefinedEncoder, - number: numberEncoder - } -}; -function cidDecoder(bytes) { - if (bytes[0] !== 0) { - throw new Error('Invalid CID for CBOR tag 42; expected leading 0x00'); - } - return cid.CID.decode(bytes.subarray(1)); -} -const decodeOptions = { - allowIndefinite: false, - allowUndefined: false, - allowNaN: false, - allowInfinity: false, - allowBigInt: true, - strict: true, - useMaps: false, - tags: [] -}; -decodeOptions.tags[CID_CBOR_TAG] = cidDecoder; -const name = 'dag-cbor'; -const code = 113; -const encode = node => cborg__namespace.encode(node, encodeOptions); -const decode = data => cborg__namespace.decode(data, decodeOptions); +/***/ }), -exports.code = code; -exports.decode = decode; -exports.encode = encode; -exports.name = name; +/***/ "./node_modules/core-js/modules/es6.array.species.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.species.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_302825__) { + +__nested_webpack_require_302825__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js")('Array'); /***/ }), -/***/ 56994: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.date.now.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.date.now.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_303263__) { -"use strict"; +// 20.3.3.1 / 15.9.4.4 Date.now() +var $export = __nested_webpack_require_303263__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +$export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); -Object.defineProperty(exports, "__esModule", ({ value: true })); -var reader = __nccwpck_require__(67237); -var indexer = __nccwpck_require__(76346); -var iterator = __nccwpck_require__(2650); -var writer = __nccwpck_require__(72902); -var indexedReader = __nccwpck_require__(87305); +/***/ }), +/***/ "./node_modules/core-js/modules/es6.date.to-iso-string.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.date.to-iso-string.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_303854__) { +// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() +var $export = __nested_webpack_require_303854__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toISOString = __nested_webpack_require_303854__(/*! ./_date-to-iso-string */ "./node_modules/core-js/modules/_date-to-iso-string.js"); -exports.CarReader = reader.CarReader; -exports.CarIndexer = indexer.CarIndexer; -exports.CarBlockIterator = iterator.CarBlockIterator; -exports.CarCIDIterator = iterator.CarCIDIterator; -exports.CarWriter = writer.CarWriter; -exports.CarIndexedReader = indexedReader.CarIndexedReader; +// PhantomJS / old WebKit has a broken implementations +$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { + toISOString: toISOString +}); /***/ }), -/***/ 92730: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.date.to-json.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.date.to-json.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_304657__) { "use strict"; +var $export = __nested_webpack_require_304657__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toObject = __nested_webpack_require_304657__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toPrimitive = __nested_webpack_require_304657__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); -Object.defineProperty(exports, "__esModule", ({ value: true })); +$export($export.P + $export.F * __nested_webpack_require_304657__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + return new Date(NaN).toJSON() !== null + || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; +}), 'Date', { + // eslint-disable-next-line no-unused-vars + toJSON: function toJSON(key) { + var O = toObject(this); + var pv = toPrimitive(O); + return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); + } +}); -var varint = __nccwpck_require__(75739); -var cid = __nccwpck_require__(24247); -var Digest = __nccwpck_require__(81168); -var dagCbor = __nccwpck_require__(89778); -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +/***/ }), -function _interopNamespace(e) { - if (e && e.__esModule) return e; - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n["default"] = e; - return Object.freeze(n); -} +/***/ "./node_modules/core-js/modules/es6.date.to-primitive.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.date.to-primitive.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_305844__) { -var varint__default = /*#__PURE__*/_interopDefaultLegacy(varint); -var Digest__namespace = /*#__PURE__*/_interopNamespace(Digest); +var TO_PRIMITIVE = __nested_webpack_require_305844__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('toPrimitive'); +var proto = Date.prototype; -const CIDV0_BYTES = { - SHA2_256: 18, - LENGTH: 32, - DAG_PB: 112 -}; -async function readVarint(reader) { - const bytes = await reader.upTo(8); - const i = varint__default["default"].decode(bytes); - reader.seek(varint__default["default"].decode.bytes); - return i; +if (!(TO_PRIMITIVE in proto)) __nested_webpack_require_305844__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js")(proto, TO_PRIMITIVE, __nested_webpack_require_305844__(/*! ./_date-to-primitive */ "./node_modules/core-js/modules/_date-to-primitive.js")); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.date.to-string.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.date.to-string.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_306579__) { + +var DateProto = Date.prototype; +var INVALID_DATE = 'Invalid Date'; +var TO_STRING = 'toString'; +var $toString = DateProto[TO_STRING]; +var getTime = DateProto.getTime; +if (new Date(NaN) + '' != INVALID_DATE) { + __nested_webpack_require_306579__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js")(DateProto, TO_STRING, function toString() { + var value = getTime.call(this); + // eslint-disable-next-line no-self-compare + return value === value ? $toString.call(this) : INVALID_DATE; + }); } -async function readHeader(reader) { - const length = await readVarint(reader); - if (length === 0) { - throw new Error('Invalid CAR header (zero length)'); - } - const header = await reader.exactly(length); - reader.seek(length); - const block = dagCbor.decode(header); - if (block == null || Array.isArray(block) || typeof block !== 'object') { - throw new Error('Invalid CAR header format'); - } - if (block.version !== 1) { - if (typeof block.version === 'string') { - throw new Error(`Invalid CAR version: "${ block.version }"`); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; -<<<<<<< HEAD - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -======= -exports.asyncIterableReader = asyncIterableReader; -exports.bytesReader = bytesReader; -exports.chunkReader = chunkReader; -exports.createDecoder = createDecoder; -exports.readBlockHead = readBlockHead; -exports.readHeader = readHeader; + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.function.bind.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.function.bind.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_307433__) { + +// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) +var $export = __nested_webpack_require_307433__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.P, 'Function', { bind: __nested_webpack_require_307433__(/*! ./_bind */ "./node_modules/core-js/modules/_bind.js") }); /***/ }), -/***/ 32454: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.function.has-instance.js": +/*!*******************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.function.has-instance.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_308105__) { "use strict"; +var isObject = __nested_webpack_require_308105__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var getPrototypeOf = __nested_webpack_require_308105__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var HAS_INSTANCE = __nested_webpack_require_308105__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('hasInstance'); +var FunctionProto = Function.prototype; +// 19.2.3.6 Function.prototype[@@hasInstance](V) +if (!(HAS_INSTANCE in FunctionProto)) __nested_webpack_require_308105__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f(FunctionProto, HAS_INSTANCE, { value: function (O) { + if (typeof this != 'function' || !isObject(O)) return false; + if (!isObject(this.prototype)) return O instanceof this; + // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: + while (O = getPrototypeOf(O)) if (this.prototype === O) return true; + return false; +} }); -Object.defineProperty(exports, "__esModule", ({ value: true })); -var varint = __nccwpck_require__(75739); -var dagCbor = __nccwpck_require__(89778); +/***/ }), -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +/***/ "./node_modules/core-js/modules/es6.function.name.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.function.name.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_309377__) { -var varint__default = /*#__PURE__*/_interopDefaultLegacy(varint); +var dP = __nested_webpack_require_309377__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +var FProto = Function.prototype; +var nameRE = /^\s*function ([^ (]*)/; +var NAME = 'name'; -function createHeader(roots) { - const headerBytes = dagCbor.encode({ - version: 1, - roots - }); - const varintBytes = varint__default["default"].encode(headerBytes.length); - const header = new Uint8Array(varintBytes.length + headerBytes.length); - header.set(varintBytes, 0); - header.set(headerBytes, varintBytes.length); - return header; -} -function createEncoder(writer) { - return { - async setRoots(roots) { - const bytes = createHeader(roots); - await writer.write(bytes); - }, - async writeBlock(block) { - const {cid, bytes} = block; - await writer.write(new Uint8Array(varint__default["default"].encode(cid.bytes.length + bytes.length))); - await writer.write(cid.bytes); - if (bytes.length) { - await writer.write(bytes); - } - }, - async close() { - return writer.end(); +// 19.2.4.2 name +NAME in FProto || __nested_webpack_require_309377__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && dP(FProto, NAME, { + configurable: true, + get: function () { + try { + return ('' + this).match(nameRE)[1]; + } catch (e) { + return ''; } - }; -} - -exports.createEncoder = createEncoder; -exports.createHeader = createHeader; + } +}); /***/ }), -/***/ 87305: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.map.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/es6.map.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_310178__) { "use strict"; +var strong = __nested_webpack_require_310178__(/*! ./_collection-strong */ "./node_modules/core-js/modules/_collection-strong.js"); +var validate = __nested_webpack_require_310178__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); +var MAP = 'Map'; -Object.defineProperty(exports, "__esModule", ({ value: true })); +// 23.1 Map Objects +module.exports = __nested_webpack_require_310178__(/*! ./_collection */ "./node_modules/core-js/modules/_collection.js")(MAP, function (get) { + return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key) { + var entry = strong.getEntry(validate(this, MAP), key); + return entry && entry.v; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value) { + return strong.def(validate(this, MAP), key === 0 ? 0 : key, value); + } +}, strong, true); -var fs = __nccwpck_require__(57147); -var stream = __nccwpck_require__(12781); -var cid = __nccwpck_require__(24247); -var indexer = __nccwpck_require__(76346); -var reader = __nccwpck_require__(67237); -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.math.acosh.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.acosh.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_311376__) { -var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); +// 20.2.2.3 Math.acosh(x) +var $export = __nested_webpack_require_311376__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var log1p = __nested_webpack_require_311376__(/*! ./_math-log1p */ "./node_modules/core-js/modules/_math-log1p.js"); +var sqrt = Math.sqrt; +var $acosh = Math.acosh; -class CarIndexedReader { - constructor(version, path, roots, index, order) { - this._version = version; - this._path = path; - this._roots = roots; - this._index = index; - this._order = order; - this._fd = null; - } - get version() { - return this._version; - } - async getRoots() { - return this._roots; - } - async has(key) { - return this._index.has(key.toString()); +$export($export.S + $export.F * !($acosh + // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 + && Math.floor($acosh(Number.MAX_VALUE)) == 710 + // Tor Browser bug: Math.acosh(Infinity) -> NaN + && $acosh(Infinity) == Infinity +), 'Math', { + acosh: function acosh(x) { + return (x = +x) < 1 ? NaN : x > 94906265.62425156 + ? Math.log(x) + Math.LN2 + : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); } - async get(key) { - const blockIndex = this._index.get(key.toString()); - if (!blockIndex) { - return undefined; - } - if (!this._fd) { - this._fd = await fs__default["default"].promises.open(this._path, 'r'); - } - const readIndex = { - cid: key, - length: 0, - offset: 0, - blockLength: blockIndex.blockLength, - blockOffset: blockIndex.blockOffset ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - }; +}); - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; +/***/ }), - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; +/***/ "./node_modules/core-js/modules/es6.math.asinh.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.asinh.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_312417__) { - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; +// 20.2.2.5 Math.asinh(x) +var $export = __nested_webpack_require_312417__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $asinh = Math.asinh; - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; +function asinh(x) { + return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); +} - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; +// Tor Browser bug: Math.asinh(0) -> -0 +$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh }); - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; +/***/ }), - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; +/***/ "./node_modules/core-js/modules/es6.math.atanh.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.atanh.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_313164__) { - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; +// 20.2.2.7 Math.atanh(x) +var $export = __nested_webpack_require_313164__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $atanh = Math.atanh; - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; +// Tor Browser bug: Math.atanh(-0) -> 0 +$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { + atanh: function atanh(x) { + return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; + } +}); - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; +/***/ }), - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; +/***/ "./node_modules/core-js/modules/es6.math.cbrt.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.cbrt.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_313869__) { - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; +// 20.2.2.9 Math.cbrt(x) +var $export = __nested_webpack_require_313869__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var sign = __nested_webpack_require_313869__(/*! ./_math-sign */ "./node_modules/core-js/modules/_math-sign.js"); - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); +$export($export.S, 'Math', { + cbrt: function cbrt(x) { + return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); + } }); /***/ }), -<<<<<<< HEAD -/***/ 74700: -======= -/***/ 76346: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -var __webpack_unused_export__; +/***/ "./node_modules/core-js/modules/es6.math.clz32.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.clz32.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_314556__) { +// 20.2.2.11 Math.clz32(x) +var $export = __nested_webpack_require_314556__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -__webpack_unused_export__ = ({ - value: true -}); -Object.defineProperty(exports, "zR", ({ - enumerable: true, - get: function () { - return _nil.default; - } -})); -Object.defineProperty(exports, "Qc", ({ - enumerable: true, - get: function () { - return _parse.default; - } -})); -Object.defineProperty(exports, "Pz", ({ - enumerable: true, - get: function () { - return _stringify.default; - } -})); -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, "Gu", ({ - enumerable: true, - get: function () { - return _validate.default; - } -})); -Object.defineProperty(exports, "i8", ({ - enumerable: true, - get: function () { - return _version.default; +$export($export.S, 'Math', { + clz32: function clz32(x) { + return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; } -})); - -<<<<<<< HEAD -var _v = _interopRequireDefault(__nccwpck_require__(7863)); -======= -var decoder = __nccwpck_require__(92730); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -var _v2 = _interopRequireDefault(__nccwpck_require__(83804)); - -var _v3 = _interopRequireDefault(__nccwpck_require__(48308)); - -var _v4 = _interopRequireDefault(__nccwpck_require__(17773)); +}); -var _nil = _interopRequireDefault(__nccwpck_require__(75396)); -var _version = _interopRequireDefault(__nccwpck_require__(1932)); +/***/ }), -var _validate = _interopRequireDefault(__nccwpck_require__(43384)); +/***/ "./node_modules/core-js/modules/es6.math.cosh.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.cosh.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_315165__) { -var _stringify = _interopRequireDefault(__nccwpck_require__(64346)); +// 20.2.2.12 Math.cosh(x) +var $export = __nested_webpack_require_315165__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var exp = Math.exp; -var _parse = _interopRequireDefault(__nccwpck_require__(12798)); +$export($export.S, 'Math', { + cosh: function cosh(x) { + return (exp(x = +x) + exp(-x)) / 2; + } +}); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), -<<<<<<< HEAD -/***/ 2026: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.math.expm1.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.expm1.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_315757__) { +// 20.2.2.14 Math.expm1(x) +var $export = __nested_webpack_require_315757__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $expm1 = __nested_webpack_require_315757__(/*! ./_math-expm1 */ "./node_modules/core-js/modules/_math-expm1.js"); +$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 }); -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 }; } +/***/ "./node_modules/core-js/modules/es6.math.fround.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.fround.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_316418__) { -function md5(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); - } +// 20.2.2.16 Math.fround(x) +var $export = __nested_webpack_require_316418__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - return _crypto.default.createHash('md5').update(bytes).digest(); -} +$export($export.S, 'Math', { fround: __nested_webpack_require_316418__(/*! ./_math-fround */ "./node_modules/core-js/modules/_math-fround.js") }); -var _default = md5; -exports["default"] = _default; /***/ }), -/***/ 45476: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; +/***/ "./node_modules/core-js/modules/es6.math.hypot.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.hypot.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_317021__) { -var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); +// 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) +var $export = __nested_webpack_require_317021__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var abs = Math.abs; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +$export($export.S, 'Math', { + hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars + var sum = 0; + var i = 0; + var aLen = arguments.length; + var larg = 0; + var arg, div; + while (i < aLen) { + arg = abs(arguments[i++]); + if (larg < arg) { + div = larg / arg; + sum = sum * div * div + 1; + larg = arg; + } else if (arg > 0) { + div = arg / larg; + sum += div * div; + } else sum += arg; + } + return larg === Infinity ? Infinity : larg * Math.sqrt(sum); + } +}); -var _default = { - randomUUID: _crypto.default.randomUUID -}; -exports["default"] = _default; /***/ }), -/***/ 75396: -======= -/***/ 69388: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/es6.math.imul.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.imul.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_318084__) { +// 20.2.2.18 Math.imul(x, y) +var $export = __nested_webpack_require_318084__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $imul = Math.imul; +// some WebKit versions fails with big numbers, some has wrong arity +$export($export.S + $export.F * __nested_webpack_require_318084__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + return $imul(0xffffffff, 5) != -5 || $imul.length != 2; +}), 'Math', { + imul: function imul(x, y) { + var UINT16 = 0xffff; + var xn = +x; + var yn = +y; + var xl = UINT16 & xn; + var yl = UINT16 & yn; + return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); + } +}); -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _default = '00000000-0000-0000-0000-000000000000'; -exports["default"] = _default; /***/ }), -/***/ 12798: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; - -var _validate = _interopRequireDefault(__nccwpck_require__(43384)); +/***/ "./node_modules/core-js/modules/es6.math.log10.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.log10.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_319088__) { -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +// 20.2.2.21 Math.log10(x) +var $export = __nested_webpack_require_319088__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -function parse(uuid) { - if (!(0, _validate.default)(uuid)) { - throw TypeError('Invalid UUID'); +$export($export.S, 'Math', { + log10: function log10(x) { + return Math.log(x) * Math.LOG10E; } +}); - 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 ........-....-....-####-............ +/***/ "./node_modules/core-js/modules/es6.math.log1p.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.log1p.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_319661__) { - 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) +// 20.2.2.20 Math.log1p(x) +var $export = __nested_webpack_require_319661__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - 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; -} +$export($export.S, 'Math', { log1p: __nested_webpack_require_319661__(/*! ./_math-log1p */ "./node_modules/core-js/modules/_math-log1p.js") }); -var _default = parse; -exports["default"] = _default; /***/ }), -/***/ 14296: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/es6.math.log2.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.log2.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_320256__) { +// 20.2.2.22 Math.log2(x) +var $export = __nested_webpack_require_320256__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +$export($export.S, 'Math', { + log2: function log2(x) { + return Math.log(x) / Math.LN2; + } +}); -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; /***/ }), -/***/ 7782: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - +/***/ "./node_modules/core-js/modules/es6.math.sign.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.sign.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_320819__) { -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = rng; +// 20.2.2.28 Math.sign(x) +var $export = __nested_webpack_require_320819__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); +$export($export.S, 'Math', { sign: __nested_webpack_require_320819__(/*! ./_math-sign */ "./node_modules/core-js/modules/_math-sign.js") }); -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; +/***/ "./node_modules/core-js/modules/es6.math.sinh.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.sinh.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_321410__) { -function rng() { - if (poolPtr > rnds8Pool.length - 16) { - _crypto.default.randomFillSync(rnds8Pool); +// 20.2.2.30 Math.sinh(x) +var $export = __nested_webpack_require_321410__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var expm1 = __nested_webpack_require_321410__(/*! ./_math-expm1 */ "./node_modules/core-js/modules/_math-expm1.js"); +var exp = Math.exp; - poolPtr = 0; +// V8 near Chromium 38 has a problem with very small numbers +$export($export.S + $export.F * __nested_webpack_require_321410__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + return !Math.sinh(-2e-17) != -2e-17; +}), 'Math', { + sinh: function sinh(x) { + return Math.abs(x = +x) < 1 + ? (expm1(x) - expm1(-x)) / 2 + : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); } +}); - return rnds8Pool.slice(poolPtr, poolPtr += 16); -} /***/ }), -/***/ 26860: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; - -var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); +/***/ "./node_modules/core-js/modules/es6.math.tanh.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.tanh.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_322390__) { -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +// 20.2.2.33 Math.tanh(x) +var $export = __nested_webpack_require_322390__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var expm1 = __nested_webpack_require_322390__(/*! ./_math-expm1 */ "./node_modules/core-js/modules/_math-expm1.js"); +var exp = Math.exp; -function sha1(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); +$export($export.S, 'Math', { + tanh: function tanh(x) { + var a = expm1(x = +x); + var b = expm1(-x); + return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); } +}); - return _crypto.default.createHash('sha1').update(bytes).digest(); -} - -var _default = sha1; -exports["default"] = _default; /***/ }), -/***/ 64346: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - +/***/ "./node_modules/core-js/modules/es6.math.trunc.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.trunc.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_323177__) { +// 20.2.2.34 Math.trunc(x) +var $export = __nested_webpack_require_323177__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -exports.unsafeStringify = unsafeStringify; +$export($export.S, 'Math', { + trunc: function trunc(it) { + return (it > 0 ? Math.floor : Math.ceil)(it); + } +}); -var _validate = _interopRequireDefault(__nccwpck_require__(43384)); -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 = []; +/***/ "./node_modules/core-js/modules/es6.number.constructor.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.constructor.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_323795__) { -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).slice(1)); -} +"use strict"; -function unsafeStringify(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 - return 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]]; -} +var global = __nested_webpack_require_323795__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var has = __nested_webpack_require_323795__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var cof = __nested_webpack_require_323795__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); +var inheritIfRequired = __nested_webpack_require_323795__(/*! ./_inherit-if-required */ "./node_modules/core-js/modules/_inherit-if-required.js"); +var toPrimitive = __nested_webpack_require_323795__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); +var fails = __nested_webpack_require_323795__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var gOPN = __nested_webpack_require_323795__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f; +var gOPD = __nested_webpack_require_323795__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js").f; +var dP = __nested_webpack_require_323795__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +var $trim = __nested_webpack_require_323795__(/*! ./_string-trim */ "./node_modules/core-js/modules/_string-trim.js").trim; +var NUMBER = 'Number'; +var $Number = global[NUMBER]; +var Base = $Number; +var proto = $Number.prototype; +// Opera ~12 has broken Object#toString +var BROKEN_COF = cof(__nested_webpack_require_323795__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js")(proto)) == NUMBER; +var TRIM = 'trim' in String.prototype; -function stringify(arr, offset = 0) { - const uuid = unsafeStringify(arr, offset); // 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 +// 7.1.3 ToNumber(argument) +var toNumber = function (argument) { + var it = toPrimitive(argument, false); + if (typeof it == 'string' && it.length > 2) { + it = TRIM ? it.trim() : $trim(it, 3); + var first = it.charCodeAt(0); + var third, radix, maxCode; + if (first === 43 || first === 45) { + third = it.charCodeAt(2); + if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix + } else if (first === 48) { + switch (it.charCodeAt(1)) { + case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i + case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i + default: return +it; + } + for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) { + code = digits.charCodeAt(i); + // parseInt parses a string to a first unavailable symbol + // but ToNumber should return NaN if a string contains unavailable symbols + if (code < 48 || code > maxCode) return NaN; + } return parseInt(digits, radix); + } + } return +it; +}; - if (!(0, _validate.default)(uuid)) { - throw TypeError('Stringified UUID is invalid'); +if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) { + $Number = function Number(value) { + var it = arguments.length < 1 ? 0 : value; + var that = this; + return that instanceof $Number + // check on 1..constructor(foo) case + && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER) + ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); + }; + for (var keys = __nested_webpack_require_323795__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") ? gOPN(Base) : ( + // ES3: + 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + + // ES6 (in case, if modules with ES6 Number statics required before): + 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' + ).split(','), j = 0, key; keys.length > j; j++) { + if (has(Base, key = keys[j]) && !has($Number, key)) { + dP($Number, key, gOPD(Base, key)); + } } - - return uuid; + $Number.prototype = proto; + proto.constructor = $Number; + __nested_webpack_require_323795__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js")(global, NUMBER, $Number); } -var _default = stringify; -exports["default"] = _default; /***/ }), -/***/ 7863: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; - -var _rng = _interopRequireDefault(__nccwpck_require__(7782)); - -var _stringify = __nccwpck_require__(64346); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/***/ "./node_modules/core-js/modules/es6.number.epsilon.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.epsilon.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_327786__) { -// **`v1()` - Generate time-based UUID** -// -// Inspired by https://github.com/LiosK/UUID.js -// and http://docs.python.org/library/uuid.html -let _nodeId; +// 20.1.2.1 Number.EPSILON +var $export = __nested_webpack_require_327786__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -let _clockseq; // Previous uuid creation time +$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); -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 +/***/ "./node_modules/core-js/modules/es6.number.is-finite.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.is-finite.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_328340__) { - if (node == null || clockseq == null) { - const seedBytes = options.random || (options.rng || _rng.default)(); +// 20.1.2.2 Number.isFinite(number) +var $export = __nested_webpack_require_328340__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var _isFinite = __nested_webpack_require_328340__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").isFinite; - 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]]; - } +$export($export.S, 'Number', { + isFinite: function isFinite(it) { + return typeof it == 'number' && _isFinite(it); + } +}); - 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 +/***/ "./node_modules/core-js/modules/es6.number.is-integer.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.is-integer.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_329080__) { - let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) +// 20.1.2.3 Number.isInteger(number) +var $export = __nested_webpack_require_329080__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression +$export($export.S, 'Number', { isInteger: __nested_webpack_require_329080__(/*! ./_is-integer */ "./node_modules/core-js/modules/_is-integer.js") }); - 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 +/***/ "./node_modules/core-js/modules/es6.number.is-nan.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.is-nan.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_329707__) { +// 20.1.2.4 Number.isNaN(number) +var $export = __nested_webpack_require_329707__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - if (nsecs >= 10000) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); +$export($export.S, 'Number', { + isNaN: function isNaN(number) { + // eslint-disable-next-line no-self-compare + return number != number; } +}); - _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` +/***/ "./node_modules/core-js/modules/es6.number.is-safe-integer.js": +/*!********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.is-safe-integer.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_330380__) { - const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; // `time_high_and_version` +// 20.1.2.5 Number.isSafeInteger(number) +var $export = __nested_webpack_require_330380__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var isInteger = __nested_webpack_require_330380__(/*! ./_is-integer */ "./node_modules/core-js/modules/_is-integer.js"); +var abs = Math.abs; - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version +$export($export.S, 'Number', { + isSafeInteger: function isSafeInteger(number) { + return isInteger(number) && abs(number) <= 0x1fffffffffffff; + } +}); - 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` +/***/ "./node_modules/core-js/modules/es6.number.max-safe-integer.js": +/*!*********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.max-safe-integer.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_331196__) { - for (let n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } +// 20.1.2.6 Number.MAX_SAFE_INTEGER +var $export = __nested_webpack_require_331196__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - return buf || (0, _stringify.unsafeStringify)(b); -} +$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); -var _default = v1; -exports["default"] = _default; /***/ }), -/***/ 83804: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.number.min-safe-integer.js": +/*!*********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.min-safe-integer.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_331796__) { +// 20.1.2.10 Number.MIN_SAFE_INTEGER +var $export = __nested_webpack_require_331796__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _v = _interopRequireDefault(__nccwpck_require__(50771)); +/***/ }), -var _md = _interopRequireDefault(__nccwpck_require__(2026)); +/***/ "./node_modules/core-js/modules/es6.number.parse-float.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.parse-float.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_332378__) { -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var $export = __nested_webpack_require_332378__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $parseFloat = __nested_webpack_require_332378__(/*! ./_parse-float */ "./node_modules/core-js/modules/_parse-float.js"); +// 20.1.2.12 Number.parseFloat(string) +$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); -const v3 = (0, _v.default)('v3', 0x30, _md.default); -var _default = v3; -exports["default"] = _default; /***/ }), -/***/ 50771: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - +/***/ "./node_modules/core-js/modules/es6.number.parse-int.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.parse-int.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_333101__) { -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.URL = exports.DNS = void 0; -exports["default"] = v35; +var $export = __nested_webpack_require_333101__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $parseInt = __nested_webpack_require_333101__(/*! ./_parse-int */ "./node_modules/core-js/modules/_parse-int.js"); +// 20.1.2.13 Number.parseInt(string, radix) +$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); -var _stringify = __nccwpck_require__(64346); -var _parse = _interopRequireDefault(__nccwpck_require__(12798)); +/***/ }), -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/***/ "./node_modules/core-js/modules/es6.number.to-fixed.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.to-fixed.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_333811__) { -function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); // UTF8 escape +"use strict"; - const bytes = []; +var $export = __nested_webpack_require_333811__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toInteger = __nested_webpack_require_333811__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var aNumberValue = __nested_webpack_require_333811__(/*! ./_a-number-value */ "./node_modules/core-js/modules/_a-number-value.js"); +var repeat = __nested_webpack_require_333811__(/*! ./_string-repeat */ "./node_modules/core-js/modules/_string-repeat.js"); +var $toFixed = 1.0.toFixed; +var floor = Math.floor; +var data = [0, 0, 0, 0, 0, 0]; +var ERROR = 'Number.toFixed: incorrect invocation!'; +var ZERO = '0'; - for (let i = 0; i < str.length; ++i) { - bytes.push(str.charCodeAt(i)); +var multiply = function (n, c) { + var i = -1; + var c2 = c; + while (++i < 6) { + c2 += n * data[i]; + data[i] = c2 % 1e7; + c2 = floor(c2 / 1e7); } - - return bytes; -} - -const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; -exports.DNS = DNS; -const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; -exports.URL = URL; - -function v35(name, version, hashfunc) { - function generateUUID(value, namespace, buf, offset) { - var _namespace; - - if (typeof value === 'string') { - value = stringToBytes(value); - } - - if (typeof namespace === 'string') { - namespace = (0, _parse.default)(namespace); +}; +var divide = function (n) { + var i = 6; + var c = 0; + while (--i >= 0) { + c += data[i]; + data[i] = floor(c / n); + c = (c % n) * 1e7; + } +}; +var numToString = function () { + var i = 6; + var s = ''; + while (--i >= 0) { + if (s !== '' || i === 0 || data[i] !== 0) { + var t = String(data[i]); + s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; } + } return s; +}; +var pow = function (x, n, acc) { + return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); +}; +var log = function (x) { + var n = 0; + var x2 = x; + while (x2 >= 4096) { + n += 12; + x2 /= 4096; + } + while (x2 >= 2) { + n += 1; + x2 /= 2; + } return n; +}; - if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _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]; +$export($export.P + $export.F * (!!$toFixed && ( + 0.00008.toFixed(3) !== '0.000' || + 0.9.toFixed(0) !== '1' || + 1.255.toFixed(2) !== '1.25' || + 1000000000000000128.0.toFixed(0) !== '1000000000000000128' +) || !__nested_webpack_require_333811__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + // V8 ~ Android 4.3- + $toFixed.call({}); +})), 'Number', { + toFixed: function toFixed(fractionDigits) { + var x = aNumberValue(this, ERROR); + var f = toInteger(fractionDigits); + var s = ''; + var m = ZERO; + var e, z, j, k; + if (f < 0 || f > 20) throw RangeError(ERROR); + // eslint-disable-next-line no-self-compare + if (x != x) return 'NaN'; + if (x <= -1e21 || x >= 1e21) return String(x); + if (x < 0) { + s = '-'; + x = -x; + } + if (x > 1e-21) { + e = log(x * pow(2, 69, 1)) - 69; + z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); + z *= 0x10000000000000; + e = 52 - e; + if (e > 0) { + multiply(0, z); + j = f; + while (j >= 7) { + multiply(1e7, 0); + j -= 7; + } + multiply(pow(10, j, 1), 0); + j = e - 1; + while (j >= 23) { + divide(1 << 23); + j -= 23; + } + divide(1 << j); + multiply(1, 1); + divide(2); + m = numToString(); + } else { + multiply(0, z); + multiply(1 << -e, 0); + m = numToString() + repeat.call(ZERO, f); } - - return buf; } + if (f > 0) { + k = m.length; + m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); + } else { + m = s + m; + } return m; + } +}); - return (0, _stringify.unsafeStringify)(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; -} /***/ }), -<<<<<<< HEAD -/***/ 48308: -======= -/***/ 2650: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.number.to-precision.js": +/*!*****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.to-precision.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_337285__) { +"use strict"; +var $export = __nested_webpack_require_337285__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $fails = __nested_webpack_require_337285__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var aNumberValue = __nested_webpack_require_337285__(/*! ./_a-number-value */ "./node_modules/core-js/modules/_a-number-value.js"); +var $toPrecision = 1.0.toPrecision; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; +$export($export.P + $export.F * ($fails(function () { + // IE7- + return $toPrecision.call(1, undefined) !== '1'; +}) || !$fails(function () { + // V8 ~ Android 4.3- + $toPrecision.call({}); +})), 'Number', { + toPrecision: function toPrecision(precision) { + var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); + return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); + } +}); -<<<<<<< HEAD -var _native = _interopRequireDefault(__nccwpck_require__(45476)); -======= -var decoder = __nccwpck_require__(92730); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -var _rng = _interopRequireDefault(__nccwpck_require__(7782)); +/***/ }), -var _stringify = __nccwpck_require__(64346); +/***/ "./node_modules/core-js/modules/es6.object.assign.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.assign.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_338445__) { -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +// 19.1.3.1 Object.assign(target, source) +var $export = __nested_webpack_require_338445__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -function v4(options, buf, offset) { - if (_native.default.randomUUID && !buf && !options) { - return _native.default.randomUUID(); - } +$export($export.S + $export.F, 'Object', { assign: __nested_webpack_require_338445__(/*! ./_object-assign */ "./node_modules/core-js/modules/_object-assign.js") }); - options = options || {}; - const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` +/***/ }), +/***/ "./node_modules/core-js/modules/es6.object.create.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.create.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_339092__) { - rnds[6] = rnds[6] & 0x0f | 0x40; - rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided +var $export = __nested_webpack_require_339092__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +$export($export.S, 'Object', { create: __nested_webpack_require_339092__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js") }); - if (buf) { - offset = offset || 0; - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } +/***/ }), - return buf; - } +/***/ "./node_modules/core-js/modules/es6.object.define-properties.js": +/*!**********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.define-properties.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_339783__) { - return (0, _stringify.unsafeStringify)(rnds); -} +var $export = __nested_webpack_require_339783__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) +$export($export.S + $export.F * !__nested_webpack_require_339783__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"), 'Object', { defineProperties: __nested_webpack_require_339783__(/*! ./_object-dps */ "./node_modules/core-js/modules/_object-dps.js") }); -var _default = v4; -exports["default"] = _default; /***/ }), -<<<<<<< HEAD -/***/ 17773: -======= -/***/ 18824: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.object.define-property.js": +/*!********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.define-property.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_340584__) { +var $export = __nested_webpack_require_340584__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) +$export($export.S + $export.F * !__nested_webpack_require_340584__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"), 'Object', { defineProperty: __nested_webpack_require_340584__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f }); -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; +/***/ }), -<<<<<<< HEAD -var _v = _interopRequireDefault(__nccwpck_require__(50771)); -======= -var decoder = __nccwpck_require__(92730); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ "./node_modules/core-js/modules/es6.object.freeze.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.freeze.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_341348__) { -var _sha = _interopRequireDefault(__nccwpck_require__(26860)); +// 19.1.2.5 Object.freeze(O) +var isObject = __nested_webpack_require_341348__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var meta = __nested_webpack_require_341348__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").onFreeze; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +__nested_webpack_require_341348__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('freeze', function ($freeze) { + return function freeze(it) { + return $freeze && isObject(it) ? $freeze(meta(it)) : it; + }; +}); -const v5 = (0, _v.default)('v5', 0x50, _sha.default); -var _default = v5; -exports["default"] = _default; /***/ }), -<<<<<<< HEAD -/***/ 43384: -======= -/***/ 67237: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.object.get-own-property-descriptor.js": +/*!********************************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.get-own-property-descriptor.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_342243__) { +// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) +var toIObject = __nested_webpack_require_342243__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var $getOwnPropertyDescriptor = __nested_webpack_require_342243__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js").f; +__nested_webpack_require_342243__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('getOwnPropertyDescriptor', function () { + return function getOwnPropertyDescriptor(it, key) { + return $getOwnPropertyDescriptor(toIObject(it), key); + }; +}); -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -<<<<<<< HEAD -var _regex = _interopRequireDefault(__nccwpck_require__(14296)); -======= -var fs = __nccwpck_require__(57147); -var util = __nccwpck_require__(73837); -var readerBrowser = __nccwpck_require__(18824); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ }), -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/***/ "./node_modules/core-js/modules/es6.object.get-own-property-names.js": +/*!***************************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.get-own-property-names.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_343201__) { -function validate(uuid) { - return typeof uuid === 'string' && _regex.default.test(uuid); -} +// 19.1.2.7 Object.getOwnPropertyNames(O) +__nested_webpack_require_343201__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('getOwnPropertyNames', function () { + return __nested_webpack_require_343201__(/*! ./_object-gopn-ext */ "./node_modules/core-js/modules/_object-gopn-ext.js").f; +}); -var _default = validate; -exports["default"] = _default; /***/ }), -<<<<<<< HEAD -/***/ 1932: -======= -/***/ 25562: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.object.get-prototype-of.js": +/*!*********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.get-prototype-of.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_343882__) { +// 19.1.2.9 Object.getPrototypeOf(O) +var toObject = __nested_webpack_require_343882__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var $getPrototypeOf = __nested_webpack_require_343882__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +__nested_webpack_require_343882__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('getPrototypeOf', function () { + return function getPrototypeOf(it) { + return $getPrototypeOf(toObject(it)); + }; +}); -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -<<<<<<< HEAD -var _validate = _interopRequireDefault(__nccwpck_require__(43384)); -======= -var cid = __nccwpck_require__(24247); -var encoder = __nccwpck_require__(32454); -var iteratorChannel = __nccwpck_require__(69388); -var decoder = __nccwpck_require__(92730); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ }), -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/***/ "./node_modules/core-js/modules/es6.object.is-extensible.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.is-extensible.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_344733__) { -function version(uuid) { - if (!(0, _validate.default)(uuid)) { - throw TypeError('Invalid UUID'); - } +// 19.1.2.11 Object.isExtensible(O) +var isObject = __nested_webpack_require_344733__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); - return parseInt(uuid.slice(14, 15), 16); -} +__nested_webpack_require_344733__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('isExtensible', function ($isExtensible) { + return function isExtensible(it) { + return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; + }; +}); -var _default = version; -exports["default"] = _default; /***/ }), -<<<<<<< HEAD -/***/ 95018: -======= -/***/ 72902: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ "./node_modules/core-js/modules/es6.object.is-frozen.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.is-frozen.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_345497__) { +// 19.1.2.12 Object.isFrozen(O) +var isObject = __nested_webpack_require_345497__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -Object.defineProperty(exports, "__esModule", ({ value: true })); +__nested_webpack_require_345497__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('isFrozen', function ($isFrozen) { + return function isFrozen(it) { + return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; + }; +}); -var fs = __nccwpck_require__(57147); -var util = __nccwpck_require__(73837); -var writerBrowser = __nccwpck_require__(25562); -var decoder = __nccwpck_require__(92730); -var encoder = __nccwpck_require__(32454); -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +/***/ }), -var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); +/***/ "./node_modules/core-js/modules/es6.object.is-sealed.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.is-sealed.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_346237__) { -const fsread = util.promisify(fs__default["default"].read); -const fswrite = util.promisify(fs__default["default"].write); -class CarWriter extends writerBrowser.CarWriter { - static async updateRootsInFile(fd, roots) { - const chunkSize = 256; - let bytes; - let offset = 0; - let readChunk; - if (typeof fd === 'number') { - readChunk = async () => (await fsread(fd, bytes, 0, chunkSize, offset)).bytesRead; - } else if (typeof fd === 'object' && typeof fd.read === 'function') { - readChunk = async () => (await fd.read(bytes, 0, chunkSize, offset)).bytesRead; - } else { - throw new TypeError('Bad fd'); - } - const fdReader = decoder.chunkReader(async () => { - bytes = new Uint8Array(chunkSize); - const read = await readChunk(); - offset += read; - return read < chunkSize ? bytes.subarray(0, read) : bytes; - }); - await decoder.readHeader(fdReader); - const newHeader = encoder.createHeader(roots); - if (fdReader.pos !== newHeader.length) { - 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)`); - } - if (typeof fd === 'number') { - await fswrite(fd, newHeader, 0, newHeader.length, 0); - } else if (typeof fd === 'object' && typeof fd.read === 'function') { - await fd.write(newHeader, 0, newHeader.length, 0); - } - } -} -const __browser = false; +// 19.1.2.13 Object.isSealed(O) +var isObject = __nested_webpack_require_346237__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -exports.CarWriter = CarWriter; -exports.__browser = __browser; +__nested_webpack_require_346237__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('isSealed', function ($isSealed) { + return function isSealed(it) { + return isObject(it) ? $isSealed ? $isSealed(it) : false : true; + }; +}); /***/ }), -/***/ 54346: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { +/***/ "./node_modules/core-js/modules/es6.object.is.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.is.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_346949__) { -module.exports = read +// 19.1.3.10 Object.is(value1, value2) +var $export = __nested_webpack_require_346949__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +$export($export.S, 'Object', { is: __nested_webpack_require_346949__(/*! ./_same-value */ "./node_modules/core-js/modules/_same-value.js") }); -var MSB = 0x80 - , REST = 0x7F -function read(buf, offset) { - var res = 0 - , offset = offset || 0 - , shift = 0 - , counter = offset - , b - , l = buf.length +/***/ }), - do { - if (counter >= l || shift > 49) { - read.bytes = 0 - throw new RangeError('Could not decode varint') - } - b = buf[counter++] - res += shift < 28 - ? (b & REST) << shift - : (b & REST) * Math.pow(2, shift) - shift += 7 - } while (b >= MSB) +/***/ "./node_modules/core-js/modules/es6.object.keys.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.keys.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_347562__) { - read.bytes = counter - offset +// 19.1.2.14 Object.keys(O) +var toObject = __nested_webpack_require_347562__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var $keys = __nested_webpack_require_347562__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); - return res -} +__nested_webpack_require_347562__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('keys', function () { + return function keys(it) { + return $keys(toObject(it)); + }; +}); /***/ }), -<<<<<<< HEAD -/***/ 51732: -======= -/***/ 86526: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - -module.exports = encode - -var MSB = 0x80 - , REST = 0x7F - , MSBALL = ~REST - , INT = Math.pow(2, 31) +/***/ "./node_modules/core-js/modules/es6.object.prevent-extensions.js": +/*!***********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.prevent-extensions.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_348386__) { -function encode(num, out, offset) { - if (Number.MAX_SAFE_INTEGER && num > Number.MAX_SAFE_INTEGER) { - encode.bytes = 0 - throw new RangeError('Could not encode varint') - } - out = out || [] - offset = offset || 0 - var oldOffset = offset +// 19.1.2.15 Object.preventExtensions(O) +var isObject = __nested_webpack_require_348386__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var meta = __nested_webpack_require_348386__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").onFreeze; - while(num >= INT) { - out[offset++] = (num & 0xFF) | MSB - num /= 128 - } - while(num & MSBALL) { - out[offset++] = (num & 0xFF) | MSB - num >>>= 7 - } - out[offset] = num | 0 - - encode.bytes = offset - oldOffset + 1 - - return out -} +__nested_webpack_require_348386__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('preventExtensions', function ($preventExtensions) { + return function preventExtensions(it) { + return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; + }; +}); /***/ }), -<<<<<<< HEAD -/***/ 59800: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.object.seal.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.seal.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_349256__) { -module.exports = { - encode: __nccwpck_require__(51732) - , decode: __nccwpck_require__(95018) - , encodingLength: __nccwpck_require__(75026) -======= -/***/ 75739: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +// 19.1.2.17 Object.seal(O) +var isObject = __nested_webpack_require_349256__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var meta = __nested_webpack_require_349256__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").onFreeze; -module.exports = { - encode: __nccwpck_require__(86526) - , decode: __nccwpck_require__(54346) - , encodingLength: __nccwpck_require__(22651) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -} +__nested_webpack_require_349256__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('seal', function ($seal) { + return function seal(it) { + return $seal && isObject(it) ? $seal(meta(it)) : it; + }; +}); /***/ }), -<<<<<<< HEAD -/***/ 75026: -======= -/***/ 22651: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - - -var N1 = Math.pow(2, 7) -var N2 = Math.pow(2, 14) -var N3 = Math.pow(2, 21) -var N4 = Math.pow(2, 28) -var N5 = Math.pow(2, 35) -var N6 = Math.pow(2, 42) -var N7 = Math.pow(2, 49) -var N8 = Math.pow(2, 56) -var N9 = Math.pow(2, 63) +/***/ "./node_modules/core-js/modules/es6.object.set-prototype-of.js": +/*!*********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.set-prototype-of.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_350096__) { -module.exports = function (value) { - 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 - ) -} +// 19.1.3.19 Object.setPrototypeOf(O, proto) +var $export = __nested_webpack_require_350096__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +$export($export.S, 'Object', { setPrototypeOf: __nested_webpack_require_350096__(/*! ./_set-proto */ "./node_modules/core-js/modules/_set-proto.js").set }); /***/ }), -<<<<<<< HEAD -/***/ 74405: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -======= -/***/ 89778: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ "./node_modules/core-js/modules/es6.object.to-string.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.to-string.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_350749__) { -var balanced = __nccwpck_require__(99171); +"use strict"; -module.exports = expandTop; +// 19.1.3.6 Object.prototype.toString() +var classof = __nested_webpack_require_350749__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); +var test = {}; +test[__nested_webpack_require_350749__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('toStringTag')] = 'z'; +if (test + '' != '[object z]') { + __nested_webpack_require_350749__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js")(Object.prototype, 'toString', function toString() { + return '[object ' + classof(this) + ']'; + }, true); +} -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; -<<<<<<< HEAD -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} +/***/ }), -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} +/***/ "./node_modules/core-js/modules/es6.parse-float.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.parse-float.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_351602__) { -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -======= -var cborg = __nccwpck_require__(12085); -var cid = __nccwpck_require__(24247); +var $export = __nested_webpack_require_351602__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $parseFloat = __nested_webpack_require_351602__(/*! ./_parse-float */ "./node_modules/core-js/modules/_parse-float.js"); +// 18.2.4 parseFloat(string) +$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); -function _interopNamespace(e) { - if (e && e.__esModule) return e; - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n["default"] = e; - return Object.freeze(n); -} -var cborg__namespace = /*#__PURE__*/_interopNamespace(cborg); +/***/ }), -const CID_CBOR_TAG = 42; -function cidEncoder(obj) { - if (obj.asCID !== obj) { - return null; - } - const cid$1 = cid.CID.asCID(obj); - if (!cid$1) { - return null; - } - const bytes = new Uint8Array(cid$1.bytes.byteLength + 1); - bytes.set(cid$1.bytes, 1); - return [ - new cborg__namespace.Token(cborg__namespace.Type.tag, CID_CBOR_TAG), - new cborg__namespace.Token(cborg__namespace.Type.bytes, bytes) - ]; -} -function undefinedEncoder() { - throw new Error('`undefined` is not supported by the IPLD Data Model and cannot be encoded'); -} -function numberEncoder(num) { - if (Number.isNaN(num)) { - throw new Error('`NaN` is not supported by the IPLD Data Model and cannot be encoded'); - } - if (num === Infinity || num === -Infinity) { - throw new Error('`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded'); - } - return null; -} -const encodeOptions = { - float64: true, - typeEncoders: { - Object: cidEncoder, - undefined: undefinedEncoder, - number: numberEncoder - } -}; -function cidDecoder(bytes) { - if (bytes[0] !== 0) { - throw new Error('Invalid CID for CBOR tag 42; expected leading 0x00'); - } - return cid.CID.decode(bytes.subarray(1)); -} -const decodeOptions = { - allowIndefinite: false, - coerceUndefinedToNull: true, - allowNaN: false, - allowInfinity: false, - allowBigInt: true, - strict: true, - useMaps: false, - tags: [] -}; -decodeOptions.tags[CID_CBOR_TAG] = cidDecoder; -const name = 'dag-cbor'; -const code = 113; -const encode = node => cborg__namespace.encode(node, encodeOptions); -const decode = data => cborg__namespace.decode(data, decodeOptions); +/***/ "./node_modules/core-js/modules/es6.parse-int.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.parse-int.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_352270__) { -exports.code = code; -exports.decode = decode; -exports.encode = encode; -exports.name = name; +var $export = __nested_webpack_require_352270__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $parseInt = __nested_webpack_require_352270__(/*! ./_parse-int */ "./node_modules/core-js/modules/_parse-int.js"); +// 18.2.5 parseInt(string, radix) +$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); /***/ }), -/***/ 46777: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.promise.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/es6.promise.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_352921__) { "use strict"; +var LIBRARY = __nested_webpack_require_352921__(/*! ./_library */ "./node_modules/core-js/modules/_library.js"); +var global = __nested_webpack_require_352921__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var ctx = __nested_webpack_require_352921__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var classof = __nested_webpack_require_352921__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); +var $export = __nested_webpack_require_352921__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var isObject = __nested_webpack_require_352921__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var aFunction = __nested_webpack_require_352921__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var anInstance = __nested_webpack_require_352921__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); +var forOf = __nested_webpack_require_352921__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); +var speciesConstructor = __nested_webpack_require_352921__(/*! ./_species-constructor */ "./node_modules/core-js/modules/_species-constructor.js"); +var task = __nested_webpack_require_352921__(/*! ./_task */ "./node_modules/core-js/modules/_task.js").set; +var microtask = __nested_webpack_require_352921__(/*! ./_microtask */ "./node_modules/core-js/modules/_microtask.js")(); +var newPromiseCapabilityModule = __nested_webpack_require_352921__(/*! ./_new-promise-capability */ "./node_modules/core-js/modules/_new-promise-capability.js"); +var perform = __nested_webpack_require_352921__(/*! ./_perform */ "./node_modules/core-js/modules/_perform.js"); +var userAgent = __nested_webpack_require_352921__(/*! ./_user-agent */ "./node_modules/core-js/modules/_user-agent.js"); +var promiseResolve = __nested_webpack_require_352921__(/*! ./_promise-resolve */ "./node_modules/core-js/modules/_promise-resolve.js"); +var PROMISE = 'Promise'; +var TypeError = global.TypeError; +var process = global.process; +var versions = process && process.versions; +var v8 = versions && versions.v8 || ''; +var $Promise = global[PROMISE]; +var isNode = classof(process) == 'process'; +var empty = function () { /* empty */ }; +var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; +var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var multiformats = __nccwpck_require__(27331); -var base64 = __nccwpck_require__(98197); -var cborg = __nccwpck_require__(12085); -var cborgJson = __nccwpck_require__(81342); - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n["default"] = e; - return Object.freeze(n); -} - -var cborgJson__namespace = /*#__PURE__*/_interopNamespace(cborgJson); +var USE_NATIVE = !!function () { + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1); + var FakePromise = (promise.constructor = {})[__nested_webpack_require_352921__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('species')] = function (exec) { + exec(empty, empty); + }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') + && promise.then(empty) instanceof FakePromise + // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables + // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 + // we can't detect it synchronously, so just check versions + && v8.indexOf('6.6') !== 0 + && userAgent.indexOf('Chrome/66') === -1; + } catch (e) { /* empty */ } +}(); -function cidEncoder(obj) { - if (obj.asCID !== obj) { - return null; - } - const cid = multiformats.CID.asCID(obj); - if (!cid) { - return null; - } - const cidString = cid.toString(); - return [ - new cborg.Token(cborg.Type.map, Infinity, 1), - new cborg.Token(cborg.Type.string, '/', 1), - new cborg.Token(cborg.Type.string, cidString, cidString.length), - new cborg.Token(cborg.Type.break, undefined, 1) - ]; -} -function bytesEncoder(bytes) { - const bytesString = base64.base64.encode(bytes).slice(1); - return [ - new cborg.Token(cborg.Type.map, Infinity, 1), - new cborg.Token(cborg.Type.string, '/', 1), - new cborg.Token(cborg.Type.map, Infinity, 1), - new cborg.Token(cborg.Type.string, 'bytes', 5), - new cborg.Token(cborg.Type.string, bytesString, bytesString.length), - new cborg.Token(cborg.Type.break, undefined, 1), - new cborg.Token(cborg.Type.break, undefined, 1) - ]; -} -function undefinedEncoder() { - throw new Error('`undefined` is not supported by the IPLD Data Model and cannot be encoded'); -} -function numberEncoder(num) { - if (Number.isNaN(num)) { - throw new Error('`NaN` is not supported by the IPLD Data Model and cannot be encoded'); - } - if (num === Infinity || num === -Infinity) { - throw new Error('`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded'); - } - return null; -} -const encodeOptions = { - typeEncoders: { - Object: cidEncoder, - Uint8Array: bytesEncoder, - Buffer: bytesEncoder, - undefined: undefinedEncoder, - number: numberEncoder - } +// helpers +var isThenable = function (it) { + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; }; -class DagJsonTokenizer extends cborgJson__namespace.Tokenizer { - constructor(data, options) { - super(data, options); - this.tokenBuffer = []; - } - done() { - return this.tokenBuffer.length === 0 && super.done(); - } - _next() { - if (this.tokenBuffer.length > 0) { - return this.tokenBuffer.pop(); - } - return super.next(); - } - next() { - const token = this._next(); - if (token.type === cborg.Type.map) { - const keyToken = this._next(); - if (keyToken.type === cborg.Type.string && keyToken.value === '/') { - const valueToken = this._next(); - if (valueToken.type === cborg.Type.string) { - const breakToken = this._next(); - if (breakToken.type !== cborg.Type.break) { - throw new Error('Invalid encoded CID form'); +var notify = function (promise, isReject) { + if (promise._n) return; + promise._n = true; + var chain = promise._c; + microtask(function () { + var value = promise._v; + var ok = promise._s == 1; + var i = 0; + var run = function (reaction) { + var handler = ok ? reaction.ok : reaction.fail; + var resolve = reaction.resolve; + var reject = reaction.reject; + var domain = reaction.domain; + var result, then, exited; + try { + if (handler) { + if (!ok) { + if (promise._h == 2) onHandleUnhandled(promise); + promise._h = 1; } - this.tokenBuffer.push(valueToken); - return new cborg.Token(cborg.Type.tag, 42, 0); - } - if (valueToken.type === cborg.Type.map) { - const innerKeyToken = this._next(); - if (innerKeyToken.type === cborg.Type.string && innerKeyToken.value === 'bytes') { - const innerValueToken = this._next(); - if (innerValueToken.type === cborg.Type.string) { - for (let i = 0; i < 2; i++) { - const breakToken = this._next(); - if (breakToken.type !== cborg.Type.break) { - throw new Error('Invalid encoded Bytes form'); - } - } - const bytes = base64.base64.decode(`m${ innerValueToken.value }`); - return new cborg.Token(cborg.Type.bytes, bytes, innerValueToken.value.length); + if (handler === true) result = value; + else { + if (domain) domain.enter(); + result = handler(value); // may throw + if (domain) { + domain.exit(); + exited = true; } - this.tokenBuffer.push(innerValueToken); } - this.tokenBuffer.push(innerKeyToken); - } - this.tokenBuffer.push(valueToken); + if (result === reaction.promise) { + reject(TypeError('Promise-chain cycle')); + } else if (then = isThenable(result)) { + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch (e) { + if (domain && !exited) domain.exit(); + reject(e); } - this.tokenBuffer.push(keyToken); + }; + while (chain.length > i) run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if (isReject && !promise._h) onUnhandled(promise); + }); +}; +var onUnhandled = function (promise) { + task.call(global, function () { + var value = promise._v; + var unhandled = isUnhandled(promise); + var result, handler, console; + if (unhandled) { + result = perform(function () { + if (isNode) { + process.emit('unhandledRejection', value, promise); + } else if (handler = global.onunhandledrejection) { + handler({ promise: promise, reason: value }); + } else if ((console = global.console) && console.error) { + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if (unhandled && result.e) throw result.v; + }); +}; +var isUnhandled = function (promise) { + return promise._h !== 1 && (promise._a || promise._c).length === 0; +}; +var onHandleUnhandled = function (promise) { + task.call(global, function () { + var handler; + if (isNode) { + process.emit('rejectionHandled', promise); + } else if (handler = global.onrejectionhandled) { + handler({ promise: promise, reason: promise._v }); } - return token; - } -} -const decodeOptions = { - allowIndefinite: false, - allowUndefined: false, - allowNaN: false, - allowInfinity: false, - allowBigInt: true, - strict: true, - useMaps: false, - tags: [] + }); }; -decodeOptions.tags[42] = multiformats.CID.parse; -const name = 'dag-json'; -const code = 297; -const encode = node => cborgJson__namespace.encode(node, encodeOptions); -const decode = data => { - const options = Object.assign(decodeOptions, { tokenizer: new DagJsonTokenizer(data, decodeOptions) }); - return cborgJson__namespace.decode(data, options); +var $reject = function (value) { + var promise = this; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if (!promise._a) promise._a = promise._c.slice(); + notify(promise, true); +}; +var $resolve = function (value) { + var promise = this; + var then; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if (promise === value) throw TypeError("Promise can't be resolved itself"); + if (then = isThenable(value)) { + microtask(function () { + var wrapper = { _w: promise, _d: false }; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch (e) { + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch (e) { + $reject.call({ _w: promise, _d: false }, e); // wrap + } }; -exports.code = code; -exports.decode = decode; -exports.encode = encode; -exports.name = name; - - -/***/ }), - -/***/ 72532: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); +// constructor polyfill +if (!USE_NATIVE) { + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor) { + anInstance(this, $Promise, PROMISE, '_h'); + aFunction(executor); + Internal.call(this); + try { + executor(ctx($resolve, this, 1), ctx($reject, this, 1)); + } catch (err) { + $reject.call(this, err); + } + }; + // eslint-disable-next-line no-unused-vars + Internal = function Promise(executor) { + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = __nested_webpack_require_352921__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js")($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected) { + var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process.domain : undefined; + this._c.push(reaction); + if (this._a) this._a.push(reaction); + if (this._s) notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function (onRejected) { + return this.then(undefined, onRejected); + } + }); + OwnPromiseCapability = function () { + var promise = new Internal(); + this.promise = promise; + this.resolve = ctx($resolve, promise, 1); + this.reject = ctx($reject, promise, 1); + }; + newPromiseCapabilityModule.f = newPromiseCapability = function (C) { + return C === $Promise || C === Wrapper + ? new OwnPromiseCapability(C) + : newGenericPromiseCapability(C); + }; +} -var cid = __nccwpck_require__(24247); -var pbDecode = __nccwpck_require__(80021); -var pbEncode = __nccwpck_require__(30982); -var util = __nccwpck_require__(54690); +$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); +__nested_webpack_require_352921__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js")($Promise, PROMISE); +__nested_webpack_require_352921__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js")(PROMISE); +Wrapper = __nested_webpack_require_352921__(/*! ./_core */ "./node_modules/core-js/modules/_core.js")[PROMISE]; -const name = 'dag-pb'; -const code = 112; -function encode(node) { - util.validate(node); - const pbn = {}; - if (node.Links) { - pbn.Links = node.Links.map(l => { - const link = {}; - if (l.Hash) { - link.Hash = l.Hash.bytes; - } - if (l.Name !== undefined) { - link.Name = l.Name; - } - if (l.Tsize !== undefined) { - link.Tsize = l.Tsize; - } - return link; - }); - } - if (node.Data) { - pbn.Data = node.Data; +// statics +$export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r) { + var capability = newPromiseCapability(this); + var $$reject = capability.reject; + $$reject(r); + return capability.promise; } - return pbEncode.encodeNode(pbn); -} -function decode(bytes) { - const pbn = pbDecode.decodeNode(bytes); - const node = {}; - if (pbn.Data) { - node.Data = pbn.Data; +}); +$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x) { + return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); } - if (pbn.Links) { - node.Links = pbn.Links.map(l => { - const link = {}; - try { - link.Hash = cid.CID.decode(l.Hash); - } catch (e) { - } - if (!link.Hash) { - throw new Error('Invalid Hash field found in link, expected CID'); - } - if (l.Name !== undefined) { - link.Name = l.Name; - } - if (l.Tsize !== undefined) { - link.Tsize = l.Tsize; - } - return link; +}); +$export($export.S + $export.F * !(USE_NATIVE && __nested_webpack_require_352921__(/*! ./_iter-detect */ "./node_modules/core-js/modules/_iter-detect.js")(function (iter) { + $Promise.all(iter)['catch'](empty); +})), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = perform(function () { + var values = []; + var index = 0; + var remaining = 1; + forOf(iterable, false, function (promise) { + var $index = index++; + var alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if (result.e) reject(result.v); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var reject = capability.reject; + var result = perform(function () { + forOf(iterable, false, function (promise) { + C.resolve(promise).then(capability.resolve, reject); + }); }); + if (result.e) reject(result.v); + return capability.promise; } - return node; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -} +}); -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; +/***/ }), - var parts = []; - var m = balanced('{', '}', str); +/***/ "./node_modules/core-js/modules/es6.reflect.apply.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.apply.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_364509__) { -<<<<<<< HEAD - if (!m) - return str.split(','); -======= -/***/ 80021: -/***/ ((__unused_webpack_module, exports) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +// 26.1.1 Reflect.apply(target, thisArgument, argumentsList) +var $export = __nested_webpack_require_364509__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var aFunction = __nested_webpack_require_364509__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var anObject = __nested_webpack_require_364509__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var rApply = (__nested_webpack_require_364509__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").Reflect || {}).apply; +var fApply = Function.apply; +// MS Edge argumentsList argument is optional +$export($export.S + $export.F * !__nested_webpack_require_364509__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + rApply(function () { /* empty */ }); +}), 'Reflect', { + apply: function apply(target, thisArgument, argumentsList) { + var T = aFunction(target); + var L = anObject(argumentsList); + return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); + } +}); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.construct.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.construct.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_365847__) { + +// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) +var $export = __nested_webpack_require_365847__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var create = __nested_webpack_require_365847__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js"); +var aFunction = __nested_webpack_require_365847__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var anObject = __nested_webpack_require_365847__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var isObject = __nested_webpack_require_365847__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var fails = __nested_webpack_require_365847__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var bind = __nested_webpack_require_365847__(/*! ./_bind */ "./node_modules/core-js/modules/_bind.js"); +var rConstruct = (__nested_webpack_require_365847__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").Reflect || {}).construct; + +// MS Edge supports only 2 arguments and argumentsList argument is optional +// FF Nightly sets third argument as `new.target`, but does not create `this` from it +var NEW_TARGET_BUG = fails(function () { + function F() { /* empty */ } + return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); +}); +var ARGS_BUG = !fails(function () { + rConstruct(function () { /* empty */ }); +}); + +$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { + construct: function construct(Target, args /* , newTarget */) { + aFunction(Target); + anObject(args); + var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); + if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); + if (Target == newTarget) { + // w/o altered newTarget, optimization for 0-4 arguments + switch (args.length) { + case 0: return new Target(); + case 1: return new Target(args[0]); + case 2: return new Target(args[0], args[1]); + case 3: return new Target(args[0], args[1], args[2]); + case 4: return new Target(args[0], args[1], args[2], args[3]); + } + // w/o altered newTarget, lot of arguments case + var $args = [null]; + $args.push.apply($args, args); + return new (bind.apply(Target, $args))(); + } + // with altered newTarget, not support built-in constructors + var proto = newTarget.prototype; + var instance = create(isObject(proto) ? proto : Object.prototype); + var result = Function.apply.call(Target, instance, args); + return isObject(result) ? result : instance; } +}); - parts.push.apply(parts, p); - return parts; -} +/***/ }), -function expandTop(str) { - if (!str) - return []; +/***/ "./node_modules/core-js/modules/es6.reflect.define-property.js": +/*!*********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.define-property.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_368738__) { + +// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) +var dP = __nested_webpack_require_368738__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); +var $export = __nested_webpack_require_368738__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var anObject = __nested_webpack_require_368738__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var toPrimitive = __nested_webpack_require_368738__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); + +// MS Edge has broken Reflect.defineProperty - throwing instead of returning false +$export($export.S + $export.F * __nested_webpack_require_368738__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + // eslint-disable-next-line no-undef + Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); +}), 'Reflect', { + defineProperty: function defineProperty(target, propertyKey, attributes) { + anObject(target); + propertyKey = toPrimitive(propertyKey, true); + anObject(attributes); + try { + dP.f(target, propertyKey, attributes); + return true; + } catch (e) { + return false; + } + } +}); -<<<<<<< HEAD - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); -======= /***/ }), -/***/ 30982: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/es6.reflect.delete-property.js": +/*!*********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.delete-property.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_370249__) { + +// 26.1.4 Reflect.deleteProperty(target, propertyKey) +var $export = __nested_webpack_require_370249__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var gOPD = __nested_webpack_require_370249__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js").f; +var anObject = __nested_webpack_require_370249__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); + +$export($export.S, 'Reflect', { + deleteProperty: function deleteProperty(target, propertyKey) { + var desc = gOPD(anObject(target), propertyKey); + return desc && !desc.configurable ? false : delete target[propertyKey]; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.enumerate.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.enumerate.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_371216__) { "use strict"; +// 26.1.5 Reflect.enumerate(target) +var $export = __nested_webpack_require_371216__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var anObject = __nested_webpack_require_371216__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var Enumerate = function (iterated) { + this._t = anObject(iterated); // target + this._i = 0; // next index + var keys = this._k = []; // keys + var key; + for (key in iterated) keys.push(key); +}; +__nested_webpack_require_371216__(/*! ./_iter-create */ "./node_modules/core-js/modules/_iter-create.js")(Enumerate, 'Object', function () { + var that = this; + var keys = that._k; + var key; + do { + if (that._i >= keys.length) return { value: undefined, done: true }; + } while (!((key = keys[that._i++]) in that._t)); + return { value: key, done: false }; +}); -Object.defineProperty(exports, "__esModule", ({ value: true })); +$export($export.S, 'Reflect', { + enumerate: function enumerate(target) { + return new Enumerate(target); + } +}); -const textEncoder = new TextEncoder(); -const maxInt32 = 2 ** 32; -const maxUInt32 = 2 ** 31; -function encodeLink(link, bytes) { - let i = bytes.length; - if (typeof link.Tsize === 'number') { - if (link.Tsize < 0) { - throw new Error('Tsize cannot be negative'); - } - if (!Number.isSafeInteger(link.Tsize)) { - throw new Error('Tsize too large for encoding'); - } - i = encodeVarint(bytes, i, link.Tsize) - 1; - bytes[i] = 24; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_372601__) { + +// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) +var gOPD = __nested_webpack_require_372601__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js"); +var $export = __nested_webpack_require_372601__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var anObject = __nested_webpack_require_372601__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); + +$export($export.S, 'Reflect', { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { + return gOPD.f(anObject(target), propertyKey); } +}); - return expand(escapeBraces(str), true).map(unescapeBraces); + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.get-prototype-of.js": +/*!**********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.get-prototype-of.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_373546__) { + +// 26.1.8 Reflect.getPrototypeOf(target) +var $export = __nested_webpack_require_373546__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var getProto = __nested_webpack_require_373546__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var anObject = __nested_webpack_require_373546__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); + +$export($export.S, 'Reflect', { + getPrototypeOf: function getPrototypeOf(target) { + return getProto(anObject(target)); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.get.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.get.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_374374__) { + +// 26.1.6 Reflect.get(target, propertyKey [, receiver]) +var gOPD = __nested_webpack_require_374374__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js"); +var getPrototypeOf = __nested_webpack_require_374374__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var has = __nested_webpack_require_374374__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var $export = __nested_webpack_require_374374__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var isObject = __nested_webpack_require_374374__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var anObject = __nested_webpack_require_374374__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); + +function get(target, propertyKey /* , receiver */) { + var receiver = arguments.length < 3 ? target : arguments[2]; + var desc, proto; + if (anObject(target) === receiver) return target[propertyKey]; + if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') + ? desc.value + : desc.get !== undefined + ? desc.get.call(receiver) + : undefined; + if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); } -<<<<<<< HEAD -function embrace(str) { - return '{' + str + '}'; -======= -exports.encodeNode = encodeNode; +$export($export.S, 'Reflect', { get: get }); /***/ }), -/***/ 54690: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.reflect.has.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.has.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_375890__) { -"use strict"; +// 26.1.9 Reflect.has(target, propertyKey) +var $export = __nested_webpack_require_375890__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +$export($export.S, 'Reflect', { + has: function has(target, propertyKey) { + return propertyKey in target; + } +}); -Object.defineProperty(exports, "__esModule", ({ value: true })); -var cid = __nccwpck_require__(24247); +/***/ }), -const pbNodeProperties = [ - 'Data', - 'Links' -]; -const pbLinkProperties = [ - 'Hash', - 'Name', - 'Tsize' -]; -const textEncoder = new TextEncoder(); -function linkComparator(a, b) { - if (a === b) { - return 0; +/***/ "./node_modules/core-js/modules/es6.reflect.is-extensible.js": +/*!*******************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.is-extensible.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_376536__) { + +// 26.1.10 Reflect.isExtensible(target) +var $export = __nested_webpack_require_376536__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var anObject = __nested_webpack_require_376536__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var $isExtensible = Object.isExtensible; + +$export($export.S, 'Reflect', { + isExtensible: function isExtensible(target) { + anObject(target); + return $isExtensible ? $isExtensible(target) : true; } - const abuf = a.Name ? textEncoder.encode(a.Name) : []; - const bbuf = b.Name ? textEncoder.encode(b.Name) : []; - let x = abuf.length; - let y = bbuf.length; - for (let i = 0, len = Math.min(x, y); i < len; ++i) { - if (abuf[i] !== bbuf[i]) { - x = abuf[i]; - y = bbuf[i]; - break; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.own-keys.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.own-keys.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_377354__) { + +// 26.1.11 Reflect.ownKeys(target) +var $export = __nested_webpack_require_377354__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Reflect', { ownKeys: __nested_webpack_require_377354__(/*! ./_own-keys */ "./node_modules/core-js/modules/_own-keys.js") }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.prevent-extensions.js": +/*!************************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.prevent-extensions.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_378026__) { + +// 26.1.12 Reflect.preventExtensions(target) +var $export = __nested_webpack_require_378026__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var anObject = __nested_webpack_require_378026__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var $preventExtensions = Object.preventExtensions; + +$export($export.S, 'Reflect', { + preventExtensions: function preventExtensions(target) { + anObject(target); + try { + if ($preventExtensions) $preventExtensions(target); + return true; + } catch (e) { + return false; } } - return x < y ? -1 : y < x ? 1 : 0; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -} -function isPadded(el) { - return /^-?0\d/.test(el); -} +}); -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} -function expand(str, isTop) { - var expansions = []; +/***/ }), - var m = balanced('{', '}', str); - if (!m) return [str]; +/***/ "./node_modules/core-js/modules/es6.reflect.set-prototype-of.js": +/*!**********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.set-prototype-of.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_378975__) { - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; +// 26.1.14 Reflect.setPrototypeOf(target, proto) +var $export = __nested_webpack_require_378975__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var setProto = __nested_webpack_require_378975__(/*! ./_set-proto */ "./node_modules/core-js/modules/_set-proto.js"); - if (/\$$/.test(m.pre)) { - for (var k = 0; k < post.length; k++) { - var expansion = pre+ '{' + m.body + '}' + post[k]; - expansions.push(expansion); +if (setProto) $export($export.S, 'Reflect', { + setPrototypeOf: function setPrototypeOf(target, proto) { + setProto.check(target, proto); + try { + setProto.set(target, proto); + return true; + } catch (e) { + return false; } - } else { - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.set.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.set.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_379830__) { + +// 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) +var dP = __nested_webpack_require_379830__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); +var gOPD = __nested_webpack_require_379830__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js"); +var getPrototypeOf = __nested_webpack_require_379830__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var has = __nested_webpack_require_379830__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var $export = __nested_webpack_require_379830__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var createDesc = __nested_webpack_require_379830__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); +var anObject = __nested_webpack_require_379830__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var isObject = __nested_webpack_require_379830__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); + +function set(target, propertyKey, V /* , receiver */) { + var receiver = arguments.length < 4 ? target : arguments[3]; + var ownDesc = gOPD.f(anObject(target), propertyKey); + var existingDescriptor, proto; + if (!ownDesc) { + if (isObject(proto = getPrototypeOf(target))) { + return set(proto, propertyKey, V, receiver); } + ownDesc = createDesc(0); + } + if (has(ownDesc, 'value')) { + if (ownDesc.writable === false || !isObject(receiver)) return false; + if (existingDescriptor = gOPD.f(receiver, propertyKey)) { + if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; + existingDescriptor.value = V; + dP.f(receiver, propertyKey, existingDescriptor); + } else dP.f(receiver, propertyKey, createDesc(0, V)); + return true; + } + return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); +} - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } +$export($export.S, 'Reflect', { set: set }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.regexp.constructor.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.constructor.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_382037__) { + +var global = __nested_webpack_require_382037__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var inheritIfRequired = __nested_webpack_require_382037__(/*! ./_inherit-if-required */ "./node_modules/core-js/modules/_inherit-if-required.js"); +var dP = __nested_webpack_require_382037__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +var gOPN = __nested_webpack_require_382037__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f; +var isRegExp = __nested_webpack_require_382037__(/*! ./_is-regexp */ "./node_modules/core-js/modules/_is-regexp.js"); +var $flags = __nested_webpack_require_382037__(/*! ./_flags */ "./node_modules/core-js/modules/_flags.js"); +var $RegExp = global.RegExp; +var Base = $RegExp; +var proto = $RegExp.prototype; +var re1 = /a/g; +var re2 = /a/g; +// "new" creates a new object, old webkit buggy here +var CORRECT_NEW = new $RegExp(re1) !== re1; + +if (__nested_webpack_require_382037__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && (!CORRECT_NEW || __nested_webpack_require_382037__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + re2[__nested_webpack_require_382037__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('match')] = false; + // RegExp constructor can alter flags and IsRegExp works correct with @@match + return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; +}))) { + $RegExp = function RegExp(p, f) { + var tiRE = this instanceof $RegExp; + var piRE = isRegExp(p); + var fiU = f === undefined; + return !tiRE && piRE && p.constructor === $RegExp && fiU ? p + : inheritIfRequired(CORRECT_NEW + ? new Base(piRE && !fiU ? p.source : p, f) + : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) + , tiRE ? this : proto, $RegExp); + }; + var proxy = function (key) { + key in $RegExp || dP($RegExp, key, { + configurable: true, + get: function () { return Base[key]; }, + set: function (it) { Base[key] = it; } + }); + }; + for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]); + proto.constructor = $RegExp; + $RegExp.prototype = proto; + __nested_webpack_require_382037__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js")(global, 'RegExp', $RegExp); +} + +__nested_webpack_require_382037__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js")('RegExp'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.regexp.exec.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.exec.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_384695__) { + +"use strict"; + +var regexpExec = __nested_webpack_require_384695__(/*! ./_regexp-exec */ "./node_modules/core-js/modules/_regexp-exec.js"); +__nested_webpack_require_384695__(/*! ./_export */ "./node_modules/core-js/modules/_export.js")({ + target: 'RegExp', + proto: true, + forced: regexpExec !== /./.exec +}, { + exec: regexpExec +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.regexp.flags.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.flags.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_385353__) { + +// 21.2.5.3 get RegExp.prototype.flags() +if (__nested_webpack_require_385353__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && /./g.flags != 'g') __nested_webpack_require_385353__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f(RegExp.prototype, 'flags', { + configurable: true, + get: __nested_webpack_require_385353__(/*! ./_flags */ "./node_modules/core-js/modules/_flags.js") +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.regexp.match.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.match.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_386096__) { + +"use strict"; + + +var anObject = __nested_webpack_require_386096__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var toLength = __nested_webpack_require_386096__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var advanceStringIndex = __nested_webpack_require_386096__(/*! ./_advance-string-index */ "./node_modules/core-js/modules/_advance-string-index.js"); +var regExpExec = __nested_webpack_require_386096__(/*! ./_regexp-exec-abstract */ "./node_modules/core-js/modules/_regexp-exec-abstract.js"); + +// @@match logic +__nested_webpack_require_386096__(/*! ./_fix-re-wks */ "./node_modules/core-js/modules/_fix-re-wks.js")('match', 1, function (defined, MATCH, $match, maybeCallNative) { + return [ + // `String.prototype.match` method + // https://tc39.github.io/ecma262/#sec-string.prototype.match + function match(regexp) { + var O = defined(this); + var fn = regexp == undefined ? undefined : regexp[MATCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); + }, + // `RegExp.prototype[@@match]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match + function (regexp) { + var res = maybeCallNative($match, regexp, this); + if (res.done) return res.value; + var rx = anObject(regexp); + var S = String(this); + if (!rx.global) return regExpExec(rx, S); + var fullUnicode = rx.unicode; + rx.lastIndex = 0; + var A = []; + var n = 0; + var result; + while ((result = regExpExec(rx, S)) !== null) { + var matchStr = String(result[0]); + A[n] = matchStr; + if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); + n++; } + return n === 0 ? null : A; } + ]; +}); - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - var N; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); +/***/ }), - N = []; +/***/ "./node_modules/core-js/modules/es6.regexp.replace.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.replace.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_388196__) { - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; +"use strict"; + + +var anObject = __nested_webpack_require_388196__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var toObject = __nested_webpack_require_388196__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toLength = __nested_webpack_require_388196__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var toInteger = __nested_webpack_require_388196__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var advanceStringIndex = __nested_webpack_require_388196__(/*! ./_advance-string-index */ "./node_modules/core-js/modules/_advance-string-index.js"); +var regExpExec = __nested_webpack_require_388196__(/*! ./_regexp-exec-abstract */ "./node_modules/core-js/modules/_regexp-exec-abstract.js"); +var max = Math.max; +var min = Math.min; +var floor = Math.floor; +var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g; +var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g; + +var maybeToString = function (it) { + return it === undefined ? it : String(it); +}; + +// @@replace logic +__nested_webpack_require_388196__(/*! ./_fix-re-wks */ "./node_modules/core-js/modules/_fix-re-wks.js")('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) { + return [ + // `String.prototype.replace` method + // https://tc39.github.io/ecma262/#sec-string.prototype.replace + function replace(searchValue, replaceValue) { + var O = defined(this); + var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; + return fn !== undefined + ? fn.call(searchValue, O, replaceValue) + : $replace.call(String(O), searchValue, replaceValue); + }, + // `RegExp.prototype[@@replace]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace + function (regexp, replaceValue) { + var res = maybeCallNative($replace, regexp, this, replaceValue); + if (res.done) return res.value; + + var rx = anObject(regexp); + var S = String(this); + var functionalReplace = typeof replaceValue === 'function'; + if (!functionalReplace) replaceValue = String(replaceValue); + var global = rx.global; + if (global) { + var fullUnicode = rx.unicode; + rx.lastIndex = 0; + } + var results = []; + while (true) { + var result = regExpExec(rx, S); + if (result === null) break; + results.push(result); + if (!global) break; + var matchStr = String(result[0]); + if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); + } + var accumulatedResult = ''; + var nextSourcePosition = 0; + for (var i = 0; i < results.length; i++) { + result = results[i]; + var matched = String(result[0]); + var position = max(min(toInteger(result.index), S.length), 0); + var captures = []; + // NOTE: This is equivalent to + // captures = result.slice(1).map(maybeToString) + // but for some reason `nativeSlice.call(result, 1, result.length)` (called in + // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and + // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. + for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); + var namedCaptures = result.groups; + if (functionalReplace) { + var replacerArgs = [matched].concat(captures, position, S); + if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); + var replacement = String(replaceValue.apply(undefined, replacerArgs)); } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } + replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); + } + if (position >= nextSourcePosition) { + accumulatedResult += S.slice(nextSourcePosition, position) + replacement; + nextSourcePosition = position + matched.length; } - N.push(c); } - } else { - N = []; + return accumulatedResult + S.slice(nextSourcePosition); + } + ]; - for (var j = 0; j < n.length; j++) { - N.push.apply(N, expand(n[j], false)); + // https://tc39.github.io/ecma262/#sec-getsubstitution + function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { + var tailPos = position + matched.length; + var m = captures.length; + var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; + if (namedCaptures !== undefined) { + namedCaptures = toObject(namedCaptures); + symbols = SUBSTITUTION_SYMBOLS; + } + return $replace.call(replacement, symbols, function (match, ch) { + var capture; + switch (ch.charAt(0)) { + case '$': return '$'; + case '&': return matched; + case '`': return str.slice(0, position); + case "'": return str.slice(tailPos); + case '<': + capture = namedCaptures[ch.slice(1, -1)]; + break; + default: // \d\d? + var n = +ch; + if (n === 0) return match; + if (n > m) { + var f = floor(n / 10); + if (f === 0) return match; + if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); + return match; + } + capture = captures[n - 1]; } + return capture === undefined ? '' : capture; + }); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.regexp.search.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.search.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_393682__) { + +"use strict"; + + +var anObject = __nested_webpack_require_393682__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var sameValue = __nested_webpack_require_393682__(/*! ./_same-value */ "./node_modules/core-js/modules/_same-value.js"); +var regExpExec = __nested_webpack_require_393682__(/*! ./_regexp-exec-abstract */ "./node_modules/core-js/modules/_regexp-exec-abstract.js"); + +// @@search logic +__nested_webpack_require_393682__(/*! ./_fix-re-wks */ "./node_modules/core-js/modules/_fix-re-wks.js")('search', 1, function (defined, SEARCH, $search, maybeCallNative) { + return [ + // `String.prototype.search` method + // https://tc39.github.io/ecma262/#sec-string.prototype.search + function search(regexp) { + var O = defined(this); + var fn = regexp == undefined ? undefined : regexp[SEARCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); + }, + // `RegExp.prototype[@@search]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search + function (regexp) { + var res = maybeCallNative($search, regexp, this); + if (res.done) return res.value; + var rx = anObject(regexp); + var S = String(this); + var previousLastIndex = rx.lastIndex; + if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; + var result = regExpExec(rx, S); + if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; + return result === null ? -1 : result.index; } + ]; +}); - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.regexp.split.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.split.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_395496__) { + +"use strict"; + + +var isRegExp = __nested_webpack_require_395496__(/*! ./_is-regexp */ "./node_modules/core-js/modules/_is-regexp.js"); +var anObject = __nested_webpack_require_395496__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var speciesConstructor = __nested_webpack_require_395496__(/*! ./_species-constructor */ "./node_modules/core-js/modules/_species-constructor.js"); +var advanceStringIndex = __nested_webpack_require_395496__(/*! ./_advance-string-index */ "./node_modules/core-js/modules/_advance-string-index.js"); +var toLength = __nested_webpack_require_395496__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var callRegExpExec = __nested_webpack_require_395496__(/*! ./_regexp-exec-abstract */ "./node_modules/core-js/modules/_regexp-exec-abstract.js"); +var regexpExec = __nested_webpack_require_395496__(/*! ./_regexp-exec */ "./node_modules/core-js/modules/_regexp-exec.js"); +var fails = __nested_webpack_require_395496__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var $min = Math.min; +var $push = [].push; +var $SPLIT = 'split'; +var LENGTH = 'length'; +var LAST_INDEX = 'lastIndex'; +var MAX_UINT32 = 0xffffffff; + +// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError +var SUPPORTS_Y = !fails(function () { RegExp(MAX_UINT32, 'y'); }); + +// @@split logic +__nested_webpack_require_395496__(/*! ./_fix-re-wks */ "./node_modules/core-js/modules/_fix-re-wks.js")('split', 2, function (defined, SPLIT, $split, maybeCallNative) { + var internalSplit; + if ( + 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || + 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || + 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || + '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || + '.'[$SPLIT](/()()/)[LENGTH] > 1 || + ''[$SPLIT](/.?/)[LENGTH] + ) { + // based on es5-shim implementation, need to rework it + internalSplit = function (separator, limit) { + var string = String(this); + if (separator === undefined && limit === 0) return []; + // If `separator` is not a regex, use native split + if (!isRegExp(separator)) return $split.call(string, separator, limit); + var output = []; + var flags = (separator.ignoreCase ? 'i' : '') + + (separator.multiline ? 'm' : '') + + (separator.unicode ? 'u' : '') + + (separator.sticky ? 'y' : ''); + var lastLastIndex = 0; + var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0; + // Make `global` and avoid `lastIndex` issues by working with a copy + var separatorCopy = new RegExp(separator.source, flags + 'g'); + var match, lastIndex, lastLength; + while (match = regexpExec.call(separatorCopy, string)) { + lastIndex = separatorCopy[LAST_INDEX]; + if (lastIndex > lastLastIndex) { + output.push(string.slice(lastLastIndex, match.index)); + if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); + lastLength = match[0][LENGTH]; + lastLastIndex = lastIndex; + if (output[LENGTH] >= splitLimit) break; + } + if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop } - } + if (lastLastIndex === string[LENGTH]) { + if (lastLength || !separatorCopy.test('')) output.push(''); + } else output.push(string.slice(lastLastIndex)); + return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; + }; + // Chakra, V8 + } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { + internalSplit = function (separator, limit) { + return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit); + }; + } else { + internalSplit = $split; } - return expansions; -} + return [ + // `String.prototype.split` method + // https://tc39.github.io/ecma262/#sec-string.prototype.split + function split(separator, limit) { + var O = defined(this); + var splitter = separator == undefined ? undefined : separator[SPLIT]; + return splitter !== undefined + ? splitter.call(separator, O, limit) + : internalSplit.call(String(O), separator, limit); + }, + // `RegExp.prototype[@@split]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split + // + // NOTE: This cannot be properly polyfilled in engines that don't support + // the 'y' flag. + function (regexp, limit) { + var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split); + if (res.done) return res.value; + var rx = anObject(regexp); + var S = String(this); + var C = speciesConstructor(rx, RegExp); + var unicodeMatching = rx.unicode; + var flags = (rx.ignoreCase ? 'i' : '') + + (rx.multiline ? 'm' : '') + + (rx.unicode ? 'u' : '') + + (SUPPORTS_Y ? 'y' : 'g'); -/***/ }), + // ^(? + rx + ) is needed, in combination with some S slicing, to + // simulate the 'y' flag. + var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags); + var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; + if (lim === 0) return []; + if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : []; + var p = 0; + var q = 0; + var A = []; + while (q < S.length) { + splitter.lastIndex = SUPPORTS_Y ? q : 0; + var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q)); + var e; + if ( + z === null || + (e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p + ) { + q = advanceStringIndex(S, q, unicodeMatching); + } else { + A.push(S.slice(p, q)); + if (A.length === lim) return A; + for (var i = 1; i <= z.length - 1; i++) { + A.push(z[i]); + if (A.length === lim) return A; + } + q = p = e; + } + } + A.push(S.slice(p)); + return A; + } + ]; +}); -<<<<<<< HEAD -/***/ 72426: -======= -/***/ 17422: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ }), -/*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -======= +/***/ "./node_modules/core-js/modules/es6.regexp.to-string.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.to-string.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_401699__) { -var hasher = __nccwpck_require__(62030); -var multiformats = __nccwpck_require__(27331); -var mur = __nccwpck_require__(32924); +"use strict"; -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +__nested_webpack_require_401699__(/*! ./es6.regexp.flags */ "./node_modules/core-js/modules/es6.regexp.flags.js"); +var anObject = __nested_webpack_require_401699__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var $flags = __nested_webpack_require_401699__(/*! ./_flags */ "./node_modules/core-js/modules/_flags.js"); +var DESCRIPTORS = __nested_webpack_require_401699__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); +var TO_STRING = 'toString'; +var $toString = /./[TO_STRING]; -var mur__default = /*#__PURE__*/_interopDefaultLegacy(mur); +var define = function (fn) { + __nested_webpack_require_401699__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js")(RegExp.prototype, TO_STRING, fn, true); +}; -function fromNumberTo32BitBuf(number) { - const bytes = new Array(4); - for (let i = 0; i < 4; i++) { - bytes[i] = number & 255; - number = number >> 8; - } - return new Uint8Array(bytes); +// 21.2.5.14 RegExp.prototype.toString() +if (__nested_webpack_require_401699__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) { + define(function toString() { + var R = anObject(this); + return '/'.concat(R.source, '/', + 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); + }); +// FF44- RegExp#toString has a wrong name +} else if ($toString.name != TO_STRING) { + define(function toString() { + return $toString.call(this); + }); } -const murmur332 = hasher.from({ - name: 'murmur3-32', - code: 35, - encode: input => fromNumberTo32BitBuf(mur__default["default"].x86.hash32(input)) -}); -const murmur3128 = hasher.from({ - name: 'murmur3-128', - code: 34, - encode: input => multiformats.bytes.fromHex(mur__default["default"].x64.hash128(input)) -}); -exports.murmur3128 = murmur3128; -exports.murmur332 = murmur332; + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.set.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/es6.set.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_403225__) { + +"use strict"; + +var strong = __nested_webpack_require_403225__(/*! ./_collection-strong */ "./node_modules/core-js/modules/_collection-strong.js"); +var validate = __nested_webpack_require_403225__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); +var SET = 'Set'; + +// 23.2 Set Objects +module.exports = __nested_webpack_require_403225__(/*! ./_collection */ "./node_modules/core-js/modules/_collection.js")(SET, function (get) { + return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value) { + return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); + } +}, strong); /***/ }), -/***/ 27766: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.string.anchor.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.anchor.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_404274__) { "use strict"; -/*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) */ -Object.defineProperty(exports, "__esModule", ({ value: true })); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -exports.utils = exports.curve25519 = exports.getSharedSecret = exports.sync = exports.verify = exports.sign = exports.getPublicKey = exports.Signature = exports.Point = exports.RistrettoPoint = exports.ExtendedPoint = exports.CURVE = void 0; -const nodeCrypto = __nccwpck_require__(6113); -const _0n = BigInt(0); -const _1n = BigInt(1); -const _2n = BigInt(2); -<<<<<<< HEAD -const _8n = BigInt(8); -======= ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const CU_O = BigInt('7237005577332262213973186563042994240857116359379907606001950938285454250989'); -const CURVE = Object.freeze({ - a: BigInt(-1), - d: BigInt('37095705934669439343138083508754565189542113879843219016388785533085940283555'), - P: BigInt('57896044618658097711785492504343953926634992332820282019728792003956564819949'), - l: CU_O, - n: CU_O, - h: BigInt(8), - Gx: BigInt('15112221349535400772501151409588531511454012693041857206046113283949847762202'), - Gy: BigInt('46316835694926478169428394003475163141307993866256225615783033603165251855960'), +// B.2.3.2 String.prototype.anchor(name) +__nested_webpack_require_404274__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('anchor', function (createHTML) { + return function anchor(name) { + return createHTML(this, 'a', 'name', name); + }; }); -exports.CURVE = CURVE; -const POW_2_256 = BigInt('0x10000000000000000000000000000000000000000000000000000000000000000'); -const SQRT_M1 = BigInt('19681161376707505956807079304988542015446066515923890162744021073123829784752'); -const SQRT_D = BigInt('6853475219497561581579357271197624642482790079785650197046958215289687604742'); -const SQRT_AD_MINUS_ONE = BigInt('25063068953384623474111414158702152701244531502492656460079210482610430750235'); -const INVSQRT_A_MINUS_D = BigInt('54469307008909316920995813868745141605393597292927456921205312896311721017578'); -const ONE_MINUS_D_SQ = BigInt('1159843021668779879193775521855586647937357759715417654439879720876111806838'); -const D_MINUS_ONE_SQ = BigInt('40440834346308536858101042469323190826248399146238708352240133220865137265952'); -class ExtendedPoint { - constructor(x, y, z, t) { - this.x = x; - this.y = y; - this.z = z; - this.t = t; - } - static fromAffine(p) { - if (!(p instanceof Point)) { - throw new TypeError('ExtendedPoint#fromAffine: expected Point'); - } - if (p.equals(Point.ZERO)) - return ExtendedPoint.ZERO; - return new ExtendedPoint(p.x, p.y, _1n, mod(p.x * p.y)); - } - static toAffineBatch(points) { - const toInv = invertBatch(points.map((p) => p.z)); - return points.map((p, i) => p.toAffine(toInv[i])); - } - static normalizeZ(points) { - return this.toAffineBatch(points).map(this.fromAffine); - } - equals(other) { - assertExtPoint(other); - const { x: X1, y: Y1, z: Z1 } = this; - const { x: X2, y: Y2, z: Z2 } = other; - const X1Z2 = mod(X1 * Z2); - const X2Z1 = mod(X2 * Z1); - const Y1Z2 = mod(Y1 * Z2); - const Y2Z1 = mod(Y2 * Z1); - return X1Z2 === X2Z1 && Y1Z2 === Y2Z1; - } - negate() { - return new ExtendedPoint(mod(-this.x), this.y, this.z, mod(-this.t)); - } - double() { - const { x: X1, y: Y1, z: Z1 } = this; - const { a } = CURVE; - const A = mod(X1 * X1); - const B = mod(Y1 * Y1); - const C = mod(_2n * mod(Z1 * Z1)); - const D = mod(a * A); - const x1y1 = X1 + Y1; - const E = mod(mod(x1y1 * x1y1) - A - B); - const G = D + B; - const F = G - C; - const H = D - B; - const X3 = mod(E * F); - const Y3 = mod(G * H); - const T3 = mod(E * H); - const Z3 = mod(F * G); - return new ExtendedPoint(X3, Y3, Z3, T3); - } - add(other) { - assertExtPoint(other); - const { x: X1, y: Y1, z: Z1, t: T1 } = this; - const { x: X2, y: Y2, z: Z2, t: T2 } = other; - const A = mod((Y1 - X1) * (Y2 + X2)); - const B = mod((Y1 + X1) * (Y2 - X2)); - const F = mod(B - A); - if (F === _0n) - return this.double(); - const C = mod(Z1 * _2n * T2); - const D = mod(T1 * _2n * Z2); - const E = D + C; - const G = B + A; - const H = D - C; - const X3 = mod(E * F); - const Y3 = mod(G * H); - const T3 = mod(E * H); - const Z3 = mod(F * G); - return new ExtendedPoint(X3, Y3, Z3, T3); - } - subtract(other) { - return this.add(other.negate()); - } - precomputeWindow(W) { - const windows = 1 + 256 / W; - const points = []; - let p = this; - let base = p; - for (let window = 0; window < windows; window++) { - base = p; - points.push(base); - for (let i = 1; i < 2 ** (W - 1); i++) { - base = base.add(p); - points.push(base); - } - p = base.double(); - } - return points; - } - wNAF(n, affinePoint) { - if (!affinePoint && this.equals(ExtendedPoint.BASE)) - affinePoint = Point.BASE; - const W = (affinePoint && affinePoint._WINDOW_SIZE) || 1; - if (256 % W) { - throw new Error('Point#wNAF: Invalid precomputation window, must be power of 2'); - } - let precomputes = affinePoint && pointPrecomputes.get(affinePoint); - if (!precomputes) { - precomputes = this.precomputeWindow(W); - if (affinePoint && W !== 1) { - precomputes = ExtendedPoint.normalizeZ(precomputes); - pointPrecomputes.set(affinePoint, precomputes); - } - } - let p = ExtendedPoint.ZERO; -<<<<<<< HEAD - let f = ExtendedPoint.BASE; -======= - let f = ExtendedPoint.ZERO; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - const windows = 1 + 256 / W; - const windowSize = 2 ** (W - 1); - const mask = BigInt(2 ** W - 1); - const maxNumber = 2 ** W; - const shiftBy = BigInt(W); - for (let window = 0; window < windows; window++) { - const offset = window * windowSize; - let wbits = Number(n & mask); - n >>= shiftBy; - if (wbits > windowSize) { - wbits -= maxNumber; - n += _1n; - } - const offset1 = offset; - const offset2 = offset + Math.abs(wbits) - 1; - const cond1 = window % 2 !== 0; - const cond2 = wbits < 0; - if (wbits === 0) { - f = f.add(constTimeNegate(cond1, precomputes[offset1])); - } - else { - p = p.add(constTimeNegate(cond2, precomputes[offset2])); - } - } - return ExtendedPoint.normalizeZ([p, f])[0]; - } - multiply(scalar, affinePoint) { - return this.wNAF(normalizeScalar(scalar, CURVE.l), affinePoint); -<<<<<<< HEAD - } - multiplyUnsafe(scalar) { - let n = normalizeScalar(scalar, CURVE.l, false); - const G = ExtendedPoint.BASE; - const P0 = ExtendedPoint.ZERO; - if (n === _0n) - return P0; - if (this.equals(P0) || n === _1n) - return this; - if (this.equals(G)) - return this.wNAF(n); - let p = P0; - let d = this; - while (n > _0n) { - if (n & _1n) - p = p.add(d); - d = d.double(); - n >>= _1n; - } - return p; - } - isSmallOrder() { - return this.multiplyUnsafe(CURVE.h).equals(ExtendedPoint.ZERO); - } - isTorsionFree() { - let p = this.multiplyUnsafe(CURVE.l / _2n).double(); - if (CURVE.l % _2n) - p = p.add(this); - return p.equals(ExtendedPoint.ZERO); - } - toAffine(invZ) { - const { x, y, z } = this; - const is0 = this.equals(ExtendedPoint.ZERO); - if (invZ == null) - invZ = is0 ? _8n : invert(z); - const ax = mod(x * invZ); - const ay = mod(y * invZ); - const zz = mod(z * invZ); - if (is0) - return Point.ZERO; -======= - } - multiplyUnsafe(scalar) { - let n = normalizeScalar(scalar, CURVE.l, false); - const G = ExtendedPoint.BASE; - const P0 = ExtendedPoint.ZERO; - if (n === _0n) - return P0; - if (this.equals(P0) || n === _1n) - return this; - if (this.equals(G)) - return this.wNAF(n); - let p = P0; - let d = this; - while (n > _0n) { - if (n & _1n) - p = p.add(d); - d = d.double(); - n >>= _1n; - } - return p; - } - isSmallOrder() { - return this.multiplyUnsafe(CURVE.h).equals(ExtendedPoint.ZERO); - } - isTorsionFree() { - return this.multiplyUnsafe(CURVE.l).equals(ExtendedPoint.ZERO); - } - toAffine(invZ = invert(this.z)) { - const { x, y, z } = this; - const ax = mod(x * invZ); - const ay = mod(y * invZ); - const zz = mod(z * invZ); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - if (zz !== _1n) - throw new Error('invZ was invalid'); - return new Point(ax, ay); - } - fromRistrettoBytes() { - legacyRist(); - } - toRistrettoBytes() { - legacyRist(); - } - fromRistrettoHash() { - legacyRist(); - } -} -exports.ExtendedPoint = ExtendedPoint; -ExtendedPoint.BASE = new ExtendedPoint(CURVE.Gx, CURVE.Gy, _1n, mod(CURVE.Gx * CURVE.Gy)); -ExtendedPoint.ZERO = new ExtendedPoint(_0n, _1n, _1n, _0n); -<<<<<<< HEAD -function constTimeNegate(condition, item) { - const neg = item.negate(); - return condition ? neg : item; -} -======= ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -function assertExtPoint(other) { - if (!(other instanceof ExtendedPoint)) - throw new TypeError('ExtendedPoint expected'); -} -function assertRstPoint(other) { - if (!(other instanceof RistrettoPoint)) - throw new TypeError('RistrettoPoint expected'); -} -function legacyRist() { - throw new Error('Legacy method: switch to RistrettoPoint'); -} -class RistrettoPoint { - constructor(ep) { - this.ep = ep; - } - static calcElligatorRistrettoMap(r0) { - const { d } = CURVE; - const r = mod(SQRT_M1 * r0 * r0); - const Ns = mod((r + _1n) * ONE_MINUS_D_SQ); - let c = BigInt(-1); - const D = mod((c - d * r) * mod(r + d)); - let { isValid: Ns_D_is_sq, value: s } = uvRatio(Ns, D); - let s_ = mod(s * r0); - if (!edIsNegative(s_)) - s_ = mod(-s_); - if (!Ns_D_is_sq) - s = s_; - if (!Ns_D_is_sq) - c = r; - const Nt = mod(c * (r - _1n) * D_MINUS_ONE_SQ - D); - const s2 = s * s; - const W0 = mod((s + s) * D); - const W1 = mod(Nt * SQRT_AD_MINUS_ONE); - const W2 = mod(_1n - s2); - const W3 = mod(_1n + s2); - return new ExtendedPoint(mod(W0 * W3), mod(W2 * W1), mod(W1 * W3), mod(W0 * W2)); - } - static hashToCurve(hex) { - hex = ensureBytes(hex, 64); - const r1 = bytes255ToNumberLE(hex.slice(0, 32)); - const R1 = this.calcElligatorRistrettoMap(r1); - const r2 = bytes255ToNumberLE(hex.slice(32, 64)); - const R2 = this.calcElligatorRistrettoMap(r2); - return new RistrettoPoint(R1.add(R2)); - } - static fromHex(hex) { - hex = ensureBytes(hex, 32); - const { a, d } = CURVE; - const emsg = 'RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint'; - const s = bytes255ToNumberLE(hex); - if (!equalBytes(numberTo32BytesLE(s), hex) || edIsNegative(s)) - throw new Error(emsg); - const s2 = mod(s * s); - const u1 = mod(_1n + a * s2); - const u2 = mod(_1n - a * s2); - const u1_2 = mod(u1 * u1); - const u2_2 = mod(u2 * u2); - const v = mod(a * d * u1_2 - u2_2); - const { isValid, value: I } = invertSqrt(mod(v * u2_2)); - const Dx = mod(I * u2); - const Dy = mod(I * Dx * v); - let x = mod((s + s) * Dx); - if (edIsNegative(x)) - x = mod(-x); - const y = mod(u1 * Dy); - const t = mod(x * y); - if (!isValid || edIsNegative(t) || y === _0n) - throw new Error(emsg); - return new RistrettoPoint(new ExtendedPoint(x, y, _1n, t)); - } - toRawBytes() { - let { x, y, z, t } = this.ep; - const u1 = mod(mod(z + y) * mod(z - y)); - const u2 = mod(x * y); - const u2sq = mod(u2 * u2); - const { value: invsqrt } = invertSqrt(mod(u1 * u2sq)); - const D1 = mod(invsqrt * u1); - const D2 = mod(invsqrt * u2); - const zInv = mod(D1 * D2 * t); - let D; - if (edIsNegative(t * zInv)) { - let _x = mod(y * SQRT_M1); - let _y = mod(x * SQRT_M1); - x = _x; - y = _y; - D = mod(D1 * INVSQRT_A_MINUS_D); - } - else { - D = D2; - } - if (edIsNegative(x * zInv)) - y = mod(-y); - let s = mod((z - y) * D); - if (edIsNegative(s)) - s = mod(-s); - return numberTo32BytesLE(s); - } - toHex() { - return bytesToHex(this.toRawBytes()); - } - toString() { - return this.toHex(); - } - equals(other) { - assertRstPoint(other); - const a = this.ep; - const b = other.ep; - const one = mod(a.x * b.y) === mod(a.y * b.x); - const two = mod(a.y * b.y) === mod(a.x * b.x); - return one || two; - } - add(other) { - assertRstPoint(other); - return new RistrettoPoint(this.ep.add(other.ep)); - } - subtract(other) { - assertRstPoint(other); - return new RistrettoPoint(this.ep.subtract(other.ep)); - } - multiply(scalar) { - return new RistrettoPoint(this.ep.multiply(scalar)); - } - multiplyUnsafe(scalar) { - return new RistrettoPoint(this.ep.multiplyUnsafe(scalar)); - } -} -exports.RistrettoPoint = RistrettoPoint; -RistrettoPoint.BASE = new RistrettoPoint(ExtendedPoint.BASE); -RistrettoPoint.ZERO = new RistrettoPoint(ExtendedPoint.ZERO); -const pointPrecomputes = new WeakMap(); -class Point { - constructor(x, y) { - this.x = x; - this.y = y; - } - _setWindowSize(windowSize) { - this._WINDOW_SIZE = windowSize; - pointPrecomputes.delete(this); - } - static fromHex(hex, strict = true) { - const { d, P } = CURVE; - hex = ensureBytes(hex, 32); - const normed = hex.slice(); - normed[31] = hex[31] & ~0x80; - const y = bytesToNumberLE(normed); - if (strict && y >= P) - throw new Error('Expected 0 < hex < P'); - if (!strict && y >= POW_2_256) - throw new Error('Expected 0 < hex < 2**256'); - const y2 = mod(y * y); - const u = mod(y2 - _1n); - const v = mod(d * y2 + _1n); - let { isValid, value: x } = uvRatio(u, v); - if (!isValid) - throw new Error('Point.fromHex: invalid y coordinate'); - const isXOdd = (x & _1n) === _1n; - const isLastByteOdd = (hex[31] & 0x80) !== 0; - if (isLastByteOdd !== isXOdd) { - x = mod(-x); - } - return new Point(x, y); - } - static async fromPrivateKey(privateKey) { - return (await getExtendedPublicKey(privateKey)).point; - } - toRawBytes() { - const bytes = numberTo32BytesLE(this.y); - bytes[31] |= this.x & _1n ? 0x80 : 0; - return bytes; - } - toHex() { - return bytesToHex(this.toRawBytes()); - } - toX25519() { - const { y } = this; - const u = mod((_1n + y) * invert(_1n - y)); - return numberTo32BytesLE(u); - } - isTorsionFree() { - return ExtendedPoint.fromAffine(this).isTorsionFree(); - } - equals(other) { - return this.x === other.x && this.y === other.y; - } - negate() { - return new Point(mod(-this.x), this.y); - } - add(other) { - return ExtendedPoint.fromAffine(this).add(ExtendedPoint.fromAffine(other)).toAffine(); - } - subtract(other) { - return this.add(other.negate()); - } - multiply(scalar) { - return ExtendedPoint.fromAffine(this).multiply(scalar, this).toAffine(); - } -} -exports.Point = Point; -Point.BASE = new Point(CURVE.Gx, CURVE.Gy); -Point.ZERO = new Point(_0n, _1n); -class Signature { - constructor(r, s) { - this.r = r; - this.s = s; - this.assertValidity(); - } - static fromHex(hex) { - const bytes = ensureBytes(hex, 64); - const r = Point.fromHex(bytes.slice(0, 32), false); - const s = bytesToNumberLE(bytes.slice(32, 64)); - return new Signature(r, s); - } - assertValidity() { - const { r, s } = this; - if (!(r instanceof Point)) - throw new Error('Expected Point instance'); - normalizeScalar(s, CURVE.l, false); - return this; - } - toRawBytes() { - const u8 = new Uint8Array(64); - u8.set(this.r.toRawBytes()); - u8.set(numberTo32BytesLE(this.s), 32); - return u8; - } - toHex() { - return bytesToHex(this.toRawBytes()); - } -} -exports.Signature = Signature; -function concatBytes(...arrays) { - if (!arrays.every((a) => a instanceof Uint8Array)) - throw new Error('Expected Uint8Array list'); - if (arrays.length === 1) - return arrays[0]; - const length = arrays.reduce((a, arr) => a + arr.length, 0); - const result = new Uint8Array(length); - for (let i = 0, pad = 0; i < arrays.length; i++) { - const arr = arrays[i]; - result.set(arr, pad); - pad += arr.length; - } - return result; -} -const hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, '0')); -function bytesToHex(uint8a) { - if (!(uint8a instanceof Uint8Array)) - throw new Error('Uint8Array expected'); - let hex = ''; - for (let i = 0; i < uint8a.length; i++) { - hex += hexes[uint8a[i]]; - } - return hex; -} -function hexToBytes(hex) { - if (typeof hex !== 'string') { - throw new TypeError('hexToBytes: expected string, got ' + typeof hex); - } - if (hex.length % 2) - throw new Error('hexToBytes: received invalid unpadded hex'); - const array = new Uint8Array(hex.length / 2); - for (let i = 0; i < array.length; i++) { - const j = i * 2; - const hexByte = hex.slice(j, j + 2); - const byte = Number.parseInt(hexByte, 16); - if (Number.isNaN(byte) || byte < 0) - throw new Error('Invalid byte sequence'); - array[i] = byte; - } - return array; -} -function numberTo32BytesBE(num) { - const length = 32; - const hex = num.toString(16).padStart(length * 2, '0'); - return hexToBytes(hex); -} -function numberTo32BytesLE(num) { - return numberTo32BytesBE(num).reverse(); -} -function edIsNegative(num) { - return (mod(num) & _1n) === _1n; -} -function bytesToNumberLE(uint8a) { - if (!(uint8a instanceof Uint8Array)) - throw new Error('Expected Uint8Array'); - return BigInt('0x' + bytesToHex(Uint8Array.from(uint8a).reverse())); -} -const MAX_255B = BigInt('0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); -function bytes255ToNumberLE(bytes) { - return mod(bytesToNumberLE(bytes) & MAX_255B); -} -function mod(a, b = CURVE.P) { - const res = a % b; - return res >= _0n ? res : b + res; -} -function invert(number, modulo = CURVE.P) { - if (number === _0n || modulo <= _0n) { - throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`); - } - let a = mod(number, modulo); - let b = modulo; - let x = _0n, y = _1n, u = _1n, v = _0n; - while (a !== _0n) { - const q = b / a; - const r = b % a; - const m = x - u * q; - const n = y - v * q; - b = a, a = r, x = u, y = v, u = m, v = n; - } - const gcd = b; - if (gcd !== _1n) - throw new Error('invert: does not exist'); - return mod(x, modulo); -} -function invertBatch(nums, p = CURVE.P) { - const tmp = new Array(nums.length); - const lastMultiplied = nums.reduce((acc, num, i) => { - if (num === _0n) - return acc; - tmp[i] = acc; - return mod(acc * num, p); - }, _1n); - const inverted = invert(lastMultiplied, p); - nums.reduceRight((acc, num, i) => { - if (num === _0n) - return acc; - tmp[i] = mod(acc * tmp[i], p); - return mod(acc * num, p); - }, inverted); - return tmp; -} -function pow2(x, power) { - const { P } = CURVE; - let res = x; - while (power-- > _0n) { - res *= res; - res %= P; - } - return res; -} -function pow_2_252_3(x) { - const { P } = CURVE; - const _5n = BigInt(5); - const _10n = BigInt(10); - const _20n = BigInt(20); - const _40n = BigInt(40); - const _80n = BigInt(80); - const x2 = (x * x) % P; - const b2 = (x2 * x) % P; - const b4 = (pow2(b2, _2n) * b2) % P; - const b5 = (pow2(b4, _1n) * x) % P; - const b10 = (pow2(b5, _5n) * b5) % P; - const b20 = (pow2(b10, _10n) * b10) % P; - const b40 = (pow2(b20, _20n) * b20) % P; - const b80 = (pow2(b40, _40n) * b40) % P; - const b160 = (pow2(b80, _80n) * b80) % P; - const b240 = (pow2(b160, _80n) * b80) % P; - const b250 = (pow2(b240, _10n) * b10) % P; - const pow_p_5_8 = (pow2(b250, _2n) * x) % P; - return { pow_p_5_8, b2 }; -} -function uvRatio(u, v) { - const v3 = mod(v * v * v); - const v7 = mod(v3 * v3 * v); - const pow = pow_2_252_3(u * v7).pow_p_5_8; - let x = mod(u * v3 * pow); - const vx2 = mod(v * x * x); - const root1 = x; - const root2 = mod(x * SQRT_M1); - const useRoot1 = vx2 === u; - const useRoot2 = vx2 === mod(-u); - const noRoot = vx2 === mod(-u * SQRT_M1); - if (useRoot1) - x = root1; - if (useRoot2 || noRoot) - x = root2; - if (edIsNegative(x)) - x = mod(-x); - return { isValid: useRoot1 || useRoot2, value: x }; -} -function invertSqrt(number) { - return uvRatio(_1n, number); -} -function modlLE(hash) { - return mod(bytesToNumberLE(hash), CURVE.l); -} -function equalBytes(b1, b2) { - if (b1.length !== b2.length) { - return false; - } - for (let i = 0; i < b1.length; i++) { - if (b1[i] !== b2[i]) { - return false; - } - } - return true; -} -function ensureBytes(hex, expectedLength) { - const bytes = hex instanceof Uint8Array ? Uint8Array.from(hex) : hexToBytes(hex); - if (typeof expectedLength === 'number' && bytes.length !== expectedLength) - throw new Error(`Expected ${expectedLength} bytes`); - return bytes; -} -function normalizeScalar(num, max, strict = true) { - if (!max) - throw new TypeError('Specify max value'); - if (typeof num === 'number' && Number.isSafeInteger(num)) - num = BigInt(num); - if (typeof num === 'bigint' && num < max) { - if (strict) { - if (_0n < num) - return num; - } - else { - if (_0n <= num) - return num; - } - } - throw new TypeError('Expected valid scalar: 0 < scalar < max'); -} -function adjustBytes25519(bytes) { - bytes[0] &= 248; - bytes[31] &= 127; - bytes[31] |= 64; - return bytes; -} -function decodeScalar25519(n) { - return bytesToNumberLE(adjustBytes25519(ensureBytes(n, 32))); -} -function checkPrivateKey(key) { - key = - typeof key === 'bigint' || typeof key === 'number' - ? numberTo32BytesBE(normalizeScalar(key, POW_2_256)) - : ensureBytes(key); - if (key.length !== 32) - throw new Error(`Expected 32 bytes`); - return key; -} -function getKeyFromHash(hashed) { - const head = adjustBytes25519(hashed.slice(0, 32)); - const prefix = hashed.slice(32, 64); - const scalar = modlLE(head); - const point = Point.BASE.multiply(scalar); - const pointBytes = point.toRawBytes(); - return { head, prefix, scalar, point, pointBytes }; -} -let _sha512Sync; -function sha512s(...m) { - if (typeof _sha512Sync !== 'function') - throw new Error('utils.sha512Sync must be set to use sync methods'); - return _sha512Sync(...m); -} -async function getExtendedPublicKey(key) { - return getKeyFromHash(await exports.utils.sha512(checkPrivateKey(key))); -} -function getExtendedPublicKeySync(key) { - return getKeyFromHash(sha512s(checkPrivateKey(key))); -} -async function getPublicKey(privateKey) { - return (await getExtendedPublicKey(privateKey)).pointBytes; -} -exports.getPublicKey = getPublicKey; -function getPublicKeySync(privateKey) { - return getExtendedPublicKeySync(privateKey).pointBytes; -} -async function sign(message, privateKey) { - message = ensureBytes(message); - const { prefix, scalar, pointBytes } = await getExtendedPublicKey(privateKey); - const r = modlLE(await exports.utils.sha512(prefix, message)); - const R = Point.BASE.multiply(r); - const k = modlLE(await exports.utils.sha512(R.toRawBytes(), pointBytes, message)); - const s = mod(r + k * scalar, CURVE.l); - return new Signature(R, s).toRawBytes(); -} -exports.sign = sign; -function signSync(message, privateKey) { - message = ensureBytes(message); - const { prefix, scalar, pointBytes } = getExtendedPublicKeySync(privateKey); - const r = modlLE(sha512s(prefix, message)); - const R = Point.BASE.multiply(r); - const k = modlLE(sha512s(R.toRawBytes(), pointBytes, message)); - const s = mod(r + k * scalar, CURVE.l); - return new Signature(R, s).toRawBytes(); -} -function prepareVerification(sig, message, publicKey) { - message = ensureBytes(message); - if (!(publicKey instanceof Point)) - publicKey = Point.fromHex(publicKey, false); - const { r, s } = sig instanceof Signature ? sig.assertValidity() : Signature.fromHex(sig); - const SB = ExtendedPoint.BASE.multiplyUnsafe(s); - return { r, s, SB, pub: publicKey, msg: message }; -} -function finishVerification(publicKey, r, SB, hashed) { - const k = modlLE(hashed); - const kA = ExtendedPoint.fromAffine(publicKey).multiplyUnsafe(k); - const RkA = ExtendedPoint.fromAffine(r).add(kA); - return RkA.subtract(SB).multiplyUnsafe(CURVE.h).equals(ExtendedPoint.ZERO); -} -async function verify(sig, message, publicKey) { - const { r, SB, msg, pub } = prepareVerification(sig, message, publicKey); - const hashed = await exports.utils.sha512(r.toRawBytes(), pub.toRawBytes(), msg); - return finishVerification(pub, r, SB, hashed); -} -exports.verify = verify; -function verifySync(sig, message, publicKey) { - const { r, SB, msg, pub } = prepareVerification(sig, message, publicKey); - const hashed = sha512s(r.toRawBytes(), pub.toRawBytes(), msg); - return finishVerification(pub, r, SB, hashed); -} -exports.sync = { - getExtendedPublicKey: getExtendedPublicKeySync, - getPublicKey: getPublicKeySync, - sign: signSync, - verify: verifySync, -}; -async function getSharedSecret(privateKey, publicKey) { - const { head } = await getExtendedPublicKey(privateKey); - const u = Point.fromHex(publicKey).toX25519(); - return exports.curve25519.scalarMult(head, u); -} -exports.getSharedSecret = getSharedSecret; -Point.BASE._setWindowSize(8); -function cswap(swap, x_2, x_3) { - const dummy = mod(swap * (x_2 - x_3)); - x_2 = mod(x_2 - dummy); - x_3 = mod(x_3 + dummy); - return [x_2, x_3]; -} -function montgomeryLadder(pointU, scalar) { - const { P } = CURVE; - const u = normalizeScalar(pointU, P); - const k = normalizeScalar(scalar, P); - const a24 = BigInt(121665); - const x_1 = u; - let x_2 = _1n; - let z_2 = _0n; - let x_3 = u; - let z_3 = _1n; - let swap = _0n; - let sw; - for (let t = BigInt(255 - 1); t >= _0n; t--) { - const k_t = (k >> t) & _1n; - swap ^= k_t; - sw = cswap(swap, x_2, x_3); - x_2 = sw[0]; - x_3 = sw[1]; - sw = cswap(swap, z_2, z_3); - z_2 = sw[0]; - z_3 = sw[1]; - swap = k_t; - const A = x_2 + z_2; - const AA = mod(A * A); - const B = x_2 - z_2; - const BB = mod(B * B); - const E = AA - BB; - const C = x_3 + z_3; - const D = x_3 - z_3; - const DA = mod(D * A); - const CB = mod(C * B); - const dacb = DA + CB; - const da_cb = DA - CB; - x_3 = mod(dacb * dacb); - z_3 = mod(x_1 * mod(da_cb * da_cb)); - x_2 = mod(AA * BB); - z_2 = mod(E * (AA + mod(a24 * E))); - } - sw = cswap(swap, x_2, x_3); - x_2 = sw[0]; - x_3 = sw[1]; - sw = cswap(swap, z_2, z_3); - z_2 = sw[0]; - z_3 = sw[1]; - const { pow_p_5_8, b2 } = pow_2_252_3(z_2); - const xp2 = mod(pow2(pow_p_5_8, BigInt(3)) * b2); - return mod(x_2 * xp2); -} -function encodeUCoordinate(u) { - return numberTo32BytesLE(mod(u, CURVE.P)); -} -function decodeUCoordinate(uEnc) { - const u = ensureBytes(uEnc, 32); - u[31] &= 127; - return bytesToNumberLE(u); -} -exports.curve25519 = { - BASE_POINT_U: '0900000000000000000000000000000000000000000000000000000000000000', - scalarMult(privateKey, publicKey) { - const u = decodeUCoordinate(publicKey); - const p = decodeScalar25519(privateKey); - const pu = montgomeryLadder(u, p); - if (pu === _0n) - throw new Error('Invalid private or public key received'); - return encodeUCoordinate(pu); - }, - scalarMultBase(privateKey) { - return exports.curve25519.scalarMult(privateKey, exports.curve25519.BASE_POINT_U); - }, -}; -const crypto = { - node: nodeCrypto, - web: typeof self === 'object' && 'crypto' in self ? self.crypto : undefined, -}; -exports.utils = { - bytesToHex, - hexToBytes, - concatBytes, - getExtendedPublicKey, - mod, - invert, - TORSION_SUBGROUP: [ - '0100000000000000000000000000000000000000000000000000000000000000', - 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a', - '0000000000000000000000000000000000000000000000000000000000000080', - '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05', - 'ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f', - '26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85', - '0000000000000000000000000000000000000000000000000000000000000000', - 'c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa', - ], - hashToPrivateScalar: (hash) => { - hash = ensureBytes(hash); - if (hash.length < 40 || hash.length > 1024) - throw new Error('Expected 40-1024 bytes of private key as per FIPS 186'); - return mod(bytesToNumberLE(hash), CURVE.l - _1n) + _1n; - }, - randomBytes: (bytesLength = 32) => { - if (crypto.web) { - return crypto.web.getRandomValues(new Uint8Array(bytesLength)); - } - else if (crypto.node) { - const { randomBytes } = crypto.node; - return new Uint8Array(randomBytes(bytesLength).buffer); - } - else { - throw new Error("The environment doesn't have randomBytes function"); - } - }, - randomPrivateKey: () => { - return exports.utils.randomBytes(32); - }, - sha512: async (...messages) => { - const message = concatBytes(...messages); - if (crypto.web) { - const buffer = await crypto.web.subtle.digest('SHA-512', message.buffer); - return new Uint8Array(buffer); - } - else if (crypto.node) { - return Uint8Array.from(crypto.node.createHash('sha512').update(message).digest()); - } - else { - throw new Error("The environment doesn't have sha512 function"); - } - }, - precompute(windowSize = 8, point = Point.BASE) { - const cached = point.equals(Point.BASE) ? point : new Point(point.x, point.y); - cached._setWindowSize(windowSize); - cached.multiply(_2n); - return cached; - }, - sha512Sync: undefined, -}; -Object.defineProperties(exports.utils, { - sha512Sync: { - configurable: false, - get() { - return _sha512Sync; - }, - set(val) { - if (!_sha512Sync) - _sha512Sync = val; - }, - }, -}); - - -/***/ }), - -<<<<<<< HEAD -/***/ 14681: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -======= -/***/ 61163: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - -/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.utils = exports.schnorr = exports.verify = exports.signSync = exports.sign = exports.getSharedSecret = exports.recoverPublicKey = exports.getPublicKey = exports.Signature = exports.Point = exports.CURVE = void 0; -const nodeCrypto = __nccwpck_require__(6113); -const _0n = BigInt(0); -const _1n = BigInt(1); -const _2n = BigInt(2); -const _3n = BigInt(3); -const _8n = BigInt(8); -const CURVE = Object.freeze({ - a: _0n, - b: BigInt(7), - P: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'), - n: BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'), - h: _1n, - Gx: BigInt('55066263022277343669578718895168534326250603453777594175500187360389116729240'), - Gy: BigInt('32670510020758816978083085130507043184471273380659243275938904335757337482424'), - beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'), -}); -exports.CURVE = CURVE; -const divNearest = (a, b) => (a + b / _2n) / b; -const endo = { - beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'), - splitScalar(k) { - const { n } = CURVE; - const a1 = BigInt('0x3086d221a7d46bcde86c90e49284eb15'); - const b1 = -_1n * BigInt('0xe4437ed6010e88286f547fa90abfe4c3'); - const a2 = BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8'); - const b2 = a1; - const POW_2_128 = BigInt('0x100000000000000000000000000000000'); - const c1 = divNearest(b2 * k, n); - const c2 = divNearest(-b1 * k, n); - let k1 = mod(k - c1 * a1 - c2 * a2, n); - let k2 = mod(-c1 * b1 - c2 * b2, n); - const k1neg = k1 > POW_2_128; - const k2neg = k2 > POW_2_128; - if (k1neg) - k1 = n - k1; - if (k2neg) - k2 = n - k2; - if (k1 > POW_2_128 || k2 > POW_2_128) { - throw new Error('splitScalarEndo: Endomorphism failed, k=' + k); - } - return { k1neg, k1, k2neg, k2 }; - }, -}; -const fieldLen = 32; -const groupLen = 32; -const hashLen = 32; -const compressedLen = fieldLen + 1; -const uncompressedLen = 2 * fieldLen + 1; -function weierstrass(x) { - const { a, b } = CURVE; - const x2 = mod(x * x); - const x3 = mod(x2 * x); - return mod(x3 + a * x + b); -} -const USE_ENDOMORPHISM = CURVE.a === _0n; -class ShaError extends Error { - constructor(message) { - super(message); - } -} -function assertJacPoint(other) { - if (!(other instanceof JacobianPoint)) - throw new TypeError('JacobianPoint expected'); -} -class JacobianPoint { - constructor(x, y, z) { - this.x = x; - this.y = y; - this.z = z; - } - static fromAffine(p) { - if (!(p instanceof Point)) { - throw new TypeError('JacobianPoint#fromAffine: expected Point'); - } - if (p.equals(Point.ZERO)) - return JacobianPoint.ZERO; - return new JacobianPoint(p.x, p.y, _1n); - } - static toAffineBatch(points) { - const toInv = invertBatch(points.map((p) => p.z)); - return points.map((p, i) => p.toAffine(toInv[i])); - } - static normalizeZ(points) { - return JacobianPoint.toAffineBatch(points).map(JacobianPoint.fromAffine); - } - equals(other) { - assertJacPoint(other); - const { x: X1, y: Y1, z: Z1 } = this; - const { x: X2, y: Y2, z: Z2 } = other; - const Z1Z1 = mod(Z1 * Z1); - const Z2Z2 = mod(Z2 * Z2); - const U1 = mod(X1 * Z2Z2); - const U2 = mod(X2 * Z1Z1); - const S1 = mod(mod(Y1 * Z2) * Z2Z2); - const S2 = mod(mod(Y2 * Z1) * Z1Z1); - return U1 === U2 && S1 === S2; - } - negate() { - return new JacobianPoint(this.x, mod(-this.y), this.z); - } - double() { - const { x: X1, y: Y1, z: Z1 } = this; - const A = mod(X1 * X1); - const B = mod(Y1 * Y1); - const C = mod(B * B); - const x1b = X1 + B; - const D = mod(_2n * (mod(x1b * x1b) - A - C)); - const E = mod(_3n * A); - const F = mod(E * E); - const X3 = mod(F - _2n * D); - const Y3 = mod(E * (D - X3) - _8n * C); - const Z3 = mod(_2n * Y1 * Z1); - return new JacobianPoint(X3, Y3, Z3); - } - add(other) { - assertJacPoint(other); - const { x: X1, y: Y1, z: Z1 } = this; - const { x: X2, y: Y2, z: Z2 } = other; - if (X2 === _0n || Y2 === _0n) - return this; - if (X1 === _0n || Y1 === _0n) - return other; - const Z1Z1 = mod(Z1 * Z1); - const Z2Z2 = mod(Z2 * Z2); - const U1 = mod(X1 * Z2Z2); - const U2 = mod(X2 * Z1Z1); - const S1 = mod(mod(Y1 * Z2) * Z2Z2); - const S2 = mod(mod(Y2 * Z1) * Z1Z1); - const H = mod(U2 - U1); - const r = mod(S2 - S1); - if (H === _0n) { - if (r === _0n) { - return this.double(); - } - else { - return JacobianPoint.ZERO; - } - } - const HH = mod(H * H); - const HHH = mod(H * HH); - const V = mod(U1 * HH); - const X3 = mod(r * r - HHH - _2n * V); - const Y3 = mod(r * (V - X3) - S1 * HHH); - const Z3 = mod(Z1 * Z2 * H); - return new JacobianPoint(X3, Y3, Z3); - } - subtract(other) { - return this.add(other.negate()); - } - multiplyUnsafe(scalar) { - const P0 = JacobianPoint.ZERO; - if (typeof scalar === 'bigint' && scalar === _0n) - return P0; - let n = normalizeScalar(scalar); - if (n === _1n) - return this; - if (!USE_ENDOMORPHISM) { - let p = P0; - let d = this; - while (n > _0n) { - if (n & _1n) - p = p.add(d); - d = d.double(); - n >>= _1n; - } - return p; - } - let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); - let k1p = P0; - let k2p = P0; - let d = this; - while (k1 > _0n || k2 > _0n) { - if (k1 & _1n) - k1p = k1p.add(d); - if (k2 & _1n) - k2p = k2p.add(d); - d = d.double(); - k1 >>= _1n; - k2 >>= _1n; - } - if (k1neg) - k1p = k1p.negate(); - if (k2neg) - k2p = k2p.negate(); - k2p = new JacobianPoint(mod(k2p.x * endo.beta), k2p.y, k2p.z); - return k1p.add(k2p); - } - precomputeWindow(W) { - const windows = USE_ENDOMORPHISM ? 128 / W + 1 : 256 / W + 1; - const points = []; - let p = this; - let base = p; - for (let window = 0; window < windows; window++) { - base = p; - points.push(base); - for (let i = 1; i < 2 ** (W - 1); i++) { - base = base.add(p); - points.push(base); - } - p = base.double(); - } - return points; - } - wNAF(n, affinePoint) { - if (!affinePoint && this.equals(JacobianPoint.BASE)) - affinePoint = Point.BASE; - const W = (affinePoint && affinePoint._WINDOW_SIZE) || 1; - if (256 % W) { - throw new Error('Point#wNAF: Invalid precomputation window, must be power of 2'); - } - let precomputes = affinePoint && pointPrecomputes.get(affinePoint); - if (!precomputes) { - precomputes = this.precomputeWindow(W); - if (affinePoint && W !== 1) { - precomputes = JacobianPoint.normalizeZ(precomputes); - pointPrecomputes.set(affinePoint, precomputes); - } - } - let p = JacobianPoint.ZERO; - let f = JacobianPoint.BASE; - const windows = 1 + (USE_ENDOMORPHISM ? 128 / W : 256 / W); - const windowSize = 2 ** (W - 1); - const mask = BigInt(2 ** W - 1); - const maxNumber = 2 ** W; - const shiftBy = BigInt(W); - for (let window = 0; window < windows; window++) { - const offset = window * windowSize; - let wbits = Number(n & mask); - n >>= shiftBy; - if (wbits > windowSize) { - wbits -= maxNumber; - n += _1n; - } - const offset1 = offset; - const offset2 = offset + Math.abs(wbits) - 1; - const cond1 = window % 2 !== 0; - const cond2 = wbits < 0; - if (wbits === 0) { - f = f.add(constTimeNegate(cond1, precomputes[offset1])); - } - else { - p = p.add(constTimeNegate(cond2, precomputes[offset2])); - } - } - return { p, f }; - } - multiply(scalar, affinePoint) { - let n = normalizeScalar(scalar); - let point; - let fake; - if (USE_ENDOMORPHISM) { - const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); - let { p: k1p, f: f1p } = this.wNAF(k1, affinePoint); - let { p: k2p, f: f2p } = this.wNAF(k2, affinePoint); - k1p = constTimeNegate(k1neg, k1p); - k2p = constTimeNegate(k2neg, k2p); - k2p = new JacobianPoint(mod(k2p.x * endo.beta), k2p.y, k2p.z); - point = k1p.add(k2p); - fake = f1p.add(f2p); - } - else { - const { p, f } = this.wNAF(n, affinePoint); - point = p; - fake = f; - } - return JacobianPoint.normalizeZ([point, fake])[0]; - } - toAffine(invZ) { - const { x, y, z } = this; - const is0 = this.equals(JacobianPoint.ZERO); - if (invZ == null) - invZ = is0 ? _8n : invert(z); - const iz1 = invZ; - const iz2 = mod(iz1 * iz1); - const iz3 = mod(iz2 * iz1); - const ax = mod(x * iz2); - const ay = mod(y * iz3); - const zz = mod(z * iz1); - if (is0) - return Point.ZERO; - if (zz !== _1n) - throw new Error('invZ was invalid'); - return new Point(ax, ay); - } -} -JacobianPoint.BASE = new JacobianPoint(CURVE.Gx, CURVE.Gy, _1n); -JacobianPoint.ZERO = new JacobianPoint(_0n, _1n, _0n); -function constTimeNegate(condition, item) { - const neg = item.negate(); - return condition ? neg : item; -} -const pointPrecomputes = new WeakMap(); -class Point { - constructor(x, y) { - this.x = x; - this.y = y; - } - _setWindowSize(windowSize) { - this._WINDOW_SIZE = windowSize; - pointPrecomputes.delete(this); - } - hasEvenY() { - return this.y % _2n === _0n; - } - static fromCompressedHex(bytes) { - const isShort = bytes.length === 32; - const x = bytesToNumber(isShort ? bytes : bytes.subarray(1)); - if (!isValidFieldElement(x)) - throw new Error('Point is not on curve'); - const y2 = weierstrass(x); - let y = sqrtMod(y2); - const isYOdd = (y & _1n) === _1n; - if (isShort) { - if (isYOdd) - y = mod(-y); - } - else { - const isFirstByteOdd = (bytes[0] & 1) === 1; - if (isFirstByteOdd !== isYOdd) - y = mod(-y); - } - const point = new Point(x, y); - point.assertValidity(); - return point; - } - static fromUncompressedHex(bytes) { - const x = bytesToNumber(bytes.subarray(1, fieldLen + 1)); - const y = bytesToNumber(bytes.subarray(fieldLen + 1, fieldLen * 2 + 1)); - const point = new Point(x, y); - point.assertValidity(); - return point; - } - static fromHex(hex) { - const bytes = ensureBytes(hex); - const len = bytes.length; - const header = bytes[0]; - if (len === fieldLen) - return this.fromCompressedHex(bytes); - if (len === compressedLen && (header === 0x02 || header === 0x03)) { - return this.fromCompressedHex(bytes); - } - if (len === uncompressedLen && header === 0x04) - return this.fromUncompressedHex(bytes); - throw new Error(`Point.fromHex: received invalid point. Expected 32-${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes, not ${len}`); - } - static fromPrivateKey(privateKey) { - return Point.BASE.multiply(normalizePrivateKey(privateKey)); - } - static fromSignature(msgHash, signature, recovery) { - const { r, s } = normalizeSignature(signature); - if (![0, 1, 2, 3].includes(recovery)) - throw new Error('Cannot recover: invalid recovery bit'); - const h = truncateHash(ensureBytes(msgHash)); - const { n } = CURVE; - const radj = recovery === 2 || recovery === 3 ? r + n : r; - const rinv = invert(radj, n); - const u1 = mod(-h * rinv, n); - const u2 = mod(s * rinv, n); - const prefix = recovery & 1 ? '03' : '02'; - const R = Point.fromHex(prefix + numTo32bStr(radj)); - const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); - if (!Q) - throw new Error('Cannot recover signature: point at infinify'); - Q.assertValidity(); - return Q; - } - toRawBytes(isCompressed = false) { - return hexToBytes(this.toHex(isCompressed)); - } - toHex(isCompressed = false) { - const x = numTo32bStr(this.x); - if (isCompressed) { - const prefix = this.hasEvenY() ? '02' : '03'; - return `${prefix}${x}`; - } - else { - return `04${x}${numTo32bStr(this.y)}`; - } - } - toHexX() { - return this.toHex(true).slice(2); - } - toRawX() { - return this.toRawBytes(true).slice(1); - } - assertValidity() { - const msg = 'Point is not on elliptic curve'; - const { x, y } = this; - if (!isValidFieldElement(x) || !isValidFieldElement(y)) - throw new Error(msg); - const left = mod(y * y); - const right = weierstrass(x); - if (mod(left - right) !== _0n) - throw new Error(msg); - } - equals(other) { - return this.x === other.x && this.y === other.y; - } - negate() { - return new Point(this.x, mod(-this.y)); - } - double() { - return JacobianPoint.fromAffine(this).double().toAffine(); - } - add(other) { - return JacobianPoint.fromAffine(this).add(JacobianPoint.fromAffine(other)).toAffine(); - } - subtract(other) { - return this.add(other.negate()); - } - multiply(scalar) { - return JacobianPoint.fromAffine(this).multiply(scalar, this).toAffine(); - } - multiplyAndAddUnsafe(Q, a, b) { - const P = JacobianPoint.fromAffine(this); - const aP = a === _0n || a === _1n || this !== Point.BASE ? P.multiplyUnsafe(a) : P.multiply(a); - const bQ = JacobianPoint.fromAffine(Q).multiplyUnsafe(b); - const sum = aP.add(bQ); - return sum.equals(JacobianPoint.ZERO) ? undefined : sum.toAffine(); - } -} -exports.Point = Point; -Point.BASE = new Point(CURVE.Gx, CURVE.Gy); -Point.ZERO = new Point(_0n, _0n); -function sliceDER(s) { - return Number.parseInt(s[0], 16) >= 8 ? '00' + s : s; -} -function parseDERInt(data) { - if (data.length < 2 || data[0] !== 0x02) { - throw new Error(`Invalid signature integer tag: ${bytesToHex(data)}`); - } - const len = data[1]; - const res = data.subarray(2, len + 2); - if (!len || res.length !== len) { - throw new Error(`Invalid signature integer: wrong length`); - } - if (res[0] === 0x00 && res[1] <= 0x7f) { - throw new Error('Invalid signature integer: trailing length'); - } - return { data: bytesToNumber(res), left: data.subarray(len + 2) }; -} -function parseDERSignature(data) { - if (data.length < 2 || data[0] != 0x30) { - throw new Error(`Invalid signature tag: ${bytesToHex(data)}`); - } - if (data[1] !== data.length - 2) { - throw new Error('Invalid signature: incorrect length'); - } - const { data: r, left: sBytes } = parseDERInt(data.subarray(2)); - const { data: s, left: rBytesLeft } = parseDERInt(sBytes); - if (rBytesLeft.length) { - throw new Error(`Invalid signature: left bytes after parsing: ${bytesToHex(rBytesLeft)}`); - } - return { r, s }; -} -class Signature { - constructor(r, s) { - this.r = r; - this.s = s; - this.assertValidity(); - } - static fromCompact(hex) { - const arr = hex instanceof Uint8Array; - const name = 'Signature.fromCompact'; - if (typeof hex !== 'string' && !arr) - throw new TypeError(`${name}: Expected string or Uint8Array`); - const str = arr ? bytesToHex(hex) : hex; - if (str.length !== 128) - throw new Error(`${name}: Expected 64-byte hex`); - return new Signature(hexToNumber(str.slice(0, 64)), hexToNumber(str.slice(64, 128))); - } - static fromDER(hex) { - const arr = hex instanceof Uint8Array; - if (typeof hex !== 'string' && !arr) - throw new TypeError(`Signature.fromDER: Expected string or Uint8Array`); - const { r, s } = parseDERSignature(arr ? hex : hexToBytes(hex)); - return new Signature(r, s); - } - static fromHex(hex) { - return this.fromDER(hex); - } - assertValidity() { - const { r, s } = this; - if (!isWithinCurveOrder(r)) - throw new Error('Invalid Signature: r must be 0 < r < n'); - if (!isWithinCurveOrder(s)) - throw new Error('Invalid Signature: s must be 0 < s < n'); - } - hasHighS() { - const HALF = CURVE.n >> _1n; - return this.s > HALF; - } - normalizeS() { - return this.hasHighS() ? new Signature(this.r, mod(-this.s, CURVE.n)) : this; - } - toDERRawBytes() { - return hexToBytes(this.toDERHex()); - } - toDERHex() { - const sHex = sliceDER(numberToHexUnpadded(this.s)); - const rHex = sliceDER(numberToHexUnpadded(this.r)); - const sHexL = sHex.length / 2; - const rHexL = rHex.length / 2; - const sLen = numberToHexUnpadded(sHexL); - const rLen = numberToHexUnpadded(rHexL); - const length = numberToHexUnpadded(rHexL + sHexL + 4); - return `30${length}02${rLen}${rHex}02${sLen}${sHex}`; - } - toRawBytes() { - return this.toDERRawBytes(); - } - toHex() { - return this.toDERHex(); - } - toCompactRawBytes() { - return hexToBytes(this.toCompactHex()); - } - toCompactHex() { - return numTo32bStr(this.r) + numTo32bStr(this.s); - } -} -exports.Signature = Signature; -function concatBytes(...arrays) { - if (!arrays.every((b) => b instanceof Uint8Array)) - throw new Error('Uint8Array list expected'); - if (arrays.length === 1) - return arrays[0]; - const length = arrays.reduce((a, arr) => a + arr.length, 0); - const result = new Uint8Array(length); - for (let i = 0, pad = 0; i < arrays.length; i++) { - const arr = arrays[i]; - result.set(arr, pad); - pad += arr.length; - } - return result; -} -const hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, '0')); -function bytesToHex(uint8a) { - if (!(uint8a instanceof Uint8Array)) - throw new Error('Expected Uint8Array'); - let hex = ''; - for (let i = 0; i < uint8a.length; i++) { - hex += hexes[uint8a[i]]; - } - return hex; -} -const POW_2_256 = BigInt('0x10000000000000000000000000000000000000000000000000000000000000000'); -function numTo32bStr(num) { - if (typeof num !== 'bigint') - throw new Error('Expected bigint'); - if (!(_0n <= num && num < POW_2_256)) - throw new Error('Expected number 0 <= n < 2^256'); - return num.toString(16).padStart(64, '0'); -} -function numTo32b(num) { - const b = hexToBytes(numTo32bStr(num)); - if (b.length !== 32) - throw new Error('Error: expected 32 bytes'); - return b; -} -function numberToHexUnpadded(num) { - const hex = num.toString(16); - return hex.length & 1 ? `0${hex}` : hex; -} -function hexToNumber(hex) { - if (typeof hex !== 'string') { - throw new TypeError('hexToNumber: expected string, got ' + typeof hex); - } - return BigInt(`0x${hex}`); -} -function hexToBytes(hex) { - if (typeof hex !== 'string') { - throw new TypeError('hexToBytes: expected string, got ' + typeof hex); - } - if (hex.length % 2) - throw new Error('hexToBytes: received invalid unpadded hex' + hex.length); - const array = new Uint8Array(hex.length / 2); - for (let i = 0; i < array.length; i++) { - const j = i * 2; - const hexByte = hex.slice(j, j + 2); - const byte = Number.parseInt(hexByte, 16); - if (Number.isNaN(byte) || byte < 0) - throw new Error('Invalid byte sequence'); - array[i] = byte; - } - return array; -} -function bytesToNumber(bytes) { - return hexToNumber(bytesToHex(bytes)); -} -function ensureBytes(hex) { - return hex instanceof Uint8Array ? Uint8Array.from(hex) : hexToBytes(hex); -} -function normalizeScalar(num) { - if (typeof num === 'number' && Number.isSafeInteger(num) && num > 0) - return BigInt(num); - if (typeof num === 'bigint' && isWithinCurveOrder(num)) - return num; - throw new TypeError('Expected valid private scalar: 0 < scalar < curve.n'); -} -function mod(a, b = CURVE.P) { - const result = a % b; - return result >= _0n ? result : b + result; -} -function pow2(x, power) { - const { P } = CURVE; - let res = x; - while (power-- > _0n) { - res *= res; - res %= P; - } - return res; -} -function sqrtMod(x) { - const { P } = CURVE; - const _6n = BigInt(6); - const _11n = BigInt(11); - const _22n = BigInt(22); - const _23n = BigInt(23); - const _44n = BigInt(44); - const _88n = BigInt(88); - const b2 = (x * x * x) % P; - const b3 = (b2 * b2 * x) % P; - const b6 = (pow2(b3, _3n) * b3) % P; - const b9 = (pow2(b6, _3n) * b3) % P; - const b11 = (pow2(b9, _2n) * b2) % P; - const b22 = (pow2(b11, _11n) * b11) % P; - const b44 = (pow2(b22, _22n) * b22) % P; - const b88 = (pow2(b44, _44n) * b44) % P; - const b176 = (pow2(b88, _88n) * b88) % P; - const b220 = (pow2(b176, _44n) * b44) % P; - const b223 = (pow2(b220, _3n) * b3) % P; - const t1 = (pow2(b223, _23n) * b22) % P; - const t2 = (pow2(t1, _6n) * b2) % P; - const rt = pow2(t2, _2n); - const xc = (rt * rt) % P; - if (xc !== x) - throw new Error('Cannot find square root'); - return rt; -} -function invert(number, modulo = CURVE.P) { - if (number === _0n || modulo <= _0n) { - throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`); - } - let a = mod(number, modulo); - let b = modulo; - let x = _0n, y = _1n, u = _1n, v = _0n; - while (a !== _0n) { - const q = b / a; - const r = b % a; - const m = x - u * q; - const n = y - v * q; - b = a, a = r, x = u, y = v, u = m, v = n; - } - const gcd = b; - if (gcd !== _1n) - throw new Error('invert: does not exist'); - return mod(x, modulo); -} -function invertBatch(nums, p = CURVE.P) { - const scratch = new Array(nums.length); - const lastMultiplied = nums.reduce((acc, num, i) => { - if (num === _0n) - return acc; - scratch[i] = acc; - return mod(acc * num, p); - }, _1n); - const inverted = invert(lastMultiplied, p); - nums.reduceRight((acc, num, i) => { - if (num === _0n) - return acc; - scratch[i] = mod(acc * scratch[i], p); - return mod(acc * num, p); - }, inverted); - return scratch; -} -function bits2int_2(bytes) { - const delta = bytes.length * 8 - groupLen * 8; - const num = bytesToNumber(bytes); - return delta > 0 ? num >> BigInt(delta) : num; -} -function truncateHash(hash, truncateOnly = false) { - const h = bits2int_2(hash); - if (truncateOnly) - return h; - const { n } = CURVE; - return h >= n ? h - n : h; -} -let _sha256Sync; -let _hmacSha256Sync; -class HmacDrbg { - constructor(hashLen, qByteLen) { - this.hashLen = hashLen; - this.qByteLen = qByteLen; - if (typeof hashLen !== 'number' || hashLen < 2) - throw new Error('hashLen must be a number'); - if (typeof qByteLen !== 'number' || qByteLen < 2) - throw new Error('qByteLen must be a number'); - this.v = new Uint8Array(hashLen).fill(1); - this.k = new Uint8Array(hashLen).fill(0); - this.counter = 0; - } - hmac(...values) { - return exports.utils.hmacSha256(this.k, ...values); - } - hmacSync(...values) { - return _hmacSha256Sync(this.k, ...values); - } - checkSync() { - if (typeof _hmacSha256Sync !== 'function') - throw new ShaError('hmacSha256Sync needs to be set'); - } - incr() { - if (this.counter >= 1000) - throw new Error('Tried 1,000 k values for sign(), all were invalid'); - this.counter += 1; - } - async reseed(seed = new Uint8Array()) { - this.k = await this.hmac(this.v, Uint8Array.from([0x00]), seed); - this.v = await this.hmac(this.v); - if (seed.length === 0) - return; - this.k = await this.hmac(this.v, Uint8Array.from([0x01]), seed); - this.v = await this.hmac(this.v); - } - reseedSync(seed = new Uint8Array()) { - this.checkSync(); - this.k = this.hmacSync(this.v, Uint8Array.from([0x00]), seed); - this.v = this.hmacSync(this.v); - if (seed.length === 0) - return; - this.k = this.hmacSync(this.v, Uint8Array.from([0x01]), seed); - this.v = this.hmacSync(this.v); - } - async generate() { - this.incr(); - let len = 0; - const out = []; - while (len < this.qByteLen) { - this.v = await this.hmac(this.v); - const sl = this.v.slice(); - out.push(sl); - len += this.v.length; - } - return concatBytes(...out); - } - generateSync() { - this.checkSync(); - this.incr(); - let len = 0; - const out = []; - while (len < this.qByteLen) { - this.v = this.hmacSync(this.v); - const sl = this.v.slice(); - out.push(sl); - len += this.v.length; - } - return concatBytes(...out); - } -} -function isWithinCurveOrder(num) { - return _0n < num && num < CURVE.n; -} -function isValidFieldElement(num) { - return _0n < num && num < CURVE.P; -} -function kmdToSig(kBytes, m, d, lowS = true) { - const { n } = CURVE; - const k = truncateHash(kBytes, true); - if (!isWithinCurveOrder(k)) - return; - const kinv = invert(k, n); - const q = Point.BASE.multiply(k); - const r = mod(q.x, n); - if (r === _0n) - return; - const s = mod(kinv * mod(m + d * r, n), n); - if (s === _0n) - return; - let sig = new Signature(r, s); - let recovery = (q.x === sig.r ? 0 : 2) | Number(q.y & _1n); - if (lowS && sig.hasHighS()) { - sig = sig.normalizeS(); - recovery ^= 1; - } - return { sig, recovery }; -} -function normalizePrivateKey(key) { - let num; - if (typeof key === 'bigint') { - num = key; - } - else if (typeof key === 'number' && Number.isSafeInteger(key) && key > 0) { - num = BigInt(key); - } - else if (typeof key === 'string') { - if (key.length !== 2 * groupLen) - throw new Error('Expected 32 bytes of private key'); - num = hexToNumber(key); - } - else if (key instanceof Uint8Array) { - if (key.length !== groupLen) - throw new Error('Expected 32 bytes of private key'); - num = bytesToNumber(key); - } - else { - throw new TypeError('Expected valid private key'); - } - if (!isWithinCurveOrder(num)) - throw new Error('Expected private key: 0 < key < n'); - return num; -} -function normalizePublicKey(publicKey) { - if (publicKey instanceof Point) { - publicKey.assertValidity(); - return publicKey; - } - else { - return Point.fromHex(publicKey); - } -} -function normalizeSignature(signature) { - if (signature instanceof Signature) { - signature.assertValidity(); - return signature; - } - try { - return Signature.fromDER(signature); - } - catch (error) { - return Signature.fromCompact(signature); - } -} -function getPublicKey(privateKey, isCompressed = false) { - return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed); -} -exports.getPublicKey = getPublicKey; -function recoverPublicKey(msgHash, signature, recovery, isCompressed = false) { - return Point.fromSignature(msgHash, signature, recovery).toRawBytes(isCompressed); -} -exports.recoverPublicKey = recoverPublicKey; -function isProbPub(item) { - const arr = item instanceof Uint8Array; - const str = typeof item === 'string'; - const len = (arr || str) && item.length; - if (arr) - return len === compressedLen || len === uncompressedLen; - if (str) - return len === compressedLen * 2 || len === uncompressedLen * 2; - if (item instanceof Point) - return true; - return false; -} -function getSharedSecret(privateA, publicB, isCompressed = false) { - if (isProbPub(privateA)) - throw new TypeError('getSharedSecret: first arg must be private key'); - if (!isProbPub(publicB)) - throw new TypeError('getSharedSecret: second arg must be public key'); - const b = normalizePublicKey(publicB); - b.assertValidity(); - return b.multiply(normalizePrivateKey(privateA)).toRawBytes(isCompressed); -} -exports.getSharedSecret = getSharedSecret; -function bits2int(bytes) { - const slice = bytes.length > fieldLen ? bytes.slice(0, fieldLen) : bytes; - return bytesToNumber(slice); -} -function bits2octets(bytes) { - const z1 = bits2int(bytes); - const z2 = mod(z1, CURVE.n); - return int2octets(z2 < _0n ? z1 : z2); -} -function int2octets(num) { - return numTo32b(num); -} -function initSigArgs(msgHash, privateKey, extraEntropy) { - if (msgHash == null) - throw new Error(`sign: expected valid message hash, not "${msgHash}"`); - const h1 = ensureBytes(msgHash); - const d = normalizePrivateKey(privateKey); - const seedArgs = [int2octets(d), bits2octets(h1)]; - if (extraEntropy != null) { - if (extraEntropy === true) - extraEntropy = exports.utils.randomBytes(fieldLen); - const e = ensureBytes(extraEntropy); - if (e.length !== fieldLen) - throw new Error(`sign: Expected ${fieldLen} bytes of extra data`); - seedArgs.push(e); - } - const seed = concatBytes(...seedArgs); - const m = bits2int(h1); - return { seed, m, d }; -} -function finalizeSig(recSig, opts) { - const { sig, recovery } = recSig; - const { der, recovered } = Object.assign({ canonical: true, der: true }, opts); - const hashed = der ? sig.toDERRawBytes() : sig.toCompactRawBytes(); - return recovered ? [hashed, recovery] : hashed; -} -async function sign(msgHash, privKey, opts = {}) { - const { seed, m, d } = initSigArgs(msgHash, privKey, opts.extraEntropy); - const drbg = new HmacDrbg(hashLen, groupLen); - await drbg.reseed(seed); - let sig; - while (!(sig = kmdToSig(await drbg.generate(), m, d, opts.canonical))) - await drbg.reseed(); - return finalizeSig(sig, opts); -} -exports.sign = sign; -function signSync(msgHash, privKey, opts = {}) { - const { seed, m, d } = initSigArgs(msgHash, privKey, opts.extraEntropy); - const drbg = new HmacDrbg(hashLen, groupLen); - drbg.reseedSync(seed); - let sig; - while (!(sig = kmdToSig(drbg.generateSync(), m, d, opts.canonical))) - drbg.reseedSync(); - return finalizeSig(sig, opts); -} -exports.signSync = signSync; -const vopts = { strict: true }; -function verify(signature, msgHash, publicKey, opts = vopts) { - let sig; - try { - sig = normalizeSignature(signature); - msgHash = ensureBytes(msgHash); - } - catch (error) { - return false; - } - const { r, s } = sig; - if (opts.strict && sig.hasHighS()) - return false; - const h = truncateHash(msgHash); - let P; - try { - P = normalizePublicKey(publicKey); - } - catch (error) { - return false; - } - const { n } = CURVE; - const sinv = invert(s, n); - const u1 = mod(h * sinv, n); - const u2 = mod(r * sinv, n); - const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2); - if (!R) - return false; - const v = mod(R.x, n); - return v === r; -} -exports.verify = verify; -function schnorrChallengeFinalize(ch) { - return mod(bytesToNumber(ch), CURVE.n); -} -class SchnorrSignature { - constructor(r, s) { - this.r = r; - this.s = s; - this.assertValidity(); - } - static fromHex(hex) { - const bytes = ensureBytes(hex); - if (bytes.length !== 64) - throw new TypeError(`SchnorrSignature.fromHex: expected 64 bytes, not ${bytes.length}`); - const r = bytesToNumber(bytes.subarray(0, 32)); - const s = bytesToNumber(bytes.subarray(32, 64)); - return new SchnorrSignature(r, s); - } - assertValidity() { - const { r, s } = this; - if (!isValidFieldElement(r) || !isWithinCurveOrder(s)) - throw new Error('Invalid signature'); - } - toHex() { - return numTo32bStr(this.r) + numTo32bStr(this.s); - } - toRawBytes() { - return hexToBytes(this.toHex()); - } -} -function schnorrGetPublicKey(privateKey) { - return Point.fromPrivateKey(privateKey).toRawX(); -} -class InternalSchnorrSignature { - constructor(message, privateKey, auxRand = exports.utils.randomBytes()) { - if (message == null) - throw new TypeError(`sign: Expected valid message, not "${message}"`); - this.m = ensureBytes(message); - const { x, scalar } = this.getScalar(normalizePrivateKey(privateKey)); - this.px = x; - this.d = scalar; - this.rand = ensureBytes(auxRand); - if (this.rand.length !== 32) - throw new TypeError('sign: Expected 32 bytes of aux randomness'); - } - getScalar(priv) { - const point = Point.fromPrivateKey(priv); - const scalar = point.hasEvenY() ? priv : CURVE.n - priv; - return { point, scalar, x: point.toRawX() }; - } - initNonce(d, t0h) { - return numTo32b(d ^ bytesToNumber(t0h)); - } - finalizeNonce(k0h) { - const k0 = mod(bytesToNumber(k0h), CURVE.n); - if (k0 === _0n) - throw new Error('sign: Creation of signature failed. k is zero'); - const { point: R, x: rx, scalar: k } = this.getScalar(k0); - return { R, rx, k }; - } - finalizeSig(R, k, e, d) { - return new SchnorrSignature(R.x, mod(k + e * d, CURVE.n)).toRawBytes(); - } - error() { - throw new Error('sign: Invalid signature produced'); - } - async calc() { - const { m, d, px, rand } = this; - const tag = exports.utils.taggedHash; - const t = this.initNonce(d, await tag(TAGS.aux, rand)); - const { R, rx, k } = this.finalizeNonce(await tag(TAGS.nonce, t, px, m)); - const e = schnorrChallengeFinalize(await tag(TAGS.challenge, rx, px, m)); - const sig = this.finalizeSig(R, k, e, d); - if (!(await schnorrVerify(sig, m, px))) - this.error(); - return sig; - } - calcSync() { - const { m, d, px, rand } = this; - const tag = exports.utils.taggedHashSync; - const t = this.initNonce(d, tag(TAGS.aux, rand)); - const { R, rx, k } = this.finalizeNonce(tag(TAGS.nonce, t, px, m)); - const e = schnorrChallengeFinalize(tag(TAGS.challenge, rx, px, m)); - const sig = this.finalizeSig(R, k, e, d); - if (!schnorrVerifySync(sig, m, px)) - this.error(); - return sig; - } -} -async function schnorrSign(msg, privKey, auxRand) { - return new InternalSchnorrSignature(msg, privKey, auxRand).calc(); -} -function schnorrSignSync(msg, privKey, auxRand) { - return new InternalSchnorrSignature(msg, privKey, auxRand).calcSync(); -} -function initSchnorrVerify(signature, message, publicKey) { - const raw = signature instanceof SchnorrSignature; - const sig = raw ? signature : SchnorrSignature.fromHex(signature); - if (raw) - sig.assertValidity(); - return { - ...sig, - m: ensureBytes(message), - P: normalizePublicKey(publicKey), - }; -} -function finalizeSchnorrVerify(r, P, s, e) { - const R = Point.BASE.multiplyAndAddUnsafe(P, normalizePrivateKey(s), mod(-e, CURVE.n)); - if (!R || !R.hasEvenY() || R.x !== r) - return false; - return true; -} -async function schnorrVerify(signature, message, publicKey) { - try { - const { r, s, m, P } = initSchnorrVerify(signature, message, publicKey); - const e = schnorrChallengeFinalize(await exports.utils.taggedHash(TAGS.challenge, numTo32b(r), P.toRawX(), m)); - return finalizeSchnorrVerify(r, P, s, e); - } - catch (error) { - return false; - } -} -function schnorrVerifySync(signature, message, publicKey) { - try { - const { r, s, m, P } = initSchnorrVerify(signature, message, publicKey); - const e = schnorrChallengeFinalize(exports.utils.taggedHashSync(TAGS.challenge, numTo32b(r), P.toRawX(), m)); - return finalizeSchnorrVerify(r, P, s, e); - } - catch (error) { - if (error instanceof ShaError) - throw error; - return false; - } -} -exports.schnorr = { - Signature: SchnorrSignature, - getPublicKey: schnorrGetPublicKey, - sign: schnorrSign, - verify: schnorrVerify, - signSync: schnorrSignSync, - verifySync: schnorrVerifySync, -}; -Point.BASE._setWindowSize(8); -const crypto = { - node: nodeCrypto, - web: typeof self === 'object' && 'crypto' in self ? self.crypto : undefined, -}; -const TAGS = { - challenge: 'BIP0340/challenge', - aux: 'BIP0340/aux', - nonce: 'BIP0340/nonce', -}; -const TAGGED_HASH_PREFIXES = {}; -exports.utils = { - bytesToHex, - hexToBytes, - concatBytes, - mod, - invert, - isValidPrivateKey(privateKey) { - try { - normalizePrivateKey(privateKey); - return true; - } - catch (error) { - return false; - } - }, - _bigintTo32Bytes: numTo32b, - _normalizePrivateKey: normalizePrivateKey, - hashToPrivateKey: (hash) => { - hash = ensureBytes(hash); - const minLen = groupLen + 8; - if (hash.length < minLen || hash.length > 1024) { - throw new Error(`Expected valid bytes of private key as per FIPS 186`); - } - const num = mod(bytesToNumber(hash), CURVE.n - _1n) + _1n; - return numTo32b(num); - }, - randomBytes: (bytesLength = 32) => { - if (crypto.web) { - return crypto.web.getRandomValues(new Uint8Array(bytesLength)); - } - else if (crypto.node) { - const { randomBytes } = crypto.node; - return Uint8Array.from(randomBytes(bytesLength)); - } - else { - throw new Error("The environment doesn't have randomBytes function"); - } - }, - randomPrivateKey: () => exports.utils.hashToPrivateKey(exports.utils.randomBytes(groupLen + 8)), - precompute(windowSize = 8, point = Point.BASE) { - const cached = point === Point.BASE ? point : new Point(point.x, point.y); - cached._setWindowSize(windowSize); - cached.multiply(_3n); - return cached; - }, - sha256: async (...messages) => { - if (crypto.web) { - const buffer = await crypto.web.subtle.digest('SHA-256', concatBytes(...messages)); - return new Uint8Array(buffer); - } - else if (crypto.node) { - const { createHash } = crypto.node; - const hash = createHash('sha256'); - messages.forEach((m) => hash.update(m)); - return Uint8Array.from(hash.digest()); - } - else { - throw new Error("The environment doesn't have sha256 function"); - } - }, - hmacSha256: async (key, ...messages) => { - if (crypto.web) { - const ckey = await crypto.web.subtle.importKey('raw', key, { name: 'HMAC', hash: { name: 'SHA-256' } }, false, ['sign']); - const message = concatBytes(...messages); - const buffer = await crypto.web.subtle.sign('HMAC', ckey, message); - return new Uint8Array(buffer); - } - else if (crypto.node) { - const { createHmac } = crypto.node; - const hash = createHmac('sha256', key); - messages.forEach((m) => hash.update(m)); - return Uint8Array.from(hash.digest()); - } - else { - throw new Error("The environment doesn't have hmac-sha256 function"); - } - }, - sha256Sync: undefined, - hmacSha256Sync: undefined, -<<<<<<< HEAD - taggedHash: async (tag, ...messages) => { - let tagP = TAGGED_HASH_PREFIXES[tag]; - if (tagP === undefined) { - const tagH = await exports.utils.sha256(Uint8Array.from(tag, (c) => c.charCodeAt(0))); - tagP = concatBytes(tagH, tagH); - TAGGED_HASH_PREFIXES[tag] = tagP; -======= - precompute(windowSize = 8, point = Point.BASE) { - const cached = point === Point.BASE ? point : new Point(point.x, point.y); - cached._setWindowSize(windowSize); - cached.multiply(_3n); - return cached; - }, -}; - - -/***/ }), - -/***/ 79597: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -async function auth(token) { - const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth"; - return { - type: "token", - token: token, - tokenType - }; -} - -/** - * Prefix token for usage in the Authorization header - * - * @param token OAuth token or JSON Web Token - */ -function withAuthorizationPrefix(token) { - if (token.split(/\./).length === 3) { - return `bearer ${token}`; - } - - return `token ${token}`; -} - -async function hook(token, request, route, parameters) { - const endpoint = request.endpoint.merge(route, parameters); - endpoint.headers.authorization = withAuthorizationPrefix(token); - return request(endpoint); -} - -const createTokenAuth = function createTokenAuth(token) { - if (!token) { - throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); - } - - if (typeof token !== "string") { - throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string"); - } - - token = token.replace(/^(token|bearer) +/i, ""); - return Object.assign(auth.bind(null, token), { - hook: hook.bind(null, token) - }); -}; - -exports.createTokenAuth = createTokenAuth; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 85354: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var universalUserAgent = __nccwpck_require__(35770); -var beforeAfterHook = __nccwpck_require__(83136); -var request = __nccwpck_require__(31131); -var graphql = __nccwpck_require__(89106); -var authToken = __nccwpck_require__(79597); - -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} - -function _objectWithoutProperties(source, excluded) { - if (source == null) return {}; - - var target = _objectWithoutPropertiesLoose(source, excluded); - - var key, i; - - if (Object.getOwnPropertySymbols) { - var sourceSymbolKeys = Object.getOwnPropertySymbols(source); - - for (i = 0; i < sourceSymbolKeys.length; i++) { - key = sourceSymbolKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; - target[key] = source[key]; - } - } - - return target; -} - -const VERSION = "3.6.0"; - -const _excluded = ["authStrategy"]; -class Octokit { - constructor(options = {}) { - const hook = new beforeAfterHook.Collection(); - const requestDefaults = { - baseUrl: request.request.endpoint.DEFAULTS.baseUrl, - headers: {}, - request: Object.assign({}, options.request, { - // @ts-ignore internal usage only, no need to type - hook: hook.bind(null, "request") - }), - mediaType: { - previews: [], - format: "" - } - }; // prepend default user agent with `options.userAgent` if set - - requestDefaults.headers["user-agent"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(" "); - - if (options.baseUrl) { - requestDefaults.baseUrl = options.baseUrl; - } - - if (options.previews) { - requestDefaults.mediaType.previews = options.previews; - } - - if (options.timeZone) { - requestDefaults.headers["time-zone"] = options.timeZone; - } - - this.request = request.request.defaults(requestDefaults); - this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults); - this.log = Object.assign({ - debug: () => {}, - info: () => {}, - warn: console.warn.bind(console), - error: console.error.bind(console) - }, options.log); - this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance - // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered. - // (2) If only `options.auth` is set, use the default token authentication strategy. - // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance. - // TODO: type `options.auth` based on `options.authStrategy`. - - if (!options.authStrategy) { - if (!options.auth) { - // (1) - this.auth = async () => ({ - type: "unauthenticated" - }); - } else { - // (2) - const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\_(ツ)_/¯ - - hook.wrap("request", auth.hook); - this.auth = auth; - } - } else { - const { - authStrategy - } = options, - otherOptions = _objectWithoutProperties(options, _excluded); - - const auth = authStrategy(Object.assign({ - request: this.request, - log: this.log, - // we pass the current octokit instance as well as its constructor options - // to allow for authentication strategies that return a new octokit instance - // that shares the same internal state as the current one. The original - // requirement for this was the "event-octokit" authentication strategy - // of https://github.com/probot/octokit-auth-probot. - octokit: this, - octokitOptions: otherOptions - }, options.auth)); // @ts-ignore ¯\_(ツ)_/¯ - - hook.wrap("request", auth.hook); - this.auth = auth; - } // apply plugins - // https://stackoverflow.com/a/16345172 - - - const classConstructor = this.constructor; - classConstructor.plugins.forEach(plugin => { - Object.assign(this, plugin(this, options)); - }); - } - - static defaults(defaults) { - const OctokitWithDefaults = class extends this { - constructor(...args) { - const options = args[0] || {}; - - if (typeof defaults === "function") { - super(defaults(options)); - return; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - return exports.utils.sha256(tagP, ...messages); - }, - taggedHashSync: (tag, ...messages) => { - if (typeof _sha256Sync !== 'function') - throw new ShaError('sha256Sync is undefined, you need to set it'); - let tagP = TAGGED_HASH_PREFIXES[tag]; - if (tagP === undefined) { - const tagH = _sha256Sync(Uint8Array.from(tag, (c) => c.charCodeAt(0))); - tagP = concatBytes(tagH, tagH); - TAGGED_HASH_PREFIXES[tag] = tagP; - } - return _sha256Sync(tagP, ...messages); - }, - _JacobianPoint: JacobianPoint, -}; -Object.defineProperties(exports.utils, { - sha256Sync: { - configurable: false, - get() { - return _sha256Sync; - }, - set(val) { - if (!_sha256Sync) - _sha256Sync = val; - }, - }, - hmacSha256Sync: { - configurable: false, - get() { - return _hmacSha256Sync; - }, - set(val) { - if (!_hmacSha256Sync) - _hmacSha256Sync = val; - }, - }, -}); - - -/***/ }), - -<<<<<<< HEAD -/***/ 12510: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -======= -/***/ 89106: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -<<<<<<< HEAD -// pkg/dist-src/index.js -var dist_src_exports = {}; -__export(dist_src_exports, { - GraphqlResponseError: () => GraphqlResponseError, - graphql: () => graphql2, - withCustomRequest: () => withCustomRequest -}); -module.exports = __toCommonJS(dist_src_exports); -var import_request3 = __nccwpck_require__(21790); -var import_universal_user_agent = __nccwpck_require__(60031); -======= -var request = __nccwpck_require__(31131); -var universalUserAgent = __nccwpck_require__(35770); - -const VERSION = "4.6.4"; - -class GraphqlError extends Error { - constructor(request, response) { - const message = response.data.errors[0].message; - super(message); - Object.assign(this, response.data); - Object.assign(this, { - headers: response.headers - }); - this.name = "GraphqlError"; - this.request = request; // Maintains proper stack trace (only available on V8) - - /* istanbul ignore next */ - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - } - -} - -const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query", "mediaType"]; -const FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"]; -const GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; -function graphql(request, query, options) { - if (options) { - if (typeof query === "string" && "query" in options) { - return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`)); - } - - for (const key in options) { - if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue; - return Promise.reject(new Error(`[@octokit/graphql] "${key}" cannot be used as variable name`)); - } - } - - const parsedOptions = typeof query === "string" ? Object.assign({ - query - }, options) : query; - const requestOptions = Object.keys(parsedOptions).reduce((result, key) => { - if (NON_VARIABLE_OPTIONS.includes(key)) { - result[key] = parsedOptions[key]; - return result; - } - - if (!result.variables) { - result.variables = {}; - } - - result.variables[key] = parsedOptions[key]; - return result; - }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix - // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451 - - const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl; - - if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) { - requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); - } - - return request(requestOptions).then(response => { - if (response.data.errors) { - const headers = {}; - - for (const key of Object.keys(response.headers)) { - headers[key] = response.headers[key]; - } - - throw new GraphqlError(requestOptions, { - headers, - data: response.data - }); - } - - return response.data.data; - }); -} - -function withDefaults(request$1, newDefaults) { - const newRequest = request$1.defaults(newDefaults); - - const newApi = (query, options) => { - return graphql(newRequest, query, options); - }; - - return Object.assign(newApi, { - defaults: withDefaults.bind(null, newRequest), - endpoint: request.request.endpoint - }); -} - -const graphql$1 = withDefaults(request.request, { - headers: { - "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}` - }, - method: "POST", - url: "/graphql" -}); -function withCustomRequest(customRequest) { - return withDefaults(customRequest, { - method: "POST", - url: "/graphql" - }); -} - -exports.graphql = graphql$1; -exports.withCustomRequest = withCustomRequest; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 83136: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var register = __nccwpck_require__(22239) -var addHook = __nccwpck_require__(96352) -var removeHook = __nccwpck_require__(77312) - -// bind with array of arguments: https://stackoverflow.com/a/21792913 -var bind = Function.bind -var bindable = bind.bind(bind) - -function bindApi (hook, state, name) { - var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state]) - hook.api = { remove: removeHookRef } - hook.remove = removeHookRef - - ;['before', 'error', 'after', 'wrap'].forEach(function (kind) { - var args = name ? [state, kind, name] : [state, kind] - hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args) - }) -} - -function HookSingular () { - var singularHookName = 'h' - var singularHookState = { - registry: {} - } - var singularHook = register.bind(null, singularHookState, singularHookName) - bindApi(singularHook, singularHookState, singularHookName) - return singularHook -} - -function HookCollection () { - var state = { - registry: {} - } - - var hook = register.bind(null, state) - bindApi(hook, state) - - return hook -} - -var collectionHookDeprecationMessageDisplayed = false -function Hook () { - if (!collectionHookDeprecationMessageDisplayed) { - console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4') - collectionHookDeprecationMessageDisplayed = true - } - return HookCollection() -} - -Hook.Singular = HookSingular.bind() -Hook.Collection = HookCollection.bind() - -module.exports = Hook -// expose constructors as a named property for TypeScript -module.exports.Hook = Hook -module.exports.Singular = Hook.Singular -module.exports.Collection = Hook.Collection - - -/***/ }), - -/***/ 96352: -/***/ ((module) => { - -module.exports = addHook; - -function addHook(state, kind, name, hook) { - var orig = hook; - if (!state.registry[name]) { - state.registry[name] = []; - } - - if (kind === "before") { - hook = function (method, options) { - return Promise.resolve() - .then(orig.bind(null, options)) - .then(method.bind(null, options)); - }; - } - - if (kind === "after") { - hook = function (method, options) { - var result; - return Promise.resolve() - .then(method.bind(null, options)) - .then(function (result_) { - result = result_; - return orig(result, options); - }) - .then(function () { - return result; - }); - }; - } - - if (kind === "error") { - hook = function (method, options) { - return Promise.resolve() - .then(method.bind(null, options)) - .catch(function (error) { - return orig(error, options); - }); - }; - } - - state.registry[name].push({ - hook: hook, - orig: orig, - }); -} - - -/***/ }), - -/***/ 22239: -/***/ ((module) => { - -module.exports = register; - -function register(state, name, method, options) { - if (typeof method !== "function") { - throw new Error("method for before hook must be a function"); - } - - if (!options) { - options = {}; - } - - if (Array.isArray(name)) { - return name.reverse().reduce(function (callback, name) { - return register.bind(null, state, name, callback, options); - }, method)(); - } - - return Promise.resolve().then(function () { - if (!state.registry[name]) { - return method(options); - } - - return state.registry[name].reduce(function (method, registered) { - return registered.hook.bind(null, method, options); - }, method)(); - }); -} - - -/***/ }), - -/***/ 77312: -/***/ ((module) => { - -module.exports = removeHook; - -function removeHook(state, name, method) { - if (!state.registry[name]) { - return; - } - - var index = state.registry[name] - .map(function (registered) { - return registered.orig; - }) - .indexOf(method); - - if (index === -1) { - return; - } - - state.registry[name].splice(index, 1); -} - - -/***/ }), - -/***/ 96164: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var isPlainObject = __nccwpck_require__(9551); -var universalUserAgent = __nccwpck_require__(35770); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -// pkg/dist-src/version.js -var VERSION = "7.0.2"; - -// pkg/dist-src/with-defaults.js -var import_request2 = __nccwpck_require__(21790); - -// pkg/dist-src/graphql.js -var import_request = __nccwpck_require__(21790); - -// pkg/dist-src/error.js -function _buildMessageForResponseErrors(data) { - return `Request failed due to following response errors: -` + data.errors.map((e) => ` - ${e.message}`).join("\n"); -} -var GraphqlResponseError = class extends Error { - constructor(request2, headers, response) { - super(_buildMessageForResponseErrors(response)); - this.request = request2; - this.headers = headers; - this.response = response; - this.name = "GraphqlResponseError"; - this.errors = response.errors; - this.data = response.data; - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - } -}; - -// pkg/dist-src/graphql.js -var NON_VARIABLE_OPTIONS = [ - "method", - "baseUrl", - "url", - "headers", - "request", - "query", - "mediaType" -]; -var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"]; -var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; -function graphql(request2, query, options) { - if (options) { - if (typeof query === "string" && "query" in options) { - return Promise.reject( - new Error(`[@octokit/graphql] "query" cannot be used as variable name`) - ); - } - for (const key in options) { - if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) - continue; - return Promise.reject( - new Error( - `[@octokit/graphql] "${key}" cannot be used as variable name` - ) - ); - } - } - const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query; - const requestOptions = Object.keys( - parsedOptions - ).reduce((result, key) => { - if (NON_VARIABLE_OPTIONS.includes(key)) { - result[key] = parsedOptions[key]; - return result; - } - if (!result.variables) { - result.variables = {}; - } - result.variables[key] = parsedOptions[key]; - return result; - }, {}); - const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl; - if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) { - requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); - } - return request2(requestOptions).then((response) => { - if (response.data.errors) { - const headers = {}; - for (const key of Object.keys(response.headers)) { - headers[key] = response.headers[key]; - } - throw new GraphqlResponseError( - requestOptions, - headers, - response.data - ); - } - return response.data.data; - }); -} - -// pkg/dist-src/with-defaults.js -function withDefaults(request2, newDefaults) { - const newRequest = request2.defaults(newDefaults); - const newApi = (query, options) => { - return graphql(newRequest, query, options); - }; - return Object.assign(newApi, { - defaults: withDefaults.bind(null, newRequest), - endpoint: newRequest.endpoint - }); -} - -// pkg/dist-src/index.js -var graphql2 = withDefaults(import_request3.request, { - headers: { - "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}` - }, - method: "POST", - url: "/graphql" -}); -function withCustomRequest(customRequest) { - return withDefaults(customRequest, { - method: "POST", - url: "/graphql" - }); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (0); - - -/***/ }), - -/***/ 10103: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// pkg/dist-src/index.js -var dist_src_exports = {}; -__export(dist_src_exports, { - endpoint: () => endpoint -}); -module.exports = __toCommonJS(dist_src_exports); - -// pkg/dist-src/defaults.js -var import_universal_user_agent = __nccwpck_require__(60031); - -// pkg/dist-src/version.js -var VERSION = "9.0.4"; - -// pkg/dist-src/defaults.js -var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`; -var DEFAULTS = { - method: "GET", - baseUrl: "https://api.github.com", - headers: { - accept: "application/vnd.github.v3+json", - "user-agent": userAgent - }, - mediaType: { - format: "" - } -}; - -// pkg/dist-src/util/lowercase-keys.js -function lowercaseKeys(object) { - if (!object) { - return {}; - } - return Object.keys(object).reduce((newObj, key) => { - newObj[key.toLowerCase()] = object[key]; - return newObj; - }, {}); -} - -// pkg/dist-src/util/is-plain-object.js -function isPlainObject(value) { - if (typeof value !== "object" || value === null) - return false; - if (Object.prototype.toString.call(value) !== "[object Object]") - return false; - const proto = Object.getPrototypeOf(value); - if (proto === null) - return true; - const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor; - return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value); -} - -// pkg/dist-src/util/merge-deep.js -function mergeDeep(defaults, options) { - const result = Object.assign({}, defaults); - Object.keys(options).forEach((key) => { - if (isPlainObject(options[key])) { - if (!(key in defaults)) - Object.assign(result, { [key]: options[key] }); - else - result[key] = mergeDeep(defaults[key], options[key]); - } else { - Object.assign(result, { [key]: options[key] }); - } - }); - return result; -} - -// pkg/dist-src/util/remove-undefined-properties.js -function removeUndefinedProperties(obj) { - for (const key in obj) { - if (obj[key] === void 0) { - delete obj[key]; - } - } - return obj; -} - -// pkg/dist-src/merge.js -function merge(defaults, route, options) { - if (typeof route === "string") { - let [method, url] = route.split(" "); - options = Object.assign(url ? { method, url } : { url: method }, options); - } else { - options = Object.assign({}, route); - } - options.headers = lowercaseKeys(options.headers); - removeUndefinedProperties(options); - removeUndefinedProperties(options.headers); - const mergedOptions = mergeDeep(defaults || {}, options); - if (options.url === "/graphql") { - if (defaults && defaults.mediaType.previews?.length) { - mergedOptions.mediaType.previews = defaults.mediaType.previews.filter( - (preview) => !mergedOptions.mediaType.previews.includes(preview) - ).concat(mergedOptions.mediaType.previews); - } - mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, "")); - } - return mergedOptions; -} - -// pkg/dist-src/util/add-query-parameters.js -function addQueryParameters(url, parameters) { - const separator = /\?/.test(url) ? "&" : "?"; - const names = Object.keys(parameters); - if (names.length === 0) { - return url; - } - return url + separator + names.map((name) => { - if (name === "q") { - return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); - } - return `${name}=${encodeURIComponent(parameters[name])}`; - }).join("&"); -} - -// pkg/dist-src/util/extract-url-variable-names.js -var urlVariableRegex = /\{[^}]+\}/g; -function removeNonChars(variableName) { - return variableName.replace(/^\W+|\W+$/g, "").split(/,/); -} -function extractUrlVariableNames(url) { - const matches = url.match(urlVariableRegex); - if (!matches) { - return []; - } - return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []); -} - -// pkg/dist-src/util/omit.js -function omit(object, keysToOmit) { - const result = { __proto__: null }; - for (const key of Object.keys(object)) { - if (keysToOmit.indexOf(key) === -1) { - result[key] = object[key]; - } - } - return result; -} - -// pkg/dist-src/util/url-template.js -function encodeReserved(str) { - return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) { - if (!/%[0-9A-Fa-f]/.test(part)) { - part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]"); - } - return part; - }).join(""); -} -function encodeUnreserved(str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function(c) { - return "%" + c.charCodeAt(0).toString(16).toUpperCase(); - }); -} -function encodeValue(operator, value, key) { - value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value); - if (key) { - return encodeUnreserved(key) + "=" + value; - } else { - return value; - } -} -function isDefined(value) { - return value !== void 0 && value !== null; -} -function isKeyOperator(operator) { - return operator === ";" || operator === "&" || operator === "?"; -} -function getValues(context, operator, key, modifier) { - var value = context[key], result = []; - if (isDefined(value) && value !== "") { - if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { - value = value.toString(); - if (modifier && modifier !== "*") { - value = value.substring(0, parseInt(modifier, 10)); - } - result.push( - encodeValue(operator, value, isKeyOperator(operator) ? key : "") - ); - } else { - if (modifier === "*") { - if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { - result.push( - encodeValue(operator, value2, isKeyOperator(operator) ? key : "") - ); - }); - } else { - Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { - result.push(encodeValue(operator, value[k], k)); - } - }); - } - } else { - const tmp = []; - if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { - tmp.push(encodeValue(operator, value2)); - }); - } else { - Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { - tmp.push(encodeUnreserved(k)); - tmp.push(encodeValue(operator, value[k].toString())); - } - }); - } - if (isKeyOperator(operator)) { - result.push(encodeUnreserved(key) + "=" + tmp.join(",")); - } else if (tmp.length !== 0) { - result.push(tmp.join(",")); - } - } - } - } else { - if (operator === ";") { - if (isDefined(value)) { - result.push(encodeUnreserved(key)); - } - } else if (value === "" && (operator === "&" || operator === "?")) { - result.push(encodeUnreserved(key) + "="); - } else if (value === "") { - result.push(""); - } - } - return result; -} -function parseUrl(template) { - return { - expand: expand.bind(null, template) - }; -} -function expand(template, context) { - var operators = ["+", "#", ".", "/", ";", "?", "&"]; - template = template.replace( - /\{([^\{\}]+)\}|([^\{\}]+)/g, - function(_, expression, literal) { - if (expression) { - let operator = ""; - const values = []; - if (operators.indexOf(expression.charAt(0)) !== -1) { - operator = expression.charAt(0); - expression = expression.substr(1); - } - expression.split(/,/g).forEach(function(variable) { - var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); - values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3])); - }); - if (operator && operator !== "+") { - var separator = ","; - if (operator === "?") { - separator = "&"; - } else if (operator !== "#") { - separator = operator; - } - return (values.length !== 0 ? operator : "") + values.join(separator); - } else { - return values.join(","); - } - } else { - return encodeReserved(literal); - } - } - ); - if (template === "/") { - return template; - } else { - return template.replace(/\/$/, ""); - } -} - -// pkg/dist-src/parse.js -function parse(options) { - let method = options.method.toUpperCase(); - let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); - let headers = Object.assign({}, options.headers); - let body; - let parameters = omit(options, [ - "method", - "baseUrl", - "url", - "headers", - "request", - "mediaType" - ]); - const urlVariableNames = extractUrlVariableNames(url); - url = parseUrl(url).expand(parameters); - if (!/^http/.test(url)) { - url = options.baseUrl + url; - } - const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl"); - const remainingParameters = omit(parameters, omittedParameters); - const isBinaryRequest = /application\/octet-stream/i.test(headers.accept); - if (!isBinaryRequest) { - if (options.mediaType.format) { - headers.accept = headers.accept.split(/,/).map( - (format) => format.replace( - /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, - `application/vnd$1$2.${options.mediaType.format}` - ) - ).join(","); - } - if (url.endsWith("/graphql")) { - if (options.mediaType.previews?.length) { - const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || []; - headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => { - const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; - return `application/vnd.github.${preview}-preview${format}`; - }).join(","); - } - } - } - if (["GET", "HEAD"].includes(method)) { - url = addQueryParameters(url, remainingParameters); - } else { - if ("data" in remainingParameters) { - body = remainingParameters.data; - } else { - if (Object.keys(remainingParameters).length) { - body = remainingParameters; - } - } - } - if (!headers["content-type"] && typeof body !== "undefined") { - headers["content-type"] = "application/json; charset=utf-8"; - } - if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { - body = ""; - } - return Object.assign( - { method, url, headers }, - typeof body !== "undefined" ? { body } : null, - options.request ? { request: options.request } : null - ); -} - -// pkg/dist-src/endpoint-with-defaults.js -function endpointWithDefaults(defaults, route, options) { - return parse(merge(defaults, route, options)); -} - -// pkg/dist-src/with-defaults.js -function withDefaults(oldDefaults, newDefaults) { - const DEFAULTS2 = merge(oldDefaults, newDefaults); - const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2); - return Object.assign(endpoint2, { - DEFAULTS: DEFAULTS2, - defaults: withDefaults.bind(null, DEFAULTS2), - merge: merge.bind(null, DEFAULTS2), - parse - }); -} - -// pkg/dist-src/index.js -var endpoint = withDefaults(null, DEFAULTS); -// Annotate the CommonJS export names for ESM import in node: -0 && (0); - - -/***/ }), - -/***/ 7651: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -<<<<<<< HEAD -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); -======= - -const endpoint = withDefaults(null, DEFAULTS); - -exports.endpoint = endpoint; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 58601: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const VERSION = "2.21.3"; - -function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - enumerableOnly && (symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - })), keys.push.apply(keys, symbols); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -<<<<<<< HEAD -// pkg/dist-src/index.js -var dist_src_exports = {}; -__export(dist_src_exports, { - RequestError: () => RequestError -}); -module.exports = __toCommonJS(dist_src_exports); -var import_deprecation = __nccwpck_require__(40454); -var import_once = __toESM(__nccwpck_require__(56939)); -var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation)); -var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation)); -var RequestError = class extends Error { -======= - return keys; -} - -function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = null != arguments[i] ? arguments[i] : {}; - i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { - _defineProperty(target, key, source[key]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - - return target; -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -/** - * Some “list” response that can be paginated have a different response structure - * - * They have a `total_count` key in the response (search also has `incomplete_results`, - * /installation/repositories also has `repository_selection`), as well as a key with - * the list of the items which name varies from endpoint to endpoint. - * - * Octokit normalizes these responses so that paginated results are always returned following - * the same structure. One challenge is that if the list response has only one page, no Link - * header is provided, so this header alone is not sufficient to check wether a response is - * paginated or not. - * - * We check if a "total_count" key is present in the response data, but also make sure that - * a "url" property is not, as the "Get the combined status for a specific ref" endpoint would - * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref - */ -function normalizePaginatedListResponse(response) { - // endpoints can respond with 204 if repository is empty - if (!response.data) { - return _objectSpread2(_objectSpread2({}, response), {}, { - data: [] - }); - } - - const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data); - if (!responseNeedsNormalization) return response; // keep the additional properties intact as there is currently no other way - // to retrieve the same information. - - const incompleteResults = response.data.incomplete_results; - const repositorySelection = response.data.repository_selection; - const totalCount = response.data.total_count; - delete response.data.incomplete_results; - delete response.data.repository_selection; - delete response.data.total_count; - const namespaceKey = Object.keys(response.data)[0]; - const data = response.data[namespaceKey]; - response.data = data; - - if (typeof incompleteResults !== "undefined") { - response.data.incomplete_results = incompleteResults; - } - - if (typeof repositorySelection !== "undefined") { - response.data.repository_selection = repositorySelection; - } - - response.data.total_count = totalCount; - return response; -} - -function iterator(octokit, route, parameters) { - const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters); - const requestMethod = typeof route === "function" ? route : octokit.request; - const method = options.method; - const headers = options.headers; - let url = options.url; - return { - [Symbol.asyncIterator]: () => ({ - async next() { - if (!url) return { - done: true - }; - - try { - const response = await requestMethod({ - method, - url, - headers - }); - const normalizedResponse = normalizePaginatedListResponse(response); // `response.headers.link` format: - // '; rel="next", ; rel="last"' - // sets `url` to undefined if "next" URL is not present or `link` header is not set - - url = ((normalizedResponse.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1]; - return { - value: normalizedResponse - }; - } catch (error) { - if (error.status !== 409) throw error; - url = ""; - return { - value: { - status: 200, - headers: {}, - data: [] - } - }; - } - } - - }) - }; -} - -function paginate(octokit, route, parameters, mapFn) { - if (typeof parameters === "function") { - mapFn = parameters; - parameters = undefined; - } - - return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn); -} - -function gather(octokit, results, iterator, mapFn) { - return iterator.next().then(result => { - if (result.done) { - return results; - } - - let earlyExit = false; - - function done() { - earlyExit = true; - } - - results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data); - - if (earlyExit) { - return results; - } - - return gather(octokit, results, iterator, mapFn); - }); -} - -const composePaginateRest = Object.assign(paginate, { - iterator -}); - -const paginatingEndpoints = ["GET /app/hook/deliveries", "GET /app/installations", "GET /applications/grants", "GET /authorizations", "GET /enterprises/{enterprise}/actions/permissions/organizations", "GET /enterprises/{enterprise}/actions/runner-groups", "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations", "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners", "GET /enterprises/{enterprise}/actions/runners", "GET /enterprises/{enterprise}/audit-log", "GET /enterprises/{enterprise}/secret-scanning/alerts", "GET /enterprises/{enterprise}/settings/billing/advanced-security", "GET /events", "GET /gists", "GET /gists/public", "GET /gists/starred", "GET /gists/{gist_id}/comments", "GET /gists/{gist_id}/commits", "GET /gists/{gist_id}/forks", "GET /installation/repositories", "GET /issues", "GET /licenses", "GET /marketplace_listing/plans", "GET /marketplace_listing/plans/{plan_id}/accounts", "GET /marketplace_listing/stubbed/plans", "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts", "GET /networks/{owner}/{repo}/events", "GET /notifications", "GET /organizations", "GET /orgs/{org}/actions/cache/usage-by-repository", "GET /orgs/{org}/actions/permissions/repositories", "GET /orgs/{org}/actions/runner-groups", "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories", "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners", "GET /orgs/{org}/actions/runners", "GET /orgs/{org}/actions/secrets", "GET /orgs/{org}/actions/secrets/{secret_name}/repositories", "GET /orgs/{org}/audit-log", "GET /orgs/{org}/blocks", "GET /orgs/{org}/code-scanning/alerts", "GET /orgs/{org}/codespaces", "GET /orgs/{org}/credential-authorizations", "GET /orgs/{org}/dependabot/secrets", "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories", "GET /orgs/{org}/events", "GET /orgs/{org}/external-groups", "GET /orgs/{org}/failed_invitations", "GET /orgs/{org}/hooks", "GET /orgs/{org}/hooks/{hook_id}/deliveries", "GET /orgs/{org}/installations", "GET /orgs/{org}/invitations", "GET /orgs/{org}/invitations/{invitation_id}/teams", "GET /orgs/{org}/issues", "GET /orgs/{org}/members", "GET /orgs/{org}/migrations", "GET /orgs/{org}/migrations/{migration_id}/repositories", "GET /orgs/{org}/outside_collaborators", "GET /orgs/{org}/packages", "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", "GET /orgs/{org}/projects", "GET /orgs/{org}/public_members", "GET /orgs/{org}/repos", "GET /orgs/{org}/secret-scanning/alerts", "GET /orgs/{org}/settings/billing/advanced-security", "GET /orgs/{org}/team-sync/groups", "GET /orgs/{org}/teams", "GET /orgs/{org}/teams/{team_slug}/discussions", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", "GET /orgs/{org}/teams/{team_slug}/invitations", "GET /orgs/{org}/teams/{team_slug}/members", "GET /orgs/{org}/teams/{team_slug}/projects", "GET /orgs/{org}/teams/{team_slug}/repos", "GET /orgs/{org}/teams/{team_slug}/teams", "GET /projects/columns/{column_id}/cards", "GET /projects/{project_id}/collaborators", "GET /projects/{project_id}/columns", "GET /repos/{owner}/{repo}/actions/artifacts", "GET /repos/{owner}/{repo}/actions/caches", "GET /repos/{owner}/{repo}/actions/runners", "GET /repos/{owner}/{repo}/actions/runs", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs", "GET /repos/{owner}/{repo}/actions/secrets", "GET /repos/{owner}/{repo}/actions/workflows", "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs", "GET /repos/{owner}/{repo}/assignees", "GET /repos/{owner}/{repo}/branches", "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", "GET /repos/{owner}/{repo}/code-scanning/alerts", "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", "GET /repos/{owner}/{repo}/code-scanning/analyses", "GET /repos/{owner}/{repo}/codespaces", "GET /repos/{owner}/{repo}/codespaces/devcontainers", "GET /repos/{owner}/{repo}/codespaces/secrets", "GET /repos/{owner}/{repo}/collaborators", "GET /repos/{owner}/{repo}/comments", "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/commits", "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments", "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls", "GET /repos/{owner}/{repo}/commits/{ref}/check-runs", "GET /repos/{owner}/{repo}/commits/{ref}/check-suites", "GET /repos/{owner}/{repo}/commits/{ref}/status", "GET /repos/{owner}/{repo}/commits/{ref}/statuses", "GET /repos/{owner}/{repo}/contributors", "GET /repos/{owner}/{repo}/dependabot/secrets", "GET /repos/{owner}/{repo}/deployments", "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses", "GET /repos/{owner}/{repo}/environments", "GET /repos/{owner}/{repo}/events", "GET /repos/{owner}/{repo}/forks", "GET /repos/{owner}/{repo}/git/matching-refs/{ref}", "GET /repos/{owner}/{repo}/hooks", "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries", "GET /repos/{owner}/{repo}/invitations", "GET /repos/{owner}/{repo}/issues", "GET /repos/{owner}/{repo}/issues/comments", "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/issues/events", "GET /repos/{owner}/{repo}/issues/{issue_number}/comments", "GET /repos/{owner}/{repo}/issues/{issue_number}/events", "GET /repos/{owner}/{repo}/issues/{issue_number}/labels", "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions", "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline", "GET /repos/{owner}/{repo}/keys", "GET /repos/{owner}/{repo}/labels", "GET /repos/{owner}/{repo}/milestones", "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels", "GET /repos/{owner}/{repo}/notifications", "GET /repos/{owner}/{repo}/pages/builds", "GET /repos/{owner}/{repo}/projects", "GET /repos/{owner}/{repo}/pulls", "GET /repos/{owner}/{repo}/pulls/comments", "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments", "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits", "GET /repos/{owner}/{repo}/pulls/{pull_number}/files", "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers", "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews", "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments", "GET /repos/{owner}/{repo}/releases", "GET /repos/{owner}/{repo}/releases/{release_id}/assets", "GET /repos/{owner}/{repo}/releases/{release_id}/reactions", "GET /repos/{owner}/{repo}/secret-scanning/alerts", "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations", "GET /repos/{owner}/{repo}/stargazers", "GET /repos/{owner}/{repo}/subscribers", "GET /repos/{owner}/{repo}/tags", "GET /repos/{owner}/{repo}/teams", "GET /repos/{owner}/{repo}/topics", "GET /repositories", "GET /repositories/{repository_id}/environments/{environment_name}/secrets", "GET /search/code", "GET /search/commits", "GET /search/issues", "GET /search/labels", "GET /search/repositories", "GET /search/topics", "GET /search/users", "GET /teams/{team_id}/discussions", "GET /teams/{team_id}/discussions/{discussion_number}/comments", "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions", "GET /teams/{team_id}/discussions/{discussion_number}/reactions", "GET /teams/{team_id}/invitations", "GET /teams/{team_id}/members", "GET /teams/{team_id}/projects", "GET /teams/{team_id}/repos", "GET /teams/{team_id}/teams", "GET /user/blocks", "GET /user/codespaces", "GET /user/codespaces/secrets", "GET /user/emails", "GET /user/followers", "GET /user/following", "GET /user/gpg_keys", "GET /user/installations", "GET /user/installations/{installation_id}/repositories", "GET /user/issues", "GET /user/keys", "GET /user/marketplace_purchases", "GET /user/marketplace_purchases/stubbed", "GET /user/memberships/orgs", "GET /user/migrations", "GET /user/migrations/{migration_id}/repositories", "GET /user/orgs", "GET /user/packages", "GET /user/packages/{package_type}/{package_name}/versions", "GET /user/public_emails", "GET /user/repos", "GET /user/repository_invitations", "GET /user/starred", "GET /user/subscriptions", "GET /user/teams", "GET /users", "GET /users/{username}/events", "GET /users/{username}/events/orgs/{org}", "GET /users/{username}/events/public", "GET /users/{username}/followers", "GET /users/{username}/following", "GET /users/{username}/gists", "GET /users/{username}/gpg_keys", "GET /users/{username}/keys", "GET /users/{username}/orgs", "GET /users/{username}/packages", "GET /users/{username}/projects", "GET /users/{username}/received_events", "GET /users/{username}/received_events/public", "GET /users/{username}/repos", "GET /users/{username}/starred", "GET /users/{username}/subscriptions"]; - -function isPaginatingEndpoint(arg) { - if (typeof arg === "string") { - return paginatingEndpoints.includes(arg); - } else { - return false; - } -} - -/** - * @param octokit Octokit instance - * @param options Options passed to Octokit constructor - */ - -function paginateRest(octokit) { - return { - paginate: Object.assign(paginate.bind(null, octokit), { - iterator: iterator.bind(null, octokit) - }) - }; -} -paginateRest.VERSION = VERSION; - -exports.composePaginateRest = composePaginateRest; -exports.isPaginatingEndpoint = isPaginatingEndpoint; -exports.paginateRest = paginateRest; -exports.paginatingEndpoints = paginatingEndpoints; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 39148: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var deprecation = __nccwpck_require__(17320); -var once = _interopDefault(__nccwpck_require__(57175)); - -const logOnceCode = once(deprecation => console.warn(deprecation)); -const logOnceHeaders = once(deprecation => console.warn(deprecation)); -/** - * Error with extra properties to help with debugging - */ - -class RequestError extends Error { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - constructor(message, statusCode, options) { - super(message); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - this.name = "HttpError"; - this.status = statusCode; - let headers; - if ("headers" in options && typeof options.headers !== "undefined") { - headers = options.headers; - } - if ("response" in options) { - this.response = options.response; - headers = options.response.headers; - } - const requestCopy = Object.assign({}, options.request); - if (options.request.headers.authorization) { - requestCopy.headers = Object.assign({}, options.request.headers, { - authorization: options.request.headers.authorization.replace( - / .*$/, - " [REDACTED]" - ) - }); - } - requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"); - this.request = requestCopy; - Object.defineProperty(this, "code", { - get() { - logOnceCode( - new import_deprecation.Deprecation( - "[@octokit/request-error] `error.code` is deprecated, use `error.status`." - ) - ); - return statusCode; - } - }); - Object.defineProperty(this, "headers", { - get() { - logOnceHeaders( - new import_deprecation.Deprecation( - "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`." - ) - ); - return headers || {}; - } - }); - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (0); - - -/***/ }), - -<<<<<<< HEAD -/***/ 21790: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -======= -/***/ 31131: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// pkg/dist-src/index.js -var dist_src_exports = {}; -__export(dist_src_exports, { - request: () => request -}); -module.exports = __toCommonJS(dist_src_exports); -var import_endpoint = __nccwpck_require__(10103); -var import_universal_user_agent = __nccwpck_require__(60031); - -<<<<<<< HEAD -// pkg/dist-src/version.js -var VERSION = "8.1.6"; - -// pkg/dist-src/is-plain-object.js -function isPlainObject(value) { - if (typeof value !== "object" || value === null) - return false; - if (Object.prototype.toString.call(value) !== "[object Object]") - return false; - const proto = Object.getPrototypeOf(value); - if (proto === null) - return true; - const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor; - return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value); -} -======= -var endpoint = __nccwpck_require__(96164); -var universalUserAgent = __nccwpck_require__(35770); -var isPlainObject = __nccwpck_require__(9551); -var nodeFetch = _interopDefault(__nccwpck_require__(66471)); -var requestError = __nccwpck_require__(39148); - -const VERSION = "5.6.3"; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -// pkg/dist-src/fetch-wrapper.js -var import_request_error = __nccwpck_require__(7651); - -// pkg/dist-src/get-buffer-response.js -function getBufferResponse(response) { - return response.arrayBuffer(); -} - -// pkg/dist-src/fetch-wrapper.js -function fetchWrapper(requestOptions) { - var _a, _b, _c; - const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; - const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false; - if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { - requestOptions.body = JSON.stringify(requestOptions.body); - } - let headers = {}; - let status; - let url; - let { fetch } = globalThis; - if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) { - fetch = requestOptions.request.fetch; - } - if (!fetch) { - throw new Error( - "fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing" - ); - } - return fetch(requestOptions.url, { - method: requestOptions.method, - body: requestOptions.body, - headers: requestOptions.headers, - signal: (_c = requestOptions.request) == null ? void 0 : _c.signal, - // duplex must be set if request.body is ReadableStream or Async Iterables. - // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex. - ...requestOptions.body && { duplex: "half" } - }).then(async (response) => { - url = response.url; - status = response.status; - for (const keyAndValue of response.headers) { - headers[keyAndValue[0]] = keyAndValue[1]; - } - if ("deprecation" in headers) { - const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/); - const deprecationLink = matches && matches.pop(); - log.warn( - `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}` - ); - } - if (status === 204 || status === 205) { - return; - } - if (requestOptions.method === "HEAD") { - if (status < 400) { - return; - } - throw new import_request_error.RequestError(response.statusText, status, { - response: { - url, - status, - headers, - data: void 0 - }, - request: requestOptions - }); - } - if (status === 304) { - throw new import_request_error.RequestError("Not modified", status, { - response: { - url, - status, - headers, - data: await getResponseData(response) - }, - request: requestOptions - }); - } - if (status >= 400) { - const data = await getResponseData(response); - const error = new import_request_error.RequestError(toErrorMessage(data), status, { - response: { - url, - status, - headers, - data - }, - request: requestOptions - }); - throw error; - } - return parseSuccessResponseBody ? await getResponseData(response) : response.body; - }).then((data) => { - return { - status, - url, - headers, - data - }; - }).catch((error) => { - if (error instanceof import_request_error.RequestError) - throw error; - else if (error.name === "AbortError") - throw error; - let message = error.message; - if (error.name === "TypeError" && "cause" in error) { - if (error.cause instanceof Error) { - message = error.cause.message; - } else if (typeof error.cause === "string") { - message = error.cause; - } - } - throw new import_request_error.RequestError(message, 500, { - request: requestOptions - }); - }); -} -async function getResponseData(response) { - const contentType = response.headers.get("content-type"); - if (/application\/json/.test(contentType)) { - return response.json().catch(() => response.text()).catch(() => ""); - } - if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { - return response.text(); - } - return getBufferResponse(response); -} -function toErrorMessage(data) { - if (typeof data === "string") - return data; - if ("message" in data) { - if (Array.isArray(data.errors)) { - return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`; - } - return data.message; - } - return `Unknown error: ${JSON.stringify(data)}`; -} - -// pkg/dist-src/with-defaults.js -function withDefaults(oldEndpoint, newDefaults) { - const endpoint2 = oldEndpoint.defaults(newDefaults); - const newApi = function(route, parameters) { - const endpointOptions = endpoint2.merge(route, parameters); - if (!endpointOptions.request || !endpointOptions.request.hook) { - return fetchWrapper(endpoint2.parse(endpointOptions)); - } - const request2 = (route2, parameters2) => { - return fetchWrapper( - endpoint2.parse(endpoint2.merge(route2, parameters2)) - ); - }; - Object.assign(request2, { - endpoint: endpoint2, - defaults: withDefaults.bind(null, endpoint2) - }); - return endpointOptions.request.hook(request2, endpointOptions); - }; - return Object.assign(newApi, { - endpoint: endpoint2, - defaults: withDefaults.bind(null, endpoint2) - }); -} - -// pkg/dist-src/index.js -var request = withDefaults(import_endpoint.endpoint, { - headers: { - "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}` - } -}); -// Annotate the CommonJS export names for ESM import in node: -0 && (0); - - -/***/ }), - -<<<<<<< HEAD -/***/ 80590: -======= -/***/ 44386: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) { - -(function webpackUniversalModuleDefinition(root, factory) { - if(true) - module.exports = factory(); - else {} -})(typeof self !== 'undefined' ? self : this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __nested_webpack_require_594__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_594__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __nested_webpack_require_594__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __nested_webpack_require_594__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __nested_webpack_require_594__.d = function(exports, name, getter) { -/******/ if(!__nested_webpack_require_594__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __nested_webpack_require_594__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __nested_webpack_require_594__.t = function(value, mode) { -/******/ if(mode & 1) value = __nested_webpack_require_594__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __nested_webpack_require_594__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_594__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __nested_webpack_require_594__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __nested_webpack_require_594__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __nested_webpack_require_594__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __nested_webpack_require_594__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __nested_webpack_require_594__(__nested_webpack_require_594__.s = 0); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "./node_modules/asynckit/index.js": -/*!****************************************!*\ - !*** ./node_modules/asynckit/index.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_4261__) { - -module.exports = -{ - parallel : __nested_webpack_require_4261__(/*! ./parallel.js */ "./node_modules/asynckit/parallel.js"), - serial : __nested_webpack_require_4261__(/*! ./serial.js */ "./node_modules/asynckit/serial.js"), - serialOrdered : __nested_webpack_require_4261__(/*! ./serialOrdered.js */ "./node_modules/asynckit/serialOrdered.js") -}; - - -/***/ }), - -/***/ "./node_modules/asynckit/lib/abort.js": -/*!********************************************!*\ - !*** ./node_modules/asynckit/lib/abort.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// API -module.exports = abort; - -/** - * Aborts leftover active jobs - * - * @param {object} state - current state object - */ -function abort(state) -{ - Object.keys(state.jobs).forEach(clean.bind(state)); - - // reset leftover jobs - state.jobs = {}; -} - -/** - * Cleans up leftover job by invoking abort function for the provided job id - * - * @this state - * @param {string|number} key - job id to abort - */ -function clean(key) -{ - if (typeof this.jobs[key] == 'function') - { - this.jobs[key](); - } -} - - -/***/ }), - -/***/ "./node_modules/asynckit/lib/async.js": -/*!********************************************!*\ - !*** ./node_modules/asynckit/lib/async.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_5653__) { - -var defer = __nested_webpack_require_5653__(/*! ./defer.js */ "./node_modules/asynckit/lib/defer.js"); - -// API -module.exports = async; - -/** - * Runs provided callback asynchronously - * even if callback itself is not - * - * @param {function} callback - callback to invoke - * @returns {function} - augmented callback - */ -function async(callback) -{ - var isAsync = false; - - // check if async happened - defer(function() { isAsync = true; }); - - return function async_callback(err, result) - { - if (isAsync) - { - callback(err, result); - } - else - { - defer(function nextTick_callback() - { - callback(err, result); - }); - } - }; -} - - -/***/ }), - -/***/ "./node_modules/asynckit/lib/defer.js": -/*!********************************************!*\ - !*** ./node_modules/asynckit/lib/defer.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = defer; - -/** - * Runs provided function on next iteration of the event loop - * - * @param {function} fn - function to run - */ -function defer(fn) -{ - var nextTick = typeof setImmediate == 'function' - ? setImmediate - : ( - typeof process == 'object' && typeof process.nextTick == 'function' - ? process.nextTick - : null - ); - - if (nextTick) - { - nextTick(fn); - } - else - { - setTimeout(fn, 0); - } -} - - -/***/ }), - -/***/ "./node_modules/asynckit/lib/iterate.js": -/*!**********************************************!*\ - !*** ./node_modules/asynckit/lib/iterate.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_7328__) { - -var async = __nested_webpack_require_7328__(/*! ./async.js */ "./node_modules/asynckit/lib/async.js") - , abort = __nested_webpack_require_7328__(/*! ./abort.js */ "./node_modules/asynckit/lib/abort.js") - ; - -// API -module.exports = iterate; - -/** - * Iterates over each job object - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {object} state - current job status - * @param {function} callback - invoked when all elements processed - */ -function iterate(list, iterator, state, callback) -{ - // store current index - var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; - - state.jobs[key] = runJob(iterator, key, list[key], function(error, output) - { - // don't repeat yourself - // skip secondary callbacks - if (!(key in state.jobs)) - { - return; - } - - // clean up jobs - delete state.jobs[key]; - - if (error) - { - // don't process rest of the results - // stop still active jobs - // and reset the list - abort(state); - } - else - { - state.results[key] = output; - } - - // return salvaged results - callback(error, state.results); - }); -} - -/** - * Runs iterator over provided job element - * - * @param {function} iterator - iterator to invoke - * @param {string|number} key - key/index of the element in the list of jobs - * @param {mixed} item - job description - * @param {function} callback - invoked after iterator is done with the job - * @returns {function|mixed} - job abort function or something else - */ -function runJob(iterator, key, item, callback) -{ - var aborter; - - // allow shortcut if iterator expects only two arguments - if (iterator.length == 2) - { - aborter = iterator(item, async(callback)); - } - // otherwise go with full three arguments - else - { - aborter = iterator(item, key, async(callback)); - } - - return aborter; -} - - -/***/ }), - -/***/ "./node_modules/asynckit/lib/state.js": -/*!********************************************!*\ - !*** ./node_modules/asynckit/lib/state.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// API -module.exports = state; - -/** - * Creates initial state object - * for iteration over list - * - * @param {array|object} list - list to iterate over - * @param {function|null} sortMethod - function to use for keys sort, - * or `null` to keep them as is - * @returns {object} - initial state object - */ -function state(list, sortMethod) -{ - var isNamedList = !Array.isArray(list) - , initState = - { - index : 0, - keyedList: isNamedList || sortMethod ? Object.keys(list) : null, - jobs : {}, - results : isNamedList ? {} : [], - size : isNamedList ? Object.keys(list).length : list.length - } - ; - - if (sortMethod) - { - // sort array keys based on it's values - // sort object's keys just on own merit - initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) - { - return sortMethod(list[a], list[b]); - }); - } - - return initState; -} - - -/***/ }), - -/***/ "./node_modules/asynckit/lib/terminator.js": -/*!*************************************************!*\ - !*** ./node_modules/asynckit/lib/terminator.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_10766__) { - -var abort = __nested_webpack_require_10766__(/*! ./abort.js */ "./node_modules/asynckit/lib/abort.js") - , async = __nested_webpack_require_10766__(/*! ./async.js */ "./node_modules/asynckit/lib/async.js") - ; - -// API -module.exports = terminator; - -/** - * Terminates jobs in the attached state context - * - * @this AsyncKitState# - * @param {function} callback - final callback to invoke after termination - */ -function terminator(callback) -{ - if (!Object.keys(this.jobs).length) - { - return; - } - - // fast forward iteration index - this.index = this.size; - - // abort jobs - abort(this); - - // send back results we have so far - async(callback)(null, this.results); -} - - -/***/ }), - -/***/ "./node_modules/asynckit/parallel.js": -/*!*******************************************!*\ - !*** ./node_modules/asynckit/parallel.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_11703__) { - -var iterate = __nested_webpack_require_11703__(/*! ./lib/iterate.js */ "./node_modules/asynckit/lib/iterate.js") - , initState = __nested_webpack_require_11703__(/*! ./lib/state.js */ "./node_modules/asynckit/lib/state.js") - , terminator = __nested_webpack_require_11703__(/*! ./lib/terminator.js */ "./node_modules/asynckit/lib/terminator.js") - ; - -// Public API -module.exports = parallel; - -/** - * Runs iterator over provided array elements in parallel - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function parallel(list, iterator, callback) -{ - var state = initState(list); - - while (state.index < (state['keyedList'] || list).length) - { - iterate(list, iterator, state, function(error, result) - { - if (error) - { - callback(error, result); - return; - } - - // looks like it's the last one - if (Object.keys(state.jobs).length === 0) - { - callback(null, state.results); - return; - } - }); - - state.index++; - } - - return terminator.bind(state, callback); -} - - -/***/ }), - -/***/ "./node_modules/asynckit/serial.js": -/*!*****************************************!*\ - !*** ./node_modules/asynckit/serial.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_13179__) { - -var serialOrdered = __nested_webpack_require_13179__(/*! ./serialOrdered.js */ "./node_modules/asynckit/serialOrdered.js"); - -// Public API -module.exports = serial; - -/** - * Runs iterator over provided array elements in series - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function serial(list, iterator, callback) -{ - return serialOrdered(list, iterator, null, callback); -} - - -/***/ }), - -/***/ "./node_modules/asynckit/serialOrdered.js": -/*!************************************************!*\ - !*** ./node_modules/asynckit/serialOrdered.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_14052__) { - -var iterate = __nested_webpack_require_14052__(/*! ./lib/iterate.js */ "./node_modules/asynckit/lib/iterate.js") - , initState = __nested_webpack_require_14052__(/*! ./lib/state.js */ "./node_modules/asynckit/lib/state.js") - , terminator = __nested_webpack_require_14052__(/*! ./lib/terminator.js */ "./node_modules/asynckit/lib/terminator.js") - ; - -// Public API -module.exports = serialOrdered; -// sorting helpers -module.exports.ascending = ascending; -module.exports.descending = descending; - -/** - * Runs iterator over provided sorted array elements in series - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} sortMethod - custom sort function - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function serialOrdered(list, iterator, sortMethod, callback) -{ - var state = initState(list, sortMethod); - - iterate(list, iterator, state, function iteratorHandler(error, result) - { - if (error) - { - callback(error, result); - return; - } - - state.index++; - - // are we there yet? - if (state.index < (state['keyedList'] || list).length) - { - iterate(list, iterator, state, iteratorHandler); - return; - } - - // done here - callback(null, state.results); - }); - - return terminator.bind(state, callback); -} - -/* - * -- Sort methods - */ - -/** - * sort helper to sort array elements in ascending order - * - * @param {mixed} a - an item to compare - * @param {mixed} b - an item to compare - * @returns {number} - comparison result - */ -function ascending(a, b) -{ - return a < b ? -1 : a > b ? 1 : 0; -} - -/** - * sort helper to sort array elements in descending order - * - * @param {mixed} a - an item to compare - * @param {mixed} b - an item to compare - * @returns {number} - comparison result - */ -function descending(a, b) -{ - return -1 * ascending(a, b); -} - - -/***/ }), - -/***/ "./node_modules/axios/index.js": -/*!*************************************!*\ - !*** ./node_modules/axios/index.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_16246__) { - -module.exports = __nested_webpack_require_16246__(/*! ./lib/axios */ "./node_modules/axios/lib/axios.js"); - -/***/ }), - -/***/ "./node_modules/axios/lib/adapters/http.js": -/*!*************************************************!*\ - !*** ./node_modules/axios/lib/adapters/http.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_16655__) { - -"use strict"; - - -var utils = __nested_webpack_require_16655__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); -var settle = __nested_webpack_require_16655__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js"); -var buildFullPath = __nested_webpack_require_16655__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js"); -var buildURL = __nested_webpack_require_16655__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); -var http = __nested_webpack_require_16655__(/*! http */ "http"); -var https = __nested_webpack_require_16655__(/*! https */ "https"); -var httpFollow = __nested_webpack_require_16655__(/*! follow-redirects */ "./node_modules/follow-redirects/index.js").http; -var httpsFollow = __nested_webpack_require_16655__(/*! follow-redirects */ "./node_modules/follow-redirects/index.js").https; -var url = __nested_webpack_require_16655__(/*! url */ "url"); -var zlib = __nested_webpack_require_16655__(/*! zlib */ "zlib"); -var pkg = __nested_webpack_require_16655__(/*! ./../../package.json */ "./node_modules/axios/package.json"); -var createError = __nested_webpack_require_16655__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js"); -var enhanceError = __nested_webpack_require_16655__(/*! ../core/enhanceError */ "./node_modules/axios/lib/core/enhanceError.js"); - -var isHttps = /https:?/; - -/** - * - * @param {http.ClientRequestArgs} options - * @param {AxiosProxyConfig} proxy - * @param {string} location - */ -function setProxy(options, proxy, location) { - options.hostname = proxy.host; - options.host = proxy.host; - options.port = proxy.port; - options.path = location; - - // Basic proxy authorization - if (proxy.auth) { - var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); - options.headers['Proxy-Authorization'] = 'Basic ' + base64; - } - - // If a proxy is used, any redirects must also pass through the proxy - options.beforeRedirect = function beforeRedirect(redirection) { - redirection.headers.host = redirection.host; - setProxy(redirection, proxy, redirection.href); - }; -} - -/*eslint consistent-return:0*/ -module.exports = function httpAdapter(config) { - return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { - var resolve = function resolve(value) { - resolvePromise(value); - }; - var reject = function reject(value) { - rejectPromise(value); - }; - var data = config.data; - var headers = config.headers; - - // Set User-Agent (required by some servers) - // Only set header if it hasn't been set in config - // See https://github.com/axios/axios/issues/69 - if (!headers['User-Agent'] && !headers['user-agent']) { - headers['User-Agent'] = 'axios/' + pkg.version; - } - - if (data && !utils.isStream(data)) { - if (Buffer.isBuffer(data)) { - // Nothing to do... - } else if (utils.isArrayBuffer(data)) { - data = Buffer.from(new Uint8Array(data)); - } else if (utils.isString(data)) { - data = Buffer.from(data, 'utf-8'); - } else { - return reject(createError( - 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', - config - )); - } - - // Add Content-Length header if data exists - headers['Content-Length'] = data.length; - } - - // HTTP basic authentication - var auth = undefined; - if (config.auth) { - var username = config.auth.username || ''; - var password = config.auth.password || ''; - auth = username + ':' + password; - } - - // Parse url - var fullPath = buildFullPath(config.baseURL, config.url); - var parsed = url.parse(fullPath); - var protocol = parsed.protocol || 'http:'; - - if (!auth && parsed.auth) { - var urlAuth = parsed.auth.split(':'); - var urlUsername = urlAuth[0] || ''; - var urlPassword = urlAuth[1] || ''; - auth = urlUsername + ':' + urlPassword; - } - - if (auth) { - delete headers.Authorization; - } - - var isHttpsRequest = isHttps.test(protocol); - var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; - - var options = { - path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''), - method: config.method.toUpperCase(), - headers: headers, - agent: agent, - agents: { http: config.httpAgent, https: config.httpsAgent }, - auth: auth - }; - - if (config.socketPath) { - options.socketPath = config.socketPath; - } else { - options.hostname = parsed.hostname; - options.port = parsed.port; - } - - var proxy = config.proxy; - if (!proxy && proxy !== false) { - var proxyEnv = protocol.slice(0, -1) + '_proxy'; - var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()]; - if (proxyUrl) { - var parsedProxyUrl = url.parse(proxyUrl); - var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY; - var shouldProxy = true; - - if (noProxyEnv) { - var noProxy = noProxyEnv.split(',').map(function trim(s) { - return s.trim(); - }); - - shouldProxy = !noProxy.some(function proxyMatch(proxyElement) { - if (!proxyElement) { - return false; - } - if (proxyElement === '*') { - return true; - } - if (proxyElement[0] === '.' && - parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) { - return true; - } - - return parsed.hostname === proxyElement; - }); - } - - if (shouldProxy) { - proxy = { - host: parsedProxyUrl.hostname, - port: parsedProxyUrl.port, - protocol: parsedProxyUrl.protocol - }; - - if (parsedProxyUrl.auth) { - var proxyUrlAuth = parsedProxyUrl.auth.split(':'); - proxy.auth = { - username: proxyUrlAuth[0], - password: proxyUrlAuth[1] - }; - } - } - } - } - - if (proxy) { - options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : ''); - setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); - } - - var transport; - var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true); - if (config.transport) { - transport = config.transport; - } else if (config.maxRedirects === 0) { - transport = isHttpsProxy ? https : http; - } else { - if (config.maxRedirects) { - options.maxRedirects = config.maxRedirects; - } - transport = isHttpsProxy ? httpsFollow : httpFollow; - } - - if (config.maxBodyLength > -1) { - options.maxBodyLength = config.maxBodyLength; - } - - // Create the request - var req = transport.request(options, function handleResponse(res) { - if (req.aborted) return; - - // uncompress the response body transparently if required - var stream = res; - - // return the last request in case of redirects - var lastRequest = res.req || req; - - - // if no content, is HEAD request or decompress disabled we should not decompress - if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) { - switch (res.headers['content-encoding']) { - /*eslint default-case:0*/ - case 'gzip': - case 'compress': - case 'deflate': - // add the unzipper to the body stream processing pipeline - stream = stream.pipe(zlib.createUnzip()); - - // remove the content-encoding in order to not confuse downstream operations - delete res.headers['content-encoding']; - break; - } - } - - var response = { - status: res.statusCode, - statusText: res.statusMessage, - headers: res.headers, - config: config, - request: lastRequest - }; - - if (config.responseType === 'stream') { - response.data = stream; - settle(resolve, reject, response); - } else { - var responseBuffer = []; - stream.on('data', function handleStreamData(chunk) { - responseBuffer.push(chunk); - - // make sure the content length is not over the maxContentLength if specified - if (config.maxContentLength > -1 && Buffer.concat(responseBuffer).length > config.maxContentLength) { - stream.destroy(); - reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded', - config, null, lastRequest)); - } - }); - - stream.on('error', function handleStreamError(err) { - if (req.aborted) return; - reject(enhanceError(err, config, null, lastRequest)); - }); - - stream.on('end', function handleStreamEnd() { - var responseData = Buffer.concat(responseBuffer); - if (config.responseType !== 'arraybuffer') { - responseData = responseData.toString(config.responseEncoding); - if (!config.responseEncoding || config.responseEncoding === 'utf8') { - responseData = utils.stripBOM(responseData); - } - } - - response.data = responseData; - settle(resolve, reject, response); - }); - } - }); - - // Handle errors - req.on('error', function handleRequestError(err) { - if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return; - reject(enhanceError(err, config, null, req)); - }); - - // Handle request timeout - if (config.timeout) { - // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. - // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. - // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. - // And then these socket which be hang up will devoring CPU little by little. - // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. - req.setTimeout(config.timeout, function handleRequestTimeout() { - req.abort(); - reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', req)); - }); - } - - if (config.cancelToken) { - // Handle cancellation - config.cancelToken.promise.then(function onCanceled(cancel) { - if (req.aborted) return; - - req.abort(); - reject(cancel); - }); - } - - // Send the request - if (utils.isStream(data)) { - data.on('error', function handleStreamError(err) { - reject(enhanceError(err, config, null, req)); - }).pipe(req); - } else { - req.end(data); - } - }); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/adapters/xhr.js": -/*!************************************************!*\ - !*** ./node_modules/axios/lib/adapters/xhr.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_27727__) { - -"use strict"; - - -var utils = __nested_webpack_require_27727__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); -var settle = __nested_webpack_require_27727__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js"); -var cookies = __nested_webpack_require_27727__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js"); -var buildURL = __nested_webpack_require_27727__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); -var buildFullPath = __nested_webpack_require_27727__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js"); -var parseHeaders = __nested_webpack_require_27727__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js"); -var isURLSameOrigin = __nested_webpack_require_27727__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js"); -var createError = __nested_webpack_require_27727__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js"); - -module.exports = function xhrAdapter(config) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - var requestData = config.data; - var requestHeaders = config.headers; - - if (utils.isFormData(requestData)) { - delete requestHeaders['Content-Type']; // Let the browser set it - } - - var request = new XMLHttpRequest(); - - // HTTP basic authentication - if (config.auth) { - var username = config.auth.username || ''; - var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; - requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); - } - - var fullPath = buildFullPath(config.baseURL, config.url); - request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); - - // Set the request timeout in MS - request.timeout = config.timeout; - - // Listen for ready state - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } - - // The request errored out and we didn't get a response, this will be - // handled by onerror instead - // With one exception: request that using file: protocol, most browsers - // will return status as 0 even though it's a successful request - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { - return; - } - - // Prepare the response - var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; - var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; - var response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config: config, - request: request - }; - - settle(resolve, reject, response); - - // Clean up request - request = null; - }; - - // Handle browser request cancellation (as opposed to a manual cancellation) - request.onabort = function handleAbort() { - if (!request) { - return; - } - - reject(createError('Request aborted', config, 'ECONNABORTED', request)); - - // Clean up request - request = null; - }; - - // Handle low level network errors - request.onerror = function handleError() { - // Real errors are hidden from us by the browser - // onerror should only fire if it's a network error - reject(createError('Network Error', config, null, request)); - - // Clean up request - request = null; - }; - - // Handle timeout - request.ontimeout = function handleTimeout() { - var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; - } - reject(createError(timeoutErrorMessage, config, 'ECONNABORTED', - request)); - - // Clean up request - request = null; - }; - - // Add xsrf header - // This is only done if running in a standard browser environment. - // Specifically not if we're in a web worker, or react-native. - if (utils.isStandardBrowserEnv()) { - // Add xsrf header - var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? - cookies.read(config.xsrfCookieName) : - undefined; - - if (xsrfValue) { - requestHeaders[config.xsrfHeaderName] = xsrfValue; - } - } - - // Add headers to the request - if ('setRequestHeader' in request) { - utils.forEach(requestHeaders, function setRequestHeader(val, key) { - if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { - // Remove Content-Type if data is undefined - delete requestHeaders[key]; - } else { - // Otherwise add header to the request - request.setRequestHeader(key, val); - } - }); - } - - // Add withCredentials to request if needed - if (!utils.isUndefined(config.withCredentials)) { - request.withCredentials = !!config.withCredentials; - } - - // Add responseType to request if needed - if (config.responseType) { - try { - request.responseType = config.responseType; - } catch (e) { - // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2. - // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function. - if (config.responseType !== 'json') { - throw e; - } - } - } - - // Handle progress if needed - if (typeof config.onDownloadProgress === 'function') { - request.addEventListener('progress', config.onDownloadProgress); - } - - // Not all browsers support upload events - if (typeof config.onUploadProgress === 'function' && request.upload) { - request.upload.addEventListener('progress', config.onUploadProgress); - } - - if (config.cancelToken) { - // Handle cancellation - config.cancelToken.promise.then(function onCanceled(cancel) { - if (!request) { - return; - } - - request.abort(); - reject(cancel); - // Clean up request - request = null; - }); - } - - if (!requestData) { - requestData = null; - } - - // Send the request - request.send(requestData); - }); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/axios.js": -/*!*****************************************!*\ - !*** ./node_modules/axios/lib/axios.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_34389__) { - -"use strict"; - - -var utils = __nested_webpack_require_34389__(/*! ./utils */ "./node_modules/axios/lib/utils.js"); -var bind = __nested_webpack_require_34389__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); -var Axios = __nested_webpack_require_34389__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js"); -var mergeConfig = __nested_webpack_require_34389__(/*! ./core/mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js"); -var defaults = __nested_webpack_require_34389__(/*! ./defaults */ "./node_modules/axios/lib/defaults.js"); - -/** - * Create an instance of Axios - * - * @param {Object} defaultConfig The default config for the instance - * @return {Axios} A new instance of Axios - */ -function createInstance(defaultConfig) { - var context = new Axios(defaultConfig); - var instance = bind(Axios.prototype.request, context); - - // Copy axios.prototype to instance - utils.extend(instance, Axios.prototype, context); - - // Copy context to instance - utils.extend(instance, context); - - return instance; -} - -// Create the default instance to be exported -var axios = createInstance(defaults); - -// Expose Axios class to allow class inheritance -axios.Axios = Axios; - -// Factory for creating new instances -axios.create = function create(instanceConfig) { - return createInstance(mergeConfig(axios.defaults, instanceConfig)); -}; - -// Expose Cancel & CancelToken -axios.Cancel = __nested_webpack_require_34389__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); -axios.CancelToken = __nested_webpack_require_34389__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js"); -axios.isCancel = __nested_webpack_require_34389__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); - -// Expose all/spread -axios.all = function all(promises) { - return Promise.all(promises); -}; -axios.spread = __nested_webpack_require_34389__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js"); - -// Expose isAxiosError -axios.isAxiosError = __nested_webpack_require_34389__(/*! ./helpers/isAxiosError */ "./node_modules/axios/lib/helpers/isAxiosError.js"); - -module.exports = axios; - -// Allow use of default import syntax in TypeScript -module.exports.default = axios; - - -/***/ }), - -/***/ "./node_modules/axios/lib/cancel/Cancel.js": -/*!*************************************************!*\ - !*** ./node_modules/axios/lib/cancel/Cancel.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; - - -/** - * A `Cancel` is an object that is thrown when an operation is canceled. - * - * @class - * @param {string=} message The message. - */ -function Cancel(message) { - this.message = message; -} - -Cancel.prototype.toString = function toString() { - return 'Cancel' + (this.message ? ': ' + this.message : ''); -}; - -Cancel.prototype.__CANCEL__ = true; - -module.exports = Cancel; - - -/***/ }), - -/***/ "./node_modules/axios/lib/cancel/CancelToken.js": -/*!******************************************************!*\ - !*** ./node_modules/axios/lib/cancel/CancelToken.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_37542__) { - -"use strict"; - - -var Cancel = __nested_webpack_require_37542__(/*! ./Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); - -/** - * A `CancelToken` is an object that can be used to request cancellation of an operation. - * - * @class - * @param {Function} executor The executor function. - */ -function CancelToken(executor) { - if (typeof executor !== 'function') { - throw new TypeError('executor must be a function.'); - } - - var resolvePromise; - this.promise = new Promise(function promiseExecutor(resolve) { - resolvePromise = resolve; - }); - - var token = this; - executor(function cancel(message) { - if (token.reason) { - // Cancellation has already been requested - return; - } - - token.reason = new Cancel(message); - resolvePromise(token.reason); - }); -} - -/** - * Throws a `Cancel` if cancellation has been requested. - */ -CancelToken.prototype.throwIfRequested = function throwIfRequested() { - if (this.reason) { - throw this.reason; - } -}; - -/** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ -CancelToken.source = function source() { - var cancel; - var token = new CancelToken(function executor(c) { - cancel = c; - }); - return { - token: token, - cancel: cancel - }; -}; - -module.exports = CancelToken; - - -/***/ }), - -/***/ "./node_modules/axios/lib/cancel/isCancel.js": -/*!***************************************************!*\ - !*** ./node_modules/axios/lib/cancel/isCancel.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; - - -module.exports = function isCancel(value) { - return !!(value && value.__CANCEL__); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/Axios.js": -/*!**********************************************!*\ - !*** ./node_modules/axios/lib/core/Axios.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_39575__) { - -"use strict"; - - -var utils = __nested_webpack_require_39575__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); -var buildURL = __nested_webpack_require_39575__(/*! ../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); -var InterceptorManager = __nested_webpack_require_39575__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js"); -var dispatchRequest = __nested_webpack_require_39575__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js"); -var mergeConfig = __nested_webpack_require_39575__(/*! ./mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js"); - -/** - * Create a new instance of Axios - * - * @param {Object} instanceConfig The default config for the instance - */ -function Axios(instanceConfig) { - this.defaults = instanceConfig; - this.interceptors = { - request: new InterceptorManager(), - response: new InterceptorManager() - }; -} - -/** - * Dispatch a request - * - * @param {Object} config The config specific for this request (merged with this.defaults) - */ -Axios.prototype.request = function request(config) { - /*eslint no-param-reassign:0*/ - // Allow for axios('example/url'[, config]) a la fetch API - if (typeof config === 'string') { - config = arguments[1] || {}; - config.url = arguments[0]; - } else { - config = config || {}; - } - - config = mergeConfig(this.defaults, config); - - // Set config.method - if (config.method) { - config.method = config.method.toLowerCase(); - } else if (this.defaults.method) { - config.method = this.defaults.method.toLowerCase(); - } else { - config.method = 'get'; - } - - // Hook up interceptors middleware - var chain = [dispatchRequest, undefined]; - var promise = Promise.resolve(config); - - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - chain.unshift(interceptor.fulfilled, interceptor.rejected); - }); - - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - chain.push(interceptor.fulfilled, interceptor.rejected); - }); - - while (chain.length) { - promise = promise.then(chain.shift(), chain.shift()); - } - - return promise; -}; - -Axios.prototype.getUri = function getUri(config) { - config = mergeConfig(this.defaults, config); - return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); -}; - -// Provide aliases for supported request methods -utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function(url, config) { - return this.request(mergeConfig(config || {}, { - method: method, - url: url, - data: (config || {}).data - })); - }; -}); - -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function(url, data, config) { - return this.request(mergeConfig(config || {}, { - method: method, - url: url, - data: data - })); - }; -}); - -module.exports = Axios; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/InterceptorManager.js": -/*!***********************************************************!*\ - !*** ./node_modules/axios/lib/core/InterceptorManager.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_42900__) { - -"use strict"; - - -var utils = __nested_webpack_require_42900__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - -function InterceptorManager() { - this.handlers = []; -} - -/** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * - * @return {Number} An ID used to remove interceptor later - */ -InterceptorManager.prototype.use = function use(fulfilled, rejected) { - this.handlers.push({ - fulfilled: fulfilled, - rejected: rejected - }); - return this.handlers.length - 1; -}; - -/** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - */ -InterceptorManager.prototype.eject = function eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; - } -}; - -/** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - */ -InterceptorManager.prototype.forEach = function forEach(fn) { - utils.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); - } - }); -}; - -module.exports = InterceptorManager; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/buildFullPath.js": -/*!******************************************************!*\ - !*** ./node_modules/axios/lib/core/buildFullPath.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_44541__) { - -"use strict"; - - -var isAbsoluteURL = __nested_webpack_require_44541__(/*! ../helpers/isAbsoluteURL */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js"); -var combineURLs = __nested_webpack_require_44541__(/*! ../helpers/combineURLs */ "./node_modules/axios/lib/helpers/combineURLs.js"); - -/** - * Creates a new URL by combining the baseURL with the requestedURL, - * only when the requestedURL is not already an absolute URL. - * If the requestURL is absolute, this function returns the requestedURL untouched. - * - * @param {string} baseURL The base URL - * @param {string} requestedURL Absolute or relative URL to combine - * @returns {string} The combined full path - */ -module.exports = function buildFullPath(baseURL, requestedURL) { - if (baseURL && !isAbsoluteURL(requestedURL)) { - return combineURLs(baseURL, requestedURL); - } - return requestedURL; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/createError.js": -/*!****************************************************!*\ - !*** ./node_modules/axios/lib/core/createError.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_45701__) { - -"use strict"; - - -var enhanceError = __nested_webpack_require_45701__(/*! ./enhanceError */ "./node_modules/axios/lib/core/enhanceError.js"); - -/** - * Create an Error with the specified message, config, error code, request and response. - * - * @param {string} message The error message. - * @param {Object} config The config. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * @returns {Error} The created error. - */ -module.exports = function createError(message, config, code, request, response) { - var error = new Error(message); - return enhanceError(error, config, code, request, response); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/dispatchRequest.js": -/*!********************************************************!*\ - !*** ./node_modules/axios/lib/core/dispatchRequest.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_46736__) { - -"use strict"; - - -var utils = __nested_webpack_require_46736__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); -var transformData = __nested_webpack_require_46736__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js"); -var isCancel = __nested_webpack_require_46736__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); -var defaults = __nested_webpack_require_46736__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js"); - -/** - * Throws a `Cancel` if cancellation has been requested. - */ -function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } -} - -/** - * Dispatch a request to the server using the configured adapter. - * - * @param {object} config The config that is to be used for the request - * @returns {Promise} The Promise to be fulfilled - */ -module.exports = function dispatchRequest(config) { - throwIfCancellationRequested(config); - - // Ensure headers exist - config.headers = config.headers || {}; - - // Transform request data - config.data = transformData( - config.data, - config.headers, - config.transformRequest - ); - - // Flatten headers - config.headers = utils.merge( - config.headers.common || {}, - config.headers[config.method] || {}, - config.headers - ); - - utils.forEach( - ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], - function cleanHeaderConfig(method) { - delete config.headers[method]; - } - ); - - var adapter = config.adapter || defaults.adapter; - - return adapter(config).then(function onAdapterResolution(response) { - throwIfCancellationRequested(config); - - // Transform response data - response.data = transformData( - response.data, - response.headers, - config.transformResponse - ); - - return response; - }, function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); - - // Transform response data - if (reason && reason.response) { - reason.response.data = transformData( - reason.response.data, - reason.response.headers, - config.transformResponse - ); - } - } - - return Promise.reject(reason); - }); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/enhanceError.js": -/*!*****************************************************!*\ - !*** ./node_modules/axios/lib/core/enhanceError.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; - - -/** - * Update an Error with the specified config, error code, and response. - * - * @param {Error} error The error to update. - * @param {Object} config The config. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * @returns {Error} The error. - */ -module.exports = function enhanceError(error, config, code, request, response) { - error.config = config; - if (code) { - error.code = code; - } - - error.request = request; - error.response = response; - error.isAxiosError = true; - - error.toJSON = function toJSON() { - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: this.config, - code: this.code - }; - }; - return error; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/mergeConfig.js": -/*!****************************************************!*\ - !*** ./node_modules/axios/lib/core/mergeConfig.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_50619__) { - -"use strict"; - - -var utils = __nested_webpack_require_50619__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); - -/** - * Config-specific merge-function which creates a new config-object - * by merging two configuration objects together. - * - * @param {Object} config1 - * @param {Object} config2 - * @returns {Object} New object resulting from merging config2 to config1 - */ -module.exports = function mergeConfig(config1, config2) { - // eslint-disable-next-line no-param-reassign - config2 = config2 || {}; - var config = {}; - - var valueFromConfig2Keys = ['url', 'method', 'data']; - var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; - var defaultToConfig2Keys = [ - 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', - 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', - 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', - 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', - 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' - ]; - var directMergeKeys = ['validateStatus']; - - function getMergedValue(target, source) { - if (utils.isPlainObject(target) && utils.isPlainObject(source)) { - return utils.merge(target, source); - } else if (utils.isPlainObject(source)) { - return utils.merge({}, source); - } else if (utils.isArray(source)) { - return source.slice(); - } - return source; - } - - function mergeDeepProperties(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(config1[prop], config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - config[prop] = getMergedValue(undefined, config1[prop]); - } - } - - utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(undefined, config2[prop]); - } - }); - - utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); - - utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(undefined, config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - config[prop] = getMergedValue(undefined, config1[prop]); - } - }); - - utils.forEach(directMergeKeys, function merge(prop) { - if (prop in config2) { - config[prop] = getMergedValue(config1[prop], config2[prop]); - } else if (prop in config1) { - config[prop] = getMergedValue(undefined, config1[prop]); - } - }); - - var axiosKeys = valueFromConfig2Keys - .concat(mergeDeepPropertiesKeys) - .concat(defaultToConfig2Keys) - .concat(directMergeKeys); - - var otherKeys = Object - .keys(config1) - .concat(Object.keys(config2)) - .filter(function filterAxiosKeys(key) { - return axiosKeys.indexOf(key) === -1; - }); - - utils.forEach(otherKeys, mergeDeepProperties); - - return config; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/settle.js": -/*!***********************************************!*\ - !*** ./node_modules/axios/lib/core/settle.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_53876__) { - -"use strict"; - - -var createError = __nested_webpack_require_53876__(/*! ./createError */ "./node_modules/axios/lib/core/createError.js"); - -/** - * Resolve or reject a Promise based on response status. - * - * @param {Function} resolve A function that resolves the promise. - * @param {Function} reject A function that rejects the promise. - * @param {object} response The response. - */ -module.exports = function settle(resolve, reject, response) { - var validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve(response); - } else { - reject(createError( - 'Request failed with status code ' + response.status, - response.config, - null, - response.request, - response - )); - } -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/transformData.js": -/*!******************************************************!*\ - !*** ./node_modules/axios/lib/core/transformData.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_54983__) { - -"use strict"; - - -var utils = __nested_webpack_require_54983__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - -/** - * Transform the data for a request or a response - * - * @param {Object|String} data The data to be transformed - * @param {Array} headers The headers for the request or response - * @param {Array|Function} fns A single function or Array of functions - * @returns {*} The resulting transformed data - */ -module.exports = function transformData(data, headers, fns) { - /*eslint no-param-reassign:0*/ - utils.forEach(fns, function transform(fn) { - data = fn(data, headers); - }); - - return data; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/defaults.js": -/*!********************************************!*\ - !*** ./node_modules/axios/lib/defaults.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_55883__) { - -"use strict"; - - -var utils = __nested_webpack_require_55883__(/*! ./utils */ "./node_modules/axios/lib/utils.js"); -var normalizeHeaderName = __nested_webpack_require_55883__(/*! ./helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js"); - -var DEFAULT_CONTENT_TYPE = { - 'Content-Type': 'application/x-www-form-urlencoded' -}; - -function setContentTypeIfUnset(headers, value) { - if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { - headers['Content-Type'] = value; - } -} - -function getDefaultAdapter() { - var adapter; - if (typeof XMLHttpRequest !== 'undefined') { - // For browsers use XHR adapter - adapter = __nested_webpack_require_55883__(/*! ./adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js"); - } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { - // For node use HTTP adapter - adapter = __nested_webpack_require_55883__(/*! ./adapters/http */ "./node_modules/axios/lib/adapters/http.js"); - } - return adapter; -} - -var defaults = { - adapter: getDefaultAdapter(), - - transformRequest: [function transformRequest(data, headers) { - normalizeHeaderName(headers, 'Accept'); - normalizeHeaderName(headers, 'Content-Type'); - if (utils.isFormData(data) || - utils.isArrayBuffer(data) || - utils.isBuffer(data) || - utils.isStream(data) || - utils.isFile(data) || - utils.isBlob(data) - ) { - return data; - } - if (utils.isArrayBufferView(data)) { - return data.buffer; - } - if (utils.isURLSearchParams(data)) { - setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); - return data.toString(); - } - if (utils.isObject(data)) { - setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); - return JSON.stringify(data); - } - return data; - }], - - transformResponse: [function transformResponse(data) { - /*eslint no-param-reassign:0*/ - if (typeof data === 'string') { - try { - data = JSON.parse(data); - } catch (e) { /* Ignore */ } - } - return data; - }], - - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', - - maxContentLength: -1, - maxBodyLength: -1, - - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - } -}; - -defaults.headers = { - common: { - 'Accept': 'application/json, text/plain, */*' - } -}; - -utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { - defaults.headers[method] = {}; -}); - -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); -}); - -module.exports = defaults; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/bind.js": -/*!************************************************!*\ - !*** ./node_modules/axios/lib/helpers/bind.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; - - -module.exports = function bind(fn, thisArg) { - return function wrap() { - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - return fn.apply(thisArg, args); - }; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/buildURL.js": -/*!****************************************************!*\ - !*** ./node_modules/axios/lib/helpers/buildURL.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_59593__) { - -"use strict"; - - -var utils = __nested_webpack_require_59593__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - -function encode(val) { - return encodeURIComponent(val). - replace(/%3A/gi, ':'). - replace(/%24/g, '$'). - replace(/%2C/gi, ','). - replace(/%20/g, '+'). - replace(/%5B/gi, '['). - replace(/%5D/gi, ']'); -} - -/** - * Build a URL by appending params to the end - * - * @param {string} url The base of the url (e.g., http://www.google.com) - * @param {object} [params] The params to be appended - * @returns {string} The formatted url - */ -module.exports = function buildURL(url, params, paramsSerializer) { - /*eslint no-param-reassign:0*/ - if (!params) { - return url; - } - - var serializedParams; - if (paramsSerializer) { - serializedParams = paramsSerializer(params); - } else if (utils.isURLSearchParams(params)) { - serializedParams = params.toString(); - } else { - var parts = []; - - utils.forEach(params, function serialize(val, key) { - if (val === null || typeof val === 'undefined') { - return; - } - - if (utils.isArray(val)) { - key = key + '[]'; - } else { - val = [val]; - } - - utils.forEach(val, function parseValue(v) { - if (utils.isDate(v)) { - v = v.toISOString(); - } else if (utils.isObject(v)) { - v = JSON.stringify(v); - } - parts.push(encode(key) + '=' + encode(v)); - }); - }); - - serializedParams = parts.join('&'); - } - - if (serializedParams) { - var hashmarkIndex = url.indexOf('#'); - if (hashmarkIndex !== -1) { - url = url.slice(0, hashmarkIndex); - } - - url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; - } - - return url; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/combineURLs.js": -/*!*******************************************************!*\ - !*** ./node_modules/axios/lib/helpers/combineURLs.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; - - -/** - * Creates a new URL by combining the specified URLs - * - * @param {string} baseURL The base URL - * @param {string} relativeURL The relative URL - * @returns {string} The combined URL - */ -module.exports = function combineURLs(baseURL, relativeURL) { - return relativeURL - ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') - : baseURL; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/cookies.js": -/*!***************************************************!*\ - !*** ./node_modules/axios/lib/helpers/cookies.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_62336__) { - -"use strict"; - - -var utils = __nested_webpack_require_62336__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - -module.exports = ( - utils.isStandardBrowserEnv() ? - - // Standard browser envs support document.cookie - (function standardBrowserEnv() { - return { - write: function write(name, value, expires, path, domain, secure) { - var cookie = []; - cookie.push(name + '=' + encodeURIComponent(value)); - - if (utils.isNumber(expires)) { - cookie.push('expires=' + new Date(expires).toGMTString()); - } - - if (utils.isString(path)) { - cookie.push('path=' + path); - } - - if (utils.isString(domain)) { - cookie.push('domain=' + domain); - } - - if (secure === true) { - cookie.push('secure'); - } - - document.cookie = cookie.join('; '); - }, - - read: function read(name) { - var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); - return (match ? decodeURIComponent(match[3]) : null); - }, - - remove: function remove(name) { - this.write(name, '', Date.now() - 86400000); - } - }; - })() : - - // Non standard browser env (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return { - write: function write() {}, - read: function read() { return null; }, - remove: function remove() {} - }; - })() -); - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": -/*!*********************************************************!*\ - !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; - - -/** - * Determines whether the specified URL is absolute - * - * @param {string} url The URL to test - * @returns {boolean} True if the specified URL is absolute, otherwise false - */ -module.exports = function isAbsoluteURL(url) { - // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). - // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed - // by any combination of letters, digits, plus, period, or hyphen. - return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/isAxiosError.js": -/*!********************************************************!*\ - !*** ./node_modules/axios/lib/helpers/isAxiosError.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; - - -/** - * Determines whether the payload is an error thrown by Axios - * - * @param {*} payload The value to test - * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false - */ -module.exports = function isAxiosError(payload) { - return (typeof payload === 'object') && (payload.isAxiosError === true); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": -/*!***********************************************************!*\ - !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_65781__) { - -"use strict"; - - -var utils = __nested_webpack_require_65781__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - -module.exports = ( - utils.isStandardBrowserEnv() ? - - // Standard browser envs have full support of the APIs needed to test - // whether the request URL is of the same origin as current location. - (function standardBrowserEnv() { - var msie = /(msie|trident)/i.test(navigator.userAgent); - var urlParsingNode = document.createElement('a'); - var originURL; - - /** - * Parse a URL to discover it's components - * - * @param {String} url The URL to be parsed - * @returns {Object} - */ - function resolveURL(url) { - var href = url; - - if (msie) { - // IE needs attribute set twice to normalize properties - urlParsingNode.setAttribute('href', href); - href = urlParsingNode.href; - } - - urlParsingNode.setAttribute('href', href); - - // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils - return { - href: urlParsingNode.href, - protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', - host: urlParsingNode.host, - search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', - hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', - hostname: urlParsingNode.hostname, - port: urlParsingNode.port, - pathname: (urlParsingNode.pathname.charAt(0) === '/') ? - urlParsingNode.pathname : - '/' + urlParsingNode.pathname - }; - } - - originURL = resolveURL(window.location.href); - - /** - * Determine if a URL shares the same origin as the current location - * - * @param {String} requestURL The URL to test - * @returns {boolean} True if URL shares the same origin, otherwise false - */ - return function isURLSameOrigin(requestURL) { - var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; - return (parsed.protocol === originURL.protocol && - parsed.host === originURL.host); - }; - })() : - - // Non standard browser envs (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return function isURLSameOrigin() { - return true; - }; - })() -); - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js": -/*!***************************************************************!*\ - !*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_68512__) { - -"use strict"; - - -var utils = __nested_webpack_require_68512__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); - -module.exports = function normalizeHeaderName(headers, normalizedName) { - utils.forEach(headers, function processHeader(value, name) { - if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { - headers[normalizedName] = value; - delete headers[name]; - } - }); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/parseHeaders.js": -/*!********************************************************!*\ - !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_69267__) { - -"use strict"; - - -var utils = __nested_webpack_require_69267__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - -// Headers whose duplicates are ignored by node -// c.f. https://nodejs.org/api/http.html#http_message_headers -var ignoreDuplicateOf = [ - 'age', 'authorization', 'content-length', 'content-type', 'etag', - 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', - 'last-modified', 'location', 'max-forwards', 'proxy-authorization', - 'referer', 'retry-after', 'user-agent' -]; - -/** - * Parse headers into an object - * - * ``` - * Date: Wed, 27 Aug 2014 08:58:49 GMT - * Content-Type: application/json - * Connection: keep-alive - * Transfer-Encoding: chunked - * ``` - * - * @param {String} headers Headers needing to be parsed - * @returns {Object} Headers parsed into an object - */ -module.exports = function parseHeaders(headers) { - var parsed = {}; - var key; - var val; - var i; - - if (!headers) { return parsed; } - - utils.forEach(headers.split('\n'), function parser(line) { - i = line.indexOf(':'); - key = utils.trim(line.substr(0, i)).toLowerCase(); - val = utils.trim(line.substr(i + 1)); - - if (key) { - if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { - return; - } - if (key === 'set-cookie') { - parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); - } else { - parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; - } - } - }); - - return parsed; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/spread.js": -/*!**************************************************!*\ - !*** ./node_modules/axios/lib/helpers/spread.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; - - -/** - * Syntactic sugar for invoking a function and expanding an array for arguments. - * - * Common use case would be to use `Function.prototype.apply`. - * - * ```js - * function f(x, y, z) {} - * var args = [1, 2, 3]; - * f.apply(null, args); - * ``` - * - * With `spread` this example can be re-written. - * - * ```js - * spread(function(x, y, z) {})([1, 2, 3]); - * ``` - * - * @param {Function} callback - * @returns {Function} - */ -module.exports = function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/utils.js": -/*!*****************************************!*\ - !*** ./node_modules/axios/lib/utils.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_71883__) { - -"use strict"; - - -var bind = __nested_webpack_require_71883__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); - -/*global toString:true*/ - -// utils is a library of generic helper functions non-specific to axios - -var toString = Object.prototype.toString; - -/** - * Determine if a value is an Array - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Array, otherwise false - */ -function isArray(val) { - return toString.call(val) === '[object Array]'; -} - -/** - * Determine if a value is undefined - * - * @param {Object} val The value to test - * @returns {boolean} True if the value is undefined, otherwise false - */ -function isUndefined(val) { - return typeof val === 'undefined'; -} - -/** - * Determine if a value is a Buffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Buffer, otherwise false - */ -function isBuffer(val) { - return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) - && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); -} - -/** - * Determine if a value is an ArrayBuffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an ArrayBuffer, otherwise false - */ -function isArrayBuffer(val) { - return toString.call(val) === '[object ArrayBuffer]'; -} - -/** - * Determine if a value is a FormData - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an FormData, otherwise false - */ -function isFormData(val) { - return (typeof FormData !== 'undefined') && (val instanceof FormData); -} - -/** - * Determine if a value is a view on an ArrayBuffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false - */ -function isArrayBufferView(val) { - var result; - if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { - result = ArrayBuffer.isView(val); - } else { - result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); - } - return result; -} - -/** - * Determine if a value is a String - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a String, otherwise false - */ -function isString(val) { - return typeof val === 'string'; -} - -/** - * Determine if a value is a Number - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Number, otherwise false - */ -function isNumber(val) { - return typeof val === 'number'; -} - -/** - * Determine if a value is an Object - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Object, otherwise false - */ -function isObject(val) { - return val !== null && typeof val === 'object'; -} - -/** - * Determine if a value is a plain Object - * - * @param {Object} val The value to test - * @return {boolean} True if value is a plain Object, otherwise false - */ -function isPlainObject(val) { - if (toString.call(val) !== '[object Object]') { - return false; - } - - var prototype = Object.getPrototypeOf(val); - return prototype === null || prototype === Object.prototype; -} - -/** - * Determine if a value is a Date - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Date, otherwise false - */ -function isDate(val) { - return toString.call(val) === '[object Date]'; -} - -/** - * Determine if a value is a File - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a File, otherwise false - */ -function isFile(val) { - return toString.call(val) === '[object File]'; -} - -/** - * Determine if a value is a Blob - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Blob, otherwise false - */ -function isBlob(val) { - return toString.call(val) === '[object Blob]'; -} - -/** - * Determine if a value is a Function - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Function, otherwise false - */ -function isFunction(val) { - return toString.call(val) === '[object Function]'; -} - -/** - * Determine if a value is a Stream - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Stream, otherwise false - */ -function isStream(val) { - return isObject(val) && isFunction(val.pipe); -} - -/** - * Determine if a value is a URLSearchParams object - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a URLSearchParams object, otherwise false - */ -function isURLSearchParams(val) { - return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; -} - -/** - * Trim excess whitespace off the beginning and end of a string - * - * @param {String} str The String to trim - * @returns {String} The String freed of excess whitespace - */ -function trim(str) { - return str.replace(/^\s*/, '').replace(/\s*$/, ''); -} - -/** - * Determine if we're running in a standard browser environment - * - * This allows axios to run in a web worker, and react-native. - * Both environments support XMLHttpRequest, but not fully standard globals. - * - * web workers: - * typeof window -> undefined - * typeof document -> undefined - * - * react-native: - * navigator.product -> 'ReactNative' - * nativescript - * navigator.product -> 'NativeScript' or 'NS' - */ -function isStandardBrowserEnv() { - if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || - navigator.product === 'NativeScript' || - navigator.product === 'NS')) { - return false; - } - return ( - typeof window !== 'undefined' && - typeof document !== 'undefined' - ); -} - -/** - * Iterate over an Array or an Object invoking a function for each item. - * - * If `obj` is an Array callback will be called passing - * the value, index, and complete array for each item. - * - * If 'obj' is an Object callback will be called passing - * the value, key, and complete object for each property. - * - * @param {Object|Array} obj The object to iterate - * @param {Function} fn The callback to invoke for each item - */ -function forEach(obj, fn) { - // Don't bother if no value provided - if (obj === null || typeof obj === 'undefined') { - return; - } - - // Force an array if not already something iterable - if (typeof obj !== 'object') { - /*eslint no-param-reassign:0*/ - obj = [obj]; - } - - if (isArray(obj)) { - // Iterate over array values - for (var i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - // Iterate over object keys - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - fn.call(null, obj[key], key, obj); - } - } - } -} - -/** - * Accepts varargs expecting each argument to be an object, then - * immutably merges the properties of each object and returns result. - * - * When multiple objects contain the same key the later object in - * the arguments list will take precedence. - * - * Example: - * - * ```js - * var result = merge({foo: 123}, {foo: 456}); - * console.log(result.foo); // outputs 456 - * ``` - * - * @param {Object} obj1 Object to merge - * @returns {Object} Result of all merge properties - */ -function merge(/* obj1, obj2, obj3, ... */) { - var result = {}; - function assignValue(val, key) { - if (isPlainObject(result[key]) && isPlainObject(val)) { - result[key] = merge(result[key], val); - } else if (isPlainObject(val)) { - result[key] = merge({}, val); - } else if (isArray(val)) { - result[key] = val.slice(); - } else { - result[key] = val; - } - } - - for (var i = 0, l = arguments.length; i < l; i++) { - forEach(arguments[i], assignValue); - } - return result; -} - -/** - * Extends object a by mutably adding to it the properties of object b. - * - * @param {Object} a The object to be extended - * @param {Object} b The object to copy properties from - * @param {Object} thisArg The object to bind function to - * @return {Object} The resulting value of object a - */ -function extend(a, b, thisArg) { - forEach(b, function assignValue(val, key) { - if (thisArg && typeof val === 'function') { - a[key] = bind(val, thisArg); - } else { - a[key] = val; - } - }); - return a; -} - -/** - * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) - * - * @param {string} content with BOM - * @return {string} content value without BOM - */ -function stripBOM(content) { - if (content.charCodeAt(0) === 0xFEFF) { - content = content.slice(1); - } - return content; -} - -module.exports = { - isArray: isArray, - isArrayBuffer: isArrayBuffer, - isBuffer: isBuffer, - isFormData: isFormData, - isArrayBufferView: isArrayBufferView, - isString: isString, - isNumber: isNumber, - isObject: isObject, - isPlainObject: isPlainObject, - isUndefined: isUndefined, - isDate: isDate, - isFile: isFile, - isBlob: isBlob, - isFunction: isFunction, - isStream: isStream, - isURLSearchParams: isURLSearchParams, - isStandardBrowserEnv: isStandardBrowserEnv, - forEach: forEach, - merge: merge, - extend: extend, - trim: trim, - stripBOM: stripBOM -}; - - -/***/ }), - -/***/ "./node_modules/axios/package.json": -/*!*****************************************!*\ - !*** ./node_modules/axios/package.json ***! - \*****************************************/ -/*! exports provided: _args, _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _spec, _where, author, browser, bugs, bundlesize, dependencies, description, devDependencies, homepage, jsdelivr, keywords, license, main, name, repository, scripts, typings, unpkg, version, default */ -/***/ (function(module) { - -module.exports = JSON.parse("{\"_args\":[[\"axios@0.21.1\",\"/Users/mattober/Repos/ipfs/pinata/open-source-tools/Pinata-SDK\"]],\"_from\":\"axios@0.21.1\",\"_id\":\"axios@0.21.1\",\"_inBundle\":false,\"_integrity\":\"sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==\",\"_location\":\"/axios\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"version\",\"registry\":true,\"raw\":\"axios@0.21.1\",\"name\":\"axios\",\"escapedName\":\"axios\",\"rawSpec\":\"0.21.1\",\"saveSpec\":null,\"fetchSpec\":\"0.21.1\"},\"_requiredBy\":[\"/\"],\"_resolved\":\"https://registry.npmjs.org/axios/-/axios-0.21.1.tgz\",\"_spec\":\"0.21.1\",\"_where\":\"/Users/mattober/Repos/ipfs/pinata/open-source-tools/Pinata-SDK\",\"author\":{\"name\":\"Matt Zabriskie\"},\"browser\":{\"./lib/adapters/http.js\":\"./lib/adapters/xhr.js\"},\"bugs\":{\"url\":\"https://github.com/axios/axios/issues\"},\"bundlesize\":[{\"path\":\"./dist/axios.min.js\",\"threshold\":\"5kB\"}],\"dependencies\":{\"follow-redirects\":\"^1.10.0\"},\"description\":\"Promise based HTTP client for the browser and node.js\",\"devDependencies\":{\"bundlesize\":\"^0.17.0\",\"coveralls\":\"^3.0.0\",\"es6-promise\":\"^4.2.4\",\"grunt\":\"^1.0.2\",\"grunt-banner\":\"^0.6.0\",\"grunt-cli\":\"^1.2.0\",\"grunt-contrib-clean\":\"^1.1.0\",\"grunt-contrib-watch\":\"^1.0.0\",\"grunt-eslint\":\"^20.1.0\",\"grunt-karma\":\"^2.0.0\",\"grunt-mocha-test\":\"^0.13.3\",\"grunt-ts\":\"^6.0.0-beta.19\",\"grunt-webpack\":\"^1.0.18\",\"istanbul-instrumenter-loader\":\"^1.0.0\",\"jasmine-core\":\"^2.4.1\",\"karma\":\"^1.3.0\",\"karma-chrome-launcher\":\"^2.2.0\",\"karma-coverage\":\"^1.1.1\",\"karma-firefox-launcher\":\"^1.1.0\",\"karma-jasmine\":\"^1.1.1\",\"karma-jasmine-ajax\":\"^0.1.13\",\"karma-opera-launcher\":\"^1.0.0\",\"karma-safari-launcher\":\"^1.0.0\",\"karma-sauce-launcher\":\"^1.2.0\",\"karma-sinon\":\"^1.0.5\",\"karma-sourcemap-loader\":\"^0.3.7\",\"karma-webpack\":\"^1.7.0\",\"load-grunt-tasks\":\"^3.5.2\",\"minimist\":\"^1.2.0\",\"mocha\":\"^5.2.0\",\"sinon\":\"^4.5.0\",\"typescript\":\"^2.8.1\",\"url-search-params\":\"^0.10.0\",\"webpack\":\"^1.13.1\",\"webpack-dev-server\":\"^1.14.1\"},\"homepage\":\"https://github.com/axios/axios\",\"jsdelivr\":\"dist/axios.min.js\",\"keywords\":[\"xhr\",\"http\",\"ajax\",\"promise\",\"node\"],\"license\":\"MIT\",\"main\":\"index.js\",\"name\":\"axios\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/axios/axios.git\"},\"scripts\":{\"build\":\"NODE_ENV=production grunt build\",\"coveralls\":\"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\"examples\":\"node ./examples/server.js\",\"fix\":\"eslint --fix lib/**/*.js\",\"postversion\":\"git push && git push --tags\",\"preversion\":\"npm test\",\"start\":\"node ./sandbox/server.js\",\"test\":\"grunt test && bundlesize\",\"version\":\"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\"},\"typings\":\"./index.d.ts\",\"unpkg\":\"dist/axios.min.js\",\"version\":\"0.21.1\"}"); - -/***/ }), - -/***/ "./node_modules/babel-polyfill/lib/index.js": -/*!**************************************************!*\ - !*** ./node_modules/babel-polyfill/lib/index.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_84831__) { - -"use strict"; - - -__nested_webpack_require_84831__(/*! core-js/shim */ "./node_modules/core-js/shim.js"); - -__nested_webpack_require_84831__(/*! regenerator-runtime/runtime */ "./node_modules/regenerator-runtime/runtime.js"); - -__nested_webpack_require_84831__(/*! core-js/fn/regexp/escape */ "./node_modules/core-js/fn/regexp/escape.js"); - -if (global._babelPolyfill) { - throw new Error("only one instance of babel-polyfill is allowed"); -} -global._babelPolyfill = true; - -var DEFINE_PROPERTY = "defineProperty"; -function define(O, key, value) { - O[key] || Object[DEFINE_PROPERTY](O, key, { - writable: true, - configurable: true, - value: value - }); -} - -define(String.prototype, "padLeft", "".padStart); -define(String.prototype, "padRight", "".padEnd); - -"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function (key) { - [][key] && define(Array, key, Function.call.bind([][key])); -}); - -/***/ }), - -/***/ "./node_modules/base-path-converter/index.js": -/*!***************************************************!*\ - !*** ./node_modules/base-path-converter/index.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -function convertFilePathToBaseDirectoryPath(sourcePath, filePath) { - let newString = (sourcePath.startsWith('./') ? sourcePath.substring(2) : sourcePath); - //make sure there isn't a dangling / to throw a false positive into the mix - const lastIndexOfDirectory = newString.lastIndexOf('/'); - if(lastIndexOfDirectory === -1) { - return filePath; - } - const lengthOfSource = sourcePath.length; - //only trim if the / is the last character in the string - if (lastIndexOfDirectory === (lengthOfSource - 1)) { - newString = sourcePath.slice(0,-1); - } - - //now that we're sure of no false positive, let's check and see where the "root" directory is - const newLastIndex = newString.lastIndexOf('/'); - if ( newLastIndex === -1) { - return newString; - } else { - const pathGarbage = newString.substring(0, newLastIndex + 1); - newString = filePath.split(pathGarbage)[1]; - } - - return newString; -} - -module.exports = convertFilePathToBaseDirectoryPath - -/***/ }), - -/***/ "./node_modules/base-x/src/index.js": -/*!******************************************!*\ - !*** ./node_modules/base-x/src/index.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_87443__) { - -"use strict"; - -// base-x encoding / decoding -// Copyright (c) 2018 base-x contributors -// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) -// Distributed under the MIT software license, see the accompanying -// file LICENSE or http://www.opensource.org/licenses/mit-license.php. -// @ts-ignore -var _Buffer = __nested_webpack_require_87443__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer -function base (ALPHABET) { - if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } - var BASE_MAP = new Uint8Array(256) - for (var j = 0; j < BASE_MAP.length; j++) { - BASE_MAP[j] = 255 - } - for (var i = 0; i < ALPHABET.length; i++) { - var x = ALPHABET.charAt(i) - var xc = x.charCodeAt(0) - if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') } - BASE_MAP[xc] = i - } - var BASE = ALPHABET.length - var LEADER = ALPHABET.charAt(0) - var FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up - var iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up - function encode (source) { - if (Array.isArray(source) || source instanceof Uint8Array) { source = _Buffer.from(source) } - if (!_Buffer.isBuffer(source)) { throw new TypeError('Expected Buffer') } - if (source.length === 0) { return '' } - // Skip & count leading zeroes. - var zeroes = 0 - var length = 0 - var pbegin = 0 - var pend = source.length - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++ - zeroes++ - } - // Allocate enough space in big-endian base58 representation. - var size = ((pend - pbegin) * iFACTOR + 1) >>> 0 - var b58 = new Uint8Array(size) - // Process the bytes. - while (pbegin !== pend) { - var carry = source[pbegin] - // Apply "b58 = b58 * 256 + ch". - var i = 0 - for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { - carry += (256 * b58[it1]) >>> 0 - b58[it1] = (carry % BASE) >>> 0 - carry = (carry / BASE) >>> 0 - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i - pbegin++ - } - // Skip leading zeroes in base58 result. - var it2 = size - length - while (it2 !== size && b58[it2] === 0) { - it2++ - } - // Translate the result into a string. - var str = LEADER.repeat(zeroes) - for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]) } - return str - } - function decodeUnsafe (source) { - if (typeof source !== 'string') { throw new TypeError('Expected String') } - if (source.length === 0) { return _Buffer.alloc(0) } - var psz = 0 - // Skip leading spaces. - if (source[psz] === ' ') { return } - // Skip and count leading '1's. - var zeroes = 0 - var length = 0 - while (source[psz] === LEADER) { - zeroes++ - psz++ - } - // Allocate enough space in big-endian base256 representation. - var size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up. - var b256 = new Uint8Array(size) - // Process the characters. - while (source[psz]) { - // Decode character - var carry = BASE_MAP[source.charCodeAt(psz)] - // Invalid character - if (carry === 255) { return } - var i = 0 - for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { - carry += (BASE * b256[it3]) >>> 0 - b256[it3] = (carry % 256) >>> 0 - carry = (carry / 256) >>> 0 - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i - psz++ - } - // Skip trailing spaces. - if (source[psz] === ' ') { return } - // Skip leading zeroes in b256. - var it4 = size - length - while (it4 !== size && b256[it4] === 0) { - it4++ - } - var vch = _Buffer.allocUnsafe(zeroes + (size - it4)) - vch.fill(0x00, 0, zeroes) - var j = zeroes - while (it4 !== size) { - vch[j++] = b256[it4++] - } - return vch - } - function decode (string) { - var buffer = decodeUnsafe(string) - if (buffer) { return buffer } - throw new Error('Non-base' + BASE + ' character') - } - return { - encode: encode, - decodeUnsafe: decodeUnsafe, - decode: decode - } -} -module.exports = base - - -/***/ }), - -/***/ "./node_modules/bs58/index.js": -/*!************************************!*\ - !*** ./node_modules/bs58/index.js ***! - \************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_91968__) { - -var basex = __nested_webpack_require_91968__(/*! base-x */ "./node_modules/base-x/src/index.js") -var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' - -module.exports = basex(ALPHABET) - - -/***/ }), - -/***/ "./node_modules/cids/src/cid-util.js": -/*!*******************************************!*\ - !*** ./node_modules/cids/src/cid-util.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_92454__) { - -"use strict"; - - -const mh = __nested_webpack_require_92454__(/*! multihashes */ "./node_modules/multihashes/src/index.js") - -var CIDUtil = { - /** - * Test if the given input is a valid CID object. - * Returns an error message if it is not. - * Returns undefined if it is a valid CID. - * - * @param {any} other - * @returns {string} - */ - checkCIDComponents: function (other) { - if (other == null) { - return 'null values are not valid CIDs' - } - - if (!(other.version === 0 || other.version === 1)) { - return 'Invalid version, must be a number equal to 1 or 0' - } - - if (typeof other.codec !== 'string') { - return 'codec must be string' - } - - if (other.version === 0) { - if (other.codec !== 'dag-pb') { - return "codec must be 'dag-pb' for CIDv0" - } - if (other.multibaseName !== 'base58btc') { - return "multibaseName must be 'base58btc' for CIDv0" - } - } - - if (!Buffer.isBuffer(other.multihash)) { - return 'multihash must be a Buffer' - } - - try { - mh.validate(other.multihash) - } catch (err) { - let errorMsg = err.message - if (!errorMsg) { // Just in case mh.validate() throws an error with empty error message - errorMsg = 'Multihash validation failed' - } - return errorMsg - } - } -} - -module.exports = CIDUtil - - -/***/ }), - -/***/ "./node_modules/cids/src/index.js": -/*!****************************************!*\ - !*** ./node_modules/cids/src/index.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_94054__) { - -"use strict"; - - -const mh = __nested_webpack_require_94054__(/*! multihashes */ "./node_modules/multihashes/src/index.js") -const multibase = __nested_webpack_require_94054__(/*! multibase */ "./node_modules/multibase/src/index.js") -const multicodec = __nested_webpack_require_94054__(/*! multicodec */ "./node_modules/multicodec/src/index.js") -const codecs = __nested_webpack_require_94054__(/*! multicodec/src/base-table.json */ "./node_modules/multicodec/src/base-table.json") -const CIDUtil = __nested_webpack_require_94054__(/*! ./cid-util */ "./node_modules/cids/src/cid-util.js") -const withIs = __nested_webpack_require_94054__(/*! class-is */ "./node_modules/class-is/index.js") - -/** - * @typedef {Object} SerializedCID - * @param {string} codec - * @param {number} version - * @param {Buffer} multihash - */ - -/** - * Test if the given input is a CID. - * @function isCID - * @memberof CID - * @static - * @param {any} other - * @returns {bool} - */ - -/** - * Class representing a CID `` - * , as defined in [ipld/cid](https://github.com/multiformats/cid). - * @class CID - */ -class CID { - /** - * Create a new CID. - * - * The algorithm for argument input is roughly: - * ``` - * if (cid) - * -> create a copy - * else if (str) - * if (1st char is on multibase table) -> CID String - * else -> bs58 encoded multihash - * else if (Buffer) - * if (1st byte is 0 or 1) -> CID - * else -> multihash - * else if (Number) - * -> construct CID by parts - * ``` - * - * @param {string|Buffer|CID} version - * @param {string} [codec] - * @param {Buffer} [multihash] - * @param {string} [multibaseName] - * - * @example - * new CID(, , , ) - * new CID() - * new CID() - * new CID() - * new CID() - * new CID() - */ - constructor (version, codec, multihash, multibaseName) { - if (_CID.isCID(version)) { - // version is an exising CID instance - const cid = version - this.version = cid.version - this.codec = cid.codec - this.multihash = Buffer.from(cid.multihash) - // Default guard for when a CID < 0.7 is passed with no multibaseName - this.multibaseName = cid.multibaseName || (cid.version === 0 ? 'base58btc' : 'base32') - return - } - - if (typeof version === 'string') { - // e.g. 'base32' or false - const baseName = multibase.isEncoded(version) - if (baseName) { - // version is a CID String encoded with multibase, so v1 - const cid = multibase.decode(version) - this.version = parseInt(cid.slice(0, 1).toString('hex'), 16) - this.codec = multicodec.getCodec(cid.slice(1)) - this.multihash = multicodec.rmPrefix(cid.slice(1)) - this.multibaseName = baseName - } else { - // version is a base58btc string multihash, so v0 - this.version = 0 - this.codec = 'dag-pb' - this.multihash = mh.fromB58String(version) - this.multibaseName = 'base58btc' - } - CID.validateCID(this) - Object.defineProperty(this, 'string', { value: version }) - return - } - - if (Buffer.isBuffer(version)) { - const firstByte = version.slice(0, 1) - const v = parseInt(firstByte.toString('hex'), 16) - if (v === 1) { - // version is a CID buffer - const cid = version - this.version = v - this.codec = multicodec.getCodec(cid.slice(1)) - this.multihash = multicodec.rmPrefix(cid.slice(1)) - this.multibaseName = 'base32' - } else { - // version is a raw multihash buffer, so v0 - this.version = 0 - this.codec = 'dag-pb' - this.multihash = version - this.multibaseName = 'base58btc' - } - CID.validateCID(this) - return - } - - // otherwise, assemble the CID from the parameters - - /** - * @type {number} - */ - this.version = version - - /** - * @type {string} - */ - this.codec = codec - - /** - * @type {Buffer} - */ - this.multihash = multihash - - /** - * @type {string} - */ - this.multibaseName = multibaseName || (version === 0 ? 'base58btc' : 'base32') - - CID.validateCID(this) - } - - /** - * The CID as a `Buffer` - * - * @return {Buffer} - * @readonly - * - * @memberOf CID - */ - get buffer () { - let buffer = this._buffer - - if (!buffer) { - if (this.version === 0) { - buffer = this.multihash - } else if (this.version === 1) { - buffer = Buffer.concat([ - Buffer.from('01', 'hex'), - multicodec.getCodeVarint(this.codec), - this.multihash - ]) - } else { - throw new Error('unsupported version') - } - - // Cache this buffer so it doesn't have to be recreated - Object.defineProperty(this, '_buffer', { value: buffer }) - } - - return buffer - } - - /** - * Get the prefix of the CID. - * - * @returns {Buffer} - * @readonly - */ - get prefix () { - return Buffer.concat([ - Buffer.from(`0${this.version}`, 'hex'), - multicodec.getCodeVarint(this.codec), - mh.prefix(this.multihash) - ]) - } - - /** - * Convert to a CID of version `0`. - * - * @returns {CID} - */ - toV0 () { - if (this.codec !== 'dag-pb') { - throw new Error('Cannot convert a non dag-pb CID to CIDv0') - } - - const { name, length } = mh.decode(this.multihash) - - if (name !== 'sha2-256') { - throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') - } - - if (length !== 32) { - throw new Error('Cannot convert non 32 byte multihash CID to CIDv0') - } - - return new _CID(0, this.codec, this.multihash) - } - - /** - * Convert to a CID of version `1`. - * - * @returns {CID} - */ - toV1 () { - return new _CID(1, this.codec, this.multihash) - } - - /** - * Encode the CID into a string. - * - * @param {string} [base=this.multibaseName] - Base encoding to use. - * @returns {string} - */ - toBaseEncodedString (base = this.multibaseName) { - if (this.string && base === this.multibaseName) { - return this.string - } - let str = null - if (this.version === 0) { - if (base !== 'base58btc') { - throw new Error('not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()') - } - str = mh.toB58String(this.multihash) - } else if (this.version === 1) { - str = multibase.encode(base, this.buffer).toString() - } else { - throw new Error('unsupported version') - } - if (base === this.multibaseName) { - // cache the string value - Object.defineProperty(this, 'string', { value: str }) - } - return str - } - - toString (base) { - return this.toBaseEncodedString(base) - } - - /** - * Serialize to a plain object. - * - * @returns {SerializedCID} - */ - toJSON () { - return { - codec: this.codec, - version: this.version, - hash: this.multihash - } - } - - /** - * Compare equality with another CID. - * - * @param {CID} other - * @returns {bool} - */ - equals (other) { - return this.codec === other.codec && - this.version === other.version && - this.multihash.equals(other.multihash) - } - - /** - * Test if the given input is a valid CID object. - * Throws if it is not. - * - * @param {any} other - * @returns {void} - */ - static validateCID (other) { - const errorMsg = CIDUtil.checkCIDComponents(other) - if (errorMsg) { - throw new Error(errorMsg) - } - } -} - -const _CID = withIs(CID, { - className: 'CID', - symbolName: '@ipld/js-cid/CID' -}) - -_CID.codecs = codecs - -module.exports = _CID - - -/***/ }), - -/***/ "./node_modules/class-is/index.js": -/*!****************************************!*\ - !*** ./node_modules/class-is/index.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; - - -function withIs(Class, { className, symbolName }) { - const symbol = Symbol.for(symbolName); - - const ClassIsWrapper = { - // The code below assigns the class wrapper to an object to trick - // JavaScript engines to show the name of the extended class when - // logging an instances. - // We are assigning an anonymous class (class wrapper) to the object - // with key `className` to keep the correct name. - // If this is not supported it falls back to logging `ClassIsWrapper`. - [className]: class extends Class { - constructor(...args) { - super(...args); - Object.defineProperty(this, symbol, { value: true }); - } - - get [Symbol.toStringTag]() { - return className; - } - }, - }[className]; - - ClassIsWrapper[`is${className}`] = (obj) => !!(obj && obj[symbol]); - - return ClassIsWrapper; -} - -function withIsProto(Class, { className, symbolName, withoutNew }) { - const symbol = Symbol.for(symbolName); - - /* eslint-disable object-shorthand */ - const ClassIsWrapper = { - [className]: function (...args) { - if (withoutNew && !(this instanceof ClassIsWrapper)) { - return new ClassIsWrapper(...args); - } - - const _this = Class.call(this, ...args) || this; - - if (_this && !_this[symbol]) { - Object.defineProperty(_this, symbol, { value: true }); - } - - return _this; - }, - }[className]; - /* eslint-enable object-shorthand */ - - ClassIsWrapper.prototype = Object.create(Class.prototype); - ClassIsWrapper.prototype.constructor = ClassIsWrapper; - - Object.defineProperty(ClassIsWrapper.prototype, Symbol.toStringTag, { - get() { - return className; - }, - }); - - ClassIsWrapper[`is${className}`] = (obj) => !!(obj && obj[symbol]); - - return ClassIsWrapper; -} - -module.exports = withIs; -module.exports.proto = withIsProto; - - -/***/ }), - -/***/ "./node_modules/combined-stream/lib/combined_stream.js": -/*!*************************************************************!*\ - !*** ./node_modules/combined-stream/lib/combined_stream.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_104270__) { - -var util = __nested_webpack_require_104270__(/*! util */ "util"); -var Stream = __nested_webpack_require_104270__(/*! stream */ "stream").Stream; -var DelayedStream = __nested_webpack_require_104270__(/*! delayed-stream */ "./node_modules/delayed-stream/lib/delayed_stream.js"); - -module.exports = CombinedStream; -function CombinedStream() { - this.writable = false; - this.readable = true; - this.dataSize = 0; - this.maxDataSize = 2 * 1024 * 1024; - this.pauseStreams = true; - - this._released = false; - this._streams = []; - this._currentStream = null; - this._insideLoop = false; - this._pendingNext = false; -} -util.inherits(CombinedStream, Stream); - -CombinedStream.create = function(options) { - var combinedStream = new this(); - - options = options || {}; - for (var option in options) { - combinedStream[option] = options[option]; - } - - return combinedStream; -}; - -CombinedStream.isStreamLike = function(stream) { - return (typeof stream !== 'function') - && (typeof stream !== 'string') - && (typeof stream !== 'boolean') - && (typeof stream !== 'number') - && (!Buffer.isBuffer(stream)); -}; - -CombinedStream.prototype.append = function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - - if (isStreamLike) { - if (!(stream instanceof DelayedStream)) { - var newStream = DelayedStream.create(stream, { - maxDataSize: Infinity, - pauseStream: this.pauseStreams, - }); - stream.on('data', this._checkDataSize.bind(this)); - stream = newStream; - } - - this._handleErrors(stream); - - if (this.pauseStreams) { - stream.pause(); - } - } - - this._streams.push(stream); - return this; -}; - -CombinedStream.prototype.pipe = function(dest, options) { - Stream.prototype.pipe.call(this, dest, options); - this.resume(); - return dest; -}; - -CombinedStream.prototype._getNext = function() { - this._currentStream = null; - - if (this._insideLoop) { - this._pendingNext = true; - return; // defer call - } - - this._insideLoop = true; - try { - do { - this._pendingNext = false; - this._realGetNext(); - } while (this._pendingNext); - } finally { - this._insideLoop = false; - } -}; - -CombinedStream.prototype._realGetNext = function() { - var stream = this._streams.shift(); - - - if (typeof stream == 'undefined') { - this.end(); - return; - } - - if (typeof stream !== 'function') { - this._pipeNext(stream); - return; - } - - var getStream = stream; - getStream(function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('data', this._checkDataSize.bind(this)); - this._handleErrors(stream); - } - - this._pipeNext(stream); - }.bind(this)); -}; - -CombinedStream.prototype._pipeNext = function(stream) { - this._currentStream = stream; - - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('end', this._getNext.bind(this)); - stream.pipe(this, {end: false}); - return; - } - - var value = stream; - this.write(value); - this._getNext(); -}; - -CombinedStream.prototype._handleErrors = function(stream) { - var self = this; - stream.on('error', function(err) { - self._emitError(err); - }); -}; - -CombinedStream.prototype.write = function(data) { - this.emit('data', data); -}; - -CombinedStream.prototype.pause = function() { - if (!this.pauseStreams) { - return; - } - - if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); - this.emit('pause'); -}; - -CombinedStream.prototype.resume = function() { - if (!this._released) { - this._released = true; - this.writable = true; - this._getNext(); - } - - if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); - this.emit('resume'); -}; - -CombinedStream.prototype.end = function() { - this._reset(); - this.emit('end'); -}; - -CombinedStream.prototype.destroy = function() { - this._reset(); - this.emit('close'); -}; - -CombinedStream.prototype._reset = function() { - this.writable = false; - this._streams = []; - this._currentStream = null; -}; - -CombinedStream.prototype._checkDataSize = function() { - this._updateDataSize(); - if (this.dataSize <= this.maxDataSize) { - return; - } - - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; - this._emitError(new Error(message)); -}; - -CombinedStream.prototype._updateDataSize = function() { - this.dataSize = 0; - - var self = this; - this._streams.forEach(function(stream) { - if (!stream.dataSize) { - return; - } - - self.dataSize += stream.dataSize; - }); - - if (this._currentStream && this._currentStream.dataSize) { - this.dataSize += this._currentStream.dataSize; - } -}; - -CombinedStream.prototype._emitError = function(err) { - this._reset(); - this.emit('error', err); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/fn/regexp/escape.js": -/*!**************************************************!*\ - !*** ./node_modules/core-js/fn/regexp/escape.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_109398__) { - -__nested_webpack_require_109398__(/*! ../../modules/core.regexp.escape */ "./node_modules/core-js/modules/core.regexp.escape.js"); -module.exports = __nested_webpack_require_109398__(/*! ../../modules/_core */ "./node_modules/core-js/modules/_core.js").RegExp.escape; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_a-function.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_a-function.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = function (it) { - if (typeof it != 'function') throw TypeError(it + ' is not a function!'); - return it; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_a-number-value.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/_a-number-value.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_110421__) { - -var cof = __nested_webpack_require_110421__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); -module.exports = function (it, msg) { - if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg); - return +it; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_add-to-unscopables.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/modules/_add-to-unscopables.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_111001__) { - -// 22.1.3.31 Array.prototype[@@unscopables] -var UNSCOPABLES = __nested_webpack_require_111001__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('unscopables'); -var ArrayProto = Array.prototype; -if (ArrayProto[UNSCOPABLES] == undefined) __nested_webpack_require_111001__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js")(ArrayProto, UNSCOPABLES, {}); -module.exports = function (key) { - ArrayProto[UNSCOPABLES][key] = true; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_advance-string-index.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js/modules/_advance-string-index.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_111787__) { - -"use strict"; - -var at = __nested_webpack_require_111787__(/*! ./_string-at */ "./node_modules/core-js/modules/_string-at.js")(true); - - // `AdvanceStringIndex` abstract operation -// https://tc39.github.io/ecma262/#sec-advancestringindex -module.exports = function (S, index, unicode) { - return index + (unicode ? at(S, index).length : 1); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_an-instance.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/_an-instance.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = function (it, Constructor, name, forbiddenField) { - if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { - throw TypeError(name + ': incorrect invocation!'); - } return it; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_an-object.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/_an-object.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_112994__) { - -var isObject = __nested_webpack_require_112994__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -module.exports = function (it) { - if (!isObject(it)) throw TypeError(it + ' is not an object!'); - return it; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_array-copy-within.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/_array-copy-within.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_113572__) { - -"use strict"; -// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) - -var toObject = __nested_webpack_require_113572__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); -var toAbsoluteIndex = __nested_webpack_require_113572__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); -var toLength = __nested_webpack_require_113572__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); - -module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { - var O = toObject(this); - var len = toLength(O.length); - var to = toAbsoluteIndex(target, len); - var from = toAbsoluteIndex(start, len); - var end = arguments.length > 2 ? arguments[2] : undefined; - var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); - var inc = 1; - if (from < to && to < from + count) { - inc = -1; - from += count - 1; - to += count - 1; - } - while (count-- > 0) { - if (from in O) O[to] = O[from]; - else delete O[to]; - to += inc; - from += inc; - } return O; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_array-fill.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_array-fill.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_114981__) { - -"use strict"; -// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) - -var toObject = __nested_webpack_require_114981__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); -var toAbsoluteIndex = __nested_webpack_require_114981__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); -var toLength = __nested_webpack_require_114981__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -module.exports = function fill(value /* , start = 0, end = @length */) { - var O = toObject(this); - var length = toLength(O.length); - var aLen = arguments.length; - var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); - var end = aLen > 2 ? arguments[2] : undefined; - var endPos = end === undefined ? length : toAbsoluteIndex(end, length); - while (endPos > index) O[index++] = value; - return O; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_array-from-iterable.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/_array-from-iterable.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_116193__) { - -var forOf = __nested_webpack_require_116193__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); - -module.exports = function (iter, ITERATOR) { - var result = []; - forOf(iter, false, result.push, result, ITERATOR); - return result; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_array-includes.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/_array-includes.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_116774__) { - -// false -> Array#indexOf -// true -> Array#includes -var toIObject = __nested_webpack_require_116774__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); -var toLength = __nested_webpack_require_116774__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -var toAbsoluteIndex = __nested_webpack_require_116774__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); -module.exports = function (IS_INCLUDES) { - return function ($this, el, fromIndex) { - var O = toIObject($this); - var length = toLength(O.length); - var index = toAbsoluteIndex(fromIndex, length); - var value; - // Array#includes uses SameValueZero equality algorithm - // eslint-disable-next-line no-self-compare - if (IS_INCLUDES && el != el) while (length > index) { - value = O[index++]; - // eslint-disable-next-line no-self-compare - if (value != value) return true; - // Array#indexOf ignores holes, Array#includes - not - } else for (;length > index; index++) if (IS_INCLUDES || index in O) { - if (O[index] === el) return IS_INCLUDES || index || 0; - } return !IS_INCLUDES && -1; - }; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_array-methods.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/_array-methods.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_118243__) { - -// 0 -> Array#forEach -// 1 -> Array#map -// 2 -> Array#filter -// 3 -> Array#some -// 4 -> Array#every -// 5 -> Array#find -// 6 -> Array#findIndex -var ctx = __nested_webpack_require_118243__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); -var IObject = __nested_webpack_require_118243__(/*! ./_iobject */ "./node_modules/core-js/modules/_iobject.js"); -var toObject = __nested_webpack_require_118243__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); -var toLength = __nested_webpack_require_118243__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -var asc = __nested_webpack_require_118243__(/*! ./_array-species-create */ "./node_modules/core-js/modules/_array-species-create.js"); -module.exports = function (TYPE, $create) { - var IS_MAP = TYPE == 1; - var IS_FILTER = TYPE == 2; - var IS_SOME = TYPE == 3; - var IS_EVERY = TYPE == 4; - var IS_FIND_INDEX = TYPE == 6; - var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; - var create = $create || asc; - return function ($this, callbackfn, that) { - var O = toObject($this); - var self = IObject(O); - var f = ctx(callbackfn, that, 3); - var length = toLength(self.length); - var index = 0; - var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; - var val, res; - for (;length > index; index++) if (NO_HOLES || index in self) { - val = self[index]; - res = f(val, index, O); - if (TYPE) { - if (IS_MAP) result[index] = res; // map - else if (res) switch (TYPE) { - case 3: return true; // some - case 5: return val; // find - case 6: return index; // findIndex - case 2: result.push(val); // filter - } else if (IS_EVERY) return false; // every - } - } - return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; - }; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_array-reduce.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/modules/_array-reduce.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_120400__) { - -var aFunction = __nested_webpack_require_120400__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); -var toObject = __nested_webpack_require_120400__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); -var IObject = __nested_webpack_require_120400__(/*! ./_iobject */ "./node_modules/core-js/modules/_iobject.js"); -var toLength = __nested_webpack_require_120400__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); - -module.exports = function (that, callbackfn, aLen, memo, isRight) { - aFunction(callbackfn); - var O = toObject(that); - var self = IObject(O); - var length = toLength(O.length); - var index = isRight ? length - 1 : 0; - var i = isRight ? -1 : 1; - if (aLen < 2) for (;;) { - if (index in self) { - memo = self[index]; - index += i; - break; - } - index += i; - if (isRight ? index < 0 : length <= index) { - throw TypeError('Reduce of empty array with no initial value'); - } - } - for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { - memo = callbackfn(memo, self[index], index, O); - } - return memo; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_array-species-constructor.js": -/*!********************************************************************!*\ - !*** ./node_modules/core-js/modules/_array-species-constructor.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_121868__) { - -var isObject = __nested_webpack_require_121868__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var isArray = __nested_webpack_require_121868__(/*! ./_is-array */ "./node_modules/core-js/modules/_is-array.js"); -var SPECIES = __nested_webpack_require_121868__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('species'); - -module.exports = function (original) { - var C; - if (isArray(original)) { - C = original.constructor; - // cross-realm fallback - if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; - if (isObject(C)) { - C = C[SPECIES]; - if (C === null) C = undefined; - } - } return C === undefined ? Array : C; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_array-species-create.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js/modules/_array-species-create.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_122900__) { - -// 9.4.2.3 ArraySpeciesCreate(originalArray, length) -var speciesConstructor = __nested_webpack_require_122900__(/*! ./_array-species-constructor */ "./node_modules/core-js/modules/_array-species-constructor.js"); - -module.exports = function (original, length) { - return new (speciesConstructor(original))(length); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_bind.js": -/*!***********************************************!*\ - !*** ./node_modules/core-js/modules/_bind.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_123511__) { - -"use strict"; - -var aFunction = __nested_webpack_require_123511__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); -var isObject = __nested_webpack_require_123511__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var invoke = __nested_webpack_require_123511__(/*! ./_invoke */ "./node_modules/core-js/modules/_invoke.js"); -var arraySlice = [].slice; -var factories = {}; - -var construct = function (F, len, args) { - if (!(len in factories)) { - for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; - // eslint-disable-next-line no-new-func - factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); - } return factories[len](F, args); -}; - -module.exports = Function.bind || function bind(that /* , ...args */) { - var fn = aFunction(this); - var partArgs = arraySlice.call(arguments, 1); - var bound = function (/* args... */) { - var args = partArgs.concat(arraySlice.call(arguments)); - return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); - }; - if (isObject(fn.prototype)) bound.prototype = fn.prototype; - return bound; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_classof.js": -/*!**************************************************!*\ - !*** ./node_modules/core-js/modules/_classof.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_124925__) { - -// getting tag from 19.1.3.6 Object.prototype.toString() -var cof = __nested_webpack_require_124925__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); -var TAG = __nested_webpack_require_124925__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('toStringTag'); -// ES3 wrong here -var ARG = cof(function () { return arguments; }()) == 'Arguments'; - -// fallback for IE11 Script Access Denied error -var tryGet = function (it, key) { - try { - return it[key]; - } catch (e) { /* empty */ } -}; - -module.exports = function (it) { - var O, T, B; - return it === undefined ? 'Undefined' : it === null ? 'Null' - // @@toStringTag case - : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T - // builtinTag case - : ARG ? cof(O) - // ES3 arguments fallback - : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_cof.js": -/*!**********************************************!*\ - !*** ./node_modules/core-js/modules/_cof.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -var toString = {}.toString; - -module.exports = function (it) { - return toString.call(it).slice(8, -1); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_collection-strong.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/_collection-strong.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_126508__) { - -"use strict"; - -var dP = __nested_webpack_require_126508__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; -var create = __nested_webpack_require_126508__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js"); -var redefineAll = __nested_webpack_require_126508__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); -var ctx = __nested_webpack_require_126508__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); -var anInstance = __nested_webpack_require_126508__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); -var forOf = __nested_webpack_require_126508__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); -var $iterDefine = __nested_webpack_require_126508__(/*! ./_iter-define */ "./node_modules/core-js/modules/_iter-define.js"); -var step = __nested_webpack_require_126508__(/*! ./_iter-step */ "./node_modules/core-js/modules/_iter-step.js"); -var setSpecies = __nested_webpack_require_126508__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js"); -var DESCRIPTORS = __nested_webpack_require_126508__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); -var fastKey = __nested_webpack_require_126508__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").fastKey; -var validate = __nested_webpack_require_126508__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); -var SIZE = DESCRIPTORS ? '_s' : 'size'; - -var getEntry = function (that, key) { - // fast case - var index = fastKey(key); - var entry; - if (index !== 'F') return that._i[index]; - // frozen object case - for (entry = that._f; entry; entry = entry.n) { - if (entry.k == key) return entry; - } -}; - -module.exports = { - getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { - var C = wrapper(function (that, iterable) { - anInstance(that, C, NAME, '_i'); - that._t = NAME; // collection type - that._i = create(null); // index - that._f = undefined; // first entry - that._l = undefined; // last entry - that[SIZE] = 0; // size - if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); - }); - redefineAll(C.prototype, { - // 23.1.3.1 Map.prototype.clear() - // 23.2.3.2 Set.prototype.clear() - clear: function clear() { - for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) { - entry.r = true; - if (entry.p) entry.p = entry.p.n = undefined; - delete data[entry.i]; - } - that._f = that._l = undefined; - that[SIZE] = 0; - }, - // 23.1.3.3 Map.prototype.delete(key) - // 23.2.3.4 Set.prototype.delete(value) - 'delete': function (key) { - var that = validate(this, NAME); - var entry = getEntry(that, key); - if (entry) { - var next = entry.n; - var prev = entry.p; - delete that._i[entry.i]; - entry.r = true; - if (prev) prev.n = next; - if (next) next.p = prev; - if (that._f == entry) that._f = next; - if (that._l == entry) that._l = prev; - that[SIZE]--; - } return !!entry; - }, - // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) - // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) - forEach: function forEach(callbackfn /* , that = undefined */) { - validate(this, NAME); - var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); - var entry; - while (entry = entry ? entry.n : this._f) { - f(entry.v, entry.k, this); - // revert to the last existing entry - while (entry && entry.r) entry = entry.p; - } - }, - // 23.1.3.7 Map.prototype.has(key) - // 23.2.3.7 Set.prototype.has(value) - has: function has(key) { - return !!getEntry(validate(this, NAME), key); - } - }); - if (DESCRIPTORS) dP(C.prototype, 'size', { - get: function () { - return validate(this, NAME)[SIZE]; - } - }); - return C; - }, - def: function (that, key, value) { - var entry = getEntry(that, key); - var prev, index; - // change existing entry - if (entry) { - entry.v = value; - // create new entry - } else { - that._l = entry = { - i: index = fastKey(key, true), // <- index - k: key, // <- key - v: value, // <- value - p: prev = that._l, // <- previous entry - n: undefined, // <- next entry - r: false // <- removed - }; - if (!that._f) that._f = entry; - if (prev) prev.n = entry; - that[SIZE]++; - // add to index - if (index !== 'F') that._i[index] = entry; - } return that; - }, - getEntry: getEntry, - setStrong: function (C, NAME, IS_MAP) { - // add .keys, .values, .entries, [@@iterator] - // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 - $iterDefine(C, NAME, function (iterated, kind) { - this._t = validate(iterated, NAME); // target - this._k = kind; // kind - this._l = undefined; // previous - }, function () { - var that = this; - var kind = that._k; - var entry = that._l; - // revert to the last existing entry - while (entry && entry.r) entry = entry.p; - // get next entry - if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { - // or finish the iteration - that._t = undefined; - return step(1); - } - // return step by kind - if (kind == 'keys') return step(0, entry.k); - if (kind == 'values') return step(0, entry.v); - return step(0, [entry.k, entry.v]); - }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); - - // add [@@species], 23.1.2.2, 23.2.2.2 - setSpecies(NAME); - } -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_collection-to-json.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/modules/_collection-to-json.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_132671__) { - -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var classof = __nested_webpack_require_132671__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); -var from = __nested_webpack_require_132671__(/*! ./_array-from-iterable */ "./node_modules/core-js/modules/_array-from-iterable.js"); -module.exports = function (NAME) { - return function toJSON() { - if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); - return from(this); - }; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_collection-weak.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/modules/_collection-weak.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_133476__) { - -"use strict"; - -var redefineAll = __nested_webpack_require_133476__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); -var getWeak = __nested_webpack_require_133476__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").getWeak; -var anObject = __nested_webpack_require_133476__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var isObject = __nested_webpack_require_133476__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var anInstance = __nested_webpack_require_133476__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); -var forOf = __nested_webpack_require_133476__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); -var createArrayMethod = __nested_webpack_require_133476__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js"); -var $has = __nested_webpack_require_133476__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); -var validate = __nested_webpack_require_133476__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); -var arrayFind = createArrayMethod(5); -var arrayFindIndex = createArrayMethod(6); -var id = 0; - -// fallback for uncaught frozen keys -var uncaughtFrozenStore = function (that) { - return that._l || (that._l = new UncaughtFrozenStore()); -}; -var UncaughtFrozenStore = function () { - this.a = []; -}; -var findUncaughtFrozen = function (store, key) { - return arrayFind(store.a, function (it) { - return it[0] === key; - }); -}; -UncaughtFrozenStore.prototype = { - get: function (key) { - var entry = findUncaughtFrozen(this, key); - if (entry) return entry[1]; - }, - has: function (key) { - return !!findUncaughtFrozen(this, key); - }, - set: function (key, value) { - var entry = findUncaughtFrozen(this, key); - if (entry) entry[1] = value; - else this.a.push([key, value]); - }, - 'delete': function (key) { - var index = arrayFindIndex(this.a, function (it) { - return it[0] === key; - }); - if (~index) this.a.splice(index, 1); - return !!~index; - } -}; - -module.exports = { - getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { - var C = wrapper(function (that, iterable) { - anInstance(that, C, NAME, '_i'); - that._t = NAME; // collection type - that._i = id++; // collection id - that._l = undefined; // leak store for uncaught frozen objects - if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); - }); - redefineAll(C.prototype, { - // 23.3.3.2 WeakMap.prototype.delete(key) - // 23.4.3.3 WeakSet.prototype.delete(value) - 'delete': function (key) { - if (!isObject(key)) return false; - var data = getWeak(key); - if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key); - return data && $has(data, this._i) && delete data[this._i]; - }, - // 23.3.3.4 WeakMap.prototype.has(key) - // 23.4.3.4 WeakSet.prototype.has(value) - has: function has(key) { - if (!isObject(key)) return false; - var data = getWeak(key); - if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key); - return data && $has(data, this._i); - } - }); - return C; - }, - def: function (that, key, value) { - var data = getWeak(anObject(key), true); - if (data === true) uncaughtFrozenStore(that).set(key, value); - else data[that._i] = value; - return that; - }, - ufstore: uncaughtFrozenStore -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_collection.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_collection.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_137178__) { - -"use strict"; - -var global = __nested_webpack_require_137178__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var $export = __nested_webpack_require_137178__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var redefine = __nested_webpack_require_137178__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); -var redefineAll = __nested_webpack_require_137178__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); -var meta = __nested_webpack_require_137178__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js"); -var forOf = __nested_webpack_require_137178__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); -var anInstance = __nested_webpack_require_137178__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); -var isObject = __nested_webpack_require_137178__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var fails = __nested_webpack_require_137178__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); -var $iterDetect = __nested_webpack_require_137178__(/*! ./_iter-detect */ "./node_modules/core-js/modules/_iter-detect.js"); -var setToStringTag = __nested_webpack_require_137178__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js"); -var inheritIfRequired = __nested_webpack_require_137178__(/*! ./_inherit-if-required */ "./node_modules/core-js/modules/_inherit-if-required.js"); - -module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { - var Base = global[NAME]; - var C = Base; - var ADDER = IS_MAP ? 'set' : 'add'; - var proto = C && C.prototype; - var O = {}; - var fixMethod = function (KEY) { - var fn = proto[KEY]; - redefine(proto, KEY, - KEY == 'delete' ? function (a) { - return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'has' ? function has(a) { - return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'get' ? function get(a) { - return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; } - : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; } - ); - }; - if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { - new C().entries().next(); - }))) { - // create collection constructor - C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); - redefineAll(C.prototype, methods); - meta.NEED = true; - } else { - var instance = new C(); - // early implementations not supports chaining - var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; - // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false - var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); - // most early implementations doesn't supports iterables, most modern - not close it correctly - var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new - // for early implementations -0 and +0 not the same - var BUGGY_ZERO = !IS_WEAK && fails(function () { - // V8 ~ Chromium 42- fails only with 5+ elements - var $instance = new C(); - var index = 5; - while (index--) $instance[ADDER](index, index); - return !$instance.has(-0); - }); - if (!ACCEPT_ITERABLES) { - C = wrapper(function (target, iterable) { - anInstance(target, C, NAME); - var that = inheritIfRequired(new Base(), target, C); - if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); - return that; - }); - C.prototype = proto; - proto.constructor = C; - } - if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { - fixMethod('delete'); - fixMethod('has'); - IS_MAP && fixMethod('get'); - } - if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); - // weak collections should not contains .clear method - if (IS_WEAK && proto.clear) delete proto.clear; - } - - setToStringTag(C, NAME); - - O[NAME] = C; - $export($export.G + $export.W + $export.F * (C != Base), O); - - if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); - - return C; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_core.js": -/*!***********************************************!*\ - !*** ./node_modules/core-js/modules/_core.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -var core = module.exports = { version: '2.6.11' }; -if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_create-property.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/modules/_create-property.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_142022__) { - -"use strict"; - -var $defineProperty = __nested_webpack_require_142022__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); -var createDesc = __nested_webpack_require_142022__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); - -module.exports = function (object, index, value) { - if (index in object) $defineProperty.f(object, index, createDesc(0, value)); - else object[index] = value; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_ctx.js": -/*!**********************************************!*\ - !*** ./node_modules/core-js/modules/_ctx.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_142730__) { - -// optional / simple context binding -var aFunction = __nested_webpack_require_142730__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); -module.exports = function (fn, that, length) { - aFunction(fn); - if (that === undefined) return fn; - switch (length) { - case 1: return function (a) { - return fn.call(that, a); - }; - case 2: return function (a, b) { - return fn.call(that, a, b); - }; - case 3: return function (a, b, c) { - return fn.call(that, a, b, c); - }; - } - return function (/* ...args */) { - return fn.apply(that, arguments); - }; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_date-to-iso-string.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/modules/_date-to-iso-string.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_143679__) { - -"use strict"; - -// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() -var fails = __nested_webpack_require_143679__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); -var getTime = Date.prototype.getTime; -var $toISOString = Date.prototype.toISOString; - -var lz = function (num) { - return num > 9 ? num : '0' + num; -}; - -// PhantomJS / old WebKit has a broken implementations -module.exports = (fails(function () { - return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; -}) || !fails(function () { - $toISOString.call(new Date(NaN)); -})) ? function toISOString() { - if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); - var d = this; - var y = d.getUTCFullYear(); - var m = d.getUTCMilliseconds(); - var s = y < 0 ? '-' : y > 9999 ? '+' : ''; - return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + - '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + - 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + - ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; -} : $toISOString; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_date-to-primitive.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/_date-to-primitive.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_145096__) { - -"use strict"; - -var anObject = __nested_webpack_require_145096__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var toPrimitive = __nested_webpack_require_145096__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); -var NUMBER = 'number'; - -module.exports = function (hint) { - if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint'); - return toPrimitive(anObject(this), hint != NUMBER); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_defined.js": -/*!**************************************************!*\ - !*** ./node_modules/core-js/modules/_defined.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// 7.2.1 RequireObjectCoercible(argument) -module.exports = function (it) { - if (it == undefined) throw TypeError("Can't call method on " + it); - return it; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_descriptors.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/_descriptors.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_146342__) { - -// Thank's IE8 for his funny defineProperty -module.exports = !__nested_webpack_require_146342__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { - return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_dom-create.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_dom-create.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_146918__) { - -var isObject = __nested_webpack_require_146918__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var document = __nested_webpack_require_146918__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").document; -// typeof document.createElement is 'object' in old IE -var is = isObject(document) && isObject(document.createElement); -module.exports = function (it) { - return is ? document.createElement(it) : {}; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_enum-bug-keys.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/_enum-bug-keys.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// IE 8- don't enum bug keys -module.exports = ( - 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' -).split(','); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_enum-keys.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/_enum-keys.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_148143__) { - -// all enumerable object keys, includes symbols -var getKeys = __nested_webpack_require_148143__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); -var gOPS = __nested_webpack_require_148143__(/*! ./_object-gops */ "./node_modules/core-js/modules/_object-gops.js"); -var pIE = __nested_webpack_require_148143__(/*! ./_object-pie */ "./node_modules/core-js/modules/_object-pie.js"); -module.exports = function (it) { - var result = getKeys(it); - var getSymbols = gOPS.f; - if (getSymbols) { - var symbols = getSymbols(it); - var isEnum = pIE.f; - var i = 0; - var key; - while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); - } return result; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_export.js": -/*!*************************************************!*\ - !*** ./node_modules/core-js/modules/_export.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_149125__) { - -var global = __nested_webpack_require_149125__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var core = __nested_webpack_require_149125__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); -var hide = __nested_webpack_require_149125__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); -var redefine = __nested_webpack_require_149125__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); -var ctx = __nested_webpack_require_149125__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); -var PROTOTYPE = 'prototype'; - -var $export = function (type, name, source) { - var IS_FORCED = type & $export.F; - var IS_GLOBAL = type & $export.G; - var IS_STATIC = type & $export.S; - var IS_PROTO = type & $export.P; - var IS_BIND = type & $export.B; - var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; - var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); - var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); - var key, own, out, exp; - if (IS_GLOBAL) source = name; - for (key in source) { - // contains in native - own = !IS_FORCED && target && target[key] !== undefined; - // export native or passed - out = (own ? target : source)[key]; - // bind timers to global for call from export context - exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; - // extend global - if (target) redefine(target, key, out, type & $export.U); - // export - if (exports[key] != out) hide(exports, key, exp); - if (IS_PROTO && expProto[key] != out) expProto[key] = out; - } -}; -global.core = core; -// type bitmap -$export.F = 1; // forced -$export.G = 2; // global -$export.S = 4; // static -$export.P = 8; // proto -$export.B = 16; // bind -$export.W = 32; // wrap -$export.U = 64; // safe -$export.R = 128; // real proto method for `library` -module.exports = $export; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_fails-is-regexp.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/modules/_fails-is-regexp.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_151378__) { - -var MATCH = __nested_webpack_require_151378__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('match'); -module.exports = function (KEY) { - var re = /./; - try { - '/./'[KEY](re); - } catch (e) { - try { - re[MATCH] = false; - return !'/./'[KEY](re); - } catch (f) { /* empty */ } - } return true; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_fails.js": -/*!************************************************!*\ - !*** ./node_modules/core-js/modules/_fails.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = function (exec) { - try { - return !!exec(); - } catch (e) { - return true; - } -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_fix-re-wks.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_fix-re-wks.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_152414__) { - -"use strict"; - -__nested_webpack_require_152414__(/*! ./es6.regexp.exec */ "./node_modules/core-js/modules/es6.regexp.exec.js"); -var redefine = __nested_webpack_require_152414__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); -var hide = __nested_webpack_require_152414__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); -var fails = __nested_webpack_require_152414__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); -var defined = __nested_webpack_require_152414__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); -var wks = __nested_webpack_require_152414__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js"); -var regexpExec = __nested_webpack_require_152414__(/*! ./_regexp-exec */ "./node_modules/core-js/modules/_regexp-exec.js"); - -var SPECIES = wks('species'); - -var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { - // #replace needs built-in support for named groups. - // #match works fine because it just return the exec results, even if it has - // a "grops" property. - var re = /./; - re.exec = function () { - var result = []; - result.groups = { a: '7' }; - return result; - }; - return ''.replace(re, '$') !== '7'; -}); - -var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () { - // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec - var re = /(?:)/; - var originalExec = re.exec; - re.exec = function () { return originalExec.apply(this, arguments); }; - var result = 'ab'.split(re); - return result.length === 2 && result[0] === 'a' && result[1] === 'b'; -})(); - -module.exports = function (KEY, length, exec) { - var SYMBOL = wks(KEY); - - var DELEGATES_TO_SYMBOL = !fails(function () { - // String methods call symbol-named RegEp methods - var O = {}; - O[SYMBOL] = function () { return 7; }; - return ''[KEY](O) != 7; - }); - - var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () { - // Symbol-named RegExp methods call .exec - var execCalled = false; - var re = /a/; - re.exec = function () { execCalled = true; return null; }; - if (KEY === 'split') { - // RegExp[@@split] doesn't call the regex's exec method, but first creates - // a new one. We need to return the patched regex when creating the new one. - re.constructor = {}; - re.constructor[SPECIES] = function () { return re; }; - } - re[SYMBOL](''); - return !execCalled; - }) : undefined; - - if ( - !DELEGATES_TO_SYMBOL || - !DELEGATES_TO_EXEC || - (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) || - (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) - ) { - var nativeRegExpMethod = /./[SYMBOL]; - var fns = exec( - defined, - SYMBOL, - ''[KEY], - function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) { - if (regexp.exec === regexpExec) { - if (DELEGATES_TO_SYMBOL && !forceStringMethod) { - // The native String method already delegates to @@method (this - // polyfilled function), leasing to infinite recursion. - // We avoid it by directly calling the native @@method method. - return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) }; - } - return { done: true, value: nativeMethod.call(str, regexp, arg2) }; - } - return { done: false }; - } - ); - var strfn = fns[0]; - var rxfn = fns[1]; - - redefine(String.prototype, KEY, strfn); - hide(RegExp.prototype, SYMBOL, length == 2 - // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) - // 21.2.5.11 RegExp.prototype[@@split](string, limit) - ? function (string, arg) { return rxfn.call(string, this, arg); } - // 21.2.5.6 RegExp.prototype[@@match](string) - // 21.2.5.9 RegExp.prototype[@@search](string) - : function (string) { return rxfn.call(string, this); } - ); - } -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_flags.js": -/*!************************************************!*\ - !*** ./node_modules/core-js/modules/_flags.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_156497__) { - -"use strict"; - -// 21.2.5.3 get RegExp.prototype.flags -var anObject = __nested_webpack_require_156497__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -module.exports = function () { - var that = anObject(this); - var result = ''; - if (that.global) result += 'g'; - if (that.ignoreCase) result += 'i'; - if (that.multiline) result += 'm'; - if (that.unicode) result += 'u'; - if (that.sticky) result += 'y'; - return result; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_flatten-into-array.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/modules/_flatten-into-array.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_157296__) { - -"use strict"; - -// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray -var isArray = __nested_webpack_require_157296__(/*! ./_is-array */ "./node_modules/core-js/modules/_is-array.js"); -var isObject = __nested_webpack_require_157296__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var toLength = __nested_webpack_require_157296__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -var ctx = __nested_webpack_require_157296__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); -var IS_CONCAT_SPREADABLE = __nested_webpack_require_157296__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('isConcatSpreadable'); - -function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) { - var targetIndex = start; - var sourceIndex = 0; - var mapFn = mapper ? ctx(mapper, thisArg, 3) : false; - var element, spreadable; - - while (sourceIndex < sourceLen) { - if (sourceIndex in source) { - element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; - - spreadable = false; - if (isObject(element)) { - spreadable = element[IS_CONCAT_SPREADABLE]; - spreadable = spreadable !== undefined ? !!spreadable : isArray(element); - } - - if (spreadable && depth > 0) { - targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; - } else { - if (targetIndex >= 0x1fffffffffffff) throw TypeError(); - target[targetIndex] = element; - } - - targetIndex++; - } - sourceIndex++; - } - return targetIndex; -} - -module.exports = flattenIntoArray; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_for-of.js": -/*!*************************************************!*\ - !*** ./node_modules/core-js/modules/_for-of.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_159206__) { - -var ctx = __nested_webpack_require_159206__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); -var call = __nested_webpack_require_159206__(/*! ./_iter-call */ "./node_modules/core-js/modules/_iter-call.js"); -var isArrayIter = __nested_webpack_require_159206__(/*! ./_is-array-iter */ "./node_modules/core-js/modules/_is-array-iter.js"); -var anObject = __nested_webpack_require_159206__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var toLength = __nested_webpack_require_159206__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -var getIterFn = __nested_webpack_require_159206__(/*! ./core.get-iterator-method */ "./node_modules/core-js/modules/core.get-iterator-method.js"); -var BREAK = {}; -var RETURN = {}; -var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { - var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); - var f = ctx(fn, that, entries ? 2 : 1); - var index = 0; - var length, step, iterator, result; - if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); - // fast case for arrays with default iterator - if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { - result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); - if (result === BREAK || result === RETURN) return result; - } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { - result = call(iterator, f, step.value, entries); - if (result === BREAK || result === RETURN) return result; - } -}; -exports.BREAK = BREAK; -exports.RETURN = RETURN; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_function-to-string.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/modules/_function-to-string.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_161142__) { - -module.exports = __nested_webpack_require_161142__(/*! ./_shared */ "./node_modules/core-js/modules/_shared.js")('native-function-to-string', Function.toString); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_global.js": -/*!*************************************************!*\ - !*** ./node_modules/core-js/modules/_global.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 -var global = module.exports = typeof window != 'undefined' && window.Math == Math - ? window : typeof self != 'undefined' && self.Math == Math ? self - // eslint-disable-next-line no-new-func - : Function('return this')(); -if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_has.js": -/*!**********************************************!*\ - !*** ./node_modules/core-js/modules/_has.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -var hasOwnProperty = {}.hasOwnProperty; -module.exports = function (it, key) { - return hasOwnProperty.call(it, key); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_hide.js": -/*!***********************************************!*\ - !*** ./node_modules/core-js/modules/_hide.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_162665__) { - -var dP = __nested_webpack_require_162665__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); -var createDesc = __nested_webpack_require_162665__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); -module.exports = __nested_webpack_require_162665__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") ? function (object, key, value) { - return dP.f(object, key, createDesc(1, value)); -} : function (object, key, value) { - object[key] = value; - return object; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_html.js": -/*!***********************************************!*\ - !*** ./node_modules/core-js/modules/_html.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_163457__) { - -var document = __nested_webpack_require_163457__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").document; -module.exports = document && document.documentElement; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_ie8-dom-define.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/_ie8-dom-define.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_163967__) { - -module.exports = !__nested_webpack_require_163967__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && !__nested_webpack_require_163967__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { - return Object.defineProperty(__nested_webpack_require_163967__(/*! ./_dom-create */ "./node_modules/core-js/modules/_dom-create.js")('div'), 'a', { get: function () { return 7; } }).a != 7; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_inherit-if-required.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/_inherit-if-required.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_164725__) { - -var isObject = __nested_webpack_require_164725__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var setPrototypeOf = __nested_webpack_require_164725__(/*! ./_set-proto */ "./node_modules/core-js/modules/_set-proto.js").set; -module.exports = function (that, target, C) { - var S = target.constructor; - var P; - if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { - setPrototypeOf(that, P); - } return that; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_invoke.js": -/*!*************************************************!*\ - !*** ./node_modules/core-js/modules/_invoke.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// fast apply, http://jsperf.lnkit.com/fast-apply/5 -module.exports = function (fn, args, that) { - var un = that === undefined; - switch (args.length) { - case 0: return un ? fn() - : fn.call(that); - case 1: return un ? fn(args[0]) - : fn.call(that, args[0]); - case 2: return un ? fn(args[0], args[1]) - : fn.call(that, args[0], args[1]); - case 3: return un ? fn(args[0], args[1], args[2]) - : fn.call(that, args[0], args[1], args[2]); - case 4: return un ? fn(args[0], args[1], args[2], args[3]) - : fn.call(that, args[0], args[1], args[2], args[3]); - } return fn.apply(that, args); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_iobject.js": -/*!**************************************************!*\ - !*** ./node_modules/core-js/modules/_iobject.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_166506__) { - -// fallback for non-array-like ES3 and non-enumerable old V8 strings -var cof = __nested_webpack_require_166506__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); -// eslint-disable-next-line no-prototype-builtins -module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { - return cof(it) == 'String' ? it.split('') : Object(it); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_is-array-iter.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/_is-array-iter.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_167197__) { - -// check on default Array iterator -var Iterators = __nested_webpack_require_167197__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); -var ITERATOR = __nested_webpack_require_167197__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'); -var ArrayProto = Array.prototype; - -module.exports = function (it) { - return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_is-array.js": -/*!***************************************************!*\ - !*** ./node_modules/core-js/modules/_is-array.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_167922__) { - -// 7.2.2 IsArray(argument) -var cof = __nested_webpack_require_167922__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); -module.exports = Array.isArray || function isArray(arg) { - return cof(arg) == 'Array'; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_is-integer.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_is-integer.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_168459__) { - -// 20.1.2.3 Number.isInteger(number) -var isObject = __nested_webpack_require_168459__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var floor = Math.floor; -module.exports = function isInteger(it) { - return !isObject(it) && isFinite(it) && floor(it) === it; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_is-object.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/_is-object.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = function (it) { - return typeof it === 'object' ? it !== null : typeof it === 'function'; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_is-regexp.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/_is-regexp.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_169474__) { - -// 7.2.8 IsRegExp(argument) -var isObject = __nested_webpack_require_169474__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var cof = __nested_webpack_require_169474__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); -var MATCH = __nested_webpack_require_169474__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('match'); -module.exports = function (it) { - var isRegExp; - return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_iter-call.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/_iter-call.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_170271__) { - -// call something on iterator step with safe closing on error -var anObject = __nested_webpack_require_170271__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -module.exports = function (iterator, fn, value, entries) { - try { - return entries ? fn(anObject(value)[0], value[1]) : fn(value); - // 7.4.6 IteratorClose(iterator, completion) - } catch (e) { - var ret = iterator['return']; - if (ret !== undefined) anObject(ret.call(iterator)); - throw e; - } -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_iter-create.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/_iter-create.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_171081__) { - -"use strict"; - -var create = __nested_webpack_require_171081__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js"); -var descriptor = __nested_webpack_require_171081__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); -var setToStringTag = __nested_webpack_require_171081__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js"); -var IteratorPrototype = {}; - -// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() -__nested_webpack_require_171081__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js")(IteratorPrototype, __nested_webpack_require_171081__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'), function () { return this; }); - -module.exports = function (Constructor, NAME, next) { - Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); - setToStringTag(Constructor, NAME + ' Iterator'); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_iter-define.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/_iter-define.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_172269__) { - -"use strict"; - -var LIBRARY = __nested_webpack_require_172269__(/*! ./_library */ "./node_modules/core-js/modules/_library.js"); -var $export = __nested_webpack_require_172269__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var redefine = __nested_webpack_require_172269__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); -var hide = __nested_webpack_require_172269__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); -var Iterators = __nested_webpack_require_172269__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); -var $iterCreate = __nested_webpack_require_172269__(/*! ./_iter-create */ "./node_modules/core-js/modules/_iter-create.js"); -var setToStringTag = __nested_webpack_require_172269__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js"); -var getPrototypeOf = __nested_webpack_require_172269__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); -var ITERATOR = __nested_webpack_require_172269__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'); -var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` -var FF_ITERATOR = '@@iterator'; -var KEYS = 'keys'; -var VALUES = 'values'; - -var returnThis = function () { return this; }; - -module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { - $iterCreate(Constructor, NAME, next); - var getMethod = function (kind) { - if (!BUGGY && kind in proto) return proto[kind]; - switch (kind) { - case KEYS: return function keys() { return new Constructor(this, kind); }; - case VALUES: return function values() { return new Constructor(this, kind); }; - } return function entries() { return new Constructor(this, kind); }; - }; - var TAG = NAME + ' Iterator'; - var DEF_VALUES = DEFAULT == VALUES; - var VALUES_BUG = false; - var proto = Base.prototype; - var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; - var $default = $native || getMethod(DEFAULT); - var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; - var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; - var methods, key, IteratorPrototype; - // Fix native - if ($anyNative) { - IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); - if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { - // Set @@toStringTag to native iterators - setToStringTag(IteratorPrototype, TAG, true); - // fix for some old engines - if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); - } - } - // fix Array#{values, @@iterator}.name in V8 / FF - if (DEF_VALUES && $native && $native.name !== VALUES) { - VALUES_BUG = true; - $default = function values() { return $native.call(this); }; - } - // Define iterator - if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { - hide(proto, ITERATOR, $default); - } - // Plug for library - Iterators[NAME] = $default; - Iterators[TAG] = returnThis; - if (DEFAULT) { - methods = { - values: DEF_VALUES ? $default : getMethod(VALUES), - keys: IS_SET ? $default : getMethod(KEYS), - entries: $entries - }; - if (FORCED) for (key in methods) { - if (!(key in proto)) redefine(proto, key, methods[key]); - } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); - } - return methods; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_iter-detect.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/_iter-detect.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_175955__) { - -var ITERATOR = __nested_webpack_require_175955__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'); -var SAFE_CLOSING = false; - -try { - var riter = [7][ITERATOR](); - riter['return'] = function () { SAFE_CLOSING = true; }; - // eslint-disable-next-line no-throw-literal - Array.from(riter, function () { throw 2; }); -} catch (e) { /* empty */ } - -module.exports = function (exec, skipClosing) { - if (!skipClosing && !SAFE_CLOSING) return false; - var safe = false; - try { - var arr = [7]; - var iter = arr[ITERATOR](); - iter.next = function () { return { done: safe = true }; }; - arr[ITERATOR] = function () { return iter; }; - exec(arr); - } catch (e) { /* empty */ } - return safe; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_iter-step.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/_iter-step.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = function (done, value) { - return { value: value, done: !!done }; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_iterators.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/_iterators.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = {}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_library.js": -/*!**************************************************!*\ - !*** ./node_modules/core-js/modules/_library.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = false; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_math-expm1.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_math-expm1.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// 20.2.2.14 Math.expm1(x) -var $expm1 = Math.expm1; -module.exports = (!$expm1 - // Old FF bug - || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 - // Tor Browser bug - || $expm1(-2e-17) != -2e-17 -) ? function expm1(x) { - return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; -} : $expm1; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_math-fround.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/_math-fround.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_178692__) { - -// 20.2.2.16 Math.fround(x) -var sign = __nested_webpack_require_178692__(/*! ./_math-sign */ "./node_modules/core-js/modules/_math-sign.js"); -var pow = Math.pow; -var EPSILON = pow(2, -52); -var EPSILON32 = pow(2, -23); -var MAX32 = pow(2, 127) * (2 - EPSILON32); -var MIN32 = pow(2, -126); - -var roundTiesToEven = function (n) { - return n + 1 / EPSILON - 1 / EPSILON; -}; - -module.exports = Math.fround || function fround(x) { - var $abs = Math.abs(x); - var $sign = sign(x); - var a, result; - if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; - a = (1 + EPSILON32 / EPSILON) * $abs; - result = a - (a - $abs); - // eslint-disable-next-line no-self-compare - if (result > MAX32 || result != result) return $sign * Infinity; - return $sign * result; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_math-log1p.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_math-log1p.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// 20.2.2.20 Math.log1p(x) -module.exports = Math.log1p || function log1p(x) { - return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_math-scale.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_math-scale.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// https://rwaldron.github.io/proposal-math-extensions/ -module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { - if ( - arguments.length === 0 - // eslint-disable-next-line no-self-compare - || x != x - // eslint-disable-next-line no-self-compare - || inLow != inLow - // eslint-disable-next-line no-self-compare - || inHigh != inHigh - // eslint-disable-next-line no-self-compare - || outLow != outLow - // eslint-disable-next-line no-self-compare - || outHigh != outHigh - ) return NaN; - if (x === Infinity || x === -Infinity) return x; - return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_math-sign.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/_math-sign.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// 20.2.2.28 Math.sign(x) -module.exports = Math.sign || function sign(x) { - // eslint-disable-next-line no-self-compare - return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_meta.js": -/*!***********************************************!*\ - !*** ./node_modules/core-js/modules/_meta.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_181726__) { - -var META = __nested_webpack_require_181726__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js")('meta'); -var isObject = __nested_webpack_require_181726__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var has = __nested_webpack_require_181726__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); -var setDesc = __nested_webpack_require_181726__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; -var id = 0; -var isExtensible = Object.isExtensible || function () { - return true; -}; -var FREEZE = !__nested_webpack_require_181726__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { - return isExtensible(Object.preventExtensions({})); -}); -var setMeta = function (it) { - setDesc(it, META, { value: { - i: 'O' + ++id, // object ID - w: {} // weak collections IDs - } }); -}; -var fastKey = function (it, create) { - // return primitive with prefix - if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; - if (!has(it, META)) { - // can't set metadata to uncaught frozen object - if (!isExtensible(it)) return 'F'; - // not necessary to add metadata - if (!create) return 'E'; - // add missing metadata - setMeta(it); - // return object ID - } return it[META].i; -}; -var getWeak = function (it, create) { - if (!has(it, META)) { - // can't set metadata to uncaught frozen object - if (!isExtensible(it)) return true; - // not necessary to add metadata - if (!create) return false; - // add missing metadata - setMeta(it); - // return hash weak collections IDs - } return it[META].w; -}; -// add metadata on freeze-family methods calling -var onFreeze = function (it) { - if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); - return it; -}; -var meta = module.exports = { - KEY: META, - NEED: false, - fastKey: fastKey, - getWeak: getWeak, - onFreeze: onFreeze -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_metadata.js": -/*!***************************************************!*\ - !*** ./node_modules/core-js/modules/_metadata.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_183912__) { - -var Map = __nested_webpack_require_183912__(/*! ./es6.map */ "./node_modules/core-js/modules/es6.map.js"); -var $export = __nested_webpack_require_183912__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var shared = __nested_webpack_require_183912__(/*! ./_shared */ "./node_modules/core-js/modules/_shared.js")('metadata'); -var store = shared.store || (shared.store = new (__nested_webpack_require_183912__(/*! ./es6.weak-map */ "./node_modules/core-js/modules/es6.weak-map.js"))()); - -var getOrCreateMetadataMap = function (target, targetKey, create) { - var targetMetadata = store.get(target); - if (!targetMetadata) { - if (!create) return undefined; - store.set(target, targetMetadata = new Map()); - } - var keyMetadata = targetMetadata.get(targetKey); - if (!keyMetadata) { - if (!create) return undefined; - targetMetadata.set(targetKey, keyMetadata = new Map()); - } return keyMetadata; -}; -var ordinaryHasOwnMetadata = function (MetadataKey, O, P) { - var metadataMap = getOrCreateMetadataMap(O, P, false); - return metadataMap === undefined ? false : metadataMap.has(MetadataKey); -}; -var ordinaryGetOwnMetadata = function (MetadataKey, O, P) { - var metadataMap = getOrCreateMetadataMap(O, P, false); - return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); -}; -var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) { - getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); -}; -var ordinaryOwnMetadataKeys = function (target, targetKey) { - var metadataMap = getOrCreateMetadataMap(target, targetKey, false); - var keys = []; - if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); }); - return keys; -}; -var toMetaKey = function (it) { - return it === undefined || typeof it == 'symbol' ? it : String(it); -}; -var exp = function (O) { - $export($export.S, 'Reflect', O); -}; - -module.exports = { - store: store, - map: getOrCreateMetadataMap, - has: ordinaryHasOwnMetadata, - get: ordinaryGetOwnMetadata, - set: ordinaryDefineOwnMetadata, - keys: ordinaryOwnMetadataKeys, - key: toMetaKey, - exp: exp -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_microtask.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/_microtask.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_186292__) { - -var global = __nested_webpack_require_186292__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var macrotask = __nested_webpack_require_186292__(/*! ./_task */ "./node_modules/core-js/modules/_task.js").set; -var Observer = global.MutationObserver || global.WebKitMutationObserver; -var process = global.process; -var Promise = global.Promise; -var isNode = __nested_webpack_require_186292__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js")(process) == 'process'; - -module.exports = function () { - var head, last, notify; - - var flush = function () { - var parent, fn; - if (isNode && (parent = process.domain)) parent.exit(); - while (head) { - fn = head.fn; - head = head.next; - try { - fn(); - } catch (e) { - if (head) notify(); - else last = undefined; - throw e; - } - } last = undefined; - if (parent) parent.enter(); - }; - - // Node.js - if (isNode) { - notify = function () { - process.nextTick(flush); - }; - // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 - } else if (Observer && !(global.navigator && global.navigator.standalone)) { - var toggle = true; - var node = document.createTextNode(''); - new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new - notify = function () { - node.data = toggle = !toggle; - }; - // environments with maybe non-completely correct, but existent Promise - } else if (Promise && Promise.resolve) { - // Promise.resolve without an argument throws an error in LG WebOS 2 - var promise = Promise.resolve(undefined); - notify = function () { - promise.then(flush); - }; - // for other environments - macrotask based on: - // - setImmediate - // - MessageChannel - // - window.postMessag - // - onreadystatechange - // - setTimeout - } else { - notify = function () { - // strange IE + webpack dev server bug - use .call(global) - macrotask.call(global, flush); - }; - } - - return function (fn) { - var task = { fn: fn, next: undefined }; - if (last) last.next = task; - if (!head) { - head = task; - notify(); - } last = task; - }; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_new-promise-capability.js": -/*!*****************************************************************!*\ - !*** ./node_modules/core-js/modules/_new-promise-capability.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_188832__) { - -"use strict"; - -// 25.4.1.5 NewPromiseCapability(C) -var aFunction = __nested_webpack_require_188832__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); - -function PromiseCapability(C) { - var resolve, reject; - this.promise = new C(function ($$resolve, $$reject) { - if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); - resolve = $$resolve; - reject = $$reject; - }); - this.resolve = aFunction(resolve); - this.reject = aFunction(reject); -} - -module.exports.f = function (C) { - return new PromiseCapability(C); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_object-assign.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/_object-assign.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_189746__) { - -"use strict"; - -// 19.1.2.1 Object.assign(target, source, ...) -var DESCRIPTORS = __nested_webpack_require_189746__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); -var getKeys = __nested_webpack_require_189746__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); -var gOPS = __nested_webpack_require_189746__(/*! ./_object-gops */ "./node_modules/core-js/modules/_object-gops.js"); -var pIE = __nested_webpack_require_189746__(/*! ./_object-pie */ "./node_modules/core-js/modules/_object-pie.js"); -var toObject = __nested_webpack_require_189746__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); -var IObject = __nested_webpack_require_189746__(/*! ./_iobject */ "./node_modules/core-js/modules/_iobject.js"); -var $assign = Object.assign; - -// should work with symbols and should have deterministic property order (V8 bug) -module.exports = !$assign || __nested_webpack_require_189746__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { - var A = {}; - var B = {}; - // eslint-disable-next-line no-undef - var S = Symbol(); - var K = 'abcdefghijklmnopqrst'; - A[S] = 7; - K.split('').forEach(function (k) { B[k] = k; }); - return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; -}) ? function assign(target, source) { // eslint-disable-line no-unused-vars - var T = toObject(target); - var aLen = arguments.length; - var index = 1; - var getSymbols = gOPS.f; - var isEnum = pIE.f; - while (aLen > index) { - var S = IObject(arguments[index++]); - var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); - var length = keys.length; - var j = 0; - var key; - while (length > j) { - key = keys[j++]; - if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key]; - } - } return T; -} : $assign; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_object-create.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/_object-create.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_191821__) { - -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -var anObject = __nested_webpack_require_191821__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var dPs = __nested_webpack_require_191821__(/*! ./_object-dps */ "./node_modules/core-js/modules/_object-dps.js"); -var enumBugKeys = __nested_webpack_require_191821__(/*! ./_enum-bug-keys */ "./node_modules/core-js/modules/_enum-bug-keys.js"); -var IE_PROTO = __nested_webpack_require_191821__(/*! ./_shared-key */ "./node_modules/core-js/modules/_shared-key.js")('IE_PROTO'); -var Empty = function () { /* empty */ }; -var PROTOTYPE = 'prototype'; - -// Create object with fake `null` prototype: use iframe Object with cleared prototype -var createDict = function () { - // Thrash, waste and sodomy: IE GC bug - var iframe = __nested_webpack_require_191821__(/*! ./_dom-create */ "./node_modules/core-js/modules/_dom-create.js")('iframe'); - var i = enumBugKeys.length; - var lt = '<'; - var gt = '>'; - var iframeDocument; - iframe.style.display = 'none'; - __nested_webpack_require_191821__(/*! ./_html */ "./node_modules/core-js/modules/_html.js").appendChild(iframe); - iframe.src = 'javascript:'; // eslint-disable-line no-script-url - // createDict = iframe.contentWindow.Object; - // html.removeChild(iframe); - iframeDocument = iframe.contentWindow.document; - iframeDocument.open(); - iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); - iframeDocument.close(); - createDict = iframeDocument.F; - while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; - return createDict(); -}; - -module.exports = Object.create || function create(O, Properties) { - var result; - if (O !== null) { - Empty[PROTOTYPE] = anObject(O); - result = new Empty(); - Empty[PROTOTYPE] = null; - // add "__proto__" for Object.getPrototypeOf polyfill - result[IE_PROTO] = O; - } else result = createDict(); - return Properties === undefined ? result : dPs(result, Properties); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_object-dp.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/_object-dp.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_194040__) { - -var anObject = __nested_webpack_require_194040__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var IE8_DOM_DEFINE = __nested_webpack_require_194040__(/*! ./_ie8-dom-define */ "./node_modules/core-js/modules/_ie8-dom-define.js"); -var toPrimitive = __nested_webpack_require_194040__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); -var dP = Object.defineProperty; - -exports.f = __nested_webpack_require_194040__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") ? Object.defineProperty : function defineProperty(O, P, Attributes) { - anObject(O); - P = toPrimitive(P, true); - anObject(Attributes); - if (IE8_DOM_DEFINE) try { - return dP(O, P, Attributes); - } catch (e) { /* empty */ } - if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); - if ('value' in Attributes) O[P] = Attributes.value; - return O; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_object-dps.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_object-dps.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_195238__) { - -var dP = __nested_webpack_require_195238__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); -var anObject = __nested_webpack_require_195238__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var getKeys = __nested_webpack_require_195238__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); - -module.exports = __nested_webpack_require_195238__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") ? Object.defineProperties : function defineProperties(O, Properties) { - anObject(O); - var keys = getKeys(Properties); - var length = keys.length; - var i = 0; - var P; - while (length > i) dP.f(O, P = keys[i++], Properties[P]); - return O; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_object-forced-pam.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/_object-forced-pam.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_196262__) { - -"use strict"; - -// Forced replacement prototype accessors methods -module.exports = __nested_webpack_require_196262__(/*! ./_library */ "./node_modules/core-js/modules/_library.js") || !__nested_webpack_require_196262__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { - var K = Math.random(); - // In FF throws only define methods - // eslint-disable-next-line no-undef, no-useless-call - __defineSetter__.call(null, K, function () { /* empty */ }); - delete __nested_webpack_require_196262__(/*! ./_global */ "./node_modules/core-js/modules/_global.js")[K]; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_object-gopd.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/_object-gopd.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_197143__) { - -var pIE = __nested_webpack_require_197143__(/*! ./_object-pie */ "./node_modules/core-js/modules/_object-pie.js"); -var createDesc = __nested_webpack_require_197143__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); -var toIObject = __nested_webpack_require_197143__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); -var toPrimitive = __nested_webpack_require_197143__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); -var has = __nested_webpack_require_197143__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); -var IE8_DOM_DEFINE = __nested_webpack_require_197143__(/*! ./_ie8-dom-define */ "./node_modules/core-js/modules/_ie8-dom-define.js"); -var gOPD = Object.getOwnPropertyDescriptor; - -exports.f = __nested_webpack_require_197143__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") ? gOPD : function getOwnPropertyDescriptor(O, P) { - O = toIObject(O); - P = toPrimitive(P, true); - if (IE8_DOM_DEFINE) try { - return gOPD(O, P); - } catch (e) { /* empty */ } - if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_object-gopn-ext.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/modules/_object-gopn-ext.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_198530__) { - -// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window -var toIObject = __nested_webpack_require_198530__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); -var gOPN = __nested_webpack_require_198530__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f; -var toString = {}.toString; - -var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames - ? Object.getOwnPropertyNames(window) : []; - -var getWindowNames = function (it) { - try { - return gOPN(it); - } catch (e) { - return windowNames.slice(); - } -}; - -module.exports.f = function getOwnPropertyNames(it) { - return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_object-gopn.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/_object-gopn.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_199601__) { - -// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) -var $keys = __nested_webpack_require_199601__(/*! ./_object-keys-internal */ "./node_modules/core-js/modules/_object-keys-internal.js"); -var hiddenKeys = __nested_webpack_require_199601__(/*! ./_enum-bug-keys */ "./node_modules/core-js/modules/_enum-bug-keys.js").concat('length', 'prototype'); - -exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return $keys(O, hiddenKeys); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_object-gops.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/_object-gops.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -exports.f = Object.getOwnPropertySymbols; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_object-gpo.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_object-gpo.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_200721__) { - -// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) -var has = __nested_webpack_require_200721__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); -var toObject = __nested_webpack_require_200721__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); -var IE_PROTO = __nested_webpack_require_200721__(/*! ./_shared-key */ "./node_modules/core-js/modules/_shared-key.js")('IE_PROTO'); -var ObjectProto = Object.prototype; - -module.exports = Object.getPrototypeOf || function (O) { - O = toObject(O); - if (has(O, IE_PROTO)) return O[IE_PROTO]; - if (typeof O.constructor == 'function' && O instanceof O.constructor) { - return O.constructor.prototype; - } return O instanceof Object ? ObjectProto : null; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_object-keys-internal.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js/modules/_object-keys-internal.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_201773__) { - -var has = __nested_webpack_require_201773__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); -var toIObject = __nested_webpack_require_201773__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); -var arrayIndexOf = __nested_webpack_require_201773__(/*! ./_array-includes */ "./node_modules/core-js/modules/_array-includes.js")(false); -var IE_PROTO = __nested_webpack_require_201773__(/*! ./_shared-key */ "./node_modules/core-js/modules/_shared-key.js")('IE_PROTO'); - -module.exports = function (object, names) { - var O = toIObject(object); - var i = 0; - var result = []; - var key; - for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); - // Don't enum bug & hidden keys - while (names.length > i) if (has(O, key = names[i++])) { - ~arrayIndexOf(result, key) || result.push(key); - } - return result; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_object-keys.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/_object-keys.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_202903__) { - -// 19.1.2.14 / 15.2.3.14 Object.keys(O) -var $keys = __nested_webpack_require_202903__(/*! ./_object-keys-internal */ "./node_modules/core-js/modules/_object-keys-internal.js"); -var enumBugKeys = __nested_webpack_require_202903__(/*! ./_enum-bug-keys */ "./node_modules/core-js/modules/_enum-bug-keys.js"); - -module.exports = Object.keys || function keys(O) { - return $keys(O, enumBugKeys); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_object-pie.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_object-pie.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -exports.f = {}.propertyIsEnumerable; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_object-sap.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_object-sap.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_203948__) { - -// most Object methods by ES6 should accept primitives -var $export = __nested_webpack_require_203948__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var core = __nested_webpack_require_203948__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); -var fails = __nested_webpack_require_203948__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); -module.exports = function (KEY, exec) { - var fn = (core.Object || {})[KEY] || Object[KEY]; - var exp = {}; - exp[KEY] = exec(fn); - $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_object-to-array.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/modules/_object-to-array.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_204850__) { - -var DESCRIPTORS = __nested_webpack_require_204850__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); -var getKeys = __nested_webpack_require_204850__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); -var toIObject = __nested_webpack_require_204850__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); -var isEnum = __nested_webpack_require_204850__(/*! ./_object-pie */ "./node_modules/core-js/modules/_object-pie.js").f; -module.exports = function (isEntries) { - return function (it) { - var O = toIObject(it); - var keys = getKeys(O); - var length = keys.length; - var i = 0; - var result = []; - var key; - while (length > i) { - key = keys[i++]; - if (!DESCRIPTORS || isEnum.call(O, key)) { - result.push(isEntries ? [key, O[key]] : O[key]); - } - } - return result; - }; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_own-keys.js": -/*!***************************************************!*\ - !*** ./node_modules/core-js/modules/_own-keys.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_205998__) { - -// all object keys, includes non-enumerable and symbols -var gOPN = __nested_webpack_require_205998__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js"); -var gOPS = __nested_webpack_require_205998__(/*! ./_object-gops */ "./node_modules/core-js/modules/_object-gops.js"); -var anObject = __nested_webpack_require_205998__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var Reflect = __nested_webpack_require_205998__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").Reflect; -module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { - var keys = gOPN.f(anObject(it)); - var getSymbols = gOPS.f; - return getSymbols ? keys.concat(getSymbols(it)) : keys; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_parse-float.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/_parse-float.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_207000__) { - -var $parseFloat = __nested_webpack_require_207000__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").parseFloat; -var $trim = __nested_webpack_require_207000__(/*! ./_string-trim */ "./node_modules/core-js/modules/_string-trim.js").trim; - -module.exports = 1 / $parseFloat(__nested_webpack_require_207000__(/*! ./_string-ws */ "./node_modules/core-js/modules/_string-ws.js") + '-0') !== -Infinity ? function parseFloat(str) { - var string = $trim(String(str), 3); - var result = $parseFloat(string); - return result === 0 && string.charAt(0) == '-' ? -0 : result; -} : $parseFloat; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_parse-int.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/_parse-int.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_207878__) { - -var $parseInt = __nested_webpack_require_207878__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").parseInt; -var $trim = __nested_webpack_require_207878__(/*! ./_string-trim */ "./node_modules/core-js/modules/_string-trim.js").trim; -var ws = __nested_webpack_require_207878__(/*! ./_string-ws */ "./node_modules/core-js/modules/_string-ws.js"); -var hex = /^[-+]?0[xX]/; - -module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { - var string = $trim(String(str), 3); - return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); -} : $parseInt; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_perform.js": -/*!**************************************************!*\ - !*** ./node_modules/core-js/modules/_perform.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = function (exec) { - try { - return { e: false, v: exec() }; - } catch (e) { - return { e: true, v: e }; - } -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_promise-resolve.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/modules/_promise-resolve.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_209242__) { - -var anObject = __nested_webpack_require_209242__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var isObject = __nested_webpack_require_209242__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var newPromiseCapability = __nested_webpack_require_209242__(/*! ./_new-promise-capability */ "./node_modules/core-js/modules/_new-promise-capability.js"); - -module.exports = function (C, x) { - anObject(C); - if (isObject(x) && x.constructor === C) return x; - var promiseCapability = newPromiseCapability.f(C); - var resolve = promiseCapability.resolve; - resolve(x); - return promiseCapability.promise; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_property-desc.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/_property-desc.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = function (bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value: value - }; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_redefine-all.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/modules/_redefine-all.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_210680__) { - -var redefine = __nested_webpack_require_210680__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); -module.exports = function (target, src, safe) { - for (var key in src) redefine(target, key, src[key], safe); - return target; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_redefine.js": -/*!***************************************************!*\ - !*** ./node_modules/core-js/modules/_redefine.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_211236__) { - -var global = __nested_webpack_require_211236__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var hide = __nested_webpack_require_211236__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); -var has = __nested_webpack_require_211236__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); -var SRC = __nested_webpack_require_211236__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js")('src'); -var $toString = __nested_webpack_require_211236__(/*! ./_function-to-string */ "./node_modules/core-js/modules/_function-to-string.js"); -var TO_STRING = 'toString'; -var TPL = ('' + $toString).split(TO_STRING); - -__nested_webpack_require_211236__(/*! ./_core */ "./node_modules/core-js/modules/_core.js").inspectSource = function (it) { - return $toString.call(it); -}; - -(module.exports = function (O, key, val, safe) { - var isFunction = typeof val == 'function'; - if (isFunction) has(val, 'name') || hide(val, 'name', key); - if (O[key] === val) return; - if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); - if (O === global) { - O[key] = val; - } else if (!safe) { - delete O[key]; - hide(O, key, val); - } else if (O[key]) { - O[key] = val; - } else { - hide(O, key, val); - } -// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative -})(Function.prototype, TO_STRING, function toString() { - return typeof this == 'function' && this[SRC] || $toString.call(this); -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_regexp-exec-abstract.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js/modules/_regexp-exec-abstract.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_213026__) { - -"use strict"; - - -var classof = __nested_webpack_require_213026__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); -var builtinExec = RegExp.prototype.exec; - - // `RegExpExec` abstract operation -// https://tc39.github.io/ecma262/#sec-regexpexec -module.exports = function (R, S) { - var exec = R.exec; - if (typeof exec === 'function') { - var result = exec.call(R, S); - if (typeof result !== 'object') { - throw new TypeError('RegExp exec method returned something other than an Object or null'); - } - return result; - } - if (classof(R) !== 'RegExp') { - throw new TypeError('RegExp#exec called on incompatible receiver'); - } - return builtinExec.call(R, S); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_regexp-exec.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/_regexp-exec.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_214040__) { - -"use strict"; - - -var regexpFlags = __nested_webpack_require_214040__(/*! ./_flags */ "./node_modules/core-js/modules/_flags.js"); - -var nativeExec = RegExp.prototype.exec; -// This always refers to the native implementation, because the -// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, -// which loads this file before patching the method. -var nativeReplace = String.prototype.replace; - -var patchedExec = nativeExec; - -var LAST_INDEX = 'lastIndex'; - -var UPDATES_LAST_INDEX_WRONG = (function () { - var re1 = /a/, - re2 = /b*/g; - nativeExec.call(re1, 'a'); - nativeExec.call(re2, 'a'); - return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0; -})(); - -// nonparticipating capturing group, copied from es5-shim's String#split patch. -var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; - -var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED; - -if (PATCH) { - patchedExec = function exec(str) { - var re = this; - var lastIndex, reCopy, match, i; - - if (NPCG_INCLUDED) { - reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re)); - } - if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX]; - - match = nativeExec.call(re, str); - - if (UPDATES_LAST_INDEX_WRONG && match) { - re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex; - } - if (NPCG_INCLUDED && match && match.length > 1) { - // Fix browsers whose `exec` methods don't consistently return `undefined` - // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ - // eslint-disable-next-line no-loop-func - nativeReplace.call(match[0], reCopy, function () { - for (i = 1; i < arguments.length - 2; i++) { - if (arguments[i] === undefined) match[i] = undefined; - } - }); - } - - return match; - }; -} - -module.exports = patchedExec; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_replacer.js": -/*!***************************************************!*\ - !*** ./node_modules/core-js/modules/_replacer.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = function (regExp, replace) { - var replacer = replace === Object(replace) ? function (part) { - return replace[part]; - } : replace; - return function (it) { - return String(it).replace(regExp, replacer); - }; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_same-value.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_same-value.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// 7.2.9 SameValue(x, y) -module.exports = Object.is || function is(x, y) { - // eslint-disable-next-line no-self-compare - return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_set-collection-from.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/_set-collection-from.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_217247__) { - -"use strict"; - -// https://tc39.github.io/proposal-setmap-offrom/ -var $export = __nested_webpack_require_217247__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var aFunction = __nested_webpack_require_217247__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); -var ctx = __nested_webpack_require_217247__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); -var forOf = __nested_webpack_require_217247__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); - -module.exports = function (COLLECTION) { - $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) { - var mapFn = arguments[1]; - var mapping, A, n, cb; - aFunction(this); - mapping = mapFn !== undefined; - if (mapping) aFunction(mapFn); - if (source == undefined) return new this(); - A = []; - if (mapping) { - n = 0; - cb = ctx(mapFn, arguments[2], 2); - forOf(source, false, function (nextItem) { - A.push(cb(nextItem, n++)); - }); - } else { - forOf(source, false, A.push, A); - } - return new this(A); - } }); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_set-collection-of.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/_set-collection-of.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_218655__) { - -"use strict"; - -// https://tc39.github.io/proposal-setmap-offrom/ -var $export = __nested_webpack_require_218655__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -module.exports = function (COLLECTION) { - $export($export.S, COLLECTION, { of: function of() { - var length = arguments.length; - var A = new Array(length); - while (length--) A[length] = arguments[length]; - return new this(A); - } }); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_set-proto.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/_set-proto.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_219395__) { - -// Works with __proto__ only. Old v8 can't work with null proto objects. -/* eslint-disable no-proto */ -var isObject = __nested_webpack_require_219395__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var anObject = __nested_webpack_require_219395__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var check = function (O, proto) { - anObject(O); - if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); -}; -module.exports = { - set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line - function (test, buggy, set) { - try { - set = __nested_webpack_require_219395__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js")(Function.call, __nested_webpack_require_219395__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js").f(Object.prototype, '__proto__').set, 2); - set(test, []); - buggy = !(test instanceof Array); - } catch (e) { buggy = true; } - return function setPrototypeOf(O, proto) { - check(O, proto); - if (buggy) O.__proto__ = proto; - else set(O, proto); - return O; - }; - }({}, false) : undefined), - check: check -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_set-species.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/_set-species.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_220889__) { - -"use strict"; - -var global = __nested_webpack_require_220889__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var dP = __nested_webpack_require_220889__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); -var DESCRIPTORS = __nested_webpack_require_220889__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); -var SPECIES = __nested_webpack_require_220889__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('species'); - -module.exports = function (KEY) { - var C = global[KEY]; - if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { - configurable: true, - get: function () { return this; } - }); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_set-to-string-tag.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/_set-to-string-tag.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_221858__) { - -var def = __nested_webpack_require_221858__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; -var has = __nested_webpack_require_221858__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); -var TAG = __nested_webpack_require_221858__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('toStringTag'); - -module.exports = function (it, tag, stat) { - if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_shared-key.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_shared-key.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_222632__) { - -var shared = __nested_webpack_require_222632__(/*! ./_shared */ "./node_modules/core-js/modules/_shared.js")('keys'); -var uid = __nested_webpack_require_222632__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js"); -module.exports = function (key) { - return shared[key] || (shared[key] = uid(key)); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_shared.js": -/*!*************************************************!*\ - !*** ./node_modules/core-js/modules/_shared.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_223226__) { - -var core = __nested_webpack_require_223226__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); -var global = __nested_webpack_require_223226__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var SHARED = '__core-js_shared__'; -var store = global[SHARED] || (global[SHARED] = {}); - -(module.exports = function (key, value) { - return store[key] || (store[key] = value !== undefined ? value : {}); -})('versions', []).push({ - version: core.version, - mode: __nested_webpack_require_223226__(/*! ./_library */ "./node_modules/core-js/modules/_library.js") ? 'pure' : 'global', - copyright: '© 2019 Denis Pushkarev (zloirock.ru)' -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_species-constructor.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/_species-constructor.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_224203__) { - -// 7.3.20 SpeciesConstructor(O, defaultConstructor) -var anObject = __nested_webpack_require_224203__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var aFunction = __nested_webpack_require_224203__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); -var SPECIES = __nested_webpack_require_224203__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('species'); -module.exports = function (O, D) { - var C = anObject(O).constructor; - var S; - return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_strict-method.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/_strict-method.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_225082__) { - -"use strict"; - -var fails = __nested_webpack_require_225082__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); - -module.exports = function (method, arg) { - return !!method && fails(function () { - // eslint-disable-next-line no-useless-call - arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); - }); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_string-at.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/_string-at.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_225740__) { - -var toInteger = __nested_webpack_require_225740__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); -var defined = __nested_webpack_require_225740__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); -// true -> String#at -// false -> String#codePointAt -module.exports = function (TO_STRING) { - return function (that, pos) { - var s = String(defined(that)); - var i = toInteger(pos); - var l = s.length; - var a, b; - if (i < 0 || i >= l) return TO_STRING ? '' : undefined; - a = s.charCodeAt(i); - return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff - ? TO_STRING ? s.charAt(i) : a - : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; - }; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_string-context.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/_string-context.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_226835__) { - -// helper for String#{startsWith, endsWith, includes} -var isRegExp = __nested_webpack_require_226835__(/*! ./_is-regexp */ "./node_modules/core-js/modules/_is-regexp.js"); -var defined = __nested_webpack_require_226835__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); - -module.exports = function (that, searchString, NAME) { - if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); - return String(defined(that)); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_string-html.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/_string-html.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_227611__) { - -var $export = __nested_webpack_require_227611__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var fails = __nested_webpack_require_227611__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); -var defined = __nested_webpack_require_227611__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); -var quot = /"/g; -// B.2.3.2.1 CreateHTML(string, tag, attribute, value) -var createHTML = function (string, tag, attribute, value) { - var S = String(defined(string)); - var p1 = '<' + tag; - if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; - return p1 + '>' + S + ''; -}; -module.exports = function (NAME, exec) { - var O = {}; - O[NAME] = exec(createHTML); - $export($export.P + $export.F * fails(function () { - var test = ''[NAME]('"'); - return test !== test.toLowerCase() || test.split('"').length > 3; - }), 'String', O); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_string-pad.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_string-pad.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_228828__) { - -// https://github.com/tc39/proposal-string-pad-start-end -var toLength = __nested_webpack_require_228828__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -var repeat = __nested_webpack_require_228828__(/*! ./_string-repeat */ "./node_modules/core-js/modules/_string-repeat.js"); -var defined = __nested_webpack_require_228828__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); - -module.exports = function (that, maxLength, fillString, left) { - var S = String(defined(that)); - var stringLength = S.length; - var fillStr = fillString === undefined ? ' ' : String(fillString); - var intMaxLength = toLength(maxLength); - if (intMaxLength <= stringLength || fillStr == '') return S; - var fillLen = intMaxLength - stringLength; - var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); - if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); - return left ? stringFiller + S : S + stringFiller; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_string-repeat.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/_string-repeat.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_230110__) { - -"use strict"; - -var toInteger = __nested_webpack_require_230110__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); -var defined = __nested_webpack_require_230110__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); - -module.exports = function repeat(count) { - var str = String(defined(this)); - var res = ''; - var n = toInteger(count); - if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); - for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; - return res; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_string-trim.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/_string-trim.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_230947__) { - -var $export = __nested_webpack_require_230947__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var defined = __nested_webpack_require_230947__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); -var fails = __nested_webpack_require_230947__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); -var spaces = __nested_webpack_require_230947__(/*! ./_string-ws */ "./node_modules/core-js/modules/_string-ws.js"); -var space = '[' + spaces + ']'; -var non = '\u200b\u0085'; -var ltrim = RegExp('^' + space + space + '*'); -var rtrim = RegExp(space + space + '*$'); - -var exporter = function (KEY, exec, ALIAS) { - var exp = {}; - var FORCE = fails(function () { - return !!spaces[KEY]() || non[KEY]() != non; - }); - var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; - if (ALIAS) exp[ALIAS] = fn; - $export($export.P + $export.F * FORCE, 'String', exp); -}; - -// 1 -> String#trimLeft -// 2 -> String#trimRight -// 3 -> String#trim -var trim = exporter.trim = function (string, TYPE) { - string = String(defined(string)); - if (TYPE & 1) string = string.replace(ltrim, ''); - if (TYPE & 2) string = string.replace(rtrim, ''); - return string; -}; - -module.exports = exporter; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_string-ws.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/_string-ws.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + - '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_task.js": -/*!***********************************************!*\ - !*** ./node_modules/core-js/modules/_task.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_232878__) { - -var ctx = __nested_webpack_require_232878__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); -var invoke = __nested_webpack_require_232878__(/*! ./_invoke */ "./node_modules/core-js/modules/_invoke.js"); -var html = __nested_webpack_require_232878__(/*! ./_html */ "./node_modules/core-js/modules/_html.js"); -var cel = __nested_webpack_require_232878__(/*! ./_dom-create */ "./node_modules/core-js/modules/_dom-create.js"); -var global = __nested_webpack_require_232878__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var process = global.process; -var setTask = global.setImmediate; -var clearTask = global.clearImmediate; -var MessageChannel = global.MessageChannel; -var Dispatch = global.Dispatch; -var counter = 0; -var queue = {}; -var ONREADYSTATECHANGE = 'onreadystatechange'; -var defer, channel, port; -var run = function () { - var id = +this; - // eslint-disable-next-line no-prototype-builtins - if (queue.hasOwnProperty(id)) { - var fn = queue[id]; - delete queue[id]; - fn(); - } -}; -var listener = function (event) { - run.call(event.data); -}; -// Node.js 0.9+ & IE10+ has setImmediate, otherwise: -if (!setTask || !clearTask) { - setTask = function setImmediate(fn) { - var args = []; - var i = 1; - while (arguments.length > i) args.push(arguments[i++]); - queue[++counter] = function () { - // eslint-disable-next-line no-new-func - invoke(typeof fn == 'function' ? fn : Function(fn), args); - }; - defer(counter); - return counter; - }; - clearTask = function clearImmediate(id) { - delete queue[id]; - }; - // Node.js 0.8- - if (__nested_webpack_require_232878__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js")(process) == 'process') { - defer = function (id) { - process.nextTick(ctx(run, id, 1)); - }; - // Sphere (JS game engine) Dispatch API - } else if (Dispatch && Dispatch.now) { - defer = function (id) { - Dispatch.now(ctx(run, id, 1)); - }; - // Browsers with MessageChannel, includes WebWorkers - } else if (MessageChannel) { - channel = new MessageChannel(); - port = channel.port2; - channel.port1.onmessage = listener; - defer = ctx(port.postMessage, port, 1); - // Browsers with postMessage, skip WebWorkers - // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' - } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { - defer = function (id) { - global.postMessage(id + '', '*'); - }; - global.addEventListener('message', listener, false); - // IE8- - } else if (ONREADYSTATECHANGE in cel('script')) { - defer = function (id) { - html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { - html.removeChild(this); - run.call(id); - }; - }; - // Rest old browsers - } else { - defer = function (id) { - setTimeout(ctx(run, id, 1), 0); - }; - } -} -module.exports = { - set: setTask, - clear: clearTask -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_to-absolute-index.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/_to-absolute-index.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_236084__) { - -var toInteger = __nested_webpack_require_236084__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); -var max = Math.max; -var min = Math.min; -module.exports = function (index, length) { - index = toInteger(index); - return index < 0 ? max(index + length, 0) : min(index, length); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_to-index.js": -/*!***************************************************!*\ - !*** ./node_modules/core-js/modules/_to-index.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_236696__) { - -// https://tc39.github.io/ecma262/#sec-toindex -var toInteger = __nested_webpack_require_236696__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); -var toLength = __nested_webpack_require_236696__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -module.exports = function (it) { - if (it === undefined) return 0; - var number = toInteger(it); - var length = toLength(number); - if (number !== length) throw RangeError('Wrong length!'); - return length; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_to-integer.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_to-integer.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// 7.1.4 ToInteger -var ceil = Math.ceil; -var floor = Math.floor; -module.exports = function (it) { - return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_to-iobject.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_to-iobject.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_237968__) { - -// to indexed object, toObject with fallback for non-array-like ES3 strings -var IObject = __nested_webpack_require_237968__(/*! ./_iobject */ "./node_modules/core-js/modules/_iobject.js"); -var defined = __nested_webpack_require_237968__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); -module.exports = function (it) { - return IObject(defined(it)); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_to-length.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/_to-length.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_238637__) { - -// 7.1.15 ToLength -var toInteger = __nested_webpack_require_238637__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); -var min = Math.min; -module.exports = function (it) { - return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_to-object.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/_to-object.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_239245__) { - -// 7.1.13 ToObject(argument) -var defined = __nested_webpack_require_239245__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); -module.exports = function (it) { - return Object(defined(it)); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_to-primitive.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/modules/_to-primitive.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_239779__) { - -// 7.1.1 ToPrimitive(input [, PreferredType]) -var isObject = __nested_webpack_require_239779__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -// instead of the ES6 spec version, we didn't implement @@toPrimitive case -// and the second argument - flag - preferred type is a string -module.exports = function (it, S) { - if (!isObject(it)) return it; - var fn, val; - if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; - if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; - if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; - throw TypeError("Can't convert object to primitive value"); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_typed-array.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/_typed-array.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_240834__) { - -"use strict"; - -if (__nested_webpack_require_240834__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js")) { - var LIBRARY = __nested_webpack_require_240834__(/*! ./_library */ "./node_modules/core-js/modules/_library.js"); - var global = __nested_webpack_require_240834__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); - var fails = __nested_webpack_require_240834__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); - var $export = __nested_webpack_require_240834__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - var $typed = __nested_webpack_require_240834__(/*! ./_typed */ "./node_modules/core-js/modules/_typed.js"); - var $buffer = __nested_webpack_require_240834__(/*! ./_typed-buffer */ "./node_modules/core-js/modules/_typed-buffer.js"); - var ctx = __nested_webpack_require_240834__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); - var anInstance = __nested_webpack_require_240834__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); - var propertyDesc = __nested_webpack_require_240834__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); - var hide = __nested_webpack_require_240834__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); - var redefineAll = __nested_webpack_require_240834__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); - var toInteger = __nested_webpack_require_240834__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); - var toLength = __nested_webpack_require_240834__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); - var toIndex = __nested_webpack_require_240834__(/*! ./_to-index */ "./node_modules/core-js/modules/_to-index.js"); - var toAbsoluteIndex = __nested_webpack_require_240834__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); - var toPrimitive = __nested_webpack_require_240834__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); - var has = __nested_webpack_require_240834__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); - var classof = __nested_webpack_require_240834__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); - var isObject = __nested_webpack_require_240834__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); - var toObject = __nested_webpack_require_240834__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); - var isArrayIter = __nested_webpack_require_240834__(/*! ./_is-array-iter */ "./node_modules/core-js/modules/_is-array-iter.js"); - var create = __nested_webpack_require_240834__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js"); - var getPrototypeOf = __nested_webpack_require_240834__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); - var gOPN = __nested_webpack_require_240834__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f; - var getIterFn = __nested_webpack_require_240834__(/*! ./core.get-iterator-method */ "./node_modules/core-js/modules/core.get-iterator-method.js"); - var uid = __nested_webpack_require_240834__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js"); - var wks = __nested_webpack_require_240834__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js"); - var createArrayMethod = __nested_webpack_require_240834__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js"); - var createArrayIncludes = __nested_webpack_require_240834__(/*! ./_array-includes */ "./node_modules/core-js/modules/_array-includes.js"); - var speciesConstructor = __nested_webpack_require_240834__(/*! ./_species-constructor */ "./node_modules/core-js/modules/_species-constructor.js"); - var ArrayIterators = __nested_webpack_require_240834__(/*! ./es6.array.iterator */ "./node_modules/core-js/modules/es6.array.iterator.js"); - var Iterators = __nested_webpack_require_240834__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); - var $iterDetect = __nested_webpack_require_240834__(/*! ./_iter-detect */ "./node_modules/core-js/modules/_iter-detect.js"); - var setSpecies = __nested_webpack_require_240834__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js"); - var arrayFill = __nested_webpack_require_240834__(/*! ./_array-fill */ "./node_modules/core-js/modules/_array-fill.js"); - var arrayCopyWithin = __nested_webpack_require_240834__(/*! ./_array-copy-within */ "./node_modules/core-js/modules/_array-copy-within.js"); - var $DP = __nested_webpack_require_240834__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); - var $GOPD = __nested_webpack_require_240834__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js"); - var dP = $DP.f; - var gOPD = $GOPD.f; - var RangeError = global.RangeError; - var TypeError = global.TypeError; - var Uint8Array = global.Uint8Array; - var ARRAY_BUFFER = 'ArrayBuffer'; - var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; - var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; - var PROTOTYPE = 'prototype'; - var ArrayProto = Array[PROTOTYPE]; - var $ArrayBuffer = $buffer.ArrayBuffer; - var $DataView = $buffer.DataView; - var arrayForEach = createArrayMethod(0); - var arrayFilter = createArrayMethod(2); - var arraySome = createArrayMethod(3); - var arrayEvery = createArrayMethod(4); - var arrayFind = createArrayMethod(5); - var arrayFindIndex = createArrayMethod(6); - var arrayIncludes = createArrayIncludes(true); - var arrayIndexOf = createArrayIncludes(false); - var arrayValues = ArrayIterators.values; - var arrayKeys = ArrayIterators.keys; - var arrayEntries = ArrayIterators.entries; - var arrayLastIndexOf = ArrayProto.lastIndexOf; - var arrayReduce = ArrayProto.reduce; - var arrayReduceRight = ArrayProto.reduceRight; - var arrayJoin = ArrayProto.join; - var arraySort = ArrayProto.sort; - var arraySlice = ArrayProto.slice; - var arrayToString = ArrayProto.toString; - var arrayToLocaleString = ArrayProto.toLocaleString; - var ITERATOR = wks('iterator'); - var TAG = wks('toStringTag'); - var TYPED_CONSTRUCTOR = uid('typed_constructor'); - var DEF_CONSTRUCTOR = uid('def_constructor'); - var ALL_CONSTRUCTORS = $typed.CONSTR; - var TYPED_ARRAY = $typed.TYPED; - var VIEW = $typed.VIEW; - var WRONG_LENGTH = 'Wrong length!'; - - var $map = createArrayMethod(1, function (O, length) { - return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); - }); - - var LITTLE_ENDIAN = fails(function () { - // eslint-disable-next-line no-undef - return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; - }); - - var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { - new Uint8Array(1).set({}); - }); - - var toOffset = function (it, BYTES) { - var offset = toInteger(it); - if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); - return offset; - }; - - var validate = function (it) { - if (isObject(it) && TYPED_ARRAY in it) return it; - throw TypeError(it + ' is not a typed array!'); - }; - - var allocate = function (C, length) { - if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { - throw TypeError('It is not a typed array constructor!'); - } return new C(length); - }; - - var speciesFromList = function (O, list) { - return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); - }; - - var fromList = function (C, list) { - var index = 0; - var length = list.length; - var result = allocate(C, length); - while (length > index) result[index] = list[index++]; - return result; - }; - - var addGetter = function (it, key, internal) { - dP(it, key, { get: function () { return this._d[internal]; } }); - }; - - var $from = function from(source /* , mapfn, thisArg */) { - var O = toObject(source); - var aLen = arguments.length; - var mapfn = aLen > 1 ? arguments[1] : undefined; - var mapping = mapfn !== undefined; - var iterFn = getIterFn(O); - var i, length, values, result, step, iterator; - if (iterFn != undefined && !isArrayIter(iterFn)) { - for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { - values.push(step.value); - } O = values; - } - if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); - for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { - result[i] = mapping ? mapfn(O[i], i) : O[i]; - } - return result; - }; - - var $of = function of(/* ...items */) { - var index = 0; - var length = arguments.length; - var result = allocate(this, length); - while (length > index) result[index] = arguments[index++]; - return result; - }; - - // iOS Safari 6.x fails here - var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); - - var $toLocaleString = function toLocaleString() { - return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); - }; - - var proto = { - copyWithin: function copyWithin(target, start /* , end */) { - return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); - }, - every: function every(callbackfn /* , thisArg */) { - return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars - return arrayFill.apply(validate(this), arguments); - }, - filter: function filter(callbackfn /* , thisArg */) { - return speciesFromList(this, arrayFilter(validate(this), callbackfn, - arguments.length > 1 ? arguments[1] : undefined)); - }, - find: function find(predicate /* , thisArg */) { - return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); - }, - findIndex: function findIndex(predicate /* , thisArg */) { - return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); - }, - forEach: function forEach(callbackfn /* , thisArg */) { - arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - indexOf: function indexOf(searchElement /* , fromIndex */) { - return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); - }, - includes: function includes(searchElement /* , fromIndex */) { - return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); - }, - join: function join(separator) { // eslint-disable-line no-unused-vars - return arrayJoin.apply(validate(this), arguments); - }, - lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars - return arrayLastIndexOf.apply(validate(this), arguments); - }, - map: function map(mapfn /* , thisArg */) { - return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); - }, - reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars - return arrayReduce.apply(validate(this), arguments); - }, - reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars - return arrayReduceRight.apply(validate(this), arguments); - }, - reverse: function reverse() { - var that = this; - var length = validate(that).length; - var middle = Math.floor(length / 2); - var index = 0; - var value; - while (index < middle) { - value = that[index]; - that[index++] = that[--length]; - that[length] = value; - } return that; - }, - some: function some(callbackfn /* , thisArg */) { - return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - sort: function sort(comparefn) { - return arraySort.call(validate(this), comparefn); - }, - subarray: function subarray(begin, end) { - var O = validate(this); - var length = O.length; - var $begin = toAbsoluteIndex(begin, length); - return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( - O.buffer, - O.byteOffset + $begin * O.BYTES_PER_ELEMENT, - toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) - ); - } - }; - - var $slice = function slice(start, end) { - return speciesFromList(this, arraySlice.call(validate(this), start, end)); - }; - - var $set = function set(arrayLike /* , offset */) { - validate(this); - var offset = toOffset(arguments[1], 1); - var length = this.length; - var src = toObject(arrayLike); - var len = toLength(src.length); - var index = 0; - if (len + offset > length) throw RangeError(WRONG_LENGTH); - while (index < len) this[offset + index] = src[index++]; - }; - - var $iterators = { - entries: function entries() { - return arrayEntries.call(validate(this)); - }, - keys: function keys() { - return arrayKeys.call(validate(this)); - }, - values: function values() { - return arrayValues.call(validate(this)); - } - }; - - var isTAIndex = function (target, key) { - return isObject(target) - && target[TYPED_ARRAY] - && typeof key != 'symbol' - && key in target - && String(+key) == String(key); - }; - var $getDesc = function getOwnPropertyDescriptor(target, key) { - return isTAIndex(target, key = toPrimitive(key, true)) - ? propertyDesc(2, target[key]) - : gOPD(target, key); - }; - var $setDesc = function defineProperty(target, key, desc) { - if (isTAIndex(target, key = toPrimitive(key, true)) - && isObject(desc) - && has(desc, 'value') - && !has(desc, 'get') - && !has(desc, 'set') - // TODO: add validation descriptor w/o calling accessors - && !desc.configurable - && (!has(desc, 'writable') || desc.writable) - && (!has(desc, 'enumerable') || desc.enumerable) - ) { - target[key] = desc.value; - return target; - } return dP(target, key, desc); - }; - - if (!ALL_CONSTRUCTORS) { - $GOPD.f = $getDesc; - $DP.f = $setDesc; - } - - $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { - getOwnPropertyDescriptor: $getDesc, - defineProperty: $setDesc - }); - - if (fails(function () { arrayToString.call({}); })) { - arrayToString = arrayToLocaleString = function toString() { - return arrayJoin.call(this); - }; - } - - var $TypedArrayPrototype$ = redefineAll({}, proto); - redefineAll($TypedArrayPrototype$, $iterators); - hide($TypedArrayPrototype$, ITERATOR, $iterators.values); - redefineAll($TypedArrayPrototype$, { - slice: $slice, - set: $set, - constructor: function () { /* noop */ }, - toString: arrayToString, - toLocaleString: $toLocaleString - }); - addGetter($TypedArrayPrototype$, 'buffer', 'b'); - addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); - addGetter($TypedArrayPrototype$, 'byteLength', 'l'); - addGetter($TypedArrayPrototype$, 'length', 'e'); - dP($TypedArrayPrototype$, TAG, { - get: function () { return this[TYPED_ARRAY]; } - }); - - // eslint-disable-next-line max-statements - module.exports = function (KEY, BYTES, wrapper, CLAMPED) { - CLAMPED = !!CLAMPED; - var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; - var GETTER = 'get' + KEY; - var SETTER = 'set' + KEY; - var TypedArray = global[NAME]; - var Base = TypedArray || {}; - var TAC = TypedArray && getPrototypeOf(TypedArray); - var FORCED = !TypedArray || !$typed.ABV; - var O = {}; - var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; - var getter = function (that, index) { - var data = that._d; - return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); - }; - var setter = function (that, index, value) { - var data = that._d; - if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; - data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); - }; - var addElement = function (that, index) { - dP(that, index, { - get: function () { - return getter(this, index); - }, - set: function (value) { - return setter(this, index, value); - }, - enumerable: true - }); - }; - if (FORCED) { - TypedArray = wrapper(function (that, data, $offset, $length) { - anInstance(that, TypedArray, NAME, '_d'); - var index = 0; - var offset = 0; - var buffer, byteLength, length, klass; - if (!isObject(data)) { - length = toIndex(data); - byteLength = length * BYTES; - buffer = new $ArrayBuffer(byteLength); - } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { - buffer = data; - offset = toOffset($offset, BYTES); - var $len = data.byteLength; - if ($length === undefined) { - if ($len % BYTES) throw RangeError(WRONG_LENGTH); - byteLength = $len - offset; - if (byteLength < 0) throw RangeError(WRONG_LENGTH); - } else { - byteLength = toLength($length) * BYTES; - if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); - } - length = byteLength / BYTES; - } else if (TYPED_ARRAY in data) { - return fromList(TypedArray, data); - } else { - return $from.call(TypedArray, data); - } - hide(that, '_d', { - b: buffer, - o: offset, - l: byteLength, - e: length, - v: new $DataView(buffer) - }); - while (index < length) addElement(that, index++); - }); - TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); - hide(TypedArrayPrototype, 'constructor', TypedArray); - } else if (!fails(function () { - TypedArray(1); - }) || !fails(function () { - new TypedArray(-1); // eslint-disable-line no-new - }) || !$iterDetect(function (iter) { - new TypedArray(); // eslint-disable-line no-new - new TypedArray(null); // eslint-disable-line no-new - new TypedArray(1.5); // eslint-disable-line no-new - new TypedArray(iter); // eslint-disable-line no-new - }, true)) { - TypedArray = wrapper(function (that, data, $offset, $length) { - anInstance(that, TypedArray, NAME); - var klass; - // `ws` module bug, temporarily remove validation length for Uint8Array - // https://github.com/websockets/ws/pull/645 - if (!isObject(data)) return new Base(toIndex(data)); - if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { - return $length !== undefined - ? new Base(data, toOffset($offset, BYTES), $length) - : $offset !== undefined - ? new Base(data, toOffset($offset, BYTES)) - : new Base(data); - } - if (TYPED_ARRAY in data) return fromList(TypedArray, data); - return $from.call(TypedArray, data); - }); - arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { - if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); - }); - TypedArray[PROTOTYPE] = TypedArrayPrototype; - if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; - } - var $nativeIterator = TypedArrayPrototype[ITERATOR]; - var CORRECT_ITER_NAME = !!$nativeIterator - && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); - var $iterator = $iterators.values; - hide(TypedArray, TYPED_CONSTRUCTOR, true); - hide(TypedArrayPrototype, TYPED_ARRAY, NAME); - hide(TypedArrayPrototype, VIEW, true); - hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); - - if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { - dP(TypedArrayPrototype, TAG, { - get: function () { return NAME; } - }); - } - - O[NAME] = TypedArray; - - $export($export.G + $export.W + $export.F * (TypedArray != Base), O); - - $export($export.S, NAME, { - BYTES_PER_ELEMENT: BYTES - }); - - $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { - from: $from, - of: $of - }); - - if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); - - $export($export.P, NAME, proto); - - setSpecies(NAME); - - $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); - - $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); - - if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; - - $export($export.P + $export.F * fails(function () { - new TypedArray(1).slice(); - }), NAME, { slice: $slice }); - - $export($export.P + $export.F * (fails(function () { - return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); - }) || !fails(function () { - TypedArrayPrototype.toLocaleString.call([1, 2]); - })), NAME, { toLocaleString: $toLocaleString }); - - Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; - if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); - }; -} else module.exports = function () { /* empty */ }; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_typed-buffer.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/modules/_typed-buffer.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_262002__) { - -"use strict"; - -var global = __nested_webpack_require_262002__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var DESCRIPTORS = __nested_webpack_require_262002__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); -var LIBRARY = __nested_webpack_require_262002__(/*! ./_library */ "./node_modules/core-js/modules/_library.js"); -var $typed = __nested_webpack_require_262002__(/*! ./_typed */ "./node_modules/core-js/modules/_typed.js"); -var hide = __nested_webpack_require_262002__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); -var redefineAll = __nested_webpack_require_262002__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); -var fails = __nested_webpack_require_262002__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); -var anInstance = __nested_webpack_require_262002__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); -var toInteger = __nested_webpack_require_262002__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); -var toLength = __nested_webpack_require_262002__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -var toIndex = __nested_webpack_require_262002__(/*! ./_to-index */ "./node_modules/core-js/modules/_to-index.js"); -var gOPN = __nested_webpack_require_262002__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f; -var dP = __nested_webpack_require_262002__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; -var arrayFill = __nested_webpack_require_262002__(/*! ./_array-fill */ "./node_modules/core-js/modules/_array-fill.js"); -var setToStringTag = __nested_webpack_require_262002__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js"); -var ARRAY_BUFFER = 'ArrayBuffer'; -var DATA_VIEW = 'DataView'; -var PROTOTYPE = 'prototype'; -var WRONG_LENGTH = 'Wrong length!'; -var WRONG_INDEX = 'Wrong index!'; -var $ArrayBuffer = global[ARRAY_BUFFER]; -var $DataView = global[DATA_VIEW]; -var Math = global.Math; -var RangeError = global.RangeError; -// eslint-disable-next-line no-shadow-restricted-names -var Infinity = global.Infinity; -var BaseBuffer = $ArrayBuffer; -var abs = Math.abs; -var pow = Math.pow; -var floor = Math.floor; -var log = Math.log; -var LN2 = Math.LN2; -var BUFFER = 'buffer'; -var BYTE_LENGTH = 'byteLength'; -var BYTE_OFFSET = 'byteOffset'; -var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; -var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; -var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; - -// IEEE754 conversions based on https://github.com/feross/ieee754 -function packIEEE754(value, mLen, nBytes) { - var buffer = new Array(nBytes); - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; - var i = 0; - var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; - var e, m, c; - value = abs(value); - // eslint-disable-next-line no-self-compare - if (value != value || value === Infinity) { - // eslint-disable-next-line no-self-compare - m = value != value ? 1 : 0; - e = eMax; - } else { - e = floor(log(value) / LN2); - if (value * (c = pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = (value * c - 1) * pow(2, mLen); - e = e + eBias; - } else { - m = value * pow(2, eBias - 1) * pow(2, mLen); - e = 0; - } - } - for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); - e = e << mLen | m; - eLen += mLen; - for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); - buffer[--i] |= s * 128; - return buffer; -} -function unpackIEEE754(buffer, mLen, nBytes) { - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var nBits = eLen - 7; - var i = nBytes - 1; - var s = buffer[i--]; - var e = s & 127; - var m; - s >>= 7; - for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); - m = e & (1 << -nBits) - 1; - e >>= -nBits; - nBits += mLen; - for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : s ? -Infinity : Infinity; - } else { - m = m + pow(2, mLen); - e = e - eBias; - } return (s ? -1 : 1) * m * pow(2, e - mLen); -} - -function unpackI32(bytes) { - return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; -} -function packI8(it) { - return [it & 0xff]; -} -function packI16(it) { - return [it & 0xff, it >> 8 & 0xff]; -} -function packI32(it) { - return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; -} -function packF64(it) { - return packIEEE754(it, 52, 8); -} -function packF32(it) { - return packIEEE754(it, 23, 4); -} - -function addGetter(C, key, internal) { - dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } }); -} - -function get(view, bytes, index, isLittleEndian) { - var numIndex = +index; - var intIndex = toIndex(numIndex); - if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); - var store = view[$BUFFER]._b; - var start = intIndex + view[$OFFSET]; - var pack = store.slice(start, start + bytes); - return isLittleEndian ? pack : pack.reverse(); -} -function set(view, bytes, index, conversion, value, isLittleEndian) { - var numIndex = +index; - var intIndex = toIndex(numIndex); - if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); - var store = view[$BUFFER]._b; - var start = intIndex + view[$OFFSET]; - var pack = conversion(+value); - for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; -} - -if (!$typed.ABV) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer, ARRAY_BUFFER); - var byteLength = toIndex(length); - this._b = arrayFill.call(new Array(byteLength), 0); - this[$LENGTH] = byteLength; - }; - - $DataView = function DataView(buffer, byteOffset, byteLength) { - anInstance(this, $DataView, DATA_VIEW); - anInstance(buffer, $ArrayBuffer, DATA_VIEW); - var bufferLength = buffer[$LENGTH]; - var offset = toInteger(byteOffset); - if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); - byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); - if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); - this[$BUFFER] = buffer; - this[$OFFSET] = offset; - this[$LENGTH] = byteLength; - }; - - if (DESCRIPTORS) { - addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); - addGetter($DataView, BUFFER, '_b'); - addGetter($DataView, BYTE_LENGTH, '_l'); - addGetter($DataView, BYTE_OFFSET, '_o'); - } - - redefineAll($DataView[PROTOTYPE], { - getInt8: function getInt8(byteOffset) { - return get(this, 1, byteOffset)[0] << 24 >> 24; - }, - getUint8: function getUint8(byteOffset) { - return get(this, 1, byteOffset)[0]; - }, - getInt16: function getInt16(byteOffset /* , littleEndian */) { - var bytes = get(this, 2, byteOffset, arguments[1]); - return (bytes[1] << 8 | bytes[0]) << 16 >> 16; - }, - getUint16: function getUint16(byteOffset /* , littleEndian */) { - var bytes = get(this, 2, byteOffset, arguments[1]); - return bytes[1] << 8 | bytes[0]; - }, - getInt32: function getInt32(byteOffset /* , littleEndian */) { - return unpackI32(get(this, 4, byteOffset, arguments[1])); - }, - getUint32: function getUint32(byteOffset /* , littleEndian */) { - return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; - }, - getFloat32: function getFloat32(byteOffset /* , littleEndian */) { - return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); - }, - getFloat64: function getFloat64(byteOffset /* , littleEndian */) { - return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); - }, - setInt8: function setInt8(byteOffset, value) { - set(this, 1, byteOffset, packI8, value); - }, - setUint8: function setUint8(byteOffset, value) { - set(this, 1, byteOffset, packI8, value); - }, - setInt16: function setInt16(byteOffset, value /* , littleEndian */) { - set(this, 2, byteOffset, packI16, value, arguments[2]); - }, - setUint16: function setUint16(byteOffset, value /* , littleEndian */) { - set(this, 2, byteOffset, packI16, value, arguments[2]); - }, - setInt32: function setInt32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packI32, value, arguments[2]); - }, - setUint32: function setUint32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packI32, value, arguments[2]); - }, - setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packF32, value, arguments[2]); - }, - setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { - set(this, 8, byteOffset, packF64, value, arguments[2]); - } - }); -} else { - if (!fails(function () { - $ArrayBuffer(1); - }) || !fails(function () { - new $ArrayBuffer(-1); // eslint-disable-line no-new - }) || fails(function () { - new $ArrayBuffer(); // eslint-disable-line no-new - new $ArrayBuffer(1.5); // eslint-disable-line no-new - new $ArrayBuffer(NaN); // eslint-disable-line no-new - return $ArrayBuffer.name != ARRAY_BUFFER; - })) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer); - return new BaseBuffer(toIndex(length)); - }; - var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; - for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { - if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); - } - if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; - } - // iOS Safari 7.x bug - var view = new $DataView(new $ArrayBuffer(2)); - var $setInt8 = $DataView[PROTOTYPE].setInt8; - view.setInt8(0, 2147483648); - view.setInt8(1, 2147483649); - if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { - setInt8: function setInt8(byteOffset, value) { - $setInt8.call(this, byteOffset, value << 24 >> 24); - }, - setUint8: function setUint8(byteOffset, value) { - $setInt8.call(this, byteOffset, value << 24 >> 24); - } - }, true); -} -setToStringTag($ArrayBuffer, ARRAY_BUFFER); -setToStringTag($DataView, DATA_VIEW); -hide($DataView[PROTOTYPE], $typed.VIEW, true); -exports[ARRAY_BUFFER] = $ArrayBuffer; -exports[DATA_VIEW] = $DataView; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_typed.js": -/*!************************************************!*\ - !*** ./node_modules/core-js/modules/_typed.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_272754__) { - -var global = __nested_webpack_require_272754__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var hide = __nested_webpack_require_272754__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); -var uid = __nested_webpack_require_272754__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js"); -var TYPED = uid('typed_array'); -var VIEW = uid('view'); -var ABV = !!(global.ArrayBuffer && global.DataView); -var CONSTR = ABV; -var i = 0; -var l = 9; -var Typed; - -var TypedArrayConstructors = ( - 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' -).split(','); - -while (i < l) { - if (Typed = global[TypedArrayConstructors[i++]]) { - hide(Typed.prototype, TYPED, true); - hide(Typed.prototype, VIEW, true); - } else CONSTR = false; -} - -module.exports = { - ABV: ABV, - CONSTR: CONSTR, - TYPED: TYPED, - VIEW: VIEW -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_uid.js": -/*!**********************************************!*\ - !*** ./node_modules/core-js/modules/_uid.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -var id = 0; -var px = Math.random(); -module.exports = function (key) { - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_user-agent.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_user-agent.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_274383__) { - -var global = __nested_webpack_require_274383__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var navigator = global.navigator; - -module.exports = navigator && navigator.userAgent || ''; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_validate-collection.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/_validate-collection.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_274939__) { - -var isObject = __nested_webpack_require_274939__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -module.exports = function (it, TYPE) { - if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); - return it; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_wks-define.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/_wks-define.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_275535__) { - -var global = __nested_webpack_require_275535__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var core = __nested_webpack_require_275535__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); -var LIBRARY = __nested_webpack_require_275535__(/*! ./_library */ "./node_modules/core-js/modules/_library.js"); -var wksExt = __nested_webpack_require_275535__(/*! ./_wks-ext */ "./node_modules/core-js/modules/_wks-ext.js"); -var defineProperty = __nested_webpack_require_275535__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; -module.exports = function (name) { - var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); - if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_wks-ext.js": -/*!**************************************************!*\ - !*** ./node_modules/core-js/modules/_wks-ext.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_276580__) { - -exports.f = __nested_webpack_require_276580__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js"); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/_wks.js": -/*!**********************************************!*\ - !*** ./node_modules/core-js/modules/_wks.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_276973__) { - -var store = __nested_webpack_require_276973__(/*! ./_shared */ "./node_modules/core-js/modules/_shared.js")('wks'); -var uid = __nested_webpack_require_276973__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js"); -var Symbol = __nested_webpack_require_276973__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").Symbol; -var USE_SYMBOL = typeof Symbol == 'function'; - -var $exports = module.exports = function (name) { - return store[name] || (store[name] = - USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); -}; - -$exports.store = store; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/core.get-iterator-method.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js/modules/core.get-iterator-method.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_277895__) { - -var classof = __nested_webpack_require_277895__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); -var ITERATOR = __nested_webpack_require_277895__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'); -var Iterators = __nested_webpack_require_277895__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); -module.exports = __nested_webpack_require_277895__(/*! ./_core */ "./node_modules/core-js/modules/_core.js").getIteratorMethod = function (it) { - if (it != undefined) return it[ITERATOR] - || it['@@iterator'] - || Iterators[classof(it)]; -}; - - -/***/ }), - -/***/ "./node_modules/core-js/modules/core.regexp.escape.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/core.regexp.escape.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_278795__) { - -// https://github.com/benjamingr/RexExp.escape -var $export = __nested_webpack_require_278795__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $re = __nested_webpack_require_278795__(/*! ./_replacer */ "./node_modules/core-js/modules/_replacer.js")(/[\\^$*+?.()|[\]{}]/g, '\\$&'); - -$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.copy-within.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.copy-within.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_279523__) { - -// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) -var $export = __nested_webpack_require_279523__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.P, 'Array', { copyWithin: __nested_webpack_require_279523__(/*! ./_array-copy-within */ "./node_modules/core-js/modules/_array-copy-within.js") }); - -__nested_webpack_require_279523__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")('copyWithin'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.every.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.every.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_280314__) { - -"use strict"; - -var $export = __nested_webpack_require_280314__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $every = __nested_webpack_require_280314__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(4); - -$export($export.P + $export.F * !__nested_webpack_require_280314__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].every, true), 'Array', { - // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) - every: function every(callbackfn /* , thisArg */) { - return $every(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.fill.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.fill.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_281226__) { - -// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) -var $export = __nested_webpack_require_281226__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.P, 'Array', { fill: __nested_webpack_require_281226__(/*! ./_array-fill */ "./node_modules/core-js/modules/_array-fill.js") }); - -__nested_webpack_require_281226__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")('fill'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.filter.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.filter.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_281992__) { - -"use strict"; - -var $export = __nested_webpack_require_281992__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $filter = __nested_webpack_require_281992__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(2); - -$export($export.P + $export.F * !__nested_webpack_require_281992__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].filter, true), 'Array', { - // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) - filter: function filter(callbackfn /* , thisArg */) { - return $filter(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.find-index.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.find-index.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_282934__) { - -"use strict"; - -// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) -var $export = __nested_webpack_require_282934__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $find = __nested_webpack_require_282934__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(6); -var KEY = 'findIndex'; -var forced = true; -// Shouldn't skip holes -if (KEY in []) Array(1)[KEY](function () { forced = false; }); -$export($export.P + $export.F * forced, 'Array', { - findIndex: function findIndex(callbackfn /* , that = undefined */) { - return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } -}); -__nested_webpack_require_282934__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")(KEY); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.find.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.find.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_284028__) { - -"use strict"; - -// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) -var $export = __nested_webpack_require_284028__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $find = __nested_webpack_require_284028__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(5); -var KEY = 'find'; -var forced = true; -// Shouldn't skip holes -if (KEY in []) Array(1)[KEY](function () { forced = false; }); -$export($export.P + $export.F * forced, 'Array', { - find: function find(callbackfn /* , that = undefined */) { - return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } -}); -__nested_webpack_require_284028__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")(KEY); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.for-each.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.for-each.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_285118__) { - -"use strict"; - -var $export = __nested_webpack_require_285118__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $forEach = __nested_webpack_require_285118__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(0); -var STRICT = __nested_webpack_require_285118__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].forEach, true); - -$export($export.P + $export.F * !STRICT, 'Array', { - // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) - forEach: function forEach(callbackfn /* , thisArg */) { - return $forEach(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.from.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.from.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_286064__) { - -"use strict"; - -var ctx = __nested_webpack_require_286064__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); -var $export = __nested_webpack_require_286064__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var toObject = __nested_webpack_require_286064__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); -var call = __nested_webpack_require_286064__(/*! ./_iter-call */ "./node_modules/core-js/modules/_iter-call.js"); -var isArrayIter = __nested_webpack_require_286064__(/*! ./_is-array-iter */ "./node_modules/core-js/modules/_is-array-iter.js"); -var toLength = __nested_webpack_require_286064__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -var createProperty = __nested_webpack_require_286064__(/*! ./_create-property */ "./node_modules/core-js/modules/_create-property.js"); -var getIterFn = __nested_webpack_require_286064__(/*! ./core.get-iterator-method */ "./node_modules/core-js/modules/core.get-iterator-method.js"); - -$export($export.S + $export.F * !__nested_webpack_require_286064__(/*! ./_iter-detect */ "./node_modules/core-js/modules/_iter-detect.js")(function (iter) { Array.from(iter); }), 'Array', { - // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) - from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { - var O = toObject(arrayLike); - var C = typeof this == 'function' ? this : Array; - var aLen = arguments.length; - var mapfn = aLen > 1 ? arguments[1] : undefined; - var mapping = mapfn !== undefined; - var index = 0; - var iterFn = getIterFn(O); - var length, result, step, iterator; - if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); - // if object isn't iterable or it's array with default iterator - use simple case - if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) { - for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { - createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); - } - } else { - length = toLength(O.length); - for (result = new C(length); length > index; index++) { - createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); - } - } - result.length = index; - return result; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.index-of.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.index-of.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_288653__) { - -"use strict"; - -var $export = __nested_webpack_require_288653__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $indexOf = __nested_webpack_require_288653__(/*! ./_array-includes */ "./node_modules/core-js/modules/_array-includes.js")(false); -var $native = [].indexOf; -var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; - -$export($export.P + $export.F * (NEGATIVE_ZERO || !__nested_webpack_require_288653__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")($native)), 'Array', { - // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) - indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { - return NEGATIVE_ZERO - // convert -0 to +0 - ? $native.apply(this, arguments) || 0 - : $indexOf(this, searchElement, arguments[1]); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.is-array.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.is-array.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_289806__) { - -// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) -var $export = __nested_webpack_require_289806__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Array', { isArray: __nested_webpack_require_289806__(/*! ./_is-array */ "./node_modules/core-js/modules/_is-array.js") }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.iterator.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.iterator.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_290435__) { - -"use strict"; - -var addToUnscopables = __nested_webpack_require_290435__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js"); -var step = __nested_webpack_require_290435__(/*! ./_iter-step */ "./node_modules/core-js/modules/_iter-step.js"); -var Iterators = __nested_webpack_require_290435__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); -var toIObject = __nested_webpack_require_290435__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); - -// 22.1.3.4 Array.prototype.entries() -// 22.1.3.13 Array.prototype.keys() -// 22.1.3.29 Array.prototype.values() -// 22.1.3.30 Array.prototype[@@iterator]() -module.exports = __nested_webpack_require_290435__(/*! ./_iter-define */ "./node_modules/core-js/modules/_iter-define.js")(Array, 'Array', function (iterated, kind) { - this._t = toIObject(iterated); // target - this._i = 0; // next index - this._k = kind; // kind -// 22.1.5.2.1 %ArrayIteratorPrototype%.next() -}, function () { - var O = this._t; - var kind = this._k; - var index = this._i++; - if (!O || index >= O.length) { - this._t = undefined; - return step(1); - } - if (kind == 'keys') return step(0, index); - if (kind == 'values') return step(0, O[index]); - return step(0, [index, O[index]]); -}, 'values'); - -// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) -Iterators.Arguments = Iterators.Array; - -addToUnscopables('keys'); -addToUnscopables('values'); -addToUnscopables('entries'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.join.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.join.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_292228__) { - -"use strict"; - -// 22.1.3.13 Array.prototype.join(separator) -var $export = __nested_webpack_require_292228__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var toIObject = __nested_webpack_require_292228__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); -var arrayJoin = [].join; - -// fallback for not array-like strings -$export($export.P + $export.F * (__nested_webpack_require_292228__(/*! ./_iobject */ "./node_modules/core-js/modules/_iobject.js") != Object || !__nested_webpack_require_292228__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")(arrayJoin)), 'Array', { - join: function join(separator) { - return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.last-index-of.js": -/*!*****************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.last-index-of.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_293318__) { - -"use strict"; - -var $export = __nested_webpack_require_293318__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var toIObject = __nested_webpack_require_293318__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); -var toInteger = __nested_webpack_require_293318__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); -var toLength = __nested_webpack_require_293318__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -var $native = [].lastIndexOf; -var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; - -$export($export.P + $export.F * (NEGATIVE_ZERO || !__nested_webpack_require_293318__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")($native)), 'Array', { - // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) - lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { - // convert -0 to +0 - if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0; - var O = toIObject(this); - var length = toLength(O.length); - var index = length - 1; - if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1])); - if (index < 0) index = length + index; - for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0; - return -1; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.map.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.map.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_294946__) { - -"use strict"; - -var $export = __nested_webpack_require_294946__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $map = __nested_webpack_require_294946__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(1); - -$export($export.P + $export.F * !__nested_webpack_require_294946__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].map, true), 'Array', { - // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) - map: function map(callbackfn /* , thisArg */) { - return $map(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.of.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.of.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_295839__) { - -"use strict"; - -var $export = __nested_webpack_require_295839__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var createProperty = __nested_webpack_require_295839__(/*! ./_create-property */ "./node_modules/core-js/modules/_create-property.js"); - -// WebKit Array.of isn't generic -$export($export.S + $export.F * __nested_webpack_require_295839__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { - function F() { /* empty */ } - return !(Array.of.call(F) instanceof F); -}), 'Array', { - // 22.1.2.3 Array.of( ...items) - of: function of(/* ...args */) { - var index = 0; - var aLen = arguments.length; - var result = new (typeof this == 'function' ? this : Array)(aLen); - while (aLen > index) createProperty(result, index, arguments[index++]); - result.length = aLen; - return result; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.reduce-right.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.reduce-right.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_297019__) { - -"use strict"; - -var $export = __nested_webpack_require_297019__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $reduce = __nested_webpack_require_297019__(/*! ./_array-reduce */ "./node_modules/core-js/modules/_array-reduce.js"); - -$export($export.P + $export.F * !__nested_webpack_require_297019__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].reduceRight, true), 'Array', { - // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) - reduceRight: function reduceRight(callbackfn /* , initialValue */) { - return $reduce(this, callbackfn, arguments.length, arguments[1], true); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.reduce.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.reduce.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_297995__) { - -"use strict"; - -var $export = __nested_webpack_require_297995__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $reduce = __nested_webpack_require_297995__(/*! ./_array-reduce */ "./node_modules/core-js/modules/_array-reduce.js"); - -$export($export.P + $export.F * !__nested_webpack_require_297995__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].reduce, true), 'Array', { - // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) - reduce: function reduce(callbackfn /* , initialValue */) { - return $reduce(this, callbackfn, arguments.length, arguments[1], false); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.slice.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.slice.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_298948__) { - -"use strict"; - -var $export = __nested_webpack_require_298948__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var html = __nested_webpack_require_298948__(/*! ./_html */ "./node_modules/core-js/modules/_html.js"); -var cof = __nested_webpack_require_298948__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); -var toAbsoluteIndex = __nested_webpack_require_298948__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); -var toLength = __nested_webpack_require_298948__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -var arraySlice = [].slice; - -// fallback for not array-like ES3 strings and DOM objects -$export($export.P + $export.F * __nested_webpack_require_298948__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { - if (html) arraySlice.call(html); -}), 'Array', { - slice: function slice(begin, end) { - var len = toLength(this.length); - var klass = cof(this); - end = end === undefined ? len : end; - if (klass == 'Array') return arraySlice.call(this, begin, end); - var start = toAbsoluteIndex(begin, len); - var upTo = toAbsoluteIndex(end, len); - var size = toLength(upTo - start); - var cloned = new Array(size); - var i = 0; - for (; i < size; i++) cloned[i] = klass == 'String' - ? this.charAt(start + i) - : this[start + i]; - return cloned; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.some.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.some.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_300600__) { - -"use strict"; - -var $export = __nested_webpack_require_300600__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $some = __nested_webpack_require_300600__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(3); - -$export($export.P + $export.F * !__nested_webpack_require_300600__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].some, true), 'Array', { - // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) - some: function some(callbackfn /* , thisArg */) { - return $some(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.sort.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.sort.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_301507__) { - -"use strict"; - -var $export = __nested_webpack_require_301507__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var aFunction = __nested_webpack_require_301507__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); -var toObject = __nested_webpack_require_301507__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); -var fails = __nested_webpack_require_301507__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); -var $sort = [].sort; -var test = [1, 2, 3]; - -$export($export.P + $export.F * (fails(function () { - // IE8- - test.sort(undefined); -}) || !fails(function () { - // V8 bug - test.sort(null); - // Old WebKit -}) || !__nested_webpack_require_301507__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")($sort)), 'Array', { - // 22.1.3.25 Array.prototype.sort(comparefn) - sort: function sort(comparefn) { - return comparefn === undefined - ? $sort.call(toObject(this)) - : $sort.call(toObject(this), aFunction(comparefn)); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.array.species.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.array.species.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_302825__) { - -__nested_webpack_require_302825__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js")('Array'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.date.now.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/es6.date.now.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_303263__) { - -// 20.3.3.1 / 15.9.4.4 Date.now() -var $export = __nested_webpack_require_303263__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.date.to-iso-string.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.date.to-iso-string.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_303854__) { - -// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() -var $export = __nested_webpack_require_303854__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var toISOString = __nested_webpack_require_303854__(/*! ./_date-to-iso-string */ "./node_modules/core-js/modules/_date-to-iso-string.js"); - -// PhantomJS / old WebKit has a broken implementations -$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { - toISOString: toISOString -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.date.to-json.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.date.to-json.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_304657__) { - -"use strict"; - -var $export = __nested_webpack_require_304657__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var toObject = __nested_webpack_require_304657__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); -var toPrimitive = __nested_webpack_require_304657__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); - -$export($export.P + $export.F * __nested_webpack_require_304657__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { - return new Date(NaN).toJSON() !== null - || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; -}), 'Date', { - // eslint-disable-next-line no-unused-vars - toJSON: function toJSON(key) { - var O = toObject(this); - var pv = toPrimitive(O); - return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.date.to-primitive.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.date.to-primitive.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_305844__) { - -var TO_PRIMITIVE = __nested_webpack_require_305844__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('toPrimitive'); -var proto = Date.prototype; - -if (!(TO_PRIMITIVE in proto)) __nested_webpack_require_305844__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js")(proto, TO_PRIMITIVE, __nested_webpack_require_305844__(/*! ./_date-to-primitive */ "./node_modules/core-js/modules/_date-to-primitive.js")); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.date.to-string.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.date.to-string.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_306579__) { - -var DateProto = Date.prototype; -var INVALID_DATE = 'Invalid Date'; -var TO_STRING = 'toString'; -var $toString = DateProto[TO_STRING]; -var getTime = DateProto.getTime; -if (new Date(NaN) + '' != INVALID_DATE) { - __nested_webpack_require_306579__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js")(DateProto, TO_STRING, function toString() { - var value = getTime.call(this); - // eslint-disable-next-line no-self-compare - return value === value ? $toString.call(this) : INVALID_DATE; - }); -} - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.function.bind.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.function.bind.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_307433__) { - -// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) -var $export = __nested_webpack_require_307433__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.P, 'Function', { bind: __nested_webpack_require_307433__(/*! ./_bind */ "./node_modules/core-js/modules/_bind.js") }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.function.has-instance.js": -/*!*******************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.function.has-instance.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_308105__) { - -"use strict"; - -var isObject = __nested_webpack_require_308105__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var getPrototypeOf = __nested_webpack_require_308105__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); -var HAS_INSTANCE = __nested_webpack_require_308105__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('hasInstance'); -var FunctionProto = Function.prototype; -// 19.2.3.6 Function.prototype[@@hasInstance](V) -if (!(HAS_INSTANCE in FunctionProto)) __nested_webpack_require_308105__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f(FunctionProto, HAS_INSTANCE, { value: function (O) { - if (typeof this != 'function' || !isObject(O)) return false; - if (!isObject(this.prototype)) return O instanceof this; - // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: - while (O = getPrototypeOf(O)) if (this.prototype === O) return true; - return false; -} }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.function.name.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.function.name.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_309377__) { - -var dP = __nested_webpack_require_309377__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; -var FProto = Function.prototype; -var nameRE = /^\s*function ([^ (]*)/; -var NAME = 'name'; - -// 19.2.4.2 name -NAME in FProto || __nested_webpack_require_309377__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && dP(FProto, NAME, { - configurable: true, - get: function () { - try { - return ('' + this).match(nameRE)[1]; - } catch (e) { - return ''; - } - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.map.js": -/*!*************************************************!*\ - !*** ./node_modules/core-js/modules/es6.map.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_310178__) { - -"use strict"; - -var strong = __nested_webpack_require_310178__(/*! ./_collection-strong */ "./node_modules/core-js/modules/_collection-strong.js"); -var validate = __nested_webpack_require_310178__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); -var MAP = 'Map'; - -// 23.1 Map Objects -module.exports = __nested_webpack_require_310178__(/*! ./_collection */ "./node_modules/core-js/modules/_collection.js")(MAP, function (get) { - return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; -}, { - // 23.1.3.6 Map.prototype.get(key) - get: function get(key) { - var entry = strong.getEntry(validate(this, MAP), key); - return entry && entry.v; - }, - // 23.1.3.9 Map.prototype.set(key, value) - set: function set(key, value) { - return strong.def(validate(this, MAP), key === 0 ? 0 : key, value); - } -}, strong, true); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.math.acosh.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.math.acosh.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_311376__) { - -// 20.2.2.3 Math.acosh(x) -var $export = __nested_webpack_require_311376__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var log1p = __nested_webpack_require_311376__(/*! ./_math-log1p */ "./node_modules/core-js/modules/_math-log1p.js"); -var sqrt = Math.sqrt; -var $acosh = Math.acosh; - -$export($export.S + $export.F * !($acosh - // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 - && Math.floor($acosh(Number.MAX_VALUE)) == 710 - // Tor Browser bug: Math.acosh(Infinity) -> NaN - && $acosh(Infinity) == Infinity -), 'Math', { - acosh: function acosh(x) { - return (x = +x) < 1 ? NaN : x > 94906265.62425156 - ? Math.log(x) + Math.LN2 - : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.math.asinh.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.math.asinh.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_312417__) { - -// 20.2.2.5 Math.asinh(x) -var $export = __nested_webpack_require_312417__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $asinh = Math.asinh; - -function asinh(x) { - return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); -} - -// Tor Browser bug: Math.asinh(0) -> -0 -$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.math.atanh.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.math.atanh.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_313164__) { - -// 20.2.2.7 Math.atanh(x) -var $export = __nested_webpack_require_313164__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $atanh = Math.atanh; - -// Tor Browser bug: Math.atanh(-0) -> 0 -$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { - atanh: function atanh(x) { - return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.math.cbrt.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/modules/es6.math.cbrt.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_313869__) { - -// 20.2.2.9 Math.cbrt(x) -var $export = __nested_webpack_require_313869__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var sign = __nested_webpack_require_313869__(/*! ./_math-sign */ "./node_modules/core-js/modules/_math-sign.js"); - -$export($export.S, 'Math', { - cbrt: function cbrt(x) { - return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.math.clz32.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.math.clz32.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_314556__) { - -// 20.2.2.11 Math.clz32(x) -var $export = __nested_webpack_require_314556__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Math', { - clz32: function clz32(x) { - return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.math.cosh.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/modules/es6.math.cosh.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_315165__) { - -// 20.2.2.12 Math.cosh(x) -var $export = __nested_webpack_require_315165__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var exp = Math.exp; - -$export($export.S, 'Math', { - cosh: function cosh(x) { - return (exp(x = +x) + exp(-x)) / 2; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.math.expm1.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.math.expm1.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_315757__) { - -// 20.2.2.14 Math.expm1(x) -var $export = __nested_webpack_require_315757__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $expm1 = __nested_webpack_require_315757__(/*! ./_math-expm1 */ "./node_modules/core-js/modules/_math-expm1.js"); - -$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.math.fround.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.math.fround.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_316418__) { - -// 20.2.2.16 Math.fround(x) -var $export = __nested_webpack_require_316418__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Math', { fround: __nested_webpack_require_316418__(/*! ./_math-fround */ "./node_modules/core-js/modules/_math-fround.js") }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.math.hypot.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.math.hypot.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_317021__) { - -// 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) -var $export = __nested_webpack_require_317021__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var abs = Math.abs; - -$export($export.S, 'Math', { - hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars - var sum = 0; - var i = 0; - var aLen = arguments.length; - var larg = 0; - var arg, div; - while (i < aLen) { - arg = abs(arguments[i++]); - if (larg < arg) { - div = larg / arg; - sum = sum * div * div + 1; - larg = arg; - } else if (arg > 0) { - div = arg / larg; - sum += div * div; - } else sum += arg; - } - return larg === Infinity ? Infinity : larg * Math.sqrt(sum); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.math.imul.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/modules/es6.math.imul.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_318084__) { - -// 20.2.2.18 Math.imul(x, y) -var $export = __nested_webpack_require_318084__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $imul = Math.imul; - -// some WebKit versions fails with big numbers, some has wrong arity -$export($export.S + $export.F * __nested_webpack_require_318084__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { - return $imul(0xffffffff, 5) != -5 || $imul.length != 2; -}), 'Math', { - imul: function imul(x, y) { - var UINT16 = 0xffff; - var xn = +x; - var yn = +y; - var xl = UINT16 & xn; - var yl = UINT16 & yn; - return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.math.log10.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.math.log10.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_319088__) { - -// 20.2.2.21 Math.log10(x) -var $export = __nested_webpack_require_319088__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Math', { - log10: function log10(x) { - return Math.log(x) * Math.LOG10E; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.math.log1p.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.math.log1p.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_319661__) { - -// 20.2.2.20 Math.log1p(x) -var $export = __nested_webpack_require_319661__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Math', { log1p: __nested_webpack_require_319661__(/*! ./_math-log1p */ "./node_modules/core-js/modules/_math-log1p.js") }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.math.log2.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/modules/es6.math.log2.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_320256__) { - -// 20.2.2.22 Math.log2(x) -var $export = __nested_webpack_require_320256__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Math', { - log2: function log2(x) { - return Math.log(x) / Math.LN2; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.math.sign.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/modules/es6.math.sign.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_320819__) { - -// 20.2.2.28 Math.sign(x) -var $export = __nested_webpack_require_320819__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Math', { sign: __nested_webpack_require_320819__(/*! ./_math-sign */ "./node_modules/core-js/modules/_math-sign.js") }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.math.sinh.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/modules/es6.math.sinh.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_321410__) { - -// 20.2.2.30 Math.sinh(x) -var $export = __nested_webpack_require_321410__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var expm1 = __nested_webpack_require_321410__(/*! ./_math-expm1 */ "./node_modules/core-js/modules/_math-expm1.js"); -var exp = Math.exp; - -// V8 near Chromium 38 has a problem with very small numbers -$export($export.S + $export.F * __nested_webpack_require_321410__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { - return !Math.sinh(-2e-17) != -2e-17; -}), 'Math', { - sinh: function sinh(x) { - return Math.abs(x = +x) < 1 - ? (expm1(x) - expm1(-x)) / 2 - : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.math.tanh.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/modules/es6.math.tanh.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_322390__) { - -// 20.2.2.33 Math.tanh(x) -var $export = __nested_webpack_require_322390__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var expm1 = __nested_webpack_require_322390__(/*! ./_math-expm1 */ "./node_modules/core-js/modules/_math-expm1.js"); -var exp = Math.exp; - -$export($export.S, 'Math', { - tanh: function tanh(x) { - var a = expm1(x = +x); - var b = expm1(-x); - return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.math.trunc.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.math.trunc.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_323177__) { - -// 20.2.2.34 Math.trunc(x) -var $export = __nested_webpack_require_323177__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Math', { - trunc: function trunc(it) { - return (it > 0 ? Math.floor : Math.ceil)(it); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.number.constructor.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.number.constructor.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_323795__) { - -"use strict"; - -var global = __nested_webpack_require_323795__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var has = __nested_webpack_require_323795__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); -var cof = __nested_webpack_require_323795__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); -var inheritIfRequired = __nested_webpack_require_323795__(/*! ./_inherit-if-required */ "./node_modules/core-js/modules/_inherit-if-required.js"); -var toPrimitive = __nested_webpack_require_323795__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); -var fails = __nested_webpack_require_323795__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); -var gOPN = __nested_webpack_require_323795__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f; -var gOPD = __nested_webpack_require_323795__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js").f; -var dP = __nested_webpack_require_323795__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; -var $trim = __nested_webpack_require_323795__(/*! ./_string-trim */ "./node_modules/core-js/modules/_string-trim.js").trim; -var NUMBER = 'Number'; -var $Number = global[NUMBER]; -var Base = $Number; -var proto = $Number.prototype; -// Opera ~12 has broken Object#toString -var BROKEN_COF = cof(__nested_webpack_require_323795__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js")(proto)) == NUMBER; -var TRIM = 'trim' in String.prototype; - -// 7.1.3 ToNumber(argument) -var toNumber = function (argument) { - var it = toPrimitive(argument, false); - if (typeof it == 'string' && it.length > 2) { - it = TRIM ? it.trim() : $trim(it, 3); - var first = it.charCodeAt(0); - var third, radix, maxCode; - if (first === 43 || first === 45) { - third = it.charCodeAt(2); - if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix - } else if (first === 48) { - switch (it.charCodeAt(1)) { - case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i - case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i - default: return +it; - } - for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) { - code = digits.charCodeAt(i); - // parseInt parses a string to a first unavailable symbol - // but ToNumber should return NaN if a string contains unavailable symbols - if (code < 48 || code > maxCode) return NaN; - } return parseInt(digits, radix); - } - } return +it; -}; - -if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) { - $Number = function Number(value) { - var it = arguments.length < 1 ? 0 : value; - var that = this; - return that instanceof $Number - // check on 1..constructor(foo) case - && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER) - ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); - }; - for (var keys = __nested_webpack_require_323795__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") ? gOPN(Base) : ( - // ES3: - 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + - // ES6 (in case, if modules with ES6 Number statics required before): - 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + - 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' - ).split(','), j = 0, key; keys.length > j; j++) { - if (has(Base, key = keys[j]) && !has($Number, key)) { - dP($Number, key, gOPD(Base, key)); - } - } - $Number.prototype = proto; - proto.constructor = $Number; - __nested_webpack_require_323795__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js")(global, NUMBER, $Number); -} - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.number.epsilon.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.number.epsilon.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_327786__) { - -// 20.1.2.1 Number.EPSILON -var $export = __nested_webpack_require_327786__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.number.is-finite.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.number.is-finite.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_328340__) { - -// 20.1.2.2 Number.isFinite(number) -var $export = __nested_webpack_require_328340__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var _isFinite = __nested_webpack_require_328340__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").isFinite; - -$export($export.S, 'Number', { - isFinite: function isFinite(it) { - return typeof it == 'number' && _isFinite(it); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.number.is-integer.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.number.is-integer.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_329080__) { - -// 20.1.2.3 Number.isInteger(number) -var $export = __nested_webpack_require_329080__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Number', { isInteger: __nested_webpack_require_329080__(/*! ./_is-integer */ "./node_modules/core-js/modules/_is-integer.js") }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.number.is-nan.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.number.is-nan.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_329707__) { - -// 20.1.2.4 Number.isNaN(number) -var $export = __nested_webpack_require_329707__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Number', { - isNaN: function isNaN(number) { - // eslint-disable-next-line no-self-compare - return number != number; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.number.is-safe-integer.js": -/*!********************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.number.is-safe-integer.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_330380__) { - -// 20.1.2.5 Number.isSafeInteger(number) -var $export = __nested_webpack_require_330380__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var isInteger = __nested_webpack_require_330380__(/*! ./_is-integer */ "./node_modules/core-js/modules/_is-integer.js"); -var abs = Math.abs; - -$export($export.S, 'Number', { - isSafeInteger: function isSafeInteger(number) { - return isInteger(number) && abs(number) <= 0x1fffffffffffff; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.number.max-safe-integer.js": -/*!*********************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.number.max-safe-integer.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_331196__) { - -// 20.1.2.6 Number.MAX_SAFE_INTEGER -var $export = __nested_webpack_require_331196__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.number.min-safe-integer.js": -/*!*********************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.number.min-safe-integer.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_331796__) { - -// 20.1.2.10 Number.MIN_SAFE_INTEGER -var $export = __nested_webpack_require_331796__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.number.parse-float.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.number.parse-float.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_332378__) { - -var $export = __nested_webpack_require_332378__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $parseFloat = __nested_webpack_require_332378__(/*! ./_parse-float */ "./node_modules/core-js/modules/_parse-float.js"); -// 20.1.2.12 Number.parseFloat(string) -$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.number.parse-int.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.number.parse-int.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_333101__) { - -var $export = __nested_webpack_require_333101__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $parseInt = __nested_webpack_require_333101__(/*! ./_parse-int */ "./node_modules/core-js/modules/_parse-int.js"); -// 20.1.2.13 Number.parseInt(string, radix) -$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.number.to-fixed.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.number.to-fixed.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_333811__) { - -"use strict"; - -var $export = __nested_webpack_require_333811__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var toInteger = __nested_webpack_require_333811__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); -var aNumberValue = __nested_webpack_require_333811__(/*! ./_a-number-value */ "./node_modules/core-js/modules/_a-number-value.js"); -var repeat = __nested_webpack_require_333811__(/*! ./_string-repeat */ "./node_modules/core-js/modules/_string-repeat.js"); -var $toFixed = 1.0.toFixed; -var floor = Math.floor; -var data = [0, 0, 0, 0, 0, 0]; -var ERROR = 'Number.toFixed: incorrect invocation!'; -var ZERO = '0'; - -var multiply = function (n, c) { - var i = -1; - var c2 = c; - while (++i < 6) { - c2 += n * data[i]; - data[i] = c2 % 1e7; - c2 = floor(c2 / 1e7); - } -}; -var divide = function (n) { - var i = 6; - var c = 0; - while (--i >= 0) { - c += data[i]; - data[i] = floor(c / n); - c = (c % n) * 1e7; - } -}; -var numToString = function () { - var i = 6; - var s = ''; - while (--i >= 0) { - if (s !== '' || i === 0 || data[i] !== 0) { - var t = String(data[i]); - s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; - } - } return s; -}; -var pow = function (x, n, acc) { - return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); -}; -var log = function (x) { - var n = 0; - var x2 = x; - while (x2 >= 4096) { - n += 12; - x2 /= 4096; - } - while (x2 >= 2) { - n += 1; - x2 /= 2; - } return n; -}; - -$export($export.P + $export.F * (!!$toFixed && ( - 0.00008.toFixed(3) !== '0.000' || - 0.9.toFixed(0) !== '1' || - 1.255.toFixed(2) !== '1.25' || - 1000000000000000128.0.toFixed(0) !== '1000000000000000128' -) || !__nested_webpack_require_333811__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { - // V8 ~ Android 4.3- - $toFixed.call({}); -})), 'Number', { - toFixed: function toFixed(fractionDigits) { - var x = aNumberValue(this, ERROR); - var f = toInteger(fractionDigits); - var s = ''; - var m = ZERO; - var e, z, j, k; - if (f < 0 || f > 20) throw RangeError(ERROR); - // eslint-disable-next-line no-self-compare - if (x != x) return 'NaN'; - if (x <= -1e21 || x >= 1e21) return String(x); - if (x < 0) { - s = '-'; - x = -x; - } - if (x > 1e-21) { - e = log(x * pow(2, 69, 1)) - 69; - z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); - z *= 0x10000000000000; - e = 52 - e; - if (e > 0) { - multiply(0, z); - j = f; - while (j >= 7) { - multiply(1e7, 0); - j -= 7; - } - multiply(pow(10, j, 1), 0); - j = e - 1; - while (j >= 23) { - divide(1 << 23); - j -= 23; - } - divide(1 << j); - multiply(1, 1); - divide(2); - m = numToString(); - } else { - multiply(0, z); - multiply(1 << -e, 0); - m = numToString() + repeat.call(ZERO, f); - } - } - if (f > 0) { - k = m.length; - m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); - } else { - m = s + m; - } return m; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.number.to-precision.js": -/*!*****************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.number.to-precision.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_337285__) { - -"use strict"; - -var $export = __nested_webpack_require_337285__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $fails = __nested_webpack_require_337285__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); -var aNumberValue = __nested_webpack_require_337285__(/*! ./_a-number-value */ "./node_modules/core-js/modules/_a-number-value.js"); -var $toPrecision = 1.0.toPrecision; - -$export($export.P + $export.F * ($fails(function () { - // IE7- - return $toPrecision.call(1, undefined) !== '1'; -}) || !$fails(function () { - // V8 ~ Android 4.3- - $toPrecision.call({}); -})), 'Number', { - toPrecision: function toPrecision(precision) { - var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); - return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.object.assign.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.object.assign.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_338445__) { - -// 19.1.3.1 Object.assign(target, source) -var $export = __nested_webpack_require_338445__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S + $export.F, 'Object', { assign: __nested_webpack_require_338445__(/*! ./_object-assign */ "./node_modules/core-js/modules/_object-assign.js") }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.object.create.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.object.create.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_339092__) { - -var $export = __nested_webpack_require_339092__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -$export($export.S, 'Object', { create: __nested_webpack_require_339092__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js") }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.object.define-properties.js": -/*!**********************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.object.define-properties.js ***! - \**********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_339783__) { - -var $export = __nested_webpack_require_339783__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) -$export($export.S + $export.F * !__nested_webpack_require_339783__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"), 'Object', { defineProperties: __nested_webpack_require_339783__(/*! ./_object-dps */ "./node_modules/core-js/modules/_object-dps.js") }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.object.define-property.js": -/*!********************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.object.define-property.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_340584__) { - -var $export = __nested_webpack_require_340584__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) -$export($export.S + $export.F * !__nested_webpack_require_340584__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"), 'Object', { defineProperty: __nested_webpack_require_340584__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.object.freeze.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.object.freeze.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_341348__) { - -// 19.1.2.5 Object.freeze(O) -var isObject = __nested_webpack_require_341348__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var meta = __nested_webpack_require_341348__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").onFreeze; - -__nested_webpack_require_341348__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('freeze', function ($freeze) { - return function freeze(it) { - return $freeze && isObject(it) ? $freeze(meta(it)) : it; - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.object.get-own-property-descriptor.js": -/*!********************************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.object.get-own-property-descriptor.js ***! - \********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_342243__) { - -// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) -var toIObject = __nested_webpack_require_342243__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); -var $getOwnPropertyDescriptor = __nested_webpack_require_342243__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js").f; - -__nested_webpack_require_342243__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('getOwnPropertyDescriptor', function () { - return function getOwnPropertyDescriptor(it, key) { - return $getOwnPropertyDescriptor(toIObject(it), key); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.object.get-own-property-names.js": -/*!***************************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.object.get-own-property-names.js ***! - \***************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_343201__) { - -// 19.1.2.7 Object.getOwnPropertyNames(O) -__nested_webpack_require_343201__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('getOwnPropertyNames', function () { - return __nested_webpack_require_343201__(/*! ./_object-gopn-ext */ "./node_modules/core-js/modules/_object-gopn-ext.js").f; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.object.get-prototype-of.js": -/*!*********************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.object.get-prototype-of.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_343882__) { - -// 19.1.2.9 Object.getPrototypeOf(O) -var toObject = __nested_webpack_require_343882__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); -var $getPrototypeOf = __nested_webpack_require_343882__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); - -__nested_webpack_require_343882__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('getPrototypeOf', function () { - return function getPrototypeOf(it) { - return $getPrototypeOf(toObject(it)); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.object.is-extensible.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.object.is-extensible.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_344733__) { - -// 19.1.2.11 Object.isExtensible(O) -var isObject = __nested_webpack_require_344733__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); - -__nested_webpack_require_344733__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('isExtensible', function ($isExtensible) { - return function isExtensible(it) { - return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.object.is-frozen.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.object.is-frozen.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_345497__) { - -// 19.1.2.12 Object.isFrozen(O) -var isObject = __nested_webpack_require_345497__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); - -__nested_webpack_require_345497__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('isFrozen', function ($isFrozen) { - return function isFrozen(it) { - return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.object.is-sealed.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.object.is-sealed.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_346237__) { - -// 19.1.2.13 Object.isSealed(O) -var isObject = __nested_webpack_require_346237__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); - -__nested_webpack_require_346237__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('isSealed', function ($isSealed) { - return function isSealed(it) { - return isObject(it) ? $isSealed ? $isSealed(it) : false : true; - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.object.is.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/modules/es6.object.is.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_346949__) { - -// 19.1.3.10 Object.is(value1, value2) -var $export = __nested_webpack_require_346949__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -$export($export.S, 'Object', { is: __nested_webpack_require_346949__(/*! ./_same-value */ "./node_modules/core-js/modules/_same-value.js") }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.object.keys.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.object.keys.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_347562__) { - -// 19.1.2.14 Object.keys(O) -var toObject = __nested_webpack_require_347562__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); -var $keys = __nested_webpack_require_347562__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); - -__nested_webpack_require_347562__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('keys', function () { - return function keys(it) { - return $keys(toObject(it)); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.object.prevent-extensions.js": -/*!***********************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.object.prevent-extensions.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_348386__) { - -// 19.1.2.15 Object.preventExtensions(O) -var isObject = __nested_webpack_require_348386__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var meta = __nested_webpack_require_348386__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").onFreeze; - -__nested_webpack_require_348386__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('preventExtensions', function ($preventExtensions) { - return function preventExtensions(it) { - return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.object.seal.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.object.seal.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_349256__) { - -// 19.1.2.17 Object.seal(O) -var isObject = __nested_webpack_require_349256__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var meta = __nested_webpack_require_349256__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").onFreeze; - -__nested_webpack_require_349256__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('seal', function ($seal) { - return function seal(it) { - return $seal && isObject(it) ? $seal(meta(it)) : it; - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.object.set-prototype-of.js": -/*!*********************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.object.set-prototype-of.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_350096__) { - -// 19.1.3.19 Object.setPrototypeOf(O, proto) -var $export = __nested_webpack_require_350096__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -$export($export.S, 'Object', { setPrototypeOf: __nested_webpack_require_350096__(/*! ./_set-proto */ "./node_modules/core-js/modules/_set-proto.js").set }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.object.to-string.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.object.to-string.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_350749__) { - -"use strict"; - -// 19.1.3.6 Object.prototype.toString() -var classof = __nested_webpack_require_350749__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); -var test = {}; -test[__nested_webpack_require_350749__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('toStringTag')] = 'z'; -if (test + '' != '[object z]') { - __nested_webpack_require_350749__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js")(Object.prototype, 'toString', function toString() { - return '[object ' + classof(this) + ']'; - }, true); -} - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.parse-float.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.parse-float.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_351602__) { - -var $export = __nested_webpack_require_351602__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $parseFloat = __nested_webpack_require_351602__(/*! ./_parse-float */ "./node_modules/core-js/modules/_parse-float.js"); -// 18.2.4 parseFloat(string) -$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.parse-int.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/modules/es6.parse-int.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_352270__) { - -var $export = __nested_webpack_require_352270__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $parseInt = __nested_webpack_require_352270__(/*! ./_parse-int */ "./node_modules/core-js/modules/_parse-int.js"); -// 18.2.5 parseInt(string, radix) -$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.promise.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/modules/es6.promise.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_352921__) { - -"use strict"; - -var LIBRARY = __nested_webpack_require_352921__(/*! ./_library */ "./node_modules/core-js/modules/_library.js"); -var global = __nested_webpack_require_352921__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var ctx = __nested_webpack_require_352921__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); -var classof = __nested_webpack_require_352921__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); -var $export = __nested_webpack_require_352921__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var isObject = __nested_webpack_require_352921__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var aFunction = __nested_webpack_require_352921__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); -var anInstance = __nested_webpack_require_352921__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); -var forOf = __nested_webpack_require_352921__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); -var speciesConstructor = __nested_webpack_require_352921__(/*! ./_species-constructor */ "./node_modules/core-js/modules/_species-constructor.js"); -var task = __nested_webpack_require_352921__(/*! ./_task */ "./node_modules/core-js/modules/_task.js").set; -var microtask = __nested_webpack_require_352921__(/*! ./_microtask */ "./node_modules/core-js/modules/_microtask.js")(); -var newPromiseCapabilityModule = __nested_webpack_require_352921__(/*! ./_new-promise-capability */ "./node_modules/core-js/modules/_new-promise-capability.js"); -var perform = __nested_webpack_require_352921__(/*! ./_perform */ "./node_modules/core-js/modules/_perform.js"); -var userAgent = __nested_webpack_require_352921__(/*! ./_user-agent */ "./node_modules/core-js/modules/_user-agent.js"); -var promiseResolve = __nested_webpack_require_352921__(/*! ./_promise-resolve */ "./node_modules/core-js/modules/_promise-resolve.js"); -var PROMISE = 'Promise'; -var TypeError = global.TypeError; -var process = global.process; -var versions = process && process.versions; -var v8 = versions && versions.v8 || ''; -var $Promise = global[PROMISE]; -var isNode = classof(process) == 'process'; -var empty = function () { /* empty */ }; -var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; -var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; - -var USE_NATIVE = !!function () { - try { - // correct subclassing with @@species support - var promise = $Promise.resolve(1); - var FakePromise = (promise.constructor = {})[__nested_webpack_require_352921__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('species')] = function (exec) { - exec(empty, empty); - }; - // unhandled rejections tracking support, NodeJS Promise without it fails @@species test - return (isNode || typeof PromiseRejectionEvent == 'function') - && promise.then(empty) instanceof FakePromise - // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables - // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 - // we can't detect it synchronously, so just check versions - && v8.indexOf('6.6') !== 0 - && userAgent.indexOf('Chrome/66') === -1; - } catch (e) { /* empty */ } -}(); - -// helpers -var isThenable = function (it) { - var then; - return isObject(it) && typeof (then = it.then) == 'function' ? then : false; -}; -var notify = function (promise, isReject) { - if (promise._n) return; - promise._n = true; - var chain = promise._c; - microtask(function () { - var value = promise._v; - var ok = promise._s == 1; - var i = 0; - var run = function (reaction) { - var handler = ok ? reaction.ok : reaction.fail; - var resolve = reaction.resolve; - var reject = reaction.reject; - var domain = reaction.domain; - var result, then, exited; - try { - if (handler) { - if (!ok) { - if (promise._h == 2) onHandleUnhandled(promise); - promise._h = 1; - } - if (handler === true) result = value; - else { - if (domain) domain.enter(); - result = handler(value); // may throw - if (domain) { - domain.exit(); - exited = true; - } - } - if (result === reaction.promise) { - reject(TypeError('Promise-chain cycle')); - } else if (then = isThenable(result)) { - then.call(result, resolve, reject); - } else resolve(result); - } else reject(value); - } catch (e) { - if (domain && !exited) domain.exit(); - reject(e); - } - }; - while (chain.length > i) run(chain[i++]); // variable length - can't use forEach - promise._c = []; - promise._n = false; - if (isReject && !promise._h) onUnhandled(promise); - }); -}; -var onUnhandled = function (promise) { - task.call(global, function () { - var value = promise._v; - var unhandled = isUnhandled(promise); - var result, handler, console; - if (unhandled) { - result = perform(function () { - if (isNode) { - process.emit('unhandledRejection', value, promise); - } else if (handler = global.onunhandledrejection) { - handler({ promise: promise, reason: value }); - } else if ((console = global.console) && console.error) { - console.error('Unhandled promise rejection', value); - } - }); - // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should - promise._h = isNode || isUnhandled(promise) ? 2 : 1; - } promise._a = undefined; - if (unhandled && result.e) throw result.v; - }); -}; -var isUnhandled = function (promise) { - return promise._h !== 1 && (promise._a || promise._c).length === 0; -}; -var onHandleUnhandled = function (promise) { - task.call(global, function () { - var handler; - if (isNode) { - process.emit('rejectionHandled', promise); - } else if (handler = global.onrejectionhandled) { - handler({ promise: promise, reason: promise._v }); - } - }); -}; -var $reject = function (value) { - var promise = this; - if (promise._d) return; - promise._d = true; - promise = promise._w || promise; // unwrap - promise._v = value; - promise._s = 2; - if (!promise._a) promise._a = promise._c.slice(); - notify(promise, true); -}; -var $resolve = function (value) { - var promise = this; - var then; - if (promise._d) return; - promise._d = true; - promise = promise._w || promise; // unwrap - try { - if (promise === value) throw TypeError("Promise can't be resolved itself"); - if (then = isThenable(value)) { - microtask(function () { - var wrapper = { _w: promise, _d: false }; // wrap - try { - then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); - } catch (e) { - $reject.call(wrapper, e); - } - }); - } else { - promise._v = value; - promise._s = 1; - notify(promise, false); - } - } catch (e) { - $reject.call({ _w: promise, _d: false }, e); // wrap - } -}; - -// constructor polyfill -if (!USE_NATIVE) { - // 25.4.3.1 Promise(executor) - $Promise = function Promise(executor) { - anInstance(this, $Promise, PROMISE, '_h'); - aFunction(executor); - Internal.call(this); - try { - executor(ctx($resolve, this, 1), ctx($reject, this, 1)); - } catch (err) { - $reject.call(this, err); - } - }; - // eslint-disable-next-line no-unused-vars - Internal = function Promise(executor) { - this._c = []; // <- awaiting reactions - this._a = undefined; // <- checked in isUnhandled reactions - this._s = 0; // <- state - this._d = false; // <- done - this._v = undefined; // <- value - this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled - this._n = false; // <- notify - }; - Internal.prototype = __nested_webpack_require_352921__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js")($Promise.prototype, { - // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) - then: function then(onFulfilled, onRejected) { - var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); - reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; - reaction.fail = typeof onRejected == 'function' && onRejected; - reaction.domain = isNode ? process.domain : undefined; - this._c.push(reaction); - if (this._a) this._a.push(reaction); - if (this._s) notify(this, false); - return reaction.promise; - }, - // 25.4.5.1 Promise.prototype.catch(onRejected) - 'catch': function (onRejected) { - return this.then(undefined, onRejected); - } - }); - OwnPromiseCapability = function () { - var promise = new Internal(); - this.promise = promise; - this.resolve = ctx($resolve, promise, 1); - this.reject = ctx($reject, promise, 1); - }; - newPromiseCapabilityModule.f = newPromiseCapability = function (C) { - return C === $Promise || C === Wrapper - ? new OwnPromiseCapability(C) - : newGenericPromiseCapability(C); - }; -} - -$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); -__nested_webpack_require_352921__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js")($Promise, PROMISE); -__nested_webpack_require_352921__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js")(PROMISE); -Wrapper = __nested_webpack_require_352921__(/*! ./_core */ "./node_modules/core-js/modules/_core.js")[PROMISE]; - -// statics -$export($export.S + $export.F * !USE_NATIVE, PROMISE, { - // 25.4.4.5 Promise.reject(r) - reject: function reject(r) { - var capability = newPromiseCapability(this); - var $$reject = capability.reject; - $$reject(r); - return capability.promise; - } -}); -$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { - // 25.4.4.6 Promise.resolve(x) - resolve: function resolve(x) { - return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); - } -}); -$export($export.S + $export.F * !(USE_NATIVE && __nested_webpack_require_352921__(/*! ./_iter-detect */ "./node_modules/core-js/modules/_iter-detect.js")(function (iter) { - $Promise.all(iter)['catch'](empty); -})), PROMISE, { - // 25.4.4.1 Promise.all(iterable) - all: function all(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var resolve = capability.resolve; - var reject = capability.reject; - var result = perform(function () { - var values = []; - var index = 0; - var remaining = 1; - forOf(iterable, false, function (promise) { - var $index = index++; - var alreadyCalled = false; - values.push(undefined); - remaining++; - C.resolve(promise).then(function (value) { - if (alreadyCalled) return; - alreadyCalled = true; - values[$index] = value; - --remaining || resolve(values); - }, reject); - }); - --remaining || resolve(values); - }); - if (result.e) reject(result.v); - return capability.promise; - }, - // 25.4.4.4 Promise.race(iterable) - race: function race(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var reject = capability.reject; - var result = perform(function () { - forOf(iterable, false, function (promise) { - C.resolve(promise).then(capability.resolve, reject); - }); - }); - if (result.e) reject(result.v); - return capability.promise; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.reflect.apply.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.reflect.apply.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_364509__) { - -// 26.1.1 Reflect.apply(target, thisArgument, argumentsList) -var $export = __nested_webpack_require_364509__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var aFunction = __nested_webpack_require_364509__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); -var anObject = __nested_webpack_require_364509__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var rApply = (__nested_webpack_require_364509__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").Reflect || {}).apply; -var fApply = Function.apply; -// MS Edge argumentsList argument is optional -$export($export.S + $export.F * !__nested_webpack_require_364509__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { - rApply(function () { /* empty */ }); -}), 'Reflect', { - apply: function apply(target, thisArgument, argumentsList) { - var T = aFunction(target); - var L = anObject(argumentsList); - return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.reflect.construct.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.reflect.construct.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_365847__) { - -// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) -var $export = __nested_webpack_require_365847__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var create = __nested_webpack_require_365847__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js"); -var aFunction = __nested_webpack_require_365847__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); -var anObject = __nested_webpack_require_365847__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var isObject = __nested_webpack_require_365847__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var fails = __nested_webpack_require_365847__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); -var bind = __nested_webpack_require_365847__(/*! ./_bind */ "./node_modules/core-js/modules/_bind.js"); -var rConstruct = (__nested_webpack_require_365847__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").Reflect || {}).construct; - -// MS Edge supports only 2 arguments and argumentsList argument is optional -// FF Nightly sets third argument as `new.target`, but does not create `this` from it -var NEW_TARGET_BUG = fails(function () { - function F() { /* empty */ } - return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); -}); -var ARGS_BUG = !fails(function () { - rConstruct(function () { /* empty */ }); -}); - -$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { - construct: function construct(Target, args /* , newTarget */) { - aFunction(Target); - anObject(args); - var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); - if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); - if (Target == newTarget) { - // w/o altered newTarget, optimization for 0-4 arguments - switch (args.length) { - case 0: return new Target(); - case 1: return new Target(args[0]); - case 2: return new Target(args[0], args[1]); - case 3: return new Target(args[0], args[1], args[2]); - case 4: return new Target(args[0], args[1], args[2], args[3]); - } - // w/o altered newTarget, lot of arguments case - var $args = [null]; - $args.push.apply($args, args); - return new (bind.apply(Target, $args))(); - } - // with altered newTarget, not support built-in constructors - var proto = newTarget.prototype; - var instance = create(isObject(proto) ? proto : Object.prototype); - var result = Function.apply.call(Target, instance, args); - return isObject(result) ? result : instance; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.reflect.define-property.js": -/*!*********************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.reflect.define-property.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_368738__) { - -// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) -var dP = __nested_webpack_require_368738__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); -var $export = __nested_webpack_require_368738__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var anObject = __nested_webpack_require_368738__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var toPrimitive = __nested_webpack_require_368738__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); - -// MS Edge has broken Reflect.defineProperty - throwing instead of returning false -$export($export.S + $export.F * __nested_webpack_require_368738__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { - // eslint-disable-next-line no-undef - Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); -}), 'Reflect', { - defineProperty: function defineProperty(target, propertyKey, attributes) { - anObject(target); - propertyKey = toPrimitive(propertyKey, true); - anObject(attributes); - try { - dP.f(target, propertyKey, attributes); - return true; - } catch (e) { - return false; - } - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.reflect.delete-property.js": -/*!*********************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.reflect.delete-property.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_370249__) { - -// 26.1.4 Reflect.deleteProperty(target, propertyKey) -var $export = __nested_webpack_require_370249__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var gOPD = __nested_webpack_require_370249__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js").f; -var anObject = __nested_webpack_require_370249__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); - -$export($export.S, 'Reflect', { - deleteProperty: function deleteProperty(target, propertyKey) { - var desc = gOPD(anObject(target), propertyKey); - return desc && !desc.configurable ? false : delete target[propertyKey]; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.reflect.enumerate.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.reflect.enumerate.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_371216__) { - -"use strict"; - -// 26.1.5 Reflect.enumerate(target) -var $export = __nested_webpack_require_371216__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var anObject = __nested_webpack_require_371216__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var Enumerate = function (iterated) { - this._t = anObject(iterated); // target - this._i = 0; // next index - var keys = this._k = []; // keys - var key; - for (key in iterated) keys.push(key); -}; -__nested_webpack_require_371216__(/*! ./_iter-create */ "./node_modules/core-js/modules/_iter-create.js")(Enumerate, 'Object', function () { - var that = this; - var keys = that._k; - var key; - do { - if (that._i >= keys.length) return { value: undefined, done: true }; - } while (!((key = keys[that._i++]) in that._t)); - return { value: key, done: false }; -}); - -$export($export.S, 'Reflect', { - enumerate: function enumerate(target) { - return new Enumerate(target); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js ***! - \*********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_372601__) { - -// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) -var gOPD = __nested_webpack_require_372601__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js"); -var $export = __nested_webpack_require_372601__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var anObject = __nested_webpack_require_372601__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); - -$export($export.S, 'Reflect', { - getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { - return gOPD.f(anObject(target), propertyKey); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.reflect.get-prototype-of.js": -/*!**********************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.reflect.get-prototype-of.js ***! - \**********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_373546__) { - -// 26.1.8 Reflect.getPrototypeOf(target) -var $export = __nested_webpack_require_373546__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var getProto = __nested_webpack_require_373546__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); -var anObject = __nested_webpack_require_373546__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); - -$export($export.S, 'Reflect', { - getPrototypeOf: function getPrototypeOf(target) { - return getProto(anObject(target)); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.reflect.get.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.reflect.get.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_374374__) { - -// 26.1.6 Reflect.get(target, propertyKey [, receiver]) -var gOPD = __nested_webpack_require_374374__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js"); -var getPrototypeOf = __nested_webpack_require_374374__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); -var has = __nested_webpack_require_374374__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); -var $export = __nested_webpack_require_374374__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var isObject = __nested_webpack_require_374374__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var anObject = __nested_webpack_require_374374__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); - -function get(target, propertyKey /* , receiver */) { - var receiver = arguments.length < 3 ? target : arguments[2]; - var desc, proto; - if (anObject(target) === receiver) return target[propertyKey]; - if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') - ? desc.value - : desc.get !== undefined - ? desc.get.call(receiver) - : undefined; - if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); -} - -$export($export.S, 'Reflect', { get: get }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.reflect.has.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.reflect.has.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_375890__) { - -// 26.1.9 Reflect.has(target, propertyKey) -var $export = __nested_webpack_require_375890__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Reflect', { - has: function has(target, propertyKey) { - return propertyKey in target; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.reflect.is-extensible.js": -/*!*******************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.reflect.is-extensible.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_376536__) { - -// 26.1.10 Reflect.isExtensible(target) -var $export = __nested_webpack_require_376536__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var anObject = __nested_webpack_require_376536__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var $isExtensible = Object.isExtensible; - -$export($export.S, 'Reflect', { - isExtensible: function isExtensible(target) { - anObject(target); - return $isExtensible ? $isExtensible(target) : true; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.reflect.own-keys.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.reflect.own-keys.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_377354__) { - -// 26.1.11 Reflect.ownKeys(target) -var $export = __nested_webpack_require_377354__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Reflect', { ownKeys: __nested_webpack_require_377354__(/*! ./_own-keys */ "./node_modules/core-js/modules/_own-keys.js") }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.reflect.prevent-extensions.js": -/*!************************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.reflect.prevent-extensions.js ***! - \************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_378026__) { - -// 26.1.12 Reflect.preventExtensions(target) -var $export = __nested_webpack_require_378026__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var anObject = __nested_webpack_require_378026__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var $preventExtensions = Object.preventExtensions; - -$export($export.S, 'Reflect', { - preventExtensions: function preventExtensions(target) { - anObject(target); - try { - if ($preventExtensions) $preventExtensions(target); - return true; - } catch (e) { - return false; - } - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.reflect.set-prototype-of.js": -/*!**********************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.reflect.set-prototype-of.js ***! - \**********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_378975__) { - -// 26.1.14 Reflect.setPrototypeOf(target, proto) -var $export = __nested_webpack_require_378975__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var setProto = __nested_webpack_require_378975__(/*! ./_set-proto */ "./node_modules/core-js/modules/_set-proto.js"); - -if (setProto) $export($export.S, 'Reflect', { - setPrototypeOf: function setPrototypeOf(target, proto) { - setProto.check(target, proto); - try { - setProto.set(target, proto); - return true; - } catch (e) { - return false; - } - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.reflect.set.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.reflect.set.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_379830__) { - -// 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) -var dP = __nested_webpack_require_379830__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); -var gOPD = __nested_webpack_require_379830__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js"); -var getPrototypeOf = __nested_webpack_require_379830__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); -var has = __nested_webpack_require_379830__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); -var $export = __nested_webpack_require_379830__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var createDesc = __nested_webpack_require_379830__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); -var anObject = __nested_webpack_require_379830__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var isObject = __nested_webpack_require_379830__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); - -function set(target, propertyKey, V /* , receiver */) { - var receiver = arguments.length < 4 ? target : arguments[3]; - var ownDesc = gOPD.f(anObject(target), propertyKey); - var existingDescriptor, proto; - if (!ownDesc) { - if (isObject(proto = getPrototypeOf(target))) { - return set(proto, propertyKey, V, receiver); - } - ownDesc = createDesc(0); - } - if (has(ownDesc, 'value')) { - if (ownDesc.writable === false || !isObject(receiver)) return false; - if (existingDescriptor = gOPD.f(receiver, propertyKey)) { - if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; - existingDescriptor.value = V; - dP.f(receiver, propertyKey, existingDescriptor); - } else dP.f(receiver, propertyKey, createDesc(0, V)); - return true; - } - return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); -} - -$export($export.S, 'Reflect', { set: set }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.regexp.constructor.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.regexp.constructor.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_382037__) { - -var global = __nested_webpack_require_382037__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var inheritIfRequired = __nested_webpack_require_382037__(/*! ./_inherit-if-required */ "./node_modules/core-js/modules/_inherit-if-required.js"); -var dP = __nested_webpack_require_382037__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; -var gOPN = __nested_webpack_require_382037__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f; -var isRegExp = __nested_webpack_require_382037__(/*! ./_is-regexp */ "./node_modules/core-js/modules/_is-regexp.js"); -var $flags = __nested_webpack_require_382037__(/*! ./_flags */ "./node_modules/core-js/modules/_flags.js"); -var $RegExp = global.RegExp; -var Base = $RegExp; -var proto = $RegExp.prototype; -var re1 = /a/g; -var re2 = /a/g; -// "new" creates a new object, old webkit buggy here -var CORRECT_NEW = new $RegExp(re1) !== re1; - -if (__nested_webpack_require_382037__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && (!CORRECT_NEW || __nested_webpack_require_382037__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { - re2[__nested_webpack_require_382037__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('match')] = false; - // RegExp constructor can alter flags and IsRegExp works correct with @@match - return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; -}))) { - $RegExp = function RegExp(p, f) { - var tiRE = this instanceof $RegExp; - var piRE = isRegExp(p); - var fiU = f === undefined; - return !tiRE && piRE && p.constructor === $RegExp && fiU ? p - : inheritIfRequired(CORRECT_NEW - ? new Base(piRE && !fiU ? p.source : p, f) - : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) - , tiRE ? this : proto, $RegExp); - }; - var proxy = function (key) { - key in $RegExp || dP($RegExp, key, { - configurable: true, - get: function () { return Base[key]; }, - set: function (it) { Base[key] = it; } - }); - }; - for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]); - proto.constructor = $RegExp; - $RegExp.prototype = proto; - __nested_webpack_require_382037__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js")(global, 'RegExp', $RegExp); -} - -__nested_webpack_require_382037__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js")('RegExp'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.regexp.exec.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.regexp.exec.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_384695__) { - -"use strict"; - -var regexpExec = __nested_webpack_require_384695__(/*! ./_regexp-exec */ "./node_modules/core-js/modules/_regexp-exec.js"); -__nested_webpack_require_384695__(/*! ./_export */ "./node_modules/core-js/modules/_export.js")({ - target: 'RegExp', - proto: true, - forced: regexpExec !== /./.exec -}, { - exec: regexpExec -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.regexp.flags.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.regexp.flags.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_385353__) { - -// 21.2.5.3 get RegExp.prototype.flags() -if (__nested_webpack_require_385353__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && /./g.flags != 'g') __nested_webpack_require_385353__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f(RegExp.prototype, 'flags', { - configurable: true, - get: __nested_webpack_require_385353__(/*! ./_flags */ "./node_modules/core-js/modules/_flags.js") -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.regexp.match.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.regexp.match.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_386096__) { - -"use strict"; - - -var anObject = __nested_webpack_require_386096__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var toLength = __nested_webpack_require_386096__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -var advanceStringIndex = __nested_webpack_require_386096__(/*! ./_advance-string-index */ "./node_modules/core-js/modules/_advance-string-index.js"); -var regExpExec = __nested_webpack_require_386096__(/*! ./_regexp-exec-abstract */ "./node_modules/core-js/modules/_regexp-exec-abstract.js"); - -// @@match logic -__nested_webpack_require_386096__(/*! ./_fix-re-wks */ "./node_modules/core-js/modules/_fix-re-wks.js")('match', 1, function (defined, MATCH, $match, maybeCallNative) { - return [ - // `String.prototype.match` method - // https://tc39.github.io/ecma262/#sec-string.prototype.match - function match(regexp) { - var O = defined(this); - var fn = regexp == undefined ? undefined : regexp[MATCH]; - return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); - }, - // `RegExp.prototype[@@match]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match - function (regexp) { - var res = maybeCallNative($match, regexp, this); - if (res.done) return res.value; - var rx = anObject(regexp); - var S = String(this); - if (!rx.global) return regExpExec(rx, S); - var fullUnicode = rx.unicode; - rx.lastIndex = 0; - var A = []; - var n = 0; - var result; - while ((result = regExpExec(rx, S)) !== null) { - var matchStr = String(result[0]); - A[n] = matchStr; - if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); - n++; - } - return n === 0 ? null : A; - } - ]; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.regexp.replace.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.regexp.replace.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_388196__) { - -"use strict"; - - -var anObject = __nested_webpack_require_388196__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var toObject = __nested_webpack_require_388196__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); -var toLength = __nested_webpack_require_388196__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -var toInteger = __nested_webpack_require_388196__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); -var advanceStringIndex = __nested_webpack_require_388196__(/*! ./_advance-string-index */ "./node_modules/core-js/modules/_advance-string-index.js"); -var regExpExec = __nested_webpack_require_388196__(/*! ./_regexp-exec-abstract */ "./node_modules/core-js/modules/_regexp-exec-abstract.js"); -var max = Math.max; -var min = Math.min; -var floor = Math.floor; -var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g; -var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g; - -var maybeToString = function (it) { - return it === undefined ? it : String(it); -}; - -// @@replace logic -__nested_webpack_require_388196__(/*! ./_fix-re-wks */ "./node_modules/core-js/modules/_fix-re-wks.js")('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) { - return [ - // `String.prototype.replace` method - // https://tc39.github.io/ecma262/#sec-string.prototype.replace - function replace(searchValue, replaceValue) { - var O = defined(this); - var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; - return fn !== undefined - ? fn.call(searchValue, O, replaceValue) - : $replace.call(String(O), searchValue, replaceValue); - }, - // `RegExp.prototype[@@replace]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace - function (regexp, replaceValue) { - var res = maybeCallNative($replace, regexp, this, replaceValue); - if (res.done) return res.value; - - var rx = anObject(regexp); - var S = String(this); - var functionalReplace = typeof replaceValue === 'function'; - if (!functionalReplace) replaceValue = String(replaceValue); - var global = rx.global; - if (global) { - var fullUnicode = rx.unicode; - rx.lastIndex = 0; - } - var results = []; - while (true) { - var result = regExpExec(rx, S); - if (result === null) break; - results.push(result); - if (!global) break; - var matchStr = String(result[0]); - if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); - } - var accumulatedResult = ''; - var nextSourcePosition = 0; - for (var i = 0; i < results.length; i++) { - result = results[i]; - var matched = String(result[0]); - var position = max(min(toInteger(result.index), S.length), 0); - var captures = []; - // NOTE: This is equivalent to - // captures = result.slice(1).map(maybeToString) - // but for some reason `nativeSlice.call(result, 1, result.length)` (called in - // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and - // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. - for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); - var namedCaptures = result.groups; - if (functionalReplace) { - var replacerArgs = [matched].concat(captures, position, S); - if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); - var replacement = String(replaceValue.apply(undefined, replacerArgs)); - } else { - replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); - } - if (position >= nextSourcePosition) { - accumulatedResult += S.slice(nextSourcePosition, position) + replacement; - nextSourcePosition = position + matched.length; - } - } - return accumulatedResult + S.slice(nextSourcePosition); - } - ]; - - // https://tc39.github.io/ecma262/#sec-getsubstitution - function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { - var tailPos = position + matched.length; - var m = captures.length; - var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; - if (namedCaptures !== undefined) { - namedCaptures = toObject(namedCaptures); - symbols = SUBSTITUTION_SYMBOLS; - } - return $replace.call(replacement, symbols, function (match, ch) { - var capture; - switch (ch.charAt(0)) { - case '$': return '$'; - case '&': return matched; - case '`': return str.slice(0, position); - case "'": return str.slice(tailPos); - case '<': - capture = namedCaptures[ch.slice(1, -1)]; - break; - default: // \d\d? - var n = +ch; - if (n === 0) return match; - if (n > m) { - var f = floor(n / 10); - if (f === 0) return match; - if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); - return match; - } - capture = captures[n - 1]; - } - return capture === undefined ? '' : capture; - }); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.regexp.search.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.regexp.search.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_393682__) { - -"use strict"; - - -var anObject = __nested_webpack_require_393682__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var sameValue = __nested_webpack_require_393682__(/*! ./_same-value */ "./node_modules/core-js/modules/_same-value.js"); -var regExpExec = __nested_webpack_require_393682__(/*! ./_regexp-exec-abstract */ "./node_modules/core-js/modules/_regexp-exec-abstract.js"); - -// @@search logic -__nested_webpack_require_393682__(/*! ./_fix-re-wks */ "./node_modules/core-js/modules/_fix-re-wks.js")('search', 1, function (defined, SEARCH, $search, maybeCallNative) { - return [ - // `String.prototype.search` method - // https://tc39.github.io/ecma262/#sec-string.prototype.search - function search(regexp) { - var O = defined(this); - var fn = regexp == undefined ? undefined : regexp[SEARCH]; - return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); - }, - // `RegExp.prototype[@@search]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search - function (regexp) { - var res = maybeCallNative($search, regexp, this); - if (res.done) return res.value; - var rx = anObject(regexp); - var S = String(this); - var previousLastIndex = rx.lastIndex; - if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; - var result = regExpExec(rx, S); - if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; - return result === null ? -1 : result.index; - } - ]; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.regexp.split.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.regexp.split.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_395496__) { - -"use strict"; - - -var isRegExp = __nested_webpack_require_395496__(/*! ./_is-regexp */ "./node_modules/core-js/modules/_is-regexp.js"); -var anObject = __nested_webpack_require_395496__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var speciesConstructor = __nested_webpack_require_395496__(/*! ./_species-constructor */ "./node_modules/core-js/modules/_species-constructor.js"); -var advanceStringIndex = __nested_webpack_require_395496__(/*! ./_advance-string-index */ "./node_modules/core-js/modules/_advance-string-index.js"); -var toLength = __nested_webpack_require_395496__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -var callRegExpExec = __nested_webpack_require_395496__(/*! ./_regexp-exec-abstract */ "./node_modules/core-js/modules/_regexp-exec-abstract.js"); -var regexpExec = __nested_webpack_require_395496__(/*! ./_regexp-exec */ "./node_modules/core-js/modules/_regexp-exec.js"); -var fails = __nested_webpack_require_395496__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); -var $min = Math.min; -var $push = [].push; -var $SPLIT = 'split'; -var LENGTH = 'length'; -var LAST_INDEX = 'lastIndex'; -var MAX_UINT32 = 0xffffffff; - -// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError -var SUPPORTS_Y = !fails(function () { RegExp(MAX_UINT32, 'y'); }); - -// @@split logic -__nested_webpack_require_395496__(/*! ./_fix-re-wks */ "./node_modules/core-js/modules/_fix-re-wks.js")('split', 2, function (defined, SPLIT, $split, maybeCallNative) { - var internalSplit; - if ( - 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || - 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || - 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || - '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || - '.'[$SPLIT](/()()/)[LENGTH] > 1 || - ''[$SPLIT](/.?/)[LENGTH] - ) { - // based on es5-shim implementation, need to rework it - internalSplit = function (separator, limit) { - var string = String(this); - if (separator === undefined && limit === 0) return []; - // If `separator` is not a regex, use native split - if (!isRegExp(separator)) return $split.call(string, separator, limit); - var output = []; - var flags = (separator.ignoreCase ? 'i' : '') + - (separator.multiline ? 'm' : '') + - (separator.unicode ? 'u' : '') + - (separator.sticky ? 'y' : ''); - var lastLastIndex = 0; - var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0; - // Make `global` and avoid `lastIndex` issues by working with a copy - var separatorCopy = new RegExp(separator.source, flags + 'g'); - var match, lastIndex, lastLength; - while (match = regexpExec.call(separatorCopy, string)) { - lastIndex = separatorCopy[LAST_INDEX]; - if (lastIndex > lastLastIndex) { - output.push(string.slice(lastLastIndex, match.index)); - if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); - lastLength = match[0][LENGTH]; - lastLastIndex = lastIndex; - if (output[LENGTH] >= splitLimit) break; - } - if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop - } - if (lastLastIndex === string[LENGTH]) { - if (lastLength || !separatorCopy.test('')) output.push(''); - } else output.push(string.slice(lastLastIndex)); - return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; - }; - // Chakra, V8 - } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { - internalSplit = function (separator, limit) { - return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit); - }; - } else { - internalSplit = $split; - } - - return [ - // `String.prototype.split` method - // https://tc39.github.io/ecma262/#sec-string.prototype.split - function split(separator, limit) { - var O = defined(this); - var splitter = separator == undefined ? undefined : separator[SPLIT]; - return splitter !== undefined - ? splitter.call(separator, O, limit) - : internalSplit.call(String(O), separator, limit); - }, - // `RegExp.prototype[@@split]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split - // - // NOTE: This cannot be properly polyfilled in engines that don't support - // the 'y' flag. - function (regexp, limit) { - var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split); - if (res.done) return res.value; - - var rx = anObject(regexp); - var S = String(this); - var C = speciesConstructor(rx, RegExp); - - var unicodeMatching = rx.unicode; - var flags = (rx.ignoreCase ? 'i' : '') + - (rx.multiline ? 'm' : '') + - (rx.unicode ? 'u' : '') + - (SUPPORTS_Y ? 'y' : 'g'); - - // ^(? + rx + ) is needed, in combination with some S slicing, to - // simulate the 'y' flag. - var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags); - var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; - if (lim === 0) return []; - if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : []; - var p = 0; - var q = 0; - var A = []; - while (q < S.length) { - splitter.lastIndex = SUPPORTS_Y ? q : 0; - var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q)); - var e; - if ( - z === null || - (e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p - ) { - q = advanceStringIndex(S, q, unicodeMatching); - } else { - A.push(S.slice(p, q)); - if (A.length === lim) return A; - for (var i = 1; i <= z.length - 1; i++) { - A.push(z[i]); - if (A.length === lim) return A; - } - q = p = e; - } - } - A.push(S.slice(p)); - return A; - } - ]; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.regexp.to-string.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.regexp.to-string.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_401699__) { - -"use strict"; - -__nested_webpack_require_401699__(/*! ./es6.regexp.flags */ "./node_modules/core-js/modules/es6.regexp.flags.js"); -var anObject = __nested_webpack_require_401699__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var $flags = __nested_webpack_require_401699__(/*! ./_flags */ "./node_modules/core-js/modules/_flags.js"); -var DESCRIPTORS = __nested_webpack_require_401699__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); -var TO_STRING = 'toString'; -var $toString = /./[TO_STRING]; - -var define = function (fn) { - __nested_webpack_require_401699__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js")(RegExp.prototype, TO_STRING, fn, true); -}; - -// 21.2.5.14 RegExp.prototype.toString() -if (__nested_webpack_require_401699__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) { - define(function toString() { - var R = anObject(this); - return '/'.concat(R.source, '/', - 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); - }); -// FF44- RegExp#toString has a wrong name -} else if ($toString.name != TO_STRING) { - define(function toString() { - return $toString.call(this); - }); -} - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.set.js": -/*!*************************************************!*\ - !*** ./node_modules/core-js/modules/es6.set.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_403225__) { - -"use strict"; - -var strong = __nested_webpack_require_403225__(/*! ./_collection-strong */ "./node_modules/core-js/modules/_collection-strong.js"); -var validate = __nested_webpack_require_403225__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); -var SET = 'Set'; - -// 23.2 Set Objects -module.exports = __nested_webpack_require_403225__(/*! ./_collection */ "./node_modules/core-js/modules/_collection.js")(SET, function (get) { - return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; -}, { - // 23.2.3.1 Set.prototype.add(value) - add: function add(value) { - return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); - } -}, strong); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.anchor.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.anchor.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_404274__) { - -"use strict"; - -// B.2.3.2 String.prototype.anchor(name) -__nested_webpack_require_404274__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('anchor', function (createHTML) { - return function anchor(name) { - return createHTML(this, 'a', 'name', name); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.big.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.big.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_404890__) { - -"use strict"; - -// B.2.3.3 String.prototype.big() -__nested_webpack_require_404890__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('big', function (createHTML) { - return function big() { - return createHTML(this, 'big', '', ''); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.blink.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.blink.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_405493__) { - -"use strict"; - -// B.2.3.4 String.prototype.blink() -__nested_webpack_require_405493__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('blink', function (createHTML) { - return function blink() { - return createHTML(this, 'blink', '', ''); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.bold.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.bold.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_406100__) { - -"use strict"; - -// B.2.3.5 String.prototype.bold() -__nested_webpack_require_406100__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('bold', function (createHTML) { - return function bold() { - return createHTML(this, 'b', '', ''); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.code-point-at.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.code-point-at.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_406736__) { - -"use strict"; - -var $export = __nested_webpack_require_406736__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $at = __nested_webpack_require_406736__(/*! ./_string-at */ "./node_modules/core-js/modules/_string-at.js")(false); -$export($export.P, 'String', { - // 21.1.3.3 String.prototype.codePointAt(pos) - codePointAt: function codePointAt(pos) { - return $at(this, pos); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.ends-with.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.ends-with.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_407479__) { - -"use strict"; -// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) - -var $export = __nested_webpack_require_407479__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var toLength = __nested_webpack_require_407479__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -var context = __nested_webpack_require_407479__(/*! ./_string-context */ "./node_modules/core-js/modules/_string-context.js"); -var ENDS_WITH = 'endsWith'; -var $endsWith = ''[ENDS_WITH]; - -$export($export.P + $export.F * __nested_webpack_require_407479__(/*! ./_fails-is-regexp */ "./node_modules/core-js/modules/_fails-is-regexp.js")(ENDS_WITH), 'String', { - endsWith: function endsWith(searchString /* , endPosition = @length */) { - var that = context(this, searchString, ENDS_WITH); - var endPosition = arguments.length > 1 ? arguments[1] : undefined; - var len = toLength(that.length); - var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); - var search = String(searchString); - return $endsWith - ? $endsWith.call(that, search, end) - : that.slice(end - search.length, end) === search; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.fixed.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.fixed.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_408936__) { - -"use strict"; - -// B.2.3.6 String.prototype.fixed() -__nested_webpack_require_408936__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('fixed', function (createHTML) { - return function fixed() { - return createHTML(this, 'tt', '', ''); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.fontcolor.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.fontcolor.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_409560__) { - -"use strict"; - -// B.2.3.7 String.prototype.fontcolor(color) -__nested_webpack_require_409560__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('fontcolor', function (createHTML) { - return function fontcolor(color) { - return createHTML(this, 'font', 'color', color); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.fontsize.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.fontsize.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_410212__) { - -"use strict"; - -// B.2.3.8 String.prototype.fontsize(size) -__nested_webpack_require_410212__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('fontsize', function (createHTML) { - return function fontsize(size) { - return createHTML(this, 'font', 'size', size); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.from-code-point.js": -/*!********************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.from-code-point.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_410885__) { - -var $export = __nested_webpack_require_410885__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var toAbsoluteIndex = __nested_webpack_require_410885__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); -var fromCharCode = String.fromCharCode; -var $fromCodePoint = String.fromCodePoint; - -// length should be 1, old FF problem -$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { - // 21.1.2.2 String.fromCodePoint(...codePoints) - fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars - var res = []; - var aLen = arguments.length; - var i = 0; - var code; - while (aLen > i) { - code = +arguments[i++]; - if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); - res.push(code < 0x10000 - ? fromCharCode(code) - : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) - ); - } return res.join(''); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.includes.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.includes.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_412247__) { - -"use strict"; -// 21.1.3.7 String.prototype.includes(searchString, position = 0) - -var $export = __nested_webpack_require_412247__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var context = __nested_webpack_require_412247__(/*! ./_string-context */ "./node_modules/core-js/modules/_string-context.js"); -var INCLUDES = 'includes'; - -$export($export.P + $export.F * __nested_webpack_require_412247__(/*! ./_fails-is-regexp */ "./node_modules/core-js/modules/_fails-is-regexp.js")(INCLUDES), 'String', { - includes: function includes(searchString /* , position = 0 */) { - return !!~context(this, searchString, INCLUDES) - .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.italics.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.italics.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_413287__) { - -"use strict"; - -// B.2.3.9 String.prototype.italics() -__nested_webpack_require_413287__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('italics', function (createHTML) { - return function italics() { - return createHTML(this, 'i', '', ''); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.iterator.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.iterator.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_413912__) { - -"use strict"; - -var $at = __nested_webpack_require_413912__(/*! ./_string-at */ "./node_modules/core-js/modules/_string-at.js")(true); - -// 21.1.3.27 String.prototype[@@iterator]() -__nested_webpack_require_413912__(/*! ./_iter-define */ "./node_modules/core-js/modules/_iter-define.js")(String, 'String', function (iterated) { - this._t = String(iterated); // target - this._i = 0; // next index -// 21.1.5.2.1 %StringIteratorPrototype%.next() -}, function () { - var O = this._t; - var index = this._i; - var point; - if (index >= O.length) return { value: undefined, done: true }; - point = $at(O, index); - this._i += point.length; - return { value: point, done: false }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.link.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.link.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_414922__) { - -"use strict"; - -// B.2.3.10 String.prototype.link(url) -__nested_webpack_require_414922__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('link', function (createHTML) { - return function link(url) { - return createHTML(this, 'a', 'href', url); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.raw.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.raw.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_415530__) { - -var $export = __nested_webpack_require_415530__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var toIObject = __nested_webpack_require_415530__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); -var toLength = __nested_webpack_require_415530__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); - -$export($export.S, 'String', { - // 21.1.2.4 String.raw(callSite, ...substitutions) - raw: function raw(callSite) { - var tpl = toIObject(callSite.raw); - var len = toLength(tpl.length); - var aLen = arguments.length; - var res = []; - var i = 0; - while (len > i) { - res.push(String(tpl[i++])); - if (i < aLen) res.push(String(arguments[i])); - } return res.join(''); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.repeat.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.repeat.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_416595__) { - -var $export = __nested_webpack_require_416595__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.P, 'String', { - // 21.1.3.13 String.prototype.repeat(count) - repeat: __nested_webpack_require_416595__(/*! ./_string-repeat */ "./node_modules/core-js/modules/_string-repeat.js") -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.small.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.small.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_417232__) { - -"use strict"; - -// B.2.3.11 String.prototype.small() -__nested_webpack_require_417232__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('small', function (createHTML) { - return function small() { - return createHTML(this, 'small', '', ''); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.starts-with.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.starts-with.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_417868__) { - -"use strict"; -// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) - -var $export = __nested_webpack_require_417868__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var toLength = __nested_webpack_require_417868__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -var context = __nested_webpack_require_417868__(/*! ./_string-context */ "./node_modules/core-js/modules/_string-context.js"); -var STARTS_WITH = 'startsWith'; -var $startsWith = ''[STARTS_WITH]; - -$export($export.P + $export.F * __nested_webpack_require_417868__(/*! ./_fails-is-regexp */ "./node_modules/core-js/modules/_fails-is-regexp.js")(STARTS_WITH), 'String', { - startsWith: function startsWith(searchString /* , position = 0 */) { - var that = context(this, searchString, STARTS_WITH); - var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); - var search = String(searchString); - return $startsWith - ? $startsWith.call(that, search, index) - : that.slice(index, index + search.length) === search; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.strike.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.strike.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_419251__) { - -"use strict"; - -// B.2.3.12 String.prototype.strike() -__nested_webpack_require_419251__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('strike', function (createHTML) { - return function strike() { - return createHTML(this, 'strike', '', ''); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.sub.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.sub.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_419859__) { - -"use strict"; - -// B.2.3.13 String.prototype.sub() -__nested_webpack_require_419859__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('sub', function (createHTML) { - return function sub() { - return createHTML(this, 'sub', '', ''); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.sup.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.sup.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_420455__) { - -"use strict"; - -// B.2.3.14 String.prototype.sup() -__nested_webpack_require_420455__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('sup', function (createHTML) { - return function sup() { - return createHTML(this, 'sup', '', ''); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.string.trim.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es6.string.trim.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_421055__) { - -"use strict"; - -// 21.1.3.25 String.prototype.trim() -__nested_webpack_require_421055__(/*! ./_string-trim */ "./node_modules/core-js/modules/_string-trim.js")('trim', function ($trim) { - return function trim() { - return $trim(this, 3); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.symbol.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/es6.symbol.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_421617__) { - -"use strict"; - -// ECMAScript 6 symbols shim -var global = __nested_webpack_require_421617__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var has = __nested_webpack_require_421617__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); -var DESCRIPTORS = __nested_webpack_require_421617__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); -var $export = __nested_webpack_require_421617__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var redefine = __nested_webpack_require_421617__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); -var META = __nested_webpack_require_421617__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").KEY; -var $fails = __nested_webpack_require_421617__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); -var shared = __nested_webpack_require_421617__(/*! ./_shared */ "./node_modules/core-js/modules/_shared.js"); -var setToStringTag = __nested_webpack_require_421617__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js"); -var uid = __nested_webpack_require_421617__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js"); -var wks = __nested_webpack_require_421617__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js"); -var wksExt = __nested_webpack_require_421617__(/*! ./_wks-ext */ "./node_modules/core-js/modules/_wks-ext.js"); -var wksDefine = __nested_webpack_require_421617__(/*! ./_wks-define */ "./node_modules/core-js/modules/_wks-define.js"); -var enumKeys = __nested_webpack_require_421617__(/*! ./_enum-keys */ "./node_modules/core-js/modules/_enum-keys.js"); -var isArray = __nested_webpack_require_421617__(/*! ./_is-array */ "./node_modules/core-js/modules/_is-array.js"); -var anObject = __nested_webpack_require_421617__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var isObject = __nested_webpack_require_421617__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var toObject = __nested_webpack_require_421617__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); -var toIObject = __nested_webpack_require_421617__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); -var toPrimitive = __nested_webpack_require_421617__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); -var createDesc = __nested_webpack_require_421617__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); -var _create = __nested_webpack_require_421617__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js"); -var gOPNExt = __nested_webpack_require_421617__(/*! ./_object-gopn-ext */ "./node_modules/core-js/modules/_object-gopn-ext.js"); -var $GOPD = __nested_webpack_require_421617__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js"); -var $GOPS = __nested_webpack_require_421617__(/*! ./_object-gops */ "./node_modules/core-js/modules/_object-gops.js"); -var $DP = __nested_webpack_require_421617__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); -var $keys = __nested_webpack_require_421617__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); -var gOPD = $GOPD.f; -var dP = $DP.f; -var gOPN = gOPNExt.f; -var $Symbol = global.Symbol; -var $JSON = global.JSON; -var _stringify = $JSON && $JSON.stringify; -var PROTOTYPE = 'prototype'; -var HIDDEN = wks('_hidden'); -var TO_PRIMITIVE = wks('toPrimitive'); -var isEnum = {}.propertyIsEnumerable; -var SymbolRegistry = shared('symbol-registry'); -var AllSymbols = shared('symbols'); -var OPSymbols = shared('op-symbols'); -var ObjectProto = Object[PROTOTYPE]; -var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f; -var QObject = global.QObject; -// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 -var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; - -// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 -var setSymbolDesc = DESCRIPTORS && $fails(function () { - return _create(dP({}, 'a', { - get: function () { return dP(this, 'a', { value: 7 }).a; } - })).a != 7; -}) ? function (it, key, D) { - var protoDesc = gOPD(ObjectProto, key); - if (protoDesc) delete ObjectProto[key]; - dP(it, key, D); - if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); -} : dP; - -var wrap = function (tag) { - var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); - sym._k = tag; - return sym; -}; - -var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { - return typeof it == 'symbol'; -} : function (it) { - return it instanceof $Symbol; -}; - -var $defineProperty = function defineProperty(it, key, D) { - if (it === ObjectProto) $defineProperty(OPSymbols, key, D); - anObject(it); - key = toPrimitive(key, true); - anObject(D); - if (has(AllSymbols, key)) { - if (!D.enumerable) { - if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); - it[HIDDEN][key] = true; - } else { - if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; - D = _create(D, { enumerable: createDesc(0, false) }); - } return setSymbolDesc(it, key, D); - } return dP(it, key, D); -}; -var $defineProperties = function defineProperties(it, P) { - anObject(it); - var keys = enumKeys(P = toIObject(P)); - var i = 0; - var l = keys.length; - var key; - while (l > i) $defineProperty(it, key = keys[i++], P[key]); - return it; -}; -var $create = function create(it, P) { - return P === undefined ? _create(it) : $defineProperties(_create(it), P); -}; -var $propertyIsEnumerable = function propertyIsEnumerable(key) { - var E = isEnum.call(this, key = toPrimitive(key, true)); - if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; - return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; -}; -var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { - it = toIObject(it); - key = toPrimitive(key, true); - if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; - var D = gOPD(it, key); - if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; - return D; -}; -var $getOwnPropertyNames = function getOwnPropertyNames(it) { - var names = gOPN(toIObject(it)); - var result = []; - var i = 0; - var key; - while (names.length > i) { - if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); - } return result; -}; -var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { - var IS_OP = it === ObjectProto; - var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); - var result = []; - var i = 0; - var key; - while (names.length > i) { - if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); - } return result; -}; - -// 19.4.1.1 Symbol([description]) -if (!USE_NATIVE) { - $Symbol = function Symbol() { - if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); - var tag = uid(arguments.length > 0 ? arguments[0] : undefined); - var $set = function (value) { - if (this === ObjectProto) $set.call(OPSymbols, value); - if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; - setSymbolDesc(this, tag, createDesc(1, value)); - }; - if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); - return wrap(tag); - }; - redefine($Symbol[PROTOTYPE], 'toString', function toString() { - return this._k; - }); - - $GOPD.f = $getOwnPropertyDescriptor; - $DP.f = $defineProperty; - __nested_webpack_require_421617__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f = gOPNExt.f = $getOwnPropertyNames; - __nested_webpack_require_421617__(/*! ./_object-pie */ "./node_modules/core-js/modules/_object-pie.js").f = $propertyIsEnumerable; - $GOPS.f = $getOwnPropertySymbols; - - if (DESCRIPTORS && !__nested_webpack_require_421617__(/*! ./_library */ "./node_modules/core-js/modules/_library.js")) { - redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); - } - - wksExt.f = function (name) { - return wrap(wks(name)); - }; -} - -$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); - -for (var es6Symbols = ( - // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 - 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' -).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]); - -for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); - -$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { - // 19.4.2.1 Symbol.for(key) - 'for': function (key) { - return has(SymbolRegistry, key += '') - ? SymbolRegistry[key] - : SymbolRegistry[key] = $Symbol(key); - }, - // 19.4.2.5 Symbol.keyFor(sym) - keyFor: function keyFor(sym) { - if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); - for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; - }, - useSetter: function () { setter = true; }, - useSimple: function () { setter = false; } -}); - -$export($export.S + $export.F * !USE_NATIVE, 'Object', { - // 19.1.2.2 Object.create(O [, Properties]) - create: $create, - // 19.1.2.4 Object.defineProperty(O, P, Attributes) - defineProperty: $defineProperty, - // 19.1.2.3 Object.defineProperties(O, Properties) - defineProperties: $defineProperties, - // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) - getOwnPropertyDescriptor: $getOwnPropertyDescriptor, - // 19.1.2.7 Object.getOwnPropertyNames(O) - getOwnPropertyNames: $getOwnPropertyNames, - // 19.1.2.8 Object.getOwnPropertySymbols(O) - getOwnPropertySymbols: $getOwnPropertySymbols -}); - -// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives -// https://bugs.chromium.org/p/v8/issues/detail?id=3443 -var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); }); - -$export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', { - getOwnPropertySymbols: function getOwnPropertySymbols(it) { - return $GOPS.f(toObject(it)); - } -}); - -// 24.3.2 JSON.stringify(value [, replacer [, space]]) -$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { - var S = $Symbol(); - // MS Edge converts symbol values to JSON as {} - // WebKit converts symbol values to JSON as null - // V8 throws on boxed symbols - return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; -})), 'JSON', { - stringify: function stringify(it) { - var args = [it]; - var i = 1; - var replacer, $replacer; - while (arguments.length > i) args.push(arguments[i++]); - $replacer = replacer = args[1]; - if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined - if (!isArray(replacer)) replacer = function (key, value) { - if (typeof $replacer == 'function') value = $replacer.call(this, key, value); - if (!isSymbol(value)) return value; - }; - args[1] = replacer; - return _stringify.apply($JSON, args); - } -}); - -// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) -$Symbol[PROTOTYPE][TO_PRIMITIVE] || __nested_webpack_require_421617__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js")($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); -// 19.4.3.5 Symbol.prototype[@@toStringTag] -setToStringTag($Symbol, 'Symbol'); -// 20.2.1.9 Math[@@toStringTag] -setToStringTag(Math, 'Math', true); -// 24.3.3 JSON[@@toStringTag] -setToStringTag(global.JSON, 'JSON', true); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.typed.array-buffer.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.typed.array-buffer.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_433253__) { - -"use strict"; - -var $export = __nested_webpack_require_433253__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $typed = __nested_webpack_require_433253__(/*! ./_typed */ "./node_modules/core-js/modules/_typed.js"); -var buffer = __nested_webpack_require_433253__(/*! ./_typed-buffer */ "./node_modules/core-js/modules/_typed-buffer.js"); -var anObject = __nested_webpack_require_433253__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var toAbsoluteIndex = __nested_webpack_require_433253__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); -var toLength = __nested_webpack_require_433253__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -var isObject = __nested_webpack_require_433253__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var ArrayBuffer = __nested_webpack_require_433253__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").ArrayBuffer; -var speciesConstructor = __nested_webpack_require_433253__(/*! ./_species-constructor */ "./node_modules/core-js/modules/_species-constructor.js"); -var $ArrayBuffer = buffer.ArrayBuffer; -var $DataView = buffer.DataView; -var $isView = $typed.ABV && ArrayBuffer.isView; -var $slice = $ArrayBuffer.prototype.slice; -var VIEW = $typed.VIEW; -var ARRAY_BUFFER = 'ArrayBuffer'; - -$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); - -$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { - // 24.1.3.1 ArrayBuffer.isView(arg) - isView: function isView(it) { - return $isView && $isView(it) || isObject(it) && VIEW in it; - } -}); - -$export($export.P + $export.U + $export.F * __nested_webpack_require_433253__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { - return !new $ArrayBuffer(2).slice(1, undefined).byteLength; -}), ARRAY_BUFFER, { - // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) - slice: function slice(start, end) { - if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix - var len = anObject(this).byteLength; - var first = toAbsoluteIndex(start, len); - var fin = toAbsoluteIndex(end === undefined ? len : end, len); - var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first)); - var viewS = new $DataView(this); - var viewT = new $DataView(result); - var index = 0; - while (first < fin) { - viewT.setUint8(index++, viewS.getUint8(first++)); - } return result; - } -}); - -__nested_webpack_require_433253__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js")(ARRAY_BUFFER); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.typed.data-view.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.typed.data-view.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_436125__) { - -var $export = __nested_webpack_require_436125__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -$export($export.G + $export.W + $export.F * !__nested_webpack_require_436125__(/*! ./_typed */ "./node_modules/core-js/modules/_typed.js").ABV, { - DataView: __nested_webpack_require_436125__(/*! ./_typed-buffer */ "./node_modules/core-js/modules/_typed-buffer.js").DataView -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.typed.float32-array.js": -/*!*****************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.typed.float32-array.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_436853__) { - -__nested_webpack_require_436853__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Float32', 4, function (init) { - return function Float32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.typed.float64-array.js": -/*!*****************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.typed.float64-array.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_437474__) { - -__nested_webpack_require_437474__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Float64', 8, function (init) { - return function Float64Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.typed.int16-array.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.typed.int16-array.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_438087__) { - -__nested_webpack_require_438087__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Int16', 2, function (init) { - return function Int16Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.typed.int32-array.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.typed.int32-array.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_438696__) { - -__nested_webpack_require_438696__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Int32', 4, function (init) { - return function Int32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.typed.int8-array.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.typed.int8-array.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_439301__) { - -__nested_webpack_require_439301__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Int8', 1, function (init) { - return function Int8Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.typed.uint16-array.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.typed.uint16-array.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_439912__) { - -__nested_webpack_require_439912__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Uint16', 2, function (init) { - return function Uint16Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.typed.uint32-array.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.typed.uint32-array.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_440527__) { - -__nested_webpack_require_440527__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Uint32', 4, function (init) { - return function Uint32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.typed.uint8-array.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.typed.uint8-array.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_441138__) { - -__nested_webpack_require_441138__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Uint8', 1, function (init) { - return function Uint8Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.typed.uint8-clamped-array.js": -/*!***********************************************************************!*\ - !*** ./node_modules/core-js/modules/es6.typed.uint8-clamped-array.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_441779__) { - -__nested_webpack_require_441779__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Uint8', 1, function (init) { - return function Uint8ClampedArray(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}, true); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.weak-map.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/es6.weak-map.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_442365__) { - -"use strict"; - -var global = __nested_webpack_require_442365__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var each = __nested_webpack_require_442365__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(0); -var redefine = __nested_webpack_require_442365__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); -var meta = __nested_webpack_require_442365__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js"); -var assign = __nested_webpack_require_442365__(/*! ./_object-assign */ "./node_modules/core-js/modules/_object-assign.js"); -var weak = __nested_webpack_require_442365__(/*! ./_collection-weak */ "./node_modules/core-js/modules/_collection-weak.js"); -var isObject = __nested_webpack_require_442365__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); -var validate = __nested_webpack_require_442365__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); -var NATIVE_WEAK_MAP = __nested_webpack_require_442365__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); -var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global; -var WEAK_MAP = 'WeakMap'; -var getWeak = meta.getWeak; -var isExtensible = Object.isExtensible; -var uncaughtFrozenStore = weak.ufstore; -var InternalMap; - -var wrapper = function (get) { - return function WeakMap() { - return get(this, arguments.length > 0 ? arguments[0] : undefined); - }; -}; - -var methods = { - // 23.3.3.3 WeakMap.prototype.get(key) - get: function get(key) { - if (isObject(key)) { - var data = getWeak(key); - if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key); - return data ? data[this._i] : undefined; - } - }, - // 23.3.3.5 WeakMap.prototype.set(key, value) - set: function set(key, value) { - return weak.def(validate(this, WEAK_MAP), key, value); - } -}; - -// 23.3 WeakMap Objects -var $WeakMap = module.exports = __nested_webpack_require_442365__(/*! ./_collection */ "./node_modules/core-js/modules/_collection.js")(WEAK_MAP, wrapper, methods, weak, true, true); - -// IE11 WeakMap frozen keys fix -if (NATIVE_WEAK_MAP && IS_IE11) { - InternalMap = weak.getConstructor(wrapper, WEAK_MAP); - assign(InternalMap.prototype, methods); - meta.NEED = true; - each(['delete', 'has', 'get', 'set'], function (key) { - var proto = $WeakMap.prototype; - var method = proto[key]; - redefine(proto, key, function (a, b) { - // store frozen objects on internal weakmap shim - if (isObject(a) && !isExtensible(a)) { - if (!this._f) this._f = new InternalMap(); - var result = this._f[key](a, b); - return key == 'set' ? this : result; - // store all the rest on native weakmap - } return method.call(this, a, b); - }); - }); -} - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es6.weak-set.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/es6.weak-set.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_445372__) { - -"use strict"; - -var weak = __nested_webpack_require_445372__(/*! ./_collection-weak */ "./node_modules/core-js/modules/_collection-weak.js"); -var validate = __nested_webpack_require_445372__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); -var WEAK_SET = 'WeakSet'; - -// 23.4 WeakSet Objects -__nested_webpack_require_445372__(/*! ./_collection */ "./node_modules/core-js/modules/_collection.js")(WEAK_SET, function (get) { - return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; -}, { - // 23.4.3.1 WeakSet.prototype.add(value) - add: function add(value) { - return weak.def(validate(this, WEAK_SET), value, true); - } -}, weak, false, true); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.array.flat-map.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.array.flat-map.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_446415__) { - -"use strict"; - -// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap -var $export = __nested_webpack_require_446415__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var flattenIntoArray = __nested_webpack_require_446415__(/*! ./_flatten-into-array */ "./node_modules/core-js/modules/_flatten-into-array.js"); -var toObject = __nested_webpack_require_446415__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); -var toLength = __nested_webpack_require_446415__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -var aFunction = __nested_webpack_require_446415__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); -var arraySpeciesCreate = __nested_webpack_require_446415__(/*! ./_array-species-create */ "./node_modules/core-js/modules/_array-species-create.js"); - -$export($export.P, 'Array', { - flatMap: function flatMap(callbackfn /* , thisArg */) { - var O = toObject(this); - var sourceLen, A; - aFunction(callbackfn); - sourceLen = toLength(O.length); - A = arraySpeciesCreate(O, 0); - flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]); - return A; - } -}); - -__nested_webpack_require_446415__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")('flatMap'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.array.flatten.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.array.flatten.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_447987__) { - -"use strict"; - -// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten -var $export = __nested_webpack_require_447987__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var flattenIntoArray = __nested_webpack_require_447987__(/*! ./_flatten-into-array */ "./node_modules/core-js/modules/_flatten-into-array.js"); -var toObject = __nested_webpack_require_447987__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); -var toLength = __nested_webpack_require_447987__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -var toInteger = __nested_webpack_require_447987__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); -var arraySpeciesCreate = __nested_webpack_require_447987__(/*! ./_array-species-create */ "./node_modules/core-js/modules/_array-species-create.js"); - -$export($export.P, 'Array', { - flatten: function flatten(/* depthArg = 1 */) { - var depthArg = arguments[0]; - var O = toObject(this); - var sourceLen = toLength(O.length); - var A = arraySpeciesCreate(O, 0); - flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); - return A; - } -}); - -__nested_webpack_require_447987__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")('flatten'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.array.includes.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.array.includes.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_449568__) { - -"use strict"; - -// https://github.com/tc39/Array.prototype.includes -var $export = __nested_webpack_require_449568__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $includes = __nested_webpack_require_449568__(/*! ./_array-includes */ "./node_modules/core-js/modules/_array-includes.js")(true); - -$export($export.P, 'Array', { - includes: function includes(el /* , fromIndex = 0 */) { - return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); - } -}); - -__nested_webpack_require_449568__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")('includes'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.asap.js": -/*!**************************************************!*\ - !*** ./node_modules/core-js/modules/es7.asap.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_450471__) { - -// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask -var $export = __nested_webpack_require_450471__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var microtask = __nested_webpack_require_450471__(/*! ./_microtask */ "./node_modules/core-js/modules/_microtask.js")(); -var process = __nested_webpack_require_450471__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").process; -var isNode = __nested_webpack_require_450471__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js")(process) == 'process'; - -$export($export.G, { - asap: function asap(fn) { - var domain = isNode && process.domain; - microtask(domain ? domain.bind(fn) : fn); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.error.is-error.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.error.is-error.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_451517__) { - -// https://github.com/ljharb/proposal-is-error -var $export = __nested_webpack_require_451517__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var cof = __nested_webpack_require_451517__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); - -$export($export.S, 'Error', { - isError: function isError(it) { - return cof(it) === 'Error'; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.global.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/es7.global.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_452181__) { - -// https://github.com/tc39/proposal-global -var $export = __nested_webpack_require_452181__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.G, { global: __nested_webpack_require_452181__(/*! ./_global */ "./node_modules/core-js/modules/_global.js") }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.map.from.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/es7.map.from.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_452773__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from -__nested_webpack_require_452773__(/*! ./_set-collection-from */ "./node_modules/core-js/modules/_set-collection-from.js")('Map'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.map.of.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/es7.map.of.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_453280__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of -__nested_webpack_require_453280__(/*! ./_set-collection-of */ "./node_modules/core-js/modules/_set-collection-of.js")('Map'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.map.to-json.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.map.to-json.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_453801__) { - -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var $export = __nested_webpack_require_453801__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.P + $export.R, 'Map', { toJSON: __nested_webpack_require_453801__(/*! ./_collection-to-json */ "./node_modules/core-js/modules/_collection-to-json.js")('Map') }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.math.clamp.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.math.clamp.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_454467__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __nested_webpack_require_454467__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Math', { - clamp: function clamp(x, lower, upper) { - return Math.min(upper, Math.max(lower, x)); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.math.deg-per-rad.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.math.deg-per-rad.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_455117__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __nested_webpack_require_455117__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.math.degrees.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.math.degrees.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_455683__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __nested_webpack_require_455683__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var RAD_PER_DEG = 180 / Math.PI; - -$export($export.S, 'Math', { - degrees: function degrees(radians) { - return radians * RAD_PER_DEG; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.math.fscale.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.math.fscale.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_456328__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __nested_webpack_require_456328__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var scale = __nested_webpack_require_456328__(/*! ./_math-scale */ "./node_modules/core-js/modules/_math-scale.js"); -var fround = __nested_webpack_require_456328__(/*! ./_math-fround */ "./node_modules/core-js/modules/_math-fround.js"); - -$export($export.S, 'Math', { - fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { - return fround(scale(x, inLow, inHigh, outLow, outHigh)); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.math.iaddh.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.math.iaddh.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_457196__) { - -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = __nested_webpack_require_457196__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Math', { - iaddh: function iaddh(x0, x1, y0, y1) { - var $x0 = x0 >>> 0; - var $x1 = x1 >>> 0; - var $y0 = y0 >>> 0; - return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.math.imulh.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.math.imulh.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_457940__) { - -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = __nested_webpack_require_457940__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Math', { - imulh: function imulh(u, v) { - var UINT16 = 0xffff; - var $u = +u; - var $v = +v; - var u0 = $u & UINT16; - var v0 = $v & UINT16; - var u1 = $u >> 16; - var v1 = $v >> 16; - var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); - return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.math.isubh.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.math.isubh.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_458789__) { - -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = __nested_webpack_require_458789__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Math', { - isubh: function isubh(x0, x1, y0, y1) { - var $x0 = x0 >>> 0; - var $x1 = x1 >>> 0; - var $y0 = y0 >>> 0; - return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.math.rad-per-deg.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.math.rad-per-deg.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_459556__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __nested_webpack_require_459556__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.math.radians.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.math.radians.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_460122__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __nested_webpack_require_460122__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var DEG_PER_RAD = Math.PI / 180; - -$export($export.S, 'Math', { - radians: function radians(degrees) { - return degrees * DEG_PER_RAD; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.math.scale.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.math.scale.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_460763__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __nested_webpack_require_460763__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Math', { scale: __nested_webpack_require_460763__(/*! ./_math-scale */ "./node_modules/core-js/modules/_math-scale.js") }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.math.signbit.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.math.signbit.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_461399__) { - -// http://jfbastien.github.io/papers/Math.signbit.html -var $export = __nested_webpack_require_461399__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Math', { signbit: function signbit(x) { - // eslint-disable-next-line no-self-compare - return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0; -} }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.math.umulh.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.math.umulh.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_462073__) { - -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = __nested_webpack_require_462073__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'Math', { - umulh: function umulh(u, v) { - var UINT16 = 0xffff; - var $u = +u; - var $v = +v; - var u0 = $u & UINT16; - var v0 = $v & UINT16; - var u1 = $u >>> 16; - var v1 = $v >>> 16; - var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); - return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.object.define-getter.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.object.define-getter.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_462966__) { - -"use strict"; - -var $export = __nested_webpack_require_462966__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var toObject = __nested_webpack_require_462966__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); -var aFunction = __nested_webpack_require_462966__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); -var $defineProperty = __nested_webpack_require_462966__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); - -// B.2.2.2 Object.prototype.__defineGetter__(P, getter) -__nested_webpack_require_462966__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && $export($export.P + __nested_webpack_require_462966__(/*! ./_object-forced-pam */ "./node_modules/core-js/modules/_object-forced-pam.js"), 'Object', { - __defineGetter__: function __defineGetter__(P, getter) { - $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true }); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.object.define-setter.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.object.define-setter.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_464248__) { - -"use strict"; - -var $export = __nested_webpack_require_464248__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var toObject = __nested_webpack_require_464248__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); -var aFunction = __nested_webpack_require_464248__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); -var $defineProperty = __nested_webpack_require_464248__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); - -// B.2.2.3 Object.prototype.__defineSetter__(P, setter) -__nested_webpack_require_464248__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && $export($export.P + __nested_webpack_require_464248__(/*! ./_object-forced-pam */ "./node_modules/core-js/modules/_object-forced-pam.js"), 'Object', { - __defineSetter__: function __defineSetter__(P, setter) { - $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true }); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.object.entries.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.object.entries.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_465506__) { - -// https://github.com/tc39/proposal-object-values-entries -var $export = __nested_webpack_require_465506__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $entries = __nested_webpack_require_465506__(/*! ./_object-to-array */ "./node_modules/core-js/modules/_object-to-array.js")(true); - -$export($export.S, 'Object', { - entries: function entries(it) { - return $entries(it); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.object.get-own-property-descriptors.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.object.get-own-property-descriptors.js ***! - \*********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_466326__) { - -// https://github.com/tc39/proposal-object-getownpropertydescriptors -var $export = __nested_webpack_require_466326__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var ownKeys = __nested_webpack_require_466326__(/*! ./_own-keys */ "./node_modules/core-js/modules/_own-keys.js"); -var toIObject = __nested_webpack_require_466326__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); -var gOPD = __nested_webpack_require_466326__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js"); -var createProperty = __nested_webpack_require_466326__(/*! ./_create-property */ "./node_modules/core-js/modules/_create-property.js"); - -$export($export.S, 'Object', { - getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { - var O = toIObject(object); - var getDesc = gOPD.f; - var keys = ownKeys(O); - var result = {}; - var i = 0; - var key, desc; - while (keys.length > i) { - desc = getDesc(O, key = keys[i++]); - if (desc !== undefined) createProperty(result, key, desc); - } - return result; - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.object.lookup-getter.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.object.lookup-getter.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_467725__) { - -"use strict"; - -var $export = __nested_webpack_require_467725__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var toObject = __nested_webpack_require_467725__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); -var toPrimitive = __nested_webpack_require_467725__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); -var getPrototypeOf = __nested_webpack_require_467725__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); -var getOwnPropertyDescriptor = __nested_webpack_require_467725__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js").f; - -// B.2.2.4 Object.prototype.__lookupGetter__(P) -__nested_webpack_require_467725__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && $export($export.P + __nested_webpack_require_467725__(/*! ./_object-forced-pam */ "./node_modules/core-js/modules/_object-forced-pam.js"), 'Object', { - __lookupGetter__: function __lookupGetter__(P) { - var O = toObject(this); - var K = toPrimitive(P, true); - var D; - do { - if (D = getOwnPropertyDescriptor(O, K)) return D.get; - } while (O = getPrototypeOf(O)); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.object.lookup-setter.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.object.lookup-setter.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_469195__) { - -"use strict"; - -var $export = __nested_webpack_require_469195__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var toObject = __nested_webpack_require_469195__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); -var toPrimitive = __nested_webpack_require_469195__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); -var getPrototypeOf = __nested_webpack_require_469195__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); -var getOwnPropertyDescriptor = __nested_webpack_require_469195__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js").f; - -// B.2.2.5 Object.prototype.__lookupSetter__(P) -__nested_webpack_require_469195__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && $export($export.P + __nested_webpack_require_469195__(/*! ./_object-forced-pam */ "./node_modules/core-js/modules/_object-forced-pam.js"), 'Object', { - __lookupSetter__: function __lookupSetter__(P) { - var O = toObject(this); - var K = toPrimitive(P, true); - var D; - do { - if (D = getOwnPropertyDescriptor(O, K)) return D.set; - } while (O = getPrototypeOf(O)); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.object.values.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.object.values.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_470637__) { - -// https://github.com/tc39/proposal-object-values-entries -var $export = __nested_webpack_require_470637__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $values = __nested_webpack_require_470637__(/*! ./_object-to-array */ "./node_modules/core-js/modules/_object-to-array.js")(false); - -$export($export.S, 'Object', { - values: function values(it) { - return $values(it); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.observable.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.observable.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_471354__) { - -"use strict"; - -// https://github.com/zenparsing/es-observable -var $export = __nested_webpack_require_471354__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var global = __nested_webpack_require_471354__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var core = __nested_webpack_require_471354__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); -var microtask = __nested_webpack_require_471354__(/*! ./_microtask */ "./node_modules/core-js/modules/_microtask.js")(); -var OBSERVABLE = __nested_webpack_require_471354__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('observable'); -var aFunction = __nested_webpack_require_471354__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); -var anObject = __nested_webpack_require_471354__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var anInstance = __nested_webpack_require_471354__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); -var redefineAll = __nested_webpack_require_471354__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); -var hide = __nested_webpack_require_471354__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); -var forOf = __nested_webpack_require_471354__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); -var RETURN = forOf.RETURN; - -var getMethod = function (fn) { - return fn == null ? undefined : aFunction(fn); -}; - -var cleanupSubscription = function (subscription) { - var cleanup = subscription._c; - if (cleanup) { - subscription._c = undefined; - cleanup(); - } -}; - -var subscriptionClosed = function (subscription) { - return subscription._o === undefined; -}; - -var closeSubscription = function (subscription) { - if (!subscriptionClosed(subscription)) { - subscription._o = undefined; - cleanupSubscription(subscription); - } -}; - -var Subscription = function (observer, subscriber) { - anObject(observer); - this._c = undefined; - this._o = observer; - observer = new SubscriptionObserver(this); - try { - var cleanup = subscriber(observer); - var subscription = cleanup; - if (cleanup != null) { - if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); }; - else aFunction(cleanup); - this._c = cleanup; - } - } catch (e) { - observer.error(e); - return; - } if (subscriptionClosed(this)) cleanupSubscription(this); -}; - -Subscription.prototype = redefineAll({}, { - unsubscribe: function unsubscribe() { closeSubscription(this); } -}); - -var SubscriptionObserver = function (subscription) { - this._s = subscription; -}; - -SubscriptionObserver.prototype = redefineAll({}, { - next: function next(value) { - var subscription = this._s; - if (!subscriptionClosed(subscription)) { - var observer = subscription._o; - try { - var m = getMethod(observer.next); - if (m) return m.call(observer, value); - } catch (e) { - try { - closeSubscription(subscription); - } finally { - throw e; - } - } - } - }, - error: function error(value) { - var subscription = this._s; - if (subscriptionClosed(subscription)) throw value; - var observer = subscription._o; - subscription._o = undefined; - try { - var m = getMethod(observer.error); - if (!m) throw value; - value = m.call(observer, value); - } catch (e) { - try { - cleanupSubscription(subscription); - } finally { - throw e; - } - } cleanupSubscription(subscription); - return value; - }, - complete: function complete(value) { - var subscription = this._s; - if (!subscriptionClosed(subscription)) { - var observer = subscription._o; - subscription._o = undefined; - try { - var m = getMethod(observer.complete); - value = m ? m.call(observer, value) : undefined; - } catch (e) { - try { - cleanupSubscription(subscription); - } finally { - throw e; - } - } cleanupSubscription(subscription); - return value; - } - } -}); - -var $Observable = function Observable(subscriber) { - anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); -}; - -redefineAll($Observable.prototype, { - subscribe: function subscribe(observer) { - return new Subscription(observer, this._f); - }, - forEach: function forEach(fn) { - var that = this; - return new (core.Promise || global.Promise)(function (resolve, reject) { - aFunction(fn); - var subscription = that.subscribe({ - next: function (value) { - try { - return fn(value); - } catch (e) { - reject(e); - subscription.unsubscribe(); - } - }, - error: reject, - complete: resolve - }); - }); - } -}); - -redefineAll($Observable, { - from: function from(x) { - var C = typeof this === 'function' ? this : $Observable; - var method = getMethod(anObject(x)[OBSERVABLE]); - if (method) { - var observable = anObject(method.call(x)); - return observable.constructor === C ? observable : new C(function (observer) { - return observable.subscribe(observer); - }); - } - return new C(function (observer) { - var done = false; - microtask(function () { - if (!done) { - try { - if (forOf(x, false, function (it) { - observer.next(it); - if (done) return RETURN; - }) === RETURN) return; - } catch (e) { - if (done) throw e; - observer.error(e); - return; - } observer.complete(); - } - }); - return function () { done = true; }; - }); - }, - of: function of() { - for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++]; - return new (typeof this === 'function' ? this : $Observable)(function (observer) { - var done = false; - microtask(function () { - if (!done) { - for (var j = 0; j < items.length; ++j) { - observer.next(items[j]); - if (done) return; - } observer.complete(); - } - }); - return function () { done = true; }; - }); - } -}); - -hide($Observable.prototype, OBSERVABLE, function () { return this; }); - -$export($export.G, { Observable: $Observable }); - -__nested_webpack_require_471354__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js")('Observable'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.promise.finally.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.promise.finally.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_477987__) { - -"use strict"; -// https://github.com/tc39/proposal-promise-finally - -var $export = __nested_webpack_require_477987__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var core = __nested_webpack_require_477987__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); -var global = __nested_webpack_require_477987__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var speciesConstructor = __nested_webpack_require_477987__(/*! ./_species-constructor */ "./node_modules/core-js/modules/_species-constructor.js"); -var promiseResolve = __nested_webpack_require_477987__(/*! ./_promise-resolve */ "./node_modules/core-js/modules/_promise-resolve.js"); - -$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { - var C = speciesConstructor(this, core.Promise || global.Promise); - var isFunction = typeof onFinally == 'function'; - return this.then( - isFunction ? function (x) { - return promiseResolve(C, onFinally()).then(function () { return x; }); - } : onFinally, - isFunction ? function (e) { - return promiseResolve(C, onFinally()).then(function () { throw e; }); - } : onFinally - ); -} }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.promise.try.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.promise.try.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_479424__) { - -"use strict"; - -// https://github.com/tc39/proposal-promise-try -var $export = __nested_webpack_require_479424__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var newPromiseCapability = __nested_webpack_require_479424__(/*! ./_new-promise-capability */ "./node_modules/core-js/modules/_new-promise-capability.js"); -var perform = __nested_webpack_require_479424__(/*! ./_perform */ "./node_modules/core-js/modules/_perform.js"); - -$export($export.S, 'Promise', { 'try': function (callbackfn) { - var promiseCapability = newPromiseCapability.f(this); - var result = perform(callbackfn); - (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); - return promiseCapability.promise; -} }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.reflect.define-metadata.js": -/*!*********************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.reflect.define-metadata.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_480498__) { - -var metadata = __nested_webpack_require_480498__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); -var anObject = __nested_webpack_require_480498__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var toMetaKey = metadata.key; -var ordinaryDefineOwnMetadata = metadata.set; - -metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) { - ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); -} }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.reflect.delete-metadata.js": -/*!*********************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.reflect.delete-metadata.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_481384__) { - -var metadata = __nested_webpack_require_481384__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); -var anObject = __nested_webpack_require_481384__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var toMetaKey = metadata.key; -var getOrCreateMetadataMap = metadata.map; -var store = metadata.store; - -metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { - var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]); - var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); - if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false; - if (metadataMap.size) return true; - var targetMetadata = store.get(target); - targetMetadata['delete'](targetKey); - return !!targetMetadata.size || store['delete'](target); -} }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.reflect.get-metadata-keys.js": -/*!***********************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.reflect.get-metadata-keys.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_482619__) { - -var Set = __nested_webpack_require_482619__(/*! ./es6.set */ "./node_modules/core-js/modules/es6.set.js"); -var from = __nested_webpack_require_482619__(/*! ./_array-from-iterable */ "./node_modules/core-js/modules/_array-from-iterable.js"); -var metadata = __nested_webpack_require_482619__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); -var anObject = __nested_webpack_require_482619__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var getPrototypeOf = __nested_webpack_require_482619__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); -var ordinaryOwnMetadataKeys = metadata.keys; -var toMetaKey = metadata.key; - -var ordinaryMetadataKeys = function (O, P) { - var oKeys = ordinaryOwnMetadataKeys(O, P); - var parent = getPrototypeOf(O); - if (parent === null) return oKeys; - var pKeys = ordinaryMetadataKeys(parent, P); - return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; -}; - -metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) { - return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); -} }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.reflect.get-metadata.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.reflect.get-metadata.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_484113__) { - -var metadata = __nested_webpack_require_484113__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); -var anObject = __nested_webpack_require_484113__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var getPrototypeOf = __nested_webpack_require_484113__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); -var ordinaryHasOwnMetadata = metadata.has; -var ordinaryGetOwnMetadata = metadata.get; -var toMetaKey = metadata.key; - -var ordinaryGetMetadata = function (MetadataKey, O, P) { - var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); - if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P); - var parent = getPrototypeOf(O); - return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; -}; - -metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) { - return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js": -/*!***************************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js ***! - \***************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_485486__) { - -var metadata = __nested_webpack_require_485486__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); -var anObject = __nested_webpack_require_485486__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var ordinaryOwnMetadataKeys = metadata.keys; -var toMetaKey = metadata.key; - -metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { - return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); -} }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.reflect.get-own-metadata.js": -/*!**********************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.reflect.get-own-metadata.js ***! - \**********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_486377__) { - -var metadata = __nested_webpack_require_486377__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); -var anObject = __nested_webpack_require_486377__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var ordinaryGetOwnMetadata = metadata.get; -var toMetaKey = metadata.key; - -metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { - return ordinaryGetOwnMetadata(metadataKey, anObject(target) - , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.reflect.has-metadata.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.reflect.has-metadata.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_487272__) { - -var metadata = __nested_webpack_require_487272__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); -var anObject = __nested_webpack_require_487272__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var getPrototypeOf = __nested_webpack_require_487272__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); -var ordinaryHasOwnMetadata = metadata.has; -var toMetaKey = metadata.key; - -var ordinaryHasMetadata = function (MetadataKey, O, P) { - var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); - if (hasOwn) return true; - var parent = getPrototypeOf(O); - return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; -}; - -metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) { - return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.reflect.has-own-metadata.js": -/*!**********************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.reflect.has-own-metadata.js ***! - \**********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_488541__) { - -var metadata = __nested_webpack_require_488541__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); -var anObject = __nested_webpack_require_488541__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var ordinaryHasOwnMetadata = metadata.has; -var toMetaKey = metadata.key; - -metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { - return ordinaryHasOwnMetadata(metadataKey, anObject(target) - , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.reflect.metadata.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.reflect.metadata.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_489420__) { - -var $metadata = __nested_webpack_require_489420__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); -var anObject = __nested_webpack_require_489420__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); -var aFunction = __nested_webpack_require_489420__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); -var toMetaKey = $metadata.key; -var ordinaryDefineOwnMetadata = $metadata.set; - -$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) { - return function decorator(target, targetKey) { - ordinaryDefineOwnMetadata( - metadataKey, metadataValue, - (targetKey !== undefined ? anObject : aFunction)(target), - toMetaKey(targetKey) - ); - }; -} }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.set.from.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js/modules/es7.set.from.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_490446__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from -__nested_webpack_require_490446__(/*! ./_set-collection-from */ "./node_modules/core-js/modules/_set-collection-from.js")('Set'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.set.of.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/es7.set.of.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_490953__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of -__nested_webpack_require_490953__(/*! ./_set-collection-of */ "./node_modules/core-js/modules/_set-collection-of.js")('Set'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.set.to-json.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.set.to-json.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_491474__) { - -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var $export = __nested_webpack_require_491474__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.P + $export.R, 'Set', { toJSON: __nested_webpack_require_491474__(/*! ./_collection-to-json */ "./node_modules/core-js/modules/_collection-to-json.js")('Set') }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.string.at.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/modules/es7.string.at.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_492136__) { - -"use strict"; - -// https://github.com/mathiasbynens/String.prototype.at -var $export = __nested_webpack_require_492136__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $at = __nested_webpack_require_492136__(/*! ./_string-at */ "./node_modules/core-js/modules/_string-at.js")(true); - -$export($export.P, 'String', { - at: function at(pos) { - return $at(this, pos); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.string.match-all.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.string.match-all.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_492869__) { - -"use strict"; - -// https://tc39.github.io/String.prototype.matchAll/ -var $export = __nested_webpack_require_492869__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var defined = __nested_webpack_require_492869__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); -var toLength = __nested_webpack_require_492869__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -var isRegExp = __nested_webpack_require_492869__(/*! ./_is-regexp */ "./node_modules/core-js/modules/_is-regexp.js"); -var getFlags = __nested_webpack_require_492869__(/*! ./_flags */ "./node_modules/core-js/modules/_flags.js"); -var RegExpProto = RegExp.prototype; - -var $RegExpStringIterator = function (regexp, string) { - this._r = regexp; - this._s = string; -}; - -__nested_webpack_require_492869__(/*! ./_iter-create */ "./node_modules/core-js/modules/_iter-create.js")($RegExpStringIterator, 'RegExp String', function next() { - var match = this._r.exec(this._s); - return { value: match, done: match === null }; -}); - -$export($export.P, 'String', { - matchAll: function matchAll(regexp) { - defined(this); - if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!'); - var S = String(this); - var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp); - var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); - rx.lastIndex = toLength(regexp.lastIndex); - return new $RegExpStringIterator(rx, S); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.string.pad-end.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.string.pad-end.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_494635__) { - -"use strict"; - -// https://github.com/tc39/proposal-string-pad-start-end -var $export = __nested_webpack_require_494635__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $pad = __nested_webpack_require_494635__(/*! ./_string-pad */ "./node_modules/core-js/modules/_string-pad.js"); -var userAgent = __nested_webpack_require_494635__(/*! ./_user-agent */ "./node_modules/core-js/modules/_user-agent.js"); - -// https://github.com/zloirock/core-js/issues/280 -var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent); - -$export($export.P + $export.F * WEBKIT_BUG, 'String', { - padEnd: function padEnd(maxLength /* , fillString = ' ' */) { - return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.string.pad-start.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.string.pad-start.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_495736__) { - -"use strict"; - -// https://github.com/tc39/proposal-string-pad-start-end -var $export = __nested_webpack_require_495736__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $pad = __nested_webpack_require_495736__(/*! ./_string-pad */ "./node_modules/core-js/modules/_string-pad.js"); -var userAgent = __nested_webpack_require_495736__(/*! ./_user-agent */ "./node_modules/core-js/modules/_user-agent.js"); - -// https://github.com/zloirock/core-js/issues/280 -var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent); - -$export($export.P + $export.F * WEBKIT_BUG, 'String', { - padStart: function padStart(maxLength /* , fillString = ' ' */) { - return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); - } -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.string.trim-left.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.string.trim-left.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_496840__) { - -"use strict"; - -// https://github.com/sebmarkbage/ecmascript-string-left-right-trim -__nested_webpack_require_496840__(/*! ./_string-trim */ "./node_modules/core-js/modules/_string-trim.js")('trimLeft', function ($trim) { - return function trimLeft() { - return $trim(this, 1); - }; -}, 'trimStart'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.string.trim-right.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.string.trim-right.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_497498__) { - -"use strict"; - -// https://github.com/sebmarkbage/ecmascript-string-left-right-trim -__nested_webpack_require_497498__(/*! ./_string-trim */ "./node_modules/core-js/modules/_string-trim.js")('trimRight', function ($trim) { - return function trimRight() { - return $trim(this, 2); - }; -}, 'trimEnd'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.symbol.async-iterator.js": -/*!*******************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.symbol.async-iterator.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_498172__) { - -__nested_webpack_require_498172__(/*! ./_wks-define */ "./node_modules/core-js/modules/_wks-define.js")('asyncIterator'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.symbol.observable.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js/modules/es7.symbol.observable.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_498652__) { - -__nested_webpack_require_498652__(/*! ./_wks-define */ "./node_modules/core-js/modules/_wks-define.js")('observable'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.system.global.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.system.global.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_499113__) { - -// https://github.com/tc39/proposal-global -var $export = __nested_webpack_require_499113__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - -$export($export.S, 'System', { global: __nested_webpack_require_499113__(/*! ./_global */ "./node_modules/core-js/modules/_global.js") }); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.weak-map.from.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.weak-map.from.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_499735__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from -__nested_webpack_require_499735__(/*! ./_set-collection-from */ "./node_modules/core-js/modules/_set-collection-from.js")('WeakMap'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.weak-map.of.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.weak-map.of.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_500270__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of -__nested_webpack_require_500270__(/*! ./_set-collection-of */ "./node_modules/core-js/modules/_set-collection-of.js")('WeakMap'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.weak-set.from.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.weak-set.from.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_500807__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from -__nested_webpack_require_500807__(/*! ./_set-collection-from */ "./node_modules/core-js/modules/_set-collection-from.js")('WeakSet'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/es7.weak-set.of.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es7.weak-set.of.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_501342__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of -__nested_webpack_require_501342__(/*! ./_set-collection-of */ "./node_modules/core-js/modules/_set-collection-of.js")('WeakSet'); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/web.dom.iterable.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/modules/web.dom.iterable.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_501875__) { - -var $iterators = __nested_webpack_require_501875__(/*! ./es6.array.iterator */ "./node_modules/core-js/modules/es6.array.iterator.js"); -var getKeys = __nested_webpack_require_501875__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); -var redefine = __nested_webpack_require_501875__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); -var global = __nested_webpack_require_501875__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var hide = __nested_webpack_require_501875__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); -var Iterators = __nested_webpack_require_501875__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); -var wks = __nested_webpack_require_501875__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js"); -var ITERATOR = wks('iterator'); -var TO_STRING_TAG = wks('toStringTag'); -var ArrayValues = Iterators.Array; - -var DOMIterables = { - CSSRuleList: true, // TODO: Not spec compliant, should be false. - CSSStyleDeclaration: false, - CSSValueList: false, - ClientRectList: false, - DOMRectList: false, - DOMStringList: false, - DOMTokenList: true, - DataTransferItemList: false, - FileList: false, - HTMLAllCollection: false, - HTMLCollection: false, - HTMLFormElement: false, - HTMLSelectElement: false, - MediaList: true, // TODO: Not spec compliant, should be false. - MimeTypeArray: false, - NamedNodeMap: false, - NodeList: true, - PaintRequestList: false, - Plugin: false, - PluginArray: false, - SVGLengthList: false, - SVGNumberList: false, - SVGPathSegList: false, - SVGPointList: false, - SVGStringList: false, - SVGTransformList: false, - SourceBufferList: false, - StyleSheetList: true, // TODO: Not spec compliant, should be false. - TextTrackCueList: false, - TextTrackList: false, - TouchList: false -}; - -for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { - var NAME = collections[i]; - var explicit = DOMIterables[NAME]; - var Collection = global[NAME]; - var proto = Collection && Collection.prototype; - var key; - if (proto) { - if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); - if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); - Iterators[NAME] = ArrayValues; - if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true); - } -} - - -/***/ }), - -/***/ "./node_modules/core-js/modules/web.immediate.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js/modules/web.immediate.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_504468__) { - -var $export = __nested_webpack_require_504468__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var $task = __nested_webpack_require_504468__(/*! ./_task */ "./node_modules/core-js/modules/_task.js"); -$export($export.G + $export.B, { - setImmediate: $task.set, - clearImmediate: $task.clear -}); - - -/***/ }), - -/***/ "./node_modules/core-js/modules/web.timers.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js/modules/web.timers.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_505078__) { - -// ie9- setTimeout & setInterval additional parameters fix -var global = __nested_webpack_require_505078__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); -var $export = __nested_webpack_require_505078__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var userAgent = __nested_webpack_require_505078__(/*! ./_user-agent */ "./node_modules/core-js/modules/_user-agent.js"); -var slice = [].slice; -var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check -var wrap = function (set) { - return function (fn, time /* , ...args */) { - var boundArgs = arguments.length > 2; - var args = boundArgs ? slice.call(arguments, 2) : false; - return set(boundArgs ? function () { - // eslint-disable-next-line no-new-func - (typeof fn == 'function' ? fn : Function(fn)).apply(this, args); - } : fn, time); - }; -}; -$export($export.G + $export.B + $export.F * MSIE, { - setTimeout: wrap(global.setTimeout), - setInterval: wrap(global.setInterval) -}); - - -/***/ }), - -/***/ "./node_modules/core-js/shim.js": -/*!**************************************!*\ - !*** ./node_modules/core-js/shim.js ***! - \**************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_506291__) { - -__nested_webpack_require_506291__(/*! ./modules/es6.symbol */ "./node_modules/core-js/modules/es6.symbol.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.object.create */ "./node_modules/core-js/modules/es6.object.create.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.object.define-property */ "./node_modules/core-js/modules/es6.object.define-property.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.object.define-properties */ "./node_modules/core-js/modules/es6.object.define-properties.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.object.get-own-property-descriptor */ "./node_modules/core-js/modules/es6.object.get-own-property-descriptor.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.object.get-prototype-of */ "./node_modules/core-js/modules/es6.object.get-prototype-of.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.object.keys */ "./node_modules/core-js/modules/es6.object.keys.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.object.get-own-property-names */ "./node_modules/core-js/modules/es6.object.get-own-property-names.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.object.freeze */ "./node_modules/core-js/modules/es6.object.freeze.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.object.seal */ "./node_modules/core-js/modules/es6.object.seal.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.object.prevent-extensions */ "./node_modules/core-js/modules/es6.object.prevent-extensions.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.object.is-frozen */ "./node_modules/core-js/modules/es6.object.is-frozen.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.object.is-sealed */ "./node_modules/core-js/modules/es6.object.is-sealed.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.object.is-extensible */ "./node_modules/core-js/modules/es6.object.is-extensible.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.object.assign */ "./node_modules/core-js/modules/es6.object.assign.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.object.is */ "./node_modules/core-js/modules/es6.object.is.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.object.set-prototype-of */ "./node_modules/core-js/modules/es6.object.set-prototype-of.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.object.to-string */ "./node_modules/core-js/modules/es6.object.to-string.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.function.bind */ "./node_modules/core-js/modules/es6.function.bind.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.function.name */ "./node_modules/core-js/modules/es6.function.name.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.function.has-instance */ "./node_modules/core-js/modules/es6.function.has-instance.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.parse-int */ "./node_modules/core-js/modules/es6.parse-int.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.parse-float */ "./node_modules/core-js/modules/es6.parse-float.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.number.constructor */ "./node_modules/core-js/modules/es6.number.constructor.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.number.to-fixed */ "./node_modules/core-js/modules/es6.number.to-fixed.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.number.to-precision */ "./node_modules/core-js/modules/es6.number.to-precision.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.number.epsilon */ "./node_modules/core-js/modules/es6.number.epsilon.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.number.is-finite */ "./node_modules/core-js/modules/es6.number.is-finite.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.number.is-integer */ "./node_modules/core-js/modules/es6.number.is-integer.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.number.is-nan */ "./node_modules/core-js/modules/es6.number.is-nan.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.number.is-safe-integer */ "./node_modules/core-js/modules/es6.number.is-safe-integer.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.number.max-safe-integer */ "./node_modules/core-js/modules/es6.number.max-safe-integer.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.number.min-safe-integer */ "./node_modules/core-js/modules/es6.number.min-safe-integer.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.number.parse-float */ "./node_modules/core-js/modules/es6.number.parse-float.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.number.parse-int */ "./node_modules/core-js/modules/es6.number.parse-int.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.math.acosh */ "./node_modules/core-js/modules/es6.math.acosh.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.math.asinh */ "./node_modules/core-js/modules/es6.math.asinh.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.math.atanh */ "./node_modules/core-js/modules/es6.math.atanh.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.math.cbrt */ "./node_modules/core-js/modules/es6.math.cbrt.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.math.clz32 */ "./node_modules/core-js/modules/es6.math.clz32.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.math.cosh */ "./node_modules/core-js/modules/es6.math.cosh.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.math.expm1 */ "./node_modules/core-js/modules/es6.math.expm1.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.math.fround */ "./node_modules/core-js/modules/es6.math.fround.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.math.hypot */ "./node_modules/core-js/modules/es6.math.hypot.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.math.imul */ "./node_modules/core-js/modules/es6.math.imul.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.math.log10 */ "./node_modules/core-js/modules/es6.math.log10.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.math.log1p */ "./node_modules/core-js/modules/es6.math.log1p.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.math.log2 */ "./node_modules/core-js/modules/es6.math.log2.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.math.sign */ "./node_modules/core-js/modules/es6.math.sign.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.math.sinh */ "./node_modules/core-js/modules/es6.math.sinh.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.math.tanh */ "./node_modules/core-js/modules/es6.math.tanh.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.math.trunc */ "./node_modules/core-js/modules/es6.math.trunc.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.from-code-point */ "./node_modules/core-js/modules/es6.string.from-code-point.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.raw */ "./node_modules/core-js/modules/es6.string.raw.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.trim */ "./node_modules/core-js/modules/es6.string.trim.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.iterator */ "./node_modules/core-js/modules/es6.string.iterator.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.code-point-at */ "./node_modules/core-js/modules/es6.string.code-point-at.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.ends-with */ "./node_modules/core-js/modules/es6.string.ends-with.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.includes */ "./node_modules/core-js/modules/es6.string.includes.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.repeat */ "./node_modules/core-js/modules/es6.string.repeat.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.starts-with */ "./node_modules/core-js/modules/es6.string.starts-with.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.anchor */ "./node_modules/core-js/modules/es6.string.anchor.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.big */ "./node_modules/core-js/modules/es6.string.big.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.blink */ "./node_modules/core-js/modules/es6.string.blink.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.bold */ "./node_modules/core-js/modules/es6.string.bold.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.fixed */ "./node_modules/core-js/modules/es6.string.fixed.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.fontcolor */ "./node_modules/core-js/modules/es6.string.fontcolor.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.fontsize */ "./node_modules/core-js/modules/es6.string.fontsize.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.italics */ "./node_modules/core-js/modules/es6.string.italics.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.link */ "./node_modules/core-js/modules/es6.string.link.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.small */ "./node_modules/core-js/modules/es6.string.small.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.strike */ "./node_modules/core-js/modules/es6.string.strike.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.sub */ "./node_modules/core-js/modules/es6.string.sub.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.string.sup */ "./node_modules/core-js/modules/es6.string.sup.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.date.now */ "./node_modules/core-js/modules/es6.date.now.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.date.to-json */ "./node_modules/core-js/modules/es6.date.to-json.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.date.to-iso-string */ "./node_modules/core-js/modules/es6.date.to-iso-string.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.date.to-string */ "./node_modules/core-js/modules/es6.date.to-string.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.date.to-primitive */ "./node_modules/core-js/modules/es6.date.to-primitive.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.is-array */ "./node_modules/core-js/modules/es6.array.is-array.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.from */ "./node_modules/core-js/modules/es6.array.from.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.of */ "./node_modules/core-js/modules/es6.array.of.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.join */ "./node_modules/core-js/modules/es6.array.join.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.slice */ "./node_modules/core-js/modules/es6.array.slice.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.sort */ "./node_modules/core-js/modules/es6.array.sort.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.for-each */ "./node_modules/core-js/modules/es6.array.for-each.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.map */ "./node_modules/core-js/modules/es6.array.map.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.filter */ "./node_modules/core-js/modules/es6.array.filter.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.some */ "./node_modules/core-js/modules/es6.array.some.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.every */ "./node_modules/core-js/modules/es6.array.every.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.reduce */ "./node_modules/core-js/modules/es6.array.reduce.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.reduce-right */ "./node_modules/core-js/modules/es6.array.reduce-right.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.index-of */ "./node_modules/core-js/modules/es6.array.index-of.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.last-index-of */ "./node_modules/core-js/modules/es6.array.last-index-of.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.copy-within */ "./node_modules/core-js/modules/es6.array.copy-within.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.fill */ "./node_modules/core-js/modules/es6.array.fill.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.find */ "./node_modules/core-js/modules/es6.array.find.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.find-index */ "./node_modules/core-js/modules/es6.array.find-index.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.species */ "./node_modules/core-js/modules/es6.array.species.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.array.iterator */ "./node_modules/core-js/modules/es6.array.iterator.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.regexp.constructor */ "./node_modules/core-js/modules/es6.regexp.constructor.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.regexp.exec */ "./node_modules/core-js/modules/es6.regexp.exec.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.regexp.to-string */ "./node_modules/core-js/modules/es6.regexp.to-string.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.regexp.flags */ "./node_modules/core-js/modules/es6.regexp.flags.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.regexp.match */ "./node_modules/core-js/modules/es6.regexp.match.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.regexp.replace */ "./node_modules/core-js/modules/es6.regexp.replace.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.regexp.search */ "./node_modules/core-js/modules/es6.regexp.search.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.regexp.split */ "./node_modules/core-js/modules/es6.regexp.split.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.promise */ "./node_modules/core-js/modules/es6.promise.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.map */ "./node_modules/core-js/modules/es6.map.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.set */ "./node_modules/core-js/modules/es6.set.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.weak-map */ "./node_modules/core-js/modules/es6.weak-map.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.weak-set */ "./node_modules/core-js/modules/es6.weak-set.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.typed.array-buffer */ "./node_modules/core-js/modules/es6.typed.array-buffer.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.typed.data-view */ "./node_modules/core-js/modules/es6.typed.data-view.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.typed.int8-array */ "./node_modules/core-js/modules/es6.typed.int8-array.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.typed.uint8-array */ "./node_modules/core-js/modules/es6.typed.uint8-array.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.typed.uint8-clamped-array */ "./node_modules/core-js/modules/es6.typed.uint8-clamped-array.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.typed.int16-array */ "./node_modules/core-js/modules/es6.typed.int16-array.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.typed.uint16-array */ "./node_modules/core-js/modules/es6.typed.uint16-array.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.typed.int32-array */ "./node_modules/core-js/modules/es6.typed.int32-array.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.typed.uint32-array */ "./node_modules/core-js/modules/es6.typed.uint32-array.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.typed.float32-array */ "./node_modules/core-js/modules/es6.typed.float32-array.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.typed.float64-array */ "./node_modules/core-js/modules/es6.typed.float64-array.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.reflect.apply */ "./node_modules/core-js/modules/es6.reflect.apply.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.reflect.construct */ "./node_modules/core-js/modules/es6.reflect.construct.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.reflect.define-property */ "./node_modules/core-js/modules/es6.reflect.define-property.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.reflect.delete-property */ "./node_modules/core-js/modules/es6.reflect.delete-property.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.reflect.enumerate */ "./node_modules/core-js/modules/es6.reflect.enumerate.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.reflect.get */ "./node_modules/core-js/modules/es6.reflect.get.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.reflect.get-own-property-descriptor */ "./node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.reflect.get-prototype-of */ "./node_modules/core-js/modules/es6.reflect.get-prototype-of.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.reflect.has */ "./node_modules/core-js/modules/es6.reflect.has.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.reflect.is-extensible */ "./node_modules/core-js/modules/es6.reflect.is-extensible.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.reflect.own-keys */ "./node_modules/core-js/modules/es6.reflect.own-keys.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.reflect.prevent-extensions */ "./node_modules/core-js/modules/es6.reflect.prevent-extensions.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.reflect.set */ "./node_modules/core-js/modules/es6.reflect.set.js"); -__nested_webpack_require_506291__(/*! ./modules/es6.reflect.set-prototype-of */ "./node_modules/core-js/modules/es6.reflect.set-prototype-of.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.array.includes */ "./node_modules/core-js/modules/es7.array.includes.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.array.flat-map */ "./node_modules/core-js/modules/es7.array.flat-map.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.array.flatten */ "./node_modules/core-js/modules/es7.array.flatten.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.string.at */ "./node_modules/core-js/modules/es7.string.at.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.string.pad-start */ "./node_modules/core-js/modules/es7.string.pad-start.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.string.pad-end */ "./node_modules/core-js/modules/es7.string.pad-end.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.string.trim-left */ "./node_modules/core-js/modules/es7.string.trim-left.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.string.trim-right */ "./node_modules/core-js/modules/es7.string.trim-right.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.string.match-all */ "./node_modules/core-js/modules/es7.string.match-all.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.symbol.async-iterator */ "./node_modules/core-js/modules/es7.symbol.async-iterator.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.symbol.observable */ "./node_modules/core-js/modules/es7.symbol.observable.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.object.get-own-property-descriptors */ "./node_modules/core-js/modules/es7.object.get-own-property-descriptors.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.object.values */ "./node_modules/core-js/modules/es7.object.values.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.object.entries */ "./node_modules/core-js/modules/es7.object.entries.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.object.define-getter */ "./node_modules/core-js/modules/es7.object.define-getter.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.object.define-setter */ "./node_modules/core-js/modules/es7.object.define-setter.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.object.lookup-getter */ "./node_modules/core-js/modules/es7.object.lookup-getter.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.object.lookup-setter */ "./node_modules/core-js/modules/es7.object.lookup-setter.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.map.to-json */ "./node_modules/core-js/modules/es7.map.to-json.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.set.to-json */ "./node_modules/core-js/modules/es7.set.to-json.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.map.of */ "./node_modules/core-js/modules/es7.map.of.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.set.of */ "./node_modules/core-js/modules/es7.set.of.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.weak-map.of */ "./node_modules/core-js/modules/es7.weak-map.of.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.weak-set.of */ "./node_modules/core-js/modules/es7.weak-set.of.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.map.from */ "./node_modules/core-js/modules/es7.map.from.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.set.from */ "./node_modules/core-js/modules/es7.set.from.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.weak-map.from */ "./node_modules/core-js/modules/es7.weak-map.from.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.weak-set.from */ "./node_modules/core-js/modules/es7.weak-set.from.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.global */ "./node_modules/core-js/modules/es7.global.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.system.global */ "./node_modules/core-js/modules/es7.system.global.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.error.is-error */ "./node_modules/core-js/modules/es7.error.is-error.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.math.clamp */ "./node_modules/core-js/modules/es7.math.clamp.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.math.deg-per-rad */ "./node_modules/core-js/modules/es7.math.deg-per-rad.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.math.degrees */ "./node_modules/core-js/modules/es7.math.degrees.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.math.fscale */ "./node_modules/core-js/modules/es7.math.fscale.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.math.iaddh */ "./node_modules/core-js/modules/es7.math.iaddh.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.math.isubh */ "./node_modules/core-js/modules/es7.math.isubh.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.math.imulh */ "./node_modules/core-js/modules/es7.math.imulh.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.math.rad-per-deg */ "./node_modules/core-js/modules/es7.math.rad-per-deg.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.math.radians */ "./node_modules/core-js/modules/es7.math.radians.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.math.scale */ "./node_modules/core-js/modules/es7.math.scale.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.math.umulh */ "./node_modules/core-js/modules/es7.math.umulh.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.math.signbit */ "./node_modules/core-js/modules/es7.math.signbit.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.promise.finally */ "./node_modules/core-js/modules/es7.promise.finally.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.promise.try */ "./node_modules/core-js/modules/es7.promise.try.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.reflect.define-metadata */ "./node_modules/core-js/modules/es7.reflect.define-metadata.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.reflect.delete-metadata */ "./node_modules/core-js/modules/es7.reflect.delete-metadata.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.reflect.get-metadata */ "./node_modules/core-js/modules/es7.reflect.get-metadata.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.reflect.get-metadata-keys */ "./node_modules/core-js/modules/es7.reflect.get-metadata-keys.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.reflect.get-own-metadata */ "./node_modules/core-js/modules/es7.reflect.get-own-metadata.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.reflect.get-own-metadata-keys */ "./node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.reflect.has-metadata */ "./node_modules/core-js/modules/es7.reflect.has-metadata.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.reflect.has-own-metadata */ "./node_modules/core-js/modules/es7.reflect.has-own-metadata.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.reflect.metadata */ "./node_modules/core-js/modules/es7.reflect.metadata.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.asap */ "./node_modules/core-js/modules/es7.asap.js"); -__nested_webpack_require_506291__(/*! ./modules/es7.observable */ "./node_modules/core-js/modules/es7.observable.js"); -__nested_webpack_require_506291__(/*! ./modules/web.timers */ "./node_modules/core-js/modules/web.timers.js"); -__nested_webpack_require_506291__(/*! ./modules/web.immediate */ "./node_modules/core-js/modules/web.immediate.js"); -__nested_webpack_require_506291__(/*! ./modules/web.dom.iterable */ "./node_modules/core-js/modules/web.dom.iterable.js"); -module.exports = __nested_webpack_require_506291__(/*! ./modules/_core */ "./node_modules/core-js/modules/_core.js"); - - -/***/ }), - -/***/ "./node_modules/debug/src/browser.js": -/*!*******************************************!*\ - !*** ./node_modules/debug/src/browser.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_529146__) { - -/* eslint-env browser */ - -/** - * This is the web browser implementation of `debug()`. - */ - -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = localstorage(); -exports.destroy = (() => { - let warned = false; - - return () => { - if (!warned) { - warned = true; - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - }; -})(); - -/** - * Colors. - */ - -exports.colors = [ - '#0000CC', - '#0000FF', - '#0033CC', - '#0033FF', - '#0066CC', - '#0066FF', - '#0099CC', - '#0099FF', - '#00CC00', - '#00CC33', - '#00CC66', - '#00CC99', - '#00CCCC', - '#00CCFF', - '#3300CC', - '#3300FF', - '#3333CC', - '#3333FF', - '#3366CC', - '#3366FF', - '#3399CC', - '#3399FF', - '#33CC00', - '#33CC33', - '#33CC66', - '#33CC99', - '#33CCCC', - '#33CCFF', - '#6600CC', - '#6600FF', - '#6633CC', - '#6633FF', - '#66CC00', - '#66CC33', - '#9900CC', - '#9900FF', - '#9933CC', - '#9933FF', - '#99CC00', - '#99CC33', - '#CC0000', - '#CC0033', - '#CC0066', - '#CC0099', - '#CC00CC', - '#CC00FF', - '#CC3300', - '#CC3333', - '#CC3366', - '#CC3399', - '#CC33CC', - '#CC33FF', - '#CC6600', - '#CC6633', - '#CC9900', - '#CC9933', - '#CCCC00', - '#CCCC33', - '#FF0000', - '#FF0033', - '#FF0066', - '#FF0099', - '#FF00CC', - '#FF00FF', - '#FF3300', - '#FF3333', - '#FF3366', - '#FF3399', - '#FF33CC', - '#FF33FF', - '#FF6600', - '#FF6633', - '#FF9900', - '#FF9933', - '#FFCC00', - '#FFCC33' -]; - -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - -// eslint-disable-next-line complexity -function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { - return true; - } - - // Internet Explorer and Edge do not support colors. - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - - // Is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || - // Is firebug? http://stackoverflow.com/a/398120/376773 - (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || - // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || - // Double check webkit in userAgent just in case we are in a worker - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); -} - -/** - * Colorize log arguments if enabled. - * - * @api public - */ - -function formatArgs(args) { - args[0] = (this.useColors ? '%c' : '') + - this.namespace + - (this.useColors ? ' %c' : ' ') + - args[0] + - (this.useColors ? '%c ' : ' ') + - '+' + module.exports.humanize(this.diff); - - if (!this.useColors) { - return; - } - - const c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit'); - - // The final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, match => { - if (match === '%%') { - return; - } - index++; - if (match === '%c') { - // We only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - - args.splice(lastC, 0, c); -} - -/** - * Invokes `console.debug()` when available. - * No-op when `console.debug` is not a "function". - * If `console.debug` is not available, falls back - * to `console.log`. - * - * @api public - */ -exports.log = console.debug || console.log || (() => {}); - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem('debug', namespaces); - } else { - exports.storage.removeItem('debug'); - } - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ -function load() { - let r; - try { - r = exports.storage.getItem('debug'); - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } - - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - if (!r && typeof process !== 'undefined' && 'env' in process) { - r = process.env.DEBUG; - } - - return r; -} - -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - -function localstorage() { - try { - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context - // The Browser also has localStorage in the global context. - return localStorage; - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} - -module.exports = __nested_webpack_require_529146__(/*! ./common */ "./node_modules/debug/src/common.js")(exports); - -const {formatters} = module.exports; - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -formatters.j = function (v) { - try { - return JSON.stringify(v); - } catch (error) { - return '[UnexpectedJSONParseError]: ' + error.message; - } -}; - - -/***/ }), - -/***/ "./node_modules/debug/src/common.js": -/*!******************************************!*\ - !*** ./node_modules/debug/src/common.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_535498__) { - - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - */ - -function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = __nested_webpack_require_535498__(/*! ms */ "./node_modules/ms/index.js"); - createDebug.destroy = destroy; - - Object.keys(env).forEach(key => { - createDebug[key] = env[key]; - }); - - /** - * The currently active debug mode names, and names to skip. - */ - - createDebug.names = []; - createDebug.skips = []; - - /** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ - createDebug.formatters = {}; - - /** - * Selects a color for a debug namespace - * @param {String} namespace The namespace string for the for the debug instance to be colored - * @return {Number|String} An ANSI color code for the given namespace - * @api private - */ - function selectColor(namespace) { - let hash = 0; - - for (let i = 0; i < namespace.length; i++) { - hash = ((hash << 5) - hash) + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } - - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - - /** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - - function debug(...args) { - // Disabled? - if (!debug.enabled) { - return; - } - - const self = debug; - - // Set `diff` timestamp - const curr = Number(new Date()); - const ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - args[0] = createDebug.coerce(args[0]); - - if (typeof args[0] !== 'string') { - // Anything else let's inspect with %O - args.unshift('%O'); - } - - // Apply any `formatters` transformations - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return '%'; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === 'function') { - const val = args[index]; - match = formatter.call(self, val); - - // Now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - // Apply env-specific formatting (colors, etc.) - createDebug.formatArgs.call(self, args); - - const logFn = self.log || createDebug.log; - logFn.apply(self, args); - } - - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend; - debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. - - Object.defineProperty(debug, 'enabled', { - enumerable: true, - configurable: false, - get: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride, - set: v => { - enableOverride = v; - } - }); - - // Env-specific initialization logic for debug instances - if (typeof createDebug.init === 'function') { - createDebug.init(debug); - } - - return debug; - } - - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - - /** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - function enable(namespaces) { - createDebug.save(namespaces); - - createDebug.names = []; - createDebug.skips = []; - - let i; - const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - const len = split.length; - - for (i = 0; i < len; i++) { - if (!split[i]) { - // ignore empty strings - continue; - } - - namespaces = split[i].replace(/\*/g, '.*?'); - - if (namespaces[0] === '-') { - createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - createDebug.names.push(new RegExp('^' + namespaces + '$')); - } - } - } - - /** - * Disable debug output. - * - * @return {String} namespaces - * @api public - */ - function disable() { - const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) - ].join(','); - createDebug.enable(''); - return namespaces; - } - - /** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - function enabled(name) { - if (name[name.length - 1] === '*') { - return true; - } - - let i; - let len; - - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { - return false; - } - } - - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { - return true; - } - } - - return false; - } - - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - function toNamespace(regexp) { - return regexp.toString() - .substring(2, regexp.toString().length - 2) - .replace(/\.\*\?$/, '*'); - } - - /** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - - /** - * XXX DO NOT USE. This is a temporary stub function. - * XXX It WILL be removed in the next major release. - */ - function destroy() { - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - - createDebug.enable(createDebug.load()); - - return createDebug; -} - -module.exports = setup; - - -/***/ }), - -/***/ "./node_modules/debug/src/index.js": -/*!*****************************************!*\ - !*** ./node_modules/debug/src/index.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_541857__) { - -/** - * Detect Electron renderer / nwjs process, which is node, but we should - * treat as a browser. - */ - -if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { - module.exports = __nested_webpack_require_541857__(/*! ./browser.js */ "./node_modules/debug/src/browser.js"); -} else { - module.exports = __nested_webpack_require_541857__(/*! ./node.js */ "./node_modules/debug/src/node.js"); -} - - -/***/ }), - -/***/ "./node_modules/debug/src/node.js": -/*!****************************************!*\ - !*** ./node_modules/debug/src/node.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_542558__) { - -/** - * Module dependencies. - */ - -const tty = __nested_webpack_require_542558__(/*! tty */ "tty"); -const util = __nested_webpack_require_542558__(/*! util */ "util"); - -/** - * This is the Node.js implementation of `debug()`. - */ - -exports.init = init; -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.destroy = util.deprecate( - () => {}, - 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' -); - -/** - * Colors. - */ - -exports.colors = [6, 2, 3, 4, 5, 1]; - -try { - // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) - // eslint-disable-next-line import/no-extraneous-dependencies - const supportsColor = __nested_webpack_require_542558__(/*! supports-color */ "./node_modules/supports-color/index.js"); - - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } -} catch (error) { - // Swallow - we only care if `supports-color` is available; it doesn't have to be. -} - -/** - * Build up the default `inspectOpts` object from the environment variables. - * - * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js - */ - -exports.inspectOpts = Object.keys(process.env).filter(key => { - return /^debug_/i.test(key); -}).reduce((obj, key) => { - // Camel-case - const prop = key - .substring(6) - .toLowerCase() - .replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); - - // Coerce string value into JS value - let val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === 'null') { - val = null; - } else { - val = Number(val); - } - - obj[prop] = val; - return obj; -}, {}); - -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ - -function useColors() { - return 'colors' in exports.inspectOpts ? - Boolean(exports.inspectOpts.colors) : - tty.isatty(process.stderr.fd); -} - -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ - -function formatArgs(args) { - const {namespace: name, useColors} = this; - - if (useColors) { - const c = this.color; - const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); - const prefix = ` ${colorCode};1m${name} \u001B[0m`; - - args[0] = prefix + args[0].split('\n').join('\n' + prefix); - args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); - } else { - args[0] = getDate() + name + ' ' + args[0]; - } -} - -function getDate() { - if (exports.inspectOpts.hideDate) { - return ''; - } - return new Date().toISOString() + ' '; -} - -/** - * Invokes `util.format()` with the specified arguments and writes to stderr. - */ - -function log(...args) { - return process.stderr.write(util.format(...args) + '\n'); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - return process.env.DEBUG; -} - -/** - * Init logic for `debug` instances. - * - * Create a new `inspectOpts` object in case `useColors` is set - * differently for a particular `debug` instance. - */ - -function init(debug) { - debug.inspectOpts = {}; - - const keys = Object.keys(exports.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } -} - -module.exports = __nested_webpack_require_542558__(/*! ./common */ "./node_modules/debug/src/common.js")(exports); - -const {formatters} = module.exports; - -/** - * Map %o to `util.inspect()`, all on a single line. - */ - -formatters.o = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts) - .split('\n') - .map(str => str.trim()) - .join(' '); -}; - -/** - * Map %O to `util.inspect()`, allowing multiple lines if needed. - */ - -formatters.O = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); -}; - - -/***/ }), - -/***/ "./node_modules/delayed-stream/lib/delayed_stream.js": -/*!***********************************************************!*\ - !*** ./node_modules/delayed-stream/lib/delayed_stream.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_547758__) { - -var Stream = __nested_webpack_require_547758__(/*! stream */ "stream").Stream; -var util = __nested_webpack_require_547758__(/*! util */ "util"); - -module.exports = DelayedStream; -function DelayedStream() { - this.source = null; - this.dataSize = 0; - this.maxDataSize = 1024 * 1024; - this.pauseStream = true; - - this._maxDataSizeExceeded = false; - this._released = false; - this._bufferedEvents = []; -} -util.inherits(DelayedStream, Stream); - -DelayedStream.create = function(source, options) { - var delayedStream = new this(); - - options = options || {}; - for (var option in options) { - delayedStream[option] = options[option]; - } - - delayedStream.source = source; - - var realEmit = source.emit; - source.emit = function() { - delayedStream._handleEmit(arguments); - return realEmit.apply(source, arguments); - }; - - source.on('error', function() {}); - if (delayedStream.pauseStream) { - source.pause(); - } - - return delayedStream; -}; - -Object.defineProperty(DelayedStream.prototype, 'readable', { - configurable: true, - enumerable: true, - get: function() { - return this.source.readable; - } -}); - -DelayedStream.prototype.setEncoding = function() { - return this.source.setEncoding.apply(this.source, arguments); -}; - -DelayedStream.prototype.resume = function() { - if (!this._released) { - this.release(); - } - - this.source.resume(); -}; - -DelayedStream.prototype.pause = function() { - this.source.pause(); -}; - -DelayedStream.prototype.release = function() { - this._released = true; - - this._bufferedEvents.forEach(function(args) { - this.emit.apply(this, args); - }.bind(this)); - this._bufferedEvents = []; -}; - -DelayedStream.prototype.pipe = function() { - var r = Stream.prototype.pipe.apply(this, arguments); - this.resume(); - return r; -}; - -DelayedStream.prototype._handleEmit = function(args) { - if (this._released) { - this.emit.apply(this, args); - return; - } - - if (args[0] === 'data') { - this.dataSize += args[1].length; - this._checkIfMaxDataSizeExceeded(); - } - - this._bufferedEvents.push(args); -}; - -DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { - if (this._maxDataSizeExceeded) { - return; - } - - if (this.dataSize <= this.maxDataSize) { - return; - } - - this._maxDataSizeExceeded = true; - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' - this.emit('error', new Error(message)); -}; - - -/***/ }), - -/***/ "./node_modules/follow-redirects/debug.js": -/*!************************************************!*\ - !*** ./node_modules/follow-redirects/debug.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_550439__) { - -var debug; -try { - /* eslint global-require: off */ - debug = __nested_webpack_require_550439__(/*! debug */ "./node_modules/debug/src/index.js")("follow-redirects"); -} -catch (error) { - debug = function () { /* */ }; -} -module.exports = debug; - - -/***/ }), - -/***/ "./node_modules/follow-redirects/index.js": -/*!************************************************!*\ - !*** ./node_modules/follow-redirects/index.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_550981__) { - -var url = __nested_webpack_require_550981__(/*! url */ "url"); -var URL = url.URL; -var http = __nested_webpack_require_550981__(/*! http */ "http"); -var https = __nested_webpack_require_550981__(/*! https */ "https"); -var Writable = __nested_webpack_require_550981__(/*! stream */ "stream").Writable; -var assert = __nested_webpack_require_550981__(/*! assert */ "assert"); -var debug = __nested_webpack_require_550981__(/*! ./debug */ "./node_modules/follow-redirects/debug.js"); - -// Create handlers that pass events from native requests -var eventHandlers = Object.create(null); -["abort", "aborted", "connect", "error", "socket", "timeout"].forEach(function (event) { - eventHandlers[event] = function (arg1, arg2, arg3) { - this._redirectable.emit(event, arg1, arg2, arg3); - }; -}); - -// Error types with codes -var RedirectionError = createErrorType( - "ERR_FR_REDIRECTION_FAILURE", - "" -); -var TooManyRedirectsError = createErrorType( - "ERR_FR_TOO_MANY_REDIRECTS", - "Maximum number of redirects exceeded" -); -var MaxBodyLengthExceededError = createErrorType( - "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", - "Request body larger than maxBodyLength limit" -); -var WriteAfterEndError = createErrorType( - "ERR_STREAM_WRITE_AFTER_END", - "write after end" -); - -// An HTTP(S) request that can be redirected -function RedirectableRequest(options, responseCallback) { - // Initialize the request - Writable.call(this); - this._sanitizeOptions(options); - this._options = options; - this._ended = false; - this._ending = false; - this._redirectCount = 0; - this._redirects = []; - this._requestBodyLength = 0; - this._requestBodyBuffers = []; - - // Attach a callback if passed - if (responseCallback) { - this.on("response", responseCallback); - } - - // React to responses of native requests - var self = this; - this._onNativeResponse = function (response) { - self._processResponse(response); - }; - - // Perform the first request - this._performRequest(); -} -RedirectableRequest.prototype = Object.create(Writable.prototype); - -// Writes buffered data to the current native request -RedirectableRequest.prototype.write = function (data, encoding, callback) { - // Writing is not allowed if end has been called - if (this._ending) { - throw new WriteAfterEndError(); - } - - // Validate input and shift parameters if necessary - if (!(typeof data === "string" || typeof data === "object" && ("length" in data))) { - throw new TypeError("data should be a string, Buffer or Uint8Array"); - } - if (typeof encoding === "function") { - callback = encoding; - encoding = null; - } - - // Ignore empty buffers, since writing them doesn't invoke the callback - // https://github.com/nodejs/node/issues/22066 - if (data.length === 0) { - if (callback) { - callback(); - } - return; - } - // Only write when we don't exceed the maximum body length - if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { - this._requestBodyLength += data.length; - this._requestBodyBuffers.push({ data: data, encoding: encoding }); - this._currentRequest.write(data, encoding, callback); - } - // Error when we exceed the maximum body length - else { - this.emit("error", new MaxBodyLengthExceededError()); - this.abort(); - } -}; - -// Ends the current native request -RedirectableRequest.prototype.end = function (data, encoding, callback) { - // Shift parameters if necessary - if (typeof data === "function") { - callback = data; - data = encoding = null; - } - else if (typeof encoding === "function") { - callback = encoding; - encoding = null; - } - - // Write data if needed and end - if (!data) { - this._ended = this._ending = true; - this._currentRequest.end(null, null, callback); - } - else { - var self = this; - var currentRequest = this._currentRequest; - this.write(data, encoding, function () { - self._ended = true; - currentRequest.end(null, null, callback); - }); - this._ending = true; - } -}; - -// Sets a header value on the current native request -RedirectableRequest.prototype.setHeader = function (name, value) { - this._options.headers[name] = value; - this._currentRequest.setHeader(name, value); -}; - -// Clears a header value on the current native request -RedirectableRequest.prototype.removeHeader = function (name) { - delete this._options.headers[name]; - this._currentRequest.removeHeader(name); -}; - -// Global timeout for all underlying requests -RedirectableRequest.prototype.setTimeout = function (msecs, callback) { - if (callback) { - this.once("timeout", callback); - } - - if (this.socket) { - startTimer(this, msecs); - } - else { - var self = this; - this._currentRequest.once("socket", function () { - startTimer(self, msecs); - }); - } - - this.once("response", clearTimer); - this.once("error", clearTimer); - - return this; -}; - -function startTimer(request, msecs) { - clearTimeout(request._timeout); - request._timeout = setTimeout(function () { - request.emit("timeout"); - }, msecs); -} - -function clearTimer() { - clearTimeout(this._timeout); -} - -// Proxy all other public ClientRequest methods -[ - "abort", "flushHeaders", "getHeader", - "setNoDelay", "setSocketKeepAlive", -].forEach(function (method) { - RedirectableRequest.prototype[method] = function (a, b) { - return this._currentRequest[method](a, b); - }; -}); - -// Proxy all public ClientRequest properties -["aborted", "connection", "socket"].forEach(function (property) { - Object.defineProperty(RedirectableRequest.prototype, property, { - get: function () { return this._currentRequest[property]; }, - }); -}); - -RedirectableRequest.prototype._sanitizeOptions = function (options) { - // Ensure headers are always present - if (!options.headers) { - options.headers = {}; - } - - // Since http.request treats host as an alias of hostname, - // but the url module interprets host as hostname plus port, - // eliminate the host property to avoid confusion. - if (options.host) { - // Use hostname if set, because it has precedence - if (!options.hostname) { - options.hostname = options.host; - } - delete options.host; - } - - // Complete the URL object when necessary - if (!options.pathname && options.path) { - var searchPos = options.path.indexOf("?"); - if (searchPos < 0) { - options.pathname = options.path; - } - else { - options.pathname = options.path.substring(0, searchPos); - options.search = options.path.substring(searchPos); - } - } -}; - - -// Executes the next native request (initial or redirect) -RedirectableRequest.prototype._performRequest = function () { - // Load the native protocol - var protocol = this._options.protocol; - var nativeProtocol = this._options.nativeProtocols[protocol]; - if (!nativeProtocol) { - this.emit("error", new TypeError("Unsupported protocol " + protocol)); - return; - } - - // If specified, use the agent corresponding to the protocol - // (HTTP and HTTPS use different types of agents) - if (this._options.agents) { - var scheme = protocol.substr(0, protocol.length - 1); - this._options.agent = this._options.agents[scheme]; - } - - // Create the native request - var request = this._currentRequest = - nativeProtocol.request(this._options, this._onNativeResponse); - this._currentUrl = url.format(this._options); - - // Set up event handlers - request._redirectable = this; - for (var event in eventHandlers) { - /* istanbul ignore else */ - if (event) { - request.on(event, eventHandlers[event]); - } - } - - // End a redirected request - // (The first request must be ended explicitly with RedirectableRequest#end) - if (this._isRedirect) { - // Write the request entity and end. - var i = 0; - var self = this; - var buffers = this._requestBodyBuffers; - (function writeNext(error) { - // Only write if this request has not been redirected yet - /* istanbul ignore else */ - if (request === self._currentRequest) { - // Report any write errors - /* istanbul ignore if */ - if (error) { - self.emit("error", error); - } - // Write the next buffer if there are still left - else if (i < buffers.length) { - var buffer = buffers[i++]; - /* istanbul ignore else */ - if (!request.finished) { - request.write(buffer.data, buffer.encoding, writeNext); - } - } - // End the request if `end` has been called on us - else if (self._ended) { - request.end(); - } - } - }()); - } -}; - -// Processes a response from the current native request -RedirectableRequest.prototype._processResponse = function (response) { - // Store the redirected response - var statusCode = response.statusCode; - if (this._options.trackRedirects) { - this._redirects.push({ - url: this._currentUrl, - headers: response.headers, - statusCode: statusCode, - }); - } - - // RFC7231§6.4: The 3xx (Redirection) class of status code indicates - // that further action needs to be taken by the user agent in order to - // fulfill the request. If a Location header field is provided, - // the user agent MAY automatically redirect its request to the URI - // referenced by the Location field value, - // even if the specific status code is not understood. - var location = response.headers.location; - if (location && this._options.followRedirects !== false && - statusCode >= 300 && statusCode < 400) { - // Abort the current request - this._currentRequest.removeAllListeners(); - this._currentRequest.on("error", noop); - this._currentRequest.abort(); - // Discard the remainder of the response to avoid waiting for data - response.destroy(); - - // RFC7231§6.4: A client SHOULD detect and intervene - // in cyclical redirections (i.e., "infinite" redirection loops). - if (++this._redirectCount > this._options.maxRedirects) { - this.emit("error", new TooManyRedirectsError()); - return; - } - - // RFC7231§6.4: Automatic redirection needs to done with - // care for methods not known to be safe, […] - // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change - // the request method from POST to GET for the subsequent request. - if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || - // RFC7231§6.4.4: The 303 (See Other) status code indicates that - // the server is redirecting the user agent to a different resource […] - // A user agent can perform a retrieval request targeting that URI - // (a GET or HEAD request if using HTTP) […] - (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { - this._options.method = "GET"; - // Drop a possible entity and headers related to it - this._requestBodyBuffers = []; - removeMatchingHeaders(/^content-/i, this._options.headers); - } - - // Drop the Host header, as the redirect might lead to a different host - var previousHostName = removeMatchingHeaders(/^host$/i, this._options.headers) || - url.parse(this._currentUrl).hostname; - - // Create the redirected request - var redirectUrl = url.resolve(this._currentUrl, location); - debug("redirecting to", redirectUrl); - this._isRedirect = true; - var redirectUrlParts = url.parse(redirectUrl); - Object.assign(this._options, redirectUrlParts); - - // Drop the Authorization header if redirecting to another host - if (redirectUrlParts.hostname !== previousHostName) { - removeMatchingHeaders(/^authorization$/i, this._options.headers); - } - - // Evaluate the beforeRedirect callback - if (typeof this._options.beforeRedirect === "function") { - var responseDetails = { headers: response.headers }; - try { - this._options.beforeRedirect.call(null, this._options, responseDetails); - } - catch (err) { - this.emit("error", err); - return; - } - this._sanitizeOptions(this._options); - } - - // Perform the redirected request - try { - this._performRequest(); - } - catch (cause) { - var error = new RedirectionError("Redirected request failed: " + cause.message); - error.cause = cause; - this.emit("error", error); - } - } - else { - // The response is not a redirect; return it as-is - response.responseUrl = this._currentUrl; - response.redirects = this._redirects; - this.emit("response", response); - - // Clean up - this._requestBodyBuffers = []; - } -}; - -// Wraps the key/value object of protocols with redirect functionality -function wrap(protocols) { - // Default settings - var exports = { - maxRedirects: 21, - maxBodyLength: 10 * 1024 * 1024, - }; - - // Wrap each protocol - var nativeProtocols = {}; - Object.keys(protocols).forEach(function (scheme) { - var protocol = scheme + ":"; - var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; - var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); - - // Executes a request, following redirects - function request(input, options, callback) { - // Parse parameters - if (typeof input === "string") { - var urlStr = input; - try { - input = urlToOptions(new URL(urlStr)); - } - catch (err) { - /* istanbul ignore next */ - input = url.parse(urlStr); - } - } - else if (URL && (input instanceof URL)) { - input = urlToOptions(input); - } - else { - callback = options; - options = input; - input = { protocol: protocol }; - } - if (typeof options === "function") { - callback = options; - options = null; - } - - // Set defaults - options = Object.assign({ - maxRedirects: exports.maxRedirects, - maxBodyLength: exports.maxBodyLength, - }, input, options); - options.nativeProtocols = nativeProtocols; - - assert.equal(options.protocol, protocol, "protocol mismatch"); - debug("options", options); - return new RedirectableRequest(options, callback); - } - - // Executes a GET request, following redirects - function get(input, options, callback) { - var wrappedRequest = wrappedProtocol.request(input, options, callback); - wrappedRequest.end(); - return wrappedRequest; - } - - // Expose the properties on the wrapped protocol - Object.defineProperties(wrappedProtocol, { - request: { value: request, configurable: true, enumerable: true, writable: true }, - get: { value: get, configurable: true, enumerable: true, writable: true }, - }); - }); - return exports; -} - -/* istanbul ignore next */ -function noop() { /* empty */ } - -// from https://github.com/nodejs/node/blob/master/lib/internal/url.js -function urlToOptions(urlObject) { - var options = { - protocol: urlObject.protocol, - hostname: urlObject.hostname.startsWith("[") ? - /* istanbul ignore next */ - urlObject.hostname.slice(1, -1) : - urlObject.hostname, - hash: urlObject.hash, - search: urlObject.search, - pathname: urlObject.pathname, - path: urlObject.pathname + urlObject.search, - href: urlObject.href, - }; - if (urlObject.port !== "") { - options.port = Number(urlObject.port); - } - return options; -} - -function removeMatchingHeaders(regex, headers) { - var lastValue; - for (var header in headers) { - if (regex.test(header)) { - lastValue = headers[header]; - delete headers[header]; - } - } - return lastValue; -} - -function createErrorType(code, defaultMessage) { - function CustomError(message) { - Error.captureStackTrace(this, this.constructor); - this.message = message || defaultMessage; - } - CustomError.prototype = new Error(); - CustomError.prototype.constructor = CustomError; - CustomError.prototype.name = "Error [" + code + "]"; - CustomError.prototype.code = code; - return CustomError; -} - -// Exports -module.exports = wrap({ http: http, https: https }); -module.exports.wrap = wrap; - - -/***/ }), - -/***/ "./node_modules/form-data/lib/form_data.js": -/*!*************************************************!*\ - !*** ./node_modules/form-data/lib/form_data.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_567065__) { - -var CombinedStream = __nested_webpack_require_567065__(/*! combined-stream */ "./node_modules/combined-stream/lib/combined_stream.js"); -var util = __nested_webpack_require_567065__(/*! util */ "util"); -var path = __nested_webpack_require_567065__(/*! path */ "path"); -var http = __nested_webpack_require_567065__(/*! http */ "http"); -var https = __nested_webpack_require_567065__(/*! https */ "https"); -var parseUrl = __nested_webpack_require_567065__(/*! url */ "url").parse; -var fs = __nested_webpack_require_567065__(/*! fs */ "fs"); -var mime = __nested_webpack_require_567065__(/*! mime-types */ "./node_modules/mime-types/index.js"); -var asynckit = __nested_webpack_require_567065__(/*! asynckit */ "./node_modules/asynckit/index.js"); -var populate = __nested_webpack_require_567065__(/*! ./populate.js */ "./node_modules/form-data/lib/populate.js"); - -// Public API -module.exports = FormData; - -// make it a Stream -util.inherits(FormData, CombinedStream); - -/** - * Create readable "multipart/form-data" streams. - * Can be used to submit forms - * and file uploads to other web applications. - * - * @constructor - * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream - */ -function FormData(options) { - if (!(this instanceof FormData)) { - return new FormData(); - } - - this._overheadLength = 0; - this._valueLength = 0; - this._valuesToMeasure = []; - - CombinedStream.call(this); - - options = options || {}; - for (var option in options) { - this[option] = options[option]; - } -} - -FormData.LINE_BREAK = '\r\n'; -FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream'; - -FormData.prototype.append = function(field, value, options) { - - options = options || {}; - - // allow filename as single option - if (typeof options == 'string') { - options = {filename: options}; - } - - var append = CombinedStream.prototype.append.bind(this); - - // all that streamy business can't handle numbers - if (typeof value == 'number') { - value = '' + value; - } - - // https://github.com/felixge/node-form-data/issues/38 - if (util.isArray(value)) { - // Please convert your array into string - // the way web server expects it - this._error(new Error('Arrays are not supported.')); - return; - } - - var header = this._multiPartHeader(field, value, options); - var footer = this._multiPartFooter(); - - append(header); - append(value); - append(footer); - - // pass along options.knownLength - this._trackLength(header, value, options); -}; - -FormData.prototype._trackLength = function(header, value, options) { - var valueLength = 0; - - // used w/ getLengthSync(), when length is known. - // e.g. for streaming directly from a remote server, - // w/ a known file a size, and not wanting to wait for - // incoming file to finish to get its size. - if (options.knownLength != null) { - valueLength += +options.knownLength; - } else if (Buffer.isBuffer(value)) { - valueLength = value.length; - } else if (typeof value === 'string') { - valueLength = Buffer.byteLength(value); - } - - this._valueLength += valueLength; - - // @check why add CRLF? does this account for custom/multiple CRLFs? - this._overheadLength += - Buffer.byteLength(header) + - FormData.LINE_BREAK.length; - - // empty or either doesn't have path or not an http response - if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) { - return; - } - - // no need to bother with the length - if (!options.knownLength) { - this._valuesToMeasure.push(value); - } -}; - -FormData.prototype._lengthRetriever = function(value, callback) { - - if (value.hasOwnProperty('fd')) { - - // take read range into a account - // `end` = Infinity –> read file till the end - // - // TODO: Looks like there is bug in Node fs.createReadStream - // it doesn't respect `end` options without `start` options - // Fix it when node fixes it. - // https://github.com/joyent/node/issues/7819 - if (value.end != undefined && value.end != Infinity && value.start != undefined) { - - // when end specified - // no need to calculate range - // inclusive, starts with 0 - callback(null, value.end + 1 - (value.start ? value.start : 0)); - - // not that fast snoopy - } else { - // still need to fetch file size from fs - fs.stat(value.path, function(err, stat) { - - var fileSize; - - if (err) { - callback(err); - return; - } - - // update final size based on the range options - fileSize = stat.size - (value.start ? value.start : 0); - callback(null, fileSize); - }); - } - - // or http response - } else if (value.hasOwnProperty('httpVersion')) { - callback(null, +value.headers['content-length']); - - // or request stream http://github.com/mikeal/request - } else if (value.hasOwnProperty('httpModule')) { - // wait till response come back - value.on('response', function(response) { - value.pause(); - callback(null, +response.headers['content-length']); - }); - value.resume(); - - // something else - } else { - callback('Unknown stream'); - } -}; - -FormData.prototype._multiPartHeader = function(field, value, options) { - // custom header specified (as string)? - // it becomes responsible for boundary - // (e.g. to handle extra CRLFs on .NET servers) - if (typeof options.header == 'string') { - return options.header; - } - - var contentDisposition = this._getContentDisposition(value, options); - var contentType = this._getContentType(value, options); - - var contents = ''; - var headers = { - // add custom disposition as third element or keep it two elements if not - 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []), - // if no content type. allow it to be empty array - 'Content-Type': [].concat(contentType || []) - }; - - // allow custom headers. - if (typeof options.header == 'object') { - populate(headers, options.header); - } - - var header; - for (var prop in headers) { - if (!headers.hasOwnProperty(prop)) continue; - header = headers[prop]; - - // skip nullish headers. - if (header == null) { - continue; - } - - // convert all headers to arrays. - if (!Array.isArray(header)) { - header = [header]; - } - - // add non-empty headers. - if (header.length) { - contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK; - } - } - - return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; -}; - -FormData.prototype._getContentDisposition = function(value, options) { - - var filename - , contentDisposition - ; - - if (typeof options.filepath === 'string') { - // custom filepath for relative paths - filename = path.normalize(options.filepath).replace(/\\/g, '/'); - } else if (options.filename || value.name || value.path) { - // custom filename take precedence - // formidable and the browser add a name property - // fs- and request- streams have path property - filename = path.basename(options.filename || value.name || value.path); - } else if (value.readable && value.hasOwnProperty('httpVersion')) { - // or try http response - filename = path.basename(value.client._httpMessage.path || ''); - } - - if (filename) { - contentDisposition = 'filename="' + filename + '"'; - } - - return contentDisposition; -}; - -FormData.prototype._getContentType = function(value, options) { - - // use custom content-type above all - var contentType = options.contentType; - - // or try `name` from formidable, browser - if (!contentType && value.name) { - contentType = mime.lookup(value.name); - } - - // or try `path` from fs-, request- streams - if (!contentType && value.path) { - contentType = mime.lookup(value.path); - } - - // or if it's http-reponse - if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) { - contentType = value.headers['content-type']; - } - - // or guess it from the filepath or filename - if (!contentType && (options.filepath || options.filename)) { - contentType = mime.lookup(options.filepath || options.filename); - } - - // fallback to the default content type if `value` is not simple value - if (!contentType && typeof value == 'object') { - contentType = FormData.DEFAULT_CONTENT_TYPE; - } - - return contentType; -}; - -FormData.prototype._multiPartFooter = function() { - return function(next) { - var footer = FormData.LINE_BREAK; - - var lastPart = (this._streams.length === 0); - if (lastPart) { - footer += this._lastBoundary(); - } - - next(footer); - }.bind(this); -}; - -FormData.prototype._lastBoundary = function() { - return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; -}; - -FormData.prototype.getHeaders = function(userHeaders) { - var header; - var formHeaders = { - 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() - }; - - for (header in userHeaders) { - if (userHeaders.hasOwnProperty(header)) { - formHeaders[header.toLowerCase()] = userHeaders[header]; - } - } - - return formHeaders; -}; - -FormData.prototype.getBoundary = function() { - if (!this._boundary) { - this._generateBoundary(); - } - - return this._boundary; -}; - -FormData.prototype.getBuffer = function() { - var dataBuffer = new Buffer.alloc( 0 ); - var boundary = this.getBoundary(); - - // Create the form content. Add Line breaks to the end of data. - for (var i = 0, len = this._streams.length; i < len; i++) { - if (typeof this._streams[i] !== 'function') { - - // Add content to the buffer. - if(Buffer.isBuffer(this._streams[i])) { - dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]); - }else { - dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]); - } - - // Add break after content. - if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) { - dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] ); - } - } - } - - // Add the footer and return the Buffer object. - return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] ); -}; - -FormData.prototype._generateBoundary = function() { - // This generates a 50 character boundary similar to those used by Firefox. - // They are optimized for boyer-moore parsing. - var boundary = '--------------------------'; - for (var i = 0; i < 24; i++) { - boundary += Math.floor(Math.random() * 10).toString(16); - } - - this._boundary = boundary; -}; - -// Note: getLengthSync DOESN'T calculate streams length -// As workaround one can calculate file size manually -// and add it as knownLength option -FormData.prototype.getLengthSync = function() { - var knownLength = this._overheadLength + this._valueLength; - - // Don't get confused, there are 3 "internal" streams for each keyval pair - // so it basically checks if there is any value added to the form - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - - // https://github.com/form-data/form-data/issues/40 - if (!this.hasKnownLength()) { - // Some async length retrievers are present - // therefore synchronous length calculation is false. - // Please use getLength(callback) to get proper length - this._error(new Error('Cannot calculate proper length in synchronous way.')); - } - - return knownLength; -}; - -// Public API to check if length of added values is known -// https://github.com/form-data/form-data/issues/196 -// https://github.com/form-data/form-data/issues/262 -FormData.prototype.hasKnownLength = function() { - var hasKnownLength = true; - - if (this._valuesToMeasure.length) { - hasKnownLength = false; - } - - return hasKnownLength; -}; - -FormData.prototype.getLength = function(cb) { - var knownLength = this._overheadLength + this._valueLength; - - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - - if (!this._valuesToMeasure.length) { - process.nextTick(cb.bind(this, null, knownLength)); - return; - } - - asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { - if (err) { - cb(err); - return; - } - - values.forEach(function(length) { - knownLength += length; - }); - - cb(null, knownLength); - }); -}; - -FormData.prototype.submit = function(params, cb) { - var request - , options - , defaults = {method: 'post'} - ; - - // parse provided url if it's string - // or treat it as options object - if (typeof params == 'string') { - - params = parseUrl(params); - options = populate({ - port: params.port, - path: params.pathname, - host: params.hostname, - protocol: params.protocol - }, defaults); - - // use custom params - } else { - - options = populate(params, defaults); - // if no port provided use default one - if (!options.port) { - options.port = options.protocol == 'https:' ? 443 : 80; - } - } - - // put that good code in getHeaders to some use - options.headers = this.getHeaders(params.headers); - - // https if specified, fallback to http in any other case - if (options.protocol == 'https:') { - request = https.request(options); - } else { - request = http.request(options); - } - - // get content length and fire away - this.getLength(function(err, length) { - if (err) { - this._error(err); - return; - } - - // add content length - request.setHeader('Content-Length', length); - - this.pipe(request); - if (cb) { - request.on('error', cb); - request.on('response', cb.bind(this, null)); - } - }.bind(this)); - - return request; -}; - -FormData.prototype._error = function(err) { - if (!this.error) { - this.error = err; - this.pause(); - this.emit('error', err); - } -}; - -FormData.prototype.toString = function () { - return '[object FormData]'; -}; - - -/***/ }), - -/***/ "./node_modules/form-data/lib/populate.js": -/*!************************************************!*\ - !*** ./node_modules/form-data/lib/populate.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// populates missing values -module.exports = function(dst, src) { - - Object.keys(src).forEach(function(prop) - { - dst[prop] = dst[prop] || src[prop]; - }); - - return dst; -}; - - -/***/ }), - -/***/ "./node_modules/has-flag/index.js": -/*!****************************************!*\ - !*** ./node_modules/has-flag/index.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; - -module.exports = (flag, argv) => { - argv = argv || process.argv; - const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); - const pos = argv.indexOf(prefix + flag); - const terminatorPos = argv.indexOf('--'); - return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); -}; - - -/***/ }), - -/***/ "./node_modules/hi-base32/src/base32.js": -/*!**********************************************!*\ - !*** ./node_modules/hi-base32/src/base32.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_582018__) { - -var __WEBPACK_AMD_DEFINE_RESULT__;/* - * [hi-base32]{@link https://github.com/emn178/hi-base32} - * - * @version 0.5.0 - * @author Chen, Yi-Cyuan [emn178@gmail.com] - * @copyright Chen, Yi-Cyuan 2015-2018 - * @license MIT - */ -/*jslint bitwise: true */ -(function () { - 'use strict'; - - var root = typeof window === 'object' ? window : {}; - var NODE_JS = !root.HI_BASE32_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node; - if (NODE_JS) { - root = global; - } - var COMMON_JS = !root.HI_BASE32_NO_COMMON_JS && typeof module === 'object' && module.exports; - var AMD = true && __nested_webpack_require_582018__(/*! !webpack amd options */ "./node_modules/webpack/buildin/amd-options.js"); - var BASE32_ENCODE_CHAR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'.split(''); - var BASE32_DECODE_CHAR = { - 'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': 6, 'H': 7, 'I': 8, - 'J': 9, 'K': 10, 'L': 11, 'M': 12, 'N': 13, 'O': 14, 'P': 15, 'Q': 16, - 'R': 17, 'S': 18, 'T': 19, 'U': 20, 'V': 21, 'W': 22, 'X': 23, 'Y': 24, - 'Z': 25, '2': 26, '3': 27, '4': 28, '5': 29, '6': 30, '7': 31 - }; - - var blocks = [0, 0, 0, 0, 0, 0, 0, 0]; - - var throwInvalidUtf8 = function (position, partial) { - if (partial.length > 10) { - partial = '...' + partial.substr(-10); - } - var err = new Error('Decoded data is not valid UTF-8.' - + ' Maybe try base32.decode.asBytes()?' - + ' Partial data after reading ' + position + ' bytes: ' + partial + ' <-'); - err.position = position; - throw err; - }; - - var toUtf8String = function (bytes) { - var str = '', length = bytes.length, i = 0, followingChars = 0, b, c; - while (i < length) { - b = bytes[i++]; - if (b <= 0x7F) { - str += String.fromCharCode(b); - continue; - } else if (b > 0xBF && b <= 0xDF) { - c = b & 0x1F; - followingChars = 1; - } else if (b <= 0xEF) { - c = b & 0x0F; - followingChars = 2; - } else if (b <= 0xF7) { - c = b & 0x07; - followingChars = 3; - } else { - throwInvalidUtf8(i, str); - } - - for (var j = 0; j < followingChars; ++j) { - b = bytes[i++]; - if (b < 0x80 || b > 0xBF) { - throwInvalidUtf8(i, str); - } - c <<= 6; - c += b & 0x3F; - } - if (c >= 0xD800 && c <= 0xDFFF) { - throwInvalidUtf8(i, str); - } - if (c > 0x10FFFF) { - throwInvalidUtf8(i, str); - } - - if (c <= 0xFFFF) { - str += String.fromCharCode(c); - } else { - c -= 0x10000; - str += String.fromCharCode((c >> 10) + 0xD800); - str += String.fromCharCode((c & 0x3FF) + 0xDC00); - } - } - return str; - }; - - var decodeAsBytes = function (base32Str) { - if (!/^[A-Z2-7=]+$/.test(base32Str)) { - throw new Error('Invalid base32 characters'); - } - base32Str = base32Str.replace(/=/g, ''); - var v1, v2, v3, v4, v5, v6, v7, v8, bytes = [], index = 0, length = base32Str.length; - - // 4 char to 3 bytes - for (var i = 0, count = length >> 3 << 3; i < count;) { - v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v6 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v7 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v8 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - bytes[index++] = (v1 << 3 | v2 >>> 2) & 255; - bytes[index++] = (v2 << 6 | v3 << 1 | v4 >>> 4) & 255; - bytes[index++] = (v4 << 4 | v5 >>> 1) & 255; - bytes[index++] = (v5 << 7 | v6 << 2 | v7 >>> 3) & 255; - bytes[index++] = (v7 << 5 | v8) & 255; - } - - // remain bytes - var remain = length - count; - if (remain === 2) { - v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - bytes[index++] = (v1 << 3 | v2 >>> 2) & 255; - } else if (remain === 4) { - v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - bytes[index++] = (v1 << 3 | v2 >>> 2) & 255; - bytes[index++] = (v2 << 6 | v3 << 1 | v4 >>> 4) & 255; - } else if (remain === 5) { - v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - bytes[index++] = (v1 << 3 | v2 >>> 2) & 255; - bytes[index++] = (v2 << 6 | v3 << 1 | v4 >>> 4) & 255; - bytes[index++] = (v4 << 4 | v5 >>> 1) & 255; - } else if (remain === 7) { - v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v6 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v7 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - bytes[index++] = (v1 << 3 | v2 >>> 2) & 255; - bytes[index++] = (v2 << 6 | v3 << 1 | v4 >>> 4) & 255; - bytes[index++] = (v4 << 4 | v5 >>> 1) & 255; - bytes[index++] = (v5 << 7 | v6 << 2 | v7 >>> 3) & 255; - } - return bytes; - }; - - var encodeAscii = function (str) { - var v1, v2, v3, v4, v5, base32Str = '', length = str.length; - for (var i = 0, count = parseInt(length / 5) * 5; i < count;) { - v1 = str.charCodeAt(i++); - v2 = str.charCodeAt(i++); - v3 = str.charCodeAt(i++); - v4 = str.charCodeAt(i++); - v5 = str.charCodeAt(i++); - base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + - BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + - BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + - BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] + - BASE32_ENCODE_CHAR[(v3 << 1 | v4 >>> 7) & 31] + - BASE32_ENCODE_CHAR[(v4 >>> 2) & 31] + - BASE32_ENCODE_CHAR[(v4 << 3 | v5 >>> 5) & 31] + - BASE32_ENCODE_CHAR[v5 & 31]; - } - - // remain char - var remain = length - count; - if (remain === 1) { - v1 = str.charCodeAt(i); - base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + - BASE32_ENCODE_CHAR[(v1 << 2) & 31] + - '======'; - } else if (remain === 2) { - v1 = str.charCodeAt(i++); - v2 = str.charCodeAt(i); - base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + - BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + - BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + - BASE32_ENCODE_CHAR[(v2 << 4) & 31] + - '===='; - } else if (remain === 3) { - v1 = str.charCodeAt(i++); - v2 = str.charCodeAt(i++); - v3 = str.charCodeAt(i); - base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + - BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + - BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + - BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] + - BASE32_ENCODE_CHAR[(v3 << 1) & 31] + - '==='; - } else if (remain === 4) { - v1 = str.charCodeAt(i++); - v2 = str.charCodeAt(i++); - v3 = str.charCodeAt(i++); - v4 = str.charCodeAt(i); - base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + - BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + - BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + - BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] + - BASE32_ENCODE_CHAR[(v3 << 1 | v4 >>> 7) & 31] + - BASE32_ENCODE_CHAR[(v4 >>> 2) & 31] + - BASE32_ENCODE_CHAR[(v4 << 3) & 31] + - '='; - } - return base32Str; - }; - - var encodeUtf8 = function (str) { - var v1, v2, v3, v4, v5, code, end = false, base32Str = '', - index = 0, i, start = 0, bytes = 0, length = str.length; - do { - blocks[0] = blocks[5]; - blocks[1] = blocks[6]; - blocks[2] = blocks[7]; - for (i = start; index < length && i < 5; ++index) { - code = str.charCodeAt(index); - if (code < 0x80) { - blocks[i++] = code; - } else if (code < 0x800) { - blocks[i++] = 0xc0 | (code >> 6); - blocks[i++] = 0x80 | (code & 0x3f); - } else if (code < 0xd800 || code >= 0xe000) { - blocks[i++] = 0xe0 | (code >> 12); - blocks[i++] = 0x80 | ((code >> 6) & 0x3f); - blocks[i++] = 0x80 | (code & 0x3f); - } else { - code = 0x10000 + (((code & 0x3ff) << 10) | (str.charCodeAt(++index) & 0x3ff)); - blocks[i++] = 0xf0 | (code >> 18); - blocks[i++] = 0x80 | ((code >> 12) & 0x3f); - blocks[i++] = 0x80 | ((code >> 6) & 0x3f); - blocks[i++] = 0x80 | (code & 0x3f); - } - } - bytes += i - start; - start = i - 5; - if (index === length) { - ++index; - } - if (index > length && i < 6) { - end = true; - } - v1 = blocks[0]; - if (i > 4) { - v2 = blocks[1]; - v3 = blocks[2]; - v4 = blocks[3]; - v5 = blocks[4]; - base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + - BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + - BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + - BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] + - BASE32_ENCODE_CHAR[(v3 << 1 | v4 >>> 7) & 31] + - BASE32_ENCODE_CHAR[(v4 >>> 2) & 31] + - BASE32_ENCODE_CHAR[(v4 << 3 | v5 >>> 5) & 31] + - BASE32_ENCODE_CHAR[v5 & 31]; - } else if (i === 1) { - base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + - BASE32_ENCODE_CHAR[(v1 << 2) & 31] + - '======'; - } else if (i === 2) { - v2 = blocks[1]; - base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + - BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + - BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + - BASE32_ENCODE_CHAR[(v2 << 4) & 31] + - '===='; - } else if (i === 3) { - v2 = blocks[1]; - v3 = blocks[2]; - base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + - BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + - BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + - BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] + - BASE32_ENCODE_CHAR[(v3 << 1) & 31] + - '==='; - } else { - v2 = blocks[1]; - v3 = blocks[2]; - v4 = blocks[3]; - base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + - BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + - BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + - BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] + - BASE32_ENCODE_CHAR[(v3 << 1 | v4 >>> 7) & 31] + - BASE32_ENCODE_CHAR[(v4 >>> 2) & 31] + - BASE32_ENCODE_CHAR[(v4 << 3) & 31] + - '='; - } - } while (!end); - return base32Str; - }; - - var encodeBytes = function (bytes) { - var v1, v2, v3, v4, v5, base32Str = '', length = bytes.length; - for (var i = 0, count = parseInt(length / 5) * 5; i < count;) { - v1 = bytes[i++]; - v2 = bytes[i++]; - v3 = bytes[i++]; - v4 = bytes[i++]; - v5 = bytes[i++]; - base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + - BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + - BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + - BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] + - BASE32_ENCODE_CHAR[(v3 << 1 | v4 >>> 7) & 31] + - BASE32_ENCODE_CHAR[(v4 >>> 2) & 31] + - BASE32_ENCODE_CHAR[(v4 << 3 | v5 >>> 5) & 31] + - BASE32_ENCODE_CHAR[v5 & 31]; - } - - // remain char - var remain = length - count; - if (remain === 1) { - v1 = bytes[i]; - base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + - BASE32_ENCODE_CHAR[(v1 << 2) & 31] + - '======'; - } else if (remain === 2) { - v1 = bytes[i++]; - v2 = bytes[i]; - base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + - BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + - BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + - BASE32_ENCODE_CHAR[(v2 << 4) & 31] + - '===='; - } else if (remain === 3) { - v1 = bytes[i++]; - v2 = bytes[i++]; - v3 = bytes[i]; - base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + - BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + - BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + - BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] + - BASE32_ENCODE_CHAR[(v3 << 1) & 31] + - '==='; - } else if (remain === 4) { - v1 = bytes[i++]; - v2 = bytes[i++]; - v3 = bytes[i++]; - v4 = bytes[i]; - base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + - BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + - BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + - BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] + - BASE32_ENCODE_CHAR[(v3 << 1 | v4 >>> 7) & 31] + - BASE32_ENCODE_CHAR[(v4 >>> 2) & 31] + - BASE32_ENCODE_CHAR[(v4 << 3) & 31] + - '='; - } - return base32Str; - }; - - var encode = function (input, asciiOnly) { - var notString = typeof(input) !== 'string'; - if (notString && input.constructor === ArrayBuffer) { - input = new Uint8Array(input); - } - if (notString) { - return encodeBytes(input); - } else if (asciiOnly) { - return encodeAscii(input); - } else { - return encodeUtf8(input); - } - }; - - var decode = function (base32Str, asciiOnly) { - if (!asciiOnly) { - return toUtf8String(decodeAsBytes(base32Str)); - } - if (!/^[A-Z2-7=]+$/.test(base32Str)) { - throw new Error('Invalid base32 characters'); - } - var v1, v2, v3, v4, v5, v6, v7, v8, str = '', length = base32Str.indexOf('='); - if (length === -1) { - length = base32Str.length; - } - - // 8 char to 5 bytes - for (var i = 0, count = length >> 3 << 3; i < count;) { - v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v6 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v7 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v8 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - str += String.fromCharCode((v1 << 3 | v2 >>> 2) & 255) + - String.fromCharCode((v2 << 6 | v3 << 1 | v4 >>> 4) & 255) + - String.fromCharCode((v4 << 4 | v5 >>> 1) & 255) + - String.fromCharCode((v5 << 7 | v6 << 2 | v7 >>> 3) & 255) + - String.fromCharCode((v7 << 5 | v8) & 255); - } - - // remain bytes - var remain = length - count; - if (remain === 2) { - v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - str += String.fromCharCode((v1 << 3 | v2 >>> 2) & 255); - } else if (remain === 4) { - v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - str += String.fromCharCode((v1 << 3 | v2 >>> 2) & 255) + - String.fromCharCode((v2 << 6 | v3 << 1 | v4 >>> 4) & 255); - } else if (remain === 5) { - v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - str += String.fromCharCode((v1 << 3 | v2 >>> 2) & 255) + - String.fromCharCode((v2 << 6 | v3 << 1 | v4 >>> 4) & 255) + - String.fromCharCode((v4 << 4 | v5 >>> 1) & 255); - } else if (remain === 7) { - v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v6 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - v7 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; - str += String.fromCharCode((v1 << 3 | v2 >>> 2) & 255) + - String.fromCharCode((v2 << 6 | v3 << 1 | v4 >>> 4) & 255) + - String.fromCharCode((v4 << 4 | v5 >>> 1) & 255) + - String.fromCharCode((v5 << 7 | v6 << 2 | v7 >>> 3) & 255); - } - return str; - }; - - var exports = { - encode: encode, - decode: decode - }; - decode.asBytes = decodeAsBytes; - - if (COMMON_JS) { - module.exports = exports; - } else { - root.base32 = exports; - if (AMD) { - !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { - return exports; - }).call(exports, __nested_webpack_require_582018__, exports, module), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } - } -})(); - - -/***/ }), - -/***/ "./node_modules/ip-regex/index.js": -/*!****************************************!*\ - !*** ./node_modules/ip-regex/index.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; - - -const word = '[a-fA-F\\d:]'; -const b = options => options && options.includeBoundaries ? - `(?:(?<=\\s|^)(?=${word})|(?<=${word})(?=\\s|$))` : - ''; - -const v4 = '(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}'; - -const v6seg = '[a-fA-F\\d]{1,4}'; -const v6 = ` -( -(?:${v6seg}:){7}(?:${v6seg}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8 -(?:${v6seg}:){6}(?:${v4}|:${v6seg}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4 -(?:${v6seg}:){5}(?::${v4}|(:${v6seg}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4 -(?:${v6seg}:){4}(?:(:${v6seg}){0,1}:${v4}|(:${v6seg}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4 -(?:${v6seg}:){3}(?:(:${v6seg}){0,2}:${v4}|(:${v6seg}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4 -(?:${v6seg}:){2}(?:(:${v6seg}){0,3}:${v4}|(:${v6seg}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4 -(?:${v6seg}:){1}(?:(:${v6seg}){0,4}:${v4}|(:${v6seg}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4 -(?::((?::${v6seg}){0,5}:${v4}|(?::${v6seg}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4 -)(%[0-9a-zA-Z]{1,})? // %eth0 %1 -`.replace(/\s*\/\/.*$/gm, '').replace(/\n/g, '').trim(); - -const ip = options => options && options.exact ? - new RegExp(`(?:^${v4}$)|(?:^${v6}$)`) : - new RegExp(`(?:${b(options)}${v4}${b(options)})|(?:${b(options)}${v6}${b(options)})`, 'g'); - -ip.v4 = options => options && options.exact ? new RegExp(`^${v4}$`) : new RegExp(`${b(options)}${v4}${b(options)}`, 'g'); -ip.v6 = options => options && options.exact ? new RegExp(`^${v6}$`) : new RegExp(`${b(options)}${v6}${b(options)}`, 'g'); - -module.exports = ip; - - -/***/ }), - -/***/ "./node_modules/ip/lib/ip.js": -/*!***********************************!*\ - !*** ./node_modules/ip/lib/ip.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_601229__) { - -"use strict"; - - -var ip = exports; -var Buffer = __nested_webpack_require_601229__(/*! buffer */ "buffer").Buffer; -var os = __nested_webpack_require_601229__(/*! os */ "os"); - -ip.toBuffer = function(ip, buff, offset) { - offset = ~~offset; - - var result; - - if (this.isV4Format(ip)) { - result = buff || new Buffer(offset + 4); - ip.split(/\./g).map(function(byte) { - result[offset++] = parseInt(byte, 10) & 0xff; - }); - } else if (this.isV6Format(ip)) { - var sections = ip.split(':', 8); - - var i; - for (i = 0; i < sections.length; i++) { - var isv4 = this.isV4Format(sections[i]); - var v4Buffer; - - if (isv4) { - v4Buffer = this.toBuffer(sections[i]); - sections[i] = v4Buffer.slice(0, 2).toString('hex'); - } - - if (v4Buffer && ++i < 8) { - sections.splice(i, 0, v4Buffer.slice(2, 4).toString('hex')); - } - } - - if (sections[0] === '') { - while (sections.length < 8) sections.unshift('0'); - } else if (sections[sections.length - 1] === '') { - while (sections.length < 8) sections.push('0'); - } else if (sections.length < 8) { - for (i = 0; i < sections.length && sections[i] !== ''; i++); - var argv = [ i, 1 ]; - for (i = 9 - sections.length; i > 0; i--) { - argv.push('0'); - } - sections.splice.apply(sections, argv); - } - - result = buff || new Buffer(offset + 16); - for (i = 0; i < sections.length; i++) { - var word = parseInt(sections[i], 16); - result[offset++] = (word >> 8) & 0xff; - result[offset++] = word & 0xff; - } - } - - if (!result) { - throw Error('Invalid ip address: ' + ip); - } - - return result; -}; - -ip.toString = function(buff, offset, length) { - offset = ~~offset; - length = length || (buff.length - offset); - - var result = []; - if (length === 4) { - // IPv4 - for (var i = 0; i < length; i++) { - result.push(buff[offset + i]); - } - result = result.join('.'); - } else if (length === 16) { - // IPv6 - for (var i = 0; i < length; i += 2) { - result.push(buff.readUInt16BE(offset + i).toString(16)); - } - result = result.join(':'); - result = result.replace(/(^|:)0(:0)*:0(:|$)/, '$1::$3'); - result = result.replace(/:{3,4}/, '::'); - } - - return result; -}; - -var ipv4Regex = /^(\d{1,3}\.){3,3}\d{1,3}$/; -var ipv6Regex = - /^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i; - -ip.isV4Format = function(ip) { - return ipv4Regex.test(ip); -}; - -ip.isV6Format = function(ip) { - return ipv6Regex.test(ip); -}; -function _normalizeFamily(family) { - return family ? family.toLowerCase() : 'ipv4'; -} - -ip.fromPrefixLen = function(prefixlen, family) { - if (prefixlen > 32) { - family = 'ipv6'; - } else { - family = _normalizeFamily(family); - } - - var len = 4; - if (family === 'ipv6') { - len = 16; - } - var buff = new Buffer(len); - - for (var i = 0, n = buff.length; i < n; ++i) { - var bits = 8; - if (prefixlen < 8) { - bits = prefixlen; - } - prefixlen -= bits; - - buff[i] = ~(0xff >> bits) & 0xff; - } - - return ip.toString(buff); -}; - -ip.mask = function(addr, mask) { - addr = ip.toBuffer(addr); - mask = ip.toBuffer(mask); - - var result = new Buffer(Math.max(addr.length, mask.length)); - - var i = 0; - // Same protocol - do bitwise and - if (addr.length === mask.length) { - for (i = 0; i < addr.length; i++) { - result[i] = addr[i] & mask[i]; - } - } else if (mask.length === 4) { - // IPv6 address and IPv4 mask - // (Mask low bits) - for (i = 0; i < mask.length; i++) { - result[i] = addr[addr.length - 4 + i] & mask[i]; - } - } else { - // IPv6 mask and IPv4 addr - for (var i = 0; i < result.length - 6; i++) { - result[i] = 0; - } - - // ::ffff:ipv4 - result[10] = 0xff; - result[11] = 0xff; - for (i = 0; i < addr.length; i++) { - result[i + 12] = addr[i] & mask[i + 12]; - } - i = i + 12; - } - for (; i < result.length; i++) - result[i] = 0; - - return ip.toString(result); -}; - -ip.cidr = function(cidrString) { - var cidrParts = cidrString.split('/'); - - var addr = cidrParts[0]; - if (cidrParts.length !== 2) - throw new Error('invalid CIDR subnet: ' + addr); - - var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); - - return ip.mask(addr, mask); -}; - -ip.subnet = function(addr, mask) { - var networkAddress = ip.toLong(ip.mask(addr, mask)); - - // Calculate the mask's length. - var maskBuffer = ip.toBuffer(mask); - var maskLength = 0; - - for (var i = 0; i < maskBuffer.length; i++) { - if (maskBuffer[i] === 0xff) { - maskLength += 8; - } else { - var octet = maskBuffer[i] & 0xff; - while (octet) { - octet = (octet << 1) & 0xff; - maskLength++; - } - } - } - - var numberOfAddresses = Math.pow(2, 32 - maskLength); - - return { - networkAddress: ip.fromLong(networkAddress), - firstAddress: numberOfAddresses <= 2 ? - ip.fromLong(networkAddress) : - ip.fromLong(networkAddress + 1), - lastAddress: numberOfAddresses <= 2 ? - ip.fromLong(networkAddress + numberOfAddresses - 1) : - ip.fromLong(networkAddress + numberOfAddresses - 2), - broadcastAddress: ip.fromLong(networkAddress + numberOfAddresses - 1), - subnetMask: mask, - subnetMaskLength: maskLength, - numHosts: numberOfAddresses <= 2 ? - numberOfAddresses : numberOfAddresses - 2, - length: numberOfAddresses, - contains: function(other) { - return networkAddress === ip.toLong(ip.mask(other, mask)); - } - }; -}; - -ip.cidrSubnet = function(cidrString) { - var cidrParts = cidrString.split('/'); - - var addr = cidrParts[0]; - if (cidrParts.length !== 2) - throw new Error('invalid CIDR subnet: ' + addr); - - var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); - - return ip.subnet(addr, mask); -}; - -ip.not = function(addr) { - var buff = ip.toBuffer(addr); - for (var i = 0; i < buff.length; i++) { - buff[i] = 0xff ^ buff[i]; - } - return ip.toString(buff); -}; - -ip.or = function(a, b) { - a = ip.toBuffer(a); - b = ip.toBuffer(b); - - // same protocol - if (a.length === b.length) { - for (var i = 0; i < a.length; ++i) { - a[i] |= b[i]; - } - return ip.toString(a); - - // mixed protocols - } else { - var buff = a; - var other = b; - if (b.length > a.length) { - buff = b; - other = a; - } - - var offset = buff.length - other.length; - for (var i = offset; i < buff.length; ++i) { - buff[i] |= other[i - offset]; - } - - return ip.toString(buff); - } -}; - -ip.isEqual = function(a, b) { - a = ip.toBuffer(a); - b = ip.toBuffer(b); - - // Same protocol - if (a.length === b.length) { - for (var i = 0; i < a.length; i++) { - if (a[i] !== b[i]) return false; - } - return true; - } - - // Swap - if (b.length === 4) { - var t = b; - b = a; - a = t; - } - - // a - IPv4, b - IPv6 - for (var i = 0; i < 10; i++) { - if (b[i] !== 0) return false; - } - - var word = b.readUInt16BE(10); - if (word !== 0 && word !== 0xffff) return false; - - for (var i = 0; i < 4; i++) { - if (a[i] !== b[i + 12]) return false; - } - - return true; -}; - -ip.isPrivate = function(addr) { - return /^(::f{4}:)?10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i - .test(addr) || - /^(::f{4}:)?192\.168\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || - /^(::f{4}:)?172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})$/i - .test(addr) || - /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || - /^(::f{4}:)?169\.254\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || - /^f[cd][0-9a-f]{2}:/i.test(addr) || - /^fe80:/i.test(addr) || - /^::1$/.test(addr) || - /^::$/.test(addr); -}; - -ip.isPublic = function(addr) { - return !ip.isPrivate(addr); -}; - -ip.isLoopback = function(addr) { - return /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/ - .test(addr) || - /^fe80::1$/.test(addr) || - /^::1$/.test(addr) || - /^::$/.test(addr); -}; - -ip.loopback = function(family) { - // - // Default to `ipv4` - // - family = _normalizeFamily(family); - - if (family !== 'ipv4' && family !== 'ipv6') { - throw new Error('family must be ipv4 or ipv6'); - } - - return family === 'ipv4' ? '127.0.0.1' : 'fe80::1'; -}; - -// -// ### function address (name, family) -// #### @name {string|'public'|'private'} **Optional** Name or security -// of the network interface. -// #### @family {ipv4|ipv6} **Optional** IP family of the address (defaults -// to ipv4). -// -// Returns the address for the network interface on the current system with -// the specified `name`: -// * String: First `family` address of the interface. -// If not found see `undefined`. -// * 'public': the first public ip address of family. -// * 'private': the first private ip address of family. -// * undefined: First address with `ipv4` or loopback address `127.0.0.1`. -// -ip.address = function(name, family) { - var interfaces = os.networkInterfaces(); - var all; - - // - // Default to `ipv4` - // - family = _normalizeFamily(family); - - // - // If a specific network interface has been named, - // return the address. - // - if (name && name !== 'private' && name !== 'public') { - var res = interfaces[name].filter(function(details) { - var itemFamily = details.family.toLowerCase(); - return itemFamily === family; - }); - if (res.length === 0) - return undefined; - return res[0].address; - } - - var all = Object.keys(interfaces).map(function (nic) { - // - // Note: name will only be `public` or `private` - // when this is called. - // - var addresses = interfaces[nic].filter(function (details) { - details.family = details.family.toLowerCase(); - if (details.family !== family || ip.isLoopback(details.address)) { - return false; - } else if (!name) { - return true; - } - - return name === 'public' ? ip.isPrivate(details.address) : - ip.isPublic(details.address); - }); - - return addresses.length ? addresses[0].address : undefined; - }).filter(Boolean); - - return !all.length ? ip.loopback(family) : all[0]; -}; - -ip.toLong = function(ip) { - var ipl = 0; - ip.split('.').forEach(function(octet) { - ipl <<= 8; - ipl += parseInt(octet); - }); - return(ipl >>> 0); -}; - -ip.fromLong = function(ipl) { - return ((ipl >>> 24) + '.' + - (ipl >> 16 & 255) + '.' + - (ipl >> 8 & 255) + '.' + - (ipl & 255) ); -}; - - -/***/ }), - -/***/ "./node_modules/is-ip/index.js": -/*!*************************************!*\ - !*** ./node_modules/is-ip/index.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_611820__) { - -"use strict"; - -const ipRegex = __nested_webpack_require_611820__(/*! ip-regex */ "./node_modules/ip-regex/index.js"); - -const isIp = string => ipRegex({exact: true}).test(string); -isIp.v4 = string => ipRegex.v4({exact: true}).test(string); -isIp.v6 = string => ipRegex.v6({exact: true}).test(string); -isIp.version = string => isIp(string) ? (isIp.v4(string) ? 4 : 6) : undefined; - -module.exports = isIp; - - -/***/ }), - -/***/ "./node_modules/is-ipfs/src/index.js": -/*!*******************************************!*\ - !*** ./node_modules/is-ipfs/src/index.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_612500__) { - -"use strict"; - - -const base58 = __nested_webpack_require_612500__(/*! bs58 */ "./node_modules/bs58/index.js") -const multihash = __nested_webpack_require_612500__(/*! multihashes */ "./node_modules/multihashes/src/index.js") -const multibase = __nested_webpack_require_612500__(/*! multibase */ "./node_modules/multibase/src/index.js") -const Multiaddr = __nested_webpack_require_612500__(/*! multiaddr */ "./node_modules/multiaddr/src/index.js") -const mafmt = __nested_webpack_require_612500__(/*! mafmt */ "./node_modules/mafmt/src/index.js") -const CID = __nested_webpack_require_612500__(/*! cids */ "./node_modules/cids/src/index.js") - -const urlPattern = /^https?:\/\/[^/]+\/(ip(f|n)s)\/((\w+).*)/ -const pathPattern = /^\/(ip(f|n)s)\/((\w+).*)/ -const defaultProtocolMatch = 1 -const defaultHashMath = 4 - -const fqdnPattern = /^https?:\/\/([^/]+)\.(ip(?:f|n)s)\.[^/]+/ -const fqdnHashMatch = 1 -const fqdnProtocolMatch = 2 - -function isMultihash (hash) { - const formatted = convertToString(hash) - try { - const buffer = Buffer.from(base58.decode(formatted)) - multihash.decode(buffer) - return true - } catch (e) { - return false - } -} - -function isMultibase (hash) { - try { - return multibase.isEncoded(hash) - } catch (e) { - return false - } -} - -function isCID (hash) { - try { - new CID(hash) // eslint-disable-line no-new - return true - } catch (e) { - return false - } -} - -function isMultiaddr (input) { - if (!input) return false - if (Multiaddr.isMultiaddr(input)) return true - try { - new Multiaddr(input) // eslint-disable-line no-new - return true - } catch (e) { - return false - } -} - -function isPeerMultiaddr (input) { - return isMultiaddr(input) && mafmt.IPFS.matches(input) -} - -function isIpfs (input, pattern, protocolMatch = defaultProtocolMatch, hashMatch = defaultHashMath) { - const formatted = convertToString(input) - if (!formatted) { - return false - } - - const match = formatted.match(pattern) - if (!match) { - return false - } - - if (match[protocolMatch] !== 'ipfs') { - return false - } - - let hash = match[hashMatch] - - if (hash && pattern === fqdnPattern) { - // when doing checks for subdomain context - // ensure hash is case-insensitive - // (browsers force-lowercase authority compotent anyway) - hash = hash.toLowerCase() - } - - return isCID(hash) -} - -function isIpns (input, pattern, protocolMatch = defaultProtocolMatch, hashMatch) { - const formatted = convertToString(input) - if (!formatted) { - return false - } - const match = formatted.match(pattern) - if (!match) { - return false - } - - if (match[protocolMatch] !== 'ipns') { - return false - } - - if (hashMatch && pattern === fqdnPattern) { - let hash = match[hashMatch] - // when doing checks for subdomain context - // ensure hash is case-insensitive - // (browsers force-lowercase authority compotent anyway) - hash = hash.toLowerCase() - return isCID(hash) - } - - return true -} - -function isString (input) { - return typeof input === 'string' -} - -function convertToString (input) { - if (Buffer.isBuffer(input)) { - return base58.encode(input) - } - - if (isString(input)) { - return input - } - - return false -} - -const ipfsSubdomain = (url) => isIpfs(url, fqdnPattern, fqdnProtocolMatch, fqdnHashMatch) -const ipnsSubdomain = (url) => isIpns(url, fqdnPattern, fqdnProtocolMatch, fqdnHashMatch) - -module.exports = { - multihash: isMultihash, - multiaddr: isMultiaddr, - peerMultiaddr: isPeerMultiaddr, - cid: isCID, - base32cid: (cid) => (isMultibase(cid) === 'base32' && isCID(cid)), - ipfsSubdomain: ipfsSubdomain, - ipnsSubdomain: ipnsSubdomain, - subdomain: (url) => (ipfsSubdomain(url) || ipnsSubdomain(url)), - subdomainPattern: fqdnPattern, - ipfsUrl: (url) => isIpfs(url, urlPattern), - ipnsUrl: (url) => isIpns(url, urlPattern), - url: (url) => (isIpfs(url, urlPattern) || isIpns(url, urlPattern)), - urlPattern: urlPattern, - ipfsPath: (path) => isIpfs(path, pathPattern), - ipnsPath: (path) => isIpns(path, pathPattern), - path: (path) => (isIpfs(path, pathPattern) || isIpns(path, pathPattern)), - pathPattern: pathPattern, - urlOrPath: (x) => (isIpfs(x, urlPattern) || isIpns(x, urlPattern) || isIpfs(x, pathPattern) || isIpns(x, pathPattern)), - cidPath: path => isString(path) && !isCID(path) && isIpfs(`/ipfs/${path}`, pathPattern) -} - - -/***/ }), - -/***/ "./node_modules/mafmt/src/index.js": -/*!*****************************************!*\ - !*** ./node_modules/mafmt/src/index.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_616998__) { - -"use strict"; - - -const multiaddr = __nested_webpack_require_616998__(/*! multiaddr */ "./node_modules/multiaddr/src/index.js") - -/* - * Valid combinations - */ -const DNS4 = base('dns4') -const DNS6 = base('dns6') -const DNS = or( - base('dns'), - base('dnsaddr'), - DNS4, - DNS6 -) - -const IP = or(base('ip4'), base('ip6')) -const TCP = or( - and(IP, base('tcp')), - and(DNS, base('tcp')) -) -const UDP = and(IP, base('udp')) -const UTP = and(UDP, base('utp')) - -const WebSockets = or( - and(TCP, base('ws')), - and(DNS, base('ws')) -) - -const WebSocketsSecure = or( - and(TCP, base('wss')), - and(DNS, base('wss')) -) - -const HTTP = or( - and(TCP, base('http')), - and(IP, base('http')), - and(DNS, base('http')) -) - -const HTTPS = or( - and(TCP, base('https')), - and(IP, base('https')), - and(DNS, base('https')) -) - -const WebRTCStar = or( - and(WebSockets, base('p2p-webrtc-star'), base('p2p')), - and(WebSocketsSecure, base('p2p-webrtc-star'), base('p2p')), - and(WebSockets, base('p2p-webrtc-star')), - and(WebSocketsSecure, base('p2p-webrtc-star')) -) - -const WebSocketStar = or( - and(WebSockets, base('p2p-websocket-star'), base('p2p')), - and(WebSocketsSecure, base('p2p-websocket-star'), base('p2p')), - and(WebSockets, base('p2p-websocket-star')), - and(WebSocketsSecure, base('p2p-websocket-star')) -) - -const WebRTCDirect = or( - and(HTTP, base('p2p-webrtc-direct')), - and(HTTPS, base('p2p-webrtc-direct')) -) - -const Reliable = or( - WebSockets, - WebSocketsSecure, - HTTP, - HTTPS, - WebRTCStar, - WebRTCDirect, - TCP, - UTP -) - -// Unlike ws-star, stardust can run over any transport thus removing the requirement for websockets (but don't even think about running a stardust server over webrtc-star ;) ) -const Stardust = or( - and(Reliable, base('p2p-stardust'), base('p2p')), - and(Reliable, base('p2p-stardust')) -) - -const _P2P = or( - and(Reliable, base('p2p')), - WebRTCStar, - base('p2p') -) - -const _Circuit = or( - and(_P2P, base('p2p-circuit'), _P2P), - and(_P2P, base('p2p-circuit')), - and(base('p2p-circuit'), _P2P), - and(Reliable, base('p2p-circuit')), - and(base('p2p-circuit'), Reliable), - base('p2p-circuit') -) - -const CircuitRecursive = () => or( - and(_Circuit, CircuitRecursive), - _Circuit -) - -const Circuit = CircuitRecursive() - -const P2P = or( - and(Circuit, _P2P, Circuit), - and(_P2P, Circuit), - and(Circuit, _P2P), - Circuit, - _P2P -) - -exports.DNS = DNS -exports.DNS4 = DNS4 -exports.DNS6 = DNS6 -exports.IP = IP -exports.TCP = TCP -exports.UDP = UDP -exports.UTP = UTP -exports.HTTP = HTTP -exports.HTTPS = HTTPS -exports.WebSockets = WebSockets -exports.WebSocketsSecure = WebSocketsSecure -exports.WebSocketStar = WebSocketStar -exports.WebRTCStar = WebRTCStar -exports.WebRTCDirect = WebRTCDirect -exports.Reliable = Reliable -exports.Stardust = Stardust -exports.Circuit = Circuit -exports.P2P = P2P -exports.IPFS = P2P - -/* - * Validation funcs - */ - -function makeMatchesFunction (partialMatch) { - return function matches (a) { - if (!multiaddr.isMultiaddr(a)) { - try { - a = multiaddr(a) - } catch (err) { // catch error - return false // also if it's invalid it's propably not matching as well so return false - } - } - const out = partialMatch(a.protoNames()) - if (out === null) { - return false - } - return out.length === 0 - } -} - -function and () { - const args = Array.from(arguments) - function partialMatch (a) { - if (a.length < args.length) { - return null - } - args.some((arg) => { - a = typeof arg === 'function' - ? arg().partialMatch(a) - : arg.partialMatch(a) - - if (a === null) { - return true - } - }) - - return a - } - - return { - toString: function () { return '{ ' + args.join(' ') + ' }' }, - input: args, - matches: makeMatchesFunction(partialMatch), - partialMatch: partialMatch - } -} - -function or () { - const args = Array.from(arguments) - - function partialMatch (a) { - let out = null - args.some((arg) => { - const res = typeof arg === 'function' - ? arg().partialMatch(a) - : arg.partialMatch(a) - if (res) { - out = res - return true - } - }) - - return out - } - - const result = { - toString: function () { return '{ ' + args.join(' ') + ' }' }, - input: args, - matches: makeMatchesFunction(partialMatch), - partialMatch: partialMatch - } - - return result -} - -function base (n) { - const name = n - - function matches (a) { - if (typeof a === 'string') { - try { - a = multiaddr(a) - } catch (err) { // catch error - return false // also if it's invalid it's propably not matching as well so return false - } - } - - const pnames = a.protoNames() - if (pnames.length === 1 && pnames[0] === name) { - return true - } - return false - } - - function partialMatch (protos) { - if (protos.length === 0) { - return null - } - - if (protos[0] === name) { - return protos.slice(1) - } - return null - } - - return { - toString: function () { return name }, - matches: matches, - partialMatch: partialMatch - } -} - - -/***/ }), - -/***/ "./node_modules/mime-db/db.json": -/*!**************************************!*\ - !*** ./node_modules/mime-db/db.json ***! - \**************************************/ -/*! exports provided: application/1d-interleaved-parityfec, application/3gpdash-qoe-report+xml, application/3gpp-ims+xml, application/a2l, application/activemessage, application/activity+json, application/alto-costmap+json, application/alto-costmapfilter+json, application/alto-directory+json, application/alto-endpointcost+json, application/alto-endpointcostparams+json, application/alto-endpointprop+json, application/alto-endpointpropparams+json, application/alto-error+json, application/alto-networkmap+json, application/alto-networkmapfilter+json, application/aml, application/andrew-inset, application/applefile, application/applixware, application/atf, application/atfx, application/atom+xml, application/atomcat+xml, application/atomdeleted+xml, application/atomicmail, application/atomsvc+xml, application/atsc-dwd+xml, application/atsc-held+xml, application/atsc-rdt+json, application/atsc-rsat+xml, application/atxml, application/auth-policy+xml, application/bacnet-xdd+zip, application/batch-smtp, application/bdoc, application/beep+xml, application/calendar+json, application/calendar+xml, application/call-completion, application/cals-1840, application/cbor, application/cbor-seq, application/cccex, application/ccmp+xml, application/ccxml+xml, application/cdfx+xml, application/cdmi-capability, application/cdmi-container, application/cdmi-domain, application/cdmi-object, application/cdmi-queue, application/cdni, application/cea, application/cea-2018+xml, application/cellml+xml, application/cfw, application/clue+xml, application/clue_info+xml, application/cms, application/cnrp+xml, application/coap-group+json, application/coap-payload, application/commonground, application/conference-info+xml, application/cose, application/cose-key, application/cose-key-set, application/cpl+xml, application/csrattrs, application/csta+xml, application/cstadata+xml, application/csvm+json, application/cu-seeme, application/cwt, application/cybercash, application/dart, application/dash+xml, application/dashdelta, application/davmount+xml, application/dca-rft, application/dcd, application/dec-dx, application/dialog-info+xml, application/dicom, application/dicom+json, application/dicom+xml, application/dii, application/dit, application/dns, application/dns+json, application/dns-message, application/docbook+xml, application/dskpp+xml, application/dssc+der, application/dssc+xml, application/dvcs, application/ecmascript, application/edi-consent, application/edi-x12, application/edifact, application/efi, application/emergencycalldata.comment+xml, application/emergencycalldata.control+xml, application/emergencycalldata.deviceinfo+xml, application/emergencycalldata.ecall.msd, application/emergencycalldata.providerinfo+xml, application/emergencycalldata.serviceinfo+xml, application/emergencycalldata.subscriberinfo+xml, application/emergencycalldata.veds+xml, application/emma+xml, application/emotionml+xml, application/encaprtp, application/epp+xml, application/epub+zip, application/eshop, application/exi, application/expect-ct-report+json, application/fastinfoset, application/fastsoap, application/fdt+xml, application/fhir+json, application/fhir+xml, application/fido.trusted-apps+json, application/fits, application/flexfec, application/font-sfnt, application/font-tdpfr, application/font-woff, application/framework-attributes+xml, application/geo+json, application/geo+json-seq, application/geopackage+sqlite3, application/geoxacml+xml, application/gltf-buffer, application/gml+xml, application/gpx+xml, application/gxf, application/gzip, application/h224, application/held+xml, application/hjson, application/http, application/hyperstudio, application/ibe-key-request+xml, application/ibe-pkg-reply+xml, application/ibe-pp-data, application/iges, application/im-iscomposing+xml, application/index, application/index.cmd, application/index.obj, application/index.response, application/index.vnd, application/inkml+xml, application/iotp, application/ipfix, application/ipp, application/isup, application/its+xml, application/java-archive, application/java-serialized-object, application/java-vm, application/javascript, application/jf2feed+json, application/jose, application/jose+json, application/jrd+json, application/json, application/json-patch+json, application/json-seq, application/json5, application/jsonml+json, application/jwk+json, application/jwk-set+json, application/jwt, application/kpml-request+xml, application/kpml-response+xml, application/ld+json, application/lgr+xml, application/link-format, application/load-control+xml, application/lost+xml, application/lostsync+xml, application/lxf, application/mac-binhex40, application/mac-compactpro, application/macwriteii, application/mads+xml, application/manifest+json, application/marc, application/marcxml+xml, application/mathematica, application/mathml+xml, application/mathml-content+xml, application/mathml-presentation+xml, application/mbms-associated-procedure-description+xml, application/mbms-deregister+xml, application/mbms-envelope+xml, application/mbms-msk+xml, application/mbms-msk-response+xml, application/mbms-protection-description+xml, application/mbms-reception-report+xml, application/mbms-register+xml, application/mbms-register-response+xml, application/mbms-schedule+xml, application/mbms-user-service-description+xml, application/mbox, application/media-policy-dataset+xml, application/media_control+xml, application/mediaservercontrol+xml, application/merge-patch+json, application/metalink+xml, application/metalink4+xml, application/mets+xml, application/mf4, application/mikey, application/mipc, application/mmt-aei+xml, application/mmt-usd+xml, application/mods+xml, application/moss-keys, application/moss-signature, application/mosskey-data, application/mosskey-request, application/mp21, application/mp4, application/mpeg4-generic, application/mpeg4-iod, application/mpeg4-iod-xmt, application/mrb-consumer+xml, application/mrb-publish+xml, application/msc-ivr+xml, application/msc-mixer+xml, application/msword, application/mud+json, application/multipart-core, application/mxf, application/n-quads, application/n-triples, application/nasdata, application/news-checkgroups, application/news-groupinfo, application/news-transmission, application/nlsml+xml, application/node, application/nss, application/ocsp-request, application/ocsp-response, application/octet-stream, application/oda, application/odm+xml, application/odx, application/oebps-package+xml, application/ogg, application/omdoc+xml, application/onenote, application/oscore, application/oxps, application/p2p-overlay+xml, application/parityfec, application/passport, application/patch-ops-error+xml, application/pdf, application/pdx, application/pem-certificate-chain, application/pgp-encrypted, application/pgp-keys, application/pgp-signature, application/pics-rules, application/pidf+xml, application/pidf-diff+xml, application/pkcs10, application/pkcs12, application/pkcs7-mime, application/pkcs7-signature, application/pkcs8, application/pkcs8-encrypted, application/pkix-attr-cert, application/pkix-cert, application/pkix-crl, application/pkix-pkipath, application/pkixcmp, application/pls+xml, application/poc-settings+xml, application/postscript, application/ppsp-tracker+json, application/problem+json, application/problem+xml, application/provenance+xml, application/prs.alvestrand.titrax-sheet, application/prs.cww, application/prs.hpub+zip, application/prs.nprend, application/prs.plucker, application/prs.rdf-xml-crypt, application/prs.xsf+xml, application/pskc+xml, application/qsig, application/raml+yaml, application/raptorfec, application/rdap+json, application/rdf+xml, application/reginfo+xml, application/relax-ng-compact-syntax, application/remote-printing, application/reputon+json, application/resource-lists+xml, application/resource-lists-diff+xml, application/rfc+xml, application/riscos, application/rlmi+xml, application/rls-services+xml, application/route-apd+xml, application/route-s-tsid+xml, application/route-usd+xml, application/rpki-ghostbusters, application/rpki-manifest, application/rpki-publication, application/rpki-roa, application/rpki-updown, application/rsd+xml, application/rss+xml, application/rtf, application/rtploopback, application/rtx, application/samlassertion+xml, application/samlmetadata+xml, application/sbml+xml, application/scaip+xml, application/scim+json, application/scvp-cv-request, application/scvp-cv-response, application/scvp-vp-request, application/scvp-vp-response, application/sdp, application/secevent+jwt, application/senml+cbor, application/senml+json, application/senml+xml, application/senml-exi, application/sensml+cbor, application/sensml+json, application/sensml+xml, application/sensml-exi, application/sep+xml, application/sep-exi, application/session-info, application/set-payment, application/set-payment-initiation, application/set-registration, application/set-registration-initiation, application/sgml, application/sgml-open-catalog, application/shf+xml, application/sieve, application/simple-filter+xml, application/simple-message-summary, application/simplesymbolcontainer, application/sipc, application/slate, application/smil, application/smil+xml, application/smpte336m, application/soap+fastinfoset, application/soap+xml, application/sparql-query, application/sparql-results+xml, application/spirits-event+xml, application/sql, application/srgs, application/srgs+xml, application/sru+xml, application/ssdl+xml, application/ssml+xml, application/stix+json, application/swid+xml, application/tamp-apex-update, application/tamp-apex-update-confirm, application/tamp-community-update, application/tamp-community-update-confirm, application/tamp-error, application/tamp-sequence-adjust, application/tamp-sequence-adjust-confirm, application/tamp-status-query, application/tamp-status-response, application/tamp-update, application/tamp-update-confirm, application/tar, application/taxii+json, application/tei+xml, application/tetra_isi, application/thraud+xml, application/timestamp-query, application/timestamp-reply, application/timestamped-data, application/tlsrpt+gzip, application/tlsrpt+json, application/tnauthlist, application/toml, application/trickle-ice-sdpfrag, application/trig, application/ttml+xml, application/tve-trigger, application/tzif, application/tzif-leap, application/ulpfec, application/urc-grpsheet+xml, application/urc-ressheet+xml, application/urc-targetdesc+xml, application/urc-uisocketdesc+xml, application/vcard+json, application/vcard+xml, application/vemmi, application/vividence.scriptfile, application/vnd.1000minds.decision-model+xml, application/vnd.3gpp-prose+xml, application/vnd.3gpp-prose-pc3ch+xml, application/vnd.3gpp-v2x-local-service-information, application/vnd.3gpp.access-transfer-events+xml, application/vnd.3gpp.bsf+xml, application/vnd.3gpp.gmop+xml, application/vnd.3gpp.mc-signalling-ear, application/vnd.3gpp.mcdata-affiliation-command+xml, application/vnd.3gpp.mcdata-info+xml, application/vnd.3gpp.mcdata-payload, application/vnd.3gpp.mcdata-service-config+xml, application/vnd.3gpp.mcdata-signalling, application/vnd.3gpp.mcdata-ue-config+xml, application/vnd.3gpp.mcdata-user-profile+xml, application/vnd.3gpp.mcptt-affiliation-command+xml, application/vnd.3gpp.mcptt-floor-request+xml, application/vnd.3gpp.mcptt-info+xml, application/vnd.3gpp.mcptt-location-info+xml, application/vnd.3gpp.mcptt-mbms-usage-info+xml, application/vnd.3gpp.mcptt-service-config+xml, application/vnd.3gpp.mcptt-signed+xml, application/vnd.3gpp.mcptt-ue-config+xml, application/vnd.3gpp.mcptt-ue-init-config+xml, application/vnd.3gpp.mcptt-user-profile+xml, application/vnd.3gpp.mcvideo-affiliation-command+xml, application/vnd.3gpp.mcvideo-affiliation-info+xml, application/vnd.3gpp.mcvideo-info+xml, application/vnd.3gpp.mcvideo-location-info+xml, application/vnd.3gpp.mcvideo-mbms-usage-info+xml, application/vnd.3gpp.mcvideo-service-config+xml, application/vnd.3gpp.mcvideo-transmission-request+xml, application/vnd.3gpp.mcvideo-ue-config+xml, application/vnd.3gpp.mcvideo-user-profile+xml, application/vnd.3gpp.mid-call+xml, application/vnd.3gpp.pic-bw-large, application/vnd.3gpp.pic-bw-small, application/vnd.3gpp.pic-bw-var, application/vnd.3gpp.sms, application/vnd.3gpp.sms+xml, application/vnd.3gpp.srvcc-ext+xml, application/vnd.3gpp.srvcc-info+xml, application/vnd.3gpp.state-and-event-info+xml, application/vnd.3gpp.ussd+xml, application/vnd.3gpp2.bcmcsinfo+xml, application/vnd.3gpp2.sms, application/vnd.3gpp2.tcap, application/vnd.3lightssoftware.imagescal, application/vnd.3m.post-it-notes, application/vnd.accpac.simply.aso, application/vnd.accpac.simply.imp, application/vnd.acucobol, application/vnd.acucorp, application/vnd.adobe.air-application-installer-package+zip, application/vnd.adobe.flash.movie, application/vnd.adobe.formscentral.fcdt, application/vnd.adobe.fxp, application/vnd.adobe.partial-upload, application/vnd.adobe.xdp+xml, application/vnd.adobe.xfdf, application/vnd.aether.imp, application/vnd.afpc.afplinedata, application/vnd.afpc.afplinedata-pagedef, application/vnd.afpc.foca-charset, application/vnd.afpc.foca-codedfont, application/vnd.afpc.foca-codepage, application/vnd.afpc.modca, application/vnd.afpc.modca-formdef, application/vnd.afpc.modca-mediummap, application/vnd.afpc.modca-objectcontainer, application/vnd.afpc.modca-overlay, application/vnd.afpc.modca-pagesegment, application/vnd.ah-barcode, application/vnd.ahead.space, application/vnd.airzip.filesecure.azf, application/vnd.airzip.filesecure.azs, application/vnd.amadeus+json, application/vnd.amazon.ebook, application/vnd.amazon.mobi8-ebook, application/vnd.americandynamics.acc, application/vnd.amiga.ami, application/vnd.amundsen.maze+xml, application/vnd.android.ota, application/vnd.android.package-archive, application/vnd.anki, application/vnd.anser-web-certificate-issue-initiation, application/vnd.anser-web-funds-transfer-initiation, application/vnd.antix.game-component, application/vnd.apache.thrift.binary, application/vnd.apache.thrift.compact, application/vnd.apache.thrift.json, application/vnd.api+json, application/vnd.aplextor.warrp+json, application/vnd.apothekende.reservation+json, application/vnd.apple.installer+xml, application/vnd.apple.keynote, application/vnd.apple.mpegurl, application/vnd.apple.numbers, application/vnd.apple.pages, application/vnd.apple.pkpass, application/vnd.arastra.swi, application/vnd.aristanetworks.swi, application/vnd.artisan+json, application/vnd.artsquare, application/vnd.astraea-software.iota, application/vnd.audiograph, application/vnd.autopackage, application/vnd.avalon+json, application/vnd.avistar+xml, application/vnd.balsamiq.bmml+xml, application/vnd.balsamiq.bmpr, application/vnd.banana-accounting, application/vnd.bbf.usp.error, application/vnd.bbf.usp.msg, application/vnd.bbf.usp.msg+json, application/vnd.bekitzur-stech+json, application/vnd.bint.med-content, application/vnd.biopax.rdf+xml, application/vnd.blink-idb-value-wrapper, application/vnd.blueice.multipass, application/vnd.bluetooth.ep.oob, application/vnd.bluetooth.le.oob, application/vnd.bmi, application/vnd.bpf, application/vnd.bpf3, application/vnd.businessobjects, application/vnd.byu.uapi+json, application/vnd.cab-jscript, application/vnd.canon-cpdl, application/vnd.canon-lips, application/vnd.capasystems-pg+json, application/vnd.cendio.thinlinc.clientconf, application/vnd.century-systems.tcp_stream, application/vnd.chemdraw+xml, application/vnd.chess-pgn, application/vnd.chipnuts.karaoke-mmd, application/vnd.ciedi, application/vnd.cinderella, application/vnd.cirpack.isdn-ext, application/vnd.citationstyles.style+xml, application/vnd.claymore, application/vnd.cloanto.rp9, application/vnd.clonk.c4group, application/vnd.cluetrust.cartomobile-config, application/vnd.cluetrust.cartomobile-config-pkg, application/vnd.coffeescript, application/vnd.collabio.xodocuments.document, application/vnd.collabio.xodocuments.document-template, application/vnd.collabio.xodocuments.presentation, application/vnd.collabio.xodocuments.presentation-template, application/vnd.collabio.xodocuments.spreadsheet, application/vnd.collabio.xodocuments.spreadsheet-template, application/vnd.collection+json, application/vnd.collection.doc+json, application/vnd.collection.next+json, application/vnd.comicbook+zip, application/vnd.comicbook-rar, application/vnd.commerce-battelle, application/vnd.commonspace, application/vnd.contact.cmsg, application/vnd.coreos.ignition+json, application/vnd.cosmocaller, application/vnd.crick.clicker, application/vnd.crick.clicker.keyboard, application/vnd.crick.clicker.palette, application/vnd.crick.clicker.template, application/vnd.crick.clicker.wordbank, application/vnd.criticaltools.wbs+xml, application/vnd.cryptii.pipe+json, application/vnd.crypto-shade-file, application/vnd.ctc-posml, application/vnd.ctct.ws+xml, application/vnd.cups-pdf, application/vnd.cups-postscript, application/vnd.cups-ppd, application/vnd.cups-raster, application/vnd.cups-raw, application/vnd.curl, application/vnd.curl.car, application/vnd.curl.pcurl, application/vnd.cyan.dean.root+xml, application/vnd.cybank, application/vnd.d2l.coursepackage1p0+zip, application/vnd.dart, application/vnd.data-vision.rdz, application/vnd.datapackage+json, application/vnd.dataresource+json, application/vnd.debian.binary-package, application/vnd.dece.data, application/vnd.dece.ttml+xml, application/vnd.dece.unspecified, application/vnd.dece.zip, application/vnd.denovo.fcselayout-link, application/vnd.desmume.movie, application/vnd.dir-bi.plate-dl-nosuffix, application/vnd.dm.delegation+xml, application/vnd.dna, application/vnd.document+json, application/vnd.dolby.mlp, application/vnd.dolby.mobile.1, application/vnd.dolby.mobile.2, application/vnd.doremir.scorecloud-binary-document, application/vnd.dpgraph, application/vnd.dreamfactory, application/vnd.drive+json, application/vnd.ds-keypoint, application/vnd.dtg.local, application/vnd.dtg.local.flash, application/vnd.dtg.local.html, application/vnd.dvb.ait, application/vnd.dvb.dvbj, application/vnd.dvb.esgcontainer, application/vnd.dvb.ipdcdftnotifaccess, application/vnd.dvb.ipdcesgaccess, application/vnd.dvb.ipdcesgaccess2, application/vnd.dvb.ipdcesgpdd, application/vnd.dvb.ipdcroaming, application/vnd.dvb.iptv.alfec-base, application/vnd.dvb.iptv.alfec-enhancement, application/vnd.dvb.notif-aggregate-root+xml, application/vnd.dvb.notif-container+xml, application/vnd.dvb.notif-generic+xml, application/vnd.dvb.notif-ia-msglist+xml, application/vnd.dvb.notif-ia-registration-request+xml, application/vnd.dvb.notif-ia-registration-response+xml, application/vnd.dvb.notif-init+xml, application/vnd.dvb.pfr, application/vnd.dvb.service, application/vnd.dxr, application/vnd.dynageo, application/vnd.dzr, application/vnd.easykaraoke.cdgdownload, application/vnd.ecdis-update, application/vnd.ecip.rlp, application/vnd.ecowin.chart, application/vnd.ecowin.filerequest, application/vnd.ecowin.fileupdate, application/vnd.ecowin.series, application/vnd.ecowin.seriesrequest, application/vnd.ecowin.seriesupdate, application/vnd.efi.img, application/vnd.efi.iso, application/vnd.emclient.accessrequest+xml, application/vnd.enliven, application/vnd.enphase.envoy, application/vnd.eprints.data+xml, application/vnd.epson.esf, application/vnd.epson.msf, application/vnd.epson.quickanime, application/vnd.epson.salt, application/vnd.epson.ssf, application/vnd.ericsson.quickcall, application/vnd.espass-espass+zip, application/vnd.eszigno3+xml, application/vnd.etsi.aoc+xml, application/vnd.etsi.asic-e+zip, application/vnd.etsi.asic-s+zip, application/vnd.etsi.cug+xml, application/vnd.etsi.iptvcommand+xml, application/vnd.etsi.iptvdiscovery+xml, application/vnd.etsi.iptvprofile+xml, application/vnd.etsi.iptvsad-bc+xml, application/vnd.etsi.iptvsad-cod+xml, application/vnd.etsi.iptvsad-npvr+xml, application/vnd.etsi.iptvservice+xml, application/vnd.etsi.iptvsync+xml, application/vnd.etsi.iptvueprofile+xml, application/vnd.etsi.mcid+xml, application/vnd.etsi.mheg5, application/vnd.etsi.overload-control-policy-dataset+xml, application/vnd.etsi.pstn+xml, application/vnd.etsi.sci+xml, application/vnd.etsi.simservs+xml, application/vnd.etsi.timestamp-token, application/vnd.etsi.tsl+xml, application/vnd.etsi.tsl.der, application/vnd.eudora.data, application/vnd.evolv.ecig.profile, application/vnd.evolv.ecig.settings, application/vnd.evolv.ecig.theme, application/vnd.exstream-empower+zip, application/vnd.exstream-package, application/vnd.ezpix-album, application/vnd.ezpix-package, application/vnd.f-secure.mobile, application/vnd.fastcopy-disk-image, application/vnd.fdf, application/vnd.fdsn.mseed, application/vnd.fdsn.seed, application/vnd.ffsns, application/vnd.ficlab.flb+zip, application/vnd.filmit.zfc, application/vnd.fints, application/vnd.firemonkeys.cloudcell, application/vnd.flographit, application/vnd.fluxtime.clip, application/vnd.font-fontforge-sfd, application/vnd.framemaker, application/vnd.frogans.fnc, application/vnd.frogans.ltf, application/vnd.fsc.weblaunch, application/vnd.fujitsu.oasys, application/vnd.fujitsu.oasys2, application/vnd.fujitsu.oasys3, application/vnd.fujitsu.oasysgp, application/vnd.fujitsu.oasysprs, application/vnd.fujixerox.art-ex, application/vnd.fujixerox.art4, application/vnd.fujixerox.ddd, application/vnd.fujixerox.docuworks, application/vnd.fujixerox.docuworks.binder, application/vnd.fujixerox.docuworks.container, application/vnd.fujixerox.hbpl, application/vnd.fut-misnet, application/vnd.futoin+cbor, application/vnd.futoin+json, application/vnd.fuzzysheet, application/vnd.genomatix.tuxedo, application/vnd.gentics.grd+json, application/vnd.geo+json, application/vnd.geocube+xml, application/vnd.geogebra.file, application/vnd.geogebra.tool, application/vnd.geometry-explorer, application/vnd.geonext, application/vnd.geoplan, application/vnd.geospace, application/vnd.gerber, application/vnd.globalplatform.card-content-mgt, application/vnd.globalplatform.card-content-mgt-response, application/vnd.gmx, application/vnd.google-apps.document, application/vnd.google-apps.presentation, application/vnd.google-apps.spreadsheet, application/vnd.google-earth.kml+xml, application/vnd.google-earth.kmz, application/vnd.gov.sk.e-form+xml, application/vnd.gov.sk.e-form+zip, application/vnd.gov.sk.xmldatacontainer+xml, application/vnd.grafeq, application/vnd.gridmp, application/vnd.groove-account, application/vnd.groove-help, application/vnd.groove-identity-message, application/vnd.groove-injector, application/vnd.groove-tool-message, application/vnd.groove-tool-template, application/vnd.groove-vcard, application/vnd.hal+json, application/vnd.hal+xml, application/vnd.handheld-entertainment+xml, application/vnd.hbci, application/vnd.hc+json, application/vnd.hcl-bireports, application/vnd.hdt, application/vnd.heroku+json, application/vnd.hhe.lesson-player, application/vnd.hp-hpgl, application/vnd.hp-hpid, application/vnd.hp-hps, application/vnd.hp-jlyt, application/vnd.hp-pcl, application/vnd.hp-pclxl, application/vnd.httphone, application/vnd.hydrostatix.sof-data, application/vnd.hyper+json, application/vnd.hyper-item+json, application/vnd.hyperdrive+json, application/vnd.hzn-3d-crossword, application/vnd.ibm.afplinedata, application/vnd.ibm.electronic-media, application/vnd.ibm.minipay, application/vnd.ibm.modcap, application/vnd.ibm.rights-management, application/vnd.ibm.secure-container, application/vnd.iccprofile, application/vnd.ieee.1905, application/vnd.igloader, application/vnd.imagemeter.folder+zip, application/vnd.imagemeter.image+zip, application/vnd.immervision-ivp, application/vnd.immervision-ivu, application/vnd.ims.imsccv1p1, application/vnd.ims.imsccv1p2, application/vnd.ims.imsccv1p3, application/vnd.ims.lis.v2.result+json, application/vnd.ims.lti.v2.toolconsumerprofile+json, application/vnd.ims.lti.v2.toolproxy+json, application/vnd.ims.lti.v2.toolproxy.id+json, application/vnd.ims.lti.v2.toolsettings+json, application/vnd.ims.lti.v2.toolsettings.simple+json, application/vnd.informedcontrol.rms+xml, application/vnd.informix-visionary, application/vnd.infotech.project, application/vnd.infotech.project+xml, application/vnd.innopath.wamp.notification, application/vnd.insors.igm, application/vnd.intercon.formnet, application/vnd.intergeo, application/vnd.intertrust.digibox, application/vnd.intertrust.nncp, application/vnd.intu.qbo, application/vnd.intu.qfx, application/vnd.iptc.g2.catalogitem+xml, application/vnd.iptc.g2.conceptitem+xml, application/vnd.iptc.g2.knowledgeitem+xml, application/vnd.iptc.g2.newsitem+xml, application/vnd.iptc.g2.newsmessage+xml, application/vnd.iptc.g2.packageitem+xml, application/vnd.iptc.g2.planningitem+xml, application/vnd.ipunplugged.rcprofile, application/vnd.irepository.package+xml, application/vnd.is-xpr, application/vnd.isac.fcs, application/vnd.iso11783-10+zip, application/vnd.jam, application/vnd.japannet-directory-service, application/vnd.japannet-jpnstore-wakeup, application/vnd.japannet-payment-wakeup, application/vnd.japannet-registration, application/vnd.japannet-registration-wakeup, application/vnd.japannet-setstore-wakeup, application/vnd.japannet-verification, application/vnd.japannet-verification-wakeup, application/vnd.jcp.javame.midlet-rms, application/vnd.jisp, application/vnd.joost.joda-archive, application/vnd.jsk.isdn-ngn, application/vnd.kahootz, application/vnd.kde.karbon, application/vnd.kde.kchart, application/vnd.kde.kformula, application/vnd.kde.kivio, application/vnd.kde.kontour, application/vnd.kde.kpresenter, application/vnd.kde.kspread, application/vnd.kde.kword, application/vnd.kenameaapp, application/vnd.kidspiration, application/vnd.kinar, application/vnd.koan, application/vnd.kodak-descriptor, application/vnd.las, application/vnd.las.las+json, application/vnd.las.las+xml, application/vnd.laszip, application/vnd.leap+json, application/vnd.liberty-request+xml, application/vnd.llamagraphics.life-balance.desktop, application/vnd.llamagraphics.life-balance.exchange+xml, application/vnd.logipipe.circuit+zip, application/vnd.loom, application/vnd.lotus-1-2-3, application/vnd.lotus-approach, application/vnd.lotus-freelance, application/vnd.lotus-notes, application/vnd.lotus-organizer, application/vnd.lotus-screencam, application/vnd.lotus-wordpro, application/vnd.macports.portpkg, application/vnd.mapbox-vector-tile, application/vnd.marlin.drm.actiontoken+xml, application/vnd.marlin.drm.conftoken+xml, application/vnd.marlin.drm.license+xml, application/vnd.marlin.drm.mdcf, application/vnd.mason+json, application/vnd.maxmind.maxmind-db, application/vnd.mcd, application/vnd.medcalcdata, application/vnd.mediastation.cdkey, application/vnd.meridian-slingshot, application/vnd.mfer, application/vnd.mfmp, application/vnd.micro+json, application/vnd.micrografx.flo, application/vnd.micrografx.igx, application/vnd.microsoft.portable-executable, application/vnd.microsoft.windows.thumbnail-cache, application/vnd.miele+json, application/vnd.mif, application/vnd.minisoft-hp3000-save, application/vnd.mitsubishi.misty-guard.trustweb, application/vnd.mobius.daf, application/vnd.mobius.dis, application/vnd.mobius.mbk, application/vnd.mobius.mqy, application/vnd.mobius.msl, application/vnd.mobius.plc, application/vnd.mobius.txf, application/vnd.mophun.application, application/vnd.mophun.certificate, application/vnd.motorola.flexsuite, application/vnd.motorola.flexsuite.adsi, application/vnd.motorola.flexsuite.fis, application/vnd.motorola.flexsuite.gotap, application/vnd.motorola.flexsuite.kmr, application/vnd.motorola.flexsuite.ttc, application/vnd.motorola.flexsuite.wem, application/vnd.motorola.iprm, application/vnd.mozilla.xul+xml, application/vnd.ms-3mfdocument, application/vnd.ms-artgalry, application/vnd.ms-asf, application/vnd.ms-cab-compressed, application/vnd.ms-color.iccprofile, application/vnd.ms-excel, application/vnd.ms-excel.addin.macroenabled.12, application/vnd.ms-excel.sheet.binary.macroenabled.12, application/vnd.ms-excel.sheet.macroenabled.12, application/vnd.ms-excel.template.macroenabled.12, application/vnd.ms-fontobject, application/vnd.ms-htmlhelp, application/vnd.ms-ims, application/vnd.ms-lrm, application/vnd.ms-office.activex+xml, application/vnd.ms-officetheme, application/vnd.ms-opentype, application/vnd.ms-outlook, application/vnd.ms-package.obfuscated-opentype, application/vnd.ms-pki.seccat, application/vnd.ms-pki.stl, application/vnd.ms-playready.initiator+xml, application/vnd.ms-powerpoint, application/vnd.ms-powerpoint.addin.macroenabled.12, application/vnd.ms-powerpoint.presentation.macroenabled.12, application/vnd.ms-powerpoint.slide.macroenabled.12, application/vnd.ms-powerpoint.slideshow.macroenabled.12, application/vnd.ms-powerpoint.template.macroenabled.12, application/vnd.ms-printdevicecapabilities+xml, application/vnd.ms-printing.printticket+xml, application/vnd.ms-printschematicket+xml, application/vnd.ms-project, application/vnd.ms-tnef, application/vnd.ms-windows.devicepairing, application/vnd.ms-windows.nwprinting.oob, application/vnd.ms-windows.printerpairing, application/vnd.ms-windows.wsd.oob, application/vnd.ms-wmdrm.lic-chlg-req, application/vnd.ms-wmdrm.lic-resp, application/vnd.ms-wmdrm.meter-chlg-req, application/vnd.ms-wmdrm.meter-resp, application/vnd.ms-word.document.macroenabled.12, application/vnd.ms-word.template.macroenabled.12, application/vnd.ms-works, application/vnd.ms-wpl, application/vnd.ms-xpsdocument, application/vnd.msa-disk-image, application/vnd.mseq, application/vnd.msign, application/vnd.multiad.creator, application/vnd.multiad.creator.cif, application/vnd.music-niff, application/vnd.musician, application/vnd.muvee.style, application/vnd.mynfc, application/vnd.ncd.control, application/vnd.ncd.reference, application/vnd.nearst.inv+json, application/vnd.nervana, application/vnd.netfpx, application/vnd.neurolanguage.nlu, application/vnd.nimn, application/vnd.nintendo.nitro.rom, application/vnd.nintendo.snes.rom, application/vnd.nitf, application/vnd.noblenet-directory, application/vnd.noblenet-sealer, application/vnd.noblenet-web, application/vnd.nokia.catalogs, application/vnd.nokia.conml+wbxml, application/vnd.nokia.conml+xml, application/vnd.nokia.iptv.config+xml, application/vnd.nokia.isds-radio-presets, application/vnd.nokia.landmark+wbxml, application/vnd.nokia.landmark+xml, application/vnd.nokia.landmarkcollection+xml, application/vnd.nokia.n-gage.ac+xml, application/vnd.nokia.n-gage.data, application/vnd.nokia.n-gage.symbian.install, application/vnd.nokia.ncd, application/vnd.nokia.pcd+wbxml, application/vnd.nokia.pcd+xml, application/vnd.nokia.radio-preset, application/vnd.nokia.radio-presets, application/vnd.novadigm.edm, application/vnd.novadigm.edx, application/vnd.novadigm.ext, application/vnd.ntt-local.content-share, application/vnd.ntt-local.file-transfer, application/vnd.ntt-local.ogw_remote-access, application/vnd.ntt-local.sip-ta_remote, application/vnd.ntt-local.sip-ta_tcp_stream, application/vnd.oasis.opendocument.chart, application/vnd.oasis.opendocument.chart-template, application/vnd.oasis.opendocument.database, application/vnd.oasis.opendocument.formula, application/vnd.oasis.opendocument.formula-template, application/vnd.oasis.opendocument.graphics, application/vnd.oasis.opendocument.graphics-template, application/vnd.oasis.opendocument.image, application/vnd.oasis.opendocument.image-template, application/vnd.oasis.opendocument.presentation, application/vnd.oasis.opendocument.presentation-template, application/vnd.oasis.opendocument.spreadsheet, application/vnd.oasis.opendocument.spreadsheet-template, application/vnd.oasis.opendocument.text, application/vnd.oasis.opendocument.text-master, application/vnd.oasis.opendocument.text-template, application/vnd.oasis.opendocument.text-web, application/vnd.obn, application/vnd.ocf+cbor, application/vnd.oftn.l10n+json, application/vnd.oipf.contentaccessdownload+xml, application/vnd.oipf.contentaccessstreaming+xml, application/vnd.oipf.cspg-hexbinary, application/vnd.oipf.dae.svg+xml, application/vnd.oipf.dae.xhtml+xml, application/vnd.oipf.mippvcontrolmessage+xml, application/vnd.oipf.pae.gem, application/vnd.oipf.spdiscovery+xml, application/vnd.oipf.spdlist+xml, application/vnd.oipf.ueprofile+xml, application/vnd.oipf.userprofile+xml, application/vnd.olpc-sugar, application/vnd.oma-scws-config, application/vnd.oma-scws-http-request, application/vnd.oma-scws-http-response, application/vnd.oma.bcast.associated-procedure-parameter+xml, application/vnd.oma.bcast.drm-trigger+xml, application/vnd.oma.bcast.imd+xml, application/vnd.oma.bcast.ltkm, application/vnd.oma.bcast.notification+xml, application/vnd.oma.bcast.provisioningtrigger, application/vnd.oma.bcast.sgboot, application/vnd.oma.bcast.sgdd+xml, application/vnd.oma.bcast.sgdu, application/vnd.oma.bcast.simple-symbol-container, application/vnd.oma.bcast.smartcard-trigger+xml, application/vnd.oma.bcast.sprov+xml, application/vnd.oma.bcast.stkm, application/vnd.oma.cab-address-book+xml, application/vnd.oma.cab-feature-handler+xml, application/vnd.oma.cab-pcc+xml, application/vnd.oma.cab-subs-invite+xml, application/vnd.oma.cab-user-prefs+xml, application/vnd.oma.dcd, application/vnd.oma.dcdc, application/vnd.oma.dd2+xml, application/vnd.oma.drm.risd+xml, application/vnd.oma.group-usage-list+xml, application/vnd.oma.lwm2m+json, application/vnd.oma.lwm2m+tlv, application/vnd.oma.pal+xml, application/vnd.oma.poc.detailed-progress-report+xml, application/vnd.oma.poc.final-report+xml, application/vnd.oma.poc.groups+xml, application/vnd.oma.poc.invocation-descriptor+xml, application/vnd.oma.poc.optimized-progress-report+xml, application/vnd.oma.push, application/vnd.oma.scidm.messages+xml, application/vnd.oma.xcap-directory+xml, application/vnd.omads-email+xml, application/vnd.omads-file+xml, application/vnd.omads-folder+xml, application/vnd.omaloc-supl-init, application/vnd.onepager, application/vnd.onepagertamp, application/vnd.onepagertamx, application/vnd.onepagertat, application/vnd.onepagertatp, application/vnd.onepagertatx, application/vnd.openblox.game+xml, application/vnd.openblox.game-binary, application/vnd.openeye.oeb, application/vnd.openofficeorg.extension, application/vnd.openstreetmap.data+xml, application/vnd.openxmlformats-officedocument.custom-properties+xml, application/vnd.openxmlformats-officedocument.customxmlproperties+xml, application/vnd.openxmlformats-officedocument.drawing+xml, application/vnd.openxmlformats-officedocument.drawingml.chart+xml, application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml, application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml, application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml, application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml, application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml, application/vnd.openxmlformats-officedocument.extended-properties+xml, application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml, application/vnd.openxmlformats-officedocument.presentationml.comments+xml, application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml, application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml, application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml, application/vnd.openxmlformats-officedocument.presentationml.presprops+xml, application/vnd.openxmlformats-officedocument.presentationml.slide, application/vnd.openxmlformats-officedocument.presentationml.slide+xml, application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml, application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml, application/vnd.openxmlformats-officedocument.presentationml.slideshow, application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml, application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml, application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml, application/vnd.openxmlformats-officedocument.presentationml.tags+xml, application/vnd.openxmlformats-officedocument.presentationml.template, application/vnd.openxmlformats-officedocument.presentationml.template.main+xml, application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.template, application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml, application/vnd.openxmlformats-officedocument.theme+xml, application/vnd.openxmlformats-officedocument.themeoverride+xml, application/vnd.openxmlformats-officedocument.vmldrawing, application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.template, application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml, application/vnd.openxmlformats-package.core-properties+xml, application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml, application/vnd.openxmlformats-package.relationships+xml, application/vnd.oracle.resource+json, application/vnd.orange.indata, application/vnd.osa.netdeploy, application/vnd.osgeo.mapguide.package, application/vnd.osgi.bundle, application/vnd.osgi.dp, application/vnd.osgi.subsystem, application/vnd.otps.ct-kip+xml, application/vnd.oxli.countgraph, application/vnd.pagerduty+json, application/vnd.palm, application/vnd.panoply, application/vnd.paos.xml, application/vnd.patentdive, application/vnd.patientecommsdoc, application/vnd.pawaafile, application/vnd.pcos, application/vnd.pg.format, application/vnd.pg.osasli, application/vnd.piaccess.application-licence, application/vnd.picsel, application/vnd.pmi.widget, application/vnd.poc.group-advertisement+xml, application/vnd.pocketlearn, application/vnd.powerbuilder6, application/vnd.powerbuilder6-s, application/vnd.powerbuilder7, application/vnd.powerbuilder7-s, application/vnd.powerbuilder75, application/vnd.powerbuilder75-s, application/vnd.preminet, application/vnd.previewsystems.box, application/vnd.proteus.magazine, application/vnd.psfs, application/vnd.publishare-delta-tree, application/vnd.pvi.ptid1, application/vnd.pwg-multiplexed, application/vnd.pwg-xhtml-print+xml, application/vnd.qualcomm.brew-app-res, application/vnd.quarantainenet, application/vnd.quark.quarkxpress, application/vnd.quobject-quoxdocument, application/vnd.radisys.moml+xml, application/vnd.radisys.msml+xml, application/vnd.radisys.msml-audit+xml, application/vnd.radisys.msml-audit-conf+xml, application/vnd.radisys.msml-audit-conn+xml, application/vnd.radisys.msml-audit-dialog+xml, application/vnd.radisys.msml-audit-stream+xml, application/vnd.radisys.msml-conf+xml, application/vnd.radisys.msml-dialog+xml, application/vnd.radisys.msml-dialog-base+xml, application/vnd.radisys.msml-dialog-fax-detect+xml, application/vnd.radisys.msml-dialog-fax-sendrecv+xml, application/vnd.radisys.msml-dialog-group+xml, application/vnd.radisys.msml-dialog-speech+xml, application/vnd.radisys.msml-dialog-transform+xml, application/vnd.rainstor.data, application/vnd.rapid, application/vnd.rar, application/vnd.realvnc.bed, application/vnd.recordare.musicxml, application/vnd.recordare.musicxml+xml, application/vnd.renlearn.rlprint, application/vnd.restful+json, application/vnd.rig.cryptonote, application/vnd.rim.cod, application/vnd.rn-realmedia, application/vnd.rn-realmedia-vbr, application/vnd.route66.link66+xml, application/vnd.rs-274x, application/vnd.ruckus.download, application/vnd.s3sms, application/vnd.sailingtracker.track, application/vnd.sbm.cid, application/vnd.sbm.mid2, application/vnd.scribus, application/vnd.sealed.3df, application/vnd.sealed.csf, application/vnd.sealed.doc, application/vnd.sealed.eml, application/vnd.sealed.mht, application/vnd.sealed.net, application/vnd.sealed.ppt, application/vnd.sealed.tiff, application/vnd.sealed.xls, application/vnd.sealedmedia.softseal.html, application/vnd.sealedmedia.softseal.pdf, application/vnd.seemail, application/vnd.sema, application/vnd.semd, application/vnd.semf, application/vnd.shade-save-file, application/vnd.shana.informed.formdata, application/vnd.shana.informed.formtemplate, application/vnd.shana.informed.interchange, application/vnd.shana.informed.package, application/vnd.shootproof+json, application/vnd.shopkick+json, application/vnd.sigrok.session, application/vnd.simtech-mindmapper, application/vnd.siren+json, application/vnd.smaf, application/vnd.smart.notebook, application/vnd.smart.teacher, application/vnd.software602.filler.form+xml, application/vnd.software602.filler.form-xml-zip, application/vnd.solent.sdkm+xml, application/vnd.spotfire.dxp, application/vnd.spotfire.sfs, application/vnd.sqlite3, application/vnd.sss-cod, application/vnd.sss-dtf, application/vnd.sss-ntf, application/vnd.stardivision.calc, application/vnd.stardivision.draw, application/vnd.stardivision.impress, application/vnd.stardivision.math, application/vnd.stardivision.writer, application/vnd.stardivision.writer-global, application/vnd.stepmania.package, application/vnd.stepmania.stepchart, application/vnd.street-stream, application/vnd.sun.wadl+xml, application/vnd.sun.xml.calc, application/vnd.sun.xml.calc.template, application/vnd.sun.xml.draw, application/vnd.sun.xml.draw.template, application/vnd.sun.xml.impress, application/vnd.sun.xml.impress.template, application/vnd.sun.xml.math, application/vnd.sun.xml.writer, application/vnd.sun.xml.writer.global, application/vnd.sun.xml.writer.template, application/vnd.sus-calendar, application/vnd.svd, application/vnd.swiftview-ics, application/vnd.symbian.install, application/vnd.syncml+xml, application/vnd.syncml.dm+wbxml, application/vnd.syncml.dm+xml, application/vnd.syncml.dm.notification, application/vnd.syncml.dmddf+wbxml, application/vnd.syncml.dmddf+xml, application/vnd.syncml.dmtnds+wbxml, application/vnd.syncml.dmtnds+xml, application/vnd.syncml.ds.notification, application/vnd.tableschema+json, application/vnd.tao.intent-module-archive, application/vnd.tcpdump.pcap, application/vnd.think-cell.ppttc+json, application/vnd.tmd.mediaflex.api+xml, application/vnd.tml, application/vnd.tmobile-livetv, application/vnd.tri.onesource, application/vnd.trid.tpt, application/vnd.triscape.mxs, application/vnd.trueapp, application/vnd.truedoc, application/vnd.ubisoft.webplayer, application/vnd.ufdl, application/vnd.uiq.theme, application/vnd.umajin, application/vnd.unity, application/vnd.uoml+xml, application/vnd.uplanet.alert, application/vnd.uplanet.alert-wbxml, application/vnd.uplanet.bearer-choice, application/vnd.uplanet.bearer-choice-wbxml, application/vnd.uplanet.cacheop, application/vnd.uplanet.cacheop-wbxml, application/vnd.uplanet.channel, application/vnd.uplanet.channel-wbxml, application/vnd.uplanet.list, application/vnd.uplanet.list-wbxml, application/vnd.uplanet.listcmd, application/vnd.uplanet.listcmd-wbxml, application/vnd.uplanet.signal, application/vnd.uri-map, application/vnd.valve.source.material, application/vnd.vcx, application/vnd.vd-study, application/vnd.vectorworks, application/vnd.vel+json, application/vnd.verimatrix.vcas, application/vnd.veryant.thin, application/vnd.ves.encrypted, application/vnd.vidsoft.vidconference, application/vnd.visio, application/vnd.visionary, application/vnd.vividence.scriptfile, application/vnd.vsf, application/vnd.wap.sic, application/vnd.wap.slc, application/vnd.wap.wbxml, application/vnd.wap.wmlc, application/vnd.wap.wmlscriptc, application/vnd.webturbo, application/vnd.wfa.p2p, application/vnd.wfa.wsc, application/vnd.windows.devicepairing, application/vnd.wmc, application/vnd.wmf.bootstrap, application/vnd.wolfram.mathematica, application/vnd.wolfram.mathematica.package, application/vnd.wolfram.player, application/vnd.wordperfect, application/vnd.wqd, application/vnd.wrq-hp3000-labelled, application/vnd.wt.stf, application/vnd.wv.csp+wbxml, application/vnd.wv.csp+xml, application/vnd.wv.ssp+xml, application/vnd.xacml+json, application/vnd.xara, application/vnd.xfdl, application/vnd.xfdl.webform, application/vnd.xmi+xml, application/vnd.xmpie.cpkg, application/vnd.xmpie.dpkg, application/vnd.xmpie.plan, application/vnd.xmpie.ppkg, application/vnd.xmpie.xlim, application/vnd.yamaha.hv-dic, application/vnd.yamaha.hv-script, application/vnd.yamaha.hv-voice, application/vnd.yamaha.openscoreformat, application/vnd.yamaha.openscoreformat.osfpvg+xml, application/vnd.yamaha.remote-setup, application/vnd.yamaha.smaf-audio, application/vnd.yamaha.smaf-phrase, application/vnd.yamaha.through-ngn, application/vnd.yamaha.tunnel-udpencap, application/vnd.yaoweme, application/vnd.yellowriver-custom-menu, application/vnd.youtube.yt, application/vnd.zul, application/vnd.zzazz.deck+xml, application/voicexml+xml, application/voucher-cms+json, application/vq-rtcpxr, application/wasm, application/watcherinfo+xml, application/webpush-options+json, application/whoispp-query, application/whoispp-response, application/widget, application/winhlp, application/wita, application/wordperfect5.1, application/wsdl+xml, application/wspolicy+xml, application/x-7z-compressed, application/x-abiword, application/x-ace-compressed, application/x-amf, application/x-apple-diskimage, application/x-arj, application/x-authorware-bin, application/x-authorware-map, application/x-authorware-seg, application/x-bcpio, application/x-bdoc, application/x-bittorrent, application/x-blorb, application/x-bzip, application/x-bzip2, application/x-cbr, application/x-cdlink, application/x-cfs-compressed, application/x-chat, application/x-chess-pgn, application/x-chrome-extension, application/x-cocoa, application/x-compress, application/x-conference, application/x-cpio, application/x-csh, application/x-deb, application/x-debian-package, application/x-dgc-compressed, application/x-director, application/x-doom, application/x-dtbncx+xml, application/x-dtbook+xml, application/x-dtbresource+xml, application/x-dvi, application/x-envoy, application/x-eva, application/x-font-bdf, application/x-font-dos, application/x-font-framemaker, application/x-font-ghostscript, application/x-font-libgrx, application/x-font-linux-psf, application/x-font-pcf, application/x-font-snf, application/x-font-speedo, application/x-font-sunos-news, application/x-font-type1, application/x-font-vfont, application/x-freearc, application/x-futuresplash, application/x-gca-compressed, application/x-glulx, application/x-gnumeric, application/x-gramps-xml, application/x-gtar, application/x-gzip, application/x-hdf, application/x-httpd-php, application/x-install-instructions, application/x-iso9660-image, application/x-java-archive-diff, application/x-java-jnlp-file, application/x-javascript, application/x-keepass2, application/x-latex, application/x-lua-bytecode, application/x-lzh-compressed, application/x-makeself, application/x-mie, application/x-mobipocket-ebook, application/x-mpegurl, application/x-ms-application, application/x-ms-shortcut, application/x-ms-wmd, application/x-ms-wmz, application/x-ms-xbap, application/x-msaccess, application/x-msbinder, application/x-mscardfile, application/x-msclip, application/x-msdos-program, application/x-msdownload, application/x-msmediaview, application/x-msmetafile, application/x-msmoney, application/x-mspublisher, application/x-msschedule, application/x-msterminal, application/x-mswrite, application/x-netcdf, application/x-ns-proxy-autoconfig, application/x-nzb, application/x-perl, application/x-pilot, application/x-pkcs12, application/x-pkcs7-certificates, application/x-pkcs7-certreqresp, application/x-rar-compressed, application/x-redhat-package-manager, application/x-research-info-systems, application/x-sea, application/x-sh, application/x-shar, application/x-shockwave-flash, application/x-silverlight-app, application/x-sql, application/x-stuffit, application/x-stuffitx, application/x-subrip, application/x-sv4cpio, application/x-sv4crc, application/x-t3vm-image, application/x-tads, application/x-tar, application/x-tcl, application/x-tex, application/x-tex-tfm, application/x-texinfo, application/x-tgif, application/x-ustar, application/x-virtualbox-hdd, application/x-virtualbox-ova, application/x-virtualbox-ovf, application/x-virtualbox-vbox, application/x-virtualbox-vbox-extpack, application/x-virtualbox-vdi, application/x-virtualbox-vhd, application/x-virtualbox-vmdk, application/x-wais-source, application/x-web-app-manifest+json, application/x-www-form-urlencoded, application/x-x509-ca-cert, application/x-xfig, application/x-xliff+xml, application/x-xpinstall, application/x-xz, application/x-zmachine, application/x400-bp, application/xacml+xml, application/xaml+xml, application/xcap-att+xml, application/xcap-caps+xml, application/xcap-diff+xml, application/xcap-el+xml, application/xcap-error+xml, application/xcap-ns+xml, application/xcon-conference-info+xml, application/xcon-conference-info-diff+xml, application/xenc+xml, application/xhtml+xml, application/xhtml-voice+xml, application/xliff+xml, application/xml, application/xml-dtd, application/xml-external-parsed-entity, application/xml-patch+xml, application/xmpp+xml, application/xop+xml, application/xproc+xml, application/xslt+xml, application/xspf+xml, application/xv+xml, application/yang, application/yang-data+json, application/yang-data+xml, application/yang-patch+json, application/yang-patch+xml, application/yin+xml, application/zip, application/zlib, application/zstd, audio/1d-interleaved-parityfec, audio/32kadpcm, audio/3gpp, audio/3gpp2, audio/aac, audio/ac3, audio/adpcm, audio/amr, audio/amr-wb, audio/amr-wb+, audio/aptx, audio/asc, audio/atrac-advanced-lossless, audio/atrac-x, audio/atrac3, audio/basic, audio/bv16, audio/bv32, audio/clearmode, audio/cn, audio/dat12, audio/dls, audio/dsr-es201108, audio/dsr-es202050, audio/dsr-es202211, audio/dsr-es202212, audio/dv, audio/dvi4, audio/eac3, audio/encaprtp, audio/evrc, audio/evrc-qcp, audio/evrc0, audio/evrc1, audio/evrcb, audio/evrcb0, audio/evrcb1, audio/evrcnw, audio/evrcnw0, audio/evrcnw1, audio/evrcwb, audio/evrcwb0, audio/evrcwb1, audio/evs, audio/flexfec, audio/fwdred, audio/g711-0, audio/g719, audio/g722, audio/g7221, audio/g723, audio/g726-16, audio/g726-24, audio/g726-32, audio/g726-40, audio/g728, audio/g729, audio/g7291, audio/g729d, audio/g729e, audio/gsm, audio/gsm-efr, audio/gsm-hr-08, audio/ilbc, audio/ip-mr_v2.5, audio/isac, audio/l16, audio/l20, audio/l24, audio/l8, audio/lpc, audio/melp, audio/melp1200, audio/melp2400, audio/melp600, audio/midi, audio/mobile-xmf, audio/mp3, audio/mp4, audio/mp4a-latm, audio/mpa, audio/mpa-robust, audio/mpeg, audio/mpeg4-generic, audio/musepack, audio/ogg, audio/opus, audio/parityfec, audio/pcma, audio/pcma-wb, audio/pcmu, audio/pcmu-wb, audio/prs.sid, audio/qcelp, audio/raptorfec, audio/red, audio/rtp-enc-aescm128, audio/rtp-midi, audio/rtploopback, audio/rtx, audio/s3m, audio/silk, audio/smv, audio/smv-qcp, audio/smv0, audio/sp-midi, audio/speex, audio/t140c, audio/t38, audio/telephone-event, audio/tetra_acelp, audio/tone, audio/uemclip, audio/ulpfec, audio/usac, audio/vdvi, audio/vmr-wb, audio/vnd.3gpp.iufp, audio/vnd.4sb, audio/vnd.audiokoz, audio/vnd.celp, audio/vnd.cisco.nse, audio/vnd.cmles.radio-events, audio/vnd.cns.anp1, audio/vnd.cns.inf1, audio/vnd.dece.audio, audio/vnd.digital-winds, audio/vnd.dlna.adts, audio/vnd.dolby.heaac.1, audio/vnd.dolby.heaac.2, audio/vnd.dolby.mlp, audio/vnd.dolby.mps, audio/vnd.dolby.pl2, audio/vnd.dolby.pl2x, audio/vnd.dolby.pl2z, audio/vnd.dolby.pulse.1, audio/vnd.dra, audio/vnd.dts, audio/vnd.dts.hd, audio/vnd.dts.uhd, audio/vnd.dvb.file, audio/vnd.everad.plj, audio/vnd.hns.audio, audio/vnd.lucent.voice, audio/vnd.ms-playready.media.pya, audio/vnd.nokia.mobile-xmf, audio/vnd.nortel.vbk, audio/vnd.nuera.ecelp4800, audio/vnd.nuera.ecelp7470, audio/vnd.nuera.ecelp9600, audio/vnd.octel.sbc, audio/vnd.presonus.multitrack, audio/vnd.qcelp, audio/vnd.rhetorex.32kadpcm, audio/vnd.rip, audio/vnd.rn-realaudio, audio/vnd.sealedmedia.softseal.mpeg, audio/vnd.vmx.cvsd, audio/vnd.wave, audio/vorbis, audio/vorbis-config, audio/wav, audio/wave, audio/webm, audio/x-aac, audio/x-aiff, audio/x-caf, audio/x-flac, audio/x-m4a, audio/x-matroska, audio/x-mpegurl, audio/x-ms-wax, audio/x-ms-wma, audio/x-pn-realaudio, audio/x-pn-realaudio-plugin, audio/x-realaudio, audio/x-tta, audio/x-wav, audio/xm, chemical/x-cdx, chemical/x-cif, chemical/x-cmdf, chemical/x-cml, chemical/x-csml, chemical/x-pdb, chemical/x-xyz, font/collection, font/otf, font/sfnt, font/ttf, font/woff, font/woff2, image/aces, image/apng, image/avci, image/avcs, image/bmp, image/cgm, image/dicom-rle, image/emf, image/fits, image/g3fax, image/gif, image/heic, image/heic-sequence, image/heif, image/heif-sequence, image/hej2k, image/hsj2, image/ief, image/jls, image/jp2, image/jpeg, image/jph, image/jphc, image/jpm, image/jpx, image/jxr, image/jxra, image/jxrs, image/jxs, image/jxsc, image/jxsi, image/jxss, image/ktx, image/naplps, image/pjpeg, image/png, image/prs.btif, image/prs.pti, image/pwg-raster, image/sgi, image/svg+xml, image/t38, image/tiff, image/tiff-fx, image/vnd.adobe.photoshop, image/vnd.airzip.accelerator.azv, image/vnd.cns.inf2, image/vnd.dece.graphic, image/vnd.djvu, image/vnd.dvb.subtitle, image/vnd.dwg, image/vnd.dxf, image/vnd.fastbidsheet, image/vnd.fpx, image/vnd.fst, image/vnd.fujixerox.edmics-mmr, image/vnd.fujixerox.edmics-rlc, image/vnd.globalgraphics.pgb, image/vnd.microsoft.icon, image/vnd.mix, image/vnd.mozilla.apng, image/vnd.ms-dds, image/vnd.ms-modi, image/vnd.ms-photo, image/vnd.net-fpx, image/vnd.radiance, image/vnd.sealed.png, image/vnd.sealedmedia.softseal.gif, image/vnd.sealedmedia.softseal.jpg, image/vnd.svf, image/vnd.tencent.tap, image/vnd.valve.source.texture, image/vnd.wap.wbmp, image/vnd.xiff, image/vnd.zbrush.pcx, image/webp, image/wmf, image/x-3ds, image/x-cmu-raster, image/x-cmx, image/x-freehand, image/x-icon, image/x-jng, image/x-mrsid-image, image/x-ms-bmp, image/x-pcx, image/x-pict, image/x-portable-anymap, image/x-portable-bitmap, image/x-portable-graymap, image/x-portable-pixmap, image/x-rgb, image/x-tga, image/x-xbitmap, image/x-xcf, image/x-xpixmap, image/x-xwindowdump, message/cpim, message/delivery-status, message/disposition-notification, message/external-body, message/feedback-report, message/global, message/global-delivery-status, message/global-disposition-notification, message/global-headers, message/http, message/imdn+xml, message/news, message/partial, message/rfc822, message/s-http, message/sip, message/sipfrag, message/tracking-status, message/vnd.si.simp, message/vnd.wfa.wsc, model/3mf, model/gltf+json, model/gltf-binary, model/iges, model/mesh, model/stl, model/vnd.collada+xml, model/vnd.dwf, model/vnd.flatland.3dml, model/vnd.gdl, model/vnd.gs-gdl, model/vnd.gs.gdl, model/vnd.gtw, model/vnd.moml+xml, model/vnd.mts, model/vnd.opengex, model/vnd.parasolid.transmit.binary, model/vnd.parasolid.transmit.text, model/vnd.rosette.annotated-data-model, model/vnd.usdz+zip, model/vnd.valve.source.compiled-map, model/vnd.vtu, model/vrml, model/x3d+binary, model/x3d+fastinfoset, model/x3d+vrml, model/x3d+xml, model/x3d-vrml, multipart/alternative, multipart/appledouble, multipart/byteranges, multipart/digest, multipart/encrypted, multipart/form-data, multipart/header-set, multipart/mixed, multipart/multilingual, multipart/parallel, multipart/related, multipart/report, multipart/signed, multipart/vnd.bint.med-plus, multipart/voice-message, multipart/x-mixed-replace, text/1d-interleaved-parityfec, text/cache-manifest, text/calendar, text/calender, text/cmd, text/coffeescript, text/css, text/csv, text/csv-schema, text/directory, text/dns, text/ecmascript, text/encaprtp, text/enriched, text/flexfec, text/fwdred, text/grammar-ref-list, text/html, text/jade, text/javascript, text/jcr-cnd, text/jsx, text/less, text/markdown, text/mathml, text/mdx, text/mizar, text/n3, text/parameters, text/parityfec, text/plain, text/provenance-notation, text/prs.fallenstein.rst, text/prs.lines.tag, text/prs.prop.logic, text/raptorfec, text/red, text/rfc822-headers, text/richtext, text/rtf, text/rtp-enc-aescm128, text/rtploopback, text/rtx, text/sgml, text/shex, text/slim, text/strings, text/stylus, text/t140, text/tab-separated-values, text/troff, text/turtle, text/ulpfec, text/uri-list, text/vcard, text/vnd.a, text/vnd.abc, text/vnd.ascii-art, text/vnd.curl, text/vnd.curl.dcurl, text/vnd.curl.mcurl, text/vnd.curl.scurl, text/vnd.debian.copyright, text/vnd.dmclientscript, text/vnd.dvb.subtitle, text/vnd.esmertec.theme-descriptor, text/vnd.ficlab.flt, text/vnd.fly, text/vnd.fmi.flexstor, text/vnd.gml, text/vnd.graphviz, text/vnd.hgl, text/vnd.in3d.3dml, text/vnd.in3d.spot, text/vnd.iptc.newsml, text/vnd.iptc.nitf, text/vnd.latex-z, text/vnd.motorola.reflex, text/vnd.ms-mediapackage, text/vnd.net2phone.commcenter.command, text/vnd.radisys.msml-basic-layout, text/vnd.senx.warpscript, text/vnd.si.uricatalogue, text/vnd.sosi, text/vnd.sun.j2me.app-descriptor, text/vnd.trolltech.linguist, text/vnd.wap.si, text/vnd.wap.sl, text/vnd.wap.wml, text/vnd.wap.wmlscript, text/vtt, text/x-asm, text/x-c, text/x-component, text/x-fortran, text/x-gwt-rpc, text/x-handlebars-template, text/x-java-source, text/x-jquery-tmpl, text/x-lua, text/x-markdown, text/x-nfo, text/x-opml, text/x-org, text/x-pascal, text/x-processing, text/x-sass, text/x-scss, text/x-setext, text/x-sfv, text/x-suse-ymp, text/x-uuencode, text/x-vcalendar, text/x-vcard, text/xml, text/xml-external-parsed-entity, text/yaml, video/1d-interleaved-parityfec, video/3gpp, video/3gpp-tt, video/3gpp2, video/bmpeg, video/bt656, video/celb, video/dv, video/encaprtp, video/flexfec, video/h261, video/h263, video/h263-1998, video/h263-2000, video/h264, video/h264-rcdo, video/h264-svc, video/h265, video/iso.segment, video/jpeg, video/jpeg2000, video/jpm, video/mj2, video/mp1s, video/mp2p, video/mp2t, video/mp4, video/mp4v-es, video/mpeg, video/mpeg4-generic, video/mpv, video/nv, video/ogg, video/parityfec, video/pointer, video/quicktime, video/raptorfec, video/raw, video/rtp-enc-aescm128, video/rtploopback, video/rtx, video/smpte291, video/smpte292m, video/ulpfec, video/vc1, video/vc2, video/vnd.cctv, video/vnd.dece.hd, video/vnd.dece.mobile, video/vnd.dece.mp4, video/vnd.dece.pd, video/vnd.dece.sd, video/vnd.dece.video, video/vnd.directv.mpeg, video/vnd.directv.mpeg-tts, video/vnd.dlna.mpeg-tts, video/vnd.dvb.file, video/vnd.fvt, video/vnd.hns.video, video/vnd.iptvforum.1dparityfec-1010, video/vnd.iptvforum.1dparityfec-2005, video/vnd.iptvforum.2dparityfec-1010, video/vnd.iptvforum.2dparityfec-2005, video/vnd.iptvforum.ttsavc, video/vnd.iptvforum.ttsmpeg2, video/vnd.motorola.video, video/vnd.motorola.videop, video/vnd.mpegurl, video/vnd.ms-playready.media.pyv, video/vnd.nokia.interleaved-multimedia, video/vnd.nokia.mp4vr, video/vnd.nokia.videovoip, video/vnd.objectvideo, video/vnd.radgamettools.bink, video/vnd.radgamettools.smacker, video/vnd.sealed.mpeg1, video/vnd.sealed.mpeg4, video/vnd.sealed.swf, video/vnd.sealedmedia.softseal.mov, video/vnd.uvvu.mp4, video/vnd.vivo, video/vnd.youtube.yt, video/vp8, video/webm, video/x-f4v, video/x-fli, video/x-flv, video/x-m4v, video/x-matroska, video/x-mng, video/x-ms-asf, video/x-ms-vob, video/x-ms-wm, video/x-ms-wmv, video/x-ms-wmx, video/x-ms-wvx, video/x-msvideo, video/x-sgi-movie, video/x-smv, x-conference/x-cooltalk, x-shader/x-fragment, x-shader/x-vertex, default */ -/***/ (function(module) { - -module.exports = JSON.parse("{\"application/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"application/3gpdash-qoe-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/3gpp-ims+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/a2l\":{\"source\":\"iana\"},\"application/activemessage\":{\"source\":\"iana\"},\"application/activity+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-costmap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-costmapfilter+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-directory+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointcost+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointcostparams+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointprop+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointpropparams+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-error+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-networkmap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-networkmapfilter+json\":{\"source\":\"iana\",\"compressible\":true},\"application/aml\":{\"source\":\"iana\"},\"application/andrew-inset\":{\"source\":\"iana\",\"extensions\":[\"ez\"]},\"application/applefile\":{\"source\":\"iana\"},\"application/applixware\":{\"source\":\"apache\",\"extensions\":[\"aw\"]},\"application/atf\":{\"source\":\"iana\"},\"application/atfx\":{\"source\":\"iana\"},\"application/atom+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atom\"]},\"application/atomcat+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atomcat\"]},\"application/atomdeleted+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atomdeleted\"]},\"application/atomicmail\":{\"source\":\"iana\"},\"application/atomsvc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atomsvc\"]},\"application/atsc-dwd+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dwd\"]},\"application/atsc-held+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"held\"]},\"application/atsc-rdt+json\":{\"source\":\"iana\",\"compressible\":true},\"application/atsc-rsat+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rsat\"]},\"application/atxml\":{\"source\":\"iana\"},\"application/auth-policy+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/bacnet-xdd+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/batch-smtp\":{\"source\":\"iana\"},\"application/bdoc\":{\"compressible\":false,\"extensions\":[\"bdoc\"]},\"application/beep+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/calendar+json\":{\"source\":\"iana\",\"compressible\":true},\"application/calendar+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xcs\"]},\"application/call-completion\":{\"source\":\"iana\"},\"application/cals-1840\":{\"source\":\"iana\"},\"application/cbor\":{\"source\":\"iana\"},\"application/cbor-seq\":{\"source\":\"iana\"},\"application/cccex\":{\"source\":\"iana\"},\"application/ccmp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ccxml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ccxml\"]},\"application/cdfx+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"cdfx\"]},\"application/cdmi-capability\":{\"source\":\"iana\",\"extensions\":[\"cdmia\"]},\"application/cdmi-container\":{\"source\":\"iana\",\"extensions\":[\"cdmic\"]},\"application/cdmi-domain\":{\"source\":\"iana\",\"extensions\":[\"cdmid\"]},\"application/cdmi-object\":{\"source\":\"iana\",\"extensions\":[\"cdmio\"]},\"application/cdmi-queue\":{\"source\":\"iana\",\"extensions\":[\"cdmiq\"]},\"application/cdni\":{\"source\":\"iana\"},\"application/cea\":{\"source\":\"iana\"},\"application/cea-2018+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cellml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cfw\":{\"source\":\"iana\"},\"application/clue+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/clue_info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cms\":{\"source\":\"iana\"},\"application/cnrp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/coap-group+json\":{\"source\":\"iana\",\"compressible\":true},\"application/coap-payload\":{\"source\":\"iana\"},\"application/commonground\":{\"source\":\"iana\"},\"application/conference-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cose\":{\"source\":\"iana\"},\"application/cose-key\":{\"source\":\"iana\"},\"application/cose-key-set\":{\"source\":\"iana\"},\"application/cpl+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/csrattrs\":{\"source\":\"iana\"},\"application/csta+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cstadata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/csvm+json\":{\"source\":\"iana\",\"compressible\":true},\"application/cu-seeme\":{\"source\":\"apache\",\"extensions\":[\"cu\"]},\"application/cwt\":{\"source\":\"iana\"},\"application/cybercash\":{\"source\":\"iana\"},\"application/dart\":{\"compressible\":true},\"application/dash+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mpd\"]},\"application/dashdelta\":{\"source\":\"iana\"},\"application/davmount+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"davmount\"]},\"application/dca-rft\":{\"source\":\"iana\"},\"application/dcd\":{\"source\":\"iana\"},\"application/dec-dx\":{\"source\":\"iana\"},\"application/dialog-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/dicom\":{\"source\":\"iana\"},\"application/dicom+json\":{\"source\":\"iana\",\"compressible\":true},\"application/dicom+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/dii\":{\"source\":\"iana\"},\"application/dit\":{\"source\":\"iana\"},\"application/dns\":{\"source\":\"iana\"},\"application/dns+json\":{\"source\":\"iana\",\"compressible\":true},\"application/dns-message\":{\"source\":\"iana\"},\"application/docbook+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"dbk\"]},\"application/dskpp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/dssc+der\":{\"source\":\"iana\",\"extensions\":[\"dssc\"]},\"application/dssc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdssc\"]},\"application/dvcs\":{\"source\":\"iana\"},\"application/ecmascript\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ecma\",\"es\"]},\"application/edi-consent\":{\"source\":\"iana\"},\"application/edi-x12\":{\"source\":\"iana\",\"compressible\":false},\"application/edifact\":{\"source\":\"iana\",\"compressible\":false},\"application/efi\":{\"source\":\"iana\"},\"application/emergencycalldata.comment+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.control+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.deviceinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.ecall.msd\":{\"source\":\"iana\"},\"application/emergencycalldata.providerinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.serviceinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.subscriberinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.veds+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emma+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"emma\"]},\"application/emotionml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"emotionml\"]},\"application/encaprtp\":{\"source\":\"iana\"},\"application/epp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/epub+zip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"epub\"]},\"application/eshop\":{\"source\":\"iana\"},\"application/exi\":{\"source\":\"iana\",\"extensions\":[\"exi\"]},\"application/expect-ct-report+json\":{\"source\":\"iana\",\"compressible\":true},\"application/fastinfoset\":{\"source\":\"iana\"},\"application/fastsoap\":{\"source\":\"iana\"},\"application/fdt+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"fdt\"]},\"application/fhir+json\":{\"source\":\"iana\",\"compressible\":true},\"application/fhir+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/fido.trusted-apps+json\":{\"compressible\":true},\"application/fits\":{\"source\":\"iana\"},\"application/flexfec\":{\"source\":\"iana\"},\"application/font-sfnt\":{\"source\":\"iana\"},\"application/font-tdpfr\":{\"source\":\"iana\",\"extensions\":[\"pfr\"]},\"application/font-woff\":{\"source\":\"iana\",\"compressible\":false},\"application/framework-attributes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/geo+json\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"geojson\"]},\"application/geo+json-seq\":{\"source\":\"iana\"},\"application/geopackage+sqlite3\":{\"source\":\"iana\"},\"application/geoxacml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/gltf-buffer\":{\"source\":\"iana\"},\"application/gml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"gml\"]},\"application/gpx+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"gpx\"]},\"application/gxf\":{\"source\":\"apache\",\"extensions\":[\"gxf\"]},\"application/gzip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"gz\"]},\"application/h224\":{\"source\":\"iana\"},\"application/held+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/hjson\":{\"extensions\":[\"hjson\"]},\"application/http\":{\"source\":\"iana\"},\"application/hyperstudio\":{\"source\":\"iana\",\"extensions\":[\"stk\"]},\"application/ibe-key-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ibe-pkg-reply+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ibe-pp-data\":{\"source\":\"iana\"},\"application/iges\":{\"source\":\"iana\"},\"application/im-iscomposing+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/index\":{\"source\":\"iana\"},\"application/index.cmd\":{\"source\":\"iana\"},\"application/index.obj\":{\"source\":\"iana\"},\"application/index.response\":{\"source\":\"iana\"},\"application/index.vnd\":{\"source\":\"iana\"},\"application/inkml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ink\",\"inkml\"]},\"application/iotp\":{\"source\":\"iana\"},\"application/ipfix\":{\"source\":\"iana\",\"extensions\":[\"ipfix\"]},\"application/ipp\":{\"source\":\"iana\"},\"application/isup\":{\"source\":\"iana\"},\"application/its+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"its\"]},\"application/java-archive\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"jar\",\"war\",\"ear\"]},\"application/java-serialized-object\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"ser\"]},\"application/java-vm\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"class\"]},\"application/javascript\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"js\",\"mjs\"]},\"application/jf2feed+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jose\":{\"source\":\"iana\"},\"application/jose+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jrd+json\":{\"source\":\"iana\",\"compressible\":true},\"application/json\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"json\",\"map\"]},\"application/json-patch+json\":{\"source\":\"iana\",\"compressible\":true},\"application/json-seq\":{\"source\":\"iana\"},\"application/json5\":{\"extensions\":[\"json5\"]},\"application/jsonml+json\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"jsonml\"]},\"application/jwk+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jwk-set+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jwt\":{\"source\":\"iana\"},\"application/kpml-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/kpml-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ld+json\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"jsonld\"]},\"application/lgr+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lgr\"]},\"application/link-format\":{\"source\":\"iana\"},\"application/load-control+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/lost+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lostxml\"]},\"application/lostsync+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/lxf\":{\"source\":\"iana\"},\"application/mac-binhex40\":{\"source\":\"iana\",\"extensions\":[\"hqx\"]},\"application/mac-compactpro\":{\"source\":\"apache\",\"extensions\":[\"cpt\"]},\"application/macwriteii\":{\"source\":\"iana\"},\"application/mads+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mads\"]},\"application/manifest+json\":{\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"webmanifest\"]},\"application/marc\":{\"source\":\"iana\",\"extensions\":[\"mrc\"]},\"application/marcxml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mrcx\"]},\"application/mathematica\":{\"source\":\"iana\",\"extensions\":[\"ma\",\"nb\",\"mb\"]},\"application/mathml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mathml\"]},\"application/mathml-content+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mathml-presentation+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-associated-procedure-description+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-deregister+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-envelope+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-msk+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-msk-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-protection-description+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-reception-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-register+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-register-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-schedule+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-user-service-description+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbox\":{\"source\":\"iana\",\"extensions\":[\"mbox\"]},\"application/media-policy-dataset+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/media_control+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mediaservercontrol+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mscml\"]},\"application/merge-patch+json\":{\"source\":\"iana\",\"compressible\":true},\"application/metalink+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"metalink\"]},\"application/metalink4+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"meta4\"]},\"application/mets+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mets\"]},\"application/mf4\":{\"source\":\"iana\"},\"application/mikey\":{\"source\":\"iana\"},\"application/mipc\":{\"source\":\"iana\"},\"application/mmt-aei+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"maei\"]},\"application/mmt-usd+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"musd\"]},\"application/mods+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mods\"]},\"application/moss-keys\":{\"source\":\"iana\"},\"application/moss-signature\":{\"source\":\"iana\"},\"application/mosskey-data\":{\"source\":\"iana\"},\"application/mosskey-request\":{\"source\":\"iana\"},\"application/mp21\":{\"source\":\"iana\",\"extensions\":[\"m21\",\"mp21\"]},\"application/mp4\":{\"source\":\"iana\",\"extensions\":[\"mp4s\",\"m4p\"]},\"application/mpeg4-generic\":{\"source\":\"iana\"},\"application/mpeg4-iod\":{\"source\":\"iana\"},\"application/mpeg4-iod-xmt\":{\"source\":\"iana\"},\"application/mrb-consumer+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdf\"]},\"application/mrb-publish+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdf\"]},\"application/msc-ivr+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/msc-mixer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/msword\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"doc\",\"dot\"]},\"application/mud+json\":{\"source\":\"iana\",\"compressible\":true},\"application/multipart-core\":{\"source\":\"iana\"},\"application/mxf\":{\"source\":\"iana\",\"extensions\":[\"mxf\"]},\"application/n-quads\":{\"source\":\"iana\",\"extensions\":[\"nq\"]},\"application/n-triples\":{\"source\":\"iana\",\"extensions\":[\"nt\"]},\"application/nasdata\":{\"source\":\"iana\"},\"application/news-checkgroups\":{\"source\":\"iana\"},\"application/news-groupinfo\":{\"source\":\"iana\"},\"application/news-transmission\":{\"source\":\"iana\"},\"application/nlsml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/node\":{\"source\":\"iana\"},\"application/nss\":{\"source\":\"iana\"},\"application/ocsp-request\":{\"source\":\"iana\"},\"application/ocsp-response\":{\"source\":\"iana\"},\"application/octet-stream\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"bin\",\"dms\",\"lrf\",\"mar\",\"so\",\"dist\",\"distz\",\"pkg\",\"bpk\",\"dump\",\"elc\",\"deploy\",\"exe\",\"dll\",\"deb\",\"dmg\",\"iso\",\"img\",\"msi\",\"msp\",\"msm\",\"buffer\"]},\"application/oda\":{\"source\":\"iana\",\"extensions\":[\"oda\"]},\"application/odm+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/odx\":{\"source\":\"iana\"},\"application/oebps-package+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"opf\"]},\"application/ogg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ogx\"]},\"application/omdoc+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"omdoc\"]},\"application/onenote\":{\"source\":\"apache\",\"extensions\":[\"onetoc\",\"onetoc2\",\"onetmp\",\"onepkg\"]},\"application/oscore\":{\"source\":\"iana\"},\"application/oxps\":{\"source\":\"iana\",\"extensions\":[\"oxps\"]},\"application/p2p-overlay+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"relo\"]},\"application/parityfec\":{\"source\":\"iana\"},\"application/passport\":{\"source\":\"iana\"},\"application/patch-ops-error+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xer\"]},\"application/pdf\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"pdf\"]},\"application/pdx\":{\"source\":\"iana\"},\"application/pem-certificate-chain\":{\"source\":\"iana\"},\"application/pgp-encrypted\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"pgp\"]},\"application/pgp-keys\":{\"source\":\"iana\"},\"application/pgp-signature\":{\"source\":\"iana\",\"extensions\":[\"asc\",\"sig\"]},\"application/pics-rules\":{\"source\":\"apache\",\"extensions\":[\"prf\"]},\"application/pidf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/pidf-diff+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/pkcs10\":{\"source\":\"iana\",\"extensions\":[\"p10\"]},\"application/pkcs12\":{\"source\":\"iana\"},\"application/pkcs7-mime\":{\"source\":\"iana\",\"extensions\":[\"p7m\",\"p7c\"]},\"application/pkcs7-signature\":{\"source\":\"iana\",\"extensions\":[\"p7s\"]},\"application/pkcs8\":{\"source\":\"iana\",\"extensions\":[\"p8\"]},\"application/pkcs8-encrypted\":{\"source\":\"iana\"},\"application/pkix-attr-cert\":{\"source\":\"iana\",\"extensions\":[\"ac\"]},\"application/pkix-cert\":{\"source\":\"iana\",\"extensions\":[\"cer\"]},\"application/pkix-crl\":{\"source\":\"iana\",\"extensions\":[\"crl\"]},\"application/pkix-pkipath\":{\"source\":\"iana\",\"extensions\":[\"pkipath\"]},\"application/pkixcmp\":{\"source\":\"iana\",\"extensions\":[\"pki\"]},\"application/pls+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"pls\"]},\"application/poc-settings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/postscript\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ai\",\"eps\",\"ps\"]},\"application/ppsp-tracker+json\":{\"source\":\"iana\",\"compressible\":true},\"application/problem+json\":{\"source\":\"iana\",\"compressible\":true},\"application/problem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/provenance+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"provx\"]},\"application/prs.alvestrand.titrax-sheet\":{\"source\":\"iana\"},\"application/prs.cww\":{\"source\":\"iana\",\"extensions\":[\"cww\"]},\"application/prs.hpub+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/prs.nprend\":{\"source\":\"iana\"},\"application/prs.plucker\":{\"source\":\"iana\"},\"application/prs.rdf-xml-crypt\":{\"source\":\"iana\"},\"application/prs.xsf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/pskc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"pskcxml\"]},\"application/qsig\":{\"source\":\"iana\"},\"application/raml+yaml\":{\"compressible\":true,\"extensions\":[\"raml\"]},\"application/raptorfec\":{\"source\":\"iana\"},\"application/rdap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/rdf+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rdf\",\"owl\"]},\"application/reginfo+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rif\"]},\"application/relax-ng-compact-syntax\":{\"source\":\"iana\",\"extensions\":[\"rnc\"]},\"application/remote-printing\":{\"source\":\"iana\"},\"application/reputon+json\":{\"source\":\"iana\",\"compressible\":true},\"application/resource-lists+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rl\"]},\"application/resource-lists-diff+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rld\"]},\"application/rfc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/riscos\":{\"source\":\"iana\"},\"application/rlmi+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/rls-services+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rs\"]},\"application/route-apd+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rapd\"]},\"application/route-s-tsid+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sls\"]},\"application/route-usd+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rusd\"]},\"application/rpki-ghostbusters\":{\"source\":\"iana\",\"extensions\":[\"gbr\"]},\"application/rpki-manifest\":{\"source\":\"iana\",\"extensions\":[\"mft\"]},\"application/rpki-publication\":{\"source\":\"iana\"},\"application/rpki-roa\":{\"source\":\"iana\",\"extensions\":[\"roa\"]},\"application/rpki-updown\":{\"source\":\"iana\"},\"application/rsd+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"rsd\"]},\"application/rss+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"rss\"]},\"application/rtf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rtf\"]},\"application/rtploopback\":{\"source\":\"iana\"},\"application/rtx\":{\"source\":\"iana\"},\"application/samlassertion+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/samlmetadata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sbml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sbml\"]},\"application/scaip+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/scim+json\":{\"source\":\"iana\",\"compressible\":true},\"application/scvp-cv-request\":{\"source\":\"iana\",\"extensions\":[\"scq\"]},\"application/scvp-cv-response\":{\"source\":\"iana\",\"extensions\":[\"scs\"]},\"application/scvp-vp-request\":{\"source\":\"iana\",\"extensions\":[\"spq\"]},\"application/scvp-vp-response\":{\"source\":\"iana\",\"extensions\":[\"spp\"]},\"application/sdp\":{\"source\":\"iana\",\"extensions\":[\"sdp\"]},\"application/secevent+jwt\":{\"source\":\"iana\"},\"application/senml+cbor\":{\"source\":\"iana\"},\"application/senml+json\":{\"source\":\"iana\",\"compressible\":true},\"application/senml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"senmlx\"]},\"application/senml-exi\":{\"source\":\"iana\"},\"application/sensml+cbor\":{\"source\":\"iana\"},\"application/sensml+json\":{\"source\":\"iana\",\"compressible\":true},\"application/sensml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sensmlx\"]},\"application/sensml-exi\":{\"source\":\"iana\"},\"application/sep+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sep-exi\":{\"source\":\"iana\"},\"application/session-info\":{\"source\":\"iana\"},\"application/set-payment\":{\"source\":\"iana\"},\"application/set-payment-initiation\":{\"source\":\"iana\",\"extensions\":[\"setpay\"]},\"application/set-registration\":{\"source\":\"iana\"},\"application/set-registration-initiation\":{\"source\":\"iana\",\"extensions\":[\"setreg\"]},\"application/sgml\":{\"source\":\"iana\"},\"application/sgml-open-catalog\":{\"source\":\"iana\"},\"application/shf+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"shf\"]},\"application/sieve\":{\"source\":\"iana\",\"extensions\":[\"siv\",\"sieve\"]},\"application/simple-filter+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/simple-message-summary\":{\"source\":\"iana\"},\"application/simplesymbolcontainer\":{\"source\":\"iana\"},\"application/sipc\":{\"source\":\"iana\"},\"application/slate\":{\"source\":\"iana\"},\"application/smil\":{\"source\":\"iana\"},\"application/smil+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"smi\",\"smil\"]},\"application/smpte336m\":{\"source\":\"iana\"},\"application/soap+fastinfoset\":{\"source\":\"iana\"},\"application/soap+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sparql-query\":{\"source\":\"iana\",\"extensions\":[\"rq\"]},\"application/sparql-results+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"srx\"]},\"application/spirits-event+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sql\":{\"source\":\"iana\"},\"application/srgs\":{\"source\":\"iana\",\"extensions\":[\"gram\"]},\"application/srgs+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"grxml\"]},\"application/sru+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sru\"]},\"application/ssdl+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"ssdl\"]},\"application/ssml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ssml\"]},\"application/stix+json\":{\"source\":\"iana\",\"compressible\":true},\"application/swid+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"swidtag\"]},\"application/tamp-apex-update\":{\"source\":\"iana\"},\"application/tamp-apex-update-confirm\":{\"source\":\"iana\"},\"application/tamp-community-update\":{\"source\":\"iana\"},\"application/tamp-community-update-confirm\":{\"source\":\"iana\"},\"application/tamp-error\":{\"source\":\"iana\"},\"application/tamp-sequence-adjust\":{\"source\":\"iana\"},\"application/tamp-sequence-adjust-confirm\":{\"source\":\"iana\"},\"application/tamp-status-query\":{\"source\":\"iana\"},\"application/tamp-status-response\":{\"source\":\"iana\"},\"application/tamp-update\":{\"source\":\"iana\"},\"application/tamp-update-confirm\":{\"source\":\"iana\"},\"application/tar\":{\"compressible\":true},\"application/taxii+json\":{\"source\":\"iana\",\"compressible\":true},\"application/tei+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"tei\",\"teicorpus\"]},\"application/tetra_isi\":{\"source\":\"iana\"},\"application/thraud+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"tfi\"]},\"application/timestamp-query\":{\"source\":\"iana\"},\"application/timestamp-reply\":{\"source\":\"iana\"},\"application/timestamped-data\":{\"source\":\"iana\",\"extensions\":[\"tsd\"]},\"application/tlsrpt+gzip\":{\"source\":\"iana\"},\"application/tlsrpt+json\":{\"source\":\"iana\",\"compressible\":true},\"application/tnauthlist\":{\"source\":\"iana\"},\"application/toml\":{\"compressible\":true,\"extensions\":[\"toml\"]},\"application/trickle-ice-sdpfrag\":{\"source\":\"iana\"},\"application/trig\":{\"source\":\"iana\"},\"application/ttml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ttml\"]},\"application/tve-trigger\":{\"source\":\"iana\"},\"application/tzif\":{\"source\":\"iana\"},\"application/tzif-leap\":{\"source\":\"iana\"},\"application/ulpfec\":{\"source\":\"iana\"},\"application/urc-grpsheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/urc-ressheet+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rsheet\"]},\"application/urc-targetdesc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/urc-uisocketdesc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vcard+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vcard+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vemmi\":{\"source\":\"iana\"},\"application/vividence.scriptfile\":{\"source\":\"apache\"},\"application/vnd.1000minds.decision-model+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"1km\"]},\"application/vnd.3gpp-prose+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp-prose-pc3ch+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp-v2x-local-service-information\":{\"source\":\"iana\"},\"application/vnd.3gpp.access-transfer-events+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.bsf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.gmop+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mc-signalling-ear\":{\"source\":\"iana\"},\"application/vnd.3gpp.mcdata-affiliation-command+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-payload\":{\"source\":\"iana\"},\"application/vnd.3gpp.mcdata-service-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-signalling\":{\"source\":\"iana\"},\"application/vnd.3gpp.mcdata-ue-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-user-profile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-affiliation-command+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-floor-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-location-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-mbms-usage-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-service-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-signed+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-ue-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-ue-init-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-user-profile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-affiliation-command+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-affiliation-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-location-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-mbms-usage-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-service-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-transmission-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-ue-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-user-profile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mid-call+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.pic-bw-large\":{\"source\":\"iana\",\"extensions\":[\"plb\"]},\"application/vnd.3gpp.pic-bw-small\":{\"source\":\"iana\",\"extensions\":[\"psb\"]},\"application/vnd.3gpp.pic-bw-var\":{\"source\":\"iana\",\"extensions\":[\"pvb\"]},\"application/vnd.3gpp.sms\":{\"source\":\"iana\"},\"application/vnd.3gpp.sms+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.srvcc-ext+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.srvcc-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.state-and-event-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.ussd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp2.bcmcsinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp2.sms\":{\"source\":\"iana\"},\"application/vnd.3gpp2.tcap\":{\"source\":\"iana\",\"extensions\":[\"tcap\"]},\"application/vnd.3lightssoftware.imagescal\":{\"source\":\"iana\"},\"application/vnd.3m.post-it-notes\":{\"source\":\"iana\",\"extensions\":[\"pwn\"]},\"application/vnd.accpac.simply.aso\":{\"source\":\"iana\",\"extensions\":[\"aso\"]},\"application/vnd.accpac.simply.imp\":{\"source\":\"iana\",\"extensions\":[\"imp\"]},\"application/vnd.acucobol\":{\"source\":\"iana\",\"extensions\":[\"acu\"]},\"application/vnd.acucorp\":{\"source\":\"iana\",\"extensions\":[\"atc\",\"acutc\"]},\"application/vnd.adobe.air-application-installer-package+zip\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"air\"]},\"application/vnd.adobe.flash.movie\":{\"source\":\"iana\"},\"application/vnd.adobe.formscentral.fcdt\":{\"source\":\"iana\",\"extensions\":[\"fcdt\"]},\"application/vnd.adobe.fxp\":{\"source\":\"iana\",\"extensions\":[\"fxp\",\"fxpl\"]},\"application/vnd.adobe.partial-upload\":{\"source\":\"iana\"},\"application/vnd.adobe.xdp+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdp\"]},\"application/vnd.adobe.xfdf\":{\"source\":\"iana\",\"extensions\":[\"xfdf\"]},\"application/vnd.aether.imp\":{\"source\":\"iana\"},\"application/vnd.afpc.afplinedata\":{\"source\":\"iana\"},\"application/vnd.afpc.afplinedata-pagedef\":{\"source\":\"iana\"},\"application/vnd.afpc.foca-charset\":{\"source\":\"iana\"},\"application/vnd.afpc.foca-codedfont\":{\"source\":\"iana\"},\"application/vnd.afpc.foca-codepage\":{\"source\":\"iana\"},\"application/vnd.afpc.modca\":{\"source\":\"iana\"},\"application/vnd.afpc.modca-formdef\":{\"source\":\"iana\"},\"application/vnd.afpc.modca-mediummap\":{\"source\":\"iana\"},\"application/vnd.afpc.modca-objectcontainer\":{\"source\":\"iana\"},\"application/vnd.afpc.modca-overlay\":{\"source\":\"iana\"},\"application/vnd.afpc.modca-pagesegment\":{\"source\":\"iana\"},\"application/vnd.ah-barcode\":{\"source\":\"iana\"},\"application/vnd.ahead.space\":{\"source\":\"iana\",\"extensions\":[\"ahead\"]},\"application/vnd.airzip.filesecure.azf\":{\"source\":\"iana\",\"extensions\":[\"azf\"]},\"application/vnd.airzip.filesecure.azs\":{\"source\":\"iana\",\"extensions\":[\"azs\"]},\"application/vnd.amadeus+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.amazon.ebook\":{\"source\":\"apache\",\"extensions\":[\"azw\"]},\"application/vnd.amazon.mobi8-ebook\":{\"source\":\"iana\"},\"application/vnd.americandynamics.acc\":{\"source\":\"iana\",\"extensions\":[\"acc\"]},\"application/vnd.amiga.ami\":{\"source\":\"iana\",\"extensions\":[\"ami\"]},\"application/vnd.amundsen.maze+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.android.ota\":{\"source\":\"iana\"},\"application/vnd.android.package-archive\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"apk\"]},\"application/vnd.anki\":{\"source\":\"iana\"},\"application/vnd.anser-web-certificate-issue-initiation\":{\"source\":\"iana\",\"extensions\":[\"cii\"]},\"application/vnd.anser-web-funds-transfer-initiation\":{\"source\":\"apache\",\"extensions\":[\"fti\"]},\"application/vnd.antix.game-component\":{\"source\":\"iana\",\"extensions\":[\"atx\"]},\"application/vnd.apache.thrift.binary\":{\"source\":\"iana\"},\"application/vnd.apache.thrift.compact\":{\"source\":\"iana\"},\"application/vnd.apache.thrift.json\":{\"source\":\"iana\"},\"application/vnd.api+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.aplextor.warrp+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.apothekende.reservation+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.apple.installer+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mpkg\"]},\"application/vnd.apple.keynote\":{\"source\":\"iana\",\"extensions\":[\"keynote\"]},\"application/vnd.apple.mpegurl\":{\"source\":\"iana\",\"extensions\":[\"m3u8\"]},\"application/vnd.apple.numbers\":{\"source\":\"iana\",\"extensions\":[\"numbers\"]},\"application/vnd.apple.pages\":{\"source\":\"iana\",\"extensions\":[\"pages\"]},\"application/vnd.apple.pkpass\":{\"compressible\":false,\"extensions\":[\"pkpass\"]},\"application/vnd.arastra.swi\":{\"source\":\"iana\"},\"application/vnd.aristanetworks.swi\":{\"source\":\"iana\",\"extensions\":[\"swi\"]},\"application/vnd.artisan+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.artsquare\":{\"source\":\"iana\"},\"application/vnd.astraea-software.iota\":{\"source\":\"iana\",\"extensions\":[\"iota\"]},\"application/vnd.audiograph\":{\"source\":\"iana\",\"extensions\":[\"aep\"]},\"application/vnd.autopackage\":{\"source\":\"iana\"},\"application/vnd.avalon+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.avistar+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.balsamiq.bmml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"bmml\"]},\"application/vnd.balsamiq.bmpr\":{\"source\":\"iana\"},\"application/vnd.banana-accounting\":{\"source\":\"iana\"},\"application/vnd.bbf.usp.error\":{\"source\":\"iana\"},\"application/vnd.bbf.usp.msg\":{\"source\":\"iana\"},\"application/vnd.bbf.usp.msg+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.bekitzur-stech+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.bint.med-content\":{\"source\":\"iana\"},\"application/vnd.biopax.rdf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.blink-idb-value-wrapper\":{\"source\":\"iana\"},\"application/vnd.blueice.multipass\":{\"source\":\"iana\",\"extensions\":[\"mpm\"]},\"application/vnd.bluetooth.ep.oob\":{\"source\":\"iana\"},\"application/vnd.bluetooth.le.oob\":{\"source\":\"iana\"},\"application/vnd.bmi\":{\"source\":\"iana\",\"extensions\":[\"bmi\"]},\"application/vnd.bpf\":{\"source\":\"iana\"},\"application/vnd.bpf3\":{\"source\":\"iana\"},\"application/vnd.businessobjects\":{\"source\":\"iana\",\"extensions\":[\"rep\"]},\"application/vnd.byu.uapi+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cab-jscript\":{\"source\":\"iana\"},\"application/vnd.canon-cpdl\":{\"source\":\"iana\"},\"application/vnd.canon-lips\":{\"source\":\"iana\"},\"application/vnd.capasystems-pg+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cendio.thinlinc.clientconf\":{\"source\":\"iana\"},\"application/vnd.century-systems.tcp_stream\":{\"source\":\"iana\"},\"application/vnd.chemdraw+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"cdxml\"]},\"application/vnd.chess-pgn\":{\"source\":\"iana\"},\"application/vnd.chipnuts.karaoke-mmd\":{\"source\":\"iana\",\"extensions\":[\"mmd\"]},\"application/vnd.ciedi\":{\"source\":\"iana\"},\"application/vnd.cinderella\":{\"source\":\"iana\",\"extensions\":[\"cdy\"]},\"application/vnd.cirpack.isdn-ext\":{\"source\":\"iana\"},\"application/vnd.citationstyles.style+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"csl\"]},\"application/vnd.claymore\":{\"source\":\"iana\",\"extensions\":[\"cla\"]},\"application/vnd.cloanto.rp9\":{\"source\":\"iana\",\"extensions\":[\"rp9\"]},\"application/vnd.clonk.c4group\":{\"source\":\"iana\",\"extensions\":[\"c4g\",\"c4d\",\"c4f\",\"c4p\",\"c4u\"]},\"application/vnd.cluetrust.cartomobile-config\":{\"source\":\"iana\",\"extensions\":[\"c11amc\"]},\"application/vnd.cluetrust.cartomobile-config-pkg\":{\"source\":\"iana\",\"extensions\":[\"c11amz\"]},\"application/vnd.coffeescript\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.document\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.document-template\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.presentation\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.presentation-template\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.spreadsheet\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.spreadsheet-template\":{\"source\":\"iana\"},\"application/vnd.collection+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.collection.doc+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.collection.next+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.comicbook+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.comicbook-rar\":{\"source\":\"iana\"},\"application/vnd.commerce-battelle\":{\"source\":\"iana\"},\"application/vnd.commonspace\":{\"source\":\"iana\",\"extensions\":[\"csp\"]},\"application/vnd.contact.cmsg\":{\"source\":\"iana\",\"extensions\":[\"cdbcmsg\"]},\"application/vnd.coreos.ignition+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cosmocaller\":{\"source\":\"iana\",\"extensions\":[\"cmc\"]},\"application/vnd.crick.clicker\":{\"source\":\"iana\",\"extensions\":[\"clkx\"]},\"application/vnd.crick.clicker.keyboard\":{\"source\":\"iana\",\"extensions\":[\"clkk\"]},\"application/vnd.crick.clicker.palette\":{\"source\":\"iana\",\"extensions\":[\"clkp\"]},\"application/vnd.crick.clicker.template\":{\"source\":\"iana\",\"extensions\":[\"clkt\"]},\"application/vnd.crick.clicker.wordbank\":{\"source\":\"iana\",\"extensions\":[\"clkw\"]},\"application/vnd.criticaltools.wbs+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wbs\"]},\"application/vnd.cryptii.pipe+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.crypto-shade-file\":{\"source\":\"iana\"},\"application/vnd.ctc-posml\":{\"source\":\"iana\",\"extensions\":[\"pml\"]},\"application/vnd.ctct.ws+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cups-pdf\":{\"source\":\"iana\"},\"application/vnd.cups-postscript\":{\"source\":\"iana\"},\"application/vnd.cups-ppd\":{\"source\":\"iana\",\"extensions\":[\"ppd\"]},\"application/vnd.cups-raster\":{\"source\":\"iana\"},\"application/vnd.cups-raw\":{\"source\":\"iana\"},\"application/vnd.curl\":{\"source\":\"iana\"},\"application/vnd.curl.car\":{\"source\":\"apache\",\"extensions\":[\"car\"]},\"application/vnd.curl.pcurl\":{\"source\":\"apache\",\"extensions\":[\"pcurl\"]},\"application/vnd.cyan.dean.root+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cybank\":{\"source\":\"iana\"},\"application/vnd.d2l.coursepackage1p0+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.dart\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dart\"]},\"application/vnd.data-vision.rdz\":{\"source\":\"iana\",\"extensions\":[\"rdz\"]},\"application/vnd.datapackage+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dataresource+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.debian.binary-package\":{\"source\":\"iana\"},\"application/vnd.dece.data\":{\"source\":\"iana\",\"extensions\":[\"uvf\",\"uvvf\",\"uvd\",\"uvvd\"]},\"application/vnd.dece.ttml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"uvt\",\"uvvt\"]},\"application/vnd.dece.unspecified\":{\"source\":\"iana\",\"extensions\":[\"uvx\",\"uvvx\"]},\"application/vnd.dece.zip\":{\"source\":\"iana\",\"extensions\":[\"uvz\",\"uvvz\"]},\"application/vnd.denovo.fcselayout-link\":{\"source\":\"iana\",\"extensions\":[\"fe_launch\"]},\"application/vnd.desmume.movie\":{\"source\":\"iana\"},\"application/vnd.dir-bi.plate-dl-nosuffix\":{\"source\":\"iana\"},\"application/vnd.dm.delegation+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dna\":{\"source\":\"iana\",\"extensions\":[\"dna\"]},\"application/vnd.document+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dolby.mlp\":{\"source\":\"apache\",\"extensions\":[\"mlp\"]},\"application/vnd.dolby.mobile.1\":{\"source\":\"iana\"},\"application/vnd.dolby.mobile.2\":{\"source\":\"iana\"},\"application/vnd.doremir.scorecloud-binary-document\":{\"source\":\"iana\"},\"application/vnd.dpgraph\":{\"source\":\"iana\",\"extensions\":[\"dpg\"]},\"application/vnd.dreamfactory\":{\"source\":\"iana\",\"extensions\":[\"dfac\"]},\"application/vnd.drive+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ds-keypoint\":{\"source\":\"apache\",\"extensions\":[\"kpxx\"]},\"application/vnd.dtg.local\":{\"source\":\"iana\"},\"application/vnd.dtg.local.flash\":{\"source\":\"iana\"},\"application/vnd.dtg.local.html\":{\"source\":\"iana\"},\"application/vnd.dvb.ait\":{\"source\":\"iana\",\"extensions\":[\"ait\"]},\"application/vnd.dvb.dvbj\":{\"source\":\"iana\"},\"application/vnd.dvb.esgcontainer\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcdftnotifaccess\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcesgaccess\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcesgaccess2\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcesgpdd\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcroaming\":{\"source\":\"iana\"},\"application/vnd.dvb.iptv.alfec-base\":{\"source\":\"iana\"},\"application/vnd.dvb.iptv.alfec-enhancement\":{\"source\":\"iana\"},\"application/vnd.dvb.notif-aggregate-root+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-container+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-generic+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-ia-msglist+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-ia-registration-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-ia-registration-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-init+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.pfr\":{\"source\":\"iana\"},\"application/vnd.dvb.service\":{\"source\":\"iana\",\"extensions\":[\"svc\"]},\"application/vnd.dxr\":{\"source\":\"iana\"},\"application/vnd.dynageo\":{\"source\":\"iana\",\"extensions\":[\"geo\"]},\"application/vnd.dzr\":{\"source\":\"iana\"},\"application/vnd.easykaraoke.cdgdownload\":{\"source\":\"iana\"},\"application/vnd.ecdis-update\":{\"source\":\"iana\"},\"application/vnd.ecip.rlp\":{\"source\":\"iana\"},\"application/vnd.ecowin.chart\":{\"source\":\"iana\",\"extensions\":[\"mag\"]},\"application/vnd.ecowin.filerequest\":{\"source\":\"iana\"},\"application/vnd.ecowin.fileupdate\":{\"source\":\"iana\"},\"application/vnd.ecowin.series\":{\"source\":\"iana\"},\"application/vnd.ecowin.seriesrequest\":{\"source\":\"iana\"},\"application/vnd.ecowin.seriesupdate\":{\"source\":\"iana\"},\"application/vnd.efi.img\":{\"source\":\"iana\"},\"application/vnd.efi.iso\":{\"source\":\"iana\"},\"application/vnd.emclient.accessrequest+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.enliven\":{\"source\":\"iana\",\"extensions\":[\"nml\"]},\"application/vnd.enphase.envoy\":{\"source\":\"iana\"},\"application/vnd.eprints.data+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.epson.esf\":{\"source\":\"iana\",\"extensions\":[\"esf\"]},\"application/vnd.epson.msf\":{\"source\":\"iana\",\"extensions\":[\"msf\"]},\"application/vnd.epson.quickanime\":{\"source\":\"iana\",\"extensions\":[\"qam\"]},\"application/vnd.epson.salt\":{\"source\":\"iana\",\"extensions\":[\"slt\"]},\"application/vnd.epson.ssf\":{\"source\":\"iana\",\"extensions\":[\"ssf\"]},\"application/vnd.ericsson.quickcall\":{\"source\":\"iana\"},\"application/vnd.espass-espass+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.eszigno3+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"es3\",\"et3\"]},\"application/vnd.etsi.aoc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.asic-e+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.etsi.asic-s+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.etsi.cug+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvcommand+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvdiscovery+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsad-bc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsad-cod+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsad-npvr+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvservice+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsync+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvueprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.mcid+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.mheg5\":{\"source\":\"iana\"},\"application/vnd.etsi.overload-control-policy-dataset+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.pstn+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.sci+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.simservs+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.timestamp-token\":{\"source\":\"iana\"},\"application/vnd.etsi.tsl+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.tsl.der\":{\"source\":\"iana\"},\"application/vnd.eudora.data\":{\"source\":\"iana\"},\"application/vnd.evolv.ecig.profile\":{\"source\":\"iana\"},\"application/vnd.evolv.ecig.settings\":{\"source\":\"iana\"},\"application/vnd.evolv.ecig.theme\":{\"source\":\"iana\"},\"application/vnd.exstream-empower+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.exstream-package\":{\"source\":\"iana\"},\"application/vnd.ezpix-album\":{\"source\":\"iana\",\"extensions\":[\"ez2\"]},\"application/vnd.ezpix-package\":{\"source\":\"iana\",\"extensions\":[\"ez3\"]},\"application/vnd.f-secure.mobile\":{\"source\":\"iana\"},\"application/vnd.fastcopy-disk-image\":{\"source\":\"iana\"},\"application/vnd.fdf\":{\"source\":\"iana\",\"extensions\":[\"fdf\"]},\"application/vnd.fdsn.mseed\":{\"source\":\"iana\",\"extensions\":[\"mseed\"]},\"application/vnd.fdsn.seed\":{\"source\":\"iana\",\"extensions\":[\"seed\",\"dataless\"]},\"application/vnd.ffsns\":{\"source\":\"iana\"},\"application/vnd.ficlab.flb+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.filmit.zfc\":{\"source\":\"iana\"},\"application/vnd.fints\":{\"source\":\"iana\"},\"application/vnd.firemonkeys.cloudcell\":{\"source\":\"iana\"},\"application/vnd.flographit\":{\"source\":\"iana\",\"extensions\":[\"gph\"]},\"application/vnd.fluxtime.clip\":{\"source\":\"iana\",\"extensions\":[\"ftc\"]},\"application/vnd.font-fontforge-sfd\":{\"source\":\"iana\"},\"application/vnd.framemaker\":{\"source\":\"iana\",\"extensions\":[\"fm\",\"frame\",\"maker\",\"book\"]},\"application/vnd.frogans.fnc\":{\"source\":\"iana\",\"extensions\":[\"fnc\"]},\"application/vnd.frogans.ltf\":{\"source\":\"iana\",\"extensions\":[\"ltf\"]},\"application/vnd.fsc.weblaunch\":{\"source\":\"iana\",\"extensions\":[\"fsc\"]},\"application/vnd.fujitsu.oasys\":{\"source\":\"iana\",\"extensions\":[\"oas\"]},\"application/vnd.fujitsu.oasys2\":{\"source\":\"iana\",\"extensions\":[\"oa2\"]},\"application/vnd.fujitsu.oasys3\":{\"source\":\"iana\",\"extensions\":[\"oa3\"]},\"application/vnd.fujitsu.oasysgp\":{\"source\":\"iana\",\"extensions\":[\"fg5\"]},\"application/vnd.fujitsu.oasysprs\":{\"source\":\"iana\",\"extensions\":[\"bh2\"]},\"application/vnd.fujixerox.art-ex\":{\"source\":\"iana\"},\"application/vnd.fujixerox.art4\":{\"source\":\"iana\"},\"application/vnd.fujixerox.ddd\":{\"source\":\"iana\",\"extensions\":[\"ddd\"]},\"application/vnd.fujixerox.docuworks\":{\"source\":\"iana\",\"extensions\":[\"xdw\"]},\"application/vnd.fujixerox.docuworks.binder\":{\"source\":\"iana\",\"extensions\":[\"xbd\"]},\"application/vnd.fujixerox.docuworks.container\":{\"source\":\"iana\"},\"application/vnd.fujixerox.hbpl\":{\"source\":\"iana\"},\"application/vnd.fut-misnet\":{\"source\":\"iana\"},\"application/vnd.futoin+cbor\":{\"source\":\"iana\"},\"application/vnd.futoin+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.fuzzysheet\":{\"source\":\"iana\",\"extensions\":[\"fzs\"]},\"application/vnd.genomatix.tuxedo\":{\"source\":\"iana\",\"extensions\":[\"txd\"]},\"application/vnd.gentics.grd+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.geo+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.geocube+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.geogebra.file\":{\"source\":\"iana\",\"extensions\":[\"ggb\"]},\"application/vnd.geogebra.tool\":{\"source\":\"iana\",\"extensions\":[\"ggt\"]},\"application/vnd.geometry-explorer\":{\"source\":\"iana\",\"extensions\":[\"gex\",\"gre\"]},\"application/vnd.geonext\":{\"source\":\"iana\",\"extensions\":[\"gxt\"]},\"application/vnd.geoplan\":{\"source\":\"iana\",\"extensions\":[\"g2w\"]},\"application/vnd.geospace\":{\"source\":\"iana\",\"extensions\":[\"g3w\"]},\"application/vnd.gerber\":{\"source\":\"iana\"},\"application/vnd.globalplatform.card-content-mgt\":{\"source\":\"iana\"},\"application/vnd.globalplatform.card-content-mgt-response\":{\"source\":\"iana\"},\"application/vnd.gmx\":{\"source\":\"iana\",\"extensions\":[\"gmx\"]},\"application/vnd.google-apps.document\":{\"compressible\":false,\"extensions\":[\"gdoc\"]},\"application/vnd.google-apps.presentation\":{\"compressible\":false,\"extensions\":[\"gslides\"]},\"application/vnd.google-apps.spreadsheet\":{\"compressible\":false,\"extensions\":[\"gsheet\"]},\"application/vnd.google-earth.kml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"kml\"]},\"application/vnd.google-earth.kmz\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"kmz\"]},\"application/vnd.gov.sk.e-form+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.gov.sk.e-form+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.gov.sk.xmldatacontainer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.grafeq\":{\"source\":\"iana\",\"extensions\":[\"gqf\",\"gqs\"]},\"application/vnd.gridmp\":{\"source\":\"iana\"},\"application/vnd.groove-account\":{\"source\":\"iana\",\"extensions\":[\"gac\"]},\"application/vnd.groove-help\":{\"source\":\"iana\",\"extensions\":[\"ghf\"]},\"application/vnd.groove-identity-message\":{\"source\":\"iana\",\"extensions\":[\"gim\"]},\"application/vnd.groove-injector\":{\"source\":\"iana\",\"extensions\":[\"grv\"]},\"application/vnd.groove-tool-message\":{\"source\":\"iana\",\"extensions\":[\"gtm\"]},\"application/vnd.groove-tool-template\":{\"source\":\"iana\",\"extensions\":[\"tpl\"]},\"application/vnd.groove-vcard\":{\"source\":\"iana\",\"extensions\":[\"vcg\"]},\"application/vnd.hal+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hal+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"hal\"]},\"application/vnd.handheld-entertainment+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"zmm\"]},\"application/vnd.hbci\":{\"source\":\"iana\",\"extensions\":[\"hbci\"]},\"application/vnd.hc+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hcl-bireports\":{\"source\":\"iana\"},\"application/vnd.hdt\":{\"source\":\"iana\"},\"application/vnd.heroku+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hhe.lesson-player\":{\"source\":\"iana\",\"extensions\":[\"les\"]},\"application/vnd.hp-hpgl\":{\"source\":\"iana\",\"extensions\":[\"hpgl\"]},\"application/vnd.hp-hpid\":{\"source\":\"iana\",\"extensions\":[\"hpid\"]},\"application/vnd.hp-hps\":{\"source\":\"iana\",\"extensions\":[\"hps\"]},\"application/vnd.hp-jlyt\":{\"source\":\"iana\",\"extensions\":[\"jlt\"]},\"application/vnd.hp-pcl\":{\"source\":\"iana\",\"extensions\":[\"pcl\"]},\"application/vnd.hp-pclxl\":{\"source\":\"iana\",\"extensions\":[\"pclxl\"]},\"application/vnd.httphone\":{\"source\":\"iana\"},\"application/vnd.hydrostatix.sof-data\":{\"source\":\"iana\",\"extensions\":[\"sfd-hdstx\"]},\"application/vnd.hyper+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hyper-item+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hyperdrive+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hzn-3d-crossword\":{\"source\":\"iana\"},\"application/vnd.ibm.afplinedata\":{\"source\":\"iana\"},\"application/vnd.ibm.electronic-media\":{\"source\":\"iana\"},\"application/vnd.ibm.minipay\":{\"source\":\"iana\",\"extensions\":[\"mpy\"]},\"application/vnd.ibm.modcap\":{\"source\":\"iana\",\"extensions\":[\"afp\",\"listafp\",\"list3820\"]},\"application/vnd.ibm.rights-management\":{\"source\":\"iana\",\"extensions\":[\"irm\"]},\"application/vnd.ibm.secure-container\":{\"source\":\"iana\",\"extensions\":[\"sc\"]},\"application/vnd.iccprofile\":{\"source\":\"iana\",\"extensions\":[\"icc\",\"icm\"]},\"application/vnd.ieee.1905\":{\"source\":\"iana\"},\"application/vnd.igloader\":{\"source\":\"iana\",\"extensions\":[\"igl\"]},\"application/vnd.imagemeter.folder+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.imagemeter.image+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.immervision-ivp\":{\"source\":\"iana\",\"extensions\":[\"ivp\"]},\"application/vnd.immervision-ivu\":{\"source\":\"iana\",\"extensions\":[\"ivu\"]},\"application/vnd.ims.imsccv1p1\":{\"source\":\"iana\"},\"application/vnd.ims.imsccv1p2\":{\"source\":\"iana\"},\"application/vnd.ims.imsccv1p3\":{\"source\":\"iana\"},\"application/vnd.ims.lis.v2.result+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolconsumerprofile+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolproxy+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolproxy.id+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolsettings+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolsettings.simple+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.informedcontrol.rms+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.informix-visionary\":{\"source\":\"iana\"},\"application/vnd.infotech.project\":{\"source\":\"iana\"},\"application/vnd.infotech.project+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.innopath.wamp.notification\":{\"source\":\"iana\"},\"application/vnd.insors.igm\":{\"source\":\"iana\",\"extensions\":[\"igm\"]},\"application/vnd.intercon.formnet\":{\"source\":\"iana\",\"extensions\":[\"xpw\",\"xpx\"]},\"application/vnd.intergeo\":{\"source\":\"iana\",\"extensions\":[\"i2g\"]},\"application/vnd.intertrust.digibox\":{\"source\":\"iana\"},\"application/vnd.intertrust.nncp\":{\"source\":\"iana\"},\"application/vnd.intu.qbo\":{\"source\":\"iana\",\"extensions\":[\"qbo\"]},\"application/vnd.intu.qfx\":{\"source\":\"iana\",\"extensions\":[\"qfx\"]},\"application/vnd.iptc.g2.catalogitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.conceptitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.knowledgeitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.newsitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.newsmessage+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.packageitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.planningitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ipunplugged.rcprofile\":{\"source\":\"iana\",\"extensions\":[\"rcprofile\"]},\"application/vnd.irepository.package+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"irp\"]},\"application/vnd.is-xpr\":{\"source\":\"iana\",\"extensions\":[\"xpr\"]},\"application/vnd.isac.fcs\":{\"source\":\"iana\",\"extensions\":[\"fcs\"]},\"application/vnd.iso11783-10+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.jam\":{\"source\":\"iana\",\"extensions\":[\"jam\"]},\"application/vnd.japannet-directory-service\":{\"source\":\"iana\"},\"application/vnd.japannet-jpnstore-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-payment-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-registration\":{\"source\":\"iana\"},\"application/vnd.japannet-registration-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-setstore-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-verification\":{\"source\":\"iana\"},\"application/vnd.japannet-verification-wakeup\":{\"source\":\"iana\"},\"application/vnd.jcp.javame.midlet-rms\":{\"source\":\"iana\",\"extensions\":[\"rms\"]},\"application/vnd.jisp\":{\"source\":\"iana\",\"extensions\":[\"jisp\"]},\"application/vnd.joost.joda-archive\":{\"source\":\"iana\",\"extensions\":[\"joda\"]},\"application/vnd.jsk.isdn-ngn\":{\"source\":\"iana\"},\"application/vnd.kahootz\":{\"source\":\"iana\",\"extensions\":[\"ktz\",\"ktr\"]},\"application/vnd.kde.karbon\":{\"source\":\"iana\",\"extensions\":[\"karbon\"]},\"application/vnd.kde.kchart\":{\"source\":\"iana\",\"extensions\":[\"chrt\"]},\"application/vnd.kde.kformula\":{\"source\":\"iana\",\"extensions\":[\"kfo\"]},\"application/vnd.kde.kivio\":{\"source\":\"iana\",\"extensions\":[\"flw\"]},\"application/vnd.kde.kontour\":{\"source\":\"iana\",\"extensions\":[\"kon\"]},\"application/vnd.kde.kpresenter\":{\"source\":\"iana\",\"extensions\":[\"kpr\",\"kpt\"]},\"application/vnd.kde.kspread\":{\"source\":\"iana\",\"extensions\":[\"ksp\"]},\"application/vnd.kde.kword\":{\"source\":\"iana\",\"extensions\":[\"kwd\",\"kwt\"]},\"application/vnd.kenameaapp\":{\"source\":\"iana\",\"extensions\":[\"htke\"]},\"application/vnd.kidspiration\":{\"source\":\"iana\",\"extensions\":[\"kia\"]},\"application/vnd.kinar\":{\"source\":\"iana\",\"extensions\":[\"kne\",\"knp\"]},\"application/vnd.koan\":{\"source\":\"iana\",\"extensions\":[\"skp\",\"skd\",\"skt\",\"skm\"]},\"application/vnd.kodak-descriptor\":{\"source\":\"iana\",\"extensions\":[\"sse\"]},\"application/vnd.las\":{\"source\":\"iana\"},\"application/vnd.las.las+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.las.las+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lasxml\"]},\"application/vnd.laszip\":{\"source\":\"iana\"},\"application/vnd.leap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.liberty-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.llamagraphics.life-balance.desktop\":{\"source\":\"iana\",\"extensions\":[\"lbd\"]},\"application/vnd.llamagraphics.life-balance.exchange+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lbe\"]},\"application/vnd.logipipe.circuit+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.loom\":{\"source\":\"iana\"},\"application/vnd.lotus-1-2-3\":{\"source\":\"iana\",\"extensions\":[\"123\"]},\"application/vnd.lotus-approach\":{\"source\":\"iana\",\"extensions\":[\"apr\"]},\"application/vnd.lotus-freelance\":{\"source\":\"iana\",\"extensions\":[\"pre\"]},\"application/vnd.lotus-notes\":{\"source\":\"iana\",\"extensions\":[\"nsf\"]},\"application/vnd.lotus-organizer\":{\"source\":\"iana\",\"extensions\":[\"org\"]},\"application/vnd.lotus-screencam\":{\"source\":\"iana\",\"extensions\":[\"scm\"]},\"application/vnd.lotus-wordpro\":{\"source\":\"iana\",\"extensions\":[\"lwp\"]},\"application/vnd.macports.portpkg\":{\"source\":\"iana\",\"extensions\":[\"portpkg\"]},\"application/vnd.mapbox-vector-tile\":{\"source\":\"iana\"},\"application/vnd.marlin.drm.actiontoken+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.marlin.drm.conftoken+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.marlin.drm.license+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.marlin.drm.mdcf\":{\"source\":\"iana\"},\"application/vnd.mason+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.maxmind.maxmind-db\":{\"source\":\"iana\"},\"application/vnd.mcd\":{\"source\":\"iana\",\"extensions\":[\"mcd\"]},\"application/vnd.medcalcdata\":{\"source\":\"iana\",\"extensions\":[\"mc1\"]},\"application/vnd.mediastation.cdkey\":{\"source\":\"iana\",\"extensions\":[\"cdkey\"]},\"application/vnd.meridian-slingshot\":{\"source\":\"iana\"},\"application/vnd.mfer\":{\"source\":\"iana\",\"extensions\":[\"mwf\"]},\"application/vnd.mfmp\":{\"source\":\"iana\",\"extensions\":[\"mfm\"]},\"application/vnd.micro+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.micrografx.flo\":{\"source\":\"iana\",\"extensions\":[\"flo\"]},\"application/vnd.micrografx.igx\":{\"source\":\"iana\",\"extensions\":[\"igx\"]},\"application/vnd.microsoft.portable-executable\":{\"source\":\"iana\"},\"application/vnd.microsoft.windows.thumbnail-cache\":{\"source\":\"iana\"},\"application/vnd.miele+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.mif\":{\"source\":\"iana\",\"extensions\":[\"mif\"]},\"application/vnd.minisoft-hp3000-save\":{\"source\":\"iana\"},\"application/vnd.mitsubishi.misty-guard.trustweb\":{\"source\":\"iana\"},\"application/vnd.mobius.daf\":{\"source\":\"iana\",\"extensions\":[\"daf\"]},\"application/vnd.mobius.dis\":{\"source\":\"iana\",\"extensions\":[\"dis\"]},\"application/vnd.mobius.mbk\":{\"source\":\"iana\",\"extensions\":[\"mbk\"]},\"application/vnd.mobius.mqy\":{\"source\":\"iana\",\"extensions\":[\"mqy\"]},\"application/vnd.mobius.msl\":{\"source\":\"iana\",\"extensions\":[\"msl\"]},\"application/vnd.mobius.plc\":{\"source\":\"iana\",\"extensions\":[\"plc\"]},\"application/vnd.mobius.txf\":{\"source\":\"iana\",\"extensions\":[\"txf\"]},\"application/vnd.mophun.application\":{\"source\":\"iana\",\"extensions\":[\"mpn\"]},\"application/vnd.mophun.certificate\":{\"source\":\"iana\",\"extensions\":[\"mpc\"]},\"application/vnd.motorola.flexsuite\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.adsi\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.fis\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.gotap\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.kmr\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.ttc\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.wem\":{\"source\":\"iana\"},\"application/vnd.motorola.iprm\":{\"source\":\"iana\"},\"application/vnd.mozilla.xul+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xul\"]},\"application/vnd.ms-3mfdocument\":{\"source\":\"iana\"},\"application/vnd.ms-artgalry\":{\"source\":\"iana\",\"extensions\":[\"cil\"]},\"application/vnd.ms-asf\":{\"source\":\"iana\"},\"application/vnd.ms-cab-compressed\":{\"source\":\"iana\",\"extensions\":[\"cab\"]},\"application/vnd.ms-color.iccprofile\":{\"source\":\"apache\"},\"application/vnd.ms-excel\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"xls\",\"xlm\",\"xla\",\"xlc\",\"xlt\",\"xlw\"]},\"application/vnd.ms-excel.addin.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xlam\"]},\"application/vnd.ms-excel.sheet.binary.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xlsb\"]},\"application/vnd.ms-excel.sheet.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xlsm\"]},\"application/vnd.ms-excel.template.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xltm\"]},\"application/vnd.ms-fontobject\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"eot\"]},\"application/vnd.ms-htmlhelp\":{\"source\":\"iana\",\"extensions\":[\"chm\"]},\"application/vnd.ms-ims\":{\"source\":\"iana\",\"extensions\":[\"ims\"]},\"application/vnd.ms-lrm\":{\"source\":\"iana\",\"extensions\":[\"lrm\"]},\"application/vnd.ms-office.activex+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-officetheme\":{\"source\":\"iana\",\"extensions\":[\"thmx\"]},\"application/vnd.ms-opentype\":{\"source\":\"apache\",\"compressible\":true},\"application/vnd.ms-outlook\":{\"compressible\":false,\"extensions\":[\"msg\"]},\"application/vnd.ms-package.obfuscated-opentype\":{\"source\":\"apache\"},\"application/vnd.ms-pki.seccat\":{\"source\":\"apache\",\"extensions\":[\"cat\"]},\"application/vnd.ms-pki.stl\":{\"source\":\"apache\",\"extensions\":[\"stl\"]},\"application/vnd.ms-playready.initiator+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-powerpoint\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ppt\",\"pps\",\"pot\"]},\"application/vnd.ms-powerpoint.addin.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"ppam\"]},\"application/vnd.ms-powerpoint.presentation.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"pptm\"]},\"application/vnd.ms-powerpoint.slide.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"sldm\"]},\"application/vnd.ms-powerpoint.slideshow.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"ppsm\"]},\"application/vnd.ms-powerpoint.template.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"potm\"]},\"application/vnd.ms-printdevicecapabilities+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-printing.printticket+xml\":{\"source\":\"apache\",\"compressible\":true},\"application/vnd.ms-printschematicket+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-project\":{\"source\":\"iana\",\"extensions\":[\"mpp\",\"mpt\"]},\"application/vnd.ms-tnef\":{\"source\":\"iana\"},\"application/vnd.ms-windows.devicepairing\":{\"source\":\"iana\"},\"application/vnd.ms-windows.nwprinting.oob\":{\"source\":\"iana\"},\"application/vnd.ms-windows.printerpairing\":{\"source\":\"iana\"},\"application/vnd.ms-windows.wsd.oob\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.lic-chlg-req\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.lic-resp\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.meter-chlg-req\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.meter-resp\":{\"source\":\"iana\"},\"application/vnd.ms-word.document.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"docm\"]},\"application/vnd.ms-word.template.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"dotm\"]},\"application/vnd.ms-works\":{\"source\":\"iana\",\"extensions\":[\"wps\",\"wks\",\"wcm\",\"wdb\"]},\"application/vnd.ms-wpl\":{\"source\":\"iana\",\"extensions\":[\"wpl\"]},\"application/vnd.ms-xpsdocument\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"xps\"]},\"application/vnd.msa-disk-image\":{\"source\":\"iana\"},\"application/vnd.mseq\":{\"source\":\"iana\",\"extensions\":[\"mseq\"]},\"application/vnd.msign\":{\"source\":\"iana\"},\"application/vnd.multiad.creator\":{\"source\":\"iana\"},\"application/vnd.multiad.creator.cif\":{\"source\":\"iana\"},\"application/vnd.music-niff\":{\"source\":\"iana\"},\"application/vnd.musician\":{\"source\":\"iana\",\"extensions\":[\"mus\"]},\"application/vnd.muvee.style\":{\"source\":\"iana\",\"extensions\":[\"msty\"]},\"application/vnd.mynfc\":{\"source\":\"iana\",\"extensions\":[\"taglet\"]},\"application/vnd.ncd.control\":{\"source\":\"iana\"},\"application/vnd.ncd.reference\":{\"source\":\"iana\"},\"application/vnd.nearst.inv+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nervana\":{\"source\":\"iana\"},\"application/vnd.netfpx\":{\"source\":\"iana\"},\"application/vnd.neurolanguage.nlu\":{\"source\":\"iana\",\"extensions\":[\"nlu\"]},\"application/vnd.nimn\":{\"source\":\"iana\"},\"application/vnd.nintendo.nitro.rom\":{\"source\":\"iana\"},\"application/vnd.nintendo.snes.rom\":{\"source\":\"iana\"},\"application/vnd.nitf\":{\"source\":\"iana\",\"extensions\":[\"ntf\",\"nitf\"]},\"application/vnd.noblenet-directory\":{\"source\":\"iana\",\"extensions\":[\"nnd\"]},\"application/vnd.noblenet-sealer\":{\"source\":\"iana\",\"extensions\":[\"nns\"]},\"application/vnd.noblenet-web\":{\"source\":\"iana\",\"extensions\":[\"nnw\"]},\"application/vnd.nokia.catalogs\":{\"source\":\"iana\"},\"application/vnd.nokia.conml+wbxml\":{\"source\":\"iana\"},\"application/vnd.nokia.conml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.iptv.config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.isds-radio-presets\":{\"source\":\"iana\"},\"application/vnd.nokia.landmark+wbxml\":{\"source\":\"iana\"},\"application/vnd.nokia.landmark+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.landmarkcollection+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.n-gage.ac+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ac\"]},\"application/vnd.nokia.n-gage.data\":{\"source\":\"iana\",\"extensions\":[\"ngdat\"]},\"application/vnd.nokia.n-gage.symbian.install\":{\"source\":\"iana\",\"extensions\":[\"n-gage\"]},\"application/vnd.nokia.ncd\":{\"source\":\"iana\"},\"application/vnd.nokia.pcd+wbxml\":{\"source\":\"iana\"},\"application/vnd.nokia.pcd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.radio-preset\":{\"source\":\"iana\",\"extensions\":[\"rpst\"]},\"application/vnd.nokia.radio-presets\":{\"source\":\"iana\",\"extensions\":[\"rpss\"]},\"application/vnd.novadigm.edm\":{\"source\":\"iana\",\"extensions\":[\"edm\"]},\"application/vnd.novadigm.edx\":{\"source\":\"iana\",\"extensions\":[\"edx\"]},\"application/vnd.novadigm.ext\":{\"source\":\"iana\",\"extensions\":[\"ext\"]},\"application/vnd.ntt-local.content-share\":{\"source\":\"iana\"},\"application/vnd.ntt-local.file-transfer\":{\"source\":\"iana\"},\"application/vnd.ntt-local.ogw_remote-access\":{\"source\":\"iana\"},\"application/vnd.ntt-local.sip-ta_remote\":{\"source\":\"iana\"},\"application/vnd.ntt-local.sip-ta_tcp_stream\":{\"source\":\"iana\"},\"application/vnd.oasis.opendocument.chart\":{\"source\":\"iana\",\"extensions\":[\"odc\"]},\"application/vnd.oasis.opendocument.chart-template\":{\"source\":\"iana\",\"extensions\":[\"otc\"]},\"application/vnd.oasis.opendocument.database\":{\"source\":\"iana\",\"extensions\":[\"odb\"]},\"application/vnd.oasis.opendocument.formula\":{\"source\":\"iana\",\"extensions\":[\"odf\"]},\"application/vnd.oasis.opendocument.formula-template\":{\"source\":\"iana\",\"extensions\":[\"odft\"]},\"application/vnd.oasis.opendocument.graphics\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"odg\"]},\"application/vnd.oasis.opendocument.graphics-template\":{\"source\":\"iana\",\"extensions\":[\"otg\"]},\"application/vnd.oasis.opendocument.image\":{\"source\":\"iana\",\"extensions\":[\"odi\"]},\"application/vnd.oasis.opendocument.image-template\":{\"source\":\"iana\",\"extensions\":[\"oti\"]},\"application/vnd.oasis.opendocument.presentation\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"odp\"]},\"application/vnd.oasis.opendocument.presentation-template\":{\"source\":\"iana\",\"extensions\":[\"otp\"]},\"application/vnd.oasis.opendocument.spreadsheet\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ods\"]},\"application/vnd.oasis.opendocument.spreadsheet-template\":{\"source\":\"iana\",\"extensions\":[\"ots\"]},\"application/vnd.oasis.opendocument.text\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"odt\"]},\"application/vnd.oasis.opendocument.text-master\":{\"source\":\"iana\",\"extensions\":[\"odm\"]},\"application/vnd.oasis.opendocument.text-template\":{\"source\":\"iana\",\"extensions\":[\"ott\"]},\"application/vnd.oasis.opendocument.text-web\":{\"source\":\"iana\",\"extensions\":[\"oth\"]},\"application/vnd.obn\":{\"source\":\"iana\"},\"application/vnd.ocf+cbor\":{\"source\":\"iana\"},\"application/vnd.oftn.l10n+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.contentaccessdownload+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.contentaccessstreaming+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.cspg-hexbinary\":{\"source\":\"iana\"},\"application/vnd.oipf.dae.svg+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.dae.xhtml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.mippvcontrolmessage+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.pae.gem\":{\"source\":\"iana\"},\"application/vnd.oipf.spdiscovery+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.spdlist+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.ueprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.userprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.olpc-sugar\":{\"source\":\"iana\",\"extensions\":[\"xo\"]},\"application/vnd.oma-scws-config\":{\"source\":\"iana\"},\"application/vnd.oma-scws-http-request\":{\"source\":\"iana\"},\"application/vnd.oma-scws-http-response\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.associated-procedure-parameter+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.drm-trigger+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.imd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.ltkm\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.notification+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.provisioningtrigger\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.sgboot\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.sgdd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.sgdu\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.simple-symbol-container\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.smartcard-trigger+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.sprov+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.stkm\":{\"source\":\"iana\"},\"application/vnd.oma.cab-address-book+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-feature-handler+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-pcc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-subs-invite+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-user-prefs+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.dcd\":{\"source\":\"iana\"},\"application/vnd.oma.dcdc\":{\"source\":\"iana\"},\"application/vnd.oma.dd2+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dd2\"]},\"application/vnd.oma.drm.risd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.group-usage-list+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.lwm2m+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.lwm2m+tlv\":{\"source\":\"iana\"},\"application/vnd.oma.pal+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.detailed-progress-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.final-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.groups+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.invocation-descriptor+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.optimized-progress-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.push\":{\"source\":\"iana\"},\"application/vnd.oma.scidm.messages+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.xcap-directory+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omads-email+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omads-file+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omads-folder+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omaloc-supl-init\":{\"source\":\"iana\"},\"application/vnd.onepager\":{\"source\":\"iana\"},\"application/vnd.onepagertamp\":{\"source\":\"iana\"},\"application/vnd.onepagertamx\":{\"source\":\"iana\"},\"application/vnd.onepagertat\":{\"source\":\"iana\"},\"application/vnd.onepagertatp\":{\"source\":\"iana\"},\"application/vnd.onepagertatx\":{\"source\":\"iana\"},\"application/vnd.openblox.game+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"obgx\"]},\"application/vnd.openblox.game-binary\":{\"source\":\"iana\"},\"application/vnd.openeye.oeb\":{\"source\":\"iana\"},\"application/vnd.openofficeorg.extension\":{\"source\":\"apache\",\"extensions\":[\"oxt\"]},\"application/vnd.openstreetmap.data+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"osm\"]},\"application/vnd.openxmlformats-officedocument.custom-properties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.customxmlproperties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawing+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.chart+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.extended-properties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.comments+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.presentation\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"pptx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slide\":{\"source\":\"iana\",\"extensions\":[\"sldx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.slide+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slideshow\":{\"source\":\"iana\",\"extensions\":[\"ppsx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.tags+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.template\":{\"source\":\"iana\",\"extensions\":[\"potx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"xlsx\"]},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.template\":{\"source\":\"iana\",\"extensions\":[\"xltx\"]},\"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.theme+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.themeoverride+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.vmldrawing\":{\"source\":\"iana\"},\"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"docx\"]},\"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.template\":{\"source\":\"iana\",\"extensions\":[\"dotx\"]},\"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-package.core-properties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-package.relationships+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oracle.resource+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.orange.indata\":{\"source\":\"iana\"},\"application/vnd.osa.netdeploy\":{\"source\":\"iana\"},\"application/vnd.osgeo.mapguide.package\":{\"source\":\"iana\",\"extensions\":[\"mgp\"]},\"application/vnd.osgi.bundle\":{\"source\":\"iana\"},\"application/vnd.osgi.dp\":{\"source\":\"iana\",\"extensions\":[\"dp\"]},\"application/vnd.osgi.subsystem\":{\"source\":\"iana\",\"extensions\":[\"esa\"]},\"application/vnd.otps.ct-kip+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oxli.countgraph\":{\"source\":\"iana\"},\"application/vnd.pagerduty+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.palm\":{\"source\":\"iana\",\"extensions\":[\"pdb\",\"pqa\",\"oprc\"]},\"application/vnd.panoply\":{\"source\":\"iana\"},\"application/vnd.paos.xml\":{\"source\":\"iana\"},\"application/vnd.patentdive\":{\"source\":\"iana\"},\"application/vnd.patientecommsdoc\":{\"source\":\"iana\"},\"application/vnd.pawaafile\":{\"source\":\"iana\",\"extensions\":[\"paw\"]},\"application/vnd.pcos\":{\"source\":\"iana\"},\"application/vnd.pg.format\":{\"source\":\"iana\",\"extensions\":[\"str\"]},\"application/vnd.pg.osasli\":{\"source\":\"iana\",\"extensions\":[\"ei6\"]},\"application/vnd.piaccess.application-licence\":{\"source\":\"iana\"},\"application/vnd.picsel\":{\"source\":\"iana\",\"extensions\":[\"efif\"]},\"application/vnd.pmi.widget\":{\"source\":\"iana\",\"extensions\":[\"wg\"]},\"application/vnd.poc.group-advertisement+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.pocketlearn\":{\"source\":\"iana\",\"extensions\":[\"plf\"]},\"application/vnd.powerbuilder6\":{\"source\":\"iana\",\"extensions\":[\"pbd\"]},\"application/vnd.powerbuilder6-s\":{\"source\":\"iana\"},\"application/vnd.powerbuilder7\":{\"source\":\"iana\"},\"application/vnd.powerbuilder7-s\":{\"source\":\"iana\"},\"application/vnd.powerbuilder75\":{\"source\":\"iana\"},\"application/vnd.powerbuilder75-s\":{\"source\":\"iana\"},\"application/vnd.preminet\":{\"source\":\"iana\"},\"application/vnd.previewsystems.box\":{\"source\":\"iana\",\"extensions\":[\"box\"]},\"application/vnd.proteus.magazine\":{\"source\":\"iana\",\"extensions\":[\"mgz\"]},\"application/vnd.psfs\":{\"source\":\"iana\"},\"application/vnd.publishare-delta-tree\":{\"source\":\"iana\",\"extensions\":[\"qps\"]},\"application/vnd.pvi.ptid1\":{\"source\":\"iana\",\"extensions\":[\"ptid\"]},\"application/vnd.pwg-multiplexed\":{\"source\":\"iana\"},\"application/vnd.pwg-xhtml-print+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.qualcomm.brew-app-res\":{\"source\":\"iana\"},\"application/vnd.quarantainenet\":{\"source\":\"iana\"},\"application/vnd.quark.quarkxpress\":{\"source\":\"iana\",\"extensions\":[\"qxd\",\"qxt\",\"qwd\",\"qwt\",\"qxl\",\"qxb\"]},\"application/vnd.quobject-quoxdocument\":{\"source\":\"iana\"},\"application/vnd.radisys.moml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-conf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-conn+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-dialog+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-stream+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-conf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-base+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-fax-detect+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-fax-sendrecv+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-group+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-speech+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-transform+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.rainstor.data\":{\"source\":\"iana\"},\"application/vnd.rapid\":{\"source\":\"iana\"},\"application/vnd.rar\":{\"source\":\"iana\"},\"application/vnd.realvnc.bed\":{\"source\":\"iana\",\"extensions\":[\"bed\"]},\"application/vnd.recordare.musicxml\":{\"source\":\"iana\",\"extensions\":[\"mxl\"]},\"application/vnd.recordare.musicxml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"musicxml\"]},\"application/vnd.renlearn.rlprint\":{\"source\":\"iana\"},\"application/vnd.restful+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.rig.cryptonote\":{\"source\":\"iana\",\"extensions\":[\"cryptonote\"]},\"application/vnd.rim.cod\":{\"source\":\"apache\",\"extensions\":[\"cod\"]},\"application/vnd.rn-realmedia\":{\"source\":\"apache\",\"extensions\":[\"rm\"]},\"application/vnd.rn-realmedia-vbr\":{\"source\":\"apache\",\"extensions\":[\"rmvb\"]},\"application/vnd.route66.link66+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"link66\"]},\"application/vnd.rs-274x\":{\"source\":\"iana\"},\"application/vnd.ruckus.download\":{\"source\":\"iana\"},\"application/vnd.s3sms\":{\"source\":\"iana\"},\"application/vnd.sailingtracker.track\":{\"source\":\"iana\",\"extensions\":[\"st\"]},\"application/vnd.sbm.cid\":{\"source\":\"iana\"},\"application/vnd.sbm.mid2\":{\"source\":\"iana\"},\"application/vnd.scribus\":{\"source\":\"iana\"},\"application/vnd.sealed.3df\":{\"source\":\"iana\"},\"application/vnd.sealed.csf\":{\"source\":\"iana\"},\"application/vnd.sealed.doc\":{\"source\":\"iana\"},\"application/vnd.sealed.eml\":{\"source\":\"iana\"},\"application/vnd.sealed.mht\":{\"source\":\"iana\"},\"application/vnd.sealed.net\":{\"source\":\"iana\"},\"application/vnd.sealed.ppt\":{\"source\":\"iana\"},\"application/vnd.sealed.tiff\":{\"source\":\"iana\"},\"application/vnd.sealed.xls\":{\"source\":\"iana\"},\"application/vnd.sealedmedia.softseal.html\":{\"source\":\"iana\"},\"application/vnd.sealedmedia.softseal.pdf\":{\"source\":\"iana\"},\"application/vnd.seemail\":{\"source\":\"iana\",\"extensions\":[\"see\"]},\"application/vnd.sema\":{\"source\":\"iana\",\"extensions\":[\"sema\"]},\"application/vnd.semd\":{\"source\":\"iana\",\"extensions\":[\"semd\"]},\"application/vnd.semf\":{\"source\":\"iana\",\"extensions\":[\"semf\"]},\"application/vnd.shade-save-file\":{\"source\":\"iana\"},\"application/vnd.shana.informed.formdata\":{\"source\":\"iana\",\"extensions\":[\"ifm\"]},\"application/vnd.shana.informed.formtemplate\":{\"source\":\"iana\",\"extensions\":[\"itp\"]},\"application/vnd.shana.informed.interchange\":{\"source\":\"iana\",\"extensions\":[\"iif\"]},\"application/vnd.shana.informed.package\":{\"source\":\"iana\",\"extensions\":[\"ipk\"]},\"application/vnd.shootproof+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.shopkick+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.sigrok.session\":{\"source\":\"iana\"},\"application/vnd.simtech-mindmapper\":{\"source\":\"iana\",\"extensions\":[\"twd\",\"twds\"]},\"application/vnd.siren+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.smaf\":{\"source\":\"iana\",\"extensions\":[\"mmf\"]},\"application/vnd.smart.notebook\":{\"source\":\"iana\"},\"application/vnd.smart.teacher\":{\"source\":\"iana\",\"extensions\":[\"teacher\"]},\"application/vnd.software602.filler.form+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"fo\"]},\"application/vnd.software602.filler.form-xml-zip\":{\"source\":\"iana\"},\"application/vnd.solent.sdkm+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sdkm\",\"sdkd\"]},\"application/vnd.spotfire.dxp\":{\"source\":\"iana\",\"extensions\":[\"dxp\"]},\"application/vnd.spotfire.sfs\":{\"source\":\"iana\",\"extensions\":[\"sfs\"]},\"application/vnd.sqlite3\":{\"source\":\"iana\"},\"application/vnd.sss-cod\":{\"source\":\"iana\"},\"application/vnd.sss-dtf\":{\"source\":\"iana\"},\"application/vnd.sss-ntf\":{\"source\":\"iana\"},\"application/vnd.stardivision.calc\":{\"source\":\"apache\",\"extensions\":[\"sdc\"]},\"application/vnd.stardivision.draw\":{\"source\":\"apache\",\"extensions\":[\"sda\"]},\"application/vnd.stardivision.impress\":{\"source\":\"apache\",\"extensions\":[\"sdd\"]},\"application/vnd.stardivision.math\":{\"source\":\"apache\",\"extensions\":[\"smf\"]},\"application/vnd.stardivision.writer\":{\"source\":\"apache\",\"extensions\":[\"sdw\",\"vor\"]},\"application/vnd.stardivision.writer-global\":{\"source\":\"apache\",\"extensions\":[\"sgl\"]},\"application/vnd.stepmania.package\":{\"source\":\"iana\",\"extensions\":[\"smzip\"]},\"application/vnd.stepmania.stepchart\":{\"source\":\"iana\",\"extensions\":[\"sm\"]},\"application/vnd.street-stream\":{\"source\":\"iana\"},\"application/vnd.sun.wadl+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wadl\"]},\"application/vnd.sun.xml.calc\":{\"source\":\"apache\",\"extensions\":[\"sxc\"]},\"application/vnd.sun.xml.calc.template\":{\"source\":\"apache\",\"extensions\":[\"stc\"]},\"application/vnd.sun.xml.draw\":{\"source\":\"apache\",\"extensions\":[\"sxd\"]},\"application/vnd.sun.xml.draw.template\":{\"source\":\"apache\",\"extensions\":[\"std\"]},\"application/vnd.sun.xml.impress\":{\"source\":\"apache\",\"extensions\":[\"sxi\"]},\"application/vnd.sun.xml.impress.template\":{\"source\":\"apache\",\"extensions\":[\"sti\"]},\"application/vnd.sun.xml.math\":{\"source\":\"apache\",\"extensions\":[\"sxm\"]},\"application/vnd.sun.xml.writer\":{\"source\":\"apache\",\"extensions\":[\"sxw\"]},\"application/vnd.sun.xml.writer.global\":{\"source\":\"apache\",\"extensions\":[\"sxg\"]},\"application/vnd.sun.xml.writer.template\":{\"source\":\"apache\",\"extensions\":[\"stw\"]},\"application/vnd.sus-calendar\":{\"source\":\"iana\",\"extensions\":[\"sus\",\"susp\"]},\"application/vnd.svd\":{\"source\":\"iana\",\"extensions\":[\"svd\"]},\"application/vnd.swiftview-ics\":{\"source\":\"iana\"},\"application/vnd.symbian.install\":{\"source\":\"apache\",\"extensions\":[\"sis\",\"sisx\"]},\"application/vnd.syncml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xsm\"]},\"application/vnd.syncml.dm+wbxml\":{\"source\":\"iana\",\"extensions\":[\"bdm\"]},\"application/vnd.syncml.dm+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdm\"]},\"application/vnd.syncml.dm.notification\":{\"source\":\"iana\"},\"application/vnd.syncml.dmddf+wbxml\":{\"source\":\"iana\"},\"application/vnd.syncml.dmddf+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ddf\"]},\"application/vnd.syncml.dmtnds+wbxml\":{\"source\":\"iana\"},\"application/vnd.syncml.dmtnds+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.syncml.ds.notification\":{\"source\":\"iana\"},\"application/vnd.tableschema+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.tao.intent-module-archive\":{\"source\":\"iana\",\"extensions\":[\"tao\"]},\"application/vnd.tcpdump.pcap\":{\"source\":\"iana\",\"extensions\":[\"pcap\",\"cap\",\"dmp\"]},\"application/vnd.think-cell.ppttc+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.tmd.mediaflex.api+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.tml\":{\"source\":\"iana\"},\"application/vnd.tmobile-livetv\":{\"source\":\"iana\",\"extensions\":[\"tmo\"]},\"application/vnd.tri.onesource\":{\"source\":\"iana\"},\"application/vnd.trid.tpt\":{\"source\":\"iana\",\"extensions\":[\"tpt\"]},\"application/vnd.triscape.mxs\":{\"source\":\"iana\",\"extensions\":[\"mxs\"]},\"application/vnd.trueapp\":{\"source\":\"iana\",\"extensions\":[\"tra\"]},\"application/vnd.truedoc\":{\"source\":\"iana\"},\"application/vnd.ubisoft.webplayer\":{\"source\":\"iana\"},\"application/vnd.ufdl\":{\"source\":\"iana\",\"extensions\":[\"ufd\",\"ufdl\"]},\"application/vnd.uiq.theme\":{\"source\":\"iana\",\"extensions\":[\"utz\"]},\"application/vnd.umajin\":{\"source\":\"iana\",\"extensions\":[\"umj\"]},\"application/vnd.unity\":{\"source\":\"iana\",\"extensions\":[\"unityweb\"]},\"application/vnd.uoml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"uoml\"]},\"application/vnd.uplanet.alert\":{\"source\":\"iana\"},\"application/vnd.uplanet.alert-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.bearer-choice\":{\"source\":\"iana\"},\"application/vnd.uplanet.bearer-choice-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.cacheop\":{\"source\":\"iana\"},\"application/vnd.uplanet.cacheop-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.channel\":{\"source\":\"iana\"},\"application/vnd.uplanet.channel-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.list\":{\"source\":\"iana\"},\"application/vnd.uplanet.list-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.listcmd\":{\"source\":\"iana\"},\"application/vnd.uplanet.listcmd-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.signal\":{\"source\":\"iana\"},\"application/vnd.uri-map\":{\"source\":\"iana\"},\"application/vnd.valve.source.material\":{\"source\":\"iana\"},\"application/vnd.vcx\":{\"source\":\"iana\",\"extensions\":[\"vcx\"]},\"application/vnd.vd-study\":{\"source\":\"iana\"},\"application/vnd.vectorworks\":{\"source\":\"iana\"},\"application/vnd.vel+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.verimatrix.vcas\":{\"source\":\"iana\"},\"application/vnd.veryant.thin\":{\"source\":\"iana\"},\"application/vnd.ves.encrypted\":{\"source\":\"iana\"},\"application/vnd.vidsoft.vidconference\":{\"source\":\"iana\"},\"application/vnd.visio\":{\"source\":\"iana\",\"extensions\":[\"vsd\",\"vst\",\"vss\",\"vsw\"]},\"application/vnd.visionary\":{\"source\":\"iana\",\"extensions\":[\"vis\"]},\"application/vnd.vividence.scriptfile\":{\"source\":\"iana\"},\"application/vnd.vsf\":{\"source\":\"iana\",\"extensions\":[\"vsf\"]},\"application/vnd.wap.sic\":{\"source\":\"iana\"},\"application/vnd.wap.slc\":{\"source\":\"iana\"},\"application/vnd.wap.wbxml\":{\"source\":\"iana\",\"extensions\":[\"wbxml\"]},\"application/vnd.wap.wmlc\":{\"source\":\"iana\",\"extensions\":[\"wmlc\"]},\"application/vnd.wap.wmlscriptc\":{\"source\":\"iana\",\"extensions\":[\"wmlsc\"]},\"application/vnd.webturbo\":{\"source\":\"iana\",\"extensions\":[\"wtb\"]},\"application/vnd.wfa.p2p\":{\"source\":\"iana\"},\"application/vnd.wfa.wsc\":{\"source\":\"iana\"},\"application/vnd.windows.devicepairing\":{\"source\":\"iana\"},\"application/vnd.wmc\":{\"source\":\"iana\"},\"application/vnd.wmf.bootstrap\":{\"source\":\"iana\"},\"application/vnd.wolfram.mathematica\":{\"source\":\"iana\"},\"application/vnd.wolfram.mathematica.package\":{\"source\":\"iana\"},\"application/vnd.wolfram.player\":{\"source\":\"iana\",\"extensions\":[\"nbp\"]},\"application/vnd.wordperfect\":{\"source\":\"iana\",\"extensions\":[\"wpd\"]},\"application/vnd.wqd\":{\"source\":\"iana\",\"extensions\":[\"wqd\"]},\"application/vnd.wrq-hp3000-labelled\":{\"source\":\"iana\"},\"application/vnd.wt.stf\":{\"source\":\"iana\",\"extensions\":[\"stf\"]},\"application/vnd.wv.csp+wbxml\":{\"source\":\"iana\"},\"application/vnd.wv.csp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.wv.ssp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.xacml+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.xara\":{\"source\":\"iana\",\"extensions\":[\"xar\"]},\"application/vnd.xfdl\":{\"source\":\"iana\",\"extensions\":[\"xfdl\"]},\"application/vnd.xfdl.webform\":{\"source\":\"iana\"},\"application/vnd.xmi+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.xmpie.cpkg\":{\"source\":\"iana\"},\"application/vnd.xmpie.dpkg\":{\"source\":\"iana\"},\"application/vnd.xmpie.plan\":{\"source\":\"iana\"},\"application/vnd.xmpie.ppkg\":{\"source\":\"iana\"},\"application/vnd.xmpie.xlim\":{\"source\":\"iana\"},\"application/vnd.yamaha.hv-dic\":{\"source\":\"iana\",\"extensions\":[\"hvd\"]},\"application/vnd.yamaha.hv-script\":{\"source\":\"iana\",\"extensions\":[\"hvs\"]},\"application/vnd.yamaha.hv-voice\":{\"source\":\"iana\",\"extensions\":[\"hvp\"]},\"application/vnd.yamaha.openscoreformat\":{\"source\":\"iana\",\"extensions\":[\"osf\"]},\"application/vnd.yamaha.openscoreformat.osfpvg+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"osfpvg\"]},\"application/vnd.yamaha.remote-setup\":{\"source\":\"iana\"},\"application/vnd.yamaha.smaf-audio\":{\"source\":\"iana\",\"extensions\":[\"saf\"]},\"application/vnd.yamaha.smaf-phrase\":{\"source\":\"iana\",\"extensions\":[\"spf\"]},\"application/vnd.yamaha.through-ngn\":{\"source\":\"iana\"},\"application/vnd.yamaha.tunnel-udpencap\":{\"source\":\"iana\"},\"application/vnd.yaoweme\":{\"source\":\"iana\"},\"application/vnd.yellowriver-custom-menu\":{\"source\":\"iana\",\"extensions\":[\"cmp\"]},\"application/vnd.youtube.yt\":{\"source\":\"iana\"},\"application/vnd.zul\":{\"source\":\"iana\",\"extensions\":[\"zir\",\"zirz\"]},\"application/vnd.zzazz.deck+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"zaz\"]},\"application/voicexml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"vxml\"]},\"application/voucher-cms+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vq-rtcpxr\":{\"source\":\"iana\"},\"application/wasm\":{\"compressible\":true,\"extensions\":[\"wasm\"]},\"application/watcherinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/webpush-options+json\":{\"source\":\"iana\",\"compressible\":true},\"application/whoispp-query\":{\"source\":\"iana\"},\"application/whoispp-response\":{\"source\":\"iana\"},\"application/widget\":{\"source\":\"iana\",\"extensions\":[\"wgt\"]},\"application/winhlp\":{\"source\":\"apache\",\"extensions\":[\"hlp\"]},\"application/wita\":{\"source\":\"iana\"},\"application/wordperfect5.1\":{\"source\":\"iana\"},\"application/wsdl+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wsdl\"]},\"application/wspolicy+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wspolicy\"]},\"application/x-7z-compressed\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"7z\"]},\"application/x-abiword\":{\"source\":\"apache\",\"extensions\":[\"abw\"]},\"application/x-ace-compressed\":{\"source\":\"apache\",\"extensions\":[\"ace\"]},\"application/x-amf\":{\"source\":\"apache\"},\"application/x-apple-diskimage\":{\"source\":\"apache\",\"extensions\":[\"dmg\"]},\"application/x-arj\":{\"compressible\":false,\"extensions\":[\"arj\"]},\"application/x-authorware-bin\":{\"source\":\"apache\",\"extensions\":[\"aab\",\"x32\",\"u32\",\"vox\"]},\"application/x-authorware-map\":{\"source\":\"apache\",\"extensions\":[\"aam\"]},\"application/x-authorware-seg\":{\"source\":\"apache\",\"extensions\":[\"aas\"]},\"application/x-bcpio\":{\"source\":\"apache\",\"extensions\":[\"bcpio\"]},\"application/x-bdoc\":{\"compressible\":false,\"extensions\":[\"bdoc\"]},\"application/x-bittorrent\":{\"source\":\"apache\",\"extensions\":[\"torrent\"]},\"application/x-blorb\":{\"source\":\"apache\",\"extensions\":[\"blb\",\"blorb\"]},\"application/x-bzip\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"bz\"]},\"application/x-bzip2\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"bz2\",\"boz\"]},\"application/x-cbr\":{\"source\":\"apache\",\"extensions\":[\"cbr\",\"cba\",\"cbt\",\"cbz\",\"cb7\"]},\"application/x-cdlink\":{\"source\":\"apache\",\"extensions\":[\"vcd\"]},\"application/x-cfs-compressed\":{\"source\":\"apache\",\"extensions\":[\"cfs\"]},\"application/x-chat\":{\"source\":\"apache\",\"extensions\":[\"chat\"]},\"application/x-chess-pgn\":{\"source\":\"apache\",\"extensions\":[\"pgn\"]},\"application/x-chrome-extension\":{\"extensions\":[\"crx\"]},\"application/x-cocoa\":{\"source\":\"nginx\",\"extensions\":[\"cco\"]},\"application/x-compress\":{\"source\":\"apache\"},\"application/x-conference\":{\"source\":\"apache\",\"extensions\":[\"nsc\"]},\"application/x-cpio\":{\"source\":\"apache\",\"extensions\":[\"cpio\"]},\"application/x-csh\":{\"source\":\"apache\",\"extensions\":[\"csh\"]},\"application/x-deb\":{\"compressible\":false},\"application/x-debian-package\":{\"source\":\"apache\",\"extensions\":[\"deb\",\"udeb\"]},\"application/x-dgc-compressed\":{\"source\":\"apache\",\"extensions\":[\"dgc\"]},\"application/x-director\":{\"source\":\"apache\",\"extensions\":[\"dir\",\"dcr\",\"dxr\",\"cst\",\"cct\",\"cxt\",\"w3d\",\"fgd\",\"swa\"]},\"application/x-doom\":{\"source\":\"apache\",\"extensions\":[\"wad\"]},\"application/x-dtbncx+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"ncx\"]},\"application/x-dtbook+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"dtb\"]},\"application/x-dtbresource+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"res\"]},\"application/x-dvi\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"dvi\"]},\"application/x-envoy\":{\"source\":\"apache\",\"extensions\":[\"evy\"]},\"application/x-eva\":{\"source\":\"apache\",\"extensions\":[\"eva\"]},\"application/x-font-bdf\":{\"source\":\"apache\",\"extensions\":[\"bdf\"]},\"application/x-font-dos\":{\"source\":\"apache\"},\"application/x-font-framemaker\":{\"source\":\"apache\"},\"application/x-font-ghostscript\":{\"source\":\"apache\",\"extensions\":[\"gsf\"]},\"application/x-font-libgrx\":{\"source\":\"apache\"},\"application/x-font-linux-psf\":{\"source\":\"apache\",\"extensions\":[\"psf\"]},\"application/x-font-pcf\":{\"source\":\"apache\",\"extensions\":[\"pcf\"]},\"application/x-font-snf\":{\"source\":\"apache\",\"extensions\":[\"snf\"]},\"application/x-font-speedo\":{\"source\":\"apache\"},\"application/x-font-sunos-news\":{\"source\":\"apache\"},\"application/x-font-type1\":{\"source\":\"apache\",\"extensions\":[\"pfa\",\"pfb\",\"pfm\",\"afm\"]},\"application/x-font-vfont\":{\"source\":\"apache\"},\"application/x-freearc\":{\"source\":\"apache\",\"extensions\":[\"arc\"]},\"application/x-futuresplash\":{\"source\":\"apache\",\"extensions\":[\"spl\"]},\"application/x-gca-compressed\":{\"source\":\"apache\",\"extensions\":[\"gca\"]},\"application/x-glulx\":{\"source\":\"apache\",\"extensions\":[\"ulx\"]},\"application/x-gnumeric\":{\"source\":\"apache\",\"extensions\":[\"gnumeric\"]},\"application/x-gramps-xml\":{\"source\":\"apache\",\"extensions\":[\"gramps\"]},\"application/x-gtar\":{\"source\":\"apache\",\"extensions\":[\"gtar\"]},\"application/x-gzip\":{\"source\":\"apache\"},\"application/x-hdf\":{\"source\":\"apache\",\"extensions\":[\"hdf\"]},\"application/x-httpd-php\":{\"compressible\":true,\"extensions\":[\"php\"]},\"application/x-install-instructions\":{\"source\":\"apache\",\"extensions\":[\"install\"]},\"application/x-iso9660-image\":{\"source\":\"apache\",\"extensions\":[\"iso\"]},\"application/x-java-archive-diff\":{\"source\":\"nginx\",\"extensions\":[\"jardiff\"]},\"application/x-java-jnlp-file\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"jnlp\"]},\"application/x-javascript\":{\"compressible\":true},\"application/x-keepass2\":{\"extensions\":[\"kdbx\"]},\"application/x-latex\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"latex\"]},\"application/x-lua-bytecode\":{\"extensions\":[\"luac\"]},\"application/x-lzh-compressed\":{\"source\":\"apache\",\"extensions\":[\"lzh\",\"lha\"]},\"application/x-makeself\":{\"source\":\"nginx\",\"extensions\":[\"run\"]},\"application/x-mie\":{\"source\":\"apache\",\"extensions\":[\"mie\"]},\"application/x-mobipocket-ebook\":{\"source\":\"apache\",\"extensions\":[\"prc\",\"mobi\"]},\"application/x-mpegurl\":{\"compressible\":false},\"application/x-ms-application\":{\"source\":\"apache\",\"extensions\":[\"application\"]},\"application/x-ms-shortcut\":{\"source\":\"apache\",\"extensions\":[\"lnk\"]},\"application/x-ms-wmd\":{\"source\":\"apache\",\"extensions\":[\"wmd\"]},\"application/x-ms-wmz\":{\"source\":\"apache\",\"extensions\":[\"wmz\"]},\"application/x-ms-xbap\":{\"source\":\"apache\",\"extensions\":[\"xbap\"]},\"application/x-msaccess\":{\"source\":\"apache\",\"extensions\":[\"mdb\"]},\"application/x-msbinder\":{\"source\":\"apache\",\"extensions\":[\"obd\"]},\"application/x-mscardfile\":{\"source\":\"apache\",\"extensions\":[\"crd\"]},\"application/x-msclip\":{\"source\":\"apache\",\"extensions\":[\"clp\"]},\"application/x-msdos-program\":{\"extensions\":[\"exe\"]},\"application/x-msdownload\":{\"source\":\"apache\",\"extensions\":[\"exe\",\"dll\",\"com\",\"bat\",\"msi\"]},\"application/x-msmediaview\":{\"source\":\"apache\",\"extensions\":[\"mvb\",\"m13\",\"m14\"]},\"application/x-msmetafile\":{\"source\":\"apache\",\"extensions\":[\"wmf\",\"wmz\",\"emf\",\"emz\"]},\"application/x-msmoney\":{\"source\":\"apache\",\"extensions\":[\"mny\"]},\"application/x-mspublisher\":{\"source\":\"apache\",\"extensions\":[\"pub\"]},\"application/x-msschedule\":{\"source\":\"apache\",\"extensions\":[\"scd\"]},\"application/x-msterminal\":{\"source\":\"apache\",\"extensions\":[\"trm\"]},\"application/x-mswrite\":{\"source\":\"apache\",\"extensions\":[\"wri\"]},\"application/x-netcdf\":{\"source\":\"apache\",\"extensions\":[\"nc\",\"cdf\"]},\"application/x-ns-proxy-autoconfig\":{\"compressible\":true,\"extensions\":[\"pac\"]},\"application/x-nzb\":{\"source\":\"apache\",\"extensions\":[\"nzb\"]},\"application/x-perl\":{\"source\":\"nginx\",\"extensions\":[\"pl\",\"pm\"]},\"application/x-pilot\":{\"source\":\"nginx\",\"extensions\":[\"prc\",\"pdb\"]},\"application/x-pkcs12\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"p12\",\"pfx\"]},\"application/x-pkcs7-certificates\":{\"source\":\"apache\",\"extensions\":[\"p7b\",\"spc\"]},\"application/x-pkcs7-certreqresp\":{\"source\":\"apache\",\"extensions\":[\"p7r\"]},\"application/x-rar-compressed\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"rar\"]},\"application/x-redhat-package-manager\":{\"source\":\"nginx\",\"extensions\":[\"rpm\"]},\"application/x-research-info-systems\":{\"source\":\"apache\",\"extensions\":[\"ris\"]},\"application/x-sea\":{\"source\":\"nginx\",\"extensions\":[\"sea\"]},\"application/x-sh\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"sh\"]},\"application/x-shar\":{\"source\":\"apache\",\"extensions\":[\"shar\"]},\"application/x-shockwave-flash\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"swf\"]},\"application/x-silverlight-app\":{\"source\":\"apache\",\"extensions\":[\"xap\"]},\"application/x-sql\":{\"source\":\"apache\",\"extensions\":[\"sql\"]},\"application/x-stuffit\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"sit\"]},\"application/x-stuffitx\":{\"source\":\"apache\",\"extensions\":[\"sitx\"]},\"application/x-subrip\":{\"source\":\"apache\",\"extensions\":[\"srt\"]},\"application/x-sv4cpio\":{\"source\":\"apache\",\"extensions\":[\"sv4cpio\"]},\"application/x-sv4crc\":{\"source\":\"apache\",\"extensions\":[\"sv4crc\"]},\"application/x-t3vm-image\":{\"source\":\"apache\",\"extensions\":[\"t3\"]},\"application/x-tads\":{\"source\":\"apache\",\"extensions\":[\"gam\"]},\"application/x-tar\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"tar\"]},\"application/x-tcl\":{\"source\":\"apache\",\"extensions\":[\"tcl\",\"tk\"]},\"application/x-tex\":{\"source\":\"apache\",\"extensions\":[\"tex\"]},\"application/x-tex-tfm\":{\"source\":\"apache\",\"extensions\":[\"tfm\"]},\"application/x-texinfo\":{\"source\":\"apache\",\"extensions\":[\"texinfo\",\"texi\"]},\"application/x-tgif\":{\"source\":\"apache\",\"extensions\":[\"obj\"]},\"application/x-ustar\":{\"source\":\"apache\",\"extensions\":[\"ustar\"]},\"application/x-virtualbox-hdd\":{\"compressible\":true,\"extensions\":[\"hdd\"]},\"application/x-virtualbox-ova\":{\"compressible\":true,\"extensions\":[\"ova\"]},\"application/x-virtualbox-ovf\":{\"compressible\":true,\"extensions\":[\"ovf\"]},\"application/x-virtualbox-vbox\":{\"compressible\":true,\"extensions\":[\"vbox\"]},\"application/x-virtualbox-vbox-extpack\":{\"compressible\":false,\"extensions\":[\"vbox-extpack\"]},\"application/x-virtualbox-vdi\":{\"compressible\":true,\"extensions\":[\"vdi\"]},\"application/x-virtualbox-vhd\":{\"compressible\":true,\"extensions\":[\"vhd\"]},\"application/x-virtualbox-vmdk\":{\"compressible\":true,\"extensions\":[\"vmdk\"]},\"application/x-wais-source\":{\"source\":\"apache\",\"extensions\":[\"src\"]},\"application/x-web-app-manifest+json\":{\"compressible\":true,\"extensions\":[\"webapp\"]},\"application/x-www-form-urlencoded\":{\"source\":\"iana\",\"compressible\":true},\"application/x-x509-ca-cert\":{\"source\":\"apache\",\"extensions\":[\"der\",\"crt\",\"pem\"]},\"application/x-xfig\":{\"source\":\"apache\",\"extensions\":[\"fig\"]},\"application/x-xliff+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xlf\"]},\"application/x-xpinstall\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"xpi\"]},\"application/x-xz\":{\"source\":\"apache\",\"extensions\":[\"xz\"]},\"application/x-zmachine\":{\"source\":\"apache\",\"extensions\":[\"z1\",\"z2\",\"z3\",\"z4\",\"z5\",\"z6\",\"z7\",\"z8\"]},\"application/x400-bp\":{\"source\":\"iana\"},\"application/xacml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xaml+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xaml\"]},\"application/xcap-att+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xav\"]},\"application/xcap-caps+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xca\"]},\"application/xcap-diff+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdf\"]},\"application/xcap-el+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xel\"]},\"application/xcap-error+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xer\"]},\"application/xcap-ns+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xns\"]},\"application/xcon-conference-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcon-conference-info-diff+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xenc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xenc\"]},\"application/xhtml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xhtml\",\"xht\"]},\"application/xhtml-voice+xml\":{\"source\":\"apache\",\"compressible\":true},\"application/xliff+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xlf\"]},\"application/xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xml\",\"xsl\",\"xsd\",\"rng\"]},\"application/xml-dtd\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dtd\"]},\"application/xml-external-parsed-entity\":{\"source\":\"iana\"},\"application/xml-patch+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xmpp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xop+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xop\"]},\"application/xproc+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xpl\"]},\"application/xslt+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xslt\"]},\"application/xspf+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xspf\"]},\"application/xv+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mxml\",\"xhvml\",\"xvml\",\"xvm\"]},\"application/yang\":{\"source\":\"iana\",\"extensions\":[\"yang\"]},\"application/yang-data+json\":{\"source\":\"iana\",\"compressible\":true},\"application/yang-data+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/yang-patch+json\":{\"source\":\"iana\",\"compressible\":true},\"application/yang-patch+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/yin+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"yin\"]},\"application/zip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"zip\"]},\"application/zlib\":{\"source\":\"iana\"},\"application/zstd\":{\"source\":\"iana\"},\"audio/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"audio/32kadpcm\":{\"source\":\"iana\"},\"audio/3gpp\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"3gpp\"]},\"audio/3gpp2\":{\"source\":\"iana\"},\"audio/aac\":{\"source\":\"iana\"},\"audio/ac3\":{\"source\":\"iana\"},\"audio/adpcm\":{\"source\":\"apache\",\"extensions\":[\"adp\"]},\"audio/amr\":{\"source\":\"iana\"},\"audio/amr-wb\":{\"source\":\"iana\"},\"audio/amr-wb+\":{\"source\":\"iana\"},\"audio/aptx\":{\"source\":\"iana\"},\"audio/asc\":{\"source\":\"iana\"},\"audio/atrac-advanced-lossless\":{\"source\":\"iana\"},\"audio/atrac-x\":{\"source\":\"iana\"},\"audio/atrac3\":{\"source\":\"iana\"},\"audio/basic\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"au\",\"snd\"]},\"audio/bv16\":{\"source\":\"iana\"},\"audio/bv32\":{\"source\":\"iana\"},\"audio/clearmode\":{\"source\":\"iana\"},\"audio/cn\":{\"source\":\"iana\"},\"audio/dat12\":{\"source\":\"iana\"},\"audio/dls\":{\"source\":\"iana\"},\"audio/dsr-es201108\":{\"source\":\"iana\"},\"audio/dsr-es202050\":{\"source\":\"iana\"},\"audio/dsr-es202211\":{\"source\":\"iana\"},\"audio/dsr-es202212\":{\"source\":\"iana\"},\"audio/dv\":{\"source\":\"iana\"},\"audio/dvi4\":{\"source\":\"iana\"},\"audio/eac3\":{\"source\":\"iana\"},\"audio/encaprtp\":{\"source\":\"iana\"},\"audio/evrc\":{\"source\":\"iana\"},\"audio/evrc-qcp\":{\"source\":\"iana\"},\"audio/evrc0\":{\"source\":\"iana\"},\"audio/evrc1\":{\"source\":\"iana\"},\"audio/evrcb\":{\"source\":\"iana\"},\"audio/evrcb0\":{\"source\":\"iana\"},\"audio/evrcb1\":{\"source\":\"iana\"},\"audio/evrcnw\":{\"source\":\"iana\"},\"audio/evrcnw0\":{\"source\":\"iana\"},\"audio/evrcnw1\":{\"source\":\"iana\"},\"audio/evrcwb\":{\"source\":\"iana\"},\"audio/evrcwb0\":{\"source\":\"iana\"},\"audio/evrcwb1\":{\"source\":\"iana\"},\"audio/evs\":{\"source\":\"iana\"},\"audio/flexfec\":{\"source\":\"iana\"},\"audio/fwdred\":{\"source\":\"iana\"},\"audio/g711-0\":{\"source\":\"iana\"},\"audio/g719\":{\"source\":\"iana\"},\"audio/g722\":{\"source\":\"iana\"},\"audio/g7221\":{\"source\":\"iana\"},\"audio/g723\":{\"source\":\"iana\"},\"audio/g726-16\":{\"source\":\"iana\"},\"audio/g726-24\":{\"source\":\"iana\"},\"audio/g726-32\":{\"source\":\"iana\"},\"audio/g726-40\":{\"source\":\"iana\"},\"audio/g728\":{\"source\":\"iana\"},\"audio/g729\":{\"source\":\"iana\"},\"audio/g7291\":{\"source\":\"iana\"},\"audio/g729d\":{\"source\":\"iana\"},\"audio/g729e\":{\"source\":\"iana\"},\"audio/gsm\":{\"source\":\"iana\"},\"audio/gsm-efr\":{\"source\":\"iana\"},\"audio/gsm-hr-08\":{\"source\":\"iana\"},\"audio/ilbc\":{\"source\":\"iana\"},\"audio/ip-mr_v2.5\":{\"source\":\"iana\"},\"audio/isac\":{\"source\":\"apache\"},\"audio/l16\":{\"source\":\"iana\"},\"audio/l20\":{\"source\":\"iana\"},\"audio/l24\":{\"source\":\"iana\",\"compressible\":false},\"audio/l8\":{\"source\":\"iana\"},\"audio/lpc\":{\"source\":\"iana\"},\"audio/melp\":{\"source\":\"iana\"},\"audio/melp1200\":{\"source\":\"iana\"},\"audio/melp2400\":{\"source\":\"iana\"},\"audio/melp600\":{\"source\":\"iana\"},\"audio/midi\":{\"source\":\"apache\",\"extensions\":[\"mid\",\"midi\",\"kar\",\"rmi\"]},\"audio/mobile-xmf\":{\"source\":\"iana\",\"extensions\":[\"mxmf\"]},\"audio/mp3\":{\"compressible\":false,\"extensions\":[\"mp3\"]},\"audio/mp4\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"m4a\",\"mp4a\"]},\"audio/mp4a-latm\":{\"source\":\"iana\"},\"audio/mpa\":{\"source\":\"iana\"},\"audio/mpa-robust\":{\"source\":\"iana\"},\"audio/mpeg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"mpga\",\"mp2\",\"mp2a\",\"mp3\",\"m2a\",\"m3a\"]},\"audio/mpeg4-generic\":{\"source\":\"iana\"},\"audio/musepack\":{\"source\":\"apache\"},\"audio/ogg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"oga\",\"ogg\",\"spx\"]},\"audio/opus\":{\"source\":\"iana\"},\"audio/parityfec\":{\"source\":\"iana\"},\"audio/pcma\":{\"source\":\"iana\"},\"audio/pcma-wb\":{\"source\":\"iana\"},\"audio/pcmu\":{\"source\":\"iana\"},\"audio/pcmu-wb\":{\"source\":\"iana\"},\"audio/prs.sid\":{\"source\":\"iana\"},\"audio/qcelp\":{\"source\":\"iana\"},\"audio/raptorfec\":{\"source\":\"iana\"},\"audio/red\":{\"source\":\"iana\"},\"audio/rtp-enc-aescm128\":{\"source\":\"iana\"},\"audio/rtp-midi\":{\"source\":\"iana\"},\"audio/rtploopback\":{\"source\":\"iana\"},\"audio/rtx\":{\"source\":\"iana\"},\"audio/s3m\":{\"source\":\"apache\",\"extensions\":[\"s3m\"]},\"audio/silk\":{\"source\":\"apache\",\"extensions\":[\"sil\"]},\"audio/smv\":{\"source\":\"iana\"},\"audio/smv-qcp\":{\"source\":\"iana\"},\"audio/smv0\":{\"source\":\"iana\"},\"audio/sp-midi\":{\"source\":\"iana\"},\"audio/speex\":{\"source\":\"iana\"},\"audio/t140c\":{\"source\":\"iana\"},\"audio/t38\":{\"source\":\"iana\"},\"audio/telephone-event\":{\"source\":\"iana\"},\"audio/tetra_acelp\":{\"source\":\"iana\"},\"audio/tone\":{\"source\":\"iana\"},\"audio/uemclip\":{\"source\":\"iana\"},\"audio/ulpfec\":{\"source\":\"iana\"},\"audio/usac\":{\"source\":\"iana\"},\"audio/vdvi\":{\"source\":\"iana\"},\"audio/vmr-wb\":{\"source\":\"iana\"},\"audio/vnd.3gpp.iufp\":{\"source\":\"iana\"},\"audio/vnd.4sb\":{\"source\":\"iana\"},\"audio/vnd.audiokoz\":{\"source\":\"iana\"},\"audio/vnd.celp\":{\"source\":\"iana\"},\"audio/vnd.cisco.nse\":{\"source\":\"iana\"},\"audio/vnd.cmles.radio-events\":{\"source\":\"iana\"},\"audio/vnd.cns.anp1\":{\"source\":\"iana\"},\"audio/vnd.cns.inf1\":{\"source\":\"iana\"},\"audio/vnd.dece.audio\":{\"source\":\"iana\",\"extensions\":[\"uva\",\"uvva\"]},\"audio/vnd.digital-winds\":{\"source\":\"iana\",\"extensions\":[\"eol\"]},\"audio/vnd.dlna.adts\":{\"source\":\"iana\"},\"audio/vnd.dolby.heaac.1\":{\"source\":\"iana\"},\"audio/vnd.dolby.heaac.2\":{\"source\":\"iana\"},\"audio/vnd.dolby.mlp\":{\"source\":\"iana\"},\"audio/vnd.dolby.mps\":{\"source\":\"iana\"},\"audio/vnd.dolby.pl2\":{\"source\":\"iana\"},\"audio/vnd.dolby.pl2x\":{\"source\":\"iana\"},\"audio/vnd.dolby.pl2z\":{\"source\":\"iana\"},\"audio/vnd.dolby.pulse.1\":{\"source\":\"iana\"},\"audio/vnd.dra\":{\"source\":\"iana\",\"extensions\":[\"dra\"]},\"audio/vnd.dts\":{\"source\":\"iana\",\"extensions\":[\"dts\"]},\"audio/vnd.dts.hd\":{\"source\":\"iana\",\"extensions\":[\"dtshd\"]},\"audio/vnd.dts.uhd\":{\"source\":\"iana\"},\"audio/vnd.dvb.file\":{\"source\":\"iana\"},\"audio/vnd.everad.plj\":{\"source\":\"iana\"},\"audio/vnd.hns.audio\":{\"source\":\"iana\"},\"audio/vnd.lucent.voice\":{\"source\":\"iana\",\"extensions\":[\"lvp\"]},\"audio/vnd.ms-playready.media.pya\":{\"source\":\"iana\",\"extensions\":[\"pya\"]},\"audio/vnd.nokia.mobile-xmf\":{\"source\":\"iana\"},\"audio/vnd.nortel.vbk\":{\"source\":\"iana\"},\"audio/vnd.nuera.ecelp4800\":{\"source\":\"iana\",\"extensions\":[\"ecelp4800\"]},\"audio/vnd.nuera.ecelp7470\":{\"source\":\"iana\",\"extensions\":[\"ecelp7470\"]},\"audio/vnd.nuera.ecelp9600\":{\"source\":\"iana\",\"extensions\":[\"ecelp9600\"]},\"audio/vnd.octel.sbc\":{\"source\":\"iana\"},\"audio/vnd.presonus.multitrack\":{\"source\":\"iana\"},\"audio/vnd.qcelp\":{\"source\":\"iana\"},\"audio/vnd.rhetorex.32kadpcm\":{\"source\":\"iana\"},\"audio/vnd.rip\":{\"source\":\"iana\",\"extensions\":[\"rip\"]},\"audio/vnd.rn-realaudio\":{\"compressible\":false},\"audio/vnd.sealedmedia.softseal.mpeg\":{\"source\":\"iana\"},\"audio/vnd.vmx.cvsd\":{\"source\":\"iana\"},\"audio/vnd.wave\":{\"compressible\":false},\"audio/vorbis\":{\"source\":\"iana\",\"compressible\":false},\"audio/vorbis-config\":{\"source\":\"iana\"},\"audio/wav\":{\"compressible\":false,\"extensions\":[\"wav\"]},\"audio/wave\":{\"compressible\":false,\"extensions\":[\"wav\"]},\"audio/webm\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"weba\"]},\"audio/x-aac\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"aac\"]},\"audio/x-aiff\":{\"source\":\"apache\",\"extensions\":[\"aif\",\"aiff\",\"aifc\"]},\"audio/x-caf\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"caf\"]},\"audio/x-flac\":{\"source\":\"apache\",\"extensions\":[\"flac\"]},\"audio/x-m4a\":{\"source\":\"nginx\",\"extensions\":[\"m4a\"]},\"audio/x-matroska\":{\"source\":\"apache\",\"extensions\":[\"mka\"]},\"audio/x-mpegurl\":{\"source\":\"apache\",\"extensions\":[\"m3u\"]},\"audio/x-ms-wax\":{\"source\":\"apache\",\"extensions\":[\"wax\"]},\"audio/x-ms-wma\":{\"source\":\"apache\",\"extensions\":[\"wma\"]},\"audio/x-pn-realaudio\":{\"source\":\"apache\",\"extensions\":[\"ram\",\"ra\"]},\"audio/x-pn-realaudio-plugin\":{\"source\":\"apache\",\"extensions\":[\"rmp\"]},\"audio/x-realaudio\":{\"source\":\"nginx\",\"extensions\":[\"ra\"]},\"audio/x-tta\":{\"source\":\"apache\"},\"audio/x-wav\":{\"source\":\"apache\",\"extensions\":[\"wav\"]},\"audio/xm\":{\"source\":\"apache\",\"extensions\":[\"xm\"]},\"chemical/x-cdx\":{\"source\":\"apache\",\"extensions\":[\"cdx\"]},\"chemical/x-cif\":{\"source\":\"apache\",\"extensions\":[\"cif\"]},\"chemical/x-cmdf\":{\"source\":\"apache\",\"extensions\":[\"cmdf\"]},\"chemical/x-cml\":{\"source\":\"apache\",\"extensions\":[\"cml\"]},\"chemical/x-csml\":{\"source\":\"apache\",\"extensions\":[\"csml\"]},\"chemical/x-pdb\":{\"source\":\"apache\"},\"chemical/x-xyz\":{\"source\":\"apache\",\"extensions\":[\"xyz\"]},\"font/collection\":{\"source\":\"iana\",\"extensions\":[\"ttc\"]},\"font/otf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"otf\"]},\"font/sfnt\":{\"source\":\"iana\"},\"font/ttf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ttf\"]},\"font/woff\":{\"source\":\"iana\",\"extensions\":[\"woff\"]},\"font/woff2\":{\"source\":\"iana\",\"extensions\":[\"woff2\"]},\"image/aces\":{\"source\":\"iana\",\"extensions\":[\"exr\"]},\"image/apng\":{\"compressible\":false,\"extensions\":[\"apng\"]},\"image/avci\":{\"source\":\"iana\"},\"image/avcs\":{\"source\":\"iana\"},\"image/bmp\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"bmp\"]},\"image/cgm\":{\"source\":\"iana\",\"extensions\":[\"cgm\"]},\"image/dicom-rle\":{\"source\":\"iana\",\"extensions\":[\"drle\"]},\"image/emf\":{\"source\":\"iana\",\"extensions\":[\"emf\"]},\"image/fits\":{\"source\":\"iana\",\"extensions\":[\"fits\"]},\"image/g3fax\":{\"source\":\"iana\",\"extensions\":[\"g3\"]},\"image/gif\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"gif\"]},\"image/heic\":{\"source\":\"iana\",\"extensions\":[\"heic\"]},\"image/heic-sequence\":{\"source\":\"iana\",\"extensions\":[\"heics\"]},\"image/heif\":{\"source\":\"iana\",\"extensions\":[\"heif\"]},\"image/heif-sequence\":{\"source\":\"iana\",\"extensions\":[\"heifs\"]},\"image/hej2k\":{\"source\":\"iana\",\"extensions\":[\"hej2\"]},\"image/hsj2\":{\"source\":\"iana\",\"extensions\":[\"hsj2\"]},\"image/ief\":{\"source\":\"iana\",\"extensions\":[\"ief\"]},\"image/jls\":{\"source\":\"iana\",\"extensions\":[\"jls\"]},\"image/jp2\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jp2\",\"jpg2\"]},\"image/jpeg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jpeg\",\"jpg\",\"jpe\"]},\"image/jph\":{\"source\":\"iana\",\"extensions\":[\"jph\"]},\"image/jphc\":{\"source\":\"iana\",\"extensions\":[\"jhc\"]},\"image/jpm\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jpm\"]},\"image/jpx\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jpx\",\"jpf\"]},\"image/jxr\":{\"source\":\"iana\",\"extensions\":[\"jxr\"]},\"image/jxra\":{\"source\":\"iana\",\"extensions\":[\"jxra\"]},\"image/jxrs\":{\"source\":\"iana\",\"extensions\":[\"jxrs\"]},\"image/jxs\":{\"source\":\"iana\",\"extensions\":[\"jxs\"]},\"image/jxsc\":{\"source\":\"iana\",\"extensions\":[\"jxsc\"]},\"image/jxsi\":{\"source\":\"iana\",\"extensions\":[\"jxsi\"]},\"image/jxss\":{\"source\":\"iana\",\"extensions\":[\"jxss\"]},\"image/ktx\":{\"source\":\"iana\",\"extensions\":[\"ktx\"]},\"image/naplps\":{\"source\":\"iana\"},\"image/pjpeg\":{\"compressible\":false},\"image/png\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"png\"]},\"image/prs.btif\":{\"source\":\"iana\",\"extensions\":[\"btif\"]},\"image/prs.pti\":{\"source\":\"iana\",\"extensions\":[\"pti\"]},\"image/pwg-raster\":{\"source\":\"iana\"},\"image/sgi\":{\"source\":\"apache\",\"extensions\":[\"sgi\"]},\"image/svg+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"svg\",\"svgz\"]},\"image/t38\":{\"source\":\"iana\",\"extensions\":[\"t38\"]},\"image/tiff\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"tif\",\"tiff\"]},\"image/tiff-fx\":{\"source\":\"iana\",\"extensions\":[\"tfx\"]},\"image/vnd.adobe.photoshop\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"psd\"]},\"image/vnd.airzip.accelerator.azv\":{\"source\":\"iana\",\"extensions\":[\"azv\"]},\"image/vnd.cns.inf2\":{\"source\":\"iana\"},\"image/vnd.dece.graphic\":{\"source\":\"iana\",\"extensions\":[\"uvi\",\"uvvi\",\"uvg\",\"uvvg\"]},\"image/vnd.djvu\":{\"source\":\"iana\",\"extensions\":[\"djvu\",\"djv\"]},\"image/vnd.dvb.subtitle\":{\"source\":\"iana\",\"extensions\":[\"sub\"]},\"image/vnd.dwg\":{\"source\":\"iana\",\"extensions\":[\"dwg\"]},\"image/vnd.dxf\":{\"source\":\"iana\",\"extensions\":[\"dxf\"]},\"image/vnd.fastbidsheet\":{\"source\":\"iana\",\"extensions\":[\"fbs\"]},\"image/vnd.fpx\":{\"source\":\"iana\",\"extensions\":[\"fpx\"]},\"image/vnd.fst\":{\"source\":\"iana\",\"extensions\":[\"fst\"]},\"image/vnd.fujixerox.edmics-mmr\":{\"source\":\"iana\",\"extensions\":[\"mmr\"]},\"image/vnd.fujixerox.edmics-rlc\":{\"source\":\"iana\",\"extensions\":[\"rlc\"]},\"image/vnd.globalgraphics.pgb\":{\"source\":\"iana\"},\"image/vnd.microsoft.icon\":{\"source\":\"iana\",\"extensions\":[\"ico\"]},\"image/vnd.mix\":{\"source\":\"iana\"},\"image/vnd.mozilla.apng\":{\"source\":\"iana\"},\"image/vnd.ms-dds\":{\"extensions\":[\"dds\"]},\"image/vnd.ms-modi\":{\"source\":\"iana\",\"extensions\":[\"mdi\"]},\"image/vnd.ms-photo\":{\"source\":\"apache\",\"extensions\":[\"wdp\"]},\"image/vnd.net-fpx\":{\"source\":\"iana\",\"extensions\":[\"npx\"]},\"image/vnd.radiance\":{\"source\":\"iana\"},\"image/vnd.sealed.png\":{\"source\":\"iana\"},\"image/vnd.sealedmedia.softseal.gif\":{\"source\":\"iana\"},\"image/vnd.sealedmedia.softseal.jpg\":{\"source\":\"iana\"},\"image/vnd.svf\":{\"source\":\"iana\"},\"image/vnd.tencent.tap\":{\"source\":\"iana\",\"extensions\":[\"tap\"]},\"image/vnd.valve.source.texture\":{\"source\":\"iana\",\"extensions\":[\"vtf\"]},\"image/vnd.wap.wbmp\":{\"source\":\"iana\",\"extensions\":[\"wbmp\"]},\"image/vnd.xiff\":{\"source\":\"iana\",\"extensions\":[\"xif\"]},\"image/vnd.zbrush.pcx\":{\"source\":\"iana\",\"extensions\":[\"pcx\"]},\"image/webp\":{\"source\":\"apache\",\"extensions\":[\"webp\"]},\"image/wmf\":{\"source\":\"iana\",\"extensions\":[\"wmf\"]},\"image/x-3ds\":{\"source\":\"apache\",\"extensions\":[\"3ds\"]},\"image/x-cmu-raster\":{\"source\":\"apache\",\"extensions\":[\"ras\"]},\"image/x-cmx\":{\"source\":\"apache\",\"extensions\":[\"cmx\"]},\"image/x-freehand\":{\"source\":\"apache\",\"extensions\":[\"fh\",\"fhc\",\"fh4\",\"fh5\",\"fh7\"]},\"image/x-icon\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"ico\"]},\"image/x-jng\":{\"source\":\"nginx\",\"extensions\":[\"jng\"]},\"image/x-mrsid-image\":{\"source\":\"apache\",\"extensions\":[\"sid\"]},\"image/x-ms-bmp\":{\"source\":\"nginx\",\"compressible\":true,\"extensions\":[\"bmp\"]},\"image/x-pcx\":{\"source\":\"apache\",\"extensions\":[\"pcx\"]},\"image/x-pict\":{\"source\":\"apache\",\"extensions\":[\"pic\",\"pct\"]},\"image/x-portable-anymap\":{\"source\":\"apache\",\"extensions\":[\"pnm\"]},\"image/x-portable-bitmap\":{\"source\":\"apache\",\"extensions\":[\"pbm\"]},\"image/x-portable-graymap\":{\"source\":\"apache\",\"extensions\":[\"pgm\"]},\"image/x-portable-pixmap\":{\"source\":\"apache\",\"extensions\":[\"ppm\"]},\"image/x-rgb\":{\"source\":\"apache\",\"extensions\":[\"rgb\"]},\"image/x-tga\":{\"source\":\"apache\",\"extensions\":[\"tga\"]},\"image/x-xbitmap\":{\"source\":\"apache\",\"extensions\":[\"xbm\"]},\"image/x-xcf\":{\"compressible\":false},\"image/x-xpixmap\":{\"source\":\"apache\",\"extensions\":[\"xpm\"]},\"image/x-xwindowdump\":{\"source\":\"apache\",\"extensions\":[\"xwd\"]},\"message/cpim\":{\"source\":\"iana\"},\"message/delivery-status\":{\"source\":\"iana\"},\"message/disposition-notification\":{\"source\":\"iana\",\"extensions\":[\"disposition-notification\"]},\"message/external-body\":{\"source\":\"iana\"},\"message/feedback-report\":{\"source\":\"iana\"},\"message/global\":{\"source\":\"iana\",\"extensions\":[\"u8msg\"]},\"message/global-delivery-status\":{\"source\":\"iana\",\"extensions\":[\"u8dsn\"]},\"message/global-disposition-notification\":{\"source\":\"iana\",\"extensions\":[\"u8mdn\"]},\"message/global-headers\":{\"source\":\"iana\",\"extensions\":[\"u8hdr\"]},\"message/http\":{\"source\":\"iana\",\"compressible\":false},\"message/imdn+xml\":{\"source\":\"iana\",\"compressible\":true},\"message/news\":{\"source\":\"iana\"},\"message/partial\":{\"source\":\"iana\",\"compressible\":false},\"message/rfc822\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"eml\",\"mime\"]},\"message/s-http\":{\"source\":\"iana\"},\"message/sip\":{\"source\":\"iana\"},\"message/sipfrag\":{\"source\":\"iana\"},\"message/tracking-status\":{\"source\":\"iana\"},\"message/vnd.si.simp\":{\"source\":\"iana\"},\"message/vnd.wfa.wsc\":{\"source\":\"iana\",\"extensions\":[\"wsc\"]},\"model/3mf\":{\"source\":\"iana\",\"extensions\":[\"3mf\"]},\"model/gltf+json\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"gltf\"]},\"model/gltf-binary\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"glb\"]},\"model/iges\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"igs\",\"iges\"]},\"model/mesh\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"msh\",\"mesh\",\"silo\"]},\"model/stl\":{\"source\":\"iana\",\"extensions\":[\"stl\"]},\"model/vnd.collada+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dae\"]},\"model/vnd.dwf\":{\"source\":\"iana\",\"extensions\":[\"dwf\"]},\"model/vnd.flatland.3dml\":{\"source\":\"iana\"},\"model/vnd.gdl\":{\"source\":\"iana\",\"extensions\":[\"gdl\"]},\"model/vnd.gs-gdl\":{\"source\":\"apache\"},\"model/vnd.gs.gdl\":{\"source\":\"iana\"},\"model/vnd.gtw\":{\"source\":\"iana\",\"extensions\":[\"gtw\"]},\"model/vnd.moml+xml\":{\"source\":\"iana\",\"compressible\":true},\"model/vnd.mts\":{\"source\":\"iana\",\"extensions\":[\"mts\"]},\"model/vnd.opengex\":{\"source\":\"iana\",\"extensions\":[\"ogex\"]},\"model/vnd.parasolid.transmit.binary\":{\"source\":\"iana\",\"extensions\":[\"x_b\"]},\"model/vnd.parasolid.transmit.text\":{\"source\":\"iana\",\"extensions\":[\"x_t\"]},\"model/vnd.rosette.annotated-data-model\":{\"source\":\"iana\"},\"model/vnd.usdz+zip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"usdz\"]},\"model/vnd.valve.source.compiled-map\":{\"source\":\"iana\",\"extensions\":[\"bsp\"]},\"model/vnd.vtu\":{\"source\":\"iana\",\"extensions\":[\"vtu\"]},\"model/vrml\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"wrl\",\"vrml\"]},\"model/x3d+binary\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"x3db\",\"x3dbz\"]},\"model/x3d+fastinfoset\":{\"source\":\"iana\",\"extensions\":[\"x3db\"]},\"model/x3d+vrml\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"x3dv\",\"x3dvz\"]},\"model/x3d+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"x3d\",\"x3dz\"]},\"model/x3d-vrml\":{\"source\":\"iana\",\"extensions\":[\"x3dv\"]},\"multipart/alternative\":{\"source\":\"iana\",\"compressible\":false},\"multipart/appledouble\":{\"source\":\"iana\"},\"multipart/byteranges\":{\"source\":\"iana\"},\"multipart/digest\":{\"source\":\"iana\"},\"multipart/encrypted\":{\"source\":\"iana\",\"compressible\":false},\"multipart/form-data\":{\"source\":\"iana\",\"compressible\":false},\"multipart/header-set\":{\"source\":\"iana\"},\"multipart/mixed\":{\"source\":\"iana\"},\"multipart/multilingual\":{\"source\":\"iana\"},\"multipart/parallel\":{\"source\":\"iana\"},\"multipart/related\":{\"source\":\"iana\",\"compressible\":false},\"multipart/report\":{\"source\":\"iana\"},\"multipart/signed\":{\"source\":\"iana\",\"compressible\":false},\"multipart/vnd.bint.med-plus\":{\"source\":\"iana\"},\"multipart/voice-message\":{\"source\":\"iana\"},\"multipart/x-mixed-replace\":{\"source\":\"iana\"},\"text/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"text/cache-manifest\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"appcache\",\"manifest\"]},\"text/calendar\":{\"source\":\"iana\",\"extensions\":[\"ics\",\"ifb\"]},\"text/calender\":{\"compressible\":true},\"text/cmd\":{\"compressible\":true},\"text/coffeescript\":{\"extensions\":[\"coffee\",\"litcoffee\"]},\"text/css\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"css\"]},\"text/csv\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"csv\"]},\"text/csv-schema\":{\"source\":\"iana\"},\"text/directory\":{\"source\":\"iana\"},\"text/dns\":{\"source\":\"iana\"},\"text/ecmascript\":{\"source\":\"iana\"},\"text/encaprtp\":{\"source\":\"iana\"},\"text/enriched\":{\"source\":\"iana\"},\"text/flexfec\":{\"source\":\"iana\"},\"text/fwdred\":{\"source\":\"iana\"},\"text/grammar-ref-list\":{\"source\":\"iana\"},\"text/html\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"html\",\"htm\",\"shtml\"]},\"text/jade\":{\"extensions\":[\"jade\"]},\"text/javascript\":{\"source\":\"iana\",\"compressible\":true},\"text/jcr-cnd\":{\"source\":\"iana\"},\"text/jsx\":{\"compressible\":true,\"extensions\":[\"jsx\"]},\"text/less\":{\"compressible\":true,\"extensions\":[\"less\"]},\"text/markdown\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"markdown\",\"md\"]},\"text/mathml\":{\"source\":\"nginx\",\"extensions\":[\"mml\"]},\"text/mdx\":{\"compressible\":true,\"extensions\":[\"mdx\"]},\"text/mizar\":{\"source\":\"iana\"},\"text/n3\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"n3\"]},\"text/parameters\":{\"source\":\"iana\"},\"text/parityfec\":{\"source\":\"iana\"},\"text/plain\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"txt\",\"text\",\"conf\",\"def\",\"list\",\"log\",\"in\",\"ini\"]},\"text/provenance-notation\":{\"source\":\"iana\"},\"text/prs.fallenstein.rst\":{\"source\":\"iana\"},\"text/prs.lines.tag\":{\"source\":\"iana\",\"extensions\":[\"dsc\"]},\"text/prs.prop.logic\":{\"source\":\"iana\"},\"text/raptorfec\":{\"source\":\"iana\"},\"text/red\":{\"source\":\"iana\"},\"text/rfc822-headers\":{\"source\":\"iana\"},\"text/richtext\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rtx\"]},\"text/rtf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rtf\"]},\"text/rtp-enc-aescm128\":{\"source\":\"iana\"},\"text/rtploopback\":{\"source\":\"iana\"},\"text/rtx\":{\"source\":\"iana\"},\"text/sgml\":{\"source\":\"iana\",\"extensions\":[\"sgml\",\"sgm\"]},\"text/shex\":{\"extensions\":[\"shex\"]},\"text/slim\":{\"extensions\":[\"slim\",\"slm\"]},\"text/strings\":{\"source\":\"iana\"},\"text/stylus\":{\"extensions\":[\"stylus\",\"styl\"]},\"text/t140\":{\"source\":\"iana\"},\"text/tab-separated-values\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"tsv\"]},\"text/troff\":{\"source\":\"iana\",\"extensions\":[\"t\",\"tr\",\"roff\",\"man\",\"me\",\"ms\"]},\"text/turtle\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"extensions\":[\"ttl\"]},\"text/ulpfec\":{\"source\":\"iana\"},\"text/uri-list\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"uri\",\"uris\",\"urls\"]},\"text/vcard\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"vcard\"]},\"text/vnd.a\":{\"source\":\"iana\"},\"text/vnd.abc\":{\"source\":\"iana\"},\"text/vnd.ascii-art\":{\"source\":\"iana\"},\"text/vnd.curl\":{\"source\":\"iana\",\"extensions\":[\"curl\"]},\"text/vnd.curl.dcurl\":{\"source\":\"apache\",\"extensions\":[\"dcurl\"]},\"text/vnd.curl.mcurl\":{\"source\":\"apache\",\"extensions\":[\"mcurl\"]},\"text/vnd.curl.scurl\":{\"source\":\"apache\",\"extensions\":[\"scurl\"]},\"text/vnd.debian.copyright\":{\"source\":\"iana\"},\"text/vnd.dmclientscript\":{\"source\":\"iana\"},\"text/vnd.dvb.subtitle\":{\"source\":\"iana\",\"extensions\":[\"sub\"]},\"text/vnd.esmertec.theme-descriptor\":{\"source\":\"iana\"},\"text/vnd.ficlab.flt\":{\"source\":\"iana\"},\"text/vnd.fly\":{\"source\":\"iana\",\"extensions\":[\"fly\"]},\"text/vnd.fmi.flexstor\":{\"source\":\"iana\",\"extensions\":[\"flx\"]},\"text/vnd.gml\":{\"source\":\"iana\"},\"text/vnd.graphviz\":{\"source\":\"iana\",\"extensions\":[\"gv\"]},\"text/vnd.hgl\":{\"source\":\"iana\"},\"text/vnd.in3d.3dml\":{\"source\":\"iana\",\"extensions\":[\"3dml\"]},\"text/vnd.in3d.spot\":{\"source\":\"iana\",\"extensions\":[\"spot\"]},\"text/vnd.iptc.newsml\":{\"source\":\"iana\"},\"text/vnd.iptc.nitf\":{\"source\":\"iana\"},\"text/vnd.latex-z\":{\"source\":\"iana\"},\"text/vnd.motorola.reflex\":{\"source\":\"iana\"},\"text/vnd.ms-mediapackage\":{\"source\":\"iana\"},\"text/vnd.net2phone.commcenter.command\":{\"source\":\"iana\"},\"text/vnd.radisys.msml-basic-layout\":{\"source\":\"iana\"},\"text/vnd.senx.warpscript\":{\"source\":\"iana\"},\"text/vnd.si.uricatalogue\":{\"source\":\"iana\"},\"text/vnd.sosi\":{\"source\":\"iana\"},\"text/vnd.sun.j2me.app-descriptor\":{\"source\":\"iana\",\"extensions\":[\"jad\"]},\"text/vnd.trolltech.linguist\":{\"source\":\"iana\"},\"text/vnd.wap.si\":{\"source\":\"iana\"},\"text/vnd.wap.sl\":{\"source\":\"iana\"},\"text/vnd.wap.wml\":{\"source\":\"iana\",\"extensions\":[\"wml\"]},\"text/vnd.wap.wmlscript\":{\"source\":\"iana\",\"extensions\":[\"wmls\"]},\"text/vtt\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"vtt\"]},\"text/x-asm\":{\"source\":\"apache\",\"extensions\":[\"s\",\"asm\"]},\"text/x-c\":{\"source\":\"apache\",\"extensions\":[\"c\",\"cc\",\"cxx\",\"cpp\",\"h\",\"hh\",\"dic\"]},\"text/x-component\":{\"source\":\"nginx\",\"extensions\":[\"htc\"]},\"text/x-fortran\":{\"source\":\"apache\",\"extensions\":[\"f\",\"for\",\"f77\",\"f90\"]},\"text/x-gwt-rpc\":{\"compressible\":true},\"text/x-handlebars-template\":{\"extensions\":[\"hbs\"]},\"text/x-java-source\":{\"source\":\"apache\",\"extensions\":[\"java\"]},\"text/x-jquery-tmpl\":{\"compressible\":true},\"text/x-lua\":{\"extensions\":[\"lua\"]},\"text/x-markdown\":{\"compressible\":true,\"extensions\":[\"mkd\"]},\"text/x-nfo\":{\"source\":\"apache\",\"extensions\":[\"nfo\"]},\"text/x-opml\":{\"source\":\"apache\",\"extensions\":[\"opml\"]},\"text/x-org\":{\"compressible\":true,\"extensions\":[\"org\"]},\"text/x-pascal\":{\"source\":\"apache\",\"extensions\":[\"p\",\"pas\"]},\"text/x-processing\":{\"compressible\":true,\"extensions\":[\"pde\"]},\"text/x-sass\":{\"extensions\":[\"sass\"]},\"text/x-scss\":{\"extensions\":[\"scss\"]},\"text/x-setext\":{\"source\":\"apache\",\"extensions\":[\"etx\"]},\"text/x-sfv\":{\"source\":\"apache\",\"extensions\":[\"sfv\"]},\"text/x-suse-ymp\":{\"compressible\":true,\"extensions\":[\"ymp\"]},\"text/x-uuencode\":{\"source\":\"apache\",\"extensions\":[\"uu\"]},\"text/x-vcalendar\":{\"source\":\"apache\",\"extensions\":[\"vcs\"]},\"text/x-vcard\":{\"source\":\"apache\",\"extensions\":[\"vcf\"]},\"text/xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xml\"]},\"text/xml-external-parsed-entity\":{\"source\":\"iana\"},\"text/yaml\":{\"extensions\":[\"yaml\",\"yml\"]},\"video/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"video/3gpp\":{\"source\":\"iana\",\"extensions\":[\"3gp\",\"3gpp\"]},\"video/3gpp-tt\":{\"source\":\"iana\"},\"video/3gpp2\":{\"source\":\"iana\",\"extensions\":[\"3g2\"]},\"video/bmpeg\":{\"source\":\"iana\"},\"video/bt656\":{\"source\":\"iana\"},\"video/celb\":{\"source\":\"iana\"},\"video/dv\":{\"source\":\"iana\"},\"video/encaprtp\":{\"source\":\"iana\"},\"video/flexfec\":{\"source\":\"iana\"},\"video/h261\":{\"source\":\"iana\",\"extensions\":[\"h261\"]},\"video/h263\":{\"source\":\"iana\",\"extensions\":[\"h263\"]},\"video/h263-1998\":{\"source\":\"iana\"},\"video/h263-2000\":{\"source\":\"iana\"},\"video/h264\":{\"source\":\"iana\",\"extensions\":[\"h264\"]},\"video/h264-rcdo\":{\"source\":\"iana\"},\"video/h264-svc\":{\"source\":\"iana\"},\"video/h265\":{\"source\":\"iana\"},\"video/iso.segment\":{\"source\":\"iana\"},\"video/jpeg\":{\"source\":\"iana\",\"extensions\":[\"jpgv\"]},\"video/jpeg2000\":{\"source\":\"iana\"},\"video/jpm\":{\"source\":\"apache\",\"extensions\":[\"jpm\",\"jpgm\"]},\"video/mj2\":{\"source\":\"iana\",\"extensions\":[\"mj2\",\"mjp2\"]},\"video/mp1s\":{\"source\":\"iana\"},\"video/mp2p\":{\"source\":\"iana\"},\"video/mp2t\":{\"source\":\"iana\",\"extensions\":[\"ts\"]},\"video/mp4\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"mp4\",\"mp4v\",\"mpg4\"]},\"video/mp4v-es\":{\"source\":\"iana\"},\"video/mpeg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"mpeg\",\"mpg\",\"mpe\",\"m1v\",\"m2v\"]},\"video/mpeg4-generic\":{\"source\":\"iana\"},\"video/mpv\":{\"source\":\"iana\"},\"video/nv\":{\"source\":\"iana\"},\"video/ogg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ogv\"]},\"video/parityfec\":{\"source\":\"iana\"},\"video/pointer\":{\"source\":\"iana\"},\"video/quicktime\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"qt\",\"mov\"]},\"video/raptorfec\":{\"source\":\"iana\"},\"video/raw\":{\"source\":\"iana\"},\"video/rtp-enc-aescm128\":{\"source\":\"iana\"},\"video/rtploopback\":{\"source\":\"iana\"},\"video/rtx\":{\"source\":\"iana\"},\"video/smpte291\":{\"source\":\"iana\"},\"video/smpte292m\":{\"source\":\"iana\"},\"video/ulpfec\":{\"source\":\"iana\"},\"video/vc1\":{\"source\":\"iana\"},\"video/vc2\":{\"source\":\"iana\"},\"video/vnd.cctv\":{\"source\":\"iana\"},\"video/vnd.dece.hd\":{\"source\":\"iana\",\"extensions\":[\"uvh\",\"uvvh\"]},\"video/vnd.dece.mobile\":{\"source\":\"iana\",\"extensions\":[\"uvm\",\"uvvm\"]},\"video/vnd.dece.mp4\":{\"source\":\"iana\"},\"video/vnd.dece.pd\":{\"source\":\"iana\",\"extensions\":[\"uvp\",\"uvvp\"]},\"video/vnd.dece.sd\":{\"source\":\"iana\",\"extensions\":[\"uvs\",\"uvvs\"]},\"video/vnd.dece.video\":{\"source\":\"iana\",\"extensions\":[\"uvv\",\"uvvv\"]},\"video/vnd.directv.mpeg\":{\"source\":\"iana\"},\"video/vnd.directv.mpeg-tts\":{\"source\":\"iana\"},\"video/vnd.dlna.mpeg-tts\":{\"source\":\"iana\"},\"video/vnd.dvb.file\":{\"source\":\"iana\",\"extensions\":[\"dvb\"]},\"video/vnd.fvt\":{\"source\":\"iana\",\"extensions\":[\"fvt\"]},\"video/vnd.hns.video\":{\"source\":\"iana\"},\"video/vnd.iptvforum.1dparityfec-1010\":{\"source\":\"iana\"},\"video/vnd.iptvforum.1dparityfec-2005\":{\"source\":\"iana\"},\"video/vnd.iptvforum.2dparityfec-1010\":{\"source\":\"iana\"},\"video/vnd.iptvforum.2dparityfec-2005\":{\"source\":\"iana\"},\"video/vnd.iptvforum.ttsavc\":{\"source\":\"iana\"},\"video/vnd.iptvforum.ttsmpeg2\":{\"source\":\"iana\"},\"video/vnd.motorola.video\":{\"source\":\"iana\"},\"video/vnd.motorola.videop\":{\"source\":\"iana\"},\"video/vnd.mpegurl\":{\"source\":\"iana\",\"extensions\":[\"mxu\",\"m4u\"]},\"video/vnd.ms-playready.media.pyv\":{\"source\":\"iana\",\"extensions\":[\"pyv\"]},\"video/vnd.nokia.interleaved-multimedia\":{\"source\":\"iana\"},\"video/vnd.nokia.mp4vr\":{\"source\":\"iana\"},\"video/vnd.nokia.videovoip\":{\"source\":\"iana\"},\"video/vnd.objectvideo\":{\"source\":\"iana\"},\"video/vnd.radgamettools.bink\":{\"source\":\"iana\"},\"video/vnd.radgamettools.smacker\":{\"source\":\"iana\"},\"video/vnd.sealed.mpeg1\":{\"source\":\"iana\"},\"video/vnd.sealed.mpeg4\":{\"source\":\"iana\"},\"video/vnd.sealed.swf\":{\"source\":\"iana\"},\"video/vnd.sealedmedia.softseal.mov\":{\"source\":\"iana\"},\"video/vnd.uvvu.mp4\":{\"source\":\"iana\",\"extensions\":[\"uvu\",\"uvvu\"]},\"video/vnd.vivo\":{\"source\":\"iana\",\"extensions\":[\"viv\"]},\"video/vnd.youtube.yt\":{\"source\":\"iana\"},\"video/vp8\":{\"source\":\"iana\"},\"video/webm\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"webm\"]},\"video/x-f4v\":{\"source\":\"apache\",\"extensions\":[\"f4v\"]},\"video/x-fli\":{\"source\":\"apache\",\"extensions\":[\"fli\"]},\"video/x-flv\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"flv\"]},\"video/x-m4v\":{\"source\":\"apache\",\"extensions\":[\"m4v\"]},\"video/x-matroska\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"mkv\",\"mk3d\",\"mks\"]},\"video/x-mng\":{\"source\":\"apache\",\"extensions\":[\"mng\"]},\"video/x-ms-asf\":{\"source\":\"apache\",\"extensions\":[\"asf\",\"asx\"]},\"video/x-ms-vob\":{\"source\":\"apache\",\"extensions\":[\"vob\"]},\"video/x-ms-wm\":{\"source\":\"apache\",\"extensions\":[\"wm\"]},\"video/x-ms-wmv\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"wmv\"]},\"video/x-ms-wmx\":{\"source\":\"apache\",\"extensions\":[\"wmx\"]},\"video/x-ms-wvx\":{\"source\":\"apache\",\"extensions\":[\"wvx\"]},\"video/x-msvideo\":{\"source\":\"apache\",\"extensions\":[\"avi\"]},\"video/x-sgi-movie\":{\"source\":\"apache\",\"extensions\":[\"movie\"]},\"video/x-smv\":{\"source\":\"apache\",\"extensions\":[\"smv\"]},\"x-conference/x-cooltalk\":{\"source\":\"apache\",\"extensions\":[\"ice\"]},\"x-shader/x-fragment\":{\"compressible\":true},\"x-shader/x-vertex\":{\"compressible\":true}}"); - -/***/ }), - -/***/ "./node_modules/mime-db/index.js": -/*!***************************************!*\ - !*** ./node_modules/mime-db/index.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_841955__) { - -/*! - * mime-db - * Copyright(c) 2014 Jonathan Ong - * MIT Licensed - */ - -/** - * Module exports. - */ - -module.exports = __nested_webpack_require_841955__(/*! ./db.json */ "./node_modules/mime-db/db.json") - - -/***/ }), - -/***/ "./node_modules/mime-types/index.js": -/*!******************************************!*\ - !*** ./node_modules/mime-types/index.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_842429__) { - -"use strict"; -/*! - * mime-types - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - - - -/** - * Module dependencies. - * @private - */ - -var db = __nested_webpack_require_842429__(/*! mime-db */ "./node_modules/mime-db/index.js") -var extname = __nested_webpack_require_842429__(/*! path */ "path").extname - -/** - * Module variables. - * @private - */ - -var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/ -var TEXT_TYPE_REGEXP = /^text\//i - -/** - * Module exports. - * @public - */ - -exports.charset = charset -exports.charsets = { lookup: charset } -exports.contentType = contentType -exports.extension = extension -exports.extensions = Object.create(null) -exports.lookup = lookup -exports.types = Object.create(null) - -// Populate the extensions/types maps -populateMaps(exports.extensions, exports.types) - -/** - * Get the default charset for a MIME type. - * - * @param {string} type - * @return {boolean|string} - */ - -function charset (type) { - if (!type || typeof type !== 'string') { - return false - } - - // TODO: use media-typer - var match = EXTRACT_TYPE_REGEXP.exec(type) - var mime = match && db[match[1].toLowerCase()] - - if (mime && mime.charset) { - return mime.charset - } - - // default text/* to utf-8 - if (match && TEXT_TYPE_REGEXP.test(match[1])) { - return 'UTF-8' - } - - return false -} - -/** - * Create a full Content-Type header given a MIME type or extension. - * - * @param {string} str - * @return {boolean|string} - */ - -function contentType (str) { - // TODO: should this even be in this module? - if (!str || typeof str !== 'string') { - return false - } - - var mime = str.indexOf('/') === -1 - ? exports.lookup(str) - : str - - if (!mime) { - return false - } - - // TODO: use content-type or other module - if (mime.indexOf('charset') === -1) { - var charset = exports.charset(mime) - if (charset) mime += '; charset=' + charset.toLowerCase() - } - - return mime -} - -/** - * Get the default extension for a MIME type. - * - * @param {string} type - * @return {boolean|string} - */ - -function extension (type) { - if (!type || typeof type !== 'string') { - return false - } - - // TODO: use media-typer - var match = EXTRACT_TYPE_REGEXP.exec(type) - - // get extensions - var exts = match && exports.extensions[match[1].toLowerCase()] - - if (!exts || !exts.length) { - return false - } - - return exts[0] -} - -/** - * Lookup the MIME type for a file path/extension. - * - * @param {string} path - * @return {boolean|string} - */ - -function lookup (path) { - if (!path || typeof path !== 'string') { - return false - } - - // get the extension ("ext" or ".ext" or full path) - var extension = extname('x.' + path) - .toLowerCase() - .substr(1) - - if (!extension) { - return false - } - - return exports.types[extension] || false -} - -/** - * Populate the extensions and types maps. - * @private - */ - -function populateMaps (extensions, types) { - // source preference (least -> most) - var preference = ['nginx', 'apache', undefined, 'iana'] - - Object.keys(db).forEach(function forEachMimeType (type) { - var mime = db[type] - var exts = mime.extensions - - if (!exts || !exts.length) { - return - } - - // mime -> extensions - extensions[type] = exts - - // extension -> mime - for (var i = 0; i < exts.length; i++) { - var extension = exts[i] - - if (types[extension]) { - var from = preference.indexOf(db[types[extension]].source) - var to = preference.indexOf(mime.source) - - if (types[extension] !== 'application/octet-stream' && - (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) { - // skip the remapping - continue - } - } - - // set the extension -> mime - types[extension] = type - } - }) -} - - -/***/ }), - -/***/ "./node_modules/ms/index.js": -/*!**********************************!*\ - !*** ./node_modules/ms/index.js ***! - \**********************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isNaN(val) === false) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - 'val is not a non-empty string or a valid number. val=' + - JSON.stringify(val) - ); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - default: - return undefined; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtShort(ms) { - if (ms >= d) { - return Math.round(ms / d) + 'd'; - } - if (ms >= h) { - return Math.round(ms / h) + 'h'; - } - if (ms >= m) { - return Math.round(ms / m) + 'm'; - } - if (ms >= s) { - return Math.round(ms / s) + 's'; - } - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtLong(ms) { - return plural(ms, d, 'day') || - plural(ms, h, 'hour') || - plural(ms, m, 'minute') || - plural(ms, s, 'second') || - ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, n, name) { - if (ms < n) { - return; - } - if (ms < n * 1.5) { - return Math.floor(ms / n) + ' ' + name; - } - return Math.ceil(ms / n) + ' ' + name + 's'; -} - - -/***/ }), - -/***/ "./node_modules/multiaddr/src/codec.js": -/*!*********************************************!*\ - !*** ./node_modules/multiaddr/src/codec.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_849468__) { - -"use strict"; - - -const convert = __nested_webpack_require_849468__(/*! ./convert */ "./node_modules/multiaddr/src/convert.js") -const protocols = __nested_webpack_require_849468__(/*! ./protocols-table */ "./node_modules/multiaddr/src/protocols-table.js") -const varint = __nested_webpack_require_849468__(/*! varint */ "./node_modules/varint/index.js") - -// export codec -module.exports = { - stringToStringTuples: stringToStringTuples, - stringTuplesToString: stringTuplesToString, - - tuplesToStringTuples: tuplesToStringTuples, - stringTuplesToTuples: stringTuplesToTuples, - - bufferToTuples: bufferToTuples, - tuplesToBuffer: tuplesToBuffer, - - bufferToString: bufferToString, - stringToBuffer: stringToBuffer, - - fromString: fromString, - fromBuffer: fromBuffer, - validateBuffer: validateBuffer, - isValidBuffer: isValidBuffer, - cleanPath: cleanPath, - - ParseError: ParseError, - protoFromTuple: protoFromTuple, - - sizeForAddr: sizeForAddr -} - -// string -> [[str name, str addr]... ] -function stringToStringTuples (str) { - const tuples = [] - const parts = str.split('/').slice(1) // skip first empty elem - if (parts.length === 1 && parts[0] === '') { - return [] - } - - for (let p = 0; p < parts.length; p++) { - const part = parts[p] - const proto = protocols(part) - - if (proto.size === 0) { - tuples.push([part]) - continue - } - - p++ // advance addr part - if (p >= parts.length) { - throw ParseError('invalid address: ' + str) - } - - // if it's a path proto, take the rest - if (proto.path) { - tuples.push([ - part, - // TODO: should we need to check each path part to see if it's a proto? - // This would allow for other protocols to be added after a unix path, - // however it would have issues if the path had a protocol name in the path - cleanPath(parts.slice(p).join('/')) - ]) - break - } - - tuples.push([part, parts[p]]) - } - - return tuples -} - -// [[str name, str addr]... ] -> string -function stringTuplesToString (tuples) { - const parts = [] - tuples.map(tup => { - const proto = protoFromTuple(tup) - parts.push(proto.name) - if (tup.length > 1) { - parts.push(tup[1]) - } - }) - - return cleanPath(parts.join('/')) -} - -// [[str name, str addr]... ] -> [[int code, Buffer]... ] -function stringTuplesToTuples (tuples) { - return tuples.map(tup => { - if (!Array.isArray(tup)) { - tup = [tup] - } - const proto = protoFromTuple(tup) - if (tup.length > 1) { - return [proto.code, convert.toBuffer(proto.code, tup[1])] - } - return [proto.code] - }) -} - -// [[int code, Buffer]... ] -> [[str name, str addr]... ] -function tuplesToStringTuples (tuples) { - return tuples.map(tup => { - const proto = protoFromTuple(tup) - if (tup.length > 1) { - return [proto.code, convert.toString(proto.code, tup[1])] - } - return [proto.code] - }) -} - -// [[int code, Buffer ]... ] -> Buffer -function tuplesToBuffer (tuples) { - return fromBuffer(Buffer.concat(tuples.map(tup => { - const proto = protoFromTuple(tup) - let buf = Buffer.from(varint.encode(proto.code)) - - if (tup.length > 1) { - buf = Buffer.concat([buf, tup[1]]) // add address buffer - } - - return buf - }))) -} - -function sizeForAddr (p, addr) { - if (p.size > 0) { - return p.size / 8 - } else if (p.size === 0) { - return 0 - } else { - const size = varint.decode(addr) - return size + varint.decode.bytes - } -} - -// Buffer -> [[int code, Buffer ]... ] -function bufferToTuples (buf) { - const tuples = [] - let i = 0 - while (i < buf.length) { - const code = varint.decode(buf, i) - const n = varint.decode.bytes - - const p = protocols(code) - - const size = sizeForAddr(p, buf.slice(i + n)) - - if (size === 0) { - tuples.push([code]) - i += n - continue - } - - const addr = buf.slice(i + n, i + n + size) - - i += (size + n) - - if (i > buf.length) { // did not end _exactly_ at buffer.length - throw ParseError('Invalid address buffer: ' + buf.toString('hex')) - } - - // ok, tuple seems good. - tuples.push([code, addr]) - } - - return tuples -} - -// Buffer -> String -function bufferToString (buf) { - const a = bufferToTuples(buf) - const b = tuplesToStringTuples(a) - return stringTuplesToString(b) -} - -// String -> Buffer -function stringToBuffer (str) { - str = cleanPath(str) - const a = stringToStringTuples(str) - const b = stringTuplesToTuples(a) - - return tuplesToBuffer(b) -} - -// String -> Buffer -function fromString (str) { - return stringToBuffer(str) -} - -// Buffer -> Buffer -function fromBuffer (buf) { - const err = validateBuffer(buf) - if (err) throw err - return Buffer.from(buf) // copy -} - -function validateBuffer (buf) { - try { - bufferToTuples(buf) // try to parse. will throw if breaks - } catch (err) { - return err - } -} - -function isValidBuffer (buf) { - return validateBuffer(buf) === undefined -} - -function cleanPath (str) { - return '/' + str.trim().split('/').filter(a => a).join('/') -} - -function ParseError (str) { - return new Error('Error parsing address: ' + str) -} - -function protoFromTuple (tup) { - const proto = protocols(tup[0]) - return proto -} - - -/***/ }), - -/***/ "./node_modules/multiaddr/src/convert.js": -/*!***********************************************!*\ - !*** ./node_modules/multiaddr/src/convert.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_854861__) { - -"use strict"; - - -const ip = __nested_webpack_require_854861__(/*! ip */ "./node_modules/ip/lib/ip.js") -const isIp = __nested_webpack_require_854861__(/*! is-ip */ "./node_modules/is-ip/index.js") -const protocols = __nested_webpack_require_854861__(/*! ./protocols-table */ "./node_modules/multiaddr/src/protocols-table.js") -const bs58 = __nested_webpack_require_854861__(/*! bs58 */ "./node_modules/bs58/index.js") -const CID = __nested_webpack_require_854861__(/*! cids */ "./node_modules/cids/src/index.js") -const base32 = __nested_webpack_require_854861__(/*! hi-base32 */ "./node_modules/hi-base32/src/base32.js") -const varint = __nested_webpack_require_854861__(/*! varint */ "./node_modules/varint/index.js") - -module.exports = Convert - -// converts (serializes) addresses -function Convert (proto, a) { - if (a instanceof Buffer) { - return Convert.toString(proto, a) - } else { - return Convert.toBuffer(proto, a) - } -} - -Convert.toString = function convertToString (proto, buf) { - proto = protocols(proto) - switch (proto.code) { - case 4: // ipv4 - case 41: // ipv6 - return buf2ip(buf) - - case 6: // tcp - case 273: // udp - case 33: // dccp - case 132: // sctp - return buf2port(buf) - - case 53: // dns - case 54: // dns4 - case 55: // dns6 - case 56: // dnsaddr - case 400: // unix - return buf2str(buf) - - case 421: // ipfs - return buf2mh(buf) - case 444: // onion - return buf2onion(buf) - case 445: // onion3 - return buf2onion(buf) - default: - return buf.toString('hex') // no clue. convert to hex - } -} - -Convert.toBuffer = function convertToBuffer (proto, str) { - proto = protocols(proto) - switch (proto.code) { - case 4: // ipv4 - return ip2buf(str) - case 41: // ipv6 - return ip2buf(str) - - case 6: // tcp - case 273: // udp - case 33: // dccp - case 132: // sctp - return port2buf(parseInt(str, 10)) - - case 53: // dns - case 54: // dns4 - case 55: // dns6 - case 56: // dnsaddr - case 400: // unix - return str2buf(str) - - case 421: // ipfs - return mh2buf(str) - case 444: // onion - return onion2buf(str) - case 445: // onion3 - return onion32buf(str) - default: - return Buffer.from(str, 'hex') // no clue. convert from hex - } -} - -function ip2buf (ipString) { - if (!isIp(ipString)) { - throw new Error('invalid ip address') - } - return ip.toBuffer(ipString) -} - -function buf2ip (ipBuff) { - const ipString = ip.toString(ipBuff) - if (!isIp(ipString)) { - throw new Error('invalid ip address') - } - return ipString -} - -function port2buf (port) { - const buf = Buffer.alloc(2) - buf.writeUInt16BE(port, 0) - return buf -} - -function buf2port (buf) { - return buf.readUInt16BE(0) -} - -function str2buf (str) { - const buf = Buffer.from(str) - const size = Buffer.from(varint.encode(buf.length)) - return Buffer.concat([size, buf]) -} - -function buf2str (buf) { - const size = varint.decode(buf) - buf = buf.slice(varint.decode.bytes) - - if (buf.length !== size) { - throw new Error('inconsistent lengths') - } - - return buf.toString() -} - -function mh2buf (hash) { - // the address is a varint prefixed multihash string representation - const mh = new CID(hash).multihash - const size = Buffer.from(varint.encode(mh.length)) - return Buffer.concat([size, mh]) -} - -function buf2mh (buf) { - const size = varint.decode(buf) - const address = buf.slice(varint.decode.bytes) - - if (address.length !== size) { - throw new Error('inconsistent lengths') - } - - return bs58.encode(address) -} - -function onion2buf (str) { - const addr = str.split(':') - if (addr.length !== 2) { - throw new Error('failed to parse onion addr: ' + addr + ' does not contain a port number') - } - if (addr[0].length !== 16) { - throw new Error('failed to parse onion addr: ' + addr[0] + ' not a Tor onion address.') - } - const buf = Buffer.from(base32.decode.asBytes(addr[0].toUpperCase())) - - // onion port number - const port = parseInt(addr[1], 10) - if (port < 1 || port > 65536) { - throw new Error('Port number is not in range(1, 65536)') - } - const portBuf = port2buf(port) - return Buffer.concat([buf, portBuf]) -} - -function onion32buf (str) { - const addr = str.split(':') - if (addr.length !== 2) { - throw new Error('failed to parse onion addr: ' + addr + ' does not contain a port number') - } - if (addr[0].length !== 56) { - throw new Error('failed to parse onion addr: ' + addr[0] + ' not a Tor onion3 address.') - } - const buf = Buffer.from(base32.decode.asBytes(addr[0].toUpperCase())) - - // onion port number - const port = parseInt(addr[1], 10) - if (port < 1 || port > 65536) { - throw new Error('Port number is not in range(1, 65536)') - } - const portBuf = port2buf(port) - return Buffer.concat([buf, portBuf]) -} - -function buf2onion (buf) { - const addrBytes = buf.slice(0, buf.length - 2) - const portBytes = buf.slice(buf.length - 2) - const addr = base32.encode(addrBytes).toLowerCase() - const port = buf2port(portBytes) - return addr + ':' + port -} - - -/***/ }), - -/***/ "./node_modules/multiaddr/src/index.js": -/*!*********************************************!*\ - !*** ./node_modules/multiaddr/src/index.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_860070__) { - -"use strict"; - - -const codec = __nested_webpack_require_860070__(/*! ./codec */ "./node_modules/multiaddr/src/codec.js") -const protocols = __nested_webpack_require_860070__(/*! ./protocols-table */ "./node_modules/multiaddr/src/protocols-table.js") -const varint = __nested_webpack_require_860070__(/*! varint */ "./node_modules/varint/index.js") -const bs58 = __nested_webpack_require_860070__(/*! bs58 */ "./node_modules/bs58/index.js") -const CID = __nested_webpack_require_860070__(/*! cids */ "./node_modules/cids/src/index.js") -const withIs = __nested_webpack_require_860070__(/*! class-is */ "./node_modules/class-is/index.js") -const inspect = Symbol.for('nodejs.util.inspect.custom') - -/** - * Creates a [multiaddr](https://github.com/multiformats/multiaddr) from - * a Buffer, String or another Multiaddr instance - * public key. - * @class Multiaddr - * @param {(String|Buffer|Multiaddr)} addr - If String or Buffer, needs to adhere - * to the address format of a [multiaddr](https://github.com/multiformats/multiaddr#string-format) - * @example - * Multiaddr('/ip4/127.0.0.1/tcp/4001') - * // - */ -const Multiaddr = withIs.proto(function (addr) { - if (!(this instanceof Multiaddr)) { - return new Multiaddr(addr) - } - - // default - if (addr == null) { - addr = '' - } - - if (addr instanceof Buffer) { - /** - * @type {Buffer} - The raw bytes representing this multiaddress - */ - this.buffer = codec.fromBuffer(addr) - } else if (typeof addr === 'string' || addr instanceof String) { - if (addr.length > 0 && addr.charAt(0) !== '/') { - throw new Error(`multiaddr "${addr}" must start with a "/"`) - } - this.buffer = codec.fromString(addr) - } else if (addr.buffer && addr.protos && addr.protoCodes) { // Multiaddr - this.buffer = codec.fromBuffer(addr.buffer) // validate + copy buffer - } else { - throw new Error('addr must be a string, Buffer, or another Multiaddr') - } -}, { className: 'Multiaddr', symbolName: '@multiformats/js-multiaddr/multiaddr' }) - -/** - * Returns Multiaddr as a String - * - * @returns {String} - * @example - * Multiaddr('/ip4/127.0.0.1/tcp/4001').toString() - * // '/ip4/127.0.0.1/tcp/4001' - */ -Multiaddr.prototype.toString = function toString () { - return codec.bufferToString(this.buffer) -} - -/** - * Returns Multiaddr as a JSON encoded object - * - * @returns {String} - * @example - * JSON.stringify(Multiaddr('/ip4/127.0.0.1/tcp/4001')) - * // '/ip4/127.0.0.1/tcp/4001' - */ -Multiaddr.prototype.toJSON = Multiaddr.prototype.toString - -/** - * Returns Multiaddr as a convinient options object to be used with net.createConnection - * - * @returns {{family: String, host: String, transport: String, port: Number}} - * @example - * Multiaddr('/ip4/127.0.0.1/tcp/4001').toOptions() - * // { family: 'ipv4', host: '127.0.0.1', transport: 'tcp', port: 4001 } - */ -Multiaddr.prototype.toOptions = function toOptions () { - const opts = {} - const parsed = this.toString().split('/') - opts.family = parsed[1] === 'ip4' ? 'ipv4' : 'ipv6' - opts.host = parsed[2] - opts.transport = parsed[3] - opts.port = parseInt(parsed[4]) - return opts -} - -/** - * Returns Multiaddr as a human-readable string. - * For post Node.js v10.0.0. - * https://nodejs.org/api/deprecations.html#deprecations_dep0079_custom_inspection_function_on_objects_via_inspect - * - * @returns {String} - * @example - * console.log(Multiaddr('/ip4/127.0.0.1/tcp/4001')) - * // '' - */ -Multiaddr.prototype[inspect] = function inspectCustom () { - return '' -} - -/** - * Returns Multiaddr as a human-readable string. - * Fallback for pre Node.js v10.0.0. - * https://nodejs.org/api/deprecations.html#deprecations_dep0079_custom_inspection_function_on_objects_via_inspect - * - * @returns {String} - * @example - * Multiaddr('/ip4/127.0.0.1/tcp/4001').inspect() - * // '' - */ -Multiaddr.prototype.inspect = function inspect () { - return '' -} - -/** - * Returns the protocols the Multiaddr is defined with, as an array of objects, in - * left-to-right order. Each object contains the protocol code, protocol name, - * and the size of its address space in bits. - * [See list of protocols](https://github.com/multiformats/multiaddr/blob/master/protocols.csv) - * - * @returns {Array.} protocols - All the protocols the address is composed of - * @returns {Number} protocols[].code - * @returns {Number} protocols[].size - * @returns {String} protocols[].name - * @example - * Multiaddr('/ip4/127.0.0.1/tcp/4001').protos() - * // [ { code: 4, size: 32, name: 'ip4' }, - * // { code: 6, size: 16, name: 'tcp' } ] - */ -Multiaddr.prototype.protos = function protos () { - return this.protoCodes().map(code => Object.assign({}, protocols(code))) -} - -/** - * Returns the codes of the protocols in left-to-right order. - * [See list of protocols](https://github.com/multiformats/multiaddr/blob/master/protocols.csv) - * - * @returns {Array.} protocol codes - * @example - * Multiaddr('/ip4/127.0.0.1/tcp/4001').protoCodes() - * // [ 4, 6 ] - */ -Multiaddr.prototype.protoCodes = function protoCodes () { - const codes = [] - const buf = this.buffer - let i = 0 - while (i < buf.length) { - const code = varint.decode(buf, i) - const n = varint.decode.bytes - - const p = protocols(code) - const size = codec.sizeForAddr(p, buf.slice(i + n)) - - i += (size + n) - codes.push(code) - } - - return codes -} - -/** - * Returns the names of the protocols in left-to-right order. - * [See list of protocols](https://github.com/multiformats/multiaddr/blob/master/protocols.csv) - * - * @return {Array.} protocol names - * @example - * Multiaddr('/ip4/127.0.0.1/tcp/4001').protoNames() - * // [ 'ip4', 'tcp' ] - */ -Multiaddr.prototype.protoNames = function protoNames () { - return this.protos().map(proto => proto.name) -} - -/** - * Returns a tuple of parts - * - * @return {Array.} tuples - * @return {Number} tuples[].0 code of protocol - * @return {Buffer} tuples[].1 contents of address - * @example - * Multiaddr("/ip4/127.0.0.1/tcp/4001").tuples() - * // [ [ 4, ], [ 6, ] ] - */ -Multiaddr.prototype.tuples = function tuples () { - return codec.bufferToTuples(this.buffer) -} - -/** - * Returns a tuple of string/number parts - * - * @return {Array.} tuples - * @return {Number} tuples[].0 code of protocol - * @return {(String|Number)} tuples[].1 contents of address - * @example - * Multiaddr("/ip4/127.0.0.1/tcp/4001").stringTuples() - * // [ [ 4, '127.0.0.1' ], [ 6, 4001 ] ] - */ -Multiaddr.prototype.stringTuples = function stringTuples () { - const t = codec.bufferToTuples(this.buffer) - return codec.tuplesToStringTuples(t) -} - -/** - * Encapsulates a Multiaddr in another Multiaddr - * - * @param {Multiaddr} addr - Multiaddr to add into this Multiaddr - * @return {Multiaddr} - * @example - * const mh1 = Multiaddr('/ip4/8.8.8.8/tcp/1080') - * // - * - * const mh2 = Multiaddr('/ip4/127.0.0.1/tcp/4001') - * // - * - * const mh3 = mh1.encapsulate(mh2) - * // - * - * mh3.toString() - * // '/ip4/8.8.8.8/tcp/1080/ip4/127.0.0.1/tcp/4001' - */ -Multiaddr.prototype.encapsulate = function encapsulate (addr) { - addr = Multiaddr(addr) - return Multiaddr(this.toString() + addr.toString()) -} - -/** - * Decapsulates a Multiaddr from another Multiaddr - * - * @param {Multiaddr} addr - Multiaddr to remove from this Multiaddr - * @return {Multiaddr} - * @example - * const mh1 = Multiaddr('/ip4/8.8.8.8/tcp/1080') - * // - * - * const mh2 = Multiaddr('/ip4/127.0.0.1/tcp/4001') - * // - * - * const mh3 = mh1.encapsulate(mh2) - * // - * - * mh3.decapsulate(mh2).toString() - * // '/ip4/8.8.8.8/tcp/1080' - */ -Multiaddr.prototype.decapsulate = function decapsulate (addr) { - addr = addr.toString() - const s = this.toString() - const i = s.lastIndexOf(addr) - if (i < 0) { - throw new Error('Address ' + this + ' does not contain subaddress: ' + addr) - } - return Multiaddr(s.slice(0, i)) -} - -/** - * A more reliable version of `decapsulate` if you are targeting a - * specific code, such as 421 (the `p2p` protocol code). The last index of the code - * will be removed from the `Multiaddr`, and a new instance will be returned. - * If the code is not present, the original `Multiaddr` is returned. - * - * @param {Number} code The code of the protocol to decapsulate from this Multiaddr - * @return {Multiaddr} - * @example - * const addr = Multiaddr('/ip4/0.0.0.0/tcp/8080/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC') - * // - * - * addr.decapsulateCode(421).toString() - * // '/ip4/0.0.0.0/tcp/8080' - * - * Multiaddr('/ip4/127.0.0.1/tcp/8080').decapsulateCode(421).toString() - * // '/ip4/127.0.0.1/tcp/8080' - */ -Multiaddr.prototype.decapsulateCode = function decapsulateCode (code) { - const tuples = this.tuples() - for (let i = tuples.length - 1; i >= 0; i--) { - if (tuples[i][0] === code) { - return Multiaddr(codec.tuplesToBuffer(tuples.slice(0, i))) - } - } - return this -} - -/** - * Extract the peerId if the multiaddr contains one - * - * @return {String|null} peerId - The id of the peer or null if invalid or missing from the ma - * @example - * const mh1 = Multiaddr('/ip4/8.8.8.8/tcp/1080/ipfs/QmValidBase58string') - * // - * - * // should return QmValidBase58string or null if the id is missing or invalid - * const peerId = mh1.getPeerId() - */ -Multiaddr.prototype.getPeerId = function getPeerId () { - let b58str = null - try { - const tuples = this.stringTuples().filter((tuple) => { - if (tuple[0] === protocols.names.ipfs.code) { - return true - } - }) - - // Get the last id - b58str = tuples.pop()[1] - // Get multihash, unwrap from CID if needed - b58str = bs58.encode(new CID(b58str).multihash) - } catch (e) { - b58str = null - } - - return b58str -} - -/** - * Extract the path if the multiaddr contains one - * - * @return {String|null} path - The path of the multiaddr, or null if no path protocol is present - * @example - * const mh1 = Multiaddr('/ip4/8.8.8.8/tcp/1080/unix/tmp/p2p.sock') - * // - * - * // should return utf8 string or null if the id is missing or invalid - * const path = mh1.getPath() - */ -Multiaddr.prototype.getPath = function getPath () { - let path = null - try { - path = this.stringTuples().filter((tuple) => { - const proto = protocols(tuple[0]) - if (proto.path) { - return true - } - })[0][1] - } catch (e) { - path = null - } - - return path -} - -/** - * Checks if two Multiaddrs are the same - * - * @param {Multiaddr} addr - * @return {Bool} - * @example - * const mh1 = Multiaddr('/ip4/8.8.8.8/tcp/1080') - * // - * - * const mh2 = Multiaddr('/ip4/127.0.0.1/tcp/4001') - * // - * - * mh1.equals(mh1) - * // true - * - * mh1.equals(mh2) - * // false - */ -Multiaddr.prototype.equals = function equals (addr) { - return this.buffer.equals(addr.buffer) -} - -/** - * Gets a Multiaddrs node-friendly address object. Note that protocol information - * is left out: in Node (and most network systems) the protocol is unknowable - * given only the address. - * - * Has to be a ThinWaist Address, otherwise throws error - * - * @returns {{family: String, address: String, port: Number}} - * @throws {Error} Throws error if Multiaddr is not a Thin Waist address - * @example - * Multiaddr('/ip4/127.0.0.1/tcp/4001').nodeAddress() - * // {family: 'IPv4', address: '127.0.0.1', port: '4001'} - */ -Multiaddr.prototype.nodeAddress = function nodeAddress () { - const codes = this.protoCodes() - const names = this.protoNames() - const parts = this.toString().split('/').slice(1) - - if (parts.length < 4) { - throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6}/{address}/{tcp, udp}/{port}".') - } else if (codes[0] !== 4 && codes[0] !== 41 && codes[0] !== 54 && codes[0] !== 55) { - throw new Error(`no protocol with name: "'${names[0]}'". Must have a valid family name: "{ip4, ip6, dns4, dns6}".`) - } else if (parts[2] !== 'tcp' && parts[2] !== 'udp') { - throw new Error(`no protocol with name: "'${names[1]}'". Must have a valid transport protocol: "{tcp, udp}".`) - } - - return { - family: (codes[0] === 41 || codes[0] === 55) ? 6 : 4, - address: parts[1], // ip addr - port: parseInt(parts[3]) // tcp or udp port - } -} - -/** - * Creates a Multiaddr from a node-friendly address object - * - * @param {{family: String, address: String, port: Number}} addr - * @param {String} transport - * @returns {Multiaddr} multiaddr - * @throws {Error} Throws error if addr is not truthy - * @throws {Error} Throws error if transport is not truthy - * @example - * Multiaddr.fromNodeAddress({address: '127.0.0.1', port: '4001'}, 'tcp') - * // - */ -Multiaddr.fromNodeAddress = function fromNodeAddress (addr, transport) { - if (!addr) throw new Error('requires node address object') - if (!transport) throw new Error('requires transport protocol') - const ip = (addr.family === 'IPv6') ? 'ip6' : 'ip4' - return Multiaddr('/' + [ip, addr.address, transport, addr.port].join('/')) -} - -// TODO find a better example, not sure about it's good enough -/** - * Returns if a Multiaddr is a Thin Waist address or not. - * - * Thin Waist is if a Multiaddr adheres to the standard combination of: - * - * `{IPv4, IPv6}/{TCP, UDP}` - * - * @param {Multiaddr} [addr] - Defaults to using `this` instance - * @returns {Boolean} isThinWaistAddress - * @example - * const mh1 = Multiaddr('/ip4/127.0.0.1/tcp/4001') - * // - * const mh2 = Multiaddr('/ip4/192.168.2.1/tcp/5001') - * // - * const mh3 = mh1.encapsulate(mh2) - * // - * mh1.isThinWaistAddress() - * // true - * mh2.isThinWaistAddress() - * // true - * mh3.isThinWaistAddress() - * // false - */ -Multiaddr.prototype.isThinWaistAddress = function isThinWaistAddress (addr) { - const protos = (addr || this).protos() - - if (protos.length !== 2) { - return false - } - - if (protos[0].code !== 4 && protos[0].code !== 41) { - return false - } - if (protos[1].code !== 6 && protos[1].code !== 273) { - return false - } - return true -} - -/** - * Object containing table, names and codes of all supported protocols. - * To get the protocol values from a Multiaddr, you can use - * [`.protos()`](#multiaddrprotos), - * [`.protoCodes()`](#multiaddrprotocodes) or - * [`.protoNames()`](#multiaddrprotonames) - * - * @instance - * @returns {{table: Array, names: Object, codes: Object}} - * - */ -Multiaddr.protocols = protocols - -/** - * Returns if something is a Multiaddr that is a name - * - * @param {Multiaddr} addr - * @return {Bool} isName - */ -Multiaddr.isName = function isName (addr) { - if (!Multiaddr.isMultiaddr(addr)) { - return false - } - - // if a part of the multiaddr is resolvable, then return true - return addr.protos().some((proto) => proto.resolvable) -} - -/** - * Returns an array of multiaddrs, by resolving the multiaddr that is a name - * - * @async - * @param {Multiaddr} addr - * @return {Multiaddr[]} - */ -Multiaddr.resolve = function resolve (addr) { - if (!Multiaddr.isMultiaddr(addr) || !Multiaddr.isName(addr)) { - return Promise.reject(Error('not a valid name')) - } - - /* - * Needs more consideration from spec design: - * - what to return - * - how to achieve it in the browser? - */ - return Promise.reject(new Error('not implemented yet')) -} - -exports = module.exports = Multiaddr - - -/***/ }), - -/***/ "./node_modules/multiaddr/src/protocols-table.js": -/*!*******************************************************!*\ - !*** ./node_modules/multiaddr/src/protocols-table.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; - - -function Protocols (proto) { - if (typeof (proto) === 'number') { - if (Protocols.codes[proto]) { - return Protocols.codes[proto] - } - - throw new Error('no protocol with code: ' + proto) - } else if (typeof (proto) === 'string' || proto instanceof String) { - if (Protocols.names[proto]) { - return Protocols.names[proto] - } - - throw new Error('no protocol with name: ' + proto) - } - - throw new Error('invalid protocol id type: ' + proto) -} - -const V = -1 -Protocols.lengthPrefixedVarSize = V -Protocols.V = V - -Protocols.table = [ - [4, 32, 'ip4'], - [6, 16, 'tcp'], - [33, 16, 'dccp'], - [41, 128, 'ip6'], - [42, V, 'ip6zone'], - [53, V, 'dns', 'resolvable'], - [54, V, 'dns4', 'resolvable'], - [55, V, 'dns6', 'resolvable'], - [56, V, 'dnsaddr', 'resolvable'], - [132, 16, 'sctp'], - [273, 16, 'udp'], - [275, 0, 'p2p-webrtc-star'], - [276, 0, 'p2p-webrtc-direct'], - [277, 0, 'p2p-stardust'], - [290, 0, 'p2p-circuit'], - [301, 0, 'udt'], - [302, 0, 'utp'], - [400, V, 'unix', false, 'path'], - // `ipfs` is added before `p2p` for legacy support. - // All text representations will default to `p2p`, but `ipfs` will - // still be supported - [421, V, 'ipfs'], - // `p2p` is the preferred name for 421, and is now the default - [421, V, 'p2p'], - [443, 0, 'https'], - [444, 96, 'onion'], - [445, 296, 'onion3'], - [446, V, 'garlic64'], - [460, 0, 'quic'], - [477, 0, 'ws'], - [478, 0, 'wss'], - [479, 0, 'p2p-websocket-star'], - [480, 0, 'http'] -] - -Protocols.names = {} -Protocols.codes = {} - -// populate tables -Protocols.table.map(row => { - const proto = p.apply(null, row) - Protocols.codes[proto.code] = proto - Protocols.names[proto.name] = proto -}) - -Protocols.object = p - -function p (code, size, name, resolvable, path) { - return { - code: code, - size: size, - name: name, - resolvable: Boolean(resolvable), - path: Boolean(path) - } -} - -module.exports = Protocols - - -/***/ }), - -/***/ "./node_modules/multibase/src/base.js": -/*!********************************************!*\ - !*** ./node_modules/multibase/src/base.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; - - -class Base { - constructor (name, code, implementation, alphabet) { - this.name = name - this.code = code - this.alphabet = alphabet - if (implementation && alphabet) { - this.engine = implementation(alphabet) - } - } - - encode (stringOrBuffer) { - return this.engine.encode(stringOrBuffer) - } - - decode (stringOrBuffer) { - return this.engine.decode(stringOrBuffer) - } - - isImplemented () { - return this.engine - } -} - -module.exports = Base - - -/***/ }), - -/***/ "./node_modules/multibase/src/base16.js": -/*!**********************************************!*\ - !*** ./node_modules/multibase/src/base16.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; - - -module.exports = function base16 (alphabet) { - return { - encode (input) { - if (typeof input === 'string') { - return Buffer.from(input).toString('hex') - } - return input.toString('hex') - }, - decode (input) { - for (let char of input) { - if (alphabet.indexOf(char) < 0) { - throw new Error('invalid base16 character') - } - } - return Buffer.from(input, 'hex') - } - } -} - - -/***/ }), - -/***/ "./node_modules/multibase/src/base32.js": -/*!**********************************************!*\ - !*** ./node_modules/multibase/src/base32.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; - - -function decode (input, alphabet) { - input = input.replace(new RegExp('=', 'g'), '') - let length = input.length - - let bits = 0 - let value = 0 - - let index = 0 - let output = new Uint8Array((length * 5 / 8) | 0) - - for (let i = 0; i < length; i++) { - value = (value << 5) | alphabet.indexOf(input[i]) - bits += 5 - - if (bits >= 8) { - output[index++] = (value >>> (bits - 8)) & 255 - bits -= 8 - } - } - - return output.buffer -} - -function encode (buffer, alphabet) { - let length = buffer.byteLength - let view = new Uint8Array(buffer) - let padding = alphabet.indexOf('=') === alphabet.length - 1 - - if (padding) { - alphabet = alphabet.substring(0, alphabet.length - 2) - } - - let bits = 0 - let value = 0 - let output = '' - - for (let i = 0; i < length; i++) { - value = (value << 8) | view[i] - bits += 8 - - while (bits >= 5) { - output += alphabet[(value >>> (bits - 5)) & 31] - bits -= 5 - } - } - - if (bits > 0) { - output += alphabet[(value << (5 - bits)) & 31] - } - - if (padding) { - while ((output.length % 8) !== 0) { - output += '=' - } - } - - return output -} - -module.exports = function base32 (alphabet) { - return { - encode (input) { - if (typeof input === 'string') { - return encode(Buffer.from(input), alphabet) - } - - return encode(input, alphabet) - }, - decode (input) { - for (let char of input) { - if (alphabet.indexOf(char) < 0) { - throw new Error('invalid base32 character') - } - } - - return decode(input, alphabet) - } - } -} - - -/***/ }), - -/***/ "./node_modules/multibase/src/base64.js": -/*!**********************************************!*\ - !*** ./node_modules/multibase/src/base64.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; - - -module.exports = function base64 (alphabet) { - // The alphabet is only used to know: - // 1. If padding is enabled (must contain '=') - // 2. If the output must be url-safe (must contain '-' and '_') - // 3. If the input of the output function is valid - // The alphabets from RFC 4648 are always used. - const padding = alphabet.indexOf('=') > -1 - const url = alphabet.indexOf('-') > -1 && alphabet.indexOf('_') > -1 - - return { - encode (input) { - let output = '' - - if (typeof input === 'string') { - output = Buffer.from(input).toString('base64') - } else { - output = input.toString('base64') - } - - if (url) { - output = output.replace(/\+/g, '-').replace(/\//g, '_') - } - - const pad = output.indexOf('=') - if (pad > 0 && !padding) { - output = output.substring(0, pad) - } - - return output - }, - decode (input) { - for (let char of input) { - if (alphabet.indexOf(char) < 0) { - throw new Error('invalid base64 character') - } - } - - return Buffer.from(input, 'base64') - } - } -} - - -/***/ }), - -/***/ "./node_modules/multibase/src/constants.js": -/*!*************************************************!*\ - !*** ./node_modules/multibase/src/constants.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_883710__) { - -"use strict"; - - -const Base = __nested_webpack_require_883710__(/*! ./base.js */ "./node_modules/multibase/src/base.js") -const baseX = __nested_webpack_require_883710__(/*! base-x */ "./node_modules/base-x/src/index.js") -const base16 = __nested_webpack_require_883710__(/*! ./base16 */ "./node_modules/multibase/src/base16.js") -const base32 = __nested_webpack_require_883710__(/*! ./base32 */ "./node_modules/multibase/src/base32.js") -const base64 = __nested_webpack_require_883710__(/*! ./base64 */ "./node_modules/multibase/src/base64.js") - -// name, code, implementation, alphabet -const constants = [ - ['base1', '1', '', '1'], - ['base2', '0', baseX, '01'], - ['base8', '7', baseX, '01234567'], - ['base10', '9', baseX, '0123456789'], - ['base16', 'f', base16, '0123456789abcdef'], - ['base32', 'b', base32, 'abcdefghijklmnopqrstuvwxyz234567'], - ['base32pad', 'c', base32, 'abcdefghijklmnopqrstuvwxyz234567='], - ['base32hex', 'v', base32, '0123456789abcdefghijklmnopqrstuv'], - ['base32hexpad', 't', base32, '0123456789abcdefghijklmnopqrstuv='], - ['base32z', 'h', base32, 'ybndrfg8ejkmcpqxot1uwisza345h769'], - ['base58flickr', 'Z', baseX, '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'], - ['base58btc', 'z', baseX, '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'], - ['base64', 'm', base64, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'], - ['base64pad', 'M', base64, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='], - ['base64url', 'u', base64, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'], - ['base64urlpad', 'U', base64, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_='] -] - -const names = constants.reduce((prev, tupple) => { - prev[tupple[0]] = new Base(tupple[0], tupple[1], tupple[2], tupple[3]) - return prev -}, {}) - -const codes = constants.reduce((prev, tupple) => { - prev[tupple[1]] = names[tupple[0]] - return prev -}, {}) - -module.exports = { - names: names, - codes: codes -} - - -/***/ }), - -/***/ "./node_modules/multibase/src/index.js": -/*!*********************************************!*\ - !*** ./node_modules/multibase/src/index.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_885943__) { - -"use strict"; -/** - * Implementation of the [multibase](https://github.com/multiformats/multibase) specification. - * @module Multibase - */ - - -const constants = __nested_webpack_require_885943__(/*! ./constants */ "./node_modules/multibase/src/constants.js") - -exports = module.exports = multibase -exports.encode = encode -exports.decode = decode -exports.isEncoded = isEncoded -exports.names = Object.freeze(Object.keys(constants.names)) -exports.codes = Object.freeze(Object.keys(constants.codes)) - -const errNotSupported = new Error('Unsupported encoding') - -/** - * Create a new buffer with the multibase varint+code. - * - * @param {string|number} nameOrCode - The multibase name or code number. - * @param {Buffer} buf - The data to be prefixed with multibase. - * @memberof Multibase - * @returns {Buffer} - */ -function multibase (nameOrCode, buf) { - if (!buf) { - throw new Error('requires an encoded buffer') - } - const base = getBase(nameOrCode) - const codeBuf = Buffer.from(base.code) - - const name = base.name - validEncode(name, buf) - return Buffer.concat([codeBuf, buf]) -} - -/** - * Encode data with the specified base and add the multibase prefix. - * - * @param {string|number} nameOrCode - The multibase name or code number. - * @param {Buffer} buf - The data to be encoded. - * @returns {Buffer} - * @memberof Multibase - */ -function encode (nameOrCode, buf) { - const base = getBase(nameOrCode) - const name = base.name - - return multibase(name, Buffer.from(base.encode(buf))) -} - -/** - * Takes a buffer or string encoded with multibase header, decodes it and - * returns the decoded buffer - * - * @param {Buffer|string} bufOrString - * @returns {Buffer} - * @memberof Multibase - * - */ -function decode (bufOrString) { - if (Buffer.isBuffer(bufOrString)) { - bufOrString = bufOrString.toString() - } - - const code = bufOrString.substring(0, 1) - bufOrString = bufOrString.substring(1, bufOrString.length) - - if (typeof bufOrString === 'string') { - bufOrString = Buffer.from(bufOrString) - } - - const base = getBase(code) - return Buffer.from(base.decode(bufOrString.toString())) -} - -/** - * Is the given data multibase encoded? - * - * @param {Buffer|string} bufOrString - * @returns {boolean} - * @memberof Multibase - */ -function isEncoded (bufOrString) { - if (Buffer.isBuffer(bufOrString)) { - bufOrString = bufOrString.toString() - } - - // Ensure bufOrString is a string - if (Object.prototype.toString.call(bufOrString) !== '[object String]') { - return false - } - - const code = bufOrString.substring(0, 1) - try { - const base = getBase(code) - return base.name - } catch (err) { - return false - } -} - -/** - * @param {string} name - * @param {Buffer} buf - * @private - * @returns {undefined} - */ -function validEncode (name, buf) { - const base = getBase(name) - base.decode(buf.toString()) -} - -function getBase (nameOrCode) { - let base - - if (constants.names[nameOrCode]) { - base = constants.names[nameOrCode] - } else if (constants.codes[nameOrCode]) { - base = constants.codes[nameOrCode] - } else { - throw errNotSupported - } - - if (!base.isImplemented()) { - throw new Error('Base ' + nameOrCode + ' is not implemented yet') - } - - return base -} - - -/***/ }), - -/***/ "./node_modules/multicodec/src/base-table.json": -/*!*****************************************************!*\ - !*** ./node_modules/multicodec/src/base-table.json ***! - \*****************************************************/ -/*! exports provided: identity, ip4, tcp, sha1, sha2-256, sha2-512, sha3-512, sha3-384, sha3-256, sha3-224, shake-128, shake-256, keccak-224, keccak-256, keccak-384, keccak-512, dccp, murmur3-128, murmur3-32, ip6, ip6zone, path, multicodec, multihash, multiaddr, multibase, dns, dns4, dns6, dnsaddr, protobuf, cbor, raw, dbl-sha2-256, rlp, bencode, dag-pb, dag-cbor, libp2p-key, git-raw, torrent-info, torrent-file, leofcoin-block, leofcoin-tx, leofcoin-pr, sctp, eth-block, eth-block-list, eth-tx-trie, eth-tx, eth-tx-receipt-trie, eth-tx-receipt, eth-state-trie, eth-account-snapshot, eth-storage-trie, bitcoin-block, bitcoin-tx, zcash-block, zcash-tx, stellar-block, stellar-tx, md4, md5, bmt, decred-block, decred-tx, ipld-ns, ipfs-ns, swarm-ns, ipns-ns, zeronet, ed25519-pub, dash-block, dash-tx, swarm-manifest, swarm-feed, udp, p2p-webrtc-star, p2p-webrtc-direct, p2p-stardust, p2p-circuit, dag-json, udt, utp, unix, p2p, ipfs, https, onion, onion3, garlic64, garlic32, tls, quic, ws, wss, p2p-websocket-star, http, json, messagepack, x11, blake2b-8, blake2b-16, blake2b-24, blake2b-32, blake2b-40, blake2b-48, blake2b-56, blake2b-64, blake2b-72, blake2b-80, blake2b-88, blake2b-96, blake2b-104, blake2b-112, blake2b-120, blake2b-128, blake2b-136, blake2b-144, blake2b-152, blake2b-160, blake2b-168, blake2b-176, blake2b-184, blake2b-192, blake2b-200, blake2b-208, blake2b-216, blake2b-224, blake2b-232, blake2b-240, blake2b-248, blake2b-256, blake2b-264, blake2b-272, blake2b-280, blake2b-288, blake2b-296, blake2b-304, blake2b-312, blake2b-320, blake2b-328, blake2b-336, blake2b-344, blake2b-352, blake2b-360, blake2b-368, blake2b-376, blake2b-384, blake2b-392, blake2b-400, blake2b-408, blake2b-416, blake2b-424, blake2b-432, blake2b-440, blake2b-448, blake2b-456, blake2b-464, blake2b-472, blake2b-480, blake2b-488, blake2b-496, blake2b-504, blake2b-512, blake2s-8, blake2s-16, blake2s-24, blake2s-32, blake2s-40, blake2s-48, blake2s-56, blake2s-64, blake2s-72, blake2s-80, blake2s-88, blake2s-96, blake2s-104, blake2s-112, blake2s-120, blake2s-128, blake2s-136, blake2s-144, blake2s-152, blake2s-160, blake2s-168, blake2s-176, blake2s-184, blake2s-192, blake2s-200, blake2s-208, blake2s-216, blake2s-224, blake2s-232, blake2s-240, blake2s-248, blake2s-256, skein256-8, skein256-16, skein256-24, skein256-32, skein256-40, skein256-48, skein256-56, skein256-64, skein256-72, skein256-80, skein256-88, skein256-96, skein256-104, skein256-112, skein256-120, skein256-128, skein256-136, skein256-144, skein256-152, skein256-160, skein256-168, skein256-176, skein256-184, skein256-192, skein256-200, skein256-208, skein256-216, skein256-224, skein256-232, skein256-240, skein256-248, skein256-256, skein512-8, skein512-16, skein512-24, skein512-32, skein512-40, skein512-48, skein512-56, skein512-64, skein512-72, skein512-80, skein512-88, skein512-96, skein512-104, skein512-112, skein512-120, skein512-128, skein512-136, skein512-144, skein512-152, skein512-160, skein512-168, skein512-176, skein512-184, skein512-192, skein512-200, skein512-208, skein512-216, skein512-224, skein512-232, skein512-240, skein512-248, skein512-256, skein512-264, skein512-272, skein512-280, skein512-288, skein512-296, skein512-304, skein512-312, skein512-320, skein512-328, skein512-336, skein512-344, skein512-352, skein512-360, skein512-368, skein512-376, skein512-384, skein512-392, skein512-400, skein512-408, skein512-416, skein512-424, skein512-432, skein512-440, skein512-448, skein512-456, skein512-464, skein512-472, skein512-480, skein512-488, skein512-496, skein512-504, skein512-512, skein1024-8, skein1024-16, skein1024-24, skein1024-32, skein1024-40, skein1024-48, skein1024-56, skein1024-64, skein1024-72, skein1024-80, skein1024-88, skein1024-96, skein1024-104, skein1024-112, skein1024-120, skein1024-128, skein1024-136, skein1024-144, skein1024-152, skein1024-160, skein1024-168, skein1024-176, skein1024-184, skein1024-192, skein1024-200, skein1024-208, skein1024-216, skein1024-224, skein1024-232, skein1024-240, skein1024-248, skein1024-256, skein1024-264, skein1024-272, skein1024-280, skein1024-288, skein1024-296, skein1024-304, skein1024-312, skein1024-320, skein1024-328, skein1024-336, skein1024-344, skein1024-352, skein1024-360, skein1024-368, skein1024-376, skein1024-384, skein1024-392, skein1024-400, skein1024-408, skein1024-416, skein1024-424, skein1024-432, skein1024-440, skein1024-448, skein1024-456, skein1024-464, skein1024-472, skein1024-480, skein1024-488, skein1024-496, skein1024-504, skein1024-512, skein1024-520, skein1024-528, skein1024-536, skein1024-544, skein1024-552, skein1024-560, skein1024-568, skein1024-576, skein1024-584, skein1024-592, skein1024-600, skein1024-608, skein1024-616, skein1024-624, skein1024-632, skein1024-640, skein1024-648, skein1024-656, skein1024-664, skein1024-672, skein1024-680, skein1024-688, skein1024-696, skein1024-704, skein1024-712, skein1024-720, skein1024-728, skein1024-736, skein1024-744, skein1024-752, skein1024-760, skein1024-768, skein1024-776, skein1024-784, skein1024-792, skein1024-800, skein1024-808, skein1024-816, skein1024-824, skein1024-832, skein1024-840, skein1024-848, skein1024-856, skein1024-864, skein1024-872, skein1024-880, skein1024-888, skein1024-896, skein1024-904, skein1024-912, skein1024-920, skein1024-928, skein1024-936, skein1024-944, skein1024-952, skein1024-960, skein1024-968, skein1024-976, skein1024-984, skein1024-992, skein1024-1000, skein1024-1008, skein1024-1016, skein1024-1024, holochain-adr-v0, holochain-adr-v1, holochain-key-v0, holochain-key-v1, holochain-sig-v0, holochain-sig-v1, default */ -/***/ (function(module) { - -module.exports = JSON.parse("{\"identity\":0,\"ip4\":4,\"tcp\":6,\"sha1\":17,\"sha2-256\":18,\"sha2-512\":19,\"sha3-512\":20,\"sha3-384\":21,\"sha3-256\":22,\"sha3-224\":23,\"shake-128\":24,\"shake-256\":25,\"keccak-224\":26,\"keccak-256\":27,\"keccak-384\":28,\"keccak-512\":29,\"dccp\":33,\"murmur3-128\":34,\"murmur3-32\":35,\"ip6\":41,\"ip6zone\":42,\"path\":47,\"multicodec\":48,\"multihash\":49,\"multiaddr\":50,\"multibase\":51,\"dns\":53,\"dns4\":54,\"dns6\":55,\"dnsaddr\":56,\"protobuf\":80,\"cbor\":81,\"raw\":85,\"dbl-sha2-256\":86,\"rlp\":96,\"bencode\":99,\"dag-pb\":112,\"dag-cbor\":113,\"libp2p-key\":114,\"git-raw\":120,\"torrent-info\":123,\"torrent-file\":124,\"leofcoin-block\":129,\"leofcoin-tx\":130,\"leofcoin-pr\":131,\"sctp\":132,\"eth-block\":144,\"eth-block-list\":145,\"eth-tx-trie\":146,\"eth-tx\":147,\"eth-tx-receipt-trie\":148,\"eth-tx-receipt\":149,\"eth-state-trie\":150,\"eth-account-snapshot\":151,\"eth-storage-trie\":152,\"bitcoin-block\":176,\"bitcoin-tx\":177,\"zcash-block\":192,\"zcash-tx\":193,\"stellar-block\":208,\"stellar-tx\":209,\"md4\":212,\"md5\":213,\"bmt\":214,\"decred-block\":224,\"decred-tx\":225,\"ipld-ns\":226,\"ipfs-ns\":227,\"swarm-ns\":228,\"ipns-ns\":229,\"zeronet\":230,\"ed25519-pub\":237,\"dash-block\":240,\"dash-tx\":241,\"swarm-manifest\":250,\"swarm-feed\":251,\"udp\":273,\"p2p-webrtc-star\":275,\"p2p-webrtc-direct\":276,\"p2p-stardust\":277,\"p2p-circuit\":290,\"dag-json\":297,\"udt\":301,\"utp\":302,\"unix\":400,\"p2p\":421,\"ipfs\":421,\"https\":443,\"onion\":444,\"onion3\":445,\"garlic64\":446,\"garlic32\":447,\"tls\":448,\"quic\":460,\"ws\":477,\"wss\":478,\"p2p-websocket-star\":479,\"http\":480,\"json\":512,\"messagepack\":513,\"x11\":4352,\"blake2b-8\":45569,\"blake2b-16\":45570,\"blake2b-24\":45571,\"blake2b-32\":45572,\"blake2b-40\":45573,\"blake2b-48\":45574,\"blake2b-56\":45575,\"blake2b-64\":45576,\"blake2b-72\":45577,\"blake2b-80\":45578,\"blake2b-88\":45579,\"blake2b-96\":45580,\"blake2b-104\":45581,\"blake2b-112\":45582,\"blake2b-120\":45583,\"blake2b-128\":45584,\"blake2b-136\":45585,\"blake2b-144\":45586,\"blake2b-152\":45587,\"blake2b-160\":45588,\"blake2b-168\":45589,\"blake2b-176\":45590,\"blake2b-184\":45591,\"blake2b-192\":45592,\"blake2b-200\":45593,\"blake2b-208\":45594,\"blake2b-216\":45595,\"blake2b-224\":45596,\"blake2b-232\":45597,\"blake2b-240\":45598,\"blake2b-248\":45599,\"blake2b-256\":45600,\"blake2b-264\":45601,\"blake2b-272\":45602,\"blake2b-280\":45603,\"blake2b-288\":45604,\"blake2b-296\":45605,\"blake2b-304\":45606,\"blake2b-312\":45607,\"blake2b-320\":45608,\"blake2b-328\":45609,\"blake2b-336\":45610,\"blake2b-344\":45611,\"blake2b-352\":45612,\"blake2b-360\":45613,\"blake2b-368\":45614,\"blake2b-376\":45615,\"blake2b-384\":45616,\"blake2b-392\":45617,\"blake2b-400\":45618,\"blake2b-408\":45619,\"blake2b-416\":45620,\"blake2b-424\":45621,\"blake2b-432\":45622,\"blake2b-440\":45623,\"blake2b-448\":45624,\"blake2b-456\":45625,\"blake2b-464\":45626,\"blake2b-472\":45627,\"blake2b-480\":45628,\"blake2b-488\":45629,\"blake2b-496\":45630,\"blake2b-504\":45631,\"blake2b-512\":45632,\"blake2s-8\":45633,\"blake2s-16\":45634,\"blake2s-24\":45635,\"blake2s-32\":45636,\"blake2s-40\":45637,\"blake2s-48\":45638,\"blake2s-56\":45639,\"blake2s-64\":45640,\"blake2s-72\":45641,\"blake2s-80\":45642,\"blake2s-88\":45643,\"blake2s-96\":45644,\"blake2s-104\":45645,\"blake2s-112\":45646,\"blake2s-120\":45647,\"blake2s-128\":45648,\"blake2s-136\":45649,\"blake2s-144\":45650,\"blake2s-152\":45651,\"blake2s-160\":45652,\"blake2s-168\":45653,\"blake2s-176\":45654,\"blake2s-184\":45655,\"blake2s-192\":45656,\"blake2s-200\":45657,\"blake2s-208\":45658,\"blake2s-216\":45659,\"blake2s-224\":45660,\"blake2s-232\":45661,\"blake2s-240\":45662,\"blake2s-248\":45663,\"blake2s-256\":45664,\"skein256-8\":45825,\"skein256-16\":45826,\"skein256-24\":45827,\"skein256-32\":45828,\"skein256-40\":45829,\"skein256-48\":45830,\"skein256-56\":45831,\"skein256-64\":45832,\"skein256-72\":45833,\"skein256-80\":45834,\"skein256-88\":45835,\"skein256-96\":45836,\"skein256-104\":45837,\"skein256-112\":45838,\"skein256-120\":45839,\"skein256-128\":45840,\"skein256-136\":45841,\"skein256-144\":45842,\"skein256-152\":45843,\"skein256-160\":45844,\"skein256-168\":45845,\"skein256-176\":45846,\"skein256-184\":45847,\"skein256-192\":45848,\"skein256-200\":45849,\"skein256-208\":45850,\"skein256-216\":45851,\"skein256-224\":45852,\"skein256-232\":45853,\"skein256-240\":45854,\"skein256-248\":45855,\"skein256-256\":45856,\"skein512-8\":45857,\"skein512-16\":45858,\"skein512-24\":45859,\"skein512-32\":45860,\"skein512-40\":45861,\"skein512-48\":45862,\"skein512-56\":45863,\"skein512-64\":45864,\"skein512-72\":45865,\"skein512-80\":45866,\"skein512-88\":45867,\"skein512-96\":45868,\"skein512-104\":45869,\"skein512-112\":45870,\"skein512-120\":45871,\"skein512-128\":45872,\"skein512-136\":45873,\"skein512-144\":45874,\"skein512-152\":45875,\"skein512-160\":45876,\"skein512-168\":45877,\"skein512-176\":45878,\"skein512-184\":45879,\"skein512-192\":45880,\"skein512-200\":45881,\"skein512-208\":45882,\"skein512-216\":45883,\"skein512-224\":45884,\"skein512-232\":45885,\"skein512-240\":45886,\"skein512-248\":45887,\"skein512-256\":45888,\"skein512-264\":45889,\"skein512-272\":45890,\"skein512-280\":45891,\"skein512-288\":45892,\"skein512-296\":45893,\"skein512-304\":45894,\"skein512-312\":45895,\"skein512-320\":45896,\"skein512-328\":45897,\"skein512-336\":45898,\"skein512-344\":45899,\"skein512-352\":45900,\"skein512-360\":45901,\"skein512-368\":45902,\"skein512-376\":45903,\"skein512-384\":45904,\"skein512-392\":45905,\"skein512-400\":45906,\"skein512-408\":45907,\"skein512-416\":45908,\"skein512-424\":45909,\"skein512-432\":45910,\"skein512-440\":45911,\"skein512-448\":45912,\"skein512-456\":45913,\"skein512-464\":45914,\"skein512-472\":45915,\"skein512-480\":45916,\"skein512-488\":45917,\"skein512-496\":45918,\"skein512-504\":45919,\"skein512-512\":45920,\"skein1024-8\":45921,\"skein1024-16\":45922,\"skein1024-24\":45923,\"skein1024-32\":45924,\"skein1024-40\":45925,\"skein1024-48\":45926,\"skein1024-56\":45927,\"skein1024-64\":45928,\"skein1024-72\":45929,\"skein1024-80\":45930,\"skein1024-88\":45931,\"skein1024-96\":45932,\"skein1024-104\":45933,\"skein1024-112\":45934,\"skein1024-120\":45935,\"skein1024-128\":45936,\"skein1024-136\":45937,\"skein1024-144\":45938,\"skein1024-152\":45939,\"skein1024-160\":45940,\"skein1024-168\":45941,\"skein1024-176\":45942,\"skein1024-184\":45943,\"skein1024-192\":45944,\"skein1024-200\":45945,\"skein1024-208\":45946,\"skein1024-216\":45947,\"skein1024-224\":45948,\"skein1024-232\":45949,\"skein1024-240\":45950,\"skein1024-248\":45951,\"skein1024-256\":45952,\"skein1024-264\":45953,\"skein1024-272\":45954,\"skein1024-280\":45955,\"skein1024-288\":45956,\"skein1024-296\":45957,\"skein1024-304\":45958,\"skein1024-312\":45959,\"skein1024-320\":45960,\"skein1024-328\":45961,\"skein1024-336\":45962,\"skein1024-344\":45963,\"skein1024-352\":45964,\"skein1024-360\":45965,\"skein1024-368\":45966,\"skein1024-376\":45967,\"skein1024-384\":45968,\"skein1024-392\":45969,\"skein1024-400\":45970,\"skein1024-408\":45971,\"skein1024-416\":45972,\"skein1024-424\":45973,\"skein1024-432\":45974,\"skein1024-440\":45975,\"skein1024-448\":45976,\"skein1024-456\":45977,\"skein1024-464\":45978,\"skein1024-472\":45979,\"skein1024-480\":45980,\"skein1024-488\":45981,\"skein1024-496\":45982,\"skein1024-504\":45983,\"skein1024-512\":45984,\"skein1024-520\":45985,\"skein1024-528\":45986,\"skein1024-536\":45987,\"skein1024-544\":45988,\"skein1024-552\":45989,\"skein1024-560\":45990,\"skein1024-568\":45991,\"skein1024-576\":45992,\"skein1024-584\":45993,\"skein1024-592\":45994,\"skein1024-600\":45995,\"skein1024-608\":45996,\"skein1024-616\":45997,\"skein1024-624\":45998,\"skein1024-632\":45999,\"skein1024-640\":46000,\"skein1024-648\":46001,\"skein1024-656\":46002,\"skein1024-664\":46003,\"skein1024-672\":46004,\"skein1024-680\":46005,\"skein1024-688\":46006,\"skein1024-696\":46007,\"skein1024-704\":46008,\"skein1024-712\":46009,\"skein1024-720\":46010,\"skein1024-728\":46011,\"skein1024-736\":46012,\"skein1024-744\":46013,\"skein1024-752\":46014,\"skein1024-760\":46015,\"skein1024-768\":46016,\"skein1024-776\":46017,\"skein1024-784\":46018,\"skein1024-792\":46019,\"skein1024-800\":46020,\"skein1024-808\":46021,\"skein1024-816\":46022,\"skein1024-824\":46023,\"skein1024-832\":46024,\"skein1024-840\":46025,\"skein1024-848\":46026,\"skein1024-856\":46027,\"skein1024-864\":46028,\"skein1024-872\":46029,\"skein1024-880\":46030,\"skein1024-888\":46031,\"skein1024-896\":46032,\"skein1024-904\":46033,\"skein1024-912\":46034,\"skein1024-920\":46035,\"skein1024-928\":46036,\"skein1024-936\":46037,\"skein1024-944\":46038,\"skein1024-952\":46039,\"skein1024-960\":46040,\"skein1024-968\":46041,\"skein1024-976\":46042,\"skein1024-984\":46043,\"skein1024-992\":46044,\"skein1024-1000\":46045,\"skein1024-1008\":46046,\"skein1024-1016\":46047,\"skein1024-1024\":46048,\"holochain-adr-v0\":8417572,\"holochain-adr-v1\":8483108,\"holochain-key-v0\":9728292,\"holochain-key-v1\":9793828,\"holochain-sig-v0\":10645796,\"holochain-sig-v1\":10711332}"); - -/***/ }), - -/***/ "./node_modules/multicodec/src/constants.js": -/*!**************************************************!*\ - !*** ./node_modules/multicodec/src/constants.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_904537__) { - -"use strict"; - - -const table = __nested_webpack_require_904537__(/*! ./base-table.json */ "./node_modules/multicodec/src/base-table.json") - -// map for codecConstant -> code -const constants = {} - -for (const [name, code] of Object.entries(table)) { - constants[name.toUpperCase().replace(/-/g, '_')] = code -} - -module.exports = Object.freeze(constants) - - -/***/ }), - -/***/ "./node_modules/multicodec/src/index.js": -/*!**********************************************!*\ - !*** ./node_modules/multicodec/src/index.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_905176__) { - -"use strict"; -/** - * Implementation of the multicodec specification. - * - * @module multicodec - * @example - * const multicodec = require('multicodec') - * - * const prefixedProtobuf = multicodec.addPrefix('protobuf', protobufBuffer) - * // prefixedProtobuf 0x50... - * - */ - - -const varint = __nested_webpack_require_905176__(/*! varint */ "./node_modules/varint/index.js") -const intTable = __nested_webpack_require_905176__(/*! ./int-table */ "./node_modules/multicodec/src/int-table.js") -const codecNameToCodeVarint = __nested_webpack_require_905176__(/*! ./varint-table */ "./node_modules/multicodec/src/varint-table.js") -const util = __nested_webpack_require_905176__(/*! ./util */ "./node_modules/multicodec/src/util.js") - -exports = module.exports - -/** - * Prefix a buffer with a multicodec-packed. - * - * @param {string|number} multicodecStrOrCode - * @param {Buffer} data - * @returns {Buffer} - */ -exports.addPrefix = (multicodecStrOrCode, data) => { - let prefix - - if (Buffer.isBuffer(multicodecStrOrCode)) { - prefix = util.varintBufferEncode(multicodecStrOrCode) - } else { - if (codecNameToCodeVarint[multicodecStrOrCode]) { - prefix = codecNameToCodeVarint[multicodecStrOrCode] - } else { - throw new Error('multicodec not recognized') - } - } - return Buffer.concat([prefix, data]) -} - -/** - * Decapsulate the multicodec-packed prefix from the data. - * - * @param {Buffer} data - * @returns {Buffer} - */ -exports.rmPrefix = (data) => { - varint.decode(data) - return data.slice(varint.decode.bytes) -} - -/** - * Get the codec of the prefixed data. - * @param {Buffer} prefixedData - * @returns {string} - */ -exports.getCodec = (prefixedData) => { - const code = varint.decode(prefixedData) - const codecName = intTable.get(code) - if (codecName === undefined) { - throw new Error(`Code ${code} not found`) - } - return codecName -} - -/** - * Get the name of the codec. - * @param {number} codec - * @returns {string} - */ -exports.getName = (codec) => { - return intTable.get(codec) -} - -/** - * Get the code of the codec - * @param {string} name - * @returns {number} - */ -exports.getNumber = (name) => { - const code = codecNameToCodeVarint[name] - if (code === undefined) { - throw new Error('Codec `' + name + '` not found') - } - return util.varintBufferDecode(code)[0] -} - -/** - * Get the code of the prefixed data. - * @param {Buffer} prefixedData - * @returns {number} - */ -exports.getCode = (prefixedData) => { - return varint.decode(prefixedData) -} - -/** - * Get the code as varint of a codec name. - * @param {string} codecName - * @returns {Buffer} - */ -exports.getCodeVarint = (codecName) => { - const code = codecNameToCodeVarint[codecName] - if (code === undefined) { - throw new Error('Codec `' + codecName + '` not found') - } - return code -} - -/** - * Get the varint of a code. - * @param {Number} code - * @returns {Array.} - */ -exports.getVarint = (code) => { - return varint.encode(code) -} - -// Make the constants top-level constants -const constants = __nested_webpack_require_905176__(/*! ./constants */ "./node_modules/multicodec/src/constants.js") -Object.assign(exports, constants) - -// Human friendly names for printing, e.g. in error messages -exports.print = __nested_webpack_require_905176__(/*! ./print */ "./node_modules/multicodec/src/print.js") - - -/***/ }), - -/***/ "./node_modules/multicodec/src/int-table.js": -/*!**************************************************!*\ - !*** ./node_modules/multicodec/src/int-table.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_908680__) { - -"use strict"; - -const baseTable = __nested_webpack_require_908680__(/*! ./base-table.json */ "./node_modules/multicodec/src/base-table.json") - -// map for hexString -> codecName -const nameTable = new Map() - -for (const encodingName in baseTable) { - const code = baseTable[encodingName] - nameTable.set(code, encodingName) -} - -module.exports = Object.freeze(nameTable) - - -/***/ }), - -/***/ "./node_modules/multicodec/src/print.js": -/*!**********************************************!*\ - !*** ./node_modules/multicodec/src/print.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_909335__) { - -"use strict"; - - -const table = __nested_webpack_require_909335__(/*! ./base-table.json */ "./node_modules/multicodec/src/base-table.json") - -// map for code -> print friendly name -const tableByCode = {} - -for (const [name, code] of Object.entries(table)) { - if (tableByCode[code] === undefined) tableByCode[code] = name -} - -module.exports = Object.freeze(tableByCode) - - -/***/ }), - -/***/ "./node_modules/multicodec/src/util.js": -/*!*********************************************!*\ - !*** ./node_modules/multicodec/src/util.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_909986__) { - -"use strict"; - -const varint = __nested_webpack_require_909986__(/*! varint */ "./node_modules/varint/index.js") - -module.exports = { - numberToBuffer, - bufferToNumber, - varintBufferEncode, - varintBufferDecode, - varintEncode -} - -function bufferToNumber (buf) { - return parseInt(buf.toString('hex'), 16) -} - -function numberToBuffer (num) { - let hexString = num.toString(16) - if (hexString.length % 2 === 1) { - hexString = '0' + hexString - } - return Buffer.from(hexString, 'hex') -} - -function varintBufferEncode (input) { - return Buffer.from(varint.encode(bufferToNumber(input))) -} - -function varintBufferDecode (input) { - return numberToBuffer(varint.decode(input)) -} - -function varintEncode (num) { - return Buffer.from(varint.encode(num)) -} - - -/***/ }), - -/***/ "./node_modules/multicodec/src/varint-table.js": -/*!*****************************************************!*\ - !*** ./node_modules/multicodec/src/varint-table.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_911053__) { - -"use strict"; - - -const baseTable = __nested_webpack_require_911053__(/*! ./base-table.json */ "./node_modules/multicodec/src/base-table.json") -const varintEncode = __nested_webpack_require_911053__(/*! ./util */ "./node_modules/multicodec/src/util.js").varintEncode - -// map for codecName -> codeVarintBuffer -const varintTable = {} - -for (const encodingName in baseTable) { - const code = baseTable[encodingName] - varintTable[encodingName] = varintEncode(code) -} - -module.exports = Object.freeze(varintTable) - - -/***/ }), - -/***/ "./node_modules/multihashes/src/constants.js": -/*!***************************************************!*\ - !*** ./node_modules/multihashes/src/constants.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; -/* eslint quote-props: off */ -/* eslint key-spacing: off */ - - -exports.names = Object.freeze({ - 'identity': 0x0, - 'sha1': 0x11, - 'sha2-256': 0x12, - 'sha2-512': 0x13, - 'dbl-sha2-256': 0x56, - 'sha3-224': 0x17, - 'sha3-256': 0x16, - 'sha3-384': 0x15, - 'sha3-512': 0x14, - 'shake-128': 0x18, - 'shake-256': 0x19, - 'keccak-224': 0x1A, - 'keccak-256': 0x1B, - 'keccak-384': 0x1C, - 'keccak-512': 0x1D, - 'murmur3-128': 0x22, - 'murmur3-32': 0x23, - 'blake2b-8': 0xb201, - 'blake2b-16': 0xb202, - 'blake2b-24': 0xb203, - 'blake2b-32': 0xb204, - 'blake2b-40': 0xb205, - 'blake2b-48': 0xb206, - 'blake2b-56': 0xb207, - 'blake2b-64': 0xb208, - 'blake2b-72': 0xb209, - 'blake2b-80': 0xb20a, - 'blake2b-88': 0xb20b, - 'blake2b-96': 0xb20c, - 'blake2b-104': 0xb20d, - 'blake2b-112': 0xb20e, - 'blake2b-120': 0xb20f, - 'blake2b-128': 0xb210, - 'blake2b-136': 0xb211, - 'blake2b-144': 0xb212, - 'blake2b-152': 0xb213, - 'blake2b-160': 0xb214, - 'blake2b-168': 0xb215, - 'blake2b-176': 0xb216, - 'blake2b-184': 0xb217, - 'blake2b-192': 0xb218, - 'blake2b-200': 0xb219, - 'blake2b-208': 0xb21a, - 'blake2b-216': 0xb21b, - 'blake2b-224': 0xb21c, - 'blake2b-232': 0xb21d, - 'blake2b-240': 0xb21e, - 'blake2b-248': 0xb21f, - 'blake2b-256': 0xb220, - 'blake2b-264': 0xb221, - 'blake2b-272': 0xb222, - 'blake2b-280': 0xb223, - 'blake2b-288': 0xb224, - 'blake2b-296': 0xb225, - 'blake2b-304': 0xb226, - 'blake2b-312': 0xb227, - 'blake2b-320': 0xb228, - 'blake2b-328': 0xb229, - 'blake2b-336': 0xb22a, - 'blake2b-344': 0xb22b, - 'blake2b-352': 0xb22c, - 'blake2b-360': 0xb22d, - 'blake2b-368': 0xb22e, - 'blake2b-376': 0xb22f, - 'blake2b-384': 0xb230, - 'blake2b-392': 0xb231, - 'blake2b-400': 0xb232, - 'blake2b-408': 0xb233, - 'blake2b-416': 0xb234, - 'blake2b-424': 0xb235, - 'blake2b-432': 0xb236, - 'blake2b-440': 0xb237, - 'blake2b-448': 0xb238, - 'blake2b-456': 0xb239, - 'blake2b-464': 0xb23a, - 'blake2b-472': 0xb23b, - 'blake2b-480': 0xb23c, - 'blake2b-488': 0xb23d, - 'blake2b-496': 0xb23e, - 'blake2b-504': 0xb23f, - 'blake2b-512': 0xb240, - 'blake2s-8': 0xb241, - 'blake2s-16': 0xb242, - 'blake2s-24': 0xb243, - 'blake2s-32': 0xb244, - 'blake2s-40': 0xb245, - 'blake2s-48': 0xb246, - 'blake2s-56': 0xb247, - 'blake2s-64': 0xb248, - 'blake2s-72': 0xb249, - 'blake2s-80': 0xb24a, - 'blake2s-88': 0xb24b, - 'blake2s-96': 0xb24c, - 'blake2s-104': 0xb24d, - 'blake2s-112': 0xb24e, - 'blake2s-120': 0xb24f, - 'blake2s-128': 0xb250, - 'blake2s-136': 0xb251, - 'blake2s-144': 0xb252, - 'blake2s-152': 0xb253, - 'blake2s-160': 0xb254, - 'blake2s-168': 0xb255, - 'blake2s-176': 0xb256, - 'blake2s-184': 0xb257, - 'blake2s-192': 0xb258, - 'blake2s-200': 0xb259, - 'blake2s-208': 0xb25a, - 'blake2s-216': 0xb25b, - 'blake2s-224': 0xb25c, - 'blake2s-232': 0xb25d, - 'blake2s-240': 0xb25e, - 'blake2s-248': 0xb25f, - 'blake2s-256': 0xb260, - 'Skein256-8': 0xb301, - 'Skein256-16': 0xb302, - 'Skein256-24': 0xb303, - 'Skein256-32': 0xb304, - 'Skein256-40': 0xb305, - 'Skein256-48': 0xb306, - 'Skein256-56': 0xb307, - 'Skein256-64': 0xb308, - 'Skein256-72': 0xb309, - 'Skein256-80': 0xb30a, - 'Skein256-88': 0xb30b, - 'Skein256-96': 0xb30c, - 'Skein256-104': 0xb30d, - 'Skein256-112': 0xb30e, - 'Skein256-120': 0xb30f, - 'Skein256-128': 0xb310, - 'Skein256-136': 0xb311, - 'Skein256-144': 0xb312, - 'Skein256-152': 0xb313, - 'Skein256-160': 0xb314, - 'Skein256-168': 0xb315, - 'Skein256-176': 0xb316, - 'Skein256-184': 0xb317, - 'Skein256-192': 0xb318, - 'Skein256-200': 0xb319, - 'Skein256-208': 0xb31a, - 'Skein256-216': 0xb31b, - 'Skein256-224': 0xb31c, - 'Skein256-232': 0xb31d, - 'Skein256-240': 0xb31e, - 'Skein256-248': 0xb31f, - 'Skein256-256': 0xb320, - 'Skein512-8': 0xb321, - 'Skein512-16': 0xb322, - 'Skein512-24': 0xb323, - 'Skein512-32': 0xb324, - 'Skein512-40': 0xb325, - 'Skein512-48': 0xb326, - 'Skein512-56': 0xb327, - 'Skein512-64': 0xb328, - 'Skein512-72': 0xb329, - 'Skein512-80': 0xb32a, - 'Skein512-88': 0xb32b, - 'Skein512-96': 0xb32c, - 'Skein512-104': 0xb32d, - 'Skein512-112': 0xb32e, - 'Skein512-120': 0xb32f, - 'Skein512-128': 0xb330, - 'Skein512-136': 0xb331, - 'Skein512-144': 0xb332, - 'Skein512-152': 0xb333, - 'Skein512-160': 0xb334, - 'Skein512-168': 0xb335, - 'Skein512-176': 0xb336, - 'Skein512-184': 0xb337, - 'Skein512-192': 0xb338, - 'Skein512-200': 0xb339, - 'Skein512-208': 0xb33a, - 'Skein512-216': 0xb33b, - 'Skein512-224': 0xb33c, - 'Skein512-232': 0xb33d, - 'Skein512-240': 0xb33e, - 'Skein512-248': 0xb33f, - 'Skein512-256': 0xb340, - 'Skein512-264': 0xb341, - 'Skein512-272': 0xb342, - 'Skein512-280': 0xb343, - 'Skein512-288': 0xb344, - 'Skein512-296': 0xb345, - 'Skein512-304': 0xb346, - 'Skein512-312': 0xb347, - 'Skein512-320': 0xb348, - 'Skein512-328': 0xb349, - 'Skein512-336': 0xb34a, - 'Skein512-344': 0xb34b, - 'Skein512-352': 0xb34c, - 'Skein512-360': 0xb34d, - 'Skein512-368': 0xb34e, - 'Skein512-376': 0xb34f, - 'Skein512-384': 0xb350, - 'Skein512-392': 0xb351, - 'Skein512-400': 0xb352, - 'Skein512-408': 0xb353, - 'Skein512-416': 0xb354, - 'Skein512-424': 0xb355, - 'Skein512-432': 0xb356, - 'Skein512-440': 0xb357, - 'Skein512-448': 0xb358, - 'Skein512-456': 0xb359, - 'Skein512-464': 0xb35a, - 'Skein512-472': 0xb35b, - 'Skein512-480': 0xb35c, - 'Skein512-488': 0xb35d, - 'Skein512-496': 0xb35e, - 'Skein512-504': 0xb35f, - 'Skein512-512': 0xb360, - 'Skein1024-8': 0xb361, - 'Skein1024-16': 0xb362, - 'Skein1024-24': 0xb363, - 'Skein1024-32': 0xb364, - 'Skein1024-40': 0xb365, - 'Skein1024-48': 0xb366, - 'Skein1024-56': 0xb367, - 'Skein1024-64': 0xb368, - 'Skein1024-72': 0xb369, - 'Skein1024-80': 0xb36a, - 'Skein1024-88': 0xb36b, - 'Skein1024-96': 0xb36c, - 'Skein1024-104': 0xb36d, - 'Skein1024-112': 0xb36e, - 'Skein1024-120': 0xb36f, - 'Skein1024-128': 0xb370, - 'Skein1024-136': 0xb371, - 'Skein1024-144': 0xb372, - 'Skein1024-152': 0xb373, - 'Skein1024-160': 0xb374, - 'Skein1024-168': 0xb375, - 'Skein1024-176': 0xb376, - 'Skein1024-184': 0xb377, - 'Skein1024-192': 0xb378, - 'Skein1024-200': 0xb379, - 'Skein1024-208': 0xb37a, - 'Skein1024-216': 0xb37b, - 'Skein1024-224': 0xb37c, - 'Skein1024-232': 0xb37d, - 'Skein1024-240': 0xb37e, - 'Skein1024-248': 0xb37f, - 'Skein1024-256': 0xb380, - 'Skein1024-264': 0xb381, - 'Skein1024-272': 0xb382, - 'Skein1024-280': 0xb383, - 'Skein1024-288': 0xb384, - 'Skein1024-296': 0xb385, - 'Skein1024-304': 0xb386, - 'Skein1024-312': 0xb387, - 'Skein1024-320': 0xb388, - 'Skein1024-328': 0xb389, - 'Skein1024-336': 0xb38a, - 'Skein1024-344': 0xb38b, - 'Skein1024-352': 0xb38c, - 'Skein1024-360': 0xb38d, - 'Skein1024-368': 0xb38e, - 'Skein1024-376': 0xb38f, - 'Skein1024-384': 0xb390, - 'Skein1024-392': 0xb391, - 'Skein1024-400': 0xb392, - 'Skein1024-408': 0xb393, - 'Skein1024-416': 0xb394, - 'Skein1024-424': 0xb395, - 'Skein1024-432': 0xb396, - 'Skein1024-440': 0xb397, - 'Skein1024-448': 0xb398, - 'Skein1024-456': 0xb399, - 'Skein1024-464': 0xb39a, - 'Skein1024-472': 0xb39b, - 'Skein1024-480': 0xb39c, - 'Skein1024-488': 0xb39d, - 'Skein1024-496': 0xb39e, - 'Skein1024-504': 0xb39f, - 'Skein1024-512': 0xb3a0, - 'Skein1024-520': 0xb3a1, - 'Skein1024-528': 0xb3a2, - 'Skein1024-536': 0xb3a3, - 'Skein1024-544': 0xb3a4, - 'Skein1024-552': 0xb3a5, - 'Skein1024-560': 0xb3a6, - 'Skein1024-568': 0xb3a7, - 'Skein1024-576': 0xb3a8, - 'Skein1024-584': 0xb3a9, - 'Skein1024-592': 0xb3aa, - 'Skein1024-600': 0xb3ab, - 'Skein1024-608': 0xb3ac, - 'Skein1024-616': 0xb3ad, - 'Skein1024-624': 0xb3ae, - 'Skein1024-632': 0xb3af, - 'Skein1024-640': 0xb3b0, - 'Skein1024-648': 0xb3b1, - 'Skein1024-656': 0xb3b2, - 'Skein1024-664': 0xb3b3, - 'Skein1024-672': 0xb3b4, - 'Skein1024-680': 0xb3b5, - 'Skein1024-688': 0xb3b6, - 'Skein1024-696': 0xb3b7, - 'Skein1024-704': 0xb3b8, - 'Skein1024-712': 0xb3b9, - 'Skein1024-720': 0xb3ba, - 'Skein1024-728': 0xb3bb, - 'Skein1024-736': 0xb3bc, - 'Skein1024-744': 0xb3bd, - 'Skein1024-752': 0xb3be, - 'Skein1024-760': 0xb3bf, - 'Skein1024-768': 0xb3c0, - 'Skein1024-776': 0xb3c1, - 'Skein1024-784': 0xb3c2, - 'Skein1024-792': 0xb3c3, - 'Skein1024-800': 0xb3c4, - 'Skein1024-808': 0xb3c5, - 'Skein1024-816': 0xb3c6, - 'Skein1024-824': 0xb3c7, - 'Skein1024-832': 0xb3c8, - 'Skein1024-840': 0xb3c9, - 'Skein1024-848': 0xb3ca, - 'Skein1024-856': 0xb3cb, - 'Skein1024-864': 0xb3cc, - 'Skein1024-872': 0xb3cd, - 'Skein1024-880': 0xb3ce, - 'Skein1024-888': 0xb3cf, - 'Skein1024-896': 0xb3d0, - 'Skein1024-904': 0xb3d1, - 'Skein1024-912': 0xb3d2, - 'Skein1024-920': 0xb3d3, - 'Skein1024-928': 0xb3d4, - 'Skein1024-936': 0xb3d5, - 'Skein1024-944': 0xb3d6, - 'Skein1024-952': 0xb3d7, - 'Skein1024-960': 0xb3d8, - 'Skein1024-968': 0xb3d9, - 'Skein1024-976': 0xb3da, - 'Skein1024-984': 0xb3db, - 'Skein1024-992': 0xb3dc, - 'Skein1024-1000': 0xb3dd, - 'Skein1024-1008': 0xb3de, - 'Skein1024-1016': 0xb3df, - 'Skein1024-1024': 0xb3e0 -}) - -exports.codes = Object.freeze({ - 0x0: 'identity', - - // sha family - 0x11: 'sha1', - 0x12: 'sha2-256', - 0x13: 'sha2-512', - 0x56: 'dbl-sha2-256', - 0x17: 'sha3-224', - 0x16: 'sha3-256', - 0x15: 'sha3-384', - 0x14: 'sha3-512', - 0x18: 'shake-128', - 0x19: 'shake-256', - 0x1A: 'keccak-224', - 0x1B: 'keccak-256', - 0x1C: 'keccak-384', - 0x1D: 'keccak-512', - - 0x22: 'murmur3-128', - 0x23: 'murmur3-32', - - // blake2 - 0xb201: 'blake2b-8', - 0xb202: 'blake2b-16', - 0xb203: 'blake2b-24', - 0xb204: 'blake2b-32', - 0xb205: 'blake2b-40', - 0xb206: 'blake2b-48', - 0xb207: 'blake2b-56', - 0xb208: 'blake2b-64', - 0xb209: 'blake2b-72', - 0xb20a: 'blake2b-80', - 0xb20b: 'blake2b-88', - 0xb20c: 'blake2b-96', - 0xb20d: 'blake2b-104', - 0xb20e: 'blake2b-112', - 0xb20f: 'blake2b-120', - 0xb210: 'blake2b-128', - 0xb211: 'blake2b-136', - 0xb212: 'blake2b-144', - 0xb213: 'blake2b-152', - 0xb214: 'blake2b-160', - 0xb215: 'blake2b-168', - 0xb216: 'blake2b-176', - 0xb217: 'blake2b-184', - 0xb218: 'blake2b-192', - 0xb219: 'blake2b-200', - 0xb21a: 'blake2b-208', - 0xb21b: 'blake2b-216', - 0xb21c: 'blake2b-224', - 0xb21d: 'blake2b-232', - 0xb21e: 'blake2b-240', - 0xb21f: 'blake2b-248', - 0xb220: 'blake2b-256', - 0xb221: 'blake2b-264', - 0xb222: 'blake2b-272', - 0xb223: 'blake2b-280', - 0xb224: 'blake2b-288', - 0xb225: 'blake2b-296', - 0xb226: 'blake2b-304', - 0xb227: 'blake2b-312', - 0xb228: 'blake2b-320', - 0xb229: 'blake2b-328', - 0xb22a: 'blake2b-336', - 0xb22b: 'blake2b-344', - 0xb22c: 'blake2b-352', - 0xb22d: 'blake2b-360', - 0xb22e: 'blake2b-368', - 0xb22f: 'blake2b-376', - 0xb230: 'blake2b-384', - 0xb231: 'blake2b-392', - 0xb232: 'blake2b-400', - 0xb233: 'blake2b-408', - 0xb234: 'blake2b-416', - 0xb235: 'blake2b-424', - 0xb236: 'blake2b-432', - 0xb237: 'blake2b-440', - 0xb238: 'blake2b-448', - 0xb239: 'blake2b-456', - 0xb23a: 'blake2b-464', - 0xb23b: 'blake2b-472', - 0xb23c: 'blake2b-480', - 0xb23d: 'blake2b-488', - 0xb23e: 'blake2b-496', - 0xb23f: 'blake2b-504', - 0xb240: 'blake2b-512', - 0xb241: 'blake2s-8', - 0xb242: 'blake2s-16', - 0xb243: 'blake2s-24', - 0xb244: 'blake2s-32', - 0xb245: 'blake2s-40', - 0xb246: 'blake2s-48', - 0xb247: 'blake2s-56', - 0xb248: 'blake2s-64', - 0xb249: 'blake2s-72', - 0xb24a: 'blake2s-80', - 0xb24b: 'blake2s-88', - 0xb24c: 'blake2s-96', - 0xb24d: 'blake2s-104', - 0xb24e: 'blake2s-112', - 0xb24f: 'blake2s-120', - 0xb250: 'blake2s-128', - 0xb251: 'blake2s-136', - 0xb252: 'blake2s-144', - 0xb253: 'blake2s-152', - 0xb254: 'blake2s-160', - 0xb255: 'blake2s-168', - 0xb256: 'blake2s-176', - 0xb257: 'blake2s-184', - 0xb258: 'blake2s-192', - 0xb259: 'blake2s-200', - 0xb25a: 'blake2s-208', - 0xb25b: 'blake2s-216', - 0xb25c: 'blake2s-224', - 0xb25d: 'blake2s-232', - 0xb25e: 'blake2s-240', - 0xb25f: 'blake2s-248', - 0xb260: 'blake2s-256', - - // skein - 0xb301: 'Skein256-8', - 0xb302: 'Skein256-16', - 0xb303: 'Skein256-24', - 0xb304: 'Skein256-32', - 0xb305: 'Skein256-40', - 0xb306: 'Skein256-48', - 0xb307: 'Skein256-56', - 0xb308: 'Skein256-64', - 0xb309: 'Skein256-72', - 0xb30a: 'Skein256-80', - 0xb30b: 'Skein256-88', - 0xb30c: 'Skein256-96', - 0xb30d: 'Skein256-104', - 0xb30e: 'Skein256-112', - 0xb30f: 'Skein256-120', - 0xb310: 'Skein256-128', - 0xb311: 'Skein256-136', - 0xb312: 'Skein256-144', - 0xb313: 'Skein256-152', - 0xb314: 'Skein256-160', - 0xb315: 'Skein256-168', - 0xb316: 'Skein256-176', - 0xb317: 'Skein256-184', - 0xb318: 'Skein256-192', - 0xb319: 'Skein256-200', - 0xb31a: 'Skein256-208', - 0xb31b: 'Skein256-216', - 0xb31c: 'Skein256-224', - 0xb31d: 'Skein256-232', - 0xb31e: 'Skein256-240', - 0xb31f: 'Skein256-248', - 0xb320: 'Skein256-256', - 0xb321: 'Skein512-8', - 0xb322: 'Skein512-16', - 0xb323: 'Skein512-24', - 0xb324: 'Skein512-32', - 0xb325: 'Skein512-40', - 0xb326: 'Skein512-48', - 0xb327: 'Skein512-56', - 0xb328: 'Skein512-64', - 0xb329: 'Skein512-72', - 0xb32a: 'Skein512-80', - 0xb32b: 'Skein512-88', - 0xb32c: 'Skein512-96', - 0xb32d: 'Skein512-104', - 0xb32e: 'Skein512-112', - 0xb32f: 'Skein512-120', - 0xb330: 'Skein512-128', - 0xb331: 'Skein512-136', - 0xb332: 'Skein512-144', - 0xb333: 'Skein512-152', - 0xb334: 'Skein512-160', - 0xb335: 'Skein512-168', - 0xb336: 'Skein512-176', - 0xb337: 'Skein512-184', - 0xb338: 'Skein512-192', - 0xb339: 'Skein512-200', - 0xb33a: 'Skein512-208', - 0xb33b: 'Skein512-216', - 0xb33c: 'Skein512-224', - 0xb33d: 'Skein512-232', - 0xb33e: 'Skein512-240', - 0xb33f: 'Skein512-248', - 0xb340: 'Skein512-256', - 0xb341: 'Skein512-264', - 0xb342: 'Skein512-272', - 0xb343: 'Skein512-280', - 0xb344: 'Skein512-288', - 0xb345: 'Skein512-296', - 0xb346: 'Skein512-304', - 0xb347: 'Skein512-312', - 0xb348: 'Skein512-320', - 0xb349: 'Skein512-328', - 0xb34a: 'Skein512-336', - 0xb34b: 'Skein512-344', - 0xb34c: 'Skein512-352', - 0xb34d: 'Skein512-360', - 0xb34e: 'Skein512-368', - 0xb34f: 'Skein512-376', - 0xb350: 'Skein512-384', - 0xb351: 'Skein512-392', - 0xb352: 'Skein512-400', - 0xb353: 'Skein512-408', - 0xb354: 'Skein512-416', - 0xb355: 'Skein512-424', - 0xb356: 'Skein512-432', - 0xb357: 'Skein512-440', - 0xb358: 'Skein512-448', - 0xb359: 'Skein512-456', - 0xb35a: 'Skein512-464', - 0xb35b: 'Skein512-472', - 0xb35c: 'Skein512-480', - 0xb35d: 'Skein512-488', - 0xb35e: 'Skein512-496', - 0xb35f: 'Skein512-504', - 0xb360: 'Skein512-512', - 0xb361: 'Skein1024-8', - 0xb362: 'Skein1024-16', - 0xb363: 'Skein1024-24', - 0xb364: 'Skein1024-32', - 0xb365: 'Skein1024-40', - 0xb366: 'Skein1024-48', - 0xb367: 'Skein1024-56', - 0xb368: 'Skein1024-64', - 0xb369: 'Skein1024-72', - 0xb36a: 'Skein1024-80', - 0xb36b: 'Skein1024-88', - 0xb36c: 'Skein1024-96', - 0xb36d: 'Skein1024-104', - 0xb36e: 'Skein1024-112', - 0xb36f: 'Skein1024-120', - 0xb370: 'Skein1024-128', - 0xb371: 'Skein1024-136', - 0xb372: 'Skein1024-144', - 0xb373: 'Skein1024-152', - 0xb374: 'Skein1024-160', - 0xb375: 'Skein1024-168', - 0xb376: 'Skein1024-176', - 0xb377: 'Skein1024-184', - 0xb378: 'Skein1024-192', - 0xb379: 'Skein1024-200', - 0xb37a: 'Skein1024-208', - 0xb37b: 'Skein1024-216', - 0xb37c: 'Skein1024-224', - 0xb37d: 'Skein1024-232', - 0xb37e: 'Skein1024-240', - 0xb37f: 'Skein1024-248', - 0xb380: 'Skein1024-256', - 0xb381: 'Skein1024-264', - 0xb382: 'Skein1024-272', - 0xb383: 'Skein1024-280', - 0xb384: 'Skein1024-288', - 0xb385: 'Skein1024-296', - 0xb386: 'Skein1024-304', - 0xb387: 'Skein1024-312', - 0xb388: 'Skein1024-320', - 0xb389: 'Skein1024-328', - 0xb38a: 'Skein1024-336', - 0xb38b: 'Skein1024-344', - 0xb38c: 'Skein1024-352', - 0xb38d: 'Skein1024-360', - 0xb38e: 'Skein1024-368', - 0xb38f: 'Skein1024-376', - 0xb390: 'Skein1024-384', - 0xb391: 'Skein1024-392', - 0xb392: 'Skein1024-400', - 0xb393: 'Skein1024-408', - 0xb394: 'Skein1024-416', - 0xb395: 'Skein1024-424', - 0xb396: 'Skein1024-432', - 0xb397: 'Skein1024-440', - 0xb398: 'Skein1024-448', - 0xb399: 'Skein1024-456', - 0xb39a: 'Skein1024-464', - 0xb39b: 'Skein1024-472', - 0xb39c: 'Skein1024-480', - 0xb39d: 'Skein1024-488', - 0xb39e: 'Skein1024-496', - 0xb39f: 'Skein1024-504', - 0xb3a0: 'Skein1024-512', - 0xb3a1: 'Skein1024-520', - 0xb3a2: 'Skein1024-528', - 0xb3a3: 'Skein1024-536', - 0xb3a4: 'Skein1024-544', - 0xb3a5: 'Skein1024-552', - 0xb3a6: 'Skein1024-560', - 0xb3a7: 'Skein1024-568', - 0xb3a8: 'Skein1024-576', - 0xb3a9: 'Skein1024-584', - 0xb3aa: 'Skein1024-592', - 0xb3ab: 'Skein1024-600', - 0xb3ac: 'Skein1024-608', - 0xb3ad: 'Skein1024-616', - 0xb3ae: 'Skein1024-624', - 0xb3af: 'Skein1024-632', - 0xb3b0: 'Skein1024-640', - 0xb3b1: 'Skein1024-648', - 0xb3b2: 'Skein1024-656', - 0xb3b3: 'Skein1024-664', - 0xb3b4: 'Skein1024-672', - 0xb3b5: 'Skein1024-680', - 0xb3b6: 'Skein1024-688', - 0xb3b7: 'Skein1024-696', - 0xb3b8: 'Skein1024-704', - 0xb3b9: 'Skein1024-712', - 0xb3ba: 'Skein1024-720', - 0xb3bb: 'Skein1024-728', - 0xb3bc: 'Skein1024-736', - 0xb3bd: 'Skein1024-744', - 0xb3be: 'Skein1024-752', - 0xb3bf: 'Skein1024-760', - 0xb3c0: 'Skein1024-768', - 0xb3c1: 'Skein1024-776', - 0xb3c2: 'Skein1024-784', - 0xb3c3: 'Skein1024-792', - 0xb3c4: 'Skein1024-800', - 0xb3c5: 'Skein1024-808', - 0xb3c6: 'Skein1024-816', - 0xb3c7: 'Skein1024-824', - 0xb3c8: 'Skein1024-832', - 0xb3c9: 'Skein1024-840', - 0xb3ca: 'Skein1024-848', - 0xb3cb: 'Skein1024-856', - 0xb3cc: 'Skein1024-864', - 0xb3cd: 'Skein1024-872', - 0xb3ce: 'Skein1024-880', - 0xb3cf: 'Skein1024-888', - 0xb3d0: 'Skein1024-896', - 0xb3d1: 'Skein1024-904', - 0xb3d2: 'Skein1024-912', - 0xb3d3: 'Skein1024-920', - 0xb3d4: 'Skein1024-928', - 0xb3d5: 'Skein1024-936', - 0xb3d6: 'Skein1024-944', - 0xb3d7: 'Skein1024-952', - 0xb3d8: 'Skein1024-960', - 0xb3d9: 'Skein1024-968', - 0xb3da: 'Skein1024-976', - 0xb3db: 'Skein1024-984', - 0xb3dc: 'Skein1024-992', - 0xb3dd: 'Skein1024-1000', - 0xb3de: 'Skein1024-1008', - 0xb3df: 'Skein1024-1016', - 0xb3e0: 'Skein1024-1024' -}) - -exports.defaultLengths = Object.freeze({ - 0x11: 20, - 0x12: 32, - 0x13: 64, - 0x56: 32, - 0x17: 28, - 0x16: 32, - 0x15: 48, - 0x14: 64, - 0x18: 32, - 0x19: 64, - 0x1A: 28, - 0x1B: 32, - 0x1C: 48, - 0x1D: 64, - 0x22: 32, - - 0xb201: 0x01, - 0xb202: 0x02, - 0xb203: 0x03, - 0xb204: 0x04, - 0xb205: 0x05, - 0xb206: 0x06, - 0xb207: 0x07, - 0xb208: 0x08, - 0xb209: 0x09, - 0xb20a: 0x0a, - 0xb20b: 0x0b, - 0xb20c: 0x0c, - 0xb20d: 0x0d, - 0xb20e: 0x0e, - 0xb20f: 0x0f, - 0xb210: 0x10, - 0xb211: 0x11, - 0xb212: 0x12, - 0xb213: 0x13, - 0xb214: 0x14, - 0xb215: 0x15, - 0xb216: 0x16, - 0xb217: 0x17, - 0xb218: 0x18, - 0xb219: 0x19, - 0xb21a: 0x1a, - 0xb21b: 0x1b, - 0xb21c: 0x1c, - 0xb21d: 0x1d, - 0xb21e: 0x1e, - 0xb21f: 0x1f, - 0xb220: 0x20, - 0xb221: 0x21, - 0xb222: 0x22, - 0xb223: 0x23, - 0xb224: 0x24, - 0xb225: 0x25, - 0xb226: 0x26, - 0xb227: 0x27, - 0xb228: 0x28, - 0xb229: 0x29, - 0xb22a: 0x2a, - 0xb22b: 0x2b, - 0xb22c: 0x2c, - 0xb22d: 0x2d, - 0xb22e: 0x2e, - 0xb22f: 0x2f, - 0xb230: 0x30, - 0xb231: 0x31, - 0xb232: 0x32, - 0xb233: 0x33, - 0xb234: 0x34, - 0xb235: 0x35, - 0xb236: 0x36, - 0xb237: 0x37, - 0xb238: 0x38, - 0xb239: 0x39, - 0xb23a: 0x3a, - 0xb23b: 0x3b, - 0xb23c: 0x3c, - 0xb23d: 0x3d, - 0xb23e: 0x3e, - 0xb23f: 0x3f, - 0xb240: 0x40, - 0xb241: 0x01, - 0xb242: 0x02, - 0xb243: 0x03, - 0xb244: 0x04, - 0xb245: 0x05, - 0xb246: 0x06, - 0xb247: 0x07, - 0xb248: 0x08, - 0xb249: 0x09, - 0xb24a: 0x0a, - 0xb24b: 0x0b, - 0xb24c: 0x0c, - 0xb24d: 0x0d, - 0xb24e: 0x0e, - 0xb24f: 0x0f, - 0xb250: 0x10, - 0xb251: 0x11, - 0xb252: 0x12, - 0xb253: 0x13, - 0xb254: 0x14, - 0xb255: 0x15, - 0xb256: 0x16, - 0xb257: 0x17, - 0xb258: 0x18, - 0xb259: 0x19, - 0xb25a: 0x1a, - 0xb25b: 0x1b, - 0xb25c: 0x1c, - 0xb25d: 0x1d, - 0xb25e: 0x1e, - 0xb25f: 0x1f, - 0xb260: 0x20, - 0xb301: 0x01, - 0xb302: 0x02, - 0xb303: 0x03, - 0xb304: 0x04, - 0xb305: 0x05, - 0xb306: 0x06, - 0xb307: 0x07, - 0xb308: 0x08, - 0xb309: 0x09, - 0xb30a: 0x0a, - 0xb30b: 0x0b, - 0xb30c: 0x0c, - 0xb30d: 0x0d, - 0xb30e: 0x0e, - 0xb30f: 0x0f, - 0xb310: 0x10, - 0xb311: 0x11, - 0xb312: 0x12, - 0xb313: 0x13, - 0xb314: 0x14, - 0xb315: 0x15, - 0xb316: 0x16, - 0xb317: 0x17, - 0xb318: 0x18, - 0xb319: 0x19, - 0xb31a: 0x1a, - 0xb31b: 0x1b, - 0xb31c: 0x1c, - 0xb31d: 0x1d, - 0xb31e: 0x1e, - 0xb31f: 0x1f, - 0xb320: 0x20, - 0xb321: 0x01, - 0xb322: 0x02, - 0xb323: 0x03, - 0xb324: 0x04, - 0xb325: 0x05, - 0xb326: 0x06, - 0xb327: 0x07, - 0xb328: 0x08, - 0xb329: 0x09, - 0xb32a: 0x0a, - 0xb32b: 0x0b, - 0xb32c: 0x0c, - 0xb32d: 0x0d, - 0xb32e: 0x0e, - 0xb32f: 0x0f, - 0xb330: 0x10, - 0xb331: 0x11, - 0xb332: 0x12, - 0xb333: 0x13, - 0xb334: 0x14, - 0xb335: 0x15, - 0xb336: 0x16, - 0xb337: 0x17, - 0xb338: 0x18, - 0xb339: 0x19, - 0xb33a: 0x1a, - 0xb33b: 0x1b, - 0xb33c: 0x1c, - 0xb33d: 0x1d, - 0xb33e: 0x1e, - 0xb33f: 0x1f, - 0xb340: 0x20, - 0xb341: 0x21, - 0xb342: 0x22, - 0xb343: 0x23, - 0xb344: 0x24, - 0xb345: 0x25, - 0xb346: 0x26, - 0xb347: 0x27, - 0xb348: 0x28, - 0xb349: 0x29, - 0xb34a: 0x2a, - 0xb34b: 0x2b, - 0xb34c: 0x2c, - 0xb34d: 0x2d, - 0xb34e: 0x2e, - 0xb34f: 0x2f, - 0xb350: 0x30, - 0xb351: 0x31, - 0xb352: 0x32, - 0xb353: 0x33, - 0xb354: 0x34, - 0xb355: 0x35, - 0xb356: 0x36, - 0xb357: 0x37, - 0xb358: 0x38, - 0xb359: 0x39, - 0xb35a: 0x3a, - 0xb35b: 0x3b, - 0xb35c: 0x3c, - 0xb35d: 0x3d, - 0xb35e: 0x3e, - 0xb35f: 0x3f, - 0xb360: 0x40, - 0xb361: 0x01, - 0xb362: 0x02, - 0xb363: 0x03, - 0xb364: 0x04, - 0xb365: 0x05, - 0xb366: 0x06, - 0xb367: 0x07, - 0xb368: 0x08, - 0xb369: 0x09, - 0xb36a: 0x0a, - 0xb36b: 0x0b, - 0xb36c: 0x0c, - 0xb36d: 0x0d, - 0xb36e: 0x0e, - 0xb36f: 0x0f, - 0xb370: 0x10, - 0xb371: 0x11, - 0xb372: 0x12, - 0xb373: 0x13, - 0xb374: 0x14, - 0xb375: 0x15, - 0xb376: 0x16, - 0xb377: 0x17, - 0xb378: 0x18, - 0xb379: 0x19, - 0xb37a: 0x1a, - 0xb37b: 0x1b, - 0xb37c: 0x1c, - 0xb37d: 0x1d, - 0xb37e: 0x1e, - 0xb37f: 0x1f, - 0xb380: 0x20, - 0xb381: 0x21, - 0xb382: 0x22, - 0xb383: 0x23, - 0xb384: 0x24, - 0xb385: 0x25, - 0xb386: 0x26, - 0xb387: 0x27, - 0xb388: 0x28, - 0xb389: 0x29, - 0xb38a: 0x2a, - 0xb38b: 0x2b, - 0xb38c: 0x2c, - 0xb38d: 0x2d, - 0xb38e: 0x2e, - 0xb38f: 0x2f, - 0xb390: 0x30, - 0xb391: 0x31, - 0xb392: 0x32, - 0xb393: 0x33, - 0xb394: 0x34, - 0xb395: 0x35, - 0xb396: 0x36, - 0xb397: 0x37, - 0xb398: 0x38, - 0xb399: 0x39, - 0xb39a: 0x3a, - 0xb39b: 0x3b, - 0xb39c: 0x3c, - 0xb39d: 0x3d, - 0xb39e: 0x3e, - 0xb39f: 0x3f, - 0xb3a0: 0x40, - 0xb3a1: 0x41, - 0xb3a2: 0x42, - 0xb3a3: 0x43, - 0xb3a4: 0x44, - 0xb3a5: 0x45, - 0xb3a6: 0x46, - 0xb3a7: 0x47, - 0xb3a8: 0x48, - 0xb3a9: 0x49, - 0xb3aa: 0x4a, - 0xb3ab: 0x4b, - 0xb3ac: 0x4c, - 0xb3ad: 0x4d, - 0xb3ae: 0x4e, - 0xb3af: 0x4f, - 0xb3b0: 0x50, - 0xb3b1: 0x51, - 0xb3b2: 0x52, - 0xb3b3: 0x53, - 0xb3b4: 0x54, - 0xb3b5: 0x55, - 0xb3b6: 0x56, - 0xb3b7: 0x57, - 0xb3b8: 0x58, - 0xb3b9: 0x59, - 0xb3ba: 0x5a, - 0xb3bb: 0x5b, - 0xb3bc: 0x5c, - 0xb3bd: 0x5d, - 0xb3be: 0x5e, - 0xb3bf: 0x5f, - 0xb3c0: 0x60, - 0xb3c1: 0x61, - 0xb3c2: 0x62, - 0xb3c3: 0x63, - 0xb3c4: 0x64, - 0xb3c5: 0x65, - 0xb3c6: 0x66, - 0xb3c7: 0x67, - 0xb3c8: 0x68, - 0xb3c9: 0x69, - 0xb3ca: 0x6a, - 0xb3cb: 0x6b, - 0xb3cc: 0x6c, - 0xb3cd: 0x6d, - 0xb3ce: 0x6e, - 0xb3cf: 0x6f, - 0xb3d0: 0x70, - 0xb3d1: 0x71, - 0xb3d2: 0x72, - 0xb3d3: 0x73, - 0xb3d4: 0x74, - 0xb3d5: 0x75, - 0xb3d6: 0x76, - 0xb3d7: 0x77, - 0xb3d8: 0x78, - 0xb3d9: 0x79, - 0xb3da: 0x7a, - 0xb3db: 0x7b, - 0xb3dc: 0x7c, - 0xb3dd: 0x7d, - 0xb3de: 0x7e, - 0xb3df: 0x7f, - 0xb3e0: 0x80 -}) - - -/***/ }), - -/***/ "./node_modules/multihashes/src/index.js": -/*!***********************************************!*\ - !*** ./node_modules/multihashes/src/index.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_935035__) { - -"use strict"; -/** - * Multihash implementation in JavaScript. - * - * @module multihash - */ - - -const bs58 = __nested_webpack_require_935035__(/*! bs58 */ "./node_modules/bs58/index.js") - -const cs = __nested_webpack_require_935035__(/*! ./constants */ "./node_modules/multihashes/src/constants.js") - -exports.names = cs.names -exports.codes = cs.codes -exports.defaultLengths = cs.defaultLengths - -const varint = __nested_webpack_require_935035__(/*! varint */ "./node_modules/varint/index.js") - -/** - * Convert the given multihash to a hex encoded string. - * - * @param {Buffer} hash - * @returns {string} - */ -exports.toHexString = function toHexString (hash) { - if (!Buffer.isBuffer(hash)) { - throw new Error('must be passed a buffer') - } - - return hash.toString('hex') -} - -/** - * Convert the given hex encoded string to a multihash. - * - * @param {string} hash - * @returns {Buffer} - */ -exports.fromHexString = function fromHexString (hash) { - return Buffer.from(hash, 'hex') -} - -/** - * Convert the given multihash to a base58 encoded string. - * - * @param {Buffer} hash - * @returns {string} - */ -exports.toB58String = function toB58String (hash) { - if (!Buffer.isBuffer(hash)) { - throw new Error('must be passed a buffer') - } - - return bs58.encode(hash) -} - -/** - * Convert the given base58 encoded string to a multihash. - * - * @param {string|Buffer} hash - * @returns {Buffer} - */ -exports.fromB58String = function fromB58String (hash) { - let encoded = hash - if (Buffer.isBuffer(hash)) { - encoded = hash.toString() - } - - return Buffer.from(bs58.decode(encoded)) -} - -/** - * Decode a hash from the given multihash. - * - * @param {Buffer} buf - * @returns {{code: number, name: string, length: number, digest: Buffer}} result - */ -exports.decode = function decode (buf) { - if (!(Buffer.isBuffer(buf))) { - throw new Error('multihash must be a Buffer') - } - - if (buf.length < 3) { - throw new Error('multihash too short. must be > 3 bytes.') - } - - const code = varint.decode(buf) - if (!exports.isValidCode(code)) { - throw new Error(`multihash unknown function code: 0x${code.toString(16)}`) - } - buf = buf.slice(varint.decode.bytes) - - const len = varint.decode(buf) - if (len < 1) { - throw new Error(`multihash invalid length: 0x${len.toString(16)}`) - } - buf = buf.slice(varint.decode.bytes) - - if (buf.length !== len) { - throw new Error(`multihash length inconsistent: 0x${buf.toString('hex')}`) - } - - return { - code: code, - name: cs.codes[code], - length: len, - digest: buf - } -} - -/** - * Encode a hash digest along with the specified function code. - * - * > **Note:** the length is derived from the length of the digest itself. - * - * @param {Buffer} digest - * @param {string|number} code - * @param {number} [length] - * @returns {Buffer} - */ -exports.encode = function encode (digest, code, length) { - if (!digest || code === undefined) { - throw new Error('multihash encode requires at least two args: digest, code') - } - - // ensure it's a hashfunction code. - const hashfn = exports.coerceCode(code) - - if (!(Buffer.isBuffer(digest))) { - throw new Error('digest should be a Buffer') - } - - if (length == null) { - length = digest.length - } - - if (length && digest.length !== length) { - throw new Error('digest length should be equal to specified length.') - } - - return Buffer.concat([ - Buffer.from(varint.encode(hashfn)), - Buffer.from(varint.encode(length)), - digest - ]) -} - -/** - * Converts a hash function name into the matching code. - * If passed a number it will return the number if it's a valid code. - * @param {string|number} name - * @returns {number} - */ -exports.coerceCode = function coerceCode (name) { - let code = name - - if (typeof name === 'string') { - if (cs.names[name] === undefined) { - throw new Error(`Unrecognized hash function named: ${name}`) - } - code = cs.names[name] - } - - if (typeof code !== 'number') { - throw new Error(`Hash function code should be a number. Got: ${code}`) - } - - if (cs.codes[code] === undefined && !exports.isAppCode(code)) { - throw new Error(`Unrecognized function code: ${code}`) - } - - return code -} - -/** - * Checks wether a code is part of the app range - * - * @param {number} code - * @returns {boolean} - */ -exports.isAppCode = function appCode (code) { - return code > 0 && code < 0x10 -} - -/** - * Checks whether a multihash code is valid. - * - * @param {number} code - * @returns {boolean} - */ -exports.isValidCode = function validCode (code) { - if (exports.isAppCode(code)) { - return true - } - - if (cs.codes[code]) { - return true - } - - return false -} - -/** - * Check if the given buffer is a valid multihash. Throws an error if it is not valid. - * - * @param {Buffer} multihash - * @returns {undefined} - * @throws {Error} - */ -function validate (multihash) { - exports.decode(multihash) // throws if bad. -} -exports.validate = validate - -/** - * Returns a prefix from a valid multihash. Throws an error if it is not valid. - * - * @param {Buffer} multihash - * @returns {undefined} - * @throws {Error} - */ -exports.prefix = function prefix (multihash) { - validate(multihash) - - return multihash.slice(0, 2) -} - - -/***/ }), - -/***/ "./node_modules/recursive-fs/index.js": -/*!********************************************!*\ - !*** ./node_modules/recursive-fs/index.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_940411__) { - - -module.exports = { - readdirr: __nested_webpack_require_940411__(/*! ./lib/readdirr */ "./node_modules/recursive-fs/lib/readdirr.js").readdirr, - - rmdirr: __nested_webpack_require_940411__(/*! ./lib/rmdirr */ "./node_modules/recursive-fs/lib/rmdirr.js").rmdirr, - rmdirs: __nested_webpack_require_940411__(/*! ./lib/rmdirr */ "./node_modules/recursive-fs/lib/rmdirr.js").rmdirs, - rmfiles: __nested_webpack_require_940411__(/*! ./lib/rmdirr */ "./node_modules/recursive-fs/lib/rmdirr.js").rmfiles, - - cpdirr: __nested_webpack_require_940411__(/*! ./lib/cpdirr */ "./node_modules/recursive-fs/lib/cpdirr.js").cpdirr, - cpdirs: __nested_webpack_require_940411__(/*! ./lib/cpdirr */ "./node_modules/recursive-fs/lib/cpdirr.js").cpdirs, - cpfiles: __nested_webpack_require_940411__(/*! ./lib/cpdirr */ "./node_modules/recursive-fs/lib/cpdirr.js").cpfiles -} - - -/***/ }), - -/***/ "./node_modules/recursive-fs/lib/cpdirr.js": -/*!*************************************************!*\ - !*** ./node_modules/recursive-fs/lib/cpdirr.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_941483__) { - - -var fs = __nested_webpack_require_941483__(/*! fs */ "fs") -var path = __nested_webpack_require_941483__(/*! path */ "path") -var readdirr = __nested_webpack_require_941483__(/*! ./readdirr */ "./node_modules/recursive-fs/lib/readdirr.js").readdirr - - -/** - * Copy directory recursively - * - * @param {String} source path - * @param {String} target path - * @param {Function} callback - * @api public - */ - -exports.cpdirr = function (spath, tpath, cb) { - readdirr(spath, function (err, dirs, files) { - if (err) return cb(err) - exports.cpdirs(spath, tpath, dirs, function (err) { - if (err) return cb(err) - exports.cpfiles(spath, tpath, files, function (err) { - if (err) return cb(err) - cb() - }) - }) - }) -} - -/** - * Copy a list of directories - * - * @param {String} source path - * @param {String} target path - * @param {Array} dirs - * @param {Function} callback - * @api public - */ - -exports.cpdirs = function (spath, tpath, dirs, cb) { - dirs.sort() - ;(function loop (index) { - if (index == dirs.length) return cb() - var rpath = path.relative(spath, dirs[index]) - rpath = path.join(tpath, rpath) - fs.exists(rpath, function (exists) { - if (exists) return loop(++index) - fs.mkdir(rpath, function (err) { - if (err) return cb(err) - loop(++index) - }) - }) - }(0)) -} - -/** - * Copy a list of files - * - * @param {String} source path - * @param {String} target path - * @param {Array} files - * @param {Function} callback - * @api public - */ - -exports.cpfiles = function (spath, tpath, files, cb) { - ;(function loop (index) { - if (index == files.length) return cb() - fs.readFile(files[index], function (err, data) { - if (err) return cb(err) - var rpath = path.relative(spath, files[index]) - rpath = path.join(tpath, rpath) - fs.writeFile(rpath, data, function (err) { - if (err) return cb(err) - loop(++index) - }) - }) - }(0)) -} - - -/***/ }), - -/***/ "./node_modules/recursive-fs/lib/readdirr.js": -/*!***************************************************!*\ - !*** ./node_modules/recursive-fs/lib/readdirr.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_943693__) { - - -var fs = __nested_webpack_require_943693__(/*! fs */ "fs") -var path = __nested_webpack_require_943693__(/*! path */ "path") - - -/** - * Read directory recursively - * - * @param {String} directory path - * @param {Function} callback - * @return {Arrays} dirs & files - * @api public - */ - -exports.readdirr = function (dpath, cb) { - var dirs = [], files = [] - dirs.push(dpath) - ;(function loop (index) { - if (index == dirs.length) return cb(null, dirs, files) - fs.readdir(dirs[index], function (err, _files) { - if (err) return cb(err) - getstat(dirs[index], _files, function (err) { - if (err) return cb(err) - loop(++index) - }) - }) - }(0)) - - /** - * Get stat - * - * @param {String} directory path - * @param {Array} files - * @param {Function} callback - * @api private - */ - function getstat (dpath, _files, cb) { - ;(function loop (index) { - if (index == _files.length) return cb() - var fpath = path.join(dpath, _files[index]) - fs.stat(fpath, function (err, stats) { - if (err) return cb(err) - if (stats.isDirectory()) { - dirs.push(fpath) - } else { - files.push(fpath) - } - loop(++index) - }) - }(0)) - } -} - - -/***/ }), - -/***/ "./node_modules/recursive-fs/lib/rmdirr.js": -/*!*************************************************!*\ - !*** ./node_modules/recursive-fs/lib/rmdirr.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_945203__) { - - -var fs = __nested_webpack_require_945203__(/*! fs */ "fs") -var readdirr = __nested_webpack_require_945203__(/*! ./readdirr */ "./node_modules/recursive-fs/lib/readdirr.js").readdirr - - -/** - * Remove directory recursively - * - * @param {String} directory path - * @param {Function} callback - * @api public - */ - -exports.rmdirr = function (dpath, cb) { - readdirr(dpath, function (err, dirs, files) { - if (err) return cb(err) - exports.rmfiles(files, function (err) { - if (err) return cb(err) - exports.rmdirs(dirs, cb) - }) - }) -} - -/** - * Remove a list of files - * - * @param {Array} files - * @param {Function} callback - * @api public - */ - -exports.rmfiles = function (files, cb) { - ;(function loop (index) { - if (index == files.length) return cb() - fs.unlink(files[index], function (err) { - if (err) return cb(err) - loop(++index) - }) - }(0)) -} - -/** - * Remove a list of directories - * - * @param {Array} dirs - * @param {Function} callback - * @api public - */ - -exports.rmdirs = function (dirs, cb) { - dirs.sort(desc) - ;(function loop (index) { - if (index == dirs.length) return cb() - fs.rmdir(dirs[index], function (err) { - if (err) return cb(err) - loop(++index) - }) - }(0)) -} - -/** - * Sort in descending order - * - * @param {String} a - * @param {String} b - * @api private - */ - -function desc(a, b) { - if (a > b) return -1 - if (a < b) return 1 - return 0 -} - - -/***/ }), - -/***/ "./node_modules/regenerator-runtime/runtime.js": -/*!*****************************************************!*\ - !*** ./node_modules/regenerator-runtime/runtime.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * Copyright (c) 2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * https://raw.github.com/facebook/regenerator/master/LICENSE file. An - * additional grant of patent rights can be found in the PATENTS file in - * the same directory. - */ - -!(function(global) { - "use strict"; - - var Op = Object.prototype; - var hasOwn = Op.hasOwnProperty; - var undefined; // More compressible than void 0. - var $Symbol = typeof Symbol === "function" ? Symbol : {}; - var iteratorSymbol = $Symbol.iterator || "@@iterator"; - var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; - var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; - - var inModule = typeof module === "object"; - var runtime = global.regeneratorRuntime; - if (runtime) { - if (inModule) { - // If regeneratorRuntime is defined globally and we're in a module, - // make the exports object identical to regeneratorRuntime. - module.exports = runtime; - } - // Don't bother evaluating the rest of this file if the runtime was - // already defined globally. - return; - } - - // Define the runtime globally (as expected by generated code) as either - // module.exports (if we're in a module) or a new, empty object. - runtime = global.regeneratorRuntime = inModule ? module.exports : {}; - - function wrap(innerFn, outerFn, self, tryLocsList) { - // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. - var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; - var generator = Object.create(protoGenerator.prototype); - var context = new Context(tryLocsList || []); - - // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - generator._invoke = makeInvokeMethod(innerFn, self, context); - - return generator; - } - runtime.wrap = wrap; - - // Try/catch helper to minimize deoptimizations. Returns a completion - // record like context.tryEntries[i].completion. This interface could - // have been (and was previously) designed to take a closure to be - // invoked without arguments, but in all the cases we care about we - // already have an existing method we want to call, so there's no need - // to create a new function object. We can even get away with assuming - // the method takes exactly one argument, since that happens to be true - // in every case, so we don't have to touch the arguments object. The - // only additional allocation required is the completion record, which - // has a stable shape and so hopefully should be cheap to allocate. - function tryCatch(fn, obj, arg) { - try { - return { type: "normal", arg: fn.call(obj, arg) }; - } catch (err) { - return { type: "throw", arg: err }; - } - } - - var GenStateSuspendedStart = "suspendedStart"; - var GenStateSuspendedYield = "suspendedYield"; - var GenStateExecuting = "executing"; - var GenStateCompleted = "completed"; - - // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. - var ContinueSentinel = {}; - - // Dummy constructor functions that we use as the .constructor and - // .constructor.prototype properties for functions that return Generator - // objects. For full spec compliance, you may wish to configure your - // minifier not to mangle the names of these two functions. - function Generator() {} - function GeneratorFunction() {} - function GeneratorFunctionPrototype() {} - - // This is a polyfill for %IteratorPrototype% for environments that - // don't natively support it. - var IteratorPrototype = {}; - IteratorPrototype[iteratorSymbol] = function () { - return this; - }; - - var getProto = Object.getPrototypeOf; - var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); - if (NativeIteratorPrototype && - NativeIteratorPrototype !== Op && - hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { - // This environment has a native %IteratorPrototype%; use it instead - // of the polyfill. - IteratorPrototype = NativeIteratorPrototype; - } - - var Gp = GeneratorFunctionPrototype.prototype = - Generator.prototype = Object.create(IteratorPrototype); - GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; - GeneratorFunctionPrototype.constructor = GeneratorFunction; - GeneratorFunctionPrototype[toStringTagSymbol] = - GeneratorFunction.displayName = "GeneratorFunction"; - - // Helper for defining the .next, .throw, and .return methods of the - // Iterator interface in terms of a single ._invoke method. - function defineIteratorMethods(prototype) { - ["next", "throw", "return"].forEach(function(method) { - prototype[method] = function(arg) { - return this._invoke(method, arg); - }; - }); - } - - runtime.isGeneratorFunction = function(genFun) { - var ctor = typeof genFun === "function" && genFun.constructor; - return ctor - ? ctor === GeneratorFunction || - // For the native GeneratorFunction constructor, the best we can - // do is to check its .name property. - (ctor.displayName || ctor.name) === "GeneratorFunction" - : false; - }; - - runtime.mark = function(genFun) { - if (Object.setPrototypeOf) { - Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); - } else { - genFun.__proto__ = GeneratorFunctionPrototype; - if (!(toStringTagSymbol in genFun)) { - genFun[toStringTagSymbol] = "GeneratorFunction"; - } - } - genFun.prototype = Object.create(Gp); - return genFun; - }; - - // Within the body of any async function, `await x` is transformed to - // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test - // `hasOwn.call(value, "__await")` to determine if the yielded value is - // meant to be awaited. - runtime.awrap = function(arg) { - return { __await: arg }; - }; - - function AsyncIterator(generator) { - function invoke(method, arg, resolve, reject) { - var record = tryCatch(generator[method], generator, arg); - if (record.type === "throw") { - reject(record.arg); - } else { - var result = record.arg; - var value = result.value; - if (value && - typeof value === "object" && - hasOwn.call(value, "__await")) { - return Promise.resolve(value.__await).then(function(value) { - invoke("next", value, resolve, reject); - }, function(err) { - invoke("throw", err, resolve, reject); - }); - } - - return Promise.resolve(value).then(function(unwrapped) { - // When a yielded Promise is resolved, its final value becomes - // the .value of the Promise<{value,done}> result for the - // current iteration. If the Promise is rejected, however, the - // result for this iteration will be rejected with the same - // reason. Note that rejections of yielded Promises are not - // thrown back into the generator function, as is the case - // when an awaited Promise is rejected. This difference in - // behavior between yield and await is important, because it - // allows the consumer to decide what to do with the yielded - // rejection (swallow it and continue, manually .throw it back - // into the generator, abandon iteration, whatever). With - // await, by contrast, there is no opportunity to examine the - // rejection reason outside the generator function, so the - // only option is to throw it from the await expression, and - // let the generator function handle the exception. - result.value = unwrapped; - resolve(result); - }, reject); - } - } - - if (typeof global.process === "object" && global.process.domain) { - invoke = global.process.domain.bind(invoke); - } - - var previousPromise; - - function enqueue(method, arg) { - function callInvokeWithMethodAndArg() { - return new Promise(function(resolve, reject) { - invoke(method, arg, resolve, reject); - }); - } - - return previousPromise = - // If enqueue has been called before, then we want to wait until - // all previous Promises have been resolved before calling invoke, - // so that results are always delivered in the correct order. If - // enqueue has not been called before, then it is important to - // call invoke immediately, without waiting on a callback to fire, - // so that the async generator function has the opportunity to do - // any necessary setup in a predictable way. This predictability - // is why the Promise constructor synchronously invokes its - // executor callback, and why async functions synchronously - // execute code before the first await. Since we implement simple - // async functions in terms of async generators, it is especially - // important to get this right, even though it requires care. - previousPromise ? previousPromise.then( - callInvokeWithMethodAndArg, - // Avoid propagating failures to Promises returned by later - // invocations of the iterator. - callInvokeWithMethodAndArg - ) : callInvokeWithMethodAndArg(); - } - - // Define the unified helper method that is used to implement .next, - // .throw, and .return (see defineIteratorMethods). - this._invoke = enqueue; - } - - defineIteratorMethods(AsyncIterator.prototype); - AsyncIterator.prototype[asyncIteratorSymbol] = function () { - return this; - }; - runtime.AsyncIterator = AsyncIterator; - - // Note that simple async functions are implemented on top of - // AsyncIterator objects; they just return a Promise for the value of - // the final result produced by the iterator. - runtime.async = function(innerFn, outerFn, self, tryLocsList) { - var iter = new AsyncIterator( - wrap(innerFn, outerFn, self, tryLocsList) - ); - - return runtime.isGeneratorFunction(outerFn) - ? iter // If outerFn is a generator, return the full iterator. - : iter.next().then(function(result) { - return result.done ? result.value : iter.next(); - }); - }; - - function makeInvokeMethod(innerFn, self, context) { - var state = GenStateSuspendedStart; - - return function invoke(method, arg) { - if (state === GenStateExecuting) { - throw new Error("Generator is already running"); - } - - if (state === GenStateCompleted) { - if (method === "throw") { - throw arg; - } - - // Be forgiving, per 25.3.3.3.3 of the spec: - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume - return doneResult(); - } - - context.method = method; - context.arg = arg; - - while (true) { - var delegate = context.delegate; - if (delegate) { - var delegateResult = maybeInvokeDelegate(delegate, context); - if (delegateResult) { - if (delegateResult === ContinueSentinel) continue; - return delegateResult; - } - } - - if (context.method === "next") { - // Setting context._sent for legacy support of Babel's - // function.sent implementation. - context.sent = context._sent = context.arg; - - } else if (context.method === "throw") { - if (state === GenStateSuspendedStart) { - state = GenStateCompleted; - throw context.arg; - } - - context.dispatchException(context.arg); - - } else if (context.method === "return") { - context.abrupt("return", context.arg); - } - - state = GenStateExecuting; - - var record = tryCatch(innerFn, self, context); - if (record.type === "normal") { - // If an exception is thrown from innerFn, we leave state === - // GenStateExecuting and loop back for another invocation. - state = context.done - ? GenStateCompleted - : GenStateSuspendedYield; - - if (record.arg === ContinueSentinel) { - continue; - } - - return { - value: record.arg, - done: context.done - }; - - } else if (record.type === "throw") { - state = GenStateCompleted; - // Dispatch the exception by looping back around to the - // context.dispatchException(context.arg) call above. - context.method = "throw"; - context.arg = record.arg; - } - } - }; - } - - // Call delegate.iterator[context.method](context.arg) and handle the - // result, either by returning a { value, done } result from the - // delegate iterator, or by modifying context.method and context.arg, - // setting context.delegate to null, and returning the ContinueSentinel. - function maybeInvokeDelegate(delegate, context) { - var method = delegate.iterator[context.method]; - if (method === undefined) { - // A .throw or .return when the delegate iterator has no .throw - // method always terminates the yield* loop. - context.delegate = null; - - if (context.method === "throw") { - if (delegate.iterator.return) { - // If the delegate iterator has a return method, give it a - // chance to clean up. - context.method = "return"; - context.arg = undefined; - maybeInvokeDelegate(delegate, context); - - if (context.method === "throw") { - // If maybeInvokeDelegate(context) changed context.method from - // "return" to "throw", let that override the TypeError below. - return ContinueSentinel; - } - } - - context.method = "throw"; - context.arg = new TypeError( - "The iterator does not provide a 'throw' method"); - } - - return ContinueSentinel; - } - - var record = tryCatch(method, delegate.iterator, context.arg); - - if (record.type === "throw") { - context.method = "throw"; - context.arg = record.arg; - context.delegate = null; - return ContinueSentinel; - } - - var info = record.arg; - - if (! info) { - context.method = "throw"; - context.arg = new TypeError("iterator result is not an object"); - context.delegate = null; - return ContinueSentinel; - } - - if (info.done) { - // Assign the result of the finished delegate to the temporary - // variable specified by delegate.resultName (see delegateYield). - context[delegate.resultName] = info.value; - - // Resume execution at the desired location (see delegateYield). - context.next = delegate.nextLoc; - - // If context.method was "throw" but the delegate handled the - // exception, let the outer generator proceed normally. If - // context.method was "next", forget context.arg since it has been - // "consumed" by the delegate iterator. If context.method was - // "return", allow the original .return call to continue in the - // outer generator. - if (context.method !== "return") { - context.method = "next"; - context.arg = undefined; - } - - } else { - // Re-yield the result returned by the delegate method. - return info; - } - - // The delegate iterator is finished, so forget it and continue with - // the outer generator. - context.delegate = null; - return ContinueSentinel; - } - - // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - defineIteratorMethods(Gp); - - Gp[toStringTagSymbol] = "Generator"; - - // A Generator should always return itself as the iterator object when the - // @@iterator function is called on it. Some browsers' implementations of the - // iterator prototype chain incorrectly implement this, causing the Generator - // object to not be returned from this call. This ensures that doesn't happen. - // See https://github.com/facebook/regenerator/issues/274 for more details. - Gp[iteratorSymbol] = function() { - return this; - }; - - Gp.toString = function() { - return "[object Generator]"; - }; - - function pushTryEntry(locs) { - var entry = { tryLoc: locs[0] }; - - if (1 in locs) { - entry.catchLoc = locs[1]; - } - - if (2 in locs) { - entry.finallyLoc = locs[2]; - entry.afterLoc = locs[3]; - } - - this.tryEntries.push(entry); - } - - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal"; - delete record.arg; - entry.completion = record; - } - - function Context(tryLocsList) { - // The root entry object (effectively a try statement without a catch - // or a finally block) gives us a place to store values thrown from - // locations where there is no enclosing try statement. - this.tryEntries = [{ tryLoc: "root" }]; - tryLocsList.forEach(pushTryEntry, this); - this.reset(true); - } - - runtime.keys = function(object) { - var keys = []; - for (var key in object) { - keys.push(key); - } - keys.reverse(); - - // Rather than returning an object with a next method, we keep - // things simple and return the next function itself. - return function next() { - while (keys.length) { - var key = keys.pop(); - if (key in object) { - next.value = key; - next.done = false; - return next; - } - } - - // To avoid creating an additional object, we just hang the .value - // and .done properties off the next function object itself. This - // also ensures that the minifier will not anonymize the function. - next.done = true; - return next; - }; - }; - - function values(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) { - return iteratorMethod.call(iterable); - } - - if (typeof iterable.next === "function") { - return iterable; - } - - if (!isNaN(iterable.length)) { - var i = -1, next = function next() { - while (++i < iterable.length) { - if (hasOwn.call(iterable, i)) { - next.value = iterable[i]; - next.done = false; - return next; - } - } - - next.value = undefined; - next.done = true; - - return next; - }; - - return next.next = next; - } - } - - // Return an iterator with no values. - return { next: doneResult }; - } - runtime.values = values; - - function doneResult() { - return { value: undefined, done: true }; - } - - Context.prototype = { - constructor: Context, - - reset: function(skipTempReset) { - this.prev = 0; - this.next = 0; - // Resetting context._sent for legacy support of Babel's - // function.sent implementation. - this.sent = this._sent = undefined; - this.done = false; - this.delegate = null; - - this.method = "next"; - this.arg = undefined; - - this.tryEntries.forEach(resetTryEntry); - - if (!skipTempReset) { - for (var name in this) { - // Not sure about the optimal order of these conditions: - if (name.charAt(0) === "t" && - hasOwn.call(this, name) && - !isNaN(+name.slice(1))) { - this[name] = undefined; - } - } - } - }, - - stop: function() { - this.done = true; - - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - if (rootRecord.type === "throw") { - throw rootRecord.arg; - } - - return this.rval; - }, - - dispatchException: function(exception) { - if (this.done) { - throw exception; - } - - var context = this; - function handle(loc, caught) { - record.type = "throw"; - record.arg = exception; - context.next = loc; - - if (caught) { - // If the dispatched exception was caught by a catch block, - // then let that catch block handle the exception normally. - context.method = "next"; - context.arg = undefined; - } - - return !! caught; - } - - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; - - if (entry.tryLoc === "root") { - // Exception thrown outside of any try block that could handle - // it, so set the completion value of the entire function to - // throw the exception. - return handle("end"); - } - - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); - - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } - - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - - } else { - throw new Error("try statement without catch or finally"); - } - } - } - }, - - abrupt: function(type, arg) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc <= this.prev && - hasOwn.call(entry, "finallyLoc") && - this.prev < entry.finallyLoc) { - var finallyEntry = entry; - break; - } - } - - if (finallyEntry && - (type === "break" || - type === "continue") && - finallyEntry.tryLoc <= arg && - arg <= finallyEntry.finallyLoc) { - // Ignore the finally entry if control is not jumping to a - // location outside the try/catch block. - finallyEntry = null; - } - - var record = finallyEntry ? finallyEntry.completion : {}; - record.type = type; - record.arg = arg; - - if (finallyEntry) { - this.method = "next"; - this.next = finallyEntry.finallyLoc; - return ContinueSentinel; - } - - return this.complete(record); - }, - - complete: function(record, afterLoc) { - if (record.type === "throw") { - throw record.arg; - } - - if (record.type === "break" || - record.type === "continue") { - this.next = record.arg; - } else if (record.type === "return") { - this.rval = this.arg = record.arg; - this.method = "return"; - this.next = "end"; - } else if (record.type === "normal" && afterLoc) { - this.next = afterLoc; - } - - return ContinueSentinel; - }, - - finish: function(finallyLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.finallyLoc === finallyLoc) { - this.complete(entry.completion, entry.afterLoc); - resetTryEntry(entry); - return ContinueSentinel; - } - } - }, - - "catch": function(tryLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - if (record.type === "throw") { - var thrown = record.arg; - resetTryEntry(entry); - } - return thrown; - } - } - - // The context.catch method must only be called with a location - // argument that corresponds to a known catch block. - throw new Error("illegal catch attempt"); - }, - - delegateYield: function(iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc - }; - - if (this.method === "next") { - // Deliberately forget the last sent value so that we don't - // accidentally pass it on to the delegate. - this.arg = undefined; - } - - return ContinueSentinel; - } - }; -})( - // Among the various tricks for obtaining a reference to the global - // object, this seems to be the most reliable technique that does not - // use indirect eval (which violates Content Security Policy). - typeof global === "object" ? global : - typeof window === "object" ? window : - typeof self === "object" ? self : this -); - - -/***/ }), - -/***/ "./node_modules/safe-buffer/index.js": -/*!*******************************************!*\ - !*** ./node_modules/safe-buffer/index.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_971614__) { - -/* eslint-disable node/no-deprecated-api */ -var buffer = __nested_webpack_require_971614__(/*! buffer */ "buffer") -var Buffer = buffer.Buffer - -// alternative to using Object.keys for old browsers -function copyProps (src, dst) { - for (var key in src) { - dst[key] = src[key] - } -} -if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { - module.exports = buffer -} else { - // Copy properties from require('buffer') - copyProps(buffer, exports) - exports.Buffer = SafeBuffer -} - -function SafeBuffer (arg, encodingOrOffset, length) { - return Buffer(arg, encodingOrOffset, length) -} - -SafeBuffer.prototype = Object.create(Buffer.prototype) - -// Copy static methods from Buffer -copyProps(Buffer, SafeBuffer) - -SafeBuffer.from = function (arg, encodingOrOffset, length) { - if (typeof arg === 'number') { - throw new TypeError('Argument must not be a number') - } - return Buffer(arg, encodingOrOffset, length) -} - -SafeBuffer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - var buf = Buffer(size) - if (fill !== undefined) { - if (typeof encoding === 'string') { - buf.fill(fill, encoding) - } else { - buf.fill(fill) - } - } else { - buf.fill(0) - } - return buf -} - -SafeBuffer.allocUnsafe = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return Buffer(size) -} - -SafeBuffer.allocUnsafeSlow = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return buffer.SlowBuffer(size) -} - - -/***/ }), - -/***/ "./node_modules/supports-color/index.js": -/*!**********************************************!*\ - !*** ./node_modules/supports-color/index.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_973529__) { - -"use strict"; - -const os = __nested_webpack_require_973529__(/*! os */ "os"); -const hasFlag = __nested_webpack_require_973529__(/*! has-flag */ "./node_modules/has-flag/index.js"); - -const env = process.env; - -let forceColor; -if (hasFlag('no-color') || - hasFlag('no-colors') || - hasFlag('color=false')) { - forceColor = false; -} else if (hasFlag('color') || - hasFlag('colors') || - hasFlag('color=true') || - hasFlag('color=always')) { - forceColor = true; -} -if ('FORCE_COLOR' in env) { - forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; -} - -function translateLevel(level) { - if (level === 0) { - return false; - } - - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; -} - -function supportsColor(stream) { - if (forceColor === false) { - return 0; - } - - if (hasFlag('color=16m') || - hasFlag('color=full') || - hasFlag('color=truecolor')) { - return 3; - } - - if (hasFlag('color=256')) { - return 2; - } - - if (stream && !stream.isTTY && forceColor !== true) { - return 0; - } - - const min = forceColor ? 1 : 0; - - if (process.platform === 'win32') { - // Node.js 7.5.0 is the first version of Node.js to include a patch to - // libuv that enables 256 color output on Windows. Anything earlier and it - // won't work. However, here we target Node.js 8 at minimum as it is an LTS - // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows - // release that supports 256 colors. Windows 10 build 14931 is the first release - // that supports 16m/TrueColor. - const osRelease = os.release().split('.'); - if ( - Number(process.versions.node.split('.')[0]) >= 8 && - Number(osRelease[0]) >= 10 && - Number(osRelease[2]) >= 10586 - ) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - - return 1; - } - - if ('CI' in env) { - if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { - return 1; - } - - return min; - } - - if ('TEAMCITY_VERSION' in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - - if (env.COLORTERM === 'truecolor') { - return 3; - } - - if ('TERM_PROGRAM' in env) { - const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); - - switch (env.TERM_PROGRAM) { - case 'iTerm.app': - return version >= 3 ? 3 : 2; - case 'Apple_Terminal': - return 2; - // No default - } - } - - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - - if ('COLORTERM' in env) { - return 1; - } - - if (env.TERM === 'dumb') { - return min; - } - - return min; -} - -function getSupportLevel(stream) { - const level = supportsColor(stream); - return translateLevel(level); -} - -module.exports = { - supportsColor: getSupportLevel, - stdout: getSupportLevel(process.stdout), - stderr: getSupportLevel(process.stderr) -}; - - -/***/ }), - -/***/ "./node_modules/varint/decode.js": -/*!***************************************!*\ - !*** ./node_modules/varint/decode.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = read - -var MSB = 0x80 - , REST = 0x7F - -function read(buf, offset) { - var res = 0 - , offset = offset || 0 - , shift = 0 - , counter = offset - , b - , l = buf.length - - do { - if (counter >= l) { - read.bytes = 0 - throw new RangeError('Could not decode varint') - } - b = buf[counter++] - res += shift < 28 - ? (b & REST) << shift - : (b & REST) * Math.pow(2, shift) - shift += 7 - } while (b >= MSB) - - read.bytes = counter - offset - - return res -} - - -/***/ }), - -/***/ "./node_modules/varint/encode.js": -/*!***************************************!*\ - !*** ./node_modules/varint/encode.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = encode - -var MSB = 0x80 - , REST = 0x7F - , MSBALL = ~REST - , INT = Math.pow(2, 31) - -function encode(num, out, offset) { - out = out || [] - offset = offset || 0 - var oldOffset = offset - - while(num >= INT) { - out[offset++] = (num & 0xFF) | MSB - num /= 128 - } - while(num & MSBALL) { - out[offset++] = (num & 0xFF) | MSB - num >>>= 7 - } - out[offset] = num | 0 - - encode.bytes = offset - oldOffset + 1 - - return out -} - - -/***/ }), - -/***/ "./node_modules/varint/index.js": -/*!**************************************!*\ - !*** ./node_modules/varint/index.js ***! - \**************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_978117__) { - -module.exports = { - encode: __nested_webpack_require_978117__(/*! ./encode.js */ "./node_modules/varint/encode.js") - , decode: __nested_webpack_require_978117__(/*! ./decode.js */ "./node_modules/varint/decode.js") - , encodingLength: __nested_webpack_require_978117__(/*! ./length.js */ "./node_modules/varint/length.js") -} - - -/***/ }), - -/***/ "./node_modules/varint/length.js": -/*!***************************************!*\ - !*** ./node_modules/varint/length.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - - -var N1 = Math.pow(2, 7) -var N2 = Math.pow(2, 14) -var N3 = Math.pow(2, 21) -var N4 = Math.pow(2, 28) -var N5 = Math.pow(2, 35) -var N6 = Math.pow(2, 42) -var N7 = Math.pow(2, 49) -var N8 = Math.pow(2, 56) -var N9 = Math.pow(2, 63) - -module.exports = function (value) { - 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 - ) -} - - -/***/ }), - -/***/ "./node_modules/webpack/buildin/amd-options.js": -/*!****************************************!*\ - !*** (webpack)/buildin/amd-options.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {/* globals __webpack_amd_options__ */ -module.exports = __webpack_amd_options__; - -/* WEBPACK VAR INJECTION */}.call(this, {})) - -/***/ }), - -/***/ "./src/commands/data/pinList/pinList.js": -/*!**********************************************!*\ - !*** ./src/commands/data/pinList/pinList.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_979894__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = pinList; - -var _axios = _interopRequireDefault(__nested_webpack_require_979894__(/*! axios */ "./node_modules/axios/index.js")); - -var _constants = __nested_webpack_require_979894__(/*! ./../../../constants */ "./src/constants.js"); - -var _validators = __nested_webpack_require_979894__(/*! ../../../util/validators */ "./src/util/validators.js"); - -var _errorResponse = __nested_webpack_require_979894__(/*! ../../../util/errorResponse */ "./src/util/errorResponse.js"); - -var _queryBuilder = _interopRequireDefault(__nested_webpack_require_979894__(/*! ./queryBuilder */ "./src/commands/data/pinList/queryBuilder.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -/** - * Pin List - * @param {string} pinataApiKey - * @param {string} pinataSecretApiKey - * @param {string} filters - * @returns {Promise} - */ -function pinList(pinataApiKey, pinataSecretApiKey, filters) { - (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); - var baseEndpoint = "".concat(_constants.baseUrl, "/data/pinList"); - var endpoint = (0, _queryBuilder["default"])(baseEndpoint, filters); - return new Promise(function (resolve, reject) { - _axios["default"].get(endpoint, { - withCredentials: true, - headers: { - 'pinata_api_key': pinataApiKey, - 'pinata_secret_api_key': pinataSecretApiKey - } - }).then(function (result) { - if (result.status !== 200) { - reject(new Error("unknown server response while attempting to retrieve user pin list: ".concat(result))); - } - - resolve(result.data); - })["catch"](function (error) { - var formattedError = (0, _errorResponse.handleError)(error); - reject(formattedError); - }); - }); -} - -module.exports = exports.default; - -/***/ }), - -/***/ "./src/commands/data/pinList/queryBuilder.js": -/*!***************************************************!*\ - !*** ./src/commands/data/pinList/queryBuilder.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = queryBuilder; - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -/** - * Validate and return data - * @param {*} dateToValidate - * @returns {*} - */ -function validateAndReturnDate(dateToValidate) { - var dateParsed = new Date(Date.parse(dateToValidate)); - - try { - if (dateParsed.toISOString() === dateToValidate) { - return dateToValidate; - } - - throw new Error('dates must be in valid ISO_8601 format'); - } catch (e) { - throw new Error('dates must be in valid ISO_8601 format'); - } -} -/** - * Query Builder - * @param {string} baseUrl - * @param {*} filters - * @returns {string} - */ - - -function queryBuilder(baseUrl, filters) { - if (!baseUrl) { - throw new Error('no baseUrl provided'); - } // preset filter values - - - var filterQuery = '?'; - var metadataQuery = ''; - - if (filters) { - // now we need to construct the actual URL based on the given filters provided - if (filters.hashContains) { - if (typeof filters.hashContains !== 'string') { - throw new Error('hashContains value is not a string'); - } - - filterQuery = filterQuery + "hashContains=".concat(filters.hashContains, "&"); - } - - if (filters.pinStart) { - filterQuery = filterQuery + "pinStart=".concat(validateAndReturnDate(filters.pinStart), "&"); - } - - if (filters.pinEnd) { - filterQuery = filterQuery + "pinEnd=".concat(validateAndReturnDate(filters.pinEnd), "&"); - } - - if (filters.unpinStart) { - filterQuery = filterQuery + "unpinStart=".concat(validateAndReturnDate(filters.unpinStart), "&"); - } - - if (filters.unpinEnd) { - filterQuery = filterQuery + "unpinEnd=".concat(validateAndReturnDate(filters.unpinEnd), "&"); - } - - if (filters.pinSizeMin) { - if (isNaN(filters.pinSizeMin) || filters.pinSizeMin < 0) { - throw new Error('Please make sure the pinSizeMin is a valid positive integer'); - } - - filterQuery = filterQuery + "pinSizeMin=".concat(filters.pinSizeMin, "&"); - } - - if (filters.pinSizeMax) { - if (isNaN(filters.pinSizeMax) || filters.pinSizeMax < 0) { - throw new Error('Please make sure the pinSizeMax is a valid positive integer'); - } - - filterQuery = filterQuery + "pinSizeMax=".concat(filters.pinSizeMax, "&"); - } - - if (filters.status) { - if (filters.status !== 'all' && filters.status !== 'pinned' && filters.status !== 'unpinned') { - throw new Error('status value must be either: all, pinned, or unpinned'); - } - - filterQuery = filterQuery + "status=".concat(filters.status, "&"); - } - - if (filters.pageLimit) { - if (isNaN(filters.pageLimit) || filters.pageLimit <= 0 || filters.pageLimit > 1000) { - throw new Error('Please make sure the pageLimit is a valid integer between 1-1000'); - } - - filterQuery = filterQuery + "pageLimit=".concat(parseInt(filters.pageLimit), "&"); // we want to make sure that decimals get rounded to integers - } - - if (filters.pageOffset) { - if (isNaN(filters.pageOffset) || filters.pageOffset <= 0) { - throw new Error('Please make sure the pageOffset is a positive integer'); - } - - filterQuery = filterQuery + "pageOffset=".concat(parseInt(filters.pageOffset), "&"); // we want to make sure that decimals get rounded to integers - } - - if (filters.metadata) { - if (_typeof(filters.metadata) !== 'object') { - throw new Error('metadata value must be an object'); - } - - if (filters.metadata.name) { - metadataQuery = "metadata[name]=".concat(filters.metadata.name, "&"); - } - - if (filters.metadata.keyvalues) { - metadataQuery = metadataQuery + 'metadata[keyvalues]='; - - if (_typeof(filters.metadata.keyvalues) !== 'object') { - throw new Error('metadata keyvalues must be an object'); - } - - var prunedKeyValues = {}; // we want to make sure we're only grabbing the values we want for the query, and nothing extra - - Object.entries(filters.metadata.keyvalues).forEach(function (keyValue) { - var key = keyValue[0]; - var value = keyValue[1]; - - if (_typeof(value) !== 'object') { - throw new Error("keyValue: ".concat(key, " is not an object")); - } - - if (!value || !value.value || !value.op) { - throw new Error("keyValue: ".concat(key, " must have both value and op attributes")); - } - - if (typeof value.value !== 'string' && typeof value.value !== 'boolean' && typeof value.value !== 'number') { - throw new Error('Metadata keyvalue values must be strings, booleans, or numbers'); - } // Run checks to make sure all of the keyvalues are valid - - - switch (value.op) { - case 'gt': - prunedKeyValues[key] = { - value: value.value, - op: value.op - }; - break; - //greater than or equal - - case 'gte': - prunedKeyValues[key] = { - value: value.value, - op: value.op - }; - break; - // less than - - case 'lt': - prunedKeyValues[key] = { - value: value.value, - op: value.op - }; - break; - // less than or equal - - case 'lte': - prunedKeyValues[key] = { - value: value.value, - op: value.op - }; - break; - // not equal to - - case 'ne': - prunedKeyValues[key] = { - value: value.value, - op: value.op - }; - break; - // equal to - - case 'eq': - prunedKeyValues[key] = { - value: value.value, - op: value.op - }; - break; - // between - - case 'between': - if (!value.secondValue) { - throw new Error("Because between op code was passed in, keyValue: ".concat(keyValue[0], " must have both also include a secondValue")); - } - - if (typeof value.secondValue !== 'string' && typeof value.secondValue !== 'boolean' && typeof value.secondValue !== 'number') { - throw new Error('Metadata keyvalue secondValue must be a string, boolean, or number'); - } - - prunedKeyValues[key] = { - value: value.value, - op: value.op, - secondValue: value.secondValue - }; - break; - // not between - - case 'notBetween': - if (!value.secondValue) { - throw new Error("Because notBetween op code was passed in, keyValue: ".concat(keyValue[0], " must have both also include a secondValue")); - } - - if (typeof value.secondValue !== 'string' && typeof value.secondValue !== 'boolean' && typeof value.secondValue !== 'number') { - throw new Error('Metadata keyvalue secondValue must be a string, boolean, or number'); - } - - prunedKeyValues[key] = { - value: value.value, - op: value.op, - secondValue: value.secondValue - }; - break; - // like - - case 'like': - prunedKeyValues[key] = { - value: value.value, - op: value.op - }; - break; - // not like - - case 'notLike': - prunedKeyValues[key] = { - value: value.value, - op: value.op - }; - break; - // case insensitive like - - case 'iLike': - prunedKeyValues[key] = { - value: value.value, - op: value.op - }; - break; - // case insensitive not like - - case 'notILike': - prunedKeyValues[key] = { - value: value.value, - op: value.op - }; - break; - // regex - - case 'regexp': - prunedKeyValues[key] = { - value: value.value, - op: value.op - }; - break; - // case insensitive regex - - case 'iRegexp': - prunedKeyValues[key] = { - value: value.value, - op: value.op - }; - break; - - default: - throw new Error("keyValue op: ".concat(value.op, " is not a valid op code")); - } - }); - metadataQuery = metadataQuery + "".concat(JSON.stringify(prunedKeyValues)); - } - } - } - - return "".concat(baseUrl).concat(filterQuery).concat(metadataQuery); -} - -module.exports = exports.default; - -/***/ }), - -/***/ "./src/commands/data/testAuthentication.js": -/*!*************************************************!*\ - !*** ./src/commands/data/testAuthentication.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_991576__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = testAuthentication; - -var _axios = _interopRequireDefault(__nested_webpack_require_991576__(/*! axios */ "./node_modules/axios/index.js")); - -var _constants = __nested_webpack_require_991576__(/*! ./../../constants */ "./src/constants.js"); - -var _validators = __nested_webpack_require_991576__(/*! ../../util/validators */ "./src/util/validators.js"); - -var _errorResponse = __nested_webpack_require_991576__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -/** - * Test Authentication - * @param {string} pinataApiKey - * @param {string} pinataSecretApiKey - * @returns {Promise} - */ -function testAuthentication(pinataApiKey, pinataSecretApiKey) { - (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); // test authentication to make sure that the user's provided keys are legit - - var endpoint = "".concat(_constants.baseUrl, "/data/testAuthentication"); - return new Promise(function (resolve, reject) { - _axios["default"].get(endpoint, { - withCredentials: true, - headers: { - 'pinata_api_key': pinataApiKey, - 'pinata_secret_api_key': pinataSecretApiKey - } - }).then(function (result) { - if (result.status !== 200) { - reject(new Error("unknown server response while authenticating: ".concat(result))); - } - - resolve({ - authenticated: true - }); - })["catch"](function (error) { - var formattedError = (0, _errorResponse.handleError)(error); - reject(formattedError); - }); - }); -} - -; -module.exports = exports.default; - -/***/ }), - -/***/ "./src/commands/data/userPinnedDataTotal.js": -/*!**************************************************!*\ - !*** ./src/commands/data/userPinnedDataTotal.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_993572__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = userPinnedDataTotal; - -var _axios = _interopRequireDefault(__nested_webpack_require_993572__(/*! axios */ "./node_modules/axios/index.js")); - -var _constants = __nested_webpack_require_993572__(/*! ./../../constants */ "./src/constants.js"); - -var _validators = __nested_webpack_require_993572__(/*! ../../util/validators */ "./src/util/validators.js"); - -var _errorResponse = __nested_webpack_require_993572__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -/** - * User Pinned Data Total - * @param {string} pinataApiKey - * @param {string} pinataSecretApiKey - * @returns {Promise} - */ -function userPinnedDataTotal(pinataApiKey, pinataSecretApiKey) { - (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); - var endpoint = "".concat(_constants.baseUrl, "/data/userPinnedDataTotal"); - return new Promise(function (resolve, reject) { - _axios["default"].get(endpoint, { - withCredentials: true, - headers: { - 'pinata_api_key': pinataApiKey, - 'pinata_secret_api_key': pinataSecretApiKey - } - }).then(function (result) { - if (result.status !== 200) { - reject(new Error("unknown server response while attempting to retrieve pinned data total: ".concat(result))); - } - - resolve(result.data); - })["catch"](function (error) { - var formattedError = (0, _errorResponse.handleError)(error); - reject(formattedError); - }); - }); -} - -module.exports = exports.default; - -/***/ }), - -/***/ "./src/commands/pinning/hashMetadata.js": -/*!**********************************************!*\ - !*** ./src/commands/pinning/hashMetadata.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_995478__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = hashMetadata; - -var _axios = _interopRequireDefault(__nested_webpack_require_995478__(/*! axios */ "./node_modules/axios/index.js")); - -var _constants = __nested_webpack_require_995478__(/*! ./../../constants */ "./src/constants.js"); - -var _validators = __nested_webpack_require_995478__(/*! ../../util/validators */ "./src/util/validators.js"); - -var _isIpfs = _interopRequireDefault(__nested_webpack_require_995478__(/*! is-ipfs */ "./node_modules/is-ipfs/src/index.js")); - -var _errorResponse = __nested_webpack_require_995478__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -/** - * Hash Meta Data - * @param {string} pinataApiKey - * @param {string} pinataSecretApiKey - * @param {*} ipfsPinHash - * @param {*} metadata - * @returns {Promise} - */ -function hashMetadata(pinataApiKey, pinataSecretApiKey, ipfsPinHash, metadata) { - (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); - - if (!ipfsPinHash) { - throw new Error('ipfsPinHash value is required for changing the pin policy of a pin'); - } - - if (!_isIpfs["default"].cid(ipfsPinHash)) { - throw new Error('ipfsPinHash value is an invalid IPFS CID'); - } - - if (!metadata) { - throw new Error('no metadata object provided'); - } - - (0, _validators.validateMetadata)(metadata); - var endpoint = "".concat(_constants.baseUrl, "/pinning/hashMetadata"); - var body = { - ipfsPinHash: ipfsPinHash - }; - - if (metadata.name) { - body.name = metadata.name; - } - - if (metadata.keyvalues) { - body.keyvalues = metadata.keyvalues; - } - - return new Promise(function (resolve, reject) { - _axios["default"].put(endpoint, body, { - withCredentials: true, - headers: { - 'pinata_api_key': pinataApiKey, - 'pinata_secret_api_key': pinataSecretApiKey - } - }).then(function (result) { - if (result.status !== 200) { - reject(new Error("unknown server response while changing metadata for hash: ".concat(result))); - } - - resolve(result.data); - })["catch"](function (error) { - var formattedError = (0, _errorResponse.handleError)(error); - reject(formattedError); - }); - }); -} - -module.exports = exports.default; - -/***/ }), - -/***/ "./src/commands/pinning/hashPinPolicy.js": -/*!***********************************************!*\ - !*** ./src/commands/pinning/hashPinPolicy.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_998081__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = hashPinPolicy; - -var _axios = _interopRequireDefault(__nested_webpack_require_998081__(/*! axios */ "./node_modules/axios/index.js")); - -var _constants = __nested_webpack_require_998081__(/*! ./../../constants */ "./src/constants.js"); - -var _validators = __nested_webpack_require_998081__(/*! ../../util/validators */ "./src/util/validators.js"); - -var _isIpfs = _interopRequireDefault(__nested_webpack_require_998081__(/*! is-ipfs */ "./node_modules/is-ipfs/src/index.js")); - -var _errorResponse = __nested_webpack_require_998081__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -/** - * Hash Pin Policy - * @param {string} pinataApiKey - * @param {string} pinataSecretApiKey - * @param {*} ipfsPinHash - * @param {*} newPinPolicy - * @returns {Promise} - */ -function hashPinPolicy(pinataApiKey, pinataSecretApiKey, ipfsPinHash, newPinPolicy) { - (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); - (0, _validators.validatePinPolicyStructure)(newPinPolicy); - - if (!ipfsPinHash) { - throw new Error('ipfsPinHash value is required for changing the pin policy of a pin'); - } - - if (!_isIpfs["default"].cid(ipfsPinHash)) { - throw new Error('ipfsPinHash value is an invalid IPFS CID'); - } - - if (!newPinPolicy) { - throw new Error('newPinPolicy is required for changing the pin policy of a pin'); - } - - var endpoint = "".concat(_constants.baseUrl, "/pinning/hashPinPolicy"); - var body = { - ipfsPinHash: ipfsPinHash, - newPinPolicy: newPinPolicy - }; - return new Promise(function (resolve, reject) { - _axios["default"].put(endpoint, body, { - withCredentials: true, - headers: { - 'pinata_api_key': pinataApiKey, - 'pinata_secret_api_key': pinataSecretApiKey - } - }).then(function (result) { - if (result.status !== 200) { - reject(new Error("unknown server response while changing pin policy for hash: ".concat(result))); - } - - resolve(result.data); - })["catch"](function (error) { - var formattedError = (0, _errorResponse.handleError)(error); - reject(formattedError); - }); - }); -} - -module.exports = exports.default; - -/***/ }), - -/***/ "./src/commands/pinning/pinByHash.js": -/*!*******************************************!*\ - !*** ./src/commands/pinning/pinByHash.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_1000632__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = pinByHash; - -var _axios = _interopRequireDefault(__nested_webpack_require_1000632__(/*! axios */ "./node_modules/axios/index.js")); - -var _constants = __nested_webpack_require_1000632__(/*! ./../../constants */ "./src/constants.js"); - -var _validators = __nested_webpack_require_1000632__(/*! ../../util/validators */ "./src/util/validators.js"); - -var _isIpfs = _interopRequireDefault(__nested_webpack_require_1000632__(/*! is-ipfs */ "./node_modules/is-ipfs/src/index.js")); - -var _errorResponse = __nested_webpack_require_1000632__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -/** - * Pin By Hash - * @param {string} pinataApiKey - * @param {string} pinataSecretApiKey - * @param {*} hashToPin - * @param {*} options - * @returns {Promise} - */ -function pinByHash(pinataApiKey, pinataSecretApiKey, hashToPin, options) { - (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); - - if (!hashToPin) { - throw new Error('hashToPin value is required for pinning by hash'); - } - - if (!_isIpfs["default"].cid(hashToPin)) { - throw new Error('hashToPin value is an invalid IPFS CID'); - } - - var endpoint = "".concat(_constants.baseUrl, "/pinning/pinByHash"); - var body = { - hashToPin: hashToPin, - pinataOptions: {} - }; - - if (options) { - if (options.pinataOptions) { - body.pinataOptions = options.pinataOptions; - } - - if (options.pinataMetadata) { - (0, _validators.validateMetadata)(options.pinataMetadata); - body.pinataMetadata = options.pinataMetadata; - } - } - - return new Promise(function (resolve, reject) { - _axios["default"].post(endpoint, body, { - withCredentials: true, - headers: { - 'pinata_api_key': pinataApiKey, - 'pinata_secret_api_key': pinataSecretApiKey - } - }).then(function (result) { - if (result.status !== 200) { - reject(new Error("unknown server response while adding to pin queue: ".concat(result))); - } - - resolve(result.data); - })["catch"](function (error) { - var formattedError = (0, _errorResponse.handleError)(error); - reject(formattedError); - }); - }); -} - -module.exports = exports.default; - -/***/ }), - -/***/ "./src/commands/pinning/pinFileToIPFS.js": -/*!***********************************************!*\ - !*** ./src/commands/pinning/pinFileToIPFS.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_1003218__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = pinFileToIPFS; - -var _axios = _interopRequireDefault(__nested_webpack_require_1003218__(/*! axios */ "./node_modules/axios/index.js")); - -var _constants = __nested_webpack_require_1003218__(/*! ./../../constants */ "./src/constants.js"); - -var _formData = _interopRequireDefault(__nested_webpack_require_1003218__(/*! form-data */ "./node_modules/form-data/lib/form_data.js")); - -var _stream = _interopRequireDefault(__nested_webpack_require_1003218__(/*! stream */ "stream")); - -var _validators = __nested_webpack_require_1003218__(/*! ../../util/validators */ "./src/util/validators.js"); - -var _errorResponse = __nested_webpack_require_1003218__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -/** - * Pin File to IPFS - * @param {string} pinataApiKey - * @param {string} pinataSecretApiKey - * @param {*} readStream - * @param {*} options - * @returns {Promise} - */ -function pinFileToIPFS(pinataApiKey, pinataSecretApiKey, readStream, options) { - (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); - return new Promise(function (resolve, reject) { - var data = new _formData["default"](); - data.append('file', readStream); - var endpoint = "".concat(_constants.baseUrl, "/pinning/pinFileToIPFS"); - - if (!(readStream instanceof _stream["default"].Readable)) { - reject(new Error('readStream is not a readable stream')); - } - - if (options) { - if (options.pinataMetadata) { - (0, _validators.validateMetadata)(options.pinataMetadata); - data.append('pinataMetadata', JSON.stringify(options.pinataMetadata)); - } - - if (options.pinataOptions) { - (0, _validators.validatePinataOptions)(options.pinataOptions); - data.append('pinataOptions', JSON.stringify(options.pinataOptions)); - } - } - - _axios["default"].post(endpoint, data, { - withCredentials: true, - maxContentLength: 'Infinity', - //this is needed to prevent axios from erroring out with large files - maxBodyLength: 'Infinity', - headers: { - 'Content-type': "multipart/form-data; boundary= ".concat(data._boundary), - 'pinata_api_key': pinataApiKey, - 'pinata_secret_api_key': pinataSecretApiKey - } - }).then(function (result) { - if (result.status !== 200) { - reject(new Error("unknown server response while pinning File to IPFS: ".concat(result))); - } - - resolve(result.data); - })["catch"](function (error) { - var formattedError = (0, _errorResponse.handleError)(error); - reject(formattedError); - }); - }); -} - -module.exports = exports.default; - -/***/ }), - -/***/ "./src/commands/pinning/pinFromFS.js": -/*!*******************************************!*\ - !*** ./src/commands/pinning/pinFromFS.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_1006206__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = pinFromFS; - -var _axios = _interopRequireDefault(__nested_webpack_require_1006206__(/*! axios */ "./node_modules/axios/index.js")); - -var _constants = __nested_webpack_require_1006206__(/*! ./../../constants */ "./src/constants.js"); - -var _formData = _interopRequireDefault(__nested_webpack_require_1006206__(/*! form-data */ "./node_modules/form-data/lib/form_data.js")); - -var _validators = __nested_webpack_require_1006206__(/*! ../../util/validators */ "./src/util/validators.js"); - -var _basePathConverter = _interopRequireDefault(__nested_webpack_require_1006206__(/*! base-path-converter */ "./node_modules/base-path-converter/index.js")); - -var _errorResponse = __nested_webpack_require_1006206__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -var fs = __nested_webpack_require_1006206__(/*! fs */ "fs"); - -var recursive = __nested_webpack_require_1006206__(/*! recursive-fs */ "./node_modules/recursive-fs/index.js"); -/** - * PinFromFS - * @param {string} pinataApiKey - * @param {string} pinataSecretApiKey - * @param {string} sourcePath - * @param {*} options - * @returns {Promise} - */ - - -function pinFromFS(pinataApiKey, pinataSecretApiKey, sourcePath, options) { - (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); - return new Promise(function (resolve, reject) { - var endpoint = "".concat(_constants.baseUrl, "/pinning/pinFileToIPFS"); - fs.stat(sourcePath, function (err, stats) { - if (err) { - reject(err); - } - - if (stats.isFile()) { - //we need to create a single read stream instead of reading the directory recursively - var data = new _formData["default"](); - data.append('file', fs.createReadStream(sourcePath)); - - if (options) { - if (options.pinataMetadata) { - (0, _validators.validateMetadata)(options.pinataMetadata); - data.append('pinataMetadata', JSON.stringify(options.pinataMetadata)); - } - - if (options.pinataOptions) { - (0, _validators.validatePinataOptions)(options.pinataOptions); - data.append('pinataOptions', JSON.stringify(options.pinataOptions)); - } - } - - _axios["default"].post(endpoint, data, { - withCredentials: true, - maxContentLength: 'Infinity', - //this is needed to prevent axios from erroring out with large directories - maxBodyLength: 'Infinity', - headers: { - 'Content-type': "multipart/form-data; boundary= ".concat(data._boundary), - 'pinata_api_key': pinataApiKey, - 'pinata_secret_api_key': pinataSecretApiKey - } - }).then(function (result) { - if (result.status !== 200) { - reject(new Error("unknown server response while pinning File to IPFS: ".concat(result))); - } - - resolve(result.data); - })["catch"](function (error) { - var formattedError = (0, _errorResponse.handleError)(error); - reject(formattedError); - }); - } else { - recursive.readdirr(sourcePath, function (err, dirs, files) { - if (err) { - reject(new Error(err)); - } - - var data = new _formData["default"](); - files.forEach(function (file) { - //for each file stream, we need to include the correct relative file path - data.append('file', fs.createReadStream(file), { - filepath: (0, _basePathConverter["default"])(sourcePath, file) - }); - }); - - if (options) { - if (options.pinataMetadata) { - (0, _validators.validateMetadata)(options.pinataMetadata); - data.append('pinataMetadata', JSON.stringify(options.pinataMetadata)); - } - - if (options.pinataOptions) { - (0, _validators.validatePinataOptions)(options.pinataOptions); - data.append('pinataOptions', JSON.stringify(options.pinataOptions)); - } - } - - _axios["default"].post(endpoint, data, { - withCredentials: true, - maxContentLength: 'Infinity', - maxBodyLength: 'Infinity', - //this is needed to prevent axios from erroring out with large directories - headers: { - 'Content-type': "multipart/form-data; boundary= ".concat(data._boundary), - 'pinata_api_key': pinataApiKey, - 'pinata_secret_api_key': pinataSecretApiKey - } - }).then(function (result) { - if (result.status !== 200) { - reject(new Error("unknown server response while pinning File to IPFS: ".concat(result))); - } - - resolve(result.data); - })["catch"](function (error) { - var formattedError = (0, _errorResponse.handleError)(error); - reject(formattedError); - }); - }); - } - }); - }); -} - -module.exports = exports.default; - -/***/ }), - -/***/ "./src/commands/pinning/pinJSONToIPFS.js": -/*!***********************************************!*\ - !*** ./src/commands/pinning/pinJSONToIPFS.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_1011515__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = pinJSONToIPFS; - -var _axios = _interopRequireDefault(__nested_webpack_require_1011515__(/*! axios */ "./node_modules/axios/index.js")); - -var _constants = __nested_webpack_require_1011515__(/*! ./../../constants */ "./src/constants.js"); - -var _validators = __nested_webpack_require_1011515__(/*! ../../util/validators */ "./src/util/validators.js"); - -var _errorResponse = __nested_webpack_require_1011515__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -/** - * Pin JSON to IPFS - * @param {string} pinataApiKey - * @param {string} pinataSecretApiKey - * @param {*} body - * @param {*} options - * @returns {Promise} - */ -function pinJSONToIPFS(pinataApiKey, pinataSecretApiKey, body, options) { - (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); - var requestBody = body; - - if (_typeof(body) !== 'object') { - throw new Error('body must be a valid JSON object'); - } - - if (options) { - requestBody = { - pinataContent: body - }; - - if (options.pinataMetadata) { - (0, _validators.validateMetadata)(options.pinataMetadata); - requestBody.pinataMetadata = options.pinataMetadata; - } - - if (options.pinataOptions) { - (0, _validators.validatePinataOptions)(options.pinataOptions); - requestBody.pinataOptions = options.pinataOptions; - } - } - - var endpoint = "".concat(_constants.baseUrl, "/pinning/pinJSONToIPFS"); - return new Promise(function (resolve, reject) { - _axios["default"].post(endpoint, requestBody, { - withCredentials: true, - headers: { - 'pinata_api_key': pinataApiKey, - 'pinata_secret_api_key': pinataSecretApiKey - } - }).then(function (result) { - if (result.status !== 200) { - reject(new Error("unknown server response while pinning JSON to IPFS: ".concat(result))); - } - - resolve(result.data); - })["catch"](function (error) { - var formattedError = (0, _errorResponse.handleError)(error); - reject(formattedError); - }); - }); -} - -module.exports = exports.default; - -/***/ }), - -/***/ "./src/commands/pinning/pinJobs/pinJobs.js": -/*!*************************************************!*\ - !*** ./src/commands/pinning/pinJobs/pinJobs.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_1014373__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = pinJobs; - -var _axios = _interopRequireDefault(__nested_webpack_require_1014373__(/*! axios */ "./node_modules/axios/index.js")); - -var _constants = __nested_webpack_require_1014373__(/*! ./../../../constants */ "./src/constants.js"); - -var _validators = __nested_webpack_require_1014373__(/*! ../../../util/validators */ "./src/util/validators.js"); - -var _queryBuilder = _interopRequireDefault(__nested_webpack_require_1014373__(/*! ./queryBuilder */ "./src/commands/pinning/pinJobs/queryBuilder.js")); - -var _errorResponse = __nested_webpack_require_1014373__(/*! ../../../util/errorResponse */ "./src/util/errorResponse.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -/** - * Pin Jobs - * @param {string} pinataApiKey - * @param {string} pinataSecretApiKey - * @param {*} filters - * @returns {Promise} - */ -function pinJobs(pinataApiKey, pinataSecretApiKey, filters) { - (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); - var endpoint = "".concat(_constants.baseUrl, "/pinning/pinJobs"); - - if (filters) { - endpoint = (0, _queryBuilder["default"])(endpoint, filters); - } - - return new Promise(function (resolve, reject) { - _axios["default"].get(endpoint, { - withCredentials: true, - headers: { - 'pinata_api_key': pinataApiKey, - 'pinata_secret_api_key': pinataSecretApiKey - } - }).then(function (result) { - if (result.status !== 200) { - reject(new Error("unknown server response while attempting to retrieve pin jobs: ".concat(result))); - } - - resolve(result.data); - })["catch"](function (error) { - var formattedError = (0, _errorResponse.handleError)(error); - reject(formattedError); - }); - }); -} - -module.exports = exports.default; - -/***/ }), - -/***/ "./src/commands/pinning/pinJobs/queryBuilder.js": -/*!******************************************************!*\ - !*** ./src/commands/pinning/pinJobs/queryBuilder.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_1016521__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = queryBuilder; - -var _isIpfs = _interopRequireDefault(__nested_webpack_require_1016521__(/*! is-ipfs */ "./node_modules/is-ipfs/src/index.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -/** - * Query Buidler - * @param {string} baseUrl - * @param {*} filters - * @returns {*} - */ -function queryBuilder(baseUrl, filters) { - if (!baseUrl) { - throw new Error('no baseUrl provided'); - } - - if (!filters) { - return baseUrl; - } - - var newUrl = baseUrl; - var firstFilterApplied = false; // we want to make sure that the "?" character is only applied once - - function addFilter(newFilter) { - if (firstFilterApplied) { - newUrl = "".concat(newUrl, "&").concat(newFilter); - } else { - firstFilterApplied = true; - newUrl = "".concat(newUrl, "?").concat(newFilter); - } - } - - if (filters) { - // now we need to construct the actual URL based on the given filters provided - if (filters.sort) { - if (filters.sort === 'ASC' || filters.sort === 'DESC') { - addFilter("sort=".concat(filters.sort)); - } else { - throw new Error("Unknown sort value: ".concat(filters.sort, " provided")); - } - } - - if (filters.status) { - if (filters.status === 'searching' || filters.status === 'expired' || filters.status === 'over_free_limit' || filters.status === 'over_max_size' || filters.status === 'invalid_object' || filters.status === 'bad_host_node') { - addFilter("status=".concat(filters.status)); - } else { - throw new Error("Unknown status value: ".concat(filters.status, " provided")); - } - } - - if (filters.ipfs_pin_hash) { - if (_isIpfs["default"].cid(filters.ipfs_pin_hash)) { - addFilter("ipfs_pin_hash=".concat(filters.ipfs_pin_hash)); - } else { - throw new Error("Invalid IPFS hash: ".concat(filters.ipfs_pin_hash)); - } - } - - if (filters.limit) { - if (Number.isInteger(filters.limit) && filters.limit > 0 && filters.limit < 100) { - addFilter("limit=".concat(filters.limit)); - } else { - throw new Error("Invalid limit: ".concat(filters.limit, ". Valid limits are 1-100")); - } - } - - if (filters.offset) { - if (Number.isInteger(filters.offset) && filters.offset > 0) { - addFilter("offset=".concat(filters.offset)); - } else { - throw new Error("Invalid offset: ".concat(filters.offset, ". Please provide a positive integer for the offset")); - } - } - } - - return newUrl; -} - -module.exports = exports.default; - -/***/ }), - -/***/ "./src/commands/pinning/unpin.js": -/*!***************************************!*\ - !*** ./src/commands/pinning/unpin.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_1019420__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = unpin; - -var _axios = _interopRequireDefault(__nested_webpack_require_1019420__(/*! axios */ "./node_modules/axios/index.js")); - -var _constants = __nested_webpack_require_1019420__(/*! ./../../constants */ "./src/constants.js"); - -var _validators = __nested_webpack_require_1019420__(/*! ../../util/validators */ "./src/util/validators.js"); - -var _isIpfs = _interopRequireDefault(__nested_webpack_require_1019420__(/*! is-ipfs */ "./node_modules/is-ipfs/src/index.js")); - -var _errorResponse = __nested_webpack_require_1019420__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -/** - * Unpin - * @param {string} pinataApiKey - * @param {string} pinataSecretApiKey - * @param {string} hashToUnpin - * @returns {Promise} - */ -function unpin(pinataApiKey, pinataSecretApiKey, hashToUnpin) { - (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); - - if (!hashToUnpin) { - throw new Error('hashToUnpin value is required for removing a pin from Pinata'); - } - - if (!_isIpfs["default"].cid(hashToUnpin)) { - throw new Error("".concat(hashToUnpin, " is an invalid IPFS CID")); - } - - var endpoint = "".concat(_constants.baseUrl, "/pinning/unpin/").concat(hashToUnpin); - return new Promise(function (resolve, reject) { - _axios["default"]["delete"](endpoint, { - withCredentials: true, - headers: { - 'pinata_api_key': pinataApiKey, - 'pinata_secret_api_key': pinataSecretApiKey - } - }).then(function (result) { - if (result.status !== 200) { - reject(new Error("unknown server response while removing pin from IPFS: ".concat(result))); - } - - resolve(result.data); - })["catch"](function (error) { - var formattedError = (0, _errorResponse.handleError)(error); - reject(formattedError); - }); - }); -} - -module.exports = exports.default; - -/***/ }), - -/***/ "./src/commands/pinning/userPinPolicy.js": -/*!***********************************************!*\ - !*** ./src/commands/pinning/userPinPolicy.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_1021677__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = userPinPolicy; - -var _axios = _interopRequireDefault(__nested_webpack_require_1021677__(/*! axios */ "./node_modules/axios/index.js")); - -var _constants = __nested_webpack_require_1021677__(/*! ./../../constants */ "./src/constants.js"); - -var _validators = __nested_webpack_require_1021677__(/*! ../../util/validators */ "./src/util/validators.js"); - -var _errorResponse = __nested_webpack_require_1021677__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -/** - * User Pin Policy - * @param {string} pinataApiKey - * @param {string} pinataSecretApiKey - * @param {*} newPinPolicy - * @returns {Promise} - */ -function userPinPolicy(pinataApiKey, pinataSecretApiKey, newPinPolicy) { - (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); - (0, _validators.validatePinPolicyStructure)(newPinPolicy); - - if (!newPinPolicy) { - throw new Error('newPinPolicy is required for changing the pin policy of a pin'); - } - - var endpoint = "".concat(_constants.baseUrl, "/pinning/userPinPolicy"); - var body = { - newPinPolicy: newPinPolicy - }; - return new Promise(function (resolve, reject) { - _axios["default"].put(endpoint, body, { - withCredentials: true, - headers: { - 'pinata_api_key': pinataApiKey, - 'pinata_secret_api_key': pinataSecretApiKey - } - }).then(function (result) { - if (result.status !== 200) { - reject(new Error("unknown server response while changing pin policy for user: ".concat(result))); - } - - resolve(result.data); - })["catch"](function (error) { - var formattedError = (0, _errorResponse.handleError)(error); - reject(formattedError); - }); - }); -} - -module.exports = exports.default; - -/***/ }), - -/***/ "./src/constants.js": -/*!**************************!*\ - !*** ./src/constants.js ***! - \**************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.baseUrl = void 0; -var baseUrl = 'https://api.pinata.cloud'; -exports.baseUrl = baseUrl; - -/***/ }), - -/***/ "./src/index.js": -/*!**********************!*\ - !*** ./src/index.js ***! - \**********************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_1024126__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = pinataClient; - -var _pinByHash = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/pinning/pinByHash */ "./src/commands/pinning/pinByHash.js")); - -var _hashMetadata = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/pinning/hashMetadata */ "./src/commands/pinning/hashMetadata.js")); - -var _hashPinPolicy = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/pinning/hashPinPolicy */ "./src/commands/pinning/hashPinPolicy.js")); - -var _pinFileToIPFS = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/pinning/pinFileToIPFS */ "./src/commands/pinning/pinFileToIPFS.js")); - -var _pinFromFS = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/pinning/pinFromFS */ "./src/commands/pinning/pinFromFS.js")); - -var _pinJSONToIPFS = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/pinning/pinJSONToIPFS */ "./src/commands/pinning/pinJSONToIPFS.js")); - -var _pinJobs = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/pinning/pinJobs/pinJobs */ "./src/commands/pinning/pinJobs/pinJobs.js")); - -var _unpin = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/pinning/unpin */ "./src/commands/pinning/unpin.js")); - -var _userPinPolicy = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/pinning/userPinPolicy */ "./src/commands/pinning/userPinPolicy.js")); - -var _testAuthentication = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/data/testAuthentication */ "./src/commands/data/testAuthentication.js")); - -var _pinList = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/data/pinList/pinList */ "./src/commands/data/pinList/pinList.js")); - -var _userPinnedDataTotal = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/data/userPinnedDataTotal */ "./src/commands/data/userPinnedDataTotal.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -// OPTIONS - -/** - * @typedef {Record} PinataMetadata - */ - -/** - * @typedef PinataMetadataFilter - * @property {string} [name] - * @property {Record} keyvalues - */ - -/** - * @typedef {{id: string, desiredReplicationCount: number}} PinataPinPolicyItem - */ - -/** - * @typedef PinataPinByHashOptions - * @property {string[]} [hostNodes] - * @property {{regions: PinataPinPolicyItem[]}} [customPinPolicy] - */ - -/** - * @typedef PinataPinByHashPinOptions - * @property {PinataMetadata} [pinataMetadata] - * @property {PinataPinByHashOptions} [pinataOptions] - */ - -/** - * @typedef PinataOptions - * @property {0 | 1} [cidVersion] - * @property {boolean} [wrapWithDirectory] - * @property {{regions: PinataPinPolicyItem[]}} [customPinPolicy] - */ - -/** - * @typedef PinataPinOptions - * @property {PinataMetadata} [pinataMetadata] - * @property {PinataOptions} [pinataOptions] - */ - -/** - * @typedef PinataPinJobsFilterOptions - * @property {'ASC' | 'DESC'} sort - * @property {string} [status] - * @property {string} [ipfs_pin_hash] - * @property {number} [limit] - * @property {number} [offset] - */ - -/** - * @typedef PinataPinListFilterOptions - * @property {string} [hashContains] - * @property {string} [pinStart] - * @property {string} [pinEnd] - * @property {string} [unpinStart] - * @property {string} [unpinEnd] - * @property {number} [pinSizeMin] - * @property {number} [pinSizeMax] - * @property {string} [status] - * @property {number} [pageLimit] - * @property {number} [pageOffset] - * @property {PinataMetadataFilter} [metadata] - */ -// RESPONSES - -/** - * @typedef PinataPinByHashResponse - * @property {number | string} id - * @property {string} ipfsHash - * @property {string} status - * @property {string} name - */ - -/** - * @typedef PinataPinResponse - * @property {string} IpfsHash - * @property {number} PinSize - * @property {string} Timestamp - */ - -/** - * @typedef PinataPinJobsResponseRow - * @property {number | string} id - * @property {string} ipfs_pin_hash - * @property {string} date_queued - * @property {string | undefined | null} name - * @property {string} status - */ - -/** - * @typedef PinataPinJobsResponse - * @property {number} count - * @property {PinataPinJobsResponseRow[]} rows - */ - -/** - * @typedef PinataPinListResponseRow - * @property {number | string} id - * @property {string} ipfs_pin_hash - * @property {number} size - * @property {string | number} user_id - * @property {string} date_pinned - * @property {string} date_unpinned - * @property {PinataMetadata} metadata - */ - -/** - * @typedef PinataPinListResponse - * @property {number} count - * @property {PinataPinListResponseRow[]} rows - */ -// METHODS - -/** - * Hash meta data - * @callback hashMetadata - * @param {string} ipfsPinHash - * @param {PinataMetadata} metadata - * @returns {Promise} - */ - -/** - * Hash pin policy - * @callback hashPinPolicy - * @param {string} ipfsPinHash - * @param {{regions: PinataPinPolicyItem[]}} newPinPolicy - * @returns {Promise} - */ - -/** - * Pin by hash - * @callback pinByHash - * @param {string} hashToPin - * @param {PinataPinByHashPinOptions} [options] - * @returns {Promise} - */ - -/** - * Pin file to IPFS - * @callback pinFileToIPFS - * @param {ReadStream} readableStream - * @param {PinataPinOptions} [options] - * @returns {Promise} - */ - -/** - * Pin from FS - * @callback pinFromFS - * @param {string} sourcePath - * @param {PinataPinOptions} [options] - * @returns {Promise} - */ - -/** - * Pin Jobs - * @callback pinJobs - * @param {PinataPinJobsFilterOptions} [filters] - * @returns {Promise} - */ - -/** - * Pin JSON to IPFS - * @callback pinJSONToIPFS - * @param {Object} body - * @param {PinataPinOptions} [options] - * @returns {Promise} - */ - -/** - * Unpin - * @callback unpin - * @param {string} hashToUnpin - * @returns {Promise} - */ - -/** - * User Pin Policy - * @callback userPinPolicy - * @param {{regions: PinataPinPolicyItem[]}} newPinPolicy - * @returns {Promise} - */ - -/** - * Test Authentication - * @callback testAuthentication - * @returns {Promise<{authenticated: boolean}>} - */ - -/** - * Pin List - * @callback pinList - * @param {PinataPinListFilterOptions} [filters] - * @returns {Promise} - */ - -/** - * User Pinned Data Total - * @callback userPinnedDataTotal - * @returns {Promise} - */ - -/** - * @typedef PinataClient - * @property {pinByHash} pinByHash - * @property {hashMetadata} hashMetadata - * @property {hashPinPolicy} hashPinPolicy - * @property {pinFileToIPFS} pinFileToIPFS - * @property {pinFromFS} pinFromFS - * @property {pinJSONToIPFS} pinJSONToIPFS - * @property {pinJobs} pinJobs - * @property {unpin} unpin - * @property {userPinPolicy} userPinPolicy - * @property {testAuthentication} testAuthentication - * @property {pinList} pinList - * @property {userPinnedDataTotal} userPinnedDataTotal - */ - -/** - * Pinata Client - * - * @param {string} pinataApiKey - * @param {string} pinataSecretApiKey - * @returns {PinataClient} - */ -function pinataClient(pinataApiKey, pinataSecretApiKey) { - var client = {}; // setting up the actual calls you can make using this package - - client.pinByHash = function (hashToPin, options) { - return (0, _pinByHash["default"])(pinataApiKey, pinataSecretApiKey, hashToPin, options); - }; - - client.hashMetadata = function (ipfsPinHash, metadata) { - return (0, _hashMetadata["default"])(pinataApiKey, pinataSecretApiKey, ipfsPinHash, metadata); - }; - - client.hashPinPolicy = function (ipfsPinHash, newPinPolicy) { - return (0, _hashPinPolicy["default"])(pinataApiKey, pinataSecretApiKey, ipfsPinHash, newPinPolicy); - }; - - client.pinFileToIPFS = function (readableStream, options) { - return (0, _pinFileToIPFS["default"])(pinataApiKey, pinataSecretApiKey, readableStream, options); - }; - - client.pinFromFS = function (sourcePath, options) { - return (0, _pinFromFS["default"])(pinataApiKey, pinataSecretApiKey, sourcePath, options); - }; - - client.pinJSONToIPFS = function (body, options) { - return (0, _pinJSONToIPFS["default"])(pinataApiKey, pinataSecretApiKey, body, options); - }; - - client.pinJobs = function (filters) { - return (0, _pinJobs["default"])(pinataApiKey, pinataSecretApiKey, filters); - }; - - client.unpin = function (hashToUnpin) { - return (0, _unpin["default"])(pinataApiKey, pinataSecretApiKey, hashToUnpin); - }; - - client.userPinPolicy = function (newPinPolicy) { - return (0, _userPinPolicy["default"])(pinataApiKey, pinataSecretApiKey, newPinPolicy); - }; - - client.testAuthentication = function () { - return (0, _testAuthentication["default"])(pinataApiKey, pinataSecretApiKey); - }; - - client.pinList = function (filters) { - return (0, _pinList["default"])(pinataApiKey, pinataSecretApiKey, filters); - }; - - client.userPinnedDataTotal = function () { - return (0, _userPinnedDataTotal["default"])(pinataApiKey, pinataSecretApiKey); - }; - - return client; -} - -module.exports = exports.default; - -/***/ }), - -/***/ "./src/util/errorResponse.js": -/*!***********************************!*\ - !*** ./src/util/errorResponse.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nccwpck_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.handleError = void 0; - -var handleError = function handleError(error) { - if (error && error.response && error.response && error.response.data && error.response.data.error) { - return error.response.data.error; - } else if (error.data && error.data.error) { - return error.data.error; - } else if (error.response && error.response.error) { - return error.response.error; - } - - return error; -}; - -exports.handleError = handleError; - -/***/ }), - -/***/ "./src/util/validators.js": -/*!********************************!*\ - !*** ./src/util/validators.js ***! - \********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_1034066__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.validateApiKeys = validateApiKeys; -exports.validateHostNodes = validateHostNodes; -exports.validateMetadata = validateMetadata; -exports.validatePinPolicyStructure = validatePinPolicyStructure; -exports.validatePinataOptions = validatePinataOptions; - -var _isIpfs = _interopRequireDefault(__nested_webpack_require_1034066__(/*! is-ipfs */ "./node_modules/is-ipfs/src/index.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -/** - * Validate API Keys - * @param {string} pinataApiKey - * @param {string} pinataSecretApiKey - */ -function validateApiKeys(pinataApiKey, pinataSecretApiKey) { - if (!pinataApiKey || pinataApiKey === '') { - throw new Error('No pinataApiKey provided! Please provide your pinata api key as an argument when you start this script'); - } - - if (!pinataSecretApiKey || pinataSecretApiKey === '') { - throw new Error('No pinataSecretApiKey provided! Please provide your pinata secret api key as an argument when you start this script'); - } -} -/** - * Validate host Nodes - * @param {*} hostNodes - */ - - -function validateHostNodes(hostNodes) { - if (!Array.isArray(hostNodes)) { - throw new Error('host_nodes value must be an array'); - } - - hostNodes.forEach(function (node) { - if (!_isIpfs["default"].peerMultiaddr(node)) { - throw new Error("host_node array entry: ".concat(node, " is not a valid peer multiaddr")); - } - }); -} -/** - * Validate MetaData - * @param {*} metadata - */ - - -function validateMetadata(metadata) { - if (metadata.name) { - if (!(typeof metadata.name === 'string' || metadata.name instanceof String)) { - throw new Error('metadata name must be of type string'); - } - } - - if (metadata.keyvalues) { - if (!(_typeof(metadata.keyvalues) === 'object')) { - throw new Error('metatadata keyvalues must be an object'); - } - - var i = 0; - Object.entries(metadata.keyvalues).forEach(function (keyValue) { - if (i > 9) { - throw new Error('No more than 10 keyvalues can be provided for metadata entries'); - } // we want to make sure that the input is a string, a boolean, or a number, so we don't get an object passed in by accident - - - if (!(typeof keyValue[1] === 'string' || typeof keyValue[1] === 'boolean' || !isNaN(keyValue[1]))) { - throw new Error('Metadata keyvalue values must be strings, booleans, or numbers'); - } - - i++; - }); - } -} -/** - * Validate Pin Policy Structure - * @param {*} pinPolicy - */ - - -function validatePinPolicyStructure(pinPolicy) { - //this function takes in a pin policy and checks the JSON structure to make sure it's valid - if (!pinPolicy) { - throw new Error('No pin policy provided'); - } - - if (!pinPolicy.regions) { - throw new Error('No regions provided in pin policy'); - } - - if (pinPolicy.regions.length) { - pinPolicy.regions.forEach(function (region) { - if (!region.id || !(Object.prototype.toString.call(region.id) === '[object String]')) { - throw new Error('region id must be a string'); - } - - if (!(region.desiredReplicationCount || region.desiredReplicationCount === 0) || !Number.isInteger(region.desiredReplicationCount)) { - throw new Error('desiredReplicationCount must be an integer'); - } - }); - } -} -/** - * Validate Pinata Options - * @param {*} options - */ - - -function validatePinataOptions(options) { - if (_typeof(options) !== 'object') { - throw new Error('options must be an object'); - } - - if (options.cidVersion) { - // eslint-disable-next-line eqeqeq - if (options.cidVersion != 0 && options.cidVersion != 1) { - throw new Error('unsupported or invalid cidVersion'); - } - } - - if (options.wrapWithDirectory) { - // eslint-disable-next-line eqeqeq - if (options.wrapWithDirectory !== true && options.wrapWithDirectory !== false) { - throw new Error('wrapWithDirectory must be a boolean value of true or false'); - } - } - - if (options.hostNodes) { - validateHostNodes(options.hostNodes); - } - - if (options.customPinPolicy) { - validatePinPolicyStructure(options.customPinPolicy); - } -} - -/***/ }), - -/***/ 0: -/*!*******************************************!*\ - !*** multi babel-polyfill ./src/index.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __nested_webpack_require_1038844__) { - -__nested_webpack_require_1038844__(/*! babel-polyfill */"./node_modules/babel-polyfill/lib/index.js"); -module.exports = __nested_webpack_require_1038844__(/*! /Users/mattober/Repos/ipfs/pinata/open-source-tools/Pinata-SDK/src/index.js */"./src/index.js"); - - -/***/ }), - -/***/ "assert": -/*!*************************!*\ - !*** external "assert" ***! - \*************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __nccwpck_require__(39491); - -/***/ }), - -/***/ "buffer": -/*!*************************!*\ - !*** external "buffer" ***! - \*************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __nccwpck_require__(14300); - -/***/ }), - -/***/ "fs": -/*!*********************!*\ - !*** external "fs" ***! - \*********************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __nccwpck_require__(57147); - -/***/ }), - -/***/ "http": -/*!***********************!*\ - !*** external "http" ***! - \***********************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __nccwpck_require__(13685); - -/***/ }), - -/***/ "https": -/*!************************!*\ - !*** external "https" ***! - \************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __nccwpck_require__(95687); - -/***/ }), - -/***/ "os": -/*!*********************!*\ - !*** external "os" ***! - \*********************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __nccwpck_require__(22037); - -/***/ }), - -/***/ "path": -/*!***********************!*\ - !*** external "path" ***! - \***********************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __nccwpck_require__(71017); - -/***/ }), - -/***/ "stream": -/*!*************************!*\ - !*** external "stream" ***! - \*************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __nccwpck_require__(12781); - -/***/ }), - -/***/ "tty": -/*!**********************!*\ - !*** external "tty" ***! - \**********************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __nccwpck_require__(76224); - -/***/ }), - -/***/ "url": -/*!**********************!*\ - !*** external "url" ***! - \**********************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __nccwpck_require__(57310); - -/***/ }), - -/***/ "util": -/*!***********************!*\ - !*** external "util" ***! - \***********************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __nccwpck_require__(73837); - -/***/ }), - -/***/ "zlib": -/*!***********************!*\ - !*** external "zlib" ***! - \***********************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __nccwpck_require__(59796); - -/***/ }) - -/******/ }); -}); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9waW5hdGEtc2RrL3dlYnBhY2svdW5pdmVyc2FsTW9kdWxlRGVmaW5pdGlvbiIsIndlYnBhY2s6Ly9waW5hdGEtc2RrL3dlYnBhY2svYm9vdHN0cmFwIiwid2VicGFjazovL3BpbmF0YS1zZGsvLi9ub2RlX21vZHVsZXMvYXN5bmNraXQvaW5kZXguanMiLCJ3ZWJwYWNrOi8vcGluYXRhLXNkay8uL25vZGVfbW9kdWxlcy9hc3luY2tpdC9saWIvYWJvcnQuanMiLCJ3ZWJwYWNrOi8vcGluYXRhLXNkay8uL25vZGVfbW9kdWxlcy9hc3luY2tpdC9saWIvYXN5bmMuanMiLCJ3ZWJwYWNrOi8vcGluYXRhLXNkay8uL25vZGVfbW9kdWxlcy9hc3luY2tpdC9saWIvZGVmZXIuanMiLCJ3ZWJwYWNrOi8vcGluYXRhLXNkay8uL25vZGVfbW9kdWxlcy9hc3luY2tpdC9saWIvaXRlcmF0ZS5qcyIsIndlYnBhY2s6Ly9waW5hdGEtc2RrLy4vbm9kZV9tb2R1bGVzL2FzeW5ja2l0L2xpYi9zdGF0ZS5qcyIsIndlYnBhY2s6Ly9waW5hdGEtc2RrLy4vbm9kZV9tb2R1bGVzL2FzeW5ja2l0L2xpYi90ZXJtaW5hdG9yLmpzIiwid2VicGFjazovL3BpbmF0YS1zZGsvLi9ub2RlX21vZHVsZXMvYXN5bmNraXQ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gPSBwcm9jZXNzLmVudltwcm94eUVudl0gfHwgcHJvY2Vzcy5lbnZbcHJveHlFbnYudG9VcHBlckNhc2UoKV07XG4gICAgICBpZiAocHJveHlVcmwpIHtcbiAgICAgICAgdmFyIHBhcnNlZFByb3h5VXJsID0gdXJsLnBhcnNlKHByb3h5VXJsKTtcbiAgICAgICAgdmFyIG5vUHJveHlFbnYgPSBwcm9jZXNzLmVudi5ub19wcm94eSB8fCBwcm9jZXNzLmVudi5OT19QUk9YWTtcbiAgICAgICAgdmFyIHNob3VsZFByb3h5ID0gdHJ1ZTtcblxuICAgICAgICBpZiAobm9Qcm94eUVudikge1xuICAgICAgICAgIHZhciBub1Byb3h5ID0gbm9Qcm94eUVudi5zcGxpdCgnLCcpLm1hcChmdW5jdGlvbiB0cmltKHMpIHtcbiAgICAgICAgICAgIHJldHVybiBzLnRyaW0oKTtcbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIHNob3VsZFByb3h5ID0gIW5vUHJveHkuc29tZShmdW5jdGlvbiBwcm94eU1hdGNoKHByb3h5RWxlbWVudCkge1xuICAgICAgICAgICAgaWYgKCFwcm94eUVsZW1lbnQpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHByb3h5RWxlbWVudCA9PT0gJyonKSB7XG4gICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHByb3h5RWxlbWVudFswXSA9PT0gJy4nICYmXG4gICAgICAgICAgICAgICAgcGFyc2VkLmhvc3RuYW1lLnN1YnN0cihwYXJzZWQuaG9zdG5hbWUubGVuZ3RoIC0gcHJveHlFbGVtZW50Lmxlbmd0aCkgPT09IHByb3h5RWxlbWVudCkge1xuICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIHBhcnNlZC5ob3N0bmFtZSA9PT0gcHJveHlFbGVtZW50O1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHNob3VsZFByb3h5KSB7XG4gICAgICAgICAgcHJveHkgPSB7XG4gICAgICAgICAgICBob3N0OiBwYXJzZWRQcm94eVVybC5ob3N0bmFtZSxcbiAgICAgICAgICAgIHBvcnQ6IHBhcnNlZFByb3h5VXJsLnBvcnQsXG4gICAgICAgICAgICBwcm90b2NvbDogcGFyc2VkUHJveHlVcmwucHJvdG9jb2xcbiAgICAgICAgICB9O1xuXG4gICAgICAgICAgaWYgKHBhcnNlZFByb3h5VXJsLmF1dGgpIHtcbiAgICAgICAgICAgIHZhciBwcm94eVVybEF1dGggPSBwYXJzZWRQcm94eVVybC5hdXRoLnNwbGl0KCc6Jyk7XG4gICAgICAgICAgICBwcm94eS5hdXRoID0ge1xuICAgICAgICAgICAgICB1c2VybmFtZTogcHJveHlVcmxBdXRoWzBdLFxuICAgICAgICAgICAgICBwYXNzd29yZDogcHJveHlVcmxBdXRoWzFdXG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIGlmIChwcm94eSkge1xuICAgICAgb3B0aW9ucy5oZWFkZXJzLmhvc3QgPSBwYXJzZWQuaG9zdG5hbWUgKyAocGFyc2VkLnBvcnQgPyAnOicgKyBwYXJzZWQucG9ydCA6ICcnKTtcbiAgICAgIHNldFByb3h5KG9wdGlvbnMsIHByb3h5LCBwcm90b2NvbCArICcvLycgKyBwYXJzZWQuaG9zdG5hbWUgKyAocGFyc2VkLnBvcnQgPyAnOicgKyBwYXJzZWQucG9ydCA6ICcnKSArIG9wdGlvbnMucGF0aCk7XG4gICAgfVxuXG4gICAgdmFyIHRyYW5zcG9ydDtcbiAgICB2YXIgaXNIdHRwc1Byb3h5ID0gaXNIdHRwc1JlcXVlc3QgJiYgKHByb3h5ID8gaXNIdHRwcy50ZXN0KHByb3h5LnByb3RvY29sKSA6IHRyd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gICAgICAgICAgICBjb29raWUucHVzaCgnZG9tYWluPScgKyBkb21haW4pO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChzZWN1cmUgPT09IHRydWUpIHtcbiAgICAgICAgICAgIGNvb2tpZS5wdXNoKCdzZWN1cmUnKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBkb2N1bWVudC5jb29raWUgPSBjb29raWUuam9pbignOyAnKTtcbiAgICAgICAgfSxcblxuICAgICAgICByZWFkOiBmdW5jdGlvbiByZWFkKG5hbWUpIHtcbiAgICAgICAgICB2YXIgbWF0Y2ggPSBkb2N1bWVudC5jb29raWUubWF0Y2gobmV3IFJlZ0V4cCgnKF58O1xcXFxzKikoJyArIG5hbWUgKyAnKT0oW147XSopJykpO1xuICAgICAgICAgIHJldHVybiAobWF0Y2ggPyBkZWNvZGVVUklDb21wb25lbnQobWF0Y2hbM10pIDogbnVsbCk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgcmVtb3ZlOiBmdW5jdGlvbiByZW1vdmUobmFtZSkge1xuICAgICAgICAgIHRoaXMud3JpdGUobmFtZSwgJycsIERhdGUubm93KCkgLSA4NjQwMDAwMCk7XG4gICAgICAgIH1cbiAgICAgIH07XG4gICAgfSkoKSA6XG5cbiAgLy8gTm9uIHN0YW5kYXJkIGJyb3dzZXIgZW52ICh3ZWIgd29ya2VycywgcmVhY3QtbmF0aXZlKSBsYWNrIG5lZWRlZCBzdXBwb3J0LlxuICAgIChmdW5jdGlvbiBub25TdGFuZGFyZEJyb3dzZXJFbnYoKSB7XG4gICAgICByZXR1cm4ge1xuICAgICAgICB3cml0ZTogZnVuY3Rpb24gd3JpdGUoKSB7fSxcbiAgICAgICAgcmVhZDogZnVuY3Rpb24gcmVhZCgpIHsgcmV0dXJuIG51bGw7IH0sXG4gICAgICAgIHJlbW92ZTogZnVuY3Rpb24gcmVtb3ZlKCkge31cbiAgICAgIH07XG4gICAgfSkoKVxuKTtcbiIsIid1c2Ugc3RyaWN0Jztcbl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mICh4IDw9IC0xZTIxIHx8IHggPj0gMWUyMSkgcmV0dXJuIFN0cmluZyh4KTtcbiAgICBpZiAoeCA8IDApIHtcbiAgICAgIHMgPSAnLSc7XG4gICAgICB4ID0gLXg7XG4gICAgfVxuICAgIGlmICh4ID4gMWUtMjEpIHtcbiAgICAgIGUgPSBsb2coeCAqIHBvdygyLCA2OSwgMSkpIC0gNjk7XG4gICAgICB6ID0gZSA8IDAgPyB4ICogcG93KDIsIC1lLCAxKSA6IHggLyBwb3coMiwgZSwgMSk7XG4gICAgICB6ICo9IDB4MTAwMDAwMDAwMDAwMDA7XG4gICAgICBlID0gNTIgLSBlO1xuICAgICAgaWYgKGUgPiAwKSB7XG4gICAgICAgIG11bHRpcGx5KDAsIHopO1xuICAgICAgICBqID0gZjtcbiAgICAgICAgd2hpbGUgKGogPj0gNykge1xuICAgICAgICAgIG11bHRpcGx5KDFlNywgMCk7XG4gICAgICAgICAgaiAtPSA3O1xuICAgICAgICB9XG4gICAgICAgIG11bHRpcGx5KHBvdygxMCwgaiwgMSksIDApO1xuICAgICAgICBqID0gZSAtIDE7XG4gICAgICAgIHdoaWxlIChqID49IDIzKSB7XG4gICAgICAgICAgZGl2aWRlKDEgPDwgMjMpO1xuICAgICAgICAgIGogLT0gMjM7XG4gICAgICAgIH1cbiAgICAgICAgZGl2aWRlKDEgPDwgaik7XG4gICAgICAgIG11bHRpcGx5KDEsIDEpO1xuICAgICAgICBkaXZpZGUoMik7XG4gICAgICAgIG0gPSBudW1Ub1N0cmluZygpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgbXVsdGlwbHkoMCwgeik7XG4gICAgICAgIG11bHRpcGx5KDEgPDwgLWUsIDApO1xuICAgICAgICBtID0gbnVtVG9TdHJpbmcoKSArIHJlcGVhdC5jYWxsKFpFUk8sIGYpO1xuICAgICAgfVxuICAgIH1cbiAgICBpZiAoZiA+IDApIHtcbiAgICAgIGsgPSBtLmxlbmd0aDtcbiAgICAgIG0gPSBzICsgKG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x1ZTtcbiAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGlmIChkb21haW4pIGRvbWFpbi5lbnRlcigpO1xuICAgICAgICAgICAgcmVzdWx0ID0gaGFuZGxlcih2YWx1ZSk7IC8vIG1heSB0aHJvd1xuICAgICAgICAgICAgaWYgKGRvbWFpbikge1xuICAgICAgICAgICAgICBkb21haW4uZXhpdCgpO1xuICAgICAgICAgICAgICBleGl0ZWQgPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAocmVzdWx0ID09PSByZWFjdGlvbi5wcm9taXNlKSB7XG4gICAgICAgICAgICByZWplY3QoVHlwZUVycm9yKCdQcm9taXNlLWNoYWluIGN5Y2xlJykpO1xuICAgICAgICAgIH0gZWxzZSBpZiAodGhlbiA9IGlzVGhlbmFibGUocmVzdWx0KSkge1xuICAgICAgICAgICAgdGhlbi5jYWxsKHJlc3VsdCwgcmVzb2x2ZSwgcmVqZWN0KTtcbiAgICAgICAgICB9IGVsc2UgcmVzb2x2ZShyZXN1bHQpO1xuICAgICAgICB9IGVsc2UgcmVqZWN0KHZhbHVlKTtcbiAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgaWYgKGRvbWFpbiAmJiAhZXhpdGVkKSBkb21haW4uZXhpdCgpO1xuICAgICAgICByZWplY3QoZSk7XG4gICAgICB9XG4gICAgfTtcbiAgICB3aGlsZSAoY2hhaW4ubGVuZ3RoID4gaSkgcnVuKGNoYWluW2krK10pOyAvLyB2YXJpYWJsZSBsZW5ndGggLSBjYW4ndCB1c2UgZm9yRWFjaFxuICAgIHByb21pc2UuX2MgPSBbXTtcbiAgICBwcm9taXNlLl9uID0gZmFsc2U7XG4gICAgaWYgKGlzUmVqZWN0ICYmICFwcm9taXNlLl9oKSBvblVuaGFuZGxlZChwcm9taXNlKTtcbiAgfSk7XG59O1xudmFyIG9uVW5oYW5kbGVkID0gZnVuY3Rpb24gKHByb21pc2UpIHtcbiAgdGF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zogMHhiMzM0LFxuICAnU2tlaW41MTItMTY4JzogMHhiMzM1LFxuICAnU2tlaW41MTItMTc2JzogMHhiMzM2LFxuICAnU2tlaW41MTItMTg0JzogMHhiMzM3LFxuICAnU2tlaW41MTItMTkyJzogMHhiMzM4LFxuICAnU2tlaW41MTItMjAwJzogMHhiMzM5LFxuICAnU2tlaW41MTItMjA4JzogMHhiMzNhLFxuICAnU2tlaW41MTItMjE2JzogMHhiMzNiLFxuICAnU2tlaW41MTItMjI0JzogMHhiMzNjLFxuICAnU2tlaW41MTItMjMyJzogMHhiMzNkLFxuICAnU2tlaW41MTItMjQwJzogMHhiMzNlLFxuICAnU2tlaW41MTItMjQ4JzogMHhiMzNmLFxuICAnU2tlaW41MTItMjU2JzogMHhiMzQwLFxuICAnU2tlaW41MTItMjY0JzogMHhiMzQxLFxuICAnU2tlaW41MTItMjcyJzogMHhiMzQyLFxuICAnU2tlaW41MTItMjgwJzogMHhiMzQzLFxuICAnU2tlaW41MTItMjg4JzogMHhiMzQ0LFxuICAnU2tlaW41MTItMjk2JzogMHhiMzQ1LFxuICAnU2tlaW41MTItMzA0JzogMHhiMzQ2LFxuICAnU2tlaW41MTItMzEyJzogMHhiMzQ3LFxuICAnU2tlaW41MTItMzIwJzogMHhiMzQ4LFxuICAnU2tlaW41MTItMzI4JzogMHhiMzQ5LFxuICAnU2tlaW41MTItMzM2JzogMHhiMzRhLFxuICAnU2tlaW41MTItMzQ0JzogMHhiMzRiLFxuICAnU2tlaW41MTItMzUyJzogMHhiMzRjLFxuICAnU2tlaW41MTItMzYwJzogMHhiMzRkLFxuICAnU2tlaW41MTItMzY4JzogMHhiMzRlLFxuICAnU2tlaW41MTItMzc2JzogMHhiMzRmLFxuICAnU2tlaW41MTItMzg0JzogMHhiMzUwLFxuICAnU2tlaW41MTItMzkyJzogMHhiMzUxLFxuICAnU2tlaW41MTItNDAwJzogMHhiMzUyLFxuICAnU2tlaW41MTItNDA4JzogMHhiMzUzLFxuICAnU2tlaW41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O1xuXG4gICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICB2YXIgZGVsZWdhdGUgPSBjb250ZXh0LmRlbGVnYXRlO1xuICAgICAgICBpZiAoZGVsZWdhdGUpIHtcbiAgICAgICAgICB2YXIgZGVsZWdhdGVSZXN1bHQgPSBtYXliZUludm9rZURlbGVnYXRlKGRlbGVnYXRlLCBjb250ZXh0KTtcbiAgICAgICAgICBpZiAoZGVsZWdhdGVSZXN1bHQpIHtcbiAgICAgICAgICAgIGlmIChkZWxlZ2F0ZVJlc3VsdCA9PT0gQ29udGludWVTZW50aW5lbCkgY29udGludWU7XG4gICAgICAgICAgICByZXR1cm4gZGVsZWdhdGVSZXN1bHQ7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGNvbnRleHQubWV0aG9kID09PSBcIm5leHRcIikge1xuICAgICAgICAgIC8vIFNldHRpbmcgY29udGV4dC5fc2VudCBmb3IgbGVnYWN5IHN1cHBvcnQgb2YgQmFiZWwnc1xuICAgICAgICAgIC8vIGZ1bmN0aW9uLnNlbnQgaW1wbGVtZW50YXRpb24uXG4gICAgICAgICAgY29udGV4dC5zZW50ID0gY29udGV4dC5fc2VudCA9IGNvbnRleHQuYXJnO1xuXG4gICAgICAgIH0gZWxzZSBpZiAoY29udGV4dC5tZXRob2QgPT09IFwidGhyb3dcIikge1xuICAgICAgICAgIGlmIChzdGF0ZSA9PT0gR2VuU3RhdGVTdXNwZW5kZWRTdGFydCkge1xuICAgICAgICAgICAgc3RhdGUgPSBHZW5TdGF0ZUNvbXBsZXRlZDtcbiAgICAgICAgICAgIHRocm93IGNvbnRleHQuYXJnO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGNvbnRleHQuZGlzcGF0Y2hFeGNlcHRpb24oY29udGV4dC5hcmcpO1xuXG4gICAgICAgIH0gZWxzZSBpZiAoY29udGV4dC5tZXRob2QgPT09IFwicmV0dXJuXCIpIHtcbiAgICAgICAgICBjb250ZXh0LmFicnV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hhcyBhIHJldHVybiBtZXRob2QsIGdpdmUgaXQgYVxuICAgICAgICAgIC8vIGNoYW5jZSB0byBjbGVhbiB1cC5cbiAgICAgICAgICBjb250ZXh0Lm1ldGhvZCA9IFwicmV0dXJuXCI7XG4gICAgICAgICAgY29udGV4dC5hcmcgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgbWF5YmVJbnZva2VEZWxlZ2F0ZShkZWxlZ2F0ZSwgY29udGV4dCk7XG5cbiAgICAgICAgICBpZiAoY29udGV4dC5tZXRob2QgPT09IFwidGhyb3dcIikge1xuICAgICAgICAgICAgLy8gSWYgbWF5YmVJbnZva2VEZWxlZ2F0ZShjb250ZXh0KSBjaGFuZ2VkIGNvbnRleHQubWV0aG9kIGZyb21cbiAgICAgICAgICAgIC8vIFwicmV0dXJuXCIgdG8gXCJ0aHJvd1wiLCBsZXQgdGhhdCBvdmVycmlkZSB0aGUgVHlwZUVycm9yIGJlbG93LlxuICAgICAgICAgICAgcmV0dXJuIENvbnRpbnVlU2VudGluZWw7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgY29udGV4dC5tZXRob2QgPSBcInRocm93XCI7XG4gICAgICAgIGNvbnRleHQuYXJnID0gbmV3IFR5cGVFcnJvcihcbiAgICAgICAgICBcIlRoZSBpdGVyYXRvciBkb2VzIG5vdCBwcm92aWRlIGEgJ3Rocm93JyBtZXRob2RcIik7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBDb250aW51ZVNlbnRpbmVsO1xuICAgIH1cblxuICAgIHZhciByZWNvcmQgPSB0cnlDYXRjaChtZXRob2QsIGRlbGVnYXRlLml0ZXJhdG9yLCBjb250ZXh0LmFyZyk7XG5cbiAgICBpZiAocmVjb3JkLnR5cGUgPT09IFwidGhyb3dcIikge1xuICAgICAgY29udGV4dC5tZXRob2QgPSBcInRocm93XCI7XG4gICAgICBjb250ZXh0LmFyZyA9IHJlY29yZC5hcmc7XG4gICAgICBjb250ZXh0LmRlbGVnYXRlID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ytpIDwgaXRlcmFibGUubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAoaGFzT3duLmNhbGwoaXRlcmFibGUsIGkpKSB7XG4gICAgICAgICAgICAgIG5leHQudmFsdWUgPSBpdGVyYWJsZVtpXTtcbiAgICAgICAgICAgICAgbmV4dC5kb25lID0gZmFsc2U7XG4gICAgICAgICAgICAgIHJldHVybiBuZXh0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIG5leHQudmFsdWUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgbmV4dC5kb25lID0gdHJ1ZTtcblxuICAgICAgICAgIHJldHVybiBuZXh0O1xuICAgICAgICB9O1xuXG4gICAgICAgIHJldHVybiBuZXh0Lm5leHQgPSBuZXh0O1xuICAgICAgfVxuICAgIH1cblxuICAgIC8vIFJldHVybiBhbiBpdGVyYXRvciB3aXRoIG5vIHZhbHVlcy5cbiAgICByZXR1cm4geyBuZXh0OiBkb25lUmVzdWx0IH07XG4gIH1cbiAgcnVudGltZS52YWx1ZXMgPSB2YWx1ZXM7XG5cbiAgZnVuY3Rpb24gZG9uZVJlc3VsdCgpIHtcbiAgICByZXR1cm4geyB2YWx1ZTogdW5kZWZpbmVkLCBkb25lOiB0cnVlIH07XG4gIH1cblxuICBDb250ZXh0LnByb3RvdHlwZSA9IHtcbiAgICBjb25zdHJ1Y3RvcjogQ29udGV4dCxcblxuICAgIHJlc2V0OiBmdW5jdGlvbihza2lwVGVtcFJlc2V0KSB7XG4gICAgICB0aGlzLnByZXYgPSAwO1xuICAgICAgdGhpcy5uZXh0ID0gMDtcbiAgICAgIC8vIFJlc2V0dGluZyBjb250ZXh0Ll9zZW50IGZvciBsZWdhY3kgc3VwcG9ydCBvZiBCYWJlbCdzXG4gICAgICAvLyBmdW5jdGlvbi5zZW50IGltcGxlbWVudGF0aW9uLlxuICAgICAgdGhpcy5zZW50ID0gdGhpcy5fc2VudCA9IHVuZGVmaW5lZDtcbiAgICAgIHRoaXMu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dGlvbi5cbiAgICAgICAgICByZXR1cm4gaGFuZGxlKFwiZW5kXCIpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGVudHJ5LnRyeUxvYyA8PSB0aGlzLnByZXYpIHtcbiAgICAgICAgICB2YXIgaGFzQ2F0Y2ggPSBoYXNPd24uY2FsbChlbnRyeSwgXCJjYXRjaExvY1wiKTtcbiAgICAgICAgICB2YXIgaGFzRmluYWxseSA9IGhhc093bi5jYWxsKGVudHJ5LCBcImZpbmFsbHlMb2NcIik7XG5cbiAgICAgICAgICBpZiAoaGFzQ2F0Y2ggJiYgaGFzRmluYWxseSkge1xuICAgICAgICAgICAgaWYgKHRoaXMucHJldiA8IGVudHJ5LmNhdGNoTG9jKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoYW5kbGUoZW50cnkuY2F0Y2hMb2MsIHRydWUpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLnByZXYgPCBlbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoYW5kbGUoZW50cnkuZmluYWxseUxvYyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICB9IGVsc2UgaWYgKGhhc0NhdGNoKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5wcmV2IDwgZW50cnkuY2F0Y2hMb2MpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGhhbmRsZShlbnRyeS5jYXRjaExvYywgdHJ1ZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICB9IGVsc2UgaWYgKGhhc0ZpbmFsbHkpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnByZXYgPCBlbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoYW5kbGUoZW50cnkuZmluYWxseUxvYyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwidHJ5IHN0YXRlbWVudCB3aXRob3V0IGNhdGNoIG9yIGZpbmFsbHlcIik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcblxuICAgIGFicnVwdDogZnVuY3Rpb24odHlwZSwgYXJnKSB7XG4gICAgICBmb3IgKHZhciBpID0gdGhpcy50cnlFbnRyaWVzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBlbnRyeSA9IHRoaXMudHJ5RW50cmllc1tpXTtcbiAgICAgICAgaWYgKGVudHJ5LnRyeUxvYyA8PSB0aGlzLnByZXYgJiZcbiAgICAgICAgICAgIGhhc093bi5jYWxsKGVudHJ5LCBcImZpbmFsbHlMb2NcIikgJiZcbiAgICAgICAgICAgIHRoaXMucHJldiA8IGVudHJ5LmZpbmFsbHlMb2MpIHtcbiAgICAgICAgICB2YXIgZmluYWxseUVudHJ5ID0gZW50cnk7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKGZpbmFsbHlFbnRyeSAmJlxuICAgICAgICAgICh0eXBlID09PSBcImJyZWFrXCIgfHxcbiAgICAgICAgICAgdHlwZSA9PT0gXCJjb250aW51ZVwiKSAmJlxuICAgICAgICAgIGZpbmFsbHlFbnRyeS50cnlMb2MgPD0gYXJnICYmXG4gICAgICAgICAgYXJnIDw9IGZpbmFsbHlFbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgIC8vIElnbm9yZSB0aGUgZmluYWxseSBlbnRyeSBpZiBjb250cm9sIGlzIG5vdCBqdW1waW5nIHRvIGFcbiAgICAgICAgLy8gbG9jYXRpb24gb3V0c2lkZSB0aGUgdHJ5L2NhdGNoIGJsb2NrLlxuICAgICAgICBmaW5hbGx5RW50cnkgPSBudWxsO1xuICAgICAgfVxuXG4gICAgICB2YXIgcmVjb3JkID0gZmluYWxseUVudHJ5ID8gZmluYWxseUVudHJ5LmNvbXBsZXRpb24gOiB7fTtcbiAgICAgIHJlY29yZC50eXBlID0gdHlwZTtcbiAgICAgIHJlY29yZC5hcmcgPSBhcmc7XG5cbiAgICAgIGlmIChmaW5hbGx5RW50cnkpIHtcbiAgICAgICAgdGhpcy5tZXRob2QgPSBcIm5leHRcIjtcbiAgICAgICAgdGhpcy5uZXh0ID0gZmluYWxseUVudHJ5LmZpbmFsbHlMb2M7XG4gICAgICAgIHJldHVybiBDb250aW51ZVNlbnRpbmVsO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gdGhpcy5jb21wbGV0ZShyZWNvcmQpO1xuICAgIH0sXG5cbiAgICBjb21wbGV0ZTogZnVuY3Rpb24ocmVjb3JkLCBhZnRlckxvYykge1xuICAgICAgaWYgKHJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgICAgdGhyb3cgcmVjb3JkLmFyZztcbiAgICAgIH1cblxuICAgICAgaWYgKHJlY29yZC50eXBlID09PSBcImJyZWFrXCIgfHxcbiAgICAgICAgICByZWNvcmQudHlwZSA9PT0gXCJjb250aW51ZVwiKSB7XG4gICAgICAgIHRoaXMubmV4dCA9IHJlY29yZC5hcmc7XG4gICAgICB9IGVsc2UgaWYgKHJlY29yZC50eXBlID09PSBcInJldHVyblwiKSB7XG4gICAgICAgIHRoaXMucnZhbCA9IHRoaXMuYXJnID0gcmVjb3JkLmFyZztcbiAgICAgICAgdGhpcy5tZXRob2QgPSBcInJldHVyblwiO1xuICAgICAgICB0aGlzLm5leHQgPSBcImVuZFwiO1xuICAgICAgfSBlbHNlIGlmIChyZWNvcmQudHlwZSA9PT0gXCJub3JtYWxcIiAmJiBhZnRlckxvYykge1xuICAgICAgICB0aGlzLm5leHQgPSBhZnRlckxvYztcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIENvbnRpbnVlU2VudGluZWw7XG4gICAgfSxcblxuICAgIGZpbmlzaDogZnVuY3Rpb24oZmluYWxseUxvYykge1xuICAgICAgZm9yICh2YXIgaSA9IHRoaXMudHJ5RW50cmllcy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICB2YXIgZW50cnkgPSB0aGlzLnRyeUVudHJpZXNbaV07XG4gICAgICAgIGlmIChlbnRyeS5maW5hbGx5TG9jID09PSBmaW5hbGx5TG9jKSB7XG4gICAgICAgICAgdGhpcy5jb21wbGV0ZShlbnRyeS5jb21wbGV0aW9uLCBlbnRyeS5hZnRlckxvYyk7XG4gICAgICAgICAgcmVzZXRUcnlFbnRyeShlbnRyeSk7XG4gICAgICAgICAgcmV0dXJuIENvbnRpbnVlU2VudGluZWw7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuXG4gICAgXCJjYXRjaFwiOiBmdW5jdGlvbih0cnlMb2MpIHtcbiAgICAgIGZvciAodmFyIGkgPSB0aGlzLnRyeUVudHJpZXMubGVuZ3RoIC0gMTsgaSA+PSAwOyAtLWkpIHtcbiAgICAgICAgdmFyIGVudHJ5ID0gdGhpcy50cnlFbnRyaWVzW2ldO1xuICAgICAgICBpZiAoZW50cnkudHJ5TG9jID09PSB0cnlMb2MpIHtcbiAgICAgICAgICB2YXIgcmVjb3JkID0gZW50cnkuY29tcGxldGlvbjtcbiAgICAgICAgICBpZiAocmVjb3JkLnR5cGUgPT09IFwidGhyb3dcIikge1xuICAgICAgICAgICAgdmFyIHRocm93biA9IHJlY29yZC5hcmc7XG4gICAgICAgICAgICByZXNldFRyeUVudHJ5KGVudHJ5KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIHRocm93bjtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvLyBUaGUgY29udGV4dC5jYXRjaCBtZXRob2QgbXVzdCBvbmx5IGJlIGNhbGxlZCB3aXRoIGEgbG9jYXRpb25cbiAgICAgIC8vIGFyZ3VtZW50IHRoYXQgY29ycmVzcG9uZHMgdG8gYSBrbm93biBjYXRjaCBibG9jay5cbiAgICAgIHRocm93IG5ldyBFcnJvcihcImlsbGVnYWwgY2F0Y2ggYXR0ZW1wdFwiKTtcbiA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hbHVlICE9PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBrZXlWYWx1ZTogJHtrZXl9IGlzIG5vdCBhbiBvYmplY3RgKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoIXZhbHVlIHx8ICF2YWx1ZS52YWx1ZSB8fCAhdmFsdWUub3ApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihga2V5VmFsdWU6ICR7a2V5fSBtdXN0IGhhdmUgYm90aCB2YWx1ZSBhbmQgb3AgYXR0cmlidXRlc2ApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgodHlwZW9mIHZhbHVlLnZhbHVlICE9PSAnc3RyaW5nJykgJiYgKHR5cGVvZiB2YWx1ZS52YWx1ZSAhPT0gJ2Jvb2xlYW4nKSAmJiAodHlwZW9mIHZhbHVlLnZhbHVlICE9PSAnbnVtYmVyJykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignTWV0YWRhdGEga2V5dmFsdWUgdmFsdWVzIG11c3QgYmUgc3RyaW5ncywgYm9vbGVhbnMsIG9yIG51bWJlcnMnKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIC8vIFJ1biBjaGVja3MgdG8gbWFrZSBzdXJlIGFsbCBvZiB0aGUga2V5dmFsdWVzIGFyZSB2YWxpZFxuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHZhbHVlLm9wKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdndCc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJ1bmVkS2V5VmFsdWVzW2tleV0gPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWx1ZS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3A6IHZhbHVlLm9wXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZ3JlYXRlciB0aGFuIG9yIGVxdWFsXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdndGUnOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBydW5lZEtleVZhbHVlc1trZXldID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdmFsdWUudmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wOiB2YWx1ZS5vcFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBsZXNzIHRoYW5cbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2x0JzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcnVuZWRLZXlWYWx1ZXNba2V5XSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHZhbHVlLnZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcDogdmFsdWUub3BcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbGVzcyB0aGFuIG9yIGVxdWFsXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdsdGUnOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBydW5lZEtleVZhbHVlc1trZXldID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdmFsdWUudmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wOiB2YWx1ZS5vcFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBub3QgZXF1YWwgdG9cbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ25lJzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcnVuZWRLZXlWYWx1ZXNba2V5XSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHZhbHVlLnZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcDogdmFsdWUub3BcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZXF1YWwgdG9cbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2VxJzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcnVuZWRLZXlWYWx1ZXNba2V5XSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHZhbHVlLnZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcDogdmFsdWUub3BcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYmV0d2VlblxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnYmV0d2Vlbic6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF2YWx1ZS5zZWNvbmRWYWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYEJlY2F1c2UgYmV0d2VlbiBvcCBjb2RlIHdhcyBwYXNzZWQgaW4sIGtleVZhbHVlOiAke2tleVZhbHVlWzBdfSBtdXN0IGhhdmUgYm90aCBhbHNvIGluY2x1ZGUgYSBzZWNvbmRWYWx1ZWApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHR5cGVvZiB2YWx1ZS5zZWNvbmRWYWx1ZSAhPT0gJ3N0cmluZycpICYmICh0eXBlb2YgdmFsdWUuc2Vjb25kVmFsdWUgIT09ICdib29sZWFuJykgJiYgKHR5cGVvZiB2YWx1ZS5zZWNvbmRWYWx1ZSAhPT0gJ251bWJlcicpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignTWV0YWRhdGEga2V5dmFsdWUgc2Vjb25kVmFsdWUgbXVzdCBiZSBhIHN0cmluZywgYm9vbGVhbiwgb3IgbnVtYmVyJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBydW5lZEtleVZhbHVlc1trZXldID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdmFsdWUudmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wOiB2YWx1ZS5vcCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vjb25kVmFsdWU6IHZhbHVlLnNlY29uZFZhbHVlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vdCBiZXR3ZWVuXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdub3RCZXR3ZWVuJzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXZhbHVlLnNlY29uZFZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgQmVjYXVzZSBub3RCZXR3ZWVuIG9wIGNvZGUgd2FzIHBhc3NlZCBpbiwga2V5VmFsdWU6ICR7a2V5VmFsdWVbMF19IG11c3QgaGF2ZSBib3RoIGFsc28gaW5jbHVkZSBhIHNlY29uZFZhbHVlYCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodHlwZW9mIHZhbHVlLnNlY29uZFZhbHVlICE9PSAnc3RyaW5nJykgJiYgKHR5cGVvZiB2YWx1ZS5zZWNvbmRWYWx1ZSAhPT0gJ2Jvb2xlYW4nKSAmJiAodHlwZW9mIHZhbHVlLnNlY29uZFZhbHVlICE9PSAnbnVtYmVyJykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdNZXRhZGF0YSBrZXl2YWx1ZSBzZWNvbmRWYWx1ZSBtdXN0IGJlIGEgc3RyaW5nLCBib29sZWFuLCBvciBudW1iZXInKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJ1bmVkS2V5VmFsdWVzW2tleV0gPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWx1ZS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3A6IHZhbHVlLm9wLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWNvbmRWYWx1ZTogdmFsdWUuc2Vjb25kVmFsdWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbGlrZVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnbGlrZSc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJ1bmVkS2V5VmFsdWVzW2tleV0gPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWx1ZS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3A6IHZhbHVlLm9wXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vdCBsaWtlXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdub3RMaWtlJzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcnVuZWRLZXlWYWx1ZXNba2V5XSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHZhbHVlLnZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcDogdmFsdWUub3BcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2FzZSBpbnNlbnNpdGl2ZSBsaWtlXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdpTGlrZSc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJ1bmVkS2V5VmFsdWVzW2tleV0gPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWx1ZS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3A6IHZhbHVlLm9wXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNhc2UgaW5zZW5zaXRpdmUgbm90IGxpa2VcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ25vdElMaWtlJzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcnVuZWRLZXlWYWx1ZXNba2V5XSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHZhbHVlLnZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcDogdmFsdWUub3BcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVnZXhcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3JlZ2V4cCc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJ1bmVkS2V5VmFsdWVzW2tleV0gPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWx1ZS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3A6IHZhbHVlLm9wXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNhc2UgaW5zZW5zaXRpdmUgcmVnZXhcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2lSZWdleHAnOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBydW5lZEtleVZhbHVlc1trZXldID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdmFsdWUudmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wOiB2YWx1ZS5vcFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihga2V5VmFsdWUgb3A6ICR7dmFsdWUub3B9IGlzIG5vdCBhIHZhbGlkIG9wIGNvZGVgKTtcbiAgICAg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GEvdGVzdEF1dGhlbnRpY2F0aW9uYDtcblxuICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICAgIGF4aW9zLmdldChcbiAgICAgICAgICAgIGVuZHBvaW50LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHdpdGhDcmVkZW50aWFsczogdHJ1ZSxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XG4gICAgICAgICAgICAgICAgICAgICdwaW5hdGFfYXBpX2tleSc6IHBpbmF0YUFwaUtleSxcbiAgICAgICAgICAgICAgICAgICAgJ3BpbmF0YV9zZWNyZXRfYXBpX2tleSc6IHBpbmF0YVNlY3JldEFwaUtleVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pLnRoZW4oZnVuY3Rpb24gKHJlc3VsdCkge1xuICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgIT09IDIwMCkge1xuICAgICAgICAgICAgICAgIHJlamVjdChuZXcgRXJyb3IoYHVua25vd24gc2VydmVyIHJlc3BvbnNlIHdoaWxlIGF1dGhlbnRpY2F0aW5nOiAke3Jlc3VsdH1gKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXNvbHZlKHtcbiAgICAgICAgICAgICAgICBhdXRoZW50aWNhdGVkOiB0cnVlXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSkuY2F0Y2goZnVuY3Rpb24gKGVycm9yKSB7XG4gICAgICAgICAgICBjb25zdCBmb3JtYXR0ZWRFcnJvciA9IGhhbmRsZUVycm9yKGVycm9yKTtcbiAgICAgICAgICAgIHJlamVjdChmb3JtYXR0ZWRFcnJvcik7XG4gICAgICAgIH0pO1xuICAgIH0pO1xufTtcbiIsImltcG9ydCBheGlvcyBmcm9tICdheGlvcyc7XG5pbXBvcnQgeyBiYXNlVXJsIH0gZnJvbSAnLi8uLi8uLi9jb25zdGFudHMnO1xuaW1wb3J0IHsgdmFsaWRhd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AgIGVuZHBvaW50LFxuICAgICAgICAgICAgYm9keSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB3aXRoQ3JlZGVudGlhbHM6IHRydWUsXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgICAgICAncGluYXRhX2FwaV9rZXknOiBwaW5hdGFBcGlLZXksXG4gICAgICAgICAgICAgICAgICAgICdwaW5hdGFfc2VjcmV0X2FwaV9rZXknOiBwaW5hdGFTZWNyZXRBcGlLZXlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KS50aGVuKGZ1bmN0aW9uIChyZXN1bHQpIHtcbiAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzICE9PSAyMDApIHtcbiAgICAgICAgICAgICAgICByZWplY3QobmV3IEVycm9yKGB1bmtub3duIHNlcnZlciByZXNwb25zZSB3aGlsZSBjaGFuZ2luZyBtZXRhZGF0YSBmb3IgaGFzaDogJHtyZXN1bHR9YCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzb2x2ZShyZXN1bHQuZGF0YSk7XG4gICAgICAgIH0pLmNhdGNoKGZ1bmN0aW9uIChlcnJvcikge1xuICAgICAgICAgICAgY29uc3QgZm9ybWF0dGVkRXJyb3IgPSBoYW5kbGVFcnJvcihlcnJvcik7XG4gICAgICAgICAgICByZWplY3QoZm9ybWF0dGVkRXJyb3IpO1xuICAgICAgICB9KTtcbiAgICB9KTtcbn1cbiIsImltcG9ydCBheGlvcyBmcm9tICdheGlvcyc7XG5pbXBvcnQgeyBiYXNlVXJsIH0gZnJvbSAnLi8uLi8uLi9jb25zdGFudHMnO1xuaW1wb3J0IHsgdmFsaWRhdGVBcGlLZXlzLCB2YWxpZGF0ZVBpblBvbGljeVN0cnVjdHVyZSB9IGZyb20gJy4uLy4uL3V0aWwvdmFsaWRhdG9ycyc7XG5pbXBvcnQgaXNJUEZTIGZyb20gJ2lzLWlwZnMnO1xuaW1wb3J0IHsg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uXG4gICAgY29uc3QgZW5kcG9pbnQgPSBgJHtiYXNlVXJsfS9waW5uaW5nL2hhc2hQaW5Qb2xpY3lgO1xuICAgIGNvbnN0IGJvZHkgPSB7XG4gICAgICAgIGlwZnNQaW5IYXNoOiBpcGZzUGluSGFzaCxcbiAgICAgICAgbmV3UGluUG9saWN5OiBuZXdQaW5Qb2xpY3lcbiAgICB9O1xuXG4gICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgICAgYXhpb3MucHV0KFxuICAgICAgICAgICAgZW5kcG9pbnQsXG4gICAgICAgICAgICBib2R5LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHdpdGhDcmVkZW50aWFsczogdHJ1ZSxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XG4gICAgICAgICAgICAgICAgICAgICdwaW5hdGFfYXBpX2tleSc6IHBpbmF0YUFwaUtleSxcbiAgICAgICAgICAgICAgICAgICAgJ3BpbmF0YV9zZWNyZXRfYXBpX2tleSc6IHBpbmF0YVNlY3JldEFwaUtleVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pLnRoZW4oZnVuY3Rpb24gKHJlc3VsdCkge1xuICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgIT09IDIwMCkge1xuICAgICAgICAgICAgICAgIHJlamVjdChuZXcgRXJyb3IoYHVua25vd24gc2VydmVyIHJlc3BvbnNlIHdoaWxlIGNoYW5naW5nIHBpbiBwb2xpY3kgZm9yIGhhc2g6ICR7cmVzdWx0fWApKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc29sdmUocmVzdWx0LmRhdGEpO1xuICAgICAgICB9KS5jYXRjaChmdW5jdGlvbiAoZXJyb3IpIHtcbiAgICAgICAgICAgIGNvbnN0IGZvcm1hdHRlZEVycm9yID0gaGFuZGxlRXJyb3IoZXJyb3IpO1xuICAgICAgICAgICAgcmVqZWN0KGZvcm1hd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hbGlkIElQRlMgQ0lEJyk7XG4gICAgfVxuXG4gICAgY29uc3QgZW5kcG9pbnQgPSBgJHtiYXNlVXJsfS9waW5uaW5nL3BpbkJ5SGFzaGA7XG4gICAgY29uc3QgYm9keSA9IHtcbiAgICAgICAgaGFzaFRvUGluOiBoYXNoVG9QaW4sXG4gICAgICAgIHBpbmF0YU9wdGlvbnM6IHt9XG4gICAgfTtcblxuICAgIGlmIChvcHRpb25zKSB7XG4gICAgICAgIGlmIChvcHRpb25zLnBpbmF0YU9wdGlvbnMpIHtcbiAgICAgICAgICAgIGJvZHkucGluYXRhT3B0aW9ucyA9IG9wdGlvbnMucGluYXRhT3B0aW9ucztcbiAgICAgICAgfVxuICAgICAgICBpZiAob3B0aW9ucy5waW5hdGFNZXRhZGF0YSkge1xuICAgICAgICAgICAgdmFsaWRhdGVNZXRhZGF0YShvcHRpb25zLnBpbmF0YU1ldGFkYXRhKTtcbiAgICAgICAgICAgIGJvZHkucGluYXRhTWV0YWRhdGEgPSBvcHRpb25zLnBpbmF0YU1ldGFkYXRhO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgICAgYXhpb3MucG9zdChcbiAgICAgICAgICAgIGVuZHBvaW50LFxuICAgICAgICAgICAgYm9keSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB3aXRoQ3JlZGVudGlhbHM6IHRydWUsXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgICAgICAncGluYXRhX2FwaV9rZXknOiBwaW5hdGFBcGlLZXksXG4gICAgICAgICAgICAgICAgICAgICdwaW5hdGFfc2VjcmV0X2FwaV9rZXknOiBwaW5hdGFTZWNyZXRBcGlLZXlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KS50aGVuKGZ1bmN0aW9uIChyZXN1bHQpIHtcbiAgICAgICAgICAgIGlmIChyZXN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7XG4gICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoJ3BpbmF0YU9wdGlvbnMnLCBKU09OLnN0cmluZ2lmeShvcHRpb25zLnBpbmF0YU9wdGlvbnMpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGF4aW9zLnBvc3QoXG4gICAgICAgICAgICBlbmRwb2ludCxcbiAgICAgICAgICAgIGRhdGEsXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgd2l0aENyZWRlbnRpYWxzOiB0cnVlLFxuICAgICAgICAgICAgICAgIG1heENvbnRlbnRMZW5ndGg6ICdJbmZpbml0eScsIC8vdGhpcyBpcyBuZWVkZWQgdG8gcHJldmVudCBheGlvcyBmcm9tIGVycm9yaW5nIG91dCB3aXRoIGxhcmdlIGZpbGVzXG4gICAgICAgICAgICAgICAgbWF4Qm9keUxlbmd0aDogJ0luZmluaXR5JyxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XG4gICAgICAgICAgICAgICAgICAgICdDb250ZW50LXR5cGUnOiBgbXVsdGlwYXJ0L2Zvcm0tZGF0YTsgYm91bmRhcnk9ICR7ZGF0YS5fYm91bmRhcnl9YCxcbiAgICAgICAgICAgICAgICAgICAgJ3BpbmF0YV9hcGlfa2V5JzogcGluYXRhQXBpS2V5LFxuICAgICAgICAgICAgICAgICAgICAncGluYXRhX3NlY3JldF9hcGlfa2V5JzogcGluYXRhU2VjcmV0QXBpS2V5XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSkudGhlbihmdW5jdGlvbiAocmVzdWx0KSB7XG4gICAgICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyAhPT0gMjAwKSB7XG4gICAgICAgICAgICAgICAgcmVqZWN0KG5ldyBFcnJvcihgdW5rbm93biBzZXJ2ZXIgcmVzcG9uc2Ugd2hpbGUgcGlubmluZyBGaWxlIHRvIElQRlM6ICR7cmVzdWx0fWApKTtcbiAgICAgICAgICAgIH1cbiAgICAgICA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ZXRhZGF0YSkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLnBpbmF0YU9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbGlkYXRlUGluYXRhT3B0aW9ucyhvcHRpb25zLnBpbmF0YU9wdGlvbnMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoJ3BpbmF0YU9wdGlvbnMnLCBKU09OLnN0cmluZ2lmeShvcHRpb25zLnBpbmF0YU9wdGlvbnMpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGF4aW9zLnBvc3QoXG4gICAgICAgICAgICAgICAgICAgIGVuZHBvaW50LFxuICAgICAgICAgICAgICAgICAgICBkYXRhLFxuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3aXRoQ3JlZGVudGlhbHM6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXhDb250ZW50TGVuZ3RoOiAnSW5maW5pdHknLCAvL3RoaXMgaXMgbmVlZGVkIHRvIHByZXZlbnQgYXhpb3MgZnJvbSBlcnJvcmluZyBvdXQgd2l0aCBsYXJnZSBkaXJlY3Rvcmllc1xuICAgICAgICAgICAgICAgICAgICAgICAgbWF4Qm9keUxlbmd0aDogJ0luZmluaXR5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnQ29udGVudC10eXBlJzogYG11bHRpcGFydC9mb3JtLWRhdGE7IGJvdW5kYXJ5PSAke2RhdGEuX2JvdW5kYXJ5fWAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3BpbmF0YV9hcGlfa2V5JzogcGluYXRhQXBpS2V5LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdwaW5hdGFfc2VjcmV0X2FwaV9rZXknOiBwaW5hdGFTZWNyZXRBcGlLZXlcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSkudGhlbihmdW5jdGlvbiAocmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzICE9PSAyMDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChuZXcgRXJyb3IoYHVua25vd24gc2VydmVyIHJlc3BvbnNlIHdoaWxlIHBpbm5pbmcgRmlsZSB0byBJUEZTOiAke3Jlc3VsdH1gKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShyZXN1bHQuZGF0YSk7XG4gICAgICAgICAgICAgICAgfSkuY2F0Y2goZnVuY3Rpb24gKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGZvcm1hdHRlZEVycm9yID0gaGFuZGxlRXJyb3IoZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZm9ybWF0dGVkRXJyb3IpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZWN1cnNpdmUucmVhZGRpcnIoc291cmNlUGF0aCwgZnVuY3Rpb24gKGVyciwgZGlycywgZmlsZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KG5ldyBFcnJvcihlcnIpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGxldCBkYXRhID0gbmV3IE5vZGVGb3JtRGF0YSgpO1xuXG4gICAgICAgICAgICAgICAgICAgIGZpbGVzLmZvckVhY2goKGZpbGUpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZm9yIGVhY2ggZmlsZSBzdHJlYW0sIHdlIG5lZWQgdG8gaW5jbHVkZSB0aGUgY29ycmVjdCByZWxhdGl2ZSBmaWxlIHBhdGhcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKCdmaWxlJywgZnMuY3JlYXRlUmVhZFN0cmVhbShmaWxlKSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVwYXRoOiBiYXNlUGF0aENvbnZlcnRlcihzb3VyY2VQYXRoLCBmaWxlKVxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5waW5hdGFNZXRhZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbGlkYXRlTWV0YWRhdGEob3B0aW9ucy5waW5hdGFNZXRhZGF0YSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoJ3BpbmF0YU1ldGFkYXRhJywgSlNPTi5zdHJpbmdpZnkob3B0aW9ucy5waW5hdGFNZXRhZGF0YSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMucGluYXRhT3B0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbGlkYXRlUGluYXRhT3B0aW9ucyhvcHRpb25zLnBpbmF0YU9wdGlvbnMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKCdwaW5hdGFPcHRpb25zJywgSlNPTi5zdHJpbmdpZnkob3B0aW9ucy5waW5hdGFPcHRpb25zKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBheGlvcy5wb3N0KFxuICAgICAgICAgICAgICAgICAgICAgICAgZW5kcG9pbnQsXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhLFxuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhDcmVkZW50aWFsczogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhDb250ZW50TGVuZ3RoOiAnSW5maW5pdHknLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heEJvZHlMZW5ndGg6ICdJbmZpbml0eScsIC8vdGhpcyBpcyBuZWVkZWQgdG8gcHJldmVudCBheGlvcyBmcm9tIGVycm9yaW5nIG91dCB3aXRoIGxhcmdlIGRpcmVjdG9yaWVzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnQ29udGVudC10eXBlJzogYG11bHRpcGFydC9mb3JtLWRhdGE7IGJvdW5kYXJ5PSAke2RhdGEuX2JvdW5kYXJ5fWAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdwaW5hdGFfYXBpX2tleSc6IHBpbmF0YUFwaUtleSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3BpbmF0YV9zZWNyZXRfYXBpX2tleSc6IHBpbmF0YVNlY3JldEFwaUtleVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLnRoZW4oZnVuY3Rpb24gKHJlc3VsdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgIT09IDIwMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChuZXcgRXJyb3IoYHVua25vd24gc2VydmVyIHJlc3BvbnNlIHdoaWxlIHBpbm5pbmcgRmlsZSB0byBJUEZTOiAke3Jlc3VsdH1gKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHJlc3VsdC5kYXRhKT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W5nfSBwaW5hdGFTZWNyZXRBcGlLZXlcbiAqIEBwYXJhbSB7Kn0gZmlsdGVyc1xuICogQHJldHVybnMge1Byb21pc2U8dW5rbm93bj59XG4gKi9cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIHBpbkpvYnMocGluYXRhQXBpS2V5LCBwaW5hdGFTZWNyZXRBcGlLZXksIGZpbHRlcnMpIHtcbiAgICB2YWxpZGF0ZUFwaUtleXMocGluYXRhQXBpS2V5LCBwaW5hdGFTZWNyZXRBcGlLZXkpO1xuXG4gICAgbGV0IGVuZHBvaW50ID0gYCR7YmFzZVVybH0vcGlubmluZy9waW5Kb2JzYDtcblxuICAgIGlmIChmaWx0ZXJzKSB7XG4gICAgICAgIGVuZHBvaW50ID0gcXVlcnlCdWlsZGVyKGVuZHBvaW50LCBmaWx0ZXJzKTtcbiAgICB9XG5cbiAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgICBheGlvcy5nZXQoXG4gICAgICAgICAgICBlbmRwb2ludCxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB3aXRoQ3JlZGVudGlhbHM6IHRydWUsXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgICAgICAncGluYXRhX2FwaV9rZXknOiBwaW5hdGFBcGlLZXksXG4gICAgICAgICAgICAgICAgICAgICdwaW5hdGFfc2VjcmV0X2FwaV9rZXknOiBwaW5hdGFTZWNyZXRBcGlLZXlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KS50aGVuKGZ1bmN0aW9uIChyZXN1bHQpIHtcbiAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzICE9PSAyMDApIHtcbiAgICAgICAgICAgICAgICByZWplY3QobmV3IEVycm9yKGB1bmtub3duIHNlcnZlciByZXNwb25zZSB3aGlsZSBhdHRlbXB0aW5nIHRvIHJldHJpZXZlIHBpbiBqb2JzOiAke3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GFzaFRvVW5waW4pIHtcbiAgICB2YWxpZGF0ZUFwaUtleXMocGluYXRhQXBpS2V5LCBwaW5hdGFTZWNyZXRBcGlLZXkpO1xuXG4gICAgaWYgKCFoYXNoVG9VbnBpbikge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ2hhc2hUb1VucGluIHZhbHVlIGlzIHJlcXVpcmVkIGZvciByZW1vdmluZyBhIHBpbiBmcm9tIFBpbmF0YScpO1xuICAgIH1cbiAgICBpZiAoIWlzSVBGUy5jaWQoaGFzaFRvVW5waW4pKSB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcihgJHtoYXNoVG9VbnBpbn0gaXMgYW4gaW52YWxpZCBJUEZTIENJRGApO1xuICAgIH1cblxuICAgIGNvbnN0IGVuZHBvaW50ID0gYCR7YmFzZVVybH0vcGlubmluZy91bnBpbi8ke2hhc2hUb1VucGlufWA7XG5cbiAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgICBheGlvcy5kZWxldGUoXG4gICAgICAgICAgICBlbmRwb2ludCxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB3aXRoQ3JlZGVudGlhbHM6IHRydWUsXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgICAgICAncGluYXRhX2FwaV9rZXknOiBwaW5hdGFBcGlLZXksXG4gICAgICAgICAgICAgICAgICAgICdwaW5hdGFfc2VjcmV0X2FwaV9rZXknOiBwaW5hdGFTZWNyZXRBcGlLZXlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KS50aGVuKGZ1bmN0aW9uIChyZXN1bHQpIHtcbiAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzICE9PSAyMDApIHtcbiAgICAgICAgICAgICAgICByZWplY3QobmV3IEVycm9yKGB1bmtub3duIHNlcnZlciByZXNwb25zZSB3aGlsZSByZW1vdmluZyBwaW4gZnJvbSBJUEZT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W5Qb2xpY3kpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKCduZXdQaW5Qb2xpY3kgaXMgcmVxdWlyZWQgZm9yIGNoYW5naW5nIHRoZSBwaW4gcG9saWN5IG9mIGEgcGluJyk7XG4gICAgfVxuXG4gICAgY29uc3QgZW5kcG9pbnQgPSBgJHtiYXNlVXJsfS9waW5uaW5nL3VzZXJQaW5Qb2xpY3lgO1xuICAgIGNvbnN0IGJvZHkgPSB7XG4gICAgICAgIG5ld1BpblBvbGljeTogbmV3UGluUG9saWN5XG4gICAgfTtcblxuICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICAgIGF4aW9zLnB1dChcbiAgICAgICAgICAgIGVuZHBvaW50LFxuICAgICAgICAgICAgYm9keSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB3aXRoQ3JlZGVudGlhbHM6IHRydWUsXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgICAgICAncGluYXRhX2FwaV9rZXknOiBwaW5hdGFBcGlLZXksXG4gICAgICAgICAgICAgICAgICAgICdwaW5hdGFfc2VjcmV0X2FwaV9rZXknOiBwaW5hdGFTZWNyZXRBcGlLZXlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KS50aGVuKGZ1bmN0aW9uIChyZXN1bHQpIHtcbiAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzICE9PSAyMDApIHtcbiAgICAgICAgICAgICAgICByZWplY3QobmV3IEVycm9yKGB1bmtub3duIHNlcnZlciByZXNwb25zZSB3aGlsZSBjaGFuZ2luZyBwaW4gcG9saWN5IGZvciB1c2VyOiAke3Jlc3VsdH1gKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXNvbHZlKHJlc3VsdC5kYXRhKTtcbiAgICAgICAgfSkuY2F0Y2goZnVuY3Rpb24gKGVycm9yKSB7XG4gICAgICAgICAg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pO1xuICAgIH1cblxuICAgIGlmIChvcHRpb25zLmN1c3RvbVBpblBvbGljeSkge1xuICAgICAgICB2YWxpZGF0ZVBpblBvbGljeVN0cnVjdHVyZShvcHRpb25zLmN1c3RvbVBpblBvbGljeSk7XG4gICAgfVxufVxuIiwibW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKFwiYXNzZXJ0XCIpOyIsIm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZShcImJ1ZmZlclwiKTsiLCJtb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoXCJmc1wiKTsiLCJtb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoXCJodHRwXCIpOyIsIm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZShcImh0dHBzXCIpOyIsIm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZShcIm9zXCIpOyIsIm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZShcInBhdGhcIik7IiwibW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKFwic3RyZWFtXCIpOyIsIm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZShcInR0eVwiKTsiLCJtb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoXCJ1cmxcIik7IiwibW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKFwidXRpbFwiKTsiLCJtb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoXCJ6bGliXCIpOyJdLCJzb3VyY2VSb290IjoiIn0= - -/***/ }), - -<<<<<<< HEAD -/***/ 40488: -======= -/***/ 66619: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - - -module.exports = asPromise; - -/** - * Callback as used by {@link util.asPromise}. - * @typedef asPromiseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {...*} params Additional arguments - * @returns {undefined} - */ - -/** - * Returns a promise from a node-style callback function. - * @memberof util - * @param {asPromiseCallback} fn Function to call - * @param {*} ctx Function context - * @param {...*} params Function arguments - * @returns {Promise<*>} Promisified function - */ -function asPromise(fn, ctx/*, varargs */) { - var params = new Array(arguments.length - 1), - offset = 0, - index = 2, - pending = true; - while (index < arguments.length) - params[offset++] = arguments[index++]; - return new Promise(function executor(resolve, reject) { - params[offset] = function callback(err/*, varargs */) { - if (pending) { - pending = false; - if (err) - reject(err); - else { - var params = new Array(arguments.length - 1), - offset = 0; - while (offset < params.length) - params[offset++] = arguments[offset]; - resolve.apply(null, params); - } - } - }; - try { - fn.apply(ctx || null, params); - } catch (err) { - if (pending) { - pending = false; - reject(err); - } - } - }); -} - - -/***/ }), - -<<<<<<< HEAD -/***/ 81246: -======= -/***/ 37366: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { - - - -/** - * A minimal base64 implementation for number arrays. - * @memberof util - * @namespace - */ -var base64 = exports; - -/** - * Calculates the byte length of a base64 encoded string. - * @param {string} string Base64 encoded string - * @returns {number} Byte length - */ -base64.length = function length(string) { - var p = string.length; - if (!p) - return 0; - var n = 0; - while (--p % 4 > 1 && string.charAt(p) === "=") - ++n; - return Math.ceil(string.length * 3) / 4 - n; -}; - -// Base64 encoding table -var b64 = new Array(64); - -// Base64 decoding table -var s64 = new Array(123); - -// 65..90, 97..122, 48..57, 43, 47 -for (var i = 0; i < 64;) - s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; - -/** - * Encodes a buffer to a base64 encoded string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} Base64 encoded string - */ -base64.encode = function encode(buffer, start, end) { - var parts = null, - chunk = []; - var i = 0, // output index - j = 0, // goto index - t; // temporary - while (start < end) { - var b = buffer[start++]; - switch (j) { - case 0: - chunk[i++] = b64[b >> 2]; - t = (b & 3) << 4; - j = 1; - break; - case 1: - chunk[i++] = b64[t | b >> 4]; - t = (b & 15) << 2; - j = 2; - break; - case 2: - chunk[i++] = b64[t | b >> 6]; - chunk[i++] = b64[b & 63]; - j = 0; - break; - } - if (i > 8191) { - (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); - i = 0; - } - } - if (j) { - chunk[i++] = b64[t]; - chunk[i++] = 61; - if (j === 1) - chunk[i++] = 61; - } - if (parts) { - if (i) - parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); - return parts.join(""); - } - return String.fromCharCode.apply(String, chunk.slice(0, i)); -}; - -var invalidEncoding = "invalid encoding"; - -/** - * Decodes a base64 encoded string to a buffer. - * @param {string} string Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Number of bytes written - * @throws {Error} If encoding is invalid - */ -base64.decode = function decode(string, buffer, offset) { - var start = offset; - var j = 0, // goto index - t; // temporary - for (var i = 0; i < string.length;) { - var c = string.charCodeAt(i++); - if (c === 61 && j > 1) - break; - if ((c = s64[c]) === undefined) - throw Error(invalidEncoding); - switch (j) { - case 0: - t = c; - j = 1; - break; - case 1: - buffer[offset++] = t << 2 | (c & 48) >> 4; - t = c; - j = 2; - break; - case 2: - buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; - t = c; - j = 3; - break; - case 3: - buffer[offset++] = (t & 3) << 6 | c; - j = 0; - break; - } - } - if (j === 1) - throw Error(invalidEncoding); - return offset - start; -}; - -/** - * Tests if the specified string appears to be base64 encoded. - * @param {string} string String to test - * @returns {boolean} `true` if probably base64 encoded, otherwise false - */ -base64.test = function test(string) { - return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); -}; - - -/***/ }), - -<<<<<<< HEAD -/***/ 85885: -======= -/***/ 98873: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - - -module.exports = EventEmitter; - -/** - * Constructs a new event emitter instance. - * @classdesc A minimal event emitter. - * @memberof util - * @constructor - */ -function EventEmitter() { - - /** - * Registered listeners. - * @type {Object.} - * @private - */ - this._listeners = {}; -} - -/** - * Registers an event listener. - * @param {string} evt Event name - * @param {function} fn Listener - * @param {*} [ctx] Listener context - * @returns {util.EventEmitter} `this` - */ -EventEmitter.prototype.on = function on(evt, fn, ctx) { - (this._listeners[evt] || (this._listeners[evt] = [])).push({ - fn : fn, - ctx : ctx || this - }); - return this; -}; - -/** - * Removes an event listener or any matching listeners if arguments are omitted. - * @param {string} [evt] Event name. Removes all listeners if omitted. - * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. - * @returns {util.EventEmitter} `this` - */ -EventEmitter.prototype.off = function off(evt, fn) { - if (evt === undefined) - this._listeners = {}; - else { - if (fn === undefined) - this._listeners[evt] = []; - else { - var listeners = this._listeners[evt]; - for (var i = 0; i < listeners.length;) - if (listeners[i].fn === fn) - listeners.splice(i, 1); - else - ++i; - } - } - return this; -}; - -/** - * Emits an event by calling its listeners with the specified arguments. - * @param {string} evt Event name - * @param {...*} args Arguments - * @returns {util.EventEmitter} `this` - */ -EventEmitter.prototype.emit = function emit(evt) { - var listeners = this._listeners[evt]; - if (listeners) { - var args = [], - i = 1; - for (; i < arguments.length;) - args.push(arguments[i++]); - for (i = 0; i < listeners.length;) - listeners[i].fn.apply(listeners[i++].ctx, args); - } - return this; -}; - - -/***/ }), - -<<<<<<< HEAD -/***/ 26666: -======= -/***/ 13001: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - - - -module.exports = factory(factory); - -/** - * Reads / writes floats / doubles from / to buffers. - * @name util.float - * @namespace - */ - -/** - * Writes a 32 bit float to a buffer using little endian byte order. - * @name util.float.writeFloatLE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Writes a 32 bit float to a buffer using big endian byte order. - * @name util.float.writeFloatBE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Reads a 32 bit float from a buffer using little endian byte order. - * @name util.float.readFloatLE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -/** - * Reads a 32 bit float from a buffer using big endian byte order. - * @name util.float.readFloatBE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -/** - * Writes a 64 bit double to a buffer using little endian byte order. - * @name util.float.writeDoubleLE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Writes a 64 bit double to a buffer using big endian byte order. - * @name util.float.writeDoubleBE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Reads a 64 bit double from a buffer using little endian byte order. - * @name util.float.readDoubleLE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -/** - * Reads a 64 bit double from a buffer using big endian byte order. - * @name util.float.readDoubleBE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -// Factory function for the purpose of node-based testing in modified global environments -function factory(exports) { - - // float: typed array - if (typeof Float32Array !== "undefined") (function() { - - var f32 = new Float32Array([ -0 ]), - f8b = new Uint8Array(f32.buffer), - le = f8b[3] === 128; - - function writeFloat_f32_cpy(val, buf, pos) { - f32[0] = val; - buf[pos ] = f8b[0]; - buf[pos + 1] = f8b[1]; - buf[pos + 2] = f8b[2]; - buf[pos + 3] = f8b[3]; - } - - function writeFloat_f32_rev(val, buf, pos) { - f32[0] = val; - buf[pos ] = f8b[3]; - buf[pos + 1] = f8b[2]; - buf[pos + 2] = f8b[1]; - buf[pos + 3] = f8b[0]; - } - - /* istanbul ignore next */ - exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; - /* istanbul ignore next */ - exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; - - function readFloat_f32_cpy(buf, pos) { - f8b[0] = buf[pos ]; - f8b[1] = buf[pos + 1]; - f8b[2] = buf[pos + 2]; - f8b[3] = buf[pos + 3]; - return f32[0]; - } - - function readFloat_f32_rev(buf, pos) { - f8b[3] = buf[pos ]; - f8b[2] = buf[pos + 1]; - f8b[1] = buf[pos + 2]; - f8b[0] = buf[pos + 3]; - return f32[0]; - } - - /* istanbul ignore next */ - exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; - /* istanbul ignore next */ - exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; - - // float: ieee754 - })(); else (function() { - - function writeFloat_ieee754(writeUint, val, buf, pos) { - var sign = val < 0 ? 1 : 0; - if (sign) - val = -val; - if (val === 0) - writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); - else if (isNaN(val)) - writeUint(2143289344, buf, pos); - else if (val > 3.4028234663852886e+38) // +-Infinity - writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); - else if (val < 1.1754943508222875e-38) // denormal - writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); - else { - var exponent = Math.floor(Math.log(val) / Math.LN2), - mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; - writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); - } - } - - exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); - exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); - - function readFloat_ieee754(readUint, buf, pos) { - var uint = readUint(buf, pos), - sign = (uint >> 31) * 2 + 1, - exponent = uint >>> 23 & 255, - mantissa = uint & 8388607; - return exponent === 255 - ? mantissa - ? NaN - : sign * Infinity - : exponent === 0 // denormal - ? sign * 1.401298464324817e-45 * mantissa - : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); - } - - exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); - exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); - - })(); - - // double: typed array - if (typeof Float64Array !== "undefined") (function() { - - var f64 = new Float64Array([-0]), - f8b = new Uint8Array(f64.buffer), - le = f8b[7] === 128; - - function writeDouble_f64_cpy(val, buf, pos) { - f64[0] = val; - buf[pos ] = f8b[0]; - buf[pos + 1] = f8b[1]; - buf[pos + 2] = f8b[2]; - buf[pos + 3] = f8b[3]; - buf[pos + 4] = f8b[4]; - buf[pos + 5] = f8b[5]; - buf[pos + 6] = f8b[6]; - buf[pos + 7] = f8b[7]; - } - - function writeDouble_f64_rev(val, buf, pos) { - f64[0] = val; - buf[pos ] = f8b[7]; - buf[pos + 1] = f8b[6]; - buf[pos + 2] = f8b[5]; - buf[pos + 3] = f8b[4]; - buf[pos + 4] = f8b[3]; - buf[pos + 5] = f8b[2]; - buf[pos + 6] = f8b[1]; - buf[pos + 7] = f8b[0]; - } - - /* istanbul ignore next */ - exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; - /* istanbul ignore next */ - exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; - - function readDouble_f64_cpy(buf, pos) { - f8b[0] = buf[pos ]; - f8b[1] = buf[pos + 1]; - f8b[2] = buf[pos + 2]; - f8b[3] = buf[pos + 3]; - f8b[4] = buf[pos + 4]; - f8b[5] = buf[pos + 5]; - f8b[6] = buf[pos + 6]; - f8b[7] = buf[pos + 7]; - return f64[0]; - } - - function readDouble_f64_rev(buf, pos) { - f8b[7] = buf[pos ]; - f8b[6] = buf[pos + 1]; - f8b[5] = buf[pos + 2]; - f8b[4] = buf[pos + 3]; - f8b[3] = buf[pos + 4]; - f8b[2] = buf[pos + 5]; - f8b[1] = buf[pos + 6]; - f8b[0] = buf[pos + 7]; - return f64[0]; - } - - /* istanbul ignore next */ - exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; - /* istanbul ignore next */ - exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; - - // double: ieee754 - })(); else (function() { - - function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { - var sign = val < 0 ? 1 : 0; - if (sign) - val = -val; - if (val === 0) { - writeUint(0, buf, pos + off0); - writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); - } else if (isNaN(val)) { - writeUint(0, buf, pos + off0); - writeUint(2146959360, buf, pos + off1); - } else if (val > 1.7976931348623157e+308) { // +-Infinity - writeUint(0, buf, pos + off0); - writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); - } else { - var mantissa; - if (val < 2.2250738585072014e-308) { // denormal - mantissa = val / 5e-324; - writeUint(mantissa >>> 0, buf, pos + off0); - writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); - } else { - var exponent = Math.floor(Math.log(val) / Math.LN2); - if (exponent === 1024) - exponent = 1023; - mantissa = val * Math.pow(2, -exponent); - writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); - writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); - } - } - } - - exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); - exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); - - function readDouble_ieee754(readUint, off0, off1, buf, pos) { - var lo = readUint(buf, pos + off0), - hi = readUint(buf, pos + off1); - var sign = (hi >> 31) * 2 + 1, - exponent = hi >>> 20 & 2047, - mantissa = 4294967296 * (hi & 1048575) + lo; - return exponent === 2047 - ? mantissa - ? NaN - : sign * Infinity - : exponent === 0 // denormal - ? sign * 5e-324 * mantissa - : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); - } - - exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); - exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); - - })(); - - return exports; -} - -// uint helpers - -function writeUintLE(val, buf, pos) { - buf[pos ] = val & 255; - buf[pos + 1] = val >>> 8 & 255; - buf[pos + 2] = val >>> 16 & 255; - buf[pos + 3] = val >>> 24; -} - -function writeUintBE(val, buf, pos) { - buf[pos ] = val >>> 24; - buf[pos + 1] = val >>> 16 & 255; - buf[pos + 2] = val >>> 8 & 255; - buf[pos + 3] = val & 255; -} - -function readUintLE(buf, pos) { - return (buf[pos ] - | buf[pos + 1] << 8 - | buf[pos + 2] << 16 - | buf[pos + 3] << 24) >>> 0; -} - -function readUintBE(buf, pos) { - return (buf[pos ] << 24 - | buf[pos + 1] << 16 - | buf[pos + 2] << 8 - | buf[pos + 3]) >>> 0; -} - - -/***/ }), - -<<<<<<< HEAD -/***/ 62798: -======= -/***/ 74097: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - - -module.exports = inquire; - -<<<<<<< HEAD -/** - * Requires a module only if available. - * @memberof util - * @param {string} moduleName Module to require - * @returns {?Object} Required module if available and not empty, otherwise `null` - */ -function inquire(moduleName) { -======= -/***/ }), - -/***/ 15177: -/***/ ((module) => { - -"use strict"; - -module.exports = pool; - -/** - * An allocator as used by {@link util.pool}. - * @typedef PoolAllocator - * @type {function} - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ - -/** - * A slicer as used by {@link util.pool}. - * @typedef PoolSlicer - * @type {function} - * @param {number} start Start offset - * @param {number} end End offset - * @returns {Uint8Array} Buffer slice - * @this {Uint8Array} - */ - -/** - * A general purpose buffer pool. - * @memberof util - * @function - * @param {PoolAllocator} alloc Allocator - * @param {PoolSlicer} slice Slicer - * @param {number} [size=8192] Slab size - * @returns {PoolAllocator} Pooled allocator - */ -function pool(alloc, slice, size) { - var SIZE = size || 8192; - var MAX = SIZE >>> 1; - var slab = null; - var offset = SIZE; - return function pool_alloc(size) { - if (size < 1 || size > MAX) - return alloc(size); - if (offset + size > SIZE) { - slab = alloc(SIZE); - offset = 0; - } - var buf = slice.call(slab, offset, offset += size); - if (offset & 7) // align to 32 bit - offset = (offset | 7) + 1; - return buf; - }; -} - - -/***/ }), - -/***/ 42114: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -/** - * A minimal UTF8 implementation for number arrays. - * @memberof util - * @namespace - */ -var utf8 = exports; - -/** - * Calculates the UTF8 byte length of a string. - * @param {string} string String - * @returns {number} Byte length - */ -utf8.length = function utf8_length(string) { - var len = 0, - c = 0; - for (var i = 0; i < string.length; ++i) { - c = string.charCodeAt(i); - if (c < 128) - len += 1; - else if (c < 2048) - len += 2; - else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { - ++i; - len += 4; - } else - len += 3; - } - return len; -}; - -/** - * Reads UTF8 bytes as a string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} String read - */ -utf8.read = function utf8_read(buffer, start, end) { - var len = end - start; - if (len < 1) - return ""; - var parts = null, - chunk = [], - i = 0, // char offset - t; // temporary - while (start < end) { - t = buffer[start++]; - if (t < 128) - chunk[i++] = t; - else if (t > 191 && t < 224) - chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; - else if (t > 239 && t < 365) { - t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; - chunk[i++] = 0xD800 + (t >> 10); - chunk[i++] = 0xDC00 + (t & 1023); - } else - chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; - if (i > 8191) { - (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); - i = 0; - } - } - if (parts) { - if (i) - parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); - return parts.join(""); - } - return String.fromCharCode.apply(String, chunk.slice(0, i)); -}; - -/** - * Writes a string as UTF8 bytes. - * @param {string} string Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Bytes written - */ -utf8.write = function utf8_write(string, buffer, offset) { - var start = offset, - c1, // character 1 - c2; // character 2 - for (var i = 0; i < string.length; ++i) { - c1 = string.charCodeAt(i); - if (c1 < 128) { - buffer[offset++] = c1; - } else if (c1 < 2048) { - buffer[offset++] = c1 >> 6 | 192; - buffer[offset++] = c1 & 63 | 128; - } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { - c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); - ++i; - buffer[offset++] = c1 >> 18 | 240; - buffer[offset++] = c1 >> 12 & 63 | 128; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } else { - buffer[offset++] = c1 >> 12 | 224; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } - } - return offset - start; -}; - - -/***/ }), - -/***/ 21280: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var search = __nccwpck_require__(40961); -var utils = __nccwpck_require__(14466); - -const mergeArrays2 = Function.prototype.apply.bind(utils.mergeArrays, undefined); -const dash = utils.stringToArray('--'); -const CRLF = utils.stringToArray('\r\n'); -function parseContentDisposition(header) { - const parts = header.split(';').map(part => part.trim()); - if (parts.shift() !== 'form-data') { - throw new Error('malformed content-disposition header: missing "form-data" in `' + JSON.stringify(parts) + '`'); - } - const out = {}; - for (const part of parts) { - const kv = part.split('=', 2); - if (kv.length !== 2) { - throw new Error('malformed content-disposition header: key-value pair not found - ' + part + ' in `' + header + '`'); - } - const [name, value] = kv; - if (value[0] === '"' && value[value.length - 1] === '"') { - out[name] = value.slice(1, -1).replace(/\\"/g, '"'); - } else if (value[0] !== '"' && value[value.length - 1] !== '"') { - out[name] = value; - } else if (value[0] === '"' && value[value.length - 1] !== '"' || value[0] !== '"' && value[value.length - 1] === '"') { - throw new Error('malformed content-disposition header: mismatched quotations in `' + header + '`'); - } - } - if (!out.name) { - throw new Error('malformed content-disposition header: missing field name in `' + header + '`'); - } - return out; -} -function parsePartHeaders(lines) { - const entries = []; - let disposition = false; - let line; - while (typeof (line = lines.shift()) !== 'undefined') { - const colon = line.indexOf(':'); - if (colon === -1) { - throw new Error('malformed multipart-form header: missing colon'); - } - const header = line.slice(0, colon).trim().toLowerCase(); - const value = line.slice(colon + 1).trim(); - switch (header) { - case 'content-disposition': - disposition = true; - entries.push(...Object.entries(parseContentDisposition(value))); - break; - case 'content-type': - entries.push([ - 'contentType', - value - ]); - } - } - if (!disposition) { - throw new Error('malformed multipart-form header: missing content-disposition'); - } - return Object.fromEntries(entries); -} -async function readHeaderLines(it, needle) { - let firstChunk = true; - let lastTokenWasMatch = false; - const headerLines = [[]]; - const crlfSearch = new search.StreamSearch(CRLF); - for (;;) { - const result = await it.next(); - if (result.done) { - throw new Error('malformed multipart-form data: unexpected end of stream'); - } - if (firstChunk && result.value !== search.MATCH && utils.arraysEqual(result.value.slice(0, 2), dash)) { - return [ - undefined, - new Uint8Array() - ]; - } - let chunk; - if (result.value !== search.MATCH) { - chunk = result.value; - } else if (!lastTokenWasMatch) { - chunk = needle; - } else { - throw new Error('malformed multipart-form data: unexpected boundary'); - } - if (!chunk.length) { - continue; - } - if (firstChunk) { - firstChunk = false; - } - const tokens = crlfSearch.feed(chunk); - for (const [i, token] of tokens.entries()) { - const isMatch = token === search.MATCH; - if (!isMatch && !token.length) { - continue; - } - if (lastTokenWasMatch && isMatch) { - tokens.push(crlfSearch.end()); - return [ - headerLines.filter(chunks => chunks.length).map(mergeArrays2).map(utils.arrayToString), - utils.mergeArrays(...tokens.slice(i + 1).map(token => token === search.MATCH ? CRLF : token)) - ]; - } - if (lastTokenWasMatch = isMatch) { - headerLines.push([]); - } else { - headerLines[headerLines.length - 1].push(token); - } - } - } -} -async function* streamMultipart(body, boundary) { - const needle = utils.mergeArrays(dash, utils.stringToArray(boundary)); - const it = new search.ReadableStreamSearch(needle, body)[Symbol.asyncIterator](); - for (;;) { - const result = await it.next(); - if (result.done) { - return; - } - if (result.value === search.MATCH) { - break; - } - } - const crlfSearch = new search.StreamSearch(CRLF); - for (;;) { - const [headerLines, tail] = await readHeaderLines(it, needle); - if (!headerLines) { - return; - } - async function nextToken() { - const result = await it.next(); - if (result.done) { - throw new Error('malformed multipart-form data: unexpected end of stream'); - } - return result; - } - let trailingCRLF = false; - function feedChunk(chunk) { - const chunks = []; - for (const token of crlfSearch.feed(chunk)) { - if (trailingCRLF) { - chunks.push(CRLF); - } - if (!(trailingCRLF = token === search.MATCH)) { - chunks.push(token); - } - } - return utils.mergeArrays(...chunks); - } - let done = false; - async function nextChunk() { - const result = await nextToken(); - let chunk; - if (result.value !== search.MATCH) { - chunk = result.value; - } else if (!trailingCRLF) { - chunk = CRLF; - } else { - done = true; - return { value: crlfSearch.end() }; - } - return { value: feedChunk(chunk) }; - } - const bufferedChunks = [{ value: feedChunk(tail) }]; - yield { - ...parsePartHeaders(headerLines), - data: { - [Symbol.asyncIterator]() { - return this; - }, - async next() { - for (;;) { - const result = bufferedChunks.shift(); - if (!result) { - break; - } - if (result.value.length > 0) { - return result; - } - } - for (;;) { - if (done) { - return { - done, - value: undefined - }; - } - const result = await nextChunk(); - if (result.value.length > 0) { - return result; - } - } - } - } - }; - while (!done) { - bufferedChunks.push(await nextChunk()); - } - } -} -async function* iterateMultipart(body, boundary) { - for await (const part of streamMultipart(body, boundary)) { - const chunks = []; - for await (const chunk of part.data) { - chunks.push(chunk); - } - yield { - ...part, - data: utils.mergeArrays(...chunks) - }; - } -} - -exports.iterateMultipart = iterateMultipart; -exports.streamMultipart = streamMultipart; - - -/***/ }), - -/***/ 40961: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var utils = __nccwpck_require__(14466); - -function coerce(a) { - if (a instanceof Uint8Array) { - return index => a[index]; - } - return a; -} -function jsmemcmp(buf1, pos1, buf2, pos2, len) { - const fn1 = coerce(buf1); - const fn2 = coerce(buf2); - for (let i = 0; i < len; ++i) { - if (fn1(pos1 + i) !== fn2(pos2 + i)) { - return false; - } - } - return true; -} -function createOccurenceTable(s) { - const table = new Array(256).fill(s.length); - if (s.length > 1) { - for (let i = 0; i < s.length - 1; i++) { - table[s[i]] = s.length - 1 - i; - } - } - return table; -} -const MATCH = Symbol('Match'); -class StreamSearch { - constructor(needle) { - this._lookbehind = new Uint8Array(); - if (typeof needle === 'string') { - this._needle = needle = utils.stringToArray(needle); - } else { - this._needle = needle; - } - this._lastChar = needle[needle.length - 1]; - this._occ = createOccurenceTable(needle); - } - feed(chunk) { - let pos = 0; - let tokens; - const allTokens = []; - while (pos !== chunk.length) { - ; - [pos, ...tokens] = this._feed(chunk, pos); - allTokens.push(...tokens); - } - return allTokens; - } - end() { - const tail = this._lookbehind; - this._lookbehind = new Uint8Array(); - return tail; - } - _feed(data, bufPos) { - const tokens = []; - let pos = -this._lookbehind.length; - if (pos < 0) { - while (pos < 0 && pos <= data.length - this._needle.length) { - const ch = this._charAt(data, pos + this._needle.length - 1); - if (ch === this._lastChar && this._memcmp(data, pos, this._needle.length - 1)) { - if (pos > -this._lookbehind.length) { - tokens.push(this._lookbehind.slice(0, this._lookbehind.length + pos)); - } - tokens.push(MATCH); - this._lookbehind = new Uint8Array(); - return [ - pos + this._needle.length, - ...tokens - ]; - } else { - pos += this._occ[ch]; - } - } - if (pos < 0) { - while (pos < 0 && !this._memcmp(data, pos, data.length - pos)) { - pos++; - } - } - if (pos >= 0) { - tokens.push(this._lookbehind); - this._lookbehind = new Uint8Array(); - } else { - const bytesToCutOff = this._lookbehind.length + pos; - if (bytesToCutOff > 0) { - tokens.push(this._lookbehind.slice(0, bytesToCutOff)); - this._lookbehind = this._lookbehind.slice(bytesToCutOff); - } - this._lookbehind = Uint8Array.from(new Array(this._lookbehind.length + data.length), (_, i) => this._charAt(data, i - this._lookbehind.length)); - return [ - data.length, - ...tokens - ]; - } - } - pos += bufPos; - while (pos <= data.length - this._needle.length) { - const ch = data[pos + this._needle.length - 1]; - if (ch === this._lastChar && data[pos] === this._needle[0] && jsmemcmp(this._needle, 0, data, pos, this._needle.length - 1)) { - if (pos > bufPos) { - tokens.push(data.slice(bufPos, pos)); - } - tokens.push(MATCH); - return [ - pos + this._needle.length, - ...tokens - ]; - } else { - pos += this._occ[ch]; - } - } - if (pos < data.length) { - while (pos < data.length && (data[pos] !== this._needle[0] || !jsmemcmp(data, pos, this._needle, 0, data.length - pos))) { - ++pos; - } - if (pos < data.length) { - this._lookbehind = data.slice(pos); - } - } - if (pos > 0) { - tokens.push(data.slice(bufPos, pos < data.length ? pos : data.length)); - } - return [ - data.length, - ...tokens - ]; - } - _charAt(data, pos) { - if (pos < 0) { - return this._lookbehind[this._lookbehind.length + pos]; - } - return data[pos]; - } - _memcmp(data, pos, len) { - return jsmemcmp(this._charAt.bind(this, data), pos, this._needle, 0, len); - } -} -class ReadableStreamSearch { - constructor(needle, _readableStream) { - this._readableStream = _readableStream; - this._search = new StreamSearch(needle); - } - async *[Symbol.asyncIterator]() { - const reader = this._readableStream.getReader(); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - try { - var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval - if (mod && (mod.length || Object.keys(mod).length)) - return mod; - } catch (e) {} // eslint-disable-line no-empty - return null; -} - - -/***/ }), - -<<<<<<< HEAD -/***/ 45350: -/***/ ((module) => { - - -module.exports = pool; - -/** - * An allocator as used by {@link util.pool}. - * @typedef PoolAllocator - * @type {function} - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ - -/** - * A slicer as used by {@link util.pool}. - * @typedef PoolSlicer - * @type {function} - * @param {number} start Start offset - * @param {number} end End offset - * @returns {Uint8Array} Buffer slice - * @this {Uint8Array} - */ - -/** - * A general purpose buffer pool. - * @memberof util - * @function - * @param {PoolAllocator} alloc Allocator - * @param {PoolSlicer} slice Slicer - * @param {number} [size=8192] Slab size - * @returns {PoolAllocator} Pooled allocator - */ -function pool(alloc, slice, size) { - var SIZE = size || 8192; - var MAX = SIZE >>> 1; - var slab = null; - var offset = SIZE; - return function pool_alloc(size) { - if (size < 1 || size > MAX) - return alloc(size); - if (offset + size > SIZE) { - slab = alloc(SIZE); - offset = 0; - } - var buf = slice.call(slab, offset, offset += size); - if (offset & 7) // align to 32 bit - offset = (offset | 7) + 1; - return buf; - }; -} - - -/***/ }), - -/***/ 30105: -======= -/***/ 14466: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { - - - -/** - * A minimal UTF8 implementation for number arrays. - * @memberof util - * @namespace - */ -var utf8 = exports; - -/** - * Calculates the UTF8 byte length of a string. - * @param {string} string String - * @returns {number} Byte length - */ -utf8.length = function utf8_length(string) { - var len = 0, - c = 0; - for (var i = 0; i < string.length; ++i) { - c = string.charCodeAt(i); - if (c < 128) - len += 1; - else if (c < 2048) - len += 2; - else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { - ++i; - len += 4; - } else - len += 3; - } - return len; -}; - -/** - * Reads UTF8 bytes as a string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} String read - */ -utf8.read = function utf8_read(buffer, start, end) { - var len = end - start; - if (len < 1) - return ""; - var parts = null, - chunk = [], - i = 0, // char offset - t; // temporary - while (start < end) { - t = buffer[start++]; - if (t < 128) - chunk[i++] = t; - else if (t > 191 && t < 224) - chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; - else if (t > 239 && t < 365) { - t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; - chunk[i++] = 0xD800 + (t >> 10); - chunk[i++] = 0xDC00 + (t & 1023); - } else - chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; - if (i > 8191) { - (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); - i = 0; - } - } - if (parts) { - if (i) - parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); - return parts.join(""); - } - return String.fromCharCode.apply(String, chunk.slice(0, i)); -}; - -/** - * Writes a string as UTF8 bytes. - * @param {string} string Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Bytes written - */ -utf8.write = function utf8_write(string, buffer, offset) { - var start = offset, - c1, // character 1 - c2; // character 2 - for (var i = 0; i < string.length; ++i) { - c1 = string.charCodeAt(i); - if (c1 < 128) { - buffer[offset++] = c1; - } else if (c1 < 2048) { - buffer[offset++] = c1 >> 6 | 192; - buffer[offset++] = c1 & 63 | 128; - } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { - c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); - ++i; - buffer[offset++] = c1 >> 18 | 240; - buffer[offset++] = c1 >> 12 & 63 | 128; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } else { - buffer[offset++] = c1 >> 12 | 224; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } - } - return offset - start; -}; - - -/***/ }), - -<<<<<<< HEAD -/***/ 46612: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -======= -/***/ 67022: -/***/ ((module, exports, __nccwpck_require__) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AbortController = void 0; -const AbortSignal_1 = __nccwpck_require__(51015); -class AbortController { - constructor() { - this.signal = new AbortSignal_1.AbortSignal(); - } - abort() { - this.signal.abort(); - } -} -exports.AbortController = AbortController; - - -/***/ }), - -/***/ 51015: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AbortSignal = void 0; -class AbortSignal { - constructor() { - this.onabort = null; - this._aborted = false; - Object.defineProperty(this, "_aborted", { - value: false, - writable: true, - }); - } - get aborted() { - return this._aborted; - } - abort() { - this._aborted = true; - if (this.onabort) { - this.onabort(this); - this.onabort = null; - } - } -} -exports.AbortSignal = AbortSignal; - - -/***/ }), - -/***/ 82655: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(35025); -tslib_1.__exportStar(__nccwpck_require__(46612), exports); -tslib_1.__exportStar(__nccwpck_require__(51015), exports); - - -/***/ }), - -/***/ 35025: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 94551: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = exports.DEFAULT_USE_DUALSTACK_ENDPOINT = exports.CONFIG_USE_DUALSTACK_ENDPOINT = exports.ENV_USE_DUALSTACK_ENDPOINT = void 0; -const util_config_provider_1 = __nccwpck_require__(32617); -exports.ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT"; -exports.CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint"; -exports.DEFAULT_USE_DUALSTACK_ENDPOINT = false; -exports.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => (0, util_config_provider_1.booleanSelector)(env, exports.ENV_USE_DUALSTACK_ENDPOINT, util_config_provider_1.SelectorType.ENV), - configFileSelector: (profile) => (0, util_config_provider_1.booleanSelector)(profile, exports.CONFIG_USE_DUALSTACK_ENDPOINT, util_config_provider_1.SelectorType.CONFIG), - default: false, -}; - - -/***/ }), - -/***/ 3364: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = exports.DEFAULT_USE_FIPS_ENDPOINT = exports.CONFIG_USE_FIPS_ENDPOINT = exports.ENV_USE_FIPS_ENDPOINT = void 0; -const util_config_provider_1 = __nccwpck_require__(32617); -exports.ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT"; -exports.CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint"; -exports.DEFAULT_USE_FIPS_ENDPOINT = false; -exports.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => (0, util_config_provider_1.booleanSelector)(env, exports.ENV_USE_FIPS_ENDPOINT, util_config_provider_1.SelectorType.ENV), - configFileSelector: (profile) => (0, util_config_provider_1.booleanSelector)(profile, exports.CONFIG_USE_FIPS_ENDPOINT, util_config_provider_1.SelectorType.CONFIG), - default: false, -}; - - -/***/ }), - -/***/ 62681: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(86002); -tslib_1.__exportStar(__nccwpck_require__(94551), exports); -tslib_1.__exportStar(__nccwpck_require__(3364), exports); -tslib_1.__exportStar(__nccwpck_require__(83451), exports); -tslib_1.__exportStar(__nccwpck_require__(81765), exports); - - -/***/ }), - -/***/ 83451: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveCustomEndpointsConfig = void 0; -const util_middleware_1 = __nccwpck_require__(81243); -const resolveCustomEndpointsConfig = (input) => { - var _a, _b; - const { endpoint, urlParser } = input; - return { - ...input, - tls: (_a = input.tls) !== null && _a !== void 0 ? _a : true, - endpoint: (0, util_middleware_1.normalizeProvider)(typeof endpoint === "string" ? urlParser(endpoint) : endpoint), - isCustomEndpoint: true, - useDualstackEndpoint: (0, util_middleware_1.normalizeProvider)((_b = input.useDualstackEndpoint) !== null && _b !== void 0 ? _b : false), - }; -}; -exports.resolveCustomEndpointsConfig = resolveCustomEndpointsConfig; - - -/***/ }), - -/***/ 81765: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveEndpointsConfig = void 0; -const util_middleware_1 = __nccwpck_require__(81243); -const getEndpointFromRegion_1 = __nccwpck_require__(61811); -const resolveEndpointsConfig = (input) => { - var _a, _b; - const useDualstackEndpoint = (0, util_middleware_1.normalizeProvider)((_a = input.useDualstackEndpoint) !== null && _a !== void 0 ? _a : false); - const { endpoint, useFipsEndpoint, urlParser } = input; - return { - ...input, - tls: (_b = input.tls) !== null && _b !== void 0 ? _b : true, - endpoint: endpoint - ? (0, util_middleware_1.normalizeProvider)(typeof endpoint === "string" ? urlParser(endpoint) : endpoint) - : () => (0, getEndpointFromRegion_1.getEndpointFromRegion)({ ...input, useDualstackEndpoint, useFipsEndpoint }), - isCustomEndpoint: !!endpoint, - useDualstackEndpoint, - }; -}; -exports.resolveEndpointsConfig = resolveEndpointsConfig; - - -/***/ }), - -/***/ 61811: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEndpointFromRegion = void 0; -const getEndpointFromRegion = async (input) => { - var _a; - const { tls = true } = input; - const region = await input.region(); - const dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); - if (!dnsHostRegex.test(region)) { - throw new Error("Invalid region in client config"); - } - const useDualstackEndpoint = await input.useDualstackEndpoint(); - const useFipsEndpoint = await input.useFipsEndpoint(); - const { hostname } = (_a = (await input.regionInfoProvider(region, { useDualstackEndpoint, useFipsEndpoint }))) !== null && _a !== void 0 ? _a : {}; - if (!hostname) { - throw new Error("Cannot resolve hostname from client config"); - } - return input.urlParser(`${tls ? "https:" : "http:"}//${hostname}`); -}; -exports.getEndpointFromRegion = getEndpointFromRegion; - - -/***/ }), - -/***/ 66041: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(86002); -tslib_1.__exportStar(__nccwpck_require__(62681), exports); -tslib_1.__exportStar(__nccwpck_require__(44772), exports); -tslib_1.__exportStar(__nccwpck_require__(66563), exports); - - -/***/ }), - -/***/ 6817: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_REGION_CONFIG_FILE_OPTIONS = exports.NODE_REGION_CONFIG_OPTIONS = exports.REGION_INI_NAME = exports.REGION_ENV_NAME = void 0; -exports.REGION_ENV_NAME = "AWS_REGION"; -exports.REGION_INI_NAME = "region"; -exports.NODE_REGION_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[exports.REGION_ENV_NAME], - configFileSelector: (profile) => profile[exports.REGION_INI_NAME], - default: () => { - throw new Error("Region is missing"); - }, -}; -exports.NODE_REGION_CONFIG_FILE_OPTIONS = { - preferredFile: "credentials", -}; - - -/***/ }), - -/***/ 80356: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRealRegion = void 0; -const isFipsRegion_1 = __nccwpck_require__(39753); -const getRealRegion = (region) => (0, isFipsRegion_1.isFipsRegion)(region) - ? ["fips-aws-global", "aws-fips"].includes(region) - ? "us-east-1" - : region.replace(/fips-(dkr-|prod-)?|-fips/, "") - : region; -exports.getRealRegion = getRealRegion; - - -/***/ }), - -/***/ 44772: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(86002); -tslib_1.__exportStar(__nccwpck_require__(6817), exports); -tslib_1.__exportStar(__nccwpck_require__(14096), exports); - - -/***/ }), - -/***/ 39753: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isFipsRegion = void 0; -const isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")); -exports.isFipsRegion = isFipsRegion; - - -/***/ }), - -/***/ 14096: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveRegionConfig = void 0; -const getRealRegion_1 = __nccwpck_require__(80356); -const isFipsRegion_1 = __nccwpck_require__(39753); -const resolveRegionConfig = (input) => { - const { region, useFipsEndpoint } = input; - if (!region) { - throw new Error("Region is missing"); - } - return { - ...input, - region: async () => { - if (typeof region === "string") { - return (0, getRealRegion_1.getRealRegion)(region); - } - const providedRegion = await region(); - return (0, getRealRegion_1.getRealRegion)(providedRegion); - }, - useFipsEndpoint: async () => { - const providedRegion = typeof region === "string" ? region : await region(); - if ((0, isFipsRegion_1.isFipsRegion)(providedRegion)) { - return true; - } - return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); - }, - }; -}; -exports.resolveRegionConfig = resolveRegionConfig; - - -/***/ }), - -/***/ 51127: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -<<<<<<< HEAD -======= -var eventTargetShim = __nccwpck_require__(69685); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -/***/ }), - -/***/ 92375: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 90764: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getHostnameFromVariants = void 0; -const getHostnameFromVariants = (variants = [], { useFipsEndpoint, useDualstackEndpoint }) => { - var _a; - return (_a = variants.find(({ tags }) => useFipsEndpoint === tags.includes("fips") && useDualstackEndpoint === tags.includes("dualstack"))) === null || _a === void 0 ? void 0 : _a.hostname; -}; -exports.getHostnameFromVariants = getHostnameFromVariants; - - -/***/ }), - -/***/ 29977: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRegionInfo = void 0; -const getHostnameFromVariants_1 = __nccwpck_require__(90764); -const getResolvedHostname_1 = __nccwpck_require__(998); -const getResolvedPartition_1 = __nccwpck_require__(67891); -const getResolvedSigningRegion_1 = __nccwpck_require__(273); -const getRegionInfo = (region, { useFipsEndpoint = false, useDualstackEndpoint = false, signingService, regionHash, partitionHash, }) => { - var _a, _b, _c, _d, _e, _f; - const partition = (0, getResolvedPartition_1.getResolvedPartition)(region, { partitionHash }); - const resolvedRegion = region in regionHash ? region : (_b = (_a = partitionHash[partition]) === null || _a === void 0 ? void 0 : _a.endpoint) !== null && _b !== void 0 ? _b : region; - const hostnameOptions = { useFipsEndpoint, useDualstackEndpoint }; - const regionHostname = (0, getHostnameFromVariants_1.getHostnameFromVariants)((_c = regionHash[resolvedRegion]) === null || _c === void 0 ? void 0 : _c.variants, hostnameOptions); - const partitionHostname = (0, getHostnameFromVariants_1.getHostnameFromVariants)((_d = partitionHash[partition]) === null || _d === void 0 ? void 0 : _d.variants, hostnameOptions); - const hostname = (0, getResolvedHostname_1.getResolvedHostname)(resolvedRegion, { regionHostname, partitionHostname }); - if (hostname === undefined) { - throw new Error(`Endpoint resolution failed for: ${{ resolvedRegion, useFipsEndpoint, useDualstackEndpoint }}`); - } - const signingRegion = (0, getResolvedSigningRegion_1.getResolvedSigningRegion)(hostname, { - signingRegion: (_e = regionHash[resolvedRegion]) === null || _e === void 0 ? void 0 : _e.signingRegion, - regionRegex: partitionHash[partition].regionRegex, - useFipsEndpoint, - }); - return { - partition, - signingService, - hostname, - ...(signingRegion && { signingRegion }), - ...(((_f = regionHash[resolvedRegion]) === null || _f === void 0 ? void 0 : _f.signingService) && { - signingService: regionHash[resolvedRegion].signingService, - }), - }; -}; -exports.getRegionInfo = getRegionInfo; - - -/***/ }), - -/***/ 998: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getResolvedHostname = void 0; -const getResolvedHostname = (resolvedRegion, { regionHostname, partitionHostname }) => regionHostname - ? regionHostname - : partitionHostname - ? partitionHostname.replace("{region}", resolvedRegion) - : undefined; -exports.getResolvedHostname = getResolvedHostname; - - -/***/ }), - -/***/ 67891: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getResolvedPartition = void 0; -const getResolvedPartition = (region, { partitionHash }) => { var _a; return (_a = Object.keys(partitionHash || {}).find((key) => partitionHash[key].regions.includes(region))) !== null && _a !== void 0 ? _a : "aws"; }; -exports.getResolvedPartition = getResolvedPartition; - - -/***/ }), - -/***/ 273: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getResolvedSigningRegion = void 0; -const getResolvedSigningRegion = (hostname, { signingRegion, regionRegex, useFipsEndpoint }) => { - if (signingRegion) { - return signingRegion; - } - else if (useFipsEndpoint) { - const regionRegexJs = regionRegex.replace("\\\\", "\\").replace(/^\^/g, "\\.").replace(/\$$/g, "\\."); - const regionRegexmatchArray = hostname.match(regionRegexJs); - if (regionRegexmatchArray) { - return regionRegexmatchArray[0].slice(1, -1); - } - } -}; -exports.getResolvedSigningRegion = getResolvedSigningRegion; - - -/***/ }), - -/***/ 66563: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(86002); -tslib_1.__exportStar(__nccwpck_require__(51127), exports); -tslib_1.__exportStar(__nccwpck_require__(92375), exports); -tslib_1.__exportStar(__nccwpck_require__(29977), exports); - - -/***/ }), - -/***/ 86002: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 85646: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSmithyContext = void 0; -const types_1 = __nccwpck_require__(75751); -const getSmithyContext = (context) => context[types_1.SMITHY_CONTEXT_KEY] || (context[types_1.SMITHY_CONTEXT_KEY] = {}); -exports.getSmithyContext = getSmithyContext; - - -/***/ }), - -/***/ 53938: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createPaginator = void 0; -const tslib_1 = __nccwpck_require__(6605); -tslib_1.__exportStar(__nccwpck_require__(85286), exports); -tslib_1.__exportStar(__nccwpck_require__(51847), exports); -tslib_1.__exportStar(__nccwpck_require__(38461), exports); -tslib_1.__exportStar(__nccwpck_require__(85646), exports); -tslib_1.__exportStar(__nccwpck_require__(60235), exports); -tslib_1.__exportStar(__nccwpck_require__(29962), exports); -var createPaginator_1 = __nccwpck_require__(35966); -Object.defineProperty(exports, "createPaginator", ({ enumerable: true, get: function () { return createPaginator_1.createPaginator; } })); - - -/***/ }), - -/***/ 43742: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getHttpAuthSchemeEndpointRuleSetPlugin = exports.httpAuthSchemeEndpointRuleSetMiddlewareOptions = void 0; -const middleware_endpoint_1 = __nccwpck_require__(24916); -const httpAuthSchemeMiddleware_1 = __nccwpck_require__(30637); -exports.httpAuthSchemeEndpointRuleSetMiddlewareOptions = { - step: "serialize", - tags: ["HTTP_AUTH_SCHEME"], - name: "httpAuthSchemeMiddleware", - override: true, - relation: "before", - toMiddleware: middleware_endpoint_1.endpointMiddlewareOptions.name, -}; -const getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo((0, httpAuthSchemeMiddleware_1.httpAuthSchemeMiddleware)(config, { - httpAuthSchemeParametersProvider, - identityProviderConfigProvider, - }), exports.httpAuthSchemeEndpointRuleSetMiddlewareOptions); - }, -}); -exports.getHttpAuthSchemeEndpointRuleSetPlugin = getHttpAuthSchemeEndpointRuleSetPlugin; - - -/***/ }), - -/***/ 79619: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getHttpAuthSchemePlugin = exports.httpAuthSchemeMiddlewareOptions = void 0; -const middleware_serde_1 = __nccwpck_require__(4247); -const httpAuthSchemeMiddleware_1 = __nccwpck_require__(30637); -exports.httpAuthSchemeMiddlewareOptions = { - step: "serialize", - tags: ["HTTP_AUTH_SCHEME"], - name: "httpAuthSchemeMiddleware", - override: true, - relation: "before", - toMiddleware: middleware_serde_1.serializerMiddlewareOption.name, -}; -const getHttpAuthSchemePlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo((0, httpAuthSchemeMiddleware_1.httpAuthSchemeMiddleware)(config, { - httpAuthSchemeParametersProvider, - identityProviderConfigProvider, - }), exports.httpAuthSchemeMiddlewareOptions); - }, -}); -exports.getHttpAuthSchemePlugin = getHttpAuthSchemePlugin; - - -/***/ }), - -/***/ 30637: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.httpAuthSchemeMiddleware = void 0; -const types_1 = __nccwpck_require__(75751); -const util_middleware_1 = __nccwpck_require__(81243); -function convertHttpAuthSchemesToMap(httpAuthSchemes) { - const map = new Map(); - for (const scheme of httpAuthSchemes) { - map.set(scheme.schemeId, scheme); - } - return map; -} -const httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => { - var _a; - const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input)); - const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes); - const smithyContext = (0, util_middleware_1.getSmithyContext)(context); - const failureReasons = []; - for (const option of options) { - const scheme = authSchemes.get(option.schemeId); - if (!scheme) { - failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`); - continue; - } - const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config)); - if (!identityProvider) { - failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`); - continue; - } - const { identityProperties = {}, signingProperties = {} } = ((_a = option.propertiesExtractor) === null || _a === void 0 ? void 0 : _a.call(option, config, context)) || {}; - option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties); - option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties); - smithyContext.selectedHttpAuthScheme = { - httpAuthOption: option, - identity: await identityProvider(option.identityProperties), - signer: scheme.signer, - }; - break; - } - if (!smithyContext.selectedHttpAuthScheme) { - throw new Error(failureReasons.join("\n")); - } - return next(args); -}; -exports.httpAuthSchemeMiddleware = httpAuthSchemeMiddleware; - - -/***/ }), - -/***/ 85286: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(6605); -tslib_1.__exportStar(__nccwpck_require__(30637), exports); -tslib_1.__exportStar(__nccwpck_require__(43742), exports); -tslib_1.__exportStar(__nccwpck_require__(79619), exports); - - -/***/ }), - -/***/ 33121: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getHttpSigningPlugin = exports.httpSigningMiddlewareOptions = void 0; -const middleware_retry_1 = __nccwpck_require__(54801); -const httpSigningMiddleware_1 = __nccwpck_require__(96503); -exports.httpSigningMiddlewareOptions = { - step: "finalizeRequest", - tags: ["HTTP_SIGNING"], - name: "httpSigningMiddleware", - aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"], - override: true, - relation: "after", - toMiddleware: middleware_retry_1.retryMiddlewareOptions.name, -}; -const getHttpSigningPlugin = (config) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo((0, httpSigningMiddleware_1.httpSigningMiddleware)(config), exports.httpSigningMiddlewareOptions); - }, -}); -exports.getHttpSigningPlugin = getHttpSigningPlugin; - - -/***/ }), - -/***/ 96503: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.httpSigningMiddleware = void 0; -const protocol_http_1 = __nccwpck_require__(45311); -const types_1 = __nccwpck_require__(75751); -const util_middleware_1 = __nccwpck_require__(81243); -const defaultErrorHandler = (signingProperties) => (error) => { - throw error; -}; -const defaultSuccessHandler = (httpResponse, signingProperties) => { }; -const httpSigningMiddleware = (config) => (next, context) => async (args) => { - if (!protocol_http_1.HttpRequest.isInstance(args.request)) { - return next(args); - } - const smithyContext = (0, util_middleware_1.getSmithyContext)(context); - const scheme = smithyContext.selectedHttpAuthScheme; - if (!scheme) { - throw new Error(`No HttpAuthScheme was selected: unable to sign request`); - } - const { httpAuthOption: { signingProperties = {} }, identity, signer, } = scheme; - const output = await next({ - ...args, - request: await signer.sign(args.request, identity, signingProperties), - }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties)); - (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties); - return output; -}; -exports.httpSigningMiddleware = httpSigningMiddleware; - - -/***/ }), - -/***/ 51847: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(6605); -tslib_1.__exportStar(__nccwpck_require__(96503), exports); -tslib_1.__exportStar(__nccwpck_require__(33121), exports); - - -/***/ }), - -/***/ 60235: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.normalizeProvider = void 0; -const normalizeProvider = (input) => { - if (typeof input === "function") - return input; - const promisified = Promise.resolve(input); - return () => promisified; -}; -exports.normalizeProvider = normalizeProvider; - - -/***/ }), - -/***/ 35966: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createPaginator = void 0; -const makePagedClientRequest = async (CommandCtor, client, input, ...args) => { - return await client.send(new CommandCtor(input), ...args); -}; -function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) { - return async function* paginateOperation(config, input, ...additionalArguments) { - var _a; - let token = config.startingToken || undefined; - let hasNext = true; - let page; - while (hasNext) { - input[inputTokenName] = token; - if (pageSizeTokenName) { - input[pageSizeTokenName] = (_a = input[pageSizeTokenName]) !== null && _a !== void 0 ? _a : config.pageSize; - } - if (config.client instanceof ClientCtor) { - page = await makePagedClientRequest(CommandCtor, config.client, input, ...additionalArguments); - } - else { - throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`); - } - yield page; - const prevToken = token; - token = page[outputTokenName]; - hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); - } - return undefined; - }; -} -exports.createPaginator = createPaginator; - - -/***/ }), - -/***/ 29962: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequestBuilder = exports.requestBuilder = void 0; -const protocol_http_1 = __nccwpck_require__(45311); -const smithy_client_1 = __nccwpck_require__(33218); -function requestBuilder(input, context) { - return new RequestBuilder(input, context); -} -exports.requestBuilder = requestBuilder; -class RequestBuilder { - constructor(input, context) { - this.input = input; - this.context = context; - this.query = {}; - this.method = ""; - this.headers = {}; - this.path = ""; - this.body = null; - this.hostname = ""; - this.resolvePathStack = []; - } - async build() { - const { hostname, protocol = "https", port, path: basePath } = await this.context.endpoint(); - this.path = basePath; - for (const resolvePath of this.resolvePathStack) { - resolvePath(this.path); - } - return new protocol_http_1.HttpRequest({ - protocol, - hostname: this.hostname || hostname, - port, - method: this.method, - path: this.path, - query: this.query, - body: this.body, - headers: this.headers, - }); - } - hn(hostname) { - this.hostname = hostname; - return this; - } - bp(uriLabel) { - this.resolvePathStack.push((basePath) => { - this.path = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + uriLabel; - }); - return this; - } - p(memberName, labelValueProvider, uriLabel, isGreedyLabel) { - this.resolvePathStack.push((path) => { - this.path = (0, smithy_client_1.resolvedPath)(path, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel); - }); - return this; - } - h(headers) { - this.headers = headers; - return this; - } - q(query) { - this.query = query; - return this; - } - b(body) { - this.body = body; - return this; - } - m(method) { - this.method = method; - return this; - } -} -exports.RequestBuilder = RequestBuilder; - - -/***/ }), - -/***/ 73771: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DefaultIdentityProviderConfig = void 0; -class DefaultIdentityProviderConfig { - constructor(config) { - this.authSchemes = new Map(); - for (const [key, value] of Object.entries(config)) { - if (value !== undefined) { - this.authSchemes.set(key, value); - } - } - } - getIdentityProvider(schemeId) { - return this.authSchemes.get(schemeId); - } -} -exports.DefaultIdentityProviderConfig = DefaultIdentityProviderConfig; - - -/***/ }), - -/***/ 81720: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpApiKeyAuthSigner = void 0; -const types_1 = __nccwpck_require__(75751); -class HttpApiKeyAuthSigner { - async sign(httpRequest, identity, signingProperties) { - if (!signingProperties) { - throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing"); - } - if (!signingProperties.name) { - throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing"); - } - if (!signingProperties.in) { - throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing"); - } - if (!identity.apiKey) { - throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined"); - } - const clonedRequest = httpRequest.clone(); - if (signingProperties.in === types_1.HttpApiKeyAuthLocation.QUERY) { - clonedRequest.query[signingProperties.name] = identity.apiKey; - } - else if (signingProperties.in === types_1.HttpApiKeyAuthLocation.HEADER) { - clonedRequest.headers[signingProperties.name] = signingProperties.scheme - ? `${signingProperties.scheme} ${identity.apiKey}` - : identity.apiKey; - } - else { - throw new Error("request can only be signed with `apiKey` locations `query` or `header`, " + - "but found: `" + - signingProperties.in + - "`"); - } - return clonedRequest; - } -} -exports.HttpApiKeyAuthSigner = HttpApiKeyAuthSigner; - - -/***/ }), - -/***/ 31721: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpBearerAuthSigner = void 0; -class HttpBearerAuthSigner { - async sign(httpRequest, identity, signingProperties) { - const clonedRequest = httpRequest.clone(); - if (!identity.token) { - throw new Error("request could not be signed with `token` since the `token` is not defined"); - } - clonedRequest.headers["Authorization"] = `Bearer ${identity.token}`; - return clonedRequest; - } -} -exports.HttpBearerAuthSigner = HttpBearerAuthSigner; - - -/***/ }), - -/***/ 31834: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(6605); -tslib_1.__exportStar(__nccwpck_require__(81720), exports); -tslib_1.__exportStar(__nccwpck_require__(31721), exports); -tslib_1.__exportStar(__nccwpck_require__(83435), exports); - - -/***/ }), - -/***/ 83435: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NoAuthSigner = void 0; -class NoAuthSigner { - async sign(httpRequest, identity, signingProperties) { - return httpRequest; - } -} -exports.NoAuthSigner = NoAuthSigner; - - -/***/ }), - -/***/ 38461: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(6605); -tslib_1.__exportStar(__nccwpck_require__(73771), exports); -tslib_1.__exportStar(__nccwpck_require__(31834), exports); -tslib_1.__exportStar(__nccwpck_require__(8980), exports); - - -/***/ }), - -/***/ 8980: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.memoizeIdentityProvider = exports.doesIdentityRequireRefresh = exports.isIdentityExpired = exports.EXPIRATION_MS = exports.createIsIdentityExpiredFunction = void 0; -const createIsIdentityExpiredFunction = (expirationMs) => (identity) => (0, exports.doesIdentityRequireRefresh)(identity) && identity.expiration.getTime() - Date.now() < expirationMs; -exports.createIsIdentityExpiredFunction = createIsIdentityExpiredFunction; -exports.EXPIRATION_MS = 300000; -exports.isIdentityExpired = (0, exports.createIsIdentityExpiredFunction)(exports.EXPIRATION_MS); -const doesIdentityRequireRefresh = (identity) => identity.expiration !== undefined; -exports.doesIdentityRequireRefresh = doesIdentityRequireRefresh; -const memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => { - if (provider === undefined) { - return undefined; - } - const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider; - let resolved; - let pending; - let hasResult; - let isConstant = false; - const coalesceProvider = async (options) => { - if (!pending) { - pending = normalizedProvider(options); - } - try { - resolved = await pending; - hasResult = true; - isConstant = false; - } - finally { - pending = undefined; - } - return resolved; - }; - if (isExpired === undefined) { - return async (options) => { - if (!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh)) { - resolved = await coalesceProvider(options); - } - return resolved; - }; - } - return async (options) => { - if (!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh)) { - resolved = await coalesceProvider(options); - } - if (isConstant) { - return resolved; - } - if (!requiresRefresh(resolved)) { - isConstant = true; - return resolved; - } - if (isExpired(resolved)) { - await coalesceProvider(options); - return resolved; - } - return resolved; - }; -}; -exports.memoizeIdentityProvider = memoizeIdentityProvider; - - -/***/ }), - -/***/ 6605: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 56028: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Endpoint = void 0; -var Endpoint; -(function (Endpoint) { - Endpoint["IPv4"] = "http://169.254.169.254"; - Endpoint["IPv6"] = "http://[fd00:ec2::254]"; -})(Endpoint = exports.Endpoint || (exports.Endpoint = {})); - - -/***/ }), - -/***/ 28366: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ENDPOINT_CONFIG_OPTIONS = exports.CONFIG_ENDPOINT_NAME = exports.ENV_ENDPOINT_NAME = void 0; -exports.ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT"; -exports.CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint"; -exports.ENDPOINT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[exports.ENV_ENDPOINT_NAME], - configFileSelector: (profile) => profile[exports.CONFIG_ENDPOINT_NAME], - default: undefined, -}; - - -/***/ }), - -/***/ 1988: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointMode = void 0; -var EndpointMode; -(function (EndpointMode) { - EndpointMode["IPv4"] = "IPv4"; - EndpointMode["IPv6"] = "IPv6"; -})(EndpointMode = exports.EndpointMode || (exports.EndpointMode = {})); - - -/***/ }), - -/***/ 76819: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ENDPOINT_MODE_CONFIG_OPTIONS = exports.CONFIG_ENDPOINT_MODE_NAME = exports.ENV_ENDPOINT_MODE_NAME = void 0; -const EndpointMode_1 = __nccwpck_require__(1988); -exports.ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE"; -exports.CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode"; -exports.ENDPOINT_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[exports.ENV_ENDPOINT_MODE_NAME], - configFileSelector: (profile) => profile[exports.CONFIG_ENDPOINT_MODE_NAME], - default: EndpointMode_1.EndpointMode.IPv4, -}; - - -/***/ }), - -/***/ 57740: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.InstanceMetadataV1FallbackError = void 0; -const property_provider_1 = __nccwpck_require__(12955); -class InstanceMetadataV1FallbackError extends property_provider_1.CredentialsProviderError { - constructor(message, tryNextLink = true) { - super(message, tryNextLink); - this.tryNextLink = tryNextLink; - this.name = "InstanceMetadataV1FallbackError"; - Object.setPrototypeOf(this, InstanceMetadataV1FallbackError.prototype); - } -} -exports.InstanceMetadataV1FallbackError = InstanceMetadataV1FallbackError; - - -/***/ }), - -/***/ 11957: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromContainerMetadata = exports.ENV_CMDS_AUTH_TOKEN = exports.ENV_CMDS_RELATIVE_URI = exports.ENV_CMDS_FULL_URI = void 0; -const property_provider_1 = __nccwpck_require__(12955); -const url_1 = __nccwpck_require__(57310); -const httpRequest_1 = __nccwpck_require__(59002); -const ImdsCredentials_1 = __nccwpck_require__(15737); -const RemoteProviderInit_1 = __nccwpck_require__(58969); -const retry_1 = __nccwpck_require__(9919); -exports.ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; -exports.ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; -exports.ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; -const fromContainerMetadata = (init = {}) => { - const { timeout, maxRetries } = (0, RemoteProviderInit_1.providerConfigFromInit)(init); - return () => (0, retry_1.retry)(async () => { - const requestOptions = await getCmdsUri(); - const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions)); - if (!(0, ImdsCredentials_1.isImdsCredentials)(credsResponse)) { - throw new property_provider_1.CredentialsProviderError("Invalid response received from instance metadata service."); - } - return (0, ImdsCredentials_1.fromImdsCredentials)(credsResponse); - }, maxRetries); -}; -exports.fromContainerMetadata = fromContainerMetadata; -const requestFromEcsImds = async (timeout, options) => { - if (process.env[exports.ENV_CMDS_AUTH_TOKEN]) { - options.headers = { - ...options.headers, - Authorization: process.env[exports.ENV_CMDS_AUTH_TOKEN], - }; - } - const buffer = await (0, httpRequest_1.httpRequest)({ - ...options, - timeout, - }); - return buffer.toString(); -}; -const CMDS_IP = "169.254.170.2"; -const GREENGRASS_HOSTS = { - localhost: true, - "127.0.0.1": true, -}; -const GREENGRASS_PROTOCOLS = { - "http:": true, - "https:": true, -}; -const getCmdsUri = async () => { - if (process.env[exports.ENV_CMDS_RELATIVE_URI]) { - return { - hostname: CMDS_IP, - path: process.env[exports.ENV_CMDS_RELATIVE_URI], - }; - } - if (process.env[exports.ENV_CMDS_FULL_URI]) { - const parsed = (0, url_1.parse)(process.env[exports.ENV_CMDS_FULL_URI]); - if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) { - throw new property_provider_1.CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, false); - } - if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) { - throw new property_provider_1.CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, false); - } - return { - ...parsed, - port: parsed.port ? parseInt(parsed.port, 10) : undefined, - }; - } - throw new property_provider_1.CredentialsProviderError("The container metadata credential provider cannot be used unless" + - ` the ${exports.ENV_CMDS_RELATIVE_URI} or ${exports.ENV_CMDS_FULL_URI} environment` + - " variable is set", false); -}; - - -/***/ }), - -/***/ 72909: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromInstanceMetadata = void 0; -const node_config_provider_1 = __nccwpck_require__(13079); -const property_provider_1 = __nccwpck_require__(12955); -const InstanceMetadataV1FallbackError_1 = __nccwpck_require__(57740); -const httpRequest_1 = __nccwpck_require__(59002); -const ImdsCredentials_1 = __nccwpck_require__(15737); -const RemoteProviderInit_1 = __nccwpck_require__(58969); -const retry_1 = __nccwpck_require__(9919); -const getInstanceMetadataEndpoint_1 = __nccwpck_require__(44877); -const staticStabilityProvider_1 = __nccwpck_require__(12868); -const IMDS_PATH = "/latest/meta-data/iam/security-credentials/"; -const IMDS_TOKEN_PATH = "/latest/api/token"; -const AWS_EC2_METADATA_V1_DISABLED = "AWS_EC2_METADATA_V1_DISABLED"; -const PROFILE_AWS_EC2_METADATA_V1_DISABLED = "ec2_metadata_v1_disabled"; -const X_AWS_EC2_METADATA_TOKEN = "x-aws-ec2-metadata-token"; -const fromInstanceMetadata = (init = {}) => (0, staticStabilityProvider_1.staticStabilityProvider)(getInstanceImdsProvider(init), { logger: init.logger }); -exports.fromInstanceMetadata = fromInstanceMetadata; -const getInstanceImdsProvider = (init) => { - let disableFetchToken = false; - const { logger, profile } = init; - const { timeout, maxRetries } = (0, RemoteProviderInit_1.providerConfigFromInit)(init); - const getCredentials = async (maxRetries, options) => { - var _a; - const isImdsV1Fallback = disableFetchToken || ((_a = options.headers) === null || _a === void 0 ? void 0 : _a[X_AWS_EC2_METADATA_TOKEN]) == null; - if (isImdsV1Fallback) { - let fallbackBlockedFromProfile = false; - let fallbackBlockedFromProcessEnv = false; - const configValue = await (0, node_config_provider_1.loadConfig)({ - environmentVariableSelector: (env) => { - const envValue = env[AWS_EC2_METADATA_V1_DISABLED]; - fallbackBlockedFromProcessEnv = !!envValue && envValue !== "false"; - if (envValue === undefined) { - throw new property_provider_1.CredentialsProviderError(`${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`); - } - return fallbackBlockedFromProcessEnv; - }, - configFileSelector: (profile) => { - const profileValue = profile[PROFILE_AWS_EC2_METADATA_V1_DISABLED]; - fallbackBlockedFromProfile = !!profileValue && profileValue !== "false"; - return fallbackBlockedFromProfile; - }, - default: false, - }, { - profile, - })(); - if (init.ec2MetadataV1Disabled || configValue) { - const causes = []; - if (init.ec2MetadataV1Disabled) - causes.push("credential provider initialization (runtime option ec2MetadataV1Disabled)"); - if (fallbackBlockedFromProfile) - causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`); - if (fallbackBlockedFromProcessEnv) - causes.push(`process environment variable (${AWS_EC2_METADATA_V1_DISABLED})`); - throw new InstanceMetadataV1FallbackError_1.InstanceMetadataV1FallbackError(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${causes.join(", ")}].`); - } - } - const imdsProfile = (await (0, retry_1.retry)(async () => { - let profile; - try { - profile = await getProfile(options); - } - catch (err) { - if (err.statusCode === 401) { - disableFetchToken = false; - } - throw err; - } - return profile; - }, maxRetries)).trim(); - return (0, retry_1.retry)(async () => { - let creds; - try { - creds = await getCredentialsFromProfile(imdsProfile, options); - } - catch (err) { - if (err.statusCode === 401) { - disableFetchToken = false; - } - throw err; - } - return creds; - }, maxRetries); - }; - return async () => { - const endpoint = await (0, getInstanceMetadataEndpoint_1.getInstanceMetadataEndpoint)(); - if (disableFetchToken) { - logger === null || logger === void 0 ? void 0 : logger.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)"); - return getCredentials(maxRetries, { ...endpoint, timeout }); - } - else { - let token; - try { - token = (await getMetadataToken({ ...endpoint, timeout })).toString(); - } - catch (error) { - if ((error === null || error === void 0 ? void 0 : error.statusCode) === 400) { - throw Object.assign(error, { - message: "EC2 Metadata token request returned error", - }); - } - else if (error.message === "TimeoutError" || [403, 404, 405].includes(error.statusCode)) { - disableFetchToken = true; - } - logger === null || logger === void 0 ? void 0 : logger.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)"); - return getCredentials(maxRetries, { ...endpoint, timeout }); - } - return getCredentials(maxRetries, { - ...endpoint, - headers: { - [X_AWS_EC2_METADATA_TOKEN]: token, - }, - timeout, - }); - } - }; -}; -const getMetadataToken = async (options) => (0, httpRequest_1.httpRequest)({ - ...options, - path: IMDS_TOKEN_PATH, - method: "PUT", - headers: { - "x-aws-ec2-metadata-token-ttl-seconds": "21600", - }, -}); -const getProfile = async (options) => (await (0, httpRequest_1.httpRequest)({ ...options, path: IMDS_PATH })).toString(); -const getCredentialsFromProfile = async (profile, options) => { - const credsResponse = JSON.parse((await (0, httpRequest_1.httpRequest)({ - ...options, - path: IMDS_PATH + profile, - })).toString()); - if (!(0, ImdsCredentials_1.isImdsCredentials)(credsResponse)) { - throw new property_provider_1.CredentialsProviderError("Invalid response received from instance metadata service."); - } - return (0, ImdsCredentials_1.fromImdsCredentials)(credsResponse); -}; - - -/***/ }), - -/***/ 34673: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getInstanceMetadataEndpoint = exports.httpRequest = void 0; -const tslib_1 = __nccwpck_require__(27222); -tslib_1.__exportStar(__nccwpck_require__(11957), exports); -tslib_1.__exportStar(__nccwpck_require__(72909), exports); -tslib_1.__exportStar(__nccwpck_require__(58969), exports); -tslib_1.__exportStar(__nccwpck_require__(11472), exports); -var httpRequest_1 = __nccwpck_require__(59002); -Object.defineProperty(exports, "httpRequest", ({ enumerable: true, get: function () { return httpRequest_1.httpRequest; } })); -var getInstanceMetadataEndpoint_1 = __nccwpck_require__(44877); -Object.defineProperty(exports, "getInstanceMetadataEndpoint", ({ enumerable: true, get: function () { return getInstanceMetadataEndpoint_1.getInstanceMetadataEndpoint; } })); - - -/***/ }), - -/***/ 15737: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromImdsCredentials = exports.isImdsCredentials = void 0; -const isImdsCredentials = (arg) => Boolean(arg) && - typeof arg === "object" && - typeof arg.AccessKeyId === "string" && - typeof arg.SecretAccessKey === "string" && - typeof arg.Token === "string" && - typeof arg.Expiration === "string"; -exports.isImdsCredentials = isImdsCredentials; -const fromImdsCredentials = (creds) => ({ - accessKeyId: creds.AccessKeyId, - secretAccessKey: creds.SecretAccessKey, - sessionToken: creds.Token, - expiration: new Date(creds.Expiration), -}); -exports.fromImdsCredentials = fromImdsCredentials; - - -/***/ }), - -/***/ 58969: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.providerConfigFromInit = exports.DEFAULT_MAX_RETRIES = exports.DEFAULT_TIMEOUT = void 0; -exports.DEFAULT_TIMEOUT = 1000; -exports.DEFAULT_MAX_RETRIES = 0; -const providerConfigFromInit = ({ maxRetries = exports.DEFAULT_MAX_RETRIES, timeout = exports.DEFAULT_TIMEOUT, }) => ({ maxRetries, timeout }); -exports.providerConfigFromInit = providerConfigFromInit; - - -/***/ }), - -/***/ 59002: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.httpRequest = void 0; -const property_provider_1 = __nccwpck_require__(12955); -const buffer_1 = __nccwpck_require__(14300); -const http_1 = __nccwpck_require__(13685); -function httpRequest(options) { - return new Promise((resolve, reject) => { - var _a; - const req = (0, http_1.request)({ - method: "GET", - ...options, - hostname: (_a = options.hostname) === null || _a === void 0 ? void 0 : _a.replace(/^\[(.+)\]$/, "$1"), - }); - req.on("error", (err) => { - reject(Object.assign(new property_provider_1.ProviderError("Unable to connect to instance metadata service"), err)); - req.destroy(); - }); - req.on("timeout", () => { - reject(new property_provider_1.ProviderError("TimeoutError from instance metadata service")); - req.destroy(); - }); - req.on("response", (res) => { - const { statusCode = 400 } = res; - if (statusCode < 200 || 300 <= statusCode) { - reject(Object.assign(new property_provider_1.ProviderError("Error response received from instance metadata service"), { statusCode })); - req.destroy(); - } - const chunks = []; - res.on("data", (chunk) => { - chunks.push(chunk); - }); - res.on("end", () => { - resolve(buffer_1.Buffer.concat(chunks)); - req.destroy(); - }); - }); - req.end(); - }); -} -exports.httpRequest = httpRequest; - - -/***/ }), - -/***/ 9919: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.retry = void 0; -const retry = (toRetry, maxRetries) => { - let promise = toRetry(); - for (let i = 0; i < maxRetries; i++) { - promise = promise.catch(toRetry); - } - return promise; -}; -exports.retry = retry; - - -/***/ }), - -/***/ 11472: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 43201: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getExtendedInstanceMetadataCredentials = void 0; -const STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60; -const STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60; -const STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html"; -const getExtendedInstanceMetadataCredentials = (credentials, logger) => { - var _a; - const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + - Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS); - const newExpiration = new Date(Date.now() + refreshInterval * 1000); - logger.warn("Attempting credential expiration extension due to a credential service availability issue. A refresh of these " + - "credentials will be attempted after ${new Date(newExpiration)}.\nFor more information, please visit: " + - STATIC_STABILITY_DOC_URL); - const originalExpiration = (_a = credentials.originalExpiration) !== null && _a !== void 0 ? _a : credentials.expiration; - return { - ...credentials, - ...(originalExpiration ? { originalExpiration } : {}), - expiration: newExpiration, - }; -}; -exports.getExtendedInstanceMetadataCredentials = getExtendedInstanceMetadataCredentials; - - -/***/ }), - -/***/ 44877: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getInstanceMetadataEndpoint = void 0; -const node_config_provider_1 = __nccwpck_require__(13079); -const url_parser_1 = __nccwpck_require__(98245); -const Endpoint_1 = __nccwpck_require__(56028); -const EndpointConfigOptions_1 = __nccwpck_require__(28366); -const EndpointMode_1 = __nccwpck_require__(1988); -const EndpointModeConfigOptions_1 = __nccwpck_require__(76819); -const getInstanceMetadataEndpoint = async () => (0, url_parser_1.parseUrl)((await getFromEndpointConfig()) || (await getFromEndpointModeConfig())); -exports.getInstanceMetadataEndpoint = getInstanceMetadataEndpoint; -const getFromEndpointConfig = async () => (0, node_config_provider_1.loadConfig)(EndpointConfigOptions_1.ENDPOINT_CONFIG_OPTIONS)(); -const getFromEndpointModeConfig = async () => { - const endpointMode = await (0, node_config_provider_1.loadConfig)(EndpointModeConfigOptions_1.ENDPOINT_MODE_CONFIG_OPTIONS)(); - switch (endpointMode) { - case EndpointMode_1.EndpointMode.IPv4: - return Endpoint_1.Endpoint.IPv4; - case EndpointMode_1.EndpointMode.IPv6: - return Endpoint_1.Endpoint.IPv6; - default: - throw new Error(`Unsupported endpoint mode: ${endpointMode}.` + ` Select from ${Object.values(EndpointMode_1.EndpointMode)}`); - } -}; - - -/***/ }), - -/***/ 12868: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.staticStabilityProvider = void 0; -const getExtendedInstanceMetadataCredentials_1 = __nccwpck_require__(43201); -const staticStabilityProvider = (provider, options = {}) => { - const logger = (options === null || options === void 0 ? void 0 : options.logger) || console; - let pastCredentials; - return async () => { - let credentials; - try { - credentials = await provider(); - if (credentials.expiration && credentials.expiration.getTime() < Date.now()) { - credentials = (0, getExtendedInstanceMetadataCredentials_1.getExtendedInstanceMetadataCredentials)(credentials, logger); - } - } - catch (e) { - if (pastCredentials) { - logger.warn("Credential renew failed: ", e); - credentials = (0, getExtendedInstanceMetadataCredentials_1.getExtendedInstanceMetadataCredentials)(pastCredentials, logger); - } - else { - throw e; - } - } - pastCredentials = credentials; - return credentials; - }; -}; -exports.staticStabilityProvider = staticStabilityProvider; - - -/***/ }), - -/***/ 27222: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 66941: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EventStreamCodec = void 0; -const crc32_1 = __nccwpck_require__(30343); -const HeaderMarshaller_1 = __nccwpck_require__(47987); -const splitMessage_1 = __nccwpck_require__(52963); -class EventStreamCodec { - constructor(toUtf8, fromUtf8) { - this.headerMarshaller = new HeaderMarshaller_1.HeaderMarshaller(toUtf8, fromUtf8); - this.messageBuffer = []; - this.isEndOfStream = false; - } - feed(message) { - this.messageBuffer.push(this.decode(message)); - } - endOfStream() { - this.isEndOfStream = true; - } - getMessage() { - const message = this.messageBuffer.pop(); - const isEndOfStream = this.isEndOfStream; - return { - getMessage() { - return message; - }, - isEndOfStream() { - return isEndOfStream; - }, - }; - } - getAvailableMessages() { - const messages = this.messageBuffer; - this.messageBuffer = []; - const isEndOfStream = this.isEndOfStream; - return { - getMessages() { - return messages; - }, - isEndOfStream() { - return isEndOfStream; - }, - }; - } - encode({ headers: rawHeaders, body }) { - const headers = this.headerMarshaller.format(rawHeaders); - const length = headers.byteLength + body.byteLength + 16; - const out = new Uint8Array(length); - const view = new DataView(out.buffer, out.byteOffset, out.byteLength); - const checksum = new crc32_1.Crc32(); - view.setUint32(0, length, false); - view.setUint32(4, headers.byteLength, false); - view.setUint32(8, checksum.update(out.subarray(0, 8)).digest(), false); - out.set(headers, 12); - out.set(body, headers.byteLength + 12); - view.setUint32(length - 4, checksum.update(out.subarray(8, length - 4)).digest(), false); - return out; - } - decode(message) { - const { headers, body } = (0, splitMessage_1.splitMessage)(message); - return { headers: this.headerMarshaller.parse(headers), body }; - } - formatHeaders(rawHeaders) { - return this.headerMarshaller.format(rawHeaders); - } -} -exports.EventStreamCodec = EventStreamCodec; - - -/***/ }), - -/***/ 47987: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HeaderMarshaller = void 0; -const util_hex_encoding_1 = __nccwpck_require__(61027); -const Int64_1 = __nccwpck_require__(54876); -class HeaderMarshaller { - constructor(toUtf8, fromUtf8) { - this.toUtf8 = toUtf8; - this.fromUtf8 = fromUtf8; - } - format(headers) { - const chunks = []; - for (const headerName of Object.keys(headers)) { - const bytes = this.fromUtf8(headerName); - chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName])); - } - const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0)); - let position = 0; - for (const chunk of chunks) { - out.set(chunk, position); - position += chunk.byteLength; - } - return out; - } - formatHeaderValue(header) { - switch (header.type) { - case "boolean": - return Uint8Array.from([header.value ? 0 : 1]); - case "byte": - return Uint8Array.from([2, header.value]); - case "short": - const shortView = new DataView(new ArrayBuffer(3)); - shortView.setUint8(0, 3); - shortView.setInt16(1, header.value, false); - return new Uint8Array(shortView.buffer); - case "integer": - const intView = new DataView(new ArrayBuffer(5)); - intView.setUint8(0, 4); - intView.setInt32(1, header.value, false); - return new Uint8Array(intView.buffer); - case "long": - const longBytes = new Uint8Array(9); - longBytes[0] = 5; - longBytes.set(header.value.bytes, 1); - return longBytes; - case "binary": - const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength)); - binView.setUint8(0, 6); - binView.setUint16(1, header.value.byteLength, false); - const binBytes = new Uint8Array(binView.buffer); - binBytes.set(header.value, 3); - return binBytes; - case "string": - const utf8Bytes = this.fromUtf8(header.value); - const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength)); - strView.setUint8(0, 7); - strView.setUint16(1, utf8Bytes.byteLength, false); - const strBytes = new Uint8Array(strView.buffer); - strBytes.set(utf8Bytes, 3); - return strBytes; - case "timestamp": - const tsBytes = new Uint8Array(9); - tsBytes[0] = 8; - tsBytes.set(Int64_1.Int64.fromNumber(header.value.valueOf()).bytes, 1); - return tsBytes; - case "uuid": - if (!UUID_PATTERN.test(header.value)) { - throw new Error(`Invalid UUID received: ${header.value}`); - } - const uuidBytes = new Uint8Array(17); - uuidBytes[0] = 9; - uuidBytes.set((0, util_hex_encoding_1.fromHex)(header.value.replace(/\-/g, "")), 1); - return uuidBytes; - } - } - parse(headers) { - const out = {}; - let position = 0; - while (position < headers.byteLength) { - const nameLength = headers.getUint8(position++); - const name = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength)); - position += nameLength; - switch (headers.getUint8(position++)) { - case 0: - out[name] = { - type: BOOLEAN_TAG, - value: true, - }; - break; - case 1: - out[name] = { - type: BOOLEAN_TAG, - value: false, - }; - break; - case 2: - out[name] = { - type: BYTE_TAG, - value: headers.getInt8(position++), - }; - break; - case 3: - out[name] = { - type: SHORT_TAG, - value: headers.getInt16(position, false), - }; - position += 2; - break; - case 4: - out[name] = { - type: INT_TAG, - value: headers.getInt32(position, false), - }; - position += 4; - break; - case 5: - out[name] = { - type: LONG_TAG, - value: new Int64_1.Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)), - }; - position += 8; - break; - case 6: - const binaryLength = headers.getUint16(position, false); - position += 2; - out[name] = { - type: BINARY_TAG, - value: new Uint8Array(headers.buffer, headers.byteOffset + position, binaryLength), - }; - position += binaryLength; - break; - case 7: - const stringLength = headers.getUint16(position, false); - position += 2; - out[name] = { - type: STRING_TAG, - value: this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, stringLength)), - }; - position += stringLength; - break; - case 8: - out[name] = { - type: TIMESTAMP_TAG, - value: new Date(new Int64_1.Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf()), - }; - position += 8; - break; - case 9: - const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16); - position += 16; - out[name] = { - type: UUID_TAG, - value: `${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(0, 4))}-${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(4, 6))}-${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(6, 8))}-${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(8, 10))}-${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(10))}`, - }; - break; - default: - throw new Error(`Unrecognized header type tag`); - } - } - return out; - } -} -exports.HeaderMarshaller = HeaderMarshaller; -var HEADER_VALUE_TYPE; -(function (HEADER_VALUE_TYPE) { - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["boolTrue"] = 0] = "boolTrue"; - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["boolFalse"] = 1] = "boolFalse"; - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["byte"] = 2] = "byte"; - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["short"] = 3] = "short"; - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["integer"] = 4] = "integer"; - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["long"] = 5] = "long"; - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["byteArray"] = 6] = "byteArray"; - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["string"] = 7] = "string"; - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["timestamp"] = 8] = "timestamp"; - HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["uuid"] = 9] = "uuid"; -})(HEADER_VALUE_TYPE || (HEADER_VALUE_TYPE = {})); -const BOOLEAN_TAG = "boolean"; -const BYTE_TAG = "byte"; -const SHORT_TAG = "short"; -const INT_TAG = "integer"; -const LONG_TAG = "long"; -const BINARY_TAG = "binary"; -const STRING_TAG = "string"; -const TIMESTAMP_TAG = "timestamp"; -const UUID_TAG = "uuid"; -const UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; - - -/***/ }), - -/***/ 54876: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Int64 = void 0; -const util_hex_encoding_1 = __nccwpck_require__(61027); -class Int64 { - constructor(bytes) { - this.bytes = bytes; - if (bytes.byteLength !== 8) { - throw new Error("Int64 buffers must be exactly 8 bytes"); - } - } - static fromNumber(number) { - if (number > 9223372036854776000 || number < -9223372036854776000) { - throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`); - } - const bytes = new Uint8Array(8); - for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) { - bytes[i] = remaining; - } - if (number < 0) { - negate(bytes); - } - return new Int64(bytes); - } - valueOf() { - const bytes = this.bytes.slice(0); - const negative = bytes[0] & 0b10000000; - if (negative) { - negate(bytes); - } - return parseInt((0, util_hex_encoding_1.toHex)(bytes), 16) * (negative ? -1 : 1); - } - toString() { - return String(this.valueOf()); - } -} -exports.Int64 = Int64; -function negate(bytes) { - for (let i = 0; i < 8; i++) { - bytes[i] ^= 0xff; - } - for (let i = 7; i > -1; i--) { - bytes[i]++; - if (bytes[i] !== 0) - break; - } -} - - -/***/ }), - -/***/ 19705: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 28338: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MessageDecoderStream = void 0; -class MessageDecoderStream { - constructor(options) { - this.options = options; - } - [Symbol.asyncIterator]() { - return this.asyncIterator(); - } - async *asyncIterator() { - for await (const bytes of this.options.inputStream) { - const decoded = this.options.decoder.decode(bytes); - yield decoded; - } - } -} -exports.MessageDecoderStream = MessageDecoderStream; - - -/***/ }), - -/***/ 7130: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MessageEncoderStream = void 0; -class MessageEncoderStream { - constructor(options) { - this.options = options; - } - [Symbol.asyncIterator]() { - return this.asyncIterator(); - } - async *asyncIterator() { - for await (const msg of this.options.messageStream) { - const encoded = this.options.encoder.encode(msg); - yield encoded; - } - if (this.options.includeEndFrame) { - yield new Uint8Array(0); - } - } -} -exports.MessageEncoderStream = MessageEncoderStream; - - -/***/ }), - -/***/ 41598: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SmithyMessageDecoderStream = void 0; -class SmithyMessageDecoderStream { - constructor(options) { - this.options = options; - } - [Symbol.asyncIterator]() { - return this.asyncIterator(); - } - async *asyncIterator() { - for await (const message of this.options.messageStream) { - const deserialized = await this.options.deserializer(message); - if (deserialized === undefined) - continue; - yield deserialized; - } - } -} -exports.SmithyMessageDecoderStream = SmithyMessageDecoderStream; - - -/***/ }), - -/***/ 72548: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SmithyMessageEncoderStream = void 0; -class SmithyMessageEncoderStream { - constructor(options) { - this.options = options; - } - [Symbol.asyncIterator]() { - return this.asyncIterator(); - } - async *asyncIterator() { - for await (const chunk of this.options.inputStream) { - const payloadBuf = this.options.serializer(chunk); - yield payloadBuf; - } - } -} -exports.SmithyMessageEncoderStream = SmithyMessageEncoderStream; - - -/***/ }), - -/***/ 58152: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(28530); -tslib_1.__exportStar(__nccwpck_require__(66941), exports); -tslib_1.__exportStar(__nccwpck_require__(47987), exports); -tslib_1.__exportStar(__nccwpck_require__(54876), exports); -tslib_1.__exportStar(__nccwpck_require__(19705), exports); -tslib_1.__exportStar(__nccwpck_require__(28338), exports); -tslib_1.__exportStar(__nccwpck_require__(7130), exports); -tslib_1.__exportStar(__nccwpck_require__(41598), exports); -tslib_1.__exportStar(__nccwpck_require__(72548), exports); - - -/***/ }), - -/***/ 52963: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.splitMessage = void 0; -const crc32_1 = __nccwpck_require__(30343); -const PRELUDE_MEMBER_LENGTH = 4; -const PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2; -const CHECKSUM_LENGTH = 4; -const MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2; -function splitMessage({ byteLength, byteOffset, buffer }) { - if (byteLength < MINIMUM_MESSAGE_LENGTH) { - throw new Error("Provided message too short to accommodate event stream message overhead"); - } - const view = new DataView(buffer, byteOffset, byteLength); - const messageLength = view.getUint32(0, false); - if (byteLength !== messageLength) { - throw new Error("Reported message length does not match received message length"); - } - const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false); - const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false); - const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false); - const checksummer = new crc32_1.Crc32().update(new Uint8Array(buffer, byteOffset, PRELUDE_LENGTH)); - if (expectedPreludeChecksum !== checksummer.digest()) { - throw new Error(`The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digest()})`); - } - checksummer.update(new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH, byteLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH))); - if (expectedMessageChecksum !== checksummer.digest()) { - throw new Error(`The message checksum (${checksummer.digest()}) did not match the expected value of ${expectedMessageChecksum}`); - } - return { - headers: new DataView(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH, headerLength), - body: new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH + headerLength, messageLength - headerLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH + CHECKSUM_LENGTH)), - }; -} -exports.splitMessage = splitMessage; - - -/***/ }), - -/***/ 28530: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 40117: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveEventStreamSerdeConfig = void 0; -const resolveEventStreamSerdeConfig = (input) => ({ - ...input, - eventStreamMarshaller: input.eventStreamSerdeProvider(input), -}); -exports.resolveEventStreamSerdeConfig = resolveEventStreamSerdeConfig; - - -/***/ }), - -/***/ 33299: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(37643); -tslib_1.__exportStar(__nccwpck_require__(40117), exports); - - -/***/ }), - -/***/ 37643: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 12662: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EventStreamMarshaller = void 0; -const eventstream_serde_universal_1 = __nccwpck_require__(91372); -const stream_1 = __nccwpck_require__(12781); -const utils_1 = __nccwpck_require__(25188); -class EventStreamMarshaller { - constructor({ utf8Encoder, utf8Decoder }) { - this.universalMarshaller = new eventstream_serde_universal_1.EventStreamMarshaller({ - utf8Decoder, - utf8Encoder, - }); - } - deserialize(body, deserializer) { - const bodyIterable = typeof body[Symbol.asyncIterator] === "function" ? body : (0, utils_1.readabletoIterable)(body); - return this.universalMarshaller.deserialize(bodyIterable, deserializer); - } - serialize(input, serializer) { - return stream_1.Readable.from(this.universalMarshaller.serialize(input, serializer)); - } -} -exports.EventStreamMarshaller = EventStreamMarshaller; - - -/***/ }), - -/***/ 6293: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(67586); -tslib_1.__exportStar(__nccwpck_require__(12662), exports); -tslib_1.__exportStar(__nccwpck_require__(93043), exports); - - -/***/ }), - -/***/ 93043: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.eventStreamSerdeProvider = void 0; -const EventStreamMarshaller_1 = __nccwpck_require__(12662); -const eventStreamSerdeProvider = (options) => new EventStreamMarshaller_1.EventStreamMarshaller(options); -exports.eventStreamSerdeProvider = eventStreamSerdeProvider; - - -/***/ }), - -/***/ 25188: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.readabletoIterable = void 0; -async function* readabletoIterable(readStream) { - let streamEnded = false; - let generationEnded = false; - const records = new Array(); - readStream.on("error", (err) => { - if (!streamEnded) { - streamEnded = true; - } - if (err) { - throw err; - } - }); - readStream.on("data", (data) => { - records.push(data); - }); - readStream.on("end", () => { - streamEnded = true; - }); - while (!generationEnded) { - const value = await new Promise((resolve) => setTimeout(() => resolve(records.shift()), 0)); - if (value) { - yield value; - } - generationEnded = streamEnded && records.length === 0; - } -} -exports.readabletoIterable = readabletoIterable; - - -/***/ }), - -/***/ 67586: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 6913: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EventStreamMarshaller = void 0; -const eventstream_codec_1 = __nccwpck_require__(58152); -const getChunkedStream_1 = __nccwpck_require__(14614); -const getUnmarshalledStream_1 = __nccwpck_require__(94504); -class EventStreamMarshaller { - constructor({ utf8Encoder, utf8Decoder }) { - this.eventStreamCodec = new eventstream_codec_1.EventStreamCodec(utf8Encoder, utf8Decoder); - this.utfEncoder = utf8Encoder; - } - deserialize(body, deserializer) { - const inputStream = (0, getChunkedStream_1.getChunkedStream)(body); - return new eventstream_codec_1.SmithyMessageDecoderStream({ - messageStream: new eventstream_codec_1.MessageDecoderStream({ inputStream, decoder: this.eventStreamCodec }), - deserializer: (0, getUnmarshalledStream_1.getMessageUnmarshaller)(deserializer, this.utfEncoder), - }); - } - serialize(inputStream, serializer) { - return new eventstream_codec_1.MessageEncoderStream({ - messageStream: new eventstream_codec_1.SmithyMessageEncoderStream({ inputStream, serializer }), - encoder: this.eventStreamCodec, - includeEndFrame: true, - }); - } -} -exports.EventStreamMarshaller = EventStreamMarshaller; - - -/***/ }), - -/***/ 14614: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getChunkedStream = void 0; -function getChunkedStream(source) { - let currentMessageTotalLength = 0; - let currentMessagePendingLength = 0; - let currentMessage = null; - let messageLengthBuffer = null; - const allocateMessage = (size) => { - if (typeof size !== "number") { - throw new Error("Attempted to allocate an event message where size was not a number: " + size); - } - currentMessageTotalLength = size; - currentMessagePendingLength = 4; - currentMessage = new Uint8Array(size); - const currentMessageView = new DataView(currentMessage.buffer); - currentMessageView.setUint32(0, size, false); - }; - const iterator = async function* () { - const sourceIterator = source[Symbol.asyncIterator](); - while (true) { - const { value, done } = await sourceIterator.next(); - if (done) { - if (!currentMessageTotalLength) { - return; - } - else if (currentMessageTotalLength === currentMessagePendingLength) { - yield currentMessage; - } - else { - throw new Error("Truncated event message received."); - } - return; - } - const chunkLength = value.length; - let currentOffset = 0; - while (currentOffset < chunkLength) { - if (!currentMessage) { - const bytesRemaining = chunkLength - currentOffset; - if (!messageLengthBuffer) { - messageLengthBuffer = new Uint8Array(4); - } - const numBytesForTotal = Math.min(4 - currentMessagePendingLength, bytesRemaining); - messageLengthBuffer.set(value.slice(currentOffset, currentOffset + numBytesForTotal), currentMessagePendingLength); - currentMessagePendingLength += numBytesForTotal; - currentOffset += numBytesForTotal; - if (currentMessagePendingLength < 4) { - break; - } - allocateMessage(new DataView(messageLengthBuffer.buffer).getUint32(0, false)); - messageLengthBuffer = null; - } - const numBytesToWrite = Math.min(currentMessageTotalLength - currentMessagePendingLength, chunkLength - currentOffset); - currentMessage.set(value.slice(currentOffset, currentOffset + numBytesToWrite), currentMessagePendingLength); - currentMessagePendingLength += numBytesToWrite; - currentOffset += numBytesToWrite; - if (currentMessageTotalLength && currentMessageTotalLength === currentMessagePendingLength) { - yield currentMessage; - currentMessage = null; - currentMessageTotalLength = 0; - currentMessagePendingLength = 0; - } - } - } - }; - return { - [Symbol.asyncIterator]: iterator, - }; -} -exports.getChunkedStream = getChunkedStream; - - -/***/ }), - -/***/ 94504: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getMessageUnmarshaller = exports.getUnmarshalledStream = void 0; -function getUnmarshalledStream(source, options) { - const messageUnmarshaller = getMessageUnmarshaller(options.deserializer, options.toUtf8); - return { - [Symbol.asyncIterator]: async function* () { - for await (const chunk of source) { - const message = options.eventStreamCodec.decode(chunk); - const type = await messageUnmarshaller(message); - if (type === undefined) - continue; - yield type; - } - }, - }; -} -exports.getUnmarshalledStream = getUnmarshalledStream; -function getMessageUnmarshaller(deserializer, toUtf8) { - return async function (message) { - const { value: messageType } = message.headers[":message-type"]; - if (messageType === "error") { - const unmodeledError = new Error(message.headers[":error-message"].value || "UnknownError"); - unmodeledError.name = message.headers[":error-code"].value; - throw unmodeledError; - } - else if (messageType === "exception") { - const code = message.headers[":exception-type"].value; - const exception = { [code]: message }; - const deserializedException = await deserializer(exception); - if (deserializedException.$unknown) { - const error = new Error(toUtf8(message.body)); - error.name = code; - throw error; - } - throw deserializedException[code]; - } - else if (messageType === "event") { - const event = { - [message.headers[":event-type"].value]: message, - }; - const deserialized = await deserializer(event); - if (deserialized.$unknown) - return; - return deserialized; - } - else { - throw Error(`Unrecognizable event type: ${message.headers[":event-type"].value}`); - } - }; -} -exports.getMessageUnmarshaller = getMessageUnmarshaller; - - -/***/ }), - -/***/ 91372: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(42021); -tslib_1.__exportStar(__nccwpck_require__(6913), exports); -tslib_1.__exportStar(__nccwpck_require__(29333), exports); - - -/***/ }), - -/***/ 29333: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.eventStreamSerdeProvider = void 0; -const EventStreamMarshaller_1 = __nccwpck_require__(6913); -const eventStreamSerdeProvider = (options) => new EventStreamMarshaller_1.EventStreamMarshaller(options); -exports.eventStreamSerdeProvider = eventStreamSerdeProvider; - - -/***/ }), - -/***/ 42021: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 86775: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Hash = void 0; -const util_buffer_from_1 = __nccwpck_require__(41308); -const util_utf8_1 = __nccwpck_require__(38134); -const buffer_1 = __nccwpck_require__(14300); -const crypto_1 = __nccwpck_require__(6113); -class Hash { - constructor(algorithmIdentifier, secret) { - this.algorithmIdentifier = algorithmIdentifier; - this.secret = secret; - this.reset(); - } - update(toHash, encoding) { - this.hash.update((0, util_utf8_1.toUint8Array)(castSourceData(toHash, encoding))); - } - digest() { - return Promise.resolve(this.hash.digest()); - } - reset() { - this.hash = this.secret - ? (0, crypto_1.createHmac)(this.algorithmIdentifier, castSourceData(this.secret)) - : (0, crypto_1.createHash)(this.algorithmIdentifier); - } -} -exports.Hash = Hash; -function castSourceData(toCast, encoding) { - if (buffer_1.Buffer.isBuffer(toCast)) { - return toCast; - } - if (typeof toCast === "string") { - return (0, util_buffer_from_1.fromString)(toCast, encoding); - } - if (ArrayBuffer.isView(toCast)) { - return (0, util_buffer_from_1.fromArrayBuffer)(toCast.buffer, toCast.byteOffset, toCast.byteLength); - } - return (0, util_buffer_from_1.fromArrayBuffer)(toCast); -} - - -/***/ }), - -/***/ 62765: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HashCalculator = void 0; -const util_utf8_1 = __nccwpck_require__(38134); -const stream_1 = __nccwpck_require__(12781); -class HashCalculator extends stream_1.Writable { - constructor(hash, options) { - super(options); - this.hash = hash; - } - _write(chunk, encoding, callback) { - try { - this.hash.update((0, util_utf8_1.toUint8Array)(chunk)); - } - catch (err) { - return callback(err); - } - callback(); - } -} -exports.HashCalculator = HashCalculator; - - -/***/ }), - -/***/ 35557: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fileStreamHasher = void 0; -const fs_1 = __nccwpck_require__(57147); -const HashCalculator_1 = __nccwpck_require__(62765); -const fileStreamHasher = (hashCtor, fileStream) => new Promise((resolve, reject) => { - if (!isReadStream(fileStream)) { - reject(new Error("Unable to calculate hash for non-file streams.")); - return; - } - const fileStreamTee = (0, fs_1.createReadStream)(fileStream.path, { - start: fileStream.start, - end: fileStream.end, - }); - const hash = new hashCtor(); - const hashCalculator = new HashCalculator_1.HashCalculator(hash); - fileStreamTee.pipe(hashCalculator); - fileStreamTee.on("error", (err) => { - hashCalculator.end(); - reject(err); - }); - hashCalculator.on("error", reject); - hashCalculator.on("finish", function () { - hash.digest().then(resolve).catch(reject); - }); -}); -exports.fileStreamHasher = fileStreamHasher; -const isReadStream = (stream) => typeof stream.path === "string"; - - -/***/ }), - -<<<<<<< HEAD -/***/ 70516: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(48384); -tslib_1.__exportStar(__nccwpck_require__(35557), exports); -tslib_1.__exportStar(__nccwpck_require__(94628), exports); - - -/***/ }), - -/***/ 94628: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.readableStreamHasher = void 0; -const HashCalculator_1 = __nccwpck_require__(62765); -const readableStreamHasher = (hashCtor, readableStream) => { - if (readableStream.readableFlowing !== null) { - throw new Error("Unable to calculate hash for flowing readable stream"); - } - const hash = new hashCtor(); - const hashCalculator = new HashCalculator_1.HashCalculator(hash); - readableStream.pipe(hashCalculator); - return new Promise((resolve, reject) => { - readableStream.on("error", (err) => { - hashCalculator.end(); - reject(err); - }); - hashCalculator.on("error", reject); - hashCalculator.on("finish", () => { - hash.digest().then(resolve).catch(reject); - }); - }); -}; -exports.readableStreamHasher = readableStreamHasher; - - -/***/ }), - -/***/ 48384: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 80743: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isArrayBuffer = void 0; -const isArrayBuffer = (arg) => (typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer) || - Object.prototype.toString.call(arg) === "[object ArrayBuffer]"; -exports.isArrayBuffer = isArrayBuffer; - - -/***/ }), - -/***/ 38959: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getContentLengthPlugin = exports.contentLengthMiddlewareOptions = exports.contentLengthMiddleware = void 0; -const protocol_http_1 = __nccwpck_require__(45311); -const CONTENT_LENGTH_HEADER = "content-length"; -function contentLengthMiddleware(bodyLengthChecker) { - return (next) => async (args) => { - const request = args.request; - if (protocol_http_1.HttpRequest.isInstance(request)) { - const { body, headers } = request; - if (body && - Object.keys(headers) - .map((str) => str.toLowerCase()) - .indexOf(CONTENT_LENGTH_HEADER) === -1) { - try { - const length = bodyLengthChecker(body); - request.headers = { - ...request.headers, - [CONTENT_LENGTH_HEADER]: String(length), - }; - } - catch (error) { - } - } - } - return next({ - ...args, - request, - }); - }; -} -exports.contentLengthMiddleware = contentLengthMiddleware; -exports.contentLengthMiddlewareOptions = { - step: "build", - tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"], - name: "contentLengthMiddleware", - override: true, -}; -const getContentLengthPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), exports.contentLengthMiddlewareOptions); - }, -}); -exports.getContentLengthPlugin = getContentLengthPlugin; - - -/***/ }), - -/***/ 95111: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createConfigValueProvider = void 0; -const createConfigValueProvider = (configKey, canonicalEndpointParamKey, config) => { - const configProvider = async () => { - var _a; - const configValue = (_a = config[configKey]) !== null && _a !== void 0 ? _a : config[canonicalEndpointParamKey]; - if (typeof configValue === "function") { - return configValue(); - } - return configValue; - }; - if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") { - return async () => { - const endpoint = await configProvider(); - if (endpoint && typeof endpoint === "object") { - if ("url" in endpoint) { - return endpoint.url.href; - } - if ("hostname" in endpoint) { - const { protocol, hostname, port, path } = endpoint; - return `${protocol}//${hostname}${port ? ":" + port : ""}${path}`; - } - } - return endpoint; - }; - } - return configProvider; -}; -exports.createConfigValueProvider = createConfigValueProvider; - - -/***/ }), - -/***/ 43366: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEndpointFromConfig = void 0; -const node_config_provider_1 = __nccwpck_require__(13079); -const getEndpointUrlConfig_1 = __nccwpck_require__(85603); -const getEndpointFromConfig = async (serviceId) => (0, node_config_provider_1.loadConfig)((0, getEndpointUrlConfig_1.getEndpointUrlConfig)(serviceId))(); -exports.getEndpointFromConfig = getEndpointFromConfig; - - -/***/ }), - -/***/ 53931: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveParams = exports.getEndpointFromInstructions = void 0; -const service_customizations_1 = __nccwpck_require__(48836); -const createConfigValueProvider_1 = __nccwpck_require__(95111); -const getEndpointFromConfig_1 = __nccwpck_require__(43366); -const toEndpointV1_1 = __nccwpck_require__(83007); -const getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig, context) => { - if (!clientConfig.endpoint) { - const endpointFromConfig = await (0, getEndpointFromConfig_1.getEndpointFromConfig)(clientConfig.serviceId || ""); - if (endpointFromConfig) { - clientConfig.endpoint = () => Promise.resolve((0, toEndpointV1_1.toEndpointV1)(endpointFromConfig)); - } - } - const endpointParams = await (0, exports.resolveParams)(commandInput, instructionsSupplier, clientConfig); - if (typeof clientConfig.endpointProvider !== "function") { - throw new Error("config.endpointProvider is not set."); - } - const endpoint = clientConfig.endpointProvider(endpointParams, context); - return endpoint; -}; -exports.getEndpointFromInstructions = getEndpointFromInstructions; -const resolveParams = async (commandInput, instructionsSupplier, clientConfig) => { - var _a; - const endpointParams = {}; - const instructions = ((_a = instructionsSupplier === null || instructionsSupplier === void 0 ? void 0 : instructionsSupplier.getEndpointParameterInstructions) === null || _a === void 0 ? void 0 : _a.call(instructionsSupplier)) || {}; - for (const [name, instruction] of Object.entries(instructions)) { - switch (instruction.type) { - case "staticContextParams": - endpointParams[name] = instruction.value; - break; - case "contextParams": - endpointParams[name] = commandInput[instruction.name]; - break; - case "clientContextParams": - case "builtInParams": - endpointParams[name] = await (0, createConfigValueProvider_1.createConfigValueProvider)(instruction.name, name, clientConfig)(); - break; - default: - throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction)); - } - } - if (Object.keys(instructions).length === 0) { - Object.assign(endpointParams, clientConfig); - } - if (String(clientConfig.serviceId).toLowerCase() === "s3") { - await (0, service_customizations_1.resolveParamsForS3)(endpointParams); - } - return endpointParams; -}; -exports.resolveParams = resolveParams; - - -/***/ }), - -/***/ 85603: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEndpointUrlConfig = void 0; -const shared_ini_file_loader_1 = __nccwpck_require__(67097); -const ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL"; -const CONFIG_ENDPOINT_URL = "endpoint_url"; -const getEndpointUrlConfig = (serviceId) => ({ - environmentVariableSelector: (env) => { - const serviceSuffixParts = serviceId.split(" ").map((w) => w.toUpperCase()); - const serviceEndpointUrl = env[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join("_")]; - if (serviceEndpointUrl) - return serviceEndpointUrl; - const endpointUrl = env[ENV_ENDPOINT_URL]; - if (endpointUrl) - return endpointUrl; - return undefined; - }, - configFileSelector: (profile, config) => { - if (config && profile.services) { - const servicesSection = config[["services", profile.services].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)]; - if (servicesSection) { - const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase()); - const endpointUrl = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)]; - if (endpointUrl) - return endpointUrl; - } - } - const endpointUrl = profile[CONFIG_ENDPOINT_URL]; - if (endpointUrl) - return endpointUrl; - return undefined; - }, - default: undefined, -}); -exports.getEndpointUrlConfig = getEndpointUrlConfig; - - -/***/ }), - -/***/ 3100: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(20729); -tslib_1.__exportStar(__nccwpck_require__(53931), exports); -tslib_1.__exportStar(__nccwpck_require__(83007), exports); - - -/***/ }), - -/***/ 83007: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toEndpointV1 = void 0; -const url_parser_1 = __nccwpck_require__(98245); -const toEndpointV1 = (endpoint) => { - if (typeof endpoint === "object") { - if ("url" in endpoint) { - return (0, url_parser_1.parseUrl)(endpoint.url); - } - return endpoint; - } - return (0, url_parser_1.parseUrl)(endpoint); -}; -exports.toEndpointV1 = toEndpointV1; - - -/***/ }), - -/***/ 37332: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.endpointMiddleware = void 0; -const util_middleware_1 = __nccwpck_require__(81243); -const getEndpointFromInstructions_1 = __nccwpck_require__(53931); -const endpointMiddleware = ({ config, instructions, }) => { - return (next, context) => async (args) => { - var _a, _b, _c; - const endpoint = await (0, getEndpointFromInstructions_1.getEndpointFromInstructions)(args.input, { - getEndpointParameterInstructions() { - return instructions; - }, - }, { ...config }, context); - context.endpointV2 = endpoint; - context.authSchemes = (_a = endpoint.properties) === null || _a === void 0 ? void 0 : _a.authSchemes; - const authScheme = (_b = context.authSchemes) === null || _b === void 0 ? void 0 : _b[0]; - if (authScheme) { - context["signing_region"] = authScheme.signingRegion; - context["signing_service"] = authScheme.signingName; - const smithyContext = (0, util_middleware_1.getSmithyContext)(context); - const httpAuthOption = (_c = smithyContext === null || smithyContext === void 0 ? void 0 : smithyContext.selectedHttpAuthScheme) === null || _c === void 0 ? void 0 : _c.httpAuthOption; - if (httpAuthOption) { - httpAuthOption.signingProperties = Object.assign(httpAuthOption.signingProperties || {}, { - signing_region: authScheme.signingRegion, - signingRegion: authScheme.signingRegion, - signing_service: authScheme.signingName, - signingName: authScheme.signingName, - signingRegionSet: authScheme.signingRegionSet, - }, authScheme.properties); - } - } - return next({ - ...args, - }); - }; -}; -exports.endpointMiddleware = endpointMiddleware; - - -/***/ }), - -/***/ 38613: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEndpointPlugin = exports.endpointMiddlewareOptions = void 0; -const middleware_serde_1 = __nccwpck_require__(4247); -const endpointMiddleware_1 = __nccwpck_require__(37332); -exports.endpointMiddlewareOptions = { - step: "serialize", - tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"], - name: "endpointV2Middleware", - override: true, - relation: "before", - toMiddleware: middleware_serde_1.serializerMiddlewareOption.name, -}; -const getEndpointPlugin = (config, instructions) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo((0, endpointMiddleware_1.endpointMiddleware)({ - config, - instructions, - }), exports.endpointMiddlewareOptions); - }, -}); -exports.getEndpointPlugin = getEndpointPlugin; - - -/***/ }), - -/***/ 24916: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(20729); -tslib_1.__exportStar(__nccwpck_require__(3100), exports); -tslib_1.__exportStar(__nccwpck_require__(37332), exports); -tslib_1.__exportStar(__nccwpck_require__(38613), exports); -tslib_1.__exportStar(__nccwpck_require__(81666), exports); -tslib_1.__exportStar(__nccwpck_require__(68667), exports); - - -/***/ }), - -/***/ 81666: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveEndpointConfig = void 0; -const util_middleware_1 = __nccwpck_require__(81243); -const toEndpointV1_1 = __nccwpck_require__(83007); -const resolveEndpointConfig = (input) => { - var _a, _b, _c; - const tls = (_a = input.tls) !== null && _a !== void 0 ? _a : true; - const { endpoint } = input; - const customEndpointProvider = endpoint != null ? async () => (0, toEndpointV1_1.toEndpointV1)(await (0, util_middleware_1.normalizeProvider)(endpoint)()) : undefined; - const isCustomEndpoint = !!endpoint; - return { - ...input, - endpoint: customEndpointProvider, - tls, - isCustomEndpoint, - useDualstackEndpoint: (0, util_middleware_1.normalizeProvider)((_b = input.useDualstackEndpoint) !== null && _b !== void 0 ? _b : false), - useFipsEndpoint: (0, util_middleware_1.normalizeProvider)((_c = input.useFipsEndpoint) !== null && _c !== void 0 ? _c : false), - }; -}; -exports.resolveEndpointConfig = resolveEndpointConfig; - - -/***/ }), - -/***/ 48836: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(20729); -tslib_1.__exportStar(__nccwpck_require__(62126), exports); - - -/***/ }), - -/***/ 62126: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isArnBucketName = exports.isDnsCompatibleBucketName = exports.S3_HOSTNAME_PATTERN = exports.DOT_PATTERN = exports.resolveParamsForS3 = void 0; -const resolveParamsForS3 = async (endpointParams) => { - const bucket = (endpointParams === null || endpointParams === void 0 ? void 0 : endpointParams.Bucket) || ""; - if (typeof endpointParams.Bucket === "string") { - endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?")); - } - if ((0, exports.isArnBucketName)(bucket)) { - if (endpointParams.ForcePathStyle === true) { - throw new Error("Path-style addressing cannot be used with ARN buckets"); - } - } - else if (!(0, exports.isDnsCompatibleBucketName)(bucket) || - (bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:")) || - bucket.toLowerCase() !== bucket || - bucket.length < 3) { - endpointParams.ForcePathStyle = true; - } - if (endpointParams.DisableMultiRegionAccessPoints) { - endpointParams.disableMultiRegionAccessPoints = true; - endpointParams.DisableMRAP = true; - } - return endpointParams; -}; -exports.resolveParamsForS3 = resolveParamsForS3; -const DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; -const IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; -const DOTS_PATTERN = /\.\./; -exports.DOT_PATTERN = /\./; -exports.S3_HOSTNAME_PATTERN = /^(.+\.)?s3(-fips)?(\.dualstack)?[.-]([a-z0-9-]+)\./; -const isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName); -exports.isDnsCompatibleBucketName = isDnsCompatibleBucketName; -const isArnBucketName = (bucketName) => { - const [arn, partition, service, region, account, typeOrId] = bucketName.split(":"); - const isArn = arn === "arn" && bucketName.split(":").length >= 6; - const isValidArn = [arn, partition, service, account, typeOrId].filter(Boolean).length === 5; - if (isArn && !isValidArn) { - throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`); - } - return arn === "arn" && !!partition && !!service && !!account && !!typeOrId; -}; -exports.isArnBucketName = isArnBucketName; - - -/***/ }), - -/***/ 68667: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 20729: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 9878: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AdaptiveRetryStrategy = void 0; -const util_retry_1 = __nccwpck_require__(13744); -const StandardRetryStrategy_1 = __nccwpck_require__(10241); -class AdaptiveRetryStrategy extends StandardRetryStrategy_1.StandardRetryStrategy { - constructor(maxAttemptsProvider, options) { - const { rateLimiter, ...superOptions } = options !== null && options !== void 0 ? options : {}; - super(maxAttemptsProvider, superOptions); - this.rateLimiter = rateLimiter !== null && rateLimiter !== void 0 ? rateLimiter : new util_retry_1.DefaultRateLimiter(); - this.mode = util_retry_1.RETRY_MODES.ADAPTIVE; - } - async retry(next, args) { - return super.retry(next, args, { - beforeRequest: async () => { - return this.rateLimiter.getSendToken(); - }, - afterRequest: (response) => { - this.rateLimiter.updateClientSendingRate(response); - }, - }); - } -} -exports.AdaptiveRetryStrategy = AdaptiveRetryStrategy; - - -/***/ }), - -/***/ 10241: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.StandardRetryStrategy = void 0; -const protocol_http_1 = __nccwpck_require__(45311); -const service_error_classification_1 = __nccwpck_require__(48920); -const util_retry_1 = __nccwpck_require__(13744); -const uuid_1 = __nccwpck_require__(13472); -const defaultRetryQuota_1 = __nccwpck_require__(29708); -const delayDecider_1 = __nccwpck_require__(26375); -const retryDecider_1 = __nccwpck_require__(67785); -const util_1 = __nccwpck_require__(8473); -class StandardRetryStrategy { - constructor(maxAttemptsProvider, options) { - var _a, _b, _c; - this.maxAttemptsProvider = maxAttemptsProvider; - this.mode = util_retry_1.RETRY_MODES.STANDARD; - this.retryDecider = (_a = options === null || options === void 0 ? void 0 : options.retryDecider) !== null && _a !== void 0 ? _a : retryDecider_1.defaultRetryDecider; - this.delayDecider = (_b = options === null || options === void 0 ? void 0 : options.delayDecider) !== null && _b !== void 0 ? _b : delayDecider_1.defaultDelayDecider; - this.retryQuota = (_c = options === null || options === void 0 ? void 0 : options.retryQuota) !== null && _c !== void 0 ? _c : (0, defaultRetryQuota_1.getDefaultRetryQuota)(util_retry_1.INITIAL_RETRY_TOKENS); - } - shouldRetry(error, attempts, maxAttempts) { - return attempts < maxAttempts && this.retryDecider(error) && this.retryQuota.hasRetryTokens(error); - } - async getMaxAttempts() { - let maxAttempts; - try { - maxAttempts = await this.maxAttemptsProvider(); - } - catch (error) { - maxAttempts = util_retry_1.DEFAULT_MAX_ATTEMPTS; - } - return maxAttempts; - } - async retry(next, args, options) { - let retryTokenAmount; - let attempts = 0; - let totalDelay = 0; - const maxAttempts = await this.getMaxAttempts(); - const { request } = args; - if (protocol_http_1.HttpRequest.isInstance(request)) { - request.headers[util_retry_1.INVOCATION_ID_HEADER] = (0, uuid_1.v4)(); - } - while (true) { - try { - if (protocol_http_1.HttpRequest.isInstance(request)) { - request.headers[util_retry_1.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; - } - if (options === null || options === void 0 ? void 0 : options.beforeRequest) { - await options.beforeRequest(); - } - const { response, output } = await next(args); - if (options === null || options === void 0 ? void 0 : options.afterRequest) { - options.afterRequest(response); - } - this.retryQuota.releaseRetryTokens(retryTokenAmount); - output.$metadata.attempts = attempts + 1; - output.$metadata.totalRetryDelay = totalDelay; - return { response, output }; - } - catch (e) { - const err = (0, util_1.asSdkError)(e); - attempts++; - if (this.shouldRetry(err, attempts, maxAttempts)) { - retryTokenAmount = this.retryQuota.retrieveRetryTokens(err); - const delayFromDecider = this.delayDecider((0, service_error_classification_1.isThrottlingError)(err) ? util_retry_1.THROTTLING_RETRY_DELAY_BASE : util_retry_1.DEFAULT_RETRY_DELAY_BASE, attempts); - const delayFromResponse = getDelayFromRetryAfterHeader(err.$response); - const delay = Math.max(delayFromResponse || 0, delayFromDecider); - totalDelay += delay; - await new Promise((resolve) => setTimeout(resolve, delay)); - continue; - } - if (!err.$metadata) { - err.$metadata = {}; - } - err.$metadata.attempts = attempts; - err.$metadata.totalRetryDelay = totalDelay; - throw err; - } - } - } -} -exports.StandardRetryStrategy = StandardRetryStrategy; -const getDelayFromRetryAfterHeader = (response) => { - if (!protocol_http_1.HttpResponse.isInstance(response)) - return; - const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); - if (!retryAfterHeaderName) - return; - const retryAfter = response.headers[retryAfterHeaderName]; - const retryAfterSeconds = Number(retryAfter); - if (!Number.isNaN(retryAfterSeconds)) - return retryAfterSeconds * 1000; - const retryAfterDate = new Date(retryAfter); - return retryAfterDate.getTime() - Date.now(); -}; - - -/***/ }), - -/***/ 19498: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_RETRY_MODE_CONFIG_OPTIONS = exports.CONFIG_RETRY_MODE = exports.ENV_RETRY_MODE = exports.resolveRetryConfig = exports.NODE_MAX_ATTEMPT_CONFIG_OPTIONS = exports.CONFIG_MAX_ATTEMPTS = exports.ENV_MAX_ATTEMPTS = void 0; -const util_middleware_1 = __nccwpck_require__(81243); -const util_retry_1 = __nccwpck_require__(13744); -exports.ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; -exports.CONFIG_MAX_ATTEMPTS = "max_attempts"; -exports.NODE_MAX_ATTEMPT_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => { - const value = env[exports.ENV_MAX_ATTEMPTS]; - if (!value) - return undefined; - const maxAttempt = parseInt(value); - if (Number.isNaN(maxAttempt)) { - throw new Error(`Environment variable ${exports.ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`); - } - return maxAttempt; - }, - configFileSelector: (profile) => { - const value = profile[exports.CONFIG_MAX_ATTEMPTS]; - if (!value) - return undefined; - const maxAttempt = parseInt(value); - if (Number.isNaN(maxAttempt)) { - throw new Error(`Shared config file entry ${exports.CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`); - } - return maxAttempt; - }, - default: util_retry_1.DEFAULT_MAX_ATTEMPTS, -}; -const resolveRetryConfig = (input) => { - var _a; - const { retryStrategy } = input; - const maxAttempts = (0, util_middleware_1.normalizeProvider)((_a = input.maxAttempts) !== null && _a !== void 0 ? _a : util_retry_1.DEFAULT_MAX_ATTEMPTS); - return { - ...input, - maxAttempts, - retryStrategy: async () => { - if (retryStrategy) { - return retryStrategy; - } - const retryMode = await (0, util_middleware_1.normalizeProvider)(input.retryMode)(); - if (retryMode === util_retry_1.RETRY_MODES.ADAPTIVE) { - return new util_retry_1.AdaptiveRetryStrategy(maxAttempts); - } - return new util_retry_1.StandardRetryStrategy(maxAttempts); - }, - }; -}; -exports.resolveRetryConfig = resolveRetryConfig; -exports.ENV_RETRY_MODE = "AWS_RETRY_MODE"; -exports.CONFIG_RETRY_MODE = "retry_mode"; -exports.NODE_RETRY_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => env[exports.ENV_RETRY_MODE], - configFileSelector: (profile) => profile[exports.CONFIG_RETRY_MODE], - default: util_retry_1.DEFAULT_RETRY_MODE, -}; - - -/***/ }), - -/***/ 29708: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getDefaultRetryQuota = void 0; -const util_retry_1 = __nccwpck_require__(13744); -const getDefaultRetryQuota = (initialRetryTokens, options) => { - var _a, _b, _c; - const MAX_CAPACITY = initialRetryTokens; - const noRetryIncrement = (_a = options === null || options === void 0 ? void 0 : options.noRetryIncrement) !== null && _a !== void 0 ? _a : util_retry_1.NO_RETRY_INCREMENT; - const retryCost = (_b = options === null || options === void 0 ? void 0 : options.retryCost) !== null && _b !== void 0 ? _b : util_retry_1.RETRY_COST; - const timeoutRetryCost = (_c = options === null || options === void 0 ? void 0 : options.timeoutRetryCost) !== null && _c !== void 0 ? _c : util_retry_1.TIMEOUT_RETRY_COST; - let availableCapacity = initialRetryTokens; - const getCapacityAmount = (error) => (error.name === "TimeoutError" ? timeoutRetryCost : retryCost); - const hasRetryTokens = (error) => getCapacityAmount(error) <= availableCapacity; - const retrieveRetryTokens = (error) => { - if (!hasRetryTokens(error)) { - throw new Error("No retry token available"); - } - const capacityAmount = getCapacityAmount(error); - availableCapacity -= capacityAmount; - return capacityAmount; - }; - const releaseRetryTokens = (capacityReleaseAmount) => { - availableCapacity += capacityReleaseAmount !== null && capacityReleaseAmount !== void 0 ? capacityReleaseAmount : noRetryIncrement; - availableCapacity = Math.min(availableCapacity, MAX_CAPACITY); - }; - return Object.freeze({ - hasRetryTokens, - retrieveRetryTokens, - releaseRetryTokens, - }); -}; -exports.getDefaultRetryQuota = getDefaultRetryQuota; - - -/***/ }), - -/***/ 26375: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultDelayDecider = void 0; -const util_retry_1 = __nccwpck_require__(13744); -const defaultDelayDecider = (delayBase, attempts) => Math.floor(Math.min(util_retry_1.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); -exports.defaultDelayDecider = defaultDelayDecider; - - -/***/ }), - -/***/ 54801: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(87846); -tslib_1.__exportStar(__nccwpck_require__(9878), exports); -tslib_1.__exportStar(__nccwpck_require__(10241), exports); -tslib_1.__exportStar(__nccwpck_require__(19498), exports); -tslib_1.__exportStar(__nccwpck_require__(26375), exports); -tslib_1.__exportStar(__nccwpck_require__(76406), exports); -tslib_1.__exportStar(__nccwpck_require__(67785), exports); -tslib_1.__exportStar(__nccwpck_require__(16194), exports); - - -/***/ }), - -/***/ 96992: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isStreamingPayload = void 0; -const stream_1 = __nccwpck_require__(12781); -const isStreamingPayload = (request) => (request === null || request === void 0 ? void 0 : request.body) instanceof stream_1.Readable || - (typeof ReadableStream !== "undefined" && (request === null || request === void 0 ? void 0 : request.body) instanceof ReadableStream); -exports.isStreamingPayload = isStreamingPayload; - - -/***/ }), - -/***/ 76406: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getOmitRetryHeadersPlugin = exports.omitRetryHeadersMiddlewareOptions = exports.omitRetryHeadersMiddleware = void 0; -const protocol_http_1 = __nccwpck_require__(45311); -const util_retry_1 = __nccwpck_require__(13744); -const omitRetryHeadersMiddleware = () => (next) => async (args) => { - const { request } = args; - if (protocol_http_1.HttpRequest.isInstance(request)) { - delete request.headers[util_retry_1.INVOCATION_ID_HEADER]; - delete request.headers[util_retry_1.REQUEST_HEADER]; - } - return next(args); -}; -exports.omitRetryHeadersMiddleware = omitRetryHeadersMiddleware; -exports.omitRetryHeadersMiddlewareOptions = { - name: "omitRetryHeadersMiddleware", - tags: ["RETRY", "HEADERS", "OMIT_RETRY_HEADERS"], - relation: "before", - toMiddleware: "awsAuthMiddleware", - override: true, -}; -const getOmitRetryHeadersPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.addRelativeTo((0, exports.omitRetryHeadersMiddleware)(), exports.omitRetryHeadersMiddlewareOptions); - }, -}); -exports.getOmitRetryHeadersPlugin = getOmitRetryHeadersPlugin; - - -/***/ }), - -/***/ 67785: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultRetryDecider = void 0; -const service_error_classification_1 = __nccwpck_require__(48920); -const defaultRetryDecider = (error) => { - if (!error) { - return false; - } - return (0, service_error_classification_1.isRetryableByTrait)(error) || (0, service_error_classification_1.isClockSkewError)(error) || (0, service_error_classification_1.isThrottlingError)(error) || (0, service_error_classification_1.isTransientError)(error); -}; -exports.defaultRetryDecider = defaultRetryDecider; - - -/***/ }), - -/***/ 16194: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRetryAfterHint = exports.getRetryPlugin = exports.retryMiddlewareOptions = exports.retryMiddleware = void 0; -const protocol_http_1 = __nccwpck_require__(45311); -const service_error_classification_1 = __nccwpck_require__(48920); -const smithy_client_1 = __nccwpck_require__(33218); -const util_retry_1 = __nccwpck_require__(13744); -const uuid_1 = __nccwpck_require__(13472); -const isStreamingPayload_1 = __nccwpck_require__(96992); -const util_1 = __nccwpck_require__(8473); -const retryMiddleware = (options) => (next, context) => async (args) => { - var _a; - let retryStrategy = await options.retryStrategy(); - const maxAttempts = await options.maxAttempts(); - if (isRetryStrategyV2(retryStrategy)) { - retryStrategy = retryStrategy; - let retryToken = await retryStrategy.acquireInitialRetryToken(context["partition_id"]); - let lastError = new Error(); - let attempts = 0; - let totalRetryDelay = 0; - const { request } = args; - const isRequest = protocol_http_1.HttpRequest.isInstance(request); - if (isRequest) { - request.headers[util_retry_1.INVOCATION_ID_HEADER] = (0, uuid_1.v4)(); - } - while (true) { - try { - if (isRequest) { - request.headers[util_retry_1.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; - } - const { response, output } = await next(args); - retryStrategy.recordSuccess(retryToken); - output.$metadata.attempts = attempts + 1; - output.$metadata.totalRetryDelay = totalRetryDelay; - return { response, output }; - } - catch (e) { - const retryErrorInfo = getRetryErrorInfo(e); - lastError = (0, util_1.asSdkError)(e); - if (isRequest && (0, isStreamingPayload_1.isStreamingPayload)(request)) { - (_a = (context.logger instanceof smithy_client_1.NoOpLogger ? console : context.logger)) === null || _a === void 0 ? void 0 : _a.warn("An error was encountered in a non-retryable streaming request."); - throw lastError; - } - try { - retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo); - } - catch (refreshError) { - if (!lastError.$metadata) { - lastError.$metadata = {}; - } - lastError.$metadata.attempts = attempts + 1; - lastError.$metadata.totalRetryDelay = totalRetryDelay; - throw lastError; - } - attempts = retryToken.getRetryCount(); - const delay = retryToken.getRetryDelay(); - totalRetryDelay += delay; - await new Promise((resolve) => setTimeout(resolve, delay)); - } - } - } - else { - retryStrategy = retryStrategy; - if (retryStrategy === null || retryStrategy === void 0 ? void 0 : retryStrategy.mode) - context.userAgent = [...(context.userAgent || []), ["cfg/retry-mode", retryStrategy.mode]]; - return retryStrategy.retry(next, args); - } -}; -exports.retryMiddleware = retryMiddleware; -const isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && - typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && - typeof retryStrategy.recordSuccess !== "undefined"; -const getRetryErrorInfo = (error) => { - const errorInfo = { - errorType: getRetryErrorType(error), - }; - const retryAfterHint = (0, exports.getRetryAfterHint)(error.$response); - if (retryAfterHint) { - errorInfo.retryAfterHint = retryAfterHint; - } - return errorInfo; -}; -const getRetryErrorType = (error) => { - if ((0, service_error_classification_1.isThrottlingError)(error)) - return "THROTTLING"; - if ((0, service_error_classification_1.isTransientError)(error)) - return "TRANSIENT"; - if ((0, service_error_classification_1.isServerError)(error)) - return "SERVER_ERROR"; - return "CLIENT_ERROR"; -}; -exports.retryMiddlewareOptions = { - name: "retryMiddleware", - tags: ["RETRY"], - step: "finalizeRequest", - priority: "high", - override: true, -}; -const getRetryPlugin = (options) => ({ - applyToStack: (clientStack) => { - clientStack.add((0, exports.retryMiddleware)(options), exports.retryMiddlewareOptions); - }, -}); -exports.getRetryPlugin = getRetryPlugin; -const getRetryAfterHint = (response) => { - if (!protocol_http_1.HttpResponse.isInstance(response)) - return; - const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); - if (!retryAfterHeaderName) - return; - const retryAfter = response.headers[retryAfterHeaderName]; - const retryAfterSeconds = Number(retryAfter); - if (!Number.isNaN(retryAfterSeconds)) - return new Date(retryAfterSeconds * 1000); - const retryAfterDate = new Date(retryAfter); - return retryAfterDate; -}; -exports.getRetryAfterHint = getRetryAfterHint; - - -/***/ }), - -/***/ 8473: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.asSdkError = void 0; -const asSdkError = (error) => { - if (error instanceof Error) - return error; - if (error instanceof Object) - return Object.assign(new Error(), error); - if (typeof error === "string") - return new Error(error); - return new Error(`AWS SDK error wrapper for ${error}`); -}; -exports.asSdkError = asSdkError; - - -/***/ }), - -/***/ 87846: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 49897: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.deserializerMiddleware = void 0; -const deserializerMiddleware = (options, deserializer) => (next, context) => async (args) => { - const { response } = await next(args); - try { - const parsed = await deserializer(response, options); - return { - response, - output: parsed, - }; - } - catch (error) { - Object.defineProperty(error, "$response", { - value: response, - }); - if (!("$metadata" in error)) { - const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; - error.message += "\n " + hint; - } - throw error; - } -}; -exports.deserializerMiddleware = deserializerMiddleware; - - -/***/ }), - -/***/ 4247: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(41398); -tslib_1.__exportStar(__nccwpck_require__(49897), exports); -tslib_1.__exportStar(__nccwpck_require__(359), exports); -tslib_1.__exportStar(__nccwpck_require__(46186), exports); - - -/***/ }), - -/***/ 359: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSerdePlugin = exports.serializerMiddlewareOption = exports.deserializerMiddlewareOption = void 0; -const deserializerMiddleware_1 = __nccwpck_require__(49897); -const serializerMiddleware_1 = __nccwpck_require__(46186); -exports.deserializerMiddlewareOption = { - name: "deserializerMiddleware", - step: "deserialize", - tags: ["DESERIALIZER"], - override: true, -}; -exports.serializerMiddlewareOption = { - name: "serializerMiddleware", - step: "serialize", - tags: ["SERIALIZER"], - override: true, -}; -function getSerdePlugin(config, serializer, deserializer) { - return { - applyToStack: (commandStack) => { - commandStack.add((0, deserializerMiddleware_1.deserializerMiddleware)(config, deserializer), exports.deserializerMiddlewareOption); - commandStack.add((0, serializerMiddleware_1.serializerMiddleware)(config, serializer), exports.serializerMiddlewareOption); - }, - }; -} -exports.getSerdePlugin = getSerdePlugin; - - -/***/ }), - -/***/ 46186: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.serializerMiddleware = void 0; -const serializerMiddleware = (options, serializer) => (next, context) => async (args) => { - var _a; - const endpoint = ((_a = context.endpointV2) === null || _a === void 0 ? void 0 : _a.url) && options.urlParser - ? async () => options.urlParser(context.endpointV2.url) - : options.endpoint; - if (!endpoint) { - throw new Error("No valid endpoint provider available."); - } - const request = await serializer(args.input, { ...options, endpoint }); - return next({ - ...args, - request, - }); -}; -exports.serializerMiddleware = serializerMiddleware; - - -/***/ }), - -/***/ 41398: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 62559: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.constructStack = void 0; -const getAllAliases = (name, aliases) => { - const _aliases = []; - if (name) { - _aliases.push(name); - } - if (aliases) { - for (const alias of aliases) { - _aliases.push(alias); - } - } - return _aliases; -}; -const getMiddlewareNameWithAliases = (name, aliases) => { - return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`; -}; -const constructStack = () => { - let absoluteEntries = []; - let relativeEntries = []; - let identifyOnResolve = false; - const entriesNameSet = new Set(); - const sort = (entries) => entries.sort((a, b) => stepWeights[b.step] - stepWeights[a.step] || - priorityWeights[b.priority || "normal"] - priorityWeights[a.priority || "normal"]); - const removeByName = (toRemove) => { - let isRemoved = false; - const filterCb = (entry) => { - const aliases = getAllAliases(entry.name, entry.aliases); - if (aliases.includes(toRemove)) { - isRemoved = true; - for (const alias of aliases) { - entriesNameSet.delete(alias); - } - return false; - } - return true; - }; - absoluteEntries = absoluteEntries.filter(filterCb); - relativeEntries = relativeEntries.filter(filterCb); - return isRemoved; - }; - const removeByReference = (toRemove) => { - let isRemoved = false; - const filterCb = (entry) => { - if (entry.middleware === toRemove) { - isRemoved = true; - for (const alias of getAllAliases(entry.name, entry.aliases)) { - entriesNameSet.delete(alias); - } - return false; - } - return true; - }; - absoluteEntries = absoluteEntries.filter(filterCb); - relativeEntries = relativeEntries.filter(filterCb); - return isRemoved; - }; - const cloneTo = (toStack) => { - var _a; - absoluteEntries.forEach((entry) => { - toStack.add(entry.middleware, { ...entry }); - }); - relativeEntries.forEach((entry) => { - toStack.addRelativeTo(entry.middleware, { ...entry }); - }); - (_a = toStack.identifyOnResolve) === null || _a === void 0 ? void 0 : _a.call(toStack, stack.identifyOnResolve()); - return toStack; - }; - const expandRelativeMiddlewareList = (from) => { - const expandedMiddlewareList = []; - from.before.forEach((entry) => { - if (entry.before.length === 0 && entry.after.length === 0) { - expandedMiddlewareList.push(entry); - } - else { - expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); - } - }); - expandedMiddlewareList.push(from); - from.after.reverse().forEach((entry) => { - if (entry.before.length === 0 && entry.after.length === 0) { - expandedMiddlewareList.push(entry); - } - else { - expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); - } - }); - return expandedMiddlewareList; - }; - const getMiddlewareList = (debug = false) => { - const normalizedAbsoluteEntries = []; - const normalizedRelativeEntries = []; - const normalizedEntriesNameMap = {}; - absoluteEntries.forEach((entry) => { - const normalizedEntry = { - ...entry, - before: [], - after: [], - }; - for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { - normalizedEntriesNameMap[alias] = normalizedEntry; - } - normalizedAbsoluteEntries.push(normalizedEntry); - }); - relativeEntries.forEach((entry) => { - const normalizedEntry = { - ...entry, - before: [], - after: [], - }; - for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { - normalizedEntriesNameMap[alias] = normalizedEntry; - } - normalizedRelativeEntries.push(normalizedEntry); - }); - normalizedRelativeEntries.forEach((entry) => { - if (entry.toMiddleware) { - const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware]; - if (toMiddleware === undefined) { - if (debug) { - return; - } - throw new Error(`${entry.toMiddleware} is not found when adding ` + - `${getMiddlewareNameWithAliases(entry.name, entry.aliases)} ` + - `middleware ${entry.relation} ${entry.toMiddleware}`); - } - if (entry.relation === "after") { - toMiddleware.after.push(entry); - } - if (entry.relation === "before") { - toMiddleware.before.push(entry); - } - } - }); - const mainChain = sort(normalizedAbsoluteEntries) - .map(expandRelativeMiddlewareList) - .reduce((wholeList, expandedMiddlewareList) => { - wholeList.push(...expandedMiddlewareList); - return wholeList; - }, []); - return mainChain; - }; - const stack = { - add: (middleware, options = {}) => { - const { name, override, aliases: _aliases } = options; - const entry = { - step: "initialize", - priority: "normal", - middleware, - ...options, - }; - const aliases = getAllAliases(name, _aliases); - if (aliases.length > 0) { - if (aliases.some((alias) => entriesNameSet.has(alias))) { - if (!override) - throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`); - for (const alias of aliases) { - const toOverrideIndex = absoluteEntries.findIndex((entry) => { var _a; return entry.name === alias || ((_a = entry.aliases) === null || _a === void 0 ? void 0 : _a.some((a) => a === alias)); }); - if (toOverrideIndex === -1) { - continue; - } - const toOverride = absoluteEntries[toOverrideIndex]; - if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) { - throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware with ` + - `${toOverride.priority} priority in ${toOverride.step} step cannot ` + - `be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware with ` + - `${entry.priority} priority in ${entry.step} step.`); - } - absoluteEntries.splice(toOverrideIndex, 1); - } - } - for (const alias of aliases) { - entriesNameSet.add(alias); - } - } - absoluteEntries.push(entry); - }, - addRelativeTo: (middleware, options) => { - const { name, override, aliases: _aliases } = options; - const entry = { - middleware, - ...options, - }; - const aliases = getAllAliases(name, _aliases); - if (aliases.length > 0) { - if (aliases.some((alias) => entriesNameSet.has(alias))) { - if (!override) - throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`); - for (const alias of aliases) { - const toOverrideIndex = relativeEntries.findIndex((entry) => { var _a; return entry.name === alias || ((_a = entry.aliases) === null || _a === void 0 ? void 0 : _a.some((a) => a === alias)); }); - if (toOverrideIndex === -1) { - continue; - } - const toOverride = relativeEntries[toOverrideIndex]; - if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) { - throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware ` + - `${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden ` + - `by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware ${entry.relation} ` + - `"${entry.toMiddleware}" middleware.`); - } - relativeEntries.splice(toOverrideIndex, 1); - } - } - for (const alias of aliases) { - entriesNameSet.add(alias); - } - } - relativeEntries.push(entry); - }, - clone: () => cloneTo((0, exports.constructStack)()), - use: (plugin) => { - plugin.applyToStack(stack); - }, - remove: (toRemove) => { - if (typeof toRemove === "string") - return removeByName(toRemove); - else - return removeByReference(toRemove); - }, - removeByTag: (toRemove) => { - let isRemoved = false; - const filterCb = (entry) => { - const { tags, name, aliases: _aliases } = entry; - if (tags && tags.includes(toRemove)) { - const aliases = getAllAliases(name, _aliases); - for (const alias of aliases) { - entriesNameSet.delete(alias); - } - isRemoved = true; - return false; - } - return true; - }; - absoluteEntries = absoluteEntries.filter(filterCb); - relativeEntries = relativeEntries.filter(filterCb); - return isRemoved; - }, - concat: (from) => { - var _a, _b; - const cloned = cloneTo((0, exports.constructStack)()); - cloned.use(from); - cloned.identifyOnResolve(identifyOnResolve || cloned.identifyOnResolve() || ((_b = (_a = from.identifyOnResolve) === null || _a === void 0 ? void 0 : _a.call(from)) !== null && _b !== void 0 ? _b : false)); - return cloned; - }, - applyToStack: cloneTo, - identify: () => { - return getMiddlewareList(true).map((mw) => { - var _a; - const step = (_a = mw.step) !== null && _a !== void 0 ? _a : mw.relation + - " " + - mw.toMiddleware; - return getMiddlewareNameWithAliases(mw.name, mw.aliases) + " - " + step; - }); - }, - identifyOnResolve(toggle) { - if (typeof toggle === "boolean") - identifyOnResolve = toggle; - return identifyOnResolve; - }, - resolve: (handler, context) => { - for (const middleware of getMiddlewareList() - .map((entry) => entry.middleware) - .reverse()) { - handler = middleware(handler, context); - } - if (identifyOnResolve) { - console.log(stack.identify()); - } - return handler; - }, - }; - return stack; -}; -exports.constructStack = constructStack; -const stepWeights = { - initialize: 5, - serialize: 4, - build: 3, - finalizeRequest: 2, - deserialize: 1, -}; -const priorityWeights = { - high: 3, - normal: 2, - low: 1, -}; - - -/***/ }), - -/***/ 27814: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(26528); -tslib_1.__exportStar(__nccwpck_require__(62559), exports); - - -/***/ }), - -/***/ 26528: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 56528: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.loadConfig = void 0; -const property_provider_1 = __nccwpck_require__(12955); -const fromEnv_1 = __nccwpck_require__(84319); -const fromSharedConfigFiles_1 = __nccwpck_require__(67597); -const fromStatic_1 = __nccwpck_require__(65569); -const loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => (0, property_provider_1.memoize)((0, property_provider_1.chain)((0, fromEnv_1.fromEnv)(environmentVariableSelector), (0, fromSharedConfigFiles_1.fromSharedConfigFiles)(configFileSelector, configuration), (0, fromStatic_1.fromStatic)(defaultValue))); -exports.loadConfig = loadConfig; - - -/***/ }), - -/***/ 84319: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromEnv = void 0; -const property_provider_1 = __nccwpck_require__(12955); -const fromEnv = (envVarSelector) => async () => { - try { - const config = envVarSelector(process.env); - if (config === undefined) { - throw new Error(); - } - return config; - } - catch (e) { - throw new property_provider_1.CredentialsProviderError(e.message || `Cannot load config from environment variables with getter: ${envVarSelector}`); - } -}; -exports.fromEnv = fromEnv; - - -/***/ }), - -/***/ 67597: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromSharedConfigFiles = void 0; -const property_provider_1 = __nccwpck_require__(12955); -const shared_ini_file_loader_1 = __nccwpck_require__(67097); -const fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => { - const profile = (0, shared_ini_file_loader_1.getProfileName)(init); - const { configFile, credentialsFile } = await (0, shared_ini_file_loader_1.loadSharedConfigFiles)(init); - const profileFromCredentials = credentialsFile[profile] || {}; - const profileFromConfig = configFile[profile] || {}; - const mergedProfile = preferredFile === "config" - ? { ...profileFromCredentials, ...profileFromConfig } - : { ...profileFromConfig, ...profileFromCredentials }; - try { - const cfgFile = preferredFile === "config" ? configFile : credentialsFile; - const configValue = configSelector(mergedProfile, cfgFile); - if (configValue === undefined) { - throw new Error(); - } - return configValue; - } - catch (e) { - throw new property_provider_1.CredentialsProviderError(e.message || `Cannot load config for profile ${profile} in SDK configuration files with getter: ${configSelector}`); - } -}; -exports.fromSharedConfigFiles = fromSharedConfigFiles; - - -/***/ }), - -/***/ 65569: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromStatic = void 0; -const property_provider_1 = __nccwpck_require__(12955); -const isFunction = (func) => typeof func === "function"; -const fromStatic = (defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : (0, property_provider_1.fromStatic)(defaultValue); -exports.fromStatic = fromStatic; - - -/***/ }), - -/***/ 13079: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(57450); -tslib_1.__exportStar(__nccwpck_require__(56528), exports); - - -/***/ }), - -/***/ 57450: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 61636: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODEJS_TIMEOUT_ERROR_CODES = void 0; -exports.NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; - - -/***/ }), - -/***/ 98661: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getTransformedHeaders = void 0; -const getTransformedHeaders = (headers) => { - const transformedHeaders = {}; - for (const name of Object.keys(headers)) { - const headerValues = headers[name]; - transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; - } - return transformedHeaders; -}; -exports.getTransformedHeaders = getTransformedHeaders; - - -/***/ }), - -/***/ 54065: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(30447); -tslib_1.__exportStar(__nccwpck_require__(56885), exports); -tslib_1.__exportStar(__nccwpck_require__(8056), exports); -tslib_1.__exportStar(__nccwpck_require__(32136), exports); - - -/***/ }), - -/***/ 56885: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttpHandler = exports.DEFAULT_REQUEST_TIMEOUT = void 0; -const protocol_http_1 = __nccwpck_require__(45311); -const querystring_builder_1 = __nccwpck_require__(25201); -const http_1 = __nccwpck_require__(13685); -const https_1 = __nccwpck_require__(95687); -const constants_1 = __nccwpck_require__(61636); -const get_transformed_headers_1 = __nccwpck_require__(98661); -const set_connection_timeout_1 = __nccwpck_require__(31545); -const set_socket_keep_alive_1 = __nccwpck_require__(12063); -const set_socket_timeout_1 = __nccwpck_require__(48089); -const write_request_body_1 = __nccwpck_require__(8459); -exports.DEFAULT_REQUEST_TIMEOUT = 0; -class NodeHttpHandler { - static create(instanceOrOptions) { - if (typeof (instanceOrOptions === null || instanceOrOptions === void 0 ? void 0 : instanceOrOptions.handle) === "function") { - return instanceOrOptions; - } - return new NodeHttpHandler(instanceOrOptions); - } - constructor(options) { - this.metadata = { handlerProtocol: "http/1.1" }; - this.configProvider = new Promise((resolve, reject) => { - if (typeof options === "function") { - options() - .then((_options) => { - resolve(this.resolveDefaultConfig(_options)); - }) - .catch(reject); - } - else { - resolve(this.resolveDefaultConfig(options)); - } - }); - } - resolveDefaultConfig(options) { - const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; - const keepAlive = true; - const maxSockets = 50; - return { - connectionTimeout, - requestTimeout: requestTimeout !== null && requestTimeout !== void 0 ? requestTimeout : socketTimeout, - httpAgent: httpAgent || new http_1.Agent({ keepAlive, maxSockets }), - httpsAgent: httpsAgent || new https_1.Agent({ keepAlive, maxSockets }), - }; - } - destroy() { - var _a, _b, _c, _d; - (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.httpAgent) === null || _b === void 0 ? void 0 : _b.destroy(); - (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.httpsAgent) === null || _d === void 0 ? void 0 : _d.destroy(); - } - async handle(request, { abortSignal } = {}) { - if (!this.config) { - this.config = await this.configProvider; - } - return new Promise((_resolve, _reject) => { - var _a, _b; - let writeRequestBodyPromise = undefined; - const resolve = async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }; - const reject = async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }; - if (!this.config) { - throw new Error("Node HTTP request handler config is not resolved"); - } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - return; - } - const isSSL = request.protocol === "https:"; - const queryString = (0, querystring_builder_1.buildQueryString)(request.query || {}); - let auth = undefined; - if (request.username != null || request.password != null) { - const username = (_a = request.username) !== null && _a !== void 0 ? _a : ""; - const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; - auth = `${username}:${password}`; - } - let path = request.path; - if (queryString) { - path += `?${queryString}`; - } - if (request.fragment) { - path += `#${request.fragment}`; - } - const nodeHttpsOptions = { - headers: request.headers, - host: request.hostname, - method: request.method, - path, - port: request.port, - agent: isSSL ? this.config.httpsAgent : this.config.httpAgent, - auth, - }; - const requestFunc = isSSL ? https_1.request : http_1.request; - const req = requestFunc(nodeHttpsOptions, (res) => { - const httpResponse = new protocol_http_1.HttpResponse({ - statusCode: res.statusCode || -1, - reason: res.statusMessage, - headers: (0, get_transformed_headers_1.getTransformedHeaders)(res.headers), - body: res, - }); - resolve({ response: httpResponse }); - }); - req.on("error", (err) => { - if (constants_1.NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { - reject(Object.assign(err, { name: "TimeoutError" })); - } - else { - reject(err); - } - }); - (0, set_connection_timeout_1.setConnectionTimeout)(req, reject, this.config.connectionTimeout); - (0, set_socket_timeout_1.setSocketTimeout)(req, reject, this.config.requestTimeout); - if (abortSignal) { - abortSignal.onabort = () => { - req.abort(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - }; - } - const httpAgent = nodeHttpsOptions.agent; - if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { - (0, set_socket_keep_alive_1.setSocketKeepAlive)(req, { - keepAlive: httpAgent.keepAlive, - keepAliveMsecs: httpAgent.keepAliveMsecs, - }); - } - writeRequestBodyPromise = (0, write_request_body_1.writeRequestBody)(req, request, this.config.requestTimeout).catch(_reject); - }); - } - updateHttpClientConfig(key, value) { - this.config = undefined; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value, - }; - }); - } - httpHandlerConfigs() { - var _a; - return (_a = this.config) !== null && _a !== void 0 ? _a : {}; - } -} -exports.NodeHttpHandler = NodeHttpHandler; - - -/***/ }), - -/***/ 24807: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2ConnectionManager = void 0; -const tslib_1 = __nccwpck_require__(30447); -const http2_1 = tslib_1.__importDefault(__nccwpck_require__(85158)); -const node_http2_connection_pool_1 = __nccwpck_require__(68309); -class NodeHttp2ConnectionManager { - constructor(config) { - this.sessionCache = new Map(); - this.config = config; - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrency must be greater than zero."); - } - } - lease(requestContext, connectionConfiguration) { - const url = this.getUrlString(requestContext); - const existingPool = this.sessionCache.get(url); - if (existingPool) { - const existingSession = existingPool.poll(); - if (existingSession && !this.config.disableConcurrency) { - return existingSession; - } - } - const session = http2_1.default.connect(url); - if (this.config.maxConcurrency) { - session.settings({ maxConcurrentStreams: this.config.maxConcurrency }, (err) => { - if (err) { - throw new Error("Fail to set maxConcurrentStreams to " + - this.config.maxConcurrency + - "when creating new session for " + - requestContext.destination.toString()); - } - }); - } - session.unref(); - const destroySessionCb = () => { - session.destroy(); - this.deleteSession(url, session); - }; - session.on("goaway", destroySessionCb); - session.on("error", destroySessionCb); - session.on("frameError", destroySessionCb); - session.on("close", () => this.deleteSession(url, session)); - if (connectionConfiguration.requestTimeout) { - session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb); - } - const connectionPool = this.sessionCache.get(url) || new node_http2_connection_pool_1.NodeHttp2ConnectionPool(); - connectionPool.offerLast(session); - this.sessionCache.set(url, connectionPool); - return session; - } - deleteSession(authority, session) { - const existingConnectionPool = this.sessionCache.get(authority); - if (!existingConnectionPool) { - return; - } - if (!existingConnectionPool.contains(session)) { - return; - } - existingConnectionPool.remove(session); - this.sessionCache.set(authority, existingConnectionPool); - } - release(requestContext, session) { - var _a; - const cacheKey = this.getUrlString(requestContext); - (_a = this.sessionCache.get(cacheKey)) === null || _a === void 0 ? void 0 : _a.offerLast(session); - } - destroy() { - for (const [key, connectionPool] of this.sessionCache) { - for (const session of connectionPool) { - if (!session.destroyed) { - session.destroy(); - } - connectionPool.remove(session); - } - this.sessionCache.delete(key); - } - } - setMaxConcurrentStreams(maxConcurrentStreams) { - if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { - throw new RangeError("maxConcurrentStreams must be greater than zero."); - } - this.config.maxConcurrency = maxConcurrentStreams; - } - setDisableConcurrentStreams(disableConcurrentStreams) { - this.config.disableConcurrency = disableConcurrentStreams; - } - getUrlString(request) { - return request.destination.toString(); - } -} -exports.NodeHttp2ConnectionManager = NodeHttp2ConnectionManager; - - -/***/ }), - -/***/ 68309: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2ConnectionPool = void 0; -class NodeHttp2ConnectionPool { - constructor(sessions) { - this.sessions = []; - this.sessions = sessions !== null && sessions !== void 0 ? sessions : []; - } - poll() { - if (this.sessions.length > 0) { - return this.sessions.shift(); - } - } - offerLast(session) { - this.sessions.push(session); - } - contains(session) { - return this.sessions.includes(session); - } - remove(session) { - this.sessions = this.sessions.filter((s) => s !== session); - } - [Symbol.iterator]() { - return this.sessions[Symbol.iterator](); - } - destroy(connection) { - for (const session of this.sessions) { - if (session === connection) { - if (!session.destroyed) { - session.destroy(); - } - } - } - } -} -exports.NodeHttp2ConnectionPool = NodeHttp2ConnectionPool; - - -/***/ }), - -/***/ 8056: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NodeHttp2Handler = void 0; -const protocol_http_1 = __nccwpck_require__(45311); -const querystring_builder_1 = __nccwpck_require__(25201); -const http2_1 = __nccwpck_require__(85158); -const get_transformed_headers_1 = __nccwpck_require__(98661); -const node_http2_connection_manager_1 = __nccwpck_require__(24807); -const write_request_body_1 = __nccwpck_require__(8459); -class NodeHttp2Handler { - static create(instanceOrOptions) { - if (typeof (instanceOrOptions === null || instanceOrOptions === void 0 ? void 0 : instanceOrOptions.handle) === "function") { - return instanceOrOptions; - } - return new NodeHttp2Handler(instanceOrOptions); - } - constructor(options) { - this.metadata = { handlerProtocol: "h2" }; - this.connectionManager = new node_http2_connection_manager_1.NodeHttp2ConnectionManager({}); - this.configProvider = new Promise((resolve, reject) => { - if (typeof options === "function") { - options() - .then((opts) => { - resolve(opts || {}); - }) - .catch(reject); - } - else { - resolve(options || {}); - } - }); - } - destroy() { - this.connectionManager.destroy(); - } - async handle(request, { abortSignal } = {}) { - if (!this.config) { - this.config = await this.configProvider; - this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); - if (this.config.maxConcurrentStreams) { - this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); - } - } - const { requestTimeout, disableConcurrentStreams } = this.config; - return new Promise((_resolve, _reject) => { - var _a, _b, _c; - let fulfilled = false; - let writeRequestBodyPromise = undefined; - const resolve = async (arg) => { - await writeRequestBodyPromise; - _resolve(arg); - }; - const reject = async (arg) => { - await writeRequestBodyPromise; - _reject(arg); - }; - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - fulfilled = true; - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - reject(abortError); - return; - } - const { hostname, method, port, protocol, query } = request; - let auth = ""; - if (request.username != null || request.password != null) { - const username = (_a = request.username) !== null && _a !== void 0 ? _a : ""; - const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; - auth = `${username}:${password}@`; - } - const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; - const requestContext = { destination: new URL(authority) }; - const session = this.connectionManager.lease(requestContext, { - requestTimeout: (_c = this.config) === null || _c === void 0 ? void 0 : _c.sessionTimeout, - disableConcurrentStreams: disableConcurrentStreams || false, - }); - const rejectWithDestroy = (err) => { - if (disableConcurrentStreams) { - this.destroySession(session); - } - fulfilled = true; - reject(err); - }; - const queryString = (0, querystring_builder_1.buildQueryString)(query || {}); - let path = request.path; - if (queryString) { - path += `?${queryString}`; - } - if (request.fragment) { - path += `#${request.fragment}`; - } - const req = session.request({ - ...request.headers, - [http2_1.constants.HTTP2_HEADER_PATH]: path, - [http2_1.constants.HTTP2_HEADER_METHOD]: method, - }); - session.ref(); - req.on("response", (headers) => { - const httpResponse = new protocol_http_1.HttpResponse({ - statusCode: headers[":status"] || -1, - headers: (0, get_transformed_headers_1.getTransformedHeaders)(headers), - body: req, - }); - fulfilled = true; - resolve({ response: httpResponse }); - if (disableConcurrentStreams) { - session.close(); - this.connectionManager.deleteSession(authority, session); - } - }); - if (requestTimeout) { - req.setTimeout(requestTimeout, () => { - req.close(); - const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); - timeoutError.name = "TimeoutError"; - rejectWithDestroy(timeoutError); - }); - } - if (abortSignal) { - abortSignal.onabort = () => { - req.close(); - const abortError = new Error("Request aborted"); - abortError.name = "AbortError"; - rejectWithDestroy(abortError); - }; - } - req.on("frameError", (type, code, id) => { - rejectWithDestroy(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code}.`)); - }); - req.on("error", rejectWithDestroy); - req.on("aborted", () => { - rejectWithDestroy(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${req.rstCode}.`)); - }); - req.on("close", () => { - session.unref(); - if (disableConcurrentStreams) { - session.destroy(); - } - if (!fulfilled) { - rejectWithDestroy(new Error("Unexpected error: http2 request did not get a response")); - } - }); - writeRequestBodyPromise = (0, write_request_body_1.writeRequestBody)(req, request, requestTimeout); - }); - } - updateHttpClientConfig(key, value) { - this.config = undefined; - this.configProvider = this.configProvider.then((config) => { - return { - ...config, - [key]: value, - }; - }); - } - httpHandlerConfigs() { - var _a; - return (_a = this.config) !== null && _a !== void 0 ? _a : {}; - } - destroySession(session) { - if (!session.destroyed) { - session.destroy(); - } - } -} -exports.NodeHttp2Handler = NodeHttp2Handler; - - -/***/ }), - -/***/ 31545: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setConnectionTimeout = void 0; -const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { - if (!timeoutInMs) { - return; - } - const timeoutId = setTimeout(() => { - request.destroy(); - reject(Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { - name: "TimeoutError", - })); - }, timeoutInMs); - request.on("socket", (socket) => { - if (socket.connecting) { - socket.on("connect", () => { - clearTimeout(timeoutId); - }); - } - else { - clearTimeout(timeoutId); - } - }); -}; -exports.setConnectionTimeout = setConnectionTimeout; - - -/***/ }), - -/***/ 12063: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setSocketKeepAlive = void 0; -const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }) => { - if (keepAlive !== true) { - return; - } - request.on("socket", (socket) => { - socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); - }); -}; -exports.setSocketKeepAlive = setSocketKeepAlive; - - -/***/ }), - -/***/ 48089: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setSocketTimeout = void 0; -const setSocketTimeout = (request, reject, timeoutInMs = 0) => { - request.setTimeout(timeoutInMs, () => { - request.destroy(); - reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); - }); -}; -exports.setSocketTimeout = setSocketTimeout; - - -/***/ }), - -/***/ 4857: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Collector = void 0; -const stream_1 = __nccwpck_require__(12781); -class Collector extends stream_1.Writable { - constructor() { - super(...arguments); - this.bufferedBytes = []; - } - _write(chunk, encoding, callback) { - this.bufferedBytes.push(chunk); - callback(); - } -} -exports.Collector = Collector; - - -/***/ }), - -/***/ 32136: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.streamCollector = void 0; -const collector_1 = __nccwpck_require__(4857); -const streamCollector = (stream) => new Promise((resolve, reject) => { - const collector = new collector_1.Collector(); - stream.pipe(collector); - stream.on("error", (err) => { - collector.end(); - reject(err); - }); - collector.on("error", reject); - collector.on("finish", function () { - const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); - resolve(bytes); - }); -}); -exports.streamCollector = streamCollector; - - -/***/ }), - -/***/ 8459: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.writeRequestBody = void 0; -const stream_1 = __nccwpck_require__(12781); -const MIN_WAIT_TIME = 1000; -async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) { - var _a; - const headers = (_a = request.headers) !== null && _a !== void 0 ? _a : {}; - const expect = headers["Expect"] || headers["expect"]; - let timeoutId = -1; - let hasError = false; - if (expect === "100-continue") { - await Promise.race([ - new Promise((resolve) => { - timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); - }), - new Promise((resolve) => { - httpRequest.on("continue", () => { - clearTimeout(timeoutId); - resolve(); - }); - httpRequest.on("error", () => { - hasError = true; - clearTimeout(timeoutId); - resolve(); - }); - }), - ]); - } - if (!hasError) { - writeBody(httpRequest, request.body); - } -} -exports.writeRequestBody = writeRequestBody; -function writeBody(httpRequest, body) { - if (body instanceof stream_1.Readable) { - body.pipe(httpRequest); - } - else if (body) { - httpRequest.end(Buffer.from(body)); - } - else { - httpRequest.end(); - } -} - - -/***/ }), - -/***/ 30447: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 53329: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CredentialsProviderError = void 0; -const ProviderError_1 = __nccwpck_require__(65470); -class CredentialsProviderError extends ProviderError_1.ProviderError { - constructor(message, tryNextLink = true) { - super(message, tryNextLink); - this.tryNextLink = tryNextLink; - this.name = "CredentialsProviderError"; - Object.setPrototypeOf(this, CredentialsProviderError.prototype); - } -} -exports.CredentialsProviderError = CredentialsProviderError; - - -/***/ }), - -/***/ 65470: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProviderError = void 0; -class ProviderError extends Error { - constructor(message, tryNextLink = true) { - super(message); - this.tryNextLink = tryNextLink; - this.name = "ProviderError"; - Object.setPrototypeOf(this, ProviderError.prototype); - } - static from(error, tryNextLink = true) { - return Object.assign(new this(error.message, tryNextLink), error); - } -} -exports.ProviderError = ProviderError; - - -/***/ }), - -/***/ 36726: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TokenProviderError = void 0; -const ProviderError_1 = __nccwpck_require__(65470); -class TokenProviderError extends ProviderError_1.ProviderError { - constructor(message, tryNextLink = true) { - super(message, tryNextLink); - this.tryNextLink = tryNextLink; - this.name = "TokenProviderError"; - Object.setPrototypeOf(this, TokenProviderError.prototype); - } -} -exports.TokenProviderError = TokenProviderError; - - -/***/ }), - -/***/ 41930: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.chain = void 0; -const ProviderError_1 = __nccwpck_require__(65470); -const chain = (...providers) => async () => { - if (providers.length === 0) { - throw new ProviderError_1.ProviderError("No providers in chain"); - } - let lastProviderError; - for (const provider of providers) { - try { - const credentials = await provider(); - return credentials; - } - catch (err) { - lastProviderError = err; - if (err === null || err === void 0 ? void 0 : err.tryNextLink) { - continue; - } - throw err; - } - } - throw lastProviderError; -}; -exports.chain = chain; - - -/***/ }), - -/***/ 50242: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromStatic = void 0; -const fromStatic = (staticValue) => () => Promise.resolve(staticValue); -exports.fromStatic = fromStatic; - - -/***/ }), - -/***/ 12955: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(45855); -tslib_1.__exportStar(__nccwpck_require__(53329), exports); -tslib_1.__exportStar(__nccwpck_require__(65470), exports); -tslib_1.__exportStar(__nccwpck_require__(36726), exports); -tslib_1.__exportStar(__nccwpck_require__(41930), exports); -tslib_1.__exportStar(__nccwpck_require__(50242), exports); -tslib_1.__exportStar(__nccwpck_require__(75595), exports); - - -/***/ }), - -/***/ 75595: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.memoize = void 0; -const memoize = (provider, isExpired, requiresRefresh) => { - let resolved; - let pending; - let hasResult; - let isConstant = false; - const coalesceProvider = async () => { - if (!pending) { - pending = provider(); - } - try { - resolved = await pending; - hasResult = true; - isConstant = false; - } - finally { - pending = undefined; - } - return resolved; - }; - if (isExpired === undefined) { - return async (options) => { - if (!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh)) { - resolved = await coalesceProvider(); - } - return resolved; - }; - } - return async (options) => { - if (!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh)) { - resolved = await coalesceProvider(); - } - if (isConstant) { - return resolved; - } - if (requiresRefresh && !requiresRefresh(resolved)) { - isConstant = true; - return resolved; - } - if (isExpired(resolved)) { - await coalesceProvider(); - return resolved; - } - return resolved; - }; -}; -exports.memoize = memoize; - - -/***/ }), - -/***/ 45855: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 573: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Field = void 0; -const types_1 = __nccwpck_require__(75751); -class Field { - constructor({ name, kind = types_1.FieldPosition.HEADER, values = [] }) { - this.name = name; - this.kind = kind; - this.values = values; - } - add(value) { - this.values.push(value); - } - set(values) { - this.values = values; - } - remove(value) { - this.values = this.values.filter((v) => v !== value); - } - toString() { - return this.values.map((v) => (v.includes(",") || v.includes(" ") ? `"${v}"` : v)).join(", "); - } - get() { - return this.values; - } -} -exports.Field = Field; - - -/***/ }), - -/***/ 87007: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Fields = void 0; -class Fields { - constructor({ fields = [], encoding = "utf-8" }) { - this.entries = {}; - fields.forEach(this.setField.bind(this)); - this.encoding = encoding; - } - setField(field) { - this.entries[field.name.toLowerCase()] = field; - } - getField(name) { - return this.entries[name.toLowerCase()]; - } - removeField(name) { - delete this.entries[name.toLowerCase()]; - } - getByType(kind) { - return Object.values(this.entries).filter((field) => field.kind === kind); - } -} -exports.Fields = Fields; - - -/***/ }), - -/***/ 7961: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveHttpHandlerRuntimeConfig = exports.getHttpHandlerExtensionConfiguration = void 0; -const getHttpHandlerExtensionConfiguration = (runtimeConfig) => { - let httpHandler = runtimeConfig.httpHandler; - return { - setHttpHandler(handler) { - httpHandler = handler; - }, - httpHandler() { - return httpHandler; - }, - updateHttpClientConfig(key, value) { - httpHandler.updateHttpClientConfig(key, value); - }, - httpHandlerConfigs() { - return httpHandler.httpHandlerConfigs(); - }, - }; -}; -exports.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration; -const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => { - return { - httpHandler: httpHandlerExtensionConfiguration.httpHandler(), - }; -}; -exports.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig; - - -/***/ }), - -/***/ 37139: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(46707); -tslib_1.__exportStar(__nccwpck_require__(7961), exports); - - -/***/ }), - -/***/ 69725: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 42234: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpRequest = void 0; -class HttpRequest { - constructor(options) { - this.method = options.method || "GET"; - this.hostname = options.hostname || "localhost"; - this.port = options.port; - this.query = options.query || {}; - this.headers = options.headers || {}; - this.body = options.body; - this.protocol = options.protocol - ? options.protocol.slice(-1) !== ":" - ? `${options.protocol}:` - : options.protocol - : "https:"; - this.path = options.path ? (options.path.charAt(0) !== "/" ? `/${options.path}` : options.path) : "/"; - this.username = options.username; - this.password = options.password; - this.fragment = options.fragment; - } - static isInstance(request) { - if (!request) - return false; - const req = request; - return ("method" in req && - "protocol" in req && - "hostname" in req && - "path" in req && - typeof req["query"] === "object" && - typeof req["headers"] === "object"); - } - clone() { - const cloned = new HttpRequest({ - ...this, - headers: { ...this.headers }, - }); - if (cloned.query) - cloned.query = cloneQuery(cloned.query); - return cloned; - } -} -exports.HttpRequest = HttpRequest; -function cloneQuery(query) { - return Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param, - }; - }, {}); -} - - -/***/ }), - -/***/ 16209: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpResponse = void 0; -class HttpResponse { - constructor(options) { - this.statusCode = options.statusCode; - this.reason = options.reason; - this.headers = options.headers || {}; - this.body = options.body; - } - static isInstance(response) { - if (!response) - return false; - const resp = response; - return typeof resp.statusCode === "number" && typeof resp.headers === "object"; - } -} -exports.HttpResponse = HttpResponse; - - -/***/ }), - -/***/ 45311: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(46707); -tslib_1.__exportStar(__nccwpck_require__(37139), exports); -tslib_1.__exportStar(__nccwpck_require__(573), exports); -tslib_1.__exportStar(__nccwpck_require__(87007), exports); -tslib_1.__exportStar(__nccwpck_require__(69725), exports); -tslib_1.__exportStar(__nccwpck_require__(42234), exports); -tslib_1.__exportStar(__nccwpck_require__(16209), exports); -tslib_1.__exportStar(__nccwpck_require__(98136), exports); -tslib_1.__exportStar(__nccwpck_require__(17694), exports); - - -/***/ }), - -/***/ 98136: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isValidHostname = void 0; -function isValidHostname(hostname) { - const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; - return hostPattern.test(hostname); -} -exports.isValidHostname = isValidHostname; - - -/***/ }), - -/***/ 17694: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 46707: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 25201: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.buildQueryString = void 0; -const util_uri_escape_1 = __nccwpck_require__(28768); -function buildQueryString(query) { - const parts = []; - for (let key of Object.keys(query).sort()) { - const value = query[key]; - key = (0, util_uri_escape_1.escapeUri)(key); - if (Array.isArray(value)) { - for (let i = 0, iLen = value.length; i < iLen; i++) { - parts.push(`${key}=${(0, util_uri_escape_1.escapeUri)(value[i])}`); - } - } - else { - let qsEntry = key; - if (value || typeof value === "string") { - qsEntry += `=${(0, util_uri_escape_1.escapeUri)(value)}`; - } - parts.push(qsEntry); - } - } - return parts.join("&"); -} -exports.buildQueryString = buildQueryString; - - -/***/ }), - -/***/ 44435: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseQueryString = void 0; -function parseQueryString(querystring) { - const query = {}; - querystring = querystring.replace(/^\?/, ""); - if (querystring) { - for (const pair of querystring.split("&")) { - let [key, value = null] = pair.split("="); - key = decodeURIComponent(key); - if (value) { - value = decodeURIComponent(value); - } - if (!(key in query)) { - query[key] = value; - } - else if (Array.isArray(query[key])) { - query[key].push(value); - } - else { - query[key] = [query[key], value]; - } - } - } - return query; -} -exports.parseQueryString = parseQueryString; - - -/***/ }), - -/***/ 46311: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODEJS_TIMEOUT_ERROR_CODES = exports.TRANSIENT_ERROR_STATUS_CODES = exports.TRANSIENT_ERROR_CODES = exports.THROTTLING_ERROR_CODES = exports.CLOCK_SKEW_ERROR_CODES = void 0; -exports.CLOCK_SKEW_ERROR_CODES = [ - "AuthFailure", - "InvalidSignatureException", - "RequestExpired", - "RequestInTheFuture", - "RequestTimeTooSkewed", - "SignatureDoesNotMatch", -]; -exports.THROTTLING_ERROR_CODES = [ - "BandwidthLimitExceeded", - "EC2ThrottledException", - "LimitExceededException", - "PriorRequestNotComplete", - "ProvisionedThroughputExceededException", - "RequestLimitExceeded", - "RequestThrottled", - "RequestThrottledException", - "SlowDown", - "ThrottledException", - "Throttling", - "ThrottlingException", - "TooManyRequestsException", - "TransactionInProgressException", -]; -exports.TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"]; -exports.TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; -exports.NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"]; - - -/***/ }), - -/***/ 48920: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isServerError = exports.isTransientError = exports.isThrottlingError = exports.isClockSkewError = exports.isRetryableByTrait = void 0; -const constants_1 = __nccwpck_require__(46311); -const isRetryableByTrait = (error) => error.$retryable !== undefined; -exports.isRetryableByTrait = isRetryableByTrait; -const isClockSkewError = (error) => constants_1.CLOCK_SKEW_ERROR_CODES.includes(error.name); -exports.isClockSkewError = isClockSkewError; -const isThrottlingError = (error) => { - var _a, _b; - return ((_a = error.$metadata) === null || _a === void 0 ? void 0 : _a.httpStatusCode) === 429 || - constants_1.THROTTLING_ERROR_CODES.includes(error.name) || - ((_b = error.$retryable) === null || _b === void 0 ? void 0 : _b.throttling) == true; -}; -exports.isThrottlingError = isThrottlingError; -const isTransientError = (error) => { - var _a; - return constants_1.TRANSIENT_ERROR_CODES.includes(error.name) || - constants_1.NODEJS_TIMEOUT_ERROR_CODES.includes((error === null || error === void 0 ? void 0 : error.code) || "") || - constants_1.TRANSIENT_ERROR_STATUS_CODES.includes(((_a = error.$metadata) === null || _a === void 0 ? void 0 : _a.httpStatusCode) || 0); -}; -exports.isTransientError = isTransientError; -const isServerError = (error) => { - var _a; - if (((_a = error.$metadata) === null || _a === void 0 ? void 0 : _a.httpStatusCode) !== undefined) { - const statusCode = error.$metadata.httpStatusCode; - if (500 <= statusCode && statusCode <= 599 && !(0, exports.isTransientError)(error)) { - return true; - } - return false; - } - return false; -}; -exports.isServerError = isServerError; - - -/***/ }), - -/***/ 92737: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getConfigData = void 0; -const types_1 = __nccwpck_require__(75751); -const loadSharedConfigFiles_1 = __nccwpck_require__(25986); -const getConfigData = (data) => Object.entries(data) - .filter(([key]) => { - const indexOfSeparator = key.indexOf(loadSharedConfigFiles_1.CONFIG_PREFIX_SEPARATOR); - if (indexOfSeparator === -1) { - return false; - } - return Object.values(types_1.IniSectionType).includes(key.substring(0, indexOfSeparator)); -}) - .reduce((acc, [key, value]) => { - const indexOfSeparator = key.indexOf(loadSharedConfigFiles_1.CONFIG_PREFIX_SEPARATOR); - const updatedKey = key.substring(0, indexOfSeparator) === types_1.IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key; - acc[updatedKey] = value; - return acc; -}, { - ...(data.default && { default: data.default }), -}); -exports.getConfigData = getConfigData; - - -/***/ }), - -/***/ 60895: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getConfigFilepath = exports.ENV_CONFIG_PATH = void 0; -const path_1 = __nccwpck_require__(71017); -const getHomeDir_1 = __nccwpck_require__(50927); -exports.ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; -const getConfigFilepath = () => process.env[exports.ENV_CONFIG_PATH] || (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "config"); -exports.getConfigFilepath = getConfigFilepath; - - -/***/ }), - -/***/ 70056: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getCredentialsFilepath = exports.ENV_CREDENTIALS_PATH = void 0; -const path_1 = __nccwpck_require__(71017); -const getHomeDir_1 = __nccwpck_require__(50927); -exports.ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; -const getCredentialsFilepath = () => process.env[exports.ENV_CREDENTIALS_PATH] || (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "credentials"); -exports.getCredentialsFilepath = getCredentialsFilepath; - - -/***/ }), - -/***/ 50927: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getHomeDir = void 0; -const os_1 = __nccwpck_require__(22037); -const path_1 = __nccwpck_require__(71017); -const homeDirCache = {}; -const getHomeDirCacheKey = () => { - if (process && process.geteuid) { - return `${process.geteuid()}`; - } - return "DEFAULT"; -}; -const getHomeDir = () => { - const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${path_1.sep}` } = process.env; - if (HOME) - return HOME; - if (USERPROFILE) - return USERPROFILE; - if (HOMEPATH) - return `${HOMEDRIVE}${HOMEPATH}`; - const homeDirCacheKey = getHomeDirCacheKey(); - if (!homeDirCache[homeDirCacheKey]) - homeDirCache[homeDirCacheKey] = (0, os_1.homedir)(); - return homeDirCache[homeDirCacheKey]; -}; -exports.getHomeDir = getHomeDir; - - -/***/ }), - -/***/ 18589: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getProfileName = exports.DEFAULT_PROFILE = exports.ENV_PROFILE = void 0; -exports.ENV_PROFILE = "AWS_PROFILE"; -exports.DEFAULT_PROFILE = "default"; -const getProfileName = (init) => init.profile || process.env[exports.ENV_PROFILE] || exports.DEFAULT_PROFILE; -exports.getProfileName = getProfileName; - - -/***/ }), - -/***/ 83694: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSSOTokenFilepath = void 0; -const crypto_1 = __nccwpck_require__(6113); -const path_1 = __nccwpck_require__(71017); -const getHomeDir_1 = __nccwpck_require__(50927); -const getSSOTokenFilepath = (id) => { - const hasher = (0, crypto_1.createHash)("sha1"); - const cacheName = hasher.update(id).digest("hex"); - return (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "sso", "cache", `${cacheName}.json`); -}; -exports.getSSOTokenFilepath = getSSOTokenFilepath; - - -/***/ }), - -/***/ 26233: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSSOTokenFromFile = void 0; -const fs_1 = __nccwpck_require__(57147); -const getSSOTokenFilepath_1 = __nccwpck_require__(83694); -const { readFile } = fs_1.promises; -const getSSOTokenFromFile = async (id) => { - const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id); - const ssoTokenText = await readFile(ssoTokenFilepath, "utf8"); - return JSON.parse(ssoTokenText); -}; -exports.getSSOTokenFromFile = getSSOTokenFromFile; - - -/***/ }), - -/***/ 83474: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSsoSessionData = void 0; -const types_1 = __nccwpck_require__(75751); -const loadSharedConfigFiles_1 = __nccwpck_require__(25986); -const getSsoSessionData = (data) => Object.entries(data) - .filter(([key]) => key.startsWith(types_1.IniSectionType.SSO_SESSION + loadSharedConfigFiles_1.CONFIG_PREFIX_SEPARATOR)) - .reduce((acc, [key, value]) => ({ ...acc, [key.split(loadSharedConfigFiles_1.CONFIG_PREFIX_SEPARATOR)[1]]: value }), {}); -exports.getSsoSessionData = getSsoSessionData; - - -/***/ }), - -/***/ 67097: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(50010); -tslib_1.__exportStar(__nccwpck_require__(50927), exports); -tslib_1.__exportStar(__nccwpck_require__(18589), exports); -tslib_1.__exportStar(__nccwpck_require__(83694), exports); -tslib_1.__exportStar(__nccwpck_require__(26233), exports); -tslib_1.__exportStar(__nccwpck_require__(25986), exports); -tslib_1.__exportStar(__nccwpck_require__(87383), exports); -tslib_1.__exportStar(__nccwpck_require__(1014), exports); -tslib_1.__exportStar(__nccwpck_require__(32799), exports); - - -/***/ }), - -/***/ 25986: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.loadSharedConfigFiles = exports.CONFIG_PREFIX_SEPARATOR = void 0; -const getConfigData_1 = __nccwpck_require__(92737); -const getConfigFilepath_1 = __nccwpck_require__(60895); -const getCredentialsFilepath_1 = __nccwpck_require__(70056); -const parseIni_1 = __nccwpck_require__(1748); -const slurpFile_1 = __nccwpck_require__(80089); -const swallowError = () => ({}); -exports.CONFIG_PREFIX_SEPARATOR = "."; -const loadSharedConfigFiles = async (init = {}) => { - const { filepath = (0, getCredentialsFilepath_1.getCredentialsFilepath)(), configFilepath = (0, getConfigFilepath_1.getConfigFilepath)() } = init; - const parsedFiles = await Promise.all([ - (0, slurpFile_1.slurpFile)(configFilepath, { - ignoreCache: init.ignoreCache, - }) - .then(parseIni_1.parseIni) - .then(getConfigData_1.getConfigData) - .catch(swallowError), - (0, slurpFile_1.slurpFile)(filepath, { - ignoreCache: init.ignoreCache, - }) - .then(parseIni_1.parseIni) - .catch(swallowError), - ]); - return { - configFile: parsedFiles[0], - credentialsFile: parsedFiles[1], - }; -}; -exports.loadSharedConfigFiles = loadSharedConfigFiles; - - -/***/ }), - -/***/ 87383: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.loadSsoSessionData = void 0; -const getConfigFilepath_1 = __nccwpck_require__(60895); -const getSsoSessionData_1 = __nccwpck_require__(83474); -const parseIni_1 = __nccwpck_require__(1748); -const slurpFile_1 = __nccwpck_require__(80089); -const swallowError = () => ({}); -const loadSsoSessionData = async (init = {}) => { - var _a; - return (0, slurpFile_1.slurpFile)((_a = init.configFilepath) !== null && _a !== void 0 ? _a : (0, getConfigFilepath_1.getConfigFilepath)()) - .then(parseIni_1.parseIni) - .then(getSsoSessionData_1.getSsoSessionData) - .catch(swallowError); -}; -exports.loadSsoSessionData = loadSsoSessionData; - - -/***/ }), - -/***/ 59731: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.mergeConfigFiles = void 0; -const mergeConfigFiles = (...files) => { - const merged = {}; - for (const file of files) { - for (const [key, values] of Object.entries(file)) { - if (merged[key] !== undefined) { - Object.assign(merged[key], values); - } - else { - merged[key] = values; - } - } - } - return merged; -}; -exports.mergeConfigFiles = mergeConfigFiles; - - -/***/ }), - -/***/ 1748: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseIni = void 0; -const types_1 = __nccwpck_require__(75751); -const loadSharedConfigFiles_1 = __nccwpck_require__(25986); -const prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/; -const profileNameBlockList = ["__proto__", "profile __proto__"]; -const parseIni = (iniData) => { - const map = {}; - let currentSection; - let currentSubSection; - for (const iniLine of iniData.split(/\r?\n/)) { - const trimmedLine = iniLine.split(/(^|\s)[;#]/)[0].trim(); - const isSection = trimmedLine[0] === "[" && trimmedLine[trimmedLine.length - 1] === "]"; - if (isSection) { - currentSection = undefined; - currentSubSection = undefined; - const sectionName = trimmedLine.substring(1, trimmedLine.length - 1); - const matches = prefixKeyRegex.exec(sectionName); - if (matches) { - const [, prefix, , name] = matches; - if (Object.values(types_1.IniSectionType).includes(prefix)) { - currentSection = [prefix, name].join(loadSharedConfigFiles_1.CONFIG_PREFIX_SEPARATOR); - } - } - else { - currentSection = sectionName; - } - if (profileNameBlockList.includes(sectionName)) { - throw new Error(`Found invalid profile name "${sectionName}"`); - } - } - else if (currentSection) { - const indexOfEqualsSign = trimmedLine.indexOf("="); - if (![0, -1].includes(indexOfEqualsSign)) { - const [name, value] = [ - trimmedLine.substring(0, indexOfEqualsSign).trim(), - trimmedLine.substring(indexOfEqualsSign + 1).trim(), - ]; - if (value === "") { - currentSubSection = name; - } - else { - if (currentSubSection && iniLine.trimStart() === iniLine) { - currentSubSection = undefined; - } - map[currentSection] = map[currentSection] || {}; - const key = currentSubSection ? [currentSubSection, name].join(loadSharedConfigFiles_1.CONFIG_PREFIX_SEPARATOR) : name; - map[currentSection][key] = value; - } - } - } - } - return map; -}; -exports.parseIni = parseIni; - - -/***/ }), - -/***/ 1014: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseKnownFiles = void 0; -const loadSharedConfigFiles_1 = __nccwpck_require__(25986); -const mergeConfigFiles_1 = __nccwpck_require__(59731); -const parseKnownFiles = async (init) => { - const parsedFiles = await (0, loadSharedConfigFiles_1.loadSharedConfigFiles)(init); - return (0, mergeConfigFiles_1.mergeConfigFiles)(parsedFiles.configFile, parsedFiles.credentialsFile); -}; -exports.parseKnownFiles = parseKnownFiles; - - -/***/ }), - -/***/ 80089: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.slurpFile = void 0; -const fs_1 = __nccwpck_require__(57147); -const { readFile } = fs_1.promises; -const filePromisesHash = {}; -const slurpFile = (path, options) => { - if (!filePromisesHash[path] || (options === null || options === void 0 ? void 0 : options.ignoreCache)) { - filePromisesHash[path] = readFile(path, "utf8"); - } - return filePromisesHash[path]; -}; -exports.slurpFile = slurpFile; - - -/***/ }), - -/***/ 32799: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 50010: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 94905: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SignatureV4 = void 0; -const eventstream_codec_1 = __nccwpck_require__(58152); -const util_hex_encoding_1 = __nccwpck_require__(61027); -const util_middleware_1 = __nccwpck_require__(81243); -const util_utf8_1 = __nccwpck_require__(38134); -const constants_1 = __nccwpck_require__(92245); -const credentialDerivation_1 = __nccwpck_require__(26266); -const getCanonicalHeaders_1 = __nccwpck_require__(42188); -const getCanonicalQuery_1 = __nccwpck_require__(94300); -const getPayloadHash_1 = __nccwpck_require__(50179); -const headerUtil_1 = __nccwpck_require__(57211); -const moveHeadersToQuery_1 = __nccwpck_require__(72266); -const prepareRequest_1 = __nccwpck_require__(44656); -const utilDate_1 = __nccwpck_require__(81001); -class SignatureV4 { - constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true, }) { - this.headerMarshaller = new eventstream_codec_1.HeaderMarshaller(util_utf8_1.toUtf8, util_utf8_1.fromUtf8); - this.service = service; - this.sha256 = sha256; - this.uriEscapePath = uriEscapePath; - this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true; - this.regionProvider = (0, util_middleware_1.normalizeProvider)(region); - this.credentialProvider = (0, util_middleware_1.normalizeProvider)(credentials); - } - async presign(originalRequest, options = {}) { - const { signingDate = new Date(), expiresIn = 3600, unsignableHeaders, unhoistableHeaders, signableHeaders, signingRegion, signingService, } = options; - const credentials = await this.credentialProvider(); - this.validateResolvedCredentials(credentials); - const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); - const { longDate, shortDate } = formatDate(signingDate); - if (expiresIn > constants_1.MAX_PRESIGNED_TTL) { - return Promise.reject("Signature version 4 presigned URLs" + " must have an expiration date less than one week in" + " the future"); - } - const scope = (0, credentialDerivation_1.createScope)(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service); - const request = (0, moveHeadersToQuery_1.moveHeadersToQuery)((0, prepareRequest_1.prepareRequest)(originalRequest), { unhoistableHeaders }); - if (credentials.sessionToken) { - request.query[constants_1.TOKEN_QUERY_PARAM] = credentials.sessionToken; - } - request.query[constants_1.ALGORITHM_QUERY_PARAM] = constants_1.ALGORITHM_IDENTIFIER; - request.query[constants_1.CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`; - request.query[constants_1.AMZ_DATE_QUERY_PARAM] = longDate; - request.query[constants_1.EXPIRES_QUERY_PARAM] = expiresIn.toString(10); - const canonicalHeaders = (0, getCanonicalHeaders_1.getCanonicalHeaders)(request, unsignableHeaders, signableHeaders); - request.query[constants_1.SIGNED_HEADERS_QUERY_PARAM] = getCanonicalHeaderList(canonicalHeaders); - request.query[constants_1.SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, await (0, getPayloadHash_1.getPayloadHash)(originalRequest, this.sha256))); - return request; - } - async sign(toSign, options) { - if (typeof toSign === "string") { - return this.signString(toSign, options); - } - else if (toSign.headers && toSign.payload) { - return this.signEvent(toSign, options); - } - else if (toSign.message) { - return this.signMessage(toSign, options); - } - else { - return this.signRequest(toSign, options); - } - } - async signEvent({ headers, payload }, { signingDate = new Date(), priorSignature, signingRegion, signingService }) { - const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); - const { shortDate, longDate } = formatDate(signingDate); - const scope = (0, credentialDerivation_1.createScope)(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service); - const hashedPayload = await (0, getPayloadHash_1.getPayloadHash)({ headers: {}, body: payload }, this.sha256); - const hash = new this.sha256(); - hash.update(headers); - const hashedHeaders = (0, util_hex_encoding_1.toHex)(await hash.digest()); - const stringToSign = [ - constants_1.EVENT_ALGORITHM_IDENTIFIER, - longDate, - scope, - priorSignature, - hashedHeaders, - hashedPayload, - ].join("\n"); - return this.signString(stringToSign, { signingDate, signingRegion: region, signingService }); - } - async signMessage(signableMessage, { signingDate = new Date(), signingRegion, signingService }) { - const promise = this.signEvent({ - headers: this.headerMarshaller.format(signableMessage.message.headers), - payload: signableMessage.message.body, - }, { - signingDate, - signingRegion, - signingService, - priorSignature: signableMessage.priorSignature, - }); - return promise.then((signature) => { - return { message: signableMessage.message, signature }; - }); - } - async signString(stringToSign, { signingDate = new Date(), signingRegion, signingService } = {}) { - const credentials = await this.credentialProvider(); - this.validateResolvedCredentials(credentials); - const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); - const { shortDate } = formatDate(signingDate); - const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService)); - hash.update((0, util_utf8_1.toUint8Array)(stringToSign)); - return (0, util_hex_encoding_1.toHex)(await hash.digest()); - } - async signRequest(requestToSign, { signingDate = new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService, } = {}) { - const credentials = await this.credentialProvider(); - this.validateResolvedCredentials(credentials); - const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); - const request = (0, prepareRequest_1.prepareRequest)(requestToSign); - const { longDate, shortDate } = formatDate(signingDate); - const scope = (0, credentialDerivation_1.createScope)(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service); - request.headers[constants_1.AMZ_DATE_HEADER] = longDate; - if (credentials.sessionToken) { - request.headers[constants_1.TOKEN_HEADER] = credentials.sessionToken; - } - const payloadHash = await (0, getPayloadHash_1.getPayloadHash)(request, this.sha256); - if (!(0, headerUtil_1.hasHeader)(constants_1.SHA256_HEADER, request.headers) && this.applyChecksum) { - request.headers[constants_1.SHA256_HEADER] = payloadHash; - } - const canonicalHeaders = (0, getCanonicalHeaders_1.getCanonicalHeaders)(request, unsignableHeaders, signableHeaders); - const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, payloadHash)); - request.headers[constants_1.AUTH_HEADER] = - `${constants_1.ALGORITHM_IDENTIFIER} ` + - `Credential=${credentials.accessKeyId}/${scope}, ` + - `SignedHeaders=${getCanonicalHeaderList(canonicalHeaders)}, ` + - `Signature=${signature}`; - return request; - } - createCanonicalRequest(request, canonicalHeaders, payloadHash) { - const sortedHeaders = Object.keys(canonicalHeaders).sort(); - return `${request.method} -${this.getCanonicalPath(request)} -${(0, getCanonicalQuery_1.getCanonicalQuery)(request)} -${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")} - -${sortedHeaders.join(";")} -${payloadHash}`; - } - async createStringToSign(longDate, credentialScope, canonicalRequest) { - const hash = new this.sha256(); - hash.update((0, util_utf8_1.toUint8Array)(canonicalRequest)); - const hashedRequest = await hash.digest(); - return `${constants_1.ALGORITHM_IDENTIFIER} -${longDate} -${credentialScope} -${(0, util_hex_encoding_1.toHex)(hashedRequest)}`; - } - getCanonicalPath({ path }) { - if (this.uriEscapePath) { - const normalizedPathSegments = []; - for (const pathSegment of path.split("/")) { - if ((pathSegment === null || pathSegment === void 0 ? void 0 : pathSegment.length) === 0) - continue; - if (pathSegment === ".") - continue; - if (pathSegment === "..") { - normalizedPathSegments.pop(); - } - else { - normalizedPathSegments.push(pathSegment); - } - } - const normalizedPath = `${(path === null || path === void 0 ? void 0 : path.startsWith("/")) ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && (path === null || path === void 0 ? void 0 : path.endsWith("/")) ? "/" : ""}`; - const doubleEncoded = encodeURIComponent(normalizedPath); - return doubleEncoded.replace(/%2F/g, "/"); - } - return path; - } - async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) { - const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest); - const hash = new this.sha256(await keyPromise); - hash.update((0, util_utf8_1.toUint8Array)(stringToSign)); - return (0, util_hex_encoding_1.toHex)(await hash.digest()); - } - getSigningKey(credentials, region, shortDate, service) { - return (0, credentialDerivation_1.getSigningKey)(this.sha256, credentials, shortDate, region, service || this.service); - } - validateResolvedCredentials(credentials) { - if (typeof credentials !== "object" || - typeof credentials.accessKeyId !== "string" || - typeof credentials.secretAccessKey !== "string") { - throw new Error("Resolved credential object is not valid"); - } - } -} -exports.SignatureV4 = SignatureV4; -const formatDate = (now) => { - const longDate = (0, utilDate_1.iso8601)(now).replace(/[\-:]/g, ""); - return { - longDate, - shortDate: longDate.slice(0, 8), - }; -}; -const getCanonicalHeaderList = (headers) => Object.keys(headers).sort().join(";"); - - -/***/ }), - -/***/ 19271: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.cloneQuery = exports.cloneRequest = void 0; -const cloneRequest = ({ headers, query, ...rest }) => ({ - ...rest, - headers: { ...headers }, - query: query ? (0, exports.cloneQuery)(query) : undefined, -}); -exports.cloneRequest = cloneRequest; -const cloneQuery = (query) => Object.keys(query).reduce((carry, paramName) => { - const param = query[paramName]; - return { - ...carry, - [paramName]: Array.isArray(param) ? [...param] : param, - }; -}, {}); -exports.cloneQuery = cloneQuery; - - -/***/ }), - -/***/ 92245: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MAX_PRESIGNED_TTL = exports.KEY_TYPE_IDENTIFIER = exports.MAX_CACHE_SIZE = exports.UNSIGNED_PAYLOAD = exports.EVENT_ALGORITHM_IDENTIFIER = exports.ALGORITHM_IDENTIFIER_V4A = exports.ALGORITHM_IDENTIFIER = exports.UNSIGNABLE_PATTERNS = exports.SEC_HEADER_PATTERN = exports.PROXY_HEADER_PATTERN = exports.ALWAYS_UNSIGNABLE_HEADERS = exports.HOST_HEADER = exports.TOKEN_HEADER = exports.SHA256_HEADER = exports.SIGNATURE_HEADER = exports.GENERATED_HEADERS = exports.DATE_HEADER = exports.AMZ_DATE_HEADER = exports.AUTH_HEADER = exports.REGION_SET_PARAM = exports.TOKEN_QUERY_PARAM = exports.SIGNATURE_QUERY_PARAM = exports.EXPIRES_QUERY_PARAM = exports.SIGNED_HEADERS_QUERY_PARAM = exports.AMZ_DATE_QUERY_PARAM = exports.CREDENTIAL_QUERY_PARAM = exports.ALGORITHM_QUERY_PARAM = void 0; -exports.ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; -exports.CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; -exports.AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; -exports.SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; -exports.EXPIRES_QUERY_PARAM = "X-Amz-Expires"; -exports.SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; -exports.TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; -exports.REGION_SET_PARAM = "X-Amz-Region-Set"; -exports.AUTH_HEADER = "authorization"; -exports.AMZ_DATE_HEADER = exports.AMZ_DATE_QUERY_PARAM.toLowerCase(); -exports.DATE_HEADER = "date"; -exports.GENERATED_HEADERS = [exports.AUTH_HEADER, exports.AMZ_DATE_HEADER, exports.DATE_HEADER]; -exports.SIGNATURE_HEADER = exports.SIGNATURE_QUERY_PARAM.toLowerCase(); -exports.SHA256_HEADER = "x-amz-content-sha256"; -exports.TOKEN_HEADER = exports.TOKEN_QUERY_PARAM.toLowerCase(); -exports.HOST_HEADER = "host"; -exports.ALWAYS_UNSIGNABLE_HEADERS = { - authorization: true, - "cache-control": true, - connection: true, - expect: true, - from: true, - "keep-alive": true, - "max-forwards": true, - pragma: true, - referer: true, - te: true, - trailer: true, - "transfer-encoding": true, - upgrade: true, - "user-agent": true, - "x-amzn-trace-id": true, -}; -exports.PROXY_HEADER_PATTERN = /^proxy-/; -exports.SEC_HEADER_PATTERN = /^sec-/; -exports.UNSIGNABLE_PATTERNS = [/^proxy-/i, /^sec-/i]; -exports.ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; -exports.ALGORITHM_IDENTIFIER_V4A = "AWS4-ECDSA-P256-SHA256"; -exports.EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; -exports.UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; -exports.MAX_CACHE_SIZE = 50; -exports.KEY_TYPE_IDENTIFIER = "aws4_request"; -exports.MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7; - - -/***/ }), - -/***/ 26266: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.clearCredentialCache = exports.getSigningKey = exports.createScope = void 0; -const util_hex_encoding_1 = __nccwpck_require__(61027); -const util_utf8_1 = __nccwpck_require__(38134); -const constants_1 = __nccwpck_require__(92245); -const signingKeyCache = {}; -const cacheQueue = []; -const createScope = (shortDate, region, service) => `${shortDate}/${region}/${service}/${constants_1.KEY_TYPE_IDENTIFIER}`; -exports.createScope = createScope; -const getSigningKey = async (sha256Constructor, credentials, shortDate, region, service) => { - const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId); - const cacheKey = `${shortDate}:${region}:${service}:${(0, util_hex_encoding_1.toHex)(credsHash)}:${credentials.sessionToken}`; - if (cacheKey in signingKeyCache) { - return signingKeyCache[cacheKey]; - } - cacheQueue.push(cacheKey); - while (cacheQueue.length > constants_1.MAX_CACHE_SIZE) { - delete signingKeyCache[cacheQueue.shift()]; - } - let key = `AWS4${credentials.secretAccessKey}`; - for (const signable of [shortDate, region, service, constants_1.KEY_TYPE_IDENTIFIER]) { - key = await hmac(sha256Constructor, key, signable); - } - return (signingKeyCache[cacheKey] = key); -}; -exports.getSigningKey = getSigningKey; -const clearCredentialCache = () => { - cacheQueue.length = 0; - Object.keys(signingKeyCache).forEach((cacheKey) => { - delete signingKeyCache[cacheKey]; - }); -}; -exports.clearCredentialCache = clearCredentialCache; -const hmac = (ctor, secret, data) => { - const hash = new ctor(secret); - hash.update((0, util_utf8_1.toUint8Array)(data)); - return hash.digest(); -}; - - -/***/ }), - -/***/ 42188: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getCanonicalHeaders = void 0; -const constants_1 = __nccwpck_require__(92245); -const getCanonicalHeaders = ({ headers }, unsignableHeaders, signableHeaders) => { - const canonical = {}; - for (const headerName of Object.keys(headers).sort()) { - if (headers[headerName] == undefined) { - continue; - } - const canonicalHeaderName = headerName.toLowerCase(); - if (canonicalHeaderName in constants_1.ALWAYS_UNSIGNABLE_HEADERS || - (unsignableHeaders === null || unsignableHeaders === void 0 ? void 0 : unsignableHeaders.has(canonicalHeaderName)) || - constants_1.PROXY_HEADER_PATTERN.test(canonicalHeaderName) || - constants_1.SEC_HEADER_PATTERN.test(canonicalHeaderName)) { - if (!signableHeaders || (signableHeaders && !signableHeaders.has(canonicalHeaderName))) { - continue; - } - } - canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " "); - } - return canonical; -}; -exports.getCanonicalHeaders = getCanonicalHeaders; - - -/***/ }), - -/***/ 94300: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getCanonicalQuery = void 0; -const util_uri_escape_1 = __nccwpck_require__(28768); -const constants_1 = __nccwpck_require__(92245); -const getCanonicalQuery = ({ query = {} }) => { - const keys = []; - const serialized = {}; - for (const key of Object.keys(query).sort()) { - if (key.toLowerCase() === constants_1.SIGNATURE_HEADER) { - continue; - } - keys.push(key); - const value = query[key]; - if (typeof value === "string") { - serialized[key] = `${(0, util_uri_escape_1.escapeUri)(key)}=${(0, util_uri_escape_1.escapeUri)(value)}`; - } - else if (Array.isArray(value)) { - serialized[key] = value - .slice(0) - .reduce((encoded, value) => encoded.concat([`${(0, util_uri_escape_1.escapeUri)(key)}=${(0, util_uri_escape_1.escapeUri)(value)}`]), []) - .sort() - .join("&"); - } - } - return keys - .map((key) => serialized[key]) - .filter((serialized) => serialized) - .join("&"); -}; -exports.getCanonicalQuery = getCanonicalQuery; - - -/***/ }), - -/***/ 50179: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getPayloadHash = void 0; -const is_array_buffer_1 = __nccwpck_require__(80743); -const util_hex_encoding_1 = __nccwpck_require__(61027); -const util_utf8_1 = __nccwpck_require__(38134); -const constants_1 = __nccwpck_require__(92245); -const getPayloadHash = async ({ headers, body }, hashConstructor) => { - for (const headerName of Object.keys(headers)) { - if (headerName.toLowerCase() === constants_1.SHA256_HEADER) { - return headers[headerName]; - } - } - if (body == undefined) { - return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; - } - else if (typeof body === "string" || ArrayBuffer.isView(body) || (0, is_array_buffer_1.isArrayBuffer)(body)) { - const hashCtor = new hashConstructor(); - hashCtor.update((0, util_utf8_1.toUint8Array)(body)); - return (0, util_hex_encoding_1.toHex)(await hashCtor.digest()); - } - return constants_1.UNSIGNED_PAYLOAD; -}; -exports.getPayloadHash = getPayloadHash; - - -/***/ }), - -/***/ 57211: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.deleteHeader = exports.getHeaderValue = exports.hasHeader = void 0; -const hasHeader = (soughtHeader, headers) => { - soughtHeader = soughtHeader.toLowerCase(); - for (const headerName of Object.keys(headers)) { - if (soughtHeader === headerName.toLowerCase()) { - return true; - } - } - return false; -}; -exports.hasHeader = hasHeader; -const getHeaderValue = (soughtHeader, headers) => { - soughtHeader = soughtHeader.toLowerCase(); - for (const headerName of Object.keys(headers)) { - if (soughtHeader === headerName.toLowerCase()) { - return headers[headerName]; - } - } - return undefined; -}; -exports.getHeaderValue = getHeaderValue; -const deleteHeader = (soughtHeader, headers) => { - soughtHeader = soughtHeader.toLowerCase(); - for (const headerName of Object.keys(headers)) { - if (soughtHeader === headerName.toLowerCase()) { - delete headers[headerName]; - } - } -}; -exports.deleteHeader = deleteHeader; - - -/***/ }), - -/***/ 91116: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.prepareRequest = exports.moveHeadersToQuery = exports.getPayloadHash = exports.getCanonicalQuery = exports.getCanonicalHeaders = void 0; -const tslib_1 = __nccwpck_require__(44780); -tslib_1.__exportStar(__nccwpck_require__(94905), exports); -var getCanonicalHeaders_1 = __nccwpck_require__(42188); -Object.defineProperty(exports, "getCanonicalHeaders", ({ enumerable: true, get: function () { return getCanonicalHeaders_1.getCanonicalHeaders; } })); -var getCanonicalQuery_1 = __nccwpck_require__(94300); -Object.defineProperty(exports, "getCanonicalQuery", ({ enumerable: true, get: function () { return getCanonicalQuery_1.getCanonicalQuery; } })); -var getPayloadHash_1 = __nccwpck_require__(50179); -Object.defineProperty(exports, "getPayloadHash", ({ enumerable: true, get: function () { return getPayloadHash_1.getPayloadHash; } })); -var moveHeadersToQuery_1 = __nccwpck_require__(72266); -Object.defineProperty(exports, "moveHeadersToQuery", ({ enumerable: true, get: function () { return moveHeadersToQuery_1.moveHeadersToQuery; } })); -var prepareRequest_1 = __nccwpck_require__(44656); -Object.defineProperty(exports, "prepareRequest", ({ enumerable: true, get: function () { return prepareRequest_1.prepareRequest; } })); -tslib_1.__exportStar(__nccwpck_require__(26266), exports); - - -/***/ }), - -/***/ 72266: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.moveHeadersToQuery = void 0; -const cloneRequest_1 = __nccwpck_require__(19271); -const moveHeadersToQuery = (request, options = {}) => { - var _a; - const { headers, query = {} } = typeof request.clone === "function" ? request.clone() : (0, cloneRequest_1.cloneRequest)(request); - for (const name of Object.keys(headers)) { - const lname = name.toLowerCase(); - if (lname.slice(0, 6) === "x-amz-" && !((_a = options.unhoistableHeaders) === null || _a === void 0 ? void 0 : _a.has(lname))) { - query[name] = headers[name]; - delete headers[name]; - } - } - return { - ...request, - headers, - query, - }; -}; -exports.moveHeadersToQuery = moveHeadersToQuery; - - -/***/ }), - -/***/ 44656: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.prepareRequest = void 0; -const cloneRequest_1 = __nccwpck_require__(19271); -const constants_1 = __nccwpck_require__(92245); -const prepareRequest = (request) => { - request = typeof request.clone === "function" ? request.clone() : (0, cloneRequest_1.cloneRequest)(request); - for (const headerName of Object.keys(request.headers)) { - if (constants_1.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) { - delete request.headers[headerName]; - } - } - return request; -}; -exports.prepareRequest = prepareRequest; - - -/***/ }), - -/***/ 81001: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toDate = exports.iso8601 = void 0; -const iso8601 = (time) => (0, exports.toDate)(time) - .toISOString() - .replace(/\.\d{3}Z$/, "Z"); -exports.iso8601 = iso8601; -const toDate = (time) => { - if (typeof time === "number") { - return new Date(time * 1000); - } - if (typeof time === "string") { - if (Number(time)) { - return new Date(Number(time) * 1000); - } - return new Date(time); - } - return time; -}; -exports.toDate = toDate; - - -/***/ }), - -/***/ 44780: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 21670: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NoOpLogger = void 0; -class NoOpLogger { - trace() { } - debug() { } - info() { } - warn() { } - error() { } -} -exports.NoOpLogger = NoOpLogger; - - -/***/ }), - -/***/ 96620: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Client = void 0; -const middleware_stack_1 = __nccwpck_require__(27814); -class Client { - constructor(config) { - this.middlewareStack = (0, middleware_stack_1.constructStack)(); - this.config = config; - } - send(command, optionsOrCb, cb) { - const options = typeof optionsOrCb !== "function" ? optionsOrCb : undefined; - const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb; - const handler = command.resolveMiddleware(this.middlewareStack, this.config, options); - if (callback) { - handler(command) - .then((result) => callback(null, result.output), (err) => callback(err)) - .catch(() => { }); - } - else { - return handler(command).then((result) => result.output); - } - } - destroy() { - if (this.config.requestHandler.destroy) - this.config.requestHandler.destroy(); - } -} -exports.Client = Client; - - -/***/ }), - -/***/ 92306: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.collectBody = void 0; -const util_stream_1 = __nccwpck_require__(55844); -const collectBody = async (streamBody = new Uint8Array(), context) => { - if (streamBody instanceof Uint8Array) { - return util_stream_1.Uint8ArrayBlobAdapter.mutate(streamBody); - } - if (!streamBody) { - return util_stream_1.Uint8ArrayBlobAdapter.mutate(new Uint8Array()); - } - const fromContext = context.streamCollector(streamBody); - return util_stream_1.Uint8ArrayBlobAdapter.mutate(await fromContext); -}; -exports.collectBody = collectBody; - - -/***/ }), - -/***/ 52228: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Command = void 0; -const middleware_stack_1 = __nccwpck_require__(27814); -const types_1 = __nccwpck_require__(75751); -class Command { - constructor() { - this.middlewareStack = (0, middleware_stack_1.constructStack)(); - } - static classBuilder() { - return new ClassBuilder(); - } - resolveMiddlewareWithContext(clientStack, configuration, options, { middlewareFn, clientName, commandName, inputFilterSensitiveLog, outputFilterSensitiveLog, smithyContext, additionalContext, CommandCtor, }) { - for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options)) { - this.middlewareStack.use(mw); - } - const stack = clientStack.concat(this.middlewareStack); - const { logger } = configuration; - const handlerExecutionContext = { - logger, - clientName, - commandName, - inputFilterSensitiveLog, - outputFilterSensitiveLog, - [types_1.SMITHY_CONTEXT_KEY]: { - ...smithyContext, - }, - ...additionalContext, - }; - const { requestHandler } = configuration; - return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); - } -} -exports.Command = Command; -class ClassBuilder { - constructor() { - this._init = () => { }; - this._ep = {}; - this._middlewareFn = () => []; - this._commandName = ""; - this._clientName = ""; - this._additionalContext = {}; - this._smithyContext = {}; - this._inputFilterSensitiveLog = (_) => _; - this._outputFilterSensitiveLog = (_) => _; - this._serializer = null; - this._deserializer = null; - } - init(cb) { - this._init = cb; - } - ep(endpointParameterInstructions) { - this._ep = endpointParameterInstructions; - return this; - } - m(middlewareSupplier) { - this._middlewareFn = middlewareSupplier; - return this; - } - s(service, operation, smithyContext = {}) { - this._smithyContext = { - service, - operation, - ...smithyContext, - }; - return this; - } - c(additionalContext = {}) { - this._additionalContext = additionalContext; - return this; - } - n(clientName, commandName) { - this._clientName = clientName; - this._commandName = commandName; - return this; - } - f(inputFilter = (_) => _, outputFilter = (_) => _) { - this._inputFilterSensitiveLog = inputFilter; - this._outputFilterSensitiveLog = outputFilter; - return this; - } - ser(serializer) { - this._serializer = serializer; - return this; - } - de(deserializer) { - this._deserializer = deserializer; - return this; - } - build() { - const closure = this; - let CommandRef; - return (CommandRef = class extends Command { - static getEndpointParameterInstructions() { - return closure._ep; - } - constructor(input) { - super(); - this.input = input; - this.serialize = closure._serializer; - this.deserialize = closure._deserializer; - closure._init(this); - } - resolveMiddleware(stack, configuration, options) { - return this.resolveMiddlewareWithContext(stack, configuration, options, { - CommandCtor: CommandRef, - middlewareFn: closure._middlewareFn, - clientName: closure._clientName, - commandName: closure._commandName, - inputFilterSensitiveLog: closure._inputFilterSensitiveLog, - outputFilterSensitiveLog: closure._outputFilterSensitiveLog, - smithyContext: closure._smithyContext, - additionalContext: closure._additionalContext, - }); - } - }); - } -} - - -/***/ }), - -/***/ 20081: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SENSITIVE_STRING = void 0; -exports.SENSITIVE_STRING = "***SensitiveInformation***"; - - -/***/ }), - -/***/ 9588: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createAggregatedClient = void 0; -const createAggregatedClient = (commands, Client) => { - for (const command of Object.keys(commands)) { - const CommandCtor = commands[command]; - const methodImpl = async function (args, optionsOrCb, cb) { - const command = new CommandCtor(args); - if (typeof optionsOrCb === "function") { - this.send(command, optionsOrCb); - } - else if (typeof cb === "function") { - if (typeof optionsOrCb !== "object") - throw new Error(`Expected http options but got ${typeof optionsOrCb}`); - this.send(command, optionsOrCb || {}, cb); - } - else { - return this.send(command, optionsOrCb); - } - }; - const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, ""); - Client.prototype[methodName] = methodImpl; - } -}; -exports.createAggregatedClient = createAggregatedClient; - - -/***/ }), - -/***/ 51701: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseEpochTimestamp = exports.parseRfc7231DateTime = exports.parseRfc3339DateTimeWithOffset = exports.parseRfc3339DateTime = exports.dateToUtcString = void 0; -const parse_utils_1 = __nccwpck_require__(41456); -const DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; -const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; -function dateToUtcString(date) { - const year = date.getUTCFullYear(); - const month = date.getUTCMonth(); - const dayOfWeek = date.getUTCDay(); - const dayOfMonthInt = date.getUTCDate(); - const hoursInt = date.getUTCHours(); - const minutesInt = date.getUTCMinutes(); - const secondsInt = date.getUTCSeconds(); - const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`; - const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`; - const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`; - const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`; - return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year} ${hoursString}:${minutesString}:${secondsString} GMT`; -} -exports.dateToUtcString = dateToUtcString; -const RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/); -const parseRfc3339DateTime = (value) => { - if (value === null || value === undefined) { - return undefined; - } - if (typeof value !== "string") { - throw new TypeError("RFC-3339 date-times must be expressed as strings"); - } - const match = RFC3339.exec(value); - if (!match) { - throw new TypeError("Invalid RFC-3339 date-time value"); - } - const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match; - const year = (0, parse_utils_1.strictParseShort)(stripLeadingZeroes(yearStr)); - const month = parseDateValue(monthStr, "month", 1, 12); - const day = parseDateValue(dayStr, "day", 1, 31); - return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds }); -}; -exports.parseRfc3339DateTime = parseRfc3339DateTime; -const RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/); -const parseRfc3339DateTimeWithOffset = (value) => { - if (value === null || value === undefined) { - return undefined; - } - if (typeof value !== "string") { - throw new TypeError("RFC-3339 date-times must be expressed as strings"); - } - const match = RFC3339_WITH_OFFSET.exec(value); - if (!match) { - throw new TypeError("Invalid RFC-3339 date-time value"); - } - const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match; - const year = (0, parse_utils_1.strictParseShort)(stripLeadingZeroes(yearStr)); - const month = parseDateValue(monthStr, "month", 1, 12); - const day = parseDateValue(dayStr, "day", 1, 31); - const date = buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds }); - if (offsetStr.toUpperCase() != "Z") { - date.setTime(date.getTime() - parseOffsetToMilliseconds(offsetStr)); - } - return date; -}; -exports.parseRfc3339DateTimeWithOffset = parseRfc3339DateTimeWithOffset; -const IMF_FIXDATE = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/); -const RFC_850_DATE = new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/); -const ASC_TIME = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/); -const parseRfc7231DateTime = (value) => { - if (value === null || value === undefined) { - return undefined; - } - if (typeof value !== "string") { - throw new TypeError("RFC-7231 date-times must be expressed as strings"); - } - let match = IMF_FIXDATE.exec(value); - if (match) { - const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; - return buildDate((0, parse_utils_1.strictParseShort)(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); - } - match = RFC_850_DATE.exec(value); - if (match) { - const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; - return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { - hours, - minutes, - seconds, - fractionalMilliseconds, - })); - } - match = ASC_TIME.exec(value); - if (match) { - const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match; - return buildDate((0, parse_utils_1.strictParseShort)(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr.trimLeft(), "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); - } - throw new TypeError("Invalid RFC-7231 date-time value"); -}; -exports.parseRfc7231DateTime = parseRfc7231DateTime; -const parseEpochTimestamp = (value) => { - if (value === null || value === undefined) { - return undefined; - } - let valueAsDouble; - if (typeof value === "number") { - valueAsDouble = value; - } - else if (typeof value === "string") { - valueAsDouble = (0, parse_utils_1.strictParseDouble)(value); - } - else { - throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation"); - } - if (Number.isNaN(valueAsDouble) || valueAsDouble === Infinity || valueAsDouble === -Infinity) { - throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics"); - } - return new Date(Math.round(valueAsDouble * 1000)); -}; -exports.parseEpochTimestamp = parseEpochTimestamp; -const buildDate = (year, month, day, time) => { - const adjustedMonth = month - 1; - validateDayOfMonth(year, adjustedMonth, day); - return new Date(Date.UTC(year, adjustedMonth, day, parseDateValue(time.hours, "hour", 0, 23), parseDateValue(time.minutes, "minute", 0, 59), parseDateValue(time.seconds, "seconds", 0, 60), parseMilliseconds(time.fractionalMilliseconds))); -}; -const parseTwoDigitYear = (value) => { - const thisYear = new Date().getUTCFullYear(); - const valueInThisCentury = Math.floor(thisYear / 100) * 100 + (0, parse_utils_1.strictParseShort)(stripLeadingZeroes(value)); - if (valueInThisCentury < thisYear) { - return valueInThisCentury + 100; - } - return valueInThisCentury; -}; -const FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1000; -const adjustRfc850Year = (input) => { - if (input.getTime() - new Date().getTime() > FIFTY_YEARS_IN_MILLIS) { - return new Date(Date.UTC(input.getUTCFullYear() - 100, input.getUTCMonth(), input.getUTCDate(), input.getUTCHours(), input.getUTCMinutes(), input.getUTCSeconds(), input.getUTCMilliseconds())); - } - return input; -}; -const parseMonthByShortName = (value) => { - const monthIdx = MONTHS.indexOf(value); - if (monthIdx < 0) { - throw new TypeError(`Invalid month: ${value}`); - } - return monthIdx + 1; -}; -const DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; -const validateDayOfMonth = (year, month, day) => { - let maxDays = DAYS_IN_MONTH[month]; - if (month === 1 && isLeapYear(year)) { - maxDays = 29; - } - if (day > maxDays) { - throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`); - } -}; -const isLeapYear = (year) => { - return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); -}; -const parseDateValue = (value, type, lower, upper) => { - const dateVal = (0, parse_utils_1.strictParseByte)(stripLeadingZeroes(value)); - if (dateVal < lower || dateVal > upper) { - throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`); - } - return dateVal; -}; -const parseMilliseconds = (value) => { - if (value === null || value === undefined) { - return 0; - } - return (0, parse_utils_1.strictParseFloat32)("0." + value) * 1000; -}; -const parseOffsetToMilliseconds = (value) => { - const directionStr = value[0]; - let direction = 1; - if (directionStr == "+") { - direction = 1; - } - else if (directionStr == "-") { - direction = -1; - } - else { - throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`); - } - const hour = Number(value.substring(1, 3)); - const minute = Number(value.substring(4, 6)); - return direction * (hour * 60 + minute) * 60 * 1000; -}; -const stripLeadingZeroes = (value) => { - let idx = 0; - while (idx < value.length - 1 && value.charAt(idx) === "0") { - idx++; - } - if (idx === 0) { - return value; - } - return value.slice(idx); -}; - - -/***/ }), - -/***/ 65795: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.withBaseException = exports.throwDefaultError = void 0; -const exceptions_1 = __nccwpck_require__(60086); -const throwDefaultError = ({ output, parsedBody, exceptionCtor, errorCode }) => { - const $metadata = deserializeMetadata(output); - const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined; - const response = new exceptionCtor({ - name: (parsedBody === null || parsedBody === void 0 ? void 0 : parsedBody.code) || (parsedBody === null || parsedBody === void 0 ? void 0 : parsedBody.Code) || errorCode || statusCode || "UnknownError", - $fault: "client", - $metadata, - }); - throw (0, exceptions_1.decorateServiceException)(response, parsedBody); -}; -exports.throwDefaultError = throwDefaultError; -const withBaseException = (ExceptionCtor) => { - return ({ output, parsedBody, errorCode }) => { - (0, exports.throwDefaultError)({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode }); - }; -}; -exports.withBaseException = withBaseException; -const deserializeMetadata = (output) => { - var _a, _b; - return ({ - httpStatusCode: output.statusCode, - requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"], - extendedRequestId: output.headers["x-amz-id-2"], - cfId: output.headers["x-amz-cf-id"], - }); -}; - - -/***/ }), - -/***/ 75712: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.loadConfigsForDefaultMode = void 0; -const loadConfigsForDefaultMode = (mode) => { - switch (mode) { - case "standard": - return { - retryMode: "standard", - connectionTimeout: 3100, - }; - case "in-region": - return { - retryMode: "standard", - connectionTimeout: 1100, - }; - case "cross-region": - return { - retryMode: "standard", - connectionTimeout: 3100, - }; - case "mobile": - return { - retryMode: "standard", - connectionTimeout: 30000, - }; - default: - return {}; - } -}; -exports.loadConfigsForDefaultMode = loadConfigsForDefaultMode; - - -/***/ }), - -/***/ 23656: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.emitWarningIfUnsupportedVersion = void 0; -let warningEmitted = false; -const emitWarningIfUnsupportedVersion = (version) => { - if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 14) { - warningEmitted = true; - } -}; -exports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion; - - -/***/ }), - -/***/ 60086: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.decorateServiceException = exports.ServiceException = void 0; -class ServiceException extends Error { - constructor(options) { - super(options.message); - Object.setPrototypeOf(this, ServiceException.prototype); - this.name = options.name; - this.$fault = options.$fault; - this.$metadata = options.$metadata; - } -} -exports.ServiceException = ServiceException; -const decorateServiceException = (exception, additions = {}) => { - Object.entries(additions) - .filter(([, v]) => v !== undefined) - .forEach(([k, v]) => { - if (exception[k] == undefined || exception[k] === "") { - exception[k] = v; - } - }); - const message = exception.message || exception.Message || "UnknownError"; - exception.message = message; - delete exception.Message; - return exception; -}; -exports.decorateServiceException = decorateServiceException; - - -/***/ }), - -/***/ 71345: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.extendedEncodeURIComponent = void 0; -function extendedEncodeURIComponent(str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { - return "%" + c.charCodeAt(0).toString(16).toUpperCase(); - }); -} -exports.extendedEncodeURIComponent = extendedEncodeURIComponent; - - -/***/ }), - -/***/ 56003: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; -const types_1 = __nccwpck_require__(75751); -Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return types_1.AlgorithmId; } })); -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - for (const id in types_1.AlgorithmId) { - const algorithmId = types_1.AlgorithmId[id]; - if (runtimeConfig[algorithmId] === undefined) { - continue; - } - checksumAlgorithms.push({ - algorithmId: () => algorithmId, - checksumConstructor: () => runtimeConfig[algorithmId], - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - }, - }; -}; -exports.getChecksumConfiguration = getChecksumConfiguration; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; -}; -exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; - - -/***/ }), - -/***/ 31676: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = exports.getDefaultExtensionConfiguration = void 0; -const checksum_1 = __nccwpck_require__(56003); -const retry_1 = __nccwpck_require__(7198); -const getDefaultExtensionConfiguration = (runtimeConfig) => { - return { - ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), - ...(0, retry_1.getRetryConfiguration)(runtimeConfig), - }; -}; -exports.getDefaultExtensionConfiguration = getDefaultExtensionConfiguration; -exports.getDefaultClientConfiguration = exports.getDefaultExtensionConfiguration; -const resolveDefaultRuntimeConfig = (config) => { - return { - ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), - ...(0, retry_1.resolveRetryRuntimeConfig)(config), - }; -}; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; - - -/***/ }), - -/***/ 62154: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(72073); -tslib_1.__exportStar(__nccwpck_require__(31676), exports); - - -/***/ }), - -/***/ 7198: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveRetryRuntimeConfig = exports.getRetryConfiguration = void 0; -const getRetryConfiguration = (runtimeConfig) => { - let _retryStrategy = runtimeConfig.retryStrategy; - return { - setRetryStrategy(retryStrategy) { - _retryStrategy = retryStrategy; - }, - retryStrategy() { - return _retryStrategy; - }, - }; -}; -exports.getRetryConfiguration = getRetryConfiguration; -const resolveRetryRuntimeConfig = (retryStrategyConfiguration) => { - const runtimeConfig = {}; - runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy(); - return runtimeConfig; -}; -exports.resolveRetryRuntimeConfig = resolveRetryRuntimeConfig; - - -/***/ }), - -/***/ 37697: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getArrayIfSingleItem = void 0; -const getArrayIfSingleItem = (mayBeArray) => Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray]; -exports.getArrayIfSingleItem = getArrayIfSingleItem; - - -/***/ }), - -/***/ 78957: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getValueFromTextNode = void 0; -const getValueFromTextNode = (obj) => { - const textNodeName = "#text"; - for (const key in obj) { - if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== undefined) { - obj[key] = obj[key][textNodeName]; - } - else if (typeof obj[key] === "object" && obj[key] !== null) { - obj[key] = (0, exports.getValueFromTextNode)(obj[key]); - } - } - return obj; -}; -exports.getValueFromTextNode = getValueFromTextNode; - - -/***/ }), - -/***/ 33218: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(72073); -tslib_1.__exportStar(__nccwpck_require__(21670), exports); -tslib_1.__exportStar(__nccwpck_require__(96620), exports); -tslib_1.__exportStar(__nccwpck_require__(92306), exports); -tslib_1.__exportStar(__nccwpck_require__(52228), exports); -tslib_1.__exportStar(__nccwpck_require__(20081), exports); -tslib_1.__exportStar(__nccwpck_require__(9588), exports); -tslib_1.__exportStar(__nccwpck_require__(51701), exports); -tslib_1.__exportStar(__nccwpck_require__(65795), exports); -tslib_1.__exportStar(__nccwpck_require__(75712), exports); -tslib_1.__exportStar(__nccwpck_require__(23656), exports); -tslib_1.__exportStar(__nccwpck_require__(62154), exports); -tslib_1.__exportStar(__nccwpck_require__(60086), exports); -tslib_1.__exportStar(__nccwpck_require__(71345), exports); -tslib_1.__exportStar(__nccwpck_require__(37697), exports); -tslib_1.__exportStar(__nccwpck_require__(78957), exports); -tslib_1.__exportStar(__nccwpck_require__(90345), exports); -tslib_1.__exportStar(__nccwpck_require__(14477), exports); -tslib_1.__exportStar(__nccwpck_require__(41456), exports); -tslib_1.__exportStar(__nccwpck_require__(68799), exports); -tslib_1.__exportStar(__nccwpck_require__(96213), exports); -tslib_1.__exportStar(__nccwpck_require__(95339), exports); -tslib_1.__exportStar(__nccwpck_require__(93288), exports); - - -/***/ }), - -/***/ 90345: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LazyJsonString = exports.StringWrapper = void 0; -const StringWrapper = function () { - const Class = Object.getPrototypeOf(this).constructor; - const Constructor = Function.bind.apply(String, [null, ...arguments]); - const instance = new Constructor(); - Object.setPrototypeOf(instance, Class.prototype); - return instance; -}; -exports.StringWrapper = StringWrapper; -exports.StringWrapper.prototype = Object.create(String.prototype, { - constructor: { - value: exports.StringWrapper, - enumerable: false, - writable: true, - configurable: true, - }, -}); -Object.setPrototypeOf(exports.StringWrapper, String); -class LazyJsonString extends exports.StringWrapper { - deserializeJSON() { - return JSON.parse(super.toString()); - } - toJSON() { - return super.toString(); - } - static fromObject(object) { - if (object instanceof LazyJsonString) { - return object; - } - else if (object instanceof String || typeof object === "string") { - return new LazyJsonString(object); - } - return new LazyJsonString(JSON.stringify(object)); - } -} -exports.LazyJsonString = LazyJsonString; - - -/***/ }), - -/***/ 14477: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.take = exports.convertMap = exports.map = void 0; -function map(arg0, arg1, arg2) { - let target; - let filter; - let instructions; - if (typeof arg1 === "undefined" && typeof arg2 === "undefined") { - target = {}; - instructions = arg0; - } - else { - target = arg0; - if (typeof arg1 === "function") { - filter = arg1; - instructions = arg2; - return mapWithFilter(target, filter, instructions); - } - else { - instructions = arg1; - } - } - for (const key of Object.keys(instructions)) { - if (!Array.isArray(instructions[key])) { - target[key] = instructions[key]; - continue; - } - applyInstruction(target, null, instructions, key); - } - return target; -} -exports.map = map; -const convertMap = (target) => { - const output = {}; - for (const [k, v] of Object.entries(target || {})) { - output[k] = [, v]; - } - return output; -}; -exports.convertMap = convertMap; -const take = (source, instructions) => { - const out = {}; - for (const key in instructions) { - applyInstruction(out, source, instructions, key); - } - return out; -}; -exports.take = take; -const mapWithFilter = (target, filter, instructions) => { - return map(target, Object.entries(instructions).reduce((_instructions, [key, value]) => { - if (Array.isArray(value)) { - _instructions[key] = value; - } - else { - if (typeof value === "function") { - _instructions[key] = [filter, value()]; - } - else { - _instructions[key] = [filter, value]; - } - } - return _instructions; - }, {})); -}; -const applyInstruction = (target, source, instructions, targetKey) => { - if (source !== null) { - let instruction = instructions[targetKey]; - if (typeof instruction === "function") { - instruction = [, instruction]; - } - const [filter = nonNullish, valueFn = pass, sourceKey = targetKey] = instruction; - if ((typeof filter === "function" && filter(source[sourceKey])) || (typeof filter !== "function" && !!filter)) { - target[targetKey] = valueFn(source[sourceKey]); - } - return; - } - let [filter, value] = instructions[targetKey]; - if (typeof value === "function") { - let _value; - const defaultFilterPassed = filter === undefined && (_value = value()) != null; - const customFilterPassed = (typeof filter === "function" && !!filter(void 0)) || (typeof filter !== "function" && !!filter); - if (defaultFilterPassed) { - target[targetKey] = _value; - } - else if (customFilterPassed) { - target[targetKey] = value(); - } - } - else { - const defaultFilterPassed = filter === undefined && value != null; - const customFilterPassed = (typeof filter === "function" && !!filter(value)) || (typeof filter !== "function" && !!filter); - if (defaultFilterPassed || customFilterPassed) { - target[targetKey] = value; - } - } -}; -const nonNullish = (_) => _ != null; -const pass = (_) => _; - - -/***/ }), - -/***/ 41456: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.logger = exports.strictParseByte = exports.strictParseShort = exports.strictParseInt32 = exports.strictParseInt = exports.strictParseLong = exports.limitedParseFloat32 = exports.limitedParseFloat = exports.handleFloat = exports.limitedParseDouble = exports.strictParseFloat32 = exports.strictParseFloat = exports.strictParseDouble = exports.expectUnion = exports.expectString = exports.expectObject = exports.expectNonNull = exports.expectByte = exports.expectShort = exports.expectInt32 = exports.expectInt = exports.expectLong = exports.expectFloat32 = exports.expectNumber = exports.expectBoolean = exports.parseBoolean = void 0; -const parseBoolean = (value) => { - switch (value) { - case "true": - return true; - case "false": - return false; - default: - throw new Error(`Unable to parse boolean value "${value}"`); - } -}; -exports.parseBoolean = parseBoolean; -const expectBoolean = (value) => { - if (value === null || value === undefined) { - return undefined; - } - if (typeof value === "number") { - if (value === 0 || value === 1) { - exports.logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); - } - if (value === 0) { - return false; - } - if (value === 1) { - return true; - } - } - if (typeof value === "string") { - const lower = value.toLowerCase(); - if (lower === "false" || lower === "true") { - exports.logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); - } - if (lower === "false") { - return false; - } - if (lower === "true") { - return true; - } - } - if (typeof value === "boolean") { - return value; - } - throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`); -}; -exports.expectBoolean = expectBoolean; -const expectNumber = (value) => { - if (value === null || value === undefined) { - return undefined; - } - if (typeof value === "string") { - const parsed = parseFloat(value); - if (!Number.isNaN(parsed)) { - if (String(parsed) !== String(value)) { - exports.logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`)); - } - return parsed; - } - } - if (typeof value === "number") { - return value; - } - throw new TypeError(`Expected number, got ${typeof value}: ${value}`); -}; -exports.expectNumber = expectNumber; -const MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23)); -const expectFloat32 = (value) => { - const expected = (0, exports.expectNumber)(value); - if (expected !== undefined && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) { - if (Math.abs(expected) > MAX_FLOAT) { - throw new TypeError(`Expected 32-bit float, got ${value}`); - } - } - return expected; -}; -exports.expectFloat32 = expectFloat32; -const expectLong = (value) => { - if (value === null || value === undefined) { - return undefined; - } - if (Number.isInteger(value) && !Number.isNaN(value)) { - return value; - } - throw new TypeError(`Expected integer, got ${typeof value}: ${value}`); -}; -exports.expectLong = expectLong; -exports.expectInt = exports.expectLong; -const expectInt32 = (value) => expectSizedInt(value, 32); -exports.expectInt32 = expectInt32; -const expectShort = (value) => expectSizedInt(value, 16); -exports.expectShort = expectShort; -const expectByte = (value) => expectSizedInt(value, 8); -exports.expectByte = expectByte; -const expectSizedInt = (value, size) => { - const expected = (0, exports.expectLong)(value); - if (expected !== undefined && castInt(expected, size) !== expected) { - throw new TypeError(`Expected ${size}-bit integer, got ${value}`); - } - return expected; -}; -const castInt = (value, size) => { - switch (size) { - case 32: - return Int32Array.of(value)[0]; - case 16: - return Int16Array.of(value)[0]; - case 8: - return Int8Array.of(value)[0]; - } -}; -const expectNonNull = (value, location) => { - if (value === null || value === undefined) { - if (location) { - throw new TypeError(`Expected a non-null value for ${location}`); - } - throw new TypeError("Expected a non-null value"); - } - return value; -}; -exports.expectNonNull = expectNonNull; -const expectObject = (value) => { - if (value === null || value === undefined) { - return undefined; - } - if (typeof value === "object" && !Array.isArray(value)) { - return value; - } - const receivedType = Array.isArray(value) ? "array" : typeof value; - throw new TypeError(`Expected object, got ${receivedType}: ${value}`); -}; -exports.expectObject = expectObject; -const expectString = (value) => { - if (value === null || value === undefined) { - return undefined; - } - if (typeof value === "string") { - return value; - } - if (["boolean", "number", "bigint"].includes(typeof value)) { - exports.logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`)); - return String(value); - } - throw new TypeError(`Expected string, got ${typeof value}: ${value}`); -}; -exports.expectString = expectString; -const expectUnion = (value) => { - if (value === null || value === undefined) { - return undefined; - } - const asObject = (0, exports.expectObject)(value); - const setKeys = Object.entries(asObject) - .filter(([, v]) => v != null) - .map(([k]) => k); - if (setKeys.length === 0) { - throw new TypeError(`Unions must have exactly one non-null member. None were found.`); - } - if (setKeys.length > 1) { - throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`); - } - return asObject; -}; -exports.expectUnion = expectUnion; -const strictParseDouble = (value) => { - if (typeof value == "string") { - return (0, exports.expectNumber)(parseNumber(value)); - } - return (0, exports.expectNumber)(value); -}; -exports.strictParseDouble = strictParseDouble; -exports.strictParseFloat = exports.strictParseDouble; -const strictParseFloat32 = (value) => { - if (typeof value == "string") { - return (0, exports.expectFloat32)(parseNumber(value)); - } - return (0, exports.expectFloat32)(value); -}; -exports.strictParseFloat32 = strictParseFloat32; -const NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g; -const parseNumber = (value) => { - const matches = value.match(NUMBER_REGEX); - if (matches === null || matches[0].length !== value.length) { - throw new TypeError(`Expected real number, got implicit NaN`); - } - return parseFloat(value); -}; -const limitedParseDouble = (value) => { - if (typeof value == "string") { - return parseFloatString(value); - } - return (0, exports.expectNumber)(value); -}; -exports.limitedParseDouble = limitedParseDouble; -exports.handleFloat = exports.limitedParseDouble; -exports.limitedParseFloat = exports.limitedParseDouble; -const limitedParseFloat32 = (value) => { - if (typeof value == "string") { - return parseFloatString(value); - } - return (0, exports.expectFloat32)(value); -}; -exports.limitedParseFloat32 = limitedParseFloat32; -const parseFloatString = (value) => { - switch (value) { - case "NaN": - return NaN; - case "Infinity": - return Infinity; - case "-Infinity": - return -Infinity; - default: - throw new Error(`Unable to parse float value: ${value}`); - } -}; -const strictParseLong = (value) => { - if (typeof value === "string") { - return (0, exports.expectLong)(parseNumber(value)); - } - return (0, exports.expectLong)(value); -}; -exports.strictParseLong = strictParseLong; -exports.strictParseInt = exports.strictParseLong; -const strictParseInt32 = (value) => { - if (typeof value === "string") { - return (0, exports.expectInt32)(parseNumber(value)); - } - return (0, exports.expectInt32)(value); -}; -exports.strictParseInt32 = strictParseInt32; -const strictParseShort = (value) => { - if (typeof value === "string") { - return (0, exports.expectShort)(parseNumber(value)); - } - return (0, exports.expectShort)(value); -}; -exports.strictParseShort = strictParseShort; -const strictParseByte = (value) => { - if (typeof value === "string") { - return (0, exports.expectByte)(parseNumber(value)); - } - return (0, exports.expectByte)(value); -}; -exports.strictParseByte = strictParseByte; -const stackTraceWarning = (message) => { - return String(new TypeError(message).stack || message) - .split("\n") - .slice(0, 5) - .filter((s) => !s.includes("stackTraceWarning")) - .join("\n"); -}; -exports.logger = { - warn: console.warn, -}; - - -/***/ }), - -/***/ 68799: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolvedPath = void 0; -const extended_encode_uri_component_1 = __nccwpck_require__(71345); -const resolvedPath = (resolvedPath, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => { - if (input != null && input[memberName] !== undefined) { - const labelValue = labelValueProvider(); - if (labelValue.length <= 0) { - throw new Error("Empty value provided for input HTTP label: " + memberName + "."); - } - resolvedPath = resolvedPath.replace(uriLabel, isGreedyLabel - ? labelValue - .split("/") - .map((segment) => (0, extended_encode_uri_component_1.extendedEncodeURIComponent)(segment)) - .join("/") - : (0, extended_encode_uri_component_1.extendedEncodeURIComponent)(labelValue)); - } - else { - throw new Error("No value provided for input HTTP label: " + memberName + "."); - } - return resolvedPath; -}; -exports.resolvedPath = resolvedPath; - - -/***/ }), - -/***/ 96213: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.serializeFloat = void 0; -const serializeFloat = (value) => { - if (value !== value) { - return "NaN"; - } - switch (value) { - case Infinity: - return "Infinity"; - case -Infinity: - return "-Infinity"; - default: - return value; - } -}; -exports.serializeFloat = serializeFloat; - - -/***/ }), - -/***/ 95339: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._json = void 0; -const _json = (obj) => { - if (obj == null) { - return {}; - } - if (Array.isArray(obj)) { - return obj.filter((_) => _ != null).map(exports._json); - } - if (typeof obj === "object") { - const target = {}; - for (const key of Object.keys(obj)) { - if (obj[key] == null) { - continue; - } - target[key] = (0, exports._json)(obj[key]); - } - return target; - } - return obj; -}; -exports._json = _json; - - -/***/ }), - -/***/ 93288: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.splitEvery = void 0; -function splitEvery(value, delimiter, numDelimiters) { - if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) { - throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery."); - } - const segments = value.split(delimiter); - if (numDelimiters === 1) { - return segments; - } - const compoundSegments = []; - let currentSegment = ""; - for (let i = 0; i < segments.length; i++) { - if (currentSegment === "") { - currentSegment = segments[i]; - } - else { - currentSegment += delimiter + segments[i]; - } - if ((i + 1) % numDelimiters === 0) { - compoundSegments.push(currentSegment); - currentSegment = ""; - } - } - if (currentSegment !== "") { - compoundSegments.push(currentSegment); - } - return compoundSegments; -} -exports.splitEvery = splitEvery; - - -/***/ }), - -/***/ 72073: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 27311: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 30177: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpApiKeyAuthLocation = void 0; -var HttpApiKeyAuthLocation; -(function (HttpApiKeyAuthLocation) { - HttpApiKeyAuthLocation["HEADER"] = "header"; - HttpApiKeyAuthLocation["QUERY"] = "query"; -})(HttpApiKeyAuthLocation = exports.HttpApiKeyAuthLocation || (exports.HttpApiKeyAuthLocation = {})); - - -/***/ }), - -/***/ 3890: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 97166: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 54150: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 87652: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 35711: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpAuthLocation = void 0; -var HttpAuthLocation; -(function (HttpAuthLocation) { - HttpAuthLocation["HEADER"] = "header"; - HttpAuthLocation["QUERY"] = "query"; -})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); - - -/***/ }), - -/***/ 18281: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(78889); -tslib_1.__exportStar(__nccwpck_require__(35711), exports); -tslib_1.__exportStar(__nccwpck_require__(30177), exports); -tslib_1.__exportStar(__nccwpck_require__(3890), exports); -tslib_1.__exportStar(__nccwpck_require__(97166), exports); -tslib_1.__exportStar(__nccwpck_require__(54150), exports); -tslib_1.__exportStar(__nccwpck_require__(87652), exports); - - -/***/ }), - -/***/ 82707: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 76708: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 13184: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 19628: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 46555: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 98864: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(78889); -tslib_1.__exportStar(__nccwpck_require__(46555), exports); -tslib_1.__exportStar(__nccwpck_require__(82619), exports); -tslib_1.__exportStar(__nccwpck_require__(31324), exports); - - -/***/ }), - -/***/ 82619: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 31324: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 34391: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 39987: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 72656: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointURLScheme = void 0; -var EndpointURLScheme; -(function (EndpointURLScheme) { - EndpointURLScheme["HTTP"] = "http"; - EndpointURLScheme["HTTPS"] = "https"; -})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); - - -/***/ }), - -/***/ 36358: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 6391: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 32982: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 9527: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 68041: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(78889); -tslib_1.__exportStar(__nccwpck_require__(36358), exports); -tslib_1.__exportStar(__nccwpck_require__(6391), exports); -tslib_1.__exportStar(__nccwpck_require__(32982), exports); -tslib_1.__exportStar(__nccwpck_require__(19452), exports); -tslib_1.__exportStar(__nccwpck_require__(9527), exports); - - -/***/ }), - -/***/ 19452: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 78168: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 17956: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; -var AlgorithmId; -(function (AlgorithmId) { - AlgorithmId["MD5"] = "md5"; - AlgorithmId["CRC32"] = "crc32"; - AlgorithmId["CRC32C"] = "crc32c"; - AlgorithmId["SHA1"] = "sha1"; - AlgorithmId["SHA256"] = "sha256"; -})(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); -const getChecksumConfiguration = (runtimeConfig) => { - const checksumAlgorithms = []; - if (runtimeConfig.sha256 !== undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.SHA256, - checksumConstructor: () => runtimeConfig.sha256, - }); - } - if (runtimeConfig.md5 != undefined) { - checksumAlgorithms.push({ - algorithmId: () => AlgorithmId.MD5, - checksumConstructor: () => runtimeConfig.md5, - }); - } - return { - _checksumAlgorithms: checksumAlgorithms, - addChecksumAlgorithm(algo) { - this._checksumAlgorithms.push(algo); - }, - checksumAlgorithms() { - return this._checksumAlgorithms; - }, - }; -}; -exports.getChecksumConfiguration = getChecksumConfiguration; -const resolveChecksumRuntimeConfig = (clientConfig) => { - const runtimeConfig = {}; - clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { - runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); - }); - return runtimeConfig; -}; -exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; - - -/***/ }), - -/***/ 20071: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; -const checksum_1 = __nccwpck_require__(17956); -const getDefaultClientConfiguration = (runtimeConfig) => { - return { - ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), - }; -}; -exports.getDefaultClientConfiguration = getDefaultClientConfiguration; -const resolveDefaultRuntimeConfig = (config) => { - return { - ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), - }; -}; -exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; - - -/***/ }), - -/***/ 51839: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 50873: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlgorithmId = void 0; -const tslib_1 = __nccwpck_require__(78889); -tslib_1.__exportStar(__nccwpck_require__(20071), exports); -tslib_1.__exportStar(__nccwpck_require__(51839), exports); -var checksum_1 = __nccwpck_require__(17956); -Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return checksum_1.AlgorithmId; } })); - - -/***/ }), - -/***/ 66574: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FieldPosition = void 0; -var FieldPosition; -(function (FieldPosition) { - FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; - FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; -})(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); - - -/***/ }), - -/***/ 56867: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 2197: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 8349: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 60147: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 27469: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(78889); -tslib_1.__exportStar(__nccwpck_require__(2197), exports); -tslib_1.__exportStar(__nccwpck_require__(8349), exports); -tslib_1.__exportStar(__nccwpck_require__(60147), exports); -tslib_1.__exportStar(__nccwpck_require__(4417), exports); - - -/***/ }), - -/***/ 4417: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 75751: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(78889); -tslib_1.__exportStar(__nccwpck_require__(27311), exports); -tslib_1.__exportStar(__nccwpck_require__(18281), exports); -tslib_1.__exportStar(__nccwpck_require__(82707), exports); -tslib_1.__exportStar(__nccwpck_require__(76708), exports); -tslib_1.__exportStar(__nccwpck_require__(13184), exports); -tslib_1.__exportStar(__nccwpck_require__(19628), exports); -tslib_1.__exportStar(__nccwpck_require__(98864), exports); -tslib_1.__exportStar(__nccwpck_require__(34391), exports); -tslib_1.__exportStar(__nccwpck_require__(39987), exports); -tslib_1.__exportStar(__nccwpck_require__(72656), exports); -tslib_1.__exportStar(__nccwpck_require__(68041), exports); -tslib_1.__exportStar(__nccwpck_require__(78168), exports); -tslib_1.__exportStar(__nccwpck_require__(50873), exports); -tslib_1.__exportStar(__nccwpck_require__(66574), exports); -tslib_1.__exportStar(__nccwpck_require__(56867), exports); -tslib_1.__exportStar(__nccwpck_require__(27469), exports); -tslib_1.__exportStar(__nccwpck_require__(11617), exports); -tslib_1.__exportStar(__nccwpck_require__(38205), exports); -tslib_1.__exportStar(__nccwpck_require__(18760), exports); -tslib_1.__exportStar(__nccwpck_require__(47160), exports); -tslib_1.__exportStar(__nccwpck_require__(77883), exports); -tslib_1.__exportStar(__nccwpck_require__(89348), exports); -tslib_1.__exportStar(__nccwpck_require__(342), exports); -tslib_1.__exportStar(__nccwpck_require__(61557), exports); -tslib_1.__exportStar(__nccwpck_require__(39764), exports); -tslib_1.__exportStar(__nccwpck_require__(10599), exports); -tslib_1.__exportStar(__nccwpck_require__(50480), exports); -tslib_1.__exportStar(__nccwpck_require__(57046), exports); -tslib_1.__exportStar(__nccwpck_require__(72583), exports); -tslib_1.__exportStar(__nccwpck_require__(24592), exports); -tslib_1.__exportStar(__nccwpck_require__(26681), exports); -tslib_1.__exportStar(__nccwpck_require__(47982), exports); -tslib_1.__exportStar(__nccwpck_require__(14852), exports); -tslib_1.__exportStar(__nccwpck_require__(49541), exports); -tslib_1.__exportStar(__nccwpck_require__(15519), exports); -tslib_1.__exportStar(__nccwpck_require__(849), exports); - - -/***/ }), - -/***/ 11617: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 38205: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SMITHY_CONTEXT_KEY = void 0; -exports.SMITHY_CONTEXT_KEY = "__smithy_context"; - - -/***/ }), - -/***/ 18760: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 47160: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.IniSectionType = void 0; -var IniSectionType; -(function (IniSectionType) { - IniSectionType["PROFILE"] = "profile"; - IniSectionType["SSO_SESSION"] = "sso-session"; - IniSectionType["SERVICES"] = "services"; -})(IniSectionType = exports.IniSectionType || (exports.IniSectionType = {})); - - -/***/ }), - -/***/ 77883: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 89348: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 342: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 61557: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 39764: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 10599: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 50480: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 57046: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 72583: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 24592: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequestHandlerProtocol = void 0; -var RequestHandlerProtocol; -(function (RequestHandlerProtocol) { - RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; - RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; - RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; -})(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); - - -/***/ }), - -/***/ 26681: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 47982: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 14852: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 49541: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 15519: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 849: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 78889: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 98245: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseUrl = void 0; -const querystring_parser_1 = __nccwpck_require__(44435); -const parseUrl = (url) => { - if (typeof url === "string") { - return (0, exports.parseUrl)(new URL(url)); - } - const { hostname, pathname, port, protocol, search } = url; - let query; - if (search) { - query = (0, querystring_parser_1.parseQueryString)(search); - } - return { - hostname, - port: port ? parseInt(port) : undefined, - protocol, - path: pathname, - query, - }; -}; -exports.parseUrl = parseUrl; - - -/***/ }), - -/***/ 7417: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromBase64 = void 0; -const util_buffer_from_1 = __nccwpck_require__(41308); -const BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/; -const fromBase64 = (input) => { - if ((input.length * 3) % 4 !== 0) { - throw new TypeError(`Incorrect padding on base64 string.`); - } - if (!BASE64_REGEX.exec(input)) { - throw new TypeError(`Invalid base64 string.`); - } - const buffer = (0, util_buffer_from_1.fromString)(input, "base64"); - return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); -}; -exports.fromBase64 = fromBase64; - - -/***/ }), - -/***/ 14478: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(84245); -tslib_1.__exportStar(__nccwpck_require__(7417), exports); -tslib_1.__exportStar(__nccwpck_require__(95756), exports); - - -/***/ }), - -/***/ 95756: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toBase64 = void 0; -const util_buffer_from_1 = __nccwpck_require__(41308); -const toBase64 = (input) => (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("base64"); -exports.toBase64 = toBase64; - - -/***/ }), - -/***/ 84245: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 25590: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.calculateBodyLength = void 0; -const fs_1 = __nccwpck_require__(57147); -const calculateBodyLength = (body) => { - if (!body) { - return 0; - } - if (typeof body === "string") { - return Buffer.from(body).length; - } - else if (typeof body.byteLength === "number") { - return body.byteLength; - } - else if (typeof body.size === "number") { - return body.size; - } - else if (typeof body.start === "number" && typeof body.end === "number") { - return body.end + 1 - body.start; - } - else if (typeof body.path === "string" || Buffer.isBuffer(body.path)) { - return (0, fs_1.lstatSync)(body.path).size; - } - else if (typeof body.fd === "number") { - return (0, fs_1.fstatSync)(body.fd).size; - } - throw new Error(`Body Length computation failed for ${body}`); -}; -exports.calculateBodyLength = calculateBodyLength; - - -/***/ }), - -/***/ 87693: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(95586); -tslib_1.__exportStar(__nccwpck_require__(25590), exports); - - -/***/ }), - -/***/ 95586: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 41308: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromString = exports.fromArrayBuffer = void 0; -const is_array_buffer_1 = __nccwpck_require__(80743); -const buffer_1 = __nccwpck_require__(14300); -const fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => { - if (!(0, is_array_buffer_1.isArrayBuffer)(input)) { - throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); - } - return buffer_1.Buffer.from(input, offset, length); -}; -exports.fromArrayBuffer = fromArrayBuffer; -const fromString = (input, encoding) => { - if (typeof input !== "string") { - throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`); - } - return encoding ? buffer_1.Buffer.from(input, encoding) : buffer_1.Buffer.from(input); -}; -exports.fromString = fromString; - - -/***/ }), - -/***/ 94733: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.booleanSelector = void 0; -const booleanSelector = (obj, key, type) => { - if (!(key in obj)) - return undefined; - if (obj[key] === "true") - return true; - if (obj[key] === "false") - return false; - throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`); -}; -exports.booleanSelector = booleanSelector; - - -/***/ }), - -/***/ 32617: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(13823); -tslib_1.__exportStar(__nccwpck_require__(94733), exports); -tslib_1.__exportStar(__nccwpck_require__(39576), exports); -tslib_1.__exportStar(__nccwpck_require__(33376), exports); - - -/***/ }), - -/***/ 39576: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.numberSelector = void 0; -const numberSelector = (obj, key, type) => { - if (!(key in obj)) - return undefined; - const numberValue = parseInt(obj[key], 10); - if (Number.isNaN(numberValue)) { - throw new TypeError(`Cannot load ${type} '${key}'. Expected number, got '${obj[key]}'.`); - } - return numberValue; -}; -exports.numberSelector = numberSelector; - - -/***/ }), - -/***/ 33376: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SelectorType = void 0; -var SelectorType; -(function (SelectorType) { - SelectorType["ENV"] = "env"; - SelectorType["CONFIG"] = "shared config entry"; -})(SelectorType = exports.SelectorType || (exports.SelectorType = {})); - - -/***/ }), - -/***/ 13823: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 88479: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.IMDS_REGION_PATH = exports.DEFAULTS_MODE_OPTIONS = exports.ENV_IMDS_DISABLED = exports.AWS_DEFAULT_REGION_ENV = exports.AWS_REGION_ENV = exports.AWS_EXECUTION_ENV = void 0; -exports.AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV"; -exports.AWS_REGION_ENV = "AWS_REGION"; -exports.AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION"; -exports.ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; -exports.DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"]; -exports.IMDS_REGION_PATH = "/latest/meta-data/placement/region"; - - -/***/ }), - -/***/ 11643: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NODE_DEFAULTS_MODE_CONFIG_OPTIONS = void 0; -const AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE"; -const AWS_DEFAULTS_MODE_CONFIG = "defaults_mode"; -exports.NODE_DEFAULTS_MODE_CONFIG_OPTIONS = { - environmentVariableSelector: (env) => { - return env[AWS_DEFAULTS_MODE_ENV]; - }, - configFileSelector: (profile) => { - return profile[AWS_DEFAULTS_MODE_CONFIG]; - }, - default: "legacy", -}; - - -/***/ }), - -/***/ 6061: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(78457); -tslib_1.__exportStar(__nccwpck_require__(87965), exports); - - -/***/ }), - -/***/ 87965: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveDefaultsModeConfig = void 0; -const config_resolver_1 = __nccwpck_require__(66041); -const credential_provider_imds_1 = __nccwpck_require__(34673); -const node_config_provider_1 = __nccwpck_require__(13079); -const property_provider_1 = __nccwpck_require__(12955); -const constants_1 = __nccwpck_require__(88479); -const defaultsModeConfig_1 = __nccwpck_require__(11643); -const resolveDefaultsModeConfig = ({ region = (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS), defaultsMode = (0, node_config_provider_1.loadConfig)(defaultsModeConfig_1.NODE_DEFAULTS_MODE_CONFIG_OPTIONS), } = {}) => (0, property_provider_1.memoize)(async () => { - const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode; - switch (mode === null || mode === void 0 ? void 0 : mode.toLowerCase()) { - case "auto": - return resolveNodeDefaultsModeAuto(region); - case "in-region": - case "cross-region": - case "mobile": - case "standard": - case "legacy": - return Promise.resolve(mode === null || mode === void 0 ? void 0 : mode.toLocaleLowerCase()); - case undefined: - return Promise.resolve("legacy"); - default: - throw new Error(`Invalid parameter for "defaultsMode", expect ${constants_1.DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`); - } -}); -exports.resolveDefaultsModeConfig = resolveDefaultsModeConfig; -const resolveNodeDefaultsModeAuto = async (clientRegion) => { - if (clientRegion) { - const resolvedRegion = typeof clientRegion === "function" ? await clientRegion() : clientRegion; - const inferredRegion = await inferPhysicalRegion(); - if (!inferredRegion) { - return "standard"; - } - if (resolvedRegion === inferredRegion) { - return "in-region"; - } - else { - return "cross-region"; - } - } - return "standard"; -}; -const inferPhysicalRegion = async () => { - var _a; - if (process.env[constants_1.AWS_EXECUTION_ENV] && (process.env[constants_1.AWS_REGION_ENV] || process.env[constants_1.AWS_DEFAULT_REGION_ENV])) { - return (_a = process.env[constants_1.AWS_REGION_ENV]) !== null && _a !== void 0 ? _a : process.env[constants_1.AWS_DEFAULT_REGION_ENV]; - } - if (!process.env[constants_1.ENV_IMDS_DISABLED]) { - try { - const endpoint = await (0, credential_provider_imds_1.getInstanceMetadataEndpoint)(); - return (await (0, credential_provider_imds_1.httpRequest)({ ...endpoint, path: constants_1.IMDS_REGION_PATH })).toString(); - } - catch (e) { - } - } -}; - - -/***/ }), - -/***/ 78457: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 82902: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.debugId = void 0; -exports.debugId = "endpoints"; - - -/***/ }), - -/***/ 4140: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(9286); -tslib_1.__exportStar(__nccwpck_require__(82902), exports); -tslib_1.__exportStar(__nccwpck_require__(47162), exports); - - -/***/ }), - -/***/ 47162: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toDebugString = void 0; -function toDebugString(input) { - if (typeof input !== "object" || input == null) { - return input; - } - if ("ref" in input) { - return `$${toDebugString(input.ref)}`; - } - if ("fn" in input) { - return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`; - } - return JSON.stringify(input, null, 2); -} -exports.toDebugString = toDebugString; - - -/***/ }), - -/***/ 34548: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(9286); -tslib_1.__exportStar(__nccwpck_require__(19229), exports); -tslib_1.__exportStar(__nccwpck_require__(73598), exports); -tslib_1.__exportStar(__nccwpck_require__(59612), exports); -tslib_1.__exportStar(__nccwpck_require__(77555), exports); -tslib_1.__exportStar(__nccwpck_require__(64175), exports); - - -/***/ }), - -/***/ 56216: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.booleanEquals = void 0; -const booleanEquals = (value1, value2) => value1 === value2; -exports.booleanEquals = booleanEquals; - - -/***/ }), - -/***/ 27597: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getAttr = void 0; -const types_1 = __nccwpck_require__(64175); -const getAttrPathList_1 = __nccwpck_require__(69180); -const getAttr = (value, path) => (0, getAttrPathList_1.getAttrPathList)(path).reduce((acc, index) => { - if (typeof acc !== "object") { - throw new types_1.EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`); - } - else if (Array.isArray(acc)) { - return acc[parseInt(index)]; - } - return acc[index]; -}, value); -exports.getAttr = getAttr; - - -/***/ }), - -/***/ 69180: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getAttrPathList = void 0; -const types_1 = __nccwpck_require__(64175); -const getAttrPathList = (path) => { - const parts = path.split("."); - const pathList = []; - for (const part of parts) { - const squareBracketIndex = part.indexOf("["); - if (squareBracketIndex !== -1) { - if (part.indexOf("]") !== part.length - 1) { - throw new types_1.EndpointError(`Path: '${path}' does not end with ']'`); - } - const arrayIndex = part.slice(squareBracketIndex + 1, -1); - if (Number.isNaN(parseInt(arrayIndex))) { - throw new types_1.EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`); - } - if (squareBracketIndex !== 0) { - pathList.push(part.slice(0, squareBracketIndex)); - } - pathList.push(arrayIndex); - } - else { - pathList.push(part); - } - } - return pathList; -}; -exports.getAttrPathList = getAttrPathList; - - -/***/ }), - -/***/ 8649: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(9286); -tslib_1.__exportStar(__nccwpck_require__(56216), exports); -tslib_1.__exportStar(__nccwpck_require__(27597), exports); -tslib_1.__exportStar(__nccwpck_require__(15762), exports); -tslib_1.__exportStar(__nccwpck_require__(73598), exports); -tslib_1.__exportStar(__nccwpck_require__(89166), exports); -tslib_1.__exportStar(__nccwpck_require__(41146), exports); -tslib_1.__exportStar(__nccwpck_require__(39953), exports); -tslib_1.__exportStar(__nccwpck_require__(50584), exports); -tslib_1.__exportStar(__nccwpck_require__(28758), exports); - - -/***/ }), - -/***/ 19229: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isIpAddress = void 0; -const IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`); -const isIpAddress = (value) => IP_V4_REGEX.test(value) || (value.startsWith("[") && value.endsWith("]")); -exports.isIpAddress = isIpAddress; - - -/***/ }), - -/***/ 15762: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isSet = void 0; -const isSet = (value) => value != null; -exports.isSet = isSet; - - -/***/ }), - -/***/ 73598: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isValidHostLabel = void 0; -const VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`); -const isValidHostLabel = (value, allowSubDomains = false) => { - if (!allowSubDomains) { - return VALID_HOST_LABEL_REGEX.test(value); - } - const labels = value.split("."); - for (const label of labels) { - if (!(0, exports.isValidHostLabel)(label)) { - return false; - } - } - return true; -}; -exports.isValidHostLabel = isValidHostLabel; - - -/***/ }), - -/***/ 89166: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.not = void 0; -const not = (value) => !value; -exports.not = not; - - -/***/ }), - -/***/ 41146: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseURL = void 0; -const types_1 = __nccwpck_require__(75751); -const isIpAddress_1 = __nccwpck_require__(19229); -const DEFAULT_PORTS = { - [types_1.EndpointURLScheme.HTTP]: 80, - [types_1.EndpointURLScheme.HTTPS]: 443, -}; -const parseURL = (value) => { - const whatwgURL = (() => { - try { - if (value instanceof URL) { - return value; - } - if (typeof value === "object" && "hostname" in value) { - const { hostname, port, protocol = "", path = "", query = {} } = value; - const url = new URL(`${protocol}//${hostname}${port ? `:${port}` : ""}${path}`); - url.search = Object.entries(query) - .map(([k, v]) => `${k}=${v}`) - .join("&"); - return url; - } - return new URL(value); - } - catch (error) { - return null; - } - })(); - if (!whatwgURL) { - console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`); - return null; - } - const urlString = whatwgURL.href; - const { host, hostname, pathname, protocol, search } = whatwgURL; - if (search) { - return null; - } - const scheme = protocol.slice(0, -1); - if (!Object.values(types_1.EndpointURLScheme).includes(scheme)) { - return null; - } - const isIp = (0, isIpAddress_1.isIpAddress)(hostname); - const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) || - (typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`)); - const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`; - return { - scheme, - authority, - path: pathname, - normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`, - isIp, - }; -}; -exports.parseURL = parseURL; - - -/***/ }), - -/***/ 39953: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.stringEquals = void 0; -const stringEquals = (value1, value2) => value1 === value2; -exports.stringEquals = stringEquals; - - -/***/ }), - -/***/ 50584: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.substring = void 0; -const substring = (input, start, stop, reverse) => { - if (start >= stop || input.length < stop) { - return null; - } - if (!reverse) { - return input.substring(start, stop); - } - return input.substring(input.length - stop, input.length - start); -}; -exports.substring = substring; - - -/***/ }), - -/***/ 28758: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.uriEncode = void 0; -const uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`); -exports.uriEncode = uriEncode; - - -/***/ }), - -/***/ 77555: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.resolveEndpoint = void 0; -const debug_1 = __nccwpck_require__(4140); -const types_1 = __nccwpck_require__(64175); -const utils_1 = __nccwpck_require__(76959); -const resolveEndpoint = (ruleSetObject, options) => { - var _a, _b, _c, _d, _e, _f; - const { endpointParams, logger } = options; - const { parameters, rules } = ruleSetObject; - (_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, `${debug_1.debugId} Initial EndpointParams: ${(0, debug_1.toDebugString)(endpointParams)}`); - const paramsWithDefault = Object.entries(parameters) - .filter(([, v]) => v.default != null) - .map(([k, v]) => [k, v.default]); - if (paramsWithDefault.length > 0) { - for (const [paramKey, paramDefaultValue] of paramsWithDefault) { - endpointParams[paramKey] = (_c = endpointParams[paramKey]) !== null && _c !== void 0 ? _c : paramDefaultValue; - } - } - const requiredParams = Object.entries(parameters) - .filter(([, v]) => v.required) - .map(([k]) => k); - for (const requiredParam of requiredParams) { - if (endpointParams[requiredParam] == null) { - throw new types_1.EndpointError(`Missing required parameter: '${requiredParam}'`); - } - } - const endpoint = (0, utils_1.evaluateRules)(rules, { endpointParams, logger, referenceRecord: {} }); - if ((_d = options.endpointParams) === null || _d === void 0 ? void 0 : _d.Endpoint) { - try { - const givenEndpoint = new URL(options.endpointParams.Endpoint); - const { protocol, port } = givenEndpoint; - endpoint.url.protocol = protocol; - endpoint.url.port = port; - } - catch (e) { - } - } - (_f = (_e = options.logger) === null || _e === void 0 ? void 0 : _e.debug) === null || _f === void 0 ? void 0 : _f.call(_e, `${debug_1.debugId} Resolved endpoint: ${(0, debug_1.toDebugString)(endpoint)}`); - return endpoint; -}; -exports.resolveEndpoint = resolveEndpoint; - - -/***/ }), - -/***/ 68232: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EndpointError = void 0; -class EndpointError extends Error { - constructor(message) { - super(message); - this.name = "EndpointError"; - } -} -exports.EndpointError = EndpointError; - - -/***/ }), - -/***/ 22147: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 109: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 94743: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 40001: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 89764: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 64175: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(9286); -tslib_1.__exportStar(__nccwpck_require__(68232), exports); -tslib_1.__exportStar(__nccwpck_require__(22147), exports); -tslib_1.__exportStar(__nccwpck_require__(109), exports); -tslib_1.__exportStar(__nccwpck_require__(94743), exports); -tslib_1.__exportStar(__nccwpck_require__(40001), exports); -tslib_1.__exportStar(__nccwpck_require__(89764), exports); -tslib_1.__exportStar(__nccwpck_require__(71521), exports); - - -/***/ }), - -/***/ 71521: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 85091: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.callFunction = void 0; -const customEndpointFunctions_1 = __nccwpck_require__(59612); -const endpointFunctions_1 = __nccwpck_require__(16515); -const evaluateExpression_1 = __nccwpck_require__(22023); -const callFunction = ({ fn, argv }, options) => { - const evaluatedArgs = argv.map((arg) => ["boolean", "number"].includes(typeof arg) ? arg : (0, evaluateExpression_1.evaluateExpression)(arg, "arg", options)); - const fnSegments = fn.split("."); - if (fnSegments[0] in customEndpointFunctions_1.customEndpointFunctions && fnSegments[1] != null) { - return customEndpointFunctions_1.customEndpointFunctions[fnSegments[0]][fnSegments[1]](...evaluatedArgs); - } - return endpointFunctions_1.endpointFunctions[fn](...evaluatedArgs); -}; -exports.callFunction = callFunction; - - -/***/ }), - -/***/ 59612: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.customEndpointFunctions = void 0; -exports.customEndpointFunctions = {}; - - -/***/ }), - -/***/ 16515: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.endpointFunctions = void 0; -const lib_1 = __nccwpck_require__(8649); -exports.endpointFunctions = { - booleanEquals: lib_1.booleanEquals, - getAttr: lib_1.getAttr, - isSet: lib_1.isSet, - isValidHostLabel: lib_1.isValidHostLabel, - not: lib_1.not, - parseURL: lib_1.parseURL, - stringEquals: lib_1.stringEquals, - substring: lib_1.substring, - uriEncode: lib_1.uriEncode, -}; - - -/***/ }), - -/***/ 8742: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.evaluateCondition = void 0; -const debug_1 = __nccwpck_require__(4140); -const types_1 = __nccwpck_require__(64175); -const callFunction_1 = __nccwpck_require__(85091); -const evaluateCondition = ({ assign, ...fnArgs }, options) => { - var _a, _b; - if (assign && assign in options.referenceRecord) { - throw new types_1.EndpointError(`'${assign}' is already defined in Reference Record.`); - } - const value = (0, callFunction_1.callFunction)(fnArgs, options); - (_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, debug_1.debugId, `evaluateCondition: ${(0, debug_1.toDebugString)(fnArgs)} = ${(0, debug_1.toDebugString)(value)}`); - return { - result: value === "" ? true : !!value, - ...(assign != null && { toAssign: { name: assign, value } }), - }; -}; -exports.evaluateCondition = evaluateCondition; - - -/***/ }), - -/***/ 70232: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.evaluateConditions = void 0; -const debug_1 = __nccwpck_require__(4140); -const evaluateCondition_1 = __nccwpck_require__(8742); -const evaluateConditions = (conditions = [], options) => { - var _a, _b; - const conditionsReferenceRecord = {}; - for (const condition of conditions) { - const { result, toAssign } = (0, evaluateCondition_1.evaluateCondition)(condition, { - ...options, - referenceRecord: { - ...options.referenceRecord, - ...conditionsReferenceRecord, - }, - }); - if (!result) { - return { result }; - } - if (toAssign) { - conditionsReferenceRecord[toAssign.name] = toAssign.value; - (_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, debug_1.debugId, `assign: ${toAssign.name} := ${(0, debug_1.toDebugString)(toAssign.value)}`); - } - } - return { result: true, referenceRecord: conditionsReferenceRecord }; -}; -exports.evaluateConditions = evaluateConditions; - - -/***/ }), - -/***/ 86349: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.evaluateEndpointRule = void 0; -const debug_1 = __nccwpck_require__(4140); -const evaluateConditions_1 = __nccwpck_require__(70232); -const getEndpointHeaders_1 = __nccwpck_require__(83362); -const getEndpointProperties_1 = __nccwpck_require__(46801); -const getEndpointUrl_1 = __nccwpck_require__(41658); -const evaluateEndpointRule = (endpointRule, options) => { - var _a, _b; - const { conditions, endpoint } = endpointRule; - const { result, referenceRecord } = (0, evaluateConditions_1.evaluateConditions)(conditions, options); - if (!result) { - return; - } - const endpointRuleOptions = { - ...options, - referenceRecord: { ...options.referenceRecord, ...referenceRecord }, - }; - const { url, properties, headers } = endpoint; - (_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, debug_1.debugId, `Resolving endpoint from template: ${(0, debug_1.toDebugString)(endpoint)}`); - return { - ...(headers != undefined && { - headers: (0, getEndpointHeaders_1.getEndpointHeaders)(headers, endpointRuleOptions), - }), - ...(properties != undefined && { - properties: (0, getEndpointProperties_1.getEndpointProperties)(properties, endpointRuleOptions), - }), - url: (0, getEndpointUrl_1.getEndpointUrl)(url, endpointRuleOptions), - }; -}; -exports.evaluateEndpointRule = evaluateEndpointRule; - - -/***/ }), - -/***/ 86221: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.evaluateErrorRule = void 0; -const types_1 = __nccwpck_require__(64175); -const evaluateConditions_1 = __nccwpck_require__(70232); -const evaluateExpression_1 = __nccwpck_require__(22023); -const evaluateErrorRule = (errorRule, options) => { - const { conditions, error } = errorRule; - const { result, referenceRecord } = (0, evaluateConditions_1.evaluateConditions)(conditions, options); - if (!result) { - return; - } - throw new types_1.EndpointError((0, evaluateExpression_1.evaluateExpression)(error, "Error", { - ...options, - referenceRecord: { ...options.referenceRecord, ...referenceRecord }, - })); -}; -exports.evaluateErrorRule = evaluateErrorRule; - - -/***/ }), - -/***/ 22023: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.evaluateExpression = void 0; -const types_1 = __nccwpck_require__(64175); -const callFunction_1 = __nccwpck_require__(85091); -const evaluateTemplate_1 = __nccwpck_require__(35724); -const getReferenceValue_1 = __nccwpck_require__(78048); -const evaluateExpression = (obj, keyName, options) => { - if (typeof obj === "string") { - return (0, evaluateTemplate_1.evaluateTemplate)(obj, options); - } - else if (obj["fn"]) { - return (0, callFunction_1.callFunction)(obj, options); - } - else if (obj["ref"]) { - return (0, getReferenceValue_1.getReferenceValue)(obj, options); - } - throw new types_1.EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`); -}; -exports.evaluateExpression = evaluateExpression; - - -/***/ }), - -/***/ 31841: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.evaluateRules = void 0; -const types_1 = __nccwpck_require__(64175); -const evaluateEndpointRule_1 = __nccwpck_require__(86349); -const evaluateErrorRule_1 = __nccwpck_require__(86221); -const evaluateTreeRule_1 = __nccwpck_require__(50104); -const evaluateRules = (rules, options) => { - for (const rule of rules) { - if (rule.type === "endpoint") { - const endpointOrUndefined = (0, evaluateEndpointRule_1.evaluateEndpointRule)(rule, options); - if (endpointOrUndefined) { - return endpointOrUndefined; - } - } - else if (rule.type === "error") { - (0, evaluateErrorRule_1.evaluateErrorRule)(rule, options); - } - else if (rule.type === "tree") { - const endpointOrUndefined = (0, evaluateTreeRule_1.evaluateTreeRule)(rule, options); - if (endpointOrUndefined) { - return endpointOrUndefined; - } - } - else { - throw new types_1.EndpointError(`Unknown endpoint rule: ${rule}`); - } - } - throw new types_1.EndpointError(`Rules evaluation failed`); -}; -exports.evaluateRules = evaluateRules; - - -/***/ }), - -/***/ 35724: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.evaluateTemplate = void 0; -const lib_1 = __nccwpck_require__(8649); -const evaluateTemplate = (template, options) => { - const evaluatedTemplateArr = []; - const templateContext = { - ...options.endpointParams, - ...options.referenceRecord, - }; - let currentIndex = 0; - while (currentIndex < template.length) { - const openingBraceIndex = template.indexOf("{", currentIndex); - if (openingBraceIndex === -1) { - evaluatedTemplateArr.push(template.slice(currentIndex)); - break; - } - evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex)); - const closingBraceIndex = template.indexOf("}", openingBraceIndex); - if (closingBraceIndex === -1) { - evaluatedTemplateArr.push(template.slice(openingBraceIndex)); - break; - } - if (template[openingBraceIndex + 1] === "{" && template[closingBraceIndex + 1] === "}") { - evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex)); - currentIndex = closingBraceIndex + 2; - } - const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex); - if (parameterName.includes("#")) { - const [refName, attrName] = parameterName.split("#"); - evaluatedTemplateArr.push((0, lib_1.getAttr)(templateContext[refName], attrName)); - } - else { - evaluatedTemplateArr.push(templateContext[parameterName]); - } - currentIndex = closingBraceIndex + 1; - } - return evaluatedTemplateArr.join(""); -}; -exports.evaluateTemplate = evaluateTemplate; - - -/***/ }), - -/***/ 50104: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.evaluateTreeRule = void 0; -const evaluateConditions_1 = __nccwpck_require__(70232); -const evaluateRules_1 = __nccwpck_require__(31841); -const evaluateTreeRule = (treeRule, options) => { - const { conditions, rules } = treeRule; - const { result, referenceRecord } = (0, evaluateConditions_1.evaluateConditions)(conditions, options); - if (!result) { - return; - } - return (0, evaluateRules_1.evaluateRules)(rules, { - ...options, - referenceRecord: { ...options.referenceRecord, ...referenceRecord }, - }); -}; -exports.evaluateTreeRule = evaluateTreeRule; - - -/***/ }), - -/***/ 83362: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEndpointHeaders = void 0; -const types_1 = __nccwpck_require__(64175); -const evaluateExpression_1 = __nccwpck_require__(22023); -const getEndpointHeaders = (headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({ - ...acc, - [headerKey]: headerVal.map((headerValEntry) => { - const processedExpr = (0, evaluateExpression_1.evaluateExpression)(headerValEntry, "Header value entry", options); - if (typeof processedExpr !== "string") { - throw new types_1.EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`); - } - return processedExpr; - }), -}), {}); -exports.getEndpointHeaders = getEndpointHeaders; - - -/***/ }), - -/***/ 46801: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEndpointProperties = void 0; -const getEndpointProperty_1 = __nccwpck_require__(74270); -const getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({ - ...acc, - [propertyKey]: (0, getEndpointProperty_1.getEndpointProperty)(propertyVal, options), -}), {}); -exports.getEndpointProperties = getEndpointProperties; - - -/***/ }), - -/***/ 74270: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEndpointProperty = void 0; -const types_1 = __nccwpck_require__(64175); -const evaluateTemplate_1 = __nccwpck_require__(35724); -const getEndpointProperties_1 = __nccwpck_require__(46801); -const getEndpointProperty = (property, options) => { - if (Array.isArray(property)) { - return property.map((propertyEntry) => (0, exports.getEndpointProperty)(propertyEntry, options)); - } - switch (typeof property) { - case "string": - return (0, evaluateTemplate_1.evaluateTemplate)(property, options); - case "object": - if (property === null) { - throw new types_1.EndpointError(`Unexpected endpoint property: ${property}`); - } - return (0, getEndpointProperties_1.getEndpointProperties)(property, options); - case "boolean": - return property; - default: - throw new types_1.EndpointError(`Unexpected endpoint property type: ${typeof property}`); - } -}; -exports.getEndpointProperty = getEndpointProperty; - - -/***/ }), - -/***/ 41658: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEndpointUrl = void 0; -const types_1 = __nccwpck_require__(64175); -const evaluateExpression_1 = __nccwpck_require__(22023); -const getEndpointUrl = (endpointUrl, options) => { - const expression = (0, evaluateExpression_1.evaluateExpression)(endpointUrl, "Endpoint URL", options); - if (typeof expression === "string") { - try { - return new URL(expression); - } - catch (error) { - console.error(`Failed to construct URL with ${expression}`, error); - throw error; - } - } - throw new types_1.EndpointError(`Endpoint URL must be a string, got ${typeof expression}`); -}; -exports.getEndpointUrl = getEndpointUrl; - - -/***/ }), - -/***/ 78048: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getReferenceValue = void 0; -const getReferenceValue = ({ ref }, options) => { - const referenceRecord = { - ...options.endpointParams, - ...options.referenceRecord, - }; - return referenceRecord[ref]; -}; -exports.getReferenceValue = getReferenceValue; - - -/***/ }), - -/***/ 76959: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(9286); -tslib_1.__exportStar(__nccwpck_require__(59612), exports); -tslib_1.__exportStar(__nccwpck_require__(31841), exports); - - -/***/ }), - -/***/ 9286: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 61027: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toHex = exports.fromHex = void 0; -const SHORT_TO_HEX = {}; -const HEX_TO_SHORT = {}; -for (let i = 0; i < 256; i++) { - let encodedByte = i.toString(16).toLowerCase(); - if (encodedByte.length === 1) { - encodedByte = `0${encodedByte}`; - } - SHORT_TO_HEX[i] = encodedByte; - HEX_TO_SHORT[encodedByte] = i; -} -function fromHex(encoded) { - if (encoded.length % 2 !== 0) { - throw new Error("Hex encoded strings must have an even number length"); - } - const out = new Uint8Array(encoded.length / 2); - for (let i = 0; i < encoded.length; i += 2) { - const encodedByte = encoded.slice(i, i + 2).toLowerCase(); - if (encodedByte in HEX_TO_SHORT) { - out[i / 2] = HEX_TO_SHORT[encodedByte]; - } - else { - throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`); - } - } - return out; -} -exports.fromHex = fromHex; -function toHex(bytes) { - let out = ""; - for (let i = 0; i < bytes.byteLength; i++) { - out += SHORT_TO_HEX[bytes[i]]; - } - return out; -} -exports.toHex = toHex; - - -/***/ }), - -/***/ 82346: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSmithyContext = void 0; -const types_1 = __nccwpck_require__(75751); -const getSmithyContext = (context) => context[types_1.SMITHY_CONTEXT_KEY] || (context[types_1.SMITHY_CONTEXT_KEY] = {}); -exports.getSmithyContext = getSmithyContext; - - -/***/ }), - -/***/ 81243: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(77191); -tslib_1.__exportStar(__nccwpck_require__(82346), exports); -tslib_1.__exportStar(__nccwpck_require__(26851), exports); - - -/***/ }), - -/***/ 26851: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.normalizeProvider = void 0; -const normalizeProvider = (input) => { - if (typeof input === "function") - return input; - const promisified = Promise.resolve(input); - return () => promisified; -}; -exports.normalizeProvider = normalizeProvider; - - -/***/ }), - -/***/ 77191: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 37099: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AdaptiveRetryStrategy = void 0; -const config_1 = __nccwpck_require__(33047); -const DefaultRateLimiter_1 = __nccwpck_require__(71116); -const StandardRetryStrategy_1 = __nccwpck_require__(33965); -class AdaptiveRetryStrategy { - constructor(maxAttemptsProvider, options) { - this.maxAttemptsProvider = maxAttemptsProvider; - this.mode = config_1.RETRY_MODES.ADAPTIVE; - const { rateLimiter } = options !== null && options !== void 0 ? options : {}; - this.rateLimiter = rateLimiter !== null && rateLimiter !== void 0 ? rateLimiter : new DefaultRateLimiter_1.DefaultRateLimiter(); - this.standardRetryStrategy = new StandardRetryStrategy_1.StandardRetryStrategy(maxAttemptsProvider); - } - async acquireInitialRetryToken(retryTokenScope) { - await this.rateLimiter.getSendToken(); - return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); - } - async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { - this.rateLimiter.updateClientSendingRate(errorInfo); - return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); - } - recordSuccess(token) { - this.rateLimiter.updateClientSendingRate({}); - this.standardRetryStrategy.recordSuccess(token); - } -} -exports.AdaptiveRetryStrategy = AdaptiveRetryStrategy; - - -/***/ }), - -/***/ 2735: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ConfiguredRetryStrategy = void 0; -const constants_1 = __nccwpck_require__(99358); -const StandardRetryStrategy_1 = __nccwpck_require__(33965); -class ConfiguredRetryStrategy extends StandardRetryStrategy_1.StandardRetryStrategy { - constructor(maxAttempts, computeNextBackoffDelay = constants_1.DEFAULT_RETRY_DELAY_BASE) { - super(typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts); - if (typeof computeNextBackoffDelay === "number") { - this.computeNextBackoffDelay = () => computeNextBackoffDelay; - } - else { - this.computeNextBackoffDelay = computeNextBackoffDelay; - } - } - async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { - const token = await super.refreshRetryTokenForRetry(tokenToRenew, errorInfo); - token.getRetryDelay = () => this.computeNextBackoffDelay(token.getRetryCount()); - return token; - } -} -exports.ConfiguredRetryStrategy = ConfiguredRetryStrategy; - - -/***/ }), - -/***/ 71116: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DefaultRateLimiter = void 0; -const service_error_classification_1 = __nccwpck_require__(48920); -class DefaultRateLimiter { - constructor(options) { - var _a, _b, _c, _d, _e; - this.currentCapacity = 0; - this.enabled = false; - this.lastMaxRate = 0; - this.measuredTxRate = 0; - this.requestCount = 0; - this.lastTimestamp = 0; - this.timeWindow = 0; - this.beta = (_a = options === null || options === void 0 ? void 0 : options.beta) !== null && _a !== void 0 ? _a : 0.7; - this.minCapacity = (_b = options === null || options === void 0 ? void 0 : options.minCapacity) !== null && _b !== void 0 ? _b : 1; - this.minFillRate = (_c = options === null || options === void 0 ? void 0 : options.minFillRate) !== null && _c !== void 0 ? _c : 0.5; - this.scaleConstant = (_d = options === null || options === void 0 ? void 0 : options.scaleConstant) !== null && _d !== void 0 ? _d : 0.4; - this.smooth = (_e = options === null || options === void 0 ? void 0 : options.smooth) !== null && _e !== void 0 ? _e : 0.8; - const currentTimeInSeconds = this.getCurrentTimeInSeconds(); - this.lastThrottleTime = currentTimeInSeconds; - this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds()); - this.fillRate = this.minFillRate; - this.maxCapacity = this.minCapacity; - } - getCurrentTimeInSeconds() { - return Date.now() / 1000; - } - async getSendToken() { - return this.acquireTokenBucket(1); - } - async acquireTokenBucket(amount) { - if (!this.enabled) { - return; - } - this.refillTokenBucket(); - if (amount > this.currentCapacity) { - const delay = ((amount - this.currentCapacity) / this.fillRate) * 1000; - await new Promise((resolve) => setTimeout(resolve, delay)); - } - this.currentCapacity = this.currentCapacity - amount; - } - refillTokenBucket() { - const timestamp = this.getCurrentTimeInSeconds(); - if (!this.lastTimestamp) { - this.lastTimestamp = timestamp; - return; - } - const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate; - this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount); - this.lastTimestamp = timestamp; - } - updateClientSendingRate(response) { - let calculatedRate; - this.updateMeasuredRate(); - if ((0, service_error_classification_1.isThrottlingError)(response)) { - const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate); - this.lastMaxRate = rateToUse; - this.calculateTimeWindow(); - this.lastThrottleTime = this.getCurrentTimeInSeconds(); - calculatedRate = this.cubicThrottle(rateToUse); - this.enableTokenBucket(); - } - else { - this.calculateTimeWindow(); - calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds()); - } - const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate); - this.updateTokenBucketRate(newRate); - } - calculateTimeWindow() { - this.timeWindow = this.getPrecise(Math.pow((this.lastMaxRate * (1 - this.beta)) / this.scaleConstant, 1 / 3)); - } - cubicThrottle(rateToUse) { - return this.getPrecise(rateToUse * this.beta); - } - cubicSuccess(timestamp) { - return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate); - } - enableTokenBucket() { - this.enabled = true; - } - updateTokenBucketRate(newRate) { - this.refillTokenBucket(); - this.fillRate = Math.max(newRate, this.minFillRate); - this.maxCapacity = Math.max(newRate, this.minCapacity); - this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity); - } - updateMeasuredRate() { - const t = this.getCurrentTimeInSeconds(); - const timeBucket = Math.floor(t * 2) / 2; - this.requestCount++; - if (timeBucket > this.lastTxRateBucket) { - const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket); - this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth)); - this.requestCount = 0; - this.lastTxRateBucket = timeBucket; - } - } - getPrecise(num) { - return parseFloat(num.toFixed(8)); - } -} -exports.DefaultRateLimiter = DefaultRateLimiter; - - -/***/ }), - -/***/ 33965: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.StandardRetryStrategy = void 0; -const config_1 = __nccwpck_require__(33047); -const constants_1 = __nccwpck_require__(99358); -const defaultRetryBackoffStrategy_1 = __nccwpck_require__(8825); -const defaultRetryToken_1 = __nccwpck_require__(47819); -class StandardRetryStrategy { - constructor(maxAttempts) { - this.maxAttempts = maxAttempts; - this.mode = config_1.RETRY_MODES.STANDARD; - this.capacity = constants_1.INITIAL_RETRY_TOKENS; - this.retryBackoffStrategy = (0, defaultRetryBackoffStrategy_1.getDefaultRetryBackoffStrategy)(); - this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts; - } - async acquireInitialRetryToken(retryTokenScope) { - return (0, defaultRetryToken_1.createDefaultRetryToken)({ - retryDelay: constants_1.DEFAULT_RETRY_DELAY_BASE, - retryCount: 0, - }); - } - async refreshRetryTokenForRetry(token, errorInfo) { - const maxAttempts = await this.getMaxAttempts(); - if (this.shouldRetry(token, errorInfo, maxAttempts)) { - const errorType = errorInfo.errorType; - this.retryBackoffStrategy.setDelayBase(errorType === "THROTTLING" ? constants_1.THROTTLING_RETRY_DELAY_BASE : constants_1.DEFAULT_RETRY_DELAY_BASE); - const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount()); - const retryDelay = errorInfo.retryAfterHint - ? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType) - : delayFromErrorType; - const capacityCost = this.getCapacityCost(errorType); - this.capacity -= capacityCost; - return (0, defaultRetryToken_1.createDefaultRetryToken)({ - retryDelay, - retryCount: token.getRetryCount() + 1, - retryCost: capacityCost, - }); - } - throw new Error("No retry token available"); - } - recordSuccess(token) { - var _a; - this.capacity = Math.max(constants_1.INITIAL_RETRY_TOKENS, this.capacity + ((_a = token.getRetryCost()) !== null && _a !== void 0 ? _a : constants_1.NO_RETRY_INCREMENT)); - } - getCapacity() { - return this.capacity; - } - async getMaxAttempts() { - try { - return await this.maxAttemptsProvider(); - } - catch (error) { - console.warn(`Max attempts provider could not resolve. Using default of ${config_1.DEFAULT_MAX_ATTEMPTS}`); - return config_1.DEFAULT_MAX_ATTEMPTS; - } - } - shouldRetry(tokenToRenew, errorInfo, maxAttempts) { - const attempts = tokenToRenew.getRetryCount() + 1; - return (attempts < maxAttempts && - this.capacity >= this.getCapacityCost(errorInfo.errorType) && - this.isRetryableError(errorInfo.errorType)); - } - getCapacityCost(errorType) { - return errorType === "TRANSIENT" ? constants_1.TIMEOUT_RETRY_COST : constants_1.RETRY_COST; - } - isRetryableError(errorType) { - return errorType === "THROTTLING" || errorType === "TRANSIENT"; - } -} -exports.StandardRetryStrategy = StandardRetryStrategy; - - -/***/ }), - -/***/ 33047: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DEFAULT_RETRY_MODE = exports.DEFAULT_MAX_ATTEMPTS = exports.RETRY_MODES = void 0; -var RETRY_MODES; -(function (RETRY_MODES) { - RETRY_MODES["STANDARD"] = "standard"; - RETRY_MODES["ADAPTIVE"] = "adaptive"; -})(RETRY_MODES = exports.RETRY_MODES || (exports.RETRY_MODES = {})); -exports.DEFAULT_MAX_ATTEMPTS = 3; -exports.DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD; - - -/***/ }), - -/***/ 99358: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.REQUEST_HEADER = exports.INVOCATION_ID_HEADER = exports.NO_RETRY_INCREMENT = exports.TIMEOUT_RETRY_COST = exports.RETRY_COST = exports.INITIAL_RETRY_TOKENS = exports.THROTTLING_RETRY_DELAY_BASE = exports.MAXIMUM_RETRY_DELAY = exports.DEFAULT_RETRY_DELAY_BASE = void 0; -exports.DEFAULT_RETRY_DELAY_BASE = 100; -exports.MAXIMUM_RETRY_DELAY = 20 * 1000; -exports.THROTTLING_RETRY_DELAY_BASE = 500; -exports.INITIAL_RETRY_TOKENS = 500; -exports.RETRY_COST = 5; -exports.TIMEOUT_RETRY_COST = 10; -exports.NO_RETRY_INCREMENT = 1; -exports.INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; -exports.REQUEST_HEADER = "amz-sdk-request"; - - -/***/ }), - -/***/ 8825: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getDefaultRetryBackoffStrategy = void 0; -const constants_1 = __nccwpck_require__(99358); -const getDefaultRetryBackoffStrategy = () => { - let delayBase = constants_1.DEFAULT_RETRY_DELAY_BASE; - const computeNextBackoffDelay = (attempts) => { - return Math.floor(Math.min(constants_1.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); - }; - const setDelayBase = (delay) => { - delayBase = delay; - }; - return { - computeNextBackoffDelay, - setDelayBase, - }; -}; -exports.getDefaultRetryBackoffStrategy = getDefaultRetryBackoffStrategy; - - -/***/ }), - -/***/ 47819: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createDefaultRetryToken = void 0; -const constants_1 = __nccwpck_require__(99358); -const createDefaultRetryToken = ({ retryDelay, retryCount, retryCost, }) => { - const getRetryCount = () => retryCount; - const getRetryDelay = () => Math.min(constants_1.MAXIMUM_RETRY_DELAY, retryDelay); - const getRetryCost = () => retryCost; - return { - getRetryCount, - getRetryDelay, - getRetryCost, - }; -}; -exports.createDefaultRetryToken = createDefaultRetryToken; - - -/***/ }), - -/***/ 13744: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(35061); -tslib_1.__exportStar(__nccwpck_require__(37099), exports); -tslib_1.__exportStar(__nccwpck_require__(2735), exports); -tslib_1.__exportStar(__nccwpck_require__(71116), exports); -tslib_1.__exportStar(__nccwpck_require__(33965), exports); -tslib_1.__exportStar(__nccwpck_require__(33047), exports); -tslib_1.__exportStar(__nccwpck_require__(99358), exports); -tslib_1.__exportStar(__nccwpck_require__(17474), exports); - - -/***/ }), - -/***/ 17474: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 35061: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 99906: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Uint8ArrayBlobAdapter = void 0; -const transforms_1 = __nccwpck_require__(82724); -class Uint8ArrayBlobAdapter extends Uint8Array { - static fromString(source, encoding = "utf-8") { - switch (typeof source) { - case "string": - return (0, transforms_1.transformFromString)(source, encoding); - default: - throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`); - } - } - static mutate(source) { - Object.setPrototypeOf(source, Uint8ArrayBlobAdapter.prototype); - return source; - } - transformToString(encoding = "utf-8") { - return (0, transforms_1.transformToString)(this, encoding); - } -} -exports.Uint8ArrayBlobAdapter = Uint8ArrayBlobAdapter; - - -/***/ }), - -/***/ 82724: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.transformFromString = exports.transformToString = void 0; -const util_base64_1 = __nccwpck_require__(14478); -const util_utf8_1 = __nccwpck_require__(38134); -const Uint8ArrayBlobAdapter_1 = __nccwpck_require__(99906); -function transformToString(payload, encoding = "utf-8") { - if (encoding === "base64") { - return (0, util_base64_1.toBase64)(payload); - } - return (0, util_utf8_1.toUtf8)(payload); -} -exports.transformToString = transformToString; -function transformFromString(str, encoding) { - if (encoding === "base64") { - return Uint8ArrayBlobAdapter_1.Uint8ArrayBlobAdapter.mutate((0, util_base64_1.fromBase64)(str)); - } - return Uint8ArrayBlobAdapter_1.Uint8ArrayBlobAdapter.mutate((0, util_utf8_1.fromUtf8)(str)); -} -exports.transformFromString = transformFromString; - - -/***/ }), - -/***/ 55441: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getAwsChunkedEncodingStream = void 0; -const stream_1 = __nccwpck_require__(12781); -const getAwsChunkedEncodingStream = (readableStream, options) => { - const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options; - const checksumRequired = base64Encoder !== undefined && - checksumAlgorithmFn !== undefined && - checksumLocationName !== undefined && - streamHasher !== undefined; - const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : undefined; - const awsChunkedEncodingStream = new stream_1.Readable({ read: () => { } }); - readableStream.on("data", (data) => { - const length = bodyLengthChecker(data) || 0; - awsChunkedEncodingStream.push(`${length.toString(16)}\r\n`); - awsChunkedEncodingStream.push(data); - awsChunkedEncodingStream.push("\r\n"); - }); - readableStream.on("end", async () => { - awsChunkedEncodingStream.push(`0\r\n`); - if (checksumRequired) { - const checksum = base64Encoder(await digest); - awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r\n`); - awsChunkedEncodingStream.push(`\r\n`); - } - awsChunkedEncodingStream.push(null); - }); - return awsChunkedEncodingStream; -}; -exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream; - - -/***/ }), - -/***/ 55844: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(34974); -tslib_1.__exportStar(__nccwpck_require__(99906), exports); -tslib_1.__exportStar(__nccwpck_require__(55441), exports); -tslib_1.__exportStar(__nccwpck_require__(95063), exports); - - -/***/ }), - -/***/ 95063: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.sdkStreamMixin = void 0; -const node_http_handler_1 = __nccwpck_require__(54065); -const util_buffer_from_1 = __nccwpck_require__(41308); -const stream_1 = __nccwpck_require__(12781); -const util_1 = __nccwpck_require__(73837); -const ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; -const sdkStreamMixin = (stream) => { - var _a, _b; - if (!(stream instanceof stream_1.Readable)) { - const name = ((_b = (_a = stream === null || stream === void 0 ? void 0 : stream.__proto__) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name) || stream; - throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`); - } - let transformed = false; - const transformToByteArray = async () => { - if (transformed) { - throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); - } - transformed = true; - return await (0, node_http_handler_1.streamCollector)(stream); - }; - return Object.assign(stream, { - transformToByteArray, - transformToString: async (encoding) => { - const buf = await transformToByteArray(); - if (encoding === undefined || Buffer.isEncoding(encoding)) { - return (0, util_buffer_from_1.fromArrayBuffer)(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding); - } - else { - const decoder = new util_1.TextDecoder(encoding); - return decoder.decode(buf); - } - }, - transformToWebStream: () => { - if (transformed) { - throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); - } - if (stream.readableFlowing !== null) { - throw new Error("The stream has been consumed by other callbacks."); - } - if (typeof stream_1.Readable.toWeb !== "function") { - throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available."); - } - transformed = true; - return stream_1.Readable.toWeb(stream); - }, - }); -}; -exports.sdkStreamMixin = sdkStreamMixin; - - -/***/ }), - -/***/ 34974: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 25989: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeUriPath = void 0; -const escape_uri_1 = __nccwpck_require__(57916); -const escapeUriPath = (uri) => uri.split("/").map(escape_uri_1.escapeUri).join("/"); -exports.escapeUriPath = escapeUriPath; - - -/***/ }), - -/***/ 57916: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeUri = void 0; -const escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode); -exports.escapeUri = escapeUri; -const hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`; - - -/***/ }), - -/***/ 28768: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(238); -tslib_1.__exportStar(__nccwpck_require__(57916), exports); -tslib_1.__exportStar(__nccwpck_require__(25989), exports); - - -/***/ }), - -/***/ 238: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 54627: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fromUtf8 = void 0; -const util_buffer_from_1 = __nccwpck_require__(41308); -const fromUtf8 = (input) => { - const buf = (0, util_buffer_from_1.fromString)(input, "utf8"); - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT); -}; -exports.fromUtf8 = fromUtf8; - - -/***/ }), - -/***/ 38134: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(20250); -tslib_1.__exportStar(__nccwpck_require__(54627), exports); -tslib_1.__exportStar(__nccwpck_require__(86621), exports); -tslib_1.__exportStar(__nccwpck_require__(80751), exports); - - -/***/ }), - -/***/ 86621: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toUint8Array = void 0; -const fromUtf8_1 = __nccwpck_require__(54627); -const toUint8Array = (data) => { - if (typeof data === "string") { - return (0, fromUtf8_1.fromUtf8)(data); - } - if (ArrayBuffer.isView(data)) { - return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); - } - return new Uint8Array(data); -}; -exports.toUint8Array = toUint8Array; - - -/***/ }), - -/***/ 80751: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toUtf8 = void 0; -const util_buffer_from_1 = __nccwpck_require__(41308); -const toUtf8 = (input) => (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("utf8"); -exports.toUtf8 = toUtf8; - - -/***/ }), - -/***/ 20250: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 58132: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createWaiter = void 0; -const poller_1 = __nccwpck_require__(60245); -const utils_1 = __nccwpck_require__(47955); -const waiter_1 = __nccwpck_require__(9020); -const abortTimeout = async (abortSignal) => { - return new Promise((resolve) => { - abortSignal.onabort = () => resolve({ state: waiter_1.WaiterState.ABORTED }); - }); -}; -const createWaiter = async (options, input, acceptorChecks) => { - const params = { - ...waiter_1.waiterServiceDefaults, - ...options, - }; - (0, utils_1.validateWaiterOptions)(params); - const exitConditions = [(0, poller_1.runPolling)(params, input, acceptorChecks)]; - if (options.abortController) { - exitConditions.push(abortTimeout(options.abortController.signal)); - } - if (options.abortSignal) { - exitConditions.push(abortTimeout(options.abortSignal)); - } - return Promise.race(exitConditions); -}; -exports.createWaiter = createWaiter; - - -/***/ }), - -/***/ 32406: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(8406); -tslib_1.__exportStar(__nccwpck_require__(58132), exports); -tslib_1.__exportStar(__nccwpck_require__(9020), exports); - - -/***/ }), - -/***/ 60245: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.runPolling = void 0; -const sleep_1 = __nccwpck_require__(55142); -const waiter_1 = __nccwpck_require__(9020); -const exponentialBackoffWithJitter = (minDelay, maxDelay, attemptCeiling, attempt) => { - if (attempt > attemptCeiling) - return maxDelay; - const delay = minDelay * 2 ** (attempt - 1); - return randomInRange(minDelay, delay); -}; -const randomInRange = (min, max) => min + Math.random() * (max - min); -const runPolling = async ({ minDelay, maxDelay, maxWaitTime, abortController, client, abortSignal }, input, acceptorChecks) => { - var _a; - const { state, reason } = await acceptorChecks(client, input); - if (state !== waiter_1.WaiterState.RETRY) { - return { state, reason }; - } - let currentAttempt = 1; - const waitUntil = Date.now() + maxWaitTime * 1000; - const attemptCeiling = Math.log(maxDelay / minDelay) / Math.log(2) + 1; - while (true) { - if (((_a = abortController === null || abortController === void 0 ? void 0 : abortController.signal) === null || _a === void 0 ? void 0 : _a.aborted) || (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted)) { - return { state: waiter_1.WaiterState.ABORTED }; - } - const delay = exponentialBackoffWithJitter(minDelay, maxDelay, attemptCeiling, currentAttempt); - if (Date.now() + delay * 1000 > waitUntil) { - return { state: waiter_1.WaiterState.TIMEOUT }; - } - await (0, sleep_1.sleep)(delay); - const { state, reason } = await acceptorChecks(client, input); - if (state !== waiter_1.WaiterState.RETRY) { - return { state, reason }; - } - currentAttempt += 1; - } -}; -exports.runPolling = runPolling; - - -/***/ }), - -/***/ 47955: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const tslib_1 = __nccwpck_require__(8406); -tslib_1.__exportStar(__nccwpck_require__(55142), exports); -tslib_1.__exportStar(__nccwpck_require__(56640), exports); - - -/***/ }), - -/***/ 55142: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.sleep = void 0; -const sleep = (seconds) => { - return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); -}; -exports.sleep = sleep; - - -/***/ }), - -/***/ 56640: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.validateWaiterOptions = void 0; -const validateWaiterOptions = (options) => { - if (options.maxWaitTime < 1) { - throw new Error(`WaiterConfiguration.maxWaitTime must be greater than 0`); - } - else if (options.minDelay < 1) { - throw new Error(`WaiterConfiguration.minDelay must be greater than 0`); - } - else if (options.maxDelay < 1) { - throw new Error(`WaiterConfiguration.maxDelay must be greater than 0`); - } - else if (options.maxWaitTime <= options.minDelay) { - throw new Error(`WaiterConfiguration.maxWaitTime [${options.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${options.minDelay}] for this waiter`); - } - else if (options.maxDelay < options.minDelay) { - throw new Error(`WaiterConfiguration.maxDelay [${options.maxDelay}] must be greater than WaiterConfiguration.minDelay [${options.minDelay}] for this waiter`); - } -}; -exports.validateWaiterOptions = validateWaiterOptions; - - -/***/ }), - -/***/ 9020: -/***/ ((__unused_webpack_module, exports) => { - - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.checkExceptions = exports.WaiterState = exports.waiterServiceDefaults = void 0; -exports.waiterServiceDefaults = { - minDelay: 2, - maxDelay: 120, -}; -var WaiterState; -(function (WaiterState) { - WaiterState["ABORTED"] = "ABORTED"; - WaiterState["FAILURE"] = "FAILURE"; - WaiterState["SUCCESS"] = "SUCCESS"; - WaiterState["RETRY"] = "RETRY"; - WaiterState["TIMEOUT"] = "TIMEOUT"; -})(WaiterState = exports.WaiterState || (exports.WaiterState = {})); -const checkExceptions = (result) => { - if (result.state === WaiterState.ABORTED) { - const abortError = new Error(`${JSON.stringify({ - ...result, - reason: "Request was aborted", - })}`); - abortError.name = "AbortError"; - throw abortError; - } - else if (result.state === WaiterState.TIMEOUT) { - const timeoutError = new Error(`${JSON.stringify({ - ...result, - reason: "Waiter has timed out", - })}`); - timeoutError.name = "TimeoutError"; - throw timeoutError; - } - else if (result.state !== WaiterState.SUCCESS) { - throw new Error(`${JSON.stringify({ result })}`); - } - return result; -}; -exports.checkExceptions = checkExceptions; - - -/***/ }), - -/***/ 8406: -/***/ ((module) => { - -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, Symbol, Reflect, Promise, SuppressedError */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __esDecorate; -var __runInitializers; -var __propKey; -var __setFunctionName; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __classPrivateFieldIn; -var __createBinding; -var __addDisposableResource; -var __disposeResources; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - - __runInitializers = function (thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; - }; - - __propKey = function (x) { - return typeof x === "symbol" ? x : "".concat(x); - }; - - __setFunctionName = function (f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __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()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - __classPrivateFieldIn = function (state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - - __addDisposableResource = function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; - }; - - var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; - }; - - __disposeResources = function (env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__esDecorate", __esDecorate); - exporter("__runInitializers", __runInitializers); - exporter("__propKey", __propKey); - exporter("__setFunctionName", __setFunctionName); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); - exporter("__classPrivateFieldIn", __classPrivateFieldIn); - exporter("__addDisposableResource", __addDisposableResource); - exporter("__disposeResources", __disposeResources); -}); - - -/***/ }), - -/***/ 28332: -/***/ ((module) => { -======= -/***/ 65618: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const { AbortController } = __nccwpck_require__(43586) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -/** - * Takes an array of AbortSignals and returns a single signal. - * If any signals are aborted, the returned signal will be aborted. - * @param {Array} signals - * @returns {AbortSignal} - */ -function anySignal (signals) { - const controller = new globalThis.AbortController() - - function onAbort () { - controller.abort() - - for (const signal of signals) { - if (!signal || !signal.removeEventListener) continue - signal.removeEventListener('abort', onAbort) - } - } - - for (const signal of signals) { - if (!signal || !signal.addEventListener) continue - if (signal.aborted) { - onAbort() - break - } - signal.addEventListener('abort', onAbort) - } - - return controller.signal -} - -module.exports = anySignal -module.exports.anySignal = anySignal - - -/***/ }), - -<<<<<<< HEAD -/***/ 75719: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = -{ - parallel : __nccwpck_require__(95230), - serial : __nccwpck_require__(42891), - serialOrdered : __nccwpck_require__(29499) -}; - - -/***/ }), - -/***/ 27404: -/***/ ((module) => { - -// API -module.exports = abort; - -/** - * Aborts leftover active jobs - * - * @param {object} state - current state object - */ -function abort(state) -{ - Object.keys(state.jobs).forEach(clean.bind(state)); - - // reset leftover jobs - state.jobs = {}; -} - -/** - * Cleans up leftover job by invoking abort function for the provided job id - * - * @this state - * @param {string|number} key - job id to abort - */ -function clean(key) -{ - if (typeof this.jobs[key] == 'function') - { - this.jobs[key](); - } -} - - -/***/ }), - -/***/ 23247: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var defer = __nccwpck_require__(25847); - -// API -module.exports = async; - -/** - * Runs provided callback asynchronously - * even if callback itself is not - * - * @param {function} callback - callback to invoke - * @returns {function} - augmented callback - */ -function async(callback) -{ - var isAsync = false; - - // check if async happened - defer(function() { isAsync = true; }); - - return function async_callback(err, result) - { - if (isAsync) - { - callback(err, result); - } - else - { - defer(function nextTick_callback() - { - callback(err, result); - }); - } - }; -} - - -/***/ }), - -/***/ 25847: -/***/ ((module) => { - -module.exports = defer; - -/** - * Runs provided function on next iteration of the event loop - * - * @param {function} fn - function to run - */ -function defer(fn) -{ - var nextTick = typeof setImmediate == 'function' - ? setImmediate - : ( - typeof process == 'object' && typeof process.nextTick == 'function' - ? process.nextTick - : null - ); - - if (nextTick) - { - nextTick(fn); - } - else - { - setTimeout(fn, 0); - } -} - - -/***/ }), - -/***/ 96930: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var async = __nccwpck_require__(23247) - , abort = __nccwpck_require__(27404) - ; - -// API -module.exports = iterate; - -/** - * Iterates over each job object - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {object} state - current job status - * @param {function} callback - invoked when all elements processed - */ -function iterate(list, iterator, state, callback) -{ - // store current index - var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; - - state.jobs[key] = runJob(iterator, key, list[key], function(error, output) - { - // don't repeat yourself - // skip secondary callbacks - if (!(key in state.jobs)) - { - return; - } - - // clean up jobs - delete state.jobs[key]; - - if (error) - { - // don't process rest of the results - // stop still active jobs - // and reset the list - abort(state); - } - else - { - state.results[key] = output; - } - - // return salvaged results - callback(error, state.results); - }); -} - -/** - * Runs iterator over provided job element - * - * @param {function} iterator - iterator to invoke - * @param {string|number} key - key/index of the element in the list of jobs - * @param {mixed} item - job description - * @param {function} callback - invoked after iterator is done with the job - * @returns {function|mixed} - job abort function or something else - */ -function runJob(iterator, key, item, callback) -{ - var aborter; - - // allow shortcut if iterator expects only two arguments - if (iterator.length == 2) - { - aborter = iterator(item, async(callback)); - } - // otherwise go with full three arguments - else - { - aborter = iterator(item, key, async(callback)); - } - - return aborter; -} - - -/***/ }), - -/***/ 70152: -/***/ ((module) => { - -// API -module.exports = state; - -/** - * Creates initial state object - * for iteration over list - * - * @param {array|object} list - list to iterate over - * @param {function|null} sortMethod - function to use for keys sort, - * or `null` to keep them as is - * @returns {object} - initial state object - */ -function state(list, sortMethod) -{ - var isNamedList = !Array.isArray(list) - , initState = - { - index : 0, - keyedList: isNamedList || sortMethod ? Object.keys(list) : null, - jobs : {}, - results : isNamedList ? {} : [], - size : isNamedList ? Object.keys(list).length : list.length - } - ; - - if (sortMethod) - { - // sort array keys based on it's values - // sort object's keys just on own merit - initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) - { - return sortMethod(list[a], list[b]); - }); - } - - return initState; -} - - -/***/ }), - -/***/ 13508: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var abort = __nccwpck_require__(27404) - , async = __nccwpck_require__(23247) - ; - -// API -module.exports = terminator; - -/** - * Terminates jobs in the attached state context - * - * @this AsyncKitState# - * @param {function} callback - final callback to invoke after termination - */ -function terminator(callback) -{ - if (!Object.keys(this.jobs).length) - { - return; - } - - // fast forward iteration index - this.index = this.size; - - // abort jobs - abort(this); - - // send back results we have so far - async(callback)(null, this.results); -} - - -/***/ }), - -/***/ 95230: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var iterate = __nccwpck_require__(96930) - , initState = __nccwpck_require__(70152) - , terminator = __nccwpck_require__(13508) - ; - -// Public API -module.exports = parallel; - -/** - * Runs iterator over provided array elements in parallel - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function parallel(list, iterator, callback) -{ - var state = initState(list); - - while (state.index < (state['keyedList'] || list).length) - { - iterate(list, iterator, state, function(error, result) - { - if (error) - { - callback(error, result); - return; - } - - // looks like it's the last one - if (Object.keys(state.jobs).length === 0) - { - callback(null, state.results); - return; - } - }); - - state.index++; - } - - return terminator.bind(state, callback); -} - - -/***/ }), - -/***/ 42891: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var serialOrdered = __nccwpck_require__(29499); - -// Public API -module.exports = serial; - -/** - * Runs iterator over provided array elements in series - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function serial(list, iterator, callback) -{ - return serialOrdered(list, iterator, null, callback); -} - - -/***/ }), - -/***/ 29499: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var iterate = __nccwpck_require__(96930) - , initState = __nccwpck_require__(70152) - , terminator = __nccwpck_require__(13508) - ; - -// Public API -module.exports = serialOrdered; -// sorting helpers -module.exports.ascending = ascending; -module.exports.descending = descending; - -/** - * Runs iterator over provided sorted array elements in series - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} sortMethod - custom sort function - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function serialOrdered(list, iterator, sortMethod, callback) -{ - var state = initState(list, sortMethod); - - iterate(list, iterator, state, function iteratorHandler(error, result) - { - if (error) - { - callback(error, result); - return; - } - - state.index++; - - // are we there yet? - if (state.index < (state['keyedList'] || list).length) - { - iterate(list, iterator, state, iteratorHandler); - return; - } - - // done here - callback(null, state.results); - }); - - return terminator.bind(state, callback); -} - -/* - * -- Sort methods - */ - -/** - * sort helper to sort array elements in ascending order - * - * @param {mixed} a - an item to compare - * @param {mixed} b - an item to compare - * @returns {number} - comparison result - */ -function ascending(a, b) -{ - return a < b ? -1 : a > b ? 1 : 0; -} - -/** - * sort helper to sort array elements in descending order - * - * @param {mixed} a - an item to compare - * @param {mixed} b - an item to compare - * @returns {number} - comparison result - */ -function descending(a, b) -{ - return -1 * ascending(a, b); -} - - -/***/ }), - -/***/ 99171: -======= -/***/ 66058: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - - -module.exports = balanced; -function balanced(a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str); - if (b instanceof RegExp) b = maybeMatch(b, str); - - var r = range(a, b, str); - - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} - -function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; -} - -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - - if (ai >= 0 && bi > 0) { - begs = []; - left = str.length; - - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - - bi = str.indexOf(b, i + 1); - } - - i = ai < bi && ai >= 0 ? ai : bi; - } - - if (begs.length) { - result = [ left, right ]; - } - } - - return result; -} - - -/***/ }), - -<<<<<<< HEAD -/***/ 65997: -======= -/***/ 87455: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var register = __nccwpck_require__(64031); -var addHook = __nccwpck_require__(69819); -var removeHook = __nccwpck_require__(68870); - -// bind with array of arguments: https://stackoverflow.com/a/21792913 -var bind = Function.bind; -var bindable = bind.bind(bind); - -function bindApi(hook, state, name) { - var removeHookRef = bindable(removeHook, null).apply( - null, - name ? [state, name] : [state] - ); - hook.api = { remove: removeHookRef }; - hook.remove = removeHookRef; - ["before", "error", "after", "wrap"].forEach(function (kind) { - var args = name ? [state, kind, name] : [state, kind]; - hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args); - }); -} - -function HookSingular() { - var singularHookName = "h"; - var singularHookState = { - registry: {}, - }; - var singularHook = register.bind(null, singularHookState, singularHookName); - bindApi(singularHook, singularHookState, singularHookName); - return singularHook; -} - -function HookCollection() { - var state = { - registry: {}, - }; - - var hook = register.bind(null, state); - bindApi(hook, state); - - return hook; -} - -var collectionHookDeprecationMessageDisplayed = false; -function Hook() { - if (!collectionHookDeprecationMessageDisplayed) { - console.warn( - '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4' - ); - collectionHookDeprecationMessageDisplayed = true; - } - return HookCollection(); -} - -Hook.Singular = HookSingular.bind(); -Hook.Collection = HookCollection.bind(); - -module.exports = Hook; -// expose constructors as a named property for TypeScript -module.exports.Hook = Hook; -module.exports.Singular = Hook.Singular; -module.exports.Collection = Hook.Collection; - - -/***/ }), - -<<<<<<< HEAD -/***/ 69819: -/***/ ((module) => { -======= -/***/ 74827: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -module.exports = addHook; - -<<<<<<< HEAD -function addHook(state, kind, name, hook) { - var orig = hook; - if (!state.registry[name]) { - state.registry[name] = []; - } - - if (kind === "before") { - hook = function (method, options) { - return Promise.resolve() - .then(orig.bind(null, options)) - .then(method.bind(null, options)); -======= - - -const browserReadableStreamToIt = __nccwpck_require__(31049) - -/** - * @param {Blob} blob - * @returns {AsyncIterable} - */ -function blobToIt (blob) { - if (typeof blob.stream === 'function') { - // @ts-ignore missing some properties - return browserReadableStreamToIt(blob.stream()) - } - - // firefox < 69 does not support blob.stream() - // @ts-ignore - response.body is optional, but in practice it's a stream. - return browserReadableStreamToIt(new Response(blob).body) -} - -module.exports = blobToIt - - -/***/ }), - -/***/ 57453: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var drain = __nccwpck_require__(85041); -var filter = __nccwpck_require__(78883); -var take = __nccwpck_require__(16346); -var all = __nccwpck_require__(81172); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var drain__default = /*#__PURE__*/_interopDefaultLegacy(drain); -var filter__default = /*#__PURE__*/_interopDefaultLegacy(filter); -var take__default = /*#__PURE__*/_interopDefaultLegacy(take); -var all__default = /*#__PURE__*/_interopDefaultLegacy(all); - -const sortAll = (iterable, sorter) => { - return async function* () { - const values = await all__default["default"](iterable); - yield* values.sort(sorter); - }(); -}; -class BaseBlockstore { - open() { - return Promise.reject(new Error('.open is not implemented')); - } - close() { - return Promise.reject(new Error('.close is not implemented')); - } - put(key, val, options) { - return Promise.reject(new Error('.put is not implemented')); - } - get(key, options) { - return Promise.reject(new Error('.get is not implemented')); - } - has(key, options) { - return Promise.reject(new Error('.has is not implemented')); - } - delete(key, options) { - return Promise.reject(new Error('.delete is not implemented')); - } - async *putMany(source, options = {}) { - for await (const {key, value} of source) { - await this.put(key, value, options); - yield { - key, - value - }; - } - } - async *getMany(source, options = {}) { - for await (const key of source) { - yield this.get(key, options); - } - } - async *deleteMany(source, options = {}) { - for await (const key of source) { - await this.delete(key, options); - yield key; - } - } - batch() { - let puts = []; - let dels = []; - return { - put(key, value) { - puts.push({ - key, - value - }); - }, - delete(key) { - dels.push(key); - }, - commit: async options => { - await drain__default["default"](this.putMany(puts, options)); - puts = []; - await drain__default["default"](this.deleteMany(dels, options)); - dels = []; - } ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - }; - } - -<<<<<<< HEAD - if (kind === "after") { - hook = function (method, options) { - var result; - return Promise.resolve() - .then(method.bind(null, options)) - .then(function (result_) { - result = result_; - return orig(result, options); - }) - .then(function () { - return result; -======= -exports.BaseBlockstore = BaseBlockstore; - - -/***/ }), - -/***/ 36200: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var errCode = __nccwpck_require__(5822); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); - -function notFoundError(err) { - err = err || new Error('Not Found'); - return errCode__default["default"](err, 'ERR_NOT_FOUND'); -} -function abortedError(err) { - err = err || new Error('Aborted'); - return errCode__default["default"](err, 'ERR_ABORTED'); -} - -exports.abortedError = abortedError; -exports.notFoundError = notFoundError; - - -/***/ }), - -/***/ 95301: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var errors = __nccwpck_require__(36200); -var base = __nccwpck_require__(57453); -var memory = __nccwpck_require__(6584); - -const Errors = { ...errors }; - -exports.BaseBlockstore = base.BaseBlockstore; -exports.MemoryBlockstore = memory.MemoryBlockstore; -exports.Errors = Errors; - - -/***/ }), - -/***/ 6584: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var base = __nccwpck_require__(57453); -var base32 = __nccwpck_require__(70784); -var raw = __nccwpck_require__(4848); -var cid = __nccwpck_require__(24247); -var Digest = __nccwpck_require__(81168); -var errors = __nccwpck_require__(36200); - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - }); - }; - } - - if (kind === "error") { - hook = function (method, options) { - return Promise.resolve() - .then(method.bind(null, options)) - .catch(function (error) { - return orig(error, options); - }); - }; - } - - state.registry[name].push({ - hook: hook, - orig: orig, - }); -} - - -/***/ }), - -<<<<<<< HEAD -/***/ 64031: -/***/ ((module) => { - -module.exports = register; - -function register(state, name, method, options) { - if (typeof method !== "function") { - throw new Error("method for before hook must be a function"); - } - - if (!options) { - options = {}; - } - - if (Array.isArray(name)) { - return name.reverse().reduce(function (callback, name) { - return register.bind(null, state, name, callback, options); - }, method)(); - } - - return Promise.resolve().then(function () { - if (!state.registry[name]) { - return method(options); - } - - return state.registry[name].reduce(function (method, registered) { - return registered.hook.bind(null, method, options); - }, method)(); - }); -} - - -/***/ }), - -/***/ 68870: -/***/ ((module) => { - -module.exports = removeHook; - -function removeHook(state, name, method) { - if (!state.registry[name]) { - return; - } - - var index = state.registry[name] - .map(function (registered) { - return registered.orig; - }) - .indexOf(method); - - if (index === -1) { - return; - } - - state.registry[name].splice(index, 1); -} - - -/***/ }), - -/***/ 11401: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var balanced = __nccwpck_require__(99171); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m) return [str]; - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - if (/\$$/.test(m.pre)) { - for (var k = 0; k < post.length; k++) { - var expansion = pre+ '{' + m.body + '}' + post[k]; - expansions.push(expansion); - } - } else { - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = []; - - for (var j = 0; j < n.length; j++) { - N.push.apply(N, expand(n[j], false)); - } - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - } - - return expansions; -} - - - -/***/ }), - -/***/ 3263: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var concatMap = __nccwpck_require__(42054); -var balanced = __nccwpck_require__(99171); -======= -/***/ 73594: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var concatMap = __nccwpck_require__(73132); -var balanced = __nccwpck_require__(66058); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - - - -/***/ }), - -<<<<<<< HEAD -/***/ 82677: -/***/ ((module) => { - -======= -/***/ 31049: -/***/ ((module) => { - -"use strict"; - - -/** - * Turns a browser readable stream into an async iterable. Async iteration over - * returned iterable will lock give stream, preventing any other consumer from - * acquiring a reader. The lock will be released if iteration loop is broken. To - * prevent stream cancelling optional `{ preventCancel: true }` could be passed - * as a second argument. - * @template T - * @param {ReadableStream} stream - * @param {Object} [options] - * @param {boolean} [options.preventCancel=boolean] - * @returns {AsyncIterable} - */ -async function * browserReadableStreamToIt (stream, options = {}) { - const reader = stream.getReader() - - try { - while (true) { - const result = await reader.read() - - if (result.done) { - return - } - - yield result.value - } - } finally { - if (options.preventCancel !== true) { - reader.cancel() - } - - reader.releaseLock() - } -} - -module.exports = browserReadableStreamToIt - - -/***/ }), - -/***/ 12085: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var encode = __nccwpck_require__(87446); -var decode = __nccwpck_require__(53216); -var token = __nccwpck_require__(90915); - - - -exports.encode = encode.encode; -exports.decode = decode.decode; -exports.Token = token.Token; -exports.Type = token.Type; - - -/***/ }), - -/***/ 80316: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var token = __nccwpck_require__(90915); -var common = __nccwpck_require__(47907); - -const uintBoundaries = [ - 24, - 256, - 65536, - 4294967296, - BigInt('18446744073709551616') -]; -function readUint8(data, offset, options) { - common.assertEnoughData(data, offset, 1); - const value = data[offset]; - if (options.strict === true && value < uintBoundaries[0]) { - throw new Error(`${ common.decodeErrPrefix } integer encoded in more bytes than necessary (strict decode)`); - } - return value; -} -function readUint16(data, offset, options) { - common.assertEnoughData(data, offset, 2); - const value = data[offset] << 8 | data[offset + 1]; - if (options.strict === true && value < uintBoundaries[1]) { - throw new Error(`${ common.decodeErrPrefix } integer encoded in more bytes than necessary (strict decode)`); - } - return value; -} -function readUint32(data, offset, options) { - common.assertEnoughData(data, offset, 4); - const value = data[offset] * 16777216 + (data[offset + 1] << 16) + (data[offset + 2] << 8) + data[offset + 3]; - if (options.strict === true && value < uintBoundaries[2]) { - throw new Error(`${ common.decodeErrPrefix } integer encoded in more bytes than necessary (strict decode)`); - } - return value; -} -function readUint64(data, offset, options) { - common.assertEnoughData(data, offset, 8); - const hi = data[offset] * 16777216 + (data[offset + 1] << 16) + (data[offset + 2] << 8) + data[offset + 3]; - const lo = data[offset + 4] * 16777216 + (data[offset + 5] << 16) + (data[offset + 6] << 8) + data[offset + 7]; - const value = (BigInt(hi) << BigInt(32)) + BigInt(lo); - if (options.strict === true && value < uintBoundaries[3]) { - throw new Error(`${ common.decodeErrPrefix } integer encoded in more bytes than necessary (strict decode)`); - } - if (value <= Number.MAX_SAFE_INTEGER) { - return Number(value); - } - if (options.allowBigInt === true) { - return value; - } - throw new Error(`${ common.decodeErrPrefix } integers outside of the safe integer range are not supported`); -} -function decodeUint8(data, pos, _minor, options) { - return new token.Token(token.Type.uint, readUint8(data, pos + 1, options), 2); -} -function decodeUint16(data, pos, _minor, options) { - return new token.Token(token.Type.uint, readUint16(data, pos + 1, options), 3); -} -function decodeUint32(data, pos, _minor, options) { - return new token.Token(token.Type.uint, readUint32(data, pos + 1, options), 5); -} -function decodeUint64(data, pos, _minor, options) { - return new token.Token(token.Type.uint, readUint64(data, pos + 1, options), 9); -} -function encodeUint(buf, token) { - return encodeUintValue(buf, 0, token.value); -} -function encodeUintValue(buf, major, uint) { - if (uint < uintBoundaries[0]) { - const nuint = Number(uint); - buf.push([major | nuint]); - } else if (uint < uintBoundaries[1]) { - const nuint = Number(uint); - buf.push([ - major | 24, - nuint - ]); - } else if (uint < uintBoundaries[2]) { - const nuint = Number(uint); - buf.push([ - major | 25, - nuint >>> 8, - nuint & 255 - ]); - } else if (uint < uintBoundaries[3]) { - const nuint = Number(uint); - buf.push([ - major | 26, - nuint >>> 24 & 255, - nuint >>> 16 & 255, - nuint >>> 8 & 255, - nuint & 255 - ]); - } else { - const buint = BigInt(uint); - if (buint < uintBoundaries[4]) { - const set = [ - major | 27, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ]; - let lo = Number(buint & BigInt(4294967295)); - let hi = Number(buint >> BigInt(32) & BigInt(4294967295)); - set[8] = lo & 255; - lo = lo >> 8; - set[7] = lo & 255; - lo = lo >> 8; - set[6] = lo & 255; - lo = lo >> 8; - set[5] = lo & 255; - set[4] = hi & 255; - hi = hi >> 8; - set[3] = hi & 255; - hi = hi >> 8; - set[2] = hi & 255; - hi = hi >> 8; - set[1] = hi & 255; - buf.push(set); - } else { - throw new Error(`${ common.decodeErrPrefix } encountered BigInt larger than allowable range`); - } - } -} -encodeUint.encodedSize = function encodedSize(token) { - return encodeUintValue.encodedSize(token.value); -}; -encodeUintValue.encodedSize = function encodedSize(uint) { - if (uint < uintBoundaries[0]) { - return 1; - } - if (uint < uintBoundaries[1]) { - return 2; - } - if (uint < uintBoundaries[2]) { - return 3; - } - if (uint < uintBoundaries[3]) { - return 5; - } - return 9; -}; -encodeUint.compareTokens = function compareTokens(tok1, tok2) { - return tok1.value < tok2.value ? -1 : tok1.value > tok2.value ? 1 : 0; -}; - -exports.decodeUint16 = decodeUint16; -exports.decodeUint32 = decodeUint32; -exports.decodeUint64 = decodeUint64; -exports.decodeUint8 = decodeUint8; -exports.encodeUint = encodeUint; -exports.encodeUintValue = encodeUintValue; -exports.readUint16 = readUint16; -exports.readUint32 = readUint32; -exports.readUint64 = readUint64; -exports.readUint8 = readUint8; -exports.uintBoundaries = uintBoundaries; - - -/***/ }), - -/***/ 33709: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var token = __nccwpck_require__(90915); -var _0uint = __nccwpck_require__(80316); -var common = __nccwpck_require__(47907); - -function decodeNegint8(data, pos, _minor, options) { - return new token.Token(token.Type.negint, -1 - _0uint.readUint8(data, pos + 1, options), 2); -} -function decodeNegint16(data, pos, _minor, options) { - return new token.Token(token.Type.negint, -1 - _0uint.readUint16(data, pos + 1, options), 3); -} -function decodeNegint32(data, pos, _minor, options) { - return new token.Token(token.Type.negint, -1 - _0uint.readUint32(data, pos + 1, options), 5); -} -const neg1b = BigInt(-1); -const pos1b = BigInt(1); -function decodeNegint64(data, pos, _minor, options) { - const int = _0uint.readUint64(data, pos + 1, options); - if (typeof int !== 'bigint') { - const value = -1 - int; - if (value >= Number.MIN_SAFE_INTEGER) { - return new token.Token(token.Type.negint, value, 9); - } - } - if (options.allowBigInt !== true) { - throw new Error(`${ common.decodeErrPrefix } integers outside of the safe integer range are not supported`); - } - return new token.Token(token.Type.negint, neg1b - BigInt(int), 9); -} -function encodeNegint(buf, token) { - const negint = token.value; - const unsigned = typeof negint === 'bigint' ? negint * neg1b - pos1b : negint * -1 - 1; - _0uint.encodeUintValue(buf, token.type.majorEncoded, unsigned); -} -encodeNegint.encodedSize = function encodedSize(token) { - const negint = token.value; - const unsigned = typeof negint === 'bigint' ? negint * neg1b - pos1b : negint * -1 - 1; - if (unsigned < _0uint.uintBoundaries[0]) { - return 1; - } - if (unsigned < _0uint.uintBoundaries[1]) { - return 2; - } - if (unsigned < _0uint.uintBoundaries[2]) { - return 3; - } - if (unsigned < _0uint.uintBoundaries[3]) { - return 5; - } - return 9; -}; -encodeNegint.compareTokens = function compareTokens(tok1, tok2) { - return tok1.value < tok2.value ? 1 : tok1.value > tok2.value ? -1 : 0; -}; - -exports.decodeNegint16 = decodeNegint16; -exports.decodeNegint32 = decodeNegint32; -exports.decodeNegint64 = decodeNegint64; -exports.decodeNegint8 = decodeNegint8; -exports.encodeNegint = encodeNegint; - - -/***/ }), - -/***/ 70195: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var token = __nccwpck_require__(90915); -var common = __nccwpck_require__(47907); -var _0uint = __nccwpck_require__(80316); -var byteUtils = __nccwpck_require__(46070); - -function toToken(data, pos, prefix, length) { - common.assertEnoughData(data, pos, prefix + length); - const buf = byteUtils.slice(data, pos + prefix, pos + prefix + length); - return new token.Token(token.Type.bytes, buf, prefix + length); -} -function decodeBytesCompact(data, pos, minor, _options) { - return toToken(data, pos, 1, minor); -} -function decodeBytes8(data, pos, _minor, options) { - return toToken(data, pos, 2, _0uint.readUint8(data, pos + 1, options)); -} -function decodeBytes16(data, pos, _minor, options) { - return toToken(data, pos, 3, _0uint.readUint16(data, pos + 1, options)); -} -function decodeBytes32(data, pos, _minor, options) { - return toToken(data, pos, 5, _0uint.readUint32(data, pos + 1, options)); -} -function decodeBytes64(data, pos, _minor, options) { - const l = _0uint.readUint64(data, pos + 1, options); - if (typeof l === 'bigint') { - throw new Error(`${ common.decodeErrPrefix } 64-bit integer bytes lengths not supported`); - } - return toToken(data, pos, 9, l); -} -function tokenBytes(token$1) { - if (token$1.encodedBytes === undefined) { - token$1.encodedBytes = token$1.type === token.Type.string ? byteUtils.fromString(token$1.value) : token$1.value; - } - return token$1.encodedBytes; -} -function encodeBytes(buf, token) { - const bytes = tokenBytes(token); - _0uint.encodeUintValue(buf, token.type.majorEncoded, bytes.length); - buf.push(bytes); -} -encodeBytes.encodedSize = function encodedSize(token) { - const bytes = tokenBytes(token); - return _0uint.encodeUintValue.encodedSize(bytes.length) + bytes.length; -}; -encodeBytes.compareTokens = function compareTokens(tok1, tok2) { - return compareBytes(tokenBytes(tok1), tokenBytes(tok2)); -}; -function compareBytes(b1, b2) { - return b1.length < b2.length ? -1 : b1.length > b2.length ? 1 : byteUtils.compare(b1, b2); -} - -exports.compareBytes = compareBytes; -exports.decodeBytes16 = decodeBytes16; -exports.decodeBytes32 = decodeBytes32; -exports.decodeBytes64 = decodeBytes64; -exports.decodeBytes8 = decodeBytes8; -exports.decodeBytesCompact = decodeBytesCompact; -exports.encodeBytes = encodeBytes; - - -/***/ }), - -/***/ 49081: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var token = __nccwpck_require__(90915); -var common = __nccwpck_require__(47907); -var _0uint = __nccwpck_require__(80316); -var _2bytes = __nccwpck_require__(70195); -var byteUtils = __nccwpck_require__(46070); - -function toToken(data, pos, prefix, length) { - const totLength = prefix + length; - common.assertEnoughData(data, pos, totLength); - return new token.Token(token.Type.string, byteUtils.toString(data, pos + prefix, pos + totLength), totLength); -} -function decodeStringCompact(data, pos, minor, _options) { - return toToken(data, pos, 1, minor); -} -function decodeString8(data, pos, _minor, options) { - return toToken(data, pos, 2, _0uint.readUint8(data, pos + 1, options)); -} -function decodeString16(data, pos, _minor, options) { - return toToken(data, pos, 3, _0uint.readUint16(data, pos + 1, options)); -} -function decodeString32(data, pos, _minor, options) { - return toToken(data, pos, 5, _0uint.readUint32(data, pos + 1, options)); -} -function decodeString64(data, pos, _minor, options) { - const l = _0uint.readUint64(data, pos + 1, options); - if (typeof l === 'bigint') { - throw new Error(`${ common.decodeErrPrefix } 64-bit integer string lengths not supported`); - } - return toToken(data, pos, 9, l); -} -const encodeString = _2bytes.encodeBytes; - -exports.decodeString16 = decodeString16; -exports.decodeString32 = decodeString32; -exports.decodeString64 = decodeString64; -exports.decodeString8 = decodeString8; -exports.decodeStringCompact = decodeStringCompact; -exports.encodeString = encodeString; - - -/***/ }), - -/***/ 22339: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var token = __nccwpck_require__(90915); -var _0uint = __nccwpck_require__(80316); -var common = __nccwpck_require__(47907); - -function toToken(_data, _pos, prefix, length) { - return new token.Token(token.Type.array, length, prefix); -} -function decodeArrayCompact(data, pos, minor, _options) { - return toToken(data, pos, 1, minor); -} -function decodeArray8(data, pos, _minor, options) { - return toToken(data, pos, 2, _0uint.readUint8(data, pos + 1, options)); -} -function decodeArray16(data, pos, _minor, options) { - return toToken(data, pos, 3, _0uint.readUint16(data, pos + 1, options)); -} -function decodeArray32(data, pos, _minor, options) { - return toToken(data, pos, 5, _0uint.readUint32(data, pos + 1, options)); -} -function decodeArray64(data, pos, _minor, options) { - const l = _0uint.readUint64(data, pos + 1, options); - if (typeof l === 'bigint') { - throw new Error(`${ common.decodeErrPrefix } 64-bit integer array lengths not supported`); - } - return toToken(data, pos, 9, l); -} -function decodeArrayIndefinite(data, pos, _minor, options) { - if (options.allowIndefinite === false) { - throw new Error(`${ common.decodeErrPrefix } indefinite length items not allowed`); - } - return toToken(data, pos, 1, Infinity); -} -function encodeArray(buf, token$1) { - _0uint.encodeUintValue(buf, token.Type.array.majorEncoded, token$1.value); -} -encodeArray.compareTokens = _0uint.encodeUint.compareTokens; - -exports.decodeArray16 = decodeArray16; -exports.decodeArray32 = decodeArray32; -exports.decodeArray64 = decodeArray64; -exports.decodeArray8 = decodeArray8; -exports.decodeArrayCompact = decodeArrayCompact; -exports.decodeArrayIndefinite = decodeArrayIndefinite; -exports.encodeArray = encodeArray; - - -/***/ }), - -/***/ 91440: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var token = __nccwpck_require__(90915); -var _0uint = __nccwpck_require__(80316); -var common = __nccwpck_require__(47907); - -function toToken(_data, _pos, prefix, length) { - return new token.Token(token.Type.map, length, prefix); -} -function decodeMapCompact(data, pos, minor, _options) { - return toToken(data, pos, 1, minor); -} -function decodeMap8(data, pos, _minor, options) { - return toToken(data, pos, 2, _0uint.readUint8(data, pos + 1, options)); -} -function decodeMap16(data, pos, _minor, options) { - return toToken(data, pos, 3, _0uint.readUint16(data, pos + 1, options)); -} -function decodeMap32(data, pos, _minor, options) { - return toToken(data, pos, 5, _0uint.readUint32(data, pos + 1, options)); -} -function decodeMap64(data, pos, _minor, options) { - const l = _0uint.readUint64(data, pos + 1, options); - if (typeof l === 'bigint') { - throw new Error(`${ common.decodeErrPrefix } 64-bit integer map lengths not supported`); - } - return toToken(data, pos, 9, l); -} -function decodeMapIndefinite(data, pos, _minor, options) { - if (options.allowIndefinite === false) { - throw new Error(`${ common.decodeErrPrefix } indefinite length items not allowed`); - } - return toToken(data, pos, 1, Infinity); -} -function encodeMap(buf, token$1) { - _0uint.encodeUintValue(buf, token.Type.map.majorEncoded, token$1.value); -} -encodeMap.compareTokens = _0uint.encodeUint.compareTokens; - -exports.decodeMap16 = decodeMap16; -exports.decodeMap32 = decodeMap32; -exports.decodeMap64 = decodeMap64; -exports.decodeMap8 = decodeMap8; -exports.decodeMapCompact = decodeMapCompact; -exports.decodeMapIndefinite = decodeMapIndefinite; -exports.encodeMap = encodeMap; - - -/***/ }), - -/***/ 97051: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var token = __nccwpck_require__(90915); -var _0uint = __nccwpck_require__(80316); - -function decodeTagCompact(_data, _pos, minor, _options) { - return new token.Token(token.Type.tag, minor, 1); -} -function decodeTag8(data, pos, _minor, options) { - return new token.Token(token.Type.tag, _0uint.readUint8(data, pos + 1, options), 2); -} -function decodeTag16(data, pos, _minor, options) { - return new token.Token(token.Type.tag, _0uint.readUint16(data, pos + 1, options), 3); -} -function decodeTag32(data, pos, _minor, options) { - return new token.Token(token.Type.tag, _0uint.readUint32(data, pos + 1, options), 5); -} -function decodeTag64(data, pos, _minor, options) { - return new token.Token(token.Type.tag, _0uint.readUint64(data, pos + 1, options), 9); -} -function encodeTag(buf, token$1) { - _0uint.encodeUintValue(buf, token.Type.tag.majorEncoded, token$1.value); -} -encodeTag.compareTokens = _0uint.encodeUint.compareTokens; - -exports.decodeTag16 = decodeTag16; -exports.decodeTag32 = decodeTag32; -exports.decodeTag64 = decodeTag64; -exports.decodeTag8 = decodeTag8; -exports.decodeTagCompact = decodeTagCompact; -exports.encodeTag = encodeTag; - - -/***/ }), - -/***/ 59213: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var token = __nccwpck_require__(90915); -var common = __nccwpck_require__(47907); -var _0uint = __nccwpck_require__(80316); - -const MINOR_FALSE = 20; -const MINOR_TRUE = 21; -const MINOR_NULL = 22; -const MINOR_UNDEFINED = 23; -function decodeUndefined(_data, _pos, _minor, options) { - if (options.allowUndefined === false) { - throw new Error(`${ common.decodeErrPrefix } undefined values are not supported`); - } else if (options.coerceUndefinedToNull === true) { - return new token.Token(token.Type.null, null, 1); - } - return new token.Token(token.Type.undefined, undefined, 1); -} -function decodeBreak(_data, _pos, _minor, options) { - if (options.allowIndefinite === false) { - throw new Error(`${ common.decodeErrPrefix } indefinite length items not allowed`); - } - return new token.Token(token.Type.break, undefined, 1); -} -function createToken(value, bytes, options) { - if (options) { - if (options.allowNaN === false && Number.isNaN(value)) { - throw new Error(`${ common.decodeErrPrefix } NaN values are not supported`); - } - if (options.allowInfinity === false && (value === Infinity || value === -Infinity)) { - throw new Error(`${ common.decodeErrPrefix } Infinity values are not supported`); - } - } - return new token.Token(token.Type.float, value, bytes); -} -function decodeFloat16(data, pos, _minor, options) { - return createToken(readFloat16(data, pos + 1), 3, options); -} -function decodeFloat32(data, pos, _minor, options) { - return createToken(readFloat32(data, pos + 1), 5, options); -} -function decodeFloat64(data, pos, _minor, options) { - return createToken(readFloat64(data, pos + 1), 9, options); -} -function encodeFloat(buf, token$1, options) { - const float = token$1.value; - if (float === false) { - buf.push([token.Type.float.majorEncoded | MINOR_FALSE]); - } else if (float === true) { - buf.push([token.Type.float.majorEncoded | MINOR_TRUE]); - } else if (float === null) { - buf.push([token.Type.float.majorEncoded | MINOR_NULL]); - } else if (float === undefined) { - buf.push([token.Type.float.majorEncoded | MINOR_UNDEFINED]); - } else { - let decoded; - let success = false; - if (!options || options.float64 !== true) { - encodeFloat16(float); - decoded = readFloat16(ui8a, 1); - if (float === decoded || Number.isNaN(float)) { - ui8a[0] = 249; - buf.push(ui8a.slice(0, 3)); - success = true; - } else { - encodeFloat32(float); - decoded = readFloat32(ui8a, 1); - if (float === decoded) { - ui8a[0] = 250; - buf.push(ui8a.slice(0, 5)); - success = true; - } - } - } - if (!success) { - encodeFloat64(float); - decoded = readFloat64(ui8a, 1); - ui8a[0] = 251; - buf.push(ui8a.slice(0, 9)); - } - } -} -encodeFloat.encodedSize = function encodedSize(token, options) { - const float = token.value; - if (float === false || float === true || float === null || float === undefined) { - return 1; - } - let decoded; - if (!options || options.float64 !== true) { - encodeFloat16(float); - decoded = readFloat16(ui8a, 1); - if (float === decoded || Number.isNaN(float)) { - return 3; - } - encodeFloat32(float); - decoded = readFloat32(ui8a, 1); - if (float === decoded) { - return 5; - } - } - return 9; -}; -const buffer = new ArrayBuffer(9); -const dataView = new DataView(buffer, 1); -const ui8a = new Uint8Array(buffer, 0); -function encodeFloat16(inp) { - if (inp === Infinity) { - dataView.setUint16(0, 31744, false); - } else if (inp === -Infinity) { - dataView.setUint16(0, 64512, false); - } else if (Number.isNaN(inp)) { - dataView.setUint16(0, 32256, false); - } else { - dataView.setFloat32(0, inp); - const valu32 = dataView.getUint32(0); - const exponent = (valu32 & 2139095040) >> 23; - const mantissa = valu32 & 8388607; - if (exponent === 255) { - dataView.setUint16(0, 31744, false); - } else if (exponent === 0) { - dataView.setUint16(0, (inp & 2147483648) >> 16 | mantissa >> 13, false); - } else { - const logicalExponent = exponent - 127; - if (logicalExponent < -24) { - dataView.setUint16(0, 0); - } else if (logicalExponent < -14) { - dataView.setUint16(0, (valu32 & 2147483648) >> 16 | 1 << 24 + logicalExponent, false); - } else { - dataView.setUint16(0, (valu32 & 2147483648) >> 16 | logicalExponent + 15 << 10 | mantissa >> 13, false); - } - } - } -} -function readFloat16(ui8a, pos) { - if (ui8a.length - pos < 2) { - throw new Error(`${ common.decodeErrPrefix } not enough data for float16`); - } - const half = (ui8a[pos] << 8) + ui8a[pos + 1]; - if (half === 31744) { - return Infinity; - } - if (half === 64512) { - return -Infinity; - } - if (half === 32256) { - return NaN; - } - const exp = half >> 10 & 31; - const mant = half & 1023; - let val; - if (exp === 0) { - val = mant * 2 ** -24; - } else if (exp !== 31) { - val = (mant + 1024) * 2 ** (exp - 25); - } else { - val = mant === 0 ? Infinity : NaN; - } - return half & 32768 ? -val : val; -} -function encodeFloat32(inp) { - dataView.setFloat32(0, inp, false); -} -function readFloat32(ui8a, pos) { - if (ui8a.length - pos < 4) { - throw new Error(`${ common.decodeErrPrefix } not enough data for float32`); - } - const offset = (ui8a.byteOffset || 0) + pos; - return new DataView(ui8a.buffer, offset, 4).getFloat32(0, false); -} -function encodeFloat64(inp) { - dataView.setFloat64(0, inp, false); -} -function readFloat64(ui8a, pos) { - if (ui8a.length - pos < 8) { - throw new Error(`${ common.decodeErrPrefix } not enough data for float64`); - } - const offset = (ui8a.byteOffset || 0) + pos; - return new DataView(ui8a.buffer, offset, 8).getFloat64(0, false); -} -encodeFloat.compareTokens = _0uint.encodeUint.compareTokens; - -exports.decodeBreak = decodeBreak; -exports.decodeFloat16 = decodeFloat16; -exports.decodeFloat32 = decodeFloat32; -exports.decodeFloat64 = decodeFloat64; -exports.decodeUndefined = decodeUndefined; -exports.encodeFloat = encodeFloat; - - -/***/ }), - -/***/ 31889: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var byteUtils = __nccwpck_require__(46070); - -const defaultChunkSize = 256; -class Bl { - constructor(chunkSize = defaultChunkSize) { - this.chunkSize = chunkSize; - this.cursor = 0; - this.maxCursor = -1; - this.chunks = []; - this._initReuseChunk = null; - } - reset() { - this.chunks = []; - this.cursor = 0; - this.maxCursor = -1; - if (this._initReuseChunk !== null) { - this.chunks.push(this._initReuseChunk); - this.maxCursor = this._initReuseChunk.length - 1; - } - } - push(bytes) { - let topChunk = this.chunks[this.chunks.length - 1]; - const newMax = this.cursor + bytes.length; - if (newMax <= this.maxCursor + 1) { - const chunkPos = topChunk.length - (this.maxCursor - this.cursor) - 1; - topChunk.set(bytes, chunkPos); - } else { - if (topChunk) { - const chunkPos = topChunk.length - (this.maxCursor - this.cursor) - 1; - if (chunkPos < topChunk.length) { - this.chunks[this.chunks.length - 1] = topChunk.subarray(0, chunkPos); - this.maxCursor = this.cursor - 1; - } - } - if (bytes.length < 64 && bytes.length < this.chunkSize) { - topChunk = byteUtils.alloc(this.chunkSize); - this.chunks.push(topChunk); - this.maxCursor += topChunk.length; - if (this._initReuseChunk === null) { - this._initReuseChunk = topChunk; - } - topChunk.set(bytes, 0); - } else { - this.chunks.push(bytes); - this.maxCursor += bytes.length; - } - } - this.cursor += bytes.length; - } - toBytes(reset = false) { - let byts; - if (this.chunks.length === 1) { - const chunk = this.chunks[0]; - if (reset && this.cursor > chunk.length / 2) { - byts = this.cursor === chunk.length ? chunk : chunk.subarray(0, this.cursor); - this._initReuseChunk = null; - this.chunks = []; - } else { - byts = byteUtils.slice(chunk, 0, this.cursor); - } - } else { - byts = byteUtils.concat(this.chunks, this.cursor); - } - if (reset) { - this.reset(); - } - return byts; - } -} - -exports.Bl = Bl; - - -/***/ }), - -/***/ 46070: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const useBuffer = globalThis.process && !globalThis.process.browser && globalThis.Buffer && typeof globalThis.Buffer.isBuffer === 'function'; -const textDecoder = new TextDecoder(); -const textEncoder = new TextEncoder(); -function isBuffer(buf) { - return useBuffer && globalThis.Buffer.isBuffer(buf); -} -function asU8A(buf) { - if (!(buf instanceof Uint8Array)) { - return Uint8Array.from(buf); - } - return isBuffer(buf) ? new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength) : buf; -} -const toString = useBuffer ? (bytes, start, end) => { - return end - start > 64 ? globalThis.Buffer.from(bytes.subarray(start, end)).toString('utf8') : utf8Slice(bytes, start, end); -} : (bytes, start, end) => { - return end - start > 64 ? textDecoder.decode(bytes.subarray(start, end)) : utf8Slice(bytes, start, end); -}; -const fromString = useBuffer ? string => { - return string.length > 64 ? globalThis.Buffer.from(string) : utf8ToBytes(string); -} : string => { - return string.length > 64 ? textEncoder.encode(string) : utf8ToBytes(string); -}; -const fromArray = arr => { - return Uint8Array.from(arr); -}; -const slice = useBuffer ? (bytes, start, end) => { - if (isBuffer(bytes)) { - return new Uint8Array(bytes.subarray(start, end)); - } - return bytes.slice(start, end); -} : (bytes, start, end) => { - return bytes.slice(start, end); -}; -const concat = useBuffer ? (chunks, length) => { - chunks = chunks.map(c => c instanceof Uint8Array ? c : globalThis.Buffer.from(c)); - return asU8A(globalThis.Buffer.concat(chunks, length)); -} : (chunks, length) => { - const out = new Uint8Array(length); - let off = 0; - for (let b of chunks) { - if (off + b.length > out.length) { - b = b.subarray(0, out.length - off); - } - out.set(b, off); - off += b.length; - } - return out; -}; -const alloc = useBuffer ? size => { - return globalThis.Buffer.allocUnsafe(size); -} : size => { - return new Uint8Array(size); -}; -const toHex = useBuffer ? d => { - if (typeof d === 'string') { - return d; - } - return globalThis.Buffer.from(toBytes(d)).toString('hex'); -} : d => { - if (typeof d === 'string') { - return d; - } - return Array.prototype.reduce.call(toBytes(d), (p, c) => `${ p }${ c.toString(16).padStart(2, '0') }`, ''); -}; -const fromHex = useBuffer ? hex => { - if (hex instanceof Uint8Array) { - return hex; - } - return globalThis.Buffer.from(hex, 'hex'); -} : hex => { - if (hex instanceof Uint8Array) { - return hex; - } - if (!hex.length) { - return new Uint8Array(0); - } - return new Uint8Array(hex.split('').map((c, i, d) => i % 2 === 0 ? `0x${ c }${ d[i + 1] }` : '').filter(Boolean).map(e => parseInt(e, 16))); -}; -function toBytes(obj) { - if (obj instanceof Uint8Array && obj.constructor.name === 'Uint8Array') { - return obj; - } - if (obj instanceof ArrayBuffer) { - return new Uint8Array(obj); - } - if (ArrayBuffer.isView(obj)) { - return new Uint8Array(obj.buffer, obj.byteOffset, obj.byteLength); - } - throw new Error('Unknown type, must be binary type'); -} -function compare(b1, b2) { - if (isBuffer(b1) && isBuffer(b2)) { - return b1.compare(b2); - } - for (let i = 0; i < b1.length; i++) { - if (b1[i] === b2[i]) { - continue; - } - return b1[i] < b2[i] ? -1 : 1; - } - return 0; -} -function utf8ToBytes(string, units = Infinity) { - let codePoint; - const length = string.length; - let leadSurrogate = null; - const bytes = []; - for (let i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i); - if (codePoint > 55295 && codePoint < 57344) { - if (!leadSurrogate) { - if (codePoint > 56319) { - if ((units -= 3) > -1) - bytes.push(239, 191, 189); - continue; - } else if (i + 1 === length) { - if ((units -= 3) > -1) - bytes.push(239, 191, 189); - continue; - } - leadSurrogate = codePoint; - continue; - } - if (codePoint < 56320) { - if ((units -= 3) > -1) - bytes.push(239, 191, 189); - leadSurrogate = codePoint; - continue; - } - codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; - } else if (leadSurrogate) { - if ((units -= 3) > -1) - bytes.push(239, 191, 189); - } - leadSurrogate = null; - if (codePoint < 128) { - if ((units -= 1) < 0) - break; - bytes.push(codePoint); - } else if (codePoint < 2048) { - if ((units -= 2) < 0) - break; - bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128); - } else if (codePoint < 65536) { - if ((units -= 3) < 0) - break; - bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); - } else if (codePoint < 1114112) { - if ((units -= 4) < 0) - break; - bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); - } else { - throw new Error('Invalid code point'); - } - } - return bytes; -} -function utf8Slice(buf, offset, end) { - const res = []; - while (offset < end) { - const firstByte = buf[offset]; - let codePoint = null; - let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; - if (offset + bytesPerSequence <= end) { - let secondByte, thirdByte, fourthByte, tempCodePoint; - switch (bytesPerSequence) { - case 1: - if (firstByte < 128) { - codePoint = firstByte; - } - break; - case 2: - secondByte = buf[offset + 1]; - if ((secondByte & 192) === 128) { - tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; - if (tempCodePoint > 127) { - codePoint = tempCodePoint; - } - } - break; - case 3: - secondByte = buf[offset + 1]; - thirdByte = buf[offset + 2]; - if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { - tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; - if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { - codePoint = tempCodePoint; - } - } - break; - case 4: - secondByte = buf[offset + 1]; - thirdByte = buf[offset + 2]; - fourthByte = buf[offset + 3]; - if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { - tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; - if (tempCodePoint > 65535 && tempCodePoint < 1114112) { - codePoint = tempCodePoint; - } - } - } - } - if (codePoint === null) { - codePoint = 65533; - bytesPerSequence = 1; - } else if (codePoint > 65535) { - codePoint -= 65536; - res.push(codePoint >>> 10 & 1023 | 55296); - codePoint = 56320 | codePoint & 1023; - } - res.push(codePoint); - offset += bytesPerSequence; - } - return decodeCodePointsArray(res); -} -const MAX_ARGUMENTS_LENGTH = 4096; -function decodeCodePointsArray(codePoints) { - const len = codePoints.length; - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints); - } - let res = ''; - let i = 0; - while (i < len) { - res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); - } - return res; -} - -exports.alloc = alloc; -exports.asU8A = asU8A; -exports.compare = compare; -exports.concat = concat; -exports.decodeCodePointsArray = decodeCodePointsArray; -exports.fromArray = fromArray; -exports.fromHex = fromHex; -exports.fromString = fromString; -exports.slice = slice; -exports.toHex = toHex; -exports.toString = toString; -exports.useBuffer = useBuffer; - - -/***/ }), - -/***/ 47907: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const decodeErrPrefix = 'CBOR decode error:'; -const encodeErrPrefix = 'CBOR encode error:'; -const uintMinorPrefixBytes = []; -uintMinorPrefixBytes[23] = 1; -uintMinorPrefixBytes[24] = 2; -uintMinorPrefixBytes[25] = 3; -uintMinorPrefixBytes[26] = 5; -uintMinorPrefixBytes[27] = 9; -function assertEnoughData(data, pos, need) { - if (data.length - pos < need) { - throw new Error(`${ decodeErrPrefix } not enough data for type`); - } -} - -exports.assertEnoughData = assertEnoughData; -exports.decodeErrPrefix = decodeErrPrefix; -exports.encodeErrPrefix = encodeErrPrefix; -exports.uintMinorPrefixBytes = uintMinorPrefixBytes; - - -/***/ }), - -/***/ 53216: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var common = __nccwpck_require__(47907); -var token = __nccwpck_require__(90915); -var jump = __nccwpck_require__(60294); - -const defaultDecodeOptions = { - strict: false, - allowIndefinite: true, - allowUndefined: true, - allowBigInt: true -}; -class Tokeniser { - constructor(data, options = {}) { - this.pos = 0; - this.data = data; - this.options = options; - } - done() { - return this.pos >= this.data.length; - } - next() { - const byt = this.data[this.pos]; - let token = jump.quick[byt]; - if (token === undefined) { - const decoder = jump.jump[byt]; - if (!decoder) { - throw new Error(`${ common.decodeErrPrefix } no decoder for major type ${ byt >>> 5 } (byte 0x${ byt.toString(16).padStart(2, '0') })`); - } - const minor = byt & 31; - token = decoder(this.data, this.pos, minor, this.options); - } - this.pos += token.encodedLength; - return token; - } -} -const DONE = Symbol.for('DONE'); -const BREAK = Symbol.for('BREAK'); -function tokenToArray(token, tokeniser, options) { - const arr = []; - for (let i = 0; i < token.value; i++) { - const value = tokensToObject(tokeniser, options); - if (value === BREAK) { - if (token.value === Infinity) { - break; - } - throw new Error(`${ common.decodeErrPrefix } got unexpected break to lengthed array`); - } - if (value === DONE) { - throw new Error(`${ common.decodeErrPrefix } found array but not enough entries (got ${ i }, expected ${ token.value })`); - } - arr[i] = value; - } - return arr; -} -function tokenToMap(token, tokeniser, options) { - const useMaps = options.useMaps === true; - const obj = useMaps ? undefined : {}; - const m = useMaps ? new Map() : undefined; - for (let i = 0; i < token.value; i++) { - const key = tokensToObject(tokeniser, options); - if (key === BREAK) { - if (token.value === Infinity) { - break; - } - throw new Error(`${ common.decodeErrPrefix } got unexpected break to lengthed map`); - } - if (key === DONE) { - throw new Error(`${ common.decodeErrPrefix } found map but not enough entries (got ${ i } [no key], expected ${ token.value })`); - } - if (useMaps !== true && typeof key !== 'string') { - throw new Error(`${ common.decodeErrPrefix } non-string keys not supported (got ${ typeof key })`); - } - const value = tokensToObject(tokeniser, options); - if (value === DONE) { - throw new Error(`${ common.decodeErrPrefix } found map but not enough entries (got ${ i } [no value], expected ${ token.value })`); - } - if (useMaps) { - m.set(key, value); - } else { - obj[key] = value; - } - } - return useMaps ? m : obj; -} -function tokensToObject(tokeniser, options) { - if (tokeniser.done()) { - return DONE; - } - const token$1 = tokeniser.next(); - if (token$1.type === token.Type.break) { - return BREAK; - } - if (token$1.type.terminal) { - return token$1.value; - } - if (token$1.type === token.Type.array) { - return tokenToArray(token$1, tokeniser, options); - } - if (token$1.type === token.Type.map) { - return tokenToMap(token$1, tokeniser, options); - } - if (token$1.type === token.Type.tag) { - if (options.tags && typeof options.tags[token$1.value] === 'function') { - const tagged = tokensToObject(tokeniser, options); - return options.tags[token$1.value](tagged); - } - throw new Error(`${ common.decodeErrPrefix } tag not supported (${ token$1.value })`); - } - throw new Error('unsupported'); -} -function decode(data, options) { - if (!(data instanceof Uint8Array)) { - throw new Error(`${ common.decodeErrPrefix } data to decode must be a Uint8Array`); - } - options = Object.assign({}, defaultDecodeOptions, options); - const tokeniser = options.tokenizer || new Tokeniser(data, options); - const decoded = tokensToObject(tokeniser, options); - if (decoded === DONE) { - throw new Error(`${ common.decodeErrPrefix } did not find any content to decode`); - } - if (decoded === BREAK) { - throw new Error(`${ common.decodeErrPrefix } got unexpected break`); - } - if (!tokeniser.done()) { - throw new Error(`${ common.decodeErrPrefix } too many terminals, data makes no sense`); - } - return decoded; -} - -exports.Tokeniser = Tokeniser; -exports.decode = decode; -exports.tokensToObject = tokensToObject; - - -/***/ }), - -/***/ 87446: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var is = __nccwpck_require__(30700); -var token = __nccwpck_require__(90915); -var bl = __nccwpck_require__(31889); -var common = __nccwpck_require__(47907); -var jump = __nccwpck_require__(60294); -var byteUtils = __nccwpck_require__(46070); -var _0uint = __nccwpck_require__(80316); -var _1negint = __nccwpck_require__(33709); -var _2bytes = __nccwpck_require__(70195); -var _3string = __nccwpck_require__(49081); -var _4array = __nccwpck_require__(22339); -var _5map = __nccwpck_require__(91440); -var _6tag = __nccwpck_require__(97051); -var _7float = __nccwpck_require__(59213); - -const defaultEncodeOptions = { - float64: false, - mapSorter, - quickEncodeToken: jump.quickEncodeToken -}; -const cborEncoders = []; -cborEncoders[token.Type.uint.major] = _0uint.encodeUint; -cborEncoders[token.Type.negint.major] = _1negint.encodeNegint; -cborEncoders[token.Type.bytes.major] = _2bytes.encodeBytes; -cborEncoders[token.Type.string.major] = _3string.encodeString; -cborEncoders[token.Type.array.major] = _4array.encodeArray; -cborEncoders[token.Type.map.major] = _5map.encodeMap; -cborEncoders[token.Type.tag.major] = _6tag.encodeTag; -cborEncoders[token.Type.float.major] = _7float.encodeFloat; -const buf = new bl.Bl(); -class Ref { - constructor(obj, parent) { - this.obj = obj; - this.parent = parent; - } - includes(obj) { - let p = this; - do { - if (p.obj === obj) { - return true; - } - } while (p = p.parent); - return false; - } - static createCheck(stack, obj) { - if (stack && stack.includes(obj)) { - throw new Error(`${ common.encodeErrPrefix } object contains circular references`); - } - return new Ref(obj, stack); - } -} -const simpleTokens = { - null: new token.Token(token.Type.null, null), - undefined: new token.Token(token.Type.undefined, undefined), - true: new token.Token(token.Type.true, true), - false: new token.Token(token.Type.false, false), - emptyArray: new token.Token(token.Type.array, 0), - emptyMap: new token.Token(token.Type.map, 0) -}; -const typeEncoders = { - number(obj, _typ, _options, _refStack) { - if (!Number.isInteger(obj) || !Number.isSafeInteger(obj)) { - return new token.Token(token.Type.float, obj); - } else if (obj >= 0) { - return new token.Token(token.Type.uint, obj); - } else { - return new token.Token(token.Type.negint, obj); - } - }, - bigint(obj, _typ, _options, _refStack) { - if (obj >= BigInt(0)) { - return new token.Token(token.Type.uint, obj); - } else { - return new token.Token(token.Type.negint, obj); - } - }, - Uint8Array(obj, _typ, _options, _refStack) { - return new token.Token(token.Type.bytes, obj); - }, - string(obj, _typ, _options, _refStack) { - return new token.Token(token.Type.string, obj); - }, - boolean(obj, _typ, _options, _refStack) { - return obj ? simpleTokens.true : simpleTokens.false; - }, - null(_obj, _typ, _options, _refStack) { - return simpleTokens.null; - }, - undefined(_obj, _typ, _options, _refStack) { - return simpleTokens.undefined; - }, - ArrayBuffer(obj, _typ, _options, _refStack) { - return new token.Token(token.Type.bytes, new Uint8Array(obj)); - }, - DataView(obj, _typ, _options, _refStack) { - return new token.Token(token.Type.bytes, new Uint8Array(obj.buffer, obj.byteOffset, obj.byteLength)); - }, - Array(obj, _typ, options, refStack) { - if (!obj.length) { - if (options.addBreakTokens === true) { - return [ - simpleTokens.emptyArray, - new token.Token(token.Type.break) - ]; - } - return simpleTokens.emptyArray; - } - refStack = Ref.createCheck(refStack, obj); - const entries = []; - let i = 0; - for (const e of obj) { - entries[i++] = objectToTokens(e, options, refStack); - } - if (options.addBreakTokens) { - return [ - new token.Token(token.Type.array, obj.length), - entries, - new token.Token(token.Type.break) - ]; - } - return [ - new token.Token(token.Type.array, obj.length), - entries - ]; - }, - Object(obj, typ, options, refStack) { - const isMap = typ !== 'Object'; - const keys = isMap ? obj.keys() : Object.keys(obj); - const length = isMap ? obj.size : keys.length; - if (!length) { - if (options.addBreakTokens === true) { - return [ - simpleTokens.emptyMap, - new token.Token(token.Type.break) - ]; - } - return simpleTokens.emptyMap; - } - refStack = Ref.createCheck(refStack, obj); - const entries = []; - let i = 0; - for (const key of keys) { - entries[i++] = [ - objectToTokens(key, options, refStack), - objectToTokens(isMap ? obj.get(key) : obj[key], options, refStack) - ]; - } - sortMapEntries(entries, options); - if (options.addBreakTokens) { - return [ - new token.Token(token.Type.map, length), - entries, - new token.Token(token.Type.break) - ]; - } - return [ - new token.Token(token.Type.map, length), - entries - ]; - } -}; -typeEncoders.Map = typeEncoders.Object; -typeEncoders.Buffer = typeEncoders.Uint8Array; -for (const typ of 'Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64'.split(' ')) { - typeEncoders[`${ typ }Array`] = typeEncoders.DataView; -} -function objectToTokens(obj, options = {}, refStack) { - const typ = is.is(obj); - const customTypeEncoder = options && options.typeEncoders && options.typeEncoders[typ] || typeEncoders[typ]; - if (typeof customTypeEncoder === 'function') { - const tokens = customTypeEncoder(obj, typ, options, refStack); - if (tokens != null) { - return tokens; - } - } - const typeEncoder = typeEncoders[typ]; - if (!typeEncoder) { - throw new Error(`${ common.encodeErrPrefix } unsupported type: ${ typ }`); - } - return typeEncoder(obj, typ, options, refStack); -} -function sortMapEntries(entries, options) { - if (options.mapSorter) { - entries.sort(options.mapSorter); - } -} -function mapSorter(e1, e2) { - const keyToken1 = Array.isArray(e1[0]) ? e1[0][0] : e1[0]; - const keyToken2 = Array.isArray(e2[0]) ? e2[0][0] : e2[0]; - if (keyToken1.type !== keyToken2.type) { - return keyToken1.type.compare(keyToken2.type); - } - const major = keyToken1.type.major; - const tcmp = cborEncoders[major].compareTokens(keyToken1, keyToken2); - if (tcmp === 0) { - console.warn('WARNING: complex key types used, CBOR key sorting guarantees are gone'); - } - return tcmp; -} -function tokensToEncoded(buf, tokens, encoders, options) { - if (Array.isArray(tokens)) { - for (const token of tokens) { - tokensToEncoded(buf, token, encoders, options); - } - } else { - encoders[tokens.type.major](buf, tokens, options); - } -} -function encodeCustom(data, encoders, options) { - const tokens = objectToTokens(data, options); - if (!Array.isArray(tokens) && options.quickEncodeToken) { - const quickBytes = options.quickEncodeToken(tokens); - if (quickBytes) { - return quickBytes; - } - const encoder = encoders[tokens.type.major]; - if (encoder.encodedSize) { - const size = encoder.encodedSize(tokens, options); - const buf = new bl.Bl(size); - encoder(buf, tokens, options); - if (buf.chunks.length !== 1) { - throw new Error(`Unexpected error: pre-calculated length for ${ tokens } was wrong`); - } - return byteUtils.asU8A(buf.chunks[0]); - } - } - tokensToEncoded(buf, tokens, encoders, options); - return buf.toBytes(true); -} -function encode(data, options) { - options = Object.assign({}, defaultEncodeOptions, options); - return encodeCustom(data, cborEncoders, options); -} - -exports.Ref = Ref; -exports.encode = encode; -exports.encodeCustom = encodeCustom; -exports.objectToTokens = objectToTokens; - - -/***/ }), - -/***/ 30700: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const typeofs = [ - 'string', - 'number', - 'bigint', - 'symbol' -]; -const objectTypeNames = [ - 'Function', - 'Generator', - 'AsyncGenerator', - 'GeneratorFunction', - 'AsyncGeneratorFunction', - 'AsyncFunction', - 'Observable', - 'Array', - 'Buffer', - 'Object', - 'RegExp', - 'Date', - 'Error', - 'Map', - 'Set', - 'WeakMap', - 'WeakSet', - 'ArrayBuffer', - 'SharedArrayBuffer', - 'DataView', - 'Promise', - 'URL', - 'HTMLElement', - 'Int8Array', - 'Uint8Array', - 'Uint8ClampedArray', - 'Int16Array', - 'Uint16Array', - 'Int32Array', - 'Uint32Array', - 'Float32Array', - 'Float64Array', - 'BigInt64Array', - 'BigUint64Array' -]; -function is(value) { - if (value === null) { - return 'null'; - } - if (value === undefined) { - return 'undefined'; - } - if (value === true || value === false) { - return 'boolean'; - } - const typeOf = typeof value; - if (typeofs.includes(typeOf)) { - return typeOf; - } - if (typeOf === 'function') { - return 'Function'; - } - if (Array.isArray(value)) { - return 'Array'; - } - if (isBuffer(value)) { - return 'Buffer'; - } - const objectType = getObjectType(value); - if (objectType) { - return objectType; - } - return 'Object'; -} -function isBuffer(value) { - return value && value.constructor && value.constructor.isBuffer && value.constructor.isBuffer.call(null, value); -} -function getObjectType(value) { - const objectTypeName = Object.prototype.toString.call(value).slice(8, -1); - if (objectTypeNames.includes(objectTypeName)) { - return objectTypeName; - } - return undefined; -} - -exports.is = is; - - -/***/ }), - -/***/ 42029: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var decode$1 = __nccwpck_require__(53216); -var token = __nccwpck_require__(90915); -var byteUtils = __nccwpck_require__(46070); -var common = __nccwpck_require__(47907); - -class Tokenizer { - constructor(data, options = {}) { - this.pos = 0; - this.data = data; - this.options = options; - this.modeStack = ['value']; - this.lastToken = ''; - } - done() { - return this.pos >= this.data.length; - } - ch() { - return this.data[this.pos]; - } - currentMode() { - return this.modeStack[this.modeStack.length - 1]; - } - skipWhitespace() { - let c = this.ch(); - while (c === 32 || c === 9 || c === 13 || c === 10) { - c = this.data[++this.pos]; - } - } - expect(str) { - if (this.data.length - this.pos < str.length) { - throw new Error(`${ common.decodeErrPrefix } unexpected end of input at position ${ this.pos }`); - } - for (let i = 0; i < str.length; i++) { - if (this.data[this.pos++] !== str[i]) { - throw new Error(`${ common.decodeErrPrefix } unexpected token at position ${ this.pos }, expected to find '${ String.fromCharCode(...str) }'`); - } - } - } - parseNumber() { - const startPos = this.pos; - let negative = false; - let float = false; - const swallow = chars => { - while (!this.done()) { - const ch = this.ch(); - if (chars.includes(ch)) { - this.pos++; - } else { - break; - } - } - }; - if (this.ch() === 45) { - negative = true; - this.pos++; - } - if (this.ch() === 48) { - this.pos++; - if (this.ch() === 46) { - this.pos++; - float = true; - } else { - return new token.Token(token.Type.uint, 0, this.pos - startPos); - } - } - swallow([ - 48, - 49, - 50, - 51, - 52, - 53, - 54, - 55, - 56, - 57 - ]); - if (negative && this.pos === startPos + 1) { - throw new Error(`${ common.decodeErrPrefix } unexpected token at position ${ this.pos }`); - } - if (!this.done() && this.ch() === 46) { - if (float) { - throw new Error(`${ common.decodeErrPrefix } unexpected token at position ${ this.pos }`); - } - float = true; - this.pos++; - swallow([ - 48, - 49, - 50, - 51, - 52, - 53, - 54, - 55, - 56, - 57 - ]); - } - if (!this.done() && (this.ch() === 101 || this.ch() === 69)) { - float = true; - this.pos++; - if (!this.done() && (this.ch() === 43 || this.ch() === 45)) { - this.pos++; - } - swallow([ - 48, - 49, - 50, - 51, - 52, - 53, - 54, - 55, - 56, - 57 - ]); - } - const numStr = String.fromCharCode.apply(null, this.data.subarray(startPos, this.pos)); - const num = parseFloat(numStr); - if (float) { - return new token.Token(token.Type.float, num, this.pos - startPos); - } - if (this.options.allowBigInt !== true || Number.isSafeInteger(num)) { - return new token.Token(num >= 0 ? token.Type.uint : token.Type.negint, num, this.pos - startPos); - } - return new token.Token(num >= 0 ? token.Type.uint : token.Type.negint, BigInt(numStr), this.pos - startPos); - } - parseString() { - if (this.ch() !== 34) { - throw new Error(`${ common.decodeErrPrefix } unexpected character at position ${ this.pos }; this shouldn't happen`); - } - this.pos++; - for (let i = this.pos, l = 0; i < this.data.length && l < 65536; i++, l++) { - const ch = this.data[i]; - if (ch === 92 || ch < 32 || ch >= 128) { - break; - } - if (ch === 34) { - const str = String.fromCharCode.apply(null, this.data.subarray(this.pos, i)); - this.pos = i + 1; - return new token.Token(token.Type.string, str, l); - } - } - const startPos = this.pos; - const chars = []; - const readu4 = () => { - if (this.pos + 4 >= this.data.length) { - throw new Error(`${ common.decodeErrPrefix } unexpected end of unicode escape sequence at position ${ this.pos }`); - } - let u4 = 0; - for (let i = 0; i < 4; i++) { - let ch = this.ch(); - if (ch >= 48 && ch <= 57) { - ch -= 48; - } else if (ch >= 97 && ch <= 102) { - ch = ch - 97 + 10; - } else if (ch >= 65 && ch <= 70) { - ch = ch - 65 + 10; - } else { - throw new Error(`${ common.decodeErrPrefix } unexpected unicode escape character at position ${ this.pos }`); - } - u4 = u4 * 16 + ch; - this.pos++; - } - return u4; - }; - const readUtf8Char = () => { - const firstByte = this.ch(); - let codePoint = null; - let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; - if (this.pos + bytesPerSequence > this.data.length) { - throw new Error(`${ common.decodeErrPrefix } unexpected unicode sequence at position ${ this.pos }`); - } - let secondByte, thirdByte, fourthByte, tempCodePoint; - switch (bytesPerSequence) { - case 1: - if (firstByte < 128) { - codePoint = firstByte; - } - break; - case 2: - secondByte = this.data[this.pos + 1]; - if ((secondByte & 192) === 128) { - tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; - if (tempCodePoint > 127) { - codePoint = tempCodePoint; - } - } - break; - case 3: - secondByte = this.data[this.pos + 1]; - thirdByte = this.data[this.pos + 2]; - if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { - tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; - if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { - codePoint = tempCodePoint; - } - } - break; - case 4: - secondByte = this.data[this.pos + 1]; - thirdByte = this.data[this.pos + 2]; - fourthByte = this.data[this.pos + 3]; - if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { - tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; - if (tempCodePoint > 65535 && tempCodePoint < 1114112) { - codePoint = tempCodePoint; - } - } - } - if (codePoint === null) { - codePoint = 65533; - bytesPerSequence = 1; - } else if (codePoint > 65535) { - codePoint -= 65536; - chars.push(codePoint >>> 10 & 1023 | 55296); - codePoint = 56320 | codePoint & 1023; - } - chars.push(codePoint); - this.pos += bytesPerSequence; - }; - while (!this.done()) { - const ch = this.ch(); - let ch1; - switch (ch) { - case 92: - this.pos++; - if (this.done()) { - throw new Error(`${ common.decodeErrPrefix } unexpected string termination at position ${ this.pos }`); - } - ch1 = this.ch(); - this.pos++; - switch (ch1) { - case 34: - case 39: - case 92: - case 47: - chars.push(ch1); - break; - case 98: - chars.push(8); - break; - case 116: - chars.push(9); - break; - case 110: - chars.push(10); - break; - case 102: - chars.push(12); - break; - case 114: - chars.push(13); - break; - case 117: - chars.push(readu4()); - break; - default: - throw new Error(`${ common.decodeErrPrefix } unexpected string escape character at position ${ this.pos }`); - } - break; - case 34: - this.pos++; - return new token.Token(token.Type.string, byteUtils.decodeCodePointsArray(chars), this.pos - startPos); - default: - if (ch < 32) { - throw new Error(`${ common.decodeErrPrefix } invalid control character at position ${ this.pos }`); - } else if (ch < 128) { - chars.push(ch); - this.pos++; - } else { - readUtf8Char(); - } - } - } - throw new Error(`${ common.decodeErrPrefix } unexpected end of string at position ${ this.pos }`); - } - parseValue() { - switch (this.ch()) { - case 123: - this.modeStack.push('obj-start'); - this.pos++; - return new token.Token(token.Type.map, Infinity, 1); - case 91: - this.modeStack.push('array-start'); - this.pos++; - return new token.Token(token.Type.array, Infinity, 1); - case 34: { - return this.parseString(); - } - case 110: - this.expect([ - 110, - 117, - 108, - 108 - ]); - return new token.Token(token.Type.null, null, 4); - case 102: - this.expect([ - 102, - 97, - 108, - 115, - 101 - ]); - return new token.Token(token.Type.false, false, 5); - case 116: - this.expect([ - 116, - 114, - 117, - 101 - ]); - return new token.Token(token.Type.true, true, 4); - case 45: - case 48: - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - return this.parseNumber(); - default: - throw new Error(`${ common.decodeErrPrefix } unexpected character at position ${ this.pos }`); - } - } - next() { - this.skipWhitespace(); - switch (this.currentMode()) { - case 'value': - this.modeStack.pop(); - return this.parseValue(); - case 'array-value': { - this.modeStack.pop(); - if (this.ch() === 93) { - this.pos++; - this.skipWhitespace(); - return new token.Token(token.Type.break, undefined, 1); - } - if (this.ch() !== 44) { - throw new Error(`${ common.decodeErrPrefix } unexpected character at position ${ this.pos }, was expecting array delimiter but found '${ String.fromCharCode(this.ch()) }'`); - } - this.pos++; - this.modeStack.push('array-value'); - this.skipWhitespace(); - return this.parseValue(); - } - case 'array-start': { - this.modeStack.pop(); - if (this.ch() === 93) { - this.pos++; - this.skipWhitespace(); - return new token.Token(token.Type.break, undefined, 1); - } - this.modeStack.push('array-value'); - this.skipWhitespace(); - return this.parseValue(); - } - case 'obj-key': - if (this.ch() === 125) { - this.modeStack.pop(); - this.pos++; - this.skipWhitespace(); - return new token.Token(token.Type.break, undefined, 1); - } - if (this.ch() !== 44) { - throw new Error(`${ common.decodeErrPrefix } unexpected character at position ${ this.pos }, was expecting object delimiter but found '${ String.fromCharCode(this.ch()) }'`); - } - this.pos++; - this.skipWhitespace(); - case 'obj-start': { - this.modeStack.pop(); - if (this.ch() === 125) { - this.pos++; - this.skipWhitespace(); - return new token.Token(token.Type.break, undefined, 1); - } - const token$1 = this.parseString(); - this.skipWhitespace(); - if (this.ch() !== 58) { - throw new Error(`${ common.decodeErrPrefix } unexpected character at position ${ this.pos }, was expecting key/value delimiter ':' but found '${ String.fromCharCode(this.ch()) }'`); - } - this.pos++; - this.modeStack.push('obj-value'); - return token$1; - } - case 'obj-value': { - this.modeStack.pop(); - this.modeStack.push('obj-key'); - this.skipWhitespace(); - return this.parseValue(); - } - default: - throw new Error(`${ common.decodeErrPrefix } unexpected parse state at position ${ this.pos }; this shouldn't happen`); - } - } -} -function decode(data, options) { - options = Object.assign({ tokenizer: new Tokenizer(data, options) }, options); - return decode$1.decode(data, options); -} - -exports.Tokenizer = Tokenizer; -exports.decode = decode; - - -/***/ }), - -/***/ 65805: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var token = __nccwpck_require__(90915); -var encode$1 = __nccwpck_require__(87446); -var common = __nccwpck_require__(47907); -var byteUtils = __nccwpck_require__(46070); - -class JSONEncoder extends Array { - constructor() { - super(); - this.inRecursive = []; - } - prefix(buf) { - const recurs = this.inRecursive[this.inRecursive.length - 1]; - if (recurs) { - if (recurs.type === token.Type.array) { - recurs.elements++; - if (recurs.elements !== 1) { - buf.push([44]); - } - } - if (recurs.type === token.Type.map) { - recurs.elements++; - if (recurs.elements !== 1) { - if (recurs.elements % 2 === 1) { - buf.push([44]); - } else { - buf.push([58]); - } - } - } - } - } - [token.Type.uint.major](buf, token) { - this.prefix(buf); - const is = String(token.value); - const isa = []; - for (let i = 0; i < is.length; i++) { - isa[i] = is.charCodeAt(i); - } - buf.push(isa); - } - [token.Type.negint.major](buf, token$1) { - this[token.Type.uint.major](buf, token$1); - } - [token.Type.bytes.major](_buf, _token) { - throw new Error(`${ common.encodeErrPrefix } unsupported type: Uint8Array`); - } - [token.Type.string.major](buf, token) { - this.prefix(buf); - const byts = byteUtils.fromString(JSON.stringify(token.value)); - buf.push(byts.length > 32 ? byteUtils.asU8A(byts) : byts); - } - [token.Type.array.major](buf, _token) { - this.prefix(buf); - this.inRecursive.push({ - type: token.Type.array, - elements: 0 - }); - buf.push([91]); - } - [token.Type.map.major](buf, _token) { - this.prefix(buf); - this.inRecursive.push({ - type: token.Type.map, - elements: 0 - }); - buf.push([123]); - } - [token.Type.tag.major](_buf, _token) { - } - [token.Type.float.major](buf, token$1) { - if (token$1.type.name === 'break') { - const recurs = this.inRecursive.pop(); - if (recurs) { - if (recurs.type === token.Type.array) { - buf.push([93]); - } else if (recurs.type === token.Type.map) { - buf.push([125]); - } else { - throw new Error('Unexpected recursive type; this should not happen!'); - } - return; - } - throw new Error('Unexpected break; this should not happen!'); - } - if (token$1.value === undefined) { - throw new Error(`${ common.encodeErrPrefix } unsupported type: undefined`); - } - this.prefix(buf); - if (token$1.type.name === 'true') { - buf.push([ - 116, - 114, - 117, - 101 - ]); - return; - } else if (token$1.type.name === 'false') { - buf.push([ - 102, - 97, - 108, - 115, - 101 - ]); - return; - } else if (token$1.type.name === 'null') { - buf.push([ - 110, - 117, - 108, - 108 - ]); - return; - } - const is = String(token$1.value); - const isa = []; - let dp = false; - for (let i = 0; i < is.length; i++) { - isa[i] = is.charCodeAt(i); - if (!dp && (isa[i] === 46 || isa[i] === 101 || isa[i] === 69)) { - dp = true; - } - } - if (!dp) { - isa.push(46); - isa.push(48); - } - buf.push(isa); - } -} -function mapSorter(e1, e2) { - if (Array.isArray(e1[0]) || Array.isArray(e2[0])) { - throw new Error(`${ common.encodeErrPrefix } complex map keys are not supported`); - } - const keyToken1 = e1[0]; - const keyToken2 = e2[0]; - if (keyToken1.type !== token.Type.string || keyToken2.type !== token.Type.string) { - throw new Error(`${ common.encodeErrPrefix } non-string map keys are not supported`); - } - if (keyToken1 < keyToken2) { - return -1; - } - if (keyToken1 > keyToken2) { - return 1; - } - throw new Error(`${ common.encodeErrPrefix } unexpected duplicate map keys, this is not supported`); -} -const defaultEncodeOptions = { - addBreakTokens: true, - mapSorter -}; -function encode(data, options) { - options = Object.assign({}, defaultEncodeOptions, options); - return encode$1.encodeCustom(data, new JSONEncoder(), options); -} - -exports.encode = encode; - - -/***/ }), - -/***/ 81342: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var encode = __nccwpck_require__(65805); -var decode = __nccwpck_require__(42029); - - - -exports.encode = encode.encode; -exports.Tokenizer = decode.Tokenizer; -exports.decode = decode.decode; - - -/***/ }), - -/***/ 60294: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var token = __nccwpck_require__(90915); -var _0uint = __nccwpck_require__(80316); -var _1negint = __nccwpck_require__(33709); -var _2bytes = __nccwpck_require__(70195); -var _3string = __nccwpck_require__(49081); -var _4array = __nccwpck_require__(22339); -var _5map = __nccwpck_require__(91440); -var _6tag = __nccwpck_require__(97051); -var _7float = __nccwpck_require__(59213); -var common = __nccwpck_require__(47907); -var byteUtils = __nccwpck_require__(46070); - -function invalidMinor(data, pos, minor) { - throw new Error(`${ common.decodeErrPrefix } encountered invalid minor (${ minor }) for major ${ data[pos] >>> 5 }`); -} -function errorer(msg) { - return () => { - throw new Error(`${ common.decodeErrPrefix } ${ msg }`); - }; -} -const jump = []; -for (let i = 0; i <= 23; i++) { - jump[i] = invalidMinor; -} -jump[24] = _0uint.decodeUint8; -jump[25] = _0uint.decodeUint16; -jump[26] = _0uint.decodeUint32; -jump[27] = _0uint.decodeUint64; -jump[28] = invalidMinor; -jump[29] = invalidMinor; -jump[30] = invalidMinor; -jump[31] = invalidMinor; -for (let i = 32; i <= 55; i++) { - jump[i] = invalidMinor; -} -jump[56] = _1negint.decodeNegint8; -jump[57] = _1negint.decodeNegint16; -jump[58] = _1negint.decodeNegint32; -jump[59] = _1negint.decodeNegint64; -jump[60] = invalidMinor; -jump[61] = invalidMinor; -jump[62] = invalidMinor; -jump[63] = invalidMinor; -for (let i = 64; i <= 87; i++) { - jump[i] = _2bytes.decodeBytesCompact; -} -jump[88] = _2bytes.decodeBytes8; -jump[89] = _2bytes.decodeBytes16; -jump[90] = _2bytes.decodeBytes32; -jump[91] = _2bytes.decodeBytes64; -jump[92] = invalidMinor; -jump[93] = invalidMinor; -jump[94] = invalidMinor; -jump[95] = errorer('indefinite length bytes/strings are not supported'); -for (let i = 96; i <= 119; i++) { - jump[i] = _3string.decodeStringCompact; -} -jump[120] = _3string.decodeString8; -jump[121] = _3string.decodeString16; -jump[122] = _3string.decodeString32; -jump[123] = _3string.decodeString64; -jump[124] = invalidMinor; -jump[125] = invalidMinor; -jump[126] = invalidMinor; -jump[127] = errorer('indefinite length bytes/strings are not supported'); -for (let i = 128; i <= 151; i++) { - jump[i] = _4array.decodeArrayCompact; -} -jump[152] = _4array.decodeArray8; -jump[153] = _4array.decodeArray16; -jump[154] = _4array.decodeArray32; -jump[155] = _4array.decodeArray64; -jump[156] = invalidMinor; -jump[157] = invalidMinor; -jump[158] = invalidMinor; -jump[159] = _4array.decodeArrayIndefinite; -for (let i = 160; i <= 183; i++) { - jump[i] = _5map.decodeMapCompact; -} -jump[184] = _5map.decodeMap8; -jump[185] = _5map.decodeMap16; -jump[186] = _5map.decodeMap32; -jump[187] = _5map.decodeMap64; -jump[188] = invalidMinor; -jump[189] = invalidMinor; -jump[190] = invalidMinor; -jump[191] = _5map.decodeMapIndefinite; -for (let i = 192; i <= 215; i++) { - jump[i] = _6tag.decodeTagCompact; -} -jump[216] = _6tag.decodeTag8; -jump[217] = _6tag.decodeTag16; -jump[218] = _6tag.decodeTag32; -jump[219] = _6tag.decodeTag64; -jump[220] = invalidMinor; -jump[221] = invalidMinor; -jump[222] = invalidMinor; -jump[223] = invalidMinor; -for (let i = 224; i <= 243; i++) { - jump[i] = errorer('simple values are not supported'); -} -jump[244] = invalidMinor; -jump[245] = invalidMinor; -jump[246] = invalidMinor; -jump[247] = _7float.decodeUndefined; -jump[248] = errorer('simple values are not supported'); -jump[249] = _7float.decodeFloat16; -jump[250] = _7float.decodeFloat32; -jump[251] = _7float.decodeFloat64; -jump[252] = invalidMinor; -jump[253] = invalidMinor; -jump[254] = invalidMinor; -jump[255] = _7float.decodeBreak; -const quick = []; -for (let i = 0; i < 24; i++) { - quick[i] = new token.Token(token.Type.uint, i, 1); -} -for (let i = -1; i >= -24; i--) { - quick[31 - i] = new token.Token(token.Type.negint, i, 1); -} -quick[64] = new token.Token(token.Type.bytes, new Uint8Array(0), 1); -quick[96] = new token.Token(token.Type.string, '', 1); -quick[128] = new token.Token(token.Type.array, 0, 1); -quick[160] = new token.Token(token.Type.map, 0, 1); -quick[244] = new token.Token(token.Type.false, false, 1); -quick[245] = new token.Token(token.Type.true, true, 1); -quick[246] = new token.Token(token.Type.null, null, 1); -function quickEncodeToken(token$1) { - switch (token$1.type) { - case token.Type.false: - return byteUtils.fromArray([244]); - case token.Type.true: - return byteUtils.fromArray([245]); - case token.Type.null: - return byteUtils.fromArray([246]); - case token.Type.bytes: - if (!token$1.value.length) { - return byteUtils.fromArray([64]); - } - return; - case token.Type.string: - if (token$1.value === '') { - return byteUtils.fromArray([96]); - } - return; - case token.Type.array: - if (token$1.value === 0) { - return byteUtils.fromArray([128]); - } - return; - case token.Type.map: - if (token$1.value === 0) { - return byteUtils.fromArray([160]); - } - return; - case token.Type.uint: - if (token$1.value < 24) { - return byteUtils.fromArray([Number(token$1.value)]); - } - return; - case token.Type.negint: - if (token$1.value >= -24) { - return byteUtils.fromArray([31 - Number(token$1.value)]); - } - } -} - -exports.jump = jump; -exports.quick = quick; -exports.quickEncodeToken = quickEncodeToken; - - -/***/ }), - -/***/ 90915: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -class Type { - constructor(major, name, terminal) { - this.major = major; - this.majorEncoded = major << 5; - this.name = name; - this.terminal = terminal; - } - toString() { - return `Type[${ this.major }].${ this.name }`; - } - compare(typ) { - return this.major < typ.major ? -1 : this.major > typ.major ? 1 : 0; - } -} -Type.uint = new Type(0, 'uint', true); -Type.negint = new Type(1, 'negint', true); -Type.bytes = new Type(2, 'bytes', true); -Type.string = new Type(3, 'string', true); -Type.array = new Type(4, 'array', false); -Type.map = new Type(5, 'map', false); -Type.tag = new Type(6, 'tag', false); -Type.float = new Type(7, 'float', true); -Type.false = new Type(7, 'false', true); -Type.true = new Type(7, 'true', true); -Type.null = new Type(7, 'null', true); -Type.undefined = new Type(7, 'undefined', true); -Type.break = new Type(7, 'break', true); -class Token { - constructor(type, value, encodedLength) { - this.type = type; - this.value = value; - this.encodedLength = encodedLength; - this.encodedBytes = undefined; - } - toString() { - return `Token[${ this.type }].${ this.value }`; - } -} - -exports.Token = Token; -exports.Type = Type; - - -/***/ }), - -/***/ 86421: -/***/ ((module) => { - -"use strict"; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - -function withIs(Class, { className, symbolName }) { - const symbol = Symbol.for(symbolName); - - const ClassIsWrapper = { - // The code below assigns the class wrapper to an object to trick - // JavaScript engines to show the name of the extended class when - // logging an instances. - // We are assigning an anonymous class (class wrapper) to the object - // with key `className` to keep the correct name. - // If this is not supported it falls back to logging `ClassIsWrapper`. - [className]: class extends Class { - constructor(...args) { - super(...args); - Object.defineProperty(this, symbol, { value: true }); - } - - get [Symbol.toStringTag]() { - return className; - } - }, - }[className]; - - ClassIsWrapper[`is${className}`] = (obj) => !!(obj && obj[symbol]); - - return ClassIsWrapper; -} - -function withIsProto(Class, { className, symbolName, withoutNew }) { - const symbol = Symbol.for(symbolName); - - /* eslint-disable object-shorthand */ - const ClassIsWrapper = { - [className]: function (...args) { - if (withoutNew && !(this instanceof ClassIsWrapper)) { - return new ClassIsWrapper(...args); - } - - const _this = Class.call(this, ...args) || this; - - if (_this && !_this[symbol]) { - Object.defineProperty(_this, symbol, { value: true }); - } - - return _this; - }, - }[className]; - /* eslint-enable object-shorthand */ - - ClassIsWrapper.prototype = Object.create(Class.prototype); - ClassIsWrapper.prototype.constructor = ClassIsWrapper; - - Object.defineProperty(ClassIsWrapper.prototype, Symbol.toStringTag, { - get() { - return className; - }, - }); - - ClassIsWrapper[`is${className}`] = (obj) => !!(obj && obj[symbol]); - - return ClassIsWrapper; -} - -module.exports = withIs; -module.exports.proto = withIsProto; - - -/***/ }), - -<<<<<<< HEAD -/***/ 69715: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var util = __nccwpck_require__(73837); -var Stream = (__nccwpck_require__(12781).Stream); -var DelayedStream = __nccwpck_require__(96382); - -module.exports = CombinedStream; -function CombinedStream() { - this.writable = false; - this.readable = true; - this.dataSize = 0; - this.maxDataSize = 2 * 1024 * 1024; - this.pauseStreams = true; - - this._released = false; - this._streams = []; - this._currentStream = null; - this._insideLoop = false; - this._pendingNext = false; -} -util.inherits(CombinedStream, Stream); - -CombinedStream.create = function(options) { - var combinedStream = new this(); - - options = options || {}; - for (var option in options) { - combinedStream[option] = options[option]; - } - - return combinedStream; -}; - -CombinedStream.isStreamLike = function(stream) { - return (typeof stream !== 'function') - && (typeof stream !== 'string') - && (typeof stream !== 'boolean') - && (typeof stream !== 'number') - && (!Buffer.isBuffer(stream)); -}; - -CombinedStream.prototype.append = function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - - if (isStreamLike) { - if (!(stream instanceof DelayedStream)) { - var newStream = DelayedStream.create(stream, { - maxDataSize: Infinity, - pauseStream: this.pauseStreams, - }); - stream.on('data', this._checkDataSize.bind(this)); - stream = newStream; - } - - this._handleErrors(stream); - - if (this.pauseStreams) { - stream.pause(); - } - } - - this._streams.push(stream); - return this; -}; - -CombinedStream.prototype.pipe = function(dest, options) { - Stream.prototype.pipe.call(this, dest, options); - this.resume(); - return dest; -}; - -CombinedStream.prototype._getNext = function() { - this._currentStream = null; - - if (this._insideLoop) { - this._pendingNext = true; - return; // defer call - } - - this._insideLoop = true; - try { - do { - this._pendingNext = false; - this._realGetNext(); - } while (this._pendingNext); - } finally { - this._insideLoop = false; - } -}; - -CombinedStream.prototype._realGetNext = function() { - var stream = this._streams.shift(); - - - if (typeof stream == 'undefined') { - this.end(); - return; - } - - if (typeof stream !== 'function') { - this._pipeNext(stream); - return; - } - - var getStream = stream; - getStream(function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('data', this._checkDataSize.bind(this)); - this._handleErrors(stream); - } - - this._pipeNext(stream); - }.bind(this)); -}; - -CombinedStream.prototype._pipeNext = function(stream) { - this._currentStream = stream; - - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('end', this._getNext.bind(this)); - stream.pipe(this, {end: false}); - return; - } - - var value = stream; - this.write(value); - this._getNext(); -}; - -CombinedStream.prototype._handleErrors = function(stream) { - var self = this; - stream.on('error', function(err) { - self._emitError(err); - }); -}; - -CombinedStream.prototype.write = function(data) { - this.emit('data', data); -}; - -CombinedStream.prototype.pause = function() { - if (!this.pauseStreams) { - return; - } - - if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); - this.emit('pause'); -}; - -CombinedStream.prototype.resume = function() { - if (!this._released) { - this._released = true; - this.writable = true; - this._getNext(); - } - - if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); - this.emit('resume'); -}; - -CombinedStream.prototype.end = function() { - this._reset(); - this.emit('end'); -}; - -CombinedStream.prototype.destroy = function() { - this._reset(); - this.emit('close'); -}; - -CombinedStream.prototype._reset = function() { - this.writable = false; - this._streams = []; - this._currentStream = null; -}; - -CombinedStream.prototype._checkDataSize = function() { - this._updateDataSize(); - if (this.dataSize <= this.maxDataSize) { - return; - } - - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; - this._emitError(new Error(message)); -}; - -CombinedStream.prototype._updateDataSize = function() { - this.dataSize = 0; - - var self = this; - this._streams.forEach(function(stream) { - if (!stream.dataSize) { - return; - } - - self.dataSize += stream.dataSize; - }); - - if (this._currentStream && this._currentStream.dataSize) { - this.dataSize += this._currentStream.dataSize; - } -}; - -CombinedStream.prototype._emitError = function(err) { - this._reset(); - this.emit('error', err); -}; - - -/***/ }), - -/***/ 42054: -======= -/***/ 73132: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; - -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; - - -/***/ }), - -<<<<<<< HEAD -/***/ 77442: -======= -/***/ 43102: -/***/ ((module) => { - -"use strict"; - -/** - * Returns a `Buffer` instance from the given data URI `uri`. - * - * @param {String} uri Data URI to turn into a Buffer instance - * @return {Buffer} Buffer instance from Data URI - * @api public - */ -function dataUriToBuffer(uri) { - if (!/^data:/i.test(uri)) { - throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")'); - } - // strip newlines - uri = uri.replace(/\r?\n/g, ''); - // split the URI up into the "metadata" and the "data" portions - const firstComma = uri.indexOf(','); - if (firstComma === -1 || firstComma <= 4) { - throw new TypeError('malformed data: URI'); - } - // remove the "data:" scheme and parse the metadata - const meta = uri.substring(5, firstComma).split(';'); - let charset = ''; - let base64 = false; - const type = meta[0] || 'text/plain'; - let typeFull = type; - for (let i = 1; i < meta.length; i++) { - if (meta[i] === 'base64') { - base64 = true; - } - else { - typeFull += `;${meta[i]}`; - if (meta[i].indexOf('charset=') === 0) { - charset = meta[i].substring(8); - } - } - } - // defaults to US-ASCII only if type is not provided - if (!meta[0] && !charset.length) { - typeFull += ';charset=US-ASCII'; - charset = 'US-ASCII'; - } - // get the encoded data portion and decode URI-encoded chars - const encoding = base64 ? 'base64' : 'ascii'; - const data = unescape(uri.substring(firstComma + 1)); - const buffer = Buffer.from(data, encoding); - // set `.type` and `.typeFull` properties to MIME type - buffer.type = type; - buffer.typeFull = typeFull; - // set the `.charset` property - buffer.charset = charset; - return buffer; -} -module.exports = dataUriToBuffer; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 15524: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, exports, __nccwpck_require__) => { - -/* eslint-env browser */ - -/** - * This is the web browser implementation of `debug()`. - */ - -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = localstorage(); -exports.destroy = (() => { - let warned = false; - - return () => { - if (!warned) { - warned = true; - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - }; -})(); - -/** - * Colors. - */ - -exports.colors = [ - '#0000CC', - '#0000FF', - '#0033CC', - '#0033FF', - '#0066CC', - '#0066FF', - '#0099CC', - '#0099FF', - '#00CC00', - '#00CC33', - '#00CC66', - '#00CC99', - '#00CCCC', - '#00CCFF', - '#3300CC', - '#3300FF', - '#3333CC', - '#3333FF', - '#3366CC', - '#3366FF', - '#3399CC', - '#3399FF', - '#33CC00', - '#33CC33', - '#33CC66', - '#33CC99', - '#33CCCC', - '#33CCFF', - '#6600CC', - '#6600FF', - '#6633CC', - '#6633FF', - '#66CC00', - '#66CC33', - '#9900CC', - '#9900FF', - '#9933CC', - '#9933FF', - '#99CC00', - '#99CC33', - '#CC0000', - '#CC0033', - '#CC0066', - '#CC0099', - '#CC00CC', - '#CC00FF', - '#CC3300', - '#CC3333', - '#CC3366', - '#CC3399', - '#CC33CC', - '#CC33FF', - '#CC6600', - '#CC6633', - '#CC9900', - '#CC9933', - '#CCCC00', - '#CCCC33', - '#FF0000', - '#FF0033', - '#FF0066', - '#FF0099', - '#FF00CC', - '#FF00FF', - '#FF3300', - '#FF3333', - '#FF3366', - '#FF3399', - '#FF33CC', - '#FF33FF', - '#FF6600', - '#FF6633', - '#FF9900', - '#FF9933', - '#FFCC00', - '#FFCC33' -]; - -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - -// eslint-disable-next-line complexity -function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { - return true; - } - - // Internet Explorer and Edge do not support colors. - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - - // Is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || - // Is firebug? http://stackoverflow.com/a/398120/376773 - (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || - // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || - // Double check webkit in userAgent just in case we are in a worker - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); -} - -/** - * Colorize log arguments if enabled. - * - * @api public - */ - -function formatArgs(args) { - args[0] = (this.useColors ? '%c' : '') + - this.namespace + - (this.useColors ? ' %c' : ' ') + - args[0] + - (this.useColors ? '%c ' : ' ') + - '+' + module.exports.humanize(this.diff); - - if (!this.useColors) { - return; - } - - const c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit'); - - // The final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, match => { - if (match === '%%') { - return; - } - index++; - if (match === '%c') { - // We only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - - args.splice(lastC, 0, c); -} - -/** - * Invokes `console.debug()` when available. - * No-op when `console.debug` is not a "function". - * If `console.debug` is not available, falls back - * to `console.log`. - * - * @api public - */ -exports.log = console.debug || console.log || (() => {}); - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem('debug', namespaces); - } else { - exports.storage.removeItem('debug'); - } - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ -function load() { - let r; - try { - r = exports.storage.getItem('debug'); - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } - - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - if (!r && typeof process !== 'undefined' && 'env' in process) { - r = process.env.DEBUG; - } - - return r; -} - -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - -function localstorage() { - try { - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context - // The Browser also has localStorage in the global context. - return localStorage; - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} - -<<<<<<< HEAD -module.exports = __nccwpck_require__(63469)(exports); -======= -module.exports = __nccwpck_require__(46881)(exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -const {formatters} = module.exports; - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -formatters.j = function (v) { - try { - return JSON.stringify(v); - } catch (error) { - return '[UnexpectedJSONParseError]: ' + error.message; - } -}; - - -/***/ }), - -<<<<<<< HEAD -/***/ 63469: -======= -/***/ 46881: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - */ - -function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; -<<<<<<< HEAD - createDebug.humanize = __nccwpck_require__(20603); -======= - createDebug.humanize = __nccwpck_require__(3562); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - createDebug.destroy = destroy; - - Object.keys(env).forEach(key => { - createDebug[key] = env[key]; - }); - - /** - * The currently active debug mode names, and names to skip. - */ - - createDebug.names = []; - createDebug.skips = []; - - /** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ - createDebug.formatters = {}; - - /** - * Selects a color for a debug namespace - * @param {String} namespace The namespace string for the debug instance to be colored - * @return {Number|String} An ANSI color code for the given namespace - * @api private - */ - function selectColor(namespace) { - let hash = 0; - - for (let i = 0; i < namespace.length; i++) { - hash = ((hash << 5) - hash) + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } - - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - - /** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - - function debug(...args) { - // Disabled? - if (!debug.enabled) { - return; - } - - const self = debug; - - // Set `diff` timestamp - const curr = Number(new Date()); - const ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - args[0] = createDebug.coerce(args[0]); - - if (typeof args[0] !== 'string') { - // Anything else let's inspect with %O - args.unshift('%O'); - } - - // Apply any `formatters` transformations - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return '%'; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === 'function') { - const val = args[index]; - match = formatter.call(self, val); - - // Now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - // Apply env-specific formatting (colors, etc.) - createDebug.formatArgs.call(self, args); - - const logFn = self.log || createDebug.log; - logFn.apply(self, args); - } - - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend; - debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. - - Object.defineProperty(debug, 'enabled', { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - - return enabledCache; - }, - set: v => { - enableOverride = v; - } - }); - - // Env-specific initialization logic for debug instances - if (typeof createDebug.init === 'function') { - createDebug.init(debug); - } - - return debug; - } - - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - - /** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - - createDebug.names = []; - createDebug.skips = []; - - let i; - const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - const len = split.length; - - for (i = 0; i < len; i++) { - if (!split[i]) { - // ignore empty strings - continue; - } - - namespaces = split[i].replace(/\*/g, '.*?'); - - if (namespaces[0] === '-') { - createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); - } else { - createDebug.names.push(new RegExp('^' + namespaces + '$')); - } - } - } - - /** - * Disable debug output. - * - * @return {String} namespaces - * @api public - */ - function disable() { - const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) - ].join(','); - createDebug.enable(''); - return namespaces; - } - - /** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - function enabled(name) { - if (name[name.length - 1] === '*') { - return true; - } - - let i; - let len; - - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { - return false; - } - } - - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { - return true; - } - } - - return false; - } - - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - function toNamespace(regexp) { - return regexp.toString() - .substring(2, regexp.toString().length - 2) - .replace(/\.\*\?$/, '*'); - } - - /** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - - /** - * XXX DO NOT USE. This is a temporary stub function. - * XXX It WILL be removed in the next major release. - */ - function destroy() { - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - - createDebug.enable(createDebug.load()); - - return createDebug; -} - -module.exports = setup; - - -/***/ }), - -<<<<<<< HEAD -/***/ 80908: -======= -/***/ 58923: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -/** - * Detect Electron renderer / nwjs process, which is node, but we should - * treat as a browser. - */ - -if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { -<<<<<<< HEAD - module.exports = __nccwpck_require__(77442); -} else { - module.exports = __nccwpck_require__(23258); -======= - module.exports = __nccwpck_require__(15524); -} else { - module.exports = __nccwpck_require__(21251); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -} - - -/***/ }), - -<<<<<<< HEAD -/***/ 23258: -======= -/***/ 21251: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, exports, __nccwpck_require__) => { - -/** - * Module dependencies. - */ - -const tty = __nccwpck_require__(76224); -const util = __nccwpck_require__(73837); - -/** - * This is the Node.js implementation of `debug()`. - */ - -exports.init = init; -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.destroy = util.deprecate( - () => {}, - 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' -); - -/** - * Colors. - */ - -exports.colors = [6, 2, 3, 4, 5, 1]; - -try { - // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) - // eslint-disable-next-line import/no-extraneous-dependencies -<<<<<<< HEAD - const supportsColor = __nccwpck_require__(4147); -======= - const supportsColor = __nccwpck_require__(76463); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } -} catch (error) { - // Swallow - we only care if `supports-color` is available; it doesn't have to be. -} - -/** - * Build up the default `inspectOpts` object from the environment variables. - * - * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js - */ - -exports.inspectOpts = Object.keys(process.env).filter(key => { - return /^debug_/i.test(key); -}).reduce((obj, key) => { - // Camel-case - const prop = key - .substring(6) - .toLowerCase() - .replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); - - // Coerce string value into JS value - let val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === 'null') { - val = null; - } else { - val = Number(val); - } - - obj[prop] = val; - return obj; -}, {}); - -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ - -function useColors() { - return 'colors' in exports.inspectOpts ? - Boolean(exports.inspectOpts.colors) : - tty.isatty(process.stderr.fd); -} - -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ - -function formatArgs(args) { - const {namespace: name, useColors} = this; - - if (useColors) { - const c = this.color; - const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); - const prefix = ` ${colorCode};1m${name} \u001B[0m`; - - args[0] = prefix + args[0].split('\n').join('\n' + prefix); - args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); - } else { - args[0] = getDate() + name + ' ' + args[0]; - } -} - -function getDate() { - if (exports.inspectOpts.hideDate) { - return ''; - } - return new Date().toISOString() + ' '; -} - -/** - * Invokes `util.format()` with the specified arguments and writes to stderr. - */ - -function log(...args) { - return process.stderr.write(util.format(...args) + '\n'); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - return process.env.DEBUG; -} - -/** - * Init logic for `debug` instances. - * - * Create a new `inspectOpts` object in case `useColors` is set - * differently for a particular `debug` instance. - */ - -function init(debug) { - debug.inspectOpts = {}; - - const keys = Object.keys(exports.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } -} - -<<<<<<< HEAD -module.exports = __nccwpck_require__(63469)(exports); -======= -module.exports = __nccwpck_require__(46881)(exports); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -const {formatters} = module.exports; - -/** - * Map %o to `util.inspect()`, all on a single line. - */ - -formatters.o = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts) - .split('\n') - .map(str => str.trim()) - .join(' '); -}; - -/** - * Map %O to `util.inspect()`, allowing multiple lines if needed. - */ - -formatters.O = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); -}; - - -/***/ }), - -<<<<<<< HEAD -/***/ 96382: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var Stream = (__nccwpck_require__(12781).Stream); -var util = __nccwpck_require__(73837); - -module.exports = DelayedStream; -function DelayedStream() { - this.source = null; - this.dataSize = 0; - this.maxDataSize = 1024 * 1024; - this.pauseStream = true; - - this._maxDataSizeExceeded = false; - this._released = false; - this._bufferedEvents = []; -} -util.inherits(DelayedStream, Stream); - -DelayedStream.create = function(source, options) { - var delayedStream = new this(); - - options = options || {}; - for (var option in options) { - delayedStream[option] = options[option]; - } - - delayedStream.source = source; - - var realEmit = source.emit; - source.emit = function() { - delayedStream._handleEmit(arguments); - return realEmit.apply(source, arguments); - }; - - source.on('error', function() {}); - if (delayedStream.pauseStream) { - source.pause(); - } - - return delayedStream; -}; - -Object.defineProperty(DelayedStream.prototype, 'readable', { - configurable: true, - enumerable: true, - get: function() { - return this.source.readable; - } -}); - -DelayedStream.prototype.setEncoding = function() { - return this.source.setEncoding.apply(this.source, arguments); -}; - -DelayedStream.prototype.resume = function() { - if (!this._released) { - this.release(); - } - - this.source.resume(); -}; - -DelayedStream.prototype.pause = function() { - this.source.pause(); -}; - -DelayedStream.prototype.release = function() { - this._released = true; - - this._bufferedEvents.forEach(function(args) { - this.emit.apply(this, args); - }.bind(this)); - this._bufferedEvents = []; -}; - -DelayedStream.prototype.pipe = function() { - var r = Stream.prototype.pipe.apply(this, arguments); - this.resume(); - return r; -}; - -DelayedStream.prototype._handleEmit = function(args) { - if (this._released) { - this.emit.apply(this, args); - return; - } - - if (args[0] === 'data') { - this.dataSize += args[1].length; - this._checkIfMaxDataSizeExceeded(); - } - - this._bufferedEvents.push(args); -}; - -DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { - if (this._maxDataSizeExceeded) { - return; - } - - if (this.dataSize <= this.maxDataSize) { - return; - } - - this._maxDataSizeExceeded = true; - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' - this.emit('error', new Error(message)); -}; - - -/***/ }), - -/***/ 40454: -======= -/***/ 17320: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { - - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -class Deprecation extends Error { - constructor(message) { - super(message); // Maintains proper stack trace (only available on V8) - - /* istanbul ignore next */ - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - - this.name = 'Deprecation'; - } - -} - -exports.Deprecation = Deprecation; - - -/***/ }), - -<<<<<<< HEAD -/***/ 37647: -======= -/***/ 8281: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var url = __nccwpck_require__(57310); -var http = __nccwpck_require__(13685); -var https = __nccwpck_require__(95687); -var zlib = __nccwpck_require__(59796); -var Stream = __nccwpck_require__(12781); -<<<<<<< HEAD -var encoding = __nccwpck_require__(1086); -======= -var encoding = __nccwpck_require__(73931); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n["default"] = e; - return Object.freeze(n); -} - -var http__namespace = /*#__PURE__*/_interopNamespace(http); -var https__namespace = /*#__PURE__*/_interopNamespace(https); -var zlib__namespace = /*#__PURE__*/_interopNamespace(zlib); -var Stream__default = /*#__PURE__*/_interopDefaultLegacy(Stream); - -function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); -} - -function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - - return arr2; -} - -function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; - if (it) return (it = it.call(o)).next.bind(it); - - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} - -// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js -// (MIT licensed) -const BUFFER = Symbol('buffer'); -const TYPE = Symbol('type'); -const CLOSED = Symbol('closed'); -class Blob { - constructor() { - Object.defineProperty(this, Symbol.toStringTag, { - value: 'Blob', - writable: false, - enumerable: false, - configurable: true - }); - this[CLOSED] = false; - this[TYPE] = ''; - const blobParts = arguments[0]; - const options = arguments[1]; - const buffers = []; - - if (blobParts) { - const a = blobParts; - const length = Number(a.length); - - for (let i = 0; i < length; i++) { - const element = a[i]; - let buffer; - - if (element instanceof Buffer) { - buffer = element; - } else if (ArrayBuffer.isView(element)) { - buffer = Buffer.from(new Uint8Array(element.buffer, element.byteOffset, element.byteLength)); - } else if (element instanceof ArrayBuffer) { - buffer = Buffer.from(new Uint8Array(element)); - } else if (element instanceof Blob) { - buffer = element[BUFFER]; - } else { - buffer = Buffer.from(typeof element === 'string' ? element : String(element)); - } - - buffers.push(buffer); - } - } - - this[BUFFER] = Buffer.concat(buffers); - const type = options && options.type !== undefined && String(options.type).toLowerCase(); - - if (type && !/[^\u0020-\u007E]/.test(type)) { - this[TYPE] = type; - } - } - - get size() { - return this[CLOSED] ? 0 : this[BUFFER].length; - } - - get type() { - return this[TYPE]; - } - - get isClosed() { - return this[CLOSED]; - } - - slice() { - const size = this.size; - const start = arguments[0]; - const end = arguments[1]; - let relativeStart, relativeEnd; - - if (start === undefined) { - relativeStart = 0; - } else if (start < 0) { - relativeStart = Math.max(size + start, 0); - } else { - relativeStart = Math.min(start, size); - } - - if (end === undefined) { - relativeEnd = size; - } else if (end < 0) { - relativeEnd = Math.max(size + end, 0); - } else { - relativeEnd = Math.min(end, size); - } - - const span = Math.max(relativeEnd - relativeStart, 0); - const buffer = this[BUFFER]; - const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); - const blob = new Blob([], { - type: arguments[2] - }); - blob[BUFFER] = slicedBuffer; - blob[CLOSED] = this[CLOSED]; - return blob; - } - - close() { - this[CLOSED] = true; - } - -} -Object.defineProperty(Blob.prototype, Symbol.toStringTag, { - value: 'BlobPrototype', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * fetch-error.js - * - * FetchError interface for operational errors - */ - -/** - * Create FetchError instance - * - * @param {string} message Error message for human - * @param {string} type Error type for machine - * @param {string} systemError For Node.js system error - * @return {FetchError} - */ -const netErrorMap = { - ERR_CONNECTION_REFUSED: 'ECONNREFUSED', - ERR_EMPTY_RESPONSE: 'ECONNRESET', - ERR_NAME_NOT_RESOLVED: 'ENOTFOUND', - ERR_CONTENT_DECODING_FAILED: 'Z_DATA_ERROR', - ERR_CONTENT_DECODING_INIT_FAILED: 'Z_DATA_ERROR' -}; -function FetchError(message, type, systemError) { - Error.call(this, message); - const regex = /^.*net::(.*)/; - - if (regex.test(message)) { - let errorCode = regex.exec(message)[1]; // istanbul ignore else - - if (Object.prototype.hasOwnProperty.call(netErrorMap, errorCode)) errorCode = netErrorMap[errorCode]; - systemError = { - code: errorCode - }; - } - - this.message = message; - this.type = type; // when err.type is `system`, err.code contains system error code - - if (systemError) { - this.code = this.errno = systemError.code; - } // hide custom error implementation details from end-users - - - Error.captureStackTrace(this, this.constructor); -} -FetchError.prototype = Object.create(Error.prototype); -FetchError.prototype.constructor = FetchError; -FetchError.prototype.name = 'FetchError'; - -const DISTURBED = Symbol('disturbed'); -/** - * Body class - * - * Cannot use ES6 class because Body must be called with .call(). - * - * @param {Stream|string|Blob|Buffer|null} body Readable stream - * @param {number} size - * @param {number} timeout - */ - -function Body(body, { - size = 0, - timeout = 0 -} = {}) { - if (body == null) { - // body is undefined or null - body = null; - } else if (typeof body === 'string') ; else if (body instanceof Blob) ; else if (Buffer.isBuffer(body)) ; else if (body instanceof Stream__default["default"]) ; else { - // none of the above - // coerce to string - body = String(body); - } - - this.body = body; - this[DISTURBED] = false; - this.size = size; - this.timeout = timeout; -} -Body.prototype = { - get bodyUsed() { - return this[DISTURBED]; - }, - - /** - * Decode response as ArrayBuffer - * - * @return {Promise} - */ - arrayBuffer() { - return consumeBody.call(this).then(buf => buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength)); - }, - - /** - * Return raw response as Blob - * - * @return {Promise} - */ - blob() { - const ct = this.headers && this.headers.get('content-type') || ''; - return consumeBody.call(this).then(buf => Object.assign( // Prevent copying - new Blob([], { - type: ct.toLowerCase() - }), { - [BUFFER]: buf - })); - }, - - /** - * Decode response as json - * - * @return {Promise} - */ - json() { - return consumeBody.call(this).then(buffer => JSON.parse(buffer.toString())); - }, - - /** - * Decode response as text - * - * @return {Promise} - */ - text() { - return consumeBody.call(this).then(buffer => buffer.toString()); - }, - - /** - * Decode response as buffer (non-spec api) - * - * @return {Promise} - */ - buffer() { - return consumeBody.call(this); - }, - - /** - * Decode response as text, while automatically detecting the encoding and - * trying to decode to UTF-8 (non-spec api) - * - * @return {Promise} - */ - textConverted() { - return consumeBody.call(this).then(buffer => convertBody(buffer, this.headers)); - } - -}; - -Body.mixIn = function (proto) { - for (var _iterator = _createForOfIteratorHelperLoose(Object.getOwnPropertyNames(Body.prototype)), _step; !(_step = _iterator()).done;) { - const name = _step.value; - - // istanbul ignore else - if (!(name in proto)) { - const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); - Object.defineProperty(proto, name, desc); - } - } -}; -/** - * Decode buffers into utf-8 string - * - * @return {Promise} - */ - - -function consumeBody() { - if (this[DISTURBED]) { - return Promise.reject(new Error(`body used already for: ${this.url}`)); - } - - this[DISTURBED] = true; // body is null - - if (this.body === null) { - return Promise.resolve(Buffer.alloc(0)); - } // body is string - - - if (typeof this.body === 'string') { - return Promise.resolve(Buffer.from(this.body)); - } // body is blob - - - if (this.body instanceof Blob) { - return Promise.resolve(this.body[BUFFER]); - } // body is buffer - - - if (Buffer.isBuffer(this.body)) { - return Promise.resolve(this.body); - } // istanbul ignore if: should never happen - - - if (!(this.body instanceof Stream__default["default"])) { - return Promise.resolve(Buffer.alloc(0)); - } // body is stream - // get ready to actually consume the body - - - const accum = []; - let accumBytes = 0; - let abort = false; - return new Promise((resolve, reject) => { - let resTimeout; // allow timeout on slow response body - - if (this.timeout) { - resTimeout = setTimeout(() => { - abort = true; - reject(new FetchError(`Response timeout while trying to fetch ${this.url} (over ${this.timeout}ms)`, 'body-timeout')); - this.body.emit('cancel-request'); - }, this.timeout); - } // handle stream error, such as incorrect content-encoding - - - this.body.on('error', err => { - reject(new FetchError(`Invalid response body while trying to fetch ${this.url}: ${err.message}`, 'system', err)); - }); - this.body.on('data', chunk => { - if (abort || chunk === null) { - return; - } - - if (this.size && accumBytes + chunk.length > this.size) { - abort = true; - reject(new FetchError(`content size at ${this.url} over limit: ${this.size}`, 'max-size')); - this.body.emit('cancel-request'); - return; - } - - accumBytes += chunk.length; - accum.push(chunk); - }); - this.body.on('end', () => { - if (abort) { - return; - } - - clearTimeout(resTimeout); - resolve(Buffer.concat(accum)); - }); - }); -} -/** - * Detect buffer encoding and convert to target encoding - * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding - * - * @param {Buffer} buffer Incoming buffer - * @param {Headers} headers - * @return {string} - */ - - -function convertBody(buffer, headers) { - const ct = headers.get('content-type'); - let charset = 'utf-8'; - let res; // header - - if (ct) { - res = /charset=([^;]*)/i.exec(ct); - } // no charset in content type, peek at response body for at most 1024 bytes - - - const str = buffer.slice(0, 1024).toString(); // html5 - - if (!res && str) { - res = /= 94 && ch <= 122) { - return true; - } - - if (ch >= 65 && ch <= 90) { - return true; - } - - if (ch === 45) { - return true; - } - - if (ch >= 48 && ch <= 57) { - return true; - } - - if (ch === 34 || ch === 40 || ch === 41 || ch === 44) { - return false; - } - - if (ch >= 33 && ch <= 46) { - return true; - } - - if (ch === 124 || ch === 126) { - return true; - } - - return false; -} // istanbul ignore next - - -function checkIsHttpToken(val) { - if (typeof val !== 'string' || val.length === 0) { - return false; - } - - if (!isValidTokenChar(val.charCodeAt(0))) { - return false; - } - - const len = val.length; - - if (len > 1) { - if (!isValidTokenChar(val.charCodeAt(1))) { - return false; - } - - if (len > 2) { - if (!isValidTokenChar(val.charCodeAt(2))) { - return false; - } - - if (len > 3) { - if (!isValidTokenChar(val.charCodeAt(3))) { - return false; - } - - for (let i = 4; i < len; i++) { - if (!isValidTokenChar(val.charCodeAt(i))) { - return false; - } - } - } - } - } - - return true; -} -/** - * True if val contains an invalid field-vchar - * field-value = *( field-content / obs-fold ) - * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] - * field-vchar = VCHAR / obs-text - * - * checkInvalidHeaderChar() is currently designed to be inlinable by v8, - * so take care when making changes to the implementation so that the source - * code size does not exceed v8's default max_inlined_source_size setting. - **/ -// istanbul ignore next - -function checkInvalidHeaderChar(val) { - val += ''; - - if (val.length < 1) { - return false; - } - - let c = val.charCodeAt(0); - - if (c <= 31 && c !== 9 || c > 255 || c === 127) { - return true; - } - - if (val.length < 2) { - return false; - } - - c = val.charCodeAt(1); - - if (c <= 31 && c !== 9 || c > 255 || c === 127) { - return true; - } - - if (val.length < 3) { - return false; - } - - c = val.charCodeAt(2); - - if (c <= 31 && c !== 9 || c > 255 || c === 127) { - return true; - } - - for (let i = 3; i < val.length; ++i) { - c = val.charCodeAt(i); - - if (c <= 31 && c !== 9 || c > 255 || c === 127) { - return true; - } - } - - return false; -} - -function sanitizeName(name) { - name += ''; - - if (!checkIsHttpToken(name)) { - throw new TypeError(`${name} is not a legal HTTP header name`); - } - - return name.toLowerCase(); -} - -function sanitizeValue(value) { - value += ''; - - if (checkInvalidHeaderChar(value)) { - throw new TypeError(`${value} is not a legal HTTP header value`); - } - - return value; -} - -const MAP = Symbol('map'); -class Headers { - /** - * Headers class - * - * @param {Object} init Response headers - */ - constructor(init = undefined) { - this[MAP] = Object.create(null); // We don't worry about converting prop to ByteString here as append() - // will handle it. - - if (init == null) ; else if (typeof init === 'object') { - const method = init[Symbol.iterator]; - - if (method != null) { - if (typeof method !== 'function') { - throw new TypeError('Header pairs must be iterable'); - } // sequence> - // Note: per spec we have to first exhaust the lists then process them - - - const pairs = []; - - for (var _iterator = _createForOfIteratorHelperLoose(init), _step; !(_step = _iterator()).done;) { - const pair = _step.value; - - if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { - throw new TypeError('Each header pair must be iterable'); - } - - pairs.push(Array.from(pair)); - } - - for (var _i = 0, _pairs = pairs; _i < _pairs.length; _i++) { - const pair = _pairs[_i]; - - if (pair.length !== 2) { - throw new TypeError('Each header pair must be a name/value tuple'); - } - - this.append(pair[0], pair[1]); - } - } else { - // record - for (var _i2 = 0, _Object$keys = Object.keys(init); _i2 < _Object$keys.length; _i2++) { - const key = _Object$keys[_i2]; - const value = init[key]; - this.append(key, value); - } - } - } else { - throw new TypeError('Provided initializer must be an object'); - } - - Object.defineProperty(this, Symbol.toStringTag, { - value: 'Headers', - writable: false, - enumerable: false, - configurable: true - }); - } - /** - * Return first header value given name - * - * @param {string} name Header name - * @return {string} - */ - - - get(name) { - const list = this[MAP][sanitizeName(name)]; - - if (!list) { - return null; - } - - return list.join(','); - } - /** - * Iterate over all headers - * - * @param {function} callback Executed for each item with parameters (value, name, thisArg) - * @param {boolean} thisArg `this` context for callback function - */ - - - forEach(callback, thisArg = undefined) { - let pairs = getHeaderPairs(this); - let i = 0; - - while (i < pairs.length) { - const _pairs$i = pairs[i], - name = _pairs$i[0], - value = _pairs$i[1]; - callback.call(thisArg, value, name, this); - pairs = getHeaderPairs(this); - i++; - } - } - /** - * Overwrite header values given name - * - * @param {string} name Header name - * @param {string|Array.|*} value Header value - */ - - - set(name, value) { - this[MAP][sanitizeName(name)] = [sanitizeValue(value)]; - } - /** - * Append a value onto existing header - * - * @param {string} name Header name - * @param {string|Array.|*} value Header value - */ - - - append(name, value) { - if (!this.has(name)) { - this.set(name, value); - return; - } - - this[MAP][sanitizeName(name)].push(sanitizeValue(value)); - } - /** - * Check for header name existence - * - * @param {string} name Header name - * @return {boolean} - */ - - - has(name) { - return !!this[MAP][sanitizeName(name)]; - } - /** - * Delete all header values given name - * - * @param {string} name Header name - */ - - - delete(name) { - delete this[MAP][sanitizeName(name)]; - } - /** - * Return raw headers (non-spec api) - * - * @return {Object} - */ - - - raw() { - return this[MAP]; - } - /** - * Get an iterator on keys. - * - * @return {Iterator} - */ - - - keys() { - return createHeadersIterator(this, 'key'); - } - /** - * Get an iterator on values. - * - * @return {Iterator} - */ - - - values() { - return createHeadersIterator(this, 'value'); - } - /** - * Get an iterator on entries. - * - * This is the default iterator of the Headers object. - * - * @return {Iterator} - */ - - - [Symbol.iterator]() { - return createHeadersIterator(this, 'key+value'); - } - -} -Headers.prototype.entries = Headers.prototype[Symbol.iterator]; -Object.defineProperty(Headers.prototype, Symbol.toStringTag, { - value: 'HeadersPrototype', - writable: false, - enumerable: false, - configurable: true -}); - -function getHeaderPairs(headers, kind) { - if (kind === 'key') return Object.keys(headers[MAP]).sort().map(k => [k]); - const pairs = []; - - for (var _iterator2 = _createForOfIteratorHelperLoose(Object.keys(headers[MAP]).sort()), _step2; !(_step2 = _iterator2()).done;) { - const key = _step2.value; - - for (var _iterator3 = _createForOfIteratorHelperLoose(headers[MAP][key]), _step3; !(_step3 = _iterator3()).done;) { - const value = _step3.value; - pairs.push([key, value]); - } - } - - return pairs; -} - -const INTERNAL = Symbol('internal'); - -function createHeadersIterator(target, kind) { - const iterator = Object.create(HeadersIteratorPrototype); - iterator[INTERNAL] = { - target, - kind, - index: 0 - }; - return iterator; -} - -const HeadersIteratorPrototype = Object.setPrototypeOf({ - next() { - // istanbul ignore if - if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { - throw new TypeError('Value of `this` is not a HeadersIterator'); - } - - const _this$INTERNAL = this[INTERNAL], - target = _this$INTERNAL.target, - kind = _this$INTERNAL.kind, - index = _this$INTERNAL.index; - const values = getHeaderPairs(target, kind); - const len = values.length; - - if (index >= len) { - return { - value: undefined, - done: true - }; - } - - const pair = values[index]; - this[INTERNAL].index = index + 1; - let result; - - if (kind === 'key') { - result = pair[0]; - } else if (kind === 'value') { - result = pair[1]; - } else { - result = pair; - } - - return { - value: result, - done: false - }; - } - -}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); -Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { - value: 'HeadersIterator', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * response.js - * - * Response class provides content decoding - */ -/** - * Response class - * - * @param {Stream} body Readable stream - * @param {Object} opts Response options - */ - -class Response { - constructor(body = null, opts = {}) { - Body.call(this, body, opts); - this.url = opts.url; - this.status = opts.status || 200; - this.statusText = opts.statusText || http.STATUS_CODES[this.status]; - this.headers = new Headers(opts.headers); - this.useElectronNet = opts.useElectronNet; - Object.defineProperty(this, Symbol.toStringTag, { - value: 'Response', - writable: false, - enumerable: false, - configurable: true - }); - } - /** - * Convenience property representing if the request ended normally - */ - - - get ok() { - return this.status >= 200 && this.status < 300; - } - /** - * Clone this response - * - * @return {Response} - */ - - - clone() { - return new Response(clone(this), { - url: this.url, - status: this.status, - statusText: this.statusText, - headers: this.headers, - ok: this.ok, - useElectronNet: this.useElectronNet - }); - } - -} -Body.mixIn(Response.prototype); -Object.defineProperty(Response.prototype, Symbol.toStringTag, { - value: 'ResponsePrototype', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * request.js - * - * Request class contains server only options - */ -const PARSED_URL = Symbol('url'); -/** - * Request class - * - * @param {string|Request} input Url or Request instance - * @param {Object} init Custom options - */ - -class Request { - constructor(input, init = {}) { - let parsedURL; // normalize input - - if (!(input instanceof Request)) { - if (input && input.href) { - // in order to support Node.js' Url objects; though WHATWG's URL objects - // will fall into this branch also (since their `toString()` will return - // `href` property anyway) - parsedURL = url.parse(input.href); - } else { - // coerce input to a string before attempting to parse - parsedURL = url.parse(`${input}`); - } - - input = {}; - } else { - parsedURL = url.parse(input.url); - } - - const method = init.method || input.method || 'GET'; - - if ((init.body != null || input instanceof Request && input.body !== null) && (method === 'GET' || method === 'HEAD')) { - throw new TypeError('Request with GET/HEAD method cannot have body'); - } - - const inputBody = init.body != null ? init.body : input instanceof Request && input.body !== null ? clone(input) : null; - Body.call(this, inputBody, { - timeout: init.timeout || input.timeout || 0, - size: init.size || input.size || 0 - }); // fetch spec options - - this.method = method.toUpperCase(); - this.redirect = init.redirect || input.redirect || 'follow'; - this.signal = init.signal || input.signal || null; - this.headers = new Headers(init.headers || input.headers || {}); - this.headers.delete('Content-Length'); // user cannot set content-length themself as per fetch spec - - this.chunkedEncoding = false; - this.useElectronNet = init.useElectronNet !== undefined // have to do this instead of || because it can be set to false - ? init.useElectronNet : input.useElectronNet; // istanbul ignore if - - if (this.useElectronNet && !process.versions.electron) throw new Error('Cannot use Electron/net module on Node.js!'); - - if (this.useElectronNet === undefined) { - this.useElectronNet = Boolean(process.versions.electron); - } - - if (this.useElectronNet) { - this.useSessionCookies = init.useSessionCookies !== undefined ? init.useSessionCookies : input.useSessionCookies; - } - - if (init.body != null) { - const contentType = extractContentType(this); - - if (contentType !== null && !this.headers.has('Content-Type')) { - this.headers.append('Content-Type', contentType); - } - } // server only options - - - this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; - this.counter = init.counter || input.counter || 0; - this.session = init.session || input.session; - this[PARSED_URL] = parsedURL; - Object.defineProperty(this, Symbol.toStringTag, { - value: 'Request', - writable: false, - enumerable: false, - configurable: true - }); - } - - get url() { - return url.format(this[PARSED_URL]); - } - /** - * Clone this request - * - * @return {Request} - */ - - - clone() { - return new Request(this); - } - -} -Body.mixIn(Request.prototype); -Object.defineProperty(Request.prototype, Symbol.toStringTag, { - value: 'RequestPrototype', - writable: false, - enumerable: false, - configurable: true -}); -function getNodeRequestOptions(request) { - const parsedURL = request[PARSED_URL]; - const headers = new Headers(request.headers); // fetch step 3 - - if (!headers.has('Accept')) { - headers.set('Accept', '*/*'); - } // Basic fetch - - - if (!parsedURL.protocol || !parsedURL.hostname) { - throw new TypeError('Only absolute URLs are supported'); - } - - if (!/^https?:$/.test(parsedURL.protocol)) { - throw new TypeError('Only HTTP(S) protocols are supported'); - } // HTTP-network-or-cache fetch steps 5-9 - - - let contentLengthValue = null; - - if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { - contentLengthValue = '0'; - } - - if (request.body != null) { - const totalBytes = getTotalBytes(request); - - if (typeof totalBytes === 'number') { - contentLengthValue = String(totalBytes); - } - } - - if (contentLengthValue) { - if (!request.useElectronNet) headers.set('Content-Length', contentLengthValue); - } else { - request.chunkedEncoding = true; - } // HTTP-network-or-cache fetch step 12 - - - if (!headers.has('User-Agent')) { - headers.set('User-Agent', `electron-fetch/1.0 ${request.useElectronNet ? 'electron' : 'node'} (+https://github.com/arantes555/electron-fetch)`); - } // HTTP-network-or-cache fetch step 16 - - - headers.set('Accept-Encoding', 'gzip,deflate'); - - if (!headers.has('Connection')) { - headers.set('Connection', 'close'); - } // HTTP-network fetch step 4 - // chunked encoding is handled by Node.js when not running in electron - - - return Object.assign({}, parsedURL, { - method: request.method, - headers: headers.raw() - }); -} - -let electron; // istanbul ignore else - -if (process.versions.electron) { -<<<<<<< HEAD - electron = __nccwpck_require__(83251); -======= - electron = __nccwpck_require__(66477); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -} - -const isReady = electron && electron.app && !electron.app.isReady() ? new Promise(resolve => electron.app.once('ready', resolve)) : Promise.resolve(); -/** - * Fetch function - * - * @param {string|Request} url Absolute url or Request instance - * @param {Object} [opts] Fetch options - * @return {Promise} - */ - -function fetch(url$1, opts = {}) { - // wrap http.request into fetch - return isReady.then(() => new Promise((resolve, reject) => { - // build request object - const request = new Request(url$1, opts); - const options = getNodeRequestOptions(request); - const send = request.useElectronNet ? electron.net.request : (options.protocol === 'https:' ? https__namespace : http__namespace).request; // http.request only support string as host header, this hack make custom host header possible - - if (options.headers.host) { - options.headers.host = options.headers.host[0]; - } - - if (request.signal && request.signal.aborted) { - reject(new FetchError('request aborted', 'abort')); - return; - } // send request - - - let headers; - - if (request.useElectronNet) { - headers = options.headers; - delete options.headers; - options.session = opts.session || electron.session.defaultSession; - options.useSessionCookies = request.useSessionCookies; - } else { - if (opts.agent) options.agent = opts.agent; - if (opts.onLogin) reject(new Error('"onLogin" option is only supported with "useElectronNet" enabled')); - } - - const req = send(options); - - if (request.useElectronNet) { - for (const headerName in headers) { - if (typeof headers[headerName] === 'string') req.setHeader(headerName, headers[headerName]);else { - for (var _iterator = _createForOfIteratorHelperLoose(headers[headerName]), _step; !(_step = _iterator()).done;) { - const headerValue = _step.value; - req.setHeader(headerName, headerValue); - } - } - } - } - - let reqTimeout; - - const cancelRequest = () => { - if (request.useElectronNet) { - req.abort(); // in electron, `req.destroy()` does not send abort to server - } else { - req.destroy(); // in node.js, `req.abort()` is deprecated - } - }; - - const abortRequest = () => { - const err = new FetchError('request aborted', 'abort'); - reject(err); - cancelRequest(); - req.emit('error', err); - }; - - if (request.signal) { - request.signal.addEventListener('abort', abortRequest); - } - - if (request.timeout) { - reqTimeout = setTimeout(() => { - const err = new FetchError(`network timeout at: ${request.url}`, 'request-timeout'); - reject(err); - cancelRequest(); - }, request.timeout); - } - - if (request.useElectronNet) { - // handle authenticating proxies - req.on('login', (authInfo, callback) => { - if (opts.user && opts.password) { - callback(opts.user, opts.password); - } else if (opts.onLogin) { - opts.onLogin(authInfo).then(credentials => { - if (credentials) { - callback(credentials.username, credentials.password); - } else { - callback(); - } - }).catch(error => { - cancelRequest(); - reject(error); - }); - } else { - cancelRequest(); - reject(new FetchError(`login event received from ${authInfo.host} but no credentials or onLogin handler provided`, 'proxy', { - code: 'PROXY_AUTH_FAILED' - })); - } - }); - } - - req.on('error', err => { - clearTimeout(reqTimeout); - - if (request.signal) { - request.signal.removeEventListener('abort', abortRequest); - } - - reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); - }); - req.on('abort', () => { - clearTimeout(reqTimeout); - - if (request.signal) { - request.signal.removeEventListener('abort', abortRequest); - } - }); - req.on('response', res => { - try { - clearTimeout(reqTimeout); - - if (request.signal) { - request.signal.removeEventListener('abort', abortRequest); - } // handle redirect - - - if (fetch.isRedirect(res.statusCode) && request.redirect !== 'manual') { - if (request.redirect === 'error') { - reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect')); - return; - } - - if (request.counter >= request.follow) { - reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); - return; - } - - if (!res.headers.location) { - reject(new FetchError(`redirect location header missing at: ${request.url}`, 'invalid-redirect')); - return; - } // per fetch spec, for POST request with 301/302 response, or any request with 303 response, use GET when following redirect - - - if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { - request.method = 'GET'; - request.body = null; - request.headers.delete('content-length'); - } - - request.counter++; - resolve(fetch(url.resolve(request.url, res.headers.location), request)); - return; - } // normalize location header for manual redirect mode - - - const headers = new Headers(); - - for (var _i = 0, _Object$keys = Object.keys(res.headers); _i < _Object$keys.length; _i++) { - const name = _Object$keys[_i]; - - if (Array.isArray(res.headers[name])) { - for (var _iterator2 = _createForOfIteratorHelperLoose(res.headers[name]), _step2; !(_step2 = _iterator2()).done;) { - const val = _step2.value; - headers.append(name, val); - } - } else { - headers.append(name, res.headers[name]); - } - } - - if (request.redirect === 'manual' && headers.has('location')) { - headers.set('location', url.resolve(request.url, headers.get('location'))); - } // prepare response - - - let body = new Stream.PassThrough(); - res.on('error', err => body.emit('error', err)); - res.pipe(body); - body.on('error', cancelRequest); - body.on('cancel-request', cancelRequest); - - const abortBody = () => { - res.destroy(); - res.emit('error', new FetchError('request aborted', 'abort')); // separated from the `.destroy()` because somehow Node's IncomingMessage streams do not emit errors on destroy - }; - - if (request.signal) { - request.signal.addEventListener('abort', abortBody); - res.on('end', () => { - request.signal.removeEventListener('abort', abortBody); - }); - res.on('error', () => { - request.signal.removeEventListener('abort', abortBody); - }); - } - - const responseOptions = { - url: request.url, - status: res.statusCode, - statusText: res.statusMessage, - headers, - size: request.size, - timeout: request.timeout, - useElectronNet: request.useElectronNet, - useSessionCookies: request.useSessionCookies - }; // HTTP-network fetch step 16.1.2 - - const codings = headers.get('Content-Encoding'); // HTTP-network fetch step 16.1.3: handle content codings - // in following scenarios we ignore compression support - // 1. running on Electron/net module (it manages it for us) - // 2. HEAD request - // 3. no Content-Encoding header - // 4. no content response (204) - // 5. content not modified response (304) - - if (!request.useElectronNet && request.method !== 'HEAD' && codings !== null && res.statusCode !== 204 && res.statusCode !== 304) { - // Be less strict when decoding compressed responses, since sometimes - // servers send slightly invalid responses that are still accepted - // by common browsers. - // Always using Z_SYNC_FLUSH is what cURL does. - // /!\ This is disabled for now, because it seems broken in recent node - // const zlibOptions = { - // flush: zlib.Z_SYNC_FLUSH, - // finishFlush: zlib.Z_SYNC_FLUSH - // } - if (codings === 'gzip' || codings === 'x-gzip') { - // for gzip - body = body.pipe(zlib__namespace.createGunzip()); - } else if (codings === 'deflate' || codings === 'x-deflate') { - // for deflate - // handle the infamous raw deflate response from old servers - // a hack for old IIS and Apache servers - const raw = res.pipe(new Stream.PassThrough()); - return raw.once('data', chunk => { - // see http://stackoverflow.com/questions/37519828 - if ((chunk[0] & 0x0F) === 0x08) { - body = body.pipe(zlib__namespace.createInflate()); - } else { - body = body.pipe(zlib__namespace.createInflateRaw()); - } - - const response = new Response(body, responseOptions); - resolve(response); - }); - } - } - - const response = new Response(body, responseOptions); - resolve(response); - } catch (error) { - reject(new FetchError(`Invalid response: ${error.message}`, 'invalid-response')); - cancelRequest(); - } - }); - writeToStream(req, request); - })); -} -/** - * Redirect code matching - * - * @param {number} code Status code - * @return {boolean} - */ - -fetch.isRedirect = code => code === 301 || code === 302 || code === 303 || code === 307 || code === 308; - -exports.FetchError = FetchError; -exports.Headers = Headers; -exports.Request = Request; -exports.Response = Response; -exports["default"] = fetch; - - -/***/ }), - -<<<<<<< HEAD -/***/ 1086: -======= -/***/ 73931: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - - -<<<<<<< HEAD -var iconvLite = __nccwpck_require__(72249); -======= -var iconvLite = __nccwpck_require__(17281); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -// Expose to the world -module.exports.convert = convert; - -/** - * Convert encoding of an UTF-8 string or a buffer - * - * @param {String|Buffer} str String to be converted - * @param {String} to Encoding to be converted to - * @param {String} [from='UTF-8'] Encoding to be converted from - * @return {Buffer} Encoded string - */ -function convert(str, to, from) { - from = checkEncoding(from || 'UTF-8'); - to = checkEncoding(to || 'UTF-8'); - str = str || ''; - - var result; - - if (from !== 'UTF-8' && typeof str === 'string') { - str = Buffer.from(str, 'binary'); - } - - if (from === to) { - if (typeof str === 'string') { - result = Buffer.from(str); - } else { - result = str; - } - } else { - try { - result = convertIconvLite(str, to, from); - } catch (E) { - console.error(E); - result = str; - } - } - - if (typeof result === 'string') { - result = Buffer.from(result, 'utf-8'); - } - - return result; -} - -/** - * Convert encoding of astring with iconv-lite - * - * @param {String|Buffer} str String to be converted - * @param {String} to Encoding to be converted to - * @param {String} [from='UTF-8'] Encoding to be converted from - * @return {Buffer} Encoded string - */ -function convertIconvLite(str, to, from) { - if (to === 'UTF-8') { - return iconvLite.decode(str, from); - } else if (from === 'UTF-8') { - return iconvLite.encode(str, to); - } else { - return iconvLite.encode(iconvLite.decode(str, from), to); - } -} - -/** - * Converts charset name if needed - * - * @param {String} name Character set - * @return {String} Character set name - */ -function checkEncoding(name) { - return (name || '') - .toString() - .trim() - .replace(/^latin[\-_]?(\d+)$/i, 'ISO-8859-$1') - .replace(/^win(?:dows)?[\-_]?(\d+)$/i, 'WINDOWS-$1') - .replace(/^utf[\-_]?(\d+)$/i, 'UTF-$1') - .replace(/^ks_c_5601\-1987$/i, 'CP949') - .replace(/^us[\-_]?ascii$/i, 'ASCII') - .toUpperCase(); -} - - -/***/ }), - -<<<<<<< HEAD -/***/ 91573: -======= -/***/ 20108: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -<<<<<<< HEAD -var Buffer = (__nccwpck_require__(95944).Buffer); -======= -var Buffer = (__nccwpck_require__(25213).Buffer); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -// Multibyte codec. In this scheme, a character is represented by 1 or more bytes. -// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. -// To save memory and loading time, we read table files only when requested. - -exports._dbcs = DBCSCodec; - -var UNASSIGNED = -1, - GB18030_CODE = -2, - SEQ_START = -10, - NODE_START = -1000, - UNASSIGNED_NODE = new Array(0x100), - DEF_CHAR = -1; - -for (var i = 0; i < 0x100; i++) - UNASSIGNED_NODE[i] = UNASSIGNED; - - -// Class DBCSCodec reads and initializes mapping tables. -function DBCSCodec(codecOptions, iconv) { - this.encodingName = codecOptions.encodingName; - if (!codecOptions) - throw new Error("DBCS codec is called without the data.") - if (!codecOptions.table) - throw new Error("Encoding '" + this.encodingName + "' has no data."); - - // Load tables. - var mappingTable = codecOptions.table(); - - - // Decode tables: MBCS -> Unicode. - - // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. - // Trie root is decodeTables[0]. - // Values: >= 0 -> unicode character code. can be > 0xFFFF - // == UNASSIGNED -> unknown/unassigned sequence. - // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. - // <= NODE_START -> index of the next node in our trie to process next byte. - // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. - this.decodeTables = []; - this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node. - - // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. - this.decodeTableSeq = []; - - // Actual mapping tables consist of chunks. Use them to fill up decode tables. - for (var i = 0; i < mappingTable.length; i++) - this._addDecodeChunk(mappingTable[i]); - - // Load & create GB18030 tables when needed. - if (typeof codecOptions.gb18030 === 'function') { - this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. - - // Add GB18030 common decode nodes. - var commonThirdByteNodeIdx = this.decodeTables.length; - this.decodeTables.push(UNASSIGNED_NODE.slice(0)); - - var commonFourthByteNodeIdx = this.decodeTables.length; - this.decodeTables.push(UNASSIGNED_NODE.slice(0)); - - // Fill out the tree - var firstByteNode = this.decodeTables[0]; - for (var i = 0x81; i <= 0xFE; i++) { - var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]]; - for (var j = 0x30; j <= 0x39; j++) { - if (secondByteNode[j] === UNASSIGNED) { - secondByteNode[j] = NODE_START - commonThirdByteNodeIdx; - } else if (secondByteNode[j] > NODE_START) { - throw new Error("gb18030 decode tables conflict at byte 2"); - } - - var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]]; - for (var k = 0x81; k <= 0xFE; k++) { - if (thirdByteNode[k] === UNASSIGNED) { - thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx; - } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { - continue; - } else if (thirdByteNode[k] > NODE_START) { - throw new Error("gb18030 decode tables conflict at byte 3"); - } - - var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]]; - for (var l = 0x30; l <= 0x39; l++) { - if (fourthByteNode[l] === UNASSIGNED) - fourthByteNode[l] = GB18030_CODE; - } - } - } - } - } - - this.defaultCharUnicode = iconv.defaultCharUnicode; - - - // Encode tables: Unicode -> DBCS. - - // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. - // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. - // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). - // == UNASSIGNED -> no conversion found. Output a default char. - // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. - this.encodeTable = []; - - // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of - // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key - // means end of sequence (needed when one sequence is a strict subsequence of another). - // Objects are kept separately from encodeTable to increase performance. - this.encodeTableSeq = []; - - // Some chars can be decoded, but need not be encoded. - var skipEncodeChars = {}; - if (codecOptions.encodeSkipVals) - for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { - var val = codecOptions.encodeSkipVals[i]; - if (typeof val === 'number') - skipEncodeChars[val] = true; - else - for (var j = val.from; j <= val.to; j++) - skipEncodeChars[j] = true; - } - - // Use decode trie to recursively fill out encode tables. - this._fillEncodeTable(0, 0, skipEncodeChars); - - // Add more encoding pairs when needed. - if (codecOptions.encodeAdd) { - for (var uChar in codecOptions.encodeAdd) - if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) - this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); - } - - this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; - if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; - if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); -} - -DBCSCodec.prototype.encoder = DBCSEncoder; -DBCSCodec.prototype.decoder = DBCSDecoder; - -// Decoder helpers -DBCSCodec.prototype._getDecodeTrieNode = function(addr) { - var bytes = []; - for (; addr > 0; addr >>>= 8) - bytes.push(addr & 0xFF); - if (bytes.length == 0) - bytes.push(0); - - var node = this.decodeTables[0]; - for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie. - var val = node[bytes[i]]; - - if (val == UNASSIGNED) { // Create new node. - node[bytes[i]] = NODE_START - this.decodeTables.length; - this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); - } - else if (val <= NODE_START) { // Existing node. - node = this.decodeTables[NODE_START - val]; - } - else - throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); - } - return node; -} - - -DBCSCodec.prototype._addDecodeChunk = function(chunk) { - // First element of chunk is the hex mbcs code where we start. - var curAddr = parseInt(chunk[0], 16); - - // Choose the decoding node where we'll write our chars. - var writeTable = this._getDecodeTrieNode(curAddr); - curAddr = curAddr & 0xFF; - - // Write all other elements of the chunk to the table. - for (var k = 1; k < chunk.length; k++) { - var part = chunk[k]; - if (typeof part === "string") { // String, write as-is. - for (var l = 0; l < part.length;) { - var code = part.charCodeAt(l++); - if (0xD800 <= code && code < 0xDC00) { // Decode surrogate - var codeTrail = part.charCodeAt(l++); - if (0xDC00 <= codeTrail && codeTrail < 0xE000) - writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00); - else - throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); - } - else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used) - var len = 0xFFF - code + 2; - var seq = []; - for (var m = 0; m < len; m++) - seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq. - - writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length; - this.decodeTableSeq.push(seq); - } - else - writeTable[curAddr++] = code; // Basic char - } - } - else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. - var charCode = writeTable[curAddr - 1] + 1; - for (var l = 0; l < part; l++) - writeTable[curAddr++] = charCode++; - } - else - throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]); - } - if (curAddr > 0xFF) - throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); -} - -// Encoder helpers -DBCSCodec.prototype._getEncodeBucket = function(uCode) { - var high = uCode >> 8; // This could be > 0xFF because of astral characters. - if (this.encodeTable[high] === undefined) - this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand. - return this.encodeTable[high]; -} - -DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { - var bucket = this._getEncodeBucket(uCode); - var low = uCode & 0xFF; - if (bucket[low] <= SEQ_START) - this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it. - else if (bucket[low] == UNASSIGNED) - bucket[low] = dbcsCode; -} - -DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { - - // Get the root of character tree according to first character of the sequence. - var uCode = seq[0]; - var bucket = this._getEncodeBucket(uCode); - var low = uCode & 0xFF; - - var node; - if (bucket[low] <= SEQ_START) { - // There's already a sequence with - use it. - node = this.encodeTableSeq[SEQ_START-bucket[low]]; - } - else { - // There was no sequence object - allocate a new one. - node = {}; - if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence. - bucket[low] = SEQ_START - this.encodeTableSeq.length; - this.encodeTableSeq.push(node); - } - - // Traverse the character tree, allocating new nodes as needed. - for (var j = 1; j < seq.length-1; j++) { - var oldVal = node[uCode]; - if (typeof oldVal === 'object') - node = oldVal; - else { - node = node[uCode] = {} - if (oldVal !== undefined) - node[DEF_CHAR] = oldVal - } - } - - // Set the leaf to given dbcsCode. - uCode = seq[seq.length-1]; - node[uCode] = dbcsCode; -} - -DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { - var node = this.decodeTables[nodeIdx]; - var hasValues = false; - var subNodeEmpty = {}; - for (var i = 0; i < 0x100; i++) { - var uCode = node[i]; - var mbCode = prefix + i; - if (skipEncodeChars[mbCode]) - continue; - - if (uCode >= 0) { - this._setEncodeChar(uCode, mbCode); - hasValues = true; - } else if (uCode <= NODE_START) { - var subNodeIdx = NODE_START - uCode; - if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). - var newPrefix = (mbCode << 8) >>> 0; // NOTE: '>>> 0' keeps 32-bit num positive. - if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) - hasValues = true; - else - subNodeEmpty[subNodeIdx] = true; - } - } else if (uCode <= SEQ_START) { - this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); - hasValues = true; - } - } - return hasValues; -} - - - -// == Encoder ================================================================== - -function DBCSEncoder(options, codec) { - // Encoder state - this.leadSurrogate = -1; - this.seqObj = undefined; - - // Static data - this.encodeTable = codec.encodeTable; - this.encodeTableSeq = codec.encodeTableSeq; - this.defaultCharSingleByte = codec.defCharSB; - this.gb18030 = codec.gb18030; -} - -DBCSEncoder.prototype.write = function(str) { - var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)), - leadSurrogate = this.leadSurrogate, - seqObj = this.seqObj, nextChar = -1, - i = 0, j = 0; - - while (true) { - // 0. Get next character. - if (nextChar === -1) { - if (i == str.length) break; - var uCode = str.charCodeAt(i++); - } - else { - var uCode = nextChar; - nextChar = -1; - } - - // 1. Handle surrogates. - if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates. - if (uCode < 0xDC00) { // We've got lead surrogate. - if (leadSurrogate === -1) { - leadSurrogate = uCode; - continue; - } else { - leadSurrogate = uCode; - // Double lead surrogate found. - uCode = UNASSIGNED; - } - } else { // We've got trail surrogate. - if (leadSurrogate !== -1) { - uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00); - leadSurrogate = -1; - } else { - // Incomplete surrogate pair - only trail surrogate found. - uCode = UNASSIGNED; - } - - } - } - else if (leadSurrogate !== -1) { - // Incomplete surrogate pair - only lead surrogate found. - nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char. - leadSurrogate = -1; - } - - // 2. Convert uCode character. - var dbcsCode = UNASSIGNED; - if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence - var resCode = seqObj[uCode]; - if (typeof resCode === 'object') { // Sequence continues. - seqObj = resCode; - continue; - - } else if (typeof resCode == 'number') { // Sequence finished. Write it. - dbcsCode = resCode; - - } else if (resCode == undefined) { // Current character is not part of the sequence. - - // Try default character for this sequence - resCode = seqObj[DEF_CHAR]; - if (resCode !== undefined) { - dbcsCode = resCode; // Found. Write it. - nextChar = uCode; // Current character will be written too in the next iteration. - - } else { - // TODO: What if we have no default? (resCode == undefined) - // Then, we should write first char of the sequence as-is and try the rest recursively. - // Didn't do it for now because no encoding has this situation yet. - // Currently, just skip the sequence and write current char. - } - } - seqObj = undefined; - } - else if (uCode >= 0) { // Regular character - var subtable = this.encodeTable[uCode >> 8]; - if (subtable !== undefined) - dbcsCode = subtable[uCode & 0xFF]; - - if (dbcsCode <= SEQ_START) { // Sequence start - seqObj = this.encodeTableSeq[SEQ_START-dbcsCode]; - continue; - } - - if (dbcsCode == UNASSIGNED && this.gb18030) { - // Use GB18030 algorithm to find character(s) to write. - var idx = findIdx(this.gb18030.uChars, uCode); - if (idx != -1) { - var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]); - newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600; - newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260; - newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10; - newBuf[j++] = 0x30 + dbcsCode; - continue; - } - } - } - - // 3. Write dbcsCode character. - if (dbcsCode === UNASSIGNED) - dbcsCode = this.defaultCharSingleByte; - - if (dbcsCode < 0x100) { - newBuf[j++] = dbcsCode; - } - else if (dbcsCode < 0x10000) { - newBuf[j++] = dbcsCode >> 8; // high byte - newBuf[j++] = dbcsCode & 0xFF; // low byte - } - else if (dbcsCode < 0x1000000) { - newBuf[j++] = dbcsCode >> 16; - newBuf[j++] = (dbcsCode >> 8) & 0xFF; - newBuf[j++] = dbcsCode & 0xFF; - } else { - newBuf[j++] = dbcsCode >>> 24; - newBuf[j++] = (dbcsCode >>> 16) & 0xFF; - newBuf[j++] = (dbcsCode >>> 8) & 0xFF; - newBuf[j++] = dbcsCode & 0xFF; - } - } - - this.seqObj = seqObj; - this.leadSurrogate = leadSurrogate; - return newBuf.slice(0, j); -} - -DBCSEncoder.prototype.end = function() { - if (this.leadSurrogate === -1 && this.seqObj === undefined) - return; // All clean. Most often case. - - var newBuf = Buffer.alloc(10), j = 0; - - if (this.seqObj) { // We're in the sequence. - var dbcsCode = this.seqObj[DEF_CHAR]; - if (dbcsCode !== undefined) { // Write beginning of the sequence. - if (dbcsCode < 0x100) { - newBuf[j++] = dbcsCode; - } - else { - newBuf[j++] = dbcsCode >> 8; // high byte - newBuf[j++] = dbcsCode & 0xFF; // low byte - } - } else { - // See todo above. - } - this.seqObj = undefined; - } - - if (this.leadSurrogate !== -1) { - // Incomplete surrogate pair - only lead surrogate found. - newBuf[j++] = this.defaultCharSingleByte; - this.leadSurrogate = -1; - } - - return newBuf.slice(0, j); -} - -// Export for testing -DBCSEncoder.prototype.findIdx = findIdx; - - -// == Decoder ================================================================== - -function DBCSDecoder(options, codec) { - // Decoder state - this.nodeIdx = 0; - this.prevBytes = []; - - // Static data - this.decodeTables = codec.decodeTables; - this.decodeTableSeq = codec.decodeTableSeq; - this.defaultCharUnicode = codec.defaultCharUnicode; - this.gb18030 = codec.gb18030; -} - -DBCSDecoder.prototype.write = function(buf) { - var newBuf = Buffer.alloc(buf.length*2), - nodeIdx = this.nodeIdx, - prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, - seqStart = -this.prevBytes.length, // idx of the start of current parsed sequence. - uCode; - - for (var i = 0, j = 0; i < buf.length; i++) { - var curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset]; - - // Lookup in current trie node. - var uCode = this.decodeTables[nodeIdx][curByte]; - - if (uCode >= 0) { - // Normal character, just use it. - } - else if (uCode === UNASSIGNED) { // Unknown char. - // TODO: Callback with seq. - uCode = this.defaultCharUnicode.charCodeAt(0); - i = seqStart; // Skip one byte ('i' will be incremented by the for loop) and try to parse again. - } - else if (uCode === GB18030_CODE) { - if (i >= 3) { - var ptr = (buf[i-3]-0x81)*12600 + (buf[i-2]-0x30)*1260 + (buf[i-1]-0x81)*10 + (curByte-0x30); - } else { - var ptr = (prevBytes[i-3+prevOffset]-0x81)*12600 + - (((i-2 >= 0) ? buf[i-2] : prevBytes[i-2+prevOffset])-0x30)*1260 + - (((i-1 >= 0) ? buf[i-1] : prevBytes[i-1+prevOffset])-0x81)*10 + - (curByte-0x30); - } - var idx = findIdx(this.gb18030.gbChars, ptr); - uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; - } - else if (uCode <= NODE_START) { // Go to next trie node. - nodeIdx = NODE_START - uCode; - continue; - } - else if (uCode <= SEQ_START) { // Output a sequence of chars. - var seq = this.decodeTableSeq[SEQ_START - uCode]; - for (var k = 0; k < seq.length - 1; k++) { - uCode = seq[k]; - newBuf[j++] = uCode & 0xFF; - newBuf[j++] = uCode >> 8; - } - uCode = seq[seq.length-1]; - } - else - throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); - - // Write the character to buffer, handling higher planes using surrogate pair. - if (uCode >= 0x10000) { - uCode -= 0x10000; - var uCodeLead = 0xD800 | (uCode >> 10); - newBuf[j++] = uCodeLead & 0xFF; - newBuf[j++] = uCodeLead >> 8; - - uCode = 0xDC00 | (uCode & 0x3FF); - } - newBuf[j++] = uCode & 0xFF; - newBuf[j++] = uCode >> 8; - - // Reset trie node. - nodeIdx = 0; seqStart = i+1; - } - - this.nodeIdx = nodeIdx; - this.prevBytes = (seqStart >= 0) - ? Array.prototype.slice.call(buf, seqStart) - : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)); - - return newBuf.slice(0, j).toString('ucs2'); -} - -DBCSDecoder.prototype.end = function() { - var ret = ''; - - // Try to parse all remaining chars. - while (this.prevBytes.length > 0) { - // Skip 1 character in the buffer. - ret += this.defaultCharUnicode; - var bytesArr = this.prevBytes.slice(1); - - // Parse remaining as usual. - this.prevBytes = []; - this.nodeIdx = 0; - if (bytesArr.length > 0) - ret += this.write(bytesArr); - } - - this.prevBytes = []; - this.nodeIdx = 0; - return ret; -} - -// Binary search for GB18030. Returns largest i such that table[i] <= val. -function findIdx(table, val) { - if (table[0] > val) - return -1; - - var l = 0, r = table.length; - while (l < r-1) { // always table[l] <= val < table[r] - var mid = l + ((r-l+1) >> 1); - if (table[mid] <= val) - l = mid; - else - r = mid; - } - return l; -} - - - -/***/ }), - -<<<<<<< HEAD -/***/ 12409: -======= -/***/ 54275: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - - -// Description of supported double byte encodings and aliases. -// Tables are not require()-d until they are needed to speed up library load. -// require()-s are direct to support Browserify. - -module.exports = { - - // == Japanese/ShiftJIS ==================================================== - // All japanese encodings are based on JIS X set of standards: - // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. - // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. - // Has several variations in 1978, 1983, 1990 and 1997. - // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. - // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. - // 2 planes, first is superset of 0208, second - revised 0212. - // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) - - // Byte encodings are: - // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte - // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. - // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. - // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. - // 0x00-0x7F - lower part of 0201 - // 0x8E, 0xA1-0xDF - upper part of 0201 - // (0xA1-0xFE)x2 - 0208 plane (94x94). - // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). - // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. - // Used as-is in ISO2022 family. - // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, - // 0201-1976 Roman, 0208-1978, 0208-1983. - // * ISO2022-JP-1: Adds esc seq for 0212-1990. - // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. - // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. - // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. - // - // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. - // - // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html - - 'shiftjis': { - type: '_dbcs', - table: function() { return __nccwpck_require__(94965) }, - encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, - encodeSkipVals: [{from: 0xED40, to: 0xF940}], - }, - 'csshiftjis': 'shiftjis', - 'mskanji': 'shiftjis', - 'sjis': 'shiftjis', - 'windows31j': 'shiftjis', - 'ms31j': 'shiftjis', - 'xsjis': 'shiftjis', - 'windows932': 'shiftjis', - 'ms932': 'shiftjis', - '932': 'shiftjis', - 'cp932': 'shiftjis', - - 'eucjp': { - type: '_dbcs', - table: function() { return __nccwpck_require__(9750) }, - encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, - }, - - // TODO: KDDI extension to Shift_JIS - // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. - // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. - - - // == Chinese/GBK ========================================================== - // http://en.wikipedia.org/wiki/GBK - // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder - - // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 - 'gb2312': 'cp936', - 'gb231280': 'cp936', - 'gb23121980': 'cp936', - 'csgb2312': 'cp936', - 'csiso58gb231280': 'cp936', - 'euccn': 'cp936', - - // Microsoft's CP936 is a subset and approximation of GBK. - 'windows936': 'cp936', - 'ms936': 'cp936', - '936': 'cp936', - 'cp936': { - type: '_dbcs', - table: function() { return __nccwpck_require__(94904) }, - }, - - // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. - 'gbk': { - type: '_dbcs', - table: function() { return (__nccwpck_require__(94904).concat)(__nccwpck_require__(49429)) }, - }, - 'xgbk': 'gbk', - 'isoir58': 'gbk', - - // GB18030 is an algorithmic extension of GBK. - // Main source: https://www.w3.org/TR/encoding/#gbk-encoder - // http://icu-project.org/docs/papers/gb18030.html - // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml - // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 - 'gb18030': { - type: '_dbcs', - table: function() { return (__nccwpck_require__(94904).concat)(__nccwpck_require__(49429)) }, - gb18030: function() { return __nccwpck_require__(25893) }, - encodeSkipVals: [0x80], - encodeAdd: {'€': 0xA2E3}, - }, - - 'chinese': 'gb18030', - - - // == Korean =============================================================== - // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. - 'windows949': 'cp949', - 'ms949': 'cp949', - '949': 'cp949', - 'cp949': { - type: '_dbcs', - table: function() { return __nccwpck_require__(13940) }, - }, - - 'cseuckr': 'cp949', - 'csksc56011987': 'cp949', - 'euckr': 'cp949', - 'isoir149': 'cp949', - 'korean': 'cp949', - 'ksc56011987': 'cp949', - 'ksc56011989': 'cp949', - 'ksc5601': 'cp949', - - - // == Big5/Taiwan/Hong Kong ================================================ - // There are lots of tables for Big5 and cp950. Please see the following links for history: - // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html - // Variations, in roughly number of defined chars: - // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT - // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ - // * Big5-2003 (Taiwan standard) almost superset of cp950. - // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. - // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. - // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. - // Plus, it has 4 combining sequences. - // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 - // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. - // Implementations are not consistent within browsers; sometimes labeled as just big5. - // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. - // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 - // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. - // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt - // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt - // - // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder - // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. - - 'windows950': 'cp950', - 'ms950': 'cp950', - '950': 'cp950', - 'cp950': { - type: '_dbcs', - table: function() { return __nccwpck_require__(7507) }, - }, - - // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. - 'big5': 'big5hkscs', - 'big5hkscs': { - type: '_dbcs', - table: function() { return (__nccwpck_require__(7507).concat)(__nccwpck_require__(53768)) }, - encodeSkipVals: [ - // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of - // https://encoding.spec.whatwg.org/#index-big5-pointer), we still do it to increase compatibility with ICU. - // But if a single unicode point can be encoded both as HKSCS and regular Big5, we prefer the latter. - 0x8e69, 0x8e6f, 0x8e7e, 0x8eab, 0x8eb4, 0x8ecd, 0x8ed0, 0x8f57, 0x8f69, 0x8f6e, 0x8fcb, 0x8ffe, - 0x906d, 0x907a, 0x90c4, 0x90dc, 0x90f1, 0x91bf, 0x92af, 0x92b0, 0x92b1, 0x92b2, 0x92d1, 0x9447, 0x94ca, - 0x95d9, 0x96fc, 0x9975, 0x9b76, 0x9b78, 0x9b7b, 0x9bc6, 0x9bde, 0x9bec, 0x9bf6, 0x9c42, 0x9c53, 0x9c62, - 0x9c68, 0x9c6b, 0x9c77, 0x9cbc, 0x9cbd, 0x9cd0, 0x9d57, 0x9d5a, 0x9dc4, 0x9def, 0x9dfb, 0x9ea9, 0x9eef, - 0x9efd, 0x9f60, 0x9fcb, 0xa077, 0xa0dc, 0xa0df, 0x8fcc, 0x92c8, 0x9644, 0x96ed, - - // Step 2 of https://encoding.spec.whatwg.org/#index-big5-pointer: Use last pointer for U+2550, U+255E, U+2561, U+256A, U+5341, or U+5345 - 0xa2a4, 0xa2a5, 0xa2a7, 0xa2a6, 0xa2cc, 0xa2ce, - ], - }, - - 'cnbig5': 'big5hkscs', - 'csbig5': 'big5hkscs', - 'xxbig5': 'big5hkscs', -}; - - -/***/ }), - -<<<<<<< HEAD -/***/ 80742: -======= -/***/ 80126: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - - -// Update this array if you add/rename/remove files in this directory. -// We support Browserify by skipping automatic module discovery and requiring modules directly. -var modules = [ -<<<<<<< HEAD - __nccwpck_require__(80434), - __nccwpck_require__(28641), - __nccwpck_require__(28712), - __nccwpck_require__(79211), - __nccwpck_require__(19716), - __nccwpck_require__(25456), - __nccwpck_require__(16804), - __nccwpck_require__(91573), - __nccwpck_require__(12409), -======= - __nccwpck_require__(72097), - __nccwpck_require__(85501), - __nccwpck_require__(71611), - __nccwpck_require__(64846), - __nccwpck_require__(16399), - __nccwpck_require__(94797), - __nccwpck_require__(43281), - __nccwpck_require__(20108), - __nccwpck_require__(54275), ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -]; - -// Put all encoding/alias/codec definitions to single object and export it. -for (var i = 0; i < modules.length; i++) { - var module = modules[i]; - for (var enc in module) - if (Object.prototype.hasOwnProperty.call(module, enc)) - exports[enc] = module[enc]; -} - - -/***/ }), - -<<<<<<< HEAD -/***/ 80434: -======= -/***/ 72097: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - -<<<<<<< HEAD -var Buffer = (__nccwpck_require__(95944).Buffer); -======= -var Buffer = (__nccwpck_require__(25213).Buffer); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -// Export Node.js internal encodings. - -module.exports = { - // Encodings - utf8: { type: "_internal", bomAware: true}, - cesu8: { type: "_internal", bomAware: true}, - unicode11utf8: "utf8", - - ucs2: { type: "_internal", bomAware: true}, - utf16le: "ucs2", - - binary: { type: "_internal" }, - base64: { type: "_internal" }, - hex: { type: "_internal" }, - - // Codec. - _internal: InternalCodec, -}; - -//------------------------------------------------------------------------------ - -function InternalCodec(codecOptions, iconv) { - this.enc = codecOptions.encodingName; - this.bomAware = codecOptions.bomAware; - - if (this.enc === "base64") - this.encoder = InternalEncoderBase64; - else if (this.enc === "cesu8") { - this.enc = "utf8"; // Use utf8 for decoding. - this.encoder = InternalEncoderCesu8; - - // Add decoder for versions of Node not supporting CESU-8 - if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') { - this.decoder = InternalDecoderCesu8; - this.defaultCharUnicode = iconv.defaultCharUnicode; - } - } -} - -InternalCodec.prototype.encoder = InternalEncoder; -InternalCodec.prototype.decoder = InternalDecoder; - -//------------------------------------------------------------------------------ - -// We use node.js internal decoder. Its signature is the same as ours. -var StringDecoder = (__nccwpck_require__(71576).StringDecoder); - -if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. - StringDecoder.prototype.end = function() {}; - - -function InternalDecoder(options, codec) { - this.decoder = new StringDecoder(codec.enc); -} - -InternalDecoder.prototype.write = function(buf) { - if (!Buffer.isBuffer(buf)) { - buf = Buffer.from(buf); - } - - return this.decoder.write(buf); -} - -InternalDecoder.prototype.end = function() { - return this.decoder.end(); -} - - -//------------------------------------------------------------------------------ -// Encoder is mostly trivial - -function InternalEncoder(options, codec) { - this.enc = codec.enc; -} - -InternalEncoder.prototype.write = function(str) { - return Buffer.from(str, this.enc); -} - -InternalEncoder.prototype.end = function() { -} - - -//------------------------------------------------------------------------------ -// Except base64 encoder, which must keep its state. - -function InternalEncoderBase64(options, codec) { - this.prevStr = ''; -} - -InternalEncoderBase64.prototype.write = function(str) { - str = this.prevStr + str; - var completeQuads = str.length - (str.length % 4); - this.prevStr = str.slice(completeQuads); - str = str.slice(0, completeQuads); - - return Buffer.from(str, "base64"); -} - -InternalEncoderBase64.prototype.end = function() { - return Buffer.from(this.prevStr, "base64"); -} - - -//------------------------------------------------------------------------------ -// CESU-8 encoder is also special. - -function InternalEncoderCesu8(options, codec) { -} - -InternalEncoderCesu8.prototype.write = function(str) { - var buf = Buffer.alloc(str.length * 3), bufIdx = 0; - for (var i = 0; i < str.length; i++) { - var charCode = str.charCodeAt(i); - // Naive implementation, but it works because CESU-8 is especially easy - // to convert from UTF-16 (which all JS strings are encoded in). - if (charCode < 0x80) - buf[bufIdx++] = charCode; - else if (charCode < 0x800) { - buf[bufIdx++] = 0xC0 + (charCode >>> 6); - buf[bufIdx++] = 0x80 + (charCode & 0x3f); - } - else { // charCode will always be < 0x10000 in javascript. - buf[bufIdx++] = 0xE0 + (charCode >>> 12); - buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f); - buf[bufIdx++] = 0x80 + (charCode & 0x3f); - } - } - return buf.slice(0, bufIdx); -} - -InternalEncoderCesu8.prototype.end = function() { -} - -//------------------------------------------------------------------------------ -// CESU-8 decoder is not implemented in Node v4.0+ - -function InternalDecoderCesu8(options, codec) { - this.acc = 0; - this.contBytes = 0; - this.accBytes = 0; - this.defaultCharUnicode = codec.defaultCharUnicode; -} - -InternalDecoderCesu8.prototype.write = function(buf) { - var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, - res = ''; - for (var i = 0; i < buf.length; i++) { - var curByte = buf[i]; - if ((curByte & 0xC0) !== 0x80) { // Leading byte - if (contBytes > 0) { // Previous code is invalid - res += this.defaultCharUnicode; - contBytes = 0; - } - - if (curByte < 0x80) { // Single-byte code - res += String.fromCharCode(curByte); - } else if (curByte < 0xE0) { // Two-byte code - acc = curByte & 0x1F; - contBytes = 1; accBytes = 1; - } else if (curByte < 0xF0) { // Three-byte code - acc = curByte & 0x0F; - contBytes = 2; accBytes = 1; - } else { // Four or more are not supported for CESU-8. - res += this.defaultCharUnicode; - } - } else { // Continuation byte - if (contBytes > 0) { // We're waiting for it. - acc = (acc << 6) | (curByte & 0x3f); - contBytes--; accBytes++; - if (contBytes === 0) { - // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) - if (accBytes === 2 && acc < 0x80 && acc > 0) - res += this.defaultCharUnicode; - else if (accBytes === 3 && acc < 0x800) - res += this.defaultCharUnicode; - else - // Actually add character. - res += String.fromCharCode(acc); - } - } else { // Unexpected continuation byte - res += this.defaultCharUnicode; - } - } - } - this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes; - return res; -} - -InternalDecoderCesu8.prototype.end = function() { - var res = 0; - if (this.contBytes > 0) - res += this.defaultCharUnicode; - return res; -} - - -/***/ }), - -<<<<<<< HEAD -/***/ 19716: -======= -/***/ 16399: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -<<<<<<< HEAD -var Buffer = (__nccwpck_require__(95944).Buffer); -======= -var Buffer = (__nccwpck_require__(25213).Buffer); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that -// correspond to encoded bytes (if 128 - then lower half is ASCII). - -exports._sbcs = SBCSCodec; -function SBCSCodec(codecOptions, iconv) { - if (!codecOptions) - throw new Error("SBCS codec is called without the data.") - - // Prepare char buffer for decoding. - if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) - throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)"); - - if (codecOptions.chars.length === 128) { - var asciiString = ""; - for (var i = 0; i < 128; i++) - asciiString += String.fromCharCode(i); - codecOptions.chars = asciiString + codecOptions.chars; - } - - this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2'); - - // Encoding buffer. - var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); - - for (var i = 0; i < codecOptions.chars.length; i++) - encodeBuf[codecOptions.chars.charCodeAt(i)] = i; - - this.encodeBuf = encodeBuf; -} - -SBCSCodec.prototype.encoder = SBCSEncoder; -SBCSCodec.prototype.decoder = SBCSDecoder; - - -function SBCSEncoder(options, codec) { - this.encodeBuf = codec.encodeBuf; -} - -SBCSEncoder.prototype.write = function(str) { - var buf = Buffer.alloc(str.length); - for (var i = 0; i < str.length; i++) - buf[i] = this.encodeBuf[str.charCodeAt(i)]; - - return buf; -} - -SBCSEncoder.prototype.end = function() { -} - - -function SBCSDecoder(options, codec) { - this.decodeBuf = codec.decodeBuf; -} - -SBCSDecoder.prototype.write = function(buf) { - // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. - var decodeBuf = this.decodeBuf; - var newBuf = Buffer.alloc(buf.length*2); - var idx1 = 0, idx2 = 0; - for (var i = 0; i < buf.length; i++) { - idx1 = buf[i]*2; idx2 = i*2; - newBuf[idx2] = decodeBuf[idx1]; - newBuf[idx2+1] = decodeBuf[idx1+1]; - } - return newBuf.toString('ucs2'); -} - -SBCSDecoder.prototype.end = function() { -} - - -/***/ }), - -<<<<<<< HEAD -/***/ 16804: -======= -/***/ 43281: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - - - -// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. -module.exports = { - "437": "cp437", - "737": "cp737", - "775": "cp775", - "850": "cp850", - "852": "cp852", - "855": "cp855", - "856": "cp856", - "857": "cp857", - "858": "cp858", - "860": "cp860", - "861": "cp861", - "862": "cp862", - "863": "cp863", - "864": "cp864", - "865": "cp865", - "866": "cp866", - "869": "cp869", - "874": "windows874", - "922": "cp922", - "1046": "cp1046", - "1124": "cp1124", - "1125": "cp1125", - "1129": "cp1129", - "1133": "cp1133", - "1161": "cp1161", - "1162": "cp1162", - "1163": "cp1163", - "1250": "windows1250", - "1251": "windows1251", - "1252": "windows1252", - "1253": "windows1253", - "1254": "windows1254", - "1255": "windows1255", - "1256": "windows1256", - "1257": "windows1257", - "1258": "windows1258", - "28591": "iso88591", - "28592": "iso88592", - "28593": "iso88593", - "28594": "iso88594", - "28595": "iso88595", - "28596": "iso88596", - "28597": "iso88597", - "28598": "iso88598", - "28599": "iso88599", - "28600": "iso885910", - "28601": "iso885911", - "28603": "iso885913", - "28604": "iso885914", - "28605": "iso885915", - "28606": "iso885916", - "windows874": { - "type": "_sbcs", - "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - }, - "win874": "windows874", - "cp874": "windows874", - "windows1250": { - "type": "_sbcs", - "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" - }, - "win1250": "windows1250", - "cp1250": "windows1250", - "windows1251": { - "type": "_sbcs", - "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" - }, - "win1251": "windows1251", - "cp1251": "windows1251", - "windows1252": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "win1252": "windows1252", - "cp1252": "windows1252", - "windows1253": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" - }, - "win1253": "windows1253", - "cp1253": "windows1253", - "windows1254": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" - }, - "win1254": "windows1254", - "cp1254": "windows1254", - "windows1255": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" - }, - "win1255": "windows1255", - "cp1255": "windows1255", - "windows1256": { - "type": "_sbcs", - "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" - }, - "win1256": "windows1256", - "cp1256": "windows1256", - "windows1257": { - "type": "_sbcs", - "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" - }, - "win1257": "windows1257", - "cp1257": "windows1257", - "windows1258": { - "type": "_sbcs", - "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" - }, - "win1258": "windows1258", - "cp1258": "windows1258", - "iso88591": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "cp28591": "iso88591", - "iso88592": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" - }, - "cp28592": "iso88592", - "iso88593": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�Ż°ħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" - }, - "cp28593": "iso88593", - "iso88594": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤ĨĻ§¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩļˇ¸šēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖ×ØŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" - }, - "cp28594": "iso88594", - "iso88595": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" - }, - "cp28595": "iso88595", - "iso88596": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" - }, - "cp28596": "iso88596", - "iso88597": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" - }, - "cp28597": "iso88597", - "iso88598": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" - }, - "cp28598": "iso88598", - "iso88599": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" - }, - "cp28599": "iso88599", - "iso885910": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨĶ§ĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" - }, - "cp28600": "iso885910", - "iso885911": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - }, - "cp28601": "iso885911", - "iso885913": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" - }, - "cp28603": "iso885913", - "iso885914": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" - }, - "cp28604": "iso885914", - "iso885915": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "cp28605": "iso885915", - "iso885916": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Š§š©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" - }, - "cp28606": "iso885916", - "cp437": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm437": "cp437", - "csibm437": "cp437", - "cp737": { - "type": "_sbcs", - "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " - }, - "ibm737": "cp737", - "csibm737": "cp737", - "cp775": { - "type": "_sbcs", - "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£ØפĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " - }, - "ibm775": "cp775", - "csibm775": "cp775", - "cp850": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " - }, - "ibm850": "cp850", - "csibm850": "cp850", - "cp852": { - "type": "_sbcs", - "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " - }, - "ibm852": "cp852", - "csibm852": "cp852", - "cp855": { - "type": "_sbcs", - "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " - }, - "ibm855": "cp855", - "csibm855": "cp855", - "cp856": { - "type": "_sbcs", - "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " - }, - "ibm856": "cp856", - "csibm856": "cp856", - "cp857": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " - }, - "ibm857": "cp857", - "csibm857": "cp857", - "cp858": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " - }, - "ibm858": "cp858", - "csibm858": "cp858", - "cp860": { - "type": "_sbcs", - "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm860": "cp860", - "csibm860": "cp860", - "cp861": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm861": "cp861", - "csibm861": "cp861", - "cp862": { - "type": "_sbcs", - "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm862": "cp862", - "csibm862": "cp862", - "cp863": { - "type": "_sbcs", - "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm863": "cp863", - "csibm863": "cp863", - "cp864": { - "type": "_sbcs", - "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" - }, - "ibm864": "cp864", - "csibm864": "cp864", - "cp865": { - "type": "_sbcs", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm865": "cp865", - "csibm865": "cp865", - "cp866": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " - }, - "ibm866": "cp866", - "csibm866": "cp866", - "cp869": { - "type": "_sbcs", - "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " - }, - "ibm869": "cp869", - "csibm869": "cp869", - "cp922": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖ×ØÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" - }, - "ibm922": "cp922", - "csibm922": "cp922", - "cp1046": { - "type": "_sbcs", - "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" - }, - "ibm1046": "cp1046", - "csibm1046": "cp1046", - "cp1124": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" - }, - "ibm1124": "cp1124", - "csibm1124": "cp1124", - "cp1125": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " - }, - "ibm1125": "cp1125", - "csibm1125": "cp1125", - "cp1129": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" - }, - "ibm1129": "cp1129", - "csibm1129": "cp1129", - "cp1133": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" - }, - "ibm1133": "cp1133", - "csibm1133": "cp1133", - "cp1161": { - "type": "_sbcs", - "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " - }, - "ibm1161": "cp1161", - "csibm1161": "cp1161", - "cp1162": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - }, - "ibm1162": "cp1162", - "csibm1162": "cp1162", - "cp1163": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" - }, - "ibm1163": "cp1163", - "csibm1163": "cp1163", - "maccroatian": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" - }, - "maccyrillic": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" - }, - "macgreek": { - "type": "_sbcs", - "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" - }, - "maciceland": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macroman": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macromania": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macthai": { - "type": "_sbcs", - "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" - }, - "macturkish": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macukraine": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" - }, - "koi8r": { - "type": "_sbcs", - "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "koi8u": { - "type": "_sbcs", - "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "koi8ru": { - "type": "_sbcs", - "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "koi8t": { - "type": "_sbcs", - "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "armscii8": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" - }, - "rk1048": { - "type": "_sbcs", - "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" - }, - "tcvn": { - "type": "_sbcs", - "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" - }, - "georgianacademy": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "georgianps": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "pt154": { - "type": "_sbcs", - "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" - }, - "viscii": { - "type": "_sbcs", - "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" - }, - "iso646cn": { - "type": "_sbcs", - "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" - }, - "iso646jp": { - "type": "_sbcs", - "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" - }, - "hproman8": { - "type": "_sbcs", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" - }, - "macintosh": { - "type": "_sbcs", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "ascii": { - "type": "_sbcs", - "chars": "��������������������������������������������������������������������������������������������������������������������������������" - }, - "tis620": { - "type": "_sbcs", - "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - } -} - -/***/ }), - -<<<<<<< HEAD -/***/ 25456: -======= -/***/ 94797: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - - - -// Manually added data to be used by sbcs codec in addition to generated one. - -module.exports = { - // Not supported by iconv, not sure why. - "10029": "maccenteuro", - "maccenteuro": { - "type": "_sbcs", - "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" - }, - - "808": "cp808", - "ibm808": "cp808", - "cp808": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " - }, - - "mik": { - "type": "_sbcs", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - - "cp720": { - "type": "_sbcs", - "chars": "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0" - }, - - // Aliases of generated encodings. - "ascii8bit": "ascii", - "usascii": "ascii", - "ansix34": "ascii", - "ansix341968": "ascii", - "ansix341986": "ascii", - "csascii": "ascii", - "cp367": "ascii", - "ibm367": "ascii", - "isoir6": "ascii", - "iso646us": "ascii", - "iso646irv": "ascii", - "us": "ascii", - - "latin1": "iso88591", - "latin2": "iso88592", - "latin3": "iso88593", - "latin4": "iso88594", - "latin5": "iso88599", - "latin6": "iso885910", - "latin7": "iso885913", - "latin8": "iso885914", - "latin9": "iso885915", - "latin10": "iso885916", - - "csisolatin1": "iso88591", - "csisolatin2": "iso88592", - "csisolatin3": "iso88593", - "csisolatin4": "iso88594", - "csisolatincyrillic": "iso88595", - "csisolatinarabic": "iso88596", - "csisolatingreek" : "iso88597", - "csisolatinhebrew": "iso88598", - "csisolatin5": "iso88599", - "csisolatin6": "iso885910", - - "l1": "iso88591", - "l2": "iso88592", - "l3": "iso88593", - "l4": "iso88594", - "l5": "iso88599", - "l6": "iso885910", - "l7": "iso885913", - "l8": "iso885914", - "l9": "iso885915", - "l10": "iso885916", - - "isoir14": "iso646jp", - "isoir57": "iso646cn", - "isoir100": "iso88591", - "isoir101": "iso88592", - "isoir109": "iso88593", - "isoir110": "iso88594", - "isoir144": "iso88595", - "isoir127": "iso88596", - "isoir126": "iso88597", - "isoir138": "iso88598", - "isoir148": "iso88599", - "isoir157": "iso885910", - "isoir166": "tis620", - "isoir179": "iso885913", - "isoir199": "iso885914", - "isoir203": "iso885915", - "isoir226": "iso885916", - - "cp819": "iso88591", - "ibm819": "iso88591", - - "cyrillic": "iso88595", - - "arabic": "iso88596", - "arabic8": "iso88596", - "ecma114": "iso88596", - "asmo708": "iso88596", - - "greek" : "iso88597", - "greek8" : "iso88597", - "ecma118" : "iso88597", - "elot928" : "iso88597", - - "hebrew": "iso88598", - "hebrew8": "iso88598", - - "turkish": "iso88599", - "turkish8": "iso88599", - - "thai": "iso885911", - "thai8": "iso885911", - - "celtic": "iso885914", - "celtic8": "iso885914", - "isoceltic": "iso885914", - - "tis6200": "tis620", - "tis62025291": "tis620", - "tis62025330": "tis620", - - "10000": "macroman", - "10006": "macgreek", - "10007": "maccyrillic", - "10079": "maciceland", - "10081": "macturkish", - - "cspc8codepage437": "cp437", - "cspc775baltic": "cp775", - "cspc850multilingual": "cp850", - "cspcp852": "cp852", - "cspc862latinhebrew": "cp862", - "cpgr": "cp869", - - "msee": "cp1250", - "mscyrl": "cp1251", - "msansi": "cp1252", - "msgreek": "cp1253", - "msturk": "cp1254", - "mshebr": "cp1255", - "msarab": "cp1256", - "winbaltrim": "cp1257", - - "cp20866": "koi8r", - "20866": "koi8r", - "ibm878": "koi8r", - "cskoi8r": "koi8r", - - "cp21866": "koi8u", - "21866": "koi8u", - "ibm1168": "koi8u", - - "strk10482002": "rk1048", - - "tcvn5712": "tcvn", - "tcvn57121": "tcvn", - - "gb198880": "iso646cn", - "cn": "iso646cn", - - "csiso14jisc6220ro": "iso646jp", - "jisc62201969ro": "iso646jp", - "jp": "iso646jp", - - "cshproman8": "hproman8", - "r8": "hproman8", - "roman8": "hproman8", - "xroman8": "hproman8", - "ibm1051": "hproman8", - - "mac": "macintosh", - "csmacintosh": "macintosh", -}; - /***/ }), -<<<<<<< HEAD -/***/ 28712: -======= -/***/ 71611: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -<<<<<<< HEAD -var Buffer = (__nccwpck_require__(95944).Buffer); -======= -var Buffer = (__nccwpck_require__(25213).Buffer); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js - -// == UTF16-BE codec. ========================================================== - -exports.utf16be = Utf16BECodec; -function Utf16BECodec() { -} - -Utf16BECodec.prototype.encoder = Utf16BEEncoder; -Utf16BECodec.prototype.decoder = Utf16BEDecoder; -Utf16BECodec.prototype.bomAware = true; - - -// -- Encoding - -function Utf16BEEncoder() { -} - -Utf16BEEncoder.prototype.write = function(str) { - var buf = Buffer.from(str, 'ucs2'); - for (var i = 0; i < buf.length; i += 2) { - var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp; - } - return buf; -} - -Utf16BEEncoder.prototype.end = function() { -} - - -// -- Decoding - -function Utf16BEDecoder() { - this.overflowByte = -1; -} - -Utf16BEDecoder.prototype.write = function(buf) { - if (buf.length == 0) - return ''; - - var buf2 = Buffer.alloc(buf.length + 1), - i = 0, j = 0; - - if (this.overflowByte !== -1) { - buf2[0] = buf[0]; - buf2[1] = this.overflowByte; - i = 1; j = 2; - } - - for (; i < buf.length-1; i += 2, j+= 2) { - buf2[j] = buf[i+1]; - buf2[j+1] = buf[i]; - } - - this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1; - - return buf2.slice(0, j).toString('ucs2'); -} - -Utf16BEDecoder.prototype.end = function() { - this.overflowByte = -1; -} - - -// == UTF-16 codec ============================================================= -// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. -// Defaults to UTF-16LE, as it's prevalent and default in Node. -// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le -// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); - -// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). - -exports.utf16 = Utf16Codec; -function Utf16Codec(codecOptions, iconv) { - this.iconv = iconv; -} - -Utf16Codec.prototype.encoder = Utf16Encoder; -Utf16Codec.prototype.decoder = Utf16Decoder; - - -// -- Encoding (pass-through) - -function Utf16Encoder(options, codec) { - options = options || {}; - if (options.addBOM === undefined) - options.addBOM = true; - this.encoder = codec.iconv.getEncoder('utf-16le', options); -} - -Utf16Encoder.prototype.write = function(str) { - return this.encoder.write(str); -} - -Utf16Encoder.prototype.end = function() { - return this.encoder.end(); -} - - -// -- Decoding - -function Utf16Decoder(options, codec) { - this.decoder = null; - this.initialBufs = []; - this.initialBufsLen = 0; - - this.options = options || {}; - this.iconv = codec.iconv; -} - -Utf16Decoder.prototype.write = function(buf) { - if (!this.decoder) { - // Codec is not chosen yet. Accumulate initial bytes. - this.initialBufs.push(buf); - this.initialBufsLen += buf.length; - - if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) - return ''; - - // We have enough bytes -> detect endianness. - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); - this.decoder = this.iconv.getDecoder(encoding, this.options); - - var resStr = ''; - for (var i = 0; i < this.initialBufs.length; i++) - resStr += this.decoder.write(this.initialBufs[i]); - - this.initialBufs.length = this.initialBufsLen = 0; - return resStr; - } - - return this.decoder.write(buf); -} - -Utf16Decoder.prototype.end = function() { - if (!this.decoder) { - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); - this.decoder = this.iconv.getDecoder(encoding, this.options); - - var resStr = ''; - for (var i = 0; i < this.initialBufs.length; i++) - resStr += this.decoder.write(this.initialBufs[i]); - - var trail = this.decoder.end(); - if (trail) - resStr += trail; - - this.initialBufs.length = this.initialBufsLen = 0; - return resStr; - } - return this.decoder.end(); -} - -function detectEncoding(bufs, defaultEncoding) { - var b = []; - var charsProcessed = 0; - var asciiCharsLE = 0, asciiCharsBE = 0; // Number of ASCII chars when decoded as LE or BE. - - outer_loop: - for (var i = 0; i < bufs.length; i++) { - var buf = bufs[i]; - for (var j = 0; j < buf.length; j++) { - b.push(buf[j]); - if (b.length === 2) { - if (charsProcessed === 0) { - // Check BOM first. - if (b[0] === 0xFF && b[1] === 0xFE) return 'utf-16le'; - if (b[0] === 0xFE && b[1] === 0xFF) return 'utf-16be'; - } - - if (b[0] === 0 && b[1] !== 0) asciiCharsBE++; - if (b[0] !== 0 && b[1] === 0) asciiCharsLE++; - - b.length = 0; - charsProcessed++; - - if (charsProcessed >= 100) { - break outer_loop; - } - } - } - } - - // Make decisions. - // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. - // So, we count ASCII as if it was LE or BE, and decide from that. - if (asciiCharsBE > asciiCharsLE) return 'utf-16be'; - if (asciiCharsBE < asciiCharsLE) return 'utf-16le'; - - // Couldn't decide (likely all zeros or not enough data). - return defaultEncoding || 'utf-16le'; -} +/***/ "./node_modules/core-js/modules/es6.string.big.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.big.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_404890__) { +"use strict"; +// B.2.3.3 String.prototype.big() +__nested_webpack_require_404890__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('big', function (createHTML) { + return function big() { + return createHTML(this, 'big', '', ''); + }; +}); /***/ }), -<<<<<<< HEAD -/***/ 28641: -======= -/***/ 85501: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - - -<<<<<<< HEAD -var Buffer = (__nccwpck_require__(95944).Buffer); -======= -var Buffer = (__nccwpck_require__(25213).Buffer); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -// == UTF32-LE/BE codec. ========================================================== - -exports._utf32 = Utf32Codec; - -function Utf32Codec(codecOptions, iconv) { - this.iconv = iconv; - this.bomAware = true; - this.isLE = codecOptions.isLE; -} - -exports.utf32le = { type: '_utf32', isLE: true }; -exports.utf32be = { type: '_utf32', isLE: false }; - -// Aliases -exports.ucs4le = 'utf32le'; -exports.ucs4be = 'utf32be'; - -Utf32Codec.prototype.encoder = Utf32Encoder; -Utf32Codec.prototype.decoder = Utf32Decoder; - -// -- Encoding - -function Utf32Encoder(options, codec) { - this.isLE = codec.isLE; - this.highSurrogate = 0; -} - -Utf32Encoder.prototype.write = function(str) { - var src = Buffer.from(str, 'ucs2'); - var dst = Buffer.alloc(src.length * 2); - var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE; - var offset = 0; - - for (var i = 0; i < src.length; i += 2) { - var code = src.readUInt16LE(i); - var isHighSurrogate = (0xD800 <= code && code < 0xDC00); - var isLowSurrogate = (0xDC00 <= code && code < 0xE000); - - if (this.highSurrogate) { - if (isHighSurrogate || !isLowSurrogate) { - // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low - // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character - // (technically wrong, but expected by some applications, like Windows file names). - write32.call(dst, this.highSurrogate, offset); - offset += 4; - } - else { - // Create 32-bit value from high and low surrogates; - var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000; - - write32.call(dst, codepoint, offset); - offset += 4; - this.highSurrogate = 0; - - continue; - } - } - - if (isHighSurrogate) - this.highSurrogate = code; - else { - // Even if the current character is a low surrogate, with no previous high surrogate, we'll - // encode it as a semi-invalid stand-alone character for the same reasons expressed above for - // unpaired high surrogates. - write32.call(dst, code, offset); - offset += 4; - this.highSurrogate = 0; - } - } - - if (offset < dst.length) - dst = dst.slice(0, offset); - - return dst; -}; - -Utf32Encoder.prototype.end = function() { - // Treat any leftover high surrogate as a semi-valid independent character. - if (!this.highSurrogate) - return; - - var buf = Buffer.alloc(4); - - if (this.isLE) - buf.writeUInt32LE(this.highSurrogate, 0); - else - buf.writeUInt32BE(this.highSurrogate, 0); - - this.highSurrogate = 0; +/***/ "./node_modules/core-js/modules/es6.string.blink.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.blink.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_405493__) { - return buf; -}; +"use strict"; -// -- Decoding +// B.2.3.4 String.prototype.blink() +__nested_webpack_require_405493__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('blink', function (createHTML) { + return function blink() { + return createHTML(this, 'blink', '', ''); + }; +}); -function Utf32Decoder(options, codec) { - this.isLE = codec.isLE; - this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0); - this.overflow = []; -} -Utf32Decoder.prototype.write = function(src) { - if (src.length === 0) - return ''; +/***/ }), - var i = 0; - var codepoint = 0; - var dst = Buffer.alloc(src.length + 4); - var offset = 0; - var isLE = this.isLE; - var overflow = this.overflow; - var badChar = this.badChar; +/***/ "./node_modules/core-js/modules/es6.string.bold.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.bold.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_406100__) { - if (overflow.length > 0) { - for (; i < src.length && overflow.length < 4; i++) - overflow.push(src[i]); - - if (overflow.length === 4) { - // NOTE: codepoint is a signed int32 and can be negative. - // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). - if (isLE) { - codepoint = overflow[i] | (overflow[i+1] << 8) | (overflow[i+2] << 16) | (overflow[i+3] << 24); - } else { - codepoint = overflow[i+3] | (overflow[i+2] << 8) | (overflow[i+1] << 16) | (overflow[i] << 24); - } - overflow.length = 0; +"use strict"; - offset = _writeCodepoint(dst, offset, codepoint, badChar); - } - } +// B.2.3.5 String.prototype.bold() +__nested_webpack_require_406100__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('bold', function (createHTML) { + return function bold() { + return createHTML(this, 'b', '', ''); + }; +}); - // Main loop. Should be as optimized as possible. - for (; i < src.length - 3; i += 4) { - // NOTE: codepoint is a signed int32 and can be negative. - if (isLE) { - codepoint = src[i] | (src[i+1] << 8) | (src[i+2] << 16) | (src[i+3] << 24); - } else { - codepoint = src[i+3] | (src[i+2] << 8) | (src[i+1] << 16) | (src[i] << 24); - } - offset = _writeCodepoint(dst, offset, codepoint, badChar); - } - // Keep overflowing bytes. - for (; i < src.length; i++) { - overflow.push(src[i]); - } +/***/ }), - return dst.slice(0, offset).toString('ucs2'); -}; +/***/ "./node_modules/core-js/modules/es6.string.code-point-at.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.code-point-at.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_406736__) { -function _writeCodepoint(dst, offset, codepoint, badChar) { - // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. - if (codepoint < 0 || codepoint > 0x10FFFF) { - // Not a valid Unicode codepoint - codepoint = badChar; - } +"use strict"; - // Ephemeral Planes: Write high surrogate. - if (codepoint >= 0x10000) { - codepoint -= 0x10000; +var $export = __nested_webpack_require_406736__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $at = __nested_webpack_require_406736__(/*! ./_string-at */ "./node_modules/core-js/modules/_string-at.js")(false); +$export($export.P, 'String', { + // 21.1.3.3 String.prototype.codePointAt(pos) + codePointAt: function codePointAt(pos) { + return $at(this, pos); + } +}); - var high = 0xD800 | (codepoint >> 10); - dst[offset++] = high & 0xff; - dst[offset++] = high >> 8; - // Low surrogate is written below. - var codepoint = 0xDC00 | (codepoint & 0x3FF); - } +/***/ }), - // Write BMP char or low surrogate. - dst[offset++] = codepoint & 0xff; - dst[offset++] = codepoint >> 8; +/***/ "./node_modules/core-js/modules/es6.string.ends-with.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.ends-with.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_407479__) { - return offset; -}; +"use strict"; +// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) -Utf32Decoder.prototype.end = function() { - this.overflow.length = 0; -}; +var $export = __nested_webpack_require_407479__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toLength = __nested_webpack_require_407479__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var context = __nested_webpack_require_407479__(/*! ./_string-context */ "./node_modules/core-js/modules/_string-context.js"); +var ENDS_WITH = 'endsWith'; +var $endsWith = ''[ENDS_WITH]; -// == UTF-32 Auto codec ============================================================= -// Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic. -// Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32 -// Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'}); +$export($export.P + $export.F * __nested_webpack_require_407479__(/*! ./_fails-is-regexp */ "./node_modules/core-js/modules/_fails-is-regexp.js")(ENDS_WITH), 'String', { + endsWith: function endsWith(searchString /* , endPosition = @length */) { + var that = context(this, searchString, ENDS_WITH); + var endPosition = arguments.length > 1 ? arguments[1] : undefined; + var len = toLength(that.length); + var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); + var search = String(searchString); + return $endsWith + ? $endsWith.call(that, search, end) + : that.slice(end - search.length, end) === search; + } +}); -// Encoder prepends BOM (which can be overridden with (addBOM: false}). -exports.utf32 = Utf32AutoCodec; -exports.ucs4 = 'utf32'; +/***/ }), -function Utf32AutoCodec(options, iconv) { - this.iconv = iconv; -} +/***/ "./node_modules/core-js/modules/es6.string.fixed.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.fixed.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_408936__) { -Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder; -Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder; +"use strict"; -// -- Encoding +// B.2.3.6 String.prototype.fixed() +__nested_webpack_require_408936__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('fixed', function (createHTML) { + return function fixed() { + return createHTML(this, 'tt', '', ''); + }; +}); -function Utf32AutoEncoder(options, codec) { - options = options || {}; - if (options.addBOM === undefined) - options.addBOM = true; +/***/ }), - this.encoder = codec.iconv.getEncoder(options.defaultEncoding || 'utf-32le', options); -} +/***/ "./node_modules/core-js/modules/es6.string.fontcolor.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.fontcolor.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_409560__) { -Utf32AutoEncoder.prototype.write = function(str) { - return this.encoder.write(str); -}; +"use strict"; -Utf32AutoEncoder.prototype.end = function() { - return this.encoder.end(); -}; +// B.2.3.7 String.prototype.fontcolor(color) +__nested_webpack_require_409560__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('fontcolor', function (createHTML) { + return function fontcolor(color) { + return createHTML(this, 'font', 'color', color); + }; +}); -// -- Decoding -function Utf32AutoDecoder(options, codec) { - this.decoder = null; - this.initialBufs = []; - this.initialBufsLen = 0; - this.options = options || {}; - this.iconv = codec.iconv; -} +/***/ }), -Utf32AutoDecoder.prototype.write = function(buf) { - if (!this.decoder) { - // Codec is not chosen yet. Accumulate initial bytes. - this.initialBufs.push(buf); - this.initialBufsLen += buf.length; +/***/ "./node_modules/core-js/modules/es6.string.fontsize.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.fontsize.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_410212__) { - if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) - return ''; +"use strict"; - // We have enough bytes -> detect endianness. - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); - this.decoder = this.iconv.getDecoder(encoding, this.options); +// B.2.3.8 String.prototype.fontsize(size) +__nested_webpack_require_410212__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('fontsize', function (createHTML) { + return function fontsize(size) { + return createHTML(this, 'font', 'size', size); + }; +}); - var resStr = ''; - for (var i = 0; i < this.initialBufs.length; i++) - resStr += this.decoder.write(this.initialBufs[i]); - this.initialBufs.length = this.initialBufsLen = 0; - return resStr; - } +/***/ }), - return this.decoder.write(buf); -}; +/***/ "./node_modules/core-js/modules/es6.string.from-code-point.js": +/*!********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.from-code-point.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_410885__) { -Utf32AutoDecoder.prototype.end = function() { - if (!this.decoder) { - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); - this.decoder = this.iconv.getDecoder(encoding, this.options); +var $export = __nested_webpack_require_410885__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toAbsoluteIndex = __nested_webpack_require_410885__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); +var fromCharCode = String.fromCharCode; +var $fromCodePoint = String.fromCodePoint; - var resStr = ''; - for (var i = 0; i < this.initialBufs.length; i++) - resStr += this.decoder.write(this.initialBufs[i]); +// length should be 1, old FF problem +$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { + // 21.1.2.2 String.fromCodePoint(...codePoints) + fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars + var res = []; + var aLen = arguments.length; + var i = 0; + var code; + while (aLen > i) { + code = +arguments[i++]; + if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); + res.push(code < 0x10000 + ? fromCharCode(code) + : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) + ); + } return res.join(''); + } +}); - var trail = this.decoder.end(); - if (trail) - resStr += trail; - this.initialBufs.length = this.initialBufsLen = 0; - return resStr; - } +/***/ }), - return this.decoder.end(); -}; +/***/ "./node_modules/core-js/modules/es6.string.includes.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.includes.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_412247__) { -function detectEncoding(bufs, defaultEncoding) { - var b = []; - var charsProcessed = 0; - var invalidLE = 0, invalidBE = 0; // Number of invalid chars when decoded as LE or BE. - var bmpCharsLE = 0, bmpCharsBE = 0; // Number of BMP chars when decoded as LE or BE. +"use strict"; +// 21.1.3.7 String.prototype.includes(searchString, position = 0) - outer_loop: - for (var i = 0; i < bufs.length; i++) { - var buf = bufs[i]; - for (var j = 0; j < buf.length; j++) { - b.push(buf[j]); - if (b.length === 4) { - if (charsProcessed === 0) { - // Check BOM first. - if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { - return 'utf-32le'; - } - if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { - return 'utf-32be'; - } - } +var $export = __nested_webpack_require_412247__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var context = __nested_webpack_require_412247__(/*! ./_string-context */ "./node_modules/core-js/modules/_string-context.js"); +var INCLUDES = 'includes'; - if (b[0] !== 0 || b[1] > 0x10) invalidBE++; - if (b[3] !== 0 || b[2] > 0x10) invalidLE++; +$export($export.P + $export.F * __nested_webpack_require_412247__(/*! ./_fails-is-regexp */ "./node_modules/core-js/modules/_fails-is-regexp.js")(INCLUDES), 'String', { + includes: function includes(searchString /* , position = 0 */) { + return !!~context(this, searchString, INCLUDES) + .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); + } +}); - if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++; - if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++; - b.length = 0; - charsProcessed++; +/***/ }), - if (charsProcessed >= 100) { - break outer_loop; - } - } - } - } +/***/ "./node_modules/core-js/modules/es6.string.italics.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.italics.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_413287__) { - // Make decisions. - if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return 'utf-32be'; - if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return 'utf-32le'; +"use strict"; - // Couldn't decide (likely all zeros or not enough data). - return defaultEncoding || 'utf-32le'; -} +// B.2.3.9 String.prototype.italics() +__nested_webpack_require_413287__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('italics', function (createHTML) { + return function italics() { + return createHTML(this, 'i', '', ''); + }; +}); /***/ }), -<<<<<<< HEAD -/***/ 79211: -======= -/***/ 64846: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.string.iterator.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.iterator.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_413912__) { +"use strict"; -<<<<<<< HEAD -var Buffer = (__nccwpck_require__(95944).Buffer); -======= -var Buffer = (__nccwpck_require__(25213).Buffer); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var $at = __nested_webpack_require_413912__(/*! ./_string-at */ "./node_modules/core-js/modules/_string-at.js")(true); -// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 -// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 +// 21.1.3.27 String.prototype[@@iterator]() +__nested_webpack_require_413912__(/*! ./_iter-define */ "./node_modules/core-js/modules/_iter-define.js")(String, 'String', function (iterated) { + this._t = String(iterated); // target + this._i = 0; // next index +// 21.1.5.2.1 %StringIteratorPrototype%.next() +}, function () { + var O = this._t; + var index = this._i; + var point; + if (index >= O.length) return { value: undefined, done: true }; + point = $at(O, index); + this._i += point.length; + return { value: point, done: false }; +}); -exports.utf7 = Utf7Codec; -exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7 -function Utf7Codec(codecOptions, iconv) { - this.iconv = iconv; -}; -Utf7Codec.prototype.encoder = Utf7Encoder; -Utf7Codec.prototype.decoder = Utf7Decoder; -Utf7Codec.prototype.bomAware = true; +/***/ }), +/***/ "./node_modules/core-js/modules/es6.string.link.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.link.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_414922__) { -// -- Encoding +"use strict"; -var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; +// B.2.3.10 String.prototype.link(url) +__nested_webpack_require_414922__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('link', function (createHTML) { + return function link(url) { + return createHTML(this, 'a', 'href', url); + }; +}); -function Utf7Encoder(options, codec) { - this.iconv = codec.iconv; -} -Utf7Encoder.prototype.write = function(str) { - // Naive implementation. - // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". - return Buffer.from(str.replace(nonDirectChars, function(chunk) { - return "+" + (chunk === '+' ? '' : - this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) - + "-"; - }.bind(this))); -} +/***/ }), -Utf7Encoder.prototype.end = function() { -} +/***/ "./node_modules/core-js/modules/es6.string.raw.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.raw.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_415530__) { +var $export = __nested_webpack_require_415530__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toIObject = __nested_webpack_require_415530__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var toLength = __nested_webpack_require_415530__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); -// -- Decoding +$export($export.S, 'String', { + // 21.1.2.4 String.raw(callSite, ...substitutions) + raw: function raw(callSite) { + var tpl = toIObject(callSite.raw); + var len = toLength(tpl.length); + var aLen = arguments.length; + var res = []; + var i = 0; + while (len > i) { + res.push(String(tpl[i++])); + if (i < aLen) res.push(String(arguments[i])); + } return res.join(''); + } +}); -function Utf7Decoder(options, codec) { - this.iconv = codec.iconv; - this.inBase64 = false; - this.base64Accum = ''; -} -var base64Regex = /[A-Za-z0-9\/+]/; -var base64Chars = []; -for (var i = 0; i < 256; i++) - base64Chars[i] = base64Regex.test(String.fromCharCode(i)); +/***/ }), -var plusChar = '+'.charCodeAt(0), - minusChar = '-'.charCodeAt(0), - andChar = '&'.charCodeAt(0); +/***/ "./node_modules/core-js/modules/es6.string.repeat.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.repeat.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_416595__) { -Utf7Decoder.prototype.write = function(buf) { - var res = "", lastI = 0, - inBase64 = this.inBase64, - base64Accum = this.base64Accum; +var $export = __nested_webpack_require_416595__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - // The decoder is more involved as we must handle chunks in stream. +$export($export.P, 'String', { + // 21.1.3.13 String.prototype.repeat(count) + repeat: __nested_webpack_require_416595__(/*! ./_string-repeat */ "./node_modules/core-js/modules/_string-repeat.js") +}); - for (var i = 0; i < buf.length; i++) { - if (!inBase64) { // We're in direct mode. - // Write direct chars until '+' - if (buf[i] == plusChar) { - res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. - lastI = i+1; - inBase64 = true; - } - } else { // We decode base64. - if (!base64Chars[buf[i]]) { // Base64 ended. - if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" - res += "+"; - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii"); - res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); - } - if (buf[i] != minusChar) // Minus is absorbed after base64. - i--; +/***/ }), - lastI = i+1; - inBase64 = false; - base64Accum = ''; - } - } - } +/***/ "./node_modules/core-js/modules/es6.string.small.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.small.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_417232__) { - if (!inBase64) { - res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii"); +"use strict"; - var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. - base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. - b64str = b64str.slice(0, canBeDecoded); +// B.2.3.11 String.prototype.small() +__nested_webpack_require_417232__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('small', function (createHTML) { + return function small() { + return createHTML(this, 'small', '', ''); + }; +}); - res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); - } - this.inBase64 = inBase64; - this.base64Accum = base64Accum; +/***/ }), - return res; -} +/***/ "./node_modules/core-js/modules/es6.string.starts-with.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.starts-with.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_417868__) { -Utf7Decoder.prototype.end = function() { - var res = ""; - if (this.inBase64 && this.base64Accum.length > 0) - res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); +"use strict"; +// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) - this.inBase64 = false; - this.base64Accum = ''; - return res; -} +var $export = __nested_webpack_require_417868__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toLength = __nested_webpack_require_417868__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var context = __nested_webpack_require_417868__(/*! ./_string-context */ "./node_modules/core-js/modules/_string-context.js"); +var STARTS_WITH = 'startsWith'; +var $startsWith = ''[STARTS_WITH]; +$export($export.P + $export.F * __nested_webpack_require_417868__(/*! ./_fails-is-regexp */ "./node_modules/core-js/modules/_fails-is-regexp.js")(STARTS_WITH), 'String', { + startsWith: function startsWith(searchString /* , position = 0 */) { + var that = context(this, searchString, STARTS_WITH); + var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); + var search = String(searchString); + return $startsWith + ? $startsWith.call(that, search, index) + : that.slice(index, index + search.length) === search; + } +}); -// UTF-7-IMAP codec. -// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) -// Differences: -// * Base64 part is started by "&" instead of "+" -// * Direct characters are 0x20-0x7E, except "&" (0x26) -// * In Base64, "," is used instead of "/" -// * Base64 must not be used to represent direct characters. -// * No implicit shift back from Base64 (should always end with '-') -// * String must end in non-shifted position. -// * "-&" while in base64 is not allowed. +/***/ }), -exports.utf7imap = Utf7IMAPCodec; -function Utf7IMAPCodec(codecOptions, iconv) { - this.iconv = iconv; -}; +/***/ "./node_modules/core-js/modules/es6.string.strike.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.strike.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_419251__) { -Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder; -Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder; -Utf7IMAPCodec.prototype.bomAware = true; +"use strict"; +// B.2.3.12 String.prototype.strike() +__nested_webpack_require_419251__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('strike', function (createHTML) { + return function strike() { + return createHTML(this, 'strike', '', ''); + }; +}); -// -- Encoding -function Utf7IMAPEncoder(options, codec) { - this.iconv = codec.iconv; - this.inBase64 = false; - this.base64Accum = Buffer.alloc(6); - this.base64AccumIdx = 0; -} +/***/ }), -Utf7IMAPEncoder.prototype.write = function(str) { - var inBase64 = this.inBase64, - base64Accum = this.base64Accum, - base64AccumIdx = this.base64AccumIdx, - buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0; +/***/ "./node_modules/core-js/modules/es6.string.sub.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.sub.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_419859__) { - for (var i = 0; i < str.length; i++) { - var uChar = str.charCodeAt(i); - if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'. - if (inBase64) { - if (base64AccumIdx > 0) { - bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); - base64AccumIdx = 0; - } +"use strict"; - buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. - inBase64 = false; - } +// B.2.3.13 String.prototype.sub() +__nested_webpack_require_419859__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('sub', function (createHTML) { + return function sub() { + return createHTML(this, 'sub', '', ''); + }; +}); - if (!inBase64) { - buf[bufIdx++] = uChar; // Write direct character - if (uChar === andChar) // Ampersand -> '&-' - buf[bufIdx++] = minusChar; - } +/***/ }), - } else { // Non-direct character - if (!inBase64) { - buf[bufIdx++] = andChar; // Write '&', then go to base64 mode. - inBase64 = true; - } - if (inBase64) { - base64Accum[base64AccumIdx++] = uChar >> 8; - base64Accum[base64AccumIdx++] = uChar & 0xFF; +/***/ "./node_modules/core-js/modules/es6.string.sup.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.sup.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_420455__) { - if (base64AccumIdx == base64Accum.length) { - bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx); - base64AccumIdx = 0; - } - } - } - } +"use strict"; - this.inBase64 = inBase64; - this.base64AccumIdx = base64AccumIdx; +// B.2.3.14 String.prototype.sup() +__nested_webpack_require_420455__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('sup', function (createHTML) { + return function sup() { + return createHTML(this, 'sup', '', ''); + }; +}); - return buf.slice(0, bufIdx); -} -Utf7IMAPEncoder.prototype.end = function() { - var buf = Buffer.alloc(10), bufIdx = 0; - if (this.inBase64) { - if (this.base64AccumIdx > 0) { - bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); - this.base64AccumIdx = 0; - } +/***/ }), - buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. - this.inBase64 = false; - } +/***/ "./node_modules/core-js/modules/es6.string.trim.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.trim.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_421055__) { - return buf.slice(0, bufIdx); -} +"use strict"; +// 21.1.3.25 String.prototype.trim() +__nested_webpack_require_421055__(/*! ./_string-trim */ "./node_modules/core-js/modules/_string-trim.js")('trim', function ($trim) { + return function trim() { + return $trim(this, 3); + }; +}); -// -- Decoding -function Utf7IMAPDecoder(options, codec) { - this.iconv = codec.iconv; - this.inBase64 = false; - this.base64Accum = ''; -} +/***/ }), -var base64IMAPChars = base64Chars.slice(); -base64IMAPChars[','.charCodeAt(0)] = true; +/***/ "./node_modules/core-js/modules/es6.symbol.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/es6.symbol.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_421617__) { -Utf7IMAPDecoder.prototype.write = function(buf) { - var res = "", lastI = 0, - inBase64 = this.inBase64, - base64Accum = this.base64Accum; +"use strict"; - // The decoder is more involved as we must handle chunks in stream. - // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). +// ECMAScript 6 symbols shim +var global = __nested_webpack_require_421617__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var has = __nested_webpack_require_421617__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var DESCRIPTORS = __nested_webpack_require_421617__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); +var $export = __nested_webpack_require_421617__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var redefine = __nested_webpack_require_421617__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var META = __nested_webpack_require_421617__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").KEY; +var $fails = __nested_webpack_require_421617__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var shared = __nested_webpack_require_421617__(/*! ./_shared */ "./node_modules/core-js/modules/_shared.js"); +var setToStringTag = __nested_webpack_require_421617__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js"); +var uid = __nested_webpack_require_421617__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js"); +var wks = __nested_webpack_require_421617__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js"); +var wksExt = __nested_webpack_require_421617__(/*! ./_wks-ext */ "./node_modules/core-js/modules/_wks-ext.js"); +var wksDefine = __nested_webpack_require_421617__(/*! ./_wks-define */ "./node_modules/core-js/modules/_wks-define.js"); +var enumKeys = __nested_webpack_require_421617__(/*! ./_enum-keys */ "./node_modules/core-js/modules/_enum-keys.js"); +var isArray = __nested_webpack_require_421617__(/*! ./_is-array */ "./node_modules/core-js/modules/_is-array.js"); +var anObject = __nested_webpack_require_421617__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var isObject = __nested_webpack_require_421617__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var toObject = __nested_webpack_require_421617__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toIObject = __nested_webpack_require_421617__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var toPrimitive = __nested_webpack_require_421617__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); +var createDesc = __nested_webpack_require_421617__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); +var _create = __nested_webpack_require_421617__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js"); +var gOPNExt = __nested_webpack_require_421617__(/*! ./_object-gopn-ext */ "./node_modules/core-js/modules/_object-gopn-ext.js"); +var $GOPD = __nested_webpack_require_421617__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js"); +var $GOPS = __nested_webpack_require_421617__(/*! ./_object-gops */ "./node_modules/core-js/modules/_object-gops.js"); +var $DP = __nested_webpack_require_421617__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); +var $keys = __nested_webpack_require_421617__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); +var gOPD = $GOPD.f; +var dP = $DP.f; +var gOPN = gOPNExt.f; +var $Symbol = global.Symbol; +var $JSON = global.JSON; +var _stringify = $JSON && $JSON.stringify; +var PROTOTYPE = 'prototype'; +var HIDDEN = wks('_hidden'); +var TO_PRIMITIVE = wks('toPrimitive'); +var isEnum = {}.propertyIsEnumerable; +var SymbolRegistry = shared('symbol-registry'); +var AllSymbols = shared('symbols'); +var OPSymbols = shared('op-symbols'); +var ObjectProto = Object[PROTOTYPE]; +var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f; +var QObject = global.QObject; +// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 +var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; - for (var i = 0; i < buf.length; i++) { - if (!inBase64) { // We're in direct mode. - // Write direct chars until '&' - if (buf[i] == andChar) { - res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. - lastI = i+1; - inBase64 = true; - } - } else { // We decode base64. - if (!base64IMAPChars[buf[i]]) { // Base64 ended. - if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" - res += "&"; - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, '/'); - res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); - } +// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 +var setSymbolDesc = DESCRIPTORS && $fails(function () { + return _create(dP({}, 'a', { + get: function () { return dP(this, 'a', { value: 7 }).a; } + })).a != 7; +}) ? function (it, key, D) { + var protoDesc = gOPD(ObjectProto, key); + if (protoDesc) delete ObjectProto[key]; + dP(it, key, D); + if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); +} : dP; - if (buf[i] != minusChar) // Minus may be absorbed after base64. - i--; +var wrap = function (tag) { + var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); + sym._k = tag; + return sym; +}; - lastI = i+1; - inBase64 = false; - base64Accum = ''; - } - } - } +var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { + return typeof it == 'symbol'; +} : function (it) { + return it instanceof $Symbol; +}; - if (!inBase64) { - res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. +var $defineProperty = function defineProperty(it, key, D) { + if (it === ObjectProto) $defineProperty(OPSymbols, key, D); + anObject(it); + key = toPrimitive(key, true); + anObject(D); + if (has(AllSymbols, key)) { + if (!D.enumerable) { + if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); + it[HIDDEN][key] = true; } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, '/'); + if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; + D = _create(D, { enumerable: createDesc(0, false) }); + } return setSymbolDesc(it, key, D); + } return dP(it, key, D); +}; +var $defineProperties = function defineProperties(it, P) { + anObject(it); + var keys = enumKeys(P = toIObject(P)); + var i = 0; + var l = keys.length; + var key; + while (l > i) $defineProperty(it, key = keys[i++], P[key]); + return it; +}; +var $create = function create(it, P) { + return P === undefined ? _create(it) : $defineProperties(_create(it), P); +}; +var $propertyIsEnumerable = function propertyIsEnumerable(key) { + var E = isEnum.call(this, key = toPrimitive(key, true)); + if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; + return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; +}; +var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { + it = toIObject(it); + key = toPrimitive(key, true); + if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; + var D = gOPD(it, key); + if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; + return D; +}; +var $getOwnPropertyNames = function getOwnPropertyNames(it) { + var names = gOPN(toIObject(it)); + var result = []; + var i = 0; + var key; + while (names.length > i) { + if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); + } return result; +}; +var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { + var IS_OP = it === ObjectProto; + var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); + var result = []; + var i = 0; + var key; + while (names.length > i) { + if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); + } return result; +}; - var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. - base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. - b64str = b64str.slice(0, canBeDecoded); +// 19.4.1.1 Symbol([description]) +if (!USE_NATIVE) { + $Symbol = function Symbol() { + if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); + var tag = uid(arguments.length > 0 ? arguments[0] : undefined); + var $set = function (value) { + if (this === ObjectProto) $set.call(OPSymbols, value); + if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, createDesc(1, value)); + }; + if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); + return wrap(tag); + }; + redefine($Symbol[PROTOTYPE], 'toString', function toString() { + return this._k; + }); - res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); - } + $GOPD.f = $getOwnPropertyDescriptor; + $DP.f = $defineProperty; + __nested_webpack_require_421617__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f = gOPNExt.f = $getOwnPropertyNames; + __nested_webpack_require_421617__(/*! ./_object-pie */ "./node_modules/core-js/modules/_object-pie.js").f = $propertyIsEnumerable; + $GOPS.f = $getOwnPropertySymbols; - this.inBase64 = inBase64; - this.base64Accum = base64Accum; + if (DESCRIPTORS && !__nested_webpack_require_421617__(/*! ./_library */ "./node_modules/core-js/modules/_library.js")) { + redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } - return res; + wksExt.f = function (name) { + return wrap(wks(name)); + }; } -Utf7IMAPDecoder.prototype.end = function() { - var res = ""; - if (this.inBase64 && this.base64Accum.length > 0) - res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); +$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); - this.inBase64 = false; - this.base64Accum = ''; - return res; -} +for (var es6Symbols = ( + // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' +).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]); +for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); +$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function (key) { + return has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(sym) { + if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); + for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; + }, + useSetter: function () { setter = true; }, + useSimple: function () { setter = false; } +}); +$export($export.S + $export.F * !USE_NATIVE, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols +}); -/***/ }), +// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives +// https://bugs.chromium.org/p/v8/issues/detail?id=3443 +var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); }); -<<<<<<< HEAD -/***/ 46685: -======= -/***/ 86302: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { +$export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', { + getOwnPropertySymbols: function getOwnPropertySymbols(it) { + return $GOPS.f(toObject(it)); + } +}); +// 24.3.2 JSON.stringify(value [, replacer [, space]]) +$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; +})), 'JSON', { + stringify: function stringify(it) { + var args = [it]; + var i = 1; + var replacer, $replacer; + while (arguments.length > i) args.push(arguments[i++]); + $replacer = replacer = args[1]; + if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined + if (!isArray(replacer)) replacer = function (key, value) { + if (typeof $replacer == 'function') value = $replacer.call(this, key, value); + if (!isSymbol(value)) return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } +}); +// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) +$Symbol[PROTOTYPE][TO_PRIMITIVE] || __nested_webpack_require_421617__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js")($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); +// 19.4.3.5 Symbol.prototype[@@toStringTag] +setToStringTag($Symbol, 'Symbol'); +// 20.2.1.9 Math[@@toStringTag] +setToStringTag(Math, 'Math', true); +// 24.3.3 JSON[@@toStringTag] +setToStringTag(global.JSON, 'JSON', true); -var BOMChar = '\uFEFF'; -exports.PrependBOM = PrependBOMWrapper -function PrependBOMWrapper(encoder, options) { - this.encoder = encoder; - this.addBOM = true; -} +/***/ }), -PrependBOMWrapper.prototype.write = function(str) { - if (this.addBOM) { - str = BOMChar + str; - this.addBOM = false; - } +/***/ "./node_modules/core-js/modules/es6.typed.array-buffer.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.array-buffer.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_433253__) { - return this.encoder.write(str); -} +"use strict"; -PrependBOMWrapper.prototype.end = function() { - return this.encoder.end(); -} +var $export = __nested_webpack_require_433253__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $typed = __nested_webpack_require_433253__(/*! ./_typed */ "./node_modules/core-js/modules/_typed.js"); +var buffer = __nested_webpack_require_433253__(/*! ./_typed-buffer */ "./node_modules/core-js/modules/_typed-buffer.js"); +var anObject = __nested_webpack_require_433253__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var toAbsoluteIndex = __nested_webpack_require_433253__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); +var toLength = __nested_webpack_require_433253__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var isObject = __nested_webpack_require_433253__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var ArrayBuffer = __nested_webpack_require_433253__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").ArrayBuffer; +var speciesConstructor = __nested_webpack_require_433253__(/*! ./_species-constructor */ "./node_modules/core-js/modules/_species-constructor.js"); +var $ArrayBuffer = buffer.ArrayBuffer; +var $DataView = buffer.DataView; +var $isView = $typed.ABV && ArrayBuffer.isView; +var $slice = $ArrayBuffer.prototype.slice; +var VIEW = $typed.VIEW; +var ARRAY_BUFFER = 'ArrayBuffer'; +$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); -//------------------------------------------------------------------------------ +$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { + // 24.1.3.1 ArrayBuffer.isView(arg) + isView: function isView(it) { + return $isView && $isView(it) || isObject(it) && VIEW in it; + } +}); -exports.StripBOM = StripBOMWrapper; -function StripBOMWrapper(decoder, options) { - this.decoder = decoder; - this.pass = false; - this.options = options || {}; -} +$export($export.P + $export.U + $export.F * __nested_webpack_require_433253__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + return !new $ArrayBuffer(2).slice(1, undefined).byteLength; +}), ARRAY_BUFFER, { + // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) + slice: function slice(start, end) { + if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix + var len = anObject(this).byteLength; + var first = toAbsoluteIndex(start, len); + var fin = toAbsoluteIndex(end === undefined ? len : end, len); + var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first)); + var viewS = new $DataView(this); + var viewT = new $DataView(result); + var index = 0; + while (first < fin) { + viewT.setUint8(index++, viewS.getUint8(first++)); + } return result; + } +}); -StripBOMWrapper.prototype.write = function(buf) { - var res = this.decoder.write(buf); - if (this.pass || !res) - return res; +__nested_webpack_require_433253__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js")(ARRAY_BUFFER); - if (res[0] === BOMChar) { - res = res.slice(1); - if (typeof this.options.stripBOM === 'function') - this.options.stripBOM(); - } - this.pass = true; - return res; -} +/***/ }), -StripBOMWrapper.prototype.end = function() { - return this.decoder.end(); -} +/***/ "./node_modules/core-js/modules/es6.typed.data-view.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.data-view.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_436125__) { +var $export = __nested_webpack_require_436125__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +$export($export.G + $export.W + $export.F * !__nested_webpack_require_436125__(/*! ./_typed */ "./node_modules/core-js/modules/_typed.js").ABV, { + DataView: __nested_webpack_require_436125__(/*! ./_typed-buffer */ "./node_modules/core-js/modules/_typed-buffer.js").DataView +}); /***/ }), -<<<<<<< HEAD -/***/ 72249: -======= -/***/ 17281: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es6.typed.float32-array.js": +/*!*****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.float32-array.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_436853__) { +__nested_webpack_require_436853__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Float32', 4, function (init) { + return function Float32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); -<<<<<<< HEAD -var Buffer = (__nccwpck_require__(95944).Buffer); +/***/ }), -var bomHandling = __nccwpck_require__(46685), -======= -var Buffer = (__nccwpck_require__(25213).Buffer); +/***/ "./node_modules/core-js/modules/es6.typed.float64-array.js": +/*!*****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.float64-array.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_437474__) { -var bomHandling = __nccwpck_require__(86302), ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - iconv = module.exports; +__nested_webpack_require_437474__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Float64', 8, function (init) { + return function Float64Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); -// All codecs and aliases are kept here, keyed by encoding name/alias. -// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. -iconv.encodings = null; -// Characters emitted in case of error. -iconv.defaultCharUnicode = '�'; -iconv.defaultCharSingleByte = '?'; +/***/ }), -// Public API. -iconv.encode = function encode(str, encoding, options) { - str = "" + (str || ""); // Ensure string. +/***/ "./node_modules/core-js/modules/es6.typed.int16-array.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.int16-array.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_438087__) { - var encoder = iconv.getEncoder(encoding, options); +__nested_webpack_require_438087__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Int16', 2, function (init) { + return function Int16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); - var res = encoder.write(str); - var trail = encoder.end(); - - return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res; -} -iconv.decode = function decode(buf, encoding, options) { - if (typeof buf === 'string') { - if (!iconv.skipDecodeWarning) { - console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding'); - iconv.skipDecodeWarning = true; - } +/***/ }), - buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer. - } +/***/ "./node_modules/core-js/modules/es6.typed.int32-array.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.int32-array.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_438696__) { - var decoder = iconv.getDecoder(encoding, options); +__nested_webpack_require_438696__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Int32', 4, function (init) { + return function Int32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); - var res = decoder.write(buf); - var trail = decoder.end(); - return trail ? (res + trail) : res; -} +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.typed.int8-array.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.int8-array.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_439301__) { + +__nested_webpack_require_439301__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Int8', 1, function (init) { + return function Int8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); -iconv.encodingExists = function encodingExists(enc) { - try { - iconv.getCodec(enc); - return true; - } catch (e) { - return false; - } -} -// Legacy aliases to convert functions -iconv.toEncoding = iconv.encode; -iconv.fromEncoding = iconv.decode; +/***/ }), -// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. -iconv._codecDataCache = {}; -iconv.getCodec = function getCodec(encoding) { - if (!iconv.encodings) -<<<<<<< HEAD - iconv.encodings = __nccwpck_require__(80742); // Lazy load all encoding definitions. -======= - iconv.encodings = __nccwpck_require__(80126); // Lazy load all encoding definitions. ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. - var enc = iconv._canonicalizeEncoding(encoding); +/***/ "./node_modules/core-js/modules/es6.typed.uint16-array.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.uint16-array.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_439912__) { - // Traverse iconv.encodings to find actual codec. - var codecOptions = {}; - while (true) { - var codec = iconv._codecDataCache[enc]; - if (codec) - return codec; +__nested_webpack_require_439912__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Uint16', 2, function (init) { + return function Uint16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); - var codecDef = iconv.encodings[enc]; - switch (typeof codecDef) { - case "string": // Direct alias to other encoding. - enc = codecDef; - break; +/***/ }), - case "object": // Alias with options. Can be layered. - for (var key in codecDef) - codecOptions[key] = codecDef[key]; +/***/ "./node_modules/core-js/modules/es6.typed.uint32-array.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.uint32-array.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_440527__) { - if (!codecOptions.encodingName) - codecOptions.encodingName = enc; - - enc = codecDef.type; - break; +__nested_webpack_require_440527__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Uint32', 4, function (init) { + return function Uint32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); - case "function": // Codec itself. - if (!codecOptions.encodingName) - codecOptions.encodingName = enc; - // The codec function must load all tables and return object with .encoder and .decoder methods. - // It'll be called only once (for each different options object). - codec = new codecDef(codecOptions, iconv); +/***/ }), - iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. - return codec; +/***/ "./node_modules/core-js/modules/es6.typed.uint8-array.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.uint8-array.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_441138__) { - default: - throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); - } - } -} +__nested_webpack_require_441138__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Uint8', 1, function (init) { + return function Uint8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); -iconv._canonicalizeEncoding = function(encoding) { - // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. - return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); -} -iconv.getEncoder = function getEncoder(encoding, options) { - var codec = iconv.getCodec(encoding), - encoder = new codec.encoder(options, codec); +/***/ }), - if (codec.bomAware && options && options.addBOM) - encoder = new bomHandling.PrependBOM(encoder, options); +/***/ "./node_modules/core-js/modules/es6.typed.uint8-clamped-array.js": +/*!***********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.uint8-clamped-array.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_441779__) { - return encoder; -} +__nested_webpack_require_441779__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Uint8', 1, function (init) { + return function Uint8ClampedArray(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}, true); -iconv.getDecoder = function getDecoder(encoding, options) { - var codec = iconv.getCodec(encoding), - decoder = new codec.decoder(options, codec); - if (codec.bomAware && !(options && options.stripBOM === false)) - decoder = new bomHandling.StripBOM(decoder, options); +/***/ }), - return decoder; -} +/***/ "./node_modules/core-js/modules/es6.weak-map.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.weak-map.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_442365__) { -// Streaming API -// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add -// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. -// If you would like to enable it explicitly, please add the following code to your app: -// > iconv.enableStreamingAPI(require('stream')); -iconv.enableStreamingAPI = function enableStreamingAPI(stream_module) { - if (iconv.supportsStreams) - return; +"use strict"; - // Dependency-inject stream module to create IconvLite stream classes. -<<<<<<< HEAD - var streams = __nccwpck_require__(31699)(stream_module); -======= - var streams = __nccwpck_require__(90016)(stream_module); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var global = __nested_webpack_require_442365__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var each = __nested_webpack_require_442365__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(0); +var redefine = __nested_webpack_require_442365__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var meta = __nested_webpack_require_442365__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js"); +var assign = __nested_webpack_require_442365__(/*! ./_object-assign */ "./node_modules/core-js/modules/_object-assign.js"); +var weak = __nested_webpack_require_442365__(/*! ./_collection-weak */ "./node_modules/core-js/modules/_collection-weak.js"); +var isObject = __nested_webpack_require_442365__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var validate = __nested_webpack_require_442365__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); +var NATIVE_WEAK_MAP = __nested_webpack_require_442365__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); +var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global; +var WEAK_MAP = 'WeakMap'; +var getWeak = meta.getWeak; +var isExtensible = Object.isExtensible; +var uncaughtFrozenStore = weak.ufstore; +var InternalMap; - // Not public API yet, but expose the stream classes. - iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream; - iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream; +var wrapper = function (get) { + return function WeakMap() { + return get(this, arguments.length > 0 ? arguments[0] : undefined); + }; +}; - // Streaming API. - iconv.encodeStream = function encodeStream(encoding, options) { - return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); +var methods = { + // 23.3.3.3 WeakMap.prototype.get(key) + get: function get(key) { + if (isObject(key)) { + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key); + return data ? data[this._i] : undefined; } + }, + // 23.3.3.5 WeakMap.prototype.set(key, value) + set: function set(key, value) { + return weak.def(validate(this, WEAK_MAP), key, value); + } +}; - iconv.decodeStream = function decodeStream(encoding, options) { - return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); - } +// 23.3 WeakMap Objects +var $WeakMap = module.exports = __nested_webpack_require_442365__(/*! ./_collection */ "./node_modules/core-js/modules/_collection.js")(WEAK_MAP, wrapper, methods, weak, true, true); - iconv.supportsStreams = true; +// IE11 WeakMap frozen keys fix +if (NATIVE_WEAK_MAP && IS_IE11) { + InternalMap = weak.getConstructor(wrapper, WEAK_MAP); + assign(InternalMap.prototype, methods); + meta.NEED = true; + each(['delete', 'has', 'get', 'set'], function (key) { + var proto = $WeakMap.prototype; + var method = proto[key]; + redefine(proto, key, function (a, b) { + // store frozen objects on internal weakmap shim + if (isObject(a) && !isExtensible(a)) { + if (!this._f) this._f = new InternalMap(); + var result = this._f[key](a, b); + return key == 'set' ? this : result; + // store all the rest on native weakmap + } return method.call(this, a, b); + }); + }); } -// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). -var stream_module; -try { - stream_module = __nccwpck_require__(12781); -} catch (e) {} -if (stream_module && stream_module.Transform) { - iconv.enableStreamingAPI(stream_module); +/***/ }), -} else { - // In rare cases where 'stream' module is not available by default, throw a helpful exception. - iconv.encodeStream = iconv.decodeStream = function() { - throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it."); - }; -} +/***/ "./node_modules/core-js/modules/es6.weak-set.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.weak-set.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_445372__) { -if (false) {} +"use strict"; + +var weak = __nested_webpack_require_445372__(/*! ./_collection-weak */ "./node_modules/core-js/modules/_collection-weak.js"); +var validate = __nested_webpack_require_445372__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); +var WEAK_SET = 'WeakSet'; + +// 23.4 WeakSet Objects +__nested_webpack_require_445372__(/*! ./_collection */ "./node_modules/core-js/modules/_collection.js")(WEAK_SET, function (get) { + return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.4.3.1 WeakSet.prototype.add(value) + add: function add(value) { + return weak.def(validate(this, WEAK_SET), value, true); + } +}, weak, false, true); /***/ }), -<<<<<<< HEAD -/***/ 31699: -======= -/***/ 90016: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es7.array.flat-map.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.array.flat-map.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_446415__) { +"use strict"; +// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap +var $export = __nested_webpack_require_446415__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var flattenIntoArray = __nested_webpack_require_446415__(/*! ./_flatten-into-array */ "./node_modules/core-js/modules/_flatten-into-array.js"); +var toObject = __nested_webpack_require_446415__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toLength = __nested_webpack_require_446415__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var aFunction = __nested_webpack_require_446415__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var arraySpeciesCreate = __nested_webpack_require_446415__(/*! ./_array-species-create */ "./node_modules/core-js/modules/_array-species-create.js"); -<<<<<<< HEAD -var Buffer = (__nccwpck_require__(95944).Buffer); -======= -var Buffer = (__nccwpck_require__(25213).Buffer); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +$export($export.P, 'Array', { + flatMap: function flatMap(callbackfn /* , thisArg */) { + var O = toObject(this); + var sourceLen, A; + aFunction(callbackfn); + sourceLen = toLength(O.length); + A = arraySpeciesCreate(O, 0); + flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]); + return A; + } +}); -// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), -// we opt to dependency-inject it instead of creating a hard dependency. -module.exports = function(stream_module) { - var Transform = stream_module.Transform; +__nested_webpack_require_446415__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")('flatMap'); - // == Encoder stream ======================================================= - function IconvLiteEncoderStream(conv, options) { - this.conv = conv; - options = options || {}; - options.decodeStrings = false; // We accept only strings, so we don't need to decode them. - Transform.call(this, options); - } +/***/ }), - IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { - constructor: { value: IconvLiteEncoderStream } - }); +/***/ "./node_modules/core-js/modules/es7.array.flatten.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.array.flatten.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_447987__) { - IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { - if (typeof chunk != 'string') - return done(new Error("Iconv encoding stream needs strings as its input.")); - try { - var res = this.conv.write(chunk); - if (res && res.length) this.push(res); - done(); - } - catch (e) { - done(e); - } - } +"use strict"; - IconvLiteEncoderStream.prototype._flush = function(done) { - try { - var res = this.conv.end(); - if (res && res.length) this.push(res); - done(); - } - catch (e) { - done(e); - } - } +// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten +var $export = __nested_webpack_require_447987__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var flattenIntoArray = __nested_webpack_require_447987__(/*! ./_flatten-into-array */ "./node_modules/core-js/modules/_flatten-into-array.js"); +var toObject = __nested_webpack_require_447987__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toLength = __nested_webpack_require_447987__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var toInteger = __nested_webpack_require_447987__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var arraySpeciesCreate = __nested_webpack_require_447987__(/*! ./_array-species-create */ "./node_modules/core-js/modules/_array-species-create.js"); - IconvLiteEncoderStream.prototype.collect = function(cb) { - var chunks = []; - this.on('error', cb); - this.on('data', function(chunk) { chunks.push(chunk); }); - this.on('end', function() { - cb(null, Buffer.concat(chunks)); - }); - return this; - } +$export($export.P, 'Array', { + flatten: function flatten(/* depthArg = 1 */) { + var depthArg = arguments[0]; + var O = toObject(this); + var sourceLen = toLength(O.length); + var A = arraySpeciesCreate(O, 0); + flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); + return A; + } +}); +__nested_webpack_require_447987__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")('flatten'); - // == Decoder stream ======================================================= - function IconvLiteDecoderStream(conv, options) { - this.conv = conv; - options = options || {}; - options.encoding = this.encoding = 'utf8'; // We output strings. - Transform.call(this, options); - } +/***/ }), - IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { - constructor: { value: IconvLiteDecoderStream } - }); +/***/ "./node_modules/core-js/modules/es7.array.includes.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.array.includes.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_449568__) { - IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { - if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) - return done(new Error("Iconv decoding stream needs buffers as its input.")); - try { - var res = this.conv.write(chunk); - if (res && res.length) this.push(res, this.encoding); - done(); - } - catch (e) { - done(e); - } - } +"use strict"; - IconvLiteDecoderStream.prototype._flush = function(done) { - try { - var res = this.conv.end(); - if (res && res.length) this.push(res, this.encoding); - done(); - } - catch (e) { - done(e); - } - } +// https://github.com/tc39/Array.prototype.includes +var $export = __nested_webpack_require_449568__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $includes = __nested_webpack_require_449568__(/*! ./_array-includes */ "./node_modules/core-js/modules/_array-includes.js")(true); - IconvLiteDecoderStream.prototype.collect = function(cb) { - var res = ''; - this.on('error', cb); - this.on('data', function(chunk) { res += chunk; }); - this.on('end', function() { - cb(null, res); - }); - return this; - } +$export($export.P, 'Array', { + includes: function includes(el /* , fromIndex = 0 */) { + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } +}); - return { - IconvLiteEncoderStream: IconvLiteEncoderStream, - IconvLiteDecoderStream: IconvLiteDecoderStream, - }; -}; +__nested_webpack_require_449568__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")('includes'); /***/ }), -<<<<<<< HEAD -/***/ 22077: -======= -/***/ 40407: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ "./node_modules/core-js/modules/es7.asap.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/es7.asap.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_450471__) { -"use strict"; +// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask +var $export = __nested_webpack_require_450471__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var microtask = __nested_webpack_require_450471__(/*! ./_microtask */ "./node_modules/core-js/modules/_microtask.js")(); +var process = __nested_webpack_require_450471__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").process; +var isNode = __nested_webpack_require_450471__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js")(process) == 'process'; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.decodeHTML = exports.decodeHTMLStrict = exports.decodeXML = void 0; -var entities_json_1 = __importDefault(__nccwpck_require__(59323)); -var legacy_json_1 = __importDefault(__nccwpck_require__(29591)); -var xml_json_1 = __importDefault(__nccwpck_require__(2586)); -var decode_codepoint_1 = __importDefault(__nccwpck_require__(5689)); -var strictEntityRe = /&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g; -exports.decodeXML = getStrictDecoder(xml_json_1.default); -exports.decodeHTMLStrict = getStrictDecoder(entities_json_1.default); -function getStrictDecoder(map) { - var replace = getReplacer(map); - return function (str) { return String(str).replace(strictEntityRe, replace); }; -} -var sorter = function (a, b) { return (a < b ? 1 : -1); }; -exports.decodeHTML = (function () { - var legacy = Object.keys(legacy_json_1.default).sort(sorter); - var keys = Object.keys(entities_json_1.default).sort(sorter); - for (var i = 0, j = 0; i < keys.length; i++) { - if (legacy[j] === keys[i]) { - keys[i] += ";?"; - j++; - } - else { - keys[i] += ";"; - } - } - var re = new RegExp("&(?:" + keys.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"); - var replace = getReplacer(entities_json_1.default); - function replacer(str) { - if (str.substr(-1) !== ";") - str += ";"; - return replace(str); - } - // TODO consider creating a merged map - return function (str) { return String(str).replace(re, replacer); }; -})(); -function getReplacer(map) { - return function replace(str) { - if (str.charAt(1) === "#") { - var secondChar = str.charAt(2); - if (secondChar === "X" || secondChar === "x") { - return decode_codepoint_1.default(parseInt(str.substr(3), 16)); - } - return decode_codepoint_1.default(parseInt(str.substr(2), 10)); - } - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - return map[str.slice(1, -1)] || str; - }; -} +$export($export.G, { + asap: function asap(fn) { + var domain = isNode && process.domain; + microtask(domain ? domain.bind(fn) : fn); + } +}); /***/ }), -/***/ 5689: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ "./node_modules/core-js/modules/es7.error.is-error.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.error.is-error.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_451517__) { -"use strict"; +// https://github.com/ljharb/proposal-is-error +var $export = __nested_webpack_require_451517__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var cof = __nested_webpack_require_451517__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -var decode_json_1 = __importDefault(__nccwpck_require__(33600)); -// Adapted from https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119 -var fromCodePoint = -// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -String.fromCodePoint || - function (codePoint) { - var output = ""; - if (codePoint > 0xffff) { - codePoint -= 0x10000; - output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800); - codePoint = 0xdc00 | (codePoint & 0x3ff); - } - output += String.fromCharCode(codePoint); - return output; - }; -function decodeCodePoint(codePoint) { - if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) { - return "\uFFFD"; - } - if (codePoint in decode_json_1.default) { - codePoint = decode_json_1.default[codePoint]; - } - return fromCodePoint(codePoint); -} -exports["default"] = decodeCodePoint; +$export($export.S, 'Error', { + isError: function isError(it) { + return cof(it) === 'Error'; + } +}); /***/ }), -/***/ 95714: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ "./node_modules/core-js/modules/es7.global.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/es7.global.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_452181__) { -"use strict"; +// https://github.com/tc39/proposal-global +var $export = __nested_webpack_require_452181__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.escapeUTF8 = exports.escape = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.encodeXML = void 0; -var xml_json_1 = __importDefault(__nccwpck_require__(2586)); -var inverseXML = getInverseObj(xml_json_1.default); -var xmlReplacer = getInverseReplacer(inverseXML); -/** - * Encodes all non-ASCII characters, as well as characters not valid in XML - * documents using XML entities. - * - * If a character has no equivalent entity, a - * numeric hexadecimal reference (eg. `ü`) will be used. - */ -exports.encodeXML = getASCIIEncoder(inverseXML); -var entities_json_1 = __importDefault(__nccwpck_require__(59323)); -var inverseHTML = getInverseObj(entities_json_1.default); -var htmlReplacer = getInverseReplacer(inverseHTML); -/** - * Encodes all entities and non-ASCII characters in the input. - * - * This includes characters that are valid ASCII characters in HTML documents. - * For example `#` will be encoded as `#`. To get a more compact output, - * consider using the `encodeNonAsciiHTML` function. - * - * If a character has no equivalent entity, a - * numeric hexadecimal reference (eg. `ü`) will be used. - */ -exports.encodeHTML = getInverse(inverseHTML, htmlReplacer); -/** - * Encodes all non-ASCII characters, as well as characters not valid in HTML - * documents using HTML entities. - * - * If a character has no equivalent entity, a - * numeric hexadecimal reference (eg. `ü`) will be used. - */ -exports.encodeNonAsciiHTML = getASCIIEncoder(inverseHTML); -function getInverseObj(obj) { - return Object.keys(obj) - .sort() - .reduce(function (inverse, name) { - inverse[obj[name]] = "&" + name + ";"; - return inverse; - }, {}); -} -function getInverseReplacer(inverse) { - var single = []; - var multiple = []; - for (var _i = 0, _a = Object.keys(inverse); _i < _a.length; _i++) { - var k = _a[_i]; - if (k.length === 1) { - // Add value to single array - single.push("\\" + k); - } - else { - // Add value to multiple array - multiple.push(k); - } - } - // Add ranges to single characters. - single.sort(); - for (var start = 0; start < single.length - 1; start++) { - // Find the end of a run of characters - var end = start; - while (end < single.length - 1 && - single[end].charCodeAt(1) + 1 === single[end + 1].charCodeAt(1)) { - end += 1; - } - var count = 1 + end - start; - // We want to replace at least three characters - if (count < 3) - continue; - single.splice(start, count, single[start] + "-" + single[end]); - } - multiple.unshift("[" + single.join("") + "]"); - return new RegExp(multiple.join("|"), "g"); -} -// /[^\0-\x7F]/gu -var reNonASCII = /(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g; -var getCodePoint = -// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -String.prototype.codePointAt != null - ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - function (str) { return str.codePointAt(0); } - : // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae - function (c) { - return (c.charCodeAt(0) - 0xd800) * 0x400 + - c.charCodeAt(1) - - 0xdc00 + - 0x10000; - }; -function singleCharReplacer(c) { - return "&#x" + (c.length > 1 ? getCodePoint(c) : c.charCodeAt(0)) - .toString(16) - .toUpperCase() + ";"; -} -function getInverse(inverse, re) { - return function (data) { - return data - .replace(re, function (name) { return inverse[name]; }) - .replace(reNonASCII, singleCharReplacer); - }; -} -var reEscapeChars = new RegExp(xmlReplacer.source + "|" + reNonASCII.source, "g"); -/** - * Encodes all non-ASCII characters, as well as characters not valid in XML - * documents using numeric hexadecimal reference (eg. `ü`). - * - * Have a look at `escapeUTF8` if you want a more concise output at the expense - * of reduced transportability. - * - * @param data String to escape. - */ -function escape(data) { - return data.replace(reEscapeChars, singleCharReplacer); -} -exports.escape = escape; -/** - * Encodes all characters not valid in XML documents using numeric hexadecimal - * reference (eg. `ü`). - * - * Note that the output will be character-set dependent. - * - * @param data String to escape. - */ -function escapeUTF8(data) { - return data.replace(xmlReplacer, singleCharReplacer); -} -exports.escapeUTF8 = escapeUTF8; -function getASCIIEncoder(obj) { - return function (data) { - return data.replace(reEscapeChars, function (c) { return obj[c] || singleCharReplacer(c); }); - }; -} +$export($export.G, { global: __nested_webpack_require_452181__(/*! ./_global */ "./node_modules/core-js/modules/_global.js") }); /***/ }), -/***/ 78677: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es7.map.from.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/es7.map.from.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_452773__) { -"use strict"; +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from +__nested_webpack_require_452773__(/*! ./_set-collection-from */ "./node_modules/core-js/modules/_set-collection-from.js")('Map'); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.decodeXMLStrict = exports.decodeHTML5Strict = exports.decodeHTML4Strict = exports.decodeHTML5 = exports.decodeHTML4 = exports.decodeHTMLStrict = exports.decodeHTML = exports.decodeXML = exports.encodeHTML5 = exports.encodeHTML4 = exports.escapeUTF8 = exports.escape = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.encodeXML = exports.encode = exports.decodeStrict = exports.decode = void 0; -var decode_1 = __nccwpck_require__(40407); -var encode_1 = __nccwpck_require__(95714); -/** - * Decodes a string with entities. - * - * @param data String to decode. - * @param level Optional level to decode at. 0 = XML, 1 = HTML. Default is 0. - * @deprecated Use `decodeXML` or `decodeHTML` directly. - */ -function decode(data, level) { - return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTML)(data); -} -exports.decode = decode; -/** - * Decodes a string with entities. Does not allow missing trailing semicolons for entities. - * - * @param data String to decode. - * @param level Optional level to decode at. 0 = XML, 1 = HTML. Default is 0. - * @deprecated Use `decodeHTMLStrict` or `decodeXML` directly. - */ -function decodeStrict(data, level) { - return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTMLStrict)(data); -} -exports.decodeStrict = decodeStrict; -/** - * Encodes a string with entities. - * - * @param data String to encode. - * @param level Optional level to encode at. 0 = XML, 1 = HTML. Default is 0. - * @deprecated Use `encodeHTML`, `encodeXML` or `encodeNonAsciiHTML` directly. - */ -function encode(data, level) { - return (!level || level <= 0 ? encode_1.encodeXML : encode_1.encodeHTML)(data); -} -exports.encode = encode; -var encode_2 = __nccwpck_require__(95714); -Object.defineProperty(exports, "encodeXML", ({ enumerable: true, get: function () { return encode_2.encodeXML; } })); -Object.defineProperty(exports, "encodeHTML", ({ enumerable: true, get: function () { return encode_2.encodeHTML; } })); -Object.defineProperty(exports, "encodeNonAsciiHTML", ({ enumerable: true, get: function () { return encode_2.encodeNonAsciiHTML; } })); -Object.defineProperty(exports, "escape", ({ enumerable: true, get: function () { return encode_2.escape; } })); -Object.defineProperty(exports, "escapeUTF8", ({ enumerable: true, get: function () { return encode_2.escapeUTF8; } })); -// Legacy aliases (deprecated) -Object.defineProperty(exports, "encodeHTML4", ({ enumerable: true, get: function () { return encode_2.encodeHTML; } })); -Object.defineProperty(exports, "encodeHTML5", ({ enumerable: true, get: function () { return encode_2.encodeHTML; } })); -var decode_2 = __nccwpck_require__(40407); -Object.defineProperty(exports, "decodeXML", ({ enumerable: true, get: function () { return decode_2.decodeXML; } })); -Object.defineProperty(exports, "decodeHTML", ({ enumerable: true, get: function () { return decode_2.decodeHTML; } })); -Object.defineProperty(exports, "decodeHTMLStrict", ({ enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } })); -// Legacy aliases (deprecated) -Object.defineProperty(exports, "decodeHTML4", ({ enumerable: true, get: function () { return decode_2.decodeHTML; } })); -Object.defineProperty(exports, "decodeHTML5", ({ enumerable: true, get: function () { return decode_2.decodeHTML; } })); -Object.defineProperty(exports, "decodeHTML4Strict", ({ enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } })); -Object.defineProperty(exports, "decodeHTML5Strict", ({ enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } })); -Object.defineProperty(exports, "decodeXMLStrict", ({ enumerable: true, get: function () { return decode_2.decodeXML; } })); - - -/***/ }), - -/***/ 5822: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { +/***/ }), +/***/ "./node_modules/core-js/modules/es7.map.of.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/es7.map.of.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_453280__) { -/** - * @typedef {{ [key: string]: any }} Extensions - * @typedef {Error} Err - * @property {string} message - */ +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of +__nested_webpack_require_453280__(/*! ./_set-collection-of */ "./node_modules/core-js/modules/_set-collection-of.js")('Map'); -/** - * - * @param {Error} obj - * @param {Extensions} props - * @returns {Error & Extensions} - */ -function assign(obj, props) { - for (const key in props) { - Object.defineProperty(obj, key, { - value: props[key], - enumerable: true, - configurable: true, - }); - } - return obj; -} +/***/ }), -/** - * - * @param {any} err - An Error - * @param {string|Extensions} code - A string code or props to set on the error - * @param {Extensions} [props] - Props to set on the error - * @returns {Error & Extensions} - */ -function createError(err, code, props) { - if (!err || typeof err === 'string') { - throw new TypeError('Please pass an Error to err-code'); - } +/***/ "./node_modules/core-js/modules/es7.map.to-json.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.map.to-json.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_453801__) { - if (!props) { - props = {}; - } +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = __nested_webpack_require_453801__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - if (typeof code === 'object') { - props = code; - code = ''; - } +$export($export.P + $export.R, 'Map', { toJSON: __nested_webpack_require_453801__(/*! ./_collection-to-json */ "./node_modules/core-js/modules/_collection-to-json.js")('Map') }); - if (code) { - props.code = code; - } - try { - return assign(err, props); - } catch (_) { - props.message = err.message; - props.stack = err.stack; +/***/ }), - const ErrClass = function () {}; +/***/ "./node_modules/core-js/modules/es7.math.clamp.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.clamp.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_454467__) { - ErrClass.prototype = Object.create(Object.getPrototypeOf(err)); +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __nested_webpack_require_454467__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - // @ts-ignore - const output = assign(new ErrClass(), props); +$export($export.S, 'Math', { + clamp: function clamp(x, lower, upper) { + return Math.min(upper, Math.max(lower, x)); + } +}); - return output; - } -} -module.exports = createError; +/***/ }), +/***/ "./node_modules/core-js/modules/es7.math.deg-per-rad.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.deg-per-rad.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_455117__) { -/***/ }), +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __nested_webpack_require_455117__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -<<<<<<< HEAD -/***/ 27929: -/***/ ((module) => { -======= -/***/ 69685: -/***/ ((module, exports) => { +$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 }); -"use strict"; -/** - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - * See LICENSE file in root directory for full license. - */ ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ }), +/***/ "./node_modules/core-js/modules/es7.math.degrees.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.degrees.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_455683__) { -var has = Object.prototype.hasOwnProperty - , prefix = '~'; +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __nested_webpack_require_455683__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var RAD_PER_DEG = 180 / Math.PI; -/** - * Constructor to create a storage for our `EE` objects. - * An `Events` instance is a plain object whose properties are event names. - * - * @constructor - * @private - */ -function Events() {} +$export($export.S, 'Math', { + degrees: function degrees(radians) { + return radians * RAD_PER_DEG; + } +}); -// -// We try to not inherit from `Object.prototype`. In some engines creating an -// instance in this way is faster than calling `Object.create(null)` directly. -// If `Object.create(null)` is not supported we prefix the event names with a -// character to make sure that the built-in object properties are not -// overridden or used as an attack vector. -// -if (Object.create) { - Events.prototype = Object.create(null); - // - // This hack is needed because the `__proto__` property is still inherited in - // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. - // - if (!new Events().__proto__) prefix = false; -} +/***/ }), -/** - * Representation of a single event listener. - * - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} [once=false] Specify if the listener is a one-time listener. - * @constructor - * @private - */ -function EE(fn, context, once) { - this.fn = fn; - this.context = context; - this.once = once || false; -} +/***/ "./node_modules/core-js/modules/es7.math.fscale.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.fscale.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_456328__) { -/** - * Add a listener for a given event. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} once Specify if the listener is a one-time listener. - * @returns {EventEmitter} - * @private - */ -function addListener(emitter, event, fn, context, once) { - if (typeof fn !== 'function') { - throw new TypeError('The listener must be a function'); +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __nested_webpack_require_456328__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var scale = __nested_webpack_require_456328__(/*! ./_math-scale */ "./node_modules/core-js/modules/_math-scale.js"); +var fround = __nested_webpack_require_456328__(/*! ./_math-fround */ "./node_modules/core-js/modules/_math-fround.js"); + +$export($export.S, 'Math', { + fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { + return fround(scale(x, inLow, inHigh, outLow, outHigh)); } +}); - var listener = new EE(fn, context || emitter, once) - , evt = prefix ? prefix + event : event; - if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; - else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); - else emitter._events[evt] = [emitter._events[evt], listener]; +/***/ }), - return emitter; -} +/***/ "./node_modules/core-js/modules/es7.math.iaddh.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.iaddh.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_457196__) { -/** - * Clear event by name. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} evt The Event name. - * @private - */ -function clearEvent(emitter, evt) { - if (--emitter._eventsCount === 0) emitter._events = new Events(); - else delete emitter._events[evt]; -} +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __nested_webpack_require_457196__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -/** - * Minimal `EventEmitter` interface that is molded against the Node.js - * `EventEmitter` interface. - * - * @constructor - * @public - */ -function EventEmitter() { - this._events = new Events(); - this._eventsCount = 0; -} +$export($export.S, 'Math', { + iaddh: function iaddh(x0, x1, y0, y1) { + var $x0 = x0 >>> 0; + var $x1 = x1 >>> 0; + var $y0 = y0 >>> 0; + return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; + } +}); -/** - * Return an array listing the events for which the emitter has registered - * listeners. - * - * @returns {Array} - * @public - */ -EventEmitter.prototype.eventNames = function eventNames() { - var names = [] - , events - , name; - if (this._eventsCount === 0) return names; +/***/ }), - for (name in (events = this._events)) { - if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); - } +/***/ "./node_modules/core-js/modules/es7.math.imulh.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.imulh.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_457940__) { - if (Object.getOwnPropertySymbols) { - return names.concat(Object.getOwnPropertySymbols(events)); +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __nested_webpack_require_457940__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Math', { + imulh: function imulh(u, v) { + var UINT16 = 0xffff; + var $u = +u; + var $v = +v; + var u0 = $u & UINT16; + var v0 = $v & UINT16; + var u1 = $u >> 16; + var v1 = $v >> 16; + var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); } +}); - return names; -}; -/** - * Return the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Array} The registered listeners. - * @public - */ -EventEmitter.prototype.listeners = function listeners(event) { - var evt = prefix ? prefix + event : event - , handlers = this._events[evt]; +/***/ }), - if (!handlers) return []; - if (handlers.fn) return [handlers.fn]; +/***/ "./node_modules/core-js/modules/es7.math.isubh.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.isubh.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_458789__) { - for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { - ee[i] = handlers[i].fn; +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __nested_webpack_require_458789__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Math', { + isubh: function isubh(x0, x1, y0, y1) { + var $x0 = x0 >>> 0; + var $x1 = x1 >>> 0; + var $y0 = y0 >>> 0; + return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; } +}); - return ee; -}; -/** - * Return the number of listeners listening to a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Number} The number of listeners. - * @public - */ -EventEmitter.prototype.listenerCount = function listenerCount(event) { - var evt = prefix ? prefix + event : event - , listeners = this._events[evt]; +/***/ }), - if (!listeners) return 0; - if (listeners.fn) return 1; - return listeners.length; -}; +/***/ "./node_modules/core-js/modules/es7.math.rad-per-deg.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.rad-per-deg.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_459556__) { -/** - * Calls each of the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Boolean} `true` if the event had listeners, else `false`. - * @public - */ -EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { - var evt = prefix ? prefix + event : event; +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __nested_webpack_require_459556__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - if (!this._events[evt]) return false; +$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI }); - var listeners = this._events[evt] - , len = arguments.length - , args - , i; - if (listeners.fn) { - if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); +/***/ }), - switch (len) { - case 1: return listeners.fn.call(listeners.context), true; - case 2: return listeners.fn.call(listeners.context, a1), true; - case 3: return listeners.fn.call(listeners.context, a1, a2), true; - case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; - case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; - case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; - } +/***/ "./node_modules/core-js/modules/es7.math.radians.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.radians.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_460122__) { - for (i = 1, args = new Array(len -1); i < len; i++) { - args[i - 1] = arguments[i]; - } +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __nested_webpack_require_460122__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var DEG_PER_RAD = Math.PI / 180; - listeners.fn.apply(listeners.context, args); - } else { - var length = listeners.length - , j; +$export($export.S, 'Math', { + radians: function radians(degrees) { + return degrees * DEG_PER_RAD; + } +}); - for (i = 0; i < length; i++) { - if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); - switch (len) { - case 1: listeners[i].fn.call(listeners[i].context); break; - case 2: listeners[i].fn.call(listeners[i].context, a1); break; - case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; - case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; - default: - if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { - args[j - 1] = arguments[j]; - } +/***/ }), - listeners[i].fn.apply(listeners[i].context, args); - } - } - } +/***/ "./node_modules/core-js/modules/es7.math.scale.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.scale.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_460763__) { - return true; -}; +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __nested_webpack_require_460763__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -/** - * Add a listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.on = function on(event, fn, context) { - return addListener(this, event, fn, context, false); -}; +$export($export.S, 'Math', { scale: __nested_webpack_require_460763__(/*! ./_math-scale */ "./node_modules/core-js/modules/_math-scale.js") }); -/** - * Add a one-time listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.once = function once(event, fn, context) { - return addListener(this, event, fn, context, true); -}; -/** - * Remove the listeners of a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn Only remove the listeners that match this function. - * @param {*} context Only remove the listeners that have this context. - * @param {Boolean} once Only remove one-time listeners. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { - var evt = prefix ? prefix + event : event; +/***/ }), - if (!this._events[evt]) return this; - if (!fn) { - clearEvent(this, evt); - return this; - } +/***/ "./node_modules/core-js/modules/es7.math.signbit.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.signbit.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_461399__) { - var listeners = this._events[evt]; +// http://jfbastien.github.io/papers/Math.signbit.html +var $export = __nested_webpack_require_461399__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - if (listeners.fn) { - if ( - listeners.fn === fn && - (!once || listeners.once) && - (!context || listeners.context === context) - ) { - clearEvent(this, evt); - } - } else { - for (var i = 0, events = [], length = listeners.length; i < length; i++) { - if ( - listeners[i].fn !== fn || - (once && !listeners[i].once) || - (context && listeners[i].context !== context) - ) { - events.push(listeners[i]); - } - } +$export($export.S, 'Math', { signbit: function signbit(x) { + // eslint-disable-next-line no-self-compare + return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0; +} }); - // - // Reset the array, or remove it completely if we have no more listeners. - // - if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; - else clearEvent(this, evt); + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.math.umulh.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.umulh.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_462073__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __nested_webpack_require_462073__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Math', { + umulh: function umulh(u, v) { + var UINT16 = 0xffff; + var $u = +u; + var $v = +v; + var u0 = $u & UINT16; + var v0 = $v & UINT16; + var u1 = $u >>> 16; + var v1 = $v >>> 16; + var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); } +}); - return this; -}; -/** - * Remove all listeners, or those of the specified event. - * - * @param {(String|Symbol)} [event] The event name. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { - var evt; +/***/ }), - if (event) { - evt = prefix ? prefix + event : event; - if (this._events[evt]) clearEvent(this, evt); - } else { - this._events = new Events(); - this._eventsCount = 0; +/***/ "./node_modules/core-js/modules/es7.object.define-getter.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.object.define-getter.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_462966__) { + +"use strict"; + +var $export = __nested_webpack_require_462966__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toObject = __nested_webpack_require_462966__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var aFunction = __nested_webpack_require_462966__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var $defineProperty = __nested_webpack_require_462966__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); + +// B.2.2.2 Object.prototype.__defineGetter__(P, getter) +__nested_webpack_require_462966__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && $export($export.P + __nested_webpack_require_462966__(/*! ./_object-forced-pam */ "./node_modules/core-js/modules/_object-forced-pam.js"), 'Object', { + __defineGetter__: function __defineGetter__(P, getter) { + $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true }); } +}); - return this; -}; -// -// Alias methods names because people roll like that. -// -EventEmitter.prototype.off = EventEmitter.prototype.removeListener; -EventEmitter.prototype.addListener = EventEmitter.prototype.on; +/***/ }), -// -// Expose the prefix. -// -EventEmitter.prefixed = prefix; +/***/ "./node_modules/core-js/modules/es7.object.define-setter.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.object.define-setter.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_464248__) { -// -// Allow `EventEmitter` to be imported as module namespace. -// -EventEmitter.EventEmitter = EventEmitter; +"use strict"; -// -// Expose the module. -// -if (true) { - module.exports = EventEmitter; -} +var $export = __nested_webpack_require_464248__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toObject = __nested_webpack_require_464248__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var aFunction = __nested_webpack_require_464248__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var $defineProperty = __nested_webpack_require_464248__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); + +// B.2.2.3 Object.prototype.__defineSetter__(P, setter) +__nested_webpack_require_464248__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && $export($export.P + __nested_webpack_require_464248__(/*! ./_object-forced-pam */ "./node_modules/core-js/modules/_object-forced-pam.js"), 'Object', { + __defineSetter__: function __defineSetter__(P, setter) { + $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true }); + } +}); /***/ }), -<<<<<<< HEAD -/***/ 43250: -======= -/***/ 61166: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { +/***/ "./node_modules/core-js/modules/es7.object.entries.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.object.entries.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_465506__) { -module.exports = class FixedFIFO { - constructor (hwm) { - if (!(hwm > 0) || ((hwm - 1) & hwm) !== 0) throw new Error('Max size for a FixedFIFO should be a power of two') - this.buffer = new Array(hwm) - this.mask = hwm - 1 - this.top = 0 - this.btm = 0 - this.next = null - } +// https://github.com/tc39/proposal-object-values-entries +var $export = __nested_webpack_require_465506__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $entries = __nested_webpack_require_465506__(/*! ./_object-to-array */ "./node_modules/core-js/modules/_object-to-array.js")(true); - clear () { - this.top = this.btm = 0 - this.next = null - this.buffer.fill(undefined) +$export($export.S, 'Object', { + entries: function entries(it) { + return $entries(it); } +}); - push (data) { - if (this.buffer[this.top] !== undefined) return false - this.buffer[this.top] = data - this.top = (this.top + 1) & this.mask - return true - } - shift () { - const last = this.buffer[this.btm] - if (last === undefined) return undefined - this.buffer[this.btm] = undefined - this.btm = (this.btm + 1) & this.mask - return last - } +/***/ }), - peek () { - return this.buffer[this.btm] - } +/***/ "./node_modules/core-js/modules/es7.object.get-own-property-descriptors.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.object.get-own-property-descriptors.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_466326__) { - isEmpty () { - return this.buffer[this.btm] === undefined +// https://github.com/tc39/proposal-object-getownpropertydescriptors +var $export = __nested_webpack_require_466326__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var ownKeys = __nested_webpack_require_466326__(/*! ./_own-keys */ "./node_modules/core-js/modules/_own-keys.js"); +var toIObject = __nested_webpack_require_466326__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var gOPD = __nested_webpack_require_466326__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js"); +var createProperty = __nested_webpack_require_466326__(/*! ./_create-property */ "./node_modules/core-js/modules/_create-property.js"); + +$export($export.S, 'Object', { + getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { + var O = toIObject(object); + var getDesc = gOPD.f; + var keys = ownKeys(O); + var result = {}; + var i = 0; + var key, desc; + while (keys.length > i) { + desc = getDesc(O, key = keys[i++]); + if (desc !== undefined) createProperty(result, key, desc); + } + return result; } -} +}); /***/ }), -<<<<<<< HEAD -/***/ 98761: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es7.object.lookup-getter.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.object.lookup-getter.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_467725__) { -const FixedFIFO = __nccwpck_require__(43250) -======= -/***/ 20375: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +"use strict"; -const FixedFIFO = __nccwpck_require__(61166) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var $export = __nested_webpack_require_467725__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toObject = __nested_webpack_require_467725__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toPrimitive = __nested_webpack_require_467725__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); +var getPrototypeOf = __nested_webpack_require_467725__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var getOwnPropertyDescriptor = __nested_webpack_require_467725__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js").f; -module.exports = class FastFIFO { - constructor (hwm) { - this.hwm = hwm || 16 - this.head = new FixedFIFO(this.hwm) - this.tail = this.head - this.length = 0 +// B.2.2.4 Object.prototype.__lookupGetter__(P) +__nested_webpack_require_467725__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && $export($export.P + __nested_webpack_require_467725__(/*! ./_object-forced-pam */ "./node_modules/core-js/modules/_object-forced-pam.js"), 'Object', { + __lookupGetter__: function __lookupGetter__(P) { + var O = toObject(this); + var K = toPrimitive(P, true); + var D; + do { + if (D = getOwnPropertyDescriptor(O, K)) return D.get; + } while (O = getPrototypeOf(O)); } +}); - clear () { - this.head = this.tail - this.head.clear() - this.length = 0 - } - push (val) { - this.length++ - if (!this.head.push(val)) { - const prev = this.head - this.head = prev.next = new FixedFIFO(2 * this.head.buffer.length) - this.head.push(val) - } - } +/***/ }), - shift () { - if (this.length !== 0) this.length-- - const val = this.tail.shift() - if (val === undefined && this.tail.next) { - const next = this.tail.next - this.tail.next = null - this.tail = next - return this.tail.shift() - } +/***/ "./node_modules/core-js/modules/es7.object.lookup-setter.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.object.lookup-setter.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_469195__) { - return val - } +"use strict"; - peek () { - const val = this.tail.peek() - if (val === undefined && this.tail.next) return this.tail.next.peek() - return val - } +var $export = __nested_webpack_require_469195__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toObject = __nested_webpack_require_469195__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toPrimitive = __nested_webpack_require_469195__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); +var getPrototypeOf = __nested_webpack_require_469195__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var getOwnPropertyDescriptor = __nested_webpack_require_469195__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js").f; - isEmpty () { - return this.length === 0 +// B.2.2.5 Object.prototype.__lookupSetter__(P) +__nested_webpack_require_469195__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && $export($export.P + __nested_webpack_require_469195__(/*! ./_object-forced-pam */ "./node_modules/core-js/modules/_object-forced-pam.js"), 'Object', { + __lookupSetter__: function __lookupSetter__(P) { + var O = toObject(this); + var K = toPrimitive(P, true); + var D; + do { + if (D = getOwnPropertyDescriptor(O, K)) return D.set; + } while (O = getPrototypeOf(O)); } -} +}); /***/ }), -<<<<<<< HEAD -/***/ 27865: -======= -/***/ 6985: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es7.object.values.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.object.values.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_470637__) { +// https://github.com/tc39/proposal-object-values-entries +var $export = __nested_webpack_require_470637__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $values = __nested_webpack_require_470637__(/*! ./_object-to-array */ "./node_modules/core-js/modules/_object-to-array.js")(false); -<<<<<<< HEAD -======= -//parse Empty Node as self closing node -const buildOptions = (__nccwpck_require__(73430).buildOptions); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +$export($export.S, 'Object', { + values: function values(it) { + return $values(it); + } +}); -const { open, write, close, rename, fsync, unlink } = __nccwpck_require__(57147) -const { join, dirname } = __nccwpck_require__(71017) -var counter = 0 +/***/ }), -function cleanup (dest, err, cb) { - unlink(dest, function () { - cb(err) - }) -} +/***/ "./node_modules/core-js/modules/es7.observable.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.observable.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_471354__) { -function closeAndCleanup (fd, dest, err, cb) { - close(fd, cleanup.bind(null, dest, err, cb)) -} +"use strict"; -function writeLoop (fd, content, contentLength, offset, cb) { - write(fd, content, offset, function (err, bytesWritten) { - if (err) { - cb(err) - return - } +// https://github.com/zenparsing/es-observable +var $export = __nested_webpack_require_471354__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var global = __nested_webpack_require_471354__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var core = __nested_webpack_require_471354__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); +var microtask = __nested_webpack_require_471354__(/*! ./_microtask */ "./node_modules/core-js/modules/_microtask.js")(); +var OBSERVABLE = __nested_webpack_require_471354__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('observable'); +var aFunction = __nested_webpack_require_471354__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var anObject = __nested_webpack_require_471354__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var anInstance = __nested_webpack_require_471354__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); +var redefineAll = __nested_webpack_require_471354__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); +var hide = __nested_webpack_require_471354__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var forOf = __nested_webpack_require_471354__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); +var RETURN = forOf.RETURN; - return (bytesWritten < contentLength - offset) - ? writeLoop(fd, content, contentLength, offset + bytesWritten, cb) - : cb(null) - }) -} +var getMethod = function (fn) { + return fn == null ? undefined : aFunction(fn); +}; -function openLoop (dest, cb) { - open(dest, 'w', function (err, fd) { - if (err) { - return (err.code === 'EMFILE') - ? openLoop(dest, cb) - : cb(err) - } +var cleanupSubscription = function (subscription) { + var cleanup = subscription._c; + if (cleanup) { + subscription._c = undefined; + cleanup(); + } +}; - cb(null, fd) - }) -} +var subscriptionClosed = function (subscription) { + return subscription._o === undefined; +}; -function writeAtomic (path, content, cb) { - const tmp = join(dirname(path), '.' + process.pid + '.' + counter++) - openLoop(tmp, function (err, fd) { - if (err) { - cb(err) - return +var closeSubscription = function (subscription) { + if (!subscriptionClosed(subscription)) { + subscription._o = undefined; + cleanupSubscription(subscription); + } +}; + +var Subscription = function (observer, subscriber) { + anObject(observer); + this._c = undefined; + this._o = observer; + observer = new SubscriptionObserver(this); + try { + var cleanup = subscriber(observer); + var subscription = cleanup; + if (cleanup != null) { + if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); }; + else aFunction(cleanup); + this._c = cleanup; } + } catch (e) { + observer.error(e); + return; + } if (subscriptionClosed(this)) cleanupSubscription(this); +}; - const contentLength = Buffer.byteLength(content) - writeLoop(fd, content, contentLength, 0, function (err) { - if (err) { - closeAndCleanup(fd, tmp, err, cb) - return - } +Subscription.prototype = redefineAll({}, { + unsubscribe: function unsubscribe() { closeSubscription(this); } +}); - fsync(fd, function (err) { - if (err) { - closeAndCleanup(fd, tmp, err, cb) - return +var SubscriptionObserver = function (subscription) { + this._s = subscription; +}; + +SubscriptionObserver.prototype = redefineAll({}, { + next: function next(value) { + var subscription = this._s; + if (!subscriptionClosed(subscription)) { + var observer = subscription._o; + try { + var m = getMethod(observer.next); + if (m) return m.call(observer, value); + } catch (e) { + try { + closeSubscription(subscription); + } finally { + throw e; + } + } + } + }, + error: function error(value) { + var subscription = this._s; + if (subscriptionClosed(subscription)) throw value; + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.error); + if (!m) throw value; + value = m.call(observer, value); + } catch (e) { + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + }, + complete: function complete(value) { + var subscription = this._s; + if (!subscriptionClosed(subscription)) { + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.complete); + value = m ? m.call(observer, value) : undefined; + } catch (e) { + try { + cleanupSubscription(subscription); + } finally { + throw e; } + } cleanupSubscription(subscription); + return value; + } + } +}); - close(fd, function (err) { - if (err) { - // TODO could we possibly be leaking a file descriptor here? - cleanup(tmp, err, cb) - return - } +var $Observable = function Observable(subscriber) { + anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); +}; - rename(tmp, path, (err) => { - if (err) { - cleanup(tmp, err, cb) - return - } +redefineAll($Observable.prototype, { + subscribe: function subscribe(observer) { + return new Subscription(observer, this._f); + }, + forEach: function forEach(fn) { + var that = this; + return new (core.Promise || global.Promise)(function (resolve, reject) { + aFunction(fn); + var subscription = that.subscribe({ + next: function (value) { + try { + return fn(value); + } catch (e) { + reject(e); + subscription.unsubscribe(); + } + }, + error: reject, + complete: resolve + }); + }); + } +}); -<<<<<<< HEAD - cb(null) -======= -function replaceCDATAarr(str, cdata) { - str = this.options.tagValueProcessor('' + str); - if (this.options.cdataPositionChar === '' || str === '') { - return str + ''); +redefineAll($Observable, { + from: function from(x) { + var C = typeof this === 'function' ? this : $Observable; + var method = getMethod(anObject(x)[OBSERVABLE]); + if (method) { + var observable = anObject(method.call(x)); + return observable.constructor === C ? observable : new C(function (observer) { + return observable.subscribe(observer); + }); } - return str + this.newLine; + return new C(function (observer) { + var done = false; + microtask(function () { + if (!done) { + try { + if (forOf(x, false, function (it) { + observer.next(it); + if (done) return RETURN; + }) === RETURN) return; + } catch (e) { + if (done) throw e; + observer.error(e); + return; + } observer.complete(); + } + }); + return function () { done = true; }; + }); + }, + of: function of() { + for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++]; + return new (typeof this === 'function' ? this : $Observable)(function (observer) { + var done = false; + microtask(function () { + if (!done) { + for (var j = 0; j < items.length; ++j) { + observer.next(items[j]); + if (done) return; + } observer.complete(); + } + }); + return function () { done = true; }; + }); } -} +}); -function buildObjectNode(val, key, attrStr, level) { - if (attrStr && !val.includes('<')) { - return ( - this.indentate(level) + - '<' + - key + - attrStr + - '>' + - val + - //+ this.newLine - // + this.indentate(level) - '' + - this.options.tagValueProcessor(val) + - ' { +/***/ "./node_modules/core-js/modules/es7.promise.try.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.promise.try.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_479424__) { "use strict"; -const char = function(a) { - return String.fromCharCode(a); -}; +// https://github.com/tc39/proposal-promise-try +var $export = __nested_webpack_require_479424__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var newPromiseCapability = __nested_webpack_require_479424__(/*! ./_new-promise-capability */ "./node_modules/core-js/modules/_new-promise-capability.js"); +var perform = __nested_webpack_require_479424__(/*! ./_perform */ "./node_modules/core-js/modules/_perform.js"); + +$export($export.S, 'Promise', { 'try': function (callbackfn) { + var promiseCapability = newPromiseCapability.f(this); + var result = perform(callbackfn); + (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); + return promiseCapability.promise; +} }); -const chars = { - nilChar: char(176), - missingChar: char(201), - nilPremitive: char(175), - missingPremitive: char(200), - emptyChar: char(178), - emptyValue: char(177), //empty Premitive +/***/ }), - boundryChar: char(179), +/***/ "./node_modules/core-js/modules/es7.reflect.define-metadata.js": +/*!*********************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.reflect.define-metadata.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_480498__) { - objStart: char(198), - arrStart: char(204), - arrayEnd: char(185), -}; +var metadata = __nested_webpack_require_480498__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); +var anObject = __nested_webpack_require_480498__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var toMetaKey = metadata.key; +var ordinaryDefineOwnMetadata = metadata.set; -const charsArr = [ - chars.nilChar, - chars.nilPremitive, - chars.missingChar, - chars.missingPremitive, - chars.boundryChar, - chars.emptyChar, - chars.emptyValue, - chars.arrayEnd, - chars.objStart, - chars.arrStart, -]; +metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) { + ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); +} }); -const _e = function(node, e_schema, options) { - if (typeof e_schema === 'string') { - //premitive - if (node && node[0] && node[0].val !== undefined) { - return getValue(node[0].val, e_schema); - } else { - return getValue(node, e_schema); - } - } else { - const hasValidData = hasData(node); - if (hasValidData === true) { - let str = ''; - if (Array.isArray(e_schema)) { - //attributes can't be repeated. hence check in children tags only - str += chars.arrStart; - const itemSchema = e_schema[0]; - //var itemSchemaType = itemSchema; - const arr_len = node.length; - - if (typeof itemSchema === 'string') { - for (let arr_i = 0; arr_i < arr_len; arr_i++) { - const r = getValue(node[arr_i].val, itemSchema); - str = processValue(str, r); - } - } else { - for (let arr_i = 0; arr_i < arr_len; arr_i++) { - const r = _e(node[arr_i], itemSchema, options); - str = processValue(str, r); - } - } - str += chars.arrayEnd; //indicates that next item is not array item - } else { - //object - str += chars.objStart; - const keys = Object.keys(e_schema); - if (Array.isArray(node)) { - node = node[0]; - } - for (let i in keys) { - const key = keys[i]; - //a property defined in schema can be present either in attrsMap or children tags - //options.textNodeName will not present in both maps, take it's value from val - //options.attrNodeName will be present in attrsMap - let r; - if (!options.ignoreAttributes && node.attrsMap && node.attrsMap[key]) { - r = _e(node.attrsMap[key], e_schema[key], options); - } else if (key === options.textNodeName) { - r = _e(node.val, e_schema[key], options); - } else { - r = _e(node.child[key], e_schema[key], options); - } - str = processValue(str, r); - } - } - return str; - } else { - return hasValidData; - } - } -}; -const getValue = function(a /*, type*/) { - switch (a) { - case undefined: - return chars.missingPremitive; - case null: - return chars.nilPremitive; - case '': - return chars.emptyValue; - default: - return a; - } -}; +/***/ }), -const processValue = function(str, r) { - if (!isAppChar(r[0]) && !isAppChar(str[str.length - 1])) { - str += chars.boundryChar; - } - return str + r; -}; +/***/ "./node_modules/core-js/modules/es7.reflect.delete-metadata.js": +/*!*********************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.reflect.delete-metadata.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_481384__) { + +var metadata = __nested_webpack_require_481384__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); +var anObject = __nested_webpack_require_481384__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var toMetaKey = metadata.key; +var getOrCreateMetadataMap = metadata.map; +var store = metadata.store; + +metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { + var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]); + var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); + if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false; + if (metadataMap.size) return true; + var targetMetadata = store.get(target); + targetMetadata['delete'](targetKey); + return !!targetMetadata.size || store['delete'](target); +} }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.reflect.get-metadata-keys.js": +/*!***********************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.reflect.get-metadata-keys.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_482619__) { + +var Set = __nested_webpack_require_482619__(/*! ./es6.set */ "./node_modules/core-js/modules/es6.set.js"); +var from = __nested_webpack_require_482619__(/*! ./_array-from-iterable */ "./node_modules/core-js/modules/_array-from-iterable.js"); +var metadata = __nested_webpack_require_482619__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); +var anObject = __nested_webpack_require_482619__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var getPrototypeOf = __nested_webpack_require_482619__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var ordinaryOwnMetadataKeys = metadata.keys; +var toMetaKey = metadata.key; -const isAppChar = function(ch) { - return charsArr.indexOf(ch) !== -1; +var ordinaryMetadataKeys = function (O, P) { + var oKeys = ordinaryOwnMetadataKeys(O, P); + var parent = getPrototypeOf(O); + if (parent === null) return oKeys; + var pKeys = ordinaryMetadataKeys(parent, P); + return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; }; -function hasData(jObj) { - if (jObj === undefined) { - return chars.missingChar; - } else if (jObj === null) { - return chars.nilChar; - } else if ( - jObj.child && - Object.keys(jObj.child).length === 0 && - (!jObj.attrsMap || Object.keys(jObj.attrsMap).length === 0) - ) { - return chars.emptyChar; - } else { - return true; - } -} +metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) { + return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +} }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.reflect.get-metadata.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.reflect.get-metadata.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_484113__) { -const x2j = __nccwpck_require__(5525); -const buildOptions = (__nccwpck_require__(73430).buildOptions); +var metadata = __nested_webpack_require_484113__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); +var anObject = __nested_webpack_require_484113__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var getPrototypeOf = __nested_webpack_require_484113__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var ordinaryHasOwnMetadata = metadata.has; +var ordinaryGetOwnMetadata = metadata.get; +var toMetaKey = metadata.key; -const convert2nimn = function(node, e_schema, options) { - options = buildOptions(options, x2j.defaultOptions, x2j.props); - return _e(node, e_schema, options); +var ordinaryGetMetadata = function (MetadataKey, O, P) { + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P); + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; }; -exports.convert2nimn = convert2nimn; +metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) { + return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); /***/ }), -/***/ 91113: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js": +/*!***************************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_485486__) { -"use strict"; +var metadata = __nested_webpack_require_485486__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); +var anObject = __nested_webpack_require_485486__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var ordinaryOwnMetadataKeys = metadata.keys; +var toMetaKey = metadata.key; +metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { + return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +} }); -const util = __nccwpck_require__(73430); -const convertToJson = function(node, options, parentTagName) { - const jObj = {}; +/***/ }), - // when no child node or attr is present - if ((!node.child || util.isEmptyObject(node.child)) && (!node.attrsMap || util.isEmptyObject(node.attrsMap))) { - return util.isExist(node.val) ? node.val : ''; - } +/***/ "./node_modules/core-js/modules/es7.reflect.get-own-metadata.js": +/*!**********************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.reflect.get-own-metadata.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_486377__) { - // otherwise create a textnode if node has some text - if (util.isExist(node.val) && !(typeof node.val === 'string' && (node.val === '' || node.val === options.cdataPositionChar))) { - const asArray = util.isTagNameInArrayMode(node.tagname, options.arrayMode, parentTagName) - jObj[options.textNodeName] = asArray ? [node.val] : node.val; - } +var metadata = __nested_webpack_require_486377__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); +var anObject = __nested_webpack_require_486377__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var ordinaryGetOwnMetadata = metadata.get; +var toMetaKey = metadata.key; - util.merge(jObj, node.attrsMap, options.arrayMode); +metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { + return ordinaryGetOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); - const keys = Object.keys(node.child); - for (let index = 0; index < keys.length; index++) { - const tagName = keys[index]; - if (node.child[tagName] && node.child[tagName].length > 1) { - jObj[tagName] = []; - for (let tag in node.child[tagName]) { - if (node.child[tagName].hasOwnProperty(tag)) { - jObj[tagName].push(convertToJson(node.child[tagName][tag], options, tagName)); - } - } - } else { - const result = convertToJson(node.child[tagName][0], options, tagName); - const asArray = (options.arrayMode === true && typeof result === 'object') || util.isTagNameInArrayMode(tagName, options.arrayMode, parentTagName); - jObj[tagName] = asArray ? [result] : result; - } - } - //add value - return jObj; +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.reflect.has-metadata.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.reflect.has-metadata.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_487272__) { + +var metadata = __nested_webpack_require_487272__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); +var anObject = __nested_webpack_require_487272__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var getPrototypeOf = __nested_webpack_require_487272__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var ordinaryHasOwnMetadata = metadata.has; +var toMetaKey = metadata.key; + +var ordinaryHasMetadata = function (MetadataKey, O, P) { + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) return true; + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; }; -exports.convertToJson = convertToJson; +metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) { + return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); /***/ }), -/***/ 61766: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es7.reflect.has-own-metadata.js": +/*!**********************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.reflect.has-own-metadata.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_488541__) { -"use strict"; +var metadata = __nested_webpack_require_488541__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); +var anObject = __nested_webpack_require_488541__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var ordinaryHasOwnMetadata = metadata.has; +var toMetaKey = metadata.key; +metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { + return ordinaryHasOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); -const util = __nccwpck_require__(73430); -const buildOptions = (__nccwpck_require__(73430).buildOptions); -const x2j = __nccwpck_require__(5525); -//TODO: do it later -const convertToJsonString = function(node, options) { - options = buildOptions(options, x2j.defaultOptions, x2j.props); +/***/ }), - options.indentBy = options.indentBy || ''; - return _cToJsonStr(node, options, 0); -}; +/***/ "./node_modules/core-js/modules/es7.reflect.metadata.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.reflect.metadata.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_489420__) { -const _cToJsonStr = function(node, options, level) { - let jObj = '{'; +var $metadata = __nested_webpack_require_489420__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); +var anObject = __nested_webpack_require_489420__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var aFunction = __nested_webpack_require_489420__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var toMetaKey = $metadata.key; +var ordinaryDefineOwnMetadata = $metadata.set; - //traver through all the children - const keys = Object.keys(node.child); +$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) { + return function decorator(target, targetKey) { + ordinaryDefineOwnMetadata( + metadataKey, metadataValue, + (targetKey !== undefined ? anObject : aFunction)(target), + toMetaKey(targetKey) + ); + }; +} }); - for (let index = 0; index < keys.length; index++) { - var tagname = keys[index]; - if (node.child[tagname] && node.child[tagname].length > 1) { - jObj += '"' + tagname + '" : [ '; - for (var tag in node.child[tagname]) { - jObj += _cToJsonStr(node.child[tagname][tag], options) + ' , '; - } - jObj = jObj.substr(0, jObj.length - 1) + ' ] '; //remove extra comma in last - } else { - jObj += '"' + tagname + '" : ' + _cToJsonStr(node.child[tagname][0], options) + ' ,'; - } - } - util.merge(jObj, node.attrsMap); - //add attrsMap as new children - if (util.isEmptyObject(jObj)) { - return util.isExist(node.val) ? node.val : ''; - } else { - if (util.isExist(node.val)) { - if (!(typeof node.val === 'string' && (node.val === '' || node.val === options.cdataPositionChar))) { - jObj += '"' + options.textNodeName + '" : ' + stringval(node.val); - } - } - } - //add value - if (jObj[jObj.length - 1] === ',') { - jObj = jObj.substr(0, jObj.length - 2); - } - return jObj + '}'; -}; -function stringval(v) { - if (v === true || v === false || !isNaN(v)) { - return v; - } else { - return '"' + v + '"'; - } -} +/***/ }), -function indentate(options, level) { - return options.indentBy.repeat(level); -} +/***/ "./node_modules/core-js/modules/es7.set.from.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/es7.set.from.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_490446__) { -exports.convertToJsonString = convertToJsonString; +// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from +__nested_webpack_require_490446__(/*! ./_set-collection-from */ "./node_modules/core-js/modules/_set-collection-from.js")('Set'); /***/ }), -/***/ 65460: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es7.set.of.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/es7.set.of.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_490953__) { -"use strict"; +// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of +__nested_webpack_require_490953__(/*! ./_set-collection-of */ "./node_modules/core-js/modules/_set-collection-of.js")('Set'); -const nodeToJson = __nccwpck_require__(91113); -const xmlToNodeobj = __nccwpck_require__(5525); -const x2xmlnode = __nccwpck_require__(5525); -const buildOptions = (__nccwpck_require__(73430).buildOptions); -const validator = __nccwpck_require__(77731); +/***/ }), -exports.parse = function(xmlData, options, validationOption) { - if( validationOption){ - if(validationOption === true) validationOption = {} - - const result = validator.validate(xmlData, validationOption); - if (result !== true) { - throw Error( result.err.msg) - } - } - options = buildOptions(options, x2xmlnode.defaultOptions, x2xmlnode.props); - const traversableObj = xmlToNodeobj.getTraversalObj(xmlData, options) - //print(traversableObj, " "); - return nodeToJson.convertToJson(traversableObj, options); -}; -exports.convertTonimn = __nccwpck_require__(50186).convert2nimn; -exports.getTraversalObj = xmlToNodeobj.getTraversalObj; -exports.convertToJson = nodeToJson.convertToJson; -exports.convertToJsonString = __nccwpck_require__(61766).convertToJsonString; -exports.validate = validator.validate; -exports.j2xParser = __nccwpck_require__(6985); -exports.parseToNimn = function(xmlData, schema, options) { - return exports.convertTonimn(exports.getTraversalObj(xmlData, options), schema, options); -}; - - -function print(xmlNode, indentation){ - if(xmlNode){ - console.log(indentation + "{") - console.log(indentation + " \"tagName\": \"" + xmlNode.tagname + "\", "); - if(xmlNode.parent){ - console.log(indentation + " \"parent\": \"" + xmlNode.parent.tagname + "\", "); - } - console.log(indentation + " \"val\": \"" + xmlNode.val + "\", "); - console.log(indentation + " \"attrs\": " + JSON.stringify(xmlNode.attrsMap,null,4) + ", "); - - if(xmlNode.child){ - console.log(indentation + "\"child\": {") - const indentation2 = indentation + indentation; - Object.keys(xmlNode.child).forEach( function(key) { - const node = xmlNode.child[key]; - - if(Array.isArray(node)){ - console.log(indentation + "\""+key+"\" :[") - node.forEach( function(item,index) { - //console.log(indentation + " \""+index+"\" : [") - print(item, indentation2); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - }) - }) - }) - }) +/***/ "./node_modules/core-js/modules/es7.set.to-json.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.set.to-json.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_491474__) { - // clean up after oursevles, this is not needed - // anymore - content = null - }) -} +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = __nested_webpack_require_491474__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); -module.exports = writeAtomic +$export($export.P + $export.R, 'Set', { toJSON: __nested_webpack_require_491474__(/*! ./_collection-to-json */ "./node_modules/core-js/modules/_collection-to-json.js")('Set') }); /***/ }), -<<<<<<< HEAD -/***/ 6714: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ "./node_modules/core-js/modules/es7.string.at.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es7.string.at.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_492136__) { +"use strict"; +// https://github.com/mathiasbynens/String.prototype.at +var $export = __nested_webpack_require_492136__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $at = __nested_webpack_require_492136__(/*! ./_string-at */ "./node_modules/core-js/modules/_string-at.js")(true); -const validator = __nccwpck_require__(77890); -const XMLParser = __nccwpck_require__(58505); -const XMLBuilder = __nccwpck_require__(24554); +$export($export.P, 'String', { + at: function at(pos) { + return $at(this, pos); + } +}); -module.exports = { - XMLParser: XMLParser, - XMLValidator: validator, - XMLBuilder: XMLBuilder -} /***/ }), -/***/ 58151: -======= -/***/ 73430: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/core-js/modules/es7.string.match-all.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.string.match-all.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_492869__) { +"use strict"; +// https://tc39.github.io/String.prototype.matchAll/ +var $export = __nested_webpack_require_492869__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var defined = __nested_webpack_require_492869__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +var toLength = __nested_webpack_require_492869__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var isRegExp = __nested_webpack_require_492869__(/*! ./_is-regexp */ "./node_modules/core-js/modules/_is-regexp.js"); +var getFlags = __nested_webpack_require_492869__(/*! ./_flags */ "./node_modules/core-js/modules/_flags.js"); +var RegExpProto = RegExp.prototype; -const nameStartChar = ':A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD'; -const nameChar = nameStartChar + '\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040'; -const nameRegexp = '[' + nameStartChar + '][' + nameChar + ']*' -const regexName = new RegExp('^' + nameRegexp + '$'); +var $RegExpStringIterator = function (regexp, string) { + this._r = regexp; + this._s = string; +}; -const getAllMatches = function(string, regex) { - const matches = []; - let match = regex.exec(string); - while (match) { - const allmatches = []; - allmatches.startIndex = regex.lastIndex - match[0].length; - const len = match.length; - for (let index = 0; index < len; index++) { - allmatches.push(match[index]); - } - matches.push(allmatches); - match = regex.exec(string); +__nested_webpack_require_492869__(/*! ./_iter-create */ "./node_modules/core-js/modules/_iter-create.js")($RegExpStringIterator, 'RegExp String', function next() { + var match = this._r.exec(this._s); + return { value: match, done: match === null }; +}); + +$export($export.P, 'String', { + matchAll: function matchAll(regexp) { + defined(this); + if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!'); + var S = String(this); + var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp); + var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); + rx.lastIndex = toLength(regexp.lastIndex); + return new $RegExpStringIterator(rx, S); } - return matches; -}; +}); -const isName = function(string) { - const match = regexName.exec(string); - return !(match === null || typeof match === 'undefined'); -}; -exports.isExist = function(v) { - return typeof v !== 'undefined'; -}; +/***/ }), -exports.isEmptyObject = function(obj) { - return Object.keys(obj).length === 0; -}; +/***/ "./node_modules/core-js/modules/es7.string.pad-end.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.string.pad-end.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_494635__) { -/** - * Copy all the properties of a into b. - * @param {*} target - * @param {*} a - */ -exports.merge = function(target, a, arrayMode) { - if (a) { - const keys = Object.keys(a); // will return an array of own properties - const len = keys.length; //don't make it inline - for (let i = 0; i < len; i++) { - if (arrayMode === 'strict') { - target[keys[i]] = [ a[keys[i]] ]; - } else { - target[keys[i]] = a[keys[i]]; - } - } +"use strict"; + +// https://github.com/tc39/proposal-string-pad-start-end +var $export = __nested_webpack_require_494635__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $pad = __nested_webpack_require_494635__(/*! ./_string-pad */ "./node_modules/core-js/modules/_string-pad.js"); +var userAgent = __nested_webpack_require_494635__(/*! ./_user-agent */ "./node_modules/core-js/modules/_user-agent.js"); + +// https://github.com/zloirock/core-js/issues/280 +var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent); + +$export($export.P + $export.F * WEBKIT_BUG, 'String', { + padEnd: function padEnd(maxLength /* , fillString = ' ' */) { + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); } -}; -/* exports.merge =function (b,a){ - return Object.assign(b,a); -} */ +}); -exports.getValue = function(v) { - if (exports.isExist(v)) { - return v; - } else { - return ''; + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.string.pad-start.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.string.pad-start.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_495736__) { + +"use strict"; + +// https://github.com/tc39/proposal-string-pad-start-end +var $export = __nested_webpack_require_495736__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $pad = __nested_webpack_require_495736__(/*! ./_string-pad */ "./node_modules/core-js/modules/_string-pad.js"); +var userAgent = __nested_webpack_require_495736__(/*! ./_user-agent */ "./node_modules/core-js/modules/_user-agent.js"); + +// https://github.com/zloirock/core-js/issues/280 +var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent); + +$export($export.P + $export.F * WEBKIT_BUG, 'String', { + padStart: function padStart(maxLength /* , fillString = ' ' */) { + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); } -}; +}); -// const fakeCall = function(a) {return a;}; -// const fakeCallNoReturn = function() {}; -exports.isName = isName; -exports.getAllMatches = getAllMatches; -exports.nameRegexp = nameRegexp; +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.string.trim-left.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.string.trim-left.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_496840__) { + +"use strict"; + +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +__nested_webpack_require_496840__(/*! ./_string-trim */ "./node_modules/core-js/modules/_string-trim.js")('trimLeft', function ($trim) { + return function trimLeft() { + return $trim(this, 1); + }; +}, 'trimStart'); /***/ }), -<<<<<<< HEAD -/***/ 77890: -======= -/***/ 77731: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - +/***/ "./node_modules/core-js/modules/es7.string.trim-right.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.string.trim-right.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_497498__) { -<<<<<<< HEAD -const util = __nccwpck_require__(58151); -======= -const util = __nccwpck_require__(73430); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +"use strict"; -const defaultOptions = { - allowBooleanAttributes: false, //A tag can have attributes without any value - unpairedTags: [] -}; +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +__nested_webpack_require_497498__(/*! ./_string-trim */ "./node_modules/core-js/modules/_string-trim.js")('trimRight', function ($trim) { + return function trimRight() { + return $trim(this, 2); + }; +}, 'trimEnd'); -//const tagsPattern = new RegExp("<\\/?([\\w:\\-_\.]+)\\s*\/?>","g"); -exports.validate = function (xmlData, options) { - options = Object.assign({}, defaultOptions, options); - //xmlData = xmlData.replace(/(\r\n|\n|\r)/gm,"");//make it single line - //xmlData = xmlData.replace(/(^\s*<\?xml.*?\?>)/g,"");//Remove XML starting tag - //xmlData = xmlData.replace(/()/g,"");//Remove DOCTYPE - const tags = []; - let tagFound = false; +/***/ }), - //indicates that the root tag has been closed (aka. depth 0 has been reached) - let reachedRoot = false; +/***/ "./node_modules/core-js/modules/es7.symbol.async-iterator.js": +/*!*******************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.symbol.async-iterator.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_498172__) { - if (xmlData[0] === '\ufeff') { - // check for byte order mark (BOM) - xmlData = xmlData.substr(1); - } - - for (let i = 0; i < xmlData.length; i++) { +__nested_webpack_require_498172__(/*! ./_wks-define */ "./node_modules/core-js/modules/_wks-define.js")('asyncIterator'); - if (xmlData[i] === '<' && xmlData[i+1] === '?') { - i+=2; - i = readPI(xmlData,i); - if (i.err) return i; - }else if (xmlData[i] === '<') { - //starting of tag - //read until you reach to '>' avoiding any '>' in attribute value - let tagStartPos = i; - i++; - - if (xmlData[i] === '!') { - i = readCommentAndCDATA(xmlData, i); - continue; - } else { - let closingTag = false; - if (xmlData[i] === '/') { - //closing tag - closingTag = true; - i++; - } - //read tagname - let tagName = ''; - for (; i < xmlData.length && - xmlData[i] !== '>' && - xmlData[i] !== ' ' && - xmlData[i] !== '\t' && - xmlData[i] !== '\n' && - xmlData[i] !== '\r'; i++ - ) { - tagName += xmlData[i]; - } - tagName = tagName.trim(); - //console.log(tagName); - if (tagName[tagName.length - 1] === '/') { - //self closing tag without attributes - tagName = tagName.substring(0, tagName.length - 1); - //continue; - i--; - } - if (!validateTagName(tagName)) { - let msg; - if (tagName.trim().length === 0) { - msg = "Invalid space after '<'."; - } else { - msg = "Tag '"+tagName+"' is an invalid name."; - } - return getErrorObject('InvalidTag', msg, getLineNumberForPosition(xmlData, i)); - } +/***/ }), - const result = readAttributeStr(xmlData, i); - if (result === false) { - return getErrorObject('InvalidAttr', "Attributes for '"+tagName+"' have open quote.", getLineNumberForPosition(xmlData, i)); - } - let attrStr = result.value; - i = result.index; +/***/ "./node_modules/core-js/modules/es7.symbol.observable.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.symbol.observable.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_498652__) { - if (attrStr[attrStr.length - 1] === '/') { - //self closing tag - const attrStrStart = i - attrStr.length; - attrStr = attrStr.substring(0, attrStr.length - 1); - const isValid = validateAttributeString(attrStr, options); - if (isValid === true) { - tagFound = true; - //continue; //text may presents after self closing tag - } else { - //the result from the nested function returns the position of the error within the attribute - //in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute - //this gives us the absolute index in the entire xml, which we can use to find the line at last - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)); - } - } else if (closingTag) { - if (!result.tagClosed) { - return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' doesn't have proper closing.", getLineNumberForPosition(xmlData, i)); - } else if (attrStr.trim().length > 0) { - return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); - } else { - const otg = tags.pop(); - if (tagName !== otg.tagName) { - let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); - return getErrorObject('InvalidTag', - "Expected closing tag '"+otg.tagName+"' (opened in line "+openPos.line+", col "+openPos.col+") instead of closing tag '"+tagName+"'.", - getLineNumberForPosition(xmlData, tagStartPos)); - } +__nested_webpack_require_498652__(/*! ./_wks-define */ "./node_modules/core-js/modules/_wks-define.js")('observable'); - //when there are no more tags, we reached the root level. - if (tags.length == 0) { - reachedRoot = true; - } - } - } else { - const isValid = validateAttributeString(attrStr, options); - if (isValid !== true) { - //the result from the nested function returns the position of the error within the attribute - //in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute - //this gives us the absolute index in the entire xml, which we can use to find the line at last - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)); - } - //if the root level has been reached before ... - if (reachedRoot === true) { - return getErrorObject('InvalidXml', 'Multiple possible root nodes found.', getLineNumberForPosition(xmlData, i)); - } else if(options.unpairedTags.indexOf(tagName) !== -1){ - //don't push into stack - } else { - tags.push({tagName, tagStartPos}); - } - tagFound = true; - } +/***/ }), - //skip tag text value - //It may include comments and CDATA value - for (i++; i < xmlData.length; i++) { - if (xmlData[i] === '<') { - if (xmlData[i + 1] === '!') { - //comment or CADATA - i++; - i = readCommentAndCDATA(xmlData, i); - continue; - } else if (xmlData[i+1] === '?') { - i = readPI(xmlData, ++i); - if (i.err) return i; - } else{ - break; - } - } else if (xmlData[i] === '&') { - const afterAmp = validateAmpersand(xmlData, i); - if (afterAmp == -1) - return getErrorObject('InvalidChar', "char '&' is not expected.", getLineNumberForPosition(xmlData, i)); - i = afterAmp; - }else{ - if (reachedRoot === true && !isWhiteSpace(xmlData[i])) { - return getErrorObject('InvalidXml', "Extra text at the end", getLineNumberForPosition(xmlData, i)); - } - } - } //end of reading tag text value - if (xmlData[i] === '<') { - i--; - } - } - } else { - if ( isWhiteSpace(xmlData[i])) { - continue; - } - return getErrorObject('InvalidChar', "char '"+xmlData[i]+"' is not expected.", getLineNumberForPosition(xmlData, i)); - } - } +/***/ "./node_modules/core-js/modules/es7.system.global.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.system.global.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_499113__) { - if (!tagFound) { - return getErrorObject('InvalidXml', 'Start tag expected.', 1); - }else if (tags.length == 1) { - return getErrorObject('InvalidTag', "Unclosed tag '"+tags[0].tagName+"'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos)); - }else if (tags.length > 0) { - return getErrorObject('InvalidXml', "Invalid '"+ - JSON.stringify(tags.map(t => t.tagName), null, 4).replace(/\r?\n/g, '')+ - "' found.", {line: 1, col: 1}); - } +// https://github.com/tc39/proposal-global +var $export = __nested_webpack_require_499113__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); - return true; -}; +$export($export.S, 'System', { global: __nested_webpack_require_499113__(/*! ./_global */ "./node_modules/core-js/modules/_global.js") }); -function isWhiteSpace(char){ - return char === ' ' || char === '\t' || char === '\n' || char === '\r'; -} -/** - * Read Processing insstructions and skip - * @param {*} xmlData - * @param {*} i - */ -function readPI(xmlData, i) { - const start = i; - for (; i < xmlData.length; i++) { - if (xmlData[i] == '?' || xmlData[i] == ' ') { - //tagname - const tagname = xmlData.substr(start, i - start); - if (i > 5 && tagname === 'xml') { - return getErrorObject('InvalidXml', 'XML declaration allowed only at the start of the document.', getLineNumberForPosition(xmlData, i)); - } else if (xmlData[i] == '?' && xmlData[i + 1] == '>') { - //check if valid attribut string - i++; - break; - } else { - continue; - } - } - } - return i; -} -function readCommentAndCDATA(xmlData, i) { - if (xmlData.length > i + 5 && xmlData[i + 1] === '-' && xmlData[i + 2] === '-') { - //comment - for (i += 3; i < xmlData.length; i++) { - if (xmlData[i] === '-' && xmlData[i + 1] === '-' && xmlData[i + 2] === '>') { - i += 2; - break; - } - } - } else if ( - xmlData.length > i + 8 && - xmlData[i + 1] === 'D' && - xmlData[i + 2] === 'O' && - xmlData[i + 3] === 'C' && - xmlData[i + 4] === 'T' && - xmlData[i + 5] === 'Y' && - xmlData[i + 6] === 'P' && - xmlData[i + 7] === 'E' - ) { - let angleBracketsCount = 1; - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === '<') { - angleBracketsCount++; - } else if (xmlData[i] === '>') { - angleBracketsCount--; - if (angleBracketsCount === 0) { - break; - } - } - } - } else if ( - xmlData.length > i + 9 && - xmlData[i + 1] === '[' && - xmlData[i + 2] === 'C' && - xmlData[i + 3] === 'D' && - xmlData[i + 4] === 'A' && - xmlData[i + 5] === 'T' && - xmlData[i + 6] === 'A' && - xmlData[i + 7] === '[' - ) { - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === ']' && xmlData[i + 1] === ']' && xmlData[i + 2] === '>') { - i += 2; - break; - } - } - } +/***/ }), - return i; -} +/***/ "./node_modules/core-js/modules/es7.weak-map.from.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.weak-map.from.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_499735__) { -const doubleQuote = '"'; -const singleQuote = "'"; +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from +__nested_webpack_require_499735__(/*! ./_set-collection-from */ "./node_modules/core-js/modules/_set-collection-from.js")('WeakMap'); -/** - * Keep reading xmlData until '<' is found outside the attribute value. - * @param {string} xmlData - * @param {number} i - */ -function readAttributeStr(xmlData, i) { - let attrStr = ''; - let startChar = ''; - let tagClosed = false; - for (; i < xmlData.length; i++) { - if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) { - if (startChar === '') { - startChar = xmlData[i]; - } else if (startChar !== xmlData[i]) { - //if vaue is enclosed with double quote then single quotes are allowed inside the value and vice versa - } else { - startChar = ''; - } - } else if (xmlData[i] === '>') { - if (startChar === '') { - tagClosed = true; - break; - } - } - attrStr += xmlData[i]; - } - if (startChar !== '') { - return false; - } - return { - value: attrStr, - index: i, - tagClosed: tagClosed - }; -} +/***/ }), -/** - * Select all the attributes whether valid or invalid. - */ -const validAttrStrRegxp = new RegExp('(\\s*)([^\\s=]+)(\\s*=)?(\\s*([\'"])(([\\s\\S])*?)\\5)?', 'g'); +/***/ "./node_modules/core-js/modules/es7.weak-map.of.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.weak-map.of.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_500270__) { -//attr, ="sd", a="amit's", a="sd"b="saf", ab cd="" +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of +__nested_webpack_require_500270__(/*! ./_set-collection-of */ "./node_modules/core-js/modules/_set-collection-of.js")('WeakMap'); -function validateAttributeString(attrStr, options) { - //console.log("start:"+attrStr+":end"); - //if(attrStr.trim().length === 0) return true; //empty string +/***/ }), - const matches = util.getAllMatches(attrStr, validAttrStrRegxp); - const attrNames = {}; +/***/ "./node_modules/core-js/modules/es7.weak-set.from.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.weak-set.from.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_500807__) { - for (let i = 0; i < matches.length; i++) { - if (matches[i][1].length === 0) { - //nospace before attribute name: a="sd"b="saf" - return getErrorObject('InvalidAttr', "Attribute '"+matches[i][2]+"' has no space in starting.", getPositionFromMatch(matches[i])) - } else if (matches[i][3] !== undefined && matches[i][4] === undefined) { - return getErrorObject('InvalidAttr', "Attribute '"+matches[i][2]+"' is without value.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] === undefined && !options.allowBooleanAttributes) { - //independent attribute: ab - return getErrorObject('InvalidAttr', "boolean attribute '"+matches[i][2]+"' is not allowed.", getPositionFromMatch(matches[i])); - } - /* else if(matches[i][6] === undefined){//attribute without value: ab= - return { err: { code:"InvalidAttr",msg:"attribute " + matches[i][2] + " has no value assigned."}}; - } */ - const attrName = matches[i][2]; - if (!validateAttrName(attrName)) { - return getErrorObject('InvalidAttr', "Attribute '"+attrName+"' is an invalid name.", getPositionFromMatch(matches[i])); - } - if (!attrNames.hasOwnProperty(attrName)) { - //check for duplicate attribute. - attrNames[attrName] = 1; - } else { - return getErrorObject('InvalidAttr', "Attribute '"+attrName+"' is repeated.", getPositionFromMatch(matches[i])); - } - } +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from +__nested_webpack_require_500807__(/*! ./_set-collection-from */ "./node_modules/core-js/modules/_set-collection-from.js")('WeakSet'); - return true; -} -function validateNumberAmpersand(xmlData, i) { - let re = /\d/; - if (xmlData[i] === 'x') { - i++; - re = /[\da-fA-F]/; - } - for (; i < xmlData.length; i++) { - if (xmlData[i] === ';') - return i; - if (!xmlData[i].match(re)) - break; - } - return -1; -} +/***/ }), -function validateAmpersand(xmlData, i) { - // https://www.w3.org/TR/xml/#dt-charref - i++; - if (xmlData[i] === ';') - return -1; - if (xmlData[i] === '#') { - i++; - return validateNumberAmpersand(xmlData, i); - } - let count = 0; - for (; i < xmlData.length; i++, count++) { - if (xmlData[i].match(/\w/) && count < 20) - continue; - if (xmlData[i] === ';') - break; - return -1; - } - return i; -} +/***/ "./node_modules/core-js/modules/es7.weak-set.of.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.weak-set.of.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_501342__) { -function getErrorObject(code, message, lineNumber) { - return { - err: { - code: code, - msg: message, - line: lineNumber.line || lineNumber, - col: lineNumber.col, - }, - }; -} +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of +__nested_webpack_require_501342__(/*! ./_set-collection-of */ "./node_modules/core-js/modules/_set-collection-of.js")('WeakSet'); -function validateAttrName(attrName) { - return util.isName(attrName); -} -// const startsWithXML = /^xml/i; +/***/ }), -function validateTagName(tagname) { - return util.isName(tagname) /* && !tagname.match(startsWithXML) */; -} +/***/ "./node_modules/core-js/modules/web.dom.iterable.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/web.dom.iterable.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_501875__) { -//this function returns the line number for the character at the given index -function getLineNumberForPosition(xmlData, index) { - const lines = xmlData.substring(0, index).split(/\r?\n/); - return { - line: lines.length, +var $iterators = __nested_webpack_require_501875__(/*! ./es6.array.iterator */ "./node_modules/core-js/modules/es6.array.iterator.js"); +var getKeys = __nested_webpack_require_501875__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); +var redefine = __nested_webpack_require_501875__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var global = __nested_webpack_require_501875__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var hide = __nested_webpack_require_501875__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var Iterators = __nested_webpack_require_501875__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); +var wks = __nested_webpack_require_501875__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js"); +var ITERATOR = wks('iterator'); +var TO_STRING_TAG = wks('toStringTag'); +var ArrayValues = Iterators.Array; - // column number is last line's length + 1, because column numbering starts at 1: - col: lines[lines.length - 1].length + 1 - }; -} +var DOMIterables = { + CSSRuleList: true, // TODO: Not spec compliant, should be false. + CSSStyleDeclaration: false, + CSSValueList: false, + ClientRectList: false, + DOMRectList: false, + DOMStringList: false, + DOMTokenList: true, + DataTransferItemList: false, + FileList: false, + HTMLAllCollection: false, + HTMLCollection: false, + HTMLFormElement: false, + HTMLSelectElement: false, + MediaList: true, // TODO: Not spec compliant, should be false. + MimeTypeArray: false, + NamedNodeMap: false, + NodeList: true, + PaintRequestList: false, + Plugin: false, + PluginArray: false, + SVGLengthList: false, + SVGNumberList: false, + SVGPathSegList: false, + SVGPointList: false, + SVGStringList: false, + SVGTransformList: false, + SourceBufferList: false, + StyleSheetList: true, // TODO: Not spec compliant, should be false. + TextTrackCueList: false, + TextTrackList: false, + TouchList: false +}; -//this function returns the position of the first character of match within attrStr -function getPositionFromMatch(match) { - return match.startIndex + match[1].length; +for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { + var NAME = collections[i]; + var explicit = DOMIterables[NAME]; + var Collection = global[NAME]; + var proto = Collection && Collection.prototype; + var key; + if (proto) { + if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); + if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = ArrayValues; + if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true); + } } /***/ }), -<<<<<<< HEAD -/***/ 24554: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -======= -/***/ 51835: -/***/ ((module) => { - -"use strict"; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - - -//parse Empty Node as self closing node -const buildFromOrderedJs = __nccwpck_require__(94934); - -const defaultOptions = { - attributeNamePrefix: '@_', - attributesGroupName: false, - textNodeName: '#text', - ignoreAttributes: true, - cdataPropName: false, - format: false, - indentBy: ' ', - suppressEmptyNode: false, - suppressUnpairedNode: true, - suppressBooleanAttributes: true, - tagValueProcessor: function(key, a) { - return a; - }, - attributeValueProcessor: function(attrName, a) { - return a; - }, - preserveOrder: false, - commentPropName: false, - unpairedTags: [], - entities: [ - { regex: new RegExp("&", "g"), val: "&" },//it must be on top - { regex: new RegExp(">", "g"), val: ">" }, - { regex: new RegExp("<", "g"), val: "<" }, - { regex: new RegExp("\'", "g"), val: "'" }, - { regex: new RegExp("\"", "g"), val: """ } - ], - processEntities: true, - stopNodes: [], - // transformTagName: false, - // transformAttributeName: false, - oneListGroup: false -}; +/***/ "./node_modules/core-js/modules/web.immediate.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/web.immediate.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_504468__) { -function Builder(options) { - this.options = Object.assign({}, defaultOptions, options); - if (this.options.ignoreAttributes || this.options.attributesGroupName) { - this.isAttribute = function(/*a*/) { - return false; - }; - } else { - this.attrPrefixLen = this.options.attributeNamePrefix.length; - this.isAttribute = isAttribute; - } +var $export = __nested_webpack_require_504468__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $task = __nested_webpack_require_504468__(/*! ./_task */ "./node_modules/core-js/modules/_task.js"); +$export($export.G + $export.B, { + setImmediate: $task.set, + clearImmediate: $task.clear +}); - this.processTextOrObjNode = processTextOrObjNode - if (this.options.format) { - this.indentate = indentate; - this.tagEndChar = '>\n'; - this.newLine = '\n'; - } else { - this.indentate = function() { - return ''; - }; - this.tagEndChar = '>'; - this.newLine = ''; - } -} +/***/ }), -Builder.prototype.build = function(jObj) { - if(this.options.preserveOrder){ - return buildFromOrderedJs(jObj, this.options); - }else { - if(Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1){ - jObj = { - [this.options.arrayNodeName] : jObj - } - } - return this.j2x(jObj, 0).val; - } -}; +/***/ "./node_modules/core-js/modules/web.timers.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/web.timers.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_505078__) { -Builder.prototype.j2x = function(jObj, level) { - let attrStr = ''; - let val = ''; - for (let key in jObj) { - if (typeof jObj[key] === 'undefined') { - // supress undefined node - } else if (jObj[key] === null) { - if(key[0] === "?") val += this.indentate(level) + '<' + key + '?' + this.tagEndChar; - else val += this.indentate(level) + '<' + key + '/' + this.tagEndChar; - // val += this.indentate(level) + '<' + key + '/' + this.tagEndChar; - } else if (jObj[key] instanceof Date) { - val += this.buildTextValNode(jObj[key], key, '', level); - } else if (typeof jObj[key] !== 'object') { - //premitive type - const attr = this.isAttribute(key); - if (attr) { - attrStr += this.buildAttrPairStr(attr, '' + jObj[key]); - }else { - //tag value - if (key === this.options.textNodeName) { - let newval = this.options.tagValueProcessor(key, '' + jObj[key]); - val += this.replaceEntitiesValue(newval); - } else { - val += this.buildTextValNode(jObj[key], key, '', level); - } - } - } else if (Array.isArray(jObj[key])) { - //repeated nodes - const arrLen = jObj[key].length; - let listTagVal = ""; - for (let j = 0; j < arrLen; j++) { - const item = jObj[key][j]; - if (typeof item === 'undefined') { - // supress undefined node - } else if (item === null) { - if(key[0] === "?") val += this.indentate(level) + '<' + key + '?' + this.tagEndChar; - else val += this.indentate(level) + '<' + key + '/' + this.tagEndChar; - // val += this.indentate(level) + '<' + key + '/' + this.tagEndChar; - } else if (typeof item === 'object') { - if(this.options.oneListGroup ){ - listTagVal += this.j2x(item, level + 1).val; - }else{ - listTagVal += this.processTextOrObjNode(item, key, level) - } - } else { - listTagVal += this.buildTextValNode(item, key, '', level); - } - } - if(this.options.oneListGroup){ - listTagVal = this.buildObjectNode(listTagVal, key, '', level); - } - val += listTagVal; - } else { - //nested node - if (this.options.attributesGroupName && key === this.options.attributesGroupName) { - const Ks = Object.keys(jObj[key]); - const L = Ks.length; - for (let j = 0; j < L; j++) { - attrStr += this.buildAttrPairStr(Ks[j], '' + jObj[key][Ks[j]]); - } - } else { - val += this.processTextOrObjNode(jObj[key], key, level) - } - } - } - return {attrStr: attrStr, val: val}; +// ie9- setTimeout & setInterval additional parameters fix +var global = __nested_webpack_require_505078__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var $export = __nested_webpack_require_505078__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var userAgent = __nested_webpack_require_505078__(/*! ./_user-agent */ "./node_modules/core-js/modules/_user-agent.js"); +var slice = [].slice; +var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check +var wrap = function (set) { + return function (fn, time /* , ...args */) { + var boundArgs = arguments.length > 2; + var args = boundArgs ? slice.call(arguments, 2) : false; + return set(boundArgs ? function () { + // eslint-disable-next-line no-new-func + (typeof fn == 'function' ? fn : Function(fn)).apply(this, args); + } : fn, time); + }; }; +$export($export.G + $export.B + $export.F * MSIE, { + setTimeout: wrap(global.setTimeout), + setInterval: wrap(global.setInterval) +}); -Builder.prototype.buildAttrPairStr = function(attrName, val){ - val = this.options.attributeValueProcessor(attrName, '' + val); - val = this.replaceEntitiesValue(val); - if (this.options.suppressBooleanAttributes && val === "true") { - return ' ' + attrName; - } else return ' ' + attrName + '="' + val + '"'; -} - -function processTextOrObjNode (object, key, level) { - const result = this.j2x(object, level + 1); - if (object[this.options.textNodeName] !== undefined && Object.keys(object).length === 1) { - return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level); - } else { - return this.buildObjectNode(result.val, key, result.attrStr, level); - } -} - -Builder.prototype.buildObjectNode = function(val, key, attrStr, level) { - if(val === ""){ - if(key[0] === "?") return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar; - else { - return this.indentate(level) + '<' + key + attrStr + this.closeTag(key) + this.tagEndChar; - } - }else{ - let tagEndExp = '' + val + tagEndExp ); - } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) { - return this.indentate(level) + `` + this.newLine; - }else { - return ( - this.indentate(level) + '<' + key + attrStr + piClosingChar + this.tagEndChar + - val + - this.indentate(level) + tagEndExp ); - } - } -} +/***/ }), -Builder.prototype.closeTag = function(key){ - let closeTag = ""; - if(this.options.unpairedTags.indexOf(key) !== -1){ //unpaired - if(!this.options.suppressUnpairedNode) closeTag = "/" - }else if(this.options.suppressEmptyNode){ //empty - closeTag = "/"; - }else{ - closeTag = `>` + this.newLine; - }else if (this.options.commentPropName !== false && key === this.options.commentPropName) { - return this.indentate(level) + `` + this.newLine; - }else if(key[0] === "?") {//PI tag - return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar; - }else{ - let textValue = this.options.tagValueProcessor(key, val); - textValue = this.replaceEntitiesValue(textValue); - - if( textValue === ''){ - return this.indentate(level) + '<' + key + attrStr + this.closeTag(key) + this.tagEndChar; - }else{ - return this.indentate(level) + '<' + key + attrStr + '>' + - textValue + - ' 0 && this.options.processEntities){ - for (let i=0; i { + let warned = false; -/***/ }), + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +})(); -<<<<<<< HEAD -/***/ 94934: -/***/ ((module) => { -======= -/***/ 5525: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/** + * Colors. + */ -const EOL = "\n"; +exports.colors = [ + '#0000CC', + '#0000FF', + '#0033CC', + '#0033FF', + '#0066CC', + '#0066FF', + '#0099CC', + '#0099FF', + '#00CC00', + '#00CC33', + '#00CC66', + '#00CC99', + '#00CCCC', + '#00CCFF', + '#3300CC', + '#3300FF', + '#3333CC', + '#3333FF', + '#3366CC', + '#3366FF', + '#3399CC', + '#3399FF', + '#33CC00', + '#33CC33', + '#33CC66', + '#33CC99', + '#33CCCC', + '#33CCFF', + '#6600CC', + '#6600FF', + '#6633CC', + '#6633FF', + '#66CC00', + '#66CC33', + '#9900CC', + '#9900FF', + '#9933CC', + '#9933FF', + '#99CC00', + '#99CC33', + '#CC0000', + '#CC0033', + '#CC0066', + '#CC0099', + '#CC00CC', + '#CC00FF', + '#CC3300', + '#CC3333', + '#CC3366', + '#CC3399', + '#CC33CC', + '#CC33FF', + '#CC6600', + '#CC6633', + '#CC9900', + '#CC9933', + '#CCCC00', + '#CCCC33', + '#FF0000', + '#FF0033', + '#FF0066', + '#FF0099', + '#FF00CC', + '#FF00FF', + '#FF3300', + '#FF3333', + '#FF3366', + '#FF3399', + '#FF33CC', + '#FF33FF', + '#FF6600', + '#FF6633', + '#FF9900', + '#FF9933', + '#FFCC00', + '#FFCC33' +]; /** - * - * @param {array} jArray - * @param {any} options - * @returns + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors */ -function toXml(jArray, options) { - let indentation = ""; - if (options.format && options.indentBy.length > 0) { - indentation = EOL; - } - return arrToStr(jArray, options, "", indentation); + +// eslint-disable-next-line complexity +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } + + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + + // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // Is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // Double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } -function arrToStr(arr, options, jPath, indentation) { - let xmlStr = ""; - let isPreviousElementTag = false; +/** + * Colorize log arguments if enabled. + * + * @api public + */ - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const tagName = propName(tagObj); - let newJPath = ""; - if (jPath.length === 0) newJPath = tagName - else newJPath = `${jPath}.${tagName}`; +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); - if (tagName === options.textNodeName) { - let tagText = tagObj[tagName]; - if (!isStopNode(newJPath, options)) { - tagText = options.tagValueProcessor(tagName, tagText); - tagText = replaceEntitiesValue(tagText, options); - } - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += tagText; - isPreviousElementTag = false; - continue; - } else if (tagName === options.cdataPropName) { - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += ``; - isPreviousElementTag = false; - continue; - } else if (tagName === options.commentPropName) { - xmlStr += indentation + ``; - isPreviousElementTag = true; - continue; - } else if (tagName[0] === "?") { - const attStr = attr_to_str(tagObj[":@"], options); - const tempInd = tagName === "?xml" ? "" : indentation; - let piTextNodeName = tagObj[tagName][0][options.textNodeName]; - piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; //remove extra spacing - xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr}?>`; - isPreviousElementTag = true; - continue; - } - let newIdentation = indentation; - if (newIdentation !== "") { - newIdentation += options.indentBy; - } - const attStr = attr_to_str(tagObj[":@"], options); - const tagStart = indentation + `<${tagName}${attStr}`; - const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation); - if (options.unpairedTags.indexOf(tagName) !== -1) { - if (options.suppressUnpairedNode) xmlStr += tagStart + ">"; - else xmlStr += tagStart + "/>"; - } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) { - xmlStr += tagStart + "/>"; - } else if (tagValue && tagValue.endsWith(">")) { - xmlStr += tagStart + `>${tagValue}${indentation}`; - } else { - xmlStr += tagStart + ">"; - if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("`; - } - isPreviousElementTag = true; - } + if (!this.useColors) { + return; + } - return xmlStr; -} + const c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); -function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key !== ":@") return key; - } -} + // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; + } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); -function attr_to_str(attrMap, options) { - let attrStr = ""; - if (attrMap && !options.ignoreAttributes) { - for (let attr in attrMap) { - let attrVal = options.attributeValueProcessor(attr, attrMap[attr]); - attrVal = replaceEntitiesValue(attrVal, options); - if (attrVal === true && options.suppressBooleanAttributes) { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; - } else { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; - } - } - } - return attrStr; + args.splice(lastC, 0, c); } -function isStopNode(jPath, options) { - jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1); - let tagName = jPath.substr(jPath.lastIndexOf(".") + 1); - for (let index in options.stopNodes) { - if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true; - } - return false; -} +/** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ +exports.log = console.debug || console.log || (() => {}); -function replaceEntitiesValue(textValue, options) { - if (textValue && textValue.length > 0 && options.processEntities) { - for (let i = 0; i < options.entities.length; i++) { - const entity = options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } - } - return textValue; +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } } -module.exports = toXml; +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ +function load() { + let r; + try { + r = exports.storage.getItem('debug'); + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } -<<<<<<< HEAD -/***/ }), - -/***/ 31838: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } -const util = __nccwpck_require__(58151); + return r; +} -//TODO: handle comments -function readDocType(xmlData, i){ - - const entities = {}; - if( xmlData[i + 3] === 'O' && - xmlData[i + 4] === 'C' && - xmlData[i + 5] === 'T' && - xmlData[i + 6] === 'Y' && - xmlData[i + 7] === 'P' && - xmlData[i + 8] === 'E') - { - i = i+9; - let angleBracketsCount = 1; - let hasBody = false, comment = false; - let exp = ""; - for(;i') { //Read tag content - if(comment){ - if( xmlData[i - 1] === "-" && xmlData[i - 2] === "-"){ - comment = false; - angleBracketsCount--; - } - }else{ - angleBracketsCount--; - } - if (angleBracketsCount === 0) { - break; - } - }else if( xmlData[i] === '['){ - hasBody = true; - }else{ - exp += xmlData[i]; - } - } - if(angleBracketsCount !== 0){ - throw new Error(`Unclosed DOCTYPE`); - } - }else{ - throw new Error(`Invalid Tag instead of DOCTYPE`); - } - return {entities, i}; +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } } -function readEntityExp(xmlData,i){ - //External entities are not supported - // +module.exports = __nested_webpack_require_529146__(/*! ./common */ "./node_modules/debug/src/common.js")(exports); - //Parameter entities are not supported - // +const {formatters} = module.exports; - //Internal entities are supported - // - - //read EntityName - let entityName = ""; - for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"' ); i++) { - // if(xmlData[i] === " ") continue; - // else - entityName += xmlData[i]; - } - entityName = entityName.trim(); - if(entityName.indexOf(" ") !== -1) throw new Error("External entites are not supported"); +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ - //read Entity Value - const startChar = xmlData[i++]; - let val = "" - for (; i < xmlData.length && xmlData[i] !== startChar ; i++) { - val += xmlData[i]; - } - return [entityName, val, i]; -} +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } +}; -function isComment(xmlData, i){ - if(xmlData[i+1] === '!' && - xmlData[i+2] === '-' && - xmlData[i+3] === '-') return true - return false -} -function isEntity(xmlData, i){ - if(xmlData[i+1] === '!' && - xmlData[i+2] === 'E' && - xmlData[i+3] === 'N' && - xmlData[i+4] === 'T' && - xmlData[i+5] === 'I' && - xmlData[i+6] === 'T' && - xmlData[i+7] === 'Y') return true - return false -} -function isElement(xmlData, i){ - if(xmlData[i+1] === '!' && - xmlData[i+2] === 'E' && - xmlData[i+3] === 'L' && - xmlData[i+4] === 'E' && - xmlData[i+5] === 'M' && - xmlData[i+6] === 'E' && - xmlData[i+7] === 'N' && - xmlData[i+8] === 'T') return true - return false -} -function isAttlist(xmlData, i){ - if(xmlData[i+1] === '!' && - xmlData[i+2] === 'A' && - xmlData[i+3] === 'T' && - xmlData[i+4] === 'T' && - xmlData[i+5] === 'L' && - xmlData[i+6] === 'I' && - xmlData[i+7] === 'S' && - xmlData[i+8] === 'T') return true - return false -} -function isNotation(xmlData, i){ - if(xmlData[i+1] === '!' && - xmlData[i+2] === 'N' && - xmlData[i+3] === 'O' && - xmlData[i+4] === 'T' && - xmlData[i+5] === 'A' && - xmlData[i+6] === 'T' && - xmlData[i+7] === 'I' && - xmlData[i+8] === 'O' && - xmlData[i+9] === 'N') return true - return false -} +/***/ }), -function validateEntityName(name){ - if (util.isName(name)) - return name; - else - throw new Error(`Invalid entity name ${name}`); -} +/***/ "./node_modules/debug/src/common.js": +/*!******************************************!*\ + !*** ./node_modules/debug/src/common.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_535498__) { -module.exports = readDocType; +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ -/***/ }), +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = __nested_webpack_require_535498__(/*! ms */ "./node_modules/ms/index.js"); + createDebug.destroy = destroy; -/***/ 80633: -/***/ ((__unused_webpack_module, exports) => { + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); + /** + * The currently active debug mode names, and names to skip. + */ -const defaultOptions = { - preserveOrder: false, - attributeNamePrefix: '@_', - attributesGroupName: false, - textNodeName: '#text', - ignoreAttributes: true, - removeNSPrefix: false, // remove NS from tag name or attribute name if true - allowBooleanAttributes: false, //a tag can have attributes without any value - //ignoreRootElement : false, - parseTagValue: true, - parseAttributeValue: false, - trimValues: true, //Trim string values of tag and attributes - cdataPropName: false, - numberParseOptions: { - hex: true, - leadingZeros: true, - eNotation: true - }, - tagValueProcessor: function(tagName, val) { - return val; - }, - attributeValueProcessor: function(attrName, val) { - return val; - }, - stopNodes: [], //nested tags will not be parsed even for errors - alwaysCreateTextNode: false, - isArray: () => false, - commentPropName: false, - unpairedTags: [], - processEntities: true, - htmlEntities: false, - ignoreDeclaration: false, - ignorePiTags: false, - transformTagName: false, - transformAttributeName: false, - updateTag: function(tagName, jPath, attrs){ - return tagName - }, - // skipEmptyListItem: false -}; - -const buildOptions = function(options) { - return Object.assign({}, defaultOptions, options); -}; + createDebug.names = []; + createDebug.skips = []; -exports.buildOptions = buildOptions; -exports.defaultOptions = defaultOptions; + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; -/***/ }), + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; -/***/ 79063: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; -///@ts-check + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; -const util = __nccwpck_require__(58151); -const xmlNode = __nccwpck_require__(43056); -const readDocType = __nccwpck_require__(31838); -const toNumber = __nccwpck_require__(88828); + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } -======= -const util = __nccwpck_require__(73430); -const buildOptions = (__nccwpck_require__(73430).buildOptions); -const xmlNode = __nccwpck_require__(51835); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const regx = - '<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)' - .replace(/NAME/g, util.nameRegexp); + const self = debug; -//const tagsRegx = new RegExp("<(\\/?[\\w:\\-\._]+)([^>]*)>(\\s*"+cdataRegx+")*([^<]+)?","g"); -//const tagsRegx = new RegExp("<(\\/?)((\\w*:)?([\\w:\\-\._]+))([^>]*)>([^<]*)("+cdataRegx+"([^<]*))*([^<]+)?","g"); + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; -class OrderedObjParser{ - constructor(options){ - this.options = options; - this.currentNode = null; - this.tagsNodeStack = []; - this.docTypeEntities = {}; - this.lastEntities = { - "apos" : { regex: /&(apos|#39|#x27);/g, val : "'"}, - "gt" : { regex: /&(gt|#62|#x3E);/g, val : ">"}, - "lt" : { regex: /&(lt|#60|#x3C);/g, val : "<"}, - "quot" : { regex: /&(quot|#34|#x22);/g, val : "\""}, - }; - this.ampEntity = { regex: /&(amp|#38|#x26);/g, val : "&"}; - this.htmlEntities = { - "space": { regex: /&(nbsp|#160);/g, val: " " }, - // "lt" : { regex: /&(lt|#60);/g, val: "<" }, - // "gt" : { regex: /&(gt|#62);/g, val: ">" }, - // "amp" : { regex: /&(amp|#38);/g, val: "&" }, - // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, - // "apos" : { regex: /&(apos|#39);/g, val: "'" }, - "cent" : { regex: /&(cent|#162);/g, val: "¢" }, - "pound" : { regex: /&(pound|#163);/g, val: "£" }, - "yen" : { regex: /&(yen|#165);/g, val: "¥" }, - "euro" : { regex: /&(euro|#8364);/g, val: "€" }, - "copyright" : { regex: /&(copy|#169);/g, val: "©" }, - "reg" : { regex: /&(reg|#174);/g, val: "®" }, - "inr" : { regex: /&(inr|#8377);/g, val: "₹" }, - }; - this.addExternalEntities = addExternalEntities; - this.parseXml = parseXml; - this.parseTextData = parseTextData; - this.resolveNameSpace = resolveNameSpace; - this.buildAttributesMap = buildAttributesMap; - this.isItStopNode = isItStopNode; - this.replaceEntitiesValue = replaceEntitiesValue; - this.readStopNodeData = readStopNodeData; - this.saveTextToParentTag = saveTextToParentTag; - this.addChild = addChild; - } + args[0] = createDebug.coerce(args[0]); -} + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } -function addExternalEntities(externalEntities){ - const entKeys = Object.keys(externalEntities); - for (let i = 0; i < entKeys.length; i++) { - const ent = entKeys[i]; - this.lastEntities[ent] = { - regex: new RegExp("&"+ent+";","g"), - val : externalEntities[ent] - } - } -} + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); -/** - * @param {string} val - * @param {string} tagName - * @param {string} jPath - * @param {boolean} dontTrim - * @param {boolean} hasAttributes - * @param {boolean} isLeafNode - * @param {boolean} escapeEntities - */ -function parseTextData(val, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { - if (val !== undefined) { - if (this.options.trimValues && !dontTrim) { - val = val.trim(); - } - if(val.length > 0){ - if(!escapeEntities) val = this.replaceEntitiesValue(val); - - const newval = this.options.tagValueProcessor(tagName, val, jPath, hasAttributes, isLeafNode); - if(newval === null || newval === undefined){ - //don't parse - return val; - }else if(typeof newval !== typeof val || newval !== val){ - //overwrite - return newval; - }else if(this.options.trimValues){ - return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions); - }else{ - const trimmedVal = val.trim(); - if(trimmedVal === val){ - return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions); - }else{ - return val; - } - } - } - } -} + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); -function resolveNameSpace(tagname) { - if (this.options.removeNSPrefix) { - const tags = tagname.split(':'); - const prefix = tagname.charAt(0) === '/' ? '/' : ''; - if (tags[0] === 'xmlns') { - return ''; - } - if (tags.length === 2) { - tagname = prefix + tags[1]; - } - } - return tagname; -} + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); -//TODO: change regex to capture NS -//const attrsRegx = new RegExp("([\\w\\-\\.\\:]+)\\s*=\\s*(['\"])((.|\n)*?)\\2","gm"); -const attrsRegx = new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?', 'gm'); + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } -function buildAttributesMap(attrStr, jPath, tagName) { - if (!this.options.ignoreAttributes && typeof attrStr === 'string') { - // attrStr = attrStr.replace(/\r?\n/g, ' '); - //attrStr = attrStr || attrStr.trim(); + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. - const matches = util.getAllMatches(attrStr, attrsRegx); - const len = matches.length; //don't make it inline - const attrs = {}; - for (let i = 0; i < len; i++) { - const attrName = this.resolveNameSpace(matches[i][1]); - let oldVal = matches[i][4]; - let aName = this.options.attributeNamePrefix + attrName; - if (attrName.length) { - if (this.options.transformAttributeName) { - aName = this.options.transformAttributeName(aName); - } - if(aName === "__proto__") aName = "#__proto__"; - if (oldVal !== undefined) { - if (this.options.trimValues) { - oldVal = oldVal.trim(); - } - oldVal = this.replaceEntitiesValue(oldVal); - const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); - if(newVal === null || newVal === undefined){ - //don't parse - attrs[aName] = oldVal; - }else if(typeof newVal !== typeof oldVal || newVal !== oldVal){ - //overwrite - attrs[aName] = newVal; - }else{ - //parse - attrs[aName] = parseValue( - oldVal, - this.options.parseAttributeValue, - this.options.numberParseOptions - ); - } - } else if (this.options.allowBooleanAttributes) { - attrs[aName] = true; - } - } - } - if (!Object.keys(attrs).length) { - return; - } - if (this.options.attributesGroupName) { - const attrCollection = {}; - attrCollection[this.options.attributesGroupName] = attrs; - return attrCollection; - } - return attrs - } -} + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride, + set: v => { + enableOverride = v; + } + }); -const parseXml = function(xmlData) { - xmlData = xmlData.replace(/\r\n?/g, "\n"); //TODO: remove this line - const xmlObj = new xmlNode('!xml'); - let currentNode = xmlObj; - let textData = ""; - let jPath = ""; - for(let i=0; i< xmlData.length; i++){//for each char in XML data - const ch = xmlData[i]; - if(ch === '<'){ - // const nextIndex = i+1; - // const _2ndChar = xmlData[nextIndex]; - if( xmlData[i+1] === '/') {//Closing Tag - const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed.") - let tagName = xmlData.substring(i+2,closeIndex).trim(); + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } - if(this.options.removeNSPrefix){ - const colonIndex = tagName.indexOf(":"); - if(colonIndex !== -1){ - tagName = tagName.substr(colonIndex+1); - } - } + return debug; + } - if(this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } - if(currentNode){ - textData = this.saveTextToParentTag(textData, currentNode, jPath); - } + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); - //check if last tag of nested tag was unpaired tag - const lastTagName = jPath.substring(jPath.lastIndexOf(".")+1); - if(tagName && this.options.unpairedTags.indexOf(tagName) !== -1 ){ - throw new Error(`Unpaired tag can not be used as closing tag: `); - } - let propIndex = 0 - if(lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1 ){ - propIndex = jPath.lastIndexOf('.', jPath.lastIndexOf('.')-1) - this.tagsNodeStack.pop(); - }else{ - propIndex = jPath.lastIndexOf("."); - } - jPath = jPath.substring(0, propIndex); + createDebug.names = []; + createDebug.skips = []; - currentNode = this.tagsNodeStack.pop();//avoid recursion, set the parent tag scope - textData = ""; - i = closeIndex; - } else if( xmlData[i+1] === '?') { + let i; + const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + const len = split.length; - let tagData = readTagExp(xmlData,i, false, "?>"); - if(!tagData) throw new Error("Pi Tag is not closed."); + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } - textData = this.saveTextToParentTag(textData, currentNode, jPath); - if( (this.options.ignoreDeclaration && tagData.tagName === "?xml") || this.options.ignorePiTags){ + namespaces = split[i].replace(/\*/g, '.*?'); - }else{ - - const childNode = new xmlNode(tagData.tagName); - childNode.add(this.options.textNodeName, ""); - - if(tagData.tagName !== tagData.tagExp && tagData.attrExpPresent){ - childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); - } - this.addChild(currentNode, childNode, jPath) + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + } - } + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names.map(toNamespace), + ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } - i = tagData.closeIndex + 1; - } else if(xmlData.substr(i + 1, 3) === '!--') { - const endIndex = findClosingIndex(xmlData, "-->", i+4, "Comment is not closed.") - if(this.options.commentPropName){ - const comment = xmlData.substring(i + 4, endIndex - 2); + let i; + let len; - textData = this.saveTextToParentTag(textData, currentNode, jPath); + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } - currentNode.add(this.options.commentPropName, [ { [this.options.textNodeName] : comment } ]); - } - i = endIndex; - } else if( xmlData.substr(i + 1, 2) === '!D') { - const result = readDocType(xmlData, i); - this.docTypeEntities = result.entities; - i = result.i; - }else if(xmlData.substr(i + 1, 2) === '![') { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2; - const tagExp = xmlData.substring(i + 9,closeIndex); + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } - textData = this.saveTextToParentTag(textData, currentNode, jPath); + return false; + } - //cdata should be set even if it is 0 length string - if(this.options.cdataPropName){ - // let val = this.parseTextData(tagExp, this.options.cdataPropName, jPath + "." + this.options.cdataPropName, true, false, true); - // if(!val) val = ""; - currentNode.add(this.options.cdataPropName, [ { [this.options.textNodeName] : tagExp } ]); - }else{ - let val = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true); - if(val == undefined) val = ""; - currentNode.add(this.options.textNodeName, val); - } - - i = closeIndex + 2; - }else {//Opening tag - let result = readTagExp(xmlData,i, this.options.removeNSPrefix); - let tagName= result.tagName; - let tagExp = result.tagExp; - let attrExpPresent = result.attrExpPresent; - let closeIndex = result.closeIndex; + /** + * Convert regexp to namespace + * + * @param {RegExp} regxep + * @return {String} namespace + * @api private + */ + function toNamespace(regexp) { + return regexp.toString() + .substring(2, regexp.toString().length - 2) + .replace(/\.\*\?$/, '*'); + } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - - //save text as child node - if (currentNode && textData) { - if(currentNode.tagname !== '!xml'){ - //when nested tag is found - textData = this.saveTextToParentTag(textData, currentNode, jPath, false); - } - } + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } - //check if last tag was unpaired tag - const lastTag = currentNode; - if(lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1 ){ - currentNode = this.tagsNodeStack.pop(); - jPath = jPath.substring(0, jPath.lastIndexOf(".")); - } - if(tagName !== xmlObj.tagname){ - jPath += jPath ? "." + tagName : tagName; - } - if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { //TODO: namespace - let tagContent = ""; - //self-closing tag - if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){ - i = result.closeIndex; - } - //unpaired tag - else if(this.options.unpairedTags.indexOf(tagName) !== -1){ - i = result.closeIndex; - } - //normal tag - else{ - //read until closing tag is found - const result = this.readStopNodeData(xmlData, tagName, closeIndex + 1); - if(!result) throw new Error(`Unexpected end of ${tagName}`); - i = result.i; - tagContent = result.tagContent; - } + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } - const childNode = new xmlNode(tagName); - if(tagName !== tagExp && attrExpPresent){ - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - if(tagContent) { - tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); - } - - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - childNode.add(this.options.textNodeName, tagContent); - - this.addChild(currentNode, childNode, jPath) - }else{ - //selfClosing tag - if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){ - if(tagName[tagName.length - 1] === "/"){ //remove trailing '/' - tagName = tagName.substr(0, tagName.length - 1); - tagExp = tagName; - }else{ - tagExp = tagExp.substr(0, tagExp.length - 1); - } - - if(this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } + createDebug.enable(createDebug.load()); - const childNode = new xmlNode(tagName); - if(tagName !== tagExp && attrExpPresent){ - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath) - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - } - //opening tag - else{ - const childNode = new xmlNode( tagName); - this.tagsNodeStack.push(currentNode); - - if(tagName !== tagExp && attrExpPresent){ - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath) - currentNode = childNode; - } - textData = ""; - i = closeIndex; - } - } - }else{ - textData += xmlData[i]; - } - } - return xmlObj.child; + return createDebug; } -function addChild(currentNode, childNode, jPath){ - const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]) - if(result === false){ - }else if(typeof result === "string"){ - childNode.tagname = result - currentNode.addChild(childNode); - }else{ - currentNode.addChild(childNode); - } -} +module.exports = setup; -const replaceEntitiesValue = function(val){ - if(this.options.processEntities){ - for(let entityName in this.docTypeEntities){ - const entity = this.docTypeEntities[entityName]; - val = val.replace( entity.regx, entity.val); - } - for(let entityName in this.lastEntities){ - const entity = this.lastEntities[entityName]; - val = val.replace( entity.regex, entity.val); - } - if(this.options.htmlEntities){ - for(let entityName in this.htmlEntities){ - const entity = this.htmlEntities[entityName]; - val = val.replace( entity.regex, entity.val); - } - } - val = val.replace( this.ampEntity.regex, this.ampEntity.val); - } - return val; -} -function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { - if (textData) { //store previously collected data as textNode - if(isLeafNode === undefined) isLeafNode = Object.keys(currentNode.child).length === 0 - - textData = this.parseTextData(textData, - currentNode.tagname, - jPath, - false, - currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, - isLeafNode); +/***/ }), - if (textData !== undefined && textData !== "") - currentNode.add(this.options.textNodeName, textData); - textData = ""; - } - return textData; -} +/***/ "./node_modules/debug/src/index.js": +/*!*****************************************!*\ + !*** ./node_modules/debug/src/index.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_541857__) { -//TODO: use jPath to simplify the logic /** - * - * @param {string[]} stopNodes - * @param {string} jPath - * @param {string} currentTagName + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. */ -function isItStopNode(stopNodes, jPath, currentTagName){ - const allNodesExp = "*." + currentTagName; - for (const stopNodePath in stopNodes) { - const stopNodeExp = stopNodes[stopNodePath]; - if( allNodesExp === stopNodeExp || jPath === stopNodeExp ) return true; - } - return false; -} -/** - * Returns the tag Expression and where it is ending handling single-double quotes situation - * @param {string} xmlData - * @param {number} i starting index - * @returns - */ -function tagExpWithClosingIndex(xmlData, i, closingChar = ">"){ - let attrBoundary; - let tagExp = ""; - for (let index = i; index < xmlData.length; index++) { - let ch = xmlData[index]; - if (attrBoundary) { - if (ch === attrBoundary) attrBoundary = "";//reset - } else if (ch === '"' || ch === "'") { - attrBoundary = ch; - } else if (ch === closingChar[0]) { - if(closingChar[1]){ - if(xmlData[index + 1] === closingChar[1]){ - return { - data: tagExp, - index: index - } - } - }else{ - return { - data: tagExp, - index: index - } - } - } else if (ch === '\t') { - ch = " " - } - tagExp += ch; - } +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + module.exports = __nested_webpack_require_541857__(/*! ./browser.js */ "./node_modules/debug/src/browser.js"); +} else { + module.exports = __nested_webpack_require_541857__(/*! ./node.js */ "./node_modules/debug/src/node.js"); } -function findClosingIndex(xmlData, str, i, errMsg){ - const closingIndex = xmlData.indexOf(str, i); - if(closingIndex === -1){ - throw new Error(errMsg) - }else{ - return closingIndex + str.length - 1; - } -} -function readTagExp(xmlData,i, removeNSPrefix, closingChar = ">"){ - const result = tagExpWithClosingIndex(xmlData, i+1, closingChar); - if(!result) return; - let tagExp = result.data; - const closeIndex = result.index; - const separatorIndex = tagExp.search(/\s/); - let tagName = tagExp; - let attrExpPresent = true; - if(separatorIndex !== -1){//separate tag name and attributes expression - tagName = tagExp.substr(0, separatorIndex).replace(/\s\s*$/, ''); - tagExp = tagExp.substr(separatorIndex + 1); - } +/***/ }), - if(removeNSPrefix){ - const colonIndex = tagName.indexOf(":"); - if(colonIndex !== -1){ - tagName = tagName.substr(colonIndex+1); - attrExpPresent = tagName !== result.data.substr(colonIndex + 1); - } - } +/***/ "./node_modules/debug/src/node.js": +/*!****************************************!*\ + !*** ./node_modules/debug/src/node.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_542558__) { - return { - tagName: tagName, - tagExp: tagExp, - closeIndex: closeIndex, - attrExpPresent: attrExpPresent, - } -} /** - * find paired tag for a stop node - * @param {string} xmlData - * @param {string} tagName - * @param {number} i + * Module dependencies. */ -function readStopNodeData(xmlData, tagName, i){ - const startIndex = i; - // Starting at 1 since we already have an open tag - let openTagCount = 1; - - for (; i < xmlData.length; i++) { - if( xmlData[i] === "<"){ - if (xmlData[i+1] === "/") {//close tag - const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`); - let closeTagName = xmlData.substring(i+2,closeIndex).trim(); - if(closeTagName === tagName){ - openTagCount--; - if (openTagCount === 0) { - return { - tagContent: xmlData.substring(startIndex, i), - i : closeIndex - } - } - } - i=closeIndex; - } else if(xmlData[i+1] === '?') { - const closeIndex = findClosingIndex(xmlData, "?>", i+1, "StopNode is not closed.") - i=closeIndex; - } else if(xmlData.substr(i + 1, 3) === '!--') { - const closeIndex = findClosingIndex(xmlData, "-->", i+3, "StopNode is not closed.") - i=closeIndex; - } else if(xmlData.substr(i + 1, 2) === '![') { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2; - i=closeIndex; - } else { - const tagData = readTagExp(xmlData, i, '>') - - if (tagData) { - const openTagName = tagData && tagData.tagName; - if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length-1] !== "/") { - openTagCount++; - } - i=tagData.closeIndex; - } - } - } - }//end for loop -} -function parseValue(val, shouldParse, options) { - if (shouldParse && typeof val === 'string') { - //console.log(options) - const newval = val.trim(); - if(newval === 'true' ) return true; - else if(newval === 'false' ) return false; - else return toNumber(val, options); - } else { - if (util.isExist(val)) { - return val; - } else { - return ''; - } - } -} +const tty = __nested_webpack_require_542558__(/*! tty */ "tty"); +const util = __nested_webpack_require_542558__(/*! util */ "util"); +/** + * This is the Node.js implementation of `debug()`. + */ -module.exports = OrderedObjParser; +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' +); +/** + * Colors. + */ -/***/ }), +exports.colors = [6, 2, 3, 4, 5, 1]; -<<<<<<< HEAD -/***/ 58505: -======= -/***/ 29857: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + const supportsColor = __nested_webpack_require_542558__(/*! supports-color */ "./node_modules/supports-color/index.js"); -"use strict"; + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } +} catch (error) { + // Swallow - we only care if `supports-color` is available; it doesn't have to be. +} +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.inspectOpts = Object.keys(process.env).filter(key => { + return /^debug_/i.test(key); +}).reduce((obj, key) => { + // Camel-case + const prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); -var Path = __nccwpck_require__(71017); -var fs = __nccwpck_require__(68644); -var util = __nccwpck_require__(73837); -var glob = __nccwpck_require__(58956); -var errCode = __nccwpck_require__(5822); + // Coerce string value into JS value + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + obj[prop] = val; + return obj; +}, {}); -var Path__default = /*#__PURE__*/_interopDefaultLegacy(Path); -var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); -var glob__default = /*#__PURE__*/_interopDefaultLegacy(glob); -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ -const fsStat = util.promisify(fs__default["default"].stat); -async function getFilesFromPath(paths, options) { - const files = []; - for await (const file of filesFromPath(paths, options)) { - files.push(file); - } - return files; -} -async function* filesFromPath(paths, options) { - options = options || {}; - if (typeof paths === 'string') { - paths = [paths]; - } - const globSourceOptions = { - recursive: true, - glob: { - dot: Boolean(options.hidden), - ignore: Array.isArray(options.ignore) ? options.ignore : [], - follow: options.followSymlinks != null ? options.followSymlinks : true - } - }; - for await (const path of paths) { - if (typeof path !== 'string') { - throw errCode__default["default"](new Error('Path must be a string'), 'ERR_INVALID_PATH', { path }); - } - const absolutePath = Path__default["default"].resolve(process.cwd(), path); - const stat = await fsStat(absolutePath); - const prefix = options.pathPrefix || Path__default["default"].dirname(absolutePath); - let mode = options.mode; - if (options.preserveMode) { - mode = stat.mode; - } - let mtime = options.mtime; - if (options.preserveMtime) { - mtime = stat.mtime; - } - yield* toGlobSource({ - path, - type: stat.isDirectory() ? 'dir' : 'file', - prefix, - mode, - mtime, - size: stat.size, - preserveMode: options.preserveMode, - preserveMtime: options.preserveMtime - }, globSourceOptions); - } -} -async function* toGlobSource({path, type, prefix, mode, mtime, size, preserveMode, preserveMtime}, options) { - options = options || {}; - const baseName = Path__default["default"].basename(path); - if (type === 'file') { - yield { - name: `/${ baseName.replace(prefix, '') }`, - stream: () => fs__default["default"].createReadStream(Path__default["default"].isAbsolute(path) ? path : Path__default["default"].join(process.cwd(), path)), - mode, - mtime, - size - }; - return; - } - const globOptions = Object.assign({}, options.glob, { - cwd: path, - nodir: false, - realpath: false, - absolute: true - }); - for await (const p of glob__default["default"](path, '**/*', globOptions)) { - const stat = await fsStat(p); - if (!stat.isFile()) { - continue; - } - if (preserveMode || preserveMtime) { - if (preserveMode) { - mode = stat.mode; - } - if (preserveMtime) { - mtime = stat.mtime; - } - } - yield { - name: toPosix(p.replace(prefix, '')), - stream: () => fs__default["default"].createReadStream(p), - mode, - mtime, - size: stat.size - }; - } +function useColors() { + return 'colors' in exports.inspectOpts ? + Boolean(exports.inspectOpts.colors) : + tty.isatty(process.stderr.fd); } -const toPosix = path => path.replace(/\\/g, '/'); -exports.filesFromPath = filesFromPath; -exports.getFilesFromPath = getFilesFromPath; +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ +function formatArgs(args) { + const {namespace: name, useColors} = this; -/***/ }), + if (useColors) { + const c = this.color; + const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); + const prefix = ` ${colorCode};1m${name} \u001B[0m`; -/***/ 58956: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} -const { buildOptions} = __nccwpck_require__(80633); -const OrderedObjParser = __nccwpck_require__(79063); -const { prettify} = __nccwpck_require__(89353); -const validator = __nccwpck_require__(77890); +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + return new Date().toISOString() + ' '; +} -<<<<<<< HEAD -class XMLParser{ - - constructor(options){ - this.externalEntities = {}; - this.options = buildOptions(options); - - } - /** - * Parse XML dats to JS object - * @param {string|Buffer} xmlData - * @param {boolean|Object} validationOption - */ - parse(xmlData,validationOption){ - if(typeof xmlData === "string"){ - }else if( xmlData.toString){ - xmlData = xmlData.toString(); - }else{ - throw new Error("XML data is accepted in String or Bytes[] form.") - } - if( validationOption){ - if(validationOption === true) validationOption = {}; //validate with default options - - const result = validator.validate(xmlData, validationOption); - if (result !== true) { - throw Error( `${result.err.msg}:${result.err.line}:${result.err.col}` ) - } - } - const orderedObjParser = new OrderedObjParser(this.options); - orderedObjParser.addExternalEntities(this.externalEntities); - const orderedResult = orderedObjParser.parseXml(xmlData); - if(this.options.preserveOrder || orderedResult === undefined) return orderedResult; - else return prettify(orderedResult, this.options); -======= +/** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ -const fs = (__nccwpck_require__(57147).promises) -const path = __nccwpck_require__(71017) -const minimatch = __nccwpck_require__(71111) +function log(...args) { + return process.stderr.write(util.format(...args) + '\n'); +} /** - * @typedef {string} Glob - * @typedef {Object} OptionsExt - * @property {Glob[]} [ignore] - Glob patterns to ignore - * @property {string} [cwd=process.cwd()] - * @property {boolean} [absolute=false] - If true produces absolute paths - * @property {boolean} [nodir] - If true yields file paths and skip directories + * Save `namespaces`. * - * @typedef {OptionsExt & minimatch.IOptions} Options + * @param {String} namespaces + * @api private */ +function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } +} /** - * Async iterable filename pattern matcher + * Load `namespaces`. * - * @param {string} dir - * @param {string} pattern - * @param {Options} [options] - * @returns {AsyncIterable} + * @return {String} returns the previously persisted debug modes + * @api private */ -async function * glob (dir, pattern, options = {}) { - const absoluteDir = path.resolve(dir) - const relativeDir = path.relative(options.cwd || process.cwd(), dir) - - const stats = await fs.stat(absoluteDir) - - if (stats.isDirectory()) { - for await (const entry of _glob(absoluteDir, '', pattern, options)) { - yield entry ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - /** - * Add Entity which is not by default supported by this library - * @param {string} key - * @param {string} value - */ - addEntity(key, value){ - if(value.indexOf("&") !== -1){ - throw new Error("Entity value can't have '&'") - }else if(key.indexOf("&") !== -1 || key.indexOf(";") !== -1){ - throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '") - }else if(value === "&"){ - throw new Error("An entity with value '&' is not permitted"); - }else{ - this.externalEntities[key] = value; - } - } +function load() { + return process.env.DEBUG; } -module.exports = XMLParser; +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ -/***/ }), +function init(debug) { + debug.inspectOpts = {}; -/***/ 89353: -/***/ ((__unused_webpack_module, exports) => { + const keys = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} +module.exports = __nested_webpack_require_542558__(/*! ./common */ "./node_modules/debug/src/common.js")(exports); +const {formatters} = module.exports; /** - * - * @param {array} node - * @param {any} options - * @returns + * Map %o to `util.inspect()`, all on a single line. */ -function prettify(node, options){ - return compress( node, options); -} + +formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(str => str.trim()) + .join(' '); +}; /** - * - * @param {array} arr - * @param {object} options - * @param {string} jPath - * @returns object + * Map %O to `util.inspect()`, allowing multiple lines if needed. */ -function compress(arr, options, jPath){ - let text; - const compressedObj = {}; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const property = propName(tagObj); - let newJpath = ""; - if(jPath === undefined) newJpath = property; - else newJpath = jPath + "." + property; - if(property === options.textNodeName){ - if(text === undefined) text = tagObj[property]; - else text += "" + tagObj[property]; - }else if(property === undefined){ - continue; - }else if(tagObj[property]){ - - let val = compress(tagObj[property], options, newJpath); - const isLeaf = isLeafTag(val, options); +formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; - if(tagObj[":@"]){ - assignAttributes( val, tagObj[":@"], newJpath, options); - }else if(Object.keys(val).length === 1 && val[options.textNodeName] !== undefined && !options.alwaysCreateTextNode){ - val = val[options.textNodeName]; - }else if(Object.keys(val).length === 0){ - if(options.alwaysCreateTextNode) val[options.textNodeName] = ""; - else val = ""; - } - if(compressedObj[property] !== undefined && compressedObj.hasOwnProperty(property)) { - if(!Array.isArray(compressedObj[property])) { - compressedObj[property] = [ compressedObj[property] ]; - } - compressedObj[property].push(val); - }else{ - //TODO: if a node is not an array, then check if it should be an array - //also determine if it is a leaf node - if (options.isArray(property, newJpath, isLeaf )) { - compressedObj[property] = [val]; - }else{ - compressedObj[property] = val; - } - } - } - - } - // if(text && text.length > 0) compressedObj[options.textNodeName] = text; - if(typeof text === "string"){ - if(text.length > 0) compressedObj[options.textNodeName] = text; - }else if(text !== undefined) compressedObj[options.textNodeName] = text; - return compressedObj; -} +/***/ }), -function propName(obj){ - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if(key !== ":@") return key; - } +/***/ "./node_modules/delayed-stream/lib/delayed_stream.js": +/*!***********************************************************!*\ + !*** ./node_modules/delayed-stream/lib/delayed_stream.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_547758__) { + +var Stream = __nested_webpack_require_547758__(/*! stream */ "stream").Stream; +var util = __nested_webpack_require_547758__(/*! util */ "util"); + +module.exports = DelayedStream; +function DelayedStream() { + this.source = null; + this.dataSize = 0; + this.maxDataSize = 1024 * 1024; + this.pauseStream = true; + + this._maxDataSizeExceeded = false; + this._released = false; + this._bufferedEvents = []; } +util.inherits(DelayedStream, Stream); -function assignAttributes(obj, attrMap, jpath, options){ - if (attrMap) { - const keys = Object.keys(attrMap); - const len = keys.length; //don't make it inline - for (let i = 0; i < len; i++) { - const atrrName = keys[i]; - if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) { - obj[atrrName] = [ attrMap[atrrName] ]; - } else { - obj[atrrName] = attrMap[atrrName]; - } - } +DelayedStream.create = function(source, options) { + var delayedStream = new this(); + + options = options || {}; + for (var option in options) { + delayedStream[option] = options[option]; } -} -function isLeafTag(obj, options){ - const { textNodeName } = options; - const propCount = Object.keys(obj).length; - - if (propCount === 0) { - return true; + delayedStream.source = source; + + var realEmit = source.emit; + source.emit = function() { + delayedStream._handleEmit(arguments); + return realEmit.apply(source, arguments); + }; + + source.on('error', function() {}); + if (delayedStream.pauseStream) { + source.pause(); } - if ( - propCount === 1 && - (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0) - ) { - return true; + return delayedStream; +}; + +Object.defineProperty(DelayedStream.prototype, 'readable', { + configurable: true, + enumerable: true, + get: function() { + return this.source.readable; } +}); - return false; -} -exports.prettify = prettify; +DelayedStream.prototype.setEncoding = function() { + return this.source.setEncoding.apply(this.source, arguments); +}; +DelayedStream.prototype.resume = function() { + if (!this._released) { + this.release(); + } -/***/ }), + this.source.resume(); +}; -<<<<<<< HEAD -/***/ 43056: -/***/ ((module) => { +DelayedStream.prototype.pause = function() { + this.source.pause(); +}; +DelayedStream.prototype.release = function() { + this._released = true; + this._bufferedEvents.forEach(function(args) { + this.emit.apply(this, args); + }.bind(this)); + this._bufferedEvents = []; +}; -class XmlNode{ - constructor(tagname) { - this.tagname = tagname; - this.child = []; //nested tags, text, cdata, comments in order - this[":@"] = {}; //attributes map +DelayedStream.prototype.pipe = function() { + var r = Stream.prototype.pipe.apply(this, arguments); + this.resume(); + return r; +}; + +DelayedStream.prototype._handleEmit = function(args) { + if (this._released) { + this.emit.apply(this, args); + return; } - add(key,val){ - // this.child.push( {name : key, val: val, isCdata: isCdata }); - if(key === "__proto__") key = "#__proto__"; - this.child.push( {[key]: val }); + + if (args[0] === 'data') { + this.dataSize += args[1].length; + this._checkIfMaxDataSizeExceeded(); } - addChild(node) { - if(node.tagname === "__proto__") node.tagname = "#__proto__"; - if(node[":@"] && Object.keys(node[":@"]).length > 0){ - this.child.push( { [node.tagname]: node.child, [":@"]: node[":@"] }); - }else{ - this.child.push( { [node.tagname]: node.child }); - } - }; + + this._bufferedEvents.push(args); }; +DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { + if (this._maxDataSizeExceeded) { + return; + } + + if (this.dataSize <= this.maxDataSize) { + return; + } + + this._maxDataSizeExceeded = true; + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' + this.emit('error', new Error(message)); +}; -module.exports = XmlNode; /***/ }), -/***/ 62879: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ "./node_modules/follow-redirects/debug.js": +/*!************************************************!*\ + !*** ./node_modules/follow-redirects/debug.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_550439__) { var debug; - -module.exports = function () { - if (!debug) { - try { - /* eslint global-require: off */ - debug = __nccwpck_require__(80908)("follow-redirects"); - } - catch (error) { /* */ } - if (typeof debug !== "function") { - debug = function () { /* */ }; - } - } - debug.apply(null, arguments); -}; +try { + /* eslint global-require: off */ + debug = __nested_webpack_require_550439__(/*! debug */ "./node_modules/debug/src/index.js")("follow-redirects"); +} +catch (error) { + debug = function () { /* */ }; +} +module.exports = debug; /***/ }), -/***/ 55213: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ "./node_modules/follow-redirects/index.js": +/*!************************************************!*\ + !*** ./node_modules/follow-redirects/index.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_550981__) { -var url = __nccwpck_require__(57310); +var url = __nested_webpack_require_550981__(/*! url */ "url"); var URL = url.URL; -var http = __nccwpck_require__(13685); -var https = __nccwpck_require__(95687); -var Writable = (__nccwpck_require__(12781).Writable); -var assert = __nccwpck_require__(39491); -var debug = __nccwpck_require__(62879); +var http = __nested_webpack_require_550981__(/*! http */ "http"); +var https = __nested_webpack_require_550981__(/*! https */ "https"); +var Writable = __nested_webpack_require_550981__(/*! stream */ "stream").Writable; +var assert = __nested_webpack_require_550981__(/*! assert */ "assert"); +var debug = __nested_webpack_require_550981__(/*! ./debug */ "./node_modules/follow-redirects/debug.js"); // Create handlers that pass events from native requests -var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; var eventHandlers = Object.create(null); -events.forEach(function (event) { +["abort", "aborted", "connect", "error", "socket", "timeout"].forEach(function (event) { eventHandlers[event] = function (arg1, arg2, arg3) { this._redirectable.emit(event, arg1, arg2, arg3); }; }); -var InvalidUrlError = createErrorType( - "ERR_INVALID_URL", - "Invalid URL", - TypeError -); // Error types with codes var RedirectionError = createErrorType( "ERR_FR_REDIRECTION_FAILURE", - "Redirected request failed" + "" ); var TooManyRedirectsError = createErrorType( "ERR_FR_TOO_MANY_REDIRECTS", @@ -128521,9 +52232,6 @@ var WriteAfterEndError = createErrorType( "write after end" ); -// istanbul ignore next -var destroy = Writable.prototype.destroy || noop; - // An HTTP(S) request that can be redirected function RedirectableRequest(options, responseCallback) { // Initialize the request @@ -128553,18 +52261,6 @@ function RedirectableRequest(options, responseCallback) { } RedirectableRequest.prototype = Object.create(Writable.prototype); -RedirectableRequest.prototype.abort = function () { - destroyRequest(this._currentRequest); - this._currentRequest.abort(); - this.emit("abort"); -}; - -RedirectableRequest.prototype.destroy = function (error) { - destroyRequest(this._currentRequest, error); - destroy.call(this, error); - return this; -}; - // Writes buffered data to the current native request RedirectableRequest.prototype.write = function (data, encoding, callback) { // Writing is not allowed if end has been called @@ -128573,10 +52269,10 @@ RedirectableRequest.prototype.write = function (data, encoding, callback) { } // Validate input and shift parameters if necessary - if (!isString(data) && !isBuffer(data)) { + if (!(typeof data === "string" || typeof data === "object" && ("length" in data))) { throw new TypeError("data should be a string, Buffer or Uint8Array"); } - if (isFunction(encoding)) { + if (typeof encoding === "function") { callback = encoding; encoding = null; } @@ -128605,11 +52301,11 @@ RedirectableRequest.prototype.write = function (data, encoding, callback) { // Ends the current native request RedirectableRequest.prototype.end = function (data, encoding, callback) { // Shift parameters if necessary - if (isFunction(data)) { + if (typeof data === "function") { callback = data; data = encoding = null; } - else if (isFunction(encoding)) { + else if (typeof encoding === "function") { callback = encoding; encoding = null; } @@ -128644,74 +52340,40 @@ RedirectableRequest.prototype.removeHeader = function (name) { // Global timeout for all underlying requests RedirectableRequest.prototype.setTimeout = function (msecs, callback) { - var self = this; - - // Destroys the socket on timeout - function destroyOnTimeout(socket) { - socket.setTimeout(msecs); - socket.removeListener("timeout", socket.destroy); - socket.addListener("timeout", socket.destroy); - } - - // Sets up a timer to trigger a timeout event - function startTimer(socket) { - if (self._timeout) { - clearTimeout(self._timeout); - } - self._timeout = setTimeout(function () { - self.emit("timeout"); - clearTimer(); - }, msecs); - destroyOnTimeout(socket); - } - - // Stops a timeout from triggering - function clearTimer() { - // Clear the timeout - if (self._timeout) { - clearTimeout(self._timeout); - self._timeout = null; - } - - // Clean up all attached listeners - self.removeListener("abort", clearTimer); - self.removeListener("error", clearTimer); - self.removeListener("response", clearTimer); - self.removeListener("close", clearTimer); - if (callback) { - self.removeListener("timeout", callback); - } - if (!self.socket) { - self._currentRequest.removeListener("socket", startTimer); - } - } - - // Attach callback if passed if (callback) { - this.on("timeout", callback); + this.once("timeout", callback); } - // Start the timer if or when the socket is opened if (this.socket) { - startTimer(this.socket); + startTimer(this, msecs); } else { - this._currentRequest.once("socket", startTimer); + var self = this; + this._currentRequest.once("socket", function () { + startTimer(self, msecs); + }); } - // Clean up on events - this.on("socket", destroyOnTimeout); - this.on("abort", clearTimer); - this.on("error", clearTimer); - this.on("response", clearTimer); - this.on("close", clearTimer); + this.once("response", clearTimer); + this.once("error", clearTimer); return this; }; +function startTimer(request, msecs) { + clearTimeout(request._timeout); + request._timeout = setTimeout(function () { + request.emit("timeout"); + }, msecs); +} + +function clearTimer() { + clearTimeout(this._timeout); +} + // Proxy all other public ClientRequest methods [ - "flushHeaders", "getHeader", + "abort", "flushHeaders", "getHeader", "setNoDelay", "setSocketKeepAlive", ].forEach(function (method) { RedirectableRequest.prototype[method] = function (a, b) { @@ -128770,30 +52432,28 @@ RedirectableRequest.prototype._performRequest = function () { // If specified, use the agent corresponding to the protocol // (HTTP and HTTPS use different types of agents) if (this._options.agents) { - var scheme = protocol.slice(0, -1); + var scheme = protocol.substr(0, protocol.length - 1); this._options.agent = this._options.agents[scheme]; } - // Create the native request and set up its event handlers + // Create the native request var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); - request._redirectable = this; - for (var event of events) { - request.on(event, eventHandlers[event]); + this._currentUrl = url.format(this._options); + + // Set up event handlers + request._redirectable = this; + for (var event in eventHandlers) { + /* istanbul ignore else */ + if (event) { + request.on(event, eventHandlers[event]); + } } - // RFC7230§5.3.1: When making a request directly to an origin server, […] - // a client MUST send only the absolute path […] as the request-target. - this._currentUrl = /^\//.test(this._options.path) ? - url.format(this._options) : - // When making a request to a proxy, […] - // a client MUST send the target URI in absolute-form […]. - this._options.path; - // End a redirected request // (The first request must be ended explicitly with RedirectableRequest#end) if (this._isRedirect) { - // Write the request entity and end + // Write the request entity and end. var i = 0; var self = this; var buffers = this._requestBodyBuffers; @@ -128841,120 +52501,86 @@ RedirectableRequest.prototype._processResponse = function (response) { // the user agent MAY automatically redirect its request to the URI // referenced by the Location field value, // even if the specific status code is not understood. - - // If the response is not a redirect; return it as-is var location = response.headers.location; - if (!location || this._options.followRedirects === false || - statusCode < 300 || statusCode >= 400) { - response.responseUrl = this._currentUrl; - response.redirects = this._redirects; - this.emit("response", response); - - // Clean up - this._requestBodyBuffers = []; - return; - } - - // The response is a redirect, so abort the current request - destroyRequest(this._currentRequest); - // Discard the remainder of the response to avoid waiting for data - response.destroy(); - - // RFC7231§6.4: A client SHOULD detect and intervene - // in cyclical redirections (i.e., "infinite" redirection loops). - if (++this._redirectCount > this._options.maxRedirects) { - this.emit("error", new TooManyRedirectsError()); - return; - } - - // Store the request headers if applicable - var requestHeaders; - var beforeRedirect = this._options.beforeRedirect; - if (beforeRedirect) { - requestHeaders = Object.assign({ - // The Host header was set by nativeProtocol.request - Host: response.req.getHeader("host"), - }, this._options.headers); - } + if (location && this._options.followRedirects !== false && + statusCode >= 300 && statusCode < 400) { + // Abort the current request + this._currentRequest.removeAllListeners(); + this._currentRequest.on("error", noop); + this._currentRequest.abort(); + // Discard the remainder of the response to avoid waiting for data + response.destroy(); - // RFC7231§6.4: Automatic redirection needs to done with - // care for methods not known to be safe, […] - // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change - // the request method from POST to GET for the subsequent request. - var method = this._options.method; - if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || - // RFC7231§6.4.4: The 303 (See Other) status code indicates that - // the server is redirecting the user agent to a different resource […] - // A user agent can perform a retrieval request targeting that URI - // (a GET or HEAD request if using HTTP) […] - (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { - this._options.method = "GET"; - // Drop a possible entity and headers related to it - this._requestBodyBuffers = []; - removeMatchingHeaders(/^content-/i, this._options.headers); - } + // RFC7231§6.4: A client SHOULD detect and intervene + // in cyclical redirections (i.e., "infinite" redirection loops). + if (++this._redirectCount > this._options.maxRedirects) { + this.emit("error", new TooManyRedirectsError()); + return; + } - // Drop the Host header, as the redirect might lead to a different host - var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); + // RFC7231§6.4: Automatic redirection needs to done with + // care for methods not known to be safe, […] + // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change + // the request method from POST to GET for the subsequent request. + if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || + // RFC7231§6.4.4: The 303 (See Other) status code indicates that + // the server is redirecting the user agent to a different resource […] + // A user agent can perform a retrieval request targeting that URI + // (a GET or HEAD request if using HTTP) […] + (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { + this._options.method = "GET"; + // Drop a possible entity and headers related to it + this._requestBodyBuffers = []; + removeMatchingHeaders(/^content-/i, this._options.headers); + } - // If the redirect is relative, carry over the host of the last request - var currentUrlParts = url.parse(this._currentUrl); - var currentHost = currentHostHeader || currentUrlParts.host; - var currentUrl = /^\w+:/.test(location) ? this._currentUrl : - url.format(Object.assign(currentUrlParts, { host: currentHost })); + // Drop the Host header, as the redirect might lead to a different host + var previousHostName = removeMatchingHeaders(/^host$/i, this._options.headers) || + url.parse(this._currentUrl).hostname; - // Determine the URL of the redirection - var redirectUrl; - try { - redirectUrl = url.resolve(currentUrl, location); - } - catch (cause) { - this.emit("error", new RedirectionError({ cause: cause })); - return; - } + // Create the redirected request + var redirectUrl = url.resolve(this._currentUrl, location); + debug("redirecting to", redirectUrl); + this._isRedirect = true; + var redirectUrlParts = url.parse(redirectUrl); + Object.assign(this._options, redirectUrlParts); - // Create the redirected request - debug("redirecting to", redirectUrl); - this._isRedirect = true; - var redirectUrlParts = url.parse(redirectUrl); - Object.assign(this._options, redirectUrlParts); + // Drop the Authorization header if redirecting to another host + if (redirectUrlParts.hostname !== previousHostName) { + removeMatchingHeaders(/^authorization$/i, this._options.headers); + } - // Drop confidential headers when redirecting to a less secure protocol - // or to a different domain that is not a superdomain - if (redirectUrlParts.protocol !== currentUrlParts.protocol && - redirectUrlParts.protocol !== "https:" || - redirectUrlParts.host !== currentHost && - !isSubdomain(redirectUrlParts.host, currentHost)) { - removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers); - } + // Evaluate the beforeRedirect callback + if (typeof this._options.beforeRedirect === "function") { + var responseDetails = { headers: response.headers }; + try { + this._options.beforeRedirect.call(null, this._options, responseDetails); + } + catch (err) { + this.emit("error", err); + return; + } + this._sanitizeOptions(this._options); + } - // Evaluate the beforeRedirect callback - if (isFunction(beforeRedirect)) { - var responseDetails = { - headers: response.headers, - statusCode: statusCode, - }; - var requestDetails = { - url: currentUrl, - method: method, - headers: requestHeaders, - }; + // Perform the redirected request try { - beforeRedirect(this._options, responseDetails, requestDetails); + this._performRequest(); } - catch (err) { - this.emit("error", err); - return; + catch (cause) { + var error = new RedirectionError("Redirected request failed: " + cause.message); + error.cause = cause; + this.emit("error", error); } - this._sanitizeOptions(this._options); } + else { + // The response is not a redirect; return it as-is + response.responseUrl = this._currentUrl; + response.redirects = this._redirects; + this.emit("response", response); - // Perform the redirected request - try { - this._performRequest(); - } - catch (cause) { - this.emit("error", new RedirectionError({ cause: cause })); + // Clean up + this._requestBodyBuffers = []; } }; @@ -128976,19 +52602,15 @@ function wrap(protocols) { // Executes a request, following redirects function request(input, options, callback) { // Parse parameters - if (isString(input)) { - var parsed; + if (typeof input === "string") { + var urlStr = input; try { - parsed = urlToOptions(new URL(input)); + input = urlToOptions(new URL(urlStr)); } catch (err) { /* istanbul ignore next */ - parsed = url.parse(input); - } - if (!isString(parsed.protocol)) { - throw new InvalidUrlError({ input }); + input = url.parse(urlStr); } - input = parsed; } else if (URL && (input instanceof URL)) { input = urlToOptions(input); @@ -128998,7 +52620,7 @@ function wrap(protocols) { options = input; input = { protocol: protocol }; } - if (isFunction(options)) { + if (typeof options === "function") { callback = options; options = null; } @@ -129009,9 +52631,6 @@ function wrap(protocols) { maxBodyLength: exports.maxBodyLength, }, input, options); options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { - options.hostname = "::1"; - } assert.equal(options.protocol, protocol, "protocol mismatch"); debug("options", options); @@ -129065,52 +52684,21 @@ function removeMatchingHeaders(regex, headers) { delete headers[header]; } } - return (lastValue === null || typeof lastValue === "undefined") ? - undefined : String(lastValue).trim(); + return lastValue; } -function createErrorType(code, message, baseClass) { - // Create constructor - function CustomError(properties) { +function createErrorType(code, defaultMessage) { + function CustomError(message) { Error.captureStackTrace(this, this.constructor); - Object.assign(this, properties || {}); - this.code = code; - this.message = this.cause ? message + ": " + this.cause.message : message; + this.message = message || defaultMessage; } - - // Attach constructor and set default properties - CustomError.prototype = new (baseClass || Error)(); + CustomError.prototype = new Error(); CustomError.prototype.constructor = CustomError; CustomError.prototype.name = "Error [" + code + "]"; + CustomError.prototype.code = code; return CustomError; } -function destroyRequest(request, error) { - for (var event of events) { - request.removeListener(event, eventHandlers[event]); - } - request.on("error", noop); - request.destroy(error); -} - -function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); - var dot = subdomain.length - domain.length - 1; - return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); -} - -function isString(value) { - return typeof value === "string" || value instanceof String; -} - -function isFunction(value) { - return typeof value === "function"; -} - -function isBuffer(value) { - return typeof value === "object" && ("length" in value); -} - // Exports module.exports = wrap({ http: http, https: https }); module.exports.wrap = wrap; @@ -129118,20 +52706,23 @@ module.exports.wrap = wrap; /***/ }), -/***/ 68111: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ "./node_modules/form-data/lib/form_data.js": +/*!*************************************************!*\ + !*** ./node_modules/form-data/lib/form_data.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_567065__) { -var CombinedStream = __nccwpck_require__(69715); -var util = __nccwpck_require__(73837); -var path = __nccwpck_require__(71017); -var http = __nccwpck_require__(13685); -var https = __nccwpck_require__(95687); -var parseUrl = (__nccwpck_require__(57310).parse); -var fs = __nccwpck_require__(57147); -var Stream = (__nccwpck_require__(12781).Stream); -var mime = __nccwpck_require__(21919); -var asynckit = __nccwpck_require__(75719); -var populate = __nccwpck_require__(74808); +var CombinedStream = __nested_webpack_require_567065__(/*! combined-stream */ "./node_modules/combined-stream/lib/combined_stream.js"); +var util = __nested_webpack_require_567065__(/*! util */ "util"); +var path = __nested_webpack_require_567065__(/*! path */ "path"); +var http = __nested_webpack_require_567065__(/*! http */ "http"); +var https = __nested_webpack_require_567065__(/*! https */ "https"); +var parseUrl = __nested_webpack_require_567065__(/*! url */ "url").parse; +var fs = __nested_webpack_require_567065__(/*! fs */ "fs"); +var mime = __nested_webpack_require_567065__(/*! mime-types */ "./node_modules/mime-types/index.js"); +var asynckit = __nested_webpack_require_567065__(/*! asynckit */ "./node_modules/asynckit/index.js"); +var populate = __nested_webpack_require_567065__(/*! ./populate.js */ "./node_modules/form-data/lib/populate.js"); // Public API module.exports = FormData; @@ -129149,7 +52740,7 @@ util.inherits(FormData, CombinedStream); */ function FormData(options) { if (!(this instanceof FormData)) { - return new FormData(options); + return new FormData(); } this._overheadLength = 0; @@ -129224,8 +52815,8 @@ FormData.prototype._trackLength = function(header, value, options) { Buffer.byteLength(header) + FormData.LINE_BREAK.length; - // empty or either doesn't have path or not an http response or not a stream - if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) && !(value instanceof Stream))) { + // empty or either doesn't have path or not an http response + if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) { return; } @@ -129324,6074 +52915,6370 @@ FormData.prototype._multiPartHeader = function(field, value, options) { continue; } - // convert all headers to arrays. - if (!Array.isArray(header)) { - header = [header]; - } + // convert all headers to arrays. + if (!Array.isArray(header)) { + header = [header]; + } + + // add non-empty headers. + if (header.length) { + contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK; + } + } + + return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; +}; + +FormData.prototype._getContentDisposition = function(value, options) { + + var filename + , contentDisposition + ; + + if (typeof options.filepath === 'string') { + // custom filepath for relative paths + filename = path.normalize(options.filepath).replace(/\\/g, '/'); + } else if (options.filename || value.name || value.path) { + // custom filename take precedence + // formidable and the browser add a name property + // fs- and request- streams have path property + filename = path.basename(options.filename || value.name || value.path); + } else if (value.readable && value.hasOwnProperty('httpVersion')) { + // or try http response + filename = path.basename(value.client._httpMessage.path || ''); + } + + if (filename) { + contentDisposition = 'filename="' + filename + '"'; + } + + return contentDisposition; +}; + +FormData.prototype._getContentType = function(value, options) { + + // use custom content-type above all + var contentType = options.contentType; + + // or try `name` from formidable, browser + if (!contentType && value.name) { + contentType = mime.lookup(value.name); + } + + // or try `path` from fs-, request- streams + if (!contentType && value.path) { + contentType = mime.lookup(value.path); + } + + // or if it's http-reponse + if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) { + contentType = value.headers['content-type']; + } + + // or guess it from the filepath or filename + if (!contentType && (options.filepath || options.filename)) { + contentType = mime.lookup(options.filepath || options.filename); + } + + // fallback to the default content type if `value` is not simple value + if (!contentType && typeof value == 'object') { + contentType = FormData.DEFAULT_CONTENT_TYPE; + } + + return contentType; +}; + +FormData.prototype._multiPartFooter = function() { + return function(next) { + var footer = FormData.LINE_BREAK; + + var lastPart = (this._streams.length === 0); + if (lastPart) { + footer += this._lastBoundary(); + } + + next(footer); + }.bind(this); +}; + +FormData.prototype._lastBoundary = function() { + return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; +}; + +FormData.prototype.getHeaders = function(userHeaders) { + var header; + var formHeaders = { + 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() + }; + + for (header in userHeaders) { + if (userHeaders.hasOwnProperty(header)) { + formHeaders[header.toLowerCase()] = userHeaders[header]; + } + } + + return formHeaders; +}; + +FormData.prototype.getBoundary = function() { + if (!this._boundary) { + this._generateBoundary(); + } + + return this._boundary; +}; + +FormData.prototype.getBuffer = function() { + var dataBuffer = new Buffer.alloc( 0 ); + var boundary = this.getBoundary(); + + // Create the form content. Add Line breaks to the end of data. + for (var i = 0, len = this._streams.length; i < len; i++) { + if (typeof this._streams[i] !== 'function') { + + // Add content to the buffer. + if(Buffer.isBuffer(this._streams[i])) { + dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]); + }else { + dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]); + } + + // Add break after content. + if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) { + dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] ); + } + } + } + + // Add the footer and return the Buffer object. + return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] ); +}; + +FormData.prototype._generateBoundary = function() { + // This generates a 50 character boundary similar to those used by Firefox. + // They are optimized for boyer-moore parsing. + var boundary = '--------------------------'; + for (var i = 0; i < 24; i++) { + boundary += Math.floor(Math.random() * 10).toString(16); + } + + this._boundary = boundary; +}; + +// Note: getLengthSync DOESN'T calculate streams length +// As workaround one can calculate file size manually +// and add it as knownLength option +FormData.prototype.getLengthSync = function() { + var knownLength = this._overheadLength + this._valueLength; + + // Don't get confused, there are 3 "internal" streams for each keyval pair + // so it basically checks if there is any value added to the form + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } + + // https://github.com/form-data/form-data/issues/40 + if (!this.hasKnownLength()) { + // Some async length retrievers are present + // therefore synchronous length calculation is false. + // Please use getLength(callback) to get proper length + this._error(new Error('Cannot calculate proper length in synchronous way.')); + } + + return knownLength; +}; + +// Public API to check if length of added values is known +// https://github.com/form-data/form-data/issues/196 +// https://github.com/form-data/form-data/issues/262 +FormData.prototype.hasKnownLength = function() { + var hasKnownLength = true; + + if (this._valuesToMeasure.length) { + hasKnownLength = false; + } + + return hasKnownLength; +}; + +FormData.prototype.getLength = function(cb) { + var knownLength = this._overheadLength + this._valueLength; + + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } + + if (!this._valuesToMeasure.length) { + process.nextTick(cb.bind(this, null, knownLength)); + return; + } + + asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { + if (err) { + cb(err); + return; + } + + values.forEach(function(length) { + knownLength += length; + }); + + cb(null, knownLength); + }); +}; + +FormData.prototype.submit = function(params, cb) { + var request + , options + , defaults = {method: 'post'} + ; + + // parse provided url if it's string + // or treat it as options object + if (typeof params == 'string') { + + params = parseUrl(params); + options = populate({ + port: params.port, + path: params.pathname, + host: params.hostname, + protocol: params.protocol + }, defaults); + + // use custom params + } else { + + options = populate(params, defaults); + // if no port provided use default one + if (!options.port) { + options.port = options.protocol == 'https:' ? 443 : 80; + } + } + + // put that good code in getHeaders to some use + options.headers = this.getHeaders(params.headers); + + // https if specified, fallback to http in any other case + if (options.protocol == 'https:') { + request = https.request(options); + } else { + request = http.request(options); + } + + // get content length and fire away + this.getLength(function(err, length) { + if (err) { + this._error(err); + return; + } + + // add content length + request.setHeader('Content-Length', length); + + this.pipe(request); + if (cb) { + request.on('error', cb); + request.on('response', cb.bind(this, null)); + } + }.bind(this)); + + return request; +}; + +FormData.prototype._error = function(err) { + if (!this.error) { + this.error = err; + this.pause(); + this.emit('error', err); + } +}; + +FormData.prototype.toString = function () { + return '[object FormData]'; +}; + + +/***/ }), + +/***/ "./node_modules/form-data/lib/populate.js": +/*!************************************************!*\ + !*** ./node_modules/form-data/lib/populate.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// populates missing values +module.exports = function(dst, src) { + + Object.keys(src).forEach(function(prop) + { + dst[prop] = dst[prop] || src[prop]; + }); + + return dst; +}; + + +/***/ }), + +/***/ "./node_modules/has-flag/index.js": +/*!****************************************!*\ + !*** ./node_modules/has-flag/index.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { + +"use strict"; + +module.exports = (flag, argv) => { + argv = argv || process.argv; + const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); + const pos = argv.indexOf(prefix + flag); + const terminatorPos = argv.indexOf('--'); + return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); +}; + + +/***/ }), + +/***/ "./node_modules/hi-base32/src/base32.js": +/*!**********************************************!*\ + !*** ./node_modules/hi-base32/src/base32.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_582018__) { + +var __WEBPACK_AMD_DEFINE_RESULT__;/* + * [hi-base32]{@link https://github.com/emn178/hi-base32} + * + * @version 0.5.0 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2015-2018 + * @license MIT + */ +/*jslint bitwise: true */ +(function () { + 'use strict'; + + var root = typeof window === 'object' ? window : {}; + var NODE_JS = !root.HI_BASE32_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node; + if (NODE_JS) { + root = global; + } + var COMMON_JS = !root.HI_BASE32_NO_COMMON_JS && typeof module === 'object' && module.exports; + var AMD = true && __nested_webpack_require_582018__(/*! !webpack amd options */ "./node_modules/webpack/buildin/amd-options.js"); + var BASE32_ENCODE_CHAR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'.split(''); + var BASE32_DECODE_CHAR = { + 'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': 6, 'H': 7, 'I': 8, + 'J': 9, 'K': 10, 'L': 11, 'M': 12, 'N': 13, 'O': 14, 'P': 15, 'Q': 16, + 'R': 17, 'S': 18, 'T': 19, 'U': 20, 'V': 21, 'W': 22, 'X': 23, 'Y': 24, + 'Z': 25, '2': 26, '3': 27, '4': 28, '5': 29, '6': 30, '7': 31 + }; + + var blocks = [0, 0, 0, 0, 0, 0, 0, 0]; + + var throwInvalidUtf8 = function (position, partial) { + if (partial.length > 10) { + partial = '...' + partial.substr(-10); + } + var err = new Error('Decoded data is not valid UTF-8.' + + ' Maybe try base32.decode.asBytes()?' + + ' Partial data after reading ' + position + ' bytes: ' + partial + ' <-'); + err.position = position; + throw err; + }; + + var toUtf8String = function (bytes) { + var str = '', length = bytes.length, i = 0, followingChars = 0, b, c; + while (i < length) { + b = bytes[i++]; + if (b <= 0x7F) { + str += String.fromCharCode(b); + continue; + } else if (b > 0xBF && b <= 0xDF) { + c = b & 0x1F; + followingChars = 1; + } else if (b <= 0xEF) { + c = b & 0x0F; + followingChars = 2; + } else if (b <= 0xF7) { + c = b & 0x07; + followingChars = 3; + } else { + throwInvalidUtf8(i, str); + } + + for (var j = 0; j < followingChars; ++j) { + b = bytes[i++]; + if (b < 0x80 || b > 0xBF) { + throwInvalidUtf8(i, str); + } + c <<= 6; + c += b & 0x3F; + } + if (c >= 0xD800 && c <= 0xDFFF) { + throwInvalidUtf8(i, str); + } + if (c > 0x10FFFF) { + throwInvalidUtf8(i, str); + } + + if (c <= 0xFFFF) { + str += String.fromCharCode(c); + } else { + c -= 0x10000; + str += String.fromCharCode((c >> 10) + 0xD800); + str += String.fromCharCode((c & 0x3FF) + 0xDC00); + } + } + return str; + }; + + var decodeAsBytes = function (base32Str) { + if (!/^[A-Z2-7=]+$/.test(base32Str)) { + throw new Error('Invalid base32 characters'); + } + base32Str = base32Str.replace(/=/g, ''); + var v1, v2, v3, v4, v5, v6, v7, v8, bytes = [], index = 0, length = base32Str.length; + + // 4 char to 3 bytes + for (var i = 0, count = length >> 3 << 3; i < count;) { + v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v6 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v7 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v8 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + bytes[index++] = (v1 << 3 | v2 >>> 2) & 255; + bytes[index++] = (v2 << 6 | v3 << 1 | v4 >>> 4) & 255; + bytes[index++] = (v4 << 4 | v5 >>> 1) & 255; + bytes[index++] = (v5 << 7 | v6 << 2 | v7 >>> 3) & 255; + bytes[index++] = (v7 << 5 | v8) & 255; + } + + // remain bytes + var remain = length - count; + if (remain === 2) { + v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + bytes[index++] = (v1 << 3 | v2 >>> 2) & 255; + } else if (remain === 4) { + v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + bytes[index++] = (v1 << 3 | v2 >>> 2) & 255; + bytes[index++] = (v2 << 6 | v3 << 1 | v4 >>> 4) & 255; + } else if (remain === 5) { + v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + bytes[index++] = (v1 << 3 | v2 >>> 2) & 255; + bytes[index++] = (v2 << 6 | v3 << 1 | v4 >>> 4) & 255; + bytes[index++] = (v4 << 4 | v5 >>> 1) & 255; + } else if (remain === 7) { + v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v6 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v7 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + bytes[index++] = (v1 << 3 | v2 >>> 2) & 255; + bytes[index++] = (v2 << 6 | v3 << 1 | v4 >>> 4) & 255; + bytes[index++] = (v4 << 4 | v5 >>> 1) & 255; + bytes[index++] = (v5 << 7 | v6 << 2 | v7 >>> 3) & 255; + } + return bytes; + }; + + var encodeAscii = function (str) { + var v1, v2, v3, v4, v5, base32Str = '', length = str.length; + for (var i = 0, count = parseInt(length / 5) * 5; i < count;) { + v1 = str.charCodeAt(i++); + v2 = str.charCodeAt(i++); + v3 = str.charCodeAt(i++); + v4 = str.charCodeAt(i++); + v5 = str.charCodeAt(i++); + base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + + BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + + BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + + BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] + + BASE32_ENCODE_CHAR[(v3 << 1 | v4 >>> 7) & 31] + + BASE32_ENCODE_CHAR[(v4 >>> 2) & 31] + + BASE32_ENCODE_CHAR[(v4 << 3 | v5 >>> 5) & 31] + + BASE32_ENCODE_CHAR[v5 & 31]; + } + + // remain char + var remain = length - count; + if (remain === 1) { + v1 = str.charCodeAt(i); + base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + + BASE32_ENCODE_CHAR[(v1 << 2) & 31] + + '======'; + } else if (remain === 2) { + v1 = str.charCodeAt(i++); + v2 = str.charCodeAt(i); + base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + + BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + + BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + + BASE32_ENCODE_CHAR[(v2 << 4) & 31] + + '===='; + } else if (remain === 3) { + v1 = str.charCodeAt(i++); + v2 = str.charCodeAt(i++); + v3 = str.charCodeAt(i); + base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + + BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + + BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + + BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] + + BASE32_ENCODE_CHAR[(v3 << 1) & 31] + + '==='; + } else if (remain === 4) { + v1 = str.charCodeAt(i++); + v2 = str.charCodeAt(i++); + v3 = str.charCodeAt(i++); + v4 = str.charCodeAt(i); + base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + + BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + + BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + + BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] + + BASE32_ENCODE_CHAR[(v3 << 1 | v4 >>> 7) & 31] + + BASE32_ENCODE_CHAR[(v4 >>> 2) & 31] + + BASE32_ENCODE_CHAR[(v4 << 3) & 31] + + '='; + } + return base32Str; + }; + + var encodeUtf8 = function (str) { + var v1, v2, v3, v4, v5, code, end = false, base32Str = '', + index = 0, i, start = 0, bytes = 0, length = str.length; + do { + blocks[0] = blocks[5]; + blocks[1] = blocks[6]; + blocks[2] = blocks[7]; + for (i = start; index < length && i < 5; ++index) { + code = str.charCodeAt(index); + if (code < 0x80) { + blocks[i++] = code; + } else if (code < 0x800) { + blocks[i++] = 0xc0 | (code >> 6); + blocks[i++] = 0x80 | (code & 0x3f); + } else if (code < 0xd800 || code >= 0xe000) { + blocks[i++] = 0xe0 | (code >> 12); + blocks[i++] = 0x80 | ((code >> 6) & 0x3f); + blocks[i++] = 0x80 | (code & 0x3f); + } else { + code = 0x10000 + (((code & 0x3ff) << 10) | (str.charCodeAt(++index) & 0x3ff)); + blocks[i++] = 0xf0 | (code >> 18); + blocks[i++] = 0x80 | ((code >> 12) & 0x3f); + blocks[i++] = 0x80 | ((code >> 6) & 0x3f); + blocks[i++] = 0x80 | (code & 0x3f); + } + } + bytes += i - start; + start = i - 5; + if (index === length) { + ++index; + } + if (index > length && i < 6) { + end = true; + } + v1 = blocks[0]; + if (i > 4) { + v2 = blocks[1]; + v3 = blocks[2]; + v4 = blocks[3]; + v5 = blocks[4]; + base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + + BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + + BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + + BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] + + BASE32_ENCODE_CHAR[(v3 << 1 | v4 >>> 7) & 31] + + BASE32_ENCODE_CHAR[(v4 >>> 2) & 31] + + BASE32_ENCODE_CHAR[(v4 << 3 | v5 >>> 5) & 31] + + BASE32_ENCODE_CHAR[v5 & 31]; + } else if (i === 1) { + base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + + BASE32_ENCODE_CHAR[(v1 << 2) & 31] + + '======'; + } else if (i === 2) { + v2 = blocks[1]; + base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + + BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + + BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + + BASE32_ENCODE_CHAR[(v2 << 4) & 31] + + '===='; + } else if (i === 3) { + v2 = blocks[1]; + v3 = blocks[2]; + base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + + BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + + BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + + BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] + + BASE32_ENCODE_CHAR[(v3 << 1) & 31] + + '==='; + } else { + v2 = blocks[1]; + v3 = blocks[2]; + v4 = blocks[3]; + base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + + BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + + BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + + BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] + + BASE32_ENCODE_CHAR[(v3 << 1 | v4 >>> 7) & 31] + + BASE32_ENCODE_CHAR[(v4 >>> 2) & 31] + + BASE32_ENCODE_CHAR[(v4 << 3) & 31] + + '='; + } + } while (!end); + return base32Str; + }; + + var encodeBytes = function (bytes) { + var v1, v2, v3, v4, v5, base32Str = '', length = bytes.length; + for (var i = 0, count = parseInt(length / 5) * 5; i < count;) { + v1 = bytes[i++]; + v2 = bytes[i++]; + v3 = bytes[i++]; + v4 = bytes[i++]; + v5 = bytes[i++]; + base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + + BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + + BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + + BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] + + BASE32_ENCODE_CHAR[(v3 << 1 | v4 >>> 7) & 31] + + BASE32_ENCODE_CHAR[(v4 >>> 2) & 31] + + BASE32_ENCODE_CHAR[(v4 << 3 | v5 >>> 5) & 31] + + BASE32_ENCODE_CHAR[v5 & 31]; + } + + // remain char + var remain = length - count; + if (remain === 1) { + v1 = bytes[i]; + base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + + BASE32_ENCODE_CHAR[(v1 << 2) & 31] + + '======'; + } else if (remain === 2) { + v1 = bytes[i++]; + v2 = bytes[i]; + base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + + BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + + BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + + BASE32_ENCODE_CHAR[(v2 << 4) & 31] + + '===='; + } else if (remain === 3) { + v1 = bytes[i++]; + v2 = bytes[i++]; + v3 = bytes[i]; + base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + + BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + + BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + + BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] + + BASE32_ENCODE_CHAR[(v3 << 1) & 31] + + '==='; + } else if (remain === 4) { + v1 = bytes[i++]; + v2 = bytes[i++]; + v3 = bytes[i++]; + v4 = bytes[i]; + base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + + BASE32_ENCODE_CHAR[(v1 << 2 | v2 >>> 6) & 31] + + BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + + BASE32_ENCODE_CHAR[(v2 << 4 | v3 >>> 4) & 31] + + BASE32_ENCODE_CHAR[(v3 << 1 | v4 >>> 7) & 31] + + BASE32_ENCODE_CHAR[(v4 >>> 2) & 31] + + BASE32_ENCODE_CHAR[(v4 << 3) & 31] + + '='; + } + return base32Str; + }; + + var encode = function (input, asciiOnly) { + var notString = typeof(input) !== 'string'; + if (notString && input.constructor === ArrayBuffer) { + input = new Uint8Array(input); + } + if (notString) { + return encodeBytes(input); + } else if (asciiOnly) { + return encodeAscii(input); + } else { + return encodeUtf8(input); + } + }; + + var decode = function (base32Str, asciiOnly) { + if (!asciiOnly) { + return toUtf8String(decodeAsBytes(base32Str)); + } + if (!/^[A-Z2-7=]+$/.test(base32Str)) { + throw new Error('Invalid base32 characters'); + } + var v1, v2, v3, v4, v5, v6, v7, v8, str = '', length = base32Str.indexOf('='); + if (length === -1) { + length = base32Str.length; + } + + // 8 char to 5 bytes + for (var i = 0, count = length >> 3 << 3; i < count;) { + v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v6 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v7 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v8 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + str += String.fromCharCode((v1 << 3 | v2 >>> 2) & 255) + + String.fromCharCode((v2 << 6 | v3 << 1 | v4 >>> 4) & 255) + + String.fromCharCode((v4 << 4 | v5 >>> 1) & 255) + + String.fromCharCode((v5 << 7 | v6 << 2 | v7 >>> 3) & 255) + + String.fromCharCode((v7 << 5 | v8) & 255); + } + + // remain bytes + var remain = length - count; + if (remain === 2) { + v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + str += String.fromCharCode((v1 << 3 | v2 >>> 2) & 255); + } else if (remain === 4) { + v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + str += String.fromCharCode((v1 << 3 | v2 >>> 2) & 255) + + String.fromCharCode((v2 << 6 | v3 << 1 | v4 >>> 4) & 255); + } else if (remain === 5) { + v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + str += String.fromCharCode((v1 << 3 | v2 >>> 2) & 255) + + String.fromCharCode((v2 << 6 | v3 << 1 | v4 >>> 4) & 255) + + String.fromCharCode((v4 << 4 | v5 >>> 1) & 255); + } else if (remain === 7) { + v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v6 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + v7 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; + str += String.fromCharCode((v1 << 3 | v2 >>> 2) & 255) + + String.fromCharCode((v2 << 6 | v3 << 1 | v4 >>> 4) & 255) + + String.fromCharCode((v4 << 4 | v5 >>> 1) & 255) + + String.fromCharCode((v5 << 7 | v6 << 2 | v7 >>> 3) & 255); + } + return str; + }; + + var exports = { + encode: encode, + decode: decode + }; + decode.asBytes = decodeAsBytes; - // add non-empty headers. - if (header.length) { - contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK; + if (COMMON_JS) { + module.exports = exports; + } else { + root.base32 = exports; + if (AMD) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { + return exports; + }).call(exports, __nested_webpack_require_582018__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } } +})(); - return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; -}; - -FormData.prototype._getContentDisposition = function(value, options) { - - var filename - , contentDisposition - ; - - if (typeof options.filepath === 'string') { - // custom filepath for relative paths - filename = path.normalize(options.filepath).replace(/\\/g, '/'); - } else if (options.filename || value.name || value.path) { - // custom filename take precedence - // formidable and the browser add a name property - // fs- and request- streams have path property - filename = path.basename(options.filename || value.name || value.path); - } else if (value.readable && value.hasOwnProperty('httpVersion')) { - // or try http response - filename = path.basename(value.client._httpMessage.path || ''); - } - - if (filename) { - contentDisposition = 'filename="' + filename + '"'; - } - return contentDisposition; -}; +/***/ }), -FormData.prototype._getContentType = function(value, options) { +/***/ "./node_modules/ip-regex/index.js": +/*!****************************************!*\ + !*** ./node_modules/ip-regex/index.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { - // use custom content-type above all - var contentType = options.contentType; +"use strict"; - // or try `name` from formidable, browser - if (!contentType && value.name) { - contentType = mime.lookup(value.name); - } - // or try `path` from fs-, request- streams - if (!contentType && value.path) { - contentType = mime.lookup(value.path); - } +const word = '[a-fA-F\\d:]'; +const b = options => options && options.includeBoundaries ? + `(?:(?<=\\s|^)(?=${word})|(?<=${word})(?=\\s|$))` : + ''; - // or if it's http-reponse - if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) { - contentType = value.headers['content-type']; - } +const v4 = '(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}'; - // or guess it from the filepath or filename - if (!contentType && (options.filepath || options.filename)) { - contentType = mime.lookup(options.filepath || options.filename); - } +const v6seg = '[a-fA-F\\d]{1,4}'; +const v6 = ` +( +(?:${v6seg}:){7}(?:${v6seg}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8 +(?:${v6seg}:){6}(?:${v4}|:${v6seg}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4 +(?:${v6seg}:){5}(?::${v4}|(:${v6seg}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4 +(?:${v6seg}:){4}(?:(:${v6seg}){0,1}:${v4}|(:${v6seg}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4 +(?:${v6seg}:){3}(?:(:${v6seg}){0,2}:${v4}|(:${v6seg}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4 +(?:${v6seg}:){2}(?:(:${v6seg}){0,3}:${v4}|(:${v6seg}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4 +(?:${v6seg}:){1}(?:(:${v6seg}){0,4}:${v4}|(:${v6seg}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4 +(?::((?::${v6seg}){0,5}:${v4}|(?::${v6seg}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4 +)(%[0-9a-zA-Z]{1,})? // %eth0 %1 +`.replace(/\s*\/\/.*$/gm, '').replace(/\n/g, '').trim(); - // fallback to the default content type if `value` is not simple value - if (!contentType && typeof value == 'object') { - contentType = FormData.DEFAULT_CONTENT_TYPE; - } +const ip = options => options && options.exact ? + new RegExp(`(?:^${v4}$)|(?:^${v6}$)`) : + new RegExp(`(?:${b(options)}${v4}${b(options)})|(?:${b(options)}${v6}${b(options)})`, 'g'); - return contentType; -}; +ip.v4 = options => options && options.exact ? new RegExp(`^${v4}$`) : new RegExp(`${b(options)}${v4}${b(options)}`, 'g'); +ip.v6 = options => options && options.exact ? new RegExp(`^${v6}$`) : new RegExp(`${b(options)}${v6}${b(options)}`, 'g'); -FormData.prototype._multiPartFooter = function() { - return function(next) { - var footer = FormData.LINE_BREAK; +module.exports = ip; - var lastPart = (this._streams.length === 0); - if (lastPart) { - footer += this._lastBoundary(); - } - next(footer); - }.bind(this); -}; +/***/ }), -FormData.prototype._lastBoundary = function() { - return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; -}; +/***/ "./node_modules/ip/lib/ip.js": +/*!***********************************!*\ + !*** ./node_modules/ip/lib/ip.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_601229__) { -FormData.prototype.getHeaders = function(userHeaders) { - var header; - var formHeaders = { - 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() - }; +"use strict"; - for (header in userHeaders) { - if (userHeaders.hasOwnProperty(header)) { - formHeaders[header.toLowerCase()] = userHeaders[header]; - } - } - return formHeaders; -}; +var ip = exports; +var Buffer = __nested_webpack_require_601229__(/*! buffer */ "buffer").Buffer; +var os = __nested_webpack_require_601229__(/*! os */ "os"); -FormData.prototype.setBoundary = function(boundary) { - this._boundary = boundary; -}; +ip.toBuffer = function(ip, buff, offset) { + offset = ~~offset; -FormData.prototype.getBoundary = function() { - if (!this._boundary) { - this._generateBoundary(); - } + var result; - return this._boundary; -}; + if (this.isV4Format(ip)) { + result = buff || new Buffer(offset + 4); + ip.split(/\./g).map(function(byte) { + result[offset++] = parseInt(byte, 10) & 0xff; + }); + } else if (this.isV6Format(ip)) { + var sections = ip.split(':', 8); -FormData.prototype.getBuffer = function() { - var dataBuffer = new Buffer.alloc( 0 ); - var boundary = this.getBoundary(); + var i; + for (i = 0; i < sections.length; i++) { + var isv4 = this.isV4Format(sections[i]); + var v4Buffer; - // Create the form content. Add Line breaks to the end of data. - for (var i = 0, len = this._streams.length; i < len; i++) { - if (typeof this._streams[i] !== 'function') { + if (isv4) { + v4Buffer = this.toBuffer(sections[i]); + sections[i] = v4Buffer.slice(0, 2).toString('hex'); + } - // Add content to the buffer. - if(Buffer.isBuffer(this._streams[i])) { - dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]); - }else { - dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]); + if (v4Buffer && ++i < 8) { + sections.splice(i, 0, v4Buffer.slice(2, 4).toString('hex')); } + } - // Add break after content. - if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) { - dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] ); + if (sections[0] === '') { + while (sections.length < 8) sections.unshift('0'); + } else if (sections[sections.length - 1] === '') { + while (sections.length < 8) sections.push('0'); + } else if (sections.length < 8) { + for (i = 0; i < sections.length && sections[i] !== ''; i++); + var argv = [ i, 1 ]; + for (i = 9 - sections.length; i > 0; i--) { + argv.push('0'); } + sections.splice.apply(sections, argv); } - } - // Add the footer and return the Buffer object. - return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] ); -}; + result = buff || new Buffer(offset + 16); + for (i = 0; i < sections.length; i++) { + var word = parseInt(sections[i], 16); + result[offset++] = (word >> 8) & 0xff; + result[offset++] = word & 0xff; + } + } -FormData.prototype._generateBoundary = function() { - // This generates a 50 character boundary similar to those used by Firefox. - // They are optimized for boyer-moore parsing. - var boundary = '--------------------------'; - for (var i = 0; i < 24; i++) { - boundary += Math.floor(Math.random() * 10).toString(16); + if (!result) { + throw Error('Invalid ip address: ' + ip); } - this._boundary = boundary; + return result; }; -// Note: getLengthSync DOESN'T calculate streams length -// As workaround one can calculate file size manually -// and add it as knownLength option -FormData.prototype.getLengthSync = function() { - var knownLength = this._overheadLength + this._valueLength; - - // Don't get confused, there are 3 "internal" streams for each keyval pair - // so it basically checks if there is any value added to the form - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } +ip.toString = function(buff, offset, length) { + offset = ~~offset; + length = length || (buff.length - offset); - // https://github.com/form-data/form-data/issues/40 - if (!this.hasKnownLength()) { - // Some async length retrievers are present - // therefore synchronous length calculation is false. - // Please use getLength(callback) to get proper length - this._error(new Error('Cannot calculate proper length in synchronous way.')); + var result = []; + if (length === 4) { + // IPv4 + for (var i = 0; i < length; i++) { + result.push(buff[offset + i]); + } + result = result.join('.'); + } else if (length === 16) { + // IPv6 + for (var i = 0; i < length; i += 2) { + result.push(buff.readUInt16BE(offset + i).toString(16)); + } + result = result.join(':'); + result = result.replace(/(^|:)0(:0)*:0(:|$)/, '$1::$3'); + result = result.replace(/:{3,4}/, '::'); } - return knownLength; + return result; }; -// Public API to check if length of added values is known -// https://github.com/form-data/form-data/issues/196 -// https://github.com/form-data/form-data/issues/262 -FormData.prototype.hasKnownLength = function() { - var hasKnownLength = true; - - if (this._valuesToMeasure.length) { - hasKnownLength = false; - } +var ipv4Regex = /^(\d{1,3}\.){3,3}\d{1,3}$/; +var ipv6Regex = + /^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i; - return hasKnownLength; +ip.isV4Format = function(ip) { + return ipv4Regex.test(ip); }; -FormData.prototype.getLength = function(cb) { - var knownLength = this._overheadLength + this._valueLength; +ip.isV6Format = function(ip) { + return ipv6Regex.test(ip); +}; +function _normalizeFamily(family) { + return family ? family.toLowerCase() : 'ipv4'; +} - if (this._streams.length) { - knownLength += this._lastBoundary().length; +ip.fromPrefixLen = function(prefixlen, family) { + if (prefixlen > 32) { + family = 'ipv6'; + } else { + family = _normalizeFamily(family); } - if (!this._valuesToMeasure.length) { - process.nextTick(cb.bind(this, null, knownLength)); - return; + var len = 4; + if (family === 'ipv6') { + len = 16; } + var buff = new Buffer(len); - asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { - if (err) { - cb(err); - return; + for (var i = 0, n = buff.length; i < n; ++i) { + var bits = 8; + if (prefixlen < 8) { + bits = prefixlen; } + prefixlen -= bits; - values.forEach(function(length) { - knownLength += length; - }); + buff[i] = ~(0xff >> bits) & 0xff; + } - cb(null, knownLength); - }); + return ip.toString(buff); }; -FormData.prototype.submit = function(params, cb) { - var request - , options - , defaults = {method: 'post'} - ; - - // parse provided url if it's string - // or treat it as options object - if (typeof params == 'string') { - - params = parseUrl(params); - options = populate({ - port: params.port, - path: params.pathname, - host: params.hostname, - protocol: params.protocol - }, defaults); +ip.mask = function(addr, mask) { + addr = ip.toBuffer(addr); + mask = ip.toBuffer(mask); - // use custom params - } else { + var result = new Buffer(Math.max(addr.length, mask.length)); - options = populate(params, defaults); - // if no port provided use default one - if (!options.port) { - options.port = options.protocol == 'https:' ? 443 : 80; + var i = 0; + // Same protocol - do bitwise and + if (addr.length === mask.length) { + for (i = 0; i < addr.length; i++) { + result[i] = addr[i] & mask[i]; } - } - - // put that good code in getHeaders to some use - options.headers = this.getHeaders(params.headers); - - // https if specified, fallback to http in any other case - if (options.protocol == 'https:') { - request = https.request(options); - } else { - request = http.request(options); - } - - // get content length and fire away - this.getLength(function(err, length) { - if (err && err !== 'Unknown stream') { - this._error(err); - return; + } else if (mask.length === 4) { + // IPv6 address and IPv4 mask + // (Mask low bits) + for (i = 0; i < mask.length; i++) { + result[i] = addr[addr.length - 4 + i] & mask[i]; } - - // add content length - if (length) { - request.setHeader('Content-Length', length); + } else { + // IPv6 mask and IPv4 addr + for (var i = 0; i < result.length - 6; i++) { + result[i] = 0; } - this.pipe(request); - if (cb) { - var onResponse; - - var callback = function (error, responce) { - request.removeListener('error', callback); - request.removeListener('response', onResponse); - - return cb.call(this, error, responce); - }; - - onResponse = callback.bind(this, null); - - request.on('error', callback); - request.on('response', onResponse); + // ::ffff:ipv4 + result[10] = 0xff; + result[11] = 0xff; + for (i = 0; i < addr.length; i++) { + result[i + 12] = addr[i] & mask[i + 12]; } - }.bind(this)); - - return request; -}; - -FormData.prototype._error = function(err) { - if (!this.error) { - this.error = err; - this.pause(); - this.emit('error', err); + i = i + 12; } -}; + for (; i < result.length; i++) + result[i] = 0; -FormData.prototype.toString = function () { - return '[object FormData]'; + return ip.toString(result); }; +ip.cidr = function(cidrString) { + var cidrParts = cidrString.split('/'); -/***/ }), - -/***/ 74808: -/***/ ((module) => { - -// populates missing values -module.exports = function(dst, src) { + var addr = cidrParts[0]; + if (cidrParts.length !== 2) + throw new Error('invalid CIDR subnet: ' + addr); - Object.keys(src).forEach(function(prop) - { - dst[prop] = dst[prop] || src[prop]; - }); + var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); - return dst; + return ip.mask(addr, mask); }; +ip.subnet = function(addr, mask) { + var networkAddress = ip.toLong(ip.mask(addr, mask)); -/***/ }), - -/***/ 50481: -======= -/***/ 26805: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - -// If the passed object is an (async) iterable, then get the iterator -// If it's probably an iterator already (i.e. has next function) return it -// else throw -module.exports = function getIterator (obj) { - if (obj) { - if (typeof obj[Symbol.iterator] === 'function') { - return obj[Symbol.iterator]() - } - if (typeof obj[Symbol.asyncIterator] === 'function') { - return obj[Symbol.asyncIterator]() - } - if (typeof obj.next === 'function') { - return obj // probably an iterator - } - } - throw new Error('argument is not an iterator or iterable') -} - - -/***/ }), - -<<<<<<< HEAD -/***/ 35772: -======= -/***/ 9645: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - - - -module.exports = clone - -var getPrototypeOf = Object.getPrototypeOf || function (obj) { - return obj.__proto__ -} - -function clone (obj) { - if (obj === null || typeof obj !== 'object') - return obj - - if (obj instanceof Object) - var copy = { __proto__: getPrototypeOf(obj) } - else - var copy = Object.create(null) - - Object.getOwnPropertyNames(obj).forEach(function (key) { - Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) - }) - - return copy -} - - -/***/ }), - -<<<<<<< HEAD -/***/ 20846: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var fs = __nccwpck_require__(57147) -var polyfills = __nccwpck_require__(82132) -var legacy = __nccwpck_require__(46641) -var clone = __nccwpck_require__(35772) -======= -/***/ 68644: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var fs = __nccwpck_require__(57147) -var polyfills = __nccwpck_require__(98944) -var legacy = __nccwpck_require__(75288) -var clone = __nccwpck_require__(9645) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -var util = __nccwpck_require__(73837) - -/* istanbul ignore next - node 0.x polyfill */ -var gracefulQueue -var previousSymbol - -/* istanbul ignore else - node 0.x polyfill */ -if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { - gracefulQueue = Symbol.for('graceful-fs.queue') - // This is used in testing by future versions - previousSymbol = Symbol.for('graceful-fs.previous') -} else { - gracefulQueue = '___graceful-fs.queue' - previousSymbol = '___graceful-fs.previous' -} - -function noop () {} + // Calculate the mask's length. + var maskBuffer = ip.toBuffer(mask); + var maskLength = 0; -function publishQueue(context, queue) { - Object.defineProperty(context, gracefulQueue, { - get: function() { - return queue + for (var i = 0; i < maskBuffer.length; i++) { + if (maskBuffer[i] === 0xff) { + maskLength += 8; + } else { + var octet = maskBuffer[i] & 0xff; + while (octet) { + octet = (octet << 1) & 0xff; + maskLength++; + } } - }) -} - -var debug = noop -if (util.debuglog) - debug = util.debuglog('gfs4') -else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') - console.error(m) } -// Once time initialization -if (!fs[gracefulQueue]) { - // This queue can be shared by multiple loaded instances - var queue = global[gracefulQueue] || [] - publishQueue(fs, queue) - - // Patch fs.close/closeSync to shared queue version, because we need - // to retry() whenever a close happens *anywhere* in the program. - // This is essential when multiple graceful-fs instances are - // in play at the same time. - fs.close = (function (fs$close) { - function close (fd, cb) { - return fs$close.call(fs, fd, function (err) { - // This function uses the graceful-fs shared queue - if (!err) { - resetQueue() - } - - if (typeof cb === 'function') - cb.apply(this, arguments) - }) - } - - Object.defineProperty(close, previousSymbol, { - value: fs$close - }) - return close - })(fs.close) + var numberOfAddresses = Math.pow(2, 32 - maskLength); - fs.closeSync = (function (fs$closeSync) { - function closeSync (fd) { - // This function uses the graceful-fs shared queue - fs$closeSync.apply(fs, arguments) - resetQueue() + return { + networkAddress: ip.fromLong(networkAddress), + firstAddress: numberOfAddresses <= 2 ? + ip.fromLong(networkAddress) : + ip.fromLong(networkAddress + 1), + lastAddress: numberOfAddresses <= 2 ? + ip.fromLong(networkAddress + numberOfAddresses - 1) : + ip.fromLong(networkAddress + numberOfAddresses - 2), + broadcastAddress: ip.fromLong(networkAddress + numberOfAddresses - 1), + subnetMask: mask, + subnetMaskLength: maskLength, + numHosts: numberOfAddresses <= 2 ? + numberOfAddresses : numberOfAddresses - 2, + length: numberOfAddresses, + contains: function(other) { + return networkAddress === ip.toLong(ip.mask(other, mask)); } + }; +}; - Object.defineProperty(closeSync, previousSymbol, { - value: fs$closeSync - }) - return closeSync - })(fs.closeSync) - - if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug(fs[gracefulQueue]) - __nccwpck_require__(39491).equal(fs[gracefulQueue].length, 0) - }) - } -} - -if (!global[gracefulQueue]) { - publishQueue(global, fs[gracefulQueue]); -} - -module.exports = patch(clone(fs)) -if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { - module.exports = patch(fs) - fs.__patched = true; -} +ip.cidrSubnet = function(cidrString) { + var cidrParts = cidrString.split('/'); -function patch (fs) { - // Everything that references the open() function needs to be in here - polyfills(fs) - fs.gracefulify = patch + var addr = cidrParts[0]; + if (cidrParts.length !== 2) + throw new Error('invalid CIDR subnet: ' + addr); - fs.createReadStream = createReadStream - fs.createWriteStream = createWriteStream - var fs$readFile = fs.readFile - fs.readFile = readFile - function readFile (path, options, cb) { - if (typeof options === 'function') - cb = options, options = null + var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); - return go$readFile(path, options, cb) + return ip.subnet(addr, mask); +}; - function go$readFile (path, options, cb, startTime) { - return fs$readFile(path, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - } - }) - } +ip.not = function(addr) { + var buff = ip.toBuffer(addr); + for (var i = 0; i < buff.length; i++) { + buff[i] = 0xff ^ buff[i]; } + return ip.toString(buff); +}; - var fs$writeFile = fs.writeFile - fs.writeFile = writeFile - function writeFile (path, data, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$writeFile(path, data, options, cb) +ip.or = function(a, b) { + a = ip.toBuffer(a); + b = ip.toBuffer(b); - function go$writeFile (path, data, options, cb, startTime) { - return fs$writeFile(path, data, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - } - }) + // same protocol + if (a.length === b.length) { + for (var i = 0; i < a.length; ++i) { + a[i] |= b[i]; } - } - - var fs$appendFile = fs.appendFile - if (fs$appendFile) - fs.appendFile = appendFile - function appendFile (path, data, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$appendFile(path, data, options, cb) + return ip.toString(a); - function go$appendFile (path, data, options, cb, startTime) { - return fs$appendFile(path, data, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - } - }) + // mixed protocols + } else { + var buff = a; + var other = b; + if (b.length > a.length) { + buff = b; + other = a; } - } - var fs$copyFile = fs.copyFile - if (fs$copyFile) - fs.copyFile = copyFile - function copyFile (src, dest, flags, cb) { - if (typeof flags === 'function') { - cb = flags - flags = 0 + var offset = buff.length - other.length; + for (var i = offset; i < buff.length; ++i) { + buff[i] |= other[i - offset]; } - return go$copyFile(src, dest, flags, cb) - function go$copyFile (src, dest, flags, cb, startTime) { - return fs$copyFile(src, dest, flags, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - } - }) - } + return ip.toString(buff); } +}; - var fs$readdir = fs.readdir - fs.readdir = readdir - var noReaddirOptionVersions = /^v[0-5]\./ - function readdir (path, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - var go$readdir = noReaddirOptionVersions.test(process.version) - ? function go$readdir (path, options, cb, startTime) { - return fs$readdir(path, fs$readdirCallback( - path, options, cb, startTime - )) - } - : function go$readdir (path, options, cb, startTime) { - return fs$readdir(path, options, fs$readdirCallback( - path, options, cb, startTime - )) - } - - return go$readdir(path, options, cb) - - function fs$readdirCallback (path, options, cb, startTime) { - return function (err, files) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([ - go$readdir, - [path, options, cb], - err, - startTime || Date.now(), - Date.now() - ]) - else { - if (files && files.sort) - files.sort() +ip.isEqual = function(a, b) { + a = ip.toBuffer(a); + b = ip.toBuffer(b); - if (typeof cb === 'function') - cb.call(this, err, files) - } - } + // Same protocol + if (a.length === b.length) { + for (var i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; } + return true; } - if (process.version.substr(0, 4) === 'v0.8') { - var legStreams = legacy(fs) - ReadStream = legStreams.ReadStream - WriteStream = legStreams.WriteStream - } - - var fs$ReadStream = fs.ReadStream - if (fs$ReadStream) { - ReadStream.prototype = Object.create(fs$ReadStream.prototype) - ReadStream.prototype.open = ReadStream$open - } - - var fs$WriteStream = fs.WriteStream - if (fs$WriteStream) { - WriteStream.prototype = Object.create(fs$WriteStream.prototype) - WriteStream.prototype.open = WriteStream$open + // Swap + if (b.length === 4) { + var t = b; + b = a; + a = t; } - Object.defineProperty(fs, 'ReadStream', { - get: function () { - return ReadStream - }, - set: function (val) { - ReadStream = val - }, - enumerable: true, - configurable: true - }) - Object.defineProperty(fs, 'WriteStream', { - get: function () { - return WriteStream - }, - set: function (val) { - WriteStream = val - }, - enumerable: true, - configurable: true - }) - - // legacy names - var FileReadStream = ReadStream - Object.defineProperty(fs, 'FileReadStream', { - get: function () { - return FileReadStream - }, - set: function (val) { - FileReadStream = val - }, - enumerable: true, - configurable: true - }) - var FileWriteStream = WriteStream - Object.defineProperty(fs, 'FileWriteStream', { - get: function () { - return FileWriteStream - }, - set: function (val) { - FileWriteStream = val - }, - enumerable: true, - configurable: true - }) - - function ReadStream (path, options) { - if (this instanceof ReadStream) - return fs$ReadStream.apply(this, arguments), this - else - return ReadStream.apply(Object.create(ReadStream.prototype), arguments) + // a - IPv4, b - IPv6 + for (var i = 0; i < 10; i++) { + if (b[i] !== 0) return false; } - function ReadStream$open () { - var that = this - open(that.path, that.flags, that.mode, function (err, fd) { - if (err) { - if (that.autoClose) - that.destroy() - - that.emit('error', err) - } else { - that.fd = fd - that.emit('open', fd) - that.read() - } - }) - } + var word = b.readUInt16BE(10); + if (word !== 0 && word !== 0xffff) return false; - function WriteStream (path, options) { - if (this instanceof WriteStream) - return fs$WriteStream.apply(this, arguments), this - else - return WriteStream.apply(Object.create(WriteStream.prototype), arguments) + for (var i = 0; i < 4; i++) { + if (a[i] !== b[i + 12]) return false; } - function WriteStream$open () { - var that = this - open(that.path, that.flags, that.mode, function (err, fd) { - if (err) { - that.destroy() - that.emit('error', err) - } else { - that.fd = fd - that.emit('open', fd) - } - }) - } + return true; +}; - function createReadStream (path, options) { - return new fs.ReadStream(path, options) - } +ip.isPrivate = function(addr) { + return /^(::f{4}:)?10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i + .test(addr) || + /^(::f{4}:)?192\.168\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || + /^(::f{4}:)?172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})$/i + .test(addr) || + /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || + /^(::f{4}:)?169\.254\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || + /^f[cd][0-9a-f]{2}:/i.test(addr) || + /^fe80:/i.test(addr) || + /^::1$/.test(addr) || + /^::$/.test(addr); +}; - function createWriteStream (path, options) { - return new fs.WriteStream(path, options) - } +ip.isPublic = function(addr) { + return !ip.isPrivate(addr); +}; - var fs$open = fs.open - fs.open = open - function open (path, flags, mode, cb) { - if (typeof mode === 'function') - cb = mode, mode = null +ip.isLoopback = function(addr) { + return /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/ + .test(addr) || + /^fe80::1$/.test(addr) || + /^::1$/.test(addr) || + /^::$/.test(addr); +}; - return go$open(path, flags, mode, cb) +ip.loopback = function(family) { + // + // Default to `ipv4` + // + family = _normalizeFamily(family); - function go$open (path, flags, mode, cb, startTime) { - return fs$open(path, flags, mode, function (err, fd) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - } - }) - } + if (family !== 'ipv4' && family !== 'ipv6') { + throw new Error('family must be ipv4 or ipv6'); } - return fs -} + return family === 'ipv4' ? '127.0.0.1' : 'fe80::1'; +}; -function enqueue (elem) { - debug('ENQUEUE', elem[0].name, elem[1]) - fs[gracefulQueue].push(elem) - retry() -} +// +// ### function address (name, family) +// #### @name {string|'public'|'private'} **Optional** Name or security +// of the network interface. +// #### @family {ipv4|ipv6} **Optional** IP family of the address (defaults +// to ipv4). +// +// Returns the address for the network interface on the current system with +// the specified `name`: +// * String: First `family` address of the interface. +// If not found see `undefined`. +// * 'public': the first public ip address of family. +// * 'private': the first private ip address of family. +// * undefined: First address with `ipv4` or loopback address `127.0.0.1`. +// +ip.address = function(name, family) { + var interfaces = os.networkInterfaces(); + var all; -// keep track of the timeout between retry() calls -var retryTimer + // + // Default to `ipv4` + // + family = _normalizeFamily(family); -// reset the startTime and lastTime to now -// this resets the start of the 60 second overall timeout as well as the -// delay between attempts so that we'll retry these jobs sooner -function resetQueue () { - var now = Date.now() - for (var i = 0; i < fs[gracefulQueue].length; ++i) { - // entries that are only a length of 2 are from an older version, don't - // bother modifying those since they'll be retried anyway. - if (fs[gracefulQueue][i].length > 2) { - fs[gracefulQueue][i][3] = now // startTime - fs[gracefulQueue][i][4] = now // lastTime - } + // + // If a specific network interface has been named, + // return the address. + // + if (name && name !== 'private' && name !== 'public') { + var res = interfaces[name].filter(function(details) { + var itemFamily = details.family.toLowerCase(); + return itemFamily === family; + }); + if (res.length === 0) + return undefined; + return res[0].address; } - // call retry to make sure we're actively processing the queue - retry() -} -function retry () { - // clear the timer and remove it to help prevent unintended concurrency - clearTimeout(retryTimer) - retryTimer = undefined + var all = Object.keys(interfaces).map(function (nic) { + // + // Note: name will only be `public` or `private` + // when this is called. + // + var addresses = interfaces[nic].filter(function (details) { + details.family = details.family.toLowerCase(); + if (details.family !== family || ip.isLoopback(details.address)) { + return false; + } else if (!name) { + return true; + } + + return name === 'public' ? ip.isPrivate(details.address) : + ip.isPublic(details.address); + }); - if (fs[gracefulQueue].length === 0) - return + return addresses.length ? addresses[0].address : undefined; + }).filter(Boolean); - var elem = fs[gracefulQueue].shift() - var fn = elem[0] - var args = elem[1] - // these items may be unset if they were added by an older graceful-fs - var err = elem[2] - var startTime = elem[3] - var lastTime = elem[4] + return !all.length ? ip.loopback(family) : all[0]; +}; - // if we don't have a startTime we have no way of knowing if we've waited - // long enough, so go ahead and retry this item now - if (startTime === undefined) { - debug('RETRY', fn.name, args) - fn.apply(null, args) - } else if (Date.now() - startTime >= 60000) { - // it's been more than 60 seconds total, bail now - debug('TIMEOUT', fn.name, args) - var cb = args.pop() - if (typeof cb === 'function') - cb.call(null, err) - } else { - // the amount of time between the last attempt and right now - var sinceAttempt = Date.now() - lastTime - // the amount of time between when we first tried, and when we last tried - // rounded up to at least 1 - var sinceStart = Math.max(lastTime - startTime, 1) - // backoff. wait longer than the total time we've been retrying, but only - // up to a maximum of 100ms - var desiredDelay = Math.min(sinceStart * 1.2, 100) - // it's been long enough since the last retry, do it again - if (sinceAttempt >= desiredDelay) { - debug('RETRY', fn.name, args) - fn.apply(null, args.concat([startTime])) - } else { - // if we can't do this job yet, push it to the end of the queue - // and let the next iteration check again - fs[gracefulQueue].push(elem) - } - } +ip.toLong = function(ip) { + var ipl = 0; + ip.split('.').forEach(function(octet) { + ipl <<= 8; + ipl += parseInt(octet); + }); + return(ipl >>> 0); +}; - // schedule our next run if one isn't already scheduled - if (retryTimer === undefined) { - retryTimer = setTimeout(retry, 0) - } -} +ip.fromLong = function(ipl) { + return ((ipl >>> 24) + '.' + + (ipl >> 16 & 255) + '.' + + (ipl >> 8 & 255) + '.' + + (ipl & 255) ); +}; /***/ }), -<<<<<<< HEAD -/***/ 46641: -======= -/***/ 75288: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var Stream = (__nccwpck_require__(12781).Stream) +/***/ "./node_modules/is-ip/index.js": +/*!*************************************!*\ + !*** ./node_modules/is-ip/index.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_611820__) { -module.exports = legacy +"use strict"; -function legacy (fs) { - return { - ReadStream: ReadStream, - WriteStream: WriteStream - } +const ipRegex = __nested_webpack_require_611820__(/*! ip-regex */ "./node_modules/ip-regex/index.js"); - function ReadStream (path, options) { - if (!(this instanceof ReadStream)) return new ReadStream(path, options); +const isIp = string => ipRegex({exact: true}).test(string); +isIp.v4 = string => ipRegex.v4({exact: true}).test(string); +isIp.v6 = string => ipRegex.v6({exact: true}).test(string); +isIp.version = string => isIp(string) ? (isIp.v4(string) ? 4 : 6) : undefined; - Stream.call(this); +module.exports = isIp; - var self = this; - this.path = path; - this.fd = null; - this.readable = true; - this.paused = false; +/***/ }), - this.flags = 'r'; - this.mode = 438; /*=0666*/ - this.bufferSize = 64 * 1024; +/***/ "./node_modules/is-ipfs/src/index.js": +/*!*******************************************!*\ + !*** ./node_modules/is-ipfs/src/index.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_612500__) { - options = options || {}; +"use strict"; - // Mixin options into this - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - if (this.encoding) this.setEncoding(this.encoding); +const base58 = __nested_webpack_require_612500__(/*! bs58 */ "./node_modules/bs58/index.js") +const multihash = __nested_webpack_require_612500__(/*! multihashes */ "./node_modules/multihashes/src/index.js") +const multibase = __nested_webpack_require_612500__(/*! multibase */ "./node_modules/multibase/src/index.js") +const Multiaddr = __nested_webpack_require_612500__(/*! multiaddr */ "./node_modules/multiaddr/src/index.js") +const mafmt = __nested_webpack_require_612500__(/*! mafmt */ "./node_modules/mafmt/src/index.js") +const CID = __nested_webpack_require_612500__(/*! cids */ "./node_modules/cids/src/index.js") - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.end === undefined) { - this.end = Infinity; - } else if ('number' !== typeof this.end) { - throw TypeError('end must be a Number'); - } +const urlPattern = /^https?:\/\/[^/]+\/(ip(f|n)s)\/((\w+).*)/ +const pathPattern = /^\/(ip(f|n)s)\/((\w+).*)/ +const defaultProtocolMatch = 1 +const defaultHashMath = 4 - if (this.start > this.end) { - throw new Error('start must be <= end'); - } +const fqdnPattern = /^https?:\/\/([^/]+)\.(ip(?:f|n)s)\.[^/]+/ +const fqdnHashMatch = 1 +const fqdnProtocolMatch = 2 - this.pos = this.start; - } +function isMultihash (hash) { + const formatted = convertToString(hash) + try { + const buffer = Buffer.from(base58.decode(formatted)) + multihash.decode(buffer) + return true + } catch (e) { + return false + } +} - if (this.fd !== null) { - process.nextTick(function() { - self._read(); - }); - return; - } +function isMultibase (hash) { + try { + return multibase.isEncoded(hash) + } catch (e) { + return false + } +} - fs.open(this.path, this.flags, this.mode, function (err, fd) { - if (err) { - self.emit('error', err); - self.readable = false; - return; - } +function isCID (hash) { + try { + new CID(hash) // eslint-disable-line no-new + return true + } catch (e) { + return false + } +} - self.fd = fd; - self.emit('open', fd); - self._read(); - }) +function isMultiaddr (input) { + if (!input) return false + if (Multiaddr.isMultiaddr(input)) return true + try { + new Multiaddr(input) // eslint-disable-line no-new + return true + } catch (e) { + return false } +} - function WriteStream (path, options) { - if (!(this instanceof WriteStream)) return new WriteStream(path, options); +function isPeerMultiaddr (input) { + return isMultiaddr(input) && mafmt.IPFS.matches(input) +} - Stream.call(this); +function isIpfs (input, pattern, protocolMatch = defaultProtocolMatch, hashMatch = defaultHashMath) { + const formatted = convertToString(input) + if (!formatted) { + return false + } - this.path = path; - this.fd = null; - this.writable = true; + const match = formatted.match(pattern) + if (!match) { + return false + } - this.flags = 'w'; - this.encoding = 'binary'; - this.mode = 438; /*=0666*/ - this.bytesWritten = 0; + if (match[protocolMatch] !== 'ipfs') { + return false + } - options = options || {}; + let hash = match[hashMatch] - // Mixin options into this - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } + if (hash && pattern === fqdnPattern) { + // when doing checks for subdomain context + // ensure hash is case-insensitive + // (browsers force-lowercase authority compotent anyway) + hash = hash.toLowerCase() + } - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.start < 0) { - throw new Error('start must be >= zero'); - } + return isCID(hash) +} - this.pos = this.start; - } +function isIpns (input, pattern, protocolMatch = defaultProtocolMatch, hashMatch) { + const formatted = convertToString(input) + if (!formatted) { + return false + } + const match = formatted.match(pattern) + if (!match) { + return false + } - this.busy = false; - this._queue = []; + if (match[protocolMatch] !== 'ipns') { + return false + } - if (this.fd === null) { - this._open = fs.open; - this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); - this.flush(); - } + if (hashMatch && pattern === fqdnPattern) { + let hash = match[hashMatch] + // when doing checks for subdomain context + // ensure hash is case-insensitive + // (browsers force-lowercase authority compotent anyway) + hash = hash.toLowerCase() + return isCID(hash) } -} + return true +} -/***/ }), +function isString (input) { + return typeof input === 'string' +} -<<<<<<< HEAD -/***/ 82132: -======= -/***/ 98944: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +function convertToString (input) { + if (Buffer.isBuffer(input)) { + return base58.encode(input) + } -var constants = __nccwpck_require__(22057) + if (isString(input)) { + return input + } -var origCwd = process.cwd -var cwd = null + return false +} -var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform +const ipfsSubdomain = (url) => isIpfs(url, fqdnPattern, fqdnProtocolMatch, fqdnHashMatch) +const ipnsSubdomain = (url) => isIpns(url, fqdnPattern, fqdnProtocolMatch, fqdnHashMatch) -process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process) - return cwd +module.exports = { + multihash: isMultihash, + multiaddr: isMultiaddr, + peerMultiaddr: isPeerMultiaddr, + cid: isCID, + base32cid: (cid) => (isMultibase(cid) === 'base32' && isCID(cid)), + ipfsSubdomain: ipfsSubdomain, + ipnsSubdomain: ipnsSubdomain, + subdomain: (url) => (ipfsSubdomain(url) || ipnsSubdomain(url)), + subdomainPattern: fqdnPattern, + ipfsUrl: (url) => isIpfs(url, urlPattern), + ipnsUrl: (url) => isIpns(url, urlPattern), + url: (url) => (isIpfs(url, urlPattern) || isIpns(url, urlPattern)), + urlPattern: urlPattern, + ipfsPath: (path) => isIpfs(path, pathPattern), + ipnsPath: (path) => isIpns(path, pathPattern), + path: (path) => (isIpfs(path, pathPattern) || isIpns(path, pathPattern)), + pathPattern: pathPattern, + urlOrPath: (x) => (isIpfs(x, urlPattern) || isIpns(x, urlPattern) || isIpfs(x, pathPattern) || isIpns(x, pathPattern)), + cidPath: path => isString(path) && !isCID(path) && isIpfs(`/ipfs/${path}`, pathPattern) } -try { - process.cwd() -} catch (er) {} -// This check is needed until node.js 12 is required -if (typeof process.chdir === 'function') { - var chdir = process.chdir - process.chdir = function (d) { - cwd = null - chdir.call(process, d) - } - if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) -} -module.exports = patch +/***/ }), -function patch (fs) { - // (re-)implement some things that are known busted or missing. +/***/ "./node_modules/mafmt/src/index.js": +/*!*****************************************!*\ + !*** ./node_modules/mafmt/src/index.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_616998__) { - // lchmod, broken prior to 0.6.2 - // back-port the fix here. - if (constants.hasOwnProperty('O_SYMLINK') && - process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - patchLchmod(fs) - } +"use strict"; - // lutimes implementation, or no-op - if (!fs.lutimes) { - patchLutimes(fs) - } - // https://github.com/isaacs/node-graceful-fs/issues/4 - // Chown should not fail on einval or eperm if non-root. - // It should not fail on enosys ever, as this just indicates - // that a fs doesn't support the intended operation. +const multiaddr = __nested_webpack_require_616998__(/*! multiaddr */ "./node_modules/multiaddr/src/index.js") - fs.chown = chownFix(fs.chown) - fs.fchown = chownFix(fs.fchown) - fs.lchown = chownFix(fs.lchown) +/* + * Valid combinations + */ +const DNS4 = base('dns4') +const DNS6 = base('dns6') +const DNS = or( + base('dns'), + base('dnsaddr'), + DNS4, + DNS6 +) - fs.chmod = chmodFix(fs.chmod) - fs.fchmod = chmodFix(fs.fchmod) - fs.lchmod = chmodFix(fs.lchmod) +const IP = or(base('ip4'), base('ip6')) +const TCP = or( + and(IP, base('tcp')), + and(DNS, base('tcp')) +) +const UDP = and(IP, base('udp')) +const UTP = and(UDP, base('utp')) - fs.chownSync = chownFixSync(fs.chownSync) - fs.fchownSync = chownFixSync(fs.fchownSync) - fs.lchownSync = chownFixSync(fs.lchownSync) +const WebSockets = or( + and(TCP, base('ws')), + and(DNS, base('ws')) +) - fs.chmodSync = chmodFixSync(fs.chmodSync) - fs.fchmodSync = chmodFixSync(fs.fchmodSync) - fs.lchmodSync = chmodFixSync(fs.lchmodSync) +const WebSocketsSecure = or( + and(TCP, base('wss')), + and(DNS, base('wss')) +) - fs.stat = statFix(fs.stat) - fs.fstat = statFix(fs.fstat) - fs.lstat = statFix(fs.lstat) +const HTTP = or( + and(TCP, base('http')), + and(IP, base('http')), + and(DNS, base('http')) +) - fs.statSync = statFixSync(fs.statSync) - fs.fstatSync = statFixSync(fs.fstatSync) - fs.lstatSync = statFixSync(fs.lstatSync) +const HTTPS = or( + and(TCP, base('https')), + and(IP, base('https')), + and(DNS, base('https')) +) - // if lchmod/lchown do not exist, then make them no-ops - if (fs.chmod && !fs.lchmod) { - fs.lchmod = function (path, mode, cb) { - if (cb) process.nextTick(cb) - } - fs.lchmodSync = function () {} - } - if (fs.chown && !fs.lchown) { - fs.lchown = function (path, uid, gid, cb) { - if (cb) process.nextTick(cb) - } - fs.lchownSync = function () {} - } +const WebRTCStar = or( + and(WebSockets, base('p2p-webrtc-star'), base('p2p')), + and(WebSocketsSecure, base('p2p-webrtc-star'), base('p2p')), + and(WebSockets, base('p2p-webrtc-star')), + and(WebSocketsSecure, base('p2p-webrtc-star')) +) - // on Windows, A/V software can lock the directory, causing this - // to fail with an EACCES or EPERM if the directory contains newly - // created files. Try again on failure, for up to 60 seconds. +const WebSocketStar = or( + and(WebSockets, base('p2p-websocket-star'), base('p2p')), + and(WebSocketsSecure, base('p2p-websocket-star'), base('p2p')), + and(WebSockets, base('p2p-websocket-star')), + and(WebSocketsSecure, base('p2p-websocket-star')) +) - // Set the timeout this long because some Windows Anti-Virus, such as Parity - // bit9, may lock files for up to a minute, causing npm package install - // failures. Also, take care to yield the scheduler. Windows scheduling gives - // CPU to a busy looping process, which can cause the program causing the lock - // contention to be starved of CPU by node, so the contention doesn't resolve. - if (platform === "win32") { - fs.rename = typeof fs.rename !== 'function' ? fs.rename - : (function (fs$rename) { - function rename (from, to, cb) { - var start = Date.now() - var backoff = 0; - fs$rename(from, to, function CB (er) { - if (er - && (er.code === "EACCES" || er.code === "EPERM") - && Date.now() - start < 60000) { - setTimeout(function() { - fs.stat(to, function (stater, st) { - if (stater && stater.code === "ENOENT") - fs$rename(from, to, CB); - else - cb(er) - }) - }, backoff) - if (backoff < 100) - backoff += 10; - return; - } - if (cb) cb(er) - }) - } - if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename) - return rename - })(fs.rename) - } +const WebRTCDirect = or( + and(HTTP, base('p2p-webrtc-direct')), + and(HTTPS, base('p2p-webrtc-direct')) +) - // if read() returns EAGAIN, then just try it again. - fs.read = typeof fs.read !== 'function' ? fs.read - : (function (fs$read) { - function read (fd, buffer, offset, length, position, callback_) { - var callback - if (callback_ && typeof callback_ === 'function') { - var eagCounter = 0 - callback = function (er, _, __) { - if (er && er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - return fs$read.call(fs, fd, buffer, offset, length, position, callback) - } - callback_.apply(this, arguments) - } - } - return fs$read.call(fs, fd, buffer, offset, length, position, callback) - } +const Reliable = or( + WebSockets, + WebSocketsSecure, + HTTP, + HTTPS, + WebRTCStar, + WebRTCDirect, + TCP, + UTP +) - // This ensures `util.promisify` works as it does for native `fs.read`. - if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) - return read - })(fs.read) +// Unlike ws-star, stardust can run over any transport thus removing the requirement for websockets (but don't even think about running a stardust server over webrtc-star ;) ) +const Stardust = or( + and(Reliable, base('p2p-stardust'), base('p2p')), + and(Reliable, base('p2p-stardust')) +) - fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync - : (function (fs$readSync) { return function (fd, buffer, offset, length, position) { - var eagCounter = 0 - while (true) { - try { - return fs$readSync.call(fs, fd, buffer, offset, length, position) - } catch (er) { - if (er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - continue - } - throw er - } - } - }})(fs.readSync) +const _P2P = or( + and(Reliable, base('p2p')), + WebRTCStar, + base('p2p') +) - function patchLchmod (fs) { - fs.lchmod = function (path, mode, callback) { - fs.open( path - , constants.O_WRONLY | constants.O_SYMLINK - , mode - , function (err, fd) { - if (err) { - if (callback) callback(err) - return - } - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - fs.fchmod(fd, mode, function (err) { - fs.close(fd, function(err2) { - if (callback) callback(err || err2) - }) - }) - }) - } +const _Circuit = or( + and(_P2P, base('p2p-circuit'), _P2P), + and(_P2P, base('p2p-circuit')), + and(base('p2p-circuit'), _P2P), + and(Reliable, base('p2p-circuit')), + and(base('p2p-circuit'), Reliable), + base('p2p-circuit') +) - fs.lchmodSync = function (path, mode) { - var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) +const CircuitRecursive = () => or( + and(_Circuit, CircuitRecursive), + _Circuit +) - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - var threw = true - var ret +const Circuit = CircuitRecursive() + +const P2P = or( + and(Circuit, _P2P, Circuit), + and(_P2P, Circuit), + and(Circuit, _P2P), + Circuit, + _P2P +) + +exports.DNS = DNS +exports.DNS4 = DNS4 +exports.DNS6 = DNS6 +exports.IP = IP +exports.TCP = TCP +exports.UDP = UDP +exports.UTP = UTP +exports.HTTP = HTTP +exports.HTTPS = HTTPS +exports.WebSockets = WebSockets +exports.WebSocketsSecure = WebSocketsSecure +exports.WebSocketStar = WebSocketStar +exports.WebRTCStar = WebRTCStar +exports.WebRTCDirect = WebRTCDirect +exports.Reliable = Reliable +exports.Stardust = Stardust +exports.Circuit = Circuit +exports.P2P = P2P +exports.IPFS = P2P + +/* + * Validation funcs + */ + +function makeMatchesFunction (partialMatch) { + return function matches (a) { + if (!multiaddr.isMultiaddr(a)) { try { - ret = fs.fchmodSync(fd, mode) - threw = false - } finally { - if (threw) { - try { - fs.closeSync(fd) - } catch (er) {} - } else { - fs.closeSync(fd) - } + a = multiaddr(a) + } catch (err) { // catch error + return false // also if it's invalid it's propably not matching as well so return false } - return ret } + const out = partialMatch(a.protoNames()) + if (out === null) { + return false + } + return out.length === 0 } +} - function patchLutimes (fs) { - if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) { - fs.lutimes = function (path, at, mt, cb) { - fs.open(path, constants.O_SYMLINK, function (er, fd) { - if (er) { - if (cb) cb(er) - return - } - fs.futimes(fd, at, mt, function (er) { - fs.close(fd, function (er2) { - if (cb) cb(er || er2) - }) - }) - }) - } +function and () { + const args = Array.from(arguments) + function partialMatch (a) { + if (a.length < args.length) { + return null + } + args.some((arg) => { + a = typeof arg === 'function' + ? arg().partialMatch(a) + : arg.partialMatch(a) - fs.lutimesSync = function (path, at, mt) { - var fd = fs.openSync(path, constants.O_SYMLINK) - var ret - var threw = true - try { - ret = fs.futimesSync(fd, at, mt) - threw = false - } finally { - if (threw) { - try { - fs.closeSync(fd) - } catch (er) {} - } else { - fs.closeSync(fd) - } - } - return ret + if (a === null) { + return true } + }) - } else if (fs.futimes) { - fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } - fs.lutimesSync = function () {} - } + return a } - function chmodFix (orig) { - if (!orig) return orig - return function (target, mode, cb) { - return orig.call(fs, target, mode, function (er) { - if (chownErOk(er)) er = null - if (cb) cb.apply(this, arguments) - }) - } + return { + toString: function () { return '{ ' + args.join(' ') + ' }' }, + input: args, + matches: makeMatchesFunction(partialMatch), + partialMatch: partialMatch } +} - function chmodFixSync (orig) { - if (!orig) return orig - return function (target, mode) { - try { - return orig.call(fs, target, mode) - } catch (er) { - if (!chownErOk(er)) throw er +function or () { + const args = Array.from(arguments) + + function partialMatch (a) { + let out = null + args.some((arg) => { + const res = typeof arg === 'function' + ? arg().partialMatch(a) + : arg.partialMatch(a) + if (res) { + out = res + return true } - } - } + }) + return out + } - function chownFix (orig) { - if (!orig) return orig - return function (target, uid, gid, cb) { - return orig.call(fs, target, uid, gid, function (er) { - if (chownErOk(er)) er = null - if (cb) cb.apply(this, arguments) - }) - } + const result = { + toString: function () { return '{ ' + args.join(' ') + ' }' }, + input: args, + matches: makeMatchesFunction(partialMatch), + partialMatch: partialMatch } - function chownFixSync (orig) { - if (!orig) return orig - return function (target, uid, gid) { + return result +} + +function base (n) { + const name = n + + function matches (a) { + if (typeof a === 'string') { try { - return orig.call(fs, target, uid, gid) - } catch (er) { - if (!chownErOk(er)) throw er + a = multiaddr(a) + } catch (err) { // catch error + return false // also if it's invalid it's propably not matching as well so return false } } - } - function statFix (orig) { - if (!orig) return orig - // Older versions of Node erroneously returned signed integers for - // uid + gid. - return function (target, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - function callback (er, stats) { - if (stats) { - if (stats.uid < 0) stats.uid += 0x100000000 - if (stats.gid < 0) stats.gid += 0x100000000 - } - if (cb) cb.apply(this, arguments) - } - return options ? orig.call(fs, target, options, callback) - : orig.call(fs, target, callback) + const pnames = a.protoNames() + if (pnames.length === 1 && pnames[0] === name) { + return true } + return false } - function statFixSync (orig) { - if (!orig) return orig - // Older versions of Node erroneously returned signed integers for - // uid + gid. - return function (target, options) { - var stats = options ? orig.call(fs, target, options) - : orig.call(fs, target) - if (stats) { - if (stats.uid < 0) stats.uid += 0x100000000 - if (stats.gid < 0) stats.gid += 0x100000000 - } - return stats; + function partialMatch (protos) { + if (protos.length === 0) { + return null } - } - - // ENOSYS means that the fs doesn't support the op. Just ignore - // that, because it doesn't matter. - // - // if there's no getuid, or if getuid() is something other - // than 0, and the error is EINVAL or EPERM, then just ignore - // it. - // - // This specific case is a silent failure in cp, install, tar, - // and most other unix tools that manage permissions. - // - // When running as root, or if other types of errors are - // encountered, then it's strict. - function chownErOk (er) { - if (!er) - return true - if (er.code === "ENOSYS") - return true - - var nonroot = !process.getuid || process.getuid() !== 0 - if (nonroot) { - if (er.code === "EINVAL" || er.code === "EPERM") - return true + if (protos[0] === name) { + return protos.slice(1) } + return null + } - return false + return { + toString: function () { return name }, + matches: matches, + partialMatch: partialMatch } } /***/ }), -<<<<<<< HEAD -/***/ 55392: -/***/ ((module) => { - -======= -/***/ 35779: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -// @ts-ignore -const SparseArray = __nccwpck_require__(447) -const { fromString: uint8ArrayFromString } = __nccwpck_require__(39451) - -/** - * @typedef {import('./consumable-hash').InfiniteHash} InfiniteHash - * @typedef {import('../').UserBucketOptions} UserBucketOptions - */ +/***/ "./node_modules/mime-db/db.json": +/*!**************************************!*\ + !*** ./node_modules/mime-db/db.json ***! + \**************************************/ +/*! exports provided: application/1d-interleaved-parityfec, application/3gpdash-qoe-report+xml, application/3gpp-ims+xml, application/a2l, application/activemessage, application/activity+json, application/alto-costmap+json, application/alto-costmapfilter+json, application/alto-directory+json, application/alto-endpointcost+json, application/alto-endpointcostparams+json, application/alto-endpointprop+json, application/alto-endpointpropparams+json, application/alto-error+json, application/alto-networkmap+json, application/alto-networkmapfilter+json, application/aml, application/andrew-inset, application/applefile, application/applixware, application/atf, application/atfx, application/atom+xml, application/atomcat+xml, application/atomdeleted+xml, application/atomicmail, application/atomsvc+xml, application/atsc-dwd+xml, application/atsc-held+xml, application/atsc-rdt+json, application/atsc-rsat+xml, application/atxml, application/auth-policy+xml, application/bacnet-xdd+zip, application/batch-smtp, application/bdoc, application/beep+xml, application/calendar+json, application/calendar+xml, application/call-completion, application/cals-1840, application/cbor, application/cbor-seq, application/cccex, application/ccmp+xml, application/ccxml+xml, application/cdfx+xml, application/cdmi-capability, application/cdmi-container, application/cdmi-domain, application/cdmi-object, application/cdmi-queue, application/cdni, application/cea, application/cea-2018+xml, application/cellml+xml, application/cfw, application/clue+xml, application/clue_info+xml, application/cms, application/cnrp+xml, application/coap-group+json, application/coap-payload, application/commonground, application/conference-info+xml, application/cose, application/cose-key, application/cose-key-set, application/cpl+xml, application/csrattrs, application/csta+xml, application/cstadata+xml, application/csvm+json, application/cu-seeme, application/cwt, application/cybercash, application/dart, application/dash+xml, application/dashdelta, application/davmount+xml, application/dca-rft, application/dcd, application/dec-dx, application/dialog-info+xml, application/dicom, application/dicom+json, application/dicom+xml, application/dii, application/dit, application/dns, application/dns+json, application/dns-message, application/docbook+xml, application/dskpp+xml, application/dssc+der, application/dssc+xml, application/dvcs, application/ecmascript, application/edi-consent, application/edi-x12, application/edifact, application/efi, application/emergencycalldata.comment+xml, application/emergencycalldata.control+xml, application/emergencycalldata.deviceinfo+xml, application/emergencycalldata.ecall.msd, application/emergencycalldata.providerinfo+xml, application/emergencycalldata.serviceinfo+xml, application/emergencycalldata.subscriberinfo+xml, application/emergencycalldata.veds+xml, application/emma+xml, application/emotionml+xml, application/encaprtp, application/epp+xml, application/epub+zip, application/eshop, application/exi, application/expect-ct-report+json, application/fastinfoset, application/fastsoap, application/fdt+xml, application/fhir+json, application/fhir+xml, application/fido.trusted-apps+json, application/fits, application/flexfec, application/font-sfnt, application/font-tdpfr, application/font-woff, application/framework-attributes+xml, application/geo+json, application/geo+json-seq, application/geopackage+sqlite3, application/geoxacml+xml, application/gltf-buffer, application/gml+xml, application/gpx+xml, application/gxf, application/gzip, application/h224, application/held+xml, application/hjson, application/http, application/hyperstudio, application/ibe-key-request+xml, application/ibe-pkg-reply+xml, application/ibe-pp-data, application/iges, application/im-iscomposing+xml, application/index, application/index.cmd, application/index.obj, application/index.response, application/index.vnd, application/inkml+xml, application/iotp, application/ipfix, application/ipp, application/isup, application/its+xml, application/java-archive, application/java-serialized-object, application/java-vm, application/javascript, application/jf2feed+json, application/jose, application/jose+json, application/jrd+json, application/json, application/json-patch+json, application/json-seq, application/json5, application/jsonml+json, application/jwk+json, application/jwk-set+json, application/jwt, application/kpml-request+xml, application/kpml-response+xml, application/ld+json, application/lgr+xml, application/link-format, application/load-control+xml, application/lost+xml, application/lostsync+xml, application/lxf, application/mac-binhex40, application/mac-compactpro, application/macwriteii, application/mads+xml, application/manifest+json, application/marc, application/marcxml+xml, application/mathematica, application/mathml+xml, application/mathml-content+xml, application/mathml-presentation+xml, application/mbms-associated-procedure-description+xml, application/mbms-deregister+xml, application/mbms-envelope+xml, application/mbms-msk+xml, application/mbms-msk-response+xml, application/mbms-protection-description+xml, application/mbms-reception-report+xml, application/mbms-register+xml, application/mbms-register-response+xml, application/mbms-schedule+xml, application/mbms-user-service-description+xml, application/mbox, application/media-policy-dataset+xml, application/media_control+xml, application/mediaservercontrol+xml, application/merge-patch+json, application/metalink+xml, application/metalink4+xml, application/mets+xml, application/mf4, application/mikey, application/mipc, application/mmt-aei+xml, application/mmt-usd+xml, application/mods+xml, application/moss-keys, application/moss-signature, application/mosskey-data, application/mosskey-request, application/mp21, application/mp4, application/mpeg4-generic, application/mpeg4-iod, application/mpeg4-iod-xmt, application/mrb-consumer+xml, application/mrb-publish+xml, application/msc-ivr+xml, application/msc-mixer+xml, application/msword, application/mud+json, application/multipart-core, application/mxf, application/n-quads, application/n-triples, application/nasdata, application/news-checkgroups, application/news-groupinfo, application/news-transmission, application/nlsml+xml, application/node, application/nss, application/ocsp-request, application/ocsp-response, application/octet-stream, application/oda, application/odm+xml, application/odx, application/oebps-package+xml, application/ogg, application/omdoc+xml, application/onenote, application/oscore, application/oxps, application/p2p-overlay+xml, application/parityfec, application/passport, application/patch-ops-error+xml, application/pdf, application/pdx, application/pem-certificate-chain, application/pgp-encrypted, application/pgp-keys, application/pgp-signature, application/pics-rules, application/pidf+xml, application/pidf-diff+xml, application/pkcs10, application/pkcs12, application/pkcs7-mime, application/pkcs7-signature, application/pkcs8, application/pkcs8-encrypted, application/pkix-attr-cert, application/pkix-cert, application/pkix-crl, application/pkix-pkipath, application/pkixcmp, application/pls+xml, application/poc-settings+xml, application/postscript, application/ppsp-tracker+json, application/problem+json, application/problem+xml, application/provenance+xml, application/prs.alvestrand.titrax-sheet, application/prs.cww, application/prs.hpub+zip, application/prs.nprend, application/prs.plucker, application/prs.rdf-xml-crypt, application/prs.xsf+xml, application/pskc+xml, application/qsig, application/raml+yaml, application/raptorfec, application/rdap+json, application/rdf+xml, application/reginfo+xml, application/relax-ng-compact-syntax, application/remote-printing, application/reputon+json, application/resource-lists+xml, application/resource-lists-diff+xml, application/rfc+xml, application/riscos, application/rlmi+xml, application/rls-services+xml, application/route-apd+xml, application/route-s-tsid+xml, application/route-usd+xml, application/rpki-ghostbusters, application/rpki-manifest, application/rpki-publication, application/rpki-roa, application/rpki-updown, application/rsd+xml, application/rss+xml, application/rtf, application/rtploopback, application/rtx, application/samlassertion+xml, application/samlmetadata+xml, application/sbml+xml, application/scaip+xml, application/scim+json, application/scvp-cv-request, application/scvp-cv-response, application/scvp-vp-request, application/scvp-vp-response, application/sdp, application/secevent+jwt, application/senml+cbor, application/senml+json, application/senml+xml, application/senml-exi, application/sensml+cbor, application/sensml+json, application/sensml+xml, application/sensml-exi, application/sep+xml, application/sep-exi, application/session-info, application/set-payment, application/set-payment-initiation, application/set-registration, application/set-registration-initiation, application/sgml, application/sgml-open-catalog, application/shf+xml, application/sieve, application/simple-filter+xml, application/simple-message-summary, application/simplesymbolcontainer, application/sipc, application/slate, application/smil, application/smil+xml, application/smpte336m, application/soap+fastinfoset, application/soap+xml, application/sparql-query, application/sparql-results+xml, application/spirits-event+xml, application/sql, application/srgs, application/srgs+xml, application/sru+xml, application/ssdl+xml, application/ssml+xml, application/stix+json, application/swid+xml, application/tamp-apex-update, application/tamp-apex-update-confirm, application/tamp-community-update, application/tamp-community-update-confirm, application/tamp-error, application/tamp-sequence-adjust, application/tamp-sequence-adjust-confirm, application/tamp-status-query, application/tamp-status-response, application/tamp-update, application/tamp-update-confirm, application/tar, application/taxii+json, application/tei+xml, application/tetra_isi, application/thraud+xml, application/timestamp-query, application/timestamp-reply, application/timestamped-data, application/tlsrpt+gzip, application/tlsrpt+json, application/tnauthlist, application/toml, application/trickle-ice-sdpfrag, application/trig, application/ttml+xml, application/tve-trigger, application/tzif, application/tzif-leap, application/ulpfec, application/urc-grpsheet+xml, application/urc-ressheet+xml, application/urc-targetdesc+xml, application/urc-uisocketdesc+xml, application/vcard+json, application/vcard+xml, application/vemmi, application/vividence.scriptfile, application/vnd.1000minds.decision-model+xml, application/vnd.3gpp-prose+xml, application/vnd.3gpp-prose-pc3ch+xml, application/vnd.3gpp-v2x-local-service-information, application/vnd.3gpp.access-transfer-events+xml, application/vnd.3gpp.bsf+xml, application/vnd.3gpp.gmop+xml, application/vnd.3gpp.mc-signalling-ear, application/vnd.3gpp.mcdata-affiliation-command+xml, application/vnd.3gpp.mcdata-info+xml, application/vnd.3gpp.mcdata-payload, application/vnd.3gpp.mcdata-service-config+xml, application/vnd.3gpp.mcdata-signalling, application/vnd.3gpp.mcdata-ue-config+xml, application/vnd.3gpp.mcdata-user-profile+xml, application/vnd.3gpp.mcptt-affiliation-command+xml, application/vnd.3gpp.mcptt-floor-request+xml, application/vnd.3gpp.mcptt-info+xml, application/vnd.3gpp.mcptt-location-info+xml, application/vnd.3gpp.mcptt-mbms-usage-info+xml, application/vnd.3gpp.mcptt-service-config+xml, application/vnd.3gpp.mcptt-signed+xml, application/vnd.3gpp.mcptt-ue-config+xml, application/vnd.3gpp.mcptt-ue-init-config+xml, application/vnd.3gpp.mcptt-user-profile+xml, application/vnd.3gpp.mcvideo-affiliation-command+xml, application/vnd.3gpp.mcvideo-affiliation-info+xml, application/vnd.3gpp.mcvideo-info+xml, application/vnd.3gpp.mcvideo-location-info+xml, application/vnd.3gpp.mcvideo-mbms-usage-info+xml, application/vnd.3gpp.mcvideo-service-config+xml, application/vnd.3gpp.mcvideo-transmission-request+xml, application/vnd.3gpp.mcvideo-ue-config+xml, application/vnd.3gpp.mcvideo-user-profile+xml, application/vnd.3gpp.mid-call+xml, application/vnd.3gpp.pic-bw-large, application/vnd.3gpp.pic-bw-small, application/vnd.3gpp.pic-bw-var, application/vnd.3gpp.sms, application/vnd.3gpp.sms+xml, application/vnd.3gpp.srvcc-ext+xml, application/vnd.3gpp.srvcc-info+xml, application/vnd.3gpp.state-and-event-info+xml, application/vnd.3gpp.ussd+xml, application/vnd.3gpp2.bcmcsinfo+xml, application/vnd.3gpp2.sms, application/vnd.3gpp2.tcap, application/vnd.3lightssoftware.imagescal, application/vnd.3m.post-it-notes, application/vnd.accpac.simply.aso, application/vnd.accpac.simply.imp, application/vnd.acucobol, application/vnd.acucorp, application/vnd.adobe.air-application-installer-package+zip, application/vnd.adobe.flash.movie, application/vnd.adobe.formscentral.fcdt, application/vnd.adobe.fxp, application/vnd.adobe.partial-upload, application/vnd.adobe.xdp+xml, application/vnd.adobe.xfdf, application/vnd.aether.imp, application/vnd.afpc.afplinedata, application/vnd.afpc.afplinedata-pagedef, application/vnd.afpc.foca-charset, application/vnd.afpc.foca-codedfont, application/vnd.afpc.foca-codepage, application/vnd.afpc.modca, application/vnd.afpc.modca-formdef, application/vnd.afpc.modca-mediummap, application/vnd.afpc.modca-objectcontainer, application/vnd.afpc.modca-overlay, application/vnd.afpc.modca-pagesegment, application/vnd.ah-barcode, application/vnd.ahead.space, application/vnd.airzip.filesecure.azf, application/vnd.airzip.filesecure.azs, application/vnd.amadeus+json, application/vnd.amazon.ebook, application/vnd.amazon.mobi8-ebook, application/vnd.americandynamics.acc, application/vnd.amiga.ami, application/vnd.amundsen.maze+xml, application/vnd.android.ota, application/vnd.android.package-archive, application/vnd.anki, application/vnd.anser-web-certificate-issue-initiation, application/vnd.anser-web-funds-transfer-initiation, application/vnd.antix.game-component, application/vnd.apache.thrift.binary, application/vnd.apache.thrift.compact, application/vnd.apache.thrift.json, application/vnd.api+json, application/vnd.aplextor.warrp+json, application/vnd.apothekende.reservation+json, application/vnd.apple.installer+xml, application/vnd.apple.keynote, application/vnd.apple.mpegurl, application/vnd.apple.numbers, application/vnd.apple.pages, application/vnd.apple.pkpass, application/vnd.arastra.swi, application/vnd.aristanetworks.swi, application/vnd.artisan+json, application/vnd.artsquare, application/vnd.astraea-software.iota, application/vnd.audiograph, application/vnd.autopackage, application/vnd.avalon+json, application/vnd.avistar+xml, application/vnd.balsamiq.bmml+xml, application/vnd.balsamiq.bmpr, application/vnd.banana-accounting, application/vnd.bbf.usp.error, application/vnd.bbf.usp.msg, application/vnd.bbf.usp.msg+json, application/vnd.bekitzur-stech+json, application/vnd.bint.med-content, application/vnd.biopax.rdf+xml, application/vnd.blink-idb-value-wrapper, application/vnd.blueice.multipass, application/vnd.bluetooth.ep.oob, application/vnd.bluetooth.le.oob, application/vnd.bmi, application/vnd.bpf, application/vnd.bpf3, application/vnd.businessobjects, application/vnd.byu.uapi+json, application/vnd.cab-jscript, application/vnd.canon-cpdl, application/vnd.canon-lips, application/vnd.capasystems-pg+json, application/vnd.cendio.thinlinc.clientconf, application/vnd.century-systems.tcp_stream, application/vnd.chemdraw+xml, application/vnd.chess-pgn, application/vnd.chipnuts.karaoke-mmd, application/vnd.ciedi, application/vnd.cinderella, application/vnd.cirpack.isdn-ext, application/vnd.citationstyles.style+xml, application/vnd.claymore, application/vnd.cloanto.rp9, application/vnd.clonk.c4group, application/vnd.cluetrust.cartomobile-config, application/vnd.cluetrust.cartomobile-config-pkg, application/vnd.coffeescript, application/vnd.collabio.xodocuments.document, application/vnd.collabio.xodocuments.document-template, application/vnd.collabio.xodocuments.presentation, application/vnd.collabio.xodocuments.presentation-template, application/vnd.collabio.xodocuments.spreadsheet, application/vnd.collabio.xodocuments.spreadsheet-template, application/vnd.collection+json, application/vnd.collection.doc+json, application/vnd.collection.next+json, application/vnd.comicbook+zip, application/vnd.comicbook-rar, application/vnd.commerce-battelle, application/vnd.commonspace, application/vnd.contact.cmsg, application/vnd.coreos.ignition+json, application/vnd.cosmocaller, application/vnd.crick.clicker, application/vnd.crick.clicker.keyboard, application/vnd.crick.clicker.palette, application/vnd.crick.clicker.template, application/vnd.crick.clicker.wordbank, application/vnd.criticaltools.wbs+xml, application/vnd.cryptii.pipe+json, application/vnd.crypto-shade-file, application/vnd.ctc-posml, application/vnd.ctct.ws+xml, application/vnd.cups-pdf, application/vnd.cups-postscript, application/vnd.cups-ppd, application/vnd.cups-raster, application/vnd.cups-raw, application/vnd.curl, application/vnd.curl.car, application/vnd.curl.pcurl, application/vnd.cyan.dean.root+xml, application/vnd.cybank, application/vnd.d2l.coursepackage1p0+zip, application/vnd.dart, application/vnd.data-vision.rdz, application/vnd.datapackage+json, application/vnd.dataresource+json, application/vnd.debian.binary-package, application/vnd.dece.data, application/vnd.dece.ttml+xml, application/vnd.dece.unspecified, application/vnd.dece.zip, application/vnd.denovo.fcselayout-link, application/vnd.desmume.movie, application/vnd.dir-bi.plate-dl-nosuffix, application/vnd.dm.delegation+xml, application/vnd.dna, application/vnd.document+json, application/vnd.dolby.mlp, application/vnd.dolby.mobile.1, application/vnd.dolby.mobile.2, application/vnd.doremir.scorecloud-binary-document, application/vnd.dpgraph, application/vnd.dreamfactory, application/vnd.drive+json, application/vnd.ds-keypoint, application/vnd.dtg.local, application/vnd.dtg.local.flash, application/vnd.dtg.local.html, application/vnd.dvb.ait, application/vnd.dvb.dvbj, application/vnd.dvb.esgcontainer, application/vnd.dvb.ipdcdftnotifaccess, application/vnd.dvb.ipdcesgaccess, application/vnd.dvb.ipdcesgaccess2, application/vnd.dvb.ipdcesgpdd, application/vnd.dvb.ipdcroaming, application/vnd.dvb.iptv.alfec-base, application/vnd.dvb.iptv.alfec-enhancement, application/vnd.dvb.notif-aggregate-root+xml, application/vnd.dvb.notif-container+xml, application/vnd.dvb.notif-generic+xml, application/vnd.dvb.notif-ia-msglist+xml, application/vnd.dvb.notif-ia-registration-request+xml, application/vnd.dvb.notif-ia-registration-response+xml, application/vnd.dvb.notif-init+xml, application/vnd.dvb.pfr, application/vnd.dvb.service, application/vnd.dxr, application/vnd.dynageo, application/vnd.dzr, application/vnd.easykaraoke.cdgdownload, application/vnd.ecdis-update, application/vnd.ecip.rlp, application/vnd.ecowin.chart, application/vnd.ecowin.filerequest, application/vnd.ecowin.fileupdate, application/vnd.ecowin.series, application/vnd.ecowin.seriesrequest, application/vnd.ecowin.seriesupdate, application/vnd.efi.img, application/vnd.efi.iso, application/vnd.emclient.accessrequest+xml, application/vnd.enliven, application/vnd.enphase.envoy, application/vnd.eprints.data+xml, application/vnd.epson.esf, application/vnd.epson.msf, application/vnd.epson.quickanime, application/vnd.epson.salt, application/vnd.epson.ssf, application/vnd.ericsson.quickcall, application/vnd.espass-espass+zip, application/vnd.eszigno3+xml, application/vnd.etsi.aoc+xml, application/vnd.etsi.asic-e+zip, application/vnd.etsi.asic-s+zip, application/vnd.etsi.cug+xml, application/vnd.etsi.iptvcommand+xml, application/vnd.etsi.iptvdiscovery+xml, application/vnd.etsi.iptvprofile+xml, application/vnd.etsi.iptvsad-bc+xml, application/vnd.etsi.iptvsad-cod+xml, application/vnd.etsi.iptvsad-npvr+xml, application/vnd.etsi.iptvservice+xml, application/vnd.etsi.iptvsync+xml, application/vnd.etsi.iptvueprofile+xml, application/vnd.etsi.mcid+xml, application/vnd.etsi.mheg5, application/vnd.etsi.overload-control-policy-dataset+xml, application/vnd.etsi.pstn+xml, application/vnd.etsi.sci+xml, application/vnd.etsi.simservs+xml, application/vnd.etsi.timestamp-token, application/vnd.etsi.tsl+xml, application/vnd.etsi.tsl.der, application/vnd.eudora.data, application/vnd.evolv.ecig.profile, application/vnd.evolv.ecig.settings, application/vnd.evolv.ecig.theme, application/vnd.exstream-empower+zip, application/vnd.exstream-package, application/vnd.ezpix-album, application/vnd.ezpix-package, application/vnd.f-secure.mobile, application/vnd.fastcopy-disk-image, application/vnd.fdf, application/vnd.fdsn.mseed, application/vnd.fdsn.seed, application/vnd.ffsns, application/vnd.ficlab.flb+zip, application/vnd.filmit.zfc, application/vnd.fints, application/vnd.firemonkeys.cloudcell, application/vnd.flographit, application/vnd.fluxtime.clip, application/vnd.font-fontforge-sfd, application/vnd.framemaker, application/vnd.frogans.fnc, application/vnd.frogans.ltf, application/vnd.fsc.weblaunch, application/vnd.fujitsu.oasys, application/vnd.fujitsu.oasys2, application/vnd.fujitsu.oasys3, application/vnd.fujitsu.oasysgp, application/vnd.fujitsu.oasysprs, application/vnd.fujixerox.art-ex, application/vnd.fujixerox.art4, application/vnd.fujixerox.ddd, application/vnd.fujixerox.docuworks, application/vnd.fujixerox.docuworks.binder, application/vnd.fujixerox.docuworks.container, application/vnd.fujixerox.hbpl, application/vnd.fut-misnet, application/vnd.futoin+cbor, application/vnd.futoin+json, application/vnd.fuzzysheet, application/vnd.genomatix.tuxedo, application/vnd.gentics.grd+json, application/vnd.geo+json, application/vnd.geocube+xml, application/vnd.geogebra.file, application/vnd.geogebra.tool, application/vnd.geometry-explorer, application/vnd.geonext, application/vnd.geoplan, application/vnd.geospace, application/vnd.gerber, application/vnd.globalplatform.card-content-mgt, application/vnd.globalplatform.card-content-mgt-response, application/vnd.gmx, application/vnd.google-apps.document, application/vnd.google-apps.presentation, application/vnd.google-apps.spreadsheet, application/vnd.google-earth.kml+xml, application/vnd.google-earth.kmz, application/vnd.gov.sk.e-form+xml, application/vnd.gov.sk.e-form+zip, application/vnd.gov.sk.xmldatacontainer+xml, application/vnd.grafeq, application/vnd.gridmp, application/vnd.groove-account, application/vnd.groove-help, application/vnd.groove-identity-message, application/vnd.groove-injector, application/vnd.groove-tool-message, application/vnd.groove-tool-template, application/vnd.groove-vcard, application/vnd.hal+json, application/vnd.hal+xml, application/vnd.handheld-entertainment+xml, application/vnd.hbci, application/vnd.hc+json, application/vnd.hcl-bireports, application/vnd.hdt, application/vnd.heroku+json, application/vnd.hhe.lesson-player, application/vnd.hp-hpgl, application/vnd.hp-hpid, application/vnd.hp-hps, application/vnd.hp-jlyt, application/vnd.hp-pcl, application/vnd.hp-pclxl, application/vnd.httphone, application/vnd.hydrostatix.sof-data, application/vnd.hyper+json, application/vnd.hyper-item+json, application/vnd.hyperdrive+json, application/vnd.hzn-3d-crossword, application/vnd.ibm.afplinedata, application/vnd.ibm.electronic-media, application/vnd.ibm.minipay, application/vnd.ibm.modcap, application/vnd.ibm.rights-management, application/vnd.ibm.secure-container, application/vnd.iccprofile, application/vnd.ieee.1905, application/vnd.igloader, application/vnd.imagemeter.folder+zip, application/vnd.imagemeter.image+zip, application/vnd.immervision-ivp, application/vnd.immervision-ivu, application/vnd.ims.imsccv1p1, application/vnd.ims.imsccv1p2, application/vnd.ims.imsccv1p3, application/vnd.ims.lis.v2.result+json, application/vnd.ims.lti.v2.toolconsumerprofile+json, application/vnd.ims.lti.v2.toolproxy+json, application/vnd.ims.lti.v2.toolproxy.id+json, application/vnd.ims.lti.v2.toolsettings+json, application/vnd.ims.lti.v2.toolsettings.simple+json, application/vnd.informedcontrol.rms+xml, application/vnd.informix-visionary, application/vnd.infotech.project, application/vnd.infotech.project+xml, application/vnd.innopath.wamp.notification, application/vnd.insors.igm, application/vnd.intercon.formnet, application/vnd.intergeo, application/vnd.intertrust.digibox, application/vnd.intertrust.nncp, application/vnd.intu.qbo, application/vnd.intu.qfx, application/vnd.iptc.g2.catalogitem+xml, application/vnd.iptc.g2.conceptitem+xml, application/vnd.iptc.g2.knowledgeitem+xml, application/vnd.iptc.g2.newsitem+xml, application/vnd.iptc.g2.newsmessage+xml, application/vnd.iptc.g2.packageitem+xml, application/vnd.iptc.g2.planningitem+xml, application/vnd.ipunplugged.rcprofile, application/vnd.irepository.package+xml, application/vnd.is-xpr, application/vnd.isac.fcs, application/vnd.iso11783-10+zip, application/vnd.jam, application/vnd.japannet-directory-service, application/vnd.japannet-jpnstore-wakeup, application/vnd.japannet-payment-wakeup, application/vnd.japannet-registration, application/vnd.japannet-registration-wakeup, application/vnd.japannet-setstore-wakeup, application/vnd.japannet-verification, application/vnd.japannet-verification-wakeup, application/vnd.jcp.javame.midlet-rms, application/vnd.jisp, application/vnd.joost.joda-archive, application/vnd.jsk.isdn-ngn, application/vnd.kahootz, application/vnd.kde.karbon, application/vnd.kde.kchart, application/vnd.kde.kformula, application/vnd.kde.kivio, application/vnd.kde.kontour, application/vnd.kde.kpresenter, application/vnd.kde.kspread, application/vnd.kde.kword, application/vnd.kenameaapp, application/vnd.kidspiration, application/vnd.kinar, application/vnd.koan, application/vnd.kodak-descriptor, application/vnd.las, application/vnd.las.las+json, application/vnd.las.las+xml, application/vnd.laszip, application/vnd.leap+json, application/vnd.liberty-request+xml, application/vnd.llamagraphics.life-balance.desktop, application/vnd.llamagraphics.life-balance.exchange+xml, application/vnd.logipipe.circuit+zip, application/vnd.loom, application/vnd.lotus-1-2-3, application/vnd.lotus-approach, application/vnd.lotus-freelance, application/vnd.lotus-notes, application/vnd.lotus-organizer, application/vnd.lotus-screencam, application/vnd.lotus-wordpro, application/vnd.macports.portpkg, application/vnd.mapbox-vector-tile, application/vnd.marlin.drm.actiontoken+xml, application/vnd.marlin.drm.conftoken+xml, application/vnd.marlin.drm.license+xml, application/vnd.marlin.drm.mdcf, application/vnd.mason+json, application/vnd.maxmind.maxmind-db, application/vnd.mcd, application/vnd.medcalcdata, application/vnd.mediastation.cdkey, application/vnd.meridian-slingshot, application/vnd.mfer, application/vnd.mfmp, application/vnd.micro+json, application/vnd.micrografx.flo, application/vnd.micrografx.igx, application/vnd.microsoft.portable-executable, application/vnd.microsoft.windows.thumbnail-cache, application/vnd.miele+json, application/vnd.mif, application/vnd.minisoft-hp3000-save, application/vnd.mitsubishi.misty-guard.trustweb, application/vnd.mobius.daf, application/vnd.mobius.dis, application/vnd.mobius.mbk, application/vnd.mobius.mqy, application/vnd.mobius.msl, application/vnd.mobius.plc, application/vnd.mobius.txf, application/vnd.mophun.application, application/vnd.mophun.certificate, application/vnd.motorola.flexsuite, application/vnd.motorola.flexsuite.adsi, application/vnd.motorola.flexsuite.fis, application/vnd.motorola.flexsuite.gotap, application/vnd.motorola.flexsuite.kmr, application/vnd.motorola.flexsuite.ttc, application/vnd.motorola.flexsuite.wem, application/vnd.motorola.iprm, application/vnd.mozilla.xul+xml, application/vnd.ms-3mfdocument, application/vnd.ms-artgalry, application/vnd.ms-asf, application/vnd.ms-cab-compressed, application/vnd.ms-color.iccprofile, application/vnd.ms-excel, application/vnd.ms-excel.addin.macroenabled.12, application/vnd.ms-excel.sheet.binary.macroenabled.12, application/vnd.ms-excel.sheet.macroenabled.12, application/vnd.ms-excel.template.macroenabled.12, application/vnd.ms-fontobject, application/vnd.ms-htmlhelp, application/vnd.ms-ims, application/vnd.ms-lrm, application/vnd.ms-office.activex+xml, application/vnd.ms-officetheme, application/vnd.ms-opentype, application/vnd.ms-outlook, application/vnd.ms-package.obfuscated-opentype, application/vnd.ms-pki.seccat, application/vnd.ms-pki.stl, application/vnd.ms-playready.initiator+xml, application/vnd.ms-powerpoint, application/vnd.ms-powerpoint.addin.macroenabled.12, application/vnd.ms-powerpoint.presentation.macroenabled.12, application/vnd.ms-powerpoint.slide.macroenabled.12, application/vnd.ms-powerpoint.slideshow.macroenabled.12, application/vnd.ms-powerpoint.template.macroenabled.12, application/vnd.ms-printdevicecapabilities+xml, application/vnd.ms-printing.printticket+xml, application/vnd.ms-printschematicket+xml, application/vnd.ms-project, application/vnd.ms-tnef, application/vnd.ms-windows.devicepairing, application/vnd.ms-windows.nwprinting.oob, application/vnd.ms-windows.printerpairing, application/vnd.ms-windows.wsd.oob, application/vnd.ms-wmdrm.lic-chlg-req, application/vnd.ms-wmdrm.lic-resp, application/vnd.ms-wmdrm.meter-chlg-req, application/vnd.ms-wmdrm.meter-resp, application/vnd.ms-word.document.macroenabled.12, application/vnd.ms-word.template.macroenabled.12, application/vnd.ms-works, application/vnd.ms-wpl, application/vnd.ms-xpsdocument, application/vnd.msa-disk-image, application/vnd.mseq, application/vnd.msign, application/vnd.multiad.creator, application/vnd.multiad.creator.cif, application/vnd.music-niff, application/vnd.musician, application/vnd.muvee.style, application/vnd.mynfc, application/vnd.ncd.control, application/vnd.ncd.reference, application/vnd.nearst.inv+json, application/vnd.nervana, application/vnd.netfpx, application/vnd.neurolanguage.nlu, application/vnd.nimn, application/vnd.nintendo.nitro.rom, application/vnd.nintendo.snes.rom, application/vnd.nitf, application/vnd.noblenet-directory, application/vnd.noblenet-sealer, application/vnd.noblenet-web, application/vnd.nokia.catalogs, application/vnd.nokia.conml+wbxml, application/vnd.nokia.conml+xml, application/vnd.nokia.iptv.config+xml, application/vnd.nokia.isds-radio-presets, application/vnd.nokia.landmark+wbxml, application/vnd.nokia.landmark+xml, application/vnd.nokia.landmarkcollection+xml, application/vnd.nokia.n-gage.ac+xml, application/vnd.nokia.n-gage.data, application/vnd.nokia.n-gage.symbian.install, application/vnd.nokia.ncd, application/vnd.nokia.pcd+wbxml, application/vnd.nokia.pcd+xml, application/vnd.nokia.radio-preset, application/vnd.nokia.radio-presets, application/vnd.novadigm.edm, application/vnd.novadigm.edx, application/vnd.novadigm.ext, application/vnd.ntt-local.content-share, application/vnd.ntt-local.file-transfer, application/vnd.ntt-local.ogw_remote-access, application/vnd.ntt-local.sip-ta_remote, application/vnd.ntt-local.sip-ta_tcp_stream, application/vnd.oasis.opendocument.chart, application/vnd.oasis.opendocument.chart-template, application/vnd.oasis.opendocument.database, application/vnd.oasis.opendocument.formula, application/vnd.oasis.opendocument.formula-template, application/vnd.oasis.opendocument.graphics, application/vnd.oasis.opendocument.graphics-template, application/vnd.oasis.opendocument.image, application/vnd.oasis.opendocument.image-template, application/vnd.oasis.opendocument.presentation, application/vnd.oasis.opendocument.presentation-template, application/vnd.oasis.opendocument.spreadsheet, application/vnd.oasis.opendocument.spreadsheet-template, application/vnd.oasis.opendocument.text, application/vnd.oasis.opendocument.text-master, application/vnd.oasis.opendocument.text-template, application/vnd.oasis.opendocument.text-web, application/vnd.obn, application/vnd.ocf+cbor, application/vnd.oftn.l10n+json, application/vnd.oipf.contentaccessdownload+xml, application/vnd.oipf.contentaccessstreaming+xml, application/vnd.oipf.cspg-hexbinary, application/vnd.oipf.dae.svg+xml, application/vnd.oipf.dae.xhtml+xml, application/vnd.oipf.mippvcontrolmessage+xml, application/vnd.oipf.pae.gem, application/vnd.oipf.spdiscovery+xml, application/vnd.oipf.spdlist+xml, application/vnd.oipf.ueprofile+xml, application/vnd.oipf.userprofile+xml, application/vnd.olpc-sugar, application/vnd.oma-scws-config, application/vnd.oma-scws-http-request, application/vnd.oma-scws-http-response, application/vnd.oma.bcast.associated-procedure-parameter+xml, application/vnd.oma.bcast.drm-trigger+xml, application/vnd.oma.bcast.imd+xml, application/vnd.oma.bcast.ltkm, application/vnd.oma.bcast.notification+xml, application/vnd.oma.bcast.provisioningtrigger, application/vnd.oma.bcast.sgboot, application/vnd.oma.bcast.sgdd+xml, application/vnd.oma.bcast.sgdu, application/vnd.oma.bcast.simple-symbol-container, application/vnd.oma.bcast.smartcard-trigger+xml, application/vnd.oma.bcast.sprov+xml, application/vnd.oma.bcast.stkm, application/vnd.oma.cab-address-book+xml, application/vnd.oma.cab-feature-handler+xml, application/vnd.oma.cab-pcc+xml, application/vnd.oma.cab-subs-invite+xml, application/vnd.oma.cab-user-prefs+xml, application/vnd.oma.dcd, application/vnd.oma.dcdc, application/vnd.oma.dd2+xml, application/vnd.oma.drm.risd+xml, application/vnd.oma.group-usage-list+xml, application/vnd.oma.lwm2m+json, application/vnd.oma.lwm2m+tlv, application/vnd.oma.pal+xml, application/vnd.oma.poc.detailed-progress-report+xml, application/vnd.oma.poc.final-report+xml, application/vnd.oma.poc.groups+xml, application/vnd.oma.poc.invocation-descriptor+xml, application/vnd.oma.poc.optimized-progress-report+xml, application/vnd.oma.push, application/vnd.oma.scidm.messages+xml, application/vnd.oma.xcap-directory+xml, application/vnd.omads-email+xml, application/vnd.omads-file+xml, application/vnd.omads-folder+xml, application/vnd.omaloc-supl-init, application/vnd.onepager, application/vnd.onepagertamp, application/vnd.onepagertamx, application/vnd.onepagertat, application/vnd.onepagertatp, application/vnd.onepagertatx, application/vnd.openblox.game+xml, application/vnd.openblox.game-binary, application/vnd.openeye.oeb, application/vnd.openofficeorg.extension, application/vnd.openstreetmap.data+xml, application/vnd.openxmlformats-officedocument.custom-properties+xml, application/vnd.openxmlformats-officedocument.customxmlproperties+xml, application/vnd.openxmlformats-officedocument.drawing+xml, application/vnd.openxmlformats-officedocument.drawingml.chart+xml, application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml, application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml, application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml, application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml, application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml, application/vnd.openxmlformats-officedocument.extended-properties+xml, application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml, application/vnd.openxmlformats-officedocument.presentationml.comments+xml, application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml, application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml, application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml, application/vnd.openxmlformats-officedocument.presentationml.presprops+xml, application/vnd.openxmlformats-officedocument.presentationml.slide, application/vnd.openxmlformats-officedocument.presentationml.slide+xml, application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml, application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml, application/vnd.openxmlformats-officedocument.presentationml.slideshow, application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml, application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml, application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml, application/vnd.openxmlformats-officedocument.presentationml.tags+xml, application/vnd.openxmlformats-officedocument.presentationml.template, application/vnd.openxmlformats-officedocument.presentationml.template.main+xml, application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.template, application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml, application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml, application/vnd.openxmlformats-officedocument.theme+xml, application/vnd.openxmlformats-officedocument.themeoverride+xml, application/vnd.openxmlformats-officedocument.vmldrawing, application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.template, application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml, application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml, application/vnd.openxmlformats-package.core-properties+xml, application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml, application/vnd.openxmlformats-package.relationships+xml, application/vnd.oracle.resource+json, application/vnd.orange.indata, application/vnd.osa.netdeploy, application/vnd.osgeo.mapguide.package, application/vnd.osgi.bundle, application/vnd.osgi.dp, application/vnd.osgi.subsystem, application/vnd.otps.ct-kip+xml, application/vnd.oxli.countgraph, application/vnd.pagerduty+json, application/vnd.palm, application/vnd.panoply, application/vnd.paos.xml, application/vnd.patentdive, application/vnd.patientecommsdoc, application/vnd.pawaafile, application/vnd.pcos, application/vnd.pg.format, application/vnd.pg.osasli, application/vnd.piaccess.application-licence, application/vnd.picsel, application/vnd.pmi.widget, application/vnd.poc.group-advertisement+xml, application/vnd.pocketlearn, application/vnd.powerbuilder6, application/vnd.powerbuilder6-s, application/vnd.powerbuilder7, application/vnd.powerbuilder7-s, application/vnd.powerbuilder75, application/vnd.powerbuilder75-s, application/vnd.preminet, application/vnd.previewsystems.box, application/vnd.proteus.magazine, application/vnd.psfs, application/vnd.publishare-delta-tree, application/vnd.pvi.ptid1, application/vnd.pwg-multiplexed, application/vnd.pwg-xhtml-print+xml, application/vnd.qualcomm.brew-app-res, application/vnd.quarantainenet, application/vnd.quark.quarkxpress, application/vnd.quobject-quoxdocument, application/vnd.radisys.moml+xml, application/vnd.radisys.msml+xml, application/vnd.radisys.msml-audit+xml, application/vnd.radisys.msml-audit-conf+xml, application/vnd.radisys.msml-audit-conn+xml, application/vnd.radisys.msml-audit-dialog+xml, application/vnd.radisys.msml-audit-stream+xml, application/vnd.radisys.msml-conf+xml, application/vnd.radisys.msml-dialog+xml, application/vnd.radisys.msml-dialog-base+xml, application/vnd.radisys.msml-dialog-fax-detect+xml, application/vnd.radisys.msml-dialog-fax-sendrecv+xml, application/vnd.radisys.msml-dialog-group+xml, application/vnd.radisys.msml-dialog-speech+xml, application/vnd.radisys.msml-dialog-transform+xml, application/vnd.rainstor.data, application/vnd.rapid, application/vnd.rar, application/vnd.realvnc.bed, application/vnd.recordare.musicxml, application/vnd.recordare.musicxml+xml, application/vnd.renlearn.rlprint, application/vnd.restful+json, application/vnd.rig.cryptonote, application/vnd.rim.cod, application/vnd.rn-realmedia, application/vnd.rn-realmedia-vbr, application/vnd.route66.link66+xml, application/vnd.rs-274x, application/vnd.ruckus.download, application/vnd.s3sms, application/vnd.sailingtracker.track, application/vnd.sbm.cid, application/vnd.sbm.mid2, application/vnd.scribus, application/vnd.sealed.3df, application/vnd.sealed.csf, application/vnd.sealed.doc, application/vnd.sealed.eml, application/vnd.sealed.mht, application/vnd.sealed.net, application/vnd.sealed.ppt, application/vnd.sealed.tiff, application/vnd.sealed.xls, application/vnd.sealedmedia.softseal.html, application/vnd.sealedmedia.softseal.pdf, application/vnd.seemail, application/vnd.sema, application/vnd.semd, application/vnd.semf, application/vnd.shade-save-file, application/vnd.shana.informed.formdata, application/vnd.shana.informed.formtemplate, application/vnd.shana.informed.interchange, application/vnd.shana.informed.package, application/vnd.shootproof+json, application/vnd.shopkick+json, application/vnd.sigrok.session, application/vnd.simtech-mindmapper, application/vnd.siren+json, application/vnd.smaf, application/vnd.smart.notebook, application/vnd.smart.teacher, application/vnd.software602.filler.form+xml, application/vnd.software602.filler.form-xml-zip, application/vnd.solent.sdkm+xml, application/vnd.spotfire.dxp, application/vnd.spotfire.sfs, application/vnd.sqlite3, application/vnd.sss-cod, application/vnd.sss-dtf, application/vnd.sss-ntf, application/vnd.stardivision.calc, application/vnd.stardivision.draw, application/vnd.stardivision.impress, application/vnd.stardivision.math, application/vnd.stardivision.writer, application/vnd.stardivision.writer-global, application/vnd.stepmania.package, application/vnd.stepmania.stepchart, application/vnd.street-stream, application/vnd.sun.wadl+xml, application/vnd.sun.xml.calc, application/vnd.sun.xml.calc.template, application/vnd.sun.xml.draw, application/vnd.sun.xml.draw.template, application/vnd.sun.xml.impress, application/vnd.sun.xml.impress.template, application/vnd.sun.xml.math, application/vnd.sun.xml.writer, application/vnd.sun.xml.writer.global, application/vnd.sun.xml.writer.template, application/vnd.sus-calendar, application/vnd.svd, application/vnd.swiftview-ics, application/vnd.symbian.install, application/vnd.syncml+xml, application/vnd.syncml.dm+wbxml, application/vnd.syncml.dm+xml, application/vnd.syncml.dm.notification, application/vnd.syncml.dmddf+wbxml, application/vnd.syncml.dmddf+xml, application/vnd.syncml.dmtnds+wbxml, application/vnd.syncml.dmtnds+xml, application/vnd.syncml.ds.notification, application/vnd.tableschema+json, application/vnd.tao.intent-module-archive, application/vnd.tcpdump.pcap, application/vnd.think-cell.ppttc+json, application/vnd.tmd.mediaflex.api+xml, application/vnd.tml, application/vnd.tmobile-livetv, application/vnd.tri.onesource, application/vnd.trid.tpt, application/vnd.triscape.mxs, application/vnd.trueapp, application/vnd.truedoc, application/vnd.ubisoft.webplayer, application/vnd.ufdl, application/vnd.uiq.theme, application/vnd.umajin, application/vnd.unity, application/vnd.uoml+xml, application/vnd.uplanet.alert, application/vnd.uplanet.alert-wbxml, application/vnd.uplanet.bearer-choice, application/vnd.uplanet.bearer-choice-wbxml, application/vnd.uplanet.cacheop, application/vnd.uplanet.cacheop-wbxml, application/vnd.uplanet.channel, application/vnd.uplanet.channel-wbxml, application/vnd.uplanet.list, application/vnd.uplanet.list-wbxml, application/vnd.uplanet.listcmd, application/vnd.uplanet.listcmd-wbxml, application/vnd.uplanet.signal, application/vnd.uri-map, application/vnd.valve.source.material, application/vnd.vcx, application/vnd.vd-study, application/vnd.vectorworks, application/vnd.vel+json, application/vnd.verimatrix.vcas, application/vnd.veryant.thin, application/vnd.ves.encrypted, application/vnd.vidsoft.vidconference, application/vnd.visio, application/vnd.visionary, application/vnd.vividence.scriptfile, application/vnd.vsf, application/vnd.wap.sic, application/vnd.wap.slc, application/vnd.wap.wbxml, application/vnd.wap.wmlc, application/vnd.wap.wmlscriptc, application/vnd.webturbo, application/vnd.wfa.p2p, application/vnd.wfa.wsc, application/vnd.windows.devicepairing, application/vnd.wmc, application/vnd.wmf.bootstrap, application/vnd.wolfram.mathematica, application/vnd.wolfram.mathematica.package, application/vnd.wolfram.player, application/vnd.wordperfect, application/vnd.wqd, application/vnd.wrq-hp3000-labelled, application/vnd.wt.stf, application/vnd.wv.csp+wbxml, application/vnd.wv.csp+xml, application/vnd.wv.ssp+xml, application/vnd.xacml+json, application/vnd.xara, application/vnd.xfdl, application/vnd.xfdl.webform, application/vnd.xmi+xml, application/vnd.xmpie.cpkg, application/vnd.xmpie.dpkg, application/vnd.xmpie.plan, application/vnd.xmpie.ppkg, application/vnd.xmpie.xlim, application/vnd.yamaha.hv-dic, application/vnd.yamaha.hv-script, application/vnd.yamaha.hv-voice, application/vnd.yamaha.openscoreformat, application/vnd.yamaha.openscoreformat.osfpvg+xml, application/vnd.yamaha.remote-setup, application/vnd.yamaha.smaf-audio, application/vnd.yamaha.smaf-phrase, application/vnd.yamaha.through-ngn, application/vnd.yamaha.tunnel-udpencap, application/vnd.yaoweme, application/vnd.yellowriver-custom-menu, application/vnd.youtube.yt, application/vnd.zul, application/vnd.zzazz.deck+xml, application/voicexml+xml, application/voucher-cms+json, application/vq-rtcpxr, application/wasm, application/watcherinfo+xml, application/webpush-options+json, application/whoispp-query, application/whoispp-response, application/widget, application/winhlp, application/wita, application/wordperfect5.1, application/wsdl+xml, application/wspolicy+xml, application/x-7z-compressed, application/x-abiword, application/x-ace-compressed, application/x-amf, application/x-apple-diskimage, application/x-arj, application/x-authorware-bin, application/x-authorware-map, application/x-authorware-seg, application/x-bcpio, application/x-bdoc, application/x-bittorrent, application/x-blorb, application/x-bzip, application/x-bzip2, application/x-cbr, application/x-cdlink, application/x-cfs-compressed, application/x-chat, application/x-chess-pgn, application/x-chrome-extension, application/x-cocoa, application/x-compress, application/x-conference, application/x-cpio, application/x-csh, application/x-deb, application/x-debian-package, application/x-dgc-compressed, application/x-director, application/x-doom, application/x-dtbncx+xml, application/x-dtbook+xml, application/x-dtbresource+xml, application/x-dvi, application/x-envoy, application/x-eva, application/x-font-bdf, application/x-font-dos, application/x-font-framemaker, application/x-font-ghostscript, application/x-font-libgrx, application/x-font-linux-psf, application/x-font-pcf, application/x-font-snf, application/x-font-speedo, application/x-font-sunos-news, application/x-font-type1, application/x-font-vfont, application/x-freearc, application/x-futuresplash, application/x-gca-compressed, application/x-glulx, application/x-gnumeric, application/x-gramps-xml, application/x-gtar, application/x-gzip, application/x-hdf, application/x-httpd-php, application/x-install-instructions, application/x-iso9660-image, application/x-java-archive-diff, application/x-java-jnlp-file, application/x-javascript, application/x-keepass2, application/x-latex, application/x-lua-bytecode, application/x-lzh-compressed, application/x-makeself, application/x-mie, application/x-mobipocket-ebook, application/x-mpegurl, application/x-ms-application, application/x-ms-shortcut, application/x-ms-wmd, application/x-ms-wmz, application/x-ms-xbap, application/x-msaccess, application/x-msbinder, application/x-mscardfile, application/x-msclip, application/x-msdos-program, application/x-msdownload, application/x-msmediaview, application/x-msmetafile, application/x-msmoney, application/x-mspublisher, application/x-msschedule, application/x-msterminal, application/x-mswrite, application/x-netcdf, application/x-ns-proxy-autoconfig, application/x-nzb, application/x-perl, application/x-pilot, application/x-pkcs12, application/x-pkcs7-certificates, application/x-pkcs7-certreqresp, application/x-rar-compressed, application/x-redhat-package-manager, application/x-research-info-systems, application/x-sea, application/x-sh, application/x-shar, application/x-shockwave-flash, application/x-silverlight-app, application/x-sql, application/x-stuffit, application/x-stuffitx, application/x-subrip, application/x-sv4cpio, application/x-sv4crc, application/x-t3vm-image, application/x-tads, application/x-tar, application/x-tcl, application/x-tex, application/x-tex-tfm, application/x-texinfo, application/x-tgif, application/x-ustar, application/x-virtualbox-hdd, application/x-virtualbox-ova, application/x-virtualbox-ovf, application/x-virtualbox-vbox, application/x-virtualbox-vbox-extpack, application/x-virtualbox-vdi, application/x-virtualbox-vhd, application/x-virtualbox-vmdk, application/x-wais-source, application/x-web-app-manifest+json, application/x-www-form-urlencoded, application/x-x509-ca-cert, application/x-xfig, application/x-xliff+xml, application/x-xpinstall, application/x-xz, application/x-zmachine, application/x400-bp, application/xacml+xml, application/xaml+xml, application/xcap-att+xml, application/xcap-caps+xml, application/xcap-diff+xml, application/xcap-el+xml, application/xcap-error+xml, application/xcap-ns+xml, application/xcon-conference-info+xml, application/xcon-conference-info-diff+xml, application/xenc+xml, application/xhtml+xml, application/xhtml-voice+xml, application/xliff+xml, application/xml, application/xml-dtd, application/xml-external-parsed-entity, application/xml-patch+xml, application/xmpp+xml, application/xop+xml, application/xproc+xml, application/xslt+xml, application/xspf+xml, application/xv+xml, application/yang, application/yang-data+json, application/yang-data+xml, application/yang-patch+json, application/yang-patch+xml, application/yin+xml, application/zip, application/zlib, application/zstd, audio/1d-interleaved-parityfec, audio/32kadpcm, audio/3gpp, audio/3gpp2, audio/aac, audio/ac3, audio/adpcm, audio/amr, audio/amr-wb, audio/amr-wb+, audio/aptx, audio/asc, audio/atrac-advanced-lossless, audio/atrac-x, audio/atrac3, audio/basic, audio/bv16, audio/bv32, audio/clearmode, audio/cn, audio/dat12, audio/dls, audio/dsr-es201108, audio/dsr-es202050, audio/dsr-es202211, audio/dsr-es202212, audio/dv, audio/dvi4, audio/eac3, audio/encaprtp, audio/evrc, audio/evrc-qcp, audio/evrc0, audio/evrc1, audio/evrcb, audio/evrcb0, audio/evrcb1, audio/evrcnw, audio/evrcnw0, audio/evrcnw1, audio/evrcwb, audio/evrcwb0, audio/evrcwb1, audio/evs, audio/flexfec, audio/fwdred, audio/g711-0, audio/g719, audio/g722, audio/g7221, audio/g723, audio/g726-16, audio/g726-24, audio/g726-32, audio/g726-40, audio/g728, audio/g729, audio/g7291, audio/g729d, audio/g729e, audio/gsm, audio/gsm-efr, audio/gsm-hr-08, audio/ilbc, audio/ip-mr_v2.5, audio/isac, audio/l16, audio/l20, audio/l24, audio/l8, audio/lpc, audio/melp, audio/melp1200, audio/melp2400, audio/melp600, audio/midi, audio/mobile-xmf, audio/mp3, audio/mp4, audio/mp4a-latm, audio/mpa, audio/mpa-robust, audio/mpeg, audio/mpeg4-generic, audio/musepack, audio/ogg, audio/opus, audio/parityfec, audio/pcma, audio/pcma-wb, audio/pcmu, audio/pcmu-wb, audio/prs.sid, audio/qcelp, audio/raptorfec, audio/red, audio/rtp-enc-aescm128, audio/rtp-midi, audio/rtploopback, audio/rtx, audio/s3m, audio/silk, audio/smv, audio/smv-qcp, audio/smv0, audio/sp-midi, audio/speex, audio/t140c, audio/t38, audio/telephone-event, audio/tetra_acelp, audio/tone, audio/uemclip, audio/ulpfec, audio/usac, audio/vdvi, audio/vmr-wb, audio/vnd.3gpp.iufp, audio/vnd.4sb, audio/vnd.audiokoz, audio/vnd.celp, audio/vnd.cisco.nse, audio/vnd.cmles.radio-events, audio/vnd.cns.anp1, audio/vnd.cns.inf1, audio/vnd.dece.audio, audio/vnd.digital-winds, audio/vnd.dlna.adts, audio/vnd.dolby.heaac.1, audio/vnd.dolby.heaac.2, audio/vnd.dolby.mlp, audio/vnd.dolby.mps, audio/vnd.dolby.pl2, audio/vnd.dolby.pl2x, audio/vnd.dolby.pl2z, audio/vnd.dolby.pulse.1, audio/vnd.dra, audio/vnd.dts, audio/vnd.dts.hd, audio/vnd.dts.uhd, audio/vnd.dvb.file, audio/vnd.everad.plj, audio/vnd.hns.audio, audio/vnd.lucent.voice, audio/vnd.ms-playready.media.pya, audio/vnd.nokia.mobile-xmf, audio/vnd.nortel.vbk, audio/vnd.nuera.ecelp4800, audio/vnd.nuera.ecelp7470, audio/vnd.nuera.ecelp9600, audio/vnd.octel.sbc, audio/vnd.presonus.multitrack, audio/vnd.qcelp, audio/vnd.rhetorex.32kadpcm, audio/vnd.rip, audio/vnd.rn-realaudio, audio/vnd.sealedmedia.softseal.mpeg, audio/vnd.vmx.cvsd, audio/vnd.wave, audio/vorbis, audio/vorbis-config, audio/wav, audio/wave, audio/webm, audio/x-aac, audio/x-aiff, audio/x-caf, audio/x-flac, audio/x-m4a, audio/x-matroska, audio/x-mpegurl, audio/x-ms-wax, audio/x-ms-wma, audio/x-pn-realaudio, audio/x-pn-realaudio-plugin, audio/x-realaudio, audio/x-tta, audio/x-wav, audio/xm, chemical/x-cdx, chemical/x-cif, chemical/x-cmdf, chemical/x-cml, chemical/x-csml, chemical/x-pdb, chemical/x-xyz, font/collection, font/otf, font/sfnt, font/ttf, font/woff, font/woff2, image/aces, image/apng, image/avci, image/avcs, image/bmp, image/cgm, image/dicom-rle, image/emf, image/fits, image/g3fax, image/gif, image/heic, image/heic-sequence, image/heif, image/heif-sequence, image/hej2k, image/hsj2, image/ief, image/jls, image/jp2, image/jpeg, image/jph, image/jphc, image/jpm, image/jpx, image/jxr, image/jxra, image/jxrs, image/jxs, image/jxsc, image/jxsi, image/jxss, image/ktx, image/naplps, image/pjpeg, image/png, image/prs.btif, image/prs.pti, image/pwg-raster, image/sgi, image/svg+xml, image/t38, image/tiff, image/tiff-fx, image/vnd.adobe.photoshop, image/vnd.airzip.accelerator.azv, image/vnd.cns.inf2, image/vnd.dece.graphic, image/vnd.djvu, image/vnd.dvb.subtitle, image/vnd.dwg, image/vnd.dxf, image/vnd.fastbidsheet, image/vnd.fpx, image/vnd.fst, image/vnd.fujixerox.edmics-mmr, image/vnd.fujixerox.edmics-rlc, image/vnd.globalgraphics.pgb, image/vnd.microsoft.icon, image/vnd.mix, image/vnd.mozilla.apng, image/vnd.ms-dds, image/vnd.ms-modi, image/vnd.ms-photo, image/vnd.net-fpx, image/vnd.radiance, image/vnd.sealed.png, image/vnd.sealedmedia.softseal.gif, image/vnd.sealedmedia.softseal.jpg, image/vnd.svf, image/vnd.tencent.tap, image/vnd.valve.source.texture, image/vnd.wap.wbmp, image/vnd.xiff, image/vnd.zbrush.pcx, image/webp, image/wmf, image/x-3ds, image/x-cmu-raster, image/x-cmx, image/x-freehand, image/x-icon, image/x-jng, image/x-mrsid-image, image/x-ms-bmp, image/x-pcx, image/x-pict, image/x-portable-anymap, image/x-portable-bitmap, image/x-portable-graymap, image/x-portable-pixmap, image/x-rgb, image/x-tga, image/x-xbitmap, image/x-xcf, image/x-xpixmap, image/x-xwindowdump, message/cpim, message/delivery-status, message/disposition-notification, message/external-body, message/feedback-report, message/global, message/global-delivery-status, message/global-disposition-notification, message/global-headers, message/http, message/imdn+xml, message/news, message/partial, message/rfc822, message/s-http, message/sip, message/sipfrag, message/tracking-status, message/vnd.si.simp, message/vnd.wfa.wsc, model/3mf, model/gltf+json, model/gltf-binary, model/iges, model/mesh, model/stl, model/vnd.collada+xml, model/vnd.dwf, model/vnd.flatland.3dml, model/vnd.gdl, model/vnd.gs-gdl, model/vnd.gs.gdl, model/vnd.gtw, model/vnd.moml+xml, model/vnd.mts, model/vnd.opengex, model/vnd.parasolid.transmit.binary, model/vnd.parasolid.transmit.text, model/vnd.rosette.annotated-data-model, model/vnd.usdz+zip, model/vnd.valve.source.compiled-map, model/vnd.vtu, model/vrml, model/x3d+binary, model/x3d+fastinfoset, model/x3d+vrml, model/x3d+xml, model/x3d-vrml, multipart/alternative, multipart/appledouble, multipart/byteranges, multipart/digest, multipart/encrypted, multipart/form-data, multipart/header-set, multipart/mixed, multipart/multilingual, multipart/parallel, multipart/related, multipart/report, multipart/signed, multipart/vnd.bint.med-plus, multipart/voice-message, multipart/x-mixed-replace, text/1d-interleaved-parityfec, text/cache-manifest, text/calendar, text/calender, text/cmd, text/coffeescript, text/css, text/csv, text/csv-schema, text/directory, text/dns, text/ecmascript, text/encaprtp, text/enriched, text/flexfec, text/fwdred, text/grammar-ref-list, text/html, text/jade, text/javascript, text/jcr-cnd, text/jsx, text/less, text/markdown, text/mathml, text/mdx, text/mizar, text/n3, text/parameters, text/parityfec, text/plain, text/provenance-notation, text/prs.fallenstein.rst, text/prs.lines.tag, text/prs.prop.logic, text/raptorfec, text/red, text/rfc822-headers, text/richtext, text/rtf, text/rtp-enc-aescm128, text/rtploopback, text/rtx, text/sgml, text/shex, text/slim, text/strings, text/stylus, text/t140, text/tab-separated-values, text/troff, text/turtle, text/ulpfec, text/uri-list, text/vcard, text/vnd.a, text/vnd.abc, text/vnd.ascii-art, text/vnd.curl, text/vnd.curl.dcurl, text/vnd.curl.mcurl, text/vnd.curl.scurl, text/vnd.debian.copyright, text/vnd.dmclientscript, text/vnd.dvb.subtitle, text/vnd.esmertec.theme-descriptor, text/vnd.ficlab.flt, text/vnd.fly, text/vnd.fmi.flexstor, text/vnd.gml, text/vnd.graphviz, text/vnd.hgl, text/vnd.in3d.3dml, text/vnd.in3d.spot, text/vnd.iptc.newsml, text/vnd.iptc.nitf, text/vnd.latex-z, text/vnd.motorola.reflex, text/vnd.ms-mediapackage, text/vnd.net2phone.commcenter.command, text/vnd.radisys.msml-basic-layout, text/vnd.senx.warpscript, text/vnd.si.uricatalogue, text/vnd.sosi, text/vnd.sun.j2me.app-descriptor, text/vnd.trolltech.linguist, text/vnd.wap.si, text/vnd.wap.sl, text/vnd.wap.wml, text/vnd.wap.wmlscript, text/vtt, text/x-asm, text/x-c, text/x-component, text/x-fortran, text/x-gwt-rpc, text/x-handlebars-template, text/x-java-source, text/x-jquery-tmpl, text/x-lua, text/x-markdown, text/x-nfo, text/x-opml, text/x-org, text/x-pascal, text/x-processing, text/x-sass, text/x-scss, text/x-setext, text/x-sfv, text/x-suse-ymp, text/x-uuencode, text/x-vcalendar, text/x-vcard, text/xml, text/xml-external-parsed-entity, text/yaml, video/1d-interleaved-parityfec, video/3gpp, video/3gpp-tt, video/3gpp2, video/bmpeg, video/bt656, video/celb, video/dv, video/encaprtp, video/flexfec, video/h261, video/h263, video/h263-1998, video/h263-2000, video/h264, video/h264-rcdo, video/h264-svc, video/h265, video/iso.segment, video/jpeg, video/jpeg2000, video/jpm, video/mj2, video/mp1s, video/mp2p, video/mp2t, video/mp4, video/mp4v-es, video/mpeg, video/mpeg4-generic, video/mpv, video/nv, video/ogg, video/parityfec, video/pointer, video/quicktime, video/raptorfec, video/raw, video/rtp-enc-aescm128, video/rtploopback, video/rtx, video/smpte291, video/smpte292m, video/ulpfec, video/vc1, video/vc2, video/vnd.cctv, video/vnd.dece.hd, video/vnd.dece.mobile, video/vnd.dece.mp4, video/vnd.dece.pd, video/vnd.dece.sd, video/vnd.dece.video, video/vnd.directv.mpeg, video/vnd.directv.mpeg-tts, video/vnd.dlna.mpeg-tts, video/vnd.dvb.file, video/vnd.fvt, video/vnd.hns.video, video/vnd.iptvforum.1dparityfec-1010, video/vnd.iptvforum.1dparityfec-2005, video/vnd.iptvforum.2dparityfec-1010, video/vnd.iptvforum.2dparityfec-2005, video/vnd.iptvforum.ttsavc, video/vnd.iptvforum.ttsmpeg2, video/vnd.motorola.video, video/vnd.motorola.videop, video/vnd.mpegurl, video/vnd.ms-playready.media.pyv, video/vnd.nokia.interleaved-multimedia, video/vnd.nokia.mp4vr, video/vnd.nokia.videovoip, video/vnd.objectvideo, video/vnd.radgamettools.bink, video/vnd.radgamettools.smacker, video/vnd.sealed.mpeg1, video/vnd.sealed.mpeg4, video/vnd.sealed.swf, video/vnd.sealedmedia.softseal.mov, video/vnd.uvvu.mp4, video/vnd.vivo, video/vnd.youtube.yt, video/vp8, video/webm, video/x-f4v, video/x-fli, video/x-flv, video/x-m4v, video/x-matroska, video/x-mng, video/x-ms-asf, video/x-ms-vob, video/x-ms-wm, video/x-ms-wmv, video/x-ms-wmx, video/x-ms-wvx, video/x-msvideo, video/x-sgi-movie, video/x-smv, x-conference/x-cooltalk, x-shader/x-fragment, x-shader/x-vertex, default */ +/***/ (function(module) { -/** - * @template V - * @typedef {object} BucketChild - * @property {string} key - * @property {V} value - * @property {InfiniteHash} hash - */ +module.exports = JSON.parse("{\"application/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"application/3gpdash-qoe-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/3gpp-ims+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/a2l\":{\"source\":\"iana\"},\"application/activemessage\":{\"source\":\"iana\"},\"application/activity+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-costmap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-costmapfilter+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-directory+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointcost+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointcostparams+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointprop+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-endpointpropparams+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-error+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-networkmap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/alto-networkmapfilter+json\":{\"source\":\"iana\",\"compressible\":true},\"application/aml\":{\"source\":\"iana\"},\"application/andrew-inset\":{\"source\":\"iana\",\"extensions\":[\"ez\"]},\"application/applefile\":{\"source\":\"iana\"},\"application/applixware\":{\"source\":\"apache\",\"extensions\":[\"aw\"]},\"application/atf\":{\"source\":\"iana\"},\"application/atfx\":{\"source\":\"iana\"},\"application/atom+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atom\"]},\"application/atomcat+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atomcat\"]},\"application/atomdeleted+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atomdeleted\"]},\"application/atomicmail\":{\"source\":\"iana\"},\"application/atomsvc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"atomsvc\"]},\"application/atsc-dwd+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dwd\"]},\"application/atsc-held+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"held\"]},\"application/atsc-rdt+json\":{\"source\":\"iana\",\"compressible\":true},\"application/atsc-rsat+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rsat\"]},\"application/atxml\":{\"source\":\"iana\"},\"application/auth-policy+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/bacnet-xdd+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/batch-smtp\":{\"source\":\"iana\"},\"application/bdoc\":{\"compressible\":false,\"extensions\":[\"bdoc\"]},\"application/beep+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/calendar+json\":{\"source\":\"iana\",\"compressible\":true},\"application/calendar+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xcs\"]},\"application/call-completion\":{\"source\":\"iana\"},\"application/cals-1840\":{\"source\":\"iana\"},\"application/cbor\":{\"source\":\"iana\"},\"application/cbor-seq\":{\"source\":\"iana\"},\"application/cccex\":{\"source\":\"iana\"},\"application/ccmp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ccxml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ccxml\"]},\"application/cdfx+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"cdfx\"]},\"application/cdmi-capability\":{\"source\":\"iana\",\"extensions\":[\"cdmia\"]},\"application/cdmi-container\":{\"source\":\"iana\",\"extensions\":[\"cdmic\"]},\"application/cdmi-domain\":{\"source\":\"iana\",\"extensions\":[\"cdmid\"]},\"application/cdmi-object\":{\"source\":\"iana\",\"extensions\":[\"cdmio\"]},\"application/cdmi-queue\":{\"source\":\"iana\",\"extensions\":[\"cdmiq\"]},\"application/cdni\":{\"source\":\"iana\"},\"application/cea\":{\"source\":\"iana\"},\"application/cea-2018+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cellml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cfw\":{\"source\":\"iana\"},\"application/clue+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/clue_info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cms\":{\"source\":\"iana\"},\"application/cnrp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/coap-group+json\":{\"source\":\"iana\",\"compressible\":true},\"application/coap-payload\":{\"source\":\"iana\"},\"application/commonground\":{\"source\":\"iana\"},\"application/conference-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cose\":{\"source\":\"iana\"},\"application/cose-key\":{\"source\":\"iana\"},\"application/cose-key-set\":{\"source\":\"iana\"},\"application/cpl+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/csrattrs\":{\"source\":\"iana\"},\"application/csta+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/cstadata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/csvm+json\":{\"source\":\"iana\",\"compressible\":true},\"application/cu-seeme\":{\"source\":\"apache\",\"extensions\":[\"cu\"]},\"application/cwt\":{\"source\":\"iana\"},\"application/cybercash\":{\"source\":\"iana\"},\"application/dart\":{\"compressible\":true},\"application/dash+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mpd\"]},\"application/dashdelta\":{\"source\":\"iana\"},\"application/davmount+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"davmount\"]},\"application/dca-rft\":{\"source\":\"iana\"},\"application/dcd\":{\"source\":\"iana\"},\"application/dec-dx\":{\"source\":\"iana\"},\"application/dialog-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/dicom\":{\"source\":\"iana\"},\"application/dicom+json\":{\"source\":\"iana\",\"compressible\":true},\"application/dicom+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/dii\":{\"source\":\"iana\"},\"application/dit\":{\"source\":\"iana\"},\"application/dns\":{\"source\":\"iana\"},\"application/dns+json\":{\"source\":\"iana\",\"compressible\":true},\"application/dns-message\":{\"source\":\"iana\"},\"application/docbook+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"dbk\"]},\"application/dskpp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/dssc+der\":{\"source\":\"iana\",\"extensions\":[\"dssc\"]},\"application/dssc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdssc\"]},\"application/dvcs\":{\"source\":\"iana\"},\"application/ecmascript\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ecma\",\"es\"]},\"application/edi-consent\":{\"source\":\"iana\"},\"application/edi-x12\":{\"source\":\"iana\",\"compressible\":false},\"application/edifact\":{\"source\":\"iana\",\"compressible\":false},\"application/efi\":{\"source\":\"iana\"},\"application/emergencycalldata.comment+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.control+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.deviceinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.ecall.msd\":{\"source\":\"iana\"},\"application/emergencycalldata.providerinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.serviceinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.subscriberinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emergencycalldata.veds+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/emma+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"emma\"]},\"application/emotionml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"emotionml\"]},\"application/encaprtp\":{\"source\":\"iana\"},\"application/epp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/epub+zip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"epub\"]},\"application/eshop\":{\"source\":\"iana\"},\"application/exi\":{\"source\":\"iana\",\"extensions\":[\"exi\"]},\"application/expect-ct-report+json\":{\"source\":\"iana\",\"compressible\":true},\"application/fastinfoset\":{\"source\":\"iana\"},\"application/fastsoap\":{\"source\":\"iana\"},\"application/fdt+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"fdt\"]},\"application/fhir+json\":{\"source\":\"iana\",\"compressible\":true},\"application/fhir+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/fido.trusted-apps+json\":{\"compressible\":true},\"application/fits\":{\"source\":\"iana\"},\"application/flexfec\":{\"source\":\"iana\"},\"application/font-sfnt\":{\"source\":\"iana\"},\"application/font-tdpfr\":{\"source\":\"iana\",\"extensions\":[\"pfr\"]},\"application/font-woff\":{\"source\":\"iana\",\"compressible\":false},\"application/framework-attributes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/geo+json\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"geojson\"]},\"application/geo+json-seq\":{\"source\":\"iana\"},\"application/geopackage+sqlite3\":{\"source\":\"iana\"},\"application/geoxacml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/gltf-buffer\":{\"source\":\"iana\"},\"application/gml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"gml\"]},\"application/gpx+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"gpx\"]},\"application/gxf\":{\"source\":\"apache\",\"extensions\":[\"gxf\"]},\"application/gzip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"gz\"]},\"application/h224\":{\"source\":\"iana\"},\"application/held+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/hjson\":{\"extensions\":[\"hjson\"]},\"application/http\":{\"source\":\"iana\"},\"application/hyperstudio\":{\"source\":\"iana\",\"extensions\":[\"stk\"]},\"application/ibe-key-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ibe-pkg-reply+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ibe-pp-data\":{\"source\":\"iana\"},\"application/iges\":{\"source\":\"iana\"},\"application/im-iscomposing+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/index\":{\"source\":\"iana\"},\"application/index.cmd\":{\"source\":\"iana\"},\"application/index.obj\":{\"source\":\"iana\"},\"application/index.response\":{\"source\":\"iana\"},\"application/index.vnd\":{\"source\":\"iana\"},\"application/inkml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ink\",\"inkml\"]},\"application/iotp\":{\"source\":\"iana\"},\"application/ipfix\":{\"source\":\"iana\",\"extensions\":[\"ipfix\"]},\"application/ipp\":{\"source\":\"iana\"},\"application/isup\":{\"source\":\"iana\"},\"application/its+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"its\"]},\"application/java-archive\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"jar\",\"war\",\"ear\"]},\"application/java-serialized-object\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"ser\"]},\"application/java-vm\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"class\"]},\"application/javascript\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"js\",\"mjs\"]},\"application/jf2feed+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jose\":{\"source\":\"iana\"},\"application/jose+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jrd+json\":{\"source\":\"iana\",\"compressible\":true},\"application/json\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"json\",\"map\"]},\"application/json-patch+json\":{\"source\":\"iana\",\"compressible\":true},\"application/json-seq\":{\"source\":\"iana\"},\"application/json5\":{\"extensions\":[\"json5\"]},\"application/jsonml+json\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"jsonml\"]},\"application/jwk+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jwk-set+json\":{\"source\":\"iana\",\"compressible\":true},\"application/jwt\":{\"source\":\"iana\"},\"application/kpml-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/kpml-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/ld+json\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"jsonld\"]},\"application/lgr+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lgr\"]},\"application/link-format\":{\"source\":\"iana\"},\"application/load-control+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/lost+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lostxml\"]},\"application/lostsync+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/lxf\":{\"source\":\"iana\"},\"application/mac-binhex40\":{\"source\":\"iana\",\"extensions\":[\"hqx\"]},\"application/mac-compactpro\":{\"source\":\"apache\",\"extensions\":[\"cpt\"]},\"application/macwriteii\":{\"source\":\"iana\"},\"application/mads+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mads\"]},\"application/manifest+json\":{\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"webmanifest\"]},\"application/marc\":{\"source\":\"iana\",\"extensions\":[\"mrc\"]},\"application/marcxml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mrcx\"]},\"application/mathematica\":{\"source\":\"iana\",\"extensions\":[\"ma\",\"nb\",\"mb\"]},\"application/mathml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mathml\"]},\"application/mathml-content+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mathml-presentation+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-associated-procedure-description+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-deregister+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-envelope+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-msk+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-msk-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-protection-description+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-reception-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-register+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-register-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-schedule+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbms-user-service-description+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mbox\":{\"source\":\"iana\",\"extensions\":[\"mbox\"]},\"application/media-policy-dataset+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/media_control+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/mediaservercontrol+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mscml\"]},\"application/merge-patch+json\":{\"source\":\"iana\",\"compressible\":true},\"application/metalink+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"metalink\"]},\"application/metalink4+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"meta4\"]},\"application/mets+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mets\"]},\"application/mf4\":{\"source\":\"iana\"},\"application/mikey\":{\"source\":\"iana\"},\"application/mipc\":{\"source\":\"iana\"},\"application/mmt-aei+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"maei\"]},\"application/mmt-usd+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"musd\"]},\"application/mods+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mods\"]},\"application/moss-keys\":{\"source\":\"iana\"},\"application/moss-signature\":{\"source\":\"iana\"},\"application/mosskey-data\":{\"source\":\"iana\"},\"application/mosskey-request\":{\"source\":\"iana\"},\"application/mp21\":{\"source\":\"iana\",\"extensions\":[\"m21\",\"mp21\"]},\"application/mp4\":{\"source\":\"iana\",\"extensions\":[\"mp4s\",\"m4p\"]},\"application/mpeg4-generic\":{\"source\":\"iana\"},\"application/mpeg4-iod\":{\"source\":\"iana\"},\"application/mpeg4-iod-xmt\":{\"source\":\"iana\"},\"application/mrb-consumer+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdf\"]},\"application/mrb-publish+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdf\"]},\"application/msc-ivr+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/msc-mixer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/msword\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"doc\",\"dot\"]},\"application/mud+json\":{\"source\":\"iana\",\"compressible\":true},\"application/multipart-core\":{\"source\":\"iana\"},\"application/mxf\":{\"source\":\"iana\",\"extensions\":[\"mxf\"]},\"application/n-quads\":{\"source\":\"iana\",\"extensions\":[\"nq\"]},\"application/n-triples\":{\"source\":\"iana\",\"extensions\":[\"nt\"]},\"application/nasdata\":{\"source\":\"iana\"},\"application/news-checkgroups\":{\"source\":\"iana\"},\"application/news-groupinfo\":{\"source\":\"iana\"},\"application/news-transmission\":{\"source\":\"iana\"},\"application/nlsml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/node\":{\"source\":\"iana\"},\"application/nss\":{\"source\":\"iana\"},\"application/ocsp-request\":{\"source\":\"iana\"},\"application/ocsp-response\":{\"source\":\"iana\"},\"application/octet-stream\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"bin\",\"dms\",\"lrf\",\"mar\",\"so\",\"dist\",\"distz\",\"pkg\",\"bpk\",\"dump\",\"elc\",\"deploy\",\"exe\",\"dll\",\"deb\",\"dmg\",\"iso\",\"img\",\"msi\",\"msp\",\"msm\",\"buffer\"]},\"application/oda\":{\"source\":\"iana\",\"extensions\":[\"oda\"]},\"application/odm+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/odx\":{\"source\":\"iana\"},\"application/oebps-package+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"opf\"]},\"application/ogg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ogx\"]},\"application/omdoc+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"omdoc\"]},\"application/onenote\":{\"source\":\"apache\",\"extensions\":[\"onetoc\",\"onetoc2\",\"onetmp\",\"onepkg\"]},\"application/oscore\":{\"source\":\"iana\"},\"application/oxps\":{\"source\":\"iana\",\"extensions\":[\"oxps\"]},\"application/p2p-overlay+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"relo\"]},\"application/parityfec\":{\"source\":\"iana\"},\"application/passport\":{\"source\":\"iana\"},\"application/patch-ops-error+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xer\"]},\"application/pdf\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"pdf\"]},\"application/pdx\":{\"source\":\"iana\"},\"application/pem-certificate-chain\":{\"source\":\"iana\"},\"application/pgp-encrypted\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"pgp\"]},\"application/pgp-keys\":{\"source\":\"iana\"},\"application/pgp-signature\":{\"source\":\"iana\",\"extensions\":[\"asc\",\"sig\"]},\"application/pics-rules\":{\"source\":\"apache\",\"extensions\":[\"prf\"]},\"application/pidf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/pidf-diff+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/pkcs10\":{\"source\":\"iana\",\"extensions\":[\"p10\"]},\"application/pkcs12\":{\"source\":\"iana\"},\"application/pkcs7-mime\":{\"source\":\"iana\",\"extensions\":[\"p7m\",\"p7c\"]},\"application/pkcs7-signature\":{\"source\":\"iana\",\"extensions\":[\"p7s\"]},\"application/pkcs8\":{\"source\":\"iana\",\"extensions\":[\"p8\"]},\"application/pkcs8-encrypted\":{\"source\":\"iana\"},\"application/pkix-attr-cert\":{\"source\":\"iana\",\"extensions\":[\"ac\"]},\"application/pkix-cert\":{\"source\":\"iana\",\"extensions\":[\"cer\"]},\"application/pkix-crl\":{\"source\":\"iana\",\"extensions\":[\"crl\"]},\"application/pkix-pkipath\":{\"source\":\"iana\",\"extensions\":[\"pkipath\"]},\"application/pkixcmp\":{\"source\":\"iana\",\"extensions\":[\"pki\"]},\"application/pls+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"pls\"]},\"application/poc-settings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/postscript\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ai\",\"eps\",\"ps\"]},\"application/ppsp-tracker+json\":{\"source\":\"iana\",\"compressible\":true},\"application/problem+json\":{\"source\":\"iana\",\"compressible\":true},\"application/problem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/provenance+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"provx\"]},\"application/prs.alvestrand.titrax-sheet\":{\"source\":\"iana\"},\"application/prs.cww\":{\"source\":\"iana\",\"extensions\":[\"cww\"]},\"application/prs.hpub+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/prs.nprend\":{\"source\":\"iana\"},\"application/prs.plucker\":{\"source\":\"iana\"},\"application/prs.rdf-xml-crypt\":{\"source\":\"iana\"},\"application/prs.xsf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/pskc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"pskcxml\"]},\"application/qsig\":{\"source\":\"iana\"},\"application/raml+yaml\":{\"compressible\":true,\"extensions\":[\"raml\"]},\"application/raptorfec\":{\"source\":\"iana\"},\"application/rdap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/rdf+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rdf\",\"owl\"]},\"application/reginfo+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rif\"]},\"application/relax-ng-compact-syntax\":{\"source\":\"iana\",\"extensions\":[\"rnc\"]},\"application/remote-printing\":{\"source\":\"iana\"},\"application/reputon+json\":{\"source\":\"iana\",\"compressible\":true},\"application/resource-lists+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rl\"]},\"application/resource-lists-diff+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rld\"]},\"application/rfc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/riscos\":{\"source\":\"iana\"},\"application/rlmi+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/rls-services+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rs\"]},\"application/route-apd+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rapd\"]},\"application/route-s-tsid+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sls\"]},\"application/route-usd+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rusd\"]},\"application/rpki-ghostbusters\":{\"source\":\"iana\",\"extensions\":[\"gbr\"]},\"application/rpki-manifest\":{\"source\":\"iana\",\"extensions\":[\"mft\"]},\"application/rpki-publication\":{\"source\":\"iana\"},\"application/rpki-roa\":{\"source\":\"iana\",\"extensions\":[\"roa\"]},\"application/rpki-updown\":{\"source\":\"iana\"},\"application/rsd+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"rsd\"]},\"application/rss+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"rss\"]},\"application/rtf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rtf\"]},\"application/rtploopback\":{\"source\":\"iana\"},\"application/rtx\":{\"source\":\"iana\"},\"application/samlassertion+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/samlmetadata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sbml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sbml\"]},\"application/scaip+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/scim+json\":{\"source\":\"iana\",\"compressible\":true},\"application/scvp-cv-request\":{\"source\":\"iana\",\"extensions\":[\"scq\"]},\"application/scvp-cv-response\":{\"source\":\"iana\",\"extensions\":[\"scs\"]},\"application/scvp-vp-request\":{\"source\":\"iana\",\"extensions\":[\"spq\"]},\"application/scvp-vp-response\":{\"source\":\"iana\",\"extensions\":[\"spp\"]},\"application/sdp\":{\"source\":\"iana\",\"extensions\":[\"sdp\"]},\"application/secevent+jwt\":{\"source\":\"iana\"},\"application/senml+cbor\":{\"source\":\"iana\"},\"application/senml+json\":{\"source\":\"iana\",\"compressible\":true},\"application/senml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"senmlx\"]},\"application/senml-exi\":{\"source\":\"iana\"},\"application/sensml+cbor\":{\"source\":\"iana\"},\"application/sensml+json\":{\"source\":\"iana\",\"compressible\":true},\"application/sensml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sensmlx\"]},\"application/sensml-exi\":{\"source\":\"iana\"},\"application/sep+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sep-exi\":{\"source\":\"iana\"},\"application/session-info\":{\"source\":\"iana\"},\"application/set-payment\":{\"source\":\"iana\"},\"application/set-payment-initiation\":{\"source\":\"iana\",\"extensions\":[\"setpay\"]},\"application/set-registration\":{\"source\":\"iana\"},\"application/set-registration-initiation\":{\"source\":\"iana\",\"extensions\":[\"setreg\"]},\"application/sgml\":{\"source\":\"iana\"},\"application/sgml-open-catalog\":{\"source\":\"iana\"},\"application/shf+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"shf\"]},\"application/sieve\":{\"source\":\"iana\",\"extensions\":[\"siv\",\"sieve\"]},\"application/simple-filter+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/simple-message-summary\":{\"source\":\"iana\"},\"application/simplesymbolcontainer\":{\"source\":\"iana\"},\"application/sipc\":{\"source\":\"iana\"},\"application/slate\":{\"source\":\"iana\"},\"application/smil\":{\"source\":\"iana\"},\"application/smil+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"smi\",\"smil\"]},\"application/smpte336m\":{\"source\":\"iana\"},\"application/soap+fastinfoset\":{\"source\":\"iana\"},\"application/soap+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sparql-query\":{\"source\":\"iana\",\"extensions\":[\"rq\"]},\"application/sparql-results+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"srx\"]},\"application/spirits-event+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/sql\":{\"source\":\"iana\"},\"application/srgs\":{\"source\":\"iana\",\"extensions\":[\"gram\"]},\"application/srgs+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"grxml\"]},\"application/sru+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sru\"]},\"application/ssdl+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"ssdl\"]},\"application/ssml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ssml\"]},\"application/stix+json\":{\"source\":\"iana\",\"compressible\":true},\"application/swid+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"swidtag\"]},\"application/tamp-apex-update\":{\"source\":\"iana\"},\"application/tamp-apex-update-confirm\":{\"source\":\"iana\"},\"application/tamp-community-update\":{\"source\":\"iana\"},\"application/tamp-community-update-confirm\":{\"source\":\"iana\"},\"application/tamp-error\":{\"source\":\"iana\"},\"application/tamp-sequence-adjust\":{\"source\":\"iana\"},\"application/tamp-sequence-adjust-confirm\":{\"source\":\"iana\"},\"application/tamp-status-query\":{\"source\":\"iana\"},\"application/tamp-status-response\":{\"source\":\"iana\"},\"application/tamp-update\":{\"source\":\"iana\"},\"application/tamp-update-confirm\":{\"source\":\"iana\"},\"application/tar\":{\"compressible\":true},\"application/taxii+json\":{\"source\":\"iana\",\"compressible\":true},\"application/tei+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"tei\",\"teicorpus\"]},\"application/tetra_isi\":{\"source\":\"iana\"},\"application/thraud+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"tfi\"]},\"application/timestamp-query\":{\"source\":\"iana\"},\"application/timestamp-reply\":{\"source\":\"iana\"},\"application/timestamped-data\":{\"source\":\"iana\",\"extensions\":[\"tsd\"]},\"application/tlsrpt+gzip\":{\"source\":\"iana\"},\"application/tlsrpt+json\":{\"source\":\"iana\",\"compressible\":true},\"application/tnauthlist\":{\"source\":\"iana\"},\"application/toml\":{\"compressible\":true,\"extensions\":[\"toml\"]},\"application/trickle-ice-sdpfrag\":{\"source\":\"iana\"},\"application/trig\":{\"source\":\"iana\"},\"application/ttml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ttml\"]},\"application/tve-trigger\":{\"source\":\"iana\"},\"application/tzif\":{\"source\":\"iana\"},\"application/tzif-leap\":{\"source\":\"iana\"},\"application/ulpfec\":{\"source\":\"iana\"},\"application/urc-grpsheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/urc-ressheet+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rsheet\"]},\"application/urc-targetdesc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/urc-uisocketdesc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vcard+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vcard+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vemmi\":{\"source\":\"iana\"},\"application/vividence.scriptfile\":{\"source\":\"apache\"},\"application/vnd.1000minds.decision-model+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"1km\"]},\"application/vnd.3gpp-prose+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp-prose-pc3ch+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp-v2x-local-service-information\":{\"source\":\"iana\"},\"application/vnd.3gpp.access-transfer-events+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.bsf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.gmop+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mc-signalling-ear\":{\"source\":\"iana\"},\"application/vnd.3gpp.mcdata-affiliation-command+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-payload\":{\"source\":\"iana\"},\"application/vnd.3gpp.mcdata-service-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-signalling\":{\"source\":\"iana\"},\"application/vnd.3gpp.mcdata-ue-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcdata-user-profile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-affiliation-command+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-floor-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-location-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-mbms-usage-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-service-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-signed+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-ue-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-ue-init-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcptt-user-profile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-affiliation-command+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-affiliation-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-location-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-mbms-usage-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-service-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-transmission-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-ue-config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mcvideo-user-profile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.mid-call+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.pic-bw-large\":{\"source\":\"iana\",\"extensions\":[\"plb\"]},\"application/vnd.3gpp.pic-bw-small\":{\"source\":\"iana\",\"extensions\":[\"psb\"]},\"application/vnd.3gpp.pic-bw-var\":{\"source\":\"iana\",\"extensions\":[\"pvb\"]},\"application/vnd.3gpp.sms\":{\"source\":\"iana\"},\"application/vnd.3gpp.sms+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.srvcc-ext+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.srvcc-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.state-and-event-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp.ussd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp2.bcmcsinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.3gpp2.sms\":{\"source\":\"iana\"},\"application/vnd.3gpp2.tcap\":{\"source\":\"iana\",\"extensions\":[\"tcap\"]},\"application/vnd.3lightssoftware.imagescal\":{\"source\":\"iana\"},\"application/vnd.3m.post-it-notes\":{\"source\":\"iana\",\"extensions\":[\"pwn\"]},\"application/vnd.accpac.simply.aso\":{\"source\":\"iana\",\"extensions\":[\"aso\"]},\"application/vnd.accpac.simply.imp\":{\"source\":\"iana\",\"extensions\":[\"imp\"]},\"application/vnd.acucobol\":{\"source\":\"iana\",\"extensions\":[\"acu\"]},\"application/vnd.acucorp\":{\"source\":\"iana\",\"extensions\":[\"atc\",\"acutc\"]},\"application/vnd.adobe.air-application-installer-package+zip\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"air\"]},\"application/vnd.adobe.flash.movie\":{\"source\":\"iana\"},\"application/vnd.adobe.formscentral.fcdt\":{\"source\":\"iana\",\"extensions\":[\"fcdt\"]},\"application/vnd.adobe.fxp\":{\"source\":\"iana\",\"extensions\":[\"fxp\",\"fxpl\"]},\"application/vnd.adobe.partial-upload\":{\"source\":\"iana\"},\"application/vnd.adobe.xdp+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdp\"]},\"application/vnd.adobe.xfdf\":{\"source\":\"iana\",\"extensions\":[\"xfdf\"]},\"application/vnd.aether.imp\":{\"source\":\"iana\"},\"application/vnd.afpc.afplinedata\":{\"source\":\"iana\"},\"application/vnd.afpc.afplinedata-pagedef\":{\"source\":\"iana\"},\"application/vnd.afpc.foca-charset\":{\"source\":\"iana\"},\"application/vnd.afpc.foca-codedfont\":{\"source\":\"iana\"},\"application/vnd.afpc.foca-codepage\":{\"source\":\"iana\"},\"application/vnd.afpc.modca\":{\"source\":\"iana\"},\"application/vnd.afpc.modca-formdef\":{\"source\":\"iana\"},\"application/vnd.afpc.modca-mediummap\":{\"source\":\"iana\"},\"application/vnd.afpc.modca-objectcontainer\":{\"source\":\"iana\"},\"application/vnd.afpc.modca-overlay\":{\"source\":\"iana\"},\"application/vnd.afpc.modca-pagesegment\":{\"source\":\"iana\"},\"application/vnd.ah-barcode\":{\"source\":\"iana\"},\"application/vnd.ahead.space\":{\"source\":\"iana\",\"extensions\":[\"ahead\"]},\"application/vnd.airzip.filesecure.azf\":{\"source\":\"iana\",\"extensions\":[\"azf\"]},\"application/vnd.airzip.filesecure.azs\":{\"source\":\"iana\",\"extensions\":[\"azs\"]},\"application/vnd.amadeus+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.amazon.ebook\":{\"source\":\"apache\",\"extensions\":[\"azw\"]},\"application/vnd.amazon.mobi8-ebook\":{\"source\":\"iana\"},\"application/vnd.americandynamics.acc\":{\"source\":\"iana\",\"extensions\":[\"acc\"]},\"application/vnd.amiga.ami\":{\"source\":\"iana\",\"extensions\":[\"ami\"]},\"application/vnd.amundsen.maze+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.android.ota\":{\"source\":\"iana\"},\"application/vnd.android.package-archive\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"apk\"]},\"application/vnd.anki\":{\"source\":\"iana\"},\"application/vnd.anser-web-certificate-issue-initiation\":{\"source\":\"iana\",\"extensions\":[\"cii\"]},\"application/vnd.anser-web-funds-transfer-initiation\":{\"source\":\"apache\",\"extensions\":[\"fti\"]},\"application/vnd.antix.game-component\":{\"source\":\"iana\",\"extensions\":[\"atx\"]},\"application/vnd.apache.thrift.binary\":{\"source\":\"iana\"},\"application/vnd.apache.thrift.compact\":{\"source\":\"iana\"},\"application/vnd.apache.thrift.json\":{\"source\":\"iana\"},\"application/vnd.api+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.aplextor.warrp+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.apothekende.reservation+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.apple.installer+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mpkg\"]},\"application/vnd.apple.keynote\":{\"source\":\"iana\",\"extensions\":[\"keynote\"]},\"application/vnd.apple.mpegurl\":{\"source\":\"iana\",\"extensions\":[\"m3u8\"]},\"application/vnd.apple.numbers\":{\"source\":\"iana\",\"extensions\":[\"numbers\"]},\"application/vnd.apple.pages\":{\"source\":\"iana\",\"extensions\":[\"pages\"]},\"application/vnd.apple.pkpass\":{\"compressible\":false,\"extensions\":[\"pkpass\"]},\"application/vnd.arastra.swi\":{\"source\":\"iana\"},\"application/vnd.aristanetworks.swi\":{\"source\":\"iana\",\"extensions\":[\"swi\"]},\"application/vnd.artisan+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.artsquare\":{\"source\":\"iana\"},\"application/vnd.astraea-software.iota\":{\"source\":\"iana\",\"extensions\":[\"iota\"]},\"application/vnd.audiograph\":{\"source\":\"iana\",\"extensions\":[\"aep\"]},\"application/vnd.autopackage\":{\"source\":\"iana\"},\"application/vnd.avalon+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.avistar+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.balsamiq.bmml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"bmml\"]},\"application/vnd.balsamiq.bmpr\":{\"source\":\"iana\"},\"application/vnd.banana-accounting\":{\"source\":\"iana\"},\"application/vnd.bbf.usp.error\":{\"source\":\"iana\"},\"application/vnd.bbf.usp.msg\":{\"source\":\"iana\"},\"application/vnd.bbf.usp.msg+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.bekitzur-stech+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.bint.med-content\":{\"source\":\"iana\"},\"application/vnd.biopax.rdf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.blink-idb-value-wrapper\":{\"source\":\"iana\"},\"application/vnd.blueice.multipass\":{\"source\":\"iana\",\"extensions\":[\"mpm\"]},\"application/vnd.bluetooth.ep.oob\":{\"source\":\"iana\"},\"application/vnd.bluetooth.le.oob\":{\"source\":\"iana\"},\"application/vnd.bmi\":{\"source\":\"iana\",\"extensions\":[\"bmi\"]},\"application/vnd.bpf\":{\"source\":\"iana\"},\"application/vnd.bpf3\":{\"source\":\"iana\"},\"application/vnd.businessobjects\":{\"source\":\"iana\",\"extensions\":[\"rep\"]},\"application/vnd.byu.uapi+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cab-jscript\":{\"source\":\"iana\"},\"application/vnd.canon-cpdl\":{\"source\":\"iana\"},\"application/vnd.canon-lips\":{\"source\":\"iana\"},\"application/vnd.capasystems-pg+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cendio.thinlinc.clientconf\":{\"source\":\"iana\"},\"application/vnd.century-systems.tcp_stream\":{\"source\":\"iana\"},\"application/vnd.chemdraw+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"cdxml\"]},\"application/vnd.chess-pgn\":{\"source\":\"iana\"},\"application/vnd.chipnuts.karaoke-mmd\":{\"source\":\"iana\",\"extensions\":[\"mmd\"]},\"application/vnd.ciedi\":{\"source\":\"iana\"},\"application/vnd.cinderella\":{\"source\":\"iana\",\"extensions\":[\"cdy\"]},\"application/vnd.cirpack.isdn-ext\":{\"source\":\"iana\"},\"application/vnd.citationstyles.style+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"csl\"]},\"application/vnd.claymore\":{\"source\":\"iana\",\"extensions\":[\"cla\"]},\"application/vnd.cloanto.rp9\":{\"source\":\"iana\",\"extensions\":[\"rp9\"]},\"application/vnd.clonk.c4group\":{\"source\":\"iana\",\"extensions\":[\"c4g\",\"c4d\",\"c4f\",\"c4p\",\"c4u\"]},\"application/vnd.cluetrust.cartomobile-config\":{\"source\":\"iana\",\"extensions\":[\"c11amc\"]},\"application/vnd.cluetrust.cartomobile-config-pkg\":{\"source\":\"iana\",\"extensions\":[\"c11amz\"]},\"application/vnd.coffeescript\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.document\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.document-template\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.presentation\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.presentation-template\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.spreadsheet\":{\"source\":\"iana\"},\"application/vnd.collabio.xodocuments.spreadsheet-template\":{\"source\":\"iana\"},\"application/vnd.collection+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.collection.doc+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.collection.next+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.comicbook+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.comicbook-rar\":{\"source\":\"iana\"},\"application/vnd.commerce-battelle\":{\"source\":\"iana\"},\"application/vnd.commonspace\":{\"source\":\"iana\",\"extensions\":[\"csp\"]},\"application/vnd.contact.cmsg\":{\"source\":\"iana\",\"extensions\":[\"cdbcmsg\"]},\"application/vnd.coreos.ignition+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cosmocaller\":{\"source\":\"iana\",\"extensions\":[\"cmc\"]},\"application/vnd.crick.clicker\":{\"source\":\"iana\",\"extensions\":[\"clkx\"]},\"application/vnd.crick.clicker.keyboard\":{\"source\":\"iana\",\"extensions\":[\"clkk\"]},\"application/vnd.crick.clicker.palette\":{\"source\":\"iana\",\"extensions\":[\"clkp\"]},\"application/vnd.crick.clicker.template\":{\"source\":\"iana\",\"extensions\":[\"clkt\"]},\"application/vnd.crick.clicker.wordbank\":{\"source\":\"iana\",\"extensions\":[\"clkw\"]},\"application/vnd.criticaltools.wbs+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wbs\"]},\"application/vnd.cryptii.pipe+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.crypto-shade-file\":{\"source\":\"iana\"},\"application/vnd.ctc-posml\":{\"source\":\"iana\",\"extensions\":[\"pml\"]},\"application/vnd.ctct.ws+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cups-pdf\":{\"source\":\"iana\"},\"application/vnd.cups-postscript\":{\"source\":\"iana\"},\"application/vnd.cups-ppd\":{\"source\":\"iana\",\"extensions\":[\"ppd\"]},\"application/vnd.cups-raster\":{\"source\":\"iana\"},\"application/vnd.cups-raw\":{\"source\":\"iana\"},\"application/vnd.curl\":{\"source\":\"iana\"},\"application/vnd.curl.car\":{\"source\":\"apache\",\"extensions\":[\"car\"]},\"application/vnd.curl.pcurl\":{\"source\":\"apache\",\"extensions\":[\"pcurl\"]},\"application/vnd.cyan.dean.root+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.cybank\":{\"source\":\"iana\"},\"application/vnd.d2l.coursepackage1p0+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.dart\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dart\"]},\"application/vnd.data-vision.rdz\":{\"source\":\"iana\",\"extensions\":[\"rdz\"]},\"application/vnd.datapackage+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dataresource+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.debian.binary-package\":{\"source\":\"iana\"},\"application/vnd.dece.data\":{\"source\":\"iana\",\"extensions\":[\"uvf\",\"uvvf\",\"uvd\",\"uvvd\"]},\"application/vnd.dece.ttml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"uvt\",\"uvvt\"]},\"application/vnd.dece.unspecified\":{\"source\":\"iana\",\"extensions\":[\"uvx\",\"uvvx\"]},\"application/vnd.dece.zip\":{\"source\":\"iana\",\"extensions\":[\"uvz\",\"uvvz\"]},\"application/vnd.denovo.fcselayout-link\":{\"source\":\"iana\",\"extensions\":[\"fe_launch\"]},\"application/vnd.desmume.movie\":{\"source\":\"iana\"},\"application/vnd.dir-bi.plate-dl-nosuffix\":{\"source\":\"iana\"},\"application/vnd.dm.delegation+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dna\":{\"source\":\"iana\",\"extensions\":[\"dna\"]},\"application/vnd.document+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dolby.mlp\":{\"source\":\"apache\",\"extensions\":[\"mlp\"]},\"application/vnd.dolby.mobile.1\":{\"source\":\"iana\"},\"application/vnd.dolby.mobile.2\":{\"source\":\"iana\"},\"application/vnd.doremir.scorecloud-binary-document\":{\"source\":\"iana\"},\"application/vnd.dpgraph\":{\"source\":\"iana\",\"extensions\":[\"dpg\"]},\"application/vnd.dreamfactory\":{\"source\":\"iana\",\"extensions\":[\"dfac\"]},\"application/vnd.drive+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ds-keypoint\":{\"source\":\"apache\",\"extensions\":[\"kpxx\"]},\"application/vnd.dtg.local\":{\"source\":\"iana\"},\"application/vnd.dtg.local.flash\":{\"source\":\"iana\"},\"application/vnd.dtg.local.html\":{\"source\":\"iana\"},\"application/vnd.dvb.ait\":{\"source\":\"iana\",\"extensions\":[\"ait\"]},\"application/vnd.dvb.dvbj\":{\"source\":\"iana\"},\"application/vnd.dvb.esgcontainer\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcdftnotifaccess\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcesgaccess\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcesgaccess2\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcesgpdd\":{\"source\":\"iana\"},\"application/vnd.dvb.ipdcroaming\":{\"source\":\"iana\"},\"application/vnd.dvb.iptv.alfec-base\":{\"source\":\"iana\"},\"application/vnd.dvb.iptv.alfec-enhancement\":{\"source\":\"iana\"},\"application/vnd.dvb.notif-aggregate-root+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-container+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-generic+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-ia-msglist+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-ia-registration-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-ia-registration-response+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.notif-init+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.dvb.pfr\":{\"source\":\"iana\"},\"application/vnd.dvb.service\":{\"source\":\"iana\",\"extensions\":[\"svc\"]},\"application/vnd.dxr\":{\"source\":\"iana\"},\"application/vnd.dynageo\":{\"source\":\"iana\",\"extensions\":[\"geo\"]},\"application/vnd.dzr\":{\"source\":\"iana\"},\"application/vnd.easykaraoke.cdgdownload\":{\"source\":\"iana\"},\"application/vnd.ecdis-update\":{\"source\":\"iana\"},\"application/vnd.ecip.rlp\":{\"source\":\"iana\"},\"application/vnd.ecowin.chart\":{\"source\":\"iana\",\"extensions\":[\"mag\"]},\"application/vnd.ecowin.filerequest\":{\"source\":\"iana\"},\"application/vnd.ecowin.fileupdate\":{\"source\":\"iana\"},\"application/vnd.ecowin.series\":{\"source\":\"iana\"},\"application/vnd.ecowin.seriesrequest\":{\"source\":\"iana\"},\"application/vnd.ecowin.seriesupdate\":{\"source\":\"iana\"},\"application/vnd.efi.img\":{\"source\":\"iana\"},\"application/vnd.efi.iso\":{\"source\":\"iana\"},\"application/vnd.emclient.accessrequest+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.enliven\":{\"source\":\"iana\",\"extensions\":[\"nml\"]},\"application/vnd.enphase.envoy\":{\"source\":\"iana\"},\"application/vnd.eprints.data+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.epson.esf\":{\"source\":\"iana\",\"extensions\":[\"esf\"]},\"application/vnd.epson.msf\":{\"source\":\"iana\",\"extensions\":[\"msf\"]},\"application/vnd.epson.quickanime\":{\"source\":\"iana\",\"extensions\":[\"qam\"]},\"application/vnd.epson.salt\":{\"source\":\"iana\",\"extensions\":[\"slt\"]},\"application/vnd.epson.ssf\":{\"source\":\"iana\",\"extensions\":[\"ssf\"]},\"application/vnd.ericsson.quickcall\":{\"source\":\"iana\"},\"application/vnd.espass-espass+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.eszigno3+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"es3\",\"et3\"]},\"application/vnd.etsi.aoc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.asic-e+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.etsi.asic-s+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.etsi.cug+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvcommand+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvdiscovery+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsad-bc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsad-cod+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsad-npvr+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvservice+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvsync+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.iptvueprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.mcid+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.mheg5\":{\"source\":\"iana\"},\"application/vnd.etsi.overload-control-policy-dataset+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.pstn+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.sci+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.simservs+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.timestamp-token\":{\"source\":\"iana\"},\"application/vnd.etsi.tsl+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.etsi.tsl.der\":{\"source\":\"iana\"},\"application/vnd.eudora.data\":{\"source\":\"iana\"},\"application/vnd.evolv.ecig.profile\":{\"source\":\"iana\"},\"application/vnd.evolv.ecig.settings\":{\"source\":\"iana\"},\"application/vnd.evolv.ecig.theme\":{\"source\":\"iana\"},\"application/vnd.exstream-empower+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.exstream-package\":{\"source\":\"iana\"},\"application/vnd.ezpix-album\":{\"source\":\"iana\",\"extensions\":[\"ez2\"]},\"application/vnd.ezpix-package\":{\"source\":\"iana\",\"extensions\":[\"ez3\"]},\"application/vnd.f-secure.mobile\":{\"source\":\"iana\"},\"application/vnd.fastcopy-disk-image\":{\"source\":\"iana\"},\"application/vnd.fdf\":{\"source\":\"iana\",\"extensions\":[\"fdf\"]},\"application/vnd.fdsn.mseed\":{\"source\":\"iana\",\"extensions\":[\"mseed\"]},\"application/vnd.fdsn.seed\":{\"source\":\"iana\",\"extensions\":[\"seed\",\"dataless\"]},\"application/vnd.ffsns\":{\"source\":\"iana\"},\"application/vnd.ficlab.flb+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.filmit.zfc\":{\"source\":\"iana\"},\"application/vnd.fints\":{\"source\":\"iana\"},\"application/vnd.firemonkeys.cloudcell\":{\"source\":\"iana\"},\"application/vnd.flographit\":{\"source\":\"iana\",\"extensions\":[\"gph\"]},\"application/vnd.fluxtime.clip\":{\"source\":\"iana\",\"extensions\":[\"ftc\"]},\"application/vnd.font-fontforge-sfd\":{\"source\":\"iana\"},\"application/vnd.framemaker\":{\"source\":\"iana\",\"extensions\":[\"fm\",\"frame\",\"maker\",\"book\"]},\"application/vnd.frogans.fnc\":{\"source\":\"iana\",\"extensions\":[\"fnc\"]},\"application/vnd.frogans.ltf\":{\"source\":\"iana\",\"extensions\":[\"ltf\"]},\"application/vnd.fsc.weblaunch\":{\"source\":\"iana\",\"extensions\":[\"fsc\"]},\"application/vnd.fujitsu.oasys\":{\"source\":\"iana\",\"extensions\":[\"oas\"]},\"application/vnd.fujitsu.oasys2\":{\"source\":\"iana\",\"extensions\":[\"oa2\"]},\"application/vnd.fujitsu.oasys3\":{\"source\":\"iana\",\"extensions\":[\"oa3\"]},\"application/vnd.fujitsu.oasysgp\":{\"source\":\"iana\",\"extensions\":[\"fg5\"]},\"application/vnd.fujitsu.oasysprs\":{\"source\":\"iana\",\"extensions\":[\"bh2\"]},\"application/vnd.fujixerox.art-ex\":{\"source\":\"iana\"},\"application/vnd.fujixerox.art4\":{\"source\":\"iana\"},\"application/vnd.fujixerox.ddd\":{\"source\":\"iana\",\"extensions\":[\"ddd\"]},\"application/vnd.fujixerox.docuworks\":{\"source\":\"iana\",\"extensions\":[\"xdw\"]},\"application/vnd.fujixerox.docuworks.binder\":{\"source\":\"iana\",\"extensions\":[\"xbd\"]},\"application/vnd.fujixerox.docuworks.container\":{\"source\":\"iana\"},\"application/vnd.fujixerox.hbpl\":{\"source\":\"iana\"},\"application/vnd.fut-misnet\":{\"source\":\"iana\"},\"application/vnd.futoin+cbor\":{\"source\":\"iana\"},\"application/vnd.futoin+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.fuzzysheet\":{\"source\":\"iana\",\"extensions\":[\"fzs\"]},\"application/vnd.genomatix.tuxedo\":{\"source\":\"iana\",\"extensions\":[\"txd\"]},\"application/vnd.gentics.grd+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.geo+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.geocube+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.geogebra.file\":{\"source\":\"iana\",\"extensions\":[\"ggb\"]},\"application/vnd.geogebra.tool\":{\"source\":\"iana\",\"extensions\":[\"ggt\"]},\"application/vnd.geometry-explorer\":{\"source\":\"iana\",\"extensions\":[\"gex\",\"gre\"]},\"application/vnd.geonext\":{\"source\":\"iana\",\"extensions\":[\"gxt\"]},\"application/vnd.geoplan\":{\"source\":\"iana\",\"extensions\":[\"g2w\"]},\"application/vnd.geospace\":{\"source\":\"iana\",\"extensions\":[\"g3w\"]},\"application/vnd.gerber\":{\"source\":\"iana\"},\"application/vnd.globalplatform.card-content-mgt\":{\"source\":\"iana\"},\"application/vnd.globalplatform.card-content-mgt-response\":{\"source\":\"iana\"},\"application/vnd.gmx\":{\"source\":\"iana\",\"extensions\":[\"gmx\"]},\"application/vnd.google-apps.document\":{\"compressible\":false,\"extensions\":[\"gdoc\"]},\"application/vnd.google-apps.presentation\":{\"compressible\":false,\"extensions\":[\"gslides\"]},\"application/vnd.google-apps.spreadsheet\":{\"compressible\":false,\"extensions\":[\"gsheet\"]},\"application/vnd.google-earth.kml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"kml\"]},\"application/vnd.google-earth.kmz\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"kmz\"]},\"application/vnd.gov.sk.e-form+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.gov.sk.e-form+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.gov.sk.xmldatacontainer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.grafeq\":{\"source\":\"iana\",\"extensions\":[\"gqf\",\"gqs\"]},\"application/vnd.gridmp\":{\"source\":\"iana\"},\"application/vnd.groove-account\":{\"source\":\"iana\",\"extensions\":[\"gac\"]},\"application/vnd.groove-help\":{\"source\":\"iana\",\"extensions\":[\"ghf\"]},\"application/vnd.groove-identity-message\":{\"source\":\"iana\",\"extensions\":[\"gim\"]},\"application/vnd.groove-injector\":{\"source\":\"iana\",\"extensions\":[\"grv\"]},\"application/vnd.groove-tool-message\":{\"source\":\"iana\",\"extensions\":[\"gtm\"]},\"application/vnd.groove-tool-template\":{\"source\":\"iana\",\"extensions\":[\"tpl\"]},\"application/vnd.groove-vcard\":{\"source\":\"iana\",\"extensions\":[\"vcg\"]},\"application/vnd.hal+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hal+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"hal\"]},\"application/vnd.handheld-entertainment+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"zmm\"]},\"application/vnd.hbci\":{\"source\":\"iana\",\"extensions\":[\"hbci\"]},\"application/vnd.hc+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hcl-bireports\":{\"source\":\"iana\"},\"application/vnd.hdt\":{\"source\":\"iana\"},\"application/vnd.heroku+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hhe.lesson-player\":{\"source\":\"iana\",\"extensions\":[\"les\"]},\"application/vnd.hp-hpgl\":{\"source\":\"iana\",\"extensions\":[\"hpgl\"]},\"application/vnd.hp-hpid\":{\"source\":\"iana\",\"extensions\":[\"hpid\"]},\"application/vnd.hp-hps\":{\"source\":\"iana\",\"extensions\":[\"hps\"]},\"application/vnd.hp-jlyt\":{\"source\":\"iana\",\"extensions\":[\"jlt\"]},\"application/vnd.hp-pcl\":{\"source\":\"iana\",\"extensions\":[\"pcl\"]},\"application/vnd.hp-pclxl\":{\"source\":\"iana\",\"extensions\":[\"pclxl\"]},\"application/vnd.httphone\":{\"source\":\"iana\"},\"application/vnd.hydrostatix.sof-data\":{\"source\":\"iana\",\"extensions\":[\"sfd-hdstx\"]},\"application/vnd.hyper+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hyper-item+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hyperdrive+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.hzn-3d-crossword\":{\"source\":\"iana\"},\"application/vnd.ibm.afplinedata\":{\"source\":\"iana\"},\"application/vnd.ibm.electronic-media\":{\"source\":\"iana\"},\"application/vnd.ibm.minipay\":{\"source\":\"iana\",\"extensions\":[\"mpy\"]},\"application/vnd.ibm.modcap\":{\"source\":\"iana\",\"extensions\":[\"afp\",\"listafp\",\"list3820\"]},\"application/vnd.ibm.rights-management\":{\"source\":\"iana\",\"extensions\":[\"irm\"]},\"application/vnd.ibm.secure-container\":{\"source\":\"iana\",\"extensions\":[\"sc\"]},\"application/vnd.iccprofile\":{\"source\":\"iana\",\"extensions\":[\"icc\",\"icm\"]},\"application/vnd.ieee.1905\":{\"source\":\"iana\"},\"application/vnd.igloader\":{\"source\":\"iana\",\"extensions\":[\"igl\"]},\"application/vnd.imagemeter.folder+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.imagemeter.image+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.immervision-ivp\":{\"source\":\"iana\",\"extensions\":[\"ivp\"]},\"application/vnd.immervision-ivu\":{\"source\":\"iana\",\"extensions\":[\"ivu\"]},\"application/vnd.ims.imsccv1p1\":{\"source\":\"iana\"},\"application/vnd.ims.imsccv1p2\":{\"source\":\"iana\"},\"application/vnd.ims.imsccv1p3\":{\"source\":\"iana\"},\"application/vnd.ims.lis.v2.result+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolconsumerprofile+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolproxy+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolproxy.id+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolsettings+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ims.lti.v2.toolsettings.simple+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.informedcontrol.rms+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.informix-visionary\":{\"source\":\"iana\"},\"application/vnd.infotech.project\":{\"source\":\"iana\"},\"application/vnd.infotech.project+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.innopath.wamp.notification\":{\"source\":\"iana\"},\"application/vnd.insors.igm\":{\"source\":\"iana\",\"extensions\":[\"igm\"]},\"application/vnd.intercon.formnet\":{\"source\":\"iana\",\"extensions\":[\"xpw\",\"xpx\"]},\"application/vnd.intergeo\":{\"source\":\"iana\",\"extensions\":[\"i2g\"]},\"application/vnd.intertrust.digibox\":{\"source\":\"iana\"},\"application/vnd.intertrust.nncp\":{\"source\":\"iana\"},\"application/vnd.intu.qbo\":{\"source\":\"iana\",\"extensions\":[\"qbo\"]},\"application/vnd.intu.qfx\":{\"source\":\"iana\",\"extensions\":[\"qfx\"]},\"application/vnd.iptc.g2.catalogitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.conceptitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.knowledgeitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.newsitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.newsmessage+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.packageitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.iptc.g2.planningitem+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ipunplugged.rcprofile\":{\"source\":\"iana\",\"extensions\":[\"rcprofile\"]},\"application/vnd.irepository.package+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"irp\"]},\"application/vnd.is-xpr\":{\"source\":\"iana\",\"extensions\":[\"xpr\"]},\"application/vnd.isac.fcs\":{\"source\":\"iana\",\"extensions\":[\"fcs\"]},\"application/vnd.iso11783-10+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.jam\":{\"source\":\"iana\",\"extensions\":[\"jam\"]},\"application/vnd.japannet-directory-service\":{\"source\":\"iana\"},\"application/vnd.japannet-jpnstore-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-payment-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-registration\":{\"source\":\"iana\"},\"application/vnd.japannet-registration-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-setstore-wakeup\":{\"source\":\"iana\"},\"application/vnd.japannet-verification\":{\"source\":\"iana\"},\"application/vnd.japannet-verification-wakeup\":{\"source\":\"iana\"},\"application/vnd.jcp.javame.midlet-rms\":{\"source\":\"iana\",\"extensions\":[\"rms\"]},\"application/vnd.jisp\":{\"source\":\"iana\",\"extensions\":[\"jisp\"]},\"application/vnd.joost.joda-archive\":{\"source\":\"iana\",\"extensions\":[\"joda\"]},\"application/vnd.jsk.isdn-ngn\":{\"source\":\"iana\"},\"application/vnd.kahootz\":{\"source\":\"iana\",\"extensions\":[\"ktz\",\"ktr\"]},\"application/vnd.kde.karbon\":{\"source\":\"iana\",\"extensions\":[\"karbon\"]},\"application/vnd.kde.kchart\":{\"source\":\"iana\",\"extensions\":[\"chrt\"]},\"application/vnd.kde.kformula\":{\"source\":\"iana\",\"extensions\":[\"kfo\"]},\"application/vnd.kde.kivio\":{\"source\":\"iana\",\"extensions\":[\"flw\"]},\"application/vnd.kde.kontour\":{\"source\":\"iana\",\"extensions\":[\"kon\"]},\"application/vnd.kde.kpresenter\":{\"source\":\"iana\",\"extensions\":[\"kpr\",\"kpt\"]},\"application/vnd.kde.kspread\":{\"source\":\"iana\",\"extensions\":[\"ksp\"]},\"application/vnd.kde.kword\":{\"source\":\"iana\",\"extensions\":[\"kwd\",\"kwt\"]},\"application/vnd.kenameaapp\":{\"source\":\"iana\",\"extensions\":[\"htke\"]},\"application/vnd.kidspiration\":{\"source\":\"iana\",\"extensions\":[\"kia\"]},\"application/vnd.kinar\":{\"source\":\"iana\",\"extensions\":[\"kne\",\"knp\"]},\"application/vnd.koan\":{\"source\":\"iana\",\"extensions\":[\"skp\",\"skd\",\"skt\",\"skm\"]},\"application/vnd.kodak-descriptor\":{\"source\":\"iana\",\"extensions\":[\"sse\"]},\"application/vnd.las\":{\"source\":\"iana\"},\"application/vnd.las.las+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.las.las+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lasxml\"]},\"application/vnd.laszip\":{\"source\":\"iana\"},\"application/vnd.leap+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.liberty-request+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.llamagraphics.life-balance.desktop\":{\"source\":\"iana\",\"extensions\":[\"lbd\"]},\"application/vnd.llamagraphics.life-balance.exchange+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"lbe\"]},\"application/vnd.logipipe.circuit+zip\":{\"source\":\"iana\",\"compressible\":false},\"application/vnd.loom\":{\"source\":\"iana\"},\"application/vnd.lotus-1-2-3\":{\"source\":\"iana\",\"extensions\":[\"123\"]},\"application/vnd.lotus-approach\":{\"source\":\"iana\",\"extensions\":[\"apr\"]},\"application/vnd.lotus-freelance\":{\"source\":\"iana\",\"extensions\":[\"pre\"]},\"application/vnd.lotus-notes\":{\"source\":\"iana\",\"extensions\":[\"nsf\"]},\"application/vnd.lotus-organizer\":{\"source\":\"iana\",\"extensions\":[\"org\"]},\"application/vnd.lotus-screencam\":{\"source\":\"iana\",\"extensions\":[\"scm\"]},\"application/vnd.lotus-wordpro\":{\"source\":\"iana\",\"extensions\":[\"lwp\"]},\"application/vnd.macports.portpkg\":{\"source\":\"iana\",\"extensions\":[\"portpkg\"]},\"application/vnd.mapbox-vector-tile\":{\"source\":\"iana\"},\"application/vnd.marlin.drm.actiontoken+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.marlin.drm.conftoken+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.marlin.drm.license+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.marlin.drm.mdcf\":{\"source\":\"iana\"},\"application/vnd.mason+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.maxmind.maxmind-db\":{\"source\":\"iana\"},\"application/vnd.mcd\":{\"source\":\"iana\",\"extensions\":[\"mcd\"]},\"application/vnd.medcalcdata\":{\"source\":\"iana\",\"extensions\":[\"mc1\"]},\"application/vnd.mediastation.cdkey\":{\"source\":\"iana\",\"extensions\":[\"cdkey\"]},\"application/vnd.meridian-slingshot\":{\"source\":\"iana\"},\"application/vnd.mfer\":{\"source\":\"iana\",\"extensions\":[\"mwf\"]},\"application/vnd.mfmp\":{\"source\":\"iana\",\"extensions\":[\"mfm\"]},\"application/vnd.micro+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.micrografx.flo\":{\"source\":\"iana\",\"extensions\":[\"flo\"]},\"application/vnd.micrografx.igx\":{\"source\":\"iana\",\"extensions\":[\"igx\"]},\"application/vnd.microsoft.portable-executable\":{\"source\":\"iana\"},\"application/vnd.microsoft.windows.thumbnail-cache\":{\"source\":\"iana\"},\"application/vnd.miele+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.mif\":{\"source\":\"iana\",\"extensions\":[\"mif\"]},\"application/vnd.minisoft-hp3000-save\":{\"source\":\"iana\"},\"application/vnd.mitsubishi.misty-guard.trustweb\":{\"source\":\"iana\"},\"application/vnd.mobius.daf\":{\"source\":\"iana\",\"extensions\":[\"daf\"]},\"application/vnd.mobius.dis\":{\"source\":\"iana\",\"extensions\":[\"dis\"]},\"application/vnd.mobius.mbk\":{\"source\":\"iana\",\"extensions\":[\"mbk\"]},\"application/vnd.mobius.mqy\":{\"source\":\"iana\",\"extensions\":[\"mqy\"]},\"application/vnd.mobius.msl\":{\"source\":\"iana\",\"extensions\":[\"msl\"]},\"application/vnd.mobius.plc\":{\"source\":\"iana\",\"extensions\":[\"plc\"]},\"application/vnd.mobius.txf\":{\"source\":\"iana\",\"extensions\":[\"txf\"]},\"application/vnd.mophun.application\":{\"source\":\"iana\",\"extensions\":[\"mpn\"]},\"application/vnd.mophun.certificate\":{\"source\":\"iana\",\"extensions\":[\"mpc\"]},\"application/vnd.motorola.flexsuite\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.adsi\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.fis\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.gotap\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.kmr\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.ttc\":{\"source\":\"iana\"},\"application/vnd.motorola.flexsuite.wem\":{\"source\":\"iana\"},\"application/vnd.motorola.iprm\":{\"source\":\"iana\"},\"application/vnd.mozilla.xul+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xul\"]},\"application/vnd.ms-3mfdocument\":{\"source\":\"iana\"},\"application/vnd.ms-artgalry\":{\"source\":\"iana\",\"extensions\":[\"cil\"]},\"application/vnd.ms-asf\":{\"source\":\"iana\"},\"application/vnd.ms-cab-compressed\":{\"source\":\"iana\",\"extensions\":[\"cab\"]},\"application/vnd.ms-color.iccprofile\":{\"source\":\"apache\"},\"application/vnd.ms-excel\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"xls\",\"xlm\",\"xla\",\"xlc\",\"xlt\",\"xlw\"]},\"application/vnd.ms-excel.addin.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xlam\"]},\"application/vnd.ms-excel.sheet.binary.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xlsb\"]},\"application/vnd.ms-excel.sheet.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xlsm\"]},\"application/vnd.ms-excel.template.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"xltm\"]},\"application/vnd.ms-fontobject\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"eot\"]},\"application/vnd.ms-htmlhelp\":{\"source\":\"iana\",\"extensions\":[\"chm\"]},\"application/vnd.ms-ims\":{\"source\":\"iana\",\"extensions\":[\"ims\"]},\"application/vnd.ms-lrm\":{\"source\":\"iana\",\"extensions\":[\"lrm\"]},\"application/vnd.ms-office.activex+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-officetheme\":{\"source\":\"iana\",\"extensions\":[\"thmx\"]},\"application/vnd.ms-opentype\":{\"source\":\"apache\",\"compressible\":true},\"application/vnd.ms-outlook\":{\"compressible\":false,\"extensions\":[\"msg\"]},\"application/vnd.ms-package.obfuscated-opentype\":{\"source\":\"apache\"},\"application/vnd.ms-pki.seccat\":{\"source\":\"apache\",\"extensions\":[\"cat\"]},\"application/vnd.ms-pki.stl\":{\"source\":\"apache\",\"extensions\":[\"stl\"]},\"application/vnd.ms-playready.initiator+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-powerpoint\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ppt\",\"pps\",\"pot\"]},\"application/vnd.ms-powerpoint.addin.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"ppam\"]},\"application/vnd.ms-powerpoint.presentation.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"pptm\"]},\"application/vnd.ms-powerpoint.slide.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"sldm\"]},\"application/vnd.ms-powerpoint.slideshow.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"ppsm\"]},\"application/vnd.ms-powerpoint.template.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"potm\"]},\"application/vnd.ms-printdevicecapabilities+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-printing.printticket+xml\":{\"source\":\"apache\",\"compressible\":true},\"application/vnd.ms-printschematicket+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.ms-project\":{\"source\":\"iana\",\"extensions\":[\"mpp\",\"mpt\"]},\"application/vnd.ms-tnef\":{\"source\":\"iana\"},\"application/vnd.ms-windows.devicepairing\":{\"source\":\"iana\"},\"application/vnd.ms-windows.nwprinting.oob\":{\"source\":\"iana\"},\"application/vnd.ms-windows.printerpairing\":{\"source\":\"iana\"},\"application/vnd.ms-windows.wsd.oob\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.lic-chlg-req\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.lic-resp\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.meter-chlg-req\":{\"source\":\"iana\"},\"application/vnd.ms-wmdrm.meter-resp\":{\"source\":\"iana\"},\"application/vnd.ms-word.document.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"docm\"]},\"application/vnd.ms-word.template.macroenabled.12\":{\"source\":\"iana\",\"extensions\":[\"dotm\"]},\"application/vnd.ms-works\":{\"source\":\"iana\",\"extensions\":[\"wps\",\"wks\",\"wcm\",\"wdb\"]},\"application/vnd.ms-wpl\":{\"source\":\"iana\",\"extensions\":[\"wpl\"]},\"application/vnd.ms-xpsdocument\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"xps\"]},\"application/vnd.msa-disk-image\":{\"source\":\"iana\"},\"application/vnd.mseq\":{\"source\":\"iana\",\"extensions\":[\"mseq\"]},\"application/vnd.msign\":{\"source\":\"iana\"},\"application/vnd.multiad.creator\":{\"source\":\"iana\"},\"application/vnd.multiad.creator.cif\":{\"source\":\"iana\"},\"application/vnd.music-niff\":{\"source\":\"iana\"},\"application/vnd.musician\":{\"source\":\"iana\",\"extensions\":[\"mus\"]},\"application/vnd.muvee.style\":{\"source\":\"iana\",\"extensions\":[\"msty\"]},\"application/vnd.mynfc\":{\"source\":\"iana\",\"extensions\":[\"taglet\"]},\"application/vnd.ncd.control\":{\"source\":\"iana\"},\"application/vnd.ncd.reference\":{\"source\":\"iana\"},\"application/vnd.nearst.inv+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nervana\":{\"source\":\"iana\"},\"application/vnd.netfpx\":{\"source\":\"iana\"},\"application/vnd.neurolanguage.nlu\":{\"source\":\"iana\",\"extensions\":[\"nlu\"]},\"application/vnd.nimn\":{\"source\":\"iana\"},\"application/vnd.nintendo.nitro.rom\":{\"source\":\"iana\"},\"application/vnd.nintendo.snes.rom\":{\"source\":\"iana\"},\"application/vnd.nitf\":{\"source\":\"iana\",\"extensions\":[\"ntf\",\"nitf\"]},\"application/vnd.noblenet-directory\":{\"source\":\"iana\",\"extensions\":[\"nnd\"]},\"application/vnd.noblenet-sealer\":{\"source\":\"iana\",\"extensions\":[\"nns\"]},\"application/vnd.noblenet-web\":{\"source\":\"iana\",\"extensions\":[\"nnw\"]},\"application/vnd.nokia.catalogs\":{\"source\":\"iana\"},\"application/vnd.nokia.conml+wbxml\":{\"source\":\"iana\"},\"application/vnd.nokia.conml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.iptv.config+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.isds-radio-presets\":{\"source\":\"iana\"},\"application/vnd.nokia.landmark+wbxml\":{\"source\":\"iana\"},\"application/vnd.nokia.landmark+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.landmarkcollection+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.n-gage.ac+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ac\"]},\"application/vnd.nokia.n-gage.data\":{\"source\":\"iana\",\"extensions\":[\"ngdat\"]},\"application/vnd.nokia.n-gage.symbian.install\":{\"source\":\"iana\",\"extensions\":[\"n-gage\"]},\"application/vnd.nokia.ncd\":{\"source\":\"iana\"},\"application/vnd.nokia.pcd+wbxml\":{\"source\":\"iana\"},\"application/vnd.nokia.pcd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.nokia.radio-preset\":{\"source\":\"iana\",\"extensions\":[\"rpst\"]},\"application/vnd.nokia.radio-presets\":{\"source\":\"iana\",\"extensions\":[\"rpss\"]},\"application/vnd.novadigm.edm\":{\"source\":\"iana\",\"extensions\":[\"edm\"]},\"application/vnd.novadigm.edx\":{\"source\":\"iana\",\"extensions\":[\"edx\"]},\"application/vnd.novadigm.ext\":{\"source\":\"iana\",\"extensions\":[\"ext\"]},\"application/vnd.ntt-local.content-share\":{\"source\":\"iana\"},\"application/vnd.ntt-local.file-transfer\":{\"source\":\"iana\"},\"application/vnd.ntt-local.ogw_remote-access\":{\"source\":\"iana\"},\"application/vnd.ntt-local.sip-ta_remote\":{\"source\":\"iana\"},\"application/vnd.ntt-local.sip-ta_tcp_stream\":{\"source\":\"iana\"},\"application/vnd.oasis.opendocument.chart\":{\"source\":\"iana\",\"extensions\":[\"odc\"]},\"application/vnd.oasis.opendocument.chart-template\":{\"source\":\"iana\",\"extensions\":[\"otc\"]},\"application/vnd.oasis.opendocument.database\":{\"source\":\"iana\",\"extensions\":[\"odb\"]},\"application/vnd.oasis.opendocument.formula\":{\"source\":\"iana\",\"extensions\":[\"odf\"]},\"application/vnd.oasis.opendocument.formula-template\":{\"source\":\"iana\",\"extensions\":[\"odft\"]},\"application/vnd.oasis.opendocument.graphics\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"odg\"]},\"application/vnd.oasis.opendocument.graphics-template\":{\"source\":\"iana\",\"extensions\":[\"otg\"]},\"application/vnd.oasis.opendocument.image\":{\"source\":\"iana\",\"extensions\":[\"odi\"]},\"application/vnd.oasis.opendocument.image-template\":{\"source\":\"iana\",\"extensions\":[\"oti\"]},\"application/vnd.oasis.opendocument.presentation\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"odp\"]},\"application/vnd.oasis.opendocument.presentation-template\":{\"source\":\"iana\",\"extensions\":[\"otp\"]},\"application/vnd.oasis.opendocument.spreadsheet\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ods\"]},\"application/vnd.oasis.opendocument.spreadsheet-template\":{\"source\":\"iana\",\"extensions\":[\"ots\"]},\"application/vnd.oasis.opendocument.text\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"odt\"]},\"application/vnd.oasis.opendocument.text-master\":{\"source\":\"iana\",\"extensions\":[\"odm\"]},\"application/vnd.oasis.opendocument.text-template\":{\"source\":\"iana\",\"extensions\":[\"ott\"]},\"application/vnd.oasis.opendocument.text-web\":{\"source\":\"iana\",\"extensions\":[\"oth\"]},\"application/vnd.obn\":{\"source\":\"iana\"},\"application/vnd.ocf+cbor\":{\"source\":\"iana\"},\"application/vnd.oftn.l10n+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.contentaccessdownload+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.contentaccessstreaming+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.cspg-hexbinary\":{\"source\":\"iana\"},\"application/vnd.oipf.dae.svg+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.dae.xhtml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.mippvcontrolmessage+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.pae.gem\":{\"source\":\"iana\"},\"application/vnd.oipf.spdiscovery+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.spdlist+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.ueprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oipf.userprofile+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.olpc-sugar\":{\"source\":\"iana\",\"extensions\":[\"xo\"]},\"application/vnd.oma-scws-config\":{\"source\":\"iana\"},\"application/vnd.oma-scws-http-request\":{\"source\":\"iana\"},\"application/vnd.oma-scws-http-response\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.associated-procedure-parameter+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.drm-trigger+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.imd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.ltkm\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.notification+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.provisioningtrigger\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.sgboot\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.sgdd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.sgdu\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.simple-symbol-container\":{\"source\":\"iana\"},\"application/vnd.oma.bcast.smartcard-trigger+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.sprov+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.bcast.stkm\":{\"source\":\"iana\"},\"application/vnd.oma.cab-address-book+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-feature-handler+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-pcc+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-subs-invite+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.cab-user-prefs+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.dcd\":{\"source\":\"iana\"},\"application/vnd.oma.dcdc\":{\"source\":\"iana\"},\"application/vnd.oma.dd2+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dd2\"]},\"application/vnd.oma.drm.risd+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.group-usage-list+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.lwm2m+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.lwm2m+tlv\":{\"source\":\"iana\"},\"application/vnd.oma.pal+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.detailed-progress-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.final-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.groups+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.invocation-descriptor+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.poc.optimized-progress-report+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.push\":{\"source\":\"iana\"},\"application/vnd.oma.scidm.messages+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oma.xcap-directory+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omads-email+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omads-file+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omads-folder+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.omaloc-supl-init\":{\"source\":\"iana\"},\"application/vnd.onepager\":{\"source\":\"iana\"},\"application/vnd.onepagertamp\":{\"source\":\"iana\"},\"application/vnd.onepagertamx\":{\"source\":\"iana\"},\"application/vnd.onepagertat\":{\"source\":\"iana\"},\"application/vnd.onepagertatp\":{\"source\":\"iana\"},\"application/vnd.onepagertatx\":{\"source\":\"iana\"},\"application/vnd.openblox.game+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"obgx\"]},\"application/vnd.openblox.game-binary\":{\"source\":\"iana\"},\"application/vnd.openeye.oeb\":{\"source\":\"iana\"},\"application/vnd.openofficeorg.extension\":{\"source\":\"apache\",\"extensions\":[\"oxt\"]},\"application/vnd.openstreetmap.data+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"osm\"]},\"application/vnd.openxmlformats-officedocument.custom-properties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.customxmlproperties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawing+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.chart+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.extended-properties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.comments+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.presentation\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"pptx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slide\":{\"source\":\"iana\",\"extensions\":[\"sldx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.slide+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slideshow\":{\"source\":\"iana\",\"extensions\":[\"ppsx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.tags+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.template\":{\"source\":\"iana\",\"extensions\":[\"potx\"]},\"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"xlsx\"]},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.template\":{\"source\":\"iana\",\"extensions\":[\"xltx\"]},\"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.theme+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.themeoverride+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.vmldrawing\":{\"source\":\"iana\"},\"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"docx\"]},\"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.template\":{\"source\":\"iana\",\"extensions\":[\"dotx\"]},\"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-package.core-properties+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.openxmlformats-package.relationships+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oracle.resource+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.orange.indata\":{\"source\":\"iana\"},\"application/vnd.osa.netdeploy\":{\"source\":\"iana\"},\"application/vnd.osgeo.mapguide.package\":{\"source\":\"iana\",\"extensions\":[\"mgp\"]},\"application/vnd.osgi.bundle\":{\"source\":\"iana\"},\"application/vnd.osgi.dp\":{\"source\":\"iana\",\"extensions\":[\"dp\"]},\"application/vnd.osgi.subsystem\":{\"source\":\"iana\",\"extensions\":[\"esa\"]},\"application/vnd.otps.ct-kip+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.oxli.countgraph\":{\"source\":\"iana\"},\"application/vnd.pagerduty+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.palm\":{\"source\":\"iana\",\"extensions\":[\"pdb\",\"pqa\",\"oprc\"]},\"application/vnd.panoply\":{\"source\":\"iana\"},\"application/vnd.paos.xml\":{\"source\":\"iana\"},\"application/vnd.patentdive\":{\"source\":\"iana\"},\"application/vnd.patientecommsdoc\":{\"source\":\"iana\"},\"application/vnd.pawaafile\":{\"source\":\"iana\",\"extensions\":[\"paw\"]},\"application/vnd.pcos\":{\"source\":\"iana\"},\"application/vnd.pg.format\":{\"source\":\"iana\",\"extensions\":[\"str\"]},\"application/vnd.pg.osasli\":{\"source\":\"iana\",\"extensions\":[\"ei6\"]},\"application/vnd.piaccess.application-licence\":{\"source\":\"iana\"},\"application/vnd.picsel\":{\"source\":\"iana\",\"extensions\":[\"efif\"]},\"application/vnd.pmi.widget\":{\"source\":\"iana\",\"extensions\":[\"wg\"]},\"application/vnd.poc.group-advertisement+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.pocketlearn\":{\"source\":\"iana\",\"extensions\":[\"plf\"]},\"application/vnd.powerbuilder6\":{\"source\":\"iana\",\"extensions\":[\"pbd\"]},\"application/vnd.powerbuilder6-s\":{\"source\":\"iana\"},\"application/vnd.powerbuilder7\":{\"source\":\"iana\"},\"application/vnd.powerbuilder7-s\":{\"source\":\"iana\"},\"application/vnd.powerbuilder75\":{\"source\":\"iana\"},\"application/vnd.powerbuilder75-s\":{\"source\":\"iana\"},\"application/vnd.preminet\":{\"source\":\"iana\"},\"application/vnd.previewsystems.box\":{\"source\":\"iana\",\"extensions\":[\"box\"]},\"application/vnd.proteus.magazine\":{\"source\":\"iana\",\"extensions\":[\"mgz\"]},\"application/vnd.psfs\":{\"source\":\"iana\"},\"application/vnd.publishare-delta-tree\":{\"source\":\"iana\",\"extensions\":[\"qps\"]},\"application/vnd.pvi.ptid1\":{\"source\":\"iana\",\"extensions\":[\"ptid\"]},\"application/vnd.pwg-multiplexed\":{\"source\":\"iana\"},\"application/vnd.pwg-xhtml-print+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.qualcomm.brew-app-res\":{\"source\":\"iana\"},\"application/vnd.quarantainenet\":{\"source\":\"iana\"},\"application/vnd.quark.quarkxpress\":{\"source\":\"iana\",\"extensions\":[\"qxd\",\"qxt\",\"qwd\",\"qwt\",\"qxl\",\"qxb\"]},\"application/vnd.quobject-quoxdocument\":{\"source\":\"iana\"},\"application/vnd.radisys.moml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-conf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-conn+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-dialog+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-audit-stream+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-conf+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-base+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-fax-detect+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-fax-sendrecv+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-group+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-speech+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.radisys.msml-dialog-transform+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.rainstor.data\":{\"source\":\"iana\"},\"application/vnd.rapid\":{\"source\":\"iana\"},\"application/vnd.rar\":{\"source\":\"iana\"},\"application/vnd.realvnc.bed\":{\"source\":\"iana\",\"extensions\":[\"bed\"]},\"application/vnd.recordare.musicxml\":{\"source\":\"iana\",\"extensions\":[\"mxl\"]},\"application/vnd.recordare.musicxml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"musicxml\"]},\"application/vnd.renlearn.rlprint\":{\"source\":\"iana\"},\"application/vnd.restful+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.rig.cryptonote\":{\"source\":\"iana\",\"extensions\":[\"cryptonote\"]},\"application/vnd.rim.cod\":{\"source\":\"apache\",\"extensions\":[\"cod\"]},\"application/vnd.rn-realmedia\":{\"source\":\"apache\",\"extensions\":[\"rm\"]},\"application/vnd.rn-realmedia-vbr\":{\"source\":\"apache\",\"extensions\":[\"rmvb\"]},\"application/vnd.route66.link66+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"link66\"]},\"application/vnd.rs-274x\":{\"source\":\"iana\"},\"application/vnd.ruckus.download\":{\"source\":\"iana\"},\"application/vnd.s3sms\":{\"source\":\"iana\"},\"application/vnd.sailingtracker.track\":{\"source\":\"iana\",\"extensions\":[\"st\"]},\"application/vnd.sbm.cid\":{\"source\":\"iana\"},\"application/vnd.sbm.mid2\":{\"source\":\"iana\"},\"application/vnd.scribus\":{\"source\":\"iana\"},\"application/vnd.sealed.3df\":{\"source\":\"iana\"},\"application/vnd.sealed.csf\":{\"source\":\"iana\"},\"application/vnd.sealed.doc\":{\"source\":\"iana\"},\"application/vnd.sealed.eml\":{\"source\":\"iana\"},\"application/vnd.sealed.mht\":{\"source\":\"iana\"},\"application/vnd.sealed.net\":{\"source\":\"iana\"},\"application/vnd.sealed.ppt\":{\"source\":\"iana\"},\"application/vnd.sealed.tiff\":{\"source\":\"iana\"},\"application/vnd.sealed.xls\":{\"source\":\"iana\"},\"application/vnd.sealedmedia.softseal.html\":{\"source\":\"iana\"},\"application/vnd.sealedmedia.softseal.pdf\":{\"source\":\"iana\"},\"application/vnd.seemail\":{\"source\":\"iana\",\"extensions\":[\"see\"]},\"application/vnd.sema\":{\"source\":\"iana\",\"extensions\":[\"sema\"]},\"application/vnd.semd\":{\"source\":\"iana\",\"extensions\":[\"semd\"]},\"application/vnd.semf\":{\"source\":\"iana\",\"extensions\":[\"semf\"]},\"application/vnd.shade-save-file\":{\"source\":\"iana\"},\"application/vnd.shana.informed.formdata\":{\"source\":\"iana\",\"extensions\":[\"ifm\"]},\"application/vnd.shana.informed.formtemplate\":{\"source\":\"iana\",\"extensions\":[\"itp\"]},\"application/vnd.shana.informed.interchange\":{\"source\":\"iana\",\"extensions\":[\"iif\"]},\"application/vnd.shana.informed.package\":{\"source\":\"iana\",\"extensions\":[\"ipk\"]},\"application/vnd.shootproof+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.shopkick+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.sigrok.session\":{\"source\":\"iana\"},\"application/vnd.simtech-mindmapper\":{\"source\":\"iana\",\"extensions\":[\"twd\",\"twds\"]},\"application/vnd.siren+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.smaf\":{\"source\":\"iana\",\"extensions\":[\"mmf\"]},\"application/vnd.smart.notebook\":{\"source\":\"iana\"},\"application/vnd.smart.teacher\":{\"source\":\"iana\",\"extensions\":[\"teacher\"]},\"application/vnd.software602.filler.form+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"fo\"]},\"application/vnd.software602.filler.form-xml-zip\":{\"source\":\"iana\"},\"application/vnd.solent.sdkm+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"sdkm\",\"sdkd\"]},\"application/vnd.spotfire.dxp\":{\"source\":\"iana\",\"extensions\":[\"dxp\"]},\"application/vnd.spotfire.sfs\":{\"source\":\"iana\",\"extensions\":[\"sfs\"]},\"application/vnd.sqlite3\":{\"source\":\"iana\"},\"application/vnd.sss-cod\":{\"source\":\"iana\"},\"application/vnd.sss-dtf\":{\"source\":\"iana\"},\"application/vnd.sss-ntf\":{\"source\":\"iana\"},\"application/vnd.stardivision.calc\":{\"source\":\"apache\",\"extensions\":[\"sdc\"]},\"application/vnd.stardivision.draw\":{\"source\":\"apache\",\"extensions\":[\"sda\"]},\"application/vnd.stardivision.impress\":{\"source\":\"apache\",\"extensions\":[\"sdd\"]},\"application/vnd.stardivision.math\":{\"source\":\"apache\",\"extensions\":[\"smf\"]},\"application/vnd.stardivision.writer\":{\"source\":\"apache\",\"extensions\":[\"sdw\",\"vor\"]},\"application/vnd.stardivision.writer-global\":{\"source\":\"apache\",\"extensions\":[\"sgl\"]},\"application/vnd.stepmania.package\":{\"source\":\"iana\",\"extensions\":[\"smzip\"]},\"application/vnd.stepmania.stepchart\":{\"source\":\"iana\",\"extensions\":[\"sm\"]},\"application/vnd.street-stream\":{\"source\":\"iana\"},\"application/vnd.sun.wadl+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wadl\"]},\"application/vnd.sun.xml.calc\":{\"source\":\"apache\",\"extensions\":[\"sxc\"]},\"application/vnd.sun.xml.calc.template\":{\"source\":\"apache\",\"extensions\":[\"stc\"]},\"application/vnd.sun.xml.draw\":{\"source\":\"apache\",\"extensions\":[\"sxd\"]},\"application/vnd.sun.xml.draw.template\":{\"source\":\"apache\",\"extensions\":[\"std\"]},\"application/vnd.sun.xml.impress\":{\"source\":\"apache\",\"extensions\":[\"sxi\"]},\"application/vnd.sun.xml.impress.template\":{\"source\":\"apache\",\"extensions\":[\"sti\"]},\"application/vnd.sun.xml.math\":{\"source\":\"apache\",\"extensions\":[\"sxm\"]},\"application/vnd.sun.xml.writer\":{\"source\":\"apache\",\"extensions\":[\"sxw\"]},\"application/vnd.sun.xml.writer.global\":{\"source\":\"apache\",\"extensions\":[\"sxg\"]},\"application/vnd.sun.xml.writer.template\":{\"source\":\"apache\",\"extensions\":[\"stw\"]},\"application/vnd.sus-calendar\":{\"source\":\"iana\",\"extensions\":[\"sus\",\"susp\"]},\"application/vnd.svd\":{\"source\":\"iana\",\"extensions\":[\"svd\"]},\"application/vnd.swiftview-ics\":{\"source\":\"iana\"},\"application/vnd.symbian.install\":{\"source\":\"apache\",\"extensions\":[\"sis\",\"sisx\"]},\"application/vnd.syncml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xsm\"]},\"application/vnd.syncml.dm+wbxml\":{\"source\":\"iana\",\"extensions\":[\"bdm\"]},\"application/vnd.syncml.dm+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdm\"]},\"application/vnd.syncml.dm.notification\":{\"source\":\"iana\"},\"application/vnd.syncml.dmddf+wbxml\":{\"source\":\"iana\"},\"application/vnd.syncml.dmddf+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ddf\"]},\"application/vnd.syncml.dmtnds+wbxml\":{\"source\":\"iana\"},\"application/vnd.syncml.dmtnds+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.syncml.ds.notification\":{\"source\":\"iana\"},\"application/vnd.tableschema+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.tao.intent-module-archive\":{\"source\":\"iana\",\"extensions\":[\"tao\"]},\"application/vnd.tcpdump.pcap\":{\"source\":\"iana\",\"extensions\":[\"pcap\",\"cap\",\"dmp\"]},\"application/vnd.think-cell.ppttc+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.tmd.mediaflex.api+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.tml\":{\"source\":\"iana\"},\"application/vnd.tmobile-livetv\":{\"source\":\"iana\",\"extensions\":[\"tmo\"]},\"application/vnd.tri.onesource\":{\"source\":\"iana\"},\"application/vnd.trid.tpt\":{\"source\":\"iana\",\"extensions\":[\"tpt\"]},\"application/vnd.triscape.mxs\":{\"source\":\"iana\",\"extensions\":[\"mxs\"]},\"application/vnd.trueapp\":{\"source\":\"iana\",\"extensions\":[\"tra\"]},\"application/vnd.truedoc\":{\"source\":\"iana\"},\"application/vnd.ubisoft.webplayer\":{\"source\":\"iana\"},\"application/vnd.ufdl\":{\"source\":\"iana\",\"extensions\":[\"ufd\",\"ufdl\"]},\"application/vnd.uiq.theme\":{\"source\":\"iana\",\"extensions\":[\"utz\"]},\"application/vnd.umajin\":{\"source\":\"iana\",\"extensions\":[\"umj\"]},\"application/vnd.unity\":{\"source\":\"iana\",\"extensions\":[\"unityweb\"]},\"application/vnd.uoml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"uoml\"]},\"application/vnd.uplanet.alert\":{\"source\":\"iana\"},\"application/vnd.uplanet.alert-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.bearer-choice\":{\"source\":\"iana\"},\"application/vnd.uplanet.bearer-choice-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.cacheop\":{\"source\":\"iana\"},\"application/vnd.uplanet.cacheop-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.channel\":{\"source\":\"iana\"},\"application/vnd.uplanet.channel-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.list\":{\"source\":\"iana\"},\"application/vnd.uplanet.list-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.listcmd\":{\"source\":\"iana\"},\"application/vnd.uplanet.listcmd-wbxml\":{\"source\":\"iana\"},\"application/vnd.uplanet.signal\":{\"source\":\"iana\"},\"application/vnd.uri-map\":{\"source\":\"iana\"},\"application/vnd.valve.source.material\":{\"source\":\"iana\"},\"application/vnd.vcx\":{\"source\":\"iana\",\"extensions\":[\"vcx\"]},\"application/vnd.vd-study\":{\"source\":\"iana\"},\"application/vnd.vectorworks\":{\"source\":\"iana\"},\"application/vnd.vel+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.verimatrix.vcas\":{\"source\":\"iana\"},\"application/vnd.veryant.thin\":{\"source\":\"iana\"},\"application/vnd.ves.encrypted\":{\"source\":\"iana\"},\"application/vnd.vidsoft.vidconference\":{\"source\":\"iana\"},\"application/vnd.visio\":{\"source\":\"iana\",\"extensions\":[\"vsd\",\"vst\",\"vss\",\"vsw\"]},\"application/vnd.visionary\":{\"source\":\"iana\",\"extensions\":[\"vis\"]},\"application/vnd.vividence.scriptfile\":{\"source\":\"iana\"},\"application/vnd.vsf\":{\"source\":\"iana\",\"extensions\":[\"vsf\"]},\"application/vnd.wap.sic\":{\"source\":\"iana\"},\"application/vnd.wap.slc\":{\"source\":\"iana\"},\"application/vnd.wap.wbxml\":{\"source\":\"iana\",\"extensions\":[\"wbxml\"]},\"application/vnd.wap.wmlc\":{\"source\":\"iana\",\"extensions\":[\"wmlc\"]},\"application/vnd.wap.wmlscriptc\":{\"source\":\"iana\",\"extensions\":[\"wmlsc\"]},\"application/vnd.webturbo\":{\"source\":\"iana\",\"extensions\":[\"wtb\"]},\"application/vnd.wfa.p2p\":{\"source\":\"iana\"},\"application/vnd.wfa.wsc\":{\"source\":\"iana\"},\"application/vnd.windows.devicepairing\":{\"source\":\"iana\"},\"application/vnd.wmc\":{\"source\":\"iana\"},\"application/vnd.wmf.bootstrap\":{\"source\":\"iana\"},\"application/vnd.wolfram.mathematica\":{\"source\":\"iana\"},\"application/vnd.wolfram.mathematica.package\":{\"source\":\"iana\"},\"application/vnd.wolfram.player\":{\"source\":\"iana\",\"extensions\":[\"nbp\"]},\"application/vnd.wordperfect\":{\"source\":\"iana\",\"extensions\":[\"wpd\"]},\"application/vnd.wqd\":{\"source\":\"iana\",\"extensions\":[\"wqd\"]},\"application/vnd.wrq-hp3000-labelled\":{\"source\":\"iana\"},\"application/vnd.wt.stf\":{\"source\":\"iana\",\"extensions\":[\"stf\"]},\"application/vnd.wv.csp+wbxml\":{\"source\":\"iana\"},\"application/vnd.wv.csp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.wv.ssp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.xacml+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.xara\":{\"source\":\"iana\",\"extensions\":[\"xar\"]},\"application/vnd.xfdl\":{\"source\":\"iana\",\"extensions\":[\"xfdl\"]},\"application/vnd.xfdl.webform\":{\"source\":\"iana\"},\"application/vnd.xmi+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/vnd.xmpie.cpkg\":{\"source\":\"iana\"},\"application/vnd.xmpie.dpkg\":{\"source\":\"iana\"},\"application/vnd.xmpie.plan\":{\"source\":\"iana\"},\"application/vnd.xmpie.ppkg\":{\"source\":\"iana\"},\"application/vnd.xmpie.xlim\":{\"source\":\"iana\"},\"application/vnd.yamaha.hv-dic\":{\"source\":\"iana\",\"extensions\":[\"hvd\"]},\"application/vnd.yamaha.hv-script\":{\"source\":\"iana\",\"extensions\":[\"hvs\"]},\"application/vnd.yamaha.hv-voice\":{\"source\":\"iana\",\"extensions\":[\"hvp\"]},\"application/vnd.yamaha.openscoreformat\":{\"source\":\"iana\",\"extensions\":[\"osf\"]},\"application/vnd.yamaha.openscoreformat.osfpvg+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"osfpvg\"]},\"application/vnd.yamaha.remote-setup\":{\"source\":\"iana\"},\"application/vnd.yamaha.smaf-audio\":{\"source\":\"iana\",\"extensions\":[\"saf\"]},\"application/vnd.yamaha.smaf-phrase\":{\"source\":\"iana\",\"extensions\":[\"spf\"]},\"application/vnd.yamaha.through-ngn\":{\"source\":\"iana\"},\"application/vnd.yamaha.tunnel-udpencap\":{\"source\":\"iana\"},\"application/vnd.yaoweme\":{\"source\":\"iana\"},\"application/vnd.yellowriver-custom-menu\":{\"source\":\"iana\",\"extensions\":[\"cmp\"]},\"application/vnd.youtube.yt\":{\"source\":\"iana\"},\"application/vnd.zul\":{\"source\":\"iana\",\"extensions\":[\"zir\",\"zirz\"]},\"application/vnd.zzazz.deck+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"zaz\"]},\"application/voicexml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"vxml\"]},\"application/voucher-cms+json\":{\"source\":\"iana\",\"compressible\":true},\"application/vq-rtcpxr\":{\"source\":\"iana\"},\"application/wasm\":{\"compressible\":true,\"extensions\":[\"wasm\"]},\"application/watcherinfo+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/webpush-options+json\":{\"source\":\"iana\",\"compressible\":true},\"application/whoispp-query\":{\"source\":\"iana\"},\"application/whoispp-response\":{\"source\":\"iana\"},\"application/widget\":{\"source\":\"iana\",\"extensions\":[\"wgt\"]},\"application/winhlp\":{\"source\":\"apache\",\"extensions\":[\"hlp\"]},\"application/wita\":{\"source\":\"iana\"},\"application/wordperfect5.1\":{\"source\":\"iana\"},\"application/wsdl+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wsdl\"]},\"application/wspolicy+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"wspolicy\"]},\"application/x-7z-compressed\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"7z\"]},\"application/x-abiword\":{\"source\":\"apache\",\"extensions\":[\"abw\"]},\"application/x-ace-compressed\":{\"source\":\"apache\",\"extensions\":[\"ace\"]},\"application/x-amf\":{\"source\":\"apache\"},\"application/x-apple-diskimage\":{\"source\":\"apache\",\"extensions\":[\"dmg\"]},\"application/x-arj\":{\"compressible\":false,\"extensions\":[\"arj\"]},\"application/x-authorware-bin\":{\"source\":\"apache\",\"extensions\":[\"aab\",\"x32\",\"u32\",\"vox\"]},\"application/x-authorware-map\":{\"source\":\"apache\",\"extensions\":[\"aam\"]},\"application/x-authorware-seg\":{\"source\":\"apache\",\"extensions\":[\"aas\"]},\"application/x-bcpio\":{\"source\":\"apache\",\"extensions\":[\"bcpio\"]},\"application/x-bdoc\":{\"compressible\":false,\"extensions\":[\"bdoc\"]},\"application/x-bittorrent\":{\"source\":\"apache\",\"extensions\":[\"torrent\"]},\"application/x-blorb\":{\"source\":\"apache\",\"extensions\":[\"blb\",\"blorb\"]},\"application/x-bzip\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"bz\"]},\"application/x-bzip2\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"bz2\",\"boz\"]},\"application/x-cbr\":{\"source\":\"apache\",\"extensions\":[\"cbr\",\"cba\",\"cbt\",\"cbz\",\"cb7\"]},\"application/x-cdlink\":{\"source\":\"apache\",\"extensions\":[\"vcd\"]},\"application/x-cfs-compressed\":{\"source\":\"apache\",\"extensions\":[\"cfs\"]},\"application/x-chat\":{\"source\":\"apache\",\"extensions\":[\"chat\"]},\"application/x-chess-pgn\":{\"source\":\"apache\",\"extensions\":[\"pgn\"]},\"application/x-chrome-extension\":{\"extensions\":[\"crx\"]},\"application/x-cocoa\":{\"source\":\"nginx\",\"extensions\":[\"cco\"]},\"application/x-compress\":{\"source\":\"apache\"},\"application/x-conference\":{\"source\":\"apache\",\"extensions\":[\"nsc\"]},\"application/x-cpio\":{\"source\":\"apache\",\"extensions\":[\"cpio\"]},\"application/x-csh\":{\"source\":\"apache\",\"extensions\":[\"csh\"]},\"application/x-deb\":{\"compressible\":false},\"application/x-debian-package\":{\"source\":\"apache\",\"extensions\":[\"deb\",\"udeb\"]},\"application/x-dgc-compressed\":{\"source\":\"apache\",\"extensions\":[\"dgc\"]},\"application/x-director\":{\"source\":\"apache\",\"extensions\":[\"dir\",\"dcr\",\"dxr\",\"cst\",\"cct\",\"cxt\",\"w3d\",\"fgd\",\"swa\"]},\"application/x-doom\":{\"source\":\"apache\",\"extensions\":[\"wad\"]},\"application/x-dtbncx+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"ncx\"]},\"application/x-dtbook+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"dtb\"]},\"application/x-dtbresource+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"res\"]},\"application/x-dvi\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"dvi\"]},\"application/x-envoy\":{\"source\":\"apache\",\"extensions\":[\"evy\"]},\"application/x-eva\":{\"source\":\"apache\",\"extensions\":[\"eva\"]},\"application/x-font-bdf\":{\"source\":\"apache\",\"extensions\":[\"bdf\"]},\"application/x-font-dos\":{\"source\":\"apache\"},\"application/x-font-framemaker\":{\"source\":\"apache\"},\"application/x-font-ghostscript\":{\"source\":\"apache\",\"extensions\":[\"gsf\"]},\"application/x-font-libgrx\":{\"source\":\"apache\"},\"application/x-font-linux-psf\":{\"source\":\"apache\",\"extensions\":[\"psf\"]},\"application/x-font-pcf\":{\"source\":\"apache\",\"extensions\":[\"pcf\"]},\"application/x-font-snf\":{\"source\":\"apache\",\"extensions\":[\"snf\"]},\"application/x-font-speedo\":{\"source\":\"apache\"},\"application/x-font-sunos-news\":{\"source\":\"apache\"},\"application/x-font-type1\":{\"source\":\"apache\",\"extensions\":[\"pfa\",\"pfb\",\"pfm\",\"afm\"]},\"application/x-font-vfont\":{\"source\":\"apache\"},\"application/x-freearc\":{\"source\":\"apache\",\"extensions\":[\"arc\"]},\"application/x-futuresplash\":{\"source\":\"apache\",\"extensions\":[\"spl\"]},\"application/x-gca-compressed\":{\"source\":\"apache\",\"extensions\":[\"gca\"]},\"application/x-glulx\":{\"source\":\"apache\",\"extensions\":[\"ulx\"]},\"application/x-gnumeric\":{\"source\":\"apache\",\"extensions\":[\"gnumeric\"]},\"application/x-gramps-xml\":{\"source\":\"apache\",\"extensions\":[\"gramps\"]},\"application/x-gtar\":{\"source\":\"apache\",\"extensions\":[\"gtar\"]},\"application/x-gzip\":{\"source\":\"apache\"},\"application/x-hdf\":{\"source\":\"apache\",\"extensions\":[\"hdf\"]},\"application/x-httpd-php\":{\"compressible\":true,\"extensions\":[\"php\"]},\"application/x-install-instructions\":{\"source\":\"apache\",\"extensions\":[\"install\"]},\"application/x-iso9660-image\":{\"source\":\"apache\",\"extensions\":[\"iso\"]},\"application/x-java-archive-diff\":{\"source\":\"nginx\",\"extensions\":[\"jardiff\"]},\"application/x-java-jnlp-file\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"jnlp\"]},\"application/x-javascript\":{\"compressible\":true},\"application/x-keepass2\":{\"extensions\":[\"kdbx\"]},\"application/x-latex\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"latex\"]},\"application/x-lua-bytecode\":{\"extensions\":[\"luac\"]},\"application/x-lzh-compressed\":{\"source\":\"apache\",\"extensions\":[\"lzh\",\"lha\"]},\"application/x-makeself\":{\"source\":\"nginx\",\"extensions\":[\"run\"]},\"application/x-mie\":{\"source\":\"apache\",\"extensions\":[\"mie\"]},\"application/x-mobipocket-ebook\":{\"source\":\"apache\",\"extensions\":[\"prc\",\"mobi\"]},\"application/x-mpegurl\":{\"compressible\":false},\"application/x-ms-application\":{\"source\":\"apache\",\"extensions\":[\"application\"]},\"application/x-ms-shortcut\":{\"source\":\"apache\",\"extensions\":[\"lnk\"]},\"application/x-ms-wmd\":{\"source\":\"apache\",\"extensions\":[\"wmd\"]},\"application/x-ms-wmz\":{\"source\":\"apache\",\"extensions\":[\"wmz\"]},\"application/x-ms-xbap\":{\"source\":\"apache\",\"extensions\":[\"xbap\"]},\"application/x-msaccess\":{\"source\":\"apache\",\"extensions\":[\"mdb\"]},\"application/x-msbinder\":{\"source\":\"apache\",\"extensions\":[\"obd\"]},\"application/x-mscardfile\":{\"source\":\"apache\",\"extensions\":[\"crd\"]},\"application/x-msclip\":{\"source\":\"apache\",\"extensions\":[\"clp\"]},\"application/x-msdos-program\":{\"extensions\":[\"exe\"]},\"application/x-msdownload\":{\"source\":\"apache\",\"extensions\":[\"exe\",\"dll\",\"com\",\"bat\",\"msi\"]},\"application/x-msmediaview\":{\"source\":\"apache\",\"extensions\":[\"mvb\",\"m13\",\"m14\"]},\"application/x-msmetafile\":{\"source\":\"apache\",\"extensions\":[\"wmf\",\"wmz\",\"emf\",\"emz\"]},\"application/x-msmoney\":{\"source\":\"apache\",\"extensions\":[\"mny\"]},\"application/x-mspublisher\":{\"source\":\"apache\",\"extensions\":[\"pub\"]},\"application/x-msschedule\":{\"source\":\"apache\",\"extensions\":[\"scd\"]},\"application/x-msterminal\":{\"source\":\"apache\",\"extensions\":[\"trm\"]},\"application/x-mswrite\":{\"source\":\"apache\",\"extensions\":[\"wri\"]},\"application/x-netcdf\":{\"source\":\"apache\",\"extensions\":[\"nc\",\"cdf\"]},\"application/x-ns-proxy-autoconfig\":{\"compressible\":true,\"extensions\":[\"pac\"]},\"application/x-nzb\":{\"source\":\"apache\",\"extensions\":[\"nzb\"]},\"application/x-perl\":{\"source\":\"nginx\",\"extensions\":[\"pl\",\"pm\"]},\"application/x-pilot\":{\"source\":\"nginx\",\"extensions\":[\"prc\",\"pdb\"]},\"application/x-pkcs12\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"p12\",\"pfx\"]},\"application/x-pkcs7-certificates\":{\"source\":\"apache\",\"extensions\":[\"p7b\",\"spc\"]},\"application/x-pkcs7-certreqresp\":{\"source\":\"apache\",\"extensions\":[\"p7r\"]},\"application/x-rar-compressed\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"rar\"]},\"application/x-redhat-package-manager\":{\"source\":\"nginx\",\"extensions\":[\"rpm\"]},\"application/x-research-info-systems\":{\"source\":\"apache\",\"extensions\":[\"ris\"]},\"application/x-sea\":{\"source\":\"nginx\",\"extensions\":[\"sea\"]},\"application/x-sh\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"sh\"]},\"application/x-shar\":{\"source\":\"apache\",\"extensions\":[\"shar\"]},\"application/x-shockwave-flash\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"swf\"]},\"application/x-silverlight-app\":{\"source\":\"apache\",\"extensions\":[\"xap\"]},\"application/x-sql\":{\"source\":\"apache\",\"extensions\":[\"sql\"]},\"application/x-stuffit\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"sit\"]},\"application/x-stuffitx\":{\"source\":\"apache\",\"extensions\":[\"sitx\"]},\"application/x-subrip\":{\"source\":\"apache\",\"extensions\":[\"srt\"]},\"application/x-sv4cpio\":{\"source\":\"apache\",\"extensions\":[\"sv4cpio\"]},\"application/x-sv4crc\":{\"source\":\"apache\",\"extensions\":[\"sv4crc\"]},\"application/x-t3vm-image\":{\"source\":\"apache\",\"extensions\":[\"t3\"]},\"application/x-tads\":{\"source\":\"apache\",\"extensions\":[\"gam\"]},\"application/x-tar\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"tar\"]},\"application/x-tcl\":{\"source\":\"apache\",\"extensions\":[\"tcl\",\"tk\"]},\"application/x-tex\":{\"source\":\"apache\",\"extensions\":[\"tex\"]},\"application/x-tex-tfm\":{\"source\":\"apache\",\"extensions\":[\"tfm\"]},\"application/x-texinfo\":{\"source\":\"apache\",\"extensions\":[\"texinfo\",\"texi\"]},\"application/x-tgif\":{\"source\":\"apache\",\"extensions\":[\"obj\"]},\"application/x-ustar\":{\"source\":\"apache\",\"extensions\":[\"ustar\"]},\"application/x-virtualbox-hdd\":{\"compressible\":true,\"extensions\":[\"hdd\"]},\"application/x-virtualbox-ova\":{\"compressible\":true,\"extensions\":[\"ova\"]},\"application/x-virtualbox-ovf\":{\"compressible\":true,\"extensions\":[\"ovf\"]},\"application/x-virtualbox-vbox\":{\"compressible\":true,\"extensions\":[\"vbox\"]},\"application/x-virtualbox-vbox-extpack\":{\"compressible\":false,\"extensions\":[\"vbox-extpack\"]},\"application/x-virtualbox-vdi\":{\"compressible\":true,\"extensions\":[\"vdi\"]},\"application/x-virtualbox-vhd\":{\"compressible\":true,\"extensions\":[\"vhd\"]},\"application/x-virtualbox-vmdk\":{\"compressible\":true,\"extensions\":[\"vmdk\"]},\"application/x-wais-source\":{\"source\":\"apache\",\"extensions\":[\"src\"]},\"application/x-web-app-manifest+json\":{\"compressible\":true,\"extensions\":[\"webapp\"]},\"application/x-www-form-urlencoded\":{\"source\":\"iana\",\"compressible\":true},\"application/x-x509-ca-cert\":{\"source\":\"apache\",\"extensions\":[\"der\",\"crt\",\"pem\"]},\"application/x-xfig\":{\"source\":\"apache\",\"extensions\":[\"fig\"]},\"application/x-xliff+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xlf\"]},\"application/x-xpinstall\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"xpi\"]},\"application/x-xz\":{\"source\":\"apache\",\"extensions\":[\"xz\"]},\"application/x-zmachine\":{\"source\":\"apache\",\"extensions\":[\"z1\",\"z2\",\"z3\",\"z4\",\"z5\",\"z6\",\"z7\",\"z8\"]},\"application/x400-bp\":{\"source\":\"iana\"},\"application/xacml+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xaml+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xaml\"]},\"application/xcap-att+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xav\"]},\"application/xcap-caps+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xca\"]},\"application/xcap-diff+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xdf\"]},\"application/xcap-el+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xel\"]},\"application/xcap-error+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xer\"]},\"application/xcap-ns+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xns\"]},\"application/xcon-conference-info+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xcon-conference-info-diff+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xenc+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xenc\"]},\"application/xhtml+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xhtml\",\"xht\"]},\"application/xhtml-voice+xml\":{\"source\":\"apache\",\"compressible\":true},\"application/xliff+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xlf\"]},\"application/xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xml\",\"xsl\",\"xsd\",\"rng\"]},\"application/xml-dtd\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dtd\"]},\"application/xml-external-parsed-entity\":{\"source\":\"iana\"},\"application/xml-patch+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xmpp+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/xop+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xop\"]},\"application/xproc+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xpl\"]},\"application/xslt+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xslt\"]},\"application/xspf+xml\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"xspf\"]},\"application/xv+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"mxml\",\"xhvml\",\"xvml\",\"xvm\"]},\"application/yang\":{\"source\":\"iana\",\"extensions\":[\"yang\"]},\"application/yang-data+json\":{\"source\":\"iana\",\"compressible\":true},\"application/yang-data+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/yang-patch+json\":{\"source\":\"iana\",\"compressible\":true},\"application/yang-patch+xml\":{\"source\":\"iana\",\"compressible\":true},\"application/yin+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"yin\"]},\"application/zip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"zip\"]},\"application/zlib\":{\"source\":\"iana\"},\"application/zstd\":{\"source\":\"iana\"},\"audio/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"audio/32kadpcm\":{\"source\":\"iana\"},\"audio/3gpp\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"3gpp\"]},\"audio/3gpp2\":{\"source\":\"iana\"},\"audio/aac\":{\"source\":\"iana\"},\"audio/ac3\":{\"source\":\"iana\"},\"audio/adpcm\":{\"source\":\"apache\",\"extensions\":[\"adp\"]},\"audio/amr\":{\"source\":\"iana\"},\"audio/amr-wb\":{\"source\":\"iana\"},\"audio/amr-wb+\":{\"source\":\"iana\"},\"audio/aptx\":{\"source\":\"iana\"},\"audio/asc\":{\"source\":\"iana\"},\"audio/atrac-advanced-lossless\":{\"source\":\"iana\"},\"audio/atrac-x\":{\"source\":\"iana\"},\"audio/atrac3\":{\"source\":\"iana\"},\"audio/basic\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"au\",\"snd\"]},\"audio/bv16\":{\"source\":\"iana\"},\"audio/bv32\":{\"source\":\"iana\"},\"audio/clearmode\":{\"source\":\"iana\"},\"audio/cn\":{\"source\":\"iana\"},\"audio/dat12\":{\"source\":\"iana\"},\"audio/dls\":{\"source\":\"iana\"},\"audio/dsr-es201108\":{\"source\":\"iana\"},\"audio/dsr-es202050\":{\"source\":\"iana\"},\"audio/dsr-es202211\":{\"source\":\"iana\"},\"audio/dsr-es202212\":{\"source\":\"iana\"},\"audio/dv\":{\"source\":\"iana\"},\"audio/dvi4\":{\"source\":\"iana\"},\"audio/eac3\":{\"source\":\"iana\"},\"audio/encaprtp\":{\"source\":\"iana\"},\"audio/evrc\":{\"source\":\"iana\"},\"audio/evrc-qcp\":{\"source\":\"iana\"},\"audio/evrc0\":{\"source\":\"iana\"},\"audio/evrc1\":{\"source\":\"iana\"},\"audio/evrcb\":{\"source\":\"iana\"},\"audio/evrcb0\":{\"source\":\"iana\"},\"audio/evrcb1\":{\"source\":\"iana\"},\"audio/evrcnw\":{\"source\":\"iana\"},\"audio/evrcnw0\":{\"source\":\"iana\"},\"audio/evrcnw1\":{\"source\":\"iana\"},\"audio/evrcwb\":{\"source\":\"iana\"},\"audio/evrcwb0\":{\"source\":\"iana\"},\"audio/evrcwb1\":{\"source\":\"iana\"},\"audio/evs\":{\"source\":\"iana\"},\"audio/flexfec\":{\"source\":\"iana\"},\"audio/fwdred\":{\"source\":\"iana\"},\"audio/g711-0\":{\"source\":\"iana\"},\"audio/g719\":{\"source\":\"iana\"},\"audio/g722\":{\"source\":\"iana\"},\"audio/g7221\":{\"source\":\"iana\"},\"audio/g723\":{\"source\":\"iana\"},\"audio/g726-16\":{\"source\":\"iana\"},\"audio/g726-24\":{\"source\":\"iana\"},\"audio/g726-32\":{\"source\":\"iana\"},\"audio/g726-40\":{\"source\":\"iana\"},\"audio/g728\":{\"source\":\"iana\"},\"audio/g729\":{\"source\":\"iana\"},\"audio/g7291\":{\"source\":\"iana\"},\"audio/g729d\":{\"source\":\"iana\"},\"audio/g729e\":{\"source\":\"iana\"},\"audio/gsm\":{\"source\":\"iana\"},\"audio/gsm-efr\":{\"source\":\"iana\"},\"audio/gsm-hr-08\":{\"source\":\"iana\"},\"audio/ilbc\":{\"source\":\"iana\"},\"audio/ip-mr_v2.5\":{\"source\":\"iana\"},\"audio/isac\":{\"source\":\"apache\"},\"audio/l16\":{\"source\":\"iana\"},\"audio/l20\":{\"source\":\"iana\"},\"audio/l24\":{\"source\":\"iana\",\"compressible\":false},\"audio/l8\":{\"source\":\"iana\"},\"audio/lpc\":{\"source\":\"iana\"},\"audio/melp\":{\"source\":\"iana\"},\"audio/melp1200\":{\"source\":\"iana\"},\"audio/melp2400\":{\"source\":\"iana\"},\"audio/melp600\":{\"source\":\"iana\"},\"audio/midi\":{\"source\":\"apache\",\"extensions\":[\"mid\",\"midi\",\"kar\",\"rmi\"]},\"audio/mobile-xmf\":{\"source\":\"iana\",\"extensions\":[\"mxmf\"]},\"audio/mp3\":{\"compressible\":false,\"extensions\":[\"mp3\"]},\"audio/mp4\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"m4a\",\"mp4a\"]},\"audio/mp4a-latm\":{\"source\":\"iana\"},\"audio/mpa\":{\"source\":\"iana\"},\"audio/mpa-robust\":{\"source\":\"iana\"},\"audio/mpeg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"mpga\",\"mp2\",\"mp2a\",\"mp3\",\"m2a\",\"m3a\"]},\"audio/mpeg4-generic\":{\"source\":\"iana\"},\"audio/musepack\":{\"source\":\"apache\"},\"audio/ogg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"oga\",\"ogg\",\"spx\"]},\"audio/opus\":{\"source\":\"iana\"},\"audio/parityfec\":{\"source\":\"iana\"},\"audio/pcma\":{\"source\":\"iana\"},\"audio/pcma-wb\":{\"source\":\"iana\"},\"audio/pcmu\":{\"source\":\"iana\"},\"audio/pcmu-wb\":{\"source\":\"iana\"},\"audio/prs.sid\":{\"source\":\"iana\"},\"audio/qcelp\":{\"source\":\"iana\"},\"audio/raptorfec\":{\"source\":\"iana\"},\"audio/red\":{\"source\":\"iana\"},\"audio/rtp-enc-aescm128\":{\"source\":\"iana\"},\"audio/rtp-midi\":{\"source\":\"iana\"},\"audio/rtploopback\":{\"source\":\"iana\"},\"audio/rtx\":{\"source\":\"iana\"},\"audio/s3m\":{\"source\":\"apache\",\"extensions\":[\"s3m\"]},\"audio/silk\":{\"source\":\"apache\",\"extensions\":[\"sil\"]},\"audio/smv\":{\"source\":\"iana\"},\"audio/smv-qcp\":{\"source\":\"iana\"},\"audio/smv0\":{\"source\":\"iana\"},\"audio/sp-midi\":{\"source\":\"iana\"},\"audio/speex\":{\"source\":\"iana\"},\"audio/t140c\":{\"source\":\"iana\"},\"audio/t38\":{\"source\":\"iana\"},\"audio/telephone-event\":{\"source\":\"iana\"},\"audio/tetra_acelp\":{\"source\":\"iana\"},\"audio/tone\":{\"source\":\"iana\"},\"audio/uemclip\":{\"source\":\"iana\"},\"audio/ulpfec\":{\"source\":\"iana\"},\"audio/usac\":{\"source\":\"iana\"},\"audio/vdvi\":{\"source\":\"iana\"},\"audio/vmr-wb\":{\"source\":\"iana\"},\"audio/vnd.3gpp.iufp\":{\"source\":\"iana\"},\"audio/vnd.4sb\":{\"source\":\"iana\"},\"audio/vnd.audiokoz\":{\"source\":\"iana\"},\"audio/vnd.celp\":{\"source\":\"iana\"},\"audio/vnd.cisco.nse\":{\"source\":\"iana\"},\"audio/vnd.cmles.radio-events\":{\"source\":\"iana\"},\"audio/vnd.cns.anp1\":{\"source\":\"iana\"},\"audio/vnd.cns.inf1\":{\"source\":\"iana\"},\"audio/vnd.dece.audio\":{\"source\":\"iana\",\"extensions\":[\"uva\",\"uvva\"]},\"audio/vnd.digital-winds\":{\"source\":\"iana\",\"extensions\":[\"eol\"]},\"audio/vnd.dlna.adts\":{\"source\":\"iana\"},\"audio/vnd.dolby.heaac.1\":{\"source\":\"iana\"},\"audio/vnd.dolby.heaac.2\":{\"source\":\"iana\"},\"audio/vnd.dolby.mlp\":{\"source\":\"iana\"},\"audio/vnd.dolby.mps\":{\"source\":\"iana\"},\"audio/vnd.dolby.pl2\":{\"source\":\"iana\"},\"audio/vnd.dolby.pl2x\":{\"source\":\"iana\"},\"audio/vnd.dolby.pl2z\":{\"source\":\"iana\"},\"audio/vnd.dolby.pulse.1\":{\"source\":\"iana\"},\"audio/vnd.dra\":{\"source\":\"iana\",\"extensions\":[\"dra\"]},\"audio/vnd.dts\":{\"source\":\"iana\",\"extensions\":[\"dts\"]},\"audio/vnd.dts.hd\":{\"source\":\"iana\",\"extensions\":[\"dtshd\"]},\"audio/vnd.dts.uhd\":{\"source\":\"iana\"},\"audio/vnd.dvb.file\":{\"source\":\"iana\"},\"audio/vnd.everad.plj\":{\"source\":\"iana\"},\"audio/vnd.hns.audio\":{\"source\":\"iana\"},\"audio/vnd.lucent.voice\":{\"source\":\"iana\",\"extensions\":[\"lvp\"]},\"audio/vnd.ms-playready.media.pya\":{\"source\":\"iana\",\"extensions\":[\"pya\"]},\"audio/vnd.nokia.mobile-xmf\":{\"source\":\"iana\"},\"audio/vnd.nortel.vbk\":{\"source\":\"iana\"},\"audio/vnd.nuera.ecelp4800\":{\"source\":\"iana\",\"extensions\":[\"ecelp4800\"]},\"audio/vnd.nuera.ecelp7470\":{\"source\":\"iana\",\"extensions\":[\"ecelp7470\"]},\"audio/vnd.nuera.ecelp9600\":{\"source\":\"iana\",\"extensions\":[\"ecelp9600\"]},\"audio/vnd.octel.sbc\":{\"source\":\"iana\"},\"audio/vnd.presonus.multitrack\":{\"source\":\"iana\"},\"audio/vnd.qcelp\":{\"source\":\"iana\"},\"audio/vnd.rhetorex.32kadpcm\":{\"source\":\"iana\"},\"audio/vnd.rip\":{\"source\":\"iana\",\"extensions\":[\"rip\"]},\"audio/vnd.rn-realaudio\":{\"compressible\":false},\"audio/vnd.sealedmedia.softseal.mpeg\":{\"source\":\"iana\"},\"audio/vnd.vmx.cvsd\":{\"source\":\"iana\"},\"audio/vnd.wave\":{\"compressible\":false},\"audio/vorbis\":{\"source\":\"iana\",\"compressible\":false},\"audio/vorbis-config\":{\"source\":\"iana\"},\"audio/wav\":{\"compressible\":false,\"extensions\":[\"wav\"]},\"audio/wave\":{\"compressible\":false,\"extensions\":[\"wav\"]},\"audio/webm\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"weba\"]},\"audio/x-aac\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"aac\"]},\"audio/x-aiff\":{\"source\":\"apache\",\"extensions\":[\"aif\",\"aiff\",\"aifc\"]},\"audio/x-caf\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"caf\"]},\"audio/x-flac\":{\"source\":\"apache\",\"extensions\":[\"flac\"]},\"audio/x-m4a\":{\"source\":\"nginx\",\"extensions\":[\"m4a\"]},\"audio/x-matroska\":{\"source\":\"apache\",\"extensions\":[\"mka\"]},\"audio/x-mpegurl\":{\"source\":\"apache\",\"extensions\":[\"m3u\"]},\"audio/x-ms-wax\":{\"source\":\"apache\",\"extensions\":[\"wax\"]},\"audio/x-ms-wma\":{\"source\":\"apache\",\"extensions\":[\"wma\"]},\"audio/x-pn-realaudio\":{\"source\":\"apache\",\"extensions\":[\"ram\",\"ra\"]},\"audio/x-pn-realaudio-plugin\":{\"source\":\"apache\",\"extensions\":[\"rmp\"]},\"audio/x-realaudio\":{\"source\":\"nginx\",\"extensions\":[\"ra\"]},\"audio/x-tta\":{\"source\":\"apache\"},\"audio/x-wav\":{\"source\":\"apache\",\"extensions\":[\"wav\"]},\"audio/xm\":{\"source\":\"apache\",\"extensions\":[\"xm\"]},\"chemical/x-cdx\":{\"source\":\"apache\",\"extensions\":[\"cdx\"]},\"chemical/x-cif\":{\"source\":\"apache\",\"extensions\":[\"cif\"]},\"chemical/x-cmdf\":{\"source\":\"apache\",\"extensions\":[\"cmdf\"]},\"chemical/x-cml\":{\"source\":\"apache\",\"extensions\":[\"cml\"]},\"chemical/x-csml\":{\"source\":\"apache\",\"extensions\":[\"csml\"]},\"chemical/x-pdb\":{\"source\":\"apache\"},\"chemical/x-xyz\":{\"source\":\"apache\",\"extensions\":[\"xyz\"]},\"font/collection\":{\"source\":\"iana\",\"extensions\":[\"ttc\"]},\"font/otf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"otf\"]},\"font/sfnt\":{\"source\":\"iana\"},\"font/ttf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"ttf\"]},\"font/woff\":{\"source\":\"iana\",\"extensions\":[\"woff\"]},\"font/woff2\":{\"source\":\"iana\",\"extensions\":[\"woff2\"]},\"image/aces\":{\"source\":\"iana\",\"extensions\":[\"exr\"]},\"image/apng\":{\"compressible\":false,\"extensions\":[\"apng\"]},\"image/avci\":{\"source\":\"iana\"},\"image/avcs\":{\"source\":\"iana\"},\"image/bmp\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"bmp\"]},\"image/cgm\":{\"source\":\"iana\",\"extensions\":[\"cgm\"]},\"image/dicom-rle\":{\"source\":\"iana\",\"extensions\":[\"drle\"]},\"image/emf\":{\"source\":\"iana\",\"extensions\":[\"emf\"]},\"image/fits\":{\"source\":\"iana\",\"extensions\":[\"fits\"]},\"image/g3fax\":{\"source\":\"iana\",\"extensions\":[\"g3\"]},\"image/gif\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"gif\"]},\"image/heic\":{\"source\":\"iana\",\"extensions\":[\"heic\"]},\"image/heic-sequence\":{\"source\":\"iana\",\"extensions\":[\"heics\"]},\"image/heif\":{\"source\":\"iana\",\"extensions\":[\"heif\"]},\"image/heif-sequence\":{\"source\":\"iana\",\"extensions\":[\"heifs\"]},\"image/hej2k\":{\"source\":\"iana\",\"extensions\":[\"hej2\"]},\"image/hsj2\":{\"source\":\"iana\",\"extensions\":[\"hsj2\"]},\"image/ief\":{\"source\":\"iana\",\"extensions\":[\"ief\"]},\"image/jls\":{\"source\":\"iana\",\"extensions\":[\"jls\"]},\"image/jp2\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jp2\",\"jpg2\"]},\"image/jpeg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jpeg\",\"jpg\",\"jpe\"]},\"image/jph\":{\"source\":\"iana\",\"extensions\":[\"jph\"]},\"image/jphc\":{\"source\":\"iana\",\"extensions\":[\"jhc\"]},\"image/jpm\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jpm\"]},\"image/jpx\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"jpx\",\"jpf\"]},\"image/jxr\":{\"source\":\"iana\",\"extensions\":[\"jxr\"]},\"image/jxra\":{\"source\":\"iana\",\"extensions\":[\"jxra\"]},\"image/jxrs\":{\"source\":\"iana\",\"extensions\":[\"jxrs\"]},\"image/jxs\":{\"source\":\"iana\",\"extensions\":[\"jxs\"]},\"image/jxsc\":{\"source\":\"iana\",\"extensions\":[\"jxsc\"]},\"image/jxsi\":{\"source\":\"iana\",\"extensions\":[\"jxsi\"]},\"image/jxss\":{\"source\":\"iana\",\"extensions\":[\"jxss\"]},\"image/ktx\":{\"source\":\"iana\",\"extensions\":[\"ktx\"]},\"image/naplps\":{\"source\":\"iana\"},\"image/pjpeg\":{\"compressible\":false},\"image/png\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"png\"]},\"image/prs.btif\":{\"source\":\"iana\",\"extensions\":[\"btif\"]},\"image/prs.pti\":{\"source\":\"iana\",\"extensions\":[\"pti\"]},\"image/pwg-raster\":{\"source\":\"iana\"},\"image/sgi\":{\"source\":\"apache\",\"extensions\":[\"sgi\"]},\"image/svg+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"svg\",\"svgz\"]},\"image/t38\":{\"source\":\"iana\",\"extensions\":[\"t38\"]},\"image/tiff\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"tif\",\"tiff\"]},\"image/tiff-fx\":{\"source\":\"iana\",\"extensions\":[\"tfx\"]},\"image/vnd.adobe.photoshop\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"psd\"]},\"image/vnd.airzip.accelerator.azv\":{\"source\":\"iana\",\"extensions\":[\"azv\"]},\"image/vnd.cns.inf2\":{\"source\":\"iana\"},\"image/vnd.dece.graphic\":{\"source\":\"iana\",\"extensions\":[\"uvi\",\"uvvi\",\"uvg\",\"uvvg\"]},\"image/vnd.djvu\":{\"source\":\"iana\",\"extensions\":[\"djvu\",\"djv\"]},\"image/vnd.dvb.subtitle\":{\"source\":\"iana\",\"extensions\":[\"sub\"]},\"image/vnd.dwg\":{\"source\":\"iana\",\"extensions\":[\"dwg\"]},\"image/vnd.dxf\":{\"source\":\"iana\",\"extensions\":[\"dxf\"]},\"image/vnd.fastbidsheet\":{\"source\":\"iana\",\"extensions\":[\"fbs\"]},\"image/vnd.fpx\":{\"source\":\"iana\",\"extensions\":[\"fpx\"]},\"image/vnd.fst\":{\"source\":\"iana\",\"extensions\":[\"fst\"]},\"image/vnd.fujixerox.edmics-mmr\":{\"source\":\"iana\",\"extensions\":[\"mmr\"]},\"image/vnd.fujixerox.edmics-rlc\":{\"source\":\"iana\",\"extensions\":[\"rlc\"]},\"image/vnd.globalgraphics.pgb\":{\"source\":\"iana\"},\"image/vnd.microsoft.icon\":{\"source\":\"iana\",\"extensions\":[\"ico\"]},\"image/vnd.mix\":{\"source\":\"iana\"},\"image/vnd.mozilla.apng\":{\"source\":\"iana\"},\"image/vnd.ms-dds\":{\"extensions\":[\"dds\"]},\"image/vnd.ms-modi\":{\"source\":\"iana\",\"extensions\":[\"mdi\"]},\"image/vnd.ms-photo\":{\"source\":\"apache\",\"extensions\":[\"wdp\"]},\"image/vnd.net-fpx\":{\"source\":\"iana\",\"extensions\":[\"npx\"]},\"image/vnd.radiance\":{\"source\":\"iana\"},\"image/vnd.sealed.png\":{\"source\":\"iana\"},\"image/vnd.sealedmedia.softseal.gif\":{\"source\":\"iana\"},\"image/vnd.sealedmedia.softseal.jpg\":{\"source\":\"iana\"},\"image/vnd.svf\":{\"source\":\"iana\"},\"image/vnd.tencent.tap\":{\"source\":\"iana\",\"extensions\":[\"tap\"]},\"image/vnd.valve.source.texture\":{\"source\":\"iana\",\"extensions\":[\"vtf\"]},\"image/vnd.wap.wbmp\":{\"source\":\"iana\",\"extensions\":[\"wbmp\"]},\"image/vnd.xiff\":{\"source\":\"iana\",\"extensions\":[\"xif\"]},\"image/vnd.zbrush.pcx\":{\"source\":\"iana\",\"extensions\":[\"pcx\"]},\"image/webp\":{\"source\":\"apache\",\"extensions\":[\"webp\"]},\"image/wmf\":{\"source\":\"iana\",\"extensions\":[\"wmf\"]},\"image/x-3ds\":{\"source\":\"apache\",\"extensions\":[\"3ds\"]},\"image/x-cmu-raster\":{\"source\":\"apache\",\"extensions\":[\"ras\"]},\"image/x-cmx\":{\"source\":\"apache\",\"extensions\":[\"cmx\"]},\"image/x-freehand\":{\"source\":\"apache\",\"extensions\":[\"fh\",\"fhc\",\"fh4\",\"fh5\",\"fh7\"]},\"image/x-icon\":{\"source\":\"apache\",\"compressible\":true,\"extensions\":[\"ico\"]},\"image/x-jng\":{\"source\":\"nginx\",\"extensions\":[\"jng\"]},\"image/x-mrsid-image\":{\"source\":\"apache\",\"extensions\":[\"sid\"]},\"image/x-ms-bmp\":{\"source\":\"nginx\",\"compressible\":true,\"extensions\":[\"bmp\"]},\"image/x-pcx\":{\"source\":\"apache\",\"extensions\":[\"pcx\"]},\"image/x-pict\":{\"source\":\"apache\",\"extensions\":[\"pic\",\"pct\"]},\"image/x-portable-anymap\":{\"source\":\"apache\",\"extensions\":[\"pnm\"]},\"image/x-portable-bitmap\":{\"source\":\"apache\",\"extensions\":[\"pbm\"]},\"image/x-portable-graymap\":{\"source\":\"apache\",\"extensions\":[\"pgm\"]},\"image/x-portable-pixmap\":{\"source\":\"apache\",\"extensions\":[\"ppm\"]},\"image/x-rgb\":{\"source\":\"apache\",\"extensions\":[\"rgb\"]},\"image/x-tga\":{\"source\":\"apache\",\"extensions\":[\"tga\"]},\"image/x-xbitmap\":{\"source\":\"apache\",\"extensions\":[\"xbm\"]},\"image/x-xcf\":{\"compressible\":false},\"image/x-xpixmap\":{\"source\":\"apache\",\"extensions\":[\"xpm\"]},\"image/x-xwindowdump\":{\"source\":\"apache\",\"extensions\":[\"xwd\"]},\"message/cpim\":{\"source\":\"iana\"},\"message/delivery-status\":{\"source\":\"iana\"},\"message/disposition-notification\":{\"source\":\"iana\",\"extensions\":[\"disposition-notification\"]},\"message/external-body\":{\"source\":\"iana\"},\"message/feedback-report\":{\"source\":\"iana\"},\"message/global\":{\"source\":\"iana\",\"extensions\":[\"u8msg\"]},\"message/global-delivery-status\":{\"source\":\"iana\",\"extensions\":[\"u8dsn\"]},\"message/global-disposition-notification\":{\"source\":\"iana\",\"extensions\":[\"u8mdn\"]},\"message/global-headers\":{\"source\":\"iana\",\"extensions\":[\"u8hdr\"]},\"message/http\":{\"source\":\"iana\",\"compressible\":false},\"message/imdn+xml\":{\"source\":\"iana\",\"compressible\":true},\"message/news\":{\"source\":\"iana\"},\"message/partial\":{\"source\":\"iana\",\"compressible\":false},\"message/rfc822\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"eml\",\"mime\"]},\"message/s-http\":{\"source\":\"iana\"},\"message/sip\":{\"source\":\"iana\"},\"message/sipfrag\":{\"source\":\"iana\"},\"message/tracking-status\":{\"source\":\"iana\"},\"message/vnd.si.simp\":{\"source\":\"iana\"},\"message/vnd.wfa.wsc\":{\"source\":\"iana\",\"extensions\":[\"wsc\"]},\"model/3mf\":{\"source\":\"iana\",\"extensions\":[\"3mf\"]},\"model/gltf+json\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"gltf\"]},\"model/gltf-binary\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"glb\"]},\"model/iges\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"igs\",\"iges\"]},\"model/mesh\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"msh\",\"mesh\",\"silo\"]},\"model/stl\":{\"source\":\"iana\",\"extensions\":[\"stl\"]},\"model/vnd.collada+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"dae\"]},\"model/vnd.dwf\":{\"source\":\"iana\",\"extensions\":[\"dwf\"]},\"model/vnd.flatland.3dml\":{\"source\":\"iana\"},\"model/vnd.gdl\":{\"source\":\"iana\",\"extensions\":[\"gdl\"]},\"model/vnd.gs-gdl\":{\"source\":\"apache\"},\"model/vnd.gs.gdl\":{\"source\":\"iana\"},\"model/vnd.gtw\":{\"source\":\"iana\",\"extensions\":[\"gtw\"]},\"model/vnd.moml+xml\":{\"source\":\"iana\",\"compressible\":true},\"model/vnd.mts\":{\"source\":\"iana\",\"extensions\":[\"mts\"]},\"model/vnd.opengex\":{\"source\":\"iana\",\"extensions\":[\"ogex\"]},\"model/vnd.parasolid.transmit.binary\":{\"source\":\"iana\",\"extensions\":[\"x_b\"]},\"model/vnd.parasolid.transmit.text\":{\"source\":\"iana\",\"extensions\":[\"x_t\"]},\"model/vnd.rosette.annotated-data-model\":{\"source\":\"iana\"},\"model/vnd.usdz+zip\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"usdz\"]},\"model/vnd.valve.source.compiled-map\":{\"source\":\"iana\",\"extensions\":[\"bsp\"]},\"model/vnd.vtu\":{\"source\":\"iana\",\"extensions\":[\"vtu\"]},\"model/vrml\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"wrl\",\"vrml\"]},\"model/x3d+binary\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"x3db\",\"x3dbz\"]},\"model/x3d+fastinfoset\":{\"source\":\"iana\",\"extensions\":[\"x3db\"]},\"model/x3d+vrml\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"x3dv\",\"x3dvz\"]},\"model/x3d+xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"x3d\",\"x3dz\"]},\"model/x3d-vrml\":{\"source\":\"iana\",\"extensions\":[\"x3dv\"]},\"multipart/alternative\":{\"source\":\"iana\",\"compressible\":false},\"multipart/appledouble\":{\"source\":\"iana\"},\"multipart/byteranges\":{\"source\":\"iana\"},\"multipart/digest\":{\"source\":\"iana\"},\"multipart/encrypted\":{\"source\":\"iana\",\"compressible\":false},\"multipart/form-data\":{\"source\":\"iana\",\"compressible\":false},\"multipart/header-set\":{\"source\":\"iana\"},\"multipart/mixed\":{\"source\":\"iana\"},\"multipart/multilingual\":{\"source\":\"iana\"},\"multipart/parallel\":{\"source\":\"iana\"},\"multipart/related\":{\"source\":\"iana\",\"compressible\":false},\"multipart/report\":{\"source\":\"iana\"},\"multipart/signed\":{\"source\":\"iana\",\"compressible\":false},\"multipart/vnd.bint.med-plus\":{\"source\":\"iana\"},\"multipart/voice-message\":{\"source\":\"iana\"},\"multipart/x-mixed-replace\":{\"source\":\"iana\"},\"text/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"text/cache-manifest\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"appcache\",\"manifest\"]},\"text/calendar\":{\"source\":\"iana\",\"extensions\":[\"ics\",\"ifb\"]},\"text/calender\":{\"compressible\":true},\"text/cmd\":{\"compressible\":true},\"text/coffeescript\":{\"extensions\":[\"coffee\",\"litcoffee\"]},\"text/css\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"css\"]},\"text/csv\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"csv\"]},\"text/csv-schema\":{\"source\":\"iana\"},\"text/directory\":{\"source\":\"iana\"},\"text/dns\":{\"source\":\"iana\"},\"text/ecmascript\":{\"source\":\"iana\"},\"text/encaprtp\":{\"source\":\"iana\"},\"text/enriched\":{\"source\":\"iana\"},\"text/flexfec\":{\"source\":\"iana\"},\"text/fwdred\":{\"source\":\"iana\"},\"text/grammar-ref-list\":{\"source\":\"iana\"},\"text/html\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"html\",\"htm\",\"shtml\"]},\"text/jade\":{\"extensions\":[\"jade\"]},\"text/javascript\":{\"source\":\"iana\",\"compressible\":true},\"text/jcr-cnd\":{\"source\":\"iana\"},\"text/jsx\":{\"compressible\":true,\"extensions\":[\"jsx\"]},\"text/less\":{\"compressible\":true,\"extensions\":[\"less\"]},\"text/markdown\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"markdown\",\"md\"]},\"text/mathml\":{\"source\":\"nginx\",\"extensions\":[\"mml\"]},\"text/mdx\":{\"compressible\":true,\"extensions\":[\"mdx\"]},\"text/mizar\":{\"source\":\"iana\"},\"text/n3\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"n3\"]},\"text/parameters\":{\"source\":\"iana\"},\"text/parityfec\":{\"source\":\"iana\"},\"text/plain\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"txt\",\"text\",\"conf\",\"def\",\"list\",\"log\",\"in\",\"ini\"]},\"text/provenance-notation\":{\"source\":\"iana\"},\"text/prs.fallenstein.rst\":{\"source\":\"iana\"},\"text/prs.lines.tag\":{\"source\":\"iana\",\"extensions\":[\"dsc\"]},\"text/prs.prop.logic\":{\"source\":\"iana\"},\"text/raptorfec\":{\"source\":\"iana\"},\"text/red\":{\"source\":\"iana\"},\"text/rfc822-headers\":{\"source\":\"iana\"},\"text/richtext\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rtx\"]},\"text/rtf\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"rtf\"]},\"text/rtp-enc-aescm128\":{\"source\":\"iana\"},\"text/rtploopback\":{\"source\":\"iana\"},\"text/rtx\":{\"source\":\"iana\"},\"text/sgml\":{\"source\":\"iana\",\"extensions\":[\"sgml\",\"sgm\"]},\"text/shex\":{\"extensions\":[\"shex\"]},\"text/slim\":{\"extensions\":[\"slim\",\"slm\"]},\"text/strings\":{\"source\":\"iana\"},\"text/stylus\":{\"extensions\":[\"stylus\",\"styl\"]},\"text/t140\":{\"source\":\"iana\"},\"text/tab-separated-values\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"tsv\"]},\"text/troff\":{\"source\":\"iana\",\"extensions\":[\"t\",\"tr\",\"roff\",\"man\",\"me\",\"ms\"]},\"text/turtle\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"extensions\":[\"ttl\"]},\"text/ulpfec\":{\"source\":\"iana\"},\"text/uri-list\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"uri\",\"uris\",\"urls\"]},\"text/vcard\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"vcard\"]},\"text/vnd.a\":{\"source\":\"iana\"},\"text/vnd.abc\":{\"source\":\"iana\"},\"text/vnd.ascii-art\":{\"source\":\"iana\"},\"text/vnd.curl\":{\"source\":\"iana\",\"extensions\":[\"curl\"]},\"text/vnd.curl.dcurl\":{\"source\":\"apache\",\"extensions\":[\"dcurl\"]},\"text/vnd.curl.mcurl\":{\"source\":\"apache\",\"extensions\":[\"mcurl\"]},\"text/vnd.curl.scurl\":{\"source\":\"apache\",\"extensions\":[\"scurl\"]},\"text/vnd.debian.copyright\":{\"source\":\"iana\"},\"text/vnd.dmclientscript\":{\"source\":\"iana\"},\"text/vnd.dvb.subtitle\":{\"source\":\"iana\",\"extensions\":[\"sub\"]},\"text/vnd.esmertec.theme-descriptor\":{\"source\":\"iana\"},\"text/vnd.ficlab.flt\":{\"source\":\"iana\"},\"text/vnd.fly\":{\"source\":\"iana\",\"extensions\":[\"fly\"]},\"text/vnd.fmi.flexstor\":{\"source\":\"iana\",\"extensions\":[\"flx\"]},\"text/vnd.gml\":{\"source\":\"iana\"},\"text/vnd.graphviz\":{\"source\":\"iana\",\"extensions\":[\"gv\"]},\"text/vnd.hgl\":{\"source\":\"iana\"},\"text/vnd.in3d.3dml\":{\"source\":\"iana\",\"extensions\":[\"3dml\"]},\"text/vnd.in3d.spot\":{\"source\":\"iana\",\"extensions\":[\"spot\"]},\"text/vnd.iptc.newsml\":{\"source\":\"iana\"},\"text/vnd.iptc.nitf\":{\"source\":\"iana\"},\"text/vnd.latex-z\":{\"source\":\"iana\"},\"text/vnd.motorola.reflex\":{\"source\":\"iana\"},\"text/vnd.ms-mediapackage\":{\"source\":\"iana\"},\"text/vnd.net2phone.commcenter.command\":{\"source\":\"iana\"},\"text/vnd.radisys.msml-basic-layout\":{\"source\":\"iana\"},\"text/vnd.senx.warpscript\":{\"source\":\"iana\"},\"text/vnd.si.uricatalogue\":{\"source\":\"iana\"},\"text/vnd.sosi\":{\"source\":\"iana\"},\"text/vnd.sun.j2me.app-descriptor\":{\"source\":\"iana\",\"extensions\":[\"jad\"]},\"text/vnd.trolltech.linguist\":{\"source\":\"iana\"},\"text/vnd.wap.si\":{\"source\":\"iana\"},\"text/vnd.wap.sl\":{\"source\":\"iana\"},\"text/vnd.wap.wml\":{\"source\":\"iana\",\"extensions\":[\"wml\"]},\"text/vnd.wap.wmlscript\":{\"source\":\"iana\",\"extensions\":[\"wmls\"]},\"text/vtt\":{\"source\":\"iana\",\"charset\":\"UTF-8\",\"compressible\":true,\"extensions\":[\"vtt\"]},\"text/x-asm\":{\"source\":\"apache\",\"extensions\":[\"s\",\"asm\"]},\"text/x-c\":{\"source\":\"apache\",\"extensions\":[\"c\",\"cc\",\"cxx\",\"cpp\",\"h\",\"hh\",\"dic\"]},\"text/x-component\":{\"source\":\"nginx\",\"extensions\":[\"htc\"]},\"text/x-fortran\":{\"source\":\"apache\",\"extensions\":[\"f\",\"for\",\"f77\",\"f90\"]},\"text/x-gwt-rpc\":{\"compressible\":true},\"text/x-handlebars-template\":{\"extensions\":[\"hbs\"]},\"text/x-java-source\":{\"source\":\"apache\",\"extensions\":[\"java\"]},\"text/x-jquery-tmpl\":{\"compressible\":true},\"text/x-lua\":{\"extensions\":[\"lua\"]},\"text/x-markdown\":{\"compressible\":true,\"extensions\":[\"mkd\"]},\"text/x-nfo\":{\"source\":\"apache\",\"extensions\":[\"nfo\"]},\"text/x-opml\":{\"source\":\"apache\",\"extensions\":[\"opml\"]},\"text/x-org\":{\"compressible\":true,\"extensions\":[\"org\"]},\"text/x-pascal\":{\"source\":\"apache\",\"extensions\":[\"p\",\"pas\"]},\"text/x-processing\":{\"compressible\":true,\"extensions\":[\"pde\"]},\"text/x-sass\":{\"extensions\":[\"sass\"]},\"text/x-scss\":{\"extensions\":[\"scss\"]},\"text/x-setext\":{\"source\":\"apache\",\"extensions\":[\"etx\"]},\"text/x-sfv\":{\"source\":\"apache\",\"extensions\":[\"sfv\"]},\"text/x-suse-ymp\":{\"compressible\":true,\"extensions\":[\"ymp\"]},\"text/x-uuencode\":{\"source\":\"apache\",\"extensions\":[\"uu\"]},\"text/x-vcalendar\":{\"source\":\"apache\",\"extensions\":[\"vcs\"]},\"text/x-vcard\":{\"source\":\"apache\",\"extensions\":[\"vcf\"]},\"text/xml\":{\"source\":\"iana\",\"compressible\":true,\"extensions\":[\"xml\"]},\"text/xml-external-parsed-entity\":{\"source\":\"iana\"},\"text/yaml\":{\"extensions\":[\"yaml\",\"yml\"]},\"video/1d-interleaved-parityfec\":{\"source\":\"iana\"},\"video/3gpp\":{\"source\":\"iana\",\"extensions\":[\"3gp\",\"3gpp\"]},\"video/3gpp-tt\":{\"source\":\"iana\"},\"video/3gpp2\":{\"source\":\"iana\",\"extensions\":[\"3g2\"]},\"video/bmpeg\":{\"source\":\"iana\"},\"video/bt656\":{\"source\":\"iana\"},\"video/celb\":{\"source\":\"iana\"},\"video/dv\":{\"source\":\"iana\"},\"video/encaprtp\":{\"source\":\"iana\"},\"video/flexfec\":{\"source\":\"iana\"},\"video/h261\":{\"source\":\"iana\",\"extensions\":[\"h261\"]},\"video/h263\":{\"source\":\"iana\",\"extensions\":[\"h263\"]},\"video/h263-1998\":{\"source\":\"iana\"},\"video/h263-2000\":{\"source\":\"iana\"},\"video/h264\":{\"source\":\"iana\",\"extensions\":[\"h264\"]},\"video/h264-rcdo\":{\"source\":\"iana\"},\"video/h264-svc\":{\"source\":\"iana\"},\"video/h265\":{\"source\":\"iana\"},\"video/iso.segment\":{\"source\":\"iana\"},\"video/jpeg\":{\"source\":\"iana\",\"extensions\":[\"jpgv\"]},\"video/jpeg2000\":{\"source\":\"iana\"},\"video/jpm\":{\"source\":\"apache\",\"extensions\":[\"jpm\",\"jpgm\"]},\"video/mj2\":{\"source\":\"iana\",\"extensions\":[\"mj2\",\"mjp2\"]},\"video/mp1s\":{\"source\":\"iana\"},\"video/mp2p\":{\"source\":\"iana\"},\"video/mp2t\":{\"source\":\"iana\",\"extensions\":[\"ts\"]},\"video/mp4\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"mp4\",\"mp4v\",\"mpg4\"]},\"video/mp4v-es\":{\"source\":\"iana\"},\"video/mpeg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"mpeg\",\"mpg\",\"mpe\",\"m1v\",\"m2v\"]},\"video/mpeg4-generic\":{\"source\":\"iana\"},\"video/mpv\":{\"source\":\"iana\"},\"video/nv\":{\"source\":\"iana\"},\"video/ogg\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"ogv\"]},\"video/parityfec\":{\"source\":\"iana\"},\"video/pointer\":{\"source\":\"iana\"},\"video/quicktime\":{\"source\":\"iana\",\"compressible\":false,\"extensions\":[\"qt\",\"mov\"]},\"video/raptorfec\":{\"source\":\"iana\"},\"video/raw\":{\"source\":\"iana\"},\"video/rtp-enc-aescm128\":{\"source\":\"iana\"},\"video/rtploopback\":{\"source\":\"iana\"},\"video/rtx\":{\"source\":\"iana\"},\"video/smpte291\":{\"source\":\"iana\"},\"video/smpte292m\":{\"source\":\"iana\"},\"video/ulpfec\":{\"source\":\"iana\"},\"video/vc1\":{\"source\":\"iana\"},\"video/vc2\":{\"source\":\"iana\"},\"video/vnd.cctv\":{\"source\":\"iana\"},\"video/vnd.dece.hd\":{\"source\":\"iana\",\"extensions\":[\"uvh\",\"uvvh\"]},\"video/vnd.dece.mobile\":{\"source\":\"iana\",\"extensions\":[\"uvm\",\"uvvm\"]},\"video/vnd.dece.mp4\":{\"source\":\"iana\"},\"video/vnd.dece.pd\":{\"source\":\"iana\",\"extensions\":[\"uvp\",\"uvvp\"]},\"video/vnd.dece.sd\":{\"source\":\"iana\",\"extensions\":[\"uvs\",\"uvvs\"]},\"video/vnd.dece.video\":{\"source\":\"iana\",\"extensions\":[\"uvv\",\"uvvv\"]},\"video/vnd.directv.mpeg\":{\"source\":\"iana\"},\"video/vnd.directv.mpeg-tts\":{\"source\":\"iana\"},\"video/vnd.dlna.mpeg-tts\":{\"source\":\"iana\"},\"video/vnd.dvb.file\":{\"source\":\"iana\",\"extensions\":[\"dvb\"]},\"video/vnd.fvt\":{\"source\":\"iana\",\"extensions\":[\"fvt\"]},\"video/vnd.hns.video\":{\"source\":\"iana\"},\"video/vnd.iptvforum.1dparityfec-1010\":{\"source\":\"iana\"},\"video/vnd.iptvforum.1dparityfec-2005\":{\"source\":\"iana\"},\"video/vnd.iptvforum.2dparityfec-1010\":{\"source\":\"iana\"},\"video/vnd.iptvforum.2dparityfec-2005\":{\"source\":\"iana\"},\"video/vnd.iptvforum.ttsavc\":{\"source\":\"iana\"},\"video/vnd.iptvforum.ttsmpeg2\":{\"source\":\"iana\"},\"video/vnd.motorola.video\":{\"source\":\"iana\"},\"video/vnd.motorola.videop\":{\"source\":\"iana\"},\"video/vnd.mpegurl\":{\"source\":\"iana\",\"extensions\":[\"mxu\",\"m4u\"]},\"video/vnd.ms-playready.media.pyv\":{\"source\":\"iana\",\"extensions\":[\"pyv\"]},\"video/vnd.nokia.interleaved-multimedia\":{\"source\":\"iana\"},\"video/vnd.nokia.mp4vr\":{\"source\":\"iana\"},\"video/vnd.nokia.videovoip\":{\"source\":\"iana\"},\"video/vnd.objectvideo\":{\"source\":\"iana\"},\"video/vnd.radgamettools.bink\":{\"source\":\"iana\"},\"video/vnd.radgamettools.smacker\":{\"source\":\"iana\"},\"video/vnd.sealed.mpeg1\":{\"source\":\"iana\"},\"video/vnd.sealed.mpeg4\":{\"source\":\"iana\"},\"video/vnd.sealed.swf\":{\"source\":\"iana\"},\"video/vnd.sealedmedia.softseal.mov\":{\"source\":\"iana\"},\"video/vnd.uvvu.mp4\":{\"source\":\"iana\",\"extensions\":[\"uvu\",\"uvvu\"]},\"video/vnd.vivo\":{\"source\":\"iana\",\"extensions\":[\"viv\"]},\"video/vnd.youtube.yt\":{\"source\":\"iana\"},\"video/vp8\":{\"source\":\"iana\"},\"video/webm\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"webm\"]},\"video/x-f4v\":{\"source\":\"apache\",\"extensions\":[\"f4v\"]},\"video/x-fli\":{\"source\":\"apache\",\"extensions\":[\"fli\"]},\"video/x-flv\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"flv\"]},\"video/x-m4v\":{\"source\":\"apache\",\"extensions\":[\"m4v\"]},\"video/x-matroska\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"mkv\",\"mk3d\",\"mks\"]},\"video/x-mng\":{\"source\":\"apache\",\"extensions\":[\"mng\"]},\"video/x-ms-asf\":{\"source\":\"apache\",\"extensions\":[\"asf\",\"asx\"]},\"video/x-ms-vob\":{\"source\":\"apache\",\"extensions\":[\"vob\"]},\"video/x-ms-wm\":{\"source\":\"apache\",\"extensions\":[\"wm\"]},\"video/x-ms-wmv\":{\"source\":\"apache\",\"compressible\":false,\"extensions\":[\"wmv\"]},\"video/x-ms-wmx\":{\"source\":\"apache\",\"extensions\":[\"wmx\"]},\"video/x-ms-wvx\":{\"source\":\"apache\",\"extensions\":[\"wvx\"]},\"video/x-msvideo\":{\"source\":\"apache\",\"extensions\":[\"avi\"]},\"video/x-sgi-movie\":{\"source\":\"apache\",\"extensions\":[\"movie\"]},\"video/x-smv\":{\"source\":\"apache\",\"extensions\":[\"smv\"]},\"x-conference/x-cooltalk\":{\"source\":\"apache\",\"extensions\":[\"ice\"]},\"x-shader/x-fragment\":{\"compressible\":true},\"x-shader/x-vertex\":{\"compressible\":true}}"); -/** - * @template B - * - * @typedef {object} SA - * @property {number} length - * @property {() => B[]} compactArray - * @property {(i: number) => B} get - * @property {(i: number, value: B) => void} set - * @property { (fn: (acc: A, curr: B, index: number) => A, initial: A) => B} reduce - * @property {(fn: (item: B) => boolean) => B | undefined} find - * @property {() => number[]} bitField - * @property {(i: number) => void} unset - */ +/***/ }), -/** - * @template T - * - * @typedef {object} BucketPosition - * @property {Bucket} bucket - * @property {number} pos - * @property {InfiniteHash} hash - * @property {BucketChild} [existingChild] - */ +/***/ "./node_modules/mime-db/index.js": +/*!***************************************!*\ + !*** ./node_modules/mime-db/index.js ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_841955__) { -/** - * @typedef {object} BucketOptions - * @property {number} bits - * @property {(value: Uint8Array | InfiniteHash) => InfiniteHash} hash +/*! + * mime-db + * Copyright(c) 2014 Jonathan Ong + * MIT Licensed */ /** - * @template T + * Module exports. */ -class Bucket { - /** - * @param {BucketOptions} options - * @param {Bucket} [parent] - * @param {number} [posAtParent=0] - */ - constructor (options, parent, posAtParent = 0) { - this._options = options - this._popCount = 0 - this._parent = parent - this._posAtParent = posAtParent - - /** @type {SA | BucketChild>} */ - this._children = new SparseArray() - - /** @type {string | null} */ - this.key = null - } - - /** - * @param {string} key - * @param {T} value - */ - async put (key, value) { - const place = await this._findNewBucketAndPos(key) - await place.bucket._putAt(place, key, value) - } +module.exports = __nested_webpack_require_841955__(/*! ./db.json */ "./node_modules/mime-db/db.json") - /** - * @param {string} key - */ - async get (key) { - const child = await this._findChild(key) - if (child) { - return child.value - } - } +/***/ }), - /** - * @param {string} key - */ - async del (key) { - const place = await this._findPlace(key) - const child = place.bucket._at(place.pos) +/***/ "./node_modules/mime-types/index.js": +/*!******************************************!*\ + !*** ./node_modules/mime-types/index.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_842429__) { - if (child && child.key === key) { - place.bucket._delAt(place.pos) - } - } +"use strict"; +/*! + * mime-types + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ - /** - * @returns {number} - */ - leafCount () { - const children = this._children.compactArray() - return children.reduce((acc, child) => { - if (child instanceof Bucket) { - return acc + child.leafCount() - } - return acc + 1 - }, 0) - } +/** + * Module dependencies. + * @private + */ - childrenCount () { - return this._children.length - } +var db = __nested_webpack_require_842429__(/*! mime-db */ "./node_modules/mime-db/index.js") +var extname = __nested_webpack_require_842429__(/*! path */ "path").extname - onlyChild () { - return this._children.get(0) - } +/** + * Module variables. + * @private + */ - /** - * @returns {Iterable>} - */ - * eachLeafSeries () { - const children = this._children.compactArray() +var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/ +var TEXT_TYPE_REGEXP = /^text\//i - for (const child of children) { - if (child instanceof Bucket) { - yield * child.eachLeafSeries() - } else { - yield child - } - } +/** + * Module exports. + * @public + */ - // this is necessary because tsc requires a @return annotation as it - // can't derive a return type due to the recursion, and eslint requires - // a return statement when there is a @return annotation - return [] - } +exports.charset = charset +exports.charsets = { lookup: charset } +exports.contentType = contentType +exports.extension = extension +exports.extensions = Object.create(null) +exports.lookup = lookup +exports.types = Object.create(null) - /** - * @param {(value: BucketChild, index: number) => T} map - * @param {(reduced: any) => any} reduce - */ - serialize (map, reduce) { - /** @type {T[]} */ - const acc = [] - // serialize to a custom non-sparse representation - return reduce(this._children.reduce((acc, child, index) => { - if (child) { - if (child instanceof Bucket) { - acc.push(child.serialize(map, reduce)) - } else { - acc.push(map(child, index)) - } - } - return acc - }, acc)) - } +// Populate the extensions/types maps +populateMaps(exports.extensions, exports.types) - /** - * @param {(value: BucketChild) => Promise} asyncMap - * @param {(reduced: any) => Promise} asyncReduce - */ - asyncTransform (asyncMap, asyncReduce) { - return asyncTransformBucket(this, asyncMap, asyncReduce) - } +/** + * Get the default charset for a MIME type. + * + * @param {string} type + * @return {boolean|string} + */ - toJSON () { - return this.serialize(mapNode, reduceNodes) +function charset (type) { + if (!type || typeof type !== 'string') { + return false } - prettyPrint () { - return JSON.stringify(this.toJSON(), null, ' ') - } + // TODO: use media-typer + var match = EXTRACT_TYPE_REGEXP.exec(type) + var mime = match && db[match[1].toLowerCase()] - tableSize () { - return Math.pow(2, this._options.bits) + if (mime && mime.charset) { + return mime.charset } - /** - * @param {string} key - * @returns {Promise | undefined>} - */ - async _findChild (key) { - const result = await this._findPlace(key) - const child = result.bucket._at(result.pos) - - if (child instanceof Bucket) { - // should not be possible, this._findPlace should always - // return a location for a child, not a bucket - return undefined - } - - if (child && child.key === key) { - return child - } + // default text/* to utf-8 + if (match && TEXT_TYPE_REGEXP.test(match[1])) { + return 'UTF-8' } - /** - * @param {string | InfiniteHash} key - * @returns {Promise>} - */ - async _findPlace (key) { - const hashValue = this._options.hash(typeof key === 'string' ? uint8ArrayFromString(key) : key) - const index = await hashValue.take(this._options.bits) - - const child = this._children.get(index) + return false +} - if (child instanceof Bucket) { - return child._findPlace(hashValue) - } +/** + * Create a full Content-Type header given a MIME type or extension. + * + * @param {string} str + * @return {boolean|string} + */ - return { - bucket: this, - pos: index, - hash: hashValue, - existingChild: child - } +function contentType (str) { + // TODO: should this even be in this module? + if (!str || typeof str !== 'string') { + return false } - /** - * @param {string | InfiniteHash} key - * @returns {Promise>} - */ - async _findNewBucketAndPos (key) { - const place = await this._findPlace(key) - - if (place.existingChild && place.existingChild.key !== key) { - // conflict - const bucket = new Bucket(this._options, place.bucket, place.pos) - place.bucket._putObjectAt(place.pos, bucket) - - // put the previous value - const newPlace = await bucket._findPlace(place.existingChild.hash) - newPlace.bucket._putAt(newPlace, place.existingChild.key, place.existingChild.value) - - return bucket._findNewBucketAndPos(place.hash) - } + var mime = str.indexOf('/') === -1 + ? exports.lookup(str) + : str - // no conflict, we found the place - return place + if (!mime) { + return false } - /** - * @param {BucketPosition} place - * @param {string} key - * @param {T} value - */ - _putAt (place, key, value) { - this._putObjectAt(place.pos, { - key: key, - value: value, - hash: place.hash - }) + // TODO: use content-type or other module + if (mime.indexOf('charset') === -1) { + var charset = exports.charset(mime) + if (charset) mime += '; charset=' + charset.toLowerCase() } - /** - * @param {number} pos - * @param {Bucket | BucketChild} object - */ - _putObjectAt (pos, object) { - if (!this._children.get(pos)) { - this._popCount++ - } - this._children.set(pos, object) - } + return mime +} - /** - * @param {number} pos - */ - _delAt (pos) { - if (pos === -1) { - throw new Error('Invalid position') - } +/** + * Get the default extension for a MIME type. + * + * @param {string} type + * @return {boolean|string} + */ - if (this._children.get(pos)) { - this._popCount-- - } - this._children.unset(pos) - this._level() +function extension (type) { + if (!type || typeof type !== 'string') { + return false } - _level () { - if (this._parent && this._popCount <= 1) { - if (this._popCount === 1) { - // remove myself from parent, replacing me with my only child - const onlyChild = this._children.find(exists) + // TODO: use media-typer + var match = EXTRACT_TYPE_REGEXP.exec(type) - if (onlyChild && !(onlyChild instanceof Bucket)) { - const hash = onlyChild.hash - hash.untake(this._options.bits) - const place = { - pos: this._posAtParent, - hash: hash, - bucket: this._parent - } - this._parent._putAt(place, onlyChild.key, onlyChild.value) - } - } else { - this._parent._delAt(this._posAtParent) - } - } - } + // get extensions + var exts = match && exports.extensions[match[1].toLowerCase()] - /** - * @param {number} index - * @returns {BucketChild | Bucket | undefined} - */ - _at (index) { - return this._children.get(index) + if (!exts || !exts.length) { + return false } -} -/** - * @param {any} o - */ -function exists (o) { - return Boolean(o) + return exts[0] } /** + * Lookup the MIME type for a file path/extension. * - * @param {*} node - * @param {number} index + * @param {string} path + * @return {boolean|string} */ -function mapNode (node, index) { - return node.key -} -/** - * @param {*} nodes - */ -function reduceNodes (nodes) { - return nodes +function lookup (path) { + if (!path || typeof path !== 'string') { + return false + } + + // get the extension ("ext" or ".ext" or full path) + var extension = extname('x.' + path) + .toLowerCase() + .substr(1) + + if (!extension) { + return false + } + + return exports.types[extension] || false } /** - * @template T - * - * @param {Bucket} bucket - * @param {(value: BucketChild) => Promise} asyncMap - * @param {(reduced: any) => Promise} asyncReduce + * Populate the extensions and types maps. + * @private */ -async function asyncTransformBucket (bucket, asyncMap, asyncReduce) { - const output = [] - for (const child of bucket._children.compactArray()) { - if (child instanceof Bucket) { - await asyncTransformBucket(child, asyncMap, asyncReduce) - } else { - const mappedChildren = await asyncMap(child) +function populateMaps (extensions, types) { + // source preference (least -> most) + var preference = ['nginx', 'apache', undefined, 'iana'] - output.push({ - bitField: bucket._children.bitField(), - children: mappedChildren - }) + Object.keys(db).forEach(function forEachMimeType (type) { + var mime = db[type] + var exts = mime.extensions + + if (!exts || !exts.length) { + return } - } - return asyncReduce(output) -} + // mime -> extensions + extensions[type] = exts -module.exports = Bucket + // extension -> mime + for (var i = 0; i < exts.length; i++) { + var extension = exts[i] + if (types[extension]) { + var from = preference.indexOf(db[types[extension]].source) + var to = preference.indexOf(mime.source) -/***/ }), + if (types[extension] !== 'application/octet-stream' && + (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) { + // skip the remapping + continue + } + } -/***/ 1267: -/***/ ((module) => { + // set the extension -> mime + types[extension] = type + } + }) +} -"use strict"; +/***/ }), -const START_MASKS = [ - 0b11111111, - 0b11111110, - 0b11111100, - 0b11111000, - 0b11110000, - 0b11100000, - 0b11000000, - 0b10000000 -] +/***/ "./node_modules/ms/index.js": +/*!**********************************!*\ + !*** ./node_modules/ms/index.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -const STOP_MASKS = [ - 0b00000001, - 0b00000011, - 0b00000111, - 0b00001111, - 0b00011111, - 0b00111111, - 0b01111111, - 0b11111111 -] +/** + * Helpers. + */ -module.exports = class ConsumableBuffer { - /** - * @param {Uint8Array} value - */ - constructor (value) { - this._value = value - this._currentBytePos = value.length - 1 - this._currentBitPos = 7 - } +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; - availableBits () { - return this._currentBitPos + 1 + this._currentBytePos * 8 - } +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ - totalBits () { - return this._value.length * 8 +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isNaN(val) === false) { + return options.long ? fmtLong(val) : fmtShort(val); } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; - /** - * @param {number} bits - */ - take (bits) { - let pendingBits = bits - let result = 0 - while (pendingBits && this._haveBits()) { - const byte = this._value[this._currentBytePos] - const availableBits = this._currentBitPos + 1 - const taking = Math.min(availableBits, pendingBits) - const value = byteBitsToInt(byte, availableBits - taking, taking) - result = (result << taking) + value +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ - pendingBits -= taking +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} - this._currentBitPos -= taking - if (this._currentBitPos < 0) { - this._currentBitPos = 7 - this._currentBytePos-- - } - } +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ - return result +function fmtShort(ms) { + if (ms >= d) { + return Math.round(ms / d) + 'd'; } - - /** - * @param {number} bits - */ - untake (bits) { - this._currentBitPos += bits - while (this._currentBitPos > 7) { - this._currentBitPos -= 8 - this._currentBytePos += 1 - } + if (ms >= h) { + return Math.round(ms / h) + 'h'; } - - _haveBits () { - return this._currentBytePos >= 0 + if (ms >= m) { + return Math.round(ms / m) + 'm'; } + if (ms >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; } /** - * @param {number} byte - * @param {number} start - * @param {number} length + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private */ -function byteBitsToInt (byte, start, length) { - const mask = maskFor(start, length) - return (byte & mask) >>> start + +function fmtLong(ms) { + return plural(ms, d, 'day') || + plural(ms, h, 'hour') || + plural(ms, m, 'minute') || + plural(ms, s, 'second') || + ms + ' ms'; } /** - * @param {number} start - * @param {number} length + * Pluralization helper. */ -function maskFor (start, length) { - return START_MASKS[start] & STOP_MASKS[Math.min(length + start - 1, 7)] + +function plural(ms, n, name) { + if (ms < n) { + return; + } + if (ms < n * 1.5) { + return Math.floor(ms / n) + ' ' + name; + } + return Math.ceil(ms / n) + ' ' + name + 's'; } /***/ }), -/***/ 1663: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ "./node_modules/multiaddr/src/codec.js": +/*!*********************************************!*\ + !*** ./node_modules/multiaddr/src/codec.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_849468__) { "use strict"; -const ConsumableBuffer = __nccwpck_require__(1267) -const { concat: uint8ArrayConcat } = __nccwpck_require__(17225) - -/** - * @param {(value: Uint8Array) => Promise} hashFn - */ -function wrapHash (hashFn) { - /** - * @param {InfiniteHash | Uint8Array} value - */ - function hashing (value) { - if (value instanceof InfiniteHash) { - // already a hash. return it - return value - } else { - return new InfiniteHash(value, hashFn) - } - } - - return hashing -} - -class InfiniteHash { - /** - * - * @param {Uint8Array} value - * @param {(value: Uint8Array) => Promise} hashFn - */ - constructor (value, hashFn) { - if (!(value instanceof Uint8Array)) { - throw new Error('can only hash Uint8Arrays') - } +const convert = __nested_webpack_require_849468__(/*! ./convert */ "./node_modules/multiaddr/src/convert.js") +const protocols = __nested_webpack_require_849468__(/*! ./protocols-table */ "./node_modules/multiaddr/src/protocols-table.js") +const varint = __nested_webpack_require_849468__(/*! varint */ "./node_modules/varint/index.js") - this._value = value - this._hashFn = hashFn - this._depth = -1 - this._availableBits = 0 - this._currentBufferIndex = 0 +// export codec +module.exports = { + stringToStringTuples: stringToStringTuples, + stringTuplesToString: stringTuplesToString, - /** @type {ConsumableBuffer[]} */ - this._buffers = [] - } + tuplesToStringTuples: tuplesToStringTuples, + stringTuplesToTuples: stringTuplesToTuples, - /** - * @param {number} bits - */ - async take (bits) { - let pendingBits = bits + bufferToTuples: bufferToTuples, + tuplesToBuffer: tuplesToBuffer, - while (this._availableBits < pendingBits) { - await this._produceMoreBits() - } + bufferToString: bufferToString, + stringToBuffer: stringToBuffer, - let result = 0 + fromString: fromString, + fromBuffer: fromBuffer, + validateBuffer: validateBuffer, + isValidBuffer: isValidBuffer, + cleanPath: cleanPath, - while (pendingBits > 0) { - const hash = this._buffers[this._currentBufferIndex] - const available = Math.min(hash.availableBits(), pendingBits) - const took = hash.take(available) - result = (result << available) + took - pendingBits -= available - this._availableBits -= available + ParseError: ParseError, + protoFromTuple: protoFromTuple, - if (hash.availableBits() === 0) { - this._currentBufferIndex++ - } - } + sizeForAddr: sizeForAddr +} - return result +// string -> [[str name, str addr]... ] +function stringToStringTuples (str) { + const tuples = [] + const parts = str.split('/').slice(1) // skip first empty elem + if (parts.length === 1 && parts[0] === '') { + return [] } - /** - * @param {number} bits - */ - untake (bits) { - let pendingBits = bits - - while (pendingBits > 0) { - const hash = this._buffers[this._currentBufferIndex] - const availableForUntake = Math.min(hash.totalBits() - hash.availableBits(), pendingBits) - hash.untake(availableForUntake) - pendingBits -= availableForUntake - this._availableBits += availableForUntake + for (let p = 0; p < parts.length; p++) { + const part = parts[p] + const proto = protocols(part) - if (this._currentBufferIndex > 0 && hash.totalBits() === hash.availableBits()) { - this._depth-- - this._currentBufferIndex-- - } + if (proto.size === 0) { + tuples.push([part]) + continue } - } - async _produceMoreBits () { - this._depth++ + p++ // advance addr part + if (p >= parts.length) { + throw ParseError('invalid address: ' + str) + } - const value = this._depth ? uint8ArrayConcat([this._value, Uint8Array.from([this._depth])]) : this._value - const hashValue = await this._hashFn(value) - const buffer = new ConsumableBuffer(hashValue) + // if it's a path proto, take the rest + if (proto.path) { + tuples.push([ + part, + // TODO: should we need to check each path part to see if it's a proto? + // This would allow for other protocols to be added after a unix path, + // however it would have issues if the path had a protocol name in the path + cleanPath(parts.slice(p).join('/')) + ]) + break + } - this._buffers.push(buffer) - this._availableBits += buffer.availableBits() + tuples.push([part, parts[p]]) } -} - -module.exports = wrapHash -module.exports.InfiniteHash = InfiniteHash + return tuples +} -/***/ }), - -/***/ 78338: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; +// [[str name, str addr]... ] -> string +function stringTuplesToString (tuples) { + const parts = [] + tuples.map(tup => { + const proto = protoFromTuple(tup) + parts.push(proto.name) + if (tup.length > 1) { + parts.push(tup[1]) + } + }) + return cleanPath(parts.join('/')) +} -const Bucket = __nccwpck_require__(35779) -const wrapHash = __nccwpck_require__(1663) +// [[str name, str addr]... ] -> [[int code, Buffer]... ] +function stringTuplesToTuples (tuples) { + return tuples.map(tup => { + if (!Array.isArray(tup)) { + tup = [tup] + } + const proto = protoFromTuple(tup) + if (tup.length > 1) { + return [proto.code, convert.toBuffer(proto.code, tup[1])] + } + return [proto.code] + }) +} -/** - * @typedef {object} UserBucketOptions - * @property {(value: Uint8Array) => Promise} hashFn - * @property {number} [bits=8] - */ +// [[int code, Buffer]... ] -> [[str name, str addr]... ] +function tuplesToStringTuples (tuples) { + return tuples.map(tup => { + const proto = protoFromTuple(tup) + if (tup.length > 1) { + return [proto.code, convert.toString(proto.code, tup[1])] + } + return [proto.code] + }) +} -/** - * @param {UserBucketOptions} options - */ -function createHAMT (options) { - if (!options || !options.hashFn) { - throw new Error('please define an options.hashFn') - } +// [[int code, Buffer ]... ] -> Buffer +function tuplesToBuffer (tuples) { + return fromBuffer(Buffer.concat(tuples.map(tup => { + const proto = protoFromTuple(tup) + let buf = Buffer.from(varint.encode(proto.code)) - const bucketOptions = { - bits: options.bits || 8, - hash: wrapHash(options.hashFn) - } + if (tup.length > 1) { + buf = Buffer.concat([buf, tup[1]]) // add address buffer + } - return new Bucket(bucketOptions) + return buf + }))) } -module.exports = { - createHAMT, - Bucket +function sizeForAddr (p, addr) { + if (p.size > 0) { + return p.size / 8 + } else if (p.size === 0) { + return 0 + } else { + const size = varint.decode(addr) + return size + varint.decode.bytes + } } +// Buffer -> [[int code, Buffer ]... ] +function bufferToTuples (buf) { + const tuples = [] + let i = 0 + while (i < buf.length) { + const code = varint.decode(buf, i) + const n = varint.decode.bytes -/***/ }), - -/***/ 24099: -/***/ ((module) => { - -"use strict"; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + const p = protocols(code) -module.exports = (flag, argv) => { - argv = argv || process.argv; - const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); - const pos = argv.indexOf(prefix + flag); - const terminatorPos = argv.indexOf('--'); - return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); -}; + const size = sizeForAddr(p, buf.slice(i + n)) + if (size === 0) { + tuples.push([code]) + i += n + continue + } -/***/ }), + const addr = buf.slice(i + n, i + n + size) -<<<<<<< HEAD -/***/ 42413: -======= -/***/ 94807: -/***/ ((module) => { + i += (size + n) -"use strict"; + if (i > buf.length) { // did not end _exactly_ at buffer.length + throw ParseError('Invalid address buffer: ' + buf.toString('hex')) + } + // ok, tuple seems good. + tuples.push([code, addr]) + } -const word = '[a-fA-F\\d:]'; -const b = options => options && options.includeBoundaries ? - `(?:(?<=\\s|^)(?=${word})|(?<=${word})(?=\\s|$))` : - ''; + return tuples +} -const v4 = '(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}'; +// Buffer -> String +function bufferToString (buf) { + const a = bufferToTuples(buf) + const b = tuplesToStringTuples(a) + return stringTuplesToString(b) +} -const v6seg = '[a-fA-F\\d]{1,4}'; -const v6 = ` -( -(?:${v6seg}:){7}(?:${v6seg}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8 -(?:${v6seg}:){6}(?:${v4}|:${v6seg}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4 -(?:${v6seg}:){5}(?::${v4}|(:${v6seg}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4 -(?:${v6seg}:){4}(?:(:${v6seg}){0,1}:${v4}|(:${v6seg}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4 -(?:${v6seg}:){3}(?:(:${v6seg}){0,2}:${v4}|(:${v6seg}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4 -(?:${v6seg}:){2}(?:(:${v6seg}){0,3}:${v4}|(:${v6seg}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4 -(?:${v6seg}:){1}(?:(:${v6seg}){0,4}:${v4}|(:${v6seg}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4 -(?::((?::${v6seg}){0,5}:${v4}|(?::${v6seg}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4 -)(%[0-9a-zA-Z]{1,})? // %eth0 %1 -`.replace(/\s*\/\/.*$/gm, '').replace(/\n/g, '').trim(); +// String -> Buffer +function stringToBuffer (str) { + str = cleanPath(str) + const a = stringToStringTuples(str) + const b = stringTuplesToTuples(a) -const ip = options => options && options.exact ? - new RegExp(`(?:^${v4}$)|(?:^${v6}$)`) : - new RegExp(`(?:${b(options)}${v4}${b(options)})|(?:${b(options)}${v6}${b(options)})`, 'g'); + return tuplesToBuffer(b) +} -ip.v4 = options => options && options.exact ? new RegExp(`^${v4}$`) : new RegExp(`${b(options)}${v4}${b(options)}`, 'g'); -ip.v6 = options => options && options.exact ? new RegExp(`^${v6}$`) : new RegExp(`${b(options)}${v6}${b(options)}`, 'g'); +// String -> Buffer +function fromString (str) { + return stringToBuffer(str) +} -module.exports = ip; +// Buffer -> Buffer +function fromBuffer (buf) { + const err = validateBuffer(buf) + if (err) throw err + return Buffer.from(buf) // copy +} +function validateBuffer (buf) { + try { + bufferToTuples(buf) // try to parse. will throw if breaks + } catch (err) { + return err + } +} -/***/ }), +function isValidBuffer (buf) { + return validateBuffer(buf) === undefined +} -/***/ 75433: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +function cleanPath (str) { + return '/' + str.trim().split('/').filter(a => a).join('/') +} -"use strict"; +function ParseError (str) { + return new Error('Error parsing address: ' + str) +} -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FsBlockStore = void 0; -const fs_1 = __importDefault(__nccwpck_require__(57147)); -const os_1 = __importDefault(__nccwpck_require__(22037)); -const multiformats_1 = __nccwpck_require__(27331); -const blockstore_core_1 = __nccwpck_require__(95301); -class FsBlockStore extends blockstore_core_1.BaseBlockstore { - constructor() { - super(); - this.path = `${os_1.default.tmpdir()}/${(parseInt(String(Math.random() * 1e9), 10)).toString() + Date.now()}`; - this._opened = false; - } - async _open() { - if (this._opening) { - await this._opening; - } - else { - this._opening = fs_1.default.promises.mkdir(this.path); - await this._opening; - this._opened = true; - } - } - async put(cid, bytes) { - if (!this._opened) { - await this._open(); - } - const cidStr = cid.toString(); - const location = `${this.path}/${cidStr}`; - await fs_1.default.promises.writeFile(location, bytes); - } - async get(cid) { - if (!this._opened) { - await this._open(); - } - const cidStr = cid.toString(); - const location = `${this.path}/${cidStr}`; - const bytes = await fs_1.default.promises.readFile(location); - return bytes; - } - async has(cid) { - if (!this._opened) { - await this._open(); - } - const cidStr = cid.toString(); - const location = `${this.path}/${cidStr}`; - try { - await fs_1.default.promises.access(location); - return true; - } - catch (err) { - return false; - } - } - async *blocks() { - if (!this._opened) { - await this._open(); - } - const cids = await fs_1.default.promises.readdir(this.path); - for (const cidStr of cids) { - const location = `${this.path}/${cidStr}`; - const bytes = await fs_1.default.promises.readFile(location); - yield { cid: multiformats_1.CID.parse(cidStr), bytes }; - } - } - async close() { - if (this._opened) { - await fs_1.default.promises.rm(this.path, { recursive: true }); - } - this._opened = false; - } +function protoFromTuple (tup) { + const proto = protocols(tup[0]) + return proto } -exports.FsBlockStore = FsBlockStore; /***/ }), -/***/ 58832: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/multiaddr/src/convert.js": +/*!***********************************************!*\ + !*** ./node_modules/multiaddr/src/convert.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_854861__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MemoryBlockStore = void 0; -const multiformats_1 = __nccwpck_require__(27331); -const blockstore_core_1 = __nccwpck_require__(95301); -class MemoryBlockStore extends blockstore_core_1.BaseBlockstore { - constructor() { - super(); - this.store = new Map(); - } - async *blocks() { - for (const [cidStr, bytes] of this.store.entries()) { - yield { cid: multiformats_1.CID.parse(cidStr), bytes }; - } - } - put(cid, bytes) { - this.store.set(cid.toString(), bytes); - return Promise.resolve(); - } - get(cid) { - const bytes = this.store.get(cid.toString()); - if (!bytes) { - throw new Error(`block with cid ${cid.toString()} no found`); - } - return Promise.resolve(bytes); - } - has(cid) { - return Promise.resolve(this.store.has(cid.toString())); - } - close() { - this.store.clear(); - return Promise.resolve(); - } -} -exports.MemoryBlockStore = MemoryBlockStore; - -/***/ }), - -/***/ 68118: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +const ip = __nested_webpack_require_854861__(/*! ip */ "./node_modules/ip/lib/ip.js") +const isIp = __nested_webpack_require_854861__(/*! is-ip */ "./node_modules/is-ip/index.js") +const protocols = __nested_webpack_require_854861__(/*! ./protocols-table */ "./node_modules/multiaddr/src/protocols-table.js") +const bs58 = __nested_webpack_require_854861__(/*! bs58 */ "./node_modules/bs58/index.js") +const CID = __nested_webpack_require_854861__(/*! cids */ "./node_modules/cids/src/index.js") +const base32 = __nested_webpack_require_854861__(/*! hi-base32 */ "./node_modules/hi-base32/src/base32.js") +const varint = __nested_webpack_require_854861__(/*! varint */ "./node_modules/varint/index.js") -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unixfsImporterOptionsDefault = void 0; -const sha2_1 = __nccwpck_require__(80960); -exports.unixfsImporterOptionsDefault = { - cidVersion: 1, - chunker: 'fixed', - maxChunkSize: 262144, - hasher: sha2_1.sha256, - rawLeaves: true, - wrapWithDirectory: true, - maxChildrenPerNode: 174 -}; +module.exports = Convert +// converts (serializes) addresses +function Convert (proto, a) { + if (a instanceof Buffer) { + return Convert.toString(proto, a) + } else { + return Convert.toBuffer(proto, a) + } +} -/***/ }), +Convert.toString = function convertToString (proto, buf) { + proto = protocols(proto) + switch (proto.code) { + case 4: // ipv4 + case 41: // ipv6 + return buf2ip(buf) -/***/ 47859: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + case 6: // tcp + case 273: // udp + case 33: // dccp + case 132: // sctp + return buf2port(buf) -"use strict"; + case 53: // dns + case 54: // dns4 + case 55: // dns6 + case 56: // dnsaddr + case 400: // unix + return buf2str(buf) -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.pack = void 0; -const it_last_1 = __importDefault(__nccwpck_require__(28741)); -const it_pipe_1 = __importDefault(__nccwpck_require__(74824)); -const car_1 = __nccwpck_require__(56994); -const ipfs_unixfs_importer_1 = __nccwpck_require__(17512); -const normalise_input_1 = __nccwpck_require__(24699); -const memory_1 = __nccwpck_require__(58832); -const constants_1 = __nccwpck_require__(68118); -async function pack({ input, blockstore: userBlockstore, hasher, maxChunkSize, maxChildrenPerNode, wrapWithDirectory, rawLeaves, cidVersion }) { - if (!input || (Array.isArray(input) && !input.length)) { - throw new Error('missing input file(s)'); - } - const blockstore = userBlockstore ? userBlockstore : new memory_1.MemoryBlockStore(); - // Consume the source - 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, { - ...constants_1.unixfsImporterOptionsDefault, - hasher: hasher || constants_1.unixfsImporterOptionsDefault.hasher, - maxChunkSize: maxChunkSize || constants_1.unixfsImporterOptionsDefault.maxChunkSize, - maxChildrenPerNode: maxChildrenPerNode || constants_1.unixfsImporterOptionsDefault.maxChildrenPerNode, - wrapWithDirectory: wrapWithDirectory === false ? false : constants_1.unixfsImporterOptionsDefault.wrapWithDirectory, - rawLeaves: rawLeaves == null ? constants_1.unixfsImporterOptionsDefault.rawLeaves : rawLeaves, - cidVersion: typeof cidVersion === "number" ? cidVersion : constants_1.unixfsImporterOptionsDefault.cidVersion - }))); - if (!rootEntry || !rootEntry.cid) { - throw new Error('given input could not be parsed correctly'); - } - const root = rootEntry.cid; - const { writer, out: carOut } = await car_1.CarWriter.create([root]); - const carOutIter = carOut[Symbol.asyncIterator](); - let writingPromise; - const writeAll = async () => { - for await (const block of blockstore.blocks()) { - // `await` will block until all bytes in `carOut` are consumed by the user - // so we have backpressure here - await writer.put(block); - } - await writer.close(); - if (!userBlockstore) { - await blockstore.close(); - } - }; - const out = { - [Symbol.asyncIterator]() { - if (writingPromise != null) { - throw new Error('Multiple iterator not supported'); - } - // don't start writing until the user starts consuming the iterator - writingPromise = writeAll(); - return { - async next() { - const result = await carOutIter.next(); - if (result.done) { - await writingPromise; // any errors will propagate from here - } - return result; - } - }; - } - }; - return { root, out }; + case 421: // ipfs + return buf2mh(buf) + case 444: // onion + return buf2onion(buf) + case 445: // onion3 + return buf2onion(buf) + default: + return buf.toString('hex') // no clue. convert to hex + } } -exports.pack = pack; +Convert.toBuffer = function convertToBuffer (proto, str) { + proto = protocols(proto) + switch (proto.code) { + case 4: // ipv4 + return ip2buf(str) + case 41: // ipv6 + return ip2buf(str) -/***/ }), - -/***/ 24699: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + case 6: // tcp + case 273: // udp + case 33: // dccp + case 132: // sctp + return port2buf(parseInt(str, 10)) -"use strict"; + case 53: // dns + case 54: // dns4 + case 55: // dns6 + case 56: // dnsaddr + case 400: // unix + return str2buf(str) -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getNormaliser = void 0; -const normalise_input_single_1 = __nccwpck_require__(82806); -const normalise_input_multiple_1 = __nccwpck_require__(36708); -function isBytes(obj) { - return ArrayBuffer.isView(obj) || obj instanceof ArrayBuffer; + case 421: // ipfs + return mh2buf(str) + case 444: // onion + return onion2buf(str) + case 445: // onion3 + return onion32buf(str) + default: + return Buffer.from(str, 'hex') // no clue. convert from hex + } } -function isBlob(obj) { - return Boolean(obj.constructor) && - (obj.constructor.name === 'Blob' || obj.constructor.name === 'File') && - typeof obj.stream === 'function'; + +function ip2buf (ipString) { + if (!isIp(ipString)) { + throw new Error('invalid ip address') + } + return ip.toBuffer(ipString) } -function isSingle(input) { - return typeof input === 'string' || input instanceof String || isBytes(input) || isBlob(input) || '_readableState' in input; + +function buf2ip (ipBuff) { + const ipString = ip.toString(ipBuff) + if (!isIp(ipString)) { + throw new Error('invalid ip address') + } + return ipString } -/** - * Get a single or multiple normaliser depending on the input. - */ -function getNormaliser(input) { - if (isSingle(input)) { - return (0, normalise_input_single_1.normaliseInput)(input); - } - else { - return (0, normalise_input_multiple_1.normaliseInput)(input); - } + +function port2buf (port) { + const buf = Buffer.alloc(2) + buf.writeUInt16BE(port, 0) + return buf } -exports.getNormaliser = getNormaliser; +function buf2port (buf) { + return buf.readUInt16BE(0) +} -/***/ }), +function str2buf (str) { + const buf = Buffer.from(str) + const size = Buffer.from(varint.encode(buf.length)) + return Buffer.concat([size, buf]) +} -/***/ 98381: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +function buf2str (buf) { + const size = varint.decode(buf) + buf = buf.slice(varint.decode.bytes) -"use strict"; + if (buf.length !== size) { + throw new Error('inconsistent lengths') + } + return buf.toString() +} -Object.defineProperty(exports, "__esModule", ({ value: true })); +function mh2buf (hash) { + // the address is a varint prefixed multihash string representation + const mh = new CID(hash).multihash + const size = Buffer.from(varint.encode(mh.length)) + return Buffer.concat([size, mh]) +} -var errCode = __nccwpck_require__(5822); -var browserStreamToIt = __nccwpck_require__(31049); -var itPeekable = __nccwpck_require__(66140); -var map = __nccwpck_require__(6305); -var utils = __nccwpck_require__(43691); -var ipfsUnixfs = __nccwpck_require__(24821); +function buf2mh (buf) { + const size = varint.decode(buf) + const address = buf.slice(varint.decode.bytes) -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + if (address.length !== size) { + throw new Error('inconsistent lengths') + } -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); -var browserStreamToIt__default = /*#__PURE__*/_interopDefaultLegacy(browserStreamToIt); -var itPeekable__default = /*#__PURE__*/_interopDefaultLegacy(itPeekable); -var map__default = /*#__PURE__*/_interopDefaultLegacy(map); + return bs58.encode(address) +} -async function* normaliseCandidateMultiple(input, normaliseContent) { - if (typeof input === 'string' || input instanceof String || utils.isBytes(input) || utils.isBlob(input) || input._readableState) { - 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'); - } - if (utils.isReadableStream(input)) { - input = browserStreamToIt__default["default"](input); +function onion2buf (str) { + const addr = str.split(':') + if (addr.length !== 2) { + throw new Error('failed to parse onion addr: ' + addr + ' does not contain a port number') } - if (Symbol.iterator in input || Symbol.asyncIterator in input) { - const peekable = itPeekable__default["default"](input); - const {value, done} = await peekable.peek(); - if (done) { - yield* []; - return; - } - peekable.push(value); - if (Number.isInteger(value)) { - 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'); - } - if (value._readableState) { - yield* map__default["default"](peekable, value => toFileObject({ content: value }, normaliseContent)); - return; - } - if (utils.isBytes(value)) { - yield toFileObject({ content: peekable }, normaliseContent); - return; - } - if (utils.isFileObject(value) || value[Symbol.iterator] || value[Symbol.asyncIterator] || utils.isReadableStream(value) || utils.isBlob(value)) { - yield* map__default["default"](peekable, value => toFileObject(value, normaliseContent)); - return; - } + if (addr[0].length !== 16) { + throw new Error('failed to parse onion addr: ' + addr[0] + ' not a Tor onion address.') } - if (utils.isFileObject(input)) { - 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'); + const buf = Buffer.from(base32.decode.asBytes(addr[0].toUpperCase())) + + // onion port number + const port = parseInt(addr[1], 10) + if (port < 1 || port > 65536) { + throw new Error('Port number is not in range(1, 65536)') } - throw errCode__default["default"](new Error('Unexpected input: ' + typeof input), 'ERR_UNEXPECTED_INPUT'); + const portBuf = port2buf(port) + return Buffer.concat([buf, portBuf]) } -async function toFileObject(input, normaliseContent) { - const {path, mode, mtime, content} = input; - const file = { - path: path || '', - mode: ipfsUnixfs.parseMode(mode), - mtime: ipfsUnixfs.parseMtime(mtime) - }; - if (content) { - file.content = await normaliseContent(content); - } else if (!path) { - file.content = await normaliseContent(input); + +function onion32buf (str) { + const addr = str.split(':') + if (addr.length !== 2) { + throw new Error('failed to parse onion addr: ' + addr + ' does not contain a port number') + } + if (addr[0].length !== 56) { + throw new Error('failed to parse onion addr: ' + addr[0] + ' not a Tor onion3 address.') + } + const buf = Buffer.from(base32.decode.asBytes(addr[0].toUpperCase())) + + // onion port number + const port = parseInt(addr[1], 10) + if (port < 1 || port > 65536) { + throw new Error('Port number is not in range(1, 65536)') } - return file; + const portBuf = port2buf(port) + return Buffer.concat([buf, portBuf]) } -exports.normaliseCandidateMultiple = normaliseCandidateMultiple; +function buf2onion (buf) { + const addrBytes = buf.slice(0, buf.length - 2) + const portBytes = buf.slice(buf.length - 2) + const addr = base32.encode(addrBytes).toLowerCase() + const port = buf2port(portBytes) + return addr + ':' + port +} /***/ }), -/***/ 23772: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/multiaddr/src/index.js": +/*!*********************************************!*\ + !*** ./node_modules/multiaddr/src/index.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_860070__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var errCode = __nccwpck_require__(5822); -var browserStreamToIt = __nccwpck_require__(31049); -var itPeekable = __nccwpck_require__(66140); -var utils = __nccwpck_require__(43691); -var ipfsUnixfs = __nccwpck_require__(24821); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); -var browserStreamToIt__default = /*#__PURE__*/_interopDefaultLegacy(browserStreamToIt); -var itPeekable__default = /*#__PURE__*/_interopDefaultLegacy(itPeekable); +const codec = __nested_webpack_require_860070__(/*! ./codec */ "./node_modules/multiaddr/src/codec.js") +const protocols = __nested_webpack_require_860070__(/*! ./protocols-table */ "./node_modules/multiaddr/src/protocols-table.js") +const varint = __nested_webpack_require_860070__(/*! varint */ "./node_modules/varint/index.js") +const bs58 = __nested_webpack_require_860070__(/*! bs58 */ "./node_modules/bs58/index.js") +const CID = __nested_webpack_require_860070__(/*! cids */ "./node_modules/cids/src/index.js") +const withIs = __nested_webpack_require_860070__(/*! class-is */ "./node_modules/class-is/index.js") +const inspect = Symbol.for('nodejs.util.inspect.custom') -async function* normaliseCandidateSingle(input, normaliseContent) { - if (input === null || input === undefined) { - throw errCode__default["default"](new Error(`Unexpected input: ${ input }`), 'ERR_UNEXPECTED_INPUT'); - } - if (typeof input === 'string' || input instanceof String) { - yield toFileObject(input.toString(), normaliseContent); - return; - } - if (utils.isBytes(input) || utils.isBlob(input)) { - yield toFileObject(input, normaliseContent); - return; +/** + * Creates a [multiaddr](https://github.com/multiformats/multiaddr) from + * a Buffer, String or another Multiaddr instance + * public key. + * @class Multiaddr + * @param {(String|Buffer|Multiaddr)} addr - If String or Buffer, needs to adhere + * to the address format of a [multiaddr](https://github.com/multiformats/multiaddr#string-format) + * @example + * Multiaddr('/ip4/127.0.0.1/tcp/4001') + * // + */ +const Multiaddr = withIs.proto(function (addr) { + if (!(this instanceof Multiaddr)) { + return new Multiaddr(addr) } - if (utils.isReadableStream(input)) { - input = browserStreamToIt__default["default"](input); + + // default + if (addr == null) { + addr = '' } - if (Symbol.iterator in input || Symbol.asyncIterator in input) { - const peekable = itPeekable__default["default"](input); - const {value, done} = await peekable.peek(); - if (done) { - yield { content: [] }; - return; - } - peekable.push(value); - if (Number.isInteger(value) || utils.isBytes(value) || typeof value === 'string' || value instanceof String) { - yield toFileObject(peekable, normaliseContent); - return; + + if (addr instanceof Buffer) { + /** + * @type {Buffer} - The raw bytes representing this multiaddress + */ + this.buffer = codec.fromBuffer(addr) + } else if (typeof addr === 'string' || addr instanceof String) { + if (addr.length > 0 && addr.charAt(0) !== '/') { + throw new Error(`multiaddr "${addr}" must start with a "/"`) } - 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'); - } - if (utils.isFileObject(input)) { - yield toFileObject(input, normaliseContent); - return; + this.buffer = codec.fromString(addr) + } else if (addr.buffer && addr.protos && addr.protoCodes) { // Multiaddr + this.buffer = codec.fromBuffer(addr.buffer) // validate + copy buffer + } else { + throw new Error('addr must be a string, Buffer, or another Multiaddr') } - throw errCode__default["default"](new Error('Unexpected input: cannot convert "' + typeof input + '" into ImportCandidate'), 'ERR_UNEXPECTED_INPUT'); +}, { className: 'Multiaddr', symbolName: '@multiformats/js-multiaddr/multiaddr' }) + +/** + * Returns Multiaddr as a String + * + * @returns {String} + * @example + * Multiaddr('/ip4/127.0.0.1/tcp/4001').toString() + * // '/ip4/127.0.0.1/tcp/4001' + */ +Multiaddr.prototype.toString = function toString () { + return codec.bufferToString(this.buffer) } -async function toFileObject(input, normaliseContent) { - const {path, mode, mtime, content} = input; - const file = { - path: path || '', - mode: ipfsUnixfs.parseMode(mode), - mtime: ipfsUnixfs.parseMtime(mtime) - }; - if (content) { - file.content = await normaliseContent(content); - } else if (!path) { - file.content = await normaliseContent(input); - } - return file; + +/** + * Returns Multiaddr as a JSON encoded object + * + * @returns {String} + * @example + * JSON.stringify(Multiaddr('/ip4/127.0.0.1/tcp/4001')) + * // '/ip4/127.0.0.1/tcp/4001' + */ +Multiaddr.prototype.toJSON = Multiaddr.prototype.toString + +/** + * Returns Multiaddr as a convinient options object to be used with net.createConnection + * + * @returns {{family: String, host: String, transport: String, port: Number}} + * @example + * Multiaddr('/ip4/127.0.0.1/tcp/4001').toOptions() + * // { family: 'ipv4', host: '127.0.0.1', transport: 'tcp', port: 4001 } + */ +Multiaddr.prototype.toOptions = function toOptions () { + const opts = {} + const parsed = this.toString().split('/') + opts.family = parsed[1] === 'ip4' ? 'ipv4' : 'ipv6' + opts.host = parsed[2] + opts.transport = parsed[3] + opts.port = parseInt(parsed[4]) + return opts } -exports.normaliseCandidateSingle = normaliseCandidateSingle; +/** + * Returns Multiaddr as a human-readable string. + * For post Node.js v10.0.0. + * https://nodejs.org/api/deprecations.html#deprecations_dep0079_custom_inspection_function_on_objects_via_inspect + * + * @returns {String} + * @example + * console.log(Multiaddr('/ip4/127.0.0.1/tcp/4001')) + * // '' + */ +Multiaddr.prototype[inspect] = function inspectCustom () { + return '' +} +/** + * Returns Multiaddr as a human-readable string. + * Fallback for pre Node.js v10.0.0. + * https://nodejs.org/api/deprecations.html#deprecations_dep0079_custom_inspection_function_on_objects_via_inspect + * + * @returns {String} + * @example + * Multiaddr('/ip4/127.0.0.1/tcp/4001').inspect() + * // '' + */ +Multiaddr.prototype.inspect = function inspect () { + return '' +} -/***/ }), +/** + * Returns the protocols the Multiaddr is defined with, as an array of objects, in + * left-to-right order. Each object contains the protocol code, protocol name, + * and the size of its address space in bits. + * [See list of protocols](https://github.com/multiformats/multiaddr/blob/master/protocols.csv) + * + * @returns {Array.} protocols - All the protocols the address is composed of + * @returns {Number} protocols[].code + * @returns {Number} protocols[].size + * @returns {String} protocols[].name + * @example + * Multiaddr('/ip4/127.0.0.1/tcp/4001').protos() + * // [ { code: 4, size: 32, name: 'ip4' }, + * // { code: 6, size: 16, name: 'tcp' } ] + */ +Multiaddr.prototype.protos = function protos () { + return this.protoCodes().map(code => Object.assign({}, protocols(code))) +} -/***/ 49849: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/** + * Returns the codes of the protocols in left-to-right order. + * [See list of protocols](https://github.com/multiformats/multiaddr/blob/master/protocols.csv) + * + * @returns {Array.} protocol codes + * @example + * Multiaddr('/ip4/127.0.0.1/tcp/4001').protoCodes() + * // [ 4, 6 ] + */ +Multiaddr.prototype.protoCodes = function protoCodes () { + const codes = [] + const buf = this.buffer + let i = 0 + while (i < buf.length) { + const code = varint.decode(buf, i) + const n = varint.decode.bytes -"use strict"; + const p = protocols(code) + const size = codec.sizeForAddr(p, buf.slice(i + n)) + i += (size + n) + codes.push(code) + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + return codes +} -var errCode = __nccwpck_require__(5822); -var fromString = __nccwpck_require__(39451); -var browserStreamToIt = __nccwpck_require__(31049); -var blobToIt = __nccwpck_require__(74827); -var itPeekable = __nccwpck_require__(66140); -var all = __nccwpck_require__(81172); -var map = __nccwpck_require__(6305); -var utils = __nccwpck_require__(43691); +/** + * Returns the names of the protocols in left-to-right order. + * [See list of protocols](https://github.com/multiformats/multiaddr/blob/master/protocols.csv) + * + * @return {Array.} protocol names + * @example + * Multiaddr('/ip4/127.0.0.1/tcp/4001').protoNames() + * // [ 'ip4', 'tcp' ] + */ +Multiaddr.prototype.protoNames = function protoNames () { + return this.protos().map(proto => proto.name) +} -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +/** + * Returns a tuple of parts + * + * @return {Array.} tuples + * @return {Number} tuples[].0 code of protocol + * @return {Buffer} tuples[].1 contents of address + * @example + * Multiaddr("/ip4/127.0.0.1/tcp/4001").tuples() + * // [ [ 4, ], [ 6, ] ] + */ +Multiaddr.prototype.tuples = function tuples () { + return codec.bufferToTuples(this.buffer) +} -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); -var browserStreamToIt__default = /*#__PURE__*/_interopDefaultLegacy(browserStreamToIt); -var blobToIt__default = /*#__PURE__*/_interopDefaultLegacy(blobToIt); -var itPeekable__default = /*#__PURE__*/_interopDefaultLegacy(itPeekable); -var all__default = /*#__PURE__*/_interopDefaultLegacy(all); -var map__default = /*#__PURE__*/_interopDefaultLegacy(map); +/** + * Returns a tuple of string/number parts + * + * @return {Array.} tuples + * @return {Number} tuples[].0 code of protocol + * @return {(String|Number)} tuples[].1 contents of address + * @example + * Multiaddr("/ip4/127.0.0.1/tcp/4001").stringTuples() + * // [ [ 4, '127.0.0.1' ], [ 6, 4001 ] ] + */ +Multiaddr.prototype.stringTuples = function stringTuples () { + const t = codec.bufferToTuples(this.buffer) + return codec.tuplesToStringTuples(t) +} -async function* toAsyncIterable(thing) { - yield thing; +/** + * Encapsulates a Multiaddr in another Multiaddr + * + * @param {Multiaddr} addr - Multiaddr to add into this Multiaddr + * @return {Multiaddr} + * @example + * const mh1 = Multiaddr('/ip4/8.8.8.8/tcp/1080') + * // + * + * const mh2 = Multiaddr('/ip4/127.0.0.1/tcp/4001') + * // + * + * const mh3 = mh1.encapsulate(mh2) + * // + * + * mh3.toString() + * // '/ip4/8.8.8.8/tcp/1080/ip4/127.0.0.1/tcp/4001' + */ +Multiaddr.prototype.encapsulate = function encapsulate (addr) { + addr = Multiaddr(addr) + return Multiaddr(this.toString() + addr.toString()) } -async function normaliseContent(input) { - if (utils.isBytes(input)) { - return toAsyncIterable(toBytes(input)); - } - if (typeof input === 'string' || input instanceof String) { - return toAsyncIterable(toBytes(input.toString())); - } - if (utils.isBlob(input)) { - return blobToIt__default["default"](input); - } - if (utils.isReadableStream(input)) { - input = browserStreamToIt__default["default"](input); - } - if (Symbol.iterator in input || Symbol.asyncIterator in input) { - const peekable = itPeekable__default["default"](input); - const {value, done} = await peekable.peek(); - if (done) { - return toAsyncIterable(new Uint8Array(0)); - } - peekable.push(value); - if (Number.isInteger(value)) { - return toAsyncIterable(Uint8Array.from(await all__default["default"](peekable))); - } - if (utils.isBytes(value) || typeof value === 'string' || value instanceof String) { - return map__default["default"](peekable, toBytes); - } + +/** + * Decapsulates a Multiaddr from another Multiaddr + * + * @param {Multiaddr} addr - Multiaddr to remove from this Multiaddr + * @return {Multiaddr} + * @example + * const mh1 = Multiaddr('/ip4/8.8.8.8/tcp/1080') + * // + * + * const mh2 = Multiaddr('/ip4/127.0.0.1/tcp/4001') + * // + * + * const mh3 = mh1.encapsulate(mh2) + * // + * + * mh3.decapsulate(mh2).toString() + * // '/ip4/8.8.8.8/tcp/1080' + */ +Multiaddr.prototype.decapsulate = function decapsulate (addr) { + addr = addr.toString() + const s = this.toString() + const i = s.lastIndexOf(addr) + if (i < 0) { + throw new Error('Address ' + this + ' does not contain subaddress: ' + addr) } - throw errCode__default["default"](new Error(`Unexpected input: ${ input }`), 'ERR_UNEXPECTED_INPUT'); + return Multiaddr(s.slice(0, i)) } -function toBytes(chunk) { - if (chunk instanceof Uint8Array) { - return chunk; - } - if (ArrayBuffer.isView(chunk)) { - return new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength); - } - if (chunk instanceof ArrayBuffer) { - return new Uint8Array(chunk); - } - if (Array.isArray(chunk)) { - return Uint8Array.from(chunk); + +/** + * A more reliable version of `decapsulate` if you are targeting a + * specific code, such as 421 (the `p2p` protocol code). The last index of the code + * will be removed from the `Multiaddr`, and a new instance will be returned. + * If the code is not present, the original `Multiaddr` is returned. + * + * @param {Number} code The code of the protocol to decapsulate from this Multiaddr + * @return {Multiaddr} + * @example + * const addr = Multiaddr('/ip4/0.0.0.0/tcp/8080/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC') + * // + * + * addr.decapsulateCode(421).toString() + * // '/ip4/0.0.0.0/tcp/8080' + * + * Multiaddr('/ip4/127.0.0.1/tcp/8080').decapsulateCode(421).toString() + * // '/ip4/127.0.0.1/tcp/8080' + */ +Multiaddr.prototype.decapsulateCode = function decapsulateCode (code) { + const tuples = this.tuples() + for (let i = tuples.length - 1; i >= 0; i--) { + if (tuples[i][0] === code) { + return Multiaddr(codec.tuplesToBuffer(tuples.slice(0, i))) + } } - return fromString.fromString(chunk.toString()); + return this } -exports.normaliseContent = normaliseContent; - - -/***/ }), - -/***/ 36708: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); +/** + * Extract the peerId if the multiaddr contains one + * + * @return {String|null} peerId - The id of the peer or null if invalid or missing from the ma + * @example + * const mh1 = Multiaddr('/ip4/8.8.8.8/tcp/1080/ipfs/QmValidBase58string') + * // + * + * // should return QmValidBase58string or null if the id is missing or invalid + * const peerId = mh1.getPeerId() + */ +Multiaddr.prototype.getPeerId = function getPeerId () { + let b58str = null + try { + const tuples = this.stringTuples().filter((tuple) => { + if (tuple[0] === protocols.names.ipfs.code) { + return true + } + }) -var normaliseContent = __nccwpck_require__(49849); -var normaliseCandidateMultiple = __nccwpck_require__(98381); + // Get the last id + b58str = tuples.pop()[1] + // Get multihash, unwrap from CID if needed + b58str = bs58.encode(new CID(b58str).multihash) + } catch (e) { + b58str = null + } -function normaliseInput(input) { - return normaliseCandidateMultiple.normaliseCandidateMultiple(input, normaliseContent.normaliseContent); + return b58str } -exports.normaliseInput = normaliseInput; - - -/***/ }), - -/***/ 82806: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var normaliseContent = __nccwpck_require__(49849); -var normaliseCandidateSingle = __nccwpck_require__(23772); +/** + * Extract the path if the multiaddr contains one + * + * @return {String|null} path - The path of the multiaddr, or null if no path protocol is present + * @example + * const mh1 = Multiaddr('/ip4/8.8.8.8/tcp/1080/unix/tmp/p2p.sock') + * // + * + * // should return utf8 string or null if the id is missing or invalid + * const path = mh1.getPath() + */ +Multiaddr.prototype.getPath = function getPath () { + let path = null + try { + path = this.stringTuples().filter((tuple) => { + const proto = protocols(tuple[0]) + if (proto.path) { + return true + } + })[0][1] + } catch (e) { + path = null + } -function normaliseInput(input) { - return normaliseCandidateSingle.normaliseCandidateSingle(input, normaliseContent.normaliseContent); + return path } -exports.normaliseInput = normaliseInput; - - -/***/ }), - -/***/ 43691: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -function isBytes(obj) { - return ArrayBuffer.isView(obj) || obj instanceof ArrayBuffer; -} -function isBlob(obj) { - return obj.constructor && (obj.constructor.name === 'Blob' || obj.constructor.name === 'File') && typeof obj.stream === 'function'; -} -function isFileObject(obj) { - return typeof obj === 'object' && (obj.path || obj.content); +/** + * Checks if two Multiaddrs are the same + * + * @param {Multiaddr} addr + * @return {Bool} + * @example + * const mh1 = Multiaddr('/ip4/8.8.8.8/tcp/1080') + * // + * + * const mh2 = Multiaddr('/ip4/127.0.0.1/tcp/4001') + * // + * + * mh1.equals(mh1) + * // true + * + * mh1.equals(mh2) + * // false + */ +Multiaddr.prototype.equals = function equals (addr) { + return this.buffer.equals(addr.buffer) } -const isReadableStream = value => value && typeof value.getReader === 'function'; - -exports.isBlob = isBlob; -exports.isBytes = isBytes; -exports.isFileObject = isFileObject; -exports.isReadableStream = isReadableStream; - - -/***/ }), - -/***/ 34290: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -// minimal library entry point. - - -module.exports = __nccwpck_require__(51539); - - -/***/ }), - -/***/ 51539: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - - -var protobuf = exports; /** - * Build type, one of `"full"`, `"light"` or `"minimal"`. - * @name build - * @type {string} - * @const + * Gets a Multiaddrs node-friendly address object. Note that protocol information + * is left out: in Node (and most network systems) the protocol is unknowable + * given only the address. + * + * Has to be a ThinWaist Address, otherwise throws error + * + * @returns {{family: String, address: String, port: Number}} + * @throws {Error} Throws error if Multiaddr is not a Thin Waist address + * @example + * Multiaddr('/ip4/127.0.0.1/tcp/4001').nodeAddress() + * // {family: 'IPv4', address: '127.0.0.1', port: '4001'} */ -protobuf.build = "minimal"; +Multiaddr.prototype.nodeAddress = function nodeAddress () { + const codes = this.protoCodes() + const names = this.protoNames() + const parts = this.toString().split('/').slice(1) -// Serialization -protobuf.Writer = __nccwpck_require__(18583); -protobuf.BufferWriter = __nccwpck_require__(41779); -protobuf.Reader = __nccwpck_require__(40118); -protobuf.BufferReader = __nccwpck_require__(65886); + if (parts.length < 4) { + throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6}/{address}/{tcp, udp}/{port}".') + } else if (codes[0] !== 4 && codes[0] !== 41 && codes[0] !== 54 && codes[0] !== 55) { + throw new Error(`no protocol with name: "'${names[0]}'". Must have a valid family name: "{ip4, ip6, dns4, dns6}".`) + } else if (parts[2] !== 'tcp' && parts[2] !== 'udp') { + throw new Error(`no protocol with name: "'${names[1]}'". Must have a valid transport protocol: "{tcp, udp}".`) + } -// Utility -protobuf.util = __nccwpck_require__(14512); -protobuf.rpc = __nccwpck_require__(57978); -protobuf.roots = __nccwpck_require__(19080); -protobuf.configure = configure; + return { + family: (codes[0] === 41 || codes[0] === 55) ? 6 : 4, + address: parts[1], // ip addr + port: parseInt(parts[3]) // tcp or udp port + } +} -/* istanbul ignore next */ /** - * Reconfigures the library according to the environment. - * @returns {undefined} + * Creates a Multiaddr from a node-friendly address object + * + * @param {{family: String, address: String, port: Number}} addr + * @param {String} transport + * @returns {Multiaddr} multiaddr + * @throws {Error} Throws error if addr is not truthy + * @throws {Error} Throws error if transport is not truthy + * @example + * Multiaddr.fromNodeAddress({address: '127.0.0.1', port: '4001'}, 'tcp') + * // */ -function configure() { - protobuf.util._configure(); - protobuf.Writer._configure(protobuf.BufferWriter); - protobuf.Reader._configure(protobuf.BufferReader); -} - -// Set up buffer utility according to the environment -configure(); - - -/***/ }), - -/***/ 40118: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - -module.exports = Reader; - -var util = __nccwpck_require__(14512); - -var BufferReader; // cyclic - -var LongBits = util.LongBits, - utf8 = util.utf8; - -/* istanbul ignore next */ -function indexOutOfRange(reader, writeLength) { - return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); +Multiaddr.fromNodeAddress = function fromNodeAddress (addr, transport) { + if (!addr) throw new Error('requires node address object') + if (!transport) throw new Error('requires transport protocol') + const ip = (addr.family === 'IPv6') ? 'ip6' : 'ip4' + return Multiaddr('/' + [ip, addr.address, transport, addr.port].join('/')) } +// TODO find a better example, not sure about it's good enough /** - * Constructs a new reader instance using the specified buffer. - * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. - * @constructor - * @param {Uint8Array} buffer Buffer to read from + * Returns if a Multiaddr is a Thin Waist address or not. + * + * Thin Waist is if a Multiaddr adheres to the standard combination of: + * + * `{IPv4, IPv6}/{TCP, UDP}` + * + * @param {Multiaddr} [addr] - Defaults to using `this` instance + * @returns {Boolean} isThinWaistAddress + * @example + * const mh1 = Multiaddr('/ip4/127.0.0.1/tcp/4001') + * // + * const mh2 = Multiaddr('/ip4/192.168.2.1/tcp/5001') + * // + * const mh3 = mh1.encapsulate(mh2) + * // + * mh1.isThinWaistAddress() + * // true + * mh2.isThinWaistAddress() + * // true + * mh3.isThinWaistAddress() + * // false */ -function Reader(buffer) { - - /** - * Read buffer. - * @type {Uint8Array} - */ - this.buf = buffer; +Multiaddr.prototype.isThinWaistAddress = function isThinWaistAddress (addr) { + const protos = (addr || this).protos() - /** - * Read buffer position. - * @type {number} - */ - this.pos = 0; + if (protos.length !== 2) { + return false + } - /** - * Read buffer length. - * @type {number} - */ - this.len = buffer.length; + if (protos[0].code !== 4 && protos[0].code !== 41) { + return false + } + if (protos[1].code !== 6 && protos[1].code !== 273) { + return false + } + return true } -var create_array = typeof Uint8Array !== "undefined" - ? function create_typed_array(buffer) { - if (buffer instanceof Uint8Array || Array.isArray(buffer)) - return new Reader(buffer); - throw Error("illegal buffer"); - } - /* istanbul ignore next */ - : function create_array(buffer) { - if (Array.isArray(buffer)) - return new Reader(buffer); - throw Error("illegal buffer"); - }; - -var create = function create() { - return util.Buffer - ? function create_buffer_setup(buffer) { - return (Reader.create = function create_buffer(buffer) { - return util.Buffer.isBuffer(buffer) - ? new BufferReader(buffer) - /* istanbul ignore next */ - : create_array(buffer); - })(buffer); - } - /* istanbul ignore next */ - : create_array; -}; - -<<<<<<< HEAD /** - * Creates a new reader using the specified buffer. - * @function - * @param {Uint8Array|Buffer} buffer Buffer to read from - * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} - * @throws {Error} If `buffer` is not a valid buffer + * Object containing table, names and codes of all supported protocols. + * To get the protocol values from a Multiaddr, you can use + * [`.protos()`](#multiaddrprotos), + * [`.protoCodes()`](#multiaddrprotocodes) or + * [`.protoNames()`](#multiaddrprotonames) + * + * @instance + * @returns {{table: Array, names: Object, codes: Object}} + * */ -Reader.create = create(); - -Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; +Multiaddr.protocols = protocols /** - * Reads a varint as an unsigned 32 bit value. - * @function - * @returns {number} Value read + * Returns if something is a Multiaddr that is a name + * + * @param {Multiaddr} addr + * @return {Bool} isName */ -Reader.prototype.uint32 = (function read_uint32_setup() { - var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) - return function read_uint32() { - value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; - - /* istanbul ignore if */ - if ((this.pos += 5) > this.len) { - this.pos = this.len; - throw indexOutOfRange(this, 10); - } - return value; - }; -})(); +Multiaddr.isName = function isName (addr) { + if (!Multiaddr.isMultiaddr(addr)) { + return false + } -/** - * Reads a varint as a signed 32 bit value. - * @returns {number} Value read - */ -Reader.prototype.int32 = function read_int32() { - return this.uint32() | 0; -}; + // if a part of the multiaddr is resolvable, then return true + return addr.protos().some((proto) => proto.resolvable) +} /** - * Reads a zig-zag encoded varint as a signed 32 bit value. - * @returns {number} Value read + * Returns an array of multiaddrs, by resolving the multiaddr that is a name + * + * @async + * @param {Multiaddr} addr + * @return {Multiaddr[]} */ -Reader.prototype.sint32 = function read_sint32() { - var value = this.uint32(); - return value >>> 1 ^ -(value & 1) | 0; -}; +Multiaddr.resolve = function resolve (addr) { + if (!Multiaddr.isMultiaddr(addr) || !Multiaddr.isName(addr)) { + return Promise.reject(Error('not a valid name')) + } -/* eslint-disable no-invalid-this */ + /* + * Needs more consideration from spec design: + * - what to return + * - how to achieve it in the browser? + */ + return Promise.reject(new Error('not implemented yet')) +} -function readLongVarint() { - // tends to deopt with local vars for octet etc. - var bits = new LongBits(0, 0); - var i = 0; - if (this.len - this.pos > 4) { // fast route (lo) - for (; i < 4; ++i) { - // 1st..4th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - // 5th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; - bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - i = 0; - } else { - for (; i < 3; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - // 1st..3th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; -======= -module.exports = agent; +exports = module.exports = Multiaddr /***/ }), -/***/ 91946: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/multiaddr/src/protocols-table.js": +/*!*******************************************************!*\ + !*** ./node_modules/multiaddr/src/protocols-table.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var errCode = __nccwpck_require__(5822); -var browserStreamToIt = __nccwpck_require__(31049); -var itPeekable = __nccwpck_require__(66140); -var map = __nccwpck_require__(6305); -var utils = __nccwpck_require__(35630); -var ipfsUnixfs = __nccwpck_require__(24821); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); -var browserStreamToIt__default = /*#__PURE__*/_interopDefaultLegacy(browserStreamToIt); -var itPeekable__default = /*#__PURE__*/_interopDefaultLegacy(itPeekable); -var map__default = /*#__PURE__*/_interopDefaultLegacy(map); - -async function* normaliseCandidateMultiple(input, normaliseContent) { - if (typeof input === 'string' || input instanceof String || utils.isBytes(input) || utils.isBlob(input) || input._readableState) { - 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'); - } - if (utils.isReadableStream(input)) { - input = browserStreamToIt__default["default"](input); - } - if (Symbol.iterator in input || Symbol.asyncIterator in input) { - const peekable = itPeekable__default["default"](input); - const {value, done} = await peekable.peek(); - if (done) { - yield* []; - return; - } - peekable.push(value); - if (Number.isInteger(value)) { - 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'); - } - if (value._readableState) { - yield* map__default["default"](peekable, value => toFileObject({ content: value }, normaliseContent)); - return; - } - if (utils.isBytes(value)) { - yield toFileObject({ content: peekable }, normaliseContent); - return; +function Protocols (proto) { + if (typeof (proto) === 'number') { + if (Protocols.codes[proto]) { + return Protocols.codes[proto] } - if (utils.isFileObject(value) || value[Symbol.iterator] || value[Symbol.asyncIterator] || utils.isReadableStream(value) || utils.isBlob(value)) { - yield* map__default["default"](peekable, value => toFileObject(value, normaliseContent)); - return; + + throw new Error('no protocol with code: ' + proto) + } else if (typeof (proto) === 'string' || proto instanceof String) { + if (Protocols.names[proto]) { + return Protocols.names[proto] } + + throw new Error('no protocol with name: ' + proto) } - if (utils.isFileObject(input)) { - 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'); - } - throw errCode__default["default"](new Error('Unexpected input: ' + typeof input), 'ERR_UNEXPECTED_INPUT'); -} -async function toFileObject(input, normaliseContent) { - const {path, mode, mtime, content} = input; - const file = { - path: path || '', - mode: ipfsUnixfs.parseMode(mode), - mtime: ipfsUnixfs.parseMtime(mtime) - }; - if (content) { - file.content = await normaliseContent(content); - } else if (!path) { - file.content = await normaliseContent(input); - } - return file; + + throw new Error('invalid protocol id type: ' + proto) } -exports.normaliseCandidateMultiple = normaliseCandidateMultiple; +const V = -1 +Protocols.lengthPrefixedVarSize = V +Protocols.V = V + +Protocols.table = [ + [4, 32, 'ip4'], + [6, 16, 'tcp'], + [33, 16, 'dccp'], + [41, 128, 'ip6'], + [42, V, 'ip6zone'], + [53, V, 'dns', 'resolvable'], + [54, V, 'dns4', 'resolvable'], + [55, V, 'dns6', 'resolvable'], + [56, V, 'dnsaddr', 'resolvable'], + [132, 16, 'sctp'], + [273, 16, 'udp'], + [275, 0, 'p2p-webrtc-star'], + [276, 0, 'p2p-webrtc-direct'], + [277, 0, 'p2p-stardust'], + [290, 0, 'p2p-circuit'], + [301, 0, 'udt'], + [302, 0, 'utp'], + [400, V, 'unix', false, 'path'], + // `ipfs` is added before `p2p` for legacy support. + // All text representations will default to `p2p`, but `ipfs` will + // still be supported + [421, V, 'ipfs'], + // `p2p` is the preferred name for 421, and is now the default + [421, V, 'p2p'], + [443, 0, 'https'], + [444, 96, 'onion'], + [445, 296, 'onion3'], + [446, V, 'garlic64'], + [460, 0, 'quic'], + [477, 0, 'ws'], + [478, 0, 'wss'], + [479, 0, 'p2p-websocket-star'], + [480, 0, 'http'] +] + +Protocols.names = {} +Protocols.codes = {} +// populate tables +Protocols.table.map(row => { + const proto = p.apply(null, row) + Protocols.codes[proto.code] = proto + Protocols.names[proto.name] = proto +}) -/***/ }), +Protocols.object = p -/***/ 89926: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +function p (code, size, name, resolvable, path) { + return { + code: code, + size: size, + name: name, + resolvable: Boolean(resolvable), + path: Boolean(path) + } +} -"use strict"; +module.exports = Protocols -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ }), -var errCode = __nccwpck_require__(5822); -var browserStreamToIt = __nccwpck_require__(31049); -var itPeekable = __nccwpck_require__(66140); -var utils = __nccwpck_require__(35630); -var ipfsUnixfs = __nccwpck_require__(24821); +/***/ "./node_modules/multibase/src/base.js": +/*!********************************************!*\ + !*** ./node_modules/multibase/src/base.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +"use strict"; -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); -var browserStreamToIt__default = /*#__PURE__*/_interopDefaultLegacy(browserStreamToIt); -var itPeekable__default = /*#__PURE__*/_interopDefaultLegacy(itPeekable); -async function* normaliseCandidateSingle(input, normaliseContent) { - if (input === null || input === undefined) { - throw errCode__default["default"](new Error(`Unexpected input: ${ input }`), 'ERR_UNEXPECTED_INPUT'); - } - if (typeof input === 'string' || input instanceof String) { - yield toFileObject(input.toString(), normaliseContent); - return; - } - if (utils.isBytes(input) || utils.isBlob(input)) { - yield toFileObject(input, normaliseContent); - return; - } - if (utils.isReadableStream(input)) { - input = browserStreamToIt__default["default"](input); - } - if (Symbol.iterator in input || Symbol.asyncIterator in input) { - const peekable = itPeekable__default["default"](input); - const {value, done} = await peekable.peek(); - if (done) { - yield { content: [] }; - return; - } - peekable.push(value); - if (Number.isInteger(value) || utils.isBytes(value) || typeof value === 'string' || value instanceof String) { - yield toFileObject(peekable, normaliseContent); - return; +class Base { + constructor (name, code, implementation, alphabet) { + this.name = name + this.code = code + this.alphabet = alphabet + if (implementation && alphabet) { + this.engine = implementation(alphabet) } - 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'); } - if (utils.isFileObject(input)) { - yield toFileObject(input, normaliseContent); - return; + + encode (stringOrBuffer) { + return this.engine.encode(stringOrBuffer) } - throw errCode__default["default"](new Error('Unexpected input: cannot convert "' + typeof input + '" into ImportCandidate'), 'ERR_UNEXPECTED_INPUT'); -} -async function toFileObject(input, normaliseContent) { - const {path, mode, mtime, content} = input; - const file = { - path: path || '', - mode: ipfsUnixfs.parseMode(mode), - mtime: ipfsUnixfs.parseMtime(mtime) - }; - if (content) { - file.content = await normaliseContent(content); - } else if (!path) { - file.content = await normaliseContent(input); + + decode (stringOrBuffer) { + return this.engine.decode(stringOrBuffer) + } + + isImplemented () { + return this.engine } - return file; } -exports.normaliseCandidateSingle = normaliseCandidateSingle; +module.exports = Base /***/ }), -/***/ 31890: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/multibase/src/base16.js": +/*!**********************************************!*\ + !*** ./node_modules/multibase/src/base16.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var errCode = __nccwpck_require__(5822); -var itPeekable = __nccwpck_require__(66140); -var browserStreamToIt = __nccwpck_require__(31049); -var all = __nccwpck_require__(81172); -var utils = __nccwpck_require__(35630); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); -var itPeekable__default = /*#__PURE__*/_interopDefaultLegacy(itPeekable); -var browserStreamToIt__default = /*#__PURE__*/_interopDefaultLegacy(browserStreamToIt); -var all__default = /*#__PURE__*/_interopDefaultLegacy(all); - -async function normaliseContent(input) { - if (utils.isBytes(input)) { - return new Blob([input]); - } - if (typeof input === 'string' || input instanceof String) { - return new Blob([input.toString()]); - } - if (utils.isBlob(input)) { - return input; - } - if (utils.isReadableStream(input)) { - input = browserStreamToIt__default["default"](input); - } - if (Symbol.iterator in input || Symbol.asyncIterator in input) { - const peekable = itPeekable__default["default"](input); - const {value, done} = await peekable.peek(); - if (done) { - return itToBlob(peekable); - } - peekable.push(value); - if (Number.isInteger(value)) { - return new Blob([Uint8Array.from(await all__default["default"](peekable))]); - } - if (utils.isBytes(value) || typeof value === 'string' || value instanceof String) { - return itToBlob(peekable); +module.exports = function base16 (alphabet) { + return { + encode (input) { + if (typeof input === 'string') { + return Buffer.from(input).toString('hex') + } + return input.toString('hex') + }, + decode (input) { + for (let char of input) { + if (alphabet.indexOf(char) < 0) { + throw new Error('invalid base16 character') + } + } + return Buffer.from(input, 'hex') } } - throw errCode__default["default"](new Error(`Unexpected input: ${ input }`), 'ERR_UNEXPECTED_INPUT'); -} -async function itToBlob(stream) { - const parts = []; - for await (const chunk of stream) { - parts.push(chunk); - } - return new Blob(parts); } -exports.normaliseContent = normaliseContent; - /***/ }), -/***/ 20604: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/multibase/src/base32.js": +/*!**********************************************!*\ + !*** ./node_modules/multibase/src/base32.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +function decode (input, alphabet) { + input = input.replace(new RegExp('=', 'g'), '') + let length = input.length -var errCode = __nccwpck_require__(5822); -var fromString = __nccwpck_require__(39451); -var browserStreamToIt = __nccwpck_require__(31049); -var blobToIt = __nccwpck_require__(74827); -var itPeekable = __nccwpck_require__(66140); -var all = __nccwpck_require__(81172); -var map = __nccwpck_require__(6305); -var utils = __nccwpck_require__(35630); + let bits = 0 + let value = 0 -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + let index = 0 + let output = new Uint8Array((length * 5 / 8) | 0) -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); -var browserStreamToIt__default = /*#__PURE__*/_interopDefaultLegacy(browserStreamToIt); -var blobToIt__default = /*#__PURE__*/_interopDefaultLegacy(blobToIt); -var itPeekable__default = /*#__PURE__*/_interopDefaultLegacy(itPeekable); -var all__default = /*#__PURE__*/_interopDefaultLegacy(all); -var map__default = /*#__PURE__*/_interopDefaultLegacy(map); + for (let i = 0; i < length; i++) { + value = (value << 5) | alphabet.indexOf(input[i]) + bits += 5 -async function* toAsyncIterable(thing) { - yield thing; -} -async function normaliseContent(input) { - if (utils.isBytes(input)) { - return toAsyncIterable(toBytes(input)); - } - if (typeof input === 'string' || input instanceof String) { - return toAsyncIterable(toBytes(input.toString())); - } - if (utils.isBlob(input)) { - return blobToIt__default["default"](input); - } - if (utils.isReadableStream(input)) { - input = browserStreamToIt__default["default"](input); - } - if (Symbol.iterator in input || Symbol.asyncIterator in input) { - const peekable = itPeekable__default["default"](input); - const {value, done} = await peekable.peek(); - if (done) { - return toAsyncIterable(new Uint8Array(0)); - } - peekable.push(value); - if (Number.isInteger(value)) { - return toAsyncIterable(Uint8Array.from(await all__default["default"](peekable))); - } - if (utils.isBytes(value) || typeof value === 'string' || value instanceof String) { - return map__default["default"](peekable, toBytes); + if (bits >= 8) { + output[index++] = (value >>> (bits - 8)) & 255 + bits -= 8 } } - throw errCode__default["default"](new Error(`Unexpected input: ${ input }`), 'ERR_UNEXPECTED_INPUT'); + + return output.buffer } -function toBytes(chunk) { - if (chunk instanceof Uint8Array) { - return chunk; - } - if (ArrayBuffer.isView(chunk)) { - return new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength); - } - if (chunk instanceof ArrayBuffer) { - return new Uint8Array(chunk); - } - if (Array.isArray(chunk)) { - return Uint8Array.from(chunk); + +function encode (buffer, alphabet) { + let length = buffer.byteLength + let view = new Uint8Array(buffer) + let padding = alphabet.indexOf('=') === alphabet.length - 1 + + if (padding) { + alphabet = alphabet.substring(0, alphabet.length - 2) } - return fromString.fromString(chunk.toString()); -} -exports.normaliseContent = normaliseContent; + let bits = 0 + let value = 0 + let output = '' + for (let i = 0; i < length; i++) { + value = (value << 8) | view[i] + bits += 8 -/***/ }), + while (bits >= 5) { + output += alphabet[(value >>> (bits - 5)) & 31] + bits -= 5 + } + } -/***/ 19666: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (bits > 0) { + output += alphabet[(value << (5 - bits)) & 31] + } -"use strict"; + if (padding) { + while ((output.length % 8) !== 0) { + output += '=' + } + } + return output +} -Object.defineProperty(exports, "__esModule", ({ value: true })); +module.exports = function base32 (alphabet) { + return { + encode (input) { + if (typeof input === 'string') { + return encode(Buffer.from(input), alphabet) + } -var normaliseContent_browser = __nccwpck_require__(31890); -var normaliseCandidateMultiple = __nccwpck_require__(91946); + return encode(input, alphabet) + }, + decode (input) { + for (let char of input) { + if (alphabet.indexOf(char) < 0) { + throw new Error('invalid base32 character') + } + } -function normaliseInput(input) { - return normaliseCandidateMultiple.normaliseCandidateMultiple(input, normaliseContent_browser.normaliseContent, true); + return decode(input, alphabet) + } + } } -exports.normaliseInput = normaliseInput; - /***/ }), -/***/ 46416: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/multibase/src/base64.js": +/*!**********************************************!*\ + !*** ./node_modules/multibase/src/base64.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var normaliseContent = __nccwpck_require__(20604); -var normaliseCandidateMultiple = __nccwpck_require__(91946); - -function normaliseInput(input) { - return normaliseCandidateMultiple.normaliseCandidateMultiple(input, normaliseContent.normaliseContent); -} - -exports.normaliseInput = normaliseInput; - - -/***/ }), +module.exports = function base64 (alphabet) { + // The alphabet is only used to know: + // 1. If padding is enabled (must contain '=') + // 2. If the output must be url-safe (must contain '-' and '_') + // 3. If the input of the output function is valid + // The alphabets from RFC 4648 are always used. + const padding = alphabet.indexOf('=') > -1 + const url = alphabet.indexOf('-') > -1 && alphabet.indexOf('_') > -1 -/***/ 75400: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + return { + encode (input) { + let output = '' -"use strict"; + if (typeof input === 'string') { + output = Buffer.from(input).toString('base64') + } else { + output = input.toString('base64') + } + if (url) { + output = output.replace(/\+/g, '-').replace(/\//g, '_') + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + const pad = output.indexOf('=') + if (pad > 0 && !padding) { + output = output.substring(0, pad) + } -var normaliseContent = __nccwpck_require__(20604); -var normaliseCandidateSingle = __nccwpck_require__(89926); + return output + }, + decode (input) { + for (let char of input) { + if (alphabet.indexOf(char) < 0) { + throw new Error('invalid base64 character') + } + } -function normaliseInput(input) { - return normaliseCandidateSingle.normaliseCandidateSingle(input, normaliseContent.normaliseContent); + return Buffer.from(input, 'base64') + } + } } -exports.normaliseInput = normaliseInput; - /***/ }), -/***/ 35630: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/multibase/src/constants.js": +/*!*************************************************!*\ + !*** ./node_modules/multibase/src/constants.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_883710__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +const Base = __nested_webpack_require_883710__(/*! ./base.js */ "./node_modules/multibase/src/base.js") +const baseX = __nested_webpack_require_883710__(/*! base-x */ "./node_modules/base-x/src/index.js") +const base16 = __nested_webpack_require_883710__(/*! ./base16 */ "./node_modules/multibase/src/base16.js") +const base32 = __nested_webpack_require_883710__(/*! ./base32 */ "./node_modules/multibase/src/base32.js") +const base64 = __nested_webpack_require_883710__(/*! ./base64 */ "./node_modules/multibase/src/base64.js") -function isBytes(obj) { - return ArrayBuffer.isView(obj) || obj instanceof ArrayBuffer; -} -function isBlob(obj) { - return obj.constructor && (obj.constructor.name === 'Blob' || obj.constructor.name === 'File') && typeof obj.stream === 'function'; -} -function isFileObject(obj) { - return typeof obj === 'object' && (obj.path || obj.content); -} -const isReadableStream = value => value && typeof value.getReader === 'function'; +// name, code, implementation, alphabet +const constants = [ + ['base1', '1', '', '1'], + ['base2', '0', baseX, '01'], + ['base8', '7', baseX, '01234567'], + ['base10', '9', baseX, '0123456789'], + ['base16', 'f', base16, '0123456789abcdef'], + ['base32', 'b', base32, 'abcdefghijklmnopqrstuvwxyz234567'], + ['base32pad', 'c', base32, 'abcdefghijklmnopqrstuvwxyz234567='], + ['base32hex', 'v', base32, '0123456789abcdefghijklmnopqrstuv'], + ['base32hexpad', 't', base32, '0123456789abcdefghijklmnopqrstuv='], + ['base32z', 'h', base32, 'ybndrfg8ejkmcpqxot1uwisza345h769'], + ['base58flickr', 'Z', baseX, '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'], + ['base58btc', 'z', baseX, '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'], + ['base64', 'm', base64, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'], + ['base64pad', 'M', base64, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='], + ['base64url', 'u', base64, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'], + ['base64urlpad', 'U', base64, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_='] +] + +const names = constants.reduce((prev, tupple) => { + prev[tupple[0]] = new Base(tupple[0], tupple[1], tupple[2], tupple[3]) + return prev +}, {}) + +const codes = constants.reduce((prev, tupple) => { + prev[tupple[1]] = names[tupple[0]] + return prev +}, {}) -exports.isBlob = isBlob; -exports.isBytes = isBytes; -exports.isFileObject = isFileObject; -exports.isReadableStream = isReadableStream; +module.exports = { + names: names, + codes: codes +} /***/ }), -/***/ 1295: -/***/ ((__unused_webpack_module, exports) => { +/***/ "./node_modules/multibase/src/index.js": +/*!*********************************************!*\ + !*** ./node_modules/multibase/src/index.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_885943__) { "use strict"; +/** + * Implementation of the [multibase](https://github.com/multiformats/multibase) specification. + * @module Multibase + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); +const constants = __nested_webpack_require_885943__(/*! ./constants */ "./node_modules/multibase/src/constants.js") -function modeToString(mode) { - if (mode == null) { - return undefined; - } - if (typeof mode === 'string') { - return mode; - } - return mode.toString(8).padStart(4, '0'); -} +exports = module.exports = multibase +exports.encode = encode +exports.decode = decode +exports.isEncoded = isEncoded +exports.names = Object.freeze(Object.keys(constants.names)) +exports.codes = Object.freeze(Object.keys(constants.codes)) -exports.modeToString = modeToString; +const errNotSupported = new Error('Unsupported encoding') +/** + * Create a new buffer with the multibase varint+code. + * + * @param {string|number} nameOrCode - The multibase name or code number. + * @param {Buffer} buf - The data to be prefixed with multibase. + * @memberof Multibase + * @returns {Buffer} + */ +function multibase (nameOrCode, buf) { + if (!buf) { + throw new Error('requires an encoded buffer') + } + const base = getBase(nameOrCode) + const codeBuf = Buffer.from(base.code) -/***/ }), + const name = base.name + validEncode(name, buf) + return Buffer.concat([codeBuf, buf]) +} -/***/ 61560: -/***/ ((__unused_webpack_module, exports) => { +/** + * Encode data with the specified base and add the multibase prefix. + * + * @param {string|number} nameOrCode - The multibase name or code number. + * @param {Buffer} buf - The data to be encoded. + * @returns {Buffer} + * @memberof Multibase + */ +function encode (nameOrCode, buf) { + const base = getBase(nameOrCode) + const name = base.name -"use strict"; + return multibase(name, Buffer.from(base.encode(buf))) +} +/** + * Takes a buffer or string encoded with multibase header, decodes it and + * returns the decoded buffer + * + * @param {Buffer|string} bufOrString + * @returns {Buffer} + * @memberof Multibase + * + */ +function decode (bufOrString) { + if (Buffer.isBuffer(bufOrString)) { + bufOrString = bufOrString.toString() + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + const code = bufOrString.substring(0, 1) + bufOrString = bufOrString.substring(1, bufOrString.length) -const LOAD_BASE = name => Promise.reject(new Error(`No base found for "${ name }"`)); -class Multibases { - constructor(options) { - this._basesByName = {}; - this._basesByPrefix = {}; - this._loadBase = options.loadBase || LOAD_BASE; - for (const base of options.bases) { - this.addBase(base); - } - } - addBase(base) { - if (this._basesByName[base.name] || this._basesByPrefix[base.prefix]) { - throw new Error(`Codec already exists for codec "${ base.name }"`); - } - this._basesByName[base.name] = base; - this._basesByPrefix[base.prefix] = base; - } - removeBase(base) { - delete this._basesByName[base.name]; - delete this._basesByPrefix[base.prefix]; - } - async getBase(nameOrPrefix) { - if (this._basesByName[nameOrPrefix]) { - return this._basesByName[nameOrPrefix]; - } - if (this._basesByPrefix[nameOrPrefix]) { - return this._basesByPrefix[nameOrPrefix]; - } - const base = await this._loadBase(nameOrPrefix); - if (this._basesByName[base.name] == null && this._basesByPrefix[base.prefix] == null) { - this.addBase(base); - } - return base; - } - listBases() { - return Object.values(this._basesByName); + if (typeof bufOrString === 'string') { + bufOrString = Buffer.from(bufOrString) } -} - -exports.Multibases = Multibases; + const base = getBase(code) + return Buffer.from(base.decode(bufOrString.toString())) +} -/***/ }), +/** + * Is the given data multibase encoded? + * + * @param {Buffer|string} bufOrString + * @returns {boolean} + * @memberof Multibase + */ +function isEncoded (bufOrString) { + if (Buffer.isBuffer(bufOrString)) { + bufOrString = bufOrString.toString() + } -/***/ 83319: -/***/ ((__unused_webpack_module, exports) => { + // Ensure bufOrString is a string + if (Object.prototype.toString.call(bufOrString) !== '[object String]') { + return false + } -"use strict"; + const code = bufOrString.substring(0, 1) + try { + const base = getBase(code) + return base.name + } catch (err) { + return false + } +} +/** + * @param {string} name + * @param {Buffer} buf + * @private + * @returns {undefined} + */ +function validEncode (name, buf) { + const base = getBase(name) + base.decode(buf.toString()) +} -Object.defineProperty(exports, "__esModule", ({ value: true })); +function getBase (nameOrCode) { + let base -const LOAD_CODEC = codeOrName => Promise.reject(new Error(`No codec found for "${ codeOrName }"`)); -class Multicodecs { - constructor(options) { - this._codecsByName = {}; - this._codecsByCode = {}; - this._loadCodec = options.loadCodec || LOAD_CODEC; - for (const codec of options.codecs) { - this.addCodec(codec); - } - } - addCodec(codec) { - if (this._codecsByName[codec.name] || this._codecsByCode[codec.code]) { - throw new Error(`Resolver already exists for codec "${ codec.name }"`); - } - this._codecsByName[codec.name] = codec; - this._codecsByCode[codec.code] = codec; - } - removeCodec(codec) { - delete this._codecsByName[codec.name]; - delete this._codecsByCode[codec.code]; - } - async getCodec(code) { - const table = typeof code === 'string' ? this._codecsByName : this._codecsByCode; - if (table[code]) { - return table[code]; - } - const codec = await this._loadCodec(code); - if (table[code] == null) { - this.addCodec(codec); - } - return codec; + if (constants.names[nameOrCode]) { + base = constants.names[nameOrCode] + } else if (constants.codes[nameOrCode]) { + base = constants.codes[nameOrCode] + } else { + throw errNotSupported } - listCodecs() { - return Object.values(this._codecsByName); + + if (!base.isImplemented()) { + throw new Error('Base ' + nameOrCode + ' is not implemented yet') } -} -exports.Multicodecs = Multicodecs; + return base +} /***/ }), -/***/ 5529: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +/***/ "./node_modules/multicodec/src/base-table.json": +/*!*****************************************************!*\ + !*** ./node_modules/multicodec/src/base-table.json ***! + \*****************************************************/ +/*! exports provided: identity, ip4, tcp, sha1, sha2-256, sha2-512, sha3-512, sha3-384, sha3-256, sha3-224, shake-128, shake-256, keccak-224, keccak-256, keccak-384, keccak-512, dccp, murmur3-128, murmur3-32, ip6, ip6zone, path, multicodec, multihash, multiaddr, multibase, dns, dns4, dns6, dnsaddr, protobuf, cbor, raw, dbl-sha2-256, rlp, bencode, dag-pb, dag-cbor, libp2p-key, git-raw, torrent-info, torrent-file, leofcoin-block, leofcoin-tx, leofcoin-pr, sctp, eth-block, eth-block-list, eth-tx-trie, eth-tx, eth-tx-receipt-trie, eth-tx-receipt, eth-state-trie, eth-account-snapshot, eth-storage-trie, bitcoin-block, bitcoin-tx, zcash-block, zcash-tx, stellar-block, stellar-tx, md4, md5, bmt, decred-block, decred-tx, ipld-ns, ipfs-ns, swarm-ns, ipns-ns, zeronet, ed25519-pub, dash-block, dash-tx, swarm-manifest, swarm-feed, udp, p2p-webrtc-star, p2p-webrtc-direct, p2p-stardust, p2p-circuit, dag-json, udt, utp, unix, p2p, ipfs, https, onion, onion3, garlic64, garlic32, tls, quic, ws, wss, p2p-websocket-star, http, json, messagepack, x11, blake2b-8, blake2b-16, blake2b-24, blake2b-32, blake2b-40, blake2b-48, blake2b-56, blake2b-64, blake2b-72, blake2b-80, blake2b-88, blake2b-96, blake2b-104, blake2b-112, blake2b-120, blake2b-128, blake2b-136, blake2b-144, blake2b-152, blake2b-160, blake2b-168, blake2b-176, blake2b-184, blake2b-192, blake2b-200, blake2b-208, blake2b-216, blake2b-224, blake2b-232, blake2b-240, blake2b-248, blake2b-256, blake2b-264, blake2b-272, blake2b-280, blake2b-288, blake2b-296, blake2b-304, blake2b-312, blake2b-320, blake2b-328, blake2b-336, blake2b-344, blake2b-352, blake2b-360, blake2b-368, blake2b-376, blake2b-384, blake2b-392, blake2b-400, blake2b-408, blake2b-416, blake2b-424, blake2b-432, blake2b-440, blake2b-448, blake2b-456, blake2b-464, blake2b-472, blake2b-480, blake2b-488, blake2b-496, blake2b-504, blake2b-512, blake2s-8, blake2s-16, blake2s-24, blake2s-32, blake2s-40, blake2s-48, blake2s-56, blake2s-64, blake2s-72, blake2s-80, blake2s-88, blake2s-96, blake2s-104, blake2s-112, blake2s-120, blake2s-128, blake2s-136, blake2s-144, blake2s-152, blake2s-160, blake2s-168, blake2s-176, blake2s-184, blake2s-192, blake2s-200, blake2s-208, blake2s-216, blake2s-224, blake2s-232, blake2s-240, blake2s-248, blake2s-256, skein256-8, skein256-16, skein256-24, skein256-32, skein256-40, skein256-48, skein256-56, skein256-64, skein256-72, skein256-80, skein256-88, skein256-96, skein256-104, skein256-112, skein256-120, skein256-128, skein256-136, skein256-144, skein256-152, skein256-160, skein256-168, skein256-176, skein256-184, skein256-192, skein256-200, skein256-208, skein256-216, skein256-224, skein256-232, skein256-240, skein256-248, skein256-256, skein512-8, skein512-16, skein512-24, skein512-32, skein512-40, skein512-48, skein512-56, skein512-64, skein512-72, skein512-80, skein512-88, skein512-96, skein512-104, skein512-112, skein512-120, skein512-128, skein512-136, skein512-144, skein512-152, skein512-160, skein512-168, skein512-176, skein512-184, skein512-192, skein512-200, skein512-208, skein512-216, skein512-224, skein512-232, skein512-240, skein512-248, skein512-256, skein512-264, skein512-272, skein512-280, skein512-288, skein512-296, skein512-304, skein512-312, skein512-320, skein512-328, skein512-336, skein512-344, skein512-352, skein512-360, skein512-368, skein512-376, skein512-384, skein512-392, skein512-400, skein512-408, skein512-416, skein512-424, skein512-432, skein512-440, skein512-448, skein512-456, skein512-464, skein512-472, skein512-480, skein512-488, skein512-496, skein512-504, skein512-512, skein1024-8, skein1024-16, skein1024-24, skein1024-32, skein1024-40, skein1024-48, skein1024-56, skein1024-64, skein1024-72, skein1024-80, skein1024-88, skein1024-96, skein1024-104, skein1024-112, skein1024-120, skein1024-128, skein1024-136, skein1024-144, skein1024-152, skein1024-160, skein1024-168, skein1024-176, skein1024-184, skein1024-192, skein1024-200, skein1024-208, skein1024-216, skein1024-224, skein1024-232, skein1024-240, skein1024-248, skein1024-256, skein1024-264, skein1024-272, skein1024-280, skein1024-288, skein1024-296, skein1024-304, skein1024-312, skein1024-320, skein1024-328, skein1024-336, skein1024-344, skein1024-352, skein1024-360, skein1024-368, skein1024-376, skein1024-384, skein1024-392, skein1024-400, skein1024-408, skein1024-416, skein1024-424, skein1024-432, skein1024-440, skein1024-448, skein1024-456, skein1024-464, skein1024-472, skein1024-480, skein1024-488, skein1024-496, skein1024-504, skein1024-512, skein1024-520, skein1024-528, skein1024-536, skein1024-544, skein1024-552, skein1024-560, skein1024-568, skein1024-576, skein1024-584, skein1024-592, skein1024-600, skein1024-608, skein1024-616, skein1024-624, skein1024-632, skein1024-640, skein1024-648, skein1024-656, skein1024-664, skein1024-672, skein1024-680, skein1024-688, skein1024-696, skein1024-704, skein1024-712, skein1024-720, skein1024-728, skein1024-736, skein1024-744, skein1024-752, skein1024-760, skein1024-768, skein1024-776, skein1024-784, skein1024-792, skein1024-800, skein1024-808, skein1024-816, skein1024-824, skein1024-832, skein1024-840, skein1024-848, skein1024-856, skein1024-864, skein1024-872, skein1024-880, skein1024-888, skein1024-896, skein1024-904, skein1024-912, skein1024-920, skein1024-928, skein1024-936, skein1024-944, skein1024-952, skein1024-960, skein1024-968, skein1024-976, skein1024-984, skein1024-992, skein1024-1000, skein1024-1008, skein1024-1016, skein1024-1024, holochain-adr-v0, holochain-adr-v1, holochain-key-v0, holochain-key-v1, holochain-sig-v0, holochain-sig-v1, default */ +/***/ (function(module) { +module.exports = JSON.parse("{\"identity\":0,\"ip4\":4,\"tcp\":6,\"sha1\":17,\"sha2-256\":18,\"sha2-512\":19,\"sha3-512\":20,\"sha3-384\":21,\"sha3-256\":22,\"sha3-224\":23,\"shake-128\":24,\"shake-256\":25,\"keccak-224\":26,\"keccak-256\":27,\"keccak-384\":28,\"keccak-512\":29,\"dccp\":33,\"murmur3-128\":34,\"murmur3-32\":35,\"ip6\":41,\"ip6zone\":42,\"path\":47,\"multicodec\":48,\"multihash\":49,\"multiaddr\":50,\"multibase\":51,\"dns\":53,\"dns4\":54,\"dns6\":55,\"dnsaddr\":56,\"protobuf\":80,\"cbor\":81,\"raw\":85,\"dbl-sha2-256\":86,\"rlp\":96,\"bencode\":99,\"dag-pb\":112,\"dag-cbor\":113,\"libp2p-key\":114,\"git-raw\":120,\"torrent-info\":123,\"torrent-file\":124,\"leofcoin-block\":129,\"leofcoin-tx\":130,\"leofcoin-pr\":131,\"sctp\":132,\"eth-block\":144,\"eth-block-list\":145,\"eth-tx-trie\":146,\"eth-tx\":147,\"eth-tx-receipt-trie\":148,\"eth-tx-receipt\":149,\"eth-state-trie\":150,\"eth-account-snapshot\":151,\"eth-storage-trie\":152,\"bitcoin-block\":176,\"bitcoin-tx\":177,\"zcash-block\":192,\"zcash-tx\":193,\"stellar-block\":208,\"stellar-tx\":209,\"md4\":212,\"md5\":213,\"bmt\":214,\"decred-block\":224,\"decred-tx\":225,\"ipld-ns\":226,\"ipfs-ns\":227,\"swarm-ns\":228,\"ipns-ns\":229,\"zeronet\":230,\"ed25519-pub\":237,\"dash-block\":240,\"dash-tx\":241,\"swarm-manifest\":250,\"swarm-feed\":251,\"udp\":273,\"p2p-webrtc-star\":275,\"p2p-webrtc-direct\":276,\"p2p-stardust\":277,\"p2p-circuit\":290,\"dag-json\":297,\"udt\":301,\"utp\":302,\"unix\":400,\"p2p\":421,\"ipfs\":421,\"https\":443,\"onion\":444,\"onion3\":445,\"garlic64\":446,\"garlic32\":447,\"tls\":448,\"quic\":460,\"ws\":477,\"wss\":478,\"p2p-websocket-star\":479,\"http\":480,\"json\":512,\"messagepack\":513,\"x11\":4352,\"blake2b-8\":45569,\"blake2b-16\":45570,\"blake2b-24\":45571,\"blake2b-32\":45572,\"blake2b-40\":45573,\"blake2b-48\":45574,\"blake2b-56\":45575,\"blake2b-64\":45576,\"blake2b-72\":45577,\"blake2b-80\":45578,\"blake2b-88\":45579,\"blake2b-96\":45580,\"blake2b-104\":45581,\"blake2b-112\":45582,\"blake2b-120\":45583,\"blake2b-128\":45584,\"blake2b-136\":45585,\"blake2b-144\":45586,\"blake2b-152\":45587,\"blake2b-160\":45588,\"blake2b-168\":45589,\"blake2b-176\":45590,\"blake2b-184\":45591,\"blake2b-192\":45592,\"blake2b-200\":45593,\"blake2b-208\":45594,\"blake2b-216\":45595,\"blake2b-224\":45596,\"blake2b-232\":45597,\"blake2b-240\":45598,\"blake2b-248\":45599,\"blake2b-256\":45600,\"blake2b-264\":45601,\"blake2b-272\":45602,\"blake2b-280\":45603,\"blake2b-288\":45604,\"blake2b-296\":45605,\"blake2b-304\":45606,\"blake2b-312\":45607,\"blake2b-320\":45608,\"blake2b-328\":45609,\"blake2b-336\":45610,\"blake2b-344\":45611,\"blake2b-352\":45612,\"blake2b-360\":45613,\"blake2b-368\":45614,\"blake2b-376\":45615,\"blake2b-384\":45616,\"blake2b-392\":45617,\"blake2b-400\":45618,\"blake2b-408\":45619,\"blake2b-416\":45620,\"blake2b-424\":45621,\"blake2b-432\":45622,\"blake2b-440\":45623,\"blake2b-448\":45624,\"blake2b-456\":45625,\"blake2b-464\":45626,\"blake2b-472\":45627,\"blake2b-480\":45628,\"blake2b-488\":45629,\"blake2b-496\":45630,\"blake2b-504\":45631,\"blake2b-512\":45632,\"blake2s-8\":45633,\"blake2s-16\":45634,\"blake2s-24\":45635,\"blake2s-32\":45636,\"blake2s-40\":45637,\"blake2s-48\":45638,\"blake2s-56\":45639,\"blake2s-64\":45640,\"blake2s-72\":45641,\"blake2s-80\":45642,\"blake2s-88\":45643,\"blake2s-96\":45644,\"blake2s-104\":45645,\"blake2s-112\":45646,\"blake2s-120\":45647,\"blake2s-128\":45648,\"blake2s-136\":45649,\"blake2s-144\":45650,\"blake2s-152\":45651,\"blake2s-160\":45652,\"blake2s-168\":45653,\"blake2s-176\":45654,\"blake2s-184\":45655,\"blake2s-192\":45656,\"blake2s-200\":45657,\"blake2s-208\":45658,\"blake2s-216\":45659,\"blake2s-224\":45660,\"blake2s-232\":45661,\"blake2s-240\":45662,\"blake2s-248\":45663,\"blake2s-256\":45664,\"skein256-8\":45825,\"skein256-16\":45826,\"skein256-24\":45827,\"skein256-32\":45828,\"skein256-40\":45829,\"skein256-48\":45830,\"skein256-56\":45831,\"skein256-64\":45832,\"skein256-72\":45833,\"skein256-80\":45834,\"skein256-88\":45835,\"skein256-96\":45836,\"skein256-104\":45837,\"skein256-112\":45838,\"skein256-120\":45839,\"skein256-128\":45840,\"skein256-136\":45841,\"skein256-144\":45842,\"skein256-152\":45843,\"skein256-160\":45844,\"skein256-168\":45845,\"skein256-176\":45846,\"skein256-184\":45847,\"skein256-192\":45848,\"skein256-200\":45849,\"skein256-208\":45850,\"skein256-216\":45851,\"skein256-224\":45852,\"skein256-232\":45853,\"skein256-240\":45854,\"skein256-248\":45855,\"skein256-256\":45856,\"skein512-8\":45857,\"skein512-16\":45858,\"skein512-24\":45859,\"skein512-32\":45860,\"skein512-40\":45861,\"skein512-48\":45862,\"skein512-56\":45863,\"skein512-64\":45864,\"skein512-72\":45865,\"skein512-80\":45866,\"skein512-88\":45867,\"skein512-96\":45868,\"skein512-104\":45869,\"skein512-112\":45870,\"skein512-120\":45871,\"skein512-128\":45872,\"skein512-136\":45873,\"skein512-144\":45874,\"skein512-152\":45875,\"skein512-160\":45876,\"skein512-168\":45877,\"skein512-176\":45878,\"skein512-184\":45879,\"skein512-192\":45880,\"skein512-200\":45881,\"skein512-208\":45882,\"skein512-216\":45883,\"skein512-224\":45884,\"skein512-232\":45885,\"skein512-240\":45886,\"skein512-248\":45887,\"skein512-256\":45888,\"skein512-264\":45889,\"skein512-272\":45890,\"skein512-280\":45891,\"skein512-288\":45892,\"skein512-296\":45893,\"skein512-304\":45894,\"skein512-312\":45895,\"skein512-320\":45896,\"skein512-328\":45897,\"skein512-336\":45898,\"skein512-344\":45899,\"skein512-352\":45900,\"skein512-360\":45901,\"skein512-368\":45902,\"skein512-376\":45903,\"skein512-384\":45904,\"skein512-392\":45905,\"skein512-400\":45906,\"skein512-408\":45907,\"skein512-416\":45908,\"skein512-424\":45909,\"skein512-432\":45910,\"skein512-440\":45911,\"skein512-448\":45912,\"skein512-456\":45913,\"skein512-464\":45914,\"skein512-472\":45915,\"skein512-480\":45916,\"skein512-488\":45917,\"skein512-496\":45918,\"skein512-504\":45919,\"skein512-512\":45920,\"skein1024-8\":45921,\"skein1024-16\":45922,\"skein1024-24\":45923,\"skein1024-32\":45924,\"skein1024-40\":45925,\"skein1024-48\":45926,\"skein1024-56\":45927,\"skein1024-64\":45928,\"skein1024-72\":45929,\"skein1024-80\":45930,\"skein1024-88\":45931,\"skein1024-96\":45932,\"skein1024-104\":45933,\"skein1024-112\":45934,\"skein1024-120\":45935,\"skein1024-128\":45936,\"skein1024-136\":45937,\"skein1024-144\":45938,\"skein1024-152\":45939,\"skein1024-160\":45940,\"skein1024-168\":45941,\"skein1024-176\":45942,\"skein1024-184\":45943,\"skein1024-192\":45944,\"skein1024-200\":45945,\"skein1024-208\":45946,\"skein1024-216\":45947,\"skein1024-224\":45948,\"skein1024-232\":45949,\"skein1024-240\":45950,\"skein1024-248\":45951,\"skein1024-256\":45952,\"skein1024-264\":45953,\"skein1024-272\":45954,\"skein1024-280\":45955,\"skein1024-288\":45956,\"skein1024-296\":45957,\"skein1024-304\":45958,\"skein1024-312\":45959,\"skein1024-320\":45960,\"skein1024-328\":45961,\"skein1024-336\":45962,\"skein1024-344\":45963,\"skein1024-352\":45964,\"skein1024-360\":45965,\"skein1024-368\":45966,\"skein1024-376\":45967,\"skein1024-384\":45968,\"skein1024-392\":45969,\"skein1024-400\":45970,\"skein1024-408\":45971,\"skein1024-416\":45972,\"skein1024-424\":45973,\"skein1024-432\":45974,\"skein1024-440\":45975,\"skein1024-448\":45976,\"skein1024-456\":45977,\"skein1024-464\":45978,\"skein1024-472\":45979,\"skein1024-480\":45980,\"skein1024-488\":45981,\"skein1024-496\":45982,\"skein1024-504\":45983,\"skein1024-512\":45984,\"skein1024-520\":45985,\"skein1024-528\":45986,\"skein1024-536\":45987,\"skein1024-544\":45988,\"skein1024-552\":45989,\"skein1024-560\":45990,\"skein1024-568\":45991,\"skein1024-576\":45992,\"skein1024-584\":45993,\"skein1024-592\":45994,\"skein1024-600\":45995,\"skein1024-608\":45996,\"skein1024-616\":45997,\"skein1024-624\":45998,\"skein1024-632\":45999,\"skein1024-640\":46000,\"skein1024-648\":46001,\"skein1024-656\":46002,\"skein1024-664\":46003,\"skein1024-672\":46004,\"skein1024-680\":46005,\"skein1024-688\":46006,\"skein1024-696\":46007,\"skein1024-704\":46008,\"skein1024-712\":46009,\"skein1024-720\":46010,\"skein1024-728\":46011,\"skein1024-736\":46012,\"skein1024-744\":46013,\"skein1024-752\":46014,\"skein1024-760\":46015,\"skein1024-768\":46016,\"skein1024-776\":46017,\"skein1024-784\":46018,\"skein1024-792\":46019,\"skein1024-800\":46020,\"skein1024-808\":46021,\"skein1024-816\":46022,\"skein1024-824\":46023,\"skein1024-832\":46024,\"skein1024-840\":46025,\"skein1024-848\":46026,\"skein1024-856\":46027,\"skein1024-864\":46028,\"skein1024-872\":46029,\"skein1024-880\":46030,\"skein1024-888\":46031,\"skein1024-896\":46032,\"skein1024-904\":46033,\"skein1024-912\":46034,\"skein1024-920\":46035,\"skein1024-928\":46036,\"skein1024-936\":46037,\"skein1024-944\":46038,\"skein1024-952\":46039,\"skein1024-960\":46040,\"skein1024-968\":46041,\"skein1024-976\":46042,\"skein1024-984\":46043,\"skein1024-992\":46044,\"skein1024-1000\":46045,\"skein1024-1008\":46046,\"skein1024-1016\":46047,\"skein1024-1024\":46048,\"holochain-adr-v0\":8417572,\"holochain-adr-v1\":8483108,\"holochain-key-v0\":9728292,\"holochain-key-v1\":9793828,\"holochain-sig-v0\":10645796,\"holochain-sig-v1\":10711332}"); -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ }), -const LOAD_HASHER = codeOrName => Promise.reject(new Error(`No hasher found for "${ codeOrName }"`)); -class Multihashes { - constructor(options) { - this._hashersByName = {}; - this._hashersByCode = {}; - this._loadHasher = options.loadHasher || LOAD_HASHER; - for (const hasher of options.hashers) { - this.addHasher(hasher); - } - } - addHasher(hasher) { - if (this._hashersByName[hasher.name] || this._hashersByCode[hasher.code]) { - throw new Error(`Resolver already exists for codec "${ hasher.name }"`); - } - this._hashersByName[hasher.name] = hasher; - this._hashersByCode[hasher.code] = hasher; - } - removeHasher(hasher) { - delete this._hashersByName[hasher.name]; - delete this._hashersByCode[hasher.code]; - } - async getHasher(code) { - const table = typeof code === 'string' ? this._hashersByName : this._hashersByCode; - if (table[code]) { - return table[code]; - } - const hasher = await this._loadHasher(code); - if (table[code] == null) { - this.addHasher(hasher); - } - return hasher; - } - listHashers() { - return Object.values(this._hashersByName); - } +/***/ "./node_modules/multicodec/src/constants.js": +/*!**************************************************!*\ + !*** ./node_modules/multicodec/src/constants.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_904537__) { + +"use strict"; + + +const table = __nested_webpack_require_904537__(/*! ./base-table.json */ "./node_modules/multicodec/src/base-table.json") + +// map for codecConstant -> code +const constants = {} + +for (const [name, code] of Object.entries(table)) { + constants[name.toUpperCase().replace(/-/g, '_')] = code } -exports.Multihashes = Multihashes; +module.exports = Object.freeze(constants) /***/ }), -/***/ 20665: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/multicodec/src/index.js": +/*!**********************************************!*\ + !*** ./node_modules/multicodec/src/index.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_905176__) { "use strict"; +/** + * Implementation of the multicodec specification. + * + * @module multicodec + * @example + * const multicodec = require('multicodec') + * + * const prefixedProtobuf = multicodec.addPrefix('protobuf', protobufBuffer) + * // prefixedProtobuf 0x50... + * + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); +const varint = __nested_webpack_require_905176__(/*! varint */ "./node_modules/varint/index.js") +const intTable = __nested_webpack_require_905176__(/*! ./int-table */ "./node_modules/multicodec/src/int-table.js") +const codecNameToCodeVarint = __nested_webpack_require_905176__(/*! ./varint-table */ "./node_modules/multicodec/src/varint-table.js") +const util = __nested_webpack_require_905176__(/*! ./util */ "./node_modules/multicodec/src/util.js") -var normaliseInputMultiple_browser = __nccwpck_require__(19666); -var modeToString = __nccwpck_require__(1295); +exports = module.exports -async function multipartRequest(source, abortController, headers = {}) { - const parts = []; - const formData = new FormData(); - let index = 0; - let total = 0; - for await (const {content, path, mode, mtime} of normaliseInputMultiple_browser.normaliseInput(source)) { - let fileSuffix = ''; - const type = content ? 'file' : 'dir'; - if (index > 0) { - fileSuffix = `-${ index }`; - } - let fieldName = type + fileSuffix; - const qs = []; - if (mode !== null && mode !== undefined) { - qs.push(`mode=${ modeToString.modeToString(mode) }`); - } - if (mtime != null) { - const {secs, nsecs} = mtime; - qs.push(`mtime=${ secs }`); - if (nsecs != null) { - qs.push(`mtime-nsecs=${ nsecs }`); - } - } - if (qs.length) { - fieldName = `${ fieldName }?${ qs.join('&') }`; - } - if (content) { - formData.set(fieldName, content, path != null ? encodeURIComponent(path) : undefined); - const end = total + content.size; - parts.push({ - name: path, - start: total, - end - }); - total = end; - } else if (path != null) { - formData.set(fieldName, new File([''], encodeURIComponent(path), { type: 'application/x-directory' })); +/** + * Prefix a buffer with a multicodec-packed. + * + * @param {string|number} multicodecStrOrCode + * @param {Buffer} data + * @returns {Buffer} + */ +exports.addPrefix = (multicodecStrOrCode, data) => { + let prefix + + if (Buffer.isBuffer(multicodecStrOrCode)) { + prefix = util.varintBufferEncode(multicodecStrOrCode) + } else { + if (codecNameToCodeVarint[multicodecStrOrCode]) { + prefix = codecNameToCodeVarint[multicodecStrOrCode] } else { - throw new Error('path or content or both must be set'); + throw new Error('multicodec not recognized') } - index++; } - return { - total, - parts, - headers, - body: formData - }; + return Buffer.concat([prefix, data]) } -exports.multipartRequest = multipartRequest; - - -/***/ }), - -/***/ 87527: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/** + * Decapsulate the multicodec-packed prefix from the data. + * + * @param {Buffer} data + * @returns {Buffer} + */ +exports.rmPrefix = (data) => { + varint.decode(data) + return data.slice(varint.decode.bytes) +} -"use strict"; +/** + * Get the codec of the prefixed data. + * @param {Buffer} prefixedData + * @returns {string} + */ +exports.getCodec = (prefixedData) => { + const code = varint.decode(prefixedData) + const codecName = intTable.get(code) + if (codecName === undefined) { + throw new Error(`Code ${code} not found`) + } + return codecName +} +/** + * Get the name of the codec. + * @param {number} codec + * @returns {string} + */ +exports.getName = (codec) => { + return intTable.get(codec) +} -Object.defineProperty(exports, "__esModule", ({ value: true })); +/** + * Get the code of the codec + * @param {string} name + * @returns {number} + */ +exports.getNumber = (name) => { + const code = codecNameToCodeVarint[name] + if (code === undefined) { + throw new Error('Codec `' + name + '` not found') + } + return util.varintBufferDecode(code)[0] +} -var env_js = __nccwpck_require__(48488); -var multipartRequest_node = __nccwpck_require__(57043); -var multipartRequest_browser = __nccwpck_require__(20665); -var nanoid = __nccwpck_require__(45835); +/** + * Get the code of the prefixed data. + * @param {Buffer} prefixedData + * @returns {number} + */ +exports.getCode = (prefixedData) => { + return varint.decode(prefixedData) +} -async function multipartRequest(source, abortController, headers = {}, boundary = `-----------------------------${ nanoid.nanoid() }`) { - let req = multipartRequest_node.multipartRequest; - if (env_js.isElectronRenderer) { - req = multipartRequest_browser.multipartRequest; +/** + * Get the code as varint of a codec name. + * @param {string} codecName + * @returns {Buffer} + */ +exports.getCodeVarint = (codecName) => { + const code = codecNameToCodeVarint[codecName] + if (code === undefined) { + throw new Error('Codec `' + codecName + '` not found') } - return req(source, abortController, headers, boundary); + return code } -exports.multipartRequest = multipartRequest; - +/** + * Get the varint of a code. + * @param {Number} code + * @returns {Array.} + */ +exports.getVarint = (code) => { + return varint.encode(code) +} -/***/ }), +// Make the constants top-level constants +const constants = __nested_webpack_require_905176__(/*! ./constants */ "./node_modules/multicodec/src/constants.js") +Object.assign(exports, constants) -/***/ 57043: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// Human friendly names for printing, e.g. in error messages +exports.print = __nested_webpack_require_905176__(/*! ./print */ "./node_modules/multicodec/src/print.js") -"use strict"; +/***/ }), -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ "./node_modules/multicodec/src/int-table.js": +/*!**************************************************!*\ + !*** ./node_modules/multicodec/src/int-table.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_908680__) { -var normaliseInputMultiple = __nccwpck_require__(46416); -var nanoid = __nccwpck_require__(45835); -var modeToString = __nccwpck_require__(1295); -var mergeOpts = __nccwpck_require__(79139); -var toStream = __nccwpck_require__(28186); -var debug = __nccwpck_require__(58923); -var itPeekable = __nccwpck_require__(66140); +"use strict"; -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +const baseTable = __nested_webpack_require_908680__(/*! ./base-table.json */ "./node_modules/multicodec/src/base-table.json") -var mergeOpts__default = /*#__PURE__*/_interopDefaultLegacy(mergeOpts); -var toStream__default = /*#__PURE__*/_interopDefaultLegacy(toStream); -var debug__default = /*#__PURE__*/_interopDefaultLegacy(debug); -var itPeekable__default = /*#__PURE__*/_interopDefaultLegacy(itPeekable); +// map for hexString -> codecName +const nameTable = new Map() -const merge = mergeOpts__default["default"].bind({ ignoreUndefined: true }); -const log = debug__default["default"]('ipfs:core-utils:multipart-request'); -async function multipartRequest(source, abortController, headers = {}, boundary = `-----------------------------${ nanoid.nanoid() }`) { - async function* streamFiles(source) { - try { - let index = 0; - for await (const {content, path, mode, mtime} of source) { - let fileSuffix = ''; - const type = content ? 'file' : 'dir'; - if (index > 0) { - yield '\r\n'; - fileSuffix = `-${ index }`; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - // 4th - bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; - return bits; - } - if (this.len - this.pos > 4) { // fast route (hi) - for (; i < 5; ++i) { - // 6th..10th - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } -<<<<<<< HEAD -======= - if (mtime != null) { - const {secs, nsecs} = mtime; - qs.push(`mtime=${ secs }`); - if (nsecs != null) { - qs.push(`mtime-nsecs=${ nsecs }`); - } - } - if (qs.length) { - fieldName = `${ fieldName }?${ qs.join('&') }`; - } - yield `--${ boundary }\r\n`; - yield `Content-Disposition: form-data; name="${ fieldName }"; filename="${ encodeURIComponent(path || '') }"\r\n`; - yield `Content-Type: ${ content ? 'application/octet-stream' : 'application/x-directory' }\r\n`; - yield '\r\n'; - if (content) { - yield* content; - } - index++; - } - } catch (err) { - log(err); - abortController.abort(); - } finally { - yield `\r\n--${ boundary }--\r\n`; - } - } - const peekable = itPeekable__default["default"](normaliseInputMultiple.normaliseInput(source)); - const {value, done} = await peekable.peek(); - if (!done) { - peekable.push(value); - } - return { - parts: null, - total: -1, - headers: merge(headers, { 'Content-Type': `multipart/form-data; boundary=${ boundary }` }), - body: toStream__default["default"](streamFiles(peekable)) - }; +for (const encodingName in baseTable) { + const code = baseTable[encodingName] + nameTable.set(code, encodingName) } -exports.multipartRequest = multipartRequest; +module.exports = Object.freeze(nameTable) /***/ }), -/***/ 44956: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/multicodec/src/print.js": +/*!**********************************************!*\ + !*** ./node_modules/multicodec/src/print.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_909335__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var errCode = __nccwpck_require__(5822); -var cid = __nccwpck_require__(24247); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +const table = __nested_webpack_require_909335__(/*! ./base-table.json */ "./node_modules/multicodec/src/base-table.json") -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); +// map for code -> print friendly name +const tableByCode = {} -async function* normaliseInput(input) { - if (input === null || input === undefined) { - throw errCode__default["default"](new Error(`Unexpected input: ${ input }`), 'ERR_UNEXPECTED_INPUT'); - } - const cid$1 = cid.CID.asCID(input); - if (cid$1) { - yield toPin({ cid: cid$1 }); - return; - } - if (input instanceof String || typeof input === 'string') { - yield toPin({ path: input }); - return; - } - if (input.cid != null || input.path != null) { - return yield toPin(input); - } - if (Symbol.iterator in input) { - const iterator = input[Symbol.iterator](); - const first = iterator.next(); - if (first.done) - return iterator; - if (cid.CID.asCID(first.value) || first.value instanceof String || typeof first.value === 'string') { - yield toPin({ cid: first.value }); - for (const cid of iterator) { - yield toPin({ cid }); - } - return; - } - if (first.value.cid != null || first.value.path != null) { - yield toPin(first.value); - for (const obj of iterator) { - yield toPin(obj); - } - return; - } - throw errCode__default["default"](new Error('Unexpected input: ' + typeof input), 'ERR_UNEXPECTED_INPUT'); - } - if (Symbol.asyncIterator in input) { - const iterator = input[Symbol.asyncIterator](); - const first = await iterator.next(); - if (first.done) - return iterator; - if (cid.CID.asCID(first.value) || first.value instanceof String || typeof first.value === 'string') { - yield toPin({ cid: first.value }); - for await (const cid of iterator) { - yield toPin({ cid }); - } - return; - } - if (first.value.cid != null || first.value.path != null) { - yield toPin(first.value); - for await (const obj of iterator) { - yield toPin(obj); - } - return; - } - throw errCode__default["default"](new Error('Unexpected input: ' + typeof input), 'ERR_UNEXPECTED_INPUT'); - } - throw errCode__default["default"](new Error('Unexpected input: ' + typeof input), 'ERR_UNEXPECTED_INPUT'); -} -function toPin(input) { - const path = input.cid || `${ input.path }`; - if (!path) { - throw errCode__default["default"](new Error('Unexpected input: Please path either a CID or an IPFS path'), 'ERR_UNEXPECTED_INPUT'); - } - const pin = { - path, - recursive: input.recursive !== false - }; - if (input.metadata != null) { - pin.metadata = input.metadata; - } - return pin; +for (const [name, code] of Object.entries(table)) { + if (tableByCode[code] === undefined) tableByCode[code] = name } -exports.normaliseInput = normaliseInput; +module.exports = Object.freeze(tableByCode) /***/ }), -/***/ 4037: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/multicodec/src/util.js": +/*!*********************************************!*\ + !*** ./node_modules/multicodec/src/util.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_909986__) { "use strict"; +const varint = __nested_webpack_require_909986__(/*! varint */ "./node_modules/varint/index.js") -Object.defineProperty(exports, "__esModule", ({ value: true })); +module.exports = { + numberToBuffer, + bufferToNumber, + varintBufferEncode, + varintBufferDecode, + varintEncode +} -var multiaddr = __nccwpck_require__(47730); -var multiAddrToUri = __nccwpck_require__(6211); +function bufferToNumber (buf) { + return parseInt(buf.toString('hex'), 16) +} -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +function numberToBuffer (num) { + let hexString = num.toString(16) + if (hexString.length % 2 === 1) { + hexString = '0' + hexString + } + return Buffer.from(hexString, 'hex') +} -var multiAddrToUri__default = /*#__PURE__*/_interopDefaultLegacy(multiAddrToUri); +function varintBufferEncode (input) { + return Buffer.from(varint.encode(bufferToNumber(input))) +} -function toUrlString(url) { - try { - url = multiAddrToUri__default["default"](new multiaddr.Multiaddr(url)); - } catch (err) { - } - url = url.toString(); - return url; +function varintBufferDecode (input) { + return numberToBuffer(varint.decode(input)) } -exports.toUrlString = toUrlString; +function varintEncode (num) { + return Buffer.from(varint.encode(num)) +} /***/ }), -/***/ 22126: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ "./node_modules/multicodec/src/varint-table.js": +/*!*****************************************************!*\ + !*** ./node_modules/multicodec/src/varint-table.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_911053__) { "use strict"; -const convert = __nccwpck_require__(59943) -const protocols = __nccwpck_require__(19612) -const varint = __nccwpck_require__(30310) -const { concat: uint8ArrayConcat } = __nccwpck_require__(17225) -const { toString: uint8ArrayToString } = __nccwpck_require__(2771) +const baseTable = __nested_webpack_require_911053__(/*! ./base-table.json */ "./node_modules/multicodec/src/base-table.json") +const varintEncode = __nested_webpack_require_911053__(/*! ./util */ "./node_modules/multicodec/src/util.js").varintEncode -// export codec -module.exports = { - stringToStringTuples, - stringTuplesToString, +// map for codecName -> codeVarintBuffer +const varintTable = {} - tuplesToStringTuples, - stringTuplesToTuples, +for (const encodingName in baseTable) { + const code = baseTable[encodingName] + varintTable[encodingName] = varintEncode(code) +} - bytesToTuples, - tuplesToBytes, +module.exports = Object.freeze(varintTable) - bytesToString, - stringToBytes, - fromString, - fromBytes, - validateBytes, - isValidBytes, - cleanPath, +/***/ }), - ParseError, - protoFromTuple, +/***/ "./node_modules/multihashes/src/constants.js": +/*!***************************************************!*\ + !*** ./node_modules/multihashes/src/constants.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { - sizeForAddr -} +"use strict"; +/* eslint quote-props: off */ +/* eslint key-spacing: off */ -// string -> [[str name, str addr]... ] -/** - * @param {string} str - */ -function stringToStringTuples (str) { - const tuples = [] - const parts = str.split('/').slice(1) // skip first empty elem - if (parts.length === 1 && parts[0] === '') { - return [] - } - for (let p = 0; p < parts.length; p++) { - const part = parts[p] - const proto = protocols(part) +exports.names = Object.freeze({ + 'identity': 0x0, + 'sha1': 0x11, + 'sha2-256': 0x12, + 'sha2-512': 0x13, + 'dbl-sha2-256': 0x56, + 'sha3-224': 0x17, + 'sha3-256': 0x16, + 'sha3-384': 0x15, + 'sha3-512': 0x14, + 'shake-128': 0x18, + 'shake-256': 0x19, + 'keccak-224': 0x1A, + 'keccak-256': 0x1B, + 'keccak-384': 0x1C, + 'keccak-512': 0x1D, + 'murmur3-128': 0x22, + 'murmur3-32': 0x23, + 'blake2b-8': 0xb201, + 'blake2b-16': 0xb202, + 'blake2b-24': 0xb203, + 'blake2b-32': 0xb204, + 'blake2b-40': 0xb205, + 'blake2b-48': 0xb206, + 'blake2b-56': 0xb207, + 'blake2b-64': 0xb208, + 'blake2b-72': 0xb209, + 'blake2b-80': 0xb20a, + 'blake2b-88': 0xb20b, + 'blake2b-96': 0xb20c, + 'blake2b-104': 0xb20d, + 'blake2b-112': 0xb20e, + 'blake2b-120': 0xb20f, + 'blake2b-128': 0xb210, + 'blake2b-136': 0xb211, + 'blake2b-144': 0xb212, + 'blake2b-152': 0xb213, + 'blake2b-160': 0xb214, + 'blake2b-168': 0xb215, + 'blake2b-176': 0xb216, + 'blake2b-184': 0xb217, + 'blake2b-192': 0xb218, + 'blake2b-200': 0xb219, + 'blake2b-208': 0xb21a, + 'blake2b-216': 0xb21b, + 'blake2b-224': 0xb21c, + 'blake2b-232': 0xb21d, + 'blake2b-240': 0xb21e, + 'blake2b-248': 0xb21f, + 'blake2b-256': 0xb220, + 'blake2b-264': 0xb221, + 'blake2b-272': 0xb222, + 'blake2b-280': 0xb223, + 'blake2b-288': 0xb224, + 'blake2b-296': 0xb225, + 'blake2b-304': 0xb226, + 'blake2b-312': 0xb227, + 'blake2b-320': 0xb228, + 'blake2b-328': 0xb229, + 'blake2b-336': 0xb22a, + 'blake2b-344': 0xb22b, + 'blake2b-352': 0xb22c, + 'blake2b-360': 0xb22d, + 'blake2b-368': 0xb22e, + 'blake2b-376': 0xb22f, + 'blake2b-384': 0xb230, + 'blake2b-392': 0xb231, + 'blake2b-400': 0xb232, + 'blake2b-408': 0xb233, + 'blake2b-416': 0xb234, + 'blake2b-424': 0xb235, + 'blake2b-432': 0xb236, + 'blake2b-440': 0xb237, + 'blake2b-448': 0xb238, + 'blake2b-456': 0xb239, + 'blake2b-464': 0xb23a, + 'blake2b-472': 0xb23b, + 'blake2b-480': 0xb23c, + 'blake2b-488': 0xb23d, + 'blake2b-496': 0xb23e, + 'blake2b-504': 0xb23f, + 'blake2b-512': 0xb240, + 'blake2s-8': 0xb241, + 'blake2s-16': 0xb242, + 'blake2s-24': 0xb243, + 'blake2s-32': 0xb244, + 'blake2s-40': 0xb245, + 'blake2s-48': 0xb246, + 'blake2s-56': 0xb247, + 'blake2s-64': 0xb248, + 'blake2s-72': 0xb249, + 'blake2s-80': 0xb24a, + 'blake2s-88': 0xb24b, + 'blake2s-96': 0xb24c, + 'blake2s-104': 0xb24d, + 'blake2s-112': 0xb24e, + 'blake2s-120': 0xb24f, + 'blake2s-128': 0xb250, + 'blake2s-136': 0xb251, + 'blake2s-144': 0xb252, + 'blake2s-152': 0xb253, + 'blake2s-160': 0xb254, + 'blake2s-168': 0xb255, + 'blake2s-176': 0xb256, + 'blake2s-184': 0xb257, + 'blake2s-192': 0xb258, + 'blake2s-200': 0xb259, + 'blake2s-208': 0xb25a, + 'blake2s-216': 0xb25b, + 'blake2s-224': 0xb25c, + 'blake2s-232': 0xb25d, + 'blake2s-240': 0xb25e, + 'blake2s-248': 0xb25f, + 'blake2s-256': 0xb260, + 'Skein256-8': 0xb301, + 'Skein256-16': 0xb302, + 'Skein256-24': 0xb303, + 'Skein256-32': 0xb304, + 'Skein256-40': 0xb305, + 'Skein256-48': 0xb306, + 'Skein256-56': 0xb307, + 'Skein256-64': 0xb308, + 'Skein256-72': 0xb309, + 'Skein256-80': 0xb30a, + 'Skein256-88': 0xb30b, + 'Skein256-96': 0xb30c, + 'Skein256-104': 0xb30d, + 'Skein256-112': 0xb30e, + 'Skein256-120': 0xb30f, + 'Skein256-128': 0xb310, + 'Skein256-136': 0xb311, + 'Skein256-144': 0xb312, + 'Skein256-152': 0xb313, + 'Skein256-160': 0xb314, + 'Skein256-168': 0xb315, + 'Skein256-176': 0xb316, + 'Skein256-184': 0xb317, + 'Skein256-192': 0xb318, + 'Skein256-200': 0xb319, + 'Skein256-208': 0xb31a, + 'Skein256-216': 0xb31b, + 'Skein256-224': 0xb31c, + 'Skein256-232': 0xb31d, + 'Skein256-240': 0xb31e, + 'Skein256-248': 0xb31f, + 'Skein256-256': 0xb320, + 'Skein512-8': 0xb321, + 'Skein512-16': 0xb322, + 'Skein512-24': 0xb323, + 'Skein512-32': 0xb324, + 'Skein512-40': 0xb325, + 'Skein512-48': 0xb326, + 'Skein512-56': 0xb327, + 'Skein512-64': 0xb328, + 'Skein512-72': 0xb329, + 'Skein512-80': 0xb32a, + 'Skein512-88': 0xb32b, + 'Skein512-96': 0xb32c, + 'Skein512-104': 0xb32d, + 'Skein512-112': 0xb32e, + 'Skein512-120': 0xb32f, + 'Skein512-128': 0xb330, + 'Skein512-136': 0xb331, + 'Skein512-144': 0xb332, + 'Skein512-152': 0xb333, + 'Skein512-160': 0xb334, + 'Skein512-168': 0xb335, + 'Skein512-176': 0xb336, + 'Skein512-184': 0xb337, + 'Skein512-192': 0xb338, + 'Skein512-200': 0xb339, + 'Skein512-208': 0xb33a, + 'Skein512-216': 0xb33b, + 'Skein512-224': 0xb33c, + 'Skein512-232': 0xb33d, + 'Skein512-240': 0xb33e, + 'Skein512-248': 0xb33f, + 'Skein512-256': 0xb340, + 'Skein512-264': 0xb341, + 'Skein512-272': 0xb342, + 'Skein512-280': 0xb343, + 'Skein512-288': 0xb344, + 'Skein512-296': 0xb345, + 'Skein512-304': 0xb346, + 'Skein512-312': 0xb347, + 'Skein512-320': 0xb348, + 'Skein512-328': 0xb349, + 'Skein512-336': 0xb34a, + 'Skein512-344': 0xb34b, + 'Skein512-352': 0xb34c, + 'Skein512-360': 0xb34d, + 'Skein512-368': 0xb34e, + 'Skein512-376': 0xb34f, + 'Skein512-384': 0xb350, + 'Skein512-392': 0xb351, + 'Skein512-400': 0xb352, + 'Skein512-408': 0xb353, + 'Skein512-416': 0xb354, + 'Skein512-424': 0xb355, + 'Skein512-432': 0xb356, + 'Skein512-440': 0xb357, + 'Skein512-448': 0xb358, + 'Skein512-456': 0xb359, + 'Skein512-464': 0xb35a, + 'Skein512-472': 0xb35b, + 'Skein512-480': 0xb35c, + 'Skein512-488': 0xb35d, + 'Skein512-496': 0xb35e, + 'Skein512-504': 0xb35f, + 'Skein512-512': 0xb360, + 'Skein1024-8': 0xb361, + 'Skein1024-16': 0xb362, + 'Skein1024-24': 0xb363, + 'Skein1024-32': 0xb364, + 'Skein1024-40': 0xb365, + 'Skein1024-48': 0xb366, + 'Skein1024-56': 0xb367, + 'Skein1024-64': 0xb368, + 'Skein1024-72': 0xb369, + 'Skein1024-80': 0xb36a, + 'Skein1024-88': 0xb36b, + 'Skein1024-96': 0xb36c, + 'Skein1024-104': 0xb36d, + 'Skein1024-112': 0xb36e, + 'Skein1024-120': 0xb36f, + 'Skein1024-128': 0xb370, + 'Skein1024-136': 0xb371, + 'Skein1024-144': 0xb372, + 'Skein1024-152': 0xb373, + 'Skein1024-160': 0xb374, + 'Skein1024-168': 0xb375, + 'Skein1024-176': 0xb376, + 'Skein1024-184': 0xb377, + 'Skein1024-192': 0xb378, + 'Skein1024-200': 0xb379, + 'Skein1024-208': 0xb37a, + 'Skein1024-216': 0xb37b, + 'Skein1024-224': 0xb37c, + 'Skein1024-232': 0xb37d, + 'Skein1024-240': 0xb37e, + 'Skein1024-248': 0xb37f, + 'Skein1024-256': 0xb380, + 'Skein1024-264': 0xb381, + 'Skein1024-272': 0xb382, + 'Skein1024-280': 0xb383, + 'Skein1024-288': 0xb384, + 'Skein1024-296': 0xb385, + 'Skein1024-304': 0xb386, + 'Skein1024-312': 0xb387, + 'Skein1024-320': 0xb388, + 'Skein1024-328': 0xb389, + 'Skein1024-336': 0xb38a, + 'Skein1024-344': 0xb38b, + 'Skein1024-352': 0xb38c, + 'Skein1024-360': 0xb38d, + 'Skein1024-368': 0xb38e, + 'Skein1024-376': 0xb38f, + 'Skein1024-384': 0xb390, + 'Skein1024-392': 0xb391, + 'Skein1024-400': 0xb392, + 'Skein1024-408': 0xb393, + 'Skein1024-416': 0xb394, + 'Skein1024-424': 0xb395, + 'Skein1024-432': 0xb396, + 'Skein1024-440': 0xb397, + 'Skein1024-448': 0xb398, + 'Skein1024-456': 0xb399, + 'Skein1024-464': 0xb39a, + 'Skein1024-472': 0xb39b, + 'Skein1024-480': 0xb39c, + 'Skein1024-488': 0xb39d, + 'Skein1024-496': 0xb39e, + 'Skein1024-504': 0xb39f, + 'Skein1024-512': 0xb3a0, + 'Skein1024-520': 0xb3a1, + 'Skein1024-528': 0xb3a2, + 'Skein1024-536': 0xb3a3, + 'Skein1024-544': 0xb3a4, + 'Skein1024-552': 0xb3a5, + 'Skein1024-560': 0xb3a6, + 'Skein1024-568': 0xb3a7, + 'Skein1024-576': 0xb3a8, + 'Skein1024-584': 0xb3a9, + 'Skein1024-592': 0xb3aa, + 'Skein1024-600': 0xb3ab, + 'Skein1024-608': 0xb3ac, + 'Skein1024-616': 0xb3ad, + 'Skein1024-624': 0xb3ae, + 'Skein1024-632': 0xb3af, + 'Skein1024-640': 0xb3b0, + 'Skein1024-648': 0xb3b1, + 'Skein1024-656': 0xb3b2, + 'Skein1024-664': 0xb3b3, + 'Skein1024-672': 0xb3b4, + 'Skein1024-680': 0xb3b5, + 'Skein1024-688': 0xb3b6, + 'Skein1024-696': 0xb3b7, + 'Skein1024-704': 0xb3b8, + 'Skein1024-712': 0xb3b9, + 'Skein1024-720': 0xb3ba, + 'Skein1024-728': 0xb3bb, + 'Skein1024-736': 0xb3bc, + 'Skein1024-744': 0xb3bd, + 'Skein1024-752': 0xb3be, + 'Skein1024-760': 0xb3bf, + 'Skein1024-768': 0xb3c0, + 'Skein1024-776': 0xb3c1, + 'Skein1024-784': 0xb3c2, + 'Skein1024-792': 0xb3c3, + 'Skein1024-800': 0xb3c4, + 'Skein1024-808': 0xb3c5, + 'Skein1024-816': 0xb3c6, + 'Skein1024-824': 0xb3c7, + 'Skein1024-832': 0xb3c8, + 'Skein1024-840': 0xb3c9, + 'Skein1024-848': 0xb3ca, + 'Skein1024-856': 0xb3cb, + 'Skein1024-864': 0xb3cc, + 'Skein1024-872': 0xb3cd, + 'Skein1024-880': 0xb3ce, + 'Skein1024-888': 0xb3cf, + 'Skein1024-896': 0xb3d0, + 'Skein1024-904': 0xb3d1, + 'Skein1024-912': 0xb3d2, + 'Skein1024-920': 0xb3d3, + 'Skein1024-928': 0xb3d4, + 'Skein1024-936': 0xb3d5, + 'Skein1024-944': 0xb3d6, + 'Skein1024-952': 0xb3d7, + 'Skein1024-960': 0xb3d8, + 'Skein1024-968': 0xb3d9, + 'Skein1024-976': 0xb3da, + 'Skein1024-984': 0xb3db, + 'Skein1024-992': 0xb3dc, + 'Skein1024-1000': 0xb3dd, + 'Skein1024-1008': 0xb3de, + 'Skein1024-1016': 0xb3df, + 'Skein1024-1024': 0xb3e0 +}) - if (proto.size === 0) { - tuples.push([part]) - continue - } +exports.codes = Object.freeze({ + 0x0: 'identity', - p++ // advance addr part - if (p >= parts.length) { - throw ParseError('invalid address: ' + str) - } + // sha family + 0x11: 'sha1', + 0x12: 'sha2-256', + 0x13: 'sha2-512', + 0x56: 'dbl-sha2-256', + 0x17: 'sha3-224', + 0x16: 'sha3-256', + 0x15: 'sha3-384', + 0x14: 'sha3-512', + 0x18: 'shake-128', + 0x19: 'shake-256', + 0x1A: 'keccak-224', + 0x1B: 'keccak-256', + 0x1C: 'keccak-384', + 0x1D: 'keccak-512', - // if it's a path proto, take the rest - if (proto.path) { - tuples.push([ - part, - // TODO: should we need to check each path part to see if it's a proto? - // This would allow for other protocols to be added after a unix path, - // however it would have issues if the path had a protocol name in the path - cleanPath(parts.slice(p).join('/')) - ]) - break - } + 0x22: 'murmur3-128', + 0x23: 'murmur3-32', + + // blake2 + 0xb201: 'blake2b-8', + 0xb202: 'blake2b-16', + 0xb203: 'blake2b-24', + 0xb204: 'blake2b-32', + 0xb205: 'blake2b-40', + 0xb206: 'blake2b-48', + 0xb207: 'blake2b-56', + 0xb208: 'blake2b-64', + 0xb209: 'blake2b-72', + 0xb20a: 'blake2b-80', + 0xb20b: 'blake2b-88', + 0xb20c: 'blake2b-96', + 0xb20d: 'blake2b-104', + 0xb20e: 'blake2b-112', + 0xb20f: 'blake2b-120', + 0xb210: 'blake2b-128', + 0xb211: 'blake2b-136', + 0xb212: 'blake2b-144', + 0xb213: 'blake2b-152', + 0xb214: 'blake2b-160', + 0xb215: 'blake2b-168', + 0xb216: 'blake2b-176', + 0xb217: 'blake2b-184', + 0xb218: 'blake2b-192', + 0xb219: 'blake2b-200', + 0xb21a: 'blake2b-208', + 0xb21b: 'blake2b-216', + 0xb21c: 'blake2b-224', + 0xb21d: 'blake2b-232', + 0xb21e: 'blake2b-240', + 0xb21f: 'blake2b-248', + 0xb220: 'blake2b-256', + 0xb221: 'blake2b-264', + 0xb222: 'blake2b-272', + 0xb223: 'blake2b-280', + 0xb224: 'blake2b-288', + 0xb225: 'blake2b-296', + 0xb226: 'blake2b-304', + 0xb227: 'blake2b-312', + 0xb228: 'blake2b-320', + 0xb229: 'blake2b-328', + 0xb22a: 'blake2b-336', + 0xb22b: 'blake2b-344', + 0xb22c: 'blake2b-352', + 0xb22d: 'blake2b-360', + 0xb22e: 'blake2b-368', + 0xb22f: 'blake2b-376', + 0xb230: 'blake2b-384', + 0xb231: 'blake2b-392', + 0xb232: 'blake2b-400', + 0xb233: 'blake2b-408', + 0xb234: 'blake2b-416', + 0xb235: 'blake2b-424', + 0xb236: 'blake2b-432', + 0xb237: 'blake2b-440', + 0xb238: 'blake2b-448', + 0xb239: 'blake2b-456', + 0xb23a: 'blake2b-464', + 0xb23b: 'blake2b-472', + 0xb23c: 'blake2b-480', + 0xb23d: 'blake2b-488', + 0xb23e: 'blake2b-496', + 0xb23f: 'blake2b-504', + 0xb240: 'blake2b-512', + 0xb241: 'blake2s-8', + 0xb242: 'blake2s-16', + 0xb243: 'blake2s-24', + 0xb244: 'blake2s-32', + 0xb245: 'blake2s-40', + 0xb246: 'blake2s-48', + 0xb247: 'blake2s-56', + 0xb248: 'blake2s-64', + 0xb249: 'blake2s-72', + 0xb24a: 'blake2s-80', + 0xb24b: 'blake2s-88', + 0xb24c: 'blake2s-96', + 0xb24d: 'blake2s-104', + 0xb24e: 'blake2s-112', + 0xb24f: 'blake2s-120', + 0xb250: 'blake2s-128', + 0xb251: 'blake2s-136', + 0xb252: 'blake2s-144', + 0xb253: 'blake2s-152', + 0xb254: 'blake2s-160', + 0xb255: 'blake2s-168', + 0xb256: 'blake2s-176', + 0xb257: 'blake2s-184', + 0xb258: 'blake2s-192', + 0xb259: 'blake2s-200', + 0xb25a: 'blake2s-208', + 0xb25b: 'blake2s-216', + 0xb25c: 'blake2s-224', + 0xb25d: 'blake2s-232', + 0xb25e: 'blake2s-240', + 0xb25f: 'blake2s-248', + 0xb260: 'blake2s-256', + + // skein + 0xb301: 'Skein256-8', + 0xb302: 'Skein256-16', + 0xb303: 'Skein256-24', + 0xb304: 'Skein256-32', + 0xb305: 'Skein256-40', + 0xb306: 'Skein256-48', + 0xb307: 'Skein256-56', + 0xb308: 'Skein256-64', + 0xb309: 'Skein256-72', + 0xb30a: 'Skein256-80', + 0xb30b: 'Skein256-88', + 0xb30c: 'Skein256-96', + 0xb30d: 'Skein256-104', + 0xb30e: 'Skein256-112', + 0xb30f: 'Skein256-120', + 0xb310: 'Skein256-128', + 0xb311: 'Skein256-136', + 0xb312: 'Skein256-144', + 0xb313: 'Skein256-152', + 0xb314: 'Skein256-160', + 0xb315: 'Skein256-168', + 0xb316: 'Skein256-176', + 0xb317: 'Skein256-184', + 0xb318: 'Skein256-192', + 0xb319: 'Skein256-200', + 0xb31a: 'Skein256-208', + 0xb31b: 'Skein256-216', + 0xb31c: 'Skein256-224', + 0xb31d: 'Skein256-232', + 0xb31e: 'Skein256-240', + 0xb31f: 'Skein256-248', + 0xb320: 'Skein256-256', + 0xb321: 'Skein512-8', + 0xb322: 'Skein512-16', + 0xb323: 'Skein512-24', + 0xb324: 'Skein512-32', + 0xb325: 'Skein512-40', + 0xb326: 'Skein512-48', + 0xb327: 'Skein512-56', + 0xb328: 'Skein512-64', + 0xb329: 'Skein512-72', + 0xb32a: 'Skein512-80', + 0xb32b: 'Skein512-88', + 0xb32c: 'Skein512-96', + 0xb32d: 'Skein512-104', + 0xb32e: 'Skein512-112', + 0xb32f: 'Skein512-120', + 0xb330: 'Skein512-128', + 0xb331: 'Skein512-136', + 0xb332: 'Skein512-144', + 0xb333: 'Skein512-152', + 0xb334: 'Skein512-160', + 0xb335: 'Skein512-168', + 0xb336: 'Skein512-176', + 0xb337: 'Skein512-184', + 0xb338: 'Skein512-192', + 0xb339: 'Skein512-200', + 0xb33a: 'Skein512-208', + 0xb33b: 'Skein512-216', + 0xb33c: 'Skein512-224', + 0xb33d: 'Skein512-232', + 0xb33e: 'Skein512-240', + 0xb33f: 'Skein512-248', + 0xb340: 'Skein512-256', + 0xb341: 'Skein512-264', + 0xb342: 'Skein512-272', + 0xb343: 'Skein512-280', + 0xb344: 'Skein512-288', + 0xb345: 'Skein512-296', + 0xb346: 'Skein512-304', + 0xb347: 'Skein512-312', + 0xb348: 'Skein512-320', + 0xb349: 'Skein512-328', + 0xb34a: 'Skein512-336', + 0xb34b: 'Skein512-344', + 0xb34c: 'Skein512-352', + 0xb34d: 'Skein512-360', + 0xb34e: 'Skein512-368', + 0xb34f: 'Skein512-376', + 0xb350: 'Skein512-384', + 0xb351: 'Skein512-392', + 0xb352: 'Skein512-400', + 0xb353: 'Skein512-408', + 0xb354: 'Skein512-416', + 0xb355: 'Skein512-424', + 0xb356: 'Skein512-432', + 0xb357: 'Skein512-440', + 0xb358: 'Skein512-448', + 0xb359: 'Skein512-456', + 0xb35a: 'Skein512-464', + 0xb35b: 'Skein512-472', + 0xb35c: 'Skein512-480', + 0xb35d: 'Skein512-488', + 0xb35e: 'Skein512-496', + 0xb35f: 'Skein512-504', + 0xb360: 'Skein512-512', + 0xb361: 'Skein1024-8', + 0xb362: 'Skein1024-16', + 0xb363: 'Skein1024-24', + 0xb364: 'Skein1024-32', + 0xb365: 'Skein1024-40', + 0xb366: 'Skein1024-48', + 0xb367: 'Skein1024-56', + 0xb368: 'Skein1024-64', + 0xb369: 'Skein1024-72', + 0xb36a: 'Skein1024-80', + 0xb36b: 'Skein1024-88', + 0xb36c: 'Skein1024-96', + 0xb36d: 'Skein1024-104', + 0xb36e: 'Skein1024-112', + 0xb36f: 'Skein1024-120', + 0xb370: 'Skein1024-128', + 0xb371: 'Skein1024-136', + 0xb372: 'Skein1024-144', + 0xb373: 'Skein1024-152', + 0xb374: 'Skein1024-160', + 0xb375: 'Skein1024-168', + 0xb376: 'Skein1024-176', + 0xb377: 'Skein1024-184', + 0xb378: 'Skein1024-192', + 0xb379: 'Skein1024-200', + 0xb37a: 'Skein1024-208', + 0xb37b: 'Skein1024-216', + 0xb37c: 'Skein1024-224', + 0xb37d: 'Skein1024-232', + 0xb37e: 'Skein1024-240', + 0xb37f: 'Skein1024-248', + 0xb380: 'Skein1024-256', + 0xb381: 'Skein1024-264', + 0xb382: 'Skein1024-272', + 0xb383: 'Skein1024-280', + 0xb384: 'Skein1024-288', + 0xb385: 'Skein1024-296', + 0xb386: 'Skein1024-304', + 0xb387: 'Skein1024-312', + 0xb388: 'Skein1024-320', + 0xb389: 'Skein1024-328', + 0xb38a: 'Skein1024-336', + 0xb38b: 'Skein1024-344', + 0xb38c: 'Skein1024-352', + 0xb38d: 'Skein1024-360', + 0xb38e: 'Skein1024-368', + 0xb38f: 'Skein1024-376', + 0xb390: 'Skein1024-384', + 0xb391: 'Skein1024-392', + 0xb392: 'Skein1024-400', + 0xb393: 'Skein1024-408', + 0xb394: 'Skein1024-416', + 0xb395: 'Skein1024-424', + 0xb396: 'Skein1024-432', + 0xb397: 'Skein1024-440', + 0xb398: 'Skein1024-448', + 0xb399: 'Skein1024-456', + 0xb39a: 'Skein1024-464', + 0xb39b: 'Skein1024-472', + 0xb39c: 'Skein1024-480', + 0xb39d: 'Skein1024-488', + 0xb39e: 'Skein1024-496', + 0xb39f: 'Skein1024-504', + 0xb3a0: 'Skein1024-512', + 0xb3a1: 'Skein1024-520', + 0xb3a2: 'Skein1024-528', + 0xb3a3: 'Skein1024-536', + 0xb3a4: 'Skein1024-544', + 0xb3a5: 'Skein1024-552', + 0xb3a6: 'Skein1024-560', + 0xb3a7: 'Skein1024-568', + 0xb3a8: 'Skein1024-576', + 0xb3a9: 'Skein1024-584', + 0xb3aa: 'Skein1024-592', + 0xb3ab: 'Skein1024-600', + 0xb3ac: 'Skein1024-608', + 0xb3ad: 'Skein1024-616', + 0xb3ae: 'Skein1024-624', + 0xb3af: 'Skein1024-632', + 0xb3b0: 'Skein1024-640', + 0xb3b1: 'Skein1024-648', + 0xb3b2: 'Skein1024-656', + 0xb3b3: 'Skein1024-664', + 0xb3b4: 'Skein1024-672', + 0xb3b5: 'Skein1024-680', + 0xb3b6: 'Skein1024-688', + 0xb3b7: 'Skein1024-696', + 0xb3b8: 'Skein1024-704', + 0xb3b9: 'Skein1024-712', + 0xb3ba: 'Skein1024-720', + 0xb3bb: 'Skein1024-728', + 0xb3bc: 'Skein1024-736', + 0xb3bd: 'Skein1024-744', + 0xb3be: 'Skein1024-752', + 0xb3bf: 'Skein1024-760', + 0xb3c0: 'Skein1024-768', + 0xb3c1: 'Skein1024-776', + 0xb3c2: 'Skein1024-784', + 0xb3c3: 'Skein1024-792', + 0xb3c4: 'Skein1024-800', + 0xb3c5: 'Skein1024-808', + 0xb3c6: 'Skein1024-816', + 0xb3c7: 'Skein1024-824', + 0xb3c8: 'Skein1024-832', + 0xb3c9: 'Skein1024-840', + 0xb3ca: 'Skein1024-848', + 0xb3cb: 'Skein1024-856', + 0xb3cc: 'Skein1024-864', + 0xb3cd: 'Skein1024-872', + 0xb3ce: 'Skein1024-880', + 0xb3cf: 'Skein1024-888', + 0xb3d0: 'Skein1024-896', + 0xb3d1: 'Skein1024-904', + 0xb3d2: 'Skein1024-912', + 0xb3d3: 'Skein1024-920', + 0xb3d4: 'Skein1024-928', + 0xb3d5: 'Skein1024-936', + 0xb3d6: 'Skein1024-944', + 0xb3d7: 'Skein1024-952', + 0xb3d8: 'Skein1024-960', + 0xb3d9: 'Skein1024-968', + 0xb3da: 'Skein1024-976', + 0xb3db: 'Skein1024-984', + 0xb3dc: 'Skein1024-992', + 0xb3dd: 'Skein1024-1000', + 0xb3de: 'Skein1024-1008', + 0xb3df: 'Skein1024-1016', + 0xb3e0: 'Skein1024-1024' +}) - tuples.push([part, parts[p]]) - } +exports.defaultLengths = Object.freeze({ + 0x11: 20, + 0x12: 32, + 0x13: 64, + 0x56: 32, + 0x17: 28, + 0x16: 32, + 0x15: 48, + 0x14: 64, + 0x18: 32, + 0x19: 64, + 0x1A: 28, + 0x1B: 32, + 0x1C: 48, + 0x1D: 64, + 0x22: 32, - return tuples -} + 0xb201: 0x01, + 0xb202: 0x02, + 0xb203: 0x03, + 0xb204: 0x04, + 0xb205: 0x05, + 0xb206: 0x06, + 0xb207: 0x07, + 0xb208: 0x08, + 0xb209: 0x09, + 0xb20a: 0x0a, + 0xb20b: 0x0b, + 0xb20c: 0x0c, + 0xb20d: 0x0d, + 0xb20e: 0x0e, + 0xb20f: 0x0f, + 0xb210: 0x10, + 0xb211: 0x11, + 0xb212: 0x12, + 0xb213: 0x13, + 0xb214: 0x14, + 0xb215: 0x15, + 0xb216: 0x16, + 0xb217: 0x17, + 0xb218: 0x18, + 0xb219: 0x19, + 0xb21a: 0x1a, + 0xb21b: 0x1b, + 0xb21c: 0x1c, + 0xb21d: 0x1d, + 0xb21e: 0x1e, + 0xb21f: 0x1f, + 0xb220: 0x20, + 0xb221: 0x21, + 0xb222: 0x22, + 0xb223: 0x23, + 0xb224: 0x24, + 0xb225: 0x25, + 0xb226: 0x26, + 0xb227: 0x27, + 0xb228: 0x28, + 0xb229: 0x29, + 0xb22a: 0x2a, + 0xb22b: 0x2b, + 0xb22c: 0x2c, + 0xb22d: 0x2d, + 0xb22e: 0x2e, + 0xb22f: 0x2f, + 0xb230: 0x30, + 0xb231: 0x31, + 0xb232: 0x32, + 0xb233: 0x33, + 0xb234: 0x34, + 0xb235: 0x35, + 0xb236: 0x36, + 0xb237: 0x37, + 0xb238: 0x38, + 0xb239: 0x39, + 0xb23a: 0x3a, + 0xb23b: 0x3b, + 0xb23c: 0x3c, + 0xb23d: 0x3d, + 0xb23e: 0x3e, + 0xb23f: 0x3f, + 0xb240: 0x40, + 0xb241: 0x01, + 0xb242: 0x02, + 0xb243: 0x03, + 0xb244: 0x04, + 0xb245: 0x05, + 0xb246: 0x06, + 0xb247: 0x07, + 0xb248: 0x08, + 0xb249: 0x09, + 0xb24a: 0x0a, + 0xb24b: 0x0b, + 0xb24c: 0x0c, + 0xb24d: 0x0d, + 0xb24e: 0x0e, + 0xb24f: 0x0f, + 0xb250: 0x10, + 0xb251: 0x11, + 0xb252: 0x12, + 0xb253: 0x13, + 0xb254: 0x14, + 0xb255: 0x15, + 0xb256: 0x16, + 0xb257: 0x17, + 0xb258: 0x18, + 0xb259: 0x19, + 0xb25a: 0x1a, + 0xb25b: 0x1b, + 0xb25c: 0x1c, + 0xb25d: 0x1d, + 0xb25e: 0x1e, + 0xb25f: 0x1f, + 0xb260: 0x20, + 0xb301: 0x01, + 0xb302: 0x02, + 0xb303: 0x03, + 0xb304: 0x04, + 0xb305: 0x05, + 0xb306: 0x06, + 0xb307: 0x07, + 0xb308: 0x08, + 0xb309: 0x09, + 0xb30a: 0x0a, + 0xb30b: 0x0b, + 0xb30c: 0x0c, + 0xb30d: 0x0d, + 0xb30e: 0x0e, + 0xb30f: 0x0f, + 0xb310: 0x10, + 0xb311: 0x11, + 0xb312: 0x12, + 0xb313: 0x13, + 0xb314: 0x14, + 0xb315: 0x15, + 0xb316: 0x16, + 0xb317: 0x17, + 0xb318: 0x18, + 0xb319: 0x19, + 0xb31a: 0x1a, + 0xb31b: 0x1b, + 0xb31c: 0x1c, + 0xb31d: 0x1d, + 0xb31e: 0x1e, + 0xb31f: 0x1f, + 0xb320: 0x20, + 0xb321: 0x01, + 0xb322: 0x02, + 0xb323: 0x03, + 0xb324: 0x04, + 0xb325: 0x05, + 0xb326: 0x06, + 0xb327: 0x07, + 0xb328: 0x08, + 0xb329: 0x09, + 0xb32a: 0x0a, + 0xb32b: 0x0b, + 0xb32c: 0x0c, + 0xb32d: 0x0d, + 0xb32e: 0x0e, + 0xb32f: 0x0f, + 0xb330: 0x10, + 0xb331: 0x11, + 0xb332: 0x12, + 0xb333: 0x13, + 0xb334: 0x14, + 0xb335: 0x15, + 0xb336: 0x16, + 0xb337: 0x17, + 0xb338: 0x18, + 0xb339: 0x19, + 0xb33a: 0x1a, + 0xb33b: 0x1b, + 0xb33c: 0x1c, + 0xb33d: 0x1d, + 0xb33e: 0x1e, + 0xb33f: 0x1f, + 0xb340: 0x20, + 0xb341: 0x21, + 0xb342: 0x22, + 0xb343: 0x23, + 0xb344: 0x24, + 0xb345: 0x25, + 0xb346: 0x26, + 0xb347: 0x27, + 0xb348: 0x28, + 0xb349: 0x29, + 0xb34a: 0x2a, + 0xb34b: 0x2b, + 0xb34c: 0x2c, + 0xb34d: 0x2d, + 0xb34e: 0x2e, + 0xb34f: 0x2f, + 0xb350: 0x30, + 0xb351: 0x31, + 0xb352: 0x32, + 0xb353: 0x33, + 0xb354: 0x34, + 0xb355: 0x35, + 0xb356: 0x36, + 0xb357: 0x37, + 0xb358: 0x38, + 0xb359: 0x39, + 0xb35a: 0x3a, + 0xb35b: 0x3b, + 0xb35c: 0x3c, + 0xb35d: 0x3d, + 0xb35e: 0x3e, + 0xb35f: 0x3f, + 0xb360: 0x40, + 0xb361: 0x01, + 0xb362: 0x02, + 0xb363: 0x03, + 0xb364: 0x04, + 0xb365: 0x05, + 0xb366: 0x06, + 0xb367: 0x07, + 0xb368: 0x08, + 0xb369: 0x09, + 0xb36a: 0x0a, + 0xb36b: 0x0b, + 0xb36c: 0x0c, + 0xb36d: 0x0d, + 0xb36e: 0x0e, + 0xb36f: 0x0f, + 0xb370: 0x10, + 0xb371: 0x11, + 0xb372: 0x12, + 0xb373: 0x13, + 0xb374: 0x14, + 0xb375: 0x15, + 0xb376: 0x16, + 0xb377: 0x17, + 0xb378: 0x18, + 0xb379: 0x19, + 0xb37a: 0x1a, + 0xb37b: 0x1b, + 0xb37c: 0x1c, + 0xb37d: 0x1d, + 0xb37e: 0x1e, + 0xb37f: 0x1f, + 0xb380: 0x20, + 0xb381: 0x21, + 0xb382: 0x22, + 0xb383: 0x23, + 0xb384: 0x24, + 0xb385: 0x25, + 0xb386: 0x26, + 0xb387: 0x27, + 0xb388: 0x28, + 0xb389: 0x29, + 0xb38a: 0x2a, + 0xb38b: 0x2b, + 0xb38c: 0x2c, + 0xb38d: 0x2d, + 0xb38e: 0x2e, + 0xb38f: 0x2f, + 0xb390: 0x30, + 0xb391: 0x31, + 0xb392: 0x32, + 0xb393: 0x33, + 0xb394: 0x34, + 0xb395: 0x35, + 0xb396: 0x36, + 0xb397: 0x37, + 0xb398: 0x38, + 0xb399: 0x39, + 0xb39a: 0x3a, + 0xb39b: 0x3b, + 0xb39c: 0x3c, + 0xb39d: 0x3d, + 0xb39e: 0x3e, + 0xb39f: 0x3f, + 0xb3a0: 0x40, + 0xb3a1: 0x41, + 0xb3a2: 0x42, + 0xb3a3: 0x43, + 0xb3a4: 0x44, + 0xb3a5: 0x45, + 0xb3a6: 0x46, + 0xb3a7: 0x47, + 0xb3a8: 0x48, + 0xb3a9: 0x49, + 0xb3aa: 0x4a, + 0xb3ab: 0x4b, + 0xb3ac: 0x4c, + 0xb3ad: 0x4d, + 0xb3ae: 0x4e, + 0xb3af: 0x4f, + 0xb3b0: 0x50, + 0xb3b1: 0x51, + 0xb3b2: 0x52, + 0xb3b3: 0x53, + 0xb3b4: 0x54, + 0xb3b5: 0x55, + 0xb3b6: 0x56, + 0xb3b7: 0x57, + 0xb3b8: 0x58, + 0xb3b9: 0x59, + 0xb3ba: 0x5a, + 0xb3bb: 0x5b, + 0xb3bc: 0x5c, + 0xb3bd: 0x5d, + 0xb3be: 0x5e, + 0xb3bf: 0x5f, + 0xb3c0: 0x60, + 0xb3c1: 0x61, + 0xb3c2: 0x62, + 0xb3c3: 0x63, + 0xb3c4: 0x64, + 0xb3c5: 0x65, + 0xb3c6: 0x66, + 0xb3c7: 0x67, + 0xb3c8: 0x68, + 0xb3c9: 0x69, + 0xb3ca: 0x6a, + 0xb3cb: 0x6b, + 0xb3cc: 0x6c, + 0xb3cd: 0x6d, + 0xb3ce: 0x6e, + 0xb3cf: 0x6f, + 0xb3d0: 0x70, + 0xb3d1: 0x71, + 0xb3d2: 0x72, + 0xb3d3: 0x73, + 0xb3d4: 0x74, + 0xb3d5: 0x75, + 0xb3d6: 0x76, + 0xb3d7: 0x77, + 0xb3d8: 0x78, + 0xb3d9: 0x79, + 0xb3da: 0x7a, + 0xb3db: 0x7b, + 0xb3dc: 0x7c, + 0xb3dd: 0x7d, + 0xb3de: 0x7e, + 0xb3df: 0x7f, + 0xb3e0: 0x80 +}) -// [[str name, str addr]... ] -> string -/** - * @param {[number, string?][]} tuples - */ -function stringTuplesToString (tuples) { - /** @type {Array} */ - const parts = [] - tuples.map((tup) => { - const proto = protoFromTuple(tup) - parts.push(proto.name) - if (tup.length > 1) { - parts.push(tup[1]) - } - return null - }) - return cleanPath(parts.join('/')) -} +/***/ }), -// [[str name, str addr]... ] -> [[int code, Uint8Array]... ] -/** - * @param {Array} tuples - * @returns {[number , Uint8Array?][]} - */ -function stringTuplesToTuples (tuples) { - return tuples.map((tup) => { - if (!Array.isArray(tup)) { - tup = [tup] - } - const proto = protoFromTuple(tup) - if (tup.length > 1) { - return [proto.code, convert.toBytes(proto.code, tup[1])] - } - return [proto.code] - }) -} +/***/ "./node_modules/multihashes/src/index.js": +/*!***********************************************!*\ + !*** ./node_modules/multihashes/src/index.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_935035__) { +"use strict"; /** - * Convert tuples to string tuples - * - * [[int code, Uint8Array]... ] -> [[int code, str addr]... ] + * Multihash implementation in JavaScript. * - * @param {Array<[number, Uint8Array?]>} tuples - * @returns {Array<[number, string?]>} + * @module multihash */ -function tuplesToStringTuples (tuples) { - return tuples.map(tup => { - const proto = protoFromTuple(tup) - if (tup[1]) { - return [proto.code, convert.toString(proto.code, tup[1])] - } - return [proto.code] - }) -} -// [[int code, Uint8Array ]... ] -> Uint8Array -/** - * @param {[number, Uint8Array?][]} tuples - */ -function tuplesToBytes (tuples) { - return fromBytes(uint8ArrayConcat(tuples.map((/** @type {any[]} */ tup) => { - const proto = protoFromTuple(tup) - let buf = Uint8Array.from(varint.encode(proto.code)) +const bs58 = __nested_webpack_require_935035__(/*! bs58 */ "./node_modules/bs58/index.js") - if (tup.length > 1) { - buf = uint8ArrayConcat([buf, tup[1]]) // add address buffer - } +const cs = __nested_webpack_require_935035__(/*! ./constants */ "./node_modules/multihashes/src/constants.js") - return buf - }))) -} +exports.names = cs.names +exports.codes = cs.codes +exports.defaultLengths = cs.defaultLengths -/** - * @param {import("./types").Protocol} p - * @param {Uint8Array | number[]} addr - */ -function sizeForAddr (p, addr) { - if (p.size > 0) { - return p.size / 8 - } else if (p.size === 0) { - return 0 - } else { - const size = varint.decode(addr) - return size + varint.decode.bytes - } -} +const varint = __nested_webpack_require_935035__(/*! varint */ "./node_modules/varint/index.js") /** + * Convert the given multihash to a hex encoded string. * - * @param {Uint8Array} buf - * @returns {Array<[number, Uint8Array?]>} + * @param {Buffer} hash + * @returns {string} */ -function bytesToTuples (buf) { - /** @type {Array<[number, Uint8Array?]>} */ - const tuples = [] - let i = 0 - while (i < buf.length) { - const code = varint.decode(buf, i) - const n = varint.decode.bytes - - const p = protocols(code) - - const size = sizeForAddr(p, buf.slice(i + n)) - - if (size === 0) { - tuples.push([code]) - i += n - continue - } - - const addr = buf.slice(i + n, i + n + size) - - i += (size + n) - - if (i > buf.length) { // did not end _exactly_ at buffer.length - throw ParseError('Invalid address Uint8Array: ' + uint8ArrayToString(buf, 'base16')) - } - - // ok, tuple seems good. - tuples.push([code, addr]) +exports.toHexString = function toHexString (hash) { + if (!Buffer.isBuffer(hash)) { + throw new Error('must be passed a buffer') } - return tuples -} - -// Uint8Array -> String -/** - * @param {Uint8Array} buf - */ -function bytesToString (buf) { - const a = bytesToTuples(buf) - const b = tuplesToStringTuples(a) - return stringTuplesToString(b) -} - -// String -> Uint8Array -/** - * @param {string} str - */ -function stringToBytes (str) { - str = cleanPath(str) - const a = stringToStringTuples(str) - const b = stringTuplesToTuples(a) - - return tuplesToBytes(b) -} - -// String -> Uint8Array -/** - * @param {string} str - */ -function fromString (str) { - return stringToBytes(str) + return hash.toString('hex') } -// Uint8Array -> Uint8Array /** - * @param {Uint8Array} buf + * Convert the given hex encoded string to a multihash. + * + * @param {string} hash + * @returns {Buffer} */ -function fromBytes (buf) { - const err = validateBytes(buf) - if (err) throw err - return Uint8Array.from(buf) // copy +exports.fromHexString = function fromHexString (hash) { + return Buffer.from(hash, 'hex') } /** - * @param {Uint8Array} buf + * Convert the given multihash to a base58 encoded string. + * + * @param {Buffer} hash + * @returns {string} */ -function validateBytes (buf) { - try { - bytesToTuples(buf) // try to parse. will throw if breaks - } catch (err) { - return err +exports.toB58String = function toB58String (hash) { + if (!Buffer.isBuffer(hash)) { + throw new Error('must be passed a buffer') } -} - -/** - * @param {Uint8Array} buf - */ -function isValidBytes (buf) { - return validateBytes(buf) === undefined -} - -/** - * @param {string} str - */ -function cleanPath (str) { - return '/' + str.trim().split('/').filter((/** @type {any} */ a) => a).join('/') -} - -/** - * @param {string} str - */ -function ParseError (str) { - return new Error('Error parsing address: ' + str) -} -/** - * @param {any[]} tup - */ -function protoFromTuple (tup) { - const proto = protocols(tup[0]) - return proto + return bs58.encode(hash) } - -/***/ }), - -/***/ 59943: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const ip = __nccwpck_require__(53153) -const protocols = __nccwpck_require__(19612) -const { CID } = __nccwpck_require__(24247) -const { base32 } = __nccwpck_require__(70784) -const { base58btc } = __nccwpck_require__(49108) -const Digest = __nccwpck_require__(81168) -const varint = __nccwpck_require__(30310) -const { toString: uint8ArrayToString } = __nccwpck_require__(2771) -const { fromString: uint8ArrayFromString } = __nccwpck_require__(39451) -const { concat: uint8ArrayConcat } = __nccwpck_require__(17225) - -module.exports = Convert - -// converts (serializes) addresses /** - * @param {string} proto - * @param {string | Uint8Array} a + * Convert the given base58 encoded string to a multihash. + * + * @param {string|Buffer} hash + * @returns {Buffer} */ -function Convert (proto, a) { - if (a instanceof Uint8Array) { - return Convert.toString(proto, a) - } else { - return Convert.toBytes(proto, a) +exports.fromB58String = function fromB58String (hash) { + let encoded = hash + if (Buffer.isBuffer(hash)) { + encoded = hash.toString() } + + return Buffer.from(bs58.decode(encoded)) } /** - * Convert [code,Uint8Array] to string + * Decode a hash from the given multihash. * - * @param {number|string} proto - * @param {Uint8Array} buf - * @returns {string} + * @param {Buffer} buf + * @returns {{code: number, name: string, length: number, digest: Buffer}} result */ -Convert.toString = function convertToString (proto, buf) { - const protocol = protocols(proto) - switch (protocol.code) { - case 4: // ipv4 - case 41: // ipv6 - return bytes2ip(buf) - - case 6: // tcp - case 273: // udp - case 33: // dccp - case 132: // sctp - return bytes2port(buf).toString() - - case 53: // dns - case 54: // dns4 - case 55: // dns6 - case 56: // dnsaddr - case 400: // unix - case 777: // memory - return bytes2str(buf) - - case 421: // ipfs - return bytes2mh(buf) - case 444: // onion - return bytes2onion(buf) - case 445: // onion3 - return bytes2onion(buf) - default: - return uint8ArrayToString(buf, 'base16') // no clue. convert to hex +exports.decode = function decode (buf) { + if (!(Buffer.isBuffer(buf))) { + throw new Error('multihash must be a Buffer') } -} - -Convert.toBytes = function convertToBytes (/** @type {string | number } */ proto, /** @type {string} */ str) { - const protocol = protocols(proto) - switch (protocol.code) { - case 4: // ipv4 - return ip2bytes(str) - case 41: // ipv6 - return ip2bytes(str) - - case 6: // tcp - case 273: // udp - case 33: // dccp - case 132: // sctp - return port2bytes(parseInt(str, 10)) - - case 53: // dns - case 54: // dns4 - case 55: // dns6 - case 56: // dnsaddr - case 400: // unix - case 777: // memory - return str2bytes(str) - case 421: // ipfs - return mh2bytes(str) - case 444: // onion - return onion2bytes(str) - case 445: // onion3 - return onion32bytes(str) - default: - return uint8ArrayFromString(str, 'base16') // no clue. convert from hex + if (buf.length < 3) { + throw new Error('multihash too short. must be > 3 bytes.') } -} -/** - * @param {string} ipString - */ -function ip2bytes (ipString) { - if (!ip.isIP(ipString)) { - throw new Error('invalid ip address') + const code = varint.decode(buf) + if (!exports.isValidCode(code)) { + throw new Error(`multihash unknown function code: 0x${code.toString(16)}`) } - return ip.toBytes(ipString) -} + buf = buf.slice(varint.decode.bytes) -/** - * @param {Uint8Array} ipBuff - */ -function bytes2ip (ipBuff) { - const ipString = ip.toString(ipBuff) - if (!ipString || !ip.isIP(ipString)) { - throw new Error('invalid ip address') + const len = varint.decode(buf) + if (len < 1) { + throw new Error(`multihash invalid length: 0x${len.toString(16)}`) } - return ipString -} - -/** - * @param {number} port - */ -function port2bytes (port) { - const buf = new ArrayBuffer(2) - const view = new DataView(buf) - view.setUint16(0, port) - - return new Uint8Array(buf) -} - -/** - * @param {Uint8Array} buf - */ -function bytes2port (buf) { - const view = new DataView(buf.buffer) - return view.getUint16(buf.byteOffset) -} - -/** - * @param {string} str - */ -function str2bytes (str) { - const buf = uint8ArrayFromString(str) - const size = Uint8Array.from(varint.encode(buf.length)) - return uint8ArrayConcat([size, buf], size.length + buf.length) -} - -/** - * @param {Uint8Array} buf - */ -function bytes2str (buf) { - const size = varint.decode(buf) buf = buf.slice(varint.decode.bytes) - if (buf.length !== size) { - throw new Error('inconsistent lengths') + if (buf.length !== len) { + throw new Error(`multihash length inconsistent: 0x${buf.toString('hex')}`) } - return uint8ArrayToString(buf) -} - -/** - * @param {string} hash - base58btc string - */ -function mh2bytes (hash) { - let mh - - if (hash[0] === 'Q' || hash[0] === '1') { - mh = Digest.decode(base58btc.decode(`z${hash}`)).bytes - } else { - mh = CID.parse(hash).multihash.bytes + return { + code: code, + name: cs.codes[code], + length: len, + digest: buf } - - // the address is a varint prefixed multihash string representation - const size = Uint8Array.from(varint.encode(mh.length)) - return uint8ArrayConcat([size, mh], size.length + mh.length) } /** - * Converts bytes to bas58btc string + * Encode a hash digest along with the specified function code. * - * @param {Uint8Array} buf - * @returns {string} base58btc string + * > **Note:** the length is derived from the length of the digest itself. + * + * @param {Buffer} digest + * @param {string|number} code + * @param {number} [length] + * @returns {Buffer} */ -function bytes2mh (buf) { - const size = varint.decode(buf) - const address = buf.slice(varint.decode.bytes) - - if (address.length !== size) { - throw new Error('inconsistent lengths') +exports.encode = function encode (digest, code, length) { + if (!digest || code === undefined) { + throw new Error('multihash encode requires at least two args: digest, code') } - return uint8ArrayToString(address, 'base58btc') -} + // ensure it's a hashfunction code. + const hashfn = exports.coerceCode(code) -/** - * @param {string} str - */ -function onion2bytes (str) { - const addr = str.split(':') - if (addr.length !== 2) { - throw new Error('failed to parse onion addr: ' + addr + ' does not contain a port number') - } - if (addr[0].length !== 16) { - throw new Error('failed to parse onion addr: ' + addr[0] + ' not a Tor onion address.') + if (!(Buffer.isBuffer(digest))) { + throw new Error('digest should be a Buffer') } - // onion addresses do not include the multibase prefix, add it before decoding - const buf = base32.decode('b' + addr[0]) - - // onion port number - const port = parseInt(addr[1], 10) - if (port < 1 || port > 65536) { - throw new Error('Port number is not in range(1, 65536)') + if (length == null) { + length = digest.length } - const portBuf = port2bytes(port) - return uint8ArrayConcat([buf, portBuf], buf.length + portBuf.length) -} -/** - * @param {string} str - */ -function onion32bytes (str) { - const addr = str.split(':') - if (addr.length !== 2) { - throw new Error('failed to parse onion addr: ' + addr + ' does not contain a port number') - } - if (addr[0].length !== 56) { - throw new Error('failed to parse onion addr: ' + addr[0] + ' not a Tor onion3 address.') + if (length && digest.length !== length) { + throw new Error('digest length should be equal to specified length.') } - // onion addresses do not include the multibase prefix, add it before decoding - const buf = base32.decode('b' + addr[0]) - // onion port number - const port = parseInt(addr[1], 10) - if (port < 1 || port > 65536) { - throw new Error('Port number is not in range(1, 65536)') - } - const portBuf = port2bytes(port) - return uint8ArrayConcat([buf, portBuf], buf.length + portBuf.length) + return Buffer.concat([ + Buffer.from(varint.encode(hashfn)), + Buffer.from(varint.encode(length)), + digest + ]) } /** - * @param {Uint8Array} buf + * Converts a hash function name into the matching code. + * If passed a number it will return the number if it's a valid code. + * @param {string|number} name + * @returns {number} */ -function bytes2onion (buf) { - const addrBytes = buf.slice(0, buf.length - 2) - const portBytes = buf.slice(buf.length - 2) - const addr = uint8ArrayToString(addrBytes, 'base32') - const port = bytes2port(portBytes) - return addr + ':' + port -} - - -/***/ }), - -/***/ 47730: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; +exports.coerceCode = function coerceCode (name) { + let code = name + if (typeof name === 'string') { + if (cs.names[name] === undefined) { + throw new Error(`Unrecognized hash function named: ${name}`) + } + code = cs.names[name] + } -const codec = __nccwpck_require__(22126) -const protocols = __nccwpck_require__(19612) -const varint = __nccwpck_require__(30310) -const { CID } = __nccwpck_require__(24247) -const { base58btc } = __nccwpck_require__(49108) -const errCode = __nccwpck_require__(5822) -const inspect = Symbol.for('nodejs.util.inspect.custom') -const { toString: uint8ArrayToString } = __nccwpck_require__(2771) -const { equals: uint8ArrayEquals } = __nccwpck_require__(94646) + if (typeof code !== 'number') { + throw new Error(`Hash function code should be a number. Got: ${code}`) + } -/** - * @typedef {(addr: Multiaddr) => Promise} Resolver - * @typedef {string | Multiaddr | Uint8Array | null} MultiaddrInput - * @typedef {import('./types').MultiaddrObject} MultiaddrObject - * @typedef {import('./types').Protocol} Protocol - */ + if (cs.codes[code] === undefined && !exports.isAppCode(code)) { + throw new Error(`Unrecognized function code: ${code}`) + } -/** @type {Map} */ -const resolvers = new Map() -const symbol = Symbol.for('@multiformats/js-multiaddr/multiaddr') + return code +} /** - * Creates a [multiaddr](https://github.com/multiformats/multiaddr) from - * a Uint8Array, String or another Multiaddr instance - * public key. + * Checks wether a code is part of the app range * + * @param {number} code + * @returns {boolean} */ -class Multiaddr { - /** - * @example - * ```js - * new Multiaddr('/ip4/127.0.0.1/tcp/4001') - * // - * ``` - * - * @param {MultiaddrInput} [addr] - If String or Uint8Array, needs to adhere to the address format of a [multiaddr](https://github.com/multiformats/multiaddr#string-format) - */ - constructor (addr) { - // default - if (addr == null) { - addr = '' - } - - // Define symbol - Object.defineProperty(this, symbol, { value: true }) - - if (addr instanceof Uint8Array) { - /** @type {Uint8Array} - The raw bytes representing this multiaddress */ - this.bytes = codec.fromBytes(addr) - } else if (typeof addr === 'string') { - if (addr.length > 0 && addr.charAt(0) !== '/') { - throw new Error(`multiaddr "${addr}" must start with a "/"`) - } - this.bytes = codec.fromString(addr) - } else if (Multiaddr.isMultiaddr(addr)) { // Multiaddr - this.bytes = codec.fromBytes(addr.bytes) // validate + copy buffer ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } else { - for (; i < 5; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - // 6th..10th - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - } - /* istanbul ignore next */ - throw Error("invalid varint encoding"); +exports.isAppCode = function appCode (code) { + return code > 0 && code < 0x10 } -/* eslint-enable no-invalid-this */ - -/** - * Reads a varint as a signed 64 bit value. - * @name Reader#int64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a varint as an unsigned 64 bit value. - * @name Reader#uint64 - * @function - * @returns {Long} Value read - */ - /** - * Reads a zig-zag encoded varint as a signed 64 bit value. - * @name Reader#sint64 - * @function - * @returns {Long} Value read + * Checks whether a multihash code is valid. + * + * @param {number} code + * @returns {boolean} */ +exports.isValidCode = function validCode (code) { + if (exports.isAppCode(code)) { + return true + } -/** - * Reads a varint as a boolean. - * @returns {boolean} Value read - */ -Reader.prototype.bool = function read_bool() { - return this.uint32() !== 0; -}; + if (cs.codes[code]) { + return true + } -function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` - return (buf[end - 4] - | buf[end - 3] << 8 - | buf[end - 2] << 16 - | buf[end - 1] << 24) >>> 0; + return false } /** - * Reads fixed 32 bits as an unsigned 32 bit integer. - * @returns {number} Value read - */ -Reader.prototype.fixed32 = function read_fixed32() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - return readFixed32_end(this.buf, this.pos += 4); -}; - -/** - * Reads fixed 32 bits as a signed 32 bit integer. - * @returns {number} Value read + * Check if the given buffer is a valid multihash. Throws an error if it is not valid. + * + * @param {Buffer} multihash + * @returns {undefined} + * @throws {Error} */ -Reader.prototype.sfixed32 = function read_sfixed32() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - return readFixed32_end(this.buf, this.pos += 4) | 0; -}; - -/* eslint-disable no-invalid-this */ - -function readFixed64(/* this: Reader */) { - - /* istanbul ignore if */ - if (this.pos + 8 > this.len) - throw indexOutOfRange(this, 8); - - return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); +function validate (multihash) { + exports.decode(multihash) // throws if bad. } - -/* eslint-enable no-invalid-this */ - -/** - * Reads fixed 64 bits. - * @name Reader#fixed64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads zig-zag encoded fixed 64 bits. - * @name Reader#sfixed64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a float (32 bit) as a number. - * @function - * @returns {number} Value read - */ -Reader.prototype.float = function read_float() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - var value = util.float.readFloatLE(this.buf, this.pos); - this.pos += 4; - return value; -}; - -/** - * Reads a double (64 bit float) as a number. - * @function - * @returns {number} Value read - */ -Reader.prototype.double = function read_double() { - - /* istanbul ignore if */ - if (this.pos + 8 > this.len) - throw indexOutOfRange(this, 4); - - var value = util.float.readDoubleLE(this.buf, this.pos); - this.pos += 8; - return value; -}; - -/** - * Reads a sequence of bytes preceeded by its length as a varint. - * @returns {Uint8Array} Value read - */ -Reader.prototype.bytes = function read_bytes() { - var length = this.uint32(), - start = this.pos, - end = this.pos + length; - - /* istanbul ignore if */ - if (end > this.len) - throw indexOutOfRange(this, length); - - this.pos += length; - if (Array.isArray(this.buf)) // plain array - return this.buf.slice(start, end); - - if (start === end) { // fix for IE 10/Win8 and others' subarray returning array of size 1 - var nativeBuffer = util.Buffer; - return nativeBuffer - ? nativeBuffer.alloc(0) - : new this.buf.constructor(0); - } - return this._slice.call(this.buf, start, end); -}; - -/** - * Reads a string preceeded by its byte length as a varint. - * @returns {string} Value read - */ -Reader.prototype.string = function read_string() { - var bytes = this.bytes(); - return utf8.read(bytes, 0, bytes.length); -}; - -/** - * Skips the specified number of bytes if specified, otherwise skips a varint. - * @param {number} [length] Length if known, otherwise a varint is assumed - * @returns {Reader} `this` - */ -Reader.prototype.skip = function skip(length) { - if (typeof length === "number") { - /* istanbul ignore if */ - if (this.pos + length > this.len) - throw indexOutOfRange(this, length); - this.pos += length; - } else { - do { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - } while (this.buf[this.pos++] & 128); - } - return this; -}; +exports.validate = validate /** - * Skips the next element of the specified wire type. - * @param {number} wireType Wire type received - * @returns {Reader} `this` + * Returns a prefix from a valid multihash. Throws an error if it is not valid. + * + * @param {Buffer} multihash + * @returns {undefined} + * @throws {Error} */ -Reader.prototype.skipType = function(wireType) { - switch (wireType) { - case 0: - this.skip(); - break; - case 1: - this.skip(8); - break; - case 2: - this.skip(this.uint32()); - break; - case 3: - while ((wireType = this.uint32() & 7) !== 4) { - this.skipType(wireType); - } - break; - case 5: - this.skip(4); - break; - - /* istanbul ignore next */ - default: - throw Error("invalid wire type " + wireType + " at offset " + this.pos); - } - return this; -}; - -Reader._configure = function(BufferReader_) { - BufferReader = BufferReader_; - Reader.create = create(); - BufferReader._configure(); +exports.prefix = function prefix (multihash) { + validate(multihash) - var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; - util.merge(Reader.prototype, { + return multihash.slice(0, 2) +} - int64: function read_int64() { - return readLongVarint.call(this)[fn](false); - }, - uint64: function read_uint64() { - return readLongVarint.call(this)[fn](true); - }, +/***/ }), - sint64: function read_sint64() { - return readLongVarint.call(this).zzDecode()[fn](false); - }, +/***/ "./node_modules/recursive-fs/index.js": +/*!********************************************!*\ + !*** ./node_modules/recursive-fs/index.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_940411__) { - fixed64: function read_fixed64() { - return readFixed64.call(this)[fn](true); - }, - sfixed64: function read_sfixed64() { - return readFixed64.call(this)[fn](false); - } +module.exports = { + readdirr: __nested_webpack_require_940411__(/*! ./lib/readdirr */ "./node_modules/recursive-fs/lib/readdirr.js").readdirr, - }); -}; + rmdirr: __nested_webpack_require_940411__(/*! ./lib/rmdirr */ "./node_modules/recursive-fs/lib/rmdirr.js").rmdirr, + rmdirs: __nested_webpack_require_940411__(/*! ./lib/rmdirr */ "./node_modules/recursive-fs/lib/rmdirr.js").rmdirs, + rmfiles: __nested_webpack_require_940411__(/*! ./lib/rmdirr */ "./node_modules/recursive-fs/lib/rmdirr.js").rmfiles, + + cpdirr: __nested_webpack_require_940411__(/*! ./lib/cpdirr */ "./node_modules/recursive-fs/lib/cpdirr.js").cpdirr, + cpdirs: __nested_webpack_require_940411__(/*! ./lib/cpdirr */ "./node_modules/recursive-fs/lib/cpdirr.js").cpdirs, + cpfiles: __nested_webpack_require_940411__(/*! ./lib/cpdirr */ "./node_modules/recursive-fs/lib/cpdirr.js").cpfiles +} /***/ }), -<<<<<<< HEAD -/***/ 65886: -======= -/***/ 53153: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - +/***/ "./node_modules/recursive-fs/lib/cpdirr.js": +/*!*************************************************!*\ + !*** ./node_modules/recursive-fs/lib/cpdirr.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_941483__) { -module.exports = BufferReader; -<<<<<<< HEAD -// extends Reader -var Reader = __nccwpck_require__(40118); -(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; -======= -const isIp = __nccwpck_require__(89837) -const { toString: uint8ArrayToString } = __nccwpck_require__(2771) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var fs = __nested_webpack_require_941483__(/*! fs */ "fs") +var path = __nested_webpack_require_941483__(/*! path */ "path") +var readdirr = __nested_webpack_require_941483__(/*! ./readdirr */ "./node_modules/recursive-fs/lib/readdirr.js").readdirr -var util = __nccwpck_require__(14512); /** - * Constructs a new buffer reader instance. - * @classdesc Wire format reader using node buffers. - * @extends Reader - * @constructor - * @param {Buffer} buffer Buffer to read from + * Copy directory recursively + * + * @param {String} source path + * @param {String} target path + * @param {Function} callback + * @api public */ -function BufferReader(buffer) { - Reader.call(this, buffer); - /** - * Read buffer. - * @name BufferReader#buf - * @type {Buffer} - */ +exports.cpdirr = function (spath, tpath, cb) { + readdirr(spath, function (err, dirs, files) { + if (err) return cb(err) + exports.cpdirs(spath, tpath, dirs, function (err) { + if (err) return cb(err) + exports.cpfiles(spath, tpath, files, function (err) { + if (err) return cb(err) + cb() + }) + }) + }) } -BufferReader._configure = function () { - /* istanbul ignore else */ - if (util.Buffer) - BufferReader.prototype._slice = util.Buffer.prototype.slice; -}; - - /** - * @override + * Copy a list of directories + * + * @param {String} source path + * @param {String} target path + * @param {Array} dirs + * @param {Function} callback + * @api public */ -BufferReader.prototype.string = function read_string_buffer() { - var len = this.uint32(); // modifies pos - return this.buf.utf8Slice - ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) - : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); -}; + +exports.cpdirs = function (spath, tpath, dirs, cb) { + dirs.sort() + ;(function loop (index) { + if (index == dirs.length) return cb() + var rpath = path.relative(spath, dirs[index]) + rpath = path.join(tpath, rpath) + fs.exists(rpath, function (exists) { + if (exists) return loop(++index) + fs.mkdir(rpath, function (err) { + if (err) return cb(err) + loop(++index) + }) + }) + }(0)) +} /** - * Reads a sequence of bytes preceeded by its length as a varint. - * @name BufferReader#bytes - * @function - * @returns {Buffer} Value read + * Copy a list of files + * + * @param {String} source path + * @param {String} target path + * @param {Array} files + * @param {Function} callback + * @api public */ -BufferReader._configure(); +exports.cpfiles = function (spath, tpath, files, cb) { + ;(function loop (index) { + if (index == files.length) return cb() + fs.readFile(files[index], function (err, data) { + if (err) return cb(err) + var rpath = path.relative(spath, files[index]) + rpath = path.join(tpath, rpath) + fs.writeFile(rpath, data, function (err) { + if (err) return cb(err) + loop(++index) + }) + }) + }(0)) +} /***/ }), -<<<<<<< HEAD -/***/ 19080: -======= -/***/ 19612: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { +/***/ "./node_modules/recursive-fs/lib/readdirr.js": +/*!***************************************************!*\ + !*** ./node_modules/recursive-fs/lib/readdirr.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_943693__) { -module.exports = {}; +var fs = __nested_webpack_require_943693__(/*! fs */ "fs") +var path = __nested_webpack_require_943693__(/*! path */ "path") + /** - * Named roots. - * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). - * Can also be used manually to make roots available across modules. - * @name roots - * @type {Object.} - * @example - * // pbjs -r myroot -o compiled.js ... - * - * // in another module: - * require("./compiled.js"); + * Read directory recursively * - * // in any subsequent module: - * var root = protobuf.roots["myroot"]; + * @param {String} directory path + * @param {Function} callback + * @return {Arrays} dirs & files + * @api public */ +exports.readdirr = function (dpath, cb) { + var dirs = [], files = [] + dirs.push(dpath) + ;(function loop (index) { + if (index == dirs.length) return cb(null, dirs, files) + fs.readdir(dirs[index], function (err, _files) { + if (err) return cb(err) + getstat(dirs[index], _files, function (err) { + if (err) return cb(err) + loop(++index) + }) + }) + }(0)) + + /** + * Get stat + * + * @param {String} directory path + * @param {Array} files + * @param {Function} callback + * @api private + */ + function getstat (dpath, _files, cb) { + ;(function loop (index) { + if (index == _files.length) return cb() + var fpath = path.join(dpath, _files[index]) + fs.stat(fpath, function (err, stats) { + if (err) return cb(err) + if (stats.isDirectory()) { + dirs.push(fpath) + } else { + files.push(fpath) + } + loop(++index) + }) + }(0)) + } +} + /***/ }), -<<<<<<< HEAD -/***/ 57978: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./node_modules/recursive-fs/lib/rmdirr.js": +/*!*************************************************!*\ + !*** ./node_modules/recursive-fs/lib/rmdirr.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_945203__) { +var fs = __nested_webpack_require_945203__(/*! fs */ "fs") +var readdirr = __nested_webpack_require_945203__(/*! ./readdirr */ "./node_modules/recursive-fs/lib/readdirr.js").readdirr -/** - * Streaming RPC helpers. - * @namespace - */ -var rpc = exports; /** - * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. - * @typedef RPCImpl - * @type {function} - * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called - * @param {Uint8Array} requestData Request data - * @param {RPCImplCallback} callback Callback function - * @returns {undefined} - * @example - * function rpcImpl(method, requestData, callback) { - * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code - * throw Error("no such method"); - * asynchronouslyObtainAResponse(requestData, function(err, responseData) { - * callback(err, responseData); - * }); - * } + * Remove directory recursively + * + * @param {String} directory path + * @param {Function} callback + * @api public */ +exports.rmdirr = function (dpath, cb) { + readdirr(dpath, function (err, dirs, files) { + if (err) return cb(err) + exports.rmfiles(files, function (err) { + if (err) return cb(err) + exports.rmdirs(dirs, cb) + }) + }) +} + /** - * Node-style callback as used by {@link RPCImpl}. - * @typedef RPCImplCallback - * @type {function} - * @param {Error|null} error Error, if any, otherwise `null` - * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error - * @returns {undefined} + * Remove a list of files + * + * @param {Array} files + * @param {Function} callback + * @api public */ -rpc.Service = __nccwpck_require__(54783); - - -/***/ }), - -/***/ 54783: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - -module.exports = Service; - -var util = __nccwpck_require__(14512); - -// Extends EventEmitter -(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; +exports.rmfiles = function (files, cb) { + ;(function loop (index) { + if (index == files.length) return cb() + fs.unlink(files[index], function (err) { + if (err) return cb(err) + loop(++index) + }) + }(0)) +} /** - * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * Remove a list of directories * - * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. - * @typedef rpc.ServiceMethodCallback - * @template TRes extends Message - * @type {function} - * @param {Error|null} error Error, if any - * @param {TRes} [response] Response message - * @returns {undefined} + * @param {Array} dirs + * @param {Function} callback + * @api public */ -/** - * A service method part of a {@link rpc.Service} as created by {@link Service.create}. - * @typedef rpc.ServiceMethod - * @template TReq extends Message - * @template TRes extends Message - * @type {function} - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message - * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` - */ +exports.rmdirs = function (dirs, cb) { + dirs.sort(desc) + ;(function loop (index) { + if (index == dirs.length) return cb() + fs.rmdir(dirs[index], function (err) { + if (err) return cb(err) + loop(++index) + }) + }(0)) +} /** - * Constructs a new RPC service instance. - * @classdesc An RPC service as returned by {@link Service#create}. - * @exports rpc.Service - * @extends util.EventEmitter - * @constructor - * @param {RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * Sort in descending order + * + * @param {String} a + * @param {String} b + * @api private */ -function Service(rpcImpl, requestDelimited, responseDelimited) { - - if (typeof rpcImpl !== "function") - throw TypeError("rpcImpl must be a function"); - util.EventEmitter.call(this); +function desc(a, b) { + if (a > b) return -1 + if (a < b) return 1 + return 0 +} - /** - * RPC implementation. Becomes `null` once the service is ended. - * @type {RPCImpl|null} - */ - this.rpcImpl = rpcImpl; - /** - * Whether requests are length-delimited. - * @type {boolean} - */ - this.requestDelimited = Boolean(requestDelimited); +/***/ }), - /** - * Whether responses are length-delimited. - * @type {boolean} - */ - this.responseDelimited = Boolean(responseDelimited); -} +/***/ "./node_modules/regenerator-runtime/runtime.js": +/*!*****************************************************!*\ + !*** ./node_modules/regenerator-runtime/runtime.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { /** - * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. - * @param {Method|rpc.ServiceMethod} method Reflected or static method - * @param {Constructor} requestCtor Request constructor - * @param {Constructor} responseCtor Response constructor - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} callback Service callback - * @returns {undefined} - * @template TReq extends Message - * @template TRes extends Message + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. */ -Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { - if (!request) - throw TypeError("request must be specified"); +!(function(global) { + "use strict"; - var self = this; - if (!callback) - return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var undefined; // More compressible than void 0. + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; - if (!self.rpcImpl) { - setTimeout(function() { callback(Error("already ended")); }, 0); - return undefined; + var inModule = typeof module === "object"; + var runtime = global.regeneratorRuntime; + if (runtime) { + if (inModule) { + // If regeneratorRuntime is defined globally and we're in a module, + // make the exports object identical to regeneratorRuntime. + module.exports = runtime; } + // Don't bother evaluating the rest of this file if the runtime was + // already defined globally. + return; + } - try { - return self.rpcImpl( - method, - requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), - function rpcCallback(err, response) { + // Define the runtime globally (as expected by generated code) as either + // module.exports (if we're in a module) or a new, empty object. + runtime = global.regeneratorRuntime = inModule ? module.exports : {}; - if (err) { - self.emit("error", err, method); - return callback(err); - } + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); - if (response === null) { - self.end(/* endedByRPC */ true); - return undefined; - } + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); - if (!(response instanceof responseCtor)) { - try { - response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); - } catch (err) { - self.emit("error", err, method); - return callback(err); - } - } + return generator; + } + runtime.wrap = wrap; - self.emit("data", response, method); - return callback(null, response); - } - ); + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { - self.emit("error", err, method); - setTimeout(function() { callback(err); }, 0); - return undefined; - } -}; - -/** - * Ends this service and emits the `end` event. - * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. - * @returns {rpc.Service} `this` - */ -Service.prototype.end = function end(endedByRPC) { - if (this.rpcImpl) { - if (!endedByRPC) // signal end to rpcImpl - this.rpcImpl(null, null, null); - this.rpcImpl = null; - this.emit("end").off(); + return { type: "throw", arg: err }; } - return this; -}; - - -/***/ }), - -/***/ 23958: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + } + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; -module.exports = LongBits; + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; -var util = __nccwpck_require__(14512); + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} -/** - * Constructs new long bits. - * @classdesc Helper class for working with the low and high bits of a 64 bit value. - * @memberof util - * @constructor - * @param {number} lo Low 32 bits, unsigned - * @param {number} hi High 32 bits, unsigned - */ -function LongBits(lo, hi) { + // This is a polyfill for %IteratorPrototype% for environments that + // don't natively support it. + var IteratorPrototype = {}; + IteratorPrototype[iteratorSymbol] = function () { + return this; + }; - // note that the casts below are theoretically unnecessary as of today, but older statically - // generated converter code might still call the ctor with signed 32bits. kept for compat. + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + if (NativeIteratorPrototype && + NativeIteratorPrototype !== Op && + hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + // This environment has a native %IteratorPrototype%; use it instead + // of the polyfill. + IteratorPrototype = NativeIteratorPrototype; + } - /** - * Low bits. - * @type {number} - */ - this.lo = lo >>> 0; + var Gp = GeneratorFunctionPrototype.prototype = + Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunctionPrototype[toStringTagSymbol] = + GeneratorFunction.displayName = "GeneratorFunction"; - /** - * High bits. - * @type {number} - */ - this.hi = hi >>> 0; -} + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + prototype[method] = function(arg) { + return this._invoke(method, arg); + }; + }); + } -/** - * Zero bits. - * @memberof util.LongBits - * @type {util.LongBits} - */ -var zero = LongBits.zero = new LongBits(0, 0); + runtime.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; -zero.toNumber = function() { return 0; }; -zero.zzEncode = zero.zzDecode = function() { return this; }; -zero.length = function() { return 1; }; + runtime.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + if (!(toStringTagSymbol in genFun)) { + genFun[toStringTagSymbol] = "GeneratorFunction"; + } + } + genFun.prototype = Object.create(Gp); + return genFun; + }; -/** - * Zero hash. - * @memberof util.LongBits - * @type {string} - */ -var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `hasOwn.call(value, "__await")` to determine if the yielded value is + // meant to be awaited. + runtime.awrap = function(arg) { + return { __await: arg }; + }; -/** - * Constructs new long bits from the specified number. - * @param {number} value Value - * @returns {util.LongBits} Instance - */ -LongBits.fromNumber = function fromNumber(value) { - if (value === 0) - return zero; - var sign = value < 0; - if (sign) - value = -value; - var lo = value >>> 0, - hi = (value - lo) / 4294967296 >>> 0; - if (sign) { - hi = ~hi >>> 0; - lo = ~lo >>> 0; - if (++lo > 4294967295) { - lo = 0; - if (++hi > 4294967295) - hi = 0; + function AsyncIterator(generator) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if (value && + typeof value === "object" && + hasOwn.call(value, "__await")) { + return Promise.resolve(value.__await).then(function(value) { + invoke("next", value, resolve, reject); + }, function(err) { + invoke("throw", err, resolve, reject); + }); } - } - return new LongBits(lo, hi); -}; -/** - * Constructs new long bits from a number, long or string. - * @param {Long|number|string} value Value - * @returns {util.LongBits} Instance - */ -LongBits.from = function from(value) { - if (typeof value === "number") - return LongBits.fromNumber(value); - if (util.isString(value)) { - /* istanbul ignore else */ - if (util.Long) - value = util.Long.fromString(value); - else - return LongBits.fromNumber(parseInt(value, 10)); + return Promise.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. If the Promise is rejected, however, the + // result for this iteration will be rejected with the same + // reason. Note that rejections of yielded Promises are not + // thrown back into the generator function, as is the case + // when an awaited Promise is rejected. This difference in + // behavior between yield and await is important, because it + // allows the consumer to decide what to do with the yielded + // rejection (swallow it and continue, manually .throw it back + // into the generator, abandon iteration, whatever). With + // await, by contrast, there is no opportunity to examine the + // rejection reason outside the generator function, so the + // only option is to throw it from the await expression, and + // let the generator function handle the exception. + result.value = unwrapped; + resolve(result); + }, reject); + } } - return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; -}; -/** - * Converts this long bits to a possibly unsafe JavaScript number. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {number} Possibly unsafe number - */ -LongBits.prototype.toNumber = function toNumber(unsigned) { - if (!unsigned && this.hi >>> 31) { - var lo = ~this.lo + 1 >>> 0, - hi = ~this.hi >>> 0; - if (!lo) - hi = hi + 1 >>> 0; - return -(lo + hi * 4294967296); + if (typeof global.process === "object" && global.process.domain) { + invoke = global.process.domain.bind(invoke); } - return this.lo + this.hi * 4294967296; -}; - -/** - * Converts this long bits to a long. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long} Long - */ -LongBits.prototype.toLong = function toLong(unsigned) { - return util.Long - ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) - /* istanbul ignore next */ - : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; -}; -var charCodeAt = String.prototype.charCodeAt; + var previousPromise; -/** - * Constructs new long bits from the specified 8 characters long hash. - * @param {string} hash Hash - * @returns {util.LongBits} Bits - */ -LongBits.fromHash = function fromHash(hash) { - if (hash === zeroHash) - return zero; - return new LongBits( - ( charCodeAt.call(hash, 0) - | charCodeAt.call(hash, 1) << 8 - | charCodeAt.call(hash, 2) << 16 - | charCodeAt.call(hash, 3) << 24) >>> 0 - , - ( charCodeAt.call(hash, 4) - | charCodeAt.call(hash, 5) << 8 - | charCodeAt.call(hash, 6) << 16 - | charCodeAt.call(hash, 7) << 24) >>> 0 - ); -}; + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new Promise(function(resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } -/** - * Converts this long bits to a 8 characters long hash. - * @returns {string} Hash - */ -LongBits.prototype.toHash = function toHash() { - return String.fromCharCode( - this.lo & 255, - this.lo >>> 8 & 255, - this.lo >>> 16 & 255, - this.lo >>> 24 , - this.hi & 255, - this.hi >>> 8 & 255, - this.hi >>> 16 & 255, - this.hi >>> 24 - ); -}; + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : callInvokeWithMethodAndArg(); + } -/** - * Zig-zag encodes this long bits. - * @returns {util.LongBits} `this` - */ -LongBits.prototype.zzEncode = function zzEncode() { - var mask = this.hi >> 31; - this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; - this.lo = ( this.lo << 1 ^ mask) >>> 0; - return this; -}; + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; + } -/** - * Zig-zag decodes this long bits. - * @returns {util.LongBits} `this` - */ -LongBits.prototype.zzDecode = function zzDecode() { - var mask = -(this.lo & 1); - this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; - this.hi = ( this.hi >>> 1 ^ mask) >>> 0; + defineIteratorMethods(AsyncIterator.prototype); + AsyncIterator.prototype[asyncIteratorSymbol] = function () { return this; -}; - -/** - * Calculates the length of this longbits when encoded as a varint. - * @returns {number} Length - */ -LongBits.prototype.length = function length() { - var part0 = this.lo, - part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, - part2 = this.hi >>> 24; - return part2 === 0 - ? part1 === 0 - ? part0 < 16384 - ? part0 < 128 ? 1 : 2 - : part0 < 2097152 ? 3 : 4 - : part1 < 16384 - ? part1 < 128 ? 5 : 6 - : part1 < 2097152 ? 7 : 8 - : part2 < 128 ? 9 : 10; -}; - - -/***/ }), - -/***/ 14512: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + }; + runtime.AsyncIterator = AsyncIterator; + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + runtime.async = function(innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList) + ); -var util = exports; + return runtime.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; -// used to return a Promise where callback is omitted -util.asPromise = __nccwpck_require__(40488); + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; -// converts to / from base64 encoded strings -util.base64 = __nccwpck_require__(81246); + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } -// base class of rpc.Service -util.EventEmitter = __nccwpck_require__(85885); + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } -// float handling accross browsers -util.float = __nccwpck_require__(26666); + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } -// requires modules optionally and hides the call from bundlers -util.inquire = __nccwpck_require__(62798); + context.method = method; + context.arg = arg; -// converts to / from utf8 encoded strings -util.utf8 = __nccwpck_require__(30105); + while (true) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } -// provides a node-like buffer pool in the browser -util.pool = __nccwpck_require__(45350); + if (context.method === "next") { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = context.arg; -// utility to work with the low and high bits of a 64 bit value -util.LongBits = __nccwpck_require__(23958); + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } -/** - * Whether running within node or not. - * @memberof util - * @type {boolean} - */ -util.isNode = Boolean(typeof global !== "undefined" - && global - && global.process - && global.process.versions - && global.process.versions.node); + context.dispatchException(context.arg); -/** - * Global object reference. - * @memberof util - * @type {Object} - */ -util.global = util.isNode && global - || typeof window !== "undefined" && window - || typeof self !== "undefined" && self - || this; // eslint-disable-line no-invalid-this + } else if (context.method === "return") { + context.abrupt("return", context.arg); + } -/** - * An immuable empty array. - * @memberof util - * @type {Array.<*>} - * @const - */ -util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes + state = GenStateExecuting; -/** - * An immutable empty object. - * @type {Object} - * @const - */ -util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; -/** - * Tests if the specified value is an integer. - * @function - * @param {*} value Value to test - * @returns {boolean} `true` if the value is an integer - */ -util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { - return typeof value === "number" && isFinite(value) && Math.floor(value) === value; -}; + if (record.arg === ContinueSentinel) { + continue; + } -/** - * Tests if the specified value is a string. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a string - */ -util.isString = function isString(value) { - return typeof value === "string" || value instanceof String; -}; + return { + value: record.arg, + done: context.done + }; -/** - * Tests if the specified value is a non-null object. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a non-null object - */ -util.isObject = function isObject(value) { - return value && typeof value === "object"; -}; + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(context.arg) call above. + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } -/** - * Checks if a property on a message is considered to be present. - * This is an alias of {@link util.isSet}. - * @function - * @param {Object} obj Plain object or message instance - * @param {string} prop Property name - * @returns {boolean} `true` if considered to be present, otherwise `false` - */ -util.isset = + // Call delegate.iterator[context.method](context.arg) and handle the + // result, either by returning a { value, done } result from the + // delegate iterator, or by modifying context.method and context.arg, + // setting context.delegate to null, and returning the ContinueSentinel. + function maybeInvokeDelegate(delegate, context) { + var method = delegate.iterator[context.method]; + if (method === undefined) { + // A .throw or .return when the delegate iterator has no .throw + // method always terminates the yield* loop. + context.delegate = null; -/** - * Checks if a property on a message is considered to be present. - * @param {Object} obj Plain object or message instance - * @param {string} prop Property name - * @returns {boolean} `true` if considered to be present, otherwise `false` - */ -util.isSet = function isSet(obj, prop) { - var value = obj[prop]; - if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins - return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; - return false; -}; + if (context.method === "throw") { + if (delegate.iterator.return) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = "return"; + context.arg = undefined; + maybeInvokeDelegate(delegate, context); -/** - * Any compatible Buffer instance. - * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. - * @interface Buffer - * @extends Uint8Array - */ + if (context.method === "throw") { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; + } + } -/** - * Node's Buffer class if available. - * @type {Constructor} - */ -util.Buffer = (function() { - try { - var Buffer = util.inquire("buffer").Buffer; - // refuse to use non-node buffers if not explicitly assigned (perf reasons): - return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; - } catch (e) { - /* istanbul ignore next */ - return null; - } -})(); + context.method = "throw"; + context.arg = new TypeError( + "The iterator does not provide a 'throw' method"); + } -// Internal alias of or polyfull for Buffer.from. -util._Buffer_from = null; + return ContinueSentinel; + } -// Internal alias of or polyfill for Buffer.allocUnsafe. -util._Buffer_allocUnsafe = null; + var record = tryCatch(method, delegate.iterator, context.arg); -/** - * Creates a new buffer of whatever type supported by the environment. - * @param {number|number[]} [sizeOrArray=0] Buffer size or number array - * @returns {Uint8Array|Buffer} Buffer - */ -util.newBuffer = function newBuffer(sizeOrArray) { - /* istanbul ignore next */ - return typeof sizeOrArray === "number" - ? util.Buffer - ? util._Buffer_allocUnsafe(sizeOrArray) - : new util.Array(sizeOrArray) - : util.Buffer - ? util._Buffer_from(sizeOrArray) - : typeof Uint8Array === "undefined" - ? sizeOrArray - : new Uint8Array(sizeOrArray); -}; + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } -/** - * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. - * @type {Constructor} - */ -util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; + var info = record.arg; -/** - * Any compatible Long instance. - * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. - * @interface Long - * @property {number} low Low bits - * @property {number} high High bits - * @property {boolean} unsigned Whether unsigned or not - */ + if (! info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } -/** - * Long.js's Long class if available. - * @type {Constructor} - */ -util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long - || /* istanbul ignore next */ util.global.Long - || util.inquire("long"); + if (info.done) { + // Assign the result of the finished delegate to the temporary + // variable specified by delegate.resultName (see delegateYield). + context[delegate.resultName] = info.value; -/** - * Regular expression used to verify 2 bit (`bool`) map keys. - * @type {RegExp} - * @const - */ -util.key2Re = /^true|false|0|1$/; + // Resume execution at the desired location (see delegateYield). + context.next = delegate.nextLoc; -/** - * Regular expression used to verify 32 bit (`int32` etc.) map keys. - * @type {RegExp} - * @const - */ -util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; + // If context.method was "throw" but the delegate handled the + // exception, let the outer generator proceed normally. If + // context.method was "next", forget context.arg since it has been + // "consumed" by the delegate iterator. If context.method was + // "return", allow the original .return call to continue in the + // outer generator. + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined; + } -/** - * Regular expression used to verify 64 bit (`int64` etc.) map keys. - * @type {RegExp} - * @const - */ -util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; + } else { + // Re-yield the result returned by the delegate method. + return info; + } -/** - * Converts a number or long to an 8 characters long hash string. - * @param {Long|number} value Value to convert - * @returns {string} Hash - */ -util.longToHash = function longToHash(value) { - return value - ? util.LongBits.from(value).toHash() - : util.LongBits.zeroHash; -}; + // The delegate iterator is finished, so forget it and continue with + // the outer generator. + context.delegate = null; + return ContinueSentinel; + } -/** - * Converts an 8 characters long hash string to a long or number. - * @param {string} hash Hash - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long|number} Original value - */ -util.longFromHash = function longFromHash(hash, unsigned) { - var bits = util.LongBits.fromHash(hash); - if (util.Long) - return util.Long.fromBits(bits.lo, bits.hi, unsigned); - return bits.toNumber(Boolean(unsigned)); -}; + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); -/** - * Merges the properties of the source object into the destination object. - * @memberof util - * @param {Object.} dst Destination object - * @param {Object.} src Source object - * @param {boolean} [ifNotSet=false] Merges only if the key is not already set - * @returns {Object.} Destination object - */ -function merge(dst, src, ifNotSet) { // used by converters - for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) - if (dst[keys[i]] === undefined || !ifNotSet) - dst[keys[i]] = src[keys[i]]; - return dst; -} + Gp[toStringTagSymbol] = "Generator"; -util.merge = merge; + // A Generator should always return itself as the iterator object when the + // @@iterator function is called on it. Some browsers' implementations of the + // iterator prototype chain incorrectly implement this, causing the Generator + // object to not be returned from this call. This ensures that doesn't happen. + // See https://github.com/facebook/regenerator/issues/274 for more details. + Gp[iteratorSymbol] = function() { + return this; + }; -/** - * Converts the first character of a string to lower case. - * @param {string} str String to convert - * @returns {string} Converted string - */ -util.lcFirst = function lcFirst(str) { - return str.charAt(0).toLowerCase() + str.substring(1); -}; + Gp.toString = function() { + return "[object Generator]"; + }; -/** - * Creates a custom error constructor. - * @memberof util - * @param {string} name Error name - * @returns {Constructor} Custom error constructor - */ -function newError(name) { + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; - function CustomError(message, properties) { + if (1 in locs) { + entry.catchLoc = locs[1]; + } - if (!(this instanceof CustomError)) - return new CustomError(message, properties); + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } - // Error.call(this, message); - // ^ just returns a new error instance because the ctor can be called as a function + this.tryEntries.push(entry); + } - Object.defineProperty(this, "message", { get: function() { return message; } }); + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } - /* istanbul ignore next */ - if (Error.captureStackTrace) // node - Error.captureStackTrace(this, CustomError); - else - Object.defineProperty(this, "stack", { value: new Error().stack || "" }); + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } - if (properties) - merge(this, properties); + runtime.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); } + keys.reverse(); - CustomError.prototype = Object.create(Error.prototype, { - constructor: { - value: CustomError, - writable: true, - enumerable: false, - configurable: true, - }, - name: { - get: function get() { return name; }, - set: undefined, - enumerable: false, - // configurable: false would accurately preserve the behavior of - // the original, but I'm guessing that was not intentional. - // For an actual error subclass, this property would - // be configurable. - configurable: true, - }, - toString: { - value: function value() { return this.name + ": " + this.message; }, - writable: true, - enumerable: false, - configurable: true, - }, - }); - - return CustomError; -} + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } -util.newError = newError; + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; -/** - * Constructs a new protocol error. - * @classdesc Error subclass indicating a protocol specifc error. - * @memberof util - * @extends Error - * @template T extends Message - * @constructor - * @param {string} message Error message - * @param {Object.} [properties] Additional properties - * @example - * try { - * MyMessage.decode(someBuffer); // throws if required fields are missing - * } catch (e) { - * if (e instanceof ProtocolError && e.instance) - * console.log("decoded so far: " + JSON.stringify(e.instance)); - * } - */ -util.ProtocolError = newError("ProtocolError"); + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } -/** - * So far decoded message instance. - * @name util.ProtocolError#instance - * @type {Message} - */ + if (typeof iterable.next === "function") { + return iterable; + } -/** - * A OneOf getter as returned by {@link util.oneOfGetter}. - * @typedef OneOfGetter - * @type {function} - * @returns {string|undefined} Set field name, if any - */ + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } -/** - * Builds a getter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfGetter} Unbound getter - */ -util.oneOfGetter = function getOneOf(fieldNames) { - var fieldMap = {}; - for (var i = 0; i < fieldNames.length; ++i) - fieldMap[fieldNames[i]] = 1; + next.value = undefined; + next.done = true; - /** - * @returns {string|undefined} Set field name, if any - * @this Object - * @ignore - */ - return function() { // eslint-disable-line consistent-return - for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) - if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) - return keys[i]; - }; -}; + return next; + }; -/** - * A OneOf setter as returned by {@link util.oneOfSetter}. - * @typedef OneOfSetter - * @type {function} - * @param {string|undefined} value Field name - * @returns {undefined} - */ + return next.next = next; + } + } -/** - * Builds a setter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfSetter} Unbound setter - */ -util.oneOfSetter = function setOneOf(fieldNames) { + // Return an iterator with no values. + return { next: doneResult }; + } + runtime.values = values; - /** - * @param {string} name Field name - * @returns {undefined} - * @this Object - * @ignore - */ - return function(name) { - for (var i = 0; i < fieldNames.length; ++i) - if (fieldNames[i] !== name) - delete this[fieldNames[i]]; - }; -}; + function doneResult() { + return { value: undefined, done: true }; + } -/** - * Default conversion options used for {@link Message#toJSON} implementations. - * - * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: - * - * - Longs become strings - * - Enums become string keys - * - Bytes become base64 encoded strings - * - (Sub-)Messages become plain objects - * - Maps become plain objects with all string keys - * - Repeated fields become arrays - * - NaN and Infinity for float and double fields become strings - * - * @type {IConversionOptions} - * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json - */ -util.toJSONOptions = { - longs: String, - enums: String, - bytes: String, - json: true -}; + Context.prototype = { + constructor: Context, -// Sets up buffer utility according to the environment (called in index-minimal) -util._configure = function() { - var Buffer = util.Buffer; - /* istanbul ignore if */ - if (!Buffer) { - util._Buffer_from = util._Buffer_allocUnsafe = null; - return; - } - // because node 4.x buffers are incompatible & immutable - // see: https://github.com/dcodeIO/protobuf.js/pull/665 - util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || - /* istanbul ignore next */ - function Buffer_from(value, encoding) { - return new Buffer(value, encoding); - }; - util._Buffer_allocUnsafe = Buffer.allocUnsafe || - /* istanbul ignore next */ - function Buffer_allocUnsafe(size) { - return new Buffer(size); - }; -}; + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; + this.method = "next"; + this.arg = undefined; -/***/ }), + this.tryEntries.forEach(resetTryEntry); -/***/ 18583: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + stop: function() { + this.done = true; -module.exports = Writer; + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } -var util = __nccwpck_require__(14512); + return this.rval; + }, -var BufferWriter; // cyclic + dispatchException: function(exception) { + if (this.done) { + throw exception; + } -var LongBits = util.LongBits, - base64 = util.base64, - utf8 = util.utf8; + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; -/** - * Constructs a new writer operation instance. - * @classdesc Scheduled writer operation. - * @constructor - * @param {function(*, Uint8Array, number)} fn Function to call - * @param {number} len Value byte length - * @param {*} val Value to write - * @ignore - */ -function Op(fn, len, val) { + if (caught) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + context.method = "next"; + context.arg = undefined; + } - /** - * Function to call. - * @type {function(Uint8Array, number, *)} - */ - this.fn = fn; + return !! caught; + } - /** - * Value byte length. - * @type {number} - */ - this.len = len; + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; - /** - * Next operation. - * @type {Writer.Op|undefined} - */ - this.next = undefined; + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } - /** - * Value to write. - * @type {*} - */ - this.val = val; // type varies -} + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); -/* istanbul ignore next */ -function noop() {} // eslint-disable-line no-empty-function + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } -/** - * Constructs a new writer state instance. - * @classdesc Copied writer state. - * @memberof Writer - * @constructor - * @param {Writer} writer Writer to copy state from - * @ignore - */ -function State(writer) { + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } - /** - * Current head. - * @type {Writer.Op} - */ - this.head = writer.head; + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } - /** - * Current tail. - * @type {Writer.Op} - */ - this.tail = writer.tail; + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, - /** - * Current buffer length. - * @type {number} - */ - this.len = writer.len; + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } - /** - * Next state. - * @type {State|null} - */ - this.next = writer.states; -} + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } -/** - * Constructs a new writer instance. - * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. - * @constructor - */ -function Writer() { + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; - /** - * Current length. - * @type {number} - */ - this.len = 0; + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } - /** - * Operations head. - * @type {Object} - */ - this.head = new Op(noop, 0, 0); + return this.complete(record); + }, - /** - * Operations tail - * @type {Object} - */ - this.tail = this.head; + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } - /** - * Linked forked states. - * @type {Object|null} - */ - this.states = null; + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } - // When a value is written, the writer calculates its byte length and puts it into a linked - // list of operations to perform when finish() is called. This both allows us to allocate - // buffers of the exact required size and reduces the amount of work we have to do compared - // to first calculating over objects and then encoding over objects. In our case, the encoding - // part is just a linked list walk calling operations with already prepared values. -} + return ContinueSentinel; + }, -var create = function create() { - return util.Buffer - ? function create_buffer_setup() { - return (Writer.create = function create_buffer() { - return new BufferWriter(); - })(); + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; } - /* istanbul ignore next */ - : function create_array() { - return new Writer(); - }; -}; - -/** - * Creates a new writer. - * @function - * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} - */ -Writer.create = create(); + } + }, -/** - * Allocates a buffer of the specified size. - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ -Writer.alloc = function alloc(size) { - return new util.Array(size); -}; + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } -// Use Uint8Array buffer pool in the browser, just like node does with buffers -/* istanbul ignore else */ -if (util.Array !== Array) - Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, -/** - * Pushes a new operation to the queue. - * @param {function(Uint8Array, number, *)} fn Function to call - * @param {number} len Value byte length - * @param {number} val Value to write - * @returns {Writer} `this` - * @private - */ -Writer.prototype._push = function push(fn, len, val) { - this.tail = this.tail.next = new Op(fn, len, val); - this.len += len; - return this; -}; + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; -function writeByte(val, buf, pos) { - buf[pos] = val & 255; -} + if (this.method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + this.arg = undefined; + } -function writeVarint32(val, buf, pos) { - while (val > 127) { - buf[pos++] = val & 127 | 128; - val >>>= 7; + return ContinueSentinel; } - buf[pos] = val; -} - -/** - * Constructs a new varint writer operation instance. - * @classdesc Scheduled varint writer operation. - * @extends Op - * @constructor - * @param {number} len Value byte length - * @param {number} val Value to write - * @ignore - */ -function VarintOp(len, val) { - this.len = len; - this.next = undefined; - this.val = val; -} + }; +})( + // Among the various tricks for obtaining a reference to the global + // object, this seems to be the most reliable technique that does not + // use indirect eval (which violates Content Security Policy). + typeof global === "object" ? global : + typeof window === "object" ? window : + typeof self === "object" ? self : this +); -VarintOp.prototype = Object.create(Op.prototype); -VarintOp.prototype.fn = writeVarint32; -/** - * Writes an unsigned 32 bit value as a varint. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.uint32 = function write_uint32(value) { - // here, the call to this.push has been inlined and a varint specific Op subclass is used. - // uint32 is by far the most frequently used operation and benefits significantly from this. - this.len += (this.tail = this.tail.next = new VarintOp( - (value = value >>> 0) - < 128 ? 1 - : value < 16384 ? 2 - : value < 2097152 ? 3 - : value < 268435456 ? 4 - : 5, - value)).len; - return this; -}; +/***/ }), -/** - * Writes a signed 32 bit value as a varint. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.int32 = function write_int32(value) { - return value < 0 - ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec - : this.uint32(value); -}; +/***/ "./node_modules/safe-buffer/index.js": +/*!*******************************************!*\ + !*** ./node_modules/safe-buffer/index.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_971614__) { -/** - * Writes a 32 bit value as a varint, zig-zag encoded. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.sint32 = function write_sint32(value) { - return this.uint32((value << 1 ^ value >> 31) >>> 0); -}; +/* eslint-disable node/no-deprecated-api */ +var buffer = __nested_webpack_require_971614__(/*! buffer */ "buffer") +var Buffer = buffer.Buffer -function writeVarint64(val, buf, pos) { - while (val.hi) { - buf[pos++] = val.lo & 127 | 128; - val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; - val.hi >>>= 7; - } - while (val.lo > 127) { - buf[pos++] = val.lo & 127 | 128; - val.lo = val.lo >>> 7; - } - buf[pos++] = val.lo; +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer } -/** - * Writes an unsigned 64 bit value as a varint. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.uint64 = function write_uint64(value) { - var bits = LongBits.from(value); - return this._push(writeVarint64, bits.length(), bits); -}; +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} -/** - * Writes a signed 64 bit value as a varint. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.int64 = Writer.prototype.uint64; +SafeBuffer.prototype = Object.create(Buffer.prototype) -/** - * Writes a signed 64 bit value as a varint, zig-zag encoded. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.sint64 = function write_sint64(value) { - var bits = LongBits.from(value).zzEncode(); - return this._push(writeVarint64, bits.length(), bits); -}; +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) -/** - * Writes a boolish value as a varint. - * @param {boolean} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.bool = function write_bool(value) { - return this._push(writeByte, 1, value ? 1 : 0); -}; +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} -function writeFixed32(val, buf, pos) { - buf[pos ] = val & 255; - buf[pos + 1] = val >>> 8 & 255; - buf[pos + 2] = val >>> 16 & 255; - buf[pos + 3] = val >>> 24; +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf } -/** - * Writes an unsigned 32 bit value as fixed 32 bits. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.fixed32 = function write_fixed32(value) { - return this._push(writeFixed32, 4, value >>> 0); -}; +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} -/** - * Writes a signed 32 bit value as fixed 32 bits. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.sfixed32 = Writer.prototype.fixed32; +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} -/** - * Writes an unsigned 64 bit value as fixed 64 bits. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.fixed64 = function write_fixed64(value) { - var bits = LongBits.from(value); - return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); -}; -/** - * Writes a signed 64 bit value as fixed 64 bits. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.sfixed64 = Writer.prototype.fixed64; +/***/ }), -/** - * Writes a float (32 bit). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.float = function write_float(value) { - return this._push(util.float.writeFloatLE, 4, value); -}; +/***/ "./node_modules/supports-color/index.js": +/*!**********************************************!*\ + !*** ./node_modules/supports-color/index.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_973529__) { -/** - * Writes a double (64 bit float). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.double = function write_double(value) { - return this._push(util.float.writeDoubleLE, 8, value); -}; +"use strict"; -var writeBytes = util.Array.prototype.set - ? function writeBytes_set(val, buf, pos) { - buf.set(val, pos); // also works for plain array values - } - /* istanbul ignore next */ - : function writeBytes_for(val, buf, pos) { - for (var i = 0; i < val.length; ++i) - buf[pos + i] = val[i]; - }; +const os = __nested_webpack_require_973529__(/*! os */ "os"); +const hasFlag = __nested_webpack_require_973529__(/*! has-flag */ "./node_modules/has-flag/index.js"); -/** - * Writes a sequence of bytes. - * @param {Uint8Array|string} value Buffer or base64 encoded string to write - * @returns {Writer} `this` - */ -Writer.prototype.bytes = function write_bytes(value) { - var len = value.length >>> 0; - if (!len) - return this._push(writeByte, 1, 0); - if (util.isString(value)) { - var buf = Writer.alloc(len = base64.length(value)); - base64.decode(value, buf, 0); - value = buf; - } - return this.uint32(len)._push(writeBytes, len, value); -}; +const env = process.env; -/** - * Writes a string. - * @param {string} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.string = function write_string(value) { - var len = utf8.length(value); - return len - ? this.uint32(len)._push(utf8.write, len, value) - : this._push(writeByte, 1, 0); -}; +let forceColor; +if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false')) { + forceColor = false; +} else if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + forceColor = true; +} +if ('FORCE_COLOR' in env) { + forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; +} -/** - * Forks this writer's state by pushing it to a stack. - * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. - * @returns {Writer} `this` - */ -Writer.prototype.fork = function fork() { - this.states = new State(this); - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; - return this; -}; +function translateLevel(level) { + if (level === 0) { + return false; + } -/** - * Resets this instance to the last state. - * @returns {Writer} `this` - */ -Writer.prototype.reset = function reset() { - if (this.states) { - this.head = this.states.head; - this.tail = this.states.tail; - this.len = this.states.len; - this.states = this.states.next; - } else { - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; - } - return this; -}; + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; +} -/** - * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. - * @returns {Writer} `this` - */ -Writer.prototype.ldelim = function ldelim() { - var head = this.head, - tail = this.tail, - len = this.len; - this.reset().uint32(len); - if (len) { - this.tail.next = head.next; // skip noop - this.tail = tail; - this.len += len; - } - return this; -}; +function supportsColor(stream) { + if (forceColor === false) { + return 0; + } -/** - * Finishes the write operation. - * @returns {Uint8Array} Finished buffer - */ -Writer.prototype.finish = function finish() { - var head = this.head.next, // skip noop - buf = this.constructor.alloc(this.len), - pos = 0; - while (head) { - head.fn(head.val, buf, pos); - pos += head.len; - head = head.next; - } - // this.head = this.tail = null; - return buf; -}; + if (hasFlag('color=16m') || + hasFlag('color=full') || + hasFlag('color=truecolor')) { + return 3; + } -Writer._configure = function(BufferWriter_) { - BufferWriter = BufferWriter_; - Writer.create = create(); - BufferWriter._configure(); -}; + if (hasFlag('color=256')) { + return 2; + } + if (stream && !stream.isTTY && forceColor !== true) { + return 0; + } -/***/ }), + const min = forceColor ? 1 : 0; -/***/ 41779: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (process.platform === 'win32') { + // Node.js 7.5.0 is the first version of Node.js to include a patch to + // libuv that enables 256 color output on Windows. Anything earlier and it + // won't work. However, here we target Node.js 8 at minimum as it is an LTS + // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows + // release that supports 256 colors. Windows 10 build 14931 is the first release + // that supports 16m/TrueColor. + const osRelease = os.release().split('.'); + if ( + Number(process.versions.node.split('.')[0]) >= 8 && + Number(osRelease[0]) >= 10 && + Number(osRelease[2]) >= 10586 + ) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + return 1; + } -module.exports = BufferWriter; + if ('CI' in env) { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + return 1; + } -// extends Writer -var Writer = __nccwpck_require__(18583); -(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; + return min; + } -var util = __nccwpck_require__(14512); + if ('TEAMCITY_VERSION' in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } -/** - * Constructs a new buffer writer instance. - * @classdesc Wire format writer using node buffers. - * @extends Writer - * @constructor - */ -function BufferWriter() { - Writer.call(this); -} + if (env.COLORTERM === 'truecolor') { + return 3; + } -BufferWriter._configure = function () { - /** - * Allocates a buffer of the specified size. - * @function - * @param {number} size Buffer size - * @returns {Buffer} Buffer - */ - BufferWriter.alloc = util._Buffer_allocUnsafe; + if ('TERM_PROGRAM' in env) { + const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); - BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" - ? function writeBytesBuffer_set(val, buf, pos) { - buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) - // also works for plain array values - } - /* istanbul ignore next */ - : function writeBytesBuffer_copy(val, buf, pos) { - if (val.copy) // Buffer values - val.copy(buf, pos, 0, val.length); - else for (var i = 0; i < val.length;) // plain array values - buf[pos++] = val[i++]; - }; -}; + switch (env.TERM_PROGRAM) { + case 'iTerm.app': + return version >= 3 ? 3 : 2; + case 'Apple_Terminal': + return 2; + // No default + } + } + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } -/** - * @override - */ -BufferWriter.prototype.bytes = function write_bytes_buffer(value) { - if (util.isString(value)) - value = util._Buffer_from(value, "base64"); - var len = value.length >>> 0; - this.uint32(len); - if (len) - this._push(BufferWriter.writeBytesBuffer, len, value); - return this; -}; + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } -function writeStringBuffer(val, buf, pos) { - if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) - util.utf8.write(val, buf, pos); - else if (buf.utf8Write) - buf.utf8Write(val, pos); - else - buf.write(val, pos); -} + if ('COLORTERM' in env) { + return 1; + } -/** - * @override - */ -BufferWriter.prototype.string = function write_string_buffer(value) { - var len = util.Buffer.byteLength(value); - this.uint32(len); - if (len) - this._push(writeStringBuffer, len, value); - return this; -}; + if (env.TERM === 'dumb') { + return min; + } + return min; +} -/** - * Finishes the write operation. - * @name BufferWriter#finish - * @function - * @returns {Buffer} Finished buffer - */ +function getSupportLevel(stream) { + const level = supportsColor(stream); + return translateLevel(level); +} -BufferWriter._configure(); +module.exports = { + supportsColor: getSupportLevel, + stdout: getSupportLevel(process.stdout), + stderr: getSupportLevel(process.stderr) +}; /***/ }), -/***/ 62193: -======= -/***/ 45261: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { +/***/ "./node_modules/varint/decode.js": +/*!***************************************!*\ + !*** ./node_modules/varint/decode.js ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { module.exports = read @@ -135407,7 +59294,7 @@ function read(buf, offset) { , l = buf.length do { - if (counter >= l || shift > 49) { + if (counter >= l) { read.bytes = 0 throw new RangeError('Could not decode varint') } @@ -135426,12 +59313,12 @@ function read(buf, offset) { /***/ }), -<<<<<<< HEAD -/***/ 7197: -======= -/***/ 12801: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { +/***/ "./node_modules/varint/encode.js": +/*!***************************************!*\ + !*** ./node_modules/varint/encode.js ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { module.exports = encode @@ -135441,10 +59328,6 @@ var MSB = 0x80 , INT = Math.pow(2, 31) function encode(num, out, offset) { - if (Number.MAX_SAFE_INTEGER && num > Number.MAX_SAFE_INTEGER) { - encode.bytes = 0 - throw new RangeError('Could not encode varint') - } out = out || [] offset = offset || 0 var oldOffset = offset @@ -135467,34 +59350,28 @@ function encode(num, out, offset) { /***/ }), -<<<<<<< HEAD -/***/ 86941: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = { - encode: __nccwpck_require__(7197) - , decode: __nccwpck_require__(62193) - , encodingLength: __nccwpck_require__(89336) -======= -/***/ 30310: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ "./node_modules/varint/index.js": +/*!**************************************!*\ + !*** ./node_modules/varint/index.js ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_978117__) { module.exports = { - encode: __nccwpck_require__(12801) - , decode: __nccwpck_require__(45261) - , encodingLength: __nccwpck_require__(92945) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + encode: __nested_webpack_require_978117__(/*! ./encode.js */ "./node_modules/varint/encode.js") + , decode: __nested_webpack_require_978117__(/*! ./decode.js */ "./node_modules/varint/decode.js") + , encodingLength: __nested_webpack_require_978117__(/*! ./length.js */ "./node_modules/varint/length.js") } /***/ }), -<<<<<<< HEAD -/***/ 89336: -======= -/***/ 92945: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { +/***/ "./node_modules/varint/length.js": +/*!***************************************!*\ + !*** ./node_modules/varint/length.js ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { var N1 = Math.pow(2, 7) @@ -135525,84410 +59402,78916 @@ module.exports = function (value) { /***/ }), -<<<<<<< HEAD -/***/ 59759: -/***/ ((module) => { +/***/ "./node_modules/webpack/buildin/amd-options.js": +/*!****************************************!*\ + !*** (webpack)/buildin/amd-options.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { +/* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {/* globals __webpack_amd_options__ */ +module.exports = __webpack_amd_options__; +/* WEBPACK VAR INJECTION */}.call(this, {})) -/** - * Turns a browser readable stream into an async iterable. Async iteration over - * returned iterable will lock give stream, preventing any other consumer from - * acquiring a reader. The lock will be released if iteration loop is broken. To - * prevent stream cancelling optional `{ preventCancel: true }` could be passed - * as a second argument. - * @template T - * @param {ReadableStream} stream - * @param {Object} [options] - * @param {boolean} [options.preventCancel=boolean] - * @returns {AsyncIterable} - */ -async function * browserReadableStreamToIt (stream, options = {}) { - const reader = stream.getReader() +/***/ }), -======= -/***/ 44713: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./src/commands/data/pinList/pinList.js": +/*!**********************************************!*\ + !*** ./src/commands/data/pinList/pinList.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_979894__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = pinList; -var cid = __nccwpck_require__(24247); -var objectToCamel = __nccwpck_require__(62268); -var configure = __nccwpck_require__(31775); -var multipartRequest = __nccwpck_require__(87527); -var toUrlSearchParams = __nccwpck_require__(52836); -var abortSignal = __nccwpck_require__(14594); -var nativeAbortController = __nccwpck_require__(43586); - -const createAddAll = configure.configure(api => { - async function* addAll(source, options = {}) { - const controller = new nativeAbortController.AbortController(); - const signal = abortSignal.abortSignal(controller.signal, options.signal); - const {headers, body, total, parts} = await multipartRequest.multipartRequest(source, controller, options.headers); - const [progressFn, onUploadProgress] = typeof options.progress === 'function' ? createProgressHandler(total, parts, options.progress) : [ - undefined, - undefined - ]; - const res = await api.post('add', { - searchParams: toUrlSearchParams.toUrlSearchParams({ - 'stream-channels': true, - ...options, - progress: Boolean(progressFn) - }), - onUploadProgress, - signal, - headers, - body - }); - for await (let file of res.ndjson()) { - file = objectToCamel.objectToCamel(file); - if (file.hash !== undefined) { - yield toCoreInterface(file); - } else if (progressFn) { - progressFn(file.bytes || 0, file.name); +var _axios = _interopRequireDefault(__nested_webpack_require_979894__(/*! axios */ "./node_modules/axios/index.js")); + +var _constants = __nested_webpack_require_979894__(/*! ./../../../constants */ "./src/constants.js"); + +var _validators = __nested_webpack_require_979894__(/*! ../../../util/validators */ "./src/util/validators.js"); + +var _errorResponse = __nested_webpack_require_979894__(/*! ../../../util/errorResponse */ "./src/util/errorResponse.js"); + +var _queryBuilder = _interopRequireDefault(__nested_webpack_require_979894__(/*! ./queryBuilder */ "./src/commands/data/pinList/queryBuilder.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +/** + * Pin List + * @param {string} pinataApiKey + * @param {string} pinataSecretApiKey + * @param {string} filters + * @returns {Promise} + */ +function pinList(pinataApiKey, pinataSecretApiKey, filters) { + (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); + var baseEndpoint = "".concat(_constants.baseUrl, "/data/pinList"); + var endpoint = (0, _queryBuilder["default"])(baseEndpoint, filters); + return new Promise(function (resolve, reject) { + _axios["default"].get(endpoint, { + withCredentials: true, + headers: { + 'pinata_api_key': pinataApiKey, + 'pinata_secret_api_key': pinataSecretApiKey } - } - } - return addAll; -}); -const createProgressHandler = (total, parts, progress) => parts ? [ - undefined, - createOnUploadProgress(total, parts, progress) -] : [ - progress, - undefined -]; -const createOnUploadProgress = (size, parts, progress) => { - let index = 0; - const count = parts.length; - return ({loaded, total}) => { - const position = Math.floor(loaded / total * size); - while (index < count) { - const {start, end, name} = parts[index]; - if (position < end) { - progress(position - start, name); - break; - } else { - progress(end - start, name); - index += 1; + }).then(function (result) { + if (result.status !== 200) { + reject(new Error("unknown server response while attempting to retrieve user pin list: ".concat(result))); } - } - }; -}; -function toCoreInterface({name, hash, size, mode, mtime, mtimeNsecs}) { - const output = { - path: name, - cid: cid.CID.parse(hash), - size: parseInt(size) - }; - if (mode != null) { - output.mode = parseInt(mode, 8); - } - if (mtime != null) { - output.mtime = { - secs: mtime, - nsecs: mtimeNsecs || 0 - }; - } - return output; -} -exports.createAddAll = createAddAll; + resolve(result.data); + })["catch"](function (error) { + var formattedError = (0, _errorResponse.handleError)(error); + reject(formattedError); + }); + }); +} +module.exports = exports.default; /***/ }), -/***/ 26151: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./src/commands/data/pinList/queryBuilder.js": +/*!***************************************************!*\ + !*** ./src/commands/data/pinList/queryBuilder.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var addAll = __nccwpck_require__(44713); -var last = __nccwpck_require__(28741); -var configure = __nccwpck_require__(31775); -var normaliseInputSingle = __nccwpck_require__(75400); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = queryBuilder; -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } -var last__default = /*#__PURE__*/_interopDefaultLegacy(last); +/** + * Validate and return data + * @param {*} dateToValidate + * @returns {*} + */ +function validateAndReturnDate(dateToValidate) { + var dateParsed = new Date(Date.parse(dateToValidate)); -function createAdd(options) { - const all = addAll.createAddAll(options); - return configure.configure(() => { - async function add(input, options = {}) { - return await last__default["default"](all(normaliseInputSingle.normaliseInput(input), options)); + try { + if (dateParsed.toISOString() === dateToValidate) { + return dateToValidate; } - return add; - })(options); + + throw new Error('dates must be in valid ISO_8601 format'); + } catch (e) { + throw new Error('dates must be in valid ISO_8601 format'); + } } +/** + * Query Builder + * @param {string} baseUrl + * @param {*} filters + * @returns {string} + */ -exports.createAdd = createAdd; +function queryBuilder(baseUrl, filters) { + if (!baseUrl) { + throw new Error('no baseUrl provided'); + } // preset filter values -/***/ }), -/***/ 60138: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + var filterQuery = '?'; + var metadataQuery = ''; -"use strict"; + if (filters) { + // now we need to construct the actual URL based on the given filters provided + if (filters.hashContains) { + if (typeof filters.hashContains !== 'string') { + throw new Error('hashContains value is not a string'); + } + filterQuery = filterQuery + "hashContains=".concat(filters.hashContains, "&"); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + if (filters.pinStart) { + filterQuery = filterQuery + "pinStart=".concat(validateAndReturnDate(filters.pinStart), "&"); + } -var wantlist = __nccwpck_require__(81812); -var wantlistForPeer = __nccwpck_require__(34861); -var stat = __nccwpck_require__(70104); -var unwant = __nccwpck_require__(12388); + if (filters.pinEnd) { + filterQuery = filterQuery + "pinEnd=".concat(validateAndReturnDate(filters.pinEnd), "&"); + } -function createBitswap(config) { - return { - wantlist: wantlist.createWantlist(config), - wantlistForPeer: wantlistForPeer.createWantlistForPeer(config), - unwant: unwant.createUnwant(config), - stat: stat.createStat(config) - }; -} + if (filters.unpinStart) { + filterQuery = filterQuery + "unpinStart=".concat(validateAndReturnDate(filters.unpinStart), "&"); + } -exports.createBitswap = createBitswap; + if (filters.unpinEnd) { + filterQuery = filterQuery + "unpinEnd=".concat(validateAndReturnDate(filters.unpinEnd), "&"); + } + if (filters.pinSizeMin) { + if (isNaN(filters.pinSizeMin) || filters.pinSizeMin < 0) { + throw new Error('Please make sure the pinSizeMin is a valid positive integer'); + } -/***/ }), + filterQuery = filterQuery + "pinSizeMin=".concat(filters.pinSizeMin, "&"); + } -/***/ 70104: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (filters.pinSizeMax) { + if (isNaN(filters.pinSizeMax) || filters.pinSizeMax < 0) { + throw new Error('Please make sure the pinSizeMax is a valid positive integer'); + } -"use strict"; + filterQuery = filterQuery + "pinSizeMax=".concat(filters.pinSizeMax, "&"); + } + if (filters.status) { + if (filters.status !== 'all' && filters.status !== 'pinned' && filters.status !== 'unpinned') { + throw new Error('status value must be either: all, pinned, or unpinned'); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + filterQuery = filterQuery + "status=".concat(filters.status, "&"); + } -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); + if (filters.pageLimit) { + if (isNaN(filters.pageLimit) || filters.pageLimit <= 0 || filters.pageLimit > 1000) { + throw new Error('Please make sure the pageLimit is a valid integer between 1-1000'); + } -const createStat = configure.configure(api => { - async function stat(options = {}) { - const res = await api.post('bitswap/stat', { - searchParams: toUrlSearchParams.toUrlSearchParams(options), - signal: options.signal, - headers: options.headers - }); - return toCoreInterface(await res.json()); - } - return stat; -}); -function toCoreInterface(res) { - return { - provideBufLen: res.ProvideBufLen, - wantlist: (res.Wantlist || []).map(k => cid.CID.parse(k['/'])), - peers: res.Peers || [], - blocksReceived: BigInt(res.BlocksReceived), - dataReceived: BigInt(res.DataReceived), - blocksSent: BigInt(res.BlocksSent), - dataSent: BigInt(res.DataSent), - dupBlksReceived: BigInt(res.DupBlksReceived), - dupDataReceived: BigInt(res.DupDataReceived) - }; -} + filterQuery = filterQuery + "pageLimit=".concat(parseInt(filters.pageLimit), "&"); // we want to make sure that decimals get rounded to integers + } -exports.createStat = createStat; + if (filters.pageOffset) { + if (isNaN(filters.pageOffset) || filters.pageOffset <= 0) { + throw new Error('Please make sure the pageOffset is a positive integer'); + } + filterQuery = filterQuery + "pageOffset=".concat(parseInt(filters.pageOffset), "&"); // we want to make sure that decimals get rounded to integers + } -/***/ }), + if (filters.metadata) { + if (_typeof(filters.metadata) !== 'object') { + throw new Error('metadata value must be an object'); + } -/***/ 12388: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (filters.metadata.name) { + metadataQuery = "metadata[name]=".concat(filters.metadata.name, "&"); + } -"use strict"; + if (filters.metadata.keyvalues) { + metadataQuery = metadataQuery + 'metadata[keyvalues]='; + if (_typeof(filters.metadata.keyvalues) !== 'object') { + throw new Error('metadata keyvalues must be an object'); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + var prunedKeyValues = {}; // we want to make sure we're only grabbing the values we want for the query, and nothing extra -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); + Object.entries(filters.metadata.keyvalues).forEach(function (keyValue) { + var key = keyValue[0]; + var value = keyValue[1]; -const createUnwant = configure.configure(api => { - async function unwant(cid, options = {}) { - const res = await api.post('bitswap/unwant', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: cid.toString(), - ...options - }), - headers: options.headers - }); - return res.json(); - } - return unwant; -}); + if (_typeof(value) !== 'object') { + throw new Error("keyValue: ".concat(key, " is not an object")); + } -exports.createUnwant = createUnwant; + if (!value || !value.value || !value.op) { + throw new Error("keyValue: ".concat(key, " must have both value and op attributes")); + } + if (typeof value.value !== 'string' && typeof value.value !== 'boolean' && typeof value.value !== 'number') { + throw new Error('Metadata keyvalue values must be strings, booleans, or numbers'); + } // Run checks to make sure all of the keyvalues are valid -/***/ }), -/***/ 34861: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + switch (value.op) { + case 'gt': + prunedKeyValues[key] = { + value: value.value, + op: value.op + }; + break; + //greater than or equal -"use strict"; + case 'gte': + prunedKeyValues[key] = { + value: value.value, + op: value.op + }; + break; + // less than + case 'lt': + prunedKeyValues[key] = { + value: value.value, + op: value.op + }; + break; + // less than or equal -Object.defineProperty(exports, "__esModule", ({ value: true })); + case 'lte': + prunedKeyValues[key] = { + value: value.value, + op: value.op + }; + break; + // not equal to -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); + case 'ne': + prunedKeyValues[key] = { + value: value.value, + op: value.op + }; + break; + // equal to -const createWantlistForPeer = configure.configure(api => { - async function wantlistForPeer(peerId, options = {}) { - const res = await (await api.post('bitswap/wantlist', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - ...options, - peer: peerId.toString() - }), - headers: options.headers - })).json(); - return (res.Keys || []).map(k => cid.CID.parse(k['/'])); - } - return wantlistForPeer; -}); + case 'eq': + prunedKeyValues[key] = { + value: value.value, + op: value.op + }; + break; + // between -exports.createWantlistForPeer = createWantlistForPeer; + case 'between': + if (!value.secondValue) { + throw new Error("Because between op code was passed in, keyValue: ".concat(keyValue[0], " must have both also include a secondValue")); + } + if (typeof value.secondValue !== 'string' && typeof value.secondValue !== 'boolean' && typeof value.secondValue !== 'number') { + throw new Error('Metadata keyvalue secondValue must be a string, boolean, or number'); + } -/***/ }), + prunedKeyValues[key] = { + value: value.value, + op: value.op, + secondValue: value.secondValue + }; + break; + // not between -/***/ 81812: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + case 'notBetween': + if (!value.secondValue) { + throw new Error("Because notBetween op code was passed in, keyValue: ".concat(keyValue[0], " must have both also include a secondValue")); + } -"use strict"; + if (typeof value.secondValue !== 'string' && typeof value.secondValue !== 'boolean' && typeof value.secondValue !== 'number') { + throw new Error('Metadata keyvalue secondValue must be a string, boolean, or number'); + } + + prunedKeyValues[key] = { + value: value.value, + op: value.op, + secondValue: value.secondValue + }; + break; + // like + case 'like': + prunedKeyValues[key] = { + value: value.value, + op: value.op + }; + break; + // not like -Object.defineProperty(exports, "__esModule", ({ value: true })); + case 'notLike': + prunedKeyValues[key] = { + value: value.value, + op: value.op + }; + break; + // case insensitive like -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); + case 'iLike': + prunedKeyValues[key] = { + value: value.value, + op: value.op + }; + break; + // case insensitive not like -const createWantlist = configure.configure(api => { - async function wantlist(options = {}) { - const res = await (await api.post('bitswap/wantlist', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - })).json(); - return (res.Keys || []).map(k => cid.CID.parse(k['/'])); + case 'notILike': + prunedKeyValues[key] = { + value: value.value, + op: value.op + }; + break; + // regex + + case 'regexp': + prunedKeyValues[key] = { + value: value.value, + op: value.op + }; + break; + // case insensitive regex + + case 'iRegexp': + prunedKeyValues[key] = { + value: value.value, + op: value.op + }; + break; + + default: + throw new Error("keyValue op: ".concat(value.op, " is not a valid op code")); + } + }); + metadataQuery = metadataQuery + "".concat(JSON.stringify(prunedKeyValues)); + } + } } - return wantlist; -}); -exports.createWantlist = createWantlist; + return "".concat(baseUrl).concat(filterQuery).concat(metadataQuery); +} +module.exports = exports.default; /***/ }), -/***/ 22845: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./src/commands/data/testAuthentication.js": +/*!*************************************************!*\ + !*** ./src/commands/data/testAuthentication.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_991576__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createGet = configure.configure(api => { - async function get(cid, options = {}) { - const res = await api.post('block/get', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: cid.toString(), - ...options - }), - headers: options.headers - }); - return new Uint8Array(await res.arrayBuffer()); - } - return get; +Object.defineProperty(exports, "__esModule", { + value: true }); +exports["default"] = testAuthentication; -exports.createGet = createGet; - +var _axios = _interopRequireDefault(__nested_webpack_require_991576__(/*! axios */ "./node_modules/axios/index.js")); -/***/ }), +var _constants = __nested_webpack_require_991576__(/*! ./../../constants */ "./src/constants.js"); -/***/ 54826: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +var _validators = __nested_webpack_require_991576__(/*! ../../util/validators */ "./src/util/validators.js"); -"use strict"; +var _errorResponse = __nested_webpack_require_991576__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -Object.defineProperty(exports, "__esModule", ({ value: true })); +/** + * Test Authentication + * @param {string} pinataApiKey + * @param {string} pinataSecretApiKey + * @returns {Promise} + */ +function testAuthentication(pinataApiKey, pinataSecretApiKey) { + (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); // test authentication to make sure that the user's provided keys are legit -var get = __nccwpck_require__(22845); -var put = __nccwpck_require__(64124); -var rm = __nccwpck_require__(16250); -var stat = __nccwpck_require__(86947); + var endpoint = "".concat(_constants.baseUrl, "/data/testAuthentication"); + return new Promise(function (resolve, reject) { + _axios["default"].get(endpoint, { + withCredentials: true, + headers: { + 'pinata_api_key': pinataApiKey, + 'pinata_secret_api_key': pinataSecretApiKey + } + }).then(function (result) { + if (result.status !== 200) { + reject(new Error("unknown server response while authenticating: ".concat(result))); + } -function createBlock(config) { - return { - get: get.createGet(config), - put: put.createPut(config), - rm: rm.createRm(config), - stat: stat.createStat(config) - }; + resolve({ + authenticated: true + }); + })["catch"](function (error) { + var formattedError = (0, _errorResponse.handleError)(error); + reject(formattedError); + }); + }); } -exports.createBlock = createBlock; - +; +module.exports = exports.default; /***/ }), -/***/ 64124: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./src/commands/data/userPinnedDataTotal.js": +/*!**************************************************!*\ + !*** ./src/commands/data/userPinnedDataTotal.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_993572__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = userPinnedDataTotal; -var cid = __nccwpck_require__(24247); -var multipartRequest = __nccwpck_require__(87527); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var abortSignal = __nccwpck_require__(14594); -var nativeAbortController = __nccwpck_require__(43586); - -const createPut = configure.configure(api => { - async function put(data, options = {}) { - const controller = new nativeAbortController.AbortController(); - const signal = abortSignal.abortSignal(controller.signal, options.signal); - let res; - try { - const response = await api.post('block/put', { - signal: signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - ...await multipartRequest.multipartRequest([data], controller, options.headers) - }); - res = await response.json(); - } catch (err) { - if (options.format === 'dag-pb') { - return put(data, { - ...options, - format: 'protobuf' - }); - } else if (options.format === 'dag-cbor') { - return put(data, { - ...options, - format: 'cbor' - }); +var _axios = _interopRequireDefault(__nested_webpack_require_993572__(/*! axios */ "./node_modules/axios/index.js")); + +var _constants = __nested_webpack_require_993572__(/*! ./../../constants */ "./src/constants.js"); + +var _validators = __nested_webpack_require_993572__(/*! ../../util/validators */ "./src/util/validators.js"); + +var _errorResponse = __nested_webpack_require_993572__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +/** + * User Pinned Data Total + * @param {string} pinataApiKey + * @param {string} pinataSecretApiKey + * @returns {Promise} + */ +function userPinnedDataTotal(pinataApiKey, pinataSecretApiKey) { + (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); + var endpoint = "".concat(_constants.baseUrl, "/data/userPinnedDataTotal"); + return new Promise(function (resolve, reject) { + _axios["default"].get(endpoint, { + withCredentials: true, + headers: { + 'pinata_api_key': pinataApiKey, + 'pinata_secret_api_key': pinataSecretApiKey + } + }).then(function (result) { + if (result.status !== 200) { + reject(new Error("unknown server response while attempting to retrieve pinned data total: ".concat(result))); } - throw err; - } - return cid.CID.parse(res.Key); - } - return put; -}); -exports.createPut = createPut; + resolve(result.data); + })["catch"](function (error) { + var formattedError = (0, _errorResponse.handleError)(error); + reject(formattedError); + }); + }); +} +module.exports = exports.default; /***/ }), -/***/ 16250: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./src/commands/pinning/hashMetadata.js": +/*!**********************************************!*\ + !*** ./src/commands/pinning/hashMetadata.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_995478__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = hashMetadata; -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); +var _axios = _interopRequireDefault(__nested_webpack_require_995478__(/*! axios */ "./node_modules/axios/index.js")); -const createRm = configure.configure(api => { - async function* rm(cid, options = {}) { - if (!Array.isArray(cid)) { - cid = [cid]; - } - const res = await api.post('block/rm', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: cid.map(cid => cid.toString()), - 'stream-channels': true, - ...options - }), - headers: options.headers - }); - for await (const removed of res.ndjson()) { - yield toCoreInterface(removed); - } - } - return rm; -}); -function toCoreInterface(removed) { - const out = { cid: cid.CID.parse(removed.Hash) }; - if (removed.Error) { - out.error = new Error(removed.Error); - } - return out; -} +var _constants = __nested_webpack_require_995478__(/*! ./../../constants */ "./src/constants.js"); -exports.createRm = createRm; +var _validators = __nested_webpack_require_995478__(/*! ../../util/validators */ "./src/util/validators.js"); +var _isIpfs = _interopRequireDefault(__nested_webpack_require_995478__(/*! is-ipfs */ "./node_modules/is-ipfs/src/index.js")); -/***/ }), +var _errorResponse = __nested_webpack_require_995478__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); -/***/ 86947: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -"use strict"; +/** + * Hash Meta Data + * @param {string} pinataApiKey + * @param {string} pinataSecretApiKey + * @param {*} ipfsPinHash + * @param {*} metadata + * @returns {Promise} + */ +function hashMetadata(pinataApiKey, pinataSecretApiKey, ipfsPinHash, metadata) { + (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); + if (!ipfsPinHash) { + throw new Error('ipfsPinHash value is required for changing the pin policy of a pin'); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + if (!_isIpfs["default"].cid(ipfsPinHash)) { + throw new Error('ipfsPinHash value is an invalid IPFS CID'); + } -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); + if (!metadata) { + throw new Error('no metadata object provided'); + } -const createStat = configure.configure(api => { - async function stat(cid$1, options = {}) { - const res = await api.post('block/stat', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: cid$1.toString(), - ...options - }), - headers: options.headers - }); - const data = await res.json(); - return { - cid: cid.CID.parse(data.Key), - size: data.Size - }; + (0, _validators.validateMetadata)(metadata); + var endpoint = "".concat(_constants.baseUrl, "/pinning/hashMetadata"); + var body = { + ipfsPinHash: ipfsPinHash + }; + + if (metadata.name) { + body.name = metadata.name; } - return stat; -}); -exports.createStat = createStat; + if (metadata.keyvalues) { + body.keyvalues = metadata.keyvalues; + } + return new Promise(function (resolve, reject) { + _axios["default"].put(endpoint, body, { + withCredentials: true, + headers: { + 'pinata_api_key': pinataApiKey, + 'pinata_secret_api_key': pinataSecretApiKey + } + }).then(function (result) { + if (result.status !== 200) { + reject(new Error("unknown server response while changing metadata for hash: ".concat(result))); + } -/***/ }), + resolve(result.data); + })["catch"](function (error) { + var formattedError = (0, _errorResponse.handleError)(error); + reject(formattedError); + }); + }); +} -/***/ 24438: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +module.exports = exports.default; -"use strict"; +/***/ }), +/***/ "./src/commands/pinning/hashPinPolicy.js": +/*!***********************************************!*\ + !*** ./src/commands/pinning/hashPinPolicy.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_998081__) { -Object.defineProperty(exports, "__esModule", ({ value: true })); +"use strict"; -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var multiaddr = __nccwpck_require__(78025); -const createAdd = configure.configure(api => { - async function add(addr, options = {}) { - const res = await api.post('bootstrap/add', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: addr, - ...options - }), - headers: options.headers - }); - const {Peers} = await res.json(); - return { Peers: Peers.map(ma => new multiaddr.Multiaddr(ma)) }; - } - return add; +Object.defineProperty(exports, "__esModule", { + value: true }); +exports["default"] = hashPinPolicy; -exports.createAdd = createAdd; +var _axios = _interopRequireDefault(__nested_webpack_require_998081__(/*! axios */ "./node_modules/axios/index.js")); +var _constants = __nested_webpack_require_998081__(/*! ./../../constants */ "./src/constants.js"); -/***/ }), +var _validators = __nested_webpack_require_998081__(/*! ../../util/validators */ "./src/util/validators.js"); -/***/ 99450: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +var _isIpfs = _interopRequireDefault(__nested_webpack_require_998081__(/*! is-ipfs */ "./node_modules/is-ipfs/src/index.js")); -"use strict"; +var _errorResponse = __nested_webpack_require_998081__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -Object.defineProperty(exports, "__esModule", ({ value: true })); +/** + * Hash Pin Policy + * @param {string} pinataApiKey + * @param {string} pinataSecretApiKey + * @param {*} ipfsPinHash + * @param {*} newPinPolicy + * @returns {Promise} + */ +function hashPinPolicy(pinataApiKey, pinataSecretApiKey, ipfsPinHash, newPinPolicy) { + (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); + (0, _validators.validatePinPolicyStructure)(newPinPolicy); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var multiaddr = __nccwpck_require__(78025); + if (!ipfsPinHash) { + throw new Error('ipfsPinHash value is required for changing the pin policy of a pin'); + } -const createClear = configure.configure(api => { - async function clear(options = {}) { - const res = await api.post('bootstrap/rm', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - ...options, - all: true - }), - headers: options.headers - }); - const {Peers} = await res.json(); - return { Peers: Peers.map(ma => new multiaddr.Multiaddr(ma)) }; + if (!_isIpfs["default"].cid(ipfsPinHash)) { + throw new Error('ipfsPinHash value is an invalid IPFS CID'); } - return clear; -}); -exports.createClear = createClear; + if (!newPinPolicy) { + throw new Error('newPinPolicy is required for changing the pin policy of a pin'); + } + + var endpoint = "".concat(_constants.baseUrl, "/pinning/hashPinPolicy"); + var body = { + ipfsPinHash: ipfsPinHash, + newPinPolicy: newPinPolicy + }; + return new Promise(function (resolve, reject) { + _axios["default"].put(endpoint, body, { + withCredentials: true, + headers: { + 'pinata_api_key': pinataApiKey, + 'pinata_secret_api_key': pinataSecretApiKey + } + }).then(function (result) { + if (result.status !== 200) { + reject(new Error("unknown server response while changing pin policy for hash: ".concat(result))); + } + + resolve(result.data); + })["catch"](function (error) { + var formattedError = (0, _errorResponse.handleError)(error); + reject(formattedError); + }); + }); +} +module.exports = exports.default; /***/ }), -/***/ 37723: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./src/commands/pinning/pinByHash.js": +/*!*******************************************!*\ + !*** ./src/commands/pinning/pinByHash.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_1000632__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = pinByHash; -var add = __nccwpck_require__(24438); -var clear = __nccwpck_require__(99450); -var list = __nccwpck_require__(77448); -var reset = __nccwpck_require__(3542); -var rm = __nccwpck_require__(36783); +var _axios = _interopRequireDefault(__nested_webpack_require_1000632__(/*! axios */ "./node_modules/axios/index.js")); -function createBootstrap(config) { - return { - add: add.createAdd(config), - clear: clear.createClear(config), - list: list.createList(config), - reset: reset.createReset(config), - rm: rm.createRm(config) - }; -} +var _constants = __nested_webpack_require_1000632__(/*! ./../../constants */ "./src/constants.js"); + +var _validators = __nested_webpack_require_1000632__(/*! ../../util/validators */ "./src/util/validators.js"); -exports.createBootstrap = createBootstrap; +var _isIpfs = _interopRequireDefault(__nested_webpack_require_1000632__(/*! is-ipfs */ "./node_modules/is-ipfs/src/index.js")); +var _errorResponse = __nested_webpack_require_1000632__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); -/***/ }), +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +/** + * Pin By Hash + * @param {string} pinataApiKey + * @param {string} pinataSecretApiKey + * @param {*} hashToPin + * @param {*} options + * @returns {Promise} + */ +function pinByHash(pinataApiKey, pinataSecretApiKey, hashToPin, options) { + (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); + + if (!hashToPin) { + throw new Error('hashToPin value is required for pinning by hash'); + } -/***/ 77448: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (!_isIpfs["default"].cid(hashToPin)) { + throw new Error('hashToPin value is an invalid IPFS CID'); + } -"use strict"; + var endpoint = "".concat(_constants.baseUrl, "/pinning/pinByHash"); + var body = { + hashToPin: hashToPin, + pinataOptions: {} + }; + if (options) { + if (options.pinataOptions) { + body.pinataOptions = options.pinataOptions; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + if (options.pinataMetadata) { + (0, _validators.validateMetadata)(options.pinataMetadata); + body.pinataMetadata = options.pinataMetadata; + } + } -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var multiaddr = __nccwpck_require__(78025); + return new Promise(function (resolve, reject) { + _axios["default"].post(endpoint, body, { + withCredentials: true, + headers: { + 'pinata_api_key': pinataApiKey, + 'pinata_secret_api_key': pinataSecretApiKey + } + }).then(function (result) { + if (result.status !== 200) { + reject(new Error("unknown server response while adding to pin queue: ".concat(result))); + } -const createList = configure.configure(api => { - async function list(options = {}) { - const res = await api.post('bootstrap/list', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers + resolve(result.data); + })["catch"](function (error) { + var formattedError = (0, _errorResponse.handleError)(error); + reject(formattedError); }); - const {Peers} = await res.json(); - return { Peers: Peers.map(ma => new multiaddr.Multiaddr(ma)) }; - } - return list; -}); - -exports.createList = createList; + }); +} +module.exports = exports.default; /***/ }), -/***/ 3542: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./src/commands/pinning/pinFileToIPFS.js": +/*!***********************************************!*\ + !*** ./src/commands/pinning/pinFileToIPFS.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_1003218__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var multiaddr = __nccwpck_require__(78025); - -const createReset = configure.configure(api => { - async function reset(options = {}) { - const res = await api.post('bootstrap/add', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - ...options, - default: true - }), - headers: options.headers - }); - const {Peers} = await res.json(); - return { Peers: Peers.map(ma => new multiaddr.Multiaddr(ma)) }; - } - return reset; +Object.defineProperty(exports, "__esModule", { + value: true }); +exports["default"] = pinFileToIPFS; -exports.createReset = createReset; - - -/***/ }), - -/***/ 36783: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - +var _axios = _interopRequireDefault(__nested_webpack_require_1003218__(/*! axios */ "./node_modules/axios/index.js")); -Object.defineProperty(exports, "__esModule", ({ value: true })); +var _constants = __nested_webpack_require_1003218__(/*! ./../../constants */ "./src/constants.js"); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var multiaddr = __nccwpck_require__(78025); +var _formData = _interopRequireDefault(__nested_webpack_require_1003218__(/*! form-data */ "./node_modules/form-data/lib/form_data.js")); -const createRm = configure.configure(api => { - async function rm(addr, options = {}) { - const res = await api.post('bootstrap/rm', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: addr, - ...options - }), - headers: options.headers - }); - const {Peers} = await res.json(); - return { Peers: Peers.map(ma => new multiaddr.Multiaddr(ma)) }; - } - return rm; -}); +var _stream = _interopRequireDefault(__nested_webpack_require_1003218__(/*! stream */ "stream")); -exports.createRm = createRm; +var _validators = __nested_webpack_require_1003218__(/*! ../../util/validators */ "./src/util/validators.js"); +var _errorResponse = __nested_webpack_require_1003218__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); -/***/ }), +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -/***/ 84000: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/** + * Pin File to IPFS + * @param {string} pinataApiKey + * @param {string} pinataSecretApiKey + * @param {*} readStream + * @param {*} options + * @returns {Promise} + */ +function pinFileToIPFS(pinataApiKey, pinataSecretApiKey, readStream, options) { + (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); + return new Promise(function (resolve, reject) { + var data = new _formData["default"](); + data.append('file', readStream); + var endpoint = "".concat(_constants.baseUrl, "/pinning/pinFileToIPFS"); -"use strict"; + if (!(readStream instanceof _stream["default"].Readable)) { + reject(new Error('readStream is not a readable stream')); + } + if (options) { + if (options.pinataMetadata) { + (0, _validators.validateMetadata)(options.pinataMetadata); + data.append('pinataMetadata', JSON.stringify(options.pinataMetadata)); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + if (options.pinataOptions) { + (0, _validators.validatePinataOptions)(options.pinataOptions); + data.append('pinataOptions', JSON.stringify(options.pinataOptions)); + } + } -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); + _axios["default"].post(endpoint, data, { + withCredentials: true, + maxContentLength: 'Infinity', + //this is needed to prevent axios from erroring out with large files + maxBodyLength: 'Infinity', + headers: { + 'Content-type': "multipart/form-data; boundary= ".concat(data._boundary), + 'pinata_api_key': pinataApiKey, + 'pinata_secret_api_key': pinataSecretApiKey + } + }).then(function (result) { + if (result.status !== 200) { + reject(new Error("unknown server response while pinning File to IPFS: ".concat(result))); + } -const createCat = configure.configure(api => { - async function* cat(path, options = {}) { - const res = await api.post('cat', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: path.toString(), - ...options - }), - headers: options.headers + resolve(result.data); + })["catch"](function (error) { + var formattedError = (0, _errorResponse.handleError)(error); + reject(formattedError); }); - yield* res.iterator(); - } - return cat; -}); - -exports.createCat = createCat; + }); +} +module.exports = exports.default; /***/ }), -/***/ 27154: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./src/commands/pinning/pinFromFS.js": +/*!*******************************************!*\ + !*** ./src/commands/pinning/pinFromFS.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_1006206__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = pinFromFS; -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); +var _axios = _interopRequireDefault(__nested_webpack_require_1006206__(/*! axios */ "./node_modules/axios/index.js")); -const createCommands = configure.configure(api => { - const commands = async (options = {}) => { - const res = await api.post('commands', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - }); - return res.json(); - }; - return commands; -}); +var _constants = __nested_webpack_require_1006206__(/*! ./../../constants */ "./src/constants.js"); -exports.createCommands = createCommands; +var _formData = _interopRequireDefault(__nested_webpack_require_1006206__(/*! form-data */ "./node_modules/form-data/lib/form_data.js")); +var _validators = __nested_webpack_require_1006206__(/*! ../../util/validators */ "./src/util/validators.js"); -/***/ }), +var _basePathConverter = _interopRequireDefault(__nested_webpack_require_1006206__(/*! base-path-converter */ "./node_modules/base-path-converter/index.js")); -/***/ 90372: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +var _errorResponse = __nested_webpack_require_1006206__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); -"use strict"; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +var fs = __nested_webpack_require_1006206__(/*! fs */ "fs"); -Object.defineProperty(exports, "__esModule", ({ value: true })); +var recursive = __nested_webpack_require_1006206__(/*! recursive-fs */ "./node_modules/recursive-fs/index.js"); +/** + * PinFromFS + * @param {string} pinataApiKey + * @param {string} pinataSecretApiKey + * @param {string} sourcePath + * @param {*} options + * @returns {Promise} + */ -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -const createGetAll = configure.configure(api => { - const getAll = async (options = {}) => { - const res = await api.post('config/show', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ ...options }), - headers: options.headers - }); - const data = await res.json(); - return data; - }; - return getAll; -}); +function pinFromFS(pinataApiKey, pinataSecretApiKey, sourcePath, options) { + (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); + return new Promise(function (resolve, reject) { + var endpoint = "".concat(_constants.baseUrl, "/pinning/pinFileToIPFS"); + fs.stat(sourcePath, function (err, stats) { + if (err) { + reject(err); + } -exports.createGetAll = createGetAll; + if (stats.isFile()) { + //we need to create a single read stream instead of reading the directory recursively + var data = new _formData["default"](); + data.append('file', fs.createReadStream(sourcePath)); + if (options) { + if (options.pinataMetadata) { + (0, _validators.validateMetadata)(options.pinataMetadata); + data.append('pinataMetadata', JSON.stringify(options.pinataMetadata)); + } -/***/ }), + if (options.pinataOptions) { + (0, _validators.validatePinataOptions)(options.pinataOptions); + data.append('pinataOptions', JSON.stringify(options.pinataOptions)); + } + } -/***/ 45965: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + _axios["default"].post(endpoint, data, { + withCredentials: true, + maxContentLength: 'Infinity', + //this is needed to prevent axios from erroring out with large directories + maxBodyLength: 'Infinity', + headers: { + 'Content-type': "multipart/form-data; boundary= ".concat(data._boundary), + 'pinata_api_key': pinataApiKey, + 'pinata_secret_api_key': pinataSecretApiKey + } + }).then(function (result) { + if (result.status !== 200) { + reject(new Error("unknown server response while pinning File to IPFS: ".concat(result))); + } -"use strict"; + resolve(result.data); + })["catch"](function (error) { + var formattedError = (0, _errorResponse.handleError)(error); + reject(formattedError); + }); + } else { + recursive.readdirr(sourcePath, function (err, dirs, files) { + if (err) { + reject(new Error(err)); + } + var data = new _formData["default"](); + files.forEach(function (file) { + //for each file stream, we need to include the correct relative file path + data.append('file', fs.createReadStream(file), { + filepath: (0, _basePathConverter["default"])(sourcePath, file) + }); + }); -Object.defineProperty(exports, "__esModule", ({ value: true })); + if (options) { + if (options.pinataMetadata) { + (0, _validators.validateMetadata)(options.pinataMetadata); + data.append('pinataMetadata', JSON.stringify(options.pinataMetadata)); + } -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); + if (options.pinataOptions) { + (0, _validators.validatePinataOptions)(options.pinataOptions); + data.append('pinataOptions', JSON.stringify(options.pinataOptions)); + } + } -const createGet = configure.configure(api => { - const get = async (key, options = {}) => { - if (!key) { - throw new Error('key argument is required'); - } - const res = await api.post('config', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: key, - ...options - }), - headers: options.headers - }); - const data = await res.json(); - return data.Value; - }; - return get; -}); + _axios["default"].post(endpoint, data, { + withCredentials: true, + maxContentLength: 'Infinity', + maxBodyLength: 'Infinity', + //this is needed to prevent axios from erroring out with large directories + headers: { + 'Content-type': "multipart/form-data; boundary= ".concat(data._boundary), + 'pinata_api_key': pinataApiKey, + 'pinata_secret_api_key': pinataSecretApiKey + } + }).then(function (result) { + if (result.status !== 200) { + reject(new Error("unknown server response while pinning File to IPFS: ".concat(result))); + } -exports.createGet = createGet; + resolve(result.data); + })["catch"](function (error) { + var formattedError = (0, _errorResponse.handleError)(error); + reject(formattedError); + }); + }); + } + }); + }); +} +module.exports = exports.default; /***/ }), -/***/ 95499: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./src/commands/pinning/pinJSONToIPFS.js": +/*!***********************************************!*\ + !*** ./src/commands/pinning/pinJSONToIPFS.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_1011515__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = pinJSONToIPFS; -var index = __nccwpck_require__(99566); -var get = __nccwpck_require__(45965); -var getAll = __nccwpck_require__(90372); -var replace = __nccwpck_require__(29380); -var set = __nccwpck_require__(78974); +var _axios = _interopRequireDefault(__nested_webpack_require_1011515__(/*! axios */ "./node_modules/axios/index.js")); -function createConfig(config) { - return { - getAll: getAll.createGetAll(config), - get: get.createGet(config), - set: set.createSet(config), - replace: replace.createReplace(config), - profiles: index.createProfiles(config) - }; -} +var _constants = __nested_webpack_require_1011515__(/*! ./../../constants */ "./src/constants.js"); -exports.createConfig = createConfig; +var _validators = __nested_webpack_require_1011515__(/*! ../../util/validators */ "./src/util/validators.js"); +var _errorResponse = __nested_webpack_require_1011515__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); -/***/ }), +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -/***/ 93937: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } -"use strict"; +/** + * Pin JSON to IPFS + * @param {string} pinataApiKey + * @param {string} pinataSecretApiKey + * @param {*} body + * @param {*} options + * @returns {Promise} + */ +function pinJSONToIPFS(pinataApiKey, pinataSecretApiKey, body, options) { + (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); + var requestBody = body; + if (_typeof(body) !== 'object') { + throw new Error('body must be a valid JSON object'); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + if (options) { + requestBody = { + pinataContent: body + }; -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); + if (options.pinataMetadata) { + (0, _validators.validateMetadata)(options.pinataMetadata); + requestBody.pinataMetadata = options.pinataMetadata; + } -const createApply = configure.configure(api => { - async function apply(profile, options = {}) { - const res = await api.post('config/profile/apply', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: profile, - ...options - }), - headers: options.headers - }); - const data = await res.json(); - return { - original: data.OldCfg, - updated: data.NewCfg - }; + if (options.pinataOptions) { + (0, _validators.validatePinataOptions)(options.pinataOptions); + requestBody.pinataOptions = options.pinataOptions; + } } - return apply; -}); -exports.createApply = createApply; + var endpoint = "".concat(_constants.baseUrl, "/pinning/pinJSONToIPFS"); + return new Promise(function (resolve, reject) { + _axios["default"].post(endpoint, requestBody, { + withCredentials: true, + headers: { + 'pinata_api_key': pinataApiKey, + 'pinata_secret_api_key': pinataSecretApiKey + } + }).then(function (result) { + if (result.status !== 200) { + reject(new Error("unknown server response while pinning JSON to IPFS: ".concat(result))); + } + + resolve(result.data); + })["catch"](function (error) { + var formattedError = (0, _errorResponse.handleError)(error); + reject(formattedError); + }); + }); +} +module.exports = exports.default; /***/ }), -/***/ 99566: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./src/commands/pinning/pinJobs/pinJobs.js": +/*!*************************************************!*\ + !*** ./src/commands/pinning/pinJobs/pinJobs.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_1014373__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var apply = __nccwpck_require__(93937); -var list = __nccwpck_require__(84442); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = pinJobs; -function createProfiles(config) { - return { - apply: apply.createApply(config), - list: list.createList(config) - }; -} +var _axios = _interopRequireDefault(__nested_webpack_require_1014373__(/*! axios */ "./node_modules/axios/index.js")); -exports.createProfiles = createProfiles; +var _constants = __nested_webpack_require_1014373__(/*! ./../../../constants */ "./src/constants.js"); +var _validators = __nested_webpack_require_1014373__(/*! ../../../util/validators */ "./src/util/validators.js"); -/***/ }), +var _queryBuilder = _interopRequireDefault(__nested_webpack_require_1014373__(/*! ./queryBuilder */ "./src/commands/pinning/pinJobs/queryBuilder.js")); -/***/ 84442: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +var _errorResponse = __nested_webpack_require_1014373__(/*! ../../../util/errorResponse */ "./src/util/errorResponse.js"); -"use strict"; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +/** + * Pin Jobs + * @param {string} pinataApiKey + * @param {string} pinataSecretApiKey + * @param {*} filters + * @returns {Promise} + */ +function pinJobs(pinataApiKey, pinataSecretApiKey, filters) { + (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); + var endpoint = "".concat(_constants.baseUrl, "/pinning/pinJobs"); -Object.defineProperty(exports, "__esModule", ({ value: true })); + if (filters) { + endpoint = (0, _queryBuilder["default"])(endpoint, filters); + } -var objectToCamel = __nccwpck_require__(62268); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); + return new Promise(function (resolve, reject) { + _axios["default"].get(endpoint, { + withCredentials: true, + headers: { + 'pinata_api_key': pinataApiKey, + 'pinata_secret_api_key': pinataSecretApiKey + } + }).then(function (result) { + if (result.status !== 200) { + reject(new Error("unknown server response while attempting to retrieve pin jobs: ".concat(result))); + } -const createList = configure.configure(api => { - async function list(options = {}) { - const res = await api.post('config/profile/list', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers + resolve(result.data); + })["catch"](function (error) { + var formattedError = (0, _errorResponse.handleError)(error); + reject(formattedError); }); - const data = await res.json(); - return data.map(profile => objectToCamel.objectToCamel(profile)); - } - return list; -}); - -exports.createList = createList; + }); +} +module.exports = exports.default; /***/ }), -/***/ 29380: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./src/commands/pinning/pinJobs/queryBuilder.js": +/*!******************************************************!*\ + !*** ./src/commands/pinning/pinJobs/queryBuilder.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_1016521__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = queryBuilder; -var fromString = __nccwpck_require__(39451); -var multipartRequest = __nccwpck_require__(87527); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var abortSignal = __nccwpck_require__(14594); -var nativeAbortController = __nccwpck_require__(43586); +var _isIpfs = _interopRequireDefault(__nested_webpack_require_1016521__(/*! is-ipfs */ "./node_modules/is-ipfs/src/index.js")); -const createReplace = configure.configure(api => { - const replace = async (config, options = {}) => { - const controller = new nativeAbortController.AbortController(); - const signal = abortSignal.abortSignal(controller.signal, options.signal); - const res = await api.post('config/replace', { - signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - ...await multipartRequest.multipartRequest([fromString.fromString(JSON.stringify(config))], controller, options.headers) - }); - await res.text(); - }; - return replace; -}); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -exports.createReplace = createReplace; +/** + * Query Buidler + * @param {string} baseUrl + * @param {*} filters + * @returns {*} + */ +function queryBuilder(baseUrl, filters) { + if (!baseUrl) { + throw new Error('no baseUrl provided'); + } + if (!filters) { + return baseUrl; + } -/***/ }), + var newUrl = baseUrl; + var firstFilterApplied = false; // we want to make sure that the "?" character is only applied once -/***/ 78974: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + function addFilter(newFilter) { + if (firstFilterApplied) { + newUrl = "".concat(newUrl, "&").concat(newFilter); + } else { + firstFilterApplied = true; + newUrl = "".concat(newUrl, "?").concat(newFilter); + } + } -"use strict"; + if (filters) { + // now we need to construct the actual URL based on the given filters provided + if (filters.sort) { + if (filters.sort === 'ASC' || filters.sort === 'DESC') { + addFilter("sort=".concat(filters.sort)); + } else { + throw new Error("Unknown sort value: ".concat(filters.sort, " provided")); + } + } + if (filters.status) { + if (filters.status === 'searching' || filters.status === 'expired' || filters.status === 'over_free_limit' || filters.status === 'over_max_size' || filters.status === 'invalid_object' || filters.status === 'bad_host_node') { + addFilter("status=".concat(filters.status)); + } else { + throw new Error("Unknown status value: ".concat(filters.status, " provided")); + } + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + if (filters.ipfs_pin_hash) { + if (_isIpfs["default"].cid(filters.ipfs_pin_hash)) { + addFilter("ipfs_pin_hash=".concat(filters.ipfs_pin_hash)); + } else { + throw new Error("Invalid IPFS hash: ".concat(filters.ipfs_pin_hash)); + } + } -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); + if (filters.limit) { + if (Number.isInteger(filters.limit) && filters.limit > 0 && filters.limit < 100) { + addFilter("limit=".concat(filters.limit)); + } else { + throw new Error("Invalid limit: ".concat(filters.limit, ". Valid limits are 1-100")); + } + } -const createSet = configure.configure(api => { - const set = async (key, value, options = {}) => { - if (typeof key !== 'string') { - throw new Error('Invalid key type'); + if (filters.offset) { + if (Number.isInteger(filters.offset) && filters.offset > 0) { + addFilter("offset=".concat(filters.offset)); + } else { + throw new Error("Invalid offset: ".concat(filters.offset, ". Please provide a positive integer for the offset")); + } } - const params = { - ...options, - ...encodeParam(key, value) - }; - const res = await api.post('config', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(params), - headers: options.headers - }); - await res.text(); - }; - return set; -}); -const encodeParam = (key, value) => { - switch (typeof value) { - case 'boolean': - return { - arg: [ - key, - value.toString() - ], - bool: true - }; - case 'string': - return { - arg: [ - key, - value - ] - }; - default: - return { - arg: [ - key, - JSON.stringify(value) - ], - json: true - }; } -}; -exports.createSet = createSet; + return newUrl; +} +module.exports = exports.default; /***/ }), -/***/ 36927: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./src/commands/pinning/unpin.js": +/*!***************************************!*\ + !*** ./src/commands/pinning/unpin.js ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_1019420__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createExport = configure.configure(api => { - async function* dagExport(root, options = {}) { - const res = await api.post('dag/export', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ arg: root.toString() }), - headers: options.headers - }); - yield* res.iterator(); - } - return dagExport; +Object.defineProperty(exports, "__esModule", { + value: true }); +exports["default"] = unpin; -exports.createExport = createExport; - +var _axios = _interopRequireDefault(__nested_webpack_require_1019420__(/*! axios */ "./node_modules/axios/index.js")); -/***/ }), +var _constants = __nested_webpack_require_1019420__(/*! ./../../constants */ "./src/constants.js"); -/***/ 55291: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +var _validators = __nested_webpack_require_1019420__(/*! ../../util/validators */ "./src/util/validators.js"); -"use strict"; +var _isIpfs = _interopRequireDefault(__nested_webpack_require_1019420__(/*! is-ipfs */ "./node_modules/is-ipfs/src/index.js")); +var _errorResponse = __nested_webpack_require_1019420__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); -Object.defineProperty(exports, "__esModule", ({ value: true })); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -var configure = __nccwpck_require__(31775); -var resolve = __nccwpck_require__(51788); -var first = __nccwpck_require__(84103); -var last = __nccwpck_require__(28741); -var errCode = __nccwpck_require__(5822); -var get = __nccwpck_require__(22845); +/** + * Unpin + * @param {string} pinataApiKey + * @param {string} pinataSecretApiKey + * @param {string} hashToUnpin + * @returns {Promise} + */ +function unpin(pinataApiKey, pinataSecretApiKey, hashToUnpin) { + (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + if (!hashToUnpin) { + throw new Error('hashToUnpin value is required for removing a pin from Pinata'); + } -var first__default = /*#__PURE__*/_interopDefaultLegacy(first); -var last__default = /*#__PURE__*/_interopDefaultLegacy(last); -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); + if (!_isIpfs["default"].cid(hashToUnpin)) { + throw new Error("".concat(hashToUnpin, " is an invalid IPFS CID")); + } -const createGet = (codecs, options) => { - const fn = configure.configure((api, opts) => { - const getBlock = get.createGet(opts); - const get$1 = async (cid, options = {}) => { - if (options.path) { - const entry = options.localResolve ? await first__default["default"](resolve.resolve(cid, options.path, codecs, getBlock, options)) : await last__default["default"](resolve.resolve(cid, options.path, codecs, getBlock, options)); - const result = entry; - if (!result) { - throw errCode__default["default"](new Error('Not found'), 'ERR_NOT_FOUND'); - } - return result; + var endpoint = "".concat(_constants.baseUrl, "/pinning/unpin/").concat(hashToUnpin); + return new Promise(function (resolve, reject) { + _axios["default"]["delete"](endpoint, { + withCredentials: true, + headers: { + 'pinata_api_key': pinataApiKey, + 'pinata_secret_api_key': pinataSecretApiKey + } + }).then(function (result) { + if (result.status !== 200) { + reject(new Error("unknown server response while removing pin from IPFS: ".concat(result))); } - const codec = await codecs.getCodec(cid.code); - const block = await getBlock(cid, options); - const node = codec.decode(block); - return { - value: node, - remainderPath: '' - }; - }; - return get$1; - }); - return fn(options); -}; -exports.createGet = createGet; + resolve(result.data); + })["catch"](function (error) { + var formattedError = (0, _errorResponse.handleError)(error); + reject(formattedError); + }); + }); +} +module.exports = exports.default; /***/ }), -/***/ 22135: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./src/commands/pinning/userPinPolicy.js": +/*!***********************************************!*\ + !*** ./src/commands/pinning/userPinPolicy.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_1021677__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var abortSignal = __nccwpck_require__(14594); -var multipartRequest = __nccwpck_require__(87527); -var nativeAbortController = __nccwpck_require__(43586); -var cid = __nccwpck_require__(24247); - -const createImport = configure.configure(api => { - async function* dagImport(source, options = {}) { - const controller = new nativeAbortController.AbortController(); - const signal = abortSignal.abortSignal(controller.signal, options.signal); - const {headers, body} = await multipartRequest.multipartRequest(source, controller, options.headers); - const res = await api.post('dag/import', { - signal, - headers, - body, - searchParams: toUrlSearchParams.toUrlSearchParams({ 'pin-roots': options.pinRoots }) - }); - for await (const {Root} of res.ndjson()) { - if (Root !== undefined) { - const { - Cid: {'/': Cid}, - PinErrorMsg - } = Root; - yield { - root: { - cid: cid.CID.parse(Cid), - pinErrorMsg: PinErrorMsg - } - }; - } - } - } - return dagImport; +Object.defineProperty(exports, "__esModule", { + value: true }); +exports["default"] = userPinPolicy; -exports.createImport = createImport; - +var _axios = _interopRequireDefault(__nested_webpack_require_1021677__(/*! axios */ "./node_modules/axios/index.js")); -/***/ }), +var _constants = __nested_webpack_require_1021677__(/*! ./../../constants */ "./src/constants.js"); -/***/ 71168: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +var _validators = __nested_webpack_require_1021677__(/*! ../../util/validators */ "./src/util/validators.js"); -"use strict"; +var _errorResponse = __nested_webpack_require_1021677__(/*! ../../util/errorResponse */ "./src/util/errorResponse.js"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -Object.defineProperty(exports, "__esModule", ({ value: true })); +/** + * User Pin Policy + * @param {string} pinataApiKey + * @param {string} pinataSecretApiKey + * @param {*} newPinPolicy + * @returns {Promise} + */ +function userPinPolicy(pinataApiKey, pinataSecretApiKey, newPinPolicy) { + (0, _validators.validateApiKeys)(pinataApiKey, pinataSecretApiKey); + (0, _validators.validatePinPolicyStructure)(newPinPolicy); -var _export = __nccwpck_require__(36927); -var get = __nccwpck_require__(55291); -var _import = __nccwpck_require__(22135); -var put = __nccwpck_require__(79631); -var resolve = __nccwpck_require__(11229); + if (!newPinPolicy) { + throw new Error('newPinPolicy is required for changing the pin policy of a pin'); + } -function createDag(codecs, config) { - return { - export: _export.createExport(config), - get: get.createGet(codecs, config), - import: _import.createImport(config), - put: put.createPut(codecs, config), - resolve: resolve.createResolve(config) + var endpoint = "".concat(_constants.baseUrl, "/pinning/userPinPolicy"); + var body = { + newPinPolicy: newPinPolicy }; -} + return new Promise(function (resolve, reject) { + _axios["default"].put(endpoint, body, { + withCredentials: true, + headers: { + 'pinata_api_key': pinataApiKey, + 'pinata_secret_api_key': pinataSecretApiKey + } + }).then(function (result) { + if (result.status !== 200) { + reject(new Error("unknown server response while changing pin policy for user: ".concat(result))); + } -exports.createDag = createDag; + resolve(result.data); + })["catch"](function (error) { + var formattedError = (0, _errorResponse.handleError)(error); + reject(formattedError); + }); + }); +} +module.exports = exports.default; /***/ }), -/***/ 79631: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./src/constants.js": +/*!**************************!*\ + !*** ./src/constants.js ***! + \**************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.baseUrl = void 0; +var baseUrl = 'https://api.pinata.cloud'; +exports.baseUrl = baseUrl; -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var multipartRequest = __nccwpck_require__(87527); -var toUrlSearchParams = __nccwpck_require__(52836); -var abortSignal = __nccwpck_require__(14594); -var nativeAbortController = __nccwpck_require__(43586); +/***/ }), -const createPut = (codecs, options) => { - const fn = configure.configure(api => { - const put = async (dagNode, options = {}) => { - const settings = { - storeCodec: 'dag-cbor', - hashAlg: 'sha2-256', - ...options - }; - let serialized; - if (settings.inputCodec) { - if (!(dagNode instanceof Uint8Array)) { - throw new Error('Can only inputCodec on raw bytes that can be decoded'); - } - serialized = dagNode; - } else { - const storeCodec = await codecs.getCodec(settings.storeCodec); - serialized = storeCodec.encode(dagNode); - settings.inputCodec = settings.storeCodec; - } - const controller = new nativeAbortController.AbortController(); - const signal = abortSignal.abortSignal(controller.signal, settings.signal); - const res = await api.post('dag/put', { - timeout: settings.timeout, - signal, - searchParams: toUrlSearchParams.toUrlSearchParams(settings), - ...await multipartRequest.multipartRequest([serialized], controller, settings.headers) - }); - const data = await res.json(); - return cid.CID.parse(data.Cid['/']); - }; - return put; - }); - return fn(options); -}; +/***/ "./src/index.js": +/*!**********************!*\ + !*** ./src/index.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_1024126__) { -exports.createPut = createPut; +"use strict"; -/***/ }), +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = pinataClient; -/***/ 11229: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +var _pinByHash = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/pinning/pinByHash */ "./src/commands/pinning/pinByHash.js")); -"use strict"; +var _hashMetadata = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/pinning/hashMetadata */ "./src/commands/pinning/hashMetadata.js")); +var _hashPinPolicy = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/pinning/hashPinPolicy */ "./src/commands/pinning/hashPinPolicy.js")); -Object.defineProperty(exports, "__esModule", ({ value: true })); +var _pinFileToIPFS = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/pinning/pinFileToIPFS */ "./src/commands/pinning/pinFileToIPFS.js")); -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); +var _pinFromFS = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/pinning/pinFromFS */ "./src/commands/pinning/pinFromFS.js")); -const createResolve = configure.configure(api => { - const resolve = async (ipfsPath, options = {}) => { - const res = await api.post('dag/resolve', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: `${ ipfsPath }${ options.path ? `/${ options.path }`.replace(/\/[/]+/g, '/') : '' }`, - ...options - }), - headers: options.headers - }); - const data = await res.json(); - return { - cid: cid.CID.parse(data.Cid['/']), - remainderPath: data.RemPath - }; - }; - return resolve; -}); +var _pinJSONToIPFS = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/pinning/pinJSONToIPFS */ "./src/commands/pinning/pinJSONToIPFS.js")); -exports.createResolve = createResolve; +var _pinJobs = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/pinning/pinJobs/pinJobs */ "./src/commands/pinning/pinJobs/pinJobs.js")); +var _unpin = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/pinning/unpin */ "./src/commands/pinning/unpin.js")); -/***/ }), +var _userPinPolicy = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/pinning/userPinPolicy */ "./src/commands/pinning/userPinPolicy.js")); -/***/ 71141: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +var _testAuthentication = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/data/testAuthentication */ "./src/commands/data/testAuthentication.js")); -"use strict"; +var _pinList = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/data/pinList/pinList */ "./src/commands/data/pinList/pinList.js")); +var _userPinnedDataTotal = _interopRequireDefault(__nested_webpack_require_1024126__(/*! ./commands/data/userPinnedDataTotal */ "./src/commands/data/userPinnedDataTotal.js")); -Object.defineProperty(exports, "__esModule", ({ value: true })); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var mapEvent = __nccwpck_require__(79249); +// OPTIONS -const createFindPeer = configure.configure(api => { - async function* findPeer(peerId, options = {}) { - const res = await api.post('dht/findpeer', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: peerId, - ...options - }), - headers: options.headers - }); - for await (const event of res.ndjson()) { - yield mapEvent.mapEvent(event); - } - } - return findPeer; -}); +/** + * @typedef {Record} PinataMetadata + */ -exports.createFindPeer = createFindPeer; +/** + * @typedef PinataMetadataFilter + * @property {string} [name] + * @property {Record} keyvalues + */ +/** + * @typedef {{id: string, desiredReplicationCount: number}} PinataPinPolicyItem + */ -/***/ }), +/** + * @typedef PinataPinByHashOptions + * @property {string[]} [hostNodes] + * @property {{regions: PinataPinPolicyItem[]}} [customPinPolicy] + */ -/***/ 1718: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/** + * @typedef PinataPinByHashPinOptions + * @property {PinataMetadata} [pinataMetadata] + * @property {PinataPinByHashOptions} [pinataOptions] + */ -"use strict"; +/** + * @typedef PinataOptions + * @property {0 | 1} [cidVersion] + * @property {boolean} [wrapWithDirectory] + * @property {{regions: PinataPinPolicyItem[]}} [customPinPolicy] + */ +/** + * @typedef PinataPinOptions + * @property {PinataMetadata} [pinataMetadata] + * @property {PinataOptions} [pinataOptions] + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); +/** + * @typedef PinataPinJobsFilterOptions + * @property {'ASC' | 'DESC'} sort + * @property {string} [status] + * @property {string} [ipfs_pin_hash] + * @property {number} [limit] + * @property {number} [offset] + */ -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var mapEvent = __nccwpck_require__(79249); +/** + * @typedef PinataPinListFilterOptions + * @property {string} [hashContains] + * @property {string} [pinStart] + * @property {string} [pinEnd] + * @property {string} [unpinStart] + * @property {string} [unpinEnd] + * @property {number} [pinSizeMin] + * @property {number} [pinSizeMax] + * @property {string} [status] + * @property {number} [pageLimit] + * @property {number} [pageOffset] + * @property {PinataMetadataFilter} [metadata] + */ +// RESPONSES -const createFindProvs = configure.configure(api => { - async function* findProvs(cid, options = {}) { - const res = await api.post('dht/findprovs', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: cid.toString(), - ...options - }), - headers: options.headers - }); - for await (const event of res.ndjson()) { - yield mapEvent.mapEvent(event); - } - } - return findProvs; -}); +/** + * @typedef PinataPinByHashResponse + * @property {number | string} id + * @property {string} ipfsHash + * @property {string} status + * @property {string} name + */ -exports.createFindProvs = createFindProvs; +/** + * @typedef PinataPinResponse + * @property {string} IpfsHash + * @property {number} PinSize + * @property {string} Timestamp + */ +/** + * @typedef PinataPinJobsResponseRow + * @property {number | string} id + * @property {string} ipfs_pin_hash + * @property {string} date_queued + * @property {string | undefined | null} name + * @property {string} status + */ -/***/ }), +/** + * @typedef PinataPinJobsResponse + * @property {number} count + * @property {PinataPinJobsResponseRow[]} rows + */ -/***/ 83019: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/** + * @typedef PinataPinListResponseRow + * @property {number | string} id + * @property {string} ipfs_pin_hash + * @property {number} size + * @property {string | number} user_id + * @property {string} date_pinned + * @property {string} date_unpinned + * @property {PinataMetadata} metadata + */ -"use strict"; +/** + * @typedef PinataPinListResponse + * @property {number} count + * @property {PinataPinListResponseRow[]} rows + */ +// METHODS +/** + * Hash meta data + * @callback hashMetadata + * @param {string} ipfsPinHash + * @param {PinataMetadata} metadata + * @returns {Promise} + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); +/** + * Hash pin policy + * @callback hashPinPolicy + * @param {string} ipfsPinHash + * @param {{regions: PinataPinPolicyItem[]}} newPinPolicy + * @returns {Promise} + */ -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var mapEvent = __nccwpck_require__(79249); -var toString = __nccwpck_require__(2771); +/** + * Pin by hash + * @callback pinByHash + * @param {string} hashToPin + * @param {PinataPinByHashPinOptions} [options] + * @returns {Promise} + */ -const createGet = configure.configure(api => { - async function* get(key, options = {}) { - const res = await api.post('dht/get', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: key instanceof Uint8Array ? toString.toString(key) : key.toString(), - ...options - }), - headers: options.headers - }); - for await (const event of res.ndjson()) { - yield mapEvent.mapEvent(event); - } - } - return get; -}); +/** + * Pin file to IPFS + * @callback pinFileToIPFS + * @param {ReadStream} readableStream + * @param {PinataPinOptions} [options] + * @returns {Promise} + */ -exports.createGet = createGet; +/** + * Pin from FS + * @callback pinFromFS + * @param {string} sourcePath + * @param {PinataPinOptions} [options] + * @returns {Promise} + */ +/** + * Pin Jobs + * @callback pinJobs + * @param {PinataPinJobsFilterOptions} [filters] + * @returns {Promise} + */ -/***/ }), +/** + * Pin JSON to IPFS + * @callback pinJSONToIPFS + * @param {Object} body + * @param {PinataPinOptions} [options] + * @returns {Promise} + */ -/***/ 57135: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/** + * Unpin + * @callback unpin + * @param {string} hashToUnpin + * @returns {Promise} + */ -"use strict"; +/** + * User Pin Policy + * @callback userPinPolicy + * @param {{regions: PinataPinPolicyItem[]}} newPinPolicy + * @returns {Promise} + */ + +/** + * Test Authentication + * @callback testAuthentication + * @returns {Promise<{authenticated: boolean}>} + */ + +/** + * Pin List + * @callback pinList + * @param {PinataPinListFilterOptions} [filters] + * @returns {Promise} + */ + +/** + * User Pinned Data Total + * @callback userPinnedDataTotal + * @returns {Promise} + */ + +/** + * @typedef PinataClient + * @property {pinByHash} pinByHash + * @property {hashMetadata} hashMetadata + * @property {hashPinPolicy} hashPinPolicy + * @property {pinFileToIPFS} pinFileToIPFS + * @property {pinFromFS} pinFromFS + * @property {pinJSONToIPFS} pinJSONToIPFS + * @property {pinJobs} pinJobs + * @property {unpin} unpin + * @property {userPinPolicy} userPinPolicy + * @property {testAuthentication} testAuthentication + * @property {pinList} pinList + * @property {userPinnedDataTotal} userPinnedDataTotal + */ +/** + * Pinata Client + * + * @param {string} pinataApiKey + * @param {string} pinataSecretApiKey + * @returns {PinataClient} + */ +function pinataClient(pinataApiKey, pinataSecretApiKey) { + var client = {}; // setting up the actual calls you can make using this package -Object.defineProperty(exports, "__esModule", ({ value: true })); + client.pinByHash = function (hashToPin, options) { + return (0, _pinByHash["default"])(pinataApiKey, pinataSecretApiKey, hashToPin, options); + }; -var findPeer = __nccwpck_require__(71141); -var findProvs = __nccwpck_require__(1718); -var get = __nccwpck_require__(83019); -var provide = __nccwpck_require__(54851); -var put = __nccwpck_require__(76639); -var query = __nccwpck_require__(38533); + client.hashMetadata = function (ipfsPinHash, metadata) { + return (0, _hashMetadata["default"])(pinataApiKey, pinataSecretApiKey, ipfsPinHash, metadata); + }; -function createDht(config) { - return { - findPeer: findPeer.createFindPeer(config), - findProvs: findProvs.createFindProvs(config), - get: get.createGet(config), - provide: provide.createProvide(config), - put: put.createPut(config), - query: query.createQuery(config) + client.hashPinPolicy = function (ipfsPinHash, newPinPolicy) { + return (0, _hashPinPolicy["default"])(pinataApiKey, pinataSecretApiKey, ipfsPinHash, newPinPolicy); }; -} -exports.createDht = createDht; + client.pinFileToIPFS = function (readableStream, options) { + return (0, _pinFileToIPFS["default"])(pinataApiKey, pinataSecretApiKey, readableStream, options); + }; + client.pinFromFS = function (sourcePath, options) { + return (0, _pinFromFS["default"])(pinataApiKey, pinataSecretApiKey, sourcePath, options); + }; -/***/ }), + client.pinJSONToIPFS = function (body, options) { + return (0, _pinJSONToIPFS["default"])(pinataApiKey, pinataSecretApiKey, body, options); + }; -/***/ 79249: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + client.pinJobs = function (filters) { + return (0, _pinJobs["default"])(pinataApiKey, pinataSecretApiKey, filters); + }; -"use strict"; + client.unpin = function (hashToUnpin) { + return (0, _unpin["default"])(pinataApiKey, pinataSecretApiKey, hashToUnpin); + }; + client.userPinPolicy = function (newPinPolicy) { + return (0, _userPinPolicy["default"])(pinataApiKey, pinataSecretApiKey, newPinPolicy); + }; -Object.defineProperty(exports, "__esModule", ({ value: true })); + client.testAuthentication = function () { + return (0, _testAuthentication["default"])(pinataApiKey, pinataSecretApiKey); + }; -var fromString = __nccwpck_require__(39451); -var responseTypes = __nccwpck_require__(85218); -var multiaddr = __nccwpck_require__(78025); + client.pinList = function (filters) { + return (0, _pinList["default"])(pinataApiKey, pinataSecretApiKey, filters); + }; -const mapEvent = event => { - if (event.Type === responseTypes.SendingQuery) { - return { - to: event.ID, - name: 'SENDING_QUERY', - type: event.Type - }; - } - if (event.Type === responseTypes.PeerResponse) { - return { - from: event.ID, - name: 'PEER_RESPONSE', - type: event.Type, - messageType: 0, - messageName: 'PUT_VALUE', - closer: (event.Responses || []).map(({ID, Addrs}) => ({ - id: ID, - multiaddrs: Addrs.map(addr => new multiaddr.Multiaddr(addr)) - })), - providers: (event.Responses || []).map(({ID, Addrs}) => ({ - id: ID, - multiaddrs: Addrs.map(addr => new multiaddr.Multiaddr(addr)) - })) - }; - } - if (event.Type === responseTypes.FinalPeer) { - let peer = { - id: event.ID, - multiaddrs: [] - }; - if (event.Responses && event.Responses.length) { - peer = { - id: event.Responses[0].ID, - multiaddrs: event.Responses[0].Addrs.map(addr => new multiaddr.Multiaddr(addr)) - }; - } - return { - from: event.ID, - name: 'FINAL_PEER', - type: event.Type, - peer - }; - } - if (event.Type === responseTypes.QueryError) { - return { - from: event.ID, - name: 'QUERY_ERROR', - type: event.Type, - error: new Error(event.Extra) - }; - } - if (event.Type === responseTypes.Provider) { - return { - from: event.ID, - name: 'PROVIDER', - type: event.Type, - providers: event.Responses.map(({ID, Addrs}) => ({ - id: ID, - multiaddrs: Addrs.map(addr => new multiaddr.Multiaddr(addr)) - })) - }; - } - if (event.Type === responseTypes.Value) { - return { - from: event.ID, - name: 'VALUE', - type: event.Type, - value: fromString.fromString(event.Extra, 'base64pad') - }; - } - if (event.Type === responseTypes.AddingPeer) { - const peers = event.Responses.map(({ID}) => ID); - if (!peers.length) { - throw new Error('No peer found'); - } - return { - name: 'ADDING_PEER', - type: event.Type, - peer: peers[0] - }; - } - if (event.Type === responseTypes.DialingPeer) { - return { - name: 'DIALING_PEER', - type: event.Type, - peer: event.ID - }; - } - throw new Error('Unknown DHT event type'); -}; + client.userPinnedDataTotal = function () { + return (0, _userPinnedDataTotal["default"])(pinataApiKey, pinataSecretApiKey); + }; -exports.mapEvent = mapEvent; + return client; +} +module.exports = exports.default; /***/ }), -/***/ 54851: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./src/util/errorResponse.js": +/*!***********************************!*\ + !*** ./src/util/errorResponse.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nccwpck_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var mapEvent = __nccwpck_require__(79249); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.handleError = void 0; -const createProvide = configure.configure(api => { - async function* provide(cids, options = { recursive: false }) { - const cidArr = Array.isArray(cids) ? cids : [cids]; - const res = await api.post('dht/provide', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: cidArr.map(cid => cid.toString()), - ...options - }), - headers: options.headers - }); - for await (const event of res.ndjson()) { - yield mapEvent.mapEvent(event); - } +var handleError = function handleError(error) { + if (error && error.response && error.response && error.response.data && error.response.data.error) { + return error.response.data.error; + } else if (error.data && error.data.error) { + return error.data.error; + } else if (error.response && error.response.error) { + return error.response.error; } - return provide; -}); -exports.createProvide = createProvide; + return error; +}; +exports.handleError = handleError; /***/ }), -/***/ 76639: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "./src/util/validators.js": +/*!********************************!*\ + !*** ./src/util/validators.js ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_1034066__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var multipartRequest = __nccwpck_require__(87527); -var abortSignal = __nccwpck_require__(14594); -var nativeAbortController = __nccwpck_require__(43586); -var toString = __nccwpck_require__(2771); -var mapEvent = __nccwpck_require__(79249); - -const createPut = configure.configure(api => { - async function* put(key, value, options = {}) { - const controller = new nativeAbortController.AbortController(); - const signal = abortSignal.abortSignal(controller.signal, options.signal); - const res = await api.post('dht/put', { - signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: key instanceof Uint8Array ? toString.toString(key) : key.toString(), - ...options - }), - ...await multipartRequest.multipartRequest([value], controller, options.headers) - }); - for await (const event of res.ndjson()) { - yield mapEvent.mapEvent(event); - } - } - return put; +Object.defineProperty(exports, "__esModule", { + value: true }); +exports.validateApiKeys = validateApiKeys; +exports.validateHostNodes = validateHostNodes; +exports.validateMetadata = validateMetadata; +exports.validatePinPolicyStructure = validatePinPolicyStructure; +exports.validatePinataOptions = validatePinataOptions; -exports.createPut = createPut; - - -/***/ }), +var _isIpfs = _interopRequireDefault(__nested_webpack_require_1034066__(/*! is-ipfs */ "./node_modules/is-ipfs/src/index.js")); -/***/ 38533: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -"use strict"; +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } +/** + * Validate API Keys + * @param {string} pinataApiKey + * @param {string} pinataSecretApiKey + */ +function validateApiKeys(pinataApiKey, pinataSecretApiKey) { + if (!pinataApiKey || pinataApiKey === '') { + throw new Error('No pinataApiKey provided! Please provide your pinata api key as an argument when you start this script'); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + if (!pinataSecretApiKey || pinataSecretApiKey === '') { + throw new Error('No pinataSecretApiKey provided! Please provide your pinata secret api key as an argument when you start this script'); + } +} +/** + * Validate host Nodes + * @param {*} hostNodes + */ -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var mapEvent = __nccwpck_require__(79249); -const createQuery = configure.configure(api => { - async function* query(peerId, options = {}) { - const res = await api.post('dht/query', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: peerId.toString(), - ...options - }), - headers: options.headers - }); - for await (const event of res.ndjson()) { - yield mapEvent.mapEvent(event); - } +function validateHostNodes(hostNodes) { + if (!Array.isArray(hostNodes)) { + throw new Error('host_nodes value must be an array'); } - return query; -}); -exports.createQuery = createQuery; + hostNodes.forEach(function (node) { + if (!_isIpfs["default"].peerMultiaddr(node)) { + throw new Error("host_node array entry: ".concat(node, " is not a valid peer multiaddr")); + } + }); +} +/** + * Validate MetaData + * @param {*} metadata + */ -/***/ }), +function validateMetadata(metadata) { + if (metadata.name) { + if (!(typeof metadata.name === 'string' || metadata.name instanceof String)) { + throw new Error('metadata name must be of type string'); + } + } -/***/ 85218: -/***/ ((__unused_webpack_module, exports) => { + if (metadata.keyvalues) { + if (!(_typeof(metadata.keyvalues) === 'object')) { + throw new Error('metatadata keyvalues must be an object'); + } -"use strict"; + var i = 0; + Object.entries(metadata.keyvalues).forEach(function (keyValue) { + if (i > 9) { + throw new Error('No more than 10 keyvalues can be provided for metadata entries'); + } // we want to make sure that the input is a string, a boolean, or a number, so we don't get an object passed in by accident -Object.defineProperty(exports, "__esModule", ({ value: true })); + if (!(typeof keyValue[1] === 'string' || typeof keyValue[1] === 'boolean' || !isNaN(keyValue[1]))) { + throw new Error('Metadata keyvalue values must be strings, booleans, or numbers'); + } -const SendingQuery = 0; -const PeerResponse = 1; -const FinalPeer = 2; -const QueryError = 3; -const Provider = 4; -const Value = 5; -const AddingPeer = 6; -const DialingPeer = 7; + i++; + }); + } +} +/** + * Validate Pin Policy Structure + * @param {*} pinPolicy + */ -exports.AddingPeer = AddingPeer; -exports.DialingPeer = DialingPeer; -exports.FinalPeer = FinalPeer; -exports.PeerResponse = PeerResponse; -exports.Provider = Provider; -exports.QueryError = QueryError; -exports.SendingQuery = SendingQuery; -exports.Value = Value; +function validatePinPolicyStructure(pinPolicy) { + //this function takes in a pin policy and checks the JSON structure to make sure it's valid + if (!pinPolicy) { + throw new Error('No pin policy provided'); + } -/***/ }), + if (!pinPolicy.regions) { + throw new Error('No regions provided in pin policy'); + } -/***/ 48257: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (pinPolicy.regions.length) { + pinPolicy.regions.forEach(function (region) { + if (!region.id || !(Object.prototype.toString.call(region.id) === '[object String]')) { + throw new Error('region id must be a string'); + } -"use strict"; + if (!(region.desiredReplicationCount || region.desiredReplicationCount === 0) || !Number.isInteger(region.desiredReplicationCount)) { + throw new Error('desiredReplicationCount must be an integer'); + } + }); + } +} +/** + * Validate Pinata Options + * @param {*} options + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); +function validatePinataOptions(options) { + if (_typeof(options) !== 'object') { + throw new Error('options must be an object'); + } -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); + if (options.cidVersion) { + // eslint-disable-next-line eqeqeq + if (options.cidVersion != 0 && options.cidVersion != 1) { + throw new Error('unsupported or invalid cidVersion'); + } + } -const createCmds = configure.configure(api => { - async function cmds(options = {}) { - const res = await api.post('diag/cmds', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - }); - return res.json(); + if (options.wrapWithDirectory) { + // eslint-disable-next-line eqeqeq + if (options.wrapWithDirectory !== true && options.wrapWithDirectory !== false) { + throw new Error('wrapWithDirectory must be a boolean value of true or false'); + } } - return cmds; -}); -exports.createCmds = createCmds; + if (options.hostNodes) { + validateHostNodes(options.hostNodes); + } + if (options.customPinPolicy) { + validatePinPolicyStructure(options.customPinPolicy); + } +} /***/ }), -/***/ 19433: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - +/***/ 0: +/*!*******************************************!*\ + !*** multi babel-polyfill ./src/index.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __nested_webpack_require_1038844__) { -Object.defineProperty(exports, "__esModule", ({ value: true })); +__nested_webpack_require_1038844__(/*! babel-polyfill */"./node_modules/babel-polyfill/lib/index.js"); +module.exports = __nested_webpack_require_1038844__(/*! /Users/mattober/Repos/ipfs/pinata/open-source-tools/Pinata-SDK/src/index.js */"./src/index.js"); -var cmds = __nccwpck_require__(48257); -var net = __nccwpck_require__(97401); -var sys = __nccwpck_require__(803); -function createDiag(config) { - return { - cmds: cmds.createCmds(config), - net: net.createNet(config), - sys: sys.createSys(config) - }; -} +/***/ }), -exports.createDiag = createDiag; +/***/ "assert": +/*!*************************!*\ + !*** external "assert" ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports) { +module.exports = __nccwpck_require__(39491); /***/ }), -/***/ 97401: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "buffer": +/*!*************************!*\ + !*** external "buffer" ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -"use strict"; +module.exports = __nccwpck_require__(14300); +/***/ }), -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ "fs": +/*!*********************!*\ + !*** external "fs" ***! + \*********************/ +/*! no static exports found */ +/***/ (function(module, exports) { -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); +module.exports = __nccwpck_require__(57147); -const createNet = configure.configure(api => { - async function net(options = {}) { - const res = await api.post('diag/net', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - }); - return res.json(); - } - return net; -}); +/***/ }), -exports.createNet = createNet; +/***/ "http": +/*!***********************!*\ + !*** external "http" ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports) { +module.exports = __nccwpck_require__(13685); /***/ }), -/***/ 803: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "https": +/*!************************!*\ + !*** external "https" ***! + \************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -"use strict"; +module.exports = __nccwpck_require__(95687); +/***/ }), -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ "os": +/*!*********************!*\ + !*** external "os" ***! + \*********************/ +/*! no static exports found */ +/***/ (function(module, exports) { -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); +module.exports = __nccwpck_require__(22037); -const createSys = configure.configure(api => { - async function sys(options = {}) { - const res = await api.post('diag/sys', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - }); - return res.json(); - } - return sys; -}); +/***/ }), -exports.createSys = createSys; +/***/ "path": +/*!***********************!*\ + !*** external "path" ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports) { +module.exports = __nccwpck_require__(71017); /***/ }), -/***/ 1503: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ "stream": +/*!*************************!*\ + !*** external "stream" ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -"use strict"; +module.exports = __nccwpck_require__(12781); +/***/ }), -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ "tty": +/*!**********************!*\ + !*** external "tty" ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports) { -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); +module.exports = __nccwpck_require__(76224); -const createDns = configure.configure(api => { - const dns = async (domain, options = {}) => { - const res = await api.post('dns', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: domain, - ...options - }), - headers: options.headers - }); - const data = await res.json(); - return data.Path; - }; - return dns; -}); +/***/ }), -exports.createDns = createDns; +/***/ "url": +/*!**********************!*\ + !*** external "url" ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports) { +module.exports = __nccwpck_require__(57310); /***/ }), -/***/ 48771: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ "util": +/*!***********************!*\ + !*** external "util" ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports) { +module.exports = __nccwpck_require__(73837); -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ }), -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); +/***/ "zlib": +/*!***********************!*\ + !*** external "zlib" ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports) { -const createChmod = configure.configure(api => { - async function chmod(path, mode, options = {}) { - const res = await api.post('files/chmod', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: path, - mode, - ...options - }), - headers: options.headers - }); - await res.text(); - } - return chmod; -}); +module.exports = __nccwpck_require__(59796); -exports.createChmod = createChmod; +/***/ }) +/******/ }); +}); +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9waW5hdGEtc2RrL3dlYnBhY2svdW5pdmVyc2FsTW9kdWxlRGVmaW5pdGlvbiIsIndlYnB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CcpLm1hcChmdW5jdGlvbiB0cmltKHMpIHtcbiAgICAgICAgICAgIHJldHVybiBzLnRyaW0oKTtcbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIHNob3VsZFByb3h5ID0gIW5vUHJveHkuc29tZShmdW5jdGlvbiBwcm94eU1hdGNoKHByb3h5RWxlbWVudCkge1xuICAgICAgICAgICAgaWYgKCFwcm94eUVsZW1lbnQpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHByb3h5RWxlbWVudCA9PT0gJyonKSB7XG4gICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHByb3h5RWxlbWVudFswXSA9PT0gJy4nICYmXG4gICAgICAgICAgICAgICAgcGFyc2VkLmhvc3RuYW1lLnN1YnN0cihwYXJzZWQuaG9zdG5hbWUubGVuZ3RoIC0gcHJveHlFbGVtZW50Lmxlbmd0aCkgPT09IHByb3h5RWxlbWVudCkge1xuICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIHBhcnNlZC5ob3N0bmFtZSA9PT0gcHJveHlFbGVtZW50O1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHNob3VsZFByb3h5KSB7XG4gICAgICAgICAgcHJveHkgPSB7XG4gICAgICAgICAgICBob3N0OiBwYXJzZWRQcm94eVVybC5ob3N0bmFtZSxcbiAgICAgICAgICAgIHBvcnQ6IHBhcnNlZFByb3h5VXJsLnBvcnQsXG4gICAgICAgICAgICBwcm90b2NvbDogcGFyc2VkUHJveHlVcmwucHJvdG9jb2xcbiAgICAgICAgICB9O1xuXG4gICAgICAgICAgaWYgKHBhcnNlZFByb3h5VXJsLmF1dGgpIHtcbiAgICAgICAgICAgIHZhciBwcm94eVVybEF1dGggPSBwYXJzZWRQcm94eVVybC5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0YW5kYXJkIGJyb3dzZXIgZW52cyBzdXBwb3J0IGRvY3VtZW50LmNvb2tpZVxuICAgIChmdW5jdGlvbiBzdGFuZGFyZEJyb3dzZXJFbnYoKSB7XG4gICAgICByZXR1cm4ge1xuICAgICAgICB3cml0ZTogZnVuY3Rpb24gd3JpdGUobmFtZSwgdmFsdWUsIGV4cGlyZXMsIHBhdGgsIGRvbWFpbiwgc2VjdXJlKSB7XG4gICAgICAgICAgdmFyIGNvb2tpZSA9IFtdO1xuICAgICAgICAgIGNvb2tpZS5wdXNoKG5hbWUgKyAnPScgKyBlbmNvZGVVUklDb21wb25lbnQodmFsdWUpKTtcblxuICAgICAgICAgIGlmICh1dGlscy5pc051bWJlcihleHBpcmVzKSkge1xuICAgICAgICAgICAgY29va2llLnB1c2goJ2V4cGlyZXM9JyArIG5ldyBEYXRlKGV4cGlyZXMpLnRvR01UU3RyaW5nKCkpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmICh1dGlscy5pc1N0cmluZyhwYXRoKSkge1xuICAgICAgICAgICAgY29va2llLnB1c2goJ3BhdGg9JyArIHBhdGgpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmICh1dGlscy5pc1N0cmluZyhkb21haW4pKSB7XG4gICAgICAgICAgICBjb29raWUucHVzaCgnZG9tYWluPScgKyBkb21haW4pO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChzZWN1cmUgPT09IHRydWUpIHtcbiAgICAgICAgICAgIGNvb2tpZS5wdXNoKCdzZWN1cmUnKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBkb2N1bWVudC5jb29raWUgPSBjb29raWUuam9pbignOyAnKTtcbiAgICAgICAgfSxcblxuICAgICAgICByZWFkOiBmdW5jdGlvbiByZWFkKG5hbWUpIHtcbiAgICAgICAgICB2YXIgbWF0Y2ggPSBkb2N1bWVudC5jb29raWUubWF0Y2gobmV3IFJlZ0V4cCgnKF58O1xcXFxzKikoJyArIG5hbWUgKyAnKT0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gIHZhciBkb21haW4gPSByZWFjdGlvbi5kb21haW47XG4gICAgICB2YXIgcmVzdWx0LCB0aGVuLCBleGl0ZWQ7XG4gICAgICB0cnkge1xuICAgICAgICBpZiAoaGFuZGxlcikge1xuICAgICAgICAgIGlmICghb2spIHtcbiAgICAgICAgICAgIGlmIChwcm9taXNlLl9oID09IDIpIG9uSGFuZGxlVW5oYW5kbGVkKHByb21pc2UpO1xuICAgICAgICAgICAgcHJvbWlzZS5faCA9IDE7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChoYW5kbGVyID09PSB0cnVlKSByZXN1bHQgPSB2YWx1ZTtcbiAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGlmIChkb21haW4pIGRvbWFpbi5lbnRlcigpO1xuICAgICAgICAgICAgcmVzdWx0ID0gaGFuZGxlcih2YWx1ZSk7IC8vIG1heSB0aHJvd1xuICAgICAgICAgICAgaWYgKGRvbWFpbikge1xuICAgICAgICAgICAgICBkb21haW4uZXhpdCgpO1xuICAgICAgICAgICAgICBleGl0ZWQgPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAocmVzdWx0ID09PSByZWFjdGlvbi5wcm9taXNlKSB7XG4gICAgICAgICAgICByZWplY3QoVHlwZUVycm9yKCdQcm9taXNlLWNoYWluIGN5Y2xlJykpO1xuICAgICAgICAgIH0gZWxzZSBpZiAodGhlbiA9IGlzVGhlbmFibGUocmVzdWx0KSkge1xuICAgICAgICAgICAgdGhlbi5jYWxsKHJlc3VsdCwgcmVzb2x2ZSwgcmVqZWN0KTtcbiAgICAgICAgICB9IGVsc2UgcmVzb2x2ZShyZXN1bHQpO1xuICAgICAgICB9IGVsc2UgcmVqZWN0KHZhbHVlKTtcbiAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgaWYgKGRvbWFpbiAmJiAhZXhpdGVkKSBkb21haW4uZXhpdCgpO1xuICAgICAgICByZWplY3QoZSk7XG4gICAgICB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sc2UgaWYgKGIgPD0gMHhFRikge1xuICAgICAgICBjID0gYiAmIDB4MEY7XG4gICAgICAgIGZvbGxvd2luZ0NoYXJzID0gMjtcbiAgICAgIH0gZWxzZSBpZiAoYiA8PSAweEY3KSB7XG4gICAgICAgIGMgPSBiICYgMHgwNztcbiAgICAgICAgZm9sbG93aW5nQ2hhcnMgPSAzO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdGhyb3dJbnZhbGlkVXRmOChpLCBzdHIpO1xuICAgICAgfVxuXG4gICAgICBmb3IgKHZhciBqID0gMDsgaiA8IGZvbGxvd2luZ0NoYXJzOyArK2opIHtcbiAgICAgICAgYiA9IGJ5dGVzW2krK107XG4gICAgICAgIGlmIChiIDwgMHg4MCB8fCBiID4gMHhCRikge1xuICAgICAgICAgIHRocm93SW52YWxpZFV0ZjgoaSwgc3RyKTtcbiAgICAgICAgfVxuICAgICAgICBjIDw8PSA2O1xuICAgICAgICBjICs9IGIgJiAweDNGO1xuICAgICAgfVxuICAgICAgaWYgKGMgPj0gMHhEODAwICYmIGMgPD0gMHhERkZGKSB7XG4gICAgICAgIHRocm93SW52YWxpZFV0ZjgoaSwgc3RyKTtcbiAgICAgIH1cbiAgICAgIGlmIChjID4gMHgxMEZGRkYpIHtcbiAgICAgICAgdGhyb3dJbnZhbGlkVXRmOChpLCBzdHIpO1xuICAgICAgfVxuXG4gICAgICBpZiAoYyA8PSAweEZGRkYpIHtcbiAgICAgICAgc3RyICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoYyk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBjIC09IDB4MTAwMDA7XG4gICAgICAgIHN0ciArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKChjID4+IDEwKSArIDB4RDgwMCk7XG4gICAgICAgIHN0ciArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKChjICYgMHgzRkYpICsgMHhEQzAwKTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIHN0cjtcbiAgfT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BlbHNlIGlmIChjb2RlIDwgMHhkODAwIHx8IGNvZGUgPj0gMHhlMDAwKSB7XG4gICAgICAgICAgYmxvY2tzW2krK10gPSAweGUwIHwgKGNvZGUgPj4gMTIpO1xuICAgICAgICAgIGJsb2Nrc1tpKytdID0gMHg4MCB8ICgoY29kZSA+PiA2KSAmIDB4M2YpO1xuICAgICAgICAgIGJsb2Nrc1tpKytdID0gMHg4MCB8IChjb2RlICYgMHgzZik7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgY29kZSA9IDB4MTAwMDAgKyAoKChjb2RlICYgMHgzZmYpIDw8IDEwKSB8IChzdHIuY2hhckNvZGVBdCgrK2luZGV4KSAmIDB4M2ZmKSk7XG4gICAgICAgICAgYmxvY2tzW2krK10gPSAweGYwIHwgKGNvZGUgPj4gMTgpO1xuICAgICAgICAgIGJsb2Nrc1tpKytdID0gMHg4MCB8ICgoY29kZSA+PiAxMikgJiAweDNmKTtcbiAgICAgICAgICBibG9ja3NbaSsrXSA9IDB4ODAgfCAoKGNvZGUgPj4gNikgJiAweDNmKTtcbiAgICAgICAgICBibG9ja3NbaSsrXSA9IDB4ODAgfCAoY29kZSAmIDB4M2YpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBieXRlcyArPSBpIC0gc3RhcnQ7XG4gICAgICBzdGFydCA9IGkgLSA1O1xuICAgICAgaWYgKGluZGV4ID09PSBsZW5ndGgpIHtcbiAgICAgICAgKytpbmRleDtcbiAgICAgIH1cbiAgICAgIGlmIChpbmRleCA+IGxlbmd0aCAmJiBpIDwgNikge1xuICAgICAgICBlbmQgPSB0cnVlO1xuICAgICAgfVxuICAgICAgdjEgPSBibG9ja3NbMF07XG4gICAgICBpZiAoaSA+IDQpIHtcbiAgICAgICAgdjIgPSBibG9ja3NbMV07XG4gICAgICAgIHYzID0gYmxvY2tzWzJdO1xuICAgICAgICB2NCA9IGJsb2Nrc1szXTtcbiAgICAgICAgdjUgPSBibG9ja3NbNF07XG4gICAgICAg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IzMmEsXG4gICdTa2VpbjUxMi04OCc6IDB4YjMyYixcbiAgJ1NrZWluNTEyLTk2JzogMHhiMzJjLFxuICAnU2tlaW41MTItMTA0JzogMHhiMzJkLFxuICAnU2tlaW41MTItMTEyJzogMHhiMzJlLFxuICAnU2tlaW41MTItMTIwJzogMHhiMzJmLFxuICAnU2tlaW41MTItMTI4JzogMHhiMzMwLFxuICAnU2tlaW41MTItMTM2JzogMHhiMzMxLFxuICAnU2tlaW41MTItMTQ0JzogMHhiMzMyLFxuICAnU2tlaW41MTItMTUyJzogMHhiMzMzLFxuICAnU2tlaW41MTItMTYwJzogMHhiMzM0LFxuICAnU2tlaW41MTItMTY4JzogMHhiMzM1LFxuICAnU2tlaW41MTItMTc2JzogMHhiMzM2LFxuICAnU2tlaW41MTItMTg0JzogMHhiMzM3LFxuICAnU2tlaW41MTItMTkyJzogMHhiMzM4LFxuICAnU2tlaW41MTItMjAwJzogMHhiMzM5LFxuICAnU2tlaW41MTItMjA4JzogMHhiMzNhLFxuICAnU2tlaW41MTItMjE2JzogMHhiMzNiLFxuICAnU2tlaW41MTItMjI0JzogMHhiMzNjLFxuICAnU2tlaW41MTItMjMyJzogMHhiMzNkLFxuICAnU2tlaW41MTItMjQwJzogMHhiMzNlLFxuICAnU2tlaW41MTItMjQ4JzogMHhiMzNmLFxuICAnU2tlaW41MTItMjU2JzogMHhiMzQwLFxuICAnU2tlaW41MTItMjY0JzogMHhiMzQxLFxuICAnU2tlaW41MTItMjcyJzogMHhiMzQyLFxuICAnU2tlaW41MTItMjgwJzogMHhiMzQzLFxuICAnU2tlaW41MTItMjg4JzogMHhiMzQ0LFxuICAnU2tlaW41MTItMjk2JzogMHhiMzQ1LFxuICAnU2tlaW41MTItMzA0JzogMHhiMzQ2LFxuICAnU2tlaW41MTItMzEyJzogMHhiMzQ3LFxuICAnU2tlaW41MTItMzIwJzogMHhiMzQ4LFxuICAnU2tlaW41MTItMzI4JzogMHhiMzQ5LFxuICAnU2tlaW41MTItMzM2JzogMHhiMzRhLFxuICAnU2tlaW41MTItMzQ0JzogMHhiMzRiLFxuICAnU2tlaW41MTItMzUyJzogMHhiMzRjLFxuICAnU2tlaW41MTItMzYwJzogMHhiMzRkLFxuICAnU2tlaW41MTItMzY4JzogMHhiMzRlLFxuICAnU2tlaW41MTItMzc2JzogMHhiMzRmLFxuICAnU2tlaW41MTItMzg0JzogMHhiMzUwLFxuICAnU2tlaW41MTItMzkyJzogMHhiMzUxLFxuICAnU2tlaW41MTItNDAwJzogMHhiMzUyLFxuICAnU2tlaW41MTItNDA4JzogMHhiMzUzLFxuICAnU2tlaW41MTItNDE2JzogMHhiMzU0LFxuICAnU2tlaW41MTItNDI0JzogMHhiMzU1LFxuICAnU2tlaW41MTItNDMyJzogMHhiMzU2LFxuICAnU2tlaW41MTItNDQwJzogMHhiMzU3LFxuICAnU2tlaW41MTItNDQ4JzogMHhiMzU4LFxuICAnU2tlaW41MTItNDU2JzogMHhiMzU5LFxuICAnU2tlaW41MTItNDY0JzogMHhiMzVhLFxuICAnU2tlaW41MTItNDcyJzogMHhiMzViLFxuICAnU2tlaW41MTItNDgwJzogMHhiMzVjLFxuICAnU2tlaW41MTItNDg4JzogMHhiMzVkLFxuICAnU2tlaW41MTItNDk2JzogMHhiMzVlLFxuICAnU2tlaW41MTItNTA0JzogMHhiMzVmLFxuICAnU2tlaW41MTItNTEyJzogMHhiMzYwLFxuICAnU2tlaW4xMDI0LTgnOiAweGIzNjEsXG4gICdTa2VpbjEwMjQtMTYnOiAweGIzNjIsXG4gICdTa2VpbjEwMjQtMjQnOiAweGIzNjMsXG4gICdTa2VpbjEwMjQtMzInOiAweGIzNjQsXG4gICdTa2VpbjEwMjQtNDAnOiAweGIzNjUsXG4gICdTa2VpbjEwMjQtNDgnOiAweGIzNjYsXG4gICdTa2VpbjEwMjQtNTYnOiAweGIzNjcsXG4gICdTa2VpbjEwMjQtNjQnOiAweGIzNjgsXG4gICdTa2VpbjEwMjQtNzInOiAweGIzNjksXG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gICAgICAgIGlmIChzdGF0ZSA9PT0gR2VuU3RhdGVTdXNwZW5kZWRTdGFydCkge1xuICAgICAgICAgICAgc3RhdGUgPSBHZW5TdGF0ZUNvbXBsZXRlZDtcbiAgICAgICAgICAgIHRocm93IGNvbnRleHQuYXJnO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGNvbnRleHQuZGlzcGF0Y2hFeGNlcHRpb24oY29udGV4dC5hcmcpO1xuXG4gICAgICAgIH0gZWxzZSBpZiAoY29udGV4dC5tZXRob2QgPT09IFwicmV0dXJuXCIpIHtcbiAgICAgICAgICBjb250ZXh0LmFicnVwdChcInJldHVyblwiLCBjb250ZXh0LmFyZyk7XG4gICAgICAgIH1cblxuICAgICAgICBzdGF0ZSA9IEdlblN0YXRlRXhlY3V0aW5nO1xuXG4gICAgICAgIHZhciByZWNvcmQgPSB0cnlDYXRjaChpbm5lckZuLCBzZWxmLCBjb250ZXh0KTtcbiAgICAgICAgaWYgKHJlY29yZC50eXBlID09PSBcIm5vcm1hbFwiKSB7XG4gICAgICAgICAgLy8gSWYgYW4gZXhjZXB0aW9uIGlzIHRocm93biBmcm9tIGlubmVyRm4sIHdlIGxlYXZlIHN0YXRlID09PVxuICAgICAgICAgIC8vIEdlblN0YXRlRXhlY3V0aW5nIGFuZCBsb29wIGJhY2sgZm9yIGFub3RoZXIgaW52b2NhdGlvbi5cbiAgICAgICAgICBzdGF0ZSA9IGNvbnRleHQuZG9uZVxuICAgICAgICAgICAgPyBHZW5TdGF0ZUNvbXBsZXRlZFxuICAgICAgICAgICAgOiBHZW5TdGF0ZVN1c3BlbmRlZFlpZWxkO1xuXG4gICAgICAgICAgaWYgKHJlY29yZC5hcmcgPT09IENvbnRpbnVlU2VudGluZWwpIHtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICB2YWx1ZTogcmVjb3JkLmFyZyxcbiAgICAgICAgICAgIGRvbmU6IG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NZXRob2QpIHtcbiAgICAgICAgcmV0dXJuIGl0ZXJhdG9yTWV0aG9kLmNhbGwoaXRlcmFibGUpO1xuICAgICAgfVxuXG4gICAgICBpZiAodHlwZW9mIGl0ZXJhYmxlLm5leHQgPT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICByZXR1cm4gaXRlcmFibGU7XG4gICAgICB9XG5cbiAgICAgIGlmICghaXNOYU4oaXRlcmFibGUubGVuZ3RoKSkge1xuICAgICAgICB2YXIgaSA9IC0xLCBuZXh0ID0gZnVuY3Rpb24gbmV4dCgpIHtcbiAgICAgICAgICB3aGlsZSAoKytpIDwgaXRlcmFibGUubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAoaGFzT3duLmNhbGwoaXRlcmFibGUsIGkpKSB7XG4gICAgICAgICAgICAgIG5leHQudmFsdWUgPSBpdGVyYWJsZVtpXTtcbiAgICAgICAgICAgICAgbmV4dC5kb25lID0gZmFsc2U7XG4gICAgICAgICAgICAgIHJldHVybiBuZXh0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIG5leHQudmFsdWUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgbmV4dC5kb25lID0gdHJ1ZTtcblxuICAgICAgICAgIHJldHVybiBuZXh0O1xuICAgICAgICB9O1xuXG4gICAgICAgIHJldHVybiBuZXh0Lm5leHQgPSBuZXh0O1xuICAgICAgfVxuICAgIH1cblxuICAgIC8vIFJldHVybiBhbiBpdGVyYXRvciB3aXRoIG5vIHZhbHVlcy5cbiAgICByZXR1cm4geyBuZXh0OiBkb25lUmVzdWx0IH07XG4gIH1cbiAgcnVudGltZS52YWx1ZXMgPSB2YWx1ZXM7XG5cbiAgZnVuY3Rpb24gZG9uZVJlc3VsdCgpIHtcbiAgICByZXR1cm4geyB2YWx1ZTogdW5kZWZpbmVkLCBkb25lOiB0cnVlIH07XG4gIH1cblxuICBDb250ZXh0LnByb3RvdHlwZSA9IHtcbiAgICBjb25zdHJ1Y3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uIGhhbmRsZShlbnRyeS5jYXRjaExvYywgdHJ1ZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICB9IGVsc2UgaWYgKGhhc0ZpbmFsbHkpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnByZXYgPCBlbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoYW5kbGUoZW50cnkuZmluYWxseUxvYyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwidHJ5IHN0YXRlbWVudCB3aXRob3V0IGNhdGNoIG9yIGZpbmFsbHlcIik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcblxuICAgIGFicnVwdDogZnVuY3Rpb24odHlwZSwgYXJnKSB7XG4gICAgICBmb3IgKHZhciBpID0gdGhpcy50cnlFbnRyaWVzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBlbnRyeSA9IHRoaXMudHJ5RW50cmllc1tpXTtcbiAgICAgICAgaWYgKGVudHJ5LnRyeUxvYyA8PSB0aGlzLnByZXYgJiZcbiAgICAgICAgICAgIGhhc093bi5jYWxsKGVudHJ5LCBcImZpbmFsbHlMb2NcIikgJiZcbiAgICAgICAgICAgIHRoaXMucHJldiA8IGVudHJ5LmZpbmFsbHlMb2MpIHtcbiAgICAgICAgICB2YXIgZmluYWxseUVudHJ5ID0gZW50cnk7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKGZpbmFsbHlFbnRyeSAmJlxuICAgICAgICAgICh0eXBlID09PSBcImJyZWFrXCIgfHxcbiAgICAgICAgICAgdHlwZSA9PT0gXCJjb250aW51ZVwiKSAmJlxuICAgICAgICAgIGZpbmFsbHlFbnRyeS50cnlMb2MgPD0gYXJnICYmXG4gICAgICAgICAgYXJnIDw9IGZpbmFsbHlFbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgIC8vIElnbm9yZSB0aGUgZmluYWxseSBlbnRyeSBpZiBjb250cm9sIGlzIG5vdCBqdW1waW5nIHRvIGFcbiAgICAgICAgLy8gbG9jYXRpb24gb3V0c2lkZSB0aGUgdHJ5L2NhdGNoIGJsb2NrLlxuICAgICAgICBmaW5hbGx5RW50cnkgPSBudWxsO1xuICAgICAgfVxuXG4gICAgICB2YXIgcmVjb3JkID0gZmluYWxseUVudHJ5ID8gZmluYWxseUVudHJ5LmNvbXBsZXRpb24gOiB7fTtcbiAgICAgIHJlY29yZC50eXBlID0gdHlwZTtcbiAgICAgIHJlY29yZC5hcmcgPSBhcmc7XG5cbiAgICAgIGlmIChmaW5hbGx5RW50cnkpIHtcbiAgICAgICAgdGhpcy5tZXRob2QgPSBcIm5leHRcIjtcbiAgICAgICAgdGhpcy5uZXh0ID0gZmluYWxseUVudHJ5LmZpbmFsbHlMb2M7XG4gICAgICAgIHJldHVybiBDb250aW51ZVNlbnRpbmVsO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gdGhpcy5jb21wbGV0ZShyZWNvcmQpO1xuICAgIH0sXG5cbiAgICBjb21wbGV0ZTogZnVuY3Rpb24ocmVjb3JkLCBhZnRlckxvYykge1xuICAgICAgaWYgKHJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgICAgdGhyb3cgcmVjb3JkLmFyZztcbiAgICAgIH1cblxuICAgICAgaWYgKHJlY29yZC50eXBlID09PSBcImJyZWFrXCIgfHxcbiAgICAgICAgICByZWNvcmQudHlwZSA9PT0gXCJjb250aW51ZVwiKSB7XG4gICAgICAgIHRoaXMubmV4dCA9IHJlY29yZC5hcmc7XG4gICAgICB9IGVsc2UgaWYgKHJlY29yZC50eXBlID09PSBcInJldHVyblwiKSB7XG4gICAgICAgIHRoaXMucnZhbCA9IHRoaXMuYXJnID0gcmVjb3JkLmFyZztcbiAgICAgICAgdGhpcy5tZXRob2QgPSBcInJldHVyblwiO1xuICAgICAgICB0aGlzLm5leHQgPSBcImVuZFwiO1xuICAgICAgfSBlbHNlIGlmIChyZWNvcmQudHlwZSA9PT0gXCJub3JtYWxcIiAmJiBhZnRlckxvYykge1xuICAgICAgICB0aGlzLm5leHQgPSBhZnRlckxvYztcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIENvbnRpbnVlU2VudGluZWw7XG4gICAgfSxcblxuICAgIGZpbmlzaDogZnVuY3Rpb24oZmluYWxseUxvYykge1xuICAgICAgZm9yICh2YXIgaSA9IHRoaXMudHJ5RW50cmllcy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICB2YXIgZW50cnkgPSB0aGlzLnRyeUVudHJpZXNbaV07XG4gICAgICAgIGlmIChlbnRyeS5maW5hbGx5TG9jID09PSBmaW5hbGx5TG9jKSB7XG4gICAgICAgICAgdGhpcy5jb21wbGV0ZShlbnRyeS5jb21wbGV0aW9uLCBlbnRyeS5hZnRlckxvYyk7XG4gICAgICAgICAgcmVzZXRUcnlFbnRyeShlbnRyeSk7XG4gICAgICAgICAgcmV0dXJuIENvbnRpbnVlU2VudGluZWw7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuXG4gICAgXCJjYXRjaFwiOiBmdW5jdGlvbih0cnlMb2MpIHtcbiAgICAgIGZvciAodmFyIGkgPSB0aGlzLnRyeUVudHJpZXMubGVuZ3RoIC0gMTsgaSA+PSAwOyAtLWkpIHtcbiAgICAgICAgdmFyIGVudHJ5ID0gdGhpcy50cnlFbnRyaWVzW2ldO1xuICAgICAgICBpZiAoZW50cnkudHJ5TG9jID09PSB0cnlMb2MpIHtcbiAgICAgICAgICB2YXIgcmVjb3JkID0gZW50cnkuY29tcGxldGlvbjtcbiAgICAgICAgICBpZiAocmVjb3JkLnR5cGUgPT09IFwidGhyb3dcIikge1xuICAgICAgICAgICAgdmFyIHRocm93biA9IHJlY29yZC5hcmc7XG4gICAgICAgICAgICByZXNldFRyeUV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O1xuICAgIGNvbnN0IGVuZHBvaW50ID0gcXVlcnlCdWlsZGVyKGJhc2VFbmRwb2ludCwgZmlsdGVycyk7XG5cbiAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgICBheGlvcy5nZXQoXG4gICAgICAgICAgICBlbmRwb2ludCxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB3aXRoQ3JlZGVudGlhbHM6IHRydWUsXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgICAgICAncGluYXRhX2FwaV9rZXknOiBwaW5hdGFBcGlLZXksXG4gICAgICAgICAgICAgICAgICAgICdwaW5hdGFfc2VjcmV0X2FwaV9rZXknOiBwaW5hdGFTZWNyZXRBcGlLZXlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KS50aGVuKGZ1bmN0aW9uIChyZXN1bHQpIHtcbiAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzICE9PSAyMDApIHtcbiAgICAgICAgICAgICAgICByZWplY3QobmV3IEVycm9yKGB1bmtub3duIHNlcnZlciByZXNwb25zZSB3aGlsZSBhdHRlbXB0aW5nIHRvIHJldHJpZXZlIHVzZXIgcGluIGxpc3Q6ICR7cmVzdWx0fWApKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc29sdmUocmVzdWx0LmRhdGEpO1xuICAgICAgICB9KS5jYXRjaChmdW5jdGlvbiAoZXJyb3IpIHtcbiAgICAgICAgICAgIGNvbnN0IGZvcm1hdHRlZEVycm9yID0gaGFuZGxlRXJyb3IoZXJyb3IpO1xuICAgICAgICAgICAgcmVqZWN0KGZvcm1hdHRlZEVycm9yKTtcbiAgICAgICAgfSk7XG4gICAgfSk7XG59XG4iLCIvKipcbiAqIFZhbGlkYXRlIGFuZCByZXR1cm4gZGF0YVxuICogQHBhcmFtIHsqfSBkYXRlVG9WYWxpZGF0ZVxuICogQHJldHVybnM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FsdWVzIHdlIHdhbnQgZm9yIHRoZSBxdWVyeSwgYW5kIG5vdGhpbmcgZXh0cmFcblxuICAgICAgICAgICAgICAgIE9iamVjdC5lbnRyaWVzKGZpbHRlcnMubWV0YWRhdGEua2V5dmFsdWVzKS5mb3JFYWNoKChrZXlWYWx1ZSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBrZXkgPSBrZXlWYWx1ZVswXTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSBrZXlWYWx1ZVsxXTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHZhbHVlICE9PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBrZXlWYWx1ZTogJHtrZXl9IGlzIG5vdCBhbiBvYmplY3RgKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoIXZhbHVlIHx8ICF2YWx1ZS52YWx1ZSB8fCAhdmFsdWUub3ApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihga2V5VmFsdWU6ICR7a2V5fSBtdXN0IGhhdmUgYm90aCB2YWx1ZSBhbmQgb3AgYXR0cmlidXRlc2ApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgodHlwZW9mIHZhbHVlLnZhbHVlICE9PSAnc3RyaW5nJykgJiYgKHR5cGVvZiB2YWx1ZS52YWx1ZSAhPT0gJ2Jvb2xlYW4nKSAmJiAodHlwZW9mIHZhbHVlLnZhbHVlICE9PSAnbnVtYmVyJykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignTWV0YWRhdGEga2V5dmFsdWUgdmFsdWVzIG11c3QgYmUgc3RyaW5ncywgYm9vbGVhbnMsIG9yIG51bWJlcnMnKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIC8vIFJ1biBjaGVja3MgdG8gbWFrZSBzdXJlIGFsbCBvZiB0aGUga2V5dmFsdWVzIGFyZSB2YWxpZFxuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHZhbHVlLm9wKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdndCc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJ1bmVkS2V5VmFsdWVzW2tleV0gPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWx1ZS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3A6IHZhbHVlLm9wXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZ3JlYXRlciB0aGFuIG9yIGVxdWFsXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdndGUnOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBydW5lZEtleVZhbHVlc1trZXldID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdmFsdWUudmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wOiB2YWx1ZS5vcFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBsZXNzIHRoYW5cbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2x0JzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcnVuZWRLZXlWYWx1ZXNba2V5XSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHZhbHVlLnZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcDogdmFsdWUub3BcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbGVzcyB0aGFuIG9yIGVxdWFsXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdsdGUnOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBydW5lZEtleVZhbHVlc1trZXldID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdmFsdWUudmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wOiB2YWx1ZS5vcFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBub3QgZXF1YWwgdG9cbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ25lJzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcnVuZWRLZXlWYWx1ZXNba2V5XSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHZhbHVlLnZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcDogdmFsdWUub3BcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZXF1YWwgdG9cbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2VxJzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcnVuZWRLZXlWYWx1ZXNba2V5XSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHZhbHVlLnZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcDogdmFsdWUub3BcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYmV0d2VlblxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnYmV0d2Vlbic6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF2YWx1ZS5zZWNvbmRWYWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYEJlY2F1c2UgYmV0d2VlbiBvcCBjb2RlIHdhcyBwYXNzZWQgaW4sIGtleVZhbHVlOiAke2tleVZhbHVlWzBdfSBtdXN0IGhhdmUgYm90aCBhbHNvIGluY2x1ZGUgYSBzZWNvbmRWYWx1ZWApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHR5cGVvZiB2YWx1ZS5zZWNvbmRWYWx1ZSAhPT0gJ3N0cmluZycpICYmICh0eXBlb2YgdmFsdWUuc2Vjb25kVmFsdWUgIT09ICdib29sZWFuJykgJiYgKHR5cGVvZiB2YWx1ZS5zZWNvbmRWYWx1ZSAhPT0gJ251bWJlcicpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignTWV0YWRhdGEga2V5dmFsdWUgc2Vjb25kVmFsdWUgbXVzdCBiZSBhIHN0cmluZywgYm9vbGVhbiwgb3IgbnVtYmVyJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBydW5lZEtleVZhbHVlc1trZXldID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdmFsdWUudmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wOiB2YWx1ZS5vcCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vjb25kVmFsdWU6IHZhbHVlLnNlY29uZFZhbHVlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vdCBiZXR3ZWVuXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdub3RCZXR3ZWVuJzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXZhbHVlLnNlY29uZFZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgQmVjYXVzZSBub3RCZXR3ZWVuIG9wIGNvZGUgd2FzIHBhc3NlZCBpbiwga2V5VmFsdWU6ICR7a2V5VmFsdWVbMF19IG11c3QgaGF2ZSBib3RoIGFsc28gaW5jbHVkZSBhIHNlY29uZFZhbHVlYCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodHlwZW9mIHZhbHVlLnNlY29uZFZhbHVlICE9PSAnc3RyaW5nJykgJiYgKHR5cGVvZiB2YWx1ZS5zZWNvbmRWYWx1ZSAhPT0gJ2Jvb2xlYW4nKSAmJiAodHlwZW9mIHZhbHVlLnNlY29uZFZhbHVlICE9PSAnbnVtYmVyJykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdNZXRhZGF0YSBrZXl2YWx1ZSBzZWNvbmRWYWx1ZSBtdXN0IGJlIGEgc3RyaW5nLCBib29sZWFuLCBvciBudW1iZXInKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJ1bmVkS2V5VmFsdWVzW2tleV0gPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWx1ZS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3A6IHZhbHVlLm9wLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWNvbmRWYWx1ZTogdmFsdWUuc2Vjb25kVmFsdWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbGlrZVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnbGlrZSc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJ1bmVkS2V5VmFsdWVzW2tleV0gPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWx1ZS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3A6IHZhbHVlLm9wXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vdCBsaWtlXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdub3RMaWtlJzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcnVuZWRLZXlWYWx1ZXNba2V5XSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHZhbHVlLnZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcDogdmFsdWUub3BcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2FzZSBpbnNlbnNpdGl2ZSBsaWtlXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdpTGlrZSc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJ1bmVkS2V5VmFsdWVzW2tleV0gPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWx1ZS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3A6IHZhbHVlLm9wXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNhc2UgaW5zZW5zaXRpdmUgbm90IGxpa2VcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ25vdElMaWtlJzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcnVuZWRLZXlWYWx1ZXNba2V5XSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHZhbHVlLnZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcDogdmFsdWUub3BcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVnZXhcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3JlZ2V4cCc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJ1bmVkS2V5VmFsdWVzW2tleV0gPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWx1ZS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3A6IHZhbHVlLm9wXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNhc2UgaW5zZW5zaXRpdmUgcmVnZXhcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2lSZWdleHAnOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBydW5lZEtleVZhbHVlc1trZXldID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAg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ogaXBmc1Bpbkhhc2hcbiAgICB9O1xuXG4gICAgaWYgKG1ldGFkYXRhLm5hbWUpIHtcbiAgICAgICAgYm9keS5uYW1lID0gbWV0YWRhdGEubmFtZTtcbiAgICB9XG5cbiAgICBpZiAobWV0YWRhdGEua2V5dmFsdWVzKSB7XG4gICAgICAgIGJvZHkua2V5dmFsdWVzID0gbWV0YWRhdGEua2V5dmFsdWVzO1xuICAgIH1cblxuICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICAgIGF4aW9zLnB1dChcbiAgICAgICAgICAgIGVuZHBvaW50LFxuICAgICAgICAgICAgYm9keSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICB3aXRoQ3JlZGVudGlhbHM6IHRydWUsXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgICAgICAncGluYXRhX2FwaV9rZXknOiBwaW5hdGFBcGlLZXksXG4gICAgICAgICAgICAgICAgICAgICdwaW5hdGFfc2VjcmV0X2FwaV9rZXknOiBwaW5hdGFTZWNyZXRBcGlLZXlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KS50aGVuKGZ1bmN0aW9uIChyZXN1bHQpIHtcbiAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzICE9PSAyMDApIHtcbiAgICAgICAgICAgICAgICByZWplY3QobmV3IEVycm9yKGB1bmtub3duIHNlcnZlciByZXNwb25zZSB3aGlsZSBjaGFuZ2luZyBtZXRhZGF0YSBmb3IgaGFzaDogJHtyZXN1bHR9YCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzb2x2ZShyZXN1bHQuZGF0YSk7XG4gICAgICAgIH0pLmNhdGNoKGZ1bmN0aW9uIChlcnJvcikge1xuICAgICAgICAgICAgY29uc3QgZm9ybWF0dGVkRXJyb3IgPSBoYW5kbGVFcnJvcihlcnJvcik7XG4gICAgICAgICAgICByZWplY3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4gICAgICAgICAgICAgICAgdmFsaWRhdGVNZXRhZGF0YShvcHRpb25zLnBpbmF0YU1ldGFkYXRhKTtcbiAgICAgICAgICAgICAgICBkYXRhLmFwcGVuZCgncGluYXRhTWV0YWRhdGEnLCBKU09OLnN0cmluZ2lmeShvcHRpb25zLnBpbmF0YU1ldGFkYXRhKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAob3B0aW9ucy5waW5hdGFPcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgdmFsaWRhdGVQaW5hdGFPcHRpb25zKG9wdGlvbnMucGluYXRhT3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoJ3BpbmF0YU9wdGlvbnMnLCBKU09OLnN0cmluZ2lmeShvcHRpb25zLnBpbmF0YU9wdGlvbnMpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGF4aW9zLnBvc3QoXG4gICAgICAgICAgICBlbmRwb2ludCxcbiAgICAgICAgICAgIGRhdGEsXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgd2l0aENyZWRlbnRpYWxzOiB0cnVlLFxuICAgICAgICAgICAgICAgIG1heENvbnRlbnRMZW5ndGg6ICdJbmZpbml0eScsIC8vdGhpcyBpcyBuZWVkZWQgdG8gcHJldmVudCBheGlvcyBmcm9tIGVycm9yaW5nIG91dCB3aXRoIGxhcmdlIGZpbGVzXG4gICAgICAgICAgICAgICAgbWF4Qm9keUxlbmd0aDogJ0luZmluaXR5JyxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XG4gICAgICAgICAgICAgICAgICAgICdDb250ZW50LXR5cGUnOiBgbXVsdGlwYXJ0L2Zvcm0tZGF0YTsgYm91bmRhcnk9ICR7ZGF0YS5fYm91bmRhcnl9YCxcbiAgICAgICAgICAgICAgICAgICAgJ3BpbmF0YV9hcGlfa2V5JzogcGluYXRhQXBpS2V5LFxuICAgICAgICAgICAgICAgICAgICAncGluYXRh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dGVSZWFkU3RyZWFtKHNvdXJjZVBhdGgpKTtcblxuICAgICAgICAgICAgICAgIGlmIChvcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLnBpbmF0YU1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YWxpZGF0ZU1ldGFkYXRhKG9wdGlvbnMucGluYXRhTWV0YWRhdGEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoJ3BpbmF0YU1ldGFkYXRhJywgSlNPTi5zdHJpbmdpZnkob3B0aW9ucy5waW5hdGFNZXRhZGF0YSkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLnBpbmF0YU9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbGlkYXRlUGluYXRhT3B0aW9ucyhvcHRpb25zLnBpbmF0YU9wdGlvbnMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoJ3BpbmF0YU9wdGlvbnMnLCBKU09OLnN0cmluZ2lmeShvcHRpb25zLnBpbmF0YU9wdGlvbnMpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGF4aW9zLnBvc3QoXG4gICAgICAgICAgICAgICAgICAgIGVuZHBvaW50LFxuICAgICAgICAgICAgICAgICAgICBkYXRhLFxuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3aXRoQ3JlZGVudGlhbHM6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXhDb250ZW50TGVuZ3RoOiAnSW5maW5pdHknLCAvL3RoaXMgaXMgbmVlZGVkIHRvIHByZXZlbnQgYXhpb3MgZnJvbSBlcnJvcmluZyBvdXQgd2l0aCBsYXJnZSBkaXJlY3Rvcmllc1xuICAgICAgICAgICAgICAgICAgICAgICAgbWF4Qm9keUxlbmd0aDogJ0luZmluaXR5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnQ29udGVudC10eXBlJzogYG11bHRpcGFydC9mb3JtLWRhdGE7IGJvdW5kYXJ5PSAke2RhdGEuX2JvdW5kYXJ5fWAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3BpbmF0YV9hcGlfa2V5JzogcGluYXRhQXBpS2V5LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdwaW5hdGFfc2VjcmV0X2FwaV9rZXknOiBwaW5hdGFTZWNyZXRBcGlLZXlcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSkudGhlbihmdW5jdGlvbiAocmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzICE9PSAyMDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChuZXcgRXJyb3IoYHVua25vd24gc2VydmVyIHJlc3BvbnNlIHdoaWxlIHBpbm5pbmcgRmlsZSB0byBJUEZTOiAke3Jlc3VsdH1gKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShyZXN1bHQuZGF0YSk7XG4gICAgICAgICAgICAgICAgfSkuY2F0Y2goZnVuY3Rpb24gKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGZvcm1hdHRlZEVycm9yID0gaGFuZGxlRXJyb3IoZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZm9ybWF0dGVkRXJyb3IpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZWN1cnNpdmUucmVhZGRpcnIoc291cmNlUGF0aCwgZnVuY3Rpb24gKGVyciwgZGlycywgZmlsZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KG5ldyBFcnJvcihlcnIpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGxldCBkYXRhID0gbmV3IE5vZGVGb3JtRGF0YSgpO1xuXG4gICAgICAgICAgICAgICAgICAgIGZpbGVzLmZvckVhY2goKGZpbGUpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZm9yIGVhY2ggZmlsZSBzdHJlYW0sIHdlIG5lZWQgdG8gaW5jbHVkZSB0aGUgY29ycmVjdCByZWxhdGl2ZSBmaWxlIHBhdGhcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKCdmaWxlJywgZnMuY3JlYXRlUmVhZFN0cmVhbShmaWxlKSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVwYXRoOiBiYXNlUGF0aENvbnZlcnRlcihzb3VyY2VQYXRoLCBmaWxlKVxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5waW5hdGFNZXRhZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbGlkYXRlTWV0YWRhdGEob3B0aW9ucy5waW5hdGFNZXRhZGF0YSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoJ3BpbmF0YU1ldGFkYXRhJywgSlNPTi5zdHJpbmdpZnkob3B0aW9ucy5waW5hdGFNZXRhZGF0YSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMucGluYXRhT3B0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbGlkYXRlUGluYXRhT3B0aW9ucyhvcHRpb25zLnBpbmF0YU9wdGlvbnMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKCdwaW5hdGFPcHRpb25zJywgSlNPTi5zdHJpbmdpZnkob3B0aW9ucy5waW5hdGFPcHRpb25zKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBheGlvcy5wb3N0KFxuICAgICAgICAgICAgICAgICAgICAgICAgZW5kcG9pbnQsXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhLFxuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhDcmVkZW50aWFsczogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhDb250ZW50TGVuZ3RoOiAnSW5maW5pdHknLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heEJvZHlMZW5ndGg6ICdJbmZpbml0eScsIC8vdGhpcyBpcyBuZWVkZWQgdG8gcHJldmVudCBheGlvcyBmcm9tIGVycm9yaW5nIG91dCB3aXRoIGxhcmdlIGRpcmVjdG9yaWVzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnQ29udGVudC10eXBlJzogYG11bHRpcGFydC9mb3JtLWRhdGE7IGJvdW5kYXJ5PSAke2RhdGEuX2JvdW5kYXJ5fWAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdwaW5hdGFfYXBpX2tleSc6IHBpbmF0YUFwaUtleSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3BpbmF0YV9zZWNyZXRfYXBpX2tleSc6IHBpbmF0YVNlY3JldEFwaUtleVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAg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NvbnN0IGVuZHBvaW50ID0gYCR7YmFzZVVybH0vcGlubmluZy9waW5KU09OVG9JUEZTYDtcblxuICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICAgIGF4aW9zLnBvc3QoXG4gICAgICAgICAgICBlbmRwb2ludCxcbiAgICAgICAgICAgIHJlcXVlc3RCb2R5LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHdpdGhDcmVkZW50aWFsczogdHJ1ZSxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XG4gICAgICAgICAgICAgICAgICAgICdwaW5hdGFfYXBpX2tleSc6IHBpbmF0YUFwaUtleSxcbiAgICAgICAgICAgICAgICAgICAgJ3BpbmF0YV9zZWNyZXRfYXBpX2tleSc6IHBpbmF0YVNlY3JldEFwaUtleVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pLnRoZW4oZnVuY3Rpb24gKHJlc3VsdCkge1xuICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgIT09IDIwMCkge1xuICAgICAgICAgICAgICAgIHJlamVjdChuZXcgRXJyb3IoYHVua25vd24gc2VydmVyIHJlc3BvbnNlIHdoaWxlIHBpbm5pbmcgSlNPTiB0byBJUEZTOiAke3Jlc3VsdH1gKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXNvbHZlKHJlc3VsdC5kYXRhKTtcbiAgICAgICAgfSkuY2F0Y2goZnVuY3Rpb24gKGVycm9yKSB7XG4gICAgICAgICAgICBjb25zdCBmb3JtYXR0ZWRFcnJvciA9IGhhbmRsZUVycm9yKGVycm9yKTtcbiAgICAgICAgICAgIHJlamVjdChmb3JtYXR0ZWRFcnJvcik7XG4gICAgICAgIH0pO1xuICAgIH0pO1xufVxuIiwiaW1wb3J0IGF4aW9zIGZyb20gJ2F4aW9zJztcbmltcG9ydCB7IGJhc2VVcmwgfSBmcm9tICcuLy4uLy4uLy4uL2Nvb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pcmUoXCJ6bGliXCIpOyJdLCJzb3VyY2VSb290IjoiIn0= /***/ }), -/***/ 6545: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 78969: +/***/ ((module) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +module.exports = asPromise; -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); +/** + * Callback as used by {@link util.asPromise}. + * @typedef asPromiseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {...*} params Additional arguments + * @returns {undefined} + */ -const createCp = configure.configure(api => { - async function cp(sources, destination, options = {}) { - const sourceArr = Array.isArray(sources) ? sources : [sources]; - const res = await api.post('files/cp', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: sourceArr.concat(destination).map(src => cid.CID.asCID(src) ? `/ipfs/${ src }` : src), - ...options - }), - headers: options.headers +/** + * Returns a promise from a node-style callback function. + * @memberof util + * @param {asPromiseCallback} fn Function to call + * @param {*} ctx Function context + * @param {...*} params Function arguments + * @returns {Promise<*>} Promisified function + */ +function asPromise(fn, ctx/*, varargs */) { + var params = new Array(arguments.length - 1), + offset = 0, + index = 2, + pending = true; + while (index < arguments.length) + params[offset++] = arguments[index++]; + return new Promise(function executor(resolve, reject) { + params[offset] = function callback(err/*, varargs */) { + if (pending) { + pending = false; + if (err) + reject(err); + else { + var params = new Array(arguments.length - 1), + offset = 0; + while (offset < params.length) + params[offset++] = arguments[offset]; + resolve.apply(null, params); + } + } + }; + try { + fn.apply(ctx || null, params); + } catch (err) { + if (pending) { + pending = false; + reject(err); + } + } }); - await res.text(); - } - return cp; -}); - -exports.createCp = createCp; +} /***/ }), -/***/ 43346: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ 57738: +/***/ ((__unused_webpack_module, exports) => { -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -const createFlush = configure.configure(api => { - async function flush(path, options = {}) { - if (!path || typeof path !== 'string') { - throw new Error('ipfs.files.flush requires a path'); - } - const res = await api.post('files/flush', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: path, - ...options - }), - headers: options.headers - }); - const data = await res.json(); - return cid.CID.parse(data.Cid); - } - return flush; -}); -exports.createFlush = createFlush; +/** + * A minimal base64 implementation for number arrays. + * @memberof util + * @namespace + */ +var base64 = exports; +/** + * Calculates the byte length of a base64 encoded string. + * @param {string} string Base64 encoded string + * @returns {number} Byte length + */ +base64.length = function length(string) { + var p = string.length; + if (!p) + return 0; + var n = 0; + while (--p % 4 > 1 && string.charAt(p) === "=") + ++n; + return Math.ceil(string.length * 3) / 4 - n; +}; -/***/ }), +// Base64 encoding table +var b64 = new Array(64); -/***/ 35976: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// Base64 decoding table +var s64 = new Array(123); -"use strict"; +// 65..90, 97..122, 48..57, 43, 47 +for (var i = 0; i < 64;) + s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; +/** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ +base64.encode = function encode(buffer, start, end) { + var parts = null, + chunk = []; + var i = 0, // output index + j = 0, // goto index + t; // temporary + while (start < end) { + var b = buffer[start++]; + switch (j) { + case 0: + chunk[i++] = b64[b >> 2]; + t = (b & 3) << 4; + j = 1; + break; + case 1: + chunk[i++] = b64[t | b >> 4]; + t = (b & 15) << 2; + j = 2; + break; + case 2: + chunk[i++] = b64[t | b >> 6]; + chunk[i++] = b64[b & 63]; + j = 0; + break; + } + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (j) { + chunk[i++] = b64[t]; + chunk[i++] = 61; + if (j === 1) + chunk[i++] = 61; + } + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); +var invalidEncoding = "invalid encoding"; -var chmod = __nccwpck_require__(48771); -var cp = __nccwpck_require__(6545); -var flush = __nccwpck_require__(43346); -var ls = __nccwpck_require__(76291); -var mkdir = __nccwpck_require__(40643); -var mv = __nccwpck_require__(64840); -var read = __nccwpck_require__(42085); -var rm = __nccwpck_require__(33848); -var stat = __nccwpck_require__(74168); -var touch = __nccwpck_require__(91068); -var write = __nccwpck_require__(66447); - -function createFiles(config) { - return { - chmod: chmod.createChmod(config), - cp: cp.createCp(config), - flush: flush.createFlush(config), - ls: ls.createLs(config), - mkdir: mkdir.createMkdir(config), - mv: mv.createMv(config), - read: read.createRead(config), - rm: rm.createRm(config), - stat: stat.createStat(config), - touch: touch.createTouch(config), - write: write.createWrite(config) - }; -} +/** + * Decodes a base64 encoded string to a buffer. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ +base64.decode = function decode(string, buffer, offset) { + var start = offset; + var j = 0, // goto index + t; // temporary + for (var i = 0; i < string.length;) { + var c = string.charCodeAt(i++); + if (c === 61 && j > 1) + break; + if ((c = s64[c]) === undefined) + throw Error(invalidEncoding); + switch (j) { + case 0: + t = c; + j = 1; + break; + case 1: + buffer[offset++] = t << 2 | (c & 48) >> 4; + t = c; + j = 2; + break; + case 2: + buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; + t = c; + j = 3; + break; + case 3: + buffer[offset++] = (t & 3) << 6 | c; + j = 0; + break; + } + } + if (j === 1) + throw Error(invalidEncoding); + return offset - start; +}; -exports.createFiles = createFiles; +/** + * Tests if the specified string appears to be base64 encoded. + * @param {string} string String to test + * @returns {boolean} `true` if probably base64 encoded, otherwise false + */ +base64.test = function test(string) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); +}; /***/ }), -/***/ 76291: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 62403: +/***/ ((module) => { -"use strict"; +module.exports = EventEmitter; -Object.defineProperty(exports, "__esModule", ({ value: true })); +/** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ +function EventEmitter() { -var cid = __nccwpck_require__(24247); -var objectToCamelWithMetadata = __nccwpck_require__(28060); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); + /** + * Registered listeners. + * @type {Object.} + * @private + */ + this._listeners = {}; +} -const createLs = configure.configure(api => { - async function* ls(path, options = {}) { - if (!path) { - throw new Error('ipfs.files.ls requires a path'); - } - const res = await api.post('files/ls', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: cid.CID.asCID(path) ? `/ipfs/${ path }` : path, - long: true, - ...options, - stream: true - }), - headers: options.headers +/** + * Registers an event listener. + * @param {string} evt Event name + * @param {function} fn Listener + * @param {*} [ctx] Listener context + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.on = function on(evt, fn, ctx) { + (this._listeners[evt] || (this._listeners[evt] = [])).push({ + fn : fn, + ctx : ctx || this }); - for await (const result of res.ndjson()) { - if ('Entries' in result) { - for (const entry of result.Entries || []) { - yield toCoreInterface(objectToCamelWithMetadata.objectToCamelWithMetadata(entry)); + return this; +}; + +/** + * Removes an event listener or any matching listeners if arguments are omitted. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.off = function off(evt, fn) { + if (evt === undefined) + this._listeners = {}; + else { + if (fn === undefined) + this._listeners[evt] = []; + else { + var listeners = this._listeners[evt]; + for (var i = 0; i < listeners.length;) + if (listeners[i].fn === fn) + listeners.splice(i, 1); + else + ++i; } - } else { - yield toCoreInterface(objectToCamelWithMetadata.objectToCamelWithMetadata(result)); - } } - } - return ls; -}); -function toCoreInterface(entry) { - if (entry.hash) { - entry.cid = cid.CID.parse(entry.hash); - } - delete entry.hash; - entry.type = entry.type === 1 ? 'directory' : 'file'; - return entry; -} + return this; +}; -exports.createLs = createLs; +/** + * Emits an event by calling its listeners with the specified arguments. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {util.EventEmitter} `this` + */ +EventEmitter.prototype.emit = function emit(evt) { + var listeners = this._listeners[evt]; + if (listeners) { + var args = [], + i = 1; + for (; i < arguments.length;) + args.push(arguments[i++]); + for (i = 0; i < listeners.length;) + listeners[i].fn.apply(listeners[i++].ctx, args); + } + return this; +}; /***/ }), -/***/ 40643: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ 44775: +/***/ ((module) => { -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -const createMkdir = configure.configure(api => { - async function mkdir(path, options = {}) { - const res = await api.post('files/mkdir', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: path, - ...options - }), - headers: options.headers - }); - await res.text(); - } - return mkdir; -}); -exports.createMkdir = createMkdir; +module.exports = factory(factory); +/** + * Reads / writes floats / doubles from / to buffers. + * @name util.float + * @namespace + */ -/***/ }), +/** + * Writes a 32 bit float to a buffer using little endian byte order. + * @name util.float.writeFloatLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ -/***/ 64840: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/** + * Writes a 32 bit float to a buffer using big endian byte order. + * @name util.float.writeFloatBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ -"use strict"; +/** + * Reads a 32 bit float from a buffer using little endian byte order. + * @name util.float.readFloatLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ +/** + * Reads a 32 bit float from a buffer using big endian byte order. + * @name util.float.readFloatBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); +/** + * Writes a 64 bit double to a buffer using little endian byte order. + * @name util.float.writeDoubleLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); +/** + * Writes a 64 bit double to a buffer using big endian byte order. + * @name util.float.writeDoubleBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ -const createMv = configure.configure(api => { - async function mv(sources, destination, options = {}) { - if (!Array.isArray(sources)) { - sources = [sources]; - } - const res = await api.post('files/mv', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: sources.concat(destination), - ...options - }), - headers: options.headers - }); - await res.text(); - } - return mv; -}); +/** + * Reads a 64 bit double from a buffer using little endian byte order. + * @name util.float.readDoubleLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ -exports.createMv = createMv; +/** + * Reads a 64 bit double from a buffer using big endian byte order. + * @name util.float.readDoubleBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ +// Factory function for the purpose of node-based testing in modified global environments +function factory(exports) { -/***/ }), + // float: typed array + if (typeof Float32Array !== "undefined") (function() { -/***/ 42085: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + var f32 = new Float32Array([ -0 ]), + f8b = new Uint8Array(f32.buffer), + le = f8b[3] === 128; -"use strict"; + function writeFloat_f32_cpy(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + } + function writeFloat_f32_rev(val, buf, pos) { + f32[0] = val; + buf[pos ] = f8b[3]; + buf[pos + 1] = f8b[2]; + buf[pos + 2] = f8b[1]; + buf[pos + 3] = f8b[0]; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + /* istanbul ignore next */ + exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; + /* istanbul ignore next */ + exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var toIterable = __nccwpck_require__(79546); + function readFloat_f32_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + return f32[0]; + } -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + function readFloat_f32_rev(buf, pos) { + f8b[3] = buf[pos ]; + f8b[2] = buf[pos + 1]; + f8b[1] = buf[pos + 2]; + f8b[0] = buf[pos + 3]; + return f32[0]; + } -var toIterable__default = /*#__PURE__*/_interopDefaultLegacy(toIterable); + /* istanbul ignore next */ + exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; + /* istanbul ignore next */ + exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; -const createRead = configure.configure(api => { - async function* read(path, options = {}) { - const res = await api.post('files/read', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: path, - count: options.length, - ...options - }), - headers: options.headers - }); - yield* toIterable__default["default"](res.body); - } - return read; -}); + // float: ieee754 + })(); else (function() { -exports.createRead = createRead; + function writeFloat_ieee754(writeUint, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); + else if (isNaN(val)) + writeUint(2143289344, buf, pos); + else if (val > 3.4028234663852886e+38) // +-Infinity + writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); + else if (val < 1.1754943508222875e-38) // denormal + writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); + else { + var exponent = Math.floor(Math.log(val) / Math.LN2), + mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; + writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); + } + } + exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); + exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); -/***/ }), + function readFloat_ieee754(readUint, buf, pos) { + var uint = readUint(buf, pos), + sign = (uint >> 31) * 2 + 1, + exponent = uint >>> 23 & 255, + mantissa = uint & 8388607; + return exponent === 255 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 1.401298464324817e-45 * mantissa + : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); + } -/***/ 33848: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); + exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); -"use strict"; + })(); + // double: typed array + if (typeof Float64Array !== "undefined") (function() { -Object.defineProperty(exports, "__esModule", ({ value: true })); + var f64 = new Float64Array([-0]), + f8b = new Uint8Array(f64.buffer), + le = f8b[7] === 128; -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var HTTP = __nccwpck_require__(24335); + function writeDouble_f64_cpy(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + buf[pos + 4] = f8b[4]; + buf[pos + 5] = f8b[5]; + buf[pos + 6] = f8b[6]; + buf[pos + 7] = f8b[7]; + } -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + function writeDouble_f64_rev(val, buf, pos) { + f64[0] = val; + buf[pos ] = f8b[7]; + buf[pos + 1] = f8b[6]; + buf[pos + 2] = f8b[5]; + buf[pos + 3] = f8b[4]; + buf[pos + 4] = f8b[3]; + buf[pos + 5] = f8b[2]; + buf[pos + 6] = f8b[1]; + buf[pos + 7] = f8b[0]; + } -var HTTP__default = /*#__PURE__*/_interopDefaultLegacy(HTTP); + /* istanbul ignore next */ + exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; + /* istanbul ignore next */ + exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; -const createRm = configure.configure(api => { - async function rm(path, options = {}) { - const res = await api.post('files/rm', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: path, - ...options - }), - headers: options.headers - }); - const body = await res.text(); - if (body !== '') { - const error = new HTTP__default["default"].HTTPError(res); - error.message = body; - throw error; - } - } - return rm; -}); + function readDouble_f64_cpy(buf, pos) { + f8b[0] = buf[pos ]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + f8b[4] = buf[pos + 4]; + f8b[5] = buf[pos + 5]; + f8b[6] = buf[pos + 6]; + f8b[7] = buf[pos + 7]; + return f64[0]; + } -exports.createRm = createRm; + function readDouble_f64_rev(buf, pos) { + f8b[7] = buf[pos ]; + f8b[6] = buf[pos + 1]; + f8b[5] = buf[pos + 2]; + f8b[4] = buf[pos + 3]; + f8b[3] = buf[pos + 4]; + f8b[2] = buf[pos + 5]; + f8b[1] = buf[pos + 6]; + f8b[0] = buf[pos + 7]; + return f64[0]; + } + /* istanbul ignore next */ + exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; + /* istanbul ignore next */ + exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; -/***/ }), + // double: ieee754 + })(); else (function() { -/***/ 74168: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) { + writeUint(0, buf, pos + off0); + writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); + } else if (isNaN(val)) { + writeUint(0, buf, pos + off0); + writeUint(2146959360, buf, pos + off1); + } else if (val > 1.7976931348623157e+308) { // +-Infinity + writeUint(0, buf, pos + off0); + writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); + } else { + var mantissa; + if (val < 2.2250738585072014e-308) { // denormal + mantissa = val / 5e-324; + writeUint(mantissa >>> 0, buf, pos + off0); + writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); + } else { + var exponent = Math.floor(Math.log(val) / Math.LN2); + if (exponent === 1024) + exponent = 1023; + mantissa = val * Math.pow(2, -exponent); + writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); + writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); + } + } + } -"use strict"; + exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); + exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); + function readDouble_ieee754(readUint, off0, off1, buf, pos) { + var lo = readUint(buf, pos + off0), + hi = readUint(buf, pos + off1); + var sign = (hi >> 31) * 2 + 1, + exponent = hi >>> 20 & 2047, + mantissa = 4294967296 * (hi & 1048575) + lo; + return exponent === 2047 + ? mantissa + ? NaN + : sign * Infinity + : exponent === 0 // denormal + ? sign * 5e-324 * mantissa + : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); + exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); -var cid = __nccwpck_require__(24247); -var objectToCamelWithMetadata = __nccwpck_require__(28060); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); + })(); -const createStat = configure.configure(api => { - async function stat(path, options = {}) { - const res = await api.post('files/stat', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: path, - ...options - }), - headers: options.headers - }); - const data = await res.json(); - data.WithLocality = data.WithLocality || false; - return toCoreInterface(objectToCamelWithMetadata.objectToCamelWithMetadata(data)); - } - return stat; -}); -function toCoreInterface(entry) { - entry.cid = cid.CID.parse(entry.hash); - delete entry.hash; - return entry; + return exports; } -exports.createStat = createStat; - - -/***/ }), - -/***/ 91068: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - +// uint helpers -Object.defineProperty(exports, "__esModule", ({ value: true })); +function writeUintLE(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); +function writeUintBE(val, buf, pos) { + buf[pos ] = val >>> 24; + buf[pos + 1] = val >>> 16 & 255; + buf[pos + 2] = val >>> 8 & 255; + buf[pos + 3] = val & 255; +} -const createTouch = configure.configure(api => { - async function touch(path, options = {}) { - const res = await api.post('files/touch', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: path, - ...options - }), - headers: options.headers - }); - await res.text(); - } - return touch; -}); +function readUintLE(buf, pos) { + return (buf[pos ] + | buf[pos + 1] << 8 + | buf[pos + 2] << 16 + | buf[pos + 3] << 24) >>> 0; +} -exports.createTouch = createTouch; +function readUintBE(buf, pos) { + return (buf[pos ] << 24 + | buf[pos + 1] << 16 + | buf[pos + 2] << 8 + | buf[pos + 3]) >>> 0; +} /***/ }), -/***/ 66447: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - +/***/ 43287: +/***/ ((module) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -var modeToString = __nccwpck_require__(87513); -var parseMtime = __nccwpck_require__(68414); -var configure = __nccwpck_require__(31775); -var multipartRequest = __nccwpck_require__(87527); -var toUrlSearchParams = __nccwpck_require__(52836); -var abortSignal = __nccwpck_require__(14594); -var nativeAbortController = __nccwpck_require__(43586); - -const createWrite = configure.configure(api => { - async function write(path, input, options = {}) { - const controller = new nativeAbortController.AbortController(); - const signal = abortSignal.abortSignal(controller.signal, options.signal); - const res = await api.post('files/write', { - signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: path, - streamChannels: true, - count: options.length, - ...options - }), - ...await multipartRequest.multipartRequest([{ - content: input, - path: 'arg', - mode: modeToString.modeToString(options.mode), - mtime: parseMtime.parseMtime(options.mtime) - }], controller, options.headers) - }); - await res.text(); - } - return write; -}); +module.exports = inquire; -exports.createWrite = createWrite; +/** + * Requires a module only if available. + * @memberof util + * @param {string} moduleName Module to require + * @returns {?Object} Required module if available and not empty, otherwise `null` + */ +function inquire(moduleName) { + try { + var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval + if (mod && (mod.length || Object.keys(mod).length)) + return mod; + } catch (e) {} // eslint-disable-line no-empty + return null; +} /***/ }), -/***/ 89338: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 52487: +/***/ ((module) => { -"use strict"; +module.exports = pool; -Object.defineProperty(exports, "__esModule", ({ value: true })); +/** + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ -var configure = __nccwpck_require__(31775); +/** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ -const createGetEndpointConfig = configure.configure(api => { - return () => { - const url = new URL(api.opts.base || ''); - return { - host: url.hostname, - port: url.port, - protocol: url.protocol, - pathname: url.pathname, - 'api-path': url.pathname +/** + * A general purpose buffer pool. + * @memberof util + * @function + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer + * @param {number} [size=8192] Slab size + * @returns {PoolAllocator} Pooled allocator + */ +function pool(alloc, slice, size) { + var SIZE = size || 8192; + var MAX = SIZE >>> 1; + var slab = null; + var offset = SIZE; + return function pool_alloc(size) { + if (size < 1 || size > MAX) + return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + var buf = slice.call(slab, offset, offset += size); + if (offset & 7) // align to 32 bit + offset = (offset | 7) + 1; + return buf; }; - }; -}); - -exports.createGetEndpointConfig = createGetEndpointConfig; +} /***/ }), -/***/ 31471: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 32581: +/***/ ((__unused_webpack_module, exports) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); +/** + * A minimal UTF8 implementation for number arrays. + * @memberof util + * @namespace + */ +var utf8 = exports; -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +utf8.length = function utf8_length(string) { + var len = 0, + c = 0; + for (var i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) + len += 1; + else if (c < 2048) + len += 2; + else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { + ++i; + len += 4; + } else + len += 3; + } + return len; +}; -const createGet = configure.configure(api => { - async function* get(path, options = {}) { - const opts = { - arg: `${ path instanceof Uint8Array ? cid.CID.decode(path) : path }`, - ...options - }; - if (opts.compressionLevel) { - opts['compression-level'] = opts.compressionLevel; - delete opts.compressionLevel; +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +utf8.read = function utf8_read(buffer, start, end) { + var len = end - start; + if (len < 1) + return ""; + var parts = null, + chunk = [], + i = 0, // char offset + t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) + chunk[i++] = t; + else if (t > 191 && t < 224) + chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; + else if (t > 239 && t < 365) { + t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; + chunk[i++] = 0xD800 + (t >> 10); + chunk[i++] = 0xDC00 + (t & 1023); + } else + chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } } - const res = await api.post('get', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(opts), - headers: options.headers - }); - yield* res.iterator(); - } - return get; -}); + if (parts) { + if (i) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +}; -exports.createGet = createGet; +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +utf8.write = function utf8_write(string, buffer, offset) { + var start = offset, + c1, // character 1 + c2; // character 2 + for (var i = 0; i < string.length; ++i) { + c1 = string.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { + c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); + ++i; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return offset - start; +}; /***/ }), -/***/ 15192: +/***/ 34527: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var objectToCamel = __nccwpck_require__(62268); -var multiaddr = __nccwpck_require__(78025); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createId = configure.configure(api => { - async function id(options = {}) { - const res = await api.post('id', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: options.peerId ? options.peerId.toString() : undefined, - ...options - }), - headers: options.headers - }); - const data = await res.json(); - const output = { ...objectToCamel.objectToCamel(data) }; - if (output.addresses) { - output.addresses = output.addresses.map(ma => new multiaddr.Multiaddr(ma)); +exports.AbortController = void 0; +const AbortSignal_1 = __nccwpck_require__(70175); +class AbortController { + constructor() { + this.signal = new AbortSignal_1.AbortSignal(); } - return output; - } - return id; -}); - -exports.createId = createId; + abort() { + this.signal.abort(); + } +} +exports.AbortController = AbortController; /***/ }), -/***/ 21719: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 70175: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); - -var multibases = __nccwpck_require__(61560); -var multicodecs = __nccwpck_require__(83319); -var multihashes = __nccwpck_require__(5529); -var dagPB = __nccwpck_require__(72532); -var dagCBOR = __nccwpck_require__(89778); -var dagJSON = __nccwpck_require__(46777); -var identity = __nccwpck_require__(53863); -var basics = __nccwpck_require__(42916); -var index = __nccwpck_require__(60138); -var index$1 = __nccwpck_require__(54826); -var index$2 = __nccwpck_require__(37723); -var index$3 = __nccwpck_require__(95499); -var index$4 = __nccwpck_require__(71168); -var index$5 = __nccwpck_require__(57135); -var index$6 = __nccwpck_require__(19433); -var index$7 = __nccwpck_require__(35976); -var index$8 = __nccwpck_require__(66007); -var index$9 = __nccwpck_require__(85077); -var index$a = __nccwpck_require__(8302); -var index$b = __nccwpck_require__(64980); -var index$c = __nccwpck_require__(1115); -var index$d = __nccwpck_require__(38248); -var index$e = __nccwpck_require__(50782); -var index$f = __nccwpck_require__(65381); -var index$g = __nccwpck_require__(39825); -var index$h = __nccwpck_require__(8697); -var add = __nccwpck_require__(26151); -var addAll = __nccwpck_require__(44713); -var cat = __nccwpck_require__(84000); -var commands = __nccwpck_require__(27154); -var dns = __nccwpck_require__(1503); -var getEndpointConfig = __nccwpck_require__(89338); -var get = __nccwpck_require__(31471); -var id = __nccwpck_require__(15192); -var isOnline = __nccwpck_require__(5426); -var ls = __nccwpck_require__(97506); -var mount = __nccwpck_require__(75785); -var ping = __nccwpck_require__(25466); -var resolve = __nccwpck_require__(38587); -var start = __nccwpck_require__(86476); -var stop = __nccwpck_require__(94121); -var version = __nccwpck_require__(93620); -var globSourceImport = __nccwpck_require__(23905); -var cid = __nccwpck_require__(24247); -var multiaddr = __nccwpck_require__(78025); -var urlSource_js = __nccwpck_require__(74676); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } +exports.AbortSignal = void 0; +class AbortSignal { + constructor() { + this.onabort = null; + this._aborted = false; + Object.defineProperty(this, "_aborted", { + value: false, + writable: true, }); - } - }); - } - n["default"] = e; - return Object.freeze(n); -} - -var dagPB__namespace = /*#__PURE__*/_interopNamespace(dagPB); -var dagCBOR__namespace = /*#__PURE__*/_interopNamespace(dagCBOR); -var dagJSON__namespace = /*#__PURE__*/_interopNamespace(dagJSON); -var globSourceImport__default = /*#__PURE__*/_interopDefaultLegacy(globSourceImport); -var urlSource_js__default = /*#__PURE__*/_interopDefaultLegacy(urlSource_js); - -function create(options = {}) { - const id$1 = { - name: identity.identity.name, - code: identity.identity.code, - encode: id => id, - decode: id => id - }; - const multibaseCodecs = Object.values(basics.bases); - (options.ipld && options.ipld.bases ? options.ipld.bases : []).forEach(base => multibaseCodecs.push(base)); - const multibases$1 = new multibases.Multibases({ - bases: multibaseCodecs, - loadBase: options.ipld && options.ipld.loadBase - }); - const blockCodecs = Object.values(basics.codecs); - [ - dagPB__namespace, - dagCBOR__namespace, - dagJSON__namespace, - id$1 - ].concat(options.ipld && options.ipld.codecs || []).forEach(codec => blockCodecs.push(codec)); - const multicodecs$1 = new multicodecs.Multicodecs({ - codecs: blockCodecs, - loadCodec: options.ipld && options.ipld.loadCodec - }); - const multihashHashers = Object.values(basics.hashes); - (options.ipld && options.ipld.hashers ? options.ipld.hashers : []).forEach(hasher => multihashHashers.push(hasher)); - const multihashes$1 = new multihashes.Multihashes({ - hashers: multihashHashers, - loadHasher: options.ipld && options.ipld.loadHasher - }); - const client = { - add: add.createAdd(options), - addAll: addAll.createAddAll(options), - bitswap: index.createBitswap(options), - block: index$1.createBlock(options), - bootstrap: index$2.createBootstrap(options), - cat: cat.createCat(options), - commands: commands.createCommands(options), - config: index$3.createConfig(options), - dag: index$4.createDag(multicodecs$1, options), - dht: index$5.createDht(options), - diag: index$6.createDiag(options), - dns: dns.createDns(options), - files: index$7.createFiles(options), - get: get.createGet(options), - getEndpointConfig: getEndpointConfig.createGetEndpointConfig(options), - id: id.createId(options), - isOnline: isOnline.createIsOnline(options), - key: index$8.createKey(options), - log: index$9.createLog(options), - ls: ls.createLs(options), - mount: mount.createMount(options), - name: index$a.createName(options), - object: index$b.createObject(multicodecs$1, options), - pin: index$c.createPin(options), - ping: ping.createPing(options), - pubsub: index$d.createPubsub(options), - refs: index$e.createRefs(options), - repo: index$f.createRepo(options), - resolve: resolve.createResolve(options), - start: start.createStart(options), - stats: index$g.createStats(options), - stop: stop.createStop(options), - swarm: index$h.createSwarm(options), - version: version.createVersion(options), - bases: multibases$1, - codecs: multicodecs$1, - hashers: multihashes$1 - }; - return client; + } + get aborted() { + return this._aborted; + } + abort() { + this._aborted = true; + if (this.onabort) { + this.onabort(this); + this.onabort = null; + } + } } -const globSource = globSourceImport__default["default"]; - -Object.defineProperty(exports, "CID", ({ - enumerable: true, - get: function () { return cid.CID; } -})); -Object.defineProperty(exports, "multiaddr", ({ - enumerable: true, - get: function () { return multiaddr.Multiaddr; } -})); -Object.defineProperty(exports, "urlSource", ({ - enumerable: true, - get: function () { return urlSource_js__default["default"]; } -})); -exports.create = create; -exports.globSource = globSource; +exports.AbortSignal = AbortSignal; /***/ }), -/***/ 5426: +/***/ 93251: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var id = __nccwpck_require__(15192); - -const createIsOnline = options => { - const id$1 = id.createId(options); - async function isOnline(options = {}) { - const res = await id$1(options); - return Boolean(res && res.addresses && res.addresses.length); - } - return isOnline; -}; - -exports.createIsOnline = createIsOnline; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(34527), exports); +tslib_1.__exportStar(__nccwpck_require__(70175), exports); /***/ }), -/***/ 89160: +/***/ 72010: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var errCode = __nccwpck_require__(5822); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); - -const createExport = configure.configure(api => { - const exportKey = async (name, password, options = {}) => { - throw errCode__default["default"](new Error('Not implemented'), 'ERR_NOT_IMPLEMENTED'); - }; - return exportKey; -}); - -exports.createExport = createExport; +exports.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = exports.DEFAULT_USE_DUALSTACK_ENDPOINT = exports.CONFIG_USE_DUALSTACK_ENDPOINT = exports.ENV_USE_DUALSTACK_ENDPOINT = void 0; +const util_config_provider_1 = __nccwpck_require__(54822); +exports.ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT"; +exports.CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint"; +exports.DEFAULT_USE_DUALSTACK_ENDPOINT = false; +exports.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => (0, util_config_provider_1.booleanSelector)(env, exports.ENV_USE_DUALSTACK_ENDPOINT, util_config_provider_1.SelectorType.ENV), + configFileSelector: (profile) => (0, util_config_provider_1.booleanSelector)(profile, exports.CONFIG_USE_DUALSTACK_ENDPOINT, util_config_provider_1.SelectorType.CONFIG), + default: false, +}; /***/ }), -/***/ 22932: +/***/ 71474: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var objectToCamel = __nccwpck_require__(62268); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createGen = configure.configure(api => { - async function gen(name, options = { - type: 'rsa', - size: 2048 - }) { - const res = await api.post('key/gen', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: name, - ...options - }), - headers: options.headers - }); - const data = await res.json(); - return objectToCamel.objectToCamel(data); - } - return gen; -}); - -exports.createGen = createGen; +exports.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = exports.DEFAULT_USE_FIPS_ENDPOINT = exports.CONFIG_USE_FIPS_ENDPOINT = exports.ENV_USE_FIPS_ENDPOINT = void 0; +const util_config_provider_1 = __nccwpck_require__(54822); +exports.ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT"; +exports.CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint"; +exports.DEFAULT_USE_FIPS_ENDPOINT = false; +exports.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => (0, util_config_provider_1.booleanSelector)(env, exports.ENV_USE_FIPS_ENDPOINT, util_config_provider_1.SelectorType.ENV), + configFileSelector: (profile) => (0, util_config_provider_1.booleanSelector)(profile, exports.CONFIG_USE_FIPS_ENDPOINT, util_config_provider_1.SelectorType.CONFIG), + default: false, +}; /***/ }), -/***/ 11031: +/***/ 72989: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var objectToCamel = __nccwpck_require__(62268); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createImport = configure.configure(api => { - async function importKey(name, pem, password, options = {}) { - const res = await api.post('key/import', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: name, - pem, - password, - ...options - }), - headers: options.headers - }); - const data = await res.json(); - return objectToCamel.objectToCamel(data); - } - return importKey; -}); - -exports.createImport = createImport; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(72010), exports); +tslib_1.__exportStar(__nccwpck_require__(71474), exports); +tslib_1.__exportStar(__nccwpck_require__(92297), exports); +tslib_1.__exportStar(__nccwpck_require__(62305), exports); /***/ }), -/***/ 66007: +/***/ 92297: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var _export = __nccwpck_require__(89160); -var gen = __nccwpck_require__(22932); -var _import = __nccwpck_require__(11031); -var info = __nccwpck_require__(99925); -var list = __nccwpck_require__(98360); -var rename = __nccwpck_require__(47172); -var rm = __nccwpck_require__(94585); - -function createKey(config) { - return { - export: _export.createExport(config), - gen: gen.createGen(config), - import: _import.createImport(config), - info: info.createInfo(config), - list: list.createList(config), - rename: rename.createRename(config), - rm: rm.createRm(config) - }; -} - -exports.createKey = createKey; +exports.resolveCustomEndpointsConfig = void 0; +const util_middleware_1 = __nccwpck_require__(3626); +const resolveCustomEndpointsConfig = (input) => { + var _a, _b; + const { endpoint, urlParser } = input; + return { + ...input, + tls: (_a = input.tls) !== null && _a !== void 0 ? _a : true, + endpoint: (0, util_middleware_1.normalizeProvider)(typeof endpoint === "string" ? urlParser(endpoint) : endpoint), + isCustomEndpoint: true, + useDualstackEndpoint: (0, util_middleware_1.normalizeProvider)((_b = input.useDualstackEndpoint) !== null && _b !== void 0 ? _b : false), + }; +}; +exports.resolveCustomEndpointsConfig = resolveCustomEndpointsConfig; /***/ }), -/***/ 99925: +/***/ 62305: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var errCode = __nccwpck_require__(5822); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); - -const createInfo = configure.configure(api => { - const info = async (name, options = {}) => { - throw errCode__default["default"](new Error('Not implemented'), 'ERR_NOT_IMPLEMENTED'); - }; - return info; -}); - -exports.createInfo = createInfo; +exports.resolveEndpointsConfig = void 0; +const util_middleware_1 = __nccwpck_require__(3626); +const getEndpointFromRegion_1 = __nccwpck_require__(77857); +const resolveEndpointsConfig = (input) => { + var _a, _b; + const useDualstackEndpoint = (0, util_middleware_1.normalizeProvider)((_a = input.useDualstackEndpoint) !== null && _a !== void 0 ? _a : false); + const { endpoint, useFipsEndpoint, urlParser } = input; + return { + ...input, + tls: (_b = input.tls) !== null && _b !== void 0 ? _b : true, + endpoint: endpoint + ? (0, util_middleware_1.normalizeProvider)(typeof endpoint === "string" ? urlParser(endpoint) : endpoint) + : () => (0, getEndpointFromRegion_1.getEndpointFromRegion)({ ...input, useDualstackEndpoint, useFipsEndpoint }), + isCustomEndpoint: !!endpoint, + useDualstackEndpoint, + }; +}; +exports.resolveEndpointsConfig = resolveEndpointsConfig; /***/ }), -/***/ 98360: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 77857: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); - -var objectToCamel = __nccwpck_require__(62268); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createList = configure.configure(api => { - async function list(options = {}) { - const res = await api.post('key/list', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - }); - const data = await res.json(); - return (data.Keys || []).map(k => objectToCamel.objectToCamel(k)); - } - return list; -}); - -exports.createList = createList; +exports.getEndpointFromRegion = void 0; +const getEndpointFromRegion = async (input) => { + var _a; + const { tls = true } = input; + const region = await input.region(); + const dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); + if (!dnsHostRegex.test(region)) { + throw new Error("Invalid region in client config"); + } + const useDualstackEndpoint = await input.useDualstackEndpoint(); + const useFipsEndpoint = await input.useFipsEndpoint(); + const { hostname } = (_a = (await input.regionInfoProvider(region, { useDualstackEndpoint, useFipsEndpoint }))) !== null && _a !== void 0 ? _a : {}; + if (!hostname) { + throw new Error("Cannot resolve hostname from client config"); + } + return input.urlParser(`${tls ? "https:" : "http:"}//${hostname}`); +}; +exports.getEndpointFromRegion = getEndpointFromRegion; /***/ }), -/***/ 47172: +/***/ 36407: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var objectToCamel = __nccwpck_require__(62268); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createRename = configure.configure(api => { - async function rename(oldName, newName, options = {}) { - const res = await api.post('key/rename', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: [ - oldName, - newName - ], - ...options - }), - headers: options.headers - }); - return objectToCamel.objectToCamel(await res.json()); - } - return rename; -}); - -exports.createRename = createRename; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(72989), exports); +tslib_1.__exportStar(__nccwpck_require__(10073), exports); +tslib_1.__exportStar(__nccwpck_require__(49310), exports); /***/ }), -/***/ 94585: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 73788: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); - -var objectToCamel = __nccwpck_require__(62268); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createRm = configure.configure(api => { - async function rm(name, options = {}) { - const res = await api.post('key/rm', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: name, - ...options - }), - headers: options.headers - }); - const data = await res.json(); - return objectToCamel.objectToCamel(data.Keys[0]); - } - return rm; -}); - -exports.createRm = createRm; +exports.NODE_REGION_CONFIG_FILE_OPTIONS = exports.NODE_REGION_CONFIG_OPTIONS = exports.REGION_INI_NAME = exports.REGION_ENV_NAME = void 0; +exports.REGION_ENV_NAME = "AWS_REGION"; +exports.REGION_INI_NAME = "region"; +exports.NODE_REGION_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[exports.REGION_ENV_NAME], + configFileSelector: (profile) => profile[exports.REGION_INI_NAME], + default: () => { + throw new Error("Region is missing"); + }, +}; +exports.NODE_REGION_CONFIG_FILE_OPTIONS = { + preferredFile: "credentials", +}; /***/ }), -/***/ 14594: +/***/ 41791: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var anySignal = __nccwpck_require__(65618); - -function filter(signals) { - return signals.filter(Boolean); -} -function abortSignal(...signals) { - return anySignal.anySignal(filter(signals)); -} - -exports.abortSignal = abortSignal; +exports.getRealRegion = void 0; +const isFipsRegion_1 = __nccwpck_require__(37754); +const getRealRegion = (region) => (0, isFipsRegion_1.isFipsRegion)(region) + ? ["fips-aws-global", "aws-fips"].includes(region) + ? "us-east-1" + : region.replace(/fips-(dkr-|prod-)?|-fips/, "") + : region; +exports.getRealRegion = getRealRegion; /***/ }), -/***/ 31775: +/***/ 10073: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var core = __nccwpck_require__(66212); - -const configure = fn => { - return options => { - return fn(new core.Client(options), options); - }; -}; - -exports.configure = configure; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(73788), exports); +tslib_1.__exportStar(__nccwpck_require__(50754), exports); /***/ }), -/***/ 66212: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 37754: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); - -var multiaddr = __nccwpck_require__(78025); -var env_js = __nccwpck_require__(48488); -var parseDuration = __nccwpck_require__(35632); -var debug = __nccwpck_require__(58923); -var HTTP = __nccwpck_require__(24335); -var mergeOpts = __nccwpck_require__(79139); -var toUrlString = __nccwpck_require__(4037); -var getAgent = __nccwpck_require__(34290); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var parseDuration__default = /*#__PURE__*/_interopDefaultLegacy(parseDuration); -var debug__default = /*#__PURE__*/_interopDefaultLegacy(debug); -var HTTP__default = /*#__PURE__*/_interopDefaultLegacy(HTTP); -var mergeOpts__default = /*#__PURE__*/_interopDefaultLegacy(mergeOpts); -var getAgent__default = /*#__PURE__*/_interopDefaultLegacy(getAgent); - -const log = debug__default["default"]('ipfs-http-client:lib:error-handler'); -const merge = mergeOpts__default["default"].bind({ ignoreUndefined: true }); -const DEFAULT_PROTOCOL = env_js.isBrowser || env_js.isWebWorker ? location.protocol : 'http'; -const DEFAULT_HOST = env_js.isBrowser || env_js.isWebWorker ? location.hostname : 'localhost'; -const DEFAULT_PORT = env_js.isBrowser || env_js.isWebWorker ? location.port : '5001'; -const normalizeOptions = (options = {}) => { - let url; - let opts = {}; - let agent; - if (typeof options === 'string' || multiaddr.Multiaddr.isMultiaddr(options)) { - url = new URL(toUrlString.toUrlString(options)); - } else if (options instanceof URL) { - url = options; - } else if (typeof options.url === 'string' || multiaddr.Multiaddr.isMultiaddr(options.url)) { - url = new URL(toUrlString.toUrlString(options.url)); - opts = options; - } else if (options.url instanceof URL) { - url = options.url; - opts = options; - } else { - opts = options || {}; - const protocol = (opts.protocol || DEFAULT_PROTOCOL).replace(':', ''); - const host = (opts.host || DEFAULT_HOST).split(':')[0]; - const port = opts.port || DEFAULT_PORT; - url = new URL(`${ protocol }://${ host }:${ port }`); - } - if (opts.apiPath) { - url.pathname = opts.apiPath; - } else if (url.pathname === '/' || url.pathname === undefined) { - url.pathname = 'api/v0'; - } - if (env_js.isNode) { - const Agent = getAgent__default["default"](url); - agent = opts.agent || new Agent({ - keepAlive: true, - maxSockets: 6 - }); - } - return { - ...opts, - host: url.host, - protocol: url.protocol.replace(':', ''), - port: Number(url.port), - apiPath: url.pathname, - url, - agent - }; -}; -const errorHandler = async response => { - let msg; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - try { - while (true) { - const result = await reader.read() - - if (result.done) { - return - } - -<<<<<<< HEAD - yield result.value -======= -exports.Client = Client; -exports.HTTPError = HTTPError; -exports.errorHandler = errorHandler; +exports.isFipsRegion = void 0; +const isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")); +exports.isFipsRegion = isFipsRegion; /***/ }), -/***/ 29208: +/***/ 50754: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var fromString = __nccwpck_require__(39451); -var toString = __nccwpck_require__(2771); -var base64 = __nccwpck_require__(98197); - -const rpcArrayToTextArray = strings => { - if (Array.isArray(strings)) { - return strings.map(rpcToText); - } - return strings; +exports.resolveRegionConfig = void 0; +const getRealRegion_1 = __nccwpck_require__(41791); +const isFipsRegion_1 = __nccwpck_require__(37754); +const resolveRegionConfig = (input) => { + const { region, useFipsEndpoint } = input; + if (!region) { + throw new Error("Region is missing"); + } + return { + ...input, + region: async () => { + if (typeof region === "string") { + return (0, getRealRegion_1.getRealRegion)(region); + } + const providedRegion = await region(); + return (0, getRealRegion_1.getRealRegion)(providedRegion); + }, + useFipsEndpoint: async () => { + const providedRegion = typeof region === "string" ? region : await region(); + if ((0, isFipsRegion_1.isFipsRegion)(providedRegion)) { + return true; + } + return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); + }, + }; }; -const rpcToText = mb => toString.toString(rpcToBytes(mb)); -const rpcToBytes = mb => base64.base64url.decode(mb); -const textToUrlSafeRpc = text => base64.base64url.encode(fromString.fromString(text)); - -exports.rpcArrayToTextArray = rpcArrayToTextArray; -exports.rpcToBytes = rpcToBytes; -exports.rpcToText = rpcToText; -exports.textToUrlSafeRpc = textToUrlSafeRpc; +exports.resolveRegionConfig = resolveRegionConfig; /***/ }), -/***/ 87513: +/***/ 17323: /***/ ((__unused_webpack_module, exports) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); -function modeToString(mode) { - if (mode == null) { - return undefined; - } - if (typeof mode === 'string') { - return mode; - } - return mode.toString(8).padStart(4, '0'); -} - -exports.modeToString = modeToString; - /***/ }), -/***/ 28060: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 65073: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -var objectToCamel = __nccwpck_require__(62268); - -function objectToCamelWithMetadata(entry) { - const file = objectToCamel.objectToCamel(entry); - if (Object.prototype.hasOwnProperty.call(file, 'mode')) { - file.mode = parseInt(file.mode, 8); - } - if (Object.prototype.hasOwnProperty.call(file, 'mtime')) { - file.mtime = { - secs: file.mtime, - nsecs: file.mtimeNsecs || 0 - }; - delete file.mtimeNsecs; - } - return file; -} - -exports.objectToCamelWithMetadata = objectToCamelWithMetadata; - /***/ }), -/***/ 62268: +/***/ 85521: /***/ ((__unused_webpack_module, exports) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -function objectToCamel(obj) { - if (obj == null) { - return obj; - } - const caps = /^[A-Z]+$/; - const output = {}; - return Object.keys(obj).reduce((camelObj, k) => { - if (caps.test(k)) { - camelObj[k.toLowerCase()] = obj[k]; - } else if (caps.test(k[0])) { - camelObj[k[0].toLowerCase() + k.slice(1)] = obj[k]; - } else { - camelObj[k] = obj[k]; - } - return camelObj; - }, output); -} - -exports.objectToCamel = objectToCamel; +exports.getHostnameFromVariants = void 0; +const getHostnameFromVariants = (variants = [], { useFipsEndpoint, useDualstackEndpoint }) => { + var _a; + return (_a = variants.find(({ tags }) => useFipsEndpoint === tags.includes("fips") && useDualstackEndpoint === tags.includes("dualstack"))) === null || _a === void 0 ? void 0 : _a.hostname; +}; +exports.getHostnameFromVariants = getHostnameFromVariants; /***/ }), -/***/ 68414: +/***/ 94827: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var errCode = __nccwpck_require__(5822); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); - -function parseMtime(input) { - if (input == null) { - return undefined; - } - let mtime; - if (input.secs != null) { - mtime = { - secs: input.secs, - nsecs: input.nsecs - }; - } - if (input.Seconds != null) { - mtime = { - secs: input.Seconds, - nsecs: input.FractionalNanoseconds - }; - } - if (Array.isArray(input)) { - mtime = { - secs: input[0], - nsecs: input[1] - }; - } - if (input instanceof Date) { - const ms = input.getTime(); - const secs = Math.floor(ms / 1000); - mtime = { - secs: secs, - nsecs: (ms - secs * 1000) * 1000 +exports.getRegionInfo = void 0; +const getHostnameFromVariants_1 = __nccwpck_require__(85521); +const getResolvedHostname_1 = __nccwpck_require__(30106); +const getResolvedPartition_1 = __nccwpck_require__(3013); +const getResolvedSigningRegion_1 = __nccwpck_require__(32252); +const getRegionInfo = (region, { useFipsEndpoint = false, useDualstackEndpoint = false, signingService, regionHash, partitionHash, }) => { + var _a, _b, _c, _d, _e, _f; + const partition = (0, getResolvedPartition_1.getResolvedPartition)(region, { partitionHash }); + const resolvedRegion = region in regionHash ? region : (_b = (_a = partitionHash[partition]) === null || _a === void 0 ? void 0 : _a.endpoint) !== null && _b !== void 0 ? _b : region; + const hostnameOptions = { useFipsEndpoint, useDualstackEndpoint }; + const regionHostname = (0, getHostnameFromVariants_1.getHostnameFromVariants)((_c = regionHash[resolvedRegion]) === null || _c === void 0 ? void 0 : _c.variants, hostnameOptions); + const partitionHostname = (0, getHostnameFromVariants_1.getHostnameFromVariants)((_d = partitionHash[partition]) === null || _d === void 0 ? void 0 : _d.variants, hostnameOptions); + const hostname = (0, getResolvedHostname_1.getResolvedHostname)(resolvedRegion, { regionHostname, partitionHostname }); + if (hostname === undefined) { + throw new Error(`Endpoint resolution failed for: ${{ resolvedRegion, useFipsEndpoint, useDualstackEndpoint }}`); + } + const signingRegion = (0, getResolvedSigningRegion_1.getResolvedSigningRegion)(hostname, { + signingRegion: (_e = regionHash[resolvedRegion]) === null || _e === void 0 ? void 0 : _e.signingRegion, + regionRegex: partitionHash[partition].regionRegex, + useFipsEndpoint, + }); + return { + partition, + signingService, + hostname, + ...(signingRegion && { signingRegion }), + ...(((_f = regionHash[resolvedRegion]) === null || _f === void 0 ? void 0 : _f.signingService) && { + signingService: regionHash[resolvedRegion].signingService, + }), }; - } - if (!Object.prototype.hasOwnProperty.call(mtime, 'secs')) { - return undefined; - } - if (mtime != null && mtime.nsecs != null && (mtime.nsecs < 0 || mtime.nsecs > 999999999)) { - throw errCode__default["default"](new Error('mtime-nsecs must be within the range [0,999999999]'), 'ERR_INVALID_MTIME_NSECS'); - } - return mtime; -} - -exports.parseMtime = parseMtime; +}; +exports.getRegionInfo = getRegionInfo; /***/ }), -/***/ 51788: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 30106: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); - -var cid = __nccwpck_require__(24247); -var errCode = __nccwpck_require__(5822); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); - -async function* resolve(cid$1, path, codecs, getBlock, options) { - const load = async cid => { - const codec = await codecs.getCodec(cid.code); - const block = await getBlock(cid, options); - return codec.decode(block); - }; - const parts = path.split('/').filter(Boolean); - let value = await load(cid$1); - let lastCid = cid$1; - while (parts.length) { - const key = parts.shift(); - if (!key) { - throw errCode__default["default"](new Error(`Could not resolve path "${ path }"`), 'ERR_INVALID_PATH'); - } - if (Object.prototype.hasOwnProperty.call(value, key)) { - value = value[key]; - yield { - value, - remainderPath: parts.join('/') - }; - } else { - throw errCode__default["default"](new Error(`no link named "${ key }" under ${ lastCid }`), 'ERR_NO_LINK'); - } - const cid$1 = cid.CID.asCID(value); - if (cid$1) { - lastCid = cid$1; - value = await load(value); - } - } - yield { - value, - remainderPath: '' - }; -} - -exports.resolve = resolve; +exports.getResolvedHostname = void 0; +const getResolvedHostname = (resolvedRegion, { regionHostname, partitionHostname }) => regionHostname + ? regionHostname + : partitionHostname + ? partitionHostname.replace("{region}", resolvedRegion) + : undefined; +exports.getResolvedHostname = getResolvedHostname; /***/ }), -/***/ 52836: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 3013: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); - -var modeToString = __nccwpck_require__(87513); -var parseMtime = __nccwpck_require__(68414); - -function toUrlSearchParams({arg, searchParams, hashAlg, mtime, mode, ...options} = {}) { - if (searchParams) { - options = { - ...options, - ...searchParams - }; - } - if (hashAlg) { - options.hash = hashAlg; - } - if (mtime != null) { - mtime = parseMtime.parseMtime(mtime); - options.mtime = mtime.secs; - options.mtimeNsecs = mtime.nsecs; - } - if (mode != null) { - options.mode = modeToString.modeToString(mode); - } - if (options.timeout && !isNaN(options.timeout)) { - options.timeout = `${ options.timeout }ms`; - } - if (arg === undefined || arg === null) { - arg = []; - } else if (!Array.isArray(arg)) { - arg = [arg]; - } - const urlSearchParams = new URLSearchParams(options); - arg.forEach(arg => urlSearchParams.append('arg', arg)); - return urlSearchParams; -} - -exports.toUrlSearchParams = toUrlSearchParams; +exports.getResolvedPartition = void 0; +const getResolvedPartition = (region, { partitionHash }) => { var _a; return (_a = Object.keys(partitionHash || {}).find((key) => partitionHash[key].regions.includes(region))) !== null && _a !== void 0 ? _a : "aws"; }; +exports.getResolvedPartition = getResolvedPartition; /***/ }), -/***/ 85077: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 32252: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); - -var level = __nccwpck_require__(84685); -var ls = __nccwpck_require__(17150); -var tail = __nccwpck_require__(17214); - -function createLog(config) { - return { - level: level.createLevel(config), - ls: ls.createLs(config), - tail: tail.createTail(config) - }; -} - -exports.createLog = createLog; +exports.getResolvedSigningRegion = void 0; +const getResolvedSigningRegion = (hostname, { signingRegion, regionRegex, useFipsEndpoint }) => { + if (signingRegion) { + return signingRegion; + } + else if (useFipsEndpoint) { + const regionRegexJs = regionRegex.replace("\\\\", "\\").replace(/^\^/g, "\\.").replace(/\$$/g, "\\."); + const regionRegexmatchArray = hostname.match(regionRegexJs); + if (regionRegexmatchArray) { + return regionRegexmatchArray[0].slice(1, -1); + } + } +}; +exports.getResolvedSigningRegion = getResolvedSigningRegion; /***/ }), -/***/ 84685: +/***/ 49310: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var objectToCamel = __nccwpck_require__(62268); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createLevel = configure.configure(api => { - async function level(subsystem, level, options = {}) { - const res = await api.post('log/level', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: [ - subsystem, - level - ], - ...options - }), - headers: options.headers - }); - return objectToCamel.objectToCamel(await res.json()); - } - return level; -}); - -exports.createLevel = createLevel; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(17323), exports); +tslib_1.__exportStar(__nccwpck_require__(65073), exports); +tslib_1.__exportStar(__nccwpck_require__(94827), exports); /***/ }), -/***/ 17150: +/***/ 42671: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createLs = configure.configure(api => { - async function ls(options = {}) { - const res = await api.post('log/ls', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - }); - const data = await res.json(); - return data.Strings; - } - return ls; -}); - -exports.createLs = createLs; +exports.getSmithyContext = void 0; +const types_1 = __nccwpck_require__(21438); +const getSmithyContext = (context) => context[types_1.SMITHY_CONTEXT_KEY] || (context[types_1.SMITHY_CONTEXT_KEY] = {}); +exports.getSmithyContext = getSmithyContext; /***/ }), -/***/ 17214: +/***/ 41911: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createTail = configure.configure(api => { - async function* tail(options = {}) { - const res = await api.post('log/tail', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - }); - yield* res.ndjson(); - } - return tail; -}); - -exports.createTail = createTail; +exports.createPaginator = void 0; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(19093), exports); +tslib_1.__exportStar(__nccwpck_require__(72439), exports); +tslib_1.__exportStar(__nccwpck_require__(90531), exports); +tslib_1.__exportStar(__nccwpck_require__(42671), exports); +tslib_1.__exportStar(__nccwpck_require__(62424), exports); +tslib_1.__exportStar(__nccwpck_require__(28510), exports); +var createPaginator_1 = __nccwpck_require__(46264); +Object.defineProperty(exports, "createPaginator", ({ enumerable: true, get: function () { return createPaginator_1.createPaginator; } })); /***/ }), -/***/ 97506: +/***/ 68807: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var stat = __nccwpck_require__(74168); - -const createLs = configure.configure((api, opts) => { - async function* ls(path, options = {}) { - const pathStr = `${ path instanceof Uint8Array ? cid.CID.decode(path) : path }`; - async function mapLink(link) { - let hash = link.Hash; - if (hash.includes('/')) { - const ipfsPath = hash.startsWith('/ipfs/') ? hash : `/ipfs/${ hash }`; - const stats = await stat.createStat(opts)(ipfsPath); - hash = stats.cid; - } else { - hash = cid.CID.parse(hash); - } - const entry = { - name: link.Name, - path: pathStr + (link.Name ? `/${ link.Name }` : ''), - size: link.Size, - cid: hash, - type: typeOf(link) - }; - if (link.Mode) { - entry.mode = parseInt(link.Mode, 8); - } - if (link.Mtime !== undefined && link.Mtime !== null) { - entry.mtime = { secs: link.Mtime }; - if (link.MtimeNsecs !== undefined && link.MtimeNsecs !== null) { - entry.mtime.nsecs = link.MtimeNsecs; - } - } - return entry; - } - const res = await api.post('ls', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: pathStr, - ...options - }), - headers: options.headers - }); - for await (let result of res.ndjson()) { - result = result.Objects; - if (!result) { - throw new Error('expected .Objects in results'); - } - result = result[0]; - if (!result) { - throw new Error('expected one array in results.Objects'); - } - const links = result.Links; - if (!Array.isArray(links)) { - throw new Error('expected one array in results.Objects[0].Links'); - } - if (!links.length) { - yield mapLink(result); - return; - } - yield* links.map(mapLink); - } - } - return ls; +exports.getHttpAuthSchemeEndpointRuleSetPlugin = exports.httpAuthSchemeEndpointRuleSetMiddlewareOptions = void 0; +const middleware_endpoint_1 = __nccwpck_require__(9848); +const httpAuthSchemeMiddleware_1 = __nccwpck_require__(61026); +exports.httpAuthSchemeEndpointRuleSetMiddlewareOptions = { + step: "serialize", + tags: ["HTTP_AUTH_SCHEME"], + name: "httpAuthSchemeMiddleware", + override: true, + relation: "before", + toMiddleware: middleware_endpoint_1.endpointMiddlewareOptions.name, +}; +const getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo((0, httpAuthSchemeMiddleware_1.httpAuthSchemeMiddleware)(config, { + httpAuthSchemeParametersProvider, + identityProviderConfigProvider, + }), exports.httpAuthSchemeEndpointRuleSetMiddlewareOptions); + }, }); -function typeOf(link) { - switch (link.Type) { - case 1: - case 5: - return 'dir'; - case 2: - return 'file'; - default: - return 'file'; - } -} - -exports.createLs = createLs; +exports.getHttpAuthSchemeEndpointRuleSetPlugin = getHttpAuthSchemeEndpointRuleSetPlugin; /***/ }), -/***/ 75785: +/***/ 50719: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var objectToCamel = __nccwpck_require__(62268); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createMount = configure.configure(api => { - async function mount(options = {}) { - const res = await api.post('dns', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - }); - return objectToCamel.objectToCamel(await res.json()); - } - return mount; +exports.getHttpAuthSchemePlugin = exports.httpAuthSchemeMiddlewareOptions = void 0; +const middleware_serde_1 = __nccwpck_require__(44036); +const httpAuthSchemeMiddleware_1 = __nccwpck_require__(61026); +exports.httpAuthSchemeMiddlewareOptions = { + step: "serialize", + tags: ["HTTP_AUTH_SCHEME"], + name: "httpAuthSchemeMiddleware", + override: true, + relation: "before", + toMiddleware: middleware_serde_1.serializerMiddlewareOption.name, +}; +const getHttpAuthSchemePlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo((0, httpAuthSchemeMiddleware_1.httpAuthSchemeMiddleware)(config, { + httpAuthSchemeParametersProvider, + identityProviderConfigProvider, + }), exports.httpAuthSchemeMiddlewareOptions); + }, }); - -exports.createMount = createMount; +exports.getHttpAuthSchemePlugin = getHttpAuthSchemePlugin; /***/ }), -/***/ 8302: +/***/ 61026: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var publish = __nccwpck_require__(29576); -var resolve = __nccwpck_require__(49726); -var index = __nccwpck_require__(98473); - -function createName(config) { - return { - publish: publish.createPublish(config), - resolve: resolve.createResolve(config), - pubsub: index.createPubsub(config) - }; +exports.httpAuthSchemeMiddleware = void 0; +const types_1 = __nccwpck_require__(21438); +const util_middleware_1 = __nccwpck_require__(3626); +function convertHttpAuthSchemesToMap(httpAuthSchemes) { + const map = new Map(); + for (const scheme of httpAuthSchemes) { + map.set(scheme.schemeId, scheme); + } + return map; } - -exports.createName = createName; +const httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => { + var _a; + const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input)); + const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes); + const smithyContext = (0, util_middleware_1.getSmithyContext)(context); + const failureReasons = []; + for (const option of options) { + const scheme = authSchemes.get(option.schemeId); + if (!scheme) { + failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`); + continue; + } + const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config)); + if (!identityProvider) { + failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`); + continue; + } + const { identityProperties = {}, signingProperties = {} } = ((_a = option.propertiesExtractor) === null || _a === void 0 ? void 0 : _a.call(option, config, context)) || {}; + option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties); + option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties); + smithyContext.selectedHttpAuthScheme = { + httpAuthOption: option, + identity: await identityProvider(option.identityProperties), + signer: scheme.signer, + }; + break; + } + if (!smithyContext.selectedHttpAuthScheme) { + throw new Error(failureReasons.join("\n")); + } + return next(args); +}; +exports.httpAuthSchemeMiddleware = httpAuthSchemeMiddleware; /***/ }), -/***/ 29576: +/***/ 19093: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var objectToCamel = __nccwpck_require__(62268); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createPublish = configure.configure(api => { - async function publish(path, options = {}) { - const res = await api.post('name/publish', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: `${ path }`, - ...options - }), - headers: options.headers - }); - return objectToCamel.objectToCamel(await res.json()); - } - return publish; -}); - -exports.createPublish = createPublish; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(61026), exports); +tslib_1.__exportStar(__nccwpck_require__(68807), exports); +tslib_1.__exportStar(__nccwpck_require__(50719), exports); /***/ }), -/***/ 59820: +/***/ 87384: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var objectToCamel = __nccwpck_require__(62268); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createCancel = configure.configure(api => { - async function cancel(name, options = {}) { - const res = await api.post('name/pubsub/cancel', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: name, - ...options - }), - headers: options.headers - }); - return objectToCamel.objectToCamel(await res.json()); - } - return cancel; +exports.getHttpSigningPlugin = exports.httpSigningMiddlewareOptions = void 0; +const middleware_retry_1 = __nccwpck_require__(73739); +const httpSigningMiddleware_1 = __nccwpck_require__(70441); +exports.httpSigningMiddlewareOptions = { + step: "finalizeRequest", + tags: ["HTTP_SIGNING"], + name: "httpSigningMiddleware", + aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"], + override: true, + relation: "after", + toMiddleware: middleware_retry_1.retryMiddlewareOptions.name, +}; +const getHttpSigningPlugin = (config) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo((0, httpSigningMiddleware_1.httpSigningMiddleware)(config), exports.httpSigningMiddlewareOptions); + }, }); - -exports.createCancel = createCancel; +exports.getHttpSigningPlugin = getHttpSigningPlugin; /***/ }), -/***/ 98473: +/***/ 70441: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var cancel = __nccwpck_require__(59820); -var state = __nccwpck_require__(68347); -var subs = __nccwpck_require__(79481); - -function createPubsub(config) { - return { - cancel: cancel.createCancel(config), - state: state.createState(config), - subs: subs.createSubs(config) - }; -} - -exports.createPubsub = createPubsub; +exports.httpSigningMiddleware = void 0; +const protocol_http_1 = __nccwpck_require__(76232); +const types_1 = __nccwpck_require__(21438); +const util_middleware_1 = __nccwpck_require__(3626); +const defaultErrorHandler = (signingProperties) => (error) => { + throw error; +}; +const defaultSuccessHandler = (httpResponse, signingProperties) => { }; +const httpSigningMiddleware = (config) => (next, context) => async (args) => { + if (!protocol_http_1.HttpRequest.isInstance(args.request)) { + return next(args); + } + const smithyContext = (0, util_middleware_1.getSmithyContext)(context); + const scheme = smithyContext.selectedHttpAuthScheme; + if (!scheme) { + throw new Error(`No HttpAuthScheme was selected: unable to sign request`); + } + const { httpAuthOption: { signingProperties = {} }, identity, signer, } = scheme; + const output = await next({ + ...args, + request: await signer.sign(args.request, identity, signingProperties), + }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties)); + (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties); + return output; +}; +exports.httpSigningMiddleware = httpSigningMiddleware; /***/ }), -/***/ 68347: +/***/ 72439: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var objectToCamel = __nccwpck_require__(62268); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createState = configure.configure(api => { - async function state(options = {}) { - const res = await api.post('name/pubsub/state', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - }); - return objectToCamel.objectToCamel(await res.json()); - } - return state; -}); - -exports.createState = createState; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(70441), exports); +tslib_1.__exportStar(__nccwpck_require__(87384), exports); /***/ }), -/***/ 79481: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 62424: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.normalizeProvider = void 0; +const normalizeProvider = (input) => { + if (typeof input === "function") + return input; + const promisified = Promise.resolve(input); + return () => promisified; +}; +exports.normalizeProvider = normalizeProvider; -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -const createSubs = configure.configure(api => { - async function subs(options = {}) { - const res = await api.post('name/pubsub/subs', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - }); - const data = await res.json(); - return data.Strings || []; - } - return subs; -}); +/***/ }), + +/***/ 46264: +/***/ ((__unused_webpack_module, exports) => { -exports.createSubs = createSubs; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createPaginator = void 0; +const makePagedClientRequest = async (CommandCtor, client, input, ...args) => { + return await client.send(new CommandCtor(input), ...args); +}; +function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) { + return async function* paginateOperation(config, input, ...additionalArguments) { + var _a; + let token = config.startingToken || undefined; + let hasNext = true; + let page; + while (hasNext) { + input[inputTokenName] = token; + if (pageSizeTokenName) { + input[pageSizeTokenName] = (_a = input[pageSizeTokenName]) !== null && _a !== void 0 ? _a : config.pageSize; + } + if (config.client instanceof ClientCtor) { + page = await makePagedClientRequest(CommandCtor, config.client, input, ...additionalArguments); + } + else { + throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`); + } + yield page; + const prevToken = token; + token = page[outputTokenName]; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + return undefined; + }; +} +exports.createPaginator = createPaginator; /***/ }), -/***/ 49726: +/***/ 28510: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createResolve = configure.configure(api => { - async function* resolve(path, options = {}) { - const res = await api.post('name/resolve', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: path, - stream: true, - ...options - }), - headers: options.headers - }); - for await (const result of res.ndjson()) { - yield result.Path; +exports.RequestBuilder = exports.requestBuilder = void 0; +const protocol_http_1 = __nccwpck_require__(76232); +const smithy_client_1 = __nccwpck_require__(42584); +function requestBuilder(input, context) { + return new RequestBuilder(input, context); +} +exports.requestBuilder = requestBuilder; +class RequestBuilder { + constructor(input, context) { + this.input = input; + this.context = context; + this.query = {}; + this.method = ""; + this.headers = {}; + this.path = ""; + this.body = null; + this.hostname = ""; + this.resolvePathStack = []; } - } - return resolve; -}); - -exports.createResolve = createResolve; + async build() { + const { hostname, protocol = "https", port, path: basePath } = await this.context.endpoint(); + this.path = basePath; + for (const resolvePath of this.resolvePathStack) { + resolvePath(this.path); + } + return new protocol_http_1.HttpRequest({ + protocol, + hostname: this.hostname || hostname, + port, + method: this.method, + path: this.path, + query: this.query, + body: this.body, + headers: this.headers, + }); + } + hn(hostname) { + this.hostname = hostname; + return this; + } + bp(uriLabel) { + this.resolvePathStack.push((basePath) => { + this.path = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + uriLabel; + }); + return this; + } + p(memberName, labelValueProvider, uriLabel, isGreedyLabel) { + this.resolvePathStack.push((path) => { + this.path = (0, smithy_client_1.resolvedPath)(path, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel); + }); + return this; + } + h(headers) { + this.headers = headers; + return this; + } + q(query) { + this.query = query; + return this; + } + b(body) { + this.body = body; + return this; + } + m(method) { + this.method = method; + return this; + } +} +exports.RequestBuilder = RequestBuilder; /***/ }), -/***/ 47257: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 52274: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); - -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createData = configure.configure(api => { - async function data(cid$1, options = {}) { - const res = await api.post('object/data', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: `${ cid$1 instanceof Uint8Array ? cid.CID.decode(cid$1) : cid$1 }`, - ...options - }), - headers: options.headers - }); - const data = await res.arrayBuffer(); - return new Uint8Array(data, 0, data.byteLength); - } - return data; -}); - -exports.createData = createData; +exports.DefaultIdentityProviderConfig = void 0; +class DefaultIdentityProviderConfig { + constructor(config) { + this.authSchemes = new Map(); + for (const [key, value] of Object.entries(config)) { + if (value !== undefined) { + this.authSchemes.set(key, value); + } + } + } + getIdentityProvider(schemeId) { + return this.authSchemes.get(schemeId); + } +} +exports.DefaultIdentityProviderConfig = DefaultIdentityProviderConfig; /***/ }), -/***/ 55651: +/***/ 50912: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var fromString = __nccwpck_require__(39451); - -const createGet = configure.configure(api => { - async function get(cid$1, options = {}) { - const res = await api.post('object/get', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: `${ cid$1 instanceof Uint8Array ? cid.CID.decode(cid$1) : cid$1 }`, - dataEncoding: 'base64', - ...options - }), - headers: options.headers - }); - const data = await res.json(); - return { - Data: fromString.fromString(data.Data, 'base64pad'), - Links: (data.Links || []).map(link => ({ - Name: link.Name, - Hash: cid.CID.parse(link.Hash), - Tsize: link.Size - })) - }; - } - return get; -}); - -exports.createGet = createGet; +exports.HttpApiKeyAuthSigner = void 0; +const types_1 = __nccwpck_require__(21438); +class HttpApiKeyAuthSigner { + async sign(httpRequest, identity, signingProperties) { + if (!signingProperties) { + throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing"); + } + if (!signingProperties.name) { + throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing"); + } + if (!signingProperties.in) { + throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing"); + } + if (!identity.apiKey) { + throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined"); + } + const clonedRequest = httpRequest.clone(); + if (signingProperties.in === types_1.HttpApiKeyAuthLocation.QUERY) { + clonedRequest.query[signingProperties.name] = identity.apiKey; + } + else if (signingProperties.in === types_1.HttpApiKeyAuthLocation.HEADER) { + clonedRequest.headers[signingProperties.name] = signingProperties.scheme + ? `${signingProperties.scheme} ${identity.apiKey}` + : identity.apiKey; + } + else { + throw new Error("request can only be signed with `apiKey` locations `query` or `header`, " + + "but found: `" + + signingProperties.in + + "`"); + } + return clonedRequest; + } +} +exports.HttpApiKeyAuthSigner = HttpApiKeyAuthSigner; /***/ }), -/***/ 64980: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 66359: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); - -var data = __nccwpck_require__(47257); -var get = __nccwpck_require__(55651); -var links = __nccwpck_require__(56797); -var _new = __nccwpck_require__(4050); -var put = __nccwpck_require__(35217); -var stat = __nccwpck_require__(46969); -var index = __nccwpck_require__(94482); - -function createObject(codecs, config) { - return { - data: data.createData(config), - get: get.createGet(config), - links: links.createLinks(config), - new: _new.createNew(config), - put: put.createPut(codecs, config), - stat: stat.createStat(config), - patch: index.createPatch(config) - }; +exports.HttpBearerAuthSigner = void 0; +class HttpBearerAuthSigner { + async sign(httpRequest, identity, signingProperties) { + const clonedRequest = httpRequest.clone(); + if (!identity.token) { + throw new Error("request could not be signed with `token` since the `token` is not defined"); + } + clonedRequest.headers["Authorization"] = `Bearer ${identity.token}`; + return clonedRequest; + } } - -exports.createObject = createObject; +exports.HttpBearerAuthSigner = HttpBearerAuthSigner; /***/ }), -/***/ 56797: +/***/ 91865: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createLinks = configure.configure(api => { - async function links(cid$1, options = {}) { - const res = await api.post('object/links', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: `${ cid$1 instanceof Uint8Array ? cid.CID.decode(cid$1) : cid$1 }`, - ...options - }), - headers: options.headers - }); - const data = await res.json(); - return (data.Links || []).map(l => ({ - Name: l.Name, - Tsize: l.Size, - Hash: cid.CID.parse(l.Hash) - })); - } - return links; -}); - -exports.createLinks = createLinks; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(50912), exports); +tslib_1.__exportStar(__nccwpck_require__(66359), exports); +tslib_1.__exportStar(__nccwpck_require__(8271), exports); /***/ }), -/***/ 4050: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 8271: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); - -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createNew = configure.configure(api => { - async function newObject(options = {}) { - const res = await api.post('object/new', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: options.template, - ...options - }), - headers: options.headers - }); - const {Hash} = await res.json(); - return cid.CID.parse(Hash); - } - return newObject; -}); - -exports.createNew = createNew; +exports.NoAuthSigner = void 0; +class NoAuthSigner { + async sign(httpRequest, identity, signingProperties) { + return httpRequest; + } +} +exports.NoAuthSigner = NoAuthSigner; /***/ }), -/***/ 23641: +/***/ 90531: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(52274), exports); +tslib_1.__exportStar(__nccwpck_require__(91865), exports); +tslib_1.__exportStar(__nccwpck_require__(51473), exports); -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -const createAddLink = configure.configure(api => { - async function addLink(cid$1, dLink, options = {}) { - const res = await api.post('object/patch/add-link', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: [ - `${ cid$1 }`, - dLink.Name || dLink.name || '', - (dLink.Hash || dLink.cid || '').toString() || null - ], - ...options - }), - headers: options.headers - }); - const {Hash} = await res.json(); - return cid.CID.parse(Hash); - } - return addLink; -}); - -exports.createAddLink = createAddLink; +/***/ }), +/***/ 51473: +/***/ ((__unused_webpack_module, exports) => { -/***/ }), -/***/ 16432: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.memoizeIdentityProvider = exports.doesIdentityRequireRefresh = exports.isIdentityExpired = exports.EXPIRATION_MS = exports.createIsIdentityExpiredFunction = void 0; +const createIsIdentityExpiredFunction = (expirationMs) => (identity) => (0, exports.doesIdentityRequireRefresh)(identity) && identity.expiration.getTime() - Date.now() < expirationMs; +exports.createIsIdentityExpiredFunction = createIsIdentityExpiredFunction; +exports.EXPIRATION_MS = 300000; +exports.isIdentityExpired = (0, exports.createIsIdentityExpiredFunction)(exports.EXPIRATION_MS); +const doesIdentityRequireRefresh = (identity) => identity.expiration !== undefined; +exports.doesIdentityRequireRefresh = doesIdentityRequireRefresh; +const memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => { + if (provider === undefined) { + return undefined; + } + const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider; + let resolved; + let pending; + let hasResult; + let isConstant = false; + const coalesceProvider = async (options) => { + if (!pending) { + pending = normalizedProvider(options); + } + try { + resolved = await pending; + hasResult = true; + isConstant = false; + } + finally { + pending = undefined; + } + return resolved; + }; + if (isExpired === undefined) { + return async (options) => { + if (!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh)) { + resolved = await coalesceProvider(options); + } + return resolved; + }; + } + return async (options) => { + if (!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh)) { + resolved = await coalesceProvider(options); + } + if (isConstant) { + return resolved; + } + if (!requiresRefresh(resolved)) { + isConstant = true; + return resolved; + } + if (isExpired(resolved)) { + await coalesceProvider(options); + return resolved; + } + return resolved; + }; +}; +exports.memoizeIdentityProvider = memoizeIdentityProvider; -"use strict"; +/***/ }), -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ 10244: +/***/ ((__unused_webpack_module, exports) => { -var cid = __nccwpck_require__(24247); -var multipartRequest = __nccwpck_require__(87527); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var abortSignal = __nccwpck_require__(14594); -var nativeAbortController = __nccwpck_require__(43586); - -const createAppendData = configure.configure(api => { - async function appendData(cid$1, data, options = {}) { - const controller = new nativeAbortController.AbortController(); - const signal = abortSignal.abortSignal(controller.signal, options.signal); - const res = await api.post('object/patch/append-data', { - signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: `${ cid$1 }`, - ...options - }), - ...await multipartRequest.multipartRequest([data], controller, options.headers) - }); - const {Hash} = await res.json(); - return cid.CID.parse(Hash); - } - return appendData; -}); -exports.createAppendData = createAppendData; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Endpoint = void 0; +var Endpoint; +(function (Endpoint) { + Endpoint["IPv4"] = "http://169.254.169.254"; + Endpoint["IPv6"] = "http://[fd00:ec2::254]"; +})(Endpoint = exports.Endpoint || (exports.Endpoint = {})); /***/ }), -/***/ 94482: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 39949: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ENDPOINT_CONFIG_OPTIONS = exports.CONFIG_ENDPOINT_NAME = exports.ENV_ENDPOINT_NAME = void 0; +exports.ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT"; +exports.CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint"; +exports.ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[exports.ENV_ENDPOINT_NAME], + configFileSelector: (profile) => profile[exports.CONFIG_ENDPOINT_NAME], + default: undefined, +}; -var addLink = __nccwpck_require__(23641); -var appendData = __nccwpck_require__(16432); -var rmLink = __nccwpck_require__(86253); -var setData = __nccwpck_require__(89010); -function createPatch(config) { - return { - addLink: addLink.createAddLink(config), - appendData: appendData.createAppendData(config), - rmLink: rmLink.createRmLink(config), - setData: setData.createSetData(config) - }; -} +/***/ }), + +/***/ 31499: +/***/ ((__unused_webpack_module, exports) => { + -exports.createPatch = createPatch; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.EndpointMode = void 0; +var EndpointMode; +(function (EndpointMode) { + EndpointMode["IPv4"] = "IPv4"; + EndpointMode["IPv6"] = "IPv6"; +})(EndpointMode = exports.EndpointMode || (exports.EndpointMode = {})); /***/ }), -/***/ 86253: +/***/ 67171: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createRmLink = configure.configure(api => { - async function rmLink(cid$1, dLink, options = {}) { - const res = await api.post('object/patch/rm-link', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: [ - `${ cid$1 }`, - dLink.Name || dLink.name || null - ], - ...options - }), - headers: options.headers - }); - const {Hash} = await res.json(); - return cid.CID.parse(Hash); - } - return rmLink; -}); - -exports.createRmLink = createRmLink; +exports.ENDPOINT_MODE_CONFIG_OPTIONS = exports.CONFIG_ENDPOINT_MODE_NAME = exports.ENV_ENDPOINT_MODE_NAME = void 0; +const EndpointMode_1 = __nccwpck_require__(31499); +exports.ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE"; +exports.CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode"; +exports.ENDPOINT_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[exports.ENV_ENDPOINT_MODE_NAME], + configFileSelector: (profile) => profile[exports.CONFIG_ENDPOINT_MODE_NAME], + default: EndpointMode_1.EndpointMode.IPv4, +}; /***/ }), -/***/ 89010: +/***/ 62431: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var cid = __nccwpck_require__(24247); -var multipartRequest = __nccwpck_require__(87527); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var abortSignal = __nccwpck_require__(14594); -var nativeAbortController = __nccwpck_require__(43586); - -const createSetData = configure.configure(api => { - async function setData(cid$1, data, options = {}) { - const controller = new nativeAbortController.AbortController(); - const signal = abortSignal.abortSignal(controller.signal, options.signal); - const res = await api.post('object/patch/set-data', { - signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: [`${ cid$1 }`], - ...options - }), - ...await multipartRequest.multipartRequest([data], controller, options.headers) - }); - const {Hash} = await res.json(); - return cid.CID.parse(Hash); - } - return setData; -}); - -exports.createSetData = createSetData; +exports.InstanceMetadataV1FallbackError = void 0; +const property_provider_1 = __nccwpck_require__(60846); +class InstanceMetadataV1FallbackError extends property_provider_1.CredentialsProviderError { + constructor(message, tryNextLink = true) { + super(message, tryNextLink); + this.tryNextLink = tryNextLink; + this.name = "InstanceMetadataV1FallbackError"; + Object.setPrototypeOf(this, InstanceMetadataV1FallbackError.prototype); + } +} +exports.InstanceMetadataV1FallbackError = InstanceMetadataV1FallbackError; /***/ }), -/***/ 35217: +/***/ 91587: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var put = __nccwpck_require__(79631); - -const createPut = (codecs, options) => { - const fn = configure.configure(api => { - const dagPut = put.createPut(codecs, options); - async function put$1(obj, options = {}) { - return dagPut(obj, { +exports.fromContainerMetadata = exports.ENV_CMDS_AUTH_TOKEN = exports.ENV_CMDS_RELATIVE_URI = exports.ENV_CMDS_FULL_URI = void 0; +const property_provider_1 = __nccwpck_require__(60846); +const url_1 = __nccwpck_require__(57310); +const httpRequest_1 = __nccwpck_require__(56971); +const ImdsCredentials_1 = __nccwpck_require__(44438); +const RemoteProviderInit_1 = __nccwpck_require__(68328); +const retry_1 = __nccwpck_require__(22119); +exports.ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; +exports.ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; +exports.ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; +const fromContainerMetadata = (init = {}) => { + const { timeout, maxRetries } = (0, RemoteProviderInit_1.providerConfigFromInit)(init); + return () => (0, retry_1.retry)(async () => { + const requestOptions = await getCmdsUri(); + const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions)); + if (!(0, ImdsCredentials_1.isImdsCredentials)(credsResponse)) { + throw new property_provider_1.CredentialsProviderError("Invalid response received from instance metadata service."); + } + return (0, ImdsCredentials_1.fromImdsCredentials)(credsResponse); + }, maxRetries); +}; +exports.fromContainerMetadata = fromContainerMetadata; +const requestFromEcsImds = async (timeout, options) => { + if (process.env[exports.ENV_CMDS_AUTH_TOKEN]) { + options.headers = { + ...options.headers, + Authorization: process.env[exports.ENV_CMDS_AUTH_TOKEN], + }; + } + const buffer = await (0, httpRequest_1.httpRequest)({ ...options, - storeCodec: 'dag-pb', - hashAlg: 'sha2-256', - version: 1 - }); + timeout, + }); + return buffer.toString(); +}; +const CMDS_IP = "169.254.170.2"; +const GREENGRASS_HOSTS = { + localhost: true, + "127.0.0.1": true, +}; +const GREENGRASS_PROTOCOLS = { + "http:": true, + "https:": true, +}; +const getCmdsUri = async () => { + if (process.env[exports.ENV_CMDS_RELATIVE_URI]) { + return { + hostname: CMDS_IP, + path: process.env[exports.ENV_CMDS_RELATIVE_URI], + }; } - return put$1; - }); - return fn(options); + if (process.env[exports.ENV_CMDS_FULL_URI]) { + const parsed = (0, url_1.parse)(process.env[exports.ENV_CMDS_FULL_URI]); + if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) { + throw new property_provider_1.CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, false); + } + if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) { + throw new property_provider_1.CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, false); + } + return { + ...parsed, + port: parsed.port ? parseInt(parsed.port, 10) : undefined, + }; + } + throw new property_provider_1.CredentialsProviderError("The container metadata credential provider cannot be used unless" + + ` the ${exports.ENV_CMDS_RELATIVE_URI} or ${exports.ENV_CMDS_FULL_URI} environment` + + " variable is set", false); }; -exports.createPut = createPut; - /***/ }), -/***/ 46969: +/***/ 55327: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createStat = configure.configure(api => { - async function stat(cid$1, options = {}) { - const res = await api.post('object/stat', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: `${ cid$1 }`, - ...options - }), - headers: options.headers - }); - const output = await res.json(); - return { - ...output, - Hash: cid.CID.parse(output.Hash) +exports.fromInstanceMetadata = void 0; +const node_config_provider_1 = __nccwpck_require__(86711); +const property_provider_1 = __nccwpck_require__(60846); +const InstanceMetadataV1FallbackError_1 = __nccwpck_require__(62431); +const httpRequest_1 = __nccwpck_require__(56971); +const ImdsCredentials_1 = __nccwpck_require__(44438); +const RemoteProviderInit_1 = __nccwpck_require__(68328); +const retry_1 = __nccwpck_require__(22119); +const getInstanceMetadataEndpoint_1 = __nccwpck_require__(78279); +const staticStabilityProvider_1 = __nccwpck_require__(18036); +const IMDS_PATH = "/latest/meta-data/iam/security-credentials/"; +const IMDS_TOKEN_PATH = "/latest/api/token"; +const AWS_EC2_METADATA_V1_DISABLED = "AWS_EC2_METADATA_V1_DISABLED"; +const PROFILE_AWS_EC2_METADATA_V1_DISABLED = "ec2_metadata_v1_disabled"; +const X_AWS_EC2_METADATA_TOKEN = "x-aws-ec2-metadata-token"; +const fromInstanceMetadata = (init = {}) => (0, staticStabilityProvider_1.staticStabilityProvider)(getInstanceImdsProvider(init), { logger: init.logger }); +exports.fromInstanceMetadata = fromInstanceMetadata; +const getInstanceImdsProvider = (init) => { + let disableFetchToken = false; + const { logger, profile } = init; + const { timeout, maxRetries } = (0, RemoteProviderInit_1.providerConfigFromInit)(init); + const getCredentials = async (maxRetries, options) => { + var _a; + const isImdsV1Fallback = disableFetchToken || ((_a = options.headers) === null || _a === void 0 ? void 0 : _a[X_AWS_EC2_METADATA_TOKEN]) == null; + if (isImdsV1Fallback) { + let fallbackBlockedFromProfile = false; + let fallbackBlockedFromProcessEnv = false; + const configValue = await (0, node_config_provider_1.loadConfig)({ + environmentVariableSelector: (env) => { + const envValue = env[AWS_EC2_METADATA_V1_DISABLED]; + fallbackBlockedFromProcessEnv = !!envValue && envValue !== "false"; + if (envValue === undefined) { + throw new property_provider_1.CredentialsProviderError(`${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`); + } + return fallbackBlockedFromProcessEnv; + }, + configFileSelector: (profile) => { + const profileValue = profile[PROFILE_AWS_EC2_METADATA_V1_DISABLED]; + fallbackBlockedFromProfile = !!profileValue && profileValue !== "false"; + return fallbackBlockedFromProfile; + }, + default: false, + }, { + profile, + })(); + if (init.ec2MetadataV1Disabled || configValue) { + const causes = []; + if (init.ec2MetadataV1Disabled) + causes.push("credential provider initialization (runtime option ec2MetadataV1Disabled)"); + if (fallbackBlockedFromProfile) + causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`); + if (fallbackBlockedFromProcessEnv) + causes.push(`process environment variable (${AWS_EC2_METADATA_V1_DISABLED})`); + throw new InstanceMetadataV1FallbackError_1.InstanceMetadataV1FallbackError(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${causes.join(", ")}].`); + } + } + const imdsProfile = (await (0, retry_1.retry)(async () => { + let profile; + try { + profile = await getProfile(options); + } + catch (err) { + if (err.statusCode === 401) { + disableFetchToken = false; + } + throw err; + } + return profile; + }, maxRetries)).trim(); + return (0, retry_1.retry)(async () => { + let creds; + try { + creds = await getCredentialsFromProfile(imdsProfile, options); + } + catch (err) { + if (err.statusCode === 401) { + disableFetchToken = false; + } + throw err; + } + return creds; + }, maxRetries); }; - } - return stat; + return async () => { + const endpoint = await (0, getInstanceMetadataEndpoint_1.getInstanceMetadataEndpoint)(); + if (disableFetchToken) { + logger === null || logger === void 0 ? void 0 : logger.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)"); + return getCredentials(maxRetries, { ...endpoint, timeout }); + } + else { + let token; + try { + token = (await getMetadataToken({ ...endpoint, timeout })).toString(); + } + catch (error) { + if ((error === null || error === void 0 ? void 0 : error.statusCode) === 400) { + throw Object.assign(error, { + message: "EC2 Metadata token request returned error", + }); + } + else if (error.message === "TimeoutError" || [403, 404, 405].includes(error.statusCode)) { + disableFetchToken = true; + } + logger === null || logger === void 0 ? void 0 : logger.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)"); + return getCredentials(maxRetries, { ...endpoint, timeout }); + } + return getCredentials(maxRetries, { + ...endpoint, + headers: { + [X_AWS_EC2_METADATA_TOKEN]: token, + }, + timeout, + }); + } + }; +}; +const getMetadataToken = async (options) => (0, httpRequest_1.httpRequest)({ + ...options, + path: IMDS_TOKEN_PATH, + method: "PUT", + headers: { + "x-aws-ec2-metadata-token-ttl-seconds": "21600", + }, }); - -exports.createStat = createStat; +const getProfile = async (options) => (await (0, httpRequest_1.httpRequest)({ ...options, path: IMDS_PATH })).toString(); +const getCredentialsFromProfile = async (profile, options) => { + const credsResponse = JSON.parse((await (0, httpRequest_1.httpRequest)({ + ...options, + path: IMDS_PATH + profile, + })).toString()); + if (!(0, ImdsCredentials_1.isImdsCredentials)(credsResponse)) { + throw new property_provider_1.CredentialsProviderError("Invalid response received from instance metadata service."); + } + return (0, ImdsCredentials_1.fromImdsCredentials)(credsResponse); +}; /***/ }), -/***/ 95440: +/***/ 95815: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var normaliseInput = __nccwpck_require__(44956); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createAddAll = configure.configure(api => { - async function* addAll(source, options = {}) { - for await (const {path, recursive, metadata} of normaliseInput.normaliseInput(source)) { - const res = await api.post('pin/add', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - ...options, - arg: path, - recursive, - metadata: metadata ? JSON.stringify(metadata) : undefined, - stream: true - }), - headers: options.headers - }); - for await (const pin of res.ndjson()) { - if (pin.Pins) { - for (const cid$1 of pin.Pins) { - yield cid.CID.parse(cid$1); - } - continue; - } - yield cid.CID.parse(pin); - } - } - } - return addAll; -}); - -exports.createAddAll = createAddAll; +exports.getInstanceMetadataEndpoint = exports.httpRequest = void 0; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(91587), exports); +tslib_1.__exportStar(__nccwpck_require__(55327), exports); +tslib_1.__exportStar(__nccwpck_require__(68328), exports); +tslib_1.__exportStar(__nccwpck_require__(6919), exports); +var httpRequest_1 = __nccwpck_require__(56971); +Object.defineProperty(exports, "httpRequest", ({ enumerable: true, get: function () { return httpRequest_1.httpRequest; } })); +var getInstanceMetadataEndpoint_1 = __nccwpck_require__(78279); +Object.defineProperty(exports, "getInstanceMetadataEndpoint", ({ enumerable: true, get: function () { return getInstanceMetadataEndpoint_1.getInstanceMetadataEndpoint; } })); /***/ }), -/***/ 52127: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 44438: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fromImdsCredentials = exports.isImdsCredentials = void 0; +const isImdsCredentials = (arg) => Boolean(arg) && + typeof arg === "object" && + typeof arg.AccessKeyId === "string" && + typeof arg.SecretAccessKey === "string" && + typeof arg.Token === "string" && + typeof arg.Expiration === "string"; +exports.isImdsCredentials = isImdsCredentials; +const fromImdsCredentials = (creds) => ({ + accessKeyId: creds.AccessKeyId, + secretAccessKey: creds.SecretAccessKey, + sessionToken: creds.Token, + expiration: new Date(creds.Expiration), +}); +exports.fromImdsCredentials = fromImdsCredentials; -var addAll = __nccwpck_require__(95440); -var last = __nccwpck_require__(28741); -var configure = __nccwpck_require__(31775); -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +/***/ }), -var last__default = /*#__PURE__*/_interopDefaultLegacy(last); +/***/ 68328: +/***/ ((__unused_webpack_module, exports) => { -function createAdd(config) { - const all = addAll.createAddAll(config); - return configure.configure(() => { - async function add(path, options = {}) { - return last__default["default"](all([{ - path, - ...options - }], options)); - } - return add; - })(config); -} -exports.createAdd = createAdd; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.providerConfigFromInit = exports.DEFAULT_MAX_RETRIES = exports.DEFAULT_TIMEOUT = void 0; +exports.DEFAULT_TIMEOUT = 1000; +exports.DEFAULT_MAX_RETRIES = 0; +const providerConfigFromInit = ({ maxRetries = exports.DEFAULT_MAX_RETRIES, timeout = exports.DEFAULT_TIMEOUT, }) => ({ maxRetries, timeout }); +exports.providerConfigFromInit = providerConfigFromInit; /***/ }), -/***/ 1115: +/***/ 56971: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var addAll = __nccwpck_require__(95440); -var add = __nccwpck_require__(52127); -var ls = __nccwpck_require__(17454); -var rmAll = __nccwpck_require__(56863); -var rm = __nccwpck_require__(73805); -var index = __nccwpck_require__(69617); - -function createPin(config) { - return { - addAll: addAll.createAddAll(config), - add: add.createAdd(config), - ls: ls.createLs(config), - rmAll: rmAll.createRmAll(config), - rm: rm.createRm(config), - remote: index.createRemote(config) - }; +exports.httpRequest = void 0; +const property_provider_1 = __nccwpck_require__(60846); +const buffer_1 = __nccwpck_require__(14300); +const http_1 = __nccwpck_require__(13685); +function httpRequest(options) { + return new Promise((resolve, reject) => { + var _a; + const req = (0, http_1.request)({ + method: "GET", + ...options, + hostname: (_a = options.hostname) === null || _a === void 0 ? void 0 : _a.replace(/^\[(.+)\]$/, "$1"), + }); + req.on("error", (err) => { + reject(Object.assign(new property_provider_1.ProviderError("Unable to connect to instance metadata service"), err)); + req.destroy(); + }); + req.on("timeout", () => { + reject(new property_provider_1.ProviderError("TimeoutError from instance metadata service")); + req.destroy(); + }); + req.on("response", (res) => { + const { statusCode = 400 } = res; + if (statusCode < 200 || 300 <= statusCode) { + reject(Object.assign(new property_provider_1.ProviderError("Error response received from instance metadata service"), { statusCode })); + req.destroy(); + } + const chunks = []; + res.on("data", (chunk) => { + chunks.push(chunk); + }); + res.on("end", () => { + resolve(buffer_1.Buffer.concat(chunks)); + req.destroy(); + }); + }); + req.end(); + }); } - -exports.createPin = createPin; +exports.httpRequest = httpRequest; /***/ }), -/***/ 17454: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 22119: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); - -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -function toPin(type, cid$1, metadata) { - const pin = { - type, - cid: cid.CID.parse(cid$1) - }; - if (metadata) { - pin.metadata = metadata; - } - return pin; -} -const createLs = configure.configure(api => { - async function* ls(options = {}) { - let paths = []; - if (options.paths) { - paths = Array.isArray(options.paths) ? options.paths : [options.paths]; - } - const res = await api.post('pin/ls', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - ...options, - arg: paths.map(path => `${ path }`), - stream: true - }), - headers: options.headers - }); - for await (const pin of res.ndjson()) { - if (pin.Keys) { - for (const cid of Object.keys(pin.Keys)) { - yield toPin(pin.Keys[cid].Type, cid, pin.Keys[cid].Metadata); - } - return; - } - yield toPin(pin.Type, pin.Cid, pin.Metadata); +exports.retry = void 0; +const retry = (toRetry, maxRetries) => { + let promise = toRetry(); + for (let i = 0; i < maxRetries; i++) { + promise = promise.catch(toRetry); } - } - return ls; -}); - -exports.createLs = createLs; + return promise; +}; +exports.retry = retry; /***/ }), -/***/ 96668: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 6919: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -var utils = __nccwpck_require__(21292); -function createAdd(client) { - async function add(cid, {timeout, signal, headers, ...query}) { - const response = await client.post('pin/remote/add', { - timeout, - signal, - headers, - searchParams: utils.encodeAddParams({ - cid, - ...query - }) - }); - return utils.decodePin(await response.json()); - } - return add; -} +/***/ }), + +/***/ 17315: +/***/ ((__unused_webpack_module, exports) => { + -exports.createAdd = createAdd; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getExtendedInstanceMetadataCredentials = void 0; +const STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60; +const STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60; +const STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html"; +const getExtendedInstanceMetadataCredentials = (credentials, logger) => { + var _a; + const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + + Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS); + const newExpiration = new Date(Date.now() + refreshInterval * 1000); + logger.warn("Attempting credential expiration extension due to a credential service availability issue. A refresh of these " + + "credentials will be attempted after ${new Date(newExpiration)}.\nFor more information, please visit: " + + STATIC_STABILITY_DOC_URL); + const originalExpiration = (_a = credentials.originalExpiration) !== null && _a !== void 0 ? _a : credentials.expiration; + return { + ...credentials, + ...(originalExpiration ? { originalExpiration } : {}), + expiration: newExpiration, + }; +}; +exports.getExtendedInstanceMetadataCredentials = getExtendedInstanceMetadataCredentials; /***/ }), -/***/ 69617: +/***/ 78279: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var core = __nccwpck_require__(66212); -var add = __nccwpck_require__(96668); -var ls = __nccwpck_require__(94900); -var rm = __nccwpck_require__(51590); -var rmAll = __nccwpck_require__(79654); -var index = __nccwpck_require__(94954); - -function createRemote(config) { - const client = new core.Client(config); - return { - add: add.createAdd(client), - ls: ls.createLs(client), - rm: rm.createRm(client), - rmAll: rmAll.createRmAll(client), - service: index.createService(config) - }; -} - -exports.createRemote = createRemote; +exports.getInstanceMetadataEndpoint = void 0; +const node_config_provider_1 = __nccwpck_require__(86711); +const url_parser_1 = __nccwpck_require__(45013); +const Endpoint_1 = __nccwpck_require__(10244); +const EndpointConfigOptions_1 = __nccwpck_require__(39949); +const EndpointMode_1 = __nccwpck_require__(31499); +const EndpointModeConfigOptions_1 = __nccwpck_require__(67171); +const getInstanceMetadataEndpoint = async () => (0, url_parser_1.parseUrl)((await getFromEndpointConfig()) || (await getFromEndpointModeConfig())); +exports.getInstanceMetadataEndpoint = getInstanceMetadataEndpoint; +const getFromEndpointConfig = async () => (0, node_config_provider_1.loadConfig)(EndpointConfigOptions_1.ENDPOINT_CONFIG_OPTIONS)(); +const getFromEndpointModeConfig = async () => { + const endpointMode = await (0, node_config_provider_1.loadConfig)(EndpointModeConfigOptions_1.ENDPOINT_MODE_CONFIG_OPTIONS)(); + switch (endpointMode) { + case EndpointMode_1.EndpointMode.IPv4: + return Endpoint_1.Endpoint.IPv4; + case EndpointMode_1.EndpointMode.IPv6: + return Endpoint_1.Endpoint.IPv6; + default: + throw new Error(`Unsupported endpoint mode: ${endpointMode}.` + ` Select from ${Object.values(EndpointMode_1.EndpointMode)}`); + } +}; /***/ }), -/***/ 94900: +/***/ 18036: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var utils = __nccwpck_require__(21292); - -function createLs(client) { - async function* ls({timeout, signal, headers, ...query}) { - const response = await client.post('pin/remote/ls', { - timeout, - signal, - headers, - searchParams: utils.encodeQuery(query) - }); - for await (const pin of response.ndjson()) { - yield utils.decodePin(pin); - } - } - return ls; -} - -exports.createLs = createLs; +exports.staticStabilityProvider = void 0; +const getExtendedInstanceMetadataCredentials_1 = __nccwpck_require__(17315); +const staticStabilityProvider = (provider, options = {}) => { + const logger = (options === null || options === void 0 ? void 0 : options.logger) || console; + let pastCredentials; + return async () => { + let credentials; + try { + credentials = await provider(); + if (credentials.expiration && credentials.expiration.getTime() < Date.now()) { + credentials = (0, getExtendedInstanceMetadataCredentials_1.getExtendedInstanceMetadataCredentials)(credentials, logger); + } + } + catch (e) { + if (pastCredentials) { + logger.warn("Credential renew failed: ", e); + credentials = (0, getExtendedInstanceMetadataCredentials_1.getExtendedInstanceMetadataCredentials)(pastCredentials, logger); + } + else { + throw e; + } + } + pastCredentials = credentials; + return credentials; + }; +}; +exports.staticStabilityProvider = staticStabilityProvider; /***/ }), -/***/ 79654: +/***/ 51516: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var utils = __nccwpck_require__(21292); - -function createRmAll(client) { - async function rmAll({timeout, signal, headers, ...query}) { - await client.post('pin/remote/rm', { - timeout, - signal, - headers, - searchParams: utils.encodeQuery({ - ...query, - all: true - }) - }); - } - return rmAll; +exports.EventStreamCodec = void 0; +const crc32_1 = __nccwpck_require__(95736); +const HeaderMarshaller_1 = __nccwpck_require__(80765); +const splitMessage_1 = __nccwpck_require__(59759); +class EventStreamCodec { + constructor(toUtf8, fromUtf8) { + this.headerMarshaller = new HeaderMarshaller_1.HeaderMarshaller(toUtf8, fromUtf8); + this.messageBuffer = []; + this.isEndOfStream = false; + } + feed(message) { + this.messageBuffer.push(this.decode(message)); + } + endOfStream() { + this.isEndOfStream = true; + } + getMessage() { + const message = this.messageBuffer.pop(); + const isEndOfStream = this.isEndOfStream; + return { + getMessage() { + return message; + }, + isEndOfStream() { + return isEndOfStream; + }, + }; + } + getAvailableMessages() { + const messages = this.messageBuffer; + this.messageBuffer = []; + const isEndOfStream = this.isEndOfStream; + return { + getMessages() { + return messages; + }, + isEndOfStream() { + return isEndOfStream; + }, + }; + } + encode({ headers: rawHeaders, body }) { + const headers = this.headerMarshaller.format(rawHeaders); + const length = headers.byteLength + body.byteLength + 16; + const out = new Uint8Array(length); + const view = new DataView(out.buffer, out.byteOffset, out.byteLength); + const checksum = new crc32_1.Crc32(); + view.setUint32(0, length, false); + view.setUint32(4, headers.byteLength, false); + view.setUint32(8, checksum.update(out.subarray(0, 8)).digest(), false); + out.set(headers, 12); + out.set(body, headers.byteLength + 12); + view.setUint32(length - 4, checksum.update(out.subarray(8, length - 4)).digest(), false); + return out; + } + decode(message) { + const { headers, body } = (0, splitMessage_1.splitMessage)(message); + return { headers: this.headerMarshaller.parse(headers), body }; + } + formatHeaders(rawHeaders) { + return this.headerMarshaller.format(rawHeaders); + } } - -exports.createRmAll = createRmAll; +exports.EventStreamCodec = EventStreamCodec; /***/ }), -/***/ 51590: +/***/ 80765: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var utils = __nccwpck_require__(21292); - -function createRm(client) { - async function rm({timeout, signal, headers, ...query}) { - await client.post('pin/remote/rm', { - timeout, - signal, - headers, - searchParams: utils.encodeQuery({ - ...query, - all: false - }) - }); - } - return rm; +exports.HeaderMarshaller = void 0; +const util_hex_encoding_1 = __nccwpck_require__(59878); +const Int64_1 = __nccwpck_require__(83026); +class HeaderMarshaller { + constructor(toUtf8, fromUtf8) { + this.toUtf8 = toUtf8; + this.fromUtf8 = fromUtf8; + } + format(headers) { + const chunks = []; + for (const headerName of Object.keys(headers)) { + const bytes = this.fromUtf8(headerName); + chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName])); + } + const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0)); + let position = 0; + for (const chunk of chunks) { + out.set(chunk, position); + position += chunk.byteLength; + } + return out; + } + formatHeaderValue(header) { + switch (header.type) { + case "boolean": + return Uint8Array.from([header.value ? 0 : 1]); + case "byte": + return Uint8Array.from([2, header.value]); + case "short": + const shortView = new DataView(new ArrayBuffer(3)); + shortView.setUint8(0, 3); + shortView.setInt16(1, header.value, false); + return new Uint8Array(shortView.buffer); + case "integer": + const intView = new DataView(new ArrayBuffer(5)); + intView.setUint8(0, 4); + intView.setInt32(1, header.value, false); + return new Uint8Array(intView.buffer); + case "long": + const longBytes = new Uint8Array(9); + longBytes[0] = 5; + longBytes.set(header.value.bytes, 1); + return longBytes; + case "binary": + const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength)); + binView.setUint8(0, 6); + binView.setUint16(1, header.value.byteLength, false); + const binBytes = new Uint8Array(binView.buffer); + binBytes.set(header.value, 3); + return binBytes; + case "string": + const utf8Bytes = this.fromUtf8(header.value); + const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength)); + strView.setUint8(0, 7); + strView.setUint16(1, utf8Bytes.byteLength, false); + const strBytes = new Uint8Array(strView.buffer); + strBytes.set(utf8Bytes, 3); + return strBytes; + case "timestamp": + const tsBytes = new Uint8Array(9); + tsBytes[0] = 8; + tsBytes.set(Int64_1.Int64.fromNumber(header.value.valueOf()).bytes, 1); + return tsBytes; + case "uuid": + if (!UUID_PATTERN.test(header.value)) { + throw new Error(`Invalid UUID received: ${header.value}`); + } + const uuidBytes = new Uint8Array(17); + uuidBytes[0] = 9; + uuidBytes.set((0, util_hex_encoding_1.fromHex)(header.value.replace(/\-/g, "")), 1); + return uuidBytes; + } + } + parse(headers) { + const out = {}; + let position = 0; + while (position < headers.byteLength) { + const nameLength = headers.getUint8(position++); + const name = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength)); + position += nameLength; + switch (headers.getUint8(position++)) { + case 0: + out[name] = { + type: BOOLEAN_TAG, + value: true, + }; + break; + case 1: + out[name] = { + type: BOOLEAN_TAG, + value: false, + }; + break; + case 2: + out[name] = { + type: BYTE_TAG, + value: headers.getInt8(position++), + }; + break; + case 3: + out[name] = { + type: SHORT_TAG, + value: headers.getInt16(position, false), + }; + position += 2; + break; + case 4: + out[name] = { + type: INT_TAG, + value: headers.getInt32(position, false), + }; + position += 4; + break; + case 5: + out[name] = { + type: LONG_TAG, + value: new Int64_1.Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)), + }; + position += 8; + break; + case 6: + const binaryLength = headers.getUint16(position, false); + position += 2; + out[name] = { + type: BINARY_TAG, + value: new Uint8Array(headers.buffer, headers.byteOffset + position, binaryLength), + }; + position += binaryLength; + break; + case 7: + const stringLength = headers.getUint16(position, false); + position += 2; + out[name] = { + type: STRING_TAG, + value: this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, stringLength)), + }; + position += stringLength; + break; + case 8: + out[name] = { + type: TIMESTAMP_TAG, + value: new Date(new Int64_1.Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf()), + }; + position += 8; + break; + case 9: + const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16); + position += 16; + out[name] = { + type: UUID_TAG, + value: `${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(0, 4))}-${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(4, 6))}-${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(6, 8))}-${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(8, 10))}-${(0, util_hex_encoding_1.toHex)(uuidBytes.subarray(10))}`, + }; + break; + default: + throw new Error(`Unrecognized header type tag`); + } + } + return out; + } } - -exports.createRm = createRm; +exports.HeaderMarshaller = HeaderMarshaller; +var HEADER_VALUE_TYPE; +(function (HEADER_VALUE_TYPE) { + HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["boolTrue"] = 0] = "boolTrue"; + HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["boolFalse"] = 1] = "boolFalse"; + HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["byte"] = 2] = "byte"; + HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["short"] = 3] = "short"; + HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["integer"] = 4] = "integer"; + HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["long"] = 5] = "long"; + HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["byteArray"] = 6] = "byteArray"; + HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["string"] = 7] = "string"; + HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["timestamp"] = 8] = "timestamp"; + HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["uuid"] = 9] = "uuid"; +})(HEADER_VALUE_TYPE || (HEADER_VALUE_TYPE = {})); +const BOOLEAN_TAG = "boolean"; +const BYTE_TAG = "byte"; +const SHORT_TAG = "short"; +const INT_TAG = "integer"; +const LONG_TAG = "long"; +const BINARY_TAG = "binary"; +const STRING_TAG = "string"; +const TIMESTAMP_TAG = "timestamp"; +const UUID_TAG = "uuid"; +const UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; /***/ }), -/***/ 93865: +/***/ 83026: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var toUrlSearchParams = __nccwpck_require__(52836); -var utils = __nccwpck_require__(73125); - -function createAdd(client) { - async function add(name, options) { - const {endpoint, key, headers, timeout, signal} = options; - await client.post('pin/remote/service/add', { - timeout, - signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: [ - name, - utils.encodeEndpoint(endpoint), - key - ] - }), - headers - }); - } - return add; +exports.Int64 = void 0; +const util_hex_encoding_1 = __nccwpck_require__(59878); +class Int64 { + constructor(bytes) { + this.bytes = bytes; + if (bytes.byteLength !== 8) { + throw new Error("Int64 buffers must be exactly 8 bytes"); + } + } + static fromNumber(number) { + if (number > 9223372036854776000 || number < -9223372036854776000) { + throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`); + } + const bytes = new Uint8Array(8); + for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) { + bytes[i] = remaining; + } + if (number < 0) { + negate(bytes); + } + return new Int64(bytes); + } + valueOf() { + const bytes = this.bytes.slice(0); + const negative = bytes[0] & 0b10000000; + if (negative) { + negate(bytes); + } + return parseInt((0, util_hex_encoding_1.toHex)(bytes), 16) * (negative ? -1 : 1); + } + toString() { + return String(this.valueOf()); + } +} +exports.Int64 = Int64; +function negate(bytes) { + for (let i = 0; i < 8; i++) { + bytes[i] ^= 0xff; + } + for (let i = 7; i > -1; i--) { + bytes[i]++; + if (bytes[i] !== 0) + break; + } } - -exports.createAdd = createAdd; /***/ }), -/***/ 94954: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 73182: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); -var core = __nccwpck_require__(66212); -var add = __nccwpck_require__(93865); -var ls = __nccwpck_require__(85974); -var rm = __nccwpck_require__(21021); - -function createService(config) { - const client = new core.Client(config); - return { - add: add.createAdd(client), - ls: ls.createLs(client), - rm: rm.createRm(client) - }; -} - -exports.createService = createService; - /***/ }), -/***/ 85974: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 26674: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); - -var toUrlSearchParams = __nccwpck_require__(52836); -var utils = __nccwpck_require__(73125); - -function createLs(client) { - async function ls(options = {}) { - const {stat, headers, timeout, signal} = options; - const response = await client.post('pin/remote/service/ls', { - timeout, - signal, - headers, - searchParams: stat === true ? toUrlSearchParams.toUrlSearchParams({ stat }) : undefined - }); - const {RemoteServices} = await response.json(); - return RemoteServices.map(utils.decodeRemoteService); - } - return ls; +exports.MessageDecoderStream = void 0; +class MessageDecoderStream { + constructor(options) { + this.options = options; + } + [Symbol.asyncIterator]() { + return this.asyncIterator(); + } + async *asyncIterator() { + for await (const bytes of this.options.inputStream) { + const decoded = this.options.decoder.decode(bytes); + yield decoded; + } + } } - -exports.createLs = createLs; +exports.MessageDecoderStream = MessageDecoderStream; /***/ }), -/***/ 21021: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 44311: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); - -var toUrlSearchParams = __nccwpck_require__(52836); - -function createRm(client) { - async function rm(name, options = {}) { - await client.post('pin/remote/service/rm', { - signal: options.signal, - headers: options.headers, - searchParams: toUrlSearchParams.toUrlSearchParams({ arg: name }) - }); - } - return rm; +exports.MessageEncoderStream = void 0; +class MessageEncoderStream { + constructor(options) { + this.options = options; + } + [Symbol.asyncIterator]() { + return this.asyncIterator(); + } + async *asyncIterator() { + for await (const msg of this.options.messageStream) { + const encoded = this.options.encoder.encode(msg); + yield encoded; + } + if (this.options.includeEndFrame) { + yield new Uint8Array(0); + } + } } - -exports.createRm = createRm; +exports.MessageEncoderStream = MessageEncoderStream; /***/ }), -/***/ 73125: +/***/ 25398: /***/ ((__unused_webpack_module, exports) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -function encodeEndpoint(url) { - const href = String(url); - if (href === 'undefined') { - throw Error('endpoint is required'); - } - return href[href.length - 1] === '/' ? href.slice(0, -1) : href; -} -function decodeRemoteService(json) { - return { - service: json.Service, - endpoint: new URL(json.ApiEndpoint), - ...json.Stat && { stat: decodeStat(json.Stat) } - }; -} -function decodeStat(json) { - switch (json.Status) { - case 'valid': { - const {Pinning, Pinned, Queued, Failed} = json.PinCount; - return { - status: 'valid', - pinCount: { - queued: Queued, - pinning: Pinning, - pinned: Pinned, - failed: Failed - } - }; +exports.SmithyMessageDecoderStream = void 0; +class SmithyMessageDecoderStream { + constructor(options) { + this.options = options; } - case 'invalid': { - return { status: 'invalid' }; + [Symbol.asyncIterator]() { + return this.asyncIterator(); } - default: { - return { status: json.Status }; + async *asyncIterator() { + for await (const message of this.options.messageStream) { + const deserialized = await this.options.deserializer(message); + if (deserialized === undefined) + continue; + yield deserialized; + } } - } } - -exports.decodeRemoteService = decodeRemoteService; -exports.decodeStat = decodeStat; -exports.encodeEndpoint = encodeEndpoint; +exports.SmithyMessageDecoderStream = SmithyMessageDecoderStream; /***/ }), -/***/ 21292: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 77536: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); - -var cid = __nccwpck_require__(24247); -var toUrlSearchParams = __nccwpck_require__(52836); - -const decodePin = ({ - Name: name, - Status: status, - Cid: cid$1 -}) => { - return { - cid: cid.CID.parse(cid$1), - name, - status - }; -}; -const encodeService = service => { - if (typeof service === 'string' && service !== '') { - return service; - } else { - throw new TypeError('service name must be passed'); - } -}; -const encodeCID = cid$1 => { - if (cid.CID.asCID(cid$1)) { - return cid$1.toString(); - } else { - throw new TypeError(`CID instance expected instead of ${ typeof cid$1 }`); - } -}; -const encodeQuery = ({service, cid, name, status, all}) => { - const query = toUrlSearchParams.toUrlSearchParams({ - service: encodeService(service), - name, - force: all ? true : undefined - }); - if (cid) { - for (const value of cid) { - query.append('cid', encodeCID(value)); +exports.SmithyMessageEncoderStream = void 0; +class SmithyMessageEncoderStream { + constructor(options) { + this.options = options; } - } - if (status) { - for (const value of status) { - query.append('status', value); + [Symbol.asyncIterator]() { + return this.asyncIterator(); } - } - return query; -}; -const encodeAddParams = ({cid, service, background, name, origins}) => { - const params = toUrlSearchParams.toUrlSearchParams({ - arg: encodeCID(cid), - service: encodeService(service), - name, - background: background ? true : undefined - }); - if (origins) { - for (const origin of origins) { - params.append('origin', origin.toString()); + async *asyncIterator() { + for await (const chunk of this.options.inputStream) { + const payloadBuf = this.options.serializer(chunk); + yield payloadBuf; + } } - } - return params; -}; - -exports.decodePin = decodePin; -exports.encodeAddParams = encodeAddParams; -exports.encodeCID = encodeCID; -exports.encodeQuery = encodeQuery; -exports.encodeService = encodeService; +} +exports.SmithyMessageEncoderStream = SmithyMessageEncoderStream; /***/ }), -/***/ 56863: +/***/ 98807: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var normaliseInput = __nccwpck_require__(44956); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createRmAll = configure.configure(api => { - async function* rmAll(source, options = {}) { - for await (const {path, recursive} of normaliseInput.normaliseInput(source)) { - const searchParams = new URLSearchParams(options.searchParams); - searchParams.append('arg', `${ path }`); - if (recursive != null) - searchParams.set('recursive', String(recursive)); - const res = await api.post('pin/rm', { - signal: options.signal, - headers: options.headers, - searchParams: toUrlSearchParams.toUrlSearchParams({ - ...options, - arg: `${ path }`, - recursive - }) - }); - for await (const pin of res.ndjson()) { - if (pin.Pins) { - yield* pin.Pins.map(cid$1 => cid.CID.parse(cid$1)); - continue; - } - yield cid.CID.parse(pin); - } - } - } - return rmAll; -}); - -exports.createRmAll = createRmAll; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(51516), exports); +tslib_1.__exportStar(__nccwpck_require__(80765), exports); +tslib_1.__exportStar(__nccwpck_require__(83026), exports); +tslib_1.__exportStar(__nccwpck_require__(73182), exports); +tslib_1.__exportStar(__nccwpck_require__(26674), exports); +tslib_1.__exportStar(__nccwpck_require__(44311), exports); +tslib_1.__exportStar(__nccwpck_require__(25398), exports); +tslib_1.__exportStar(__nccwpck_require__(77536), exports); /***/ }), -/***/ 73805: +/***/ 59759: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var rmAll = __nccwpck_require__(56863); -var last = __nccwpck_require__(28741); -var configure = __nccwpck_require__(31775); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var last__default = /*#__PURE__*/_interopDefaultLegacy(last); - -const createRm = config => { - const all = rmAll.createRmAll(config); - return configure.configure(() => { - async function rm(path, options = {}) { - return last__default["default"](all([{ - path, - ...options - }], options)); +exports.splitMessage = void 0; +const crc32_1 = __nccwpck_require__(95736); +const PRELUDE_MEMBER_LENGTH = 4; +const PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2; +const CHECKSUM_LENGTH = 4; +const MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2; +function splitMessage({ byteLength, byteOffset, buffer }) { + if (byteLength < MINIMUM_MESSAGE_LENGTH) { + throw new Error("Provided message too short to accommodate event stream message overhead"); } - return rm; - })(config); -}; - -exports.createRm = createRm; + const view = new DataView(buffer, byteOffset, byteLength); + const messageLength = view.getUint32(0, false); + if (byteLength !== messageLength) { + throw new Error("Reported message length does not match received message length"); + } + const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false); + const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false); + const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false); + const checksummer = new crc32_1.Crc32().update(new Uint8Array(buffer, byteOffset, PRELUDE_LENGTH)); + if (expectedPreludeChecksum !== checksummer.digest()) { + throw new Error(`The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digest()})`); + } + checksummer.update(new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH, byteLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH))); + if (expectedMessageChecksum !== checksummer.digest()) { + throw new Error(`The message checksum (${checksummer.digest()}) did not match the expected value of ${expectedMessageChecksum}`); + } + return { + headers: new DataView(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH, headerLength), + body: new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH + headerLength, messageLength - headerLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH + CHECKSUM_LENGTH)), + }; +} +exports.splitMessage = splitMessage; /***/ }), -/***/ 25466: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 91275: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); - -var objectToCamel = __nccwpck_require__(62268); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createPing = configure.configure(api => { - async function* ping(peerId, options = {}) { - const res = await api.post('ping', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: `${ peerId }`, - ...options - }), - headers: options.headers, - transform: objectToCamel.objectToCamel - }); - yield* res.ndjson(); - } - return ping; +exports.resolveEventStreamSerdeConfig = void 0; +const resolveEventStreamSerdeConfig = (input) => ({ + ...input, + eventStreamMarshaller: input.eventStreamSerdeProvider(input), }); - -exports.createPing = createPing; +exports.resolveEventStreamSerdeConfig = resolveEventStreamSerdeConfig; /***/ }), -/***/ 38248: +/***/ 41350: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var ls = __nccwpck_require__(16114); -var peers = __nccwpck_require__(47504); -var publish = __nccwpck_require__(39969); -var subscribe = __nccwpck_require__(13073); -var unsubscribe = __nccwpck_require__(20939); -var subscriptionTracker = __nccwpck_require__(34690); - -function createPubsub(config) { - const subscriptionTracker$1 = new subscriptionTracker.SubscriptionTracker(); - return { - ls: ls.createLs(config), - peers: peers.createPeers(config), - publish: publish.createPublish(config), - subscribe: subscribe.createSubscribe(config, subscriptionTracker$1), - unsubscribe: unsubscribe.createUnsubscribe(config, subscriptionTracker$1) - }; -} - -exports.createPubsub = createPubsub; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(91275), exports); /***/ }), -/***/ 16114: +/***/ 3960: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var httpRpcWireFormat = __nccwpck_require__(29208); - -const createLs = configure.configure(api => { - async function ls(options = {}) { - const {Strings} = await (await api.post('pubsub/ls', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - })).json(); - return httpRpcWireFormat.rpcArrayToTextArray(Strings) || []; - } - return ls; -}); - -exports.createLs = createLs; +exports.EventStreamMarshaller = void 0; +const eventstream_serde_universal_1 = __nccwpck_require__(99442); +const stream_1 = __nccwpck_require__(12781); +const utils_1 = __nccwpck_require__(93604); +class EventStreamMarshaller { + constructor({ utf8Encoder, utf8Decoder }) { + this.universalMarshaller = new eventstream_serde_universal_1.EventStreamMarshaller({ + utf8Decoder, + utf8Encoder, + }); + } + deserialize(body, deserializer) { + const bodyIterable = typeof body[Symbol.asyncIterator] === "function" ? body : (0, utils_1.readabletoIterable)(body); + return this.universalMarshaller.deserialize(bodyIterable, deserializer); + } + serialize(input, serializer) { + return stream_1.Readable.from(this.universalMarshaller.serialize(input, serializer)); + } +} +exports.EventStreamMarshaller = EventStreamMarshaller; /***/ }), -/***/ 47504: +/***/ 99697: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var httpRpcWireFormat = __nccwpck_require__(29208); - -const createPeers = configure.configure(api => { - async function peers(topic, options = {}) { - const res = await api.post('pubsub/peers', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: httpRpcWireFormat.textToUrlSafeRpc(topic), - ...options - }), - headers: options.headers - }); - const {Strings} = await res.json(); - return Strings || []; - } - return peers; -}); - -exports.createPeers = createPeers; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(3960), exports); +tslib_1.__exportStar(__nccwpck_require__(53271), exports); /***/ }), -/***/ 39969: +/***/ 53271: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var multipartRequest = __nccwpck_require__(87527); -var abortSignal = __nccwpck_require__(14594); -var httpRpcWireFormat = __nccwpck_require__(29208); -var nativeAbortController = __nccwpck_require__(43586); - -const createPublish = configure.configure(api => { - async function publish(topic, data, options = {}) { - const searchParams = toUrlSearchParams.toUrlSearchParams({ - arg: httpRpcWireFormat.textToUrlSafeRpc(topic), - ...options - }); - const controller = new nativeAbortController.AbortController(); - const signal = abortSignal.abortSignal(controller.signal, options.signal); - const res = await api.post('pubsub/pub', { - signal, - searchParams, - ...await multipartRequest.multipartRequest([data], controller, options.headers) - }); - await res.text(); - } - return publish; -}); - -exports.createPublish = createPublish; +exports.eventStreamSerdeProvider = void 0; +const EventStreamMarshaller_1 = __nccwpck_require__(3960); +const eventStreamSerdeProvider = (options) => new EventStreamMarshaller_1.EventStreamMarshaller(options); +exports.eventStreamSerdeProvider = eventStreamSerdeProvider; /***/ }), -/***/ 13073: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 93604: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); - -var debug = __nccwpck_require__(58923); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var httpRpcWireFormat = __nccwpck_require__(29208); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var debug__default = /*#__PURE__*/_interopDefaultLegacy(debug); - -const log = debug__default["default"]('ipfs-http-client:pubsub:subscribe'); -const createSubscribe = (options, subsTracker) => { - return configure.configure(api => { - async function subscribe(topic, handler, options = {}) { - options.signal = subsTracker.subscribe(topic, handler, options.signal); - let done; - let fail; - const result = new Promise((resolve, reject) => { - done = resolve; - fail = reject; - }); - const ffWorkaround = setTimeout(() => done(), 1000); - api.post('pubsub/sub', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: httpRpcWireFormat.textToUrlSafeRpc(topic), - ...options - }), - headers: options.headers - }).catch(err => { - subsTracker.unsubscribe(topic, handler); - fail(err); - }).then(response => { - clearTimeout(ffWorkaround); - if (!response) { - return; +exports.readabletoIterable = void 0; +async function* readabletoIterable(readStream) { + let streamEnded = false; + let generationEnded = false; + const records = new Array(); + readStream.on("error", (err) => { + if (!streamEnded) { + streamEnded = true; } - readMessages(response, { - onMessage: handler, - onEnd: () => subsTracker.unsubscribe(topic, handler), - onError: options.onError - }); - done(); - }); - return result; - } - return subscribe; - })(options); -}; -async function readMessages(response, {onMessage, onEnd, onError}) { - onError = onError || log; - try { - for await (const msg of response.ndjson()) { - try { - if (!msg.from) { - continue; + if (err) { + throw err; } - onMessage({ - from: msg.from, - data: httpRpcWireFormat.rpcToBytes(msg.data), - seqno: httpRpcWireFormat.rpcToBytes(msg.seqno), - topicIDs: httpRpcWireFormat.rpcArrayToTextArray(msg.topicIDs) - }); - } catch (err) { - err.message = `Failed to parse pubsub message: ${ err.message }`; - onError(err, false, msg); - } - } - } catch (err) { - if (!isAbortError(err)) { - onError(err, true); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - } - } finally { - if (options.preventCancel !== true) { - reader.cancel() + }); + readStream.on("data", (data) => { + records.push(data); + }); + readStream.on("end", () => { + streamEnded = true; + }); + while (!generationEnded) { + const value = await new Promise((resolve) => setTimeout(() => resolve(records.shift()), 0)); + if (value) { + yield value; + } + generationEnded = streamEnded && records.length === 0; } - - reader.releaseLock() - } } - -module.exports = browserReadableStreamToIt +exports.readabletoIterable = readabletoIterable; /***/ }), -<<<<<<< HEAD -/***/ 72871: -======= -/***/ 34690: +/***/ 60237: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var nativeAbortController = __nccwpck_require__(43586); - -class SubscriptionTracker { - constructor() { - this._subs = new Map(); - } - subscribe(topic, handler, signal) { - const topicSubs = this._subs.get(topic) || []; - if (topicSubs.find(s => s.handler === handler)) { - throw new Error(`Already subscribed to ${ topic } with this handler`); - } - const controller = new nativeAbortController.AbortController(); - this._subs.set(topic, [{ - handler, - controller - }].concat(topicSubs)); - if (signal) { - signal.addEventListener('abort', () => this.unsubscribe(topic, handler)); +exports.EventStreamMarshaller = void 0; +const eventstream_codec_1 = __nccwpck_require__(98807); +const getChunkedStream_1 = __nccwpck_require__(72457); +const getUnmarshalledStream_1 = __nccwpck_require__(74604); +class EventStreamMarshaller { + constructor({ utf8Encoder, utf8Decoder }) { + this.eventStreamCodec = new eventstream_codec_1.EventStreamCodec(utf8Encoder, utf8Decoder); + this.utfEncoder = utf8Encoder; } - return controller.signal; - } - unsubscribe(topic, handler) { - const subs = this._subs.get(topic) || []; - let unsubs; - if (handler) { - this._subs.set(topic, subs.filter(s => s.handler !== handler)); - unsubs = subs.filter(s => s.handler === handler); - } else { - this._subs.set(topic, []); - unsubs = subs; + deserialize(body, deserializer) { + const inputStream = (0, getChunkedStream_1.getChunkedStream)(body); + return new eventstream_codec_1.SmithyMessageDecoderStream({ + messageStream: new eventstream_codec_1.MessageDecoderStream({ inputStream, decoder: this.eventStreamCodec }), + deserializer: (0, getUnmarshalledStream_1.getMessageUnmarshaller)(deserializer, this.utfEncoder), + }); } - if (!(this._subs.get(topic) || []).length) { - this._subs.delete(topic); + serialize(inputStream, serializer) { + return new eventstream_codec_1.MessageEncoderStream({ + messageStream: new eventstream_codec_1.SmithyMessageEncoderStream({ inputStream, serializer }), + encoder: this.eventStreamCodec, + includeEndFrame: true, + }); } - unsubs.forEach(s => s.controller.abort()); - } } - -exports.SubscriptionTracker = SubscriptionTracker; +exports.EventStreamMarshaller = EventStreamMarshaller; /***/ }), -/***/ 20939: +/***/ 72457: /***/ ((__unused_webpack_module, exports) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -const createUnsubscribe = (options, subsTracker) => { - async function unsubscribe(topic, handler) { - subsTracker.unsubscribe(topic, handler); - } - return unsubscribe; -}; - -exports.createUnsubscribe = createUnsubscribe; +exports.getChunkedStream = void 0; +function getChunkedStream(source) { + let currentMessageTotalLength = 0; + let currentMessagePendingLength = 0; + let currentMessage = null; + let messageLengthBuffer = null; + const allocateMessage = (size) => { + if (typeof size !== "number") { + throw new Error("Attempted to allocate an event message where size was not a number: " + size); + } + currentMessageTotalLength = size; + currentMessagePendingLength = 4; + currentMessage = new Uint8Array(size); + const currentMessageView = new DataView(currentMessage.buffer); + currentMessageView.setUint32(0, size, false); + }; + const iterator = async function* () { + const sourceIterator = source[Symbol.asyncIterator](); + while (true) { + const { value, done } = await sourceIterator.next(); + if (done) { + if (!currentMessageTotalLength) { + return; + } + else if (currentMessageTotalLength === currentMessagePendingLength) { + yield currentMessage; + } + else { + throw new Error("Truncated event message received."); + } + return; + } + const chunkLength = value.length; + let currentOffset = 0; + while (currentOffset < chunkLength) { + if (!currentMessage) { + const bytesRemaining = chunkLength - currentOffset; + if (!messageLengthBuffer) { + messageLengthBuffer = new Uint8Array(4); + } + const numBytesForTotal = Math.min(4 - currentMessagePendingLength, bytesRemaining); + messageLengthBuffer.set(value.slice(currentOffset, currentOffset + numBytesForTotal), currentMessagePendingLength); + currentMessagePendingLength += numBytesForTotal; + currentOffset += numBytesForTotal; + if (currentMessagePendingLength < 4) { + break; + } + allocateMessage(new DataView(messageLengthBuffer.buffer).getUint32(0, false)); + messageLengthBuffer = null; + } + const numBytesToWrite = Math.min(currentMessageTotalLength - currentMessagePendingLength, chunkLength - currentOffset); + currentMessage.set(value.slice(currentOffset, currentOffset + numBytesToWrite), currentMessagePendingLength); + currentMessagePendingLength += numBytesToWrite; + currentOffset += numBytesToWrite; + if (currentMessageTotalLength && currentMessageTotalLength === currentMessagePendingLength) { + yield currentMessage; + currentMessage = null; + currentMessageTotalLength = 0; + currentMessagePendingLength = 0; + } + } + } + }; + return { + [Symbol.asyncIterator]: iterator, + }; +} +exports.getChunkedStream = getChunkedStream; /***/ }), -/***/ 50782: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 74604: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); - -var cid = __nccwpck_require__(24247); -var objectToCamel = __nccwpck_require__(62268); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); -var local = __nccwpck_require__(77565); - -const createRefs = configure.configure((api, opts) => { - const refs = async function* (args, options = {}) { - const argsArr = Array.isArray(args) ? args : [args]; - const res = await api.post('refs', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: argsArr.map(arg => `${ arg instanceof Uint8Array ? cid.CID.decode(arg) : arg }`), - ...options - }), - headers: options.headers, - transform: objectToCamel.objectToCamel - }); - yield* res.ndjson(); - }; - return Object.assign(refs, { local: local.createLocal(opts) }); -}); - -exports.createRefs = createRefs; +exports.getMessageUnmarshaller = exports.getUnmarshalledStream = void 0; +function getUnmarshalledStream(source, options) { + const messageUnmarshaller = getMessageUnmarshaller(options.deserializer, options.toUtf8); + return { + [Symbol.asyncIterator]: async function* () { + for await (const chunk of source) { + const message = options.eventStreamCodec.decode(chunk); + const type = await messageUnmarshaller(message); + if (type === undefined) + continue; + yield type; + } + }, + }; +} +exports.getUnmarshalledStream = getUnmarshalledStream; +function getMessageUnmarshaller(deserializer, toUtf8) { + return async function (message) { + const { value: messageType } = message.headers[":message-type"]; + if (messageType === "error") { + const unmodeledError = new Error(message.headers[":error-message"].value || "UnknownError"); + unmodeledError.name = message.headers[":error-code"].value; + throw unmodeledError; + } + else if (messageType === "exception") { + const code = message.headers[":exception-type"].value; + const exception = { [code]: message }; + const deserializedException = await deserializer(exception); + if (deserializedException.$unknown) { + const error = new Error(toUtf8(message.body)); + error.name = code; + throw error; + } + throw deserializedException[code]; + } + else if (messageType === "event") { + const event = { + [message.headers[":event-type"].value]: message, + }; + const deserialized = await deserializer(event); + if (deserialized.$unknown) + return; + return deserialized; + } + else { + throw Error(`Unrecognizable event type: ${message.headers[":event-type"].value}`); + } + }; +} +exports.getMessageUnmarshaller = getMessageUnmarshaller; /***/ }), -/***/ 77565: +/***/ 99442: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var objectToCamel = __nccwpck_require__(62268); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createLocal = configure.configure(api => { - async function* refsLocal(options = {}) { - const res = await api.post('refs/local', { - signal: options.signal, - transform: objectToCamel.objectToCamel, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - }); - yield* res.ndjson(); - } - return refsLocal; -}); - -exports.createLocal = createLocal; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(60237), exports); +tslib_1.__exportStar(__nccwpck_require__(69965), exports); /***/ }), -/***/ 51417: +/***/ 69965: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var cid = __nccwpck_require__(24247); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createGc = configure.configure(api => { - async function* gc(options = {}) { - const res = await api.post('repo/gc', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers, - transform: res => { - return { - err: res.Error ? new Error(res.Error) : null, - cid: (res.Key || {})['/'] ? cid.CID.parse(res.Key['/']) : null - }; - } - }); - yield* res.ndjson(); - } - return gc; -}); - -exports.createGc = createGc; +exports.eventStreamSerdeProvider = void 0; +const EventStreamMarshaller_1 = __nccwpck_require__(60237); +const eventStreamSerdeProvider = (options) => new EventStreamMarshaller_1.EventStreamMarshaller(options); +exports.eventStreamSerdeProvider = eventStreamSerdeProvider; /***/ }), -/***/ 65381: +/***/ 3127: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var gc = __nccwpck_require__(51417); -var stat = __nccwpck_require__(48097); -var version = __nccwpck_require__(74956); - -function createRepo(config) { - return { - gc: gc.createGc(config), - stat: stat.createStat(config), - version: version.createVersion(config) - }; +exports.Hash = void 0; +const util_buffer_from_1 = __nccwpck_require__(39082); +const util_utf8_1 = __nccwpck_require__(97788); +const buffer_1 = __nccwpck_require__(14300); +const crypto_1 = __nccwpck_require__(6113); +class Hash { + constructor(algorithmIdentifier, secret) { + this.algorithmIdentifier = algorithmIdentifier; + this.secret = secret; + this.reset(); + } + update(toHash, encoding) { + this.hash.update((0, util_utf8_1.toUint8Array)(castSourceData(toHash, encoding))); + } + digest() { + return Promise.resolve(this.hash.digest()); + } + reset() { + this.hash = this.secret + ? (0, crypto_1.createHmac)(this.algorithmIdentifier, castSourceData(this.secret)) + : (0, crypto_1.createHash)(this.algorithmIdentifier); + } +} +exports.Hash = Hash; +function castSourceData(toCast, encoding) { + if (buffer_1.Buffer.isBuffer(toCast)) { + return toCast; + } + if (typeof toCast === "string") { + return (0, util_buffer_from_1.fromString)(toCast, encoding); + } + if (ArrayBuffer.isView(toCast)) { + return (0, util_buffer_from_1.fromArrayBuffer)(toCast.buffer, toCast.byteOffset, toCast.byteLength); + } + return (0, util_buffer_from_1.fromArrayBuffer)(toCast); } - -exports.createRepo = createRepo; /***/ }), -/***/ 48097: +/***/ 27849: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createStat = configure.configure(api => { - async function stat(options = {}) { - const res = await api.post('repo/stat', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - }); - const data = await res.json(); - return { - numObjects: BigInt(data.NumObjects), - repoSize: BigInt(data.RepoSize), - repoPath: data.RepoPath, - version: data.Version, - storageMax: BigInt(data.StorageMax) - }; - } - return stat; -}); - -exports.createStat = createStat; +exports.HashCalculator = void 0; +const util_utf8_1 = __nccwpck_require__(97788); +const stream_1 = __nccwpck_require__(12781); +class HashCalculator extends stream_1.Writable { + constructor(hash, options) { + super(options); + this.hash = hash; + } + _write(chunk, encoding, callback) { + try { + this.hash.update((0, util_utf8_1.toUint8Array)(chunk)); + } + catch (err) { + return callback(err); + } + callback(); + } +} +exports.HashCalculator = HashCalculator; /***/ }), -/***/ 74956: +/***/ 22066: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createVersion = configure.configure(api => { - async function version(options = {}) { - const res = await (await api.post('repo/version', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - })).json(); - return res.Version; - } - return version; +exports.fileStreamHasher = void 0; +const fs_1 = __nccwpck_require__(57147); +const HashCalculator_1 = __nccwpck_require__(27849); +const fileStreamHasher = (hashCtor, fileStream) => new Promise((resolve, reject) => { + if (!isReadStream(fileStream)) { + reject(new Error("Unable to calculate hash for non-file streams.")); + return; + } + const fileStreamTee = (0, fs_1.createReadStream)(fileStream.path, { + start: fileStream.start, + end: fileStream.end, + }); + const hash = new hashCtor(); + const hashCalculator = new HashCalculator_1.HashCalculator(hash); + fileStreamTee.pipe(hashCalculator); + fileStreamTee.on("error", (err) => { + hashCalculator.end(); + reject(err); + }); + hashCalculator.on("error", reject); + hashCalculator.on("finish", function () { + hash.digest().then(resolve).catch(reject); + }); }); - -exports.createVersion = createVersion; +exports.fileStreamHasher = fileStreamHasher; +const isReadStream = (stream) => typeof stream.path === "string"; /***/ }), -/***/ 38587: +/***/ 94420: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createResolve = configure.configure(api => { - async function resolve(path, options = {}) { - const res = await api.post('resolve', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: path, - ...options - }), - headers: options.headers - }); - const {Path} = await res.json(); - return Path; - } - return resolve; -}); -exports.createResolve = createResolve; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(22066), exports); +tslib_1.__exportStar(__nccwpck_require__(63122), exports); /***/ }), -/***/ 86476: +/***/ 63122: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.readableStreamHasher = void 0; +const HashCalculator_1 = __nccwpck_require__(27849); +const readableStreamHasher = (hashCtor, readableStream) => { + if (readableStream.readableFlowing !== null) { + throw new Error("Unable to calculate hash for flowing readable stream"); + } + const hash = new hashCtor(); + const hashCalculator = new HashCalculator_1.HashCalculator(hash); + readableStream.pipe(hashCalculator); + return new Promise((resolve, reject) => { + readableStream.on("error", (err) => { + hashCalculator.end(); + reject(err); + }); + hashCalculator.on("error", reject); + hashCalculator.on("finish", () => { + hash.digest().then(resolve).catch(reject); + }); + }); +}; +exports.readableStreamHasher = readableStreamHasher; -var configure = __nccwpck_require__(31775); -var errCode = __nccwpck_require__(5822); -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +/***/ }), -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); +/***/ 52807: +/***/ ((__unused_webpack_module, exports) => { -const createStart = configure.configure(api => { - const start = async (options = {}) => { - throw errCode__default["default"](new Error('Not implemented'), 'ERR_NOT_IMPLEMENTED'); - }; - return start; -}); -exports.createStart = createStart; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isArrayBuffer = void 0; +const isArrayBuffer = (arg) => (typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer) || + Object.prototype.toString.call(arg) === "[object ArrayBuffer]"; +exports.isArrayBuffer = isArrayBuffer; /***/ }), -/***/ 14486: +/***/ 48468: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createBw = configure.configure(api => { - async function* bw(options = {}) { - const res = await api.post('stats/bw', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers, - transform: stats => ({ - totalIn: BigInt(stats.TotalIn), - totalOut: BigInt(stats.TotalOut), - rateIn: parseFloat(stats.RateIn), - rateOut: parseFloat(stats.RateOut) - }) - }); - yield* res.ndjson(); - } - return bw; +exports.getContentLengthPlugin = exports.contentLengthMiddlewareOptions = exports.contentLengthMiddleware = void 0; +const protocol_http_1 = __nccwpck_require__(76232); +const CONTENT_LENGTH_HEADER = "content-length"; +function contentLengthMiddleware(bodyLengthChecker) { + return (next) => async (args) => { + const request = args.request; + if (protocol_http_1.HttpRequest.isInstance(request)) { + const { body, headers } = request; + if (body && + Object.keys(headers) + .map((str) => str.toLowerCase()) + .indexOf(CONTENT_LENGTH_HEADER) === -1) { + try { + const length = bodyLengthChecker(body); + request.headers = { + ...request.headers, + [CONTENT_LENGTH_HEADER]: String(length), + }; + } + catch (error) { + } + } + } + return next({ + ...args, + request, + }); + }; +} +exports.contentLengthMiddleware = contentLengthMiddleware; +exports.contentLengthMiddlewareOptions = { + step: "build", + tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"], + name: "contentLengthMiddleware", + override: true, +}; +const getContentLengthPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), exports.contentLengthMiddlewareOptions); + }, }); - -exports.createBw = createBw; +exports.getContentLengthPlugin = getContentLengthPlugin; /***/ }), -/***/ 39825: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +/***/ 5236: +/***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); - -var stat = __nccwpck_require__(70104); -var stat$1 = __nccwpck_require__(48097); -var bw = __nccwpck_require__(14486); - -function createStats(config) { - return { - bitswap: stat.createStat(config), - repo: stat$1.createStat(config), - bw: bw.createBw(config) - }; -} - -exports.createStats = createStats; +exports.createConfigValueProvider = void 0; +const createConfigValueProvider = (configKey, canonicalEndpointParamKey, config) => { + const configProvider = async () => { + var _a; + const configValue = (_a = config[configKey]) !== null && _a !== void 0 ? _a : config[canonicalEndpointParamKey]; + if (typeof configValue === "function") { + return configValue(); + } + return configValue; + }; + if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") { + return async () => { + const endpoint = await configProvider(); + if (endpoint && typeof endpoint === "object") { + if ("url" in endpoint) { + return endpoint.url.href; + } + if ("hostname" in endpoint) { + const { protocol, hostname, port, path } = endpoint; + return `${protocol}//${hostname}${port ? ":" + port : ""}${path}`; + } + } + return endpoint; + }; + } + return configProvider; +}; +exports.createConfigValueProvider = createConfigValueProvider; /***/ }), -/***/ 94121: +/***/ 24091: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createStop = configure.configure(api => { - async function stop(options = {}) { - const res = await api.post('shutdown', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - }); - await res.text(); - } - return stop; -}); - -exports.createStop = createStop; +exports.getEndpointFromConfig = void 0; +const node_config_provider_1 = __nccwpck_require__(86711); +const getEndpointUrlConfig_1 = __nccwpck_require__(94942); +const getEndpointFromConfig = async (serviceId) => (0, node_config_provider_1.loadConfig)((0, getEndpointUrlConfig_1.getEndpointUrlConfig)(serviceId))(); +exports.getEndpointFromConfig = getEndpointFromConfig; /***/ }), -/***/ 34779: +/***/ 84945: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var multiaddr = __nccwpck_require__(78025); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createAddrs = configure.configure(api => { - async function addrs(options = {}) { - const res = await api.post('swarm/addrs', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - }); - const {Addrs} = await res.json(); - return Object.keys(Addrs).map(id => ({ - id, - addrs: (Addrs[id] || []).map(a => new multiaddr.Multiaddr(a)) - })); - } - return addrs; -}); - -exports.createAddrs = createAddrs; +exports.resolveParams = exports.getEndpointFromInstructions = void 0; +const service_customizations_1 = __nccwpck_require__(34615); +const createConfigValueProvider_1 = __nccwpck_require__(5236); +const getEndpointFromConfig_1 = __nccwpck_require__(24091); +const toEndpointV1_1 = __nccwpck_require__(33616); +const getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig, context) => { + if (!clientConfig.endpoint) { + const endpointFromConfig = await (0, getEndpointFromConfig_1.getEndpointFromConfig)(clientConfig.serviceId || ""); + if (endpointFromConfig) { + clientConfig.endpoint = () => Promise.resolve((0, toEndpointV1_1.toEndpointV1)(endpointFromConfig)); + } + } + const endpointParams = await (0, exports.resolveParams)(commandInput, instructionsSupplier, clientConfig); + if (typeof clientConfig.endpointProvider !== "function") { + throw new Error("config.endpointProvider is not set."); + } + const endpoint = clientConfig.endpointProvider(endpointParams, context); + return endpoint; +}; +exports.getEndpointFromInstructions = getEndpointFromInstructions; +const resolveParams = async (commandInput, instructionsSupplier, clientConfig) => { + var _a; + const endpointParams = {}; + const instructions = ((_a = instructionsSupplier === null || instructionsSupplier === void 0 ? void 0 : instructionsSupplier.getEndpointParameterInstructions) === null || _a === void 0 ? void 0 : _a.call(instructionsSupplier)) || {}; + for (const [name, instruction] of Object.entries(instructions)) { + switch (instruction.type) { + case "staticContextParams": + endpointParams[name] = instruction.value; + break; + case "contextParams": + endpointParams[name] = commandInput[instruction.name]; + break; + case "clientContextParams": + case "builtInParams": + endpointParams[name] = await (0, createConfigValueProvider_1.createConfigValueProvider)(instruction.name, name, clientConfig)(); + break; + default: + throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction)); + } + } + if (Object.keys(instructions).length === 0) { + Object.assign(endpointParams, clientConfig); + } + if (String(clientConfig.serviceId).toLowerCase() === "s3") { + await (0, service_customizations_1.resolveParamsForS3)(endpointParams); + } + return endpointParams; +}; +exports.resolveParams = resolveParams; /***/ }), -/***/ 45988: +/***/ 94942: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createConnect = configure.configure(api => { - async function connect(addr, options = {}) { - const res = await api.post('swarm/connect', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: addr, - ...options - }), - headers: options.headers - }); - const {Strings} = await res.json(); - return Strings || []; - } - return connect; +exports.getEndpointUrlConfig = void 0; +const shared_ini_file_loader_1 = __nccwpck_require__(53013); +const ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL"; +const CONFIG_ENDPOINT_URL = "endpoint_url"; +const getEndpointUrlConfig = (serviceId) => ({ + environmentVariableSelector: (env) => { + const serviceSuffixParts = serviceId.split(" ").map((w) => w.toUpperCase()); + const serviceEndpointUrl = env[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join("_")]; + if (serviceEndpointUrl) + return serviceEndpointUrl; + const endpointUrl = env[ENV_ENDPOINT_URL]; + if (endpointUrl) + return endpointUrl; + return undefined; + }, + configFileSelector: (profile, config) => { + if (config && profile.services) { + const servicesSection = config[["services", profile.services].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)]; + if (servicesSection) { + const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase()); + const endpointUrl = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)]; + if (endpointUrl) + return endpointUrl; + } + } + const endpointUrl = profile[CONFIG_ENDPOINT_URL]; + if (endpointUrl) + return endpointUrl; + return undefined; + }, + default: undefined, }); - -exports.createConnect = createConnect; +exports.getEndpointUrlConfig = getEndpointUrlConfig; /***/ }), -/***/ 83865: +/***/ 84928: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createDisconnect = configure.configure(api => { - async function disconnect(addr, options = {}) { - const res = await api.post('swarm/disconnect', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams({ - arg: addr, - ...options - }), - headers: options.headers - }); - const {Strings} = await res.json(); - return Strings || []; - } - return disconnect; -}); - -exports.createDisconnect = createDisconnect; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(84945), exports); +tslib_1.__exportStar(__nccwpck_require__(33616), exports); /***/ }), -/***/ 8697: +/***/ 33616: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toEndpointV1 = void 0; +const url_parser_1 = __nccwpck_require__(45013); +const toEndpointV1 = (endpoint) => { + if (typeof endpoint === "object") { + if ("url" in endpoint) { + return (0, url_parser_1.parseUrl)(endpoint.url); + } + return endpoint; + } + return (0, url_parser_1.parseUrl)(endpoint); +}; +exports.toEndpointV1 = toEndpointV1; -var addrs = __nccwpck_require__(34779); -var connect = __nccwpck_require__(45988); -var disconnect = __nccwpck_require__(83865); -var localAddrs = __nccwpck_require__(27815); -var peers = __nccwpck_require__(78953); -function createSwarm(config) { - return { - addrs: addrs.createAddrs(config), - connect: connect.createConnect(config), - disconnect: disconnect.createDisconnect(config), - localAddrs: localAddrs.createLocalAddrs(config), - peers: peers.createPeers(config) - }; -} +/***/ }), + +/***/ 47994: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + -exports.createSwarm = createSwarm; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.endpointMiddleware = void 0; +const util_middleware_1 = __nccwpck_require__(3626); +const getEndpointFromInstructions_1 = __nccwpck_require__(84945); +const endpointMiddleware = ({ config, instructions, }) => { + return (next, context) => async (args) => { + var _a, _b, _c; + const endpoint = await (0, getEndpointFromInstructions_1.getEndpointFromInstructions)(args.input, { + getEndpointParameterInstructions() { + return instructions; + }, + }, { ...config }, context); + context.endpointV2 = endpoint; + context.authSchemes = (_a = endpoint.properties) === null || _a === void 0 ? void 0 : _a.authSchemes; + const authScheme = (_b = context.authSchemes) === null || _b === void 0 ? void 0 : _b[0]; + if (authScheme) { + context["signing_region"] = authScheme.signingRegion; + context["signing_service"] = authScheme.signingName; + const smithyContext = (0, util_middleware_1.getSmithyContext)(context); + const httpAuthOption = (_c = smithyContext === null || smithyContext === void 0 ? void 0 : smithyContext.selectedHttpAuthScheme) === null || _c === void 0 ? void 0 : _c.httpAuthOption; + if (httpAuthOption) { + httpAuthOption.signingProperties = Object.assign(httpAuthOption.signingProperties || {}, { + signing_region: authScheme.signingRegion, + signingRegion: authScheme.signingRegion, + signing_service: authScheme.signingName, + signingName: authScheme.signingName, + signingRegionSet: authScheme.signingRegionSet, + }, authScheme.properties); + } + } + return next({ + ...args, + }); + }; +}; +exports.endpointMiddleware = endpointMiddleware; /***/ }), -/***/ 27815: +/***/ 81420: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var multiaddr = __nccwpck_require__(78025); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createLocalAddrs = configure.configure(api => { - async function localAddrs(options = {}) { - const res = await api.post('swarm/addrs/local', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - }); - const {Strings} = await res.json(); - return (Strings || []).map(a => new multiaddr.Multiaddr(a)); - } - return localAddrs; +exports.getEndpointPlugin = exports.endpointMiddlewareOptions = void 0; +const middleware_serde_1 = __nccwpck_require__(44036); +const endpointMiddleware_1 = __nccwpck_require__(47994); +exports.endpointMiddlewareOptions = { + step: "serialize", + tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"], + name: "endpointV2Middleware", + override: true, + relation: "before", + toMiddleware: middleware_serde_1.serializerMiddlewareOption.name, +}; +const getEndpointPlugin = (config, instructions) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo((0, endpointMiddleware_1.endpointMiddleware)({ + config, + instructions, + }), exports.endpointMiddlewareOptions); + }, }); - -exports.createLocalAddrs = createLocalAddrs; +exports.getEndpointPlugin = getEndpointPlugin; /***/ }), -/***/ 78953: +/***/ 9848: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var multiaddr = __nccwpck_require__(78025); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createPeers = configure.configure(api => { - async function peers(options = {}) { - const res = await api.post('swarm/peers', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - }); - const {Peers} = await res.json(); - return (Peers || []).map(peer => { - return { - addr: new multiaddr.Multiaddr(peer.Addr), - peer: peer.Peer, - muxer: peer.Muxer, - latency: peer.Latency, - streams: peer.Streams, - direction: peer.Direction == null ? undefined : peer.Direction === 0 ? 'inbound' : 'outbound' - }; - }); - } - return peers; -}); - -exports.createPeers = createPeers; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(84928), exports); +tslib_1.__exportStar(__nccwpck_require__(47994), exports); +tslib_1.__exportStar(__nccwpck_require__(81420), exports); +tslib_1.__exportStar(__nccwpck_require__(817), exports); +tslib_1.__exportStar(__nccwpck_require__(77298), exports); /***/ }), -/***/ 93620: +/***/ 817: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var objectToCamel = __nccwpck_require__(62268); -var configure = __nccwpck_require__(31775); -var toUrlSearchParams = __nccwpck_require__(52836); - -const createVersion = configure.configure(api => { - async function version(options = {}) { - const res = await api.post('version', { - signal: options.signal, - searchParams: toUrlSearchParams.toUrlSearchParams(options), - headers: options.headers - }); +exports.resolveEndpointConfig = void 0; +const util_middleware_1 = __nccwpck_require__(3626); +const toEndpointV1_1 = __nccwpck_require__(33616); +const resolveEndpointConfig = (input) => { + var _a, _b, _c; + const tls = (_a = input.tls) !== null && _a !== void 0 ? _a : true; + const { endpoint } = input; + const customEndpointProvider = endpoint != null ? async () => (0, toEndpointV1_1.toEndpointV1)(await (0, util_middleware_1.normalizeProvider)(endpoint)()) : undefined; + const isCustomEndpoint = !!endpoint; return { - ...objectToCamel.objectToCamel(await res.json()), - 'ipfs-http-client': '1.0.0' + ...input, + endpoint: customEndpointProvider, + tls, + isCustomEndpoint, + useDualstackEndpoint: (0, util_middleware_1.normalizeProvider)((_b = input.useDualstackEndpoint) !== null && _b !== void 0 ? _b : false), + useFipsEndpoint: (0, util_middleware_1.normalizeProvider)((_c = input.useFipsEndpoint) !== null && _c !== void 0 ? _c : false), }; - } - return version; -}); - -exports.createVersion = createVersion; +}; +exports.resolveEndpointConfig = resolveEndpointConfig; /***/ }), -/***/ 38050: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 34615: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(43152), exports); -const convert = __nccwpck_require__(74954) -const protocols = __nccwpck_require__(46015) -const varint = __nccwpck_require__(9280) -const { concat: uint8ArrayConcat } = __nccwpck_require__(17225) -const { toString: uint8ArrayToString } = __nccwpck_require__(2771) -// export codec -module.exports = { - stringToStringTuples, - stringTuplesToString, +/***/ }), - tuplesToStringTuples, - stringTuplesToTuples, +/***/ 43152: +/***/ ((__unused_webpack_module, exports) => { - bytesToTuples, - tuplesToBytes, - bytesToString, - stringToBytes, +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isArnBucketName = exports.isDnsCompatibleBucketName = exports.S3_HOSTNAME_PATTERN = exports.DOT_PATTERN = exports.resolveParamsForS3 = void 0; +const resolveParamsForS3 = async (endpointParams) => { + const bucket = (endpointParams === null || endpointParams === void 0 ? void 0 : endpointParams.Bucket) || ""; + if (typeof endpointParams.Bucket === "string") { + endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?")); + } + if ((0, exports.isArnBucketName)(bucket)) { + if (endpointParams.ForcePathStyle === true) { + throw new Error("Path-style addressing cannot be used with ARN buckets"); + } + } + else if (!(0, exports.isDnsCompatibleBucketName)(bucket) || + (bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:")) || + bucket.toLowerCase() !== bucket || + bucket.length < 3) { + endpointParams.ForcePathStyle = true; + } + if (endpointParams.DisableMultiRegionAccessPoints) { + endpointParams.disableMultiRegionAccessPoints = true; + endpointParams.DisableMRAP = true; + } + return endpointParams; +}; +exports.resolveParamsForS3 = resolveParamsForS3; +const DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; +const IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; +const DOTS_PATTERN = /\.\./; +exports.DOT_PATTERN = /\./; +exports.S3_HOSTNAME_PATTERN = /^(.+\.)?s3(-fips)?(\.dualstack)?[.-]([a-z0-9-]+)\./; +const isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName); +exports.isDnsCompatibleBucketName = isDnsCompatibleBucketName; +const isArnBucketName = (bucketName) => { + const [arn, partition, service, region, account, typeOrId] = bucketName.split(":"); + const isArn = arn === "arn" && bucketName.split(":").length >= 6; + const isValidArn = [arn, partition, service, account, typeOrId].filter(Boolean).length === 5; + if (isArn && !isValidArn) { + throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`); + } + return arn === "arn" && !!partition && !!service && !!account && !!typeOrId; +}; +exports.isArnBucketName = isArnBucketName; - fromString, - fromBytes, - validateBytes, - isValidBytes, - cleanPath, - ParseError, - protoFromTuple, +/***/ }), - sizeForAddr -} +/***/ 77298: +/***/ ((__unused_webpack_module, exports) => { -// string -> [[str name, str addr]... ] -/** - * @param {string} str - */ -function stringToStringTuples (str) { - const tuples = [] - const parts = str.split('/').slice(1) // skip first empty elem - if (parts.length === 1 && parts[0] === '') { - return [] - } - for (let p = 0; p < parts.length; p++) { - const part = parts[p] - const proto = protocols(part) +Object.defineProperty(exports, "__esModule", ({ value: true })); - if (proto.size === 0) { - tuples.push([part]) - continue - } - p++ // advance addr part - if (p >= parts.length) { - throw ParseError('invalid address: ' + str) - } +/***/ }), - // if it's a path proto, take the rest - if (proto.path) { - tuples.push([ - part, - // TODO: should we need to check each path part to see if it's a proto? - // This would allow for other protocols to be added after a unix path, - // however it would have issues if the path had a protocol name in the path - cleanPath(parts.slice(p).join('/')) - ]) - break - } +/***/ 28281: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - tuples.push([part, parts[p]]) - } - return tuples +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AdaptiveRetryStrategy = void 0; +const util_retry_1 = __nccwpck_require__(20774); +const StandardRetryStrategy_1 = __nccwpck_require__(36739); +class AdaptiveRetryStrategy extends StandardRetryStrategy_1.StandardRetryStrategy { + constructor(maxAttemptsProvider, options) { + const { rateLimiter, ...superOptions } = options !== null && options !== void 0 ? options : {}; + super(maxAttemptsProvider, superOptions); + this.rateLimiter = rateLimiter !== null && rateLimiter !== void 0 ? rateLimiter : new util_retry_1.DefaultRateLimiter(); + this.mode = util_retry_1.RETRY_MODES.ADAPTIVE; + } + async retry(next, args) { + return super.retry(next, args, { + beforeRequest: async () => { + return this.rateLimiter.getSendToken(); + }, + afterRequest: (response) => { + this.rateLimiter.updateClientSendingRate(response); + }, + }); + } } +exports.AdaptiveRetryStrategy = AdaptiveRetryStrategy; -// [[str name, str addr]... ] -> string -/** - * @param {[number, string?][]} tuples - */ -function stringTuplesToString (tuples) { - /** @type {Array} */ - const parts = [] - tuples.map((tup) => { - const proto = protoFromTuple(tup) - parts.push(proto.name) - if (tup.length > 1) { - parts.push(tup[1]) - } - return null - }) - return cleanPath(parts.join('/')) -} +/***/ }), -// [[str name, str addr]... ] -> [[int code, Uint8Array]... ] -/** - * @param {Array} tuples - * @returns {[number , Uint8Array?][]} - */ -function stringTuplesToTuples (tuples) { - return tuples.map((tup) => { - if (!Array.isArray(tup)) { - tup = [tup] - } - const proto = protoFromTuple(tup) - if (tup.length > 1) { - return [proto.code, convert.toBytes(proto.code, tup[1])] - } - return [proto.code] - }) -} +/***/ 36739: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Convert tuples to string tuples - * - * [[int code, Uint8Array]... ] -> [[int code, str addr]... ] - * - * @param {Array<[number, Uint8Array?]>} tuples - * @returns {Array<[number, string?]>} - */ -function tuplesToStringTuples (tuples) { - return tuples.map(tup => { - const proto = protoFromTuple(tup) - if (tup[1]) { - return [proto.code, convert.toString(proto.code, tup[1])] +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.StandardRetryStrategy = void 0; +const protocol_http_1 = __nccwpck_require__(76232); +const service_error_classification_1 = __nccwpck_require__(50805); +const util_retry_1 = __nccwpck_require__(20774); +const uuid_1 = __nccwpck_require__(48398); +const defaultRetryQuota_1 = __nccwpck_require__(78652); +const delayDecider_1 = __nccwpck_require__(70030); +const retryDecider_1 = __nccwpck_require__(33004); +const util_1 = __nccwpck_require__(15555); +class StandardRetryStrategy { + constructor(maxAttemptsProvider, options) { + var _a, _b, _c; + this.maxAttemptsProvider = maxAttemptsProvider; + this.mode = util_retry_1.RETRY_MODES.STANDARD; + this.retryDecider = (_a = options === null || options === void 0 ? void 0 : options.retryDecider) !== null && _a !== void 0 ? _a : retryDecider_1.defaultRetryDecider; + this.delayDecider = (_b = options === null || options === void 0 ? void 0 : options.delayDecider) !== null && _b !== void 0 ? _b : delayDecider_1.defaultDelayDecider; + this.retryQuota = (_c = options === null || options === void 0 ? void 0 : options.retryQuota) !== null && _c !== void 0 ? _c : (0, defaultRetryQuota_1.getDefaultRetryQuota)(util_retry_1.INITIAL_RETRY_TOKENS); + } + shouldRetry(error, attempts, maxAttempts) { + return attempts < maxAttempts && this.retryDecider(error) && this.retryQuota.hasRetryTokens(error); + } + async getMaxAttempts() { + let maxAttempts; + try { + maxAttempts = await this.maxAttemptsProvider(); + } + catch (error) { + maxAttempts = util_retry_1.DEFAULT_MAX_ATTEMPTS; + } + return maxAttempts; + } + async retry(next, args, options) { + let retryTokenAmount; + let attempts = 0; + let totalDelay = 0; + const maxAttempts = await this.getMaxAttempts(); + const { request } = args; + if (protocol_http_1.HttpRequest.isInstance(request)) { + request.headers[util_retry_1.INVOCATION_ID_HEADER] = (0, uuid_1.v4)(); + } + while (true) { + try { + if (protocol_http_1.HttpRequest.isInstance(request)) { + request.headers[util_retry_1.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; + } + if (options === null || options === void 0 ? void 0 : options.beforeRequest) { + await options.beforeRequest(); + } + const { response, output } = await next(args); + if (options === null || options === void 0 ? void 0 : options.afterRequest) { + options.afterRequest(response); + } + this.retryQuota.releaseRetryTokens(retryTokenAmount); + output.$metadata.attempts = attempts + 1; + output.$metadata.totalRetryDelay = totalDelay; + return { response, output }; + } + catch (e) { + const err = (0, util_1.asSdkError)(e); + attempts++; + if (this.shouldRetry(err, attempts, maxAttempts)) { + retryTokenAmount = this.retryQuota.retrieveRetryTokens(err); + const delayFromDecider = this.delayDecider((0, service_error_classification_1.isThrottlingError)(err) ? util_retry_1.THROTTLING_RETRY_DELAY_BASE : util_retry_1.DEFAULT_RETRY_DELAY_BASE, attempts); + const delayFromResponse = getDelayFromRetryAfterHeader(err.$response); + const delay = Math.max(delayFromResponse || 0, delayFromDecider); + totalDelay += delay; + await new Promise((resolve) => setTimeout(resolve, delay)); + continue; + } + if (!err.$metadata) { + err.$metadata = {}; + } + err.$metadata.attempts = attempts; + err.$metadata.totalRetryDelay = totalDelay; + throw err; + } + } } - return [proto.code] - }) } +exports.StandardRetryStrategy = StandardRetryStrategy; +const getDelayFromRetryAfterHeader = (response) => { + if (!protocol_http_1.HttpResponse.isInstance(response)) + return; + const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); + if (!retryAfterHeaderName) + return; + const retryAfter = response.headers[retryAfterHeaderName]; + const retryAfterSeconds = Number(retryAfter); + if (!Number.isNaN(retryAfterSeconds)) + return retryAfterSeconds * 1000; + const retryAfterDate = new Date(retryAfter); + return retryAfterDate.getTime() - Date.now(); +}; -// [[int code, Uint8Array ]... ] -> Uint8Array -/** - * @param {[number, Uint8Array?][]} tuples - */ -function tuplesToBytes (tuples) { - return fromBytes(uint8ArrayConcat(tuples.map((/** @type {any[]} */ tup) => { - const proto = protoFromTuple(tup) - let buf = Uint8Array.from(varint.encode(proto.code)) - if (tup.length > 1) { - buf = uint8ArrayConcat([buf, tup[1]]) // add address buffer - } +/***/ }), - return buf - }))) -} +/***/ 92420: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * @param {import("./types").Protocol} p - * @param {Uint8Array | number[]} addr - */ -function sizeForAddr (p, addr) { - if (p.size > 0) { - return p.size / 8 - } else if (p.size === 0) { - return 0 - } else { - const size = varint.decode(addr) - return size + varint.decode.bytes - } -} -/** - * - * @param {Uint8Array} buf - * @returns {Array<[number, Uint8Array?]>} - */ -function bytesToTuples (buf) { - /** @type {Array<[number, Uint8Array?]>} */ - const tuples = [] - let i = 0 - while (i < buf.length) { - const code = varint.decode(buf, i) - const n = varint.decode.bytes +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NODE_RETRY_MODE_CONFIG_OPTIONS = exports.CONFIG_RETRY_MODE = exports.ENV_RETRY_MODE = exports.resolveRetryConfig = exports.NODE_MAX_ATTEMPT_CONFIG_OPTIONS = exports.CONFIG_MAX_ATTEMPTS = exports.ENV_MAX_ATTEMPTS = void 0; +const util_middleware_1 = __nccwpck_require__(3626); +const util_retry_1 = __nccwpck_require__(20774); +exports.ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; +exports.CONFIG_MAX_ATTEMPTS = "max_attempts"; +exports.NODE_MAX_ATTEMPT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => { + const value = env[exports.ENV_MAX_ATTEMPTS]; + if (!value) + return undefined; + const maxAttempt = parseInt(value); + if (Number.isNaN(maxAttempt)) { + throw new Error(`Environment variable ${exports.ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`); + } + return maxAttempt; + }, + configFileSelector: (profile) => { + const value = profile[exports.CONFIG_MAX_ATTEMPTS]; + if (!value) + return undefined; + const maxAttempt = parseInt(value); + if (Number.isNaN(maxAttempt)) { + throw new Error(`Shared config file entry ${exports.CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`); + } + return maxAttempt; + }, + default: util_retry_1.DEFAULT_MAX_ATTEMPTS, +}; +const resolveRetryConfig = (input) => { + var _a; + const { retryStrategy } = input; + const maxAttempts = (0, util_middleware_1.normalizeProvider)((_a = input.maxAttempts) !== null && _a !== void 0 ? _a : util_retry_1.DEFAULT_MAX_ATTEMPTS); + return { + ...input, + maxAttempts, + retryStrategy: async () => { + if (retryStrategy) { + return retryStrategy; + } + const retryMode = await (0, util_middleware_1.normalizeProvider)(input.retryMode)(); + if (retryMode === util_retry_1.RETRY_MODES.ADAPTIVE) { + return new util_retry_1.AdaptiveRetryStrategy(maxAttempts); + } + return new util_retry_1.StandardRetryStrategy(maxAttempts); + }, + }; +}; +exports.resolveRetryConfig = resolveRetryConfig; +exports.ENV_RETRY_MODE = "AWS_RETRY_MODE"; +exports.CONFIG_RETRY_MODE = "retry_mode"; +exports.NODE_RETRY_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[exports.ENV_RETRY_MODE], + configFileSelector: (profile) => profile[exports.CONFIG_RETRY_MODE], + default: util_retry_1.DEFAULT_RETRY_MODE, +}; - const p = protocols(code) - const size = sizeForAddr(p, buf.slice(i + n)) +/***/ }), - if (size === 0) { - tuples.push([code]) - i += n - continue - } +/***/ 78652: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - const addr = buf.slice(i + n, i + n + size) - i += (size + n) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getDefaultRetryQuota = void 0; +const util_retry_1 = __nccwpck_require__(20774); +const getDefaultRetryQuota = (initialRetryTokens, options) => { + var _a, _b, _c; + const MAX_CAPACITY = initialRetryTokens; + const noRetryIncrement = (_a = options === null || options === void 0 ? void 0 : options.noRetryIncrement) !== null && _a !== void 0 ? _a : util_retry_1.NO_RETRY_INCREMENT; + const retryCost = (_b = options === null || options === void 0 ? void 0 : options.retryCost) !== null && _b !== void 0 ? _b : util_retry_1.RETRY_COST; + const timeoutRetryCost = (_c = options === null || options === void 0 ? void 0 : options.timeoutRetryCost) !== null && _c !== void 0 ? _c : util_retry_1.TIMEOUT_RETRY_COST; + let availableCapacity = initialRetryTokens; + const getCapacityAmount = (error) => (error.name === "TimeoutError" ? timeoutRetryCost : retryCost); + const hasRetryTokens = (error) => getCapacityAmount(error) <= availableCapacity; + const retrieveRetryTokens = (error) => { + if (!hasRetryTokens(error)) { + throw new Error("No retry token available"); + } + const capacityAmount = getCapacityAmount(error); + availableCapacity -= capacityAmount; + return capacityAmount; + }; + const releaseRetryTokens = (capacityReleaseAmount) => { + availableCapacity += capacityReleaseAmount !== null && capacityReleaseAmount !== void 0 ? capacityReleaseAmount : noRetryIncrement; + availableCapacity = Math.min(availableCapacity, MAX_CAPACITY); + }; + return Object.freeze({ + hasRetryTokens, + retrieveRetryTokens, + releaseRetryTokens, + }); +}; +exports.getDefaultRetryQuota = getDefaultRetryQuota; - if (i > buf.length) { // did not end _exactly_ at buffer.length - throw ParseError('Invalid address Uint8Array: ' + uint8ArrayToString(buf, 'base16')) - } - // ok, tuple seems good. - tuples.push([code, addr]) - } +/***/ }), - return tuples -} +/***/ 70030: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -// Uint8Array -> String -/** - * @param {Uint8Array} buf - */ -function bytesToString (buf) { - const a = bytesToTuples(buf) - const b = tuplesToStringTuples(a) - return stringTuplesToString(b) -} -// String -> Uint8Array -/** - * @param {string} str - */ -function stringToBytes (str) { - str = cleanPath(str) - const a = stringToStringTuples(str) - const b = stringTuplesToTuples(a) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.defaultDelayDecider = void 0; +const util_retry_1 = __nccwpck_require__(20774); +const defaultDelayDecider = (delayBase, attempts) => Math.floor(Math.min(util_retry_1.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); +exports.defaultDelayDecider = defaultDelayDecider; - return tuplesToBytes(b) -} -// String -> Uint8Array -/** - * @param {string} str - */ -function fromString (str) { - return stringToBytes(str) -} +/***/ }), -// Uint8Array -> Uint8Array -/** - * @param {Uint8Array} buf - */ -function fromBytes (buf) { - const err = validateBytes(buf) - if (err) throw err - return Uint8Array.from(buf) // copy -} +/***/ 73739: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * @param {Uint8Array} buf - */ -function validateBytes (buf) { - try { - bytesToTuples(buf) // try to parse. will throw if breaks - } catch (err) { - return err - } -} -/** - * @param {Uint8Array} buf - */ -function isValidBytes (buf) { - return validateBytes(buf) === undefined -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(28281), exports); +tslib_1.__exportStar(__nccwpck_require__(36739), exports); +tslib_1.__exportStar(__nccwpck_require__(92420), exports); +tslib_1.__exportStar(__nccwpck_require__(70030), exports); +tslib_1.__exportStar(__nccwpck_require__(82054), exports); +tslib_1.__exportStar(__nccwpck_require__(33004), exports); +tslib_1.__exportStar(__nccwpck_require__(61910), exports); -/** - * @param {string} str - */ -function cleanPath (str) { - return '/' + str.trim().split('/').filter((/** @type {any} */ a) => a).join('/') -} -/** - * @param {string} str - */ -function ParseError (str) { - return new Error('Error parsing address: ' + str) -} +/***/ }), -/** - * @param {any[]} tup - */ -function protoFromTuple (tup) { - const proto = protocols(tup[0]) - return proto -} +/***/ 49807: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/***/ }), +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isStreamingPayload = void 0; +const stream_1 = __nccwpck_require__(12781); +const isStreamingPayload = (request) => (request === null || request === void 0 ? void 0 : request.body) instanceof stream_1.Readable || + (typeof ReadableStream !== "undefined" && (request === null || request === void 0 ? void 0 : request.body) instanceof ReadableStream); +exports.isStreamingPayload = isStreamingPayload; -/***/ 74954: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +/***/ }), +/***/ 82054: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const ip = __nccwpck_require__(48239) -const protocols = __nccwpck_require__(46015) -const { CID } = __nccwpck_require__(24247) -const { base32 } = __nccwpck_require__(70784) -const { base58btc } = __nccwpck_require__(49108) -const Digest = __nccwpck_require__(81168) -const varint = __nccwpck_require__(9280) -const { toString: uint8ArrayToString } = __nccwpck_require__(2771) -const { fromString: uint8ArrayFromString } = __nccwpck_require__(39451) -const { concat: uint8ArrayConcat } = __nccwpck_require__(17225) -module.exports = Convert +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getOmitRetryHeadersPlugin = exports.omitRetryHeadersMiddlewareOptions = exports.omitRetryHeadersMiddleware = void 0; +const protocol_http_1 = __nccwpck_require__(76232); +const util_retry_1 = __nccwpck_require__(20774); +const omitRetryHeadersMiddleware = () => (next) => async (args) => { + const { request } = args; + if (protocol_http_1.HttpRequest.isInstance(request)) { + delete request.headers[util_retry_1.INVOCATION_ID_HEADER]; + delete request.headers[util_retry_1.REQUEST_HEADER]; + } + return next(args); +}; +exports.omitRetryHeadersMiddleware = omitRetryHeadersMiddleware; +exports.omitRetryHeadersMiddlewareOptions = { + name: "omitRetryHeadersMiddleware", + tags: ["RETRY", "HEADERS", "OMIT_RETRY_HEADERS"], + relation: "before", + toMiddleware: "awsAuthMiddleware", + override: true, +}; +const getOmitRetryHeadersPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo((0, exports.omitRetryHeadersMiddleware)(), exports.omitRetryHeadersMiddlewareOptions); + }, +}); +exports.getOmitRetryHeadersPlugin = getOmitRetryHeadersPlugin; -// converts (serializes) addresses -/** - * @param {string} proto - * @param {string | Uint8Array} a - */ -function Convert (proto, a) { - if (a instanceof Uint8Array) { - return Convert.toString(proto, a) - } else { - return Convert.toBytes(proto, a) - } -} -/** - * Convert [code,Uint8Array] to string - * - * @param {number|string} proto - * @param {Uint8Array} buf - * @returns {string} - */ -Convert.toString = function convertToString (proto, buf) { - const protocol = protocols(proto) - switch (protocol.code) { - case 4: // ipv4 - case 41: // ipv6 - return bytes2ip(buf) +/***/ }), - case 6: // tcp - case 273: // udp - case 33: // dccp - case 132: // sctp - return bytes2port(buf).toString() +/***/ 33004: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - case 53: // dns - case 54: // dns4 - case 55: // dns6 - case 56: // dnsaddr - case 400: // unix - case 777: // memory - return bytes2str(buf) - case 421: // ipfs - return bytes2mh(buf) - case 444: // onion - return bytes2onion(buf) - case 445: // onion3 - return bytes2onion(buf) - default: - return uint8ArrayToString(buf, 'base16') // no clue. convert to hex - } -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.defaultRetryDecider = void 0; +const service_error_classification_1 = __nccwpck_require__(50805); +const defaultRetryDecider = (error) => { + if (!error) { + return false; + } + return (0, service_error_classification_1.isRetryableByTrait)(error) || (0, service_error_classification_1.isClockSkewError)(error) || (0, service_error_classification_1.isThrottlingError)(error) || (0, service_error_classification_1.isTransientError)(error); +}; +exports.defaultRetryDecider = defaultRetryDecider; -Convert.toBytes = function convertToBytes (/** @type {string | number } */ proto, /** @type {string} */ str) { - const protocol = protocols(proto) - switch (protocol.code) { - case 4: // ipv4 - return ip2bytes(str) - case 41: // ipv6 - return ip2bytes(str) - case 6: // tcp - case 273: // udp - case 33: // dccp - case 132: // sctp - return port2bytes(parseInt(str, 10)) +/***/ }), - case 53: // dns - case 54: // dns4 - case 55: // dns6 - case 56: // dnsaddr - case 400: // unix - case 777: // memory - return str2bytes(str) +/***/ 61910: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - case 421: // ipfs - return mh2bytes(str) - case 444: // onion - return onion2bytes(str) - case 445: // onion3 - return onion32bytes(str) - default: - return uint8ArrayFromString(str, 'base16') // no clue. convert from hex - } -} -/** - * @param {string} ipString - */ -function ip2bytes (ipString) { - if (!ip.isIP(ipString)) { - throw new Error('invalid ip address') - } - return ip.toBytes(ipString) -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getRetryAfterHint = exports.getRetryPlugin = exports.retryMiddlewareOptions = exports.retryMiddleware = void 0; +const protocol_http_1 = __nccwpck_require__(76232); +const service_error_classification_1 = __nccwpck_require__(50805); +const smithy_client_1 = __nccwpck_require__(42584); +const util_retry_1 = __nccwpck_require__(20774); +const uuid_1 = __nccwpck_require__(48398); +const isStreamingPayload_1 = __nccwpck_require__(49807); +const util_1 = __nccwpck_require__(15555); +const retryMiddleware = (options) => (next, context) => async (args) => { + var _a; + let retryStrategy = await options.retryStrategy(); + const maxAttempts = await options.maxAttempts(); + if (isRetryStrategyV2(retryStrategy)) { + retryStrategy = retryStrategy; + let retryToken = await retryStrategy.acquireInitialRetryToken(context["partition_id"]); + let lastError = new Error(); + let attempts = 0; + let totalRetryDelay = 0; + const { request } = args; + const isRequest = protocol_http_1.HttpRequest.isInstance(request); + if (isRequest) { + request.headers[util_retry_1.INVOCATION_ID_HEADER] = (0, uuid_1.v4)(); + } + while (true) { + try { + if (isRequest) { + request.headers[util_retry_1.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; + } + const { response, output } = await next(args); + retryStrategy.recordSuccess(retryToken); + output.$metadata.attempts = attempts + 1; + output.$metadata.totalRetryDelay = totalRetryDelay; + return { response, output }; + } + catch (e) { + const retryErrorInfo = getRetryErrorInfo(e); + lastError = (0, util_1.asSdkError)(e); + if (isRequest && (0, isStreamingPayload_1.isStreamingPayload)(request)) { + (_a = (context.logger instanceof smithy_client_1.NoOpLogger ? console : context.logger)) === null || _a === void 0 ? void 0 : _a.warn("An error was encountered in a non-retryable streaming request."); + throw lastError; + } + try { + retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo); + } + catch (refreshError) { + if (!lastError.$metadata) { + lastError.$metadata = {}; + } + lastError.$metadata.attempts = attempts + 1; + lastError.$metadata.totalRetryDelay = totalRetryDelay; + throw lastError; + } + attempts = retryToken.getRetryCount(); + const delay = retryToken.getRetryDelay(); + totalRetryDelay += delay; + await new Promise((resolve) => setTimeout(resolve, delay)); + } + } + } + else { + retryStrategy = retryStrategy; + if (retryStrategy === null || retryStrategy === void 0 ? void 0 : retryStrategy.mode) + context.userAgent = [...(context.userAgent || []), ["cfg/retry-mode", retryStrategy.mode]]; + return retryStrategy.retry(next, args); + } +}; +exports.retryMiddleware = retryMiddleware; +const isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && + typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && + typeof retryStrategy.recordSuccess !== "undefined"; +const getRetryErrorInfo = (error) => { + const errorInfo = { + errorType: getRetryErrorType(error), + }; + const retryAfterHint = (0, exports.getRetryAfterHint)(error.$response); + if (retryAfterHint) { + errorInfo.retryAfterHint = retryAfterHint; + } + return errorInfo; +}; +const getRetryErrorType = (error) => { + if ((0, service_error_classification_1.isThrottlingError)(error)) + return "THROTTLING"; + if ((0, service_error_classification_1.isTransientError)(error)) + return "TRANSIENT"; + if ((0, service_error_classification_1.isServerError)(error)) + return "SERVER_ERROR"; + return "CLIENT_ERROR"; +}; +exports.retryMiddlewareOptions = { + name: "retryMiddleware", + tags: ["RETRY"], + step: "finalizeRequest", + priority: "high", + override: true, +}; +const getRetryPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add((0, exports.retryMiddleware)(options), exports.retryMiddlewareOptions); + }, +}); +exports.getRetryPlugin = getRetryPlugin; +const getRetryAfterHint = (response) => { + if (!protocol_http_1.HttpResponse.isInstance(response)) + return; + const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); + if (!retryAfterHeaderName) + return; + const retryAfter = response.headers[retryAfterHeaderName]; + const retryAfterSeconds = Number(retryAfter); + if (!Number.isNaN(retryAfterSeconds)) + return new Date(retryAfterSeconds * 1000); + const retryAfterDate = new Date(retryAfter); + return retryAfterDate; +}; +exports.getRetryAfterHint = getRetryAfterHint; -/** - * @param {Uint8Array} ipBuff - */ -function bytes2ip (ipBuff) { - const ipString = ip.toString(ipBuff) - if (!ipString || !ip.isIP(ipString)) { - throw new Error('invalid ip address') - } - return ipString -} -/** - * @param {number} port - */ -function port2bytes (port) { - const buf = new ArrayBuffer(2) - const view = new DataView(buf) - view.setUint16(0, port) +/***/ }), - return new Uint8Array(buf) -} +/***/ 15555: +/***/ ((__unused_webpack_module, exports) => { -/** - * @param {Uint8Array} buf - */ -function bytes2port (buf) { - const view = new DataView(buf.buffer) - return view.getUint16(buf.byteOffset) -} -/** - * @param {string} str - */ -function str2bytes (str) { - const buf = uint8ArrayFromString(str) - const size = Uint8Array.from(varint.encode(buf.length)) - return uint8ArrayConcat([size, buf], size.length + buf.length) -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.asSdkError = void 0; +const asSdkError = (error) => { + if (error instanceof Error) + return error; + if (error instanceof Object) + return Object.assign(new Error(), error); + if (typeof error === "string") + return new Error(error); + return new Error(`AWS SDK error wrapper for ${error}`); +}; +exports.asSdkError = asSdkError; -/** - * @param {Uint8Array} buf - */ -function bytes2str (buf) { - const size = varint.decode(buf) - buf = buf.slice(varint.decode.bytes) - if (buf.length !== size) { - throw new Error('inconsistent lengths') - } +/***/ }), - return uint8ArrayToString(buf) -} +/***/ 19471: +/***/ ((__unused_webpack_module, exports) => { -/** - * @param {string} hash - base58btc string - */ -function mh2bytes (hash) { - let mh - if (hash[0] === 'Q' || hash[0] === '1') { - mh = Digest.decode(base58btc.decode(`z${hash}`)).bytes - } else { - mh = CID.parse(hash).multihash.bytes - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.deserializerMiddleware = void 0; +const deserializerMiddleware = (options, deserializer) => (next, context) => async (args) => { + const { response } = await next(args); + try { + const parsed = await deserializer(response, options); + return { + response, + output: parsed, + }; + } + catch (error) { + Object.defineProperty(error, "$response", { + value: response, + }); + if (!("$metadata" in error)) { + const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; + error.message += "\n " + hint; + } + throw error; + } +}; +exports.deserializerMiddleware = deserializerMiddleware; - // the address is a varint prefixed multihash string representation - const size = Uint8Array.from(varint.encode(mh.length)) - return uint8ArrayConcat([size, mh], size.length + mh.length) -} -/** - * Converts bytes to bas58btc string - * - * @param {Uint8Array} buf - * @returns {string} base58btc string - */ -function bytes2mh (buf) { - const size = varint.decode(buf) - const address = buf.slice(varint.decode.bytes) +/***/ }), - if (address.length !== size) { - throw new Error('inconsistent lengths') - } +/***/ 44036: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return uint8ArrayToString(address, 'base58btc') -} -/** - * @param {string} str - */ -function onion2bytes (str) { - const addr = str.split(':') - if (addr.length !== 2) { - throw new Error('failed to parse onion addr: ' + addr + ' does not contain a port number') - } - if (addr[0].length !== 16) { - throw new Error('failed to parse onion addr: ' + addr[0] + ' not a Tor onion address.') - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(19471), exports); +tslib_1.__exportStar(__nccwpck_require__(91293), exports); +tslib_1.__exportStar(__nccwpck_require__(47771), exports); - // onion addresses do not include the multibase prefix, add it before decoding - const buf = base32.decode('b' + addr[0]) - // onion port number - const port = parseInt(addr[1], 10) - if (port < 1 || port > 65536) { - throw new Error('Port number is not in range(1, 65536)') - } - const portBuf = port2bytes(port) - return uint8ArrayConcat([buf, portBuf], buf.length + portBuf.length) -} +/***/ }), -/** - * @param {string} str - */ -function onion32bytes (str) { - const addr = str.split(':') - if (addr.length !== 2) { - throw new Error('failed to parse onion addr: ' + addr + ' does not contain a port number') - } - if (addr[0].length !== 56) { - throw new Error('failed to parse onion addr: ' + addr[0] + ' not a Tor onion3 address.') - } - // onion addresses do not include the multibase prefix, add it before decoding - const buf = base32.decode('b' + addr[0]) +/***/ 91293: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // onion port number - const port = parseInt(addr[1], 10) - if (port < 1 || port > 65536) { - throw new Error('Port number is not in range(1, 65536)') - } - const portBuf = port2bytes(port) - return uint8ArrayConcat([buf, portBuf], buf.length + portBuf.length) -} -/** - * @param {Uint8Array} buf - */ -function bytes2onion (buf) { - const addrBytes = buf.slice(0, buf.length - 2) - const portBytes = buf.slice(buf.length - 2) - const addr = uint8ArrayToString(addrBytes, 'base32') - const port = bytes2port(portBytes) - return addr + ':' + port +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getSerdePlugin = exports.serializerMiddlewareOption = exports.deserializerMiddlewareOption = void 0; +const deserializerMiddleware_1 = __nccwpck_require__(19471); +const serializerMiddleware_1 = __nccwpck_require__(47771); +exports.deserializerMiddlewareOption = { + name: "deserializerMiddleware", + step: "deserialize", + tags: ["DESERIALIZER"], + override: true, +}; +exports.serializerMiddlewareOption = { + name: "serializerMiddleware", + step: "serialize", + tags: ["SERIALIZER"], + override: true, +}; +function getSerdePlugin(config, serializer, deserializer) { + return { + applyToStack: (commandStack) => { + commandStack.add((0, deserializerMiddleware_1.deserializerMiddleware)(config, deserializer), exports.deserializerMiddlewareOption); + commandStack.add((0, serializerMiddleware_1.serializerMiddleware)(config, serializer), exports.serializerMiddlewareOption); + }, + }; } +exports.getSerdePlugin = getSerdePlugin; /***/ }), -/***/ 78025: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; +/***/ 47771: +/***/ ((__unused_webpack_module, exports) => { -const codec = __nccwpck_require__(38050) -const protocols = __nccwpck_require__(46015) -const varint = __nccwpck_require__(9280) -const { CID } = __nccwpck_require__(24247) -const { base58btc } = __nccwpck_require__(49108) -const errCode = __nccwpck_require__(5822) -const inspect = Symbol.for('nodejs.util.inspect.custom') -const { toString: uint8ArrayToString } = __nccwpck_require__(2771) -const { equals: uint8ArrayEquals } = __nccwpck_require__(94646) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.serializerMiddleware = void 0; +const serializerMiddleware = (options, serializer) => (next, context) => async (args) => { + var _a; + const endpoint = ((_a = context.endpointV2) === null || _a === void 0 ? void 0 : _a.url) && options.urlParser + ? async () => options.urlParser(context.endpointV2.url) + : options.endpoint; + if (!endpoint) { + throw new Error("No valid endpoint provider available."); + } + const request = await serializer(args.input, { ...options, endpoint }); + return next({ + ...args, + request, + }); +}; +exports.serializerMiddleware = serializerMiddleware; -/** - * @typedef {(addr: Multiaddr) => Promise} Resolver - * @typedef {string | Multiaddr | Uint8Array | null} MultiaddrInput - * @typedef {import('./types').MultiaddrObject} MultiaddrObject - * @typedef {import('./types').Protocol} Protocol - */ -/** @type {Map} */ -const resolvers = new Map() -const symbol = Symbol.for('@multiformats/js-multiaddr/multiaddr') +/***/ }), -/** - * Creates a [multiaddr](https://github.com/multiformats/multiaddr) from - * a Uint8Array, String or another Multiaddr instance - * public key. - * - */ -class Multiaddr { - /** - * @example - * ```js - * new Multiaddr('/ip4/127.0.0.1/tcp/4001') - * // - * ``` - * - * @param {MultiaddrInput} [addr] - If String or Uint8Array, needs to adhere to the address format of a [multiaddr](https://github.com/multiformats/multiaddr#string-format) - */ - constructor (addr) { - // default - if (addr == null) { - addr = '' - } +/***/ 86205: +/***/ ((__unused_webpack_module, exports) => { - // Define symbol - Object.defineProperty(this, symbol, { value: true }) - if (addr instanceof Uint8Array) { - /** @type {Uint8Array} - The raw bytes representing this multiaddress */ - this.bytes = codec.fromBytes(addr) - } else if (typeof addr === 'string') { - if (addr.length > 0 && addr.charAt(0) !== '/') { - throw new Error(`multiaddr "${addr}" must start with a "/"`) - } - this.bytes = codec.fromString(addr) - } else if (Multiaddr.isMultiaddr(addr)) { // Multiaddr - this.bytes = codec.fromBytes(addr.bytes) // validate + copy buffer - } else { - throw new Error('addr must be a string, Buffer, or another Multiaddr') +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.constructStack = void 0; +const getAllAliases = (name, aliases) => { + const _aliases = []; + if (name) { + _aliases.push(name); } - } + if (aliases) { + for (const alias of aliases) { + _aliases.push(alias); + } + } + return _aliases; +}; +const getMiddlewareNameWithAliases = (name, aliases) => { + return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`; +}; +const constructStack = () => { + let absoluteEntries = []; + let relativeEntries = []; + let identifyOnResolve = false; + const entriesNameSet = new Set(); + const sort = (entries) => entries.sort((a, b) => stepWeights[b.step] - stepWeights[a.step] || + priorityWeights[b.priority || "normal"] - priorityWeights[a.priority || "normal"]); + const removeByName = (toRemove) => { + let isRemoved = false; + const filterCb = (entry) => { + const aliases = getAllAliases(entry.name, entry.aliases); + if (aliases.includes(toRemove)) { + isRemoved = true; + for (const alias of aliases) { + entriesNameSet.delete(alias); + } + return false; + } + return true; + }; + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }; + const removeByReference = (toRemove) => { + let isRemoved = false; + const filterCb = (entry) => { + if (entry.middleware === toRemove) { + isRemoved = true; + for (const alias of getAllAliases(entry.name, entry.aliases)) { + entriesNameSet.delete(alias); + } + return false; + } + return true; + }; + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }; + const cloneTo = (toStack) => { + var _a; + absoluteEntries.forEach((entry) => { + toStack.add(entry.middleware, { ...entry }); + }); + relativeEntries.forEach((entry) => { + toStack.addRelativeTo(entry.middleware, { ...entry }); + }); + (_a = toStack.identifyOnResolve) === null || _a === void 0 ? void 0 : _a.call(toStack, stack.identifyOnResolve()); + return toStack; + }; + const expandRelativeMiddlewareList = (from) => { + const expandedMiddlewareList = []; + from.before.forEach((entry) => { + if (entry.before.length === 0 && entry.after.length === 0) { + expandedMiddlewareList.push(entry); + } + else { + expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); + } + }); + expandedMiddlewareList.push(from); + from.after.reverse().forEach((entry) => { + if (entry.before.length === 0 && entry.after.length === 0) { + expandedMiddlewareList.push(entry); + } + else { + expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); + } + }); + return expandedMiddlewareList; + }; + const getMiddlewareList = (debug = false) => { + const normalizedAbsoluteEntries = []; + const normalizedRelativeEntries = []; + const normalizedEntriesNameMap = {}; + absoluteEntries.forEach((entry) => { + const normalizedEntry = { + ...entry, + before: [], + after: [], + }; + for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { + normalizedEntriesNameMap[alias] = normalizedEntry; + } + normalizedAbsoluteEntries.push(normalizedEntry); + }); + relativeEntries.forEach((entry) => { + const normalizedEntry = { + ...entry, + before: [], + after: [], + }; + for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { + normalizedEntriesNameMap[alias] = normalizedEntry; + } + normalizedRelativeEntries.push(normalizedEntry); + }); + normalizedRelativeEntries.forEach((entry) => { + if (entry.toMiddleware) { + const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware]; + if (toMiddleware === undefined) { + if (debug) { + return; + } + throw new Error(`${entry.toMiddleware} is not found when adding ` + + `${getMiddlewareNameWithAliases(entry.name, entry.aliases)} ` + + `middleware ${entry.relation} ${entry.toMiddleware}`); + } + if (entry.relation === "after") { + toMiddleware.after.push(entry); + } + if (entry.relation === "before") { + toMiddleware.before.push(entry); + } + } + }); + const mainChain = sort(normalizedAbsoluteEntries) + .map(expandRelativeMiddlewareList) + .reduce((wholeList, expandedMiddlewareList) => { + wholeList.push(...expandedMiddlewareList); + return wholeList; + }, []); + return mainChain; + }; + const stack = { + add: (middleware, options = {}) => { + const { name, override, aliases: _aliases } = options; + const entry = { + step: "initialize", + priority: "normal", + middleware, + ...options, + }; + const aliases = getAllAliases(name, _aliases); + if (aliases.length > 0) { + if (aliases.some((alias) => entriesNameSet.has(alias))) { + if (!override) + throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`); + for (const alias of aliases) { + const toOverrideIndex = absoluteEntries.findIndex((entry) => { var _a; return entry.name === alias || ((_a = entry.aliases) === null || _a === void 0 ? void 0 : _a.some((a) => a === alias)); }); + if (toOverrideIndex === -1) { + continue; + } + const toOverride = absoluteEntries[toOverrideIndex]; + if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) { + throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware with ` + + `${toOverride.priority} priority in ${toOverride.step} step cannot ` + + `be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware with ` + + `${entry.priority} priority in ${entry.step} step.`); + } + absoluteEntries.splice(toOverrideIndex, 1); + } + } + for (const alias of aliases) { + entriesNameSet.add(alias); + } + } + absoluteEntries.push(entry); + }, + addRelativeTo: (middleware, options) => { + const { name, override, aliases: _aliases } = options; + const entry = { + middleware, + ...options, + }; + const aliases = getAllAliases(name, _aliases); + if (aliases.length > 0) { + if (aliases.some((alias) => entriesNameSet.has(alias))) { + if (!override) + throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`); + for (const alias of aliases) { + const toOverrideIndex = relativeEntries.findIndex((entry) => { var _a; return entry.name === alias || ((_a = entry.aliases) === null || _a === void 0 ? void 0 : _a.some((a) => a === alias)); }); + if (toOverrideIndex === -1) { + continue; + } + const toOverride = relativeEntries[toOverrideIndex]; + if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) { + throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware ` + + `${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden ` + + `by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware ${entry.relation} ` + + `"${entry.toMiddleware}" middleware.`); + } + relativeEntries.splice(toOverrideIndex, 1); + } + } + for (const alias of aliases) { + entriesNameSet.add(alias); + } + } + relativeEntries.push(entry); + }, + clone: () => cloneTo((0, exports.constructStack)()), + use: (plugin) => { + plugin.applyToStack(stack); + }, + remove: (toRemove) => { + if (typeof toRemove === "string") + return removeByName(toRemove); + else + return removeByReference(toRemove); + }, + removeByTag: (toRemove) => { + let isRemoved = false; + const filterCb = (entry) => { + const { tags, name, aliases: _aliases } = entry; + if (tags && tags.includes(toRemove)) { + const aliases = getAllAliases(name, _aliases); + for (const alias of aliases) { + entriesNameSet.delete(alias); + } + isRemoved = true; + return false; + } + return true; + }; + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }, + concat: (from) => { + var _a, _b; + const cloned = cloneTo((0, exports.constructStack)()); + cloned.use(from); + cloned.identifyOnResolve(identifyOnResolve || cloned.identifyOnResolve() || ((_b = (_a = from.identifyOnResolve) === null || _a === void 0 ? void 0 : _a.call(from)) !== null && _b !== void 0 ? _b : false)); + return cloned; + }, + applyToStack: cloneTo, + identify: () => { + return getMiddlewareList(true).map((mw) => { + var _a; + const step = (_a = mw.step) !== null && _a !== void 0 ? _a : mw.relation + + " " + + mw.toMiddleware; + return getMiddlewareNameWithAliases(mw.name, mw.aliases) + " - " + step; + }); + }, + identifyOnResolve(toggle) { + if (typeof toggle === "boolean") + identifyOnResolve = toggle; + return identifyOnResolve; + }, + resolve: (handler, context) => { + for (const middleware of getMiddlewareList() + .map((entry) => entry.middleware) + .reverse()) { + handler = middleware(handler, context); + } + if (identifyOnResolve) { + console.log(stack.identify()); + } + return handler; + }, + }; + return stack; +}; +exports.constructStack = constructStack; +const stepWeights = { + initialize: 5, + serialize: 4, + build: 3, + finalizeRequest: 2, + deserialize: 1, +}; +const priorityWeights = { + high: 3, + normal: 2, + low: 1, +}; - /** - * Returns Multiaddr as a String - * - * @example - * ```js - * new Multiaddr('/ip4/127.0.0.1/tcp/4001').toString() - * // '/ip4/127.0.0.1/tcp/4001' - * ``` - */ - toString () { - return codec.bytesToString(this.bytes) - } - /** - * Returns Multiaddr as a JSON encoded object - * - * @example - * ```js - * JSON.stringify(new Multiaddr('/ip4/127.0.0.1/tcp/4001')) - * // '/ip4/127.0.0.1/tcp/4001' - * ``` - */ - toJSON () { - return this.toString() - } +/***/ }), - /** - * Returns Multiaddr as a convinient options object to be used with net.createConnection - * - * @example - * ```js - * new Multiaddr('/ip4/127.0.0.1/tcp/4001').toOptions() - * // { family: 4, host: '127.0.0.1', transport: 'tcp', port: 4001 } - * ``` - */ - toOptions () { - /** @type {MultiaddrObject} */ - const opts = {} - const parsed = this.toString().split('/') - opts.family = parsed[1] === 'ip4' ? 4 : 6 - opts.host = parsed[2] - opts.transport = parsed[3] - opts.port = parseInt(parsed[4]) - return opts - } +/***/ 95665: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Returns the protocols the Multiaddr is defined with, as an array of objects, in - * left-to-right order. Each object contains the protocol code, protocol name, - * and the size of its address space in bits. - * [See list of protocols](https://github.com/multiformats/multiaddr/blob/master/protocols.csv) - * - * @example - * ```js - * new Multiaddr('/ip4/127.0.0.1/tcp/4001').protos() - * // [ { code: 4, size: 32, name: 'ip4' }, - * // { code: 6, size: 16, name: 'tcp' } ] - * ``` - * - * @returns {Protocol[]} protocols - All the protocols the address is composed of - */ - protos () { - return this.protoCodes().map(code => Object.assign({}, protocols(code))) - } - /** - * Returns the codes of the protocols in left-to-right order. - * [See list of protocols](https://github.com/multiformats/multiaddr/blob/master/protocols.csv) - * - * @example - * ```js - * Multiaddr('/ip4/127.0.0.1/tcp/4001').protoCodes() - * // [ 4, 6 ] - * ``` - * - * @returns {number[]} protocol codes - */ - protoCodes () { - const codes = [] - const buf = this.bytes - let i = 0 - while (i < buf.length) { - const code = varint.decode(buf, i) - const n = varint.decode.bytes +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(86205), exports); - const p = protocols(code) - const size = codec.sizeForAddr(p, buf.slice(i + n)) - i += (size + n) - codes.push(code) - } +/***/ }), - return codes - } +/***/ 83597: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Returns the names of the protocols in left-to-right order. - * [See list of protocols](https://github.com/multiformats/multiaddr/blob/master/protocols.csv) - * - * @example - * ```js - * new Multiaddr('/ip4/127.0.0.1/tcp/4001').protoNames() - * // [ 'ip4', 'tcp' ] - * ``` - * - * @returns {string[]} protocol names - */ - protoNames () { - return this.protos().map(proto => proto.name) - } - /** - * Returns a tuple of parts - * - * @example - * ```js - * new Multiaddr("/ip4/127.0.0.1/tcp/4001").tuples() - * // [ [ 4, ], [ 6, ] ] - * ``` - */ - tuples () { - return codec.bytesToTuples(this.bytes) - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.loadConfig = void 0; +const property_provider_1 = __nccwpck_require__(60846); +const fromEnv_1 = __nccwpck_require__(59923); +const fromSharedConfigFiles_1 = __nccwpck_require__(17501); +const fromStatic_1 = __nccwpck_require__(37859); +const loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => (0, property_provider_1.memoize)((0, property_provider_1.chain)((0, fromEnv_1.fromEnv)(environmentVariableSelector), (0, fromSharedConfigFiles_1.fromSharedConfigFiles)(configFileSelector, configuration), (0, fromStatic_1.fromStatic)(defaultValue))); +exports.loadConfig = loadConfig; - /** - * Returns a tuple of string/number parts - * - tuples[][0] = code of protocol - * - tuples[][1] = contents of address - * - * @example - * ```js - * new Multiaddr("/ip4/127.0.0.1/tcp/4001").stringTuples() - * // [ [ 4, '127.0.0.1' ], [ 6, '4001' ] ] - * ``` - */ - stringTuples () { - const t = codec.bytesToTuples(this.bytes) - return codec.tuplesToStringTuples(t) - } - /** - * Encapsulates a Multiaddr in another Multiaddr - * - * @example - * ```js - * const mh1 = new Multiaddr('/ip4/8.8.8.8/tcp/1080') - * // - * - * const mh2 = new Multiaddr('/ip4/127.0.0.1/tcp/4001') - * // - * - * const mh3 = mh1.encapsulate(mh2) - * // - * - * mh3.toString() - * // '/ip4/8.8.8.8/tcp/1080/ip4/127.0.0.1/tcp/4001' - * ``` - * - * @param {MultiaddrInput} addr - Multiaddr to add into this Multiaddr - */ - encapsulate (addr) { - addr = new Multiaddr(addr) - return new Multiaddr(this.toString() + addr.toString()) - } +/***/ }), - /** - * Decapsulates a Multiaddr from another Multiaddr - * - * @example - * ```js - * const mh1 = new Multiaddr('/ip4/8.8.8.8/tcp/1080') - * // - * - * const mh2 = new Multiaddr('/ip4/127.0.0.1/tcp/4001') - * // - * - * const mh3 = mh1.encapsulate(mh2) - * // - * - * mh3.decapsulate(mh2).toString() - * // '/ip4/8.8.8.8/tcp/1080' - * ``` - * - * @param {Multiaddr | string} addr - Multiaddr to remove from this Multiaddr - * @returns {Multiaddr} - */ - decapsulate (addr) { - const addrString = addr.toString() - const s = this.toString() - const i = s.lastIndexOf(addrString) - if (i < 0) { - throw new Error('Address ' + this + ' does not contain subaddress: ' + addr) - } - return new Multiaddr(s.slice(0, i)) - } +/***/ 59923: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * A more reliable version of `decapsulate` if you are targeting a - * specific code, such as 421 (the `p2p` protocol code). The last index of the code - * will be removed from the `Multiaddr`, and a new instance will be returned. - * If the code is not present, the original `Multiaddr` is returned. - * - * @example - * ```js - * const addr = new Multiaddr('/ip4/0.0.0.0/tcp/8080/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC') - * // - * - * addr.decapsulateCode(421).toString() - * // '/ip4/0.0.0.0/tcp/8080' - * - * new Multiaddr('/ip4/127.0.0.1/tcp/8080').decapsulateCode(421).toString() - * // '/ip4/127.0.0.1/tcp/8080' - * ``` - * - * @param {number} code - The code of the protocol to decapsulate from this Multiaddr - * @returns {Multiaddr} - */ - decapsulateCode (code) { - const tuples = this.tuples() - for (let i = tuples.length - 1; i >= 0; i--) { - if (tuples[i][0] === code) { - return new Multiaddr(codec.tuplesToBytes(tuples.slice(0, i))) - } - } - return this - } - /** - * Extract the peerId if the multiaddr contains one - * - * @example - * ```js - * const mh1 = new Multiaddr('/ip4/8.8.8.8/tcp/1080/ipfs/QmValidBase58string') - * // - * - * // should return QmValidBase58string or null if the id is missing or invalid - * const peerId = mh1.getPeerId() - * ``` - * - * @returns {string | null} peerId - The id of the peer or null if invalid or missing from the ma - */ - getPeerId () { +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fromEnv = void 0; +const property_provider_1 = __nccwpck_require__(60846); +const fromEnv = (envVarSelector) => async () => { try { - const tuples = this.stringTuples().filter((tuple) => { - if (tuple[0] === protocols.names.ipfs.code) { - return true + const config = envVarSelector(process.env); + if (config === undefined) { + throw new Error(); } - return false - }) + return config; + } + catch (e) { + throw new property_provider_1.CredentialsProviderError(e.message || `Cannot load config from environment variables with getter: ${envVarSelector}`); + } +}; +exports.fromEnv = fromEnv; - // Get the last ipfs tuple ['ipfs', 'peerid string'] - const tuple = tuples.pop() - if (tuple && tuple[1]) { - const peerIdStr = tuple[1] - // peer id is base58btc encoded string but not multibase encoded so add the `z` - // prefix so we can validate that it is correctly encoded - if (peerIdStr[0] === 'Q' || peerIdStr[0] === '1') { - return uint8ArrayToString(base58btc.decode(`z${peerIdStr}`), 'base58btc') - } +/***/ }), - // try to parse peer id as CID - return uint8ArrayToString(CID.parse(peerIdStr).multihash.bytes, 'base58btc') - } +/***/ 17501: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return null - } catch (e) { - return null - } - } - /** - * Extract the path if the multiaddr contains one - * - * @example - * ```js - * const mh1 = new Multiaddr('/ip4/8.8.8.8/tcp/1080/unix/tmp/p2p.sock') - * // - * - * // should return utf8 string or null if the id is missing or invalid - * const path = mh1.getPath() - * ```js - * - * @returns {string | null} path - The path of the multiaddr, or null if no path protocol is present - */ - getPath () { - let path = null +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fromSharedConfigFiles = void 0; +const property_provider_1 = __nccwpck_require__(60846); +const shared_ini_file_loader_1 = __nccwpck_require__(53013); +const fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => { + const profile = (0, shared_ini_file_loader_1.getProfileName)(init); + const { configFile, credentialsFile } = await (0, shared_ini_file_loader_1.loadSharedConfigFiles)(init); + const profileFromCredentials = credentialsFile[profile] || {}; + const profileFromConfig = configFile[profile] || {}; + const mergedProfile = preferredFile === "config" + ? { ...profileFromCredentials, ...profileFromConfig } + : { ...profileFromConfig, ...profileFromCredentials }; try { - path = this.stringTuples().filter((tuple) => { - const proto = protocols(tuple[0]) - if (proto.path) { - return true + const cfgFile = preferredFile === "config" ? configFile : credentialsFile; + const configValue = configSelector(mergedProfile, cfgFile); + if (configValue === undefined) { + throw new Error(); } - return false - })[0][1] - - if (!path) { - path = null - } - } catch (e) { - path = null + return configValue; } - return path - } - - /** - * Checks if two Multiaddrs are the same - * - * @example - * ```js - * const mh1 = new Multiaddr('/ip4/8.8.8.8/tcp/1080') - * // - * - * const mh2 = new Multiaddr('/ip4/127.0.0.1/tcp/4001') - * // - * - * mh1.equals(mh1) - * // true - * - * mh1.equals(mh2) - * // false - * ``` - * - * @param {Multiaddr} addr - * @returns {boolean} - */ - equals (addr) { - return uint8ArrayEquals(this.bytes, addr.bytes) - } + catch (e) { + throw new property_provider_1.CredentialsProviderError(e.message || `Cannot load config for profile ${profile} in SDK configuration files with getter: ${configSelector}`); + } +}; +exports.fromSharedConfigFiles = fromSharedConfigFiles; - /** - * Resolve multiaddr if containing resolvable hostname. - * - * @example - * ```js - * Multiaddr.resolvers.set('dnsaddr', resolverFunction) - * const mh1 = new Multiaddr('/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb') - * const resolvedMultiaddrs = await mh1.resolve() - * // [ - * // , - * // , - * // - * // ] - * ``` - * - * @returns {Promise>} - */ - async resolve () { - const resolvableProto = this.protos().find((p) => p.resolvable) - // Multiaddr is not resolvable? - if (!resolvableProto) { - return [this] - } +/***/ }), - const resolver = resolvers.get(resolvableProto.name) - if (!resolver) { - throw errCode(new Error(`no available resolver for ${resolvableProto.name}`), 'ERR_NO_AVAILABLE_RESOLVER') - } +/***/ 37859: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - const addresses = await resolver(this) - return addresses.map((a) => new Multiaddr(a)) - } - /** - * Gets a Multiaddrs node-friendly address object. Note that protocol information - * is left out: in Node (and most network systems) the protocol is unknowable - * given only the address. - * - * Has to be a ThinWaist Address, otherwise throws error - * - * @example - * ```js - * new Multiaddr('/ip4/127.0.0.1/tcp/4001').nodeAddress() - * // {family: 4, address: '127.0.0.1', port: 4001} - * ``` - * - * @returns {{family: 4 | 6, address: string, port: number}} - * @throws {Error} Throws error if Multiaddr is not a Thin Waist address - */ - nodeAddress () { - const codes = this.protoCodes() - const names = this.protoNames() - const parts = this.toString().split('/').slice(1) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fromStatic = void 0; +const property_provider_1 = __nccwpck_require__(60846); +const isFunction = (func) => typeof func === "function"; +const fromStatic = (defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : (0, property_provider_1.fromStatic)(defaultValue); +exports.fromStatic = fromStatic; - if (parts.length < 4) { - throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6}/{address}/{tcp, udp}/{port}".') - } else if (codes[0] !== 4 && codes[0] !== 41 && codes[0] !== 54 && codes[0] !== 55) { - throw new Error(`no protocol with name: "'${names[0]}'". Must have a valid family name: "{ip4, ip6, dns4, dns6}".`) - } else if (parts[2] !== 'tcp' && parts[2] !== 'udp') { - throw new Error(`no protocol with name: "'${names[1]}'". Must have a valid transport protocol: "{tcp, udp}".`) - } - return { - family: (codes[0] === 41 || codes[0] === 55) ? 6 : 4, - address: parts[1], - port: parseInt(parts[3]) // tcp or udp port - } - } +/***/ }), - /** - * Returns if a Multiaddr is a Thin Waist address or not. - * - * Thin Waist is if a Multiaddr adheres to the standard combination of: - * - * `{IPv4, IPv6}/{TCP, UDP}` - * - * @example - * ```js - * const mh1 = new Multiaddr('/ip4/127.0.0.1/tcp/4001') - * // - * const mh2 = new Multiaddr('/ip4/192.168.2.1/tcp/5001') - * // - * const mh3 = mh1.encapsulate(mh2) - * // - * const mh4 = new Multiaddr('/ip4/127.0.0.1/tcp/2000/wss/p2p-webrtc-star/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSooo2a') - * // - * mh1.isThinWaistAddress() - * // true - * mh2.isThinWaistAddress() - * // true - * mh3.isThinWaistAddress() - * // false - * mh4.isThinWaistAddress() - * // false - * ``` - * - * @param {Multiaddr} [addr] - Defaults to using `this` instance - */ - isThinWaistAddress (addr) { - const protos = (addr || this).protos() +/***/ 86711: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (protos.length !== 2) { - return false - } - if (protos[0].code !== 4 && protos[0].code !== 41) { - return false - } - if (protos[1].code !== 6 && protos[1].code !== 273) { - return false - } - return true - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(83597), exports); - /** - * Creates a Multiaddr from a node-friendly address object - * - * @example - * ```js - * Multiaddr.fromNodeAddress({address: '127.0.0.1', port: '4001'}, 'tcp') - * // - * ``` - * - * @param {{family: 4 | 6, address: string, port: number}} addr - * @param {string} transport - */ - static fromNodeAddress (addr, transport) { - if (!addr) { throw new Error('requires node address object') } - if (!transport) { throw new Error('requires transport protocol') } - let ip - switch (addr.family) { - case 4: - ip = 'ip4' - break - case 6: - ip = 'ip6' - break - default: - throw Error(`Invalid addr family. Got '${addr.family}' instead of 4 or 6`) - } - return new Multiaddr('/' + [ip, addr.address, transport, addr.port].join('/')) - } - /** - * Returns if something is a Multiaddr that is a name - * - * @param {Multiaddr} addr - * @returns {boolean} isName - */ - static isName (addr) { - if (!Multiaddr.isMultiaddr(addr)) { - return false - } +/***/ }), - // if a part of the multiaddr is resolvable, then return true - return addr.protos().some((proto) => proto.resolvable) - } +/***/ 83745: +/***/ ((__unused_webpack_module, exports) => { - /** - * Check if object is a CID instance - * - * @param {any} value - * @returns {value is Multiaddr} - */ - static isMultiaddr (value) { - return value instanceof Multiaddr || Boolean(value && value[symbol]) - } - /** - * Returns Multiaddr as a human-readable string. - * For post Node.js v10.0.0. - * https://nodejs.org/api/deprecations.html#deprecations_dep0079_custom_inspection_function_on_objects_via_inspect - * - * @example - * ```js - * console.log(new Multiaddr('/ip4/127.0.0.1/tcp/4001')) - * // '' - * ``` - * - * @returns {string} - */ - [inspect] () { - return '' - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NODEJS_TIMEOUT_ERROR_CODES = void 0; +exports.NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; - /** - * Returns Multiaddr as a human-readable string. - * Fallback for pre Node.js v10.0.0. - * https://nodejs.org/api/deprecations.html#deprecations_dep0079_custom_inspection_function_on_objects_via_inspect - * - * @example - * ```js - * new Multiaddr('/ip4/127.0.0.1/tcp/4001').inspect() - * // '' - * ``` - * - * @returns {string} - */ - inspect () { - return '' - } -} -/** - * Object containing table, names and codes of all supported protocols. - * To get the protocol values from a Multiaddr, you can use - * [`.protos()`](#multiaddrprotos), - * [`.protoCodes()`](#multiaddrprotocodes) or - * [`.protoNames()`](#multiaddrprotonames) - * - * @returns {{table: Array, names: Object, codes: Object}} - */ -Multiaddr.protocols = protocols +/***/ }), -Multiaddr.resolvers = resolvers +/***/ 5454: +/***/ ((__unused_webpack_module, exports) => { -/** - * Static factory - * - * @param {MultiaddrInput} addr - */ -function multiaddr (addr) { - return new Multiaddr(addr) -} -module.exports = { Multiaddr, multiaddr, protocols, resolvers } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getTransformedHeaders = void 0; +const getTransformedHeaders = (headers) => { + const transformedHeaders = {}; + for (const name of Object.keys(headers)) { + const headerValues = headers[name]; + transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; + } + return transformedHeaders; +}; +exports.getTransformedHeaders = getTransformedHeaders; /***/ }), -/***/ 48239: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 48195: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(50582), exports); +tslib_1.__exportStar(__nccwpck_require__(25841), exports); +tslib_1.__exportStar(__nccwpck_require__(20821), exports); -const isIp = __nccwpck_require__(89837) -const { toString: uint8ArrayToString } = __nccwpck_require__(2771) -const isIP = isIp -const isV4 = isIp.v4 -const isV6 = isIp.v6 +/***/ }), -// Copied from https://github.com/indutny/node-ip/blob/master/lib/ip.js#L7 -// @ts-ignore - this is copied from the link above better to keep it the same -const toBytes = function (ip, buff, offset) { - offset = ~~offset +/***/ 50582: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - let result - if (isV4(ip)) { - result = buff || new Uint8Array(offset + 4) - // @ts-ignore - // eslint-disable-next-line array-callback-return - ip.split(/\./g).map(function (byte) { - result[offset++] = parseInt(byte, 10) & 0xff - }) - } else if (isV6(ip)) { - const sections = ip.split(':', 8) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NodeHttpHandler = exports.DEFAULT_REQUEST_TIMEOUT = void 0; +const protocol_http_1 = __nccwpck_require__(76232); +const querystring_builder_1 = __nccwpck_require__(29756); +const http_1 = __nccwpck_require__(13685); +const https_1 = __nccwpck_require__(95687); +const constants_1 = __nccwpck_require__(83745); +const get_transformed_headers_1 = __nccwpck_require__(5454); +const set_connection_timeout_1 = __nccwpck_require__(50132); +const set_socket_keep_alive_1 = __nccwpck_require__(14461); +const set_socket_timeout_1 = __nccwpck_require__(30276); +const write_request_body_1 = __nccwpck_require__(84171); +exports.DEFAULT_REQUEST_TIMEOUT = 0; +class NodeHttpHandler { + static create(instanceOrOptions) { + if (typeof (instanceOrOptions === null || instanceOrOptions === void 0 ? void 0 : instanceOrOptions.handle) === "function") { + return instanceOrOptions; + } + return new NodeHttpHandler(instanceOrOptions); + } + constructor(options) { + this.metadata = { handlerProtocol: "http/1.1" }; + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options() + .then((_options) => { + resolve(this.resolveDefaultConfig(_options)); + }) + .catch(reject); + } + else { + resolve(this.resolveDefaultConfig(options)); + } + }); + } + resolveDefaultConfig(options) { + const { requestTimeout, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; + const keepAlive = true; + const maxSockets = 50; + return { + connectionTimeout, + requestTimeout: requestTimeout !== null && requestTimeout !== void 0 ? requestTimeout : socketTimeout, + httpAgent: httpAgent || new http_1.Agent({ keepAlive, maxSockets }), + httpsAgent: httpsAgent || new https_1.Agent({ keepAlive, maxSockets }), + }; + } + destroy() { + var _a, _b, _c, _d; + (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.httpAgent) === null || _b === void 0 ? void 0 : _b.destroy(); + (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.httpsAgent) === null || _d === void 0 ? void 0 : _d.destroy(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + return new Promise((_resolve, _reject) => { + var _a, _b; + let writeRequestBodyPromise = undefined; + const resolve = async (arg) => { + await writeRequestBodyPromise; + _resolve(arg); + }; + const reject = async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }; + if (!this.config) { + throw new Error("Node HTTP request handler config is not resolved"); + } + if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const isSSL = request.protocol === "https:"; + const queryString = (0, querystring_builder_1.buildQueryString)(request.query || {}); + let auth = undefined; + if (request.username != null || request.password != null) { + const username = (_a = request.username) !== null && _a !== void 0 ? _a : ""; + const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; + auth = `${username}:${password}`; + } + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + const nodeHttpsOptions = { + headers: request.headers, + host: request.hostname, + method: request.method, + path, + port: request.port, + agent: isSSL ? this.config.httpsAgent : this.config.httpAgent, + auth, + }; + const requestFunc = isSSL ? https_1.request : http_1.request; + const req = requestFunc(nodeHttpsOptions, (res) => { + const httpResponse = new protocol_http_1.HttpResponse({ + statusCode: res.statusCode || -1, + reason: res.statusMessage, + headers: (0, get_transformed_headers_1.getTransformedHeaders)(res.headers), + body: res, + }); + resolve({ response: httpResponse }); + }); + req.on("error", (err) => { + if (constants_1.NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { + reject(Object.assign(err, { name: "TimeoutError" })); + } + else { + reject(err); + } + }); + (0, set_connection_timeout_1.setConnectionTimeout)(req, reject, this.config.connectionTimeout); + (0, set_socket_timeout_1.setSocketTimeout)(req, reject, this.config.requestTimeout); + if (abortSignal) { + abortSignal.onabort = () => { + req.abort(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }; + } + const httpAgent = nodeHttpsOptions.agent; + if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { + (0, set_socket_keep_alive_1.setSocketKeepAlive)(req, { + keepAlive: httpAgent.keepAlive, + keepAliveMsecs: httpAgent.keepAliveMsecs, + }); + } + writeRequestBodyPromise = (0, write_request_body_1.writeRequestBody)(req, request, this.config.requestTimeout).catch(_reject); + }); + } + updateHttpClientConfig(key, value) { + this.config = undefined; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value, + }; + }); + } + httpHandlerConfigs() { + var _a; + return (_a = this.config) !== null && _a !== void 0 ? _a : {}; + } +} +exports.NodeHttpHandler = NodeHttpHandler; - let i - for (i = 0; i < sections.length; i++) { - const isv4 = isV4(sections[i]) - let v4Buffer - if (isv4) { - v4Buffer = toBytes(sections[i]) - sections[i] = uint8ArrayToString(v4Buffer.slice(0, 2), 'base16') - } +/***/ }), - if (v4Buffer && ++i < 8) { - sections.splice(i, 0, uint8ArrayToString(v4Buffer.slice(2, 4), 'base16')) - } - } +/***/ 62667: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (sections[0] === '') { - while (sections.length < 8) sections.unshift('0') - } else if (sections[sections.length - 1] === '') { - while (sections.length < 8) sections.push('0') - } else if (sections.length < 8) { - for (i = 0; i < sections.length && sections[i] !== ''; i++); - const argv = [i, '1'] - for (i = 9 - sections.length; i > 0; i--) { - argv.push('0') - } - sections.splice.apply(sections, argv) - } - result = buff || new Uint8Array(offset + 16) - for (i = 0; i < sections.length; i++) { - const word = parseInt(sections[i], 16) - result[offset++] = (word >> 8) & 0xff - result[offset++] = word & 0xff +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NodeHttp2ConnectionManager = void 0; +const tslib_1 = __nccwpck_require__(47754); +const http2_1 = tslib_1.__importDefault(__nccwpck_require__(85158)); +const node_http2_connection_pool_1 = __nccwpck_require__(41869); +class NodeHttp2ConnectionManager { + constructor(config) { + this.sessionCache = new Map(); + this.config = config; + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrency must be greater than zero."); + } + } + lease(requestContext, connectionConfiguration) { + const url = this.getUrlString(requestContext); + const existingPool = this.sessionCache.get(url); + if (existingPool) { + const existingSession = existingPool.poll(); + if (existingSession && !this.config.disableConcurrency) { + return existingSession; + } + } + const session = http2_1.default.connect(url); + if (this.config.maxConcurrency) { + session.settings({ maxConcurrentStreams: this.config.maxConcurrency }, (err) => { + if (err) { + throw new Error("Fail to set maxConcurrentStreams to " + + this.config.maxConcurrency + + "when creating new session for " + + requestContext.destination.toString()); + } + }); + } + session.unref(); + const destroySessionCb = () => { + session.destroy(); + this.deleteSession(url, session); + }; + session.on("goaway", destroySessionCb); + session.on("error", destroySessionCb); + session.on("frameError", destroySessionCb); + session.on("close", () => this.deleteSession(url, session)); + if (connectionConfiguration.requestTimeout) { + session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb); + } + const connectionPool = this.sessionCache.get(url) || new node_http2_connection_pool_1.NodeHttp2ConnectionPool(); + connectionPool.offerLast(session); + this.sessionCache.set(url, connectionPool); + return session; + } + deleteSession(authority, session) { + const existingConnectionPool = this.sessionCache.get(authority); + if (!existingConnectionPool) { + return; + } + if (!existingConnectionPool.contains(session)) { + return; + } + existingConnectionPool.remove(session); + this.sessionCache.set(authority, existingConnectionPool); + } + release(requestContext, session) { + var _a; + const cacheKey = this.getUrlString(requestContext); + (_a = this.sessionCache.get(cacheKey)) === null || _a === void 0 ? void 0 : _a.offerLast(session); + } + destroy() { + for (const [key, connectionPool] of this.sessionCache) { + for (const session of connectionPool) { + if (!session.destroyed) { + session.destroy(); + } + connectionPool.remove(session); + } + this.sessionCache.delete(key); + } + } + setMaxConcurrentStreams(maxConcurrentStreams) { + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrentStreams must be greater than zero."); + } + this.config.maxConcurrency = maxConcurrentStreams; } - } - - if (!result) { - throw Error('Invalid ip address: ' + ip) - } - - return result -} - -// Copied from https://github.com/indutny/node-ip/blob/master/lib/ip.js#L63 -// @ts-ignore - this is copied from the link above better to keep it the same -const toString = function (buff, offset, length) { - offset = ~~offset - length = length || (buff.length - offset) - - const result = [] - let string - const view = new DataView(buff.buffer) - if (length === 4) { - // IPv4 - for (let i = 0; i < length; i++) { - result.push(buff[offset + i]) + setDisableConcurrentStreams(disableConcurrentStreams) { + this.config.disableConcurrency = disableConcurrentStreams; } - string = result.join('.') - } else if (length === 16) { - // IPv6 - for (let i = 0; i < length; i += 2) { - result.push(view.getUint16(offset + i).toString(16)) + getUrlString(request) { + return request.destination.toString(); } - string = result.join(':') - string = string.replace(/(^|:)0(:0)*:0(:|$)/, '$1::$3') - string = string.replace(/:{3,4}/, '::') - } - - return string -} - -module.exports = { - isIP, - isV4, - isV6, - toBytes, - toString } +exports.NodeHttp2ConnectionManager = NodeHttp2ConnectionManager; /***/ }), -/***/ 46015: -/***/ ((module) => { - -"use strict"; +/***/ 41869: +/***/ ((__unused_webpack_module, exports) => { -/** @typedef {import("./types").Protocol} Protocol */ -/** - * Protocols - * - * @param {number | string} proto - * @returns {Protocol} - */ -function Protocols (proto) { - if (typeof (proto) === 'number') { - if (Protocols.codes[proto]) { - return Protocols.codes[proto] +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NodeHttp2ConnectionPool = void 0; +class NodeHttp2ConnectionPool { + constructor(sessions) { + this.sessions = []; + this.sessions = sessions !== null && sessions !== void 0 ? sessions : []; } - - throw new Error('no protocol with code: ' + proto) - } else if (typeof (proto) === 'string') { - if (Protocols.names[proto]) { - return Protocols.names[proto] + poll() { + if (this.sessions.length > 0) { + return this.sessions.shift(); + } + } + offerLast(session) { + this.sessions.push(session); + } + contains(session) { + return this.sessions.includes(session); + } + remove(session) { + this.sessions = this.sessions.filter((s) => s !== session); + } + [Symbol.iterator]() { + return this.sessions[Symbol.iterator](); + } + destroy(connection) { + for (const session of this.sessions) { + if (session === connection) { + if (!session.destroyed) { + session.destroy(); + } + } + } } - - throw new Error('no protocol with name: ' + proto) - } - - throw new Error('invalid protocol id type: ' + proto) -} - -const V = -1 -Protocols.lengthPrefixedVarSize = V -Protocols.V = V - -/** @type {Array<[number, number, string, (string|boolean)?, string?]>} */ -Protocols.table = [ - [4, 32, 'ip4'], - [6, 16, 'tcp'], - [33, 16, 'dccp'], - [41, 128, 'ip6'], - [42, V, 'ip6zone'], - [53, V, 'dns', 'resolvable'], - [54, V, 'dns4', 'resolvable'], - [55, V, 'dns6', 'resolvable'], - [56, V, 'dnsaddr', 'resolvable'], - [132, 16, 'sctp'], - [273, 16, 'udp'], - [275, 0, 'p2p-webrtc-star'], - [276, 0, 'p2p-webrtc-direct'], - [277, 0, 'p2p-stardust'], - [290, 0, 'p2p-circuit'], - [301, 0, 'udt'], - [302, 0, 'utp'], - [400, V, 'unix', false, 'path'], - // `ipfs` is added before `p2p` for legacy support. - // All text representations will default to `p2p`, but `ipfs` will - // still be supported - [421, V, 'ipfs'], - // `p2p` is the preferred name for 421, and is now the default - [421, V, 'p2p'], - [443, 0, 'https'], - [444, 96, 'onion'], - [445, 296, 'onion3'], - [446, V, 'garlic64'], - [460, 0, 'quic'], - [477, 0, 'ws'], - [478, 0, 'wss'], - [479, 0, 'p2p-websocket-star'], - [480, 0, 'http'], - [777, V, 'memory'] -] -/** @type {Record} */ -Protocols.names = {} -/** @type {Record} */ -Protocols.codes = {} - -// populate tables -Protocols.table.map(row => { - const proto = p.apply(null, row) - Protocols.codes[proto.code] = proto - Protocols.names[proto.name] = proto - return null -}) - -Protocols.object = p - -/** - * - * Create a protocol - * - * @param {number} code - * @param {number} size - * @param {string} name - * @param {any} [resolvable] - * @param {any} [path] - * @returns {Protocol} - */ -function p (code, size, name, resolvable, path) { - return { - code, - size, - name, - resolvable: Boolean(resolvable), - path: Boolean(path) - } } - -module.exports = Protocols +exports.NodeHttp2ConnectionPool = NodeHttp2ConnectionPool; /***/ }), -/***/ 27914: -/***/ ((module) => { - -module.exports = read - -var MSB = 0x80 - , REST = 0x7F +/***/ 25841: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -function read(buf, offset) { - var res = 0 - , offset = offset || 0 - , shift = 0 - , counter = offset - , b - , l = buf.length - do { - if (counter >= l || shift > 49) { - read.bytes = 0 - throw new RangeError('Could not decode varint') +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NodeHttp2Handler = void 0; +const protocol_http_1 = __nccwpck_require__(76232); +const querystring_builder_1 = __nccwpck_require__(29756); +const http2_1 = __nccwpck_require__(85158); +const get_transformed_headers_1 = __nccwpck_require__(5454); +const node_http2_connection_manager_1 = __nccwpck_require__(62667); +const write_request_body_1 = __nccwpck_require__(84171); +class NodeHttp2Handler { + static create(instanceOrOptions) { + if (typeof (instanceOrOptions === null || instanceOrOptions === void 0 ? void 0 : instanceOrOptions.handle) === "function") { + return instanceOrOptions; + } + return new NodeHttp2Handler(instanceOrOptions); + } + constructor(options) { + this.metadata = { handlerProtocol: "h2" }; + this.connectionManager = new node_http2_connection_manager_1.NodeHttp2ConnectionManager({}); + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options() + .then((opts) => { + resolve(opts || {}); + }) + .catch(reject); + } + else { + resolve(options || {}); + } + }); + } + destroy() { + this.connectionManager.destroy(); + } + async handle(request, { abortSignal } = {}) { + if (!this.config) { + this.config = await this.configProvider; + this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); + if (this.config.maxConcurrentStreams) { + this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); + } + } + const { requestTimeout, disableConcurrentStreams } = this.config; + return new Promise((_resolve, _reject) => { + var _a, _b, _c; + let fulfilled = false; + let writeRequestBodyPromise = undefined; + const resolve = async (arg) => { + await writeRequestBodyPromise; + _resolve(arg); + }; + const reject = async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }; + if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { + fulfilled = true; + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const { hostname, method, port, protocol, query } = request; + let auth = ""; + if (request.username != null || request.password != null) { + const username = (_a = request.username) !== null && _a !== void 0 ? _a : ""; + const password = (_b = request.password) !== null && _b !== void 0 ? _b : ""; + auth = `${username}:${password}@`; + } + const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; + const requestContext = { destination: new URL(authority) }; + const session = this.connectionManager.lease(requestContext, { + requestTimeout: (_c = this.config) === null || _c === void 0 ? void 0 : _c.sessionTimeout, + disableConcurrentStreams: disableConcurrentStreams || false, + }); + const rejectWithDestroy = (err) => { + if (disableConcurrentStreams) { + this.destroySession(session); + } + fulfilled = true; + reject(err); + }; + const queryString = (0, querystring_builder_1.buildQueryString)(query || {}); + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + const req = session.request({ + ...request.headers, + [http2_1.constants.HTTP2_HEADER_PATH]: path, + [http2_1.constants.HTTP2_HEADER_METHOD]: method, + }); + session.ref(); + req.on("response", (headers) => { + const httpResponse = new protocol_http_1.HttpResponse({ + statusCode: headers[":status"] || -1, + headers: (0, get_transformed_headers_1.getTransformedHeaders)(headers), + body: req, + }); + fulfilled = true; + resolve({ response: httpResponse }); + if (disableConcurrentStreams) { + session.close(); + this.connectionManager.deleteSession(authority, session); + } + }); + if (requestTimeout) { + req.setTimeout(requestTimeout, () => { + req.close(); + const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); + timeoutError.name = "TimeoutError"; + rejectWithDestroy(timeoutError); + }); + } + if (abortSignal) { + abortSignal.onabort = () => { + req.close(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + rejectWithDestroy(abortError); + }; + } + req.on("frameError", (type, code, id) => { + rejectWithDestroy(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code}.`)); + }); + req.on("error", rejectWithDestroy); + req.on("aborted", () => { + rejectWithDestroy(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${req.rstCode}.`)); + }); + req.on("close", () => { + session.unref(); + if (disableConcurrentStreams) { + session.destroy(); + } + if (!fulfilled) { + rejectWithDestroy(new Error("Unexpected error: http2 request did not get a response")); + } + }); + writeRequestBodyPromise = (0, write_request_body_1.writeRequestBody)(req, request, requestTimeout); + }); + } + updateHttpClientConfig(key, value) { + this.config = undefined; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value, + }; + }); + } + httpHandlerConfigs() { + var _a; + return (_a = this.config) !== null && _a !== void 0 ? _a : {}; + } + destroySession(session) { + if (!session.destroyed) { + session.destroy(); + } } - b = buf[counter++] - res += shift < 28 - ? (b & REST) << shift - : (b & REST) * Math.pow(2, shift) - shift += 7 - } while (b >= MSB) - - read.bytes = counter - offset - - return res } +exports.NodeHttp2Handler = NodeHttp2Handler; /***/ }), -/***/ 95177: -/***/ ((module) => { - -module.exports = encode - -var MSB = 0x80 - , REST = 0x7F - , MSBALL = ~REST - , INT = Math.pow(2, 31) +/***/ 50132: +/***/ ((__unused_webpack_module, exports) => { -function encode(num, out, offset) { - if (Number.MAX_SAFE_INTEGER && num > Number.MAX_SAFE_INTEGER) { - encode.bytes = 0 - throw new RangeError('Could not encode varint') - } - out = out || [] - offset = offset || 0 - var oldOffset = offset - while(num >= INT) { - out[offset++] = (num & 0xFF) | MSB - num /= 128 - } - while(num & MSBALL) { - out[offset++] = (num & 0xFF) | MSB - num >>>= 7 - } - out[offset] = num | 0 - - encode.bytes = offset - oldOffset + 1 - - return out -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.setConnectionTimeout = void 0; +const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { + if (!timeoutInMs) { + return; + } + const timeoutId = setTimeout(() => { + request.destroy(); + reject(Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { + name: "TimeoutError", + })); + }, timeoutInMs); + request.on("socket", (socket) => { + if (socket.connecting) { + socket.on("connect", () => { + clearTimeout(timeoutId); + }); + } + else { + clearTimeout(timeoutId); + } + }); +}; +exports.setConnectionTimeout = setConnectionTimeout; /***/ }), -/***/ 9280: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 14461: +/***/ ((__unused_webpack_module, exports) => { -module.exports = { - encode: __nccwpck_require__(95177) - , decode: __nccwpck_require__(27914) - , encodingLength: __nccwpck_require__(62841) -} + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.setSocketKeepAlive = void 0; +const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }) => { + if (keepAlive !== true) { + return; + } + request.on("socket", (socket) => { + socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + }); +}; +exports.setSocketKeepAlive = setSocketKeepAlive; /***/ }), -/***/ 62841: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - +/***/ 30276: +/***/ ((__unused_webpack_module, exports) => { -/** - * Collects all values from an (async) iterable into an array and returns it. - * - * @template T - * @param {AsyncIterable|Iterable} source - */ -const all = async (source) => { - const arr = [] +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.setSocketTimeout = void 0; +const setSocketTimeout = (request, reject, timeoutInMs = 0) => { + request.setTimeout(timeoutInMs, () => { + request.destroy(); + reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); + }); +}; +exports.setSocketTimeout = setSocketTimeout; -<<<<<<< HEAD -======= /***/ }), -/***/ 51949: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var BufferList = __nccwpck_require__(87455); +/***/ 16950: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } -var BufferList__default = /*#__PURE__*/_interopDefaultLegacy(BufferList); - -async function* fixedSizeChunker(source, options) { - let bl = new BufferList__default["default"](); - let currentLength = 0; - let emitted = false; - const maxChunkSize = options.maxChunkSize; - for await (const buffer of source) { - bl.append(buffer); - currentLength += buffer.length; - while (currentLength >= maxChunkSize) { - yield bl.slice(0, maxChunkSize); - emitted = true; - if (maxChunkSize === bl.length) { - bl = new BufferList__default["default"](); - currentLength = 0; - } else { - const newBl = new BufferList__default["default"](); - newBl.append(bl.shallowSlice(maxChunkSize)); - bl = newBl; - currentLength -= maxChunkSize; - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Collector = void 0; +const stream_1 = __nccwpck_require__(12781); +class Collector extends stream_1.Writable { + constructor() { + super(...arguments); + this.bufferedBytes = []; + } + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); } - } - if (!emitted || currentLength) { - yield bl.slice(0, currentLength); - } } - -module.exports = fixedSizeChunker; +exports.Collector = Collector; /***/ }), -/***/ 26682: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 20821: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.streamCollector = void 0; +const collector_1 = __nccwpck_require__(16950); +const streamCollector = (stream) => new Promise((resolve, reject) => { + const collector = new collector_1.Collector(); + stream.pipe(collector); + stream.on("error", (err) => { + collector.end(); + reject(err); + }); + collector.on("error", reject); + collector.on("finish", function () { + const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); + resolve(bytes); + }); +}); +exports.streamCollector = streamCollector; -var BufferList = __nccwpck_require__(87455); -var rabinWasm = __nccwpck_require__(41333); -var errCode = __nccwpck_require__(5822); +/***/ }), -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +/***/ 84171: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var BufferList__default = /*#__PURE__*/_interopDefaultLegacy(BufferList); -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); - -async function* rabinChunker(source, options) { - let min, max, avg; - if (options.minChunkSize && options.maxChunkSize && options.avgChunkSize) { - avg = options.avgChunkSize; - min = options.minChunkSize; - max = options.maxChunkSize; - } else if (!options.avgChunkSize) { - throw errCode__default["default"](new Error('please specify an average chunk size'), 'ERR_INVALID_AVG_CHUNK_SIZE'); - } else { - avg = options.avgChunkSize; - min = avg / 3; - max = avg + avg / 2; - } - if (min < 16) { - throw errCode__default["default"](new Error('rabin min must be greater than 16'), 'ERR_INVALID_MIN_CHUNK_SIZE'); - } - if (max < min) { - max = min; - } - if (avg < min) { - avg = min; - } - const sizepow = Math.floor(Math.log2(avg)); - for await (const chunk of rabin(source, { - min: min, - max: max, - bits: sizepow, - window: options.window, - polynomial: options.polynomial - })) { - yield chunk; - } + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.writeRequestBody = void 0; +const stream_1 = __nccwpck_require__(12781); +const MIN_WAIT_TIME = 1000; +async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME) { + var _a; + const headers = (_a = request.headers) !== null && _a !== void 0 ? _a : {}; + const expect = headers["Expect"] || headers["expect"]; + let timeoutId = -1; + let hasError = false; + if (expect === "100-continue") { + await Promise.race([ + new Promise((resolve) => { + timeoutId = Number(setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); + }), + new Promise((resolve) => { + httpRequest.on("continue", () => { + clearTimeout(timeoutId); + resolve(); + }); + httpRequest.on("error", () => { + hasError = true; + clearTimeout(timeoutId); + resolve(); + }); + }), + ]); + } + if (!hasError) { + writeBody(httpRequest, request.body); + } } -async function* rabin(source, options) { - const r = await rabinWasm.create(options.bits, options.min, options.max, options.window); - const buffers = new BufferList__default["default"](); - for await (const chunk of source) { - buffers.append(chunk); - const sizes = r.fingerprint(chunk); - for (let i = 0; i < sizes.length; i++) { - const size = sizes[i]; - const buf = buffers.slice(0, size); - buffers.consume(size); - yield buf; +exports.writeRequestBody = writeRequestBody; +function writeBody(httpRequest, body) { + if (body instanceof stream_1.Readable) { + body.pipe(httpRequest); + } + else if (body) { + httpRequest.end(Buffer.from(body)); + } + else { + httpRequest.end(); } - } - if (buffers.length) { - yield buffers.slice(0); - } } -module.exports = rabinChunker; - /***/ }), -/***/ 5662: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var ipfsUnixfs = __nccwpck_require__(24821); -var persist = __nccwpck_require__(57161); -var dagPb = __nccwpck_require__(72532); +/***/ 9937: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const dirBuilder = async (item, blockstore, options) => { - const unixfs = new ipfsUnixfs.UnixFS({ - type: 'directory', - mtime: item.mtime, - mode: item.mode - }); - const buffer = dagPb.encode(dagPb.prepare({ Data: unixfs.marshal() })); - const cid = await persist(buffer, blockstore, options); - const path = item.path; - return { - cid, - path, - unixfs, - size: buffer.length - }; -}; -module.exports = dirBuilder; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CredentialsProviderError = void 0; +const ProviderError_1 = __nccwpck_require__(41377); +class CredentialsProviderError extends ProviderError_1.ProviderError { + constructor(message, tryNextLink = true) { + super(message, tryNextLink); + this.tryNextLink = tryNextLink; + this.name = "CredentialsProviderError"; + Object.setPrototypeOf(this, CredentialsProviderError.prototype); + } +} +exports.CredentialsProviderError = CredentialsProviderError; /***/ }), -/***/ 11011: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var batch = __nccwpck_require__(58611); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +/***/ 41377: +/***/ ((__unused_webpack_module, exports) => { -var batch__default = /*#__PURE__*/_interopDefaultLegacy(batch); -function balanced(source, reduce, options) { - return reduceToParents(source, reduce, options); -} -async function reduceToParents(source, reduce, options) { - const roots = []; - for await (const chunked of batch__default["default"](source, options.maxChildrenPerNode)) { - roots.push(await reduce(chunked)); - } - if (roots.length > 1) { - return reduceToParents(roots, reduce, options); - } - return roots[0]; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ProviderError = void 0; +class ProviderError extends Error { + constructor(message, tryNextLink = true) { + super(message); + this.tryNextLink = tryNextLink; + this.name = "ProviderError"; + Object.setPrototypeOf(this, ProviderError.prototype); + } + static from(error, tryNextLink = true) { + return Object.assign(new this(error.message, tryNextLink), error); + } } - -module.exports = balanced; +exports.ProviderError = ProviderError; /***/ }), -/***/ 96097: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var ipfsUnixfs = __nccwpck_require__(24821); -var persist = __nccwpck_require__(57161); -var dagPb = __nccwpck_require__(72532); -var rawCodec = __nccwpck_require__(4848); - -function _interopNamespace(e) { - if (e && e.__esModule) return e; - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n["default"] = e; - return Object.freeze(n); -} +/***/ 29433: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var dagPb__namespace = /*#__PURE__*/_interopNamespace(dagPb); -var rawCodec__namespace = /*#__PURE__*/_interopNamespace(rawCodec); -async function* bufferImporter(file, block, options) { - for await (let buffer of file.content) { - yield async () => { - options.progress(buffer.length, file.path); - let unixfs; - const opts = { - codec: dagPb__namespace, - cidVersion: options.cidVersion, - hasher: options.hasher, - onlyHash: options.onlyHash - }; - if (options.rawLeaves) { - opts.codec = rawCodec__namespace; - opts.cidVersion = 1; - } else { - unixfs = new ipfsUnixfs.UnixFS({ - type: options.leafType, - data: buffer - }); - buffer = dagPb__namespace.encode({ - Data: unixfs.marshal(), - Links: [] - }); - } - return { - cid: await persist(buffer, block, opts), - unixfs, - size: buffer.length - }; - }; - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TokenProviderError = void 0; +const ProviderError_1 = __nccwpck_require__(41377); +class TokenProviderError extends ProviderError_1.ProviderError { + constructor(message, tryNextLink = true) { + super(message, tryNextLink); + this.tryNextLink = tryNextLink; + this.name = "TokenProviderError"; + Object.setPrototypeOf(this, TokenProviderError.prototype); + } } - -module.exports = bufferImporter; +exports.TokenProviderError = TokenProviderError; /***/ }), -/***/ 84486: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 90075: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.chain = void 0; +const ProviderError_1 = __nccwpck_require__(41377); +const chain = (...providers) => async () => { + if (providers.length === 0) { + throw new ProviderError_1.ProviderError("No providers in chain"); + } + let lastProviderError; + for (const provider of providers) { + try { + const credentials = await provider(); + return credentials; + } + catch (err) { + lastProviderError = err; + if (err === null || err === void 0 ? void 0 : err.tryNextLink) { + continue; + } + throw err; + } + } + throw lastProviderError; +}; +exports.chain = chain; -var all = __nccwpck_require__(81172); -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +/***/ }), -var all__default = /*#__PURE__*/_interopDefaultLegacy(all); +/***/ 60105: +/***/ ((__unused_webpack_module, exports) => { -async function flat(source, reduce) { - return reduce(await all__default["default"](source)); -} -module.exports = flat; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fromStatic = void 0; +const fromStatic = (staticValue) => () => Promise.resolve(staticValue); +exports.fromStatic = fromStatic; /***/ }), -/***/ 28484: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 60846: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(9937), exports); +tslib_1.__exportStar(__nccwpck_require__(41377), exports); +tslib_1.__exportStar(__nccwpck_require__(29433), exports); +tslib_1.__exportStar(__nccwpck_require__(90075), exports); +tslib_1.__exportStar(__nccwpck_require__(60105), exports); +tslib_1.__exportStar(__nccwpck_require__(61086), exports); -var errCode = __nccwpck_require__(5822); -var ipfsUnixfs = __nccwpck_require__(24821); -var persist = __nccwpck_require__(57161); -var dagPb = __nccwpck_require__(72532); -var parallelBatch = __nccwpck_require__(62898); -var rawCodec = __nccwpck_require__(4848); -var flat = __nccwpck_require__(84486); -var balanced = __nccwpck_require__(11011); -var trickle = __nccwpck_require__(27000); -var bufferImporter = __nccwpck_require__(96097); -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +/***/ }), -function _interopNamespace(e) { - if (e && e.__esModule) return e; - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n["default"] = e; - return Object.freeze(n); -} +/***/ 61086: +/***/ ((__unused_webpack_module, exports) => { -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); -var dagPb__namespace = /*#__PURE__*/_interopNamespace(dagPb); -var parallelBatch__default = /*#__PURE__*/_interopDefaultLegacy(parallelBatch); -var rawCodec__namespace = /*#__PURE__*/_interopNamespace(rawCodec); -const dagBuilders = { - flat: flat, - balanced: balanced, - trickle: trickle -}; -async function* buildFileBatch(file, blockstore, options) { - let count = -1; - let previous; - let bufferImporter$1; - if (typeof options.bufferImporter === 'function') { - bufferImporter$1 = options.bufferImporter; - } else { - bufferImporter$1 = bufferImporter; - } - for await (const entry of parallelBatch__default["default"](bufferImporter$1(file, blockstore, options), options.blockWriteConcurrency)) { - count++; - if (count === 0) { - previous = entry; - continue; - } else if (count === 1 && previous) { - yield previous; - previous = null; - } - yield entry; - } - if (previous) { - previous.single = true; - yield previous; - } -} -const reduce = (file, blockstore, options) => { - async function reducer(leaves) { - if (leaves.length === 1 && leaves[0].single && options.reduceSingleLeafToSelf) { - const leaf = leaves[0]; - if (file.mtime !== undefined || file.mode !== undefined) { - let buffer = await blockstore.get(leaf.cid); - leaf.unixfs = new ipfsUnixfs.UnixFS({ - type: 'file', - mtime: file.mtime, - mode: file.mode, - data: buffer - }); - buffer = dagPb.encode(dagPb.prepare({ Data: leaf.unixfs.marshal() })); - leaf.cid = await persist(buffer, blockstore, { - ...options, - codec: dagPb__namespace, - hasher: options.hasher, - cidVersion: options.cidVersion - }); - leaf.size = buffer.length; - } - return { - cid: leaf.cid, - path: file.path, - unixfs: leaf.unixfs, - size: leaf.size - }; - } - const f = new ipfsUnixfs.UnixFS({ - type: 'file', - mtime: file.mtime, - mode: file.mode - }); - const links = leaves.filter(leaf => { - if (leaf.cid.code === rawCodec__namespace.code && leaf.size) { - return true; - } - if (leaf.unixfs && !leaf.unixfs.data && leaf.unixfs.fileSize()) { - return true; - } - return Boolean(leaf.unixfs && leaf.unixfs.data && leaf.unixfs.data.length); - }).map(leaf => { - if (leaf.cid.code === rawCodec__namespace.code) { - f.addBlockSize(leaf.size); - return { - Name: '', - Tsize: leaf.size, - Hash: leaf.cid - }; - } - if (!leaf.unixfs || !leaf.unixfs.data) { - f.addBlockSize(leaf.unixfs && leaf.unixfs.fileSize() || 0); - } else { - f.addBlockSize(leaf.unixfs.data.length); - } - return { - Name: '', - Tsize: leaf.size, - Hash: leaf.cid - }; - }); - const node = { - Data: f.marshal(), - Links: links +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.memoize = void 0; +const memoize = (provider, isExpired, requiresRefresh) => { + let resolved; + let pending; + let hasResult; + let isConstant = false; + const coalesceProvider = async () => { + if (!pending) { + pending = provider(); + } + try { + resolved = await pending; + hasResult = true; + isConstant = false; + } + finally { + pending = undefined; + } + return resolved; }; - const buffer = dagPb.encode(dagPb.prepare(node)); - const cid = await persist(buffer, blockstore, options); - return { - cid, - path: file.path, - unixfs: f, - size: buffer.length + node.Links.reduce((acc, curr) => acc + curr.Tsize, 0) + if (isExpired === undefined) { + return async (options) => { + if (!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh)) { + resolved = await coalesceProvider(); + } + return resolved; + }; + } + return async (options) => { + if (!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh)) { + resolved = await coalesceProvider(); + } + if (isConstant) { + return resolved; + } + if (requiresRefresh && !requiresRefresh(resolved)) { + isConstant = true; + return resolved; + } + if (isExpired(resolved)) { + await coalesceProvider(); + return resolved; + } + return resolved; }; - } - return reducer; }; -function fileBuilder(file, block, options) { - const dagBuilder = dagBuilders[options.strategy]; - if (!dagBuilder) { - throw errCode__default["default"](new Error(`Unknown importer build strategy name: ${ options.strategy }`), 'ERR_BAD_STRATEGY'); - } - return dagBuilder(buildFileBatch(file, block, options), reduce(file, block, options), options); -} - -module.exports = fileBuilder; +exports.memoize = memoize; /***/ }), -/***/ 27000: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var batch = __nccwpck_require__(58611); +/***/ 79697: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } -var batch__default = /*#__PURE__*/_interopDefaultLegacy(batch); - -async function trickleStream(source, reduce, options) { - const root = new Root(options.layerRepeat); - let iteration = 0; - let maxDepth = 1; - let subTree = root; - for await (const layer of batch__default["default"](source, options.maxChildrenPerNode)) { - if (subTree.isFull()) { - if (subTree !== root) { - root.addChild(await subTree.reduce(reduce)); - } - if (iteration && iteration % options.layerRepeat === 0) { - maxDepth++; - } - subTree = new SubTree(maxDepth, options.layerRepeat, iteration); - iteration++; - } - subTree.append(layer); - } - if (subTree && subTree !== root) { - root.addChild(await subTree.reduce(reduce)); - } - return root.reduce(reduce); -} -class SubTree { - constructor(maxDepth, layerRepeat, iteration = 0) { - this.maxDepth = maxDepth; - this.layerRepeat = layerRepeat; - this.currentDepth = 1; - this.iteration = iteration; - this.root = this.node = this.parent = { - children: [], - depth: this.currentDepth, - maxDepth, - maxChildren: (this.maxDepth - this.currentDepth) * this.layerRepeat - }; - } - isFull() { - if (!this.root.data) { - return false; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Field = void 0; +const types_1 = __nccwpck_require__(21438); +class Field { + constructor({ name, kind = types_1.FieldPosition.HEADER, values = [] }) { + this.name = name; + this.kind = kind; + this.values = values; } - if (this.currentDepth < this.maxDepth && this.node.maxChildren) { - this._addNextNodeToParent(this.node); - return false; + add(value) { + this.values.push(value); } - const distantRelative = this._findParent(this.node, this.currentDepth); - if (distantRelative) { - this._addNextNodeToParent(distantRelative); - return false; + set(values) { + this.values = values; } - return true; - } - _addNextNodeToParent(parent) { - this.parent = parent; - const nextNode = { - children: [], - depth: parent.depth + 1, - parent, - maxDepth: this.maxDepth, - maxChildren: Math.floor(parent.children.length / this.layerRepeat) * this.layerRepeat - }; - parent.children.push(nextNode); - this.currentDepth = nextNode.depth; - this.node = nextNode; - } - append(layer) { - this.node.data = layer; - } - reduce(reduce) { - return this._reduce(this.root, reduce); - } - async _reduce(node, reduce) { - let children = []; - if (node.children.length) { - children = await Promise.all(node.children.filter(child => child.data).map(child => this._reduce(child, reduce))); + remove(value) { + this.values = this.values.filter((v) => v !== value); } - return reduce((node.data || []).concat(children)); - } - _findParent(node, depth) { - const parent = node.parent; - if (!parent || parent.depth === 0) { - return; + toString() { + return this.values.map((v) => (v.includes(",") || v.includes(" ") ? `"${v}"` : v)).join(", "); } - if (parent.children.length === parent.maxChildren || !parent.maxChildren) { - return this._findParent(parent, depth); + get() { + return this.values; } - return parent; - } -} -class Root extends SubTree { - constructor(layerRepeat) { - super(0, layerRepeat); - this.root.depth = 0; - this.currentDepth = 1; - } - addChild(child) { - this.root.children.push(child); - } - reduce(reduce) { - return reduce((this.root.data || []).concat(this.root.children)); - } } - -module.exports = trickleStream; +exports.Field = Field; /***/ }), -/***/ 59929: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var dir = __nccwpck_require__(5662); -var index = __nccwpck_require__(28484); -var errCode = __nccwpck_require__(5822); -var rabin = __nccwpck_require__(26682); -var fixedSize = __nccwpck_require__(51949); -var validateChunks = __nccwpck_require__(1843); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +/***/ 68737: +/***/ ((__unused_webpack_module, exports) => { -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); -function isIterable(thing) { - return Symbol.iterator in thing; -} -function isAsyncIterable(thing) { - return Symbol.asyncIterator in thing; -} -function contentAsAsyncIterable(content) { - try { - if (content instanceof Uint8Array) { - return async function* () { - yield content; - }(); - } else if (isIterable(content)) { - return async function* () { - yield* content; - }(); - } else if (isAsyncIterable(content)) { - return content; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Fields = void 0; +class Fields { + constructor({ fields = [], encoding = "utf-8" }) { + this.entries = {}; + fields.forEach(this.setField.bind(this)); + this.encoding = encoding; + } + setField(field) { + this.entries[field.name.toLowerCase()] = field; + } + getField(name) { + return this.entries[name.toLowerCase()]; + } + removeField(name) { + delete this.entries[name.toLowerCase()]; + } + getByType(kind) { + return Object.values(this.entries).filter((field) => field.kind === kind); } - } catch { - throw errCode__default["default"](new Error('Content was invalid'), 'ERR_INVALID_CONTENT'); - } - throw errCode__default["default"](new Error('Content was invalid'), 'ERR_INVALID_CONTENT'); -} -async function* dagBuilder(source, blockstore, options) { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - for await (const entry of source) { - arr.push(entry) - } - - return arr } - -module.exports = all +exports.Fields = Fields; /***/ }), -<<<<<<< HEAD -/***/ 95462: -======= -/***/ 1843: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 2527: +/***/ ((__unused_webpack_module, exports) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.resolveHttpHandlerRuntimeConfig = exports.getHttpHandlerExtensionConfiguration = void 0; +const getHttpHandlerExtensionConfiguration = (runtimeConfig) => { + let httpHandler = runtimeConfig.httpHandler; + return { + setHttpHandler(handler) { + httpHandler = handler; + }, + httpHandler() { + return httpHandler; + }, + updateHttpClientConfig(key, value) { + httpHandler.updateHttpClientConfig(key, value); + }, + httpHandlerConfigs() { + return httpHandler.httpHandlerConfigs(); + }, + }; +}; +exports.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration; +const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => { + return { + httpHandler: httpHandlerExtensionConfiguration.httpHandler(), + }; +}; +exports.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig; -<<<<<<< HEAD -const fs = (__nccwpck_require__(57147).promises) -const path = __nccwpck_require__(71017) -const minimatch = __nccwpck_require__(10771) -======= -var errCode = __nccwpck_require__(5822); -var fromString = __nccwpck_require__(39451); -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +/***/ }), -var errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode); +/***/ 75000: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -async function* validateChunks(source) { - for await (const content of source) { - if (content.length === undefined) { - throw errCode__default["default"](new Error('Content was invalid'), 'ERR_INVALID_CONTENT'); - } - if (typeof content === 'string' || content instanceof String) { - yield fromString.fromString(content.toString()); - } else if (Array.isArray(content)) { - yield Uint8Array.from(content); - } else if (content instanceof Uint8Array) { - yield content; - } else { - throw errCode__default["default"](new Error('Content was invalid'), 'ERR_INVALID_CONTENT'); - } - } -} -module.exports = validateChunks; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(2527), exports); /***/ }), -/***/ 22728: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var dagPb = __nccwpck_require__(72532); -var ipfsUnixfs = __nccwpck_require__(24821); -var dir = __nccwpck_require__(86803); -var persist = __nccwpck_require__(57161); +/***/ 45082: +/***/ ((__unused_webpack_module, exports) => { -class DirFlat extends dir { - constructor(props, options) { - super(props, options); - this._children = {}; - } - async put(name, value) { - this.cid = undefined; - this.size = undefined; - this._children[name] = value; - } - get(name) { - return Promise.resolve(this._children[name]); - } - childCount() { - return Object.keys(this._children).length; - } - directChildrenCount() { - return this.childCount(); - } - onlyChild() { - return this._children[Object.keys(this._children)[0]]; - } - async *eachChildSeries() { - const keys = Object.keys(this._children); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - yield { - key: key, - child: this._children[key] - }; - } - } - async *flush(block) { - const children = Object.keys(this._children); - const links = []; - for (let i = 0; i < children.length; i++) { - let child = this._children[children[i]]; - if (child instanceof dir) { - for await (const entry of child.flush(block)) { - child = entry; - yield child; - } - } - if (child.size != null && child.cid) { - links.push({ - Name: children[i], - Tsize: child.size, - Hash: child.cid - }); - } - } - const unixfs = new ipfsUnixfs.UnixFS({ - type: 'directory', - mtime: this.mtime, - mode: this.mode - }); - const node = { - Data: unixfs.marshal(), - Links: links - }; - const buffer = dagPb.encode(dagPb.prepare(node)); - const cid = await persist(buffer, block, this.options); - const size = buffer.length + node.Links.reduce((acc, curr) => acc + (curr.Tsize == null ? 0 : curr.Tsize), 0); - this.cid = cid; - this.size = size; - yield { - cid, - unixfs, - path: this.path, - size - }; - } -} -module.exports = DirFlat; +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 9967: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - +/***/ 28735: +/***/ ((__unused_webpack_module, exports) => { -var dagPb = __nccwpck_require__(72532); -var ipfsUnixfs = __nccwpck_require__(24821); -var dir = __nccwpck_require__(86803); -var persist = __nccwpck_require__(57161); -var hamtSharding = __nccwpck_require__(78338); -class DirSharded extends dir { - constructor(props, options) { - super(props, options); - this._bucket = hamtSharding.createHAMT({ - hashFn: options.hamtHashFn, - bits: options.hamtBucketBits - }); - } - async put(name, value) { - await this._bucket.put(name, value); - } - get(name) { - return this._bucket.get(name); - } - childCount() { - return this._bucket.leafCount(); - } - directChildrenCount() { - return this._bucket.childrenCount(); - } - onlyChild() { - return this._bucket.onlyChild(); - } - async *eachChildSeries() { - for await (const {key, value} of this._bucket.eachLeafSeries()) { - yield { - key, - child: value - }; - } - } - async *flush(blockstore) { - for await (const entry of flush(this._bucket, blockstore, this, this.options)) { - yield { - ...entry, - path: this.path - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.HttpRequest = void 0; +class HttpRequest { + constructor(options) { + this.method = options.method || "GET"; + this.hostname = options.hostname || "localhost"; + this.port = options.port; + this.query = options.query || {}; + this.headers = options.headers || {}; + this.body = options.body; + this.protocol = options.protocol + ? options.protocol.slice(-1) !== ":" + ? `${options.protocol}:` + : options.protocol + : "https:"; + this.path = options.path ? (options.path.charAt(0) !== "/" ? `/${options.path}` : options.path) : "/"; + this.username = options.username; + this.password = options.password; + this.fragment = options.fragment; } - } -} -async function* flush(bucket, blockstore, shardRoot, options) { - const children = bucket._children; - const links = []; - let childrenSize = 0; - for (let i = 0; i < children.length; i++) { - const child = children.get(i); - if (!child) { - continue; + static isInstance(request) { + if (!request) + return false; + const req = request; + return ("method" in req && + "protocol" in req && + "hostname" in req && + "path" in req && + typeof req["query"] === "object" && + typeof req["headers"] === "object"); } - const labelPrefix = i.toString(16).toUpperCase().padStart(2, '0'); - if (child instanceof hamtSharding.Bucket) { - let shard; - for await (const subShard of await flush(child, blockstore, null, options)) { - shard = subShard; - } - if (!shard) { - throw new Error('Could not flush sharded directory, no subshard found'); - } - links.push({ - Name: labelPrefix, - Tsize: shard.size, - Hash: shard.cid - }); - childrenSize += shard.size; - } else if (typeof child.value.flush === 'function') { - const dir = child.value; - let flushedDir; - for await (const entry of dir.flush(blockstore)) { - flushedDir = entry; - yield flushedDir; - } - const label = labelPrefix + child.key; - links.push({ - Name: label, - Tsize: flushedDir.size, - Hash: flushedDir.cid - }); - childrenSize += flushedDir.size; - } else { - const value = child.value; - if (!value.cid) { - continue; - } - const label = labelPrefix + child.key; - const size = value.size; - links.push({ - Name: label, - Tsize: size, - Hash: value.cid - }); - childrenSize += size; + clone() { + const cloned = new HttpRequest({ + ...this, + headers: { ...this.headers }, + }); + if (cloned.query) + cloned.query = cloneQuery(cloned.query); + return cloned; } - } - const data = Uint8Array.from(children.bitField().reverse()); - const dir = new ipfsUnixfs.UnixFS({ - type: 'hamt-sharded-directory', - data, - fanout: bucket.tableSize(), - hashType: options.hamtHashCode, - mtime: shardRoot && shardRoot.mtime, - mode: shardRoot && shardRoot.mode - }); - const node = { - Data: dir.marshal(), - Links: links - }; - const buffer = dagPb.encode(dagPb.prepare(node)); - const cid = await persist(buffer, blockstore, options); - const size = buffer.length + childrenSize; - yield { - cid, - unixfs: dir, - size - }; } - -module.exports = DirSharded; - - -/***/ }), - -/***/ 86803: -/***/ ((module) => { - -"use strict"; - - -class Dir { - constructor(props, options) { - this.options = options || {}; - this.root = props.root; - this.dir = props.dir; - this.path = props.path; - this.dirty = props.dirty; - this.flat = props.flat; - this.parent = props.parent; - this.parentKey = props.parentKey; - this.unixfs = props.unixfs; - this.mode = props.mode; - this.mtime = props.mtime; - this.cid = undefined; - this.size = undefined; - } - async put(name, value) { - } - get(name) { - return Promise.resolve(this); - } - async *eachChildSeries() { - } - async *flush(blockstore) { - } +exports.HttpRequest = HttpRequest; +function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param, + }; + }, {}); } -module.exports = Dir; - - -/***/ }), - -/***/ 72095: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +/***/ }), +/***/ 75077: +/***/ ((__unused_webpack_module, exports) => { -var dirSharded = __nccwpck_require__(9967); -var dirFlat = __nccwpck_require__(22728); -async function flatToShard(child, dir, threshold, options) { - let newDir = dir; - if (dir instanceof dirFlat && dir.directChildrenCount() >= threshold) { - newDir = await convertToShard(dir, options); - } - const parent = newDir.parent; - if (parent) { - if (newDir !== dir) { - if (child) { - child.parent = newDir; - } - if (!newDir.parentKey) { - throw new Error('No parent key found'); - } - await parent.put(newDir.parentKey, newDir); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.HttpResponse = void 0; +class HttpResponse { + constructor(options) { + this.statusCode = options.statusCode; + this.reason = options.reason; + this.headers = options.headers || {}; + this.body = options.body; + } + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; } - return flatToShard(newDir, parent, threshold, options); - } - return newDir; -} -async function convertToShard(oldDir, options) { - const newDir = new dirSharded({ - root: oldDir.root, - dir: true, - parent: oldDir.parent, - parentKey: oldDir.parentKey, - path: oldDir.path, - dirty: oldDir.dirty, - flat: false, - mtime: oldDir.mtime, - mode: oldDir.mode - }, options); - for await (const {key, child} of oldDir.eachChildSeries()) { - await newDir.put(key, child); - } - return newDir; } - -module.exports = flatToShard; +exports.HttpResponse = HttpResponse; /***/ }), -/***/ 17512: +/***/ 76232: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var parallelBatch = __nccwpck_require__(62898); -var options = __nccwpck_require__(91534); -var index = __nccwpck_require__(59929); -var treeBuilder = __nccwpck_require__(65599); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var parallelBatch__default = /*#__PURE__*/_interopDefaultLegacy(parallelBatch); - -async function* importer(source, blockstore, options$1 = {}) { - const opts = options(options$1); - let dagBuilder; - if (typeof options$1.dagBuilder === 'function') { - dagBuilder = options$1.dagBuilder; - } else { - dagBuilder = index; - } - let treeBuilder$1; - if (typeof options$1.treeBuilder === 'function') { - treeBuilder$1 = options$1.treeBuilder; - } else { - treeBuilder$1 = treeBuilder; - } - let candidates; - if (Symbol.asyncIterator in source || Symbol.iterator in source) { - candidates = source; - } else { - candidates = [source]; - } - for await (const entry of treeBuilder$1(parallelBatch__default["default"](dagBuilder(candidates, blockstore, opts), opts.fileImportConcurrency), blockstore, opts)) { - yield { - cid: entry.cid, - path: entry.path, - unixfs: entry.unixfs, - size: entry.size - }; - } -} - -exports.importer = importer; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(75000), exports); +tslib_1.__exportStar(__nccwpck_require__(79697), exports); +tslib_1.__exportStar(__nccwpck_require__(68737), exports); +tslib_1.__exportStar(__nccwpck_require__(45082), exports); +tslib_1.__exportStar(__nccwpck_require__(28735), exports); +tslib_1.__exportStar(__nccwpck_require__(75077), exports); +tslib_1.__exportStar(__nccwpck_require__(32109), exports); +tslib_1.__exportStar(__nccwpck_require__(86562), exports); /***/ }), -/***/ 91534: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 32109: +/***/ ((__unused_webpack_module, exports) => { -"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isValidHostname = void 0; +function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); +} +exports.isValidHostname = isValidHostname; -var mergeOptions = __nccwpck_require__(79139); -var sha2 = __nccwpck_require__(80960); -var murmur3 = __nccwpck_require__(17422); -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +/***/ }), -var mergeOptions__default = /*#__PURE__*/_interopDefaultLegacy(mergeOptions); +/***/ 86562: +/***/ ((__unused_webpack_module, exports) => { -async function hamtHashFn(buf) { - return (await murmur3.murmur3128.encode(buf)).slice(0, 8).reverse(); -} -const defaultOptions = { - chunker: 'fixed', - strategy: 'balanced', - rawLeaves: false, - onlyHash: false, - reduceSingleLeafToSelf: true, - hasher: sha2.sha256, - leafType: 'file', - cidVersion: 0, - progress: () => () => { - }, - shardSplitThreshold: 1000, - fileImportConcurrency: 50, - blockWriteConcurrency: 10, - minChunkSize: 262144, - maxChunkSize: 262144, - avgChunkSize: 262144, - window: 16, - polynomial: 17437180132763652, - maxChildrenPerNode: 174, - layerRepeat: 4, - wrapWithDirectory: false, - recursive: false, - hidden: false, - timeout: undefined, - hamtHashFn, - hamtHashCode: 34, - hamtBucketBits: 8 -}; -var defaultOptions$1 = (options = {}) => { - const defaults = mergeOptions__default["default"].bind({ ignoreUndefined: true }); - return defaults(defaultOptions, options); -}; -module.exports = defaultOptions$1; +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 65599: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - +/***/ 29756: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var dirFlat = __nccwpck_require__(22728); -var flatToShard = __nccwpck_require__(72095); -var dir = __nccwpck_require__(86803); -var toPathComponents = __nccwpck_require__(22931); -async function addToTree(elem, tree, options) { - const pathElems = toPathComponents(elem.path || ''); - const lastIndex = pathElems.length - 1; - let parent = tree; - let currentPath = ''; - for (let i = 0; i < pathElems.length; i++) { - const pathElem = pathElems[i]; - currentPath += `${ currentPath ? '/' : '' }${ pathElem }`; - const last = i === lastIndex; - parent.dirty = true; - parent.cid = undefined; - parent.size = undefined; - if (last) { - await parent.put(pathElem, elem); - tree = await flatToShard(null, parent, options.shardSplitThreshold, options); - } else { - let dir$1 = await parent.get(pathElem); - if (!dir$1 || !(dir$1 instanceof dir)) { - dir$1 = new dirFlat({ - root: false, - dir: true, - parent: parent, - parentKey: pathElem, - path: currentPath, - dirty: true, - flat: true, - mtime: dir$1 && dir$1.unixfs && dir$1.unixfs.mtime, - mode: dir$1 && dir$1.unixfs && dir$1.unixfs.mode - }, options); - } - await parent.put(pathElem, dir$1); - parent = dir$1; - } - } - return tree; -} -async function* flushAndYield(tree, blockstore) { - if (!(tree instanceof dir)) { - if (tree && tree.unixfs && tree.unixfs.isDirectory()) { - yield tree; - } - return; - } - yield* tree.flush(blockstore); -} -async function* treeBuilder(source, block, options) { - let tree = new dirFlat({ - root: true, - dir: true, - path: '', - dirty: true, - flat: true - }, options); - for await (const entry of source) { - if (!entry) { - continue; - } - tree = await addToTree(entry, tree, options); - if (!entry.unixfs || !entry.unixfs.isDirectory()) { - yield entry; - } - } - if (options.wrapWithDirectory) { - yield* flushAndYield(tree, block); - } else { - for await (const unwrapped of tree.eachChildSeries()) { - if (!unwrapped) { - continue; - } - yield* flushAndYield(unwrapped.child, block); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.buildQueryString = void 0; +const util_uri_escape_1 = __nccwpck_require__(25293); +function buildQueryString(query) { + const parts = []; + for (let key of Object.keys(query).sort()) { + const value = query[key]; + key = (0, util_uri_escape_1.escapeUri)(key); + if (Array.isArray(value)) { + for (let i = 0, iLen = value.length; i < iLen; i++) { + parts.push(`${key}=${(0, util_uri_escape_1.escapeUri)(value[i])}`); + } + } + else { + let qsEntry = key; + if (value || typeof value === "string") { + qsEntry += `=${(0, util_uri_escape_1.escapeUri)(value)}`; + } + parts.push(qsEntry); + } } - } + return parts.join("&"); } - -module.exports = treeBuilder; +exports.buildQueryString = buildQueryString; /***/ }), -/***/ 57161: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - +/***/ 49504: +/***/ ((__unused_webpack_module, exports) => { -var cid = __nccwpck_require__(24247); -var dagPb = __nccwpck_require__(72532); -var sha2 = __nccwpck_require__(80960); -function _interopNamespace(e) { - if (e && e.__esModule) return e; - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n["default"] = e; - return Object.freeze(n); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseQueryString = void 0; +function parseQueryString(querystring) { + const query = {}; + querystring = querystring.replace(/^\?/, ""); + if (querystring) { + for (const pair of querystring.split("&")) { + let [key, value = null] = pair.split("="); + key = decodeURIComponent(key); + if (value) { + value = decodeURIComponent(value); + } + if (!(key in query)) { + query[key] = value; + } + else if (Array.isArray(query[key])) { + query[key].push(value); + } + else { + query[key] = [query[key], value]; + } + } + } + return query; } - -var dagPb__namespace = /*#__PURE__*/_interopNamespace(dagPb); - -const persist = async (buffer, blockstore, options) => { - if (!options.codec) { - options.codec = dagPb__namespace; - } - if (!options.hasher) { - options.hasher = sha2.sha256; - } - if (options.cidVersion === undefined) { - options.cidVersion = 1; - } - if (options.codec === dagPb__namespace && options.hasher !== sha2.sha256) { - options.cidVersion = 1; - } - const multihash = await options.hasher.digest(buffer); - const cid$1 = cid.CID.create(options.cidVersion, options.codec.code, multihash); - if (!options.onlyHash) { - await blockstore.put(cid$1, buffer, { signal: options.signal }); - } - return cid$1; -}; - -module.exports = persist; +exports.parseQueryString = parseQueryString; /***/ }), -/***/ 22931: -/***/ ((module) => { - -"use strict"; - +/***/ 88474: +/***/ ((__unused_webpack_module, exports) => { -const toPathComponents = (path = '') => { - return (path.trim().match(/([^\\/]|\\\/)+/g) || []).filter(Boolean); -}; -module.exports = toPathComponents; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NODEJS_TIMEOUT_ERROR_CODES = exports.TRANSIENT_ERROR_STATUS_CODES = exports.TRANSIENT_ERROR_CODES = exports.THROTTLING_ERROR_CODES = exports.CLOCK_SKEW_ERROR_CODES = void 0; +exports.CLOCK_SKEW_ERROR_CODES = [ + "AuthFailure", + "InvalidSignatureException", + "RequestExpired", + "RequestInTheFuture", + "RequestTimeTooSkewed", + "SignatureDoesNotMatch", +]; +exports.THROTTLING_ERROR_CODES = [ + "BandwidthLimitExceeded", + "EC2ThrottledException", + "LimitExceededException", + "PriorRequestNotComplete", + "ProvisionedThroughputExceededException", + "RequestLimitExceeded", + "RequestThrottled", + "RequestThrottledException", + "SlowDown", + "ThrottledException", + "Throttling", + "ThrottlingException", + "TooManyRequestsException", + "TransactionInProgressException", +]; +exports.TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"]; +exports.TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; +exports.NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"]; /***/ }), -/***/ 24821: +/***/ 50805: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var errcode = __nccwpck_require__(5822); -var unixfs = __nccwpck_require__(81422); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var errcode__default = /*#__PURE__*/_interopDefaultLegacy(errcode); - -const PBData = unixfs.Data; -const types = [ - 'raw', - 'directory', - 'file', - 'metadata', - 'symlink', - 'hamt-sharded-directory' -]; -const dirTypes = [ - 'directory', - 'hamt-sharded-directory' -]; -const DEFAULT_FILE_MODE = parseInt('0644', 8); -const DEFAULT_DIRECTORY_MODE = parseInt('0755', 8); -function parseMode(mode) { - if (mode == null) { - return undefined; - } - if (typeof mode === 'number') { - return mode & 4095; - } - mode = mode.toString(); - if (mode.substring(0, 1) === '0') { - return parseInt(mode, 8) & 4095; - } - return parseInt(mode, 10) & 4095; -} -function parseMtime(input) { - if (input == null) { - return undefined; - } - let mtime; - if (input.secs != null) { - mtime = { - secs: input.secs, - nsecs: input.nsecs - }; - } - if (input.Seconds != null) { - mtime = { - secs: input.Seconds, - nsecs: input.FractionalNanoseconds - }; - } - if (Array.isArray(input)) { - mtime = { - secs: input[0], - nsecs: input[1] - }; - } - if (input instanceof Date) { - const ms = input.getTime(); - const secs = Math.floor(ms / 1000); - mtime = { - secs: secs, - nsecs: (ms - secs * 1000) * 1000 - }; - } - if (!Object.prototype.hasOwnProperty.call(mtime, 'secs')) { - return undefined; - } - if (mtime != null && mtime.nsecs != null && (mtime.nsecs < 0 || mtime.nsecs > 999999999)) { - throw errcode__default['default'](new Error('mtime-nsecs must be within the range [0,999999999]'), 'ERR_INVALID_MTIME_NSECS'); - } - return mtime; -} -class UnixFS { - static unmarshal(marshaled) { - const message = PBData.decode(marshaled); - const decoded = PBData.toObject(message, { - defaults: false, - arrays: true, - longs: Number, - objects: false - }); - const data = new UnixFS({ - type: types[decoded.Type], - data: decoded.Data, - blockSizes: decoded.blocksizes, - mode: decoded.mode, - mtime: decoded.mtime ? { - secs: decoded.mtime.Seconds, - nsecs: decoded.mtime.FractionalNanoseconds - } : undefined - }); - data._originalMode = decoded.mode || 0; - return data; - } - constructor(options = { type: 'file' }) { - const {type, data, blockSizes, hashType, fanout, mtime, mode} = options; - if (type && !types.includes(type)) { - throw errcode__default['default'](new Error('Type: ' + type + ' is not valid'), 'ERR_INVALID_TYPE'); - } - this.type = type || 'file'; - this.data = data; - this.hashType = hashType; - this.fanout = fanout; - this.blockSizes = blockSizes || []; - this._originalMode = 0; - this.mode = parseMode(mode); - if (mtime) { - this.mtime = parseMtime(mtime); - if (this.mtime && !this.mtime.nsecs) { - this.mtime.nsecs = 0; - } - } - } - set mode(mode) { - this._mode = this.isDirectory() ? DEFAULT_DIRECTORY_MODE : DEFAULT_FILE_MODE; - const parsedMode = parseMode(mode); - if (parsedMode !== undefined) { - this._mode = parsedMode; - } - } - get mode() { - return this._mode; - } - isDirectory() { - return Boolean(this.type && dirTypes.includes(this.type)); - } - addBlockSize(size) { - this.blockSizes.push(size); - } - removeBlockSize(index) { - this.blockSizes.splice(index, 1); - } - fileSize() { - if (this.isDirectory()) { - return 0; - } - let sum = 0; - this.blockSizes.forEach(size => { - sum += size; - }); - if (this.data) { - sum += this.data.length; - } - return sum; - } - marshal() { - let type; - switch (this.type) { - case 'raw': - type = PBData.DataType.Raw; - break; - case 'directory': - type = PBData.DataType.Directory; - break; - case 'file': - type = PBData.DataType.File; - break; - case 'metadata': - type = PBData.DataType.Metadata; - break; - case 'symlink': - type = PBData.DataType.Symlink; - break; - case 'hamt-sharded-directory': - type = PBData.DataType.HAMTShard; - break; - default: - throw errcode__default['default'](new Error('Type: ' + type + ' is not valid'), 'ERR_INVALID_TYPE'); - } - let data = this.data; - if (!this.data || !this.data.length) { - data = undefined; - } - let mode; - if (this.mode != null) { - mode = this._originalMode & 4294963200 | (parseMode(this.mode) || 0); - if (mode === DEFAULT_FILE_MODE && !this.isDirectory()) { - mode = undefined; - } - if (mode === DEFAULT_DIRECTORY_MODE && this.isDirectory()) { - mode = undefined; - } - } - let mtime; - if (this.mtime != null) { - const parsed = parseMtime(this.mtime); - if (parsed) { - mtime = { - Seconds: parsed.secs, - FractionalNanoseconds: parsed.nsecs - }; - if (mtime.FractionalNanoseconds === 0) { - delete mtime.FractionalNanoseconds; +exports.isServerError = exports.isTransientError = exports.isThrottlingError = exports.isClockSkewError = exports.isRetryableByTrait = void 0; +const constants_1 = __nccwpck_require__(88474); +const isRetryableByTrait = (error) => error.$retryable !== undefined; +exports.isRetryableByTrait = isRetryableByTrait; +const isClockSkewError = (error) => constants_1.CLOCK_SKEW_ERROR_CODES.includes(error.name); +exports.isClockSkewError = isClockSkewError; +const isThrottlingError = (error) => { + var _a, _b; + return ((_a = error.$metadata) === null || _a === void 0 ? void 0 : _a.httpStatusCode) === 429 || + constants_1.THROTTLING_ERROR_CODES.includes(error.name) || + ((_b = error.$retryable) === null || _b === void 0 ? void 0 : _b.throttling) == true; +}; +exports.isThrottlingError = isThrottlingError; +const isTransientError = (error) => { + var _a; + return constants_1.TRANSIENT_ERROR_CODES.includes(error.name) || + constants_1.NODEJS_TIMEOUT_ERROR_CODES.includes((error === null || error === void 0 ? void 0 : error.code) || "") || + constants_1.TRANSIENT_ERROR_STATUS_CODES.includes(((_a = error.$metadata) === null || _a === void 0 ? void 0 : _a.httpStatusCode) || 0); +}; +exports.isTransientError = isTransientError; +const isServerError = (error) => { + var _a; + if (((_a = error.$metadata) === null || _a === void 0 ? void 0 : _a.httpStatusCode) !== undefined) { + const statusCode = error.$metadata.httpStatusCode; + if (500 <= statusCode && statusCode <= 599 && !(0, exports.isTransientError)(error)) { + return true; } - } + return false; } - const pbData = { - Type: type, - Data: data, - filesize: this.isDirectory() ? undefined : this.fileSize(), - blocksizes: this.blockSizes, - hashType: this.hashType, - fanout: this.fanout, - mode, - mtime - }; - return PBData.encode(pbData).finish(); - } -} - -exports.UnixFS = UnixFS; -exports.parseMode = parseMode; -exports.parseMtime = parseMtime; + return false; +}; +exports.isServerError = isServerError; /***/ }), -/***/ 81422: +/***/ 93973: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -var $protobuf = __nccwpck_require__(63616); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var $protobuf__default = /*#__PURE__*/_interopDefaultLegacy($protobuf); - -const $Reader = $protobuf__default['default'].Reader, $Writer = $protobuf__default['default'].Writer, $util = $protobuf__default['default'].util; -const $root = $protobuf__default['default'].roots['ipfs-unixfs'] || ($protobuf__default['default'].roots['ipfs-unixfs'] = {}); -const Data = $root.Data = (() => { - function Data(p) { - this.blocksizes = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) - this[ks[i]] = p[ks[i]]; - } - Data.prototype.Type = 0; - Data.prototype.Data = $util.newBuffer([]); - Data.prototype.filesize = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - Data.prototype.blocksizes = $util.emptyArray; - Data.prototype.hashType = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - Data.prototype.fanout = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - Data.prototype.mode = 0; - Data.prototype.mtime = null; - Data.encode = function encode(m, w) { - if (!w) - w = $Writer.create(); - w.uint32(8).int32(m.Type); - if (m.Data != null && Object.hasOwnProperty.call(m, 'Data')) - w.uint32(18).bytes(m.Data); - if (m.filesize != null && Object.hasOwnProperty.call(m, 'filesize')) - w.uint32(24).uint64(m.filesize); - if (m.blocksizes != null && m.blocksizes.length) { - for (var i = 0; i < m.blocksizes.length; ++i) - w.uint32(32).uint64(m.blocksizes[i]); - } - if (m.hashType != null && Object.hasOwnProperty.call(m, 'hashType')) - w.uint32(40).uint64(m.hashType); - if (m.fanout != null && Object.hasOwnProperty.call(m, 'fanout')) - w.uint32(48).uint64(m.fanout); - if (m.mode != null && Object.hasOwnProperty.call(m, 'mode')) - w.uint32(56).uint32(m.mode); - if (m.mtime != null && Object.hasOwnProperty.call(m, 'mtime')) - $root.UnixTime.encode(m.mtime, w.uint32(66).fork()).ldelim(); - return w; - }; - Data.decode = function decode(r, l) { - if (!(r instanceof $Reader)) - r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, m = new $root.Data(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.Type = r.int32(); - break; - case 2: - m.Data = r.bytes(); - break; - case 3: - m.filesize = r.uint64(); - break; - case 4: - if (!(m.blocksizes && m.blocksizes.length)) - m.blocksizes = []; - if ((t & 7) === 2) { - var c2 = r.uint32() + r.pos; - while (r.pos < c2) - m.blocksizes.push(r.uint64()); - } else - m.blocksizes.push(r.uint64()); - break; - case 5: - m.hashType = r.uint64(); - break; - case 6: - m.fanout = r.uint64(); - break; - case 7: - m.mode = r.uint32(); - break; - case 8: - m.mtime = $root.UnixTime.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - if (!m.hasOwnProperty('Type')) - throw $util.ProtocolError('missing required \'Type\'', { instance: m }); - return m; - }; - Data.fromObject = function fromObject(d) { - if (d instanceof $root.Data) - return d; - var m = new $root.Data(); - switch (d.Type) { - case 'Raw': - case 0: - m.Type = 0; - break; - case 'Directory': - case 1: - m.Type = 1; - break; - case 'File': - case 2: - m.Type = 2; - break; - case 'Metadata': - case 3: - m.Type = 3; - break; - case 'Symlink': - case 4: - m.Type = 4; - break; - case 'HAMTShard': - case 5: - m.Type = 5; - break; - } - if (d.Data != null) { - if (typeof d.Data === 'string') - $util.base64.decode(d.Data, m.Data = $util.newBuffer($util.base64.length(d.Data)), 0); - else if (d.Data.length) - m.Data = d.Data; - } - if (d.filesize != null) { - if ($util.Long) - (m.filesize = $util.Long.fromValue(d.filesize)).unsigned = true; - else if (typeof d.filesize === 'string') - m.filesize = parseInt(d.filesize, 10); - else if (typeof d.filesize === 'number') - m.filesize = d.filesize; - else if (typeof d.filesize === 'object') - m.filesize = new $util.LongBits(d.filesize.low >>> 0, d.filesize.high >>> 0).toNumber(true); - } - if (d.blocksizes) { - if (!Array.isArray(d.blocksizes)) - throw TypeError('.Data.blocksizes: array expected'); - m.blocksizes = []; - for (var i = 0; i < d.blocksizes.length; ++i) { - if ($util.Long) - (m.blocksizes[i] = $util.Long.fromValue(d.blocksizes[i])).unsigned = true; - else if (typeof d.blocksizes[i] === 'string') - m.blocksizes[i] = parseInt(d.blocksizes[i], 10); - else if (typeof d.blocksizes[i] === 'number') - m.blocksizes[i] = d.blocksizes[i]; - else if (typeof d.blocksizes[i] === 'object') - m.blocksizes[i] = new $util.LongBits(d.blocksizes[i].low >>> 0, d.blocksizes[i].high >>> 0).toNumber(true); - } - } - if (d.hashType != null) { - if ($util.Long) - (m.hashType = $util.Long.fromValue(d.hashType)).unsigned = true; - else if (typeof d.hashType === 'string') - m.hashType = parseInt(d.hashType, 10); - else if (typeof d.hashType === 'number') - m.hashType = d.hashType; - else if (typeof d.hashType === 'object') - m.hashType = new $util.LongBits(d.hashType.low >>> 0, d.hashType.high >>> 0).toNumber(true); - } - if (d.fanout != null) { - if ($util.Long) - (m.fanout = $util.Long.fromValue(d.fanout)).unsigned = true; - else if (typeof d.fanout === 'string') - m.fanout = parseInt(d.fanout, 10); - else if (typeof d.fanout === 'number') - m.fanout = d.fanout; - else if (typeof d.fanout === 'object') - m.fanout = new $util.LongBits(d.fanout.low >>> 0, d.fanout.high >>> 0).toNumber(true); - } - if (d.mode != null) { - m.mode = d.mode >>> 0; - } - if (d.mtime != null) { - if (typeof d.mtime !== 'object') - throw TypeError('.Data.mtime: object expected'); - m.mtime = $root.UnixTime.fromObject(d.mtime); - } - return m; - }; - Data.toObject = function toObject(m, o) { - if (!o) - o = {}; - var d = {}; - if (o.arrays || o.defaults) { - d.blocksizes = []; - } - if (o.defaults) { - d.Type = o.enums === String ? 'Raw' : 0; - if (o.bytes === String) - d.Data = ''; - else { - d.Data = []; - if (o.bytes !== Array) - d.Data = $util.newBuffer(d.Data); - } - if ($util.Long) { - var n = new $util.Long(0, 0, true); - d.filesize = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n; - } else - d.filesize = o.longs === String ? '0' : 0; - if ($util.Long) { - var n = new $util.Long(0, 0, true); - d.hashType = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n; - } else - d.hashType = o.longs === String ? '0' : 0; - if ($util.Long) { - var n = new $util.Long(0, 0, true); - d.fanout = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n; - } else - d.fanout = o.longs === String ? '0' : 0; - d.mode = 0; - d.mtime = null; - } - if (m.Type != null && m.hasOwnProperty('Type')) { - d.Type = o.enums === String ? $root.Data.DataType[m.Type] : m.Type; - } - if (m.Data != null && m.hasOwnProperty('Data')) { - 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; - } - if (m.filesize != null && m.hasOwnProperty('filesize')) { - if (typeof m.filesize === 'number') - d.filesize = o.longs === String ? String(m.filesize) : m.filesize; - else - 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; - } - if (m.blocksizes && m.blocksizes.length) { - d.blocksizes = []; - for (var j = 0; j < m.blocksizes.length; ++j) { - if (typeof m.blocksizes[j] === 'number') - d.blocksizes[j] = o.longs === String ? String(m.blocksizes[j]) : m.blocksizes[j]; - else - 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]; - } - } - if (m.hashType != null && m.hasOwnProperty('hashType')) { - if (typeof m.hashType === 'number') - d.hashType = o.longs === String ? String(m.hashType) : m.hashType; - else - 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; - } - if (m.fanout != null && m.hasOwnProperty('fanout')) { - if (typeof m.fanout === 'number') - d.fanout = o.longs === String ? String(m.fanout) : m.fanout; - else - 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; - } - if (m.mode != null && m.hasOwnProperty('mode')) { - d.mode = m.mode; - } - if (m.mtime != null && m.hasOwnProperty('mtime')) { - d.mtime = $root.UnixTime.toObject(m.mtime, o); - } - return d; - }; - Data.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf__default['default'].util.toJSONOptions); - }; - Data.DataType = function () { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = 'Raw'] = 0; - values[valuesById[1] = 'Directory'] = 1; - values[valuesById[2] = 'File'] = 2; - values[valuesById[3] = 'Metadata'] = 3; - values[valuesById[4] = 'Symlink'] = 4; - values[valuesById[5] = 'HAMTShard'] = 5; - return values; - }(); - return Data; -})(); -const UnixTime = $root.UnixTime = (() => { - function UnixTime(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) - this[ks[i]] = p[ks[i]]; - } - UnixTime.prototype.Seconds = $util.Long ? $util.Long.fromBits(0, 0, false) : 0; - UnixTime.prototype.FractionalNanoseconds = 0; - UnixTime.encode = function encode(m, w) { - if (!w) - w = $Writer.create(); - w.uint32(8).int64(m.Seconds); - if (m.FractionalNanoseconds != null && Object.hasOwnProperty.call(m, 'FractionalNanoseconds')) - w.uint32(21).fixed32(m.FractionalNanoseconds); - return w; - }; - UnixTime.decode = function decode(r, l) { - if (!(r instanceof $Reader)) - r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, m = new $root.UnixTime(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.Seconds = r.int64(); - break; - case 2: - m.FractionalNanoseconds = r.fixed32(); - break; - default: - r.skipType(t & 7); - break; - } - } - if (!m.hasOwnProperty('Seconds')) - throw $util.ProtocolError('missing required \'Seconds\'', { instance: m }); - return m; - }; - UnixTime.fromObject = function fromObject(d) { - if (d instanceof $root.UnixTime) - return d; - var m = new $root.UnixTime(); - if (d.Seconds != null) { - if ($util.Long) - (m.Seconds = $util.Long.fromValue(d.Seconds)).unsigned = false; - else if (typeof d.Seconds === 'string') - m.Seconds = parseInt(d.Seconds, 10); - else if (typeof d.Seconds === 'number') - m.Seconds = d.Seconds; - else if (typeof d.Seconds === 'object') - m.Seconds = new $util.LongBits(d.Seconds.low >>> 0, d.Seconds.high >>> 0).toNumber(); - } - if (d.FractionalNanoseconds != null) { - m.FractionalNanoseconds = d.FractionalNanoseconds >>> 0; - } - return m; - }; - UnixTime.toObject = function toObject(m, o) { - if (!o) - o = {}; - var d = {}; - if (o.defaults) { - if ($util.Long) { - var n = new $util.Long(0, 0, false); - d.Seconds = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n; - } else - d.Seconds = o.longs === String ? '0' : 0; - d.FractionalNanoseconds = 0; - } - if (m.Seconds != null && m.hasOwnProperty('Seconds')) { - if (typeof m.Seconds === 'number') - d.Seconds = o.longs === String ? String(m.Seconds) : m.Seconds; - else - 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; - } - if (m.FractionalNanoseconds != null && m.hasOwnProperty('FractionalNanoseconds')) { - d.FractionalNanoseconds = m.FractionalNanoseconds; - } - return d; - }; - UnixTime.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf__default['default'].util.toJSONOptions); - }; - return UnixTime; -})(); -const Metadata = $root.Metadata = (() => { - function Metadata(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) - this[ks[i]] = p[ks[i]]; - } - Metadata.prototype.MimeType = ''; - Metadata.encode = function encode(m, w) { - if (!w) - w = $Writer.create(); - if (m.MimeType != null && Object.hasOwnProperty.call(m, 'MimeType')) - w.uint32(10).string(m.MimeType); - return w; - }; - Metadata.decode = function decode(r, l) { - if (!(r instanceof $Reader)) - r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, m = new $root.Metadata(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.MimeType = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; - Metadata.fromObject = function fromObject(d) { - if (d instanceof $root.Metadata) - return d; - var m = new $root.Metadata(); - if (d.MimeType != null) { - m.MimeType = String(d.MimeType); - } - return m; - }; - Metadata.toObject = function toObject(m, o) { - if (!o) - o = {}; - var d = {}; - if (o.defaults) { - d.MimeType = ''; - } - if (m.MimeType != null && m.hasOwnProperty('MimeType')) { - d.MimeType = m.MimeType; +exports.getConfigData = void 0; +const types_1 = __nccwpck_require__(21438); +const loadSharedConfigFiles_1 = __nccwpck_require__(53404); +const getConfigData = (data) => Object.entries(data) + .filter(([key]) => { + const indexOfSeparator = key.indexOf(loadSharedConfigFiles_1.CONFIG_PREFIX_SEPARATOR); + if (indexOfSeparator === -1) { + return false; } - return d; - }; - Metadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf__default['default'].util.toJSONOptions); - }; - return Metadata; -})(); - -exports.Data = Data; -exports.Metadata = Metadata; -exports.UnixTime = UnixTime; -exports["default"] = $root; + return Object.values(types_1.IniSectionType).includes(key.substring(0, indexOfSeparator)); +}) + .reduce((acc, [key, value]) => { + const indexOfSeparator = key.indexOf(loadSharedConfigFiles_1.CONFIG_PREFIX_SEPARATOR); + const updatedKey = key.substring(0, indexOfSeparator) === types_1.IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key; + acc[updatedKey] = value; + return acc; +}, { + ...(data.default && { default: data.default }), +}); +exports.getConfigData = getConfigData; /***/ }), -/***/ 58529: -/***/ ((module) => { - -const { AbortController } = globalThis ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 54500: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * @typedef {string} Glob - * @typedef {object} OptionsExt - * @property {string} [cwd=process.cwd()] - * @property {boolean} [absolute=false] - If true produces absolute paths - * @property {boolean} [nodir] - If true yields file paths and skip directories - * - * @typedef {OptionsExt & minimatch.IOptions} Options - */ -/** - * Async iterable filename pattern matcher - * - * @param {string} dir - * @param {string} pattern - * @param {Options} [options] - * @returns {AsyncIterable} - */ -async function * glob (dir, pattern, options = {}) { - const absoluteDir = path.resolve(dir) - const relativeDir = path.relative(options.cwd || process.cwd(), dir) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getConfigFilepath = exports.ENV_CONFIG_PATH = void 0; +const path_1 = __nccwpck_require__(71017); +const getHomeDir_1 = __nccwpck_require__(6271); +exports.ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; +const getConfigFilepath = () => process.env[exports.ENV_CONFIG_PATH] || (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "config"); +exports.getConfigFilepath = getConfigFilepath; - const stats = await fs.stat(absoluteDir) - if (stats.isDirectory()) { - for await (const entry of _glob(absoluteDir, '', pattern, options)) { - yield entry - } +/***/ }), - return - } +/***/ 42662: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (minimatch(relativeDir, pattern, options)) { - yield options.absolute ? absoluteDir : relativeDir - } -} -/** - * @param {string} base - * @param {string} dir - * @param {Glob} pattern - * @param {Options} options - * @returns {AsyncIterable} - */ -async function * _glob (base, dir, pattern, options) { - for await (const entry of await fs.opendir(path.join(base, dir))) { - const relativeEntryPath = path.join(dir, entry.name) - const absoluteEntryPath = path.join(base, dir, entry.name) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getCredentialsFilepath = exports.ENV_CREDENTIALS_PATH = void 0; +const path_1 = __nccwpck_require__(71017); +const getHomeDir_1 = __nccwpck_require__(6271); +exports.ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; +const getCredentialsFilepath = () => process.env[exports.ENV_CREDENTIALS_PATH] || (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "credentials"); +exports.getCredentialsFilepath = getCredentialsFilepath; - let match = minimatch(relativeEntryPath, pattern, options) - const isDirectory = entry.isDirectory() +/***/ }), - if (isDirectory && options.nodir) { - match = false - } +/***/ 6271: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (match) { - yield options.absolute ? absoluteEntryPath : relativeEntryPath - } - if (isDirectory) { - yield * _glob(base, relativeEntryPath, pattern, options) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getHomeDir = void 0; +const os_1 = __nccwpck_require__(22037); +const path_1 = __nccwpck_require__(71017); +const homeDirCache = {}; +const getHomeDirCacheKey = () => { + if (process && process.geteuid) { + return `${process.geteuid()}`; } - } -} - -module.exports = glob + return "DEFAULT"; +}; +const getHomeDir = () => { + const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${path_1.sep}` } = process.env; + if (HOME) + return HOME; + if (USERPROFILE) + return USERPROFILE; + if (HOMEPATH) + return `${HOMEDRIVE}${HOMEPATH}`; + const homeDirCacheKey = getHomeDirCacheKey(); + if (!homeDirCache[homeDirCacheKey]) + homeDirCache[homeDirCacheKey] = (0, os_1.homedir)(); + return homeDirCache[homeDirCacheKey]; +}; +exports.getHomeDir = getHomeDir; /***/ }), -<<<<<<< HEAD -/***/ 75062: -======= -/***/ 48488: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - -<<<<<<< HEAD -const isElectron = __nccwpck_require__(53957) -======= -const isElectron = __nccwpck_require__(78002) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 39816: +/***/ ((__unused_webpack_module, exports) => { -const IS_ENV_WITH_DOM = typeof window === 'object' && typeof document === 'object' && document.nodeType === 9 -// @ts-ignore -const IS_ELECTRON = isElectron() -const IS_BROWSER = IS_ENV_WITH_DOM && !IS_ELECTRON -const IS_ELECTRON_MAIN = IS_ELECTRON && !IS_ENV_WITH_DOM -const IS_ELECTRON_RENDERER = IS_ELECTRON && IS_ENV_WITH_DOM -const IS_NODE = true && typeof process !== 'undefined' && typeof process.release !== 'undefined' && process.release.name === 'node' && !IS_ELECTRON -// @ts-ignore - we either ignore worker scope or dom scope -const IS_WEBWORKER = typeof importScripts === 'function' && typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope -const IS_TEST = typeof process !== 'undefined' && typeof process.env !== 'undefined' && process.env.NODE_ENV === 'test' -const IS_REACT_NATIVE = typeof navigator !== 'undefined' && navigator.product === 'ReactNative' -module.exports = { - isTest: IS_TEST, - isElectron: IS_ELECTRON, - isElectronMain: IS_ELECTRON_MAIN, - isElectronRenderer: IS_ELECTRON_RENDERER, - isNode: IS_NODE, - /** - * Detects browser main thread **NOT** web worker or service worker - */ - isBrowser: IS_BROWSER, - isWebWorker: IS_WEBWORKER, - isEnvWithDom: IS_ENV_WITH_DOM, - isReactNative: IS_REACT_NATIVE -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getProfileName = exports.DEFAULT_PROFILE = exports.ENV_PROFILE = void 0; +exports.ENV_PROFILE = "AWS_PROFILE"; +exports.DEFAULT_PROFILE = "default"; +const getProfileName = (init) => init.profile || process.env[exports.ENV_PROFILE] || exports.DEFAULT_PROFILE; +exports.getProfileName = getProfileName; /***/ }), -<<<<<<< HEAD -/***/ 98396: -======= -/***/ 48448: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - - -<<<<<<< HEAD -/** - * @typedef {globalThis.Headers} Headers - * @typedef {globalThis.Request} Request - * @typedef {globalThis.Response} Response - */ - -const { isElectronMain } = __nccwpck_require__(75062) - -// use window.fetch if it is available, fall back to node-fetch if not -let impl = 'native-fetch' - -if (isElectronMain) { - impl = 'electron-fetch' -======= -const { isElectronMain } = __nccwpck_require__(48488) +/***/ 27476: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -if (isElectronMain) { - module.exports = __nccwpck_require__(8281) -} else { -// use window.fetch if it is available, fall back to node-fetch if not - module.exports = __nccwpck_require__(96357) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -} -module.exports = __nccwpck_require__(37647) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getSSOTokenFilepath = void 0; +const crypto_1 = __nccwpck_require__(6113); +const path_1 = __nccwpck_require__(71017); +const getHomeDir_1 = __nccwpck_require__(6271); +const getSSOTokenFilepath = (id) => { + const hasher = (0, crypto_1.createHash)("sha1"); + const cacheName = hasher.update(id).digest("hex"); + return (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "sso", "cache", `${cacheName}.json`); +}; +exports.getSSOTokenFilepath = getSSOTokenFilepath; /***/ }), -<<<<<<< HEAD -/***/ 83447: -======= -/***/ 23905: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - - -const fsp = (__nccwpck_require__(57147).promises) -const fs = __nccwpck_require__(57147) -<<<<<<< HEAD -const glob = __nccwpck_require__(95462) -const Path = __nccwpck_require__(71017) -const errCode = __nccwpck_require__(22077) -======= -const glob = __nccwpck_require__(3332) -const Path = __nccwpck_require__(71017) -const errCode = __nccwpck_require__(5822) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -/** - * Create an async iterator that yields paths that match requested glob pattern - * - * @param {string} cwd - The directory to start matching the pattern in - * @param {string} pattern - Glob pattern to match - * @param {import('../types').GlobSourceOptions} [options] - Optional options - * @returns {AsyncGenerator} File objects that match glob - */ -module.exports = async function * globSource (cwd, pattern, options) { - options = options || {} - - if (typeof pattern !== 'string') { - throw errCode( - new Error('Pattern must be a string'), - 'ERR_INVALID_PATH', - { pattern } - ) - } - - if (!Path.isAbsolute(cwd)) { - cwd = Path.resolve(process.cwd(), cwd) - } - - const globOptions = Object.assign({}, { - nodir: false, - realpath: false, - absolute: true, - dot: Boolean(options.hidden), - follow: options.followSymlinks != null ? options.followSymlinks : true - }) +/***/ 13567: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - for await (const p of glob(cwd, pattern, globOptions)) { - const stat = await fsp.stat(p) - let mode = options.mode +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getSSOTokenFromFile = void 0; +const fs_1 = __nccwpck_require__(57147); +const getSSOTokenFilepath_1 = __nccwpck_require__(27476); +const { readFile } = fs_1.promises; +const getSSOTokenFromFile = async (id) => { + const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id); + const ssoTokenText = await readFile(ssoTokenFilepath, "utf8"); + return JSON.parse(ssoTokenText); +}; +exports.getSSOTokenFromFile = getSSOTokenFromFile; - if (options.preserveMode) { - mode = stat.mode - } - let mtime = options.mtime +/***/ }), - if (options.preserveMtime) { - mtime = stat.mtime - } +/***/ 46496: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - yield { - path: toPosix(p.replace(cwd, '')), - content: stat.isFile() ? fs.createReadStream(p) : undefined, - mode, - mtime - } - } -} -/** - * @param {string} path - */ -const toPosix = path => path.replace(/\\/g, '/') +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getSsoSessionData = void 0; +const types_1 = __nccwpck_require__(21438); +const loadSharedConfigFiles_1 = __nccwpck_require__(53404); +const getSsoSessionData = (data) => Object.entries(data) + .filter(([key]) => key.startsWith(types_1.IniSectionType.SSO_SESSION + loadSharedConfigFiles_1.CONFIG_PREFIX_SEPARATOR)) + .reduce((acc, [key, value]) => ({ ...acc, [key.split(loadSharedConfigFiles_1.CONFIG_PREFIX_SEPARATOR)[1]]: value }), {}); +exports.getSsoSessionData = getSsoSessionData; /***/ }), -<<<<<<< HEAD -/***/ 6846: -======= -/***/ 74676: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 53013: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(6271), exports); +tslib_1.__exportStar(__nccwpck_require__(39816), exports); +tslib_1.__exportStar(__nccwpck_require__(27476), exports); +tslib_1.__exportStar(__nccwpck_require__(13567), exports); +tslib_1.__exportStar(__nccwpck_require__(53404), exports); +tslib_1.__exportStar(__nccwpck_require__(3875), exports); +tslib_1.__exportStar(__nccwpck_require__(18921), exports); +tslib_1.__exportStar(__nccwpck_require__(96047), exports); -<<<<<<< HEAD -const HTTP = __nccwpck_require__(8530) -======= -const HTTP = __nccwpck_require__(24335) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/** - * - * @param {string} url - * @param {import("../types").HTTPOptions} [options] - * @returns {{ path: string; content?: AsyncIterable }} - */ -const urlSource = (url, options) => { - return { - path: decodeURIComponent(new URL(url).pathname.split('/').pop() || ''), - content: readURLContent(url, options) - } -} +/***/ }), -/** - * - * @param {string} url - * @param {import("../types").HTTPOptions} [options] - * @returns {AsyncIterable} - */ -async function * readURLContent (url, options) { - const http = new HTTP() - const response = await http.get(url, options) +/***/ 53404: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - yield * response.iterator() -} -module.exports = urlSource +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.loadSharedConfigFiles = exports.CONFIG_PREFIX_SEPARATOR = void 0; +const getConfigData_1 = __nccwpck_require__(93973); +const getConfigFilepath_1 = __nccwpck_require__(54500); +const getCredentialsFilepath_1 = __nccwpck_require__(42662); +const parseIni_1 = __nccwpck_require__(40328); +const slurpFile_1 = __nccwpck_require__(69861); +const swallowError = () => ({}); +exports.CONFIG_PREFIX_SEPARATOR = "."; +const loadSharedConfigFiles = async (init = {}) => { + const { filepath = (0, getCredentialsFilepath_1.getCredentialsFilepath)(), configFilepath = (0, getConfigFilepath_1.getConfigFilepath)() } = init; + const parsedFiles = await Promise.all([ + (0, slurpFile_1.slurpFile)(configFilepath, { + ignoreCache: init.ignoreCache, + }) + .then(parseIni_1.parseIni) + .then(getConfigData_1.getConfigData) + .catch(swallowError), + (0, slurpFile_1.slurpFile)(filepath, { + ignoreCache: init.ignoreCache, + }) + .then(parseIni_1.parseIni) + .catch(swallowError), + ]); + return { + configFile: parsedFiles[0], + credentialsFile: parsedFiles[1], + }; +}; +exports.loadSharedConfigFiles = loadSharedConfigFiles; /***/ }), -<<<<<<< HEAD -/***/ 8530: -======= -/***/ 24335: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -/* eslint-disable no-undef */ - - -<<<<<<< HEAD -const { fetch, Request, Headers } = __nccwpck_require__(3658) -const { TimeoutError, HTTPError } = __nccwpck_require__(65654) -const merge = (__nccwpck_require__(67270).bind)({ ignoreUndefined: true }) -const { URL, URLSearchParams } = __nccwpck_require__(3728) -const anySignal = __nccwpck_require__(28332) -const browserReableStreamToIt = __nccwpck_require__(59759) -const { isBrowser, isWebWorker } = __nccwpck_require__(75062) -const all = __nccwpck_require__(72871) -======= -const { fetch, Request, Headers } = __nccwpck_require__(12302) -const { TimeoutError, HTTPError } = __nccwpck_require__(56330) -const merge = (__nccwpck_require__(79139).bind)({ ignoreUndefined: true }) -const { URL, URLSearchParams } = __nccwpck_require__(2003) -const anySignal = __nccwpck_require__(58529) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -/** - * @typedef {import('stream').Readable} NodeReadableStream - * @typedef {import('./types').HTTPOptions} HTTPOptions - * @typedef {import('./types').ExtendedResponse} ExtendedResponse - */ +/***/ 3875: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * @template TResponse - * @param {Promise} promise - * @param {number | undefined} ms - * @param {AbortController} abortController - * @returns {Promise} - */ -const timeout = (promise, ms, abortController) => { - if (ms === undefined) { - return promise - } - const start = Date.now() +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.loadSsoSessionData = void 0; +const getConfigFilepath_1 = __nccwpck_require__(54500); +const getSsoSessionData_1 = __nccwpck_require__(46496); +const parseIni_1 = __nccwpck_require__(40328); +const slurpFile_1 = __nccwpck_require__(69861); +const swallowError = () => ({}); +const loadSsoSessionData = async (init = {}) => { + var _a; + return (0, slurpFile_1.slurpFile)((_a = init.configFilepath) !== null && _a !== void 0 ? _a : (0, getConfigFilepath_1.getConfigFilepath)()) + .then(parseIni_1.parseIni) + .then(getSsoSessionData_1.getSsoSessionData) + .catch(swallowError); +}; +exports.loadSsoSessionData = loadSsoSessionData; - const timedOut = () => { - const time = Date.now() - start - return time >= ms - } +/***/ }), - return new Promise((resolve, reject) => { - const timeoutID = setTimeout(() => { - if (timedOut()) { - reject(new TimeoutError()) - abortController.abort() - } - }, ms) +/***/ 94557: +/***/ ((__unused_webpack_module, exports) => { - /** - * @param {(value: any) => void } next - */ - const after = (next) => { - /** - * @param {any} res - */ - const fn = (res) => { - clearTimeout(timeoutID) - if (timedOut()) { - reject(new TimeoutError()) - return +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.mergeConfigFiles = void 0; +const mergeConfigFiles = (...files) => { + const merged = {}; + for (const file of files) { + for (const [key, values] of Object.entries(file)) { + if (merged[key] !== undefined) { + Object.assign(merged[key], values); + } + else { + merged[key] = values; + } } - - next(res) - } - return fn } + return merged; +}; +exports.mergeConfigFiles = mergeConfigFiles; - promise - .then(after(resolve), after(reject)) - }) -} -const defaults = { - throwHttpErrors: true, - credentials: 'same-origin' -} +/***/ }), -class HTTP { - /** - * - * @param {HTTPOptions} options - */ - constructor (options = {}) { - /** @type {HTTPOptions} */ - this.opts = merge(defaults, options) - } +/***/ 40328: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Fetch - * - * @param {string | Request} resource - * @param {HTTPOptions} options - * @returns {Promise} - */ - async fetch (resource, options = {}) { - /** @type {HTTPOptions} */ - const opts = merge(this.opts, options) - // @ts-expect-error - const headers = new Headers(opts.headers) - // validate resource type - // @ts-expect-error - if (typeof resource !== 'string' && !(resource instanceof URL || resource instanceof Request)) { - throw new TypeError('`resource` must be a string, URL, or Request') +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseIni = void 0; +const types_1 = __nccwpck_require__(21438); +const loadSharedConfigFiles_1 = __nccwpck_require__(53404); +const prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/; +const profileNameBlockList = ["__proto__", "profile __proto__"]; +const parseIni = (iniData) => { + const map = {}; + let currentSection; + let currentSubSection; + for (const iniLine of iniData.split(/\r?\n/)) { + const trimmedLine = iniLine.split(/(^|\s)[;#]/)[0].trim(); + const isSection = trimmedLine[0] === "[" && trimmedLine[trimmedLine.length - 1] === "]"; + if (isSection) { + currentSection = undefined; + currentSubSection = undefined; + const sectionName = trimmedLine.substring(1, trimmedLine.length - 1); + const matches = prefixKeyRegex.exec(sectionName); + if (matches) { + const [, prefix, , name] = matches; + if (Object.values(types_1.IniSectionType).includes(prefix)) { + currentSection = [prefix, name].join(loadSharedConfigFiles_1.CONFIG_PREFIX_SEPARATOR); + } + } + else { + currentSection = sectionName; + } + if (profileNameBlockList.includes(sectionName)) { + throw new Error(`Found invalid profile name "${sectionName}"`); + } + } + else if (currentSection) { + const indexOfEqualsSign = trimmedLine.indexOf("="); + if (![0, -1].includes(indexOfEqualsSign)) { + const [name, value] = [ + trimmedLine.substring(0, indexOfEqualsSign).trim(), + trimmedLine.substring(indexOfEqualsSign + 1).trim(), + ]; + if (value === "") { + currentSubSection = name; + } + else { + if (currentSubSection && iniLine.trimStart() === iniLine) { + currentSubSection = undefined; + } + map[currentSection] = map[currentSection] || {}; + const key = currentSubSection ? [currentSubSection, name].join(loadSharedConfigFiles_1.CONFIG_PREFIX_SEPARATOR) : name; + map[currentSection][key] = value; + } + } + } } + return map; +}; +exports.parseIni = parseIni; - const url = new URL(resource.toString(), opts.base) - const { - searchParams, - transformSearchParams, - json - } = opts +/***/ }), - if (searchParams) { - if (typeof transformSearchParams === 'function') { - // @ts-ignore - url.search = transformSearchParams(new URLSearchParams(opts.searchParams)) - } else { - // @ts-ignore - url.search = new URLSearchParams(opts.searchParams) - } - } +/***/ 18921: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (json) { - opts.body = JSON.stringify(opts.json) - headers.set('content-type', 'application/json') - } - const abortController = new AbortController() - // @ts-ignore - const signal = anySignal([abortController.signal, opts.signal]) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseKnownFiles = void 0; +const loadSharedConfigFiles_1 = __nccwpck_require__(53404); +const mergeConfigFiles_1 = __nccwpck_require__(94557); +const parseKnownFiles = async (init) => { + const parsedFiles = await (0, loadSharedConfigFiles_1.loadSharedConfigFiles)(init); + return (0, mergeConfigFiles_1.mergeConfigFiles)(parsedFiles.configFile, parsedFiles.credentialsFile); +}; +exports.parseKnownFiles = parseKnownFiles; - if (globalThis.ReadableStream != null && opts.body instanceof globalThis.ReadableStream && (isBrowser || isWebWorker)) { - // https://bugzilla.mozilla.org/show_bug.cgi?id=1387483 - opts.body = new Blob(await all(browserReableStreamToIt(opts.body))) - } - /** @type {ExtendedResponse} */ - // @ts-expect-error additional fields are assigned below - const response = await timeout( - fetch( - url.toString(), - { - ...opts, - signal, - // @ts-expect-error non-browser fetch implementations may take extra options - timeout: undefined, - headers, +/***/ }), - // https://fetch.spec.whatwg.org/#dom-requestinit-duplex - // https://github.com/whatwg/fetch/issues/1254 - duplex: 'half' - } - ), - opts.timeout, - abortController - ) +/***/ 69861: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (!response.ok && opts.throwHttpErrors) { - if (opts.handleError) { - await opts.handleError(response) - } - throw new HTTPError(response) - } - response.iterator = async function * () { - yield * fromStream(response.body) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.slurpFile = void 0; +const fs_1 = __nccwpck_require__(57147); +const { readFile } = fs_1.promises; +const filePromisesHash = {}; +const slurpFile = (path, options) => { + if (!filePromisesHash[path] || (options === null || options === void 0 ? void 0 : options.ignoreCache)) { + filePromisesHash[path] = readFile(path, "utf8"); } + return filePromisesHash[path]; +}; +exports.slurpFile = slurpFile; - response.ndjson = async function * () { - for await (const chunk of ndjson(response.iterator())) { - if (options.transform) { - yield options.transform(chunk) - } else { - yield chunk - } - } - } - return response - } +/***/ }), - /** - * @param {string | Request} resource - * @param {HTTPOptions} options - */ - post (resource, options = {}) { - return this.fetch(resource, { ...options, method: 'POST' }) - } +/***/ 96047: +/***/ ((__unused_webpack_module, exports) => { - /** - * @param {string | Request} resource - * @param {HTTPOptions} options - */ - get (resource, options = {}) { - return this.fetch(resource, { ...options, method: 'GET' }) - } - /** - * @param {string | Request} resource - * @param {HTTPOptions} options - */ - put (resource, options = {}) { - return this.fetch(resource, { ...options, method: 'PUT' }) - } +Object.defineProperty(exports, "__esModule", ({ value: true })); - /** - * @param {string | Request} resource - * @param {HTTPOptions} options - */ - delete (resource, options = {}) { - return this.fetch(resource, { ...options, method: 'DELETE' }) - } - /** - * @param {string | Request} resource - * @param {HTTPOptions} options - */ - options (resource, options = {}) { - return this.fetch(resource, { ...options, method: 'OPTIONS' }) - } -} +/***/ }), -/** - * Parses NDJSON chunks from an iterator - * - * @param {AsyncIterable} source - * @returns {AsyncIterable} - */ -const ndjson = async function * (source) { - const decoder = new TextDecoder() - let buf = '' +/***/ 85576: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - for await (const chunk of source) { - buf += decoder.decode(chunk, { stream: true }) - const lines = buf.split(/\r?\n/) - for (let i = 0; i < lines.length - 1; i++) { - const l = lines[i].trim() - if (l.length > 0) { - yield JSON.parse(l) - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SignatureV4 = void 0; +const eventstream_codec_1 = __nccwpck_require__(98807); +const util_hex_encoding_1 = __nccwpck_require__(59878); +const util_middleware_1 = __nccwpck_require__(3626); +const util_utf8_1 = __nccwpck_require__(97788); +const constants_1 = __nccwpck_require__(74962); +const credentialDerivation_1 = __nccwpck_require__(37890); +const getCanonicalHeaders_1 = __nccwpck_require__(96422); +const getCanonicalQuery_1 = __nccwpck_require__(88720); +const getPayloadHash_1 = __nccwpck_require__(88809); +const headerUtil_1 = __nccwpck_require__(50303); +const moveHeadersToQuery_1 = __nccwpck_require__(12886); +const prepareRequest_1 = __nccwpck_require__(49227); +const utilDate_1 = __nccwpck_require__(69608); +class SignatureV4 { + constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true, }) { + this.headerMarshaller = new eventstream_codec_1.HeaderMarshaller(util_utf8_1.toUtf8, util_utf8_1.fromUtf8); + this.service = service; + this.sha256 = sha256; + this.uriEscapePath = uriEscapePath; + this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true; + this.regionProvider = (0, util_middleware_1.normalizeProvider)(region); + this.credentialProvider = (0, util_middleware_1.normalizeProvider)(credentials); } - buf = lines[lines.length - 1] - } - buf += decoder.decode() - buf = buf.trim() - if (buf.length !== 0) { - yield JSON.parse(buf) - } -} - -/** - * Stream to AsyncIterable - * - * @template TChunk - * @param {ReadableStream | NodeReadableStream | null} source - * @returns {AsyncIterable} - */ -const fromStream = (source) => { - if (isAsyncIterable(source)) { - return source - } + async presign(originalRequest, options = {}) { + const { signingDate = new Date(), expiresIn = 3600, unsignableHeaders, unhoistableHeaders, signableHeaders, signingRegion, signingService, } = options; + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); + const { longDate, shortDate } = formatDate(signingDate); + if (expiresIn > constants_1.MAX_PRESIGNED_TTL) { + return Promise.reject("Signature version 4 presigned URLs" + " must have an expiration date less than one week in" + " the future"); + } + const scope = (0, credentialDerivation_1.createScope)(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service); + const request = (0, moveHeadersToQuery_1.moveHeadersToQuery)((0, prepareRequest_1.prepareRequest)(originalRequest), { unhoistableHeaders }); + if (credentials.sessionToken) { + request.query[constants_1.TOKEN_QUERY_PARAM] = credentials.sessionToken; + } + request.query[constants_1.ALGORITHM_QUERY_PARAM] = constants_1.ALGORITHM_IDENTIFIER; + request.query[constants_1.CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`; + request.query[constants_1.AMZ_DATE_QUERY_PARAM] = longDate; + request.query[constants_1.EXPIRES_QUERY_PARAM] = expiresIn.toString(10); + const canonicalHeaders = (0, getCanonicalHeaders_1.getCanonicalHeaders)(request, unsignableHeaders, signableHeaders); + request.query[constants_1.SIGNED_HEADERS_QUERY_PARAM] = getCanonicalHeaderList(canonicalHeaders); + request.query[constants_1.SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, await (0, getPayloadHash_1.getPayloadHash)(originalRequest, this.sha256))); + return request; + } + async sign(toSign, options) { + if (typeof toSign === "string") { + return this.signString(toSign, options); + } + else if (toSign.headers && toSign.payload) { + return this.signEvent(toSign, options); + } + else if (toSign.message) { + return this.signMessage(toSign, options); + } + else { + return this.signRequest(toSign, options); + } + } + async signEvent({ headers, payload }, { signingDate = new Date(), priorSignature, signingRegion, signingService }) { + const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); + const { shortDate, longDate } = formatDate(signingDate); + const scope = (0, credentialDerivation_1.createScope)(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service); + const hashedPayload = await (0, getPayloadHash_1.getPayloadHash)({ headers: {}, body: payload }, this.sha256); + const hash = new this.sha256(); + hash.update(headers); + const hashedHeaders = (0, util_hex_encoding_1.toHex)(await hash.digest()); + const stringToSign = [ + constants_1.EVENT_ALGORITHM_IDENTIFIER, + longDate, + scope, + priorSignature, + hashedHeaders, + hashedPayload, + ].join("\n"); + return this.signString(stringToSign, { signingDate, signingRegion: region, signingService }); + } + async signMessage(signableMessage, { signingDate = new Date(), signingRegion, signingService }) { + const promise = this.signEvent({ + headers: this.headerMarshaller.format(signableMessage.message.headers), + payload: signableMessage.message.body, + }, { + signingDate, + signingRegion, + signingService, + priorSignature: signableMessage.priorSignature, + }); + return promise.then((signature) => { + return { message: signableMessage.message, signature }; + }); + } + async signString(stringToSign, { signingDate = new Date(), signingRegion, signingService } = {}) { + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); + const { shortDate } = formatDate(signingDate); + const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService)); + hash.update((0, util_utf8_1.toUint8Array)(stringToSign)); + return (0, util_hex_encoding_1.toHex)(await hash.digest()); + } + async signRequest(requestToSign, { signingDate = new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService, } = {}) { + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider()); + const request = (0, prepareRequest_1.prepareRequest)(requestToSign); + const { longDate, shortDate } = formatDate(signingDate); + const scope = (0, credentialDerivation_1.createScope)(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service); + request.headers[constants_1.AMZ_DATE_HEADER] = longDate; + if (credentials.sessionToken) { + request.headers[constants_1.TOKEN_HEADER] = credentials.sessionToken; + } + const payloadHash = await (0, getPayloadHash_1.getPayloadHash)(request, this.sha256); + if (!(0, headerUtil_1.hasHeader)(constants_1.SHA256_HEADER, request.headers) && this.applyChecksum) { + request.headers[constants_1.SHA256_HEADER] = payloadHash; + } + const canonicalHeaders = (0, getCanonicalHeaders_1.getCanonicalHeaders)(request, unsignableHeaders, signableHeaders); + const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, payloadHash)); + request.headers[constants_1.AUTH_HEADER] = + `${constants_1.ALGORITHM_IDENTIFIER} ` + + `Credential=${credentials.accessKeyId}/${scope}, ` + + `SignedHeaders=${getCanonicalHeaderList(canonicalHeaders)}, ` + + `Signature=${signature}`; + return request; + } + createCanonicalRequest(request, canonicalHeaders, payloadHash) { + const sortedHeaders = Object.keys(canonicalHeaders).sort(); + return `${request.method} +${this.getCanonicalPath(request)} +${(0, getCanonicalQuery_1.getCanonicalQuery)(request)} +${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")} - // Workaround for https://github.com/node-fetch/node-fetch/issues/766 - if (isNodeReadableStream(source)) { - const iter = source[Symbol.asyncIterator]() - return { - [Symbol.asyncIterator] () { - return { - next: iter.next.bind(iter), - return (value) { - source.destroy() - if (typeof iter.return === 'function') { - return iter.return() +${sortedHeaders.join(";")} +${payloadHash}`; + } + async createStringToSign(longDate, credentialScope, canonicalRequest) { + const hash = new this.sha256(); + hash.update((0, util_utf8_1.toUint8Array)(canonicalRequest)); + const hashedRequest = await hash.digest(); + return `${constants_1.ALGORITHM_IDENTIFIER} +${longDate} +${credentialScope} +${(0, util_hex_encoding_1.toHex)(hashedRequest)}`; + } + getCanonicalPath({ path }) { + if (this.uriEscapePath) { + const normalizedPathSegments = []; + for (const pathSegment of path.split("/")) { + if ((pathSegment === null || pathSegment === void 0 ? void 0 : pathSegment.length) === 0) + continue; + if (pathSegment === ".") + continue; + if (pathSegment === "..") { + normalizedPathSegments.pop(); + } + else { + normalizedPathSegments.push(pathSegment); + } } - return Promise.resolve({ done: true, value }) - } + const normalizedPath = `${(path === null || path === void 0 ? void 0 : path.startsWith("/")) ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && (path === null || path === void 0 ? void 0 : path.endsWith("/")) ? "/" : ""}`; + const doubleEncoded = encodeURIComponent(normalizedPath); + return doubleEncoded.replace(/%2F/g, "/"); } - } + return path; } - } - - if (isWebReadableStream(source)) { - const reader = source.getReader() - return (async function * () { - try { - while (true) { - // Read from the stream - const { done, value } = await reader.read() - // Exit if we're done - if (done) return - // Else yield the chunk - if (value) { - yield value - } + async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) { + const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest); + const hash = new this.sha256(await keyPromise); + hash.update((0, util_utf8_1.toUint8Array)(stringToSign)); + return (0, util_hex_encoding_1.toHex)(await hash.digest()); + } + getSigningKey(credentials, region, shortDate, service) { + return (0, credentialDerivation_1.getSigningKey)(this.sha256, credentials, shortDate, region, service || this.service); + } + validateResolvedCredentials(credentials) { + if (typeof credentials !== "object" || + typeof credentials.accessKeyId !== "string" || + typeof credentials.secretAccessKey !== "string") { + throw new Error("Resolved credential object is not valid"); } - } finally { - reader.releaseLock() - } - })() - } - - throw new TypeError('Body can\'t be converted to AsyncIterable') + } } +exports.SignatureV4 = SignatureV4; +const formatDate = (now) => { + const longDate = (0, utilDate_1.iso8601)(now).replace(/[\-:]/g, ""); + return { + longDate, + shortDate: longDate.slice(0, 8), + }; +}; +const getCanonicalHeaderList = (headers) => Object.keys(headers).sort().join(";"); -/** - * Check if it's an AsyncIterable - * - * @template {unknown} TChunk - * @template {any} Other - * @param {Other|AsyncIterable} value - * @returns {value is AsyncIterable} - */ -const isAsyncIterable = (value) => { - return typeof value === 'object' && - value !== null && - typeof /** @type {any} */(value)[Symbol.asyncIterator] === 'function' -} -/** - * Check for web readable stream - * - * @template {unknown} TChunk - * @template {any} Other - * @param {Other|ReadableStream} value - * @returns {value is ReadableStream} - */ -const isWebReadableStream = (value) => { - return value && typeof /** @type {any} */(value).getReader === 'function' -} +/***/ }), -/** - * @param {any} value - * @returns {value is NodeReadableStream} - */ -const isNodeReadableStream = (value) => - Object.prototype.hasOwnProperty.call(value, 'readable') && - Object.prototype.hasOwnProperty.call(value, 'writable') +/***/ 63705: +/***/ ((__unused_webpack_module, exports) => { -HTTP.HTTPError = HTTPError -HTTP.TimeoutError = TimeoutError -HTTP.streamToAsyncIterator = fromStream -/** - * @param {string | Request} resource - * @param {HTTPOptions} [options] - */ -HTTP.post = (resource, options) => new HTTP(options).post(resource, options) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.cloneQuery = exports.cloneRequest = void 0; +const cloneRequest = ({ headers, query, ...rest }) => ({ + ...rest, + headers: { ...headers }, + query: query ? (0, exports.cloneQuery)(query) : undefined, +}); +exports.cloneRequest = cloneRequest; +const cloneQuery = (query) => Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param, + }; +}, {}); +exports.cloneQuery = cloneQuery; -/** - * @param {string | Request} resource - * @param {HTTPOptions} [options] - */ -HTTP.get = (resource, options) => new HTTP(options).get(resource, options) -/** - * @param {string | Request} resource - * @param {HTTPOptions} [options] - */ -HTTP.put = (resource, options) => new HTTP(options).put(resource, options) +/***/ }), -/** - * @param {string | Request} resource - * @param {HTTPOptions} [options] - */ -HTTP.delete = (resource, options) => new HTTP(options).delete(resource, options) +/***/ 74962: +/***/ ((__unused_webpack_module, exports) => { -/** - * @param {string | Request} resource - * @param {HTTPOptions} [options] - */ -HTTP.options = (resource, options) => new HTTP(options).options(resource, options) -module.exports = HTTP +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MAX_PRESIGNED_TTL = exports.KEY_TYPE_IDENTIFIER = exports.MAX_CACHE_SIZE = exports.UNSIGNED_PAYLOAD = exports.EVENT_ALGORITHM_IDENTIFIER = exports.ALGORITHM_IDENTIFIER_V4A = exports.ALGORITHM_IDENTIFIER = exports.UNSIGNABLE_PATTERNS = exports.SEC_HEADER_PATTERN = exports.PROXY_HEADER_PATTERN = exports.ALWAYS_UNSIGNABLE_HEADERS = exports.HOST_HEADER = exports.TOKEN_HEADER = exports.SHA256_HEADER = exports.SIGNATURE_HEADER = exports.GENERATED_HEADERS = exports.DATE_HEADER = exports.AMZ_DATE_HEADER = exports.AUTH_HEADER = exports.REGION_SET_PARAM = exports.TOKEN_QUERY_PARAM = exports.SIGNATURE_QUERY_PARAM = exports.EXPIRES_QUERY_PARAM = exports.SIGNED_HEADERS_QUERY_PARAM = exports.AMZ_DATE_QUERY_PARAM = exports.CREDENTIAL_QUERY_PARAM = exports.ALGORITHM_QUERY_PARAM = void 0; +exports.ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; +exports.CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; +exports.AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; +exports.SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; +exports.EXPIRES_QUERY_PARAM = "X-Amz-Expires"; +exports.SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; +exports.TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; +exports.REGION_SET_PARAM = "X-Amz-Region-Set"; +exports.AUTH_HEADER = "authorization"; +exports.AMZ_DATE_HEADER = exports.AMZ_DATE_QUERY_PARAM.toLowerCase(); +exports.DATE_HEADER = "date"; +exports.GENERATED_HEADERS = [exports.AUTH_HEADER, exports.AMZ_DATE_HEADER, exports.DATE_HEADER]; +exports.SIGNATURE_HEADER = exports.SIGNATURE_QUERY_PARAM.toLowerCase(); +exports.SHA256_HEADER = "x-amz-content-sha256"; +exports.TOKEN_HEADER = exports.TOKEN_QUERY_PARAM.toLowerCase(); +exports.HOST_HEADER = "host"; +exports.ALWAYS_UNSIGNABLE_HEADERS = { + authorization: true, + "cache-control": true, + connection: true, + expect: true, + from: true, + "keep-alive": true, + "max-forwards": true, + pragma: true, + referer: true, + te: true, + trailer: true, + "transfer-encoding": true, + upgrade: true, + "user-agent": true, + "x-amzn-trace-id": true, +}; +exports.PROXY_HEADER_PATTERN = /^proxy-/; +exports.SEC_HEADER_PATTERN = /^sec-/; +exports.UNSIGNABLE_PATTERNS = [/^proxy-/i, /^sec-/i]; +exports.ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; +exports.ALGORITHM_IDENTIFIER_V4A = "AWS4-ECDSA-P256-SHA256"; +exports.EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; +exports.UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; +exports.MAX_CACHE_SIZE = 50; +exports.KEY_TYPE_IDENTIFIER = "aws4_request"; +exports.MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7; /***/ }), -<<<<<<< HEAD -/***/ 65654: -======= -/***/ 56330: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { +/***/ 37890: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.clearCredentialCache = exports.getSigningKey = exports.createScope = void 0; +const util_hex_encoding_1 = __nccwpck_require__(59878); +const util_utf8_1 = __nccwpck_require__(97788); +const constants_1 = __nccwpck_require__(74962); +const signingKeyCache = {}; +const cacheQueue = []; +const createScope = (shortDate, region, service) => `${shortDate}/${region}/${service}/${constants_1.KEY_TYPE_IDENTIFIER}`; +exports.createScope = createScope; +const getSigningKey = async (sha256Constructor, credentials, shortDate, region, service) => { + const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId); + const cacheKey = `${shortDate}:${region}:${service}:${(0, util_hex_encoding_1.toHex)(credsHash)}:${credentials.sessionToken}`; + if (cacheKey in signingKeyCache) { + return signingKeyCache[cacheKey]; + } + cacheQueue.push(cacheKey); + while (cacheQueue.length > constants_1.MAX_CACHE_SIZE) { + delete signingKeyCache[cacheQueue.shift()]; + } + let key = `AWS4${credentials.secretAccessKey}`; + for (const signable of [shortDate, region, service, constants_1.KEY_TYPE_IDENTIFIER]) { + key = await hmac(sha256Constructor, key, signable); + } + return (signingKeyCache[cacheKey] = key); +}; +exports.getSigningKey = getSigningKey; +const clearCredentialCache = () => { + cacheQueue.length = 0; + Object.keys(signingKeyCache).forEach((cacheKey) => { + delete signingKeyCache[cacheKey]; + }); +}; +exports.clearCredentialCache = clearCredentialCache; +const hmac = (ctor, secret, data) => { + const hash = new ctor(secret); + hash.update((0, util_utf8_1.toUint8Array)(data)); + return hash.digest(); +}; -class TimeoutError extends Error { - constructor (message = 'Request timed out') { - super(message) - this.name = 'TimeoutError' - } -} -exports.TimeoutError = TimeoutError -class AbortError extends Error { - constructor (message = 'The operation was aborted.') { - super(message) - this.name = 'AbortError' - } -} -exports.AbortError = AbortError +/***/ }), -class HTTPError extends Error { - /** - * @param {Response} response - */ - constructor (response) { - super(response.statusText) - this.name = 'HTTPError' - this.response = response - } -} -exports.HTTPError = HTTPError +/***/ 96422: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/***/ }), +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getCanonicalHeaders = void 0; +const constants_1 = __nccwpck_require__(74962); +const getCanonicalHeaders = ({ headers }, unsignableHeaders, signableHeaders) => { + const canonical = {}; + for (const headerName of Object.keys(headers).sort()) { + if (headers[headerName] == undefined) { + continue; + } + const canonicalHeaderName = headerName.toLowerCase(); + if (canonicalHeaderName in constants_1.ALWAYS_UNSIGNABLE_HEADERS || + (unsignableHeaders === null || unsignableHeaders === void 0 ? void 0 : unsignableHeaders.has(canonicalHeaderName)) || + constants_1.PROXY_HEADER_PATTERN.test(canonicalHeaderName) || + constants_1.SEC_HEADER_PATTERN.test(canonicalHeaderName)) { + if (!signableHeaders || (signableHeaders && !signableHeaders.has(canonicalHeaderName))) { + continue; + } + } + canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " "); + } + return canonical; +}; +exports.getCanonicalHeaders = getCanonicalHeaders; -<<<<<<< HEAD -/***/ 2885: -======= -/***/ 97355: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ }), +/***/ 88720: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -<<<<<<< HEAD -const { TimeoutError, AbortError } = __nccwpck_require__(65654) -// @ts-expect-error -const { Response, Request, Headers, default: fetch } = __nccwpck_require__(98396) -======= -const { TimeoutError, AbortError } = __nccwpck_require__(56330) -const { Response, Request, Headers, default: fetch } = __nccwpck_require__(48448) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/** - * @typedef {import('../types').FetchOptions} FetchOptions - * @typedef {import('../types').ProgressFn} ProgressFn - */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getCanonicalQuery = void 0; +const util_uri_escape_1 = __nccwpck_require__(25293); +const constants_1 = __nccwpck_require__(74962); +const getCanonicalQuery = ({ query = {} }) => { + const keys = []; + const serialized = {}; + for (const key of Object.keys(query).sort()) { + if (key.toLowerCase() === constants_1.SIGNATURE_HEADER) { + continue; + } + keys.push(key); + const value = query[key]; + if (typeof value === "string") { + serialized[key] = `${(0, util_uri_escape_1.escapeUri)(key)}=${(0, util_uri_escape_1.escapeUri)(value)}`; + } + else if (Array.isArray(value)) { + serialized[key] = value + .slice(0) + .reduce((encoded, value) => encoded.concat([`${(0, util_uri_escape_1.escapeUri)(key)}=${(0, util_uri_escape_1.escapeUri)(value)}`]), []) + .sort() + .join("&"); + } + } + return keys + .map((key) => serialized[key]) + .filter((serialized) => serialized) + .join("&"); +}; +exports.getCanonicalQuery = getCanonicalQuery; -/** - * Fetch with progress - * - * @param {string | Request} url - * @param {FetchOptions} [options] - * @returns {Promise} - */ -const fetchWithProgress = (url, options = {}) => { - const request = new XMLHttpRequest() - request.open(options.method || 'GET', url.toString(), true) - const { timeout, headers } = options +/***/ }), - if (timeout && timeout > 0 && timeout < Infinity) { - request.timeout = timeout - } +/***/ 88809: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (options.overrideMimeType != null) { - request.overrideMimeType(options.overrideMimeType) - } - if (headers) { - for (const [name, value] of new Headers(headers)) { - request.setRequestHeader(name, value) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getPayloadHash = void 0; +const is_array_buffer_1 = __nccwpck_require__(52807); +const util_hex_encoding_1 = __nccwpck_require__(59878); +const util_utf8_1 = __nccwpck_require__(97788); +const constants_1 = __nccwpck_require__(74962); +const getPayloadHash = async ({ headers, body }, hashConstructor) => { + for (const headerName of Object.keys(headers)) { + if (headerName.toLowerCase() === constants_1.SHA256_HEADER) { + return headers[headerName]; + } } - } + if (body == undefined) { + return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; + } + else if (typeof body === "string" || ArrayBuffer.isView(body) || (0, is_array_buffer_1.isArrayBuffer)(body)) { + const hashCtor = new hashConstructor(); + hashCtor.update((0, util_utf8_1.toUint8Array)(body)); + return (0, util_hex_encoding_1.toHex)(await hashCtor.digest()); + } + return constants_1.UNSIGNED_PAYLOAD; +}; +exports.getPayloadHash = getPayloadHash; - if (options.signal) { - options.signal.onabort = () => request.abort() - } - if (options.onUploadProgress) { - request.upload.onprogress = options.onUploadProgress - } +/***/ }), - // Note: Need to use `arraybuffer` here instead of `blob` because `Blob` - // instances coming from JSDOM are not compatible with `Response` from - // node-fetch (which is the setup we get when testing with jest because - // it uses JSDOM which does not provide a global fetch - // https://github.com/jsdom/jsdom/issues/1724) - request.responseType = 'arraybuffer' +/***/ 50303: +/***/ ((__unused_webpack_module, exports) => { - return new Promise((resolve, reject) => { - /** - * @param {Event} event - */ - const handleEvent = (event) => { - switch (event.type) { - case 'error': { - resolve(Response.error()) - break - } - case 'load': { - resolve( - new ResponseWithURL(request.responseURL, request.response, { - status: request.status, - statusText: request.statusText, - headers: parseHeaders(request.getAllResponseHeaders()) - }) - ) - break - } - case 'timeout': { - reject(new TimeoutError()) - break + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.deleteHeader = exports.getHeaderValue = exports.hasHeader = void 0; +const hasHeader = (soughtHeader, headers) => { + soughtHeader = soughtHeader.toLowerCase(); + for (const headerName of Object.keys(headers)) { + if (soughtHeader === headerName.toLowerCase()) { + return true; } - case 'abort': { - reject(new AbortError()) - break + } + return false; +}; +exports.hasHeader = hasHeader; +const getHeaderValue = (soughtHeader, headers) => { + soughtHeader = soughtHeader.toLowerCase(); + for (const headerName of Object.keys(headers)) { + if (soughtHeader === headerName.toLowerCase()) { + return headers[headerName]; } - default: { - break + } + return undefined; +}; +exports.getHeaderValue = getHeaderValue; +const deleteHeader = (soughtHeader, headers) => { + soughtHeader = soughtHeader.toLowerCase(); + for (const headerName of Object.keys(headers)) { + if (soughtHeader === headerName.toLowerCase()) { + delete headers[headerName]; } - } } - request.onerror = handleEvent - request.onload = handleEvent - request.ontimeout = handleEvent - request.onabort = handleEvent - - // @ts-expect-error options.body can be a node readable stream, which isn't compatible with XHR, but this - // file is a browser override so you won't get a node readable stream so ignore the error - request.send(options.body) - }) -} - -const fetchWithStreaming = fetch +}; +exports.deleteHeader = deleteHeader; -/** - * @param {string | Request} url - * @param {FetchOptions} options - */ -const fetchWith = (url, options = {}) => - (options.onUploadProgress != null) - ? fetchWithProgress(url, options) - : fetchWithStreaming(url, options) -/** - * Parse Headers from a XMLHttpRequest - * - * @param {string} input - * @returns {Headers} - */ -const parseHeaders = (input) => { - const headers = new Headers() - for (const line of input.trim().split(/[\r\n]+/)) { - const index = line.indexOf(': ') - if (index > 0) { - headers.set(line.slice(0, index), line.slice(index + 1)) - } - } +/***/ }), - return headers -} +/***/ 32686: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -class ResponseWithURL extends Response { - /** - * @param {string} url - * @param {BodyInit} body - * @param {ResponseInit} options - */ - constructor (url, body, options) { - super(body, options) - Object.defineProperty(this, 'url', { value: url }) - } -} -module.exports = { - fetch: fetchWith, - Request, - Headers -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.prepareRequest = exports.moveHeadersToQuery = exports.getPayloadHash = exports.getCanonicalQuery = exports.getCanonicalHeaders = void 0; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(85576), exports); +var getCanonicalHeaders_1 = __nccwpck_require__(96422); +Object.defineProperty(exports, "getCanonicalHeaders", ({ enumerable: true, get: function () { return getCanonicalHeaders_1.getCanonicalHeaders; } })); +var getCanonicalQuery_1 = __nccwpck_require__(88720); +Object.defineProperty(exports, "getCanonicalQuery", ({ enumerable: true, get: function () { return getCanonicalQuery_1.getCanonicalQuery; } })); +var getPayloadHash_1 = __nccwpck_require__(88809); +Object.defineProperty(exports, "getPayloadHash", ({ enumerable: true, get: function () { return getPayloadHash_1.getPayloadHash; } })); +var moveHeadersToQuery_1 = __nccwpck_require__(12886); +Object.defineProperty(exports, "moveHeadersToQuery", ({ enumerable: true, get: function () { return moveHeadersToQuery_1.moveHeadersToQuery; } })); +var prepareRequest_1 = __nccwpck_require__(49227); +Object.defineProperty(exports, "prepareRequest", ({ enumerable: true, get: function () { return prepareRequest_1.prepareRequest; } })); +tslib_1.__exportStar(__nccwpck_require__(37890), exports); /***/ }), -<<<<<<< HEAD -/***/ 3658: -======= -/***/ 12302: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 12886: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.moveHeadersToQuery = void 0; +const cloneRequest_1 = __nccwpck_require__(63705); +const moveHeadersToQuery = (request, options = {}) => { + var _a; + const { headers, query = {} } = typeof request.clone === "function" ? request.clone() : (0, cloneRequest_1.cloneRequest)(request); + for (const name of Object.keys(headers)) { + const lname = name.toLowerCase(); + if (lname.slice(0, 6) === "x-amz-" && !((_a = options.unhoistableHeaders) === null || _a === void 0 ? void 0 : _a.has(lname))) { + query[name] = headers[name]; + delete headers[name]; + } + } + return { + ...request, + headers, + query, + }; +}; +exports.moveHeadersToQuery = moveHeadersToQuery; -/** - * @typedef {object} fetchImpl - * @property {globalThis.fetch} fetchImpl.fetch - * @property {globalThis.Request} fetchImpl.Request - * @property {globalThis.Response} fetchImpl.Response - * @property {globalThis.Headers} fetchImpl.Headers - */ -let implName = './fetch.node' +/***/ }), -if (typeof XMLHttpRequest === 'function') { - // Electron has `XMLHttpRequest` and should get the browser implementation - // instead of node. -<<<<<<< HEAD - implName = './fetch.browser' -======= - module.exports = __nccwpck_require__(97355) -} else { - module.exports = __nccwpck_require__(38606) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -} +/***/ 49227: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** @type {fetchImpl} */ -const fetch = __nccwpck_require__(2885) -module.exports = fetch +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.prepareRequest = void 0; +const cloneRequest_1 = __nccwpck_require__(63705); +const constants_1 = __nccwpck_require__(74962); +const prepareRequest = (request) => { + request = typeof request.clone === "function" ? request.clone() : (0, cloneRequest_1.cloneRequest)(request); + for (const headerName of Object.keys(request.headers)) { + if (constants_1.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) { + delete request.headers[headerName]; + } + } + return request; +}; +exports.prepareRequest = prepareRequest; /***/ }), -<<<<<<< HEAD -/***/ 53957: -======= -/***/ 38606: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; +/***/ 69608: +/***/ ((__unused_webpack_module, exports) => { -const { Request, Response, Headers, default: nativeFetch } = __nccwpck_require__(48448) -// @ts-ignore -const toStream = __nccwpck_require__(28186) -const { Buffer } = __nccwpck_require__(14300) -/** - * @typedef {import('stream').Readable} NodeReadableStream - * - * @typedef {import('../types').FetchOptions} FetchOptions - * @typedef {import('../types').ProgressFn} ProgressFn - */ -/** - * @param {string|Request} url - * @param {FetchOptions} [options] - * @returns {Promise} - */ -const fetch = (url, options = {}) => - // @ts-ignore - nativeFetch(url, withUploadProgress(options)) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toDate = exports.iso8601 = void 0; +const iso8601 = (time) => (0, exports.toDate)(time) + .toISOString() + .replace(/\.\d{3}Z$/, "Z"); +exports.iso8601 = iso8601; +const toDate = (time) => { + if (typeof time === "number") { + return new Date(time * 1000); + } + if (typeof time === "string") { + if (Number(time)) { + return new Date(Number(time) * 1000); + } + return new Date(time); + } + return time; +}; +exports.toDate = toDate; -/** - * Takes fetch options and wraps request body to track upload progress if - * `onUploadProgress` is supplied. Otherwise returns options as is. - * - * @param {FetchOptions} options - * @returns {FetchOptions} - */ -const withUploadProgress = (options) => { - const { onUploadProgress, body } = options - if (onUploadProgress && body) { - // This works around the fact that electron-fetch serializes `Uint8Array`s - // and `ArrayBuffer`s to strings. - const content = normalizeBody(body) - const rsp = new Response(content) - const source = iterateBodyWithProgress(/** @type {NodeReadableStream} */(rsp.body), onUploadProgress) - return { - ...options, - body: toStream.readable(source) - } - } else { - return options - } -} +/***/ }), -/** - * @param {BodyInit | NodeReadableStream} input - */ -const normalizeBody = (input) => { - if (input instanceof ArrayBuffer) { - return Buffer.from(input) - } else if (ArrayBuffer.isView(input)) { - return Buffer.from(input.buffer, input.byteOffset, input.byteLength) - } else if (typeof input === 'string') { - return Buffer.from(input) - } - return input -} +/***/ 8823: +/***/ ((__unused_webpack_module, exports) => { -/** - * Takes body from native-fetch response as body and `onUploadProgress` handler - * and returns async iterable that emits body chunks and emits - * `onUploadProgress`. - * - * @param {NodeReadableStream | null} body - * @param {ProgressFn} onUploadProgress - * @returns {AsyncIterable} - */ -const iterateBodyWithProgress = async function * (body, onUploadProgress) { - if (body == null) { - onUploadProgress({ total: 0, loaded: 0, lengthComputable: true }) - } else if (Buffer.isBuffer(body)) { - const total = body.byteLength - const lengthComputable = true - yield body - onUploadProgress({ total, loaded: total, lengthComputable }) - } else { - const total = 0 - const lengthComputable = false - let loaded = 0 - for await (const chunk of body) { - loaded += chunk.byteLength - yield chunk - onUploadProgress({ total, loaded, lengthComputable }) - } - } -} -module.exports = { - fetch, - Request, - Headers +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NoOpLogger = void 0; +class NoOpLogger { + trace() { } + debug() { } + info() { } + warn() { } + error() { } } +exports.NoOpLogger = NoOpLogger; /***/ }), -/***/ 78002: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { +/***/ 21629: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -// https://github.com/electron/electron/issues/2288 -function isElectron() { - // Renderer process - if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') { - return true; - } - // Main process - if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electron) { - return true; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Client = void 0; +const middleware_stack_1 = __nccwpck_require__(95665); +class Client { + constructor(config) { + this.middlewareStack = (0, middleware_stack_1.constructStack)(); + this.config = config; } - - // Detect the user agent when the `nodeIntegration` option is set to false - if (typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Electron') >= 0) { - return true; + send(command, optionsOrCb, cb) { + const options = typeof optionsOrCb !== "function" ? optionsOrCb : undefined; + const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb; + const handler = command.resolveMiddleware(this.middlewareStack, this.config, options); + if (callback) { + handler(command) + .then((result) => callback(null, result.output), (err) => callback(err)) + .catch(() => { }); + } + else { + return handler(command).then((result) => result.output); + } + } + destroy() { + if (this.config.requestHandler.destroy) + this.config.requestHandler.destroy(); } - - return false; } - -module.exports = isElectron; +exports.Client = Client; /***/ }), -<<<<<<< HEAD -/***/ 94978: -======= -/***/ 89837: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -const ipRegex = __nccwpck_require__(94807); +/***/ 7626: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const isIp = string => ipRegex({exact: true}).test(string); -isIp.v4 = string => ipRegex.v4({exact: true}).test(string); -isIp.v6 = string => ipRegex.v6({exact: true}).test(string); -isIp.version = string => isIp(string) ? (isIp.v4(string) ? 4 : 6) : undefined; -module.exports = isIp; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.collectBody = void 0; +const util_stream_1 = __nccwpck_require__(6981); +const collectBody = async (streamBody = new Uint8Array(), context) => { + if (streamBody instanceof Uint8Array) { + return util_stream_1.Uint8ArrayBlobAdapter.mutate(streamBody); + } + if (!streamBody) { + return util_stream_1.Uint8ArrayBlobAdapter.mutate(new Uint8Array()); + } + const fromContext = context.streamCollector(streamBody); + return util_stream_1.Uint8ArrayBlobAdapter.mutate(await fromContext); +}; +exports.collectBody = collectBody; /***/ }), -/***/ 87873: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - - +/***/ 38827: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -module.exports = value => { - if (Object.prototype.toString.call(value) !== '[object Object]') { - return false; - } - const prototype = Object.getPrototypeOf(value); - return prototype === null || prototype === Object.prototype; -}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Command = void 0; +const middleware_stack_1 = __nccwpck_require__(95665); +const types_1 = __nccwpck_require__(21438); +class Command { + constructor() { + this.middlewareStack = (0, middleware_stack_1.constructStack)(); + } + static classBuilder() { + return new ClassBuilder(); + } + resolveMiddlewareWithContext(clientStack, configuration, options, { middlewareFn, clientName, commandName, inputFilterSensitiveLog, outputFilterSensitiveLog, smithyContext, additionalContext, CommandCtor, }) { + for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options)) { + this.middlewareStack.use(mw); + } + const stack = clientStack.concat(this.middlewareStack); + const { logger } = configuration; + const handlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog, + outputFilterSensitiveLog, + [types_1.SMITHY_CONTEXT_KEY]: { + ...smithyContext, + }, + ...additionalContext, + }; + const { requestHandler } = configuration; + return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } +} +exports.Command = Command; +class ClassBuilder { + constructor() { + this._init = () => { }; + this._ep = {}; + this._middlewareFn = () => []; + this._commandName = ""; + this._clientName = ""; + this._additionalContext = {}; + this._smithyContext = {}; + this._inputFilterSensitiveLog = (_) => _; + this._outputFilterSensitiveLog = (_) => _; + this._serializer = null; + this._deserializer = null; + } + init(cb) { + this._init = cb; + } + ep(endpointParameterInstructions) { + this._ep = endpointParameterInstructions; + return this; + } + m(middlewareSupplier) { + this._middlewareFn = middlewareSupplier; + return this; + } + s(service, operation, smithyContext = {}) { + this._smithyContext = { + service, + operation, + ...smithyContext, + }; + return this; + } + c(additionalContext = {}) { + this._additionalContext = additionalContext; + return this; + } + n(clientName, commandName) { + this._clientName = clientName; + this._commandName = commandName; + return this; + } + f(inputFilter = (_) => _, outputFilter = (_) => _) { + this._inputFilterSensitiveLog = inputFilter; + this._outputFilterSensitiveLog = outputFilter; + return this; + } + ser(serializer) { + this._serializer = serializer; + return this; + } + de(deserializer) { + this._deserializer = deserializer; + return this; + } + build() { + const closure = this; + let CommandRef; + return (CommandRef = class extends Command { + static getEndpointParameterInstructions() { + return closure._ep; + } + constructor(input) { + super(); + this.input = input; + this.serialize = closure._serializer; + this.deserialize = closure._deserializer; + closure._init(this); + } + resolveMiddleware(stack, configuration, options) { + return this.resolveMiddlewareWithContext(stack, configuration, options, { + CommandCtor: CommandRef, + middlewareFn: closure._middlewareFn, + clientName: closure._clientName, + commandName: closure._commandName, + inputFilterSensitiveLog: closure._inputFilterSensitiveLog, + outputFilterSensitiveLog: closure._outputFilterSensitiveLog, + smithyContext: closure._smithyContext, + additionalContext: closure._additionalContext, + }); + } + }); + } +} /***/ }), -<<<<<<< HEAD -/***/ 27419: -======= -/***/ 9551: +/***/ 81303: /***/ ((__unused_webpack_module, exports) => { -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -/*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -function isObject(o) { - return Object.prototype.toString.call(o) === '[object Object]'; -} - -function isPlainObject(o) { - var ctor,prot; - - if (isObject(o) === false) return false; - - // If has modified constructor - ctor = o.constructor; - if (ctor === undefined) return true; - - // If has modified prototype - prot = ctor.prototype; - if (isObject(prot) === false) return false; - - // If constructor does not have an Object-specific method - if (prot.hasOwnProperty('isPrototypeOf') === false) { - return false; - } - - // Most likely a plain Object - return true; -} - -exports.isPlainObject = isPlainObject; +exports.SENSITIVE_STRING = void 0; +exports.SENSITIVE_STRING = "***SensitiveInformation***"; /***/ }), -/***/ 51252: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - +/***/ 38504: +/***/ ((__unused_webpack_module, exports) => { -const { randomBytes } = __nccwpck_require__(6113) -module.exports = randomBytes +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createAggregatedClient = void 0; +const createAggregatedClient = (commands, Client) => { + for (const command of Object.keys(commands)) { + const CommandCtor = commands[command]; + const methodImpl = async function (args, optionsOrCb, cb) { + const command = new CommandCtor(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } + else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expected http options but got ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } + else { + return this.send(command, optionsOrCb); + } + }; + const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, ""); + Client.prototype[methodName] = methodImpl; + } +}; +exports.createAggregatedClient = createAggregatedClient; /***/ }), -<<<<<<< HEAD -/***/ 3728: -======= -/***/ 2003: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - +/***/ 65354: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const { - URLWithLegacySupport, - format, - URLSearchParams, - defaultBase -<<<<<<< HEAD -} = __nccwpck_require__(83799) -const relative = __nccwpck_require__(99047) -======= -} = __nccwpck_require__(3197) -const relative = __nccwpck_require__(37043) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -module.exports = { - URL: URLWithLegacySupport, - URLSearchParams, - format, - relative, - defaultBase +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseEpochTimestamp = exports.parseRfc7231DateTime = exports.parseRfc3339DateTimeWithOffset = exports.parseRfc3339DateTime = exports.dateToUtcString = void 0; +const parse_utils_1 = __nccwpck_require__(49518); +const DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; +const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; +function dateToUtcString(date) { + const year = date.getUTCFullYear(); + const month = date.getUTCMonth(); + const dayOfWeek = date.getUTCDay(); + const dayOfMonthInt = date.getUTCDate(); + const hoursInt = date.getUTCHours(); + const minutesInt = date.getUTCMinutes(); + const secondsInt = date.getUTCSeconds(); + const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`; + const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`; + const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`; + const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`; + return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year} ${hoursString}:${minutesString}:${secondsString} GMT`; } +exports.dateToUtcString = dateToUtcString; +const RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/); +const parseRfc3339DateTime = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value !== "string") { + throw new TypeError("RFC-3339 date-times must be expressed as strings"); + } + const match = RFC3339.exec(value); + if (!match) { + throw new TypeError("Invalid RFC-3339 date-time value"); + } + const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match; + const year = (0, parse_utils_1.strictParseShort)(stripLeadingZeroes(yearStr)); + const month = parseDateValue(monthStr, "month", 1, 12); + const day = parseDateValue(dayStr, "day", 1, 31); + return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds }); +}; +exports.parseRfc3339DateTime = parseRfc3339DateTime; +const RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/); +const parseRfc3339DateTimeWithOffset = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value !== "string") { + throw new TypeError("RFC-3339 date-times must be expressed as strings"); + } + const match = RFC3339_WITH_OFFSET.exec(value); + if (!match) { + throw new TypeError("Invalid RFC-3339 date-time value"); + } + const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match; + const year = (0, parse_utils_1.strictParseShort)(stripLeadingZeroes(yearStr)); + const month = parseDateValue(monthStr, "month", 1, 12); + const day = parseDateValue(dayStr, "day", 1, 31); + const date = buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds }); + if (offsetStr.toUpperCase() != "Z") { + date.setTime(date.getTime() - parseOffsetToMilliseconds(offsetStr)); + } + return date; +}; +exports.parseRfc3339DateTimeWithOffset = parseRfc3339DateTimeWithOffset; +const IMF_FIXDATE = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/); +const RFC_850_DATE = new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/); +const ASC_TIME = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/); +const parseRfc7231DateTime = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value !== "string") { + throw new TypeError("RFC-7231 date-times must be expressed as strings"); + } + let match = IMF_FIXDATE.exec(value); + if (match) { + const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; + return buildDate((0, parse_utils_1.strictParseShort)(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); + } + match = RFC_850_DATE.exec(value); + if (match) { + const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; + return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { + hours, + minutes, + seconds, + fractionalMilliseconds, + })); + } + match = ASC_TIME.exec(value); + if (match) { + const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match; + return buildDate((0, parse_utils_1.strictParseShort)(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr.trimLeft(), "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); + } + throw new TypeError("Invalid RFC-7231 date-time value"); +}; +exports.parseRfc7231DateTime = parseRfc7231DateTime; +const parseEpochTimestamp = (value) => { + if (value === null || value === undefined) { + return undefined; + } + let valueAsDouble; + if (typeof value === "number") { + valueAsDouble = value; + } + else if (typeof value === "string") { + valueAsDouble = (0, parse_utils_1.strictParseDouble)(value); + } + else { + throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation"); + } + if (Number.isNaN(valueAsDouble) || valueAsDouble === Infinity || valueAsDouble === -Infinity) { + throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics"); + } + return new Date(Math.round(valueAsDouble * 1000)); +}; +exports.parseEpochTimestamp = parseEpochTimestamp; +const buildDate = (year, month, day, time) => { + const adjustedMonth = month - 1; + validateDayOfMonth(year, adjustedMonth, day); + return new Date(Date.UTC(year, adjustedMonth, day, parseDateValue(time.hours, "hour", 0, 23), parseDateValue(time.minutes, "minute", 0, 59), parseDateValue(time.seconds, "seconds", 0, 60), parseMilliseconds(time.fractionalMilliseconds))); +}; +const parseTwoDigitYear = (value) => { + const thisYear = new Date().getUTCFullYear(); + const valueInThisCentury = Math.floor(thisYear / 100) * 100 + (0, parse_utils_1.strictParseShort)(stripLeadingZeroes(value)); + if (valueInThisCentury < thisYear) { + return valueInThisCentury + 100; + } + return valueInThisCentury; +}; +const FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1000; +const adjustRfc850Year = (input) => { + if (input.getTime() - new Date().getTime() > FIFTY_YEARS_IN_MILLIS) { + return new Date(Date.UTC(input.getUTCFullYear() - 100, input.getUTCMonth(), input.getUTCDate(), input.getUTCHours(), input.getUTCMinutes(), input.getUTCSeconds(), input.getUTCMilliseconds())); + } + return input; +}; +const parseMonthByShortName = (value) => { + const monthIdx = MONTHS.indexOf(value); + if (monthIdx < 0) { + throw new TypeError(`Invalid month: ${value}`); + } + return monthIdx + 1; +}; +const DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; +const validateDayOfMonth = (year, month, day) => { + let maxDays = DAYS_IN_MONTH[month]; + if (month === 1 && isLeapYear(year)) { + maxDays = 29; + } + if (day > maxDays) { + throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`); + } +}; +const isLeapYear = (year) => { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); +}; +const parseDateValue = (value, type, lower, upper) => { + const dateVal = (0, parse_utils_1.strictParseByte)(stripLeadingZeroes(value)); + if (dateVal < lower || dateVal > upper) { + throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`); + } + return dateVal; +}; +const parseMilliseconds = (value) => { + if (value === null || value === undefined) { + return 0; + } + return (0, parse_utils_1.strictParseFloat32)("0." + value) * 1000; +}; +const parseOffsetToMilliseconds = (value) => { + const directionStr = value[0]; + let direction = 1; + if (directionStr == "+") { + direction = 1; + } + else if (directionStr == "-") { + direction = -1; + } + else { + throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`); + } + const hour = Number(value.substring(1, 3)); + const minute = Number(value.substring(4, 6)); + return direction * (hour * 60 + minute) * 60 * 1000; +}; +const stripLeadingZeroes = (value) => { + let idx = 0; + while (idx < value.length - 1 && value.charAt(idx) === "0") { + idx++; + } + if (idx === 0) { + return value; + } + return value.slice(idx); +}; /***/ }), -<<<<<<< HEAD -/***/ 99047: -======= -/***/ 37043: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - +/***/ 77770: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -<<<<<<< HEAD -const { URLWithLegacySupport, format } = __nccwpck_require__(83799) -======= -const { URLWithLegacySupport, format } = __nccwpck_require__(3197) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.withBaseException = exports.throwDefaultError = void 0; +const exceptions_1 = __nccwpck_require__(61985); +const throwDefaultError = ({ output, parsedBody, exceptionCtor, errorCode }) => { + const $metadata = deserializeMetadata(output); + const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined; + const response = new exceptionCtor({ + name: (parsedBody === null || parsedBody === void 0 ? void 0 : parsedBody.code) || (parsedBody === null || parsedBody === void 0 ? void 0 : parsedBody.Code) || errorCode || statusCode || "UnknownError", + $fault: "client", + $metadata, + }); + throw (0, exceptions_1.decorateServiceException)(response, parsedBody); +}; +exports.throwDefaultError = throwDefaultError; +const withBaseException = (ExceptionCtor) => { + return ({ output, parsedBody, errorCode }) => { + (0, exports.throwDefaultError)({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode }); + }; +}; +exports.withBaseException = withBaseException; +const deserializeMetadata = (output) => { + var _a, _b; + return ({ + httpStatusCode: output.statusCode, + requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], + }); +}; -/** - * @param {string | undefined} url - * @param {any} [location] - * @param {any} [protocolMap] - * @param {any} [defaultProtocol] - */ -module.exports = (url, location = {}, protocolMap = {}, defaultProtocol) => { - let protocol = location.protocol - ? location.protocol.replace(':', '') - : 'http' - // Check protocol map - protocol = (protocolMap[protocol] || defaultProtocol || protocol) + ':' - let urlParsed +/***/ }), - try { - urlParsed = new URLWithLegacySupport(url) - } catch (err) { - urlParsed = {} - } +/***/ 87680: +/***/ ((__unused_webpack_module, exports) => { - const base = Object.assign({}, location, { - protocol: protocol || urlParsed.protocol, - host: location.host || urlParsed.host - }) - return new URLWithLegacySupport(url, format(base)).toString() -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.loadConfigsForDefaultMode = void 0; +const loadConfigsForDefaultMode = (mode) => { + switch (mode) { + case "standard": + return { + retryMode: "standard", + connectionTimeout: 3100, + }; + case "in-region": + return { + retryMode: "standard", + connectionTimeout: 1100, + }; + case "cross-region": + return { + retryMode: "standard", + connectionTimeout: 3100, + }; + case "mobile": + return { + retryMode: "standard", + connectionTimeout: 30000, + }; + default: + return {}; + } +}; +exports.loadConfigsForDefaultMode = loadConfigsForDefaultMode; /***/ }), -<<<<<<< HEAD -/***/ 83799: -======= -/***/ 3197: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 29210: +/***/ ((__unused_webpack_module, exports) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.emitWarningIfUnsupportedVersion = void 0; +let warningEmitted = false; +const emitWarningIfUnsupportedVersion = (version) => { + if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 14) { + warningEmitted = true; + } +}; +exports.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion; -const { URL, URLSearchParams, format } = __nccwpck_require__(57310) -// https://github.com/nodejs/node/issues/12682 -const defaultBase = 'http://localhost' +/***/ }), -class URLWithLegacySupport extends URL { - constructor (url = '', base = defaultBase) { - super(url, base) - this.path = this.pathname + this.search - this.auth = - this.username && this.password - ? this.username + ':' + this.password - : null - this.query = - this.search && this.search.startsWith('?') - ? this.search.slice(1) - : null - } +/***/ 61985: +/***/ ((__unused_webpack_module, exports) => { - format () { - return this.toString() - } -} -module.exports = { - URLWithLegacySupport, - URLSearchParams, - format, - defaultBase +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.decorateServiceException = exports.ServiceException = void 0; +class ServiceException extends Error { + constructor(options) { + super(options.message); + Object.setPrototypeOf(this, ServiceException.prototype); + this.name = options.name; + this.$fault = options.$fault; + this.$metadata = options.$metadata; + } } +exports.ServiceException = ServiceException; +const decorateServiceException = (exception, additions = {}) => { + Object.entries(additions) + .filter(([, v]) => v !== undefined) + .forEach(([k, v]) => { + if (exception[k] == undefined || exception[k] === "") { + exception[k] = v; + } + }); + const message = exception.message || exception.Message || "UnknownError"; + exception.message = message; + delete exception.Message; + return exception; +}; +exports.decorateServiceException = decorateServiceException; /***/ }), -<<<<<<< HEAD -/***/ 45048: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 27873: +/***/ ((__unused_webpack_module, exports) => { -const { Readable, Writable, Duplex } = __nccwpck_require__(12781) -const getIterator = __nccwpck_require__(50481) -const Fifo = __nccwpck_require__(57911) -======= -/***/ 81172: -/***/ ((module) => { -"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.extendedEncodeURIComponent = void 0; +function extendedEncodeURIComponent(str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { + return "%" + c.charCodeAt(0).toString(16).toUpperCase(); + }); +} +exports.extendedEncodeURIComponent = extendedEncodeURIComponent; -/** - * Collects all values from an (async) iterable into an array and returns it. - * - * @template T - * @param {AsyncIterable|Iterable} source - */ -const all = async (source) => { - const arr = [] +/***/ }), - for await (const entry of source) { - arr.push(entry) - } +/***/ 83824: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return arr -} -module.exports = all +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; +const types_1 = __nccwpck_require__(21438); +Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return types_1.AlgorithmId; } })); +const getChecksumConfiguration = (runtimeConfig) => { + const checksumAlgorithms = []; + for (const id in types_1.AlgorithmId) { + const algorithmId = types_1.AlgorithmId[id]; + if (runtimeConfig[algorithmId] === undefined) { + continue; + } + checksumAlgorithms.push({ + algorithmId: () => algorithmId, + checksumConstructor: () => runtimeConfig[algorithmId], + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + }, + }; +}; +exports.getChecksumConfiguration = getChecksumConfiguration; +const resolveChecksumRuntimeConfig = (clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}; +exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; /***/ }), -/***/ 58611: -/***/ ((module) => { +/***/ 98252: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = exports.getDefaultExtensionConfiguration = void 0; +const checksum_1 = __nccwpck_require__(83824); +const retry_1 = __nccwpck_require__(24938); +const getDefaultExtensionConfiguration = (runtimeConfig) => { + return { + ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), + ...(0, retry_1.getRetryConfiguration)(runtimeConfig), + }; +}; +exports.getDefaultExtensionConfiguration = getDefaultExtensionConfiguration; +exports.getDefaultClientConfiguration = exports.getDefaultExtensionConfiguration; +const resolveDefaultRuntimeConfig = (config) => { + return { + ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), + ...(0, retry_1.resolveRetryRuntimeConfig)(config), + }; +}; +exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; -/** - * Takes an (async) iterable that emits things and returns an async iterable that - * emits those things in fixed-sized batches. - * - * @template T - * @param {AsyncIterable|Iterable} source - * @param {number} [size=1] - * @returns {AsyncIterable} - */ -async function * batch (source, size = 1) { - /** @type {T[]} */ - let things = [] - if (size < 1) { - size = 1 - } +/***/ }), - for await (const thing of source) { - things.push(thing) +/***/ 39708: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - while (things.length >= size) { - yield things.slice(0, size) - things = things.slice(size) - } - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(98252), exports); - while (things.length) { - yield things.slice(0, size) - things = things.slice(size) - } -} +/***/ }), -module.exports = batch +/***/ 24938: +/***/ ((__unused_webpack_module, exports) => { -/***/ }), +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.resolveRetryRuntimeConfig = exports.getRetryConfiguration = void 0; +const getRetryConfiguration = (runtimeConfig) => { + let _retryStrategy = runtimeConfig.retryStrategy; + return { + setRetryStrategy(retryStrategy) { + _retryStrategy = retryStrategy; + }, + retryStrategy() { + return _retryStrategy; + }, + }; +}; +exports.getRetryConfiguration = getRetryConfiguration; +const resolveRetryRuntimeConfig = (retryStrategyConfiguration) => { + const runtimeConfig = {}; + runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy(); + return runtimeConfig; +}; +exports.resolveRetryRuntimeConfig = resolveRetryRuntimeConfig; -/***/ 85041: -/***/ ((module) => { -"use strict"; +/***/ }), +/***/ 42947: +/***/ ((__unused_webpack_module, exports) => { -/** - * Drains an (async) iterable discarding its' content and does not return - * anything. - * - * @template T - * @param {AsyncIterable|Iterable} source - * @returns {Promise} - */ -const drain = async (source) => { - for await (const _ of source) { } // eslint-disable-line no-unused-vars,no-empty -} -module.exports = drain +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getArrayIfSingleItem = void 0; +const getArrayIfSingleItem = (mayBeArray) => Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray]; +exports.getArrayIfSingleItem = getArrayIfSingleItem; /***/ }), -/***/ 78883: -/***/ ((module) => { - -"use strict"; +/***/ 38128: +/***/ ((__unused_webpack_module, exports) => { -/** - * Filters the passed (async) iterable by using the filter function - * - * @template T - * @param {AsyncIterable|Iterable} source - * @param {function(T):boolean|Promise} fn - */ -const filter = async function * (source, fn) { - for await (const entry of source) { - if (await fn(entry)) { - yield entry +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getValueFromTextNode = void 0; +const getValueFromTextNode = (obj) => { + const textNodeName = "#text"; + for (const key in obj) { + if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== undefined) { + obj[key] = obj[key][textNodeName]; + } + else if (typeof obj[key] === "object" && obj[key] !== null) { + obj[key] = (0, exports.getValueFromTextNode)(obj[key]); + } } - } -} - -module.exports = filter + return obj; +}; +exports.getValueFromTextNode = getValueFromTextNode; /***/ }), -/***/ 84103: -/***/ ((module) => { - -"use strict"; - - -/** - * Returns the first result from an (async) iterable, unless empty, in which - * case returns `undefined`. - * - * @template T - * @param {AsyncIterable|Iterable} source - */ -const first = async (source) => { - for await (const entry of source) { // eslint-disable-line no-unreachable-loop - return entry - } +/***/ 42584: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return undefined -} -module.exports = first +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(8823), exports); +tslib_1.__exportStar(__nccwpck_require__(21629), exports); +tslib_1.__exportStar(__nccwpck_require__(7626), exports); +tslib_1.__exportStar(__nccwpck_require__(38827), exports); +tslib_1.__exportStar(__nccwpck_require__(81303), exports); +tslib_1.__exportStar(__nccwpck_require__(38504), exports); +tslib_1.__exportStar(__nccwpck_require__(65354), exports); +tslib_1.__exportStar(__nccwpck_require__(77770), exports); +tslib_1.__exportStar(__nccwpck_require__(87680), exports); +tslib_1.__exportStar(__nccwpck_require__(29210), exports); +tslib_1.__exportStar(__nccwpck_require__(39708), exports); +tslib_1.__exportStar(__nccwpck_require__(61985), exports); +tslib_1.__exportStar(__nccwpck_require__(27873), exports); +tslib_1.__exportStar(__nccwpck_require__(42947), exports); +tslib_1.__exportStar(__nccwpck_require__(38128), exports); +tslib_1.__exportStar(__nccwpck_require__(82364), exports); +tslib_1.__exportStar(__nccwpck_require__(97028), exports); +tslib_1.__exportStar(__nccwpck_require__(49518), exports); +tslib_1.__exportStar(__nccwpck_require__(83658), exports); +tslib_1.__exportStar(__nccwpck_require__(94332), exports); +tslib_1.__exportStar(__nccwpck_require__(35001), exports); +tslib_1.__exportStar(__nccwpck_require__(40623), exports); /***/ }), -/***/ 3332: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 82364: +/***/ ((__unused_webpack_module, exports) => { -"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.LazyJsonString = exports.StringWrapper = void 0; +const StringWrapper = function () { + const Class = Object.getPrototypeOf(this).constructor; + const Constructor = Function.bind.apply(String, [null, ...arguments]); + const instance = new Constructor(); + Object.setPrototypeOf(instance, Class.prototype); + return instance; +}; +exports.StringWrapper = StringWrapper; +exports.StringWrapper.prototype = Object.create(String.prototype, { + constructor: { + value: exports.StringWrapper, + enumerable: false, + writable: true, + configurable: true, + }, +}); +Object.setPrototypeOf(exports.StringWrapper, String); +class LazyJsonString extends exports.StringWrapper { + deserializeJSON() { + return JSON.parse(super.toString()); + } + toJSON() { + return super.toString(); + } + static fromObject(object) { + if (object instanceof LazyJsonString) { + return object; + } + else if (object instanceof String || typeof object === "string") { + return new LazyJsonString(object); + } + return new LazyJsonString(JSON.stringify(object)); + } +} +exports.LazyJsonString = LazyJsonString; -const fs = (__nccwpck_require__(57147).promises) -const path = __nccwpck_require__(71017) -const minimatch = __nccwpck_require__(71111) -/** - * @typedef {string} Glob - * @typedef {object} OptionsExt - * @property {string} [cwd=process.cwd()] - * @property {boolean} [absolute=false] - If true produces absolute paths - * @property {boolean} [nodir] - If true yields file paths and skip directories - * - * @typedef {OptionsExt & minimatch.IOptions} Options - */ +/***/ }), -/** - * Async iterable filename pattern matcher - * - * @param {string} dir - * @param {string} pattern - * @param {Options} [options] - * @returns {AsyncIterable} - */ -async function * glob (dir, pattern, options = {}) { - const absoluteDir = path.resolve(dir) - const relativeDir = path.relative(options.cwd || process.cwd(), dir) +/***/ 97028: +/***/ ((__unused_webpack_module, exports) => { - const stats = await fs.stat(absoluteDir) - if (stats.isDirectory()) { - for await (const entry of _glob(absoluteDir, '', pattern, options)) { - yield entry +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.take = exports.convertMap = exports.map = void 0; +function map(arg0, arg1, arg2) { + let target; + let filter; + let instructions; + if (typeof arg1 === "undefined" && typeof arg2 === "undefined") { + target = {}; + instructions = arg0; } - - return - } - - if (minimatch(relativeDir, pattern, options)) { - yield options.absolute ? absoluteDir : relativeDir - } + else { + target = arg0; + if (typeof arg1 === "function") { + filter = arg1; + instructions = arg2; + return mapWithFilter(target, filter, instructions); + } + else { + instructions = arg1; + } + } + for (const key of Object.keys(instructions)) { + if (!Array.isArray(instructions[key])) { + target[key] = instructions[key]; + continue; + } + applyInstruction(target, null, instructions, key); + } + return target; } +exports.map = map; +const convertMap = (target) => { + const output = {}; + for (const [k, v] of Object.entries(target || {})) { + output[k] = [, v]; + } + return output; +}; +exports.convertMap = convertMap; +const take = (source, instructions) => { + const out = {}; + for (const key in instructions) { + applyInstruction(out, source, instructions, key); + } + return out; +}; +exports.take = take; +const mapWithFilter = (target, filter, instructions) => { + return map(target, Object.entries(instructions).reduce((_instructions, [key, value]) => { + if (Array.isArray(value)) { + _instructions[key] = value; + } + else { + if (typeof value === "function") { + _instructions[key] = [filter, value()]; + } + else { + _instructions[key] = [filter, value]; + } + } + return _instructions; + }, {})); +}; +const applyInstruction = (target, source, instructions, targetKey) => { + if (source !== null) { + let instruction = instructions[targetKey]; + if (typeof instruction === "function") { + instruction = [, instruction]; + } + const [filter = nonNullish, valueFn = pass, sourceKey = targetKey] = instruction; + if ((typeof filter === "function" && filter(source[sourceKey])) || (typeof filter !== "function" && !!filter)) { + target[targetKey] = valueFn(source[sourceKey]); + } + return; + } + let [filter, value] = instructions[targetKey]; + if (typeof value === "function") { + let _value; + const defaultFilterPassed = filter === undefined && (_value = value()) != null; + const customFilterPassed = (typeof filter === "function" && !!filter(void 0)) || (typeof filter !== "function" && !!filter); + if (defaultFilterPassed) { + target[targetKey] = _value; + } + else if (customFilterPassed) { + target[targetKey] = value(); + } + } + else { + const defaultFilterPassed = filter === undefined && value != null; + const customFilterPassed = (typeof filter === "function" && !!filter(value)) || (typeof filter !== "function" && !!filter); + if (defaultFilterPassed || customFilterPassed) { + target[targetKey] = value; + } + } +}; +const nonNullish = (_) => _ != null; +const pass = (_) => _; -/** - * @param {string} base - * @param {string} dir - * @param {Glob} pattern - * @param {Options} options - * @returns {AsyncIterable} - */ -async function * _glob (base, dir, pattern, options) { - for await (const entry of await fs.opendir(path.join(base, dir))) { - const relativeEntryPath = path.join(dir, entry.name) - const absoluteEntryPath = path.join(base, dir, entry.name) - let match = minimatch(relativeEntryPath, pattern, options) +/***/ }), - const isDirectory = entry.isDirectory() +/***/ 49518: +/***/ ((__unused_webpack_module, exports) => { - if (isDirectory && options.nodir) { - match = false - } - if (match) { - yield options.absolute ? absoluteEntryPath : relativeEntryPath +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.logger = exports.strictParseByte = exports.strictParseShort = exports.strictParseInt32 = exports.strictParseInt = exports.strictParseLong = exports.limitedParseFloat32 = exports.limitedParseFloat = exports.handleFloat = exports.limitedParseDouble = exports.strictParseFloat32 = exports.strictParseFloat = exports.strictParseDouble = exports.expectUnion = exports.expectString = exports.expectObject = exports.expectNonNull = exports.expectByte = exports.expectShort = exports.expectInt32 = exports.expectInt = exports.expectLong = exports.expectFloat32 = exports.expectNumber = exports.expectBoolean = exports.parseBoolean = void 0; +const parseBoolean = (value) => { + switch (value) { + case "true": + return true; + case "false": + return false; + default: + throw new Error(`Unable to parse boolean value "${value}"`); } - - if (isDirectory) { - yield * _glob(base, relativeEntryPath, pattern, options) +}; +exports.parseBoolean = parseBoolean; +const expectBoolean = (value) => { + if (value === null || value === undefined) { + return undefined; } - } -} - -module.exports = glob + if (typeof value === "number") { + if (value === 0 || value === 1) { + exports.logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); + } + if (value === 0) { + return false; + } + if (value === 1) { + return true; + } + } + if (typeof value === "string") { + const lower = value.toLowerCase(); + if (lower === "false" || lower === "true") { + exports.logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); + } + if (lower === "false") { + return false; + } + if (lower === "true") { + return true; + } + } + if (typeof value === "boolean") { + return value; + } + throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`); +}; +exports.expectBoolean = expectBoolean; +const expectNumber = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value === "string") { + const parsed = parseFloat(value); + if (!Number.isNaN(parsed)) { + if (String(parsed) !== String(value)) { + exports.logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`)); + } + return parsed; + } + } + if (typeof value === "number") { + return value; + } + throw new TypeError(`Expected number, got ${typeof value}: ${value}`); +}; +exports.expectNumber = expectNumber; +const MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23)); +const expectFloat32 = (value) => { + const expected = (0, exports.expectNumber)(value); + if (expected !== undefined && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) { + if (Math.abs(expected) > MAX_FLOAT) { + throw new TypeError(`Expected 32-bit float, got ${value}`); + } + } + return expected; +}; +exports.expectFloat32 = expectFloat32; +const expectLong = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (Number.isInteger(value) && !Number.isNaN(value)) { + return value; + } + throw new TypeError(`Expected integer, got ${typeof value}: ${value}`); +}; +exports.expectLong = expectLong; +exports.expectInt = exports.expectLong; +const expectInt32 = (value) => expectSizedInt(value, 32); +exports.expectInt32 = expectInt32; +const expectShort = (value) => expectSizedInt(value, 16); +exports.expectShort = expectShort; +const expectByte = (value) => expectSizedInt(value, 8); +exports.expectByte = expectByte; +const expectSizedInt = (value, size) => { + const expected = (0, exports.expectLong)(value); + if (expected !== undefined && castInt(expected, size) !== expected) { + throw new TypeError(`Expected ${size}-bit integer, got ${value}`); + } + return expected; +}; +const castInt = (value, size) => { + switch (size) { + case 32: + return Int32Array.of(value)[0]; + case 16: + return Int16Array.of(value)[0]; + case 8: + return Int8Array.of(value)[0]; + } +}; +const expectNonNull = (value, location) => { + if (value === null || value === undefined) { + if (location) { + throw new TypeError(`Expected a non-null value for ${location}`); + } + throw new TypeError("Expected a non-null value"); + } + return value; +}; +exports.expectNonNull = expectNonNull; +const expectObject = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value === "object" && !Array.isArray(value)) { + return value; + } + const receivedType = Array.isArray(value) ? "array" : typeof value; + throw new TypeError(`Expected object, got ${receivedType}: ${value}`); +}; +exports.expectObject = expectObject; +const expectString = (value) => { + if (value === null || value === undefined) { + return undefined; + } + if (typeof value === "string") { + return value; + } + if (["boolean", "number", "bigint"].includes(typeof value)) { + exports.logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`)); + return String(value); + } + throw new TypeError(`Expected string, got ${typeof value}: ${value}`); +}; +exports.expectString = expectString; +const expectUnion = (value) => { + if (value === null || value === undefined) { + return undefined; + } + const asObject = (0, exports.expectObject)(value); + const setKeys = Object.entries(asObject) + .filter(([, v]) => v != null) + .map(([k]) => k); + if (setKeys.length === 0) { + throw new TypeError(`Unions must have exactly one non-null member. None were found.`); + } + if (setKeys.length > 1) { + throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`); + } + return asObject; +}; +exports.expectUnion = expectUnion; +const strictParseDouble = (value) => { + if (typeof value == "string") { + return (0, exports.expectNumber)(parseNumber(value)); + } + return (0, exports.expectNumber)(value); +}; +exports.strictParseDouble = strictParseDouble; +exports.strictParseFloat = exports.strictParseDouble; +const strictParseFloat32 = (value) => { + if (typeof value == "string") { + return (0, exports.expectFloat32)(parseNumber(value)); + } + return (0, exports.expectFloat32)(value); +}; +exports.strictParseFloat32 = strictParseFloat32; +const NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g; +const parseNumber = (value) => { + const matches = value.match(NUMBER_REGEX); + if (matches === null || matches[0].length !== value.length) { + throw new TypeError(`Expected real number, got implicit NaN`); + } + return parseFloat(value); +}; +const limitedParseDouble = (value) => { + if (typeof value == "string") { + return parseFloatString(value); + } + return (0, exports.expectNumber)(value); +}; +exports.limitedParseDouble = limitedParseDouble; +exports.handleFloat = exports.limitedParseDouble; +exports.limitedParseFloat = exports.limitedParseDouble; +const limitedParseFloat32 = (value) => { + if (typeof value == "string") { + return parseFloatString(value); + } + return (0, exports.expectFloat32)(value); +}; +exports.limitedParseFloat32 = limitedParseFloat32; +const parseFloatString = (value) => { + switch (value) { + case "NaN": + return NaN; + case "Infinity": + return Infinity; + case "-Infinity": + return -Infinity; + default: + throw new Error(`Unable to parse float value: ${value}`); + } +}; +const strictParseLong = (value) => { + if (typeof value === "string") { + return (0, exports.expectLong)(parseNumber(value)); + } + return (0, exports.expectLong)(value); +}; +exports.strictParseLong = strictParseLong; +exports.strictParseInt = exports.strictParseLong; +const strictParseInt32 = (value) => { + if (typeof value === "string") { + return (0, exports.expectInt32)(parseNumber(value)); + } + return (0, exports.expectInt32)(value); +}; +exports.strictParseInt32 = strictParseInt32; +const strictParseShort = (value) => { + if (typeof value === "string") { + return (0, exports.expectShort)(parseNumber(value)); + } + return (0, exports.expectShort)(value); +}; +exports.strictParseShort = strictParseShort; +const strictParseByte = (value) => { + if (typeof value === "string") { + return (0, exports.expectByte)(parseNumber(value)); + } + return (0, exports.expectByte)(value); +}; +exports.strictParseByte = strictParseByte; +const stackTraceWarning = (message) => { + return String(new TypeError(message).stack || message) + .split("\n") + .slice(0, 5) + .filter((s) => !s.includes("stackTraceWarning")) + .join("\n"); +}; +exports.logger = { + warn: console.warn, +}; /***/ }), -/***/ 28741: -/***/ ((module) => { - -"use strict"; - - -/** - * Returns the last item of an (async) iterable, unless empty, in which case - * return `undefined`. - * - * @template T - * @param {AsyncIterable|Iterable} source - */ -const last = async (source) => { - let res - - for await (const entry of source) { - res = entry - } +/***/ 83658: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return res -} -module.exports = last +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.resolvedPath = void 0; +const extended_encode_uri_component_1 = __nccwpck_require__(27873); +const resolvedPath = (resolvedPath, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => { + if (input != null && input[memberName] !== undefined) { + const labelValue = labelValueProvider(); + if (labelValue.length <= 0) { + throw new Error("Empty value provided for input HTTP label: " + memberName + "."); + } + resolvedPath = resolvedPath.replace(uriLabel, isGreedyLabel + ? labelValue + .split("/") + .map((segment) => (0, extended_encode_uri_component_1.extendedEncodeURIComponent)(segment)) + .join("/") + : (0, extended_encode_uri_component_1.extendedEncodeURIComponent)(labelValue)); + } + else { + throw new Error("No value provided for input HTTP label: " + memberName + "."); + } + return resolvedPath; +}; +exports.resolvedPath = resolvedPath; /***/ }), -/***/ 6305: -/***/ ((module) => { - -"use strict"; - +/***/ 94332: +/***/ ((__unused_webpack_module, exports) => { -/** - * Takes an (async) iterable and returns one with each item mapped by the passed - * function. - * - * @template I,O - * @param {AsyncIterable|Iterable} source - * @param {function(I):O|Promise} func - * @returns {AsyncIterable} - */ -const map = async function * (source, func) { - for await (const val of source) { - yield func(val) - } -} -module.exports = map +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.serializeFloat = void 0; +const serializeFloat = (value) => { + if (value !== value) { + return "NaN"; + } + switch (value) { + case Infinity: + return "Infinity"; + case -Infinity: + return "-Infinity"; + default: + return value; + } +}; +exports.serializeFloat = serializeFloat; /***/ }), -/***/ 62898: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; +/***/ 35001: +/***/ ((__unused_webpack_module, exports) => { -const batch = __nccwpck_require__(58611) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._json = void 0; +const _json = (obj) => { + if (obj == null) { + return {}; + } + if (Array.isArray(obj)) { + return obj.filter((_) => _ != null).map(exports._json); + } + if (typeof obj === "object") { + const target = {}; + for (const key of Object.keys(obj)) { + if (obj[key] == null) { + continue; + } + target[key] = (0, exports._json)(obj[key]); + } + return target; + } + return obj; +}; +exports._json = _json; -/** - * @template T - * @typedef {{ok:true, value:T}} Success - */ -/** - * @typedef {{ok:false, err:Error}} Failure - */ +/***/ }), -/** - * Takes an (async) iterator that emits promise-returning functions, - * invokes them in parallel and emits the results as they become available but - * in the same order as the input - * - * @template T - * @param {AsyncIterable<() => Promise>} source - * @param {number} [size=1] - * @returns {AsyncIterable} - */ -async function * parallelBatch (source, size = 1) { - for await (const tasks of batch(source, size)) { - /** @type {Promise|Failure>[]} */ - const things = tasks.map( - /** - * @param {() => Promise} p - */ - p => { - return p().then(value => ({ ok: true, value }), err => ({ ok: false, err })) - }) +/***/ 40623: +/***/ ((__unused_webpack_module, exports) => { - for (let i = 0; i < things.length; i++) { - const result = await things[i] - if (result.ok) { - yield result.value - } else { - throw result.err - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.splitEvery = void 0; +function splitEvery(value, delimiter, numDelimiters) { + if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) { + throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery."); } - } + const segments = value.split(delimiter); + if (numDelimiters === 1) { + return segments; + } + const compoundSegments = []; + let currentSegment = ""; + for (let i = 0; i < segments.length; i++) { + if (currentSegment === "") { + currentSegment = segments[i]; + } + else { + currentSegment += delimiter + segments[i]; + } + if ((i + 1) % numDelimiters === 0) { + compoundSegments.push(currentSegment); + currentSegment = ""; + } + } + if (currentSegment !== "") { + compoundSegments.push(currentSegment); + } + return compoundSegments; } - -module.exports = parallelBatch +exports.splitEvery = splitEvery; /***/ }), -/***/ 66140: -/***/ ((module) => { +/***/ 23512: +/***/ ((__unused_webpack_module, exports) => { -"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); -/** - * @template T - * @typedef {Object} Peek - * @property {() => IteratorResult} peek - */ -/** - * @template T - * @typedef {Object} AsyncPeek - * @property {() => Promise>} peek - */ +/***/ }), -/** - * @template T - * @typedef {Object} Push - * @property {(value:T) => void} push - */ +/***/ 94142: +/***/ ((__unused_webpack_module, exports) => { -/** - * @template T - * @typedef {Iterable & Peek & Push & Iterator} Peekable - */ -/** - * @template T - * @typedef {AsyncIterable & AsyncPeek & Push & AsyncIterator} AsyncPeekable - */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.HttpApiKeyAuthLocation = void 0; +var HttpApiKeyAuthLocation; +(function (HttpApiKeyAuthLocation) { + HttpApiKeyAuthLocation["HEADER"] = "header"; + HttpApiKeyAuthLocation["QUERY"] = "query"; +})(HttpApiKeyAuthLocation = exports.HttpApiKeyAuthLocation || (exports.HttpApiKeyAuthLocation = {})); -/** - * @template {Iterable | AsyncIterable} I - * @param {I} iterable - * @returns {I extends Iterable - * ? Peekable - * : I extends AsyncIterable - * ? AsyncPeekable - * : never - * } - */ -function peekableIterator (iterable) { - // @ts-ignore - const [iterator, symbol] = iterable[Symbol.asyncIterator] - // @ts-ignore - ? [iterable[Symbol.asyncIterator](), Symbol.asyncIterator] - // @ts-ignore - : [iterable[Symbol.iterator](), Symbol.iterator] - /** @type {any[]} */ - const queue = [] +/***/ }), - // @ts-ignore - return { - peek: () => { - return iterator.next() - }, - push: (value) => { - queue.push(value) - }, - next: () => { - if (queue.length) { - return { - done: false, - value: queue.shift() - } - } +/***/ 85064: +/***/ ((__unused_webpack_module, exports) => { - return iterator.next() - }, - [symbol] () { - return this - } - } -} -module.exports = peekableIterator +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 74824: -/***/ ((module) => { - -const rawPipe = (...fns) => { - let res - while (fns.length) { - res = fns.shift()(res) - } - return res -} - -const isIterable = obj => obj && ( - typeof obj[Symbol.asyncIterator] === 'function' || - typeof obj[Symbol.iterator] === 'function' || - typeof obj.next === 'function' // Probably, right? -) +/***/ 12525: +/***/ ((__unused_webpack_module, exports) => { -const isDuplex = obj => obj && typeof obj.sink === 'function' && isIterable(obj.source) -const duplexPipelineFn = duplex => source => { - duplex.sink(source) // TODO: error on sink side is unhandled rejection - this is the same as pull streams - return duplex.source -} +Object.defineProperty(exports, "__esModule", ({ value: true })); -const pipe = (...fns) => { - // Duplex at start: wrap in function and return duplex source - if (isDuplex(fns[0])) { - const duplex = fns[0] - fns[0] = () => duplex.source - // Iterable at start: wrap in function - } else if (isIterable(fns[0])) { - const source = fns[0] - fns[0] = () => source - } - if (fns.length > 1) { - // Duplex at end: use duplex sink - if (isDuplex(fns[fns.length - 1])) { - fns[fns.length - 1] = fns[fns.length - 1].sink - } - } +/***/ }), - if (fns.length > 2) { - // Duplex in the middle, consume source with duplex sink and return duplex source - for (let i = 1; i < fns.length - 1; i++) { - if (isDuplex(fns[i])) { - fns[i] = duplexPipelineFn(fns[i]) - } - } - } +/***/ 46408: +/***/ ((__unused_webpack_module, exports) => { - return rawPipe(...fns) -} -module.exports = pipe -module.exports.pipe = pipe -module.exports.rawPipe = rawPipe -module.exports.isIterable = isIterable -module.exports.isDuplex = isDuplex +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -/***/ 16346: -/***/ ((module) => { - -"use strict"; +/***/ 91937: +/***/ ((__unused_webpack_module, exports) => { -/** - * Stop iteration after n items have been received. - * - * @template T - * @param {AsyncIterable|Iterable} source - * @param {number} limit - * @returns {AsyncIterable} - */ -const take = async function * (source, limit) { - let items = 0 +Object.defineProperty(exports, "__esModule", ({ value: true })); - if (limit < 1) { - return - } - for await (const entry of source) { - yield entry +/***/ }), - items++ +/***/ 23397: +/***/ ((__unused_webpack_module, exports) => { - if (items === limit) { - return - } - } -} -module.exports = take +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.HttpAuthLocation = void 0; +var HttpAuthLocation; +(function (HttpAuthLocation) { + HttpAuthLocation["HEADER"] = "header"; + HttpAuthLocation["QUERY"] = "query"; +})(HttpAuthLocation = exports.HttpAuthLocation || (exports.HttpAuthLocation = {})); /***/ }), -/***/ 17188: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 75520: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const { Readable, Writable, Duplex } = __nccwpck_require__(12781) -const getIterator = __nccwpck_require__(26805) -const Fifo = __nccwpck_require__(93963) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const { Buffer } = __nccwpck_require__(14300) -const END_CHUNK = Buffer.alloc(0) -module.exports = function toDuplex (duplex, options) { - options = options || {} +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(23397), exports); +tslib_1.__exportStar(__nccwpck_require__(94142), exports); +tslib_1.__exportStar(__nccwpck_require__(85064), exports); +tslib_1.__exportStar(__nccwpck_require__(12525), exports); +tslib_1.__exportStar(__nccwpck_require__(46408), exports); +tslib_1.__exportStar(__nccwpck_require__(91937), exports); - let reading = false - const fifo = new Fifo() - duplex = { - sink: duplex.sink, - source: duplex.source ? getIterator(duplex.source) : null - } +/***/ }), - let Stream = Duplex - if (!duplex.source) { - Stream = Writable - } else if (!duplex.sink) { - Stream = Readable - } +/***/ 64888: +/***/ ((__unused_webpack_module, exports) => { - let readable - if (duplex.source) { - readable = { - async read (size) { - if (reading) return - reading = true - try { - while (true) { - const { value, done } = await duplex.source.next(size) - if (done) return this.push(null) - if (!this.push(value)) break - } - } catch (err) { - this.emit('error', err) - } finally { - reading = false - } - } - } - } +Object.defineProperty(exports, "__esModule", ({ value: true })); - let writable - if (duplex.sink) { - writable = { - write (chunk, enc, cb) { - fifo.push(chunk).then(() => cb(), cb) - }, - final (cb) { - fifo.push(END_CHUNK).then(() => cb(), cb) - } - } - } - Object.assign(options, readable, writable) +/***/ }), - const stream = new Stream(options) +/***/ 85137: +/***/ ((__unused_webpack_module, exports) => { - if (duplex.sink) { - duplex.sink({ - [Symbol.asyncIterator] () { - return this - }, - async next () { - const chunk = await fifo.shift() - return chunk === END_CHUNK ? { done: true } : { value: chunk } - }, - async throw (err) { - stream.destroy(err) - return { done: true } - }, - async return () { - stream.destroy() - return { done: true } - } - }) - } - return stream -} +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -<<<<<<< HEAD -/***/ 79620: -======= -/***/ 28186: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 17658: +/***/ ((__unused_webpack_module, exports) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const toTransform = __nccwpck_require__(99896) -const toDuplex = __nccwpck_require__(45048) -======= -const toTransform = __nccwpck_require__(63688) -const toDuplex = __nccwpck_require__(17188) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -function toReadable (source, options) { - return toDuplex({ source }, options) -} +/***/ }), -function toWritable (sink, options) { - return toDuplex({ sink }, options) -} +/***/ 59940: +/***/ ((__unused_webpack_module, exports) => { -module.exports = toReadable -module.exports.readable = toReadable -module.exports.writable = toWritable -module.exports.transform = toTransform -module.exports.duplex = toDuplex + +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -<<<<<<< HEAD -/***/ 99896: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 42819: +/***/ ((__unused_webpack_module, exports) => { -const toDuplex = __nccwpck_require__(45048) -const defer = __nccwpck_require__(35750) -======= -/***/ 63688: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const toDuplex = __nccwpck_require__(17188) -const defer = __nccwpck_require__(31368) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +Object.defineProperty(exports, "__esModule", ({ value: true })); -module.exports = function toTransform (transform, options) { - const { promise, resolve } = defer() - const source = (async function * () { - const it = await promise - for await (const chunk of it) yield chunk - })() +/***/ }), - return toDuplex({ sink: s => resolve(transform(s)), source }, options) -} +/***/ 93657: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/***/ }), +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(42819), exports); +tslib_1.__exportStar(__nccwpck_require__(69098), exports); +tslib_1.__exportStar(__nccwpck_require__(54181), exports); -<<<<<<< HEAD -/***/ 8614: -======= -/***/ 66405: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ }), +/***/ 69098: +/***/ ((__unused_webpack_module, exports) => { -const crypto = __nccwpck_require__(6113) -<<<<<<< HEAD -const { concat: uint8ArrayConcat } = __nccwpck_require__(64010) -const { fromString: uint8ArrayFromString } = __nccwpck_require__(31277) -======= -const { concat: uint8ArrayConcat } = __nccwpck_require__(17225) -const { fromString: uint8ArrayFromString } = __nccwpck_require__(39451) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -// Based off of code from https://github.com/luke-park/SecureCompatibleEncryptionExamples +Object.defineProperty(exports, "__esModule", ({ value: true })); -/** - * - * @param {object} [options] - * @param {number} [options.algorithmTagLength=16] - * @param {number} [options.nonceLength=12] - * @param {number} [options.keyLength=16] - * @param {string} [options.digest=sha256] - * @param {number} [options.saltLength=16] - * @param {number} [options.iterations=32767] - * @returns {*} - */ -function create ({ - algorithmTagLength = 16, - nonceLength = 12, - keyLength = 16, - digest = 'sha256', - saltLength = 16, - iterations = 32767 -} = {}) { - const algorithm = 'aes-128-gcm' - /** - * - * @private - * @param {Uint8Array} data - * @param {Uint8Array} key - * @returns {Promise} - */ - async function encryptWithKey (data, key) { // eslint-disable-line require-await - const nonce = crypto.randomBytes(nonceLength) - // Create the cipher instance. - const cipher = crypto.createCipheriv(algorithm, key, nonce) +/***/ }), - // Encrypt and prepend nonce. - const ciphertext = uint8ArrayConcat([cipher.update(data), cipher.final()]) +/***/ 54181: +/***/ ((__unused_webpack_module, exports) => { - return uint8ArrayConcat([nonce, ciphertext, cipher.getAuthTag()]) - } - /** - * Uses the provided password to derive a pbkdf2 key. The key - * will then be used to encrypt the data. - * - * @param {Uint8Array} data - The data to decrypt - * @param {string|Uint8Array} password - A plain password - * @returns {Promise} - */ - async function encrypt (data, password) { // eslint-disable-line require-await - // Generate a 128-bit salt using a CSPRNG. - const salt = crypto.randomBytes(saltLength) +Object.defineProperty(exports, "__esModule", ({ value: true })); - if (typeof password === 'string' || password instanceof String) { - password = uint8ArrayFromString(password) - } - // Derive a key using PBKDF2. - const key = crypto.pbkdf2Sync(password, salt, iterations, keyLength, digest) +/***/ }), - // Encrypt and prepend salt. - return uint8ArrayConcat([salt, await encryptWithKey(Uint8Array.from(data), key)]) - } +/***/ 56942: +/***/ ((__unused_webpack_module, exports) => { - /** - * Decrypts the given cipher text with the provided key. The `key` should - * be a cryptographically safe key and not a plaintext password. To use - * a plaintext password, use `decrypt`. The options used to create - * this decryption cipher must be the same as those used to create - * the encryption cipher. - * - * @private - * @param {Uint8Array} ciphertextAndNonce - The data to decrypt - * @param {Uint8Array} key - * @returns {Promise} - */ - async function decryptWithKey (ciphertextAndNonce, key) { // eslint-disable-line require-await - // Create Uint8Arrays of nonce, ciphertext and tag. - const nonce = ciphertextAndNonce.slice(0, nonceLength) - const ciphertext = ciphertextAndNonce.slice(nonceLength, ciphertextAndNonce.length - algorithmTagLength) - const tag = ciphertextAndNonce.slice(ciphertext.length + nonceLength) - // Create the cipher instance. - const cipher = crypto.createDecipheriv(algorithm, key, nonce) +Object.defineProperty(exports, "__esModule", ({ value: true })); - // Decrypt and return result. - cipher.setAuthTag(tag) - return uint8ArrayConcat([cipher.update(ciphertext), cipher.final()]) - } - /** - * Uses the provided password to derive a pbkdf2 key. The key - * will then be used to decrypt the data. The options used to create - * this decryption cipher must be the same as those used to create - * the encryption cipher. - * - * @param {Uint8Array} data - The data to decrypt - * @param {string|Uint8Array} password - A plain password - */ - async function decrypt (data, password) { // eslint-disable-line require-await - // Create Uint8Arrays of salt and ciphertextAndNonce. - const salt = data.slice(0, saltLength) - const ciphertextAndNonce = data.slice(saltLength) +/***/ }), - if (typeof password === 'string' || password instanceof String) { - password = uint8ArrayFromString(password) - } +/***/ 78314: +/***/ ((__unused_webpack_module, exports) => { - // Derive the key using PBKDF2. - const key = crypto.pbkdf2Sync(password, salt, iterations, keyLength, digest) - // Decrypt and return result. - return decryptWithKey(ciphertextAndNonce, key) - } +Object.defineProperty(exports, "__esModule", ({ value: true })); - return { - encrypt, - decrypt - } -} -module.exports = { - create -} +/***/ }), +/***/ 23888: +/***/ ((__unused_webpack_module, exports) => { -/***/ }), -<<<<<<< HEAD -/***/ 69260: -======= -/***/ 82744: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.EndpointURLScheme = void 0; +var EndpointURLScheme; +(function (EndpointURLScheme) { + EndpointURLScheme["HTTP"] = "http"; + EndpointURLScheme["HTTPS"] = "https"; +})(EndpointURLScheme = exports.EndpointURLScheme || (exports.EndpointURLScheme = {})); +/***/ }), -const crypto = __nccwpck_require__(6113) -<<<<<<< HEAD -const lengths = __nccwpck_require__(17250) -======= -const lengths = __nccwpck_require__(31481) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 26221: +/***/ ((__unused_webpack_module, exports) => { -exports.create = async function (hash, secret) { // eslint-disable-line require-await - const res = { - async digest (data) { // eslint-disable-line require-await - const hmac = crypto.createHmac(hash.toLowerCase(), secret) - hmac.update(data) - return hmac.digest() - }, - length: lengths[hash] - } - return res -} +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -<<<<<<< HEAD -/***/ 17250: -======= -/***/ 31481: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - +/***/ 73204: +/***/ ((__unused_webpack_module, exports) => { -module.exports = { - SHA1: 20, - SHA256: 32, - SHA512: 64 -} +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -<<<<<<< HEAD -/***/ 83124: -======= -/***/ 28051: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - +/***/ 80625: +/***/ ((__unused_webpack_module, exports) => { -const crypto = __nccwpck_require__(6113) -<<<<<<< HEAD -const validateCurveType = __nccwpck_require__(82432) -======= -const validateCurveType = __nccwpck_require__(52410) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +Object.defineProperty(exports, "__esModule", ({ value: true })); -const curves = { - 'P-256': 'prime256v1', - 'P-384': 'secp384r1', - 'P-521': 'secp521r1' -} -exports.generateEphmeralKeyPair = async function (curve) { // eslint-disable-line require-await - validateCurveType(Object.keys(curves), curve) +/***/ }), - const ecdh = crypto.createECDH(curves[curve]) - ecdh.generateKeys() +/***/ 86873: +/***/ ((__unused_webpack_module, exports) => { - return { - key: ecdh.getPublicKey(), - async genSharedKey (theirPub, forcePrivate) { // eslint-disable-line require-await - if (forcePrivate) { - ecdh.setPrivateKey(forcePrivate.private) - } - return ecdh.computeSecret(theirPub) - } - } -} +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -<<<<<<< HEAD -/***/ 94462: -======= -/***/ 8452: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 70985: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(26221), exports); +tslib_1.__exportStar(__nccwpck_require__(73204), exports); +tslib_1.__exportStar(__nccwpck_require__(80625), exports); +tslib_1.__exportStar(__nccwpck_require__(53011), exports); +tslib_1.__exportStar(__nccwpck_require__(86873), exports); -<<<<<<< HEAD -const errcode = __nccwpck_require__(22077) -const { equals: uint8ArrayEquals } = __nccwpck_require__(12667) -const { sha256 } = __nccwpck_require__(65484) -const { base58btc } = __nccwpck_require__(50119) -const { identity } = __nccwpck_require__(14733) -const crypto = __nccwpck_require__(35079) -const pbm = __nccwpck_require__(20040) -const exporter = __nccwpck_require__(26048) -======= -const errcode = __nccwpck_require__(5822) -const { equals: uint8ArrayEquals } = __nccwpck_require__(94646) -const { sha256 } = __nccwpck_require__(80960) -const { base58btc } = __nccwpck_require__(49108) -const { identity } = __nccwpck_require__(53863) -const crypto = __nccwpck_require__(90716) -const pbm = __nccwpck_require__(72826) -const exporter = __nccwpck_require__(76630) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -class Ed25519PublicKey { - constructor (key) { - this._key = ensureKey(key, crypto.publicKeyLength) - } +/***/ }), - async verify (data, sig) { // eslint-disable-line require-await - return crypto.hashAndVerify(this._key, sig, data) - } +/***/ 53011: +/***/ ((__unused_webpack_module, exports) => { - marshal () { - return this._key - } - get bytes () { - return pbm.PublicKey.encode({ - Type: pbm.KeyType.Ed25519, - Data: this.marshal() - }).finish() - } +Object.defineProperty(exports, "__esModule", ({ value: true })); - equals (key) { - return uint8ArrayEquals(this.bytes, key.bytes) - } - async hash () { - const { bytes } = await sha256.digest(this.bytes) +/***/ }), - return bytes - } -} +/***/ 44400: +/***/ ((__unused_webpack_module, exports) => { -class Ed25519PrivateKey { - // key - 64 byte Uint8Array containing private key - // publicKey - 32 byte Uint8Array containing public key - constructor (key, publicKey) { - this._key = ensureKey(key, crypto.privateKeyLength) - this._publicKey = ensureKey(publicKey, crypto.publicKeyLength) - } - async sign (message) { // eslint-disable-line require-await - return crypto.hashAndSign(this._key, message) - } +Object.defineProperty(exports, "__esModule", ({ value: true })); - get public () { - return new Ed25519PublicKey(this._publicKey) - } - marshal () { - return this._key - } +/***/ }), - get bytes () { - return pbm.PrivateKey.encode({ - Type: pbm.KeyType.Ed25519, - Data: this.marshal() - }).finish() - } +/***/ 25066: +/***/ ((__unused_webpack_module, exports) => { - equals (key) { - return uint8ArrayEquals(this.bytes, key.bytes) - } - async hash () { - const { bytes } = await sha256.digest(this.bytes) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.resolveChecksumRuntimeConfig = exports.getChecksumConfiguration = exports.AlgorithmId = void 0; +var AlgorithmId; +(function (AlgorithmId) { + AlgorithmId["MD5"] = "md5"; + AlgorithmId["CRC32"] = "crc32"; + AlgorithmId["CRC32C"] = "crc32c"; + AlgorithmId["SHA1"] = "sha1"; + AlgorithmId["SHA256"] = "sha256"; +})(AlgorithmId = exports.AlgorithmId || (exports.AlgorithmId = {})); +const getChecksumConfiguration = (runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== undefined) { + checksumAlgorithms.push({ + algorithmId: () => AlgorithmId.SHA256, + checksumConstructor: () => runtimeConfig.sha256, + }); + } + if (runtimeConfig.md5 != undefined) { + checksumAlgorithms.push({ + algorithmId: () => AlgorithmId.MD5, + checksumConstructor: () => runtimeConfig.md5, + }); + } + return { + _checksumAlgorithms: checksumAlgorithms, + addChecksumAlgorithm(algo) { + this._checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return this._checksumAlgorithms; + }, + }; +}; +exports.getChecksumConfiguration = getChecksumConfiguration; +const resolveChecksumRuntimeConfig = (clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; +}; +exports.resolveChecksumRuntimeConfig = resolveChecksumRuntimeConfig; - return bytes - } - /** - * Gets the ID of the key. - * - * The key id is the base58 encoding of the identity multihash containing its public key. - * The public key is a protobuf encoding containing a type and the DER encoding - * of the PKCS SubjectPublicKeyInfo. - * - * @returns {Promise} - */ - async id () { - const encoding = await identity.digest(this.public.bytes) - return base58btc.encode(encoding.bytes).substring(1) - } +/***/ }), - /** - * Exports the key into a password protected `format` - * - * @param {string} password - The password to encrypt the key - * @param {string} [format=libp2p-key] - The format in which to export as - * @returns {Promise} The encrypted private key - */ - async export (password, format = 'libp2p-key') { // eslint-disable-line require-await - if (format === 'libp2p-key') { - return exporter.export(this.bytes, password) - } else { - throw errcode(new Error(`export format '${format}' is not supported`), 'ERR_INVALID_EXPORT_FORMAT') - } - } -} +/***/ 6817: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -function unmarshalEd25519PrivateKey (bytes) { - // Try the old, redundant public key version - if (bytes.length > crypto.privateKeyLength) { - bytes = ensureKey(bytes, crypto.privateKeyLength + crypto.publicKeyLength) - const privateKeyBytes = bytes.slice(0, crypto.privateKeyLength) - const publicKeyBytes = bytes.slice(crypto.privateKeyLength, bytes.length) - return new Ed25519PrivateKey(privateKeyBytes, publicKeyBytes) - } - bytes = ensureKey(bytes, crypto.privateKeyLength) - const privateKeyBytes = bytes.slice(0, crypto.privateKeyLength) - const publicKeyBytes = bytes.slice(crypto.publicKeyLength) - return new Ed25519PrivateKey(privateKeyBytes, publicKeyBytes) -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.resolveDefaultRuntimeConfig = exports.getDefaultClientConfiguration = void 0; +const checksum_1 = __nccwpck_require__(25066); +const getDefaultClientConfiguration = (runtimeConfig) => { + return { + ...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), + }; +}; +exports.getDefaultClientConfiguration = getDefaultClientConfiguration; +const resolveDefaultRuntimeConfig = (config) => { + return { + ...(0, checksum_1.resolveChecksumRuntimeConfig)(config), + }; +}; +exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; -function unmarshalEd25519PublicKey (bytes) { - bytes = ensureKey(bytes, crypto.publicKeyLength) - return new Ed25519PublicKey(bytes) -} -async function generateKeyPair () { - const { privateKey, publicKey } = await crypto.generateKey() - return new Ed25519PrivateKey(privateKey, publicKey) -} +/***/ }), -async function generateKeyPairFromSeed (seed) { - const { privateKey, publicKey } = await crypto.generateKeyFromSeed(seed) - return new Ed25519PrivateKey(privateKey, publicKey) -} +/***/ 83283: +/***/ ((__unused_webpack_module, exports) => { -function ensureKey (key, length) { - key = Uint8Array.from(key || []) - if (key.length !== length) { - throw errcode(new Error(`Key must be a Uint8Array of length ${length}, got ${key.length}`), 'ERR_INVALID_KEY_TYPE') - } - return key -} -module.exports = { - Ed25519PublicKey, - Ed25519PrivateKey, - unmarshalEd25519PrivateKey, - unmarshalEd25519PublicKey, - generateKeyPair, - generateKeyPairFromSeed -} +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -<<<<<<< HEAD -/***/ 35079: -======= -/***/ 90716: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 19506: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AlgorithmId = void 0; +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(6817), exports); +tslib_1.__exportStar(__nccwpck_require__(83283), exports); +var checksum_1 = __nccwpck_require__(25066); +Object.defineProperty(exports, "AlgorithmId", ({ enumerable: true, get: function () { return checksum_1.AlgorithmId; } })); -<<<<<<< HEAD -const ed = __nccwpck_require__(72426) -======= -const ed = __nccwpck_require__(27766) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -const PUBLIC_KEY_BYTE_LENGTH = 32 -const PRIVATE_KEY_BYTE_LENGTH = 64 // private key is actually 32 bytes but for historical reasons we concat private and public keys -const KEYS_BYTE_LENGTH = 32 -exports.publicKeyLength = PUBLIC_KEY_BYTE_LENGTH -exports.privateKeyLength = PRIVATE_KEY_BYTE_LENGTH +/***/ }), -exports.generateKey = async function () { - // the actual private key (32 bytes) - const privateKeyRaw = ed.utils.randomPrivateKey() - const publicKey = await ed.getPublicKey(privateKeyRaw) +/***/ 45507: +/***/ ((__unused_webpack_module, exports) => { - // concatenated the public key to the private key - const privateKey = concatKeys(privateKeyRaw, publicKey) - return { - privateKey, - publicKey - } -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.FieldPosition = void 0; +var FieldPosition; +(function (FieldPosition) { + FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; + FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; +})(FieldPosition = exports.FieldPosition || (exports.FieldPosition = {})); -/** - * Generate keypair from a seed - * - * @param {Uint8Array} seed - seed should be a 32 byte uint8array - * @returns - */ -exports.generateKeyFromSeed = async function (seed) { - if (seed.length !== KEYS_BYTE_LENGTH) { - throw new TypeError('"seed" must be 32 bytes in length.') - } else if (!(seed instanceof Uint8Array)) { - throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.') - } - // based on node forges algorithm, the seed is used directly as private key - const privateKeyRaw = seed - const publicKey = await ed.getPublicKey(privateKeyRaw) +/***/ }), - const privateKey = concatKeys(privateKeyRaw, publicKey) +/***/ 54635: +/***/ ((__unused_webpack_module, exports) => { - return { - privateKey, - publicKey - } -} -exports.hashAndSign = function (privateKey, msg) { - const privateKeyRaw = privateKey.slice(0, KEYS_BYTE_LENGTH) +Object.defineProperty(exports, "__esModule", ({ value: true })); - return ed.sign(msg, privateKeyRaw) -} -exports.hashAndVerify = function (publicKey, sig, msg) { - return ed.verify(sig, msg, publicKey) -} +/***/ }), -function concatKeys (privateKeyRaw, publicKey) { - const privateKey = new Uint8Array(exports.privateKeyLength) - for (let i = 0; i < KEYS_BYTE_LENGTH; i++) { - privateKey[i] = privateKeyRaw[i] - privateKey[KEYS_BYTE_LENGTH + i] = publicKey[i] - } - return privateKey -} +/***/ 24567: +/***/ ((__unused_webpack_module, exports) => { -/***/ }), +Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -/***/ 19241: -======= -/***/ 48831: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ }), +/***/ 73234: +/***/ ((__unused_webpack_module, exports) => { -<<<<<<< HEAD -const ecdh = __nccwpck_require__(83124) -======= -const ecdh = __nccwpck_require__(28051) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -// Generates an ephemeral public key and returns a function that will compute -// the shared secret key. -// -// Focuses only on ECDH now, but can be made more general in the future. -module.exports = async (curve) => ecdh.generateEphmeralKeyPair(curve) // eslint-disable-line require-await +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -<<<<<<< HEAD -/***/ 26048: -======= -/***/ 76630: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - +/***/ 49589: +/***/ ((__unused_webpack_module, exports) => { -<<<<<<< HEAD -const { base64 } = __nccwpck_require__(25631) -const ciphers = __nccwpck_require__(8614) -======= -const { base64 } = __nccwpck_require__(98197) -const ciphers = __nccwpck_require__(66405) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -module.exports = { - /** - * Exports the given PrivateKey as a base64 encoded string. - * The PrivateKey is encrypted via a password derived PBKDF2 key - * leveraging the aes-gcm cipher algorithm. - * - * @param {Uint8Array} privateKey - The PrivateKey protobuf - * @param {string} password - * @returns {Promise} A base64 encoded string - */ - export: async function (privateKey, password) { - const cipher = ciphers.create() - const encryptedKey = await cipher.encrypt(privateKey, password) - return base64.encode(encryptedKey) - } -} +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -<<<<<<< HEAD -/***/ 90918: -======= -/***/ 22940: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - +/***/ 84026: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -<<<<<<< HEAD -const { base64 } = __nccwpck_require__(25631) -const ciphers = __nccwpck_require__(8614) -======= -const { base64 } = __nccwpck_require__(98197) -const ciphers = __nccwpck_require__(66405) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -module.exports = { - /** - * Attempts to decrypt a base64 encoded PrivateKey string - * with the given password. The privateKey must have been exported - * using the same password and underlying cipher (aes-gcm) - * - * @param {string} privateKey - A base64 encoded encrypted key - * @param {string} password - * @returns {Promise} The private key protobuf - */ - import: async function (privateKey, password) { - const encryptedKey = base64.decode(privateKey) - const cipher = ciphers.create() - return await cipher.decrypt(encryptedKey, password) - } -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(24567), exports); +tslib_1.__exportStar(__nccwpck_require__(73234), exports); +tslib_1.__exportStar(__nccwpck_require__(49589), exports); +tslib_1.__exportStar(__nccwpck_require__(37269), exports); /***/ }), -<<<<<<< HEAD -/***/ 55848: -======= -/***/ 13041: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - +/***/ 37269: +/***/ ((__unused_webpack_module, exports) => { -<<<<<<< HEAD -const keysPBM = __nccwpck_require__(20040) -__nccwpck_require__(1571) -__nccwpck_require__(60075) -const forge = __nccwpck_require__(72177) -const errcode = __nccwpck_require__(22077) -const { fromString: uint8ArrayFromString } = __nccwpck_require__(31277) -const importer = __nccwpck_require__(90918) +Object.defineProperty(exports, "__esModule", ({ value: true })); -const supportedKeys = { - rsa: __nccwpck_require__(53075), - ed25519: __nccwpck_require__(94462), - secp256k1: __nccwpck_require__(56976)(keysPBM, __nccwpck_require__(34388)) -======= -const keysPBM = __nccwpck_require__(72826) -__nccwpck_require__(69197) -__nccwpck_require__(87861) -const forge = __nccwpck_require__(96630) -const errcode = __nccwpck_require__(5822) -const { fromString: uint8ArrayFromString } = __nccwpck_require__(39451) - -const importer = __nccwpck_require__(22940) -const supportedKeys = { - rsa: __nccwpck_require__(91667), - ed25519: __nccwpck_require__(8452), - secp256k1: __nccwpck_require__(84968)(keysPBM, __nccwpck_require__(26409)) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -} +/***/ }), -const ErrMissingSecp256K1 = { - message: 'secp256k1 support requires libp2p-crypto-secp256k1 package', - code: 'ERR_MISSING_PACKAGE' -} +/***/ 21438: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -function typeToKey (type) { - const key = supportedKeys[type.toLowerCase()] - if (!key) { - const supported = Object.keys(supportedKeys).join(' / ') - throw errcode(new Error(`invalid or unsupported key type ${type}. Must be ${supported}`), 'ERR_UNSUPPORTED_KEY_TYPE') - } - return key -} -// Generates a keypair of the given type and bitsize -const generateKeyPair = async (type, bits) => { // eslint-disable-line require-await - return typeToKey(type).generateKeyPair(bits) -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(23512), exports); +tslib_1.__exportStar(__nccwpck_require__(75520), exports); +tslib_1.__exportStar(__nccwpck_require__(64888), exports); +tslib_1.__exportStar(__nccwpck_require__(85137), exports); +tslib_1.__exportStar(__nccwpck_require__(17658), exports); +tslib_1.__exportStar(__nccwpck_require__(59940), exports); +tslib_1.__exportStar(__nccwpck_require__(93657), exports); +tslib_1.__exportStar(__nccwpck_require__(56942), exports); +tslib_1.__exportStar(__nccwpck_require__(78314), exports); +tslib_1.__exportStar(__nccwpck_require__(23888), exports); +tslib_1.__exportStar(__nccwpck_require__(70985), exports); +tslib_1.__exportStar(__nccwpck_require__(44400), exports); +tslib_1.__exportStar(__nccwpck_require__(19506), exports); +tslib_1.__exportStar(__nccwpck_require__(45507), exports); +tslib_1.__exportStar(__nccwpck_require__(54635), exports); +tslib_1.__exportStar(__nccwpck_require__(84026), exports); +tslib_1.__exportStar(__nccwpck_require__(17411), exports); +tslib_1.__exportStar(__nccwpck_require__(6029), exports); +tslib_1.__exportStar(__nccwpck_require__(15153), exports); +tslib_1.__exportStar(__nccwpck_require__(80211), exports); +tslib_1.__exportStar(__nccwpck_require__(84504), exports); +tslib_1.__exportStar(__nccwpck_require__(43268), exports); +tslib_1.__exportStar(__nccwpck_require__(92799), exports); +tslib_1.__exportStar(__nccwpck_require__(43493), exports); +tslib_1.__exportStar(__nccwpck_require__(45605), exports); +tslib_1.__exportStar(__nccwpck_require__(81000), exports); +tslib_1.__exportStar(__nccwpck_require__(44046), exports); +tslib_1.__exportStar(__nccwpck_require__(50539), exports); +tslib_1.__exportStar(__nccwpck_require__(93499), exports); +tslib_1.__exportStar(__nccwpck_require__(86609), exports); +tslib_1.__exportStar(__nccwpck_require__(46694), exports); +tslib_1.__exportStar(__nccwpck_require__(4218), exports); +tslib_1.__exportStar(__nccwpck_require__(20189), exports); +tslib_1.__exportStar(__nccwpck_require__(94618), exports); +tslib_1.__exportStar(__nccwpck_require__(93397), exports); +tslib_1.__exportStar(__nccwpck_require__(46361), exports); -// Generates a keypair of the given type and bitsize -// seed is a 32 byte uint8array -const generateKeyPairFromSeed = async (type, seed, bits) => { // eslint-disable-line require-await - const key = typeToKey(type) - if (type.toLowerCase() !== 'ed25519') { - throw errcode(new Error('Seed key derivation is unimplemented for RSA or secp256k1'), 'ERR_UNSUPPORTED_KEY_DERIVATION_TYPE') - } - return key.generateKeyPairFromSeed(seed, bits) -} -// Converts a protobuf serialized public key into its -// representative object -const unmarshalPublicKey = (buf) => { - const decoded = keysPBM.PublicKey.decode(buf) - const data = decoded.Data +/***/ }), - switch (decoded.Type) { - case keysPBM.KeyType.RSA: - return supportedKeys.rsa.unmarshalRsaPublicKey(data) - case keysPBM.KeyType.Ed25519: - return supportedKeys.ed25519.unmarshalEd25519PublicKey(data) - case keysPBM.KeyType.Secp256k1: - if (supportedKeys.secp256k1) { - return supportedKeys.secp256k1.unmarshalSecp256k1PublicKey(data) - } else { - throw errcode(new Error(ErrMissingSecp256K1.message), ErrMissingSecp256K1.code) - } - default: - typeToKey(decoded.Type) // throws because type is not supported - } -} +/***/ 17411: +/***/ ((__unused_webpack_module, exports) => { -// Converts a public key object into a protobuf serialized public key -const marshalPublicKey = (key, type) => { - type = (type || 'rsa').toLowerCase() - typeToKey(type) // check type - return key.bytes -} -// Converts a protobuf serialized private key into its -// representative object -const unmarshalPrivateKey = async (buf) => { // eslint-disable-line require-await - const decoded = keysPBM.PrivateKey.decode(buf) - const data = decoded.Data +Object.defineProperty(exports, "__esModule", ({ value: true })); - switch (decoded.Type) { - case keysPBM.KeyType.RSA: - return supportedKeys.rsa.unmarshalRsaPrivateKey(data) - case keysPBM.KeyType.Ed25519: - return supportedKeys.ed25519.unmarshalEd25519PrivateKey(data) - case keysPBM.KeyType.Secp256k1: - if (supportedKeys.secp256k1) { - return supportedKeys.secp256k1.unmarshalSecp256k1PrivateKey(data) - } else { - throw errcode(new Error(ErrMissingSecp256K1.message), ErrMissingSecp256K1.code) - } - default: - typeToKey(decoded.Type) // throws because type is not supported - } -} -// Converts a private key object into a protobuf serialized private key -const marshalPrivateKey = (key, type) => { - type = (type || 'rsa').toLowerCase() - typeToKey(type) // check type - return key.bytes -} +/***/ }), -/** - * - * @param {string} encryptedKey - * @param {string} password - */ -const importKey = async (encryptedKey, password) => { // eslint-disable-line require-await - try { - const key = await importer.import(encryptedKey, password) - return unmarshalPrivateKey(key) - } catch (_) { - // Ignore and try the old pem decrypt - } +/***/ 6029: +/***/ ((__unused_webpack_module, exports) => { - // Only rsa supports pem right now - const key = forge.pki.decryptRsaPrivateKey(encryptedKey, password) - if (key === null) { - throw errcode(new Error('Cannot read the key, most likely the password is wrong or not a RSA key'), 'ERR_CANNOT_DECRYPT_PEM') - } - let der = forge.asn1.toDer(forge.pki.privateKeyToAsn1(key)) - der = uint8ArrayFromString(der.getBytes(), 'ascii') - return supportedKeys.rsa.unmarshalRsaPrivateKey(der) -} -module.exports = { - supportedKeys, - keysPBM, -<<<<<<< HEAD - keyStretcher: __nccwpck_require__(92418), - generateEphemeralKeyPair: __nccwpck_require__(19241), -======= - keyStretcher: __nccwpck_require__(88595), - generateEphemeralKeyPair: __nccwpck_require__(48831), ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - generateKeyPair, - generateKeyPairFromSeed, - unmarshalPublicKey, - marshalPublicKey, - unmarshalPrivateKey, - marshalPrivateKey, - import: importKey -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SMITHY_CONTEXT_KEY = void 0; +exports.SMITHY_CONTEXT_KEY = "__smithy_context"; /***/ }), -<<<<<<< HEAD -/***/ 92418: -======= -/***/ 88595: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 15153: +/***/ ((__unused_webpack_module, exports) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -const errcode = __nccwpck_require__(22077) -const { concat: uint8ArrayConcat } = __nccwpck_require__(64010) -const { fromString: uint8ArrayFromString } = __nccwpck_require__(31277) -const hmac = __nccwpck_require__(69260) -======= -const errcode = __nccwpck_require__(5822) -const { concat: uint8ArrayConcat } = __nccwpck_require__(17225) -const { fromString: uint8ArrayFromString } = __nccwpck_require__(39451) -const hmac = __nccwpck_require__(82744) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const cipherMap = { - 'AES-128': { - ivSize: 16, - keySize: 16 - }, - 'AES-256': { - ivSize: 16, - keySize: 32 - }, - Blowfish: { - ivSize: 8, - cipherKeySize: 32 - } -} +/***/ }), -// Generates a set of keys for each party by stretching the shared key. -// (myIV, theirIV, myCipherKey, theirCipherKey, myMACKey, theirMACKey) -module.exports = async (cipherType, hash, secret) => { - const cipher = cipherMap[cipherType] +/***/ 80211: +/***/ ((__unused_webpack_module, exports) => { - if (!cipher) { - const allowed = Object.keys(cipherMap).join(' / ') - throw errcode(new Error(`unknown cipher type '${cipherType}'. Must be ${allowed}`), 'ERR_INVALID_CIPHER_TYPE') - } - if (!hash) { - throw errcode(new Error('missing hash type'), 'ERR_MISSING_HASH_TYPE') - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.IniSectionType = void 0; +var IniSectionType; +(function (IniSectionType) { + IniSectionType["PROFILE"] = "profile"; + IniSectionType["SSO_SESSION"] = "sso-session"; + IniSectionType["SERVICES"] = "services"; +})(IniSectionType = exports.IniSectionType || (exports.IniSectionType = {})); + - const cipherKeySize = cipher.keySize - const ivSize = cipher.ivSize - const hmacKeySize = 20 - const seed = uint8ArrayFromString('key expansion') - const resultLength = 2 * (ivSize + cipherKeySize + hmacKeySize) +/***/ }), - const m = await hmac.create(hash, secret) - let a = await m.digest(seed) +/***/ 84504: +/***/ ((__unused_webpack_module, exports) => { - const result = [] - let j = 0 - while (j < resultLength) { - const b = await m.digest(uint8ArrayConcat([a, seed])) - let todo = b.length +Object.defineProperty(exports, "__esModule", ({ value: true })); - if (j + todo > resultLength) { - todo = resultLength - j - } - result.push(b) - j += todo - a = await m.digest(a) - } +/***/ }), - const half = resultLength / 2 - const resultBuffer = uint8ArrayConcat(result) - const r1 = resultBuffer.slice(0, half) - const r2 = resultBuffer.slice(half, resultLength) +/***/ 43268: +/***/ ((__unused_webpack_module, exports) => { - const createKey = (res) => ({ - iv: res.slice(0, ivSize), - cipherKey: res.slice(ivSize, ivSize + cipherKeySize), - macKey: res.slice(ivSize + cipherKeySize) - }) - return { - k1: createKey(r1), - k2: createKey(r2) - } -} +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -<<<<<<< HEAD -/***/ 20040: -======= -/***/ 72826: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 92799: +/***/ ((__unused_webpack_module, exports) => { -/*eslint-disable*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -var $protobuf = __nccwpck_require__(20606); -======= -var $protobuf = __nccwpck_require__(63616); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -// Common aliases -var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; +/***/ }), -// Exported root namespace -var $root = $protobuf.roots["libp2p-crypto-keys"] || ($protobuf.roots["libp2p-crypto-keys"] = {}); +/***/ 43493: +/***/ ((__unused_webpack_module, exports) => { -/** - * KeyType enum. - * @exports KeyType - * @enum {number} - * @property {number} RSA=0 RSA value - * @property {number} Ed25519=1 Ed25519 value - * @property {number} Secp256k1=2 Secp256k1 value - */ -$root.KeyType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RSA"] = 0; - values[valuesById[1] = "Ed25519"] = 1; - values[valuesById[2] = "Secp256k1"] = 2; - return values; -})(); -$root.PublicKey = (function() { +Object.defineProperty(exports, "__esModule", ({ value: true })); - /** - * Properties of a PublicKey. - * @exports IPublicKey - * @interface IPublicKey - * @property {KeyType} Type PublicKey Type - * @property {Uint8Array} Data PublicKey Data - */ - /** - * Constructs a new PublicKey. - * @exports PublicKey - * @classdesc Represents a PublicKey. - * @implements IPublicKey - * @constructor - * @param {IPublicKey=} [p] Properties to set - */ - function PublicKey(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) - this[ks[i]] = p[ks[i]]; - } +/***/ }), - /** - * PublicKey Type. - * @member {KeyType} Type - * @memberof PublicKey - * @instance - */ - PublicKey.prototype.Type = 0; +/***/ 45605: +/***/ ((__unused_webpack_module, exports) => { - /** - * PublicKey Data. - * @member {Uint8Array} Data - * @memberof PublicKey - * @instance - */ - PublicKey.prototype.Data = $util.newBuffer([]); - /** - * Encodes the specified PublicKey message. Does not implicitly {@link PublicKey.verify|verify} messages. - * @function encode - * @memberof PublicKey - * @static - * @param {IPublicKey} m PublicKey message or plain object to encode - * @param {$protobuf.Writer} [w] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PublicKey.encode = function encode(m, w) { - if (!w) - w = $Writer.create(); - w.uint32(8).int32(m.Type); - w.uint32(18).bytes(m.Data); - return w; - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); - /** - * Decodes a PublicKey message from the specified reader or buffer. - * @function decode - * @memberof PublicKey - * @static - * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from - * @param {number} [l] Message length if known beforehand - * @returns {PublicKey} PublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PublicKey.decode = function decode(r, l) { - if (!(r instanceof $Reader)) - r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, m = new $root.PublicKey(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.Type = r.int32(); - break; - case 2: - m.Data = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - if (!m.hasOwnProperty("Type")) - throw $util.ProtocolError("missing required 'Type'", { instance: m }); - if (!m.hasOwnProperty("Data")) - throw $util.ProtocolError("missing required 'Data'", { instance: m }); - return m; - }; - /** - * Creates a PublicKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof PublicKey - * @static - * @param {Object.} d Plain object - * @returns {PublicKey} PublicKey - */ - PublicKey.fromObject = function fromObject(d) { - if (d instanceof $root.PublicKey) - return d; - var m = new $root.PublicKey(); - switch (d.Type) { - case "RSA": - case 0: - m.Type = 0; - break; - case "Ed25519": - case 1: - m.Type = 1; - break; - case "Secp256k1": - case 2: - m.Type = 2; - break; - } - if (d.Data != null) { - if (typeof d.Data === "string") - $util.base64.decode(d.Data, m.Data = $util.newBuffer($util.base64.length(d.Data)), 0); - else if (d.Data.length) - m.Data = d.Data; - } - return m; - }; +/***/ }), - /** - * Creates a plain object from a PublicKey message. Also converts values to other types if specified. - * @function toObject - * @memberof PublicKey - * @static - * @param {PublicKey} m PublicKey - * @param {$protobuf.IConversionOptions} [o] Conversion options - * @returns {Object.} Plain object - */ - PublicKey.toObject = function toObject(m, o) { - if (!o) - o = {}; - var d = {}; - if (o.defaults) { - d.Type = o.enums === String ? "RSA" : 0; - if (o.bytes === String) - d.Data = ""; - else { - d.Data = []; - if (o.bytes !== Array) - d.Data = $util.newBuffer(d.Data); - } - } - if (m.Type != null && m.hasOwnProperty("Type")) { - d.Type = o.enums === String ? $root.KeyType[m.Type] : m.Type; - } - if (m.Data != null && m.hasOwnProperty("Data")) { - 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; - } - return d; - }; +/***/ 81000: +/***/ ((__unused_webpack_module, exports) => { - /** - * Converts this PublicKey to JSON. - * @function toJSON - * @memberof PublicKey - * @instance - * @returns {Object.} JSON object - */ - PublicKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return PublicKey; -})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); -$root.PrivateKey = (function() { - /** - * Properties of a PrivateKey. - * @exports IPrivateKey - * @interface IPrivateKey - * @property {KeyType} Type PrivateKey Type - * @property {Uint8Array} Data PrivateKey Data - */ +/***/ }), - /** - * Constructs a new PrivateKey. - * @exports PrivateKey - * @classdesc Represents a PrivateKey. - * @implements IPrivateKey - * @constructor - * @param {IPrivateKey=} [p] Properties to set - */ - function PrivateKey(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) - this[ks[i]] = p[ks[i]]; - } +/***/ 44046: +/***/ ((__unused_webpack_module, exports) => { - /** - * PrivateKey Type. - * @member {KeyType} Type - * @memberof PrivateKey - * @instance - */ - PrivateKey.prototype.Type = 0; - /** - * PrivateKey Data. - * @member {Uint8Array} Data - * @memberof PrivateKey - * @instance - */ - PrivateKey.prototype.Data = $util.newBuffer([]); +Object.defineProperty(exports, "__esModule", ({ value: true })); - /** - * Encodes the specified PrivateKey message. Does not implicitly {@link PrivateKey.verify|verify} messages. - * @function encode - * @memberof PrivateKey - * @static - * @param {IPrivateKey} m PrivateKey message or plain object to encode - * @param {$protobuf.Writer} [w] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PrivateKey.encode = function encode(m, w) { - if (!w) - w = $Writer.create(); - w.uint32(8).int32(m.Type); - w.uint32(18).bytes(m.Data); - return w; - }; - /** - * Decodes a PrivateKey message from the specified reader or buffer. - * @function decode - * @memberof PrivateKey - * @static - * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from - * @param {number} [l] Message length if known beforehand - * @returns {PrivateKey} PrivateKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PrivateKey.decode = function decode(r, l) { - if (!(r instanceof $Reader)) - r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, m = new $root.PrivateKey(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.Type = r.int32(); - break; - case 2: - m.Data = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - if (!m.hasOwnProperty("Type")) - throw $util.ProtocolError("missing required 'Type'", { instance: m }); - if (!m.hasOwnProperty("Data")) - throw $util.ProtocolError("missing required 'Data'", { instance: m }); - return m; - }; +/***/ }), - /** - * Creates a PrivateKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof PrivateKey - * @static - * @param {Object.} d Plain object - * @returns {PrivateKey} PrivateKey - */ - PrivateKey.fromObject = function fromObject(d) { - if (d instanceof $root.PrivateKey) - return d; - var m = new $root.PrivateKey(); - switch (d.Type) { - case "RSA": - case 0: - m.Type = 0; - break; - case "Ed25519": - case 1: - m.Type = 1; - break; - case "Secp256k1": - case 2: - m.Type = 2; - break; - } - if (d.Data != null) { - if (typeof d.Data === "string") - $util.base64.decode(d.Data, m.Data = $util.newBuffer($util.base64.length(d.Data)), 0); - else if (d.Data.length) - m.Data = d.Data; - } - return m; - }; +/***/ 50539: +/***/ ((__unused_webpack_module, exports) => { - /** - * Creates a plain object from a PrivateKey message. Also converts values to other types if specified. - * @function toObject - * @memberof PrivateKey - * @static - * @param {PrivateKey} m PrivateKey - * @param {$protobuf.IConversionOptions} [o] Conversion options - * @returns {Object.} Plain object - */ - PrivateKey.toObject = function toObject(m, o) { - if (!o) - o = {}; - var d = {}; - if (o.defaults) { - d.Type = o.enums === String ? "RSA" : 0; - if (o.bytes === String) - d.Data = ""; - else { - d.Data = []; - if (o.bytes !== Array) - d.Data = $util.newBuffer(d.Data); - } - } - if (m.Type != null && m.hasOwnProperty("Type")) { - d.Type = o.enums === String ? $root.KeyType[m.Type] : m.Type; - } - if (m.Data != null && m.hasOwnProperty("Data")) { - 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; - } - return d; - }; - /** - * Converts this PrivateKey to JSON. - * @function toJSON - * @memberof PrivateKey - * @instance - * @returns {Object.} JSON object - */ - PrivateKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); - return PrivateKey; -})(); -module.exports = $root; +/***/ }), +/***/ 93499: +/***/ ((__unused_webpack_module, exports) => { -/***/ }), -<<<<<<< HEAD -/***/ 53075: -======= -/***/ 91667: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ }), -<<<<<<< HEAD -const { sha256 } = __nccwpck_require__(65484) -const errcode = __nccwpck_require__(22077) -const { equals: uint8ArrayEquals } = __nccwpck_require__(12667) -const { toString: uint8ArrayToString } = __nccwpck_require__(34163) +/***/ 86609: +/***/ ((__unused_webpack_module, exports) => { -__nccwpck_require__(5388) -const forge = __nccwpck_require__(72177) -const crypto = __nccwpck_require__(51937) -const pbm = __nccwpck_require__(20040) -const exporter = __nccwpck_require__(26048) -======= -const { sha256 } = __nccwpck_require__(80960) -const errcode = __nccwpck_require__(5822) -const { equals: uint8ArrayEquals } = __nccwpck_require__(94646) -const { toString: uint8ArrayToString } = __nccwpck_require__(2771) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RequestHandlerProtocol = void 0; +var RequestHandlerProtocol; +(function (RequestHandlerProtocol) { + RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; +})(RequestHandlerProtocol = exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {})); -__nccwpck_require__(34531) -const forge = __nccwpck_require__(96630) -const crypto = __nccwpck_require__(23882) -const pbm = __nccwpck_require__(72826) -const exporter = __nccwpck_require__(76630) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ }), -class RsaPublicKey { - constructor (key) { - this._key = key - } +/***/ 46694: +/***/ ((__unused_webpack_module, exports) => { - async verify (data, sig) { // eslint-disable-line require-await - return crypto.hashAndVerify(this._key, sig, data) - } - marshal () { - return crypto.utils.jwkToPkix(this._key) - } +Object.defineProperty(exports, "__esModule", ({ value: true })); - get bytes () { - return pbm.PublicKey.encode({ - Type: pbm.KeyType.RSA, - Data: this.marshal() - }).finish() - } - encrypt (bytes) { - return crypto.encrypt(this._key, bytes) - } +/***/ }), - equals (key) { - return uint8ArrayEquals(this.bytes, key.bytes) - } +/***/ 4218: +/***/ ((__unused_webpack_module, exports) => { - async hash () { - const { bytes } = await sha256.digest(this.bytes) - return bytes - } -} +Object.defineProperty(exports, "__esModule", ({ value: true })); -class RsaPrivateKey { - // key - Object of the jwk format - // publicKey - Uint8Array of the spki format - constructor (key, publicKey) { - this._key = key - this._publicKey = publicKey - } - genSecret () { - return crypto.getRandomValues(16) - } +/***/ }), - async sign (message) { // eslint-disable-line require-await - return crypto.hashAndSign(this._key, message) - } +/***/ 20189: +/***/ ((__unused_webpack_module, exports) => { - get public () { - if (!this._publicKey) { - throw errcode(new Error('public key not provided'), 'ERR_PUBKEY_NOT_PROVIDED') - } - return new RsaPublicKey(this._publicKey) - } +Object.defineProperty(exports, "__esModule", ({ value: true })); - decrypt (bytes) { - return crypto.decrypt(this._key, bytes) - } - marshal () { - return crypto.utils.jwkToPkcs1(this._key) - } +/***/ }), - get bytes () { - return pbm.PrivateKey.encode({ - Type: pbm.KeyType.RSA, - Data: this.marshal() - }).finish() - } +/***/ 94618: +/***/ ((__unused_webpack_module, exports) => { - equals (key) { - return uint8ArrayEquals(this.bytes, key.bytes) - } - async hash () { - const { bytes } = await sha256.digest(this.bytes) +Object.defineProperty(exports, "__esModule", ({ value: true })); - return bytes - } - /** - * Gets the ID of the key. - * - * The key id is the base58 encoding of the SHA-256 multihash of its public key. - * The public key is a protobuf encoding containing a type and the DER encoding - * of the PKCS SubjectPublicKeyInfo. - * - * @returns {Promise} - */ - async id () { - const hash = await this.public.hash() - return uint8ArrayToString(hash, 'base58btc') - } +/***/ }), - /** - * Exports the key into a password protected PEM format - * - * @param {string} password - The password to read the encrypted PEM - * @param {string} [format=pkcs-8] - The format in which to export as - */ - async export (password, format = 'pkcs-8') { // eslint-disable-line require-await - if (format === 'pkcs-8') { - const buffer = new forge.util.ByteBuffer(this.marshal()) - const asn1 = forge.asn1.fromDer(buffer) - const privateKey = forge.pki.privateKeyFromAsn1(asn1) +/***/ 93397: +/***/ ((__unused_webpack_module, exports) => { - const options = { - algorithm: 'aes256', - count: 10000, - saltSize: 128 / 8, - prfAlgorithm: 'sha512' - } - return forge.pki.encryptRsaPrivateKey(privateKey, password, options) - } else if (format === 'libp2p-key') { - return exporter.export(this.bytes, password) - } else { - throw errcode(new Error(`export format '${format}' is not supported`), 'ERR_INVALID_EXPORT_FORMAT') - } - } -} -async function unmarshalRsaPrivateKey (bytes) { - const jwk = crypto.utils.pkcs1ToJwk(bytes) - const keys = await crypto.unmarshalPrivateKey(jwk) - return new RsaPrivateKey(keys.privateKey, keys.publicKey) -} +Object.defineProperty(exports, "__esModule", ({ value: true })); -function unmarshalRsaPublicKey (bytes) { - const jwk = crypto.utils.pkixToJwk(bytes) - return new RsaPublicKey(jwk) -} -async function fromJwk (jwk) { - const keys = await crypto.unmarshalPrivateKey(jwk) - return new RsaPrivateKey(keys.privateKey, keys.publicKey) -} +/***/ }), -async function generateKeyPair (bits) { - const keys = await crypto.generateKey(bits) - return new RsaPrivateKey(keys.privateKey, keys.publicKey) -} +/***/ 46361: +/***/ ((__unused_webpack_module, exports) => { -module.exports = { - RsaPublicKey, - RsaPrivateKey, - unmarshalRsaPublicKey, - unmarshalRsaPrivateKey, - generateKeyPair, - fromJwk -} + +Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), -<<<<<<< HEAD -/***/ 15590: -======= -/***/ 34219: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 45013: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseUrl = void 0; +const querystring_parser_1 = __nccwpck_require__(49504); +const parseUrl = (url) => { + if (typeof url === "string") { + return (0, exports.parseUrl)(new URL(url)); + } + const { hostname, pathname, port, protocol, search } = url; + let query; + if (search) { + query = (0, querystring_parser_1.parseQueryString)(search); + } + return { + hostname, + port: port ? parseInt(port) : undefined, + protocol, + path: pathname, + query, + }; +}; +exports.parseUrl = parseUrl; -<<<<<<< HEAD -__nccwpck_require__(1571) -__nccwpck_require__(62646) -const forge = __nccwpck_require__(72177) -const { bigIntegerToUintBase64url, base64urlToBigInteger } = __nccwpck_require__(44257) -const { fromString: uint8ArrayFromString } = __nccwpck_require__(31277) -const { toString: uint8ArrayToString } = __nccwpck_require__(34163) -======= -__nccwpck_require__(69197) -__nccwpck_require__(79626) -const forge = __nccwpck_require__(96630) -const { bigIntegerToUintBase64url, base64urlToBigInteger } = __nccwpck_require__(85216) -const { fromString: uint8ArrayFromString } = __nccwpck_require__(39451) -const { toString: uint8ArrayToString } = __nccwpck_require__(2771) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -// Convert a PKCS#1 in ASN1 DER format to a JWK key -exports.pkcs1ToJwk = function (bytes) { - const asn1 = forge.asn1.fromDer(uint8ArrayToString(bytes, 'ascii')) - const privateKey = forge.pki.privateKeyFromAsn1(asn1) +/***/ }), - // https://tools.ietf.org/html/rfc7518#section-6.3.1 - return { - kty: 'RSA', - n: bigIntegerToUintBase64url(privateKey.n), - e: bigIntegerToUintBase64url(privateKey.e), - d: bigIntegerToUintBase64url(privateKey.d), - p: bigIntegerToUintBase64url(privateKey.p), - q: bigIntegerToUintBase64url(privateKey.q), - dp: bigIntegerToUintBase64url(privateKey.dP), - dq: bigIntegerToUintBase64url(privateKey.dQ), - qi: bigIntegerToUintBase64url(privateKey.qInv), - alg: 'RS256', - kid: '2011-04-29' - } -} +/***/ 11602: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -// Convert a JWK key into PKCS#1 in ASN1 DER format -exports.jwkToPkcs1 = function (jwk) { - const asn1 = forge.pki.privateKeyToAsn1({ - n: base64urlToBigInteger(jwk.n), - e: base64urlToBigInteger(jwk.e), - d: base64urlToBigInteger(jwk.d), - p: base64urlToBigInteger(jwk.p), - q: base64urlToBigInteger(jwk.q), - dP: base64urlToBigInteger(jwk.dp), - dQ: base64urlToBigInteger(jwk.dq), - qInv: base64urlToBigInteger(jwk.qi) - }) - return uint8ArrayFromString(forge.asn1.toDer(asn1).getBytes(), 'ascii') -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fromBase64 = void 0; +const util_buffer_from_1 = __nccwpck_require__(39082); +const BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/; +const fromBase64 = (input) => { + if ((input.length * 3) % 4 !== 0) { + throw new TypeError(`Incorrect padding on base64 string.`); + } + if (!BASE64_REGEX.exec(input)) { + throw new TypeError(`Invalid base64 string.`); + } + const buffer = (0, util_buffer_from_1.fromString)(input, "base64"); + return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); +}; +exports.fromBase64 = fromBase64; -// Convert a PKCIX in ASN1 DER format to a JWK key -exports.pkixToJwk = function (bytes) { - const asn1 = forge.asn1.fromDer(uint8ArrayToString(bytes, 'ascii')) - const publicKey = forge.pki.publicKeyFromAsn1(asn1) - return { - kty: 'RSA', - n: bigIntegerToUintBase64url(publicKey.n), - e: bigIntegerToUintBase64url(publicKey.e), - alg: 'RS256', - kid: '2011-04-29' - } -} +/***/ }), -// Convert a JWK key to PKCIX in ASN1 DER format -exports.jwkToPkix = function (jwk) { - const asn1 = forge.pki.publicKeyToAsn1({ - n: base64urlToBigInteger(jwk.n), - e: base64urlToBigInteger(jwk.e) - }) +/***/ 74339: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return uint8ArrayFromString(forge.asn1.toDer(asn1).getBytes(), 'ascii') -} + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(11602), exports); +tslib_1.__exportStar(__nccwpck_require__(91924), exports); /***/ }), -<<<<<<< HEAD -/***/ 51937: -======= -/***/ 23882: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 91924: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toBase64 = void 0; +const util_buffer_from_1 = __nccwpck_require__(39082); +const toBase64 = (input) => (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("base64"); +exports.toBase64 = toBase64; -const crypto = __nccwpck_require__(6113) -const promisify = (__nccwpck_require__(73837).promisify) -<<<<<<< HEAD -const errcode = __nccwpck_require__(22077) -const randomBytes = __nccwpck_require__(34388) -const keypair = promisify(crypto.generateKeyPair) - -exports.utils = __nccwpck_require__(15590) -======= -const errcode = __nccwpck_require__(5822) -const randomBytes = __nccwpck_require__(26409) -const keypair = promisify(crypto.generateKeyPair) -exports.utils = __nccwpck_require__(34219) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ }), -exports.generateKey = async function (bits) { // eslint-disable-line require-await - const key = await keypair('rsa', { - modulusLength: bits, - publicKeyEncoding: { type: 'pkcs1', format: 'jwk' }, - privateKeyEncoding: { type: 'pkcs1', format: 'jwk' } - }) +/***/ 84483: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return { - privateKey: key.privateKey, - publicKey: key.publicKey - } -} -// Takes a jwk key -exports.unmarshalPrivateKey = async function (key) { // eslint-disable-line require-await - if (!key) { - throw errcode(new Error('Missing key parameter'), 'ERR_MISSING_KEY') - } - return { - privateKey: key, - publicKey: { - kty: key.kty, - n: key.n, - e: key.e +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.calculateBodyLength = void 0; +const fs_1 = __nccwpck_require__(57147); +const calculateBodyLength = (body) => { + if (!body) { + return 0; } - } -} - -exports.getRandomValues = randomBytes + if (typeof body === "string") { + return Buffer.from(body).length; + } + else if (typeof body.byteLength === "number") { + return body.byteLength; + } + else if (typeof body.size === "number") { + return body.size; + } + else if (typeof body.start === "number" && typeof body.end === "number") { + return body.end + 1 - body.start; + } + else if (typeof body.path === "string" || Buffer.isBuffer(body.path)) { + return (0, fs_1.lstatSync)(body.path).size; + } + else if (typeof body.fd === "number") { + return (0, fs_1.fstatSync)(body.fd).size; + } + throw new Error(`Body Length computation failed for ${body}`); +}; +exports.calculateBodyLength = calculateBodyLength; -exports.hashAndSign = async function (key, msg) { // eslint-disable-line require-await - return crypto.createSign('RSA-SHA256') - .update(msg) - .sign({ format: 'jwk', key: key }) -} -exports.hashAndVerify = async function (key, sig, msg) { // eslint-disable-line require-await - return crypto.createVerify('RSA-SHA256') - .update(msg) - .verify({ format: 'jwk', key: key }, sig) -} +/***/ }), -const padding = crypto.constants.RSA_PKCS1_PADDING +/***/ 92711: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -exports.encrypt = function (key, bytes) { - return crypto.publicEncrypt({ format: 'jwk', key, padding }, bytes) -} -exports.decrypt = function (key, bytes) { - return crypto.privateDecrypt({ format: 'jwk', key, padding }, bytes) -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(84483), exports); /***/ }), -<<<<<<< HEAD -/***/ 56976: -======= -/***/ 84968: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 39082: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fromString = exports.fromArrayBuffer = void 0; +const is_array_buffer_1 = __nccwpck_require__(52807); +const buffer_1 = __nccwpck_require__(14300); +const fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => { + if (!(0, is_array_buffer_1.isArrayBuffer)(input)) { + throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); + } + return buffer_1.Buffer.from(input, offset, length); +}; +exports.fromArrayBuffer = fromArrayBuffer; +const fromString = (input, encoding) => { + if (typeof input !== "string") { + throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`); + } + return encoding ? buffer_1.Buffer.from(input, encoding) : buffer_1.Buffer.from(input); +}; +exports.fromString = fromString; +/***/ }), -<<<<<<< HEAD -const { sha256 } = __nccwpck_require__(65484) -const errcode = __nccwpck_require__(22077) -const { equals: uint8ArrayEquals } = __nccwpck_require__(12667) -const { toString: uint8ArrayToString } = __nccwpck_require__(34163) +/***/ 33885: +/***/ ((__unused_webpack_module, exports) => { -const exporter = __nccwpck_require__(26048) -module.exports = (keysProtobuf, randomBytes, crypto) => { - crypto = crypto || __nccwpck_require__(31753)() -======= -const { sha256 } = __nccwpck_require__(80960) -const errcode = __nccwpck_require__(5822) -const { equals: uint8ArrayEquals } = __nccwpck_require__(94646) -const { toString: uint8ArrayToString } = __nccwpck_require__(2771) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.booleanSelector = void 0; +const booleanSelector = (obj, key, type) => { + if (!(key in obj)) + return undefined; + if (obj[key] === "true") + return true; + if (obj[key] === "false") + return false; + throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`); +}; +exports.booleanSelector = booleanSelector; -const exporter = __nccwpck_require__(76630) -module.exports = (keysProtobuf, randomBytes, crypto) => { - crypto = crypto || __nccwpck_require__(22831)() ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ }), - class Secp256k1PublicKey { - constructor (key) { - crypto.validatePublicKey(key) - this._key = key - } +/***/ 54822: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - verify (data, sig) { - return crypto.hashAndVerify(this._key, sig, data) - } - marshal () { - return crypto.compressPublicKey(this._key) - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(33885), exports); +tslib_1.__exportStar(__nccwpck_require__(45014), exports); +tslib_1.__exportStar(__nccwpck_require__(40341), exports); - get bytes () { - return keysProtobuf.PublicKey.encode({ - Type: keysProtobuf.KeyType.Secp256k1, - Data: this.marshal() - }).finish() - } - equals (key) { - return uint8ArrayEquals(this.bytes, key.bytes) - } +/***/ }), - async hash () { - const { bytes } = await sha256.digest(this.bytes) +/***/ 45014: +/***/ ((__unused_webpack_module, exports) => { - return bytes - } - } - class Secp256k1PrivateKey { - constructor (key, publicKey) { - this._key = key - this._publicKey = publicKey || crypto.computePublicKey(key) - crypto.validatePrivateKey(this._key) - crypto.validatePublicKey(this._publicKey) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.numberSelector = void 0; +const numberSelector = (obj, key, type) => { + if (!(key in obj)) + return undefined; + const numberValue = parseInt(obj[key], 10); + if (Number.isNaN(numberValue)) { + throw new TypeError(`Cannot load ${type} '${key}'. Expected number, got '${obj[key]}'.`); } + return numberValue; +}; +exports.numberSelector = numberSelector; - sign (message) { - return crypto.hashAndSign(this._key, message) - } - get public () { - return new Secp256k1PublicKey(this._publicKey) - } +/***/ }), - marshal () { - return this._key - } +/***/ 40341: +/***/ ((__unused_webpack_module, exports) => { - get bytes () { - return keysProtobuf.PrivateKey.encode({ - Type: keysProtobuf.KeyType.Secp256k1, - Data: this.marshal() - }).finish() - } - equals (key) { - return uint8ArrayEquals(this.bytes, key.bytes) - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SelectorType = void 0; +var SelectorType; +(function (SelectorType) { + SelectorType["ENV"] = "env"; + SelectorType["CONFIG"] = "shared config entry"; +})(SelectorType = exports.SelectorType || (exports.SelectorType = {})); - async hash () { - const { bytes } = await sha256.digest(this.bytes) - return bytes - } +/***/ }), - /** - * Gets the ID of the key. - * - * The key id is the base58 encoding of the SHA-256 multihash of its public key. - * The public key is a protobuf encoding containing a type and the DER encoding - * of the PKCS SubjectPublicKeyInfo. - * - * @returns {Promise} - */ - async id () { - const hash = await this.public.hash() - return uint8ArrayToString(hash, 'base58btc') - } +/***/ 3341: +/***/ ((__unused_webpack_module, exports) => { - /** - * Exports the key into a password protected `format` - * - * @param {string} password - The password to encrypt the key - * @param {string} [format=libp2p-key] - The format in which to export as - * @returns {Promise} The encrypted private key - */ - async export (password, format = 'libp2p-key') { // eslint-disable-line require-await - if (format === 'libp2p-key') { - return exporter.export(this.bytes, password) - } else { - throw errcode(new Error(`export format '${format}' is not supported`), 'ERR_INVALID_EXPORT_FORMAT') - } - } - } - function unmarshalSecp256k1PrivateKey (bytes) { - return new Secp256k1PrivateKey(bytes) - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.IMDS_REGION_PATH = exports.DEFAULTS_MODE_OPTIONS = exports.ENV_IMDS_DISABLED = exports.AWS_DEFAULT_REGION_ENV = exports.AWS_REGION_ENV = exports.AWS_EXECUTION_ENV = void 0; +exports.AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV"; +exports.AWS_REGION_ENV = "AWS_REGION"; +exports.AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION"; +exports.ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; +exports.DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"]; +exports.IMDS_REGION_PATH = "/latest/meta-data/placement/region"; - function unmarshalSecp256k1PublicKey (bytes) { - return new Secp256k1PublicKey(bytes) - } - async function generateKeyPair () { - const privateKeyBytes = await crypto.generateKey() - return new Secp256k1PrivateKey(privateKeyBytes) - } +/***/ }), - return { - Secp256k1PublicKey, - Secp256k1PrivateKey, - unmarshalSecp256k1PrivateKey, - unmarshalSecp256k1PublicKey, - generateKeyPair - } -} +/***/ 82411: +/***/ ((__unused_webpack_module, exports) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NODE_DEFAULTS_MODE_CONFIG_OPTIONS = void 0; +const AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE"; +const AWS_DEFAULTS_MODE_CONFIG = "defaults_mode"; +exports.NODE_DEFAULTS_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => { + return env[AWS_DEFAULTS_MODE_ENV]; + }, + configFileSelector: (profile) => { + return profile[AWS_DEFAULTS_MODE_CONFIG]; + }, + default: "legacy", +}; /***/ }), -<<<<<<< HEAD -/***/ 31753: -======= -/***/ 22831: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 3147: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(33614), exports); -<<<<<<< HEAD -const errcode = __nccwpck_require__(22077) -const secp = __nccwpck_require__(14681) -const { sha256 } = __nccwpck_require__(65484) -======= -const errcode = __nccwpck_require__(5822) -const secp = __nccwpck_require__(61163) -const { sha256 } = __nccwpck_require__(80960) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -module.exports = () => { - const privateKeyLength = 32 +/***/ }), - function generateKey () { - return secp.utils.randomPrivateKey() - } +/***/ 33614: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Hash and sign message with private key - * - * @param {number | bigint | (string | Uint8Array)} key - * @param {Uint8Array} msg - */ - async function hashAndSign (key, msg) { - const { digest } = await sha256.digest(msg) - try { - return await secp.sign(digest, key) - } catch (err) { - throw errcode(err, 'ERR_INVALID_INPUT') - } - } - /** - * Hash message and verify signature with public key - * - * @param {secp.Point | (string | Uint8Array)} key - * @param {(string | Uint8Array) | secp.Signature} sig - * @param {Uint8Array} msg - */ - async function hashAndVerify (key, sig, msg) { - try { - const { digest } = await sha256.digest(msg) - return secp.verify(sig, digest, key) - } catch (err) { - throw errcode(err, 'ERR_INVALID_INPUT') +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.resolveDefaultsModeConfig = void 0; +const config_resolver_1 = __nccwpck_require__(36407); +const credential_provider_imds_1 = __nccwpck_require__(95815); +const node_config_provider_1 = __nccwpck_require__(86711); +const property_provider_1 = __nccwpck_require__(60846); +const constants_1 = __nccwpck_require__(3341); +const defaultsModeConfig_1 = __nccwpck_require__(82411); +const resolveDefaultsModeConfig = ({ region = (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS), defaultsMode = (0, node_config_provider_1.loadConfig)(defaultsModeConfig_1.NODE_DEFAULTS_MODE_CONFIG_OPTIONS), } = {}) => (0, property_provider_1.memoize)(async () => { + const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode; + switch (mode === null || mode === void 0 ? void 0 : mode.toLowerCase()) { + case "auto": + return resolveNodeDefaultsModeAuto(region); + case "in-region": + case "cross-region": + case "mobile": + case "standard": + case "legacy": + return Promise.resolve(mode === null || mode === void 0 ? void 0 : mode.toLocaleLowerCase()); + case undefined: + return Promise.resolve("legacy"); + default: + throw new Error(`Invalid parameter for "defaultsMode", expect ${constants_1.DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`); + } +}); +exports.resolveDefaultsModeConfig = resolveDefaultsModeConfig; +const resolveNodeDefaultsModeAuto = async (clientRegion) => { + if (clientRegion) { + const resolvedRegion = typeof clientRegion === "function" ? await clientRegion() : clientRegion; + const inferredRegion = await inferPhysicalRegion(); + if (!inferredRegion) { + return "standard"; + } + if (resolvedRegion === inferredRegion) { + return "in-region"; + } + else { + return "cross-region"; + } + } + return "standard"; +}; +const inferPhysicalRegion = async () => { + var _a; + if (process.env[constants_1.AWS_EXECUTION_ENV] && (process.env[constants_1.AWS_REGION_ENV] || process.env[constants_1.AWS_DEFAULT_REGION_ENV])) { + return (_a = process.env[constants_1.AWS_REGION_ENV]) !== null && _a !== void 0 ? _a : process.env[constants_1.AWS_DEFAULT_REGION_ENV]; + } + if (!process.env[constants_1.ENV_IMDS_DISABLED]) { + try { + const endpoint = await (0, credential_provider_imds_1.getInstanceMetadataEndpoint)(); + return (await (0, credential_provider_imds_1.httpRequest)({ ...endpoint, path: constants_1.IMDS_REGION_PATH })).toString(); + } + catch (e) { + } } - } - - function compressPublicKey (key) { - const point = secp.Point.fromHex(key).toRawBytes(true) - return point - } +}; - function decompressPublicKey (key) { - const point = secp.Point.fromHex(key).toRawBytes(false) - return point - } - function validatePrivateKey (key) { - try { - secp.getPublicKey(key, true) - } catch (err) { - throw errcode(err, 'ERR_INVALID_PRIVATE_KEY') - } - } +/***/ }), - function validatePublicKey (key) { - try { - secp.Point.fromHex(key) - } catch (err) { - throw errcode(err, 'ERR_INVALID_PUBLIC_KEY') - } - } +/***/ 10787: +/***/ ((__unused_webpack_module, exports) => { - function computePublicKey (privateKey) { - try { - return secp.getPublicKey(privateKey, true) - } catch (err) { - throw errcode(err, 'ERR_INVALID_PRIVATE_KEY') - } - } - return { - generateKey, - privateKeyLength, - hashAndSign, - hashAndVerify, - compressPublicKey, - decompressPublicKey, - validatePrivateKey, - validatePublicKey, - computePublicKey - } -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.debugId = void 0; +exports.debugId = "endpoints"; /***/ }), -<<<<<<< HEAD -/***/ 82432: -======= -/***/ 52410: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 94353: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(10787), exports); +tslib_1.__exportStar(__nccwpck_require__(90822), exports); -<<<<<<< HEAD -const errcode = __nccwpck_require__(22077) -======= -const errcode = __nccwpck_require__(5822) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -module.exports = function (curveTypes, type) { - if (!curveTypes.includes(type)) { - const names = curveTypes.join(' / ') - throw errcode(new Error(`Unknown curve: ${type}. Must be ${names}`), 'ERR_INVALID_CURVE') - } +/***/ }), + +/***/ 90822: +/***/ ((__unused_webpack_module, exports) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toDebugString = void 0; +function toDebugString(input) { + if (typeof input !== "object" || input == null) { + return input; + } + if ("ref" in input) { + return `$${toDebugString(input.ref)}`; + } + if ("fn" in input) { + return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`; + } + return JSON.stringify(input, null, 2); } +exports.toDebugString = toDebugString; /***/ }), -<<<<<<< HEAD -/***/ 34388: -======= -/***/ 26409: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 34863: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -<<<<<<< HEAD -const randomBytes = __nccwpck_require__(27419) -const errcode = __nccwpck_require__(22077) -======= -const randomBytes = __nccwpck_require__(51252) -const errcode = __nccwpck_require__(5822) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(86920), exports); +tslib_1.__exportStar(__nccwpck_require__(96877), exports); +tslib_1.__exportStar(__nccwpck_require__(27738), exports); +tslib_1.__exportStar(__nccwpck_require__(16641), exports); +tslib_1.__exportStar(__nccwpck_require__(54947), exports); -module.exports = function (length) { - if (isNaN(length) || length <= 0) { - throw errcode(new Error('random bytes length must be a Number bigger than 0'), 'ERR_INVALID_LENGTH') - } - return randomBytes(length) -} + +/***/ }), + +/***/ 85877: +/***/ ((__unused_webpack_module, exports) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.booleanEquals = void 0; +const booleanEquals = (value1, value2) => value1 === value2; +exports.booleanEquals = booleanEquals; /***/ }), -<<<<<<< HEAD -/***/ 44257: -======= -/***/ 85216: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 10746: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getAttr = void 0; +const types_1 = __nccwpck_require__(54947); +const getAttrPathList_1 = __nccwpck_require__(81091); +const getAttr = (value, path) => (0, getAttrPathList_1.getAttrPathList)(path).reduce((acc, index) => { + if (typeof acc !== "object") { + throw new types_1.EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`); + } + else if (Array.isArray(acc)) { + return acc[parseInt(index)]; + } + return acc[index]; +}, value); +exports.getAttr = getAttr; -<<<<<<< HEAD -__nccwpck_require__(19239) -__nccwpck_require__(21686) -const forge = __nccwpck_require__(72177) -const { fromString: uint8ArrayFromString } = __nccwpck_require__(31277) -const { toString: uint8ArrayToString } = __nccwpck_require__(34163) -const { concat: uint8ArrayConcat } = __nccwpck_require__(64010) -======= -__nccwpck_require__(36536) -__nccwpck_require__(121) -const forge = __nccwpck_require__(96630) -const { fromString: uint8ArrayFromString } = __nccwpck_require__(39451) -const { toString: uint8ArrayToString } = __nccwpck_require__(2771) -const { concat: uint8ArrayConcat } = __nccwpck_require__(17225) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -exports.bigIntegerToUintBase64url = (num, len) => { - // Call `.abs()` to convert to unsigned - let buf = Uint8Array.from(num.abs().toByteArray()) // toByteArray converts to big endian +/***/ }), - // toByteArray() gives us back a signed array, which will include a leading 0 - // byte if the most significant bit of the number is 1: - // https://docs.microsoft.com/en-us/windows/win32/seccertenroll/about-integer - // Our number will always be positive so we should remove the leading padding. - buf = buf[0] === 0 ? buf.slice(1) : buf +/***/ 81091: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (len != null) { - if (buf.length > len) throw new Error('byte array longer than desired length') - buf = uint8ArrayConcat([new Uint8Array(len - buf.length), buf]) - } - return uint8ArrayToString(buf, 'base64url') -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getAttrPathList = void 0; +const types_1 = __nccwpck_require__(54947); +const getAttrPathList = (path) => { + const parts = path.split("."); + const pathList = []; + for (const part of parts) { + const squareBracketIndex = part.indexOf("["); + if (squareBracketIndex !== -1) { + if (part.indexOf("]") !== part.length - 1) { + throw new types_1.EndpointError(`Path: '${path}' does not end with ']'`); + } + const arrayIndex = part.slice(squareBracketIndex + 1, -1); + if (Number.isNaN(parseInt(arrayIndex))) { + throw new types_1.EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`); + } + if (squareBracketIndex !== 0) { + pathList.push(part.slice(0, squareBracketIndex)); + } + pathList.push(arrayIndex); + } + else { + pathList.push(part); + } + } + return pathList; +}; +exports.getAttrPathList = getAttrPathList; -// Convert a base64url encoded string to a BigInteger -exports.base64urlToBigInteger = str => { - const buf = exports.base64urlToBuffer(str) - return new forge.jsbn.BigInteger(uint8ArrayToString(buf, 'base16'), 16) -} -exports.base64urlToBuffer = (str, len) => { - let buf = uint8ArrayFromString(str, 'base64urlpad') +/***/ }), - if (len != null) { - if (buf.length > len) throw new Error('byte array longer than desired length') - buf = uint8ArrayConcat([new Uint8Array(len - buf.length), buf]) - } +/***/ 1066: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return buf -} + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(85877), exports); +tslib_1.__exportStar(__nccwpck_require__(10746), exports); +tslib_1.__exportStar(__nccwpck_require__(10830), exports); +tslib_1.__exportStar(__nccwpck_require__(96877), exports); +tslib_1.__exportStar(__nccwpck_require__(24334), exports); +tslib_1.__exportStar(__nccwpck_require__(84966), exports); +tslib_1.__exportStar(__nccwpck_require__(56496), exports); +tslib_1.__exportStar(__nccwpck_require__(5023), exports); +tslib_1.__exportStar(__nccwpck_require__(56161), exports); /***/ }), -<<<<<<< HEAD -/***/ 67270: -======= -/***/ 79139: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) { +/***/ 86920: +/***/ ((__unused_webpack_module, exports) => { -<<<<<<< HEAD -const isOptionObject = __nccwpck_require__(94978); -======= -const isOptionObject = __nccwpck_require__(87873); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isIpAddress = void 0; +const IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`); +const isIpAddress = (value) => IP_V4_REGEX.test(value) || (value.startsWith("[") && value.endsWith("]")); +exports.isIpAddress = isIpAddress; -const {hasOwnProperty} = Object.prototype; -const {propertyIsEnumerable} = Object; -const defineProperty = (object, name, value) => Object.defineProperty(object, name, { - value, - writable: true, - enumerable: true, - configurable: true -}); -const globalThis = this; -const defaultMergeOptions = { - concatArrays: false, - ignoreUndefined: false -}; +/***/ }), -const getEnumerableOwnPropertyKeys = value => { - const keys = []; +/***/ 10830: +/***/ ((__unused_webpack_module, exports) => { - for (const key in value) { - if (hasOwnProperty.call(value, key)) { - keys.push(key); - } - } - /* istanbul ignore else */ - if (Object.getOwnPropertySymbols) { - const symbols = Object.getOwnPropertySymbols(value); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isSet = void 0; +const isSet = (value) => value != null; +exports.isSet = isSet; - for (const symbol of symbols) { - if (propertyIsEnumerable.call(value, symbol)) { - keys.push(symbol); - } - } - } - return keys; -}; +/***/ }), -function clone(value) { - if (Array.isArray(value)) { - return cloneArray(value); - } +/***/ 96877: +/***/ ((__unused_webpack_module, exports) => { - if (isOptionObject(value)) { - return cloneOptionObject(value); - } - return value; -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isValidHostLabel = void 0; +const VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`); +const isValidHostLabel = (value, allowSubDomains = false) => { + if (!allowSubDomains) { + return VALID_HOST_LABEL_REGEX.test(value); + } + const labels = value.split("."); + for (const label of labels) { + if (!(0, exports.isValidHostLabel)(label)) { + return false; + } + } + return true; +}; +exports.isValidHostLabel = isValidHostLabel; -function cloneArray(array) { - const result = array.slice(0, 0); - getEnumerableOwnPropertyKeys(array).forEach(key => { - defineProperty(result, key, clone(array[key])); - }); +/***/ }), - return result; -} +/***/ 24334: +/***/ ((__unused_webpack_module, exports) => { -function cloneOptionObject(object) { - const result = Object.getPrototypeOf(object) === null ? Object.create(null) : {}; - getEnumerableOwnPropertyKeys(object).forEach(key => { - defineProperty(result, key, clone(object[key])); - }); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.not = void 0; +const not = (value) => !value; +exports.not = not; - return result; -} -/** - * @param {*} merged already cloned - * @param {*} source something to merge - * @param {string[]} keys keys to merge - * @param {Object} config Config Object - * @returns {*} cloned Object - */ -const mergeKeys = (merged, source, keys, config) => { - keys.forEach(key => { - if (typeof source[key] === 'undefined' && config.ignoreUndefined) { - return; - } +/***/ }), - // Do not recurse into prototype chain of merged - if (key in merged && merged[key] !== Object.getPrototypeOf(merged)) { - defineProperty(merged, key, merge(merged[key], source[key], config)); - } else { - defineProperty(merged, key, clone(source[key])); - } - }); +/***/ 84966: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return merged; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseURL = void 0; +const types_1 = __nccwpck_require__(21438); +const isIpAddress_1 = __nccwpck_require__(86920); +const DEFAULT_PORTS = { + [types_1.EndpointURLScheme.HTTP]: 80, + [types_1.EndpointURLScheme.HTTPS]: 443, +}; +const parseURL = (value) => { + const whatwgURL = (() => { + try { + if (value instanceof URL) { + return value; + } + if (typeof value === "object" && "hostname" in value) { + const { hostname, port, protocol = "", path = "", query = {} } = value; + const url = new URL(`${protocol}//${hostname}${port ? `:${port}` : ""}${path}`); + url.search = Object.entries(query) + .map(([k, v]) => `${k}=${v}`) + .join("&"); + return url; + } + return new URL(value); + } + catch (error) { + return null; + } + })(); + if (!whatwgURL) { + console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`); + return null; + } + const urlString = whatwgURL.href; + const { host, hostname, pathname, protocol, search } = whatwgURL; + if (search) { + return null; + } + const scheme = protocol.slice(0, -1); + if (!Object.values(types_1.EndpointURLScheme).includes(scheme)) { + return null; + } + const isIp = (0, isIpAddress_1.isIpAddress)(hostname); + const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) || + (typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`)); + const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`; + return { + scheme, + authority, + path: pathname, + normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`, + isIp, + }; }; +exports.parseURL = parseURL; -/** - * @param {*} merged already cloned - * @param {*} source something to merge - * @param {Object} config Config Object - * @returns {*} cloned Object - * - * see [Array.prototype.concat ( ...arguments )](http://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.concat) - */ -const concatArrays = (merged, source, config) => { - let result = merged.slice(0, 0); - let resultIndex = 0; - [merged, source].forEach(array => { - const indices = []; +/***/ }), - // `result.concat(array)` with cloning - for (let k = 0; k < array.length; k++) { - if (!hasOwnProperty.call(array, k)) { - continue; - } +/***/ 56496: +/***/ ((__unused_webpack_module, exports) => { - indices.push(String(k)); - if (array === merged) { - // Already cloned - defineProperty(result, resultIndex++, array[k]); - } else { - defineProperty(result, resultIndex++, clone(array[k])); - } - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.stringEquals = void 0; +const stringEquals = (value1, value2) => value1 === value2; +exports.stringEquals = stringEquals; - // Merge non-index keys - result = mergeKeys(result, array, getEnumerableOwnPropertyKeys(array).filter(key => !indices.includes(key)), config); - }); - return result; +/***/ }), + +/***/ 5023: +/***/ ((__unused_webpack_module, exports) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.substring = void 0; +const substring = (input, start, stop, reverse) => { + if (start >= stop || input.length < stop) { + return null; + } + if (!reverse) { + return input.substring(start, stop); + } + return input.substring(input.length - stop, input.length - start); }; +exports.substring = substring; -/** - * @param {*} merged already cloned - * @param {*} source something to merge - * @param {Object} config Config Object - * @returns {*} cloned Object - */ -function merge(merged, source, config) { - if (config.concatArrays && Array.isArray(merged) && Array.isArray(source)) { - return concatArrays(merged, source, config); - } - if (!isOptionObject(source) || !isOptionObject(merged)) { - return clone(source); - } +/***/ }), - return mergeKeys(merged, source, getEnumerableOwnPropertyKeys(source), config); -} +/***/ 56161: +/***/ ((__unused_webpack_module, exports) => { -module.exports = function (...options) { - const config = merge(clone(defaultMergeOptions), (this !== globalThis && this) || {}, defaultMergeOptions); - let merged = {_: {}}; - for (const option of options) { - if (option === undefined) { - continue; - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.uriEncode = void 0; +const uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`); +exports.uriEncode = uriEncode; - if (!isOptionObject(option)) { - throw new TypeError('`' + option + '` is not an Option Object'); - } - merged = merge(merged, {_: option}, config); - } +/***/ }), - return merged._; +/***/ 16641: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.resolveEndpoint = void 0; +const debug_1 = __nccwpck_require__(94353); +const types_1 = __nccwpck_require__(54947); +const utils_1 = __nccwpck_require__(96340); +const resolveEndpoint = (ruleSetObject, options) => { + var _a, _b, _c, _d, _e, _f; + const { endpointParams, logger } = options; + const { parameters, rules } = ruleSetObject; + (_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, `${debug_1.debugId} Initial EndpointParams: ${(0, debug_1.toDebugString)(endpointParams)}`); + const paramsWithDefault = Object.entries(parameters) + .filter(([, v]) => v.default != null) + .map(([k, v]) => [k, v.default]); + if (paramsWithDefault.length > 0) { + for (const [paramKey, paramDefaultValue] of paramsWithDefault) { + endpointParams[paramKey] = (_c = endpointParams[paramKey]) !== null && _c !== void 0 ? _c : paramDefaultValue; + } + } + const requiredParams = Object.entries(parameters) + .filter(([, v]) => v.required) + .map(([k]) => k); + for (const requiredParam of requiredParams) { + if (endpointParams[requiredParam] == null) { + throw new types_1.EndpointError(`Missing required parameter: '${requiredParam}'`); + } + } + const endpoint = (0, utils_1.evaluateRules)(rules, { endpointParams, logger, referenceRecord: {} }); + if ((_d = options.endpointParams) === null || _d === void 0 ? void 0 : _d.Endpoint) { + try { + const givenEndpoint = new URL(options.endpointParams.Endpoint); + const { protocol, port } = givenEndpoint; + endpoint.url.protocol = protocol; + endpoint.url.port = port; + } + catch (e) { + } + } + (_f = (_e = options.logger) === null || _e === void 0 ? void 0 : _e.debug) === null || _f === void 0 ? void 0 : _f.call(_e, `${debug_1.debugId} Resolved endpoint: ${(0, debug_1.toDebugString)(endpoint)}`); + return endpoint; }; +exports.resolveEndpoint = resolveEndpoint; /***/ }), -<<<<<<< HEAD -/***/ 26676: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -/*! - * mime-db - * Copyright(c) 2014 Jonathan Ong - * MIT Licensed - */ +/***/ 32108: +/***/ ((__unused_webpack_module, exports) => { -/** - * Module exports. - */ -module.exports = __nccwpck_require__(53765) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.EndpointError = void 0; +class EndpointError extends Error { + constructor(message) { + super(message); + this.name = "EndpointError"; + } +} +exports.EndpointError = EndpointError; /***/ }), -/***/ 21919: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 25766: +/***/ ((__unused_webpack_module, exports) => { -/*! - * mime-types - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ +Object.defineProperty(exports, "__esModule", ({ value: true })); -/** - * Module dependencies. - * @private - */ +/***/ }), -var db = __nccwpck_require__(26676) -var extname = (__nccwpck_require__(71017).extname) +/***/ 7260: +/***/ ((__unused_webpack_module, exports) => { -/** - * Module variables. - * @private - */ -var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/ -var TEXT_TYPE_REGEXP = /^text\//i +Object.defineProperty(exports, "__esModule", ({ value: true })); -/** - * Module exports. - * @public - */ -exports.charset = charset -exports.charsets = { lookup: charset } -exports.contentType = contentType -exports.extension = extension -exports.extensions = Object.create(null) -exports.lookup = lookup -exports.types = Object.create(null) +/***/ }), -// Populate the extensions/types maps -populateMaps(exports.extensions, exports.types) +/***/ 5673: +/***/ ((__unused_webpack_module, exports) => { -/** - * Get the default charset for a MIME type. - * - * @param {string} type - * @return {boolean|string} - */ -function charset (type) { - if (!type || typeof type !== 'string') { - return false - } +Object.defineProperty(exports, "__esModule", ({ value: true })); - // TODO: use media-typer - var match = EXTRACT_TYPE_REGEXP.exec(type) - var mime = match && db[match[1].toLowerCase()] - if (mime && mime.charset) { - return mime.charset - } +/***/ }), - // default text/* to utf-8 - if (match && TEXT_TYPE_REGEXP.test(match[1])) { - return 'UTF-8' - } +/***/ 74271: +/***/ ((__unused_webpack_module, exports) => { - return false -} -/** - * Create a full Content-Type header given a MIME type or extension. - * - * @param {string} str - * @return {boolean|string} - */ +Object.defineProperty(exports, "__esModule", ({ value: true })); -function contentType (str) { - // TODO: should this even be in this module? - if (!str || typeof str !== 'string') { - return false - } - var mime = str.indexOf('/') === -1 - ? exports.lookup(str) - : str +/***/ }), - if (!mime) { - return false - } +/***/ 46646: +/***/ ((__unused_webpack_module, exports) => { - // TODO: use content-type or other module - if (mime.indexOf('charset') === -1) { - var charset = exports.charset(mime) - if (charset) mime += '; charset=' + charset.toLowerCase() - } - return mime -} +Object.defineProperty(exports, "__esModule", ({ value: true })); -/** - * Get the default extension for a MIME type. - * - * @param {string} type - * @return {boolean|string} - */ -function extension (type) { - if (!type || typeof type !== 'string') { - return false - } +/***/ }), - // TODO: use media-typer - var match = EXTRACT_TYPE_REGEXP.exec(type) +/***/ 54947: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // get extensions - var exts = match && exports.extensions[match[1].toLowerCase()] - if (!exts || !exts.length) { - return false - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(32108), exports); +tslib_1.__exportStar(__nccwpck_require__(25766), exports); +tslib_1.__exportStar(__nccwpck_require__(7260), exports); +tslib_1.__exportStar(__nccwpck_require__(5673), exports); +tslib_1.__exportStar(__nccwpck_require__(74271), exports); +tslib_1.__exportStar(__nccwpck_require__(46646), exports); +tslib_1.__exportStar(__nccwpck_require__(52889), exports); - return exts[0] -} -/** - * Lookup the MIME type for a file path/extension. - * - * @param {string} path - * @return {boolean|string} - */ +/***/ }), -function lookup (path) { - if (!path || typeof path !== 'string') { - return false - } +/***/ 52889: +/***/ ((__unused_webpack_module, exports) => { - // get the extension ("ext" or ".ext" or full path) - var extension = extname('x.' + path) - .toLowerCase() - .substr(1) - if (!extension) { - return false - } +Object.defineProperty(exports, "__esModule", ({ value: true })); - return exports.types[extension] || false -} -/** - * Populate the extensions and types maps. - * @private - */ +/***/ }), -function populateMaps (extensions, types) { - // source preference (least -> most) - var preference = ['nginx', 'apache', undefined, 'iana'] +/***/ 15260: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - Object.keys(db).forEach(function forEachMimeType (type) { - var mime = db[type] - var exts = mime.extensions - if (!exts || !exts.length) { - return +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.callFunction = void 0; +const customEndpointFunctions_1 = __nccwpck_require__(27738); +const endpointFunctions_1 = __nccwpck_require__(70794); +const evaluateExpression_1 = __nccwpck_require__(4822); +const callFunction = ({ fn, argv }, options) => { + const evaluatedArgs = argv.map((arg) => ["boolean", "number"].includes(typeof arg) ? arg : (0, evaluateExpression_1.evaluateExpression)(arg, "arg", options)); + const fnSegments = fn.split("."); + if (fnSegments[0] in customEndpointFunctions_1.customEndpointFunctions && fnSegments[1] != null) { + return customEndpointFunctions_1.customEndpointFunctions[fnSegments[0]][fnSegments[1]](...evaluatedArgs); } + return endpointFunctions_1.endpointFunctions[fn](...evaluatedArgs); +}; +exports.callFunction = callFunction; - // mime -> extensions - extensions[type] = exts - // extension -> mime - for (var i = 0; i < exts.length; i++) { - var extension = exts[i] +/***/ }), - if (types[extension]) { - var from = preference.indexOf(db[types[extension]].source) - var to = preference.indexOf(mime.source) +/***/ 27738: +/***/ ((__unused_webpack_module, exports) => { - if (types[extension] !== 'application/octet-stream' && - (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) { - // skip the remapping - continue - } - } - // set the extension -> mime - types[extension] = type - } - }) -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.customEndpointFunctions = void 0; +exports.customEndpointFunctions = {}; /***/ }), -/***/ 10771: -======= -/***/ 71111: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 70794: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -module.exports = minimatch -minimatch.Minimatch = Minimatch -var path = (function () { try { return __nccwpck_require__(71017) } catch (e) {}}()) || { - sep: '/' -} -minimatch.sep = path.sep +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.endpointFunctions = void 0; +const lib_1 = __nccwpck_require__(1066); +exports.endpointFunctions = { + booleanEquals: lib_1.booleanEquals, + getAttr: lib_1.getAttr, + isSet: lib_1.isSet, + isValidHostLabel: lib_1.isValidHostLabel, + not: lib_1.not, + parseURL: lib_1.parseURL, + stringEquals: lib_1.stringEquals, + substring: lib_1.substring, + uriEncode: lib_1.uriEncode, +}; -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -<<<<<<< HEAD -var expand = __nccwpck_require__(3263) -======= -var expand = __nccwpck_require__(73594) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -var plTypes = { - '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, - '?': { open: '(?:', close: ')?' }, - '+': { open: '(?:', close: ')+' }, - '*': { open: '(?:', close: ')*' }, - '@': { open: '(?:', close: ')' } -} +/***/ }), -// any single thing other than / -// don't need to escape / when using new RegExp() -var qmark = '[^/]' +/***/ 56675: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -// * => any number of characters -var star = qmark + '*?' -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.evaluateCondition = void 0; +const debug_1 = __nccwpck_require__(94353); +const types_1 = __nccwpck_require__(54947); +const callFunction_1 = __nccwpck_require__(15260); +const evaluateCondition = ({ assign, ...fnArgs }, options) => { + var _a, _b; + if (assign && assign in options.referenceRecord) { + throw new types_1.EndpointError(`'${assign}' is already defined in Reference Record.`); + } + const value = (0, callFunction_1.callFunction)(fnArgs, options); + (_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, debug_1.debugId, `evaluateCondition: ${(0, debug_1.toDebugString)(fnArgs)} = ${(0, debug_1.toDebugString)(value)}`); + return { + result: value === "" ? true : !!value, + ...(assign != null && { toAssign: { name: assign, value } }), + }; +}; +exports.evaluateCondition = evaluateCondition; -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') +/***/ }), -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} +/***/ 16618: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -// normalizes slashes. -var slashSplit = /\/+/ -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.evaluateConditions = void 0; +const debug_1 = __nccwpck_require__(94353); +const evaluateCondition_1 = __nccwpck_require__(56675); +const evaluateConditions = (conditions = [], options) => { + var _a, _b; + const conditionsReferenceRecord = {}; + for (const condition of conditions) { + const { result, toAssign } = (0, evaluateCondition_1.evaluateCondition)(condition, { + ...options, + referenceRecord: { + ...options.referenceRecord, + ...conditionsReferenceRecord, + }, + }); + if (!result) { + return { result }; + } + if (toAssign) { + conditionsReferenceRecord[toAssign.name] = toAssign.value; + (_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, debug_1.debugId, `assign: ${toAssign.name} := ${(0, debug_1.toDebugString)(toAssign.value)}`); + } + } + return { result: true, referenceRecord: conditionsReferenceRecord }; +}; +exports.evaluateConditions = evaluateConditions; -function ext (a, b) { - b = b || {} - var t = {} - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - return t -} -minimatch.defaults = function (def) { - if (!def || typeof def !== 'object' || !Object.keys(def).length) { - return minimatch - } +/***/ }), - var orig = minimatch +/***/ 71801: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - var m = function minimatch (p, pattern, options) { - return orig(p, pattern, ext(def, options)) - } - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - m.Minimatch.defaults = function defaults (options) { - return orig.defaults(ext(def, options)).Minimatch - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.evaluateEndpointRule = void 0; +const debug_1 = __nccwpck_require__(94353); +const evaluateConditions_1 = __nccwpck_require__(16618); +const getEndpointHeaders_1 = __nccwpck_require__(8093); +const getEndpointProperties_1 = __nccwpck_require__(6490); +const getEndpointUrl_1 = __nccwpck_require__(9721); +const evaluateEndpointRule = (endpointRule, options) => { + var _a, _b; + const { conditions, endpoint } = endpointRule; + const { result, referenceRecord } = (0, evaluateConditions_1.evaluateConditions)(conditions, options); + if (!result) { + return; + } + const endpointRuleOptions = { + ...options, + referenceRecord: { ...options.referenceRecord, ...referenceRecord }, + }; + const { url, properties, headers } = endpoint; + (_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, debug_1.debugId, `Resolving endpoint from template: ${(0, debug_1.toDebugString)(endpoint)}`); + return { + ...(headers != undefined && { + headers: (0, getEndpointHeaders_1.getEndpointHeaders)(headers, endpointRuleOptions), + }), + ...(properties != undefined && { + properties: (0, getEndpointProperties_1.getEndpointProperties)(properties, endpointRuleOptions), + }), + url: (0, getEndpointUrl_1.getEndpointUrl)(url, endpointRuleOptions), + }; +}; +exports.evaluateEndpointRule = evaluateEndpointRule; - m.filter = function filter (pattern, options) { - return orig.filter(pattern, ext(def, options)) - } - m.defaults = function defaults (options) { - return orig.defaults(ext(def, options)) - } +/***/ }), - m.makeRe = function makeRe (pattern, options) { - return orig.makeRe(pattern, ext(def, options)) - } +/***/ 85492: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - m.braceExpand = function braceExpand (pattern, options) { - return orig.braceExpand(pattern, ext(def, options)) - } - m.match = function (list, pattern, options) { - return orig.match(list, pattern, ext(def, options)) - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.evaluateErrorRule = void 0; +const types_1 = __nccwpck_require__(54947); +const evaluateConditions_1 = __nccwpck_require__(16618); +const evaluateExpression_1 = __nccwpck_require__(4822); +const evaluateErrorRule = (errorRule, options) => { + const { conditions, error } = errorRule; + const { result, referenceRecord } = (0, evaluateConditions_1.evaluateConditions)(conditions, options); + if (!result) { + return; + } + throw new types_1.EndpointError((0, evaluateExpression_1.evaluateExpression)(error, "Error", { + ...options, + referenceRecord: { ...options.referenceRecord, ...referenceRecord }, + })); +}; +exports.evaluateErrorRule = evaluateErrorRule; - return m -} -Minimatch.defaults = function (def) { - return minimatch.defaults(def).Minimatch -} +/***/ }), -function minimatch (p, pattern, options) { - assertValidPattern(pattern) +/***/ 4822: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (!options) options = {} - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.evaluateExpression = void 0; +const types_1 = __nccwpck_require__(54947); +const callFunction_1 = __nccwpck_require__(15260); +const evaluateTemplate_1 = __nccwpck_require__(11220); +const getReferenceValue_1 = __nccwpck_require__(79443); +const evaluateExpression = (obj, keyName, options) => { + if (typeof obj === "string") { + return (0, evaluateTemplate_1.evaluateTemplate)(obj, options); + } + else if (obj["fn"]) { + return (0, callFunction_1.callFunction)(obj, options); + } + else if (obj["ref"]) { + return (0, getReferenceValue_1.getReferenceValue)(obj, options); + } + throw new types_1.EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`); +}; +exports.evaluateExpression = evaluateExpression; - return new Minimatch(pattern, options).match(p) -} -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } +/***/ }), - assertValidPattern(pattern) +/***/ 60816: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (!options) options = {} - pattern = pattern.trim() +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.evaluateRules = void 0; +const types_1 = __nccwpck_require__(54947); +const evaluateEndpointRule_1 = __nccwpck_require__(71801); +const evaluateErrorRule_1 = __nccwpck_require__(85492); +const evaluateTreeRule_1 = __nccwpck_require__(83795); +const evaluateRules = (rules, options) => { + for (const rule of rules) { + if (rule.type === "endpoint") { + const endpointOrUndefined = (0, evaluateEndpointRule_1.evaluateEndpointRule)(rule, options); + if (endpointOrUndefined) { + return endpointOrUndefined; + } + } + else if (rule.type === "error") { + (0, evaluateErrorRule_1.evaluateErrorRule)(rule, options); + } + else if (rule.type === "tree") { + const endpointOrUndefined = (0, evaluateTreeRule_1.evaluateTreeRule)(rule, options); + if (endpointOrUndefined) { + return endpointOrUndefined; + } + } + else { + throw new types_1.EndpointError(`Unknown endpoint rule: ${rule}`); + } + } + throw new types_1.EndpointError(`Rules evaluation failed`); +}; +exports.evaluateRules = evaluateRules; - // windows support: need to use /, not \ - if (!options.allowWindowsEscape && path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - this.partial = !!options.partial +/***/ }), - // make the set of regexps etc. - this.make() -} +/***/ 11220: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Minimatch.prototype.debug = function () {} -Minimatch.prototype.make = make -function make () { - var pattern = this.pattern - var options = this.options +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.evaluateTemplate = void 0; +const lib_1 = __nccwpck_require__(1066); +const evaluateTemplate = (template, options) => { + const evaluatedTemplateArr = []; + const templateContext = { + ...options.endpointParams, + ...options.referenceRecord, + }; + let currentIndex = 0; + while (currentIndex < template.length) { + const openingBraceIndex = template.indexOf("{", currentIndex); + if (openingBraceIndex === -1) { + evaluatedTemplateArr.push(template.slice(currentIndex)); + break; + } + evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex)); + const closingBraceIndex = template.indexOf("}", openingBraceIndex); + if (closingBraceIndex === -1) { + evaluatedTemplateArr.push(template.slice(openingBraceIndex)); + break; + } + if (template[openingBraceIndex + 1] === "{" && template[closingBraceIndex + 1] === "}") { + evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex)); + currentIndex = closingBraceIndex + 2; + } + const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex); + if (parameterName.includes("#")) { + const [refName, attrName] = parameterName.split("#"); + evaluatedTemplateArr.push((0, lib_1.getAttr)(templateContext[refName], attrName)); + } + else { + evaluatedTemplateArr.push(templateContext[parameterName]); + } + currentIndex = closingBraceIndex + 1; + } + return evaluatedTemplateArr.join(""); +}; +exports.evaluateTemplate = evaluateTemplate; - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - // step 1: figure out negation, etc. - this.parseNegate() +/***/ }), - // step 2: expand braces - var set = this.globSet = this.braceExpand() +/***/ 83795: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) } - this.debug(this.pattern, set) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.evaluateTreeRule = void 0; +const evaluateConditions_1 = __nccwpck_require__(16618); +const evaluateRules_1 = __nccwpck_require__(60816); +const evaluateTreeRule = (treeRule, options) => { + const { conditions, rules } = treeRule; + const { result, referenceRecord } = (0, evaluateConditions_1.evaluateConditions)(conditions, options); + if (!result) { + return; + } + return (0, evaluateRules_1.evaluateRules)(rules, { + ...options, + referenceRecord: { ...options.referenceRecord, ...referenceRecord }, + }); +}; +exports.evaluateTreeRule = evaluateTreeRule; - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - this.debug(this.pattern, set) +/***/ }), - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) +/***/ 8093: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - this.debug(this.pattern, set) - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getEndpointHeaders = void 0; +const types_1 = __nccwpck_require__(54947); +const evaluateExpression_1 = __nccwpck_require__(4822); +const getEndpointHeaders = (headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({ + ...acc, + [headerKey]: headerVal.map((headerValEntry) => { + const processedExpr = (0, evaluateExpression_1.evaluateExpression)(headerValEntry, "Header value entry", options); + if (typeof processedExpr !== "string") { + throw new types_1.EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`); + } + return processedExpr; + }), +}), {}); +exports.getEndpointHeaders = getEndpointHeaders; + - this.debug(this.pattern, set) +/***/ }), - this.set = set -} +/***/ 6490: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - if (options.nonegate) return +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getEndpointProperties = void 0; +const getEndpointProperty_1 = __nccwpck_require__(78983); +const getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({ + ...acc, + [propertyKey]: (0, getEndpointProperty_1.getEndpointProperty)(propertyVal, options), +}), {}); +exports.getEndpointProperties = getEndpointProperties; - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} +/***/ }), -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} +/***/ 78983: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Minimatch.prototype.braceExpand = braceExpand -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getEndpointProperty = void 0; +const types_1 = __nccwpck_require__(54947); +const evaluateTemplate_1 = __nccwpck_require__(11220); +const getEndpointProperties_1 = __nccwpck_require__(6490); +const getEndpointProperty = (property, options) => { + if (Array.isArray(property)) { + return property.map((propertyEntry) => (0, exports.getEndpointProperty)(propertyEntry, options)); } - } + switch (typeof property) { + case "string": + return (0, evaluateTemplate_1.evaluateTemplate)(property, options); + case "object": + if (property === null) { + throw new types_1.EndpointError(`Unexpected endpoint property: ${property}`); + } + return (0, getEndpointProperties_1.getEndpointProperties)(property, options); + case "boolean": + return property; + default: + throw new types_1.EndpointError(`Unexpected endpoint property type: ${typeof property}`); + } +}; +exports.getEndpointProperty = getEndpointProperty; - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - assertValidPattern(pattern) +/***/ }), - // Thanks to Yeting Li for - // improving this regexp to avoid a ReDOS vulnerability. - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - // shortcut. no need to expand. - return [pattern] - } +/***/ 9721: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return expand(pattern) -} -var MAX_PATTERN_LENGTH = 1024 * 64 -var assertValidPattern = function (pattern) { - if (typeof pattern !== 'string') { - throw new TypeError('invalid pattern') - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getEndpointUrl = void 0; +const types_1 = __nccwpck_require__(54947); +const evaluateExpression_1 = __nccwpck_require__(4822); +const getEndpointUrl = (endpointUrl, options) => { + const expression = (0, evaluateExpression_1.evaluateExpression)(endpointUrl, "Endpoint URL", options); + if (typeof expression === "string") { + try { + return new URL(expression); + } + catch (error) { + console.error(`Failed to construct URL with ${expression}`, error); + throw error; + } + } + throw new types_1.EndpointError(`Endpoint URL must be a string, got ${typeof expression}`); +}; +exports.getEndpointUrl = getEndpointUrl; - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError('pattern is too long') - } -} -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - assertValidPattern(pattern) +/***/ }), - var options = this.options +/***/ 79443: +/***/ ((__unused_webpack_module, exports) => { - // shortcuts - if (pattern === '**') { - if (!options.noglobstar) - return GLOBSTAR - else - pattern = '*' - } - if (pattern === '') return '' - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getReferenceValue = void 0; +const getReferenceValue = ({ ref }, options) => { + const referenceRecord = { + ...options.endpointParams, + ...options.referenceRecord, + }; + return referenceRecord[ref]; +}; +exports.getReferenceValue = getReferenceValue; - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) +/***/ }), - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } +/***/ 96340: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - switch (c) { - /* istanbul ignore next */ - case '/': { - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - } - case '\\': - clearStateChar() - escaping = true - continue +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(27738), exports); +tslib_1.__exportStar(__nccwpck_require__(60816), exports); - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } +/***/ }), - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue +/***/ 59878: +/***/ ((__unused_webpack_module, exports) => { - case '(': - if (inClass) { - re += '(' - continue - } - if (!stateChar) { - re += '\\(' - continue +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toHex = exports.fromHex = void 0; +const SHORT_TO_HEX = {}; +const HEX_TO_SHORT = {}; +for (let i = 0; i < 256; i++) { + let encodedByte = i.toString(16).toLowerCase(); + if (encodedByte.length === 1) { + encodedByte = `0${encodedByte}`; + } + SHORT_TO_HEX[i] = encodedByte; + HEX_TO_SHORT[encodedByte] = i; +} +function fromHex(encoded) { + if (encoded.length % 2 !== 0) { + throw new Error("Hex encoded strings must have an even number length"); + } + const out = new Uint8Array(encoded.length / 2); + for (let i = 0; i < encoded.length; i += 2) { + const encodedByte = encoded.slice(i, i + 2).toLowerCase(); + if (encodedByte in HEX_TO_SHORT) { + out[i / 2] = HEX_TO_SHORT[encodedByte]; } - - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue + else { + throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`); } + } + return out; +} +exports.fromHex = fromHex; +function toHex(bytes) { + let out = ""; + for (let i = 0; i < bytes.byteLength; i++) { + out += SHORT_TO_HEX[bytes[i]]; + } + return out; +} +exports.toHex = toHex; - clearStateChar() - hasMagic = true - var pl = patternListStack.pop() - // negation is (?:(?!js)[^/]*) - // The others are (?:) - re += pl.close - if (pl.type === '!') { - negativeLists.push(pl) - } - pl.reEnd = re.length - continue - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } +/***/ }), - clearStateChar() - re += '|' - continue +/***/ 94180: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - if (inClass) { - re += '\\' + c - continue - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getSmithyContext = void 0; +const types_1 = __nccwpck_require__(21438); +const getSmithyContext = (context) => context[types_1.SMITHY_CONTEXT_KEY] || (context[types_1.SMITHY_CONTEXT_KEY] = {}); +exports.getSmithyContext = getSmithyContext; - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } +/***/ }), - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } +/***/ 3626: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - default: - // swallow any state char that wasn't consumed - clearStateChar() +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(94180), exports); +tslib_1.__exportStar(__nccwpck_require__(15348), exports); - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - re += c +/***/ }), - } // switch - } // for +/***/ 15348: +/***/ ((__unused_webpack_module, exports) => { - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + pl.open.length) - this.debug('setting tail', re, pl) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.normalizeProvider = void 0; +const normalizeProvider = (input) => { + if (typeof input === "function") + return input; + const promisified = Promise.resolve(input); + return () => promisified; +}; +exports.normalizeProvider = normalizeProvider; - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - this.debug('tail=%j\n %s', tail, tail, pl, re) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type +/***/ }), - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } +/***/ 98985: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '[': case '.': case '(': addPatternStart = true - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AdaptiveRetryStrategy = void 0; +const config_1 = __nccwpck_require__(83968); +const DefaultRateLimiter_1 = __nccwpck_require__(99741); +const StandardRetryStrategy_1 = __nccwpck_require__(95455); +class AdaptiveRetryStrategy { + constructor(maxAttemptsProvider, options) { + this.maxAttemptsProvider = maxAttemptsProvider; + this.mode = config_1.RETRY_MODES.ADAPTIVE; + const { rateLimiter } = options !== null && options !== void 0 ? options : {}; + this.rateLimiter = rateLimiter !== null && rateLimiter !== void 0 ? rateLimiter : new DefaultRateLimiter_1.DefaultRateLimiter(); + this.standardRetryStrategy = new StandardRetryStrategy_1.StandardRetryStrategy(maxAttemptsProvider); + } + async acquireInitialRetryToken(retryTokenScope) { + await this.rateLimiter.getSendToken(); + return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); + } + async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { + this.rateLimiter.updateClientSendingRate(errorInfo); + return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + } + recordSuccess(token) { + this.rateLimiter.updateClientSendingRate({}); + this.standardRetryStrategy.recordSuccess(token); + } +} +exports.AdaptiveRetryStrategy = AdaptiveRetryStrategy; - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) +/***/ }), - nlLast += nlAfter +/***/ 21880: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ConfiguredRetryStrategy = void 0; +const constants_1 = __nccwpck_require__(72707); +const StandardRetryStrategy_1 = __nccwpck_require__(95455); +class ConfiguredRetryStrategy extends StandardRetryStrategy_1.StandardRetryStrategy { + constructor(maxAttempts, computeNextBackoffDelay = constants_1.DEFAULT_RETRY_DELAY_BASE) { + super(typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts); + if (typeof computeNextBackoffDelay === "number") { + this.computeNextBackoffDelay = () => computeNextBackoffDelay; + } + else { + this.computeNextBackoffDelay = computeNextBackoffDelay; + } } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } + async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { + const token = await super.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + token.getRetryDelay = () => this.computeNextBackoffDelay(token.getRetryCount()); + return token; + } +} +exports.ConfiguredRetryStrategy = ConfiguredRetryStrategy; - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - if (addPatternStart) { - re = patternStart + re - } +/***/ }), - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } +/***/ 99741: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - var flags = options.nocase ? 'i' : '' - try { - var regExp = new RegExp('^' + re + '$', flags) - } catch (er) /* istanbul ignore next - should be impossible */ { - // If it was an invalid regular expression, then it can't match - // anything. This trick looks for a character after the end of - // the string, which is of course impossible, except in multi-line - // mode, but it's not a /m regex. - return new RegExp('$.') - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DefaultRateLimiter = void 0; +const service_error_classification_1 = __nccwpck_require__(50805); +class DefaultRateLimiter { + constructor(options) { + var _a, _b, _c, _d, _e; + this.currentCapacity = 0; + this.enabled = false; + this.lastMaxRate = 0; + this.measuredTxRate = 0; + this.requestCount = 0; + this.lastTimestamp = 0; + this.timeWindow = 0; + this.beta = (_a = options === null || options === void 0 ? void 0 : options.beta) !== null && _a !== void 0 ? _a : 0.7; + this.minCapacity = (_b = options === null || options === void 0 ? void 0 : options.minCapacity) !== null && _b !== void 0 ? _b : 1; + this.minFillRate = (_c = options === null || options === void 0 ? void 0 : options.minFillRate) !== null && _c !== void 0 ? _c : 0.5; + this.scaleConstant = (_d = options === null || options === void 0 ? void 0 : options.scaleConstant) !== null && _d !== void 0 ? _d : 0.4; + this.smooth = (_e = options === null || options === void 0 ? void 0 : options.smooth) !== null && _e !== void 0 ? _e : 0.8; + const currentTimeInSeconds = this.getCurrentTimeInSeconds(); + this.lastThrottleTime = currentTimeInSeconds; + this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds()); + this.fillRate = this.minFillRate; + this.maxCapacity = this.minCapacity; + } + getCurrentTimeInSeconds() { + return Date.now() / 1000; + } + async getSendToken() { + return this.acquireTokenBucket(1); + } + async acquireTokenBucket(amount) { + if (!this.enabled) { + return; + } + this.refillTokenBucket(); + if (amount > this.currentCapacity) { + const delay = ((amount - this.currentCapacity) / this.fillRate) * 1000; + await new Promise((resolve) => setTimeout(resolve, delay)); + } + this.currentCapacity = this.currentCapacity - amount; + } + refillTokenBucket() { + const timestamp = this.getCurrentTimeInSeconds(); + if (!this.lastTimestamp) { + this.lastTimestamp = timestamp; + return; + } + const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate; + this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount); + this.lastTimestamp = timestamp; + } + updateClientSendingRate(response) { + let calculatedRate; + this.updateMeasuredRate(); + if ((0, service_error_classification_1.isThrottlingError)(response)) { + const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate); + this.lastMaxRate = rateToUse; + this.calculateTimeWindow(); + this.lastThrottleTime = this.getCurrentTimeInSeconds(); + calculatedRate = this.cubicThrottle(rateToUse); + this.enableTokenBucket(); + } + else { + this.calculateTimeWindow(); + calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds()); + } + const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate); + this.updateTokenBucketRate(newRate); + } + calculateTimeWindow() { + this.timeWindow = this.getPrecise(Math.pow((this.lastMaxRate * (1 - this.beta)) / this.scaleConstant, 1 / 3)); + } + cubicThrottle(rateToUse) { + return this.getPrecise(rateToUse * this.beta); + } + cubicSuccess(timestamp) { + return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate); + } + enableTokenBucket() { + this.enabled = true; + } + updateTokenBucketRate(newRate) { + this.refillTokenBucket(); + this.fillRate = Math.max(newRate, this.minFillRate); + this.maxCapacity = Math.max(newRate, this.minCapacity); + this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity); + } + updateMeasuredRate() { + const t = this.getCurrentTimeInSeconds(); + const timeBucket = Math.floor(t * 2) / 2; + this.requestCount++; + if (timeBucket > this.lastTxRateBucket) { + const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket); + this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth)); + this.requestCount = 0; + this.lastTxRateBucket = timeBucket; + } + } + getPrecise(num) { + return parseFloat(num.toFixed(8)); + } +} +exports.DefaultRateLimiter = DefaultRateLimiter; - regExp._glob = pattern - regExp._src = re - return regExp -} +/***/ }), -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() +/***/ 95455: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.StandardRetryStrategy = void 0; +const config_1 = __nccwpck_require__(83968); +const constants_1 = __nccwpck_require__(72707); +const defaultRetryBackoffStrategy_1 = __nccwpck_require__(5233); +const defaultRetryToken_1 = __nccwpck_require__(79744); +class StandardRetryStrategy { + constructor(maxAttempts) { + this.maxAttempts = maxAttempts; + this.mode = config_1.RETRY_MODES.STANDARD; + this.capacity = constants_1.INITIAL_RETRY_TOKENS; + this.retryBackoffStrategy = (0, defaultRetryBackoffStrategy_1.getDefaultRetryBackoffStrategy)(); + this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts; + } + async acquireInitialRetryToken(retryTokenScope) { + return (0, defaultRetryToken_1.createDefaultRetryToken)({ + retryDelay: constants_1.DEFAULT_RETRY_DELAY_BASE, + retryCount: 0, + }); + } + async refreshRetryTokenForRetry(token, errorInfo) { + const maxAttempts = await this.getMaxAttempts(); + if (this.shouldRetry(token, errorInfo, maxAttempts)) { + const errorType = errorInfo.errorType; + this.retryBackoffStrategy.setDelayBase(errorType === "THROTTLING" ? constants_1.THROTTLING_RETRY_DELAY_BASE : constants_1.DEFAULT_RETRY_DELAY_BASE); + const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount()); + const retryDelay = errorInfo.retryAfterHint + ? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType) + : delayFromErrorType; + const capacityCost = this.getCapacityCost(errorType); + this.capacity -= capacityCost; + return (0, defaultRetryToken_1.createDefaultRetryToken)({ + retryDelay, + retryCount: token.getRetryCount() + 1, + retryCost: capacityCost, + }); + } + throw new Error("No retry token available"); + } + recordSuccess(token) { + var _a; + this.capacity = Math.max(constants_1.INITIAL_RETRY_TOKENS, this.capacity + ((_a = token.getRetryCost()) !== null && _a !== void 0 ? _a : constants_1.NO_RETRY_INCREMENT)); + } + getCapacity() { + return this.capacity; + } + async getMaxAttempts() { + try { + return await this.maxAttemptsProvider(); + } + catch (error) { + console.warn(`Max attempts provider could not resolve. Using default of ${config_1.DEFAULT_MAX_ATTEMPTS}`); + return config_1.DEFAULT_MAX_ATTEMPTS; + } + } + shouldRetry(tokenToRenew, errorInfo, maxAttempts) { + const attempts = tokenToRenew.getRetryCount() + 1; + return (attempts < maxAttempts && + this.capacity >= this.getCapacityCost(errorInfo.errorType) && + this.isRetryableError(errorInfo.errorType)); + } + getCapacityCost(errorType) { + return errorType === "TRANSIENT" ? constants_1.TIMEOUT_RETRY_COST : constants_1.RETRY_COST; + } + isRetryableError(errorType) { + return errorType === "THROTTLING" || errorType === "TRANSIENT"; + } } +exports.StandardRetryStrategy = StandardRetryStrategy; -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set +/***/ }), - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options +/***/ 83968: +/***/ ((__unused_webpack_module, exports) => { - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DEFAULT_RETRY_MODE = exports.DEFAULT_MAX_ATTEMPTS = exports.RETRY_MODES = void 0; +var RETRY_MODES; +(function (RETRY_MODES) { + RETRY_MODES["STANDARD"] = "standard"; + RETRY_MODES["ADAPTIVE"] = "adaptive"; +})(RETRY_MODES = exports.RETRY_MODES || (exports.RETRY_MODES = {})); +exports.DEFAULT_MAX_ATTEMPTS = 3; +exports.DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD; - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' +/***/ }), - try { - this.regexp = new RegExp(re, flags) - } catch (ex) /* istanbul ignore next - should be impossible */ { - this.regexp = false - } - return this.regexp -} +/***/ 72707: +/***/ ((__unused_webpack_module, exports) => { -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} -Minimatch.prototype.match = function match (f, partial) { - if (typeof partial === 'undefined') partial = this.partial - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.REQUEST_HEADER = exports.INVOCATION_ID_HEADER = exports.NO_RETRY_INCREMENT = exports.TIMEOUT_RETRY_COST = exports.RETRY_COST = exports.INITIAL_RETRY_TOKENS = exports.THROTTLING_RETRY_DELAY_BASE = exports.MAXIMUM_RETRY_DELAY = exports.DEFAULT_RETRY_DELAY_BASE = void 0; +exports.DEFAULT_RETRY_DELAY_BASE = 100; +exports.MAXIMUM_RETRY_DELAY = 20 * 1000; +exports.THROTTLING_RETRY_DELAY_BASE = 500; +exports.INITIAL_RETRY_TOKENS = 500; +exports.RETRY_COST = 5; +exports.TIMEOUT_RETRY_COST = 10; +exports.NO_RETRY_INCREMENT = 1; +exports.INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; +exports.REQUEST_HEADER = "amz-sdk-request"; - if (f === '/' && partial) return true - var options = this.options +/***/ }), - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } +/***/ 5233: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getDefaultRetryBackoffStrategy = void 0; +const constants_1 = __nccwpck_require__(72707); +const getDefaultRetryBackoffStrategy = () => { + let delayBase = constants_1.DEFAULT_RETRY_DELAY_BASE; + const computeNextBackoffDelay = (attempts) => { + return Math.floor(Math.min(constants_1.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); + }; + const setDelayBase = (delay) => { + delayBase = delay; + }; + return { + computeNextBackoffDelay, + setDelayBase, + }; +}; +exports.getDefaultRetryBackoffStrategy = getDefaultRetryBackoffStrategy; - var set = this.set - this.debug(this.pattern, 'set', set) - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } +/***/ }), - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } +/***/ 79744: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createDefaultRetryToken = void 0; +const constants_1 = __nccwpck_require__(72707); +const createDefaultRetryToken = ({ retryDelay, retryCount, retryCost, }) => { + const getRetryCount = () => retryCount; + const getRetryDelay = () => Math.min(constants_1.MAXIMUM_RETRY_DELAY, retryDelay); + const getRetryCost = () => retryCost; + return { + getRetryCount, + getRetryDelay, + getRetryCost, + }; +}; +exports.createDefaultRetryToken = createDefaultRetryToken; - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - this.debug('matchOne', file.length, pattern.length) +/***/ }), - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] +/***/ 20774: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - this.debug(pattern, p, f) - // should be impossible. - // some invalid regexp stuff in the set. - /* istanbul ignore if */ - if (p === false) return false +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(98985), exports); +tslib_1.__exportStar(__nccwpck_require__(21880), exports); +tslib_1.__exportStar(__nccwpck_require__(99741), exports); +tslib_1.__exportStar(__nccwpck_require__(95455), exports); +tslib_1.__exportStar(__nccwpck_require__(83968), exports); +tslib_1.__exportStar(__nccwpck_require__(72707), exports); +tslib_1.__exportStar(__nccwpck_require__(64849), exports); - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } +/***/ }), - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] +/***/ 64849: +/***/ ((__unused_webpack_module, exports) => { - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } +Object.defineProperty(exports, "__esModule", ({ value: true })); - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - /* istanbul ignore if */ - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } +/***/ }), - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - hit = f === p - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) +/***/ 57568: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Uint8ArrayBlobAdapter = void 0; +const transforms_1 = __nccwpck_require__(53537); +class Uint8ArrayBlobAdapter extends Uint8Array { + static fromString(source, encoding = "utf-8") { + switch (typeof source) { + case "string": + return (0, transforms_1.transformFromString)(source, encoding); + default: + throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`); + } + } + static mutate(source) { + Object.setPrototypeOf(source, Uint8ArrayBlobAdapter.prototype); + return source; + } + transformToString(encoding = "utf-8") { + return (0, transforms_1.transformToString)(this, encoding); } +} +exports.Uint8ArrayBlobAdapter = Uint8ArrayBlobAdapter; - if (!hit) return false - } - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* +/***/ }), - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else /* istanbul ignore else */ if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - return (fi === fl - 1) && (file[fi] === '') - } +/***/ 53537: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // should be unreachable. - /* istanbul ignore next */ - throw new Error('wtf?') -} -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.transformFromString = exports.transformToString = void 0; +const util_base64_1 = __nccwpck_require__(74339); +const util_utf8_1 = __nccwpck_require__(97788); +const Uint8ArrayBlobAdapter_1 = __nccwpck_require__(57568); +function transformToString(payload, encoding = "utf-8") { + if (encoding === "base64") { + return (0, util_base64_1.toBase64)(payload); + } + return (0, util_utf8_1.toUtf8)(payload); } - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +exports.transformToString = transformToString; +function transformFromString(str, encoding) { + if (encoding === "base64") { + return Uint8ArrayBlobAdapter_1.Uint8ArrayBlobAdapter.mutate((0, util_base64_1.fromBase64)(str)); + } + return Uint8ArrayBlobAdapter_1.Uint8ArrayBlobAdapter.mutate((0, util_utf8_1.fromUtf8)(str)); } +exports.transformFromString = transformFromString; /***/ }), -<<<<<<< HEAD -/***/ 20603: -======= -/***/ 3562: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { +/***/ 98425: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Helpers. - */ -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var w = d * 7; -var y = d * 365.25; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getAwsChunkedEncodingStream = void 0; +const stream_1 = __nccwpck_require__(12781); +const getAwsChunkedEncodingStream = (readableStream, options) => { + const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options; + const checksumRequired = base64Encoder !== undefined && + checksumAlgorithmFn !== undefined && + checksumLocationName !== undefined && + streamHasher !== undefined; + const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : undefined; + const awsChunkedEncodingStream = new stream_1.Readable({ read: () => { } }); + readableStream.on("data", (data) => { + const length = bodyLengthChecker(data) || 0; + awsChunkedEncodingStream.push(`${length.toString(16)}\r\n`); + awsChunkedEncodingStream.push(data); + awsChunkedEncodingStream.push("\r\n"); + }); + readableStream.on("end", async () => { + awsChunkedEncodingStream.push(`0\r\n`); + if (checksumRequired) { + const checksum = base64Encoder(await digest); + awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r\n`); + awsChunkedEncodingStream.push(`\r\n`); + } + awsChunkedEncodingStream.push(null); + }); + return awsChunkedEncodingStream; +}; +exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream; -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ -module.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - 'val is not a non-empty string or a valid number. val=' + - JSON.stringify(val) - ); -}; +/***/ }), -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ +/***/ 6981: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'weeks': - case 'week': - case 'w': - return n * w; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - default: - return undefined; - } -} -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(57568), exports); +tslib_1.__exportStar(__nccwpck_require__(98425), exports); +tslib_1.__exportStar(__nccwpck_require__(40991), exports); -function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + 'd'; - } - if (msAbs >= h) { - return Math.round(ms / h) + 'h'; - } - if (msAbs >= m) { - return Math.round(ms / m) + 'm'; - } - if (msAbs >= s) { - return Math.round(ms / s) + 's'; - } - return ms + 'ms'; -} -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ +/***/ }), -function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } - return ms + ' ms'; -} +/***/ 40991: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Pluralization helper. - */ -function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.sdkStreamMixin = void 0; +const node_http_handler_1 = __nccwpck_require__(48195); +const util_buffer_from_1 = __nccwpck_require__(39082); +const stream_1 = __nccwpck_require__(12781); +const util_1 = __nccwpck_require__(73837); +const ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; +const sdkStreamMixin = (stream) => { + var _a, _b; + if (!(stream instanceof stream_1.Readable)) { + const name = ((_b = (_a = stream === null || stream === void 0 ? void 0 : stream.__proto__) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name) || stream; + throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`); + } + let transformed = false; + const transformToByteArray = async () => { + if (transformed) { + throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); + } + transformed = true; + return await (0, node_http_handler_1.streamCollector)(stream); + }; + return Object.assign(stream, { + transformToByteArray, + transformToString: async (encoding) => { + const buf = await transformToByteArray(); + if (encoding === undefined || Buffer.isEncoding(encoding)) { + return (0, util_buffer_from_1.fromArrayBuffer)(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding); + } + else { + const decoder = new util_1.TextDecoder(encoding); + return decoder.decode(buf); + } + }, + transformToWebStream: () => { + if (transformed) { + throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); + } + if (stream.readableFlowing !== null) { + throw new Error("The stream has been consumed by other callbacks."); + } + if (typeof stream_1.Readable.toWeb !== "function") { + throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available."); + } + transformed = true; + return stream_1.Readable.toWeb(stream); + }, + }); +}; +exports.sdkStreamMixin = sdkStreamMixin; /***/ }), -<<<<<<< HEAD -/***/ 91809: -======= -/***/ 6211: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 54910: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -const { Multiaddr } = __nccwpck_require__(17907) - -const reduceValue = (_, v) => v -const tcpUri = (str, port, parts, opts) => { - // return tcp when explicitly requested - if (opts && opts.assumeHttp === false) return `tcp://${str}:${port}` - // check if tcp is the last protocol in multiaddr - let protocol = 'tcp' - let explicitPort = `:${port}` - const last = parts[parts.length - 1] - if (last.protocol === 'tcp') { - // assume http and produce clean urls - protocol = port === '443' ? 'https' : 'http' - explicitPort = port === '443' || port === '80' ? '' : explicitPort - } - return `${protocol}://${str}${explicitPort}` -} - -const Reducers = { - ip4: reduceValue, - ip6: (str, content, i, parts) => ( - parts.length === 1 && parts[0].protocol === 'ip6' - ? content - : `[${content}]` - ), - tcp: (str, content, i, parts, opts) => ( - parts.some(p => ['http', 'https', 'ws', 'wss'].includes(p.protocol)) - ? `${str}:${content}` - : tcpUri(str, content, parts, opts) - ), - udp: (str, content) => `udp://${str}:${content}`, - dnsaddr: reduceValue, - dns4: reduceValue, - dns6: reduceValue, - ipfs: (str, content) => `${str}/ipfs/${content}`, - p2p: (str, content) => `${str}/p2p/${content}`, - http: str => `http://${str}`, - https: str => `https://${str}`, - ws: str => `ws://${str}`, - wss: str => `wss://${str}`, - 'p2p-websocket-star': str => `${str}/p2p-websocket-star`, - 'p2p-webrtc-star': str => `${str}/p2p-webrtc-star`, - 'p2p-webrtc-direct': str => `${str}/p2p-webrtc-direct` -} - -module.exports = (multiaddr, opts) => { - const ma = new Multiaddr(multiaddr) - const parts = multiaddr.toString().split('/').slice(1) - return ma - .tuples() - .map(tuple => ({ - protocol: parts.shift(), - content: tuple[1] ? parts.shift() : null - })) - .reduce((str, part, i, parts) => { - const reduce = Reducers[part.protocol] - if (!reduce) throw new Error(`Unsupported protocol ${part.protocol}`) - return reduce(str, part.content, i, parts, opts) - }, '') -} + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.escapeUriPath = void 0; +const escape_uri_1 = __nccwpck_require__(5506); +const escapeUriPath = (uri) => uri.split("/").map(escape_uri_1.escapeUri).join("/"); +exports.escapeUriPath = escapeUriPath; /***/ }), -/***/ 41437: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 5506: +/***/ ((__unused_webpack_module, exports) => { -"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.escapeUri = void 0; +const escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode); +exports.escapeUri = escapeUri; +const hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`; -const convert = __nccwpck_require__(73095) -const protocols = __nccwpck_require__(17046) -const varint = __nccwpck_require__(52865) -const { concat: uint8ArrayConcat } = __nccwpck_require__(17225) -const { toString: uint8ArrayToString } = __nccwpck_require__(2771) -// export codec -module.exports = { - stringToStringTuples, - stringTuplesToString, +/***/ }), - tuplesToStringTuples, - stringTuplesToTuples, +/***/ 25293: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - bytesToTuples, - tuplesToBytes, - bytesToString, - stringToBytes, +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(5506), exports); +tslib_1.__exportStar(__nccwpck_require__(54910), exports); - fromString, - fromBytes, - validateBytes, - isValidBytes, - cleanPath, - ParseError, - protoFromTuple, +/***/ }), - sizeForAddr -} +/***/ 96869: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -// string -> [[str name, str addr]... ] -/** - * @param {string} str - */ -function stringToStringTuples (str) { - const tuples = [] - const parts = str.split('/').slice(1) // skip first empty elem - if (parts.length === 1 && parts[0] === '') { - return [] - } - for (let p = 0; p < parts.length; p++) { - const part = parts[p] - const proto = protocols(part) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fromUtf8 = void 0; +const util_buffer_from_1 = __nccwpck_require__(39082); +const fromUtf8 = (input) => { + const buf = (0, util_buffer_from_1.fromString)(input, "utf8"); + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT); +}; +exports.fromUtf8 = fromUtf8; - if (proto.size === 0) { - tuples.push([part]) - continue - } - p++ // advance addr part - if (p >= parts.length) { - throw ParseError('invalid address: ' + str) - } +/***/ }), - // if it's a path proto, take the rest - if (proto.path) { - tuples.push([ - part, - // TODO: should we need to check each path part to see if it's a proto? - // This would allow for other protocols to be added after a unix path, - // however it would have issues if the path had a protocol name in the path - cleanPath(parts.slice(p).join('/')) - ]) - break - } +/***/ 97788: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - tuples.push([part, parts[p]]) - } - return tuples -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(96869), exports); +tslib_1.__exportStar(__nccwpck_require__(81174), exports); +tslib_1.__exportStar(__nccwpck_require__(2902), exports); -// [[str name, str addr]... ] -> string -/** - * @param {[number, string?][]} tuples - */ -function stringTuplesToString (tuples) { - /** @type {Array} */ - const parts = [] - tuples.map((tup) => { - const proto = protoFromTuple(tup) - parts.push(proto.name) - if (tup.length > 1) { - parts.push(tup[1]) - } - return null - }) - return cleanPath(parts.join('/')) -} +/***/ }), -// [[str name, str addr]... ] -> [[int code, Uint8Array]... ] -/** - * @param {Array} tuples - * @returns {[number , Uint8Array?][]} - */ -function stringTuplesToTuples (tuples) { - return tuples.map((tup) => { - if (!Array.isArray(tup)) { - tup = [tup] +/***/ 81174: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toUint8Array = void 0; +const fromUtf8_1 = __nccwpck_require__(96869); +const toUint8Array = (data) => { + if (typeof data === "string") { + return (0, fromUtf8_1.fromUtf8)(data); } - const proto = protoFromTuple(tup) - if (tup.length > 1) { - return [proto.code, convert.toBytes(proto.code, tup[1])] + if (ArrayBuffer.isView(data)) { + return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); } - return [proto.code] - }) -} + return new Uint8Array(data); +}; +exports.toUint8Array = toUint8Array; -/** - * Convert tuples to string tuples - * - * [[int code, Uint8Array]... ] -> [[int code, str addr]... ] - * - * @param {Array<[number, Uint8Array?]>} tuples - * @returns {Array<[number, string?]>} - */ -function tuplesToStringTuples (tuples) { - return tuples.map(tup => { - const proto = protoFromTuple(tup) - if (tup[1]) { - return [proto.code, convert.toString(proto.code, tup[1])] - } - return [proto.code] - }) -} +/***/ }), -// [[int code, Uint8Array ]... ] -> Uint8Array -/** - * @param {[number, Uint8Array?][]} tuples - */ -function tuplesToBytes (tuples) { - return fromBytes(uint8ArrayConcat(tuples.map((/** @type {any[]} */ tup) => { - const proto = protoFromTuple(tup) - let buf = Uint8Array.from(varint.encode(proto.code)) +/***/ 2902: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (tup.length > 1) { - buf = uint8ArrayConcat([buf, tup[1]]) // add address buffer - } - return buf - }))) -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toUtf8 = void 0; +const util_buffer_from_1 = __nccwpck_require__(39082); +const toUtf8 = (input) => (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("utf8"); +exports.toUtf8 = toUtf8; -/** - * @param {import("./types").Protocol} p - * @param {Uint8Array | number[]} addr - */ -function sizeForAddr (p, addr) { - if (p.size > 0) { - return p.size / 8 - } else if (p.size === 0) { - return 0 - } else { - const size = varint.decode(addr) - return size + varint.decode.bytes - } -} -/** - * - * @param {Uint8Array} buf - * @returns {Array<[number, Uint8Array?]>} - */ -function bytesToTuples (buf) { - /** @type {Array<[number, Uint8Array?]>} */ - const tuples = [] - let i = 0 - while (i < buf.length) { - const code = varint.decode(buf, i) - const n = varint.decode.bytes +/***/ }), - const p = protocols(code) +/***/ 42378: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - const size = sizeForAddr(p, buf.slice(i + n)) - if (size === 0) { - tuples.push([code]) - i += n - continue +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createWaiter = void 0; +const poller_1 = __nccwpck_require__(57732); +const utils_1 = __nccwpck_require__(83014); +const waiter_1 = __nccwpck_require__(36641); +const abortTimeout = async (abortSignal) => { + return new Promise((resolve) => { + abortSignal.onabort = () => resolve({ state: waiter_1.WaiterState.ABORTED }); + }); +}; +const createWaiter = async (options, input, acceptorChecks) => { + const params = { + ...waiter_1.waiterServiceDefaults, + ...options, + }; + (0, utils_1.validateWaiterOptions)(params); + const exitConditions = [(0, poller_1.runPolling)(params, input, acceptorChecks)]; + if (options.abortController) { + exitConditions.push(abortTimeout(options.abortController.signal)); + } + if (options.abortSignal) { + exitConditions.push(abortTimeout(options.abortSignal)); } + return Promise.race(exitConditions); +}; +exports.createWaiter = createWaiter; - const addr = buf.slice(i + n, i + n + size) - i += (size + n) +/***/ }), - if (i > buf.length) { // did not end _exactly_ at buffer.length - throw ParseError('Invalid address Uint8Array: ' + uint8ArrayToString(buf, 'base16')) - } +/***/ 47620: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // ok, tuple seems good. - tuples.push([code, addr]) - } - return tuples -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(42378), exports); +tslib_1.__exportStar(__nccwpck_require__(36641), exports); -// Uint8Array -> String -/** - * @param {Uint8Array} buf - */ -function bytesToString (buf) { - const a = bytesToTuples(buf) - const b = tuplesToStringTuples(a) - return stringTuplesToString(b) -} -// String -> Uint8Array -/** - * @param {string} str - */ -function stringToBytes (str) { - str = cleanPath(str) - const a = stringToStringTuples(str) - const b = stringTuplesToTuples(a) +/***/ }), - return tuplesToBytes(b) -} +/***/ 57732: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -// String -> Uint8Array -/** - * @param {string} str - */ -function fromString (str) { - return stringToBytes(str) -} -// Uint8Array -> Uint8Array -/** - * @param {Uint8Array} buf - */ -function fromBytes (buf) { - const err = validateBytes(buf) - if (err) throw err - return Uint8Array.from(buf) // copy -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.runPolling = void 0; +const sleep_1 = __nccwpck_require__(5644); +const waiter_1 = __nccwpck_require__(36641); +const exponentialBackoffWithJitter = (minDelay, maxDelay, attemptCeiling, attempt) => { + if (attempt > attemptCeiling) + return maxDelay; + const delay = minDelay * 2 ** (attempt - 1); + return randomInRange(minDelay, delay); +}; +const randomInRange = (min, max) => min + Math.random() * (max - min); +const runPolling = async ({ minDelay, maxDelay, maxWaitTime, abortController, client, abortSignal }, input, acceptorChecks) => { + var _a; + const { state, reason } = await acceptorChecks(client, input); + if (state !== waiter_1.WaiterState.RETRY) { + return { state, reason }; + } + let currentAttempt = 1; + const waitUntil = Date.now() + maxWaitTime * 1000; + const attemptCeiling = Math.log(maxDelay / minDelay) / Math.log(2) + 1; + while (true) { + if (((_a = abortController === null || abortController === void 0 ? void 0 : abortController.signal) === null || _a === void 0 ? void 0 : _a.aborted) || (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted)) { + return { state: waiter_1.WaiterState.ABORTED }; + } + const delay = exponentialBackoffWithJitter(minDelay, maxDelay, attemptCeiling, currentAttempt); + if (Date.now() + delay * 1000 > waitUntil) { + return { state: waiter_1.WaiterState.TIMEOUT }; + } + await (0, sleep_1.sleep)(delay); + const { state, reason } = await acceptorChecks(client, input); + if (state !== waiter_1.WaiterState.RETRY) { + return { state, reason }; + } + currentAttempt += 1; + } +}; +exports.runPolling = runPolling; -/** - * @param {Uint8Array} buf - */ -function validateBytes (buf) { - try { - bytesToTuples(buf) // try to parse. will throw if breaks - } catch (err) { - return err - } -} -/** - * @param {Uint8Array} buf - */ -function isValidBytes (buf) { - return validateBytes(buf) === undefined -} +/***/ }), -/** - * @param {string} str - */ -function cleanPath (str) { - return '/' + str.trim().split('/').filter((/** @type {any} */ a) => a).join('/') -} +/***/ 83014: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * @param {string} str - */ -function ParseError (str) { - return new Error('Error parsing address: ' + str) -} -/** - * @param {any[]} tup - */ -function protoFromTuple (tup) { - const proto = protocols(tup[0]) - return proto -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +const tslib_1 = __nccwpck_require__(47754); +tslib_1.__exportStar(__nccwpck_require__(5644), exports); +tslib_1.__exportStar(__nccwpck_require__(96065), exports); /***/ }), -/***/ 73095: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - +/***/ 5644: +/***/ ((__unused_webpack_module, exports) => { -const ip = __nccwpck_require__(95416) -const protocols = __nccwpck_require__(17046) -const { CID } = __nccwpck_require__(24247) -const { base32 } = __nccwpck_require__(70784) -const { base58btc } = __nccwpck_require__(49108) -const Digest = __nccwpck_require__(81168) -const varint = __nccwpck_require__(52865) -const { toString: uint8ArrayToString } = __nccwpck_require__(2771) -const { fromString: uint8ArrayFromString } = __nccwpck_require__(39451) -const { concat: uint8ArrayConcat } = __nccwpck_require__(17225) -module.exports = Convert +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.sleep = void 0; +const sleep = (seconds) => { + return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); +}; +exports.sleep = sleep; -// converts (serializes) addresses -/** - * @param {string} proto - * @param {string | Uint8Array} a - */ -function Convert (proto, a) { - if (a instanceof Uint8Array) { - return Convert.toString(proto, a) - } else { - return Convert.toBytes(proto, a) - } -} -/** - * Convert [code,Uint8Array] to string - * - * @param {number|string} proto - * @param {Uint8Array} buf - * @returns {string} - */ -Convert.toString = function convertToString (proto, buf) { - const protocol = protocols(proto) - switch (protocol.code) { - case 4: // ipv4 - case 41: // ipv6 - return bytes2ip(buf) +/***/ }), - case 6: // tcp - case 273: // udp - case 33: // dccp - case 132: // sctp - return bytes2port(buf).toString() +/***/ 96065: +/***/ ((__unused_webpack_module, exports) => { - case 53: // dns - case 54: // dns4 - case 55: // dns6 - case 56: // dnsaddr - case 400: // unix - case 777: // memory - return bytes2str(buf) - case 421: // ipfs - return bytes2mh(buf) - case 444: // onion - return bytes2onion(buf) - case 445: // onion3 - return bytes2onion(buf) - default: - return uint8ArrayToString(buf, 'base16') // no clue. convert to hex - } -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.validateWaiterOptions = void 0; +const validateWaiterOptions = (options) => { + if (options.maxWaitTime < 1) { + throw new Error(`WaiterConfiguration.maxWaitTime must be greater than 0`); + } + else if (options.minDelay < 1) { + throw new Error(`WaiterConfiguration.minDelay must be greater than 0`); + } + else if (options.maxDelay < 1) { + throw new Error(`WaiterConfiguration.maxDelay must be greater than 0`); + } + else if (options.maxWaitTime <= options.minDelay) { + throw new Error(`WaiterConfiguration.maxWaitTime [${options.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${options.minDelay}] for this waiter`); + } + else if (options.maxDelay < options.minDelay) { + throw new Error(`WaiterConfiguration.maxDelay [${options.maxDelay}] must be greater than WaiterConfiguration.minDelay [${options.minDelay}] for this waiter`); + } +}; +exports.validateWaiterOptions = validateWaiterOptions; -Convert.toBytes = function convertToBytes (/** @type {string | number } */ proto, /** @type {string} */ str) { - const protocol = protocols(proto) - switch (protocol.code) { - case 4: // ipv4 - return ip2bytes(str) - case 41: // ipv6 - return ip2bytes(str) - case 6: // tcp - case 273: // udp - case 33: // dccp - case 132: // sctp - return port2bytes(parseInt(str, 10)) +/***/ }), - case 53: // dns - case 54: // dns4 - case 55: // dns6 - case 56: // dnsaddr - case 400: // unix - case 777: // memory - return str2bytes(str) +/***/ 36641: +/***/ ((__unused_webpack_module, exports) => { - case 421: // ipfs - return mh2bytes(str) - case 444: // onion - return onion2bytes(str) - case 445: // onion3 - return onion32bytes(str) - default: - return uint8ArrayFromString(str, 'base16') // no clue. convert from hex - } -} -/** - * @param {string} ipString - */ -function ip2bytes (ipString) { - if (!ip.isIP(ipString)) { - throw new Error('invalid ip address') - } - return ip.toBytes(ipString) -} +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.checkExceptions = exports.WaiterState = exports.waiterServiceDefaults = void 0; +exports.waiterServiceDefaults = { + minDelay: 2, + maxDelay: 120, +}; +var WaiterState; +(function (WaiterState) { + WaiterState["ABORTED"] = "ABORTED"; + WaiterState["FAILURE"] = "FAILURE"; + WaiterState["SUCCESS"] = "SUCCESS"; + WaiterState["RETRY"] = "RETRY"; + WaiterState["TIMEOUT"] = "TIMEOUT"; +})(WaiterState = exports.WaiterState || (exports.WaiterState = {})); +const checkExceptions = (result) => { + if (result.state === WaiterState.ABORTED) { + const abortError = new Error(`${JSON.stringify({ + ...result, + reason: "Request was aborted", + })}`); + abortError.name = "AbortError"; + throw abortError; + } + else if (result.state === WaiterState.TIMEOUT) { + const timeoutError = new Error(`${JSON.stringify({ + ...result, + reason: "Waiter has timed out", + })}`); + timeoutError.name = "TimeoutError"; + throw timeoutError; + } + else if (result.state !== WaiterState.SUCCESS) { + throw new Error(`${JSON.stringify({ result })}`); + } + return result; +}; +exports.checkExceptions = checkExceptions; -/** - * @param {Uint8Array} ipBuff - */ -function bytes2ip (ipBuff) { - const ipString = ip.toString(ipBuff) - if (!ipString || !ip.isIP(ipString)) { - throw new Error('invalid ip address') - } - return ipString -} -/** - * @param {number} port - */ -function port2bytes (port) { - const buf = new ArrayBuffer(2) - const view = new DataView(buf) - view.setUint16(0, port) +/***/ }), - return new Uint8Array(buf) -} +/***/ 14577: +/***/ ((module) => { /** - * @param {Uint8Array} buf + * Takes an array of AbortSignals and returns a single signal. + * If any signals are aborted, the returned signal will be aborted. + * @param {Array} signals + * @returns {AbortSignal} */ -function bytes2port (buf) { - const view = new DataView(buf.buffer) - return view.getUint16(buf.byteOffset) -} +function anySignal (signals) { + const controller = new globalThis.AbortController() -/** - * @param {string} str - */ -function str2bytes (str) { - const buf = uint8ArrayFromString(str) - const size = Uint8Array.from(varint.encode(buf.length)) - return uint8ArrayConcat([size, buf], size.length + buf.length) -} + function onAbort () { + controller.abort() -/** - * @param {Uint8Array} buf - */ -function bytes2str (buf) { - const size = varint.decode(buf) - buf = buf.slice(varint.decode.bytes) + for (const signal of signals) { + if (!signal || !signal.removeEventListener) continue + signal.removeEventListener('abort', onAbort) + } + } - if (buf.length !== size) { - throw new Error('inconsistent lengths') + for (const signal of signals) { + if (!signal || !signal.addEventListener) continue + if (signal.aborted) { + onAbort() + break + } + signal.addEventListener('abort', onAbort) } - return uint8ArrayToString(buf) + return controller.signal } -/** - * @param {string} hash - base58btc string - */ -function mh2bytes (hash) { - let mh +module.exports = anySignal +module.exports.anySignal = anySignal - if (hash[0] === 'Q' || hash[0] === '1') { - mh = Digest.decode(base58btc.decode(`z${hash}`)).bytes - } else { - mh = CID.parse(hash).multihash.bytes - } - // the address is a varint prefixed multihash string representation - const size = Uint8Array.from(varint.encode(mh.length)) - return uint8ArrayConcat([size, mh], size.length + mh.length) -} +/***/ }), -/** - * Converts bytes to bas58btc string - * - * @param {Uint8Array} buf - * @returns {string} base58btc string - */ -function bytes2mh (buf) { - const size = varint.decode(buf) - const address = buf.slice(varint.decode.bytes) +/***/ 86686: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (address.length !== size) { - throw new Error('inconsistent lengths') - } +module.exports = +{ + parallel : __nccwpck_require__(40598), + serial : __nccwpck_require__(99365), + serialOrdered : __nccwpck_require__(91701) +}; - return uint8ArrayToString(address, 'base58btc') -} -/** - * @param {string} str - */ -function onion2bytes (str) { - const addr = str.split(':') - if (addr.length !== 2) { - throw new Error('failed to parse onion addr: ' + addr + ' does not contain a port number') - } - if (addr[0].length !== 16) { - throw new Error('failed to parse onion addr: ' + addr[0] + ' not a Tor onion address.') - } +/***/ }), - // onion addresses do not include the multibase prefix, add it before decoding - const buf = base32.decode('b' + addr[0]) +/***/ 8805: +/***/ ((module) => { - // onion port number - const port = parseInt(addr[1], 10) - if (port < 1 || port > 65536) { - throw new Error('Port number is not in range(1, 65536)') - } - const portBuf = port2bytes(port) - return uint8ArrayConcat([buf, portBuf], buf.length + portBuf.length) -} +// API +module.exports = abort; /** - * @param {string} str + * Aborts leftover active jobs + * + * @param {object} state - current state object */ -function onion32bytes (str) { - const addr = str.split(':') - if (addr.length !== 2) { - throw new Error('failed to parse onion addr: ' + addr + ' does not contain a port number') - } - if (addr[0].length !== 56) { - throw new Error('failed to parse onion addr: ' + addr[0] + ' not a Tor onion3 address.') - } - // onion addresses do not include the multibase prefix, add it before decoding - const buf = base32.decode('b' + addr[0]) +function abort(state) +{ + Object.keys(state.jobs).forEach(clean.bind(state)); - // onion port number - const port = parseInt(addr[1], 10) - if (port < 1 || port > 65536) { - throw new Error('Port number is not in range(1, 65536)') - } - const portBuf = port2bytes(port) - return uint8ArrayConcat([buf, portBuf], buf.length + portBuf.length) + // reset leftover jobs + state.jobs = {}; } /** - * @param {Uint8Array} buf + * Cleans up leftover job by invoking abort function for the provided job id + * + * @this state + * @param {string|number} key - job id to abort */ -function bytes2onion (buf) { - const addrBytes = buf.slice(0, buf.length - 2) - const portBytes = buf.slice(buf.length - 2) - const addr = uint8ArrayToString(addrBytes, 'base32') - const port = bytes2port(portBytes) - return addr + ':' + port +function clean(key) +{ + if (typeof this.jobs[key] == 'function') + { + this.jobs[key](); + } } /***/ }), -/***/ 17907: +/***/ 17113: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; - - -const codec = __nccwpck_require__(41437) -const protocols = __nccwpck_require__(17046) -const varint = __nccwpck_require__(52865) -const { CID } = __nccwpck_require__(24247) -const { base58btc } = __nccwpck_require__(49108) -const errCode = __nccwpck_require__(5822) -const inspect = Symbol.for('nodejs.util.inspect.custom') -const { toString: uint8ArrayToString } = __nccwpck_require__(2771) -const { equals: uint8ArrayEquals } = __nccwpck_require__(94646) +var defer = __nccwpck_require__(38655); -/** - * @typedef {(addr: Multiaddr) => Promise} Resolver - * @typedef {string | Multiaddr | Uint8Array | null} MultiaddrInput - * @typedef {import('./types').MultiaddrObject} MultiaddrObject - * @typedef {import('./types').Protocol} Protocol - */ - -/** @type {Map} */ -const resolvers = new Map() -const symbol = Symbol.for('@multiformats/js-multiaddr/multiaddr') +// API +module.exports = async; /** - * Creates a [multiaddr](https://github.com/multiformats/multiaddr) from - * a Uint8Array, String or another Multiaddr instance - * public key. + * Runs provided callback asynchronously + * even if callback itself is not * + * @param {function} callback - callback to invoke + * @returns {function} - augmented callback */ -class Multiaddr { - /** - * @example - * ```js - * new Multiaddr('/ip4/127.0.0.1/tcp/4001') - * // - * ``` - * - * @param {MultiaddrInput} [addr] - If String or Uint8Array, needs to adhere to the address format of a [multiaddr](https://github.com/multiformats/multiaddr#string-format) - */ - constructor (addr) { - // default - if (addr == null) { - addr = '' - } +function async(callback) +{ + var isAsync = false; - // Define symbol - Object.defineProperty(this, symbol, { value: true }) + // check if async happened + defer(function() { isAsync = true; }); - if (addr instanceof Uint8Array) { - /** @type {Uint8Array} - The raw bytes representing this multiaddress */ - this.bytes = codec.fromBytes(addr) - } else if (typeof addr === 'string') { - if (addr.length > 0 && addr.charAt(0) !== '/') { - throw new Error(`multiaddr "${addr}" must start with a "/"`) - } - this.bytes = codec.fromString(addr) - } else if (Multiaddr.isMultiaddr(addr)) { // Multiaddr - this.bytes = codec.fromBytes(addr.bytes) // validate + copy buffer - } else { - throw new Error('addr must be a string, Buffer, or another Multiaddr') + return function async_callback(err, result) + { + if (isAsync) + { + callback(err, result); } - } - - /** - * Returns Multiaddr as a String - * - * @example - * ```js - * new Multiaddr('/ip4/127.0.0.1/tcp/4001').toString() - * // '/ip4/127.0.0.1/tcp/4001' - * ``` - */ - toString () { - return codec.bytesToString(this.bytes) - } - - /** - * Returns Multiaddr as a JSON encoded object - * - * @example - * ```js - * JSON.stringify(new Multiaddr('/ip4/127.0.0.1/tcp/4001')) - * // '/ip4/127.0.0.1/tcp/4001' - * ``` - */ - toJSON () { - return this.toString() - } - - /** - * Returns Multiaddr as a convinient options object to be used with net.createConnection - * - * @example - * ```js - * new Multiaddr('/ip4/127.0.0.1/tcp/4001').toOptions() - * // { family: 4, host: '127.0.0.1', transport: 'tcp', port: 4001 } - * ``` - */ - toOptions () { - /** @type {MultiaddrObject} */ - const opts = {} - const parsed = this.toString().split('/') - opts.family = parsed[1] === 'ip4' ? 4 : 6 - opts.host = parsed[2] - opts.transport = parsed[3] - opts.port = parseInt(parsed[4]) - return opts - } - - /** - * Returns the protocols the Multiaddr is defined with, as an array of objects, in - * left-to-right order. Each object contains the protocol code, protocol name, - * and the size of its address space in bits. - * [See list of protocols](https://github.com/multiformats/multiaddr/blob/master/protocols.csv) - * - * @example - * ```js - * new Multiaddr('/ip4/127.0.0.1/tcp/4001').protos() - * // [ { code: 4, size: 32, name: 'ip4' }, - * // { code: 6, size: 16, name: 'tcp' } ] - * ``` - * - * @returns {Protocol[]} protocols - All the protocols the address is composed of - */ - protos () { - return this.protoCodes().map(code => Object.assign({}, protocols(code))) - } - - /** - * Returns the codes of the protocols in left-to-right order. - * [See list of protocols](https://github.com/multiformats/multiaddr/blob/master/protocols.csv) - * - * @example - * ```js - * Multiaddr('/ip4/127.0.0.1/tcp/4001').protoCodes() - * // [ 4, 6 ] - * ``` - * - * @returns {number[]} protocol codes - */ - protoCodes () { - const codes = [] - const buf = this.bytes - let i = 0 - while (i < buf.length) { - const code = varint.decode(buf, i) - const n = varint.decode.bytes - - const p = protocols(code) - const size = codec.sizeForAddr(p, buf.slice(i + n)) - - i += (size + n) - codes.push(code) + else + { + defer(function nextTick_callback() + { + callback(err, result); + }); } + }; +} - return codes - } - /** - * Returns the names of the protocols in left-to-right order. - * [See list of protocols](https://github.com/multiformats/multiaddr/blob/master/protocols.csv) - * - * @example - * ```js - * new Multiaddr('/ip4/127.0.0.1/tcp/4001').protoNames() - * // [ 'ip4', 'tcp' ] - * ``` - * - * @returns {string[]} protocol names - */ - protoNames () { - return this.protos().map(proto => proto.name) - } +/***/ }), - /** - * Returns a tuple of parts - * - * @example - * ```js - * new Multiaddr("/ip4/127.0.0.1/tcp/4001").tuples() - * // [ [ 4, ], [ 6, ] ] - * ``` - */ - tuples () { - return codec.bytesToTuples(this.bytes) - } +/***/ 38655: +/***/ ((module) => { - /** - * Returns a tuple of string/number parts - * - tuples[][0] = code of protocol - * - tuples[][1] = contents of address - * - * @example - * ```js - * new Multiaddr("/ip4/127.0.0.1/tcp/4001").stringTuples() - * // [ [ 4, '127.0.0.1' ], [ 6, '4001' ] ] - * ``` - */ - stringTuples () { - const t = codec.bytesToTuples(this.bytes) - return codec.tuplesToStringTuples(t) - } +module.exports = defer; - /** - * Encapsulates a Multiaddr in another Multiaddr - * - * @example - * ```js - * const mh1 = new Multiaddr('/ip4/8.8.8.8/tcp/1080') - * // - * - * const mh2 = new Multiaddr('/ip4/127.0.0.1/tcp/4001') - * // - * - * const mh3 = mh1.encapsulate(mh2) - * // - * - * mh3.toString() - * // '/ip4/8.8.8.8/tcp/1080/ip4/127.0.0.1/tcp/4001' - * ``` - * - * @param {MultiaddrInput} addr - Multiaddr to add into this Multiaddr - */ - encapsulate (addr) { - addr = new Multiaddr(addr) - return new Multiaddr(this.toString() + addr.toString()) - } +/** + * Runs provided function on next iteration of the event loop + * + * @param {function} fn - function to run + */ +function defer(fn) +{ + var nextTick = typeof setImmediate == 'function' + ? setImmediate + : ( + typeof process == 'object' && typeof process.nextTick == 'function' + ? process.nextTick + : null + ); - /** - * Decapsulates a Multiaddr from another Multiaddr - * - * @example - * ```js - * const mh1 = new Multiaddr('/ip4/8.8.8.8/tcp/1080') - * // - * - * const mh2 = new Multiaddr('/ip4/127.0.0.1/tcp/4001') - * // - * - * const mh3 = mh1.encapsulate(mh2) - * // - * - * mh3.decapsulate(mh2).toString() - * // '/ip4/8.8.8.8/tcp/1080' - * ``` - * - * @param {Multiaddr | string} addr - Multiaddr to remove from this Multiaddr - * @returns {Multiaddr} - */ - decapsulate (addr) { - const addrString = addr.toString() - const s = this.toString() - const i = s.lastIndexOf(addrString) - if (i < 0) { - throw new Error('Address ' + this + ' does not contain subaddress: ' + addr) - } - return new Multiaddr(s.slice(0, i)) + if (nextTick) + { + nextTick(fn); } - - /** - * A more reliable version of `decapsulate` if you are targeting a - * specific code, such as 421 (the `p2p` protocol code). The last index of the code - * will be removed from the `Multiaddr`, and a new instance will be returned. - * If the code is not present, the original `Multiaddr` is returned. - * - * @example - * ```js - * const addr = new Multiaddr('/ip4/0.0.0.0/tcp/8080/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC') - * // - * - * addr.decapsulateCode(421).toString() - * // '/ip4/0.0.0.0/tcp/8080' - * - * new Multiaddr('/ip4/127.0.0.1/tcp/8080').decapsulateCode(421).toString() - * // '/ip4/127.0.0.1/tcp/8080' - * ``` - * - * @param {number} code - The code of the protocol to decapsulate from this Multiaddr - * @returns {Multiaddr} - */ - decapsulateCode (code) { - const tuples = this.tuples() - for (let i = tuples.length - 1; i >= 0; i--) { - if (tuples[i][0] === code) { - return new Multiaddr(codec.tuplesToBytes(tuples.slice(0, i))) - } - } - return this + else + { + setTimeout(fn, 0); } +} - /** - * Extract the peerId if the multiaddr contains one - * - * @example - * ```js - * const mh1 = new Multiaddr('/ip4/8.8.8.8/tcp/1080/ipfs/QmValidBase58string') - * // - * - * // should return QmValidBase58string or null if the id is missing or invalid - * const peerId = mh1.getPeerId() - * ``` - * - * @returns {string | null} peerId - The id of the peer or null if invalid or missing from the ma - */ - getPeerId () { - try { - const tuples = this.stringTuples().filter((tuple) => { - if (tuple[0] === protocols.names.ipfs.code) { - return true - } - return false - }) - - // Get the last ipfs tuple ['ipfs', 'peerid string'] - const tuple = tuples.pop() - if (tuple && tuple[1]) { - const peerIdStr = tuple[1] - - // peer id is base58btc encoded string but not multibase encoded so add the `z` - // prefix so we can validate that it is correctly encoded - if (peerIdStr[0] === 'Q' || peerIdStr[0] === '1') { - return uint8ArrayToString(base58btc.decode(`z${peerIdStr}`), 'base58btc') - } - - // try to parse peer id as CID - return uint8ArrayToString(CID.parse(peerIdStr).multihash.bytes, 'base58btc') - } - - return null - } catch (e) { - return null - } - } - /** - * Extract the path if the multiaddr contains one - * - * @example - * ```js - * const mh1 = new Multiaddr('/ip4/8.8.8.8/tcp/1080/unix/tmp/p2p.sock') - * // - * - * // should return utf8 string or null if the id is missing or invalid - * const path = mh1.getPath() - * ```js - * - * @returns {string | null} path - The path of the multiaddr, or null if no path protocol is present - */ - getPath () { - let path = null - try { - path = this.stringTuples().filter((tuple) => { - const proto = protocols(tuple[0]) - if (proto.path) { - return true - } - return false - })[0][1] +/***/ }), - if (!path) { - path = null - } - } catch (e) { - path = null - } - return path - } +/***/ 24811: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Checks if two Multiaddrs are the same - * - * @example - * ```js - * const mh1 = new Multiaddr('/ip4/8.8.8.8/tcp/1080') - * // - * - * const mh2 = new Multiaddr('/ip4/127.0.0.1/tcp/4001') - * // - * - * mh1.equals(mh1) - * // true - * - * mh1.equals(mh2) - * // false - * ``` - * - * @param {Multiaddr} addr - * @returns {boolean} - */ - equals (addr) { - return uint8ArrayEquals(this.bytes, addr.bytes) - } +var async = __nccwpck_require__(17113) + , abort = __nccwpck_require__(8805) + ; - /** - * Resolve multiaddr if containing resolvable hostname. - * - * @example - * ```js - * Multiaddr.resolvers.set('dnsaddr', resolverFunction) - * const mh1 = new Multiaddr('/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb') - * const resolvedMultiaddrs = await mh1.resolve() - * // [ - * // , - * // , - * // - * // ] - * ``` - * - * @returns {Promise>} - */ - async resolve () { - const resolvableProto = this.protos().find((p) => p.resolvable) +// API +module.exports = iterate; - // Multiaddr is not resolvable? - if (!resolvableProto) { - return [this] - } +/** + * Iterates over each job object + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {object} state - current job status + * @param {function} callback - invoked when all elements processed + */ +function iterate(list, iterator, state, callback) +{ + // store current index + var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; - const resolver = resolvers.get(resolvableProto.name) - if (!resolver) { - throw errCode(new Error(`no available resolver for ${resolvableProto.name}`), 'ERR_NO_AVAILABLE_RESOLVER') + state.jobs[key] = runJob(iterator, key, list[key], function(error, output) + { + // don't repeat yourself + // skip secondary callbacks + if (!(key in state.jobs)) + { + return; } - const addresses = await resolver(this) - return addresses.map((a) => new Multiaddr(a)) - } - - /** - * Gets a Multiaddrs node-friendly address object. Note that protocol information - * is left out: in Node (and most network systems) the protocol is unknowable - * given only the address. - * - * Has to be a ThinWaist Address, otherwise throws error - * - * @example - * ```js - * new Multiaddr('/ip4/127.0.0.1/tcp/4001').nodeAddress() - * // {family: 4, address: '127.0.0.1', port: 4001} - * ``` - * - * @returns {{family: 4 | 6, address: string, port: number}} - * @throws {Error} Throws error if Multiaddr is not a Thin Waist address - */ - nodeAddress () { - const codes = this.protoCodes() - const names = this.protoNames() - const parts = this.toString().split('/').slice(1) + // clean up jobs + delete state.jobs[key]; - if (parts.length < 4) { - throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6}/{address}/{tcp, udp}/{port}".') - } else if (codes[0] !== 4 && codes[0] !== 41 && codes[0] !== 54 && codes[0] !== 55) { - throw new Error(`no protocol with name: "'${names[0]}'". Must have a valid family name: "{ip4, ip6, dns4, dns6}".`) - } else if (parts[2] !== 'tcp' && parts[2] !== 'udp') { - throw new Error(`no protocol with name: "'${names[1]}'". Must have a valid transport protocol: "{tcp, udp}".`) + if (error) + { + // don't process rest of the results + // stop still active jobs + // and reset the list + abort(state); } - - return { - family: (codes[0] === 41 || codes[0] === 55) ? 6 : 4, - address: parts[1], - port: parseInt(parts[3]) // tcp or udp port + else + { + state.results[key] = output; } - } - /** - * Returns if a Multiaddr is a Thin Waist address or not. - * - * Thin Waist is if a Multiaddr adheres to the standard combination of: - * - * `{IPv4, IPv6}/{TCP, UDP}` - * - * @example - * ```js - * const mh1 = new Multiaddr('/ip4/127.0.0.1/tcp/4001') - * // - * const mh2 = new Multiaddr('/ip4/192.168.2.1/tcp/5001') - * // - * const mh3 = mh1.encapsulate(mh2) - * // - * const mh4 = new Multiaddr('/ip4/127.0.0.1/tcp/2000/wss/p2p-webrtc-star/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSooo2a') - * // - * mh1.isThinWaistAddress() - * // true - * mh2.isThinWaistAddress() - * // true - * mh3.isThinWaistAddress() - * // false - * mh4.isThinWaistAddress() - * // false - * ``` - * - * @param {Multiaddr} [addr] - Defaults to using `this` instance - */ - isThinWaistAddress (addr) { - const protos = (addr || this).protos() + // return salvaged results + callback(error, state.results); + }); +} - if (protos.length !== 2) { - return false - } +/** + * Runs iterator over provided job element + * + * @param {function} iterator - iterator to invoke + * @param {string|number} key - key/index of the element in the list of jobs + * @param {mixed} item - job description + * @param {function} callback - invoked after iterator is done with the job + * @returns {function|mixed} - job abort function or something else + */ +function runJob(iterator, key, item, callback) +{ + var aborter; - if (protos[0].code !== 4 && protos[0].code !== 41) { - return false - } - if (protos[1].code !== 6 && protos[1].code !== 273) { - return false - } - return true + // allow shortcut if iterator expects only two arguments + if (iterator.length == 2) + { + aborter = iterator(item, async(callback)); } - - /** - * Creates a Multiaddr from a node-friendly address object - * - * @example - * ```js - * Multiaddr.fromNodeAddress({address: '127.0.0.1', port: '4001'}, 'tcp') - * // - * ``` - * - * @param {{family: 4 | 6, address: string, port: number}} addr - * @param {string} transport - */ - static fromNodeAddress (addr, transport) { - if (!addr) { throw new Error('requires node address object') } - if (!transport) { throw new Error('requires transport protocol') } - let ip - switch (addr.family) { - case 4: - ip = 'ip4' - break - case 6: - ip = 'ip6' - break - default: - throw Error(`Invalid addr family. Got '${addr.family}' instead of 4 or 6`) - } - return new Multiaddr('/' + [ip, addr.address, transport, addr.port].join('/')) + // otherwise go with full three arguments + else + { + aborter = iterator(item, key, async(callback)); } - /** - * Returns if something is a Multiaddr that is a name - * - * @param {Multiaddr} addr - * @returns {boolean} isName - */ - static isName (addr) { - if (!Multiaddr.isMultiaddr(addr)) { - return false - } + return aborter; +} - // if a part of the multiaddr is resolvable, then return true - return addr.protos().some((proto) => proto.resolvable) - } - /** - * Check if object is a CID instance - * - * @param {any} value - * @returns {value is Multiaddr} - */ - static isMultiaddr (value) { - return value instanceof Multiaddr || Boolean(value && value[symbol]) - } +/***/ }), - /** - * Returns Multiaddr as a human-readable string. - * For post Node.js v10.0.0. - * https://nodejs.org/api/deprecations.html#deprecations_dep0079_custom_inspection_function_on_objects_via_inspect - * - * @example - * ```js - * console.log(new Multiaddr('/ip4/127.0.0.1/tcp/4001')) - * // '' - * ``` - * - * @returns {string} - */ - [inspect] () { - return '' - } +/***/ 16693: +/***/ ((module) => { - /** - * Returns Multiaddr as a human-readable string. - * Fallback for pre Node.js v10.0.0. - * https://nodejs.org/api/deprecations.html#deprecations_dep0079_custom_inspection_function_on_objects_via_inspect - * - * @example - * ```js - * new Multiaddr('/ip4/127.0.0.1/tcp/4001').inspect() - * // '' - * ``` - * - * @returns {string} - */ - inspect () { - return '' - } -} +// API +module.exports = state; /** - * Object containing table, names and codes of all supported protocols. - * To get the protocol values from a Multiaddr, you can use - * [`.protos()`](#multiaddrprotos), - * [`.protoCodes()`](#multiaddrprotocodes) or - * [`.protoNames()`](#multiaddrprotonames) + * Creates initial state object + * for iteration over list * - * @returns {{table: Array, names: Object, codes: Object}} + * @param {array|object} list - list to iterate over + * @param {function|null} sortMethod - function to use for keys sort, + * or `null` to keep them as is + * @returns {object} - initial state object */ -Multiaddr.protocols = protocols +function state(list, sortMethod) +{ + var isNamedList = !Array.isArray(list) + , initState = + { + index : 0, + keyedList: isNamedList || sortMethod ? Object.keys(list) : null, + jobs : {}, + results : isNamedList ? {} : [], + size : isNamedList ? Object.keys(list).length : list.length + } + ; -Multiaddr.resolvers = resolvers + if (sortMethod) + { + // sort array keys based on it's values + // sort object's keys just on own merit + initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) + { + return sortMethod(list[a], list[b]); + }); + } -/** - * Static factory - * - * @param {MultiaddrInput} addr - */ -function multiaddr (addr) { - return new Multiaddr(addr) + return initState; } -module.exports = { Multiaddr, multiaddr, protocols, resolvers } - /***/ }), -/***/ 95416: +/***/ 92774: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var abort = __nccwpck_require__(8805) + , async = __nccwpck_require__(17113) + ; +// API +module.exports = terminator; -const isIp = __nccwpck_require__(89837) -const { toString: uint8ArrayToString } = __nccwpck_require__(2771) +/** + * Terminates jobs in the attached state context + * + * @this AsyncKitState# + * @param {function} callback - final callback to invoke after termination + */ +function terminator(callback) +{ + if (!Object.keys(this.jobs).length) + { + return; + } -const isIP = isIp -const isV4 = isIp.v4 -const isV6 = isIp.v6 + // fast forward iteration index + this.index = this.size; -// Copied from https://github.com/indutny/node-ip/blob/master/lib/ip.js#L7 -// @ts-ignore - this is copied from the link above better to keep it the same -const toBytes = function (ip, buff, offset) { - offset = ~~offset + // abort jobs + abort(this); - let result + // send back results we have so far + async(callback)(null, this.results); +} - if (isV4(ip)) { - result = buff || new Uint8Array(offset + 4) - // @ts-ignore - // eslint-disable-next-line array-callback-return - ip.split(/\./g).map(function (byte) { - result[offset++] = parseInt(byte, 10) & 0xff - }) - } else if (isV6(ip)) { - const sections = ip.split(':', 8) - let i - for (i = 0; i < sections.length; i++) { - const isv4 = isV4(sections[i]) - let v4Buffer +/***/ }), - if (isv4) { - v4Buffer = toBytes(sections[i]) - sections[i] = uint8ArrayToString(v4Buffer.slice(0, 2), 'base16') - } +/***/ 40598: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (v4Buffer && ++i < 8) { - sections.splice(i, 0, uint8ArrayToString(v4Buffer.slice(2, 4), 'base16')) - } - } +var iterate = __nccwpck_require__(24811) + , initState = __nccwpck_require__(16693) + , terminator = __nccwpck_require__(92774) + ; - if (sections[0] === '') { - while (sections.length < 8) sections.unshift('0') - } else if (sections[sections.length - 1] === '') { - while (sections.length < 8) sections.push('0') - } else if (sections.length < 8) { - for (i = 0; i < sections.length && sections[i] !== ''; i++); - const argv = [i, '1'] - for (i = 9 - sections.length; i > 0; i--) { - argv.push('0') +// Public API +module.exports = parallel; + +/** + * Runs iterator over provided array elements in parallel + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function parallel(list, iterator, callback) +{ + var state = initState(list); + + while (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, function(error, result) + { + if (error) + { + callback(error, result); + return; } - sections.splice.apply(sections, argv) - } - result = buff || new Uint8Array(offset + 16) - for (i = 0; i < sections.length; i++) { - const word = parseInt(sections[i], 16) - result[offset++] = (word >> 8) & 0xff - result[offset++] = word & 0xff - } - } + // looks like it's the last one + if (Object.keys(state.jobs).length === 0) + { + callback(null, state.results); + return; + } + }); - if (!result) { - throw Error('Invalid ip address: ' + ip) + state.index++; } - return result + return terminator.bind(state, callback); } -// Copied from https://github.com/indutny/node-ip/blob/master/lib/ip.js#L63 -// @ts-ignore - this is copied from the link above better to keep it the same -const toString = function (buff, offset, length) { - offset = ~~offset - length = length || (buff.length - offset) - const result = [] - let string - const view = new DataView(buff.buffer) - if (length === 4) { - // IPv4 - for (let i = 0; i < length; i++) { - result.push(buff[offset + i]) - } - string = result.join('.') - } else if (length === 16) { - // IPv6 - for (let i = 0; i < length; i += 2) { - result.push(view.getUint16(offset + i).toString(16)) - } - string = result.join(':') - string = string.replace(/(^|:)0(:0)*:0(:|$)/, '$1::$3') - string = string.replace(/:{3,4}/, '::') - } +/***/ }), - return string -} +/***/ 99365: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = { - isIP, - isV4, - isV6, - toBytes, - toString +var serialOrdered = __nccwpck_require__(91701); + +// Public API +module.exports = serial; + +/** + * Runs iterator over provided array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serial(list, iterator, callback) +{ + return serialOrdered(list, iterator, null, callback); } /***/ }), -/***/ 17046: -/***/ ((module) => { +/***/ 91701: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var iterate = __nccwpck_require__(24811) + , initState = __nccwpck_require__(16693) + , terminator = __nccwpck_require__(92774) + ; -/** @typedef {import("./types").Protocol} Protocol */ +// Public API +module.exports = serialOrdered; +// sorting helpers +module.exports.ascending = ascending; +module.exports.descending = descending; /** - * Protocols + * Runs iterator over provided sorted array elements in series * - * @param {number | string} proto - * @returns {Protocol} + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator */ -function Protocols (proto) { - if (typeof (proto) === 'number') { - if (Protocols.codes[proto]) { - return Protocols.codes[proto] - } +function serialOrdered(list, iterator, sortMethod, callback) +{ + var state = initState(list, sortMethod); - throw new Error('no protocol with code: ' + proto) - } else if (typeof (proto) === 'string') { - if (Protocols.names[proto]) { - return Protocols.names[proto] + iterate(list, iterator, state, function iteratorHandler(error, result) + { + if (error) + { + callback(error, result); + return; } - throw new Error('no protocol with name: ' + proto) - } - - throw new Error('invalid protocol id type: ' + proto) -} + state.index++; -const V = -1 -Protocols.lengthPrefixedVarSize = V -Protocols.V = V + // are we there yet? + if (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, iteratorHandler); + return; + } -/** @type {Array<[number, number, string, (string|boolean)?, string?]>} */ -Protocols.table = [ - [4, 32, 'ip4'], - [6, 16, 'tcp'], - [33, 16, 'dccp'], - [41, 128, 'ip6'], - [42, V, 'ip6zone'], - [53, V, 'dns', 'resolvable'], - [54, V, 'dns4', 'resolvable'], - [55, V, 'dns6', 'resolvable'], - [56, V, 'dnsaddr', 'resolvable'], - [132, 16, 'sctp'], - [273, 16, 'udp'], - [275, 0, 'p2p-webrtc-star'], - [276, 0, 'p2p-webrtc-direct'], - [277, 0, 'p2p-stardust'], - [290, 0, 'p2p-circuit'], - [301, 0, 'udt'], - [302, 0, 'utp'], - [400, V, 'unix', false, 'path'], - // `ipfs` is added before `p2p` for legacy support. - // All text representations will default to `p2p`, but `ipfs` will - // still be supported - [421, V, 'ipfs'], - // `p2p` is the preferred name for 421, and is now the default - [421, V, 'p2p'], - [443, 0, 'https'], - [444, 96, 'onion'], - [445, 296, 'onion3'], - [446, V, 'garlic64'], - [460, 0, 'quic'], - [477, 0, 'ws'], - [478, 0, 'wss'], - [479, 0, 'p2p-websocket-star'], - [480, 0, 'http'], - [777, V, 'memory'] -] -/** @type {Record} */ -Protocols.names = {} -/** @type {Record} */ -Protocols.codes = {} + // done here + callback(null, state.results); + }); -// populate tables -Protocols.table.map(row => { - const proto = p.apply(null, row) - Protocols.codes[proto.code] = proto - Protocols.names[proto.name] = proto - return null -}) + return terminator.bind(state, callback); +} -Protocols.object = p +/* + * -- Sort methods + */ /** + * sort helper to sort array elements in ascending order * - * Create a protocol - * - * @param {number} code - * @param {number} size - * @param {string} name - * @param {any} [resolvable] - * @param {any} [path] - * @returns {Protocol} + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result */ -function p (code, size, name, resolvable, path) { - return { - code, - size, - name, - resolvable: Boolean(resolvable), - path: Boolean(path) - } +function ascending(a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; } -module.exports = Protocols +/** + * sort helper to sort array elements in descending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function descending(a, b) +{ + return -1 * ascending(a, b); +} /***/ }), -/***/ 76975: +/***/ 11808: /***/ ((module) => { -module.exports = read - -var MSB = 0x80 - , REST = 0x7F -function read(buf, offset) { - var res = 0 - , offset = offset || 0 - , shift = 0 - , counter = offset - , b - , l = buf.length +module.exports = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); - do { - if (counter >= l || shift > 49) { - read.bytes = 0 - throw new RangeError('Could not decode varint') - } - b = buf[counter++] - res += shift < 28 - ? (b & REST) << shift - : (b & REST) * Math.pow(2, shift) - shift += 7 - } while (b >= MSB) + var r = range(a, b, str); - read.bytes = counter - offset + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} - return res +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; } +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; -/***/ }), + if (ai >= 0 && bi > 0) { + begs = []; + left = str.length; -/***/ 32291: -/***/ ((module) => { + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } -module.exports = encode + bi = str.indexOf(b, i + 1); + } -var MSB = 0x80 - , REST = 0x7F - , MSBALL = ~REST - , INT = Math.pow(2, 31) + i = ai < bi && ai >= 0 ? ai : bi; + } -function encode(num, out, offset) { - if (Number.MAX_SAFE_INTEGER && num > Number.MAX_SAFE_INTEGER) { - encode.bytes = 0 - throw new RangeError('Could not encode varint') + if (begs.length) { + result = [ left, right ]; + } } - out = out || [] - offset = offset || 0 - var oldOffset = offset - while(num >= INT) { - out[offset++] = (num & 0xFF) | MSB - num /= 128 - } - while(num & MSBALL) { - out[offset++] = (num & 0xFF) | MSB - num >>>= 7 - } - out[offset] = num | 0 - - encode.bytes = offset - oldOffset + 1 - - return out + return result; } /***/ }), -/***/ 52865: +/***/ 63491: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = { - encode: __nccwpck_require__(32291) - , decode: __nccwpck_require__(76975) - , encodingLength: __nccwpck_require__(52845) -} +var register = __nccwpck_require__(18045); +var addHook = __nccwpck_require__(65713); +var removeHook = __nccwpck_require__(1521); +// bind with array of arguments: https://stackoverflow.com/a/21792913 +var bind = Function.bind; +var bindable = bind.bind(bind); -/***/ }), +function bindApi(hook, state, name) { + var removeHookRef = bindable(removeHook, null).apply( + null, + name ? [state, name] : [state] + ); + hook.api = { remove: removeHookRef }; + hook.remove = removeHookRef; + ["before", "error", "after", "wrap"].forEach(function (kind) { + var args = name ? [state, kind, name] : [state, kind]; + hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args); + }); +} -/***/ 52845: -/***/ ((module) => { +function HookSingular() { + var singularHookName = "h"; + var singularHookState = { + registry: {}, + }; + var singularHook = register.bind(null, singularHookState, singularHookName); + bindApi(singularHook, singularHookState, singularHookName); + return singularHook; +} +function HookCollection() { + var state = { + registry: {}, + }; -var N1 = Math.pow(2, 7) -var N2 = Math.pow(2, 14) -var N3 = Math.pow(2, 21) -var N4 = Math.pow(2, 28) -var N5 = Math.pow(2, 35) -var N6 = Math.pow(2, 42) -var N7 = Math.pow(2, 49) -var N8 = Math.pow(2, 56) -var N9 = Math.pow(2, 63) + var hook = register.bind(null, state); + bindApi(hook, state); -module.exports = function (value) { - 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 - ) + return hook; } +var collectionHookDeprecationMessageDisplayed = false; +function Hook() { + if (!collectionHookDeprecationMessageDisplayed) { + console.warn( + '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4' + ); + collectionHookDeprecationMessageDisplayed = true; + } + return HookCollection(); +} -/***/ }), +Hook.Singular = HookSingular.bind(); +Hook.Collection = HookCollection.bind(); -/***/ 16924: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +module.exports = Hook; +// expose constructors as a named property for TypeScript +module.exports.Hook = Hook; +module.exports.Singular = Hook.Singular; +module.exports.Collection = Hook.Collection; +/***/ }), -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ 65713: +/***/ ((module) => { -<<<<<<< HEAD -var baseX$1 = __nccwpck_require__(33033); -var bytes = __nccwpck_require__(87450); -======= -var baseX$1 = __nccwpck_require__(21357); -var bytes = __nccwpck_require__(16570); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +module.exports = addHook; -class Encoder { - constructor(name, prefix, baseEncode) { - this.name = name; - this.prefix = prefix; - this.baseEncode = baseEncode; - } - encode(bytes) { - if (bytes instanceof Uint8Array) { - return `${ this.prefix }${ this.baseEncode(bytes) }`; - } else { - throw Error('Unknown type, must be binary type'); - } - } -} -class Decoder { - constructor(name, prefix, baseDecode) { - this.name = name; - this.prefix = prefix; - if (prefix.codePointAt(0) === undefined) { - throw new Error('Invalid prefix character'); - } - this.prefixCodePoint = prefix.codePointAt(0); - this.baseDecode = baseDecode; - } - decode(text) { - if (typeof text === 'string') { - if (text.codePointAt(0) !== this.prefixCodePoint) { - throw Error(`Unable to decode multibase string ${ JSON.stringify(text) }, ${ this.name } decoder only supports inputs prefixed with ${ this.prefix }`); - } - return this.baseDecode(text.slice(this.prefix.length)); - } else { - throw Error('Can only multibase decode strings'); - } - } - or(decoder) { - return or(this, decoder); - } -} -class ComposedDecoder { - constructor(decoders) { - this.decoders = decoders; - } - or(decoder) { - return or(this, decoder); - } - decode(input) { - const prefix = input[0]; - const decoder = this.decoders[prefix]; - if (decoder) { - return decoder.decode(input); - } else { - throw RangeError(`Unable to decode multibase string ${ JSON.stringify(input) }, only inputs prefixed with ${ Object.keys(this.decoders) } are supported`); - } +function addHook(state, kind, name, hook) { + var orig = hook; + if (!state.registry[name]) { + state.registry[name] = []; } -} -const or = (left, right) => new ComposedDecoder({ - ...left.decoders || { [left.prefix]: left }, - ...right.decoders || { [right.prefix]: right } -}); -class Codec { - constructor(name, prefix, baseEncode, baseDecode) { - this.name = name; - this.prefix = prefix; - this.baseEncode = baseEncode; - this.baseDecode = baseDecode; - this.encoder = new Encoder(name, prefix, baseEncode); - this.decoder = new Decoder(name, prefix, baseDecode); + + if (kind === "before") { + hook = function (method, options) { + return Promise.resolve() + .then(orig.bind(null, options)) + .then(method.bind(null, options)); + }; } - encode(input) { - return this.encoder.encode(input); + + if (kind === "after") { + hook = function (method, options) { + var result; + return Promise.resolve() + .then(method.bind(null, options)) + .then(function (result_) { + result = result_; + return orig(result, options); + }) + .then(function () { + return result; + }); + }; } - decode(input) { - return this.decoder.decode(input); + + if (kind === "error") { + hook = function (method, options) { + return Promise.resolve() + .then(method.bind(null, options)) + .catch(function (error) { + return orig(error, options); + }); + }; } -} -const from = ({name, prefix, encode, decode}) => new Codec(name, prefix, encode, decode); -const baseX = ({prefix, name, alphabet}) => { - const {encode, decode} = baseX$1(alphabet, name); - return from({ - prefix, - name, - encode, - decode: text => bytes.coerce(decode(text)) + + state.registry[name].push({ + hook: hook, + orig: orig, }); -}; -const decode = (string, alphabet, bitsPerChar, name) => { - const codes = {}; - for (let i = 0; i < alphabet.length; ++i) { - codes[alphabet[i]] = i; - } - let end = string.length; - while (string[end - 1] === '=') { - --end; - } - const out = new Uint8Array(end * bitsPerChar / 8 | 0); - let bits = 0; - let buffer = 0; - let written = 0; - for (let i = 0; i < end; ++i) { - const value = codes[string[i]]; - if (value === undefined) { - throw new SyntaxError(`Non-${ name } character`); - } - buffer = buffer << bitsPerChar | value; - bits += bitsPerChar; - if (bits >= 8) { - bits -= 8; - out[written++] = 255 & buffer >> bits; - } - } - if (bits >= bitsPerChar || 255 & buffer << 8 - bits) { - throw new SyntaxError('Unexpected end of data'); - } - return out; -}; -const encode = (data, alphabet, bitsPerChar) => { - const pad = alphabet[alphabet.length - 1] === '='; - const mask = (1 << bitsPerChar) - 1; - let out = ''; - let bits = 0; - let buffer = 0; - for (let i = 0; i < data.length; ++i) { - buffer = buffer << 8 | data[i]; - bits += 8; - while (bits > bitsPerChar) { - bits -= bitsPerChar; - out += alphabet[mask & buffer >> bits]; - } +} + + +/***/ }), + +/***/ 18045: +/***/ ((module) => { + +module.exports = register; + +function register(state, name, method, options) { + if (typeof method !== "function") { + throw new Error("method for before hook must be a function"); } - if (bits) { - out += alphabet[mask & buffer << bitsPerChar - bits]; + + if (!options) { + options = {}; } - if (pad) { - while (out.length * bitsPerChar & 7) { - out += '='; - } + + if (Array.isArray(name)) { + return name.reverse().reduce(function (callback, name) { + return register.bind(null, state, name, callback, options); + }, method)(); } - return out; -}; -const rfc4648 = ({name, prefix, bitsPerChar, alphabet}) => { - return from({ - prefix, - name, - encode(input) { - return encode(input, alphabet, bitsPerChar); - }, - decode(input) { - return decode(input, alphabet, bitsPerChar, name); + + return Promise.resolve().then(function () { + if (!state.registry[name]) { + return method(options); } - }); -}; -exports.Codec = Codec; -exports.baseX = baseX; -exports.from = from; -exports.or = or; -exports.rfc4648 = rfc4648; + return state.registry[name].reduce(function (method, registered) { + return registered.hook.bind(null, method, options); + }, method)(); + }); +} /***/ }), -<<<<<<< HEAD -/***/ 93174: -======= -/***/ 86007: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - +/***/ 1521: +/***/ ((module) => { +module.exports = removeHook; -Object.defineProperty(exports, "__esModule", ({ value: true })); +function removeHook(state, name, method) { + if (!state.registry[name]) { + return; + } -<<<<<<< HEAD -var base = __nccwpck_require__(91809); -======= -var base = __nccwpck_require__(16924); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + var index = state.registry[name] + .map(function (registered) { + return registered.orig; + }) + .indexOf(method); -const base10 = base.baseX({ - prefix: '9', - name: 'base10', - alphabet: '0123456789' -}); + if (index === -1) { + return; + } -exports.base10 = base10; + state.registry[name].splice(index, 1); +} /***/ }), -<<<<<<< HEAD -/***/ 35654: -======= -/***/ 98085: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 71610: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var balanced = __nccwpck_require__(11808); +module.exports = expandTop; -Object.defineProperty(exports, "__esModule", ({ value: true })); +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; -<<<<<<< HEAD -var base = __nccwpck_require__(91809); -======= -var base = __nccwpck_require__(16924); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} -const base16 = base.rfc4648({ - prefix: 'f', - name: 'base16', - alphabet: '0123456789abcdef', - bitsPerChar: 4 -}); -const base16upper = base.rfc4648({ - prefix: 'F', - name: 'base16upper', - alphabet: '0123456789ABCDEF', - bitsPerChar: 4 -}); +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} -exports.base16 = base16; -exports.base16upper = base16upper; +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} -/***/ }), +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; -<<<<<<< HEAD -/***/ 11527: -======= -/***/ 16721: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + parts.push.apply(parts, p); -<<<<<<< HEAD -var base = __nccwpck_require__(91809); -======= -var base = __nccwpck_require__(16924); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + return parts; +} -const base2 = base.rfc4648({ - prefix: '0', - name: 'base2', - alphabet: '01', - bitsPerChar: 1 -}); +function expandTop(str) { + if (!str) + return []; -exports.base2 = base2; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + return expand(escapeBraces(str), true).map(unescapeBraces); +} -/***/ }), +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} -<<<<<<< HEAD -/***/ 44001: -======= -/***/ 40411: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} +function expand(str, isTop) { + var expansions = []; + var m = balanced('{', '}', str); + if (!m) return [str]; -Object.defineProperty(exports, "__esModule", ({ value: true })); + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; -<<<<<<< HEAD -var base = __nccwpck_require__(91809); -======= -var base = __nccwpck_require__(16924); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + if (/\$$/.test(m.pre)) { + for (var k = 0; k < post.length; k++) { + var expansion = pre+ '{' + m.body + '}' + post[k]; + expansions.push(expansion); + } + } else { + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } -const alphabet = Array.from('\uD83D\uDE80\uD83E\uDE90\u2604\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09\u2600\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02\u2764\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09\u263A\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E\u270C\u2728\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D\u2763\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33\u270B\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13\u2B50\u2705\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6\u2714\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90\u2639\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20\u261D\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B\u26BD\uD83E\uDD19\u2615\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81\u26A1\uD83C\uDF1E\uD83C\uDF88\u274C\u270A\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C\u2708\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74\u25B6\u27A1\u2753\uD83D\uDC8E\uD83D\uDCB8\u2B07\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A\u26A0\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37\u260E\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51\u2744\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42'); -const alphabetBytesToChars = alphabet.reduce((p, c, i) => { - p[i] = c; - return p; -}, []); -const alphabetCharsToBytes = alphabet.reduce((p, c, i) => { - p[c.codePointAt(0)] = i; - return p; -}, []); -function encode(data) { - return data.reduce((p, c) => { - p += alphabetBytesToChars[c]; - return p; - }, ''); -} -function decode(str) { - const byts = []; - for (const char of str) { - const byt = alphabetCharsToBytes[char.codePointAt(0)]; - if (byt === undefined) { - throw new Error(`Non-base256emoji character: ${ char }`); + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = []; + + for (var j = 0; j < n.length; j++) { + N.push.apply(N, expand(n[j], false)); + } + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } } - byts.push(byt); } - return new Uint8Array(byts); + + return expansions; } -const base256emoji = base.from({ - prefix: '\uD83D\uDE80', - name: 'base256emoji', - encode, - decode -}); -exports.base256emoji = base256emoji; /***/ }), -<<<<<<< HEAD -/***/ 14637: -======= -/***/ 70784: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 76475: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +var concatMap = __nccwpck_require__(67814); +var balanced = __nccwpck_require__(11808); +module.exports = expandTop; -Object.defineProperty(exports, "__esModule", ({ value: true })); +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; -<<<<<<< HEAD -var base = __nccwpck_require__(91809); -======= -var base = __nccwpck_require__(16924); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} -const base32 = base.rfc4648({ - prefix: 'b', - name: 'base32', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567', - bitsPerChar: 5 -}); -const base32upper = base.rfc4648({ - prefix: 'B', - name: 'base32upper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', - bitsPerChar: 5 -}); -const base32pad = base.rfc4648({ - prefix: 'c', - name: 'base32pad', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', - bitsPerChar: 5 -}); -const base32padupper = base.rfc4648({ - prefix: 'C', - name: 'base32padupper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', - bitsPerChar: 5 -}); -const base32hex = base.rfc4648({ - prefix: 'v', - name: 'base32hex', - alphabet: '0123456789abcdefghijklmnopqrstuv', - bitsPerChar: 5 -}); -const base32hexupper = base.rfc4648({ - prefix: 'V', - name: 'base32hexupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', - bitsPerChar: 5 -}); -const base32hexpad = base.rfc4648({ - prefix: 't', - name: 'base32hexpad', - alphabet: '0123456789abcdefghijklmnopqrstuv=', - bitsPerChar: 5 -}); -const base32hexpadupper = base.rfc4648({ - prefix: 'T', - name: 'base32hexpadupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', - bitsPerChar: 5 -}); -const base32z = base.rfc4648({ - prefix: 'h', - name: 'base32z', - alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', - bitsPerChar: 5 -}); +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} -exports.base32 = base32; -exports.base32hex = base32hex; -exports.base32hexpad = base32hexpad; -exports.base32hexpadupper = base32hexpadupper; -exports.base32hexupper = base32hexupper; -exports.base32pad = base32pad; -exports.base32padupper = base32padupper; -exports.base32upper = base32upper; -exports.base32z = base32z; +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} -/***/ }), +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; -<<<<<<< HEAD -/***/ 66800: -======= -/***/ 76443: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + var parts = []; + var m = balanced('{', '}', str); + if (!m) + return str.split(','); + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); -Object.defineProperty(exports, "__esModule", ({ value: true })); + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } -<<<<<<< HEAD -var base = __nccwpck_require__(91809); -======= -var base = __nccwpck_require__(16924); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + parts.push.apply(parts, p); -const base36 = base.baseX({ - prefix: 'k', - name: 'base36', - alphabet: '0123456789abcdefghijklmnopqrstuvwxyz' -}); -const base36upper = base.baseX({ - prefix: 'K', - name: 'base36upper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' -}); + return parts; +} -exports.base36 = base36; -exports.base36upper = base36upper; +function expandTop(str) { + if (!str) + return []; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } -/***/ }), + return expand(escapeBraces(str), true).map(unescapeBraces); +} -<<<<<<< HEAD -/***/ 50119: -======= -/***/ 49108: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +function identity(e) { + return e; +} +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} -Object.defineProperty(exports, "__esModule", ({ value: true })); +function expand(str, isTop) { + var expansions = []; -<<<<<<< HEAD -var base = __nccwpck_require__(91809); -======= -var base = __nccwpck_require__(16924); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; -const base58btc = base.baseX({ - name: 'base58btc', - prefix: 'z', - alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -}); -const base58flickr = base.baseX({ - name: 'base58flickr', - prefix: 'Z', - alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -}); + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } -exports.base58btc = base58btc; -exports.base58flickr = base58flickr; + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. -/***/ }), + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; -<<<<<<< HEAD -/***/ 25631: -======= -/***/ 98197: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + var N; + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + N = []; -Object.defineProperty(exports, "__esModule", ({ value: true })); + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } -<<<<<<< HEAD -var base = __nccwpck_require__(91809); -======= -var base = __nccwpck_require__(16924); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } -const base64 = base.rfc4648({ - prefix: 'm', - name: 'base64', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', - bitsPerChar: 6 -}); -const base64pad = base.rfc4648({ - prefix: 'M', - name: 'base64pad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', - bitsPerChar: 6 -}); -const base64url = base.rfc4648({ - prefix: 'u', - name: 'base64url', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', - bitsPerChar: 6 -}); -const base64urlpad = base.rfc4648({ - prefix: 'U', - name: 'base64urlpad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', - bitsPerChar: 6 -}); + return expansions; +} -exports.base64 = base64; -exports.base64pad = base64pad; -exports.base64url = base64url; -exports.base64urlpad = base64urlpad; /***/ }), -<<<<<<< HEAD -/***/ 14075: -======= -/***/ 3529: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - +/***/ 48965: +/***/ ((module) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -<<<<<<< HEAD -var base = __nccwpck_require__(91809); -======= -var base = __nccwpck_require__(16924); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +function withIs(Class, { className, symbolName }) { + const symbol = Symbol.for(symbolName); -const base8 = base.rfc4648({ - prefix: '7', - name: 'base8', - alphabet: '01234567', - bitsPerChar: 3 -}); + const ClassIsWrapper = { + // The code below assigns the class wrapper to an object to trick + // JavaScript engines to show the name of the extended class when + // logging an instances. + // We are assigning an anonymous class (class wrapper) to the object + // with key `className` to keep the correct name. + // If this is not supported it falls back to logging `ClassIsWrapper`. + [className]: class extends Class { + constructor(...args) { + super(...args); + Object.defineProperty(this, symbol, { value: true }); + } -exports.base8 = base8; + get [Symbol.toStringTag]() { + return className; + } + }, + }[className]; + ClassIsWrapper[`is${className}`] = (obj) => !!(obj && obj[symbol]); -/***/ }), + return ClassIsWrapper; +} -<<<<<<< HEAD -/***/ 79697: -======= -/***/ 28380: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +function withIsProto(Class, { className, symbolName, withoutNew }) { + const symbol = Symbol.for(symbolName); + /* eslint-disable object-shorthand */ + const ClassIsWrapper = { + [className]: function (...args) { + if (withoutNew && !(this instanceof ClassIsWrapper)) { + return new ClassIsWrapper(...args); + } + const _this = Class.call(this, ...args) || this; -Object.defineProperty(exports, "__esModule", ({ value: true })); + if (_this && !_this[symbol]) { + Object.defineProperty(_this, symbol, { value: true }); + } -<<<<<<< HEAD -var base = __nccwpck_require__(91809); -var bytes = __nccwpck_require__(87450); -======= -var base = __nccwpck_require__(16924); -var bytes = __nccwpck_require__(16570); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + return _this; + }, + }[className]; + /* eslint-enable object-shorthand */ -const identity = base.from({ - prefix: '\0', - name: 'identity', - encode: buf => bytes.toString(buf), - decode: str => bytes.fromString(str) -}); + ClassIsWrapper.prototype = Object.create(Class.prototype); + ClassIsWrapper.prototype.constructor = ClassIsWrapper; -exports.identity = identity; + Object.defineProperty(ClassIsWrapper.prototype, Symbol.toStringTag, { + get() { + return className; + }, + }); + ClassIsWrapper[`is${className}`] = (obj) => !!(obj && obj[symbol]); -/***/ }), + return ClassIsWrapper; +} -<<<<<<< HEAD -/***/ 22965: -======= -/***/ 42916: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +module.exports = withIs; +module.exports.proto = withIsProto; +/***/ }), -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ 1526: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -<<<<<<< HEAD -var identity = __nccwpck_require__(79697); -var base2 = __nccwpck_require__(11527); -var base8 = __nccwpck_require__(14075); -var base10 = __nccwpck_require__(93174); -var base16 = __nccwpck_require__(35654); -var base32 = __nccwpck_require__(14637); -var base36 = __nccwpck_require__(66800); -var base58 = __nccwpck_require__(50119); -var base64 = __nccwpck_require__(25631); -var base256emoji = __nccwpck_require__(44001); -var sha2 = __nccwpck_require__(65484); -var identity$1 = __nccwpck_require__(14733); -var raw = __nccwpck_require__(55137); -var json = __nccwpck_require__(94633); -__nccwpck_require__(3992); -var cid = __nccwpck_require__(33862); -var hasher = __nccwpck_require__(83296); -var digest = __nccwpck_require__(65957); -var varint = __nccwpck_require__(3959); -var bytes = __nccwpck_require__(87450); -======= -var identity = __nccwpck_require__(28380); -var base2 = __nccwpck_require__(16721); -var base8 = __nccwpck_require__(3529); -var base10 = __nccwpck_require__(86007); -var base16 = __nccwpck_require__(98085); -var base32 = __nccwpck_require__(70784); -var base36 = __nccwpck_require__(76443); -var base58 = __nccwpck_require__(49108); -var base64 = __nccwpck_require__(98197); -var base256emoji = __nccwpck_require__(40411); -var sha2 = __nccwpck_require__(80960); -var identity$1 = __nccwpck_require__(53863); -var raw = __nccwpck_require__(4848); -var json = __nccwpck_require__(81245); -__nccwpck_require__(27331); -var cid = __nccwpck_require__(24247); -var hasher = __nccwpck_require__(62030); -var digest = __nccwpck_require__(81168); -var varint = __nccwpck_require__(55687); -var bytes = __nccwpck_require__(16570); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var util = __nccwpck_require__(73837); +var Stream = (__nccwpck_require__(12781).Stream); +var DelayedStream = __nccwpck_require__(19353); -const bases = { - ...identity, - ...base2, - ...base8, - ...base10, - ...base16, - ...base32, - ...base36, - ...base58, - ...base64, - ...base256emoji -}; -const hashes = { - ...sha2, - ...identity$1 -}; -const codecs = { - raw, - json -}; +module.exports = CombinedStream; +function CombinedStream() { + this.writable = false; + this.readable = true; + this.dataSize = 0; + this.maxDataSize = 2 * 1024 * 1024; + this.pauseStreams = true; -exports.CID = cid.CID; -exports.hasher = hasher; -exports.digest = digest; -exports.varint = varint; -exports.bytes = bytes; -exports.bases = bases; -exports.codecs = codecs; -exports.hashes = hashes; + this._released = false; + this._streams = []; + this._currentStream = null; + this._insideLoop = false; + this._pendingNext = false; +} +util.inherits(CombinedStream, Stream); +CombinedStream.create = function(options) { + var combinedStream = new this(); -/***/ }), + options = options || {}; + for (var option in options) { + combinedStream[option] = options[option]; + } -<<<<<<< HEAD -/***/ 87450: -======= -/***/ 44748: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + return combinedStream; +}; -"use strict"; +CombinedStream.isStreamLike = function(stream) { + return (typeof stream !== 'function') + && (typeof stream !== 'string') + && (typeof stream !== 'boolean') + && (typeof stream !== 'number') + && (!Buffer.isBuffer(stream)); +}; +CombinedStream.prototype.append = function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); -Object.defineProperty(exports, "__esModule", ({ value: true })); + if (isStreamLike) { + if (!(stream instanceof DelayedStream)) { + var newStream = DelayedStream.create(stream, { + maxDataSize: Infinity, + pauseStream: this.pauseStreams, + }); + stream.on('data', this._checkDataSize.bind(this)); + stream = newStream; + } -__nccwpck_require__(27331); -var cid = __nccwpck_require__(24247); -var bytes = __nccwpck_require__(16570); + this._handleErrors(stream); -const readonly = ({enumerable = true, configurable = false} = {}) => ({ - enumerable, - configurable, - writable: false -}); -const links = function* (source, base) { - if (source == null) - return; - if (source instanceof Uint8Array) - return; - for (const [key, value] of Object.entries(source)) { - const path = [ - ...base, - key - ]; - if (value != null && typeof value === 'object') { - if (Array.isArray(value)) { - for (const [index, element] of value.entries()) { - const elementPath = [ - ...path, - index - ]; - const cid$1 = cid.CID.asCID(element); - if (cid$1) { - yield [ - elementPath.join('/'), - cid$1 - ]; - } else if (typeof element === 'object') { - yield* links(element, elementPath); - } - } - } else { - const cid$1 = cid.CID.asCID(value); - if (cid$1) { - yield [ - path.join('/'), - cid$1 - ]; - } else { - yield* links(value, path); - } - } - } - } -}; -const tree = function* (source, base) { - if (source == null) - return; - for (const [key, value] of Object.entries(source)) { - const path = [ - ...base, - key - ]; - yield path.join('/'); - if (value != null && !(value instanceof Uint8Array) && typeof value === 'object' && !cid.CID.asCID(value)) { - if (Array.isArray(value)) { - for (const [index, element] of value.entries()) { - const elementPath = [ - ...path, - index - ]; - yield elementPath.join('/'); - if (typeof element === 'object' && !cid.CID.asCID(element)) { - yield* tree(element, elementPath); - } - } - } else { - yield* tree(value, path); - } - } - } -}; -const get = (source, path) => { - let node = source; - for (const [index, key] of path.entries()) { - node = node[key]; - if (node == null) { - throw new Error(`Object has no property at ${ path.slice(0, index + 1).map(part => `[${ JSON.stringify(part) }]`).join('') }`); - } - const cid$1 = cid.CID.asCID(node); - if (cid$1) { - return { - value: cid$1, - remaining: path.slice(index + 1).join('/') - }; + if (this.pauseStreams) { + stream.pause(); } } - return { value: node }; -}; -class Block { - constructor({cid, bytes, value}) { - if (!cid || !bytes || typeof value === 'undefined') - throw new Error('Missing required argument'); - this.cid = cid; - this.bytes = bytes; - this.value = value; - this.asBlock = this; - Object.defineProperties(this, { - cid: readonly(), - bytes: readonly(), - value: readonly(), - asBlock: readonly() - }); - } - links() { - return links(this.value, []); - } - tree() { - return tree(this.value, []); - } - get(path = '/') { - return get(this.value, path.split('/').filter(Boolean)); - } -} -const encode = async ({value, codec, hasher}) => { - if (typeof value === 'undefined') - throw new Error('Missing required argument "value"'); - if (!codec || !hasher) - throw new Error('Missing required argument: codec or hasher'); - const bytes = codec.encode(value); - const hash = await hasher.digest(bytes); - const cid$1 = cid.CID.create(1, codec.code, hash); - return new Block({ - value, - bytes, - cid: cid$1 - }); -}; -const decode = async ({bytes, codec, hasher}) => { - if (!bytes) - throw new Error('Missing required argument "bytes"'); - if (!codec || !hasher) - throw new Error('Missing required argument: codec or hasher'); - const value = codec.decode(bytes); - const hash = await hasher.digest(bytes); - const cid$1 = cid.CID.create(1, codec.code, hash); - return new Block({ - value, - bytes, - cid: cid$1 - }); -}; -const createUnsafe = ({ - bytes, - cid, - value: maybeValue, - codec -}) => { - const value = maybeValue !== undefined ? maybeValue : codec && codec.decode(bytes); - if (value === undefined) - throw new Error('Missing required argument, must either provide "value" or "codec"'); - return new Block({ - cid, - bytes, - value - }); -}; -const create = async ({bytes: bytes$1, cid, hasher, codec}) => { - if (!bytes$1) - throw new Error('Missing required argument "bytes"'); - if (!hasher) - throw new Error('Missing required argument "hasher"'); - const value = codec.decode(bytes$1); - const hash = await hasher.digest(bytes$1); - if (!bytes.equals(cid.multihash.bytes, hash.bytes)) { - throw new Error('CID hash does not match bytes'); - } - return createUnsafe({ - bytes: bytes$1, - cid, - value, - codec - }); -}; -exports.Block = Block; -exports.create = create; -exports.createUnsafe = createUnsafe; -exports.decode = decode; -exports.encode = encode; + this._streams.push(stream); + return this; +}; +CombinedStream.prototype.pipe = function(dest, options) { + Stream.prototype.pipe.call(this, dest, options); + this.resume(); + return dest; +}; -/***/ }), +CombinedStream.prototype._getNext = function() { + this._currentStream = null; -/***/ 16570: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { + if (this._insideLoop) { + this._pendingNext = true; + return; // defer call + } + this._insideLoop = true; + try { + do { + this._pendingNext = false; + this._realGetNext(); + } while (this._pendingNext); + } finally { + this._insideLoop = false; + } +}; +CombinedStream.prototype._realGetNext = function() { + var stream = this._streams.shift(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const empty = new Uint8Array(0); -const toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), ''); -const fromHex = hex => { - const hexes = hex.match(/../g); - return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : empty; -}; -const equals = (aa, bb) => { - if (aa === bb) - return true; - if (aa.byteLength !== bb.byteLength) { - return false; - } - for (let ii = 0; ii < aa.byteLength; ii++) { - if (aa[ii] !== bb[ii]) { - return false; - } - } - return true; -}; -const coerce = o => { - if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') - return o; - if (o instanceof ArrayBuffer) - return new Uint8Array(o); - if (ArrayBuffer.isView(o)) { - return new Uint8Array(o.buffer, o.byteOffset, o.byteLength); + if (typeof stream == 'undefined') { + this.end(); + return; } - throw new Error('Unknown type, must be binary type'); -}; -const isBinary = o => o instanceof ArrayBuffer || ArrayBuffer.isView(o); -const fromString = str => new TextEncoder().encode(str); -const toString = b => new TextDecoder().decode(b); - -exports.coerce = coerce; -exports.empty = empty; -exports.equals = equals; -exports.fromHex = fromHex; -exports.fromString = fromString; -exports.isBinary = isBinary; -exports.toHex = toHex; -exports.toString = toString; + if (typeof stream !== 'function') { + this._pipeNext(stream); + return; + } -/***/ }), + var getStream = stream; + getStream(function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('data', this._checkDataSize.bind(this)); + this._handleErrors(stream); + } -<<<<<<< HEAD -/***/ 33862: -======= -/***/ 24247: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + this._pipeNext(stream); + }.bind(this)); +}; +CombinedStream.prototype._pipeNext = function(stream) { + this._currentStream = stream; + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('end', this._getNext.bind(this)); + stream.pipe(this, {end: false}); + return; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + var value = stream; + this.write(value); + this._getNext(); +}; -<<<<<<< HEAD -var varint = __nccwpck_require__(3959); -var digest = __nccwpck_require__(65957); -var base58 = __nccwpck_require__(50119); -var base32 = __nccwpck_require__(14637); -var bytes = __nccwpck_require__(87450); -======= -var varint = __nccwpck_require__(55687); -var digest = __nccwpck_require__(81168); -var base58 = __nccwpck_require__(49108); -var base32 = __nccwpck_require__(70784); -var bytes = __nccwpck_require__(16570); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +CombinedStream.prototype._handleErrors = function(stream) { + var self = this; + stream.on('error', function(err) { + self._emitError(err); + }); +}; -class CID { - constructor(version, code, multihash, bytes) { - this.code = code; - this.version = version; - this.multihash = multihash; - this.bytes = bytes; - this.byteOffset = bytes.byteOffset; - this.byteLength = bytes.byteLength; - this.asCID = this; - this._baseCache = new Map(); - Object.defineProperties(this, { - byteOffset: hidden, - byteLength: hidden, - code: readonly, - version: readonly, - multihash: readonly, - bytes: readonly, - _baseCache: hidden, - asCID: hidden - }); - } - toV0() { - switch (this.version) { - case 0: { - return this; - } - default: { - const {code, multihash} = this; - if (code !== DAG_PB_CODE) { - throw new Error('Cannot convert a non dag-pb CID to CIDv0'); - } - if (multihash.code !== SHA_256_CODE) { - throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0'); - } - return CID.createV0(multihash); - } - } - } - toV1() { - switch (this.version) { - case 0: { - const {code, digest: digest$1} = this.multihash; - const multihash = digest.create(code, digest$1); - return CID.createV1(this.code, multihash); - } - case 1: { - return this; - } - default: { - throw Error(`Can not convert CID version ${ this.version } to version 0. This is a bug please report`); - } - } - } - equals(other) { - return other && this.code === other.code && this.version === other.version && digest.equals(this.multihash, other.multihash); - } - toString(base) { - const {bytes, version, _baseCache} = this; - switch (version) { - case 0: - return toStringV0(bytes, _baseCache, base || base58.base58btc.encoder); - default: - return toStringV1(bytes, _baseCache, base || base32.base32.encoder); - } - } - toJSON() { - return { - code: this.code, - version: this.version, - hash: this.multihash.bytes - }; - } - get [Symbol.toStringTag]() { - return 'CID'; - } - [Symbol.for('nodejs.util.inspect.custom')]() { - return 'CID(' + this.toString() + ')'; - } - static isCID(value) { - deprecate(/^0\.0/, IS_CID_DEPRECATION); - return !!(value && (value[cidSymbol] || value.asCID === value)); - } - get toBaseEncodedString() { - throw new Error('Deprecated, use .toString()'); - } - get codec() { - throw new Error('"codec" property is deprecated, use integer "code" property instead'); - } - get buffer() { - throw new Error('Deprecated .buffer property, use .bytes to get Uint8Array instead'); - } - get multibaseName() { - throw new Error('"multibaseName" property is deprecated'); - } - get prefix() { - throw new Error('"prefix" property is deprecated'); - } - static asCID(value) { - if (value instanceof CID) { - return value; - } else if (value != null && value.asCID === value) { - const {version, code, multihash, bytes} = value; - return new CID(version, code, multihash, bytes || encodeCID(version, code, multihash.bytes)); - } else if (value != null && value[cidSymbol] === true) { - const {version, multihash, code} = value; - const digest$1 = digest.decode(multihash); - return CID.create(version, code, digest$1); - } else { - return null; - } - } - static create(version, code, digest) { - if (typeof code !== 'number') { - throw new Error('String codecs are no longer supported'); - } - switch (version) { - case 0: { - if (code !== DAG_PB_CODE) { - throw new Error(`Version 0 CID must use dag-pb (code: ${ DAG_PB_CODE }) block encoding`); - } else { - return new CID(version, code, digest, digest.bytes); - } - } - case 1: { - const bytes = encodeCID(version, code, digest.bytes); - return new CID(version, code, digest, bytes); - } - default: { - throw new Error('Invalid version'); - } - } - } - static createV0(digest) { - return CID.create(0, DAG_PB_CODE, digest); - } - static createV1(code, digest) { - return CID.create(1, code, digest); - } - static decode(bytes) { - const [cid, remainder] = CID.decodeFirst(bytes); - if (remainder.length) { - throw new Error('Incorrect length'); - } - return cid; - } - static decodeFirst(bytes$1) { - const specs = CID.inspectBytes(bytes$1); - const prefixSize = specs.size - specs.multihashSize; - const multihashBytes = bytes.coerce(bytes$1.subarray(prefixSize, prefixSize + specs.multihashSize)); - if (multihashBytes.byteLength !== specs.multihashSize) { - throw new Error('Incorrect length'); - } - const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize); - const digest$1 = new digest.Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); - const cid = specs.version === 0 ? CID.createV0(digest$1) : CID.createV1(specs.codec, digest$1); - return [ - cid, - bytes$1.subarray(specs.size) - ]; - } - static inspectBytes(initialBytes) { - let offset = 0; - const next = () => { - const [i, length] = varint.decode(initialBytes.subarray(offset)); - offset += length; - return i; - }; - let version = next(); - let codec = DAG_PB_CODE; - if (version === 18) { - version = 0; - offset = 0; - } else if (version === 1) { - codec = next(); - } - if (version !== 0 && version !== 1) { - throw new RangeError(`Invalid CID version ${ version }`); - } - const prefixSize = offset; - const multihashCode = next(); - const digestSize = next(); - const size = offset + digestSize; - const multihashSize = size - prefixSize; - return { - version, - codec, - multihashCode, - digestSize, - multihashSize, - size - }; - } - static parse(source, base) { - const [prefix, bytes] = parseCIDtoBytes(source, base); - const cid = CID.decode(bytes); - cid._baseCache.set(prefix, source); - return cid; - } -} -const parseCIDtoBytes = (source, base) => { - switch (source[0]) { - case 'Q': { - const decoder = base || base58.base58btc; - return [ - base58.base58btc.prefix, - decoder.decode(`${ base58.base58btc.prefix }${ source }`) - ]; - } - case base58.base58btc.prefix: { - const decoder = base || base58.base58btc; - return [ - base58.base58btc.prefix, - decoder.decode(source) - ]; - } - case base32.base32.prefix: { - const decoder = base || base32.base32; - return [ - base32.base32.prefix, - decoder.decode(source) - ]; - } - default: { - if (base == null) { - throw Error('To parse non base32 or base58btc encoded CID multibase decoder must be provided'); - } - return [ - source[0], - base.decode(source) - ]; - } - } +CombinedStream.prototype.write = function(data) { + this.emit('data', data); }; -const toStringV0 = (bytes, cache, base) => { - const {prefix} = base; - if (prefix !== base58.base58btc.prefix) { - throw Error(`Cannot string encode V0 in ${ base.name } encoding`); - } - const cid = cache.get(prefix); - if (cid == null) { - const cid = base.encode(bytes).slice(1); - cache.set(prefix, cid); - return cid; - } else { - return cid; + +CombinedStream.prototype.pause = function() { + if (!this.pauseStreams) { + return; } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); + this.emit('pause'); }; -const toStringV1 = (bytes, cache, base) => { - const {prefix} = base; - const cid = cache.get(prefix); - if (cid == null) { - const cid = base.encode(bytes); - cache.set(prefix, cid); - return cid; - } else { - return cid; + +CombinedStream.prototype.resume = function() { + if (!this._released) { + this._released = true; + this.writable = true; + this._getNext(); } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); + this.emit('resume'); }; -const DAG_PB_CODE = 112; -const SHA_256_CODE = 18; -const encodeCID = (version, code, multihash) => { - const codeOffset = varint.encodingLength(version); - const hashOffset = codeOffset + varint.encodingLength(code); - const bytes = new Uint8Array(hashOffset + multihash.byteLength); - varint.encodeTo(version, bytes, 0); - varint.encodeTo(code, bytes, codeOffset); - bytes.set(multihash, hashOffset); - return bytes; + +CombinedStream.prototype.end = function() { + this._reset(); + this.emit('end'); }; -const cidSymbol = Symbol.for('@ipld/js-cid/CID'); -const readonly = { - writable: false, - configurable: false, - enumerable: true + +CombinedStream.prototype.destroy = function() { + this._reset(); + this.emit('close'); }; -const hidden = { - writable: false, - enumerable: false, - configurable: false + +CombinedStream.prototype._reset = function() { + this.writable = false; + this._streams = []; + this._currentStream = null; }; -const version = '0.0.0-dev'; -const deprecate = (range, message) => { - if (range.test(version)) { - console.warn(message); - } else { - throw new Error(message); + +CombinedStream.prototype._checkDataSize = function() { + this._updateDataSize(); + if (this.dataSize <= this.maxDataSize) { + return; } + + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; + this._emitError(new Error(message)); }; -const IS_CID_DEPRECATION = `CID.isCID(v) is deprecated and will be removed in the next major release. -Following code pattern: -if (CID.isCID(value)) { - doSomethingWithCID(value) -} +CombinedStream.prototype._updateDataSize = function() { + this.dataSize = 0; -Is replaced with: + var self = this; + this._streams.forEach(function(stream) { + if (!stream.dataSize) { + return; + } -const cid = CID.asCID(value) -if (cid) { - // Make sure to use cid instead of value - doSomethingWithCID(cid) -} -`; + self.dataSize += stream.dataSize; + }); -exports.CID = CID; + if (this._currentStream && this._currentStream.dataSize) { + this.dataSize += this._currentStream.dataSize; + } +}; + +CombinedStream.prototype._emitError = function(err) { + this._reset(); + this.emit('error', err); +}; /***/ }), -<<<<<<< HEAD -/***/ 94633: -======= -/***/ 81245: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { +/***/ 67814: +/***/ ((module) => { + +module.exports = function (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; +}; +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ }), -const textEncoder = new TextEncoder(); -const textDecoder = new TextDecoder(); -const name = 'json'; -const code = 512; -const encode = node => textEncoder.encode(JSON.stringify(node)); -const decode = data => JSON.parse(textDecoder.decode(data)); +/***/ 96657: +/***/ ((module, exports, __nccwpck_require__) => { -exports.code = code; -exports.decode = decode; -exports.encode = encode; -exports.name = name; +/* eslint-env browser */ +/** + * This is the web browser implementation of `debug()`. + */ -/***/ }), +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); +exports.destroy = (() => { + let warned = false; -<<<<<<< HEAD -/***/ 55137: -======= -/***/ 4848: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +})(); +/** + * Colors. + */ +exports.colors = [ + '#0000CC', + '#0000FF', + '#0033CC', + '#0033FF', + '#0066CC', + '#0066FF', + '#0099CC', + '#0099FF', + '#00CC00', + '#00CC33', + '#00CC66', + '#00CC99', + '#00CCCC', + '#00CCFF', + '#3300CC', + '#3300FF', + '#3333CC', + '#3333FF', + '#3366CC', + '#3366FF', + '#3399CC', + '#3399FF', + '#33CC00', + '#33CC33', + '#33CC66', + '#33CC99', + '#33CCCC', + '#33CCFF', + '#6600CC', + '#6600FF', + '#6633CC', + '#6633FF', + '#66CC00', + '#66CC33', + '#9900CC', + '#9900FF', + '#9933CC', + '#9933FF', + '#99CC00', + '#99CC33', + '#CC0000', + '#CC0033', + '#CC0066', + '#CC0099', + '#CC00CC', + '#CC00FF', + '#CC3300', + '#CC3333', + '#CC3366', + '#CC3399', + '#CC33CC', + '#CC33FF', + '#CC6600', + '#CC6633', + '#CC9900', + '#CC9933', + '#CCCC00', + '#CCCC33', + '#FF0000', + '#FF0033', + '#FF0066', + '#FF0099', + '#FF00CC', + '#FF00FF', + '#FF3300', + '#FF3333', + '#FF3366', + '#FF3399', + '#FF33CC', + '#FF33FF', + '#FF6600', + '#FF6633', + '#FF9900', + '#FF9933', + '#FFCC00', + '#FFCC33' +]; -Object.defineProperty(exports, "__esModule", ({ value: true })); +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ -<<<<<<< HEAD -var bytes = __nccwpck_require__(87450); -======= -var bytes = __nccwpck_require__(16570); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +// eslint-disable-next-line complexity +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } -const name = 'raw'; -const code = 85; -const encode = node => bytes.coerce(node); -const decode = data => bytes.coerce(data); + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } -exports.code = code; -exports.decode = decode; -exports.encode = encode; -exports.name = name; + // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // Is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // Double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} +/** + * Colorize log arguments if enabled. + * + * @api public + */ -/***/ }), +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); -<<<<<<< HEAD -/***/ 65957: -======= -/***/ 81168: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (!this.useColors) { + return; + } + const c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); + // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; + } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); -Object.defineProperty(exports, "__esModule", ({ value: true })); + args.splice(lastC, 0, c); +} -<<<<<<< HEAD -var bytes = __nccwpck_require__(87450); -var varint = __nccwpck_require__(3959); -======= -var bytes = __nccwpck_require__(16570); -var varint = __nccwpck_require__(55687); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ +exports.log = console.debug || console.log || (() => {}); -const create = (code, digest) => { - const size = digest.byteLength; - const sizeOffset = varint.encodingLength(code); - const digestOffset = sizeOffset + varint.encodingLength(size); - const bytes = new Uint8Array(digestOffset + size); - varint.encodeTo(code, bytes, 0); - varint.encodeTo(size, bytes, sizeOffset); - bytes.set(digest, digestOffset); - return new Digest(code, size, digest, bytes); -}; -const decode = multihash => { - const bytes$1 = bytes.coerce(multihash); - const [code, sizeOffset] = varint.decode(bytes$1); - const [size, digestOffset] = varint.decode(bytes$1.subarray(sizeOffset)); - const digest = bytes$1.subarray(sizeOffset + digestOffset); - if (digest.byteLength !== size) { - throw new Error('Incorrect length'); - } - return new Digest(code, size, digest, bytes$1); -}; -const equals = (a, b) => { - if (a === b) { - return true; - } else { - return a.code === b.code && a.size === b.size && bytes.equals(a.bytes, b.bytes); - } -}; -class Digest { - constructor(code, size, digest, bytes) { - this.code = code; - this.size = size; - this.digest = digest; - this.bytes = bytes; - } +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } } -exports.Digest = Digest; -exports.create = create; -exports.decode = decode; -exports.equals = equals; - +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ +function load() { + let r; + try { + r = exports.storage.getItem('debug'); + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } -/***/ }), + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } -<<<<<<< HEAD -/***/ 83296: -======= -/***/ 62030: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + return r; +} +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} -Object.defineProperty(exports, "__esModule", ({ value: true })); +module.exports = __nccwpck_require__(20742)(exports); -<<<<<<< HEAD -var digest = __nccwpck_require__(65957); -======= -var digest = __nccwpck_require__(81168); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const {formatters} = module.exports; -const from = ({name, code, encode}) => new Hasher(name, code, encode); -class Hasher { - constructor(name, code, encode) { - this.name = name; - this.code = code; - this.encode = encode; - } - digest(input) { - if (input instanceof Uint8Array) { - const result = this.encode(input); - return result instanceof Uint8Array ? digest.create(this.code, result) : result.then(digest$1 => digest.create(this.code, digest$1)); - } else { - throw Error('Unknown type, must be binary type'); - } - } -} +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ -exports.Hasher = Hasher; -exports.from = from; +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } +}; /***/ }), -<<<<<<< HEAD -/***/ 14733: -======= -/***/ 53863: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 20742: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = __nccwpck_require__(93666); + createDebug.destroy = destroy; -<<<<<<< HEAD -var bytes = __nccwpck_require__(87450); -var digest$1 = __nccwpck_require__(65957); -======= -var bytes = __nccwpck_require__(16570); -var digest$1 = __nccwpck_require__(81168); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); -const code = 0; -const name = 'identity'; -const encode = bytes.coerce; -const digest = input => digest$1.create(code, encode(input)); -const identity = { - code, - name, - encode, - digest -}; + /** + * The currently active debug mode names, and names to skip. + */ -exports.identity = identity; + createDebug.names = []; + createDebug.skips = []; + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; -/***/ }), + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; -<<<<<<< HEAD -/***/ 65484: -======= -/***/ 80960: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; -Object.defineProperty(exports, "__esModule", ({ value: true })); + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } -var crypto = __nccwpck_require__(6113); -<<<<<<< HEAD -var hasher = __nccwpck_require__(83296); -var bytes = __nccwpck_require__(87450); -======= -var hasher = __nccwpck_require__(62030); -var bytes = __nccwpck_require__(16570); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + const self = debug; -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; -var crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto); + args[0] = createDebug.coerce(args[0]); -const sha256 = hasher.from({ - name: 'sha2-256', - code: 18, - encode: input => bytes.coerce(crypto__default["default"].createHash('sha256').update(input).digest()) -}); -const sha512 = hasher.from({ - name: 'sha2-512', - code: 19, - encode: input => bytes.coerce(crypto__default["default"].createHash('sha512').update(input).digest()) -}); + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } -exports.sha256 = sha256; -exports.sha512 = sha512; + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); -/***/ }), + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); -<<<<<<< HEAD -/***/ 3992: -======= -/***/ 27331: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + return enabledCache; + }, + set: v => { + enableOverride = v; + } + }); -<<<<<<< HEAD -var cid = __nccwpck_require__(33862); -var varint = __nccwpck_require__(3959); -var bytes = __nccwpck_require__(87450); -var hasher = __nccwpck_require__(83296); -var digest = __nccwpck_require__(65957); -======= -var cid = __nccwpck_require__(24247); -var varint = __nccwpck_require__(55687); -var bytes = __nccwpck_require__(16570); -var hasher = __nccwpck_require__(62030); -var digest = __nccwpck_require__(81168); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + return debug; + } + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } -exports.CID = cid.CID; -exports.varint = varint; -exports.bytes = bytes; -exports.hasher = hasher; -exports.digest = digest; + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; + createDebug.names = []; + createDebug.skips = []; -/***/ }), + let i; + const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + const len = split.length; -<<<<<<< HEAD -/***/ 3959: -======= -/***/ 55687: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names.map(toNamespace), + ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } + + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } -<<<<<<< HEAD -var varint$1 = __nccwpck_require__(22038); -======= -var varint$1 = __nccwpck_require__(55250); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + let i; + let len; -const decode = data => { - const code = varint$1.decode(data); - return [ - code, - varint$1.decode.bytes - ]; -}; -const encodeTo = (int, target, offset = 0) => { - varint$1.encode(int, target, offset); - return target; -}; -const encodingLength = int => { - return varint$1.encodingLength(int); -}; + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } -exports.decode = decode; -exports.encodeTo = encodeTo; -exports.encodingLength = encodingLength; + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } + return false; + } -/***/ }), + /** + * Convert regexp to namespace + * + * @param {RegExp} regxep + * @return {String} namespace + * @api private + */ + function toNamespace(regexp) { + return regexp.toString() + .substring(2, regexp.toString().length - 2) + .replace(/\.\*\?$/, '*'); + } -<<<<<<< HEAD -/***/ 33033: -======= -/***/ 21357: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + createDebug.enable(createDebug.load()); -function base(ALPHABET, name) { - if (ALPHABET.length >= 255) { - throw new TypeError('Alphabet too long'); - } - var BASE_MAP = new Uint8Array(256); - for (var j = 0; j < BASE_MAP.length; j++) { - BASE_MAP[j] = 255; - } - for (var i = 0; i < ALPHABET.length; i++) { - var x = ALPHABET.charAt(i); - var xc = x.charCodeAt(0); - if (BASE_MAP[xc] !== 255) { - throw new TypeError(x + ' is ambiguous'); - } - BASE_MAP[xc] = i; - } - var BASE = ALPHABET.length; - var LEADER = ALPHABET.charAt(0); - var FACTOR = Math.log(BASE) / Math.log(256); - var iFACTOR = Math.log(256) / Math.log(BASE); - function encode(source) { - if (source instanceof Uint8Array); - else if (ArrayBuffer.isView(source)) { - source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); - } else if (Array.isArray(source)) { - source = Uint8Array.from(source); - } - if (!(source instanceof Uint8Array)) { - throw new TypeError('Expected Uint8Array'); - } - if (source.length === 0) { - return ''; - } - var zeroes = 0; - var length = 0; - var pbegin = 0; - var pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; - } - var size = (pend - pbegin) * iFACTOR + 1 >>> 0; - var b58 = new Uint8Array(size); - while (pbegin !== pend) { - var carry = source[pbegin]; - var i = 0; - for (var it1 = size - 1; (carry !== 0 || i < length) && it1 !== -1; it1--, i++) { - carry += 256 * b58[it1] >>> 0; - b58[it1] = carry % BASE >>> 0; - carry = carry / BASE >>> 0; - } - if (carry !== 0) { - throw new Error('Non-zero carry'); - } - length = i; - pbegin++; - } - var it2 = size - length; - while (it2 !== size && b58[it2] === 0) { - it2++; - } - var str = LEADER.repeat(zeroes); - for (; it2 < size; ++it2) { - str += ALPHABET.charAt(b58[it2]); - } - return str; - } - function decodeUnsafe(source) { - if (typeof source !== 'string') { - throw new TypeError('Expected String'); - } - if (source.length === 0) { - return new Uint8Array(); - } - var psz = 0; - if (source[psz] === ' ') { - return; - } - var zeroes = 0; - var length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; - } - var size = (source.length - psz) * FACTOR + 1 >>> 0; - var b256 = new Uint8Array(size); - while (source[psz]) { - var carry = BASE_MAP[source.charCodeAt(psz)]; - if (carry === 255) { - return; - } - var i = 0; - for (var it3 = size - 1; (carry !== 0 || i < length) && it3 !== -1; it3--, i++) { - carry += BASE * b256[it3] >>> 0; - b256[it3] = carry % 256 >>> 0; - carry = carry / 256 >>> 0; - } - if (carry !== 0) { - throw new Error('Non-zero carry'); - } - length = i; - psz++; - } - if (source[psz] === ' ') { - return; - } - var it4 = size - length; - while (it4 !== size && b256[it4] === 0) { - it4++; - } - var vch = new Uint8Array(zeroes + (size - it4)); - var j = zeroes; - while (it4 !== size) { - vch[j++] = b256[it4++]; - } - return vch; - } - function decode(string) { - var buffer = decodeUnsafe(string); - if (buffer) { - return buffer; - } - throw new Error(`Non-${ name } character`); - } - return { - encode: encode, - decodeUnsafe: decodeUnsafe, - decode: decode - }; + return createDebug; } -var src = base; -var _brrp__multiformats_scope_baseX = src; -module.exports = _brrp__multiformats_scope_baseX; +module.exports = setup; /***/ }), -<<<<<<< HEAD -/***/ 22038: -======= -/***/ 55250: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - +/***/ 15057: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ -var encode_1 = encode; -var MSB = 128, REST = 127, MSBALL = ~REST, INT = Math.pow(2, 31); -function encode(num, out, offset) { - out = out || []; - offset = offset || 0; - var oldOffset = offset; - while (num >= INT) { - out[offset++] = num & 255 | MSB; - num /= 128; - } - while (num & MSBALL) { - out[offset++] = num & 255 | MSB; - num >>>= 7; - } - out[offset] = num | 0; - encode.bytes = offset - oldOffset + 1; - return out; -} -var decode = read; -var MSB$1 = 128, REST$1 = 127; -function read(buf, offset) { - var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length; - do { - if (counter >= l) { - read.bytes = 0; - throw new RangeError('Could not decode varint'); - } - b = buf[counter++]; - res += shift < 28 ? (b & REST$1) << shift : (b & REST$1) * Math.pow(2, shift); - shift += 7; - } while (b >= MSB$1); - read.bytes = counter - offset; - return res; +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + module.exports = __nccwpck_require__(96657); +} else { + module.exports = __nccwpck_require__(81165); } -var N1 = Math.pow(2, 7); -var N2 = Math.pow(2, 14); -var N3 = Math.pow(2, 21); -var N4 = Math.pow(2, 28); -var N5 = Math.pow(2, 35); -var N6 = Math.pow(2, 42); -var N7 = Math.pow(2, 49); -var N8 = Math.pow(2, 56); -var N9 = Math.pow(2, 63); -var length = function (value) { - 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; -}; -var varint = { - encode: encode_1, - decode: decode, - encodingLength: length -}; -var _brrp_varint = varint; -var varint$1 = _brrp_varint; - -module.exports = varint$1; /***/ }), -<<<<<<< HEAD -/***/ 16665: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 81165: +/***/ ((module, exports, __nccwpck_require__) => { -module.exports = __nccwpck_require__(59985); -======= -/***/ 32924: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * Module dependencies. + */ -module.exports = __nccwpck_require__(62027); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const tty = __nccwpck_require__(76224); +const util = __nccwpck_require__(73837); +/** + * This is the Node.js implementation of `debug()`. + */ -/***/ }), +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' +); -<<<<<<< HEAD -/***/ 59985: -======= -/***/ 62027: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ (function(module, exports) { +/** + * Colors. + */ -/* jshint -W086: true */ -// +----------------------------------------------------------------------+ -// | murmurHash3js.js v3.0.1 // https://github.com/pid/murmurHash3js -// | A javascript implementation of MurmurHash3's x86 hashing algorithms. | -// |----------------------------------------------------------------------| -// | Copyright (c) 2012-2015 Karan Lyons | -// | https://github.com/karanlyons/murmurHash3.js/blob/c1778f75792abef7bdd74bc85d2d4e1a3d25cfe9/murmurHash3.js | -// | Freely distributable under the MIT license. | -// +----------------------------------------------------------------------+ +exports.colors = [6, 2, 3, 4, 5, 1]; -;(function (root, undefined) { - 'use strict'; +try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + const supportsColor = __nccwpck_require__(66164); - // Create a local object that'll be exported or referenced globally. - var library = { - 'version': '3.0.0', - 'x86': {}, - 'x64': {}, - 'inputValidation': true - }; + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } +} catch (error) { + // Swallow - we only care if `supports-color` is available; it doesn't have to be. +} - // PRIVATE FUNCTIONS - // ----------------- +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ - function _validBytes(bytes) { - // check the input is an array or a typed array - if (!Array.isArray(bytes) && !ArrayBuffer.isView(bytes)) { - return false; - } +exports.inspectOpts = Object.keys(process.env).filter(key => { + return /^debug_/i.test(key); +}).reduce((obj, key) => { + // Camel-case + const prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); - // check all bytes are actually bytes - for (var i = 0; i < bytes.length; i++) { - if (!Number.isInteger(bytes[i]) || bytes[i] < 0 || bytes[i] > 255) { - return false; - } - } - return true; - } + // Coerce string value into JS value + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } - function _x86Multiply(m, n) { - // - // Given two 32bit ints, returns the two multiplied together as a - // 32bit int. - // + obj[prop] = val; + return obj; +}, {}); - return ((m & 0xffff) * n) + ((((m >>> 16) * n) & 0xffff) << 16); - } +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ - function _x86Rotl(m, n) { - // - // Given a 32bit int and an int representing a number of bit positions, - // returns the 32bit int rotated left by that number of positions. - // +function useColors() { + return 'colors' in exports.inspectOpts ? + Boolean(exports.inspectOpts.colors) : + tty.isatty(process.stderr.fd); +} - return (m << n) | (m >>> (32 - n)); - } +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ - function _x86Fmix(h) { - // - // Given a block, returns murmurHash3's final x86 mix of that block. - // +function formatArgs(args) { + const {namespace: name, useColors} = this; - h ^= h >>> 16; - h = _x86Multiply(h, 0x85ebca6b); - h ^= h >>> 13; - h = _x86Multiply(h, 0xc2b2ae35); - h ^= h >>> 16; + if (useColors) { + const c = this.color; + const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); + const prefix = ` ${colorCode};1m${name} \u001B[0m`; - return h; - } + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} - function _x64Add(m, n) { - // - // Given two 64bit ints (as an array of two 32bit ints) returns the two - // added together as a 64bit int (as an array of two 32bit ints). - // +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + return new Date().toISOString() + ' '; +} + +/** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ - m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff]; - n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff]; - var o = [0, 0, 0, 0]; +function log(...args) { + return process.stderr.write(util.format(...args) + '\n'); +} - o[3] += m[3] + n[3]; - o[2] += o[3] >>> 16; - o[3] &= 0xffff; +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } +} - o[2] += m[2] + n[2]; - o[1] += o[2] >>> 16; - o[2] &= 0xffff; +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ - o[1] += m[1] + n[1]; - o[0] += o[1] >>> 16; - o[1] &= 0xffff; +function load() { + return process.env.DEBUG; +} - o[0] += m[0] + n[0]; - o[0] &= 0xffff; +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ - return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]]; - } +function init(debug) { + debug.inspectOpts = {}; - function _x64Multiply(m, n) { - // - // Given two 64bit ints (as an array of two 32bit ints) returns the two - // multiplied together as a 64bit int (as an array of two 32bit ints). - // + const keys = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} - m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff]; - n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff]; - var o = [0, 0, 0, 0]; +module.exports = __nccwpck_require__(20742)(exports); - o[3] += m[3] * n[3]; - o[2] += o[3] >>> 16; - o[3] &= 0xffff; +const {formatters} = module.exports; - o[2] += m[2] * n[3]; - o[1] += o[2] >>> 16; - o[2] &= 0xffff; +/** + * Map %o to `util.inspect()`, all on a single line. + */ - o[2] += m[3] * n[2]; - o[1] += o[2] >>> 16; - o[2] &= 0xffff; +formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(str => str.trim()) + .join(' '); +}; - o[1] += m[1] * n[3]; - o[0] += o[1] >>> 16; - o[1] &= 0xffff; +/** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ - o[1] += m[2] * n[2]; - o[0] += o[1] >>> 16; - o[1] &= 0xffff; +formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; - o[1] += m[3] * n[1]; - o[0] += o[1] >>> 16; - o[1] &= 0xffff; - o[0] += (m[0] * n[3]) + (m[1] * n[2]) + (m[2] * n[1]) + (m[3] * n[0]); - o[0] &= 0xffff; +/***/ }), - return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]]; - } +/***/ 19353: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - function _x64Rotl(m, n) { - // - // Given a 64bit int (as an array of two 32bit ints) and an int - // representing a number of bit positions, returns the 64bit int (as an - // array of two 32bit ints) rotated left by that number of positions. - // +var Stream = (__nccwpck_require__(12781).Stream); +var util = __nccwpck_require__(73837); - n %= 64; +module.exports = DelayedStream; +function DelayedStream() { + this.source = null; + this.dataSize = 0; + this.maxDataSize = 1024 * 1024; + this.pauseStream = true; - if (n === 32) { - return [m[1], m[0]]; - } else if (n < 32) { - return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))]; - } else { - n -= 32; - return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))]; - } - } + this._maxDataSizeExceeded = false; + this._released = false; + this._bufferedEvents = []; +} +util.inherits(DelayedStream, Stream); - function _x64LeftShift(m, n) { - // - // Given a 64bit int (as an array of two 32bit ints) and an int - // representing a number of bit positions, returns the 64bit int (as an - // array of two 32bit ints) shifted left by that number of positions. - // +DelayedStream.create = function(source, options) { + var delayedStream = new this(); - n %= 64; + options = options || {}; + for (var option in options) { + delayedStream[option] = options[option]; + } - if (n === 0) { - return m; - } else if (n < 32) { - return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n]; - } else { - return [m[1] << (n - 32), 0]; - } - } + delayedStream.source = source; - function _x64Xor(m, n) { - // - // Given two 64bit ints (as an array of two 32bit ints) returns the two - // xored together as a 64bit int (as an array of two 32bit ints). - // + var realEmit = source.emit; + source.emit = function() { + delayedStream._handleEmit(arguments); + return realEmit.apply(source, arguments); + }; - return [m[0] ^ n[0], m[1] ^ n[1]]; - } + source.on('error', function() {}); + if (delayedStream.pauseStream) { + source.pause(); + } - function _x64Fmix(h) { - // - // Given a block, returns murmurHash3's final x64 mix of that block. - // (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the - // only place where we need to right shift 64bit ints.) - // + return delayedStream; +}; - h = _x64Xor(h, [0, h[0] >>> 1]); - h = _x64Multiply(h, [0xff51afd7, 0xed558ccd]); - h = _x64Xor(h, [0, h[0] >>> 1]); - h = _x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]); - h = _x64Xor(h, [0, h[0] >>> 1]); +Object.defineProperty(DelayedStream.prototype, 'readable', { + configurable: true, + enumerable: true, + get: function() { + return this.source.readable; + } +}); - return h; - } +DelayedStream.prototype.setEncoding = function() { + return this.source.setEncoding.apply(this.source, arguments); +}; - // PUBLIC FUNCTIONS - // ---------------- +DelayedStream.prototype.resume = function() { + if (!this._released) { + this.release(); + } - library.x86.hash32 = function (bytes, seed) { - // - // Given a string and an optional seed as an int, returns a 32 bit hash - // using the x86 flavor of MurmurHash3, as an unsigned int. - // - if (library.inputValidation && !_validBytes(bytes)) { - return undefined; - } - seed = seed || 0; + this.source.resume(); +}; - var remainder = bytes.length % 4; - var blocks = bytes.length - remainder; +DelayedStream.prototype.pause = function() { + this.source.pause(); +}; - var h1 = seed; +DelayedStream.prototype.release = function() { + this._released = true; - var k1 = 0; + this._bufferedEvents.forEach(function(args) { + this.emit.apply(this, args); + }.bind(this)); + this._bufferedEvents = []; +}; - var c1 = 0xcc9e2d51; - var c2 = 0x1b873593; +DelayedStream.prototype.pipe = function() { + var r = Stream.prototype.pipe.apply(this, arguments); + this.resume(); + return r; +}; - for (var i = 0; i < blocks; i = i + 4) { - k1 = (bytes[i]) | (bytes[i + 1] << 8) | (bytes[i + 2] << 16) | (bytes[i + 3] << 24); +DelayedStream.prototype._handleEmit = function(args) { + if (this._released) { + this.emit.apply(this, args); + return; + } - k1 = _x86Multiply(k1, c1); - k1 = _x86Rotl(k1, 15); - k1 = _x86Multiply(k1, c2); + if (args[0] === 'data') { + this.dataSize += args[1].length; + this._checkIfMaxDataSizeExceeded(); + } - h1 ^= k1; - h1 = _x86Rotl(h1, 13); - h1 = _x86Multiply(h1, 5) + 0xe6546b64; - } + this._bufferedEvents.push(args); +}; - k1 = 0; +DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { + if (this._maxDataSizeExceeded) { + return; + } - switch (remainder) { - case 3: - k1 ^= bytes[i + 2] << 16; + if (this.dataSize <= this.maxDataSize) { + return; + } - case 2: - k1 ^= bytes[i + 1] << 8; + this._maxDataSizeExceeded = true; + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' + this.emit('error', new Error(message)); +}; - case 1: - k1 ^= bytes[i]; - k1 = _x86Multiply(k1, c1); - k1 = _x86Rotl(k1, 15); - k1 = _x86Multiply(k1, c2); - h1 ^= k1; - } - h1 ^= bytes.length; - h1 = _x86Fmix(h1); +/***/ }), - return h1 >>> 0; - }; +/***/ 45862: +/***/ ((__unused_webpack_module, exports) => { - library.x86.hash128 = function (bytes, seed) { - // - // Given a string and an optional seed as an int, returns a 128 bit - // hash using the x86 flavor of MurmurHash3, as an unsigned hex. - // - if (library.inputValidation && !_validBytes(bytes)) { - return undefined; - } - seed = seed || 0; - var remainder = bytes.length % 16; - var blocks = bytes.length - remainder; - var h1 = seed; - var h2 = seed; - var h3 = seed; - var h4 = seed; +Object.defineProperty(exports, "__esModule", ({ value: true })); - var k1 = 0; - var k2 = 0; - var k3 = 0; - var k4 = 0; +class Deprecation extends Error { + constructor(message) { + super(message); // Maintains proper stack trace (only available on V8) - var c1 = 0x239b961b; - var c2 = 0xab0e9789; - var c3 = 0x38b34ae5; - var c4 = 0xa1e38b93; + /* istanbul ignore next */ - for (var i = 0; i < blocks; i = i + 16) { - k1 = (bytes[i]) | (bytes[i + 1] << 8) | (bytes[i + 2] << 16) | (bytes[i + 3] << 24); - k2 = (bytes[i + 4]) | (bytes[i + 5] << 8) | (bytes[i + 6] << 16) | (bytes[i + 7] << 24); - k3 = (bytes[i + 8]) | (bytes[i + 9] << 8) | (bytes[i + 10] << 16) | (bytes[i + 11] << 24); - k4 = (bytes[i + 12]) | (bytes[i + 13] << 8) | (bytes[i + 14] << 16) | (bytes[i + 15] << 24); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } - k1 = _x86Multiply(k1, c1); - k1 = _x86Rotl(k1, 15); - k1 = _x86Multiply(k1, c2); - h1 ^= k1; + this.name = 'Deprecation'; + } - h1 = _x86Rotl(h1, 19); - h1 += h2; - h1 = _x86Multiply(h1, 5) + 0x561ccd1b; +} - k2 = _x86Multiply(k2, c2); - k2 = _x86Rotl(k2, 16); - k2 = _x86Multiply(k2, c3); - h2 ^= k2; +exports.Deprecation = Deprecation; - h2 = _x86Rotl(h2, 17); - h2 += h3; - h2 = _x86Multiply(h2, 5) + 0x0bcaa747; - k3 = _x86Multiply(k3, c3); - k3 = _x86Rotl(k3, 17); - k3 = _x86Multiply(k3, c4); - h3 ^= k3; +/***/ }), - h3 = _x86Rotl(h3, 15); - h3 += h4; - h3 = _x86Multiply(h3, 5) + 0x96cd1c35; +/***/ 28435: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - k4 = _x86Multiply(k4, c4); - k4 = _x86Rotl(k4, 18); - k4 = _x86Multiply(k4, c1); - h4 ^= k4; - h4 = _x86Rotl(h4, 13); - h4 += h1; - h4 = _x86Multiply(h4, 5) + 0x32ac3b17; - } - k1 = 0; - k2 = 0; - k3 = 0; - k4 = 0; +Object.defineProperty(exports, "__esModule", ({ value: true })); - switch (remainder) { - case 15: - k4 ^= bytes[i + 14] << 16; +var url = __nccwpck_require__(57310); +var http = __nccwpck_require__(13685); +var https = __nccwpck_require__(95687); +var zlib = __nccwpck_require__(59796); +var Stream = __nccwpck_require__(12781); +var encoding = __nccwpck_require__(54960); - case 14: - k4 ^= bytes[i + 13] << 8; +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - case 13: - k4 ^= bytes[i + 12]; - k4 = _x86Multiply(k4, c4); - k4 = _x86Rotl(k4, 18); - k4 = _x86Multiply(k4, c1); - h4 ^= k4; +function _interopNamespace(e) { + if (e && e.__esModule) return e; + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n["default"] = e; + return Object.freeze(n); +} - case 12: - k3 ^= bytes[i + 11] << 24; +var http__namespace = /*#__PURE__*/_interopNamespace(http); +var https__namespace = /*#__PURE__*/_interopNamespace(https); +var zlib__namespace = /*#__PURE__*/_interopNamespace(zlib); +var Stream__default = /*#__PURE__*/_interopDefaultLegacy(Stream); - case 11: - k3 ^= bytes[i + 10] << 16; +function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); +} - case 10: - k3 ^= bytes[i + 9] << 8; +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; - case 9: - k3 ^= bytes[i + 8]; - k3 = _x86Multiply(k3, c3); - k3 = _x86Rotl(k3, 17); - k3 = _x86Multiply(k3, c4); - h3 ^= k3; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - case 8: - k2 ^= bytes[i + 7] << 24; + return arr2; +} - case 7: - k2 ^= bytes[i + 6] << 16; +function _createForOfIteratorHelperLoose(o, allowArrayLike) { + var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; + if (it) return (it = it.call(o)).next.bind(it); - case 6: - k2 ^= bytes[i + 5] << 8; + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + return function () { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }; + } - case 5: - k2 ^= bytes[i + 4]; - k2 = _x86Multiply(k2, c2); - k2 = _x86Rotl(k2, 16); - k2 = _x86Multiply(k2, c3); - h2 ^= k2; + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} - case 4: - k1 ^= bytes[i + 3] << 24; +// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js +// (MIT licensed) +const BUFFER = Symbol('buffer'); +const TYPE = Symbol('type'); +const CLOSED = Symbol('closed'); +class Blob { + constructor() { + Object.defineProperty(this, Symbol.toStringTag, { + value: 'Blob', + writable: false, + enumerable: false, + configurable: true + }); + this[CLOSED] = false; + this[TYPE] = ''; + const blobParts = arguments[0]; + const options = arguments[1]; + const buffers = []; - case 3: - k1 ^= bytes[i + 2] << 16; + if (blobParts) { + const a = blobParts; + const length = Number(a.length); - case 2: - k1 ^= bytes[i + 1] << 8; + for (let i = 0; i < length; i++) { + const element = a[i]; + let buffer; - case 1: - k1 ^= bytes[i]; - k1 = _x86Multiply(k1, c1); - k1 = _x86Rotl(k1, 15); - k1 = _x86Multiply(k1, c2); - h1 ^= k1; + if (element instanceof Buffer) { + buffer = element; + } else if (ArrayBuffer.isView(element)) { + buffer = Buffer.from(new Uint8Array(element.buffer, element.byteOffset, element.byteLength)); + } else if (element instanceof ArrayBuffer) { + buffer = Buffer.from(new Uint8Array(element)); + } else if (element instanceof Blob) { + buffer = element[BUFFER]; + } else { + buffer = Buffer.from(typeof element === 'string' ? element : String(element)); } - h1 ^= bytes.length; - h2 ^= bytes.length; - h3 ^= bytes.length; - h4 ^= bytes.length; + buffers.push(buffer); + } + } - h1 += h2; - h1 += h3; - h1 += h4; - h2 += h1; - h3 += h1; - h4 += h1; + this[BUFFER] = Buffer.concat(buffers); + const type = options && options.type !== undefined && String(options.type).toLowerCase(); - h1 = _x86Fmix(h1); - h2 = _x86Fmix(h2); - h3 = _x86Fmix(h3); - h4 = _x86Fmix(h4); + if (type && !/[^\u0020-\u007E]/.test(type)) { + this[TYPE] = type; + } + } - h1 += h2; - h1 += h3; - h1 += h4; - h2 += h1; - h3 += h1; - h4 += h1; + get size() { + return this[CLOSED] ? 0 : this[BUFFER].length; + } - 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); - }; + get type() { + return this[TYPE]; + } - library.x64.hash128 = function (bytes, seed) { - // - // Given a string and an optional seed as an int, returns a 128 bit - // hash using the x64 flavor of MurmurHash3, as an unsigned hex. - // - if (library.inputValidation && !_validBytes(bytes)) { - return undefined; - } - seed = seed || 0; + get isClosed() { + return this[CLOSED]; + } - var remainder = bytes.length % 16; - var blocks = bytes.length - remainder; + slice() { + const size = this.size; + const start = arguments[0]; + const end = arguments[1]; + let relativeStart, relativeEnd; - var h1 = [0, seed]; - var h2 = [0, seed]; + if (start === undefined) { + relativeStart = 0; + } else if (start < 0) { + relativeStart = Math.max(size + start, 0); + } else { + relativeStart = Math.min(start, size); + } - var k1 = [0, 0]; - var k2 = [0, 0]; + if (end === undefined) { + relativeEnd = size; + } else if (end < 0) { + relativeEnd = Math.max(size + end, 0); + } else { + relativeEnd = Math.min(end, size); + } - var c1 = [0x87c37b91, 0x114253d5]; - var c2 = [0x4cf5ad43, 0x2745937f]; + const span = Math.max(relativeEnd - relativeStart, 0); + const buffer = this[BUFFER]; + const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); + const blob = new Blob([], { + type: arguments[2] + }); + blob[BUFFER] = slicedBuffer; + blob[CLOSED] = this[CLOSED]; + return blob; + } - for (var i = 0; i < blocks; i = i + 16) { - k1 = [(bytes[i + 4]) | (bytes[i + 5] << 8) | (bytes[i + 6] << 16) | (bytes[i + 7] << 24), (bytes[i]) | - (bytes[i + 1] << 8) | (bytes[i + 2] << 16) | (bytes[i + 3] << 24)]; - k2 = [(bytes[i + 12]) | (bytes[i + 13] << 8) | (bytes[i + 14] << 16) | (bytes[i + 15] << 24), (bytes[i + 8]) | - (bytes[i + 9] << 8) | (bytes[i + 10] << 16) | (bytes[i + 11] << 24)]; + close() { + this[CLOSED] = true; + } - k1 = _x64Multiply(k1, c1); - k1 = _x64Rotl(k1, 31); - k1 = _x64Multiply(k1, c2); - h1 = _x64Xor(h1, k1); +} +Object.defineProperty(Blob.prototype, Symbol.toStringTag, { + value: 'BlobPrototype', + writable: false, + enumerable: false, + configurable: true +}); - h1 = _x64Rotl(h1, 27); - h1 = _x64Add(h1, h2); - h1 = _x64Add(_x64Multiply(h1, [0, 5]), [0, 0x52dce729]); +/** + * fetch-error.js + * + * FetchError interface for operational errors + */ - k2 = _x64Multiply(k2, c2); - k2 = _x64Rotl(k2, 33); - k2 = _x64Multiply(k2, c1); - h2 = _x64Xor(h2, k2); +/** + * Create FetchError instance + * + * @param {string} message Error message for human + * @param {string} type Error type for machine + * @param {string} systemError For Node.js system error + * @return {FetchError} + */ +const netErrorMap = { + ERR_CONNECTION_REFUSED: 'ECONNREFUSED', + ERR_EMPTY_RESPONSE: 'ECONNRESET', + ERR_NAME_NOT_RESOLVED: 'ENOTFOUND', + ERR_CONTENT_DECODING_FAILED: 'Z_DATA_ERROR', + ERR_CONTENT_DECODING_INIT_FAILED: 'Z_DATA_ERROR' +}; +function FetchError(message, type, systemError) { + Error.call(this, message); + const regex = /^.*net::(.*)/; - h2 = _x64Rotl(h2, 31); - h2 = _x64Add(h2, h1); - h2 = _x64Add(_x64Multiply(h2, [0, 5]), [0, 0x38495ab5]); - } + if (regex.test(message)) { + let errorCode = regex.exec(message)[1]; // istanbul ignore else - k1 = [0, 0]; - k2 = [0, 0]; + if (Object.prototype.hasOwnProperty.call(netErrorMap, errorCode)) errorCode = netErrorMap[errorCode]; + systemError = { + code: errorCode + }; + } - switch (remainder) { - case 15: - k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 14]], 48)); + this.message = message; + this.type = type; // when err.type is `system`, err.code contains system error code - case 14: - k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 13]], 40)); + if (systemError) { + this.code = this.errno = systemError.code; + } // hide custom error implementation details from end-users - case 13: - k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 12]], 32)); - case 12: - k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 11]], 24)); + Error.captureStackTrace(this, this.constructor); +} +FetchError.prototype = Object.create(Error.prototype); +FetchError.prototype.constructor = FetchError; +FetchError.prototype.name = 'FetchError'; - case 11: - k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 10]], 16)); +const DISTURBED = Symbol('disturbed'); +/** + * Body class + * + * Cannot use ES6 class because Body must be called with .call(). + * + * @param {Stream|string|Blob|Buffer|null} body Readable stream + * @param {number} size + * @param {number} timeout + */ - case 10: - k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 9]], 8)); +function Body(body, { + size = 0, + timeout = 0 +} = {}) { + if (body == null) { + // body is undefined or null + body = null; + } else if (typeof body === 'string') ; else if (body instanceof Blob) ; else if (Buffer.isBuffer(body)) ; else if (body instanceof Stream__default["default"]) ; else { + // none of the above + // coerce to string + body = String(body); + } - case 9: - k2 = _x64Xor(k2, [0, bytes[i + 8]]); - k2 = _x64Multiply(k2, c2); - k2 = _x64Rotl(k2, 33); - k2 = _x64Multiply(k2, c1); - h2 = _x64Xor(h2, k2); + this.body = body; + this[DISTURBED] = false; + this.size = size; + this.timeout = timeout; +} +Body.prototype = { + get bodyUsed() { + return this[DISTURBED]; + }, - case 8: - k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 7]], 56)); + /** + * Decode response as ArrayBuffer + * + * @return {Promise} + */ + arrayBuffer() { + return consumeBody.call(this).then(buf => buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength)); + }, - case 7: - k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 6]], 48)); + /** + * Return raw response as Blob + * + * @return {Promise} + */ + blob() { + const ct = this.headers && this.headers.get('content-type') || ''; + return consumeBody.call(this).then(buf => Object.assign( // Prevent copying + new Blob([], { + type: ct.toLowerCase() + }), { + [BUFFER]: buf + })); + }, - case 6: - k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 5]], 40)); + /** + * Decode response as json + * + * @return {Promise} + */ + json() { + return consumeBody.call(this).then(buffer => JSON.parse(buffer.toString())); + }, - case 5: - k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 4]], 32)); + /** + * Decode response as text + * + * @return {Promise} + */ + text() { + return consumeBody.call(this).then(buffer => buffer.toString()); + }, - case 4: - k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 3]], 24)); + /** + * Decode response as buffer (non-spec api) + * + * @return {Promise} + */ + buffer() { + return consumeBody.call(this); + }, - case 3: - k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 2]], 16)); + /** + * Decode response as text, while automatically detecting the encoding and + * trying to decode to UTF-8 (non-spec api) + * + * @return {Promise} + */ + textConverted() { + return consumeBody.call(this).then(buffer => convertBody(buffer, this.headers)); + } - case 2: - k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 1]], 8)); +}; - case 1: - k1 = _x64Xor(k1, [0, bytes[i]]); - k1 = _x64Multiply(k1, c1); - k1 = _x64Rotl(k1, 31); - k1 = _x64Multiply(k1, c2); - h1 = _x64Xor(h1, k1); - } +Body.mixIn = function (proto) { + for (var _iterator = _createForOfIteratorHelperLoose(Object.getOwnPropertyNames(Body.prototype)), _step; !(_step = _iterator()).done;) { + const name = _step.value; - h1 = _x64Xor(h1, [0, bytes.length]); - h2 = _x64Xor(h2, [0, bytes.length]); + // istanbul ignore else + if (!(name in proto)) { + const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); + Object.defineProperty(proto, name, desc); + } + } +}; +/** + * Decode buffers into utf-8 string + * + * @return {Promise} + */ - h1 = _x64Add(h1, h2); - h2 = _x64Add(h2, h1); - h1 = _x64Fmix(h1); - h2 = _x64Fmix(h2); +function consumeBody() { + if (this[DISTURBED]) { + return Promise.reject(new Error(`body used already for: ${this.url}`)); + } - h1 = _x64Add(h1, h2); - h2 = _x64Add(h2, h1); + this[DISTURBED] = true; // body is null - 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); - }; + if (this.body === null) { + return Promise.resolve(Buffer.alloc(0)); + } // body is string - // INITIALIZATION - // -------------- - // Export murmurHash3 for CommonJS, either as an AMD module or just as part - // of the global object. - if (true) { + if (typeof this.body === 'string') { + return Promise.resolve(Buffer.from(this.body)); + } // body is blob - if ( true && module.exports) { - exports = module.exports = library; - } - exports.murmurHash3 = library; + if (this.body instanceof Blob) { + return Promise.resolve(this.body[BUFFER]); + } // body is buffer - } else {} -})(this); + if (Buffer.isBuffer(this.body)) { + return Promise.resolve(this.body); + } // istanbul ignore if: should never happen -/***/ }), -<<<<<<< HEAD -/***/ 25706: -======= -/***/ 43586: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (!(this.body instanceof Stream__default["default"])) { + return Promise.resolve(Buffer.alloc(0)); + } // body is stream + // get ready to actually consume the body -"use strict"; + const accum = []; + let accumBytes = 0; + let abort = false; + return new Promise((resolve, reject) => { + let resTimeout; // allow timeout on slow response body -let impl + if (this.timeout) { + resTimeout = setTimeout(() => { + abort = true; + reject(new FetchError(`Response timeout while trying to fetch ${this.url} (over ${this.timeout}ms)`, 'body-timeout')); + this.body.emit('cancel-request'); + }, this.timeout); + } // handle stream error, such as incorrect content-encoding -if (globalThis.AbortController && globalThis.AbortSignal) { - impl = globalThis -} else { - impl = __nccwpck_require__(67022) -} -module.exports.AbortSignal = impl.AbortSignal -module.exports.AbortController = impl.AbortController + this.body.on('error', err => { + reject(new FetchError(`Invalid response body while trying to fetch ${this.url}: ${err.message}`, 'system', err)); + }); + this.body.on('data', chunk => { + if (abort || chunk === null) { + return; + } + if (this.size && accumBytes + chunk.length > this.size) { + abort = true; + reject(new FetchError(`content size at ${this.url} over limit: ${this.size}`, 'max-size')); + this.body.emit('cancel-request'); + return; + } -/***/ }), + accumBytes += chunk.length; + accum.push(chunk); + }); + this.body.on('end', () => { + if (abort) { + return; + } -/***/ 96357: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + clearTimeout(resTimeout); + resolve(Buffer.concat(accum)); + }); + }); +} +/** + * Detect buffer encoding and convert to target encoding + * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding + * + * @param {Buffer} buffer Incoming buffer + * @param {Headers} headers + * @return {string} + */ -"use strict"; +function convertBody(buffer, headers) { + const ct = headers.get('content-type'); + let charset = 'utf-8'; + let res; // header -if (globalThis.fetch && globalThis.Headers && globalThis.Request && globalThis.Response) { - module.exports = { - default: globalThis.fetch, - Headers: globalThis.Headers, - Request: globalThis.Request, - Response: globalThis.Response - } -} else { - module.exports = { - default: (__nccwpck_require__(66471)["default"]), - Headers: (__nccwpck_require__(66471).Headers), - Request: (__nccwpck_require__(66471).Request), - Response: (__nccwpck_require__(66471).Response) - } -} + if (ct) { + res = /charset=([^;]*)/i.exec(ct); + } // no charset in content type, peek at response body for at most 1024 bytes -/***/ }), + const str = buffer.slice(0, 1024).toString(); // html5 -/***/ 66471: -/***/ ((module, exports, __nccwpck_require__) => { + if (!res && str) { + res = / 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$size = _ref.size; + * Additionally, checkIsHttpToken() is currently designed to be inlinable by v8, + * so take care when making changes to the implementation so that the source + * code size does not exceed v8's default max_inlined_source_size setting. + **/ +// istanbul ignore next +function isValidTokenChar(ch) { + if (ch >= 94 && ch <= 122) { + return true; + } - let size = _ref$size === undefined ? 0 : _ref$size; - var _ref$timeout = _ref.timeout; - let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; + if (ch >= 65 && ch <= 90) { + return true; + } - if (body == null) { - // body is undefined or null - body = null; - } else if (isURLSearchParams(body)) { - // body is a URLSearchParams - body = Buffer.from(body.toString()); - } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { - // body is ArrayBuffer - body = Buffer.from(body); - } else if (ArrayBuffer.isView(body)) { - // body is ArrayBufferView - body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); - } else if (body instanceof Stream) ; else { - // none of the above - // coerce to string then buffer - body = Buffer.from(String(body)); - } - this[INTERNALS] = { - body, - disturbed: false, - error: null - }; - this.size = size; - this.timeout = timeout; + if (ch === 45) { + return true; + } - if (body instanceof Stream) { - body.on('error', function (err) { - const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); - _this[INTERNALS].error = error; - }); - } -} + if (ch >= 48 && ch <= 57) { + return true; + } -Body.prototype = { - get body() { - return this[INTERNALS].body; - }, + if (ch === 34 || ch === 40 || ch === 41 || ch === 44) { + return false; + } - get bodyUsed() { - return this[INTERNALS].disturbed; - }, + if (ch >= 33 && ch <= 46) { + return true; + } - /** - * Decode response as ArrayBuffer - * - * @return Promise - */ - arrayBuffer() { - return consumeBody.call(this).then(function (buf) { - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - }); - }, + if (ch === 124 || ch === 126) { + return true; + } - /** - * Return raw response as Blob - * - * @return Promise - */ - blob() { - let ct = this.headers && this.headers.get('content-type') || ''; - return consumeBody.call(this).then(function (buf) { - return Object.assign( - // Prevent copying - new Blob([], { - type: ct.toLowerCase() - }), { - [BUFFER]: buf - }); - }); - }, + return false; +} // istanbul ignore next - /** - * Decode response as json - * - * @return Promise - */ - json() { - var _this2 = this; - return consumeBody.call(this).then(function (buffer) { - try { - return JSON.parse(buffer.toString()); - } catch (err) { - return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); - } - }); - }, +function checkIsHttpToken(val) { + if (typeof val !== 'string' || val.length === 0) { + return false; + } - /** - * Decode response as text - * - * @return Promise - */ - text() { - return consumeBody.call(this).then(function (buffer) { - return buffer.toString(); - }); - }, + if (!isValidTokenChar(val.charCodeAt(0))) { + return false; + } - /** - * Decode response as buffer (non-spec api) - * - * @return Promise - */ - buffer() { - return consumeBody.call(this); - }, + const len = val.length; - /** - * Decode response as text, while automatically detecting the encoding and - * trying to decode to UTF-8 (non-spec api) - * - * @return Promise - */ - textConverted() { - var _this3 = this; + if (len > 1) { + if (!isValidTokenChar(val.charCodeAt(1))) { + return false; + } - return consumeBody.call(this).then(function (buffer) { - return convertBody(buffer, _this3.headers); - }); - } -}; + if (len > 2) { + if (!isValidTokenChar(val.charCodeAt(2))) { + return false; + } -// In browsers, all properties are enumerable. -Object.defineProperties(Body.prototype, { - body: { enumerable: true }, - bodyUsed: { enumerable: true }, - arrayBuffer: { enumerable: true }, - blob: { enumerable: true }, - json: { enumerable: true }, - text: { enumerable: true } -}); + if (len > 3) { + if (!isValidTokenChar(val.charCodeAt(3))) { + return false; + } -Body.mixIn = function (proto) { - for (const name of Object.getOwnPropertyNames(Body.prototype)) { - // istanbul ignore else: future proof - if (!(name in proto)) { - const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); - Object.defineProperty(proto, name, desc); - } - } -}; + for (let i = 4; i < len; i++) { + if (!isValidTokenChar(val.charCodeAt(i))) { + return false; + } + } + } + } + } + return true; +} /** - * Consume and convert an entire Body to a Buffer. - * - * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body + * True if val contains an invalid field-vchar + * field-value = *( field-content / obs-fold ) + * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] + * field-vchar = VCHAR / obs-text * - * @return Promise - */ -function consumeBody() { - var _this4 = this; - - if (this[INTERNALS].disturbed) { - return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); - } - - this[INTERNALS].disturbed = true; - - if (this[INTERNALS].error) { - return Body.Promise.reject(this[INTERNALS].error); - } + * checkInvalidHeaderChar() is currently designed to be inlinable by v8, + * so take care when making changes to the implementation so that the source + * code size does not exceed v8's default max_inlined_source_size setting. + **/ +// istanbul ignore next - let body = this.body; +function checkInvalidHeaderChar(val) { + val += ''; - // body is null - if (body === null) { - return Body.Promise.resolve(Buffer.alloc(0)); - } + if (val.length < 1) { + return false; + } - // body is blob - if (isBlob(body)) { - body = body.stream(); - } + let c = val.charCodeAt(0); - // body is buffer - if (Buffer.isBuffer(body)) { - return Body.Promise.resolve(body); - } + if (c <= 31 && c !== 9 || c > 255 || c === 127) { + return true; + } - // istanbul ignore if: should never happen - if (!(body instanceof Stream)) { - return Body.Promise.resolve(Buffer.alloc(0)); - } + if (val.length < 2) { + return false; + } - // body is stream - // get ready to actually consume the body - let accum = []; - let accumBytes = 0; - let abort = false; - - return new Body.Promise(function (resolve, reject) { - let resTimeout; - - // allow timeout on slow response body - if (_this4.timeout) { - resTimeout = setTimeout(function () { - abort = true; - reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); - }, _this4.timeout); - } + c = val.charCodeAt(1); - // handle stream errors - body.on('error', function (err) { - if (err.name === 'AbortError') { - // if the request was aborted, reject with this Error - abort = true; - reject(err); - } else { - // other errors, such as incorrect content-encoding - reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); - } - }); + if (c <= 31 && c !== 9 || c > 255 || c === 127) { + return true; + } - body.on('data', function (chunk) { - if (abort || chunk === null) { - return; - } + if (val.length < 3) { + return false; + } - if (_this4.size && accumBytes + chunk.length > _this4.size) { - abort = true; - reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); - return; - } + c = val.charCodeAt(2); - accumBytes += chunk.length; - accum.push(chunk); - }); + if (c <= 31 && c !== 9 || c > 255 || c === 127) { + return true; + } - body.on('end', function () { - if (abort) { - return; - } + for (let i = 3; i < val.length; ++i) { + c = val.charCodeAt(i); - clearTimeout(resTimeout); + if (c <= 31 && c !== 9 || c > 255 || c === 127) { + return true; + } + } - try { - resolve(Buffer.concat(accum, accumBytes)); - } catch (err) { - // handle streams that have accumulated too much data (issue #414) - reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - }); + return false; } -/** - * Detect buffer encoding and convert to target encoding - * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding - * - * @param Buffer buffer Incoming buffer - * @param String encoding Target encoding - * @return String - */ -function convertBody(buffer, headers) { - if (typeof convert !== 'function') { - throw new Error('The package `encoding` must be installed to use the textConverted() function'); - } - - const ct = headers.get('content-type'); - let charset = 'utf-8'; - let res, str; - - // header - if (ct) { - res = /charset=([^;]*)/i.exec(ct); - } - - // no charset in content type, peek at response body for at most 1024 bytes - str = buffer.slice(0, 1024).toString(); - - // html5 - if (!res && str) { - res = /> + // Note: per spec we have to first exhaust the lists then process them -/** - * Clone body given Res/Req instance - * - * @param Mixed instance Response or Request instance - * @return Mixed - */ -function clone(instance) { - let p1, p2; - let body = instance.body; - // don't allow cloning a used body - if (instance.bodyUsed) { - throw new Error('cannot clone body after it is used'); - } + const pairs = []; - // check that body is a stream and not form-data object - // note: we can't clone the form-data object without having it as a dependency - if (body instanceof Stream && typeof body.getBoundary !== 'function') { - // tee instance body - p1 = new PassThrough(); - p2 = new PassThrough(); - body.pipe(p1); - body.pipe(p2); - // set instance body to teed body and return the other teed body - instance[INTERNALS].body = p1; - body = p2; - } + for (var _iterator = _createForOfIteratorHelperLoose(init), _step; !(_step = _iterator()).done;) { + const pair = _step.value; - return body; -} + if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { + throw new TypeError('Each header pair must be iterable'); + } -/** - * Performs the operation "extract a `Content-Type` value from |object|" as - * specified in the specification: - * https://fetch.spec.whatwg.org/#concept-bodyinit-extract - * - * This function assumes that instance.body is present. - * - * @param Mixed instance Any options.body input - */ -function extractContentType(body) { - if (body === null) { - // body is null - return null; - } else if (typeof body === 'string') { - // body is string - return 'text/plain;charset=UTF-8'; - } else if (isURLSearchParams(body)) { - // body is a URLSearchParams - return 'application/x-www-form-urlencoded;charset=UTF-8'; - } else if (isBlob(body)) { - // body is blob - return body.type || null; - } else if (Buffer.isBuffer(body)) { - // body is buffer - return null; - } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { - // body is ArrayBuffer - return null; - } else if (ArrayBuffer.isView(body)) { - // body is ArrayBufferView - return null; - } else if (typeof body.getBoundary === 'function') { - // detect form data input from form-data module - return `multipart/form-data;boundary=${body.getBoundary()}`; - } else if (body instanceof Stream) { - // body is stream - // can't really do much about this - return null; - } else { - // Body constructor defaults other things to string - return 'text/plain;charset=UTF-8'; - } -} + pairs.push(Array.from(pair)); + } -/** - * The Fetch Standard treats this as if "total bytes" is a property on the body. - * For us, we have to explicitly get it with a function. - * - * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes - * - * @param Body instance Instance of Body - * @return Number? Number of bytes, or null if not possible - */ -function getTotalBytes(instance) { - const body = instance.body; + for (var _i = 0, _pairs = pairs; _i < _pairs.length; _i++) { + const pair = _pairs[_i]; + if (pair.length !== 2) { + throw new TypeError('Each header pair must be a name/value tuple'); + } - if (body === null) { - // body is null - return 0; - } else if (isBlob(body)) { - return body.size; - } else if (Buffer.isBuffer(body)) { - // body is buffer - return body.length; - } else if (body && typeof body.getLengthSync === 'function') { - // detect form data input from form-data module - if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x - body.hasKnownLength && body.hasKnownLength()) { - // 2.x - return body.getLengthSync(); - } - return null; - } else { - // body is stream - return null; - } -} + this.append(pair[0], pair[1]); + } + } else { + // record + for (var _i2 = 0, _Object$keys = Object.keys(init); _i2 < _Object$keys.length; _i2++) { + const key = _Object$keys[_i2]; + const value = init[key]; + this.append(key, value); + } + } + } else { + throw new TypeError('Provided initializer must be an object'); + } -/** - * Write a Body to a Node.js WritableStream (e.g. http.Request) object. - * - * @param Body instance Instance of Body - * @return Void - */ -function writeToStream(dest, instance) { - const body = instance.body; - - - if (body === null) { - // body is null - dest.end(); - } else if (isBlob(body)) { - body.stream().pipe(dest); - } else if (Buffer.isBuffer(body)) { - // body is buffer - dest.write(body); - dest.end(); - } else { - // body is stream - body.pipe(dest); - } -} + Object.defineProperty(this, Symbol.toStringTag, { + value: 'Headers', + writable: false, + enumerable: false, + configurable: true + }); + } + /** + * Return first header value given name + * + * @param {string} name Header name + * @return {string} + */ -// expose Promise -Body.Promise = global.Promise; -/** - * headers.js - * - * Headers class offers convenient helpers - */ + get(name) { + const list = this[MAP][sanitizeName(name)]; -const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/; -const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/; + if (!list) { + return null; + } -function validateName(name) { - name = `${name}`; - if (invalidTokenRegex.test(name) || name === '') { - throw new TypeError(`${name} is not a legal HTTP header name`); - } -} + return list.join(','); + } + /** + * Iterate over all headers + * + * @param {function} callback Executed for each item with parameters (value, name, thisArg) + * @param {boolean} thisArg `this` context for callback function + */ -function validateValue(value) { - value = `${value}`; - if (invalidHeaderCharRegex.test(value)) { - throw new TypeError(`${value} is not a legal HTTP header value`); - } -} -/** - * Find the key in the map object given a header name. - * - * Returns undefined if not found. - * - * @param String name Header name - * @return String|Undefined - */ -function find(map, name) { - name = name.toLowerCase(); - for (const key in map) { - if (key.toLowerCase() === name) { - return key; - } - } - return undefined; -} + forEach(callback, thisArg = undefined) { + let pairs = getHeaderPairs(this); + let i = 0; -const MAP = Symbol('map'); -class Headers { - /** - * Headers class - * - * @param Object headers Response headers - * @return Void - */ - constructor() { - let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; + while (i < pairs.length) { + const _pairs$i = pairs[i], + name = _pairs$i[0], + value = _pairs$i[1]; + callback.call(thisArg, value, name, this); + pairs = getHeaderPairs(this); + i++; + } + } + /** + * Overwrite header values given name + * + * @param {string} name Header name + * @param {string|Array.|*} value Header value + */ - this[MAP] = Object.create(null); - if (init instanceof Headers) { - const rawHeaders = init.raw(); - const headerNames = Object.keys(rawHeaders); + set(name, value) { + this[MAP][sanitizeName(name)] = [sanitizeValue(value)]; + } + /** + * Append a value onto existing header + * + * @param {string} name Header name + * @param {string|Array.|*} value Header value + */ - for (const headerName of headerNames) { - for (const value of rawHeaders[headerName]) { - this.append(headerName, value); - } - } - return; - } + append(name, value) { + if (!this.has(name)) { + this.set(name, value); + return; + } - // We don't worry about converting prop to ByteString here as append() - // will handle it. - if (init == null) ; else if (typeof init === 'object') { - const method = init[Symbol.iterator]; - if (method != null) { - if (typeof method !== 'function') { - throw new TypeError('Header pairs must be iterable'); - } + this[MAP][sanitizeName(name)].push(sanitizeValue(value)); + } + /** + * Check for header name existence + * + * @param {string} name Header name + * @return {boolean} + */ - // sequence> - // Note: per spec we have to first exhaust the lists then process them - const pairs = []; - for (const pair of init) { - if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { - throw new TypeError('Each header pair must be iterable'); - } - pairs.push(Array.from(pair)); - } - for (const pair of pairs) { - if (pair.length !== 2) { - throw new TypeError('Each header pair must be a name/value tuple'); - } - this.append(pair[0], pair[1]); - } - } else { - // record - for (const key of Object.keys(init)) { - const value = init[key]; - this.append(key, value); - } - } - } else { - throw new TypeError('Provided initializer must be an object'); - } - } + has(name) { + return !!this[MAP][sanitizeName(name)]; + } + /** + * Delete all header values given name + * + * @param {string} name Header name + */ - /** - * Return combined header value given name - * - * @param String name Header name - * @return Mixed - */ - get(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key === undefined) { - return null; - } - return this[MAP][key].join(', '); - } + delete(name) { + delete this[MAP][sanitizeName(name)]; + } + /** + * Return raw headers (non-spec api) + * + * @return {Object} + */ - /** - * Iterate over all headers - * - * @param Function callback Executed for each item with parameters (value, name, thisArg) - * @param Boolean thisArg `this` context for callback function - * @return Void - */ - forEach(callback) { - let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - - let pairs = getHeaders(this); - let i = 0; - while (i < pairs.length) { - var _pairs$i = pairs[i]; - const name = _pairs$i[0], - value = _pairs$i[1]; - - callback.call(thisArg, value, name, this); - pairs = getHeaders(this); - i++; - } - } - /** - * Overwrite header values given name - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - set(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - this[MAP][key !== undefined ? key : name] = [value]; - } + raw() { + return this[MAP]; + } + /** + * Get an iterator on keys. + * + * @return {Iterator} + */ - /** - * Append a value onto existing header - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - append(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - if (key !== undefined) { - this[MAP][key].push(value); - } else { - this[MAP][name] = [value]; - } - } - /** - * Check for header name existence - * - * @param String name Header name - * @return Boolean - */ - has(name) { - name = `${name}`; - validateName(name); - return find(this[MAP], name) !== undefined; - } + keys() { + return createHeadersIterator(this, 'key'); + } + /** + * Get an iterator on values. + * + * @return {Iterator} + */ - /** - * Delete all header values given name - * - * @param String name Header name - * @return Void - */ - delete(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key !== undefined) { - delete this[MAP][key]; - } - } - /** - * Return raw headers (non-spec api) - * - * @return Object - */ - raw() { - return this[MAP]; - } + values() { + return createHeadersIterator(this, 'value'); + } + /** + * Get an iterator on entries. + * + * This is the default iterator of the Headers object. + * + * @return {Iterator} + */ - /** - * Get an iterator on keys. - * - * @return Iterator - */ - keys() { - return createHeadersIterator(this, 'key'); - } - /** - * Get an iterator on values. - * - * @return Iterator - */ - values() { - return createHeadersIterator(this, 'value'); - } + [Symbol.iterator]() { + return createHeadersIterator(this, 'key+value'); + } - /** - * Get an iterator on entries. - * - * This is the default iterator of the Headers object. - * - * @return Iterator - */ - [Symbol.iterator]() { - return createHeadersIterator(this, 'key+value'); - } } Headers.prototype.entries = Headers.prototype[Symbol.iterator]; - Object.defineProperty(Headers.prototype, Symbol.toStringTag, { - value: 'Headers', - writable: false, - enumerable: false, - configurable: true + value: 'HeadersPrototype', + writable: false, + enumerable: false, + configurable: true }); -Object.defineProperties(Headers.prototype, { - get: { enumerable: true }, - forEach: { enumerable: true }, - set: { enumerable: true }, - append: { enumerable: true }, - has: { enumerable: true }, - delete: { enumerable: true }, - keys: { enumerable: true }, - values: { enumerable: true }, - entries: { enumerable: true } -}); +function getHeaderPairs(headers, kind) { + if (kind === 'key') return Object.keys(headers[MAP]).sort().map(k => [k]); + const pairs = []; -function getHeaders(headers) { - let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; + for (var _iterator2 = _createForOfIteratorHelperLoose(Object.keys(headers[MAP]).sort()), _step2; !(_step2 = _iterator2()).done;) { + const key = _step2.value; - const keys = Object.keys(headers[MAP]).sort(); - return keys.map(kind === 'key' ? function (k) { - return k.toLowerCase(); - } : kind === 'value' ? function (k) { - return headers[MAP][k].join(', '); - } : function (k) { - return [k.toLowerCase(), headers[MAP][k].join(', ')]; - }); + for (var _iterator3 = _createForOfIteratorHelperLoose(headers[MAP][key]), _step3; !(_step3 = _iterator3()).done;) { + const value = _step3.value; + pairs.push([key, value]); + } + } + + return pairs; } const INTERNAL = Symbol('internal'); function createHeadersIterator(target, kind) { - const iterator = Object.create(HeadersIteratorPrototype); - iterator[INTERNAL] = { - target, - kind, - index: 0 - }; - return iterator; + const iterator = Object.create(HeadersIteratorPrototype); + iterator[INTERNAL] = { + target, + kind, + index: 0 + }; + return iterator; } const HeadersIteratorPrototype = Object.setPrototypeOf({ - next() { - // istanbul ignore if - if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { - throw new TypeError('Value of `this` is not a HeadersIterator'); - } - - var _INTERNAL = this[INTERNAL]; - const target = _INTERNAL.target, - kind = _INTERNAL.kind, - index = _INTERNAL.index; - - const values = getHeaders(target, kind); - const len = values.length; - if (index >= len) { - return { - value: undefined, - done: true - }; - } + next() { + // istanbul ignore if + if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { + throw new TypeError('Value of `this` is not a HeadersIterator'); + } - this[INTERNAL].index = index + 1; + const _this$INTERNAL = this[INTERNAL], + target = _this$INTERNAL.target, + kind = _this$INTERNAL.kind, + index = _this$INTERNAL.index; + const values = getHeaderPairs(target, kind); + const len = values.length; - return { - value: values[index], - done: false - }; - } -}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); + if (index >= len) { + return { + value: undefined, + done: true + }; + } -Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { - value: 'HeadersIterator', - writable: false, - enumerable: false, - configurable: true -}); + const pair = values[index]; + this[INTERNAL].index = index + 1; + let result; -/** - * Export the Headers object in a form that Node.js can consume. - * - * @param Headers headers - * @return Object - */ -function exportNodeCompatibleHeaders(headers) { - const obj = Object.assign({ __proto__: null }, headers[MAP]); + if (kind === 'key') { + result = pair[0]; + } else if (kind === 'value') { + result = pair[1]; + } else { + result = pair; + } - // http.request() only supports string as Host header. This hack makes - // specifying custom Host header possible. - const hostHeaderKey = find(headers[MAP], 'Host'); - if (hostHeaderKey !== undefined) { - obj[hostHeaderKey] = obj[hostHeaderKey][0]; - } + return { + value: result, + done: false + }; + } - return obj; -} +}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); +Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { + value: 'HeadersIterator', + writable: false, + enumerable: false, + configurable: true +}); /** - * Create a Headers object from an object of headers, ignoring those that do - * not conform to HTTP grammar productions. + * response.js * - * @param Object obj Object of headers - * @return Headers + * Response class provides content decoding */ -function createHeadersLenient(obj) { - const headers = new Headers(); - for (const name of Object.keys(obj)) { - if (invalidTokenRegex.test(name)) { - continue; - } - if (Array.isArray(obj[name])) { - for (const val of obj[name]) { - if (invalidHeaderCharRegex.test(val)) { - continue; - } - if (headers[MAP][name] === undefined) { - headers[MAP][name] = [val]; - } else { - headers[MAP][name].push(val); - } - } - } else if (!invalidHeaderCharRegex.test(obj[name])) { - headers[MAP][name] = [obj[name]]; - } - } - return headers; -} - -const INTERNALS$1 = Symbol('Response internals'); - -// fix an issue where "STATUS_CODES" aren't a named export for node <10 -const STATUS_CODES = http.STATUS_CODES; - /** * Response class * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void + * @param {Stream} body Readable stream + * @param {Object} opts Response options */ -class Response { - constructor() { - let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - Body.call(this, body, opts); - - const status = opts.status || 200; - const headers = new Headers(opts.headers); - - if (body != null && !headers.has('Content-Type')) { - const contentType = extractContentType(body); - if (contentType) { - headers.append('Content-Type', contentType); - } - } - this[INTERNALS$1] = { - url: opts.url, - status, - statusText: opts.statusText || STATUS_CODES[status], - headers, - counter: opts.counter - }; - } - - get url() { - return this[INTERNALS$1].url || ''; - } - - get status() { - return this[INTERNALS$1].status; - } +class Response { + constructor(body = null, opts = {}) { + Body.call(this, body, opts); + this.url = opts.url; + this.status = opts.status || 200; + this.statusText = opts.statusText || http.STATUS_CODES[this.status]; + this.headers = new Headers(opts.headers); + this.useElectronNet = opts.useElectronNet; + Object.defineProperty(this, Symbol.toStringTag, { + value: 'Response', + writable: false, + enumerable: false, + configurable: true + }); + } + /** + * Convenience property representing if the request ended normally + */ - /** - * Convenience property representing if the request ended normally - */ - get ok() { - return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; - } - get redirected() { - return this[INTERNALS$1].counter > 0; - } + get ok() { + return this.status >= 200 && this.status < 300; + } + /** + * Clone this response + * + * @return {Response} + */ - get statusText() { - return this[INTERNALS$1].statusText; - } - get headers() { - return this[INTERNALS$1].headers; - } + clone() { + return new Response(clone(this), { + url: this.url, + status: this.status, + statusText: this.statusText, + headers: this.headers, + ok: this.ok, + useElectronNet: this.useElectronNet + }); + } - /** - * Clone this response - * - * @return Response - */ - clone() { - return new Response(clone(this), { - url: this.url, - status: this.status, - statusText: this.statusText, - headers: this.headers, - ok: this.ok, - redirected: this.redirected - }); - } } - Body.mixIn(Response.prototype); - -Object.defineProperties(Response.prototype, { - url: { enumerable: true }, - status: { enumerable: true }, - ok: { enumerable: true }, - redirected: { enumerable: true }, - statusText: { enumerable: true }, - headers: { enumerable: true }, - clone: { enumerable: true } -}); - Object.defineProperty(Response.prototype, Symbol.toStringTag, { - value: 'Response', - writable: false, - enumerable: false, - configurable: true + value: 'ResponsePrototype', + writable: false, + enumerable: false, + configurable: true }); -const INTERNALS$2 = Symbol('Request internals'); -const URL = Url.URL || whatwgUrl.URL; - -// fix an issue where "format", "parse" aren't a named export for node <10 -const parse_url = Url.parse; -const format_url = Url.format; - -/** - * Wrapper around `new URL` to handle arbitrary URLs - * - * @param {string} urlStr - * @return {void} - */ -function parseURL(urlStr) { - /* - Check whether the URL is absolute or not - Scheme: https://tools.ietf.org/html/rfc3986#section-3.1 - Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3 - */ - if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) { - urlStr = new URL(urlStr).toString(); - } - - // Fallback to old implementation for arbitrary URLs - return parse_url(urlStr); -} - -const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; - /** - * Check if a value is an instance of Request. + * request.js * - * @param Mixed input - * @return Boolean + * Request class contains server only options */ -function isRequest(input) { - return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; -} - -function isAbortSignal(signal) { - const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); - return !!(proto && proto.constructor.name === 'AbortSignal'); -} - +const PARSED_URL = Symbol('url'); /** * Request class * - * @param Mixed input Url or Request instance - * @param Object init Custom options - * @return Void + * @param {string|Request} input Url or Request instance + * @param {Object} init Custom options */ + class Request { - constructor(input) { - let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - let parsedURL; - - // normalize input - if (!isRequest(input)) { - if (input && input.href) { - // in order to support Node.js' Url objects; though WHATWG's URL objects - // will fall into this branch also (since their `toString()` will return - // `href` property anyway) - parsedURL = parseURL(input.href); - } else { - // coerce input to a string before attempting to parse - parsedURL = parseURL(`${input}`); - } - input = {}; - } else { - parsedURL = parseURL(input.url); - } + constructor(input, init = {}) { + let parsedURL; // normalize input - let method = init.method || input.method || 'GET'; - method = method.toUpperCase(); + if (!(input instanceof Request)) { + if (input && input.href) { + // in order to support Node.js' Url objects; though WHATWG's URL objects + // will fall into this branch also (since their `toString()` will return + // `href` property anyway) + parsedURL = url.parse(input.href); + } else { + // coerce input to a string before attempting to parse + parsedURL = url.parse(`${input}`); + } - if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { - throw new TypeError('Request with GET/HEAD method cannot have body'); - } + input = {}; + } else { + parsedURL = url.parse(input.url); + } - let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; + const method = init.method || input.method || 'GET'; - Body.call(this, inputBody, { - timeout: init.timeout || input.timeout || 0, - size: init.size || input.size || 0 - }); + if ((init.body != null || input instanceof Request && input.body !== null) && (method === 'GET' || method === 'HEAD')) { + throw new TypeError('Request with GET/HEAD method cannot have body'); + } - const headers = new Headers(init.headers || input.headers || {}); + const inputBody = init.body != null ? init.body : input instanceof Request && input.body !== null ? clone(input) : null; + Body.call(this, inputBody, { + timeout: init.timeout || input.timeout || 0, + size: init.size || input.size || 0 + }); // fetch spec options - if (inputBody != null && !headers.has('Content-Type')) { - const contentType = extractContentType(inputBody); - if (contentType) { - headers.append('Content-Type', contentType); - } - } + this.method = method.toUpperCase(); + this.redirect = init.redirect || input.redirect || 'follow'; + this.signal = init.signal || input.signal || null; + this.headers = new Headers(init.headers || input.headers || {}); + this.headers.delete('Content-Length'); // user cannot set content-length themself as per fetch spec - let signal = isRequest(input) ? input.signal : null; - if ('signal' in init) signal = init.signal; + this.chunkedEncoding = false; + this.useElectronNet = init.useElectronNet !== undefined // have to do this instead of || because it can be set to false + ? init.useElectronNet : input.useElectronNet; // istanbul ignore if - if (signal != null && !isAbortSignal(signal)) { - throw new TypeError('Expected signal to be an instanceof AbortSignal'); - } + if (this.useElectronNet && !process.versions.electron) throw new Error('Cannot use Electron/net module on Node.js!'); - this[INTERNALS$2] = { - method, - redirect: init.redirect || input.redirect || 'follow', - headers, - parsedURL, - signal - }; + if (this.useElectronNet === undefined) { + this.useElectronNet = Boolean(process.versions.electron); + } - // node-fetch-only options - this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; - this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; - this.counter = init.counter || input.counter || 0; - this.agent = init.agent || input.agent; - } + if (this.useElectronNet) { + this.useSessionCookies = init.useSessionCookies !== undefined ? init.useSessionCookies : input.useSessionCookies; + } - get method() { - return this[INTERNALS$2].method; - } + if (init.body != null) { + const contentType = extractContentType(this); - get url() { - return format_url(this[INTERNALS$2].parsedURL); - } + if (contentType !== null && !this.headers.has('Content-Type')) { + this.headers.append('Content-Type', contentType); + } + } // server only options - get headers() { - return this[INTERNALS$2].headers; - } - get redirect() { - return this[INTERNALS$2].redirect; - } + this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; + this.counter = init.counter || input.counter || 0; + this.session = init.session || input.session; + this[PARSED_URL] = parsedURL; + Object.defineProperty(this, Symbol.toStringTag, { + value: 'Request', + writable: false, + enumerable: false, + configurable: true + }); + } - get signal() { - return this[INTERNALS$2].signal; - } + get url() { + return url.format(this[PARSED_URL]); + } + /** + * Clone this request + * + * @return {Request} + */ - /** - * Clone this request - * - * @return Request - */ - clone() { - return new Request(this); - } -} -Body.mixIn(Request.prototype); + clone() { + return new Request(this); + } +} +Body.mixIn(Request.prototype); Object.defineProperty(Request.prototype, Symbol.toStringTag, { - value: 'Request', - writable: false, - enumerable: false, - configurable: true + value: 'RequestPrototype', + writable: false, + enumerable: false, + configurable: true }); +function getNodeRequestOptions(request) { + const parsedURL = request[PARSED_URL]; + const headers = new Headers(request.headers); // fetch step 3 -Object.defineProperties(Request.prototype, { - method: { enumerable: true }, - url: { enumerable: true }, - headers: { enumerable: true }, - redirect: { enumerable: true }, - clone: { enumerable: true }, - signal: { enumerable: true } -}); + if (!headers.has('Accept')) { + headers.set('Accept', '*/*'); + } // Basic fetch -/** - * Convert a Request to Node.js http request options. - * - * @param Request A Request instance - * @return Object The options object to be passed to http.request - */ -function getNodeRequestOptions(request) { - const parsedURL = request[INTERNALS$2].parsedURL; - const headers = new Headers(request[INTERNALS$2].headers); - // fetch step 1.3 - if (!headers.has('Accept')) { - headers.set('Accept', '*/*'); - } + if (!parsedURL.protocol || !parsedURL.hostname) { + throw new TypeError('Only absolute URLs are supported'); + } - // Basic fetch - if (!parsedURL.protocol || !parsedURL.hostname) { - throw new TypeError('Only absolute URLs are supported'); - } + if (!/^https?:$/.test(parsedURL.protocol)) { + throw new TypeError('Only HTTP(S) protocols are supported'); + } // HTTP-network-or-cache fetch steps 5-9 - if (!/^https?:$/.test(parsedURL.protocol)) { - throw new TypeError('Only HTTP(S) protocols are supported'); - } - if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { - throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); - } + let contentLengthValue = null; - // HTTP-network-or-cache fetch steps 2.4-2.7 - let contentLengthValue = null; - if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { - contentLengthValue = '0'; - } - if (request.body != null) { - const totalBytes = getTotalBytes(request); - if (typeof totalBytes === 'number') { - contentLengthValue = String(totalBytes); - } - } - if (contentLengthValue) { - headers.set('Content-Length', contentLengthValue); - } + if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { + contentLengthValue = '0'; + } - // HTTP-network-or-cache fetch step 2.11 - if (!headers.has('User-Agent')) { - headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); - } + if (request.body != null) { + const totalBytes = getTotalBytes(request); - // HTTP-network-or-cache fetch step 2.15 - if (request.compress && !headers.has('Accept-Encoding')) { - headers.set('Accept-Encoding', 'gzip,deflate'); - } + if (typeof totalBytes === 'number') { + contentLengthValue = String(totalBytes); + } + } - let agent = request.agent; - if (typeof agent === 'function') { - agent = agent(parsedURL); - } + if (contentLengthValue) { + if (!request.useElectronNet) headers.set('Content-Length', contentLengthValue); + } else { + request.chunkedEncoding = true; + } // HTTP-network-or-cache fetch step 12 - if (!headers.has('Connection') && !agent) { - headers.set('Connection', 'close'); - } - // HTTP-network fetch step 4.2 - // chunked encoding is handled by Node.js + if (!headers.has('User-Agent')) { + headers.set('User-Agent', `electron-fetch/1.0 ${request.useElectronNet ? 'electron' : 'node'} (+https://github.com/arantes555/electron-fetch)`); + } // HTTP-network-or-cache fetch step 16 - return Object.assign({}, parsedURL, { - method: request.method, - headers: exportNodeCompatibleHeaders(headers), - agent - }); + + headers.set('Accept-Encoding', 'gzip,deflate'); + + if (!headers.has('Connection')) { + headers.set('Connection', 'close'); + } // HTTP-network fetch step 4 + // chunked encoding is handled by Node.js when not running in electron + + + return Object.assign({}, parsedURL, { + method: request.method, + headers: headers.raw() + }); } -/** - * abort-error.js - * - * AbortError interface for cancelled requests - */ +let electron; // istanbul ignore else + +if (process.versions.electron) { + electron = __nccwpck_require__(81614); +} +const isReady = electron && electron.app && !electron.app.isReady() ? new Promise(resolve => electron.app.once('ready', resolve)) : Promise.resolve(); /** - * Create AbortError instance + * Fetch function * - * @param String message Error message for human - * @return AbortError + * @param {string|Request} url Absolute url or Request instance + * @param {Object} [opts] Fetch options + * @return {Promise} */ -function AbortError(message) { - Error.call(this, message); - this.type = 'aborted'; - this.message = message; +function fetch(url$1, opts = {}) { + // wrap http.request into fetch + return isReady.then(() => new Promise((resolve, reject) => { + // build request object + const request = new Request(url$1, opts); + const options = getNodeRequestOptions(request); + const send = request.useElectronNet ? electron.net.request : (options.protocol === 'https:' ? https__namespace : http__namespace).request; // http.request only support string as host header, this hack make custom host header possible - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} + if (options.headers.host) { + options.headers.host = options.headers.host[0]; + } + + if (request.signal && request.signal.aborted) { + reject(new FetchError('request aborted', 'abort')); + return; + } // send request -AbortError.prototype = Object.create(Error.prototype); -AbortError.prototype.constructor = AbortError; -AbortError.prototype.name = 'AbortError'; -const URL$1 = Url.URL || whatwgUrl.URL; + let headers; + + if (request.useElectronNet) { + headers = options.headers; + delete options.headers; + options.session = opts.session || electron.session.defaultSession; + options.useSessionCookies = request.useSessionCookies; + } else { + if (opts.agent) options.agent = opts.agent; + if (opts.onLogin) reject(new Error('"onLogin" option is only supported with "useElectronNet" enabled')); + } -// fix an issue where "PassThrough", "resolve" aren't a named export for node <10 -const PassThrough$1 = Stream.PassThrough; + const req = send(options); -const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) { - const orig = new URL$1(original).hostname; - const dest = new URL$1(destination).hostname; + if (request.useElectronNet) { + for (const headerName in headers) { + if (typeof headers[headerName] === 'string') req.setHeader(headerName, headers[headerName]);else { + for (var _iterator = _createForOfIteratorHelperLoose(headers[headerName]), _step; !(_step = _iterator()).done;) { + const headerValue = _step.value; + req.setHeader(headerName, headerValue); + } + } + } + } - return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest); -}; + let reqTimeout; -/** - * Fetch function - * - * @param Mixed url Absolute url or Request instance - * @param Object opts Fetch options - * @return Promise - */ -function fetch(url, opts) { + const cancelRequest = () => { + if (request.useElectronNet) { + req.abort(); // in electron, `req.destroy()` does not send abort to server + } else { + req.destroy(); // in node.js, `req.abort()` is deprecated + } + }; - // allow custom promise - if (!fetch.Promise) { - throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); - } + const abortRequest = () => { + const err = new FetchError('request aborted', 'abort'); + reject(err); + cancelRequest(); + req.emit('error', err); + }; + + if (request.signal) { + request.signal.addEventListener('abort', abortRequest); + } + + if (request.timeout) { + reqTimeout = setTimeout(() => { + const err = new FetchError(`network timeout at: ${request.url}`, 'request-timeout'); + reject(err); + cancelRequest(); + }, request.timeout); + } + + if (request.useElectronNet) { + // handle authenticating proxies + req.on('login', (authInfo, callback) => { + if (opts.user && opts.password) { + callback(opts.user, opts.password); + } else if (opts.onLogin) { + opts.onLogin(authInfo).then(credentials => { + if (credentials) { + callback(credentials.username, credentials.password); + } else { + callback(); + } + }).catch(error => { + cancelRequest(); + reject(error); + }); + } else { + cancelRequest(); + reject(new FetchError(`login event received from ${authInfo.host} but no credentials or onLogin handler provided`, 'proxy', { + code: 'PROXY_AUTH_FAILED' + })); + } + }); + } + + req.on('error', err => { + clearTimeout(reqTimeout); + + if (request.signal) { + request.signal.removeEventListener('abort', abortRequest); + } + + reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); + }); + req.on('abort', () => { + clearTimeout(reqTimeout); - Body.Promise = fetch.Promise; + if (request.signal) { + request.signal.removeEventListener('abort', abortRequest); + } + }); + req.on('response', res => { + try { + clearTimeout(reqTimeout); - // wrap http.request into fetch - return new fetch.Promise(function (resolve, reject) { - // build request object - const request = new Request(url, opts); - const options = getNodeRequestOptions(request); + if (request.signal) { + request.signal.removeEventListener('abort', abortRequest); + } // handle redirect - const send = (options.protocol === 'https:' ? https : http).request; - const signal = request.signal; - let response = null; + if (fetch.isRedirect(res.statusCode) && request.redirect !== 'manual') { + if (request.redirect === 'error') { + reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect')); + return; + } - const abort = function abort() { - let error = new AbortError('The user aborted a request.'); - reject(error); - if (request.body && request.body instanceof Stream.Readable) { - request.body.destroy(error); - } - if (!response || !response.body) return; - response.body.emit('error', error); - }; + if (request.counter >= request.follow) { + reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); + return; + } - if (signal && signal.aborted) { - abort(); - return; - } + if (!res.headers.location) { + reject(new FetchError(`redirect location header missing at: ${request.url}`, 'invalid-redirect')); + return; + } // per fetch spec, for POST request with 301/302 response, or any request with 303 response, use GET when following redirect - const abortAndFinalize = function abortAndFinalize() { - abort(); - finalize(); - }; - // send request - const req = send(options); - let reqTimeout; + if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { + request.method = 'GET'; + request.body = null; + request.headers.delete('content-length'); + } - if (signal) { - signal.addEventListener('abort', abortAndFinalize); - } + request.counter++; + resolve(fetch(url.resolve(request.url, res.headers.location), request)); + return; + } // normalize location header for manual redirect mode - function finalize() { - req.abort(); - if (signal) signal.removeEventListener('abort', abortAndFinalize); - clearTimeout(reqTimeout); - } - if (request.timeout) { - req.once('socket', function (socket) { - reqTimeout = setTimeout(function () { - reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); - finalize(); - }, request.timeout); - }); - } + const headers = new Headers(); - req.on('error', function (err) { - reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); - finalize(); - }); + for (var _i = 0, _Object$keys = Object.keys(res.headers); _i < _Object$keys.length; _i++) { + const name = _Object$keys[_i]; - req.on('response', function (res) { - clearTimeout(reqTimeout); + if (Array.isArray(res.headers[name])) { + for (var _iterator2 = _createForOfIteratorHelperLoose(res.headers[name]), _step2; !(_step2 = _iterator2()).done;) { + const val = _step2.value; + headers.append(name, val); + } + } else { + headers.append(name, res.headers[name]); + } + } - const headers = createHeadersLenient(res.headers); + if (request.redirect === 'manual' && headers.has('location')) { + headers.set('location', url.resolve(request.url, headers.get('location'))); + } // prepare response - // HTTP fetch step 5 - if (fetch.isRedirect(res.statusCode)) { - // HTTP fetch step 5.2 - const location = headers.get('Location'); - // HTTP fetch step 5.3 - let locationURL = null; - try { - locationURL = location === null ? null : new URL$1(location, request.url).toString(); - } catch (err) { - // error here can only be invalid URL in Location: header - // do not throw when options.redirect == manual - // let the user extract the errorneous redirect URL - if (request.redirect !== 'manual') { - reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect')); - finalize(); - return; - } - } + let body = new Stream.PassThrough(); + res.on('error', err => body.emit('error', err)); + res.pipe(body); + body.on('error', cancelRequest); + body.on('cancel-request', cancelRequest); - // HTTP fetch step 5.5 - switch (request.redirect) { - case 'error': - reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect')); - finalize(); - return; - case 'manual': - // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. - if (locationURL !== null) { - // handle corrupted header - try { - headers.set('Location', locationURL); - } catch (err) { - // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request - reject(err); - } - } - break; - case 'follow': - // HTTP-redirect fetch step 2 - if (locationURL === null) { - break; - } - - // HTTP-redirect fetch step 5 - if (request.counter >= request.follow) { - reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 6 (counter increment) - // Create a new Request object. - const requestOpts = { - headers: new Headers(request.headers), - follow: request.follow, - counter: request.counter + 1, - agent: request.agent, - compress: request.compress, - method: request.method, - body: request.body, - signal: request.signal, - timeout: request.timeout, - size: request.size - }; - - if (!isDomainOrSubdomain(request.url, locationURL)) { - for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) { - requestOpts.headers.delete(name); - } - } - - // HTTP-redirect fetch step 9 - if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { - reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 11 - if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { - requestOpts.method = 'GET'; - requestOpts.body = undefined; - requestOpts.headers.delete('content-length'); - } - - // HTTP-redirect fetch step 15 - resolve(fetch(new Request(locationURL, requestOpts))); - finalize(); - return; - } - } + const abortBody = () => { + res.destroy(); + res.emit('error', new FetchError('request aborted', 'abort')); // separated from the `.destroy()` because somehow Node's IncomingMessage streams do not emit errors on destroy + }; - // prepare response - res.once('end', function () { - if (signal) signal.removeEventListener('abort', abortAndFinalize); - }); - let body = res.pipe(new PassThrough$1()); - - const response_options = { - url: request.url, - status: res.statusCode, - statusText: res.statusMessage, - headers: headers, - size: request.size, - timeout: request.timeout, - counter: request.counter - }; - - // HTTP-network fetch step 12.1.1.3 - const codings = headers.get('Content-Encoding'); - - // HTTP-network fetch step 12.1.1.4: handle content codings - - // in following scenarios we ignore compression support - // 1. compression support is disabled - // 2. HEAD request - // 3. no Content-Encoding header - // 4. no content response (204) - // 5. content not modified response (304) - if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { - response = new Response(body, response_options); - resolve(response); - return; - } + if (request.signal) { + request.signal.addEventListener('abort', abortBody); + res.on('end', () => { + request.signal.removeEventListener('abort', abortBody); + }); + res.on('error', () => { + request.signal.removeEventListener('abort', abortBody); + }); + } - // For Node v6+ - // Be less strict when decoding compressed responses, since sometimes - // servers send slightly invalid responses that are still accepted - // by common browsers. - // Always using Z_SYNC_FLUSH is what cURL does. - const zlibOptions = { - flush: zlib.Z_SYNC_FLUSH, - finishFlush: zlib.Z_SYNC_FLUSH - }; - - // for gzip - if (codings == 'gzip' || codings == 'x-gzip') { - body = body.pipe(zlib.createGunzip(zlibOptions)); - response = new Response(body, response_options); - resolve(response); - return; - } + const responseOptions = { + url: request.url, + status: res.statusCode, + statusText: res.statusMessage, + headers, + size: request.size, + timeout: request.timeout, + useElectronNet: request.useElectronNet, + useSessionCookies: request.useSessionCookies + }; // HTTP-network fetch step 16.1.2 - // for deflate - if (codings == 'deflate' || codings == 'x-deflate') { - // handle the infamous raw deflate response from old servers - // a hack for old IIS and Apache servers - const raw = res.pipe(new PassThrough$1()); - raw.once('data', function (chunk) { - // see http://stackoverflow.com/questions/37519828 - if ((chunk[0] & 0x0F) === 0x08) { - body = body.pipe(zlib.createInflate()); - } else { - body = body.pipe(zlib.createInflateRaw()); - } - response = new Response(body, response_options); - resolve(response); - }); - return; - } + const codings = headers.get('Content-Encoding'); // HTTP-network fetch step 16.1.3: handle content codings + // in following scenarios we ignore compression support + // 1. running on Electron/net module (it manages it for us) + // 2. HEAD request + // 3. no Content-Encoding header + // 4. no content response (204) + // 5. content not modified response (304) - // for br - if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { - body = body.pipe(zlib.createBrotliDecompress()); - response = new Response(body, response_options); - resolve(response); - return; - } + if (!request.useElectronNet && request.method !== 'HEAD' && codings !== null && res.statusCode !== 204 && res.statusCode !== 304) { + // Be less strict when decoding compressed responses, since sometimes + // servers send slightly invalid responses that are still accepted + // by common browsers. + // Always using Z_SYNC_FLUSH is what cURL does. + // /!\ This is disabled for now, because it seems broken in recent node + // const zlibOptions = { + // flush: zlib.Z_SYNC_FLUSH, + // finishFlush: zlib.Z_SYNC_FLUSH + // } + if (codings === 'gzip' || codings === 'x-gzip') { + // for gzip + body = body.pipe(zlib__namespace.createGunzip()); + } else if (codings === 'deflate' || codings === 'x-deflate') { + // for deflate + // handle the infamous raw deflate response from old servers + // a hack for old IIS and Apache servers + const raw = res.pipe(new Stream.PassThrough()); + return raw.once('data', chunk => { + // see http://stackoverflow.com/questions/37519828 + if ((chunk[0] & 0x0F) === 0x08) { + body = body.pipe(zlib__namespace.createInflate()); + } else { + body = body.pipe(zlib__namespace.createInflateRaw()); + } - // otherwise, use response as-is - response = new Response(body, response_options); - resolve(response); - }); + const response = new Response(body, responseOptions); + resolve(response); + }); + } + } - writeToStream(req, request); - }); + const response = new Response(body, responseOptions); + resolve(response); + } catch (error) { + reject(new FetchError(`Invalid response: ${error.message}`, 'invalid-response')); + cancelRequest(); + } + }); + writeToStream(req, request); + })); } /** * Redirect code matching * - * @param Number code Status code - * @return Boolean + * @param {number} code Status code + * @return {boolean} */ -fetch.isRedirect = function (code) { - return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; -}; -// expose Promise -fetch.Promise = global.Promise; +fetch.isRedirect = code => code === 301 || code === 302 || code === 303 || code === 307 || code === 308; -module.exports = exports = fetch; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports["default"] = exports; +exports.FetchError = FetchError; exports.Headers = Headers; exports.Request = Request; exports.Response = Response; -exports.FetchError = FetchError; +exports["default"] = fetch; /***/ }), -/***/ 48026: +/***/ 54960: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; - -var punycode = __nccwpck_require__(85477); -var mappingTable = __nccwpck_require__(1907); -var PROCESSING_OPTIONS = { - TRANSITIONAL: 0, - NONTRANSITIONAL: 1 -}; +var iconvLite = __nccwpck_require__(83465); -function normalize(str) { // fix bug in v8 - return str.split('\u0000').map(function (s) { return s.normalize('NFC'); }).join('\u0000'); -} +// Expose to the world +module.exports.convert = convert; -function findStatus(val) { - var start = 0; - var end = mappingTable.length - 1; +/** + * Convert encoding of an UTF-8 string or a buffer + * + * @param {String|Buffer} str String to be converted + * @param {String} to Encoding to be converted to + * @param {String} [from='UTF-8'] Encoding to be converted from + * @return {Buffer} Encoded string + */ +function convert(str, to, from) { + from = checkEncoding(from || 'UTF-8'); + to = checkEncoding(to || 'UTF-8'); + str = str || ''; - while (start <= end) { - var mid = Math.floor((start + end) / 2); + var result; - var target = mappingTable[mid]; - if (target[0][0] <= val && target[0][1] >= val) { - return target; - } else if (target[0][0] > val) { - end = mid - 1; - } else { - start = mid + 1; + if (from !== 'UTF-8' && typeof str === 'string') { + str = Buffer.from(str, 'binary'); } - } - - return null; -} -var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; - -function countSymbols(string) { - return string - // replace every surrogate pair with a BMP symbol - .replace(regexAstralSymbols, '_') - // then get the length - .length; -} - -function mapChars(domain_name, useSTD3, processing_option) { - var hasError = false; - var processed = ""; - - var len = countSymbols(domain_name); - for (var i = 0; i < len; ++i) { - var codePoint = domain_name.codePointAt(i); - var status = findStatus(codePoint); - - switch (status[1]) { - case "disallowed": - hasError = true; - processed += String.fromCodePoint(codePoint); - break; - case "ignored": - break; - case "mapped": - processed += String.fromCodePoint.apply(String, status[2]); - break; - case "deviation": - if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) { - processed += String.fromCodePoint.apply(String, status[2]); - } else { - processed += String.fromCodePoint(codePoint); - } - break; - case "valid": - processed += String.fromCodePoint(codePoint); - break; - case "disallowed_STD3_mapped": - if (useSTD3) { - hasError = true; - processed += String.fromCodePoint(codePoint); + if (from === to) { + if (typeof str === 'string') { + result = Buffer.from(str); } else { - processed += String.fromCodePoint.apply(String, status[2]); + result = str; } - break; - case "disallowed_STD3_valid": - if (useSTD3) { - hasError = true; + } else { + try { + result = convertIconvLite(str, to, from); + } catch (E) { + console.error(E); + result = str; } - - processed += String.fromCodePoint(codePoint); - break; } - } - - return { - string: processed, - error: hasError - }; -} - -var combiningMarksRegex = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/; - -function validateLabel(label, processing_option) { - if (label.substr(0, 4) === "xn--") { - label = punycode.toUnicode(label); - processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL; - } - - var error = false; - - if (normalize(label) !== label || - (label[3] === "-" && label[4] === "-") || - label[0] === "-" || label[label.length - 1] === "-" || - label.indexOf(".") !== -1 || - label.search(combiningMarksRegex) === 0) { - error = true; - } - var len = countSymbols(label); - for (var i = 0; i < len; ++i) { - var status = findStatus(label.codePointAt(i)); - if ((processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== "valid") || - (processing === PROCESSING_OPTIONS.NONTRANSITIONAL && - status[1] !== "valid" && status[1] !== "deviation")) { - error = true; - break; + if (typeof result === 'string') { + result = Buffer.from(result, 'utf-8'); } - } - return { - label: label, - error: error - }; + return result; } -function processing(domain_name, useSTD3, processing_option) { - var result = mapChars(domain_name, useSTD3, processing_option); - result.string = normalize(result.string); - - var labels = result.string.split("."); - for (var i = 0; i < labels.length; ++i) { - try { - var validation = validateLabel(labels[i]); - labels[i] = validation.label; - result.error = result.error || validation.error; - } catch(e) { - result.error = true; +/** + * Convert encoding of astring with iconv-lite + * + * @param {String|Buffer} str String to be converted + * @param {String} to Encoding to be converted to + * @param {String} [from='UTF-8'] Encoding to be converted from + * @return {Buffer} Encoded string + */ +function convertIconvLite(str, to, from) { + if (to === 'UTF-8') { + return iconvLite.decode(str, from); + } else if (from === 'UTF-8') { + return iconvLite.encode(str, to); + } else { + return iconvLite.encode(iconvLite.decode(str, from), to); } - } - - return { - string: labels.join("."), - error: result.error - }; } -module.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) { - var result = processing(domain_name, useSTD3, processing_option); - var labels = result.string.split("."); - labels = labels.map(function(l) { - try { - return punycode.toASCII(l); - } catch(e) { - result.error = true; - return l; - } - }); - - if (verifyDnsLength) { - var total = labels.slice(0, labels.length - 1).join(".").length; - if (total.length > 253 || total.length === 0) { - result.error = true; - } - - for (var i=0; i < labels.length; ++i) { - if (labels.length > 63 || labels.length === 0) { - result.error = true; - break; - } - } - } - - if (result.error) return null; - return labels.join("."); -}; +/** + * Converts charset name if needed + * + * @param {String} name Character set + * @return {String} Character set name + */ +function checkEncoding(name) { + return (name || '') + .toString() + .trim() + .replace(/^latin[\-_]?(\d+)$/i, 'ISO-8859-$1') + .replace(/^win(?:dows)?[\-_]?(\d+)$/i, 'WINDOWS-$1') + .replace(/^utf[\-_]?(\d+)$/i, 'UTF-$1') + .replace(/^ks_c_5601\-1987$/i, 'CP949') + .replace(/^us[\-_]?ascii$/i, 'ASCII') + .toUpperCase(); +} -module.exports.toUnicode = function(domain_name, useSTD3) { - var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL); - return { - domain: result.string, - error: result.error - }; -}; +/***/ }), -module.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS; +/***/ 34855: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/***/ }), +var Buffer = (__nccwpck_require__(17120).Buffer); -/***/ 40487: -/***/ ((module) => { +// Multibyte codec. In this scheme, a character is represented by 1 or more bytes. +// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. +// To save memory and loading time, we read table files only when requested. -"use strict"; +exports._dbcs = DBCSCodec; +var UNASSIGNED = -1, + GB18030_CODE = -2, + SEQ_START = -10, + NODE_START = -1000, + UNASSIGNED_NODE = new Array(0x100), + DEF_CHAR = -1; -var conversions = {}; -module.exports = conversions; +for (var i = 0; i < 0x100; i++) + UNASSIGNED_NODE[i] = UNASSIGNED; -function sign(x) { - return x < 0 ? -1 : 1; -} -function evenRound(x) { - // Round x to the nearest integer, choosing the even integer if it lies halfway between two. - if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor) - return Math.floor(x); - } else { - return Math.round(x); - } -} +// Class DBCSCodec reads and initializes mapping tables. +function DBCSCodec(codecOptions, iconv) { + this.encodingName = codecOptions.encodingName; + if (!codecOptions) + throw new Error("DBCS codec is called without the data.") + if (!codecOptions.table) + throw new Error("Encoding '" + this.encodingName + "' has no data."); -function createNumberConversion(bitLength, typeOpts) { - if (!typeOpts.unsigned) { - --bitLength; - } - const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength); - const upperBound = Math.pow(2, bitLength) - 1; + // Load tables. + var mappingTable = codecOptions.table(); - const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength); - const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1); - return function(V, opts) { - if (!opts) opts = {}; + // Decode tables: MBCS -> Unicode. - let x = +V; + // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. + // Trie root is decodeTables[0]. + // Values: >= 0 -> unicode character code. can be > 0xFFFF + // == UNASSIGNED -> unknown/unassigned sequence. + // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. + // <= NODE_START -> index of the next node in our trie to process next byte. + // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. + this.decodeTables = []; + this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node. - if (opts.enforceRange) { - if (!Number.isFinite(x)) { - throw new TypeError("Argument is not a finite number"); - } + // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. + this.decodeTableSeq = []; - x = sign(x) * Math.floor(Math.abs(x)); - if (x < lowerBound || x > upperBound) { - throw new TypeError("Argument is not in byte range"); - } + // Actual mapping tables consist of chunks. Use them to fill up decode tables. + for (var i = 0; i < mappingTable.length; i++) + this._addDecodeChunk(mappingTable[i]); - return x; - } + // Load & create GB18030 tables when needed. + if (typeof codecOptions.gb18030 === 'function') { + this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. - if (!isNaN(x) && opts.clamp) { - x = evenRound(x); + // Add GB18030 common decode nodes. + var commonThirdByteNodeIdx = this.decodeTables.length; + this.decodeTables.push(UNASSIGNED_NODE.slice(0)); - if (x < lowerBound) x = lowerBound; - if (x > upperBound) x = upperBound; - return x; - } + var commonFourthByteNodeIdx = this.decodeTables.length; + this.decodeTables.push(UNASSIGNED_NODE.slice(0)); - if (!Number.isFinite(x) || x === 0) { - return 0; - } + // Fill out the tree + var firstByteNode = this.decodeTables[0]; + for (var i = 0x81; i <= 0xFE; i++) { + var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]]; + for (var j = 0x30; j <= 0x39; j++) { + if (secondByteNode[j] === UNASSIGNED) { + secondByteNode[j] = NODE_START - commonThirdByteNodeIdx; + } else if (secondByteNode[j] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 2"); + } - x = sign(x) * Math.floor(Math.abs(x)); - x = x % moduloVal; + var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]]; + for (var k = 0x81; k <= 0xFE; k++) { + if (thirdByteNode[k] === UNASSIGNED) { + thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx; + } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { + continue; + } else if (thirdByteNode[k] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 3"); + } - if (!typeOpts.unsigned && x >= moduloBound) { - return x - moduloVal; - } else if (typeOpts.unsigned) { - if (x < 0) { - x += moduloVal; - } else if (x === -0) { // don't return negative zero - return 0; + var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]]; + for (var l = 0x30; l <= 0x39; l++) { + if (fourthByteNode[l] === UNASSIGNED) + fourthByteNode[l] = GB18030_CODE; + } + } } } - - return x; } -} - -conversions["void"] = function () { - return undefined; -}; - -conversions["boolean"] = function (val) { - return !!val; -}; -conversions["byte"] = createNumberConversion(8, { unsigned: false }); -conversions["octet"] = createNumberConversion(8, { unsigned: true }); - -conversions["short"] = createNumberConversion(16, { unsigned: false }); -conversions["unsigned short"] = createNumberConversion(16, { unsigned: true }); + this.defaultCharUnicode = iconv.defaultCharUnicode; -conversions["long"] = createNumberConversion(32, { unsigned: false }); -conversions["unsigned long"] = createNumberConversion(32, { unsigned: true }); + + // Encode tables: Unicode -> DBCS. -conversions["long long"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 }); -conversions["unsigned long long"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 }); + // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. + // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. + // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). + // == UNASSIGNED -> no conversion found. Output a default char. + // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. + this.encodeTable = []; + + // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of + // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key + // means end of sequence (needed when one sequence is a strict subsequence of another). + // Objects are kept separately from encodeTable to increase performance. + this.encodeTableSeq = []; -conversions["double"] = function (V) { - const x = +V; + // Some chars can be decoded, but need not be encoded. + var skipEncodeChars = {}; + if (codecOptions.encodeSkipVals) + for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { + var val = codecOptions.encodeSkipVals[i]; + if (typeof val === 'number') + skipEncodeChars[val] = true; + else + for (var j = val.from; j <= val.to; j++) + skipEncodeChars[j] = true; + } + + // Use decode trie to recursively fill out encode tables. + this._fillEncodeTable(0, 0, skipEncodeChars); - if (!Number.isFinite(x)) { - throw new TypeError("Argument is not a finite floating-point value"); + // Add more encoding pairs when needed. + if (codecOptions.encodeAdd) { + for (var uChar in codecOptions.encodeAdd) + if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) + this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); } - return x; -}; - -conversions["unrestricted double"] = function (V) { - const x = +V; - - if (isNaN(x)) { - throw new TypeError("Argument is NaN"); - } + this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; + if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; + if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); +} - return x; -}; +DBCSCodec.prototype.encoder = DBCSEncoder; +DBCSCodec.prototype.decoder = DBCSDecoder; -// not quite valid, but good enough for JS -conversions["float"] = conversions["double"]; -conversions["unrestricted float"] = conversions["unrestricted double"]; +// Decoder helpers +DBCSCodec.prototype._getDecodeTrieNode = function(addr) { + var bytes = []; + for (; addr > 0; addr >>>= 8) + bytes.push(addr & 0xFF); + if (bytes.length == 0) + bytes.push(0); -conversions["DOMString"] = function (V, opts) { - if (!opts) opts = {}; + var node = this.decodeTables[0]; + for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie. + var val = node[bytes[i]]; - if (opts.treatNullAsEmptyString && V === null) { - return ""; + if (val == UNASSIGNED) { // Create new node. + node[bytes[i]] = NODE_START - this.decodeTables.length; + this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); + } + else if (val <= NODE_START) { // Existing node. + node = this.decodeTables[NODE_START - val]; + } + else + throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); } + return node; +} - return String(V); -}; -conversions["ByteString"] = function (V, opts) { - const x = String(V); - let c = undefined; - for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) { - if (c > 255) { - throw new TypeError("Argument is not a valid bytestring"); - } - } +DBCSCodec.prototype._addDecodeChunk = function(chunk) { + // First element of chunk is the hex mbcs code where we start. + var curAddr = parseInt(chunk[0], 16); - return x; -}; + // Choose the decoding node where we'll write our chars. + var writeTable = this._getDecodeTrieNode(curAddr); + curAddr = curAddr & 0xFF; -conversions["USVString"] = function (V) { - const S = String(V); - const n = S.length; - const U = []; - for (let i = 0; i < n; ++i) { - const c = S.charCodeAt(i); - if (c < 0xD800 || c > 0xDFFF) { - U.push(String.fromCodePoint(c)); - } else if (0xDC00 <= c && c <= 0xDFFF) { - U.push(String.fromCodePoint(0xFFFD)); - } else { - if (i === n - 1) { - U.push(String.fromCodePoint(0xFFFD)); - } else { - const d = S.charCodeAt(i + 1); - if (0xDC00 <= d && d <= 0xDFFF) { - const a = c & 0x3FF; - const b = d & 0x3FF; - U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b)); - ++i; - } else { - U.push(String.fromCodePoint(0xFFFD)); + // Write all other elements of the chunk to the table. + for (var k = 1; k < chunk.length; k++) { + var part = chunk[k]; + if (typeof part === "string") { // String, write as-is. + for (var l = 0; l < part.length;) { + var code = part.charCodeAt(l++); + if (0xD800 <= code && code < 0xDC00) { // Decode surrogate + var codeTrail = part.charCodeAt(l++); + if (0xDC00 <= codeTrail && codeTrail < 0xE000) + writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00); + else + throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); + } + else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used) + var len = 0xFFF - code + 2; + var seq = []; + for (var m = 0; m < len; m++) + seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq. + + writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length; + this.decodeTableSeq.push(seq); } + else + writeTable[curAddr++] = code; // Basic char } + } + else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. + var charCode = writeTable[curAddr - 1] + 1; + for (var l = 0; l < part; l++) + writeTable[curAddr++] = charCode++; } + else + throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]); } + if (curAddr > 0xFF) + throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); +} - return U.join(''); -}; +// Encoder helpers +DBCSCodec.prototype._getEncodeBucket = function(uCode) { + var high = uCode >> 8; // This could be > 0xFF because of astral characters. + if (this.encodeTable[high] === undefined) + this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand. + return this.encodeTable[high]; +} -conversions["Date"] = function (V, opts) { - if (!(V instanceof Date)) { - throw new TypeError("Argument is not a Date object"); - } - if (isNaN(V)) { - return undefined; - } +DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { + var bucket = this._getEncodeBucket(uCode); + var low = uCode & 0xFF; + if (bucket[low] <= SEQ_START) + this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it. + else if (bucket[low] == UNASSIGNED) + bucket[low] = dbcsCode; +} - return V; -}; +DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { + + // Get the root of character tree according to first character of the sequence. + var uCode = seq[0]; + var bucket = this._getEncodeBucket(uCode); + var low = uCode & 0xFF; -conversions["RegExp"] = function (V, opts) { - if (!(V instanceof RegExp)) { - V = new RegExp(V); + var node; + if (bucket[low] <= SEQ_START) { + // There's already a sequence with - use it. + node = this.encodeTableSeq[SEQ_START-bucket[low]]; + } + else { + // There was no sequence object - allocate a new one. + node = {}; + if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence. + bucket[low] = SEQ_START - this.encodeTableSeq.length; + this.encodeTableSeq.push(node); } - return V; -}; - - -/***/ }), - -/***/ 79722: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; + // Traverse the character tree, allocating new nodes as needed. + for (var j = 1; j < seq.length-1; j++) { + var oldVal = node[uCode]; + if (typeof oldVal === 'object') + node = oldVal; + else { + node = node[uCode] = {} + if (oldVal !== undefined) + node[DEF_CHAR] = oldVal + } + } -const usm = __nccwpck_require__(40402); + // Set the leaf to given dbcsCode. + uCode = seq[seq.length-1]; + node[uCode] = dbcsCode; +} -exports.implementation = class URLImpl { - constructor(constructorArgs) { - const url = constructorArgs[0]; - const base = constructorArgs[1]; +DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { + var node = this.decodeTables[nodeIdx]; + var hasValues = false; + var subNodeEmpty = {}; + for (var i = 0; i < 0x100; i++) { + var uCode = node[i]; + var mbCode = prefix + i; + if (skipEncodeChars[mbCode]) + continue; - let parsedBase = null; - if (base !== undefined) { - parsedBase = usm.basicURLParse(base); - if (parsedBase === "failure") { - throw new TypeError("Invalid base URL"); - } + if (uCode >= 0) { + this._setEncodeChar(uCode, mbCode); + hasValues = true; + } else if (uCode <= NODE_START) { + var subNodeIdx = NODE_START - uCode; + if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). + var newPrefix = (mbCode << 8) >>> 0; // NOTE: '>>> 0' keeps 32-bit num positive. + if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) + hasValues = true; + else + subNodeEmpty[subNodeIdx] = true; + } + } else if (uCode <= SEQ_START) { + this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); + hasValues = true; + } } + return hasValues; +} - const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); - if (parsedURL === "failure") { - throw new TypeError("Invalid URL"); - } - this._url = parsedURL; - // TODO: query stuff - } +// == Encoder ================================================================== - get href() { - return usm.serializeURL(this._url); - } +function DBCSEncoder(options, codec) { + // Encoder state + this.leadSurrogate = -1; + this.seqObj = undefined; + + // Static data + this.encodeTable = codec.encodeTable; + this.encodeTableSeq = codec.encodeTableSeq; + this.defaultCharSingleByte = codec.defCharSB; + this.gb18030 = codec.gb18030; +} - set href(v) { - const parsedURL = usm.basicURLParse(v); - if (parsedURL === "failure") { - throw new TypeError("Invalid URL"); - } +DBCSEncoder.prototype.write = function(str) { + var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)), + leadSurrogate = this.leadSurrogate, + seqObj = this.seqObj, nextChar = -1, + i = 0, j = 0; - this._url = parsedURL; - } + while (true) { + // 0. Get next character. + if (nextChar === -1) { + if (i == str.length) break; + var uCode = str.charCodeAt(i++); + } + else { + var uCode = nextChar; + nextChar = -1; + } - get origin() { - return usm.serializeURLOrigin(this._url); - } + // 1. Handle surrogates. + if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates. + if (uCode < 0xDC00) { // We've got lead surrogate. + if (leadSurrogate === -1) { + leadSurrogate = uCode; + continue; + } else { + leadSurrogate = uCode; + // Double lead surrogate found. + uCode = UNASSIGNED; + } + } else { // We've got trail surrogate. + if (leadSurrogate !== -1) { + uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00); + leadSurrogate = -1; + } else { + // Incomplete surrogate pair - only trail surrogate found. + uCode = UNASSIGNED; + } + + } + } + else if (leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char. + leadSurrogate = -1; + } - get protocol() { - return this._url.scheme + ":"; - } + // 2. Convert uCode character. + var dbcsCode = UNASSIGNED; + if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence + var resCode = seqObj[uCode]; + if (typeof resCode === 'object') { // Sequence continues. + seqObj = resCode; + continue; - set protocol(v) { - usm.basicURLParse(v + ":", { url: this._url, stateOverride: "scheme start" }); - } + } else if (typeof resCode == 'number') { // Sequence finished. Write it. + dbcsCode = resCode; - get username() { - return this._url.username; - } + } else if (resCode == undefined) { // Current character is not part of the sequence. - set username(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } + // Try default character for this sequence + resCode = seqObj[DEF_CHAR]; + if (resCode !== undefined) { + dbcsCode = resCode; // Found. Write it. + nextChar = uCode; // Current character will be written too in the next iteration. - usm.setTheUsername(this._url, v); - } + } else { + // TODO: What if we have no default? (resCode == undefined) + // Then, we should write first char of the sequence as-is and try the rest recursively. + // Didn't do it for now because no encoding has this situation yet. + // Currently, just skip the sequence and write current char. + } + } + seqObj = undefined; + } + else if (uCode >= 0) { // Regular character + var subtable = this.encodeTable[uCode >> 8]; + if (subtable !== undefined) + dbcsCode = subtable[uCode & 0xFF]; + + if (dbcsCode <= SEQ_START) { // Sequence start + seqObj = this.encodeTableSeq[SEQ_START-dbcsCode]; + continue; + } - get password() { - return this._url.password; - } + if (dbcsCode == UNASSIGNED && this.gb18030) { + // Use GB18030 algorithm to find character(s) to write. + var idx = findIdx(this.gb18030.uChars, uCode); + if (idx != -1) { + var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]); + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600; + newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260; + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10; + newBuf[j++] = 0x30 + dbcsCode; + continue; + } + } + } - set password(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; + // 3. Write dbcsCode character. + if (dbcsCode === UNASSIGNED) + dbcsCode = this.defaultCharSingleByte; + + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode; + } + else if (dbcsCode < 0x10000) { + newBuf[j++] = dbcsCode >> 8; // high byte + newBuf[j++] = dbcsCode & 0xFF; // low byte + } + else if (dbcsCode < 0x1000000) { + newBuf[j++] = dbcsCode >> 16; + newBuf[j++] = (dbcsCode >> 8) & 0xFF; + newBuf[j++] = dbcsCode & 0xFF; + } else { + newBuf[j++] = dbcsCode >>> 24; + newBuf[j++] = (dbcsCode >>> 16) & 0xFF; + newBuf[j++] = (dbcsCode >>> 8) & 0xFF; + newBuf[j++] = dbcsCode & 0xFF; + } } - usm.setThePassword(this._url, v); - } + this.seqObj = seqObj; + this.leadSurrogate = leadSurrogate; + return newBuf.slice(0, j); +} - get host() { - const url = this._url; +DBCSEncoder.prototype.end = function() { + if (this.leadSurrogate === -1 && this.seqObj === undefined) + return; // All clean. Most often case. - if (url.host === null) { - return ""; - } + var newBuf = Buffer.alloc(10), j = 0; - if (url.port === null) { - return usm.serializeHost(url.host); + if (this.seqObj) { // We're in the sequence. + var dbcsCode = this.seqObj[DEF_CHAR]; + if (dbcsCode !== undefined) { // Write beginning of the sequence. + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode; + } + else { + newBuf[j++] = dbcsCode >> 8; // high byte + newBuf[j++] = dbcsCode & 0xFF; // low byte + } + } else { + // See todo above. + } + this.seqObj = undefined; } - return usm.serializeHost(url.host) + ":" + usm.serializeInteger(url.port); - } - - set host(v) { - if (this._url.cannotBeABaseURL) { - return; + if (this.leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + newBuf[j++] = this.defaultCharSingleByte; + this.leadSurrogate = -1; } + + return newBuf.slice(0, j); +} - usm.basicURLParse(v, { url: this._url, stateOverride: "host" }); - } - - get hostname() { - if (this._url.host === null) { - return ""; - } +// Export for testing +DBCSEncoder.prototype.findIdx = findIdx; - return usm.serializeHost(this._url.host); - } - set hostname(v) { - if (this._url.cannotBeABaseURL) { - return; - } +// == Decoder ================================================================== - usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" }); - } +function DBCSDecoder(options, codec) { + // Decoder state + this.nodeIdx = 0; + this.prevBytes = []; - get port() { - if (this._url.port === null) { - return ""; - } + // Static data + this.decodeTables = codec.decodeTables; + this.decodeTableSeq = codec.decodeTableSeq; + this.defaultCharUnicode = codec.defaultCharUnicode; + this.gb18030 = codec.gb18030; +} - return usm.serializeInteger(this._url.port); - } +DBCSDecoder.prototype.write = function(buf) { + var newBuf = Buffer.alloc(buf.length*2), + nodeIdx = this.nodeIdx, + prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, + seqStart = -this.prevBytes.length, // idx of the start of current parsed sequence. + uCode; - set port(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } + for (var i = 0, j = 0; i < buf.length; i++) { + var curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset]; - if (v === "") { - this._url.port = null; - } else { - usm.basicURLParse(v, { url: this._url, stateOverride: "port" }); - } - } + // Lookup in current trie node. + var uCode = this.decodeTables[nodeIdx][curByte]; - get pathname() { - if (this._url.cannotBeABaseURL) { - return this._url.path[0]; - } + if (uCode >= 0) { + // Normal character, just use it. + } + else if (uCode === UNASSIGNED) { // Unknown char. + // TODO: Callback with seq. + uCode = this.defaultCharUnicode.charCodeAt(0); + i = seqStart; // Skip one byte ('i' will be incremented by the for loop) and try to parse again. + } + else if (uCode === GB18030_CODE) { + if (i >= 3) { + var ptr = (buf[i-3]-0x81)*12600 + (buf[i-2]-0x30)*1260 + (buf[i-1]-0x81)*10 + (curByte-0x30); + } else { + var ptr = (prevBytes[i-3+prevOffset]-0x81)*12600 + + (((i-2 >= 0) ? buf[i-2] : prevBytes[i-2+prevOffset])-0x30)*1260 + + (((i-1 >= 0) ? buf[i-1] : prevBytes[i-1+prevOffset])-0x81)*10 + + (curByte-0x30); + } + var idx = findIdx(this.gb18030.gbChars, ptr); + uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; + } + else if (uCode <= NODE_START) { // Go to next trie node. + nodeIdx = NODE_START - uCode; + continue; + } + else if (uCode <= SEQ_START) { // Output a sequence of chars. + var seq = this.decodeTableSeq[SEQ_START - uCode]; + for (var k = 0; k < seq.length - 1; k++) { + uCode = seq[k]; + newBuf[j++] = uCode & 0xFF; + newBuf[j++] = uCode >> 8; + } + uCode = seq[seq.length-1]; + } + else + throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); - if (this._url.path.length === 0) { - return ""; - } + // Write the character to buffer, handling higher planes using surrogate pair. + if (uCode >= 0x10000) { + uCode -= 0x10000; + var uCodeLead = 0xD800 | (uCode >> 10); + newBuf[j++] = uCodeLead & 0xFF; + newBuf[j++] = uCodeLead >> 8; - return "/" + this._url.path.join("/"); - } + uCode = 0xDC00 | (uCode & 0x3FF); + } + newBuf[j++] = uCode & 0xFF; + newBuf[j++] = uCode >> 8; - set pathname(v) { - if (this._url.cannotBeABaseURL) { - return; + // Reset trie node. + nodeIdx = 0; seqStart = i+1; } - this._url.path = []; - usm.basicURLParse(v, { url: this._url, stateOverride: "path start" }); - } - - get search() { - if (this._url.query === null || this._url.query === "") { - return ""; - } + this.nodeIdx = nodeIdx; + this.prevBytes = (seqStart >= 0) + ? Array.prototype.slice.call(buf, seqStart) + : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)); - return "?" + this._url.query; - } + return newBuf.slice(0, j).toString('ucs2'); +} - set search(v) { - // TODO: query stuff +DBCSDecoder.prototype.end = function() { + var ret = ''; - const url = this._url; + // Try to parse all remaining chars. + while (this.prevBytes.length > 0) { + // Skip 1 character in the buffer. + ret += this.defaultCharUnicode; + var bytesArr = this.prevBytes.slice(1); - if (v === "") { - url.query = null; - return; + // Parse remaining as usual. + this.prevBytes = []; + this.nodeIdx = 0; + if (bytesArr.length > 0) + ret += this.write(bytesArr); } - const input = v[0] === "?" ? v.substring(1) : v; - url.query = ""; - usm.basicURLParse(input, { url, stateOverride: "query" }); - } - - get hash() { - if (this._url.fragment === null || this._url.fragment === "") { - return ""; - } + this.prevBytes = []; + this.nodeIdx = 0; + return ret; +} - return "#" + this._url.fragment; - } +// Binary search for GB18030. Returns largest i such that table[i] <= val. +function findIdx(table, val) { + if (table[0] > val) + return -1; - set hash(v) { - if (v === "") { - this._url.fragment = null; - return; + var l = 0, r = table.length; + while (l < r-1) { // always table[l] <= val < table[r] + var mid = l + ((r-l+1) >> 1); + if (table[mid] <= val) + l = mid; + else + r = mid; } + return l; +} - const input = v[0] === "#" ? v.substring(1) : v; - this._url.fragment = ""; - usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" }); - } - - toJSON() { - return this.href; - } -}; /***/ }), -/***/ 45724: +/***/ 51098: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; -const conversions = __nccwpck_require__(40487); -const utils = __nccwpck_require__(59468); -const Impl = __nccwpck_require__(79722); +// Description of supported double byte encodings and aliases. +// Tables are not require()-d until they are needed to speed up library load. +// require()-s are direct to support Browserify. -const impl = utils.implSymbol; +module.exports = { + + // == Japanese/ShiftJIS ==================================================== + // All japanese encodings are based on JIS X set of standards: + // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. + // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. + // Has several variations in 1978, 1983, 1990 and 1997. + // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. + // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. + // 2 planes, first is superset of 0208, second - revised 0212. + // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) -function URL(url) { - if (!this || this[impl] || !(this instanceof URL)) { - throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function."); - } - if (arguments.length < 1) { - throw new TypeError("Failed to construct 'URL': 1 argument required, but only " + arguments.length + " present."); - } - const args = []; - for (let i = 0; i < arguments.length && i < 2; ++i) { - args[i] = arguments[i]; - } - args[0] = conversions["USVString"](args[0]); - if (args[1] !== undefined) { - args[1] = conversions["USVString"](args[1]); - } + // Byte encodings are: + // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte + // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. + // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. + // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. + // 0x00-0x7F - lower part of 0201 + // 0x8E, 0xA1-0xDF - upper part of 0201 + // (0xA1-0xFE)x2 - 0208 plane (94x94). + // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). + // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. + // Used as-is in ISO2022 family. + // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, + // 0201-1976 Roman, 0208-1978, 0208-1983. + // * ISO2022-JP-1: Adds esc seq for 0212-1990. + // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. + // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. + // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. + // + // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. + // + // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html - module.exports.setup(this, args); -} + 'shiftjis': { + type: '_dbcs', + table: function() { return __nccwpck_require__(94965) }, + encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, + encodeSkipVals: [{from: 0xED40, to: 0xF940}], + }, + 'csshiftjis': 'shiftjis', + 'mskanji': 'shiftjis', + 'sjis': 'shiftjis', + 'windows31j': 'shiftjis', + 'ms31j': 'shiftjis', + 'xsjis': 'shiftjis', + 'windows932': 'shiftjis', + 'ms932': 'shiftjis', + '932': 'shiftjis', + 'cp932': 'shiftjis', -URL.prototype.toJSON = function toJSON() { - if (!this || !module.exports.is(this)) { - throw new TypeError("Illegal invocation"); - } - const args = []; - for (let i = 0; i < arguments.length && i < 0; ++i) { - args[i] = arguments[i]; - } - return this[impl].toJSON.apply(this[impl], args); -}; -Object.defineProperty(URL.prototype, "href", { - get() { - return this[impl].href; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].href = V; - }, - enumerable: true, - configurable: true -}); + 'eucjp': { + type: '_dbcs', + table: function() { return __nccwpck_require__(9750) }, + encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, + }, -URL.prototype.toString = function () { - if (!this || !module.exports.is(this)) { - throw new TypeError("Illegal invocation"); - } - return this.href; -}; + // TODO: KDDI extension to Shift_JIS + // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. + // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. -Object.defineProperty(URL.prototype, "origin", { - get() { - return this[impl].origin; - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(URL.prototype, "protocol", { - get() { - return this[impl].protocol; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].protocol = V; - }, - enumerable: true, - configurable: true -}); + // == Chinese/GBK ========================================================== + // http://en.wikipedia.org/wiki/GBK + // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder -Object.defineProperty(URL.prototype, "username", { - get() { - return this[impl].username; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].username = V; - }, - enumerable: true, - configurable: true -}); + // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 + 'gb2312': 'cp936', + 'gb231280': 'cp936', + 'gb23121980': 'cp936', + 'csgb2312': 'cp936', + 'csiso58gb231280': 'cp936', + 'euccn': 'cp936', -Object.defineProperty(URL.prototype, "password", { - get() { - return this[impl].password; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].password = V; - }, - enumerable: true, - configurable: true -}); + // Microsoft's CP936 is a subset and approximation of GBK. + 'windows936': 'cp936', + 'ms936': 'cp936', + '936': 'cp936', + 'cp936': { + type: '_dbcs', + table: function() { return __nccwpck_require__(94904) }, + }, -Object.defineProperty(URL.prototype, "host", { - get() { - return this[impl].host; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].host = V; - }, - enumerable: true, - configurable: true -}); + // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. + 'gbk': { + type: '_dbcs', + table: function() { return (__nccwpck_require__(94904).concat)(__nccwpck_require__(49429)) }, + }, + 'xgbk': 'gbk', + 'isoir58': 'gbk', -Object.defineProperty(URL.prototype, "hostname", { - get() { - return this[impl].hostname; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].hostname = V; - }, - enumerable: true, - configurable: true -}); + // GB18030 is an algorithmic extension of GBK. + // Main source: https://www.w3.org/TR/encoding/#gbk-encoder + // http://icu-project.org/docs/papers/gb18030.html + // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml + // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 + 'gb18030': { + type: '_dbcs', + table: function() { return (__nccwpck_require__(94904).concat)(__nccwpck_require__(49429)) }, + gb18030: function() { return __nccwpck_require__(25893) }, + encodeSkipVals: [0x80], + encodeAdd: {'€': 0xA2E3}, + }, -Object.defineProperty(URL.prototype, "port", { - get() { - return this[impl].port; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].port = V; - }, - enumerable: true, - configurable: true -}); + 'chinese': 'gb18030', + + + // == Korean =============================================================== + // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. + 'windows949': 'cp949', + 'ms949': 'cp949', + '949': 'cp949', + 'cp949': { + type: '_dbcs', + table: function() { return __nccwpck_require__(13940) }, + }, -Object.defineProperty(URL.prototype, "pathname", { - get() { - return this[impl].pathname; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].pathname = V; - }, - enumerable: true, - configurable: true -}); + 'cseuckr': 'cp949', + 'csksc56011987': 'cp949', + 'euckr': 'cp949', + 'isoir149': 'cp949', + 'korean': 'cp949', + 'ksc56011987': 'cp949', + 'ksc56011989': 'cp949', + 'ksc5601': 'cp949', -Object.defineProperty(URL.prototype, "search", { - get() { - return this[impl].search; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].search = V; - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(URL.prototype, "hash", { - get() { - return this[impl].hash; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].hash = V; - }, - enumerable: true, - configurable: true -}); + // == Big5/Taiwan/Hong Kong ================================================ + // There are lots of tables for Big5 and cp950. Please see the following links for history: + // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html + // Variations, in roughly number of defined chars: + // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT + // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ + // * Big5-2003 (Taiwan standard) almost superset of cp950. + // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. + // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. + // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. + // Plus, it has 4 combining sequences. + // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 + // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. + // Implementations are not consistent within browsers; sometimes labeled as just big5. + // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. + // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 + // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. + // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt + // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt + // + // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder + // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. + 'windows950': 'cp950', + 'ms950': 'cp950', + '950': 'cp950', + 'cp950': { + type: '_dbcs', + table: function() { return __nccwpck_require__(7507) }, + }, -module.exports = { - is(obj) { - return !!obj && obj[impl] instanceof Impl.implementation; - }, - create(constructorArgs, privateData) { - let obj = Object.create(URL.prototype); - this.setup(obj, constructorArgs, privateData); - return obj; - }, - setup(obj, constructorArgs, privateData) { - if (!privateData) privateData = {}; - privateData.wrapper = obj; + // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. + 'big5': 'big5hkscs', + 'big5hkscs': { + type: '_dbcs', + table: function() { return (__nccwpck_require__(7507).concat)(__nccwpck_require__(53768)) }, + encodeSkipVals: [ + // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of + // https://encoding.spec.whatwg.org/#index-big5-pointer), we still do it to increase compatibility with ICU. + // But if a single unicode point can be encoded both as HKSCS and regular Big5, we prefer the latter. + 0x8e69, 0x8e6f, 0x8e7e, 0x8eab, 0x8eb4, 0x8ecd, 0x8ed0, 0x8f57, 0x8f69, 0x8f6e, 0x8fcb, 0x8ffe, + 0x906d, 0x907a, 0x90c4, 0x90dc, 0x90f1, 0x91bf, 0x92af, 0x92b0, 0x92b1, 0x92b2, 0x92d1, 0x9447, 0x94ca, + 0x95d9, 0x96fc, 0x9975, 0x9b76, 0x9b78, 0x9b7b, 0x9bc6, 0x9bde, 0x9bec, 0x9bf6, 0x9c42, 0x9c53, 0x9c62, + 0x9c68, 0x9c6b, 0x9c77, 0x9cbc, 0x9cbd, 0x9cd0, 0x9d57, 0x9d5a, 0x9dc4, 0x9def, 0x9dfb, 0x9ea9, 0x9eef, + 0x9efd, 0x9f60, 0x9fcb, 0xa077, 0xa0dc, 0xa0df, 0x8fcc, 0x92c8, 0x9644, 0x96ed, - obj[impl] = new Impl.implementation(constructorArgs, privateData); - obj[impl][utils.wrapperSymbol] = obj; - }, - interface: URL, - expose: { - Window: { URL: URL }, - Worker: { URL: URL } - } -}; + // Step 2 of https://encoding.spec.whatwg.org/#index-big5-pointer: Use last pointer for U+2550, U+255E, U+2561, U+256A, U+5341, or U+5345 + 0xa2a4, 0xa2a5, 0xa2a7, 0xa2a6, 0xa2cc, 0xa2ce, + ], + }, + 'cnbig5': 'big5hkscs', + 'csbig5': 'big5hkscs', + 'xxbig5': 'big5hkscs', +}; /***/ }), -/***/ 73323: +/***/ 5531: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; -exports.URL = __nccwpck_require__(45724)["interface"]; -exports.serializeURL = __nccwpck_require__(40402).serializeURL; -exports.serializeURLOrigin = __nccwpck_require__(40402).serializeURLOrigin; -exports.basicURLParse = __nccwpck_require__(40402).basicURLParse; -exports.setTheUsername = __nccwpck_require__(40402).setTheUsername; -exports.setThePassword = __nccwpck_require__(40402).setThePassword; -exports.serializeHost = __nccwpck_require__(40402).serializeHost; -exports.serializeInteger = __nccwpck_require__(40402).serializeInteger; -exports.parseURL = __nccwpck_require__(40402).parseURL; +// Update this array if you add/rename/remove files in this directory. +// We support Browserify by skipping automatic module discovery and requiring modules directly. +var modules = [ + __nccwpck_require__(62860), + __nccwpck_require__(96078), + __nccwpck_require__(45124), + __nccwpck_require__(91081), + __nccwpck_require__(23383), + __nccwpck_require__(74733), + __nccwpck_require__(24881), + __nccwpck_require__(34855), + __nccwpck_require__(51098), +]; + +// Put all encoding/alias/codec definitions to single object and export it. +for (var i = 0; i < modules.length; i++) { + var module = modules[i]; + for (var enc in module) + if (Object.prototype.hasOwnProperty.call(module, enc)) + exports[enc] = module[enc]; +} /***/ }), -/***/ 40402: +/***/ 62860: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; -const punycode = __nccwpck_require__(85477); -const tr46 = __nccwpck_require__(48026); +var Buffer = (__nccwpck_require__(17120).Buffer); -const specialSchemes = { - ftp: 21, - file: null, - gopher: 70, - http: 80, - https: 443, - ws: 80, - wss: 443 +// Export Node.js internal encodings. + +module.exports = { + // Encodings + utf8: { type: "_internal", bomAware: true}, + cesu8: { type: "_internal", bomAware: true}, + unicode11utf8: "utf8", + + ucs2: { type: "_internal", bomAware: true}, + utf16le: "ucs2", + + binary: { type: "_internal" }, + base64: { type: "_internal" }, + hex: { type: "_internal" }, + + // Codec. + _internal: InternalCodec, }; -const failure = Symbol("failure"); +//------------------------------------------------------------------------------ -function countSymbols(str) { - return punycode.ucs2.decode(str).length; -} +function InternalCodec(codecOptions, iconv) { + this.enc = codecOptions.encodingName; + this.bomAware = codecOptions.bomAware; -function at(input, idx) { - const c = input[idx]; - return isNaN(c) ? undefined : String.fromCodePoint(c); -} + if (this.enc === "base64") + this.encoder = InternalEncoderBase64; + else if (this.enc === "cesu8") { + this.enc = "utf8"; // Use utf8 for decoding. + this.encoder = InternalEncoderCesu8; -function isASCIIDigit(c) { - return c >= 0x30 && c <= 0x39; + // Add decoder for versions of Node not supporting CESU-8 + if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') { + this.decoder = InternalDecoderCesu8; + this.defaultCharUnicode = iconv.defaultCharUnicode; + } + } } -function isASCIIAlpha(c) { - return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A); -} +InternalCodec.prototype.encoder = InternalEncoder; +InternalCodec.prototype.decoder = InternalDecoder; -function isASCIIAlphanumeric(c) { - return isASCIIAlpha(c) || isASCIIDigit(c); -} +//------------------------------------------------------------------------------ -function isASCIIHex(c) { - return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66); -} +// We use node.js internal decoder. Its signature is the same as ours. +var StringDecoder = (__nccwpck_require__(71576).StringDecoder); -function isSingleDot(buffer) { - return buffer === "." || buffer.toLowerCase() === "%2e"; -} +if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. + StringDecoder.prototype.end = function() {}; -function isDoubleDot(buffer) { - buffer = buffer.toLowerCase(); - return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e"; -} -function isWindowsDriveLetterCodePoints(cp1, cp2) { - return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124); +function InternalDecoder(options, codec) { + this.decoder = new StringDecoder(codec.enc); } -function isWindowsDriveLetterString(string) { - return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|"); -} +InternalDecoder.prototype.write = function(buf) { + if (!Buffer.isBuffer(buf)) { + buf = Buffer.from(buf); + } -function isNormalizedWindowsDriveLetterString(string) { - return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === ":"; + return this.decoder.write(buf); } -function containsForbiddenHostCodePoint(string) { - return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1; +InternalDecoder.prototype.end = function() { + return this.decoder.end(); } -function containsForbiddenHostCodePointExcludingPercent(string) { - return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/) !== -1; + +//------------------------------------------------------------------------------ +// Encoder is mostly trivial + +function InternalEncoder(options, codec) { + this.enc = codec.enc; } -function isSpecialScheme(scheme) { - return specialSchemes[scheme] !== undefined; +InternalEncoder.prototype.write = function(str) { + return Buffer.from(str, this.enc); } -function isSpecial(url) { - return isSpecialScheme(url.scheme); +InternalEncoder.prototype.end = function() { } -function defaultPort(scheme) { - return specialSchemes[scheme]; + +//------------------------------------------------------------------------------ +// Except base64 encoder, which must keep its state. + +function InternalEncoderBase64(options, codec) { + this.prevStr = ''; } -function percentEncode(c) { - let hex = c.toString(16).toUpperCase(); - if (hex.length === 1) { - hex = "0" + hex; - } +InternalEncoderBase64.prototype.write = function(str) { + str = this.prevStr + str; + var completeQuads = str.length - (str.length % 4); + this.prevStr = str.slice(completeQuads); + str = str.slice(0, completeQuads); - return "%" + hex; + return Buffer.from(str, "base64"); } -function utf8PercentEncode(c) { - const buf = new Buffer(c); +InternalEncoderBase64.prototype.end = function() { + return Buffer.from(this.prevStr, "base64"); +} - let str = ""; - for (let i = 0; i < buf.length; ++i) { - str += percentEncode(buf[i]); - } +//------------------------------------------------------------------------------ +// CESU-8 encoder is also special. - return str; +function InternalEncoderCesu8(options, codec) { } -function utf8PercentDecode(str) { - const input = new Buffer(str); - const output = []; - for (let i = 0; i < input.length; ++i) { - if (input[i] !== 37) { - output.push(input[i]); - } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) { - output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16)); - i += 2; - } else { - output.push(input[i]); +InternalEncoderCesu8.prototype.write = function(str) { + var buf = Buffer.alloc(str.length * 3), bufIdx = 0; + for (var i = 0; i < str.length; i++) { + var charCode = str.charCodeAt(i); + // Naive implementation, but it works because CESU-8 is especially easy + // to convert from UTF-16 (which all JS strings are encoded in). + if (charCode < 0x80) + buf[bufIdx++] = charCode; + else if (charCode < 0x800) { + buf[bufIdx++] = 0xC0 + (charCode >>> 6); + buf[bufIdx++] = 0x80 + (charCode & 0x3f); + } + else { // charCode will always be < 0x10000 in javascript. + buf[bufIdx++] = 0xE0 + (charCode >>> 12); + buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f); + buf[bufIdx++] = 0x80 + (charCode & 0x3f); + } } - } - return new Buffer(output).toString(); + return buf.slice(0, bufIdx); } -function isC0ControlPercentEncode(c) { - return c <= 0x1F || c > 0x7E; +InternalEncoderCesu8.prototype.end = function() { } -const extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]); -function isPathPercentEncode(c) { - return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c); -} +//------------------------------------------------------------------------------ +// CESU-8 decoder is not implemented in Node v4.0+ -const extraUserinfoPercentEncodeSet = - new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]); -function isUserinfoPercentEncode(c) { - return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c); +function InternalDecoderCesu8(options, codec) { + this.acc = 0; + this.contBytes = 0; + this.accBytes = 0; + this.defaultCharUnicode = codec.defaultCharUnicode; } -function percentEncodeChar(c, encodeSetPredicate) { - const cStr = String.fromCodePoint(c); - - if (encodeSetPredicate(c)) { - return utf8PercentEncode(cStr); - } +InternalDecoderCesu8.prototype.write = function(buf) { + var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, + res = ''; + for (var i = 0; i < buf.length; i++) { + var curByte = buf[i]; + if ((curByte & 0xC0) !== 0x80) { // Leading byte + if (contBytes > 0) { // Previous code is invalid + res += this.defaultCharUnicode; + contBytes = 0; + } - return cStr; + if (curByte < 0x80) { // Single-byte code + res += String.fromCharCode(curByte); + } else if (curByte < 0xE0) { // Two-byte code + acc = curByte & 0x1F; + contBytes = 1; accBytes = 1; + } else if (curByte < 0xF0) { // Three-byte code + acc = curByte & 0x0F; + contBytes = 2; accBytes = 1; + } else { // Four or more are not supported for CESU-8. + res += this.defaultCharUnicode; + } + } else { // Continuation byte + if (contBytes > 0) { // We're waiting for it. + acc = (acc << 6) | (curByte & 0x3f); + contBytes--; accBytes++; + if (contBytes === 0) { + // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) + if (accBytes === 2 && acc < 0x80 && acc > 0) + res += this.defaultCharUnicode; + else if (accBytes === 3 && acc < 0x800) + res += this.defaultCharUnicode; + else + // Actually add character. + res += String.fromCharCode(acc); + } + } else { // Unexpected continuation byte + res += this.defaultCharUnicode; + } + } + } + this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes; + return res; } -function parseIPv4Number(input) { - let R = 10; - - if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { - input = input.substring(2); - R = 16; - } else if (input.length >= 2 && input.charAt(0) === "0") { - input = input.substring(1); - R = 8; - } - - if (input === "") { - return 0; - } +InternalDecoderCesu8.prototype.end = function() { + var res = 0; + if (this.contBytes > 0) + res += this.defaultCharUnicode; + return res; +} - const regex = R === 10 ? /[^0-9]/ : (R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/); - if (regex.test(input)) { - return failure; - } - return parseInt(input, R); -} +/***/ }), -function parseIPv4(input) { - const parts = input.split("."); - if (parts[parts.length - 1] === "") { - if (parts.length > 1) { - parts.pop(); - } - } +/***/ 23383: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (parts.length > 4) { - return input; - } - const numbers = []; - for (const part of parts) { - if (part === "") { - return input; - } - const n = parseIPv4Number(part); - if (n === failure) { - return input; - } +var Buffer = (__nccwpck_require__(17120).Buffer); - numbers.push(n); - } +// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that +// correspond to encoded bytes (if 128 - then lower half is ASCII). - for (let i = 0; i < numbers.length - 1; ++i) { - if (numbers[i] > 255) { - return failure; +exports._sbcs = SBCSCodec; +function SBCSCodec(codecOptions, iconv) { + if (!codecOptions) + throw new Error("SBCS codec is called without the data.") + + // Prepare char buffer for decoding. + if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) + throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)"); + + if (codecOptions.chars.length === 128) { + var asciiString = ""; + for (var i = 0; i < 128; i++) + asciiString += String.fromCharCode(i); + codecOptions.chars = asciiString + codecOptions.chars; } - } - if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) { - return failure; - } - let ipv4 = numbers.pop(); - let counter = 0; + this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2'); + + // Encoding buffer. + var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); - for (const n of numbers) { - ipv4 += n * Math.pow(256, 3 - counter); - ++counter; - } + for (var i = 0; i < codecOptions.chars.length; i++) + encodeBuf[codecOptions.chars.charCodeAt(i)] = i; - return ipv4; + this.encodeBuf = encodeBuf; } -function serializeIPv4(address) { - let output = ""; - let n = address; +SBCSCodec.prototype.encoder = SBCSEncoder; +SBCSCodec.prototype.decoder = SBCSDecoder; - for (let i = 1; i <= 4; ++i) { - output = String(n % 256) + output; - if (i !== 4) { - output = "." + output; - } - n = Math.floor(n / 256); - } - return output; +function SBCSEncoder(options, codec) { + this.encodeBuf = codec.encodeBuf; } -function parseIPv6(input) { - const address = [0, 0, 0, 0, 0, 0, 0, 0]; - let pieceIndex = 0; - let compress = null; - let pointer = 0; - - input = punycode.ucs2.decode(input); - - if (input[pointer] === 58) { - if (input[pointer + 1] !== 58) { - return failure; - } - - pointer += 2; - ++pieceIndex; - compress = pieceIndex; - } +SBCSEncoder.prototype.write = function(str) { + var buf = Buffer.alloc(str.length); + for (var i = 0; i < str.length; i++) + buf[i] = this.encodeBuf[str.charCodeAt(i)]; + + return buf; +} - while (pointer < input.length) { - if (pieceIndex === 8) { - return failure; - } +SBCSEncoder.prototype.end = function() { +} - if (input[pointer] === 58) { - if (compress !== null) { - return failure; - } - ++pointer; - ++pieceIndex; - compress = pieceIndex; - continue; - } - let value = 0; - let length = 0; +function SBCSDecoder(options, codec) { + this.decodeBuf = codec.decodeBuf; +} - while (length < 4 && isASCIIHex(input[pointer])) { - value = value * 0x10 + parseInt(at(input, pointer), 16); - ++pointer; - ++length; +SBCSDecoder.prototype.write = function(buf) { + // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. + var decodeBuf = this.decodeBuf; + var newBuf = Buffer.alloc(buf.length*2); + var idx1 = 0, idx2 = 0; + for (var i = 0; i < buf.length; i++) { + idx1 = buf[i]*2; idx2 = i*2; + newBuf[idx2] = decodeBuf[idx1]; + newBuf[idx2+1] = decodeBuf[idx1+1]; } + return newBuf.toString('ucs2'); +} - if (input[pointer] === 46) { - if (length === 0) { - return failure; - } - - pointer -= length; +SBCSDecoder.prototype.end = function() { +} - if (pieceIndex > 6) { - return failure; - } - let numbersSeen = 0; +/***/ }), - while (input[pointer] !== undefined) { - let ipv4Piece = null; +/***/ 24881: +/***/ ((module) => { - if (numbersSeen > 0) { - if (input[pointer] === 46 && numbersSeen < 4) { - ++pointer; - } else { - return failure; - } - } - if (!isASCIIDigit(input[pointer])) { - return failure; - } - while (isASCIIDigit(input[pointer])) { - const number = parseInt(at(input, pointer)); - if (ipv4Piece === null) { - ipv4Piece = number; - } else if (ipv4Piece === 0) { - return failure; - } else { - ipv4Piece = ipv4Piece * 10 + number; - } - if (ipv4Piece > 255) { - return failure; - } - ++pointer; - } +// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. +module.exports = { + "437": "cp437", + "737": "cp737", + "775": "cp775", + "850": "cp850", + "852": "cp852", + "855": "cp855", + "856": "cp856", + "857": "cp857", + "858": "cp858", + "860": "cp860", + "861": "cp861", + "862": "cp862", + "863": "cp863", + "864": "cp864", + "865": "cp865", + "866": "cp866", + "869": "cp869", + "874": "windows874", + "922": "cp922", + "1046": "cp1046", + "1124": "cp1124", + "1125": "cp1125", + "1129": "cp1129", + "1133": "cp1133", + "1161": "cp1161", + "1162": "cp1162", + "1163": "cp1163", + "1250": "windows1250", + "1251": "windows1251", + "1252": "windows1252", + "1253": "windows1253", + "1254": "windows1254", + "1255": "windows1255", + "1256": "windows1256", + "1257": "windows1257", + "1258": "windows1258", + "28591": "iso88591", + "28592": "iso88592", + "28593": "iso88593", + "28594": "iso88594", + "28595": "iso88595", + "28596": "iso88596", + "28597": "iso88597", + "28598": "iso88598", + "28599": "iso88599", + "28600": "iso885910", + "28601": "iso885911", + "28603": "iso885913", + "28604": "iso885914", + "28605": "iso885915", + "28606": "iso885916", + "windows874": { + "type": "_sbcs", + "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "win874": "windows874", + "cp874": "windows874", + "windows1250": { + "type": "_sbcs", + "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "win1250": "windows1250", + "cp1250": "windows1250", + "windows1251": { + "type": "_sbcs", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "win1251": "windows1251", + "cp1251": "windows1251", + "windows1252": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "win1252": "windows1252", + "cp1252": "windows1252", + "windows1253": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "win1253": "windows1253", + "cp1253": "windows1253", + "windows1254": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "win1254": "windows1254", + "cp1254": "windows1254", + "windows1255": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "win1255": "windows1255", + "cp1255": "windows1255", + "windows1256": { + "type": "_sbcs", + "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" + }, + "win1256": "windows1256", + "cp1256": "windows1256", + "windows1257": { + "type": "_sbcs", + "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" + }, + "win1257": "windows1257", + "cp1257": "windows1257", + "windows1258": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "win1258": "windows1258", + "cp1258": "windows1258", + "iso88591": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28591": "iso88591", + "iso88592": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "cp28592": "iso88592", + "iso88593": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�Ż°ħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" + }, + "cp28593": "iso88593", + "iso88594": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤ĨĻ§¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩļˇ¸šēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖ×ØŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" + }, + "cp28594": "iso88594", + "iso88595": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" + }, + "cp28595": "iso88595", + "iso88596": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" + }, + "cp28596": "iso88596", + "iso88597": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "cp28597": "iso88597", + "iso88598": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "cp28598": "iso88598", + "iso88599": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "cp28599": "iso88599", + "iso885910": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨĶ§ĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" + }, + "cp28600": "iso885910", + "iso885911": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "cp28601": "iso885911", + "iso885913": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" + }, + "cp28603": "iso885913", + "iso885914": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" + }, + "cp28604": "iso885914", + "iso885915": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28605": "iso885915", + "iso885916": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Š§š©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" + }, + "cp28606": "iso885916", + "cp437": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm437": "cp437", + "csibm437": "cp437", + "cp737": { + "type": "_sbcs", + "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " + }, + "ibm737": "cp737", + "csibm737": "cp737", + "cp775": { + "type": "_sbcs", + "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£ØפĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " + }, + "ibm775": "cp775", + "csibm775": "cp775", + "cp850": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm850": "cp850", + "csibm850": "cp850", + "cp852": { + "type": "_sbcs", + "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " + }, + "ibm852": "cp852", + "csibm852": "cp852", + "cp855": { + "type": "_sbcs", + "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " + }, + "ibm855": "cp855", + "csibm855": "cp855", + "cp856": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm856": "cp856", + "csibm856": "cp856", + "cp857": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " + }, + "ibm857": "cp857", + "csibm857": "cp857", + "cp858": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm858": "cp858", + "csibm858": "cp858", + "cp860": { + "type": "_sbcs", + "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm860": "cp860", + "csibm860": "cp860", + "cp861": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm861": "cp861", + "csibm861": "cp861", + "cp862": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm862": "cp862", + "csibm862": "cp862", + "cp863": { + "type": "_sbcs", + "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm863": "cp863", + "csibm863": "cp863", + "cp864": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" + }, + "ibm864": "cp864", + "csibm864": "cp864", + "cp865": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm865": "cp865", + "csibm865": "cp865", + "cp866": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " + }, + "ibm866": "cp866", + "csibm866": "cp866", + "cp869": { + "type": "_sbcs", + "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " + }, + "ibm869": "cp869", + "csibm869": "cp869", + "cp922": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖ×ØÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" + }, + "ibm922": "cp922", + "csibm922": "cp922", + "cp1046": { + "type": "_sbcs", + "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" + }, + "ibm1046": "cp1046", + "csibm1046": "cp1046", + "cp1124": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" + }, + "ibm1124": "cp1124", + "csibm1124": "cp1124", + "cp1125": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " + }, + "ibm1125": "cp1125", + "csibm1125": "cp1125", + "cp1129": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "ibm1129": "cp1129", + "csibm1129": "cp1129", + "cp1133": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" + }, + "ibm1133": "cp1133", + "csibm1133": "cp1133", + "cp1161": { + "type": "_sbcs", + "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " + }, + "ibm1161": "cp1161", + "csibm1161": "cp1161", + "cp1162": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "ibm1162": "cp1162", + "csibm1162": "cp1162", + "cp1163": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "ibm1163": "cp1163", + "csibm1163": "cp1163", + "maccroatian": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" + }, + "maccyrillic": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "macgreek": { + "type": "_sbcs", + "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" + }, + "maciceland": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macroman": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macromania": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macthai": { + "type": "_sbcs", + "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" + }, + "macturkish": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macukraine": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "koi8r": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8u": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8ru": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8t": { + "type": "_sbcs", + "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "armscii8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" + }, + "rk1048": { + "type": "_sbcs", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "tcvn": { + "type": "_sbcs", + "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" + }, + "georgianacademy": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "georgianps": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "pt154": { + "type": "_sbcs", + "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "viscii": { + "type": "_sbcs", + "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" + }, + "iso646cn": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" + }, + "iso646jp": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" + }, + "hproman8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" + }, + "macintosh": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "ascii": { + "type": "_sbcs", + "chars": "��������������������������������������������������������������������������������������������������������������������������������" + }, + "tis620": { + "type": "_sbcs", + "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + } +} - address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece; +/***/ }), - ++numbersSeen; +/***/ 74733: +/***/ ((module) => { - if (numbersSeen === 2 || numbersSeen === 4) { - ++pieceIndex; - } - } - if (numbersSeen !== 4) { - return failure; - } - break; - } else if (input[pointer] === 58) { - ++pointer; - if (input[pointer] === undefined) { - return failure; - } - } else if (input[pointer] !== undefined) { - return failure; - } +// Manually added data to be used by sbcs codec in addition to generated one. - address[pieceIndex] = value; - ++pieceIndex; - } +module.exports = { + // Not supported by iconv, not sure why. + "10029": "maccenteuro", + "maccenteuro": { + "type": "_sbcs", + "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" + }, - if (compress !== null) { - let swaps = pieceIndex - compress; - pieceIndex = 7; - while (pieceIndex !== 0 && swaps > 0) { - const temp = address[compress + swaps - 1]; - address[compress + swaps - 1] = address[pieceIndex]; - address[pieceIndex] = temp; - --pieceIndex; - --swaps; - } - } else if (compress === null && pieceIndex !== 8) { - return failure; - } + "808": "cp808", + "ibm808": "cp808", + "cp808": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " + }, - return address; -} + "mik": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, -function serializeIPv6(address) { - let output = ""; - const seqResult = findLongestZeroSequence(address); - const compress = seqResult.idx; - let ignore0 = false; + "cp720": { + "type": "_sbcs", + "chars": "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0" + }, - for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { - if (ignore0 && address[pieceIndex] === 0) { - continue; - } else if (ignore0) { - ignore0 = false; - } + // Aliases of generated encodings. + "ascii8bit": "ascii", + "usascii": "ascii", + "ansix34": "ascii", + "ansix341968": "ascii", + "ansix341986": "ascii", + "csascii": "ascii", + "cp367": "ascii", + "ibm367": "ascii", + "isoir6": "ascii", + "iso646us": "ascii", + "iso646irv": "ascii", + "us": "ascii", - if (compress === pieceIndex) { - const separator = pieceIndex === 0 ? "::" : ":"; - output += separator; - ignore0 = true; - continue; - } + "latin1": "iso88591", + "latin2": "iso88592", + "latin3": "iso88593", + "latin4": "iso88594", + "latin5": "iso88599", + "latin6": "iso885910", + "latin7": "iso885913", + "latin8": "iso885914", + "latin9": "iso885915", + "latin10": "iso885916", - output += address[pieceIndex].toString(16); + "csisolatin1": "iso88591", + "csisolatin2": "iso88592", + "csisolatin3": "iso88593", + "csisolatin4": "iso88594", + "csisolatincyrillic": "iso88595", + "csisolatinarabic": "iso88596", + "csisolatingreek" : "iso88597", + "csisolatinhebrew": "iso88598", + "csisolatin5": "iso88599", + "csisolatin6": "iso885910", - if (pieceIndex !== 7) { - output += ":"; - } - } + "l1": "iso88591", + "l2": "iso88592", + "l3": "iso88593", + "l4": "iso88594", + "l5": "iso88599", + "l6": "iso885910", + "l7": "iso885913", + "l8": "iso885914", + "l9": "iso885915", + "l10": "iso885916", - return output; -} + "isoir14": "iso646jp", + "isoir57": "iso646cn", + "isoir100": "iso88591", + "isoir101": "iso88592", + "isoir109": "iso88593", + "isoir110": "iso88594", + "isoir144": "iso88595", + "isoir127": "iso88596", + "isoir126": "iso88597", + "isoir138": "iso88598", + "isoir148": "iso88599", + "isoir157": "iso885910", + "isoir166": "tis620", + "isoir179": "iso885913", + "isoir199": "iso885914", + "isoir203": "iso885915", + "isoir226": "iso885916", -function parseHost(input, isSpecialArg) { - if (input[0] === "[") { - if (input[input.length - 1] !== "]") { - return failure; - } + "cp819": "iso88591", + "ibm819": "iso88591", - return parseIPv6(input.substring(1, input.length - 1)); - } + "cyrillic": "iso88595", - if (!isSpecialArg) { - return parseOpaqueHost(input); - } + "arabic": "iso88596", + "arabic8": "iso88596", + "ecma114": "iso88596", + "asmo708": "iso88596", - const domain = utf8PercentDecode(input); - const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false); - if (asciiDomain === null) { - return failure; - } + "greek" : "iso88597", + "greek8" : "iso88597", + "ecma118" : "iso88597", + "elot928" : "iso88597", - if (containsForbiddenHostCodePoint(asciiDomain)) { - return failure; - } + "hebrew": "iso88598", + "hebrew8": "iso88598", - const ipv4Host = parseIPv4(asciiDomain); - if (typeof ipv4Host === "number" || ipv4Host === failure) { - return ipv4Host; - } + "turkish": "iso88599", + "turkish8": "iso88599", - return asciiDomain; -} + "thai": "iso885911", + "thai8": "iso885911", -function parseOpaqueHost(input) { - if (containsForbiddenHostCodePointExcludingPercent(input)) { - return failure; - } + "celtic": "iso885914", + "celtic8": "iso885914", + "isoceltic": "iso885914", - let output = ""; - const decoded = punycode.ucs2.decode(input); - for (let i = 0; i < decoded.length; ++i) { - output += percentEncodeChar(decoded[i], isC0ControlPercentEncode); - } - return output; -} + "tis6200": "tis620", + "tis62025291": "tis620", + "tis62025330": "tis620", -function findLongestZeroSequence(arr) { - let maxIdx = null; - let maxLen = 1; // only find elements > 1 - let currStart = null; - let currLen = 0; + "10000": "macroman", + "10006": "macgreek", + "10007": "maccyrillic", + "10079": "maciceland", + "10081": "macturkish", - for (let i = 0; i < arr.length; ++i) { - if (arr[i] !== 0) { - if (currLen > maxLen) { - maxIdx = currStart; - maxLen = currLen; - } + "cspc8codepage437": "cp437", + "cspc775baltic": "cp775", + "cspc850multilingual": "cp850", + "cspcp852": "cp852", + "cspc862latinhebrew": "cp862", + "cpgr": "cp869", - currStart = null; - currLen = 0; - } else { - if (currStart === null) { - currStart = i; - } - ++currLen; - } - } + "msee": "cp1250", + "mscyrl": "cp1251", + "msansi": "cp1252", + "msgreek": "cp1253", + "msturk": "cp1254", + "mshebr": "cp1255", + "msarab": "cp1256", + "winbaltrim": "cp1257", - // if trailing zeros - if (currLen > maxLen) { - maxIdx = currStart; - maxLen = currLen; - } + "cp20866": "koi8r", + "20866": "koi8r", + "ibm878": "koi8r", + "cskoi8r": "koi8r", - return { - idx: maxIdx, - len: maxLen - }; -} + "cp21866": "koi8u", + "21866": "koi8u", + "ibm1168": "koi8u", -function serializeHost(host) { - if (typeof host === "number") { - return serializeIPv4(host); - } + "strk10482002": "rk1048", - // IPv6 serializer - if (host instanceof Array) { - return "[" + serializeIPv6(host) + "]"; - } + "tcvn5712": "tcvn", + "tcvn57121": "tcvn", - return host; -} + "gb198880": "iso646cn", + "cn": "iso646cn", -function trimControlChars(url) { - return url.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, ""); -} + "csiso14jisc6220ro": "iso646jp", + "jisc62201969ro": "iso646jp", + "jp": "iso646jp", -function trimTabAndNewline(url) { - return url.replace(/\u0009|\u000A|\u000D/g, ""); -} + "cshproman8": "hproman8", + "r8": "hproman8", + "roman8": "hproman8", + "xroman8": "hproman8", + "ibm1051": "hproman8", -function shortenPath(url) { - const path = url.path; - if (path.length === 0) { - return; - } - if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) { - return; - } + "mac": "macintosh", + "csmacintosh": "macintosh", +}; - path.pop(); -} -function includesCredentials(url) { - return url.username !== "" || url.password !== ""; -} -function cannotHaveAUsernamePasswordPort(url) { - return url.host === null || url.host === "" || url.cannotBeABaseURL || url.scheme === "file"; -} +/***/ }), -function isNormalizedWindowsDriveLetter(string) { - return /^[A-Za-z]:$/.test(string); -} +/***/ 45124: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -function URLStateMachine(input, base, encodingOverride, url, stateOverride) { - this.pointer = 0; - this.input = input; - this.base = base || null; - this.encodingOverride = encodingOverride || "utf-8"; - this.stateOverride = stateOverride; - this.url = url; - this.failure = false; - this.parseError = false; - if (!this.url) { - this.url = { - scheme: "", - username: "", - password: "", - host: null, - port: null, - path: [], - query: null, - fragment: null, +var Buffer = (__nccwpck_require__(17120).Buffer); - cannotBeABaseURL: false - }; +// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js - const res = trimControlChars(this.input); - if (res !== this.input) { - this.parseError = true; - } - this.input = res; - } +// == UTF16-BE codec. ========================================================== - const res = trimTabAndNewline(this.input); - if (res !== this.input) { - this.parseError = true; - } - this.input = res; +exports.utf16be = Utf16BECodec; +function Utf16BECodec() { +} - this.state = stateOverride || "scheme start"; +Utf16BECodec.prototype.encoder = Utf16BEEncoder; +Utf16BECodec.prototype.decoder = Utf16BEDecoder; +Utf16BECodec.prototype.bomAware = true; - this.buffer = ""; - this.atFlag = false; - this.arrFlag = false; - this.passwordTokenSeenFlag = false; - this.input = punycode.ucs2.decode(this.input); +// -- Encoding - for (; this.pointer <= this.input.length; ++this.pointer) { - const c = this.input[this.pointer]; - const cStr = isNaN(c) ? undefined : String.fromCodePoint(c); +function Utf16BEEncoder() { +} - // exec state machine - const ret = this["parse " + this.state](c, cStr); - if (!ret) { - break; // terminate algorithm - } else if (ret === failure) { - this.failure = true; - break; +Utf16BEEncoder.prototype.write = function(str) { + var buf = Buffer.from(str, 'ucs2'); + for (var i = 0; i < buf.length; i += 2) { + var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp; } - } + return buf; } -URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) { - if (isASCIIAlpha(c)) { - this.buffer += cStr.toLowerCase(); - this.state = "scheme"; - } else if (!this.stateOverride) { - this.state = "no scheme"; - --this.pointer; - } else { - this.parseError = true; - return failure; - } +Utf16BEEncoder.prototype.end = function() { +} - return true; -}; -URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { - if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) { - this.buffer += cStr.toLowerCase(); - } else if (c === 58) { - if (this.stateOverride) { - if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { - return false; - } +// -- Decoding - if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { - return false; - } +function Utf16BEDecoder() { + this.overflowByte = -1; +} - if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { - return false; - } +Utf16BEDecoder.prototype.write = function(buf) { + if (buf.length == 0) + return ''; - if (this.url.scheme === "file" && (this.url.host === "" || this.url.host === null)) { - return false; - } - } - this.url.scheme = this.buffer; - this.buffer = ""; - if (this.stateOverride) { - return false; + var buf2 = Buffer.alloc(buf.length + 1), + i = 0, j = 0; + + if (this.overflowByte !== -1) { + buf2[0] = buf[0]; + buf2[1] = this.overflowByte; + i = 1; j = 2; } - if (this.url.scheme === "file") { - if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) { - this.parseError = true; - } - this.state = "file"; - } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { - this.state = "special relative or authority"; - } else if (isSpecial(this.url)) { - this.state = "special authority slashes"; - } else if (this.input[this.pointer + 1] === 47) { - this.state = "path or authority"; - ++this.pointer; - } else { - this.url.cannotBeABaseURL = true; - this.url.path.push(""); - this.state = "cannot-be-a-base-URL path"; - } - } else if (!this.stateOverride) { - this.buffer = ""; - this.state = "no scheme"; - this.pointer = -1; - } else { - this.parseError = true; - return failure; - } - return true; -}; + for (; i < buf.length-1; i += 2, j+= 2) { + buf2[j] = buf[i+1]; + buf2[j+1] = buf[i]; + } -URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) { - if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) { - return failure; - } else if (this.base.cannotBeABaseURL && c === 35) { - this.url.scheme = this.base.scheme; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.url.cannotBeABaseURL = true; - this.state = "fragment"; - } else if (this.base.scheme === "file") { - this.state = "file"; - --this.pointer; - } else { - this.state = "relative"; - --this.pointer; - } + this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1; - return true; -}; + return buf2.slice(0, j).toString('ucs2'); +} -URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c) { - if (c === 47 && this.input[this.pointer + 1] === 47) { - this.state = "special authority ignore slashes"; - ++this.pointer; - } else { - this.parseError = true; - this.state = "relative"; - --this.pointer; - } +Utf16BEDecoder.prototype.end = function() { + this.overflowByte = -1; +} - return true; -}; -URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c) { - if (c === 47) { - this.state = "authority"; - } else { - this.state = "path"; - --this.pointer; - } +// == UTF-16 codec ============================================================= +// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. +// Defaults to UTF-16LE, as it's prevalent and default in Node. +// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le +// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); - return true; -}; +// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). -URLStateMachine.prototype["parse relative"] = function parseRelative(c) { - this.url.scheme = this.base.scheme; - if (isNaN(c)) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - } else if (c === 47) { - this.state = "relative slash"; - } else if (c === 63) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = ""; - this.state = "query"; - } else if (c === 35) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.state = "fragment"; - } else if (isSpecial(this.url) && c === 92) { - this.parseError = true; - this.state = "relative slash"; - } else { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(0, this.base.path.length - 1); +exports.utf16 = Utf16Codec; +function Utf16Codec(codecOptions, iconv) { + this.iconv = iconv; +} - this.state = "path"; - --this.pointer; - } +Utf16Codec.prototype.encoder = Utf16Encoder; +Utf16Codec.prototype.decoder = Utf16Decoder; - return true; -}; -URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c) { - if (isSpecial(this.url) && (c === 47 || c === 92)) { - if (c === 92) { - this.parseError = true; - } - this.state = "special authority ignore slashes"; - } else if (c === 47) { - this.state = "authority"; - } else { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.state = "path"; - --this.pointer; - } +// -- Encoding (pass-through) - return true; -}; +function Utf16Encoder(options, codec) { + options = options || {}; + if (options.addBOM === undefined) + options.addBOM = true; + this.encoder = codec.iconv.getEncoder('utf-16le', options); +} -URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c) { - if (c === 47 && this.input[this.pointer + 1] === 47) { - this.state = "special authority ignore slashes"; - ++this.pointer; - } else { - this.parseError = true; - this.state = "special authority ignore slashes"; - --this.pointer; - } +Utf16Encoder.prototype.write = function(str) { + return this.encoder.write(str); +} - return true; -}; +Utf16Encoder.prototype.end = function() { + return this.encoder.end(); +} -URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c) { - if (c !== 47 && c !== 92) { - this.state = "authority"; - --this.pointer; - } else { - this.parseError = true; - } - return true; -}; +// -- Decoding -URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) { - if (c === 64) { - this.parseError = true; - if (this.atFlag) { - this.buffer = "%40" + this.buffer; - } - this.atFlag = true; +function Utf16Decoder(options, codec) { + this.decoder = null; + this.initialBufs = []; + this.initialBufsLen = 0; - // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars - const len = countSymbols(this.buffer); - for (let pointer = 0; pointer < len; ++pointer) { - const codePoint = this.buffer.codePointAt(pointer); + this.options = options || {}; + this.iconv = codec.iconv; +} - if (codePoint === 58 && !this.passwordTokenSeenFlag) { - this.passwordTokenSeenFlag = true; - continue; - } - const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode); - if (this.passwordTokenSeenFlag) { - this.url.password += encodedCodePoints; - } else { - this.url.username += encodedCodePoints; - } - } - this.buffer = ""; - } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || - (isSpecial(this.url) && c === 92)) { - if (this.atFlag && this.buffer === "") { - this.parseError = true; - return failure; - } - this.pointer -= countSymbols(this.buffer) + 1; - this.buffer = ""; - this.state = "host"; - } else { - this.buffer += cStr; - } +Utf16Decoder.prototype.write = function(buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBufs.push(buf); + this.initialBufsLen += buf.length; + + if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) + return ''; - return true; -}; + // We have enough bytes -> detect endianness. + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); -URLStateMachine.prototype["parse hostname"] = -URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) { - if (this.stateOverride && this.url.scheme === "file") { - --this.pointer; - this.state = "file host"; - } else if (c === 58 && !this.arrFlag) { - if (this.buffer === "") { - this.parseError = true; - return failure; - } + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); - const host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; } - this.url.host = host; - this.buffer = ""; - this.state = "port"; - if (this.stateOverride === "hostname") { - return false; - } - } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || - (isSpecial(this.url) && c === 92)) { - --this.pointer; - if (isSpecial(this.url) && this.buffer === "") { - this.parseError = true; - return failure; - } else if (this.stateOverride && this.buffer === "" && - (includesCredentials(this.url) || this.url.port !== null)) { - this.parseError = true; - return false; - } + return this.decoder.write(buf); +} - const host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; - } +Utf16Decoder.prototype.end = function() { + if (!this.decoder) { + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); - this.url.host = host; - this.buffer = ""; - this.state = "path start"; - if (this.stateOverride) { - return false; - } - } else { - if (c === 91) { - this.arrFlag = true; - } else if (c === 93) { - this.arrFlag = false; - } - this.buffer += cStr; - } + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); - return true; -}; + var trail = this.decoder.end(); + if (trail) + resStr += trail; -URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) { - if (isASCIIDigit(c)) { - this.buffer += cStr; - } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || - (isSpecial(this.url) && c === 92) || - this.stateOverride) { - if (this.buffer !== "") { - const port = parseInt(this.buffer); - if (port > Math.pow(2, 16) - 1) { - this.parseError = true; - return failure; - } - this.url.port = port === defaultPort(this.url.scheme) ? null : port; - this.buffer = ""; - } - if (this.stateOverride) { - return false; + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; } - this.state = "path start"; - --this.pointer; - } else { - this.parseError = true; - return failure; - } + return this.decoder.end(); +} - return true; -}; +function detectEncoding(bufs, defaultEncoding) { + var b = []; + var charsProcessed = 0; + var asciiCharsLE = 0, asciiCharsBE = 0; // Number of ASCII chars when decoded as LE or BE. -const fileOtherwiseCodePoints = new Set([47, 92, 63, 35]); - -URLStateMachine.prototype["parse file"] = function parseFile(c) { - this.url.scheme = "file"; - - if (c === 47 || c === 92) { - if (c === 92) { - this.parseError = true; - } - this.state = "file slash"; - } else if (this.base !== null && this.base.scheme === "file") { - if (isNaN(c)) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - } else if (c === 63) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = ""; - this.state = "query"; - } else if (c === 35) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.state = "fragment"; - } else { - if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points - !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) || - (this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points - !fileOtherwiseCodePoints.has(this.input[this.pointer + 2]))) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - shortenPath(this.url); - } else { - this.parseError = true; - } + outer_loop: + for (var i = 0; i < bufs.length; i++) { + var buf = bufs[i]; + for (var j = 0; j < buf.length; j++) { + b.push(buf[j]); + if (b.length === 2) { + if (charsProcessed === 0) { + // Check BOM first. + if (b[0] === 0xFF && b[1] === 0xFE) return 'utf-16le'; + if (b[0] === 0xFE && b[1] === 0xFF) return 'utf-16be'; + } - this.state = "path"; - --this.pointer; - } - } else { - this.state = "path"; - --this.pointer; - } + if (b[0] === 0 && b[1] !== 0) asciiCharsBE++; + if (b[0] !== 0 && b[1] === 0) asciiCharsLE++; - return true; -}; + b.length = 0; + charsProcessed++; -URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) { - if (c === 47 || c === 92) { - if (c === 92) { - this.parseError = true; - } - this.state = "file host"; - } else { - if (this.base !== null && this.base.scheme === "file") { - if (isNormalizedWindowsDriveLetterString(this.base.path[0])) { - this.url.path.push(this.base.path[0]); - } else { - this.url.host = this.base.host; - } + if (charsProcessed >= 100) { + break outer_loop; + } + } + } } - this.state = "path"; - --this.pointer; - } - return true; -}; + // Make decisions. + // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. + // So, we count ASCII as if it was LE or BE, and decide from that. + if (asciiCharsBE > asciiCharsLE) return 'utf-16be'; + if (asciiCharsBE < asciiCharsLE) return 'utf-16le'; -URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) { - if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) { - --this.pointer; - if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { - this.parseError = true; - this.state = "path"; - } else if (this.buffer === "") { - this.url.host = ""; - if (this.stateOverride) { - return false; - } - this.state = "path start"; - } else { - let host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; - } - if (host === "localhost") { - host = ""; - } - this.url.host = host; + // Couldn't decide (likely all zeros or not enough data). + return defaultEncoding || 'utf-16le'; +} - if (this.stateOverride) { - return false; - } - this.buffer = ""; - this.state = "path start"; - } - } else { - this.buffer += cStr; - } - return true; -}; -URLStateMachine.prototype["parse path start"] = function parsePathStart(c) { - if (isSpecial(this.url)) { - if (c === 92) { - this.parseError = true; - } - this.state = "path"; +/***/ }), - if (c !== 47 && c !== 92) { - --this.pointer; - } - } else if (!this.stateOverride && c === 63) { - this.url.query = ""; - this.state = "query"; - } else if (!this.stateOverride && c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } else if (c !== undefined) { - this.state = "path"; - if (c !== 47) { - --this.pointer; - } - } +/***/ 96078: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return true; -}; -URLStateMachine.prototype["parse path"] = function parsePath(c) { - if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) || - (!this.stateOverride && (c === 63 || c === 35))) { - if (isSpecial(this.url) && c === 92) { - this.parseError = true; - } - if (isDoubleDot(this.buffer)) { - shortenPath(this.url); - if (c !== 47 && !(isSpecial(this.url) && c === 92)) { - this.url.path.push(""); - } - } else if (isSingleDot(this.buffer) && c !== 47 && - !(isSpecial(this.url) && c === 92)) { - this.url.path.push(""); - } else if (!isSingleDot(this.buffer)) { - if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { - if (this.url.host !== "" && this.url.host !== null) { - this.parseError = true; - this.url.host = ""; - } - this.buffer = this.buffer[0] + ":"; - } - this.url.path.push(this.buffer); - } - this.buffer = ""; - if (this.url.scheme === "file" && (c === undefined || c === 63 || c === 35)) { - while (this.url.path.length > 1 && this.url.path[0] === "") { - this.parseError = true; - this.url.path.shift(); - } - } - if (c === 63) { - this.url.query = ""; - this.state = "query"; - } - if (c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else { - // TODO: If c is not a URL code point and not "%", parse error. +var Buffer = (__nccwpck_require__(17120).Buffer); - if (c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } +// == UTF32-LE/BE codec. ========================================================== - this.buffer += percentEncodeChar(c, isPathPercentEncode); - } +exports._utf32 = Utf32Codec; - return true; -}; +function Utf32Codec(codecOptions, iconv) { + this.iconv = iconv; + this.bomAware = true; + this.isLE = codecOptions.isLE; +} -URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c) { - if (c === 63) { - this.url.query = ""; - this.state = "query"; - } else if (c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } else { - // TODO: Add: not a URL code point - if (!isNaN(c) && c !== 37) { - this.parseError = true; - } +exports.utf32le = { type: '_utf32', isLE: true }; +exports.utf32be = { type: '_utf32', isLE: false }; - if (c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } +// Aliases +exports.ucs4le = 'utf32le'; +exports.ucs4be = 'utf32be'; - if (!isNaN(c)) { - this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode); - } - } +Utf32Codec.prototype.encoder = Utf32Encoder; +Utf32Codec.prototype.decoder = Utf32Decoder; - return true; -}; +// -- Encoding -URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) { - if (isNaN(c) || (!this.stateOverride && c === 35)) { - if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { - this.encodingOverride = "utf-8"; - } +function Utf32Encoder(options, codec) { + this.isLE = codec.isLE; + this.highSurrogate = 0; +} - const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead - for (let i = 0; i < buffer.length; ++i) { - if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 || - buffer[i] === 0x3C || buffer[i] === 0x3E) { - this.url.query += percentEncode(buffer[i]); - } else { - this.url.query += String.fromCodePoint(buffer[i]); - } - } +Utf32Encoder.prototype.write = function(str) { + var src = Buffer.from(str, 'ucs2'); + var dst = Buffer.alloc(src.length * 2); + var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE; + var offset = 0; - this.buffer = ""; - if (c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else { - // TODO: If c is not a URL code point and not "%", parse error. - if (c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } + for (var i = 0; i < src.length; i += 2) { + var code = src.readUInt16LE(i); + var isHighSurrogate = (0xD800 <= code && code < 0xDC00); + var isLowSurrogate = (0xDC00 <= code && code < 0xE000); - this.buffer += cStr; - } + if (this.highSurrogate) { + if (isHighSurrogate || !isLowSurrogate) { + // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low + // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character + // (technically wrong, but expected by some applications, like Windows file names). + write32.call(dst, this.highSurrogate, offset); + offset += 4; + } + else { + // Create 32-bit value from high and low surrogates; + var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000; - return true; -}; + write32.call(dst, codepoint, offset); + offset += 4; + this.highSurrogate = 0; -URLStateMachine.prototype["parse fragment"] = function parseFragment(c) { - if (isNaN(c)) { // do nothing - } else if (c === 0x0) { - this.parseError = true; - } else { - // TODO: If c is not a URL code point and not "%", parse error. - if (c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; + continue; + } + } + + if (isHighSurrogate) + this.highSurrogate = code; + else { + // Even if the current character is a low surrogate, with no previous high surrogate, we'll + // encode it as a semi-invalid stand-alone character for the same reasons expressed above for + // unpaired high surrogates. + write32.call(dst, code, offset); + offset += 4; + this.highSurrogate = 0; + } } - this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode); - } + if (offset < dst.length) + dst = dst.slice(0, offset); - return true; + return dst; }; -function serializeURL(url, excludeFragment) { - let output = url.scheme + ":"; - if (url.host !== null) { - output += "//"; - - if (url.username !== "" || url.password !== "") { - output += url.username; - if (url.password !== "") { - output += ":" + url.password; - } - output += "@"; - } +Utf32Encoder.prototype.end = function() { + // Treat any leftover high surrogate as a semi-valid independent character. + if (!this.highSurrogate) + return; - output += serializeHost(url.host); + var buf = Buffer.alloc(4); - if (url.port !== null) { - output += ":" + url.port; - } - } else if (url.host === null && url.scheme === "file") { - output += "//"; - } + if (this.isLE) + buf.writeUInt32LE(this.highSurrogate, 0); + else + buf.writeUInt32BE(this.highSurrogate, 0); - if (url.cannotBeABaseURL) { - output += url.path[0]; - } else { - for (const string of url.path) { - output += "/" + string; - } - } + this.highSurrogate = 0; - if (url.query !== null) { - output += "?" + url.query; - } + return buf; +}; - if (!excludeFragment && url.fragment !== null) { - output += "#" + url.fragment; - } +// -- Decoding - return output; +function Utf32Decoder(options, codec) { + this.isLE = codec.isLE; + this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0); + this.overflow = []; } -function serializeOrigin(tuple) { - let result = tuple.scheme + "://"; - result += serializeHost(tuple.host); - - if (tuple.port !== null) { - result += ":" + tuple.port; - } - - return result; -} +Utf32Decoder.prototype.write = function(src) { + if (src.length === 0) + return ''; -module.exports.serializeURL = serializeURL; + var i = 0; + var codepoint = 0; + var dst = Buffer.alloc(src.length + 4); + var offset = 0; + var isLE = this.isLE; + var overflow = this.overflow; + var badChar = this.badChar; -module.exports.serializeURLOrigin = function (url) { - // https://url.spec.whatwg.org/#concept-url-origin - switch (url.scheme) { - case "blob": - try { - return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0])); - } catch (e) { - // serializing an opaque origin returns "null" - return "null"; - } - case "ftp": - case "gopher": - case "http": - case "https": - case "ws": - case "wss": - return serializeOrigin({ - scheme: url.scheme, - host: url.host, - port: url.port - }); - case "file": - // spec says "exercise to the reader", chrome says "file://" - return "file://"; - default: - // serializing an opaque origin returns "null" - return "null"; - } -}; + if (overflow.length > 0) { + for (; i < src.length && overflow.length < 4; i++) + overflow.push(src[i]); + + if (overflow.length === 4) { + // NOTE: codepoint is a signed int32 and can be negative. + // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). + if (isLE) { + codepoint = overflow[i] | (overflow[i+1] << 8) | (overflow[i+2] << 16) | (overflow[i+3] << 24); + } else { + codepoint = overflow[i+3] | (overflow[i+2] << 8) | (overflow[i+1] << 16) | (overflow[i] << 24); + } + overflow.length = 0; -module.exports.basicURLParse = function (input, options) { - if (options === undefined) { - options = {}; - } + offset = _writeCodepoint(dst, offset, codepoint, badChar); + } + } - const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); - if (usm.failure) { - return "failure"; - } + // Main loop. Should be as optimized as possible. + for (; i < src.length - 3; i += 4) { + // NOTE: codepoint is a signed int32 and can be negative. + if (isLE) { + codepoint = src[i] | (src[i+1] << 8) | (src[i+2] << 16) | (src[i+3] << 24); + } else { + codepoint = src[i+3] | (src[i+2] << 8) | (src[i+1] << 16) | (src[i] << 24); + } + offset = _writeCodepoint(dst, offset, codepoint, badChar); + } - return usm.url; -}; + // Keep overflowing bytes. + for (; i < src.length; i++) { + overflow.push(src[i]); + } -module.exports.setTheUsername = function (url, username) { - url.username = ""; - const decoded = punycode.ucs2.decode(username); - for (let i = 0; i < decoded.length; ++i) { - url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode); - } + return dst.slice(0, offset).toString('ucs2'); }; -module.exports.setThePassword = function (url, password) { - url.password = ""; - const decoded = punycode.ucs2.decode(password); - for (let i = 0; i < decoded.length; ++i) { - url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode); - } -}; +function _writeCodepoint(dst, offset, codepoint, badChar) { + // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. + if (codepoint < 0 || codepoint > 0x10FFFF) { + // Not a valid Unicode codepoint + codepoint = badChar; + } -module.exports.serializeHost = serializeHost; + // Ephemeral Planes: Write high surrogate. + if (codepoint >= 0x10000) { + codepoint -= 0x10000; -module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; + var high = 0xD800 | (codepoint >> 10); + dst[offset++] = high & 0xff; + dst[offset++] = high >> 8; -module.exports.serializeInteger = function (integer) { - return String(integer); -}; + // Low surrogate is written below. + var codepoint = 0xDC00 | (codepoint & 0x3FF); + } -module.exports.parseURL = function (input, options) { - if (options === undefined) { - options = {}; - } + // Write BMP char or low surrogate. + dst[offset++] = codepoint & 0xff; + dst[offset++] = codepoint >> 8; - // We don't handle blobs, so this just delegates: - return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); + return offset; }; - -/***/ }), - -/***/ 59468: -/***/ ((module) => { - -"use strict"; - - -module.exports.mixin = function mixin(target, source) { - const keys = Object.getOwnPropertyNames(source); - for (let i = 0; i < keys.length; ++i) { - Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i])); - } +Utf32Decoder.prototype.end = function() { + this.overflow.length = 0; }; -module.exports.wrapperSymbol = Symbol("wrapper"); -module.exports.implSymbol = Symbol("impl"); +// == UTF-32 Auto codec ============================================================= +// Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic. +// Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32 +// Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'}); -module.exports.wrapperForImpl = function (impl) { - return impl[module.exports.wrapperSymbol]; -}; +// Encoder prepends BOM (which can be overridden with (addBOM: false}). -module.exports.implForWrapper = function (wrapper) { - return wrapper[module.exports.implSymbol]; -}; +exports.utf32 = Utf32AutoCodec; +exports.ucs4 = 'utf32'; +function Utf32AutoCodec(options, iconv) { + this.iconv = iconv; +} +Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder; +Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder; -/***/ }), +// -- Encoding -/***/ 16606: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +function Utf32AutoEncoder(options, codec) { + options = options || {}; -/** - * Advanced Encryption Standard (AES) implementation. - * - * This implementation is based on the public domain library 'jscrypto' which - * was written by: - * - * Emily Stark (estark@stanford.edu) - * Mike Hamburg (mhamburg@stanford.edu) - * Dan Boneh (dabo@cs.stanford.edu) - * - * Parts of this code are based on the OpenSSL implementation of AES: - * http://www.openssl.org - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. - */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -__nccwpck_require__(21477); -__nccwpck_require__(23540); -__nccwpck_require__(19239); -======= -var forge = __nccwpck_require__(96630); -__nccwpck_require__(27883); -__nccwpck_require__(70857); -__nccwpck_require__(36536); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + if (options.addBOM === undefined) + options.addBOM = true; -/* AES API */ -module.exports = forge.aes = forge.aes || {}; + this.encoder = codec.iconv.getEncoder(options.defaultEncoding || 'utf-32le', options); +} -/** - * Deprecated. Instead, use: - * - * var cipher = forge.cipher.createCipher('AES-', key); - * cipher.start({iv: iv}); - * - * Creates an AES cipher object to encrypt data using the given symmetric key. - * The output will be stored in the 'output' member of the returned cipher. - * - * The key and iv may be given as a string of bytes, an array of bytes, - * a byte buffer, or an array of 32-bit words. - * - * @param key the symmetric key to use. - * @param iv the initialization vector to use. - * @param output the buffer to write to, null to create one. - * @param mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -forge.aes.startEncrypting = function(key, iv, output, mode) { - var cipher = _createCipher({ - key: key, - output: output, - decrypt: false, - mode: mode - }); - cipher.start(iv); - return cipher; +Utf32AutoEncoder.prototype.write = function(str) { + return this.encoder.write(str); }; -/** - * Deprecated. Instead, use: - * - * var cipher = forge.cipher.createCipher('AES-', key); - * - * Creates an AES cipher object to encrypt data using the given symmetric key. - * - * The key may be given as a string of bytes, an array of bytes, a - * byte buffer, or an array of 32-bit words. - * - * @param key the symmetric key to use. - * @param mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -forge.aes.createEncryptionCipher = function(key, mode) { - return _createCipher({ - key: key, - output: null, - decrypt: false, - mode: mode - }); +Utf32AutoEncoder.prototype.end = function() { + return this.encoder.end(); }; -/** - * Deprecated. Instead, use: - * - * var decipher = forge.cipher.createDecipher('AES-', key); - * decipher.start({iv: iv}); - * - * Creates an AES cipher object to decrypt data using the given symmetric key. - * The output will be stored in the 'output' member of the returned cipher. - * - * The key and iv may be given as a string of bytes, an array of bytes, - * a byte buffer, or an array of 32-bit words. - * - * @param key the symmetric key to use. - * @param iv the initialization vector to use. - * @param output the buffer to write to, null to create one. - * @param mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -forge.aes.startDecrypting = function(key, iv, output, mode) { - var cipher = _createCipher({ - key: key, - output: output, - decrypt: true, - mode: mode - }); - cipher.start(iv); - return cipher; -}; +// -- Decoding -/** - * Deprecated. Instead, use: - * - * var decipher = forge.cipher.createDecipher('AES-', key); - * - * Creates an AES cipher object to decrypt data using the given symmetric key. - * - * The key may be given as a string of bytes, an array of bytes, a - * byte buffer, or an array of 32-bit words. - * - * @param key the symmetric key to use. - * @param mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -forge.aes.createDecryptionCipher = function(key, mode) { - return _createCipher({ - key: key, - output: null, - decrypt: true, - mode: mode - }); -}; +function Utf32AutoDecoder(options, codec) { + this.decoder = null; + this.initialBufs = []; + this.initialBufsLen = 0; + this.options = options || {}; + this.iconv = codec.iconv; +} -/** - * Creates a new AES cipher algorithm object. - * - * @param name the name of the algorithm. - * @param mode the mode factory function. - * - * @return the AES algorithm object. - */ -forge.aes.Algorithm = function(name, mode) { - if(!init) { - initialize(); - } - var self = this; - self.name = name; - self.mode = new mode({ - blockSize: 16, - cipher: { - encrypt: function(inBlock, outBlock) { - return _updateBlock(self._w, inBlock, outBlock, false); - }, - decrypt: function(inBlock, outBlock) { - return _updateBlock(self._w, inBlock, outBlock, true); - } - } - }); - self._init = false; -}; +Utf32AutoDecoder.prototype.write = function(buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBufs.push(buf); + this.initialBufsLen += buf.length; -/** - * Initializes this AES algorithm by expanding its key. - * - * @param options the options to use. - * key the key to use with this algorithm. - * decrypt true if the algorithm should be initialized for decryption, - * false for encryption. - */ -forge.aes.Algorithm.prototype.initialize = function(options) { - if(this._init) { - return; - } + if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) + return ''; - var key = options.key; - var tmp; + // We have enough bytes -> detect endianness. + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); - /* Note: The key may be a string of bytes, an array of bytes, a byte - buffer, or an array of 32-bit integers. If the key is in bytes, then - it must be 16, 24, or 32 bytes in length. If it is in 32-bit - integers, it must be 4, 6, or 8 integers long. */ + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); - if(typeof key === 'string' && - (key.length === 16 || key.length === 24 || key.length === 32)) { - // convert key string into byte buffer - key = forge.util.createBuffer(key); - } else if(forge.util.isArray(key) && - (key.length === 16 || key.length === 24 || key.length === 32)) { - // convert key integer array into byte buffer - tmp = key; - key = forge.util.createBuffer(); - for(var i = 0; i < tmp.length; ++i) { - key.putByte(tmp[i]); + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; } - } - // convert key byte buffer into 32-bit integer array - if(!forge.util.isArray(key)) { - tmp = key; - key = []; + return this.decoder.write(buf); +}; - // key lengths of 16, 24, 32 bytes allowed - var len = tmp.length(); - if(len === 16 || len === 24 || len === 32) { - len = len >>> 2; - for(var i = 0; i < len; ++i) { - key.push(tmp.getInt32()); - } - } - } +Utf32AutoDecoder.prototype.end = function() { + if (!this.decoder) { + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); - // key must be an array of 32-bit integers by now - if(!forge.util.isArray(key) || - !(key.length === 4 || key.length === 6 || key.length === 8)) { - throw new Error('Invalid key parameter.'); - } + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); - // encryption operation is always used for these modes - var mode = this.mode.name; - var encryptOp = (['CFB', 'OFB', 'CTR', 'GCM'].indexOf(mode) !== -1); + var trail = this.decoder.end(); + if (trail) + resStr += trail; - // do key expansion - this._w = _expandKey(key, options.decrypt && !encryptOp); - this._init = true; -}; + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; + } -/** - * Expands a key. Typically only used for testing. - * - * @param key the symmetric key to expand, as an array of 32-bit words. - * @param decrypt true to expand for decryption, false for encryption. - * - * @return the expanded key. - */ -forge.aes._expandKey = function(key, decrypt) { - if(!init) { - initialize(); - } - return _expandKey(key, decrypt); + return this.decoder.end(); }; -/** - * Updates a single block. Typically only used for testing. - * - * @param w the expanded key to use. - * @param input an array of block-size 32-bit words. - * @param output an array of block-size 32-bit words. - * @param decrypt true to decrypt, false to encrypt. - */ -forge.aes._updateBlock = _updateBlock; - -/** Register AES algorithms **/ +function detectEncoding(bufs, defaultEncoding) { + var b = []; + var charsProcessed = 0; + var invalidLE = 0, invalidBE = 0; // Number of invalid chars when decoded as LE or BE. + var bmpCharsLE = 0, bmpCharsBE = 0; // Number of BMP chars when decoded as LE or BE. -registerAlgorithm('AES-ECB', forge.cipher.modes.ecb); -registerAlgorithm('AES-CBC', forge.cipher.modes.cbc); -registerAlgorithm('AES-CFB', forge.cipher.modes.cfb); -registerAlgorithm('AES-OFB', forge.cipher.modes.ofb); -registerAlgorithm('AES-CTR', forge.cipher.modes.ctr); -registerAlgorithm('AES-GCM', forge.cipher.modes.gcm); + outer_loop: + for (var i = 0; i < bufs.length; i++) { + var buf = bufs[i]; + for (var j = 0; j < buf.length; j++) { + b.push(buf[j]); + if (b.length === 4) { + if (charsProcessed === 0) { + // Check BOM first. + if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { + return 'utf-32le'; + } + if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { + return 'utf-32be'; + } + } -function registerAlgorithm(name, mode) { - var factory = function() { - return new forge.aes.Algorithm(name, mode); - }; - forge.cipher.registerAlgorithm(name, factory); -} + if (b[0] !== 0 || b[1] > 0x10) invalidBE++; + if (b[3] !== 0 || b[2] > 0x10) invalidLE++; -/** AES implementation **/ + if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++; + if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++; -var init = false; // not yet initialized -var Nb = 4; // number of words comprising the state (AES = 4) -var sbox; // non-linear substitution table used in key expansion -var isbox; // inversion of sbox -var rcon; // round constant word array -var mix; // mix-columns table -var imix; // inverse mix-columns table + b.length = 0; + charsProcessed++; -/** - * Performs initialization, ie: precomputes tables to optimize for speed. - * - * One way to understand how AES works is to imagine that 'addition' and - * 'multiplication' are interfaces that require certain mathematical - * properties to hold true (ie: they are associative) but they might have - * different implementations and produce different kinds of results ... - * provided that their mathematical properties remain true. AES defines - * its own methods of addition and multiplication but keeps some important - * properties the same, ie: associativity and distributivity. The - * explanation below tries to shed some light on how AES defines addition - * and multiplication of bytes and 32-bit words in order to perform its - * encryption and decryption algorithms. - * - * The basics: - * - * The AES algorithm views bytes as binary representations of polynomials - * that have either 1 or 0 as the coefficients. It defines the addition - * or subtraction of two bytes as the XOR operation. It also defines the - * multiplication of two bytes as a finite field referred to as GF(2^8) - * (Note: 'GF' means "Galois Field" which is a field that contains a finite - * number of elements so GF(2^8) has 256 elements). - * - * This means that any two bytes can be represented as binary polynomials; - * when they multiplied together and modularly reduced by an irreducible - * polynomial of the 8th degree, the results are the field GF(2^8). The - * specific irreducible polynomial that AES uses in hexadecimal is 0x11b. - * This multiplication is associative with 0x01 as the identity: - * - * (b * 0x01 = GF(b, 0x01) = b). - * - * The operation GF(b, 0x02) can be performed at the byte level by left - * shifting b once and then XOR'ing it (to perform the modular reduction) - * with 0x11b if b is >= 128. Repeated application of the multiplication - * of 0x02 can be used to implement the multiplication of any two bytes. - * - * For instance, multiplying 0x57 and 0x13, denoted as GF(0x57, 0x13), can - * be performed by factoring 0x13 into 0x01, 0x02, and 0x10. Then these - * factors can each be multiplied by 0x57 and then added together. To do - * the multiplication, values for 0x57 multiplied by each of these 3 factors - * can be precomputed and stored in a table. To add them, the values from - * the table are XOR'd together. - * - * AES also defines addition and multiplication of words, that is 4-byte - * numbers represented as polynomials of 3 degrees where the coefficients - * are the values of the bytes. - * - * The word [a0, a1, a2, a3] is a polynomial a3x^3 + a2x^2 + a1x + a0. - * - * Addition is performed by XOR'ing like powers of x. Multiplication - * is performed in two steps, the first is an algebriac expansion as - * you would do normally (where addition is XOR). But the result is - * a polynomial larger than 3 degrees and thus it cannot fit in a word. So - * next the result is modularly reduced by an AES-specific polynomial of - * degree 4 which will always produce a polynomial of less than 4 degrees - * such that it will fit in a word. In AES, this polynomial is x^4 + 1. - * - * The modular product of two polynomials 'a' and 'b' is thus: - * - * d(x) = d3x^3 + d2x^2 + d1x + d0 - * with - * d0 = GF(a0, b0) ^ GF(a3, b1) ^ GF(a2, b2) ^ GF(a1, b3) - * d1 = GF(a1, b0) ^ GF(a0, b1) ^ GF(a3, b2) ^ GF(a2, b3) - * d2 = GF(a2, b0) ^ GF(a1, b1) ^ GF(a0, b2) ^ GF(a3, b3) - * d3 = GF(a3, b0) ^ GF(a2, b1) ^ GF(a1, b2) ^ GF(a0, b3) - * - * As a matrix: - * - * [d0] = [a0 a3 a2 a1][b0] - * [d1] [a1 a0 a3 a2][b1] - * [d2] [a2 a1 a0 a3][b2] - * [d3] [a3 a2 a1 a0][b3] - * - * Special polynomials defined by AES (0x02 == {02}): - * a(x) = {03}x^3 + {01}x^2 + {01}x + {02} - * a^-1(x) = {0b}x^3 + {0d}x^2 + {09}x + {0e}. - * - * These polynomials are used in the MixColumns() and InverseMixColumns() - * operations, respectively, to cause each element in the state to affect - * the output (referred to as diffusing). - * - * RotWord() uses: a0 = a1 = a2 = {00} and a3 = {01}, which is the - * polynomial x3. - * - * The ShiftRows() method modifies the last 3 rows in the state (where - * the state is 4 words with 4 bytes per word) by shifting bytes cyclically. - * The 1st byte in the second row is moved to the end of the row. The 1st - * and 2nd bytes in the third row are moved to the end of the row. The 1st, - * 2nd, and 3rd bytes are moved in the fourth row. - * - * More details on how AES arithmetic works: - * - * In the polynomial representation of binary numbers, XOR performs addition - * and subtraction and multiplication in GF(2^8) denoted as GF(a, b) - * corresponds with the multiplication of polynomials modulo an irreducible - * polynomial of degree 8. In other words, for AES, GF(a, b) will multiply - * polynomial 'a' with polynomial 'b' and then do a modular reduction by - * an AES-specific irreducible polynomial of degree 8. - * - * A polynomial is irreducible if its only divisors are one and itself. For - * the AES algorithm, this irreducible polynomial is: - * - * m(x) = x^8 + x^4 + x^3 + x + 1, - * - * or {01}{1b} in hexadecimal notation, where each coefficient is a bit: - * 100011011 = 283 = 0x11b. - * - * For example, GF(0x57, 0x83) = 0xc1 because - * - * 0x57 = 87 = 01010111 = x^6 + x^4 + x^2 + x + 1 - * 0x85 = 131 = 10000101 = x^7 + x + 1 - * - * (x^6 + x^4 + x^2 + x + 1) * (x^7 + x + 1) - * = x^13 + x^11 + x^9 + x^8 + x^7 + - * x^7 + x^5 + x^3 + x^2 + x + - * x^6 + x^4 + x^2 + x + 1 - * = x^13 + x^11 + x^9 + x^8 + x^6 + x^5 + x^4 + x^3 + 1 = y - * y modulo (x^8 + x^4 + x^3 + x + 1) - * = x^7 + x^6 + 1. - * - * The modular reduction by m(x) guarantees the result will be a binary - * polynomial of less than degree 8, so that it can fit in a byte. - * - * The operation to multiply a binary polynomial b with x (the polynomial - * x in binary representation is 00000010) is: - * - * b_7x^8 + b_6x^7 + b_5x^6 + b_4x^5 + b_3x^4 + b_2x^3 + b_1x^2 + b_0x^1 - * - * To get GF(b, x) we must reduce that by m(x). If b_7 is 0 (that is the - * most significant bit is 0 in b) then the result is already reduced. If - * it is 1, then we can reduce it by subtracting m(x) via an XOR. - * - * It follows that multiplication by x (00000010 or 0x02) can be implemented - * by performing a left shift followed by a conditional bitwise XOR with - * 0x1b. This operation on bytes is denoted by xtime(). Multiplication by - * higher powers of x can be implemented by repeated application of xtime(). - * - * By adding intermediate results, multiplication by any constant can be - * implemented. For instance: - * - * GF(0x57, 0x13) = 0xfe because: - * - * xtime(b) = (b & 128) ? (b << 1 ^ 0x11b) : (b << 1) - * - * Note: We XOR with 0x11b instead of 0x1b because in javascript our - * datatype for b can be larger than 1 byte, so a left shift will not - * automatically eliminate bits that overflow a byte ... by XOR'ing the - * overflow bit with 1 (the extra one from 0x11b) we zero it out. - * - * GF(0x57, 0x02) = xtime(0x57) = 0xae - * GF(0x57, 0x04) = xtime(0xae) = 0x47 - * GF(0x57, 0x08) = xtime(0x47) = 0x8e - * GF(0x57, 0x10) = xtime(0x8e) = 0x07 - * - * GF(0x57, 0x13) = GF(0x57, (0x01 ^ 0x02 ^ 0x10)) - * - * And by the distributive property (since XOR is addition and GF() is - * multiplication): - * - * = GF(0x57, 0x01) ^ GF(0x57, 0x02) ^ GF(0x57, 0x10) - * = 0x57 ^ 0xae ^ 0x07 - * = 0xfe. - */ -function initialize() { - init = true; + if (charsProcessed >= 100) { + break outer_loop; + } + } + } + } - /* Populate the Rcon table. These are the values given by - [x^(i-1),{00},{00},{00}] where x^(i-1) are powers of x (and x = 0x02) - in the field of GF(2^8), where i starts at 1. + // Make decisions. + if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return 'utf-32be'; + if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return 'utf-32le'; - rcon[0] = [0x00, 0x00, 0x00, 0x00] - rcon[1] = [0x01, 0x00, 0x00, 0x00] 2^(1-1) = 2^0 = 1 - rcon[2] = [0x02, 0x00, 0x00, 0x00] 2^(2-1) = 2^1 = 2 - ... - rcon[9] = [0x1B, 0x00, 0x00, 0x00] 2^(9-1) = 2^8 = 0x1B - rcon[10] = [0x36, 0x00, 0x00, 0x00] 2^(10-1) = 2^9 = 0x36 + // Couldn't decide (likely all zeros or not enough data). + return defaultEncoding || 'utf-32le'; +} - We only store the first byte because it is the only one used. - */ - rcon = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1B, 0x36]; - // compute xtime table which maps i onto GF(i, 0x02) - var xtime = new Array(256); - for(var i = 0; i < 128; ++i) { - xtime[i] = i << 1; - xtime[i + 128] = (i + 128) << 1 ^ 0x11B; - } +/***/ }), - // compute all other tables - sbox = new Array(256); - isbox = new Array(256); - mix = new Array(4); - imix = new Array(4); - for(var i = 0; i < 4; ++i) { - mix[i] = new Array(256); - imix[i] = new Array(256); - } - var e = 0, ei = 0, e2, e4, e8, sx, sx2, me, ime; - for(var i = 0; i < 256; ++i) { - /* We need to generate the SubBytes() sbox and isbox tables so that - we can perform byte substitutions. This requires us to traverse - all of the elements in GF, find their multiplicative inverses, - and apply to each the following affine transformation: +/***/ 91081: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - bi' = bi ^ b(i + 4) mod 8 ^ b(i + 5) mod 8 ^ b(i + 6) mod 8 ^ - b(i + 7) mod 8 ^ ci - for 0 <= i < 8, where bi is the ith bit of the byte, and ci is the - ith bit of a byte c with the value {63} or {01100011}. - It is possible to traverse every possible value in a Galois field - using what is referred to as a 'generator'. There are many - generators (128 out of 256): 3,5,6,9,11,82 to name a few. To fully - traverse GF we iterate 255 times, multiplying by our generator - each time. +var Buffer = (__nccwpck_require__(17120).Buffer); - On each iteration we can determine the multiplicative inverse for - the current element. +// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 +// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 - Suppose there is an element in GF 'e'. For a given generator 'g', - e = g^x. The multiplicative inverse of e is g^(255 - x). It turns - out that if use the inverse of a generator as another generator - it will produce all of the corresponding multiplicative inverses - at the same time. For this reason, we choose 5 as our inverse - generator because it only requires 2 multiplies and 1 add and its - inverse, 82, requires relatively few operations as well. +exports.utf7 = Utf7Codec; +exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7 +function Utf7Codec(codecOptions, iconv) { + this.iconv = iconv; +}; - In order to apply the affine transformation, the multiplicative - inverse 'ei' of 'e' can be repeatedly XOR'd (4 times) with a - bit-cycling of 'ei'. To do this 'ei' is first stored in 's' and - 'x'. Then 's' is left shifted and the high bit of 's' is made the - low bit. The resulting value is stored in 's'. Then 'x' is XOR'd - with 's' and stored in 'x'. On each subsequent iteration the same - operation is performed. When 4 iterations are complete, 'x' is - XOR'd with 'c' (0x63) and the transformed value is stored in 'x'. - For example: +Utf7Codec.prototype.encoder = Utf7Encoder; +Utf7Codec.prototype.decoder = Utf7Decoder; +Utf7Codec.prototype.bomAware = true; - s = 01000001 - x = 01000001 - iteration 1: s = 10000010, x ^= s - iteration 2: s = 00000101, x ^= s - iteration 3: s = 00001010, x ^= s - iteration 4: s = 00010100, x ^= s - x ^= 0x63 +// -- Encoding - This can be done with a loop where s = (s << 1) | (s >> 7). However, - it can also be done by using a single 16-bit (in this case 32-bit) - number 'sx'. Since XOR is an associative operation, we can set 'sx' - to 'ei' and then XOR it with 'sx' left-shifted 1,2,3, and 4 times. - The most significant bits will flow into the high 8 bit positions - and be correctly XOR'd with one another. All that remains will be - to cycle the high 8 bits by XOR'ing them all with the lower 8 bits - afterwards. +var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; - At the same time we're populating sbox and isbox we can precompute - the multiplication we'll need to do to do MixColumns() later. - */ +function Utf7Encoder(options, codec) { + this.iconv = codec.iconv; +} - // apply affine transformation - sx = ei ^ (ei << 1) ^ (ei << 2) ^ (ei << 3) ^ (ei << 4); - sx = (sx >> 8) ^ (sx & 255) ^ 0x63; +Utf7Encoder.prototype.write = function(str) { + // Naive implementation. + // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". + return Buffer.from(str.replace(nonDirectChars, function(chunk) { + return "+" + (chunk === '+' ? '' : + this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) + + "-"; + }.bind(this))); +} - // update tables - sbox[e] = sx; - isbox[sx] = e; +Utf7Encoder.prototype.end = function() { +} - /* Mixing columns is done using matrix multiplication. The columns - that are to be mixed are each a single word in the current state. - The state has Nb columns (4 columns). Therefore each column is a - 4 byte word. So to mix the columns in a single column 'c' where - its rows are r0, r1, r2, and r3, we use the following matrix - multiplication: - [2 3 1 1]*[r0,c]=[r'0,c] - [1 2 3 1] [r1,c] [r'1,c] - [1 1 2 3] [r2,c] [r'2,c] - [3 1 1 2] [r3,c] [r'3,c] +// -- Decoding - r0, r1, r2, and r3 are each 1 byte of one of the words in the - state (a column). To do matrix multiplication for each mixed - column c' we multiply the corresponding row from the left matrix - with the corresponding column from the right matrix. In total, we - get 4 equations: +function Utf7Decoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = ''; +} - r0,c' = 2*r0,c + 3*r1,c + 1*r2,c + 1*r3,c - r1,c' = 1*r0,c + 2*r1,c + 3*r2,c + 1*r3,c - r2,c' = 1*r0,c + 1*r1,c + 2*r2,c + 3*r3,c - r3,c' = 3*r0,c + 1*r1,c + 1*r2,c + 2*r3,c +var base64Regex = /[A-Za-z0-9\/+]/; +var base64Chars = []; +for (var i = 0; i < 256; i++) + base64Chars[i] = base64Regex.test(String.fromCharCode(i)); - As usual, the multiplication is as previously defined and the - addition is XOR. In order to optimize mixing columns we can store - the multiplication results in tables. If you think of the whole - column as a word (it might help to visualize by mentally rotating - the equations above by counterclockwise 90 degrees) then you can - see that it would be useful to map the multiplications performed on - each byte (r0, r1, r2, r3) onto a word as well. For instance, we - could map 2*r0,1*r0,1*r0,3*r0 onto a word by storing 2*r0 in the - highest 8 bits and 3*r0 in the lowest 8 bits (with the other two - respectively in the middle). This means that a table can be - constructed that uses r0 as an index to the word. We can do the - same with r1, r2, and r3, creating a total of 4 tables. +var plusChar = '+'.charCodeAt(0), + minusChar = '-'.charCodeAt(0), + andChar = '&'.charCodeAt(0); - To construct a full c', we can just look up each byte of c in - their respective tables and XOR the results together. +Utf7Decoder.prototype.write = function(buf) { + var res = "", lastI = 0, + inBase64 = this.inBase64, + base64Accum = this.base64Accum; - Also, to build each table we only have to calculate the word - for 2,1,1,3 for every byte ... which we can do on each iteration - of this loop since we will iterate over every byte. After we have - calculated 2,1,1,3 we can get the results for the other tables - by cycling the byte at the end to the beginning. For instance - we can take the result of table 2,1,1,3 and produce table 3,2,1,1 - by moving the right most byte to the left most position just like - how you can imagine the 3 moved out of 2,1,1,3 and to the front - to produce 3,2,1,1. + // The decoder is more involved as we must handle chunks in stream. - There is another optimization in that the same multiples of - the current element we need in order to advance our generator - to the next iteration can be reused in performing the 2,1,1,3 - calculation. We also calculate the inverse mix column tables, - with e,9,d,b being the inverse of 2,1,1,3. + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '+' + if (buf[i] == plusChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. + lastI = i+1; + inBase64 = true; + } + } else { // We decode base64. + if (!base64Chars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" + res += "+"; + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii"); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } - When we're done, and we need to actually mix columns, the first - byte of each state word should be put through mix[0] (2,1,1,3), - the second through mix[1] (3,2,1,1) and so forth. Then they should - be XOR'd together to produce the fully mixed column. - */ + if (buf[i] != minusChar) // Minus is absorbed after base64. + i--; - // calculate mix and imix table values - sx2 = xtime[sx]; - e2 = xtime[e]; - e4 = xtime[e2]; - e8 = xtime[e4]; - me = - (sx2 << 24) ^ // 2 - (sx << 16) ^ // 1 - (sx << 8) ^ // 1 - (sx ^ sx2); // 3 - ime = - (e2 ^ e4 ^ e8) << 24 ^ // E (14) - (e ^ e8) << 16 ^ // 9 - (e ^ e4 ^ e8) << 8 ^ // D (13) - (e ^ e2 ^ e8); // B (11) - // produce each of the mix tables by rotating the 2,1,1,3 value - for(var n = 0; n < 4; ++n) { - mix[n][e] = me; - imix[n][sx] = ime; - // cycle the right most byte to the left most position - // ie: 2,1,1,3 becomes 3,2,1,1 - me = me << 24 | me >>> 8; - ime = ime << 24 | ime >>> 8; + lastI = i+1; + inBase64 = false; + base64Accum = ''; + } + } } - // get next element and inverse - if(e === 0) { - // 1 is the inverse of 1 - e = ei = 1; + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. } else { - // e = 2e + 2*2*2*(10e)) = multiply e by 82 (chosen generator) - // ei = ei + 2*2*ei = multiply ei by 5 (inverse generator) - e = e2 ^ xtime[xtime[xtime[e2 ^ e8]]]; - ei ^= xtime[xtime[ei]]; + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii"); + + var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded); + + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } - } + + this.inBase64 = inBase64; + this.base64Accum = base64Accum; + + return res; } -/** - * Generates a key schedule using the AES key expansion algorithm. - * - * The AES algorithm takes the Cipher Key, K, and performs a Key Expansion - * routine to generate a key schedule. The Key Expansion generates a total - * of Nb*(Nr + 1) words: the algorithm requires an initial set of Nb words, - * and each of the Nr rounds requires Nb words of key data. The resulting - * key schedule consists of a linear array of 4-byte words, denoted [wi ], - * with i in the range 0 <= i < Nb(Nr + 1). - * - * KeyExpansion(byte key[4*Nk], word w[Nb*(Nr+1)], Nk) - * AES-128 (Nb=4, Nk=4, Nr=10) - * AES-192 (Nb=4, Nk=6, Nr=12) - * AES-256 (Nb=4, Nk=8, Nr=14) - * Note: Nr=Nk+6. - * - * Nb is the number of columns (32-bit words) comprising the State (or - * number of bytes in a block). For AES, Nb=4. - * - * @param key the key to schedule (as an array of 32-bit words). - * @param decrypt true to modify the key schedule to decrypt, false not to. - * - * @return the generated key schedule. - */ -function _expandKey(key, decrypt) { - // copy the key's words to initialize the key schedule - var w = key.slice(0); +Utf7Decoder.prototype.end = function() { + var res = ""; + if (this.inBase64 && this.base64Accum.length > 0) + res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); - /* RotWord() will rotate a word, moving the first byte to the last - byte's position (shifting the other bytes left). + this.inBase64 = false; + this.base64Accum = ''; + return res; +} - We will be getting the value of Rcon at i / Nk. 'i' will iterate - from Nk to (Nb * Nr+1). Nk = 4 (4 byte key), Nb = 4 (4 words in - a block), Nr = Nk + 6 (10). Therefore 'i' will iterate from - 4 to 44 (exclusive). Each time we iterate 4 times, i / Nk will - increase by 1. We use a counter iNk to keep track of this. - */ - // go through the rounds expanding the key - var temp, iNk = 1; - var Nk = w.length; - var Nr1 = Nk + 6 + 1; - var end = Nb * Nr1; - for(var i = Nk; i < end; ++i) { - temp = w[i - 1]; - if(i % Nk === 0) { - // temp = SubWord(RotWord(temp)) ^ Rcon[i / Nk] - temp = - sbox[temp >>> 16 & 255] << 24 ^ - sbox[temp >>> 8 & 255] << 16 ^ - sbox[temp & 255] << 8 ^ - sbox[temp >>> 24] ^ (rcon[iNk] << 24); - iNk++; - } else if(Nk > 6 && (i % Nk === 4)) { - // temp = SubWord(temp) - temp = - sbox[temp >>> 24] << 24 ^ - sbox[temp >>> 16 & 255] << 16 ^ - sbox[temp >>> 8 & 255] << 8 ^ - sbox[temp & 255]; - } - w[i] = w[i - Nk] ^ temp; - } +// UTF-7-IMAP codec. +// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) +// Differences: +// * Base64 part is started by "&" instead of "+" +// * Direct characters are 0x20-0x7E, except "&" (0x26) +// * In Base64, "," is used instead of "/" +// * Base64 must not be used to represent direct characters. +// * No implicit shift back from Base64 (should always end with '-') +// * String must end in non-shifted position. +// * "-&" while in base64 is not allowed. - /* When we are updating a cipher block we always use the code path for - encryption whether we are decrypting or not (to shorten code and - simplify the generation of look up tables). However, because there - are differences in the decryption algorithm, other than just swapping - in different look up tables, we must transform our key schedule to - account for these changes: - 1. The decryption algorithm gets its key rounds in reverse order. - 2. The decryption algorithm adds the round key before mixing columns - instead of afterwards. +exports.utf7imap = Utf7IMAPCodec; +function Utf7IMAPCodec(codecOptions, iconv) { + this.iconv = iconv; +}; - We don't need to modify our key schedule to handle the first case, - we can just traverse the key schedule in reverse order when decrypting. +Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder; +Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder; +Utf7IMAPCodec.prototype.bomAware = true; - The second case requires a little work. - The tables we built for performing rounds will take an input and then - perform SubBytes() and MixColumns() or, for the decrypt version, - InvSubBytes() and InvMixColumns(). But the decrypt algorithm requires - us to AddRoundKey() before InvMixColumns(). This means we'll need to - apply some transformations to the round key to inverse-mix its columns - so they'll be correct for moving AddRoundKey() to after the state has - had its columns inverse-mixed. +// -- Encoding - To inverse-mix the columns of the state when we're decrypting we use a - lookup table that will apply InvSubBytes() and InvMixColumns() at the - same time. However, the round key's bytes are not inverse-substituted - in the decryption algorithm. To get around this problem, we can first - substitute the bytes in the round key so that when we apply the - transformation via the InvSubBytes()+InvMixColumns() table, it will - undo our substitution leaving us with the original value that we - want -- and then inverse-mix that value. +function Utf7IMAPEncoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = Buffer.alloc(6); + this.base64AccumIdx = 0; +} - This change will correctly alter our key schedule so that we can XOR - each round key with our already transformed decryption state. This - allows us to use the same code path as the encryption algorithm. +Utf7IMAPEncoder.prototype.write = function(str) { + var inBase64 = this.inBase64, + base64Accum = this.base64Accum, + base64AccumIdx = this.base64AccumIdx, + buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0; - We make one more change to the decryption key. Since the decryption - algorithm runs in reverse from the encryption algorithm, we reverse - the order of the round keys to avoid having to iterate over the key - schedule backwards when running the encryption algorithm later in - decryption mode. In addition to reversing the order of the round keys, - we also swap each round key's 2nd and 4th rows. See the comments - section where rounds are performed for more details about why this is - done. These changes are done inline with the other substitution - described above. - */ - if(decrypt) { - var tmp; - var m0 = imix[0]; - var m1 = imix[1]; - var m2 = imix[2]; - var m3 = imix[3]; - var wnew = w.slice(0); - end = w.length; - for(var i = 0, wi = end - Nb; i < end; i += Nb, wi -= Nb) { - // do not sub the first or last round key (round keys are Nb - // words) as no column mixing is performed before they are added, - // but do change the key order - if(i === 0 || i === (end - Nb)) { - wnew[i] = w[wi]; - wnew[i + 1] = w[wi + 3]; - wnew[i + 2] = w[wi + 2]; - wnew[i + 3] = w[wi + 1]; - } else { - // substitute each round key byte because the inverse-mix - // table will inverse-substitute it (effectively cancel the - // substitution because round key bytes aren't sub'd in - // decryption mode) and swap indexes 3 and 1 - for(var n = 0; n < Nb; ++n) { - tmp = w[wi + n]; - wnew[i + (3&-n)] = - m0[sbox[tmp >>> 24]] ^ - m1[sbox[tmp >>> 16 & 255]] ^ - m2[sbox[tmp >>> 8 & 255]] ^ - m3[sbox[tmp & 255]]; + for (var i = 0; i < str.length; i++) { + var uChar = str.charCodeAt(i); + if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'. + if (inBase64) { + if (base64AccumIdx > 0) { + bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); + base64AccumIdx = 0; + } + + buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. + inBase64 = false; + } + + if (!inBase64) { + buf[bufIdx++] = uChar; // Write direct character + + if (uChar === andChar) // Ampersand -> '&-' + buf[bufIdx++] = minusChar; + } + + } else { // Non-direct character + if (!inBase64) { + buf[bufIdx++] = andChar; // Write '&', then go to base64 mode. + inBase64 = true; + } + if (inBase64) { + base64Accum[base64AccumIdx++] = uChar >> 8; + base64Accum[base64AccumIdx++] = uChar & 0xFF; + + if (base64AccumIdx == base64Accum.length) { + bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx); + base64AccumIdx = 0; + } + } } - } } - w = wnew; - } - return w; + this.inBase64 = inBase64; + this.base64AccumIdx = base64AccumIdx; + + return buf.slice(0, bufIdx); } -/** - * Updates a single block (16 bytes) using AES. The update will either - * encrypt or decrypt the block. - * - * @param w the key schedule. - * @param input the input block (an array of 32-bit words). - * @param output the updated output block. - * @param decrypt true to decrypt the block, false to encrypt it. - */ -function _updateBlock(w, input, output, decrypt) { - /* - Cipher(byte in[4*Nb], byte out[4*Nb], word w[Nb*(Nr+1)]) - begin - byte state[4,Nb] - state = in - AddRoundKey(state, w[0, Nb-1]) - for round = 1 step 1 to Nr-1 - SubBytes(state) - ShiftRows(state) - MixColumns(state) - AddRoundKey(state, w[round*Nb, (round+1)*Nb-1]) - end for - SubBytes(state) - ShiftRows(state) - AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) - out = state - end +Utf7IMAPEncoder.prototype.end = function() { + var buf = Buffer.alloc(10), bufIdx = 0; + if (this.inBase64) { + if (this.base64AccumIdx > 0) { + bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); + this.base64AccumIdx = 0; + } - InvCipher(byte in[4*Nb], byte out[4*Nb], word w[Nb*(Nr+1)]) - begin - byte state[4,Nb] - state = in - AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) - for round = Nr-1 step -1 downto 1 - InvShiftRows(state) - InvSubBytes(state) - AddRoundKey(state, w[round*Nb, (round+1)*Nb-1]) - InvMixColumns(state) - end for - InvShiftRows(state) - InvSubBytes(state) - AddRoundKey(state, w[0, Nb-1]) - out = state - end - */ + buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. + this.inBase64 = false; + } - // Encrypt: AddRoundKey(state, w[0, Nb-1]) - // Decrypt: AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) - var Nr = w.length / 4 - 1; - var m0, m1, m2, m3, sub; - if(decrypt) { - m0 = imix[0]; - m1 = imix[1]; - m2 = imix[2]; - m3 = imix[3]; - sub = isbox; - } else { - m0 = mix[0]; - m1 = mix[1]; - m2 = mix[2]; - m3 = mix[3]; - sub = sbox; - } - var a, b, c, d, a2, b2, c2; - a = input[0] ^ w[0]; - b = input[decrypt ? 3 : 1] ^ w[1]; - c = input[2] ^ w[2]; - d = input[decrypt ? 1 : 3] ^ w[3]; - var i = 3; + return buf.slice(0, bufIdx); +} - /* In order to share code we follow the encryption algorithm when both - encrypting and decrypting. To account for the changes required in the - decryption algorithm, we use different lookup tables when decrypting - and use a modified key schedule to account for the difference in the - order of transformations applied when performing rounds. We also get - key rounds in reverse order (relative to encryption). */ - for(var round = 1; round < Nr; ++round) { - /* As described above, we'll be using table lookups to perform the - column mixing. Each column is stored as a word in the state (the - array 'input' has one column as a word at each index). In order to - mix a column, we perform these transformations on each row in c, - which is 1 byte in each word. The new column for c0 is c'0: - m0 m1 m2 m3 - r0,c'0 = 2*r0,c0 + 3*r1,c0 + 1*r2,c0 + 1*r3,c0 - r1,c'0 = 1*r0,c0 + 2*r1,c0 + 3*r2,c0 + 1*r3,c0 - r2,c'0 = 1*r0,c0 + 1*r1,c0 + 2*r2,c0 + 3*r3,c0 - r3,c'0 = 3*r0,c0 + 1*r1,c0 + 1*r2,c0 + 2*r3,c0 +// -- Decoding - So using mix tables where c0 is a word with r0 being its upper - 8 bits and r3 being its lower 8 bits: +function Utf7IMAPDecoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = ''; +} - m0[c0 >> 24] will yield this word: [2*r0,1*r0,1*r0,3*r0] - ... - m3[c0 & 255] will yield this word: [1*r3,1*r3,3*r3,2*r3] +var base64IMAPChars = base64Chars.slice(); +base64IMAPChars[','.charCodeAt(0)] = true; - Therefore to mix the columns in each word in the state we - do the following (& 255 omitted for brevity): - c'0,r0 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] - c'0,r1 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] - c'0,r2 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] - c'0,r3 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] +Utf7IMAPDecoder.prototype.write = function(buf) { + var res = "", lastI = 0, + inBase64 = this.inBase64, + base64Accum = this.base64Accum; - However, before mixing, the algorithm requires us to perform - ShiftRows(). The ShiftRows() transformation cyclically shifts the - last 3 rows of the state over different offsets. The first row - (r = 0) is not shifted. + // The decoder is more involved as we must handle chunks in stream. + // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). - s'_r,c = s_r,(c + shift(r, Nb) mod Nb - for 0 < r < 4 and 0 <= c < Nb and - shift(1, 4) = 1 - shift(2, 4) = 2 - shift(3, 4) = 3. + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '&' + if (buf[i] == andChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. + lastI = i+1; + inBase64 = true; + } + } else { // We decode base64. + if (!base64IMAPChars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" + res += "&"; + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, '/'); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } - This causes the first byte in r = 1 to be moved to the end of - the row, the first 2 bytes in r = 2 to be moved to the end of - the row, the first 3 bytes in r = 3 to be moved to the end of - the row: + if (buf[i] != minusChar) // Minus may be absorbed after base64. + i--; - r1: [c0 c1 c2 c3] => [c1 c2 c3 c0] - r2: [c0 c1 c2 c3] [c2 c3 c0 c1] - r3: [c0 c1 c2 c3] [c3 c0 c1 c2] + lastI = i+1; + inBase64 = false; + base64Accum = ''; + } + } + } - We can make these substitutions inline with our column mixing to - generate an updated set of equations to produce each word in the - state (note the columns have changed positions): + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, '/'); - c0 c1 c2 c3 => c0 c1 c2 c3 - c0 c1 c2 c3 c1 c2 c3 c0 (cycled 1 byte) - c0 c1 c2 c3 c2 c3 c0 c1 (cycled 2 bytes) - c0 c1 c2 c3 c3 c0 c1 c2 (cycled 3 bytes) + var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded); - Therefore: + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } - c'0 = 2*r0,c0 + 3*r1,c1 + 1*r2,c2 + 1*r3,c3 - c'0 = 1*r0,c0 + 2*r1,c1 + 3*r2,c2 + 1*r3,c3 - c'0 = 1*r0,c0 + 1*r1,c1 + 2*r2,c2 + 3*r3,c3 - c'0 = 3*r0,c0 + 1*r1,c1 + 1*r2,c2 + 2*r3,c3 + this.inBase64 = inBase64; + this.base64Accum = base64Accum; - c'1 = 2*r0,c1 + 3*r1,c2 + 1*r2,c3 + 1*r3,c0 - c'1 = 1*r0,c1 + 2*r1,c2 + 3*r2,c3 + 1*r3,c0 - c'1 = 1*r0,c1 + 1*r1,c2 + 2*r2,c3 + 3*r3,c0 - c'1 = 3*r0,c1 + 1*r1,c2 + 1*r2,c3 + 2*r3,c0 + return res; +} - ... and so forth for c'2 and c'3. The important distinction is - that the columns are cycling, with c0 being used with the m0 - map when calculating c0, but c1 being used with the m0 map when - calculating c1 ... and so forth. +Utf7IMAPDecoder.prototype.end = function() { + var res = ""; + if (this.inBase64 && this.base64Accum.length > 0) + res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); - When performing the inverse we transform the mirror image and - skip the bottom row, instead of the top one, and move upwards: + this.inBase64 = false; + this.base64Accum = ''; + return res; +} - c3 c2 c1 c0 => c0 c3 c2 c1 (cycled 3 bytes) *same as encryption - c3 c2 c1 c0 c1 c0 c3 c2 (cycled 2 bytes) - c3 c2 c1 c0 c2 c1 c0 c3 (cycled 1 byte) *same as encryption - c3 c2 c1 c0 c3 c2 c1 c0 - If you compare the resulting matrices for ShiftRows()+MixColumns() - and for InvShiftRows()+InvMixColumns() the 2nd and 4th columns are - different (in encrypt mode vs. decrypt mode). So in order to use - the same code to handle both encryption and decryption, we will - need to do some mapping. - If in encryption mode we let a=c0, b=c1, c=c2, d=c3, and r be - a row number in the state, then the resulting matrix in encryption - mode for applying the above transformations would be: - r1: a b c d - r2: b c d a - r3: c d a b - r4: d a b c +/***/ }), - If we did the same in decryption mode we would get: +/***/ 6738: +/***/ ((__unused_webpack_module, exports) => { - r1: a d c b - r2: b a d c - r3: c b a d - r4: d c b a - If instead we swap d and b (set b=c3 and d=c1), then we get: - r1: a b c d - r2: d a b c - r3: c d a b - r4: b c d a +var BOMChar = '\uFEFF'; - Now the 1st and 3rd rows are the same as the encryption matrix. All - we need to do then to make the mapping exactly the same is to swap - the 2nd and 4th rows when in decryption mode. To do this without - having to do it on each iteration, we swapped the 2nd and 4th rows - in the decryption key schedule. We also have to do the swap above - when we first pull in the input and when we set the final output. */ - a2 = - m0[a >>> 24] ^ - m1[b >>> 16 & 255] ^ - m2[c >>> 8 & 255] ^ - m3[d & 255] ^ w[++i]; - b2 = - m0[b >>> 24] ^ - m1[c >>> 16 & 255] ^ - m2[d >>> 8 & 255] ^ - m3[a & 255] ^ w[++i]; - c2 = - m0[c >>> 24] ^ - m1[d >>> 16 & 255] ^ - m2[a >>> 8 & 255] ^ - m3[b & 255] ^ w[++i]; - d = - m0[d >>> 24] ^ - m1[a >>> 16 & 255] ^ - m2[b >>> 8 & 255] ^ - m3[c & 255] ^ w[++i]; - a = a2; - b = b2; - c = c2; - } +exports.PrependBOM = PrependBOMWrapper +function PrependBOMWrapper(encoder, options) { + this.encoder = encoder; + this.addBOM = true; +} - /* - Encrypt: - SubBytes(state) - ShiftRows(state) - AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) +PrependBOMWrapper.prototype.write = function(str) { + if (this.addBOM) { + str = BOMChar + str; + this.addBOM = false; + } - Decrypt: - InvShiftRows(state) - InvSubBytes(state) - AddRoundKey(state, w[0, Nb-1]) - */ - // Note: rows are shifted inline - output[0] = - (sub[a >>> 24] << 24) ^ - (sub[b >>> 16 & 255] << 16) ^ - (sub[c >>> 8 & 255] << 8) ^ - (sub[d & 255]) ^ w[++i]; - output[decrypt ? 3 : 1] = - (sub[b >>> 24] << 24) ^ - (sub[c >>> 16 & 255] << 16) ^ - (sub[d >>> 8 & 255] << 8) ^ - (sub[a & 255]) ^ w[++i]; - output[2] = - (sub[c >>> 24] << 24) ^ - (sub[d >>> 16 & 255] << 16) ^ - (sub[a >>> 8 & 255] << 8) ^ - (sub[b & 255]) ^ w[++i]; - output[decrypt ? 1 : 3] = - (sub[d >>> 24] << 24) ^ - (sub[a >>> 16 & 255] << 16) ^ - (sub[b >>> 8 & 255] << 8) ^ - (sub[c & 255]) ^ w[++i]; + return this.encoder.write(str); } -/** - * Deprecated. Instead, use: - * - * forge.cipher.createCipher('AES-', key); - * forge.cipher.createDecipher('AES-', key); - * - * Creates a deprecated AES cipher object. This object's mode will default to - * CBC (cipher-block-chaining). - * - * The key and iv may be given as a string of bytes, an array of bytes, a - * byte buffer, or an array of 32-bit words. - * - * @param options the options to use. - * key the symmetric key to use. - * output the buffer to write to. - * decrypt true for decryption, false for encryption. - * mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -function _createCipher(options) { - options = options || {}; - var mode = (options.mode || 'CBC').toUpperCase(); - var algorithm = 'AES-' + mode; +PrependBOMWrapper.prototype.end = function() { + return this.encoder.end(); +} - var cipher; - if(options.decrypt) { - cipher = forge.cipher.createDecipher(algorithm, options.key); - } else { - cipher = forge.cipher.createCipher(algorithm, options.key); - } - // backwards compatible start API - var start = cipher.start; - cipher.start = function(iv, options) { - // backwards compatibility: support second arg as output buffer - var output = null; - if(options instanceof forge.util.ByteBuffer) { - output = options; - options = {}; +//------------------------------------------------------------------------------ + +exports.StripBOM = StripBOMWrapper; +function StripBOMWrapper(decoder, options) { + this.decoder = decoder; + this.pass = false; + this.options = options || {}; +} + +StripBOMWrapper.prototype.write = function(buf) { + var res = this.decoder.write(buf); + if (this.pass || !res) + return res; + + if (res[0] === BOMChar) { + res = res.slice(1); + if (typeof this.options.stripBOM === 'function') + this.options.stripBOM(); } - options = options || {}; - options.output = output; - options.iv = iv; - start.call(cipher, options); - }; - return cipher; + this.pass = true; + return res; +} + +StripBOMWrapper.prototype.end = function() { + return this.decoder.end(); } + /***/ }), -<<<<<<< HEAD -/***/ 1571: -======= -/***/ 69197: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 83465: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Javascript implementation of Abstract Syntax Notation Number One. - * - * @author Dave Longley - * - * Copyright (c) 2010-2015 Digital Bazaar, Inc. - * - * An API for storing data using the Abstract Syntax Notation Number One - * format using DER (Distinguished Encoding Rules) encoding. This encoding is - * commonly used to store data for PKI, i.e. X.509 Certificates, and this - * implementation exists for that purpose. - * - * Abstract Syntax Notation Number One (ASN.1) is used to define the abstract - * syntax of information without restricting the way the information is encoded - * for transmission. It provides a standard that allows for open systems - * communication. ASN.1 defines the syntax of information data and a number of - * simple data types as well as a notation for describing them and specifying - * values for them. - * - * The RSA algorithm creates public and private keys that are often stored in - * X.509 or PKCS#X formats -- which use ASN.1 (encoded in DER format). This - * class provides the most basic functionality required to store and load DSA - * keys that are encoded according to ASN.1. - * - * The most common binary encodings for ASN.1 are BER (Basic Encoding Rules) - * and DER (Distinguished Encoding Rules). DER is just a subset of BER that - * has stricter requirements for how data must be encoded. - * - * Each ASN.1 structure has a tag (a byte identifying the ASN.1 structure type) - * and a byte array for the value of this ASN1 structure which may be data or a - * list of ASN.1 structures. - * - * Each ASN.1 structure using BER is (Tag-Length-Value): - * - * | byte 0 | bytes X | bytes Y | - * |--------|---------|---------- - * | tag | length | value | - * - * ASN.1 allows for tags to be of "High-tag-number form" which allows a tag to - * be two or more octets, but that is not supported by this class. A tag is - * only 1 byte. Bits 1-5 give the tag number (ie the data type within a - * particular 'class'), 6 indicates whether or not the ASN.1 value is - * constructed from other ASN.1 values, and bits 7 and 8 give the 'class'. If - * bits 7 and 8 are both zero, the class is UNIVERSAL. If only bit 7 is set, - * then the class is APPLICATION. If only bit 8 is set, then the class is - * CONTEXT_SPECIFIC. If both bits 7 and 8 are set, then the class is PRIVATE. - * The tag numbers for the data types for the class UNIVERSAL are listed below: - * - * UNIVERSAL 0 Reserved for use by the encoding rules - * UNIVERSAL 1 Boolean type - * UNIVERSAL 2 Integer type - * UNIVERSAL 3 Bitstring type - * UNIVERSAL 4 Octetstring type - * UNIVERSAL 5 Null type - * UNIVERSAL 6 Object identifier type - * UNIVERSAL 7 Object descriptor type - * UNIVERSAL 8 External type and Instance-of type - * UNIVERSAL 9 Real type - * UNIVERSAL 10 Enumerated type - * UNIVERSAL 11 Embedded-pdv type - * UNIVERSAL 12 UTF8String type - * UNIVERSAL 13 Relative object identifier type - * UNIVERSAL 14-15 Reserved for future editions - * UNIVERSAL 16 Sequence and Sequence-of types - * UNIVERSAL 17 Set and Set-of types - * UNIVERSAL 18-22, 25-30 Character string types - * UNIVERSAL 23-24 Time types - * - * The length of an ASN.1 structure is specified after the tag identifier. - * There is a definite form and an indefinite form. The indefinite form may - * be used if the encoding is constructed and not all immediately available. - * The indefinite form is encoded using a length byte with only the 8th bit - * set. The end of the constructed object is marked using end-of-contents - * octets (two zero bytes). - * - * The definite form looks like this: - * - * The length may take up 1 or more bytes, it depends on the length of the - * value of the ASN.1 structure. DER encoding requires that if the ASN.1 - * structure has a value that has a length greater than 127, more than 1 byte - * will be used to store its length, otherwise just one byte will be used. - * This is strict. - * - * In the case that the length of the ASN.1 value is less than 127, 1 octet - * (byte) is used to store the "short form" length. The 8th bit has a value of - * 0 indicating the length is "short form" and not "long form" and bits 7-1 - * give the length of the data. (The 8th bit is the left-most, most significant - * bit: also known as big endian or network format). - * - * In the case that the length of the ASN.1 value is greater than 127, 2 to - * 127 octets (bytes) are used to store the "long form" length. The first - * byte's 8th bit is set to 1 to indicate the length is "long form." Bits 7-1 - * give the number of additional octets. All following octets are in base 256 - * with the most significant digit first (typical big-endian binary unsigned - * integer storage). So, for instance, if the length of a value was 257, the - * first byte would be set to: - * - * 10000010 = 130 = 0x82. - * - * This indicates there are 2 octets (base 256) for the length. The second and - * third bytes (the octets just mentioned) would store the length in base 256: - * - * octet 2: 00000001 = 1 * 256^1 = 256 - * octet 3: 00000001 = 1 * 256^0 = 1 - * total = 257 - * - * The algorithm for converting a js integer value of 257 to base-256 is: - * - * var value = 257; - * var bytes = []; - * bytes[0] = (value >>> 8) & 0xFF; // most significant byte first - * bytes[1] = value & 0xFF; // least significant byte last - * - * On the ASN.1 UNIVERSAL Object Identifier (OID) type: - * - * An OID can be written like: "value1.value2.value3...valueN" - * - * The DER encoding rules: - * - * The first byte has the value 40 * value1 + value2. - * The following bytes, if any, encode the remaining values. Each value is - * encoded in base 128, most significant digit first (big endian), with as - * few digits as possible, and the most significant bit of each byte set - * to 1 except the last in each value's encoding. For example: Given the - * OID "1.2.840.113549", its DER encoding is (remember each byte except the - * last one in each encoding is OR'd with 0x80): - * - * byte 1: 40 * 1 + 2 = 42 = 0x2A. - * bytes 2-3: 128 * 6 + 72 = 840 = 6 72 = 6 72 = 0x0648 = 0x8648 - * bytes 4-6: 16384 * 6 + 128 * 119 + 13 = 6 119 13 = 0x06770D = 0x86F70D - * - * The final value is: 0x2A864886F70D. - * The full OID (including ASN.1 tag and length of 6 bytes) is: - * 0x06062A864886F70D - */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -__nccwpck_require__(19239); -__nccwpck_require__(40876); -======= -var forge = __nccwpck_require__(96630); -__nccwpck_require__(36536); -__nccwpck_require__(11750); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/* ASN.1 API */ -var asn1 = module.exports = forge.asn1 = forge.asn1 || {}; -/** - * ASN.1 classes. - */ -asn1.Class = { - UNIVERSAL: 0x00, - APPLICATION: 0x40, - CONTEXT_SPECIFIC: 0x80, - PRIVATE: 0xC0 -}; +var Buffer = (__nccwpck_require__(17120).Buffer); -/** - * ASN.1 types. Not all types are supported by this implementation, only - * those necessary to implement a simple PKI are implemented. - */ -asn1.Type = { - NONE: 0, - BOOLEAN: 1, - INTEGER: 2, - BITSTRING: 3, - OCTETSTRING: 4, - NULL: 5, - OID: 6, - ODESC: 7, - EXTERNAL: 8, - REAL: 9, - ENUMERATED: 10, - EMBEDDED: 11, - UTF8: 12, - ROID: 13, - SEQUENCE: 16, - SET: 17, - PRINTABLESTRING: 19, - IA5STRING: 22, - UTCTIME: 23, - GENERALIZEDTIME: 24, - BMPSTRING: 30 -}; +var bomHandling = __nccwpck_require__(6738), + iconv = module.exports; -/** - * Creates a new asn1 object. - * - * @param tagClass the tag class for the object. - * @param type the data type (tag number) for the object. - * @param constructed true if the asn1 object is in constructed form. - * @param value the value for the object, if it is not constructed. - * @param [options] the options to use: - * [bitStringContents] the plain BIT STRING content including padding - * byte. - * - * @return the asn1 object. - */ -asn1.create = function(tagClass, type, constructed, value, options) { - /* An asn1 object has a tagClass, a type, a constructed flag, and a - value. The value's type depends on the constructed flag. If - constructed, it will contain a list of other asn1 objects. If not, - it will contain the ASN.1 value as an array of bytes formatted - according to the ASN.1 data type. */ +// All codecs and aliases are kept here, keyed by encoding name/alias. +// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. +iconv.encodings = null; - // remove undefined values - if(forge.util.isArray(value)) { - var tmp = []; - for(var i = 0; i < value.length; ++i) { - if(value[i] !== undefined) { - tmp.push(value[i]); - } - } - value = tmp; - } +// Characters emitted in case of error. +iconv.defaultCharUnicode = '�'; +iconv.defaultCharSingleByte = '?'; - var obj = { - tagClass: tagClass, - type: type, - constructed: constructed, - composed: constructed || forge.util.isArray(value), - value: value - }; - if(options && 'bitStringContents' in options) { - // TODO: copy byte buffer if it's a buffer not a string - obj.bitStringContents = options.bitStringContents; - // TODO: add readonly flag to avoid this overhead - // save copy to detect changes - obj.original = asn1.copy(obj); - } - return obj; -}; +// Public API. +iconv.encode = function encode(str, encoding, options) { + str = "" + (str || ""); // Ensure string. + + var encoder = iconv.getEncoder(encoding, options); + + var res = encoder.write(str); + var trail = encoder.end(); + + return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res; +} -/** - * Copies an asn1 object. - * - * @param obj the asn1 object. - * @param [options] copy options: - * [excludeBitStringContents] true to not copy bitStringContents - * - * @return the a copy of the asn1 object. - */ -asn1.copy = function(obj, options) { - var copy; +iconv.decode = function decode(buf, encoding, options) { + if (typeof buf === 'string') { + if (!iconv.skipDecodeWarning) { + console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding'); + iconv.skipDecodeWarning = true; + } - if(forge.util.isArray(obj)) { - copy = []; - for(var i = 0; i < obj.length; ++i) { - copy.push(asn1.copy(obj[i], options)); + buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer. } - return copy; - } - if(typeof obj === 'string') { - // TODO: copy byte buffer if it's a buffer not a string - return obj; - } + var decoder = iconv.getDecoder(encoding, options); - copy = { - tagClass: obj.tagClass, - type: obj.type, - constructed: obj.constructed, - composed: obj.composed, - value: asn1.copy(obj.value, options) - }; - if(options && !options.excludeBitStringContents) { - // TODO: copy byte buffer if it's a buffer not a string - copy.bitStringContents = obj.bitStringContents; - } - return copy; -}; + var res = decoder.write(buf); + var trail = decoder.end(); -/** - * Compares asn1 objects for equality. - * - * Note this function does not run in constant time. - * - * @param obj1 the first asn1 object. - * @param obj2 the second asn1 object. - * @param [options] compare options: - * [includeBitStringContents] true to compare bitStringContents - * - * @return true if the asn1 objects are equal. - */ -asn1.equals = function(obj1, obj2, options) { - if(forge.util.isArray(obj1)) { - if(!forge.util.isArray(obj2)) { - return false; - } - if(obj1.length !== obj2.length) { - return false; - } - for(var i = 0; i < obj1.length; ++i) { - if(!asn1.equals(obj1[i], obj2[i])) { + return trail ? (res + trail) : res; +} + +iconv.encodingExists = function encodingExists(enc) { + try { + iconv.getCodec(enc); + return true; + } catch (e) { return false; - } } - return true; - } +} - if(typeof obj1 !== typeof obj2) { - return false; - } +// Legacy aliases to convert functions +iconv.toEncoding = iconv.encode; +iconv.fromEncoding = iconv.decode; - if(typeof obj1 === 'string') { - return obj1 === obj2; - } +// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. +iconv._codecDataCache = {}; +iconv.getCodec = function getCodec(encoding) { + if (!iconv.encodings) + iconv.encodings = __nccwpck_require__(5531); // Lazy load all encoding definitions. + + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + var enc = iconv._canonicalizeEncoding(encoding); - var equal = obj1.tagClass === obj2.tagClass && - obj1.type === obj2.type && - obj1.constructed === obj2.constructed && - obj1.composed === obj2.composed && - asn1.equals(obj1.value, obj2.value); - if(options && options.includeBitStringContents) { - equal = equal && (obj1.bitStringContents === obj2.bitStringContents); - } + // Traverse iconv.encodings to find actual codec. + var codecOptions = {}; + while (true) { + var codec = iconv._codecDataCache[enc]; + if (codec) + return codec; - return equal; -}; + var codecDef = iconv.encodings[enc]; -/** - * Gets the length of a BER-encoded ASN.1 value. - * - * In case the length is not specified, undefined is returned. - * - * @param b the BER-encoded ASN.1 byte buffer, starting with the first - * length byte. - * - * @return the length of the BER-encoded ASN.1 value or undefined. - */ -asn1.getBerValueLength = function(b) { - // TODO: move this function and related DER/BER functions to a der.js - // file; better abstract ASN.1 away from der/ber. - var b2 = b.getByte(); - if(b2 === 0x80) { - return undefined; - } + switch (typeof codecDef) { + case "string": // Direct alias to other encoding. + enc = codecDef; + break; - // see if the length is "short form" or "long form" (bit 8 set) - var length; - var longForm = b2 & 0x80; - if(!longForm) { - // length is just the first byte - length = b2; - } else { - // the number of bytes the length is specified in bits 7 through 1 - // and each length byte is in big-endian base-256 - length = b.getInt((b2 & 0x7F) << 3); - } - return length; -}; + case "object": // Alias with options. Can be layered. + for (var key in codecDef) + codecOptions[key] = codecDef[key]; -/** - * Check if the byte buffer has enough bytes. Throws an Error if not. - * - * @param bytes the byte buffer to parse from. - * @param remaining the bytes remaining in the current parsing state. - * @param n the number of bytes the buffer must have. - */ -function _checkBufferLength(bytes, remaining, n) { - if(n > remaining) { - var error = new Error('Too few bytes to parse DER.'); - error.available = bytes.length(); - error.remaining = remaining; - error.requested = n; - throw error; - } + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; + + enc = codecDef.type; + break; + + case "function": // Codec itself. + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; + + // The codec function must load all tables and return object with .encoder and .decoder methods. + // It'll be called only once (for each different options object). + codec = new codecDef(codecOptions, iconv); + + iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. + return codec; + + default: + throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); + } + } } -/** - * Gets the length of a BER-encoded ASN.1 value. - * - * In case the length is not specified, undefined is returned. - * - * @param bytes the byte buffer to parse from. - * @param remaining the bytes remaining in the current parsing state. - * - * @return the length of the BER-encoded ASN.1 value or undefined. - */ -var _getValueLength = function(bytes, remaining) { - // TODO: move this function and related DER/BER functions to a der.js - // file; better abstract ASN.1 away from der/ber. - // fromDer already checked that this byte exists - var b2 = bytes.getByte(); - remaining--; - if(b2 === 0x80) { - return undefined; - } +iconv._canonicalizeEncoding = function(encoding) { + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); +} - // see if the length is "short form" or "long form" (bit 8 set) - var length; - var longForm = b2 & 0x80; - if(!longForm) { - // length is just the first byte - length = b2; - } else { - // the number of bytes the length is specified in bits 7 through 1 - // and each length byte is in big-endian base-256 - var longFormBytes = b2 & 0x7F; - _checkBufferLength(bytes, remaining, longFormBytes); - length = bytes.getInt(longFormBytes << 3); - } - // FIXME: this will only happen for 32 bit getInt with high bit set - if(length < 0) { - throw new Error('Negative length: ' + length); - } - return length; -}; +iconv.getEncoder = function getEncoder(encoding, options) { + var codec = iconv.getCodec(encoding), + encoder = new codec.encoder(options, codec); -/** - * Parses an asn1 object from a byte buffer in DER format. - * - * @param bytes the byte buffer to parse from. - * @param [strict] true to be strict when checking value lengths, false to - * allow truncated values (default: true). - * @param [options] object with options or boolean strict flag - * [strict] true to be strict when checking value lengths, false to - * allow truncated values (default: true). - * [parseAllBytes] true to ensure all bytes are parsed - * (default: true) - * [decodeBitStrings] true to attempt to decode the content of - * BIT STRINGs (not OCTET STRINGs) using strict mode. Note that - * without schema support to understand the data context this can - * erroneously decode values that happen to be valid ASN.1. This - * flag will be deprecated or removed as soon as schema support is - * available. (default: true) - * - * @throws Will throw an error for various malformed input conditions. - * - * @return the parsed asn1 object. - */ -asn1.fromDer = function(bytes, options) { - if(options === undefined) { - options = { - strict: true, - parseAllBytes: true, - decodeBitStrings: true - }; - } - if(typeof options === 'boolean') { - options = { - strict: options, - parseAllBytes: true, - decodeBitStrings: true - }; - } - if(!('strict' in options)) { - options.strict = true; - } - if(!('parseAllBytes' in options)) { - options.parseAllBytes = true; - } - if(!('decodeBitStrings' in options)) { - options.decodeBitStrings = true; - } + if (codec.bomAware && options && options.addBOM) + encoder = new bomHandling.PrependBOM(encoder, options); - // wrap in buffer if needed - if(typeof bytes === 'string') { - bytes = forge.util.createBuffer(bytes); - } + return encoder; +} - var byteCount = bytes.length(); - var value = _fromDer(bytes, bytes.length(), 0, options); - if(options.parseAllBytes && bytes.length() !== 0) { - var error = new Error('Unparsed DER bytes remain after ASN.1 parsing.'); - error.byteCount = byteCount; - error.remaining = bytes.length(); - throw error; - } - return value; -}; +iconv.getDecoder = function getDecoder(encoding, options) { + var codec = iconv.getCodec(encoding), + decoder = new codec.decoder(options, codec); -/** - * Internal function to parse an asn1 object from a byte buffer in DER format. - * - * @param bytes the byte buffer to parse from. - * @param remaining the number of bytes remaining for this chunk. - * @param depth the current parsing depth. - * @param options object with same options as fromDer(). - * - * @return the parsed asn1 object. - */ -function _fromDer(bytes, remaining, depth, options) { - // temporary storage for consumption calculations - var start; + if (codec.bomAware && !(options && options.stripBOM === false)) + decoder = new bomHandling.StripBOM(decoder, options); - // minimum length for ASN.1 DER structure is 2 - _checkBufferLength(bytes, remaining, 2); + return decoder; +} - // get the first byte - var b1 = bytes.getByte(); - // consumed one byte - remaining--; +// Streaming API +// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add +// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. +// If you would like to enable it explicitly, please add the following code to your app: +// > iconv.enableStreamingAPI(require('stream')); +iconv.enableStreamingAPI = function enableStreamingAPI(stream_module) { + if (iconv.supportsStreams) + return; - // get the tag class - var tagClass = (b1 & 0xC0); + // Dependency-inject stream module to create IconvLite stream classes. + var streams = __nccwpck_require__(7284)(stream_module); - // get the type (bits 1-5) - var type = b1 & 0x1F; + // Not public API yet, but expose the stream classes. + iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream; + iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream; - // get the variable value length and adjust remaining bytes - start = bytes.length(); - var length = _getValueLength(bytes, remaining); - remaining -= start - bytes.length(); + // Streaming API. + iconv.encodeStream = function encodeStream(encoding, options) { + return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); + } - // ensure there are enough bytes to get the value - if(length !== undefined && length > remaining) { - if(options.strict) { - var error = new Error('Too few bytes to read ASN.1 value.'); - error.available = bytes.length(); - error.remaining = remaining; - error.requested = length; - throw error; + iconv.decodeStream = function decodeStream(encoding, options) { + return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); } - // Note: be lenient with truncated values and use remaining state bytes - length = remaining; - } - // value storage - var value; - // possible BIT STRING contents storage - var bitStringContents; + iconv.supportsStreams = true; +} - // constructed flag is bit 6 (32 = 0x20) of the first byte - var constructed = ((b1 & 0x20) === 0x20); - if(constructed) { - // parse child asn1 objects from the value - value = []; - if(length === undefined) { - // asn1 object of indefinite length, read until end tag - for(;;) { - _checkBufferLength(bytes, remaining, 2); - if(bytes.bytes(2) === String.fromCharCode(0, 0)) { - bytes.getBytes(2); - remaining -= 2; - break; - } - start = bytes.length(); - value.push(_fromDer(bytes, remaining, depth + 1, options)); - remaining -= start - bytes.length(); - } - } else { - // parsing asn1 object of definite length - while(length > 0) { - start = bytes.length(); - value.push(_fromDer(bytes, length, depth + 1, options)); - remaining -= start - bytes.length(); - length -= start - bytes.length(); - } - } - } +// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). +var stream_module; +try { + stream_module = __nccwpck_require__(12781); +} catch (e) {} - // if a BIT STRING, save the contents including padding - if(value === undefined && tagClass === asn1.Class.UNIVERSAL && - type === asn1.Type.BITSTRING) { - bitStringContents = bytes.bytes(length); - } +if (stream_module && stream_module.Transform) { + iconv.enableStreamingAPI(stream_module); - // determine if a non-constructed value should be decoded as a composed - // value that contains other ASN.1 objects. BIT STRINGs (and OCTET STRINGs) - // can be used this way. - if(value === undefined && options.decodeBitStrings && - tagClass === asn1.Class.UNIVERSAL && - // FIXME: OCTET STRINGs not yet supported here - // .. other parts of forge expect to decode OCTET STRINGs manually - (type === asn1.Type.BITSTRING /*|| type === asn1.Type.OCTETSTRING*/) && - length > 1) { - // save read position - var savedRead = bytes.read; - var savedRemaining = remaining; - var unused = 0; - if(type === asn1.Type.BITSTRING) { - /* The first octet gives the number of bits by which the length of the - bit string is less than the next multiple of eight (this is called - the "number of unused bits"). +} else { + // In rare cases where 'stream' module is not available by default, throw a helpful exception. + iconv.encodeStream = iconv.decodeStream = function() { + throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it."); + }; +} - The second and following octets give the value of the bit string - converted to an octet string. */ - _checkBufferLength(bytes, remaining, 1); - unused = bytes.getByte(); - remaining--; - } - // if all bits are used, maybe the BIT/OCTET STRING holds ASN.1 objs - if(unused === 0) { - try { - // attempt to parse child asn1 object from the value - // (stored in array to signal composed value) - start = bytes.length(); - var subOptions = { - // enforce strict mode to avoid parsing ASN.1 from plain data - strict: true, - decodeBitStrings: true - }; - var composed = _fromDer(bytes, remaining, depth + 1, subOptions); - var used = start - bytes.length(); - remaining -= used; - if(type == asn1.Type.BITSTRING) { - used++; - } +if (false) {} - // if the data all decoded and the class indicates UNIVERSAL or - // CONTEXT_SPECIFIC then assume we've got an encapsulated ASN.1 object - var tc = composed.tagClass; - if(used === length && - (tc === asn1.Class.UNIVERSAL || tc === asn1.Class.CONTEXT_SPECIFIC)) { - value = [composed]; - } - } catch(ex) { - } - } - if(value === undefined) { - // restore read position - bytes.read = savedRead; - remaining = savedRemaining; - } - } - if(value === undefined) { - // asn1 not constructed or composed, get raw value - // TODO: do DER to OID conversion and vice-versa in .toDer? +/***/ }), - if(length === undefined) { - if(options.strict) { - throw new Error('Non-constructed ASN.1 object of indefinite length.'); - } - // be lenient and use remaining state bytes - length = remaining; - } +/***/ 7284: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if(type === asn1.Type.BMPSTRING) { - value = ''; - for(; length > 0; length -= 2) { - _checkBufferLength(bytes, remaining, 2); - value += String.fromCharCode(bytes.getInt16()); - remaining -= 2; - } - } else { - value = bytes.getBytes(length); - remaining -= length; - } - } - // add BIT STRING contents if available - var asn1Options = bitStringContents === undefined ? null : { - bitStringContents: bitStringContents - }; - // create and return asn1 object - return asn1.create(tagClass, type, constructed, value, asn1Options); -} +var Buffer = (__nccwpck_require__(17120).Buffer); -/** - * Converts the given asn1 object to a buffer of bytes in DER format. - * - * @param asn1 the asn1 object to convert to bytes. - * - * @return the buffer of bytes. - */ -asn1.toDer = function(obj) { - var bytes = forge.util.createBuffer(); +// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), +// we opt to dependency-inject it instead of creating a hard dependency. +module.exports = function(stream_module) { + var Transform = stream_module.Transform; - // build the first byte - var b1 = obj.tagClass | obj.type; + // == Encoder stream ======================================================= - // for storing the ASN.1 value - var value = forge.util.createBuffer(); + function IconvLiteEncoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.decodeStrings = false; // We accept only strings, so we don't need to decode them. + Transform.call(this, options); + } - // use BIT STRING contents if available and data not changed - var useBitStringContents = false; - if('bitStringContents' in obj) { - useBitStringContents = true; - if(obj.original) { - useBitStringContents = asn1.equals(obj, obj.original); + IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteEncoderStream } + }); + + IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { + if (typeof chunk != 'string') + return done(new Error("Iconv encoding stream needs strings as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } } - } - if(useBitStringContents) { - value.putBytes(obj.bitStringContents); - } else if(obj.composed) { - // if composed, use each child asn1 object's DER bytes as value - // turn on 6th bit (0x20 = 32) to indicate asn1 is constructed - // from other asn1 objects - if(obj.constructed) { - b1 |= 0x20; - } else { - // type is a bit string, add unused bits of 0x00 - value.putByte(0x00); + IconvLiteEncoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } } - // add all of the child DER bytes together - for(var i = 0; i < obj.value.length; ++i) { - if(obj.value[i] !== undefined) { - value.putBuffer(asn1.toDer(obj.value[i])); - } + IconvLiteEncoderStream.prototype.collect = function(cb) { + var chunks = []; + this.on('error', cb); + this.on('data', function(chunk) { chunks.push(chunk); }); + this.on('end', function() { + cb(null, Buffer.concat(chunks)); + }); + return this; } - } else { - // use asn1.value directly - if(obj.type === asn1.Type.BMPSTRING) { - for(var i = 0; i < obj.value.length; ++i) { - value.putInt16(obj.value.charCodeAt(i)); - } - } else { - // ensure integer is minimally-encoded - // TODO: should all leading bytes be stripped vs just one? - // .. ex '00 00 01' => '01'? - if(obj.type === asn1.Type.INTEGER && - obj.value.length > 1 && - // leading 0x00 for positive integer - ((obj.value.charCodeAt(0) === 0 && - (obj.value.charCodeAt(1) & 0x80) === 0) || - // leading 0xFF for negative integer - (obj.value.charCodeAt(0) === 0xFF && - (obj.value.charCodeAt(1) & 0x80) === 0x80))) { - value.putBytes(obj.value.substr(1)); - } else { - value.putBytes(obj.value); - } + + + // == Decoder stream ======================================================= + + function IconvLiteDecoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.encoding = this.encoding = 'utf8'; // We output strings. + Transform.call(this, options); } - } - // add tag byte - bytes.putByte(b1); + IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteDecoderStream } + }); - // use "short form" encoding - if(value.length() <= 127) { - // one byte describes the length - // bit 8 = 0 and bits 7-1 = length - bytes.putByte(value.length() & 0x7F); - } else { - // use "long form" encoding - // 2 to 127 bytes describe the length - // first byte: bit 8 = 1 and bits 7-1 = # of additional bytes - // other bytes: length in base 256, big-endian - var len = value.length(); - var lenBytes = ''; - do { - lenBytes += String.fromCharCode(len & 0xFF); - len = len >>> 8; - } while(len > 0); + IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { + if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) + return done(new Error("Iconv decoding stream needs buffers as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } + } - // set first byte to # bytes used to store the length and turn on - // bit 8 to indicate long-form length is used - bytes.putByte(lenBytes.length | 0x80); + IconvLiteDecoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } + } - // concatenate length bytes in reverse since they were generated - // little endian and we need big endian - for(var i = lenBytes.length - 1; i >= 0; --i) { - bytes.putByte(lenBytes.charCodeAt(i)); + IconvLiteDecoderStream.prototype.collect = function(cb) { + var res = ''; + this.on('error', cb); + this.on('data', function(chunk) { res += chunk; }); + this.on('end', function() { + cb(null, res); + }); + return this; } - } - // concatenate value bytes - bytes.putBuffer(value); - return bytes; + return { + IconvLiteEncoderStream: IconvLiteEncoderStream, + IconvLiteDecoderStream: IconvLiteDecoderStream, + }; }; -/** - * Converts an OID dot-separated string to a byte buffer. The byte buffer - * contains only the DER-encoded value, not any tag or length bytes. - * - * @param oid the OID dot-separated string. - * - * @return the byte buffer. - */ -asn1.oidToDer = function(oid) { - // split OID into individual values - var values = oid.split('.'); - var bytes = forge.util.createBuffer(); - // first byte is 40 * value1 + value2 - bytes.putByte(40 * parseInt(values[0], 10) + parseInt(values[1], 10)); - // other bytes are each value in base 128 with 8th bit set except for - // the last byte for each value - var last, valueBytes, value, b; - for(var i = 2; i < values.length; ++i) { - // produce value bytes in reverse because we don't know how many - // bytes it will take to store the value - last = true; - valueBytes = []; - value = parseInt(values[i], 10); - do { - b = value & 0x7F; - value = value >>> 7; - // if value is not last, then turn on 8th bit - if(!last) { - b |= 0x80; - } - valueBytes.push(b); - last = false; - } while(value > 0); +/***/ }), + +/***/ 18598: +/***/ ((module) => { - // add value bytes in reverse (needs to be in big endian) - for(var n = valueBytes.length - 1; n >= 0; --n) { - bytes.putByte(valueBytes[n]); - } - } - return bytes; -}; /** - * Converts a DER-encoded byte buffer to an OID dot-separated string. The - * byte buffer should contain only the DER-encoded value, not any tag or - * length bytes. - * - * @param bytes the byte buffer. - * - * @return the OID dot-separated string. + * @typedef {{ [key: string]: any }} Extensions + * @typedef {Error} Err + * @property {string} message */ -asn1.derToOid = function(bytes) { - var oid; - - // wrap in buffer if needed - if(typeof bytes === 'string') { - bytes = forge.util.createBuffer(bytes); - } - // first byte is 40 * value1 + value2 - var b = bytes.getByte(); - oid = Math.floor(b / 40) + '.' + (b % 40); - - // other bytes are each value in base 128 with 8th bit set except for - // the last byte for each value - var value = 0; - while(bytes.length() > 0) { - b = bytes.getByte(); - value = value << 7; - // not the last byte for the value - if(b & 0x80) { - value += b & 0x7F; - } else { - // last byte - oid += '.' + (value + b); - value = 0; +/** + * + * @param {Error} obj + * @param {Extensions} props + * @returns {Error & Extensions} + */ +function assign(obj, props) { + for (const key in props) { + Object.defineProperty(obj, key, { + value: props[key], + enumerable: true, + configurable: true, + }); } - } - return oid; -}; + return obj; +} /** - * Converts a UTCTime value to a date. - * - * Note: GeneralizedTime has 4 digits for the year and is used for X.509 - * dates past 2049. Parsing that structure hasn't been implemented yet. - * - * @param utc the UTCTime value to convert. * - * @return the date. + * @param {any} err - An Error + * @param {string|Extensions} code - A string code or props to set on the error + * @param {Extensions} [props] - Props to set on the error + * @returns {Error & Extensions} */ -asn1.utcTimeToDate = function(utc) { - /* The following formats can be used: +function createError(err, code, props) { + if (!err || typeof err === 'string') { + throw new TypeError('Please pass an Error to err-code'); + } - YYMMDDhhmmZ - YYMMDDhhmm+hh'mm' - YYMMDDhhmm-hh'mm' - YYMMDDhhmmssZ - YYMMDDhhmmss+hh'mm' - YYMMDDhhmmss-hh'mm' + if (!props) { + props = {}; + } - Where: + if (typeof code === 'object') { + props = code; + code = ''; + } - YY is the least significant two digits of the year - MM is the month (01 to 12) - DD is the day (01 to 31) - hh is the hour (00 to 23) - mm are the minutes (00 to 59) - ss are the seconds (00 to 59) - Z indicates that local time is GMT, + indicates that local time is - later than GMT, and - indicates that local time is earlier than GMT - hh' is the absolute value of the offset from GMT in hours - mm' is the absolute value of the offset from GMT in minutes */ - var date = new Date(); + if (code) { + props.code = code; + } - // if YY >= 50 use 19xx, if YY < 50 use 20xx - var year = parseInt(utc.substr(0, 2), 10); - year = (year >= 50) ? 1900 + year : 2000 + year; - var MM = parseInt(utc.substr(2, 2), 10) - 1; // use 0-11 for month - var DD = parseInt(utc.substr(4, 2), 10); - var hh = parseInt(utc.substr(6, 2), 10); - var mm = parseInt(utc.substr(8, 2), 10); - var ss = 0; + try { + return assign(err, props); + } catch (_) { + props.message = err.message; + props.stack = err.stack; - // not just YYMMDDhhmmZ - if(utc.length > 11) { - // get character after minutes - var c = utc.charAt(10); - var end = 10; + const ErrClass = function () {}; - // see if seconds are present - if(c !== '+' && c !== '-') { - // get seconds - ss = parseInt(utc.substr(10, 2), 10); - end += 2; + ErrClass.prototype = Object.create(Object.getPrototypeOf(err)); + + // @ts-ignore + const output = assign(new ErrClass(), props); + + return output; } - } +} - // update date - date.setUTCFullYear(year, MM, DD); - date.setUTCHours(hh, mm, ss, 0); +module.exports = createError; - if(end) { - // get +/- after end of time - c = utc.charAt(end); - if(c === '+' || c === '-') { - // get hours+minutes offset - var hhoffset = parseInt(utc.substr(end + 1, 2), 10); - var mmoffset = parseInt(utc.substr(end + 4, 2), 10); - // calculate offset in milliseconds - var offset = hhoffset * 60 + mmoffset; - offset *= 60000; +/***/ }), - // apply offset - if(c === '+') { - date.setTime(+date - offset); - } else { - date.setTime(+date + offset); - } - } - } +/***/ 80051: +/***/ ((module) => { - return date; -}; + + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; /** - * Converts a GeneralizedTime value to a date. + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. * - * @param gentime the GeneralizedTime value to convert. + * @constructor + * @private + */ +function Events() {} + +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. * - * @return the date. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @private */ -asn1.generalizedTimeToDate = function(gentime) { - /* The following formats can be used: +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} - YYYYMMDDHHMMSS - YYYYMMDDHHMMSS.fff - YYYYMMDDHHMMSSZ - YYYYMMDDHHMMSS.fffZ - YYYYMMDDHHMMSS+hh'mm' - YYYYMMDDHHMMSS.fff+hh'mm' - YYYYMMDDHHMMSS-hh'mm' - YYYYMMDDHHMMSS.fff-hh'mm' +/** + * Add a listener for a given event. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} once Specify if the listener is a one-time listener. + * @returns {EventEmitter} + * @private + */ +function addListener(emitter, event, fn, context, once) { + if (typeof fn !== 'function') { + throw new TypeError('The listener must be a function'); + } - Where: + var listener = new EE(fn, context || emitter, once) + , evt = prefix ? prefix + event : event; - YYYY is the year - MM is the month (01 to 12) - DD is the day (01 to 31) - hh is the hour (00 to 23) - mm are the minutes (00 to 59) - ss are the seconds (00 to 59) - .fff is the second fraction, accurate to three decimal places - Z indicates that local time is GMT, + indicates that local time is - later than GMT, and - indicates that local time is earlier than GMT - hh' is the absolute value of the offset from GMT in hours - mm' is the absolute value of the offset from GMT in minutes */ - var date = new Date(); + if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; + else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); + else emitter._events[evt] = [emitter._events[evt], listener]; - var YYYY = parseInt(gentime.substr(0, 4), 10); - var MM = parseInt(gentime.substr(4, 2), 10) - 1; // use 0-11 for month - var DD = parseInt(gentime.substr(6, 2), 10); - var hh = parseInt(gentime.substr(8, 2), 10); - var mm = parseInt(gentime.substr(10, 2), 10); - var ss = parseInt(gentime.substr(12, 2), 10); - var fff = 0; - var offset = 0; - var isUTC = false; + return emitter; +} - if(gentime.charAt(gentime.length - 1) === 'Z') { - isUTC = true; - } +/** + * Clear event by name. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} evt The Event name. + * @private + */ +function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) emitter._events = new Events(); + else delete emitter._events[evt]; +} - var end = gentime.length - 5, c = gentime.charAt(end); - if(c === '+' || c === '-') { - // get hours+minutes offset - var hhoffset = parseInt(gentime.substr(end + 1, 2), 10); - var mmoffset = parseInt(gentime.substr(end + 4, 2), 10); +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} - // calculate offset in milliseconds - offset = hhoffset * 60 + mmoffset; - offset *= 60000; +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; - // apply offset - if(c === '+') { - offset *= -1; - } + if (this._eventsCount === 0) return names; - isUTC = true; + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); } - // check for second fraction - if(gentime.charAt(14) === '.') { - fff = parseFloat(gentime.substr(14), 10) * 1000; + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); } - if(isUTC) { - date.setUTCFullYear(YYYY, MM, DD); - date.setUTCHours(hh, mm, ss, fff); + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Array} The registered listeners. + * @public + */ +EventEmitter.prototype.listeners = function listeners(event) { + var evt = prefix ? prefix + event : event + , handlers = this._events[evt]; + + if (!handlers) return []; + if (handlers.fn) return [handlers.fn]; - // apply offset - date.setTime(+date + offset); - } else { - date.setFullYear(YYYY, MM, DD); - date.setHours(hh, mm, ss, fff); + for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { + ee[i] = handlers[i].fn; } - return date; + return ee; }; /** - * Converts a date to a UTCTime value. - * - * Note: GeneralizedTime has 4 digits for the year and is used for X.509 - * dates past 2049. Converting to a GeneralizedTime hasn't been - * implemented yet. + * Return the number of listeners listening to a given event. * - * @param date the date to convert. + * @param {(String|Symbol)} event The event name. + * @returns {Number} The number of listeners. + * @public + */ +EventEmitter.prototype.listenerCount = function listenerCount(event) { + var evt = prefix ? prefix + event : event + , listeners = this._events[evt]; + + if (!listeners) return 0; + if (listeners.fn) return 1; + return listeners.length; +}; + +/** + * Calls each of the listeners registered for a given event. * - * @return the UTCTime value. + * @param {(String|Symbol)} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @public */ -asn1.dateToUtcTime = function(date) { - // TODO: validate; currently assumes proper format - if(typeof date === 'string') { - return date; - } +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; - var rval = ''; + if (!this._events[evt]) return false; - // create format YYMMDDhhmmssZ - var format = []; - format.push(('' + date.getUTCFullYear()).substr(2)); - format.push('' + (date.getUTCMonth() + 1)); - format.push('' + date.getUTCDate()); - format.push('' + date.getUTCHours()); - format.push('' + date.getUTCMinutes()); - format.push('' + date.getUTCSeconds()); + var listeners = this._events[evt] + , len = arguments.length + , args + , i; - // ensure 2 digits are used for each format entry - for(var i = 0; i < format.length; ++i) { - if(format[i].length < 2) { - rval += '0'; + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; } - rval += format[i]; - } - rval += 'Z'; - return rval; -}; + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } -/** - * Converts a date to a GeneralizedTime value. - * - * @param date the date to convert. - * - * @return the GeneralizedTime value as a string. - */ -asn1.dateToGeneralizedTime = function(date) { - // TODO: validate; currently assumes proper format - if(typeof date === 'string') { - return date; - } + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; - var rval = ''; + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); - // create format YYYYMMDDHHMMSSZ - var format = []; - format.push('' + date.getUTCFullYear()); - format.push('' + (date.getUTCMonth() + 1)); - format.push('' + date.getUTCDate()); - format.push('' + date.getUTCHours()); - format.push('' + date.getUTCMinutes()); - format.push('' + date.getUTCSeconds()); + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } - // ensure 2 digits are used for each format entry - for(var i = 0; i < format.length; ++i) { - if(format[i].length < 2) { - rval += '0'; + listeners[i].fn.apply(listeners[i].context, args); + } } - rval += format[i]; } - rval += 'Z'; - return rval; + return true; }; /** - * Converts a javascript integer to a DER-encoded byte buffer to be used - * as the value for an INTEGER type. - * - * @param x the integer. + * Add a listener for a given event. * - * @return the byte buffer. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public */ -asn1.integerToDer = function(x) { - var rval = forge.util.createBuffer(); - if(x >= -0x80 && x < 0x80) { - return rval.putSignedInt(x, 8); - } - if(x >= -0x8000 && x < 0x8000) { - return rval.putSignedInt(x, 16); - } - if(x >= -0x800000 && x < 0x800000) { - return rval.putSignedInt(x, 24); - } - if(x >= -0x80000000 && x < 0x80000000) { - return rval.putSignedInt(x, 32); - } - var error = new Error('Integer too large; max is 32-bits.'); - error.integer = x; - throw error; +EventEmitter.prototype.on = function on(event, fn, context) { + return addListener(this, event, fn, context, false); }; /** - * Converts a DER-encoded byte buffer to a javascript integer. This is - * typically used to decode the value of an INTEGER type. - * - * @param bytes the byte buffer. + * Add a one-time listener for a given event. * - * @return the integer. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public */ -asn1.derToInteger = function(bytes) { - // wrap in buffer if needed - if(typeof bytes === 'string') { - bytes = forge.util.createBuffer(bytes); - } - - var n = bytes.length() * 8; - if(n > 32) { - throw new Error('Integer too large; max is 32-bits.'); - } - return bytes.getSignedInt(n); +EventEmitter.prototype.once = function once(event, fn, context) { + return addListener(this, event, fn, context, true); }; /** - * Validates that the given ASN.1 object is at least a super set of the - * given ASN.1 structure. Only tag classes and types are checked. An - * optional map may also be provided to capture ASN.1 values while the - * structure is checked. - * - * To capture an ASN.1 value, set an object in the validator's 'capture' - * parameter to the key to use in the capture map. To capture the full - * ASN.1 object, specify 'captureAsn1'. To capture BIT STRING bytes, including - * the leading unused bits counter byte, specify 'captureBitStringContents'. - * To capture BIT STRING bytes, without the leading unused bits counter byte, - * specify 'captureBitStringValue'. - * - * Objects in the validator may set a field 'optional' to true to indicate - * that it isn't necessary to pass validation. - * - * @param obj the ASN.1 object to validate. - * @param v the ASN.1 structure validator. - * @param capture an optional map to capture values in. - * @param errors an optional array for storing validation errors. + * Remove the listeners of a given event. * - * @return true on success, false on failure. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @public */ -asn1.validate = function(obj, v, capture, errors) { - var rval = false; +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; - // ensure tag class and type are the same if specified - if((obj.tagClass === v.tagClass || typeof(v.tagClass) === 'undefined') && - (obj.type === v.type || typeof(v.type) === 'undefined')) { - // ensure constructed flag is the same if specified - if(obj.constructed === v.constructed || - typeof(v.constructed) === 'undefined') { - rval = true; + if (!this._events[evt]) return this; + if (!fn) { + clearEvent(this, evt); + return this; + } - // handle sub values - if(v.value && forge.util.isArray(v.value)) { - var j = 0; - for(var i = 0; rval && i < v.value.length; ++i) { - rval = v.value[i].optional || false; - if(obj.value[j]) { - rval = asn1.validate(obj.value[j], v.value[i], capture, errors); - if(rval) { - ++j; - } else if(v.value[i].optional) { - rval = true; - } - } - if(!rval && errors) { - errors.push( - '[' + v.name + '] ' + - 'Tag class "' + v.tagClass + '", type "' + - v.type + '" expected value length "' + - v.value.length + '", got "' + - obj.value.length + '"'); - } - } - } + var listeners = this._events[evt]; - if(rval && capture) { - if(v.capture) { - capture[v.capture] = obj.value; - } - if(v.captureAsn1) { - capture[v.captureAsn1] = obj; - } - if(v.captureBitStringContents && 'bitStringContents' in obj) { - capture[v.captureBitStringContents] = obj.bitStringContents; - } - if(v.captureBitStringValue && 'bitStringContents' in obj) { - var value; - if(obj.bitStringContents.length < 2) { - capture[v.captureBitStringValue] = ''; - } else { - // FIXME: support unused bits with data shifting - var unused = obj.bitStringContents.charCodeAt(0); - if(unused !== 0) { - throw new Error( - 'captureBitStringValue only supported for zero unused bits'); - } - capture[v.captureBitStringValue] = obj.bitStringContents.slice(1); - } - } - } - } else if(errors) { - errors.push( - '[' + v.name + '] ' + - 'Expected constructed "' + v.constructed + '", got "' + - obj.constructed + '"'); - } - } else if(errors) { - if(obj.tagClass !== v.tagClass) { - errors.push( - '[' + v.name + '] ' + - 'Expected tag class "' + v.tagClass + '", got "' + - obj.tagClass + '"'); + if (listeners.fn) { + if ( + listeners.fn === fn && + (!once || listeners.once) && + (!context || listeners.context === context) + ) { + clearEvent(this, evt); } - if(obj.type !== v.type) { - errors.push( - '[' + v.name + '] ' + - 'Expected type "' + v.type + '", got "' + obj.type + '"'); + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn || + (once && !listeners[i].once) || + (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else clearEvent(this, evt); } - return rval; -}; -// regex for testing for non-latin characters -var _nonLatinRegex = /[^\\u0000-\\u00ff]/; + return this; +}; /** - * Pretty prints an ASN.1 object to a string. - * - * @param obj the object to write out. - * @param level the level in the tree. - * @param indentation the indentation to use. + * Remove all listeners, or those of the specified event. * - * @return the string. + * @param {(String|Symbol)} [event] The event name. + * @returns {EventEmitter} `this`. + * @public */ -asn1.prettyPrint = function(obj, level, indentation) { - var rval = ''; - - // set default level and indentation - level = level || 0; - indentation = indentation || 2; - - // start new line for deep levels - if(level > 0) { - rval += '\n'; - } - - // create indent - var indent = ''; - for(var i = 0; i < level * indentation; ++i) { - indent += ' '; - } +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; - // print class:type - rval += indent + 'Tag: '; - switch(obj.tagClass) { - case asn1.Class.UNIVERSAL: - rval += 'Universal:'; - break; - case asn1.Class.APPLICATION: - rval += 'Application:'; - break; - case asn1.Class.CONTEXT_SPECIFIC: - rval += 'Context-Specific:'; - break; - case asn1.Class.PRIVATE: - rval += 'Private:'; - break; + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; } - if(obj.tagClass === asn1.Class.UNIVERSAL) { - rval += obj.type; + return this; +}; - // known types - switch(obj.type) { - case asn1.Type.NONE: - rval += ' (None)'; - break; - case asn1.Type.BOOLEAN: - rval += ' (Boolean)'; - break; - case asn1.Type.INTEGER: - rval += ' (Integer)'; - break; - case asn1.Type.BITSTRING: - rval += ' (Bit string)'; - break; - case asn1.Type.OCTETSTRING: - rval += ' (Octet string)'; - break; - case asn1.Type.NULL: - rval += ' (Null)'; - break; - case asn1.Type.OID: - rval += ' (Object Identifier)'; - break; - case asn1.Type.ODESC: - rval += ' (Object Descriptor)'; - break; - case asn1.Type.EXTERNAL: - rval += ' (External or Instance of)'; - break; - case asn1.Type.REAL: - rval += ' (Real)'; - break; - case asn1.Type.ENUMERATED: - rval += ' (Enumerated)'; - break; - case asn1.Type.EMBEDDED: - rval += ' (Embedded PDV)'; - break; - case asn1.Type.UTF8: - rval += ' (UTF8)'; - break; - case asn1.Type.ROID: - rval += ' (Relative Object Identifier)'; - break; - case asn1.Type.SEQUENCE: - rval += ' (Sequence)'; - break; - case asn1.Type.SET: - rval += ' (Set)'; - break; - case asn1.Type.PRINTABLESTRING: - rval += ' (Printable String)'; - break; - case asn1.Type.IA5String: - rval += ' (IA5String (ASCII))'; - break; - case asn1.Type.UTCTIME: - rval += ' (UTC time)'; - break; - case asn1.Type.GENERALIZEDTIME: - rval += ' (Generalized time)'; - break; - case asn1.Type.BMPSTRING: - rval += ' (BMP String)'; - break; - } - } else { - rval += obj.type; - } +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; - rval += '\n'; - rval += indent + 'Constructed: ' + obj.constructed + '\n'; +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; - if(obj.composed) { - var subvalues = 0; - var sub = ''; - for(var i = 0; i < obj.value.length; ++i) { - if(obj.value[i] !== undefined) { - subvalues += 1; - sub += asn1.prettyPrint(obj.value[i], level + 1, indentation); - if((i + 1) < obj.value.length) { - sub += ','; - } - } - } - rval += indent + 'Sub values: ' + subvalues + sub; - } else { - rval += indent + 'Value: '; - if(obj.type === asn1.Type.OID) { - var oid = asn1.derToOid(obj.value); - rval += oid; - if(forge.pki && forge.pki.oids) { - if(oid in forge.pki.oids) { - rval += ' (' + forge.pki.oids[oid] + ') '; - } - } - } - if(obj.type === asn1.Type.INTEGER) { - try { - rval += asn1.derToInteger(obj.value); - } catch(ex) { - rval += '0x' + forge.util.bytesToHex(obj.value); - } - } else if(obj.type === asn1.Type.BITSTRING) { - // TODO: shift bits as needed to display without padding - if(obj.value.length > 1) { - // remove unused bits field - rval += '0x' + forge.util.bytesToHex(obj.value.slice(1)); - } else { - rval += '(none)'; - } - // show unused bit count - if(obj.value.length > 0) { - var unused = obj.value.charCodeAt(0); - if(unused == 1) { - rval += ' (1 unused bit shown)'; - } else if(unused > 1) { - rval += ' (' + unused + ' unused bits shown)'; - } - } - } else if(obj.type === asn1.Type.OCTETSTRING) { - if(!_nonLatinRegex.test(obj.value)) { - rval += '(' + obj.value + ') '; - } - rval += '0x' + forge.util.bytesToHex(obj.value); - } else if(obj.type === asn1.Type.UTF8) { - try { - rval += forge.util.decodeUtf8(obj.value); - } catch(e) { - if(e.message === 'URI malformed') { - rval += - '0x' + forge.util.bytesToHex(obj.value) + ' (malformed UTF8)'; - } else { - throw e; - } - } - } else if(obj.type === asn1.Type.PRINTABLESTRING || - obj.type === asn1.Type.IA5String) { - rval += obj.value; - } else if(_nonLatinRegex.test(obj.value)) { - rval += '0x' + forge.util.bytesToHex(obj.value); - } else if(obj.value.length === 0) { - rval += '[null]'; - } else { - rval += obj.value; - } - } +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; - return rval; -}; +// +// Expose the module. +// +if (true) { + module.exports = EventEmitter; +} /***/ }), -<<<<<<< HEAD -/***/ 56845: -======= -/***/ 12390: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 50465: /***/ ((module) => { -/** - * Base-N/Base-X encoding/decoding functions. - * - * Original implementation from base-x: - * https://github.com/cryptocoinjs/base-x - * - * Which is MIT licensed: - * - * The MIT License (MIT) - * - * Copyright base-x contributors (c) 2016 - * - * 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. - */ -var api = {}; -module.exports = api; +module.exports = class FixedFIFO { + constructor (hwm) { + if (!(hwm > 0) || ((hwm - 1) & hwm) !== 0) throw new Error('Max size for a FixedFIFO should be a power of two') + this.buffer = new Array(hwm) + this.mask = hwm - 1 + this.top = 0 + this.btm = 0 + this.next = null + } -// baseN alphabet indexes -var _reverseAlphabets = {}; + clear () { + this.top = this.btm = 0 + this.next = null + this.buffer.fill(undefined) + } -/** - * BaseN-encodes a Uint8Array using the given alphabet. - * - * @param input the Uint8Array to encode. - * @param maxline the maximum number of encoded characters per line to use, - * defaults to none. - * - * @return the baseN-encoded output string. - */ -api.encode = function(input, alphabet, maxline) { - if(typeof alphabet !== 'string') { - throw new TypeError('"alphabet" must be a string.'); + push (data) { + if (this.buffer[this.top] !== undefined) return false + this.buffer[this.top] = data + this.top = (this.top + 1) & this.mask + return true } - if(maxline !== undefined && typeof maxline !== 'number') { - throw new TypeError('"maxline" must be a number.'); + + shift () { + const last = this.buffer[this.btm] + if (last === undefined) return undefined + this.buffer[this.btm] = undefined + this.btm = (this.btm + 1) & this.mask + return last } - var output = ''; + peek () { + return this.buffer[this.btm] + } - if(!(input instanceof Uint8Array)) { - // assume forge byte buffer - output = _encodeWithByteBuffer(input, alphabet); - } else { - var i = 0; - var base = alphabet.length; - var first = alphabet.charAt(0); - var digits = [0]; - for(i = 0; i < input.length; ++i) { - for(var j = 0, carry = input[i]; j < digits.length; ++j) { - carry += digits[j] << 8; - digits[j] = carry % base; - carry = (carry / base) | 0; - } + isEmpty () { + return this.buffer[this.btm] === undefined + } +} - while(carry > 0) { - digits.push(carry % base); - carry = (carry / base) | 0; - } - } - // deal with leading zeros - for(i = 0; input[i] === 0 && i < input.length - 1; ++i) { - output += first; - } - // convert digits to a string - for(i = digits.length - 1; i >= 0; --i) { - output += alphabet[digits[i]]; - } - } +/***/ }), - if(maxline) { - var regex = new RegExp('.{1,' + maxline + '}', 'g'); - output = output.match(regex).join('\r\n'); - } +/***/ 36938: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return output; -}; +const FixedFIFO = __nccwpck_require__(50465) -/** - * Decodes a baseN-encoded (using the given alphabet) string to a - * Uint8Array. - * - * @param input the baseN-encoded input string. - * - * @return the Uint8Array. - */ -api.decode = function(input, alphabet) { - if(typeof input !== 'string') { - throw new TypeError('"input" must be a string.'); - } - if(typeof alphabet !== 'string') { - throw new TypeError('"alphabet" must be a string.'); +module.exports = class FastFIFO { + constructor (hwm) { + this.hwm = hwm || 16 + this.head = new FixedFIFO(this.hwm) + this.tail = this.head + this.length = 0 } - var table = _reverseAlphabets[alphabet]; - if(!table) { - // compute reverse alphabet - table = _reverseAlphabets[alphabet] = []; - for(var i = 0; i < alphabet.length; ++i) { - table[alphabet.charCodeAt(i)] = i; - } + clear () { + this.head = this.tail + this.head.clear() + this.length = 0 } - // remove whitespace characters - input = input.replace(/\s/g, ''); - - var base = alphabet.length; - var first = alphabet.charAt(0); - var bytes = [0]; - for(var i = 0; i < input.length; i++) { - var value = table[input.charCodeAt(i)]; - if(value === undefined) { - return; + push (val) { + this.length++ + if (!this.head.push(val)) { + const prev = this.head + this.head = prev.next = new FixedFIFO(2 * this.head.buffer.length) + this.head.push(val) } + } - for(var j = 0, carry = value; j < bytes.length; ++j) { - carry += bytes[j] * base; - bytes[j] = carry & 0xff; - carry >>= 8; + shift () { + if (this.length !== 0) this.length-- + const val = this.tail.shift() + if (val === undefined && this.tail.next) { + const next = this.tail.next + this.tail.next = null + this.tail = next + return this.tail.shift() } - while(carry > 0) { - bytes.push(carry & 0xff); - carry >>= 8; - } + return val } - // deal with leading zeros - for(var k = 0; input[k] === first && k < input.length - 1; ++k) { - bytes.push(0); + peek () { + const val = this.tail.peek() + if (val === undefined && this.tail.next) return this.tail.next.peek() + return val } - if(typeof Buffer !== 'undefined') { - return Buffer.from(bytes.reverse()); + isEmpty () { + return this.length === 0 } +} - return new Uint8Array(bytes.reverse()); -}; -function _encodeWithByteBuffer(input, alphabet) { - var i = 0; - var base = alphabet.length; - var first = alphabet.charAt(0); - var digits = [0]; - for(i = 0; i < input.length(); ++i) { - for(var j = 0, carry = input.at(i); j < digits.length; ++j) { - carry += digits[j] << 8; - digits[j] = carry % base; - carry = (carry / base) | 0; +/***/ }), + +/***/ 90078: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const { open, write, close, rename, fsync, unlink } = __nccwpck_require__(57147) +const { join, dirname } = __nccwpck_require__(71017) + +var counter = 0 + +function cleanup (dest, err, cb) { + unlink(dest, function () { + cb(err) + }) +} + +function closeAndCleanup (fd, dest, err, cb) { + close(fd, cleanup.bind(null, dest, err, cb)) +} + +function writeLoop (fd, content, contentLength, offset, cb) { + write(fd, content, offset, function (err, bytesWritten) { + if (err) { + cb(err) + return } - while(carry > 0) { - digits.push(carry % base); - carry = (carry / base) | 0; + return (bytesWritten < contentLength - offset) + ? writeLoop(fd, content, contentLength, offset + bytesWritten, cb) + : cb(null) + }) +} + +function openLoop (dest, cb) { + open(dest, 'w', function (err, fd) { + if (err) { + return (err.code === 'EMFILE') + ? openLoop(dest, cb) + : cb(err) } - } - var output = ''; + cb(null, fd) + }) +} - // deal with leading zeros - for(i = 0; input.at(i) === 0 && i < input.length() - 1; ++i) { - output += first; - } - // convert digits to a string - for(i = digits.length - 1; i >= 0; --i) { - output += alphabet[digits[i]]; - } +function writeAtomic (path, content, cb) { + const tmp = join(dirname(path), '.' + process.pid + '.' + counter++) + openLoop(tmp, function (err, fd) { + if (err) { + cb(err) + return + } - return output; + const contentLength = Buffer.byteLength(content) + writeLoop(fd, content, contentLength, 0, function (err) { + if (err) { + closeAndCleanup(fd, tmp, err, cb) + return + } + + fsync(fd, function (err) { + if (err) { + closeAndCleanup(fd, tmp, err, cb) + return + } + + close(fd, function (err) { + if (err) { + // TODO could we possibly be leaking a file descriptor here? + cleanup(tmp, err, cb) + return + } + + rename(tmp, path, (err) => { + if (err) { + cleanup(tmp, err, cb) + return + } + + cb(null) + }) + }) + }) + }) + + // clean up after oursevles, this is not needed + // anymore + content = null + }) } +module.exports = writeAtomic + /***/ }), -<<<<<<< HEAD -/***/ 21477: -======= -/***/ 27883: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 64992: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Cipher base API. - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. - */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -__nccwpck_require__(19239); -======= -var forge = __nccwpck_require__(96630); -__nccwpck_require__(36536); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -module.exports = forge.cipher = forge.cipher || {}; - -// registered algorithms -forge.cipher.algorithms = forge.cipher.algorithms || {}; -/** - * Creates a cipher object that can be used to encrypt data using the given - * algorithm and key. The algorithm may be provided as a string value for a - * previously registered algorithm or it may be given as a cipher algorithm - * API object. - * - * @param algorithm the algorithm to use, either a string or an algorithm API - * object. - * @param key the key to use, as a binary-encoded string of bytes or a - * byte buffer. - * - * @return the cipher. - */ -forge.cipher.createCipher = function(algorithm, key) { - var api = algorithm; - if(typeof api === 'string') { - api = forge.cipher.getAlgorithm(api); - if(api) { - api = api(); - } - } - if(!api) { - throw new Error('Unsupported algorithm: ' + algorithm); - } - // assume block cipher - return new forge.cipher.BlockCipher({ - algorithm: api, - key: key, - decrypt: false - }); -}; +const validator = __nccwpck_require__(16643); +const XMLParser = __nccwpck_require__(24362); +const XMLBuilder = __nccwpck_require__(12503); -/** - * Creates a decipher object that can be used to decrypt data using the given - * algorithm and key. The algorithm may be provided as a string value for a - * previously registered algorithm or it may be given as a cipher algorithm - * API object. - * - * @param algorithm the algorithm to use, either a string or an algorithm API - * object. - * @param key the key to use, as a binary-encoded string of bytes or a - * byte buffer. - * - * @return the cipher. - */ -forge.cipher.createDecipher = function(algorithm, key) { - var api = algorithm; - if(typeof api === 'string') { - api = forge.cipher.getAlgorithm(api); - if(api) { - api = api(); - } - } - if(!api) { - throw new Error('Unsupported algorithm: ' + algorithm); - } +module.exports = { + XMLParser: XMLParser, + XMLValidator: validator, + XMLBuilder: XMLBuilder +} - // assume block cipher - return new forge.cipher.BlockCipher({ - algorithm: api, - key: key, - decrypt: true - }); -}; +/***/ }), -/** - * Registers an algorithm by name. If the name was already registered, the - * algorithm API object will be overwritten. - * - * @param name the name of the algorithm. - * @param algorithm the algorithm API object. - */ -forge.cipher.registerAlgorithm = function(name, algorithm) { - name = name.toUpperCase(); - forge.cipher.algorithms[name] = algorithm; -}; +/***/ 36311: +/***/ ((__unused_webpack_module, exports) => { -/** - * Gets a registered algorithm by name. - * - * @param name the name of the algorithm. - * - * @return the algorithm, if found, null if not. - */ -forge.cipher.getAlgorithm = function(name) { - name = name.toUpperCase(); - if(name in forge.cipher.algorithms) { - return forge.cipher.algorithms[name]; - } - return null; -}; -var BlockCipher = forge.cipher.BlockCipher = function(options) { - this.algorithm = options.algorithm; - this.mode = this.algorithm.mode; - this.blockSize = this.mode.blockSize; - this._finish = false; - this._input = null; - this.output = null; - this._op = options.decrypt ? this.mode.decrypt : this.mode.encrypt; - this._decrypt = options.decrypt; - this.algorithm.initialize(options); -}; -/** - * Starts or restarts the encryption or decryption process, whichever - * was previously configured. - * - * For non-GCM mode, the IV may be a binary-encoded string of bytes, an array - * of bytes, a byte buffer, or an array of 32-bit integers. If the IV is in - * bytes, then it must be Nb (16) bytes in length. If the IV is given in as - * 32-bit integers, then it must be 4 integers long. - * - * Note: an IV is not required or used in ECB mode. - * - * For GCM-mode, the IV must be given as a binary-encoded string of bytes or - * a byte buffer. The number of bytes should be 12 (96 bits) as recommended - * by NIST SP-800-38D but another length may be given. - * - * @param options the options to use: - * iv the initialization vector to use as a binary-encoded string of - * bytes, null to reuse the last ciphered block from a previous - * update() (this "residue" method is for legacy support only). - * additionalData additional authentication data as a binary-encoded - * string of bytes, for 'GCM' mode, (default: none). - * tagLength desired length of authentication tag, in bits, for - * 'GCM' mode (0-128, default: 128). - * tag the authentication tag to check if decrypting, as a - * binary-encoded string of bytes. - * output the output the buffer to write to, null to create one. - */ -BlockCipher.prototype.start = function(options) { - options = options || {}; - var opts = {}; - for(var key in options) { - opts[key] = options[key]; - } - opts.decrypt = this._decrypt; - this._finish = false; - this._input = forge.util.createBuffer(); - this.output = options.output || forge.util.createBuffer(); - this.mode.start(opts); -}; +const nameStartChar = ':A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD'; +const nameChar = nameStartChar + '\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040'; +const nameRegexp = '[' + nameStartChar + '][' + nameChar + ']*' +const regexName = new RegExp('^' + nameRegexp + '$'); -/** - * Updates the next block according to the cipher mode. - * - * @param input the buffer to read from. - */ -BlockCipher.prototype.update = function(input) { - if(input) { - // input given, so empty it into the input buffer - this._input.putBuffer(input); +const getAllMatches = function(string, regex) { + const matches = []; + let match = regex.exec(string); + while (match) { + const allmatches = []; + allmatches.startIndex = regex.lastIndex - match[0].length; + const len = match.length; + for (let index = 0; index < len; index++) { + allmatches.push(match[index]); + } + matches.push(allmatches); + match = regex.exec(string); } + return matches; +}; - // do cipher operation until it needs more input and not finished - while(!this._op.call(this.mode, this._input, this.output, this._finish) && - !this._finish) {} +const isName = function(string) { + const match = regexName.exec(string); + return !(match === null || typeof match === 'undefined'); +}; - // free consumed memory from input buffer - this._input.compact(); +exports.isExist = function(v) { + return typeof v !== 'undefined'; +}; + +exports.isEmptyObject = function(obj) { + return Object.keys(obj).length === 0; }; /** - * Finishes encrypting or decrypting. - * - * @param pad a padding function to use in CBC mode, null for default, - * signature(blockSize, buffer, decrypt). - * - * @return true if successful, false on error. + * Copy all the properties of a into b. + * @param {*} target + * @param {*} a */ -BlockCipher.prototype.finish = function(pad) { - // backwards-compatibility w/deprecated padding API - // Note: will overwrite padding functions even after another start() call - if(pad && (this.mode.name === 'ECB' || this.mode.name === 'CBC')) { - this.mode.pad = function(input) { - return pad(this.blockSize, input, false); - }; - this.mode.unpad = function(output) { - return pad(this.blockSize, output, true); - }; - } - - // build options for padding and afterFinish functions - var options = {}; - options.decrypt = this._decrypt; - - // get # of bytes that won't fill a block - options.overflow = this._input.length() % this.blockSize; - - if(!this._decrypt && this.mode.pad) { - if(!this.mode.pad(this._input, options)) { - return false; +exports.merge = function(target, a, arrayMode) { + if (a) { + const keys = Object.keys(a); // will return an array of own properties + const len = keys.length; //don't make it inline + for (let i = 0; i < len; i++) { + if (arrayMode === 'strict') { + target[keys[i]] = [ a[keys[i]] ]; + } else { + target[keys[i]] = a[keys[i]]; + } } } +}; +/* exports.merge =function (b,a){ + return Object.assign(b,a); +} */ - // do final update - this._finish = true; - this.update(); - - if(this._decrypt && this.mode.unpad) { - if(!this.mode.unpad(this.output, options)) { - return false; - } +exports.getValue = function(v) { + if (exports.isExist(v)) { + return v; + } else { + return ''; } +}; - if(this.mode.afterFinish) { - if(!this.mode.afterFinish(this.output, options)) { - return false; - } - } +// const fakeCall = function(a) {return a;}; +// const fakeCallNoReturn = function() {}; - return true; -}; +exports.isName = isName; +exports.getAllMatches = getAllMatches; +exports.nameRegexp = nameRegexp; /***/ }), -<<<<<<< HEAD -/***/ 23540: -======= -/***/ 70857: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -/** - * Supported cipher modes. - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. - */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -__nccwpck_require__(19239); -======= -var forge = __nccwpck_require__(96630); -__nccwpck_require__(36536); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 16643: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -forge.cipher = forge.cipher || {}; -// supported cipher modes -var modes = module.exports = forge.cipher.modes = forge.cipher.modes || {}; -/** Electronic codebook (ECB) (Don't use this; it's not secure) **/ +const util = __nccwpck_require__(36311); -modes.ecb = function(options) { - options = options || {}; - this.name = 'ECB'; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = new Array(this._ints); - this._outBlock = new Array(this._ints); +const defaultOptions = { + allowBooleanAttributes: false, //A tag can have attributes without any value + unpairedTags: [] }; -modes.ecb.prototype.start = function(options) {}; +//const tagsPattern = new RegExp("<\\/?([\\w:\\-_\.]+)\\s*\/?>","g"); +exports.validate = function (xmlData, options) { + options = Object.assign({}, defaultOptions, options); -modes.ecb.prototype.encrypt = function(input, output, finish) { - // not enough input to encrypt - if(input.length() < this.blockSize && !(finish && input.length() > 0)) { - return true; - } + //xmlData = xmlData.replace(/(\r\n|\n|\r)/gm,"");//make it single line + //xmlData = xmlData.replace(/(^\s*<\?xml.*?\?>)/g,"");//Remove XML starting tag + //xmlData = xmlData.replace(/()/g,"");//Remove DOCTYPE + const tags = []; + let tagFound = false; - // get next block - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32(); + //indicates that the root tag has been closed (aka. depth 0 has been reached) + let reachedRoot = false; + + if (xmlData[0] === '\ufeff') { + // check for byte order mark (BOM) + xmlData = xmlData.substr(1); } + + for (let i = 0; i < xmlData.length; i++) { - // encrypt block - this.cipher.encrypt(this._inBlock, this._outBlock); + if (xmlData[i] === '<' && xmlData[i+1] === '?') { + i+=2; + i = readPI(xmlData,i); + if (i.err) return i; + }else if (xmlData[i] === '<') { + //starting of tag + //read until you reach to '>' avoiding any '>' in attribute value + let tagStartPos = i; + i++; + + if (xmlData[i] === '!') { + i = readCommentAndCDATA(xmlData, i); + continue; + } else { + let closingTag = false; + if (xmlData[i] === '/') { + //closing tag + closingTag = true; + i++; + } + //read tagname + let tagName = ''; + for (; i < xmlData.length && + xmlData[i] !== '>' && + xmlData[i] !== ' ' && + xmlData[i] !== '\t' && + xmlData[i] !== '\n' && + xmlData[i] !== '\r'; i++ + ) { + tagName += xmlData[i]; + } + tagName = tagName.trim(); + //console.log(tagName); - // write output - for(var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i]); - } -}; + if (tagName[tagName.length - 1] === '/') { + //self closing tag without attributes + tagName = tagName.substring(0, tagName.length - 1); + //continue; + i--; + } + if (!validateTagName(tagName)) { + let msg; + if (tagName.trim().length === 0) { + msg = "Invalid space after '<'."; + } else { + msg = "Tag '"+tagName+"' is an invalid name."; + } + return getErrorObject('InvalidTag', msg, getLineNumberForPosition(xmlData, i)); + } -modes.ecb.prototype.decrypt = function(input, output, finish) { - // not enough input to decrypt - if(input.length() < this.blockSize && !(finish && input.length() > 0)) { - return true; - } + const result = readAttributeStr(xmlData, i); + if (result === false) { + return getErrorObject('InvalidAttr', "Attributes for '"+tagName+"' have open quote.", getLineNumberForPosition(xmlData, i)); + } + let attrStr = result.value; + i = result.index; - // get next block - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32(); - } + if (attrStr[attrStr.length - 1] === '/') { + //self closing tag + const attrStrStart = i - attrStr.length; + attrStr = attrStr.substring(0, attrStr.length - 1); + const isValid = validateAttributeString(attrStr, options); + if (isValid === true) { + tagFound = true; + //continue; //text may presents after self closing tag + } else { + //the result from the nested function returns the position of the error within the attribute + //in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute + //this gives us the absolute index in the entire xml, which we can use to find the line at last + return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)); + } + } else if (closingTag) { + if (!result.tagClosed) { + return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' doesn't have proper closing.", getLineNumberForPosition(xmlData, i)); + } else if (attrStr.trim().length > 0) { + return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); + } else { + const otg = tags.pop(); + if (tagName !== otg.tagName) { + let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); + return getErrorObject('InvalidTag', + "Expected closing tag '"+otg.tagName+"' (opened in line "+openPos.line+", col "+openPos.col+") instead of closing tag '"+tagName+"'.", + getLineNumberForPosition(xmlData, tagStartPos)); + } - // decrypt block - this.cipher.decrypt(this._inBlock, this._outBlock); + //when there are no more tags, we reached the root level. + if (tags.length == 0) { + reachedRoot = true; + } + } + } else { + const isValid = validateAttributeString(attrStr, options); + if (isValid !== true) { + //the result from the nested function returns the position of the error within the attribute + //in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute + //this gives us the absolute index in the entire xml, which we can use to find the line at last + return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)); + } - // write output - for(var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i]); + //if the root level has been reached before ... + if (reachedRoot === true) { + return getErrorObject('InvalidXml', 'Multiple possible root nodes found.', getLineNumberForPosition(xmlData, i)); + } else if(options.unpairedTags.indexOf(tagName) !== -1){ + //don't push into stack + } else { + tags.push({tagName, tagStartPos}); + } + tagFound = true; + } + + //skip tag text value + //It may include comments and CDATA value + for (i++; i < xmlData.length; i++) { + if (xmlData[i] === '<') { + if (xmlData[i + 1] === '!') { + //comment or CADATA + i++; + i = readCommentAndCDATA(xmlData, i); + continue; + } else if (xmlData[i+1] === '?') { + i = readPI(xmlData, ++i); + if (i.err) return i; + } else{ + break; + } + } else if (xmlData[i] === '&') { + const afterAmp = validateAmpersand(xmlData, i); + if (afterAmp == -1) + return getErrorObject('InvalidChar', "char '&' is not expected.", getLineNumberForPosition(xmlData, i)); + i = afterAmp; + }else{ + if (reachedRoot === true && !isWhiteSpace(xmlData[i])) { + return getErrorObject('InvalidXml', "Extra text at the end", getLineNumberForPosition(xmlData, i)); + } + } + } //end of reading tag text value + if (xmlData[i] === '<') { + i--; + } + } + } else { + if ( isWhiteSpace(xmlData[i])) { + continue; + } + return getErrorObject('InvalidChar', "char '"+xmlData[i]+"' is not expected.", getLineNumberForPosition(xmlData, i)); + } + } + + if (!tagFound) { + return getErrorObject('InvalidXml', 'Start tag expected.', 1); + }else if (tags.length == 1) { + return getErrorObject('InvalidTag', "Unclosed tag '"+tags[0].tagName+"'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos)); + }else if (tags.length > 0) { + return getErrorObject('InvalidXml', "Invalid '"+ + JSON.stringify(tags.map(t => t.tagName), null, 4).replace(/\r?\n/g, '')+ + "' found.", {line: 1, col: 1}); } -}; -modes.ecb.prototype.pad = function(input, options) { - // add PKCS#7 padding to block (each pad byte is the - // value of the number of pad bytes) - var padding = (input.length() === this.blockSize ? - this.blockSize : (this.blockSize - input.length())); - input.fillWithByte(padding, padding); return true; }; -modes.ecb.prototype.unpad = function(output, options) { - // check for error: input data not a multiple of blockSize - if(options.overflow > 0) { - return false; +function isWhiteSpace(char){ + return char === ' ' || char === '\t' || char === '\n' || char === '\r'; +} +/** + * Read Processing insstructions and skip + * @param {*} xmlData + * @param {*} i + */ +function readPI(xmlData, i) { + const start = i; + for (; i < xmlData.length; i++) { + if (xmlData[i] == '?' || xmlData[i] == ' ') { + //tagname + const tagname = xmlData.substr(start, i - start); + if (i > 5 && tagname === 'xml') { + return getErrorObject('InvalidXml', 'XML declaration allowed only at the start of the document.', getLineNumberForPosition(xmlData, i)); + } else if (xmlData[i] == '?' && xmlData[i + 1] == '>') { + //check if valid attribut string + i++; + break; + } else { + continue; + } + } } + return i; +} - // ensure padding byte count is valid - var len = output.length(); - var count = output.at(len - 1); - if(count > (this.blockSize << 2)) { - return false; +function readCommentAndCDATA(xmlData, i) { + if (xmlData.length > i + 5 && xmlData[i + 1] === '-' && xmlData[i + 2] === '-') { + //comment + for (i += 3; i < xmlData.length; i++) { + if (xmlData[i] === '-' && xmlData[i + 1] === '-' && xmlData[i + 2] === '>') { + i += 2; + break; + } + } + } else if ( + xmlData.length > i + 8 && + xmlData[i + 1] === 'D' && + xmlData[i + 2] === 'O' && + xmlData[i + 3] === 'C' && + xmlData[i + 4] === 'T' && + xmlData[i + 5] === 'Y' && + xmlData[i + 6] === 'P' && + xmlData[i + 7] === 'E' + ) { + let angleBracketsCount = 1; + for (i += 8; i < xmlData.length; i++) { + if (xmlData[i] === '<') { + angleBracketsCount++; + } else if (xmlData[i] === '>') { + angleBracketsCount--; + if (angleBracketsCount === 0) { + break; + } + } + } + } else if ( + xmlData.length > i + 9 && + xmlData[i + 1] === '[' && + xmlData[i + 2] === 'C' && + xmlData[i + 3] === 'D' && + xmlData[i + 4] === 'A' && + xmlData[i + 5] === 'T' && + xmlData[i + 6] === 'A' && + xmlData[i + 7] === '[' + ) { + for (i += 8; i < xmlData.length; i++) { + if (xmlData[i] === ']' && xmlData[i + 1] === ']' && xmlData[i + 2] === '>') { + i += 2; + break; + } + } } - // trim off padding bytes - output.truncate(count); - return true; -}; - -/** Cipher-block Chaining (CBC) **/ + return i; +} -modes.cbc = function(options) { - options = options || {}; - this.name = 'CBC'; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = new Array(this._ints); - this._outBlock = new Array(this._ints); -}; +const doubleQuote = '"'; +const singleQuote = "'"; -modes.cbc.prototype.start = function(options) { - // Note: legacy support for using IV residue (has security flaws) - // if IV is null, reuse block from previous processing - if(options.iv === null) { - // must have a previous block - if(!this._prev) { - throw new Error('Invalid IV parameter.'); +/** + * Keep reading xmlData until '<' is found outside the attribute value. + * @param {string} xmlData + * @param {number} i + */ +function readAttributeStr(xmlData, i) { + let attrStr = ''; + let startChar = ''; + let tagClosed = false; + for (; i < xmlData.length; i++) { + if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) { + if (startChar === '') { + startChar = xmlData[i]; + } else if (startChar !== xmlData[i]) { + //if vaue is enclosed with double quote then single quotes are allowed inside the value and vice versa + } else { + startChar = ''; + } + } else if (xmlData[i] === '>') { + if (startChar === '') { + tagClosed = true; + break; + } } - this._iv = this._prev.slice(0); - } else if(!('iv' in options)) { - throw new Error('Invalid IV parameter.'); - } else { - // save IV as "previous" block - this._iv = transformIV(options.iv, this.blockSize); - this._prev = this._iv.slice(0); + attrStr += xmlData[i]; } -}; - -modes.cbc.prototype.encrypt = function(input, output, finish) { - // not enough input to encrypt - if(input.length() < this.blockSize && !(finish && input.length() > 0)) { - return true; + if (startChar !== '') { + return false; } - // get next block - // CBC XOR's IV (or previous block) with plaintext - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = this._prev[i] ^ input.getInt32(); - } + return { + value: attrStr, + index: i, + tagClosed: tagClosed + }; +} - // encrypt block - this.cipher.encrypt(this._inBlock, this._outBlock); +/** + * Select all the attributes whether valid or invalid. + */ +const validAttrStrRegxp = new RegExp('(\\s*)([^\\s=]+)(\\s*=)?(\\s*([\'"])(([\\s\\S])*?)\\5)?', 'g'); - // write output, save previous block - for(var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i]); - } - this._prev = this._outBlock; -}; +//attr, ="sd", a="amit's", a="sd"b="saf", ab cd="" -modes.cbc.prototype.decrypt = function(input, output, finish) { - // not enough input to decrypt - if(input.length() < this.blockSize && !(finish && input.length() > 0)) { - return true; - } +function validateAttributeString(attrStr, options) { + //console.log("start:"+attrStr+":end"); - // get next block - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32(); - } + //if(attrStr.trim().length === 0) return true; //empty string - // decrypt block - this.cipher.decrypt(this._inBlock, this._outBlock); + const matches = util.getAllMatches(attrStr, validAttrStrRegxp); + const attrNames = {}; - // write output, save previous ciphered block - // CBC XOR's IV (or previous block) with ciphertext - for(var i = 0; i < this._ints; ++i) { - output.putInt32(this._prev[i] ^ this._outBlock[i]); + for (let i = 0; i < matches.length; i++) { + if (matches[i][1].length === 0) { + //nospace before attribute name: a="sd"b="saf" + return getErrorObject('InvalidAttr', "Attribute '"+matches[i][2]+"' has no space in starting.", getPositionFromMatch(matches[i])) + } else if (matches[i][3] !== undefined && matches[i][4] === undefined) { + return getErrorObject('InvalidAttr', "Attribute '"+matches[i][2]+"' is without value.", getPositionFromMatch(matches[i])); + } else if (matches[i][3] === undefined && !options.allowBooleanAttributes) { + //independent attribute: ab + return getErrorObject('InvalidAttr', "boolean attribute '"+matches[i][2]+"' is not allowed.", getPositionFromMatch(matches[i])); + } + /* else if(matches[i][6] === undefined){//attribute without value: ab= + return { err: { code:"InvalidAttr",msg:"attribute " + matches[i][2] + " has no value assigned."}}; + } */ + const attrName = matches[i][2]; + if (!validateAttrName(attrName)) { + return getErrorObject('InvalidAttr', "Attribute '"+attrName+"' is an invalid name.", getPositionFromMatch(matches[i])); + } + if (!attrNames.hasOwnProperty(attrName)) { + //check for duplicate attribute. + attrNames[attrName] = 1; + } else { + return getErrorObject('InvalidAttr', "Attribute '"+attrName+"' is repeated.", getPositionFromMatch(matches[i])); + } } - this._prev = this._inBlock.slice(0); -}; -modes.cbc.prototype.pad = function(input, options) { - // add PKCS#7 padding to block (each pad byte is the - // value of the number of pad bytes) - var padding = (input.length() === this.blockSize ? - this.blockSize : (this.blockSize - input.length())); - input.fillWithByte(padding, padding); return true; -}; +} -modes.cbc.prototype.unpad = function(output, options) { - // check for error: input data not a multiple of blockSize - if(options.overflow > 0) { - return false; +function validateNumberAmpersand(xmlData, i) { + let re = /\d/; + if (xmlData[i] === 'x') { + i++; + re = /[\da-fA-F]/; + } + for (; i < xmlData.length; i++) { + if (xmlData[i] === ';') + return i; + if (!xmlData[i].match(re)) + break; } + return -1; +} - // ensure padding byte count is valid - var len = output.length(); - var count = output.at(len - 1); - if(count > (this.blockSize << 2)) { - return false; +function validateAmpersand(xmlData, i) { + // https://www.w3.org/TR/xml/#dt-charref + i++; + if (xmlData[i] === ';') + return -1; + if (xmlData[i] === '#') { + i++; + return validateNumberAmpersand(xmlData, i); + } + let count = 0; + for (; i < xmlData.length; i++, count++) { + if (xmlData[i].match(/\w/) && count < 20) + continue; + if (xmlData[i] === ';') + break; + return -1; } + return i; +} - // trim off padding bytes - output.truncate(count); - return true; -}; +function getErrorObject(code, message, lineNumber) { + return { + err: { + code: code, + msg: message, + line: lineNumber.line || lineNumber, + col: lineNumber.col, + }, + }; +} -/** Cipher feedback (CFB) **/ +function validateAttrName(attrName) { + return util.isName(attrName); +} -modes.cfb = function(options) { - options = options || {}; - this.name = 'CFB'; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = null; - this._outBlock = new Array(this._ints); - this._partialBlock = new Array(this._ints); - this._partialOutput = forge.util.createBuffer(); - this._partialBytes = 0; +// const startsWithXML = /^xml/i; + +function validateTagName(tagname) { + return util.isName(tagname) /* && !tagname.match(startsWithXML) */; +} + +//this function returns the line number for the character at the given index +function getLineNumberForPosition(xmlData, index) { + const lines = xmlData.substring(0, index).split(/\r?\n/); + return { + line: lines.length, + + // column number is last line's length + 1, because column numbering starts at 1: + col: lines[lines.length - 1].length + 1 + }; +} + +//this function returns the position of the first character of match within attrStr +function getPositionFromMatch(match) { + return match.startIndex + match[1].length; +} + + +/***/ }), + +/***/ 12503: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + +//parse Empty Node as self closing node +const buildFromOrderedJs = __nccwpck_require__(77201); + +const defaultOptions = { + attributeNamePrefix: '@_', + attributesGroupName: false, + textNodeName: '#text', + ignoreAttributes: true, + cdataPropName: false, + format: false, + indentBy: ' ', + suppressEmptyNode: false, + suppressUnpairedNode: true, + suppressBooleanAttributes: true, + tagValueProcessor: function(key, a) { + return a; + }, + attributeValueProcessor: function(attrName, a) { + return a; + }, + preserveOrder: false, + commentPropName: false, + unpairedTags: [], + entities: [ + { regex: new RegExp("&", "g"), val: "&" },//it must be on top + { regex: new RegExp(">", "g"), val: ">" }, + { regex: new RegExp("<", "g"), val: "<" }, + { regex: new RegExp("\'", "g"), val: "'" }, + { regex: new RegExp("\"", "g"), val: """ } + ], + processEntities: true, + stopNodes: [], + // transformTagName: false, + // transformAttributeName: false, + oneListGroup: false }; -modes.cfb.prototype.start = function(options) { - if(!('iv' in options)) { - throw new Error('Invalid IV parameter.'); +function Builder(options) { + this.options = Object.assign({}, defaultOptions, options); + if (this.options.ignoreAttributes || this.options.attributesGroupName) { + this.isAttribute = function(/*a*/) { + return false; + }; + } else { + this.attrPrefixLen = this.options.attributeNamePrefix.length; + this.isAttribute = isAttribute; } - // use IV as first input - this._iv = transformIV(options.iv, this.blockSize); - this._inBlock = this._iv.slice(0); - this._partialBytes = 0; -}; -modes.cfb.prototype.encrypt = function(input, output, finish) { - // not enough input to encrypt - var inputLength = input.length(); - if(inputLength === 0) { - return true; + this.processTextOrObjNode = processTextOrObjNode + + if (this.options.format) { + this.indentate = indentate; + this.tagEndChar = '>\n'; + this.newLine = '\n'; + } else { + this.indentate = function() { + return ''; + }; + this.tagEndChar = '>'; + this.newLine = ''; } +} - // encrypt block - this.cipher.encrypt(this._inBlock, this._outBlock); +Builder.prototype.build = function(jObj) { + if(this.options.preserveOrder){ + return buildFromOrderedJs(jObj, this.options); + }else { + if(Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1){ + jObj = { + [this.options.arrayNodeName] : jObj + } + } + return this.j2x(jObj, 0).val; + } +}; - // handle full block - if(this._partialBytes === 0 && inputLength >= this.blockSize) { - // XOR input with output, write input as output - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32() ^ this._outBlock[i]; - output.putInt32(this._inBlock[i]); +Builder.prototype.j2x = function(jObj, level) { + let attrStr = ''; + let val = ''; + for (let key in jObj) { + if (typeof jObj[key] === 'undefined') { + // supress undefined node + } else if (jObj[key] === null) { + if(key[0] === "?") val += this.indentate(level) + '<' + key + '?' + this.tagEndChar; + else val += this.indentate(level) + '<' + key + '/' + this.tagEndChar; + // val += this.indentate(level) + '<' + key + '/' + this.tagEndChar; + } else if (jObj[key] instanceof Date) { + val += this.buildTextValNode(jObj[key], key, '', level); + } else if (typeof jObj[key] !== 'object') { + //premitive type + const attr = this.isAttribute(key); + if (attr) { + attrStr += this.buildAttrPairStr(attr, '' + jObj[key]); + }else { + //tag value + if (key === this.options.textNodeName) { + let newval = this.options.tagValueProcessor(key, '' + jObj[key]); + val += this.replaceEntitiesValue(newval); + } else { + val += this.buildTextValNode(jObj[key], key, '', level); + } + } + } else if (Array.isArray(jObj[key])) { + //repeated nodes + const arrLen = jObj[key].length; + let listTagVal = ""; + for (let j = 0; j < arrLen; j++) { + const item = jObj[key][j]; + if (typeof item === 'undefined') { + // supress undefined node + } else if (item === null) { + if(key[0] === "?") val += this.indentate(level) + '<' + key + '?' + this.tagEndChar; + else val += this.indentate(level) + '<' + key + '/' + this.tagEndChar; + // val += this.indentate(level) + '<' + key + '/' + this.tagEndChar; + } else if (typeof item === 'object') { + if(this.options.oneListGroup ){ + listTagVal += this.j2x(item, level + 1).val; + }else{ + listTagVal += this.processTextOrObjNode(item, key, level) + } + } else { + listTagVal += this.buildTextValNode(item, key, '', level); + } + } + if(this.options.oneListGroup){ + listTagVal = this.buildObjectNode(listTagVal, key, '', level); + } + val += listTagVal; + } else { + //nested node + if (this.options.attributesGroupName && key === this.options.attributesGroupName) { + const Ks = Object.keys(jObj[key]); + const L = Ks.length; + for (let j = 0; j < L; j++) { + attrStr += this.buildAttrPairStr(Ks[j], '' + jObj[key][Ks[j]]); + } + } else { + val += this.processTextOrObjNode(jObj[key], key, level) + } } - return; } + return {attrStr: attrStr, val: val}; +}; - // handle partial block - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if(partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; +Builder.prototype.buildAttrPairStr = function(attrName, val){ + val = this.options.attributeValueProcessor(attrName, '' + val); + val = this.replaceEntitiesValue(val); + if (this.options.suppressBooleanAttributes && val === "true") { + return ' ' + attrName; + } else return ' ' + attrName + '="' + val + '"'; +} + +function processTextOrObjNode (object, key, level) { + const result = this.j2x(object, level + 1); + if (object[this.options.textNodeName] !== undefined && Object.keys(object).length === 1) { + return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level); + } else { + return this.buildObjectNode(result.val, key, result.attrStr, level); } +} - // XOR input with output, write input as partial output - this._partialOutput.clear(); - for(var i = 0; i < this._ints; ++i) { - this._partialBlock[i] = input.getInt32() ^ this._outBlock[i]; - this._partialOutput.putInt32(this._partialBlock[i]); +Builder.prototype.buildObjectNode = function(val, key, attrStr, level) { + if(val === ""){ + if(key[0] === "?") return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar; + else { + return this.indentate(level) + '<' + key + attrStr + this.closeTag(key) + this.tagEndChar; + } + }else{ + + let tagEndExp = '' + val + tagEndExp ); + } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) { + return this.indentate(level) + `` + this.newLine; + }else { + return ( + this.indentate(level) + '<' + key + attrStr + piClosingChar + this.tagEndChar + + val + + this.indentate(level) + tagEndExp ); + } } +} - if(partialBytes > 0) { - // block still incomplete, restore input buffer - input.read -= this.blockSize; +Builder.prototype.closeTag = function(key){ + let closeTag = ""; + if(this.options.unpairedTags.indexOf(key) !== -1){ //unpaired + if(!this.options.suppressUnpairedNode) closeTag = "/" + }else if(this.options.suppressEmptyNode){ //empty + closeTag = "/"; + }else{ + closeTag = `> 0) { - this._partialOutput.getBytes(this._partialBytes); +Builder.prototype.buildTextValNode = function(val, key, attrStr, level) { + if (this.options.cdataPropName !== false && key === this.options.cdataPropName) { + return this.indentate(level) + `` + this.newLine; + }else if (this.options.commentPropName !== false && key === this.options.commentPropName) { + return this.indentate(level) + `` + this.newLine; + }else if(key[0] === "?") {//PI tag + return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar; + }else{ + let textValue = this.options.tagValueProcessor(key, val); + textValue = this.replaceEntitiesValue(textValue); + + if( textValue === ''){ + return this.indentate(level) + '<' + key + attrStr + this.closeTag(key) + this.tagEndChar; + }else{ + return this.indentate(level) + '<' + key + attrStr + '>' + + textValue + + ' 0 && !finish) { - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes)); - this._partialBytes = partialBytes; - return true; +Builder.prototype.replaceEntitiesValue = function(textValue){ + if(textValue && textValue.length > 0 && this.options.processEntities){ + for (let i=0; i= this.blockSize) { - // XOR input with output, write input as output - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32(); - output.putInt32(this._inBlock[i] ^ this._outBlock[i]); + +/***/ }), + +/***/ 77201: +/***/ ((module) => { + +const EOL = "\n"; + +/** + * + * @param {array} jArray + * @param {any} options + * @returns + */ +function toXml(jArray, options) { + let indentation = ""; + if (options.format && options.indentBy.length > 0) { + indentation = EOL; } - return; - } + return arrToStr(jArray, options, "", indentation); +} - // handle partial block - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if(partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; - } +function arrToStr(arr, options, jPath, indentation) { + let xmlStr = ""; + let isPreviousElementTag = false; - // XOR input with output, write input as partial output - this._partialOutput.clear(); - for(var i = 0; i < this._ints; ++i) { - this._partialBlock[i] = input.getInt32(); - this._partialOutput.putInt32(this._partialBlock[i] ^ this._outBlock[i]); - } + for (let i = 0; i < arr.length; i++) { + const tagObj = arr[i]; + const tagName = propName(tagObj); + let newJPath = ""; + if (jPath.length === 0) newJPath = tagName + else newJPath = `${jPath}.${tagName}`; - if(partialBytes > 0) { - // block still incomplete, restore input buffer - input.read -= this.blockSize; - } else { - // block complete, update input block - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = this._partialBlock[i]; + if (tagName === options.textNodeName) { + let tagText = tagObj[tagName]; + if (!isStopNode(newJPath, options)) { + tagText = options.tagValueProcessor(tagName, tagText); + tagText = replaceEntitiesValue(tagText, options); + } + if (isPreviousElementTag) { + xmlStr += indentation; + } + xmlStr += tagText; + isPreviousElementTag = false; + continue; + } else if (tagName === options.cdataPropName) { + if (isPreviousElementTag) { + xmlStr += indentation; + } + xmlStr += ``; + isPreviousElementTag = false; + continue; + } else if (tagName === options.commentPropName) { + xmlStr += indentation + ``; + isPreviousElementTag = true; + continue; + } else if (tagName[0] === "?") { + const attStr = attr_to_str(tagObj[":@"], options); + const tempInd = tagName === "?xml" ? "" : indentation; + let piTextNodeName = tagObj[tagName][0][options.textNodeName]; + piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; //remove extra spacing + xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr}?>`; + isPreviousElementTag = true; + continue; + } + let newIdentation = indentation; + if (newIdentation !== "") { + newIdentation += options.indentBy; + } + const attStr = attr_to_str(tagObj[":@"], options); + const tagStart = indentation + `<${tagName}${attStr}`; + const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation); + if (options.unpairedTags.indexOf(tagName) !== -1) { + if (options.suppressUnpairedNode) xmlStr += tagStart + ">"; + else xmlStr += tagStart + "/>"; + } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) { + xmlStr += tagStart + "/>"; + } else if (tagValue && tagValue.endsWith(">")) { + xmlStr += tagStart + `>${tagValue}${indentation}`; + } else { + xmlStr += tagStart + ">"; + if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("`; + } + isPreviousElementTag = true; } - } - - // skip any previous partial bytes - if(this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); - } - - if(partialBytes > 0 && !finish) { - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes)); - this._partialBytes = partialBytes; - return true; - } - - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes)); - this._partialBytes = 0; -}; - -/** Output feedback (OFB) **/ -modes.ofb = function(options) { - options = options || {}; - this.name = 'OFB'; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = null; - this._outBlock = new Array(this._ints); - this._partialOutput = forge.util.createBuffer(); - this._partialBytes = 0; -}; - -modes.ofb.prototype.start = function(options) { - if(!('iv' in options)) { - throw new Error('Invalid IV parameter.'); - } - // use IV as first input - this._iv = transformIV(options.iv, this.blockSize); - this._inBlock = this._iv.slice(0); - this._partialBytes = 0; -}; - -modes.ofb.prototype.encrypt = function(input, output, finish) { - // not enough input to encrypt - var inputLength = input.length(); - if(input.length() === 0) { - return true; - } - - // encrypt block (OFB always uses encryption mode) - this.cipher.encrypt(this._inBlock, this._outBlock); + return xmlStr; +} - // handle full block - if(this._partialBytes === 0 && inputLength >= this.blockSize) { - // XOR input with output and update next input - for(var i = 0; i < this._ints; ++i) { - output.putInt32(input.getInt32() ^ this._outBlock[i]); - this._inBlock[i] = this._outBlock[i]; +function propName(obj) { + const keys = Object.keys(obj); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + if (key !== ":@") return key; } - return; - } - - // handle partial block - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if(partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; - } +} - // XOR input with output - this._partialOutput.clear(); - for(var i = 0; i < this._ints; ++i) { - this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); - } +function attr_to_str(attrMap, options) { + let attrStr = ""; + if (attrMap && !options.ignoreAttributes) { + for (let attr in attrMap) { + let attrVal = options.attributeValueProcessor(attr, attrMap[attr]); + attrVal = replaceEntitiesValue(attrVal, options); + if (attrVal === true && options.suppressBooleanAttributes) { + attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; + } else { + attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; + } + } + } + return attrStr; +} - if(partialBytes > 0) { - // block still incomplete, restore input buffer - input.read -= this.blockSize; - } else { - // block complete, update input block - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = this._outBlock[i]; +function isStopNode(jPath, options) { + jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1); + let tagName = jPath.substr(jPath.lastIndexOf(".") + 1); + for (let index in options.stopNodes) { + if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true; } - } + return false; +} - // skip any previous partial bytes - if(this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); - } +function replaceEntitiesValue(textValue, options) { + if (textValue && textValue.length > 0 && options.processEntities) { + for (let i = 0; i < options.entities.length; i++) { + const entity = options.entities[i]; + textValue = textValue.replace(entity.regex, entity.val); + } + } + return textValue; +} +module.exports = toXml; - if(partialBytes > 0 && !finish) { - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes)); - this._partialBytes = partialBytes; - return true; - } - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes)); - this._partialBytes = 0; -}; +/***/ }), -modes.ofb.prototype.decrypt = modes.ofb.prototype.encrypt; +/***/ 33566: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Counter (CTR) **/ +const util = __nccwpck_require__(36311); -modes.ctr = function(options) { - options = options || {}; - this.name = 'CTR'; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = null; - this._outBlock = new Array(this._ints); - this._partialOutput = forge.util.createBuffer(); - this._partialBytes = 0; -}; +//TODO: handle comments +function readDocType(xmlData, i){ + + const entities = {}; + if( xmlData[i + 3] === 'O' && + xmlData[i + 4] === 'C' && + xmlData[i + 5] === 'T' && + xmlData[i + 6] === 'Y' && + xmlData[i + 7] === 'P' && + xmlData[i + 8] === 'E') + { + i = i+9; + let angleBracketsCount = 1; + let hasBody = false, comment = false; + let exp = ""; + for(;i') { //Read tag content + if(comment){ + if( xmlData[i - 1] === "-" && xmlData[i - 2] === "-"){ + comment = false; + angleBracketsCount--; + } + }else{ + angleBracketsCount--; + } + if (angleBracketsCount === 0) { + break; + } + }else if( xmlData[i] === '['){ + hasBody = true; + }else{ + exp += xmlData[i]; + } + } + if(angleBracketsCount !== 0){ + throw new Error(`Unclosed DOCTYPE`); + } + }else{ + throw new Error(`Invalid Tag instead of DOCTYPE`); + } + return {entities, i}; +} -modes.ctr.prototype.encrypt = function(input, output, finish) { - // not enough input to encrypt - var inputLength = input.length(); - if(inputLength === 0) { - return true; - } +function readEntityExp(xmlData,i){ + //External entities are not supported + // - // encrypt block (CTR always uses encryption mode) - this.cipher.encrypt(this._inBlock, this._outBlock); + //Parameter entities are not supported + // - // handle full block - if(this._partialBytes === 0 && inputLength >= this.blockSize) { - // XOR input with output - for(var i = 0; i < this._ints; ++i) { - output.putInt32(input.getInt32() ^ this._outBlock[i]); - } - } else { - // handle partial block - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if(partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; + //Internal entities are supported + // + + //read EntityName + let entityName = ""; + for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"' ); i++) { + // if(xmlData[i] === " ") continue; + // else + entityName += xmlData[i]; } + entityName = entityName.trim(); + if(entityName.indexOf(" ") !== -1) throw new Error("External entites are not supported"); - // XOR input with output - this._partialOutput.clear(); - for(var i = 0; i < this._ints; ++i) { - this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); + //read Entity Value + const startChar = xmlData[i++]; + let val = "" + for (; i < xmlData.length && xmlData[i] !== startChar ; i++) { + val += xmlData[i]; } + return [entityName, val, i]; +} - if(partialBytes > 0) { - // block still incomplete, restore input buffer - input.read -= this.blockSize; - } +function isComment(xmlData, i){ + if(xmlData[i+1] === '!' && + xmlData[i+2] === '-' && + xmlData[i+3] === '-') return true + return false +} +function isEntity(xmlData, i){ + if(xmlData[i+1] === '!' && + xmlData[i+2] === 'E' && + xmlData[i+3] === 'N' && + xmlData[i+4] === 'T' && + xmlData[i+5] === 'I' && + xmlData[i+6] === 'T' && + xmlData[i+7] === 'Y') return true + return false +} +function isElement(xmlData, i){ + if(xmlData[i+1] === '!' && + xmlData[i+2] === 'E' && + xmlData[i+3] === 'L' && + xmlData[i+4] === 'E' && + xmlData[i+5] === 'M' && + xmlData[i+6] === 'E' && + xmlData[i+7] === 'N' && + xmlData[i+8] === 'T') return true + return false +} - // skip any previous partial bytes - if(this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); - } +function isAttlist(xmlData, i){ + if(xmlData[i+1] === '!' && + xmlData[i+2] === 'A' && + xmlData[i+3] === 'T' && + xmlData[i+4] === 'T' && + xmlData[i+5] === 'L' && + xmlData[i+6] === 'I' && + xmlData[i+7] === 'S' && + xmlData[i+8] === 'T') return true + return false +} +function isNotation(xmlData, i){ + if(xmlData[i+1] === '!' && + xmlData[i+2] === 'N' && + xmlData[i+3] === 'O' && + xmlData[i+4] === 'T' && + xmlData[i+5] === 'A' && + xmlData[i+6] === 'T' && + xmlData[i+7] === 'I' && + xmlData[i+8] === 'O' && + xmlData[i+9] === 'N') return true + return false +} - if(partialBytes > 0 && !finish) { - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes)); - this._partialBytes = partialBytes; - return true; - } +function validateEntityName(name){ + if (util.isName(name)) + return name; + else + throw new Error(`Invalid entity name ${name}`); +} - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes)); - this._partialBytes = 0; - } +module.exports = readDocType; - // block complete, increment counter (input block) - inc32(this._inBlock); -}; -modes.ctr.prototype.decrypt = modes.ctr.prototype.encrypt; +/***/ }), -/** Galois/Counter Mode (GCM) **/ +/***/ 88473: +/***/ ((__unused_webpack_module, exports) => { -modes.gcm = function(options) { - options = options || {}; - this.name = 'GCM'; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = new Array(this._ints); - this._outBlock = new Array(this._ints); - this._partialOutput = forge.util.createBuffer(); - this._partialBytes = 0; - // R is actually this value concatenated with 120 more zero bits, but - // we only XOR against R so the other zeros have no effect -- we just - // apply this value to the first integer in a block - this._R = 0xE1000000; +const defaultOptions = { + preserveOrder: false, + attributeNamePrefix: '@_', + attributesGroupName: false, + textNodeName: '#text', + ignoreAttributes: true, + removeNSPrefix: false, // remove NS from tag name or attribute name if true + allowBooleanAttributes: false, //a tag can have attributes without any value + //ignoreRootElement : false, + parseTagValue: true, + parseAttributeValue: false, + trimValues: true, //Trim string values of tag and attributes + cdataPropName: false, + numberParseOptions: { + hex: true, + leadingZeros: true, + eNotation: true + }, + tagValueProcessor: function(tagName, val) { + return val; + }, + attributeValueProcessor: function(attrName, val) { + return val; + }, + stopNodes: [], //nested tags will not be parsed even for errors + alwaysCreateTextNode: false, + isArray: () => false, + commentPropName: false, + unpairedTags: [], + processEntities: true, + htmlEntities: false, + ignoreDeclaration: false, + ignorePiTags: false, + transformTagName: false, + transformAttributeName: false, + updateTag: function(tagName, jPath, attrs){ + return tagName + }, + // skipEmptyListItem: false +}; + +const buildOptions = function(options) { + return Object.assign({}, defaultOptions, options); }; -modes.gcm.prototype.start = function(options) { - if(!('iv' in options)) { - throw new Error('Invalid IV parameter.'); - } - // ensure IV is a byte buffer - var iv = forge.util.createBuffer(options.iv); - - // no ciphered data processed yet - this._cipherLength = 0; +exports.buildOptions = buildOptions; +exports.defaultOptions = defaultOptions; - // default additional data is none - var additionalData; - if('additionalData' in options) { - additionalData = forge.util.createBuffer(options.additionalData); - } else { - additionalData = forge.util.createBuffer(); - } +/***/ }), - // default tag length is 128 bits - if('tagLength' in options) { - this._tagLength = options.tagLength; - } else { - this._tagLength = 128; - } +/***/ 11165: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // if tag is given, ensure tag matches tag length - this._tag = null; - if(options.decrypt) { - // save tag to check later - this._tag = forge.util.createBuffer(options.tag).getBytes(); - if(this._tag.length !== (this._tagLength / 8)) { - throw new Error('Authentication tag does not match tag length.'); - } - } - // create tmp storage for hash calculation - this._hashBlock = new Array(this._ints); +///@ts-check - // no tag generated yet - this.tag = null; +const util = __nccwpck_require__(36311); +const xmlNode = __nccwpck_require__(69559); +const readDocType = __nccwpck_require__(33566); +const toNumber = __nccwpck_require__(44739); - // generate hash subkey - // (apply block cipher to "zero" block) - this._hashSubkey = new Array(this._ints); - this.cipher.encrypt([0, 0, 0, 0], this._hashSubkey); +const regx = + '<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)' + .replace(/NAME/g, util.nameRegexp); - // generate table M - // use 4-bit tables (32 component decomposition of a 16 byte value) - // 8-bit tables take more space and are known to have security - // vulnerabilities (in native implementations) - this.componentBits = 4; - this._m = this.generateHashTable(this._hashSubkey, this.componentBits); +//const tagsRegx = new RegExp("<(\\/?[\\w:\\-\._]+)([^>]*)>(\\s*"+cdataRegx+")*([^<]+)?","g"); +//const tagsRegx = new RegExp("<(\\/?)((\\w*:)?([\\w:\\-\._]+))([^>]*)>([^<]*)("+cdataRegx+"([^<]*))*([^<]+)?","g"); - // Note: support IV length different from 96 bits? (only supporting - // 96 bits is recommended by NIST SP-800-38D) - // generate J_0 - var ivLength = iv.length(); - if(ivLength === 12) { - // 96-bit IV - this._j0 = [iv.getInt32(), iv.getInt32(), iv.getInt32(), 1]; - } else { - // IV is NOT 96-bits - this._j0 = [0, 0, 0, 0]; - while(iv.length() > 0) { - this._j0 = this.ghash( - this._hashSubkey, this._j0, - [iv.getInt32(), iv.getInt32(), iv.getInt32(), iv.getInt32()]); - } - this._j0 = this.ghash( - this._hashSubkey, this._j0, [0, 0].concat(from64To32(ivLength * 8))); +class OrderedObjParser{ + constructor(options){ + this.options = options; + this.currentNode = null; + this.tagsNodeStack = []; + this.docTypeEntities = {}; + this.lastEntities = { + "apos" : { regex: /&(apos|#39|#x27);/g, val : "'"}, + "gt" : { regex: /&(gt|#62|#x3E);/g, val : ">"}, + "lt" : { regex: /&(lt|#60|#x3C);/g, val : "<"}, + "quot" : { regex: /&(quot|#34|#x22);/g, val : "\""}, + }; + this.ampEntity = { regex: /&(amp|#38|#x26);/g, val : "&"}; + this.htmlEntities = { + "space": { regex: /&(nbsp|#160);/g, val: " " }, + // "lt" : { regex: /&(lt|#60);/g, val: "<" }, + // "gt" : { regex: /&(gt|#62);/g, val: ">" }, + // "amp" : { regex: /&(amp|#38);/g, val: "&" }, + // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, + // "apos" : { regex: /&(apos|#39);/g, val: "'" }, + "cent" : { regex: /&(cent|#162);/g, val: "¢" }, + "pound" : { regex: /&(pound|#163);/g, val: "£" }, + "yen" : { regex: /&(yen|#165);/g, val: "¥" }, + "euro" : { regex: /&(euro|#8364);/g, val: "€" }, + "copyright" : { regex: /&(copy|#169);/g, val: "©" }, + "reg" : { regex: /&(reg|#174);/g, val: "®" }, + "inr" : { regex: /&(inr|#8377);/g, val: "₹" }, + }; + this.addExternalEntities = addExternalEntities; + this.parseXml = parseXml; + this.parseTextData = parseTextData; + this.resolveNameSpace = resolveNameSpace; + this.buildAttributesMap = buildAttributesMap; + this.isItStopNode = isItStopNode; + this.replaceEntitiesValue = replaceEntitiesValue; + this.readStopNodeData = readStopNodeData; + this.saveTextToParentTag = saveTextToParentTag; + this.addChild = addChild; } - // generate ICB (initial counter block) - this._inBlock = this._j0.slice(0); - inc32(this._inBlock); - this._partialBytes = 0; +} - // consume authentication data - additionalData = forge.util.createBuffer(additionalData); - // save additional data length as a BE 64-bit number - this._aDataLength = from64To32(additionalData.length() * 8); - // pad additional data to 128 bit (16 byte) block size - var overflow = additionalData.length() % this.blockSize; - if(overflow) { - additionalData.fillWithByte(0, this.blockSize - overflow); - } - this._s = [0, 0, 0, 0]; - while(additionalData.length() > 0) { - this._s = this.ghash(this._hashSubkey, this._s, [ - additionalData.getInt32(), - additionalData.getInt32(), - additionalData.getInt32(), - additionalData.getInt32() - ]); +function addExternalEntities(externalEntities){ + const entKeys = Object.keys(externalEntities); + for (let i = 0; i < entKeys.length; i++) { + const ent = entKeys[i]; + this.lastEntities[ent] = { + regex: new RegExp("&"+ent+";","g"), + val : externalEntities[ent] + } } -}; +} -modes.gcm.prototype.encrypt = function(input, output, finish) { - // not enough input to encrypt - var inputLength = input.length(); - if(inputLength === 0) { - return true; +/** + * @param {string} val + * @param {string} tagName + * @param {string} jPath + * @param {boolean} dontTrim + * @param {boolean} hasAttributes + * @param {boolean} isLeafNode + * @param {boolean} escapeEntities + */ +function parseTextData(val, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { + if (val !== undefined) { + if (this.options.trimValues && !dontTrim) { + val = val.trim(); + } + if(val.length > 0){ + if(!escapeEntities) val = this.replaceEntitiesValue(val); + + const newval = this.options.tagValueProcessor(tagName, val, jPath, hasAttributes, isLeafNode); + if(newval === null || newval === undefined){ + //don't parse + return val; + }else if(typeof newval !== typeof val || newval !== val){ + //overwrite + return newval; + }else if(this.options.trimValues){ + return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions); + }else{ + const trimmedVal = val.trim(); + if(trimmedVal === val){ + return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions); + }else{ + return val; + } + } + } } +} - // encrypt block - this.cipher.encrypt(this._inBlock, this._outBlock); - - // handle full block - if(this._partialBytes === 0 && inputLength >= this.blockSize) { - // XOR input with output - for(var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i] ^= input.getInt32()); +function resolveNameSpace(tagname) { + if (this.options.removeNSPrefix) { + const tags = tagname.split(':'); + const prefix = tagname.charAt(0) === '/' ? '/' : ''; + if (tags[0] === 'xmlns') { + return ''; } - this._cipherLength += this.blockSize; - } else { - // handle partial block - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if(partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; + if (tags.length === 2) { + tagname = prefix + tags[1]; } + } + return tagname; +} - // XOR input with output - this._partialOutput.clear(); - for(var i = 0; i < this._ints; ++i) { - this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); - } +//TODO: change regex to capture NS +//const attrsRegx = new RegExp("([\\w\\-\\.\\:]+)\\s*=\\s*(['\"])((.|\n)*?)\\2","gm"); +const attrsRegx = new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?', 'gm'); - if(partialBytes <= 0 || finish) { - // handle overflow prior to hashing - if(finish) { - // get block overflow - var overflow = inputLength % this.blockSize; - this._cipherLength += overflow; - // truncate for hash function - this._partialOutput.truncate(this.blockSize - overflow); - } else { - this._cipherLength += this.blockSize; - } +function buildAttributesMap(attrStr, jPath, tagName) { + if (!this.options.ignoreAttributes && typeof attrStr === 'string') { + // attrStr = attrStr.replace(/\r?\n/g, ' '); + //attrStr = attrStr || attrStr.trim(); - // get output block for hashing - for(var i = 0; i < this._ints; ++i) { - this._outBlock[i] = this._partialOutput.getInt32(); + const matches = util.getAllMatches(attrStr, attrsRegx); + const len = matches.length; //don't make it inline + const attrs = {}; + for (let i = 0; i < len; i++) { + const attrName = this.resolveNameSpace(matches[i][1]); + let oldVal = matches[i][4]; + let aName = this.options.attributeNamePrefix + attrName; + if (attrName.length) { + if (this.options.transformAttributeName) { + aName = this.options.transformAttributeName(aName); + } + if(aName === "__proto__") aName = "#__proto__"; + if (oldVal !== undefined) { + if (this.options.trimValues) { + oldVal = oldVal.trim(); + } + oldVal = this.replaceEntitiesValue(oldVal); + const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); + if(newVal === null || newVal === undefined){ + //don't parse + attrs[aName] = oldVal; + }else if(typeof newVal !== typeof oldVal || newVal !== oldVal){ + //overwrite + attrs[aName] = newVal; + }else{ + //parse + attrs[aName] = parseValue( + oldVal, + this.options.parseAttributeValue, + this.options.numberParseOptions + ); + } + } else if (this.options.allowBooleanAttributes) { + attrs[aName] = true; + } } - this._partialOutput.read -= this.blockSize; } - - // skip any previous partial bytes - if(this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); + if (!Object.keys(attrs).length) { + return; } - - if(partialBytes > 0 && !finish) { - // block still incomplete, restore input buffer, get partial output, - // and return early - input.read -= this.blockSize; - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes)); - this._partialBytes = partialBytes; - return true; + if (this.options.attributesGroupName) { + const attrCollection = {}; + attrCollection[this.options.attributesGroupName] = attrs; + return attrCollection; } - - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes)); - this._partialBytes = 0; + return attrs } +} - // update hash block S - this._s = this.ghash(this._hashSubkey, this._s, this._outBlock); +const parseXml = function(xmlData) { + xmlData = xmlData.replace(/\r\n?/g, "\n"); //TODO: remove this line + const xmlObj = new xmlNode('!xml'); + let currentNode = xmlObj; + let textData = ""; + let jPath = ""; + for(let i=0; i< xmlData.length; i++){//for each char in XML data + const ch = xmlData[i]; + if(ch === '<'){ + // const nextIndex = i+1; + // const _2ndChar = xmlData[nextIndex]; + if( xmlData[i+1] === '/') {//Closing Tag + const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed.") + let tagName = xmlData.substring(i+2,closeIndex).trim(); - // increment counter (input block) - inc32(this._inBlock); -}; + if(this.options.removeNSPrefix){ + const colonIndex = tagName.indexOf(":"); + if(colonIndex !== -1){ + tagName = tagName.substr(colonIndex+1); + } + } -modes.gcm.prototype.decrypt = function(input, output, finish) { - // not enough input to decrypt - var inputLength = input.length(); - if(inputLength < this.blockSize && !(finish && inputLength > 0)) { - return true; - } + if(this.options.transformTagName) { + tagName = this.options.transformTagName(tagName); + } - // encrypt block (GCM always uses encryption mode) - this.cipher.encrypt(this._inBlock, this._outBlock); + if(currentNode){ + textData = this.saveTextToParentTag(textData, currentNode, jPath); + } - // increment counter (input block) - inc32(this._inBlock); + //check if last tag of nested tag was unpaired tag + const lastTagName = jPath.substring(jPath.lastIndexOf(".")+1); + if(tagName && this.options.unpairedTags.indexOf(tagName) !== -1 ){ + throw new Error(`Unpaired tag can not be used as closing tag: `); + } + let propIndex = 0 + if(lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1 ){ + propIndex = jPath.lastIndexOf('.', jPath.lastIndexOf('.')-1) + this.tagsNodeStack.pop(); + }else{ + propIndex = jPath.lastIndexOf("."); + } + jPath = jPath.substring(0, propIndex); - // update hash block S - this._hashBlock[0] = input.getInt32(); - this._hashBlock[1] = input.getInt32(); - this._hashBlock[2] = input.getInt32(); - this._hashBlock[3] = input.getInt32(); - this._s = this.ghash(this._hashSubkey, this._s, this._hashBlock); + currentNode = this.tagsNodeStack.pop();//avoid recursion, set the parent tag scope + textData = ""; + i = closeIndex; + } else if( xmlData[i+1] === '?') { - // XOR hash input with output - for(var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i] ^ this._hashBlock[i]); - } + let tagData = readTagExp(xmlData,i, false, "?>"); + if(!tagData) throw new Error("Pi Tag is not closed."); - // increment cipher data length - if(inputLength < this.blockSize) { - this._cipherLength += inputLength % this.blockSize; - } else { - this._cipherLength += this.blockSize; - } -}; + textData = this.saveTextToParentTag(textData, currentNode, jPath); + if( (this.options.ignoreDeclaration && tagData.tagName === "?xml") || this.options.ignorePiTags){ -modes.gcm.prototype.afterFinish = function(output, options) { - var rval = true; + }else{ + + const childNode = new xmlNode(tagData.tagName); + childNode.add(this.options.textNodeName, ""); + + if(tagData.tagName !== tagData.tagExp && tagData.attrExpPresent){ + childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); + } + this.addChild(currentNode, childNode, jPath) - // handle overflow - if(options.decrypt && options.overflow) { - output.truncate(this.blockSize - options.overflow); - } + } - // handle authentication tag - this.tag = forge.util.createBuffer(); - // concatenate additional data length with cipher length - var lengths = this._aDataLength.concat(from64To32(this._cipherLength * 8)); + i = tagData.closeIndex + 1; + } else if(xmlData.substr(i + 1, 3) === '!--') { + const endIndex = findClosingIndex(xmlData, "-->", i+4, "Comment is not closed.") + if(this.options.commentPropName){ + const comment = xmlData.substring(i + 4, endIndex - 2); - // include lengths in hash - this._s = this.ghash(this._hashSubkey, this._s, lengths); + textData = this.saveTextToParentTag(textData, currentNode, jPath); - // do GCTR(J_0, S) - var tag = []; - this.cipher.encrypt(this._j0, tag); - for(var i = 0; i < this._ints; ++i) { - this.tag.putInt32(this._s[i] ^ tag[i]); - } + currentNode.add(this.options.commentPropName, [ { [this.options.textNodeName] : comment } ]); + } + i = endIndex; + } else if( xmlData.substr(i + 1, 2) === '!D') { + const result = readDocType(xmlData, i); + this.docTypeEntities = result.entities; + i = result.i; + }else if(xmlData.substr(i + 1, 2) === '![') { + const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2; + const tagExp = xmlData.substring(i + 9,closeIndex); - // trim tag to length - this.tag.truncate(this.tag.length() % (this._tagLength / 8)); + textData = this.saveTextToParentTag(textData, currentNode, jPath); - // check authentication tag - if(options.decrypt && this.tag.bytes() !== this._tag) { - rval = false; - } + //cdata should be set even if it is 0 length string + if(this.options.cdataPropName){ + // let val = this.parseTextData(tagExp, this.options.cdataPropName, jPath + "." + this.options.cdataPropName, true, false, true); + // if(!val) val = ""; + currentNode.add(this.options.cdataPropName, [ { [this.options.textNodeName] : tagExp } ]); + }else{ + let val = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true); + if(val == undefined) val = ""; + currentNode.add(this.options.textNodeName, val); + } + + i = closeIndex + 2; + }else {//Opening tag + let result = readTagExp(xmlData,i, this.options.removeNSPrefix); + let tagName= result.tagName; + let tagExp = result.tagExp; + let attrExpPresent = result.attrExpPresent; + let closeIndex = result.closeIndex; - return rval; -}; + if (this.options.transformTagName) { + tagName = this.options.transformTagName(tagName); + } + + //save text as child node + if (currentNode && textData) { + if(currentNode.tagname !== '!xml'){ + //when nested tag is found + textData = this.saveTextToParentTag(textData, currentNode, jPath, false); + } + } -/** - * See NIST SP-800-38D 6.3 (Algorithm 1). This function performs Galois - * field multiplication. The field, GF(2^128), is defined by the polynomial: - * - * x^128 + x^7 + x^2 + x + 1 - * - * Which is represented in little-endian binary form as: 11100001 (0xe1). When - * the value of a coefficient is 1, a bit is set. The value R, is the - * concatenation of this value and 120 zero bits, yielding a 128-bit value - * which matches the block size. - * - * This function will multiply two elements (vectors of bytes), X and Y, in - * the field GF(2^128). The result is initialized to zero. For each bit of - * X (out of 128), x_i, if x_i is set, then the result is multiplied (XOR'd) - * by the current value of Y. For each bit, the value of Y will be raised by - * a power of x (multiplied by the polynomial x). This can be achieved by - * shifting Y once to the right. If the current value of Y, prior to being - * multiplied by x, has 0 as its LSB, then it is a 127th degree polynomial. - * Otherwise, we must divide by R after shifting to find the remainder. - * - * @param x the first block to multiply by the second. - * @param y the second block to multiply by the first. - * - * @return the block result of the multiplication. - */ -modes.gcm.prototype.multiply = function(x, y) { - var z_i = [0, 0, 0, 0]; - var v_i = y.slice(0); + //check if last tag was unpaired tag + const lastTag = currentNode; + if(lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1 ){ + currentNode = this.tagsNodeStack.pop(); + jPath = jPath.substring(0, jPath.lastIndexOf(".")); + } + if(tagName !== xmlObj.tagname){ + jPath += jPath ? "." + tagName : tagName; + } + if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { //TODO: namespace + let tagContent = ""; + //self-closing tag + if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){ + i = result.closeIndex; + } + //unpaired tag + else if(this.options.unpairedTags.indexOf(tagName) !== -1){ + i = result.closeIndex; + } + //normal tag + else{ + //read until closing tag is found + const result = this.readStopNodeData(xmlData, tagName, closeIndex + 1); + if(!result) throw new Error(`Unexpected end of ${tagName}`); + i = result.i; + tagContent = result.tagContent; + } - // calculate Z_128 (block has 128 bits) - for(var i = 0; i < 128; ++i) { - // if x_i is 0, Z_{i+1} = Z_i (unchanged) - // else Z_{i+1} = Z_i ^ V_i - // get x_i by finding 32-bit int position, then left shift 1 by remainder - var x_i = x[(i / 32) | 0] & (1 << (31 - i % 32)); - if(x_i) { - z_i[0] ^= v_i[0]; - z_i[1] ^= v_i[1]; - z_i[2] ^= v_i[2]; - z_i[3] ^= v_i[3]; - } + const childNode = new xmlNode(tagName); + if(tagName !== tagExp && attrExpPresent){ + childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); + } + if(tagContent) { + tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); + } + + jPath = jPath.substr(0, jPath.lastIndexOf(".")); + childNode.add(this.options.textNodeName, tagContent); + + this.addChild(currentNode, childNode, jPath) + }else{ + //selfClosing tag + if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){ + if(tagName[tagName.length - 1] === "/"){ //remove trailing '/' + tagName = tagName.substr(0, tagName.length - 1); + tagExp = tagName; + }else{ + tagExp = tagExp.substr(0, tagExp.length - 1); + } + + if(this.options.transformTagName) { + tagName = this.options.transformTagName(tagName); + } - // if LSB(V_i) is 1, V_i = V_i >> 1 - // else V_i = (V_i >> 1) ^ R - this.pow(v_i, v_i); + const childNode = new xmlNode(tagName); + if(tagName !== tagExp && attrExpPresent){ + childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); + } + this.addChild(currentNode, childNode, jPath) + jPath = jPath.substr(0, jPath.lastIndexOf(".")); + } + //opening tag + else{ + const childNode = new xmlNode( tagName); + this.tagsNodeStack.push(currentNode); + + if(tagName !== tagExp && attrExpPresent){ + childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); + } + this.addChild(currentNode, childNode, jPath) + currentNode = childNode; + } + textData = ""; + i = closeIndex; + } + } + }else{ + textData += xmlData[i]; + } } + return xmlObj.child; +} - return z_i; -}; - -modes.gcm.prototype.pow = function(x, out) { - // if LSB(x) is 1, x = x >>> 1 - // else x = (x >>> 1) ^ R - var lsb = x[3] & 1; - - // always do x >>> 1: - // starting with the rightmost integer, shift each integer to the right - // one bit, pulling in the bit from the integer to the left as its top - // most bit (do this for the last 3 integers) - for(var i = 3; i > 0; --i) { - out[i] = (x[i] >>> 1) | ((x[i - 1] & 1) << 31); +function addChild(currentNode, childNode, jPath){ + const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]) + if(result === false){ + }else if(typeof result === "string"){ + childNode.tagname = result + currentNode.addChild(childNode); + }else{ + currentNode.addChild(childNode); } - // shift the first integer normally - out[0] = x[0] >>> 1; +} - // if lsb was not set, then polynomial had a degree of 127 and doesn't - // need to divided; otherwise, XOR with R to find the remainder; we only - // need to XOR the first integer since R technically ends w/120 zero bits - if(lsb) { - out[0] ^= this._R; +const replaceEntitiesValue = function(val){ + + if(this.options.processEntities){ + for(let entityName in this.docTypeEntities){ + const entity = this.docTypeEntities[entityName]; + val = val.replace( entity.regx, entity.val); + } + for(let entityName in this.lastEntities){ + const entity = this.lastEntities[entityName]; + val = val.replace( entity.regex, entity.val); + } + if(this.options.htmlEntities){ + for(let entityName in this.htmlEntities){ + const entity = this.htmlEntities[entityName]; + val = val.replace( entity.regex, entity.val); + } + } + val = val.replace( this.ampEntity.regex, this.ampEntity.val); } -}; + return val; +} +function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { + if (textData) { //store previously collected data as textNode + if(isLeafNode === undefined) isLeafNode = Object.keys(currentNode.child).length === 0 + + textData = this.parseTextData(textData, + currentNode.tagname, + jPath, + false, + currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, + isLeafNode); -modes.gcm.prototype.tableMultiply = function(x) { - // assumes 4-bit tables are used - var z = [0, 0, 0, 0]; - for(var i = 0; i < 32; ++i) { - var idx = (i / 8) | 0; - var x_i = (x[idx] >>> ((7 - (i % 8)) * 4)) & 0xF; - var ah = this._m[i][x_i]; - z[0] ^= ah[0]; - z[1] ^= ah[1]; - z[2] ^= ah[2]; - z[3] ^= ah[3]; + if (textData !== undefined && textData !== "") + currentNode.add(this.options.textNodeName, textData); + textData = ""; } - return z; -}; - -/** - * A continuing version of the GHASH algorithm that operates on a single - * block. The hash block, last hash value (Ym) and the new block to hash - * are given. - * - * @param h the hash block. - * @param y the previous value for Ym, use [0, 0, 0, 0] for a new hash. - * @param x the block to hash. - * - * @return the hashed value (Ym). - */ -modes.gcm.prototype.ghash = function(h, y, x) { - y[0] ^= x[0]; - y[1] ^= x[1]; - y[2] ^= x[2]; - y[3] ^= x[3]; - return this.tableMultiply(y); - //return this.multiply(y, h); -}; + return textData; +} +//TODO: use jPath to simplify the logic /** - * Precomputes a table for multiplying against the hash subkey. This - * mechanism provides a substantial speed increase over multiplication - * performed without a table. The table-based multiplication this table is - * for solves X * H by multiplying each component of X by H and then - * composing the results together using XOR. - * - * This function can be used to generate tables with different bit sizes - * for the components, however, this implementation assumes there are - * 32 components of X (which is a 16 byte vector), therefore each component - * takes 4-bits (so the table is constructed with bits=4). - * - * @param h the hash subkey. - * @param bits the bit size for a component. + * + * @param {string[]} stopNodes + * @param {string} jPath + * @param {string} currentTagName */ -modes.gcm.prototype.generateHashTable = function(h, bits) { - // TODO: There are further optimizations that would use only the - // first table M_0 (or some variant) along with a remainder table; - // this can be explored in the future - var multiplier = 8 / bits; - var perInt = 4 * multiplier; - var size = 16 * multiplier; - var m = new Array(size); - for(var i = 0; i < size; ++i) { - var tmp = [0, 0, 0, 0]; - var idx = (i / perInt) | 0; - var shft = ((perInt - 1 - (i % perInt)) * bits); - tmp[idx] = (1 << (bits - 1)) << shft; - m[i] = this.generateSubHashTable(this.multiply(tmp, h), bits); +function isItStopNode(stopNodes, jPath, currentTagName){ + const allNodesExp = "*." + currentTagName; + for (const stopNodePath in stopNodes) { + const stopNodeExp = stopNodes[stopNodePath]; + if( allNodesExp === stopNodeExp || jPath === stopNodeExp ) return true; } - return m; -}; + return false; +} /** - * Generates a table for multiplying against the hash subkey for one - * particular component (out of all possible component values). - * - * @param mid the pre-multiplied value for the middle key of the table. - * @param bits the bit size for a component. + * Returns the tag Expression and where it is ending handling single-double quotes situation + * @param {string} xmlData + * @param {number} i starting index + * @returns */ -modes.gcm.prototype.generateSubHashTable = function(mid, bits) { - // compute the table quickly by minimizing the number of - // POW operations -- they only need to be performed for powers of 2, - // all other entries can be composed from those powers using XOR - var size = 1 << bits; - var half = size >>> 1; - var m = new Array(size); - m[half] = mid.slice(0); - var i = half >>> 1; - while(i > 0) { - // raise m0[2 * i] and store in m0[i] - this.pow(m[2 * i], m[i] = []); - i >>= 1; - } - i = 2; - while(i < half) { - for(var j = 1; j < i; ++j) { - var m_i = m[i]; - var m_j = m[j]; - m[i + j] = [ - m_i[0] ^ m_j[0], - m_i[1] ^ m_j[1], - m_i[2] ^ m_j[2], - m_i[3] ^ m_j[3] - ]; +function tagExpWithClosingIndex(xmlData, i, closingChar = ">"){ + let attrBoundary; + let tagExp = ""; + for (let index = i; index < xmlData.length; index++) { + let ch = xmlData[index]; + if (attrBoundary) { + if (ch === attrBoundary) attrBoundary = "";//reset + } else if (ch === '"' || ch === "'") { + attrBoundary = ch; + } else if (ch === closingChar[0]) { + if(closingChar[1]){ + if(xmlData[index + 1] === closingChar[1]){ + return { + data: tagExp, + index: index + } + } + }else{ + return { + data: tagExp, + index: index + } + } + } else if (ch === '\t') { + ch = " " } - i *= 2; - } - m[0] = [0, 0, 0, 0]; - /* Note: We could avoid storing these by doing composition during multiply - calculate top half using composition by speed is preferred. */ - for(i = half + 1; i < size; ++i) { - var c = m[i ^ half]; - m[i] = [mid[0] ^ c[0], mid[1] ^ c[1], mid[2] ^ c[2], mid[3] ^ c[3]]; + tagExp += ch; } - return m; -}; +} -/** Utility functions */ +function findClosingIndex(xmlData, str, i, errMsg){ + const closingIndex = xmlData.indexOf(str, i); + if(closingIndex === -1){ + throw new Error(errMsg) + }else{ + return closingIndex + str.length - 1; + } +} -function transformIV(iv, blockSize) { - if(typeof iv === 'string') { - // convert iv string into byte buffer - iv = forge.util.createBuffer(iv); +function readTagExp(xmlData,i, removeNSPrefix, closingChar = ">"){ + const result = tagExpWithClosingIndex(xmlData, i+1, closingChar); + if(!result) return; + let tagExp = result.data; + const closeIndex = result.index; + const separatorIndex = tagExp.search(/\s/); + let tagName = tagExp; + let attrExpPresent = true; + if(separatorIndex !== -1){//separate tag name and attributes expression + tagName = tagExp.substr(0, separatorIndex).replace(/\s\s*$/, ''); + tagExp = tagExp.substr(separatorIndex + 1); } - if(forge.util.isArray(iv) && iv.length > 4) { - // convert iv byte array into byte buffer - var tmp = iv; - iv = forge.util.createBuffer(); - for(var i = 0; i < tmp.length; ++i) { - iv.putByte(tmp[i]); + if(removeNSPrefix){ + const colonIndex = tagName.indexOf(":"); + if(colonIndex !== -1){ + tagName = tagName.substr(colonIndex+1); + attrExpPresent = tagName !== result.data.substr(colonIndex + 1); } } - if(iv.length() < blockSize) { - throw new Error( - 'Invalid IV length; got ' + iv.length() + - ' bytes and expected ' + blockSize + ' bytes.'); + return { + tagName: tagName, + tagExp: tagExp, + closeIndex: closeIndex, + attrExpPresent: attrExpPresent, } +} +/** + * find paired tag for a stop node + * @param {string} xmlData + * @param {string} tagName + * @param {number} i + */ +function readStopNodeData(xmlData, tagName, i){ + const startIndex = i; + // Starting at 1 since we already have an open tag + let openTagCount = 1; - if(!forge.util.isArray(iv)) { - // convert iv byte buffer into 32-bit integer array - var ints = []; - var blocks = blockSize / 4; - for(var i = 0; i < blocks; ++i) { - ints.push(iv.getInt32()); - } - iv = ints; - } + for (; i < xmlData.length; i++) { + if( xmlData[i] === "<"){ + if (xmlData[i+1] === "/") {//close tag + const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`); + let closeTagName = xmlData.substring(i+2,closeIndex).trim(); + if(closeTagName === tagName){ + openTagCount--; + if (openTagCount === 0) { + return { + tagContent: xmlData.substring(startIndex, i), + i : closeIndex + } + } + } + i=closeIndex; + } else if(xmlData[i+1] === '?') { + const closeIndex = findClosingIndex(xmlData, "?>", i+1, "StopNode is not closed.") + i=closeIndex; + } else if(xmlData.substr(i + 1, 3) === '!--') { + const closeIndex = findClosingIndex(xmlData, "-->", i+3, "StopNode is not closed.") + i=closeIndex; + } else if(xmlData.substr(i + 1, 2) === '![') { + const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2; + i=closeIndex; + } else { + const tagData = readTagExp(xmlData, i, '>') - return iv; + if (tagData) { + const openTagName = tagData && tagData.tagName; + if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length-1] !== "/") { + openTagCount++; + } + i=tagData.closeIndex; + } + } + } + }//end for loop } -function inc32(block) { - // increment last 32 bits of block only - block[block.length - 1] = (block[block.length - 1] + 1) & 0xFFFFFFFF; +function parseValue(val, shouldParse, options) { + if (shouldParse && typeof val === 'string') { + //console.log(options) + const newval = val.trim(); + if(newval === 'true' ) return true; + else if(newval === 'false' ) return false; + else return toNumber(val, options); + } else { + if (util.isExist(val)) { + return val; + } else { + return ''; + } + } } -function from64To32(num) { - // convert 64-bit number to two BE Int32s - return [(num / 0x100000000) | 0, num & 0xFFFFFFFF]; -} + +module.exports = OrderedObjParser; /***/ }), -<<<<<<< HEAD -/***/ 53436: -======= -/***/ 16855: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 24362: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * DES (Data Encryption Standard) implementation. - * - * This implementation supports DES as well as 3DES-EDE in ECB and CBC mode. - * It is based on the BSD-licensed implementation by Paul Tero: - * - * Paul Tero, July 2001 - * http://www.tero.co.uk/des/ - * - * Optimised for performance with large blocks by - * Michael Hayworth, November 2001 - * http://www.netdealing.com - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @author Stefan Siegl - * @author Dave Longley - * - * Copyright (c) 2012 Stefan Siegl - * Copyright (c) 2012-2014 Digital Bazaar, Inc. - */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -__nccwpck_require__(21477); -__nccwpck_require__(23540); -__nccwpck_require__(19239); -======= -var forge = __nccwpck_require__(96630); -__nccwpck_require__(27883); -__nccwpck_require__(70857); -__nccwpck_require__(36536); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const { buildOptions} = __nccwpck_require__(88473); +const OrderedObjParser = __nccwpck_require__(11165); +const { prettify} = __nccwpck_require__(70185); +const validator = __nccwpck_require__(16643); -/* DES API */ -module.exports = forge.des = forge.des || {}; +class XMLParser{ + + constructor(options){ + this.externalEntities = {}; + this.options = buildOptions(options); + + } + /** + * Parse XML dats to JS object + * @param {string|Buffer} xmlData + * @param {boolean|Object} validationOption + */ + parse(xmlData,validationOption){ + if(typeof xmlData === "string"){ + }else if( xmlData.toString){ + xmlData = xmlData.toString(); + }else{ + throw new Error("XML data is accepted in String or Bytes[] form.") + } + if( validationOption){ + if(validationOption === true) validationOption = {}; //validate with default options + + const result = validator.validate(xmlData, validationOption); + if (result !== true) { + throw Error( `${result.err.msg}:${result.err.line}:${result.err.col}` ) + } + } + const orderedObjParser = new OrderedObjParser(this.options); + orderedObjParser.addExternalEntities(this.externalEntities); + const orderedResult = orderedObjParser.parseXml(xmlData); + if(this.options.preserveOrder || orderedResult === undefined) return orderedResult; + else return prettify(orderedResult, this.options); + } -/** - * Deprecated. Instead, use: - * - * var cipher = forge.cipher.createCipher('DES-', key); - * cipher.start({iv: iv}); - * - * Creates an DES cipher object to encrypt data using the given symmetric key. - * The output will be stored in the 'output' member of the returned cipher. - * - * The key and iv may be given as binary-encoded strings of bytes or - * byte buffers. - * - * @param key the symmetric key to use (64 or 192 bits). - * @param iv the initialization vector to use. - * @param output the buffer to write to, null to create one. - * @param mode the cipher mode to use (default: 'CBC' if IV is - * given, 'ECB' if null). - * - * @return the cipher. - */ -forge.des.startEncrypting = function(key, iv, output, mode) { - var cipher = _createCipher({ - key: key, - output: output, - decrypt: false, - mode: mode || (iv === null ? 'ECB' : 'CBC') - }); - cipher.start(iv); - return cipher; -}; + /** + * Add Entity which is not by default supported by this library + * @param {string} key + * @param {string} value + */ + addEntity(key, value){ + if(value.indexOf("&") !== -1){ + throw new Error("Entity value can't have '&'") + }else if(key.indexOf("&") !== -1 || key.indexOf(";") !== -1){ + throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '") + }else if(value === "&"){ + throw new Error("An entity with value '&' is not permitted"); + }else{ + this.externalEntities[key] = value; + } + } +} + +module.exports = XMLParser; + +/***/ }), + +/***/ 70185: +/***/ ((__unused_webpack_module, exports) => { -/** - * Deprecated. Instead, use: - * - * var cipher = forge.cipher.createCipher('DES-', key); - * - * Creates an DES cipher object to encrypt data using the given symmetric key. - * - * The key may be given as a binary-encoded string of bytes or a byte buffer. - * - * @param key the symmetric key to use (64 or 192 bits). - * @param mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -forge.des.createEncryptionCipher = function(key, mode) { - return _createCipher({ - key: key, - output: null, - decrypt: false, - mode: mode - }); -}; -/** - * Deprecated. Instead, use: - * - * var decipher = forge.cipher.createDecipher('DES-', key); - * decipher.start({iv: iv}); - * - * Creates an DES cipher object to decrypt data using the given symmetric key. - * The output will be stored in the 'output' member of the returned cipher. - * - * The key and iv may be given as binary-encoded strings of bytes or - * byte buffers. - * - * @param key the symmetric key to use (64 or 192 bits). - * @param iv the initialization vector to use. - * @param output the buffer to write to, null to create one. - * @param mode the cipher mode to use (default: 'CBC' if IV is - * given, 'ECB' if null). - * - * @return the cipher. - */ -forge.des.startDecrypting = function(key, iv, output, mode) { - var cipher = _createCipher({ - key: key, - output: output, - decrypt: true, - mode: mode || (iv === null ? 'ECB' : 'CBC') - }); - cipher.start(iv); - return cipher; -}; /** - * Deprecated. Instead, use: - * - * var decipher = forge.cipher.createDecipher('DES-', key); - * - * Creates an DES cipher object to decrypt data using the given symmetric key. - * - * The key may be given as a binary-encoded string of bytes or a byte buffer. - * - * @param key the symmetric key to use (64 or 192 bits). - * @param mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. + * + * @param {array} node + * @param {any} options + * @returns */ -forge.des.createDecryptionCipher = function(key, mode) { - return _createCipher({ - key: key, - output: null, - decrypt: true, - mode: mode - }); -}; +function prettify(node, options){ + return compress( node, options); +} /** - * Creates a new DES cipher algorithm object. - * - * @param name the name of the algorithm. - * @param mode the mode factory function. - * - * @return the DES algorithm object. + * + * @param {array} arr + * @param {object} options + * @param {string} jPath + * @returns object */ -forge.des.Algorithm = function(name, mode) { - var self = this; - self.name = name; - self.mode = new mode({ - blockSize: 8, - cipher: { - encrypt: function(inBlock, outBlock) { - return _updateBlock(self._keys, inBlock, outBlock, false); - }, - decrypt: function(inBlock, outBlock) { - return _updateBlock(self._keys, inBlock, outBlock, true); +function compress(arr, options, jPath){ + let text; + const compressedObj = {}; + for (let i = 0; i < arr.length; i++) { + const tagObj = arr[i]; + const property = propName(tagObj); + let newJpath = ""; + if(jPath === undefined) newJpath = property; + else newJpath = jPath + "." + property; + + if(property === options.textNodeName){ + if(text === undefined) text = tagObj[property]; + else text += "" + tagObj[property]; + }else if(property === undefined){ + continue; + }else if(tagObj[property]){ + + let val = compress(tagObj[property], options, newJpath); + const isLeaf = isLeafTag(val, options); + + if(tagObj[":@"]){ + assignAttributes( val, tagObj[":@"], newJpath, options); + }else if(Object.keys(val).length === 1 && val[options.textNodeName] !== undefined && !options.alwaysCreateTextNode){ + val = val[options.textNodeName]; + }else if(Object.keys(val).length === 0){ + if(options.alwaysCreateTextNode) val[options.textNodeName] = ""; + else val = ""; + } + + if(compressedObj[property] !== undefined && compressedObj.hasOwnProperty(property)) { + if(!Array.isArray(compressedObj[property])) { + compressedObj[property] = [ compressedObj[property] ]; + } + compressedObj[property].push(val); + }else{ + //TODO: if a node is not an array, then check if it should be an array + //also determine if it is a leaf node + if (options.isArray(property, newJpath, isLeaf )) { + compressedObj[property] = [val]; + }else{ + compressedObj[property] = val; + } } } - }); - self._init = false; -}; + + } + // if(text && text.length > 0) compressedObj[options.textNodeName] = text; + if(typeof text === "string"){ + if(text.length > 0) compressedObj[options.textNodeName] = text; + }else if(text !== undefined) compressedObj[options.textNodeName] = text; + return compressedObj; +} -/** - * Initializes this DES algorithm by expanding its key. - * - * @param options the options to use. - * key the key to use with this algorithm. - * decrypt true if the algorithm should be initialized for decryption, - * false for encryption. - */ -forge.des.Algorithm.prototype.initialize = function(options) { - if(this._init) { - return; +function propName(obj){ + const keys = Object.keys(obj); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + if(key !== ":@") return key; } +} - var key = forge.util.createBuffer(options.key); - if(this.name.indexOf('3DES') === 0) { - if(key.length() !== 24) { - throw new Error('Invalid Triple-DES key size: ' + key.length() * 8); +function assignAttributes(obj, attrMap, jpath, options){ + if (attrMap) { + const keys = Object.keys(attrMap); + const len = keys.length; //don't make it inline + for (let i = 0; i < len; i++) { + const atrrName = keys[i]; + if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) { + obj[atrrName] = [ attrMap[atrrName] ]; + } else { + obj[atrrName] = attrMap[atrrName]; + } } } - - // do key expansion to 16 or 48 subkeys (single or triple DES) - this._keys = _createKeys(key); - this._init = true; -}; - -/** Register DES algorithms **/ - -registerAlgorithm('DES-ECB', forge.cipher.modes.ecb); -registerAlgorithm('DES-CBC', forge.cipher.modes.cbc); -registerAlgorithm('DES-CFB', forge.cipher.modes.cfb); -registerAlgorithm('DES-OFB', forge.cipher.modes.ofb); -registerAlgorithm('DES-CTR', forge.cipher.modes.ctr); - -registerAlgorithm('3DES-ECB', forge.cipher.modes.ecb); -registerAlgorithm('3DES-CBC', forge.cipher.modes.cbc); -registerAlgorithm('3DES-CFB', forge.cipher.modes.cfb); -registerAlgorithm('3DES-OFB', forge.cipher.modes.ofb); -registerAlgorithm('3DES-CTR', forge.cipher.modes.ctr); - -function registerAlgorithm(name, mode) { - var factory = function() { - return new forge.des.Algorithm(name, mode); - }; - forge.cipher.registerAlgorithm(name, factory); } -/** DES implementation **/ - -var spfunction1 = [0x1010400,0,0x10000,0x1010404,0x1010004,0x10404,0x4,0x10000,0x400,0x1010400,0x1010404,0x400,0x1000404,0x1010004,0x1000000,0x4,0x404,0x1000400,0x1000400,0x10400,0x10400,0x1010000,0x1010000,0x1000404,0x10004,0x1000004,0x1000004,0x10004,0,0x404,0x10404,0x1000000,0x10000,0x1010404,0x4,0x1010000,0x1010400,0x1000000,0x1000000,0x400,0x1010004,0x10000,0x10400,0x1000004,0x400,0x4,0x1000404,0x10404,0x1010404,0x10004,0x1010000,0x1000404,0x1000004,0x404,0x10404,0x1010400,0x404,0x1000400,0x1000400,0,0x10004,0x10400,0,0x1010004]; -var spfunction2 = [-0x7fef7fe0,-0x7fff8000,0x8000,0x108020,0x100000,0x20,-0x7fefffe0,-0x7fff7fe0,-0x7fffffe0,-0x7fef7fe0,-0x7fef8000,-0x80000000,-0x7fff8000,0x100000,0x20,-0x7fefffe0,0x108000,0x100020,-0x7fff7fe0,0,-0x80000000,0x8000,0x108020,-0x7ff00000,0x100020,-0x7fffffe0,0,0x108000,0x8020,-0x7fef8000,-0x7ff00000,0x8020,0,0x108020,-0x7fefffe0,0x100000,-0x7fff7fe0,-0x7ff00000,-0x7fef8000,0x8000,-0x7ff00000,-0x7fff8000,0x20,-0x7fef7fe0,0x108020,0x20,0x8000,-0x80000000,0x8020,-0x7fef8000,0x100000,-0x7fffffe0,0x100020,-0x7fff7fe0,-0x7fffffe0,0x100020,0x108000,0,-0x7fff8000,0x8020,-0x80000000,-0x7fefffe0,-0x7fef7fe0,0x108000]; -var spfunction3 = [0x208,0x8020200,0,0x8020008,0x8000200,0,0x20208,0x8000200,0x20008,0x8000008,0x8000008,0x20000,0x8020208,0x20008,0x8020000,0x208,0x8000000,0x8,0x8020200,0x200,0x20200,0x8020000,0x8020008,0x20208,0x8000208,0x20200,0x20000,0x8000208,0x8,0x8020208,0x200,0x8000000,0x8020200,0x8000000,0x20008,0x208,0x20000,0x8020200,0x8000200,0,0x200,0x20008,0x8020208,0x8000200,0x8000008,0x200,0,0x8020008,0x8000208,0x20000,0x8000000,0x8020208,0x8,0x20208,0x20200,0x8000008,0x8020000,0x8000208,0x208,0x8020000,0x20208,0x8,0x8020008,0x20200]; -var spfunction4 = [0x802001,0x2081,0x2081,0x80,0x802080,0x800081,0x800001,0x2001,0,0x802000,0x802000,0x802081,0x81,0,0x800080,0x800001,0x1,0x2000,0x800000,0x802001,0x80,0x800000,0x2001,0x2080,0x800081,0x1,0x2080,0x800080,0x2000,0x802080,0x802081,0x81,0x800080,0x800001,0x802000,0x802081,0x81,0,0,0x802000,0x2080,0x800080,0x800081,0x1,0x802001,0x2081,0x2081,0x80,0x802081,0x81,0x1,0x2000,0x800001,0x2001,0x802080,0x800081,0x2001,0x2080,0x800000,0x802001,0x80,0x800000,0x2000,0x802080]; -var spfunction5 = [0x100,0x2080100,0x2080000,0x42000100,0x80000,0x100,0x40000000,0x2080000,0x40080100,0x80000,0x2000100,0x40080100,0x42000100,0x42080000,0x80100,0x40000000,0x2000000,0x40080000,0x40080000,0,0x40000100,0x42080100,0x42080100,0x2000100,0x42080000,0x40000100,0,0x42000000,0x2080100,0x2000000,0x42000000,0x80100,0x80000,0x42000100,0x100,0x2000000,0x40000000,0x2080000,0x42000100,0x40080100,0x2000100,0x40000000,0x42080000,0x2080100,0x40080100,0x100,0x2000000,0x42080000,0x42080100,0x80100,0x42000000,0x42080100,0x2080000,0,0x40080000,0x42000000,0x80100,0x2000100,0x40000100,0x80000,0,0x40080000,0x2080100,0x40000100]; -var spfunction6 = [0x20000010,0x20400000,0x4000,0x20404010,0x20400000,0x10,0x20404010,0x400000,0x20004000,0x404010,0x400000,0x20000010,0x400010,0x20004000,0x20000000,0x4010,0,0x400010,0x20004010,0x4000,0x404000,0x20004010,0x10,0x20400010,0x20400010,0,0x404010,0x20404000,0x4010,0x404000,0x20404000,0x20000000,0x20004000,0x10,0x20400010,0x404000,0x20404010,0x400000,0x4010,0x20000010,0x400000,0x20004000,0x20000000,0x4010,0x20000010,0x20404010,0x404000,0x20400000,0x404010,0x20404000,0,0x20400010,0x10,0x4000,0x20400000,0x404010,0x4000,0x400010,0x20004010,0,0x20404000,0x20000000,0x400010,0x20004010]; -var spfunction7 = [0x200000,0x4200002,0x4000802,0,0x800,0x4000802,0x200802,0x4200800,0x4200802,0x200000,0,0x4000002,0x2,0x4000000,0x4200002,0x802,0x4000800,0x200802,0x200002,0x4000800,0x4000002,0x4200000,0x4200800,0x200002,0x4200000,0x800,0x802,0x4200802,0x200800,0x2,0x4000000,0x200800,0x4000000,0x200800,0x200000,0x4000802,0x4000802,0x4200002,0x4200002,0x2,0x200002,0x4000000,0x4000800,0x200000,0x4200800,0x802,0x200802,0x4200800,0x802,0x4000002,0x4200802,0x4200000,0x200800,0,0x2,0x4200802,0,0x200802,0x4200000,0x800,0x4000002,0x4000800,0x800,0x200002]; -var spfunction8 = [0x10001040,0x1000,0x40000,0x10041040,0x10000000,0x10001040,0x40,0x10000000,0x40040,0x10040000,0x10041040,0x41000,0x10041000,0x41040,0x1000,0x40,0x10040000,0x10000040,0x10001000,0x1040,0x41000,0x40040,0x10040040,0x10041000,0x1040,0,0,0x10040040,0x10000040,0x10001000,0x41040,0x40000,0x41040,0x40000,0x10041000,0x1000,0x40,0x10040040,0x1000,0x41040,0x10001000,0x40,0x10000040,0x10040000,0x10040040,0x10000000,0x40000,0x10001040,0,0x10041040,0x40040,0x10000040,0x10040000,0x10001000,0x10001040,0,0x10041040,0x41000,0x41000,0x1040,0x1040,0x40040,0x10000000,0x10041000]; - -/** - * Create necessary sub keys. - * - * @param key the 64-bit or 192-bit key. - * - * @return the expanded keys. - */ -function _createKeys(key) { - var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204], - pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101], - pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808], - pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000], - pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010], - pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420], - pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002], - pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800], - pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002], - pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408], - pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020], - pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200], - pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010], - pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105]; - - // how many iterations (1 for des, 3 for triple des) - // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys - var iterations = key.length() > 8 ? 3 : 1; +function isLeafTag(obj, options){ + const { textNodeName } = options; + const propCount = Object.keys(obj).length; + + if (propCount === 0) { + return true; + } - // stores the return keys - var keys = []; + if ( + propCount === 1 && + (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0) + ) { + return true; + } - // now define the left shifts which need to be done - var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0]; + return false; +} +exports.prettify = prettify; - var n = 0, tmp; - for(var j = 0; j < iterations; j++) { - var left = key.getInt32(); - var right = key.getInt32(); - tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f; - right ^= tmp; - left ^= (tmp << 4); +/***/ }), - tmp = ((right >>> -16) ^ left) & 0x0000ffff; - left ^= tmp; - right ^= (tmp << -16); +/***/ 69559: +/***/ ((module) => { - tmp = ((left >>> 2) ^ right) & 0x33333333; - right ^= tmp; - left ^= (tmp << 2); - tmp = ((right >>> -16) ^ left) & 0x0000ffff; - left ^= tmp; - right ^= (tmp << -16); - tmp = ((left >>> 1) ^ right) & 0x55555555; - right ^= tmp; - left ^= (tmp << 1); +class XmlNode{ + constructor(tagname) { + this.tagname = tagname; + this.child = []; //nested tags, text, cdata, comments in order + this[":@"] = {}; //attributes map + } + add(key,val){ + // this.child.push( {name : key, val: val, isCdata: isCdata }); + if(key === "__proto__") key = "#__proto__"; + this.child.push( {[key]: val }); + } + addChild(node) { + if(node.tagname === "__proto__") node.tagname = "#__proto__"; + if(node[":@"] && Object.keys(node[":@"]).length > 0){ + this.child.push( { [node.tagname]: node.child, [":@"]: node[":@"] }); + }else{ + this.child.push( { [node.tagname]: node.child }); + } + }; +}; - tmp = ((right >>> 8) ^ left) & 0x00ff00ff; - left ^= tmp; - right ^= (tmp << 8); - tmp = ((left >>> 1) ^ right) & 0x55555555; - right ^= tmp; - left ^= (tmp << 1); +module.exports = XmlNode; - // right needs to be shifted and OR'd with last four bits of left - tmp = (left << 8) | ((right >>> 20) & 0x000000f0); +/***/ }), - // left needs to be put upside down - left = ((right << 24) | ((right << 8) & 0xff0000) | - ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0)); - right = tmp; +/***/ 90218: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // now go through and perform these shifts on the left and right keys - for(var i = 0; i < shifts.length; ++i) { - //shift the keys either one or two bits to the left - if(shifts[i]) { - left = (left << 2) | (left >>> 26); - right = (right << 2) | (right >>> 26); - } else { - left = (left << 1) | (left >>> 27); - right = (right << 1) | (right >>> 27); - } - left &= -0xf; - right &= -0xf; +var debug; - // now apply PC-2, in such a way that E is easier when encrypting or - // decrypting this conversion will look like PC-2 except only the last 6 - // bits of each byte are used rather than 48 consecutive bits and the - // order of lines will be according to how the S selection functions will - // be applied: S2, S4, S6, S8, S1, S3, S5, S7 - var lefttmp = ( - pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] | - pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] | - pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] | - pc2bytes6[(left >>> 4) & 0xf]); - var righttmp = ( - pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] | - pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] | - pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] | - pc2bytes13[(right >>> 4) & 0xf]); - tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff; - keys[n++] = lefttmp ^ tmp; - keys[n++] = righttmp ^ (tmp << 16); +module.exports = function () { + if (!debug) { + try { + /* eslint global-require: off */ + debug = __nccwpck_require__(15057)("follow-redirects"); + } + catch (error) { /* */ } + if (typeof debug !== "function") { + debug = function () { /* */ }; } } + debug.apply(null, arguments); +}; - return keys; -} - -/** - * Updates a single block (1 byte) using DES. The update will either - * encrypt or decrypt the block. - * - * @param keys the expanded keys. - * @param input the input block (an array of 32-bit words). - * @param output the updated output block. - * @param decrypt true to decrypt the block, false to encrypt it. - */ -function _updateBlock(keys, input, output, decrypt) { - // set up loops for single or triple DES - var iterations = keys.length === 32 ? 3 : 9; - var looping; - if(iterations === 3) { - looping = decrypt ? [30, -2, -2] : [0, 32, 2]; - } else { - looping = (decrypt ? - [94, 62, -2, 32, 64, 2, 30, -2, -2] : - [0, 32, 2, 62, 30, -2, 64, 96, 2]); - } - - var tmp; - - var left = input[0]; - var right = input[1]; - - // first each 64 bit chunk of the message must be permuted according to IP - tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f; - right ^= tmp; - left ^= (tmp << 4); - tmp = ((left >>> 16) ^ right) & 0x0000ffff; - right ^= tmp; - left ^= (tmp << 16); +/***/ }), - tmp = ((right >>> 2) ^ left) & 0x33333333; - left ^= tmp; - right ^= (tmp << 2); +/***/ 14016: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - tmp = ((right >>> 8) ^ left) & 0x00ff00ff; - left ^= tmp; - right ^= (tmp << 8); +var url = __nccwpck_require__(57310); +var URL = url.URL; +var http = __nccwpck_require__(13685); +var https = __nccwpck_require__(95687); +var Writable = (__nccwpck_require__(12781).Writable); +var assert = __nccwpck_require__(39491); +var debug = __nccwpck_require__(90218); - tmp = ((left >>> 1) ^ right) & 0x55555555; - right ^= tmp; - left ^= (tmp << 1); +// Create handlers that pass events from native requests +var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; +var eventHandlers = Object.create(null); +events.forEach(function (event) { + eventHandlers[event] = function (arg1, arg2, arg3) { + this._redirectable.emit(event, arg1, arg2, arg3); + }; +}); - // rotate left 1 bit - left = ((left << 1) | (left >>> 31)); - right = ((right << 1) | (right >>> 31)); +var InvalidUrlError = createErrorType( + "ERR_INVALID_URL", + "Invalid URL", + TypeError +); +// Error types with codes +var RedirectionError = createErrorType( + "ERR_FR_REDIRECTION_FAILURE", + "Redirected request failed" +); +var TooManyRedirectsError = createErrorType( + "ERR_FR_TOO_MANY_REDIRECTS", + "Maximum number of redirects exceeded" +); +var MaxBodyLengthExceededError = createErrorType( + "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", + "Request body larger than maxBodyLength limit" +); +var WriteAfterEndError = createErrorType( + "ERR_STREAM_WRITE_AFTER_END", + "write after end" +); - for(var j = 0; j < iterations; j += 3) { - var endloop = looping[j + 1]; - var loopinc = looping[j + 2]; +// istanbul ignore next +var destroy = Writable.prototype.destroy || noop; - // now go through and perform the encryption or decryption - for(var i = looping[j]; i != endloop; i += loopinc) { - var right1 = right ^ keys[i]; - var right2 = ((right >>> 4) | (right << 28)) ^ keys[i + 1]; +// An HTTP(S) request that can be redirected +function RedirectableRequest(options, responseCallback) { + // Initialize the request + Writable.call(this); + this._sanitizeOptions(options); + this._options = options; + this._ended = false; + this._ending = false; + this._redirectCount = 0; + this._redirects = []; + this._requestBodyLength = 0; + this._requestBodyBuffers = []; - // passing these bytes through the S selection functions - tmp = left; - left = right; - right = tmp ^ ( - spfunction2[(right1 >>> 24) & 0x3f] | - spfunction4[(right1 >>> 16) & 0x3f] | - spfunction6[(right1 >>> 8) & 0x3f] | - spfunction8[right1 & 0x3f] | - spfunction1[(right2 >>> 24) & 0x3f] | - spfunction3[(right2 >>> 16) & 0x3f] | - spfunction5[(right2 >>> 8) & 0x3f] | - spfunction7[right2 & 0x3f]); - } - // unreverse left and right - tmp = left; - left = right; - right = tmp; + // Attach a callback if passed + if (responseCallback) { + this.on("response", responseCallback); } - // rotate right 1 bit - left = ((left >>> 1) | (left << 31)); - right = ((right >>> 1) | (right << 31)); - - // now perform IP-1, which is IP in the opposite direction - tmp = ((left >>> 1) ^ right) & 0x55555555; - right ^= tmp; - left ^= (tmp << 1); + // React to responses of native requests + var self = this; + this._onNativeResponse = function (response) { + self._processResponse(response); + }; - tmp = ((right >>> 8) ^ left) & 0x00ff00ff; - left ^= tmp; - right ^= (tmp << 8); + // Perform the first request + this._performRequest(); +} +RedirectableRequest.prototype = Object.create(Writable.prototype); - tmp = ((right >>> 2) ^ left) & 0x33333333; - left ^= tmp; - right ^= (tmp << 2); +RedirectableRequest.prototype.abort = function () { + destroyRequest(this._currentRequest); + this._currentRequest.abort(); + this.emit("abort"); +}; - tmp = ((left >>> 16) ^ right) & 0x0000ffff; - right ^= tmp; - left ^= (tmp << 16); +RedirectableRequest.prototype.destroy = function (error) { + destroyRequest(this._currentRequest, error); + destroy.call(this, error); + return this; +}; - tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f; - right ^= tmp; - left ^= (tmp << 4); +// Writes buffered data to the current native request +RedirectableRequest.prototype.write = function (data, encoding, callback) { + // Writing is not allowed if end has been called + if (this._ending) { + throw new WriteAfterEndError(); + } - output[0] = left; - output[1] = right; -} + // Validate input and shift parameters if necessary + if (!isString(data) && !isBuffer(data)) { + throw new TypeError("data should be a string, Buffer or Uint8Array"); + } + if (isFunction(encoding)) { + callback = encoding; + encoding = null; + } -/** - * Deprecated. Instead, use: - * - * forge.cipher.createCipher('DES-', key); - * forge.cipher.createDecipher('DES-', key); - * - * Creates a deprecated DES cipher object. This object's mode will default to - * CBC (cipher-block-chaining). - * - * The key may be given as a binary-encoded string of bytes or a byte buffer. - * - * @param options the options to use. - * key the symmetric key to use (64 or 192 bits). - * output the buffer to write to. - * decrypt true for decryption, false for encryption. - * mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -function _createCipher(options) { - options = options || {}; - var mode = (options.mode || 'CBC').toUpperCase(); - var algorithm = 'DES-' + mode; + // Ignore empty buffers, since writing them doesn't invoke the callback + // https://github.com/nodejs/node/issues/22066 + if (data.length === 0) { + if (callback) { + callback(); + } + return; + } + // Only write when we don't exceed the maximum body length + if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { + this._requestBodyLength += data.length; + this._requestBodyBuffers.push({ data: data, encoding: encoding }); + this._currentRequest.write(data, encoding, callback); + } + // Error when we exceed the maximum body length + else { + this.emit("error", new MaxBodyLengthExceededError()); + this.abort(); + } +}; - var cipher; - if(options.decrypt) { - cipher = forge.cipher.createDecipher(algorithm, options.key); - } else { - cipher = forge.cipher.createCipher(algorithm, options.key); +// Ends the current native request +RedirectableRequest.prototype.end = function (data, encoding, callback) { + // Shift parameters if necessary + if (isFunction(data)) { + callback = data; + data = encoding = null; + } + else if (isFunction(encoding)) { + callback = encoding; + encoding = null; } - // backwards compatible start API - var start = cipher.start; - cipher.start = function(iv, options) { - // backwards compatibility: support second arg as output buffer - var output = null; - if(options instanceof forge.util.ByteBuffer) { - output = options; - options = {}; - } - options = options || {}; - options.output = output; - options.iv = iv; - start.call(cipher, options); - }; - - return cipher; -} + // Write data if needed and end + if (!data) { + this._ended = this._ending = true; + this._currentRequest.end(null, null, callback); + } + else { + var self = this; + var currentRequest = this._currentRequest; + this.write(data, encoding, function () { + self._ended = true; + currentRequest.end(null, null, callback); + }); + this._ending = true; + } +}; +// Sets a header value on the current native request +RedirectableRequest.prototype.setHeader = function (name, value) { + this._options.headers[name] = value; + this._currentRequest.setHeader(name, value); +}; -/***/ }), +// Clears a header value on the current native request +RedirectableRequest.prototype.removeHeader = function (name) { + delete this._options.headers[name]; + this._currentRequest.removeHeader(name); +}; -<<<<<<< HEAD -/***/ 72177: -======= -/***/ 96630: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { +// Global timeout for all underlying requests +RedirectableRequest.prototype.setTimeout = function (msecs, callback) { + var self = this; -/** - * Node.js module for Forge. - * - * @author Dave Longley - * - * Copyright 2011-2016 Digital Bazaar, Inc. - */ -module.exports = { - // default options - options: { - usePureJavaScript: false + // Destroys the socket on timeout + function destroyOnTimeout(socket) { + socket.setTimeout(msecs); + socket.removeListener("timeout", socket.destroy); + socket.addListener("timeout", socket.destroy); } -}; + // Sets up a timer to trigger a timeout event + function startTimer(socket) { + if (self._timeout) { + clearTimeout(self._timeout); + } + self._timeout = setTimeout(function () { + self.emit("timeout"); + clearTimer(); + }, msecs); + destroyOnTimeout(socket); + } -/***/ }), + // Stops a timeout from triggering + function clearTimer() { + // Clear the timeout + if (self._timeout) { + clearTimeout(self._timeout); + self._timeout = null; + } -<<<<<<< HEAD -/***/ 8209: -======= -/***/ 46773: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // Clean up all attached listeners + self.removeListener("abort", clearTimer); + self.removeListener("error", clearTimer); + self.removeListener("response", clearTimer); + self.removeListener("close", clearTimer); + if (callback) { + self.removeListener("timeout", callback); + } + if (!self.socket) { + self._currentRequest.removeListener("socket", startTimer); + } + } -/** - * Hash-based Message Authentication Code implementation. Requires a message - * digest object that can be obtained, for example, from forge.md.sha1 or - * forge.md.md5. - * - * @author Dave Longley - * - * Copyright (c) 2010-2012 Digital Bazaar, Inc. All rights reserved. - */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -__nccwpck_require__(2439); -__nccwpck_require__(19239); -======= -var forge = __nccwpck_require__(96630); -__nccwpck_require__(80554); -__nccwpck_require__(36536); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + // Attach callback if passed + if (callback) { + this.on("timeout", callback); + } -/* HMAC API */ -var hmac = module.exports = forge.hmac = forge.hmac || {}; + // Start the timer if or when the socket is opened + if (this.socket) { + startTimer(this.socket); + } + else { + this._currentRequest.once("socket", startTimer); + } -/** - * Creates an HMAC object that uses the given message digest object. - * - * @return an HMAC object. - */ -hmac.create = function() { - // the hmac key to use - var _key = null; + // Clean up on events + this.on("socket", destroyOnTimeout); + this.on("abort", clearTimer); + this.on("error", clearTimer); + this.on("response", clearTimer); + this.on("close", clearTimer); - // the message digest to use - var _md = null; + return this; +}; - // the inner padding - var _ipadding = null; +// Proxy all other public ClientRequest methods +[ + "flushHeaders", "getHeader", + "setNoDelay", "setSocketKeepAlive", +].forEach(function (method) { + RedirectableRequest.prototype[method] = function (a, b) { + return this._currentRequest[method](a, b); + }; +}); - // the outer padding - var _opadding = null; +// Proxy all public ClientRequest properties +["aborted", "connection", "socket"].forEach(function (property) { + Object.defineProperty(RedirectableRequest.prototype, property, { + get: function () { return this._currentRequest[property]; }, + }); +}); - // hmac context - var ctx = {}; +RedirectableRequest.prototype._sanitizeOptions = function (options) { + // Ensure headers are always present + if (!options.headers) { + options.headers = {}; + } - /** - * Starts or restarts the HMAC with the given key and message digest. - * - * @param md the message digest to use, null to reuse the previous one, - * a string to use builtin 'sha1', 'md5', 'sha256'. - * @param key the key to use as a string, array of bytes, byte buffer, - * or null to reuse the previous key. - */ - ctx.start = function(md, key) { - if(md !== null) { - if(typeof md === 'string') { - // create builtin message digest - md = md.toLowerCase(); - if(md in forge.md.algorithms) { - _md = forge.md.algorithms[md].create(); - } else { - throw new Error('Unknown hash algorithm "' + md + '"'); - } - } else { - // store message digest - _md = md; - } + // Since http.request treats host as an alias of hostname, + // but the url module interprets host as hostname plus port, + // eliminate the host property to avoid confusion. + if (options.host) { + // Use hostname if set, because it has precedence + if (!options.hostname) { + options.hostname = options.host; } + delete options.host; + } - if(key === null) { - // reuse previous key - key = _key; - } else { - if(typeof key === 'string') { - // convert string into byte buffer - key = forge.util.createBuffer(key); - } else if(forge.util.isArray(key)) { - // convert byte array into byte buffer - var tmp = key; - key = forge.util.createBuffer(); - for(var i = 0; i < tmp.length; ++i) { - key.putByte(tmp[i]); - } - } - - // if key is longer than blocksize, hash it - var keylen = key.length(); - if(keylen > _md.blockLength) { - _md.start(); - _md.update(key.bytes()); - key = _md.digest(); - } - - // mix key into inner and outer padding - // ipadding = [0x36 * blocksize] ^ key - // opadding = [0x5C * blocksize] ^ key - _ipadding = forge.util.createBuffer(); - _opadding = forge.util.createBuffer(); - keylen = key.length(); - for(var i = 0; i < keylen; ++i) { - var tmp = key.at(i); - _ipadding.putByte(0x36 ^ tmp); - _opadding.putByte(0x5C ^ tmp); - } - - // if key is shorter than blocksize, add additional padding - if(keylen < _md.blockLength) { - var tmp = _md.blockLength - keylen; - for(var i = 0; i < tmp; ++i) { - _ipadding.putByte(0x36); - _opadding.putByte(0x5C); - } - } - _key = key; - _ipadding = _ipadding.bytes(); - _opadding = _opadding.bytes(); + // Complete the URL object when necessary + if (!options.pathname && options.path) { + var searchPos = options.path.indexOf("?"); + if (searchPos < 0) { + options.pathname = options.path; + } + else { + options.pathname = options.path.substring(0, searchPos); + options.search = options.path.substring(searchPos); } + } +}; - // digest is done like so: hash(opadding | hash(ipadding | message)) - // prepare to do inner hash - // hash(ipadding | message) - _md.start(); - _md.update(_ipadding); - }; +// Executes the next native request (initial or redirect) +RedirectableRequest.prototype._performRequest = function () { + // Load the native protocol + var protocol = this._options.protocol; + var nativeProtocol = this._options.nativeProtocols[protocol]; + if (!nativeProtocol) { + this.emit("error", new TypeError("Unsupported protocol " + protocol)); + return; + } - /** - * Updates the HMAC with the given message bytes. - * - * @param bytes the bytes to update with. - */ - ctx.update = function(bytes) { - _md.update(bytes); - }; + // If specified, use the agent corresponding to the protocol + // (HTTP and HTTPS use different types of agents) + if (this._options.agents) { + var scheme = protocol.slice(0, -1); + this._options.agent = this._options.agents[scheme]; + } - /** - * Produces the Message Authentication Code (MAC). - * - * @return a byte buffer containing the digest value. - */ - ctx.getMac = function() { - // digest is done like so: hash(opadding | hash(ipadding | message)) - // here we do the outer hashing - var inner = _md.digest().bytes(); - _md.start(); - _md.update(_opadding); - _md.update(inner); - return _md.digest(); - }; - // alias for getMac - ctx.digest = ctx.getMac; + // Create the native request and set up its event handlers + var request = this._currentRequest = + nativeProtocol.request(this._options, this._onNativeResponse); + request._redirectable = this; + for (var event of events) { + request.on(event, eventHandlers[event]); + } - return ctx; -}; + // RFC7230§5.3.1: When making a request directly to an origin server, […] + // a client MUST send only the absolute path […] as the request-target. + this._currentUrl = /^\//.test(this._options.path) ? + url.format(this._options) : + // When making a request to a proxy, […] + // a client MUST send the target URI in absolute-form […]. + this._options.path; + // End a redirected request + // (The first request must be ended explicitly with RedirectableRequest#end) + if (this._isRedirect) { + // Write the request entity and end + var i = 0; + var self = this; + var buffers = this._requestBodyBuffers; + (function writeNext(error) { + // Only write if this request has not been redirected yet + /* istanbul ignore else */ + if (request === self._currentRequest) { + // Report any write errors + /* istanbul ignore if */ + if (error) { + self.emit("error", error); + } + // Write the next buffer if there are still left + else if (i < buffers.length) { + var buffer = buffers[i++]; + /* istanbul ignore else */ + if (!request.finished) { + request.write(buffer.data, buffer.encoding, writeNext); + } + } + // End the request if `end` has been called on us + else if (self._ended) { + request.end(); + } + } + }()); + } +}; -/***/ }), +// Processes a response from the current native request +RedirectableRequest.prototype._processResponse = function (response) { + // Store the redirected response + var statusCode = response.statusCode; + if (this._options.trackRedirects) { + this._redirects.push({ + url: this._currentUrl, + headers: response.headers, + statusCode: statusCode, + }); + } -<<<<<<< HEAD -/***/ 21686: -======= -/***/ 121: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // RFC7231§6.4: The 3xx (Redirection) class of status code indicates + // that further action needs to be taken by the user agent in order to + // fulfill the request. If a Location header field is provided, + // the user agent MAY automatically redirect its request to the URI + // referenced by the Location field value, + // even if the specific status code is not understood. -// Copyright (c) 2005 Tom Wu -// All Rights Reserved. -// See "LICENSE" for details. + // If the response is not a redirect; return it as-is + var location = response.headers.location; + if (!location || this._options.followRedirects === false || + statusCode < 300 || statusCode >= 400) { + response.responseUrl = this._currentUrl; + response.redirects = this._redirects; + this.emit("response", response); -// Basic JavaScript BN library - subset useful for RSA encryption. + // Clean up + this._requestBodyBuffers = []; + return; + } -/* -Licensing (LICENSE) -------------------- + // The response is a redirect, so abort the current request + destroyRequest(this._currentRequest); + // Discard the remainder of the response to avoid waiting for data + response.destroy(); -This software is covered under the following copyright: -*/ -/* - * Copyright (c) 2003-2005 Tom Wu - * All Rights Reserved. - * - * 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" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF - * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * In addition, the following condition applies: - * - * All redistributions must retain an intact copy of this copyright notice - * and disclaimer. - */ -/* -Address all questions regarding this license to: + // RFC7231§6.4: A client SHOULD detect and intervene + // in cyclical redirections (i.e., "infinite" redirection loops). + if (++this._redirectCount > this._options.maxRedirects) { + this.emit("error", new TooManyRedirectsError()); + return; + } - Tom Wu - tjw@cs.Stanford.EDU -*/ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -======= -var forge = __nccwpck_require__(96630); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + // Store the request headers if applicable + var requestHeaders; + var beforeRedirect = this._options.beforeRedirect; + if (beforeRedirect) { + requestHeaders = Object.assign({ + // The Host header was set by nativeProtocol.request + Host: response.req.getHeader("host"), + }, this._options.headers); + } -module.exports = forge.jsbn = forge.jsbn || {}; + // RFC7231§6.4: Automatic redirection needs to done with + // care for methods not known to be safe, […] + // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change + // the request method from POST to GET for the subsequent request. + var method = this._options.method; + if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || + // RFC7231§6.4.4: The 303 (See Other) status code indicates that + // the server is redirecting the user agent to a different resource […] + // A user agent can perform a retrieval request targeting that URI + // (a GET or HEAD request if using HTTP) […] + (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { + this._options.method = "GET"; + // Drop a possible entity and headers related to it + this._requestBodyBuffers = []; + removeMatchingHeaders(/^content-/i, this._options.headers); + } -// Bits per digit -var dbits; + // Drop the Host header, as the redirect might lead to a different host + var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); -// JavaScript engine analysis -var canary = 0xdeadbeefcafe; -var j_lm = ((canary&0xffffff)==0xefcafe); + // If the redirect is relative, carry over the host of the last request + var currentUrlParts = url.parse(this._currentUrl); + var currentHost = currentHostHeader || currentUrlParts.host; + var currentUrl = /^\w+:/.test(location) ? this._currentUrl : + url.format(Object.assign(currentUrlParts, { host: currentHost })); -// (public) Constructor -function BigInteger(a,b,c) { - this.data = []; - if(a != null) - if("number" == typeof a) this.fromNumber(a,b,c); - else if(b == null && "string" != typeof a) this.fromString(a,256); - else this.fromString(a,b); -} -forge.jsbn.BigInteger = BigInteger; + // Determine the URL of the redirection + var redirectUrl; + try { + redirectUrl = url.resolve(currentUrl, location); + } + catch (cause) { + this.emit("error", new RedirectionError({ cause: cause })); + return; + } -// return new, unset BigInteger -function nbi() { return new BigInteger(null); } + // Create the redirected request + debug("redirecting to", redirectUrl); + this._isRedirect = true; + var redirectUrlParts = url.parse(redirectUrl); + Object.assign(this._options, redirectUrlParts); -// am: Compute w_j += (x*this_i), propagate carries, -// c is initial carry, returns final carry. -// c < 3*dvalue, x < 2*dvalue, this_i < dvalue -// We need to select the fastest one that works in this environment. + // Drop confidential headers when redirecting to a less secure protocol + // or to a different domain that is not a superdomain + if (redirectUrlParts.protocol !== currentUrlParts.protocol && + redirectUrlParts.protocol !== "https:" || + redirectUrlParts.host !== currentHost && + !isSubdomain(redirectUrlParts.host, currentHost)) { + removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers); + } -// am1: use a single mult and divide to get the high bits, -// max digit bits should be 26 because -// max internal value = 2*dvalue^2-2*dvalue (< 2^53) -function am1(i,x,w,j,c,n) { - while(--n >= 0) { - var v = x*this.data[i++]+w.data[j]+c; - c = Math.floor(v/0x4000000); - w.data[j++] = v&0x3ffffff; + // Evaluate the beforeRedirect callback + if (isFunction(beforeRedirect)) { + var responseDetails = { + headers: response.headers, + statusCode: statusCode, + }; + var requestDetails = { + url: currentUrl, + method: method, + headers: requestHeaders, + }; + try { + beforeRedirect(this._options, responseDetails, requestDetails); + } + catch (err) { + this.emit("error", err); + return; + } + this._sanitizeOptions(this._options); } - return c; -} -// am2 avoids a big mult-and-extract completely. -// Max digit bits should be <= 30 because we do bitwise ops -// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) -function am2(i,x,w,j,c,n) { - var xl = x&0x7fff, xh = x>>15; - while(--n >= 0) { - var l = this.data[i]&0x7fff; - var h = this.data[i++]>>15; - var m = xh*l+h*xl; - l = xl*l+((m&0x7fff)<<15)+w.data[j]+(c&0x3fffffff); - c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); - w.data[j++] = l&0x3fffffff; + + // Perform the redirected request + try { + this._performRequest(); } - return c; -} -// Alternately, set max digit bits to 28 since some -// browsers slow down when dealing with 32-bit numbers. -function am3(i,x,w,j,c,n) { - var xl = x&0x3fff, xh = x>>14; - while(--n >= 0) { - var l = this.data[i]&0x3fff; - var h = this.data[i++]>>14; - var m = xh*l+h*xl; - l = xl*l+((m&0x3fff)<<14)+w.data[j]+c; - c = (l>>28)+(m>>14)+xh*h; - w.data[j++] = l&0xfffffff; + catch (cause) { + this.emit("error", new RedirectionError({ cause: cause })); } - return c; -} +}; -// node.js (no browser) -if(typeof(navigator) === 'undefined') -{ - BigInteger.prototype.am = am3; - dbits = 28; -} else if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) { - BigInteger.prototype.am = am2; - dbits = 30; -} else if(j_lm && (navigator.appName != "Netscape")) { - BigInteger.prototype.am = am1; - dbits = 26; -} else { // Mozilla/Netscape seems to prefer am3 - BigInteger.prototype.am = am3; - dbits = 28; -} +// Wraps the key/value object of protocols with redirect functionality +function wrap(protocols) { + // Default settings + var exports = { + maxRedirects: 21, + maxBodyLength: 10 * 1024 * 1024, + }; -BigInteger.prototype.DB = dbits; -BigInteger.prototype.DM = ((1<= 0; --i) r.data[i] = this.data[i]; - r.t = this.t; - r.s = this.s; -} + // Executes a GET request, following redirects + function get(input, options, callback) { + var wrappedRequest = wrappedProtocol.request(input, options, callback); + wrappedRequest.end(); + return wrappedRequest; + } -// (protected) set from integer value x, -DV <= x < DV -function bnpFromInt(x) { - this.t = 1; - this.s = (x<0)?-1:0; - if(x > 0) this.data[0] = x; - else if(x < -1) this.data[0] = x+this.DV; - else this.t = 0; + // Expose the properties on the wrapped protocol + Object.defineProperties(wrappedProtocol, { + request: { value: request, configurable: true, enumerable: true, writable: true }, + get: { value: get, configurable: true, enumerable: true, writable: true }, + }); + }); + return exports; } -// return bigint initialized to value -function nbv(i) { var r = nbi(); r.fromInt(i); return r; } +/* istanbul ignore next */ +function noop() { /* empty */ } -// (protected) set from string and radix -function bnpFromString(s,b) { - var k; - if(b == 16) k = 4; - else if(b == 8) k = 3; - else if(b == 256) k = 8; // byte array - else if(b == 2) k = 1; - else if(b == 32) k = 5; - else if(b == 4) k = 2; - else { this.fromRadix(s,b); return; } - this.t = 0; - this.s = 0; - var i = s.length, mi = false, sh = 0; - while(--i >= 0) { - var x = (k==8)?s[i]&0xff:intAt(s,i); - if(x < 0) { - if(s.charAt(i) == "-") mi = true; - continue; - } - mi = false; - if(sh == 0) - this.data[this.t++] = x; - else if(sh+k > this.DB) { - this.data[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh)); - } else - this.data[this.t-1] |= x<= this.DB) sh -= this.DB; - } - if(k == 8 && (s[0]&0x80) != 0) { - this.s = -1; - if(sh > 0) this.data[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this.data[this.t-1] == c) --this.t; + return options; } -// (public) return string representation in given radix -function bnToString(b) { - if(this.s < 0) return "-"+this.negate().toString(b); - var k; - if(b == 16) k = 4; - else if(b == 8) k = 3; - else if(b == 2) k = 1; - else if(b == 32) k = 5; - else if(b == 4) k = 2; - else return this.toRadix(b); - var km = (1< 0) { - if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); } - while(i >= 0) { - if(p < k) { - d = (this.data[i]&((1<>(p+=this.DB-k); - } else { - d = (this.data[i]>>(p-=k))&km; - if(p <= 0) { p += this.DB; --i; } - } - if(d > 0) m = true; - if(m) r += int2char(d); +function removeMatchingHeaders(regex, headers) { + var lastValue; + for (var header in headers) { + if (regex.test(header)) { + lastValue = headers[header]; + delete headers[header]; } } - return m?r:"0"; + return (lastValue === null || typeof lastValue === "undefined") ? + undefined : String(lastValue).trim(); } -// (public) -this -function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } - -// (public) |this| -function bnAbs() { return (this.s<0)?this.negate():this; } +function createErrorType(code, message, baseClass) { + // Create constructor + function CustomError(properties) { + Error.captureStackTrace(this, this.constructor); + Object.assign(this, properties || {}); + this.code = code; + this.message = this.cause ? message + ": " + this.cause.message : message; + } -// (public) return + if this > a, - if this < a, 0 if equal -function bnCompareTo(a) { - var r = this.s-a.s; - if(r != 0) return r; - var i = this.t; - r = i-a.t; - if(r != 0) return (this.s<0)?-r:r; - while(--i >= 0) if((r=this.data[i]-a.data[i]) != 0) return r; - return 0; + // Attach constructor and set default properties + CustomError.prototype = new (baseClass || Error)(); + CustomError.prototype.constructor = CustomError; + CustomError.prototype.name = "Error [" + code + "]"; + return CustomError; } -// returns bit length of the integer x -function nbits(x) { - var r = 1, t; - if((t=x>>>16) != 0) { x = t; r += 16; } - if((t=x>>8) != 0) { x = t; r += 8; } - if((t=x>>4) != 0) { x = t; r += 4; } - if((t=x>>2) != 0) { x = t; r += 2; } - if((t=x>>1) != 0) { x = t; r += 1; } - return r; +function destroyRequest(request, error) { + for (var event of events) { + request.removeListener(event, eventHandlers[event]); + } + request.on("error", noop); + request.destroy(error); } -// (public) return the number of bits in "this" -function bnBitLength() { - if(this.t <= 0) return 0; - return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM)); +function isSubdomain(subdomain, domain) { + assert(isString(subdomain) && isString(domain)); + var dot = subdomain.length - domain.length - 1; + return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); } -// (protected) r = this << n*DB -function bnpDLShiftTo(n,r) { - var i; - for(i = this.t-1; i >= 0; --i) r.data[i+n] = this.data[i]; - for(i = n-1; i >= 0; --i) r.data[i] = 0; - r.t = this.t+n; - r.s = this.s; +function isString(value) { + return typeof value === "string" || value instanceof String; } -// (protected) r = this >> n*DB -function bnpDRShiftTo(n,r) { - for(var i = n; i < this.t; ++i) r.data[i-n] = this.data[i]; - r.t = Math.max(this.t-n,0); - r.s = this.s; +function isFunction(value) { + return typeof value === "function"; } -// (protected) r = this << n -function bnpLShiftTo(n,r) { - var bs = n%this.DB; - var cbs = this.DB-bs; - var bm = (1<= 0; --i) { - r.data[i+ds+1] = (this.data[i]>>cbs)|c; - c = (this.data[i]&bm)<= 0; --i) r.data[i] = 0; - r.data[ds] = c; - r.t = this.t+ds+1; - r.s = this.s; - r.clamp(); +function isBuffer(value) { + return typeof value === "object" && ("length" in value); } -// (protected) r = this >> n -function bnpRShiftTo(n,r) { - r.s = this.s; - var ds = Math.floor(n/this.DB); - if(ds >= this.t) { r.t = 0; return; } - var bs = n%this.DB; - var cbs = this.DB-bs; - var bm = (1<>bs; - for(var i = ds+1; i < this.t; ++i) { - r.data[i-ds-1] |= (this.data[i]&bm)<>bs; - } - if(bs > 0) r.data[this.t-ds-1] |= (this.s&bm)<>= this.DB; - } - if(a.t < this.t) { - c -= a.s; - while(i < this.t) { - c += this.data[i]; - r.data[i++] = c&this.DM; - c >>= this.DB; - } - c += this.s; - } else { - c += this.s; - while(i < a.t) { - c -= a.data[i]; - r.data[i++] = c&this.DM; - c >>= this.DB; - } - c -= a.s; - } - r.s = (c<0)?-1:0; - if(c < -1) r.data[i++] = this.DV+c; - else if(c > 0) r.data[i++] = c; - r.t = i; - r.clamp(); -} -// (protected) r = this * a, r != this,a (HAC 14.12) -// "this" should be the larger one if appropriate. -function bnpMultiplyTo(a,r) { - var x = this.abs(), y = a.abs(); - var i = x.t; - r.t = i+y.t; - while(--i >= 0) r.data[i] = 0; - for(i = 0; i < y.t; ++i) r.data[i+x.t] = x.am(0,y.data[i],r,i,0,x.t); - r.s = 0; - r.clamp(); - if(this.s != a.s) BigInteger.ZERO.subTo(r,r); -} +/***/ }), -// (protected) r = this^2, r != this (HAC 14.16) -function bnpSquareTo(r) { - var x = this.abs(); - var i = r.t = 2*x.t; - while(--i >= 0) r.data[i] = 0; - for(i = 0; i < x.t-1; ++i) { - var c = x.am(i,x.data[i],r,2*i,0,1); - if((r.data[i+x.t]+=x.am(i+1,2*x.data[i],r,2*i+1,c,x.t-i-1)) >= x.DV) { - r.data[i+x.t] -= x.DV; - r.data[i+x.t+1] = 1; - } - } - if(r.t > 0) r.data[r.t-1] += x.am(i,x.data[i],r,2*i,0,1); - r.s = 0; - r.clamp(); -} +/***/ 76948: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) -// r != q, this != m. q or r may be null. -function bnpDivRemTo(m,q,r) { - var pm = m.abs(); - if(pm.t <= 0) return; - var pt = this.abs(); - if(pt.t < pm.t) { - if(q != null) q.fromInt(0); - if(r != null) this.copyTo(r); - return; - } - if(r == null) r = nbi(); - var y = nbi(), ts = this.s, ms = m.s; - var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus - if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); } - var ys = y.t; - var y0 = y.data[ys-1]; - if(y0 == 0) return; - var yt = y0*(1<1)?y.data[ys-2]>>this.F2:0); - var d1 = this.FV/yt, d2 = (1<= 0) { - r.data[r.t++] = 1; - r.subTo(t,r); - } - BigInteger.ONE.dlShiftTo(ys,t); - t.subTo(y,y); // "negative" y so we can replace sub with am later - while(y.t < ys) y.data[y.t++] = 0; - while(--j >= 0) { - // Estimate quotient digit - var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2); - if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out - y.dlShiftTo(j,t); - r.subTo(t,r); - while(r.data[i] < --qd) r.subTo(t,r); - } - } - if(q != null) { - r.drShiftTo(ys,q); - if(ts != ms) BigInteger.ZERO.subTo(q,q); +var CombinedStream = __nccwpck_require__(1526); +var util = __nccwpck_require__(73837); +var path = __nccwpck_require__(71017); +var http = __nccwpck_require__(13685); +var https = __nccwpck_require__(95687); +var parseUrl = (__nccwpck_require__(57310).parse); +var fs = __nccwpck_require__(57147); +var Stream = (__nccwpck_require__(12781).Stream); +var mime = __nccwpck_require__(26195); +var asynckit = __nccwpck_require__(86686); +var populate = __nccwpck_require__(44621); + +// Public API +module.exports = FormData; + +// make it a Stream +util.inherits(FormData, CombinedStream); + +/** + * Create readable "multipart/form-data" streams. + * Can be used to submit forms + * and file uploads to other web applications. + * + * @constructor + * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream + */ +function FormData(options) { + if (!(this instanceof FormData)) { + return new FormData(options); } - r.t = ys; - r.clamp(); - if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder - if(ts < 0) BigInteger.ZERO.subTo(r,r); -} -// (public) this mod a -function bnMod(a) { - var r = nbi(); - this.abs().divRemTo(a,null,r); - if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); - return r; -} + this._overheadLength = 0; + this._valueLength = 0; + this._valuesToMeasure = []; -// Modular reduction using "classic" algorithm -function Classic(m) { this.m = m; } -function cConvert(x) { - if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); - else return x; + CombinedStream.call(this); + + options = options || {}; + for (var option in options) { + this[option] = options[option]; + } } -function cRevert(x) { return x; } -function cReduce(x) { x.divRemTo(this.m,null,x); } -function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } -function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } -Classic.prototype.convert = cConvert; -Classic.prototype.revert = cRevert; -Classic.prototype.reduce = cReduce; -Classic.prototype.mulTo = cMulTo; -Classic.prototype.sqrTo = cSqrTo; +FormData.LINE_BREAK = '\r\n'; +FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream'; -// (protected) return "-1/this % 2^DB"; useful for Mont. reduction -// justification: -// xy == 1 (mod m) -// xy = 1+km -// xy(2-xy) = (1+km)(1-km) -// x[y(2-xy)] = 1-k^2m^2 -// x[y(2-xy)] == 1 (mod m^2) -// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 -// should reduce x and y(2-xy) by m^2 at each step to keep size bounded. -// JS multiply "overflows" differently from C/C++, so care is needed here. -function bnpInvDigit() { - if(this.t < 1) return 0; - var x = this.data[0]; - if((x&1) == 0) return 0; - var y = x&3; // y == 1/x mod 2^2 - y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 - y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 - y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 - // last step - calculate inverse mod DV directly; - // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints - y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits - // we really want the negative inverse, and -DV < y < DV - return (y>0)?this.DV-y:-y; -} +FormData.prototype.append = function(field, value, options) { -// Montgomery reduction -function Montgomery(m) { - this.m = m; - this.mp = m.invDigit(); - this.mpl = this.mp&0x7fff; - this.mph = this.mp>>15; - this.um = (1<<(m.DB-15))-1; - this.mt2 = 2*m.t; -} + options = options || {}; -// xR mod m -function montConvert(x) { - var r = nbi(); - x.abs().dlShiftTo(this.m.t,r); - r.divRemTo(this.m,null,r); - if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); - return r; -} + // allow filename as single option + if (typeof options == 'string') { + options = {filename: options}; + } -// x/R mod m -function montRevert(x) { - var r = nbi(); - x.copyTo(r); - this.reduce(r); - return r; -} + var append = CombinedStream.prototype.append.bind(this); -// x = x/R mod m (HAC 14.32) -function montReduce(x) { - while(x.t <= this.mt2) // pad x so am has enough room later - x.data[x.t++] = 0; - for(var i = 0; i < this.m.t; ++i) { - // faster way of calculating u0 = x.data[i]*mp mod DV - var j = x.data[i]&0x7fff; - var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM; - // use am to combine the multiply-shift-add into one call - j = i+this.m.t; - x.data[j] += this.m.am(0,u0,x,i,0,this.m.t); - // propagate carry - while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; } + // all that streamy business can't handle numbers + if (typeof value == 'number') { + value = '' + value; } - x.clamp(); - x.drShiftTo(this.m.t,x); - if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); -} -// r = "x^2/R mod m"; x != r -function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + // https://github.com/felixge/node-form-data/issues/38 + if (util.isArray(value)) { + // Please convert your array into string + // the way web server expects it + this._error(new Error('Arrays are not supported.')); + return; + } -// r = "xy/R mod m"; x,y != r -function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } + var header = this._multiPartHeader(field, value, options); + var footer = this._multiPartFooter(); -Montgomery.prototype.convert = montConvert; -Montgomery.prototype.revert = montRevert; -Montgomery.prototype.reduce = montReduce; -Montgomery.prototype.mulTo = montMulTo; -Montgomery.prototype.sqrTo = montSqrTo; + append(header); + append(value); + append(footer); -// (protected) true iff this is even -function bnpIsEven() { return ((this.t>0)?(this.data[0]&1):this.s) == 0; } + // pass along options.knownLength + this._trackLength(header, value, options); +}; -// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) -function bnpExp(e,z) { - if(e > 0xffffffff || e < 1) return BigInteger.ONE; - var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; - g.copyTo(r); - while(--i >= 0) { - z.sqrTo(r,r2); - if((e&(1< 0) z.mulTo(r2,g,r); - else { var t = r; r = r2; r2 = t; } +FormData.prototype._trackLength = function(header, value, options) { + var valueLength = 0; + + // used w/ getLengthSync(), when length is known. + // e.g. for streaming directly from a remote server, + // w/ a known file a size, and not wanting to wait for + // incoming file to finish to get its size. + if (options.knownLength != null) { + valueLength += +options.knownLength; + } else if (Buffer.isBuffer(value)) { + valueLength = value.length; + } else if (typeof value === 'string') { + valueLength = Buffer.byteLength(value); } - return z.revert(r); -} -// (public) this^e % m, 0 <= e < 2^32 -function bnModPowInt(e,m) { - var z; - if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); - return this.exp(e,z); -} + this._valueLength += valueLength; -// protected -BigInteger.prototype.copyTo = bnpCopyTo; -BigInteger.prototype.fromInt = bnpFromInt; -BigInteger.prototype.fromString = bnpFromString; -BigInteger.prototype.clamp = bnpClamp; -BigInteger.prototype.dlShiftTo = bnpDLShiftTo; -BigInteger.prototype.drShiftTo = bnpDRShiftTo; -BigInteger.prototype.lShiftTo = bnpLShiftTo; -BigInteger.prototype.rShiftTo = bnpRShiftTo; -BigInteger.prototype.subTo = bnpSubTo; -BigInteger.prototype.multiplyTo = bnpMultiplyTo; -BigInteger.prototype.squareTo = bnpSquareTo; -BigInteger.prototype.divRemTo = bnpDivRemTo; -BigInteger.prototype.invDigit = bnpInvDigit; -BigInteger.prototype.isEven = bnpIsEven; -BigInteger.prototype.exp = bnpExp; + // @check why add CRLF? does this account for custom/multiple CRLFs? + this._overheadLength += + Buffer.byteLength(header) + + FormData.LINE_BREAK.length; -// public -BigInteger.prototype.toString = bnToString; -BigInteger.prototype.negate = bnNegate; -BigInteger.prototype.abs = bnAbs; -BigInteger.prototype.compareTo = bnCompareTo; -BigInteger.prototype.bitLength = bnBitLength; -BigInteger.prototype.mod = bnMod; -BigInteger.prototype.modPowInt = bnModPowInt; + // empty or either doesn't have path or not an http response or not a stream + if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) && !(value instanceof Stream))) { + return; + } -// "constants" -BigInteger.ZERO = nbv(0); -BigInteger.ONE = nbv(1); + // no need to bother with the length + if (!options.knownLength) { + this._valuesToMeasure.push(value); + } +}; -// jsbn2 lib +FormData.prototype._lengthRetriever = function(value, callback) { -//Copyright (c) 2005-2009 Tom Wu -//All Rights Reserved. -//See "LICENSE" for details (See jsbn.js for LICENSE). + if (value.hasOwnProperty('fd')) { -//Extended JavaScript BN functions, required for RSA private ops. + // take read range into a account + // `end` = Infinity –> read file till the end + // + // TODO: Looks like there is bug in Node fs.createReadStream + // it doesn't respect `end` options without `start` options + // Fix it when node fixes it. + // https://github.com/joyent/node/issues/7819 + if (value.end != undefined && value.end != Infinity && value.start != undefined) { -//Version 1.1: new BigInteger("0", 10) returns "proper" zero + // when end specified + // no need to calculate range + // inclusive, starts with 0 + callback(null, value.end + 1 - (value.start ? value.start : 0)); -//(public) -function bnClone() { var r = nbi(); this.copyTo(r); return r; } + // not that fast snoopy + } else { + // still need to fetch file size from fs + fs.stat(value.path, function(err, stat) { -//(public) return value as integer -function bnIntValue() { -if(this.s < 0) { - if(this.t == 1) return this.data[0]-this.DV; - else if(this.t == 0) return -1; -} else if(this.t == 1) return this.data[0]; -else if(this.t == 0) return 0; -// assumes 16 < DB < 32 -return ((this.data[1]&((1<<(32-this.DB))-1))<>24; } + if (err) { + callback(err); + return; + } -//(public) return value as short (assumes DB>=16) -function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; } + // update final size based on the range options + fileSize = stat.size - (value.start ? value.start : 0); + callback(null, fileSize); + }); + } -//(protected) return x s.t. r^x < DV -function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); } + // or http response + } else if (value.hasOwnProperty('httpVersion')) { + callback(null, +value.headers['content-length']); -//(public) 0 if this == 0, 1 if this > 0 -function bnSigNum() { -if(this.s < 0) return -1; -else if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0; -else return 1; -} + // or request stream http://github.com/mikeal/request + } else if (value.hasOwnProperty('httpModule')) { + // wait till response come back + value.on('response', function(response) { + value.pause(); + callback(null, +response.headers['content-length']); + }); + value.resume(); -//(protected) convert to radix string -function bnpToRadix(b) { -if(b == null) b = 10; -if(this.signum() == 0 || b < 2 || b > 36) return "0"; -var cs = this.chunkSize(b); -var a = Math.pow(b,cs); -var d = nbv(a), y = nbi(), z = nbi(), r = ""; -this.divRemTo(d,y,z); -while(y.signum() > 0) { - r = (a+z.intValue()).toString(b).substr(1) + r; - y.divRemTo(d,y,z); -} -return z.intValue().toString(b) + r; -} + // something else + } else { + callback('Unknown stream'); + } +}; -//(protected) convert from radix string -function bnpFromRadix(s,b) { -this.fromInt(0); -if(b == null) b = 10; -var cs = this.chunkSize(b); -var d = Math.pow(b,cs), mi = false, j = 0, w = 0; -for(var i = 0; i < s.length; ++i) { - var x = intAt(s,i); - if(x < 0) { - if(s.charAt(i) == "-" && this.signum() == 0) mi = true; - continue; - } - w = b*w+x; - if(++j >= cs) { - this.dMultiply(d); - this.dAddOffset(w,0); - j = 0; - w = 0; - } -} -if(j > 0) { - this.dMultiply(Math.pow(b,j)); - this.dAddOffset(w,0); -} -if(mi) BigInteger.ZERO.subTo(this,this); -} +FormData.prototype._multiPartHeader = function(field, value, options) { + // custom header specified (as string)? + // it becomes responsible for boundary + // (e.g. to handle extra CRLFs on .NET servers) + if (typeof options.header == 'string') { + return options.header; + } -//(protected) alternate constructor -function bnpFromNumber(a,b,c) { -if("number" == typeof b) { - // new BigInteger(int,int,RNG) - if(a < 2) this.fromInt(1); - else { - this.fromNumber(a,c); - if(!this.testBit(a-1)) // force MSB set - this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this); - if(this.isEven()) this.dAddOffset(1,0); // force odd - while(!this.isProbablePrime(b)) { - this.dAddOffset(2,0); - if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this); - } - } -} else { - // new BigInteger(int,RNG) - var x = new Array(), t = a&7; - x.length = (a>>3)+1; - b.nextBytes(x); - if(t > 0) x[0] &= ((1< 0) { - if(p < this.DB && (d = this.data[i]>>p) != (this.s&this.DM)>>p) - r[k++] = d|(this.s<<(this.DB-p)); - while(i >= 0) { - if(p < 8) { - d = (this.data[i]&((1<>(p+=this.DB-8); - } else { - d = (this.data[i]>>(p-=8))&0xff; - if(p <= 0) { p += this.DB; --i; } - } - if((d&0x80) != 0) d |= -256; - if(k == 0 && (this.s&0x80) != (d&0x80)) ++k; - if(k > 0 || d != this.s) r[k++] = d; - } -} -return r; -} + var contents = ''; + var headers = { + // add custom disposition as third element or keep it two elements if not + 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []), + // if no content type. allow it to be empty array + 'Content-Type': [].concat(contentType || []) + }; -function bnEquals(a) { return(this.compareTo(a)==0); } -function bnMin(a) { return(this.compareTo(a)<0)?this:a; } -function bnMax(a) { return(this.compareTo(a)>0)?this:a; } + // allow custom headers. + if (typeof options.header == 'object') { + populate(headers, options.header); + } -//(protected) r = this op a (bitwise) -function bnpBitwiseTo(a,op,r) { -var i, f, m = Math.min(a.t,this.t); -for(i = 0; i < m; ++i) r.data[i] = op(this.data[i],a.data[i]); -if(a.t < this.t) { - f = a.s&this.DM; - for(i = m; i < this.t; ++i) r.data[i] = op(this.data[i],f); - r.t = this.t; -} else { - f = this.s&this.DM; - for(i = m; i < a.t; ++i) r.data[i] = op(f,a.data[i]); - r.t = a.t; -} -r.s = op(this.s,a.s); -r.clamp(); -} + var header; + for (var prop in headers) { + if (!headers.hasOwnProperty(prop)) continue; + header = headers[prop]; -//(public) this & a -function op_and(x,y) { return x&y; } -function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; } + // skip nullish headers. + if (header == null) { + continue; + } -//(public) this | a -function op_or(x,y) { return x|y; } -function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; } + // convert all headers to arrays. + if (!Array.isArray(header)) { + header = [header]; + } -//(public) this ^ a -function op_xor(x,y) { return x^y; } -function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; } + // add non-empty headers. + if (header.length) { + contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK; + } + } -//(public) this & ~a -function op_andnot(x,y) { return x&~y; } -function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; } + return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; +}; -//(public) ~this -function bnNot() { -var r = nbi(); -for(var i = 0; i < this.t; ++i) r.data[i] = this.DM&~this.data[i]; -r.t = this.t; -r.s = ~this.s; -return r; -} +FormData.prototype._getContentDisposition = function(value, options) { -//(public) this << n -function bnShiftLeft(n) { -var r = nbi(); -if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r); -return r; -} + var filename + , contentDisposition + ; -//(public) this >> n -function bnShiftRight(n) { -var r = nbi(); -if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r); -return r; -} + if (typeof options.filepath === 'string') { + // custom filepath for relative paths + filename = path.normalize(options.filepath).replace(/\\/g, '/'); + } else if (options.filename || value.name || value.path) { + // custom filename take precedence + // formidable and the browser add a name property + // fs- and request- streams have path property + filename = path.basename(options.filename || value.name || value.path); + } else if (value.readable && value.hasOwnProperty('httpVersion')) { + // or try http response + filename = path.basename(value.client._httpMessage.path || ''); + } -//return index of lowest 1-bit in x, x < 2^31 -function lbit(x) { -if(x == 0) return -1; -var r = 0; -if((x&0xffff) == 0) { x >>= 16; r += 16; } -if((x&0xff) == 0) { x >>= 8; r += 8; } -if((x&0xf) == 0) { x >>= 4; r += 4; } -if((x&3) == 0) { x >>= 2; r += 2; } -if((x&1) == 0) ++r; -return r; -} + if (filename) { + contentDisposition = 'filename="' + filename + '"'; + } -//(public) returns index of lowest 1-bit (or -1 if none) -function bnGetLowestSetBit() { -for(var i = 0; i < this.t; ++i) - if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]); -if(this.s < 0) return this.t*this.DB; -return -1; -} + return contentDisposition; +}; -//return number of 1 bits in x -function cbit(x) { -var r = 0; -while(x != 0) { x &= x-1; ++r; } -return r; -} +FormData.prototype._getContentType = function(value, options) { -//(public) return number of set bits -function bnBitCount() { -var r = 0, x = this.s&this.DM; -for(var i = 0; i < this.t; ++i) r += cbit(this.data[i]^x); -return r; -} + // use custom content-type above all + var contentType = options.contentType; -//(public) true iff nth bit is set -function bnTestBit(n) { -var j = Math.floor(n/this.DB); -if(j >= this.t) return(this.s!=0); -return((this.data[j]&(1<<(n%this.DB)))!=0); -} + // or try `name` from formidable, browser + if (!contentType && value.name) { + contentType = mime.lookup(value.name); + } -//(protected) this op (1<>= this.DB; -} -if(a.t < this.t) { - c += a.s; - while(i < this.t) { - c += this.data[i]; - r.data[i++] = c&this.DM; - c >>= this.DB; - } - c += this.s; -} else { - c += this.s; - while(i < a.t) { - c += a.data[i]; - r.data[i++] = c&this.DM; - c >>= this.DB; - } - c += a.s; -} -r.s = (c<0)?-1:0; -if(c > 0) r.data[i++] = c; -else if(c < -1) r.data[i++] = this.DV+c; -r.t = i; -r.clamp(); -} + return contentType; +}; -//(public) this + a -function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; } +FormData.prototype._multiPartFooter = function() { + return function(next) { + var footer = FormData.LINE_BREAK; -//(public) this - a -function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; } + var lastPart = (this._streams.length === 0); + if (lastPart) { + footer += this._lastBoundary(); + } -//(public) this * a -function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; } + next(footer); + }.bind(this); +}; -//(public) this / a -function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; } +FormData.prototype._lastBoundary = function() { + return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; +}; -//(public) this % a -function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; } +FormData.prototype.getHeaders = function(userHeaders) { + var header; + var formHeaders = { + 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() + }; -//(public) [this/a,this%a] -function bnDivideAndRemainder(a) { -var q = nbi(), r = nbi(); -this.divRemTo(a,q,r); -return new Array(q,r); -} + for (header in userHeaders) { + if (userHeaders.hasOwnProperty(header)) { + formHeaders[header.toLowerCase()] = userHeaders[header]; + } + } -//(protected) this *= n, this >= 0, 1 < n < DV -function bnpDMultiply(n) { -this.data[this.t] = this.am(0,n-1,this,0,0,this.t); -++this.t; -this.clamp(); -} + return formHeaders; +}; -//(protected) this += n << w words, this >= 0 -function bnpDAddOffset(n,w) { -if(n == 0) return; -while(this.t <= w) this.data[this.t++] = 0; -this.data[w] += n; -while(this.data[w] >= this.DV) { - this.data[w] -= this.DV; - if(++w >= this.t) this.data[this.t++] = 0; - ++this.data[w]; -} -} +FormData.prototype.setBoundary = function(boundary) { + this._boundary = boundary; +}; -//A "null" reducer -function NullExp() {} -function nNop(x) { return x; } -function nMulTo(x,y,r) { x.multiplyTo(y,r); } -function nSqrTo(x,r) { x.squareTo(r); } +FormData.prototype.getBoundary = function() { + if (!this._boundary) { + this._generateBoundary(); + } -NullExp.prototype.convert = nNop; -NullExp.prototype.revert = nNop; -NullExp.prototype.mulTo = nMulTo; -NullExp.prototype.sqrTo = nSqrTo; + return this._boundary; +}; -//(public) this^e -function bnPow(e) { return this.exp(e,new NullExp()); } +FormData.prototype.getBuffer = function() { + var dataBuffer = new Buffer.alloc( 0 ); + var boundary = this.getBoundary(); -//(protected) r = lower n words of "this * a", a.t <= n -//"this" should be the larger one if appropriate. -function bnpMultiplyLowerTo(a,n,r) { -var i = Math.min(this.t+a.t,n); -r.s = 0; // assumes a,this >= 0 -r.t = i; -while(i > 0) r.data[--i] = 0; -var j; -for(j = r.t-this.t; i < j; ++i) r.data[i+this.t] = this.am(0,a.data[i],r,i,0,this.t); -for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a.data[i],r,i,0,n-i); -r.clamp(); -} + // Create the form content. Add Line breaks to the end of data. + for (var i = 0, len = this._streams.length; i < len; i++) { + if (typeof this._streams[i] !== 'function') { -//(protected) r = "this * a" without lower n words, n > 0 -//"this" should be the larger one if appropriate. -function bnpMultiplyUpperTo(a,n,r) { ---n; -var i = r.t = this.t+a.t-n; -r.s = 0; // assumes a,this >= 0 -while(--i >= 0) r.data[i] = 0; -for(i = Math.max(n-this.t,0); i < a.t; ++i) - r.data[this.t+i-n] = this.am(n-i,a.data[i],r,0,0,this.t+i-n); -r.clamp(); -r.drShiftTo(1,r); -} + // Add content to the buffer. + if(Buffer.isBuffer(this._streams[i])) { + dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]); + }else { + dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]); + } -//Barrett modular reduction -function Barrett(m) { -// setup Barrett -this.r2 = nbi(); -this.q3 = nbi(); -BigInteger.ONE.dlShiftTo(2*m.t,this.r2); -this.mu = this.r2.divide(m); -this.m = m; -} + // Add break after content. + if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) { + dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] ); + } + } + } -function barrettConvert(x) { -if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m); -else if(x.compareTo(this.m) < 0) return x; -else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; } -} + // Add the footer and return the Buffer object. + return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] ); +}; -function barrettRevert(x) { return x; } +FormData.prototype._generateBoundary = function() { + // This generates a 50 character boundary similar to those used by Firefox. + // They are optimized for boyer-moore parsing. + var boundary = '--------------------------'; + for (var i = 0; i < 24; i++) { + boundary += Math.floor(Math.random() * 10).toString(16); + } -//x = x mod m (HAC 14.42) -function barrettReduce(x) { -x.drShiftTo(this.m.t-1,this.r2); -if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); } -this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3); -this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2); -while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1); -x.subTo(this.r2,x); -while(x.compareTo(this.m) >= 0) x.subTo(this.m,x); -} + this._boundary = boundary; +}; -//r = x^2 mod m; x != r -function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); } +// Note: getLengthSync DOESN'T calculate streams length +// As workaround one can calculate file size manually +// and add it as knownLength option +FormData.prototype.getLengthSync = function() { + var knownLength = this._overheadLength + this._valueLength; -//r = x*y mod m; x,y != r -function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } + // Don't get confused, there are 3 "internal" streams for each keyval pair + // so it basically checks if there is any value added to the form + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } -Barrett.prototype.convert = barrettConvert; -Barrett.prototype.revert = barrettRevert; -Barrett.prototype.reduce = barrettReduce; -Barrett.prototype.mulTo = barrettMulTo; -Barrett.prototype.sqrTo = barrettSqrTo; + // https://github.com/form-data/form-data/issues/40 + if (!this.hasKnownLength()) { + // Some async length retrievers are present + // therefore synchronous length calculation is false. + // Please use getLength(callback) to get proper length + this._error(new Error('Cannot calculate proper length in synchronous way.')); + } -//(public) this^e % m (HAC 14.85) -function bnModPow(e,m) { -var i = e.bitLength(), k, r = nbv(1), z; -if(i <= 0) return r; -else if(i < 18) k = 1; -else if(i < 48) k = 3; -else if(i < 144) k = 4; -else if(i < 768) k = 5; -else k = 6; -if(i < 8) - z = new Classic(m); -else if(m.isEven()) - z = new Barrett(m); -else - z = new Montgomery(m); + return knownLength; +}; -// precomputation -var g = new Array(), n = 3, k1 = k-1, km = (1< 1) { - var g2 = nbi(); - z.sqrTo(g[1],g2); - while(n <= km) { - g[n] = nbi(); - z.mulTo(g2,g[n-2],g[n]); - n += 2; - } -} +// Public API to check if length of added values is known +// https://github.com/form-data/form-data/issues/196 +// https://github.com/form-data/form-data/issues/262 +FormData.prototype.hasKnownLength = function() { + var hasKnownLength = true; -var j = e.t-1, w, is1 = true, r2 = nbi(), t; -i = nbits(e.data[j])-1; -while(j >= 0) { - if(i >= k1) w = (e.data[j]>>(i-k1))&km; - else { - w = (e.data[j]&((1<<(i+1))-1))<<(k1-i); - if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1); - } + if (this._valuesToMeasure.length) { + hasKnownLength = false; + } - n = k; - while((w&1) == 0) { w >>= 1; --n; } - if((i -= n) < 0) { i += this.DB; --j; } - if(is1) { // ret == 1, don't bother squaring or multiplying it - g[w].copyTo(r); - is1 = false; - } else { - while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; } - if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; } - z.mulTo(r2,g[w],r); - } + return hasKnownLength; +}; - while(j >= 0 && (e.data[j]&(1< 0) { - x.rShiftTo(g,x); - y.rShiftTo(g,y); -} -while(x.signum() > 0) { - if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x); - if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y); - if(x.compareTo(y) >= 0) { - x.subTo(y,x); - x.rShiftTo(1,x); - } else { - y.subTo(x,y); - y.rShiftTo(1,y); - } -} -if(g > 0) y.lShiftTo(g,y); -return y; -} + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } -//(protected) this % n, n < 2^26 -function bnpModInt(n) { -if(n <= 0) return 0; -var d = this.DV%n, r = (this.s<0)?n-1:0; -if(this.t > 0) - if(d == 0) r = this.data[0]%n; - else for(var i = this.t-1; i >= 0; --i) r = (d*r+this.data[i])%n; -return r; -} + if (!this._valuesToMeasure.length) { + process.nextTick(cb.bind(this, null, knownLength)); + return; + } -//(public) 1/this % m (HAC 14.61) -function bnModInverse(m) { -var ac = m.isEven(); -if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO; -var u = m.clone(), v = this.clone(); -var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1); -while(u.signum() != 0) { - while(u.isEven()) { - u.rShiftTo(1,u); - if(ac) { - if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); } - a.rShiftTo(1,a); - } else if(!b.isEven()) b.subTo(m,b); - b.rShiftTo(1,b); - } - while(v.isEven()) { - v.rShiftTo(1,v); - if(ac) { - if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); } - c.rShiftTo(1,c); - } else if(!d.isEven()) d.subTo(m,d); - d.rShiftTo(1,d); - } - if(u.compareTo(v) >= 0) { - u.subTo(v,u); - if(ac) a.subTo(c,a); - b.subTo(d,b); - } else { - v.subTo(u,v); - if(ac) c.subTo(a,c); - d.subTo(b,d); - } -} -if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO; -if(d.compareTo(m) >= 0) return d.subtract(m); -if(d.signum() < 0) d.addTo(m,d); else return d; -if(d.signum() < 0) return d.add(m); else return d; -} + asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { + if (err) { + cb(err); + return; + } -var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509]; -var lplim = (1<<26)/lowprimes[lowprimes.length-1]; + values.forEach(function(length) { + knownLength += length; + }); -//(public) test primality with certainty >= 1-.5^t -function bnIsProbablePrime(t) { -var i, x = this.abs(); -if(x.t == 1 && x.data[0] <= lowprimes[lowprimes.length-1]) { - for(i = 0; i < lowprimes.length; ++i) - if(x.data[0] == lowprimes[i]) return true; - return false; -} -if(x.isEven()) return false; -i = 1; -while(i < lowprimes.length) { - var m = lowprimes[i], j = i+1; - while(j < lowprimes.length && m < lplim) m *= lowprimes[j++]; - m = x.modInt(m); - while(i < j) if(m%lowprimes[i++] == 0) return false; -} -return x.millerRabin(t); -} + cb(null, knownLength); + }); +}; -//(protected) true if probably prime (HAC 4.24, Miller-Rabin) -function bnpMillerRabin(t) { -var n1 = this.subtract(BigInteger.ONE); -var k = n1.getLowestSetBit(); -if(k <= 0) return false; -var r = n1.shiftRight(k); -var prng = bnGetPrng(); -var a; -for(var i = 0; i < t; ++i) { - // select witness 'a' at random from between 1 and n1 - do { - a = new BigInteger(this.bitLength(), prng); - } - while(a.compareTo(BigInteger.ONE) <= 0 || a.compareTo(n1) >= 0); - var y = a.modPow(r,this); - if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) { - var j = 1; - while(j++ < k && y.compareTo(n1) != 0) { - y = y.modPowInt(2,this); - if(y.compareTo(BigInteger.ONE) == 0) return false; - } - if(y.compareTo(n1) != 0) return false; - } -} -return true; -} +FormData.prototype.submit = function(params, cb) { + var request + , options + , defaults = {method: 'post'} + ; -// get pseudo random number generator -function bnGetPrng() { - // create prng with api that matches BigInteger secure random - return { - // x is an array to fill with bytes - nextBytes: function(x) { - for(var i = 0; i < x.length; ++i) { - x[i] = Math.floor(Math.random() * 0x0100); - } + // parse provided url if it's string + // or treat it as options object + if (typeof params == 'string') { + + params = parseUrl(params); + options = populate({ + port: params.port, + path: params.pathname, + host: params.hostname, + protocol: params.protocol + }, defaults); + + // use custom params + } else { + + options = populate(params, defaults); + // if no port provided use default one + if (!options.port) { + options.port = options.protocol == 'https:' ? 443 : 80; } - }; -} + } -//protected -BigInteger.prototype.chunkSize = bnpChunkSize; -BigInteger.prototype.toRadix = bnpToRadix; -BigInteger.prototype.fromRadix = bnpFromRadix; -BigInteger.prototype.fromNumber = bnpFromNumber; -BigInteger.prototype.bitwiseTo = bnpBitwiseTo; -BigInteger.prototype.changeBit = bnpChangeBit; -BigInteger.prototype.addTo = bnpAddTo; -BigInteger.prototype.dMultiply = bnpDMultiply; -BigInteger.prototype.dAddOffset = bnpDAddOffset; -BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo; -BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo; -BigInteger.prototype.modInt = bnpModInt; -BigInteger.prototype.millerRabin = bnpMillerRabin; + // put that good code in getHeaders to some use + options.headers = this.getHeaders(params.headers); + + // https if specified, fallback to http in any other case + if (options.protocol == 'https:') { + request = https.request(options); + } else { + request = http.request(options); + } + + // get content length and fire away + this.getLength(function(err, length) { + if (err && err !== 'Unknown stream') { + this._error(err); + return; + } -//public -BigInteger.prototype.clone = bnClone; -BigInteger.prototype.intValue = bnIntValue; -BigInteger.prototype.byteValue = bnByteValue; -BigInteger.prototype.shortValue = bnShortValue; -BigInteger.prototype.signum = bnSigNum; -BigInteger.prototype.toByteArray = bnToByteArray; -BigInteger.prototype.equals = bnEquals; -BigInteger.prototype.min = bnMin; -BigInteger.prototype.max = bnMax; -BigInteger.prototype.and = bnAnd; -BigInteger.prototype.or = bnOr; -BigInteger.prototype.xor = bnXor; -BigInteger.prototype.andNot = bnAndNot; -BigInteger.prototype.not = bnNot; -BigInteger.prototype.shiftLeft = bnShiftLeft; -BigInteger.prototype.shiftRight = bnShiftRight; -BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit; -BigInteger.prototype.bitCount = bnBitCount; -BigInteger.prototype.testBit = bnTestBit; -BigInteger.prototype.setBit = bnSetBit; -BigInteger.prototype.clearBit = bnClearBit; -BigInteger.prototype.flipBit = bnFlipBit; -BigInteger.prototype.add = bnAdd; -BigInteger.prototype.subtract = bnSubtract; -BigInteger.prototype.multiply = bnMultiply; -BigInteger.prototype.divide = bnDivide; -BigInteger.prototype.remainder = bnRemainder; -BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder; -BigInteger.prototype.modPow = bnModPow; -BigInteger.prototype.modInverse = bnModInverse; -BigInteger.prototype.pow = bnPow; -BigInteger.prototype.gcd = bnGCD; -BigInteger.prototype.isProbablePrime = bnIsProbablePrime; + // add content length + if (length) { + request.setHeader('Content-Length', length); + } -//BigInteger interfaces not implemented in jsbn: + this.pipe(request); + if (cb) { + var onResponse; -//BigInteger(int signum, byte[] magnitude) -//double doubleValue() -//float floatValue() -//int hashCode() -//long longValue() -//static BigInteger valueOf(long val) + var callback = function (error, responce) { + request.removeListener('error', callback); + request.removeListener('response', onResponse); + return cb.call(this, error, responce); + }; -/***/ }), + onResponse = callback.bind(this, null); -<<<<<<< HEAD -/***/ 2439: -======= -/***/ 80554: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + request.on('error', callback); + request.on('response', onResponse); + } + }.bind(this)); -/** - * Node.js module for Forge message digests. - * - * @author Dave Longley - * - * Copyright 2011-2017 Digital Bazaar, Inc. - */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -======= -var forge = __nccwpck_require__(96630); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + return request; +}; -module.exports = forge.md = forge.md || {}; -forge.md.algorithms = forge.md.algorithms || {}; +FormData.prototype._error = function(err) { + if (!this.error) { + this.error = err; + this.pause(); + this.emit('error', err); + } +}; + +FormData.prototype.toString = function () { + return '[object FormData]'; +}; /***/ }), -<<<<<<< HEAD -/***/ 40876: -======= -/***/ 11750: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 44621: +/***/ ((module) => { -/** - * Object IDs for ASN.1. - * - * @author Dave Longley - * - * Copyright (c) 2010-2013 Digital Bazaar, Inc. - */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -======= -var forge = __nccwpck_require__(96630); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +// populates missing values +module.exports = function(dst, src) { -forge.pki = forge.pki || {}; -var oids = module.exports = forge.pki.oids = forge.oids = forge.oids || {}; + Object.keys(src).forEach(function(prop) + { + dst[prop] = dst[prop] || src[prop]; + }); -// set id to name mapping and name to id mapping -function _IN(id, name) { - oids[id] = name; - oids[name] = id; -} -// set id to name mapping only -function _I_(id, name) { - oids[id] = name; -} + return dst; +}; -// algorithm OIDs -_IN('1.2.840.113549.1.1.1', 'rsaEncryption'); -// Note: md2 & md4 not implemented -//_IN('1.2.840.113549.1.1.2', 'md2WithRSAEncryption'); -//_IN('1.2.840.113549.1.1.3', 'md4WithRSAEncryption'); -_IN('1.2.840.113549.1.1.4', 'md5WithRSAEncryption'); -_IN('1.2.840.113549.1.1.5', 'sha1WithRSAEncryption'); -_IN('1.2.840.113549.1.1.7', 'RSAES-OAEP'); -_IN('1.2.840.113549.1.1.8', 'mgf1'); -_IN('1.2.840.113549.1.1.9', 'pSpecified'); -_IN('1.2.840.113549.1.1.10', 'RSASSA-PSS'); -_IN('1.2.840.113549.1.1.11', 'sha256WithRSAEncryption'); -_IN('1.2.840.113549.1.1.12', 'sha384WithRSAEncryption'); -_IN('1.2.840.113549.1.1.13', 'sha512WithRSAEncryption'); -// Edwards-curve Digital Signature Algorithm (EdDSA) Ed25519 -_IN('1.3.101.112', 'EdDSA25519'); -_IN('1.2.840.10040.4.3', 'dsa-with-sha1'); +/***/ }), -_IN('1.3.14.3.2.7', 'desCBC'); +/***/ 2914: +/***/ ((module) => { -_IN('1.3.14.3.2.26', 'sha1'); -// Deprecated equivalent of sha1WithRSAEncryption -_IN('1.3.14.3.2.29', 'sha1WithRSASignature'); -_IN('2.16.840.1.101.3.4.2.1', 'sha256'); -_IN('2.16.840.1.101.3.4.2.2', 'sha384'); -_IN('2.16.840.1.101.3.4.2.3', 'sha512'); -_IN('2.16.840.1.101.3.4.2.4', 'sha224'); -_IN('2.16.840.1.101.3.4.2.5', 'sha512-224'); -_IN('2.16.840.1.101.3.4.2.6', 'sha512-256'); -_IN('1.2.840.113549.2.2', 'md2'); -_IN('1.2.840.113549.2.5', 'md5'); +// If the passed object is an (async) iterable, then get the iterator +// If it's probably an iterator already (i.e. has next function) return it +// else throw +module.exports = function getIterator (obj) { + if (obj) { + if (typeof obj[Symbol.iterator] === 'function') { + return obj[Symbol.iterator]() + } + if (typeof obj[Symbol.asyncIterator] === 'function') { + return obj[Symbol.asyncIterator]() + } + if (typeof obj.next === 'function') { + return obj // probably an iterator + } + } + throw new Error('argument is not an iterator or iterable') +} -// pkcs#7 content types -_IN('1.2.840.113549.1.7.1', 'data'); -_IN('1.2.840.113549.1.7.2', 'signedData'); -_IN('1.2.840.113549.1.7.3', 'envelopedData'); -_IN('1.2.840.113549.1.7.4', 'signedAndEnvelopedData'); -_IN('1.2.840.113549.1.7.5', 'digestedData'); -_IN('1.2.840.113549.1.7.6', 'encryptedData'); -// pkcs#9 oids -_IN('1.2.840.113549.1.9.1', 'emailAddress'); -_IN('1.2.840.113549.1.9.2', 'unstructuredName'); -_IN('1.2.840.113549.1.9.3', 'contentType'); -_IN('1.2.840.113549.1.9.4', 'messageDigest'); -_IN('1.2.840.113549.1.9.5', 'signingTime'); -_IN('1.2.840.113549.1.9.6', 'counterSignature'); -_IN('1.2.840.113549.1.9.7', 'challengePassword'); -_IN('1.2.840.113549.1.9.8', 'unstructuredAddress'); -_IN('1.2.840.113549.1.9.14', 'extensionRequest'); +/***/ }), -_IN('1.2.840.113549.1.9.20', 'friendlyName'); -_IN('1.2.840.113549.1.9.21', 'localKeyId'); -_IN('1.2.840.113549.1.9.22.1', 'x509Certificate'); +/***/ 30745: +/***/ ((module) => { -// pkcs#12 safe bags -_IN('1.2.840.113549.1.12.10.1.1', 'keyBag'); -_IN('1.2.840.113549.1.12.10.1.2', 'pkcs8ShroudedKeyBag'); -_IN('1.2.840.113549.1.12.10.1.3', 'certBag'); -_IN('1.2.840.113549.1.12.10.1.4', 'crlBag'); -_IN('1.2.840.113549.1.12.10.1.5', 'secretBag'); -_IN('1.2.840.113549.1.12.10.1.6', 'safeContentsBag'); -// password-based-encryption for pkcs#12 -_IN('1.2.840.113549.1.5.13', 'pkcs5PBES2'); -_IN('1.2.840.113549.1.5.12', 'pkcs5PBKDF2'); -_IN('1.2.840.113549.1.12.1.1', 'pbeWithSHAAnd128BitRC4'); -_IN('1.2.840.113549.1.12.1.2', 'pbeWithSHAAnd40BitRC4'); -_IN('1.2.840.113549.1.12.1.3', 'pbeWithSHAAnd3-KeyTripleDES-CBC'); -_IN('1.2.840.113549.1.12.1.4', 'pbeWithSHAAnd2-KeyTripleDES-CBC'); -_IN('1.2.840.113549.1.12.1.5', 'pbeWithSHAAnd128BitRC2-CBC'); -_IN('1.2.840.113549.1.12.1.6', 'pbewithSHAAnd40BitRC2-CBC'); +module.exports = clone -// hmac OIDs -_IN('1.2.840.113549.2.7', 'hmacWithSHA1'); -_IN('1.2.840.113549.2.8', 'hmacWithSHA224'); -_IN('1.2.840.113549.2.9', 'hmacWithSHA256'); -_IN('1.2.840.113549.2.10', 'hmacWithSHA384'); -_IN('1.2.840.113549.2.11', 'hmacWithSHA512'); +var getPrototypeOf = Object.getPrototypeOf || function (obj) { + return obj.__proto__ +} -// symmetric key algorithm oids -_IN('1.2.840.113549.3.7', 'des-EDE3-CBC'); -_IN('2.16.840.1.101.3.4.1.2', 'aes128-CBC'); -_IN('2.16.840.1.101.3.4.1.22', 'aes192-CBC'); -_IN('2.16.840.1.101.3.4.1.42', 'aes256-CBC'); +function clone (obj) { + if (obj === null || typeof obj !== 'object') + return obj -// certificate issuer/subject OIDs -_IN('2.5.4.3', 'commonName'); -_IN('2.5.4.4', 'surname'); -_IN('2.5.4.5', 'serialNumber'); -_IN('2.5.4.6', 'countryName'); -_IN('2.5.4.7', 'localityName'); -_IN('2.5.4.8', 'stateOrProvinceName'); -_IN('2.5.4.9', 'streetAddress'); -_IN('2.5.4.10', 'organizationName'); -_IN('2.5.4.11', 'organizationalUnitName'); -_IN('2.5.4.12', 'title'); -_IN('2.5.4.13', 'description'); -_IN('2.5.4.15', 'businessCategory'); -_IN('2.5.4.17', 'postalCode'); -_IN('2.5.4.42', 'givenName'); -_IN('1.3.6.1.4.1.311.60.2.1.2', 'jurisdictionOfIncorporationStateOrProvinceName'); -_IN('1.3.6.1.4.1.311.60.2.1.3', 'jurisdictionOfIncorporationCountryName'); + if (obj instanceof Object) + var copy = { __proto__: getPrototypeOf(obj) } + else + var copy = Object.create(null) -// X.509 extension OIDs -_IN('2.16.840.1.113730.1.1', 'nsCertType'); -_IN('2.16.840.1.113730.1.13', 'nsComment'); // deprecated in theory; still widely used -_I_('2.5.29.1', 'authorityKeyIdentifier'); // deprecated, use .35 -_I_('2.5.29.2', 'keyAttributes'); // obsolete use .37 or .15 -_I_('2.5.29.3', 'certificatePolicies'); // deprecated, use .32 -_I_('2.5.29.4', 'keyUsageRestriction'); // obsolete use .37 or .15 -_I_('2.5.29.5', 'policyMapping'); // deprecated use .33 -_I_('2.5.29.6', 'subtreesConstraint'); // obsolete use .30 -_I_('2.5.29.7', 'subjectAltName'); // deprecated use .17 -_I_('2.5.29.8', 'issuerAltName'); // deprecated use .18 -_I_('2.5.29.9', 'subjectDirectoryAttributes'); -_I_('2.5.29.10', 'basicConstraints'); // deprecated use .19 -_I_('2.5.29.11', 'nameConstraints'); // deprecated use .30 -_I_('2.5.29.12', 'policyConstraints'); // deprecated use .36 -_I_('2.5.29.13', 'basicConstraints'); // deprecated use .19 -_IN('2.5.29.14', 'subjectKeyIdentifier'); -_IN('2.5.29.15', 'keyUsage'); -_I_('2.5.29.16', 'privateKeyUsagePeriod'); -_IN('2.5.29.17', 'subjectAltName'); -_IN('2.5.29.18', 'issuerAltName'); -_IN('2.5.29.19', 'basicConstraints'); -_I_('2.5.29.20', 'cRLNumber'); -_I_('2.5.29.21', 'cRLReason'); -_I_('2.5.29.22', 'expirationDate'); -_I_('2.5.29.23', 'instructionCode'); -_I_('2.5.29.24', 'invalidityDate'); -_I_('2.5.29.25', 'cRLDistributionPoints'); // deprecated use .31 -_I_('2.5.29.26', 'issuingDistributionPoint'); // deprecated use .28 -_I_('2.5.29.27', 'deltaCRLIndicator'); -_I_('2.5.29.28', 'issuingDistributionPoint'); -_I_('2.5.29.29', 'certificateIssuer'); -_I_('2.5.29.30', 'nameConstraints'); -_IN('2.5.29.31', 'cRLDistributionPoints'); -_IN('2.5.29.32', 'certificatePolicies'); -_I_('2.5.29.33', 'policyMappings'); -_I_('2.5.29.34', 'policyConstraints'); // deprecated use .36 -_IN('2.5.29.35', 'authorityKeyIdentifier'); -_I_('2.5.29.36', 'policyConstraints'); -_IN('2.5.29.37', 'extKeyUsage'); -_I_('2.5.29.46', 'freshestCRL'); -_I_('2.5.29.54', 'inhibitAnyPolicy'); + Object.getOwnPropertyNames(obj).forEach(function (key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) + }) -// extKeyUsage purposes -_IN('1.3.6.1.4.1.11129.2.4.2', 'timestampList'); -_IN('1.3.6.1.5.5.7.1.1', 'authorityInfoAccess'); -_IN('1.3.6.1.5.5.7.3.1', 'serverAuth'); -_IN('1.3.6.1.5.5.7.3.2', 'clientAuth'); -_IN('1.3.6.1.5.5.7.3.3', 'codeSigning'); -_IN('1.3.6.1.5.5.7.3.4', 'emailProtection'); -_IN('1.3.6.1.5.5.7.3.8', 'timeStamping'); + return copy +} /***/ }), -<<<<<<< HEAD -/***/ 60075: -======= -/***/ 87861: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 7261: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Password-based encryption functions. - * - * @author Dave Longley - * @author Stefan Siegl - * - * Copyright (c) 2010-2013 Digital Bazaar, Inc. - * Copyright (c) 2012 Stefan Siegl - * - * An EncryptedPrivateKeyInfo: - * - * EncryptedPrivateKeyInfo ::= SEQUENCE { - * encryptionAlgorithm EncryptionAlgorithmIdentifier, - * encryptedData EncryptedData } - * - * EncryptionAlgorithmIdentifier ::= AlgorithmIdentifier - * - * EncryptedData ::= OCTET STRING - */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -__nccwpck_require__(25706); -__nccwpck_require__(1571); -__nccwpck_require__(53436); -__nccwpck_require__(2439); -__nccwpck_require__(40876); -__nccwpck_require__(90577); -__nccwpck_require__(44214); -__nccwpck_require__(35283); -__nccwpck_require__(21828); -__nccwpck_require__(62646); -__nccwpck_require__(19239); -======= -var forge = __nccwpck_require__(96630); -__nccwpck_require__(16606); -__nccwpck_require__(69197); -__nccwpck_require__(16855); -__nccwpck_require__(80554); -__nccwpck_require__(11750); -__nccwpck_require__(84418); -__nccwpck_require__(57334); -__nccwpck_require__(68737); -__nccwpck_require__(87938); -__nccwpck_require__(79626); -__nccwpck_require__(36536); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var fs = __nccwpck_require__(57147) +var polyfills = __nccwpck_require__(40264) +var legacy = __nccwpck_require__(94757) +var clone = __nccwpck_require__(30745) -if(typeof BigInteger === 'undefined') { - var BigInteger = forge.jsbn.BigInteger; +var util = __nccwpck_require__(73837) + +/* istanbul ignore next - node 0.x polyfill */ +var gracefulQueue +var previousSymbol + +/* istanbul ignore else - node 0.x polyfill */ +if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { + gracefulQueue = Symbol.for('graceful-fs.queue') + // This is used in testing by future versions + previousSymbol = Symbol.for('graceful-fs.previous') +} else { + gracefulQueue = '___graceful-fs.queue' + previousSymbol = '___graceful-fs.previous' } -// shortcut for asn.1 API -var asn1 = forge.asn1; +function noop () {} -/* Password-based encryption implementation. */ -var pki = forge.pki = forge.pki || {}; -module.exports = pki.pbe = forge.pbe = forge.pbe || {}; -var oids = pki.oids; +function publishQueue(context, queue) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue + } + }) +} -// validator for an EncryptedPrivateKeyInfo structure -// Note: Currently only works w/algorithm params -var encryptedPrivateKeyValidator = { - name: 'EncryptedPrivateKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'EncryptedPrivateKeyInfo.encryptionAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'AlgorithmIdentifier.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'encryptionOid' - }, { - name: 'AlgorithmIdentifier.parameters', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'encryptionParams' - }] - }, { - // encryptedData - name: 'EncryptedPrivateKeyInfo.encryptedData', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'encryptedData' - }] -}; +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs4') +else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') + console.error(m) + } -// validator for a PBES2Algorithms structure -// Note: Currently only works w/PBKDF2 + AES encryption schemes -var PBES2AlgorithmsValidator = { - name: 'PBES2Algorithms', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'PBES2Algorithms.keyDerivationFunc', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'PBES2Algorithms.keyDerivationFunc.oid', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'kdfOid' - }, { - name: 'PBES2Algorithms.params', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'PBES2Algorithms.params.salt', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'kdfSalt' - }, { - name: 'PBES2Algorithms.params.iterationCount', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'kdfIterationCount' - }, { - name: 'PBES2Algorithms.params.keyLength', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - optional: true, - capture: 'keyLength' - }, { - // prf - name: 'PBES2Algorithms.params.prf', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - optional: true, - value: [{ - name: 'PBES2Algorithms.params.prf.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'prfOid' - }] - }] - }] - }, { - name: 'PBES2Algorithms.encryptionScheme', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'PBES2Algorithms.encryptionScheme.oid', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'encOid' - }, { - name: 'PBES2Algorithms.encryptionScheme.iv', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'encIv' - }] - }] -}; +// Once time initialization +if (!fs[gracefulQueue]) { + // This queue can be shared by multiple loaded instances + var queue = global[gracefulQueue] || [] + publishQueue(fs, queue) -var pkcs12PbeParamsValidator = { - name: 'pkcs-12PbeParams', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'pkcs-12PbeParams.salt', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'salt' - }, { - name: 'pkcs-12PbeParams.iterations', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'iterations' - }] -}; + // Patch fs.close/closeSync to shared queue version, because we need + // to retry() whenever a close happens *anywhere* in the program. + // This is essential when multiple graceful-fs instances are + // in play at the same time. + fs.close = (function (fs$close) { + function close (fd, cb) { + return fs$close.call(fs, fd, function (err) { + // This function uses the graceful-fs shared queue + if (!err) { + resetQueue() + } -/** - * Encrypts a ASN.1 PrivateKeyInfo object, producing an EncryptedPrivateKeyInfo. - * - * PBES2Algorithms ALGORITHM-IDENTIFIER ::= - * { {PBES2-params IDENTIFIED BY id-PBES2}, ...} - * - * id-PBES2 OBJECT IDENTIFIER ::= {pkcs-5 13} - * - * PBES2-params ::= SEQUENCE { - * keyDerivationFunc AlgorithmIdentifier {{PBES2-KDFs}}, - * encryptionScheme AlgorithmIdentifier {{PBES2-Encs}} - * } - * - * PBES2-KDFs ALGORITHM-IDENTIFIER ::= - * { {PBKDF2-params IDENTIFIED BY id-PBKDF2}, ... } - * - * PBES2-Encs ALGORITHM-IDENTIFIER ::= { ... } - * - * PBKDF2-params ::= SEQUENCE { - * salt CHOICE { - * specified OCTET STRING, - * otherSource AlgorithmIdentifier {{PBKDF2-SaltSources}} - * }, - * iterationCount INTEGER (1..MAX), - * keyLength INTEGER (1..MAX) OPTIONAL, - * prf AlgorithmIdentifier {{PBKDF2-PRFs}} DEFAULT algid-hmacWithSHA1 - * } - * - * @param obj the ASN.1 PrivateKeyInfo object. - * @param password the password to encrypt with. - * @param options: - * algorithm the encryption algorithm to use - * ('aes128', 'aes192', 'aes256', '3des'), defaults to 'aes128'. - * count the iteration count to use. - * saltSize the salt size to use. - * prfAlgorithm the PRF message digest algorithm to use - * ('sha1', 'sha224', 'sha256', 'sha384', 'sha512') - * - * @return the ASN.1 EncryptedPrivateKeyInfo. - */ -pki.encryptPrivateKeyInfo = function(obj, password, options) { - // set default options - options = options || {}; - options.saltSize = options.saltSize || 8; - options.count = options.count || 2048; - options.algorithm = options.algorithm || 'aes128'; - options.prfAlgorithm = options.prfAlgorithm || 'sha1'; + if (typeof cb === 'function') + cb.apply(this, arguments) + }) + } - // generate PBE params - var salt = forge.random.getBytesSync(options.saltSize); - var count = options.count; - var countBytes = asn1.integerToDer(count); - var dkLen; - var encryptionAlgorithm; - var encryptedData; - if(options.algorithm.indexOf('aes') === 0 || options.algorithm === 'des') { - // do PBES2 - var ivLen, encOid, cipherFn; - switch(options.algorithm) { - case 'aes128': - dkLen = 16; - ivLen = 16; - encOid = oids['aes128-CBC']; - cipherFn = forge.aes.createEncryptionCipher; - break; - case 'aes192': - dkLen = 24; - ivLen = 16; - encOid = oids['aes192-CBC']; - cipherFn = forge.aes.createEncryptionCipher; - break; - case 'aes256': - dkLen = 32; - ivLen = 16; - encOid = oids['aes256-CBC']; - cipherFn = forge.aes.createEncryptionCipher; - break; - case 'des': - dkLen = 8; - ivLen = 8; - encOid = oids['desCBC']; - cipherFn = forge.des.createEncryptionCipher; - break; - default: - var error = new Error('Cannot encrypt private key. Unknown encryption algorithm.'); - error.algorithm = options.algorithm; - throw error; + Object.defineProperty(close, previousSymbol, { + value: fs$close + }) + return close + })(fs.close) + + fs.closeSync = (function (fs$closeSync) { + function closeSync (fd) { + // This function uses the graceful-fs shared queue + fs$closeSync.apply(fs, arguments) + resetQueue() } - // get PRF message digest - var prfAlgorithm = 'hmacWith' + options.prfAlgorithm.toUpperCase(); - var md = prfAlgorithmToMessageDigest(prfAlgorithm); + Object.defineProperty(closeSync, previousSymbol, { + value: fs$closeSync + }) + return closeSync + })(fs.closeSync) - // encrypt private key using pbe SHA-1 and AES/DES - var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md); - var iv = forge.random.getBytesSync(ivLen); - var cipher = cipherFn(dk); - cipher.start(iv); - cipher.update(asn1.toDer(obj)); - cipher.finish(); - encryptedData = cipher.output.getBytes(); + if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug(fs[gracefulQueue]) + __nccwpck_require__(39491).equal(fs[gracefulQueue].length, 0) + }) + } +} - // get PBKDF2-params - var params = createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm); +if (!global[gracefulQueue]) { + publishQueue(global, fs[gracefulQueue]); +} - encryptionAlgorithm = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(oids['pkcs5PBES2']).getBytes()), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // keyDerivationFunc - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(oids['pkcs5PBKDF2']).getBytes()), - // PBKDF2-params - params - ]), - // encryptionScheme - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(encOid).getBytes()), - // iv - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, iv) - ]) - ]) - ]); - } else if(options.algorithm === '3des') { - // Do PKCS12 PBE - dkLen = 24; +module.exports = patch(clone(fs)) +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { + module.exports = patch(fs) + fs.__patched = true; +} - var saltBytes = new forge.util.ByteBuffer(salt); - var dk = pki.pbe.generatePkcs12Key(password, saltBytes, 1, count, dkLen); - var iv = pki.pbe.generatePkcs12Key(password, saltBytes, 2, count, dkLen); - var cipher = forge.des.createEncryptionCipher(dk); - cipher.start(iv); - cipher.update(asn1.toDer(obj)); - cipher.finish(); - encryptedData = cipher.output.getBytes(); +function patch (fs) { + // Everything that references the open() function needs to be in here + polyfills(fs) + fs.gracefulify = patch - encryptionAlgorithm = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(oids['pbeWithSHAAnd3-KeyTripleDES-CBC']).getBytes()), - // pkcs-12PbeParams - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // salt - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, salt), - // iteration count - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - countBytes.getBytes()) - ]) - ]); - } else { - var error = new Error('Cannot encrypt private key. Unknown encryption algorithm.'); - error.algorithm = options.algorithm; - throw error; + fs.createReadStream = createReadStream + fs.createWriteStream = createWriteStream + var fs$readFile = fs.readFile + fs.readFile = readFile + function readFile (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readFile(path, options, cb) + + function go$readFile (path, options, cb, startTime) { + return fs$readFile(path, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } } - // EncryptedPrivateKeyInfo - var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // encryptionAlgorithm - encryptionAlgorithm, - // encryptedData - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, encryptedData) - ]); - return rval; -}; + var fs$writeFile = fs.writeFile + fs.writeFile = writeFile + function writeFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null -/** - * Decrypts a ASN.1 PrivateKeyInfo object. - * - * @param obj the ASN.1 EncryptedPrivateKeyInfo object. - * @param password the password to decrypt with. - * - * @return the ASN.1 PrivateKeyInfo on success, null on failure. - */ -pki.decryptPrivateKeyInfo = function(obj, password) { - var rval = null; + return go$writeFile(path, data, options, cb) - // get PBE params - var capture = {}; - var errors = []; - if(!asn1.validate(obj, encryptedPrivateKeyValidator, capture, errors)) { - var error = new Error('Cannot read encrypted private key. ' + - 'ASN.1 object is not a supported EncryptedPrivateKeyInfo.'); - error.errors = errors; - throw error; + function go$writeFile (path, data, options, cb, startTime) { + return fs$writeFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } } - // get cipher - var oid = asn1.derToOid(capture.encryptionOid); - var cipher = pki.pbe.getCipher(oid, capture.encryptionParams, password); + var fs$appendFile = fs.appendFile + if (fs$appendFile) + fs.appendFile = appendFile + function appendFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null - // get encrypted data - var encrypted = forge.util.createBuffer(capture.encryptedData); + return go$appendFile(path, data, options, cb) - cipher.update(encrypted); - if(cipher.finish()) { - rval = asn1.fromDer(cipher.output); + function go$appendFile (path, data, options, cb, startTime) { + return fs$appendFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } } - return rval; -}; + var fs$copyFile = fs.copyFile + if (fs$copyFile) + fs.copyFile = copyFile + function copyFile (src, dest, flags, cb) { + if (typeof flags === 'function') { + cb = flags + flags = 0 + } + return go$copyFile(src, dest, flags, cb) -/** - * Converts a EncryptedPrivateKeyInfo to PEM format. - * - * @param epki the EncryptedPrivateKeyInfo. - * @param maxline the maximum characters per line, defaults to 64. - * - * @return the PEM-formatted encrypted private key. - */ -pki.encryptedPrivateKeyToPem = function(epki, maxline) { - // convert to DER, then PEM-encode - var msg = { - type: 'ENCRYPTED PRIVATE KEY', - body: asn1.toDer(epki).getBytes() - }; - return forge.pem.encode(msg, {maxline: maxline}); -}; + function go$copyFile (src, dest, flags, cb, startTime) { + return fs$copyFile(src, dest, flags, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } -/** - * Converts a PEM-encoded EncryptedPrivateKeyInfo to ASN.1 format. Decryption - * is not performed. - * - * @param pem the EncryptedPrivateKeyInfo in PEM-format. - * - * @return the ASN.1 EncryptedPrivateKeyInfo. - */ -pki.encryptedPrivateKeyFromPem = function(pem) { - var msg = forge.pem.decode(pem)[0]; + var fs$readdir = fs.readdir + fs.readdir = readdir + var noReaddirOptionVersions = /^v[0-5]\./ + function readdir (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null - if(msg.type !== 'ENCRYPTED PRIVATE KEY') { - var error = new Error('Could not convert encrypted private key from PEM; ' + - 'PEM header type is "ENCRYPTED PRIVATE KEY".'); - error.headerType = msg.type; - throw error; + var go$readdir = noReaddirOptionVersions.test(process.version) + ? function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, fs$readdirCallback( + path, options, cb, startTime + )) + } + : function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, options, fs$readdirCallback( + path, options, cb, startTime + )) + } + + return go$readdir(path, options, cb) + + function fs$readdirCallback (path, options, cb, startTime) { + return function (err, files) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([ + go$readdir, + [path, options, cb], + err, + startTime || Date.now(), + Date.now() + ]) + else { + if (files && files.sort) + files.sort() + + if (typeof cb === 'function') + cb.call(this, err, files) + } + } + } } - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - throw new Error('Could not convert encrypted private key from PEM; ' + - 'PEM is encrypted.'); + + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs) + ReadStream = legStreams.ReadStream + WriteStream = legStreams.WriteStream } - // convert DER to ASN.1 object - return asn1.fromDer(msg.body); -}; + var fs$ReadStream = fs.ReadStream + if (fs$ReadStream) { + ReadStream.prototype = Object.create(fs$ReadStream.prototype) + ReadStream.prototype.open = ReadStream$open + } -/** - * Encrypts an RSA private key. By default, the key will be wrapped in - * a PrivateKeyInfo and encrypted to produce a PKCS#8 EncryptedPrivateKeyInfo. - * This is the standard, preferred way to encrypt a private key. - * - * To produce a non-standard PEM-encrypted private key that uses encapsulated - * headers to indicate the encryption algorithm (old-style non-PKCS#8 OpenSSL - * private key encryption), set the 'legacy' option to true. Note: Using this - * option will cause the iteration count to be forced to 1. - * - * Note: The 'des' algorithm is supported, but it is not considered to be - * secure because it only uses a single 56-bit key. If possible, it is highly - * recommended that a different algorithm be used. - * - * @param rsaKey the RSA key to encrypt. - * @param password the password to use. - * @param options: - * algorithm: the encryption algorithm to use - * ('aes128', 'aes192', 'aes256', '3des', 'des'). - * count: the iteration count to use. - * saltSize: the salt size to use. - * legacy: output an old non-PKCS#8 PEM-encrypted+encapsulated - * headers (DEK-Info) private key. - * - * @return the PEM-encoded ASN.1 EncryptedPrivateKeyInfo. - */ -pki.encryptRsaPrivateKey = function(rsaKey, password, options) { - // standard PKCS#8 - options = options || {}; - if(!options.legacy) { - // encrypt PrivateKeyInfo - var rval = pki.wrapRsaPrivateKey(pki.privateKeyToAsn1(rsaKey)); - rval = pki.encryptPrivateKeyInfo(rval, password, options); - return pki.encryptedPrivateKeyToPem(rval); + var fs$WriteStream = fs.WriteStream + if (fs$WriteStream) { + WriteStream.prototype = Object.create(fs$WriteStream.prototype) + WriteStream.prototype.open = WriteStream$open } - // legacy non-PKCS#8 - var algorithm; - var iv; - var dkLen; - var cipherFn; - switch(options.algorithm) { - case 'aes128': - algorithm = 'AES-128-CBC'; - dkLen = 16; - iv = forge.random.getBytesSync(16); - cipherFn = forge.aes.createEncryptionCipher; - break; - case 'aes192': - algorithm = 'AES-192-CBC'; - dkLen = 24; - iv = forge.random.getBytesSync(16); - cipherFn = forge.aes.createEncryptionCipher; - break; - case 'aes256': - algorithm = 'AES-256-CBC'; - dkLen = 32; - iv = forge.random.getBytesSync(16); - cipherFn = forge.aes.createEncryptionCipher; - break; - case '3des': - algorithm = 'DES-EDE3-CBC'; - dkLen = 24; - iv = forge.random.getBytesSync(8); - cipherFn = forge.des.createEncryptionCipher; - break; - case 'des': - algorithm = 'DES-CBC'; - dkLen = 8; - iv = forge.random.getBytesSync(8); - cipherFn = forge.des.createEncryptionCipher; - break; - default: - var error = new Error('Could not encrypt RSA private key; unsupported ' + - 'encryption algorithm "' + options.algorithm + '".'); - error.algorithm = options.algorithm; - throw error; + Object.defineProperty(fs, 'ReadStream', { + get: function () { + return ReadStream + }, + set: function (val) { + ReadStream = val + }, + enumerable: true, + configurable: true + }) + Object.defineProperty(fs, 'WriteStream', { + get: function () { + return WriteStream + }, + set: function (val) { + WriteStream = val + }, + enumerable: true, + configurable: true + }) + + // legacy names + var FileReadStream = ReadStream + Object.defineProperty(fs, 'FileReadStream', { + get: function () { + return FileReadStream + }, + set: function (val) { + FileReadStream = val + }, + enumerable: true, + configurable: true + }) + var FileWriteStream = WriteStream + Object.defineProperty(fs, 'FileWriteStream', { + get: function () { + return FileWriteStream + }, + set: function (val) { + FileWriteStream = val + }, + enumerable: true, + configurable: true + }) + + function ReadStream (path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments) + } + + function ReadStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + if (that.autoClose) + that.destroy() + + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + that.read() + } + }) + } + + function WriteStream (path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments) } - // encrypt private key using OpenSSL legacy key derivation - var dk = forge.pbe.opensslDeriveBytes(password, iv.substr(0, 8), dkLen); - var cipher = cipherFn(dk); - cipher.start(iv); - cipher.update(asn1.toDer(pki.privateKeyToAsn1(rsaKey))); - cipher.finish(); + function WriteStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + that.destroy() + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + } + }) + } - var msg = { - type: 'RSA PRIVATE KEY', - procType: { - version: '4', - type: 'ENCRYPTED' - }, - dekInfo: { - algorithm: algorithm, - parameters: forge.util.bytesToHex(iv).toUpperCase() - }, - body: cipher.output.getBytes() - }; - return forge.pem.encode(msg); -}; + function createReadStream (path, options) { + return new fs.ReadStream(path, options) + } -/** - * Decrypts an RSA private key. - * - * @param pem the PEM-formatted EncryptedPrivateKeyInfo to decrypt. - * @param password the password to use. - * - * @return the RSA key on success, null on failure. - */ -pki.decryptRsaPrivateKey = function(pem, password) { - var rval = null; + function createWriteStream (path, options) { + return new fs.WriteStream(path, options) + } - var msg = forge.pem.decode(pem)[0]; + var fs$open = fs.open + fs.open = open + function open (path, flags, mode, cb) { + if (typeof mode === 'function') + cb = mode, mode = null - if(msg.type !== 'ENCRYPTED PRIVATE KEY' && - msg.type !== 'PRIVATE KEY' && - msg.type !== 'RSA PRIVATE KEY') { - var error = new Error('Could not convert private key from PEM; PEM header type ' + - 'is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".'); - error.headerType = error; - throw error; + return go$open(path, flags, mode, cb) + + function go$open (path, flags, mode, cb, startTime) { + return fs$open(path, flags, mode, function (err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } } - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - var dkLen; - var cipherFn; - switch(msg.dekInfo.algorithm) { - case 'DES-CBC': - dkLen = 8; - cipherFn = forge.des.createDecryptionCipher; - break; - case 'DES-EDE3-CBC': - dkLen = 24; - cipherFn = forge.des.createDecryptionCipher; - break; - case 'AES-128-CBC': - dkLen = 16; - cipherFn = forge.aes.createDecryptionCipher; - break; - case 'AES-192-CBC': - dkLen = 24; - cipherFn = forge.aes.createDecryptionCipher; - break; - case 'AES-256-CBC': - dkLen = 32; - cipherFn = forge.aes.createDecryptionCipher; - break; - case 'RC2-40-CBC': - dkLen = 5; - cipherFn = function(key) { - return forge.rc2.createDecryptionCipher(key, 40); - }; - break; - case 'RC2-64-CBC': - dkLen = 8; - cipherFn = function(key) { - return forge.rc2.createDecryptionCipher(key, 64); - }; - break; - case 'RC2-128-CBC': - dkLen = 16; - cipherFn = function(key) { - return forge.rc2.createDecryptionCipher(key, 128); - }; - break; - default: - var error = new Error('Could not decrypt private key; unsupported ' + - 'encryption algorithm "' + msg.dekInfo.algorithm + '".'); - error.algorithm = msg.dekInfo.algorithm; - throw error; + return fs +} + +function enqueue (elem) { + debug('ENQUEUE', elem[0].name, elem[1]) + fs[gracefulQueue].push(elem) + retry() +} + +// keep track of the timeout between retry() calls +var retryTimer + +// reset the startTime and lastTime to now +// this resets the start of the 60 second overall timeout as well as the +// delay between attempts so that we'll retry these jobs sooner +function resetQueue () { + var now = Date.now() + for (var i = 0; i < fs[gracefulQueue].length; ++i) { + // entries that are only a length of 2 are from an older version, don't + // bother modifying those since they'll be retried anyway. + if (fs[gracefulQueue][i].length > 2) { + fs[gracefulQueue][i][3] = now // startTime + fs[gracefulQueue][i][4] = now // lastTime } + } + // call retry to make sure we're actively processing the queue + retry() +} - // use OpenSSL legacy key derivation - var iv = forge.util.hexToBytes(msg.dekInfo.parameters); - var dk = forge.pbe.opensslDeriveBytes(password, iv.substr(0, 8), dkLen); - var cipher = cipherFn(dk); - cipher.start(iv); - cipher.update(forge.util.createBuffer(msg.body)); - if(cipher.finish()) { - rval = cipher.output.getBytes(); +function retry () { + // clear the timer and remove it to help prevent unintended concurrency + clearTimeout(retryTimer) + retryTimer = undefined + + if (fs[gracefulQueue].length === 0) + return + + var elem = fs[gracefulQueue].shift() + var fn = elem[0] + var args = elem[1] + // these items may be unset if they were added by an older graceful-fs + var err = elem[2] + var startTime = elem[3] + var lastTime = elem[4] + + // if we don't have a startTime we have no way of knowing if we've waited + // long enough, so go ahead and retry this item now + if (startTime === undefined) { + debug('RETRY', fn.name, args) + fn.apply(null, args) + } else if (Date.now() - startTime >= 60000) { + // it's been more than 60 seconds total, bail now + debug('TIMEOUT', fn.name, args) + var cb = args.pop() + if (typeof cb === 'function') + cb.call(null, err) + } else { + // the amount of time between the last attempt and right now + var sinceAttempt = Date.now() - lastTime + // the amount of time between when we first tried, and when we last tried + // rounded up to at least 1 + var sinceStart = Math.max(lastTime - startTime, 1) + // backoff. wait longer than the total time we've been retrying, but only + // up to a maximum of 100ms + var desiredDelay = Math.min(sinceStart * 1.2, 100) + // it's been long enough since the last retry, do it again + if (sinceAttempt >= desiredDelay) { + debug('RETRY', fn.name, args) + fn.apply(null, args.concat([startTime])) } else { - return rval; + // if we can't do this job yet, push it to the end of the queue + // and let the next iteration check again + fs[gracefulQueue].push(elem) } - } else { - rval = msg.body; } - if(msg.type === 'ENCRYPTED PRIVATE KEY') { - rval = pki.decryptPrivateKeyInfo(asn1.fromDer(rval), password); - } else { - // decryption already performed above - rval = asn1.fromDer(rval); + // schedule our next run if one isn't already scheduled + if (retryTimer === undefined) { + retryTimer = setTimeout(retry, 0) } +} - if(rval !== null) { - rval = pki.privateKeyFromAsn1(rval); + +/***/ }), + +/***/ 94757: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var Stream = (__nccwpck_require__(12781).Stream) + +module.exports = legacy + +function legacy (fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream } - return rval; -}; + function ReadStream (path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); -/** - * Derives a PKCS#12 key. - * - * @param password the password to derive the key material from, null or - * undefined for none. - * @param salt the salt, as a ByteBuffer, to use. - * @param id the PKCS#12 ID byte (1 = key material, 2 = IV, 3 = MAC). - * @param iter the iteration count. - * @param n the number of bytes to derive from the password. - * @param md the message digest to use, defaults to SHA-1. - * - * @return a ByteBuffer with the bytes derived from the password. - */ -pki.pbe.generatePkcs12Key = function(password, salt, id, iter, n, md) { - var j, l; + Stream.call(this); - if(typeof md === 'undefined' || md === null) { - if(!('sha1' in forge.md)) { - throw new Error('"sha1" hash algorithm unavailable.'); + var self = this; + + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; + + this.flags = 'r'; + this.mode = 438; /*=0666*/ + this.bufferSize = 64 * 1024; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; } - md = forge.md.sha1.create(); - } - var u = md.digestLength; - var v = md.blockLength; - var result = new forge.util.ByteBuffer(); + if (this.encoding) this.setEncoding(this.encoding); - /* Convert password to Unicode byte buffer + trailing 0-byte. */ - var passBuf = new forge.util.ByteBuffer(); - if(password !== null && password !== undefined) { - for(l = 0; l < password.length; l++) { - passBuf.putInt16(password.charCodeAt(l)); + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + + if (this.start > this.end) { + throw new Error('start must be <= end'); + } + + this.pos = this.start; } - passBuf.putInt16(0); - } - /* Length of salt and password in BYTES. */ - var p = passBuf.length(); - var s = salt.length(); + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } - /* 1. Construct a string, D (the "diversifier"), by concatenating - v copies of ID. */ - var D = new forge.util.ByteBuffer(); - D.fillWithByte(id, v); + fs.open(this.path, this.flags, this.mode, function (err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } - /* 2. Concatenate copies of the salt together to create a string S of length - v * ceil(s / v) bytes (the final copy of the salt may be trunacted - to create S). - Note that if the salt is the empty string, then so is S. */ - var Slen = v * Math.ceil(s / v); - var S = new forge.util.ByteBuffer(); - for(l = 0; l < Slen; l++) { - S.putByte(salt.at(l % s)); + self.fd = fd; + self.emit('open', fd); + self._read(); + }) } - /* 3. Concatenate copies of the password together to create a string P of - length v * ceil(p / v) bytes (the final copy of the password may be - truncated to create P). - Note that if the password is the empty string, then so is P. */ - var Plen = v * Math.ceil(p / v); - var P = new forge.util.ByteBuffer(); - for(l = 0; l < Plen; l++) { - P.putByte(passBuf.at(l % p)); - } + function WriteStream (path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); - /* 4. Set I=S||P to be the concatenation of S and P. */ - var I = S; - I.putBuffer(P); + Stream.call(this); - /* 5. Set c=ceil(n / u). */ - var c = Math.ceil(n / u); + this.path = path; + this.fd = null; + this.writable = true; - /* 6. For i=1, 2, ..., c, do the following: */ - for(var i = 1; i <= c; i++) { - /* a) Set Ai=H^r(D||I). (l.e. the rth hash of D||I, H(H(H(...H(D||I)))) */ - var buf = new forge.util.ByteBuffer(); - buf.putBytes(D.bytes()); - buf.putBytes(I.bytes()); - for(var round = 0; round < iter; round++) { - md.start(); - md.update(buf.getBytes()); - buf = md.digest(); - } + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; /*=0666*/ + this.bytesWritten = 0; - /* b) Concatenate copies of Ai to create a string B of length v bytes (the - final copy of Ai may be truncated to create B). */ - var B = new forge.util.ByteBuffer(); - for(l = 0; l < v; l++) { - B.putByte(buf.at(l % u)); + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; } - /* c) Treating I as a concatenation I0, I1, ..., Ik-1 of v-byte blocks, - where k=ceil(s / v) + ceil(p / v), modify I by setting - Ij=(Ij+B+1) mod 2v for each j. */ - var k = Math.ceil(s / v) + Math.ceil(p / v); - var Inew = new forge.util.ByteBuffer(); - for(j = 0; j < k; j++) { - var chunk = new forge.util.ByteBuffer(I.getBytes(v)); - var x = 0x1ff; - for(l = B.length() - 1; l >= 0; l--) { - x = x >> 8; - x += B.at(l) + chunk.at(l); - chunk.setAt(l, x & 0xff); + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); } - Inew.putBuffer(chunk); + if (this.start < 0) { + throw new Error('start must be >= zero'); + } + + this.pos = this.start; } - I = Inew; - /* Add Ai to A. */ - result.putBuffer(buf); + this.busy = false; + this._queue = []; + + if (this.fd === null) { + this._open = fs.open; + this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); + this.flush(); + } } +} - result.truncate(result.length() - n); - return result; -}; -/** - * Get new Forge cipher object instance. - * - * @param oid the OID (in string notation). - * @param params the ASN.1 params object. - * @param password the password to decrypt with. - * - * @return new cipher object instance. - */ -pki.pbe.getCipher = function(oid, params, password) { - switch(oid) { - case pki.oids['pkcs5PBES2']: - return pki.pbe.getCipherForPBES2(oid, params, password); +/***/ }), - case pki.oids['pbeWithSHAAnd3-KeyTripleDES-CBC']: - case pki.oids['pbewithSHAAnd40BitRC2-CBC']: - return pki.pbe.getCipherForPKCS12PBE(oid, params, password); +/***/ 40264: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - default: - var error = new Error('Cannot read encrypted PBE data block. Unsupported OID.'); - error.oid = oid; - error.supportedOids = [ - 'pkcs5PBES2', - 'pbeWithSHAAnd3-KeyTripleDES-CBC', - 'pbewithSHAAnd40BitRC2-CBC' - ]; - throw error; - } -}; +var constants = __nccwpck_require__(22057) -/** - * Get new Forge cipher object instance according to PBES2 params block. - * - * The returned cipher instance is already started using the IV - * from PBES2 parameter block. - * - * @param oid the PKCS#5 PBKDF2 OID (in string notation). - * @param params the ASN.1 PBES2-params object. - * @param password the password to decrypt with. - * - * @return new cipher object instance. - */ -pki.pbe.getCipherForPBES2 = function(oid, params, password) { - // get PBE params - var capture = {}; - var errors = []; - if(!asn1.validate(params, PBES2AlgorithmsValidator, capture, errors)) { - var error = new Error('Cannot read password-based-encryption algorithm ' + - 'parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.'); - error.errors = errors; - throw error; - } +var origCwd = process.cwd +var cwd = null - // check oids - oid = asn1.derToOid(capture.kdfOid); - if(oid !== pki.oids['pkcs5PBKDF2']) { - var error = new Error('Cannot read encrypted private key. ' + - 'Unsupported key derivation function OID.'); - error.oid = oid; - error.supportedOids = ['pkcs5PBKDF2']; - throw error; - } - oid = asn1.derToOid(capture.encOid); - if(oid !== pki.oids['aes128-CBC'] && - oid !== pki.oids['aes192-CBC'] && - oid !== pki.oids['aes256-CBC'] && - oid !== pki.oids['des-EDE3-CBC'] && - oid !== pki.oids['desCBC']) { - var error = new Error('Cannot read encrypted private key. ' + - 'Unsupported encryption scheme OID.'); - error.oid = oid; - error.supportedOids = [ - 'aes128-CBC', 'aes192-CBC', 'aes256-CBC', 'des-EDE3-CBC', 'desCBC']; - throw error; - } +var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform - // set PBE params - var salt = capture.kdfSalt; - var count = forge.util.createBuffer(capture.kdfIterationCount); - count = count.getInt(count.length() << 3); - var dkLen; - var cipherFn; - switch(pki.oids[oid]) { - case 'aes128-CBC': - dkLen = 16; - cipherFn = forge.aes.createDecryptionCipher; - break; - case 'aes192-CBC': - dkLen = 24; - cipherFn = forge.aes.createDecryptionCipher; - break; - case 'aes256-CBC': - dkLen = 32; - cipherFn = forge.aes.createDecryptionCipher; - break; - case 'des-EDE3-CBC': - dkLen = 24; - cipherFn = forge.des.createDecryptionCipher; - break; - case 'desCBC': - dkLen = 8; - cipherFn = forge.des.createDecryptionCipher; - break; +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +try { + process.cwd() +} catch (er) {} + +// This check is needed until node.js 12 is required +if (typeof process.chdir === 'function') { + var chdir = process.chdir + process.chdir = function (d) { + cwd = null + chdir.call(process, d) } + if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) +} - // get PRF message digest - var md = prfOidToMessageDigest(capture.prfOid); +module.exports = patch - // decrypt private key using pbe with chosen PRF and AES/DES - var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md); - var iv = capture.encIv; - var cipher = cipherFn(dk); - cipher.start(iv); +function patch (fs) { + // (re-)implement some things that are known busted or missing. - return cipher; -}; + // lchmod, broken prior to 0.6.2 + // back-port the fix here. + if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs) + } -/** - * Get new Forge cipher object instance for PKCS#12 PBE. - * - * The returned cipher instance is already started using the key & IV - * derived from the provided password and PKCS#12 PBE salt. - * - * @param oid The PKCS#12 PBE OID (in string notation). - * @param params The ASN.1 PKCS#12 PBE-params object. - * @param password The password to decrypt with. - * - * @return the new cipher object instance. - */ -pki.pbe.getCipherForPKCS12PBE = function(oid, params, password) { - // get PBE params - var capture = {}; - var errors = []; - if(!asn1.validate(params, pkcs12PbeParamsValidator, capture, errors)) { - var error = new Error('Cannot read password-based-encryption algorithm ' + - 'parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.'); - error.errors = errors; - throw error; + // lutimes implementation, or no-op + if (!fs.lutimes) { + patchLutimes(fs) } - var salt = forge.util.createBuffer(capture.salt); - var count = forge.util.createBuffer(capture.iterations); - count = count.getInt(count.length() << 3); + // https://github.com/isaacs/node-graceful-fs/issues/4 + // Chown should not fail on einval or eperm if non-root. + // It should not fail on enosys ever, as this just indicates + // that a fs doesn't support the intended operation. - var dkLen, dIvLen, cipherFn; - switch(oid) { - case pki.oids['pbeWithSHAAnd3-KeyTripleDES-CBC']: - dkLen = 24; - dIvLen = 8; - cipherFn = forge.des.startDecrypting; - break; + fs.chown = chownFix(fs.chown) + fs.fchown = chownFix(fs.fchown) + fs.lchown = chownFix(fs.lchown) - case pki.oids['pbewithSHAAnd40BitRC2-CBC']: - dkLen = 5; - dIvLen = 8; - cipherFn = function(key, iv) { - var cipher = forge.rc2.createDecryptionCipher(key, 40); - cipher.start(iv, null); - return cipher; - }; - break; + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) - default: - var error = new Error('Cannot read PKCS #12 PBE data block. Unsupported OID.'); - error.oid = oid; - throw error; - } + fs.chownSync = chownFixSync(fs.chownSync) + fs.fchownSync = chownFixSync(fs.fchownSync) + fs.lchownSync = chownFixSync(fs.lchownSync) - // get PRF message digest - var md = prfOidToMessageDigest(capture.prfOid); - var key = pki.pbe.generatePkcs12Key(password, salt, 1, count, dkLen, md); - md.start(); - var iv = pki.pbe.generatePkcs12Key(password, salt, 2, count, dIvLen, md); + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) - return cipherFn(key, iv); -}; + fs.stat = statFix(fs.stat) + fs.fstat = statFix(fs.fstat) + fs.lstat = statFix(fs.lstat) -/** - * OpenSSL's legacy key derivation function. - * - * See: http://www.openssl.org/docs/crypto/EVP_BytesToKey.html - * - * @param password the password to derive the key from. - * @param salt the salt to use, null for none. - * @param dkLen the number of bytes needed for the derived key. - * @param [options] the options to use: - * [md] an optional message digest object to use. - */ -pki.pbe.opensslDeriveBytes = function(password, salt, dkLen, md) { - if(typeof md === 'undefined' || md === null) { - if(!('md5' in forge.md)) { - throw new Error('"md5" hash algorithm unavailable.'); + fs.statSync = statFixSync(fs.statSync) + fs.fstatSync = statFixSync(fs.fstatSync) + fs.lstatSync = statFixSync(fs.lstatSync) + + // if lchmod/lchown do not exist, then make them no-ops + if (fs.chmod && !fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + if (cb) process.nextTick(cb) } - md = forge.md.md5.create(); - } - if(salt === null) { - salt = ''; + fs.lchmodSync = function () {} } - var digests = [hash(md, password + salt)]; - for(var length = 16, i = 1; length < dkLen; ++i, length += 16) { - digests.push(hash(md, digests[i - 1] + password + salt)); + if (fs.chown && !fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + if (cb) process.nextTick(cb) + } + fs.lchownSync = function () {} } - return digests.join('').substr(0, dkLen); -}; -function hash(md, bytes) { - return md.start().update(bytes).digest().getBytes(); -} + // on Windows, A/V software can lock the directory, causing this + // to fail with an EACCES or EPERM if the directory contains newly + // created files. Try again on failure, for up to 60 seconds. -function prfOidToMessageDigest(prfOid) { - // get PRF algorithm, default to SHA-1 - var prfAlgorithm; - if(!prfOid) { - prfAlgorithm = 'hmacWithSHA1'; - } else { - prfAlgorithm = pki.oids[asn1.derToOid(prfOid)]; - if(!prfAlgorithm) { - var error = new Error('Unsupported PRF OID.'); - error.oid = prfOid; - error.supported = [ - 'hmacWithSHA1', 'hmacWithSHA224', 'hmacWithSHA256', 'hmacWithSHA384', - 'hmacWithSHA512']; - throw error; - } + // Set the timeout this long because some Windows Anti-Virus, such as Parity + // bit9, may lock files for up to a minute, causing npm package install + // failures. Also, take care to yield the scheduler. Windows scheduling gives + // CPU to a busy looping process, which can cause the program causing the lock + // contention to be starved of CPU by node, so the contention doesn't resolve. + if (platform === "win32") { + fs.rename = typeof fs.rename !== 'function' ? fs.rename + : (function (fs$rename) { + function rename (from, to, cb) { + var start = Date.now() + var backoff = 0; + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM") + && Date.now() - start < 60000) { + setTimeout(function() { + fs.stat(to, function (stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er) + }) + }, backoff) + if (backoff < 100) + backoff += 10; + return; + } + if (cb) cb(er) + }) + } + if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename) + return rename + })(fs.rename) } - return prfAlgorithmToMessageDigest(prfAlgorithm); -} -function prfAlgorithmToMessageDigest(prfAlgorithm) { - var factory = forge.md; - switch(prfAlgorithm) { - case 'hmacWithSHA224': - factory = forge.md.sha512; - case 'hmacWithSHA1': - case 'hmacWithSHA256': - case 'hmacWithSHA384': - case 'hmacWithSHA512': - prfAlgorithm = prfAlgorithm.substr(8).toLowerCase(); - break; - default: - var error = new Error('Unsupported PRF algorithm.'); - error.algorithm = prfAlgorithm; - error.supported = [ - 'hmacWithSHA1', 'hmacWithSHA224', 'hmacWithSHA256', 'hmacWithSHA384', - 'hmacWithSHA512']; - throw error; - } - if(!factory || !(prfAlgorithm in factory)) { - throw new Error('Unknown hash algorithm: ' + prfAlgorithm); - } - return factory[prfAlgorithm].create(); -} + // if read() returns EAGAIN, then just try it again. + fs.read = typeof fs.read !== 'function' ? fs.read + : (function (fs$read) { + function read (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } -function createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm) { - var params = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // salt - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, salt), - // iteration count - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - countBytes.getBytes()) - ]); - // when PRF algorithm is not SHA-1 default, add key length and PRF algorithm - if(prfAlgorithm !== 'hmacWithSHA1') { - params.value.push( - // key length - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - forge.util.hexToBytes(dkLen.toString(16))), - // AlgorithmIdentifier - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids[prfAlgorithm]).getBytes()), - // parameters (null) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ])); - } - return params; -} + // This ensures `util.promisify` works as it does for native `fs.read`. + if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) + return read + })(fs.read) + fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync + : (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } + }})(fs.readSync) -/***/ }), + function patchLchmod (fs) { + fs.lchmod = function (path, mode, callback) { + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + if (callback) callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + if (callback) callback(err || err2) + }) + }) + }) + } -<<<<<<< HEAD -/***/ 90577: -======= -/***/ 84418: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) -/** - * Password-Based Key-Derivation Function #2 implementation. - * - * See RFC 2898 for details. - * - * @author Dave Longley - * - * Copyright (c) 2010-2013 Digital Bazaar, Inc. - */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -__nccwpck_require__(8209); -__nccwpck_require__(2439); -__nccwpck_require__(19239); -======= -var forge = __nccwpck_require__(96630); -__nccwpck_require__(46773); -__nccwpck_require__(80554); -__nccwpck_require__(36536); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var threw = true + var ret + try { + ret = fs.fchmodSync(fd, mode) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + } -var pkcs5 = forge.pkcs5 = forge.pkcs5 || {}; + function patchLutimes (fs) { + if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + if (er) { + if (cb) cb(er) + return + } + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + if (cb) cb(er || er2) + }) + }) + }) + } -var crypto; -if(forge.util.isNodejs && !forge.options.usePureJavaScript) { - crypto = __nccwpck_require__(6113); -} + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + var ret + var threw = true + try { + ret = fs.futimesSync(fd, at, mt) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } -/** - * Derives a key from a password. - * - * @param p the password as a binary-encoded string of bytes. - * @param s the salt as a binary-encoded string of bytes. - * @param c the iteration count, a positive integer. - * @param dkLen the intended length, in bytes, of the derived key, - * (max: 2^32 - 1) * hash length of the PRF. - * @param [md] the message digest (or algorithm identifier as a string) to use - * in the PRF, defaults to SHA-1. - * @param [callback(err, key)] presence triggers asynchronous version, called - * once the operation completes. - * - * @return the derived key, as a binary-encoded string of bytes, for the - * synchronous version (if no callback is specified). - */ -module.exports = forge.pbkdf2 = pkcs5.pbkdf2 = function( - p, s, c, dkLen, md, callback) { - if(typeof md === 'function') { - callback = md; - md = null; + } else if (fs.futimes) { + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } + fs.lutimesSync = function () {} + } } - // use native implementation if possible and not disabled, note that - // some node versions only support SHA-1, others allow digest to be changed - if(forge.util.isNodejs && !forge.options.usePureJavaScript && - crypto.pbkdf2 && (md === null || typeof md !== 'object') && - (crypto.pbkdf2Sync.length > 4 || (!md || md === 'sha1'))) { - if(typeof md !== 'string') { - // default prf to SHA-1 - md = 'sha1'; + function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) } - p = Buffer.from(p, 'binary'); - s = Buffer.from(s, 'binary'); - if(!callback) { - if(crypto.pbkdf2Sync.length === 4) { - return crypto.pbkdf2Sync(p, s, c, dkLen).toString('binary'); + } + + function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er } - return crypto.pbkdf2Sync(p, s, c, dkLen, md).toString('binary'); } - if(crypto.pbkdf2Sync.length === 4) { - return crypto.pbkdf2(p, s, c, dkLen, function(err, key) { - if(err) { - return callback(err); - } - callback(null, key.toString('binary')); - }); + } + + + function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) } - return crypto.pbkdf2(p, s, c, dkLen, md, function(err, key) { - if(err) { - return callback(err); + } + + function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er } - callback(null, key.toString('binary')); - }); + } } - if(typeof md === 'undefined' || md === null) { - // default prf to SHA-1 - md = 'sha1'; + function statFix (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + function callback (er, stats) { + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + if (cb) cb.apply(this, arguments) + } + return options ? orig.call(fs, target, options, callback) + : orig.call(fs, target, callback) + } } - if(typeof md === 'string') { - if(!(md in forge.md.algorithms)) { - throw new Error('Unknown hash algorithm: ' + md); + + function statFixSync (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options) { + var stats = options ? orig.call(fs, target, options) + : orig.call(fs, target) + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + return stats; } - md = forge.md[md].create(); } - var hLen = md.digestLength; + // ENOSYS means that the fs doesn't support the op. Just ignore + // that, because it doesn't matter. + // + // if there's no getuid, or if getuid() is something other + // than 0, and the error is EINVAL or EPERM, then just ignore + // it. + // + // This specific case is a silent failure in cp, install, tar, + // and most other unix tools that manage permissions. + // + // When running as root, or if other types of errors are + // encountered, then it's strict. + function chownErOk (er) { + if (!er) + return true + + if (er.code === "ENOSYS") + return true - /* 1. If dkLen > (2^32 - 1) * hLen, output "derived key too long" and - stop. */ - if(dkLen > (0xFFFFFFFF * hLen)) { - var err = new Error('Derived key is too long.'); - if(callback) { - return callback(err); + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true } - throw err; + + return false } +} - /* 2. Let len be the number of hLen-octet blocks in the derived key, - rounding up, and let r be the number of octets in the last - block: - len = CEIL(dkLen / hLen), - r = dkLen - (len - 1) * hLen. */ - var len = Math.ceil(dkLen / hLen); - var r = dkLen - (len - 1) * hLen; +/***/ }), - /* 3. For each block of the derived key apply the function F defined - below to the password P, the salt S, the iteration count c, and - the block index to compute the block: +/***/ 72852: +/***/ ((module) => { - T_1 = F(P, S, c, 1), - T_2 = F(P, S, c, 2), - ... - T_len = F(P, S, c, len), - where the function F is defined as the exclusive-or sum of the - first c iterates of the underlying pseudorandom function PRF - applied to the password P and the concatenation of the salt S - and the block index i: +module.exports = (flag, argv) => { + argv = argv || process.argv; + const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); + const pos = argv.indexOf(prefix + flag); + const terminatorPos = argv.indexOf('--'); + return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); +}; - F(P, S, c, i) = u_1 XOR u_2 XOR ... XOR u_c - where +/***/ }), - u_1 = PRF(P, S || INT(i)), - u_2 = PRF(P, u_1), - ... - u_c = PRF(P, u_{c-1}). +/***/ 8227: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - Here, INT(i) is a four-octet encoding of the integer i, most - significant octet first. */ - var prf = forge.hmac.create(); - prf.start(md, p); - var dk = ''; - var xor, u_c, u_c1; +// minimal library entry point. - // sync version - if(!callback) { - for(var i = 1; i <= len; ++i) { - // PRF(P, S || INT(i)) (first iteration) - prf.start(null, null); - prf.update(s); - prf.update(forge.util.int32ToBytes(i)); - xor = u_c1 = prf.digest().getBytes(); - // PRF(P, u_{c-1}) (other iterations) - for(var j = 2; j <= c; ++j) { - prf.start(null, null); - prf.update(u_c1); - u_c = prf.digest().getBytes(); - // F(p, s, c, i) - xor = forge.util.xorBytes(xor, u_c, hLen); - u_c1 = u_c; - } +module.exports = __nccwpck_require__(64725); - /* 4. Concatenate the blocks and extract the first dkLen octets to - produce a derived key DK: - DK = T_1 || T_2 || ... || T_len<0..r-1> */ - dk += (i < len) ? xor : xor.substr(0, r); - } - /* 5. Output the derived key DK. */ - return dk; - } +/***/ }), - // async version - var i = 1, j; - function outer() { - if(i > len) { - // done - return callback(null, dk); - } +/***/ 64725: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // PRF(P, S || INT(i)) (first iteration) - prf.start(null, null); - prf.update(s); - prf.update(forge.util.int32ToBytes(i)); - xor = u_c1 = prf.digest().getBytes(); - // PRF(P, u_{c-1}) (other iterations) - j = 2; - inner(); - } +var protobuf = exports; - function inner() { - if(j <= c) { - prf.start(null, null); - prf.update(u_c1); - u_c = prf.digest().getBytes(); - // F(p, s, c, i) - xor = forge.util.xorBytes(xor, u_c, hLen); - u_c1 = u_c; - ++j; - return forge.util.setImmediate(inner); - } +/** + * Build type, one of `"full"`, `"light"` or `"minimal"`. + * @name build + * @type {string} + * @const + */ +protobuf.build = "minimal"; - /* 4. Concatenate the blocks and extract the first dkLen octets to - produce a derived key DK: +// Serialization +protobuf.Writer = __nccwpck_require__(38225); +protobuf.BufferWriter = __nccwpck_require__(54020); +protobuf.Reader = __nccwpck_require__(51387); +protobuf.BufferReader = __nccwpck_require__(97513); - DK = T_1 || T_2 || ... || T_len<0..r-1> */ - dk += (i < len) ? xor : xor.substr(0, r); +// Utility +protobuf.util = __nccwpck_require__(70598); +protobuf.rpc = __nccwpck_require__(46554); +protobuf.roots = __nccwpck_require__(49123); +protobuf.configure = configure; - ++i; - outer(); - } +/* istanbul ignore next */ +/** + * Reconfigures the library according to the environment. + * @returns {undefined} + */ +function configure() { + protobuf.util._configure(); + protobuf.Writer._configure(protobuf.BufferWriter); + protobuf.Reader._configure(protobuf.BufferReader); +} - outer(); -}; +// Set up buffer utility according to the environment +configure(); /***/ }), -<<<<<<< HEAD -/***/ 44214: -======= -/***/ 57334: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 51387: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Javascript implementation of basic PEM (Privacy Enhanced Mail) algorithms. - * - * See: RFC 1421. - * - * @author Dave Longley - * - * Copyright (c) 2013-2014 Digital Bazaar, Inc. - * - * A Forge PEM object has the following fields: - * - * type: identifies the type of message (eg: "RSA PRIVATE KEY"). - * - * procType: identifies the type of processing performed on the message, - * it has two subfields: version and type, eg: 4,ENCRYPTED. - * - * contentDomain: identifies the type of content in the message, typically - * only uses the value: "RFC822". - * - * dekInfo: identifies the message encryption algorithm and mode and includes - * any parameters for the algorithm, it has two subfields: algorithm and - * parameters, eg: DES-CBC,F8143EDE5960C597. - * - * headers: contains all other PEM encapsulated headers -- where order is - * significant (for pairing data like recipient ID + key info). - * - * body: the binary-encoded body. - */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -__nccwpck_require__(19239); -======= -var forge = __nccwpck_require__(96630); -__nccwpck_require__(36536); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -// shortcut for pem API -var pem = module.exports = forge.pem = forge.pem || {}; +module.exports = Reader; + +var util = __nccwpck_require__(70598); + +var BufferReader; // cyclic + +var LongBits = util.LongBits, + utf8 = util.utf8; + +/* istanbul ignore next */ +function indexOutOfRange(reader, writeLength) { + return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); +} /** - * Encodes (serializes) the given PEM object. - * - * @param msg the PEM message object to encode. - * @param options the options to use: - * maxline the maximum characters per line for the body, (default: 64). - * - * @return the PEM-formatted string. + * Constructs a new reader instance using the specified buffer. + * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. + * @constructor + * @param {Uint8Array} buffer Buffer to read from */ -pem.encode = function(msg, options) { - options = options || {}; - var rval = '-----BEGIN ' + msg.type + '-----\r\n'; +function Reader(buffer) { - // encode special headers - var header; - if(msg.procType) { - header = { - name: 'Proc-Type', - values: [String(msg.procType.version), msg.procType.type] - }; - rval += foldHeader(header); - } - if(msg.contentDomain) { - header = {name: 'Content-Domain', values: [msg.contentDomain]}; - rval += foldHeader(header); - } - if(msg.dekInfo) { - header = {name: 'DEK-Info', values: [msg.dekInfo.algorithm]}; - if(msg.dekInfo.parameters) { - header.values.push(msg.dekInfo.parameters); - } - rval += foldHeader(header); - } + /** + * Read buffer. + * @type {Uint8Array} + */ + this.buf = buffer; - if(msg.headers) { - // encode all other headers - for(var i = 0; i < msg.headers.length; ++i) { - rval += foldHeader(msg.headers[i]); - } - } + /** + * Read buffer position. + * @type {number} + */ + this.pos = 0; - // terminate header - if(msg.procType) { - rval += '\r\n'; - } + /** + * Read buffer length. + * @type {number} + */ + this.len = buffer.length; +} - // add body - rval += forge.util.encode64(msg.body, options.maxline || 64) + '\r\n'; +var create_array = typeof Uint8Array !== "undefined" + ? function create_typed_array(buffer) { + if (buffer instanceof Uint8Array || Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + } + /* istanbul ignore next */ + : function create_array(buffer) { + if (Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + }; - rval += '-----END ' + msg.type + '-----\r\n'; - return rval; +var create = function create() { + return util.Buffer + ? function create_buffer_setup(buffer) { + return (Reader.create = function create_buffer(buffer) { + return util.Buffer.isBuffer(buffer) + ? new BufferReader(buffer) + /* istanbul ignore next */ + : create_array(buffer); + })(buffer); + } + /* istanbul ignore next */ + : create_array; }; /** - * Decodes (deserializes) all PEM messages found in the given string. - * - * @param str the PEM-formatted string to decode. - * - * @return the PEM message objects in an array. + * Creates a new reader using the specified buffer. + * @function + * @param {Uint8Array|Buffer} buffer Buffer to read from + * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} + * @throws {Error} If `buffer` is not a valid buffer */ -pem.decode = function(str) { - var rval = []; +Reader.create = create(); - // split string into PEM messages (be lenient w/EOF on BEGIN line) - var rMessage = /\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g; - var rHeader = /([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/; - var rCRLF = /\r?\n/; - var match; - while(true) { - match = rMessage.exec(str); - if(!match) { - break; - } +Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; - // accept "NEW CERTIFICATE REQUEST" as "CERTIFICATE REQUEST" - // https://datatracker.ietf.org/doc/html/rfc7468#section-7 - var type = match[1]; - if(type === 'NEW CERTIFICATE REQUEST') { - type = 'CERTIFICATE REQUEST'; - } +/** + * Reads a varint as an unsigned 32 bit value. + * @function + * @returns {number} Value read + */ +Reader.prototype.uint32 = (function read_uint32_setup() { + var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) + return function read_uint32() { + value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; - var msg = { - type: type, - procType: null, - contentDomain: null, - dekInfo: null, - headers: [], - body: forge.util.decode64(match[3]) + /* istanbul ignore if */ + if ((this.pos += 5) > this.len) { + this.pos = this.len; + throw indexOutOfRange(this, 10); + } + return value; }; - rval.push(msg); +})(); - // no headers - if(!match[2]) { - continue; - } +/** + * Reads a varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.int32 = function read_int32() { + return this.uint32() | 0; +}; - // parse headers - var lines = match[2].split(rCRLF); - var li = 0; - while(match && li < lines.length) { - // get line, trim any rhs whitespace - var line = lines[li].replace(/\s+$/, ''); +/** + * Reads a zig-zag encoded varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.sint32 = function read_sint32() { + var value = this.uint32(); + return value >>> 1 ^ -(value & 1) | 0; +}; - // RFC2822 unfold any following folded lines - for(var nl = li + 1; nl < lines.length; ++nl) { - var next = lines[nl]; - if(!/\s/.test(next[0])) { - break; - } - line += next; - li = nl; - } +/* eslint-disable no-invalid-this */ - // parse header - match = line.match(rHeader); - if(match) { - var header = {name: match[1], values: []}; - var values = match[2].split(','); - for(var vi = 0; vi < values.length; ++vi) { - header.values.push(ltrim(values[vi])); +function readLongVarint() { + // tends to deopt with local vars for octet etc. + var bits = new LongBits(0, 0); + var i = 0; + if (this.len - this.pos > 4) { // fast route (lo) + for (; i < 4; ++i) { + // 1st..4th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; } - - // Proc-Type must be the first header - if(!msg.procType) { - if(header.name !== 'Proc-Type') { - throw new Error('Invalid PEM formatted message. The first ' + - 'encapsulated header must be "Proc-Type".'); - } else if(header.values.length !== 2) { - throw new Error('Invalid PEM formatted message. The "Proc-Type" ' + - 'header must have two subfields.'); - } - msg.procType = {version: values[0], type: values[1]}; - } else if(!msg.contentDomain && header.name === 'Content-Domain') { - // special-case Content-Domain - msg.contentDomain = values[0] || ''; - } else if(!msg.dekInfo && header.name === 'DEK-Info') { - // special-case DEK-Info - if(header.values.length === 0) { - throw new Error('Invalid PEM formatted message. The "DEK-Info" ' + - 'header must have at least one subfield.'); - } - msg.dekInfo = {algorithm: values[0], parameters: values[1] || null}; - } else { - msg.headers.push(header); + // 5th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + i = 0; + } else { + for (; i < 3; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 1st..3th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; } - } - - ++li; + // 4th + bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; + return bits; } - - if(msg.procType === 'ENCRYPTED' && !msg.dekInfo) { - throw new Error('Invalid PEM formatted message. The "DEK-Info" ' + - 'header must be present if "Proc-Type" is "ENCRYPTED".'); + if (this.len - this.pos > 4) { // fast route (hi) + for (; i < 5; ++i) { + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } else { + for (; i < 5; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } } - } + /* istanbul ignore next */ + throw Error("invalid varint encoding"); +} - if(rval.length === 0) { - throw new Error('Invalid PEM formatted message.'); - } +/* eslint-enable no-invalid-this */ - return rval; -}; +/** + * Reads a varint as a signed 64 bit value. + * @name Reader#int64 + * @function + * @returns {Long} Value read + */ -function foldHeader(header) { - var rval = header.name + ': '; +/** + * Reads a varint as an unsigned 64 bit value. + * @name Reader#uint64 + * @function + * @returns {Long} Value read + */ - // ensure values with CRLF are folded - var values = []; - var insertSpace = function(match, $1) { - return ' ' + $1; - }; - for(var i = 0; i < header.values.length; ++i) { - values.push(header.values[i].replace(/^(\S+\r\n)/, insertSpace)); - } - rval += values.join(',') + '\r\n'; +/** + * Reads a zig-zag encoded varint as a signed 64 bit value. + * @name Reader#sint64 + * @function + * @returns {Long} Value read + */ - // do folding - var length = 0; - var candidate = -1; - for(var i = 0; i < rval.length; ++i, ++length) { - if(length > 65 && candidate !== -1) { - var insert = rval[candidate]; - if(insert === ',') { - ++candidate; - rval = rval.substr(0, candidate) + '\r\n ' + rval.substr(candidate); - } else { - rval = rval.substr(0, candidate) + - '\r\n' + insert + rval.substr(candidate + 1); - } - length = (i - candidate - 1); - candidate = -1; - ++i; - } else if(rval[i] === ' ' || rval[i] === '\t' || rval[i] === ',') { - candidate = i; - } - } +/** + * Reads a varint as a boolean. + * @returns {boolean} Value read + */ +Reader.prototype.bool = function read_bool() { + return this.uint32() !== 0; +}; - return rval; +function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` + return (buf[end - 4] + | buf[end - 3] << 8 + | buf[end - 2] << 16 + | buf[end - 1] << 24) >>> 0; } -function ltrim(str) { - return str.replace(/^\s+/, ''); -} +/** + * Reads fixed 32 bits as an unsigned 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.fixed32 = function read_fixed32() { + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); -/***/ }), + return readFixed32_end(this.buf, this.pos += 4); +}; -<<<<<<< HEAD -/***/ 96096: -======= -/***/ 39703: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * Reads fixed 32 bits as a signed 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.sfixed32 = function read_sfixed32() { + + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + + return readFixed32_end(this.buf, this.pos += 4) | 0; +}; + +/* eslint-disable no-invalid-this */ + +function readFixed64(/* this: Reader */) { + + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 8); + + return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); +} + +/* eslint-enable no-invalid-this */ /** - * Partial implementation of PKCS#1 v2.2: RSA-OEAP - * - * Modified but based on the following MIT and BSD licensed code: - * - * https://github.com/kjur/jsjws/blob/master/rsa.js: - * - * The 'jsjws'(JSON Web Signature JavaScript Library) License - * - * Copyright (c) 2012 Kenji Urushima - * - * 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. - * - * http://webrsa.cvs.sourceforge.net/viewvc/webrsa/Client/RSAES-OAEP.js?content-type=text%2Fplain: - * - * RSAES-OAEP.js - * $Id: RSAES-OAEP.js,v 1.1.1.1 2003/03/19 15:37:20 ellispritchard Exp $ - * JavaScript Implementation of PKCS #1 v2.1 RSA CRYPTOGRAPHY STANDARD (RSA Laboratories, June 14, 2002) - * Copyright (C) Ellis Pritchard, Guardian Unlimited 2003. - * Contact: ellis@nukinetics.com - * Distributed under the BSD License. - * - * Official documentation: http://www.rsa.com/rsalabs/node.asp?id=2125 - * - * @author Evan Jones (http://evanjones.ca/) - * @author Dave Longley - * - * Copyright (c) 2013-2014 Digital Bazaar, Inc. + * Reads fixed 64 bits. + * @name Reader#fixed64 + * @function + * @returns {Long} Value read */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -__nccwpck_require__(19239); -__nccwpck_require__(35283); -__nccwpck_require__(69970); -======= -var forge = __nccwpck_require__(96630); -__nccwpck_require__(36536); -__nccwpck_require__(68737); -__nccwpck_require__(41447); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -// shortcut for PKCS#1 API -var pkcs1 = module.exports = forge.pkcs1 = forge.pkcs1 || {}; +/** + * Reads zig-zag encoded fixed 64 bits. + * @name Reader#sfixed64 + * @function + * @returns {Long} Value read + */ /** - * Encode the given RSAES-OAEP message (M) using key, with optional label (L) - * and seed. - * - * This method does not perform RSA encryption, it only encodes the message - * using RSAES-OAEP. - * - * @param key the RSA key to use. - * @param message the message to encode. - * @param options the options to use: - * label an optional label to use. - * seed the seed to use. - * md the message digest object to use, undefined for SHA-1. - * mgf1 optional mgf1 parameters: - * md the message digest object to use for MGF1. - * - * @return the encoded message bytes. + * Reads a float (32 bit) as a number. + * @function + * @returns {number} Value read */ -pkcs1.encode_rsa_oaep = function(key, message, options) { - // parse arguments - var label; - var seed; - var md; - var mgf1Md; - // legacy args (label, seed, md) - if(typeof options === 'string') { - label = options; - seed = arguments[3] || undefined; - md = arguments[4] || undefined; - } else if(options) { - label = options.label || undefined; - seed = options.seed || undefined; - md = options.md || undefined; - if(options.mgf1 && options.mgf1.md) { - mgf1Md = options.mgf1.md; - } - } +Reader.prototype.float = function read_float() { - // default OAEP to SHA-1 message digest - if(!md) { - md = forge.md.sha1.create(); - } else { - md.start(); - } + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); - // default MGF-1 to same as OAEP - if(!mgf1Md) { - mgf1Md = md; - } + var value = util.float.readFloatLE(this.buf, this.pos); + this.pos += 4; + return value; +}; - // compute length in bytes and check output - var keyLength = Math.ceil(key.n.bitLength() / 8); - var maxLength = keyLength - 2 * md.digestLength - 2; - if(message.length > maxLength) { - var error = new Error('RSAES-OAEP input message length is too long.'); - error.length = message.length; - error.maxLength = maxLength; - throw error; - } +/** + * Reads a double (64 bit float) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.double = function read_double() { - if(!label) { - label = ''; - } - md.update(label, 'raw'); - var lHash = md.digest(); + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 4); - var PS = ''; - var PS_length = maxLength - message.length; - for(var i = 0; i < PS_length; i++) { - PS += '\x00'; - } + var value = util.float.readDoubleLE(this.buf, this.pos); + this.pos += 8; + return value; +}; - var DB = lHash.getBytes() + PS + '\x01' + message; +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @returns {Uint8Array} Value read + */ +Reader.prototype.bytes = function read_bytes() { + var length = this.uint32(), + start = this.pos, + end = this.pos + length; - if(!seed) { - seed = forge.random.getBytes(md.digestLength); - } else if(seed.length !== md.digestLength) { - var error = new Error('Invalid RSAES-OAEP seed. The seed length must ' + - 'match the digest length.'); - error.seedLength = seed.length; - error.digestLength = md.digestLength; - throw error; - } + /* istanbul ignore if */ + if (end > this.len) + throw indexOutOfRange(this, length); - var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md); - var maskedDB = forge.util.xorBytes(DB, dbMask, DB.length); + this.pos += length; + if (Array.isArray(this.buf)) // plain array + return this.buf.slice(start, end); - var seedMask = rsa_mgf1(maskedDB, md.digestLength, mgf1Md); - var maskedSeed = forge.util.xorBytes(seed, seedMask, seed.length); + if (start === end) { // fix for IE 10/Win8 and others' subarray returning array of size 1 + var nativeBuffer = util.Buffer; + return nativeBuffer + ? nativeBuffer.alloc(0) + : new this.buf.constructor(0); + } + return this._slice.call(this.buf, start, end); +}; - // return encoded message - return '\x00' + maskedSeed + maskedDB; +/** + * Reads a string preceeded by its byte length as a varint. + * @returns {string} Value read + */ +Reader.prototype.string = function read_string() { + var bytes = this.bytes(); + return utf8.read(bytes, 0, bytes.length); }; /** - * Decode the given RSAES-OAEP encoded message (EM) using key, with optional - * label (L). - * - * This method does not perform RSA decryption, it only decodes the message - * using RSAES-OAEP. - * - * @param key the RSA key to use. - * @param em the encoded message to decode. - * @param options the options to use: - * label an optional label to use. - * md the message digest object to use for OAEP, undefined for SHA-1. - * mgf1 optional mgf1 parameters: - * md the message digest object to use for MGF1. - * - * @return the decoded message bytes. + * Skips the specified number of bytes if specified, otherwise skips a varint. + * @param {number} [length] Length if known, otherwise a varint is assumed + * @returns {Reader} `this` */ -pkcs1.decode_rsa_oaep = function(key, em, options) { - // parse args - var label; - var md; - var mgf1Md; - // legacy args - if(typeof options === 'string') { - label = options; - md = arguments[3] || undefined; - } else if(options) { - label = options.label || undefined; - md = options.md || undefined; - if(options.mgf1 && options.mgf1.md) { - mgf1Md = options.mgf1.md; +Reader.prototype.skip = function skip(length) { + if (typeof length === "number") { + /* istanbul ignore if */ + if (this.pos + length > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); } - } + return this; +}; - // compute length in bytes - var keyLength = Math.ceil(key.n.bitLength() / 8); +/** + * Skips the next element of the specified wire type. + * @param {number} wireType Wire type received + * @returns {Reader} `this` + */ +Reader.prototype.skipType = function(wireType) { + switch (wireType) { + case 0: + this.skip(); + break; + case 1: + this.skip(8); + break; + case 2: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case 5: + this.skip(4); + break; - if(em.length !== keyLength) { - var error = new Error('RSAES-OAEP encoded message length is invalid.'); - error.length = em.length; - error.expectedLength = keyLength; - throw error; - } + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; +}; - // default OAEP to SHA-1 message digest - if(md === undefined) { - md = forge.md.sha1.create(); - } else { - md.start(); - } +Reader._configure = function(BufferReader_) { + BufferReader = BufferReader_; + Reader.create = create(); + BufferReader._configure(); - // default MGF-1 to same as OAEP - if(!mgf1Md) { - mgf1Md = md; - } + var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; + util.merge(Reader.prototype, { - if(keyLength < 2 * md.digestLength + 2) { - throw new Error('RSAES-OAEP key is too short for the hash function.'); - } + int64: function read_int64() { + return readLongVarint.call(this)[fn](false); + }, - if(!label) { - label = ''; - } - md.update(label, 'raw'); - var lHash = md.digest().getBytes(); + uint64: function read_uint64() { + return readLongVarint.call(this)[fn](true); + }, - // split the message into its parts - var y = em.charAt(0); - var maskedSeed = em.substring(1, md.digestLength + 1); - var maskedDB = em.substring(1 + md.digestLength); + sint64: function read_sint64() { + return readLongVarint.call(this).zzDecode()[fn](false); + }, - var seedMask = rsa_mgf1(maskedDB, md.digestLength, mgf1Md); - var seed = forge.util.xorBytes(maskedSeed, seedMask, maskedSeed.length); + fixed64: function read_fixed64() { + return readFixed64.call(this)[fn](true); + }, - var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md); - var db = forge.util.xorBytes(maskedDB, dbMask, maskedDB.length); + sfixed64: function read_sfixed64() { + return readFixed64.call(this)[fn](false); + } - var lHashPrime = db.substring(0, md.digestLength); + }); +}; - // constant time check that all values match what is expected - var error = (y !== '\x00'); - // constant time check lHash vs lHashPrime - for(var i = 0; i < md.digestLength; ++i) { - error |= (lHash.charAt(i) !== lHashPrime.charAt(i)); - } +/***/ }), - // "constant time" find the 0x1 byte separating the padding (zeros) from the - // message - // TODO: It must be possible to do this in a better/smarter way? - var in_ps = 1; - var index = md.digestLength; - for(var j = md.digestLength; j < db.length; j++) { - var code = db.charCodeAt(j); +/***/ 97513: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var is_0 = (code & 0x1) ^ 0x1; - // non-zero if not 0 or 1 in the ps section - var error_mask = in_ps ? 0xfffe : 0x0000; - error |= (code & error_mask); +module.exports = BufferReader; - // latch in_ps to zero after we find 0x1 - in_ps = in_ps & is_0; - index += in_ps; - } +// extends Reader +var Reader = __nccwpck_require__(51387); +(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; - if(error || db.charCodeAt(index) !== 0x1) { - throw new Error('Invalid RSAES-OAEP padding.'); - } +var util = __nccwpck_require__(70598); - return db.substring(index + 1); -}; +/** + * Constructs a new buffer reader instance. + * @classdesc Wire format reader using node buffers. + * @extends Reader + * @constructor + * @param {Buffer} buffer Buffer to read from + */ +function BufferReader(buffer) { + Reader.call(this, buffer); -function rsa_mgf1(seed, maskLength, hash) { - // default to SHA-1 message digest - if(!hash) { - hash = forge.md.sha1.create(); - } - var t = ''; - var count = Math.ceil(maskLength / hash.digestLength); - for(var i = 0; i < count; ++i) { - var c = String.fromCharCode( - (i >> 24) & 0xFF, (i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF); - hash.start(); - hash.update(seed + c); - t += hash.digest().getBytes(); - } - return t.substring(0, maskLength); + /** + * Read buffer. + * @name BufferReader#buf + * @type {Buffer} + */ } +BufferReader._configure = function () { + /* istanbul ignore else */ + if (util.Buffer) + BufferReader.prototype._slice = util.Buffer.prototype.slice; +}; -/***/ }), -<<<<<<< HEAD -/***/ 22679: -======= -/***/ 93254: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * @override + */ +BufferReader.prototype.string = function read_string_buffer() { + var len = this.uint32(); // modifies pos + return this.buf.utf8Slice + ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) + : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); +}; /** - * Prime number generation API. - * - * @author Dave Longley - * - * Copyright (c) 2014 Digital Bazaar, Inc. + * Reads a sequence of bytes preceeded by its length as a varint. + * @name BufferReader#bytes + * @function + * @returns {Buffer} Value read */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -__nccwpck_require__(19239); -__nccwpck_require__(21686); -__nccwpck_require__(35283); -======= -var forge = __nccwpck_require__(96630); -__nccwpck_require__(36536); -__nccwpck_require__(121); -__nccwpck_require__(68737); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -(function() { +BufferReader._configure(); -// forge.prime already defined -if(forge.prime) { - module.exports = forge.prime; - return; -} -/* PRIME API */ -var prime = module.exports = forge.prime = forge.prime || {}; +/***/ }), -var BigInteger = forge.jsbn.BigInteger; +/***/ 49123: +/***/ ((module) => { -// primes are 30k+i for i = 1, 7, 11, 13, 17, 19, 23, 29 -var GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2]; -var THIRTY = new BigInteger(null); -THIRTY.fromInt(30); -var op_or = function(x, y) {return x|y;}; + +module.exports = {}; /** - * Generates a random probable prime with the given number of bits. - * - * Alternative algorithms can be specified by name as a string or as an - * object with custom options like so: - * - * { - * name: 'PRIMEINC', - * options: { - * maxBlockTime: , - * millerRabinTests: , - * workerScript: , - * workers: . - * workLoad: the size of the work load, ie: number of possible prime - * numbers for each web worker to check per work assignment, - * (default: 100). - * } - * } + * Named roots. + * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). + * Can also be used manually to make roots available across modules. + * @name roots + * @type {Object.} + * @example + * // pbjs -r myroot -o compiled.js ... * - * @param bits the number of bits for the prime number. - * @param options the options to use. - * [algorithm] the algorithm to use (default: 'PRIMEINC'). - * [prng] a custom crypto-secure pseudo-random number generator to use, - * that must define "getBytesSync". + * // in another module: + * require("./compiled.js"); * - * @return callback(err, num) called once the operation completes. + * // in any subsequent module: + * var root = protobuf.roots["myroot"]; */ -prime.generateProbablePrime = function(bits, options, callback) { - if(typeof options === 'function') { - callback = options; - options = {}; - } - options = options || {}; - // default to PRIMEINC algorithm - var algorithm = options.algorithm || 'PRIMEINC'; - if(typeof algorithm === 'string') { - algorithm = {name: algorithm}; - } - algorithm.options = algorithm.options || {}; - // create prng with api that matches BigInteger secure random - var prng = options.prng || forge.random; - var rng = { - // x is an array to fill with bytes - nextBytes: function(x) { - var b = prng.getBytesSync(x.length); - for(var i = 0; i < x.length; ++i) { - x[i] = b.charCodeAt(i); - } - } - }; +/***/ }), - if(algorithm.name === 'PRIMEINC') { - return primeincFindPrime(bits, rng, algorithm.options, callback); - } +/***/ 46554: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - throw new Error('Invalid prime generation algorithm: ' + algorithm.name); -}; -function primeincFindPrime(bits, rng, options, callback) { - if('workers' in options) { - return primeincFindPrimeWithWorkers(bits, rng, options, callback); - } - return primeincFindPrimeWithoutWorkers(bits, rng, options, callback); -} -function primeincFindPrimeWithoutWorkers(bits, rng, options, callback) { - // initialize random number - var num = generateRandom(bits, rng); +/** + * Streaming RPC helpers. + * @namespace + */ +var rpc = exports; - /* Note: All primes are of the form 30k+i for i < 30 and gcd(30, i)=1. The - number we are given is always aligned at 30k + 1. Each time the number is - determined not to be prime we add to get to the next 'i', eg: if the number - was at 30k + 1 we add 6. */ - var deltaIdx = 0; +/** + * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. + * @typedef RPCImpl + * @type {function} + * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called + * @param {Uint8Array} requestData Request data + * @param {RPCImplCallback} callback Callback function + * @returns {undefined} + * @example + * function rpcImpl(method, requestData, callback) { + * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code + * throw Error("no such method"); + * asynchronouslyObtainAResponse(requestData, function(err, responseData) { + * callback(err, responseData); + * }); + * } + */ - // get required number of MR tests - var mrTests = getMillerRabinTests(num.bitLength()); - if('millerRabinTests' in options) { - mrTests = options.millerRabinTests; - } +/** + * Node-style callback as used by {@link RPCImpl}. + * @typedef RPCImplCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error + * @returns {undefined} + */ - // find prime nearest to 'num' for maxBlockTime ms - // 10 ms gives 5ms of leeway for other calculations before dropping - // below 60fps (1000/60 == 16.67), but in reality, the number will - // likely be higher due to an 'atomic' big int modPow - var maxBlockTime = 10; - if('maxBlockTime' in options) { - maxBlockTime = options.maxBlockTime; - } +rpc.Service = __nccwpck_require__(25427); - _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback); -} -function _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback) { - var start = +new Date(); - do { - // overflow, regenerate random number - if(num.bitLength() > bits) { - num = generateRandom(bits, rng); - } - // do primality test - if(num.isProbablePrime(mrTests)) { - return callback(null, num); - } - // get next potential prime - num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0); - } while(maxBlockTime < 0 || (+new Date() - start < maxBlockTime)); +/***/ }), - // keep trying later - forge.util.setImmediate(function() { - _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback); - }); -} +/***/ 25427: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// NOTE: This algorithm is indeterminate in nature because workers -// run in parallel looking at different segments of numbers. Even if this -// algorithm is run twice with the same input from a predictable RNG, it -// may produce different outputs. -function primeincFindPrimeWithWorkers(bits, rng, options, callback) { - // web workers unavailable - if(typeof Worker === 'undefined') { - return primeincFindPrimeWithoutWorkers(bits, rng, options, callback); - } - // initialize random number - var num = generateRandom(bits, rng); +module.exports = Service; - // use web workers to generate keys - var numWorkers = options.workers; - var workLoad = options.workLoad || 100; - var range = workLoad * 30 / 8; - var workerScript = options.workerScript || 'forge/prime.worker.js'; - if(numWorkers === -1) { - return forge.util.estimateCores(function(err, cores) { - if(err) { - // default to 2 - cores = 2; - } - numWorkers = cores - 1; - generate(); - }); - } - generate(); +var util = __nccwpck_require__(70598); - function generate() { - // require at least 1 worker - numWorkers = Math.max(1, numWorkers); +// Extends EventEmitter +(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; - // TODO: consider optimizing by starting workers outside getPrime() ... - // note that in order to clean up they will have to be made internally - // asynchronous which may actually be slower +/** + * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * + * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. + * @typedef rpc.ServiceMethodCallback + * @template TRes extends Message + * @type {function} + * @param {Error|null} error Error, if any + * @param {TRes} [response] Response message + * @returns {undefined} + */ - // start workers immediately - var workers = []; - for(var i = 0; i < numWorkers; ++i) { - // FIXME: fix path or use blob URLs - workers[i] = new Worker(workerScript); - } - var running = numWorkers; +/** + * A service method part of a {@link rpc.Service} as created by {@link Service.create}. + * @typedef rpc.ServiceMethod + * @template TReq extends Message + * @template TRes extends Message + * @type {function} + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message + * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` + */ - // listen for requests from workers and assign ranges to find prime - for(var i = 0; i < numWorkers; ++i) { - workers[i].addEventListener('message', workerMessage); - } +/** + * Constructs a new RPC service instance. + * @classdesc An RPC service as returned by {@link Service#create}. + * @exports rpc.Service + * @extends util.EventEmitter + * @constructor + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ +function Service(rpcImpl, requestDelimited, responseDelimited) { - /* Note: The distribution of random numbers is unknown. Therefore, each - web worker is continuously allocated a range of numbers to check for a - random number until one is found. + if (typeof rpcImpl !== "function") + throw TypeError("rpcImpl must be a function"); - Every 30 numbers will be checked just 8 times, because prime numbers - have the form: + util.EventEmitter.call(this); - 30k+i, for i < 30 and gcd(30, i)=1 (there are 8 values of i for this) + /** + * RPC implementation. Becomes `null` once the service is ended. + * @type {RPCImpl|null} + */ + this.rpcImpl = rpcImpl; - Therefore, if we want a web worker to run N checks before asking for - a new range of numbers, each range must contain N*30/8 numbers. + /** + * Whether requests are length-delimited. + * @type {boolean} + */ + this.requestDelimited = Boolean(requestDelimited); - For 100 checks (workLoad), this is a range of 375. */ + /** + * Whether responses are length-delimited. + * @type {boolean} + */ + this.responseDelimited = Boolean(responseDelimited); +} - var found = false; - function workerMessage(e) { - // ignore message, prime already found - if(found) { - return; - } +/** + * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. + * @param {Method|rpc.ServiceMethod} method Reflected or static method + * @param {Constructor} requestCtor Request constructor + * @param {Constructor} responseCtor Response constructor + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} callback Service callback + * @returns {undefined} + * @template TReq extends Message + * @template TRes extends Message + */ +Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { - --running; - var data = e.data; - if(data.found) { - // terminate all workers - for(var i = 0; i < workers.length; ++i) { - workers[i].terminate(); - } - found = true; - return callback(null, new BigInteger(data.prime, 16)); - } + if (!request) + throw TypeError("request must be specified"); - // overflow, regenerate random number - if(num.bitLength() > bits) { - num = generateRandom(bits, rng); - } + var self = this; + if (!callback) + return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); - // assign new range to check - var hex = num.toString(16); + if (!self.rpcImpl) { + setTimeout(function() { callback(Error("already ended")); }, 0); + return undefined; + } - // start prime search - e.target.postMessage({ - hex: hex, - workLoad: workLoad - }); + try { + return self.rpcImpl( + method, + requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), + function rpcCallback(err, response) { - num.dAddOffset(range, 0); - } - } -} + if (err) { + self.emit("error", err, method); + return callback(err); + } -/** - * Generates a random number using the given number of bits and RNG. - * - * @param bits the number of bits for the number. - * @param rng the random number generator to use. - * - * @return the random number. - */ -function generateRandom(bits, rng) { - var num = new BigInteger(bits, rng); - // force MSB set - var bits1 = bits - 1; - if(!num.testBit(bits1)) { - num.bitwiseTo(BigInteger.ONE.shiftLeft(bits1), op_or, num); - } - // align number on 30k+1 boundary - num.dAddOffset(31 - num.mod(THIRTY).byteValue(), 0); - return num; -} + if (response === null) { + self.end(/* endedByRPC */ true); + return undefined; + } + + if (!(response instanceof responseCtor)) { + try { + response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); + } catch (err) { + self.emit("error", err, method); + return callback(err); + } + } + + self.emit("data", response, method); + return callback(null, response); + } + ); + } catch (err) { + self.emit("error", err, method); + setTimeout(function() { callback(err); }, 0); + return undefined; + } +}; /** - * Returns the required number of Miller-Rabin tests to generate a - * prime with an error probability of (1/2)^80. - * - * See Handbook of Applied Cryptography Chapter 4, Table 4.4. - * - * @param bits the bit size. - * - * @return the required number of iterations. + * Ends this service and emits the `end` event. + * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. + * @returns {rpc.Service} `this` */ -function getMillerRabinTests(bits) { - if(bits <= 100) return 27; - if(bits <= 150) return 18; - if(bits <= 200) return 15; - if(bits <= 250) return 12; - if(bits <= 300) return 9; - if(bits <= 350) return 8; - if(bits <= 400) return 7; - if(bits <= 500) return 6; - if(bits <= 600) return 5; - if(bits <= 800) return 4; - if(bits <= 1250) return 3; - return 2; -} - -})(); +Service.prototype.end = function end(endedByRPC) { + if (this.rpcImpl) { + if (!endedByRPC) // signal end to rpcImpl + this.rpcImpl(null, null, null); + this.rpcImpl = null; + this.emit("end").off(); + } + return this; +}; /***/ }), -<<<<<<< HEAD -/***/ 26866: -======= -/***/ 37747: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 13822: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = LongBits; + +var util = __nccwpck_require__(70598); + /** - * A javascript implementation of a cryptographically-secure - * Pseudo Random Number Generator (PRNG). The Fortuna algorithm is followed - * here though the use of SHA-256 is not enforced; when generating an - * a PRNG context, the hashing algorithm and block cipher used for - * the generator are specified via a plugin. - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. + * Constructs new long bits. + * @classdesc Helper class for working with the low and high bits of a 64 bit value. + * @memberof util + * @constructor + * @param {number} lo Low 32 bits, unsigned + * @param {number} hi High 32 bits, unsigned */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -__nccwpck_require__(19239); -======= -var forge = __nccwpck_require__(96630); -__nccwpck_require__(36536); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +function LongBits(lo, hi) { -var _crypto = null; -if(forge.util.isNodejs && !forge.options.usePureJavaScript && - !process.versions['node-webkit']) { - _crypto = __nccwpck_require__(6113); -} + // note that the casts below are theoretically unnecessary as of today, but older statically + // generated converter code might still call the ctor with signed 32bits. kept for compat. -/* PRNG API */ -var prng = module.exports = forge.prng = forge.prng || {}; + /** + * Low bits. + * @type {number} + */ + this.lo = lo >>> 0; + + /** + * High bits. + * @type {number} + */ + this.hi = hi >>> 0; +} /** - * Creates a new PRNG context. - * - * A PRNG plugin must be passed in that will provide: - * - * 1. A function that initializes the key and seed of a PRNG context. It - * will be given a 16 byte key and a 16 byte seed. Any key expansion - * or transformation of the seed from a byte string into an array of - * integers (or similar) should be performed. - * 2. The cryptographic function used by the generator. It takes a key and - * a seed. - * 3. A seed increment function. It takes the seed and returns seed + 1. - * 4. An api to create a message digest. - * - * For an example, see random.js. - * - * @param plugin the PRNG plugin to use. + * Zero bits. + * @memberof util.LongBits + * @type {util.LongBits} */ -prng.create = function(plugin) { - var ctx = { - plugin: plugin, - key: null, - seed: null, - time: null, - // number of reseeds so far - reseeds: 0, - // amount of data generated so far - generated: 0, - // no initial key bytes - keyBytes: '' - }; +var zero = LongBits.zero = new LongBits(0, 0); - // create 32 entropy pools (each is a message digest) - var md = plugin.md; - var pools = new Array(32); - for(var i = 0; i < 32; ++i) { - pools[i] = md.create(); - } - ctx.pools = pools; +zero.toNumber = function() { return 0; }; +zero.zzEncode = zero.zzDecode = function() { return this; }; +zero.length = function() { return 1; }; - // entropy pools are written to cyclically, starting at index 0 - ctx.pool = 0; +/** + * Zero hash. + * @memberof util.LongBits + * @type {string} + */ +var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; - /** - * Generates random bytes. The bytes may be generated synchronously or - * asynchronously. Web workers must use the asynchronous interface or - * else the behavior is undefined. - * - * @param count the number of random bytes to generate. - * @param [callback(err, bytes)] called once the operation completes. - * - * @return count random bytes as a string. - */ - ctx.generate = function(count, callback) { - // do synchronously - if(!callback) { - return ctx.generateSync(count); +/** + * Constructs new long bits from the specified number. + * @param {number} value Value + * @returns {util.LongBits} Instance + */ +LongBits.fromNumber = function fromNumber(value) { + if (value === 0) + return zero; + var sign = value < 0; + if (sign) + value = -value; + var lo = value >>> 0, + hi = (value - lo) / 4294967296 >>> 0; + if (sign) { + hi = ~hi >>> 0; + lo = ~lo >>> 0; + if (++lo > 4294967295) { + lo = 0; + if (++hi > 4294967295) + hi = 0; + } } + return new LongBits(lo, hi); +}; - // simple generator using counter-based CBC - var cipher = ctx.plugin.cipher; - var increment = ctx.plugin.increment; - var formatKey = ctx.plugin.formatKey; - var formatSeed = ctx.plugin.formatSeed; - var b = forge.util.createBuffer(); +/** + * Constructs new long bits from a number, long or string. + * @param {Long|number|string} value Value + * @returns {util.LongBits} Instance + */ +LongBits.from = function from(value) { + if (typeof value === "number") + return LongBits.fromNumber(value); + if (util.isString(value)) { + /* istanbul ignore else */ + if (util.Long) + value = util.Long.fromString(value); + else + return LongBits.fromNumber(parseInt(value, 10)); + } + return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; +}; - // paranoid deviation from Fortuna: - // reset key for every request to protect previously - // generated random bytes should the key be discovered; - // there is no 100ms based reseeding because of this - // forced reseed for every `generate` call - ctx.key = null; +/** + * Converts this long bits to a possibly unsafe JavaScript number. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {number} Possibly unsafe number + */ +LongBits.prototype.toNumber = function toNumber(unsigned) { + if (!unsigned && this.hi >>> 31) { + var lo = ~this.lo + 1 >>> 0, + hi = ~this.hi >>> 0; + if (!lo) + hi = hi + 1 >>> 0; + return -(lo + hi * 4294967296); + } + return this.lo + this.hi * 4294967296; +}; - generate(); +/** + * Converts this long bits to a long. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long} Long + */ +LongBits.prototype.toLong = function toLong(unsigned) { + return util.Long + ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) + /* istanbul ignore next */ + : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; +}; - function generate(err) { - if(err) { - return callback(err); - } +var charCodeAt = String.prototype.charCodeAt; - // sufficient bytes generated - if(b.length() >= count) { - return callback(null, b.getBytes(count)); - } +/** + * Constructs new long bits from the specified 8 characters long hash. + * @param {string} hash Hash + * @returns {util.LongBits} Bits + */ +LongBits.fromHash = function fromHash(hash) { + if (hash === zeroHash) + return zero; + return new LongBits( + ( charCodeAt.call(hash, 0) + | charCodeAt.call(hash, 1) << 8 + | charCodeAt.call(hash, 2) << 16 + | charCodeAt.call(hash, 3) << 24) >>> 0 + , + ( charCodeAt.call(hash, 4) + | charCodeAt.call(hash, 5) << 8 + | charCodeAt.call(hash, 6) << 16 + | charCodeAt.call(hash, 7) << 24) >>> 0 + ); +}; - // if amount of data generated is greater than 1 MiB, trigger reseed - if(ctx.generated > 0xfffff) { - ctx.key = null; - } +/** + * Converts this long bits to a 8 characters long hash. + * @returns {string} Hash + */ +LongBits.prototype.toHash = function toHash() { + return String.fromCharCode( + this.lo & 255, + this.lo >>> 8 & 255, + this.lo >>> 16 & 255, + this.lo >>> 24 , + this.hi & 255, + this.hi >>> 8 & 255, + this.hi >>> 16 & 255, + this.hi >>> 24 + ); +}; - if(ctx.key === null) { - // prevent stack overflow - return forge.util.nextTick(function() { - _reseed(generate); - }); - } +/** + * Zig-zag encodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzEncode = function zzEncode() { + var mask = this.hi >> 31; + this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; + this.lo = ( this.lo << 1 ^ mask) >>> 0; + return this; +}; - // generate the random bytes - var bytes = cipher(ctx.key, ctx.seed); - ctx.generated += bytes.length; - b.putBytes(bytes); +/** + * Zig-zag decodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzDecode = function zzDecode() { + var mask = -(this.lo & 1); + this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; + this.hi = ( this.hi >>> 1 ^ mask) >>> 0; + return this; +}; - // generate bytes for a new key and seed - ctx.key = formatKey(cipher(ctx.key, increment(ctx.seed))); - ctx.seed = formatSeed(cipher(ctx.key, ctx.seed)); +/** + * Calculates the length of this longbits when encoded as a varint. + * @returns {number} Length + */ +LongBits.prototype.length = function length() { + var part0 = this.lo, + part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, + part2 = this.hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 ? 1 : 2 + : part0 < 2097152 ? 3 : 4 + : part1 < 16384 + ? part1 < 128 ? 5 : 6 + : part1 < 2097152 ? 7 : 8 + : part2 < 128 ? 9 : 10; +}; - forge.util.setImmediate(generate); - } - }; - /** - * Generates random bytes synchronously. - * - * @param count the number of random bytes to generate. - * - * @return count random bytes as a string. - */ - ctx.generateSync = function(count) { - // simple generator using counter-based CBC - var cipher = ctx.plugin.cipher; - var increment = ctx.plugin.increment; - var formatKey = ctx.plugin.formatKey; - var formatSeed = ctx.plugin.formatSeed; +/***/ }), - // paranoid deviation from Fortuna: - // reset key for every request to protect previously - // generated random bytes should the key be discovered; - // there is no 100ms based reseeding because of this - // forced reseed for every `generateSync` call - ctx.key = null; +/***/ 70598: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - var b = forge.util.createBuffer(); - while(b.length() < count) { - // if amount of data generated is greater than 1 MiB, trigger reseed - if(ctx.generated > 0xfffff) { - ctx.key = null; - } - if(ctx.key === null) { - _reseedSync(); - } +var util = exports; - // generate the random bytes - var bytes = cipher(ctx.key, ctx.seed); - ctx.generated += bytes.length; - b.putBytes(bytes); +// used to return a Promise where callback is omitted +util.asPromise = __nccwpck_require__(78969); - // generate bytes for a new key and seed - ctx.key = formatKey(cipher(ctx.key, increment(ctx.seed))); - ctx.seed = formatSeed(cipher(ctx.key, ctx.seed)); - } +// converts to / from base64 encoded strings +util.base64 = __nccwpck_require__(57738); - return b.getBytes(count); - }; +// base class of rpc.Service +util.EventEmitter = __nccwpck_require__(62403); - /** - * Private function that asynchronously reseeds a generator. - * - * @param callback(err) called once the operation completes. - */ - function _reseed(callback) { - if(ctx.pools[0].messageLength >= 32) { - _seed(); - return callback(); - } - // not enough seed data... - var needed = (32 - ctx.pools[0].messageLength) << 5; - ctx.seedFile(needed, function(err, bytes) { - if(err) { - return callback(err); - } - ctx.collect(bytes); - _seed(); - callback(); - }); - } +// float handling accross browsers +util.float = __nccwpck_require__(44775); - /** - * Private function that synchronously reseeds a generator. - */ - function _reseedSync() { - if(ctx.pools[0].messageLength >= 32) { - return _seed(); - } - // not enough seed data... - var needed = (32 - ctx.pools[0].messageLength) << 5; - ctx.collect(ctx.seedFileSync(needed)); - _seed(); - } +// requires modules optionally and hides the call from bundlers +util.inquire = __nccwpck_require__(43287); - /** - * Private function that seeds a generator once enough bytes are available. - */ - function _seed() { - // update reseed count - ctx.reseeds = (ctx.reseeds === 0xffffffff) ? 0 : ctx.reseeds + 1; +// converts to / from utf8 encoded strings +util.utf8 = __nccwpck_require__(32581); - // goal is to update `key` via: - // key = hash(key + s) - // where 's' is all collected entropy from selected pools, then... +// provides a node-like buffer pool in the browser +util.pool = __nccwpck_require__(52487); - // create a plugin-based message digest - var md = ctx.plugin.md.create(); +// utility to work with the low and high bits of a 64 bit value +util.LongBits = __nccwpck_require__(13822); - // consume current key bytes - md.update(ctx.keyBytes); +/** + * Whether running within node or not. + * @memberof util + * @type {boolean} + */ +util.isNode = Boolean(typeof global !== "undefined" + && global + && global.process + && global.process.versions + && global.process.versions.node); - // digest the entropy of pools whose index k meet the - // condition 'n mod 2^k == 0' where n is the number of reseeds - var _2powK = 1; - for(var k = 0; k < 32; ++k) { - if(ctx.reseeds % _2powK === 0) { - md.update(ctx.pools[k].digest().getBytes()); - ctx.pools[k].start(); - } - _2powK = _2powK << 1; - } +/** + * Global object reference. + * @memberof util + * @type {Object} + */ +util.global = util.isNode && global + || typeof window !== "undefined" && window + || typeof self !== "undefined" && self + || this; // eslint-disable-line no-invalid-this - // get digest for key bytes - ctx.keyBytes = md.digest().getBytes(); +/** + * An immuable empty array. + * @memberof util + * @type {Array.<*>} + * @const + */ +util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes - // paranoid deviation from Fortuna: - // update `seed` via `seed = hash(key)` - // instead of initializing to zero once and only - // ever incrementing it - md.start(); - md.update(ctx.keyBytes); - var seedBytes = md.digest().getBytes(); +/** + * An immutable empty object. + * @type {Object} + * @const + */ +util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes - // update state - ctx.key = ctx.plugin.formatKey(ctx.keyBytes); - ctx.seed = ctx.plugin.formatSeed(seedBytes); - ctx.generated = 0; - } +/** + * Tests if the specified value is an integer. + * @function + * @param {*} value Value to test + * @returns {boolean} `true` if the value is an integer + */ +util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { + return typeof value === "number" && isFinite(value) && Math.floor(value) === value; +}; - /** - * The built-in default seedFile. This seedFile is used when entropy - * is needed immediately. - * - * @param needed the number of bytes that are needed. - * - * @return the random bytes. - */ - function defaultSeedFile(needed) { - // use window.crypto.getRandomValues strong source of entropy if available - var getRandomValues = null; - var globalScope = forge.util.globalScope; - var _crypto = globalScope.crypto || globalScope.msCrypto; - if(_crypto && _crypto.getRandomValues) { - getRandomValues = function(arr) { - return _crypto.getRandomValues(arr); - }; - } +/** + * Tests if the specified value is a string. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a string + */ +util.isString = function isString(value) { + return typeof value === "string" || value instanceof String; +}; - var b = forge.util.createBuffer(); - if(getRandomValues) { - while(b.length() < needed) { - // max byte length is 65536 before QuotaExceededError is thrown - // http://www.w3.org/TR/WebCryptoAPI/#RandomSource-method-getRandomValues - var count = Math.max(1, Math.min(needed - b.length(), 65536) / 4); - var entropy = new Uint32Array(Math.floor(count)); - try { - getRandomValues(entropy); - for(var i = 0; i < entropy.length; ++i) { - b.putInt32(entropy[i]); - } - } catch(e) { - /* only ignore QuotaExceededError */ - if(!(typeof QuotaExceededError !== 'undefined' && - e instanceof QuotaExceededError)) { - throw e; - } - } - } - } +/** + * Tests if the specified value is a non-null object. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a non-null object + */ +util.isObject = function isObject(value) { + return value && typeof value === "object"; +}; - // be sad and add some weak random data - if(b.length() < needed) { - /* Draws from Park-Miller "minimal standard" 31 bit PRNG, - implemented with David G. Carta's optimization: with 32 bit math - and without division (Public Domain). */ - var hi, lo, next; - var seed = Math.floor(Math.random() * 0x010000); - while(b.length() < needed) { - lo = 16807 * (seed & 0xFFFF); - hi = 16807 * (seed >> 16); - lo += (hi & 0x7FFF) << 16; - lo += hi >> 15; - lo = (lo & 0x7FFFFFFF) + (lo >> 31); - seed = lo & 0xFFFFFFFF; +/** + * Checks if a property on a message is considered to be present. + * This is an alias of {@link util.isSet}. + * @function + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isset = - // consume lower 3 bytes of seed - for(var i = 0; i < 3; ++i) { - // throw in more pseudo random - next = seed >>> (i << 3); - next ^= Math.floor(Math.random() * 0x0100); - b.putByte(next & 0xFF); - } - } - } +/** + * Checks if a property on a message is considered to be present. + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isSet = function isSet(obj, prop) { + var value = obj[prop]; + if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins + return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; + return false; +}; - return b.getBytes(needed); - } - // initialize seed file APIs - if(_crypto) { - // use nodejs async API - ctx.seedFile = function(needed, callback) { - _crypto.randomBytes(needed, function(err, bytes) { - if(err) { - return callback(err); - } - callback(null, bytes.toString()); - }); - }; - // use nodejs sync API - ctx.seedFileSync = function(needed) { - return _crypto.randomBytes(needed).toString(); - }; - } else { - ctx.seedFile = function(needed, callback) { - try { - callback(null, defaultSeedFile(needed)); - } catch(e) { - callback(e); - } - }; - ctx.seedFileSync = defaultSeedFile; - } +/** + * Any compatible Buffer instance. + * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. + * @interface Buffer + * @extends Uint8Array + */ - /** - * Adds entropy to a prng ctx's accumulator. - * - * @param bytes the bytes of entropy as a string. - */ - ctx.collect = function(bytes) { - // iterate over pools distributing entropy cyclically - var count = bytes.length; - for(var i = 0; i < count; ++i) { - ctx.pools[ctx.pool].update(bytes.substr(i, 1)); - ctx.pool = (ctx.pool === 31) ? 0 : ctx.pool + 1; +/** + * Node's Buffer class if available. + * @type {Constructor} + */ +util.Buffer = (function() { + try { + var Buffer = util.inquire("buffer").Buffer; + // refuse to use non-node buffers if not explicitly assigned (perf reasons): + return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; + } catch (e) { + /* istanbul ignore next */ + return null; } - }; +})(); - /** - * Collects an integer of n bits. - * - * @param i the integer entropy. - * @param n the number of bits in the integer. - */ - ctx.collectInt = function(i, n) { - var bytes = ''; - for(var x = 0; x < n; x += 8) { - bytes += String.fromCharCode((i >> x) & 0xFF); - } - ctx.collect(bytes); - }; +// Internal alias of or polyfull for Buffer.from. +util._Buffer_from = null; - /** - * Registers a Web Worker to receive immediate entropy from the main thread. - * This method is required until Web Workers can access the native crypto - * API. This method should be called twice for each created worker, once in - * the main thread, and once in the worker itself. - * - * @param worker the worker to register. - */ - ctx.registerWorker = function(worker) { - // worker receives random bytes - if(worker === self) { - ctx.seedFile = function(needed, callback) { - function listener(e) { - var data = e.data; - if(data.forge && data.forge.prng) { - self.removeEventListener('message', listener); - callback(data.forge.prng.err, data.forge.prng.bytes); - } - } - self.addEventListener('message', listener); - self.postMessage({forge: {prng: {needed: needed}}}); - }; - } else { - // main thread sends random bytes upon request - var listener = function(e) { - var data = e.data; - if(data.forge && data.forge.prng) { - ctx.seedFile(data.forge.prng.needed, function(err, bytes) { - worker.postMessage({forge: {prng: {err: err, bytes: bytes}}}); - }); - } - }; - // TODO: do we need to remove the event listener when the worker dies? - worker.addEventListener('message', listener); - } - }; +// Internal alias of or polyfill for Buffer.allocUnsafe. +util._Buffer_allocUnsafe = null; - return ctx; +/** + * Creates a new buffer of whatever type supported by the environment. + * @param {number|number[]} [sizeOrArray=0] Buffer size or number array + * @returns {Uint8Array|Buffer} Buffer + */ +util.newBuffer = function newBuffer(sizeOrArray) { + /* istanbul ignore next */ + return typeof sizeOrArray === "number" + ? util.Buffer + ? util._Buffer_allocUnsafe(sizeOrArray) + : new util.Array(sizeOrArray) + : util.Buffer + ? util._Buffer_from(sizeOrArray) + : typeof Uint8Array === "undefined" + ? sizeOrArray + : new Uint8Array(sizeOrArray); }; - -/***/ }), - -<<<<<<< HEAD -/***/ 35283: -======= -/***/ 68737: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. + * @type {Constructor} + */ +util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; /** - * An API for getting cryptographically-secure random bytes. The bytes are - * generated using the Fortuna algorithm devised by Bruce Schneier and - * Niels Ferguson. - * - * Getting strong random bytes is not yet easy to do in javascript. The only - * truish random entropy that can be collected is from the mouse, keyboard, or - * from timing with respect to page loads, etc. This generator makes a poor - * attempt at providing random bytes when those sources haven't yet provided - * enough entropy to initially seed or to reseed the PRNG. - * - * @author Dave Longley - * - * Copyright (c) 2009-2014 Digital Bazaar, Inc. + * Any compatible Long instance. + * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. + * @interface Long + * @property {number} low Low bits + * @property {number} high High bits + * @property {boolean} unsigned Whether unsigned or not */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -__nccwpck_require__(25706); -__nccwpck_require__(13809); -__nccwpck_require__(26866); -__nccwpck_require__(19239); -======= -var forge = __nccwpck_require__(96630); -__nccwpck_require__(16606); -__nccwpck_require__(3241); -__nccwpck_require__(37747); -__nccwpck_require__(36536); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -(function() { +/** + * Long.js's Long class if available. + * @type {Constructor} + */ +util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long + || /* istanbul ignore next */ util.global.Long + || util.inquire("long"); -// forge.random already defined -if(forge.random && forge.random.getBytes) { - module.exports = forge.random; - return; -} +/** + * Regular expression used to verify 2 bit (`bool`) map keys. + * @type {RegExp} + * @const + */ +util.key2Re = /^true|false|0|1$/; -(function(jQuery) { +/** + * Regular expression used to verify 32 bit (`int32` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; -// the default prng plugin, uses AES-128 -var prng_aes = {}; -var _prng_aes_output = new Array(4); -var _prng_aes_buffer = forge.util.createBuffer(); -prng_aes.formatKey = function(key) { - // convert the key into 32-bit integers - var tmp = forge.util.createBuffer(key); - key = new Array(4); - key[0] = tmp.getInt32(); - key[1] = tmp.getInt32(); - key[2] = tmp.getInt32(); - key[3] = tmp.getInt32(); +/** + * Regular expression used to verify 64 bit (`int64` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; - // return the expanded key - return forge.aes._expandKey(key, false); -}; -prng_aes.formatSeed = function(seed) { - // convert seed into 32-bit integers - var tmp = forge.util.createBuffer(seed); - seed = new Array(4); - seed[0] = tmp.getInt32(); - seed[1] = tmp.getInt32(); - seed[2] = tmp.getInt32(); - seed[3] = tmp.getInt32(); - return seed; -}; -prng_aes.cipher = function(key, seed) { - forge.aes._updateBlock(key, seed, _prng_aes_output, false); - _prng_aes_buffer.putInt32(_prng_aes_output[0]); - _prng_aes_buffer.putInt32(_prng_aes_output[1]); - _prng_aes_buffer.putInt32(_prng_aes_output[2]); - _prng_aes_buffer.putInt32(_prng_aes_output[3]); - return _prng_aes_buffer.getBytes(); +/** + * Converts a number or long to an 8 characters long hash string. + * @param {Long|number} value Value to convert + * @returns {string} Hash + */ +util.longToHash = function longToHash(value) { + return value + ? util.LongBits.from(value).toHash() + : util.LongBits.zeroHash; }; -prng_aes.increment = function(seed) { - // FIXME: do we care about carry or signed issues? - ++seed[3]; - return seed; + +/** + * Converts an 8 characters long hash string to a long or number. + * @param {string} hash Hash + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long|number} Original value + */ +util.longFromHash = function longFromHash(hash, unsigned) { + var bits = util.LongBits.fromHash(hash); + if (util.Long) + return util.Long.fromBits(bits.lo, bits.hi, unsigned); + return bits.toNumber(Boolean(unsigned)); }; -prng_aes.md = forge.md.sha256; /** - * Creates a new PRNG. + * Merges the properties of the source object into the destination object. + * @memberof util + * @param {Object.} dst Destination object + * @param {Object.} src Source object + * @param {boolean} [ifNotSet=false] Merges only if the key is not already set + * @returns {Object.} Destination object */ -function spawnPrng() { - var ctx = forge.prng.create(prng_aes); +function merge(dst, src, ifNotSet) { // used by converters + for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) + if (dst[keys[i]] === undefined || !ifNotSet) + dst[keys[i]] = src[keys[i]]; + return dst; +} - /** - * Gets random bytes. If a native secure crypto API is unavailable, this - * method tries to make the bytes more unpredictable by drawing from data that - * can be collected from the user of the browser, eg: mouse movement. - * - * If a callback is given, this method will be called asynchronously. - * - * @param count the number of random bytes to get. - * @param [callback(err, bytes)] called once the operation completes. - * - * @return the random bytes in a string. - */ - ctx.getBytes = function(count, callback) { - return ctx.generate(count, callback); - }; +util.merge = merge; - /** - * Gets random bytes asynchronously. If a native secure crypto API is - * unavailable, this method tries to make the bytes more unpredictable by - * drawing from data that can be collected from the user of the browser, - * eg: mouse movement. - * - * @param count the number of random bytes to get. - * - * @return the random bytes in a string. - */ - ctx.getBytesSync = function(count) { - return ctx.generate(count); - }; +/** + * Converts the first character of a string to lower case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.lcFirst = function lcFirst(str) { + return str.charAt(0).toLowerCase() + str.substring(1); +}; - return ctx; -} +/** + * Creates a custom error constructor. + * @memberof util + * @param {string} name Error name + * @returns {Constructor} Custom error constructor + */ +function newError(name) { -// create default prng context -var _ctx = spawnPrng(); + function CustomError(message, properties) { -// add other sources of entropy only if window.crypto.getRandomValues is not -// available -- otherwise this source will be automatically used by the prng -var getRandomValues = null; -var globalScope = forge.util.globalScope; -var _crypto = globalScope.crypto || globalScope.msCrypto; -if(_crypto && _crypto.getRandomValues) { - getRandomValues = function(arr) { - return _crypto.getRandomValues(arr); - }; -} + if (!(this instanceof CustomError)) + return new CustomError(message, properties); -if(forge.options.usePureJavaScript || - (!forge.util.isNodejs && !getRandomValues)) { - // if this is a web worker, do not use weak entropy, instead register to - // receive strong entropy asynchronously from the main thread - if(typeof window === 'undefined' || window.document === undefined) { - // FIXME: - } + // Error.call(this, message); + // ^ just returns a new error instance because the ctor can be called as a function - // get load time entropy - _ctx.collectInt(+new Date(), 32); + Object.defineProperty(this, "message", { get: function() { return message; } }); - // add some entropy from navigator object - if(typeof(navigator) !== 'undefined') { - var _navBytes = ''; - for(var key in navigator) { - try { - if(typeof(navigator[key]) == 'string') { - _navBytes += navigator[key]; - } - } catch(e) { - /* Some navigator keys might not be accessible, e.g. the geolocation - attribute throws an exception if touched in Mozilla chrome:// - context. + /* istanbul ignore next */ + if (Error.captureStackTrace) // node + Error.captureStackTrace(this, CustomError); + else + Object.defineProperty(this, "stack", { value: new Error().stack || "" }); - Silently ignore this and just don't use this as a source of - entropy. */ - } + if (properties) + merge(this, properties); } - _ctx.collect(_navBytes); - _navBytes = null; - } - - // add mouse and keyboard collectors if jquery is available - if(jQuery) { - // set up mouse entropy capture - jQuery().mousemove(function(e) { - // add mouse coords - _ctx.collectInt(e.clientX, 16); - _ctx.collectInt(e.clientY, 16); - }); - // set up keyboard entropy capture - jQuery().keypress(function(e) { - _ctx.collectInt(e.charCode, 8); + CustomError.prototype = Object.create(Error.prototype, { + constructor: { + value: CustomError, + writable: true, + enumerable: false, + configurable: true, + }, + name: { + get: function get() { return name; }, + set: undefined, + enumerable: false, + // configurable: false would accurately preserve the behavior of + // the original, but I'm guessing that was not intentional. + // For an actual error subclass, this property would + // be configurable. + configurable: true, + }, + toString: { + value: function value() { return this.name + ": " + this.message; }, + writable: true, + enumerable: false, + configurable: true, + }, }); - } -} -/* Random API */ -if(!forge.random) { - forge.random = _ctx; -} else { - // extend forge.random with _ctx - for(var key in _ctx) { - forge.random[key] = _ctx[key]; - } + return CustomError; } -// expose spawn PRNG -forge.random.createInstance = spawnPrng; - -module.exports = forge.random; - -})(typeof(jQuery) !== 'undefined' ? jQuery : null); - -})(); +util.newError = newError; +/** + * Constructs a new protocol error. + * @classdesc Error subclass indicating a protocol specifc error. + * @memberof util + * @extends Error + * @template T extends Message + * @constructor + * @param {string} message Error message + * @param {Object.} [properties] Additional properties + * @example + * try { + * MyMessage.decode(someBuffer); // throws if required fields are missing + * } catch (e) { + * if (e instanceof ProtocolError && e.instance) + * console.log("decoded so far: " + JSON.stringify(e.instance)); + * } + */ +util.ProtocolError = newError("ProtocolError"); -/***/ }), +/** + * So far decoded message instance. + * @name util.ProtocolError#instance + * @type {Message} + */ -<<<<<<< HEAD -/***/ 21828: -======= -/***/ 87938: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * A OneOf getter as returned by {@link util.oneOfGetter}. + * @typedef OneOfGetter + * @type {function} + * @returns {string|undefined} Set field name, if any + */ /** - * RC2 implementation. - * - * @author Stefan Siegl - * - * Copyright (c) 2012 Stefan Siegl - * - * Information on the RC2 cipher is available from RFC #2268, - * http://www.ietf.org/rfc/rfc2268.txt + * Builds a getter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfGetter} Unbound getter */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -__nccwpck_require__(19239); -======= -var forge = __nccwpck_require__(96630); -__nccwpck_require__(36536); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +util.oneOfGetter = function getOneOf(fieldNames) { + var fieldMap = {}; + for (var i = 0; i < fieldNames.length; ++i) + fieldMap[fieldNames[i]] = 1; -var piTable = [ - 0xd9, 0x78, 0xf9, 0xc4, 0x19, 0xdd, 0xb5, 0xed, 0x28, 0xe9, 0xfd, 0x79, 0x4a, 0xa0, 0xd8, 0x9d, - 0xc6, 0x7e, 0x37, 0x83, 0x2b, 0x76, 0x53, 0x8e, 0x62, 0x4c, 0x64, 0x88, 0x44, 0x8b, 0xfb, 0xa2, - 0x17, 0x9a, 0x59, 0xf5, 0x87, 0xb3, 0x4f, 0x13, 0x61, 0x45, 0x6d, 0x8d, 0x09, 0x81, 0x7d, 0x32, - 0xbd, 0x8f, 0x40, 0xeb, 0x86, 0xb7, 0x7b, 0x0b, 0xf0, 0x95, 0x21, 0x22, 0x5c, 0x6b, 0x4e, 0x82, - 0x54, 0xd6, 0x65, 0x93, 0xce, 0x60, 0xb2, 0x1c, 0x73, 0x56, 0xc0, 0x14, 0xa7, 0x8c, 0xf1, 0xdc, - 0x12, 0x75, 0xca, 0x1f, 0x3b, 0xbe, 0xe4, 0xd1, 0x42, 0x3d, 0xd4, 0x30, 0xa3, 0x3c, 0xb6, 0x26, - 0x6f, 0xbf, 0x0e, 0xda, 0x46, 0x69, 0x07, 0x57, 0x27, 0xf2, 0x1d, 0x9b, 0xbc, 0x94, 0x43, 0x03, - 0xf8, 0x11, 0xc7, 0xf6, 0x90, 0xef, 0x3e, 0xe7, 0x06, 0xc3, 0xd5, 0x2f, 0xc8, 0x66, 0x1e, 0xd7, - 0x08, 0xe8, 0xea, 0xde, 0x80, 0x52, 0xee, 0xf7, 0x84, 0xaa, 0x72, 0xac, 0x35, 0x4d, 0x6a, 0x2a, - 0x96, 0x1a, 0xd2, 0x71, 0x5a, 0x15, 0x49, 0x74, 0x4b, 0x9f, 0xd0, 0x5e, 0x04, 0x18, 0xa4, 0xec, - 0xc2, 0xe0, 0x41, 0x6e, 0x0f, 0x51, 0xcb, 0xcc, 0x24, 0x91, 0xaf, 0x50, 0xa1, 0xf4, 0x70, 0x39, - 0x99, 0x7c, 0x3a, 0x85, 0x23, 0xb8, 0xb4, 0x7a, 0xfc, 0x02, 0x36, 0x5b, 0x25, 0x55, 0x97, 0x31, - 0x2d, 0x5d, 0xfa, 0x98, 0xe3, 0x8a, 0x92, 0xae, 0x05, 0xdf, 0x29, 0x10, 0x67, 0x6c, 0xba, 0xc9, - 0xd3, 0x00, 0xe6, 0xcf, 0xe1, 0x9e, 0xa8, 0x2c, 0x63, 0x16, 0x01, 0x3f, 0x58, 0xe2, 0x89, 0xa9, - 0x0d, 0x38, 0x34, 0x1b, 0xab, 0x33, 0xff, 0xb0, 0xbb, 0x48, 0x0c, 0x5f, 0xb9, 0xb1, 0xcd, 0x2e, - 0xc5, 0xf3, 0xdb, 0x47, 0xe5, 0xa5, 0x9c, 0x77, 0x0a, 0xa6, 0x20, 0x68, 0xfe, 0x7f, 0xc1, 0xad -]; + /** + * @returns {string|undefined} Set field name, if any + * @this Object + * @ignore + */ + return function() { // eslint-disable-line consistent-return + for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) + if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) + return keys[i]; + }; +}; -var s = [1, 2, 3, 5]; +/** + * A OneOf setter as returned by {@link util.oneOfSetter}. + * @typedef OneOfSetter + * @type {function} + * @param {string|undefined} value Field name + * @returns {undefined} + */ /** - * Rotate a word left by given number of bits. - * - * Bits that are shifted out on the left are put back in on the right - * hand side. - * - * @param word The word to shift left. - * @param bits The number of bits to shift by. - * @return The rotated word. + * Builds a setter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfSetter} Unbound setter */ -var rol = function(word, bits) { - return ((word << bits) & 0xffff) | ((word & 0xffff) >> (16 - bits)); +util.oneOfSetter = function setOneOf(fieldNames) { + + /** + * @param {string} name Field name + * @returns {undefined} + * @this Object + * @ignore + */ + return function(name) { + for (var i = 0; i < fieldNames.length; ++i) + if (fieldNames[i] !== name) + delete this[fieldNames[i]]; + }; }; /** - * Rotate a word right by given number of bits. + * Default conversion options used for {@link Message#toJSON} implementations. * - * Bits that are shifted out on the right are put back in on the left - * hand side. + * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: * - * @param word The word to shift right. - * @param bits The number of bits to shift by. - * @return The rotated word. + * - Longs become strings + * - Enums become string keys + * - Bytes become base64 encoded strings + * - (Sub-)Messages become plain objects + * - Maps become plain objects with all string keys + * - Repeated fields become arrays + * - NaN and Infinity for float and double fields become strings + * + * @type {IConversionOptions} + * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json */ -var ror = function(word, bits) { - return ((word & 0xffff) >> bits) | ((word << (16 - bits)) & 0xffff); +util.toJSONOptions = { + longs: String, + enums: String, + bytes: String, + json: true }; -/* RC2 API */ -module.exports = forge.rc2 = forge.rc2 || {}; +// Sets up buffer utility according to the environment (called in index-minimal) +util._configure = function() { + var Buffer = util.Buffer; + /* istanbul ignore if */ + if (!Buffer) { + util._Buffer_from = util._Buffer_allocUnsafe = null; + return; + } + // because node 4.x buffers are incompatible & immutable + // see: https://github.com/dcodeIO/protobuf.js/pull/665 + util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || + /* istanbul ignore next */ + function Buffer_from(value, encoding) { + return new Buffer(value, encoding); + }; + util._Buffer_allocUnsafe = Buffer.allocUnsafe || + /* istanbul ignore next */ + function Buffer_allocUnsafe(size) { + return new Buffer(size); + }; +}; -/** - * Perform RC2 key expansion as per RFC #2268, section 2. - * - * @param key variable-length user key (between 1 and 128 bytes) - * @param effKeyBits number of effective key bits (default: 128) - * @return the expanded RC2 key (ByteBuffer of 128 bytes) - */ -forge.rc2.expandKey = function(key, effKeyBits) { - if(typeof key === 'string') { - key = forge.util.createBuffer(key); - } - effKeyBits = effKeyBits || 128; - /* introduce variables that match the names used in RFC #2268 */ - var L = key; - var T = key.length(); - var T1 = effKeyBits; - var T8 = Math.ceil(T1 / 8); - var TM = 0xff >> (T1 & 0x07); - var i; +/***/ }), - for(i = T; i < 128; i++) { - L.putByte(piTable[(L.at(i - 1) + L.at(i - T)) & 0xff]); - } +/***/ 38225: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - L.setAt(128 - T8, piTable[L.at(128 - T8) & TM]); - for(i = 127 - T8; i >= 0; i--) { - L.setAt(i, piTable[L.at(i + 1) ^ L.at(i + T8)]); - } +module.exports = Writer; - return L; -}; +var util = __nccwpck_require__(70598); + +var BufferWriter; // cyclic + +var LongBits = util.LongBits, + base64 = util.base64, + utf8 = util.utf8; /** - * Creates a RC2 cipher object. - * - * @param key the symmetric key to use (as base for key generation). - * @param bits the number of effective key bits. - * @param encrypt false for decryption, true for encryption. - * - * @return the cipher. + * Constructs a new writer operation instance. + * @classdesc Scheduled writer operation. + * @constructor + * @param {function(*, Uint8Array, number)} fn Function to call + * @param {number} len Value byte length + * @param {*} val Value to write + * @ignore */ -var createCipher = function(key, bits, encrypt) { - var _finish = false, _input = null, _output = null, _iv = null; - var mixRound, mashRound; - var i, j, K = []; - - /* Expand key and fill into K[] Array */ - key = forge.rc2.expandKey(key, bits); - for(i = 0; i < 64; i++) { - K.push(key.getInt16Le()); - } +function Op(fn, len, val) { - if(encrypt) { /** - * Perform one mixing round "in place". - * - * @param R Array of four words to perform mixing on. + * Function to call. + * @type {function(Uint8Array, number, *)} */ - mixRound = function(R) { - for(i = 0; i < 4; i++) { - R[i] += K[j] + (R[(i + 3) % 4] & R[(i + 2) % 4]) + - ((~R[(i + 3) % 4]) & R[(i + 1) % 4]); - R[i] = rol(R[i], s[i]); - j++; - } - }; + this.fn = fn; /** - * Perform one mashing round "in place". - * - * @param R Array of four words to perform mashing on. + * Value byte length. + * @type {number} */ - mashRound = function(R) { - for(i = 0; i < 4; i++) { - R[i] += K[R[(i + 3) % 4] & 63]; - } - }; - } else { + this.len = len; + /** - * Perform one r-mixing round "in place". - * - * @param R Array of four words to perform mixing on. + * Next operation. + * @type {Writer.Op|undefined} */ - mixRound = function(R) { - for(i = 3; i >= 0; i--) { - R[i] = ror(R[i], s[i]); - R[i] -= K[j] + (R[(i + 3) % 4] & R[(i + 2) % 4]) + - ((~R[(i + 3) % 4]) & R[(i + 1) % 4]); - j--; - } - }; + this.next = undefined; /** - * Perform one r-mashing round "in place". - * - * @param R Array of four words to perform mashing on. + * Value to write. + * @type {*} */ - mashRound = function(R) { - for(i = 3; i >= 0; i--) { - R[i] -= K[R[(i + 3) % 4] & 63]; - } - }; - } - - /** - * Run the specified cipher execution plan. - * - * This function takes four words from the input buffer, applies the IV on - * it (if requested) and runs the provided execution plan. - * - * The plan must be put together in form of a array of arrays. Where the - * outer one is simply a list of steps to perform and the inner one needs - * to have two elements: the first one telling how many rounds to perform, - * the second one telling what to do (i.e. the function to call). - * - * @param {Array} plan The plan to execute. - */ - var runPlan = function(plan) { - var R = []; - - /* Get data from input buffer and fill the four words into R */ - for(i = 0; i < 4; i++) { - var val = _input.getInt16Le(); - - if(_iv !== null) { - if(encrypt) { - /* We're encrypting, apply the IV first. */ - val ^= _iv.getInt16Le(); - } else { - /* We're decryption, keep cipher text for next block. */ - _iv.putInt16Le(val); - } - } - - R.push(val & 0xffff); - } + this.val = val; // type varies +} - /* Reset global "j" variable as per spec. */ - j = encrypt ? 0 : 63; +/* istanbul ignore next */ +function noop() {} // eslint-disable-line no-empty-function - /* Run execution plan. */ - for(var ptr = 0; ptr < plan.length; ptr++) { - for(var ctr = 0; ctr < plan[ptr][0]; ctr++) { - plan[ptr][1](R); - } - } +/** + * Constructs a new writer state instance. + * @classdesc Copied writer state. + * @memberof Writer + * @constructor + * @param {Writer} writer Writer to copy state from + * @ignore + */ +function State(writer) { - /* Write back result to output buffer. */ - for(i = 0; i < 4; i++) { - if(_iv !== null) { - if(encrypt) { - /* We're encrypting in CBC-mode, feed back encrypted bytes into - IV buffer to carry it forward to next block. */ - _iv.putInt16Le(R[i]); - } else { - R[i] ^= _iv.getInt16Le(); - } - } + /** + * Current head. + * @type {Writer.Op} + */ + this.head = writer.head; - _output.putInt16Le(R[i]); - } - }; + /** + * Current tail. + * @type {Writer.Op} + */ + this.tail = writer.tail; - /* Create cipher object */ - var cipher = null; - cipher = { /** - * Starts or restarts the encryption or decryption process, whichever - * was previously configured. - * - * To use the cipher in CBC mode, iv may be given either as a string - * of bytes, or as a byte buffer. For ECB mode, give null as iv. - * - * @param iv the initialization vector to use, null for ECB mode. - * @param output the output the buffer to write to, null to create one. + * Current buffer length. + * @type {number} */ - start: function(iv, output) { - if(iv) { - /* CBC mode */ - if(typeof iv === 'string') { - iv = forge.util.createBuffer(iv); - } - } + this.len = writer.len; - _finish = false; - _input = forge.util.createBuffer(); - _output = output || new forge.util.createBuffer(); - _iv = iv; + /** + * Next state. + * @type {State|null} + */ + this.next = writer.states; +} - cipher.output = _output; - }, +/** + * Constructs a new writer instance. + * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. + * @constructor + */ +function Writer() { /** - * Updates the next block. - * - * @param input the buffer to read from. + * Current length. + * @type {number} */ - update: function(input) { - if(!_finish) { - // not finishing, so fill the input buffer with more input - _input.putBuffer(input); - } - - while(_input.length() >= 8) { - runPlan([ - [ 5, mixRound ], - [ 1, mashRound ], - [ 6, mixRound ], - [ 1, mashRound ], - [ 5, mixRound ] - ]); - } - }, + this.len = 0; /** - * Finishes encrypting or decrypting. - * - * @param pad a padding function to use, null for PKCS#7 padding, - * signature(blockSize, buffer, decrypt). - * - * @return true if successful, false on error. + * Operations head. + * @type {Object} */ - finish: function(pad) { - var rval = true; + this.head = new Op(noop, 0, 0); - if(encrypt) { - if(pad) { - rval = pad(8, _input, !encrypt); - } else { - // add PKCS#7 padding to block (each pad byte is the - // value of the number of pad bytes) - var padding = (_input.length() === 8) ? 8 : (8 - _input.length()); - _input.fillWithByte(padding, padding); - } - } + /** + * Operations tail + * @type {Object} + */ + this.tail = this.head; - if(rval) { - // do final update - _finish = true; - cipher.update(); - } + /** + * Linked forked states. + * @type {Object|null} + */ + this.states = null; - if(!encrypt) { - // check for error: input data not a multiple of block size - rval = (_input.length() === 0); - if(rval) { - if(pad) { - rval = pad(8, _output, !encrypt); - } else { - // ensure padding byte count is valid - var len = _output.length(); - var count = _output.at(len - 1); + // When a value is written, the writer calculates its byte length and puts it into a linked + // list of operations to perform when finish() is called. This both allows us to allocate + // buffers of the exact required size and reduces the amount of work we have to do compared + // to first calculating over objects and then encoding over objects. In our case, the encoding + // part is just a linked list walk calling operations with already prepared values. +} - if(count > len) { - rval = false; - } else { - // trim off padding bytes - _output.truncate(count); - } - } +var create = function create() { + return util.Buffer + ? function create_buffer_setup() { + return (Writer.create = function create_buffer() { + return new BufferWriter(); + })(); } - } + /* istanbul ignore next */ + : function create_array() { + return new Writer(); + }; +}; - return rval; - } - }; +/** + * Creates a new writer. + * @function + * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} + */ +Writer.create = create(); - return cipher; +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ +Writer.alloc = function alloc(size) { + return new util.Array(size); }; +// Use Uint8Array buffer pool in the browser, just like node does with buffers +/* istanbul ignore else */ +if (util.Array !== Array) + Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); + /** - * Creates an RC2 cipher object to encrypt data in ECB or CBC mode using the - * given symmetric key. The output will be stored in the 'output' member - * of the returned cipher. - * - * The key and iv may be given as a string of bytes or a byte buffer. - * The cipher is initialized to use 128 effective key bits. - * - * @param key the symmetric key to use. - * @param iv the initialization vector to use. - * @param output the buffer to write to, null to create one. - * - * @return the cipher. + * Pushes a new operation to the queue. + * @param {function(Uint8Array, number, *)} fn Function to call + * @param {number} len Value byte length + * @param {number} val Value to write + * @returns {Writer} `this` + * @private */ -forge.rc2.startEncrypting = function(key, iv, output) { - var cipher = forge.rc2.createEncryptionCipher(key, 128); - cipher.start(iv, output); - return cipher; +Writer.prototype._push = function push(fn, len, val) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; }; +function writeByte(val, buf, pos) { + buf[pos] = val & 255; +} + +function writeVarint32(val, buf, pos) { + while (val > 127) { + buf[pos++] = val & 127 | 128; + val >>>= 7; + } + buf[pos] = val; +} + /** - * Creates an RC2 cipher object to encrypt data in ECB or CBC mode using the - * given symmetric key. - * - * The key may be given as a string of bytes or a byte buffer. - * - * To start encrypting call start() on the cipher with an iv and optional - * output buffer. - * - * @param key the symmetric key to use. - * - * @return the cipher. + * Constructs a new varint writer operation instance. + * @classdesc Scheduled varint writer operation. + * @extends Op + * @constructor + * @param {number} len Value byte length + * @param {number} val Value to write + * @ignore */ -forge.rc2.createEncryptionCipher = function(key, bits) { - return createCipher(key, bits, true); +function VarintOp(len, val) { + this.len = len; + this.next = undefined; + this.val = val; +} + +VarintOp.prototype = Object.create(Op.prototype); +VarintOp.prototype.fn = writeVarint32; + +/** + * Writes an unsigned 32 bit value as a varint. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.uint32 = function write_uint32(value) { + // here, the call to this.push has been inlined and a varint specific Op subclass is used. + // uint32 is by far the most frequently used operation and benefits significantly from this. + this.len += (this.tail = this.tail.next = new VarintOp( + (value = value >>> 0) + < 128 ? 1 + : value < 16384 ? 2 + : value < 2097152 ? 3 + : value < 268435456 ? 4 + : 5, + value)).len; + return this; }; /** - * Creates an RC2 cipher object to decrypt data in ECB or CBC mode using the - * given symmetric key. The output will be stored in the 'output' member - * of the returned cipher. - * - * The key and iv may be given as a string of bytes or a byte buffer. - * The cipher is initialized to use 128 effective key bits. - * - * @param key the symmetric key to use. - * @param iv the initialization vector to use. - * @param output the buffer to write to, null to create one. - * - * @return the cipher. + * Writes a signed 32 bit value as a varint. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` */ -forge.rc2.startDecrypting = function(key, iv, output) { - var cipher = forge.rc2.createDecryptionCipher(key, 128); - cipher.start(iv, output); - return cipher; +Writer.prototype.int32 = function write_int32(value) { + return value < 0 + ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec + : this.uint32(value); }; /** - * Creates an RC2 cipher object to decrypt data in ECB or CBC mode using the - * given symmetric key. - * - * The key may be given as a string of bytes or a byte buffer. - * - * To start decrypting call start() on the cipher with an iv and optional - * output buffer. - * - * @param key the symmetric key to use. - * - * @return the cipher. + * Writes a 32 bit value as a varint, zig-zag encoded. + * @param {number} value Value to write + * @returns {Writer} `this` */ -forge.rc2.createDecryptionCipher = function(key, bits) { - return createCipher(key, bits, false); +Writer.prototype.sint32 = function write_sint32(value) { + return this.uint32((value << 1 ^ value >> 31) >>> 0); }; +function writeVarint64(val, buf, pos) { + while (val.hi) { + buf[pos++] = val.lo & 127 | 128; + val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = val.lo & 127 | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; +} -/***/ }), +/** + * Writes an unsigned 64 bit value as a varint. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.uint64 = function write_uint64(value) { + var bits = LongBits.from(value); + return this._push(writeVarint64, bits.length(), bits); +}; -<<<<<<< HEAD -/***/ 62646: -======= -/***/ 79626: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * Writes a signed 64 bit value as a varint. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.int64 = Writer.prototype.uint64; /** - * Javascript implementation of basic RSA algorithms. - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. - * - * The only algorithm currently supported for PKI is RSA. - * - * An RSA key is often stored in ASN.1 DER format. The SubjectPublicKeyInfo - * ASN.1 structure is composed of an algorithm of type AlgorithmIdentifier - * and a subjectPublicKey of type bit string. - * - * The AlgorithmIdentifier contains an Object Identifier (OID) and parameters - * for the algorithm, if any. In the case of RSA, there aren't any. - * - * SubjectPublicKeyInfo ::= SEQUENCE { - * algorithm AlgorithmIdentifier, - * subjectPublicKey BIT STRING - * } - * - * AlgorithmIdentifer ::= SEQUENCE { - * algorithm OBJECT IDENTIFIER, - * parameters ANY DEFINED BY algorithm OPTIONAL - * } - * - * For an RSA public key, the subjectPublicKey is: - * - * RSAPublicKey ::= SEQUENCE { - * modulus INTEGER, -- n - * publicExponent INTEGER -- e - * } - * - * PrivateKeyInfo ::= SEQUENCE { - * version Version, - * privateKeyAlgorithm PrivateKeyAlgorithmIdentifier, - * privateKey PrivateKey, - * attributes [0] IMPLICIT Attributes OPTIONAL - * } - * - * Version ::= INTEGER - * PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier - * PrivateKey ::= OCTET STRING - * Attributes ::= SET OF Attribute - * - * An RSA private key as the following structure: - * - * RSAPrivateKey ::= SEQUENCE { - * version Version, - * modulus INTEGER, -- n - * publicExponent INTEGER, -- e - * privateExponent INTEGER, -- d - * prime1 INTEGER, -- p - * prime2 INTEGER, -- q - * exponent1 INTEGER, -- d mod (p-1) - * exponent2 INTEGER, -- d mod (q-1) - * coefficient INTEGER -- (inverse of q) mod p - * } - * - * Version ::= INTEGER - * - * The OID for the RSA key algorithm is: 1.2.840.113549.1.1.1 + * Writes a signed 64 bit value as a varint, zig-zag encoded. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -__nccwpck_require__(1571); -__nccwpck_require__(21686); -__nccwpck_require__(40876); -__nccwpck_require__(96096); -__nccwpck_require__(22679); -__nccwpck_require__(35283); -__nccwpck_require__(19239); -======= -var forge = __nccwpck_require__(96630); -__nccwpck_require__(69197); -__nccwpck_require__(121); -__nccwpck_require__(11750); -__nccwpck_require__(39703); -__nccwpck_require__(93254); -__nccwpck_require__(68737); -__nccwpck_require__(36536); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +Writer.prototype.sint64 = function write_sint64(value) { + var bits = LongBits.from(value).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); +}; -if(typeof BigInteger === 'undefined') { - var BigInteger = forge.jsbn.BigInteger; -} +/** + * Writes a boolish value as a varint. + * @param {boolean} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.bool = function write_bool(value) { + return this._push(writeByte, 1, value ? 1 : 0); +}; -var _crypto = forge.util.isNodejs ? __nccwpck_require__(6113) : null; +function writeFixed32(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} -// shortcut for asn.1 API -var asn1 = forge.asn1; +/** + * Writes an unsigned 32 bit value as fixed 32 bits. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.fixed32 = function write_fixed32(value) { + return this._push(writeFixed32, 4, value >>> 0); +}; -// shortcut for util API -var util = forge.util; +/** + * Writes a signed 32 bit value as fixed 32 bits. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sfixed32 = Writer.prototype.fixed32; -/* - * RSA encryption and decryption, see RFC 2313. +/** + * Writes an unsigned 64 bit value as fixed 64 bits. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. */ -forge.pki = forge.pki || {}; -module.exports = forge.pki.rsa = forge.rsa = forge.rsa || {}; -var pki = forge.pki; +Writer.prototype.fixed64 = function write_fixed64(value) { + var bits = LongBits.from(value); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); +}; -// for finding primes, which are 30k+i for i = 1, 7, 11, 13, 17, 19, 23, 29 -var GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2]; +/** + * Writes a signed 64 bit value as fixed 64 bits. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sfixed64 = Writer.prototype.fixed64; -// validator for a PrivateKeyInfo structure -var privateKeyValidator = { - // PrivateKeyInfo - name: 'PrivateKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // Version (INTEGER) - name: 'PrivateKeyInfo.version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyVersion' - }, { - // privateKeyAlgorithm - name: 'PrivateKeyInfo.privateKeyAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'AlgorithmIdentifier.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'privateKeyOid' - }] - }, { - // PrivateKey - name: 'PrivateKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'privateKey' - }] +/** + * Writes a float (32 bit). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.float = function write_float(value) { + return this._push(util.float.writeFloatLE, 4, value); }; -// validator for an RSA private key -var rsaPrivateKeyValidator = { - // RSAPrivateKey - name: 'RSAPrivateKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // Version (INTEGER) - name: 'RSAPrivateKey.version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyVersion' - }, { - // modulus (n) - name: 'RSAPrivateKey.modulus', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyModulus' - }, { - // publicExponent (e) - name: 'RSAPrivateKey.publicExponent', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyPublicExponent' - }, { - // privateExponent (d) - name: 'RSAPrivateKey.privateExponent', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyPrivateExponent' - }, { - // prime1 (p) - name: 'RSAPrivateKey.prime1', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyPrime1' - }, { - // prime2 (q) - name: 'RSAPrivateKey.prime2', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyPrime2' - }, { - // exponent1 (d mod (p-1)) - name: 'RSAPrivateKey.exponent1', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyExponent1' - }, { - // exponent2 (d mod (q-1)) - name: 'RSAPrivateKey.exponent2', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyExponent2' - }, { - // coefficient ((inverse of q) mod p) - name: 'RSAPrivateKey.coefficient', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyCoefficient' - }] +/** + * Writes a double (64 bit float). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.double = function write_double(value) { + return this._push(util.float.writeDoubleLE, 8, value); }; -// validator for an RSA public key -var rsaPublicKeyValidator = { - // RSAPublicKey - name: 'RSAPublicKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // modulus (n) - name: 'RSAPublicKey.modulus', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'publicKeyModulus' - }, { - // publicExponent (e) - name: 'RSAPublicKey.exponent', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'publicKeyExponent' - }] -}; +var writeBytes = util.Array.prototype.set + ? function writeBytes_set(val, buf, pos) { + buf.set(val, pos); // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytes_for(val, buf, pos) { + for (var i = 0; i < val.length; ++i) + buf[pos + i] = val[i]; + }; -// validator for an SubjectPublicKeyInfo structure -// Note: Currently only works with an RSA public key -var publicKeyValidator = forge.pki.rsa.publicKeyValidator = { - name: 'SubjectPublicKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'subjectPublicKeyInfo', - value: [{ - name: 'SubjectPublicKeyInfo.AlgorithmIdentifier', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'AlgorithmIdentifier.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'publicKeyOid' - }] - }, { - // subjectPublicKey - name: 'SubjectPublicKeyInfo.subjectPublicKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - value: [{ - // RSAPublicKey - name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - optional: true, - captureAsn1: 'rsaPublicKey' - }] - }] +/** + * Writes a sequence of bytes. + * @param {Uint8Array|string} value Buffer or base64 encoded string to write + * @returns {Writer} `this` + */ +Writer.prototype.bytes = function write_bytes(value) { + var len = value.length >>> 0; + if (!len) + return this._push(writeByte, 1, 0); + if (util.isString(value)) { + var buf = Writer.alloc(len = base64.length(value)); + base64.decode(value, buf, 0); + value = buf; + } + return this.uint32(len)._push(writeBytes, len, value); }; -// validator for a DigestInfo structure -var digestInfoValidator = { - name: 'DigestInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'DigestInfo.DigestAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'DigestInfo.DigestAlgorithm.algorithmIdentifier', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'algorithmIdentifier' - }, { - // NULL paramters - name: 'DigestInfo.DigestAlgorithm.parameters', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.NULL, - // captured only to check existence for md2 and md5 - capture: 'parameters', - optional: true, - constructed: false - }] - }, { - // digest - name: 'DigestInfo.digest', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'digest' - }] +/** + * Writes a string. + * @param {string} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.string = function write_string(value) { + var len = utf8.length(value); + return len + ? this.uint32(len)._push(utf8.write, len, value) + : this._push(writeByte, 1, 0); }; /** - * Wrap digest in DigestInfo object. - * - * This function implements EMSA-PKCS1-v1_5-ENCODE as per RFC 3447. - * - * DigestInfo ::= SEQUENCE { - * digestAlgorithm DigestAlgorithmIdentifier, - * digest Digest - * } - * - * DigestAlgorithmIdentifier ::= AlgorithmIdentifier - * Digest ::= OCTET STRING - * - * @param md the message digest object with the hash to sign. - * - * @return the encoded message (ready for RSA encrytion) + * Forks this writer's state by pushing it to a stack. + * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. + * @returns {Writer} `this` */ -var emsaPkcs1v15encode = function(md) { - // get the oid for the algorithm - var oid; - if(md.algorithm in pki.oids) { - oid = pki.oids[md.algorithm]; - } else { - var error = new Error('Unknown message digest algorithm.'); - error.algorithm = md.algorithm; - throw error; - } - var oidBytes = asn1.oidToDer(oid).getBytes(); +Writer.prototype.fork = function fork() { + this.states = new State(this); + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + return this; +}; - // create the digest info - var digestInfo = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - var digestAlgorithm = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - digestAlgorithm.value.push(asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OID, false, oidBytes)); - digestAlgorithm.value.push(asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')); - var digest = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, - false, md.digest().getBytes()); - digestInfo.value.push(digestAlgorithm); - digestInfo.value.push(digest); +/** + * Resets this instance to the last state. + * @returns {Writer} `this` + */ +Writer.prototype.reset = function reset() { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + } + return this; +}; - // encode digest info - return asn1.toDer(digestInfo).getBytes(); +/** + * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. + * @returns {Writer} `this` + */ +Writer.prototype.ldelim = function ldelim() { + var head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; }; /** - * Performs x^c mod n (RSA encryption or decryption operation). - * - * @param x the number to raise and mod. - * @param key the key to use. - * @param pub true if the key is public, false if private. - * - * @return the result of x^c mod n. + * Finishes the write operation. + * @returns {Uint8Array} Finished buffer */ -var _modPow = function(x, key, pub) { - if(pub) { - return x.modPow(key.e, key.n); - } +Writer.prototype.finish = function finish() { + var head = this.head.next, // skip noop + buf = this.constructor.alloc(this.len), + pos = 0; + while (head) { + head.fn(head.val, buf, pos); + pos += head.len; + head = head.next; + } + // this.head = this.tail = null; + return buf; +}; - if(!key.p || !key.q) { - // allow calculation without CRT params (slow) - return x.modPow(key.d, key.n); - } +Writer._configure = function(BufferWriter_) { + BufferWriter = BufferWriter_; + Writer.create = create(); + BufferWriter._configure(); +}; - // pre-compute dP, dQ, and qInv if necessary - if(!key.dP) { - key.dP = key.d.mod(key.p.subtract(BigInteger.ONE)); - } - if(!key.dQ) { - key.dQ = key.d.mod(key.q.subtract(BigInteger.ONE)); - } - if(!key.qInv) { - key.qInv = key.q.modInverse(key.p); - } - /* Chinese remainder theorem (CRT) states: +/***/ }), - Suppose n1, n2, ..., nk are positive integers which are pairwise - coprime (n1 and n2 have no common factors other than 1). For any - integers x1, x2, ..., xk there exists an integer x solving the - system of simultaneous congruences (where ~= means modularly - congruent so a ~= b mod n means a mod n = b mod n): +/***/ 54020: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - x ~= x1 mod n1 - x ~= x2 mod n2 - ... - x ~= xk mod nk - This system of congruences has a single simultaneous solution x - between 0 and n - 1. Furthermore, each xk solution and x itself - is congruent modulo the product n = n1*n2*...*nk. - So x1 mod n = x2 mod n = xk mod n = x mod n. +module.exports = BufferWriter; - The single simultaneous solution x can be solved with the following - equation: +// extends Writer +var Writer = __nccwpck_require__(38225); +(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; - x = sum(xi*ri*si) mod n where ri = n/ni and si = ri^-1 mod ni. +var util = __nccwpck_require__(70598); - Where x is less than n, xi = x mod ni. +/** + * Constructs a new buffer writer instance. + * @classdesc Wire format writer using node buffers. + * @extends Writer + * @constructor + */ +function BufferWriter() { + Writer.call(this); +} - For RSA we are only concerned with k = 2. The modulus n = pq, where - p and q are coprime. The RSA decryption algorithm is: +BufferWriter._configure = function () { + /** + * Allocates a buffer of the specified size. + * @function + * @param {number} size Buffer size + * @returns {Buffer} Buffer + */ + BufferWriter.alloc = util._Buffer_allocUnsafe; - y = x^d mod n + BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" + ? function writeBytesBuffer_set(val, buf, pos) { + buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) + // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytesBuffer_copy(val, buf, pos) { + if (val.copy) // Buffer values + val.copy(buf, pos, 0, val.length); + else for (var i = 0; i < val.length;) // plain array values + buf[pos++] = val[i++]; + }; +}; - Given the above: - x1 = x^d mod p - r1 = n/p = q - s1 = q^-1 mod p - x2 = x^d mod q - r2 = n/q = p - s2 = p^-1 mod q +/** + * @override + */ +BufferWriter.prototype.bytes = function write_bytes_buffer(value) { + if (util.isString(value)) + value = util._Buffer_from(value, "base64"); + var len = value.length >>> 0; + this.uint32(len); + if (len) + this._push(BufferWriter.writeBytesBuffer, len, value); + return this; +}; - So y = (x1r1s1 + x2r2s2) mod n - = ((x^d mod p)q(q^-1 mod p) + (x^d mod q)p(p^-1 mod q)) mod n +function writeStringBuffer(val, buf, pos) { + if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) + util.utf8.write(val, buf, pos); + else if (buf.utf8Write) + buf.utf8Write(val, pos); + else + buf.write(val, pos); +} - According to Fermat's Little Theorem, if the modulus P is prime, - for any integer A not evenly divisible by P, A^(P-1) ~= 1 mod P. - Since A is not divisible by P it follows that if: - N ~= M mod (P - 1), then A^N mod P = A^M mod P. Therefore: +/** + * @override + */ +BufferWriter.prototype.string = function write_string_buffer(value) { + var len = util.Buffer.byteLength(value); + this.uint32(len); + if (len) + this._push(writeStringBuffer, len, value); + return this; +}; - A^N mod P = A^(M mod (P - 1)) mod P. (The latter takes less effort - to calculate). In order to calculate x^d mod p more quickly the - exponent d mod (p - 1) is stored in the RSA private key (the same - is done for x^d mod q). These values are referred to as dP and dQ - respectively. Therefore we now have: - y = ((x^dP mod p)q(q^-1 mod p) + (x^dQ mod q)p(p^-1 mod q)) mod n +/** + * Finishes the write operation. + * @name BufferWriter#finish + * @function + * @returns {Buffer} Finished buffer + */ - Since we'll be reducing x^dP by modulo p (same for q) we can also - reduce x by p (and q respectively) before hand. Therefore, let +BufferWriter._configure(); - xp = ((x mod p)^dP mod p), and - xq = ((x mod q)^dQ mod q), yielding: - y = (xp*q*(q^-1 mod p) + xq*p*(p^-1 mod q)) mod n +/***/ }), - This can be further reduced to a simple algorithm that only - requires 1 inverse (the q inverse is used) to be used and stored. - The algorithm is called Garner's algorithm. If qInv is the - inverse of q, we simply calculate: +/***/ 41108: +/***/ ((module) => { - y = (qInv*(xp - xq) mod p) * q + xq +module.exports = read - However, there are two further complications. First, we need to - ensure that xp > xq to prevent signed BigIntegers from being used - so we add p until this is true (since we will be mod'ing with - p anyway). Then, there is a known timing attack on algorithms - using the CRT. To mitigate this risk, "cryptographic blinding" - should be used. This requires simply generating a random number r - between 0 and n-1 and its inverse and multiplying x by r^e before - calculating y and then multiplying y by r^-1 afterwards. Note that - r must be coprime with n (gcd(r, n) === 1) in order to have an - inverse. - */ +var MSB = 0x80 + , REST = 0x7F + +function read(buf, offset) { + var res = 0 + , offset = offset || 0 + , shift = 0 + , counter = offset + , b + , l = buf.length - // cryptographic blinding - var r; do { - r = new BigInteger( - forge.util.bytesToHex(forge.random.getBytes(key.n.bitLength() / 8)), - 16); - } while(r.compareTo(key.n) >= 0 || !r.gcd(key.n).equals(BigInteger.ONE)); - x = x.multiply(r.modPow(key.e, key.n)).mod(key.n); + if (counter >= l || shift > 49) { + read.bytes = 0 + throw new RangeError('Could not decode varint') + } + b = buf[counter++] + res += shift < 28 + ? (b & REST) << shift + : (b & REST) * Math.pow(2, shift) + shift += 7 + } while (b >= MSB) - // calculate xp and xq - var xp = x.mod(key.p).modPow(key.dP, key.p); - var xq = x.mod(key.q).modPow(key.dQ, key.q); + read.bytes = counter - offset - // xp must be larger than xq to avoid signed bit usage - while(xp.compareTo(xq) < 0) { - xp = xp.add(key.p); - } + return res +} - // do last step - var y = xp.subtract(xq) - .multiply(key.qInv).mod(key.p) - .multiply(key.q).add(xq); - // remove effect of random for cryptographic blinding - y = y.multiply(r.modInverse(key.n)).mod(key.n); +/***/ }), - return y; -}; +/***/ 59557: +/***/ ((module) => { -/** - * NOTE: THIS METHOD IS DEPRECATED, use 'sign' on a private key object or - * 'encrypt' on a public key object instead. - * - * Performs RSA encryption. - * - * The parameter bt controls whether to put padding bytes before the - * message passed in. Set bt to either true or false to disable padding - * completely (in order to handle e.g. EMSA-PSS encoding seperately before), - * signaling whether the encryption operation is a public key operation - * (i.e. encrypting data) or not, i.e. private key operation (data signing). - * - * For PKCS#1 v1.5 padding pass in the block type to use, i.e. either 0x01 - * (for signing) or 0x02 (for encryption). The key operation mode (private - * or public) is derived from this flag in that case). - * - * @param m the message to encrypt as a byte string. - * @param key the RSA key to use. - * @param bt for PKCS#1 v1.5 padding, the block type to use - * (0x01 for private key, 0x02 for public), - * to disable padding: true = public key, false = private key. - * - * @return the encrypted bytes as a string. - */ -pki.rsa.encrypt = function(m, key, bt) { - var pub = bt; - var eb; +module.exports = encode - // get the length of the modulus in bytes - var k = Math.ceil(key.n.bitLength() / 8); +var MSB = 0x80 + , REST = 0x7F + , MSBALL = ~REST + , INT = Math.pow(2, 31) - if(bt !== false && bt !== true) { - // legacy, default to PKCS#1 v1.5 padding - pub = (bt === 0x02); - eb = _encodePkcs1_v1_5(m, key, bt); - } else { - eb = forge.util.createBuffer(); - eb.putBytes(m); +function encode(num, out, offset) { + if (Number.MAX_SAFE_INTEGER && num > Number.MAX_SAFE_INTEGER) { + encode.bytes = 0 + throw new RangeError('Could not encode varint') } + out = out || [] + offset = offset || 0 + var oldOffset = offset - // load encryption block as big integer 'x' - // FIXME: hex conversion inefficient, get BigInteger w/byte strings - var x = new BigInteger(eb.toHex(), 16); - - // do RSA encryption - var y = _modPow(x, key, pub); - - // convert y into the encrypted data byte string, if y is shorter in - // bytes than k, then prepend zero bytes to fill up ed - // FIXME: hex conversion inefficient, get BigInteger w/byte strings - var yhex = y.toString(16); - var ed = forge.util.createBuffer(); - var zeros = k - Math.ceil(yhex.length / 2); - while(zeros > 0) { - ed.putByte(0x00); - --zeros; + while(num >= INT) { + out[offset++] = (num & 0xFF) | MSB + num /= 128 } - ed.putBytes(forge.util.hexToBytes(yhex)); - return ed.getBytes(); -}; + while(num & MSBALL) { + out[offset++] = (num & 0xFF) | MSB + num >>>= 7 + } + out[offset] = num | 0 + + encode.bytes = offset - oldOffset + 1 + + return out +} -/** - * NOTE: THIS METHOD IS DEPRECATED, use 'decrypt' on a private key object or - * 'verify' on a public key object instead. - * - * Performs RSA decryption. - * - * The parameter ml controls whether to apply PKCS#1 v1.5 padding - * or not. Set ml = false to disable padding removal completely - * (in order to handle e.g. EMSA-PSS later on) and simply pass back - * the RSA encryption block. - * - * @param ed the encrypted data to decrypt in as a byte string. - * @param key the RSA key to use. - * @param pub true for a public key operation, false for private. - * @param ml the message length, if known, false to disable padding. - * - * @return the decrypted message as a byte string. - */ -pki.rsa.decrypt = function(ed, key, pub, ml) { - // get the length of the modulus in bytes - var k = Math.ceil(key.n.bitLength() / 8); - // error if the length of the encrypted data ED is not k - if(ed.length !== k) { - var error = new Error('Encrypted message length is invalid.'); - error.length = ed.length; - error.expected = k; - throw error; - } +/***/ }), - // convert encrypted data into a big integer - // FIXME: hex conversion inefficient, get BigInteger w/byte strings - var y = new BigInteger(forge.util.createBuffer(ed).toHex(), 16); +/***/ 57743: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // y must be less than the modulus or it wasn't the result of - // a previous mod operation (encryption) using that modulus - if(y.compareTo(key.n) >= 0) { - throw new Error('Encrypted message is invalid.'); - } +module.exports = { + encode: __nccwpck_require__(59557) + , decode: __nccwpck_require__(41108) + , encodingLength: __nccwpck_require__(94310) +} - // do RSA decryption - var x = _modPow(y, key, pub); - // create the encryption block, if x is shorter in bytes than k, then - // prepend zero bytes to fill up eb - // FIXME: hex conversion inefficient, get BigInteger w/byte strings - var xhex = x.toString(16); - var eb = forge.util.createBuffer(); - var zeros = k - Math.ceil(xhex.length / 2); - while(zeros > 0) { - eb.putByte(0x00); - --zeros; - } - eb.putBytes(forge.util.hexToBytes(xhex)); +/***/ }), - if(ml !== false) { - // legacy, default to PKCS#1 v1.5 padding - return _decodePkcs1_v1_5(eb.getBytes(), key, pub); - } +/***/ 94310: +/***/ ((module) => { - // return message - return eb.getBytes(); -}; -/** - * Creates an RSA key-pair generation state object. It is used to allow - * key-generation to be performed in steps. It also allows for a UI to - * display progress updates. - * - * @param bits the size for the private key in bits, defaults to 2048. - * @param e the public exponent to use, defaults to 65537 (0x10001). - * @param [options] the options to use. - * prng a custom crypto-secure pseudo-random number generator to use, - * that must define "getBytesSync". - * algorithm the algorithm to use (default: 'PRIMEINC'). - * - * @return the state object to use to generate the key-pair. - */ -pki.rsa.createKeyPairGenerationState = function(bits, e, options) { - // TODO: migrate step-based prime generation code to forge.prime +var N1 = Math.pow(2, 7) +var N2 = Math.pow(2, 14) +var N3 = Math.pow(2, 21) +var N4 = Math.pow(2, 28) +var N5 = Math.pow(2, 35) +var N6 = Math.pow(2, 42) +var N7 = Math.pow(2, 49) +var N8 = Math.pow(2, 56) +var N9 = Math.pow(2, 63) - // set default bits - if(typeof(bits) === 'string') { - bits = parseInt(bits, 10); - } - bits = bits || 2048; +module.exports = function (value) { + 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 + ) +} - // create prng with api that matches BigInteger secure random - options = options || {}; - var prng = options.prng || forge.random; - var rng = { - // x is an array to fill with bytes - nextBytes: function(x) { - var b = prng.getBytesSync(x.length); - for(var i = 0; i < x.length; ++i) { - x[i] = b.charCodeAt(i); - } - } - }; - var algorithm = options.algorithm || 'PRIMEINC'; +/***/ }), + +/***/ 85852: +/***/ ((module) => { - // create PRIMEINC algorithm state - var rval; - if(algorithm === 'PRIMEINC') { - rval = { - algorithm: algorithm, - state: 0, - bits: bits, - rng: rng, - eInt: e || 65537, - e: new BigInteger(null), - p: null, - q: null, - qBits: bits >> 1, - pBits: bits - (bits >> 1), - pqState: 0, - num: null, - keys: null - }; - rval.e.fromInt(rval.eInt); - } else { - throw new Error('Invalid key generation algorithm: ' + algorithm); - } - return rval; -}; /** - * Attempts to runs the key-generation algorithm for at most n seconds - * (approximately) using the given state. When key-generation has completed, - * the keys will be stored in state.keys. - * - * To use this function to update a UI while generating a key or to prevent - * causing browser lockups/warnings, set "n" to a value other than 0. A - * simple pattern for generating a key and showing a progress indicator is: - * - * var state = pki.rsa.createKeyPairGenerationState(2048); - * var step = function() { - * // step key-generation, run algorithm for 100 ms, repeat - * if(!forge.pki.rsa.stepKeyPairGenerationState(state, 100)) { - * setTimeout(step, 1); - * } else { - * // key-generation complete - * // TODO: turn off progress indicator here - * // TODO: use the generated key-pair in "state.keys" - * } - * }; - * // TODO: turn on progress indicator here - * setTimeout(step, 0); - * - * @param state the state to use. - * @param n the maximum number of milliseconds to run the algorithm for, 0 - * to run the algorithm to completion. - * - * @return true if the key-generation completed, false if not. + * Turns a browser readable stream into an async iterable. Async iteration over + * returned iterable will lock give stream, preventing any other consumer from + * acquiring a reader. The lock will be released if iteration loop is broken. To + * prevent stream cancelling optional `{ preventCancel: true }` could be passed + * as a second argument. + * @template T + * @param {ReadableStream} stream + * @param {Object} [options] + * @param {boolean} [options.preventCancel=boolean] + * @returns {AsyncIterable} */ -pki.rsa.stepKeyPairGenerationState = function(state, n) { - // set default algorithm if not set - if(!('algorithm' in state)) { - state.algorithm = 'PRIMEINC'; - } +async function * browserReadableStreamToIt (stream, options = {}) { + const reader = stream.getReader() - // TODO: migrate step-based prime generation code to forge.prime - // TODO: abstract as PRIMEINC algorithm + try { + while (true) { + const result = await reader.read() - // do key generation (based on Tom Wu's rsa.js, see jsbn.js license) - // with some minor optimizations and designed to run in steps + if (result.done) { + return + } - // local state vars - var THIRTY = new BigInteger(null); - THIRTY.fromInt(30); - var deltaIdx = 0; - var op_or = function(x, y) {return x | y;}; + yield result.value + } + } finally { + if (options.preventCancel !== true) { + reader.cancel() + } - // keep stepping until time limit is reached or done - var t1 = +new Date(); - var t2; - var total = 0; - while(state.keys === null && (n <= 0 || total < n)) { - // generate p or q - if(state.state === 0) { - /* Note: All primes are of the form: + reader.releaseLock() + } +} - 30k+i, for i < 30 and gcd(30, i)=1, where there are 8 values for i +module.exports = browserReadableStreamToIt - When we generate a random number, we always align it at 30k + 1. Each - time the number is determined not to be prime we add to get to the - next 'i', eg: if the number was at 30k + 1 we add 6. */ - var bits = (state.p === null) ? state.pBits : state.qBits; - var bits1 = bits - 1; - // get a random number - if(state.pqState === 0) { - state.num = new BigInteger(bits, state.rng); - // force MSB set - if(!state.num.testBit(bits1)) { - state.num.bitwiseTo( - BigInteger.ONE.shiftLeft(bits1), op_or, state.num); - } - // align number on 30k+1 boundary - state.num.dAddOffset(31 - state.num.mod(THIRTY).byteValue(), 0); - deltaIdx = 0; +/***/ }), - ++state.pqState; - } else if(state.pqState === 1) { - // try to make the number a prime - if(state.num.bitLength() > bits) { - // overflow, try again - state.pqState = 0; - // do primality test - } else if(state.num.isProbablePrime( - _getMillerRabinTests(state.num.bitLength()))) { - ++state.pqState; - } else { - // get next potential prime - state.num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0); - } - } else if(state.pqState === 2) { - // ensure number is coprime with e - state.pqState = - (state.num.subtract(BigInteger.ONE).gcd(state.e) - .compareTo(BigInteger.ONE) === 0) ? 3 : 0; - } else if(state.pqState === 3) { - // store p or q - state.pqState = 0; - if(state.p === null) { - state.p = state.num; - } else { - state.q = state.num; - } +/***/ 52913: +/***/ ((module) => { - // advance state if both p and q are ready - if(state.p !== null && state.q !== null) { - ++state.state; - } - state.num = null; - } - } else if(state.state === 1) { - // ensure p is larger than q (swap them if not) - if(state.p.compareTo(state.q) < 0) { - state.num = state.p; - state.p = state.q; - state.q = state.num; - } - ++state.state; - } else if(state.state === 2) { - // compute phi: (p - 1)(q - 1) (Euler's totient function) - state.p1 = state.p.subtract(BigInteger.ONE); - state.q1 = state.q.subtract(BigInteger.ONE); - state.phi = state.p1.multiply(state.q1); - ++state.state; - } else if(state.state === 3) { - // ensure e and phi are coprime - if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) === 0) { - // phi and e are coprime, advance - ++state.state; - } else { - // phi and e aren't coprime, so generate a new p and q - state.p = null; - state.q = null; - state.state = 0; - } - } else if(state.state === 4) { - // create n, ensure n is has the right number of bits - state.n = state.p.multiply(state.q); - // ensure n is right number of bits - if(state.n.bitLength() === state.bits) { - // success, advance - ++state.state; - } else { - // failed, get new q - state.q = null; - state.state = 0; - } - } else if(state.state === 5) { - // set keys - var d = state.e.modInverse(state.phi); - state.keys = { - privateKey: pki.rsa.setPrivateKey( - state.n, state.e, d, state.p, state.q, - d.mod(state.p1), d.mod(state.q1), - state.q.modInverse(state.p)), - publicKey: pki.rsa.setPublicKey(state.n, state.e) - }; - } - // update timing - t2 = +new Date(); - total += t2 - t1; - t1 = t2; +/** + * Collects all values from an (async) iterable into an array and returns it. + * + * @template T + * @param {AsyncIterable|Iterable} source + */ +const all = async (source) => { + const arr = [] + + for await (const entry of source) { + arr.push(entry) } - return state.keys !== null; -}; + return arr +} + +module.exports = all + + +/***/ }), + +/***/ 62328: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const fs = (__nccwpck_require__(57147).promises) +const path = __nccwpck_require__(71017) +const minimatch = __nccwpck_require__(2372) /** - * Generates an RSA public-private key pair in a single call. - * - * To generate a key-pair in steps (to allow for progress updates and to - * prevent blocking or warnings in slow browsers) then use the key-pair - * generation state functions. - * - * To generate a key-pair asynchronously (either through web-workers, if - * available, or by breaking up the work on the main thread), pass a - * callback function. + * @typedef {string} Glob + * @typedef {object} OptionsExt + * @property {string} [cwd=process.cwd()] + * @property {boolean} [absolute=false] - If true produces absolute paths + * @property {boolean} [nodir] - If true yields file paths and skip directories * - * @param [bits] the size for the private key in bits, defaults to 2048. - * @param [e] the public exponent to use, defaults to 65537. - * @param [options] options for key-pair generation, if given then 'bits' - * and 'e' must *not* be given: - * bits the size for the private key in bits, (default: 2048). - * e the public exponent to use, (default: 65537 (0x10001)). - * workerScript the worker script URL. - * workers the number of web workers (if supported) to use, - * (default: 2). - * workLoad the size of the work load, ie: number of possible prime - * numbers for each web worker to check per work assignment, - * (default: 100). - * prng a custom crypto-secure pseudo-random number generator to use, - * that must define "getBytesSync". Disables use of native APIs. - * algorithm the algorithm to use (default: 'PRIMEINC'). - * @param [callback(err, keypair)] called once the operation completes. + * @typedef {OptionsExt & minimatch.IOptions} Options + */ + +/** + * Async iterable filename pattern matcher * - * @return an object with privateKey and publicKey properties. + * @param {string} dir + * @param {string} pattern + * @param {Options} [options] + * @returns {AsyncIterable} */ -pki.rsa.generateKeyPair = function(bits, e, options, callback) { - // (bits), (options), (callback) - if(arguments.length === 1) { - if(typeof bits === 'object') { - options = bits; - bits = undefined; - } else if(typeof bits === 'function') { - callback = bits; - bits = undefined; - } - } else if(arguments.length === 2) { - // (bits, e), (bits, options), (bits, callback), (options, callback) - if(typeof bits === 'number') { - if(typeof e === 'function') { - callback = e; - e = undefined; - } else if(typeof e !== 'number') { - options = e; - e = undefined; - } - } else { - options = bits; - callback = e; - bits = undefined; - e = undefined; - } - } else if(arguments.length === 3) { - // (bits, e, options), (bits, e, callback), (bits, options, callback) - if(typeof e === 'number') { - if(typeof options === 'function') { - callback = options; - options = undefined; - } - } else { - callback = options; - options = e; - e = undefined; - } - } - options = options || {}; - if(bits === undefined) { - bits = options.bits || 2048; - } - if(e === undefined) { - e = options.e || 0x10001; - } +async function * glob (dir, pattern, options = {}) { + const absoluteDir = path.resolve(dir) + const relativeDir = path.relative(options.cwd || process.cwd(), dir) - // use native code if permitted, available, and parameters are acceptable - if(!forge.options.usePureJavaScript && !options.prng && - bits >= 256 && bits <= 16384 && (e === 0x10001 || e === 3)) { - if(callback) { - // try native async - if(_detectNodeCrypto('generateKeyPair')) { - return _crypto.generateKeyPair('rsa', { - modulusLength: bits, - publicExponent: e, - publicKeyEncoding: { - type: 'spki', - format: 'pem' - }, - privateKeyEncoding: { - type: 'pkcs8', - format: 'pem' - } - }, function(err, pub, priv) { - if(err) { - return callback(err); - } - callback(null, { - privateKey: pki.privateKeyFromPem(priv), - publicKey: pki.publicKeyFromPem(pub) - }); - }); - } - if(_detectSubtleCrypto('generateKey') && - _detectSubtleCrypto('exportKey')) { - // use standard native generateKey - return util.globalScope.crypto.subtle.generateKey({ - name: 'RSASSA-PKCS1-v1_5', - modulusLength: bits, - publicExponent: _intToUint8Array(e), - hash: {name: 'SHA-256'} - }, true /* key can be exported*/, ['sign', 'verify']) - .then(function(pair) { - return util.globalScope.crypto.subtle.exportKey( - 'pkcs8', pair.privateKey); - // avoiding catch(function(err) {...}) to support IE <= 8 - }).then(undefined, function(err) { - callback(err); - }).then(function(pkcs8) { - if(pkcs8) { - var privateKey = pki.privateKeyFromAsn1( - asn1.fromDer(forge.util.createBuffer(pkcs8))); - callback(null, { - privateKey: privateKey, - publicKey: pki.setRsaPublicKey(privateKey.n, privateKey.e) - }); - } - }); - } - if(_detectSubtleMsCrypto('generateKey') && - _detectSubtleMsCrypto('exportKey')) { - var genOp = util.globalScope.msCrypto.subtle.generateKey({ - name: 'RSASSA-PKCS1-v1_5', - modulusLength: bits, - publicExponent: _intToUint8Array(e), - hash: {name: 'SHA-256'} - }, true /* key can be exported*/, ['sign', 'verify']); - genOp.oncomplete = function(e) { - var pair = e.target.result; - var exportOp = util.globalScope.msCrypto.subtle.exportKey( - 'pkcs8', pair.privateKey); - exportOp.oncomplete = function(e) { - var pkcs8 = e.target.result; - var privateKey = pki.privateKeyFromAsn1( - asn1.fromDer(forge.util.createBuffer(pkcs8))); - callback(null, { - privateKey: privateKey, - publicKey: pki.setRsaPublicKey(privateKey.n, privateKey.e) - }); - }; - exportOp.onerror = function(err) { - callback(err); - }; - }; - genOp.onerror = function(err) { - callback(err); - }; - return; - } - } else { - // try native sync - if(_detectNodeCrypto('generateKeyPairSync')) { - var keypair = _crypto.generateKeyPairSync('rsa', { - modulusLength: bits, - publicExponent: e, - publicKeyEncoding: { - type: 'spki', - format: 'pem' - }, - privateKeyEncoding: { - type: 'pkcs8', - format: 'pem' - } - }); - return { - privateKey: pki.privateKeyFromPem(keypair.privateKey), - publicKey: pki.publicKeyFromPem(keypair.publicKey) - }; - } + const stats = await fs.stat(absoluteDir) + + if (stats.isDirectory()) { + for await (const entry of _glob(absoluteDir, '', pattern, options)) { + yield entry } + + return } - // use JavaScript implementation - var state = pki.rsa.createKeyPairGenerationState(bits, e, options); - if(!callback) { - pki.rsa.stepKeyPairGenerationState(state, 0); - return state.keys; + if (minimatch(relativeDir, pattern, options)) { + yield options.absolute ? absoluteDir : relativeDir } - _generateKeyPair(state, options, callback); -}; +} /** - * Sets an RSA public key from BigIntegers modulus and exponent. - * - * @param n the modulus. - * @param e the exponent. - * - * @return the public key. + * @param {string} base + * @param {string} dir + * @param {Glob} pattern + * @param {Options} options + * @returns {AsyncIterable} */ -pki.setRsaPublicKey = pki.rsa.setPublicKey = function(n, e) { - var key = { - n: n, - e: e - }; +async function * _glob (base, dir, pattern, options) { + for await (const entry of await fs.opendir(path.join(base, dir))) { + const relativeEntryPath = path.join(dir, entry.name) + const absoluteEntryPath = path.join(base, dir, entry.name) - /** - * Encrypts the given data with this public key. Newer applications - * should use the 'RSA-OAEP' decryption scheme, 'RSAES-PKCS1-V1_5' is for - * legacy applications. - * - * @param data the byte string to encrypt. - * @param scheme the encryption scheme to use: - * 'RSAES-PKCS1-V1_5' (default), - * 'RSA-OAEP', - * 'RAW', 'NONE', or null to perform raw RSA encryption, - * an object with an 'encode' property set to a function - * with the signature 'function(data, key)' that returns - * a binary-encoded string representing the encoded data. - * @param schemeOptions any scheme-specific options. - * - * @return the encrypted byte string. - */ - key.encrypt = function(data, scheme, schemeOptions) { - if(typeof scheme === 'string') { - scheme = scheme.toUpperCase(); - } else if(scheme === undefined) { - scheme = 'RSAES-PKCS1-V1_5'; + let match = minimatch(relativeEntryPath, pattern, options) + + const isDirectory = entry.isDirectory() + + if (isDirectory && options.nodir) { + match = false } - if(scheme === 'RSAES-PKCS1-V1_5') { - scheme = { - encode: function(m, key, pub) { - return _encodePkcs1_v1_5(m, key, 0x02).getBytes(); - } - }; - } else if(scheme === 'RSA-OAEP' || scheme === 'RSAES-OAEP') { - scheme = { - encode: function(m, key) { - return forge.pkcs1.encode_rsa_oaep(key, m, schemeOptions); - } - }; - } else if(['RAW', 'NONE', 'NULL', null].indexOf(scheme) !== -1) { - scheme = {encode: function(e) {return e;}}; - } else if(typeof scheme === 'string') { - throw new Error('Unsupported encryption scheme: "' + scheme + '".'); + if (match) { + yield options.absolute ? absoluteEntryPath : relativeEntryPath } - // do scheme-based encoding then rsa encryption - var e = scheme.encode(data, key, true); - return pki.rsa.encrypt(e, key, true); - }; + if (isDirectory) { + yield * _glob(base, relativeEntryPath, pattern, options) + } + } +} + +module.exports = glob + + +/***/ }), + +/***/ 45221: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + +const isElectron = __nccwpck_require__(59548) + +const IS_ENV_WITH_DOM = typeof window === 'object' && typeof document === 'object' && document.nodeType === 9 +// @ts-ignore +const IS_ELECTRON = isElectron() +const IS_BROWSER = IS_ENV_WITH_DOM && !IS_ELECTRON +const IS_ELECTRON_MAIN = IS_ELECTRON && !IS_ENV_WITH_DOM +const IS_ELECTRON_RENDERER = IS_ELECTRON && IS_ENV_WITH_DOM +const IS_NODE = true && typeof process !== 'undefined' && typeof process.release !== 'undefined' && process.release.name === 'node' && !IS_ELECTRON +// @ts-ignore - we either ignore worker scope or dom scope +const IS_WEBWORKER = typeof importScripts === 'function' && typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope +const IS_TEST = typeof process !== 'undefined' && typeof process.env !== 'undefined' && process.env.NODE_ENV === 'test' +const IS_REACT_NATIVE = typeof navigator !== 'undefined' && navigator.product === 'ReactNative' +module.exports = { + isTest: IS_TEST, + isElectron: IS_ELECTRON, + isElectronMain: IS_ELECTRON_MAIN, + isElectronRenderer: IS_ELECTRON_RENDERER, + isNode: IS_NODE, /** - * Verifies the given signature against the given digest. - * - * PKCS#1 supports multiple (currently two) signature schemes: - * RSASSA-PKCS1-V1_5 and RSASSA-PSS. - * - * By default this implementation uses the "old scheme", i.e. - * RSASSA-PKCS1-V1_5, in which case once RSA-decrypted, the - * signature is an OCTET STRING that holds a DigestInfo. - * - * DigestInfo ::= SEQUENCE { - * digestAlgorithm DigestAlgorithmIdentifier, - * digest Digest - * } - * DigestAlgorithmIdentifier ::= AlgorithmIdentifier - * Digest ::= OCTET STRING - * - * To perform PSS signature verification, provide an instance - * of Forge PSS object as the scheme parameter. - * - * @param digest the message digest hash to compare against the signature, - * as a binary-encoded string. - * @param signature the signature to verify, as a binary-encoded string. - * @param scheme signature verification scheme to use: - * 'RSASSA-PKCS1-V1_5' or undefined for RSASSA PKCS#1 v1.5, - * a Forge PSS object for RSASSA-PSS, - * 'NONE' or null for none, DigestInfo will not be expected, but - * PKCS#1 v1.5 padding will still be used. - * @param options optional verify options - * _parseAllDigestBytes testing flag to control parsing of all - * digest bytes. Unsupported and not for general usage. - * (default: true) - * - * @return true if the signature was verified, false if not. + * Detects browser main thread **NOT** web worker or service worker */ - key.verify = function(digest, signature, scheme, options) { - if(typeof scheme === 'string') { - scheme = scheme.toUpperCase(); - } else if(scheme === undefined) { - scheme = 'RSASSA-PKCS1-V1_5'; - } - if(options === undefined) { - options = { - _parseAllDigestBytes: true - }; - } - if(!('_parseAllDigestBytes' in options)) { - options._parseAllDigestBytes = true; - } + isBrowser: IS_BROWSER, + isWebWorker: IS_WEBWORKER, + isEnvWithDom: IS_ENV_WITH_DOM, + isReactNative: IS_REACT_NATIVE +} - if(scheme === 'RSASSA-PKCS1-V1_5') { - scheme = { - verify: function(digest, d) { - // remove padding - d = _decodePkcs1_v1_5(d, key, true); - // d is ASN.1 BER-encoded DigestInfo - var obj = asn1.fromDer(d, { - parseAllBytes: options._parseAllDigestBytes - }); - // validate DigestInfo - var capture = {}; - var errors = []; - if(!asn1.validate(obj, digestInfoValidator, capture, errors)) { - var error = new Error( - 'ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 ' + - 'DigestInfo value.'); - error.errors = errors; - throw error; - } - // check hash algorithm identifier - // see PKCS1-v1-5DigestAlgorithms in RFC 8017 - // FIXME: add support to vaidator for strict value choices - var oid = asn1.derToOid(capture.algorithmIdentifier); - if(!(oid === forge.oids.md2 || - oid === forge.oids.md5 || - oid === forge.oids.sha1 || - oid === forge.oids.sha224 || - oid === forge.oids.sha256 || - oid === forge.oids.sha384 || - oid === forge.oids.sha512 || - oid === forge.oids['sha512-224'] || - oid === forge.oids['sha512-256'])) { - var error = new Error( - 'Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.'); - error.oid = oid; - throw error; - } +/***/ }), - // special check for md2 and md5 that NULL parameters exist - if(oid === forge.oids.md2 || oid === forge.oids.md5) { - if(!('parameters' in capture)) { - throw new Error( - 'ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 ' + - 'DigestInfo value. ' + - 'Missing algorithm identifer NULL parameters.'); - } - } +/***/ 50977: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // compare the given digest to the decrypted one - return digest === capture.digest; - } - }; - } else if(scheme === 'NONE' || scheme === 'NULL' || scheme === null) { - scheme = { - verify: function(digest, d) { - // remove padding - d = _decodePkcs1_v1_5(d, key, true); - return digest === d; - } - }; - } - // do rsa decryption w/o any decoding, then verify -- which does decoding - var d = pki.rsa.decrypt(signature, key, true, false); - return scheme.verify(digest, d, key.n.bitLength()); - }; - return key; -}; +/** + * @typedef {globalThis.Headers} Headers + * @typedef {globalThis.Request} Request + * @typedef {globalThis.Response} Response + */ + +const { isElectronMain } = __nccwpck_require__(45221) + +// use window.fetch if it is available, fall back to node-fetch if not +let impl = 'native-fetch' + +if (isElectronMain) { + impl = 'electron-fetch' +} + +module.exports = __nccwpck_require__(28435) + + +/***/ }), + +/***/ 5160: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const fsp = (__nccwpck_require__(57147).promises) +const fs = __nccwpck_require__(57147) +const glob = __nccwpck_require__(62328) +const Path = __nccwpck_require__(71017) +const errCode = __nccwpck_require__(18598) /** - * Sets an RSA private key from BigIntegers modulus, exponent, primes, - * prime exponents, and modular multiplicative inverse. - * - * @param n the modulus. - * @param e the public exponent. - * @param d the private exponent ((inverse of e) mod n). - * @param p the first prime. - * @param q the second prime. - * @param dP exponent1 (d mod (p-1)). - * @param dQ exponent2 (d mod (q-1)). - * @param qInv ((inverse of q) mod p) + * Create an async iterator that yields paths that match requested glob pattern * - * @return the private key. + * @param {string} cwd - The directory to start matching the pattern in + * @param {string} pattern - Glob pattern to match + * @param {import('../types').GlobSourceOptions} [options] - Optional options + * @returns {AsyncGenerator} File objects that match glob */ -pki.setRsaPrivateKey = pki.rsa.setPrivateKey = function( - n, e, d, p, q, dP, dQ, qInv) { - var key = { - n: n, - e: e, - d: d, - p: p, - q: q, - dP: dP, - dQ: dQ, - qInv: qInv - }; +module.exports = async function * globSource (cwd, pattern, options) { + options = options || {} - /** - * Decrypts the given data with this private key. The decryption scheme - * must match the one used to encrypt the data. - * - * @param data the byte string to decrypt. - * @param scheme the decryption scheme to use: - * 'RSAES-PKCS1-V1_5' (default), - * 'RSA-OAEP', - * 'RAW', 'NONE', or null to perform raw RSA decryption. - * @param schemeOptions any scheme-specific options. - * - * @return the decrypted byte string. - */ - key.decrypt = function(data, scheme, schemeOptions) { - if(typeof scheme === 'string') { - scheme = scheme.toUpperCase(); - } else if(scheme === undefined) { - scheme = 'RSAES-PKCS1-V1_5'; - } + if (typeof pattern !== 'string') { + throw errCode( + new Error('Pattern must be a string'), + 'ERR_INVALID_PATH', + { pattern } + ) + } - // do rsa decryption w/o any decoding - var d = pki.rsa.decrypt(data, key, false, false); + if (!Path.isAbsolute(cwd)) { + cwd = Path.resolve(process.cwd(), cwd) + } - if(scheme === 'RSAES-PKCS1-V1_5') { - scheme = {decode: _decodePkcs1_v1_5}; - } else if(scheme === 'RSA-OAEP' || scheme === 'RSAES-OAEP') { - scheme = { - decode: function(d, key) { - return forge.pkcs1.decode_rsa_oaep(key, d, schemeOptions); - } - }; - } else if(['RAW', 'NONE', 'NULL', null].indexOf(scheme) !== -1) { - scheme = {decode: function(d) {return d;}}; - } else { - throw new Error('Unsupported encryption scheme: "' + scheme + '".'); - } + const globOptions = Object.assign({}, { + nodir: false, + realpath: false, + absolute: true, + dot: Boolean(options.hidden), + follow: options.followSymlinks != null ? options.followSymlinks : true + }) - // decode according to scheme - return scheme.decode(d, key, false); - }; + for await (const p of glob(cwd, pattern, globOptions)) { + const stat = await fsp.stat(p) - /** - * Signs the given digest, producing a signature. - * - * PKCS#1 supports multiple (currently two) signature schemes: - * RSASSA-PKCS1-V1_5 and RSASSA-PSS. - * - * By default this implementation uses the "old scheme", i.e. - * RSASSA-PKCS1-V1_5. In order to generate a PSS signature, provide - * an instance of Forge PSS object as the scheme parameter. - * - * @param md the message digest object with the hash to sign. - * @param scheme the signature scheme to use: - * 'RSASSA-PKCS1-V1_5' or undefined for RSASSA PKCS#1 v1.5, - * a Forge PSS object for RSASSA-PSS, - * 'NONE' or null for none, DigestInfo will not be used but - * PKCS#1 v1.5 padding will still be used. - * - * @return the signature as a byte string. - */ - key.sign = function(md, scheme) { - /* Note: The internal implementation of RSA operations is being - transitioned away from a PKCS#1 v1.5 hard-coded scheme. Some legacy - code like the use of an encoding block identifier 'bt' will eventually - be removed. */ + let mode = options.mode - // private key operation - var bt = false; + if (options.preserveMode) { + mode = stat.mode + } - if(typeof scheme === 'string') { - scheme = scheme.toUpperCase(); + let mtime = options.mtime + + if (options.preserveMtime) { + mtime = stat.mtime } - if(scheme === undefined || scheme === 'RSASSA-PKCS1-V1_5') { - scheme = {encode: emsaPkcs1v15encode}; - bt = 0x01; - } else if(scheme === 'NONE' || scheme === 'NULL' || scheme === null) { - scheme = {encode: function() {return md;}}; - bt = 0x01; + yield { + path: toPosix(p.replace(cwd, '')), + content: stat.isFile() ? fs.createReadStream(p) : undefined, + mode, + mtime } + } +} - // encode and then encrypt - var d = scheme.encode(md, key.n.bitLength()); - return pki.rsa.encrypt(d, key, bt); - }; +/** + * @param {string} path + */ +const toPosix = path => path.replace(/\\/g, '/') + + +/***/ }), + +/***/ 47598: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return key; -}; + + +const HTTP = __nccwpck_require__(36264) /** - * Wraps an RSAPrivateKey ASN.1 object in an ASN.1 PrivateKeyInfo object. - * - * @param rsaKey the ASN.1 RSAPrivateKey. * - * @return the ASN.1 PrivateKeyInfo. + * @param {string} url + * @param {import("../types").HTTPOptions} [options] + * @returns {{ path: string; content?: AsyncIterable }} */ -pki.wrapRsaPrivateKey = function(rsaKey) { - // PrivateKeyInfo - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version (0) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(0).getBytes()), - // privateKeyAlgorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.rsaEncryption).getBytes()), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ]), - // PrivateKey - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - asn1.toDer(rsaKey).getBytes()) - ]); -}; +const urlSource = (url, options) => { + return { + path: decodeURIComponent(new URL(url).pathname.split('/').pop() || ''), + content: readURLContent(url, options) + } +} /** - * Converts a private key from an ASN.1 object. - * - * @param obj the ASN.1 representation of a PrivateKeyInfo containing an - * RSAPrivateKey or an RSAPrivateKey. * - * @return the private key. + * @param {string} url + * @param {import("../types").HTTPOptions} [options] + * @returns {AsyncIterable} */ -pki.privateKeyFromAsn1 = function(obj) { - // get PrivateKeyInfo - var capture = {}; - var errors = []; - if(asn1.validate(obj, privateKeyValidator, capture, errors)) { - obj = asn1.fromDer(forge.util.createBuffer(capture.privateKey)); - } +async function * readURLContent (url, options) { + const http = new HTTP() + const response = await http.get(url, options) - // get RSAPrivateKey - capture = {}; - errors = []; - if(!asn1.validate(obj, rsaPrivateKeyValidator, capture, errors)) { - var error = new Error('Cannot read private key. ' + - 'ASN.1 object does not contain an RSAPrivateKey.'); - error.errors = errors; - throw error; - } + yield * response.iterator() +} - // Note: Version is currently ignored. - // capture.privateKeyVersion - // FIXME: inefficient, get a BigInteger that uses byte strings - var n, e, d, p, q, dP, dQ, qInv; - n = forge.util.createBuffer(capture.privateKeyModulus).toHex(); - e = forge.util.createBuffer(capture.privateKeyPublicExponent).toHex(); - d = forge.util.createBuffer(capture.privateKeyPrivateExponent).toHex(); - p = forge.util.createBuffer(capture.privateKeyPrime1).toHex(); - q = forge.util.createBuffer(capture.privateKeyPrime2).toHex(); - dP = forge.util.createBuffer(capture.privateKeyExponent1).toHex(); - dQ = forge.util.createBuffer(capture.privateKeyExponent2).toHex(); - qInv = forge.util.createBuffer(capture.privateKeyCoefficient).toHex(); +module.exports = urlSource - // set private key - return pki.setRsaPrivateKey( - new BigInteger(n, 16), - new BigInteger(e, 16), - new BigInteger(d, 16), - new BigInteger(p, 16), - new BigInteger(q, 16), - new BigInteger(dP, 16), - new BigInteger(dQ, 16), - new BigInteger(qInv, 16)); -}; + +/***/ }), + +/***/ 36264: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/* eslint-disable no-undef */ + + +const { fetch, Request, Headers } = __nccwpck_require__(90252) +const { TimeoutError, HTTPError } = __nccwpck_require__(81918) +const merge = (__nccwpck_require__(70395).bind)({ ignoreUndefined: true }) +const { URL, URLSearchParams } = __nccwpck_require__(85067) +const anySignal = __nccwpck_require__(14577) +const browserReableStreamToIt = __nccwpck_require__(85852) +const { isBrowser, isWebWorker } = __nccwpck_require__(45221) +const all = __nccwpck_require__(52913) /** - * Converts a private key to an ASN.1 RSAPrivateKey. - * - * @param key the private key. - * - * @return the ASN.1 representation of an RSAPrivateKey. + * @typedef {import('stream').Readable} NodeReadableStream + * @typedef {import('./types').HTTPOptions} HTTPOptions + * @typedef {import('./types').ExtendedResponse} ExtendedResponse */ -pki.privateKeyToAsn1 = pki.privateKeyToRSAPrivateKey = function(key) { - // RSAPrivateKey - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version (0 = only 2 primes, 1 multiple primes) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(0).getBytes()), - // modulus (n) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.n)), - // publicExponent (e) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.e)), - // privateExponent (d) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.d)), - // privateKeyPrime1 (p) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.p)), - // privateKeyPrime2 (q) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.q)), - // privateKeyExponent1 (dP) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.dP)), - // privateKeyExponent2 (dQ) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.dQ)), - // coefficient (qInv) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.qInv)) - ]); -}; /** - * Converts a public key from an ASN.1 SubjectPublicKeyInfo or RSAPublicKey. - * - * @param obj the asn1 representation of a SubjectPublicKeyInfo or RSAPublicKey. - * - * @return the public key. + * @template TResponse + * @param {Promise} promise + * @param {number | undefined} ms + * @param {AbortController} abortController + * @returns {Promise} */ -pki.publicKeyFromAsn1 = function(obj) { - // get SubjectPublicKeyInfo - var capture = {}; - var errors = []; - if(asn1.validate(obj, publicKeyValidator, capture, errors)) { - // get oid - var oid = asn1.derToOid(capture.publicKeyOid); - if(oid !== pki.oids.rsaEncryption) { - var error = new Error('Cannot read public key. Unknown OID.'); - error.oid = oid; - throw error; - } - obj = capture.rsaPublicKey; +const timeout = (promise, ms, abortController) => { + if (ms === undefined) { + return promise } - // get RSA params - errors = []; - if(!asn1.validate(obj, rsaPublicKeyValidator, capture, errors)) { - var error = new Error('Cannot read public key. ' + - 'ASN.1 object does not contain an RSAPublicKey.'); - error.errors = errors; - throw error; + const start = Date.now() + + const timedOut = () => { + const time = Date.now() - start + + return time >= ms } - // FIXME: inefficient, get a BigInteger that uses byte strings - var n = forge.util.createBuffer(capture.publicKeyModulus).toHex(); - var e = forge.util.createBuffer(capture.publicKeyExponent).toHex(); + return new Promise((resolve, reject) => { + const timeoutID = setTimeout(() => { + if (timedOut()) { + reject(new TimeoutError()) + abortController.abort() + } + }, ms) - // set public key - return pki.setRsaPublicKey( - new BigInteger(n, 16), - new BigInteger(e, 16)); -}; + /** + * @param {(value: any) => void } next + */ + const after = (next) => { + /** + * @param {any} res + */ + const fn = (res) => { + clearTimeout(timeoutID) -/** - * Converts a public key to an ASN.1 SubjectPublicKeyInfo. - * - * @param key the public key. - * - * @return the asn1 representation of a SubjectPublicKeyInfo. - */ -pki.publicKeyToAsn1 = pki.publicKeyToSubjectPublicKeyInfo = function(key) { - // SubjectPublicKeyInfo - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // AlgorithmIdentifier - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.rsaEncryption).getBytes()), - // parameters (null) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ]), - // subjectPublicKey - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, [ - pki.publicKeyToRSAPublicKey(key) - ]) - ]); -}; + if (timedOut()) { + reject(new TimeoutError()) + return + } -/** - * Converts a public key to an ASN.1 RSAPublicKey. - * - * @param key the public key. - * - * @return the asn1 representation of a RSAPublicKey. - */ -pki.publicKeyToRSAPublicKey = function(key) { - // RSAPublicKey - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // modulus (n) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.n)), - // publicExponent (e) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.e)) - ]); -}; + next(res) + } + return fn + } -/** - * Encodes a message using PKCS#1 v1.5 padding. - * - * @param m the message to encode. - * @param key the RSA key to use. - * @param bt the block type to use, i.e. either 0x01 (for signing) or 0x02 - * (for encryption). - * - * @return the padded byte buffer. - */ -function _encodePkcs1_v1_5(m, key, bt) { - var eb = forge.util.createBuffer(); + promise + .then(after(resolve), after(reject)) + }) +} - // get the length of the modulus in bytes - var k = Math.ceil(key.n.bitLength() / 8); +const defaults = { + throwHttpErrors: true, + credentials: 'same-origin' +} - /* use PKCS#1 v1.5 padding */ - if(m.length > (k - 11)) { - var error = new Error('Message is too long for PKCS#1 v1.5 padding.'); - error.length = m.length; - error.max = k - 11; - throw error; +class HTTP { + /** + * + * @param {HTTPOptions} options + */ + constructor (options = {}) { + /** @type {HTTPOptions} */ + this.opts = merge(defaults, options) } - /* A block type BT, a padding string PS, and the data D shall be - formatted into an octet string EB, the encryption block: + /** + * Fetch + * + * @param {string | Request} resource + * @param {HTTPOptions} options + * @returns {Promise} + */ + async fetch (resource, options = {}) { + /** @type {HTTPOptions} */ + const opts = merge(this.opts, options) + // @ts-expect-error + const headers = new Headers(opts.headers) - EB = 00 || BT || PS || 00 || D + // validate resource type + // @ts-expect-error + if (typeof resource !== 'string' && !(resource instanceof URL || resource instanceof Request)) { + throw new TypeError('`resource` must be a string, URL, or Request') + } - The block type BT shall be a single octet indicating the structure of - the encryption block. For this version of the document it shall have - value 00, 01, or 02. For a private-key operation, the block type - shall be 00 or 01. For a public-key operation, it shall be 02. + const url = new URL(resource.toString(), opts.base) - The padding string PS shall consist of k-3-||D|| octets. For block - type 00, the octets shall have value 00; for block type 01, they - shall have value FF; and for block type 02, they shall be - pseudorandomly generated and nonzero. This makes the length of the - encryption block EB equal to k. */ + const { + searchParams, + transformSearchParams, + json + } = opts - // build the encryption block - eb.putByte(0x00); - eb.putByte(bt); + if (searchParams) { + if (typeof transformSearchParams === 'function') { + // @ts-ignore + url.search = transformSearchParams(new URLSearchParams(opts.searchParams)) + } else { + // @ts-ignore + url.search = new URLSearchParams(opts.searchParams) + } + } - // create the padding - var padNum = k - 3 - m.length; - var padByte; - // private key op - if(bt === 0x00 || bt === 0x01) { - padByte = (bt === 0x00) ? 0x00 : 0xFF; - for(var i = 0; i < padNum; ++i) { - eb.putByte(padByte); + if (json) { + opts.body = JSON.stringify(opts.json) + headers.set('content-type', 'application/json') } - } else { - // public key op - // pad with random non-zero values - while(padNum > 0) { - var numZeros = 0; - var padBytes = forge.random.getBytes(padNum); - for(var i = 0; i < padNum; ++i) { - padByte = padBytes.charCodeAt(i); - if(padByte === 0) { - ++numZeros; + + const abortController = new AbortController() + // @ts-ignore + const signal = anySignal([abortController.signal, opts.signal]) + + if (globalThis.ReadableStream != null && opts.body instanceof globalThis.ReadableStream && (isBrowser || isWebWorker)) { + // https://bugzilla.mozilla.org/show_bug.cgi?id=1387483 + opts.body = new Blob(await all(browserReableStreamToIt(opts.body))) + } + + /** @type {ExtendedResponse} */ + // @ts-expect-error additional fields are assigned below + const response = await timeout( + fetch( + url.toString(), + { + ...opts, + signal, + // @ts-expect-error non-browser fetch implementations may take extra options + timeout: undefined, + headers, + + // https://fetch.spec.whatwg.org/#dom-requestinit-duplex + // https://github.com/whatwg/fetch/issues/1254 + duplex: 'half' + } + ), + opts.timeout, + abortController + ) + + if (!response.ok && opts.throwHttpErrors) { + if (opts.handleError) { + await opts.handleError(response) + } + throw new HTTPError(response) + } + + response.iterator = async function * () { + yield * fromStream(response.body) + } + + response.ndjson = async function * () { + for await (const chunk of ndjson(response.iterator())) { + if (options.transform) { + yield options.transform(chunk) } else { - eb.putByte(padByte); + yield chunk } } - padNum = numZeros; } + + return response } - // zero followed by message - eb.putByte(0x00); - eb.putBytes(m); + /** + * @param {string | Request} resource + * @param {HTTPOptions} options + */ + post (resource, options = {}) { + return this.fetch(resource, { ...options, method: 'POST' }) + } - return eb; + /** + * @param {string | Request} resource + * @param {HTTPOptions} options + */ + get (resource, options = {}) { + return this.fetch(resource, { ...options, method: 'GET' }) + } + + /** + * @param {string | Request} resource + * @param {HTTPOptions} options + */ + put (resource, options = {}) { + return this.fetch(resource, { ...options, method: 'PUT' }) + } + + /** + * @param {string | Request} resource + * @param {HTTPOptions} options + */ + delete (resource, options = {}) { + return this.fetch(resource, { ...options, method: 'DELETE' }) + } + + /** + * @param {string | Request} resource + * @param {HTTPOptions} options + */ + options (resource, options = {}) { + return this.fetch(resource, { ...options, method: 'OPTIONS' }) + } } /** - * Decodes a message using PKCS#1 v1.5 padding. - * - * @param em the message to decode. - * @param key the RSA key to use. - * @param pub true if the key is a public key, false if it is private. - * @param ml the message length, if specified. + * Parses NDJSON chunks from an iterator * - * @return the decoded bytes. + * @param {AsyncIterable} source + * @returns {AsyncIterable} */ -function _decodePkcs1_v1_5(em, key, pub, ml) { - // get the length of the modulus in bytes - var k = Math.ceil(key.n.bitLength() / 8); - - /* It is an error if any of the following conditions occurs: - - 1. The encryption block EB cannot be parsed unambiguously. - 2. The padding string PS consists of fewer than eight octets - or is inconsisent with the block type BT. - 3. The decryption process is a public-key operation and the block - type BT is not 00 or 01, or the decryption process is a - private-key operation and the block type is not 02. - */ +const ndjson = async function * (source) { + const decoder = new TextDecoder() + let buf = '' - // parse the encryption block - var eb = forge.util.createBuffer(em); - var first = eb.getByte(); - var bt = eb.getByte(); - if(first !== 0x00 || - (pub && bt !== 0x00 && bt !== 0x01) || - (!pub && bt != 0x02) || - (pub && bt === 0x00 && typeof(ml) === 'undefined')) { - throw new Error('Encryption block is invalid.'); - } + for await (const chunk of source) { + buf += decoder.decode(chunk, { stream: true }) + const lines = buf.split(/\r?\n/) - var padNum = 0; - if(bt === 0x00) { - // check all padding bytes for 0x00 - padNum = k - 3 - ml; - for(var i = 0; i < padNum; ++i) { - if(eb.getByte() !== 0x00) { - throw new Error('Encryption block is invalid.'); - } - } - } else if(bt === 0x01) { - // find the first byte that isn't 0xFF, should be after all padding - padNum = 0; - while(eb.length() > 1) { - if(eb.getByte() !== 0xFF) { - --eb.read; - break; - } - ++padNum; - } - } else if(bt === 0x02) { - // look for 0x00 byte - padNum = 0; - while(eb.length() > 1) { - if(eb.getByte() === 0x00) { - --eb.read; - break; + for (let i = 0; i < lines.length - 1; i++) { + const l = lines[i].trim() + if (l.length > 0) { + yield JSON.parse(l) } - ++padNum; } + buf = lines[lines.length - 1] } - - // zero must be 0x00 and padNum must be (k - 3 - message length) - var zero = eb.getByte(); - if(zero !== 0x00 || padNum !== (k - 3 - eb.length())) { - throw new Error('Encryption block is invalid.'); + buf += decoder.decode() + buf = buf.trim() + if (buf.length !== 0) { + yield JSON.parse(buf) } - - return eb.getBytes(); } /** - * Runs the key-generation algorithm asynchronously, either in the background - * via Web Workers, or using the main thread and setImmediate. + * Stream to AsyncIterable * - * @param state the key-pair generation state. - * @param [options] options for key-pair generation: - * workerScript the worker script URL. - * workers the number of web workers (if supported) to use, - * (default: 2, -1 to use estimated cores minus one). - * workLoad the size of the work load, ie: number of possible prime - * numbers for each web worker to check per work assignment, - * (default: 100). - * @param callback(err, keypair) called once the operation completes. + * @template TChunk + * @param {ReadableStream | NodeReadableStream | null} source + * @returns {AsyncIterable} */ -function _generateKeyPair(state, options, callback) { - if(typeof options === 'function') { - callback = options; - options = {}; +const fromStream = (source) => { + if (isAsyncIterable(source)) { + return source } - options = options || {}; - var opts = { - algorithm: { - name: options.algorithm || 'PRIMEINC', - options: { - workers: options.workers || 2, - workLoad: options.workLoad || 100, - workerScript: options.workerScript + // Workaround for https://github.com/node-fetch/node-fetch/issues/766 + if (isNodeReadableStream(source)) { + const iter = source[Symbol.asyncIterator]() + return { + [Symbol.asyncIterator] () { + return { + next: iter.next.bind(iter), + return (value) { + source.destroy() + if (typeof iter.return === 'function') { + return iter.return() + } + return Promise.resolve({ done: true, value }) + } + } } } - }; - if('prng' in options) { - opts.prng = options.prng; } - generate(); - - function generate() { - // find p and then q (done in series to simplify) - getPrime(state.pBits, function(err, num) { - if(err) { - return callback(err); - } - state.p = num; - if(state.q !== null) { - return finish(err, state.q); + if (isWebReadableStream(source)) { + const reader = source.getReader() + return (async function * () { + try { + while (true) { + // Read from the stream + const { done, value } = await reader.read() + // Exit if we're done + if (done) return + // Else yield the chunk + if (value) { + yield value + } + } + } finally { + reader.releaseLock() } - getPrime(state.qBits, finish); - }); + })() } - function getPrime(bits, callback) { - forge.prime.generateProbablePrime(bits, opts, callback); - } + throw new TypeError('Body can\'t be converted to AsyncIterable') +} - function finish(err, num) { - if(err) { - return callback(err); - } +/** + * Check if it's an AsyncIterable + * + * @template {unknown} TChunk + * @template {any} Other + * @param {Other|AsyncIterable} value + * @returns {value is AsyncIterable} + */ +const isAsyncIterable = (value) => { + return typeof value === 'object' && + value !== null && + typeof /** @type {any} */(value)[Symbol.asyncIterator] === 'function' +} - // set q - state.q = num; +/** + * Check for web readable stream + * + * @template {unknown} TChunk + * @template {any} Other + * @param {Other|ReadableStream} value + * @returns {value is ReadableStream} + */ +const isWebReadableStream = (value) => { + return value && typeof /** @type {any} */(value).getReader === 'function' +} - // ensure p is larger than q (swap them if not) - if(state.p.compareTo(state.q) < 0) { - var tmp = state.p; - state.p = state.q; - state.q = tmp; - } +/** + * @param {any} value + * @returns {value is NodeReadableStream} + */ +const isNodeReadableStream = (value) => + Object.prototype.hasOwnProperty.call(value, 'readable') && + Object.prototype.hasOwnProperty.call(value, 'writable') - // ensure p is coprime with e - if(state.p.subtract(BigInteger.ONE).gcd(state.e) - .compareTo(BigInteger.ONE) !== 0) { - state.p = null; - generate(); - return; - } +HTTP.HTTPError = HTTPError +HTTP.TimeoutError = TimeoutError +HTTP.streamToAsyncIterator = fromStream - // ensure q is coprime with e - if(state.q.subtract(BigInteger.ONE).gcd(state.e) - .compareTo(BigInteger.ONE) !== 0) { - state.q = null; - getPrime(state.qBits, finish); - return; - } +/** + * @param {string | Request} resource + * @param {HTTPOptions} [options] + */ +HTTP.post = (resource, options) => new HTTP(options).post(resource, options) - // compute phi: (p - 1)(q - 1) (Euler's totient function) - state.p1 = state.p.subtract(BigInteger.ONE); - state.q1 = state.q.subtract(BigInteger.ONE); - state.phi = state.p1.multiply(state.q1); +/** + * @param {string | Request} resource + * @param {HTTPOptions} [options] + */ +HTTP.get = (resource, options) => new HTTP(options).get(resource, options) - // ensure e and phi are coprime - if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) !== 0) { - // phi and e aren't coprime, so generate a new p and q - state.p = state.q = null; - generate(); - return; - } +/** + * @param {string | Request} resource + * @param {HTTPOptions} [options] + */ +HTTP.put = (resource, options) => new HTTP(options).put(resource, options) - // create n, ensure n is has the right number of bits - state.n = state.p.multiply(state.q); - if(state.n.bitLength() !== state.bits) { - // failed, get new q - state.q = null; - getPrime(state.qBits, finish); - return; - } +/** + * @param {string | Request} resource + * @param {HTTPOptions} [options] + */ +HTTP.delete = (resource, options) => new HTTP(options).delete(resource, options) - // set keys - var d = state.e.modInverse(state.phi); - state.keys = { - privateKey: pki.rsa.setPrivateKey( - state.n, state.e, d, state.p, state.q, - d.mod(state.p1), d.mod(state.q1), - state.q.modInverse(state.p)), - publicKey: pki.rsa.setPublicKey(state.n, state.e) - }; +/** + * @param {string | Request} resource + * @param {HTTPOptions} [options] + */ +HTTP.options = (resource, options) => new HTTP(options).options(resource, options) - callback(null, state.keys); +module.exports = HTTP + + +/***/ }), + +/***/ 81918: +/***/ ((__unused_webpack_module, exports) => { + + + +class TimeoutError extends Error { + constructor (message = 'Request timed out') { + super(message) + this.name = 'TimeoutError' } } +exports.TimeoutError = TimeoutError -/** - * Converts a positive BigInteger into 2's-complement big-endian bytes. - * - * @param b the big integer to convert. - * - * @return the bytes. - */ -function _bnToBytes(b) { - // prepend 0x00 if first byte >= 0x80 - var hex = b.toString(16); - if(hex[0] >= '8') { - hex = '00' + hex; +class AbortError extends Error { + constructor (message = 'The operation was aborted.') { + super(message) + this.name = 'AbortError' } - var bytes = forge.util.hexToBytes(hex); +} +exports.AbortError = AbortError - // ensure integer is minimally-encoded - if(bytes.length > 1 && - // leading 0x00 for positive integer - ((bytes.charCodeAt(0) === 0 && - (bytes.charCodeAt(1) & 0x80) === 0) || - // leading 0xFF for negative integer - (bytes.charCodeAt(0) === 0xFF && - (bytes.charCodeAt(1) & 0x80) === 0x80))) { - return bytes.substr(1); +class HTTPError extends Error { + /** + * @param {Response} response + */ + constructor (response) { + super(response.statusText) + this.name = 'HTTPError' + this.response = response } - return bytes; } +exports.HTTPError = HTTPError + + +/***/ }), + +/***/ 81407: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const { TimeoutError, AbortError } = __nccwpck_require__(81918) +// @ts-expect-error +const { Response, Request, Headers, default: fetch } = __nccwpck_require__(50977) /** - * Returns the required number of Miller-Rabin tests to generate a - * prime with an error probability of (1/2)^80. - * - * See Handbook of Applied Cryptography Chapter 4, Table 4.4. - * - * @param bits the bit size. - * - * @return the required number of iterations. + * @typedef {import('../types').FetchOptions} FetchOptions + * @typedef {import('../types').ProgressFn} ProgressFn */ -function _getMillerRabinTests(bits) { - if(bits <= 100) return 27; - if(bits <= 150) return 18; - if(bits <= 200) return 15; - if(bits <= 250) return 12; - if(bits <= 300) return 9; - if(bits <= 350) return 8; - if(bits <= 400) return 7; - if(bits <= 500) return 6; - if(bits <= 600) return 5; - if(bits <= 800) return 4; - if(bits <= 1250) return 3; - return 2; -} /** - * Performs feature detection on the Node crypto interface. - * - * @param fn the feature (function) to detect. + * Fetch with progress * - * @return true if detected, false if not. + * @param {string | Request} url + * @param {FetchOptions} [options] + * @returns {Promise} */ -function _detectNodeCrypto(fn) { - return forge.util.isNodejs && typeof _crypto[fn] === 'function'; +const fetchWithProgress = (url, options = {}) => { + const request = new XMLHttpRequest() + request.open(options.method || 'GET', url.toString(), true) + + const { timeout, headers } = options + + if (timeout && timeout > 0 && timeout < Infinity) { + request.timeout = timeout + } + + if (options.overrideMimeType != null) { + request.overrideMimeType(options.overrideMimeType) + } + + if (headers) { + for (const [name, value] of new Headers(headers)) { + request.setRequestHeader(name, value) + } + } + + if (options.signal) { + options.signal.onabort = () => request.abort() + } + + if (options.onUploadProgress) { + request.upload.onprogress = options.onUploadProgress + } + + // Note: Need to use `arraybuffer` here instead of `blob` because `Blob` + // instances coming from JSDOM are not compatible with `Response` from + // node-fetch (which is the setup we get when testing with jest because + // it uses JSDOM which does not provide a global fetch + // https://github.com/jsdom/jsdom/issues/1724) + request.responseType = 'arraybuffer' + + return new Promise((resolve, reject) => { + /** + * @param {Event} event + */ + const handleEvent = (event) => { + switch (event.type) { + case 'error': { + resolve(Response.error()) + break + } + case 'load': { + resolve( + new ResponseWithURL(request.responseURL, request.response, { + status: request.status, + statusText: request.statusText, + headers: parseHeaders(request.getAllResponseHeaders()) + }) + ) + break + } + case 'timeout': { + reject(new TimeoutError()) + break + } + case 'abort': { + reject(new AbortError()) + break + } + default: { + break + } + } + } + request.onerror = handleEvent + request.onload = handleEvent + request.ontimeout = handleEvent + request.onabort = handleEvent + + // @ts-expect-error options.body can be a node readable stream, which isn't compatible with XHR, but this + // file is a browser override so you won't get a node readable stream so ignore the error + request.send(options.body) + }) } +const fetchWithStreaming = fetch + /** - * Performs feature detection on the SubtleCrypto interface. - * - * @param fn the feature (function) to detect. - * - * @return true if detected, false if not. + * @param {string | Request} url + * @param {FetchOptions} options */ -function _detectSubtleCrypto(fn) { - return (typeof util.globalScope !== 'undefined' && - typeof util.globalScope.crypto === 'object' && - typeof util.globalScope.crypto.subtle === 'object' && - typeof util.globalScope.crypto.subtle[fn] === 'function'); -} +const fetchWith = (url, options = {}) => + (options.onUploadProgress != null) + ? fetchWithProgress(url, options) + : fetchWithStreaming(url, options) /** - * Performs feature detection on the deprecated Microsoft Internet Explorer - * outdated SubtleCrypto interface. This function should only be used after - * checking for the modern, standard SubtleCrypto interface. - * - * @param fn the feature (function) to detect. + * Parse Headers from a XMLHttpRequest * - * @return true if detected, false if not. + * @param {string} input + * @returns {Headers} */ -function _detectSubtleMsCrypto(fn) { - return (typeof util.globalScope !== 'undefined' && - typeof util.globalScope.msCrypto === 'object' && - typeof util.globalScope.msCrypto.subtle === 'object' && - typeof util.globalScope.msCrypto.subtle[fn] === 'function'); -} - -function _intToUint8Array(x) { - var bytes = forge.util.hexToBytes(x.toString(16)); - var buffer = new Uint8Array(bytes.length); - for(var i = 0; i < bytes.length; ++i) { - buffer[i] = bytes.charCodeAt(i); +const parseHeaders = (input) => { + const headers = new Headers() + for (const line of input.trim().split(/[\r\n]+/)) { + const index = line.indexOf(': ') + if (index > 0) { + headers.set(line.slice(0, index), line.slice(index + 1)) + } } - return buffer; -} -function _privateKeyFromJwk(jwk) { - if(jwk.kty !== 'RSA') { - throw new Error( - 'Unsupported key algorithm "' + jwk.kty + '"; algorithm must be "RSA".'); - } - return pki.setRsaPrivateKey( - _base64ToBigInt(jwk.n), - _base64ToBigInt(jwk.e), - _base64ToBigInt(jwk.d), - _base64ToBigInt(jwk.p), - _base64ToBigInt(jwk.q), - _base64ToBigInt(jwk.dp), - _base64ToBigInt(jwk.dq), - _base64ToBigInt(jwk.qi)); + return headers } -function _publicKeyFromJwk(jwk) { - if(jwk.kty !== 'RSA') { - throw new Error('Key algorithm must be "RSA".'); +class ResponseWithURL extends Response { + /** + * @param {string} url + * @param {BodyInit} body + * @param {ResponseInit} options + */ + constructor (url, body, options) { + super(body, options) + Object.defineProperty(this, 'url', { value: url }) } - return pki.setRsaPublicKey( - _base64ToBigInt(jwk.n), - _base64ToBigInt(jwk.e)); } -function _base64ToBigInt(b64) { - return new BigInteger(forge.util.bytesToHex(forge.util.decode64(b64)), 16); +module.exports = { + fetch: fetchWith, + Request, + Headers } /***/ }), -<<<<<<< HEAD -/***/ 69970: -======= -/***/ 41447: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 90252: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Secure Hash Algorithm with 160-bit digest (SHA-1) implementation. - * - * @author Dave Longley - * - * Copyright (c) 2010-2015 Digital Bazaar, Inc. - */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -__nccwpck_require__(2439); -__nccwpck_require__(19239); -======= -var forge = __nccwpck_require__(96630); -__nccwpck_require__(80554); -__nccwpck_require__(36536); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -var sha1 = module.exports = forge.sha1 = forge.sha1 || {}; -forge.md.sha1 = forge.md.algorithms.sha1 = sha1; /** - * Creates a SHA-1 message digest object. - * - * @return a message digest object. + * @typedef {object} fetchImpl + * @property {globalThis.fetch} fetchImpl.fetch + * @property {globalThis.Request} fetchImpl.Request + * @property {globalThis.Response} fetchImpl.Response + * @property {globalThis.Headers} fetchImpl.Headers */ -sha1.create = function() { - // do initialization as necessary - if(!_initialized) { - _init(); - } - // SHA-1 state contains five 32-bit integers - var _state = null; +let implName = './fetch.node' - // input buffer - var _input = forge.util.createBuffer(); +if (typeof XMLHttpRequest === 'function') { + // Electron has `XMLHttpRequest` and should get the browser implementation + // instead of node. + implName = './fetch.browser' +} - // used for word storage - var _w = new Array(80); +/** @type {fetchImpl} */ +const fetch = __nccwpck_require__(81407) - // message digest object - var md = { - algorithm: 'sha1', - blockLength: 64, - digestLength: 20, - // 56-bit length of message so far (does not including padding) - messageLength: 0, - // true message length - fullMessageLength: null, - // size of message length in bytes - messageLengthSize: 8 - }; +module.exports = fetch - /** - * Starts the digest. - * - * @return this digest object. - */ - md.start = function() { - // up to 56-bit message length for convenience - md.messageLength = 0; - // full message length (set md.messageLength64 for backwards-compatibility) - md.fullMessageLength = md.messageLength64 = []; - var int32s = md.messageLengthSize / 4; - for(var i = 0; i < int32s; ++i) { - md.fullMessageLength.push(0); +/***/ }), + +/***/ 59548: +/***/ ((module) => { + +// https://github.com/electron/electron/issues/2288 +function isElectron() { + // Renderer process + if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') { + return true; } - _input = forge.util.createBuffer(); - _state = { - h0: 0x67452301, - h1: 0xEFCDAB89, - h2: 0x98BADCFE, - h3: 0x10325476, - h4: 0xC3D2E1F0 - }; - return md; - }; - // start digest automatically for first time - md.start(); - /** - * Updates the digest with the given message input. The given input can - * treated as raw input (no encoding will be applied) or an encoding of - * 'utf8' maybe given to encode the input using UTF-8. - * - * @param msg the message input to update with. - * @param encoding the encoding to use (default: 'raw', other: 'utf8'). - * - * @return this digest object. - */ - md.update = function(msg, encoding) { - if(encoding === 'utf8') { - msg = forge.util.encodeUtf8(msg); + // Main process + if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electron) { + return true; } - // update message length - var len = msg.length; - md.messageLength += len; - len = [(len / 0x100000000) >>> 0, len >>> 0]; - for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { - md.fullMessageLength[i] += len[1]; - len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0); - md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; - len[0] = ((len[1] / 0x100000000) >>> 0); + // Detect the user agent when the `nodeIntegration` option is set to false + if (typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Electron') >= 0) { + return true; } - // add bytes to input buffer - _input.putBytes(msg); + return false; +} - // process bytes - _update(_state, _w, _input); +module.exports = isElectron; - // compact input buffer every 2K or if empty - if(_input.read > 2048 || _input.length() === 0) { - _input.compact(); - } - return md; - }; +/***/ }), - /** - * Produces the digest. - * - * @return a byte buffer containing the digest value. - */ - md.digest = function() { - /* Note: Here we copy the remaining bytes in the input buffer and - add the appropriate SHA-1 padding. Then we do the final update - on a copy of the state so that if the user wants to get - intermediate digests they can do so. */ +/***/ 38523: +/***/ ((module) => { - /* Determine the number of bytes that must be added to the message - to ensure its length is congruent to 448 mod 512. In other words, - the data to be digested must be a multiple of 512 bits (or 128 bytes). - This data includes the message, some padding, and the length of the - message. Since the length of the message will be encoded as 8 bytes (64 - bits), that means that the last segment of the data must have 56 bytes - (448 bits) of message and padding. Therefore, the length of the message - plus the padding must be congruent to 448 mod 512 because - 512 - 128 = 448. - In order to fill up the message length it must be filled with - padding that begins with 1 bit followed by all 0 bits. Padding - must *always* be present, so if the message length is already - congruent to 448 mod 512, then 512 padding bits must be added. */ - var finalBlock = forge.util.createBuffer(); - finalBlock.putBytes(_input.bytes()); +module.exports = value => { + if (Object.prototype.toString.call(value) !== '[object Object]') { + return false; + } - // compute remaining size to be digested (include message length size) - var remaining = ( - md.fullMessageLength[md.fullMessageLength.length - 1] + - md.messageLengthSize); + const prototype = Object.getPrototypeOf(value); + return prototype === null || prototype === Object.prototype; +}; - // add padding for overflow blockSize - overflow - // _padding starts with 1 byte with first bit is set (byte value 128), then - // there may be up to (blockSize - 1) other pad bytes - var overflow = remaining & (md.blockLength - 1); - finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); - // serialize message length in bits in big-endian order; since length - // is stored in bytes we multiply by 8 and add carry from next int - var next, carry; - var bits = md.fullMessageLength[0] * 8; - for(var i = 0; i < md.fullMessageLength.length - 1; ++i) { - next = md.fullMessageLength[i + 1] * 8; - carry = (next / 0x100000000) >>> 0; - bits += carry; - finalBlock.putInt32(bits >>> 0); - bits = next >>> 0; - } - finalBlock.putInt32(bits); +/***/ }), - var s2 = { - h0: _state.h0, - h1: _state.h1, - h2: _state.h2, - h3: _state.h3, - h4: _state.h4 - }; - _update(s2, _w, finalBlock); - var rval = forge.util.createBuffer(); - rval.putInt32(s2.h0); - rval.putInt32(s2.h1); - rval.putInt32(s2.h2); - rval.putInt32(s2.h3); - rval.putInt32(s2.h4); - return rval; - }; +/***/ 52222: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return md; -}; -// sha-1 padding bytes not initialized yet -var _padding = null; -var _initialized = false; -/** - * Initializes the constant tables. - */ -function _init() { - // create padding - _padding = String.fromCharCode(128); - _padding += forge.util.fillString(String.fromCharCode(0x00), 64); +const { randomBytes } = __nccwpck_require__(6113) - // now initialized - _initialized = true; +module.exports = randomBytes + + +/***/ }), + +/***/ 85067: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const { + URLWithLegacySupport, + format, + URLSearchParams, + defaultBase +} = __nccwpck_require__(20712) +const relative = __nccwpck_require__(76807) + +module.exports = { + URL: URLWithLegacySupport, + URLSearchParams, + format, + relative, + defaultBase } + +/***/ }), + +/***/ 76807: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const { URLWithLegacySupport, format } = __nccwpck_require__(20712) + /** - * Updates a SHA-1 state with the given byte buffer. - * - * @param s the SHA-1 state to update. - * @param w the array to use to store words. - * @param bytes the byte buffer to update with. + * @param {string | undefined} url + * @param {any} [location] + * @param {any} [protocolMap] + * @param {any} [defaultProtocol] */ -function _update(s, w, bytes) { - // consume 512 bit (64 byte) chunks - var t, a, b, c, d, e, f, i; - var len = bytes.length(); - while(len >= 64) { - // the w array will be populated with sixteen 32-bit big-endian words - // and then extended into 80 32-bit words according to SHA-1 algorithm - // and for 32-79 using Max Locktyukhin's optimization +module.exports = (url, location = {}, protocolMap = {}, defaultProtocol) => { + let protocol = location.protocol + ? location.protocol.replace(':', '') + : 'http' - // initialize hash value for this chunk - a = s.h0; - b = s.h1; - c = s.h2; - d = s.h3; - e = s.h4; + // Check protocol map + protocol = (protocolMap[protocol] || defaultProtocol || protocol) + ':' + let urlParsed - // round 1 - for(i = 0; i < 16; ++i) { - t = bytes.getInt32(); - w[i] = t; - f = d ^ (b & (c ^ d)); - t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t; - e = d; - d = c; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - c = ((b << 30) | (b >>> 2)) >>> 0; - b = a; - a = t; - } - for(; i < 20; ++i) { - t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]); - t = (t << 1) | (t >>> 31); - w[i] = t; - f = d ^ (b & (c ^ d)); - t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t; - e = d; - d = c; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - c = ((b << 30) | (b >>> 2)) >>> 0; - b = a; - a = t; - } - // round 2 - for(; i < 32; ++i) { - t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]); - t = (t << 1) | (t >>> 31); - w[i] = t; - f = b ^ c ^ d; - t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t; - e = d; - d = c; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - c = ((b << 30) | (b >>> 2)) >>> 0; - b = a; - a = t; - } - for(; i < 40; ++i) { - t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); - t = (t << 2) | (t >>> 30); - w[i] = t; - f = b ^ c ^ d; - t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t; - e = d; - d = c; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - c = ((b << 30) | (b >>> 2)) >>> 0; - b = a; - a = t; - } - // round 3 - for(; i < 60; ++i) { - t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); - t = (t << 2) | (t >>> 30); - w[i] = t; - f = (b & c) | (d & (b ^ c)); - t = ((a << 5) | (a >>> 27)) + f + e + 0x8F1BBCDC + t; - e = d; - d = c; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - c = ((b << 30) | (b >>> 2)) >>> 0; - b = a; - a = t; + try { + urlParsed = new URLWithLegacySupport(url) + } catch (err) { + urlParsed = {} + } + + const base = Object.assign({}, location, { + protocol: protocol || urlParsed.protocol, + host: location.host || urlParsed.host + }) + + return new URLWithLegacySupport(url, format(base)).toString() +} + + +/***/ }), + +/***/ 20712: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const { URL, URLSearchParams, format } = __nccwpck_require__(57310) + +// https://github.com/nodejs/node/issues/12682 +const defaultBase = 'http://localhost' + +class URLWithLegacySupport extends URL { + constructor (url = '', base = defaultBase) { + super(url, base) + this.path = this.pathname + this.search + this.auth = + this.username && this.password + ? this.username + ':' + this.password + : null + this.query = + this.search && this.search.startsWith('?') + ? this.search.slice(1) + : null + } + + format () { + return this.toString() + } +} + +module.exports = { + URLWithLegacySupport, + URLSearchParams, + format, + defaultBase +} + + +/***/ }), + +/***/ 11906: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const { Readable, Writable, Duplex } = __nccwpck_require__(12781) +const getIterator = __nccwpck_require__(2914) +const Fifo = __nccwpck_require__(54968) +const { Buffer } = __nccwpck_require__(14300) +const END_CHUNK = Buffer.alloc(0) + +module.exports = function toDuplex (duplex, options) { + options = options || {} + + let reading = false + const fifo = new Fifo() + + duplex = { + sink: duplex.sink, + source: duplex.source ? getIterator(duplex.source) : null + } + + let Stream = Duplex + if (!duplex.source) { + Stream = Writable + } else if (!duplex.sink) { + Stream = Readable + } + + let readable + if (duplex.source) { + readable = { + async read (size) { + if (reading) return + reading = true + + try { + while (true) { + const { value, done } = await duplex.source.next(size) + if (done) return this.push(null) + if (!this.push(value)) break + } + } catch (err) { + this.emit('error', err) + } finally { + reading = false + } + } } - // round 4 - for(; i < 80; ++i) { - t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); - t = (t << 2) | (t >>> 30); - w[i] = t; - f = b ^ c ^ d; - t = ((a << 5) | (a >>> 27)) + f + e + 0xCA62C1D6 + t; - e = d; - d = c; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - c = ((b << 30) | (b >>> 2)) >>> 0; - b = a; - a = t; + } + + let writable + if (duplex.sink) { + writable = { + write (chunk, enc, cb) { + fifo.push(chunk).then(() => cb(), cb) + }, + final (cb) { + fifo.push(END_CHUNK).then(() => cb(), cb) + } } + } + + Object.assign(options, readable, writable) + + const stream = new Stream(options) + + if (duplex.sink) { + duplex.sink({ + [Symbol.asyncIterator] () { + return this + }, + async next () { + const chunk = await fifo.shift() + return chunk === END_CHUNK ? { done: true } : { value: chunk } + }, + async throw (err) { + stream.destroy(err) + return { done: true } + }, + async return () { + stream.destroy() + return { done: true } + } + }) + } + + return stream +} - // update hash state - s.h0 = (s.h0 + a) | 0; - s.h1 = (s.h1 + b) | 0; - s.h2 = (s.h2 + c) | 0; - s.h3 = (s.h3 + d) | 0; - s.h4 = (s.h4 + e) | 0; - len -= 64; - } +/***/ }), + +/***/ 3547: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const toTransform = __nccwpck_require__(72995) +const toDuplex = __nccwpck_require__(11906) + +function toReadable (source, options) { + return toDuplex({ source }, options) +} + +function toWritable (sink, options) { + return toDuplex({ sink }, options) } +module.exports = toReadable +module.exports.readable = toReadable +module.exports.writable = toWritable +module.exports.transform = toTransform +module.exports.duplex = toDuplex + /***/ }), -<<<<<<< HEAD -/***/ 13809: -======= -/***/ 3241: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 72995: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Secure Hash Algorithm with 256-bit digest (SHA-256) implementation. - * - * See FIPS 180-2 for details. - * - * @author Dave Longley - * - * Copyright (c) 2010-2015 Digital Bazaar, Inc. - */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -__nccwpck_require__(2439); -__nccwpck_require__(19239); -======= -var forge = __nccwpck_require__(96630); -__nccwpck_require__(80554); -__nccwpck_require__(36536); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const toDuplex = __nccwpck_require__(11906) +const defer = __nccwpck_require__(3425) + +module.exports = function toTransform (transform, options) { + const { promise, resolve } = defer() + + const source = (async function * () { + const it = await promise + for await (const chunk of it) yield chunk + })() + + return toDuplex({ sink: s => resolve(transform(s)), source }, options) +} + + +/***/ }), + +/***/ 55680: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var sha256 = module.exports = forge.sha256 = forge.sha256 || {}; -forge.md.sha256 = forge.md.algorithms.sha256 = sha256; + + +const crypto = __nccwpck_require__(6113) +const { concat: uint8ArrayConcat } = __nccwpck_require__(85991) +const { fromString: uint8ArrayFromString } = __nccwpck_require__(7433) + +// Based off of code from https://github.com/luke-park/SecureCompatibleEncryptionExamples /** - * Creates a SHA-256 message digest object. * - * @return a message digest object. + * @param {object} [options] + * @param {number} [options.algorithmTagLength=16] + * @param {number} [options.nonceLength=12] + * @param {number} [options.keyLength=16] + * @param {string} [options.digest=sha256] + * @param {number} [options.saltLength=16] + * @param {number} [options.iterations=32767] + * @returns {*} */ -sha256.create = function() { - // do initialization as necessary - if(!_initialized) { - _init(); - } - - // SHA-256 state contains eight 32-bit integers - var _state = null; +function create ({ + algorithmTagLength = 16, + nonceLength = 12, + keyLength = 16, + digest = 'sha256', + saltLength = 16, + iterations = 32767 +} = {}) { + const algorithm = 'aes-128-gcm' + /** + * + * @private + * @param {Uint8Array} data + * @param {Uint8Array} key + * @returns {Promise} + */ + async function encryptWithKey (data, key) { // eslint-disable-line require-await + const nonce = crypto.randomBytes(nonceLength) - // input buffer - var _input = forge.util.createBuffer(); + // Create the cipher instance. + const cipher = crypto.createCipheriv(algorithm, key, nonce) - // used for word storage - var _w = new Array(64); + // Encrypt and prepend nonce. + const ciphertext = uint8ArrayConcat([cipher.update(data), cipher.final()]) - // message digest object - var md = { - algorithm: 'sha256', - blockLength: 64, - digestLength: 32, - // 56-bit length of message so far (does not including padding) - messageLength: 0, - // true message length - fullMessageLength: null, - // size of message length in bytes - messageLengthSize: 8 - }; + return uint8ArrayConcat([nonce, ciphertext, cipher.getAuthTag()]) + } /** - * Starts the digest. + * Uses the provided password to derive a pbkdf2 key. The key + * will then be used to encrypt the data. * - * @return this digest object. + * @param {Uint8Array} data - The data to decrypt + * @param {string|Uint8Array} password - A plain password + * @returns {Promise} */ - md.start = function() { - // up to 56-bit message length for convenience - md.messageLength = 0; + async function encrypt (data, password) { // eslint-disable-line require-await + // Generate a 128-bit salt using a CSPRNG. + const salt = crypto.randomBytes(saltLength) - // full message length (set md.messageLength64 for backwards-compatibility) - md.fullMessageLength = md.messageLength64 = []; - var int32s = md.messageLengthSize / 4; - for(var i = 0; i < int32s; ++i) { - md.fullMessageLength.push(0); + if (typeof password === 'string' || password instanceof String) { + password = uint8ArrayFromString(password) } - _input = forge.util.createBuffer(); - _state = { - h0: 0x6A09E667, - h1: 0xBB67AE85, - h2: 0x3C6EF372, - h3: 0xA54FF53A, - h4: 0x510E527F, - h5: 0x9B05688C, - h6: 0x1F83D9AB, - h7: 0x5BE0CD19 - }; - return md; - }; - // start digest automatically for first time - md.start(); + + // Derive a key using PBKDF2. + const key = crypto.pbkdf2Sync(password, salt, iterations, keyLength, digest) + + // Encrypt and prepend salt. + return uint8ArrayConcat([salt, await encryptWithKey(Uint8Array.from(data), key)]) + } /** - * Updates the digest with the given message input. The given input can - * treated as raw input (no encoding will be applied) or an encoding of - * 'utf8' maybe given to encode the input using UTF-8. + * Decrypts the given cipher text with the provided key. The `key` should + * be a cryptographically safe key and not a plaintext password. To use + * a plaintext password, use `decrypt`. The options used to create + * this decryption cipher must be the same as those used to create + * the encryption cipher. * - * @param msg the message input to update with. - * @param encoding the encoding to use (default: 'raw', other: 'utf8'). + * @private + * @param {Uint8Array} ciphertextAndNonce - The data to decrypt + * @param {Uint8Array} key + * @returns {Promise} + */ + async function decryptWithKey (ciphertextAndNonce, key) { // eslint-disable-line require-await + // Create Uint8Arrays of nonce, ciphertext and tag. + const nonce = ciphertextAndNonce.slice(0, nonceLength) + const ciphertext = ciphertextAndNonce.slice(nonceLength, ciphertextAndNonce.length - algorithmTagLength) + const tag = ciphertextAndNonce.slice(ciphertext.length + nonceLength) + + // Create the cipher instance. + const cipher = crypto.createDecipheriv(algorithm, key, nonce) + + // Decrypt and return result. + cipher.setAuthTag(tag) + return uint8ArrayConcat([cipher.update(ciphertext), cipher.final()]) + } + + /** + * Uses the provided password to derive a pbkdf2 key. The key + * will then be used to decrypt the data. The options used to create + * this decryption cipher must be the same as those used to create + * the encryption cipher. * - * @return this digest object. + * @param {Uint8Array} data - The data to decrypt + * @param {string|Uint8Array} password - A plain password */ - md.update = function(msg, encoding) { - if(encoding === 'utf8') { - msg = forge.util.encodeUtf8(msg); - } + async function decrypt (data, password) { // eslint-disable-line require-await + // Create Uint8Arrays of salt and ciphertextAndNonce. + const salt = data.slice(0, saltLength) + const ciphertextAndNonce = data.slice(saltLength) - // update message length - var len = msg.length; - md.messageLength += len; - len = [(len / 0x100000000) >>> 0, len >>> 0]; - for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { - md.fullMessageLength[i] += len[1]; - len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0); - md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; - len[0] = ((len[1] / 0x100000000) >>> 0); + if (typeof password === 'string' || password instanceof String) { + password = uint8ArrayFromString(password) } - // add bytes to input buffer - _input.putBytes(msg); + // Derive the key using PBKDF2. + const key = crypto.pbkdf2Sync(password, salt, iterations, keyLength, digest) - // process bytes - _update(_state, _w, _input); + // Decrypt and return result. + return decryptWithKey(ciphertextAndNonce, key) + } - // compact input buffer every 2K or if empty - if(_input.read > 2048 || _input.length() === 0) { - _input.compact(); - } + return { + encrypt, + decrypt + } +} - return md; - }; +module.exports = { + create +} - /** - * Produces the digest. - * - * @return a byte buffer containing the digest value. - */ - md.digest = function() { - /* Note: Here we copy the remaining bytes in the input buffer and - add the appropriate SHA-256 padding. Then we do the final update - on a copy of the state so that if the user wants to get - intermediate digests they can do so. */ - /* Determine the number of bytes that must be added to the message - to ensure its length is congruent to 448 mod 512. In other words, - the data to be digested must be a multiple of 512 bits (or 128 bytes). - This data includes the message, some padding, and the length of the - message. Since the length of the message will be encoded as 8 bytes (64 - bits), that means that the last segment of the data must have 56 bytes - (448 bits) of message and padding. Therefore, the length of the message - plus the padding must be congruent to 448 mod 512 because - 512 - 128 = 448. +/***/ }), - In order to fill up the message length it must be filled with - padding that begins with 1 bit followed by all 0 bits. Padding - must *always* be present, so if the message length is already - congruent to 448 mod 512, then 512 padding bits must be added. */ +/***/ 76721: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - var finalBlock = forge.util.createBuffer(); - finalBlock.putBytes(_input.bytes()); - // compute remaining size to be digested (include message length size) - var remaining = ( - md.fullMessageLength[md.fullMessageLength.length - 1] + - md.messageLengthSize); - // add padding for overflow blockSize - overflow - // _padding starts with 1 byte with first bit is set (byte value 128), then - // there may be up to (blockSize - 1) other pad bytes - var overflow = remaining & (md.blockLength - 1); - finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); +const crypto = __nccwpck_require__(6113) +const lengths = __nccwpck_require__(37577) - // serialize message length in bits in big-endian order; since length - // is stored in bytes we multiply by 8 and add carry from next int - var next, carry; - var bits = md.fullMessageLength[0] * 8; - for(var i = 0; i < md.fullMessageLength.length - 1; ++i) { - next = md.fullMessageLength[i + 1] * 8; - carry = (next / 0x100000000) >>> 0; - bits += carry; - finalBlock.putInt32(bits >>> 0); - bits = next >>> 0; - } - finalBlock.putInt32(bits); +exports.create = async function (hash, secret) { // eslint-disable-line require-await + const res = { + async digest (data) { // eslint-disable-line require-await + const hmac = crypto.createHmac(hash.toLowerCase(), secret) + hmac.update(data) + return hmac.digest() + }, + length: lengths[hash] + } - var s2 = { - h0: _state.h0, - h1: _state.h1, - h2: _state.h2, - h3: _state.h3, - h4: _state.h4, - h5: _state.h5, - h6: _state.h6, - h7: _state.h7 - }; - _update(s2, _w, finalBlock); - var rval = forge.util.createBuffer(); - rval.putInt32(s2.h0); - rval.putInt32(s2.h1); - rval.putInt32(s2.h2); - rval.putInt32(s2.h3); - rval.putInt32(s2.h4); - rval.putInt32(s2.h5); - rval.putInt32(s2.h6); - rval.putInt32(s2.h7); - return rval; - }; + return res +} - return md; -}; -// sha-256 padding bytes not initialized yet -var _padding = null; -var _initialized = false; +/***/ }), -// table of constants -var _k = null; +/***/ 37577: +/***/ ((module) => { -/** - * Initializes the constant tables. - */ -function _init() { - // create padding - _padding = String.fromCharCode(128); - _padding += forge.util.fillString(String.fromCharCode(0x00), 64); - // create K table for SHA-256 - _k = [ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, - 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, - 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, - 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, - 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, - 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]; - // now initialized - _initialized = true; +module.exports = { + SHA1: 20, + SHA256: 32, + SHA512: 64 } -/** - * Updates a SHA-256 state with the given byte buffer. - * - * @param s the SHA-256 state to update. - * @param w the array to use to store words. - * @param bytes the byte buffer to update with. - */ -function _update(s, w, bytes) { - // consume 512 bit (64 byte) chunks - var t1, t2, s0, s1, ch, maj, i, a, b, c, d, e, f, g, h; - var len = bytes.length(); - while(len >= 64) { - // the w array will be populated with sixteen 32-bit big-endian words - // and then extended into 64 32-bit words according to SHA-256 - for(i = 0; i < 16; ++i) { - w[i] = bytes.getInt32(); - } - for(; i < 64; ++i) { - // XOR word 2 words ago rot right 17, rot right 19, shft right 10 - t1 = w[i - 2]; - t1 = - ((t1 >>> 17) | (t1 << 15)) ^ - ((t1 >>> 19) | (t1 << 13)) ^ - (t1 >>> 10); - // XOR word 15 words ago rot right 7, rot right 18, shft right 3 - t2 = w[i - 15]; - t2 = - ((t2 >>> 7) | (t2 << 25)) ^ - ((t2 >>> 18) | (t2 << 14)) ^ - (t2 >>> 3); - // sum(t1, word 7 ago, t2, word 16 ago) modulo 2^32 - w[i] = (t1 + w[i - 7] + t2 + w[i - 16]) | 0; - } - // initialize hash value for this chunk - a = s.h0; - b = s.h1; - c = s.h2; - d = s.h3; - e = s.h4; - f = s.h5; - g = s.h6; - h = s.h7; +/***/ }), - // round function - for(i = 0; i < 64; ++i) { - // Sum1(e) - s1 = - ((e >>> 6) | (e << 26)) ^ - ((e >>> 11) | (e << 21)) ^ - ((e >>> 25) | (e << 7)); - // Ch(e, f, g) (optimized the same way as SHA-1) - ch = g ^ (e & (f ^ g)); - // Sum0(a) - s0 = - ((a >>> 2) | (a << 30)) ^ - ((a >>> 13) | (a << 19)) ^ - ((a >>> 22) | (a << 10)); - // Maj(a, b, c) (optimized the same way as SHA-1) - maj = (a & b) | (c & (a ^ b)); +/***/ 65977: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // main algorithm - t1 = h + s1 + ch + _k[i] + w[i]; - t2 = s0 + maj; - h = g; - g = f; - f = e; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - // can't truncate with `| 0` - e = (d + t1) >>> 0; - d = c; - c = b; - b = a; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - // can't truncate with `| 0` - a = (t1 + t2) >>> 0; - } - // update hash state - s.h0 = (s.h0 + a) | 0; - s.h1 = (s.h1 + b) | 0; - s.h2 = (s.h2 + c) | 0; - s.h3 = (s.h3 + d) | 0; - s.h4 = (s.h4 + e) | 0; - s.h5 = (s.h5 + f) | 0; - s.h6 = (s.h6 + g) | 0; - s.h7 = (s.h7 + h) | 0; - len -= 64; + +const crypto = __nccwpck_require__(6113) +const validateCurveType = __nccwpck_require__(79327) + +const curves = { + 'P-256': 'prime256v1', + 'P-384': 'secp384r1', + 'P-521': 'secp521r1' +} + +exports.generateEphmeralKeyPair = async function (curve) { // eslint-disable-line require-await + validateCurveType(Object.keys(curves), curve) + + const ecdh = crypto.createECDH(curves[curve]) + ecdh.generateKeys() + + return { + key: ecdh.getPublicKey(), + async genSharedKey (theirPub, forcePrivate) { // eslint-disable-line require-await + if (forcePrivate) { + ecdh.setPrivateKey(forcePrivate.private) + } + + return ecdh.computeSecret(theirPub) + } } } /***/ }), -<<<<<<< HEAD -/***/ 5388: -======= -/***/ 34531: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 50594: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Secure Hash Algorithm with a 1024-bit block size implementation. - * - * This includes: SHA-512, SHA-384, SHA-512/224, and SHA-512/256. For - * SHA-256 (block size 512 bits), see sha256.js. - * - * See FIPS 180-4 for details. - * - * @author Dave Longley - * - * Copyright (c) 2014-2015 Digital Bazaar, Inc. - */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -__nccwpck_require__(2439); -__nccwpck_require__(19239); -======= -var forge = __nccwpck_require__(96630); -__nccwpck_require__(80554); -__nccwpck_require__(36536); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -var sha512 = module.exports = forge.sha512 = forge.sha512 || {}; -// SHA-512 -forge.md.sha512 = forge.md.algorithms.sha512 = sha512; +const errcode = __nccwpck_require__(18598) +const { equals: uint8ArrayEquals } = __nccwpck_require__(13872) +const { sha256 } = __nccwpck_require__(10116) +const { base58btc } = __nccwpck_require__(96229) +const { identity } = __nccwpck_require__(8930) +const crypto = __nccwpck_require__(16407) +const pbm = __nccwpck_require__(63644) +const exporter = __nccwpck_require__(87213) -// SHA-384 -var sha384 = forge.sha384 = forge.sha512.sha384 = forge.sha512.sha384 || {}; -sha384.create = function() { - return sha512.create('SHA-384'); -}; -forge.md.sha384 = forge.md.algorithms.sha384 = sha384; +class Ed25519PublicKey { + constructor (key) { + this._key = ensureKey(key, crypto.publicKeyLength) + } -// SHA-512/256 -forge.sha512.sha256 = forge.sha512.sha256 || { - create: function() { - return sha512.create('SHA-512/256'); + async verify (data, sig) { // eslint-disable-line require-await + return crypto.hashAndVerify(this._key, sig, data) } -}; -forge.md['sha512/256'] = forge.md.algorithms['sha512/256'] = - forge.sha512.sha256; -// SHA-512/224 -forge.sha512.sha224 = forge.sha512.sha224 || { - create: function() { - return sha512.create('SHA-512/224'); + marshal () { + return this._key } -}; -forge.md['sha512/224'] = forge.md.algorithms['sha512/224'] = - forge.sha512.sha224; -/** - * Creates a SHA-2 message digest object. - * - * @param algorithm the algorithm to use (SHA-512, SHA-384, SHA-512/224, - * SHA-512/256). - * - * @return a message digest object. - */ -sha512.create = function(algorithm) { - // do initialization as necessary - if(!_initialized) { - _init(); + get bytes () { + return pbm.PublicKey.encode({ + Type: pbm.KeyType.Ed25519, + Data: this.marshal() + }).finish() } - if(typeof algorithm === 'undefined') { - algorithm = 'SHA-512'; + equals (key) { + return uint8ArrayEquals(this.bytes, key.bytes) } - if(!(algorithm in _states)) { - throw new Error('Invalid SHA-512 algorithm: ' + algorithm); + async hash () { + const { bytes } = await sha256.digest(this.bytes) + + return bytes } +} - // SHA-512 state contains eight 64-bit integers (each as two 32-bit ints) - var _state = _states[algorithm]; - var _h = null; +class Ed25519PrivateKey { + // key - 64 byte Uint8Array containing private key + // publicKey - 32 byte Uint8Array containing public key + constructor (key, publicKey) { + this._key = ensureKey(key, crypto.privateKeyLength) + this._publicKey = ensureKey(publicKey, crypto.publicKeyLength) + } - // input buffer - var _input = forge.util.createBuffer(); + async sign (message) { // eslint-disable-line require-await + return crypto.hashAndSign(this._key, message) + } - // used for 64-bit word storage - var _w = new Array(80); - for(var wi = 0; wi < 80; ++wi) { - _w[wi] = new Array(2); + get public () { + return new Ed25519PublicKey(this._publicKey) } - // determine digest length by algorithm name (default) - var digestLength = 64; - switch(algorithm) { - case 'SHA-384': - digestLength = 48; - break; - case 'SHA-512/256': - digestLength = 32; - break; - case 'SHA-512/224': - digestLength = 28; - break; + marshal () { + return this._key } - // message digest object - var md = { - // SHA-512 => sha512 - algorithm: algorithm.replace('-', '').toLowerCase(), - blockLength: 128, - digestLength: digestLength, - // 56-bit length of message so far (does not including padding) - messageLength: 0, - // true message length - fullMessageLength: null, - // size of message length in bytes - messageLengthSize: 16 - }; + get bytes () { + return pbm.PrivateKey.encode({ + Type: pbm.KeyType.Ed25519, + Data: this.marshal() + }).finish() + } - /** - * Starts the digest. - * - * @return this digest object. - */ - md.start = function() { - // up to 56-bit message length for convenience - md.messageLength = 0; + equals (key) { + return uint8ArrayEquals(this.bytes, key.bytes) + } - // full message length (set md.messageLength128 for backwards-compatibility) - md.fullMessageLength = md.messageLength128 = []; - var int32s = md.messageLengthSize / 4; - for(var i = 0; i < int32s; ++i) { - md.fullMessageLength.push(0); - } - _input = forge.util.createBuffer(); - _h = new Array(_state.length); - for(var i = 0; i < _state.length; ++i) { - _h[i] = _state[i].slice(0); - } - return md; - }; - // start digest automatically for first time - md.start(); + async hash () { + const { bytes } = await sha256.digest(this.bytes) + + return bytes + } /** - * Updates the digest with the given message input. The given input can - * treated as raw input (no encoding will be applied) or an encoding of - * 'utf8' maybe given to encode the input using UTF-8. + * Gets the ID of the key. * - * @param msg the message input to update with. - * @param encoding the encoding to use (default: 'raw', other: 'utf8'). + * The key id is the base58 encoding of the identity multihash containing its public key. + * The public key is a protobuf encoding containing a type and the DER encoding + * of the PKCS SubjectPublicKeyInfo. * - * @return this digest object. + * @returns {Promise} */ - md.update = function(msg, encoding) { - if(encoding === 'utf8') { - msg = forge.util.encodeUtf8(msg); - } + async id () { + const encoding = await identity.digest(this.public.bytes) + return base58btc.encode(encoding.bytes).substring(1) + } - // update message length - var len = msg.length; - md.messageLength += len; - len = [(len / 0x100000000) >>> 0, len >>> 0]; - for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { - md.fullMessageLength[i] += len[1]; - len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0); - md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; - len[0] = ((len[1] / 0x100000000) >>> 0); + /** + * Exports the key into a password protected `format` + * + * @param {string} password - The password to encrypt the key + * @param {string} [format=libp2p-key] - The format in which to export as + * @returns {Promise} The encrypted private key + */ + async export (password, format = 'libp2p-key') { // eslint-disable-line require-await + if (format === 'libp2p-key') { + return exporter.export(this.bytes, password) + } else { + throw errcode(new Error(`export format '${format}' is not supported`), 'ERR_INVALID_EXPORT_FORMAT') } + } +} - // add bytes to input buffer - _input.putBytes(msg); - - // process bytes - _update(_h, _w, _input); - - // compact input buffer every 2K or if empty - if(_input.read > 2048 || _input.length() === 0) { - _input.compact(); - } +function unmarshalEd25519PrivateKey (bytes) { + // Try the old, redundant public key version + if (bytes.length > crypto.privateKeyLength) { + bytes = ensureKey(bytes, crypto.privateKeyLength + crypto.publicKeyLength) + const privateKeyBytes = bytes.slice(0, crypto.privateKeyLength) + const publicKeyBytes = bytes.slice(crypto.privateKeyLength, bytes.length) + return new Ed25519PrivateKey(privateKeyBytes, publicKeyBytes) + } - return md; - }; + bytes = ensureKey(bytes, crypto.privateKeyLength) + const privateKeyBytes = bytes.slice(0, crypto.privateKeyLength) + const publicKeyBytes = bytes.slice(crypto.publicKeyLength) + return new Ed25519PrivateKey(privateKeyBytes, publicKeyBytes) +} - /** - * Produces the digest. - * - * @return a byte buffer containing the digest value. - */ - md.digest = function() { - /* Note: Here we copy the remaining bytes in the input buffer and - add the appropriate SHA-512 padding. Then we do the final update - on a copy of the state so that if the user wants to get - intermediate digests they can do so. */ +function unmarshalEd25519PublicKey (bytes) { + bytes = ensureKey(bytes, crypto.publicKeyLength) + return new Ed25519PublicKey(bytes) +} - /* Determine the number of bytes that must be added to the message - to ensure its length is congruent to 896 mod 1024. In other words, - the data to be digested must be a multiple of 1024 bits (or 128 bytes). - This data includes the message, some padding, and the length of the - message. Since the length of the message will be encoded as 16 bytes (128 - bits), that means that the last segment of the data must have 112 bytes - (896 bits) of message and padding. Therefore, the length of the message - plus the padding must be congruent to 896 mod 1024 because - 1024 - 128 = 896. +async function generateKeyPair () { + const { privateKey, publicKey } = await crypto.generateKey() + return new Ed25519PrivateKey(privateKey, publicKey) +} - In order to fill up the message length it must be filled with - padding that begins with 1 bit followed by all 0 bits. Padding - must *always* be present, so if the message length is already - congruent to 896 mod 1024, then 1024 padding bits must be added. */ +async function generateKeyPairFromSeed (seed) { + const { privateKey, publicKey } = await crypto.generateKeyFromSeed(seed) + return new Ed25519PrivateKey(privateKey, publicKey) +} - var finalBlock = forge.util.createBuffer(); - finalBlock.putBytes(_input.bytes()); +function ensureKey (key, length) { + key = Uint8Array.from(key || []) + if (key.length !== length) { + throw errcode(new Error(`Key must be a Uint8Array of length ${length}, got ${key.length}`), 'ERR_INVALID_KEY_TYPE') + } + return key +} - // compute remaining size to be digested (include message length size) - var remaining = ( - md.fullMessageLength[md.fullMessageLength.length - 1] + - md.messageLengthSize); +module.exports = { + Ed25519PublicKey, + Ed25519PrivateKey, + unmarshalEd25519PrivateKey, + unmarshalEd25519PublicKey, + generateKeyPair, + generateKeyPairFromSeed +} - // add padding for overflow blockSize - overflow - // _padding starts with 1 byte with first bit is set (byte value 128), then - // there may be up to (blockSize - 1) other pad bytes - var overflow = remaining & (md.blockLength - 1); - finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); - // serialize message length in bits in big-endian order; since length - // is stored in bytes we multiply by 8 and add carry from next int - var next, carry; - var bits = md.fullMessageLength[0] * 8; - for(var i = 0; i < md.fullMessageLength.length - 1; ++i) { - next = md.fullMessageLength[i + 1] * 8; - carry = (next / 0x100000000) >>> 0; - bits += carry; - finalBlock.putInt32(bits >>> 0); - bits = next >>> 0; - } - finalBlock.putInt32(bits); +/***/ }), - var h = new Array(_h.length); - for(var i = 0; i < _h.length; ++i) { - h[i] = _h[i].slice(0); - } - _update(h, _w, finalBlock); - var rval = forge.util.createBuffer(); - var hlen; - if(algorithm === 'SHA-512') { - hlen = h.length; - } else if(algorithm === 'SHA-384') { - hlen = h.length - 2; - } else { - hlen = h.length - 4; - } - for(var i = 0; i < hlen; ++i) { - rval.putInt32(h[i][0]); - if(i !== hlen - 1 || algorithm !== 'SHA-512/224') { - rval.putInt32(h[i][1]); - } - } - return rval; - }; +/***/ 16407: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return md; -}; -// sha-512 padding bytes not initialized yet -var _padding = null; -var _initialized = false; -// table of constants -var _k = null; +const ed = __nccwpck_require__(67862) -// initial hash states -var _states = null; +const PUBLIC_KEY_BYTE_LENGTH = 32 +const PRIVATE_KEY_BYTE_LENGTH = 64 // private key is actually 32 bytes but for historical reasons we concat private and public keys +const KEYS_BYTE_LENGTH = 32 -/** - * Initializes the constant tables. - */ -function _init() { - // create padding - _padding = String.fromCharCode(128); - _padding += forge.util.fillString(String.fromCharCode(0x00), 128); +exports.publicKeyLength = PUBLIC_KEY_BYTE_LENGTH +exports.privateKeyLength = PRIVATE_KEY_BYTE_LENGTH - // create K table for SHA-512 - _k = [ - [0x428a2f98, 0xd728ae22], [0x71374491, 0x23ef65cd], - [0xb5c0fbcf, 0xec4d3b2f], [0xe9b5dba5, 0x8189dbbc], - [0x3956c25b, 0xf348b538], [0x59f111f1, 0xb605d019], - [0x923f82a4, 0xaf194f9b], [0xab1c5ed5, 0xda6d8118], - [0xd807aa98, 0xa3030242], [0x12835b01, 0x45706fbe], - [0x243185be, 0x4ee4b28c], [0x550c7dc3, 0xd5ffb4e2], - [0x72be5d74, 0xf27b896f], [0x80deb1fe, 0x3b1696b1], - [0x9bdc06a7, 0x25c71235], [0xc19bf174, 0xcf692694], - [0xe49b69c1, 0x9ef14ad2], [0xefbe4786, 0x384f25e3], - [0x0fc19dc6, 0x8b8cd5b5], [0x240ca1cc, 0x77ac9c65], - [0x2de92c6f, 0x592b0275], [0x4a7484aa, 0x6ea6e483], - [0x5cb0a9dc, 0xbd41fbd4], [0x76f988da, 0x831153b5], - [0x983e5152, 0xee66dfab], [0xa831c66d, 0x2db43210], - [0xb00327c8, 0x98fb213f], [0xbf597fc7, 0xbeef0ee4], - [0xc6e00bf3, 0x3da88fc2], [0xd5a79147, 0x930aa725], - [0x06ca6351, 0xe003826f], [0x14292967, 0x0a0e6e70], - [0x27b70a85, 0x46d22ffc], [0x2e1b2138, 0x5c26c926], - [0x4d2c6dfc, 0x5ac42aed], [0x53380d13, 0x9d95b3df], - [0x650a7354, 0x8baf63de], [0x766a0abb, 0x3c77b2a8], - [0x81c2c92e, 0x47edaee6], [0x92722c85, 0x1482353b], - [0xa2bfe8a1, 0x4cf10364], [0xa81a664b, 0xbc423001], - [0xc24b8b70, 0xd0f89791], [0xc76c51a3, 0x0654be30], - [0xd192e819, 0xd6ef5218], [0xd6990624, 0x5565a910], - [0xf40e3585, 0x5771202a], [0x106aa070, 0x32bbd1b8], - [0x19a4c116, 0xb8d2d0c8], [0x1e376c08, 0x5141ab53], - [0x2748774c, 0xdf8eeb99], [0x34b0bcb5, 0xe19b48a8], - [0x391c0cb3, 0xc5c95a63], [0x4ed8aa4a, 0xe3418acb], - [0x5b9cca4f, 0x7763e373], [0x682e6ff3, 0xd6b2b8a3], - [0x748f82ee, 0x5defb2fc], [0x78a5636f, 0x43172f60], - [0x84c87814, 0xa1f0ab72], [0x8cc70208, 0x1a6439ec], - [0x90befffa, 0x23631e28], [0xa4506ceb, 0xde82bde9], - [0xbef9a3f7, 0xb2c67915], [0xc67178f2, 0xe372532b], - [0xca273ece, 0xea26619c], [0xd186b8c7, 0x21c0c207], - [0xeada7dd6, 0xcde0eb1e], [0xf57d4f7f, 0xee6ed178], - [0x06f067aa, 0x72176fba], [0x0a637dc5, 0xa2c898a6], - [0x113f9804, 0xbef90dae], [0x1b710b35, 0x131c471b], - [0x28db77f5, 0x23047d84], [0x32caab7b, 0x40c72493], - [0x3c9ebe0a, 0x15c9bebc], [0x431d67c4, 0x9c100d4c], - [0x4cc5d4be, 0xcb3e42b6], [0x597f299c, 0xfc657e2a], - [0x5fcb6fab, 0x3ad6faec], [0x6c44198c, 0x4a475817] - ]; +exports.generateKey = async function () { + // the actual private key (32 bytes) + const privateKeyRaw = ed.utils.randomPrivateKey() + const publicKey = await ed.getPublicKey(privateKeyRaw) - // initial hash states - _states = {}; - _states['SHA-512'] = [ - [0x6a09e667, 0xf3bcc908], - [0xbb67ae85, 0x84caa73b], - [0x3c6ef372, 0xfe94f82b], - [0xa54ff53a, 0x5f1d36f1], - [0x510e527f, 0xade682d1], - [0x9b05688c, 0x2b3e6c1f], - [0x1f83d9ab, 0xfb41bd6b], - [0x5be0cd19, 0x137e2179] - ]; - _states['SHA-384'] = [ - [0xcbbb9d5d, 0xc1059ed8], - [0x629a292a, 0x367cd507], - [0x9159015a, 0x3070dd17], - [0x152fecd8, 0xf70e5939], - [0x67332667, 0xffc00b31], - [0x8eb44a87, 0x68581511], - [0xdb0c2e0d, 0x64f98fa7], - [0x47b5481d, 0xbefa4fa4] - ]; - _states['SHA-512/256'] = [ - [0x22312194, 0xFC2BF72C], - [0x9F555FA3, 0xC84C64C2], - [0x2393B86B, 0x6F53B151], - [0x96387719, 0x5940EABD], - [0x96283EE2, 0xA88EFFE3], - [0xBE5E1E25, 0x53863992], - [0x2B0199FC, 0x2C85B8AA], - [0x0EB72DDC, 0x81C52CA2] - ]; - _states['SHA-512/224'] = [ - [0x8C3D37C8, 0x19544DA2], - [0x73E19966, 0x89DCD4D6], - [0x1DFAB7AE, 0x32FF9C82], - [0x679DD514, 0x582F9FCF], - [0x0F6D2B69, 0x7BD44DA8], - [0x77E36F73, 0x04C48942], - [0x3F9D85A8, 0x6A1D36C8], - [0x1112E6AD, 0x91D692A1] - ]; + // concatenated the public key to the private key + const privateKey = concatKeys(privateKeyRaw, publicKey) - // now initialized - _initialized = true; + return { + privateKey, + publicKey + } } /** - * Updates a SHA-512 state with the given byte buffer. + * Generate keypair from a seed * - * @param s the SHA-512 state to update. - * @param w the array to use to store words. - * @param bytes the byte buffer to update with. + * @param {Uint8Array} seed - seed should be a 32 byte uint8array + * @returns */ -function _update(s, w, bytes) { - // consume 512 bit (128 byte) chunks - var t1_hi, t1_lo; - var t2_hi, t2_lo; - var s0_hi, s0_lo; - var s1_hi, s1_lo; - var ch_hi, ch_lo; - var maj_hi, maj_lo; - var a_hi, a_lo; - var b_hi, b_lo; - var c_hi, c_lo; - var d_hi, d_lo; - var e_hi, e_lo; - var f_hi, f_lo; - var g_hi, g_lo; - var h_hi, h_lo; - var i, hi, lo, w2, w7, w15, w16; - var len = bytes.length(); - while(len >= 128) { - // the w array will be populated with sixteen 64-bit big-endian words - // and then extended into 64 64-bit words according to SHA-512 - for(i = 0; i < 16; ++i) { - w[i][0] = bytes.getInt32() >>> 0; - w[i][1] = bytes.getInt32() >>> 0; - } - for(; i < 80; ++i) { - // for word 2 words ago: ROTR 19(x) ^ ROTR 61(x) ^ SHR 6(x) - w2 = w[i - 2]; - hi = w2[0]; - lo = w2[1]; - - // high bits - t1_hi = ( - ((hi >>> 19) | (lo << 13)) ^ // ROTR 19 - ((lo >>> 29) | (hi << 3)) ^ // ROTR 61/(swap + ROTR 29) - (hi >>> 6)) >>> 0; // SHR 6 - // low bits - t1_lo = ( - ((hi << 13) | (lo >>> 19)) ^ // ROTR 19 - ((lo << 3) | (hi >>> 29)) ^ // ROTR 61/(swap + ROTR 29) - ((hi << 26) | (lo >>> 6))) >>> 0; // SHR 6 - - // for word 15 words ago: ROTR 1(x) ^ ROTR 8(x) ^ SHR 7(x) - w15 = w[i - 15]; - hi = w15[0]; - lo = w15[1]; +exports.generateKeyFromSeed = async function (seed) { + if (seed.length !== KEYS_BYTE_LENGTH) { + throw new TypeError('"seed" must be 32 bytes in length.') + } else if (!(seed instanceof Uint8Array)) { + throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.') + } - // high bits - t2_hi = ( - ((hi >>> 1) | (lo << 31)) ^ // ROTR 1 - ((hi >>> 8) | (lo << 24)) ^ // ROTR 8 - (hi >>> 7)) >>> 0; // SHR 7 - // low bits - t2_lo = ( - ((hi << 31) | (lo >>> 1)) ^ // ROTR 1 - ((hi << 24) | (lo >>> 8)) ^ // ROTR 8 - ((hi << 25) | (lo >>> 7))) >>> 0; // SHR 7 + // based on node forges algorithm, the seed is used directly as private key + const privateKeyRaw = seed + const publicKey = await ed.getPublicKey(privateKeyRaw) - // sum(t1, word 7 ago, t2, word 16 ago) modulo 2^64 (carry lo overflow) - w7 = w[i - 7]; - w16 = w[i - 16]; - lo = (t1_lo + w7[1] + t2_lo + w16[1]); - w[i][0] = (t1_hi + w7[0] + t2_hi + w16[0] + - ((lo / 0x100000000) >>> 0)) >>> 0; - w[i][1] = lo >>> 0; - } + const privateKey = concatKeys(privateKeyRaw, publicKey) - // initialize hash value for this chunk - a_hi = s[0][0]; - a_lo = s[0][1]; - b_hi = s[1][0]; - b_lo = s[1][1]; - c_hi = s[2][0]; - c_lo = s[2][1]; - d_hi = s[3][0]; - d_lo = s[3][1]; - e_hi = s[4][0]; - e_lo = s[4][1]; - f_hi = s[5][0]; - f_lo = s[5][1]; - g_hi = s[6][0]; - g_lo = s[6][1]; - h_hi = s[7][0]; - h_lo = s[7][1]; + return { + privateKey, + publicKey + } +} - // round function - for(i = 0; i < 80; ++i) { - // Sum1(e) = ROTR 14(e) ^ ROTR 18(e) ^ ROTR 41(e) - s1_hi = ( - ((e_hi >>> 14) | (e_lo << 18)) ^ // ROTR 14 - ((e_hi >>> 18) | (e_lo << 14)) ^ // ROTR 18 - ((e_lo >>> 9) | (e_hi << 23))) >>> 0; // ROTR 41/(swap + ROTR 9) - s1_lo = ( - ((e_hi << 18) | (e_lo >>> 14)) ^ // ROTR 14 - ((e_hi << 14) | (e_lo >>> 18)) ^ // ROTR 18 - ((e_lo << 23) | (e_hi >>> 9))) >>> 0; // ROTR 41/(swap + ROTR 9) +exports.hashAndSign = function (privateKey, msg) { + const privateKeyRaw = privateKey.slice(0, KEYS_BYTE_LENGTH) - // Ch(e, f, g) (optimized the same way as SHA-1) - ch_hi = (g_hi ^ (e_hi & (f_hi ^ g_hi))) >>> 0; - ch_lo = (g_lo ^ (e_lo & (f_lo ^ g_lo))) >>> 0; + return ed.sign(msg, privateKeyRaw) +} - // Sum0(a) = ROTR 28(a) ^ ROTR 34(a) ^ ROTR 39(a) - s0_hi = ( - ((a_hi >>> 28) | (a_lo << 4)) ^ // ROTR 28 - ((a_lo >>> 2) | (a_hi << 30)) ^ // ROTR 34/(swap + ROTR 2) - ((a_lo >>> 7) | (a_hi << 25))) >>> 0; // ROTR 39/(swap + ROTR 7) - s0_lo = ( - ((a_hi << 4) | (a_lo >>> 28)) ^ // ROTR 28 - ((a_lo << 30) | (a_hi >>> 2)) ^ // ROTR 34/(swap + ROTR 2) - ((a_lo << 25) | (a_hi >>> 7))) >>> 0; // ROTR 39/(swap + ROTR 7) +exports.hashAndVerify = function (publicKey, sig, msg) { + return ed.verify(sig, msg, publicKey) +} - // Maj(a, b, c) (optimized the same way as SHA-1) - maj_hi = ((a_hi & b_hi) | (c_hi & (a_hi ^ b_hi))) >>> 0; - maj_lo = ((a_lo & b_lo) | (c_lo & (a_lo ^ b_lo))) >>> 0; +function concatKeys (privateKeyRaw, publicKey) { + const privateKey = new Uint8Array(exports.privateKeyLength) + for (let i = 0; i < KEYS_BYTE_LENGTH; i++) { + privateKey[i] = privateKeyRaw[i] + privateKey[KEYS_BYTE_LENGTH + i] = publicKey[i] + } + return privateKey +} - // main algorithm - // t1 = (h + s1 + ch + _k[i] + _w[i]) modulo 2^64 (carry lo overflow) - lo = (h_lo + s1_lo + ch_lo + _k[i][1] + w[i][1]); - t1_hi = (h_hi + s1_hi + ch_hi + _k[i][0] + w[i][0] + - ((lo / 0x100000000) >>> 0)) >>> 0; - t1_lo = lo >>> 0; - // t2 = s0 + maj modulo 2^64 (carry lo overflow) - lo = s0_lo + maj_lo; - t2_hi = (s0_hi + maj_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - t2_lo = lo >>> 0; +/***/ }), - h_hi = g_hi; - h_lo = g_lo; +/***/ 23118: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - g_hi = f_hi; - g_lo = f_lo; - f_hi = e_hi; - f_lo = e_lo; - // e = (d + t1) modulo 2^64 (carry lo overflow) - lo = d_lo + t1_lo; - e_hi = (d_hi + t1_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - e_lo = lo >>> 0; +const ecdh = __nccwpck_require__(65977) - d_hi = c_hi; - d_lo = c_lo; +// Generates an ephemeral public key and returns a function that will compute +// the shared secret key. +// +// Focuses only on ECDH now, but can be made more general in the future. +module.exports = async (curve) => ecdh.generateEphmeralKeyPair(curve) // eslint-disable-line require-await - c_hi = b_hi; - c_lo = b_lo; - b_hi = a_hi; - b_lo = a_lo; +/***/ }), - // a = (t1 + t2) modulo 2^64 (carry lo overflow) - lo = t1_lo + t2_lo; - a_hi = (t1_hi + t2_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - a_lo = lo >>> 0; - } +/***/ 87213: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // update hash state (additional modulo 2^64) - lo = s[0][1] + a_lo; - s[0][0] = (s[0][0] + a_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[0][1] = lo >>> 0; - lo = s[1][1] + b_lo; - s[1][0] = (s[1][0] + b_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[1][1] = lo >>> 0; - lo = s[2][1] + c_lo; - s[2][0] = (s[2][0] + c_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[2][1] = lo >>> 0; +const { base64 } = __nccwpck_require__(62561) +const ciphers = __nccwpck_require__(55680) - lo = s[3][1] + d_lo; - s[3][0] = (s[3][0] + d_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[3][1] = lo >>> 0; +module.exports = { + /** + * Exports the given PrivateKey as a base64 encoded string. + * The PrivateKey is encrypted via a password derived PBKDF2 key + * leveraging the aes-gcm cipher algorithm. + * + * @param {Uint8Array} privateKey - The PrivateKey protobuf + * @param {string} password + * @returns {Promise} A base64 encoded string + */ + export: async function (privateKey, password) { + const cipher = ciphers.create() + const encryptedKey = await cipher.encrypt(privateKey, password) + return base64.encode(encryptedKey) + } +} - lo = s[4][1] + e_lo; - s[4][0] = (s[4][0] + e_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[4][1] = lo >>> 0; - lo = s[5][1] + f_lo; - s[5][0] = (s[5][0] + f_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[5][1] = lo >>> 0; +/***/ }), - lo = s[6][1] + g_lo; - s[6][0] = (s[6][0] + g_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[6][1] = lo >>> 0; +/***/ 34388: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - lo = s[7][1] + h_lo; - s[7][0] = (s[7][0] + h_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[7][1] = lo >>> 0; - len -= 128; + +const { base64 } = __nccwpck_require__(62561) +const ciphers = __nccwpck_require__(55680) + +module.exports = { + /** + * Attempts to decrypt a base64 encoded PrivateKey string + * with the given password. The privateKey must have been exported + * using the same password and underlying cipher (aes-gcm) + * + * @param {string} privateKey - A base64 encoded encrypted key + * @param {string} password + * @returns {Promise} The private key protobuf + */ + import: async function (privateKey, password) { + const encryptedKey = base64.decode(privateKey) + const cipher = ciphers.create() + return await cipher.decrypt(encryptedKey, password) } } /***/ }), -<<<<<<< HEAD -/***/ 19239: -======= -/***/ 36536: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 19428: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Utility functions for web applications. - * - * @author Dave Longley - * - * Copyright (c) 2010-2018 Digital Bazaar, Inc. - */ -<<<<<<< HEAD -var forge = __nccwpck_require__(72177); -var baseN = __nccwpck_require__(56845); -======= -var forge = __nccwpck_require__(96630); -var baseN = __nccwpck_require__(12390); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/* Utilities API */ -var util = module.exports = forge.util = forge.util || {}; -// define setImmediate and nextTick -(function() { - // use native nextTick (unless we're in webpack) - // webpack (or better node-libs-browser polyfill) sets process.browser. - // this way we can detect webpack properly - if(typeof process !== 'undefined' && process.nextTick && !process.browser) { - util.nextTick = process.nextTick; - if(typeof setImmediate === 'function') { - util.setImmediate = setImmediate; - } else { - // polyfill setImmediate with nextTick, older versions of node - // (those w/o setImmediate) won't totally starve IO - util.setImmediate = util.nextTick; - } - return; - } +const keysPBM = __nccwpck_require__(63644) +__nccwpck_require__(14098) +__nccwpck_require__(55363) +const forge = __nccwpck_require__(56389) +const errcode = __nccwpck_require__(18598) +const { fromString: uint8ArrayFromString } = __nccwpck_require__(7433) - // polyfill nextTick with native setImmediate - if(typeof setImmediate === 'function') { - util.setImmediate = function() { return setImmediate.apply(undefined, arguments); }; - util.nextTick = function(callback) { - return setImmediate(callback); - }; - return; +const importer = __nccwpck_require__(34388) + +const supportedKeys = { + rsa: __nccwpck_require__(77122), + ed25519: __nccwpck_require__(50594), + secp256k1: __nccwpck_require__(10466)(keysPBM, __nccwpck_require__(33642)) +} + +const ErrMissingSecp256K1 = { + message: 'secp256k1 support requires libp2p-crypto-secp256k1 package', + code: 'ERR_MISSING_PACKAGE' +} + +function typeToKey (type) { + const key = supportedKeys[type.toLowerCase()] + if (!key) { + const supported = Object.keys(supportedKeys).join(' / ') + throw errcode(new Error(`invalid or unsupported key type ${type}. Must be ${supported}`), 'ERR_UNSUPPORTED_KEY_TYPE') } + return key +} - /* Note: A polyfill upgrade pattern is used here to allow combining - polyfills. For example, MutationObserver is fast, but blocks UI updates, - so it needs to allow UI updates periodically, so it falls back on - postMessage or setTimeout. */ +// Generates a keypair of the given type and bitsize +const generateKeyPair = async (type, bits) => { // eslint-disable-line require-await + return typeToKey(type).generateKeyPair(bits) +} - // polyfill with setTimeout - util.setImmediate = function(callback) { - setTimeout(callback, 0); - }; +// Generates a keypair of the given type and bitsize +// seed is a 32 byte uint8array +const generateKeyPairFromSeed = async (type, seed, bits) => { // eslint-disable-line require-await + const key = typeToKey(type) + if (type.toLowerCase() !== 'ed25519') { + throw errcode(new Error('Seed key derivation is unimplemented for RSA or secp256k1'), 'ERR_UNSUPPORTED_KEY_DERIVATION_TYPE') + } + return key.generateKeyPairFromSeed(seed, bits) +} - // upgrade polyfill to use postMessage - if(typeof window !== 'undefined' && - typeof window.postMessage === 'function') { - var msg = 'forge.setImmediate'; - var callbacks = []; - util.setImmediate = function(callback) { - callbacks.push(callback); - // only send message when one hasn't been sent in - // the current turn of the event loop - if(callbacks.length === 1) { - window.postMessage(msg, '*'); - } - }; - function handler(event) { - if(event.source === window && event.data === msg) { - event.stopPropagation(); - var copy = callbacks.slice(); - callbacks.length = 0; - copy.forEach(function(callback) { - callback(); - }); +// Converts a protobuf serialized public key into its +// representative object +const unmarshalPublicKey = (buf) => { + const decoded = keysPBM.PublicKey.decode(buf) + const data = decoded.Data + + switch (decoded.Type) { + case keysPBM.KeyType.RSA: + return supportedKeys.rsa.unmarshalRsaPublicKey(data) + case keysPBM.KeyType.Ed25519: + return supportedKeys.ed25519.unmarshalEd25519PublicKey(data) + case keysPBM.KeyType.Secp256k1: + if (supportedKeys.secp256k1) { + return supportedKeys.secp256k1.unmarshalSecp256k1PublicKey(data) + } else { + throw errcode(new Error(ErrMissingSecp256K1.message), ErrMissingSecp256K1.code) } - } - window.addEventListener('message', handler, true); + default: + typeToKey(decoded.Type) // throws because type is not supported } +} - // upgrade polyfill to use MutationObserver - if(typeof MutationObserver !== 'undefined') { - // polyfill with MutationObserver - var now = Date.now(); - var attr = true; - var div = document.createElement('div'); - var callbacks = []; - new MutationObserver(function() { - var copy = callbacks.slice(); - callbacks.length = 0; - copy.forEach(function(callback) { - callback(); - }); - }).observe(div, {attributes: true}); - var oldSetImmediate = util.setImmediate; - util.setImmediate = function(callback) { - if(Date.now() - now > 15) { - now = Date.now(); - oldSetImmediate(callback); +// Converts a public key object into a protobuf serialized public key +const marshalPublicKey = (key, type) => { + type = (type || 'rsa').toLowerCase() + typeToKey(type) // check type + return key.bytes +} + +// Converts a protobuf serialized private key into its +// representative object +const unmarshalPrivateKey = async (buf) => { // eslint-disable-line require-await + const decoded = keysPBM.PrivateKey.decode(buf) + const data = decoded.Data + + switch (decoded.Type) { + case keysPBM.KeyType.RSA: + return supportedKeys.rsa.unmarshalRsaPrivateKey(data) + case keysPBM.KeyType.Ed25519: + return supportedKeys.ed25519.unmarshalEd25519PrivateKey(data) + case keysPBM.KeyType.Secp256k1: + if (supportedKeys.secp256k1) { + return supportedKeys.secp256k1.unmarshalSecp256k1PrivateKey(data) } else { - callbacks.push(callback); - // only trigger observer when it hasn't been triggered in - // the current turn of the event loop - if(callbacks.length === 1) { - div.setAttribute('a', attr = !attr); - } + throw errcode(new Error(ErrMissingSecp256K1.message), ErrMissingSecp256K1.code) } - }; + default: + typeToKey(decoded.Type) // throws because type is not supported } +} - util.nextTick = util.setImmediate; -})(); - -// check if running under Node.js -util.isNodejs = - typeof process !== 'undefined' && process.versions && process.versions.node; +// Converts a private key object into a protobuf serialized private key +const marshalPrivateKey = (key, type) => { + type = (type || 'rsa').toLowerCase() + typeToKey(type) // check type + return key.bytes +} +/** + * + * @param {string} encryptedKey + * @param {string} password + */ +const importKey = async (encryptedKey, password) => { // eslint-disable-line require-await + try { + const key = await importer.import(encryptedKey, password) + return unmarshalPrivateKey(key) + } catch (_) { + // Ignore and try the old pem decrypt + } -// 'self' will also work in Web Workers (instance of WorkerGlobalScope) while -// it will point to `window` in the main thread. -// To remain compatible with older browsers, we fall back to 'window' if 'self' -// is not available. -util.globalScope = (function() { - if(util.isNodejs) { - return global; + // Only rsa supports pem right now + const key = forge.pki.decryptRsaPrivateKey(encryptedKey, password) + if (key === null) { + throw errcode(new Error('Cannot read the key, most likely the password is wrong or not a RSA key'), 'ERR_CANNOT_DECRYPT_PEM') } + let der = forge.asn1.toDer(forge.pki.privateKeyToAsn1(key)) + der = uint8ArrayFromString(der.getBytes(), 'ascii') + return supportedKeys.rsa.unmarshalRsaPrivateKey(der) +} - return typeof self === 'undefined' ? window : self; -})(); +module.exports = { + supportedKeys, + keysPBM, + keyStretcher: __nccwpck_require__(7858), + generateEphemeralKeyPair: __nccwpck_require__(23118), + generateKeyPair, + generateKeyPairFromSeed, + unmarshalPublicKey, + marshalPublicKey, + unmarshalPrivateKey, + marshalPrivateKey, + import: importKey +} -// define isArray -util.isArray = Array.isArray || function(x) { - return Object.prototype.toString.call(x) === '[object Array]'; -}; -// define isArrayBuffer -util.isArrayBuffer = function(x) { - return typeof ArrayBuffer !== 'undefined' && x instanceof ArrayBuffer; -}; +/***/ }), -// define isArrayBufferView -util.isArrayBufferView = function(x) { - return x && util.isArrayBuffer(x.buffer) && x.byteLength !== undefined; -}; +/***/ 7858: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Ensure a bits param is 8, 16, 24, or 32. Used to validate input for - * algorithms where bit manipulation, JavaScript limitations, and/or algorithm - * design only allow for byte operations of a limited size. - * - * @param n number of bits. - * - * Throw Error if n invalid. - */ -function _checkBitsParam(n) { - if(!(n === 8 || n === 16 || n === 24 || n === 32)) { - throw new Error('Only 8, 16, 24, or 32 bits supported: ' + n); + + +const errcode = __nccwpck_require__(18598) +const { concat: uint8ArrayConcat } = __nccwpck_require__(85991) +const { fromString: uint8ArrayFromString } = __nccwpck_require__(7433) +const hmac = __nccwpck_require__(76721) + +const cipherMap = { + 'AES-128': { + ivSize: 16, + keySize: 16 + }, + 'AES-256': { + ivSize: 16, + keySize: 32 + }, + Blowfish: { + ivSize: 8, + cipherKeySize: 32 } } -// TODO: set ByteBuffer to best available backing -util.ByteBuffer = ByteStringBuffer; +// Generates a set of keys for each party by stretching the shared key. +// (myIV, theirIV, myCipherKey, theirCipherKey, myMACKey, theirMACKey) +module.exports = async (cipherType, hash, secret) => { + const cipher = cipherMap[cipherType] -/** Buffer w/BinaryString backing */ + if (!cipher) { + const allowed = Object.keys(cipherMap).join(' / ') + throw errcode(new Error(`unknown cipher type '${cipherType}'. Must be ${allowed}`), 'ERR_INVALID_CIPHER_TYPE') + } -/** - * Constructor for a binary string backed byte buffer. - * - * @param [b] the bytes to wrap (either encoded as string, one byte per - * character, or as an ArrayBuffer or Typed Array). - */ -function ByteStringBuffer(b) { - // TODO: update to match DataBuffer API + if (!hash) { + throw errcode(new Error('missing hash type'), 'ERR_MISSING_HASH_TYPE') + } - // the data in this buffer - this.data = ''; - // the pointer for reading from this buffer - this.read = 0; + const cipherKeySize = cipher.keySize + const ivSize = cipher.ivSize + const hmacKeySize = 20 + const seed = uint8ArrayFromString('key expansion') + const resultLength = 2 * (ivSize + cipherKeySize + hmacKeySize) - if(typeof b === 'string') { - this.data = b; - } else if(util.isArrayBuffer(b) || util.isArrayBufferView(b)) { - if(typeof Buffer !== 'undefined' && b instanceof Buffer) { - this.data = b.toString('binary'); - } else { - // convert native buffer to forge buffer - // FIXME: support native buffers internally instead - var arr = new Uint8Array(b); - try { - this.data = String.fromCharCode.apply(null, arr); - } catch(e) { - for(var i = 0; i < arr.length; ++i) { - this.putByte(arr[i]); - } - } + const m = await hmac.create(hash, secret) + let a = await m.digest(seed) + + const result = [] + let j = 0 + + while (j < resultLength) { + const b = await m.digest(uint8ArrayConcat([a, seed])) + let todo = b.length + + if (j + todo > resultLength) { + todo = resultLength - j } - } else if(b instanceof ByteStringBuffer || - (typeof b === 'object' && typeof b.data === 'string' && - typeof b.read === 'number')) { - // copy existing buffer - this.data = b.data; - this.read = b.read; + + result.push(b) + j += todo + a = await m.digest(a) } - // used for v8 optimization - this._constructedStringLength = 0; -} -util.ByteStringBuffer = ByteStringBuffer; + const half = resultLength / 2 + const resultBuffer = uint8ArrayConcat(result) + const r1 = resultBuffer.slice(0, half) + const r2 = resultBuffer.slice(half, resultLength) -/* Note: This is an optimization for V8-based browsers. When V8 concatenates - a string, the strings are only joined logically using a "cons string" or - "constructed/concatenated string". These containers keep references to one - another and can result in very large memory usage. For example, if a 2MB - string is constructed by concatenating 4 bytes together at a time, the - memory usage will be ~44MB; so ~22x increase. The strings are only joined - together when an operation requiring their joining takes place, such as - substr(). This function is called when adding data to this buffer to ensure - these types of strings are periodically joined to reduce the memory - footprint. */ -var _MAX_CONSTRUCTED_STRING_LENGTH = 4096; -util.ByteStringBuffer.prototype._optimizeConstructedString = function(x) { - this._constructedStringLength += x; - if(this._constructedStringLength > _MAX_CONSTRUCTED_STRING_LENGTH) { - // this substr() should cause the constructed string to join - this.data.substr(0, 1); - this._constructedStringLength = 0; + const createKey = (res) => ({ + iv: res.slice(0, ivSize), + cipherKey: res.slice(ivSize, ivSize + cipherKeySize), + macKey: res.slice(ivSize + cipherKeySize) + }) + + return { + k1: createKey(r1), + k2: createKey(r2) } -}; +} -/** - * Gets the number of bytes in this buffer. - * - * @return the number of bytes in this buffer. - */ -util.ByteStringBuffer.prototype.length = function() { - return this.data.length - this.read; -}; -/** - * Gets whether or not this buffer is empty. - * - * @return true if this buffer is empty, false if not. - */ -util.ByteStringBuffer.prototype.isEmpty = function() { - return this.length() <= 0; -}; +/***/ }), -/** - * Puts a byte in this buffer. - * - * @param b the byte to put. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putByte = function(b) { - return this.putBytes(String.fromCharCode(b)); -}; +/***/ 63644: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/*eslint-disable*/ + + +var $protobuf = __nccwpck_require__(73295); + +// Common aliases +var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +var $root = $protobuf.roots["libp2p-crypto-keys"] || ($protobuf.roots["libp2p-crypto-keys"] = {}); /** - * Puts a byte in this buffer N times. - * - * @param b the byte to put. - * @param n the number of bytes of value b to put. - * - * @return this buffer. + * KeyType enum. + * @exports KeyType + * @enum {number} + * @property {number} RSA=0 RSA value + * @property {number} Ed25519=1 Ed25519 value + * @property {number} Secp256k1=2 Secp256k1 value */ -util.ByteStringBuffer.prototype.fillWithByte = function(b, n) { - b = String.fromCharCode(b); - var d = this.data; - while(n > 0) { - if(n & 1) { - d += b; - } - n >>>= 1; - if(n > 0) { - b += b; +$root.KeyType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RSA"] = 0; + values[valuesById[1] = "Ed25519"] = 1; + values[valuesById[2] = "Secp256k1"] = 2; + return values; +})(); + +$root.PublicKey = (function() { + + /** + * Properties of a PublicKey. + * @exports IPublicKey + * @interface IPublicKey + * @property {KeyType} Type PublicKey Type + * @property {Uint8Array} Data PublicKey Data + */ + + /** + * Constructs a new PublicKey. + * @exports PublicKey + * @classdesc Represents a PublicKey. + * @implements IPublicKey + * @constructor + * @param {IPublicKey=} [p] Properties to set + */ + function PublicKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; } - } - this.data = d; - this._optimizeConstructedString(n); - return this; -}; -/** - * Puts bytes in this buffer. - * - * @param bytes the bytes (as a binary encoded string) to put. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putBytes = function(bytes) { - this.data += bytes; - this._optimizeConstructedString(bytes.length); - return this; -}; + /** + * PublicKey Type. + * @member {KeyType} Type + * @memberof PublicKey + * @instance + */ + PublicKey.prototype.Type = 0; -/** - * Puts a UTF-16 encoded string into this buffer. - * - * @param str the string to put. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putString = function(str) { - return this.putBytes(util.encodeUtf8(str)); -}; + /** + * PublicKey Data. + * @member {Uint8Array} Data + * @memberof PublicKey + * @instance + */ + PublicKey.prototype.Data = $util.newBuffer([]); -/** - * Puts a 16-bit integer in this buffer in big-endian order. - * - * @param i the 16-bit integer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt16 = function(i) { - return this.putBytes( - String.fromCharCode(i >> 8 & 0xFF) + - String.fromCharCode(i & 0xFF)); -}; + /** + * Encodes the specified PublicKey message. Does not implicitly {@link PublicKey.verify|verify} messages. + * @function encode + * @memberof PublicKey + * @static + * @param {IPublicKey} m PublicKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + w.uint32(8).int32(m.Type); + w.uint32(18).bytes(m.Data); + return w; + }; -/** - * Puts a 24-bit integer in this buffer in big-endian order. - * - * @param i the 24-bit integer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt24 = function(i) { - return this.putBytes( - String.fromCharCode(i >> 16 & 0xFF) + - String.fromCharCode(i >> 8 & 0xFF) + - String.fromCharCode(i & 0xFF)); -}; + /** + * Decodes a PublicKey message from the specified reader or buffer. + * @function decode + * @memberof PublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {PublicKey} PublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.PublicKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.Type = r.int32(); + break; + case 2: + m.Data = r.bytes(); + break; + default: + r.skipType(t & 7); + break; + } + } + if (!m.hasOwnProperty("Type")) + throw $util.ProtocolError("missing required 'Type'", { instance: m }); + if (!m.hasOwnProperty("Data")) + throw $util.ProtocolError("missing required 'Data'", { instance: m }); + return m; + }; -/** - * Puts a 32-bit integer in this buffer in big-endian order. - * - * @param i the 32-bit integer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt32 = function(i) { - return this.putBytes( - String.fromCharCode(i >> 24 & 0xFF) + - String.fromCharCode(i >> 16 & 0xFF) + - String.fromCharCode(i >> 8 & 0xFF) + - String.fromCharCode(i & 0xFF)); -}; + /** + * Creates a PublicKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof PublicKey + * @static + * @param {Object.} d Plain object + * @returns {PublicKey} PublicKey + */ + PublicKey.fromObject = function fromObject(d) { + if (d instanceof $root.PublicKey) + return d; + var m = new $root.PublicKey(); + switch (d.Type) { + case "RSA": + case 0: + m.Type = 0; + break; + case "Ed25519": + case 1: + m.Type = 1; + break; + case "Secp256k1": + case 2: + m.Type = 2; + break; + } + if (d.Data != null) { + if (typeof d.Data === "string") + $util.base64.decode(d.Data, m.Data = $util.newBuffer($util.base64.length(d.Data)), 0); + else if (d.Data.length) + m.Data = d.Data; + } + return m; + }; -/** - * Puts a 16-bit integer in this buffer in little-endian order. - * - * @param i the 16-bit integer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt16Le = function(i) { - return this.putBytes( - String.fromCharCode(i & 0xFF) + - String.fromCharCode(i >> 8 & 0xFF)); -}; + /** + * Creates a plain object from a PublicKey message. Also converts values to other types if specified. + * @function toObject + * @memberof PublicKey + * @static + * @param {PublicKey} m PublicKey + * @param {$protobuf.IConversionOptions} [o] Conversion options + * @returns {Object.} Plain object + */ + PublicKey.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.defaults) { + d.Type = o.enums === String ? "RSA" : 0; + if (o.bytes === String) + d.Data = ""; + else { + d.Data = []; + if (o.bytes !== Array) + d.Data = $util.newBuffer(d.Data); + } + } + if (m.Type != null && m.hasOwnProperty("Type")) { + d.Type = o.enums === String ? $root.KeyType[m.Type] : m.Type; + } + if (m.Data != null && m.hasOwnProperty("Data")) { + 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; + } + return d; + }; -/** - * Puts a 24-bit integer in this buffer in little-endian order. - * - * @param i the 24-bit integer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt24Le = function(i) { - return this.putBytes( - String.fromCharCode(i & 0xFF) + - String.fromCharCode(i >> 8 & 0xFF) + - String.fromCharCode(i >> 16 & 0xFF)); -}; + /** + * Converts this PublicKey to JSON. + * @function toJSON + * @memberof PublicKey + * @instance + * @returns {Object.} JSON object + */ + PublicKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; -/** - * Puts a 32-bit integer in this buffer in little-endian order. - * - * @param i the 32-bit integer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt32Le = function(i) { - return this.putBytes( - String.fromCharCode(i & 0xFF) + - String.fromCharCode(i >> 8 & 0xFF) + - String.fromCharCode(i >> 16 & 0xFF) + - String.fromCharCode(i >> 24 & 0xFF)); -}; + return PublicKey; +})(); -/** - * Puts an n-bit integer in this buffer in big-endian order. - * - * @param i the n-bit integer. - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt = function(i, n) { - _checkBitsParam(n); - var bytes = ''; - do { - n -= 8; - bytes += String.fromCharCode((i >> n) & 0xFF); - } while(n > 0); - return this.putBytes(bytes); -}; +$root.PrivateKey = (function() { -/** - * Puts a signed n-bit integer in this buffer in big-endian order. Two's - * complement representation is used. - * - * @param i the n-bit integer. - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putSignedInt = function(i, n) { - // putInt checks n - if(i < 0) { - i += 2 << (n - 1); - } - return this.putInt(i, n); -}; + /** + * Properties of a PrivateKey. + * @exports IPrivateKey + * @interface IPrivateKey + * @property {KeyType} Type PrivateKey Type + * @property {Uint8Array} Data PrivateKey Data + */ + + /** + * Constructs a new PrivateKey. + * @exports PrivateKey + * @classdesc Represents a PrivateKey. + * @implements IPrivateKey + * @constructor + * @param {IPrivateKey=} [p] Properties to set + */ + function PrivateKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * PrivateKey Type. + * @member {KeyType} Type + * @memberof PrivateKey + * @instance + */ + PrivateKey.prototype.Type = 0; + + /** + * PrivateKey Data. + * @member {Uint8Array} Data + * @memberof PrivateKey + * @instance + */ + PrivateKey.prototype.Data = $util.newBuffer([]); + + /** + * Encodes the specified PrivateKey message. Does not implicitly {@link PrivateKey.verify|verify} messages. + * @function encode + * @memberof PrivateKey + * @static + * @param {IPrivateKey} m PrivateKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + w.uint32(8).int32(m.Type); + w.uint32(18).bytes(m.Data); + return w; + }; + + /** + * Decodes a PrivateKey message from the specified reader or buffer. + * @function decode + * @memberof PrivateKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {PrivateKey} PrivateKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.PrivateKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.Type = r.int32(); + break; + case 2: + m.Data = r.bytes(); + break; + default: + r.skipType(t & 7); + break; + } + } + if (!m.hasOwnProperty("Type")) + throw $util.ProtocolError("missing required 'Type'", { instance: m }); + if (!m.hasOwnProperty("Data")) + throw $util.ProtocolError("missing required 'Data'", { instance: m }); + return m; + }; + + /** + * Creates a PrivateKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof PrivateKey + * @static + * @param {Object.} d Plain object + * @returns {PrivateKey} PrivateKey + */ + PrivateKey.fromObject = function fromObject(d) { + if (d instanceof $root.PrivateKey) + return d; + var m = new $root.PrivateKey(); + switch (d.Type) { + case "RSA": + case 0: + m.Type = 0; + break; + case "Ed25519": + case 1: + m.Type = 1; + break; + case "Secp256k1": + case 2: + m.Type = 2; + break; + } + if (d.Data != null) { + if (typeof d.Data === "string") + $util.base64.decode(d.Data, m.Data = $util.newBuffer($util.base64.length(d.Data)), 0); + else if (d.Data.length) + m.Data = d.Data; + } + return m; + }; + + /** + * Creates a plain object from a PrivateKey message. Also converts values to other types if specified. + * @function toObject + * @memberof PrivateKey + * @static + * @param {PrivateKey} m PrivateKey + * @param {$protobuf.IConversionOptions} [o] Conversion options + * @returns {Object.} Plain object + */ + PrivateKey.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.defaults) { + d.Type = o.enums === String ? "RSA" : 0; + if (o.bytes === String) + d.Data = ""; + else { + d.Data = []; + if (o.bytes !== Array) + d.Data = $util.newBuffer(d.Data); + } + } + if (m.Type != null && m.hasOwnProperty("Type")) { + d.Type = o.enums === String ? $root.KeyType[m.Type] : m.Type; + } + if (m.Data != null && m.hasOwnProperty("Data")) { + 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; + } + return d; + }; + + /** + * Converts this PrivateKey to JSON. + * @function toJSON + * @memberof PrivateKey + * @instance + * @returns {Object.} JSON object + */ + PrivateKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; -/** - * Puts the given buffer into this buffer. - * - * @param buffer the buffer to put into this one. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putBuffer = function(buffer) { - return this.putBytes(buffer.getBytes()); -}; + return PrivateKey; +})(); -/** - * Gets a byte from this buffer and advances the read pointer by 1. - * - * @return the byte. - */ -util.ByteStringBuffer.prototype.getByte = function() { - return this.data.charCodeAt(this.read++); -}; +module.exports = $root; -/** - * Gets a uint16 from this buffer in big-endian order and advances the read - * pointer by 2. - * - * @return the uint16. - */ -util.ByteStringBuffer.prototype.getInt16 = function() { - var rval = ( - this.data.charCodeAt(this.read) << 8 ^ - this.data.charCodeAt(this.read + 1)); - this.read += 2; - return rval; -}; -/** - * Gets a uint24 from this buffer in big-endian order and advances the read - * pointer by 3. - * - * @return the uint24. - */ -util.ByteStringBuffer.prototype.getInt24 = function() { - var rval = ( - this.data.charCodeAt(this.read) << 16 ^ - this.data.charCodeAt(this.read + 1) << 8 ^ - this.data.charCodeAt(this.read + 2)); - this.read += 3; - return rval; -}; +/***/ }), -/** - * Gets a uint32 from this buffer in big-endian order and advances the read - * pointer by 4. - * - * @return the word. - */ -util.ByteStringBuffer.prototype.getInt32 = function() { - var rval = ( - this.data.charCodeAt(this.read) << 24 ^ - this.data.charCodeAt(this.read + 1) << 16 ^ - this.data.charCodeAt(this.read + 2) << 8 ^ - this.data.charCodeAt(this.read + 3)); - this.read += 4; - return rval; -}; +/***/ 77122: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Gets a uint16 from this buffer in little-endian order and advances the read - * pointer by 2. - * - * @return the uint16. - */ -util.ByteStringBuffer.prototype.getInt16Le = function() { - var rval = ( - this.data.charCodeAt(this.read) ^ - this.data.charCodeAt(this.read + 1) << 8); - this.read += 2; - return rval; -}; -/** - * Gets a uint24 from this buffer in little-endian order and advances the read - * pointer by 3. - * - * @return the uint24. - */ -util.ByteStringBuffer.prototype.getInt24Le = function() { - var rval = ( - this.data.charCodeAt(this.read) ^ - this.data.charCodeAt(this.read + 1) << 8 ^ - this.data.charCodeAt(this.read + 2) << 16); - this.read += 3; - return rval; -}; -/** - * Gets a uint32 from this buffer in little-endian order and advances the read - * pointer by 4. - * - * @return the word. - */ -util.ByteStringBuffer.prototype.getInt32Le = function() { - var rval = ( - this.data.charCodeAt(this.read) ^ - this.data.charCodeAt(this.read + 1) << 8 ^ - this.data.charCodeAt(this.read + 2) << 16 ^ - this.data.charCodeAt(this.read + 3) << 24); - this.read += 4; - return rval; -}; +const { sha256 } = __nccwpck_require__(10116) +const errcode = __nccwpck_require__(18598) +const { equals: uint8ArrayEquals } = __nccwpck_require__(13872) +const { toString: uint8ArrayToString } = __nccwpck_require__(43840) -/** - * Gets an n-bit integer from this buffer in big-endian order and advances the - * read pointer by ceil(n/8). - * - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return the integer. - */ -util.ByteStringBuffer.prototype.getInt = function(n) { - _checkBitsParam(n); - var rval = 0; - do { - // TODO: Use (rval * 0x100) if adding support for 33 to 53 bits. - rval = (rval << 8) + this.data.charCodeAt(this.read++); - n -= 8; - } while(n > 0); - return rval; -}; +__nccwpck_require__(7841) +const forge = __nccwpck_require__(56389) -/** - * Gets a signed n-bit integer from this buffer in big-endian order, using - * two's complement, and advances the read pointer by n/8. - * - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return the integer. - */ -util.ByteStringBuffer.prototype.getSignedInt = function(n) { - // getInt checks n - var x = this.getInt(n); - var max = 2 << (n - 2); - if(x >= max) { - x -= max << 1; +const crypto = __nccwpck_require__(52070) +const pbm = __nccwpck_require__(63644) +const exporter = __nccwpck_require__(87213) + +class RsaPublicKey { + constructor (key) { + this._key = key } - return x; -}; -/** - * Reads bytes out as a binary encoded string and clears them from the - * buffer. Note that the resulting string is binary encoded (in node.js this - * encoding is referred to as `binary`, it is *not* `utf8`). - * - * @param count the number of bytes to read, undefined or null for all. - * - * @return a binary encoded string of bytes. - */ -util.ByteStringBuffer.prototype.getBytes = function(count) { - var rval; - if(count) { - // read count bytes - count = Math.min(this.length(), count); - rval = this.data.slice(this.read, this.read + count); - this.read += count; - } else if(count === 0) { - rval = ''; - } else { - // read all bytes, optimize to only copy when needed - rval = (this.read === 0) ? this.data : this.data.slice(this.read); - this.clear(); + async verify (data, sig) { // eslint-disable-line require-await + return crypto.hashAndVerify(this._key, sig, data) } - return rval; -}; -/** - * Gets a binary encoded string of the bytes from this buffer without - * modifying the read pointer. - * - * @param count the number of bytes to get, omit to get all. - * - * @return a string full of binary encoded characters. - */ -util.ByteStringBuffer.prototype.bytes = function(count) { - return (typeof(count) === 'undefined' ? - this.data.slice(this.read) : - this.data.slice(this.read, this.read + count)); -}; + marshal () { + return crypto.utils.jwkToPkix(this._key) + } -/** - * Gets a byte at the given index without modifying the read pointer. - * - * @param i the byte index. - * - * @return the byte. - */ -util.ByteStringBuffer.prototype.at = function(i) { - return this.data.charCodeAt(this.read + i); -}; + get bytes () { + return pbm.PublicKey.encode({ + Type: pbm.KeyType.RSA, + Data: this.marshal() + }).finish() + } -/** - * Puts a byte at the given index without modifying the read pointer. - * - * @param i the byte index. - * @param b the byte to put. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.setAt = function(i, b) { - this.data = this.data.substr(0, this.read + i) + - String.fromCharCode(b) + - this.data.substr(this.read + i + 1); - return this; -}; + encrypt (bytes) { + return crypto.encrypt(this._key, bytes) + } -/** - * Gets the last byte without modifying the read pointer. - * - * @return the last byte. - */ -util.ByteStringBuffer.prototype.last = function() { - return this.data.charCodeAt(this.data.length - 1); -}; + equals (key) { + return uint8ArrayEquals(this.bytes, key.bytes) + } -/** - * Creates a copy of this buffer. - * - * @return the copy. - */ -util.ByteStringBuffer.prototype.copy = function() { - var c = util.createBuffer(this.data); - c.read = this.read; - return c; -}; + async hash () { + const { bytes } = await sha256.digest(this.bytes) -/** - * Compacts this buffer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.compact = function() { - if(this.read > 0) { - this.data = this.data.slice(this.read); - this.read = 0; + return bytes } - return this; -}; +} -/** - * Clears this buffer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.clear = function() { - this.data = ''; - this.read = 0; - return this; -}; +class RsaPrivateKey { + // key - Object of the jwk format + // publicKey - Uint8Array of the spki format + constructor (key, publicKey) { + this._key = key + this._publicKey = publicKey + } -/** - * Shortens this buffer by triming bytes off of the end of this buffer. - * - * @param count the number of bytes to trim off. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.truncate = function(count) { - var len = Math.max(0, this.length() - count); - this.data = this.data.substr(this.read, len); - this.read = 0; - return this; -}; + genSecret () { + return crypto.getRandomValues(16) + } -/** - * Converts this buffer to a hexadecimal string. - * - * @return a hexadecimal string. - */ -util.ByteStringBuffer.prototype.toHex = function() { - var rval = ''; - for(var i = this.read; i < this.data.length; ++i) { - var b = this.data.charCodeAt(i); - if(b < 16) { - rval += '0'; - } - rval += b.toString(16); + async sign (message) { // eslint-disable-line require-await + return crypto.hashAndSign(this._key, message) } - return rval; -}; -/** - * Converts this buffer to a UTF-16 string (standard JavaScript string). - * - * @return a UTF-16 string. - */ -util.ByteStringBuffer.prototype.toString = function() { - return util.decodeUtf8(this.bytes()); -}; + get public () { + if (!this._publicKey) { + throw errcode(new Error('public key not provided'), 'ERR_PUBKEY_NOT_PROVIDED') + } -/** End Buffer w/BinaryString backing */ + return new RsaPublicKey(this._publicKey) + } -/** Buffer w/UInt8Array backing */ + decrypt (bytes) { + return crypto.decrypt(this._key, bytes) + } -/** - * FIXME: Experimental. Do not use yet. - * - * Constructor for an ArrayBuffer-backed byte buffer. - * - * The buffer may be constructed from a string, an ArrayBuffer, DataView, or a - * TypedArray. - * - * If a string is given, its encoding should be provided as an option, - * otherwise it will default to 'binary'. A 'binary' string is encoded such - * that each character is one byte in length and size. - * - * If an ArrayBuffer, DataView, or TypedArray is given, it will be used - * *directly* without any copying. Note that, if a write to the buffer requires - * more space, the buffer will allocate a new backing ArrayBuffer to - * accommodate. The starting read and write offsets for the buffer may be - * given as options. - * - * @param [b] the initial bytes for this buffer. - * @param options the options to use: - * [readOffset] the starting read offset to use (default: 0). - * [writeOffset] the starting write offset to use (default: the - * length of the first parameter). - * [growSize] the minimum amount, in bytes, to grow the buffer by to - * accommodate writes (default: 1024). - * [encoding] the encoding ('binary', 'utf8', 'utf16', 'hex') for the - * first parameter, if it is a string (default: 'binary'). - */ -function DataBuffer(b, options) { - // default options - options = options || {}; + marshal () { + return crypto.utils.jwkToPkcs1(this._key) + } - // pointers for read from/write to buffer - this.read = options.readOffset || 0; - this.growSize = options.growSize || 1024; + get bytes () { + return pbm.PrivateKey.encode({ + Type: pbm.KeyType.RSA, + Data: this.marshal() + }).finish() + } - var isArrayBuffer = util.isArrayBuffer(b); - var isArrayBufferView = util.isArrayBufferView(b); - if(isArrayBuffer || isArrayBufferView) { - // use ArrayBuffer directly - if(isArrayBuffer) { - this.data = new DataView(b); - } else { - // TODO: adjust read/write offset based on the type of view - // or specify that this must be done in the options ... that the - // offsets are byte-based - this.data = new DataView(b.buffer, b.byteOffset, b.byteLength); - } - this.write = ('writeOffset' in options ? - options.writeOffset : this.data.byteLength); - return; + equals (key) { + return uint8ArrayEquals(this.bytes, key.bytes) } - // initialize to empty array buffer and add any given bytes using putBytes - this.data = new DataView(new ArrayBuffer(0)); - this.write = 0; + async hash () { + const { bytes } = await sha256.digest(this.bytes) - if(b !== null && b !== undefined) { - this.putBytes(b); + return bytes } - if('writeOffset' in options) { - this.write = options.writeOffset; + /** + * Gets the ID of the key. + * + * The key id is the base58 encoding of the SHA-256 multihash of its public key. + * The public key is a protobuf encoding containing a type and the DER encoding + * of the PKCS SubjectPublicKeyInfo. + * + * @returns {Promise} + */ + async id () { + const hash = await this.public.hash() + return uint8ArrayToString(hash, 'base58btc') + } + + /** + * Exports the key into a password protected PEM format + * + * @param {string} password - The password to read the encrypted PEM + * @param {string} [format=pkcs-8] - The format in which to export as + */ + async export (password, format = 'pkcs-8') { // eslint-disable-line require-await + if (format === 'pkcs-8') { + const buffer = new forge.util.ByteBuffer(this.marshal()) + const asn1 = forge.asn1.fromDer(buffer) + const privateKey = forge.pki.privateKeyFromAsn1(asn1) + + const options = { + algorithm: 'aes256', + count: 10000, + saltSize: 128 / 8, + prfAlgorithm: 'sha512' + } + return forge.pki.encryptRsaPrivateKey(privateKey, password, options) + } else if (format === 'libp2p-key') { + return exporter.export(this.bytes, password) + } else { + throw errcode(new Error(`export format '${format}' is not supported`), 'ERR_INVALID_EXPORT_FORMAT') + } } } -util.DataBuffer = DataBuffer; -/** - * Gets the number of bytes in this buffer. - * - * @return the number of bytes in this buffer. - */ -util.DataBuffer.prototype.length = function() { - return this.write - this.read; -}; +async function unmarshalRsaPrivateKey (bytes) { + const jwk = crypto.utils.pkcs1ToJwk(bytes) + const keys = await crypto.unmarshalPrivateKey(jwk) + return new RsaPrivateKey(keys.privateKey, keys.publicKey) +} -/** - * Gets whether or not this buffer is empty. - * - * @return true if this buffer is empty, false if not. - */ -util.DataBuffer.prototype.isEmpty = function() { - return this.length() <= 0; -}; +function unmarshalRsaPublicKey (bytes) { + const jwk = crypto.utils.pkixToJwk(bytes) + return new RsaPublicKey(jwk) +} -/** - * Ensures this buffer has enough empty space to accommodate the given number - * of bytes. An optional parameter may be given that indicates a minimum - * amount to grow the buffer if necessary. If the parameter is not given, - * the buffer will be grown by some previously-specified default amount - * or heuristic. - * - * @param amount the number of bytes to accommodate. - * @param [growSize] the minimum amount, in bytes, to grow the buffer by if - * necessary. - */ -util.DataBuffer.prototype.accommodate = function(amount, growSize) { - if(this.length() >= amount) { - return this; - } - growSize = Math.max(growSize || this.growSize, amount); +async function fromJwk (jwk) { + const keys = await crypto.unmarshalPrivateKey(jwk) + return new RsaPrivateKey(keys.privateKey, keys.publicKey) +} - // grow buffer - var src = new Uint8Array( - this.data.buffer, this.data.byteOffset, this.data.byteLength); - var dst = new Uint8Array(this.length() + growSize); - dst.set(src); - this.data = new DataView(dst.buffer); +async function generateKeyPair (bits) { + const keys = await crypto.generateKey(bits) + return new RsaPrivateKey(keys.privateKey, keys.publicKey) +} - return this; -}; +module.exports = { + RsaPublicKey, + RsaPrivateKey, + unmarshalRsaPublicKey, + unmarshalRsaPrivateKey, + generateKeyPair, + fromJwk +} -/** - * Puts a byte in this buffer. - * - * @param b the byte to put. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putByte = function(b) { - this.accommodate(1); - this.data.setUint8(this.write++, b); - return this; -}; -/** - * Puts a byte in this buffer N times. - * - * @param b the byte to put. - * @param n the number of bytes of value b to put. - * - * @return this buffer. - */ -util.DataBuffer.prototype.fillWithByte = function(b, n) { - this.accommodate(n); - for(var i = 0; i < n; ++i) { - this.data.setUint8(b); - } - return this; -}; +/***/ }), -/** - * Puts bytes in this buffer. The bytes may be given as a string, an - * ArrayBuffer, a DataView, or a TypedArray. - * - * @param bytes the bytes to put. - * @param [encoding] the encoding for the first parameter ('binary', 'utf8', - * 'utf16', 'hex'), if it is a string (default: 'binary'). - * - * @return this buffer. - */ -util.DataBuffer.prototype.putBytes = function(bytes, encoding) { - if(util.isArrayBufferView(bytes)) { - var src = new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.byteLength); - var len = src.byteLength - src.byteOffset; - this.accommodate(len); - var dst = new Uint8Array(this.data.buffer, this.write); - dst.set(src); - this.write += len; - return this; - } +/***/ 8160: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if(util.isArrayBuffer(bytes)) { - var src = new Uint8Array(bytes); - this.accommodate(src.byteLength); - var dst = new Uint8Array(this.data.buffer); - dst.set(src, this.write); - this.write += src.byteLength; - return this; - } - // bytes is a util.DataBuffer or equivalent - if(bytes instanceof util.DataBuffer || - (typeof bytes === 'object' && - typeof bytes.read === 'number' && typeof bytes.write === 'number' && - util.isArrayBufferView(bytes.data))) { - var src = new Uint8Array(bytes.data.byteLength, bytes.read, bytes.length()); - this.accommodate(src.byteLength); - var dst = new Uint8Array(bytes.data.byteLength, this.write); - dst.set(src); - this.write += src.byteLength; - return this; - } - if(bytes instanceof util.ByteStringBuffer) { - // copy binary string and process as the same as a string parameter below - bytes = bytes.data; - encoding = 'binary'; - } +__nccwpck_require__(14098) +__nccwpck_require__(62175) +const forge = __nccwpck_require__(56389) +const { bigIntegerToUintBase64url, base64urlToBigInteger } = __nccwpck_require__(94566) +const { fromString: uint8ArrayFromString } = __nccwpck_require__(7433) +const { toString: uint8ArrayToString } = __nccwpck_require__(43840) - // string conversion - encoding = encoding || 'binary'; - if(typeof bytes === 'string') { - var view; +// Convert a PKCS#1 in ASN1 DER format to a JWK key +exports.pkcs1ToJwk = function (bytes) { + const asn1 = forge.asn1.fromDer(uint8ArrayToString(bytes, 'ascii')) + const privateKey = forge.pki.privateKeyFromAsn1(asn1) - // decode from string - if(encoding === 'hex') { - this.accommodate(Math.ceil(bytes.length / 2)); - view = new Uint8Array(this.data.buffer, this.write); - this.write += util.binary.hex.decode(bytes, view, this.write); - return this; - } - if(encoding === 'base64') { - this.accommodate(Math.ceil(bytes.length / 4) * 3); - view = new Uint8Array(this.data.buffer, this.write); - this.write += util.binary.base64.decode(bytes, view, this.write); - return this; - } + // https://tools.ietf.org/html/rfc7518#section-6.3.1 + return { + kty: 'RSA', + n: bigIntegerToUintBase64url(privateKey.n), + e: bigIntegerToUintBase64url(privateKey.e), + d: bigIntegerToUintBase64url(privateKey.d), + p: bigIntegerToUintBase64url(privateKey.p), + q: bigIntegerToUintBase64url(privateKey.q), + dp: bigIntegerToUintBase64url(privateKey.dP), + dq: bigIntegerToUintBase64url(privateKey.dQ), + qi: bigIntegerToUintBase64url(privateKey.qInv), + alg: 'RS256', + kid: '2011-04-29' + } +} - // encode text as UTF-8 bytes - if(encoding === 'utf8') { - // encode as UTF-8 then decode string as raw binary - bytes = util.encodeUtf8(bytes); - encoding = 'binary'; - } +// Convert a JWK key into PKCS#1 in ASN1 DER format +exports.jwkToPkcs1 = function (jwk) { + const asn1 = forge.pki.privateKeyToAsn1({ + n: base64urlToBigInteger(jwk.n), + e: base64urlToBigInteger(jwk.e), + d: base64urlToBigInteger(jwk.d), + p: base64urlToBigInteger(jwk.p), + q: base64urlToBigInteger(jwk.q), + dP: base64urlToBigInteger(jwk.dp), + dQ: base64urlToBigInteger(jwk.dq), + qInv: base64urlToBigInteger(jwk.qi) + }) - // decode string as raw binary - if(encoding === 'binary' || encoding === 'raw') { - // one byte per character - this.accommodate(bytes.length); - view = new Uint8Array(this.data.buffer, this.write); - this.write += util.binary.raw.decode(view); - return this; - } + return uint8ArrayFromString(forge.asn1.toDer(asn1).getBytes(), 'ascii') +} - // encode text as UTF-16 bytes - if(encoding === 'utf16') { - // two bytes per character - this.accommodate(bytes.length * 2); - view = new Uint16Array(this.data.buffer, this.write); - this.write += util.text.utf16.encode(view); - return this; - } +// Convert a PKCIX in ASN1 DER format to a JWK key +exports.pkixToJwk = function (bytes) { + const asn1 = forge.asn1.fromDer(uint8ArrayToString(bytes, 'ascii')) + const publicKey = forge.pki.publicKeyFromAsn1(asn1) - throw new Error('Invalid encoding: ' + encoding); + return { + kty: 'RSA', + n: bigIntegerToUintBase64url(publicKey.n), + e: bigIntegerToUintBase64url(publicKey.e), + alg: 'RS256', + kid: '2011-04-29' } +} - throw Error('Invalid parameter: ' + bytes); -}; +// Convert a JWK key to PKCIX in ASN1 DER format +exports.jwkToPkix = function (jwk) { + const asn1 = forge.pki.publicKeyToAsn1({ + n: base64urlToBigInteger(jwk.n), + e: base64urlToBigInteger(jwk.e) + }) -/** - * Puts the given buffer into this buffer. - * - * @param buffer the buffer to put into this one. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putBuffer = function(buffer) { - this.putBytes(buffer); - buffer.clear(); - return this; -}; + return uint8ArrayFromString(forge.asn1.toDer(asn1).getBytes(), 'ascii') +} -/** - * Puts a string into this buffer. - * - * @param str the string to put. - * @param [encoding] the encoding for the string (default: 'utf16'). - * - * @return this buffer. - */ -util.DataBuffer.prototype.putString = function(str) { - return this.putBytes(str, 'utf16'); -}; -/** - * Puts a 16-bit integer in this buffer in big-endian order. - * - * @param i the 16-bit integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt16 = function(i) { - this.accommodate(2); - this.data.setInt16(this.write, i); - this.write += 2; - return this; -}; +/***/ }), -/** - * Puts a 24-bit integer in this buffer in big-endian order. - * - * @param i the 24-bit integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt24 = function(i) { - this.accommodate(3); - this.data.setInt16(this.write, i >> 8 & 0xFFFF); - this.data.setInt8(this.write, i >> 16 & 0xFF); - this.write += 3; - return this; -}; +/***/ 52070: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Puts a 32-bit integer in this buffer in big-endian order. - * - * @param i the 32-bit integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt32 = function(i) { - this.accommodate(4); - this.data.setInt32(this.write, i); - this.write += 4; - return this; -}; -/** - * Puts a 16-bit integer in this buffer in little-endian order. - * - * @param i the 16-bit integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt16Le = function(i) { - this.accommodate(2); - this.data.setInt16(this.write, i, true); - this.write += 2; - return this; -}; -/** - * Puts a 24-bit integer in this buffer in little-endian order. - * - * @param i the 24-bit integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt24Le = function(i) { - this.accommodate(3); - this.data.setInt8(this.write, i >> 16 & 0xFF); - this.data.setInt16(this.write, i >> 8 & 0xFFFF, true); - this.write += 3; - return this; -}; +const crypto = __nccwpck_require__(6113) +const promisify = (__nccwpck_require__(73837).promisify) +const errcode = __nccwpck_require__(18598) +const randomBytes = __nccwpck_require__(33642) +const keypair = promisify(crypto.generateKeyPair) -/** - * Puts a 32-bit integer in this buffer in little-endian order. - * - * @param i the 32-bit integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt32Le = function(i) { - this.accommodate(4); - this.data.setInt32(this.write, i, true); - this.write += 4; - return this; -}; +exports.utils = __nccwpck_require__(8160) -/** - * Puts an n-bit integer in this buffer in big-endian order. - * - * @param i the n-bit integer. - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt = function(i, n) { - _checkBitsParam(n); - this.accommodate(n / 8); - do { - n -= 8; - this.data.setInt8(this.write++, (i >> n) & 0xFF); - } while(n > 0); - return this; -}; +exports.generateKey = async function (bits) { // eslint-disable-line require-await + const key = await keypair('rsa', { + modulusLength: bits, + publicKeyEncoding: { type: 'pkcs1', format: 'jwk' }, + privateKeyEncoding: { type: 'pkcs1', format: 'jwk' } + }) -/** - * Puts a signed n-bit integer in this buffer in big-endian order. Two's - * complement representation is used. - * - * @param i the n-bit integer. - * @param n the number of bits in the integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putSignedInt = function(i, n) { - _checkBitsParam(n); - this.accommodate(n / 8); - if(i < 0) { - i += 2 << (n - 1); + return { + privateKey: key.privateKey, + publicKey: key.publicKey } - return this.putInt(i, n); -}; +} -/** - * Gets a byte from this buffer and advances the read pointer by 1. - * - * @return the byte. - */ -util.DataBuffer.prototype.getByte = function() { - return this.data.getInt8(this.read++); -}; +// Takes a jwk key +exports.unmarshalPrivateKey = async function (key) { // eslint-disable-line require-await + if (!key) { + throw errcode(new Error('Missing key parameter'), 'ERR_MISSING_KEY') + } + return { + privateKey: key, + publicKey: { + kty: key.kty, + n: key.n, + e: key.e + } + } +} -/** - * Gets a uint16 from this buffer in big-endian order and advances the read - * pointer by 2. - * - * @return the uint16. - */ -util.DataBuffer.prototype.getInt16 = function() { - var rval = this.data.getInt16(this.read); - this.read += 2; - return rval; -}; +exports.getRandomValues = randomBytes -/** - * Gets a uint24 from this buffer in big-endian order and advances the read - * pointer by 3. - * - * @return the uint24. - */ -util.DataBuffer.prototype.getInt24 = function() { - var rval = ( - this.data.getInt16(this.read) << 8 ^ - this.data.getInt8(this.read + 2)); - this.read += 3; - return rval; -}; +exports.hashAndSign = async function (key, msg) { // eslint-disable-line require-await + return crypto.createSign('RSA-SHA256') + .update(msg) + .sign({ format: 'jwk', key: key }) +} -/** - * Gets a uint32 from this buffer in big-endian order and advances the read - * pointer by 4. - * - * @return the word. - */ -util.DataBuffer.prototype.getInt32 = function() { - var rval = this.data.getInt32(this.read); - this.read += 4; - return rval; -}; +exports.hashAndVerify = async function (key, sig, msg) { // eslint-disable-line require-await + return crypto.createVerify('RSA-SHA256') + .update(msg) + .verify({ format: 'jwk', key: key }, sig) +} -/** - * Gets a uint16 from this buffer in little-endian order and advances the read - * pointer by 2. - * - * @return the uint16. - */ -util.DataBuffer.prototype.getInt16Le = function() { - var rval = this.data.getInt16(this.read, true); - this.read += 2; - return rval; -}; +const padding = crypto.constants.RSA_PKCS1_PADDING -/** - * Gets a uint24 from this buffer in little-endian order and advances the read - * pointer by 3. - * - * @return the uint24. - */ -util.DataBuffer.prototype.getInt24Le = function() { - var rval = ( - this.data.getInt8(this.read) ^ - this.data.getInt16(this.read + 1, true) << 8); - this.read += 3; - return rval; -}; +exports.encrypt = function (key, bytes) { + return crypto.publicEncrypt({ format: 'jwk', key, padding }, bytes) +} -/** - * Gets a uint32 from this buffer in little-endian order and advances the read - * pointer by 4. - * - * @return the word. - */ -util.DataBuffer.prototype.getInt32Le = function() { - var rval = this.data.getInt32(this.read, true); - this.read += 4; - return rval; -}; +exports.decrypt = function (key, bytes) { + return crypto.privateDecrypt({ format: 'jwk', key, padding }, bytes) +} -/** - * Gets an n-bit integer from this buffer in big-endian order and advances the - * read pointer by n/8. - * - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return the integer. - */ -util.DataBuffer.prototype.getInt = function(n) { - _checkBitsParam(n); - var rval = 0; - do { - // TODO: Use (rval * 0x100) if adding support for 33 to 53 bits. - rval = (rval << 8) + this.data.getInt8(this.read++); - n -= 8; - } while(n > 0); - return rval; -}; -/** - * Gets a signed n-bit integer from this buffer in big-endian order, using - * two's complement, and advances the read pointer by n/8. - * - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return the integer. - */ -util.DataBuffer.prototype.getSignedInt = function(n) { - // getInt checks n - var x = this.getInt(n); - var max = 2 << (n - 2); - if(x >= max) { - x -= max << 1; - } - return x; -}; +/***/ }), -/** - * Reads bytes out as a binary encoded string and clears them from the - * buffer. - * - * @param count the number of bytes to read, undefined or null for all. - * - * @return a binary encoded string of bytes. - */ -util.DataBuffer.prototype.getBytes = function(count) { - // TODO: deprecate this method, it is poorly named and - // this.toString('binary') replaces it - // add a toTypedArray()/toArrayBuffer() function - var rval; - if(count) { - // read count bytes - count = Math.min(this.length(), count); - rval = this.data.slice(this.read, this.read + count); - this.read += count; - } else if(count === 0) { - rval = ''; - } else { - // read all bytes, optimize to only copy when needed - rval = (this.read === 0) ? this.data : this.data.slice(this.read); - this.clear(); - } - return rval; -}; +/***/ 10466: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Gets a binary encoded string of the bytes from this buffer without - * modifying the read pointer. - * - * @param count the number of bytes to get, omit to get all. - * - * @return a string full of binary encoded characters. - */ -util.DataBuffer.prototype.bytes = function(count) { - // TODO: deprecate this method, it is poorly named, add "getString()" - return (typeof(count) === 'undefined' ? - this.data.slice(this.read) : - this.data.slice(this.read, this.read + count)); -}; -/** - * Gets a byte at the given index without modifying the read pointer. - * - * @param i the byte index. - * - * @return the byte. - */ -util.DataBuffer.prototype.at = function(i) { - return this.data.getUint8(this.read + i); -}; -/** - * Puts a byte at the given index without modifying the read pointer. - * - * @param i the byte index. - * @param b the byte to put. - * - * @return this buffer. - */ -util.DataBuffer.prototype.setAt = function(i, b) { - this.data.setUint8(i, b); - return this; -}; +const { sha256 } = __nccwpck_require__(10116) +const errcode = __nccwpck_require__(18598) +const { equals: uint8ArrayEquals } = __nccwpck_require__(13872) +const { toString: uint8ArrayToString } = __nccwpck_require__(43840) + +const exporter = __nccwpck_require__(87213) + +module.exports = (keysProtobuf, randomBytes, crypto) => { + crypto = crypto || __nccwpck_require__(43999)() + + class Secp256k1PublicKey { + constructor (key) { + crypto.validatePublicKey(key) + this._key = key + } + + verify (data, sig) { + return crypto.hashAndVerify(this._key, sig, data) + } + + marshal () { + return crypto.compressPublicKey(this._key) + } -/** - * Gets the last byte without modifying the read pointer. - * - * @return the last byte. - */ -util.DataBuffer.prototype.last = function() { - return this.data.getUint8(this.write - 1); -}; + get bytes () { + return keysProtobuf.PublicKey.encode({ + Type: keysProtobuf.KeyType.Secp256k1, + Data: this.marshal() + }).finish() + } -/** - * Creates a copy of this buffer. - * - * @return the copy. - */ -util.DataBuffer.prototype.copy = function() { - return new util.DataBuffer(this); -}; + equals (key) { + return uint8ArrayEquals(this.bytes, key.bytes) + } -/** - * Compacts this buffer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.compact = function() { - if(this.read > 0) { - var src = new Uint8Array(this.data.buffer, this.read); - var dst = new Uint8Array(src.byteLength); - dst.set(src); - this.data = new DataView(dst); - this.write -= this.read; - this.read = 0; + async hash () { + const { bytes } = await sha256.digest(this.bytes) + + return bytes + } } - return this; -}; -/** - * Clears this buffer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.clear = function() { - this.data = new DataView(new ArrayBuffer(0)); - this.read = this.write = 0; - return this; -}; + class Secp256k1PrivateKey { + constructor (key, publicKey) { + this._key = key + this._publicKey = publicKey || crypto.computePublicKey(key) + crypto.validatePrivateKey(this._key) + crypto.validatePublicKey(this._publicKey) + } -/** - * Shortens this buffer by triming bytes off of the end of this buffer. - * - * @param count the number of bytes to trim off. - * - * @return this buffer. - */ -util.DataBuffer.prototype.truncate = function(count) { - this.write = Math.max(0, this.length() - count); - this.read = Math.min(this.read, this.write); - return this; -}; + sign (message) { + return crypto.hashAndSign(this._key, message) + } -/** - * Converts this buffer to a hexadecimal string. - * - * @return a hexadecimal string. - */ -util.DataBuffer.prototype.toHex = function() { - var rval = ''; - for(var i = this.read; i < this.data.byteLength; ++i) { - var b = this.data.getUint8(i); - if(b < 16) { - rval += '0'; + get public () { + return new Secp256k1PublicKey(this._publicKey) } - rval += b.toString(16); - } - return rval; -}; -/** - * Converts this buffer to a string, using the given encoding. If no - * encoding is given, 'utf8' (UTF-8) is used. - * - * @param [encoding] the encoding to use: 'binary', 'utf8', 'utf16', 'hex', - * 'base64' (default: 'utf8'). - * - * @return a string representation of the bytes in this buffer. - */ -util.DataBuffer.prototype.toString = function(encoding) { - var view = new Uint8Array(this.data, this.read, this.length()); - encoding = encoding || 'utf8'; + marshal () { + return this._key + } - // encode to string - if(encoding === 'binary' || encoding === 'raw') { - return util.binary.raw.encode(view); + get bytes () { + return keysProtobuf.PrivateKey.encode({ + Type: keysProtobuf.KeyType.Secp256k1, + Data: this.marshal() + }).finish() + } + + equals (key) { + return uint8ArrayEquals(this.bytes, key.bytes) + } + + async hash () { + const { bytes } = await sha256.digest(this.bytes) + + return bytes + } + + /** + * Gets the ID of the key. + * + * The key id is the base58 encoding of the SHA-256 multihash of its public key. + * The public key is a protobuf encoding containing a type and the DER encoding + * of the PKCS SubjectPublicKeyInfo. + * + * @returns {Promise} + */ + async id () { + const hash = await this.public.hash() + return uint8ArrayToString(hash, 'base58btc') + } + + /** + * Exports the key into a password protected `format` + * + * @param {string} password - The password to encrypt the key + * @param {string} [format=libp2p-key] - The format in which to export as + * @returns {Promise} The encrypted private key + */ + async export (password, format = 'libp2p-key') { // eslint-disable-line require-await + if (format === 'libp2p-key') { + return exporter.export(this.bytes, password) + } else { + throw errcode(new Error(`export format '${format}' is not supported`), 'ERR_INVALID_EXPORT_FORMAT') + } + } } - if(encoding === 'hex') { - return util.binary.hex.encode(view); + + function unmarshalSecp256k1PrivateKey (bytes) { + return new Secp256k1PrivateKey(bytes) } - if(encoding === 'base64') { - return util.binary.base64.encode(view); + + function unmarshalSecp256k1PublicKey (bytes) { + return new Secp256k1PublicKey(bytes) } - // decode to text - if(encoding === 'utf8') { - return util.text.utf8.decode(view); + async function generateKeyPair () { + const privateKeyBytes = await crypto.generateKey() + return new Secp256k1PrivateKey(privateKeyBytes) } - if(encoding === 'utf16') { - return util.text.utf16.decode(view); + + return { + Secp256k1PublicKey, + Secp256k1PrivateKey, + unmarshalSecp256k1PrivateKey, + unmarshalSecp256k1PublicKey, + generateKeyPair } +} - throw new Error('Invalid encoding: ' + encoding); -}; -/** End Buffer w/UInt8Array backing */ +/***/ }), -/** - * Creates a buffer that stores bytes. A value may be given to populate the - * buffer with data. This value can either be string of encoded bytes or a - * regular string of characters. When passing a string of binary encoded - * bytes, the encoding `raw` should be given. This is also the default. When - * passing a string of characters, the encoding `utf8` should be given. - * - * @param [input] a string with encoded bytes to store in the buffer. - * @param [encoding] (default: 'raw', other: 'utf8'). - */ -util.createBuffer = function(input, encoding) { - // TODO: deprecate, use new ByteBuffer() instead - encoding = encoding || 'raw'; - if(input !== undefined && encoding === 'utf8') { - input = util.encodeUtf8(input); +/***/ 43999: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const errcode = __nccwpck_require__(18598) +const secp = __nccwpck_require__(74813) +const { sha256 } = __nccwpck_require__(10116) + +module.exports = () => { + const privateKeyLength = 32 + + function generateKey () { + return secp.utils.randomPrivateKey() } - return new util.ByteBuffer(input); -}; -/** - * Fills a string with a particular value. If you want the string to be a byte - * string, pass in String.fromCharCode(theByte). - * - * @param c the character to fill the string with, use String.fromCharCode - * to fill the string with a byte value. - * @param n the number of characters of value c to fill with. - * - * @return the filled string. - */ -util.fillString = function(c, n) { - var s = ''; - while(n > 0) { - if(n & 1) { - s += c; + /** + * Hash and sign message with private key + * + * @param {number | bigint | (string | Uint8Array)} key + * @param {Uint8Array} msg + */ + async function hashAndSign (key, msg) { + const { digest } = await sha256.digest(msg) + try { + return await secp.sign(digest, key) + } catch (err) { + throw errcode(err, 'ERR_INVALID_INPUT') } - n >>>= 1; - if(n > 0) { - c += c; + } + + /** + * Hash message and verify signature with public key + * + * @param {secp.Point | (string | Uint8Array)} key + * @param {(string | Uint8Array) | secp.Signature} sig + * @param {Uint8Array} msg + */ + async function hashAndVerify (key, sig, msg) { + try { + const { digest } = await sha256.digest(msg) + return secp.verify(sig, digest, key) + } catch (err) { + throw errcode(err, 'ERR_INVALID_INPUT') } } - return s; -}; -/** - * Performs a per byte XOR between two byte strings and returns the result as a - * string of bytes. - * - * @param s1 first string of bytes. - * @param s2 second string of bytes. - * @param n the number of bytes to XOR. - * - * @return the XOR'd result. - */ -util.xorBytes = function(s1, s2, n) { - var s3 = ''; - var b = ''; - var t = ''; - var i = 0; - var c = 0; - for(; n > 0; --n, ++i) { - b = s1.charCodeAt(i) ^ s2.charCodeAt(i); - if(c >= 10) { - s3 += t; - t = ''; - c = 0; + function compressPublicKey (key) { + const point = secp.Point.fromHex(key).toRawBytes(true) + return point + } + + function decompressPublicKey (key) { + const point = secp.Point.fromHex(key).toRawBytes(false) + return point + } + + function validatePrivateKey (key) { + try { + secp.getPublicKey(key, true) + } catch (err) { + throw errcode(err, 'ERR_INVALID_PRIVATE_KEY') } - t += String.fromCharCode(b); - ++c; } - s3 += t; - return s3; -}; -/** - * Converts a hex string into a 'binary' encoded string of bytes. - * - * @param hex the hexadecimal string to convert. - * - * @return the binary-encoded string of bytes. - */ -util.hexToBytes = function(hex) { - // TODO: deprecate: "Deprecated. Use util.binary.hex.decode instead." - var rval = ''; - var i = 0; - if(hex.length & 1 == 1) { - // odd number of characters, convert first character alone - i = 1; - rval += String.fromCharCode(parseInt(hex[0], 16)); + function validatePublicKey (key) { + try { + secp.Point.fromHex(key) + } catch (err) { + throw errcode(err, 'ERR_INVALID_PUBLIC_KEY') + } } - // convert 2 characters (1 byte) at a time - for(; i < hex.length; i += 2) { - rval += String.fromCharCode(parseInt(hex.substr(i, 2), 16)); + + function computePublicKey (privateKey) { + try { + return secp.getPublicKey(privateKey, true) + } catch (err) { + throw errcode(err, 'ERR_INVALID_PRIVATE_KEY') + } } - return rval; -}; -/** - * Converts a 'binary' encoded string of bytes to hex. - * - * @param bytes the byte string to convert. - * - * @return the string of hexadecimal characters. - */ -util.bytesToHex = function(bytes) { - // TODO: deprecate: "Deprecated. Use util.binary.hex.encode instead." - return util.createBuffer(bytes).toHex(); -}; + return { + generateKey, + privateKeyLength, + hashAndSign, + hashAndVerify, + compressPublicKey, + decompressPublicKey, + validatePrivateKey, + validatePublicKey, + computePublicKey + } +} -/** - * Converts an 32-bit integer to 4-big-endian byte string. - * - * @param i the integer. - * - * @return the byte string. - */ -util.int32ToBytes = function(i) { - return ( - String.fromCharCode(i >> 24 & 0xFF) + - String.fromCharCode(i >> 16 & 0xFF) + - String.fromCharCode(i >> 8 & 0xFF) + - String.fromCharCode(i & 0xFF)); -}; -// base64 characters, reverse mapping -var _base64 = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; -var _base64Idx = [ -/*43 -43 = 0*/ -/*'+', 1, 2, 3,'/' */ - 62, -1, -1, -1, 63, +/***/ }), -/*'0','1','2','3','4','5','6','7','8','9' */ - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, +/***/ 79327: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/*15, 16, 17,'=', 19, 20, 21 */ - -1, -1, -1, 64, -1, -1, -1, -/*65 - 43 = 22*/ -/*'A','B','C','D','E','F','G','H','I','J','K','L','M', */ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, -/*'N','O','P','Q','R','S','T','U','V','W','X','Y','Z' */ - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, +const errcode = __nccwpck_require__(18598) -/*91 - 43 = 48 */ -/*48, 49, 50, 51, 52, 53 */ - -1, -1, -1, -1, -1, -1, +module.exports = function (curveTypes, type) { + if (!curveTypes.includes(type)) { + const names = curveTypes.join(' / ') + throw errcode(new Error(`Unknown curve: ${type}. Must be ${names}`), 'ERR_INVALID_CURVE') + } +} -/*97 - 43 = 54*/ -/*'a','b','c','d','e','f','g','h','i','j','k','l','m' */ - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, -/*'n','o','p','q','r','s','t','u','v','w','x','y','z' */ - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 -]; +/***/ }), -// base58 characters (Bitcoin alphabet) -var _base58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; +/***/ 33642: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Base64 encodes a 'binary' encoded string of bytes. - * - * @param input the binary encoded string of bytes to base64-encode. - * @param maxline the maximum number of encoded characters per line to use, - * defaults to none. - * - * @return the base64-encoded output. - */ -util.encode64 = function(input, maxline) { - // TODO: deprecate: "Deprecated. Use util.binary.base64.encode instead." - var line = ''; - var output = ''; - var chr1, chr2, chr3; - var i = 0; - while(i < input.length) { - chr1 = input.charCodeAt(i++); - chr2 = input.charCodeAt(i++); - chr3 = input.charCodeAt(i++); - // encode 4 character group - line += _base64.charAt(chr1 >> 2); - line += _base64.charAt(((chr1 & 3) << 4) | (chr2 >> 4)); - if(isNaN(chr2)) { - line += '=='; - } else { - line += _base64.charAt(((chr2 & 15) << 2) | (chr3 >> 6)); - line += isNaN(chr3) ? '=' : _base64.charAt(chr3 & 63); - } +const randomBytes = __nccwpck_require__(52222) +const errcode = __nccwpck_require__(18598) - if(maxline && line.length > maxline) { - output += line.substr(0, maxline) + '\r\n'; - line = line.substr(maxline); - } +module.exports = function (length) { + if (isNaN(length) || length <= 0) { + throw errcode(new Error('random bytes length must be a Number bigger than 0'), 'ERR_INVALID_LENGTH') } - output += line; - return output; -}; + return randomBytes(length) +} -/** - * Base64 decodes a string into a 'binary' encoded string of bytes. - * - * @param input the base64-encoded input. - * - * @return the binary encoded string. - */ -util.decode64 = function(input) { - // TODO: deprecate: "Deprecated. Use util.binary.base64.decode instead." - // remove all non-base64 characters - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ''); +/***/ }), - var output = ''; - var enc1, enc2, enc3, enc4; - var i = 0; +/***/ 94566: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - while(i < input.length) { - enc1 = _base64Idx[input.charCodeAt(i++) - 43]; - enc2 = _base64Idx[input.charCodeAt(i++) - 43]; - enc3 = _base64Idx[input.charCodeAt(i++) - 43]; - enc4 = _base64Idx[input.charCodeAt(i++) - 43]; - output += String.fromCharCode((enc1 << 2) | (enc2 >> 4)); - if(enc3 !== 64) { - // decoded at least 2 bytes - output += String.fromCharCode(((enc2 & 15) << 4) | (enc3 >> 2)); - if(enc4 !== 64) { - // decoded 3 bytes - output += String.fromCharCode(((enc3 & 3) << 6) | enc4); - } - } + +__nccwpck_require__(65138) +__nccwpck_require__(20447) +const forge = __nccwpck_require__(56389) +const { fromString: uint8ArrayFromString } = __nccwpck_require__(7433) +const { toString: uint8ArrayToString } = __nccwpck_require__(43840) +const { concat: uint8ArrayConcat } = __nccwpck_require__(85991) + +exports.bigIntegerToUintBase64url = (num, len) => { + // Call `.abs()` to convert to unsigned + let buf = Uint8Array.from(num.abs().toByteArray()) // toByteArray converts to big endian + + // toByteArray() gives us back a signed array, which will include a leading 0 + // byte if the most significant bit of the number is 1: + // https://docs.microsoft.com/en-us/windows/win32/seccertenroll/about-integer + // Our number will always be positive so we should remove the leading padding. + buf = buf[0] === 0 ? buf.slice(1) : buf + + if (len != null) { + if (buf.length > len) throw new Error('byte array longer than desired length') + buf = uint8ArrayConcat([new Uint8Array(len - buf.length), buf]) } - return output; -}; + return uint8ArrayToString(buf, 'base64url') +} -/** - * Encodes the given string of characters (a standard JavaScript - * string) as a binary encoded string where the bytes represent - * a UTF-8 encoded string of characters. Non-ASCII characters will be - * encoded as multiple bytes according to UTF-8. - * - * @param str a standard string of characters to encode. - * - * @return the binary encoded string. - */ -util.encodeUtf8 = function(str) { - return unescape(encodeURIComponent(str)); -}; +// Convert a base64url encoded string to a BigInteger +exports.base64urlToBigInteger = str => { + const buf = exports.base64urlToBuffer(str) + return new forge.jsbn.BigInteger(uint8ArrayToString(buf, 'base16'), 16) +} -/** - * Decodes a binary encoded string that contains bytes that - * represent a UTF-8 encoded string of characters -- into a - * string of characters (a standard JavaScript string). - * - * @param str the binary encoded string to decode. - * - * @return the resulting standard string of characters. - */ -util.decodeUtf8 = function(str) { - return decodeURIComponent(escape(str)); -}; +exports.base64urlToBuffer = (str, len) => { + let buf = uint8ArrayFromString(str, 'base64urlpad') -// binary encoding/decoding tools -// FIXME: Experimental. Do not use yet. -util.binary = { - raw: {}, - hex: {}, - base64: {}, - base58: {}, - baseN : { - encode: baseN.encode, - decode: baseN.decode + if (len != null) { + if (buf.length > len) throw new Error('byte array longer than desired length') + buf = uint8ArrayConcat([new Uint8Array(len - buf.length), buf]) } -}; -/** - * Encodes a Uint8Array as a binary-encoded string. This encoding uses - * a value between 0 and 255 for each character. - * - * @param bytes the Uint8Array to encode. - * - * @return the binary-encoded string. - */ -util.binary.raw.encode = function(bytes) { - return String.fromCharCode.apply(null, bytes); + return buf +} + + +/***/ }), + +/***/ 70395: +/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) { + + +const isOptionObject = __nccwpck_require__(38523); + +const {hasOwnProperty} = Object.prototype; +const {propertyIsEnumerable} = Object; +const defineProperty = (object, name, value) => Object.defineProperty(object, name, { + value, + writable: true, + enumerable: true, + configurable: true +}); + +const globalThis = this; +const defaultMergeOptions = { + concatArrays: false, + ignoreUndefined: false }; -/** - * Decodes a binary-encoded string to a Uint8Array. This encoding uses - * a value between 0 and 255 for each character. - * - * @param str the binary-encoded string to decode. - * @param [output] an optional Uint8Array to write the output to; if it - * is too small, an exception will be thrown. - * @param [offset] the start offset for writing to the output (default: 0). - * - * @return the Uint8Array or the number of bytes written if output was given. - */ -util.binary.raw.decode = function(str, output, offset) { - var out = output; - if(!out) { - out = new Uint8Array(str.length); - } - offset = offset || 0; - var j = offset; - for(var i = 0; i < str.length; ++i) { - out[j++] = str.charCodeAt(i); - } - return output ? (j - offset) : out; +const getEnumerableOwnPropertyKeys = value => { + const keys = []; + + for (const key in value) { + if (hasOwnProperty.call(value, key)) { + keys.push(key); + } + } + + /* istanbul ignore else */ + if (Object.getOwnPropertySymbols) { + const symbols = Object.getOwnPropertySymbols(value); + + for (const symbol of symbols) { + if (propertyIsEnumerable.call(value, symbol)) { + keys.push(symbol); + } + } + } + + return keys; }; -/** - * Encodes a 'binary' string, ArrayBuffer, DataView, TypedArray, or - * ByteBuffer as a string of hexadecimal characters. - * - * @param bytes the bytes to convert. - * - * @return the string of hexadecimal characters. - */ -util.binary.hex.encode = util.bytesToHex; +function clone(value) { + if (Array.isArray(value)) { + return cloneArray(value); + } + + if (isOptionObject(value)) { + return cloneOptionObject(value); + } + + return value; +} + +function cloneArray(array) { + const result = array.slice(0, 0); + + getEnumerableOwnPropertyKeys(array).forEach(key => { + defineProperty(result, key, clone(array[key])); + }); + + return result; +} + +function cloneOptionObject(object) { + const result = Object.getPrototypeOf(object) === null ? Object.create(null) : {}; + + getEnumerableOwnPropertyKeys(object).forEach(key => { + defineProperty(result, key, clone(object[key])); + }); + + return result; +} /** - * Decodes a hex-encoded string to a Uint8Array. - * - * @param hex the hexadecimal string to convert. - * @param [output] an optional Uint8Array to write the output to; if it - * is too small, an exception will be thrown. - * @param [offset] the start offset for writing to the output (default: 0). - * - * @return the Uint8Array or the number of bytes written if output was given. + * @param {*} merged already cloned + * @param {*} source something to merge + * @param {string[]} keys keys to merge + * @param {Object} config Config Object + * @returns {*} cloned Object */ -util.binary.hex.decode = function(hex, output, offset) { - var out = output; - if(!out) { - out = new Uint8Array(Math.ceil(hex.length / 2)); - } - offset = offset || 0; - var i = 0, j = offset; - if(hex.length & 1) { - // odd number of characters, convert first character alone - i = 1; - out[j++] = parseInt(hex[0], 16); - } - // convert 2 characters (1 byte) at a time - for(; i < hex.length; i += 2) { - out[j++] = parseInt(hex.substr(i, 2), 16); - } - return output ? (j - offset) : out; +const mergeKeys = (merged, source, keys, config) => { + keys.forEach(key => { + if (typeof source[key] === 'undefined' && config.ignoreUndefined) { + return; + } + + // Do not recurse into prototype chain of merged + if (key in merged && merged[key] !== Object.getPrototypeOf(merged)) { + defineProperty(merged, key, merge(merged[key], source[key], config)); + } else { + defineProperty(merged, key, clone(source[key])); + } + }); + + return merged; }; /** - * Base64-encodes a Uint8Array. - * - * @param input the Uint8Array to encode. - * @param maxline the maximum number of encoded characters per line to use, - * defaults to none. + * @param {*} merged already cloned + * @param {*} source something to merge + * @param {Object} config Config Object + * @returns {*} cloned Object * - * @return the base64-encoded output string. + * see [Array.prototype.concat ( ...arguments )](http://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.concat) */ -util.binary.base64.encode = function(input, maxline) { - var line = ''; - var output = ''; - var chr1, chr2, chr3; - var i = 0; - while(i < input.byteLength) { - chr1 = input[i++]; - chr2 = input[i++]; - chr3 = input[i++]; +const concatArrays = (merged, source, config) => { + let result = merged.slice(0, 0); + let resultIndex = 0; - // encode 4 character group - line += _base64.charAt(chr1 >> 2); - line += _base64.charAt(((chr1 & 3) << 4) | (chr2 >> 4)); - if(isNaN(chr2)) { - line += '=='; - } else { - line += _base64.charAt(((chr2 & 15) << 2) | (chr3 >> 6)); - line += isNaN(chr3) ? '=' : _base64.charAt(chr3 & 63); - } + [merged, source].forEach(array => { + const indices = []; - if(maxline && line.length > maxline) { - output += line.substr(0, maxline) + '\r\n'; - line = line.substr(maxline); - } - } - output += line; - return output; + // `result.concat(array)` with cloning + for (let k = 0; k < array.length; k++) { + if (!hasOwnProperty.call(array, k)) { + continue; + } + + indices.push(String(k)); + + if (array === merged) { + // Already cloned + defineProperty(result, resultIndex++, array[k]); + } else { + defineProperty(result, resultIndex++, clone(array[k])); + } + } + + // Merge non-index keys + result = mergeKeys(result, array, getEnumerableOwnPropertyKeys(array).filter(key => !indices.includes(key)), config); + }); + + return result; }; /** - * Decodes a base64-encoded string to a Uint8Array. - * - * @param input the base64-encoded input string. - * @param [output] an optional Uint8Array to write the output to; if it - * is too small, an exception will be thrown. - * @param [offset] the start offset for writing to the output (default: 0). - * - * @return the Uint8Array or the number of bytes written if output was given. + * @param {*} merged already cloned + * @param {*} source something to merge + * @param {Object} config Config Object + * @returns {*} cloned Object */ -util.binary.base64.decode = function(input, output, offset) { - var out = output; - if(!out) { - out = new Uint8Array(Math.ceil(input.length / 4) * 3); - } +function merge(merged, source, config) { + if (config.concatArrays && Array.isArray(merged) && Array.isArray(source)) { + return concatArrays(merged, source, config); + } - // remove all non-base64 characters - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ''); + if (!isOptionObject(source) || !isOptionObject(merged)) { + return clone(source); + } - offset = offset || 0; - var enc1, enc2, enc3, enc4; - var i = 0, j = offset; + return mergeKeys(merged, source, getEnumerableOwnPropertyKeys(source), config); +} - while(i < input.length) { - enc1 = _base64Idx[input.charCodeAt(i++) - 43]; - enc2 = _base64Idx[input.charCodeAt(i++) - 43]; - enc3 = _base64Idx[input.charCodeAt(i++) - 43]; - enc4 = _base64Idx[input.charCodeAt(i++) - 43]; +module.exports = function (...options) { + const config = merge(clone(defaultMergeOptions), (this !== globalThis && this) || {}, defaultMergeOptions); + let merged = {_: {}}; - out[j++] = (enc1 << 2) | (enc2 >> 4); - if(enc3 !== 64) { - // decoded at least 2 bytes - out[j++] = ((enc2 & 15) << 4) | (enc3 >> 2); - if(enc4 !== 64) { - // decoded 3 bytes - out[j++] = ((enc3 & 3) << 6) | enc4; - } - } - } + for (const option of options) { + if (option === undefined) { + continue; + } - // make sure result is the exact decoded length - return output ? (j - offset) : out.subarray(0, j); -}; + if (!isOptionObject(option)) { + throw new TypeError('`' + option + '` is not an Option Object'); + } -// add support for base58 encoding/decoding with Bitcoin alphabet -util.binary.base58.encode = function(input, maxline) { - return util.binary.baseN.encode(input, _base58, maxline); -}; -util.binary.base58.decode = function(input, maxline) { - return util.binary.baseN.decode(input, _base58, maxline); -}; + merged = merge(merged, {_: option}, config); + } -// text encoding/decoding tools -// FIXME: Experimental. Do not use yet. -util.text = { - utf8: {}, - utf16: {} + return merged._; }; -/** - * Encodes the given string as UTF-8 in a Uint8Array. - * - * @param str the string to encode. - * @param [output] an optional Uint8Array to write the output to; if it - * is too small, an exception will be thrown. - * @param [offset] the start offset for writing to the output (default: 0). - * - * @return the Uint8Array or the number of bytes written if output was given. + +/***/ }), + +/***/ 23717: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/*! + * mime-db + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015-2022 Douglas Christopher Wilson + * MIT Licensed */ -util.text.utf8.encode = function(str, output, offset) { - str = util.encodeUtf8(str); - var out = output; - if(!out) { - out = new Uint8Array(str.length); - } - offset = offset || 0; - var j = offset; - for(var i = 0; i < str.length; ++i) { - out[j++] = str.charCodeAt(i); - } - return output ? (j - offset) : out; -}; /** - * Decodes the UTF-8 contents from a Uint8Array. - * - * @param bytes the Uint8Array to decode. - * - * @return the resulting string. + * Module exports. */ -util.text.utf8.decode = function(bytes) { - return util.decodeUtf8(String.fromCharCode.apply(null, bytes)); -}; -/** - * Encodes the given string as UTF-16 in a Uint8Array. - * - * @param str the string to encode. - * @param [output] an optional Uint8Array to write the output to; if it - * is too small, an exception will be thrown. - * @param [offset] the start offset for writing to the output (default: 0). - * - * @return the Uint8Array or the number of bytes written if output was given. +module.exports = __nccwpck_require__(53765) + + +/***/ }), + +/***/ 26195: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +/*! + * mime-types + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed */ -util.text.utf16.encode = function(str, output, offset) { - var out = output; - if(!out) { - out = new Uint8Array(str.length * 2); - } - var view = new Uint16Array(out.buffer); - offset = offset || 0; - var j = offset; - var k = offset; - for(var i = 0; i < str.length; ++i) { - view[k++] = str.charCodeAt(i); - j += 2; - } - return output ? (j - offset) : out; -}; + + /** - * Decodes the UTF-16 contents from a Uint8Array. - * - * @param bytes the Uint8Array to decode. - * - * @return the resulting string. + * Module dependencies. + * @private */ -util.text.utf16.decode = function(bytes) { - return String.fromCharCode.apply(null, new Uint16Array(bytes.buffer)); -}; + +var db = __nccwpck_require__(23717) +var extname = (__nccwpck_require__(71017).extname) /** - * Deflates the given data using a flash interface. - * - * @param api the flash interface. - * @param bytes the data. - * @param raw true to return only raw deflate data, false to include zlib - * header and trailer. - * - * @return the deflated data as a string. + * Module variables. + * @private */ -util.deflate = function(api, bytes, raw) { - bytes = util.decode64(api.deflate(util.encode64(bytes)).rval); - - // strip zlib header and trailer if necessary - if(raw) { - // zlib header is 2 bytes (CMF,FLG) where FLG indicates that - // there is a 4-byte DICT (alder-32) block before the data if - // its 5th bit is set - var start = 2; - var flg = bytes.charCodeAt(1); - if(flg & 0x20) { - start = 6; - } - // zlib trailer is 4 bytes of adler-32 - bytes = bytes.substring(start, bytes.length - 4); - } - return bytes; -}; +var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/ +var TEXT_TYPE_REGEXP = /^text\//i /** - * Inflates the given data using a flash interface. - * - * @param api the flash interface. - * @param bytes the data. - * @param raw true if the incoming data has no zlib header or trailer and is - * raw DEFLATE data. - * - * @return the inflated data as a string, null on error. + * Module exports. + * @public */ -util.inflate = function(api, bytes, raw) { - // TODO: add zlib header and trailer if necessary/possible - var rval = api.inflate(util.encode64(bytes)).rval; - return (rval === null) ? null : util.decode64(rval); -}; + +exports.charset = charset +exports.charsets = { lookup: charset } +exports.contentType = contentType +exports.extension = extension +exports.extensions = Object.create(null) +exports.lookup = lookup +exports.types = Object.create(null) + +// Populate the extensions/types maps +populateMaps(exports.extensions, exports.types) /** - * Sets a storage object. + * Get the default charset for a MIME type. * - * @param api the storage interface. - * @param id the storage ID to use. - * @param obj the storage object, null to remove. + * @param {string} type + * @return {boolean|string} */ -var _setStorageObject = function(api, id, obj) { - if(!api) { - throw new Error('WebStorage not available.'); + +function charset (type) { + if (!type || typeof type !== 'string') { + return false } - var rval; - if(obj === null) { - rval = api.removeItem(id); - } else { - // json-encode and base64-encode object - obj = util.encode64(JSON.stringify(obj)); - rval = api.setItem(id, obj); + // TODO: use media-typer + var match = EXTRACT_TYPE_REGEXP.exec(type) + var mime = match && db[match[1].toLowerCase()] + + if (mime && mime.charset) { + return mime.charset } - // handle potential flash error - if(typeof(rval) !== 'undefined' && rval.rval !== true) { - var error = new Error(rval.error.message); - error.id = rval.error.id; - error.name = rval.error.name; - throw error; + // default text/* to utf-8 + if (match && TEXT_TYPE_REGEXP.test(match[1])) { + return 'UTF-8' } -}; + + return false +} /** - * Gets a storage object. - * - * @param api the storage interface. - * @param id the storage ID to use. + * Create a full Content-Type header given a MIME type or extension. * - * @return the storage object entry or null if none exists. + * @param {string} str + * @return {boolean|string} */ -var _getStorageObject = function(api, id) { - if(!api) { - throw new Error('WebStorage not available.'); - } - // get the existing entry - var rval = api.getItem(id); +function contentType (str) { + // TODO: should this even be in this module? + if (!str || typeof str !== 'string') { + return false + } - /* Note: We check api.init because we can't do (api == localStorage) - on IE because of "Class doesn't support Automation" exception. Only - the flash api has an init method so this works too, but we need a - better solution in the future. */ + var mime = str.indexOf('/') === -1 + ? exports.lookup(str) + : str - // flash returns item wrapped in an object, handle special case - if(api.init) { - if(rval.rval === null) { - if(rval.error) { - var error = new Error(rval.error.message); - error.id = rval.error.id; - error.name = rval.error.name; - throw error; - } - // no error, but also no item - rval = null; - } else { - rval = rval.rval; - } + if (!mime) { + return false } - // handle decoding - if(rval !== null) { - // base64-decode and json-decode data - rval = JSON.parse(util.decode64(rval)); + // TODO: use content-type or other module + if (mime.indexOf('charset') === -1) { + var charset = exports.charset(mime) + if (charset) mime += '; charset=' + charset.toLowerCase() } - return rval; -}; + return mime +} /** - * Stores an item in local storage. + * Get the default extension for a MIME type. * - * @param api the storage interface. - * @param id the storage ID to use. - * @param key the key for the item. - * @param data the data for the item (any javascript object/primitive). + * @param {string} type + * @return {boolean|string} */ -var _setItem = function(api, id, key, data) { - // get storage object - var obj = _getStorageObject(api, id); - if(obj === null) { - // create a new storage object - obj = {}; + +function extension (type) { + if (!type || typeof type !== 'string') { + return false } - // update key - obj[key] = data; - // set storage object - _setStorageObject(api, id, obj); -}; + // TODO: use media-typer + var match = EXTRACT_TYPE_REGEXP.exec(type) -/** - * Gets an item from local storage. - * - * @param api the storage interface. - * @param id the storage ID to use. - * @param key the key for the item. - * - * @return the item. - */ -var _getItem = function(api, id, key) { - // get storage object - var rval = _getStorageObject(api, id); - if(rval !== null) { - // return data at key - rval = (key in rval) ? rval[key] : null; + // get extensions + var exts = match && exports.extensions[match[1].toLowerCase()] + + if (!exts || !exts.length) { + return false } - return rval; -}; + return exts[0] +} /** - * Removes an item from local storage. + * Lookup the MIME type for a file path/extension. * - * @param api the storage interface. - * @param id the storage ID to use. - * @param key the key for the item. + * @param {string} path + * @return {boolean|string} */ -var _removeItem = function(api, id, key) { - // get storage object - var obj = _getStorageObject(api, id); - if(obj !== null && key in obj) { - // remove key - delete obj[key]; - // see if entry has no keys remaining - var empty = true; - for(var prop in obj) { - empty = false; - break; - } - if(empty) { - // remove entry entirely if no keys are left - obj = null; - } +function lookup (path) { + if (!path || typeof path !== 'string') { + return false + } - // set storage object - _setStorageObject(api, id, obj); + // get the extension ("ext" or ".ext" or full path) + var extension = extname('x.' + path) + .toLowerCase() + .substr(1) + + if (!extension) { + return false } -}; -/** - * Clears the local disk storage identified by the given ID. - * - * @param api the storage interface. - * @param id the storage ID to use. - */ -var _clearItems = function(api, id) { - _setStorageObject(api, id, null); -}; + return exports.types[extension] || false +} /** - * Calls a storage function. - * - * @param func the function to call. - * @param args the arguments for the function. - * @param location the location argument. - * - * @return the return value from the function. + * Populate the extensions and types maps. + * @private */ -var _callStorageFunction = function(func, args, location) { - var rval = null; - // default storage types - if(typeof(location) === 'undefined') { - location = ['web', 'flash']; - } +function populateMaps (extensions, types) { + // source preference (least -> most) + var preference = ['nginx', 'apache', undefined, 'iana'] - // apply storage types in order of preference - var type; - var done = false; - var exception = null; - for(var idx in location) { - type = location[idx]; - try { - if(type === 'flash' || type === 'both') { - if(args[0] === null) { - throw new Error('Flash local storage not available.'); + Object.keys(db).forEach(function forEachMimeType (type) { + var mime = db[type] + var exts = mime.extensions + + if (!exts || !exts.length) { + return + } + + // mime -> extensions + extensions[type] = exts + + // extension -> mime + for (var i = 0; i < exts.length; i++) { + var extension = exts[i] + + if (types[extension]) { + var from = preference.indexOf(db[types[extension]].source) + var to = preference.indexOf(mime.source) + + if (types[extension] !== 'application/octet-stream' && + (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) { + // skip the remapping + continue } - rval = func.apply(this, args); - done = (type === 'flash'); - } - if(type === 'web' || type === 'both') { - args[0] = localStorage; - rval = func.apply(this, args); - done = true; } - } catch(ex) { - exception = ex; - } - if(done) { - break; + + // set the extension -> mime + types[extension] = type } - } + }) +} - if(!done) { - throw exception; - } - return rval; -}; +/***/ }), -/** - * Stores an item on local disk. - * - * The available types of local storage include 'flash', 'web', and 'both'. - * - * The type 'flash' refers to flash local storage (SharedObject). In order - * to use flash local storage, the 'api' parameter must be valid. The type - * 'web' refers to WebStorage, if supported by the browser. The type 'both' - * refers to storing using both 'flash' and 'web', not just one or the - * other. - * - * The location array should list the storage types to use in order of - * preference: - * - * ['flash']: flash only storage - * ['web']: web only storage - * ['both']: try to store in both - * ['flash','web']: store in flash first, but if not available, 'web' - * ['web','flash']: store in web first, but if not available, 'flash' - * - * The location array defaults to: ['web', 'flash'] - * - * @param api the flash interface, null to use only WebStorage. - * @param id the storage ID to use. - * @param key the key for the item. - * @param data the data for the item (any javascript object/primitive). - * @param location an array with the preferred types of storage to use. - */ -util.setItem = function(api, id, key, data, location) { - _callStorageFunction(_setItem, arguments, location); -}; +/***/ 2372: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Gets an item on local disk. - * - * Set setItem() for details on storage types. - * - * @param api the flash interface, null to use only WebStorage. - * @param id the storage ID to use. - * @param key the key for the item. - * @param location an array with the preferred types of storage to use. - * - * @return the item. - */ -util.getItem = function(api, id, key, location) { - return _callStorageFunction(_getItem, arguments, location); -}; +module.exports = minimatch +minimatch.Minimatch = Minimatch -/** - * Removes an item on local disk. - * - * Set setItem() for details on storage types. - * - * @param api the flash interface. - * @param id the storage ID to use. - * @param key the key for the item. - * @param location an array with the preferred types of storage to use. - */ -util.removeItem = function(api, id, key, location) { - _callStorageFunction(_removeItem, arguments, location); -}; +var path = { sep: '/' } +try { + path = __nccwpck_require__(71017) +} catch (er) {} -/** - * Clears the local disk storage identified by the given ID. - * - * Set setItem() for details on storage types. - * - * @param api the flash interface if flash is available. - * @param id the storage ID to use. - * @param location an array with the preferred types of storage to use. - */ -util.clearItems = function(api, id, location) { - _callStorageFunction(_clearItems, arguments, location); -}; +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = __nccwpck_require__(76475) -/** - * Check if an object is empty. - * - * Taken from: - * http://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object-from-json/679937#679937 - * - * @param object the object to check. - */ -util.isEmpty = function(obj) { - for(var prop in obj) { - if(obj.hasOwnProperty(prop)) { - return false; - } +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = qmark + '*?' + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) } - return true; -}; +} -/** - * Format with simple printf-style interpolation. - * - * %%: literal '%' - * %s,%o: convert next argument into a string. - * - * @param format the string to format. - * @param ... arguments to interpolate into the format string. - */ -util.format = function(format) { - var re = /%./g; - // current match - var match; - // current part - var part; - // current arg index - var argi = 0; - // collected parts to recombine later - var parts = []; - // last index found - var last = 0; - // loop while matches remain - while((match = re.exec(format))) { - part = format.substring(last, re.lastIndex - 2); - // don't add empty strings (ie, parts between %s%s) - if(part.length > 0) { - parts.push(part); - } - last = re.lastIndex; - // switch on % code - var code = match[0][1]; - switch(code) { - case 's': - case 'o': - // check if enough arguments were given - if(argi < arguments.length) { - parts.push(arguments[argi++ + 1]); - } else { - parts.push(''); - } - break; - // FIXME: do proper formating for numbers, etc - //case 'f': - //case 'd': - case '%': - parts.push('%'); - break; - default: - parts.push('<%' + code + '?>'); - } +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) } - // add trailing part of format string - parts.push(format.substring(last)); - return parts.join(''); -}; -/** - * Formats a number. - * - * http://snipplr.com/view/5945/javascript-numberformat--ported-from-php/ - */ -util.formatNumber = function(number, decimals, dec_point, thousands_sep) { - // http://kevin.vanzonneveld.net - // + original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) - // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) - // + bugfix by: Michael White (http://crestidg.com) - // + bugfix by: Benjamin Lupton - // + bugfix by: Allan Jensen (http://www.winternet.no) - // + revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) - // * example 1: number_format(1234.5678, 2, '.', ''); - // * returns 1: 1234.57 + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } - var n = number, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals; - var d = dec_point === undefined ? ',' : dec_point; - var t = thousands_sep === undefined ? - '.' : thousands_sep, s = n < 0 ? '-' : ''; - var i = parseInt((n = Math.abs(+n || 0).toFixed(c)), 10) + ''; - var j = (i.length > 3) ? i.length % 3 : 0; - return s + (j ? i.substr(0, j) + t : '') + - i.substr(j).replace(/(\d{3})(?=\d)/g, '$1' + t) + - (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ''); -}; + return m +} -/** - * Formats a byte size. - * - * http://snipplr.com/view/5949/format-humanize-file-byte-size-presentation-in-javascript/ - */ -util.formatSize = function(size) { - if(size >= 1073741824) { - size = util.formatNumber(size / 1073741824, 2, '.', '') + ' GiB'; - } else if(size >= 1048576) { - size = util.formatNumber(size / 1048576, 2, '.', '') + ' MiB'; - } else if(size >= 1024) { - size = util.formatNumber(size / 1024, 0) + ' KiB'; - } else { - size = util.formatNumber(size, 0) + ' bytes'; +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') } - return size; -}; -/** - * Converts an IPv4 or IPv6 string representation into bytes (in network order). - * - * @param ip the IPv4 or IPv6 address to convert. - * - * @return the 4-byte IPv6 or 16-byte IPv6 address or null if the address can't - * be parsed. - */ -util.bytesFromIP = function(ip) { - if(ip.indexOf('.') !== -1) { - return util.bytesFromIPv4(ip); + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false } - if(ip.indexOf(':') !== -1) { - return util.bytesFromIPv6(ip); + + // "" only matches "" + if (pattern.trim() === '') return p === '' + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) } - return null; -}; -/** - * Converts an IPv4 string representation into bytes (in network order). - * - * @param ip the IPv4 address to convert. - * - * @return the 4-byte address or null if the address can't be parsed. - */ -util.bytesFromIPv4 = function(ip) { - ip = ip.split('.'); - if(ip.length !== 4) { - return null; + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') } - var b = util.createBuffer(); - for(var i = 0; i < ip.length; ++i) { - var num = parseInt(ip[i], 10); - if(isNaN(num)) { - return null; - } - b.putByte(num); + + if (!options) options = {} + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') } - return b.getBytes(); -}; -/** - * Converts an IPv6 string representation into bytes (in network order). - * - * @param ip the IPv6 address to convert. - * - * @return the 16-byte address or null if the address can't be parsed. - */ -util.bytesFromIPv6 = function(ip) { - var blanks = 0; - ip = ip.split(':').filter(function(e) { - if(e.length === 0) ++blanks; - return true; - }); - var zeros = (8 - ip.length + blanks) * 2; - var b = util.createBuffer(); - for(var i = 0; i < 8; ++i) { - if(!ip[i] || ip[i].length === 0) { - b.fillWithByte(0, zeros); - zeros = 0; - continue; - } - var bytes = util.hexToBytes(ip[i]); - if(bytes.length < 2) { - b.putByte(0); - } - b.putBytes(bytes); + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return } - return b.getBytes(); -}; -/** - * Converts 4-bytes into an IPv4 string representation or 16-bytes into - * an IPv6 string representation. The bytes must be in network order. - * - * @param bytes the bytes to convert. - * - * @return the IPv4 or IPv6 string representation if 4 or 16 bytes, - * respectively, are given, otherwise null. - */ -util.bytesToIP = function(bytes) { - if(bytes.length === 4) { - return util.bytesToIPv4(bytes); + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ } - if(bytes.length === 16) { - return util.bytesToIPv6(bytes); + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } } - return null; -}; -/** - * Converts 4-bytes into an IPv4 string representation. The bytes must be - * in network order. - * - * @param bytes the bytes to convert. - * - * @return the IPv4 string representation or null for an invalid # of bytes. - */ -util.bytesToIPv4 = function(bytes) { - if(bytes.length !== 4) { - return null; + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + if (typeof pattern === 'undefined') { + throw new TypeError('undefined pattern') } - var ip = []; - for(var i = 0; i < bytes.length; ++i) { - ip.push(bytes.charCodeAt(i)); + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] } - return ip.join('.'); -}; -/** - * Converts 16-bytes into an IPv16 string representation. The bytes must be - * in network order. - * - * @param bytes the bytes to convert. - * - * @return the IPv16 string representation or null for an invalid # of bytes. - */ -util.bytesToIPv6 = function(bytes) { - if(bytes.length !== 16) { - return null; + return expand(pattern) +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') } - var ip = []; - var zeroGroups = []; - var zeroMaxGroup = 0; - for(var i = 0; i < bytes.length; i += 2) { - var hex = util.bytesToHex(bytes[i] + bytes[i + 1]); - // canonicalize zero representation - while(hex[0] === '0' && hex !== '0') { - hex = hex.substr(1); - } - if(hex === '0') { - var last = zeroGroups[zeroGroups.length - 1]; - var idx = ip.length; - if(!last || idx !== last.end + 1) { - zeroGroups.push({start: idx, end: idx}); - } else { - last.end = idx; - if((last.end - last.start) > - (zeroGroups[zeroMaxGroup].end - zeroGroups[zeroMaxGroup].start)) { - zeroMaxGroup = zeroGroups.length - 1; - } + + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === '**') return GLOBSTAR + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false } - ip.push(hex); } - if(zeroGroups.length > 0) { - var group = zeroGroups[zeroMaxGroup]; - // only shorten group of length > 0 - if(group.end - group.start > 0) { - ip.splice(group.start, group.end - group.start + 1, ''); - if(group.start === 0) { - ip.unshift(''); - } - if(group.end === 7) { - ip.push(''); - } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue } + + switch (c) { + case '/': + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + var pl = patternListStack.pop() + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) + } + pl.reEnd = re.length + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + if (inClass) { + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] } - return ip.join(':'); -}; -/** - * Estimates the number of processes that can be run concurrently. If - * creating Web Workers, keep in mind that the main JavaScript process needs - * its own core. - * - * @param options the options to use: - * update true to force an update (not use the cached value). - * @param callback(err, max) called once the operation completes. - */ -util.estimateCores = function(options, callback) { - if(typeof options === 'function') { - callback = options; - options = {}; - } - options = options || {}; - if('cores' in util && !options.update) { - return callback(null, util.cores); - } - if(typeof navigator !== 'undefined' && - 'hardwareConcurrency' in navigator && - navigator.hardwareConcurrency > 0) { - util.cores = navigator.hardwareConcurrency; - return callback(null, util.cores); + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail } - if(typeof Worker === 'undefined') { - // workers not available - util.cores = 1; - return callback(null, util.cores); + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' } - if(typeof Blob === 'undefined') { - // can't estimate, default to 2 - util.cores = 2; - return callback(null, util.cores); + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '.': + case '[': + case '(': addPatternStart = true } - // create worker concurrency estimation code as blob - var blobUrl = URL.createObjectURL(new Blob(['(', - function() { - self.addEventListener('message', function(e) { - // run worker for 4 ms - var st = Date.now(); - var et = st + 4; - while(Date.now() < et); - self.postMessage({st: st, et: et}); - }); - }.toString(), - ')()'], {type: 'application/javascript'})); + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] - // take 5 samples using 16 workers - sample([], 5, 16); + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) - function sample(max, samples, numWorkers) { - if(samples === 0) { - // get overlap average - var avg = Math.floor(max.reduce(function(avg, x) { - return avg + x; - }, 0) / max.length); - util.cores = Math.max(1, avg); - URL.revokeObjectURL(blobUrl); - return callback(null, util.cores); - } - map(numWorkers, function(err, results) { - max.push(reduce(numWorkers, results)); - sample(max, samples - 1, numWorkers); - }); - } + nlLast += nlAfter - function map(numWorkers, callback) { - var workers = []; - var results = []; - for(var i = 0; i < numWorkers; ++i) { - var worker = new Worker(blobUrl); - worker.addEventListener('message', function(e) { - results.push(e.data); - if(results.length === numWorkers) { - for(var i = 0; i < numWorkers; ++i) { - workers[i].terminate(); - } - callback(null, results); - } - }); - workers.push(worker); - } - for(var i = 0; i < numWorkers; ++i) { - workers[i].postMessage(i); + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') } - } + nlAfter = cleanAfter - function reduce(numWorkers, results) { - // find overlapping time windows - var overlaps = []; - for(var n = 0; n < numWorkers; ++n) { - var r1 = results[n]; - var overlap = overlaps[n] = []; - for(var i = 0; i < numWorkers; ++i) { - if(n === i) { - continue; - } - var r2 = results[i]; - if((r1.st > r2.st && r1.st < r2.et) || - (r2.st > r1.st && r2.st < r1.et)) { - overlap.push(i); - } - } + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' } - // get maximum overlaps ... don't include overlapping worker itself - // as the main JS process was also being scheduled during the work and - // would have to be subtracted from the estimate anyway - return overlaps.reduce(function(max, overlap) { - return Math.max(max, overlap.length); - }, 0); + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe } -}; - -/***/ }), + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } -<<<<<<< HEAD -/***/ 56939: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (addPatternStart) { + re = patternStart + re + } -var wrappy = __nccwpck_require__(8909) -======= -/***/ 57175: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } -var wrappy = __nccwpck_require__(79019) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -module.exports = wrappy(once) -module.exports.strict = wrappy(onceStrict) + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } - Object.defineProperty(Function.prototype, 'onceStrict', { - value: function () { - return onceStrict(this) - }, - configurable: true - }) -}) + regExp._glob = pattern + regExp._src = re -function once (fn) { - var f = function () { - if (f.called) return f.value - f.called = true - return f.value = fn.apply(this, arguments) - } - f.called = false - return f + return regExp } -function onceStrict (fn) { - var f = function () { - if (f.called) - throw new Error(f.onceError) - f.called = true - return f.value = fn.apply(this, arguments) - } - var name = fn.name || 'Function wrapped with `once`' - f.onceError = name + " shouldn't be called more than once" - f.called = false - return f +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() } +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp -/***/ }), + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set -<<<<<<< HEAD -/***/ 35750: -======= -/***/ 31368: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') -const pDefer = () => { - const deferred = {}; + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' - deferred.promise = new Promise((resolve, reject) => { - deferred.resolve = resolve; - deferred.reject = reject; - }); + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' - return deferred; -}; + try { + this.regexp = new RegExp(re, flags) + } catch (ex) { + this.regexp = false + } + return this.regexp +} -module.exports = pDefer; +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} +Minimatch.prototype.match = match +function match (f, partial) { + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' -/***/ }), + if (f === '/' && partial) return true -<<<<<<< HEAD -/***/ 57911: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + var options = this.options -const Fifo = __nccwpck_require__(98761) -const defer = __nccwpck_require__(35750) -======= -/***/ 93963: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) -const Fifo = __nccwpck_require__(20375) -const defer = __nccwpck_require__(31368) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. -module.exports = class PFifo { - constructor () { - this._buffer = new Fifo() - this._waitingConsumers = new Fifo() - } + var set = this.set + this.debug(this.pattern, 'set', set) - push (chunk) { - const { promise, resolve } = defer() - this._buffer.push({ chunk, resolve }) - this._consume() - return promise + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break } - _consume () { - while (!this._waitingConsumers.isEmpty() && !this._buffer.isEmpty()) { - const nextConsumer = this._waitingConsumers.shift() - const nextChunk = this._buffer.shift() - nextConsumer.resolve(nextChunk.chunk) - nextChunk.resolve() + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate } } - shift () { - const { promise, resolve } = defer() - this._waitingConsumers.push({ resolve }) - this._consume() - return promise - } - - isEmpty () { - return this._buffer.isEmpty() - } + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate } +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options -/***/ }), - -<<<<<<< HEAD -/***/ 65459: -======= -/***/ 35632: -/***/ ((module) => { - -"use strict"; + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + this.debug('matchOne', file.length, pattern.length) -var durationRE = /(-?(?:\d+\.?\d*|\d*\.?\d+)(?:e[-+]?\d+)?)\s*([\p{L}]*)/uig + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] -module.exports = parse -// enable default import syntax in typescript -module.exports["default"] = parse + this.debug(pattern, p, f) -/** - * conversion ratios - */ + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false -parse.nanosecond = -parse.ns = 1 / 1e6 + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) -parse['µs'] = -parse['μs'] = -parse.us = -parse.microsecond = 1 / 1e3 + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } -parse.millisecond = -parse.ms = -parse[''] = 1 + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] -parse.second = -parse.sec = -parse.s = parse.ms * 1000 + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) -parse.minute = -parse.min = -parse.m = parse.s * 60 + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } -parse.hour = -parse.hr = -parse.h = parse.m * 60 + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } -parse.day = -parse.d = parse.h * 24 + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } -parse.week = -parse.wk = -parse.w = parse.d * 7 + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } -parse.month = -parse.b = -parse.d * (365.25 / 12) + if (!hit) return false + } -parse.year = -parse.yr = -parse.y = parse.d * 365.25 + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* -/** - * convert `str` to ms - * - * @param {String} str - * @param {String} format - * @return {Number} - */ + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') + return emptyFileEnd + } -function parse(str='', format='ms'){ - var result = null - // ignore commas/placeholders - str = (str+'').replace(/(\d)[,_](\d)/g, '$1$2') - str.replace(durationRE, function(_, n, units){ - units = unitRatio(units) - if (units) result = (result || 0) + parseFloat(n, 10) * units - }) + // should be unreachable. + throw new Error('wtf?') +} - return result && (result / (unitRatio(format) || 1)) +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') } -function unitRatio(str) { - return parse[str] || parse[str.toLowerCase().replace(/s$/, '')] +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') } /***/ }), -/***/ 63923: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, exports, __nccwpck_require__) => { +/***/ 93666: +/***/ ((module) => { -/* - * Id is an object representation of a peer Id. a peer Id is a multihash +/** + * Helpers. */ +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; -<<<<<<< HEAD -const { CID } = __nccwpck_require__(33862) -const b32 = __nccwpck_require__(14637) -const b36 = __nccwpck_require__(66800) -const b58 = __nccwpck_require__(50119) -const b64 = __nccwpck_require__(25631) -const { base58btc } = __nccwpck_require__(50119) -const { base32 } = __nccwpck_require__(14637) -const { base16 } = __nccwpck_require__(35654) -const Digest = __nccwpck_require__(65957) -const cryptoKeys = __nccwpck_require__(55848) -const withIs = __nccwpck_require__(82677) -const { PeerIdProto } = __nccwpck_require__(17804) -const { equals: uint8ArrayEquals } = __nccwpck_require__(12667) -const { fromString: uint8ArrayFromString } = __nccwpck_require__(31277) -const { toString: uint8ArrayToString } = __nccwpck_require__(34163) -const { identity } = __nccwpck_require__(14733) -======= -const { CID } = __nccwpck_require__(24247) -const b32 = __nccwpck_require__(70784) -const b36 = __nccwpck_require__(76443) -const b58 = __nccwpck_require__(49108) -const b64 = __nccwpck_require__(98197) -const { base58btc } = __nccwpck_require__(49108) -const { base32 } = __nccwpck_require__(70784) -const { base16 } = __nccwpck_require__(98085) -const Digest = __nccwpck_require__(81168) -const cryptoKeys = __nccwpck_require__(13041) -const withIs = __nccwpck_require__(86421) -const { PeerIdProto } = __nccwpck_require__(42656) -const { equals: uint8ArrayEquals } = __nccwpck_require__(94646) -const { fromString: uint8ArrayFromString } = __nccwpck_require__(39451) -const { toString: uint8ArrayToString } = __nccwpck_require__(2771) -const { identity } = __nccwpck_require__(53863) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ -const bases = { - ...b32, - ...b36, - ...b58, - ...b64 +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } } -const baseDecoder = Object.keys(bases).reduce( - (acc, curr) => acc.or(bases[curr]), - base32.decoder -) -// these values are from https://github.com/multiformats/multicodec/blob/master/table.csv -const DAG_PB_CODE = 0x70 -const LIBP2P_KEY_CODE = 0x72 +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ -class PeerId { - constructor (id, privKey, pubKey) { - if (!(id instanceof Uint8Array)) { - throw new Error('invalid id provided') - } +function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} - if (privKey && pubKey && !uint8ArrayEquals(privKey.public.bytes, pubKey.bytes)) { - throw new Error('inconsistent arguments') - } +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ - this._id = id - this._idB58String = base58btc.encode(this.id).substring(1) - this._privKey = privKey - this._pubKey = pubKey +function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); } - - get id () { - return this._id + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); } - - set id (val) { - throw new Error('Id is immutable') + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); } - - get privKey () { - return this._privKey + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); } + return ms + ' ms'; +} - set privKey (privKey) { - this._privKey = privKey - } +/** + * Pluralization helper. + */ - get pubKey () { - if (this._pubKey) { - return this._pubKey - } +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} - if (this._privKey) { - return this._privKey.public - } - try { - const decoded = Digest.decode(this.id) +/***/ }), - if (decoded.code === identity.code) { - this._pubKey = cryptoKeys.unmarshalPublicKey(decoded.digest) - } - } catch (_) { - // Ignore, there is no valid public key - } +/***/ 22603: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return this._pubKey - } - set pubKey (pubKey) { - this._pubKey = pubKey - } - // Return the protobuf version of the public key, matching go ipfs formatting - marshalPubKey () { - if (this.pubKey) { - return cryptoKeys.marshalPublicKey(this.pubKey) - } - } +Object.defineProperty(exports, "__esModule", ({ value: true })); - // Return the protobuf version of the private key, matching go ipfs formatting - marshalPrivKey () { - if (this.privKey) { - return cryptoKeys.marshalPrivateKey(this.privKey) - } - } +var baseX$1 = __nccwpck_require__(12710); +var bytes = __nccwpck_require__(40649); - // Return the protobuf version of the peer-id - marshal (excludePriv) { - return PeerIdProto.encode({ - id: this.toBytes(), - pubKey: this.marshalPubKey(), - privKey: excludePriv ? null : this.marshalPrivKey() - }).finish() +class Encoder { + constructor(name, prefix, baseEncode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; } - - toPrint () { - let pid = this.toB58String() - // All sha256 nodes start with Qm - // We can skip the Qm to make the peer.ID more useful - if (pid.startsWith('Qm')) { - pid = pid.slice(2) - } - let maxRunes = 6 - if (pid.length < maxRunes) { - maxRunes = pid.length + encode(bytes) { + if (bytes instanceof Uint8Array) { + return `${ this.prefix }${ this.baseEncode(bytes) }`; + } else { + throw Error('Unknown type, must be binary type'); } - - return '' } - - // return the jsonified version of the key, matching the formatting - // of go-ipfs for its config file - toJSON () { - return { - id: this.toB58String(), - privKey: toB64Opt(this.marshalPrivKey()), - pubKey: toB64Opt(this.marshalPubKey()) +} +class Decoder { + constructor(name, prefix, baseDecode) { + this.name = name; + this.prefix = prefix; + if (prefix.codePointAt(0) === undefined) { + throw new Error('Invalid prefix character'); } + this.prefixCodePoint = prefix.codePointAt(0); + this.baseDecode = baseDecode; } - - // encode/decode functions - toHexString () { - return base16.encode(this.id).substring(1) + decode(text) { + if (typeof text === 'string') { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${ JSON.stringify(text) }, ${ this.name } decoder only supports inputs prefixed with ${ this.prefix }`); + } + return this.baseDecode(text.slice(this.prefix.length)); + } else { + throw Error('Can only multibase decode strings'); + } } - - toBytes () { - return this.id + or(decoder) { + return or(this, decoder); } - - toB58String () { - return this._idB58String +} +class ComposedDecoder { + constructor(decoders) { + this.decoders = decoders; } - - // return self-describing String representation - // in default format from RFC 0001: https://github.com/libp2p/specs/pull/209 - toString () { - if (!this._idCIDString) { - const cid = CID.createV1(LIBP2P_KEY_CODE, Digest.decode(this.id)) - - Object.defineProperty(this, '_idCIDString', { - value: cid.toString(), - enumerable: false - }) - } - return this._idCIDString + or(decoder) { + return or(this, decoder); } - - /** - * Checks the equality of `this` peer against a given PeerId. - * - * @param {Uint8Array|PeerId} id - * @returns {boolean} - */ - equals (id) { - if (id instanceof Uint8Array) { - return uint8ArrayEquals(this.id, id) - } else if (id.id) { - return uint8ArrayEquals(this.id, id.id) + decode(input) { + const prefix = input[0]; + const decoder = this.decoders[prefix]; + if (decoder) { + return decoder.decode(input); } else { - throw new Error('not valid Id') + throw RangeError(`Unable to decode multibase string ${ JSON.stringify(input) }, only inputs prefixed with ${ Object.keys(this.decoders) } are supported`); } } - - /** - * Checks the equality of `this` peer against a given PeerId. - * - * @deprecated Use `.equals` - * @param {Uint8Array|PeerId} id - * @returns {boolean} - */ - isEqual (id) { - return this.equals(id) +} +const or = (left, right) => new ComposedDecoder({ + ...left.decoders || { [left.prefix]: left }, + ...right.decoders || { [right.prefix]: right } +}); +class Codec { + constructor(name, prefix, baseEncode, baseDecode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + this.baseDecode = baseDecode; + this.encoder = new Encoder(name, prefix, baseEncode); + this.decoder = new Decoder(name, prefix, baseDecode); } - - /* - * Check if this PeerId instance is valid (privKey -> pubKey -> Id) - */ - isValid () { - // TODO: needs better checking - return Boolean(this.privKey && - this.privKey.public && - this.privKey.public.bytes && - this.pubKey.bytes instanceof Uint8Array && - uint8ArrayEquals(this.privKey.public.bytes, this.pubKey.bytes)) + encode(input) { + return this.encoder.encode(input); } - - /** - * Check if the PeerId has an inline public key. - * - * @returns {boolean} - */ - hasInlinePublicKey () { - try { - const decoded = Digest.decode(this.id) - - if (decoded.code === identity.code) { - return true - } - } catch (_) { - // Ignore, there is no valid public key - } - - return false + decode(input) { + return this.decoder.decode(input); } } - -const PeerIdWithIs = withIs(PeerId, { - className: 'PeerId', - symbolName: '@libp2p/js-peer-id/PeerId' -}) - -exports = module.exports = PeerIdWithIs - -const computeDigest = (pubKey) => { - if (pubKey.bytes.length <= 42) { - return Digest.create(identity.code, pubKey.bytes).bytes - } else { - return pubKey.hash() +const from = ({name, prefix, encode, decode}) => new Codec(name, prefix, encode, decode); +const baseX = ({prefix, name, alphabet}) => { + const {encode, decode} = baseX$1(alphabet, name); + return from({ + prefix, + name, + encode, + decode: text => bytes.coerce(decode(text)) + }); +}; +const decode = (string, alphabet, bitsPerChar, name) => { + const codes = {}; + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i; } -} + let end = string.length; + while (string[end - 1] === '=') { + --end; + } + const out = new Uint8Array(end * bitsPerChar / 8 | 0); + let bits = 0; + let buffer = 0; + let written = 0; + for (let i = 0; i < end; ++i) { + const value = codes[string[i]]; + if (value === undefined) { + throw new SyntaxError(`Non-${ name } character`); + } + buffer = buffer << bitsPerChar | value; + bits += bitsPerChar; + if (bits >= 8) { + bits -= 8; + out[written++] = 255 & buffer >> bits; + } + } + if (bits >= bitsPerChar || 255 & buffer << 8 - bits) { + throw new SyntaxError('Unexpected end of data'); + } + return out; +}; +const encode = (data, alphabet, bitsPerChar) => { + const pad = alphabet[alphabet.length - 1] === '='; + const mask = (1 << bitsPerChar) - 1; + let out = ''; + let bits = 0; + let buffer = 0; + for (let i = 0; i < data.length; ++i) { + buffer = buffer << 8 | data[i]; + bits += 8; + while (bits > bitsPerChar) { + bits -= bitsPerChar; + out += alphabet[mask & buffer >> bits]; + } + } + if (bits) { + out += alphabet[mask & buffer << bitsPerChar - bits]; + } + if (pad) { + while (out.length * bitsPerChar & 7) { + out += '='; + } + } + return out; +}; +const rfc4648 = ({name, prefix, bitsPerChar, alphabet}) => { + return from({ + prefix, + name, + encode(input) { + return encode(input, alphabet, bitsPerChar); + }, + decode(input) { + return decode(input, alphabet, bitsPerChar, name); + } + }); +}; -const computePeerId = async (privKey, pubKey) => { - const digest = await computeDigest(pubKey) - return new PeerIdWithIs(digest, privKey, pubKey) -} +exports.Codec = Codec; +exports.baseX = baseX; +exports.from = from; +exports.or = or; +exports.rfc4648 = rfc4648; -// generation -exports.create = async (opts) => { - opts = opts || {} - opts.bits = opts.bits || 2048 - opts.keyType = opts.keyType || 'RSA' - const key = await cryptoKeys.generateKeyPair(opts.keyType, opts.bits) - return computePeerId(key, key.public) -} +/***/ }), -exports.createFromHexString = (str) => { - return new PeerIdWithIs(base16.decode('f' + str)) -} +/***/ 97640: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -exports.createFromBytes = (buf) => { - try { - const cid = CID.decode(buf) - if (!validMulticodec(cid)) { - throw new Error('Supplied PeerID CID is invalid') - } - return exports.createFromCID(cid) - } catch { - const digest = Digest.decode(buf) +Object.defineProperty(exports, "__esModule", ({ value: true })); - if (digest.code !== identity.code) { - throw new Error('Supplied PeerID CID is invalid') - } +var base = __nccwpck_require__(22603); - return new PeerIdWithIs(buf) - } -} +const base10 = base.baseX({ + prefix: '9', + name: 'base10', + alphabet: '0123456789' +}); -exports.createFromB58String = (str) => { - return exports.createFromBytes(base58btc.decode('z' + str)) -} +exports.base10 = base10; -const validMulticodec = (cid) => { - // supported: 'libp2p-key' (CIDv1) and 'dag-pb' (CIDv0 converted to CIDv1) - return cid.code === LIBP2P_KEY_CODE || cid.code === DAG_PB_CODE -} -exports.createFromCID = (cid) => { - cid = CID.asCID(cid) +/***/ }), - if (!cid || !validMulticodec(cid)) { - throw new Error('Supplied PeerID CID is invalid') - } +/***/ 50515: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - return new PeerIdWithIs(cid.multihash.bytes) -} -// Public Key input will be a Uint8Array -exports.createFromPubKey = async (key) => { - let buf = key - if (typeof buf === 'string') { - buf = uint8ArrayFromString(key, 'base64pad') - } +Object.defineProperty(exports, "__esModule", ({ value: true })); - if (!(buf instanceof Uint8Array)) { - throw new Error('Supplied key is neither a base64 string nor a Uint8Array') - } +var base = __nccwpck_require__(22603); - const pubKey = await cryptoKeys.unmarshalPublicKey(buf) - return computePeerId(undefined, pubKey) -} +const base16 = base.rfc4648({ + prefix: 'f', + name: 'base16', + alphabet: '0123456789abcdef', + bitsPerChar: 4 +}); +const base16upper = base.rfc4648({ + prefix: 'F', + name: 'base16upper', + alphabet: '0123456789ABCDEF', + bitsPerChar: 4 +}); -// Private key input will be a string -exports.createFromPrivKey = async (key) => { - if (typeof key === 'string') { - key = uint8ArrayFromString(key, 'base64pad') - } +exports.base16 = base16; +exports.base16upper = base16upper; - if (!(key instanceof Uint8Array)) { - throw new Error('Supplied key is neither a base64 string nor a Uint8Array') - } - const privKey = await cryptoKeys.unmarshalPrivateKey(key) - return computePeerId(privKey, privKey.public) -} +/***/ }), -exports.createFromJSON = async (obj) => { - const id = base58btc.decode('z' + obj.id) - const rawPrivKey = obj.privKey && uint8ArrayFromString(obj.privKey, 'base64pad') - const rawPubKey = obj.pubKey && uint8ArrayFromString(obj.pubKey, 'base64pad') - const pub = rawPubKey && await cryptoKeys.unmarshalPublicKey(rawPubKey) +/***/ 17059: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (!rawPrivKey) { - return new PeerIdWithIs(id, undefined, pub) - } - const privKey = await cryptoKeys.unmarshalPrivateKey(rawPrivKey) - const privDigest = await computeDigest(privKey.public) - let pubDigest +Object.defineProperty(exports, "__esModule", ({ value: true })); - if (pub) { - pubDigest = await computeDigest(pub) - } +var base = __nccwpck_require__(22603); - if (pub && !uint8ArrayEquals(privDigest, pubDigest)) { - throw new Error('Public and private key do not match') - } +const base2 = base.rfc4648({ + prefix: '0', + name: 'base2', + alphabet: '01', + bitsPerChar: 1 +}); - if (id && !uint8ArrayEquals(privDigest, id)) { - throw new Error('Id and private key do not match') - } +exports.base2 = base2; - return new PeerIdWithIs(id, privKey, pub) -} -exports.createFromProtobuf = async (buf) => { - if (typeof buf === 'string') { - buf = uint8ArrayFromString(buf, 'base16') - } +/***/ }), - let { id, privKey, pubKey } = PeerIdProto.decode(buf) +/***/ 16259: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - privKey = privKey ? await cryptoKeys.unmarshalPrivateKey(privKey) : false - pubKey = pubKey ? await cryptoKeys.unmarshalPublicKey(pubKey) : false - let pubDigest - let privDigest - if (privKey) { - privDigest = await computeDigest(privKey.public) - } +Object.defineProperty(exports, "__esModule", ({ value: true })); - if (pubKey) { - pubDigest = await computeDigest(pubKey) - } +var base = __nccwpck_require__(22603); - if (privKey) { - if (pubKey) { - if (!uint8ArrayEquals(privDigest, pubDigest)) { - throw new Error('Public and private key do not match') - } +const alphabet = Array.from('\uD83D\uDE80\uD83E\uDE90\u2604\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09\u2600\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02\u2764\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09\u263A\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E\u270C\u2728\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D\u2763\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33\u270B\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13\u2B50\u2705\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6\u2714\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90\u2639\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20\u261D\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B\u26BD\uD83E\uDD19\u2615\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81\u26A1\uD83C\uDF1E\uD83C\uDF88\u274C\u270A\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C\u2708\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74\u25B6\u27A1\u2753\uD83D\uDC8E\uD83D\uDCB8\u2B07\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A\u26A0\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37\u260E\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51\u2744\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42'); +const alphabetBytesToChars = alphabet.reduce((p, c, i) => { + p[i] = c; + return p; +}, []); +const alphabetCharsToBytes = alphabet.reduce((p, c, i) => { + p[c.codePointAt(0)] = i; + return p; +}, []); +function encode(data) { + return data.reduce((p, c) => { + p += alphabetBytesToChars[c]; + return p; + }, ''); +} +function decode(str) { + const byts = []; + for (const char of str) { + const byt = alphabetCharsToBytes[char.codePointAt(0)]; + if (byt === undefined) { + throw new Error(`Non-base256emoji character: ${ char }`); } - return new PeerIdWithIs(privDigest, privKey, privKey.public) + byts.push(byt); } + return new Uint8Array(byts); +} +const base256emoji = base.from({ + prefix: '\uD83D\uDE80', + name: 'base256emoji', + encode, + decode +}); - // TODO: val id and pubDigest +exports.base256emoji = base256emoji; - if (pubKey) { - return new PeerIdWithIs(pubDigest, undefined, pubKey) - } - if (id) { - return new PeerIdWithIs(id) - } +/***/ }), - throw new Error('Protobuf did not contain any usable key material') -} +/***/ 40281: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -exports.parse = (str) => { - if (str.charAt(0) === '1' || str.charAt(0) === 'Q') { - // identity hash ed25519 key or sha2-256 hash of rsa public key - // base58btc encoded either way - str = `z${str}` - } - return exports.createFromBytes(baseDecoder.decode(str)) -} -exports.isPeerId = (peerId) => { - return Boolean(typeof peerId === 'object' && - peerId._id && - peerId._idB58String) -} +Object.defineProperty(exports, "__esModule", ({ value: true })); -function toB64Opt (val) { - if (val) { - return uint8ArrayToString(val, 'base64pad') - } -} +var base = __nccwpck_require__(22603); + +const base32 = base.rfc4648({ + prefix: 'b', + name: 'base32', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567', + bitsPerChar: 5 +}); +const base32upper = base.rfc4648({ + prefix: 'B', + name: 'base32upper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', + bitsPerChar: 5 +}); +const base32pad = base.rfc4648({ + prefix: 'c', + name: 'base32pad', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', + bitsPerChar: 5 +}); +const base32padupper = base.rfc4648({ + prefix: 'C', + name: 'base32padupper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', + bitsPerChar: 5 +}); +const base32hex = base.rfc4648({ + prefix: 'v', + name: 'base32hex', + alphabet: '0123456789abcdefghijklmnopqrstuv', + bitsPerChar: 5 +}); +const base32hexupper = base.rfc4648({ + prefix: 'V', + name: 'base32hexupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', + bitsPerChar: 5 +}); +const base32hexpad = base.rfc4648({ + prefix: 't', + name: 'base32hexpad', + alphabet: '0123456789abcdefghijklmnopqrstuv=', + bitsPerChar: 5 +}); +const base32hexpadupper = base.rfc4648({ + prefix: 'T', + name: 'base32hexpadupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', + bitsPerChar: 5 +}); +const base32z = base.rfc4648({ + prefix: 'h', + name: 'base32z', + alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', + bitsPerChar: 5 +}); + +exports.base32 = base32; +exports.base32hex = base32hex; +exports.base32hexpad = base32hexpad; +exports.base32hexpadupper = base32hexpadupper; +exports.base32hexupper = base32hexupper; +exports.base32pad = base32pad; +exports.base32padupper = base32padupper; +exports.base32upper = base32upper; +exports.base32z = base32z; /***/ }), -<<<<<<< HEAD -/***/ 17804: -======= -/***/ 42656: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 51970: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/*eslint-disable*/ -<<<<<<< HEAD -var $protobuf = __nccwpck_require__(20606); -======= -var $protobuf = __nccwpck_require__(63616); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +Object.defineProperty(exports, "__esModule", ({ value: true })); -// Common aliases -var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; +var base = __nccwpck_require__(22603); -// Exported root namespace -var $root = $protobuf.roots["libp2p-peer-id"] || ($protobuf.roots["libp2p-peer-id"] = {}); +const base36 = base.baseX({ + prefix: 'k', + name: 'base36', + alphabet: '0123456789abcdefghijklmnopqrstuvwxyz' +}); +const base36upper = base.baseX({ + prefix: 'K', + name: 'base36upper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' +}); -$root.PeerIdProto = (function() { +exports.base36 = base36; +exports.base36upper = base36upper; - /** - * Properties of a PeerIdProto. - * @exports IPeerIdProto - * @interface IPeerIdProto - * @property {Uint8Array} id PeerIdProto id - * @property {Uint8Array|null} [pubKey] PeerIdProto pubKey - * @property {Uint8Array|null} [privKey] PeerIdProto privKey - */ - /** - * Constructs a new PeerIdProto. - * @exports PeerIdProto - * @classdesc Represents a PeerIdProto. - * @implements IPeerIdProto - * @constructor - * @param {IPeerIdProto=} [p] Properties to set - */ - function PeerIdProto(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) - this[ks[i]] = p[ks[i]]; - } +/***/ }), - /** - * PeerIdProto id. - * @member {Uint8Array} id - * @memberof PeerIdProto - * @instance - */ - PeerIdProto.prototype.id = $util.newBuffer([]); +/***/ 96229: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * PeerIdProto pubKey. - * @member {Uint8Array} pubKey - * @memberof PeerIdProto - * @instance - */ - PeerIdProto.prototype.pubKey = $util.newBuffer([]); - /** - * PeerIdProto privKey. - * @member {Uint8Array} privKey - * @memberof PeerIdProto - * @instance - */ - PeerIdProto.prototype.privKey = $util.newBuffer([]); - /** - * Encodes the specified PeerIdProto message. Does not implicitly {@link PeerIdProto.verify|verify} messages. - * @function encode - * @memberof PeerIdProto - * @static - * @param {IPeerIdProto} m PeerIdProto message or plain object to encode - * @param {$protobuf.Writer} [w] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PeerIdProto.encode = function encode(m, w) { - if (!w) - w = $Writer.create(); - w.uint32(10).bytes(m.id); - if (m.pubKey != null && Object.hasOwnProperty.call(m, "pubKey")) - w.uint32(18).bytes(m.pubKey); - if (m.privKey != null && Object.hasOwnProperty.call(m, "privKey")) - w.uint32(26).bytes(m.privKey); - return w; - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); - /** - * Decodes a PeerIdProto message from the specified reader or buffer. - * @function decode - * @memberof PeerIdProto - * @static - * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from - * @param {number} [l] Message length if known beforehand - * @returns {PeerIdProto} PeerIdProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PeerIdProto.decode = function decode(r, l) { - if (!(r instanceof $Reader)) - r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, m = new $root.PeerIdProto(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.id = r.bytes(); - break; - case 2: - m.pubKey = r.bytes(); - break; - case 3: - m.privKey = r.bytes(); - break; - default: - r.skipType(t & 7); - break; - } - } - if (!m.hasOwnProperty("id")) - throw $util.ProtocolError("missing required 'id'", { instance: m }); - return m; - }; +var base = __nccwpck_require__(22603); - /** - * Creates a PeerIdProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof PeerIdProto - * @static - * @param {Object.} d Plain object - * @returns {PeerIdProto} PeerIdProto - */ - PeerIdProto.fromObject = function fromObject(d) { - if (d instanceof $root.PeerIdProto) - return d; - var m = new $root.PeerIdProto(); - if (d.id != null) { - if (typeof d.id === "string") - $util.base64.decode(d.id, m.id = $util.newBuffer($util.base64.length(d.id)), 0); - else if (d.id.length) - m.id = d.id; - } - if (d.pubKey != null) { - if (typeof d.pubKey === "string") - $util.base64.decode(d.pubKey, m.pubKey = $util.newBuffer($util.base64.length(d.pubKey)), 0); - else if (d.pubKey.length) - m.pubKey = d.pubKey; - } - if (d.privKey != null) { - if (typeof d.privKey === "string") - $util.base64.decode(d.privKey, m.privKey = $util.newBuffer($util.base64.length(d.privKey)), 0); - else if (d.privKey.length) - m.privKey = d.privKey; - } - return m; - }; +const base58btc = base.baseX({ + name: 'base58btc', + prefix: 'z', + alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +}); +const base58flickr = base.baseX({ + name: 'base58flickr', + prefix: 'Z', + alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' +}); - /** - * Creates a plain object from a PeerIdProto message. Also converts values to other types if specified. - * @function toObject - * @memberof PeerIdProto - * @static - * @param {PeerIdProto} m PeerIdProto - * @param {$protobuf.IConversionOptions} [o] Conversion options - * @returns {Object.} Plain object - */ - PeerIdProto.toObject = function toObject(m, o) { - if (!o) - o = {}; - var d = {}; - if (o.defaults) { - if (o.bytes === String) - d.id = ""; - else { - d.id = []; - if (o.bytes !== Array) - d.id = $util.newBuffer(d.id); - } - if (o.bytes === String) - d.pubKey = ""; - else { - d.pubKey = []; - if (o.bytes !== Array) - d.pubKey = $util.newBuffer(d.pubKey); - } - if (o.bytes === String) - d.privKey = ""; - else { - d.privKey = []; - if (o.bytes !== Array) - d.privKey = $util.newBuffer(d.privKey); - } - } - if (m.id != null && m.hasOwnProperty("id")) { - d.id = o.bytes === String ? $util.base64.encode(m.id, 0, m.id.length) : o.bytes === Array ? Array.prototype.slice.call(m.id) : m.id; - } - if (m.pubKey != null && m.hasOwnProperty("pubKey")) { - d.pubKey = o.bytes === String ? $util.base64.encode(m.pubKey, 0, m.pubKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.pubKey) : m.pubKey; - } - if (m.privKey != null && m.hasOwnProperty("privKey")) { - d.privKey = o.bytes === String ? $util.base64.encode(m.privKey, 0, m.privKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.privKey) : m.privKey; - } - return d; - }; +exports.base58btc = base58btc; +exports.base58flickr = base58flickr; - /** - * Converts this PeerIdProto to JSON. - * @function toJSON - * @memberof PeerIdProto - * @instance - * @returns {Object.} JSON object - */ - PeerIdProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return PeerIdProto; -})(); +/***/ }), -module.exports = $root; +/***/ 62561: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/***/ }), -<<<<<<< HEAD -/***/ 20606: -======= -/***/ 63616: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +Object.defineProperty(exports, "__esModule", ({ value: true })); -// minimal library entry point. +var base = __nccwpck_require__(22603); +const base64 = base.rfc4648({ + prefix: 'm', + name: 'base64', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + bitsPerChar: 6 +}); +const base64pad = base.rfc4648({ + prefix: 'M', + name: 'base64pad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', + bitsPerChar: 6 +}); +const base64url = base.rfc4648({ + prefix: 'u', + name: 'base64url', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', + bitsPerChar: 6 +}); +const base64urlpad = base.rfc4648({ + prefix: 'U', + name: 'base64urlpad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', + bitsPerChar: 6 +}); -<<<<<<< HEAD -module.exports = __nccwpck_require__(25251); -======= -module.exports = __nccwpck_require__(18828); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +exports.base64 = base64; +exports.base64pad = base64pad; +exports.base64url = base64url; +exports.base64urlpad = base64urlpad; /***/ }), -<<<<<<< HEAD -/***/ 25251: -======= -/***/ 18828: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 83782: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var protobuf = exports; -/** - * Build type, one of `"full"`, `"light"` or `"minimal"`. - * @name build - * @type {string} - * @const - */ -protobuf.build = "minimal"; +Object.defineProperty(exports, "__esModule", ({ value: true })); -// Serialization -<<<<<<< HEAD -protobuf.Writer = __nccwpck_require__(26372); -protobuf.BufferWriter = __nccwpck_require__(47767); -protobuf.Reader = __nccwpck_require__(91890); -protobuf.BufferReader = __nccwpck_require__(98861); +var base = __nccwpck_require__(22603); -// Utility -protobuf.util = __nccwpck_require__(29902); -protobuf.rpc = __nccwpck_require__(77733); -protobuf.roots = __nccwpck_require__(17065); -======= -protobuf.Writer = __nccwpck_require__(64693); -protobuf.BufferWriter = __nccwpck_require__(42788); -protobuf.Reader = __nccwpck_require__(37994); -protobuf.BufferReader = __nccwpck_require__(18940); +const base8 = base.rfc4648({ + prefix: '7', + name: 'base8', + alphabet: '01234567', + bitsPerChar: 3 +}); -// Utility -protobuf.util = __nccwpck_require__(39807); -protobuf.rpc = __nccwpck_require__(46688); -protobuf.roots = __nccwpck_require__(20563); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -protobuf.configure = configure; +exports.base8 = base8; -/* istanbul ignore next */ -/** - * Reconfigures the library according to the environment. - * @returns {undefined} - */ -function configure() { - protobuf.util._configure(); - protobuf.Writer._configure(protobuf.BufferWriter); - protobuf.Reader._configure(protobuf.BufferReader); -} -// Set up buffer utility according to the environment -configure(); +/***/ }), + +/***/ 13762: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +var base = __nccwpck_require__(22603); +var bytes = __nccwpck_require__(40649); + +const identity = base.from({ + prefix: '\0', + name: 'identity', + encode: buf => bytes.toString(buf), + decode: str => bytes.fromString(str) +}); + +exports.identity = identity; /***/ }), -<<<<<<< HEAD -/***/ 91890: -======= -/***/ 37994: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 41019: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -module.exports = Reader; -<<<<<<< HEAD -var util = __nccwpck_require__(29902); -======= -var util = __nccwpck_require__(39807); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +Object.defineProperty(exports, "__esModule", ({ value: true })); -var BufferReader; // cyclic +var identity = __nccwpck_require__(13762); +var base2 = __nccwpck_require__(17059); +var base8 = __nccwpck_require__(83782); +var base10 = __nccwpck_require__(97640); +var base16 = __nccwpck_require__(50515); +var base32 = __nccwpck_require__(40281); +var base36 = __nccwpck_require__(51970); +var base58 = __nccwpck_require__(96229); +var base64 = __nccwpck_require__(62561); +var base256emoji = __nccwpck_require__(16259); +var sha2 = __nccwpck_require__(10116); +var identity$1 = __nccwpck_require__(8930); +var raw = __nccwpck_require__(38034); +var json = __nccwpck_require__(20537); +__nccwpck_require__(26932); +var cid = __nccwpck_require__(62058); +var hasher = __nccwpck_require__(52577); +var digest = __nccwpck_require__(91428); +var varint = __nccwpck_require__(42235); +var bytes = __nccwpck_require__(40649); -var LongBits = util.LongBits, - utf8 = util.utf8; +const bases = { + ...identity, + ...base2, + ...base8, + ...base10, + ...base16, + ...base32, + ...base36, + ...base58, + ...base64, + ...base256emoji +}; +const hashes = { + ...sha2, + ...identity$1 +}; +const codecs = { + raw, + json +}; -/* istanbul ignore next */ -function indexOutOfRange(reader, writeLength) { - return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); -} +exports.CID = cid.CID; +exports.hasher = hasher; +exports.digest = digest; +exports.varint = varint; +exports.bytes = bytes; +exports.bases = bases; +exports.codecs = codecs; +exports.hashes = hashes; -/** - * Constructs a new reader instance using the specified buffer. - * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. - * @constructor - * @param {Uint8Array} buffer Buffer to read from - */ -function Reader(buffer) { - /** - * Read buffer. - * @type {Uint8Array} - */ - this.buf = buffer; +/***/ }), - /** - * Read buffer position. - * @type {number} - */ - this.pos = 0; +/***/ 40649: +/***/ ((__unused_webpack_module, exports) => { - /** - * Read buffer length. - * @type {number} - */ - this.len = buffer.length; -} -var create_array = typeof Uint8Array !== "undefined" - ? function create_typed_array(buffer) { - if (buffer instanceof Uint8Array || Array.isArray(buffer)) - return new Reader(buffer); - throw Error("illegal buffer"); - } - /* istanbul ignore next */ - : function create_array(buffer) { - if (Array.isArray(buffer)) - return new Reader(buffer); - throw Error("illegal buffer"); - }; -var create = function create() { - return util.Buffer - ? function create_buffer_setup(buffer) { - return (Reader.create = function create_buffer(buffer) { - return util.Buffer.isBuffer(buffer) - ? new BufferReader(buffer) - /* istanbul ignore next */ - : create_array(buffer); - })(buffer); - } - /* istanbul ignore next */ - : create_array; +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const empty = new Uint8Array(0); +const toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), ''); +const fromHex = hex => { + const hexes = hex.match(/../g); + return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : empty; +}; +const equals = (aa, bb) => { + if (aa === bb) + return true; + if (aa.byteLength !== bb.byteLength) { + return false; + } + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false; + } + } + return true; +}; +const coerce = o => { + if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') + return o; + if (o instanceof ArrayBuffer) + return new Uint8Array(o); + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength); + } + throw new Error('Unknown type, must be binary type'); }; +const isBinary = o => o instanceof ArrayBuffer || ArrayBuffer.isView(o); +const fromString = str => new TextEncoder().encode(str); +const toString = b => new TextDecoder().decode(b); -/** - * Creates a new reader using the specified buffer. - * @function - * @param {Uint8Array|Buffer} buffer Buffer to read from - * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} - * @throws {Error} If `buffer` is not a valid buffer - */ -Reader.create = create(); +exports.coerce = coerce; +exports.empty = empty; +exports.equals = equals; +exports.fromHex = fromHex; +exports.fromString = fromString; +exports.isBinary = isBinary; +exports.toHex = toHex; +exports.toString = toString; -Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; -/** - * Reads a varint as an unsigned 32 bit value. - * @function - * @returns {number} Value read - */ -Reader.prototype.uint32 = (function read_uint32_setup() { - var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) - return function read_uint32() { - value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; +/***/ }), - /* istanbul ignore if */ - if ((this.pos += 5) > this.len) { - this.pos = this.len; - throw indexOutOfRange(this, 10); +/***/ 62058: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +var varint = __nccwpck_require__(42235); +var digest = __nccwpck_require__(91428); +var base58 = __nccwpck_require__(96229); +var base32 = __nccwpck_require__(40281); +var bytes = __nccwpck_require__(40649); + +class CID { + constructor(version, code, multihash, bytes) { + this.code = code; + this.version = version; + this.multihash = multihash; + this.bytes = bytes; + this.byteOffset = bytes.byteOffset; + this.byteLength = bytes.byteLength; + this.asCID = this; + this._baseCache = new Map(); + Object.defineProperties(this, { + byteOffset: hidden, + byteLength: hidden, + code: readonly, + version: readonly, + multihash: readonly, + bytes: readonly, + _baseCache: hidden, + asCID: hidden + }); + } + toV0() { + switch (this.version) { + case 0: { + return this; + } + default: { + const {code, multihash} = this; + if (code !== DAG_PB_CODE) { + throw new Error('Cannot convert a non dag-pb CID to CIDv0'); } - return value; + if (multihash.code !== SHA_256_CODE) { + throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0'); + } + return CID.createV0(multihash); + } + } + } + toV1() { + switch (this.version) { + case 0: { + const {code, digest: digest$1} = this.multihash; + const multihash = digest.create(code, digest$1); + return CID.createV1(this.code, multihash); + } + case 1: { + return this; + } + default: { + throw Error(`Can not convert CID version ${ this.version } to version 0. This is a bug please report`); + } + } + } + equals(other) { + return other && this.code === other.code && this.version === other.version && digest.equals(this.multihash, other.multihash); + } + toString(base) { + const {bytes, version, _baseCache} = this; + switch (version) { + case 0: + return toStringV0(bytes, _baseCache, base || base58.base58btc.encoder); + default: + return toStringV1(bytes, _baseCache, base || base32.base32.encoder); + } + } + toJSON() { + return { + code: this.code, + version: this.version, + hash: this.multihash.bytes }; -})(); - -/** - * Reads a varint as a signed 32 bit value. - * @returns {number} Value read - */ -Reader.prototype.int32 = function read_int32() { - return this.uint32() | 0; + } + get [Symbol.toStringTag]() { + return 'CID'; + } + [Symbol.for('nodejs.util.inspect.custom')]() { + return 'CID(' + this.toString() + ')'; + } + static isCID(value) { + deprecate(/^0\.0/, IS_CID_DEPRECATION); + return !!(value && (value[cidSymbol] || value.asCID === value)); + } + get toBaseEncodedString() { + throw new Error('Deprecated, use .toString()'); + } + get codec() { + throw new Error('"codec" property is deprecated, use integer "code" property instead'); + } + get buffer() { + throw new Error('Deprecated .buffer property, use .bytes to get Uint8Array instead'); + } + get multibaseName() { + throw new Error('"multibaseName" property is deprecated'); + } + get prefix() { + throw new Error('"prefix" property is deprecated'); + } + static asCID(value) { + if (value instanceof CID) { + return value; + } else if (value != null && value.asCID === value) { + const {version, code, multihash, bytes} = value; + return new CID(version, code, multihash, bytes || encodeCID(version, code, multihash.bytes)); + } else if (value != null && value[cidSymbol] === true) { + const {version, multihash, code} = value; + const digest$1 = digest.decode(multihash); + return CID.create(version, code, digest$1); + } else { + return null; + } + } + static create(version, code, digest) { + if (typeof code !== 'number') { + throw new Error('String codecs are no longer supported'); + } + switch (version) { + case 0: { + if (code !== DAG_PB_CODE) { + throw new Error(`Version 0 CID must use dag-pb (code: ${ DAG_PB_CODE }) block encoding`); + } else { + return new CID(version, code, digest, digest.bytes); + } + } + case 1: { + const bytes = encodeCID(version, code, digest.bytes); + return new CID(version, code, digest, bytes); + } + default: { + throw new Error('Invalid version'); + } + } + } + static createV0(digest) { + return CID.create(0, DAG_PB_CODE, digest); + } + static createV1(code, digest) { + return CID.create(1, code, digest); + } + static decode(bytes) { + const [cid, remainder] = CID.decodeFirst(bytes); + if (remainder.length) { + throw new Error('Incorrect length'); + } + return cid; + } + static decodeFirst(bytes$1) { + const specs = CID.inspectBytes(bytes$1); + const prefixSize = specs.size - specs.multihashSize; + const multihashBytes = bytes.coerce(bytes$1.subarray(prefixSize, prefixSize + specs.multihashSize)); + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error('Incorrect length'); + } + const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize); + const digest$1 = new digest.Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); + const cid = specs.version === 0 ? CID.createV0(digest$1) : CID.createV1(specs.codec, digest$1); + return [ + cid, + bytes$1.subarray(specs.size) + ]; + } + static inspectBytes(initialBytes) { + let offset = 0; + const next = () => { + const [i, length] = varint.decode(initialBytes.subarray(offset)); + offset += length; + return i; + }; + let version = next(); + let codec = DAG_PB_CODE; + if (version === 18) { + version = 0; + offset = 0; + } else if (version === 1) { + codec = next(); + } + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${ version }`); + } + const prefixSize = offset; + const multihashCode = next(); + const digestSize = next(); + const size = offset + digestSize; + const multihashSize = size - prefixSize; + return { + version, + codec, + multihashCode, + digestSize, + multihashSize, + size + }; + } + static parse(source, base) { + const [prefix, bytes] = parseCIDtoBytes(source, base); + const cid = CID.decode(bytes); + cid._baseCache.set(prefix, source); + return cid; + } +} +const parseCIDtoBytes = (source, base) => { + switch (source[0]) { + case 'Q': { + const decoder = base || base58.base58btc; + return [ + base58.base58btc.prefix, + decoder.decode(`${ base58.base58btc.prefix }${ source }`) + ]; + } + case base58.base58btc.prefix: { + const decoder = base || base58.base58btc; + return [ + base58.base58btc.prefix, + decoder.decode(source) + ]; + } + case base32.base32.prefix: { + const decoder = base || base32.base32; + return [ + base32.base32.prefix, + decoder.decode(source) + ]; + } + default: { + if (base == null) { + throw Error('To parse non base32 or base58btc encoded CID multibase decoder must be provided'); + } + return [ + source[0], + base.decode(source) + ]; + } + } +}; +const toStringV0 = (bytes, cache, base) => { + const {prefix} = base; + if (prefix !== base58.base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${ base.name } encoding`); + } + const cid = cache.get(prefix); + if (cid == null) { + const cid = base.encode(bytes).slice(1); + cache.set(prefix, cid); + return cid; + } else { + return cid; + } +}; +const toStringV1 = (bytes, cache, base) => { + const {prefix} = base; + const cid = cache.get(prefix); + if (cid == null) { + const cid = base.encode(bytes); + cache.set(prefix, cid); + return cid; + } else { + return cid; + } +}; +const DAG_PB_CODE = 112; +const SHA_256_CODE = 18; +const encodeCID = (version, code, multihash) => { + const codeOffset = varint.encodingLength(version); + const hashOffset = codeOffset + varint.encodingLength(code); + const bytes = new Uint8Array(hashOffset + multihash.byteLength); + varint.encodeTo(version, bytes, 0); + varint.encodeTo(code, bytes, codeOffset); + bytes.set(multihash, hashOffset); + return bytes; +}; +const cidSymbol = Symbol.for('@ipld/js-cid/CID'); +const readonly = { + writable: false, + configurable: false, + enumerable: true +}; +const hidden = { + writable: false, + enumerable: false, + configurable: false }; - -/** - * Reads a zig-zag encoded varint as a signed 32 bit value. - * @returns {number} Value read - */ -Reader.prototype.sint32 = function read_sint32() { - var value = this.uint32(); - return value >>> 1 ^ -(value & 1) | 0; +const version = '0.0.0-dev'; +const deprecate = (range, message) => { + if (range.test(version)) { + console.warn(message); + } else { + throw new Error(message); + } }; +const IS_CID_DEPRECATION = `CID.isCID(v) is deprecated and will be removed in the next major release. +Following code pattern: -/* eslint-disable no-invalid-this */ - -function readLongVarint() { - // tends to deopt with local vars for octet etc. - var bits = new LongBits(0, 0); - var i = 0; - if (this.len - this.pos > 4) { // fast route (lo) - for (; i < 4; ++i) { - // 1st..4th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - // 5th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; - bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - i = 0; - } else { - for (; i < 3; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - // 1st..3th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - // 4th - bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; - return bits; - } - if (this.len - this.pos > 4) { // fast route (hi) - for (; i < 5; ++i) { - // 6th..10th - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - } else { - for (; i < 5; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - // 6th..10th - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - } - /* istanbul ignore next */ - throw Error("invalid varint encoding"); +if (CID.isCID(value)) { + doSomethingWithCID(value) } -/* eslint-enable no-invalid-this */ +Is replaced with: -/** - * Reads a varint as a signed 64 bit value. - * @name Reader#int64 - * @function - * @returns {Long} Value read - */ +const cid = CID.asCID(value) +if (cid) { + // Make sure to use cid instead of value + doSomethingWithCID(cid) +} +`; -/** - * Reads a varint as an unsigned 64 bit value. - * @name Reader#uint64 - * @function - * @returns {Long} Value read - */ +exports.CID = CID; -/** - * Reads a zig-zag encoded varint as a signed 64 bit value. - * @name Reader#sint64 - * @function - * @returns {Long} Value read - */ -/** - * Reads a varint as a boolean. - * @returns {boolean} Value read - */ -Reader.prototype.bool = function read_bool() { - return this.uint32() !== 0; -}; +/***/ }), -function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` - return (buf[end - 4] - | buf[end - 3] << 8 - | buf[end - 2] << 16 - | buf[end - 1] << 24) >>> 0; -} +/***/ 20537: +/***/ ((__unused_webpack_module, exports) => { -/** - * Reads fixed 32 bits as an unsigned 32 bit integer. - * @returns {number} Value read - */ -Reader.prototype.fixed32 = function read_fixed32() { - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - return readFixed32_end(this.buf, this.pos += 4); -}; +Object.defineProperty(exports, "__esModule", ({ value: true })); -/** - * Reads fixed 32 bits as a signed 32 bit integer. - * @returns {number} Value read - */ -Reader.prototype.sfixed32 = function read_sfixed32() { +const textEncoder = new TextEncoder(); +const textDecoder = new TextDecoder(); +const name = 'json'; +const code = 512; +const encode = node => textEncoder.encode(JSON.stringify(node)); +const decode = data => JSON.parse(textDecoder.decode(data)); - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); +exports.code = code; +exports.decode = decode; +exports.encode = encode; +exports.name = name; - return readFixed32_end(this.buf, this.pos += 4) | 0; -}; -/* eslint-disable no-invalid-this */ +/***/ }), -function readFixed64(/* this: Reader */) { +/***/ 38034: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /* istanbul ignore if */ - if (this.pos + 8 > this.len) - throw indexOutOfRange(this, 8); - return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); -} -/* eslint-enable no-invalid-this */ +Object.defineProperty(exports, "__esModule", ({ value: true })); -/** - * Reads fixed 64 bits. - * @name Reader#fixed64 - * @function - * @returns {Long} Value read - */ +var bytes = __nccwpck_require__(40649); -/** - * Reads zig-zag encoded fixed 64 bits. - * @name Reader#sfixed64 - * @function - * @returns {Long} Value read - */ +const name = 'raw'; +const code = 85; +const encode = node => bytes.coerce(node); +const decode = data => bytes.coerce(data); -/** - * Reads a float (32 bit) as a number. - * @function - * @returns {number} Value read - */ -Reader.prototype.float = function read_float() { +exports.code = code; +exports.decode = decode; +exports.encode = encode; +exports.name = name; - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - var value = util.float.readFloatLE(this.buf, this.pos); - this.pos += 4; - return value; -}; +/***/ }), -/** - * Reads a double (64 bit float) as a number. - * @function - * @returns {number} Value read - */ -Reader.prototype.double = function read_double() { +/***/ 91428: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /* istanbul ignore if */ - if (this.pos + 8 > this.len) - throw indexOutOfRange(this, 4); - var value = util.float.readDoubleLE(this.buf, this.pos); - this.pos += 8; - return value; -}; -/** - * Reads a sequence of bytes preceeded by its length as a varint. - * @returns {Uint8Array} Value read - */ -Reader.prototype.bytes = function read_bytes() { - var length = this.uint32(), - start = this.pos, - end = this.pos + length; +Object.defineProperty(exports, "__esModule", ({ value: true })); - /* istanbul ignore if */ - if (end > this.len) - throw indexOutOfRange(this, length); +var bytes = __nccwpck_require__(40649); +var varint = __nccwpck_require__(42235); - this.pos += length; - if (Array.isArray(this.buf)) // plain array - return this.buf.slice(start, end); - return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 - ? new this.buf.constructor(0) - : this._slice.call(this.buf, start, end); +const create = (code, digest) => { + const size = digest.byteLength; + const sizeOffset = varint.encodingLength(code); + const digestOffset = sizeOffset + varint.encodingLength(size); + const bytes = new Uint8Array(digestOffset + size); + varint.encodeTo(code, bytes, 0); + varint.encodeTo(size, bytes, sizeOffset); + bytes.set(digest, digestOffset); + return new Digest(code, size, digest, bytes); }; - -/** - * Reads a string preceeded by its byte length as a varint. - * @returns {string} Value read - */ -Reader.prototype.string = function read_string() { - var bytes = this.bytes(); - return utf8.read(bytes, 0, bytes.length); +const decode = multihash => { + const bytes$1 = bytes.coerce(multihash); + const [code, sizeOffset] = varint.decode(bytes$1); + const [size, digestOffset] = varint.decode(bytes$1.subarray(sizeOffset)); + const digest = bytes$1.subarray(sizeOffset + digestOffset); + if (digest.byteLength !== size) { + throw new Error('Incorrect length'); + } + return new Digest(code, size, digest, bytes$1); }; - -/** - * Skips the specified number of bytes if specified, otherwise skips a varint. - * @param {number} [length] Length if known, otherwise a varint is assumed - * @returns {Reader} `this` - */ -Reader.prototype.skip = function skip(length) { - if (typeof length === "number") { - /* istanbul ignore if */ - if (this.pos + length > this.len) - throw indexOutOfRange(this, length); - this.pos += length; - } else { - do { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - } while (this.buf[this.pos++] & 128); - } - return this; +const equals = (a, b) => { + if (a === b) { + return true; + } else { + return a.code === b.code && a.size === b.size && bytes.equals(a.bytes, b.bytes); + } }; +class Digest { + constructor(code, size, digest, bytes) { + this.code = code; + this.size = size; + this.digest = digest; + this.bytes = bytes; + } +} -/** - * Skips the next element of the specified wire type. - * @param {number} wireType Wire type received - * @returns {Reader} `this` - */ -Reader.prototype.skipType = function(wireType) { - switch (wireType) { - case 0: - this.skip(); - break; - case 1: - this.skip(8); - break; - case 2: - this.skip(this.uint32()); - break; - case 3: - while ((wireType = this.uint32() & 7) !== 4) { - this.skipType(wireType); - } - break; - case 5: - this.skip(4); - break; +exports.Digest = Digest; +exports.create = create; +exports.decode = decode; +exports.equals = equals; - /* istanbul ignore next */ - default: - throw Error("invalid wire type " + wireType + " at offset " + this.pos); - } - return this; -}; -Reader._configure = function(BufferReader_) { - BufferReader = BufferReader_; - Reader.create = create(); - BufferReader._configure(); +/***/ }), - var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; - util.merge(Reader.prototype, { +/***/ 52577: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - int64: function read_int64() { - return readLongVarint.call(this)[fn](false); - }, - uint64: function read_uint64() { - return readLongVarint.call(this)[fn](true); - }, - sint64: function read_sint64() { - return readLongVarint.call(this).zzDecode()[fn](false); - }, +Object.defineProperty(exports, "__esModule", ({ value: true })); - fixed64: function read_fixed64() { - return readFixed64.call(this)[fn](true); - }, +var digest = __nccwpck_require__(91428); - sfixed64: function read_sfixed64() { - return readFixed64.call(this)[fn](false); - } +const from = ({name, code, encode}) => new Hasher(name, code, encode); +class Hasher { + constructor(name, code, encode) { + this.name = name; + this.code = code; + this.encode = encode; + } + digest(input) { + if (input instanceof Uint8Array) { + const result = this.encode(input); + return result instanceof Uint8Array ? digest.create(this.code, result) : result.then(digest$1 => digest.create(this.code, digest$1)); + } else { + throw Error('Unknown type, must be binary type'); + } + } +} - }); -}; +exports.Hasher = Hasher; +exports.from = from; /***/ }), -<<<<<<< HEAD -/***/ 98861: -======= -/***/ 18940: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - +/***/ 8930: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -module.exports = BufferReader; -// extends Reader -<<<<<<< HEAD -var Reader = __nccwpck_require__(91890); -(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; -var util = __nccwpck_require__(29902); -======= -var Reader = __nccwpck_require__(37994); -(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; +Object.defineProperty(exports, "__esModule", ({ value: true })); -var util = __nccwpck_require__(39807); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +var bytes = __nccwpck_require__(40649); +var digest$1 = __nccwpck_require__(91428); -/** - * Constructs a new buffer reader instance. - * @classdesc Wire format reader using node buffers. - * @extends Reader - * @constructor - * @param {Buffer} buffer Buffer to read from - */ -function BufferReader(buffer) { - Reader.call(this, buffer); +const code = 0; +const name = 'identity'; +const encode = bytes.coerce; +const digest = input => digest$1.create(code, encode(input)); +const identity = { + code, + name, + encode, + digest +}; - /** - * Read buffer. - * @name BufferReader#buf - * @type {Buffer} - */ -} +exports.identity = identity; -BufferReader._configure = function () { - /* istanbul ignore else */ - if (util.Buffer) - BufferReader.prototype._slice = util.Buffer.prototype.slice; -}; +/***/ }), -/** - * @override - */ -BufferReader.prototype.string = function read_string_buffer() { - var len = this.uint32(); // modifies pos - return this.buf.utf8Slice - ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) - : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); -}; +/***/ 10116: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Reads a sequence of bytes preceeded by its length as a varint. - * @name BufferReader#bytes - * @function - * @returns {Buffer} Value read - */ -BufferReader._configure(); +Object.defineProperty(exports, "__esModule", ({ value: true })); -/***/ }), +var crypto = __nccwpck_require__(6113); +var hasher = __nccwpck_require__(52577); +var bytes = __nccwpck_require__(40649); -<<<<<<< HEAD -/***/ 17065: -======= -/***/ 20563: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } +var crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto); -module.exports = {}; +const sha256 = hasher.from({ + name: 'sha2-256', + code: 18, + encode: input => bytes.coerce(crypto__default["default"].createHash('sha256').update(input).digest()) +}); +const sha512 = hasher.from({ + name: 'sha2-512', + code: 19, + encode: input => bytes.coerce(crypto__default["default"].createHash('sha512').update(input).digest()) +}); -/** - * Named roots. - * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). - * Can also be used manually to make roots available accross modules. - * @name roots - * @type {Object.} - * @example - * // pbjs -r myroot -o compiled.js ... - * - * // in another module: - * require("./compiled.js"); - * - * // in any subsequent module: - * var root = protobuf.roots["myroot"]; - */ +exports.sha256 = sha256; +exports.sha512 = sha512; /***/ }), -<<<<<<< HEAD -/***/ 77733: -======= -/***/ 46688: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 26932: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Streaming RPC helpers. - * @namespace - */ -var rpc = exports; +Object.defineProperty(exports, "__esModule", ({ value: true })); + +var cid = __nccwpck_require__(62058); +var varint = __nccwpck_require__(42235); +var bytes = __nccwpck_require__(40649); +var hasher = __nccwpck_require__(52577); +var digest = __nccwpck_require__(91428); -/** - * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. - * @typedef RPCImpl - * @type {function} - * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called - * @param {Uint8Array} requestData Request data - * @param {RPCImplCallback} callback Callback function - * @returns {undefined} - * @example - * function rpcImpl(method, requestData, callback) { - * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code - * throw Error("no such method"); - * asynchronouslyObtainAResponse(requestData, function(err, responseData) { - * callback(err, responseData); - * }); - * } - */ -/** - * Node-style callback as used by {@link RPCImpl}. - * @typedef RPCImplCallback - * @type {function} - * @param {Error|null} error Error, if any, otherwise `null` - * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error - * @returns {undefined} - */ -<<<<<<< HEAD -rpc.Service = __nccwpck_require__(64579); -======= -rpc.Service = __nccwpck_require__(80063); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +exports.CID = cid.CID; +exports.varint = varint; +exports.bytes = bytes; +exports.hasher = hasher; +exports.digest = digest; /***/ }), -<<<<<<< HEAD -/***/ 64579: -======= -/***/ 80063: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 42235: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -module.exports = Service; -<<<<<<< HEAD -var util = __nccwpck_require__(29902); -======= -var util = __nccwpck_require__(39807); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +Object.defineProperty(exports, "__esModule", ({ value: true })); -// Extends EventEmitter -(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; +var varint$1 = __nccwpck_require__(22060); -/** - * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. - * - * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. - * @typedef rpc.ServiceMethodCallback - * @template TRes extends Message - * @type {function} - * @param {Error|null} error Error, if any - * @param {TRes} [response] Response message - * @returns {undefined} - */ +const decode = data => { + const code = varint$1.decode(data); + return [ + code, + varint$1.decode.bytes + ]; +}; +const encodeTo = (int, target, offset = 0) => { + varint$1.encode(int, target, offset); + return target; +}; +const encodingLength = int => { + return varint$1.encodingLength(int); +}; -/** - * A service method part of a {@link rpc.Service} as created by {@link Service.create}. - * @typedef rpc.ServiceMethod - * @template TReq extends Message - * @template TRes extends Message - * @type {function} - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message - * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` - */ +exports.decode = decode; +exports.encodeTo = encodeTo; +exports.encodingLength = encodingLength; -/** - * Constructs a new RPC service instance. - * @classdesc An RPC service as returned by {@link Service#create}. - * @exports rpc.Service - * @extends util.EventEmitter - * @constructor - * @param {RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ -function Service(rpcImpl, requestDelimited, responseDelimited) { - if (typeof rpcImpl !== "function") - throw TypeError("rpcImpl must be a function"); +/***/ }), - util.EventEmitter.call(this); +/***/ 12710: +/***/ ((module) => { - /** - * RPC implementation. Becomes `null` once the service is ended. - * @type {RPCImpl|null} - */ - this.rpcImpl = rpcImpl; - /** - * Whether requests are length-delimited. - * @type {boolean} - */ - this.requestDelimited = Boolean(requestDelimited); - /** - * Whether responses are length-delimited. - * @type {boolean} - */ - this.responseDelimited = Boolean(responseDelimited); +function base(ALPHABET, name) { + if (ALPHABET.length >= 255) { + throw new TypeError('Alphabet too long'); + } + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; + } + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { + throw new TypeError(x + ' is ambiguous'); + } + BASE_MAP[xc] = i; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); + var iFACTOR = Math.log(256) / Math.log(BASE); + function encode(source) { + if (source instanceof Uint8Array); + else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } else if (Array.isArray(source)) { + source = Uint8Array.from(source); + } + if (!(source instanceof Uint8Array)) { + throw new TypeError('Expected Uint8Array'); + } + if (source.length === 0) { + return ''; + } + var zeroes = 0; + var length = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } + var size = (pend - pbegin) * iFACTOR + 1 >>> 0; + var b58 = new Uint8Array(size); + while (pbegin !== pend) { + var carry = source[pbegin]; + var i = 0; + for (var it1 = size - 1; (carry !== 0 || i < length) && it1 !== -1; it1--, i++) { + carry += 256 * b58[it1] >>> 0; + b58[it1] = carry % BASE >>> 0; + carry = carry / BASE >>> 0; + } + if (carry !== 0) { + throw new Error('Non-zero carry'); + } + length = i; + pbegin++; + } + var it2 = size - length; + while (it2 !== size && b58[it2] === 0) { + it2++; + } + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { + str += ALPHABET.charAt(b58[it2]); + } + return str; + } + function decodeUnsafe(source) { + if (typeof source !== 'string') { + throw new TypeError('Expected String'); + } + if (source.length === 0) { + return new Uint8Array(); + } + var psz = 0; + if (source[psz] === ' ') { + return; + } + var zeroes = 0; + var length = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; + } + var size = (source.length - psz) * FACTOR + 1 >>> 0; + var b256 = new Uint8Array(size); + while (source[psz]) { + var carry = BASE_MAP[source.charCodeAt(psz)]; + if (carry === 255) { + return; + } + var i = 0; + for (var it3 = size - 1; (carry !== 0 || i < length) && it3 !== -1; it3--, i++) { + carry += BASE * b256[it3] >>> 0; + b256[it3] = carry % 256 >>> 0; + carry = carry / 256 >>> 0; + } + if (carry !== 0) { + throw new Error('Non-zero carry'); + } + length = i; + psz++; + } + if (source[psz] === ' ') { + return; + } + var it4 = size - length; + while (it4 !== size && b256[it4] === 0) { + it4++; + } + var vch = new Uint8Array(zeroes + (size - it4)); + var j = zeroes; + while (it4 !== size) { + vch[j++] = b256[it4++]; + } + return vch; + } + function decode(string) { + var buffer = decodeUnsafe(string); + if (buffer) { + return buffer; + } + throw new Error(`Non-${ name } character`); + } + return { + encode: encode, + decodeUnsafe: decodeUnsafe, + decode: decode + }; } +var src = base; +var _brrp__multiformats_scope_baseX = src; -/** - * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. - * @param {Method|rpc.ServiceMethod} method Reflected or static method - * @param {Constructor} requestCtor Request constructor - * @param {Constructor} responseCtor Response constructor - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} callback Service callback - * @returns {undefined} - * @template TReq extends Message - * @template TRes extends Message - */ -Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { - - if (!request) - throw TypeError("request must be specified"); - - var self = this; - if (!callback) - return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); +module.exports = _brrp__multiformats_scope_baseX; - if (!self.rpcImpl) { - setTimeout(function() { callback(Error("already ended")); }, 0); - return undefined; - } - try { - return self.rpcImpl( - method, - requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), - function rpcCallback(err, response) { +/***/ }), - if (err) { - self.emit("error", err, method); - return callback(err); - } +/***/ 22060: +/***/ ((module) => { - if (response === null) { - self.end(/* endedByRPC */ true); - return undefined; - } - if (!(response instanceof responseCtor)) { - try { - response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); - } catch (err) { - self.emit("error", err, method); - return callback(err); - } - } - self.emit("data", response, method); - return callback(null, response); - } - ); - } catch (err) { - self.emit("error", err, method); - setTimeout(function() { callback(err); }, 0); - return undefined; +var encode_1 = encode; +var MSB = 128, REST = 127, MSBALL = ~REST, INT = Math.pow(2, 31); +function encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; + while (num >= INT) { + out[offset++] = num & 255 | MSB; + num /= 128; + } + while (num & MSBALL) { + out[offset++] = num & 255 | MSB; + num >>>= 7; + } + out[offset] = num | 0; + encode.bytes = offset - oldOffset + 1; + return out; +} +var decode = read; +var MSB$1 = 128, REST$1 = 127; +function read(buf, offset) { + var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length; + do { + if (counter >= l) { + read.bytes = 0; + throw new RangeError('Could not decode varint'); } + b = buf[counter++]; + res += shift < 28 ? (b & REST$1) << shift : (b & REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= MSB$1); + read.bytes = counter - offset; + return res; +} +var N1 = Math.pow(2, 7); +var N2 = Math.pow(2, 14); +var N3 = Math.pow(2, 21); +var N4 = Math.pow(2, 28); +var N5 = Math.pow(2, 35); +var N6 = Math.pow(2, 42); +var N7 = Math.pow(2, 49); +var N8 = Math.pow(2, 56); +var N9 = Math.pow(2, 63); +var length = function (value) { + 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; }; - -/** - * Ends this service and emits the `end` event. - * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. - * @returns {rpc.Service} `this` - */ -Service.prototype.end = function end(endedByRPC) { - if (this.rpcImpl) { - if (!endedByRPC) // signal end to rpcImpl - this.rpcImpl(null, null, null); - this.rpcImpl = null; - this.emit("end").off(); - } - return this; +var varint = { + encode: encode_1, + decode: decode, + encodingLength: length }; +var _brrp_varint = varint; +var varint$1 = _brrp_varint; + +module.exports = varint$1; /***/ }), -<<<<<<< HEAD -/***/ 81883: -======= -/***/ 67489: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 76456: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +module.exports = __nccwpck_require__(40538); -module.exports = LongBits; - -<<<<<<< HEAD -var util = __nccwpck_require__(29902); -======= -var util = __nccwpck_require__(39807); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/** - * Constructs new long bits. - * @classdesc Helper class for working with the low and high bits of a 64 bit value. - * @memberof util - * @constructor - * @param {number} lo Low 32 bits, unsigned - * @param {number} hi High 32 bits, unsigned - */ -function LongBits(lo, hi) { +/***/ }), - // note that the casts below are theoretically unnecessary as of today, but older statically - // generated converter code might still call the ctor with signed 32bits. kept for compat. +/***/ 40538: +/***/ (function(module, exports) { - /** - * Low bits. - * @type {number} - */ - this.lo = lo >>> 0; +/* jshint -W086: true */ +// +----------------------------------------------------------------------+ +// | murmurHash3js.js v3.0.1 // https://github.com/pid/murmurHash3js +// | A javascript implementation of MurmurHash3's x86 hashing algorithms. | +// |----------------------------------------------------------------------| +// | Copyright (c) 2012-2015 Karan Lyons | +// | https://github.com/karanlyons/murmurHash3.js/blob/c1778f75792abef7bdd74bc85d2d4e1a3d25cfe9/murmurHash3.js | +// | Freely distributable under the MIT license. | +// +----------------------------------------------------------------------+ - /** - * High bits. - * @type {number} - */ - this.hi = hi >>> 0; -} +;(function (root, undefined) { + 'use strict'; -/** - * Zero bits. - * @memberof util.LongBits - * @type {util.LongBits} - */ -var zero = LongBits.zero = new LongBits(0, 0); + // Create a local object that'll be exported or referenced globally. + var library = { + 'version': '3.0.0', + 'x86': {}, + 'x64': {}, + 'inputValidation': true + }; -zero.toNumber = function() { return 0; }; -zero.zzEncode = zero.zzDecode = function() { return this; }; -zero.length = function() { return 1; }; + // PRIVATE FUNCTIONS + // ----------------- -/** - * Zero hash. - * @memberof util.LongBits - * @type {string} - */ -var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; + function _validBytes(bytes) { + // check the input is an array or a typed array + if (!Array.isArray(bytes) && !ArrayBuffer.isView(bytes)) { + return false; + } -/** - * Constructs new long bits from the specified number. - * @param {number} value Value - * @returns {util.LongBits} Instance - */ -LongBits.fromNumber = function fromNumber(value) { - if (value === 0) - return zero; - var sign = value < 0; - if (sign) - value = -value; - var lo = value >>> 0, - hi = (value - lo) / 4294967296 >>> 0; - if (sign) { - hi = ~hi >>> 0; - lo = ~lo >>> 0; - if (++lo > 4294967295) { - lo = 0; - if (++hi > 4294967295) - hi = 0; + // check all bytes are actually bytes + for (var i = 0; i < bytes.length; i++) { + if (!Number.isInteger(bytes[i]) || bytes[i] < 0 || bytes[i] > 255) { + return false; + } } + return true; } - return new LongBits(lo, hi); -}; -/** - * Constructs new long bits from a number, long or string. - * @param {Long|number|string} value Value - * @returns {util.LongBits} Instance - */ -LongBits.from = function from(value) { - if (typeof value === "number") - return LongBits.fromNumber(value); - if (util.isString(value)) { - /* istanbul ignore else */ - if (util.Long) - value = util.Long.fromString(value); - else - return LongBits.fromNumber(parseInt(value, 10)); + function _x86Multiply(m, n) { + // + // Given two 32bit ints, returns the two multiplied together as a + // 32bit int. + // + + return ((m & 0xffff) * n) + ((((m >>> 16) * n) & 0xffff) << 16); } - return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; -}; -/** - * Converts this long bits to a possibly unsafe JavaScript number. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {number} Possibly unsafe number - */ -LongBits.prototype.toNumber = function toNumber(unsigned) { - if (!unsigned && this.hi >>> 31) { - var lo = ~this.lo + 1 >>> 0, - hi = ~this.hi >>> 0; - if (!lo) - hi = hi + 1 >>> 0; - return -(lo + hi * 4294967296); + function _x86Rotl(m, n) { + // + // Given a 32bit int and an int representing a number of bit positions, + // returns the 32bit int rotated left by that number of positions. + // + + return (m << n) | (m >>> (32 - n)); } - return this.lo + this.hi * 4294967296; -}; -/** - * Converts this long bits to a long. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long} Long - */ -LongBits.prototype.toLong = function toLong(unsigned) { - return util.Long - ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) - /* istanbul ignore next */ - : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; -}; + function _x86Fmix(h) { + // + // Given a block, returns murmurHash3's final x86 mix of that block. + // -var charCodeAt = String.prototype.charCodeAt; + h ^= h >>> 16; + h = _x86Multiply(h, 0x85ebca6b); + h ^= h >>> 13; + h = _x86Multiply(h, 0xc2b2ae35); + h ^= h >>> 16; -/** - * Constructs new long bits from the specified 8 characters long hash. - * @param {string} hash Hash - * @returns {util.LongBits} Bits - */ -LongBits.fromHash = function fromHash(hash) { - if (hash === zeroHash) - return zero; - return new LongBits( - ( charCodeAt.call(hash, 0) - | charCodeAt.call(hash, 1) << 8 - | charCodeAt.call(hash, 2) << 16 - | charCodeAt.call(hash, 3) << 24) >>> 0 - , - ( charCodeAt.call(hash, 4) - | charCodeAt.call(hash, 5) << 8 - | charCodeAt.call(hash, 6) << 16 - | charCodeAt.call(hash, 7) << 24) >>> 0 - ); -}; + return h; + } + + function _x64Add(m, n) { + // + // Given two 64bit ints (as an array of two 32bit ints) returns the two + // added together as a 64bit int (as an array of two 32bit ints). + // + + m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff]; + n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff]; + var o = [0, 0, 0, 0]; + + o[3] += m[3] + n[3]; + o[2] += o[3] >>> 16; + o[3] &= 0xffff; + + o[2] += m[2] + n[2]; + o[1] += o[2] >>> 16; + o[2] &= 0xffff; + + o[1] += m[1] + n[1]; + o[0] += o[1] >>> 16; + o[1] &= 0xffff; + + o[0] += m[0] + n[0]; + o[0] &= 0xffff; + + return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]]; + } -/** - * Converts this long bits to a 8 characters long hash. - * @returns {string} Hash - */ -LongBits.prototype.toHash = function toHash() { - return String.fromCharCode( - this.lo & 255, - this.lo >>> 8 & 255, - this.lo >>> 16 & 255, - this.lo >>> 24 , - this.hi & 255, - this.hi >>> 8 & 255, - this.hi >>> 16 & 255, - this.hi >>> 24 - ); -}; + function _x64Multiply(m, n) { + // + // Given two 64bit ints (as an array of two 32bit ints) returns the two + // multiplied together as a 64bit int (as an array of two 32bit ints). + // -/** - * Zig-zag encodes this long bits. - * @returns {util.LongBits} `this` - */ -LongBits.prototype.zzEncode = function zzEncode() { - var mask = this.hi >> 31; - this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; - this.lo = ( this.lo << 1 ^ mask) >>> 0; - return this; -}; + m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff]; + n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff]; + var o = [0, 0, 0, 0]; -/** - * Zig-zag decodes this long bits. - * @returns {util.LongBits} `this` - */ -LongBits.prototype.zzDecode = function zzDecode() { - var mask = -(this.lo & 1); - this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; - this.hi = ( this.hi >>> 1 ^ mask) >>> 0; - return this; -}; + o[3] += m[3] * n[3]; + o[2] += o[3] >>> 16; + o[3] &= 0xffff; -/** - * Calculates the length of this longbits when encoded as a varint. - * @returns {number} Length - */ -LongBits.prototype.length = function length() { - var part0 = this.lo, - part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, - part2 = this.hi >>> 24; - return part2 === 0 - ? part1 === 0 - ? part0 < 16384 - ? part0 < 128 ? 1 : 2 - : part0 < 2097152 ? 3 : 4 - : part1 < 16384 - ? part1 < 128 ? 5 : 6 - : part1 < 2097152 ? 7 : 8 - : part2 < 128 ? 9 : 10; -}; + o[2] += m[2] * n[3]; + o[1] += o[2] >>> 16; + o[2] &= 0xffff; + o[2] += m[3] * n[2]; + o[1] += o[2] >>> 16; + o[2] &= 0xffff; -/***/ }), + o[1] += m[1] * n[3]; + o[0] += o[1] >>> 16; + o[1] &= 0xffff; -<<<<<<< HEAD -/***/ 29902: -======= -/***/ 39807: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + o[1] += m[2] * n[2]; + o[0] += o[1] >>> 16; + o[1] &= 0xffff; + o[1] += m[3] * n[1]; + o[0] += o[1] >>> 16; + o[1] &= 0xffff; -var util = exports; + o[0] += (m[0] * n[3]) + (m[1] * n[2]) + (m[2] * n[1]) + (m[3] * n[0]); + o[0] &= 0xffff; -// used to return a Promise where callback is omitted -<<<<<<< HEAD -util.asPromise = __nccwpck_require__(40488); + return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]]; + } -// converts to / from base64 encoded strings -util.base64 = __nccwpck_require__(81246); + function _x64Rotl(m, n) { + // + // Given a 64bit int (as an array of two 32bit ints) and an int + // representing a number of bit positions, returns the 64bit int (as an + // array of two 32bit ints) rotated left by that number of positions. + // -// base class of rpc.Service -util.EventEmitter = __nccwpck_require__(85885); + n %= 64; -// float handling accross browsers -util.float = __nccwpck_require__(26666); + if (n === 32) { + return [m[1], m[0]]; + } else if (n < 32) { + return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))]; + } else { + n -= 32; + return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))]; + } + } -// requires modules optionally and hides the call from bundlers -util.inquire = __nccwpck_require__(62798); + function _x64LeftShift(m, n) { + // + // Given a 64bit int (as an array of two 32bit ints) and an int + // representing a number of bit positions, returns the 64bit int (as an + // array of two 32bit ints) shifted left by that number of positions. + // -// converts to / from utf8 encoded strings -util.utf8 = __nccwpck_require__(30105); + n %= 64; -// provides a node-like buffer pool in the browser -util.pool = __nccwpck_require__(45350); + if (n === 0) { + return m; + } else if (n < 32) { + return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n]; + } else { + return [m[1] << (n - 32), 0]; + } + } -// utility to work with the low and high bits of a 64 bit value -util.LongBits = __nccwpck_require__(81883); -======= -util.asPromise = __nccwpck_require__(66619); + function _x64Xor(m, n) { + // + // Given two 64bit ints (as an array of two 32bit ints) returns the two + // xored together as a 64bit int (as an array of two 32bit ints). + // -// converts to / from base64 encoded strings -util.base64 = __nccwpck_require__(37366); + return [m[0] ^ n[0], m[1] ^ n[1]]; + } -// base class of rpc.Service -util.EventEmitter = __nccwpck_require__(98873); + function _x64Fmix(h) { + // + // Given a block, returns murmurHash3's final x64 mix of that block. + // (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the + // only place where we need to right shift 64bit ints.) + // -// float handling accross browsers -util.float = __nccwpck_require__(13001); + h = _x64Xor(h, [0, h[0] >>> 1]); + h = _x64Multiply(h, [0xff51afd7, 0xed558ccd]); + h = _x64Xor(h, [0, h[0] >>> 1]); + h = _x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]); + h = _x64Xor(h, [0, h[0] >>> 1]); -// requires modules optionally and hides the call from bundlers -util.inquire = __nccwpck_require__(74097); + return h; + } -// converts to / from utf8 encoded strings -util.utf8 = __nccwpck_require__(42114); + // PUBLIC FUNCTIONS + // ---------------- -// provides a node-like buffer pool in the browser -util.pool = __nccwpck_require__(15177); + library.x86.hash32 = function (bytes, seed) { + // + // Given a string and an optional seed as an int, returns a 32 bit hash + // using the x86 flavor of MurmurHash3, as an unsigned int. + // + if (library.inputValidation && !_validBytes(bytes)) { + return undefined; + } + seed = seed || 0; -// utility to work with the low and high bits of a 64 bit value -util.LongBits = __nccwpck_require__(67489); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + var remainder = bytes.length % 4; + var blocks = bytes.length - remainder; -/** - * Whether running within node or not. - * @memberof util - * @type {boolean} - */ -util.isNode = Boolean(typeof global !== "undefined" - && global - && global.process - && global.process.versions - && global.process.versions.node); + var h1 = seed; -/** - * Global object reference. - * @memberof util - * @type {Object} - */ -util.global = util.isNode && global - || typeof window !== "undefined" && window - || typeof self !== "undefined" && self - || this; // eslint-disable-line no-invalid-this + var k1 = 0; -/** - * An immuable empty array. - * @memberof util - * @type {Array.<*>} - * @const - */ -util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes + var c1 = 0xcc9e2d51; + var c2 = 0x1b873593; -/** - * An immutable empty object. - * @type {Object} - * @const - */ -util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes + for (var i = 0; i < blocks; i = i + 4) { + k1 = (bytes[i]) | (bytes[i + 1] << 8) | (bytes[i + 2] << 16) | (bytes[i + 3] << 24); -/** - * Tests if the specified value is an integer. - * @function - * @param {*} value Value to test - * @returns {boolean} `true` if the value is an integer - */ -util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { - return typeof value === "number" && isFinite(value) && Math.floor(value) === value; -}; + k1 = _x86Multiply(k1, c1); + k1 = _x86Rotl(k1, 15); + k1 = _x86Multiply(k1, c2); -/** - * Tests if the specified value is a string. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a string - */ -util.isString = function isString(value) { - return typeof value === "string" || value instanceof String; -}; + h1 ^= k1; + h1 = _x86Rotl(h1, 13); + h1 = _x86Multiply(h1, 5) + 0xe6546b64; + } -/** - * Tests if the specified value is a non-null object. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a non-null object - */ -util.isObject = function isObject(value) { - return value && typeof value === "object"; -}; + k1 = 0; -/** - * Checks if a property on a message is considered to be present. - * This is an alias of {@link util.isSet}. - * @function - * @param {Object} obj Plain object or message instance - * @param {string} prop Property name - * @returns {boolean} `true` if considered to be present, otherwise `false` - */ -util.isset = + switch (remainder) { + case 3: + k1 ^= bytes[i + 2] << 16; -/** - * Checks if a property on a message is considered to be present. - * @param {Object} obj Plain object or message instance - * @param {string} prop Property name - * @returns {boolean} `true` if considered to be present, otherwise `false` - */ -util.isSet = function isSet(obj, prop) { - var value = obj[prop]; - if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins - return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; - return false; -}; + case 2: + k1 ^= bytes[i + 1] << 8; -/** - * Any compatible Buffer instance. - * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. - * @interface Buffer - * @extends Uint8Array - */ + case 1: + k1 ^= bytes[i]; + k1 = _x86Multiply(k1, c1); + k1 = _x86Rotl(k1, 15); + k1 = _x86Multiply(k1, c2); + h1 ^= k1; + } -/** - * Node's Buffer class if available. - * @type {Constructor} - */ -util.Buffer = (function() { - try { - var Buffer = util.inquire("buffer").Buffer; - // refuse to use non-node buffers if not explicitly assigned (perf reasons): - return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; - } catch (e) { - /* istanbul ignore next */ - return null; - } -})(); + h1 ^= bytes.length; + h1 = _x86Fmix(h1); -// Internal alias of or polyfull for Buffer.from. -util._Buffer_from = null; + return h1 >>> 0; + }; -// Internal alias of or polyfill for Buffer.allocUnsafe. -util._Buffer_allocUnsafe = null; + library.x86.hash128 = function (bytes, seed) { + // + // Given a string and an optional seed as an int, returns a 128 bit + // hash using the x86 flavor of MurmurHash3, as an unsigned hex. + // + if (library.inputValidation && !_validBytes(bytes)) { + return undefined; + } -/** - * Creates a new buffer of whatever type supported by the environment. - * @param {number|number[]} [sizeOrArray=0] Buffer size or number array - * @returns {Uint8Array|Buffer} Buffer - */ -util.newBuffer = function newBuffer(sizeOrArray) { - /* istanbul ignore next */ - return typeof sizeOrArray === "number" - ? util.Buffer - ? util._Buffer_allocUnsafe(sizeOrArray) - : new util.Array(sizeOrArray) - : util.Buffer - ? util._Buffer_from(sizeOrArray) - : typeof Uint8Array === "undefined" - ? sizeOrArray - : new Uint8Array(sizeOrArray); -}; + seed = seed || 0; + var remainder = bytes.length % 16; + var blocks = bytes.length - remainder; -/** - * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. - * @type {Constructor} - */ -util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; + var h1 = seed; + var h2 = seed; + var h3 = seed; + var h4 = seed; -/** - * Any compatible Long instance. - * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. - * @interface Long - * @property {number} low Low bits - * @property {number} high High bits - * @property {boolean} unsigned Whether unsigned or not - */ + var k1 = 0; + var k2 = 0; + var k3 = 0; + var k4 = 0; -/** - * Long.js's Long class if available. - * @type {Constructor} - */ -util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long - || /* istanbul ignore next */ util.global.Long - || util.inquire("long"); + var c1 = 0x239b961b; + var c2 = 0xab0e9789; + var c3 = 0x38b34ae5; + var c4 = 0xa1e38b93; -/** - * Regular expression used to verify 2 bit (`bool`) map keys. - * @type {RegExp} - * @const - */ -util.key2Re = /^true|false|0|1$/; + for (var i = 0; i < blocks; i = i + 16) { + k1 = (bytes[i]) | (bytes[i + 1] << 8) | (bytes[i + 2] << 16) | (bytes[i + 3] << 24); + k2 = (bytes[i + 4]) | (bytes[i + 5] << 8) | (bytes[i + 6] << 16) | (bytes[i + 7] << 24); + k3 = (bytes[i + 8]) | (bytes[i + 9] << 8) | (bytes[i + 10] << 16) | (bytes[i + 11] << 24); + k4 = (bytes[i + 12]) | (bytes[i + 13] << 8) | (bytes[i + 14] << 16) | (bytes[i + 15] << 24); -/** - * Regular expression used to verify 32 bit (`int32` etc.) map keys. - * @type {RegExp} - * @const - */ -util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; + k1 = _x86Multiply(k1, c1); + k1 = _x86Rotl(k1, 15); + k1 = _x86Multiply(k1, c2); + h1 ^= k1; -/** - * Regular expression used to verify 64 bit (`int64` etc.) map keys. - * @type {RegExp} - * @const - */ -util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; + h1 = _x86Rotl(h1, 19); + h1 += h2; + h1 = _x86Multiply(h1, 5) + 0x561ccd1b; -/** - * Converts a number or long to an 8 characters long hash string. - * @param {Long|number} value Value to convert - * @returns {string} Hash - */ -util.longToHash = function longToHash(value) { - return value - ? util.LongBits.from(value).toHash() - : util.LongBits.zeroHash; -}; + k2 = _x86Multiply(k2, c2); + k2 = _x86Rotl(k2, 16); + k2 = _x86Multiply(k2, c3); + h2 ^= k2; -/** - * Converts an 8 characters long hash string to a long or number. - * @param {string} hash Hash - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long|number} Original value - */ -util.longFromHash = function longFromHash(hash, unsigned) { - var bits = util.LongBits.fromHash(hash); - if (util.Long) - return util.Long.fromBits(bits.lo, bits.hi, unsigned); - return bits.toNumber(Boolean(unsigned)); -}; + h2 = _x86Rotl(h2, 17); + h2 += h3; + h2 = _x86Multiply(h2, 5) + 0x0bcaa747; -/** - * Merges the properties of the source object into the destination object. - * @memberof util - * @param {Object.} dst Destination object - * @param {Object.} src Source object - * @param {boolean} [ifNotSet=false] Merges only if the key is not already set - * @returns {Object.} Destination object - */ -function merge(dst, src, ifNotSet) { // used by converters - for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) - if (dst[keys[i]] === undefined || !ifNotSet) - dst[keys[i]] = src[keys[i]]; - return dst; -} + k3 = _x86Multiply(k3, c3); + k3 = _x86Rotl(k3, 17); + k3 = _x86Multiply(k3, c4); + h3 ^= k3; -util.merge = merge; + h3 = _x86Rotl(h3, 15); + h3 += h4; + h3 = _x86Multiply(h3, 5) + 0x96cd1c35; -/** - * Converts the first character of a string to lower case. - * @param {string} str String to convert - * @returns {string} Converted string - */ -util.lcFirst = function lcFirst(str) { - return str.charAt(0).toLowerCase() + str.substring(1); -}; + k4 = _x86Multiply(k4, c4); + k4 = _x86Rotl(k4, 18); + k4 = _x86Multiply(k4, c1); + h4 ^= k4; -/** - * Creates a custom error constructor. - * @memberof util - * @param {string} name Error name - * @returns {Constructor} Custom error constructor - */ -function newError(name) { + h4 = _x86Rotl(h4, 13); + h4 += h1; + h4 = _x86Multiply(h4, 5) + 0x32ac3b17; + } - function CustomError(message, properties) { + k1 = 0; + k2 = 0; + k3 = 0; + k4 = 0; - if (!(this instanceof CustomError)) - return new CustomError(message, properties); + switch (remainder) { + case 15: + k4 ^= bytes[i + 14] << 16; - // Error.call(this, message); - // ^ just returns a new error instance because the ctor can be called as a function + case 14: + k4 ^= bytes[i + 13] << 8; - Object.defineProperty(this, "message", { get: function() { return message; } }); + case 13: + k4 ^= bytes[i + 12]; + k4 = _x86Multiply(k4, c4); + k4 = _x86Rotl(k4, 18); + k4 = _x86Multiply(k4, c1); + h4 ^= k4; - /* istanbul ignore next */ - if (Error.captureStackTrace) // node - Error.captureStackTrace(this, CustomError); - else - Object.defineProperty(this, "stack", { value: new Error().stack || "" }); + case 12: + k3 ^= bytes[i + 11] << 24; - if (properties) - merge(this, properties); - } + case 11: + k3 ^= bytes[i + 10] << 16; - (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError; + case 10: + k3 ^= bytes[i + 9] << 8; - Object.defineProperty(CustomError.prototype, "name", { get: function() { return name; } }); + case 9: + k3 ^= bytes[i + 8]; + k3 = _x86Multiply(k3, c3); + k3 = _x86Rotl(k3, 17); + k3 = _x86Multiply(k3, c4); + h3 ^= k3; - CustomError.prototype.toString = function toString() { - return this.name + ": " + this.message; - }; + case 8: + k2 ^= bytes[i + 7] << 24; - return CustomError; -} + case 7: + k2 ^= bytes[i + 6] << 16; -util.newError = newError; + case 6: + k2 ^= bytes[i + 5] << 8; -/** - * Constructs a new protocol error. - * @classdesc Error subclass indicating a protocol specifc error. - * @memberof util - * @extends Error - * @template T extends Message - * @constructor - * @param {string} message Error message - * @param {Object.} [properties] Additional properties - * @example - * try { - * MyMessage.decode(someBuffer); // throws if required fields are missing - * } catch (e) { - * if (e instanceof ProtocolError && e.instance) - * console.log("decoded so far: " + JSON.stringify(e.instance)); - * } - */ -util.ProtocolError = newError("ProtocolError"); + case 5: + k2 ^= bytes[i + 4]; + k2 = _x86Multiply(k2, c2); + k2 = _x86Rotl(k2, 16); + k2 = _x86Multiply(k2, c3); + h2 ^= k2; -/** - * So far decoded message instance. - * @name util.ProtocolError#instance - * @type {Message} - */ + case 4: + k1 ^= bytes[i + 3] << 24; -/** - * A OneOf getter as returned by {@link util.oneOfGetter}. - * @typedef OneOfGetter - * @type {function} - * @returns {string|undefined} Set field name, if any - */ + case 3: + k1 ^= bytes[i + 2] << 16; -/** - * Builds a getter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfGetter} Unbound getter - */ -util.oneOfGetter = function getOneOf(fieldNames) { - var fieldMap = {}; - for (var i = 0; i < fieldNames.length; ++i) - fieldMap[fieldNames[i]] = 1; + case 2: + k1 ^= bytes[i + 1] << 8; - /** - * @returns {string|undefined} Set field name, if any - * @this Object - * @ignore - */ - return function() { // eslint-disable-line consistent-return - for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) - if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) - return keys[i]; - }; -}; + case 1: + k1 ^= bytes[i]; + k1 = _x86Multiply(k1, c1); + k1 = _x86Rotl(k1, 15); + k1 = _x86Multiply(k1, c2); + h1 ^= k1; + } -/** - * A OneOf setter as returned by {@link util.oneOfSetter}. - * @typedef OneOfSetter - * @type {function} - * @param {string|undefined} value Field name - * @returns {undefined} - */ + h1 ^= bytes.length; + h2 ^= bytes.length; + h3 ^= bytes.length; + h4 ^= bytes.length; -/** - * Builds a setter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfSetter} Unbound setter - */ -util.oneOfSetter = function setOneOf(fieldNames) { + h1 += h2; + h1 += h3; + h1 += h4; + h2 += h1; + h3 += h1; + h4 += h1; - /** - * @param {string} name Field name - * @returns {undefined} - * @this Object - * @ignore - */ - return function(name) { - for (var i = 0; i < fieldNames.length; ++i) - if (fieldNames[i] !== name) - delete this[fieldNames[i]]; - }; -}; + h1 = _x86Fmix(h1); + h2 = _x86Fmix(h2); + h3 = _x86Fmix(h3); + h4 = _x86Fmix(h4); -/** - * Default conversion options used for {@link Message#toJSON} implementations. - * - * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: - * - * - Longs become strings - * - Enums become string keys - * - Bytes become base64 encoded strings - * - (Sub-)Messages become plain objects - * - Maps become plain objects with all string keys - * - Repeated fields become arrays - * - NaN and Infinity for float and double fields become strings - * - * @type {IConversionOptions} - * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json - */ -util.toJSONOptions = { - longs: String, - enums: String, - bytes: String, - json: true -}; + h1 += h2; + h1 += h3; + h1 += h4; + h2 += h1; + h3 += h1; + h4 += h1; -// Sets up buffer utility according to the environment (called in index-minimal) -util._configure = function() { - var Buffer = util.Buffer; - /* istanbul ignore if */ - if (!Buffer) { - util._Buffer_from = util._Buffer_allocUnsafe = null; - return; - } - // because node 4.x buffers are incompatible & immutable - // see: https://github.com/dcodeIO/protobuf.js/pull/665 - util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || - /* istanbul ignore next */ - function Buffer_from(value, encoding) { - return new Buffer(value, encoding); - }; - util._Buffer_allocUnsafe = Buffer.allocUnsafe || - /* istanbul ignore next */ - function Buffer_allocUnsafe(size) { - return new Buffer(size); - }; -}; + 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); + }; + library.x64.hash128 = function (bytes, seed) { + // + // Given a string and an optional seed as an int, returns a 128 bit + // hash using the x64 flavor of MurmurHash3, as an unsigned hex. + // + if (library.inputValidation && !_validBytes(bytes)) { + return undefined; + } + seed = seed || 0; -/***/ }), + var remainder = bytes.length % 16; + var blocks = bytes.length - remainder; -<<<<<<< HEAD -/***/ 26372: -======= -/***/ 64693: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + var h1 = [0, seed]; + var h2 = [0, seed]; + var k1 = [0, 0]; + var k2 = [0, 0]; -module.exports = Writer; + var c1 = [0x87c37b91, 0x114253d5]; + var c2 = [0x4cf5ad43, 0x2745937f]; -<<<<<<< HEAD -var util = __nccwpck_require__(29902); -======= -var util = __nccwpck_require__(39807); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + for (var i = 0; i < blocks; i = i + 16) { + k1 = [(bytes[i + 4]) | (bytes[i + 5] << 8) | (bytes[i + 6] << 16) | (bytes[i + 7] << 24), (bytes[i]) | + (bytes[i + 1] << 8) | (bytes[i + 2] << 16) | (bytes[i + 3] << 24)]; + k2 = [(bytes[i + 12]) | (bytes[i + 13] << 8) | (bytes[i + 14] << 16) | (bytes[i + 15] << 24), (bytes[i + 8]) | + (bytes[i + 9] << 8) | (bytes[i + 10] << 16) | (bytes[i + 11] << 24)]; -var BufferWriter; // cyclic + k1 = _x64Multiply(k1, c1); + k1 = _x64Rotl(k1, 31); + k1 = _x64Multiply(k1, c2); + h1 = _x64Xor(h1, k1); -var LongBits = util.LongBits, - base64 = util.base64, - utf8 = util.utf8; + h1 = _x64Rotl(h1, 27); + h1 = _x64Add(h1, h2); + h1 = _x64Add(_x64Multiply(h1, [0, 5]), [0, 0x52dce729]); -/** - * Constructs a new writer operation instance. - * @classdesc Scheduled writer operation. - * @constructor - * @param {function(*, Uint8Array, number)} fn Function to call - * @param {number} len Value byte length - * @param {*} val Value to write - * @ignore - */ -function Op(fn, len, val) { + k2 = _x64Multiply(k2, c2); + k2 = _x64Rotl(k2, 33); + k2 = _x64Multiply(k2, c1); + h2 = _x64Xor(h2, k2); - /** - * Function to call. - * @type {function(Uint8Array, number, *)} - */ - this.fn = fn; + h2 = _x64Rotl(h2, 31); + h2 = _x64Add(h2, h1); + h2 = _x64Add(_x64Multiply(h2, [0, 5]), [0, 0x38495ab5]); + } - /** - * Value byte length. - * @type {number} - */ - this.len = len; + k1 = [0, 0]; + k2 = [0, 0]; - /** - * Next operation. - * @type {Writer.Op|undefined} - */ - this.next = undefined; + switch (remainder) { + case 15: + k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 14]], 48)); - /** - * Value to write. - * @type {*} - */ - this.val = val; // type varies -} + case 14: + k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 13]], 40)); -/* istanbul ignore next */ -function noop() {} // eslint-disable-line no-empty-function + case 13: + k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 12]], 32)); -/** - * Constructs a new writer state instance. - * @classdesc Copied writer state. - * @memberof Writer - * @constructor - * @param {Writer} writer Writer to copy state from - * @ignore - */ -function State(writer) { + case 12: + k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 11]], 24)); - /** - * Current head. - * @type {Writer.Op} - */ - this.head = writer.head; + case 11: + k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 10]], 16)); - /** - * Current tail. - * @type {Writer.Op} - */ - this.tail = writer.tail; + case 10: + k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 9]], 8)); - /** - * Current buffer length. - * @type {number} - */ - this.len = writer.len; + case 9: + k2 = _x64Xor(k2, [0, bytes[i + 8]]); + k2 = _x64Multiply(k2, c2); + k2 = _x64Rotl(k2, 33); + k2 = _x64Multiply(k2, c1); + h2 = _x64Xor(h2, k2); - /** - * Next state. - * @type {State|null} - */ - this.next = writer.states; -} + case 8: + k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 7]], 56)); -/** - * Constructs a new writer instance. - * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. - * @constructor - */ -function Writer() { + case 7: + k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 6]], 48)); - /** - * Current length. - * @type {number} - */ - this.len = 0; + case 6: + k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 5]], 40)); - /** - * Operations head. - * @type {Object} - */ - this.head = new Op(noop, 0, 0); + case 5: + k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 4]], 32)); - /** - * Operations tail - * @type {Object} - */ - this.tail = this.head; + case 4: + k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 3]], 24)); - /** - * Linked forked states. - * @type {Object|null} - */ - this.states = null; + case 3: + k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 2]], 16)); - // When a value is written, the writer calculates its byte length and puts it into a linked - // list of operations to perform when finish() is called. This both allows us to allocate - // buffers of the exact required size and reduces the amount of work we have to do compared - // to first calculating over objects and then encoding over objects. In our case, the encoding - // part is just a linked list walk calling operations with already prepared values. -} + case 2: + k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 1]], 8)); -var create = function create() { - return util.Buffer - ? function create_buffer_setup() { - return (Writer.create = function create_buffer() { - return new BufferWriter(); - })(); + case 1: + k1 = _x64Xor(k1, [0, bytes[i]]); + k1 = _x64Multiply(k1, c1); + k1 = _x64Rotl(k1, 31); + k1 = _x64Multiply(k1, c2); + h1 = _x64Xor(h1, k1); } - /* istanbul ignore next */ - : function create_array() { - return new Writer(); - }; -}; -/** - * Creates a new writer. - * @function - * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} - */ -Writer.create = create(); + h1 = _x64Xor(h1, [0, bytes.length]); + h2 = _x64Xor(h2, [0, bytes.length]); -/** - * Allocates a buffer of the specified size. - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ -Writer.alloc = function alloc(size) { - return new util.Array(size); -}; + h1 = _x64Add(h1, h2); + h2 = _x64Add(h2, h1); -// Use Uint8Array buffer pool in the browser, just like node does with buffers -/* istanbul ignore else */ -if (util.Array !== Array) - Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); + h1 = _x64Fmix(h1); + h2 = _x64Fmix(h2); -/** - * Pushes a new operation to the queue. - * @param {function(Uint8Array, number, *)} fn Function to call - * @param {number} len Value byte length - * @param {number} val Value to write - * @returns {Writer} `this` - * @private - */ -Writer.prototype._push = function push(fn, len, val) { - this.tail = this.tail.next = new Op(fn, len, val); - this.len += len; - return this; -}; + h1 = _x64Add(h1, h2); + h2 = _x64Add(h2, h1); -function writeByte(val, buf, pos) { - buf[pos] = val & 255; -} + 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); + }; -function writeVarint32(val, buf, pos) { - while (val > 127) { - buf[pos++] = val & 127 | 128; - val >>>= 7; - } - buf[pos] = val; -} + // INITIALIZATION + // -------------- -/** - * Constructs a new varint writer operation instance. - * @classdesc Scheduled varint writer operation. - * @extends Op - * @constructor - * @param {number} len Value byte length - * @param {number} val Value to write - * @ignore - */ -function VarintOp(len, val) { - this.len = len; - this.next = undefined; - this.val = val; -} + // Export murmurHash3 for CommonJS, either as an AMD module or just as part + // of the global object. + if (true) { -VarintOp.prototype = Object.create(Op.prototype); -VarintOp.prototype.fn = writeVarint32; + if ( true && module.exports) { + exports = module.exports = library; + } -/** - * Writes an unsigned 32 bit value as a varint. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.uint32 = function write_uint32(value) { - // here, the call to this.push has been inlined and a varint specific Op subclass is used. - // uint32 is by far the most frequently used operation and benefits significantly from this. - this.len += (this.tail = this.tail.next = new VarintOp( - (value = value >>> 0) - < 128 ? 1 - : value < 16384 ? 2 - : value < 2097152 ? 3 - : value < 268435456 ? 4 - : 5, - value)).len; - return this; -}; + exports.murmurHash3 = library; -/** - * Writes a signed 32 bit value as a varint. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.int32 = function write_int32(value) { - return value < 0 - ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec - : this.uint32(value); -}; + } else {} +})(this); -/** - * Writes a 32 bit value as a varint, zig-zag encoded. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.sint32 = function write_sint32(value) { - return this.uint32((value << 1 ^ value >> 31) >>> 0); -}; -function writeVarint64(val, buf, pos) { - while (val.hi) { - buf[pos++] = val.lo & 127 | 128; - val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; - val.hi >>>= 7; - } - while (val.lo > 127) { - buf[pos++] = val.lo & 127 | 128; - val.lo = val.lo >>> 7; - } - buf[pos++] = val.lo; -} +/***/ }), -/** - * Writes an unsigned 64 bit value as a varint. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.uint64 = function write_uint64(value) { - var bits = LongBits.from(value); - return this._push(writeVarint64, bits.length(), bits); -}; +/***/ 59745: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /** - * Writes a signed 64 bit value as a varint. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. + * Advanced Encryption Standard (AES) implementation. + * + * This implementation is based on the public domain library 'jscrypto' which + * was written by: + * + * Emily Stark (estark@stanford.edu) + * Mike Hamburg (mhamburg@stanford.edu) + * Dan Boneh (dabo@cs.stanford.edu) + * + * Parts of this code are based on the OpenSSL implementation of AES: + * http://www.openssl.org + * + * @author Dave Longley + * + * Copyright (c) 2010-2014 Digital Bazaar, Inc. */ -Writer.prototype.int64 = Writer.prototype.uint64; +var forge = __nccwpck_require__(56389); +__nccwpck_require__(7329); +__nccwpck_require__(33975); +__nccwpck_require__(65138); + +/* AES API */ +module.exports = forge.aes = forge.aes || {}; /** - * Writes a signed 64 bit value as a varint, zig-zag encoded. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. + * Deprecated. Instead, use: + * + * var cipher = forge.cipher.createCipher('AES-', key); + * cipher.start({iv: iv}); + * + * Creates an AES cipher object to encrypt data using the given symmetric key. + * The output will be stored in the 'output' member of the returned cipher. + * + * The key and iv may be given as a string of bytes, an array of bytes, + * a byte buffer, or an array of 32-bit words. + * + * @param key the symmetric key to use. + * @param iv the initialization vector to use. + * @param output the buffer to write to, null to create one. + * @param mode the cipher mode to use (default: 'CBC'). + * + * @return the cipher. */ -Writer.prototype.sint64 = function write_sint64(value) { - var bits = LongBits.from(value).zzEncode(); - return this._push(writeVarint64, bits.length(), bits); +forge.aes.startEncrypting = function(key, iv, output, mode) { + var cipher = _createCipher({ + key: key, + output: output, + decrypt: false, + mode: mode + }); + cipher.start(iv); + return cipher; }; /** - * Writes a boolish value as a varint. - * @param {boolean} value Value to write - * @returns {Writer} `this` + * Deprecated. Instead, use: + * + * var cipher = forge.cipher.createCipher('AES-', key); + * + * Creates an AES cipher object to encrypt data using the given symmetric key. + * + * The key may be given as a string of bytes, an array of bytes, a + * byte buffer, or an array of 32-bit words. + * + * @param key the symmetric key to use. + * @param mode the cipher mode to use (default: 'CBC'). + * + * @return the cipher. */ -Writer.prototype.bool = function write_bool(value) { - return this._push(writeByte, 1, value ? 1 : 0); +forge.aes.createEncryptionCipher = function(key, mode) { + return _createCipher({ + key: key, + output: null, + decrypt: false, + mode: mode + }); }; -function writeFixed32(val, buf, pos) { - buf[pos ] = val & 255; - buf[pos + 1] = val >>> 8 & 255; - buf[pos + 2] = val >>> 16 & 255; - buf[pos + 3] = val >>> 24; -} - /** - * Writes an unsigned 32 bit value as fixed 32 bits. - * @param {number} value Value to write - * @returns {Writer} `this` + * Deprecated. Instead, use: + * + * var decipher = forge.cipher.createDecipher('AES-', key); + * decipher.start({iv: iv}); + * + * Creates an AES cipher object to decrypt data using the given symmetric key. + * The output will be stored in the 'output' member of the returned cipher. + * + * The key and iv may be given as a string of bytes, an array of bytes, + * a byte buffer, or an array of 32-bit words. + * + * @param key the symmetric key to use. + * @param iv the initialization vector to use. + * @param output the buffer to write to, null to create one. + * @param mode the cipher mode to use (default: 'CBC'). + * + * @return the cipher. */ -Writer.prototype.fixed32 = function write_fixed32(value) { - return this._push(writeFixed32, 4, value >>> 0); +forge.aes.startDecrypting = function(key, iv, output, mode) { + var cipher = _createCipher({ + key: key, + output: output, + decrypt: true, + mode: mode + }); + cipher.start(iv); + return cipher; }; /** - * Writes a signed 32 bit value as fixed 32 bits. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` + * Deprecated. Instead, use: + * + * var decipher = forge.cipher.createDecipher('AES-', key); + * + * Creates an AES cipher object to decrypt data using the given symmetric key. + * + * The key may be given as a string of bytes, an array of bytes, a + * byte buffer, or an array of 32-bit words. + * + * @param key the symmetric key to use. + * @param mode the cipher mode to use (default: 'CBC'). + * + * @return the cipher. */ -Writer.prototype.sfixed32 = Writer.prototype.fixed32; +forge.aes.createDecryptionCipher = function(key, mode) { + return _createCipher({ + key: key, + output: null, + decrypt: true, + mode: mode + }); +}; /** - * Writes an unsigned 64 bit value as fixed 64 bits. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. + * Creates a new AES cipher algorithm object. + * + * @param name the name of the algorithm. + * @param mode the mode factory function. + * + * @return the AES algorithm object. */ -Writer.prototype.fixed64 = function write_fixed64(value) { - var bits = LongBits.from(value); - return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); +forge.aes.Algorithm = function(name, mode) { + if(!init) { + initialize(); + } + var self = this; + self.name = name; + self.mode = new mode({ + blockSize: 16, + cipher: { + encrypt: function(inBlock, outBlock) { + return _updateBlock(self._w, inBlock, outBlock, false); + }, + decrypt: function(inBlock, outBlock) { + return _updateBlock(self._w, inBlock, outBlock, true); + } + } + }); + self._init = false; }; /** - * Writes a signed 64 bit value as fixed 64 bits. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. + * Initializes this AES algorithm by expanding its key. + * + * @param options the options to use. + * key the key to use with this algorithm. + * decrypt true if the algorithm should be initialized for decryption, + * false for encryption. */ -Writer.prototype.sfixed64 = Writer.prototype.fixed64; +forge.aes.Algorithm.prototype.initialize = function(options) { + if(this._init) { + return; + } -/** - * Writes a float (32 bit). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.float = function write_float(value) { - return this._push(util.float.writeFloatLE, 4, value); -}; + var key = options.key; + var tmp; -/** - * Writes a double (64 bit float). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.double = function write_double(value) { - return this._push(util.float.writeDoubleLE, 8, value); -}; + /* Note: The key may be a string of bytes, an array of bytes, a byte + buffer, or an array of 32-bit integers. If the key is in bytes, then + it must be 16, 24, or 32 bytes in length. If it is in 32-bit + integers, it must be 4, 6, or 8 integers long. */ -var writeBytes = util.Array.prototype.set - ? function writeBytes_set(val, buf, pos) { - buf.set(val, pos); // also works for plain array values + if(typeof key === 'string' && + (key.length === 16 || key.length === 24 || key.length === 32)) { + // convert key string into byte buffer + key = forge.util.createBuffer(key); + } else if(forge.util.isArray(key) && + (key.length === 16 || key.length === 24 || key.length === 32)) { + // convert key integer array into byte buffer + tmp = key; + key = forge.util.createBuffer(); + for(var i = 0; i < tmp.length; ++i) { + key.putByte(tmp[i]); } - /* istanbul ignore next */ - : function writeBytes_for(val, buf, pos) { - for (var i = 0; i < val.length; ++i) - buf[pos + i] = val[i]; - }; + } -/** - * Writes a sequence of bytes. - * @param {Uint8Array|string} value Buffer or base64 encoded string to write - * @returns {Writer} `this` - */ -Writer.prototype.bytes = function write_bytes(value) { - var len = value.length >>> 0; - if (!len) - return this._push(writeByte, 1, 0); - if (util.isString(value)) { - var buf = Writer.alloc(len = base64.length(value)); - base64.decode(value, buf, 0); - value = buf; + // convert key byte buffer into 32-bit integer array + if(!forge.util.isArray(key)) { + tmp = key; + key = []; + + // key lengths of 16, 24, 32 bytes allowed + var len = tmp.length(); + if(len === 16 || len === 24 || len === 32) { + len = len >>> 2; + for(var i = 0; i < len; ++i) { + key.push(tmp.getInt32()); + } } - return this.uint32(len)._push(writeBytes, len, value); -}; + } -/** - * Writes a string. - * @param {string} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.string = function write_string(value) { - var len = utf8.length(value); - return len - ? this.uint32(len)._push(utf8.write, len, value) - : this._push(writeByte, 1, 0); -}; + // key must be an array of 32-bit integers by now + if(!forge.util.isArray(key) || + !(key.length === 4 || key.length === 6 || key.length === 8)) { + throw new Error('Invalid key parameter.'); + } -/** - * Forks this writer's state by pushing it to a stack. - * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. - * @returns {Writer} `this` - */ -Writer.prototype.fork = function fork() { - this.states = new State(this); - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; - return this; + // encryption operation is always used for these modes + var mode = this.mode.name; + var encryptOp = (['CFB', 'OFB', 'CTR', 'GCM'].indexOf(mode) !== -1); + + // do key expansion + this._w = _expandKey(key, options.decrypt && !encryptOp); + this._init = true; }; /** - * Resets this instance to the last state. - * @returns {Writer} `this` + * Expands a key. Typically only used for testing. + * + * @param key the symmetric key to expand, as an array of 32-bit words. + * @param decrypt true to expand for decryption, false for encryption. + * + * @return the expanded key. */ -Writer.prototype.reset = function reset() { - if (this.states) { - this.head = this.states.head; - this.tail = this.states.tail; - this.len = this.states.len; - this.states = this.states.next; - } else { - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; - } - return this; +forge.aes._expandKey = function(key, decrypt) { + if(!init) { + initialize(); + } + return _expandKey(key, decrypt); }; /** - * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. - * @returns {Writer} `this` + * Updates a single block. Typically only used for testing. + * + * @param w the expanded key to use. + * @param input an array of block-size 32-bit words. + * @param output an array of block-size 32-bit words. + * @param decrypt true to decrypt, false to encrypt. */ -Writer.prototype.ldelim = function ldelim() { - var head = this.head, - tail = this.tail, - len = this.len; - this.reset().uint32(len); - if (len) { - this.tail.next = head.next; // skip noop - this.tail = tail; - this.len += len; - } - return this; -}; +forge.aes._updateBlock = _updateBlock; + +/** Register AES algorithms **/ + +registerAlgorithm('AES-ECB', forge.cipher.modes.ecb); +registerAlgorithm('AES-CBC', forge.cipher.modes.cbc); +registerAlgorithm('AES-CFB', forge.cipher.modes.cfb); +registerAlgorithm('AES-OFB', forge.cipher.modes.ofb); +registerAlgorithm('AES-CTR', forge.cipher.modes.ctr); +registerAlgorithm('AES-GCM', forge.cipher.modes.gcm); + +function registerAlgorithm(name, mode) { + var factory = function() { + return new forge.aes.Algorithm(name, mode); + }; + forge.cipher.registerAlgorithm(name, factory); +} + +/** AES implementation **/ + +var init = false; // not yet initialized +var Nb = 4; // number of words comprising the state (AES = 4) +var sbox; // non-linear substitution table used in key expansion +var isbox; // inversion of sbox +var rcon; // round constant word array +var mix; // mix-columns table +var imix; // inverse mix-columns table /** - * Finishes the write operation. - * @returns {Uint8Array} Finished buffer + * Performs initialization, ie: precomputes tables to optimize for speed. + * + * One way to understand how AES works is to imagine that 'addition' and + * 'multiplication' are interfaces that require certain mathematical + * properties to hold true (ie: they are associative) but they might have + * different implementations and produce different kinds of results ... + * provided that their mathematical properties remain true. AES defines + * its own methods of addition and multiplication but keeps some important + * properties the same, ie: associativity and distributivity. The + * explanation below tries to shed some light on how AES defines addition + * and multiplication of bytes and 32-bit words in order to perform its + * encryption and decryption algorithms. + * + * The basics: + * + * The AES algorithm views bytes as binary representations of polynomials + * that have either 1 or 0 as the coefficients. It defines the addition + * or subtraction of two bytes as the XOR operation. It also defines the + * multiplication of two bytes as a finite field referred to as GF(2^8) + * (Note: 'GF' means "Galois Field" which is a field that contains a finite + * number of elements so GF(2^8) has 256 elements). + * + * This means that any two bytes can be represented as binary polynomials; + * when they multiplied together and modularly reduced by an irreducible + * polynomial of the 8th degree, the results are the field GF(2^8). The + * specific irreducible polynomial that AES uses in hexadecimal is 0x11b. + * This multiplication is associative with 0x01 as the identity: + * + * (b * 0x01 = GF(b, 0x01) = b). + * + * The operation GF(b, 0x02) can be performed at the byte level by left + * shifting b once and then XOR'ing it (to perform the modular reduction) + * with 0x11b if b is >= 128. Repeated application of the multiplication + * of 0x02 can be used to implement the multiplication of any two bytes. + * + * For instance, multiplying 0x57 and 0x13, denoted as GF(0x57, 0x13), can + * be performed by factoring 0x13 into 0x01, 0x02, and 0x10. Then these + * factors can each be multiplied by 0x57 and then added together. To do + * the multiplication, values for 0x57 multiplied by each of these 3 factors + * can be precomputed and stored in a table. To add them, the values from + * the table are XOR'd together. + * + * AES also defines addition and multiplication of words, that is 4-byte + * numbers represented as polynomials of 3 degrees where the coefficients + * are the values of the bytes. + * + * The word [a0, a1, a2, a3] is a polynomial a3x^3 + a2x^2 + a1x + a0. + * + * Addition is performed by XOR'ing like powers of x. Multiplication + * is performed in two steps, the first is an algebriac expansion as + * you would do normally (where addition is XOR). But the result is + * a polynomial larger than 3 degrees and thus it cannot fit in a word. So + * next the result is modularly reduced by an AES-specific polynomial of + * degree 4 which will always produce a polynomial of less than 4 degrees + * such that it will fit in a word. In AES, this polynomial is x^4 + 1. + * + * The modular product of two polynomials 'a' and 'b' is thus: + * + * d(x) = d3x^3 + d2x^2 + d1x + d0 + * with + * d0 = GF(a0, b0) ^ GF(a3, b1) ^ GF(a2, b2) ^ GF(a1, b3) + * d1 = GF(a1, b0) ^ GF(a0, b1) ^ GF(a3, b2) ^ GF(a2, b3) + * d2 = GF(a2, b0) ^ GF(a1, b1) ^ GF(a0, b2) ^ GF(a3, b3) + * d3 = GF(a3, b0) ^ GF(a2, b1) ^ GF(a1, b2) ^ GF(a0, b3) + * + * As a matrix: + * + * [d0] = [a0 a3 a2 a1][b0] + * [d1] [a1 a0 a3 a2][b1] + * [d2] [a2 a1 a0 a3][b2] + * [d3] [a3 a2 a1 a0][b3] + * + * Special polynomials defined by AES (0x02 == {02}): + * a(x) = {03}x^3 + {01}x^2 + {01}x + {02} + * a^-1(x) = {0b}x^3 + {0d}x^2 + {09}x + {0e}. + * + * These polynomials are used in the MixColumns() and InverseMixColumns() + * operations, respectively, to cause each element in the state to affect + * the output (referred to as diffusing). + * + * RotWord() uses: a0 = a1 = a2 = {00} and a3 = {01}, which is the + * polynomial x3. + * + * The ShiftRows() method modifies the last 3 rows in the state (where + * the state is 4 words with 4 bytes per word) by shifting bytes cyclically. + * The 1st byte in the second row is moved to the end of the row. The 1st + * and 2nd bytes in the third row are moved to the end of the row. The 1st, + * 2nd, and 3rd bytes are moved in the fourth row. + * + * More details on how AES arithmetic works: + * + * In the polynomial representation of binary numbers, XOR performs addition + * and subtraction and multiplication in GF(2^8) denoted as GF(a, b) + * corresponds with the multiplication of polynomials modulo an irreducible + * polynomial of degree 8. In other words, for AES, GF(a, b) will multiply + * polynomial 'a' with polynomial 'b' and then do a modular reduction by + * an AES-specific irreducible polynomial of degree 8. + * + * A polynomial is irreducible if its only divisors are one and itself. For + * the AES algorithm, this irreducible polynomial is: + * + * m(x) = x^8 + x^4 + x^3 + x + 1, + * + * or {01}{1b} in hexadecimal notation, where each coefficient is a bit: + * 100011011 = 283 = 0x11b. + * + * For example, GF(0x57, 0x83) = 0xc1 because + * + * 0x57 = 87 = 01010111 = x^6 + x^4 + x^2 + x + 1 + * 0x85 = 131 = 10000101 = x^7 + x + 1 + * + * (x^6 + x^4 + x^2 + x + 1) * (x^7 + x + 1) + * = x^13 + x^11 + x^9 + x^8 + x^7 + + * x^7 + x^5 + x^3 + x^2 + x + + * x^6 + x^4 + x^2 + x + 1 + * = x^13 + x^11 + x^9 + x^8 + x^6 + x^5 + x^4 + x^3 + 1 = y + * y modulo (x^8 + x^4 + x^3 + x + 1) + * = x^7 + x^6 + 1. + * + * The modular reduction by m(x) guarantees the result will be a binary + * polynomial of less than degree 8, so that it can fit in a byte. + * + * The operation to multiply a binary polynomial b with x (the polynomial + * x in binary representation is 00000010) is: + * + * b_7x^8 + b_6x^7 + b_5x^6 + b_4x^5 + b_3x^4 + b_2x^3 + b_1x^2 + b_0x^1 + * + * To get GF(b, x) we must reduce that by m(x). If b_7 is 0 (that is the + * most significant bit is 0 in b) then the result is already reduced. If + * it is 1, then we can reduce it by subtracting m(x) via an XOR. + * + * It follows that multiplication by x (00000010 or 0x02) can be implemented + * by performing a left shift followed by a conditional bitwise XOR with + * 0x1b. This operation on bytes is denoted by xtime(). Multiplication by + * higher powers of x can be implemented by repeated application of xtime(). + * + * By adding intermediate results, multiplication by any constant can be + * implemented. For instance: + * + * GF(0x57, 0x13) = 0xfe because: + * + * xtime(b) = (b & 128) ? (b << 1 ^ 0x11b) : (b << 1) + * + * Note: We XOR with 0x11b instead of 0x1b because in javascript our + * datatype for b can be larger than 1 byte, so a left shift will not + * automatically eliminate bits that overflow a byte ... by XOR'ing the + * overflow bit with 1 (the extra one from 0x11b) we zero it out. + * + * GF(0x57, 0x02) = xtime(0x57) = 0xae + * GF(0x57, 0x04) = xtime(0xae) = 0x47 + * GF(0x57, 0x08) = xtime(0x47) = 0x8e + * GF(0x57, 0x10) = xtime(0x8e) = 0x07 + * + * GF(0x57, 0x13) = GF(0x57, (0x01 ^ 0x02 ^ 0x10)) + * + * And by the distributive property (since XOR is addition and GF() is + * multiplication): + * + * = GF(0x57, 0x01) ^ GF(0x57, 0x02) ^ GF(0x57, 0x10) + * = 0x57 ^ 0xae ^ 0x07 + * = 0xfe. */ -Writer.prototype.finish = function finish() { - var head = this.head.next, // skip noop - buf = this.constructor.alloc(this.len), - pos = 0; - while (head) { - head.fn(head.val, buf, pos); - pos += head.len; - head = head.next; - } - // this.head = this.tail = null; - return buf; -}; +function initialize() { + init = true; -Writer._configure = function(BufferWriter_) { - BufferWriter = BufferWriter_; - Writer.create = create(); - BufferWriter._configure(); -}; + /* Populate the Rcon table. These are the values given by + [x^(i-1),{00},{00},{00}] where x^(i-1) are powers of x (and x = 0x02) + in the field of GF(2^8), where i starts at 1. + rcon[0] = [0x00, 0x00, 0x00, 0x00] + rcon[1] = [0x01, 0x00, 0x00, 0x00] 2^(1-1) = 2^0 = 1 + rcon[2] = [0x02, 0x00, 0x00, 0x00] 2^(2-1) = 2^1 = 2 + ... + rcon[9] = [0x1B, 0x00, 0x00, 0x00] 2^(9-1) = 2^8 = 0x1B + rcon[10] = [0x36, 0x00, 0x00, 0x00] 2^(10-1) = 2^9 = 0x36 -/***/ }), + We only store the first byte because it is the only one used. + */ + rcon = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1B, 0x36]; -<<<<<<< HEAD -/***/ 47767: -======= -/***/ 42788: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // compute xtime table which maps i onto GF(i, 0x02) + var xtime = new Array(256); + for(var i = 0; i < 128; ++i) { + xtime[i] = i << 1; + xtime[i + 128] = (i + 128) << 1 ^ 0x11B; + } + // compute all other tables + sbox = new Array(256); + isbox = new Array(256); + mix = new Array(4); + imix = new Array(4); + for(var i = 0; i < 4; ++i) { + mix[i] = new Array(256); + imix[i] = new Array(256); + } + var e = 0, ei = 0, e2, e4, e8, sx, sx2, me, ime; + for(var i = 0; i < 256; ++i) { + /* We need to generate the SubBytes() sbox and isbox tables so that + we can perform byte substitutions. This requires us to traverse + all of the elements in GF, find their multiplicative inverses, + and apply to each the following affine transformation: -module.exports = BufferWriter; + bi' = bi ^ b(i + 4) mod 8 ^ b(i + 5) mod 8 ^ b(i + 6) mod 8 ^ + b(i + 7) mod 8 ^ ci + for 0 <= i < 8, where bi is the ith bit of the byte, and ci is the + ith bit of a byte c with the value {63} or {01100011}. -// extends Writer -<<<<<<< HEAD -var Writer = __nccwpck_require__(26372); -(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; + It is possible to traverse every possible value in a Galois field + using what is referred to as a 'generator'. There are many + generators (128 out of 256): 3,5,6,9,11,82 to name a few. To fully + traverse GF we iterate 255 times, multiplying by our generator + each time. -var util = __nccwpck_require__(29902); -======= -var Writer = __nccwpck_require__(64693); -(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; + On each iteration we can determine the multiplicative inverse for + the current element. -var util = __nccwpck_require__(39807); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + Suppose there is an element in GF 'e'. For a given generator 'g', + e = g^x. The multiplicative inverse of e is g^(255 - x). It turns + out that if use the inverse of a generator as another generator + it will produce all of the corresponding multiplicative inverses + at the same time. For this reason, we choose 5 as our inverse + generator because it only requires 2 multiplies and 1 add and its + inverse, 82, requires relatively few operations as well. -/** - * Constructs a new buffer writer instance. - * @classdesc Wire format writer using node buffers. - * @extends Writer - * @constructor - */ -function BufferWriter() { - Writer.call(this); -} + In order to apply the affine transformation, the multiplicative + inverse 'ei' of 'e' can be repeatedly XOR'd (4 times) with a + bit-cycling of 'ei'. To do this 'ei' is first stored in 's' and + 'x'. Then 's' is left shifted and the high bit of 's' is made the + low bit. The resulting value is stored in 's'. Then 'x' is XOR'd + with 's' and stored in 'x'. On each subsequent iteration the same + operation is performed. When 4 iterations are complete, 'x' is + XOR'd with 'c' (0x63) and the transformed value is stored in 'x'. + For example: -BufferWriter._configure = function () { - /** - * Allocates a buffer of the specified size. - * @function - * @param {number} size Buffer size - * @returns {Buffer} Buffer - */ - BufferWriter.alloc = util._Buffer_allocUnsafe; + s = 01000001 + x = 01000001 - BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" - ? function writeBytesBuffer_set(val, buf, pos) { - buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) - // also works for plain array values - } - /* istanbul ignore next */ - : function writeBytesBuffer_copy(val, buf, pos) { - if (val.copy) // Buffer values - val.copy(buf, pos, 0, val.length); - else for (var i = 0; i < val.length;) // plain array values - buf[pos++] = val[i++]; - }; -}; + iteration 1: s = 10000010, x ^= s + iteration 2: s = 00000101, x ^= s + iteration 3: s = 00001010, x ^= s + iteration 4: s = 00010100, x ^= s + x ^= 0x63 + + This can be done with a loop where s = (s << 1) | (s >> 7). However, + it can also be done by using a single 16-bit (in this case 32-bit) + number 'sx'. Since XOR is an associative operation, we can set 'sx' + to 'ei' and then XOR it with 'sx' left-shifted 1,2,3, and 4 times. + The most significant bits will flow into the high 8 bit positions + and be correctly XOR'd with one another. All that remains will be + to cycle the high 8 bits by XOR'ing them all with the lower 8 bits + afterwards. + At the same time we're populating sbox and isbox we can precompute + the multiplication we'll need to do to do MixColumns() later. + */ -/** - * @override - */ -BufferWriter.prototype.bytes = function write_bytes_buffer(value) { - if (util.isString(value)) - value = util._Buffer_from(value, "base64"); - var len = value.length >>> 0; - this.uint32(len); - if (len) - this._push(BufferWriter.writeBytesBuffer, len, value); - return this; -}; + // apply affine transformation + sx = ei ^ (ei << 1) ^ (ei << 2) ^ (ei << 3) ^ (ei << 4); + sx = (sx >> 8) ^ (sx & 255) ^ 0x63; -function writeStringBuffer(val, buf, pos) { - if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) - util.utf8.write(val, buf, pos); - else if (buf.utf8Write) - buf.utf8Write(val, pos); - else - buf.write(val, pos); + // update tables + sbox[e] = sx; + isbox[sx] = e; + + /* Mixing columns is done using matrix multiplication. The columns + that are to be mixed are each a single word in the current state. + The state has Nb columns (4 columns). Therefore each column is a + 4 byte word. So to mix the columns in a single column 'c' where + its rows are r0, r1, r2, and r3, we use the following matrix + multiplication: + + [2 3 1 1]*[r0,c]=[r'0,c] + [1 2 3 1] [r1,c] [r'1,c] + [1 1 2 3] [r2,c] [r'2,c] + [3 1 1 2] [r3,c] [r'3,c] + + r0, r1, r2, and r3 are each 1 byte of one of the words in the + state (a column). To do matrix multiplication for each mixed + column c' we multiply the corresponding row from the left matrix + with the corresponding column from the right matrix. In total, we + get 4 equations: + + r0,c' = 2*r0,c + 3*r1,c + 1*r2,c + 1*r3,c + r1,c' = 1*r0,c + 2*r1,c + 3*r2,c + 1*r3,c + r2,c' = 1*r0,c + 1*r1,c + 2*r2,c + 3*r3,c + r3,c' = 3*r0,c + 1*r1,c + 1*r2,c + 2*r3,c + + As usual, the multiplication is as previously defined and the + addition is XOR. In order to optimize mixing columns we can store + the multiplication results in tables. If you think of the whole + column as a word (it might help to visualize by mentally rotating + the equations above by counterclockwise 90 degrees) then you can + see that it would be useful to map the multiplications performed on + each byte (r0, r1, r2, r3) onto a word as well. For instance, we + could map 2*r0,1*r0,1*r0,3*r0 onto a word by storing 2*r0 in the + highest 8 bits and 3*r0 in the lowest 8 bits (with the other two + respectively in the middle). This means that a table can be + constructed that uses r0 as an index to the word. We can do the + same with r1, r2, and r3, creating a total of 4 tables. + + To construct a full c', we can just look up each byte of c in + their respective tables and XOR the results together. + + Also, to build each table we only have to calculate the word + for 2,1,1,3 for every byte ... which we can do on each iteration + of this loop since we will iterate over every byte. After we have + calculated 2,1,1,3 we can get the results for the other tables + by cycling the byte at the end to the beginning. For instance + we can take the result of table 2,1,1,3 and produce table 3,2,1,1 + by moving the right most byte to the left most position just like + how you can imagine the 3 moved out of 2,1,1,3 and to the front + to produce 3,2,1,1. + + There is another optimization in that the same multiples of + the current element we need in order to advance our generator + to the next iteration can be reused in performing the 2,1,1,3 + calculation. We also calculate the inverse mix column tables, + with e,9,d,b being the inverse of 2,1,1,3. + + When we're done, and we need to actually mix columns, the first + byte of each state word should be put through mix[0] (2,1,1,3), + the second through mix[1] (3,2,1,1) and so forth. Then they should + be XOR'd together to produce the fully mixed column. + */ + + // calculate mix and imix table values + sx2 = xtime[sx]; + e2 = xtime[e]; + e4 = xtime[e2]; + e8 = xtime[e4]; + me = + (sx2 << 24) ^ // 2 + (sx << 16) ^ // 1 + (sx << 8) ^ // 1 + (sx ^ sx2); // 3 + ime = + (e2 ^ e4 ^ e8) << 24 ^ // E (14) + (e ^ e8) << 16 ^ // 9 + (e ^ e4 ^ e8) << 8 ^ // D (13) + (e ^ e2 ^ e8); // B (11) + // produce each of the mix tables by rotating the 2,1,1,3 value + for(var n = 0; n < 4; ++n) { + mix[n][e] = me; + imix[n][sx] = ime; + // cycle the right most byte to the left most position + // ie: 2,1,1,3 becomes 3,2,1,1 + me = me << 24 | me >>> 8; + ime = ime << 24 | ime >>> 8; + } + + // get next element and inverse + if(e === 0) { + // 1 is the inverse of 1 + e = ei = 1; + } else { + // e = 2e + 2*2*2*(10e)) = multiply e by 82 (chosen generator) + // ei = ei + 2*2*ei = multiply ei by 5 (inverse generator) + e = e2 ^ xtime[xtime[xtime[e2 ^ e8]]]; + ei ^= xtime[xtime[ei]]; + } + } } /** - * @override + * Generates a key schedule using the AES key expansion algorithm. + * + * The AES algorithm takes the Cipher Key, K, and performs a Key Expansion + * routine to generate a key schedule. The Key Expansion generates a total + * of Nb*(Nr + 1) words: the algorithm requires an initial set of Nb words, + * and each of the Nr rounds requires Nb words of key data. The resulting + * key schedule consists of a linear array of 4-byte words, denoted [wi ], + * with i in the range 0 <= i < Nb(Nr + 1). + * + * KeyExpansion(byte key[4*Nk], word w[Nb*(Nr+1)], Nk) + * AES-128 (Nb=4, Nk=4, Nr=10) + * AES-192 (Nb=4, Nk=6, Nr=12) + * AES-256 (Nb=4, Nk=8, Nr=14) + * Note: Nr=Nk+6. + * + * Nb is the number of columns (32-bit words) comprising the State (or + * number of bytes in a block). For AES, Nb=4. + * + * @param key the key to schedule (as an array of 32-bit words). + * @param decrypt true to modify the key schedule to decrypt, false not to. + * + * @return the generated key schedule. */ -BufferWriter.prototype.string = function write_string_buffer(value) { - var len = util.Buffer.byteLength(value); - this.uint32(len); - if (len) - this._push(writeStringBuffer, len, value); - return this; -}; +function _expandKey(key, decrypt) { + // copy the key's words to initialize the key schedule + var w = key.slice(0); + /* RotWord() will rotate a word, moving the first byte to the last + byte's position (shifting the other bytes left). -/** - * Finishes the write operation. - * @name BufferWriter#finish - * @function - * @returns {Buffer} Finished buffer - */ + We will be getting the value of Rcon at i / Nk. 'i' will iterate + from Nk to (Nb * Nr+1). Nk = 4 (4 byte key), Nb = 4 (4 words in + a block), Nr = Nk + 6 (10). Therefore 'i' will iterate from + 4 to 44 (exclusive). Each time we iterate 4 times, i / Nk will + increase by 1. We use a counter iNk to keep track of this. + */ -BufferWriter._configure(); + // go through the rounds expanding the key + var temp, iNk = 1; + var Nk = w.length; + var Nr1 = Nk + 6 + 1; + var end = Nb * Nr1; + for(var i = Nk; i < end; ++i) { + temp = w[i - 1]; + if(i % Nk === 0) { + // temp = SubWord(RotWord(temp)) ^ Rcon[i / Nk] + temp = + sbox[temp >>> 16 & 255] << 24 ^ + sbox[temp >>> 8 & 255] << 16 ^ + sbox[temp & 255] << 8 ^ + sbox[temp >>> 24] ^ (rcon[iNk] << 24); + iNk++; + } else if(Nk > 6 && (i % Nk === 4)) { + // temp = SubWord(temp) + temp = + sbox[temp >>> 24] << 24 ^ + sbox[temp >>> 16 & 255] << 16 ^ + sbox[temp >>> 8 & 255] << 8 ^ + sbox[temp & 255]; + } + w[i] = w[i - Nk] ^ temp; + } + /* When we are updating a cipher block we always use the code path for + encryption whether we are decrypting or not (to shorten code and + simplify the generation of look up tables). However, because there + are differences in the decryption algorithm, other than just swapping + in different look up tables, we must transform our key schedule to + account for these changes: -/***/ }), + 1. The decryption algorithm gets its key rounds in reverse order. + 2. The decryption algorithm adds the round key before mixing columns + instead of afterwards. -<<<<<<< HEAD -/***/ 72946: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + We don't need to modify our key schedule to handle the first case, + we can just traverse the key schedule in reverse order when decrypting. + The second case requires a little work. + The tables we built for performing rounds will take an input and then + perform SubBytes() and MixColumns() or, for the decrypt version, + InvSubBytes() and InvMixColumns(). But the decrypt algorithm requires + us to AddRoundKey() before InvMixColumns(). This means we'll need to + apply some transformations to the round key to inverse-mix its columns + so they'll be correct for moving AddRoundKey() to after the state has + had its columns inverse-mixed. -var parseUrl = (__nccwpck_require__(57310).parse); + To inverse-mix the columns of the state when we're decrypting we use a + lookup table that will apply InvSubBytes() and InvMixColumns() at the + same time. However, the round key's bytes are not inverse-substituted + in the decryption algorithm. To get around this problem, we can first + substitute the bytes in the round key so that when we apply the + transformation via the InvSubBytes()+InvMixColumns() table, it will + undo our substitution leaving us with the original value that we + want -- and then inverse-mix that value. -var DEFAULT_PORTS = { - ftp: 21, - gopher: 70, - http: 80, - https: 443, - ws: 80, - wss: 443, -}; + This change will correctly alter our key schedule so that we can XOR + each round key with our already transformed decryption state. This + allows us to use the same code path as the encryption algorithm. -var stringEndsWith = String.prototype.endsWith || function(s) { - return s.length <= this.length && - this.indexOf(s, this.length - s.length) !== -1; -}; + We make one more change to the decryption key. Since the decryption + algorithm runs in reverse from the encryption algorithm, we reverse + the order of the round keys to avoid having to iterate over the key + schedule backwards when running the encryption algorithm later in + decryption mode. In addition to reversing the order of the round keys, + we also swap each round key's 2nd and 4th rows. See the comments + section where rounds are performed for more details about why this is + done. These changes are done inline with the other substitution + described above. + */ + if(decrypt) { + var tmp; + var m0 = imix[0]; + var m1 = imix[1]; + var m2 = imix[2]; + var m3 = imix[3]; + var wnew = w.slice(0); + end = w.length; + for(var i = 0, wi = end - Nb; i < end; i += Nb, wi -= Nb) { + // do not sub the first or last round key (round keys are Nb + // words) as no column mixing is performed before they are added, + // but do change the key order + if(i === 0 || i === (end - Nb)) { + wnew[i] = w[wi]; + wnew[i + 1] = w[wi + 3]; + wnew[i + 2] = w[wi + 2]; + wnew[i + 3] = w[wi + 1]; + } else { + // substitute each round key byte because the inverse-mix + // table will inverse-substitute it (effectively cancel the + // substitution because round key bytes aren't sub'd in + // decryption mode) and swap indexes 3 and 1 + for(var n = 0; n < Nb; ++n) { + tmp = w[wi + n]; + wnew[i + (3&-n)] = + m0[sbox[tmp >>> 24]] ^ + m1[sbox[tmp >>> 16 & 255]] ^ + m2[sbox[tmp >>> 8 & 255]] ^ + m3[sbox[tmp & 255]]; + } + } + } + w = wnew; + } + + return w; +} /** - * @param {string|object} url - The URL, or the result from url.parse. - * @return {string} The URL of the proxy that should handle the request to the - * given URL. If no proxy is set, this will be an empty string. + * Updates a single block (16 bytes) using AES. The update will either + * encrypt or decrypt the block. + * + * @param w the key schedule. + * @param input the input block (an array of 32-bit words). + * @param output the updated output block. + * @param decrypt true to decrypt the block, false to encrypt it. */ -function getProxyForUrl(url) { - var parsedUrl = typeof url === 'string' ? parseUrl(url) : url || {}; - var proto = parsedUrl.protocol; - var hostname = parsedUrl.host; - var port = parsedUrl.port; - if (typeof hostname !== 'string' || !hostname || typeof proto !== 'string') { - return ''; // Don't proxy URLs without a valid scheme or host. - } +function _updateBlock(w, input, output, decrypt) { + /* + Cipher(byte in[4*Nb], byte out[4*Nb], word w[Nb*(Nr+1)]) + begin + byte state[4,Nb] + state = in + AddRoundKey(state, w[0, Nb-1]) + for round = 1 step 1 to Nr-1 + SubBytes(state) + ShiftRows(state) + MixColumns(state) + AddRoundKey(state, w[round*Nb, (round+1)*Nb-1]) + end for + SubBytes(state) + ShiftRows(state) + AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) + out = state + end - proto = proto.split(':', 1)[0]; - // Stripping ports in this way instead of using parsedUrl.hostname to make - // sure that the brackets around IPv6 addresses are kept. - hostname = hostname.replace(/:\d*$/, ''); - port = parseInt(port) || DEFAULT_PORTS[proto] || 0; - if (!shouldProxy(hostname, port)) { - return ''; // Don't proxy URLs that match NO_PROXY. + InvCipher(byte in[4*Nb], byte out[4*Nb], word w[Nb*(Nr+1)]) + begin + byte state[4,Nb] + state = in + AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) + for round = Nr-1 step -1 downto 1 + InvShiftRows(state) + InvSubBytes(state) + AddRoundKey(state, w[round*Nb, (round+1)*Nb-1]) + InvMixColumns(state) + end for + InvShiftRows(state) + InvSubBytes(state) + AddRoundKey(state, w[0, Nb-1]) + out = state + end + */ + + // Encrypt: AddRoundKey(state, w[0, Nb-1]) + // Decrypt: AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) + var Nr = w.length / 4 - 1; + var m0, m1, m2, m3, sub; + if(decrypt) { + m0 = imix[0]; + m1 = imix[1]; + m2 = imix[2]; + m3 = imix[3]; + sub = isbox; + } else { + m0 = mix[0]; + m1 = mix[1]; + m2 = mix[2]; + m3 = mix[3]; + sub = sbox; } + var a, b, c, d, a2, b2, c2; + a = input[0] ^ w[0]; + b = input[decrypt ? 3 : 1] ^ w[1]; + c = input[2] ^ w[2]; + d = input[decrypt ? 1 : 3] ^ w[3]; + var i = 3; + + /* In order to share code we follow the encryption algorithm when both + encrypting and decrypting. To account for the changes required in the + decryption algorithm, we use different lookup tables when decrypting + and use a modified key schedule to account for the difference in the + order of transformations applied when performing rounds. We also get + key rounds in reverse order (relative to encryption). */ + for(var round = 1; round < Nr; ++round) { + /* As described above, we'll be using table lookups to perform the + column mixing. Each column is stored as a word in the state (the + array 'input' has one column as a word at each index). In order to + mix a column, we perform these transformations on each row in c, + which is 1 byte in each word. The new column for c0 is c'0: - var proxy = - getEnv('npm_config_' + proto + '_proxy') || - getEnv(proto + '_proxy') || - getEnv('npm_config_proxy') || - getEnv('all_proxy'); - if (proxy && proxy.indexOf('://') === -1) { - // Missing scheme in proxy, default to the requested URL's scheme. - proxy = proto + '://' + proxy; - } - return proxy; -} + m0 m1 m2 m3 + r0,c'0 = 2*r0,c0 + 3*r1,c0 + 1*r2,c0 + 1*r3,c0 + r1,c'0 = 1*r0,c0 + 2*r1,c0 + 3*r2,c0 + 1*r3,c0 + r2,c'0 = 1*r0,c0 + 1*r1,c0 + 2*r2,c0 + 3*r3,c0 + r3,c'0 = 3*r0,c0 + 1*r1,c0 + 1*r2,c0 + 2*r3,c0 -/** - * Determines whether a given URL should be proxied. - * - * @param {string} hostname - The host name of the URL. - * @param {number} port - The effective port of the URL. - * @returns {boolean} Whether the given URL should be proxied. - * @private - */ -function shouldProxy(hostname, port) { - var NO_PROXY = - (getEnv('npm_config_no_proxy') || getEnv('no_proxy')).toLowerCase(); - if (!NO_PROXY) { - return true; // Always proxy if NO_PROXY is not set. - } - if (NO_PROXY === '*') { - return false; // Never proxy if wildcard is set. - } + So using mix tables where c0 is a word with r0 being its upper + 8 bits and r3 being its lower 8 bits: - return NO_PROXY.split(/[,\s]/).every(function(proxy) { - if (!proxy) { - return true; // Skip zero-length hosts. - } - var parsedProxy = proxy.match(/^(.+):(\d+)$/); - var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy; - var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0; - if (parsedProxyPort && parsedProxyPort !== port) { - return true; // Skip if ports don't match. - } + m0[c0 >> 24] will yield this word: [2*r0,1*r0,1*r0,3*r0] + ... + m3[c0 & 255] will yield this word: [1*r3,1*r3,3*r3,2*r3] - if (!/^[.*]/.test(parsedProxyHostname)) { - // No wildcards, so stop proxying if there is an exact match. - return hostname !== parsedProxyHostname; - } + Therefore to mix the columns in each word in the state we + do the following (& 255 omitted for brevity): + c'0,r0 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] + c'0,r1 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] + c'0,r2 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] + c'0,r3 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] - if (parsedProxyHostname.charAt(0) === '*') { - // Remove leading wildcard. - parsedProxyHostname = parsedProxyHostname.slice(1); - } - // Stop proxying if the hostname ends with the no_proxy host. - return !stringEndsWith.call(hostname, parsedProxyHostname); - }); -} + However, before mixing, the algorithm requires us to perform + ShiftRows(). The ShiftRows() transformation cyclically shifts the + last 3 rows of the state over different offsets. The first row + (r = 0) is not shifted. -/** - * Get the value for an environment variable. - * - * @param {string} key - The name of the environment variable. - * @return {string} The value of the environment variable. - * @private - */ -function getEnv(key) { - return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || ''; -} + s'_r,c = s_r,(c + shift(r, Nb) mod Nb + for 0 < r < 4 and 0 <= c < Nb and + shift(1, 4) = 1 + shift(2, 4) = 2 + shift(3, 4) = 3. -exports.j = getProxyForUrl; + This causes the first byte in r = 1 to be moved to the end of + the row, the first 2 bytes in r = 2 to be moved to the end of + the row, the first 3 bytes in r = 3 to be moved to the end of + the row: + r1: [c0 c1 c2 c3] => [c1 c2 c3 c0] + r2: [c0 c1 c2 c3] [c2 c3 c0 c1] + r3: [c0 c1 c2 c3] [c3 c0 c1 c2] -/***/ }), + We can make these substitutions inline with our column mixing to + generate an updated set of equations to produce each word in the + state (note the columns have changed positions): -/***/ 30517: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + c0 c1 c2 c3 => c0 c1 c2 c3 + c0 c1 c2 c3 c1 c2 c3 c0 (cycled 1 byte) + c0 c1 c2 c3 c2 c3 c0 c1 (cycled 2 bytes) + c0 c1 c2 c3 c3 c0 c1 c2 (cycled 3 bytes) + Therefore: -const { instantiateSync } = __nccwpck_require__(84181); -======= -/***/ 2682: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + c'0 = 2*r0,c0 + 3*r1,c1 + 1*r2,c2 + 1*r3,c3 + c'0 = 1*r0,c0 + 2*r1,c1 + 3*r2,c2 + 1*r3,c3 + c'0 = 1*r0,c0 + 1*r1,c1 + 2*r2,c2 + 3*r3,c3 + c'0 = 3*r0,c0 + 1*r1,c1 + 1*r2,c2 + 2*r3,c3 + c'1 = 2*r0,c1 + 3*r1,c2 + 1*r2,c3 + 1*r3,c0 + c'1 = 1*r0,c1 + 2*r1,c2 + 3*r2,c3 + 1*r3,c0 + c'1 = 1*r0,c1 + 1*r1,c2 + 2*r2,c3 + 3*r3,c0 + c'1 = 3*r0,c1 + 1*r1,c2 + 1*r2,c3 + 2*r3,c0 -const { instantiateSync } = __nccwpck_require__(63088); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -const fs = __nccwpck_require__(57147) + ... and so forth for c'2 and c'3. The important distinction is + that the columns are cycling, with c0 being used with the m0 + map when calculating c0, but c1 being used with the m0 map when + calculating c1 ... and so forth. -loadWebAssembly.supported = typeof WebAssembly !== 'undefined' + When performing the inverse we transform the mirror image and + skip the bottom row, instead of the top one, and move upwards: -async function loadWebAssembly (imp = {}) { - if (!loadWebAssembly.supported) return null - - return instantiateSync(fs.readFileSync(__nccwpck_require__.ab + "rabin.wasm"), imp); -} -module.exports = loadWebAssembly + c3 c2 c1 c0 => c0 c3 c2 c1 (cycled 3 bytes) *same as encryption + c3 c2 c1 c0 c1 c0 c3 c2 (cycled 2 bytes) + c3 c2 c1 c0 c2 c1 c0 c3 (cycled 1 byte) *same as encryption + c3 c2 c1 c0 c3 c2 c1 c0 + If you compare the resulting matrices for ShiftRows()+MixColumns() + and for InvShiftRows()+InvMixColumns() the 2nd and 4th columns are + different (in encrypt mode vs. decrypt mode). So in order to use + the same code to handle both encryption and decryption, we will + need to do some mapping. -/***/ }), + If in encryption mode we let a=c0, b=c1, c=c2, d=c3, and r be + a row number in the state, then the resulting matrix in encryption + mode for applying the above transformations would be: -<<<<<<< HEAD -/***/ 55340: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + r1: a b c d + r2: b c d a + r3: c d a b + r4: d a b c -const Rabin = __nccwpck_require__(83005) -const getRabin = __nccwpck_require__(30517) -======= -/***/ 41333: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + If we did the same in decryption mode we would get: -const Rabin = __nccwpck_require__(91098) -const getRabin = __nccwpck_require__(2682) ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + r1: a d c b + r2: b a d c + r3: c b a d + r4: d c b a -const create = async (avg, min, max, windowSize, polynomial) => { - const compiled = await getRabin() - return new Rabin(compiled, avg, min, max, windowSize, polynomial) -} + If instead we swap d and b (set b=c3 and d=c1), then we get: -module.exports = { - Rabin, - create -} + r1: a b c d + r2: d a b c + r3: c d a b + r4: b c d a + Now the 1st and 3rd rows are the same as the encryption matrix. All + we need to do then to make the mapping exactly the same is to swap + the 2nd and 4th rows when in decryption mode. To do this without + having to do it on each iteration, we swapped the 2nd and 4th rows + in the decryption key schedule. We also have to do the swap above + when we first pull in the input and when we set the final output. */ + a2 = + m0[a >>> 24] ^ + m1[b >>> 16 & 255] ^ + m2[c >>> 8 & 255] ^ + m3[d & 255] ^ w[++i]; + b2 = + m0[b >>> 24] ^ + m1[c >>> 16 & 255] ^ + m2[d >>> 8 & 255] ^ + m3[a & 255] ^ w[++i]; + c2 = + m0[c >>> 24] ^ + m1[d >>> 16 & 255] ^ + m2[a >>> 8 & 255] ^ + m3[b & 255] ^ w[++i]; + d = + m0[d >>> 24] ^ + m1[a >>> 16 & 255] ^ + m2[b >>> 8 & 255] ^ + m3[c & 255] ^ w[++i]; + a = a2; + b = b2; + c = c2; + } -/***/ }), + /* + Encrypt: + SubBytes(state) + ShiftRows(state) + AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) -<<<<<<< HEAD -/***/ 83005: -======= -/***/ 91098: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { + Decrypt: + InvShiftRows(state) + InvSubBytes(state) + AddRoundKey(state, w[0, Nb-1]) + */ + // Note: rows are shifted inline + output[0] = + (sub[a >>> 24] << 24) ^ + (sub[b >>> 16 & 255] << 16) ^ + (sub[c >>> 8 & 255] << 8) ^ + (sub[d & 255]) ^ w[++i]; + output[decrypt ? 3 : 1] = + (sub[b >>> 24] << 24) ^ + (sub[c >>> 16 & 255] << 16) ^ + (sub[d >>> 8 & 255] << 8) ^ + (sub[a & 255]) ^ w[++i]; + output[2] = + (sub[c >>> 24] << 24) ^ + (sub[d >>> 16 & 255] << 16) ^ + (sub[a >>> 8 & 255] << 8) ^ + (sub[b & 255]) ^ w[++i]; + output[decrypt ? 1 : 3] = + (sub[d >>> 24] << 24) ^ + (sub[a >>> 16 & 255] << 16) ^ + (sub[b >>> 8 & 255] << 8) ^ + (sub[c & 255]) ^ w[++i]; +} /** - * Rabin fingerprinting + * Deprecated. Instead, use: * - * @class Rabin + * forge.cipher.createCipher('AES-', key); + * forge.cipher.createDecipher('AES-', key); + * + * Creates a deprecated AES cipher object. This object's mode will default to + * CBC (cipher-block-chaining). + * + * The key and iv may be given as a string of bytes, an array of bytes, a + * byte buffer, or an array of 32-bit words. + * + * @param options the options to use. + * key the symmetric key to use. + * output the buffer to write to. + * decrypt true for decryption, false for encryption. + * mode the cipher mode to use (default: 'CBC'). + * + * @return the cipher. */ -class Rabin { - /** - * Creates an instance of Rabin. - * @param { import("./../dist/rabin-wasm") } asModule - * @param {number} [bits=12] - * @param {number} [min=8 * 1024] - * @param {number} [max=32 * 1024] - * @param {number} polynomial - * @memberof Rabin - */ - constructor(asModule, bits = 12, min = 8 * 1024, max = 32 * 1024, windowSize = 64, polynomial) { - this.bits = bits - this.min = min - this.max = max - this.asModule = asModule - this.rabin = new asModule.Rabin(bits, min, max, windowSize, polynomial) - this.polynomial = polynomial - } - - /** - * Fingerprints the buffer - * - * @param {Uint8Array} buf - * @returns {Array} - * @memberof Rabin - */ - fingerprint(buf) { - const { - __retain, - __release, - __allocArray, - __getInt32Array, - Int32Array_ID, - Uint8Array_ID - } = this.asModule - - const lengths = new Int32Array(Math.ceil(buf.length/this.min)) - const lengthsPtr = __retain(__allocArray(Int32Array_ID, lengths)) - const pointer = __retain(__allocArray(Uint8Array_ID, buf)) - - const out = this.rabin.fingerprint(pointer, lengthsPtr) - const processed = __getInt32Array(out) +function _createCipher(options) { + options = options || {}; + var mode = (options.mode || 'CBC').toUpperCase(); + var algorithm = 'AES-' + mode; - __release(pointer) - __release(lengthsPtr) + var cipher; + if(options.decrypt) { + cipher = forge.cipher.createDecipher(algorithm, options.key); + } else { + cipher = forge.cipher.createCipher(algorithm, options.key); + } - const end = processed.indexOf(0); - return end >= 0 ? processed.subarray(0, end) : processed; + // backwards compatible start API + var start = cipher.start; + cipher.start = function(iv, options) { + // backwards compatibility: support second arg as output buffer + var output = null; + if(options instanceof forge.util.ByteBuffer) { + output = options; + options = {}; } + options = options || {}; + options.output = output; + options.iv = iv; + start.call(cipher, options); + }; + + return cipher; } -module.exports = Rabin /***/ }), -<<<<<<< HEAD -/***/ 95944: -======= -/***/ 25213: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 14098: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/* eslint-disable node/no-deprecated-api */ - +/** + * Javascript implementation of Abstract Syntax Notation Number One. + * + * @author Dave Longley + * + * Copyright (c) 2010-2015 Digital Bazaar, Inc. + * + * An API for storing data using the Abstract Syntax Notation Number One + * format using DER (Distinguished Encoding Rules) encoding. This encoding is + * commonly used to store data for PKI, i.e. X.509 Certificates, and this + * implementation exists for that purpose. + * + * Abstract Syntax Notation Number One (ASN.1) is used to define the abstract + * syntax of information without restricting the way the information is encoded + * for transmission. It provides a standard that allows for open systems + * communication. ASN.1 defines the syntax of information data and a number of + * simple data types as well as a notation for describing them and specifying + * values for them. + * + * The RSA algorithm creates public and private keys that are often stored in + * X.509 or PKCS#X formats -- which use ASN.1 (encoded in DER format). This + * class provides the most basic functionality required to store and load DSA + * keys that are encoded according to ASN.1. + * + * The most common binary encodings for ASN.1 are BER (Basic Encoding Rules) + * and DER (Distinguished Encoding Rules). DER is just a subset of BER that + * has stricter requirements for how data must be encoded. + * + * Each ASN.1 structure has a tag (a byte identifying the ASN.1 structure type) + * and a byte array for the value of this ASN1 structure which may be data or a + * list of ASN.1 structures. + * + * Each ASN.1 structure using BER is (Tag-Length-Value): + * + * | byte 0 | bytes X | bytes Y | + * |--------|---------|---------- + * | tag | length | value | + * + * ASN.1 allows for tags to be of "High-tag-number form" which allows a tag to + * be two or more octets, but that is not supported by this class. A tag is + * only 1 byte. Bits 1-5 give the tag number (ie the data type within a + * particular 'class'), 6 indicates whether or not the ASN.1 value is + * constructed from other ASN.1 values, and bits 7 and 8 give the 'class'. If + * bits 7 and 8 are both zero, the class is UNIVERSAL. If only bit 7 is set, + * then the class is APPLICATION. If only bit 8 is set, then the class is + * CONTEXT_SPECIFIC. If both bits 7 and 8 are set, then the class is PRIVATE. + * The tag numbers for the data types for the class UNIVERSAL are listed below: + * + * UNIVERSAL 0 Reserved for use by the encoding rules + * UNIVERSAL 1 Boolean type + * UNIVERSAL 2 Integer type + * UNIVERSAL 3 Bitstring type + * UNIVERSAL 4 Octetstring type + * UNIVERSAL 5 Null type + * UNIVERSAL 6 Object identifier type + * UNIVERSAL 7 Object descriptor type + * UNIVERSAL 8 External type and Instance-of type + * UNIVERSAL 9 Real type + * UNIVERSAL 10 Enumerated type + * UNIVERSAL 11 Embedded-pdv type + * UNIVERSAL 12 UTF8String type + * UNIVERSAL 13 Relative object identifier type + * UNIVERSAL 14-15 Reserved for future editions + * UNIVERSAL 16 Sequence and Sequence-of types + * UNIVERSAL 17 Set and Set-of types + * UNIVERSAL 18-22, 25-30 Character string types + * UNIVERSAL 23-24 Time types + * + * The length of an ASN.1 structure is specified after the tag identifier. + * There is a definite form and an indefinite form. The indefinite form may + * be used if the encoding is constructed and not all immediately available. + * The indefinite form is encoded using a length byte with only the 8th bit + * set. The end of the constructed object is marked using end-of-contents + * octets (two zero bytes). + * + * The definite form looks like this: + * + * The length may take up 1 or more bytes, it depends on the length of the + * value of the ASN.1 structure. DER encoding requires that if the ASN.1 + * structure has a value that has a length greater than 127, more than 1 byte + * will be used to store its length, otherwise just one byte will be used. + * This is strict. + * + * In the case that the length of the ASN.1 value is less than 127, 1 octet + * (byte) is used to store the "short form" length. The 8th bit has a value of + * 0 indicating the length is "short form" and not "long form" and bits 7-1 + * give the length of the data. (The 8th bit is the left-most, most significant + * bit: also known as big endian or network format). + * + * In the case that the length of the ASN.1 value is greater than 127, 2 to + * 127 octets (bytes) are used to store the "long form" length. The first + * byte's 8th bit is set to 1 to indicate the length is "long form." Bits 7-1 + * give the number of additional octets. All following octets are in base 256 + * with the most significant digit first (typical big-endian binary unsigned + * integer storage). So, for instance, if the length of a value was 257, the + * first byte would be set to: + * + * 10000010 = 130 = 0x82. + * + * This indicates there are 2 octets (base 256) for the length. The second and + * third bytes (the octets just mentioned) would store the length in base 256: + * + * octet 2: 00000001 = 1 * 256^1 = 256 + * octet 3: 00000001 = 1 * 256^0 = 1 + * total = 257 + * + * The algorithm for converting a js integer value of 257 to base-256 is: + * + * var value = 257; + * var bytes = []; + * bytes[0] = (value >>> 8) & 0xFF; // most significant byte first + * bytes[1] = value & 0xFF; // least significant byte last + * + * On the ASN.1 UNIVERSAL Object Identifier (OID) type: + * + * An OID can be written like: "value1.value2.value3...valueN" + * + * The DER encoding rules: + * + * The first byte has the value 40 * value1 + value2. + * The following bytes, if any, encode the remaining values. Each value is + * encoded in base 128, most significant digit first (big endian), with as + * few digits as possible, and the most significant bit of each byte set + * to 1 except the last in each value's encoding. For example: Given the + * OID "1.2.840.113549", its DER encoding is (remember each byte except the + * last one in each encoding is OR'd with 0x80): + * + * byte 1: 40 * 1 + 2 = 42 = 0x2A. + * bytes 2-3: 128 * 6 + 72 = 840 = 6 72 = 6 72 = 0x0648 = 0x8648 + * bytes 4-6: 16384 * 6 + 128 * 119 + 13 = 6 119 13 = 0x06770D = 0x86F70D + * + * The final value is: 0x2A864886F70D. + * The full OID (including ASN.1 tag and length of 6 bytes) is: + * 0x06062A864886F70D + */ +var forge = __nccwpck_require__(56389); +__nccwpck_require__(65138); +__nccwpck_require__(83175); +/* ASN.1 API */ +var asn1 = module.exports = forge.asn1 = forge.asn1 || {}; -var buffer = __nccwpck_require__(14300) -var Buffer = buffer.Buffer +/** + * ASN.1 classes. + */ +asn1.Class = { + UNIVERSAL: 0x00, + APPLICATION: 0x40, + CONTEXT_SPECIFIC: 0x80, + PRIVATE: 0xC0 +}; -var safer = {} +/** + * ASN.1 types. Not all types are supported by this implementation, only + * those necessary to implement a simple PKI are implemented. + */ +asn1.Type = { + NONE: 0, + BOOLEAN: 1, + INTEGER: 2, + BITSTRING: 3, + OCTETSTRING: 4, + NULL: 5, + OID: 6, + ODESC: 7, + EXTERNAL: 8, + REAL: 9, + ENUMERATED: 10, + EMBEDDED: 11, + UTF8: 12, + ROID: 13, + SEQUENCE: 16, + SET: 17, + PRINTABLESTRING: 19, + IA5STRING: 22, + UTCTIME: 23, + GENERALIZEDTIME: 24, + BMPSTRING: 30 +}; -var key +/** + * Creates a new asn1 object. + * + * @param tagClass the tag class for the object. + * @param type the data type (tag number) for the object. + * @param constructed true if the asn1 object is in constructed form. + * @param value the value for the object, if it is not constructed. + * @param [options] the options to use: + * [bitStringContents] the plain BIT STRING content including padding + * byte. + * + * @return the asn1 object. + */ +asn1.create = function(tagClass, type, constructed, value, options) { + /* An asn1 object has a tagClass, a type, a constructed flag, and a + value. The value's type depends on the constructed flag. If + constructed, it will contain a list of other asn1 objects. If not, + it will contain the ASN.1 value as an array of bytes formatted + according to the ASN.1 data type. */ -for (key in buffer) { - if (!buffer.hasOwnProperty(key)) continue - if (key === 'SlowBuffer' || key === 'Buffer') continue - safer[key] = buffer[key] -} + // remove undefined values + if(forge.util.isArray(value)) { + var tmp = []; + for(var i = 0; i < value.length; ++i) { + if(value[i] !== undefined) { + tmp.push(value[i]); + } + } + value = tmp; + } -var Safer = safer.Buffer = {} -for (key in Buffer) { - if (!Buffer.hasOwnProperty(key)) continue - if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue - Safer[key] = Buffer[key] -} + var obj = { + tagClass: tagClass, + type: type, + constructed: constructed, + composed: constructed || forge.util.isArray(value), + value: value + }; + if(options && 'bitStringContents' in options) { + // TODO: copy byte buffer if it's a buffer not a string + obj.bitStringContents = options.bitStringContents; + // TODO: add readonly flag to avoid this overhead + // save copy to detect changes + obj.original = asn1.copy(obj); + } + return obj; +}; -safer.Buffer.prototype = Buffer.prototype +/** + * Copies an asn1 object. + * + * @param obj the asn1 object. + * @param [options] copy options: + * [excludeBitStringContents] true to not copy bitStringContents + * + * @return the a copy of the asn1 object. + */ +asn1.copy = function(obj, options) { + var copy; -if (!Safer.from || Safer.from === Uint8Array.from) { - Safer.from = function (value, encodingOrOffset, length) { - if (typeof value === 'number') { - throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) - } - if (value && typeof value.length === 'undefined') { - throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value) + if(forge.util.isArray(obj)) { + copy = []; + for(var i = 0; i < obj.length; ++i) { + copy.push(asn1.copy(obj[i], options)); } - return Buffer(value, encodingOrOffset, length) + return copy; } -} -if (!Safer.alloc) { - Safer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) + if(typeof obj === 'string') { + // TODO: copy byte buffer if it's a buffer not a string + return obj; + } + + copy = { + tagClass: obj.tagClass, + type: obj.type, + constructed: obj.constructed, + composed: obj.composed, + value: asn1.copy(obj.value, options) + }; + if(options && !options.excludeBitStringContents) { + // TODO: copy byte buffer if it's a buffer not a string + copy.bitStringContents = obj.bitStringContents; + } + return copy; +}; + +/** + * Compares asn1 objects for equality. + * + * Note this function does not run in constant time. + * + * @param obj1 the first asn1 object. + * @param obj2 the second asn1 object. + * @param [options] compare options: + * [includeBitStringContents] true to compare bitStringContents + * + * @return true if the asn1 objects are equal. + */ +asn1.equals = function(obj1, obj2, options) { + if(forge.util.isArray(obj1)) { + if(!forge.util.isArray(obj2)) { + return false; } - if (size < 0 || size >= 2 * (1 << 30)) { - throw new RangeError('The value "' + size + '" is invalid for option "size"') + if(obj1.length !== obj2.length) { + return false; } - var buf = Buffer(size) - if (!fill || fill.length === 0) { - buf.fill(0) - } else if (typeof encoding === 'string') { - buf.fill(fill, encoding) - } else { - buf.fill(fill) + for(var i = 0; i < obj1.length; ++i) { + if(!asn1.equals(obj1[i], obj2[i])) { + return false; + } } - return buf + return true; } -} -if (!safer.kStringMaxLength) { - try { - safer.kStringMaxLength = process.binding('buffer').kStringMaxLength - } catch (e) { - // we can't determine kStringMaxLength in environments where process.binding - // is unsupported, so let's not set it + if(typeof obj1 !== typeof obj2) { + return false; } -} -if (!safer.constants) { - safer.constants = { - MAX_LENGTH: safer.kMaxLength - } - if (safer.kStringMaxLength) { - safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength + if(typeof obj1 === 'string') { + return obj1 === obj2; } -} - -module.exports = safer - - -/***/ }), - -<<<<<<< HEAD -/***/ 59969: -======= -/***/ 447: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { - + var equal = obj1.tagClass === obj2.tagClass && + obj1.type === obj2.type && + obj1.constructed === obj2.constructed && + obj1.composed === obj2.composed && + asn1.equals(obj1.value, obj2.value); + if(options && options.includeBitStringContents) { + equal = equal && (obj1.bitStringContents === obj2.bitStringContents); + } -// JS treats subjects of bitwise operators as SIGNED 32 bit numbers, -// which means the maximum amount of bits we can store inside each byte -// is 7.. -const BITS_PER_BYTE = 7 + return equal; +}; -module.exports = class SparseArray { - constructor () { - this._bitArrays = [] - this._data = [] - this._length = 0 - this._changedLength = false - this._changedData = false +/** + * Gets the length of a BER-encoded ASN.1 value. + * + * In case the length is not specified, undefined is returned. + * + * @param b the BER-encoded ASN.1 byte buffer, starting with the first + * length byte. + * + * @return the length of the BER-encoded ASN.1 value or undefined. + */ +asn1.getBerValueLength = function(b) { + // TODO: move this function and related DER/BER functions to a der.js + // file; better abstract ASN.1 away from der/ber. + var b2 = b.getByte(); + if(b2 === 0x80) { + return undefined; } - set (index, value) { - let pos = this._internalPositionFor(index, false) - if (value === undefined) { - // unsetting - if (pos !== -1) { - // remove item from bit array and array itself - this._unsetInternalPos(pos) - this._unsetBit(index) - this._changedLength = true - this._changedData = true - } - } else { - let needsSort = false - if (pos === -1) { - pos = this._data.length - this._setBit(index) - this._changedData = true - } else { - needsSort = true - } - this._setInternalPos(pos, index, value, needsSort) - this._changedLength = true - } + // see if the length is "short form" or "long form" (bit 8 set) + var length; + var longForm = b2 & 0x80; + if(!longForm) { + // length is just the first byte + length = b2; + } else { + // the number of bytes the length is specified in bits 7 through 1 + // and each length byte is in big-endian base-256 + length = b.getInt((b2 & 0x7F) << 3); } + return length; +}; - unset (index) { - this.set(index, undefined) +/** + * Check if the byte buffer has enough bytes. Throws an Error if not. + * + * @param bytes the byte buffer to parse from. + * @param remaining the bytes remaining in the current parsing state. + * @param n the number of bytes the buffer must have. + */ +function _checkBufferLength(bytes, remaining, n) { + if(n > remaining) { + var error = new Error('Too few bytes to parse DER.'); + error.available = bytes.length(); + error.remaining = remaining; + error.requested = n; + throw error; } +} - get (index) { - this._sortData() - const pos = this._internalPositionFor(index, true) - if (pos === -1) { - return undefined - } - return this._data[pos][1] +/** + * Gets the length of a BER-encoded ASN.1 value. + * + * In case the length is not specified, undefined is returned. + * + * @param bytes the byte buffer to parse from. + * @param remaining the bytes remaining in the current parsing state. + * + * @return the length of the BER-encoded ASN.1 value or undefined. + */ +var _getValueLength = function(bytes, remaining) { + // TODO: move this function and related DER/BER functions to a der.js + // file; better abstract ASN.1 away from der/ber. + // fromDer already checked that this byte exists + var b2 = bytes.getByte(); + remaining--; + if(b2 === 0x80) { + return undefined; } - push (value) { - this.set(this.length, value) - return this.length + // see if the length is "short form" or "long form" (bit 8 set) + var length; + var longForm = b2 & 0x80; + if(!longForm) { + // length is just the first byte + length = b2; + } else { + // the number of bytes the length is specified in bits 7 through 1 + // and each length byte is in big-endian base-256 + var longFormBytes = b2 & 0x7F; + _checkBufferLength(bytes, remaining, longFormBytes); + length = bytes.getInt(longFormBytes << 3); } - - get length () { - this._sortData() - if (this._changedLength) { - const last = this._data[this._data.length - 1] - this._length = last ? last[0] + 1 : 0 - this._changedLength = false - } - return this._length + // FIXME: this will only happen for 32 bit getInt with high bit set + if(length < 0) { + throw new Error('Negative length: ' + length); } + return length; +}; - forEach (iterator) { - let i = 0 - while(i < this.length) { - iterator(this.get(i), i, this) - i++ - } +/** + * Parses an asn1 object from a byte buffer in DER format. + * + * @param bytes the byte buffer to parse from. + * @param [strict] true to be strict when checking value lengths, false to + * allow truncated values (default: true). + * @param [options] object with options or boolean strict flag + * [strict] true to be strict when checking value lengths, false to + * allow truncated values (default: true). + * [decodeBitStrings] true to attempt to decode the content of + * BIT STRINGs (not OCTET STRINGs) using strict mode. Note that + * without schema support to understand the data context this can + * erroneously decode values that happen to be valid ASN.1. This + * flag will be deprecated or removed as soon as schema support is + * available. (default: true) + * + * @return the parsed asn1 object. + */ +asn1.fromDer = function(bytes, options) { + if(options === undefined) { + options = { + strict: true, + decodeBitStrings: true + }; } - - map (iterator) { - let i = 0 - let mapped = new Array(this.length) - while(i < this.length) { - mapped[i] = iterator(this.get(i), i, this) - i++ - } - return mapped + if(typeof options === 'boolean') { + options = { + strict: options, + decodeBitStrings: true + }; } - - reduce (reducer, initialValue) { - let i = 0 - let acc = initialValue - while(i < this.length) { - const value = this.get(i) - acc = reducer(acc, value, i) - i++ - } - return acc + if(!('strict' in options)) { + options.strict = true; + } + if(!('decodeBitStrings' in options)) { + options.decodeBitStrings = true; } - find (finder) { - let i = 0, found, last - while ((i < this.length) && !found) { - last = this.get(i) - found = finder(last) - i++ - } - return found ? last : undefined + // wrap in buffer if needed + if(typeof bytes === 'string') { + bytes = forge.util.createBuffer(bytes); } - _internalPositionFor (index, noCreate) { - const bytePos = this._bytePosFor(index, noCreate) - if (bytePos >= this._bitArrays.length) { - return -1 - } - const byte = this._bitArrays[bytePos] - const bitPos = index - bytePos * BITS_PER_BYTE - const exists = (byte & (1 << bitPos)) > 0 - if (!exists) { - return -1 - } - const previousPopCount = this._bitArrays.slice(0, bytePos).reduce(popCountReduce, 0) + return _fromDer(bytes, bytes.length(), 0, options); +}; - const mask = ~(0xffffffff << (bitPos + 1)) - const bytePopCount = popCount(byte & mask) - const arrayPos = previousPopCount + bytePopCount - 1 - return arrayPos - } +/** + * Internal function to parse an asn1 object from a byte buffer in DER format. + * + * @param bytes the byte buffer to parse from. + * @param remaining the number of bytes remaining for this chunk. + * @param depth the current parsing depth. + * @param options object with same options as fromDer(). + * + * @return the parsed asn1 object. + */ +function _fromDer(bytes, remaining, depth, options) { + // temporary storage for consumption calculations + var start; - _bytePosFor (index, noCreate) { - const bytePos = Math.floor(index / BITS_PER_BYTE) - const targetLength = bytePos + 1 - while (!noCreate && this._bitArrays.length < targetLength) { - this._bitArrays.push(0) + // minimum length for ASN.1 DER structure is 2 + _checkBufferLength(bytes, remaining, 2); + + // get the first byte + var b1 = bytes.getByte(); + // consumed one byte + remaining--; + + // get the tag class + var tagClass = (b1 & 0xC0); + + // get the type (bits 1-5) + var type = b1 & 0x1F; + + // get the variable value length and adjust remaining bytes + start = bytes.length(); + var length = _getValueLength(bytes, remaining); + remaining -= start - bytes.length(); + + // ensure there are enough bytes to get the value + if(length !== undefined && length > remaining) { + if(options.strict) { + var error = new Error('Too few bytes to read ASN.1 value.'); + error.available = bytes.length(); + error.remaining = remaining; + error.requested = length; + throw error; } - return bytePos + // Note: be lenient with truncated values and use remaining state bytes + length = remaining; } - _setBit (index) { - const bytePos = this._bytePosFor(index, false) - this._bitArrays[bytePos] |= (1 << (index - (bytePos * BITS_PER_BYTE))) + // value storage + var value; + // possible BIT STRING contents storage + var bitStringContents; + + // constructed flag is bit 6 (32 = 0x20) of the first byte + var constructed = ((b1 & 0x20) === 0x20); + if(constructed) { + // parse child asn1 objects from the value + value = []; + if(length === undefined) { + // asn1 object of indefinite length, read until end tag + for(;;) { + _checkBufferLength(bytes, remaining, 2); + if(bytes.bytes(2) === String.fromCharCode(0, 0)) { + bytes.getBytes(2); + remaining -= 2; + break; + } + start = bytes.length(); + value.push(_fromDer(bytes, remaining, depth + 1, options)); + remaining -= start - bytes.length(); + } + } else { + // parsing asn1 object of definite length + while(length > 0) { + start = bytes.length(); + value.push(_fromDer(bytes, length, depth + 1, options)); + remaining -= start - bytes.length(); + length -= start - bytes.length(); + } + } } - _unsetBit(index) { - const bytePos = this._bytePosFor(index, false) - this._bitArrays[bytePos] &= ~(1 << (index - (bytePos * BITS_PER_BYTE))) + // if a BIT STRING, save the contents including padding + if(value === undefined && tagClass === asn1.Class.UNIVERSAL && + type === asn1.Type.BITSTRING) { + bitStringContents = bytes.bytes(length); } - _setInternalPos(pos, index, value, needsSort) { - const data =this._data - const elem = [index, value] - if (needsSort) { - this._sortData() - data[pos] = elem - } else { - // new element. just shove it into the array - // but be nice about where we shove it - // in order to make sorting it later easier - if (data.length) { - if (data[data.length - 1][0] >= index) { - data.push(elem) - } else if (data[0][0] <= index) { - data.unshift(elem) - } else { - const randomIndex = Math.round(data.length / 2) - this._data = data.slice(0, randomIndex).concat(elem).concat(data.slice(randomIndex)) + // determine if a non-constructed value should be decoded as a composed + // value that contains other ASN.1 objects. BIT STRINGs (and OCTET STRINGs) + // can be used this way. + if(value === undefined && options.decodeBitStrings && + tagClass === asn1.Class.UNIVERSAL && + // FIXME: OCTET STRINGs not yet supported here + // .. other parts of forge expect to decode OCTET STRINGs manually + (type === asn1.Type.BITSTRING /*|| type === asn1.Type.OCTETSTRING*/) && + length > 1) { + // save read position + var savedRead = bytes.read; + var savedRemaining = remaining; + var unused = 0; + if(type === asn1.Type.BITSTRING) { + /* The first octet gives the number of bits by which the length of the + bit string is less than the next multiple of eight (this is called + the "number of unused bits"). + + The second and following octets give the value of the bit string + converted to an octet string. */ + _checkBufferLength(bytes, remaining, 1); + unused = bytes.getByte(); + remaining--; + } + // if all bits are used, maybe the BIT/OCTET STRING holds ASN.1 objs + if(unused === 0) { + try { + // attempt to parse child asn1 object from the value + // (stored in array to signal composed value) + start = bytes.length(); + var subOptions = { + // enforce strict mode to avoid parsing ASN.1 from plain data + verbose: options.verbose, + strict: true, + decodeBitStrings: true + }; + var composed = _fromDer(bytes, remaining, depth + 1, subOptions); + var used = start - bytes.length(); + remaining -= used; + if(type == asn1.Type.BITSTRING) { + used++; + } + + // if the data all decoded and the class indicates UNIVERSAL or + // CONTEXT_SPECIFIC then assume we've got an encapsulated ASN.1 object + var tc = composed.tagClass; + if(used === length && + (tc === asn1.Class.UNIVERSAL || tc === asn1.Class.CONTEXT_SPECIFIC)) { + value = [composed]; } - } else { - this._data.push(elem) + } catch(ex) { } - this._changedData = true - this._changedLength = true } - } - - _unsetInternalPos (pos) { - this._data.splice(pos, 1) - } - - _sortData () { - if (this._changedData) { - this._data.sort(sortInternal) + if(value === undefined) { + // restore read position + bytes.read = savedRead; + remaining = savedRemaining; } - - this._changedData = false } - bitField () { - const bytes = [] - let pendingBitsForResultingByte = 8 - let pendingBitsForNewByte = 0 - let resultingByte = 0 - let newByte - const pending = this._bitArrays.slice() - while (pending.length || pendingBitsForNewByte) { - if (pendingBitsForNewByte === 0) { - newByte = pending.shift() - pendingBitsForNewByte = 7 - } - - const usingBits = Math.min(pendingBitsForNewByte, pendingBitsForResultingByte) - const mask = ~(0b11111111 << usingBits) - const masked = newByte & mask - resultingByte |= masked << (8 - pendingBitsForResultingByte) - newByte = newByte >>> usingBits - pendingBitsForNewByte -= usingBits - pendingBitsForResultingByte -= usingBits + if(value === undefined) { + // asn1 not constructed or composed, get raw value + // TODO: do DER to OID conversion and vice-versa in .toDer? - if (!pendingBitsForResultingByte || (!pendingBitsForNewByte && !pending.length)) { - bytes.push(resultingByte) - resultingByte = 0 - pendingBitsForResultingByte = 8 + if(length === undefined) { + if(options.strict) { + throw new Error('Non-constructed ASN.1 object of indefinite length.'); } + // be lenient and use remaining state bytes + length = remaining; } - // remove trailing zeroes - for(var i = bytes.length - 1; i > 0; i--) { - const value = bytes[i] - if (value === 0) { - bytes.pop() - } else { - break + if(type === asn1.Type.BMPSTRING) { + value = ''; + for(; length > 0; length -= 2) { + _checkBufferLength(bytes, remaining, 2); + value += String.fromCharCode(bytes.getInt16()); + remaining -= 2; } + } else { + value = bytes.getBytes(length); } - - return bytes - } - - compactArray () { - this._sortData() - return this._data.map(valueOnly) } -} - -function popCountReduce (count, byte) { - return count + popCount(byte) -} -function popCount(_v) { - let v = _v - v = v - ((v >> 1) & 0x55555555) // reuse input as temporary - v = (v & 0x33333333) + ((v >> 2) & 0x33333333) // temp - return ((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >> 24 -} + // add BIT STRING contents if available + var asn1Options = bitStringContents === undefined ? null : { + bitStringContents: bitStringContents + }; -function sortInternal (a, b) { - return a[0] - b[0] + // create and return asn1 object + return asn1.create(tagClass, type, constructed, value, asn1Options); } -function valueOnly (elem) { - return elem[1] -} +/** + * Converts the given asn1 object to a buffer of bytes in DER format. + * + * @param asn1 the asn1 object to convert to bytes. + * + * @return the buffer of bytes. + */ +asn1.toDer = function(obj) { + var bytes = forge.util.createBuffer(); -/***/ }), + // build the first byte + var b1 = obj.tagClass | obj.type; -<<<<<<< HEAD -/***/ 6581: -======= -/***/ 79546: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { + // for storing the ASN.1 value + var value = forge.util.createBuffer(); -module.exports = readable => { - // Node.js stream - if (readable[Symbol.asyncIterator]) return readable + // use BIT STRING contents if available and data not changed + var useBitStringContents = false; + if('bitStringContents' in obj) { + useBitStringContents = true; + if(obj.original) { + useBitStringContents = asn1.equals(obj, obj.original); + } + } - // Browser ReadableStream - if (readable.getReader) { - return (async function * () { - const reader = readable.getReader() + if(useBitStringContents) { + value.putBytes(obj.bitStringContents); + } else if(obj.composed) { + // if composed, use each child asn1 object's DER bytes as value + // turn on 6th bit (0x20 = 32) to indicate asn1 is constructed + // from other asn1 objects + if(obj.constructed) { + b1 |= 0x20; + } else { + // type is a bit string, add unused bits of 0x00 + value.putByte(0x00); + } - try { - while (true) { - const { done, value } = await reader.read() - if (done) return - yield value - } - } finally { - reader.releaseLock() + // add all of the child DER bytes together + for(var i = 0; i < obj.value.length; ++i) { + if(obj.value[i] !== undefined) { + value.putBuffer(asn1.toDer(obj.value[i])); } - })() + } + } else { + // use asn1.value directly + if(obj.type === asn1.Type.BMPSTRING) { + for(var i = 0; i < obj.value.length; ++i) { + value.putInt16(obj.value.charCodeAt(i)); + } + } else { + // ensure integer is minimally-encoded + // TODO: should all leading bytes be stripped vs just one? + // .. ex '00 00 01' => '01'? + if(obj.type === asn1.Type.INTEGER && + obj.value.length > 1 && + // leading 0x00 for positive integer + ((obj.value.charCodeAt(0) === 0 && + (obj.value.charCodeAt(1) & 0x80) === 0) || + // leading 0xFF for negative integer + (obj.value.charCodeAt(0) === 0xFF && + (obj.value.charCodeAt(1) & 0x80) === 0x80))) { + value.putBytes(obj.value.substr(1)); + } else { + value.putBytes(obj.value); + } + } } - throw new Error('unknown stream') -} - - -/***/ }), - -<<<<<<< HEAD -/***/ 88828: -/***/ ((module) => { + // add tag byte + bytes.putByte(b1); -const hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; -const numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/; -// const octRegex = /0x[a-z0-9]+/; -// const binRegex = /0x[a-z0-9]+/; + // use "short form" encoding + if(value.length() <= 127) { + // one byte describes the length + // bit 8 = 0 and bits 7-1 = length + bytes.putByte(value.length() & 0x7F); + } else { + // use "long form" encoding + // 2 to 127 bytes describe the length + // first byte: bit 8 = 1 and bits 7-1 = # of additional bytes + // other bytes: length in base 256, big-endian + var len = value.length(); + var lenBytes = ''; + do { + lenBytes += String.fromCharCode(len & 0xFF); + len = len >>> 8; + } while(len > 0); + // set first byte to # bytes used to store the length and turn on + // bit 8 to indicate long-form length is used + bytes.putByte(lenBytes.length | 0x80); -//polyfill -if (!Number.parseInt && window.parseInt) { - Number.parseInt = window.parseInt; -} -if (!Number.parseFloat && window.parseFloat) { - Number.parseFloat = window.parseFloat; -} + // concatenate length bytes in reverse since they were generated + // little endian and we need big endian + for(var i = lenBytes.length - 1; i >= 0; --i) { + bytes.putByte(lenBytes.charCodeAt(i)); + } + } - -const consider = { - hex : true, - leadingZeros: true, - decimalPoint: "\.", - eNotation: true - //skipLike: /regex/ + // concatenate value bytes + bytes.putBuffer(value); + return bytes; }; -function toNumber(str, options = {}){ - // const options = Object.assign({}, consider); - // if(opt.leadingZeros === false){ - // options.leadingZeros = false; - // }else if(opt.hex === false){ - // options.hex = false; - // } - - options = Object.assign({}, consider, options ); - if(!str || typeof str !== "string" ) return str; - - let trimmedStr = str.trim(); - // if(trimmedStr === "0.0") return 0; - // else if(trimmedStr === "+0.0") return 0; - // else if(trimmedStr === "-0.0") return -0; - - if(options.skipLike !== undefined && options.skipLike.test(trimmedStr)) return str; - else if (options.hex && hexRegex.test(trimmedStr)) { - return Number.parseInt(trimmedStr, 16); - // } else if (options.parseOct && octRegex.test(str)) { - // return Number.parseInt(val, 8); - // }else if (options.parseBin && binRegex.test(str)) { - // return Number.parseInt(val, 2); - }else{ - //separate negative sign, leading zeros, and rest number - const match = numRegex.exec(trimmedStr); - if(match){ - const sign = match[1]; - const leadingZeros = match[2]; - let numTrimmedByZeros = trimZeros(match[3]); //complete num without leading zeros - //trim ending zeros for floating number - - const eNotation = match[4] || match[6]; - if(!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str; //-0123 - else if(!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str; //0123 - else{//no leading zeros or leading zeros are allowed - const num = Number(trimmedStr); - const numStr = "" + num; - if(numStr.search(/[eE]/) !== -1){ //given number is long and parsed to eNotation - if(options.eNotation) return num; - else return str; - }else if(eNotation){ //given number has enotation - if(options.eNotation) return num; - else return str; - }else if(trimmedStr.indexOf(".") !== -1){ //floating number - // const decimalPart = match[5].substr(1); - // const intPart = trimmedStr.substr(0,trimmedStr.indexOf(".")); - - - // const p = numStr.indexOf("."); - // const givenIntPart = numStr.substr(0,p); - // const givenDecPart = numStr.substr(p+1); - if(numStr === "0" && (numTrimmedByZeros === "") ) return num; //0.0 - else if(numStr === numTrimmedByZeros) return num; //0.456. 0.79000 - else if( sign && numStr === "-"+numTrimmedByZeros) return num; - else return str; - } - - if(leadingZeros){ - // if(numTrimmedByZeros === numStr){ - // if(options.leadingZeros) return num; - // else return str; - // }else return str; - if(numTrimmedByZeros === numStr) return num; - else if(sign+numTrimmedByZeros === numStr) return num; - else return str; - } - - if(trimmedStr === numStr) return num; - else if(trimmedStr === sign+numStr) return num; - // else{ - // //number with +/- sign - // trimmedStr.test(/[-+][0-9]); - - // } - return str; - } - // else if(!eNotation && trimmedStr && trimmedStr !== Number(trimmedStr) ) return str; - - }else{ //non-numeric string - return str; - } - } -} - /** - * - * @param {string} numStr without leading zeros - * @returns + * Converts an OID dot-separated string to a byte buffer. The byte buffer + * contains only the DER-encoded value, not any tag or length bytes. + * + * @param oid the OID dot-separated string. + * + * @return the byte buffer. */ -function trimZeros(numStr){ - if(numStr && numStr.indexOf(".") !== -1){//float - numStr = numStr.replace(/0+$/, ""); //remove ending zeros - if(numStr === ".") numStr = "0"; - else if(numStr[0] === ".") numStr = "0"+numStr; - else if(numStr[numStr.length-1] === ".") numStr = numStr.substr(0,numStr.length-1); - return numStr; - } - return numStr; -} -module.exports = toNumber - - -/***/ }), - -/***/ 4147: -======= -/***/ 76463: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - -const os = __nccwpck_require__(22037); -<<<<<<< HEAD -const hasFlag = __nccwpck_require__(55392); -======= -const hasFlag = __nccwpck_require__(24099); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - -const env = process.env; - -let forceColor; -if (hasFlag('no-color') || - hasFlag('no-colors') || - hasFlag('color=false')) { - forceColor = false; -} else if (hasFlag('color') || - hasFlag('colors') || - hasFlag('color=true') || - hasFlag('color=always')) { - forceColor = true; -} -if ('FORCE_COLOR' in env) { - forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; -} - -function translateLevel(level) { - if (level === 0) { - return false; - } - - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; -} +asn1.oidToDer = function(oid) { + // split OID into individual values + var values = oid.split('.'); + var bytes = forge.util.createBuffer(); -function supportsColor(stream) { - if (forceColor === false) { - return 0; - } + // first byte is 40 * value1 + value2 + bytes.putByte(40 * parseInt(values[0], 10) + parseInt(values[1], 10)); + // other bytes are each value in base 128 with 8th bit set except for + // the last byte for each value + var last, valueBytes, value, b; + for(var i = 2; i < values.length; ++i) { + // produce value bytes in reverse because we don't know how many + // bytes it will take to store the value + last = true; + valueBytes = []; + value = parseInt(values[i], 10); + do { + b = value & 0x7F; + value = value >>> 7; + // if value is not last, then turn on 8th bit + if(!last) { + b |= 0x80; + } + valueBytes.push(b); + last = false; + } while(value > 0); - if (hasFlag('color=16m') || - hasFlag('color=full') || - hasFlag('color=truecolor')) { - return 3; - } + // add value bytes in reverse (needs to be in big endian) + for(var n = valueBytes.length - 1; n >= 0; --n) { + bytes.putByte(valueBytes[n]); + } + } - if (hasFlag('color=256')) { - return 2; - } + return bytes; +}; - if (stream && !stream.isTTY && forceColor !== true) { - return 0; - } +/** + * Converts a DER-encoded byte buffer to an OID dot-separated string. The + * byte buffer should contain only the DER-encoded value, not any tag or + * length bytes. + * + * @param bytes the byte buffer. + * + * @return the OID dot-separated string. + */ +asn1.derToOid = function(bytes) { + var oid; - const min = forceColor ? 1 : 0; + // wrap in buffer if needed + if(typeof bytes === 'string') { + bytes = forge.util.createBuffer(bytes); + } - if (process.platform === 'win32') { - // Node.js 7.5.0 is the first version of Node.js to include a patch to - // libuv that enables 256 color output on Windows. Anything earlier and it - // won't work. However, here we target Node.js 8 at minimum as it is an LTS - // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows - // release that supports 256 colors. Windows 10 build 14931 is the first release - // that supports 16m/TrueColor. - const osRelease = os.release().split('.'); - if ( - Number(process.versions.node.split('.')[0]) >= 8 && - Number(osRelease[0]) >= 10 && - Number(osRelease[2]) >= 10586 - ) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } + // first byte is 40 * value1 + value2 + var b = bytes.getByte(); + oid = Math.floor(b / 40) + '.' + (b % 40); - return 1; - } + // other bytes are each value in base 128 with 8th bit set except for + // the last byte for each value + var value = 0; + while(bytes.length() > 0) { + b = bytes.getByte(); + value = value << 7; + // not the last byte for the value + if(b & 0x80) { + value += b & 0x7F; + } else { + // last byte + oid += '.' + (value + b); + value = 0; + } + } - if ('CI' in env) { - if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { - return 1; - } + return oid; +}; - return min; - } +/** + * Converts a UTCTime value to a date. + * + * Note: GeneralizedTime has 4 digits for the year and is used for X.509 + * dates past 2049. Parsing that structure hasn't been implemented yet. + * + * @param utc the UTCTime value to convert. + * + * @return the date. + */ +asn1.utcTimeToDate = function(utc) { + /* The following formats can be used: - if ('TEAMCITY_VERSION' in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } + YYMMDDhhmmZ + YYMMDDhhmm+hh'mm' + YYMMDDhhmm-hh'mm' + YYMMDDhhmmssZ + YYMMDDhhmmss+hh'mm' + YYMMDDhhmmss-hh'mm' - if (env.COLORTERM === 'truecolor') { - return 3; - } + Where: - if ('TERM_PROGRAM' in env) { - const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); + YY is the least significant two digits of the year + MM is the month (01 to 12) + DD is the day (01 to 31) + hh is the hour (00 to 23) + mm are the minutes (00 to 59) + ss are the seconds (00 to 59) + Z indicates that local time is GMT, + indicates that local time is + later than GMT, and - indicates that local time is earlier than GMT + hh' is the absolute value of the offset from GMT in hours + mm' is the absolute value of the offset from GMT in minutes */ + var date = new Date(); - switch (env.TERM_PROGRAM) { - case 'iTerm.app': - return version >= 3 ? 3 : 2; - case 'Apple_Terminal': - return 2; - // No default - } - } + // if YY >= 50 use 19xx, if YY < 50 use 20xx + var year = parseInt(utc.substr(0, 2), 10); + year = (year >= 50) ? 1900 + year : 2000 + year; + var MM = parseInt(utc.substr(2, 2), 10) - 1; // use 0-11 for month + var DD = parseInt(utc.substr(4, 2), 10); + var hh = parseInt(utc.substr(6, 2), 10); + var mm = parseInt(utc.substr(8, 2), 10); + var ss = 0; - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } + // not just YYMMDDhhmmZ + if(utc.length > 11) { + // get character after minutes + var c = utc.charAt(10); + var end = 10; - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } + // see if seconds are present + if(c !== '+' && c !== '-') { + // get seconds + ss = parseInt(utc.substr(10, 2), 10); + end += 2; + } + } - if ('COLORTERM' in env) { - return 1; - } + // update date + date.setUTCFullYear(year, MM, DD); + date.setUTCHours(hh, mm, ss, 0); - if (env.TERM === 'dumb') { - return min; - } + if(end) { + // get +/- after end of time + c = utc.charAt(end); + if(c === '+' || c === '-') { + // get hours+minutes offset + var hhoffset = parseInt(utc.substr(end + 1, 2), 10); + var mmoffset = parseInt(utc.substr(end + 4, 2), 10); - return min; -} + // calculate offset in milliseconds + var offset = hhoffset * 60 + mmoffset; + offset *= 60000; -function getSupportLevel(stream) { - const level = supportsColor(stream); - return translateLevel(level); -} + // apply offset + if(c === '+') { + date.setTime(+date - offset); + } else { + date.setTime(+date + offset); + } + } + } -module.exports = { - supportsColor: getSupportLevel, - stdout: getSupportLevel(process.stdout), - stderr: getSupportLevel(process.stderr) + return date; }; +/** + * Converts a GeneralizedTime value to a date. + * + * @param gentime the GeneralizedTime value to convert. + * + * @return the date. + */ +asn1.generalizedTimeToDate = function(gentime) { + /* The following formats can be used: -/***/ }), - -<<<<<<< HEAD -/***/ 62098: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = __nccwpck_require__(15451); -======= -/***/ 16563: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = __nccwpck_require__(63918); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + YYYYMMDDHHMMSS + YYYYMMDDHHMMSS.fff + YYYYMMDDHHMMSSZ + YYYYMMDDHHMMSS.fffZ + YYYYMMDDHHMMSS+hh'mm' + YYYYMMDDHHMMSS.fff+hh'mm' + YYYYMMDDHHMMSS-hh'mm' + YYYYMMDDHHMMSS.fff-hh'mm' + Where: -/***/ }), + YYYY is the year + MM is the month (01 to 12) + DD is the day (01 to 31) + hh is the hour (00 to 23) + mm are the minutes (00 to 59) + ss are the seconds (00 to 59) + .fff is the second fraction, accurate to three decimal places + Z indicates that local time is GMT, + indicates that local time is + later than GMT, and - indicates that local time is earlier than GMT + hh' is the absolute value of the offset from GMT in hours + mm' is the absolute value of the offset from GMT in minutes */ + var date = new Date(); -<<<<<<< HEAD -/***/ 15451: -======= -/***/ 63918: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + var YYYY = parseInt(gentime.substr(0, 4), 10); + var MM = parseInt(gentime.substr(4, 2), 10) - 1; // use 0-11 for month + var DD = parseInt(gentime.substr(6, 2), 10); + var hh = parseInt(gentime.substr(8, 2), 10); + var mm = parseInt(gentime.substr(10, 2), 10); + var ss = parseInt(gentime.substr(12, 2), 10); + var fff = 0; + var offset = 0; + var isUTC = false; + if(gentime.charAt(gentime.length - 1) === 'Z') { + isUTC = true; + } + var end = gentime.length - 5, c = gentime.charAt(end); + if(c === '+' || c === '-') { + // get hours+minutes offset + var hhoffset = parseInt(gentime.substr(end + 1, 2), 10); + var mmoffset = parseInt(gentime.substr(end + 4, 2), 10); -var net = __nccwpck_require__(41808); -var tls = __nccwpck_require__(24404); -var http = __nccwpck_require__(13685); -var https = __nccwpck_require__(95687); -var events = __nccwpck_require__(82361); -var assert = __nccwpck_require__(39491); -var util = __nccwpck_require__(73837); + // calculate offset in milliseconds + offset = hhoffset * 60 + mmoffset; + offset *= 60000; + // apply offset + if(c === '+') { + offset *= -1; + } -exports.httpOverHttp = httpOverHttp; -exports.httpsOverHttp = httpsOverHttp; -exports.httpOverHttps = httpOverHttps; -exports.httpsOverHttps = httpsOverHttps; + isUTC = true; + } + // check for second fraction + if(gentime.charAt(14) === '.') { + fff = parseFloat(gentime.substr(14), 10) * 1000; + } -function httpOverHttp(options) { - var agent = new TunnelingAgent(options); - agent.request = http.request; - return agent; -} + if(isUTC) { + date.setUTCFullYear(YYYY, MM, DD); + date.setUTCHours(hh, mm, ss, fff); -function httpsOverHttp(options) { - var agent = new TunnelingAgent(options); - agent.request = http.request; - agent.createSocket = createSecureSocket; - agent.defaultPort = 443; - return agent; -} + // apply offset + date.setTime(+date + offset); + } else { + date.setFullYear(YYYY, MM, DD); + date.setHours(hh, mm, ss, fff); + } -function httpOverHttps(options) { - var agent = new TunnelingAgent(options); - agent.request = https.request; - return agent; -} + return date; +}; -function httpsOverHttps(options) { - var agent = new TunnelingAgent(options); - agent.request = https.request; - agent.createSocket = createSecureSocket; - agent.defaultPort = 443; - return agent; -} +/** + * Converts a date to a UTCTime value. + * + * Note: GeneralizedTime has 4 digits for the year and is used for X.509 + * dates past 2049. Converting to a GeneralizedTime hasn't been + * implemented yet. + * + * @param date the date to convert. + * + * @return the UTCTime value. + */ +asn1.dateToUtcTime = function(date) { + // TODO: validate; currently assumes proper format + if(typeof date === 'string') { + return date; + } + var rval = ''; -function TunnelingAgent(options) { - var self = this; - self.options = options || {}; - self.proxyOptions = self.options.proxy || {}; - self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets; - self.requests = []; - self.sockets = []; + // create format YYMMDDhhmmssZ + var format = []; + format.push(('' + date.getUTCFullYear()).substr(2)); + format.push('' + (date.getUTCMonth() + 1)); + format.push('' + date.getUTCDate()); + format.push('' + date.getUTCHours()); + format.push('' + date.getUTCMinutes()); + format.push('' + date.getUTCSeconds()); - self.on('free', function onFree(socket, host, port, localAddress) { - var options = toOptions(host, port, localAddress); - for (var i = 0, len = self.requests.length; i < len; ++i) { - var pending = self.requests[i]; - if (pending.host === options.host && pending.port === options.port) { - // Detect the request to connect same origin server, - // reuse the connection. - self.requests.splice(i, 1); - pending.request.onSocket(socket); - return; - } + // ensure 2 digits are used for each format entry + for(var i = 0; i < format.length; ++i) { + if(format[i].length < 2) { + rval += '0'; } - socket.destroy(); - self.removeSocket(socket); - }); -} -util.inherits(TunnelingAgent, events.EventEmitter); + rval += format[i]; + } + rval += 'Z'; -TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { - var self = this; - var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress)); + return rval; +}; - if (self.sockets.length >= this.maxSockets) { - // We are over limit so we'll add it to the queue. - self.requests.push(options); - return; +/** + * Converts a date to a GeneralizedTime value. + * + * @param date the date to convert. + * + * @return the GeneralizedTime value as a string. + */ +asn1.dateToGeneralizedTime = function(date) { + // TODO: validate; currently assumes proper format + if(typeof date === 'string') { + return date; } - // If we are under maxSockets create a new one. - self.createSocket(options, function(socket) { - socket.on('free', onFree); - socket.on('close', onCloseOrRemove); - socket.on('agentRemove', onCloseOrRemove); - req.onSocket(socket); + var rval = ''; - function onFree() { - self.emit('free', socket, options); - } + // create format YYYYMMDDHHMMSSZ + var format = []; + format.push('' + date.getUTCFullYear()); + format.push('' + (date.getUTCMonth() + 1)); + format.push('' + date.getUTCDate()); + format.push('' + date.getUTCHours()); + format.push('' + date.getUTCMinutes()); + format.push('' + date.getUTCSeconds()); - function onCloseOrRemove(err) { - self.removeSocket(socket); - socket.removeListener('free', onFree); - socket.removeListener('close', onCloseOrRemove); - socket.removeListener('agentRemove', onCloseOrRemove); + // ensure 2 digits are used for each format entry + for(var i = 0; i < format.length; ++i) { + if(format[i].length < 2) { + rval += '0'; } - }); -}; + rval += format[i]; + } + rval += 'Z'; -TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { - var self = this; - var placeholder = {}; - self.sockets.push(placeholder); + return rval; +}; - var connectOptions = mergeOptions({}, self.proxyOptions, { - method: 'CONNECT', - path: options.host + ':' + options.port, - agent: false, - headers: { - host: options.host + ':' + options.port - } - }); - if (options.localAddress) { - connectOptions.localAddress = options.localAddress; +/** + * Converts a javascript integer to a DER-encoded byte buffer to be used + * as the value for an INTEGER type. + * + * @param x the integer. + * + * @return the byte buffer. + */ +asn1.integerToDer = function(x) { + var rval = forge.util.createBuffer(); + if(x >= -0x80 && x < 0x80) { + return rval.putSignedInt(x, 8); } - if (connectOptions.proxyAuth) { - connectOptions.headers = connectOptions.headers || {}; - connectOptions.headers['Proxy-Authorization'] = 'Basic ' + - new Buffer(connectOptions.proxyAuth).toString('base64'); + if(x >= -0x8000 && x < 0x8000) { + return rval.putSignedInt(x, 16); } + if(x >= -0x800000 && x < 0x800000) { + return rval.putSignedInt(x, 24); + } + if(x >= -0x80000000 && x < 0x80000000) { + return rval.putSignedInt(x, 32); + } + var error = new Error('Integer too large; max is 32-bits.'); + error.integer = x; + throw error; +}; - debug('making CONNECT request'); - var connectReq = self.request(connectOptions); - connectReq.useChunkedEncodingByDefault = false; // for v0.6 - connectReq.once('response', onResponse); // for v0.6 - connectReq.once('upgrade', onUpgrade); // for v0.6 - connectReq.once('connect', onConnect); // for v0.7 or later - connectReq.once('error', onError); - connectReq.end(); - - function onResponse(res) { - // Very hacky. This is necessary to avoid http-parser leaks. - res.upgrade = true; +/** + * Converts a DER-encoded byte buffer to a javascript integer. This is + * typically used to decode the value of an INTEGER type. + * + * @param bytes the byte buffer. + * + * @return the integer. + */ +asn1.derToInteger = function(bytes) { + // wrap in buffer if needed + if(typeof bytes === 'string') { + bytes = forge.util.createBuffer(bytes); } - function onUpgrade(res, socket, head) { - // Hacky. - process.nextTick(function() { - onConnect(res, socket, head); - }); + var n = bytes.length() * 8; + if(n > 32) { + throw new Error('Integer too large; max is 32-bits.'); } + return bytes.getSignedInt(n); +}; - function onConnect(res, socket, head) { - connectReq.removeAllListeners(); - socket.removeAllListeners(); +/** + * Validates that the given ASN.1 object is at least a super set of the + * given ASN.1 structure. Only tag classes and types are checked. An + * optional map may also be provided to capture ASN.1 values while the + * structure is checked. + * + * To capture an ASN.1 value, set an object in the validator's 'capture' + * parameter to the key to use in the capture map. To capture the full + * ASN.1 object, specify 'captureAsn1'. To capture BIT STRING bytes, including + * the leading unused bits counter byte, specify 'captureBitStringContents'. + * To capture BIT STRING bytes, without the leading unused bits counter byte, + * specify 'captureBitStringValue'. + * + * Objects in the validator may set a field 'optional' to true to indicate + * that it isn't necessary to pass validation. + * + * @param obj the ASN.1 object to validate. + * @param v the ASN.1 structure validator. + * @param capture an optional map to capture values in. + * @param errors an optional array for storing validation errors. + * + * @return true on success, false on failure. + */ +asn1.validate = function(obj, v, capture, errors) { + var rval = false; - if (res.statusCode !== 200) { - debug('tunneling socket could not be established, statusCode=%d', - res.statusCode); - socket.destroy(); - var error = new Error('tunneling socket could not be established, ' + - 'statusCode=' + res.statusCode); - error.code = 'ECONNRESET'; - options.request.emit('error', error); - self.removeSocket(placeholder); - return; + // ensure tag class and type are the same if specified + if((obj.tagClass === v.tagClass || typeof(v.tagClass) === 'undefined') && + (obj.type === v.type || typeof(v.type) === 'undefined')) { + // ensure constructed flag is the same if specified + if(obj.constructed === v.constructed || + typeof(v.constructed) === 'undefined') { + rval = true; + + // handle sub values + if(v.value && forge.util.isArray(v.value)) { + var j = 0; + for(var i = 0; rval && i < v.value.length; ++i) { + rval = v.value[i].optional || false; + if(obj.value[j]) { + rval = asn1.validate(obj.value[j], v.value[i], capture, errors); + if(rval) { + ++j; + } else if(v.value[i].optional) { + rval = true; + } + } + if(!rval && errors) { + errors.push( + '[' + v.name + '] ' + + 'Tag class "' + v.tagClass + '", type "' + + v.type + '" expected value length "' + + v.value.length + '", got "' + + obj.value.length + '"'); + } + } + } + + if(rval && capture) { + if(v.capture) { + capture[v.capture] = obj.value; + } + if(v.captureAsn1) { + capture[v.captureAsn1] = obj; + } + if(v.captureBitStringContents && 'bitStringContents' in obj) { + capture[v.captureBitStringContents] = obj.bitStringContents; + } + if(v.captureBitStringValue && 'bitStringContents' in obj) { + var value; + if(obj.bitStringContents.length < 2) { + capture[v.captureBitStringValue] = ''; + } else { + // FIXME: support unused bits with data shifting + var unused = obj.bitStringContents.charCodeAt(0); + if(unused !== 0) { + throw new Error( + 'captureBitStringValue only supported for zero unused bits'); + } + capture[v.captureBitStringValue] = obj.bitStringContents.slice(1); + } + } + } + } else if(errors) { + errors.push( + '[' + v.name + '] ' + + 'Expected constructed "' + v.constructed + '", got "' + + obj.constructed + '"'); + } + } else if(errors) { + if(obj.tagClass !== v.tagClass) { + errors.push( + '[' + v.name + '] ' + + 'Expected tag class "' + v.tagClass + '", got "' + + obj.tagClass + '"'); } - if (head.length > 0) { - debug('got illegal response body from proxy'); - socket.destroy(); - var error = new Error('got illegal response body from proxy'); - error.code = 'ECONNRESET'; - options.request.emit('error', error); - self.removeSocket(placeholder); - return; + if(obj.type !== v.type) { + errors.push( + '[' + v.name + '] ' + + 'Expected type "' + v.type + '", got "' + obj.type + '"'); } - debug('tunneling connection has established'); - self.sockets[self.sockets.indexOf(placeholder)] = socket; - return cb(socket); } + return rval; +}; - function onError(cause) { - connectReq.removeAllListeners(); +// regex for testing for non-latin characters +var _nonLatinRegex = /[^\\u0000-\\u00ff]/; - debug('tunneling socket could not be established, cause=%s\n', - cause.message, cause.stack); - var error = new Error('tunneling socket could not be established, ' + - 'cause=' + cause.message); - error.code = 'ECONNRESET'; - options.request.emit('error', error); - self.removeSocket(placeholder); - } -}; +/** + * Pretty prints an ASN.1 object to a string. + * + * @param obj the object to write out. + * @param level the level in the tree. + * @param indentation the indentation to use. + * + * @return the string. + */ +asn1.prettyPrint = function(obj, level, indentation) { + var rval = ''; -TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { - var pos = this.sockets.indexOf(socket) - if (pos === -1) { - return; - } - this.sockets.splice(pos, 1); + // set default level and indentation + level = level || 0; + indentation = indentation || 2; - var pending = this.requests.shift(); - if (pending) { - // If we have pending requests and a socket gets closed a new one - // needs to be created to take over in the pool for the one that closed. - this.createSocket(pending, function(socket) { - pending.request.onSocket(socket); - }); + // start new line for deep levels + if(level > 0) { + rval += '\n'; } -}; -function createSecureSocket(options, cb) { - var self = this; - TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { - var hostHeader = options.request.getHeader('host'); - var tlsOptions = mergeOptions({}, self.options, { - socket: socket, - servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host - }); + // create indent + var indent = ''; + for(var i = 0; i < level * indentation; ++i) { + indent += ' '; + } - // 0 is dummy port for v0.6 - var secureSocket = tls.connect(0, tlsOptions); - self.sockets[self.sockets.indexOf(socket)] = secureSocket; - cb(secureSocket); - }); -} + // print class:type + rval += indent + 'Tag: '; + switch(obj.tagClass) { + case asn1.Class.UNIVERSAL: + rval += 'Universal:'; + break; + case asn1.Class.APPLICATION: + rval += 'Application:'; + break; + case asn1.Class.CONTEXT_SPECIFIC: + rval += 'Context-Specific:'; + break; + case asn1.Class.PRIVATE: + rval += 'Private:'; + break; + } + if(obj.tagClass === asn1.Class.UNIVERSAL) { + rval += obj.type; -function toOptions(host, port, localAddress) { - if (typeof host === 'string') { // since v0.10 - return { - host: host, - port: port, - localAddress: localAddress - }; + // known types + switch(obj.type) { + case asn1.Type.NONE: + rval += ' (None)'; + break; + case asn1.Type.BOOLEAN: + rval += ' (Boolean)'; + break; + case asn1.Type.INTEGER: + rval += ' (Integer)'; + break; + case asn1.Type.BITSTRING: + rval += ' (Bit string)'; + break; + case asn1.Type.OCTETSTRING: + rval += ' (Octet string)'; + break; + case asn1.Type.NULL: + rval += ' (Null)'; + break; + case asn1.Type.OID: + rval += ' (Object Identifier)'; + break; + case asn1.Type.ODESC: + rval += ' (Object Descriptor)'; + break; + case asn1.Type.EXTERNAL: + rval += ' (External or Instance of)'; + break; + case asn1.Type.REAL: + rval += ' (Real)'; + break; + case asn1.Type.ENUMERATED: + rval += ' (Enumerated)'; + break; + case asn1.Type.EMBEDDED: + rval += ' (Embedded PDV)'; + break; + case asn1.Type.UTF8: + rval += ' (UTF8)'; + break; + case asn1.Type.ROID: + rval += ' (Relative Object Identifier)'; + break; + case asn1.Type.SEQUENCE: + rval += ' (Sequence)'; + break; + case asn1.Type.SET: + rval += ' (Set)'; + break; + case asn1.Type.PRINTABLESTRING: + rval += ' (Printable String)'; + break; + case asn1.Type.IA5String: + rval += ' (IA5String (ASCII))'; + break; + case asn1.Type.UTCTIME: + rval += ' (UTC time)'; + break; + case asn1.Type.GENERALIZEDTIME: + rval += ' (Generalized time)'; + break; + case asn1.Type.BMPSTRING: + rval += ' (BMP String)'; + break; + } + } else { + rval += obj.type; } - return host; // for v0.11 or later -} -function mergeOptions(target) { - for (var i = 1, len = arguments.length; i < len; ++i) { - var overrides = arguments[i]; - if (typeof overrides === 'object') { - var keys = Object.keys(overrides); - for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { - var k = keys[j]; - if (overrides[k] !== undefined) { - target[k] = overrides[k]; + rval += '\n'; + rval += indent + 'Constructed: ' + obj.constructed + '\n'; + + if(obj.composed) { + var subvalues = 0; + var sub = ''; + for(var i = 0; i < obj.value.length; ++i) { + if(obj.value[i] !== undefined) { + subvalues += 1; + sub += asn1.prettyPrint(obj.value[i], level + 1, indentation); + if((i + 1) < obj.value.length) { + sub += ','; } } } - } - return target; -} - - -var debug; -if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { - debug = function() { - var args = Array.prototype.slice.call(arguments); - if (typeof args[0] === 'string') { - args[0] = 'TUNNEL: ' + args[0]; + rval += indent + 'Sub values: ' + subvalues + sub; + } else { + rval += indent + 'Value: '; + if(obj.type === asn1.Type.OID) { + var oid = asn1.derToOid(obj.value); + rval += oid; + if(forge.pki && forge.pki.oids) { + if(oid in forge.pki.oids) { + rval += ' (' + forge.pki.oids[oid] + ') '; + } + } + } + if(obj.type === asn1.Type.INTEGER) { + try { + rval += asn1.derToInteger(obj.value); + } catch(ex) { + rval += '0x' + forge.util.bytesToHex(obj.value); + } + } else if(obj.type === asn1.Type.BITSTRING) { + // TODO: shift bits as needed to display without padding + if(obj.value.length > 1) { + // remove unused bits field + rval += '0x' + forge.util.bytesToHex(obj.value.slice(1)); + } else { + rval += '(none)'; + } + // show unused bit count + if(obj.value.length > 0) { + var unused = obj.value.charCodeAt(0); + if(unused == 1) { + rval += ' (1 unused bit shown)'; + } else if(unused > 1) { + rval += ' (' + unused + ' unused bits shown)'; + } + } + } else if(obj.type === asn1.Type.OCTETSTRING) { + if(!_nonLatinRegex.test(obj.value)) { + rval += '(' + obj.value + ') '; + } + rval += '0x' + forge.util.bytesToHex(obj.value); + } else if(obj.type === asn1.Type.UTF8) { + rval += forge.util.decodeUtf8(obj.value); + } else if(obj.type === asn1.Type.PRINTABLESTRING || + obj.type === asn1.Type.IA5String) { + rval += obj.value; + } else if(_nonLatinRegex.test(obj.value)) { + rval += '0x' + forge.util.bytesToHex(obj.value); + } else if(obj.value.length === 0) { + rval += '[null]'; } else { - args.unshift('TUNNEL:'); + rval += obj.value; } - console.error.apply(console, args); } -} else { - debug = function() {}; -} -exports.debug = debug; // for test + + return rval; +}; /***/ }), -<<<<<<< HEAD -/***/ 64010: -======= -/***/ 17225: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { - +/***/ 31182: +/***/ ((module) => { +/** + * Base-N/Base-X encoding/decoding functions. + * + * Original implementation from base-x: + * https://github.com/cryptocoinjs/base-x + * + * Which is MIT licensed: + * + * The MIT License (MIT) + * + * Copyright base-x contributors (c) 2016 + * + * 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. + */ +var api = {}; +module.exports = api; -Object.defineProperty(exports, "__esModule", ({ value: true })); +// baseN alphabet indexes +var _reverseAlphabets = {}; -function concat(arrays, length) { - if (!length) { - length = arrays.reduce((acc, curr) => acc + curr.length, 0); +/** + * BaseN-encodes a Uint8Array using the given alphabet. + * + * @param input the Uint8Array to encode. + * @param maxline the maximum number of encoded characters per line to use, + * defaults to none. + * + * @return the baseN-encoded output string. + */ +api.encode = function(input, alphabet, maxline) { + if(typeof alphabet !== 'string') { + throw new TypeError('"alphabet" must be a string.'); } - const output = new Uint8Array(length); - let offset = 0; - for (const arr of arrays) { - output.set(arr, offset); - offset += arr.length; + if(maxline !== undefined && typeof maxline !== 'number') { + throw new TypeError('"maxline" must be a number.'); } - return output; -} - -exports.concat = concat; + var output = ''; -/***/ }), + if(!(input instanceof Uint8Array)) { + // assume forge byte buffer + output = _encodeWithByteBuffer(input, alphabet); + } else { + var i = 0; + var base = alphabet.length; + var first = alphabet.charAt(0); + var digits = [0]; + for(i = 0; i < input.length; ++i) { + for(var j = 0, carry = input[i]; j < digits.length; ++j) { + carry += digits[j] << 8; + digits[j] = carry % base; + carry = (carry / base) | 0; + } -<<<<<<< HEAD -/***/ 12667: -======= -/***/ 94646: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { + while(carry > 0) { + digits.push(carry % base); + carry = (carry / base) | 0; + } + } + // deal with leading zeros + for(i = 0; input[i] === 0 && i < input.length - 1; ++i) { + output += first; + } + // convert digits to a string + for(i = digits.length - 1; i >= 0; --i) { + output += alphabet[digits[i]]; + } + } + if(maxline) { + var regex = new RegExp('.{1,' + maxline + '}', 'g'); + output = output.match(regex).join('\r\n'); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + return output; +}; -function equals(a, b) { - if (a === b) { - return true; +/** + * Decodes a baseN-encoded (using the given alphabet) string to a + * Uint8Array. + * + * @param input the baseN-encoded input string. + * + * @return the Uint8Array. + */ +api.decode = function(input, alphabet) { + if(typeof input !== 'string') { + throw new TypeError('"input" must be a string.'); } - if (a.byteLength !== b.byteLength) { - return false; + if(typeof alphabet !== 'string') { + throw new TypeError('"alphabet" must be a string.'); } - for (let i = 0; i < a.byteLength; i++) { - if (a[i] !== b[i]) { - return false; + + var table = _reverseAlphabets[alphabet]; + if(!table) { + // compute reverse alphabet + table = _reverseAlphabets[alphabet] = []; + for(var i = 0; i < alphabet.length; ++i) { + table[alphabet.charCodeAt(i)] = i; } } - return true; -} - -exports.equals = equals; - - -/***/ }), - -<<<<<<< HEAD -/***/ 31277: -======= -/***/ 39451: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - + // remove whitespace characters + input = input.replace(/\s/g, ''); -Object.defineProperty(exports, "__esModule", ({ value: true })); + var base = alphabet.length; + var first = alphabet.charAt(0); + var bytes = [0]; + for(var i = 0; i < input.length; i++) { + var value = table[input.charCodeAt(i)]; + if(value === undefined) { + return; + } -<<<<<<< HEAD -var bases = __nccwpck_require__(4710); -======= -var bases = __nccwpck_require__(91476); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + for(var j = 0, carry = value; j < bytes.length; ++j) { + carry += bytes[j] * base; + bytes[j] = carry & 0xff; + carry >>= 8; + } -function fromString(string, encoding = 'utf8') { - const base = bases[encoding]; - if (!base) { - throw new Error(`Unsupported encoding "${ encoding }"`); + while(carry > 0) { + bytes.push(carry & 0xff); + carry >>= 8; + } } - return base.decoder.decode(`${ base.prefix }${ string }`); -} -exports.fromString = fromString; - - -/***/ }), + // deal with leading zeros + for(var k = 0; input[k] === first && k < input.length - 1; ++k) { + bytes.push(0); + } -<<<<<<< HEAD -/***/ 34163: -======= -/***/ 2771: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if(typeof Buffer !== 'undefined') { + return Buffer.from(bytes.reverse()); + } + return new Uint8Array(bytes.reverse()); +}; +function _encodeWithByteBuffer(input, alphabet) { + var i = 0; + var base = alphabet.length; + var first = alphabet.charAt(0); + var digits = [0]; + for(i = 0; i < input.length(); ++i) { + for(var j = 0, carry = input.at(i); j < digits.length; ++j) { + carry += digits[j] << 8; + digits[j] = carry % base; + carry = (carry / base) | 0; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + while(carry > 0) { + digits.push(carry % base); + carry = (carry / base) | 0; + } + } -<<<<<<< HEAD -var bases = __nccwpck_require__(4710); -======= -var bases = __nccwpck_require__(91476); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + var output = ''; -function toString(array, encoding = 'utf8') { - const base = bases[encoding]; - if (!base) { - throw new Error(`Unsupported encoding "${ encoding }"`); + // deal with leading zeros + for(i = 0; input.at(i) === 0 && i < input.length() - 1; ++i) { + output += first; + } + // convert digits to a string + for(i = digits.length - 1; i >= 0; --i) { + output += alphabet[digits[i]]; } - return base.encoder.encode(array).substring(1); -} -exports.toString = toString; + return output; +} /***/ }), -<<<<<<< HEAD -/***/ 4710: -======= -/***/ 91476: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 7329: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * Cipher base API. + * + * @author Dave Longley + * + * Copyright (c) 2010-2014 Digital Bazaar, Inc. + */ +var forge = __nccwpck_require__(56389); +__nccwpck_require__(65138); +module.exports = forge.cipher = forge.cipher || {}; -<<<<<<< HEAD -var basics = __nccwpck_require__(22965); -======= -var basics = __nccwpck_require__(42916); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +// registered algorithms +forge.cipher.algorithms = forge.cipher.algorithms || {}; -function createCodec(name, prefix, encode, decode) { - return { - name, - prefix, - encoder: { - name, - prefix, - encode - }, - decoder: { decode } - }; -} -const string = createCodec('utf8', 'u', buf => { - const decoder = new TextDecoder('utf8'); - return 'u' + decoder.decode(buf); -}, str => { - const encoder = new TextEncoder(); - return encoder.encode(str.substring(1)); -}); -const ascii = createCodec('ascii', 'a', buf => { - let string = 'a'; - for (let i = 0; i < buf.length; i++) { - string += String.fromCharCode(buf[i]); +/** + * Creates a cipher object that can be used to encrypt data using the given + * algorithm and key. The algorithm may be provided as a string value for a + * previously registered algorithm or it may be given as a cipher algorithm + * API object. + * + * @param algorithm the algorithm to use, either a string or an algorithm API + * object. + * @param key the key to use, as a binary-encoded string of bytes or a + * byte buffer. + * + * @return the cipher. + */ +forge.cipher.createCipher = function(algorithm, key) { + var api = algorithm; + if(typeof api === 'string') { + api = forge.cipher.getAlgorithm(api); + if(api) { + api = api(); + } } - return string; -}, str => { - str = str.substring(1); - const buf = new Uint8Array(str.length); - for (let i = 0; i < str.length; i++) { - buf[i] = str.charCodeAt(i); + if(!api) { + throw new Error('Unsupported algorithm: ' + algorithm); } - return buf; -}); -const BASES = { - utf8: string, - 'utf-8': string, - hex: basics.bases.base16, - latin1: ascii, - ascii: ascii, - binary: ascii, - ...basics.bases -}; - -module.exports = BASES; - - -/***/ }), - -<<<<<<< HEAD -/***/ 40992: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - + // assume block cipher + return new forge.cipher.BlockCipher({ + algorithm: api, + key: key, + decrypt: false + }); +}; -const Client = __nccwpck_require__(52463) -const Dispatcher = __nccwpck_require__(73272) -const errors = __nccwpck_require__(46339) -const Pool = __nccwpck_require__(85186) -const BalancedPool = __nccwpck_require__(8926) -const Agent = __nccwpck_require__(97464) -const util = __nccwpck_require__(67468) -const { InvalidArgumentError } = errors -const api = __nccwpck_require__(69938) -const buildConnector = __nccwpck_require__(2209) -const MockClient = __nccwpck_require__(52905) -const MockAgent = __nccwpck_require__(21627) -const MockPool = __nccwpck_require__(28511) -const mockErrors = __nccwpck_require__(31816) -const ProxyAgent = __nccwpck_require__(44417) -const RetryHandler = __nccwpck_require__(74989) -const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(29102) -const DecoratorHandler = __nccwpck_require__(68640) -const RedirectHandler = __nccwpck_require__(59660) -const createRedirectInterceptor = __nccwpck_require__(72509) - -let hasCrypto -try { - __nccwpck_require__(6113) - hasCrypto = true -} catch { - hasCrypto = false -} - -Object.assign(Dispatcher.prototype, api) +/** + * Creates a decipher object that can be used to decrypt data using the given + * algorithm and key. The algorithm may be provided as a string value for a + * previously registered algorithm or it may be given as a cipher algorithm + * API object. + * + * @param algorithm the algorithm to use, either a string or an algorithm API + * object. + * @param key the key to use, as a binary-encoded string of bytes or a + * byte buffer. + * + * @return the cipher. + */ +forge.cipher.createDecipher = function(algorithm, key) { + var api = algorithm; + if(typeof api === 'string') { + api = forge.cipher.getAlgorithm(api); + if(api) { + api = api(); + } + } + if(!api) { + throw new Error('Unsupported algorithm: ' + algorithm); + } -module.exports.Dispatcher = Dispatcher -module.exports.Client = Client -module.exports.Pool = Pool -module.exports.BalancedPool = BalancedPool -module.exports.Agent = Agent -module.exports.ProxyAgent = ProxyAgent -module.exports.RetryHandler = RetryHandler + // assume block cipher + return new forge.cipher.BlockCipher({ + algorithm: api, + key: key, + decrypt: true + }); +}; -module.exports.DecoratorHandler = DecoratorHandler -module.exports.RedirectHandler = RedirectHandler -module.exports.createRedirectInterceptor = createRedirectInterceptor +/** + * Registers an algorithm by name. If the name was already registered, the + * algorithm API object will be overwritten. + * + * @param name the name of the algorithm. + * @param algorithm the algorithm API object. + */ +forge.cipher.registerAlgorithm = function(name, algorithm) { + name = name.toUpperCase(); + forge.cipher.algorithms[name] = algorithm; +}; -module.exports.buildConnector = buildConnector -module.exports.errors = errors +/** + * Gets a registered algorithm by name. + * + * @param name the name of the algorithm. + * + * @return the algorithm, if found, null if not. + */ +forge.cipher.getAlgorithm = function(name) { + name = name.toUpperCase(); + if(name in forge.cipher.algorithms) { + return forge.cipher.algorithms[name]; + } + return null; +}; -function makeDispatcher (fn) { - return (url, opts, handler) => { - if (typeof opts === 'function') { - handler = opts - opts = null - } +var BlockCipher = forge.cipher.BlockCipher = function(options) { + this.algorithm = options.algorithm; + this.mode = this.algorithm.mode; + this.blockSize = this.mode.blockSize; + this._finish = false; + this._input = null; + this.output = null; + this._op = options.decrypt ? this.mode.decrypt : this.mode.encrypt; + this._decrypt = options.decrypt; + this.algorithm.initialize(options); +}; - if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) { - throw new InvalidArgumentError('invalid url') - } +/** + * Starts or restarts the encryption or decryption process, whichever + * was previously configured. + * + * For non-GCM mode, the IV may be a binary-encoded string of bytes, an array + * of bytes, a byte buffer, or an array of 32-bit integers. If the IV is in + * bytes, then it must be Nb (16) bytes in length. If the IV is given in as + * 32-bit integers, then it must be 4 integers long. + * + * Note: an IV is not required or used in ECB mode. + * + * For GCM-mode, the IV must be given as a binary-encoded string of bytes or + * a byte buffer. The number of bytes should be 12 (96 bits) as recommended + * by NIST SP-800-38D but another length may be given. + * + * @param options the options to use: + * iv the initialization vector to use as a binary-encoded string of + * bytes, null to reuse the last ciphered block from a previous + * update() (this "residue" method is for legacy support only). + * additionalData additional authentication data as a binary-encoded + * string of bytes, for 'GCM' mode, (default: none). + * tagLength desired length of authentication tag, in bits, for + * 'GCM' mode (0-128, default: 128). + * tag the authentication tag to check if decrypting, as a + * binary-encoded string of bytes. + * output the output the buffer to write to, null to create one. + */ +BlockCipher.prototype.start = function(options) { + options = options || {}; + var opts = {}; + for(var key in options) { + opts[key] = options[key]; + } + opts.decrypt = this._decrypt; + this._finish = false; + this._input = forge.util.createBuffer(); + this.output = options.output || forge.util.createBuffer(); + this.mode.start(opts); +}; - if (opts != null && typeof opts !== 'object') { - throw new InvalidArgumentError('invalid opts') - } +/** + * Updates the next block according to the cipher mode. + * + * @param input the buffer to read from. + */ +BlockCipher.prototype.update = function(input) { + if(input) { + // input given, so empty it into the input buffer + this._input.putBuffer(input); + } - if (opts && opts.path != null) { - if (typeof opts.path !== 'string') { - throw new InvalidArgumentError('invalid opts.path') - } + // do cipher operation until it needs more input and not finished + while(!this._op.call(this.mode, this._input, this.output, this._finish) && + !this._finish) {} - let path = opts.path - if (!opts.path.startsWith('/')) { - path = `/${path}` - } + // free consumed memory from input buffer + this._input.compact(); +}; - url = new URL(util.parseOrigin(url).origin + path) - } else { - if (!opts) { - opts = typeof url === 'object' ? url : {} - } +/** + * Finishes encrypting or decrypting. + * + * @param pad a padding function to use in CBC mode, null for default, + * signature(blockSize, buffer, decrypt). + * + * @return true if successful, false on error. + */ +BlockCipher.prototype.finish = function(pad) { + // backwards-compatibility w/deprecated padding API + // Note: will overwrite padding functions even after another start() call + if(pad && (this.mode.name === 'ECB' || this.mode.name === 'CBC')) { + this.mode.pad = function(input) { + return pad(this.blockSize, input, false); + }; + this.mode.unpad = function(output) { + return pad(this.blockSize, output, true); + }; + } - url = util.parseURL(url) - } + // build options for padding and afterFinish functions + var options = {}; + options.decrypt = this._decrypt; - const { agent, dispatcher = getGlobalDispatcher() } = opts + // get # of bytes that won't fill a block + options.overflow = this._input.length() % this.blockSize; - if (agent) { - throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?') + if(!this._decrypt && this.mode.pad) { + if(!this.mode.pad(this._input, options)) { + return false; } - - return fn.call(dispatcher, { - ...opts, - origin: url.origin, - path: url.search ? `${url.pathname}${url.search}` : url.pathname, - method: opts.method || (opts.body ? 'PUT' : 'GET') - }, handler) } -} -module.exports.setGlobalDispatcher = setGlobalDispatcher -module.exports.getGlobalDispatcher = getGlobalDispatcher + // do final update + this._finish = true; + this.update(); -if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) { - let fetchImpl = null - module.exports.fetch = async function fetch (resource) { - if (!fetchImpl) { - fetchImpl = (__nccwpck_require__(72748).fetch) + if(this._decrypt && this.mode.unpad) { + if(!this.mode.unpad(this.output, options)) { + return false; } + } - try { - return await fetchImpl(...arguments) - } catch (err) { - if (typeof err === 'object') { - Error.captureStackTrace(err, this) - } - - throw err + if(this.mode.afterFinish) { + if(!this.mode.afterFinish(this.output, options)) { + return false; } } - module.exports.Headers = __nccwpck_require__(23245).Headers - module.exports.Response = __nccwpck_require__(58846).Response - module.exports.Request = __nccwpck_require__(7288).Request - module.exports.FormData = __nccwpck_require__(12692).FormData - module.exports.File = __nccwpck_require__(96670).File - module.exports.FileReader = __nccwpck_require__(8317).FileReader - - const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(64110) - - module.exports.setGlobalOrigin = setGlobalOrigin - module.exports.getGlobalOrigin = getGlobalOrigin - - const { CacheStorage } = __nccwpck_require__(26419) - const { kConstruct } = __nccwpck_require__(69668) - - // Cache & CacheStorage are tightly coupled with fetch. Even if it may run - // in an older version of Node, it doesn't have any use without fetch. - module.exports.caches = new CacheStorage(kConstruct) -} - -if (util.nodeMajor >= 16) { - const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(15389) - - module.exports.deleteCookie = deleteCookie - module.exports.getCookies = getCookies - module.exports.getSetCookies = getSetCookies - module.exports.setCookie = setCookie - - const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(50096) - - module.exports.parseMIMEType = parseMIMEType - module.exports.serializeAMimeType = serializeAMimeType -} - -if (util.nodeMajor >= 18 && hasCrypto) { - const { WebSocket } = __nccwpck_require__(53726) - - module.exports.WebSocket = WebSocket -} -module.exports.request = makeDispatcher(api.request) -module.exports.stream = makeDispatcher(api.stream) -module.exports.pipeline = makeDispatcher(api.pipeline) -module.exports.connect = makeDispatcher(api.connect) -module.exports.upgrade = makeDispatcher(api.upgrade) - -module.exports.MockClient = MockClient -module.exports.MockPool = MockPool -module.exports.MockAgent = MockAgent -module.exports.mockErrors = mockErrors + return true; +}; /***/ }), -/***/ 97464: +/***/ 33975: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * Supported cipher modes. + * + * @author Dave Longley + * + * Copyright (c) 2010-2014 Digital Bazaar, Inc. + */ +var forge = __nccwpck_require__(56389); +__nccwpck_require__(65138); +forge.cipher = forge.cipher || {}; -const { InvalidArgumentError } = __nccwpck_require__(46339) -const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(48039) -const DispatcherBase = __nccwpck_require__(32426) -const Pool = __nccwpck_require__(85186) -const Client = __nccwpck_require__(52463) -const util = __nccwpck_require__(67468) -const createRedirectInterceptor = __nccwpck_require__(72509) -const { WeakRef, FinalizationRegistry } = __nccwpck_require__(71744)() - -const kOnConnect = Symbol('onConnect') -const kOnDisconnect = Symbol('onDisconnect') -const kOnConnectionError = Symbol('onConnectionError') -const kMaxRedirections = Symbol('maxRedirections') -const kOnDrain = Symbol('onDrain') -const kFactory = Symbol('factory') -const kFinalizer = Symbol('finalizer') -const kOptions = Symbol('options') - -function defaultFactory (origin, opts) { - return opts && opts.connections === 1 - ? new Client(origin, opts) - : new Pool(origin, opts) -} - -class Agent extends DispatcherBase { - constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { - super() - - if (typeof factory !== 'function') { - throw new InvalidArgumentError('factory must be a function.') - } - - if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { - throw new InvalidArgumentError('connect must be a function or an object') - } - - if (!Number.isInteger(maxRedirections) || maxRedirections < 0) { - throw new InvalidArgumentError('maxRedirections must be a positive number') - } - - if (connect && typeof connect !== 'function') { - connect = { ...connect } - } - - this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent) - ? options.interceptors.Agent - : [createRedirectInterceptor({ maxRedirections })] - - this[kOptions] = { ...util.deepClone(options), connect } - this[kOptions].interceptors = options.interceptors - ? { ...options.interceptors } - : undefined - this[kMaxRedirections] = maxRedirections - this[kFactory] = factory - this[kClients] = new Map() - this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => { - const ref = this[kClients].get(key) - if (ref !== undefined && ref.deref() === undefined) { - this[kClients].delete(key) - } - }) - - const agent = this +// supported cipher modes +var modes = module.exports = forge.cipher.modes = forge.cipher.modes || {}; - this[kOnDrain] = (origin, targets) => { - agent.emit('drain', origin, [agent, ...targets]) - } +/** Electronic codebook (ECB) (Don't use this; it's not secure) **/ - this[kOnConnect] = (origin, targets) => { - agent.emit('connect', origin, [agent, ...targets]) - } +modes.ecb = function(options) { + options = options || {}; + this.name = 'ECB'; + this.cipher = options.cipher; + this.blockSize = options.blockSize || 16; + this._ints = this.blockSize / 4; + this._inBlock = new Array(this._ints); + this._outBlock = new Array(this._ints); +}; - this[kOnDisconnect] = (origin, targets, err) => { - agent.emit('disconnect', origin, [agent, ...targets], err) - } +modes.ecb.prototype.start = function(options) {}; - this[kOnConnectionError] = (origin, targets, err) => { - agent.emit('connectionError', origin, [agent, ...targets], err) - } +modes.ecb.prototype.encrypt = function(input, output, finish) { + // not enough input to encrypt + if(input.length() < this.blockSize && !(finish && input.length() > 0)) { + return true; } - get [kRunning] () { - let ret = 0 - for (const ref of this[kClients].values()) { - const client = ref.deref() - /* istanbul ignore next: gc is undeterministic */ - if (client) { - ret += client[kRunning] - } - } - return ret + // get next block + for(var i = 0; i < this._ints; ++i) { + this._inBlock[i] = input.getInt32(); } - [kDispatch] (opts, handler) { - let key - if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) { - key = String(opts.origin) - } else { - throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.') - } - - const ref = this[kClients].get(key) - - let dispatcher = ref ? ref.deref() : null - if (!dispatcher) { - dispatcher = this[kFactory](opts.origin, this[kOptions]) - .on('drain', this[kOnDrain]) - .on('connect', this[kOnConnect]) - .on('disconnect', this[kOnDisconnect]) - .on('connectionError', this[kOnConnectionError]) - - this[kClients].set(key, new WeakRef(dispatcher)) - this[kFinalizer].register(dispatcher, key) - } + // encrypt block + this.cipher.encrypt(this._inBlock, this._outBlock); - return dispatcher.dispatch(opts, handler) + // write output + for(var i = 0; i < this._ints; ++i) { + output.putInt32(this._outBlock[i]); } +}; - async [kClose] () { - const closePromises = [] - for (const ref of this[kClients].values()) { - const client = ref.deref() - /* istanbul ignore else: gc is undeterministic */ - if (client) { - closePromises.push(client.close()) - } - } +modes.ecb.prototype.decrypt = function(input, output, finish) { + // not enough input to decrypt + if(input.length() < this.blockSize && !(finish && input.length() > 0)) { + return true; + } - await Promise.all(closePromises) + // get next block + for(var i = 0; i < this._ints; ++i) { + this._inBlock[i] = input.getInt32(); } - async [kDestroy] (err) { - const destroyPromises = [] - for (const ref of this[kClients].values()) { - const client = ref.deref() - /* istanbul ignore else: gc is undeterministic */ - if (client) { - destroyPromises.push(client.destroy(err)) - } - } + // decrypt block + this.cipher.decrypt(this._inBlock, this._outBlock); - await Promise.all(destroyPromises) + // write output + for(var i = 0; i < this._ints; ++i) { + output.putInt32(this._outBlock[i]); } -} +}; -module.exports = Agent +modes.ecb.prototype.pad = function(input, options) { + // add PKCS#7 padding to block (each pad byte is the + // value of the number of pad bytes) + var padding = (input.length() === this.blockSize ? + this.blockSize : (this.blockSize - input.length())); + input.fillWithByte(padding, padding); + return true; +}; +modes.ecb.prototype.unpad = function(output, options) { + // check for error: input data not a multiple of blockSize + if(options.overflow > 0) { + return false; + } -/***/ }), + // ensure padding byte count is valid + var len = output.length(); + var count = output.at(len - 1); + if(count > (this.blockSize << 2)) { + return false; + } -/***/ 6242: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // trim off padding bytes + output.truncate(count); + return true; +}; -const { addAbortListener } = __nccwpck_require__(67468) -const { RequestAbortedError } = __nccwpck_require__(46339) +/** Cipher-block Chaining (CBC) **/ -const kListener = Symbol('kListener') -const kSignal = Symbol('kSignal') +modes.cbc = function(options) { + options = options || {}; + this.name = 'CBC'; + this.cipher = options.cipher; + this.blockSize = options.blockSize || 16; + this._ints = this.blockSize / 4; + this._inBlock = new Array(this._ints); + this._outBlock = new Array(this._ints); +}; -function abort (self) { - if (self.abort) { - self.abort() +modes.cbc.prototype.start = function(options) { + // Note: legacy support for using IV residue (has security flaws) + // if IV is null, reuse block from previous processing + if(options.iv === null) { + // must have a previous block + if(!this._prev) { + throw new Error('Invalid IV parameter.'); + } + this._iv = this._prev.slice(0); + } else if(!('iv' in options)) { + throw new Error('Invalid IV parameter.'); } else { - self.onError(new RequestAbortedError()) + // save IV as "previous" block + this._iv = transformIV(options.iv, this.blockSize); + this._prev = this._iv.slice(0); } -} - -function addSignal (self, signal) { - self[kSignal] = null - self[kListener] = null +}; - if (!signal) { - return +modes.cbc.prototype.encrypt = function(input, output, finish) { + // not enough input to encrypt + if(input.length() < this.blockSize && !(finish && input.length() > 0)) { + return true; } - if (signal.aborted) { - abort(self) - return + // get next block + // CBC XOR's IV (or previous block) with plaintext + for(var i = 0; i < this._ints; ++i) { + this._inBlock[i] = this._prev[i] ^ input.getInt32(); } - self[kSignal] = signal - self[kListener] = () => { - abort(self) - } + // encrypt block + this.cipher.encrypt(this._inBlock, this._outBlock); - addAbortListener(self[kSignal], self[kListener]) -} + // write output, save previous block + for(var i = 0; i < this._ints; ++i) { + output.putInt32(this._outBlock[i]); + } + this._prev = this._outBlock; +}; -function removeSignal (self) { - if (!self[kSignal]) { - return +modes.cbc.prototype.decrypt = function(input, output, finish) { + // not enough input to decrypt + if(input.length() < this.blockSize && !(finish && input.length() > 0)) { + return true; } - if ('removeEventListener' in self[kSignal]) { - self[kSignal].removeEventListener('abort', self[kListener]) - } else { - self[kSignal].removeListener('abort', self[kListener]) + // get next block + for(var i = 0; i < this._ints; ++i) { + this._inBlock[i] = input.getInt32(); } - self[kSignal] = null - self[kListener] = null -} + // decrypt block + this.cipher.decrypt(this._inBlock, this._outBlock); -module.exports = { - addSignal, - removeSignal -} + // write output, save previous ciphered block + // CBC XOR's IV (or previous block) with ciphertext + for(var i = 0; i < this._ints; ++i) { + output.putInt32(this._prev[i] ^ this._outBlock[i]); + } + this._prev = this._inBlock.slice(0); +}; +modes.cbc.prototype.pad = function(input, options) { + // add PKCS#7 padding to block (each pad byte is the + // value of the number of pad bytes) + var padding = (input.length() === this.blockSize ? + this.blockSize : (this.blockSize - input.length())); + input.fillWithByte(padding, padding); + return true; +}; -/***/ }), +modes.cbc.prototype.unpad = function(output, options) { + // check for error: input data not a multiple of blockSize + if(options.overflow > 0) { + return false; + } -/***/ 35473: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // ensure padding byte count is valid + var len = output.length(); + var count = output.at(len - 1); + if(count > (this.blockSize << 2)) { + return false; + } + // trim off padding bytes + output.truncate(count); + return true; +}; +/** Cipher feedback (CFB) **/ -const { AsyncResource } = __nccwpck_require__(50852) -const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(46339) -const util = __nccwpck_require__(67468) -const { addSignal, removeSignal } = __nccwpck_require__(6242) +modes.cfb = function(options) { + options = options || {}; + this.name = 'CFB'; + this.cipher = options.cipher; + this.blockSize = options.blockSize || 16; + this._ints = this.blockSize / 4; + this._inBlock = null; + this._outBlock = new Array(this._ints); + this._partialBlock = new Array(this._ints); + this._partialOutput = forge.util.createBuffer(); + this._partialBytes = 0; +}; -class ConnectHandler extends AsyncResource { - constructor (opts, callback) { - if (!opts || typeof opts !== 'object') { - throw new InvalidArgumentError('invalid opts') - } +modes.cfb.prototype.start = function(options) { + if(!('iv' in options)) { + throw new Error('Invalid IV parameter.'); + } + // use IV as first input + this._iv = transformIV(options.iv, this.blockSize); + this._inBlock = this._iv.slice(0); + this._partialBytes = 0; +}; - if (typeof callback !== 'function') { - throw new InvalidArgumentError('invalid callback') - } +modes.cfb.prototype.encrypt = function(input, output, finish) { + // not enough input to encrypt + var inputLength = input.length(); + if(inputLength === 0) { + return true; + } - const { signal, opaque, responseHeaders } = opts + // encrypt block + this.cipher.encrypt(this._inBlock, this._outBlock); - if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { - throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + // handle full block + if(this._partialBytes === 0 && inputLength >= this.blockSize) { + // XOR input with output, write input as output + for(var i = 0; i < this._ints; ++i) { + this._inBlock[i] = input.getInt32() ^ this._outBlock[i]; + output.putInt32(this._inBlock[i]); } + return; + } - super('UNDICI_CONNECT') - - this.opaque = opaque || null - this.responseHeaders = responseHeaders || null - this.callback = callback - this.abort = null + // handle partial block + var partialBytes = (this.blockSize - inputLength) % this.blockSize; + if(partialBytes > 0) { + partialBytes = this.blockSize - partialBytes; + } - addSignal(this, signal) + // XOR input with output, write input as partial output + this._partialOutput.clear(); + for(var i = 0; i < this._ints; ++i) { + this._partialBlock[i] = input.getInt32() ^ this._outBlock[i]; + this._partialOutput.putInt32(this._partialBlock[i]); } - onConnect (abort, context) { - if (!this.callback) { - throw new RequestAbortedError() + if(partialBytes > 0) { + // block still incomplete, restore input buffer + input.read -= this.blockSize; + } else { + // block complete, update input block + for(var i = 0; i < this._ints; ++i) { + this._inBlock[i] = this._partialBlock[i]; } + } - this.abort = abort - this.context = context + // skip any previous partial bytes + if(this._partialBytes > 0) { + this._partialOutput.getBytes(this._partialBytes); } - onHeaders () { - throw new SocketError('bad connect', null) + if(partialBytes > 0 && !finish) { + output.putBytes(this._partialOutput.getBytes( + partialBytes - this._partialBytes)); + this._partialBytes = partialBytes; + return true; } - onUpgrade (statusCode, rawHeaders, socket) { - const { callback, opaque, context } = this + output.putBytes(this._partialOutput.getBytes( + inputLength - this._partialBytes)); + this._partialBytes = 0; +}; - removeSignal(this) +modes.cfb.prototype.decrypt = function(input, output, finish) { + // not enough input to decrypt + var inputLength = input.length(); + if(inputLength === 0) { + return true; + } - this.callback = null + // encrypt block (CFB always uses encryption mode) + this.cipher.encrypt(this._inBlock, this._outBlock); - let headers = rawHeaders - // Indicates is an HTTP2Session - if (headers != null) { - headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + // handle full block + if(this._partialBytes === 0 && inputLength >= this.blockSize) { + // XOR input with output, write input as output + for(var i = 0; i < this._ints; ++i) { + this._inBlock[i] = input.getInt32(); + output.putInt32(this._inBlock[i] ^ this._outBlock[i]); } - - this.runInAsyncScope(callback, null, null, { - statusCode, - headers, - socket, - opaque, - context - }) + return; } - onError (err) { - const { callback, opaque } = this - - removeSignal(this) - - if (callback) { - this.callback = null - queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }) - }) - } + // handle partial block + var partialBytes = (this.blockSize - inputLength) % this.blockSize; + if(partialBytes > 0) { + partialBytes = this.blockSize - partialBytes; } -} -function connect (opts, callback) { - if (callback === undefined) { - return new Promise((resolve, reject) => { - connect.call(this, opts, (err, data) => { - return err ? reject(err) : resolve(data) - }) - }) + // XOR input with output, write input as partial output + this._partialOutput.clear(); + for(var i = 0; i < this._ints; ++i) { + this._partialBlock[i] = input.getInt32(); + this._partialOutput.putInt32(this._partialBlock[i] ^ this._outBlock[i]); } - try { - const connectHandler = new ConnectHandler(opts, callback) - this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler) - } catch (err) { - if (typeof callback !== 'function') { - throw err + if(partialBytes > 0) { + // block still incomplete, restore input buffer + input.read -= this.blockSize; + } else { + // block complete, update input block + for(var i = 0; i < this._ints; ++i) { + this._inBlock[i] = this._partialBlock[i]; } - const opaque = opts && opts.opaque - queueMicrotask(() => callback(err, { opaque })) } -} -module.exports = connect + // skip any previous partial bytes + if(this._partialBytes > 0) { + this._partialOutput.getBytes(this._partialBytes); + } + if(partialBytes > 0 && !finish) { + output.putBytes(this._partialOutput.getBytes( + partialBytes - this._partialBytes)); + this._partialBytes = partialBytes; + return true; + } -/***/ }), + output.putBytes(this._partialOutput.getBytes( + inputLength - this._partialBytes)); + this._partialBytes = 0; +}; -/***/ 81627: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** Output feedback (OFB) **/ +modes.ofb = function(options) { + options = options || {}; + this.name = 'OFB'; + this.cipher = options.cipher; + this.blockSize = options.blockSize || 16; + this._ints = this.blockSize / 4; + this._inBlock = null; + this._outBlock = new Array(this._ints); + this._partialOutput = forge.util.createBuffer(); + this._partialBytes = 0; +}; +modes.ofb.prototype.start = function(options) { + if(!('iv' in options)) { + throw new Error('Invalid IV parameter.'); + } + // use IV as first input + this._iv = transformIV(options.iv, this.blockSize); + this._inBlock = this._iv.slice(0); + this._partialBytes = 0; +}; -const { - Readable, - Duplex, - PassThrough -} = __nccwpck_require__(12781) -const { - InvalidArgumentError, - InvalidReturnValueError, - RequestAbortedError -} = __nccwpck_require__(46339) -const util = __nccwpck_require__(67468) -const { AsyncResource } = __nccwpck_require__(50852) -const { addSignal, removeSignal } = __nccwpck_require__(6242) -const assert = __nccwpck_require__(39491) +modes.ofb.prototype.encrypt = function(input, output, finish) { + // not enough input to encrypt + var inputLength = input.length(); + if(input.length() === 0) { + return true; + } -const kResume = Symbol('resume') + // encrypt block (OFB always uses encryption mode) + this.cipher.encrypt(this._inBlock, this._outBlock); -class PipelineRequest extends Readable { - constructor () { - super({ autoDestroy: true }) + // handle full block + if(this._partialBytes === 0 && inputLength >= this.blockSize) { + // XOR input with output and update next input + for(var i = 0; i < this._ints; ++i) { + output.putInt32(input.getInt32() ^ this._outBlock[i]); + this._inBlock[i] = this._outBlock[i]; + } + return; + } - this[kResume] = null + // handle partial block + var partialBytes = (this.blockSize - inputLength) % this.blockSize; + if(partialBytes > 0) { + partialBytes = this.blockSize - partialBytes; } - _read () { - const { [kResume]: resume } = this + // XOR input with output + this._partialOutput.clear(); + for(var i = 0; i < this._ints; ++i) { + this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); + } - if (resume) { - this[kResume] = null - resume() + if(partialBytes > 0) { + // block still incomplete, restore input buffer + input.read -= this.blockSize; + } else { + // block complete, update input block + for(var i = 0; i < this._ints; ++i) { + this._inBlock[i] = this._outBlock[i]; } } - _destroy (err, callback) { - this._read() - - callback(err) + // skip any previous partial bytes + if(this._partialBytes > 0) { + this._partialOutput.getBytes(this._partialBytes); } -} -class PipelineResponse extends Readable { - constructor (resume) { - super({ autoDestroy: true }) - this[kResume] = resume + if(partialBytes > 0 && !finish) { + output.putBytes(this._partialOutput.getBytes( + partialBytes - this._partialBytes)); + this._partialBytes = partialBytes; + return true; } - _read () { - this[kResume]() - } + output.putBytes(this._partialOutput.getBytes( + inputLength - this._partialBytes)); + this._partialBytes = 0; +}; - _destroy (err, callback) { - if (!err && !this._readableState.endEmitted) { - err = new RequestAbortedError() - } +modes.ofb.prototype.decrypt = modes.ofb.prototype.encrypt; - callback(err) +/** Counter (CTR) **/ + +modes.ctr = function(options) { + options = options || {}; + this.name = 'CTR'; + this.cipher = options.cipher; + this.blockSize = options.blockSize || 16; + this._ints = this.blockSize / 4; + this._inBlock = null; + this._outBlock = new Array(this._ints); + this._partialOutput = forge.util.createBuffer(); + this._partialBytes = 0; +}; + +modes.ctr.prototype.start = function(options) { + if(!('iv' in options)) { + throw new Error('Invalid IV parameter.'); } -} + // use IV as first input + this._iv = transformIV(options.iv, this.blockSize); + this._inBlock = this._iv.slice(0); + this._partialBytes = 0; +}; -class PipelineHandler extends AsyncResource { - constructor (opts, handler) { - if (!opts || typeof opts !== 'object') { - throw new InvalidArgumentError('invalid opts') - } +modes.ctr.prototype.encrypt = function(input, output, finish) { + // not enough input to encrypt + var inputLength = input.length(); + if(inputLength === 0) { + return true; + } - if (typeof handler !== 'function') { - throw new InvalidArgumentError('invalid handler') - } + // encrypt block (CTR always uses encryption mode) + this.cipher.encrypt(this._inBlock, this._outBlock); - const { signal, method, opaque, onInfo, responseHeaders } = opts + // handle full block + if(this._partialBytes === 0 && inputLength >= this.blockSize) { + // XOR input with output + for(var i = 0; i < this._ints; ++i) { + output.putInt32(input.getInt32() ^ this._outBlock[i]); + } + } else { + // handle partial block + var partialBytes = (this.blockSize - inputLength) % this.blockSize; + if(partialBytes > 0) { + partialBytes = this.blockSize - partialBytes; + } - if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { - throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + // XOR input with output + this._partialOutput.clear(); + for(var i = 0; i < this._ints; ++i) { + this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); } - if (method === 'CONNECT') { - throw new InvalidArgumentError('invalid method') + if(partialBytes > 0) { + // block still incomplete, restore input buffer + input.read -= this.blockSize; } - if (onInfo && typeof onInfo !== 'function') { - throw new InvalidArgumentError('invalid onInfo callback') + // skip any previous partial bytes + if(this._partialBytes > 0) { + this._partialOutput.getBytes(this._partialBytes); } - super('UNDICI_PIPELINE') + if(partialBytes > 0 && !finish) { + output.putBytes(this._partialOutput.getBytes( + partialBytes - this._partialBytes)); + this._partialBytes = partialBytes; + return true; + } - this.opaque = opaque || null - this.responseHeaders = responseHeaders || null - this.handler = handler - this.abort = null - this.context = null - this.onInfo = onInfo || null + output.putBytes(this._partialOutput.getBytes( + inputLength - this._partialBytes)); + this._partialBytes = 0; + } - this.req = new PipelineRequest().on('error', util.nop) + // block complete, increment counter (input block) + inc32(this._inBlock); +}; - this.ret = new Duplex({ - readableObjectMode: opts.objectMode, - autoDestroy: true, - read: () => { - const { body } = this +modes.ctr.prototype.decrypt = modes.ctr.prototype.encrypt; - if (body && body.resume) { - body.resume() - } - }, - write: (chunk, encoding, callback) => { - const { req } = this +/** Galois/Counter Mode (GCM) **/ - if (req.push(chunk, encoding) || req._readableState.destroyed) { - callback() - } else { - req[kResume] = callback - } - }, - destroy: (err, callback) => { - const { body, req, res, ret, abort } = this +modes.gcm = function(options) { + options = options || {}; + this.name = 'GCM'; + this.cipher = options.cipher; + this.blockSize = options.blockSize || 16; + this._ints = this.blockSize / 4; + this._inBlock = new Array(this._ints); + this._outBlock = new Array(this._ints); + this._partialOutput = forge.util.createBuffer(); + this._partialBytes = 0; - if (!err && !ret._readableState.endEmitted) { - err = new RequestAbortedError() - } + // R is actually this value concatenated with 120 more zero bits, but + // we only XOR against R so the other zeros have no effect -- we just + // apply this value to the first integer in a block + this._R = 0xE1000000; +}; - if (abort && err) { - abort() - } +modes.gcm.prototype.start = function(options) { + if(!('iv' in options)) { + throw new Error('Invalid IV parameter.'); + } + // ensure IV is a byte buffer + var iv = forge.util.createBuffer(options.iv); - util.destroy(body, err) - util.destroy(req, err) - util.destroy(res, err) + // no ciphered data processed yet + this._cipherLength = 0; - removeSignal(this) + // default additional data is none + var additionalData; + if('additionalData' in options) { + additionalData = forge.util.createBuffer(options.additionalData); + } else { + additionalData = forge.util.createBuffer(); + } - callback(err) - } - }).on('prefinish', () => { - const { req } = this + // default tag length is 128 bits + if('tagLength' in options) { + this._tagLength = options.tagLength; + } else { + this._tagLength = 128; + } - // Node < 15 does not call _final in same tick. - req.push(null) - }) + // if tag is given, ensure tag matches tag length + this._tag = null; + if(options.decrypt) { + // save tag to check later + this._tag = forge.util.createBuffer(options.tag).getBytes(); + if(this._tag.length !== (this._tagLength / 8)) { + throw new Error('Authentication tag does not match tag length.'); + } + } - this.res = null + // create tmp storage for hash calculation + this._hashBlock = new Array(this._ints); - addSignal(this, signal) - } + // no tag generated yet + this.tag = null; - onConnect (abort, context) { - const { ret, res } = this + // generate hash subkey + // (apply block cipher to "zero" block) + this._hashSubkey = new Array(this._ints); + this.cipher.encrypt([0, 0, 0, 0], this._hashSubkey); - assert(!res, 'pipeline cannot be retried') + // generate table M + // use 4-bit tables (32 component decomposition of a 16 byte value) + // 8-bit tables take more space and are known to have security + // vulnerabilities (in native implementations) + this.componentBits = 4; + this._m = this.generateHashTable(this._hashSubkey, this.componentBits); - if (ret.destroyed) { - throw new RequestAbortedError() + // Note: support IV length different from 96 bits? (only supporting + // 96 bits is recommended by NIST SP-800-38D) + // generate J_0 + var ivLength = iv.length(); + if(ivLength === 12) { + // 96-bit IV + this._j0 = [iv.getInt32(), iv.getInt32(), iv.getInt32(), 1]; + } else { + // IV is NOT 96-bits + this._j0 = [0, 0, 0, 0]; + while(iv.length() > 0) { + this._j0 = this.ghash( + this._hashSubkey, this._j0, + [iv.getInt32(), iv.getInt32(), iv.getInt32(), iv.getInt32()]); } + this._j0 = this.ghash( + this._hashSubkey, this._j0, [0, 0].concat(from64To32(ivLength * 8))); + } - this.abort = abort - this.context = context + // generate ICB (initial counter block) + this._inBlock = this._j0.slice(0); + inc32(this._inBlock); + this._partialBytes = 0; + + // consume authentication data + additionalData = forge.util.createBuffer(additionalData); + // save additional data length as a BE 64-bit number + this._aDataLength = from64To32(additionalData.length() * 8); + // pad additional data to 128 bit (16 byte) block size + var overflow = additionalData.length() % this.blockSize; + if(overflow) { + additionalData.fillWithByte(0, this.blockSize - overflow); + } + this._s = [0, 0, 0, 0]; + while(additionalData.length() > 0) { + this._s = this.ghash(this._hashSubkey, this._s, [ + additionalData.getInt32(), + additionalData.getInt32(), + additionalData.getInt32(), + additionalData.getInt32() + ]); } +}; - onHeaders (statusCode, rawHeaders, resume) { - const { opaque, handler, context } = this +modes.gcm.prototype.encrypt = function(input, output, finish) { + // not enough input to encrypt + var inputLength = input.length(); + if(inputLength === 0) { + return true; + } - if (statusCode < 200) { - if (this.onInfo) { - const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) - this.onInfo({ statusCode, headers }) - } - return - } + // encrypt block + this.cipher.encrypt(this._inBlock, this._outBlock); - this.res = new PipelineResponse(resume) + // handle full block + if(this._partialBytes === 0 && inputLength >= this.blockSize) { + // XOR input with output + for(var i = 0; i < this._ints; ++i) { + output.putInt32(this._outBlock[i] ^= input.getInt32()); + } + this._cipherLength += this.blockSize; + } else { + // handle partial block + var partialBytes = (this.blockSize - inputLength) % this.blockSize; + if(partialBytes > 0) { + partialBytes = this.blockSize - partialBytes; + } - let body - try { - this.handler = null - const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) - body = this.runInAsyncScope(handler, null, { - statusCode, - headers, - opaque, - body: this.res, - context - }) - } catch (err) { - this.res.on('error', util.nop) - throw err + // XOR input with output + this._partialOutput.clear(); + for(var i = 0; i < this._ints; ++i) { + this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); } - if (!body || typeof body.on !== 'function') { - throw new InvalidReturnValueError('expected Readable') + if(partialBytes <= 0 || finish) { + // handle overflow prior to hashing + if(finish) { + // get block overflow + var overflow = inputLength % this.blockSize; + this._cipherLength += overflow; + // truncate for hash function + this._partialOutput.truncate(this.blockSize - overflow); + } else { + this._cipherLength += this.blockSize; + } + + // get output block for hashing + for(var i = 0; i < this._ints; ++i) { + this._outBlock[i] = this._partialOutput.getInt32(); + } + this._partialOutput.read -= this.blockSize; } - body - .on('data', (chunk) => { - const { ret, body } = this + // skip any previous partial bytes + if(this._partialBytes > 0) { + this._partialOutput.getBytes(this._partialBytes); + } - if (!ret.push(chunk) && body.pause) { - body.pause() - } - }) - .on('error', (err) => { - const { ret } = this + if(partialBytes > 0 && !finish) { + // block still incomplete, restore input buffer, get partial output, + // and return early + input.read -= this.blockSize; + output.putBytes(this._partialOutput.getBytes( + partialBytes - this._partialBytes)); + this._partialBytes = partialBytes; + return true; + } - util.destroy(ret, err) - }) - .on('end', () => { - const { ret } = this + output.putBytes(this._partialOutput.getBytes( + inputLength - this._partialBytes)); + this._partialBytes = 0; + } - ret.push(null) - }) - .on('close', () => { - const { ret } = this + // update hash block S + this._s = this.ghash(this._hashSubkey, this._s, this._outBlock); - if (!ret._readableState.ended) { - util.destroy(ret, new RequestAbortedError()) - } - }) + // increment counter (input block) + inc32(this._inBlock); +}; - this.body = body +modes.gcm.prototype.decrypt = function(input, output, finish) { + // not enough input to decrypt + var inputLength = input.length(); + if(inputLength < this.blockSize && !(finish && inputLength > 0)) { + return true; } - onData (chunk) { - const { res } = this - return res.push(chunk) - } + // encrypt block (GCM always uses encryption mode) + this.cipher.encrypt(this._inBlock, this._outBlock); - onComplete (trailers) { - const { res } = this - res.push(null) - } + // increment counter (input block) + inc32(this._inBlock); - onError (err) { - const { ret } = this - this.handler = null - util.destroy(ret, err) - } -} + // update hash block S + this._hashBlock[0] = input.getInt32(); + this._hashBlock[1] = input.getInt32(); + this._hashBlock[2] = input.getInt32(); + this._hashBlock[3] = input.getInt32(); + this._s = this.ghash(this._hashSubkey, this._s, this._hashBlock); -function pipeline (opts, handler) { - try { - const pipelineHandler = new PipelineHandler(opts, handler) - this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler) - return pipelineHandler.ret - } catch (err) { - return new PassThrough().destroy(err) + // XOR hash input with output + for(var i = 0; i < this._ints; ++i) { + output.putInt32(this._outBlock[i] ^ this._hashBlock[i]); } -} -module.exports = pipeline + // increment cipher data length + if(inputLength < this.blockSize) { + this._cipherLength += inputLength % this.blockSize; + } else { + this._cipherLength += this.blockSize; + } +}; +modes.gcm.prototype.afterFinish = function(output, options) { + var rval = true; -/***/ }), + // handle overflow + if(options.decrypt && options.overflow) { + output.truncate(this.blockSize - options.overflow); + } -/***/ 66945: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // handle authentication tag + this.tag = forge.util.createBuffer(); + // concatenate additional data length with cipher length + var lengths = this._aDataLength.concat(from64To32(this._cipherLength * 8)); + // include lengths in hash + this._s = this.ghash(this._hashSubkey, this._s, lengths); -const Readable = __nccwpck_require__(7601) -const { - InvalidArgumentError, - RequestAbortedError -} = __nccwpck_require__(46339) -const util = __nccwpck_require__(67468) -const { getResolveErrorBodyCallback } = __nccwpck_require__(2977) -const { AsyncResource } = __nccwpck_require__(50852) -const { addSignal, removeSignal } = __nccwpck_require__(6242) + // do GCTR(J_0, S) + var tag = []; + this.cipher.encrypt(this._j0, tag); + for(var i = 0; i < this._ints; ++i) { + this.tag.putInt32(this._s[i] ^ tag[i]); + } -class RequestHandler extends AsyncResource { - constructor (opts, callback) { - if (!opts || typeof opts !== 'object') { - throw new InvalidArgumentError('invalid opts') - } + // trim tag to length + this.tag.truncate(this.tag.length() % (this._tagLength / 8)); - const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts + // check authentication tag + if(options.decrypt && this.tag.bytes() !== this._tag) { + rval = false; + } - try { - if (typeof callback !== 'function') { - throw new InvalidArgumentError('invalid callback') - } + return rval; +}; - if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) { - throw new InvalidArgumentError('invalid highWaterMark') - } +/** + * See NIST SP-800-38D 6.3 (Algorithm 1). This function performs Galois + * field multiplication. The field, GF(2^128), is defined by the polynomial: + * + * x^128 + x^7 + x^2 + x + 1 + * + * Which is represented in little-endian binary form as: 11100001 (0xe1). When + * the value of a coefficient is 1, a bit is set. The value R, is the + * concatenation of this value and 120 zero bits, yielding a 128-bit value + * which matches the block size. + * + * This function will multiply two elements (vectors of bytes), X and Y, in + * the field GF(2^128). The result is initialized to zero. For each bit of + * X (out of 128), x_i, if x_i is set, then the result is multiplied (XOR'd) + * by the current value of Y. For each bit, the value of Y will be raised by + * a power of x (multiplied by the polynomial x). This can be achieved by + * shifting Y once to the right. If the current value of Y, prior to being + * multiplied by x, has 0 as its LSB, then it is a 127th degree polynomial. + * Otherwise, we must divide by R after shifting to find the remainder. + * + * @param x the first block to multiply by the second. + * @param y the second block to multiply by the first. + * + * @return the block result of the multiplication. + */ +modes.gcm.prototype.multiply = function(x, y) { + var z_i = [0, 0, 0, 0]; + var v_i = y.slice(0); - if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { - throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') - } + // calculate Z_128 (block has 128 bits) + for(var i = 0; i < 128; ++i) { + // if x_i is 0, Z_{i+1} = Z_i (unchanged) + // else Z_{i+1} = Z_i ^ V_i + // get x_i by finding 32-bit int position, then left shift 1 by remainder + var x_i = x[(i / 32) | 0] & (1 << (31 - i % 32)); + if(x_i) { + z_i[0] ^= v_i[0]; + z_i[1] ^= v_i[1]; + z_i[2] ^= v_i[2]; + z_i[3] ^= v_i[3]; + } - if (method === 'CONNECT') { - throw new InvalidArgumentError('invalid method') - } + // if LSB(V_i) is 1, V_i = V_i >> 1 + // else V_i = (V_i >> 1) ^ R + this.pow(v_i, v_i); + } - if (onInfo && typeof onInfo !== 'function') { - throw new InvalidArgumentError('invalid onInfo callback') - } + return z_i; +}; - super('UNDICI_REQUEST') - } catch (err) { - if (util.isStream(body)) { - util.destroy(body.on('error', util.nop), err) - } - throw err - } +modes.gcm.prototype.pow = function(x, out) { + // if LSB(x) is 1, x = x >>> 1 + // else x = (x >>> 1) ^ R + var lsb = x[3] & 1; - this.responseHeaders = responseHeaders || null - this.opaque = opaque || null - this.callback = callback - this.res = null - this.abort = null - this.body = body - this.trailers = {} - this.context = null - this.onInfo = onInfo || null - this.throwOnError = throwOnError - this.highWaterMark = highWaterMark + // always do x >>> 1: + // starting with the rightmost integer, shift each integer to the right + // one bit, pulling in the bit from the integer to the left as its top + // most bit (do this for the last 3 integers) + for(var i = 3; i > 0; --i) { + out[i] = (x[i] >>> 1) | ((x[i - 1] & 1) << 31); + } + // shift the first integer normally + out[0] = x[0] >>> 1; - if (util.isStream(body)) { - body.on('error', (err) => { - this.onError(err) - }) - } + // if lsb was not set, then polynomial had a degree of 127 and doesn't + // need to divided; otherwise, XOR with R to find the remainder; we only + // need to XOR the first integer since R technically ends w/120 zero bits + if(lsb) { + out[0] ^= this._R; + } +}; - addSignal(this, signal) +modes.gcm.prototype.tableMultiply = function(x) { + // assumes 4-bit tables are used + var z = [0, 0, 0, 0]; + for(var i = 0; i < 32; ++i) { + var idx = (i / 8) | 0; + var x_i = (x[idx] >>> ((7 - (i % 8)) * 4)) & 0xF; + var ah = this._m[i][x_i]; + z[0] ^= ah[0]; + z[1] ^= ah[1]; + z[2] ^= ah[2]; + z[3] ^= ah[3]; } + return z; +}; - onConnect (abort, context) { - if (!this.callback) { - throw new RequestAbortedError() - } +/** + * A continuing version of the GHASH algorithm that operates on a single + * block. The hash block, last hash value (Ym) and the new block to hash + * are given. + * + * @param h the hash block. + * @param y the previous value for Ym, use [0, 0, 0, 0] for a new hash. + * @param x the block to hash. + * + * @return the hashed value (Ym). + */ +modes.gcm.prototype.ghash = function(h, y, x) { + y[0] ^= x[0]; + y[1] ^= x[1]; + y[2] ^= x[2]; + y[3] ^= x[3]; + return this.tableMultiply(y); + //return this.multiply(y, h); +}; - this.abort = abort - this.context = context +/** + * Precomputes a table for multiplying against the hash subkey. This + * mechanism provides a substantial speed increase over multiplication + * performed without a table. The table-based multiplication this table is + * for solves X * H by multiplying each component of X by H and then + * composing the results together using XOR. + * + * This function can be used to generate tables with different bit sizes + * for the components, however, this implementation assumes there are + * 32 components of X (which is a 16 byte vector), therefore each component + * takes 4-bits (so the table is constructed with bits=4). + * + * @param h the hash subkey. + * @param bits the bit size for a component. + */ +modes.gcm.prototype.generateHashTable = function(h, bits) { + // TODO: There are further optimizations that would use only the + // first table M_0 (or some variant) along with a remainder table; + // this can be explored in the future + var multiplier = 8 / bits; + var perInt = 4 * multiplier; + var size = 16 * multiplier; + var m = new Array(size); + for(var i = 0; i < size; ++i) { + var tmp = [0, 0, 0, 0]; + var idx = (i / perInt) | 0; + var shft = ((perInt - 1 - (i % perInt)) * bits); + tmp[idx] = (1 << (bits - 1)) << shft; + m[i] = this.generateSubHashTable(this.multiply(tmp, h), bits); } + return m; +}; - onHeaders (statusCode, rawHeaders, resume, statusMessage) { - const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this - - const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) - - if (statusCode < 200) { - if (this.onInfo) { - this.onInfo({ statusCode, headers }) - } - return - } - - const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers - const contentType = parsedHeaders['content-type'] - const body = new Readable({ resume, abort, contentType, highWaterMark }) - - this.callback = null - this.res = body - if (callback !== null) { - if (this.throwOnError && statusCode >= 400) { - this.runInAsyncScope(getResolveErrorBodyCallback, null, - { callback, body, contentType, statusCode, statusMessage, headers } - ) - } else { - this.runInAsyncScope(callback, null, null, { - statusCode, - headers, - trailers: this.trailers, - opaque, - body, - context - }) - } +/** + * Generates a table for multiplying against the hash subkey for one + * particular component (out of all possible component values). + * + * @param mid the pre-multiplied value for the middle key of the table. + * @param bits the bit size for a component. + */ +modes.gcm.prototype.generateSubHashTable = function(mid, bits) { + // compute the table quickly by minimizing the number of + // POW operations -- they only need to be performed for powers of 2, + // all other entries can be composed from those powers using XOR + var size = 1 << bits; + var half = size >>> 1; + var m = new Array(size); + m[half] = mid.slice(0); + var i = half >>> 1; + while(i > 0) { + // raise m0[2 * i] and store in m0[i] + this.pow(m[2 * i], m[i] = []); + i >>= 1; + } + i = 2; + while(i < half) { + for(var j = 1; j < i; ++j) { + var m_i = m[i]; + var m_j = m[j]; + m[i + j] = [ + m_i[0] ^ m_j[0], + m_i[1] ^ m_j[1], + m_i[2] ^ m_j[2], + m_i[3] ^ m_j[3] + ]; } + i *= 2; } - - onData (chunk) { - const { res } = this - return res.push(chunk) + m[0] = [0, 0, 0, 0]; + /* Note: We could avoid storing these by doing composition during multiply + calculate top half using composition by speed is preferred. */ + for(i = half + 1; i < size; ++i) { + var c = m[i ^ half]; + m[i] = [mid[0] ^ c[0], mid[1] ^ c[1], mid[2] ^ c[2], mid[3] ^ c[3]]; } + return m; +}; - onComplete (trailers) { - const { res } = this - - removeSignal(this) - - util.parseHeaders(trailers, this.trailers) +/** Utility functions */ - res.push(null) +function transformIV(iv, blockSize) { + if(typeof iv === 'string') { + // convert iv string into byte buffer + iv = forge.util.createBuffer(iv); } - onError (err) { - const { res, callback, body, opaque } = this - - removeSignal(this) - - if (callback) { - // TODO: Does this need queueMicrotask? - this.callback = null - queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }) - }) - } - - if (res) { - this.res = null - // Ensure all queued handlers are invoked before destroying res. - queueMicrotask(() => { - util.destroy(res, err) - }) - } - - if (body) { - this.body = null - util.destroy(body, err) + if(forge.util.isArray(iv) && iv.length > 4) { + // convert iv byte array into byte buffer + var tmp = iv; + iv = forge.util.createBuffer(); + for(var i = 0; i < tmp.length; ++i) { + iv.putByte(tmp[i]); } } -} -function request (opts, callback) { - if (callback === undefined) { - return new Promise((resolve, reject) => { - request.call(this, opts, (err, data) => { - return err ? reject(err) : resolve(data) - }) - }) + if(iv.length() < blockSize) { + throw new Error( + 'Invalid IV length; got ' + iv.length() + + ' bytes and expected ' + blockSize + ' bytes.'); } - try { - this.dispatch(opts, new RequestHandler(opts, callback)) - } catch (err) { - if (typeof callback !== 'function') { - throw err + if(!forge.util.isArray(iv)) { + // convert iv byte buffer into 32-bit integer array + var ints = []; + var blocks = blockSize / 4; + for(var i = 0; i < blocks; ++i) { + ints.push(iv.getInt32()); } - const opaque = opts && opts.opaque - queueMicrotask(() => callback(err, { opaque })) + iv = ints; } + + return iv; } -module.exports = request -module.exports.RequestHandler = RequestHandler +function inc32(block) { + // increment last 32 bits of block only + block[block.length - 1] = (block[block.length - 1] + 1) & 0xFFFFFFFF; +} + +function from64To32(num) { + // convert 64-bit number to two BE Int32s + return [(num / 0x100000000) | 0, num & 0xFFFFFFFF]; +} /***/ }), -/***/ 42849: +/***/ 19023: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * DES (Data Encryption Standard) implementation. + * + * This implementation supports DES as well as 3DES-EDE in ECB and CBC mode. + * It is based on the BSD-licensed implementation by Paul Tero: + * + * Paul Tero, July 2001 + * http://www.tero.co.uk/des/ + * + * Optimised for performance with large blocks by + * Michael Hayworth, November 2001 + * http://www.netdealing.com + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @author Stefan Siegl + * @author Dave Longley + * + * Copyright (c) 2012 Stefan Siegl + * Copyright (c) 2012-2014 Digital Bazaar, Inc. + */ +var forge = __nccwpck_require__(56389); +__nccwpck_require__(7329); +__nccwpck_require__(33975); +__nccwpck_require__(65138); +/* DES API */ +module.exports = forge.des = forge.des || {}; -const { finished, PassThrough } = __nccwpck_require__(12781) -const { - InvalidArgumentError, - InvalidReturnValueError, - RequestAbortedError -} = __nccwpck_require__(46339) -const util = __nccwpck_require__(67468) -const { getResolveErrorBodyCallback } = __nccwpck_require__(2977) -const { AsyncResource } = __nccwpck_require__(50852) -const { addSignal, removeSignal } = __nccwpck_require__(6242) - -class StreamHandler extends AsyncResource { - constructor (opts, factory, callback) { - if (!opts || typeof opts !== 'object') { - throw new InvalidArgumentError('invalid opts') - } - - const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts +/** + * Deprecated. Instead, use: + * + * var cipher = forge.cipher.createCipher('DES-', key); + * cipher.start({iv: iv}); + * + * Creates an DES cipher object to encrypt data using the given symmetric key. + * The output will be stored in the 'output' member of the returned cipher. + * + * The key and iv may be given as binary-encoded strings of bytes or + * byte buffers. + * + * @param key the symmetric key to use (64 or 192 bits). + * @param iv the initialization vector to use. + * @param output the buffer to write to, null to create one. + * @param mode the cipher mode to use (default: 'CBC' if IV is + * given, 'ECB' if null). + * + * @return the cipher. + */ +forge.des.startEncrypting = function(key, iv, output, mode) { + var cipher = _createCipher({ + key: key, + output: output, + decrypt: false, + mode: mode || (iv === null ? 'ECB' : 'CBC') + }); + cipher.start(iv); + return cipher; +}; - try { - if (typeof callback !== 'function') { - throw new InvalidArgumentError('invalid callback') - } +/** + * Deprecated. Instead, use: + * + * var cipher = forge.cipher.createCipher('DES-', key); + * + * Creates an DES cipher object to encrypt data using the given symmetric key. + * + * The key may be given as a binary-encoded string of bytes or a byte buffer. + * + * @param key the symmetric key to use (64 or 192 bits). + * @param mode the cipher mode to use (default: 'CBC'). + * + * @return the cipher. + */ +forge.des.createEncryptionCipher = function(key, mode) { + return _createCipher({ + key: key, + output: null, + decrypt: false, + mode: mode + }); +}; - if (typeof factory !== 'function') { - throw new InvalidArgumentError('invalid factory') - } +/** + * Deprecated. Instead, use: + * + * var decipher = forge.cipher.createDecipher('DES-', key); + * decipher.start({iv: iv}); + * + * Creates an DES cipher object to decrypt data using the given symmetric key. + * The output will be stored in the 'output' member of the returned cipher. + * + * The key and iv may be given as binary-encoded strings of bytes or + * byte buffers. + * + * @param key the symmetric key to use (64 or 192 bits). + * @param iv the initialization vector to use. + * @param output the buffer to write to, null to create one. + * @param mode the cipher mode to use (default: 'CBC' if IV is + * given, 'ECB' if null). + * + * @return the cipher. + */ +forge.des.startDecrypting = function(key, iv, output, mode) { + var cipher = _createCipher({ + key: key, + output: output, + decrypt: true, + mode: mode || (iv === null ? 'ECB' : 'CBC') + }); + cipher.start(iv); + return cipher; +}; - if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { - throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') - } +/** + * Deprecated. Instead, use: + * + * var decipher = forge.cipher.createDecipher('DES-', key); + * + * Creates an DES cipher object to decrypt data using the given symmetric key. + * + * The key may be given as a binary-encoded string of bytes or a byte buffer. + * + * @param key the symmetric key to use (64 or 192 bits). + * @param mode the cipher mode to use (default: 'CBC'). + * + * @return the cipher. + */ +forge.des.createDecryptionCipher = function(key, mode) { + return _createCipher({ + key: key, + output: null, + decrypt: true, + mode: mode + }); +}; - if (method === 'CONNECT') { - throw new InvalidArgumentError('invalid method') +/** + * Creates a new DES cipher algorithm object. + * + * @param name the name of the algorithm. + * @param mode the mode factory function. + * + * @return the DES algorithm object. + */ +forge.des.Algorithm = function(name, mode) { + var self = this; + self.name = name; + self.mode = new mode({ + blockSize: 8, + cipher: { + encrypt: function(inBlock, outBlock) { + return _updateBlock(self._keys, inBlock, outBlock, false); + }, + decrypt: function(inBlock, outBlock) { + return _updateBlock(self._keys, inBlock, outBlock, true); } + } + }); + self._init = false; +}; - if (onInfo && typeof onInfo !== 'function') { - throw new InvalidArgumentError('invalid onInfo callback') - } +/** + * Initializes this DES algorithm by expanding its key. + * + * @param options the options to use. + * key the key to use with this algorithm. + * decrypt true if the algorithm should be initialized for decryption, + * false for encryption. + */ +forge.des.Algorithm.prototype.initialize = function(options) { + if(this._init) { + return; + } - super('UNDICI_STREAM') - } catch (err) { - if (util.isStream(body)) { - util.destroy(body.on('error', util.nop), err) - } - throw err + var key = forge.util.createBuffer(options.key); + if(this.name.indexOf('3DES') === 0) { + if(key.length() !== 24) { + throw new Error('Invalid Triple-DES key size: ' + key.length() * 8); } + } - this.responseHeaders = responseHeaders || null - this.opaque = opaque || null - this.factory = factory - this.callback = callback - this.res = null - this.abort = null - this.context = null - this.trailers = null - this.body = body - this.onInfo = onInfo || null - this.throwOnError = throwOnError || false + // do key expansion to 16 or 48 subkeys (single or triple DES) + this._keys = _createKeys(key); + this._init = true; +}; - if (util.isStream(body)) { - body.on('error', (err) => { - this.onError(err) - }) - } +/** Register DES algorithms **/ - addSignal(this, signal) - } +registerAlgorithm('DES-ECB', forge.cipher.modes.ecb); +registerAlgorithm('DES-CBC', forge.cipher.modes.cbc); +registerAlgorithm('DES-CFB', forge.cipher.modes.cfb); +registerAlgorithm('DES-OFB', forge.cipher.modes.ofb); +registerAlgorithm('DES-CTR', forge.cipher.modes.ctr); - onConnect (abort, context) { - if (!this.callback) { - throw new RequestAbortedError() - } +registerAlgorithm('3DES-ECB', forge.cipher.modes.ecb); +registerAlgorithm('3DES-CBC', forge.cipher.modes.cbc); +registerAlgorithm('3DES-CFB', forge.cipher.modes.cfb); +registerAlgorithm('3DES-OFB', forge.cipher.modes.ofb); +registerAlgorithm('3DES-CTR', forge.cipher.modes.ctr); - this.abort = abort - this.context = context - } +function registerAlgorithm(name, mode) { + var factory = function() { + return new forge.des.Algorithm(name, mode); + }; + forge.cipher.registerAlgorithm(name, factory); +} - onHeaders (statusCode, rawHeaders, resume, statusMessage) { - const { factory, opaque, context, callback, responseHeaders } = this +/** DES implementation **/ - const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) +var spfunction1 = [0x1010400,0,0x10000,0x1010404,0x1010004,0x10404,0x4,0x10000,0x400,0x1010400,0x1010404,0x400,0x1000404,0x1010004,0x1000000,0x4,0x404,0x1000400,0x1000400,0x10400,0x10400,0x1010000,0x1010000,0x1000404,0x10004,0x1000004,0x1000004,0x10004,0,0x404,0x10404,0x1000000,0x10000,0x1010404,0x4,0x1010000,0x1010400,0x1000000,0x1000000,0x400,0x1010004,0x10000,0x10400,0x1000004,0x400,0x4,0x1000404,0x10404,0x1010404,0x10004,0x1010000,0x1000404,0x1000004,0x404,0x10404,0x1010400,0x404,0x1000400,0x1000400,0,0x10004,0x10400,0,0x1010004]; +var spfunction2 = [-0x7fef7fe0,-0x7fff8000,0x8000,0x108020,0x100000,0x20,-0x7fefffe0,-0x7fff7fe0,-0x7fffffe0,-0x7fef7fe0,-0x7fef8000,-0x80000000,-0x7fff8000,0x100000,0x20,-0x7fefffe0,0x108000,0x100020,-0x7fff7fe0,0,-0x80000000,0x8000,0x108020,-0x7ff00000,0x100020,-0x7fffffe0,0,0x108000,0x8020,-0x7fef8000,-0x7ff00000,0x8020,0,0x108020,-0x7fefffe0,0x100000,-0x7fff7fe0,-0x7ff00000,-0x7fef8000,0x8000,-0x7ff00000,-0x7fff8000,0x20,-0x7fef7fe0,0x108020,0x20,0x8000,-0x80000000,0x8020,-0x7fef8000,0x100000,-0x7fffffe0,0x100020,-0x7fff7fe0,-0x7fffffe0,0x100020,0x108000,0,-0x7fff8000,0x8020,-0x80000000,-0x7fefffe0,-0x7fef7fe0,0x108000]; +var spfunction3 = [0x208,0x8020200,0,0x8020008,0x8000200,0,0x20208,0x8000200,0x20008,0x8000008,0x8000008,0x20000,0x8020208,0x20008,0x8020000,0x208,0x8000000,0x8,0x8020200,0x200,0x20200,0x8020000,0x8020008,0x20208,0x8000208,0x20200,0x20000,0x8000208,0x8,0x8020208,0x200,0x8000000,0x8020200,0x8000000,0x20008,0x208,0x20000,0x8020200,0x8000200,0,0x200,0x20008,0x8020208,0x8000200,0x8000008,0x200,0,0x8020008,0x8000208,0x20000,0x8000000,0x8020208,0x8,0x20208,0x20200,0x8000008,0x8020000,0x8000208,0x208,0x8020000,0x20208,0x8,0x8020008,0x20200]; +var spfunction4 = [0x802001,0x2081,0x2081,0x80,0x802080,0x800081,0x800001,0x2001,0,0x802000,0x802000,0x802081,0x81,0,0x800080,0x800001,0x1,0x2000,0x800000,0x802001,0x80,0x800000,0x2001,0x2080,0x800081,0x1,0x2080,0x800080,0x2000,0x802080,0x802081,0x81,0x800080,0x800001,0x802000,0x802081,0x81,0,0,0x802000,0x2080,0x800080,0x800081,0x1,0x802001,0x2081,0x2081,0x80,0x802081,0x81,0x1,0x2000,0x800001,0x2001,0x802080,0x800081,0x2001,0x2080,0x800000,0x802001,0x80,0x800000,0x2000,0x802080]; +var spfunction5 = [0x100,0x2080100,0x2080000,0x42000100,0x80000,0x100,0x40000000,0x2080000,0x40080100,0x80000,0x2000100,0x40080100,0x42000100,0x42080000,0x80100,0x40000000,0x2000000,0x40080000,0x40080000,0,0x40000100,0x42080100,0x42080100,0x2000100,0x42080000,0x40000100,0,0x42000000,0x2080100,0x2000000,0x42000000,0x80100,0x80000,0x42000100,0x100,0x2000000,0x40000000,0x2080000,0x42000100,0x40080100,0x2000100,0x40000000,0x42080000,0x2080100,0x40080100,0x100,0x2000000,0x42080000,0x42080100,0x80100,0x42000000,0x42080100,0x2080000,0,0x40080000,0x42000000,0x80100,0x2000100,0x40000100,0x80000,0,0x40080000,0x2080100,0x40000100]; +var spfunction6 = [0x20000010,0x20400000,0x4000,0x20404010,0x20400000,0x10,0x20404010,0x400000,0x20004000,0x404010,0x400000,0x20000010,0x400010,0x20004000,0x20000000,0x4010,0,0x400010,0x20004010,0x4000,0x404000,0x20004010,0x10,0x20400010,0x20400010,0,0x404010,0x20404000,0x4010,0x404000,0x20404000,0x20000000,0x20004000,0x10,0x20400010,0x404000,0x20404010,0x400000,0x4010,0x20000010,0x400000,0x20004000,0x20000000,0x4010,0x20000010,0x20404010,0x404000,0x20400000,0x404010,0x20404000,0,0x20400010,0x10,0x4000,0x20400000,0x404010,0x4000,0x400010,0x20004010,0,0x20404000,0x20000000,0x400010,0x20004010]; +var spfunction7 = [0x200000,0x4200002,0x4000802,0,0x800,0x4000802,0x200802,0x4200800,0x4200802,0x200000,0,0x4000002,0x2,0x4000000,0x4200002,0x802,0x4000800,0x200802,0x200002,0x4000800,0x4000002,0x4200000,0x4200800,0x200002,0x4200000,0x800,0x802,0x4200802,0x200800,0x2,0x4000000,0x200800,0x4000000,0x200800,0x200000,0x4000802,0x4000802,0x4200002,0x4200002,0x2,0x200002,0x4000000,0x4000800,0x200000,0x4200800,0x802,0x200802,0x4200800,0x802,0x4000002,0x4200802,0x4200000,0x200800,0,0x2,0x4200802,0,0x200802,0x4200000,0x800,0x4000002,0x4000800,0x800,0x200002]; +var spfunction8 = [0x10001040,0x1000,0x40000,0x10041040,0x10000000,0x10001040,0x40,0x10000000,0x40040,0x10040000,0x10041040,0x41000,0x10041000,0x41040,0x1000,0x40,0x10040000,0x10000040,0x10001000,0x1040,0x41000,0x40040,0x10040040,0x10041000,0x1040,0,0,0x10040040,0x10000040,0x10001000,0x41040,0x40000,0x41040,0x40000,0x10041000,0x1000,0x40,0x10040040,0x1000,0x41040,0x10001000,0x40,0x10000040,0x10040000,0x10040040,0x10000000,0x40000,0x10001040,0,0x10041040,0x40040,0x10000040,0x10040000,0x10001000,0x10001040,0,0x10041040,0x41000,0x41000,0x1040,0x1040,0x40040,0x10000000,0x10041000]; - if (statusCode < 200) { - if (this.onInfo) { - this.onInfo({ statusCode, headers }) - } - return - } +/** + * Create necessary sub keys. + * + * @param key the 64-bit or 192-bit key. + * + * @return the expanded keys. + */ +function _createKeys(key) { + var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204], + pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101], + pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808], + pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000], + pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010], + pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420], + pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002], + pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800], + pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002], + pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408], + pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020], + pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200], + pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010], + pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105]; - this.factory = null + // how many iterations (1 for des, 3 for triple des) + // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys + var iterations = key.length() > 8 ? 3 : 1; - let res + // stores the return keys + var keys = []; - if (this.throwOnError && statusCode >= 400) { - const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers - const contentType = parsedHeaders['content-type'] - res = new PassThrough() + // now define the left shifts which need to be done + var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0]; - this.callback = null - this.runInAsyncScope(getResolveErrorBodyCallback, null, - { callback, body: res, contentType, statusCode, statusMessage, headers } - ) - } else { - if (factory === null) { - return - } + var n = 0, tmp; + for(var j = 0; j < iterations; j++) { + var left = key.getInt32(); + var right = key.getInt32(); - res = this.runInAsyncScope(factory, null, { - statusCode, - headers, - opaque, - context - }) + tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f; + right ^= tmp; + left ^= (tmp << 4); - if ( - !res || - typeof res.write !== 'function' || - typeof res.end !== 'function' || - typeof res.on !== 'function' - ) { - throw new InvalidReturnValueError('expected Writable') - } + tmp = ((right >>> -16) ^ left) & 0x0000ffff; + left ^= tmp; + right ^= (tmp << -16); - // TODO: Avoid finished. It registers an unnecessary amount of listeners. - finished(res, { readable: false }, (err) => { - const { callback, res, opaque, trailers, abort } = this + tmp = ((left >>> 2) ^ right) & 0x33333333; + right ^= tmp; + left ^= (tmp << 2); - this.res = null - if (err || !res.readable) { - util.destroy(res, err) - } + tmp = ((right >>> -16) ^ left) & 0x0000ffff; + left ^= tmp; + right ^= (tmp << -16); - this.callback = null - this.runInAsyncScope(callback, null, err || null, { opaque, trailers }) + tmp = ((left >>> 1) ^ right) & 0x55555555; + right ^= tmp; + left ^= (tmp << 1); - if (err) { - abort() - } - }) - } + tmp = ((right >>> 8) ^ left) & 0x00ff00ff; + left ^= tmp; + right ^= (tmp << 8); - res.on('drain', resume) + tmp = ((left >>> 1) ^ right) & 0x55555555; + right ^= tmp; + left ^= (tmp << 1); - this.res = res + // right needs to be shifted and OR'd with last four bits of left + tmp = (left << 8) | ((right >>> 20) & 0x000000f0); - const needDrain = res.writableNeedDrain !== undefined - ? res.writableNeedDrain - : res._writableState && res._writableState.needDrain + // left needs to be put upside down + left = ((right << 24) | ((right << 8) & 0xff0000) | + ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0)); + right = tmp; - return needDrain !== true + // now go through and perform these shifts on the left and right keys + for(var i = 0; i < shifts.length; ++i) { + //shift the keys either one or two bits to the left + if(shifts[i]) { + left = (left << 2) | (left >>> 26); + right = (right << 2) | (right >>> 26); + } else { + left = (left << 1) | (left >>> 27); + right = (right << 1) | (right >>> 27); + } + left &= -0xf; + right &= -0xf; + + // now apply PC-2, in such a way that E is easier when encrypting or + // decrypting this conversion will look like PC-2 except only the last 6 + // bits of each byte are used rather than 48 consecutive bits and the + // order of lines will be according to how the S selection functions will + // be applied: S2, S4, S6, S8, S1, S3, S5, S7 + var lefttmp = ( + pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] | + pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] | + pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] | + pc2bytes6[(left >>> 4) & 0xf]); + var righttmp = ( + pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] | + pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] | + pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] | + pc2bytes13[(right >>> 4) & 0xf]); + tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff; + keys[n++] = lefttmp ^ tmp; + keys[n++] = righttmp ^ (tmp << 16); + } } - onData (chunk) { - const { res } = this + return keys; +} - return res ? res.write(chunk) : true +/** + * Updates a single block (1 byte) using DES. The update will either + * encrypt or decrypt the block. + * + * @param keys the expanded keys. + * @param input the input block (an array of 32-bit words). + * @param output the updated output block. + * @param decrypt true to decrypt the block, false to encrypt it. + */ +function _updateBlock(keys, input, output, decrypt) { + // set up loops for single or triple DES + var iterations = keys.length === 32 ? 3 : 9; + var looping; + if(iterations === 3) { + looping = decrypt ? [30, -2, -2] : [0, 32, 2]; + } else { + looping = (decrypt ? + [94, 62, -2, 32, 64, 2, 30, -2, -2] : + [0, 32, 2, 62, 30, -2, 64, 96, 2]); } - onComplete (trailers) { - const { res } = this - - removeSignal(this) + var tmp; - if (!res) { - return - } + var left = input[0]; + var right = input[1]; - this.trailers = util.parseHeaders(trailers) + // first each 64 bit chunk of the message must be permuted according to IP + tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f; + right ^= tmp; + left ^= (tmp << 4); - res.end() - } + tmp = ((left >>> 16) ^ right) & 0x0000ffff; + right ^= tmp; + left ^= (tmp << 16); - onError (err) { - const { res, callback, opaque, body } = this + tmp = ((right >>> 2) ^ left) & 0x33333333; + left ^= tmp; + right ^= (tmp << 2); - removeSignal(this) + tmp = ((right >>> 8) ^ left) & 0x00ff00ff; + left ^= tmp; + right ^= (tmp << 8); - this.factory = null + tmp = ((left >>> 1) ^ right) & 0x55555555; + right ^= tmp; + left ^= (tmp << 1); - if (res) { - this.res = null - util.destroy(res, err) - } else if (callback) { - this.callback = null - queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }) - }) - } + // rotate left 1 bit + left = ((left << 1) | (left >>> 31)); + right = ((right << 1) | (right >>> 31)); - if (body) { - this.body = null - util.destroy(body, err) - } - } -} + for(var j = 0; j < iterations; j += 3) { + var endloop = looping[j + 1]; + var loopinc = looping[j + 2]; -function stream (opts, factory, callback) { - if (callback === undefined) { - return new Promise((resolve, reject) => { - stream.call(this, opts, factory, (err, data) => { - return err ? reject(err) : resolve(data) - }) - }) - } + // now go through and perform the encryption or decryption + for(var i = looping[j]; i != endloop; i += loopinc) { + var right1 = right ^ keys[i]; + var right2 = ((right >>> 4) | (right << 28)) ^ keys[i + 1]; - try { - this.dispatch(opts, new StreamHandler(opts, factory, callback)) - } catch (err) { - if (typeof callback !== 'function') { - throw err + // passing these bytes through the S selection functions + tmp = left; + left = right; + right = tmp ^ ( + spfunction2[(right1 >>> 24) & 0x3f] | + spfunction4[(right1 >>> 16) & 0x3f] | + spfunction6[(right1 >>> 8) & 0x3f] | + spfunction8[right1 & 0x3f] | + spfunction1[(right2 >>> 24) & 0x3f] | + spfunction3[(right2 >>> 16) & 0x3f] | + spfunction5[(right2 >>> 8) & 0x3f] | + spfunction7[right2 & 0x3f]); } - const opaque = opts && opts.opaque - queueMicrotask(() => callback(err, { opaque })) + // unreverse left and right + tmp = left; + left = right; + right = tmp; } -} -module.exports = stream + // rotate right 1 bit + left = ((left >>> 1) | (left << 31)); + right = ((right >>> 1) | (right << 31)); + + // now perform IP-1, which is IP in the opposite direction + tmp = ((left >>> 1) ^ right) & 0x55555555; + right ^= tmp; + left ^= (tmp << 1); + tmp = ((right >>> 8) ^ left) & 0x00ff00ff; + left ^= tmp; + right ^= (tmp << 8); -/***/ }), + tmp = ((right >>> 2) ^ left) & 0x33333333; + left ^= tmp; + right ^= (tmp << 2); -/***/ 8882: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + tmp = ((left >>> 16) ^ right) & 0x0000ffff; + right ^= tmp; + left ^= (tmp << 16); + tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f; + right ^= tmp; + left ^= (tmp << 4); + output[0] = left; + output[1] = right; +} -const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(46339) -const { AsyncResource } = __nccwpck_require__(50852) -const util = __nccwpck_require__(67468) -const { addSignal, removeSignal } = __nccwpck_require__(6242) -const assert = __nccwpck_require__(39491) +/** + * Deprecated. Instead, use: + * + * forge.cipher.createCipher('DES-', key); + * forge.cipher.createDecipher('DES-', key); + * + * Creates a deprecated DES cipher object. This object's mode will default to + * CBC (cipher-block-chaining). + * + * The key may be given as a binary-encoded string of bytes or a byte buffer. + * + * @param options the options to use. + * key the symmetric key to use (64 or 192 bits). + * output the buffer to write to. + * decrypt true for decryption, false for encryption. + * mode the cipher mode to use (default: 'CBC'). + * + * @return the cipher. + */ +function _createCipher(options) { + options = options || {}; + var mode = (options.mode || 'CBC').toUpperCase(); + var algorithm = 'DES-' + mode; -class UpgradeHandler extends AsyncResource { - constructor (opts, callback) { - if (!opts || typeof opts !== 'object') { - throw new InvalidArgumentError('invalid opts') - } + var cipher; + if(options.decrypt) { + cipher = forge.cipher.createDecipher(algorithm, options.key); + } else { + cipher = forge.cipher.createCipher(algorithm, options.key); + } - if (typeof callback !== 'function') { - throw new InvalidArgumentError('invalid callback') + // backwards compatible start API + var start = cipher.start; + cipher.start = function(iv, options) { + // backwards compatibility: support second arg as output buffer + var output = null; + if(options instanceof forge.util.ByteBuffer) { + output = options; + options = {}; } + options = options || {}; + options.output = output; + options.iv = iv; + start.call(cipher, options); + }; - const { signal, opaque, responseHeaders } = opts + return cipher; +} - if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { - throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') - } - super('UNDICI_UPGRADE') +/***/ }), - this.responseHeaders = responseHeaders || null - this.opaque = opaque || null - this.callback = callback - this.abort = null - this.context = null +/***/ 56389: +/***/ ((module) => { - addSignal(this, signal) +/** + * Node.js module for Forge. + * + * @author Dave Longley + * + * Copyright 2011-2016 Digital Bazaar, Inc. + */ +module.exports = { + // default options + options: { + usePureJavaScript: false } +}; - onConnect (abort, context) { - if (!this.callback) { - throw new RequestAbortedError() - } - this.abort = abort - this.context = null - } +/***/ }), - onHeaders () { - throw new SocketError('bad upgrade', null) - } +/***/ 13857: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - onUpgrade (statusCode, rawHeaders, socket) { - const { callback, opaque, context } = this +/** + * Hash-based Message Authentication Code implementation. Requires a message + * digest object that can be obtained, for example, from forge.md.sha1 or + * forge.md.md5. + * + * @author Dave Longley + * + * Copyright (c) 2010-2012 Digital Bazaar, Inc. All rights reserved. + */ +var forge = __nccwpck_require__(56389); +__nccwpck_require__(48622); +__nccwpck_require__(65138); - assert.strictEqual(statusCode, 101) +/* HMAC API */ +var hmac = module.exports = forge.hmac = forge.hmac || {}; - removeSignal(this) +/** + * Creates an HMAC object that uses the given message digest object. + * + * @return an HMAC object. + */ +hmac.create = function() { + // the hmac key to use + var _key = null; - this.callback = null - const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) - this.runInAsyncScope(callback, null, null, { - headers, - socket, - opaque, - context - }) - } + // the message digest to use + var _md = null; - onError (err) { - const { callback, opaque } = this + // the inner padding + var _ipadding = null; - removeSignal(this) + // the outer padding + var _opadding = null; - if (callback) { - this.callback = null - queueMicrotask(() => { - this.runInAsyncScope(callback, null, err, { opaque }) - }) + // hmac context + var ctx = {}; + + /** + * Starts or restarts the HMAC with the given key and message digest. + * + * @param md the message digest to use, null to reuse the previous one, + * a string to use builtin 'sha1', 'md5', 'sha256'. + * @param key the key to use as a string, array of bytes, byte buffer, + * or null to reuse the previous key. + */ + ctx.start = function(md, key) { + if(md !== null) { + if(typeof md === 'string') { + // create builtin message digest + md = md.toLowerCase(); + if(md in forge.md.algorithms) { + _md = forge.md.algorithms[md].create(); + } else { + throw new Error('Unknown hash algorithm "' + md + '"'); + } + } else { + // store message digest + _md = md; + } } - } -} -function upgrade (opts, callback) { - if (callback === undefined) { - return new Promise((resolve, reject) => { - upgrade.call(this, opts, (err, data) => { - return err ? reject(err) : resolve(data) - }) - }) - } + if(key === null) { + // reuse previous key + key = _key; + } else { + if(typeof key === 'string') { + // convert string into byte buffer + key = forge.util.createBuffer(key); + } else if(forge.util.isArray(key)) { + // convert byte array into byte buffer + var tmp = key; + key = forge.util.createBuffer(); + for(var i = 0; i < tmp.length; ++i) { + key.putByte(tmp[i]); + } + } - try { - const upgradeHandler = new UpgradeHandler(opts, callback) - this.dispatch({ - ...opts, - method: opts.method || 'GET', - upgrade: opts.protocol || 'Websocket' - }, upgradeHandler) - } catch (err) { - if (typeof callback !== 'function') { - throw err - } - const opaque = opts && opts.opaque - queueMicrotask(() => callback(err, { opaque })) - } -} + // if key is longer than blocksize, hash it + var keylen = key.length(); + if(keylen > _md.blockLength) { + _md.start(); + _md.update(key.bytes()); + key = _md.digest(); + } -module.exports = upgrade + // mix key into inner and outer padding + // ipadding = [0x36 * blocksize] ^ key + // opadding = [0x5C * blocksize] ^ key + _ipadding = forge.util.createBuffer(); + _opadding = forge.util.createBuffer(); + keylen = key.length(); + for(var i = 0; i < keylen; ++i) { + var tmp = key.at(i); + _ipadding.putByte(0x36 ^ tmp); + _opadding.putByte(0x5C ^ tmp); + } + // if key is shorter than blocksize, add additional padding + if(keylen < _md.blockLength) { + var tmp = _md.blockLength - keylen; + for(var i = 0; i < tmp; ++i) { + _ipadding.putByte(0x36); + _opadding.putByte(0x5C); + } + } + _key = key; + _ipadding = _ipadding.bytes(); + _opadding = _opadding.bytes(); + } -/***/ }), + // digest is done like so: hash(opadding | hash(ipadding | message)) -/***/ 69938: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // prepare to do inner hash + // hash(ipadding | message) + _md.start(); + _md.update(_ipadding); + }; + /** + * Updates the HMAC with the given message bytes. + * + * @param bytes the bytes to update with. + */ + ctx.update = function(bytes) { + _md.update(bytes); + }; + /** + * Produces the Message Authentication Code (MAC). + * + * @return a byte buffer containing the digest value. + */ + ctx.getMac = function() { + // digest is done like so: hash(opadding | hash(ipadding | message)) + // here we do the outer hashing + var inner = _md.digest().bytes(); + _md.start(); + _md.update(_opadding); + _md.update(inner); + return _md.digest(); + }; + // alias for getMac + ctx.digest = ctx.getMac; -module.exports.request = __nccwpck_require__(66945) -module.exports.stream = __nccwpck_require__(42849) -module.exports.pipeline = __nccwpck_require__(81627) -module.exports.upgrade = __nccwpck_require__(8882) -module.exports.connect = __nccwpck_require__(35473) + return ctx; +}; /***/ }), -/***/ 7601: +/***/ 20447: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// Ported from https://github.com/nodejs/undici/pull/907 +// Copyright (c) 2005 Tom Wu +// All Rights Reserved. +// See "LICENSE" for details. + +// Basic JavaScript BN library - subset useful for RSA encryption. +/* +Licensing (LICENSE) +------------------- +This software is covered under the following copyright: +*/ +/* + * Copyright (c) 2003-2005 Tom Wu + * All Rights Reserved. + * + * 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" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF + * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * In addition, the following condition applies: + * + * All redistributions must retain an intact copy of this copyright notice + * and disclaimer. + */ +/* +Address all questions regarding this license to: -const assert = __nccwpck_require__(39491) -const { Readable } = __nccwpck_require__(12781) -const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(46339) -const util = __nccwpck_require__(67468) -const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(67468) + Tom Wu + tjw@cs.Stanford.EDU +*/ +var forge = __nccwpck_require__(56389); -let Blob +module.exports = forge.jsbn = forge.jsbn || {}; -const kConsume = Symbol('kConsume') -const kReading = Symbol('kReading') -const kBody = Symbol('kBody') -const kAbort = Symbol('abort') -const kContentType = Symbol('kContentType') +// Bits per digit +var dbits; -const noop = () => {} +// JavaScript engine analysis +var canary = 0xdeadbeefcafe; +var j_lm = ((canary&0xffffff)==0xefcafe); -module.exports = class BodyReadable extends Readable { - constructor ({ - resume, - abort, - contentType = '', - highWaterMark = 64 * 1024 // Same as nodejs fs streams. - }) { - super({ - autoDestroy: true, - read: resume, - highWaterMark - }) +// (public) Constructor +function BigInteger(a,b,c) { + this.data = []; + if(a != null) + if("number" == typeof a) this.fromNumber(a,b,c); + else if(b == null && "string" != typeof a) this.fromString(a,256); + else this.fromString(a,b); +} +forge.jsbn.BigInteger = BigInteger; - this._readableState.dataEmitted = false +// return new, unset BigInteger +function nbi() { return new BigInteger(null); } - this[kAbort] = abort - this[kConsume] = null - this[kBody] = null - this[kContentType] = contentType +// am: Compute w_j += (x*this_i), propagate carries, +// c is initial carry, returns final carry. +// c < 3*dvalue, x < 2*dvalue, this_i < dvalue +// We need to select the fastest one that works in this environment. - // Is stream being consumed through Readable API? - // This is an optimization so that we avoid checking - // for 'data' and 'readable' listeners in the hot path - // inside push(). - this[kReading] = false +// am1: use a single mult and divide to get the high bits, +// max digit bits should be 26 because +// max internal value = 2*dvalue^2-2*dvalue (< 2^53) +function am1(i,x,w,j,c,n) { + while(--n >= 0) { + var v = x*this.data[i++]+w.data[j]+c; + c = Math.floor(v/0x4000000); + w.data[j++] = v&0x3ffffff; } - - destroy (err) { - if (this.destroyed) { - // Node < 16 - return this - } - - if (!err && !this._readableState.endEmitted) { - err = new RequestAbortedError() - } - - if (err) { - this[kAbort]() - } - - return super.destroy(err) + return c; +} +// am2 avoids a big mult-and-extract completely. +// Max digit bits should be <= 30 because we do bitwise ops +// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) +function am2(i,x,w,j,c,n) { + var xl = x&0x7fff, xh = x>>15; + while(--n >= 0) { + var l = this.data[i]&0x7fff; + var h = this.data[i++]>>15; + var m = xh*l+h*xl; + l = xl*l+((m&0x7fff)<<15)+w.data[j]+(c&0x3fffffff); + c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); + w.data[j++] = l&0x3fffffff; } - - emit (ev, ...args) { - if (ev === 'data') { - // Node < 16.7 - this._readableState.dataEmitted = true - } else if (ev === 'error') { - // Node < 16 - this._readableState.errorEmitted = true - } - return super.emit(ev, ...args) + return c; +} +// Alternately, set max digit bits to 28 since some +// browsers slow down when dealing with 32-bit numbers. +function am3(i,x,w,j,c,n) { + var xl = x&0x3fff, xh = x>>14; + while(--n >= 0) { + var l = this.data[i]&0x3fff; + var h = this.data[i++]>>14; + var m = xh*l+h*xl; + l = xl*l+((m&0x3fff)<<14)+w.data[j]+c; + c = (l>>28)+(m>>14)+xh*h; + w.data[j++] = l&0xfffffff; } + return c; +} - on (ev, ...args) { - if (ev === 'data' || ev === 'readable') { - this[kReading] = true - } - return super.on(ev, ...args) - } +// node.js (no browser) +if(typeof(navigator) === 'undefined') +{ + BigInteger.prototype.am = am3; + dbits = 28; +} else if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) { + BigInteger.prototype.am = am2; + dbits = 30; +} else if(j_lm && (navigator.appName != "Netscape")) { + BigInteger.prototype.am = am1; + dbits = 26; +} else { // Mozilla/Netscape seems to prefer am3 + BigInteger.prototype.am = am3; + dbits = 28; +} - addListener (ev, ...args) { - return this.on(ev, ...args) - } +BigInteger.prototype.DB = dbits; +BigInteger.prototype.DM = ((1< 0 || - this.listenerCount('readable') > 0 - ) - } - return ret - } +var BI_FP = 52; +BigInteger.prototype.FV = Math.pow(2,BI_FP); +BigInteger.prototype.F1 = BI_FP-dbits; +BigInteger.prototype.F2 = 2*dbits-BI_FP; - removeListener (ev, ...args) { - return this.off(ev, ...args) - } +// Digit conversions +var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz"; +var BI_RC = new Array(); +var rr,vv; +rr = "0".charCodeAt(0); +for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv; +rr = "a".charCodeAt(0); +for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; +rr = "A".charCodeAt(0); +for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; - push (chunk) { - if (this[kConsume] && chunk !== null && this.readableLength === 0) { - consumePush(this[kConsume], chunk) - return this[kReading] ? super.push(chunk) : true - } - return super.push(chunk) - } +function int2char(n) { return BI_RM.charAt(n); } +function intAt(s,i) { + var c = BI_RC[s.charCodeAt(i)]; + return (c==null)?-1:c; +} - // https://fetch.spec.whatwg.org/#dom-body-text - async text () { - return consume(this, 'text') - } +// (protected) copy this to r +function bnpCopyTo(r) { + for(var i = this.t-1; i >= 0; --i) r.data[i] = this.data[i]; + r.t = this.t; + r.s = this.s; +} - // https://fetch.spec.whatwg.org/#dom-body-json - async json () { - return consume(this, 'json') - } +// (protected) set from integer value x, -DV <= x < DV +function bnpFromInt(x) { + this.t = 1; + this.s = (x<0)?-1:0; + if(x > 0) this.data[0] = x; + else if(x < -1) this.data[0] = x+this.DV; + else this.t = 0; +} - // https://fetch.spec.whatwg.org/#dom-body-blob - async blob () { - return consume(this, 'blob') - } +// return bigint initialized to value +function nbv(i) { var r = nbi(); r.fromInt(i); return r; } - // https://fetch.spec.whatwg.org/#dom-body-arraybuffer - async arrayBuffer () { - return consume(this, 'arrayBuffer') +// (protected) set from string and radix +function bnpFromString(s,b) { + var k; + if(b == 16) k = 4; + else if(b == 8) k = 3; + else if(b == 256) k = 8; // byte array + else if(b == 2) k = 1; + else if(b == 32) k = 5; + else if(b == 4) k = 2; + else { this.fromRadix(s,b); return; } + this.t = 0; + this.s = 0; + var i = s.length, mi = false, sh = 0; + while(--i >= 0) { + var x = (k==8)?s[i]&0xff:intAt(s,i); + if(x < 0) { + if(s.charAt(i) == "-") mi = true; + continue; + } + mi = false; + if(sh == 0) + this.data[this.t++] = x; + else if(sh+k > this.DB) { + this.data[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh)); + } else + this.data[this.t-1] |= x<= this.DB) sh -= this.DB; } - - // https://fetch.spec.whatwg.org/#dom-body-formdata - async formData () { - // TODO: Implement. - throw new NotSupportedError() + if(k == 8 && (s[0]&0x80) != 0) { + this.s = -1; + if(sh > 0) this.data[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this.data[this.t-1] == c) --this.t; +} - // https://fetch.spec.whatwg.org/#dom-body-body - get body () { - if (!this[kBody]) { - this[kBody] = ReadableStreamFrom(this) - if (this[kConsume]) { - // TODO: Is this the best way to force a lock? - this[kBody].getReader() // Ensure stream is locked. - assert(this[kBody].locked) +// (public) return string representation in given radix +function bnToString(b) { + if(this.s < 0) return "-"+this.negate().toString(b); + var k; + if(b == 16) k = 4; + else if(b == 8) k = 3; + else if(b == 2) k = 1; + else if(b == 32) k = 5; + else if(b == 4) k = 2; + else return this.toRadix(b); + var km = (1< 0) { + if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); } + while(i >= 0) { + if(p < k) { + d = (this.data[i]&((1<>(p+=this.DB-k); + } else { + d = (this.data[i]>>(p-=k))&km; + if(p <= 0) { p += this.DB; --i; } } + if(d > 0) m = true; + if(m) r += int2char(d); } - return this[kBody] } + return m?r:"0"; +} - dump (opts) { - let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144 - const signal = opts && opts.signal +// (public) -this +function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } - if (signal) { - try { - if (typeof signal !== 'object' || !('aborted' in signal)) { - throw new InvalidArgumentError('signal must be an AbortSignal') - } - util.throwIfAborted(signal) - } catch (err) { - return Promise.reject(err) - } - } +// (public) |this| +function bnAbs() { return (this.s<0)?this.negate():this; } - if (this.closed) { - return Promise.resolve(null) - } +// (public) return + if this > a, - if this < a, 0 if equal +function bnCompareTo(a) { + var r = this.s-a.s; + if(r != 0) return r; + var i = this.t; + r = i-a.t; + if(r != 0) return (this.s<0)?-r:r; + while(--i >= 0) if((r=this.data[i]-a.data[i]) != 0) return r; + return 0; +} - return new Promise((resolve, reject) => { - const signalListenerCleanup = signal - ? util.addAbortListener(signal, () => { - this.destroy() - }) - : noop +// returns bit length of the integer x +function nbits(x) { + var r = 1, t; + if((t=x>>>16) != 0) { x = t; r += 16; } + if((t=x>>8) != 0) { x = t; r += 8; } + if((t=x>>4) != 0) { x = t; r += 4; } + if((t=x>>2) != 0) { x = t; r += 2; } + if((t=x>>1) != 0) { x = t; r += 1; } + return r; +} - this - .on('close', function () { - signalListenerCleanup() - if (signal && signal.aborted) { - reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' })) - } else { - resolve(null) - } - }) - .on('error', noop) - .on('data', function (chunk) { - limit -= chunk.length - if (limit <= 0) { - this.destroy() - } - }) - .resume() - }) - } +// (public) return the number of bits in "this" +function bnBitLength() { + if(this.t <= 0) return 0; + return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM)); } -// https://streams.spec.whatwg.org/#readablestream-locked -function isLocked (self) { - // Consume is an implicit lock. - return (self[kBody] && self[kBody].locked === true) || self[kConsume] +// (protected) r = this << n*DB +function bnpDLShiftTo(n,r) { + var i; + for(i = this.t-1; i >= 0; --i) r.data[i+n] = this.data[i]; + for(i = n-1; i >= 0; --i) r.data[i] = 0; + r.t = this.t+n; + r.s = this.s; } -// https://fetch.spec.whatwg.org/#body-unusable -function isUnusable (self) { - return util.isDisturbed(self) || isLocked(self) +// (protected) r = this >> n*DB +function bnpDRShiftTo(n,r) { + for(var i = n; i < this.t; ++i) r.data[i-n] = this.data[i]; + r.t = Math.max(this.t-n,0); + r.s = this.s; } -async function consume (stream, type) { - if (isUnusable(stream)) { - throw new TypeError('unusable') +// (protected) r = this << n +function bnpLShiftTo(n,r) { + var bs = n%this.DB; + var cbs = this.DB-bs; + var bm = (1<= 0; --i) { + r.data[i+ds+1] = (this.data[i]>>cbs)|c; + c = (this.data[i]&bm)< { - stream[kConsume] = { - type, - stream, - resolve, - reject, - length: 0, - body: [] - } - - stream - .on('error', function (err) { - consumeFinish(this[kConsume], err) - }) - .on('close', function () { - if (this[kConsume].body !== null) { - consumeFinish(this[kConsume], new RequestAbortedError()) - } - }) - - process.nextTick(consumeStart, stream[kConsume]) - }) + for(i = ds-1; i >= 0; --i) r.data[i] = 0; + r.data[ds] = c; + r.t = this.t+ds+1; + r.s = this.s; + r.clamp(); } -function consumeStart (consume) { - if (consume.body === null) { - return +// (protected) r = this >> n +function bnpRShiftTo(n,r) { + r.s = this.s; + var ds = Math.floor(n/this.DB); + if(ds >= this.t) { r.t = 0; return; } + var bs = n%this.DB; + var cbs = this.DB-bs; + var bm = (1<>bs; + for(var i = ds+1; i < this.t; ++i) { + r.data[i-ds-1] |= (this.data[i]&bm)<>bs; } + if(bs > 0) r.data[this.t-ds-1] |= (this.s&bm)<>= this.DB; } - - if (state.endEmitted) { - consumeEnd(this[kConsume]) + if(a.t < this.t) { + c -= a.s; + while(i < this.t) { + c += this.data[i]; + r.data[i++] = c&this.DM; + c >>= this.DB; + } + c += this.s; } else { - consume.stream.on('end', function () { - consumeEnd(this[kConsume]) - }) + c += this.s; + while(i < a.t) { + c -= a.data[i]; + r.data[i++] = c&this.DM; + c >>= this.DB; + } + c -= a.s; } + r.s = (c<0)?-1:0; + if(c < -1) r.data[i++] = this.DV+c; + else if(c > 0) r.data[i++] = c; + r.t = i; + r.clamp(); +} - consume.stream.resume() +// (protected) r = this * a, r != this,a (HAC 14.12) +// "this" should be the larger one if appropriate. +function bnpMultiplyTo(a,r) { + var x = this.abs(), y = a.abs(); + var i = x.t; + r.t = i+y.t; + while(--i >= 0) r.data[i] = 0; + for(i = 0; i < y.t; ++i) r.data[i+x.t] = x.am(0,y.data[i],r,i,0,x.t); + r.s = 0; + r.clamp(); + if(this.s != a.s) BigInteger.ZERO.subTo(r,r); +} - while (consume.stream.read() != null) { - // Loop +// (protected) r = this^2, r != this (HAC 14.16) +function bnpSquareTo(r) { + var x = this.abs(); + var i = r.t = 2*x.t; + while(--i >= 0) r.data[i] = 0; + for(i = 0; i < x.t-1; ++i) { + var c = x.am(i,x.data[i],r,2*i,0,1); + if((r.data[i+x.t]+=x.am(i+1,2*x.data[i],r,2*i+1,c,x.t-i-1)) >= x.DV) { + r.data[i+x.t] -= x.DV; + r.data[i+x.t+1] = 1; + } } + if(r.t > 0) r.data[r.t-1] += x.am(i,x.data[i],r,2*i,0,1); + r.s = 0; + r.clamp(); } -function consumeEnd (consume) { - const { type, body, resolve, stream, length } = consume - - try { - if (type === 'text') { - resolve(toUSVString(Buffer.concat(body))) - } else if (type === 'json') { - resolve(JSON.parse(Buffer.concat(body))) - } else if (type === 'arrayBuffer') { - const dst = new Uint8Array(length) - - let pos = 0 - for (const buf of body) { - dst.set(buf, pos) - pos += buf.byteLength - } - - resolve(dst.buffer) - } else if (type === 'blob') { - if (!Blob) { - Blob = (__nccwpck_require__(14300).Blob) - } - resolve(new Blob(body, { type: stream[kContentType] })) +// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) +// r != q, this != m. q or r may be null. +function bnpDivRemTo(m,q,r) { + var pm = m.abs(); + if(pm.t <= 0) return; + var pt = this.abs(); + if(pt.t < pm.t) { + if(q != null) q.fromInt(0); + if(r != null) this.copyTo(r); + return; + } + if(r == null) r = nbi(); + var y = nbi(), ts = this.s, ms = m.s; + var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus + if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); } + var ys = y.t; + var y0 = y.data[ys-1]; + if(y0 == 0) return; + var yt = y0*(1<1)?y.data[ys-2]>>this.F2:0); + var d1 = this.FV/yt, d2 = (1<= 0) { + r.data[r.t++] = 1; + r.subTo(t,r); + } + BigInteger.ONE.dlShiftTo(ys,t); + t.subTo(y,y); // "negative" y so we can replace sub with am later + while(y.t < ys) y.data[y.t++] = 0; + while(--j >= 0) { + // Estimate quotient digit + var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2); + if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out + y.dlShiftTo(j,t); + r.subTo(t,r); + while(r.data[i] < --qd) r.subTo(t,r); } - - consumeFinish(consume) - } catch (err) { - stream.destroy(err) } + if(q != null) { + r.drShiftTo(ys,q); + if(ts != ms) BigInteger.ZERO.subTo(q,q); + } + r.t = ys; + r.clamp(); + if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder + if(ts < 0) BigInteger.ZERO.subTo(r,r); } -function consumePush (consume, chunk) { - consume.length += chunk.length - consume.body.push(chunk) +// (public) this mod a +function bnMod(a) { + var r = nbi(); + this.abs().divRemTo(a,null,r); + if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); + return r; } -function consumeFinish (consume, err) { - if (consume.body === null) { - return - } +// Modular reduction using "classic" algorithm +function Classic(m) { this.m = m; } +function cConvert(x) { + if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); + else return x; +} +function cRevert(x) { return x; } +function cReduce(x) { x.divRemTo(this.m,null,x); } +function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } +function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } - if (err) { - consume.reject(err) - } else { - consume.resolve() - } +Classic.prototype.convert = cConvert; +Classic.prototype.revert = cRevert; +Classic.prototype.reduce = cReduce; +Classic.prototype.mulTo = cMulTo; +Classic.prototype.sqrTo = cSqrTo; - consume.type = null - consume.stream = null - consume.resolve = null - consume.reject = null - consume.length = 0 - consume.body = null +// (protected) return "-1/this % 2^DB"; useful for Mont. reduction +// justification: +// xy == 1 (mod m) +// xy = 1+km +// xy(2-xy) = (1+km)(1-km) +// x[y(2-xy)] = 1-k^2m^2 +// x[y(2-xy)] == 1 (mod m^2) +// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 +// should reduce x and y(2-xy) by m^2 at each step to keep size bounded. +// JS multiply "overflows" differently from C/C++, so care is needed here. +function bnpInvDigit() { + if(this.t < 1) return 0; + var x = this.data[0]; + if((x&1) == 0) return 0; + var y = x&3; // y == 1/x mod 2^2 + y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 + y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 + y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 + // last step - calculate inverse mod DV directly; + // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints + y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits + // we really want the negative inverse, and -DV < y < DV + return (y>0)?this.DV-y:-y; } +// Montgomery reduction +function Montgomery(m) { + this.m = m; + this.mp = m.invDigit(); + this.mpl = this.mp&0x7fff; + this.mph = this.mp>>15; + this.um = (1<<(m.DB-15))-1; + this.mt2 = 2*m.t; +} -/***/ }), - -/***/ 2977: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +// xR mod m +function montConvert(x) { + var r = nbi(); + x.abs().dlShiftTo(this.m.t,r); + r.divRemTo(this.m,null,r); + if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); + return r; +} -const assert = __nccwpck_require__(39491) -const { - ResponseStatusCodeError -} = __nccwpck_require__(46339) -const { toUSVString } = __nccwpck_require__(67468) +// x/R mod m +function montRevert(x) { + var r = nbi(); + x.copyTo(r); + this.reduce(r); + return r; +} -async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) { - assert(body) +// x = x/R mod m (HAC 14.32) +function montReduce(x) { + while(x.t <= this.mt2) // pad x so am has enough room later + x.data[x.t++] = 0; + for(var i = 0; i < this.m.t; ++i) { + // faster way of calculating u0 = x.data[i]*mp mod DV + var j = x.data[i]&0x7fff; + var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM; + // use am to combine the multiply-shift-add into one call + j = i+this.m.t; + x.data[j] += this.m.am(0,u0,x,i,0,this.m.t); + // propagate carry + while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; } + } + x.clamp(); + x.drShiftTo(this.m.t,x); + if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); +} - let chunks = [] - let limit = 0 +// r = "x^2/R mod m"; x != r +function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } - for await (const chunk of body) { - chunks.push(chunk) - limit += chunk.length - if (limit > 128 * 1024) { - chunks = null - break - } - } +// r = "xy/R mod m"; x,y != r +function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } - if (statusCode === 204 || !contentType || !chunks) { - process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers)) - return - } +Montgomery.prototype.convert = montConvert; +Montgomery.prototype.revert = montRevert; +Montgomery.prototype.reduce = montReduce; +Montgomery.prototype.mulTo = montMulTo; +Montgomery.prototype.sqrTo = montSqrTo; - try { - if (contentType.startsWith('application/json')) { - const payload = JSON.parse(toUSVString(Buffer.concat(chunks))) - process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload)) - return - } +// (protected) true iff this is even +function bnpIsEven() { return ((this.t>0)?(this.data[0]&1):this.s) == 0; } - if (contentType.startsWith('text/')) { - const payload = toUSVString(Buffer.concat(chunks)) - process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload)) - return - } - } catch (err) { - // Process in a fallback if error +// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) +function bnpExp(e,z) { + if(e > 0xffffffff || e < 1) return BigInteger.ONE; + var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; + g.copyTo(r); + while(--i >= 0) { + z.sqrTo(r,r2); + if((e&(1< 0) z.mulTo(r2,g,r); + else { var t = r; r = r2; r2 = t; } } + return z.revert(r); +} - process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers)) +// (public) this^e % m, 0 <= e < 2^32 +function bnModPowInt(e,m) { + var z; + if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); + return this.exp(e,z); } -module.exports = { getResolveErrorBodyCallback } +// protected +BigInteger.prototype.copyTo = bnpCopyTo; +BigInteger.prototype.fromInt = bnpFromInt; +BigInteger.prototype.fromString = bnpFromString; +BigInteger.prototype.clamp = bnpClamp; +BigInteger.prototype.dlShiftTo = bnpDLShiftTo; +BigInteger.prototype.drShiftTo = bnpDRShiftTo; +BigInteger.prototype.lShiftTo = bnpLShiftTo; +BigInteger.prototype.rShiftTo = bnpRShiftTo; +BigInteger.prototype.subTo = bnpSubTo; +BigInteger.prototype.multiplyTo = bnpMultiplyTo; +BigInteger.prototype.squareTo = bnpSquareTo; +BigInteger.prototype.divRemTo = bnpDivRemTo; +BigInteger.prototype.invDigit = bnpInvDigit; +BigInteger.prototype.isEven = bnpIsEven; +BigInteger.prototype.exp = bnpExp; +// public +BigInteger.prototype.toString = bnToString; +BigInteger.prototype.negate = bnNegate; +BigInteger.prototype.abs = bnAbs; +BigInteger.prototype.compareTo = bnCompareTo; +BigInteger.prototype.bitLength = bnBitLength; +BigInteger.prototype.mod = bnMod; +BigInteger.prototype.modPowInt = bnModPowInt; -/***/ }), +// "constants" +BigInteger.ZERO = nbv(0); +BigInteger.ONE = nbv(1); -/***/ 8926: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +// jsbn2 lib +//Copyright (c) 2005-2009 Tom Wu +//All Rights Reserved. +//See "LICENSE" for details (See jsbn.js for LICENSE). +//Extended JavaScript BN functions, required for RSA private ops. -const { - BalancedPoolMissingUpstreamError, - InvalidArgumentError -} = __nccwpck_require__(46339) -const { - PoolBase, - kClients, - kNeedDrain, - kAddClient, - kRemoveClient, - kGetDispatcher -} = __nccwpck_require__(68504) -const Pool = __nccwpck_require__(85186) -const { kUrl, kInterceptors } = __nccwpck_require__(48039) -const { parseOrigin } = __nccwpck_require__(67468) -const kFactory = Symbol('factory') +//Version 1.1: new BigInteger("0", 10) returns "proper" zero -const kOptions = Symbol('options') -const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor') -const kCurrentWeight = Symbol('kCurrentWeight') -const kIndex = Symbol('kIndex') -const kWeight = Symbol('kWeight') -const kMaxWeightPerServer = Symbol('kMaxWeightPerServer') -const kErrorPenalty = Symbol('kErrorPenalty') +//(public) +function bnClone() { var r = nbi(); this.copyTo(r); return r; } -function getGreatestCommonDivisor (a, b) { - if (b === 0) return a - return getGreatestCommonDivisor(b, a % b) +//(public) return value as integer +function bnIntValue() { +if(this.s < 0) { + if(this.t == 1) return this.data[0]-this.DV; + else if(this.t == 0) return -1; +} else if(this.t == 1) return this.data[0]; +else if(this.t == 0) return 0; +// assumes 16 < DB < 32 +return ((this.data[1]&((1<<(32-this.DB))-1))<>24; } + +//(public) return value as short (assumes DB>=16) +function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; } + +//(protected) return x s.t. r^x < DV +function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); } + +//(public) 0 if this == 0, 1 if this > 0 +function bnSigNum() { +if(this.s < 0) return -1; +else if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0; +else return 1; } -class BalancedPool extends PoolBase { - constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) { - super() +//(protected) convert to radix string +function bnpToRadix(b) { +if(b == null) b = 10; +if(this.signum() == 0 || b < 2 || b > 36) return "0"; +var cs = this.chunkSize(b); +var a = Math.pow(b,cs); +var d = nbv(a), y = nbi(), z = nbi(), r = ""; +this.divRemTo(d,y,z); +while(y.signum() > 0) { + r = (a+z.intValue()).toString(b).substr(1) + r; + y.divRemTo(d,y,z); +} +return z.intValue().toString(b) + r; +} - this[kOptions] = opts - this[kIndex] = -1 - this[kCurrentWeight] = 0 +//(protected) convert from radix string +function bnpFromRadix(s,b) { +this.fromInt(0); +if(b == null) b = 10; +var cs = this.chunkSize(b); +var d = Math.pow(b,cs), mi = false, j = 0, w = 0; +for(var i = 0; i < s.length; ++i) { + var x = intAt(s,i); + if(x < 0) { + if(s.charAt(i) == "-" && this.signum() == 0) mi = true; + continue; + } + w = b*w+x; + if(++j >= cs) { + this.dMultiply(d); + this.dAddOffset(w,0); + j = 0; + w = 0; + } +} +if(j > 0) { + this.dMultiply(Math.pow(b,j)); + this.dAddOffset(w,0); +} +if(mi) BigInteger.ZERO.subTo(this,this); +} - this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100 - this[kErrorPenalty] = this[kOptions].errorPenalty || 15 +//(protected) alternate constructor +function bnpFromNumber(a,b,c) { +if("number" == typeof b) { + // new BigInteger(int,int,RNG) + if(a < 2) this.fromInt(1); + else { + this.fromNumber(a,c); + if(!this.testBit(a-1)) // force MSB set + this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this); + if(this.isEven()) this.dAddOffset(1,0); // force odd + while(!this.isProbablePrime(b)) { + this.dAddOffset(2,0); + if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this); + } + } +} else { + // new BigInteger(int,RNG) + var x = new Array(), t = a&7; + x.length = (a>>3)+1; + b.nextBytes(x); + if(t > 0) x[0] &= ((1< 0) { + if(p < this.DB && (d = this.data[i]>>p) != (this.s&this.DM)>>p) + r[k++] = d|(this.s<<(this.DB-p)); + while(i >= 0) { + if(p < 8) { + d = (this.data[i]&((1<>(p+=this.DB-8); + } else { + d = (this.data[i]>>(p-=8))&0xff; + if(p <= 0) { p += this.DB; --i; } + } + if((d&0x80) != 0) d |= -256; + if(k == 0 && (this.s&0x80) != (d&0x80)) ++k; + if(k > 0 || d != this.s) r[k++] = d; + } +} +return r; +} - if (typeof factory !== 'function') { - throw new InvalidArgumentError('factory must be a function.') - } +function bnEquals(a) { return(this.compareTo(a)==0); } +function bnMin(a) { return(this.compareTo(a)<0)?this:a; } +function bnMax(a) { return(this.compareTo(a)>0)?this:a; } - this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool) - ? opts.interceptors.BalancedPool - : [] - this[kFactory] = factory +//(protected) r = this op a (bitwise) +function bnpBitwiseTo(a,op,r) { +var i, f, m = Math.min(a.t,this.t); +for(i = 0; i < m; ++i) r.data[i] = op(this.data[i],a.data[i]); +if(a.t < this.t) { + f = a.s&this.DM; + for(i = m; i < this.t; ++i) r.data[i] = op(this.data[i],f); + r.t = this.t; +} else { + f = this.s&this.DM; + for(i = m; i < a.t; ++i) r.data[i] = op(f,a.data[i]); + r.t = a.t; +} +r.s = op(this.s,a.s); +r.clamp(); +} - for (const upstream of upstreams) { - this.addUpstream(upstream) - } - this._updateBalancedPoolStats() - } +//(public) this & a +function op_and(x,y) { return x&y; } +function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; } - addUpstream (upstream) { - const upstreamOrigin = parseOrigin(upstream).origin +//(public) this | a +function op_or(x,y) { return x|y; } +function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; } - if (this[kClients].find((pool) => ( - pool[kUrl].origin === upstreamOrigin && - pool.closed !== true && - pool.destroyed !== true - ))) { - return this - } - const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions])) +//(public) this ^ a +function op_xor(x,y) { return x^y; } +function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; } - this[kAddClient](pool) - pool.on('connect', () => { - pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty]) - }) +//(public) this & ~a +function op_andnot(x,y) { return x&~y; } +function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; } - pool.on('connectionError', () => { - pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]) - this._updateBalancedPoolStats() - }) +//(public) ~this +function bnNot() { +var r = nbi(); +for(var i = 0; i < this.t; ++i) r.data[i] = this.DM&~this.data[i]; +r.t = this.t; +r.s = ~this.s; +return r; +} - pool.on('disconnect', (...args) => { - const err = args[2] - if (err && err.code === 'UND_ERR_SOCKET') { - // decrease the weight of the pool. - pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]) - this._updateBalancedPoolStats() - } - }) +//(public) this << n +function bnShiftLeft(n) { +var r = nbi(); +if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r); +return r; +} - for (const client of this[kClients]) { - client[kWeight] = this[kMaxWeightPerServer] - } +//(public) this >> n +function bnShiftRight(n) { +var r = nbi(); +if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r); +return r; +} - this._updateBalancedPoolStats() +//return index of lowest 1-bit in x, x < 2^31 +function lbit(x) { +if(x == 0) return -1; +var r = 0; +if((x&0xffff) == 0) { x >>= 16; r += 16; } +if((x&0xff) == 0) { x >>= 8; r += 8; } +if((x&0xf) == 0) { x >>= 4; r += 4; } +if((x&3) == 0) { x >>= 2; r += 2; } +if((x&1) == 0) ++r; +return r; +} - return this - } +//(public) returns index of lowest 1-bit (or -1 if none) +function bnGetLowestSetBit() { +for(var i = 0; i < this.t; ++i) + if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]); +if(this.s < 0) return this.t*this.DB; +return -1; +} - _updateBalancedPoolStats () { - this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0) - } +//return number of 1 bits in x +function cbit(x) { +var r = 0; +while(x != 0) { x &= x-1; ++r; } +return r; +} - removeUpstream (upstream) { - const upstreamOrigin = parseOrigin(upstream).origin +//(public) return number of set bits +function bnBitCount() { +var r = 0, x = this.s&this.DM; +for(var i = 0; i < this.t; ++i) r += cbit(this.data[i]^x); +return r; +} - const pool = this[kClients].find((pool) => ( - pool[kUrl].origin === upstreamOrigin && - pool.closed !== true && - pool.destroyed !== true - )) +//(public) true iff nth bit is set +function bnTestBit(n) { +var j = Math.floor(n/this.DB); +if(j >= this.t) return(this.s!=0); +return((this.data[j]&(1<<(n%this.DB)))!=0); +} - if (pool) { - this[kRemoveClient](pool) - } +//(protected) this op (1< dispatcher.closed !== true && dispatcher.destroyed !== true) - .map((p) => p[kUrl].origin) - } +//(public) this & ~(1< ( - !dispatcher[kNeedDrain] && - dispatcher.closed !== true && - dispatcher.destroyed !== true - )) +//(protected) r = this + a +function bnpAddTo(a,r) { +var i = 0, c = 0, m = Math.min(a.t,this.t); +while(i < m) { + c += this.data[i]+a.data[i]; + r.data[i++] = c&this.DM; + c >>= this.DB; +} +if(a.t < this.t) { + c += a.s; + while(i < this.t) { + c += this.data[i]; + r.data[i++] = c&this.DM; + c >>= this.DB; + } + c += this.s; +} else { + c += this.s; + while(i < a.t) { + c += a.data[i]; + r.data[i++] = c&this.DM; + c >>= this.DB; + } + c += a.s; +} +r.s = (c<0)?-1:0; +if(c > 0) r.data[i++] = c; +else if(c < -1) r.data[i++] = this.DV+c; +r.t = i; +r.clamp(); +} - if (!dispatcher) { - return - } +//(public) this + a +function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; } - const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true) +//(public) this - a +function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; } - if (allClientsBusy) { - return - } +//(public) this * a +function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; } - let counter = 0 +//(public) this / a +function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; } - let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain]) +//(public) this % a +function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; } - while (counter++ < this[kClients].length) { - this[kIndex] = (this[kIndex] + 1) % this[kClients].length - const pool = this[kClients][this[kIndex]] +//(public) [this/a,this%a] +function bnDivideAndRemainder(a) { +var q = nbi(), r = nbi(); +this.divRemTo(a,q,r); +return new Array(q,r); +} - // find pool index with the largest weight - if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) { - maxWeightIndex = this[kIndex] - } +//(protected) this *= n, this >= 0, 1 < n < DV +function bnpDMultiply(n) { +this.data[this.t] = this.am(0,n-1,this,0,0,this.t); +++this.t; +this.clamp(); +} - // decrease the current weight every `this[kClients].length`. - if (this[kIndex] === 0) { - // Set the current weight to the next lower weight. - this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor] +//(protected) this += n << w words, this >= 0 +function bnpDAddOffset(n,w) { +if(n == 0) return; +while(this.t <= w) this.data[this.t++] = 0; +this.data[w] += n; +while(this.data[w] >= this.DV) { + this.data[w] -= this.DV; + if(++w >= this.t) this.data[this.t++] = 0; + ++this.data[w]; +} +} - if (this[kCurrentWeight] <= 0) { - this[kCurrentWeight] = this[kMaxWeightPerServer] - } - } - if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) { - return pool - } - } +//A "null" reducer +function NullExp() {} +function nNop(x) { return x; } +function nMulTo(x,y,r) { x.multiplyTo(y,r); } +function nSqrTo(x,r) { x.squareTo(r); } - this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight] - this[kIndex] = maxWeightIndex - return this[kClients][maxWeightIndex] - } -} +NullExp.prototype.convert = nNop; +NullExp.prototype.revert = nNop; +NullExp.prototype.mulTo = nMulTo; +NullExp.prototype.sqrTo = nSqrTo; -module.exports = BalancedPool +//(public) this^e +function bnPow(e) { return this.exp(e,new NullExp()); } +//(protected) r = lower n words of "this * a", a.t <= n +//"this" should be the larger one if appropriate. +function bnpMultiplyLowerTo(a,n,r) { +var i = Math.min(this.t+a.t,n); +r.s = 0; // assumes a,this >= 0 +r.t = i; +while(i > 0) r.data[--i] = 0; +var j; +for(j = r.t-this.t; i < j; ++i) r.data[i+this.t] = this.am(0,a.data[i],r,i,0,this.t); +for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a.data[i],r,i,0,n-i); +r.clamp(); +} -/***/ }), +//(protected) r = "this * a" without lower n words, n > 0 +//"this" should be the larger one if appropriate. +function bnpMultiplyUpperTo(a,n,r) { +--n; +var i = r.t = this.t+a.t-n; +r.s = 0; // assumes a,this >= 0 +while(--i >= 0) r.data[i] = 0; +for(i = Math.max(n-this.t,0); i < a.t; ++i) + r.data[this.t+i-n] = this.am(n-i,a.data[i],r,0,0,this.t+i-n); +r.clamp(); +r.drShiftTo(1,r); +} -/***/ 10468: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +//Barrett modular reduction +function Barrett(m) { +// setup Barrett +this.r2 = nbi(); +this.q3 = nbi(); +BigInteger.ONE.dlShiftTo(2*m.t,this.r2); +this.mu = this.r2.divide(m); +this.m = m; +} +function barrettConvert(x) { +if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m); +else if(x.compareTo(this.m) < 0) return x; +else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; } +} +function barrettRevert(x) { return x; } -const { kConstruct } = __nccwpck_require__(69668) -const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(12862) -const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(67468) -const { kHeadersList } = __nccwpck_require__(48039) -const { webidl } = __nccwpck_require__(96138) -const { Response, cloneResponse } = __nccwpck_require__(58846) -const { Request } = __nccwpck_require__(7288) -const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(46938) -const { fetching } = __nccwpck_require__(72748) -const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(79453) -const assert = __nccwpck_require__(39491) -const { getGlobalDispatcher } = __nccwpck_require__(29102) +//x = x mod m (HAC 14.42) +function barrettReduce(x) { +x.drShiftTo(this.m.t-1,this.r2); +if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); } +this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3); +this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2); +while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1); +x.subTo(this.r2,x); +while(x.compareTo(this.m) >= 0) x.subTo(this.m,x); +} -/** - * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation - * @typedef {Object} CacheBatchOperation - * @property {'delete' | 'put'} type - * @property {any} request - * @property {any} response - * @property {import('../../types/cache').CacheQueryOptions} options - */ +//r = x^2 mod m; x != r +function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); } -/** - * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list - * @typedef {[any, any][]} requestResponseList - */ +//r = x*y mod m; x,y != r +function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } -class Cache { - /** - * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list - * @type {requestResponseList} - */ - #relevantRequestResponseList +Barrett.prototype.convert = barrettConvert; +Barrett.prototype.revert = barrettRevert; +Barrett.prototype.reduce = barrettReduce; +Barrett.prototype.mulTo = barrettMulTo; +Barrett.prototype.sqrTo = barrettSqrTo; - constructor () { - if (arguments[0] !== kConstruct) { - webidl.illegalConstructor() - } +//(public) this^e % m (HAC 14.85) +function bnModPow(e,m) { +var i = e.bitLength(), k, r = nbv(1), z; +if(i <= 0) return r; +else if(i < 18) k = 1; +else if(i < 48) k = 3; +else if(i < 144) k = 4; +else if(i < 768) k = 5; +else k = 6; +if(i < 8) + z = new Classic(m); +else if(m.isEven()) + z = new Barrett(m); +else + z = new Montgomery(m); - this.#relevantRequestResponseList = arguments[1] - } +// precomputation +var g = new Array(), n = 3, k1 = k-1, km = (1< 1) { + var g2 = nbi(); + z.sqrTo(g[1],g2); + while(n <= km) { + g[n] = nbi(); + z.mulTo(g2,g[n-2],g[n]); + n += 2; + } +} - async match (request, options = {}) { - webidl.brandCheck(this, Cache) - webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' }) +var j = e.t-1, w, is1 = true, r2 = nbi(), t; +i = nbits(e.data[j])-1; +while(j >= 0) { + if(i >= k1) w = (e.data[j]>>(i-k1))&km; + else { + w = (e.data[j]&((1<<(i+1))-1))<<(k1-i); + if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1); + } - request = webidl.converters.RequestInfo(request) - options = webidl.converters.CacheQueryOptions(options) + n = k; + while((w&1) == 0) { w >>= 1; --n; } + if((i -= n) < 0) { i += this.DB; --j; } + if(is1) { // ret == 1, don't bother squaring or multiplying it + g[w].copyTo(r); + is1 = false; + } else { + while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; } + if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; } + z.mulTo(r2,g[w],r); + } - const p = await this.matchAll(request, options) + while(j >= 0 && (e.data[j]&(1< 0) { + x.rShiftTo(g,x); + y.rShiftTo(g,y); +} +while(x.signum() > 0) { + if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x); + if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y); + if(x.compareTo(y) >= 0) { + x.subTo(y,x); + x.rShiftTo(1,x); + } else { + y.subTo(x,y); + y.rShiftTo(1,y); + } +} +if(g > 0) y.lShiftTo(g,y); +return y; +} - return p[0] - } +//(protected) this % n, n < 2^26 +function bnpModInt(n) { +if(n <= 0) return 0; +var d = this.DV%n, r = (this.s<0)?n-1:0; +if(this.t > 0) + if(d == 0) r = this.data[0]%n; + else for(var i = this.t-1; i >= 0; --i) r = (d*r+this.data[i])%n; +return r; +} - async matchAll (request = undefined, options = {}) { - webidl.brandCheck(this, Cache) +//(public) 1/this % m (HAC 14.61) +function bnModInverse(m) { +var ac = m.isEven(); +if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO; +var u = m.clone(), v = this.clone(); +var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1); +while(u.signum() != 0) { + while(u.isEven()) { + u.rShiftTo(1,u); + if(ac) { + if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); } + a.rShiftTo(1,a); + } else if(!b.isEven()) b.subTo(m,b); + b.rShiftTo(1,b); + } + while(v.isEven()) { + v.rShiftTo(1,v); + if(ac) { + if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); } + c.rShiftTo(1,c); + } else if(!d.isEven()) d.subTo(m,d); + d.rShiftTo(1,d); + } + if(u.compareTo(v) >= 0) { + u.subTo(v,u); + if(ac) a.subTo(c,a); + b.subTo(d,b); + } else { + v.subTo(u,v); + if(ac) c.subTo(a,c); + d.subTo(b,d); + } +} +if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO; +if(d.compareTo(m) >= 0) return d.subtract(m); +if(d.signum() < 0) d.addTo(m,d); else return d; +if(d.signum() < 0) return d.add(m); else return d; +} - if (request !== undefined) request = webidl.converters.RequestInfo(request) - options = webidl.converters.CacheQueryOptions(options) +var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509]; +var lplim = (1<<26)/lowprimes[lowprimes.length-1]; - // 1. - let r = null +//(public) test primality with certainty >= 1-.5^t +function bnIsProbablePrime(t) { +var i, x = this.abs(); +if(x.t == 1 && x.data[0] <= lowprimes[lowprimes.length-1]) { + for(i = 0; i < lowprimes.length; ++i) + if(x.data[0] == lowprimes[i]) return true; + return false; +} +if(x.isEven()) return false; +i = 1; +while(i < lowprimes.length) { + var m = lowprimes[i], j = i+1; + while(j < lowprimes.length && m < lplim) m *= lowprimes[j++]; + m = x.modInt(m); + while(i < j) if(m%lowprimes[i++] == 0) return false; +} +return x.millerRabin(t); +} - // 2. - if (request !== undefined) { - if (request instanceof Request) { - // 2.1.1 - r = request[kState] +//(protected) true if probably prime (HAC 4.24, Miller-Rabin) +function bnpMillerRabin(t) { +var n1 = this.subtract(BigInteger.ONE); +var k = n1.getLowestSetBit(); +if(k <= 0) return false; +var r = n1.shiftRight(k); +var prng = bnGetPrng(); +var a; +for(var i = 0; i < t; ++i) { + // select witness 'a' at random from between 1 and n1 + do { + a = new BigInteger(this.bitLength(), prng); + } + while(a.compareTo(BigInteger.ONE) <= 0 || a.compareTo(n1) >= 0); + var y = a.modPow(r,this); + if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) { + var j = 1; + while(j++ < k && y.compareTo(n1) != 0) { + y = y.modPowInt(2,this); + if(y.compareTo(BigInteger.ONE) == 0) return false; + } + if(y.compareTo(n1) != 0) return false; + } +} +return true; +} - // 2.1.2 - if (r.method !== 'GET' && !options.ignoreMethod) { - return [] - } - } else if (typeof request === 'string') { - // 2.2.1 - r = new Request(request)[kState] +// get pseudo random number generator +function bnGetPrng() { + // create prng with api that matches BigInteger secure random + return { + // x is an array to fill with bytes + nextBytes: function(x) { + for(var i = 0; i < x.length; ++i) { + x[i] = Math.floor(Math.random() * 0x0100); } } + }; +} - // 5. - // 5.1 - const responses = [] +//protected +BigInteger.prototype.chunkSize = bnpChunkSize; +BigInteger.prototype.toRadix = bnpToRadix; +BigInteger.prototype.fromRadix = bnpFromRadix; +BigInteger.prototype.fromNumber = bnpFromNumber; +BigInteger.prototype.bitwiseTo = bnpBitwiseTo; +BigInteger.prototype.changeBit = bnpChangeBit; +BigInteger.prototype.addTo = bnpAddTo; +BigInteger.prototype.dMultiply = bnpDMultiply; +BigInteger.prototype.dAddOffset = bnpDAddOffset; +BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo; +BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo; +BigInteger.prototype.modInt = bnpModInt; +BigInteger.prototype.millerRabin = bnpMillerRabin; - // 5.2 - if (request === undefined) { - // 5.2.1 - for (const requestResponse of this.#relevantRequestResponseList) { - responses.push(requestResponse[1]) - } - } else { // 5.3 - // 5.3.1 - const requestResponses = this.#queryCache(r, options) +//public +BigInteger.prototype.clone = bnClone; +BigInteger.prototype.intValue = bnIntValue; +BigInteger.prototype.byteValue = bnByteValue; +BigInteger.prototype.shortValue = bnShortValue; +BigInteger.prototype.signum = bnSigNum; +BigInteger.prototype.toByteArray = bnToByteArray; +BigInteger.prototype.equals = bnEquals; +BigInteger.prototype.min = bnMin; +BigInteger.prototype.max = bnMax; +BigInteger.prototype.and = bnAnd; +BigInteger.prototype.or = bnOr; +BigInteger.prototype.xor = bnXor; +BigInteger.prototype.andNot = bnAndNot; +BigInteger.prototype.not = bnNot; +BigInteger.prototype.shiftLeft = bnShiftLeft; +BigInteger.prototype.shiftRight = bnShiftRight; +BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit; +BigInteger.prototype.bitCount = bnBitCount; +BigInteger.prototype.testBit = bnTestBit; +BigInteger.prototype.setBit = bnSetBit; +BigInteger.prototype.clearBit = bnClearBit; +BigInteger.prototype.flipBit = bnFlipBit; +BigInteger.prototype.add = bnAdd; +BigInteger.prototype.subtract = bnSubtract; +BigInteger.prototype.multiply = bnMultiply; +BigInteger.prototype.divide = bnDivide; +BigInteger.prototype.remainder = bnRemainder; +BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder; +BigInteger.prototype.modPow = bnModPow; +BigInteger.prototype.modInverse = bnModInverse; +BigInteger.prototype.pow = bnPow; +BigInteger.prototype.gcd = bnGCD; +BigInteger.prototype.isProbablePrime = bnIsProbablePrime; - // 5.3.2 - for (const requestResponse of requestResponses) { - responses.push(requestResponse[1]) - } - } +//BigInteger interfaces not implemented in jsbn: - // 5.4 - // We don't implement CORs so we don't need to loop over the responses, yay! +//BigInteger(int signum, byte[] magnitude) +//double doubleValue() +//float floatValue() +//int hashCode() +//long longValue() +//static BigInteger valueOf(long val) - // 5.5.1 - const responseList = [] - // 5.5.2 - for (const response of responses) { - // 5.5.2.1 - const responseObject = new Response(response.body?.source ?? null) - const body = responseObject[kState].body - responseObject[kState] = response - responseObject[kState].body = body - responseObject[kHeaders][kHeadersList] = response.headersList - responseObject[kHeaders][kGuard] = 'immutable' +/***/ }), - responseList.push(responseObject) - } +/***/ 48622: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // 6. - return Object.freeze(responseList) - } +/** + * Node.js module for Forge message digests. + * + * @author Dave Longley + * + * Copyright 2011-2017 Digital Bazaar, Inc. + */ +var forge = __nccwpck_require__(56389); - async add (request) { - webidl.brandCheck(this, Cache) - webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' }) +module.exports = forge.md = forge.md || {}; +forge.md.algorithms = forge.md.algorithms || {}; - request = webidl.converters.RequestInfo(request) - // 1. - const requests = [request] +/***/ }), - // 2. - const responseArrayPromise = this.addAll(requests) +/***/ 83175: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // 3. - return await responseArrayPromise - } +/** + * Object IDs for ASN.1. + * + * @author Dave Longley + * + * Copyright (c) 2010-2013 Digital Bazaar, Inc. + */ +var forge = __nccwpck_require__(56389); - async addAll (requests) { - webidl.brandCheck(this, Cache) - webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' }) +forge.pki = forge.pki || {}; +var oids = module.exports = forge.pki.oids = forge.oids = forge.oids || {}; - requests = webidl.converters['sequence'](requests) +// set id to name mapping and name to id mapping +function _IN(id, name) { + oids[id] = name; + oids[name] = id; +} +// set id to name mapping only +function _I_(id, name) { + oids[id] = name; +} - // 1. - const responsePromises = [] +// algorithm OIDs +_IN('1.2.840.113549.1.1.1', 'rsaEncryption'); +// Note: md2 & md4 not implemented +//_IN('1.2.840.113549.1.1.2', 'md2WithRSAEncryption'); +//_IN('1.2.840.113549.1.1.3', 'md4WithRSAEncryption'); +_IN('1.2.840.113549.1.1.4', 'md5WithRSAEncryption'); +_IN('1.2.840.113549.1.1.5', 'sha1WithRSAEncryption'); +_IN('1.2.840.113549.1.1.7', 'RSAES-OAEP'); +_IN('1.2.840.113549.1.1.8', 'mgf1'); +_IN('1.2.840.113549.1.1.9', 'pSpecified'); +_IN('1.2.840.113549.1.1.10', 'RSASSA-PSS'); +_IN('1.2.840.113549.1.1.11', 'sha256WithRSAEncryption'); +_IN('1.2.840.113549.1.1.12', 'sha384WithRSAEncryption'); +_IN('1.2.840.113549.1.1.13', 'sha512WithRSAEncryption'); +// Edwards-curve Digital Signature Algorithm (EdDSA) Ed25519 +_IN('1.3.101.112', 'EdDSA25519'); - // 2. - const requestList = [] +_IN('1.2.840.10040.4.3', 'dsa-with-sha1'); - // 3. - for (const request of requests) { - if (typeof request === 'string') { - continue - } +_IN('1.3.14.3.2.7', 'desCBC'); - // 3.1 - const r = request[kState] +_IN('1.3.14.3.2.26', 'sha1'); +_IN('2.16.840.1.101.3.4.2.1', 'sha256'); +_IN('2.16.840.1.101.3.4.2.2', 'sha384'); +_IN('2.16.840.1.101.3.4.2.3', 'sha512'); +_IN('1.2.840.113549.2.5', 'md5'); - // 3.2 - if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') { - throw webidl.errors.exception({ - header: 'Cache.addAll', - message: 'Expected http/s scheme when method is not GET.' - }) - } - } +// pkcs#7 content types +_IN('1.2.840.113549.1.7.1', 'data'); +_IN('1.2.840.113549.1.7.2', 'signedData'); +_IN('1.2.840.113549.1.7.3', 'envelopedData'); +_IN('1.2.840.113549.1.7.4', 'signedAndEnvelopedData'); +_IN('1.2.840.113549.1.7.5', 'digestedData'); +_IN('1.2.840.113549.1.7.6', 'encryptedData'); - // 4. - /** @type {ReturnType[]} */ - const fetchControllers = [] +// pkcs#9 oids +_IN('1.2.840.113549.1.9.1', 'emailAddress'); +_IN('1.2.840.113549.1.9.2', 'unstructuredName'); +_IN('1.2.840.113549.1.9.3', 'contentType'); +_IN('1.2.840.113549.1.9.4', 'messageDigest'); +_IN('1.2.840.113549.1.9.5', 'signingTime'); +_IN('1.2.840.113549.1.9.6', 'counterSignature'); +_IN('1.2.840.113549.1.9.7', 'challengePassword'); +_IN('1.2.840.113549.1.9.8', 'unstructuredAddress'); +_IN('1.2.840.113549.1.9.14', 'extensionRequest'); - // 5. - for (const request of requests) { - // 5.1 - const r = new Request(request)[kState] +_IN('1.2.840.113549.1.9.20', 'friendlyName'); +_IN('1.2.840.113549.1.9.21', 'localKeyId'); +_IN('1.2.840.113549.1.9.22.1', 'x509Certificate'); - // 5.2 - if (!urlIsHttpHttpsScheme(r.url)) { - throw webidl.errors.exception({ - header: 'Cache.addAll', - message: 'Expected http/s scheme.' - }) - } +// pkcs#12 safe bags +_IN('1.2.840.113549.1.12.10.1.1', 'keyBag'); +_IN('1.2.840.113549.1.12.10.1.2', 'pkcs8ShroudedKeyBag'); +_IN('1.2.840.113549.1.12.10.1.3', 'certBag'); +_IN('1.2.840.113549.1.12.10.1.4', 'crlBag'); +_IN('1.2.840.113549.1.12.10.1.5', 'secretBag'); +_IN('1.2.840.113549.1.12.10.1.6', 'safeContentsBag'); - // 5.4 - r.initiator = 'fetch' - r.destination = 'subresource' +// password-based-encryption for pkcs#12 +_IN('1.2.840.113549.1.5.13', 'pkcs5PBES2'); +_IN('1.2.840.113549.1.5.12', 'pkcs5PBKDF2'); - // 5.5 - requestList.push(r) +_IN('1.2.840.113549.1.12.1.1', 'pbeWithSHAAnd128BitRC4'); +_IN('1.2.840.113549.1.12.1.2', 'pbeWithSHAAnd40BitRC4'); +_IN('1.2.840.113549.1.12.1.3', 'pbeWithSHAAnd3-KeyTripleDES-CBC'); +_IN('1.2.840.113549.1.12.1.4', 'pbeWithSHAAnd2-KeyTripleDES-CBC'); +_IN('1.2.840.113549.1.12.1.5', 'pbeWithSHAAnd128BitRC2-CBC'); +_IN('1.2.840.113549.1.12.1.6', 'pbewithSHAAnd40BitRC2-CBC'); - // 5.6 - const responsePromise = createDeferredPromise() +// hmac OIDs +_IN('1.2.840.113549.2.7', 'hmacWithSHA1'); +_IN('1.2.840.113549.2.8', 'hmacWithSHA224'); +_IN('1.2.840.113549.2.9', 'hmacWithSHA256'); +_IN('1.2.840.113549.2.10', 'hmacWithSHA384'); +_IN('1.2.840.113549.2.11', 'hmacWithSHA512'); - // 5.7 - fetchControllers.push(fetching({ - request: r, - dispatcher: getGlobalDispatcher(), - processResponse (response) { - // 1. - if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) { - responsePromise.reject(webidl.errors.exception({ - header: 'Cache.addAll', - message: 'Received an invalid status code or the request failed.' - })) - } else if (response.headersList.contains('vary')) { // 2. - // 2.1 - const fieldValues = getFieldValues(response.headersList.get('vary')) +// symmetric key algorithm oids +_IN('1.2.840.113549.3.7', 'des-EDE3-CBC'); +_IN('2.16.840.1.101.3.4.1.2', 'aes128-CBC'); +_IN('2.16.840.1.101.3.4.1.22', 'aes192-CBC'); +_IN('2.16.840.1.101.3.4.1.42', 'aes256-CBC'); - // 2.2 - for (const fieldValue of fieldValues) { - // 2.2.1 - if (fieldValue === '*') { - responsePromise.reject(webidl.errors.exception({ - header: 'Cache.addAll', - message: 'invalid vary field value' - })) +// certificate issuer/subject OIDs +_IN('2.5.4.3', 'commonName'); +_IN('2.5.4.5', 'serialName'); +_IN('2.5.4.6', 'countryName'); +_IN('2.5.4.7', 'localityName'); +_IN('2.5.4.8', 'stateOrProvinceName'); +_IN('2.5.4.9', 'streetAddress'); +_IN('2.5.4.10', 'organizationName'); +_IN('2.5.4.11', 'organizationalUnitName'); +_IN('2.5.4.13', 'description'); +_IN('2.5.4.15', 'businessCategory'); +_IN('2.5.4.17', 'postalCode'); +_IN('1.3.6.1.4.1.311.60.2.1.2', 'jurisdictionOfIncorporationStateOrProvinceName'); +_IN('1.3.6.1.4.1.311.60.2.1.3', 'jurisdictionOfIncorporationCountryName'); - for (const controller of fetchControllers) { - controller.abort() - } +// X.509 extension OIDs +_IN('2.16.840.1.113730.1.1', 'nsCertType'); +_IN('2.16.840.1.113730.1.13', 'nsComment'); // deprecated in theory; still widely used +_I_('2.5.29.1', 'authorityKeyIdentifier'); // deprecated, use .35 +_I_('2.5.29.2', 'keyAttributes'); // obsolete use .37 or .15 +_I_('2.5.29.3', 'certificatePolicies'); // deprecated, use .32 +_I_('2.5.29.4', 'keyUsageRestriction'); // obsolete use .37 or .15 +_I_('2.5.29.5', 'policyMapping'); // deprecated use .33 +_I_('2.5.29.6', 'subtreesConstraint'); // obsolete use .30 +_I_('2.5.29.7', 'subjectAltName'); // deprecated use .17 +_I_('2.5.29.8', 'issuerAltName'); // deprecated use .18 +_I_('2.5.29.9', 'subjectDirectoryAttributes'); +_I_('2.5.29.10', 'basicConstraints'); // deprecated use .19 +_I_('2.5.29.11', 'nameConstraints'); // deprecated use .30 +_I_('2.5.29.12', 'policyConstraints'); // deprecated use .36 +_I_('2.5.29.13', 'basicConstraints'); // deprecated use .19 +_IN('2.5.29.14', 'subjectKeyIdentifier'); +_IN('2.5.29.15', 'keyUsage'); +_I_('2.5.29.16', 'privateKeyUsagePeriod'); +_IN('2.5.29.17', 'subjectAltName'); +_IN('2.5.29.18', 'issuerAltName'); +_IN('2.5.29.19', 'basicConstraints'); +_I_('2.5.29.20', 'cRLNumber'); +_I_('2.5.29.21', 'cRLReason'); +_I_('2.5.29.22', 'expirationDate'); +_I_('2.5.29.23', 'instructionCode'); +_I_('2.5.29.24', 'invalidityDate'); +_I_('2.5.29.25', 'cRLDistributionPoints'); // deprecated use .31 +_I_('2.5.29.26', 'issuingDistributionPoint'); // deprecated use .28 +_I_('2.5.29.27', 'deltaCRLIndicator'); +_I_('2.5.29.28', 'issuingDistributionPoint'); +_I_('2.5.29.29', 'certificateIssuer'); +_I_('2.5.29.30', 'nameConstraints'); +_IN('2.5.29.31', 'cRLDistributionPoints'); +_IN('2.5.29.32', 'certificatePolicies'); +_I_('2.5.29.33', 'policyMappings'); +_I_('2.5.29.34', 'policyConstraints'); // deprecated use .36 +_IN('2.5.29.35', 'authorityKeyIdentifier'); +_I_('2.5.29.36', 'policyConstraints'); +_IN('2.5.29.37', 'extKeyUsage'); +_I_('2.5.29.46', 'freshestCRL'); +_I_('2.5.29.54', 'inhibitAnyPolicy'); - return - } - } - } - }, - processResponseEndOfBody (response) { - // 1. - if (response.aborted) { - responsePromise.reject(new DOMException('aborted', 'AbortError')) - return - } +// extKeyUsage purposes +_IN('1.3.6.1.4.1.11129.2.4.2', 'timestampList'); +_IN('1.3.6.1.5.5.7.1.1', 'authorityInfoAccess'); +_IN('1.3.6.1.5.5.7.3.1', 'serverAuth'); +_IN('1.3.6.1.5.5.7.3.2', 'clientAuth'); +_IN('1.3.6.1.5.5.7.3.3', 'codeSigning'); +_IN('1.3.6.1.5.5.7.3.4', 'emailProtection'); +_IN('1.3.6.1.5.5.7.3.8', 'timeStamping'); - // 2. - responsePromise.resolve(response) - } - })) - // 5.8 - responsePromises.push(responsePromise.promise) - } +/***/ }), - // 6. - const p = Promise.all(responsePromises) +/***/ 55363: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // 7. - const responses = await p +/** + * Password-based encryption functions. + * + * @author Dave Longley + * @author Stefan Siegl + * + * Copyright (c) 2010-2013 Digital Bazaar, Inc. + * Copyright (c) 2012 Stefan Siegl + * + * An EncryptedPrivateKeyInfo: + * + * EncryptedPrivateKeyInfo ::= SEQUENCE { + * encryptionAlgorithm EncryptionAlgorithmIdentifier, + * encryptedData EncryptedData } + * + * EncryptionAlgorithmIdentifier ::= AlgorithmIdentifier + * + * EncryptedData ::= OCTET STRING + */ +var forge = __nccwpck_require__(56389); +__nccwpck_require__(59745); +__nccwpck_require__(14098); +__nccwpck_require__(19023); +__nccwpck_require__(48622); +__nccwpck_require__(83175); +__nccwpck_require__(23922); +__nccwpck_require__(75321); +__nccwpck_require__(62544); +__nccwpck_require__(99879); +__nccwpck_require__(62175); +__nccwpck_require__(65138); - // 7.1 - const operations = [] +if(typeof BigInteger === 'undefined') { + var BigInteger = forge.jsbn.BigInteger; +} - // 7.2 - let index = 0 +// shortcut for asn.1 API +var asn1 = forge.asn1; - // 7.3 - for (const response of responses) { - // 7.3.1 - /** @type {CacheBatchOperation} */ - const operation = { - type: 'put', // 7.3.2 - request: requestList[index], // 7.3.3 - response // 7.3.4 - } +/* Password-based encryption implementation. */ +var pki = forge.pki = forge.pki || {}; +module.exports = pki.pbe = forge.pbe = forge.pbe || {}; +var oids = pki.oids; + +// validator for an EncryptedPrivateKeyInfo structure +// Note: Currently only works w/algorithm params +var encryptedPrivateKeyValidator = { + name: 'EncryptedPrivateKeyInfo', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.SEQUENCE, + constructed: true, + value: [{ + name: 'EncryptedPrivateKeyInfo.encryptionAlgorithm', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.SEQUENCE, + constructed: true, + value: [{ + name: 'AlgorithmIdentifier.algorithm', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.OID, + constructed: false, + capture: 'encryptionOid' + }, { + name: 'AlgorithmIdentifier.parameters', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.SEQUENCE, + constructed: true, + captureAsn1: 'encryptionParams' + }] + }, { + // encryptedData + name: 'EncryptedPrivateKeyInfo.encryptedData', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.OCTETSTRING, + constructed: false, + capture: 'encryptedData' + }] +}; + +// validator for a PBES2Algorithms structure +// Note: Currently only works w/PBKDF2 + AES encryption schemes +var PBES2AlgorithmsValidator = { + name: 'PBES2Algorithms', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.SEQUENCE, + constructed: true, + value: [{ + name: 'PBES2Algorithms.keyDerivationFunc', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.SEQUENCE, + constructed: true, + value: [{ + name: 'PBES2Algorithms.keyDerivationFunc.oid', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.OID, + constructed: false, + capture: 'kdfOid' + }, { + name: 'PBES2Algorithms.params', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.SEQUENCE, + constructed: true, + value: [{ + name: 'PBES2Algorithms.params.salt', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.OCTETSTRING, + constructed: false, + capture: 'kdfSalt' + }, { + name: 'PBES2Algorithms.params.iterationCount', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.INTEGER, + constructed: false, + capture: 'kdfIterationCount' + }, { + name: 'PBES2Algorithms.params.keyLength', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.INTEGER, + constructed: false, + optional: true, + capture: 'keyLength' + }, { + // prf + name: 'PBES2Algorithms.params.prf', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.SEQUENCE, + constructed: true, + optional: true, + value: [{ + name: 'PBES2Algorithms.params.prf.algorithm', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.OID, + constructed: false, + capture: 'prfOid' + }] + }] + }] + }, { + name: 'PBES2Algorithms.encryptionScheme', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.SEQUENCE, + constructed: true, + value: [{ + name: 'PBES2Algorithms.encryptionScheme.oid', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.OID, + constructed: false, + capture: 'encOid' + }, { + name: 'PBES2Algorithms.encryptionScheme.iv', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.OCTETSTRING, + constructed: false, + capture: 'encIv' + }] + }] +}; + +var pkcs12PbeParamsValidator = { + name: 'pkcs-12PbeParams', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.SEQUENCE, + constructed: true, + value: [{ + name: 'pkcs-12PbeParams.salt', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.OCTETSTRING, + constructed: false, + capture: 'salt' + }, { + name: 'pkcs-12PbeParams.iterations', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.INTEGER, + constructed: false, + capture: 'iterations' + }] +}; - operations.push(operation) // 7.3.5 +/** + * Encrypts a ASN.1 PrivateKeyInfo object, producing an EncryptedPrivateKeyInfo. + * + * PBES2Algorithms ALGORITHM-IDENTIFIER ::= + * { {PBES2-params IDENTIFIED BY id-PBES2}, ...} + * + * id-PBES2 OBJECT IDENTIFIER ::= {pkcs-5 13} + * + * PBES2-params ::= SEQUENCE { + * keyDerivationFunc AlgorithmIdentifier {{PBES2-KDFs}}, + * encryptionScheme AlgorithmIdentifier {{PBES2-Encs}} + * } + * + * PBES2-KDFs ALGORITHM-IDENTIFIER ::= + * { {PBKDF2-params IDENTIFIED BY id-PBKDF2}, ... } + * + * PBES2-Encs ALGORITHM-IDENTIFIER ::= { ... } + * + * PBKDF2-params ::= SEQUENCE { + * salt CHOICE { + * specified OCTET STRING, + * otherSource AlgorithmIdentifier {{PBKDF2-SaltSources}} + * }, + * iterationCount INTEGER (1..MAX), + * keyLength INTEGER (1..MAX) OPTIONAL, + * prf AlgorithmIdentifier {{PBKDF2-PRFs}} DEFAULT algid-hmacWithSHA1 + * } + * + * @param obj the ASN.1 PrivateKeyInfo object. + * @param password the password to encrypt with. + * @param options: + * algorithm the encryption algorithm to use + * ('aes128', 'aes192', 'aes256', '3des'), defaults to 'aes128'. + * count the iteration count to use. + * saltSize the salt size to use. + * prfAlgorithm the PRF message digest algorithm to use + * ('sha1', 'sha224', 'sha256', 'sha384', 'sha512') + * + * @return the ASN.1 EncryptedPrivateKeyInfo. + */ +pki.encryptPrivateKeyInfo = function(obj, password, options) { + // set default options + options = options || {}; + options.saltSize = options.saltSize || 8; + options.count = options.count || 2048; + options.algorithm = options.algorithm || 'aes128'; + options.prfAlgorithm = options.prfAlgorithm || 'sha1'; - index++ // 7.3.6 + // generate PBE params + var salt = forge.random.getBytesSync(options.saltSize); + var count = options.count; + var countBytes = asn1.integerToDer(count); + var dkLen; + var encryptionAlgorithm; + var encryptedData; + if(options.algorithm.indexOf('aes') === 0 || options.algorithm === 'des') { + // do PBES2 + var ivLen, encOid, cipherFn; + switch(options.algorithm) { + case 'aes128': + dkLen = 16; + ivLen = 16; + encOid = oids['aes128-CBC']; + cipherFn = forge.aes.createEncryptionCipher; + break; + case 'aes192': + dkLen = 24; + ivLen = 16; + encOid = oids['aes192-CBC']; + cipherFn = forge.aes.createEncryptionCipher; + break; + case 'aes256': + dkLen = 32; + ivLen = 16; + encOid = oids['aes256-CBC']; + cipherFn = forge.aes.createEncryptionCipher; + break; + case 'des': + dkLen = 8; + ivLen = 8; + encOid = oids['desCBC']; + cipherFn = forge.des.createEncryptionCipher; + break; + default: + var error = new Error('Cannot encrypt private key. Unknown encryption algorithm.'); + error.algorithm = options.algorithm; + throw error; } - // 7.5 - const cacheJobPromise = createDeferredPromise() + // get PRF message digest + var prfAlgorithm = 'hmacWith' + options.prfAlgorithm.toUpperCase(); + var md = prfAlgorithmToMessageDigest(prfAlgorithm); - // 7.6.1 - let errorData = null + // encrypt private key using pbe SHA-1 and AES/DES + var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md); + var iv = forge.random.getBytesSync(ivLen); + var cipher = cipherFn(dk); + cipher.start(iv); + cipher.update(asn1.toDer(obj)); + cipher.finish(); + encryptedData = cipher.output.getBytes(); - // 7.6.2 - try { - this.#batchCacheOperations(operations) - } catch (e) { - errorData = e - } + // get PBKDF2-params + var params = createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm); - // 7.6.3 - queueMicrotask(() => { - // 7.6.3.1 - if (errorData === null) { - cacheJobPromise.resolve(undefined) - } else { - // 7.6.3.2 - cacheJobPromise.reject(errorData) - } - }) + encryptionAlgorithm = asn1.create( + asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, + asn1.oidToDer(oids['pkcs5PBES2']).getBytes()), + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ + // keyDerivationFunc + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, + asn1.oidToDer(oids['pkcs5PBKDF2']).getBytes()), + // PBKDF2-params + params + ]), + // encryptionScheme + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, + asn1.oidToDer(encOid).getBytes()), + // iv + asn1.create( + asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, iv) + ]) + ]) + ]); + } else if(options.algorithm === '3des') { + // Do PKCS12 PBE + dkLen = 24; - // 7.7 - return cacheJobPromise.promise - } + var saltBytes = new forge.util.ByteBuffer(salt); + var dk = pki.pbe.generatePkcs12Key(password, saltBytes, 1, count, dkLen); + var iv = pki.pbe.generatePkcs12Key(password, saltBytes, 2, count, dkLen); + var cipher = forge.des.createEncryptionCipher(dk); + cipher.start(iv); + cipher.update(asn1.toDer(obj)); + cipher.finish(); + encryptedData = cipher.output.getBytes(); - async put (request, response) { - webidl.brandCheck(this, Cache) - webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' }) + encryptionAlgorithm = asn1.create( + asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, + asn1.oidToDer(oids['pbeWithSHAAnd3-KeyTripleDES-CBC']).getBytes()), + // pkcs-12PbeParams + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ + // salt + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, salt), + // iteration count + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, + countBytes.getBytes()) + ]) + ]); + } else { + var error = new Error('Cannot encrypt private key. Unknown encryption algorithm.'); + error.algorithm = options.algorithm; + throw error; + } - request = webidl.converters.RequestInfo(request) - response = webidl.converters.Response(response) + // EncryptedPrivateKeyInfo + var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ + // encryptionAlgorithm + encryptionAlgorithm, + // encryptedData + asn1.create( + asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, encryptedData) + ]); + return rval; +}; - // 1. - let innerRequest = null +/** + * Decrypts a ASN.1 PrivateKeyInfo object. + * + * @param obj the ASN.1 EncryptedPrivateKeyInfo object. + * @param password the password to decrypt with. + * + * @return the ASN.1 PrivateKeyInfo on success, null on failure. + */ +pki.decryptPrivateKeyInfo = function(obj, password) { + var rval = null; - // 2. - if (request instanceof Request) { - innerRequest = request[kState] - } else { // 3. - innerRequest = new Request(request)[kState] - } + // get PBE params + var capture = {}; + var errors = []; + if(!asn1.validate(obj, encryptedPrivateKeyValidator, capture, errors)) { + var error = new Error('Cannot read encrypted private key. ' + + 'ASN.1 object is not a supported EncryptedPrivateKeyInfo.'); + error.errors = errors; + throw error; + } - // 4. - if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') { - throw webidl.errors.exception({ - header: 'Cache.put', - message: 'Expected an http/s scheme when method is not GET' - }) - } + // get cipher + var oid = asn1.derToOid(capture.encryptionOid); + var cipher = pki.pbe.getCipher(oid, capture.encryptionParams, password); - // 5. - const innerResponse = response[kState] + // get encrypted data + var encrypted = forge.util.createBuffer(capture.encryptedData); - // 6. - if (innerResponse.status === 206) { - throw webidl.errors.exception({ - header: 'Cache.put', - message: 'Got 206 status' - }) - } + cipher.update(encrypted); + if(cipher.finish()) { + rval = asn1.fromDer(cipher.output); + } - // 7. - if (innerResponse.headersList.contains('vary')) { - // 7.1. - const fieldValues = getFieldValues(innerResponse.headersList.get('vary')) + return rval; +}; - // 7.2. - for (const fieldValue of fieldValues) { - // 7.2.1 - if (fieldValue === '*') { - throw webidl.errors.exception({ - header: 'Cache.put', - message: 'Got * vary field value' - }) - } - } - } +/** + * Converts a EncryptedPrivateKeyInfo to PEM format. + * + * @param epki the EncryptedPrivateKeyInfo. + * @param maxline the maximum characters per line, defaults to 64. + * + * @return the PEM-formatted encrypted private key. + */ +pki.encryptedPrivateKeyToPem = function(epki, maxline) { + // convert to DER, then PEM-encode + var msg = { + type: 'ENCRYPTED PRIVATE KEY', + body: asn1.toDer(epki).getBytes() + }; + return forge.pem.encode(msg, {maxline: maxline}); +}; - // 8. - if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) { - throw webidl.errors.exception({ - header: 'Cache.put', - message: 'Response body is locked or disturbed' - }) - } +/** + * Converts a PEM-encoded EncryptedPrivateKeyInfo to ASN.1 format. Decryption + * is not performed. + * + * @param pem the EncryptedPrivateKeyInfo in PEM-format. + * + * @return the ASN.1 EncryptedPrivateKeyInfo. + */ +pki.encryptedPrivateKeyFromPem = function(pem) { + var msg = forge.pem.decode(pem)[0]; - // 9. - const clonedResponse = cloneResponse(innerResponse) + if(msg.type !== 'ENCRYPTED PRIVATE KEY') { + var error = new Error('Could not convert encrypted private key from PEM; ' + + 'PEM header type is "ENCRYPTED PRIVATE KEY".'); + error.headerType = msg.type; + throw error; + } + if(msg.procType && msg.procType.type === 'ENCRYPTED') { + throw new Error('Could not convert encrypted private key from PEM; ' + + 'PEM is encrypted.'); + } - // 10. - const bodyReadPromise = createDeferredPromise() + // convert DER to ASN.1 object + return asn1.fromDer(msg.body); +}; - // 11. - if (innerResponse.body != null) { - // 11.1 - const stream = innerResponse.body.stream +/** + * Encrypts an RSA private key. By default, the key will be wrapped in + * a PrivateKeyInfo and encrypted to produce a PKCS#8 EncryptedPrivateKeyInfo. + * This is the standard, preferred way to encrypt a private key. + * + * To produce a non-standard PEM-encrypted private key that uses encapsulated + * headers to indicate the encryption algorithm (old-style non-PKCS#8 OpenSSL + * private key encryption), set the 'legacy' option to true. Note: Using this + * option will cause the iteration count to be forced to 1. + * + * Note: The 'des' algorithm is supported, but it is not considered to be + * secure because it only uses a single 56-bit key. If possible, it is highly + * recommended that a different algorithm be used. + * + * @param rsaKey the RSA key to encrypt. + * @param password the password to use. + * @param options: + * algorithm: the encryption algorithm to use + * ('aes128', 'aes192', 'aes256', '3des', 'des'). + * count: the iteration count to use. + * saltSize: the salt size to use. + * legacy: output an old non-PKCS#8 PEM-encrypted+encapsulated + * headers (DEK-Info) private key. + * + * @return the PEM-encoded ASN.1 EncryptedPrivateKeyInfo. + */ +pki.encryptRsaPrivateKey = function(rsaKey, password, options) { + // standard PKCS#8 + options = options || {}; + if(!options.legacy) { + // encrypt PrivateKeyInfo + var rval = pki.wrapRsaPrivateKey(pki.privateKeyToAsn1(rsaKey)); + rval = pki.encryptPrivateKeyInfo(rval, password, options); + return pki.encryptedPrivateKeyToPem(rval); + } - // 11.2 - const reader = stream.getReader() + // legacy non-PKCS#8 + var algorithm; + var iv; + var dkLen; + var cipherFn; + switch(options.algorithm) { + case 'aes128': + algorithm = 'AES-128-CBC'; + dkLen = 16; + iv = forge.random.getBytesSync(16); + cipherFn = forge.aes.createEncryptionCipher; + break; + case 'aes192': + algorithm = 'AES-192-CBC'; + dkLen = 24; + iv = forge.random.getBytesSync(16); + cipherFn = forge.aes.createEncryptionCipher; + break; + case 'aes256': + algorithm = 'AES-256-CBC'; + dkLen = 32; + iv = forge.random.getBytesSync(16); + cipherFn = forge.aes.createEncryptionCipher; + break; + case '3des': + algorithm = 'DES-EDE3-CBC'; + dkLen = 24; + iv = forge.random.getBytesSync(8); + cipherFn = forge.des.createEncryptionCipher; + break; + case 'des': + algorithm = 'DES-CBC'; + dkLen = 8; + iv = forge.random.getBytesSync(8); + cipherFn = forge.des.createEncryptionCipher; + break; + default: + var error = new Error('Could not encrypt RSA private key; unsupported ' + + 'encryption algorithm "' + options.algorithm + '".'); + error.algorithm = options.algorithm; + throw error; + } - // 11.3 - readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject) - } else { - bodyReadPromise.resolve(undefined) - } + // encrypt private key using OpenSSL legacy key derivation + var dk = forge.pbe.opensslDeriveBytes(password, iv.substr(0, 8), dkLen); + var cipher = cipherFn(dk); + cipher.start(iv); + cipher.update(asn1.toDer(pki.privateKeyToAsn1(rsaKey))); + cipher.finish(); - // 12. - /** @type {CacheBatchOperation[]} */ - const operations = [] + var msg = { + type: 'RSA PRIVATE KEY', + procType: { + version: '4', + type: 'ENCRYPTED' + }, + dekInfo: { + algorithm: algorithm, + parameters: forge.util.bytesToHex(iv).toUpperCase() + }, + body: cipher.output.getBytes() + }; + return forge.pem.encode(msg); +}; - // 13. - /** @type {CacheBatchOperation} */ - const operation = { - type: 'put', // 14. - request: innerRequest, // 15. - response: clonedResponse // 16. - } +/** + * Decrypts an RSA private key. + * + * @param pem the PEM-formatted EncryptedPrivateKeyInfo to decrypt. + * @param password the password to use. + * + * @return the RSA key on success, null on failure. + */ +pki.decryptRsaPrivateKey = function(pem, password) { + var rval = null; - // 17. - operations.push(operation) + var msg = forge.pem.decode(pem)[0]; - // 19. - const bytes = await bodyReadPromise.promise + if(msg.type !== 'ENCRYPTED PRIVATE KEY' && + msg.type !== 'PRIVATE KEY' && + msg.type !== 'RSA PRIVATE KEY') { + var error = new Error('Could not convert private key from PEM; PEM header type ' + + 'is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".'); + error.headerType = error; + throw error; + } - if (clonedResponse.body != null) { - clonedResponse.body.source = bytes + if(msg.procType && msg.procType.type === 'ENCRYPTED') { + var dkLen; + var cipherFn; + switch(msg.dekInfo.algorithm) { + case 'DES-CBC': + dkLen = 8; + cipherFn = forge.des.createDecryptionCipher; + break; + case 'DES-EDE3-CBC': + dkLen = 24; + cipherFn = forge.des.createDecryptionCipher; + break; + case 'AES-128-CBC': + dkLen = 16; + cipherFn = forge.aes.createDecryptionCipher; + break; + case 'AES-192-CBC': + dkLen = 24; + cipherFn = forge.aes.createDecryptionCipher; + break; + case 'AES-256-CBC': + dkLen = 32; + cipherFn = forge.aes.createDecryptionCipher; + break; + case 'RC2-40-CBC': + dkLen = 5; + cipherFn = function(key) { + return forge.rc2.createDecryptionCipher(key, 40); + }; + break; + case 'RC2-64-CBC': + dkLen = 8; + cipherFn = function(key) { + return forge.rc2.createDecryptionCipher(key, 64); + }; + break; + case 'RC2-128-CBC': + dkLen = 16; + cipherFn = function(key) { + return forge.rc2.createDecryptionCipher(key, 128); + }; + break; + default: + var error = new Error('Could not decrypt private key; unsupported ' + + 'encryption algorithm "' + msg.dekInfo.algorithm + '".'); + error.algorithm = msg.dekInfo.algorithm; + throw error; } - // 19.1 - const cacheJobPromise = createDeferredPromise() - - // 19.2.1 - let errorData = null - - // 19.2.2 - try { - this.#batchCacheOperations(operations) - } catch (e) { - errorData = e + // use OpenSSL legacy key derivation + var iv = forge.util.hexToBytes(msg.dekInfo.parameters); + var dk = forge.pbe.opensslDeriveBytes(password, iv.substr(0, 8), dkLen); + var cipher = cipherFn(dk); + cipher.start(iv); + cipher.update(forge.util.createBuffer(msg.body)); + if(cipher.finish()) { + rval = cipher.output.getBytes(); + } else { + return rval; } - - // 19.2.3 - queueMicrotask(() => { - // 19.2.3.1 - if (errorData === null) { - cacheJobPromise.resolve() - } else { // 19.2.3.2 - cacheJobPromise.reject(errorData) - } - }) - - return cacheJobPromise.promise + } else { + rval = msg.body; } - async delete (request, options = {}) { - webidl.brandCheck(this, Cache) - webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' }) - - request = webidl.converters.RequestInfo(request) - options = webidl.converters.CacheQueryOptions(options) + if(msg.type === 'ENCRYPTED PRIVATE KEY') { + rval = pki.decryptPrivateKeyInfo(asn1.fromDer(rval), password); + } else { + // decryption already performed above + rval = asn1.fromDer(rval); + } - /** - * @type {Request} - */ - let r = null + if(rval !== null) { + rval = pki.privateKeyFromAsn1(rval); + } - if (request instanceof Request) { - r = request[kState] + return rval; +}; - if (r.method !== 'GET' && !options.ignoreMethod) { - return false - } - } else { - assert(typeof request === 'string') +/** + * Derives a PKCS#12 key. + * + * @param password the password to derive the key material from, null or + * undefined for none. + * @param salt the salt, as a ByteBuffer, to use. + * @param id the PKCS#12 ID byte (1 = key material, 2 = IV, 3 = MAC). + * @param iter the iteration count. + * @param n the number of bytes to derive from the password. + * @param md the message digest to use, defaults to SHA-1. + * + * @return a ByteBuffer with the bytes derived from the password. + */ +pki.pbe.generatePkcs12Key = function(password, salt, id, iter, n, md) { + var j, l; - r = new Request(request)[kState] + if(typeof md === 'undefined' || md === null) { + if(!('sha1' in forge.md)) { + throw new Error('"sha1" hash algorithm unavailable.'); } + md = forge.md.sha1.create(); + } - /** @type {CacheBatchOperation[]} */ - const operations = [] + var u = md.digestLength; + var v = md.blockLength; + var result = new forge.util.ByteBuffer(); - /** @type {CacheBatchOperation} */ - const operation = { - type: 'delete', - request: r, - options + /* Convert password to Unicode byte buffer + trailing 0-byte. */ + var passBuf = new forge.util.ByteBuffer(); + if(password !== null && password !== undefined) { + for(l = 0; l < password.length; l++) { + passBuf.putInt16(password.charCodeAt(l)); } + passBuf.putInt16(0); + } - operations.push(operation) - - const cacheJobPromise = createDeferredPromise() - - let errorData = null - let requestResponses - - try { - requestResponses = this.#batchCacheOperations(operations) - } catch (e) { - errorData = e - } + /* Length of salt and password in BYTES. */ + var p = passBuf.length(); + var s = salt.length(); - queueMicrotask(() => { - if (errorData === null) { - cacheJobPromise.resolve(!!requestResponses?.length) - } else { - cacheJobPromise.reject(errorData) - } - }) + /* 1. Construct a string, D (the "diversifier"), by concatenating + v copies of ID. */ + var D = new forge.util.ByteBuffer(); + D.fillWithByte(id, v); - return cacheJobPromise.promise + /* 2. Concatenate copies of the salt together to create a string S of length + v * ceil(s / v) bytes (the final copy of the salt may be trunacted + to create S). + Note that if the salt is the empty string, then so is S. */ + var Slen = v * Math.ceil(s / v); + var S = new forge.util.ByteBuffer(); + for(l = 0; l < Slen; l++) { + S.putByte(salt.at(l % s)); } - /** - * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys - * @param {any} request - * @param {import('../../types/cache').CacheQueryOptions} options - * @returns {readonly Request[]} - */ - async keys (request = undefined, options = {}) { - webidl.brandCheck(this, Cache) - - if (request !== undefined) request = webidl.converters.RequestInfo(request) - options = webidl.converters.CacheQueryOptions(options) + /* 3. Concatenate copies of the password together to create a string P of + length v * ceil(p / v) bytes (the final copy of the password may be + truncated to create P). + Note that if the password is the empty string, then so is P. */ + var Plen = v * Math.ceil(p / v); + var P = new forge.util.ByteBuffer(); + for(l = 0; l < Plen; l++) { + P.putByte(passBuf.at(l % p)); + } - // 1. - let r = null + /* 4. Set I=S||P to be the concatenation of S and P. */ + var I = S; + I.putBuffer(P); - // 2. - if (request !== undefined) { - // 2.1 - if (request instanceof Request) { - // 2.1.1 - r = request[kState] + /* 5. Set c=ceil(n / u). */ + var c = Math.ceil(n / u); - // 2.1.2 - if (r.method !== 'GET' && !options.ignoreMethod) { - return [] - } - } else if (typeof request === 'string') { // 2.2 - r = new Request(request)[kState] - } + /* 6. For i=1, 2, ..., c, do the following: */ + for(var i = 1; i <= c; i++) { + /* a) Set Ai=H^r(D||I). (l.e. the rth hash of D||I, H(H(H(...H(D||I)))) */ + var buf = new forge.util.ByteBuffer(); + buf.putBytes(D.bytes()); + buf.putBytes(I.bytes()); + for(var round = 0; round < iter; round++) { + md.start(); + md.update(buf.getBytes()); + buf = md.digest(); } - // 4. - const promise = createDeferredPromise() - - // 5. - // 5.1 - const requests = [] - - // 5.2 - if (request === undefined) { - // 5.2.1 - for (const requestResponse of this.#relevantRequestResponseList) { - // 5.2.1.1 - requests.push(requestResponse[0]) - } - } else { // 5.3 - // 5.3.1 - const requestResponses = this.#queryCache(r, options) - - // 5.3.2 - for (const requestResponse of requestResponses) { - // 5.3.2.1 - requests.push(requestResponse[0]) - } + /* b) Concatenate copies of Ai to create a string B of length v bytes (the + final copy of Ai may be truncated to create B). */ + var B = new forge.util.ByteBuffer(); + for(l = 0; l < v; l++) { + B.putByte(buf.at(l % u)); } - // 5.4 - queueMicrotask(() => { - // 5.4.1 - const requestList = [] - - // 5.4.2 - for (const request of requests) { - const requestObject = new Request('https://a') - requestObject[kState] = request - requestObject[kHeaders][kHeadersList] = request.headersList - requestObject[kHeaders][kGuard] = 'immutable' - requestObject[kRealm] = request.client - - // 5.4.2.1 - requestList.push(requestObject) + /* c) Treating I as a concatenation I0, I1, ..., Ik-1 of v-byte blocks, + where k=ceil(s / v) + ceil(p / v), modify I by setting + Ij=(Ij+B+1) mod 2v for each j. */ + var k = Math.ceil(s / v) + Math.ceil(p / v); + var Inew = new forge.util.ByteBuffer(); + for(j = 0; j < k; j++) { + var chunk = new forge.util.ByteBuffer(I.getBytes(v)); + var x = 0x1ff; + for(l = B.length() - 1; l >= 0; l--) { + x = x >> 8; + x += B.at(l) + chunk.at(l); + chunk.setAt(l, x & 0xff); } + Inew.putBuffer(chunk); + } + I = Inew; - // 5.4.3 - promise.resolve(Object.freeze(requestList)) - }) - - return promise.promise + /* Add Ai to A. */ + result.putBuffer(buf); } - /** - * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm - * @param {CacheBatchOperation[]} operations - * @returns {requestResponseList} - */ - #batchCacheOperations (operations) { - // 1. - const cache = this.#relevantRequestResponseList - - // 2. - const backupCache = [...cache] - - // 3. - const addedItems = [] - - // 4.1 - const resultList = [] - - try { - // 4.2 - for (const operation of operations) { - // 4.2.1 - if (operation.type !== 'delete' && operation.type !== 'put') { - throw webidl.errors.exception({ - header: 'Cache.#batchCacheOperations', - message: 'operation type does not match "delete" or "put"' - }) - } - - // 4.2.2 - if (operation.type === 'delete' && operation.response != null) { - throw webidl.errors.exception({ - header: 'Cache.#batchCacheOperations', - message: 'delete operation should not have an associated response' - }) - } - - // 4.2.3 - if (this.#queryCache(operation.request, operation.options, addedItems).length) { - throw new DOMException('???', 'InvalidStateError') - } - - // 4.2.4 - let requestResponses - - // 4.2.5 - if (operation.type === 'delete') { - // 4.2.5.1 - requestResponses = this.#queryCache(operation.request, operation.options) - - // TODO: the spec is wrong, this is needed to pass WPTs - if (requestResponses.length === 0) { - return [] - } - - // 4.2.5.2 - for (const requestResponse of requestResponses) { - const idx = cache.indexOf(requestResponse) - assert(idx !== -1) - - // 4.2.5.2.1 - cache.splice(idx, 1) - } - } else if (operation.type === 'put') { // 4.2.6 - // 4.2.6.1 - if (operation.response == null) { - throw webidl.errors.exception({ - header: 'Cache.#batchCacheOperations', - message: 'put operation should have an associated response' - }) - } - - // 4.2.6.2 - const r = operation.request - - // 4.2.6.3 - if (!urlIsHttpHttpsScheme(r.url)) { - throw webidl.errors.exception({ - header: 'Cache.#batchCacheOperations', - message: 'expected http or https scheme' - }) - } - - // 4.2.6.4 - if (r.method !== 'GET') { - throw webidl.errors.exception({ - header: 'Cache.#batchCacheOperations', - message: 'not get method' - }) - } - - // 4.2.6.5 - if (operation.options != null) { - throw webidl.errors.exception({ - header: 'Cache.#batchCacheOperations', - message: 'options must not be defined' - }) - } - - // 4.2.6.6 - requestResponses = this.#queryCache(operation.request) - - // 4.2.6.7 - for (const requestResponse of requestResponses) { - const idx = cache.indexOf(requestResponse) - assert(idx !== -1) - - // 4.2.6.7.1 - cache.splice(idx, 1) - } + result.truncate(result.length() - n); + return result; +}; - // 4.2.6.8 - cache.push([operation.request, operation.response]) +/** + * Get new Forge cipher object instance. + * + * @param oid the OID (in string notation). + * @param params the ASN.1 params object. + * @param password the password to decrypt with. + * + * @return new cipher object instance. + */ +pki.pbe.getCipher = function(oid, params, password) { + switch(oid) { + case pki.oids['pkcs5PBES2']: + return pki.pbe.getCipherForPBES2(oid, params, password); - // 4.2.6.10 - addedItems.push([operation.request, operation.response]) - } + case pki.oids['pbeWithSHAAnd3-KeyTripleDES-CBC']: + case pki.oids['pbewithSHAAnd40BitRC2-CBC']: + return pki.pbe.getCipherForPKCS12PBE(oid, params, password); - // 4.2.7 - resultList.push([operation.request, operation.response]) - } + default: + var error = new Error('Cannot read encrypted PBE data block. Unsupported OID.'); + error.oid = oid; + error.supportedOids = [ + 'pkcs5PBES2', + 'pbeWithSHAAnd3-KeyTripleDES-CBC', + 'pbewithSHAAnd40BitRC2-CBC' + ]; + throw error; + } +}; - // 4.3 - return resultList - } catch (e) { // 5. - // 5.1 - this.#relevantRequestResponseList.length = 0 +/** + * Get new Forge cipher object instance according to PBES2 params block. + * + * The returned cipher instance is already started using the IV + * from PBES2 parameter block. + * + * @param oid the PKCS#5 PBKDF2 OID (in string notation). + * @param params the ASN.1 PBES2-params object. + * @param password the password to decrypt with. + * + * @return new cipher object instance. + */ +pki.pbe.getCipherForPBES2 = function(oid, params, password) { + // get PBE params + var capture = {}; + var errors = []; + if(!asn1.validate(params, PBES2AlgorithmsValidator, capture, errors)) { + var error = new Error('Cannot read password-based-encryption algorithm ' + + 'parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.'); + error.errors = errors; + throw error; + } - // 5.2 - this.#relevantRequestResponseList = backupCache + // check oids + oid = asn1.derToOid(capture.kdfOid); + if(oid !== pki.oids['pkcs5PBKDF2']) { + var error = new Error('Cannot read encrypted private key. ' + + 'Unsupported key derivation function OID.'); + error.oid = oid; + error.supportedOids = ['pkcs5PBKDF2']; + throw error; + } + oid = asn1.derToOid(capture.encOid); + if(oid !== pki.oids['aes128-CBC'] && + oid !== pki.oids['aes192-CBC'] && + oid !== pki.oids['aes256-CBC'] && + oid !== pki.oids['des-EDE3-CBC'] && + oid !== pki.oids['desCBC']) { + var error = new Error('Cannot read encrypted private key. ' + + 'Unsupported encryption scheme OID.'); + error.oid = oid; + error.supportedOids = [ + 'aes128-CBC', 'aes192-CBC', 'aes256-CBC', 'des-EDE3-CBC', 'desCBC']; + throw error; + } - // 5.3 - throw e - } + // set PBE params + var salt = capture.kdfSalt; + var count = forge.util.createBuffer(capture.kdfIterationCount); + count = count.getInt(count.length() << 3); + var dkLen; + var cipherFn; + switch(pki.oids[oid]) { + case 'aes128-CBC': + dkLen = 16; + cipherFn = forge.aes.createDecryptionCipher; + break; + case 'aes192-CBC': + dkLen = 24; + cipherFn = forge.aes.createDecryptionCipher; + break; + case 'aes256-CBC': + dkLen = 32; + cipherFn = forge.aes.createDecryptionCipher; + break; + case 'des-EDE3-CBC': + dkLen = 24; + cipherFn = forge.des.createDecryptionCipher; + break; + case 'desCBC': + dkLen = 8; + cipherFn = forge.des.createDecryptionCipher; + break; } - /** - * @see https://w3c.github.io/ServiceWorker/#query-cache - * @param {any} requestQuery - * @param {import('../../types/cache').CacheQueryOptions} options - * @param {requestResponseList} targetStorage - * @returns {requestResponseList} - */ - #queryCache (requestQuery, options, targetStorage) { - /** @type {requestResponseList} */ - const resultList = [] + // get PRF message digest + var md = prfOidToMessageDigest(capture.prfOid); - const storage = targetStorage ?? this.#relevantRequestResponseList + // decrypt private key using pbe with chosen PRF and AES/DES + var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md); + var iv = capture.encIv; + var cipher = cipherFn(dk); + cipher.start(iv); - for (const requestResponse of storage) { - const [cachedRequest, cachedResponse] = requestResponse - if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) { - resultList.push(requestResponse) - } - } + return cipher; +}; - return resultList +/** + * Get new Forge cipher object instance for PKCS#12 PBE. + * + * The returned cipher instance is already started using the key & IV + * derived from the provided password and PKCS#12 PBE salt. + * + * @param oid The PKCS#12 PBE OID (in string notation). + * @param params The ASN.1 PKCS#12 PBE-params object. + * @param password The password to decrypt with. + * + * @return the new cipher object instance. + */ +pki.pbe.getCipherForPKCS12PBE = function(oid, params, password) { + // get PBE params + var capture = {}; + var errors = []; + if(!asn1.validate(params, pkcs12PbeParamsValidator, capture, errors)) { + var error = new Error('Cannot read password-based-encryption algorithm ' + + 'parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.'); + error.errors = errors; + throw error; } - /** - * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm - * @param {any} requestQuery - * @param {any} request - * @param {any | null} response - * @param {import('../../types/cache').CacheQueryOptions | undefined} options - * @returns {boolean} - */ - #requestMatchesCachedItem (requestQuery, request, response = null, options) { - // if (options?.ignoreMethod === false && request.method === 'GET') { - // return false - // } + var salt = forge.util.createBuffer(capture.salt); + var count = forge.util.createBuffer(capture.iterations); + count = count.getInt(count.length() << 3); - const queryURL = new URL(requestQuery.url) + var dkLen, dIvLen, cipherFn; + switch(oid) { + case pki.oids['pbeWithSHAAnd3-KeyTripleDES-CBC']: + dkLen = 24; + dIvLen = 8; + cipherFn = forge.des.startDecrypting; + break; - const cachedURL = new URL(request.url) + case pki.oids['pbewithSHAAnd40BitRC2-CBC']: + dkLen = 5; + dIvLen = 8; + cipherFn = function(key, iv) { + var cipher = forge.rc2.createDecryptionCipher(key, 40); + cipher.start(iv, null); + return cipher; + }; + break; - if (options?.ignoreSearch) { - cachedURL.search = '' + default: + var error = new Error('Cannot read PKCS #12 PBE data block. Unsupported OID.'); + error.oid = oid; + throw error; + } - queryURL.search = '' - } + // get PRF message digest + var md = prfOidToMessageDigest(capture.prfOid); + var key = pki.pbe.generatePkcs12Key(password, salt, 1, count, dkLen, md); + md.start(); + var iv = pki.pbe.generatePkcs12Key(password, salt, 2, count, dIvLen, md); - if (!urlEquals(queryURL, cachedURL, true)) { - return false - } + return cipherFn(key, iv); +}; - if ( - response == null || - options?.ignoreVary || - !response.headersList.contains('vary') - ) { - return true +/** + * OpenSSL's legacy key derivation function. + * + * See: http://www.openssl.org/docs/crypto/EVP_BytesToKey.html + * + * @param password the password to derive the key from. + * @param salt the salt to use, null for none. + * @param dkLen the number of bytes needed for the derived key. + * @param [options] the options to use: + * [md] an optional message digest object to use. + */ +pki.pbe.opensslDeriveBytes = function(password, salt, dkLen, md) { + if(typeof md === 'undefined' || md === null) { + if(!('md5' in forge.md)) { + throw new Error('"md5" hash algorithm unavailable.'); } + md = forge.md.md5.create(); + } + if(salt === null) { + salt = ''; + } + var digests = [hash(md, password + salt)]; + for(var length = 16, i = 1; length < dkLen; ++i, length += 16) { + digests.push(hash(md, digests[i - 1] + password + salt)); + } + return digests.join('').substr(0, dkLen); +}; - const fieldValues = getFieldValues(response.headersList.get('vary')) - - for (const fieldValue of fieldValues) { - if (fieldValue === '*') { - return false - } - - const requestValue = request.headersList.get(fieldValue) - const queryValue = requestQuery.headersList.get(fieldValue) +function hash(md, bytes) { + return md.start().update(bytes).digest().getBytes(); +} - // If one has the header and the other doesn't, or one has - // a different value than the other, return false - if (requestValue !== queryValue) { - return false - } +function prfOidToMessageDigest(prfOid) { + // get PRF algorithm, default to SHA-1 + var prfAlgorithm; + if(!prfOid) { + prfAlgorithm = 'hmacWithSHA1'; + } else { + prfAlgorithm = pki.oids[asn1.derToOid(prfOid)]; + if(!prfAlgorithm) { + var error = new Error('Unsupported PRF OID.'); + error.oid = prfOid; + error.supported = [ + 'hmacWithSHA1', 'hmacWithSHA224', 'hmacWithSHA256', 'hmacWithSHA384', + 'hmacWithSHA512']; + throw error; } - - return true } + return prfAlgorithmToMessageDigest(prfAlgorithm); } -Object.defineProperties(Cache.prototype, { - [Symbol.toStringTag]: { - value: 'Cache', - configurable: true - }, - match: kEnumerableProperty, - matchAll: kEnumerableProperty, - add: kEnumerableProperty, - addAll: kEnumerableProperty, - put: kEnumerableProperty, - delete: kEnumerableProperty, - keys: kEnumerableProperty -}) - -const cacheQueryOptionConverters = [ - { - key: 'ignoreSearch', - converter: webidl.converters.boolean, - defaultValue: false - }, - { - key: 'ignoreMethod', - converter: webidl.converters.boolean, - defaultValue: false - }, - { - key: 'ignoreVary', - converter: webidl.converters.boolean, - defaultValue: false +function prfAlgorithmToMessageDigest(prfAlgorithm) { + var factory = forge.md; + switch(prfAlgorithm) { + case 'hmacWithSHA224': + factory = forge.md.sha512; + case 'hmacWithSHA1': + case 'hmacWithSHA256': + case 'hmacWithSHA384': + case 'hmacWithSHA512': + prfAlgorithm = prfAlgorithm.substr(8).toLowerCase(); + break; + default: + var error = new Error('Unsupported PRF algorithm.'); + error.algorithm = prfAlgorithm; + error.supported = [ + 'hmacWithSHA1', 'hmacWithSHA224', 'hmacWithSHA256', 'hmacWithSHA384', + 'hmacWithSHA512']; + throw error; } -] - -webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters) - -webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([ - ...cacheQueryOptionConverters, - { - key: 'cacheName', - converter: webidl.converters.DOMString + if(!factory || !(prfAlgorithm in factory)) { + throw new Error('Unknown hash algorithm: ' + prfAlgorithm); } -]) - -webidl.converters.Response = webidl.interfaceConverter(Response) - -webidl.converters['sequence'] = webidl.sequenceConverter( - webidl.converters.RequestInfo -) + return factory[prfAlgorithm].create(); +} -module.exports = { - Cache +function createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm) { + var params = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ + // salt + asn1.create( + asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, salt), + // iteration count + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, + countBytes.getBytes()) + ]); + // when PRF algorithm is not SHA-1 default, add key length and PRF algorithm + if(prfAlgorithm !== 'hmacWithSHA1') { + params.value.push( + // key length + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, + forge.util.hexToBytes(dkLen.toString(16))), + // AlgorithmIdentifier + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ + // algorithm + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, + asn1.oidToDer(pki.oids[prfAlgorithm]).getBytes()), + // parameters (null) + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') + ])); + } + return params; } /***/ }), -/***/ 26419: +/***/ 23922: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * Password-Based Key-Derivation Function #2 implementation. + * + * See RFC 2898 for details. + * + * @author Dave Longley + * + * Copyright (c) 2010-2013 Digital Bazaar, Inc. + */ +var forge = __nccwpck_require__(56389); +__nccwpck_require__(13857); +__nccwpck_require__(48622); +__nccwpck_require__(65138); +var pkcs5 = forge.pkcs5 = forge.pkcs5 || {}; -const { kConstruct } = __nccwpck_require__(69668) -const { Cache } = __nccwpck_require__(10468) -const { webidl } = __nccwpck_require__(96138) -const { kEnumerableProperty } = __nccwpck_require__(67468) - -class CacheStorage { - /** - * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map - * @type {Map 4 || (!md || md === 'sha1'))) { + if(typeof md !== 'string') { + // default prf to SHA-1 + md = 'sha1'; + } + p = Buffer.from(p, 'binary'); + s = Buffer.from(s, 'binary'); + if(!callback) { + if(crypto.pbkdf2Sync.length === 4) { + return crypto.pbkdf2Sync(p, s, c, dkLen).toString('binary'); } - } else { // 2. - // 2.2 - for (const cacheList of this.#caches.values()) { - const cache = new Cache(kConstruct, cacheList) - - // 2.2.1.2 - const response = await cache.match(request, options) - - if (response !== undefined) { - return response + return crypto.pbkdf2Sync(p, s, c, dkLen, md).toString('binary'); + } + if(crypto.pbkdf2Sync.length === 4) { + return crypto.pbkdf2(p, s, c, dkLen, function(err, key) { + if(err) { + return callback(err); } - } + callback(null, key.toString('binary')); + }); } + return crypto.pbkdf2(p, s, c, dkLen, md, function(err, key) { + if(err) { + return callback(err); + } + callback(null, key.toString('binary')); + }); } - /** - * @see https://w3c.github.io/ServiceWorker/#cache-storage-has - * @param {string} cacheName - * @returns {Promise} - */ - async has (cacheName) { - webidl.brandCheck(this, CacheStorage) - webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' }) + if(typeof md === 'undefined' || md === null) { + // default prf to SHA-1 + md = 'sha1'; + } + if(typeof md === 'string') { + if(!(md in forge.md.algorithms)) { + throw new Error('Unknown hash algorithm: ' + md); + } + md = forge.md[md].create(); + } - cacheName = webidl.converters.DOMString(cacheName) + var hLen = md.digestLength; - // 2.1.1 - // 2.2 - return this.#caches.has(cacheName) + /* 1. If dkLen > (2^32 - 1) * hLen, output "derived key too long" and + stop. */ + if(dkLen > (0xFFFFFFFF * hLen)) { + var err = new Error('Derived key is too long.'); + if(callback) { + return callback(err); + } + throw err; } - /** - * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open - * @param {string} cacheName - * @returns {Promise} - */ - async open (cacheName) { - webidl.brandCheck(this, CacheStorage) - webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' }) - - cacheName = webidl.converters.DOMString(cacheName) + /* 2. Let len be the number of hLen-octet blocks in the derived key, + rounding up, and let r be the number of octets in the last + block: - // 2.1 - if (this.#caches.has(cacheName)) { - // await caches.open('v1') !== await caches.open('v1') + len = CEIL(dkLen / hLen), + r = dkLen - (len - 1) * hLen. */ + var len = Math.ceil(dkLen / hLen); + var r = dkLen - (len - 1) * hLen; - // 2.1.1 - const cache = this.#caches.get(cacheName) + /* 3. For each block of the derived key apply the function F defined + below to the password P, the salt S, the iteration count c, and + the block index to compute the block: - // 2.1.1.1 - return new Cache(kConstruct, cache) - } + T_1 = F(P, S, c, 1), + T_2 = F(P, S, c, 2), + ... + T_len = F(P, S, c, len), - // 2.2 - const cache = [] + where the function F is defined as the exclusive-or sum of the + first c iterates of the underlying pseudorandom function PRF + applied to the password P and the concatenation of the salt S + and the block index i: - // 2.3 - this.#caches.set(cacheName, cache) + F(P, S, c, i) = u_1 XOR u_2 XOR ... XOR u_c - // 2.4 - return new Cache(kConstruct, cache) - } + where - /** - * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete - * @param {string} cacheName - * @returns {Promise} - */ - async delete (cacheName) { - webidl.brandCheck(this, CacheStorage) - webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' }) + u_1 = PRF(P, S || INT(i)), + u_2 = PRF(P, u_1), + ... + u_c = PRF(P, u_{c-1}). - cacheName = webidl.converters.DOMString(cacheName) + Here, INT(i) is a four-octet encoding of the integer i, most + significant octet first. */ + var prf = forge.hmac.create(); + prf.start(md, p); + var dk = ''; + var xor, u_c, u_c1; - return this.#caches.delete(cacheName) - } + // sync version + if(!callback) { + for(var i = 1; i <= len; ++i) { + // PRF(P, S || INT(i)) (first iteration) + prf.start(null, null); + prf.update(s); + prf.update(forge.util.int32ToBytes(i)); + xor = u_c1 = prf.digest().getBytes(); - /** - * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys - * @returns {string[]} - */ - async keys () { - webidl.brandCheck(this, CacheStorage) + // PRF(P, u_{c-1}) (other iterations) + for(var j = 2; j <= c; ++j) { + prf.start(null, null); + prf.update(u_c1); + u_c = prf.digest().getBytes(); + // F(p, s, c, i) + xor = forge.util.xorBytes(xor, u_c, hLen); + u_c1 = u_c; + } - // 2.1 - const keys = this.#caches.keys() + /* 4. Concatenate the blocks and extract the first dkLen octets to + produce a derived key DK: - // 2.2 - return [...keys] + DK = T_1 || T_2 || ... || T_len<0..r-1> */ + dk += (i < len) ? xor : xor.substr(0, r); + } + /* 5. Output the derived key DK. */ + return dk; } -} -Object.defineProperties(CacheStorage.prototype, { - [Symbol.toStringTag]: { - value: 'CacheStorage', - configurable: true - }, - match: kEnumerableProperty, - has: kEnumerableProperty, - open: kEnumerableProperty, - delete: kEnumerableProperty, - keys: kEnumerableProperty -}) + // async version + var i = 1, j; + function outer() { + if(i > len) { + // done + return callback(null, dk); + } -module.exports = { - CacheStorage -} + // PRF(P, S || INT(i)) (first iteration) + prf.start(null, null); + prf.update(s); + prf.update(forge.util.int32ToBytes(i)); + xor = u_c1 = prf.digest().getBytes(); + // PRF(P, u_{c-1}) (other iterations) + j = 2; + inner(); + } -/***/ }), + function inner() { + if(j <= c) { + prf.start(null, null); + prf.update(u_c1); + u_c = prf.digest().getBytes(); + // F(p, s, c, i) + xor = forge.util.xorBytes(xor, u_c, hLen); + u_c1 = u_c; + ++j; + return forge.util.setImmediate(inner); + } -/***/ 69668: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /* 4. Concatenate the blocks and extract the first dkLen octets to + produce a derived key DK: + DK = T_1 || T_2 || ... || T_len<0..r-1> */ + dk += (i < len) ? xor : xor.substr(0, r); + ++i; + outer(); + } -module.exports = { - kConstruct: (__nccwpck_require__(48039).kConstruct) -} + outer(); +}; /***/ }), -/***/ 12862: +/***/ 75321: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - -const assert = __nccwpck_require__(39491) -const { URLSerializer } = __nccwpck_require__(50096) -const { isValidHeaderName } = __nccwpck_require__(79453) - /** - * @see https://url.spec.whatwg.org/#concept-url-equals - * @param {URL} A - * @param {URL} B - * @param {boolean | undefined} excludeFragment - * @returns {boolean} + * Javascript implementation of basic PEM (Privacy Enhanced Mail) algorithms. + * + * See: RFC 1421. + * + * @author Dave Longley + * + * Copyright (c) 2013-2014 Digital Bazaar, Inc. + * + * A Forge PEM object has the following fields: + * + * type: identifies the type of message (eg: "RSA PRIVATE KEY"). + * + * procType: identifies the type of processing performed on the message, + * it has two subfields: version and type, eg: 4,ENCRYPTED. + * + * contentDomain: identifies the type of content in the message, typically + * only uses the value: "RFC822". + * + * dekInfo: identifies the message encryption algorithm and mode and includes + * any parameters for the algorithm, it has two subfields: algorithm and + * parameters, eg: DES-CBC,F8143EDE5960C597. + * + * headers: contains all other PEM encapsulated headers -- where order is + * significant (for pairing data like recipient ID + key info). + * + * body: the binary-encoded body. */ -function urlEquals (A, B, excludeFragment = false) { - const serializedA = URLSerializer(A, excludeFragment) - - const serializedB = URLSerializer(B, excludeFragment) +var forge = __nccwpck_require__(56389); +__nccwpck_require__(65138); - return serializedA === serializedB -} +// shortcut for pem API +var pem = module.exports = forge.pem = forge.pem || {}; /** - * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262 - * @param {string} header + * Encodes (serializes) the given PEM object. + * + * @param msg the PEM message object to encode. + * @param options the options to use: + * maxline the maximum characters per line for the body, (default: 64). + * + * @return the PEM-formatted string. */ -function fieldValues (header) { - assert(header !== null) - - const values = [] - - for (let value of header.split(',')) { - value = value.trim() +pem.encode = function(msg, options) { + options = options || {}; + var rval = '-----BEGIN ' + msg.type + '-----\r\n'; - if (!value.length) { - continue - } else if (!isValidHeaderName(value)) { - continue + // encode special headers + var header; + if(msg.procType) { + header = { + name: 'Proc-Type', + values: [String(msg.procType.version), msg.procType.type] + }; + rval += foldHeader(header); + } + if(msg.contentDomain) { + header = {name: 'Content-Domain', values: [msg.contentDomain]}; + rval += foldHeader(header); + } + if(msg.dekInfo) { + header = {name: 'DEK-Info', values: [msg.dekInfo.algorithm]}; + if(msg.dekInfo.parameters) { + header.values.push(msg.dekInfo.parameters); } - - values.push(value) + rval += foldHeader(header); } - return values -} - -module.exports = { - urlEquals, - fieldValues -} - - -/***/ }), - -/***/ 52463: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -// @ts-check - - - -/* global WebAssembly */ - -const assert = __nccwpck_require__(39491) -const net = __nccwpck_require__(41808) -const http = __nccwpck_require__(13685) -const { pipeline } = __nccwpck_require__(12781) -const util = __nccwpck_require__(67468) -const timers = __nccwpck_require__(38965) -const Request = __nccwpck_require__(38325) -const DispatcherBase = __nccwpck_require__(32426) -const { - RequestContentLengthMismatchError, - ResponseContentLengthMismatchError, - InvalidArgumentError, - RequestAbortedError, - HeadersTimeoutError, - HeadersOverflowError, - SocketError, - InformationalError, - BodyTimeoutError, - HTTPParserError, - ResponseExceededMaxSizeError, - ClientDestroyedError -} = __nccwpck_require__(46339) -const buildConnector = __nccwpck_require__(2209) -const { - kUrl, - kReset, - kServerName, - kClient, - kBusy, - kParser, - kConnect, - kBlocking, - kResuming, - kRunning, - kPending, - kSize, - kWriting, - kQueue, - kConnected, - kConnecting, - kNeedDrain, - kNoRef, - kKeepAliveDefaultTimeout, - kHostHeader, - kPendingIdx, - kRunningIdx, - kError, - kPipelining, - kSocket, - kKeepAliveTimeoutValue, - kMaxHeadersSize, - kKeepAliveMaxTimeout, - kKeepAliveTimeoutThreshold, - kHeadersTimeout, - kBodyTimeout, - kStrictContentLength, - kConnector, - kMaxRedirections, - kMaxRequests, - kCounter, - kClose, - kDestroy, - kDispatch, - kInterceptors, - kLocalAddress, - kMaxResponseSize, - kHTTPConnVersion, - // HTTP2 - kHost, - kHTTP2Session, - kHTTP2SessionState, - kHTTP2BuildRequest, - kHTTP2CopyHeaders, - kHTTP1BuildRequest -} = __nccwpck_require__(48039) - -/** @type {import('http2')} */ -let http2 -try { - http2 = __nccwpck_require__(85158) -} catch { - // @ts-ignore - http2 = { constants: {} } -} - -const { - constants: { - HTTP2_HEADER_AUTHORITY, - HTTP2_HEADER_METHOD, - HTTP2_HEADER_PATH, - HTTP2_HEADER_SCHEME, - HTTP2_HEADER_CONTENT_LENGTH, - HTTP2_HEADER_EXPECT, - HTTP2_HEADER_STATUS + if(msg.headers) { + // encode all other headers + for(var i = 0; i < msg.headers.length; ++i) { + rval += foldHeader(msg.headers[i]); + } } -} = http2 - -// Experimental -let h2ExperimentalWarned = false - -const FastBuffer = Buffer[Symbol.species] -const kClosedResolve = Symbol('kClosedResolve') + // terminate header + if(msg.procType) { + rval += '\r\n'; + } -const channels = {} + // add body + rval += forge.util.encode64(msg.body, options.maxline || 64) + '\r\n'; -try { - const diagnosticsChannel = __nccwpck_require__(67643) - channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders') - channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect') - channels.connectError = diagnosticsChannel.channel('undici:client:connectError') - channels.connected = diagnosticsChannel.channel('undici:client:connected') -} catch { - channels.sendHeaders = { hasSubscribers: false } - channels.beforeConnect = { hasSubscribers: false } - channels.connectError = { hasSubscribers: false } - channels.connected = { hasSubscribers: false } -} + rval += '-----END ' + msg.type + '-----\r\n'; + return rval; +}; /** - * @type {import('../types/client').default} + * Decodes (deserializes) all PEM messages found in the given string. + * + * @param str the PEM-formatted string to decode. + * + * @return the PEM message objects in an array. */ -class Client extends DispatcherBase { - /** - * - * @param {string|URL} url - * @param {import('../types/client').Client.Options} options - */ - constructor (url, { - interceptors, - maxHeaderSize, - headersTimeout, - socketTimeout, - requestTimeout, - connectTimeout, - bodyTimeout, - idleTimeout, - keepAlive, - keepAliveTimeout, - maxKeepAliveTimeout, - keepAliveMaxTimeout, - keepAliveTimeoutThreshold, - socketPath, - pipelining, - tls, - strictContentLength, - maxCachedSessions, - maxRedirections, - connect, - maxRequestsPerClient, - localAddress, - maxResponseSize, - autoSelectFamily, - autoSelectFamilyAttemptTimeout, - // h2 - allowH2, - maxConcurrentStreams - } = {}) { - super() - - if (keepAlive !== undefined) { - throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead') - } - - if (socketTimeout !== undefined) { - throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead') - } - - if (requestTimeout !== undefined) { - throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead') - } - - if (idleTimeout !== undefined) { - throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead') - } +pem.decode = function(str) { + var rval = []; - if (maxKeepAliveTimeout !== undefined) { - throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead') + // split string into PEM messages (be lenient w/EOF on BEGIN line) + var rMessage = /\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g; + var rHeader = /([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/; + var rCRLF = /\r?\n/; + var match; + while(true) { + match = rMessage.exec(str); + if(!match) { + break; } - if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) { - throw new InvalidArgumentError('invalid maxHeaderSize') - } + var msg = { + type: match[1], + procType: null, + contentDomain: null, + dekInfo: null, + headers: [], + body: forge.util.decode64(match[3]) + }; + rval.push(msg); - if (socketPath != null && typeof socketPath !== 'string') { - throw new InvalidArgumentError('invalid socketPath') + // no headers + if(!match[2]) { + continue; } - if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) { - throw new InvalidArgumentError('invalid connectTimeout') - } + // parse headers + var lines = match[2].split(rCRLF); + var li = 0; + while(match && li < lines.length) { + // get line, trim any rhs whitespace + var line = lines[li].replace(/\s+$/, ''); - if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) { - throw new InvalidArgumentError('invalid keepAliveTimeout') - } + // RFC2822 unfold any following folded lines + for(var nl = li + 1; nl < lines.length; ++nl) { + var next = lines[nl]; + if(!/\s/.test(next[0])) { + break; + } + line += next; + li = nl; + } - if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) { - throw new InvalidArgumentError('invalid keepAliveMaxTimeout') - } + // parse header + match = line.match(rHeader); + if(match) { + var header = {name: match[1], values: []}; + var values = match[2].split(','); + for(var vi = 0; vi < values.length; ++vi) { + header.values.push(ltrim(values[vi])); + } - if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) { - throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold') - } + // Proc-Type must be the first header + if(!msg.procType) { + if(header.name !== 'Proc-Type') { + throw new Error('Invalid PEM formatted message. The first ' + + 'encapsulated header must be "Proc-Type".'); + } else if(header.values.length !== 2) { + throw new Error('Invalid PEM formatted message. The "Proc-Type" ' + + 'header must have two subfields.'); + } + msg.procType = {version: values[0], type: values[1]}; + } else if(!msg.contentDomain && header.name === 'Content-Domain') { + // special-case Content-Domain + msg.contentDomain = values[0] || ''; + } else if(!msg.dekInfo && header.name === 'DEK-Info') { + // special-case DEK-Info + if(header.values.length === 0) { + throw new Error('Invalid PEM formatted message. The "DEK-Info" ' + + 'header must have at least one subfield.'); + } + msg.dekInfo = {algorithm: values[0], parameters: values[1] || null}; + } else { + msg.headers.push(header); + } + } - if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) { - throw new InvalidArgumentError('headersTimeout must be a positive integer or zero') + ++li; } - if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) { - throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero') + if(msg.procType === 'ENCRYPTED' && !msg.dekInfo) { + throw new Error('Invalid PEM formatted message. The "DEK-Info" ' + + 'header must be present if "Proc-Type" is "ENCRYPTED".'); } + } - if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { - throw new InvalidArgumentError('connect must be a function or an object') - } + if(rval.length === 0) { + throw new Error('Invalid PEM formatted message.'); + } - if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { - throw new InvalidArgumentError('maxRedirections must be a positive number') - } + return rval; +}; - if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) { - throw new InvalidArgumentError('maxRequestsPerClient must be a positive number') - } +function foldHeader(header) { + var rval = header.name + ': '; - if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) { - throw new InvalidArgumentError('localAddress must be valid string IP address') - } + // ensure values with CRLF are folded + var values = []; + var insertSpace = function(match, $1) { + return ' ' + $1; + }; + for(var i = 0; i < header.values.length; ++i) { + values.push(header.values[i].replace(/^(\S+\r\n)/, insertSpace)); + } + rval += values.join(',') + '\r\n'; - if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) { - throw new InvalidArgumentError('maxResponseSize must be a positive number') + // do folding + var length = 0; + var candidate = -1; + for(var i = 0; i < rval.length; ++i, ++length) { + if(length > 65 && candidate !== -1) { + var insert = rval[candidate]; + if(insert === ',') { + ++candidate; + rval = rval.substr(0, candidate) + '\r\n ' + rval.substr(candidate); + } else { + rval = rval.substr(0, candidate) + + '\r\n' + insert + rval.substr(candidate + 1); + } + length = (i - candidate - 1); + candidate = -1; + ++i; + } else if(rval[i] === ' ' || rval[i] === '\t' || rval[i] === ',') { + candidate = i; } + } - if ( - autoSelectFamilyAttemptTimeout != null && - (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1) - ) { - throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number') - } + return rval; +} - // h2 - if (allowH2 != null && typeof allowH2 !== 'boolean') { - throw new InvalidArgumentError('allowH2 must be a valid boolean value') - } +function ltrim(str) { + return str.replace(/^\s+/, ''); +} - if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) { - throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0') - } - if (typeof connect !== 'function') { - connect = buildConnector({ - ...tls, - maxCachedSessions, - allowH2, - socketPath, - timeout: connectTimeout, - ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), - ...connect - }) - } +/***/ }), - this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client) - ? interceptors.Client - : [createRedirectInterceptor({ maxRedirections })] - this[kUrl] = util.parseOrigin(url) - this[kConnector] = connect - this[kSocket] = null - this[kPipelining] = pipelining != null ? pipelining : 1 - this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize - this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout - this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout - this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold - this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout] - this[kServerName] = null - this[kLocalAddress] = localAddress != null ? localAddress : null - this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming - this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming - this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n` - this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3 - this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3 - this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength - this[kMaxRedirections] = maxRedirections - this[kMaxRequests] = maxRequestsPerClient - this[kClosedResolve] = null - this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1 - this[kHTTPConnVersion] = 'h1' +/***/ 8892: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // HTTP/2 - this[kHTTP2Session] = null - this[kHTTP2SessionState] = !allowH2 - ? null - : { - // streams: null, // Fixed queue of streams - For future support of `push` - openStreams: 0, // Keep track of them to decide wether or not unref the session - maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server - } - this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}` +/** + * Partial implementation of PKCS#1 v2.2: RSA-OEAP + * + * Modified but based on the following MIT and BSD licensed code: + * + * https://github.com/kjur/jsjws/blob/master/rsa.js: + * + * The 'jsjws'(JSON Web Signature JavaScript Library) License + * + * Copyright (c) 2012 Kenji Urushima + * + * 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. + * + * http://webrsa.cvs.sourceforge.net/viewvc/webrsa/Client/RSAES-OAEP.js?content-type=text%2Fplain: + * + * RSAES-OAEP.js + * $Id: RSAES-OAEP.js,v 1.1.1.1 2003/03/19 15:37:20 ellispritchard Exp $ + * JavaScript Implementation of PKCS #1 v2.1 RSA CRYPTOGRAPHY STANDARD (RSA Laboratories, June 14, 2002) + * Copyright (C) Ellis Pritchard, Guardian Unlimited 2003. + * Contact: ellis@nukinetics.com + * Distributed under the BSD License. + * + * Official documentation: http://www.rsa.com/rsalabs/node.asp?id=2125 + * + * @author Evan Jones (http://evanjones.ca/) + * @author Dave Longley + * + * Copyright (c) 2013-2014 Digital Bazaar, Inc. + */ +var forge = __nccwpck_require__(56389); +__nccwpck_require__(65138); +__nccwpck_require__(62544); +__nccwpck_require__(56274); - // kQueue is built up of 3 sections separated by - // the kRunningIdx and kPendingIdx indices. - // | complete | running | pending | - // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length - // kRunningIdx points to the first running element. - // kPendingIdx points to the first pending element. - // This implements a fast queue with an amortized - // time of O(1). +// shortcut for PKCS#1 API +var pkcs1 = module.exports = forge.pkcs1 = forge.pkcs1 || {}; - this[kQueue] = [] - this[kRunningIdx] = 0 - this[kPendingIdx] = 0 +/** + * Encode the given RSAES-OAEP message (M) using key, with optional label (L) + * and seed. + * + * This method does not perform RSA encryption, it only encodes the message + * using RSAES-OAEP. + * + * @param key the RSA key to use. + * @param message the message to encode. + * @param options the options to use: + * label an optional label to use. + * seed the seed to use. + * md the message digest object to use, undefined for SHA-1. + * mgf1 optional mgf1 parameters: + * md the message digest object to use for MGF1. + * + * @return the encoded message bytes. + */ +pkcs1.encode_rsa_oaep = function(key, message, options) { + // parse arguments + var label; + var seed; + var md; + var mgf1Md; + // legacy args (label, seed, md) + if(typeof options === 'string') { + label = options; + seed = arguments[3] || undefined; + md = arguments[4] || undefined; + } else if(options) { + label = options.label || undefined; + seed = options.seed || undefined; + md = options.md || undefined; + if(options.mgf1 && options.mgf1.md) { + mgf1Md = options.mgf1.md; + } } - get pipelining () { - return this[kPipelining] + // default OAEP to SHA-1 message digest + if(!md) { + md = forge.md.sha1.create(); + } else { + md.start(); } - set pipelining (value) { - this[kPipelining] = value - resume(this, true) + // default MGF-1 to same as OAEP + if(!mgf1Md) { + mgf1Md = md; } - get [kPending] () { - return this[kQueue].length - this[kPendingIdx] + // compute length in bytes and check output + var keyLength = Math.ceil(key.n.bitLength() / 8); + var maxLength = keyLength - 2 * md.digestLength - 2; + if(message.length > maxLength) { + var error = new Error('RSAES-OAEP input message length is too long.'); + error.length = message.length; + error.maxLength = maxLength; + throw error; } - get [kRunning] () { - return this[kPendingIdx] - this[kRunningIdx] + if(!label) { + label = ''; } + md.update(label, 'raw'); + var lHash = md.digest(); - get [kSize] () { - return this[kQueue].length - this[kRunningIdx] + var PS = ''; + var PS_length = maxLength - message.length; + for(var i = 0; i < PS_length; i++) { + PS += '\x00'; } - get [kConnected] () { - return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed - } + var DB = lHash.getBytes() + PS + '\x01' + message; - get [kBusy] () { - const socket = this[kSocket] - return ( - (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) || - (this[kSize] >= (this[kPipelining] || 1)) || - this[kPending] > 0 - ) + if(!seed) { + seed = forge.random.getBytes(md.digestLength); + } else if(seed.length !== md.digestLength) { + var error = new Error('Invalid RSAES-OAEP seed. The seed length must ' + + 'match the digest length.'); + error.seedLength = seed.length; + error.digestLength = md.digestLength; + throw error; } - /* istanbul ignore: only used for test */ - [kConnect] (cb) { - connect(this) - this.once('connect', cb) - } + var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md); + var maskedDB = forge.util.xorBytes(DB, dbMask, DB.length); - [kDispatch] (opts, handler) { - const origin = opts.origin || this[kUrl].origin + var seedMask = rsa_mgf1(maskedDB, md.digestLength, mgf1Md); + var maskedSeed = forge.util.xorBytes(seed, seedMask, seed.length); - const request = this[kHTTPConnVersion] === 'h2' - ? Request[kHTTP2BuildRequest](origin, opts, handler) - : Request[kHTTP1BuildRequest](origin, opts, handler) + // return encoded message + return '\x00' + maskedSeed + maskedDB; +}; - this[kQueue].push(request) - if (this[kResuming]) { - // Do nothing. - } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) { - // Wait a tick in case stream/iterator is ended in the same tick. - this[kResuming] = 1 - process.nextTick(resume, this) - } else { - resume(this, true) +/** + * Decode the given RSAES-OAEP encoded message (EM) using key, with optional + * label (L). + * + * This method does not perform RSA decryption, it only decodes the message + * using RSAES-OAEP. + * + * @param key the RSA key to use. + * @param em the encoded message to decode. + * @param options the options to use: + * label an optional label to use. + * md the message digest object to use for OAEP, undefined for SHA-1. + * mgf1 optional mgf1 parameters: + * md the message digest object to use for MGF1. + * + * @return the decoded message bytes. + */ +pkcs1.decode_rsa_oaep = function(key, em, options) { + // parse args + var label; + var md; + var mgf1Md; + // legacy args + if(typeof options === 'string') { + label = options; + md = arguments[3] || undefined; + } else if(options) { + label = options.label || undefined; + md = options.md || undefined; + if(options.mgf1 && options.mgf1.md) { + mgf1Md = options.mgf1.md; } + } - if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) { - this[kNeedDrain] = 2 - } + // compute length in bytes + var keyLength = Math.ceil(key.n.bitLength() / 8); - return this[kNeedDrain] < 2 + if(em.length !== keyLength) { + var error = new Error('RSAES-OAEP encoded message length is invalid.'); + error.length = em.length; + error.expectedLength = keyLength; + throw error; } - async [kClose] () { - // TODO: for H2 we need to gracefully flush the remaining enqueued - // request and close each stream. - return new Promise((resolve) => { - if (!this[kSize]) { - resolve(null) - } else { - this[kClosedResolve] = resolve - } - }) + // default OAEP to SHA-1 message digest + if(md === undefined) { + md = forge.md.sha1.create(); + } else { + md.start(); } - async [kDestroy] (err) { - return new Promise((resolve) => { - const requests = this[kQueue].splice(this[kPendingIdx]) - for (let i = 0; i < requests.length; i++) { - const request = requests[i] - errorRequest(this, request, err) - } - - const callback = () => { - if (this[kClosedResolve]) { - // TODO (fix): Should we error here with ClientDestroyedError? - this[kClosedResolve]() - this[kClosedResolve] = null - } - resolve() - } - - if (this[kHTTP2Session] != null) { - util.destroy(this[kHTTP2Session], err) - this[kHTTP2Session] = null - this[kHTTP2SessionState] = null - } + // default MGF-1 to same as OAEP + if(!mgf1Md) { + mgf1Md = md; + } - if (!this[kSocket]) { - queueMicrotask(callback) - } else { - util.destroy(this[kSocket].on('close', callback), err) - } + if(keyLength < 2 * md.digestLength + 2) { + throw new Error('RSAES-OAEP key is too short for the hash function.'); + } - resume(this) - }) + if(!label) { + label = ''; } -} + md.update(label, 'raw'); + var lHash = md.digest().getBytes(); -function onHttp2SessionError (err) { - assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID') + // split the message into its parts + var y = em.charAt(0); + var maskedSeed = em.substring(1, md.digestLength + 1); + var maskedDB = em.substring(1 + md.digestLength); - this[kSocket][kError] = err + var seedMask = rsa_mgf1(maskedDB, md.digestLength, mgf1Md); + var seed = forge.util.xorBytes(maskedSeed, seedMask, maskedSeed.length); - onError(this[kClient], err) -} + var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md); + var db = forge.util.xorBytes(maskedDB, dbMask, maskedDB.length); -function onHttp2FrameError (type, code, id) { - const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`) + var lHashPrime = db.substring(0, md.digestLength); - if (id === 0) { - this[kSocket][kError] = err - onError(this[kClient], err) - } -} + // constant time check that all values match what is expected + var error = (y !== '\x00'); -function onHttp2SessionEnd () { - util.destroy(this, new SocketError('other side closed')) - util.destroy(this[kSocket], new SocketError('other side closed')) -} + // constant time check lHash vs lHashPrime + for(var i = 0; i < md.digestLength; ++i) { + error |= (lHash.charAt(i) !== lHashPrime.charAt(i)); + } -function onHTTP2GoAway (code) { - const client = this[kClient] - const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`) - client[kSocket] = null - client[kHTTP2Session] = null + // "constant time" find the 0x1 byte separating the padding (zeros) from the + // message + // TODO: It must be possible to do this in a better/smarter way? + var in_ps = 1; + var index = md.digestLength; + for(var j = md.digestLength; j < db.length; j++) { + var code = db.charCodeAt(j); - if (client.destroyed) { - assert(this[kPending] === 0) + var is_0 = (code & 0x1) ^ 0x1; - // Fail entire queue. - const requests = client[kQueue].splice(client[kRunningIdx]) - for (let i = 0; i < requests.length; i++) { - const request = requests[i] - errorRequest(this, request, err) - } - } else if (client[kRunning] > 0) { - // Fail head of pipeline. - const request = client[kQueue][client[kRunningIdx]] - client[kQueue][client[kRunningIdx]++] = null + // non-zero if not 0 or 1 in the ps section + var error_mask = in_ps ? 0xfffe : 0x0000; + error |= (code & error_mask); - errorRequest(client, request, err) + // latch in_ps to zero after we find 0x1 + in_ps = in_ps & is_0; + index += in_ps; } - client[kPendingIdx] = client[kRunningIdx] - - assert(client[kRunning] === 0) + if(error || db.charCodeAt(index) !== 0x1) { + throw new Error('Invalid RSAES-OAEP padding.'); + } - client.emit('disconnect', - client[kUrl], - [client], - err - ) + return db.substring(index + 1); +}; - resume(client) +function rsa_mgf1(seed, maskLength, hash) { + // default to SHA-1 message digest + if(!hash) { + hash = forge.md.sha1.create(); + } + var t = ''; + var count = Math.ceil(maskLength / hash.digestLength); + for(var i = 0; i < count; ++i) { + var c = String.fromCharCode( + (i >> 24) & 0xFF, (i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF); + hash.start(); + hash.update(seed + c); + t += hash.digest().getBytes(); + } + return t.substring(0, maskLength); } -const constants = __nccwpck_require__(49614) -const createRedirectInterceptor = __nccwpck_require__(72509) -const EMPTY_BUF = Buffer.alloc(0) - -async function lazyllhttp () { - const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(35099) : undefined - let mod - try { - mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(43315), 'base64')) - } catch (e) { - /* istanbul ignore next */ +/***/ }), - // We could check if the error was caused by the simd option not - // being enabled, but the occurring of this other error - // * https://github.com/emscripten-core/emscripten/issues/11495 - // got me to remove that check to avoid breaking Node 12. - mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(35099), 'base64')) - } +/***/ 8849: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return await WebAssembly.instantiate(mod, { - env: { - /* eslint-disable camelcase */ +/** + * Prime number generation API. + * + * @author Dave Longley + * + * Copyright (c) 2014 Digital Bazaar, Inc. + */ +var forge = __nccwpck_require__(56389); +__nccwpck_require__(65138); +__nccwpck_require__(20447); +__nccwpck_require__(62544); - wasm_on_url: (p, at, len) => { - /* istanbul ignore next */ - return 0 - }, - wasm_on_status: (p, at, len) => { - assert.strictEqual(currentParser.ptr, p) - const start = at - currentBufferPtr + currentBufferRef.byteOffset - return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 - }, - wasm_on_message_begin: (p) => { - assert.strictEqual(currentParser.ptr, p) - return currentParser.onMessageBegin() || 0 - }, - wasm_on_header_field: (p, at, len) => { - assert.strictEqual(currentParser.ptr, p) - const start = at - currentBufferPtr + currentBufferRef.byteOffset - return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 - }, - wasm_on_header_value: (p, at, len) => { - assert.strictEqual(currentParser.ptr, p) - const start = at - currentBufferPtr + currentBufferRef.byteOffset - return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 - }, - wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => { - assert.strictEqual(currentParser.ptr, p) - return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0 - }, - wasm_on_body: (p, at, len) => { - assert.strictEqual(currentParser.ptr, p) - const start = at - currentBufferPtr + currentBufferRef.byteOffset - return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 - }, - wasm_on_message_complete: (p) => { - assert.strictEqual(currentParser.ptr, p) - return currentParser.onMessageComplete() || 0 - } +(function() { - /* eslint-enable camelcase */ - } - }) +// forge.prime already defined +if(forge.prime) { + module.exports = forge.prime; + return; } -let llhttpInstance = null -let llhttpPromise = lazyllhttp() -llhttpPromise.catch() - -let currentParser = null -let currentBufferRef = null -let currentBufferSize = 0 -let currentBufferPtr = null - -const TIMEOUT_HEADERS = 1 -const TIMEOUT_BODY = 2 -const TIMEOUT_IDLE = 3 +/* PRIME API */ +var prime = module.exports = forge.prime = forge.prime || {}; -class Parser { - constructor (client, socket, { exports }) { - assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0) +var BigInteger = forge.jsbn.BigInteger; - this.llhttp = exports - this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE) - this.client = client - this.socket = socket - this.timeout = null - this.timeoutValue = null - this.timeoutType = null - this.statusCode = null - this.statusText = '' - this.upgrade = false - this.headers = [] - this.headersSize = 0 - this.headersMaxSize = client[kMaxHeadersSize] - this.shouldKeepAlive = false - this.paused = false - this.resume = this.resume.bind(this) +// primes are 30k+i for i = 1, 7, 11, 13, 17, 19, 23, 29 +var GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2]; +var THIRTY = new BigInteger(null); +THIRTY.fromInt(30); +var op_or = function(x, y) {return x|y;}; - this.bytesRead = 0 +/** + * Generates a random probable prime with the given number of bits. + * + * Alternative algorithms can be specified by name as a string or as an + * object with custom options like so: + * + * { + * name: 'PRIMEINC', + * options: { + * maxBlockTime: , + * millerRabinTests: , + * workerScript: , + * workers: . + * workLoad: the size of the work load, ie: number of possible prime + * numbers for each web worker to check per work assignment, + * (default: 100). + * } + * } + * + * @param bits the number of bits for the prime number. + * @param options the options to use. + * [algorithm] the algorithm to use (default: 'PRIMEINC'). + * [prng] a custom crypto-secure pseudo-random number generator to use, + * that must define "getBytesSync". + * + * @return callback(err, num) called once the operation completes. + */ +prime.generateProbablePrime = function(bits, options, callback) { + if(typeof options === 'function') { + callback = options; + options = {}; + } + options = options || {}; - this.keepAlive = '' - this.contentLength = '' - this.connection = '' - this.maxResponseSize = client[kMaxResponseSize] + // default to PRIMEINC algorithm + var algorithm = options.algorithm || 'PRIMEINC'; + if(typeof algorithm === 'string') { + algorithm = {name: algorithm}; } + algorithm.options = algorithm.options || {}; - setTimeout (value, type) { - this.timeoutType = type - if (value !== this.timeoutValue) { - timers.clearTimeout(this.timeout) - if (value) { - this.timeout = timers.setTimeout(onParserTimeout, value, this) - // istanbul ignore else: only for jest - if (this.timeout.unref) { - this.timeout.unref() - } - } else { - this.timeout = null - } - this.timeoutValue = value - } else if (this.timeout) { - // istanbul ignore else: only for jest - if (this.timeout.refresh) { - this.timeout.refresh() + // create prng with api that matches BigInteger secure random + var prng = options.prng || forge.random; + var rng = { + // x is an array to fill with bytes + nextBytes: function(x) { + var b = prng.getBytesSync(x.length); + for(var i = 0; i < x.length; ++i) { + x[i] = b.charCodeAt(i); } } + }; + + if(algorithm.name === 'PRIMEINC') { + return primeincFindPrime(bits, rng, algorithm.options, callback); } - resume () { - if (this.socket.destroyed || !this.paused) { - return - } + throw new Error('Invalid prime generation algorithm: ' + algorithm.name); +}; - assert(this.ptr != null) - assert(currentParser == null) +function primeincFindPrime(bits, rng, options, callback) { + if('workers' in options) { + return primeincFindPrimeWithWorkers(bits, rng, options, callback); + } + return primeincFindPrimeWithoutWorkers(bits, rng, options, callback); +} - this.llhttp.llhttp_resume(this.ptr) +function primeincFindPrimeWithoutWorkers(bits, rng, options, callback) { + // initialize random number + var num = generateRandom(bits, rng); - assert(this.timeoutType === TIMEOUT_BODY) - if (this.timeout) { - // istanbul ignore else: only for jest - if (this.timeout.refresh) { - this.timeout.refresh() - } - } + /* Note: All primes are of the form 30k+i for i < 30 and gcd(30, i)=1. The + number we are given is always aligned at 30k + 1. Each time the number is + determined not to be prime we add to get to the next 'i', eg: if the number + was at 30k + 1 we add 6. */ + var deltaIdx = 0; - this.paused = false - this.execute(this.socket.read() || EMPTY_BUF) // Flush parser. - this.readMore() + // get required number of MR tests + var mrTests = getMillerRabinTests(num.bitLength()); + if('millerRabinTests' in options) { + mrTests = options.millerRabinTests; } - readMore () { - while (!this.paused && this.ptr) { - const chunk = this.socket.read() - if (chunk === null) { - break - } - this.execute(chunk) - } + // find prime nearest to 'num' for maxBlockTime ms + // 10 ms gives 5ms of leeway for other calculations before dropping + // below 60fps (1000/60 == 16.67), but in reality, the number will + // likely be higher due to an 'atomic' big int modPow + var maxBlockTime = 10; + if('maxBlockTime' in options) { + maxBlockTime = options.maxBlockTime; } - execute (data) { - assert(this.ptr != null) - assert(currentParser == null) - assert(!this.paused) - - const { socket, llhttp } = this + _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback); +} - if (data.length > currentBufferSize) { - if (currentBufferPtr) { - llhttp.free(currentBufferPtr) - } - currentBufferSize = Math.ceil(data.length / 4096) * 4096 - currentBufferPtr = llhttp.malloc(currentBufferSize) +function _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback) { + var start = +new Date(); + do { + // overflow, regenerate random number + if(num.bitLength() > bits) { + num = generateRandom(bits, rng); } + // do primality test + if(num.isProbablePrime(mrTests)) { + return callback(null, num); + } + // get next potential prime + num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0); + } while(maxBlockTime < 0 || (+new Date() - start < maxBlockTime)); - new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data) - - // Call `execute` on the wasm parser. - // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data, - // and finally the length of bytes to parse. - // The return value is an error code or `constants.ERROR.OK`. - try { - let ret + // keep trying later + forge.util.setImmediate(function() { + _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback); + }); +} - try { - currentBufferRef = data - currentParser = this - ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length) - /* eslint-disable-next-line no-useless-catch */ - } catch (err) { - /* istanbul ignore next: difficult to make a test case for */ - throw err - } finally { - currentParser = null - currentBufferRef = null - } +// NOTE: This algorithm is indeterminate in nature because workers +// run in parallel looking at different segments of numbers. Even if this +// algorithm is run twice with the same input from a predictable RNG, it +// may produce different outputs. +function primeincFindPrimeWithWorkers(bits, rng, options, callback) { + // web workers unavailable + if(typeof Worker === 'undefined') { + return primeincFindPrimeWithoutWorkers(bits, rng, options, callback); + } - const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr + // initialize random number + var num = generateRandom(bits, rng); - if (ret === constants.ERROR.PAUSED_UPGRADE) { - this.onUpgrade(data.slice(offset)) - } else if (ret === constants.ERROR.PAUSED) { - this.paused = true - socket.unshift(data.slice(offset)) - } else if (ret !== constants.ERROR.OK) { - const ptr = llhttp.llhttp_get_error_reason(this.ptr) - let message = '' - /* istanbul ignore else: difficult to make a test case for */ - if (ptr) { - const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) - message = - 'Response does not match the HTTP/1.1 protocol (' + - Buffer.from(llhttp.memory.buffer, ptr, len).toString() + - ')' - } - throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset)) + // use web workers to generate keys + var numWorkers = options.workers; + var workLoad = options.workLoad || 100; + var range = workLoad * 30 / 8; + var workerScript = options.workerScript || 'forge/prime.worker.js'; + if(numWorkers === -1) { + return forge.util.estimateCores(function(err, cores) { + if(err) { + // default to 2 + cores = 2; } - } catch (err) { - util.destroy(socket, err) - } + numWorkers = cores - 1; + generate(); + }); } + generate(); - destroy () { - assert(this.ptr != null) - assert(currentParser == null) - - this.llhttp.llhttp_free(this.ptr) - this.ptr = null + function generate() { + // require at least 1 worker + numWorkers = Math.max(1, numWorkers); - timers.clearTimeout(this.timeout) - this.timeout = null - this.timeoutValue = null - this.timeoutType = null + // TODO: consider optimizing by starting workers outside getPrime() ... + // note that in order to clean up they will have to be made internally + // asynchronous which may actually be slower - this.paused = false - } + // start workers immediately + var workers = []; + for(var i = 0; i < numWorkers; ++i) { + // FIXME: fix path or use blob URLs + workers[i] = new Worker(workerScript); + } + var running = numWorkers; - onStatus (buf) { - this.statusText = buf.toString() - } + // listen for requests from workers and assign ranges to find prime + for(var i = 0; i < numWorkers; ++i) { + workers[i].addEventListener('message', workerMessage); + } - onMessageBegin () { - const { socket, client } = this + /* Note: The distribution of random numbers is unknown. Therefore, each + web worker is continuously allocated a range of numbers to check for a + random number until one is found. - /* istanbul ignore next: difficult to make a test case for */ - if (socket.destroyed) { - return -1 - } + Every 30 numbers will be checked just 8 times, because prime numbers + have the form: - const request = client[kQueue][client[kRunningIdx]] - if (!request) { - return -1 - } - } + 30k+i, for i < 30 and gcd(30, i)=1 (there are 8 values of i for this) - onHeaderField (buf) { - const len = this.headers.length + Therefore, if we want a web worker to run N checks before asking for + a new range of numbers, each range must contain N*30/8 numbers. - if ((len & 1) === 0) { - this.headers.push(buf) - } else { - this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]) - } + For 100 checks (workLoad), this is a range of 375. */ - this.trackHeader(buf.length) - } + var found = false; + function workerMessage(e) { + // ignore message, prime already found + if(found) { + return; + } - onHeaderValue (buf) { - let len = this.headers.length + --running; + var data = e.data; + if(data.found) { + // terminate all workers + for(var i = 0; i < workers.length; ++i) { + workers[i].terminate(); + } + found = true; + return callback(null, new BigInteger(data.prime, 16)); + } - if ((len & 1) === 1) { - this.headers.push(buf) - len += 1 - } else { - this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]) - } + // overflow, regenerate random number + if(num.bitLength() > bits) { + num = generateRandom(bits, rng); + } - const key = this.headers[len - 2] - if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') { - this.keepAlive += buf.toString() - } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') { - this.connection += buf.toString() - } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') { - this.contentLength += buf.toString() - } + // assign new range to check + var hex = num.toString(16); - this.trackHeader(buf.length) - } + // start prime search + e.target.postMessage({ + hex: hex, + workLoad: workLoad + }); - trackHeader (len) { - this.headersSize += len - if (this.headersSize >= this.headersMaxSize) { - util.destroy(this.socket, new HeadersOverflowError()) + num.dAddOffset(range, 0); } } +} - onUpgrade (head) { - const { upgrade, client, socket, headers, statusCode } = this - - assert(upgrade) +/** + * Generates a random number using the given number of bits and RNG. + * + * @param bits the number of bits for the number. + * @param rng the random number generator to use. + * + * @return the random number. + */ +function generateRandom(bits, rng) { + var num = new BigInteger(bits, rng); + // force MSB set + var bits1 = bits - 1; + if(!num.testBit(bits1)) { + num.bitwiseTo(BigInteger.ONE.shiftLeft(bits1), op_or, num); + } + // align number on 30k+1 boundary + num.dAddOffset(31 - num.mod(THIRTY).byteValue(), 0); + return num; +} - const request = client[kQueue][client[kRunningIdx]] - assert(request) +/** + * Returns the required number of Miller-Rabin tests to generate a + * prime with an error probability of (1/2)^80. + * + * See Handbook of Applied Cryptography Chapter 4, Table 4.4. + * + * @param bits the bit size. + * + * @return the required number of iterations. + */ +function getMillerRabinTests(bits) { + if(bits <= 100) return 27; + if(bits <= 150) return 18; + if(bits <= 200) return 15; + if(bits <= 250) return 12; + if(bits <= 300) return 9; + if(bits <= 350) return 8; + if(bits <= 400) return 7; + if(bits <= 500) return 6; + if(bits <= 600) return 5; + if(bits <= 800) return 4; + if(bits <= 1250) return 3; + return 2; +} - assert(!socket.destroyed) - assert(socket === client[kSocket]) - assert(!this.paused) - assert(request.upgrade || request.method === 'CONNECT') +})(); - this.statusCode = null - this.statusText = '' - this.shouldKeepAlive = null - assert(this.headers.length % 2 === 0) - this.headers = [] - this.headersSize = 0 +/***/ }), - socket.unshift(head) +/***/ 64387: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - socket[kParser].destroy() - socket[kParser] = null +/** + * A javascript implementation of a cryptographically-secure + * Pseudo Random Number Generator (PRNG). The Fortuna algorithm is followed + * here though the use of SHA-256 is not enforced; when generating an + * a PRNG context, the hashing algorithm and block cipher used for + * the generator are specified via a plugin. + * + * @author Dave Longley + * + * Copyright (c) 2010-2014 Digital Bazaar, Inc. + */ +var forge = __nccwpck_require__(56389); +__nccwpck_require__(65138); - socket[kClient] = null - socket[kError] = null - socket - .removeListener('error', onSocketError) - .removeListener('readable', onSocketReadable) - .removeListener('end', onSocketEnd) - .removeListener('close', onSocketClose) +var _crypto = null; +if(forge.util.isNodejs && !forge.options.usePureJavaScript && + !process.versions['node-webkit']) { + _crypto = __nccwpck_require__(6113); +} - client[kSocket] = null - client[kQueue][client[kRunningIdx]++] = null - client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade')) +/* PRNG API */ +var prng = module.exports = forge.prng = forge.prng || {}; - try { - request.onUpgrade(statusCode, headers, socket) - } catch (err) { - util.destroy(socket, err) - } +/** + * Creates a new PRNG context. + * + * A PRNG plugin must be passed in that will provide: + * + * 1. A function that initializes the key and seed of a PRNG context. It + * will be given a 16 byte key and a 16 byte seed. Any key expansion + * or transformation of the seed from a byte string into an array of + * integers (or similar) should be performed. + * 2. The cryptographic function used by the generator. It takes a key and + * a seed. + * 3. A seed increment function. It takes the seed and returns seed + 1. + * 4. An api to create a message digest. + * + * For an example, see random.js. + * + * @param plugin the PRNG plugin to use. + */ +prng.create = function(plugin) { + var ctx = { + plugin: plugin, + key: null, + seed: null, + time: null, + // number of reseeds so far + reseeds: 0, + // amount of data generated so far + generated: 0, + // no initial key bytes + keyBytes: '' + }; - resume(client) + // create 32 entropy pools (each is a message digest) + var md = plugin.md; + var pools = new Array(32); + for(var i = 0; i < 32; ++i) { + pools[i] = md.create(); } + ctx.pools = pools; - onHeadersComplete (statusCode, upgrade, shouldKeepAlive) { - const { client, socket, headers, statusText } = this + // entropy pools are written to cyclically, starting at index 0 + ctx.pool = 0; - /* istanbul ignore next: difficult to make a test case for */ - if (socket.destroyed) { - return -1 + /** + * Generates random bytes. The bytes may be generated synchronously or + * asynchronously. Web workers must use the asynchronous interface or + * else the behavior is undefined. + * + * @param count the number of random bytes to generate. + * @param [callback(err, bytes)] called once the operation completes. + * + * @return count random bytes as a string. + */ + ctx.generate = function(count, callback) { + // do synchronously + if(!callback) { + return ctx.generateSync(count); } - const request = client[kQueue][client[kRunningIdx]] - - /* istanbul ignore next: difficult to make a test case for */ - if (!request) { - return -1 - } + // simple generator using counter-based CBC + var cipher = ctx.plugin.cipher; + var increment = ctx.plugin.increment; + var formatKey = ctx.plugin.formatKey; + var formatSeed = ctx.plugin.formatSeed; + var b = forge.util.createBuffer(); - assert(!this.upgrade) - assert(this.statusCode < 200) + // paranoid deviation from Fortuna: + // reset key for every request to protect previously + // generated random bytes should the key be discovered; + // there is no 100ms based reseeding because of this + // forced reseed for every `generate` call + ctx.key = null; - if (statusCode === 100) { - util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) - return -1 - } + generate(); - /* this can only happen if server is misbehaving */ - if (upgrade && !request.upgrade) { - util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket))) - return -1 - } + function generate(err) { + if(err) { + return callback(err); + } - assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS) + // sufficient bytes generated + if(b.length() >= count) { + return callback(null, b.getBytes(count)); + } - this.statusCode = statusCode - this.shouldKeepAlive = ( - shouldKeepAlive || - // Override llhttp value which does not allow keepAlive for HEAD. - (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive') - ) + // if amount of data generated is greater than 1 MiB, trigger reseed + if(ctx.generated > 0xfffff) { + ctx.key = null; + } - if (this.statusCode >= 200) { - const bodyTimeout = request.bodyTimeout != null - ? request.bodyTimeout - : client[kBodyTimeout] - this.setTimeout(bodyTimeout, TIMEOUT_BODY) - } else if (this.timeout) { - // istanbul ignore else: only for jest - if (this.timeout.refresh) { - this.timeout.refresh() + if(ctx.key === null) { + // prevent stack overflow + return forge.util.nextTick(function() { + _reseed(generate); + }); } - } - if (request.method === 'CONNECT') { - assert(client[kRunning] === 1) - this.upgrade = true - return 2 - } + // generate the random bytes + var bytes = cipher(ctx.key, ctx.seed); + ctx.generated += bytes.length; + b.putBytes(bytes); + + // generate bytes for a new key and seed + ctx.key = formatKey(cipher(ctx.key, increment(ctx.seed))); + ctx.seed = formatSeed(cipher(ctx.key, ctx.seed)); - if (upgrade) { - assert(client[kRunning] === 1) - this.upgrade = true - return 2 + forge.util.setImmediate(generate); } + }; - assert(this.headers.length % 2 === 0) - this.headers = [] - this.headersSize = 0 + /** + * Generates random bytes synchronously. + * + * @param count the number of random bytes to generate. + * + * @return count random bytes as a string. + */ + ctx.generateSync = function(count) { + // simple generator using counter-based CBC + var cipher = ctx.plugin.cipher; + var increment = ctx.plugin.increment; + var formatKey = ctx.plugin.formatKey; + var formatSeed = ctx.plugin.formatSeed; - if (this.shouldKeepAlive && client[kPipelining]) { - const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null + // paranoid deviation from Fortuna: + // reset key for every request to protect previously + // generated random bytes should the key be discovered; + // there is no 100ms based reseeding because of this + // forced reseed for every `generateSync` call + ctx.key = null; - if (keepAliveTimeout != null) { - const timeout = Math.min( - keepAliveTimeout - client[kKeepAliveTimeoutThreshold], - client[kKeepAliveMaxTimeout] - ) - if (timeout <= 0) { - socket[kReset] = true - } else { - client[kKeepAliveTimeoutValue] = timeout - } - } else { - client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout] + var b = forge.util.createBuffer(); + while(b.length() < count) { + // if amount of data generated is greater than 1 MiB, trigger reseed + if(ctx.generated > 0xfffff) { + ctx.key = null; } - } else { - // Stop more requests from being dispatched. - socket[kReset] = true - } - const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false + if(ctx.key === null) { + _reseedSync(); + } - if (request.aborted) { - return -1 - } + // generate the random bytes + var bytes = cipher(ctx.key, ctx.seed); + ctx.generated += bytes.length; + b.putBytes(bytes); - if (request.method === 'HEAD') { - return 1 + // generate bytes for a new key and seed + ctx.key = formatKey(cipher(ctx.key, increment(ctx.seed))); + ctx.seed = formatSeed(cipher(ctx.key, ctx.seed)); } - if (statusCode < 200) { - return 1 - } + return b.getBytes(count); + }; - if (socket[kBlocking]) { - socket[kBlocking] = false - resume(client) + /** + * Private function that asynchronously reseeds a generator. + * + * @param callback(err) called once the operation completes. + */ + function _reseed(callback) { + if(ctx.pools[0].messageLength >= 32) { + _seed(); + return callback(); } + // not enough seed data... + var needed = (32 - ctx.pools[0].messageLength) << 5; + ctx.seedFile(needed, function(err, bytes) { + if(err) { + return callback(err); + } + ctx.collect(bytes); + _seed(); + callback(); + }); + } - return pause ? constants.ERROR.PAUSED : 0 + /** + * Private function that synchronously reseeds a generator. + */ + function _reseedSync() { + if(ctx.pools[0].messageLength >= 32) { + return _seed(); + } + // not enough seed data... + var needed = (32 - ctx.pools[0].messageLength) << 5; + ctx.collect(ctx.seedFileSync(needed)); + _seed(); } - onBody (buf) { - const { client, socket, statusCode, maxResponseSize } = this + /** + * Private function that seeds a generator once enough bytes are available. + */ + function _seed() { + // update reseed count + ctx.reseeds = (ctx.reseeds === 0xffffffff) ? 0 : ctx.reseeds + 1; - if (socket.destroyed) { - return -1 - } + // goal is to update `key` via: + // key = hash(key + s) + // where 's' is all collected entropy from selected pools, then... - const request = client[kQueue][client[kRunningIdx]] - assert(request) + // create a plugin-based message digest + var md = ctx.plugin.md.create(); - assert.strictEqual(this.timeoutType, TIMEOUT_BODY) - if (this.timeout) { - // istanbul ignore else: only for jest - if (this.timeout.refresh) { - this.timeout.refresh() + // consume current key bytes + md.update(ctx.keyBytes); + + // digest the entropy of pools whose index k meet the + // condition 'n mod 2^k == 0' where n is the number of reseeds + var _2powK = 1; + for(var k = 0; k < 32; ++k) { + if(ctx.reseeds % _2powK === 0) { + md.update(ctx.pools[k].digest().getBytes()); + ctx.pools[k].start(); } + _2powK = _2powK << 1; } - assert(statusCode >= 200) - - if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { - util.destroy(socket, new ResponseExceededMaxSizeError()) - return -1 - } + // get digest for key bytes + ctx.keyBytes = md.digest().getBytes(); - this.bytesRead += buf.length + // paranoid deviation from Fortuna: + // update `seed` via `seed = hash(key)` + // instead of initializing to zero once and only + // ever incrementing it + md.start(); + md.update(ctx.keyBytes); + var seedBytes = md.digest().getBytes(); - if (request.onData(buf) === false) { - return constants.ERROR.PAUSED - } + // update state + ctx.key = ctx.plugin.formatKey(ctx.keyBytes); + ctx.seed = ctx.plugin.formatSeed(seedBytes); + ctx.generated = 0; } - onMessageComplete () { - const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this - - if (socket.destroyed && (!statusCode || shouldKeepAlive)) { - return -1 + /** + * The built-in default seedFile. This seedFile is used when entropy + * is needed immediately. + * + * @param needed the number of bytes that are needed. + * + * @return the random bytes. + */ + function defaultSeedFile(needed) { + // use window.crypto.getRandomValues strong source of entropy if available + var getRandomValues = null; + var globalScope = forge.util.globalScope; + var _crypto = globalScope.crypto || globalScope.msCrypto; + if(_crypto && _crypto.getRandomValues) { + getRandomValues = function(arr) { + return _crypto.getRandomValues(arr); + }; } - if (upgrade) { - return + var b = forge.util.createBuffer(); + if(getRandomValues) { + while(b.length() < needed) { + // max byte length is 65536 before QuotaExceededError is thrown + // http://www.w3.org/TR/WebCryptoAPI/#RandomSource-method-getRandomValues + var count = Math.max(1, Math.min(needed - b.length(), 65536) / 4); + var entropy = new Uint32Array(Math.floor(count)); + try { + getRandomValues(entropy); + for(var i = 0; i < entropy.length; ++i) { + b.putInt32(entropy[i]); + } + } catch(e) { + /* only ignore QuotaExceededError */ + if(!(typeof QuotaExceededError !== 'undefined' && + e instanceof QuotaExceededError)) { + throw e; + } + } + } } - const request = client[kQueue][client[kRunningIdx]] - assert(request) - - assert(statusCode >= 100) + // be sad and add some weak random data + if(b.length() < needed) { + /* Draws from Park-Miller "minimal standard" 31 bit PRNG, + implemented with David G. Carta's optimization: with 32 bit math + and without division (Public Domain). */ + var hi, lo, next; + var seed = Math.floor(Math.random() * 0x010000); + while(b.length() < needed) { + lo = 16807 * (seed & 0xFFFF); + hi = 16807 * (seed >> 16); + lo += (hi & 0x7FFF) << 16; + lo += hi >> 15; + lo = (lo & 0x7FFFFFFF) + (lo >> 31); + seed = lo & 0xFFFFFFFF; - this.statusCode = null - this.statusText = '' - this.bytesRead = 0 - this.contentLength = '' - this.keepAlive = '' - this.connection = '' + // consume lower 3 bytes of seed + for(var i = 0; i < 3; ++i) { + // throw in more pseudo random + next = seed >>> (i << 3); + next ^= Math.floor(Math.random() * 0x0100); + b.putByte(String.fromCharCode(next & 0xFF)); + } + } + } - assert(this.headers.length % 2 === 0) - this.headers = [] - this.headersSize = 0 + return b.getBytes(needed); + } + // initialize seed file APIs + if(_crypto) { + // use nodejs async API + ctx.seedFile = function(needed, callback) { + _crypto.randomBytes(needed, function(err, bytes) { + if(err) { + return callback(err); + } + callback(null, bytes.toString()); + }); + }; + // use nodejs sync API + ctx.seedFileSync = function(needed) { + return _crypto.randomBytes(needed).toString(); + }; + } else { + ctx.seedFile = function(needed, callback) { + try { + callback(null, defaultSeedFile(needed)); + } catch(e) { + callback(e); + } + }; + ctx.seedFileSync = defaultSeedFile; + } - if (statusCode < 200) { - return + /** + * Adds entropy to a prng ctx's accumulator. + * + * @param bytes the bytes of entropy as a string. + */ + ctx.collect = function(bytes) { + // iterate over pools distributing entropy cyclically + var count = bytes.length; + for(var i = 0; i < count; ++i) { + ctx.pools[ctx.pool].update(bytes.substr(i, 1)); + ctx.pool = (ctx.pool === 31) ? 0 : ctx.pool + 1; } + }; - /* istanbul ignore next: should be handled by llhttp? */ - if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) { - util.destroy(socket, new ResponseContentLengthMismatchError()) - return -1 + /** + * Collects an integer of n bits. + * + * @param i the integer entropy. + * @param n the number of bits in the integer. + */ + ctx.collectInt = function(i, n) { + var bytes = ''; + for(var x = 0; x < n; x += 8) { + bytes += String.fromCharCode((i >> x) & 0xFF); } + ctx.collect(bytes); + }; - request.onComplete(headers) - - client[kQueue][client[kRunningIdx]++] = null - - if (socket[kWriting]) { - assert.strictEqual(client[kRunning], 0) - // Response completed before request. - util.destroy(socket, new InformationalError('reset')) - return constants.ERROR.PAUSED - } else if (!shouldKeepAlive) { - util.destroy(socket, new InformationalError('reset')) - return constants.ERROR.PAUSED - } else if (socket[kReset] && client[kRunning] === 0) { - // Destroy socket once all requests have completed. - // The request at the tail of the pipeline is the one - // that requested reset and no further requests should - // have been queued since then. - util.destroy(socket, new InformationalError('reset')) - return constants.ERROR.PAUSED - } else if (client[kPipelining] === 1) { - // We must wait a full event loop cycle to reuse this socket to make sure - // that non-spec compliant servers are not closing the connection even if they - // said they won't. - setImmediate(resume, client) + /** + * Registers a Web Worker to receive immediate entropy from the main thread. + * This method is required until Web Workers can access the native crypto + * API. This method should be called twice for each created worker, once in + * the main thread, and once in the worker itself. + * + * @param worker the worker to register. + */ + ctx.registerWorker = function(worker) { + // worker receives random bytes + if(worker === self) { + ctx.seedFile = function(needed, callback) { + function listener(e) { + var data = e.data; + if(data.forge && data.forge.prng) { + self.removeEventListener('message', listener); + callback(data.forge.prng.err, data.forge.prng.bytes); + } + } + self.addEventListener('message', listener); + self.postMessage({forge: {prng: {needed: needed}}}); + }; } else { - resume(client) + // main thread sends random bytes upon request + var listener = function(e) { + var data = e.data; + if(data.forge && data.forge.prng) { + ctx.seedFile(data.forge.prng.needed, function(err, bytes) { + worker.postMessage({forge: {prng: {err: err, bytes: bytes}}}); + }); + } + }; + // TODO: do we need to remove the event listener when the worker dies? + worker.addEventListener('message', listener); } - } -} - -function onParserTimeout (parser) { - const { socket, timeoutType, client } = parser + }; - /* istanbul ignore else */ - if (timeoutType === TIMEOUT_HEADERS) { - if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { - assert(!parser.paused, 'cannot be paused while waiting for headers') - util.destroy(socket, new HeadersTimeoutError()) - } - } else if (timeoutType === TIMEOUT_BODY) { - if (!parser.paused) { - util.destroy(socket, new BodyTimeoutError()) - } - } else if (timeoutType === TIMEOUT_IDLE) { - assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]) - util.destroy(socket, new InformationalError('socket idle timeout')) - } -} + return ctx; +}; -function onSocketReadable () { - const { [kParser]: parser } = this - if (parser) { - parser.readMore() - } -} -function onSocketError (err) { - const { [kClient]: client, [kParser]: parser } = this +/***/ }), - assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID') +/***/ 62544: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (client[kHTTPConnVersion] !== 'h2') { - // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded - // to the user. - if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so for as a valid response. - parser.onMessageComplete() - return - } - } +/** + * An API for getting cryptographically-secure random bytes. The bytes are + * generated using the Fortuna algorithm devised by Bruce Schneier and + * Niels Ferguson. + * + * Getting strong random bytes is not yet easy to do in javascript. The only + * truish random entropy that can be collected is from the mouse, keyboard, or + * from timing with respect to page loads, etc. This generator makes a poor + * attempt at providing random bytes when those sources haven't yet provided + * enough entropy to initially seed or to reseed the PRNG. + * + * @author Dave Longley + * + * Copyright (c) 2009-2014 Digital Bazaar, Inc. + */ +var forge = __nccwpck_require__(56389); +__nccwpck_require__(59745); +__nccwpck_require__(56798); +__nccwpck_require__(64387); +__nccwpck_require__(65138); - this[kError] = err +(function() { - onError(this[kClient], err) +// forge.random already defined +if(forge.random && forge.random.getBytes) { + module.exports = forge.random; + return; } -function onError (client, err) { - if ( - client[kRunning] === 0 && - err.code !== 'UND_ERR_INFO' && - err.code !== 'UND_ERR_SOCKET' - ) { - // Error is not caused by running request and not a recoverable - // socket error. +(function(jQuery) { - assert(client[kPendingIdx] === client[kRunningIdx]) +// the default prng plugin, uses AES-128 +var prng_aes = {}; +var _prng_aes_output = new Array(4); +var _prng_aes_buffer = forge.util.createBuffer(); +prng_aes.formatKey = function(key) { + // convert the key into 32-bit integers + var tmp = forge.util.createBuffer(key); + key = new Array(4); + key[0] = tmp.getInt32(); + key[1] = tmp.getInt32(); + key[2] = tmp.getInt32(); + key[3] = tmp.getInt32(); - const requests = client[kQueue].splice(client[kRunningIdx]) - for (let i = 0; i < requests.length; i++) { - const request = requests[i] - errorRequest(client, request, err) - } - assert(client[kSize] === 0) - } -} + // return the expanded key + return forge.aes._expandKey(key, false); +}; +prng_aes.formatSeed = function(seed) { + // convert seed into 32-bit integers + var tmp = forge.util.createBuffer(seed); + seed = new Array(4); + seed[0] = tmp.getInt32(); + seed[1] = tmp.getInt32(); + seed[2] = tmp.getInt32(); + seed[3] = tmp.getInt32(); + return seed; +}; +prng_aes.cipher = function(key, seed) { + forge.aes._updateBlock(key, seed, _prng_aes_output, false); + _prng_aes_buffer.putInt32(_prng_aes_output[0]); + _prng_aes_buffer.putInt32(_prng_aes_output[1]); + _prng_aes_buffer.putInt32(_prng_aes_output[2]); + _prng_aes_buffer.putInt32(_prng_aes_output[3]); + return _prng_aes_buffer.getBytes(); +}; +prng_aes.increment = function(seed) { + // FIXME: do we care about carry or signed issues? + ++seed[3]; + return seed; +}; +prng_aes.md = forge.md.sha256; -function onSocketEnd () { - const { [kParser]: parser, [kClient]: client } = this +/** + * Creates a new PRNG. + */ +function spawnPrng() { + var ctx = forge.prng.create(prng_aes); - if (client[kHTTPConnVersion] !== 'h2') { - if (parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so far as a valid response. - parser.onMessageComplete() - return - } - } + /** + * Gets random bytes. If a native secure crypto API is unavailable, this + * method tries to make the bytes more unpredictable by drawing from data that + * can be collected from the user of the browser, eg: mouse movement. + * + * If a callback is given, this method will be called asynchronously. + * + * @param count the number of random bytes to get. + * @param [callback(err, bytes)] called once the operation completes. + * + * @return the random bytes in a string. + */ + ctx.getBytes = function(count, callback) { + return ctx.generate(count, callback); + }; - util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this))) + /** + * Gets random bytes asynchronously. If a native secure crypto API is + * unavailable, this method tries to make the bytes more unpredictable by + * drawing from data that can be collected from the user of the browser, + * eg: mouse movement. + * + * @param count the number of random bytes to get. + * + * @return the random bytes in a string. + */ + ctx.getBytesSync = function(count) { + return ctx.generate(count); + }; + + return ctx; } -function onSocketClose () { - const { [kClient]: client, [kParser]: parser } = this +// create default prng context +var _ctx = spawnPrng(); - if (client[kHTTPConnVersion] === 'h1' && parser) { - if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so far as a valid response. - parser.onMessageComplete() - } +// add other sources of entropy only if window.crypto.getRandomValues is not +// available -- otherwise this source will be automatically used by the prng +var getRandomValues = null; +var globalScope = forge.util.globalScope; +var _crypto = globalScope.crypto || globalScope.msCrypto; +if(_crypto && _crypto.getRandomValues) { + getRandomValues = function(arr) { + return _crypto.getRandomValues(arr); + }; +} - this[kParser].destroy() - this[kParser] = null +if(forge.options.usePureJavaScript || + (!forge.util.isNodejs && !getRandomValues)) { + // if this is a web worker, do not use weak entropy, instead register to + // receive strong entropy asynchronously from the main thread + if(typeof window === 'undefined' || window.document === undefined) { + // FIXME: } - const err = this[kError] || new SocketError('closed', util.getSocketInfo(this)) - - client[kSocket] = null + // get load time entropy + _ctx.collectInt(+new Date(), 32); - if (client.destroyed) { - assert(client[kPending] === 0) + // add some entropy from navigator object + if(typeof(navigator) !== 'undefined') { + var _navBytes = ''; + for(var key in navigator) { + try { + if(typeof(navigator[key]) == 'string') { + _navBytes += navigator[key]; + } + } catch(e) { + /* Some navigator keys might not be accessible, e.g. the geolocation + attribute throws an exception if touched in Mozilla chrome:// + context. - // Fail entire queue. - const requests = client[kQueue].splice(client[kRunningIdx]) - for (let i = 0; i < requests.length; i++) { - const request = requests[i] - errorRequest(client, request, err) + Silently ignore this and just don't use this as a source of + entropy. */ + } } - } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') { - // Fail head of pipeline. - const request = client[kQueue][client[kRunningIdx]] - client[kQueue][client[kRunningIdx]++] = null - - errorRequest(client, request, err) + _ctx.collect(_navBytes); + _navBytes = null; } - client[kPendingIdx] = client[kRunningIdx] - - assert(client[kRunning] === 0) - - client.emit('disconnect', client[kUrl], [client], err) + // add mouse and keyboard collectors if jquery is available + if(jQuery) { + // set up mouse entropy capture + jQuery().mousemove(function(e) { + // add mouse coords + _ctx.collectInt(e.clientX, 16); + _ctx.collectInt(e.clientY, 16); + }); - resume(client) + // set up keyboard entropy capture + jQuery().keypress(function(e) { + _ctx.collectInt(e.charCode, 8); + }); + } } -async function connect (client) { - assert(!client[kConnecting]) - assert(!client[kSocket]) - - let { host, hostname, protocol, port } = client[kUrl] - - // Resolve ipv6 - if (hostname[0] === '[') { - const idx = hostname.indexOf(']') +/* Random API */ +if(!forge.random) { + forge.random = _ctx; +} else { + // extend forge.random with _ctx + for(var key in _ctx) { + forge.random[key] = _ctx[key]; + } +} - assert(idx !== -1) - const ip = hostname.substring(1, idx) +// expose spawn PRNG +forge.random.createInstance = spawnPrng; - assert(net.isIP(ip)) - hostname = ip - } +module.exports = forge.random; - client[kConnecting] = true +})(typeof(jQuery) !== 'undefined' ? jQuery : null); - if (channels.beforeConnect.hasSubscribers) { - channels.beforeConnect.publish({ - connectParams: { - host, - hostname, - protocol, - port, - servername: client[kServerName], - localAddress: client[kLocalAddress] - }, - connector: client[kConnector] - }) - } +})(); - try { - const socket = await new Promise((resolve, reject) => { - client[kConnector]({ - host, - hostname, - protocol, - port, - servername: client[kServerName], - localAddress: client[kLocalAddress] - }, (err, socket) => { - if (err) { - reject(err) - } else { - resolve(socket) - } - }) - }) - if (client.destroyed) { - util.destroy(socket.on('error', () => {}), new ClientDestroyedError()) - return - } +/***/ }), - client[kConnecting] = false +/***/ 99879: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - assert(socket) +/** + * RC2 implementation. + * + * @author Stefan Siegl + * + * Copyright (c) 2012 Stefan Siegl + * + * Information on the RC2 cipher is available from RFC #2268, + * http://www.ietf.org/rfc/rfc2268.txt + */ +var forge = __nccwpck_require__(56389); +__nccwpck_require__(65138); - const isH2 = socket.alpnProtocol === 'h2' - if (isH2) { - if (!h2ExperimentalWarned) { - h2ExperimentalWarned = true - process.emitWarning('H2 support is experimental, expect them to change at any time.', { - code: 'UNDICI-H2' - }) - } +var piTable =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xb4, 0x7a, 0xfc, 0x02, 0x36, 0x5b, 0x25, 0x55, 0x97, 0x31, + 0x2d, 0x5d, 0xfa, 0x98, 0xe3, 0x8a, 0x92, 0xae, 0x05, 0xdf, 0x29, 0x10, 0x67, 0x6c, 0xba, 0xc9, + 0xd3, 0x00, 0xe6, 0xcf, 0xe1, 0x9e, 0xa8, 0x2c, 0x63, 0x16, 0x01, 0x3f, 0x58, 0xe2, 0x89, 0xa9, + 0x0d, 0x38, 0x34, 0x1b, 0xab, 0x33, 0xff, 0xb0, 0xbb, 0x48, 0x0c, 0x5f, 0xb9, 0xb1, 0xcd, 0x2e, + 0xc5, 0xf3, 0xdb, 0x47, 0xe5, 0xa5, 0x9c, 0x77, 0x0a, 0xa6, 0x20, 0x68, 0xfe, 0x7f, 0xc1, 0xad +]; - const session = http2.connect(client[kUrl], { - createConnection: () => socket, - peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams - }) +var s = [1, 2, 3, 5]; - client[kHTTPConnVersion] = 'h2' - session[kClient] = client - session[kSocket] = socket - session.on('error', onHttp2SessionError) - session.on('frameError', onHttp2FrameError) - session.on('end', onHttp2SessionEnd) - session.on('goaway', onHTTP2GoAway) - session.on('close', onSocketClose) - session.unref() +/** + * Rotate a word left by given number of bits. + * + * Bits that are shifted out on the left are put back in on the right + * hand side. + * + * @param word The word to shift left. + * @param bits The number of bits to shift by. + * @return The rotated word. + */ +var rol = function(word, bits) { + return ((word << bits) & 0xffff) | ((word & 0xffff) >> (16 - bits)); +}; - client[kHTTP2Session] = session - socket[kHTTP2Session] = session - } else { - if (!llhttpInstance) { - llhttpInstance = await llhttpPromise - llhttpPromise = null - } +/** + * Rotate a word right by given number of bits. + * + * Bits that are shifted out on the right are put back in on the left + * hand side. + * + * @param word The word to shift right. + * @param bits The number of bits to shift by. + * @return The rotated word. + */ +var ror = function(word, bits) { + return ((word & 0xffff) >> bits) | ((word << (16 - bits)) & 0xffff); +}; - socket[kNoRef] = false - socket[kWriting] = false - socket[kReset] = false - socket[kBlocking] = false - socket[kParser] = new Parser(client, socket, llhttpInstance) - } +/* RC2 API */ +module.exports = forge.rc2 = forge.rc2 || {}; - socket[kCounter] = 0 - socket[kMaxRequests] = client[kMaxRequests] - socket[kClient] = client - socket[kError] = null +/** + * Perform RC2 key expansion as per RFC #2268, section 2. + * + * @param key variable-length user key (between 1 and 128 bytes) + * @param effKeyBits number of effective key bits (default: 128) + * @return the expanded RC2 key (ByteBuffer of 128 bytes) + */ +forge.rc2.expandKey = function(key, effKeyBits) { + if(typeof key === 'string') { + key = forge.util.createBuffer(key); + } + effKeyBits = effKeyBits || 128; - socket - .on('error', onSocketError) - .on('readable', onSocketReadable) - .on('end', onSocketEnd) - .on('close', onSocketClose) + /* introduce variables that match the names used in RFC #2268 */ + var L = key; + var T = key.length(); + var T1 = effKeyBits; + var T8 = Math.ceil(T1 / 8); + var TM = 0xff >> (T1 & 0x07); + var i; - client[kSocket] = socket + for(i = T; i < 128; i++) { + L.putByte(piTable[(L.at(i - 1) + L.at(i - T)) & 0xff]); + } - if (channels.connected.hasSubscribers) { - channels.connected.publish({ - connectParams: { - host, - hostname, - protocol, - port, - servername: client[kServerName], - localAddress: client[kLocalAddress] - }, - connector: client[kConnector], - socket - }) - } - client.emit('connect', client[kUrl], [client]) - } catch (err) { - if (client.destroyed) { - return - } + L.setAt(128 - T8, piTable[L.at(128 - T8) & TM]); - client[kConnecting] = false + for(i = 127 - T8; i >= 0; i--) { + L.setAt(i, piTable[L.at(i + 1) ^ L.at(i + T8)]); + } - if (channels.connectError.hasSubscribers) { - channels.connectError.publish({ - connectParams: { - host, - hostname, - protocol, - port, - servername: client[kServerName], - localAddress: client[kLocalAddress] - }, - connector: client[kConnector], - error: err - }) - } + return L; +}; - if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') { - assert(client[kRunning] === 0) - while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { - const request = client[kQueue][client[kPendingIdx]++] - errorRequest(client, request, err) - } - } else { - onError(client, err) - } +/** + * Creates a RC2 cipher object. + * + * @param key the symmetric key to use (as base for key generation). + * @param bits the number of effective key bits. + * @param encrypt false for decryption, true for encryption. + * + * @return the cipher. + */ +var createCipher = function(key, bits, encrypt) { + var _finish = false, _input = null, _output = null, _iv = null; + var mixRound, mashRound; + var i, j, K = []; - client.emit('connectionError', client[kUrl], [client], err) + /* Expand key and fill into K[] Array */ + key = forge.rc2.expandKey(key, bits); + for(i = 0; i < 64; i++) { + K.push(key.getInt16Le()); } - resume(client) -} + if(encrypt) { + /** + * Perform one mixing round "in place". + * + * @param R Array of four words to perform mixing on. + */ + mixRound = function(R) { + for(i = 0; i < 4; i++) { + R[i] += K[j] + (R[(i + 3) % 4] & R[(i + 2) % 4]) + + ((~R[(i + 3) % 4]) & R[(i + 1) % 4]); + R[i] = rol(R[i], s[i]); + j++; + } + }; -function emitDrain (client) { - client[kNeedDrain] = 0 - client.emit('drain', client[kUrl], [client]) -} + /** + * Perform one mashing round "in place". + * + * @param R Array of four words to perform mashing on. + */ + mashRound = function(R) { + for(i = 0; i < 4; i++) { + R[i] += K[R[(i + 3) % 4] & 63]; + } + }; + } else { + /** + * Perform one r-mixing round "in place". + * + * @param R Array of four words to perform mixing on. + */ + mixRound = function(R) { + for(i = 3; i >= 0; i--) { + R[i] = ror(R[i], s[i]); + R[i] -= K[j] + (R[(i + 3) % 4] & R[(i + 2) % 4]) + + ((~R[(i + 3) % 4]) & R[(i + 1) % 4]); + j--; + } + }; -function resume (client, sync) { - if (client[kResuming] === 2) { - return + /** + * Perform one r-mashing round "in place". + * + * @param R Array of four words to perform mashing on. + */ + mashRound = function(R) { + for(i = 3; i >= 0; i--) { + R[i] -= K[R[(i + 3) % 4] & 63]; + } + }; } - client[kResuming] = 2 + /** + * Run the specified cipher execution plan. + * + * This function takes four words from the input buffer, applies the IV on + * it (if requested) and runs the provided execution plan. + * + * The plan must be put together in form of a array of arrays. Where the + * outer one is simply a list of steps to perform and the inner one needs + * to have two elements: the first one telling how many rounds to perform, + * the second one telling what to do (i.e. the function to call). + * + * @param {Array} plan The plan to execute. + */ + var runPlan = function(plan) { + var R = []; - _resume(client, sync) - client[kResuming] = 0 + /* Get data from input buffer and fill the four words into R */ + for(i = 0; i < 4; i++) { + var val = _input.getInt16Le(); - if (client[kRunningIdx] > 256) { - client[kQueue].splice(0, client[kRunningIdx]) - client[kPendingIdx] -= client[kRunningIdx] - client[kRunningIdx] = 0 - } -} + if(_iv !== null) { + if(encrypt) { + /* We're encrypting, apply the IV first. */ + val ^= _iv.getInt16Le(); + } else { + /* We're decryption, keep cipher text for next block. */ + _iv.putInt16Le(val); + } + } -function _resume (client, sync) { - while (true) { - if (client.destroyed) { - assert(client[kPending] === 0) - return + R.push(val & 0xffff); } - if (client[kClosedResolve] && !client[kSize]) { - client[kClosedResolve]() - client[kClosedResolve] = null - return - } + /* Reset global "j" variable as per spec. */ + j = encrypt ? 0 : 63; - const socket = client[kSocket] + /* Run execution plan. */ + for(var ptr = 0; ptr < plan.length; ptr++) { + for(var ctr = 0; ctr < plan[ptr][0]; ctr++) { + plan[ptr][1](R); + } + } - if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') { - if (client[kSize] === 0) { - if (!socket[kNoRef] && socket.unref) { - socket.unref() - socket[kNoRef] = true + /* Write back result to output buffer. */ + for(i = 0; i < 4; i++) { + if(_iv !== null) { + if(encrypt) { + /* We're encrypting in CBC-mode, feed back encrypted bytes into + IV buffer to carry it forward to next block. */ + _iv.putInt16Le(R[i]); + } else { + R[i] ^= _iv.getInt16Le(); } - } else if (socket[kNoRef] && socket.ref) { - socket.ref() - socket[kNoRef] = false } - if (client[kSize] === 0) { - if (socket[kParser].timeoutType !== TIMEOUT_IDLE) { - socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE) - } - } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) { - if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) { - const request = client[kQueue][client[kRunningIdx]] - const headersTimeout = request.headersTimeout != null - ? request.headersTimeout - : client[kHeadersTimeout] - socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS) + _output.putInt16Le(R[i]); + } + }; + + /* Create cipher object */ + var cipher = null; + cipher = { + /** + * Starts or restarts the encryption or decryption process, whichever + * was previously configured. + * + * To use the cipher in CBC mode, iv may be given either as a string + * of bytes, or as a byte buffer. For ECB mode, give null as iv. + * + * @param iv the initialization vector to use, null for ECB mode. + * @param output the output the buffer to write to, null to create one. + */ + start: function(iv, output) { + if(iv) { + /* CBC mode */ + if(typeof iv === 'string') { + iv = forge.util.createBuffer(iv); } } - } - if (client[kBusy]) { - client[kNeedDrain] = 2 - } else if (client[kNeedDrain] === 2) { - if (sync) { - client[kNeedDrain] = 1 - process.nextTick(emitDrain, client) - } else { - emitDrain(client) + _finish = false; + _input = forge.util.createBuffer(); + _output = output || new forge.util.createBuffer(); + _iv = iv; + + cipher.output = _output; + }, + + /** + * Updates the next block. + * + * @param input the buffer to read from. + */ + update: function(input) { + if(!_finish) { + // not finishing, so fill the input buffer with more input + _input.putBuffer(input); } - continue - } - if (client[kPending] === 0) { - return - } + while(_input.length() >= 8) { + runPlan([ + [ 5, mixRound ], + [ 1, mashRound ], + [ 6, mixRound ], + [ 1, mashRound ], + [ 5, mixRound ] + ]); + } + }, - if (client[kRunning] >= (client[kPipelining] || 1)) { - return - } + /** + * Finishes encrypting or decrypting. + * + * @param pad a padding function to use, null for PKCS#7 padding, + * signature(blockSize, buffer, decrypt). + * + * @return true if successful, false on error. + */ + finish: function(pad) { + var rval = true; - const request = client[kQueue][client[kPendingIdx]] + if(encrypt) { + if(pad) { + rval = pad(8, _input, !encrypt); + } else { + // add PKCS#7 padding to block (each pad byte is the + // value of the number of pad bytes) + var padding = (_input.length() === 8) ? 8 : (8 - _input.length()); + _input.fillWithByte(padding, padding); + } + } - if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) { - if (client[kRunning] > 0) { - return + if(rval) { + // do final update + _finish = true; + cipher.update(); } - client[kServerName] = request.servername + if(!encrypt) { + // check for error: input data not a multiple of block size + rval = (_input.length() === 0); + if(rval) { + if(pad) { + rval = pad(8, _output, !encrypt); + } else { + // ensure padding byte count is valid + var len = _output.length(); + var count = _output.at(len - 1); - if (socket && socket.servername !== request.servername) { - util.destroy(socket, new InformationalError('servername changed')) - return + if(count > len) { + rval = false; + } else { + // trim off padding bytes + _output.truncate(count); + } + } + } } - } - - if (client[kConnecting]) { - return - } - if (!socket && !client[kHTTP2Session]) { - connect(client) - return + return rval; } + }; - if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) { - return - } + return cipher; +}; - if (client[kRunning] > 0 && !request.idempotent) { - // Non-idempotent request cannot be retried. - // Ensure that no other requests are inflight and - // could cause failure. - return - } +/** + * Creates an RC2 cipher object to encrypt data in ECB or CBC mode using the + * given symmetric key. The output will be stored in the 'output' member + * of the returned cipher. + * + * The key and iv may be given as a string of bytes or a byte buffer. + * The cipher is initialized to use 128 effective key bits. + * + * @param key the symmetric key to use. + * @param iv the initialization vector to use. + * @param output the buffer to write to, null to create one. + * + * @return the cipher. + */ +forge.rc2.startEncrypting = function(key, iv, output) { + var cipher = forge.rc2.createEncryptionCipher(key, 128); + cipher.start(iv, output); + return cipher; +}; - if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) { - // Don't dispatch an upgrade until all preceding requests have completed. - // A misbehaving server might upgrade the connection before all pipelined - // request has completed. - return - } +/** + * Creates an RC2 cipher object to encrypt data in ECB or CBC mode using the + * given symmetric key. + * + * The key may be given as a string of bytes or a byte buffer. + * + * To start encrypting call start() on the cipher with an iv and optional + * output buffer. + * + * @param key the symmetric key to use. + * + * @return the cipher. + */ +forge.rc2.createEncryptionCipher = function(key, bits) { + return createCipher(key, bits, true); +}; - if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 && - (util.isStream(request.body) || util.isAsyncIterable(request.body))) { - // Request with stream or iterator body can error while other requests - // are inflight and indirectly error those as well. - // Ensure this doesn't happen by waiting for inflight - // to complete before dispatching. +/** + * Creates an RC2 cipher object to decrypt data in ECB or CBC mode using the + * given symmetric key. The output will be stored in the 'output' member + * of the returned cipher. + * + * The key and iv may be given as a string of bytes or a byte buffer. + * The cipher is initialized to use 128 effective key bits. + * + * @param key the symmetric key to use. + * @param iv the initialization vector to use. + * @param output the buffer to write to, null to create one. + * + * @return the cipher. + */ +forge.rc2.startDecrypting = function(key, iv, output) { + var cipher = forge.rc2.createDecryptionCipher(key, 128); + cipher.start(iv, output); + return cipher; +}; - // Request with stream or iterator body cannot be retried. - // Ensure that no other requests are inflight and - // could cause failure. - return - } +/** + * Creates an RC2 cipher object to decrypt data in ECB or CBC mode using the + * given symmetric key. + * + * The key may be given as a string of bytes or a byte buffer. + * + * To start decrypting call start() on the cipher with an iv and optional + * output buffer. + * + * @param key the symmetric key to use. + * + * @return the cipher. + */ +forge.rc2.createDecryptionCipher = function(key, bits) { + return createCipher(key, bits, false); +}; - if (!request.aborted && write(client, request)) { - client[kPendingIdx]++ - } else { - client[kQueue].splice(client[kPendingIdx], 1) - } - } -} -// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2 -function shouldSendContentLength (method) { - return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT' -} +/***/ }), -function write (client, request) { - if (client[kHTTPConnVersion] === 'h2') { - writeH2(client, client[kHTTP2Session], request) - return - } +/***/ 62175: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const { body, method, path, host, upgrade, headers, blocking, reset } = request +/** + * Javascript implementation of basic RSA algorithms. + * + * @author Dave Longley + * + * Copyright (c) 2010-2014 Digital Bazaar, Inc. + * + * The only algorithm currently supported for PKI is RSA. + * + * An RSA key is often stored in ASN.1 DER format. The SubjectPublicKeyInfo + * ASN.1 structure is composed of an algorithm of type AlgorithmIdentifier + * and a subjectPublicKey of type bit string. + * + * The AlgorithmIdentifier contains an Object Identifier (OID) and parameters + * for the algorithm, if any. In the case of RSA, there aren't any. + * + * SubjectPublicKeyInfo ::= SEQUENCE { + * algorithm AlgorithmIdentifier, + * subjectPublicKey BIT STRING + * } + * + * AlgorithmIdentifer ::= SEQUENCE { + * algorithm OBJECT IDENTIFIER, + * parameters ANY DEFINED BY algorithm OPTIONAL + * } + * + * For an RSA public key, the subjectPublicKey is: + * + * RSAPublicKey ::= SEQUENCE { + * modulus INTEGER, -- n + * publicExponent INTEGER -- e + * } + * + * PrivateKeyInfo ::= SEQUENCE { + * version Version, + * privateKeyAlgorithm PrivateKeyAlgorithmIdentifier, + * privateKey PrivateKey, + * attributes [0] IMPLICIT Attributes OPTIONAL + * } + * + * Version ::= INTEGER + * PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier + * PrivateKey ::= OCTET STRING + * Attributes ::= SET OF Attribute + * + * An RSA private key as the following structure: + * + * RSAPrivateKey ::= SEQUENCE { + * version Version, + * modulus INTEGER, -- n + * publicExponent INTEGER, -- e + * privateExponent INTEGER, -- d + * prime1 INTEGER, -- p + * prime2 INTEGER, -- q + * exponent1 INTEGER, -- d mod (p-1) + * exponent2 INTEGER, -- d mod (q-1) + * coefficient INTEGER -- (inverse of q) mod p + * } + * + * Version ::= INTEGER + * + * The OID for the RSA key algorithm is: 1.2.840.113549.1.1.1 + */ +var forge = __nccwpck_require__(56389); +__nccwpck_require__(14098); +__nccwpck_require__(20447); +__nccwpck_require__(83175); +__nccwpck_require__(8892); +__nccwpck_require__(8849); +__nccwpck_require__(62544); +__nccwpck_require__(65138); - // https://tools.ietf.org/html/rfc7231#section-4.3.1 - // https://tools.ietf.org/html/rfc7231#section-4.3.2 - // https://tools.ietf.org/html/rfc7231#section-4.3.5 +if(typeof BigInteger === 'undefined') { + var BigInteger = forge.jsbn.BigInteger; +} - // Sending a payload body on a request that does not - // expect it can cause undefined behavior on some - // servers and corrupt connection state. Do not - // re-use the connection for further requests. +var _crypto = forge.util.isNodejs ? __nccwpck_require__(6113) : null; - const expectsPayload = ( - method === 'PUT' || - method === 'POST' || - method === 'PATCH' - ) +// shortcut for asn.1 API +var asn1 = forge.asn1; - if (body && typeof body.read === 'function') { - // Try to read EOF in order to get length. - body.read(0) - } +// shortcut for util API +var util = forge.util; - const bodyLength = util.bodyLength(body) +/* + * RSA encryption and decryption, see RFC 2313. + */ +forge.pki = forge.pki || {}; +module.exports = forge.pki.rsa = forge.rsa = forge.rsa || {}; +var pki = forge.pki; - let contentLength = bodyLength +// for finding primes, which are 30k+i for i = 1, 7, 11, 13, 17, 19, 23, 29 +var GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2]; - if (contentLength === null) { - contentLength = request.contentLength - } +// validator for a PrivateKeyInfo structure +var privateKeyValidator = { + // PrivateKeyInfo + name: 'PrivateKeyInfo', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.SEQUENCE, + constructed: true, + value: [{ + // Version (INTEGER) + name: 'PrivateKeyInfo.version', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.INTEGER, + constructed: false, + capture: 'privateKeyVersion' + }, { + // privateKeyAlgorithm + name: 'PrivateKeyInfo.privateKeyAlgorithm', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.SEQUENCE, + constructed: true, + value: [{ + name: 'AlgorithmIdentifier.algorithm', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.OID, + constructed: false, + capture: 'privateKeyOid' + }] + }, { + // PrivateKey + name: 'PrivateKeyInfo', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.OCTETSTRING, + constructed: false, + capture: 'privateKey' + }] +}; - if (contentLength === 0 && !expectsPayload) { - // https://tools.ietf.org/html/rfc7230#section-3.3.2 - // A user agent SHOULD NOT send a Content-Length header field when - // the request message does not contain a payload body and the method - // semantics do not anticipate such a body. +// validator for an RSA private key +var rsaPrivateKeyValidator = { + // RSAPrivateKey + name: 'RSAPrivateKey', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.SEQUENCE, + constructed: true, + value: [{ + // Version (INTEGER) + name: 'RSAPrivateKey.version', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.INTEGER, + constructed: false, + capture: 'privateKeyVersion' + }, { + // modulus (n) + name: 'RSAPrivateKey.modulus', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.INTEGER, + constructed: false, + capture: 'privateKeyModulus' + }, { + // publicExponent (e) + name: 'RSAPrivateKey.publicExponent', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.INTEGER, + constructed: false, + capture: 'privateKeyPublicExponent' + }, { + // privateExponent (d) + name: 'RSAPrivateKey.privateExponent', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.INTEGER, + constructed: false, + capture: 'privateKeyPrivateExponent' + }, { + // prime1 (p) + name: 'RSAPrivateKey.prime1', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.INTEGER, + constructed: false, + capture: 'privateKeyPrime1' + }, { + // prime2 (q) + name: 'RSAPrivateKey.prime2', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.INTEGER, + constructed: false, + capture: 'privateKeyPrime2' + }, { + // exponent1 (d mod (p-1)) + name: 'RSAPrivateKey.exponent1', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.INTEGER, + constructed: false, + capture: 'privateKeyExponent1' + }, { + // exponent2 (d mod (q-1)) + name: 'RSAPrivateKey.exponent2', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.INTEGER, + constructed: false, + capture: 'privateKeyExponent2' + }, { + // coefficient ((inverse of q) mod p) + name: 'RSAPrivateKey.coefficient', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.INTEGER, + constructed: false, + capture: 'privateKeyCoefficient' + }] +}; - contentLength = null - } +// validator for an RSA public key +var rsaPublicKeyValidator = { + // RSAPublicKey + name: 'RSAPublicKey', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.SEQUENCE, + constructed: true, + value: [{ + // modulus (n) + name: 'RSAPublicKey.modulus', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.INTEGER, + constructed: false, + capture: 'publicKeyModulus' + }, { + // publicExponent (e) + name: 'RSAPublicKey.exponent', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.INTEGER, + constructed: false, + capture: 'publicKeyExponent' + }] +}; - // https://github.com/nodejs/undici/issues/2046 - // A user agent may send a Content-Length header with 0 value, this should be allowed. - if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) { - if (client[kStrictContentLength]) { - errorRequest(client, request, new RequestContentLengthMismatchError()) - return false - } +// validator for an SubjectPublicKeyInfo structure +// Note: Currently only works with an RSA public key +var publicKeyValidator = forge.pki.rsa.publicKeyValidator = { + name: 'SubjectPublicKeyInfo', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.SEQUENCE, + constructed: true, + captureAsn1: 'subjectPublicKeyInfo', + value: [{ + name: 'SubjectPublicKeyInfo.AlgorithmIdentifier', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.SEQUENCE, + constructed: true, + value: [{ + name: 'AlgorithmIdentifier.algorithm', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.OID, + constructed: false, + capture: 'publicKeyOid' + }] + }, { + // subjectPublicKey + name: 'SubjectPublicKeyInfo.subjectPublicKey', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.BITSTRING, + constructed: false, + value: [{ + // RSAPublicKey + name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey', + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.SEQUENCE, + constructed: true, + optional: true, + captureAsn1: 'rsaPublicKey' + }] + }] +}; - process.emitWarning(new RequestContentLengthMismatchError()) +/** + * Wrap digest in DigestInfo object. + * + * This function implements EMSA-PKCS1-v1_5-ENCODE as per RFC 3447. + * + * DigestInfo ::= SEQUENCE { + * digestAlgorithm DigestAlgorithmIdentifier, + * digest Digest + * } + * + * DigestAlgorithmIdentifier ::= AlgorithmIdentifier + * Digest ::= OCTET STRING + * + * @param md the message digest object with the hash to sign. + * + * @return the encoded message (ready for RSA encrytion) + */ +var emsaPkcs1v15encode = function(md) { + // get the oid for the algorithm + var oid; + if(md.algorithm in pki.oids) { + oid = pki.oids[md.algorithm]; + } else { + var error = new Error('Unknown message digest algorithm.'); + error.algorithm = md.algorithm; + throw error; } + var oidBytes = asn1.oidToDer(oid).getBytes(); - const socket = client[kSocket] - - try { - request.onConnect((err) => { - if (request.aborted || request.completed) { - return - } + // create the digest info + var digestInfo = asn1.create( + asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); + var digestAlgorithm = asn1.create( + asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); + digestAlgorithm.value.push(asn1.create( + asn1.Class.UNIVERSAL, asn1.Type.OID, false, oidBytes)); + digestAlgorithm.value.push(asn1.create( + asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')); + var digest = asn1.create( + asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, + false, md.digest().getBytes()); + digestInfo.value.push(digestAlgorithm); + digestInfo.value.push(digest); - errorRequest(client, request, err || new RequestAbortedError()) + // encode digest info + return asn1.toDer(digestInfo).getBytes(); +}; - util.destroy(socket, new InformationalError('aborted')) - }) - } catch (err) { - errorRequest(client, request, err) +/** + * Performs x^c mod n (RSA encryption or decryption operation). + * + * @param x the number to raise and mod. + * @param key the key to use. + * @param pub true if the key is public, false if private. + * + * @return the result of x^c mod n. + */ +var _modPow = function(x, key, pub) { + if(pub) { + return x.modPow(key.e, key.n); } - if (request.aborted) { - return false + if(!key.p || !key.q) { + // allow calculation without CRT params (slow) + return x.modPow(key.d, key.n); } - if (method === 'HEAD') { - // https://github.com/mcollina/undici/issues/258 - // Close after a HEAD request to interop with misbehaving servers - // that may send a body in the response. - - socket[kReset] = true + // pre-compute dP, dQ, and qInv if necessary + if(!key.dP) { + key.dP = key.d.mod(key.p.subtract(BigInteger.ONE)); } - - if (upgrade || method === 'CONNECT') { - // On CONNECT or upgrade, block pipeline from dispatching further - // requests on this connection. - - socket[kReset] = true + if(!key.dQ) { + key.dQ = key.d.mod(key.q.subtract(BigInteger.ONE)); } - - if (reset != null) { - socket[kReset] = reset + if(!key.qInv) { + key.qInv = key.q.modInverse(key.p); } - if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) { - socket[kReset] = true - } + /* Chinese remainder theorem (CRT) states: - if (blocking) { - socket[kBlocking] = true - } + Suppose n1, n2, ..., nk are positive integers which are pairwise + coprime (n1 and n2 have no common factors other than 1). For any + integers x1, x2, ..., xk there exists an integer x solving the + system of simultaneous congruences (where ~= means modularly + congruent so a ~= b mod n means a mod n = b mod n): - let header = `${method} ${path} HTTP/1.1\r\n` + x ~= x1 mod n1 + x ~= x2 mod n2 + ... + x ~= xk mod nk - if (typeof host === 'string') { - header += `host: ${host}\r\n` - } else { - header += client[kHostHeader] - } + This system of congruences has a single simultaneous solution x + between 0 and n - 1. Furthermore, each xk solution and x itself + is congruent modulo the product n = n1*n2*...*nk. + So x1 mod n = x2 mod n = xk mod n = x mod n. - if (upgrade) { - header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n` - } else if (client[kPipelining] && !socket[kReset]) { - header += 'connection: keep-alive\r\n' - } else { - header += 'connection: close\r\n' - } + The single simultaneous solution x can be solved with the following + equation: - if (headers) { - header += headers - } + x = sum(xi*ri*si) mod n where ri = n/ni and si = ri^-1 mod ni. - if (channels.sendHeaders.hasSubscribers) { - channels.sendHeaders.publish({ request, headers: header, socket }) - } + Where x is less than n, xi = x mod ni. - /* istanbul ignore else: assertion */ - if (!body || bodyLength === 0) { - if (contentLength === 0) { - socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1') - } else { - assert(contentLength === null, 'no body must not have content length') - socket.write(`${header}\r\n`, 'latin1') - } - request.onRequestSent() - } else if (util.isBuffer(body)) { - assert(contentLength === body.byteLength, 'buffer body must have content length') + For RSA we are only concerned with k = 2. The modulus n = pq, where + p and q are coprime. The RSA decryption algorithm is: - socket.cork() - socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') - socket.write(body) - socket.uncork() - request.onBodySent(body) - request.onRequestSent() - if (!expectsPayload) { - socket[kReset] = true - } - } else if (util.isBlobLike(body)) { - if (typeof body.stream === 'function') { - writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload }) - } else { - writeBlob({ body, client, request, socket, contentLength, header, expectsPayload }) - } - } else if (util.isStream(body)) { - writeStream({ body, client, request, socket, contentLength, header, expectsPayload }) - } else if (util.isIterable(body)) { - writeIterable({ body, client, request, socket, contentLength, header, expectsPayload }) - } else { - assert(false) - } + y = x^d mod n - return true -} + Given the above: -function writeH2 (client, session, request) { - const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request + x1 = x^d mod p + r1 = n/p = q + s1 = q^-1 mod p + x2 = x^d mod q + r2 = n/q = p + s2 = p^-1 mod q - let headers - if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim()) - else headers = reqHeaders + So y = (x1r1s1 + x2r2s2) mod n + = ((x^d mod p)q(q^-1 mod p) + (x^d mod q)p(p^-1 mod q)) mod n - if (upgrade) { - errorRequest(client, request, new Error('Upgrade not supported for H2')) - return false - } + According to Fermat's Little Theorem, if the modulus P is prime, + for any integer A not evenly divisible by P, A^(P-1) ~= 1 mod P. + Since A is not divisible by P it follows that if: + N ~= M mod (P - 1), then A^N mod P = A^M mod P. Therefore: - try { - // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event? - request.onConnect((err) => { - if (request.aborted || request.completed) { - return - } + A^N mod P = A^(M mod (P - 1)) mod P. (The latter takes less effort + to calculate). In order to calculate x^d mod p more quickly the + exponent d mod (p - 1) is stored in the RSA private key (the same + is done for x^d mod q). These values are referred to as dP and dQ + respectively. Therefore we now have: - errorRequest(client, request, err || new RequestAbortedError()) - }) - } catch (err) { - errorRequest(client, request, err) - } + y = ((x^dP mod p)q(q^-1 mod p) + (x^dQ mod q)p(p^-1 mod q)) mod n - if (request.aborted) { - return false - } + Since we'll be reducing x^dP by modulo p (same for q) we can also + reduce x by p (and q respectively) before hand. Therefore, let - /** @type {import('node:http2').ClientHttp2Stream} */ - let stream - const h2State = client[kHTTP2SessionState] + xp = ((x mod p)^dP mod p), and + xq = ((x mod q)^dQ mod q), yielding: - headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost] - headers[HTTP2_HEADER_METHOD] = method + y = (xp*q*(q^-1 mod p) + xq*p*(p^-1 mod q)) mod n - if (method === 'CONNECT') { - session.ref() - // we are already connected, streams are pending, first request - // will create a new stream. We trigger a request to create the stream and wait until - // `ready` event is triggered - // We disabled endStream to allow the user to write to the stream - stream = session.request(headers, { endStream: false, signal }) + This can be further reduced to a simple algorithm that only + requires 1 inverse (the q inverse is used) to be used and stored. + The algorithm is called Garner's algorithm. If qInv is the + inverse of q, we simply calculate: - if (stream.id && !stream.pending) { - request.onUpgrade(null, null, stream) - ++h2State.openStreams - } else { - stream.once('ready', () => { - request.onUpgrade(null, null, stream) - ++h2State.openStreams - }) - } + y = (qInv*(xp - xq) mod p) * q + xq - stream.once('close', () => { - h2State.openStreams -= 1 - // TODO(HTTP/2): unref only if current streams count is 0 - if (h2State.openStreams === 0) session.unref() - }) + However, there are two further complications. First, we need to + ensure that xp > xq to prevent signed BigIntegers from being used + so we add p until this is true (since we will be mod'ing with + p anyway). Then, there is a known timing attack on algorithms + using the CRT. To mitigate this risk, "cryptographic blinding" + should be used. This requires simply generating a random number r + between 0 and n-1 and its inverse and multiplying x by r^e before + calculating y and then multiplying y by r^-1 afterwards. Note that + r must be coprime with n (gcd(r, n) === 1) in order to have an + inverse. + */ - return true - } + // cryptographic blinding + var r; + do { + r = new BigInteger( + forge.util.bytesToHex(forge.random.getBytes(key.n.bitLength() / 8)), + 16); + } while(r.compareTo(key.n) >= 0 || !r.gcd(key.n).equals(BigInteger.ONE)); + x = x.multiply(r.modPow(key.e, key.n)).mod(key.n); - // https://tools.ietf.org/html/rfc7540#section-8.3 - // :path and :scheme headers must be omited when sending CONNECT + // calculate xp and xq + var xp = x.mod(key.p).modPow(key.dP, key.p); + var xq = x.mod(key.q).modPow(key.dQ, key.q); - headers[HTTP2_HEADER_PATH] = path - headers[HTTP2_HEADER_SCHEME] = 'https' + // xp must be larger than xq to avoid signed bit usage + while(xp.compareTo(xq) < 0) { + xp = xp.add(key.p); + } - // https://tools.ietf.org/html/rfc7231#section-4.3.1 - // https://tools.ietf.org/html/rfc7231#section-4.3.2 - // https://tools.ietf.org/html/rfc7231#section-4.3.5 + // do last step + var y = xp.subtract(xq) + .multiply(key.qInv).mod(key.p) + .multiply(key.q).add(xq); - // Sending a payload body on a request that does not - // expect it can cause undefined behavior on some - // servers and corrupt connection state. Do not - // re-use the connection for further requests. + // remove effect of random for cryptographic blinding + y = y.multiply(r.modInverse(key.n)).mod(key.n); - const expectsPayload = ( - method === 'PUT' || - method === 'POST' || - method === 'PATCH' - ) + return y; +}; - if (body && typeof body.read === 'function') { - // Try to read EOF in order to get length. - body.read(0) - } +/** + * NOTE: THIS METHOD IS DEPRECATED, use 'sign' on a private key object or + * 'encrypt' on a public key object instead. + * + * Performs RSA encryption. + * + * The parameter bt controls whether to put padding bytes before the + * message passed in. Set bt to either true or false to disable padding + * completely (in order to handle e.g. EMSA-PSS encoding seperately before), + * signaling whether the encryption operation is a public key operation + * (i.e. encrypting data) or not, i.e. private key operation (data signing). + * + * For PKCS#1 v1.5 padding pass in the block type to use, i.e. either 0x01 + * (for signing) or 0x02 (for encryption). The key operation mode (private + * or public) is derived from this flag in that case). + * + * @param m the message to encrypt as a byte string. + * @param key the RSA key to use. + * @param bt for PKCS#1 v1.5 padding, the block type to use + * (0x01 for private key, 0x02 for public), + * to disable padding: true = public key, false = private key. + * + * @return the encrypted bytes as a string. + */ +pki.rsa.encrypt = function(m, key, bt) { + var pub = bt; + var eb; - let contentLength = util.bodyLength(body) + // get the length of the modulus in bytes + var k = Math.ceil(key.n.bitLength() / 8); - if (contentLength == null) { - contentLength = request.contentLength + if(bt !== false && bt !== true) { + // legacy, default to PKCS#1 v1.5 padding + pub = (bt === 0x02); + eb = _encodePkcs1_v1_5(m, key, bt); + } else { + eb = forge.util.createBuffer(); + eb.putBytes(m); } - if (contentLength === 0 || !expectsPayload) { - // https://tools.ietf.org/html/rfc7230#section-3.3.2 - // A user agent SHOULD NOT send a Content-Length header field when - // the request message does not contain a payload body and the method - // semantics do not anticipate such a body. + // load encryption block as big integer 'x' + // FIXME: hex conversion inefficient, get BigInteger w/byte strings + var x = new BigInteger(eb.toHex(), 16); - contentLength = null + // do RSA encryption + var y = _modPow(x, key, pub); + + // convert y into the encrypted data byte string, if y is shorter in + // bytes than k, then prepend zero bytes to fill up ed + // FIXME: hex conversion inefficient, get BigInteger w/byte strings + var yhex = y.toString(16); + var ed = forge.util.createBuffer(); + var zeros = k - Math.ceil(yhex.length / 2); + while(zeros > 0) { + ed.putByte(0x00); + --zeros; } + ed.putBytes(forge.util.hexToBytes(yhex)); + return ed.getBytes(); +}; - // https://github.com/nodejs/undici/issues/2046 - // A user agent may send a Content-Length header with 0 value, this should be allowed. - if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) { - if (client[kStrictContentLength]) { - errorRequest(client, request, new RequestContentLengthMismatchError()) - return false - } +/** + * NOTE: THIS METHOD IS DEPRECATED, use 'decrypt' on a private key object or + * 'verify' on a public key object instead. + * + * Performs RSA decryption. + * + * The parameter ml controls whether to apply PKCS#1 v1.5 padding + * or not. Set ml = false to disable padding removal completely + * (in order to handle e.g. EMSA-PSS later on) and simply pass back + * the RSA encryption block. + * + * @param ed the encrypted data to decrypt in as a byte string. + * @param key the RSA key to use. + * @param pub true for a public key operation, false for private. + * @param ml the message length, if known, false to disable padding. + * + * @return the decrypted message as a byte string. + */ +pki.rsa.decrypt = function(ed, key, pub, ml) { + // get the length of the modulus in bytes + var k = Math.ceil(key.n.bitLength() / 8); - process.emitWarning(new RequestContentLengthMismatchError()) + // error if the length of the encrypted data ED is not k + if(ed.length !== k) { + var error = new Error('Encrypted message length is invalid.'); + error.length = ed.length; + error.expected = k; + throw error; } - if (contentLength != null) { - assert(body, 'no body must not have content length') - headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}` - } + // convert encrypted data into a big integer + // FIXME: hex conversion inefficient, get BigInteger w/byte strings + var y = new BigInteger(forge.util.createBuffer(ed).toHex(), 16); - session.ref() + // y must be less than the modulus or it wasn't the result of + // a previous mod operation (encryption) using that modulus + if(y.compareTo(key.n) >= 0) { + throw new Error('Encrypted message is invalid.'); + } - const shouldEndStream = method === 'GET' || method === 'HEAD' - if (expectContinue) { - headers[HTTP2_HEADER_EXPECT] = '100-continue' - stream = session.request(headers, { endStream: shouldEndStream, signal }) + // do RSA decryption + var x = _modPow(y, key, pub); - stream.once('continue', writeBodyH2) - } else { - stream = session.request(headers, { - endStream: shouldEndStream, - signal - }) - writeBodyH2() + // create the encryption block, if x is shorter in bytes than k, then + // prepend zero bytes to fill up eb + // FIXME: hex conversion inefficient, get BigInteger w/byte strings + var xhex = x.toString(16); + var eb = forge.util.createBuffer(); + var zeros = k - Math.ceil(xhex.length / 2); + while(zeros > 0) { + eb.putByte(0x00); + --zeros; } + eb.putBytes(forge.util.hexToBytes(xhex)); - // Increment counter as we have new several streams open - ++h2State.openStreams + if(ml !== false) { + // legacy, default to PKCS#1 v1.5 padding + return _decodePkcs1_v1_5(eb.getBytes(), key, pub); + } - stream.once('response', headers => { - const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers + // return message + return eb.getBytes(); +}; - if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) { - stream.pause() - } - }) +/** + * Creates an RSA key-pair generation state object. It is used to allow + * key-generation to be performed in steps. It also allows for a UI to + * display progress updates. + * + * @param bits the size for the private key in bits, defaults to 2048. + * @param e the public exponent to use, defaults to 65537 (0x10001). + * @param [options] the options to use. + * prng a custom crypto-secure pseudo-random number generator to use, + * that must define "getBytesSync". + * algorithm the algorithm to use (default: 'PRIMEINC'). + * + * @return the state object to use to generate the key-pair. + */ +pki.rsa.createKeyPairGenerationState = function(bits, e, options) { + // TODO: migrate step-based prime generation code to forge.prime - stream.once('end', () => { - request.onComplete([]) - }) + // set default bits + if(typeof(bits) === 'string') { + bits = parseInt(bits, 10); + } + bits = bits || 2048; - stream.on('data', (chunk) => { - if (request.onData(chunk) === false) { - stream.pause() + // create prng with api that matches BigInteger secure random + options = options || {}; + var prng = options.prng || forge.random; + var rng = { + // x is an array to fill with bytes + nextBytes: function(x) { + var b = prng.getBytesSync(x.length); + for(var i = 0; i < x.length; ++i) { + x[i] = b.charCodeAt(i); + } } - }) + }; - stream.once('close', () => { - h2State.openStreams -= 1 - // TODO(HTTP/2): unref only if current streams count is 0 - if (h2State.openStreams === 0) { - session.unref() - } - }) + var algorithm = options.algorithm || 'PRIMEINC'; - stream.once('error', function (err) { - if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { - h2State.streams -= 1 - util.destroy(stream, err) - } - }) + // create PRIMEINC algorithm state + var rval; + if(algorithm === 'PRIMEINC') { + rval = { + algorithm: algorithm, + state: 0, + bits: bits, + rng: rng, + eInt: e || 65537, + e: new BigInteger(null), + p: null, + q: null, + qBits: bits >> 1, + pBits: bits - (bits >> 1), + pqState: 0, + num: null, + keys: null + }; + rval.e.fromInt(rval.eInt); + } else { + throw new Error('Invalid key generation algorithm: ' + algorithm); + } - stream.once('frameError', (type, code) => { - const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`) - errorRequest(client, request, err) + return rval; +}; - if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { - h2State.streams -= 1 - util.destroy(stream, err) - } - }) +/** + * Attempts to runs the key-generation algorithm for at most n seconds + * (approximately) using the given state. When key-generation has completed, + * the keys will be stored in state.keys. + * + * To use this function to update a UI while generating a key or to prevent + * causing browser lockups/warnings, set "n" to a value other than 0. A + * simple pattern for generating a key and showing a progress indicator is: + * + * var state = pki.rsa.createKeyPairGenerationState(2048); + * var step = function() { + * // step key-generation, run algorithm for 100 ms, repeat + * if(!forge.pki.rsa.stepKeyPairGenerationState(state, 100)) { + * setTimeout(step, 1); + * } else { + * // key-generation complete + * // TODO: turn off progress indicator here + * // TODO: use the generated key-pair in "state.keys" + * } + * }; + * // TODO: turn on progress indicator here + * setTimeout(step, 0); + * + * @param state the state to use. + * @param n the maximum number of milliseconds to run the algorithm for, 0 + * to run the algorithm to completion. + * + * @return true if the key-generation completed, false if not. + */ +pki.rsa.stepKeyPairGenerationState = function(state, n) { + // set default algorithm if not set + if(!('algorithm' in state)) { + state.algorithm = 'PRIMEINC'; + } - // stream.on('aborted', () => { - // // TODO(HTTP/2): Support aborted - // }) + // TODO: migrate step-based prime generation code to forge.prime + // TODO: abstract as PRIMEINC algorithm - // stream.on('timeout', () => { - // // TODO(HTTP/2): Support timeout - // }) + // do key generation (based on Tom Wu's rsa.js, see jsbn.js license) + // with some minor optimizations and designed to run in steps - // stream.on('push', headers => { - // // TODO(HTTP/2): Suppor push - // }) + // local state vars + var THIRTY = new BigInteger(null); + THIRTY.fromInt(30); + var deltaIdx = 0; + var op_or = function(x, y) {return x | y;}; - // stream.on('trailers', headers => { - // // TODO(HTTP/2): Support trailers - // }) + // keep stepping until time limit is reached or done + var t1 = +new Date(); + var t2; + var total = 0; + while(state.keys === null && (n <= 0 || total < n)) { + // generate p or q + if(state.state === 0) { + /* Note: All primes are of the form: - return true + 30k+i, for i < 30 and gcd(30, i)=1, where there are 8 values for i - function writeBodyH2 () { - /* istanbul ignore else: assertion */ - if (!body) { - request.onRequestSent() - } else if (util.isBuffer(body)) { - assert(contentLength === body.byteLength, 'buffer body must have content length') - stream.cork() - stream.write(body) - stream.uncork() - stream.end() - request.onBodySent(body) - request.onRequestSent() - } else if (util.isBlobLike(body)) { - if (typeof body.stream === 'function') { - writeIterable({ - client, - request, - contentLength, - h2stream: stream, - expectsPayload, - body: body.stream(), - socket: client[kSocket], - header: '' - }) - } else { - writeBlob({ - body, - client, - request, - contentLength, - expectsPayload, - h2stream: stream, - header: '', - socket: client[kSocket] - }) - } - } else if (util.isStream(body)) { - writeStream({ - body, - client, - request, - contentLength, - expectsPayload, - socket: client[kSocket], - h2stream: stream, - header: '' - }) - } else if (util.isIterable(body)) { - writeIterable({ - body, - client, - request, - contentLength, - expectsPayload, - header: '', - h2stream: stream, - socket: client[kSocket] - }) - } else { - assert(false) - } - } -} + When we generate a random number, we always align it at 30k + 1. Each + time the number is determined not to be prime we add to get to the + next 'i', eg: if the number was at 30k + 1 we add 6. */ + var bits = (state.p === null) ? state.pBits : state.qBits; + var bits1 = bits - 1; -function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { - assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined') + // get a random number + if(state.pqState === 0) { + state.num = new BigInteger(bits, state.rng); + // force MSB set + if(!state.num.testBit(bits1)) { + state.num.bitwiseTo( + BigInteger.ONE.shiftLeft(bits1), op_or, state.num); + } + // align number on 30k+1 boundary + state.num.dAddOffset(31 - state.num.mod(THIRTY).byteValue(), 0); + deltaIdx = 0; - if (client[kHTTPConnVersion] === 'h2') { - // For HTTP/2, is enough to pipe the stream - const pipe = pipeline( - body, - h2stream, - (err) => { - if (err) { - util.destroy(body, err) - util.destroy(h2stream, err) + ++state.pqState; + } else if(state.pqState === 1) { + // try to make the number a prime + if(state.num.bitLength() > bits) { + // overflow, try again + state.pqState = 0; + // do primality test + } else if(state.num.isProbablePrime( + _getMillerRabinTests(state.num.bitLength()))) { + ++state.pqState; } else { - request.onRequestSent() + // get next potential prime + state.num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0); + } + } else if(state.pqState === 2) { + // ensure number is coprime with e + state.pqState = + (state.num.subtract(BigInteger.ONE).gcd(state.e) + .compareTo(BigInteger.ONE) === 0) ? 3 : 0; + } else if(state.pqState === 3) { + // store p or q + state.pqState = 0; + if(state.p === null) { + state.p = state.num; + } else { + state.q = state.num; } - } - ) - pipe.on('data', onPipeData) - pipe.once('end', () => { - pipe.removeListener('data', onPipeData) - util.destroy(pipe) - }) + // advance state if both p and q are ready + if(state.p !== null && state.q !== null) { + ++state.state; + } + state.num = null; + } + } else if(state.state === 1) { + // ensure p is larger than q (swap them if not) + if(state.p.compareTo(state.q) < 0) { + state.num = state.p; + state.p = state.q; + state.q = state.num; + } + ++state.state; + } else if(state.state === 2) { + // compute phi: (p - 1)(q - 1) (Euler's totient function) + state.p1 = state.p.subtract(BigInteger.ONE); + state.q1 = state.q.subtract(BigInteger.ONE); + state.phi = state.p1.multiply(state.q1); + ++state.state; + } else if(state.state === 3) { + // ensure e and phi are coprime + if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) === 0) { + // phi and e are coprime, advance + ++state.state; + } else { + // phi and e aren't coprime, so generate a new p and q + state.p = null; + state.q = null; + state.state = 0; + } + } else if(state.state === 4) { + // create n, ensure n is has the right number of bits + state.n = state.p.multiply(state.q); - function onPipeData (chunk) { - request.onBodySent(chunk) + // ensure n is right number of bits + if(state.n.bitLength() === state.bits) { + // success, advance + ++state.state; + } else { + // failed, get new q + state.q = null; + state.state = 0; + } + } else if(state.state === 5) { + // set keys + var d = state.e.modInverse(state.phi); + state.keys = { + privateKey: pki.rsa.setPrivateKey( + state.n, state.e, d, state.p, state.q, + d.mod(state.p1), d.mod(state.q1), + state.q.modInverse(state.p)), + publicKey: pki.rsa.setPublicKey(state.n, state.e) + }; } - return + // update timing + t2 = +new Date(); + total += t2 - t1; + t1 = t2; } - let finished = false - - const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header }) + return state.keys !== null; +}; - const onData = function (chunk) { - if (finished) { - return +/** + * Generates an RSA public-private key pair in a single call. + * + * To generate a key-pair in steps (to allow for progress updates and to + * prevent blocking or warnings in slow browsers) then use the key-pair + * generation state functions. + * + * To generate a key-pair asynchronously (either through web-workers, if + * available, or by breaking up the work on the main thread), pass a + * callback function. + * + * @param [bits] the size for the private key in bits, defaults to 2048. + * @param [e] the public exponent to use, defaults to 65537. + * @param [options] options for key-pair generation, if given then 'bits' + * and 'e' must *not* be given: + * bits the size for the private key in bits, (default: 2048). + * e the public exponent to use, (default: 65537 (0x10001)). + * workerScript the worker script URL. + * workers the number of web workers (if supported) to use, + * (default: 2). + * workLoad the size of the work load, ie: number of possible prime + * numbers for each web worker to check per work assignment, + * (default: 100). + * prng a custom crypto-secure pseudo-random number generator to use, + * that must define "getBytesSync". Disables use of native APIs. + * algorithm the algorithm to use (default: 'PRIMEINC'). + * @param [callback(err, keypair)] called once the operation completes. + * + * @return an object with privateKey and publicKey properties. + */ +pki.rsa.generateKeyPair = function(bits, e, options, callback) { + // (bits), (options), (callback) + if(arguments.length === 1) { + if(typeof bits === 'object') { + options = bits; + bits = undefined; + } else if(typeof bits === 'function') { + callback = bits; + bits = undefined; } - - try { - if (!writer.write(chunk) && this.pause) { - this.pause() + } else if(arguments.length === 2) { + // (bits, e), (bits, options), (bits, callback), (options, callback) + if(typeof bits === 'number') { + if(typeof e === 'function') { + callback = e; + e = undefined; + } else if(typeof e !== 'number') { + options = e; + e = undefined; } - } catch (err) { - util.destroy(this, err) - } - } - const onDrain = function () { - if (finished) { - return + } else { + options = bits; + callback = e; + bits = undefined; + e = undefined; } - - if (body.resume) { - body.resume() + } else if(arguments.length === 3) { + // (bits, e, options), (bits, e, callback), (bits, options, callback) + if(typeof e === 'number') { + if(typeof options === 'function') { + callback = options; + options = undefined; + } + } else { + callback = options; + options = e; + e = undefined; } } - const onAbort = function () { - if (finished) { - return - } - const err = new RequestAbortedError() - queueMicrotask(() => onFinished(err)) + options = options || {}; + if(bits === undefined) { + bits = options.bits || 2048; + } + if(e === undefined) { + e = options.e || 0x10001; } - const onFinished = function (err) { - if (finished) { - return - } - - finished = true - - assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1)) - - socket - .off('drain', onDrain) - .off('error', onFinished) - - body - .removeListener('data', onData) - .removeListener('end', onFinished) - .removeListener('error', onFinished) - .removeListener('close', onAbort) - if (!err) { - try { - writer.end() - } catch (er) { - err = er + // use native code if permitted, available, and parameters are acceptable + if(!forge.options.usePureJavaScript && !options.prng && + bits >= 256 && bits <= 16384 && (e === 0x10001 || e === 3)) { + if(callback) { + // try native async + if(_detectNodeCrypto('generateKeyPair')) { + return _crypto.generateKeyPair('rsa', { + modulusLength: bits, + publicExponent: e, + publicKeyEncoding: { + type: 'spki', + format: 'pem' + }, + privateKeyEncoding: { + type: 'pkcs8', + format: 'pem' + } + }, function(err, pub, priv) { + if(err) { + return callback(err); + } + callback(null, { + privateKey: pki.privateKeyFromPem(priv), + publicKey: pki.publicKeyFromPem(pub) + }); + }); + } + if(_detectSubtleCrypto('generateKey') && + _detectSubtleCrypto('exportKey')) { + // use standard native generateKey + return util.globalScope.crypto.subtle.generateKey({ + name: 'RSASSA-PKCS1-v1_5', + modulusLength: bits, + publicExponent: _intToUint8Array(e), + hash: {name: 'SHA-256'} + }, true /* key can be exported*/, ['sign', 'verify']) + .then(function(pair) { + return util.globalScope.crypto.subtle.exportKey( + 'pkcs8', pair.privateKey); + // avoiding catch(function(err) {...}) to support IE <= 8 + }).then(undefined, function(err) { + callback(err); + }).then(function(pkcs8) { + if(pkcs8) { + var privateKey = pki.privateKeyFromAsn1( + asn1.fromDer(forge.util.createBuffer(pkcs8))); + callback(null, { + privateKey: privateKey, + publicKey: pki.setRsaPublicKey(privateKey.n, privateKey.e) + }); + } + }); + } + if(_detectSubtleMsCrypto('generateKey') && + _detectSubtleMsCrypto('exportKey')) { + var genOp = util.globalScope.msCrypto.subtle.generateKey({ + name: 'RSASSA-PKCS1-v1_5', + modulusLength: bits, + publicExponent: _intToUint8Array(e), + hash: {name: 'SHA-256'} + }, true /* key can be exported*/, ['sign', 'verify']); + genOp.oncomplete = function(e) { + var pair = e.target.result; + var exportOp = util.globalScope.msCrypto.subtle.exportKey( + 'pkcs8', pair.privateKey); + exportOp.oncomplete = function(e) { + var pkcs8 = e.target.result; + var privateKey = pki.privateKeyFromAsn1( + asn1.fromDer(forge.util.createBuffer(pkcs8))); + callback(null, { + privateKey: privateKey, + publicKey: pki.setRsaPublicKey(privateKey.n, privateKey.e) + }); + }; + exportOp.onerror = function(err) { + callback(err); + }; + }; + genOp.onerror = function(err) { + callback(err); + }; + return; } - } - - writer.destroy(err) - - if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) { - util.destroy(body, err) } else { - util.destroy(body) + // try native sync + if(_detectNodeCrypto('generateKeyPairSync')) { + var keypair = _crypto.generateKeyPairSync('rsa', { + modulusLength: bits, + publicExponent: e, + publicKeyEncoding: { + type: 'spki', + format: 'pem' + }, + privateKeyEncoding: { + type: 'pkcs8', + format: 'pem' + } + }); + return { + privateKey: pki.privateKeyFromPem(keypair.privateKey), + publicKey: pki.publicKeyFromPem(keypair.publicKey) + }; + } } } - body - .on('data', onData) - .on('end', onFinished) - .on('error', onFinished) - .on('close', onAbort) - - if (body.resume) { - body.resume() + // use JavaScript implementation + var state = pki.rsa.createKeyPairGenerationState(bits, e, options); + if(!callback) { + pki.rsa.stepKeyPairGenerationState(state, 0); + return state.keys; } + _generateKeyPair(state, options, callback); +}; - socket - .on('drain', onDrain) - .on('error', onFinished) -} +/** + * Sets an RSA public key from BigIntegers modulus and exponent. + * + * @param n the modulus. + * @param e the exponent. + * + * @return the public key. + */ +pki.setRsaPublicKey = pki.rsa.setPublicKey = function(n, e) { + var key = { + n: n, + e: e + }; -async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { - assert(contentLength === body.size, 'blob body must have content length') + /** + * Encrypts the given data with this public key. Newer applications + * should use the 'RSA-OAEP' decryption scheme, 'RSAES-PKCS1-V1_5' is for + * legacy applications. + * + * @param data the byte string to encrypt. + * @param scheme the encryption scheme to use: + * 'RSAES-PKCS1-V1_5' (default), + * 'RSA-OAEP', + * 'RAW', 'NONE', or null to perform raw RSA encryption, + * an object with an 'encode' property set to a function + * with the signature 'function(data, key)' that returns + * a binary-encoded string representing the encoded data. + * @param schemeOptions any scheme-specific options. + * + * @return the encrypted byte string. + */ + key.encrypt = function(data, scheme, schemeOptions) { + if(typeof scheme === 'string') { + scheme = scheme.toUpperCase(); + } else if(scheme === undefined) { + scheme = 'RSAES-PKCS1-V1_5'; + } - const isH2 = client[kHTTPConnVersion] === 'h2' - try { - if (contentLength != null && contentLength !== body.size) { - throw new RequestContentLengthMismatchError() + if(scheme === 'RSAES-PKCS1-V1_5') { + scheme = { + encode: function(m, key, pub) { + return _encodePkcs1_v1_5(m, key, 0x02).getBytes(); + } + }; + } else if(scheme === 'RSA-OAEP' || scheme === 'RSAES-OAEP') { + scheme = { + encode: function(m, key) { + return forge.pkcs1.encode_rsa_oaep(key, m, schemeOptions); + } + }; + } else if(['RAW', 'NONE', 'NULL', null].indexOf(scheme) !== -1) { + scheme = {encode: function(e) {return e;}}; + } else if(typeof scheme === 'string') { + throw new Error('Unsupported encryption scheme: "' + scheme + '".'); } - const buffer = Buffer.from(await body.arrayBuffer()) + // do scheme-based encoding then rsa encryption + var e = scheme.encode(data, key, true); + return pki.rsa.encrypt(e, key, true); + }; - if (isH2) { - h2stream.cork() - h2stream.write(buffer) - h2stream.uncork() - } else { - socket.cork() - socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') - socket.write(buffer) - socket.uncork() + /** + * Verifies the given signature against the given digest. + * + * PKCS#1 supports multiple (currently two) signature schemes: + * RSASSA-PKCS1-V1_5 and RSASSA-PSS. + * + * By default this implementation uses the "old scheme", i.e. + * RSASSA-PKCS1-V1_5, in which case once RSA-decrypted, the + * signature is an OCTET STRING that holds a DigestInfo. + * + * DigestInfo ::= SEQUENCE { + * digestAlgorithm DigestAlgorithmIdentifier, + * digest Digest + * } + * DigestAlgorithmIdentifier ::= AlgorithmIdentifier + * Digest ::= OCTET STRING + * + * To perform PSS signature verification, provide an instance + * of Forge PSS object as the scheme parameter. + * + * @param digest the message digest hash to compare against the signature, + * as a binary-encoded string. + * @param signature the signature to verify, as a binary-encoded string. + * @param scheme signature verification scheme to use: + * 'RSASSA-PKCS1-V1_5' or undefined for RSASSA PKCS#1 v1.5, + * a Forge PSS object for RSASSA-PSS, + * 'NONE' or null for none, DigestInfo will not be expected, but + * PKCS#1 v1.5 padding will still be used. + * + * @return true if the signature was verified, false if not. + */ + key.verify = function(digest, signature, scheme) { + if(typeof scheme === 'string') { + scheme = scheme.toUpperCase(); + } else if(scheme === undefined) { + scheme = 'RSASSA-PKCS1-V1_5'; } - request.onBodySent(buffer) - request.onRequestSent() - - if (!expectsPayload) { - socket[kReset] = true + if(scheme === 'RSASSA-PKCS1-V1_5') { + scheme = { + verify: function(digest, d) { + // remove padding + d = _decodePkcs1_v1_5(d, key, true); + // d is ASN.1 BER-encoded DigestInfo + var obj = asn1.fromDer(d); + // compare the given digest to the decrypted one + return digest === obj.value[1].value; + } + }; + } else if(scheme === 'NONE' || scheme === 'NULL' || scheme === null) { + scheme = { + verify: function(digest, d) { + // remove padding + d = _decodePkcs1_v1_5(d, key, true); + return digest === d; + } + }; } - resume(client) - } catch (err) { - util.destroy(isH2 ? h2stream : socket, err) - } -} + // do rsa decryption w/o any decoding, then verify -- which does decoding + var d = pki.rsa.decrypt(signature, key, true, false); + return scheme.verify(digest, d, key.n.bitLength()); + }; -async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { - assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined') + return key; +}; - let callback = null - function onDrain () { - if (callback) { - const cb = callback - callback = null - cb() +/** + * Sets an RSA private key from BigIntegers modulus, exponent, primes, + * prime exponents, and modular multiplicative inverse. + * + * @param n the modulus. + * @param e the public exponent. + * @param d the private exponent ((inverse of e) mod n). + * @param p the first prime. + * @param q the second prime. + * @param dP exponent1 (d mod (p-1)). + * @param dQ exponent2 (d mod (q-1)). + * @param qInv ((inverse of q) mod p) + * + * @return the private key. + */ +pki.setRsaPrivateKey = pki.rsa.setPrivateKey = function( + n, e, d, p, q, dP, dQ, qInv) { + var key = { + n: n, + e: e, + d: d, + p: p, + q: q, + dP: dP, + dQ: dQ, + qInv: qInv + }; + + /** + * Decrypts the given data with this private key. The decryption scheme + * must match the one used to encrypt the data. + * + * @param data the byte string to decrypt. + * @param scheme the decryption scheme to use: + * 'RSAES-PKCS1-V1_5' (default), + * 'RSA-OAEP', + * 'RAW', 'NONE', or null to perform raw RSA decryption. + * @param schemeOptions any scheme-specific options. + * + * @return the decrypted byte string. + */ + key.decrypt = function(data, scheme, schemeOptions) { + if(typeof scheme === 'string') { + scheme = scheme.toUpperCase(); + } else if(scheme === undefined) { + scheme = 'RSAES-PKCS1-V1_5'; } - } - const waitForDrain = () => new Promise((resolve, reject) => { - assert(callback === null) + // do rsa decryption w/o any decoding + var d = pki.rsa.decrypt(data, key, false, false); - if (socket[kError]) { - reject(socket[kError]) + if(scheme === 'RSAES-PKCS1-V1_5') { + scheme = {decode: _decodePkcs1_v1_5}; + } else if(scheme === 'RSA-OAEP' || scheme === 'RSAES-OAEP') { + scheme = { + decode: function(d, key) { + return forge.pkcs1.decode_rsa_oaep(key, d, schemeOptions); + } + }; + } else if(['RAW', 'NONE', 'NULL', null].indexOf(scheme) !== -1) { + scheme = {decode: function(d) {return d;}}; } else { - callback = resolve + throw new Error('Unsupported encryption scheme: "' + scheme + '".'); } - }) - if (client[kHTTPConnVersion] === 'h2') { - h2stream - .on('close', onDrain) - .on('drain', onDrain) + // decode according to scheme + return scheme.decode(d, key, false); + }; - try { - // It's up to the user to somehow abort the async iterable. - for await (const chunk of body) { - if (socket[kError]) { - throw socket[kError] - } + /** + * Signs the given digest, producing a signature. + * + * PKCS#1 supports multiple (currently two) signature schemes: + * RSASSA-PKCS1-V1_5 and RSASSA-PSS. + * + * By default this implementation uses the "old scheme", i.e. + * RSASSA-PKCS1-V1_5. In order to generate a PSS signature, provide + * an instance of Forge PSS object as the scheme parameter. + * + * @param md the message digest object with the hash to sign. + * @param scheme the signature scheme to use: + * 'RSASSA-PKCS1-V1_5' or undefined for RSASSA PKCS#1 v1.5, + * a Forge PSS object for RSASSA-PSS, + * 'NONE' or null for none, DigestInfo will not be used but + * PKCS#1 v1.5 padding will still be used. + * + * @return the signature as a byte string. + */ + key.sign = function(md, scheme) { + /* Note: The internal implementation of RSA operations is being + transitioned away from a PKCS#1 v1.5 hard-coded scheme. Some legacy + code like the use of an encoding block identifier 'bt' will eventually + be removed. */ - const res = h2stream.write(chunk) - request.onBodySent(chunk) - if (!res) { - await waitForDrain() - } - } - } catch (err) { - h2stream.destroy(err) - } finally { - request.onRequestSent() - h2stream.end() - h2stream - .off('close', onDrain) - .off('drain', onDrain) + // private key operation + var bt = false; + + if(typeof scheme === 'string') { + scheme = scheme.toUpperCase(); } - return - } + if(scheme === undefined || scheme === 'RSASSA-PKCS1-V1_5') { + scheme = {encode: emsaPkcs1v15encode}; + bt = 0x01; + } else if(scheme === 'NONE' || scheme === 'NULL' || scheme === null) { + scheme = {encode: function() {return md;}}; + bt = 0x01; + } - socket - .on('close', onDrain) - .on('drain', onDrain) + // encode and then encrypt + var d = scheme.encode(md, key.n.bitLength()); + return pki.rsa.encrypt(d, key, bt); + }; - const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header }) - try { - // It's up to the user to somehow abort the async iterable. - for await (const chunk of body) { - if (socket[kError]) { - throw socket[kError] - } + return key; +}; - if (!writer.write(chunk)) { - await waitForDrain() - } - } +/** + * Wraps an RSAPrivateKey ASN.1 object in an ASN.1 PrivateKeyInfo object. + * + * @param rsaKey the ASN.1 RSAPrivateKey. + * + * @return the ASN.1 PrivateKeyInfo. + */ +pki.wrapRsaPrivateKey = function(rsaKey) { + // PrivateKeyInfo + return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ + // version (0) + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, + asn1.integerToDer(0).getBytes()), + // privateKeyAlgorithm + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ + asn1.create( + asn1.Class.UNIVERSAL, asn1.Type.OID, false, + asn1.oidToDer(pki.oids.rsaEncryption).getBytes()), + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') + ]), + // PrivateKey + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, + asn1.toDer(rsaKey).getBytes()) + ]); +}; - writer.end() - } catch (err) { - writer.destroy(err) - } finally { - socket - .off('close', onDrain) - .off('drain', onDrain) +/** + * Converts a private key from an ASN.1 object. + * + * @param obj the ASN.1 representation of a PrivateKeyInfo containing an + * RSAPrivateKey or an RSAPrivateKey. + * + * @return the private key. + */ +pki.privateKeyFromAsn1 = function(obj) { + // get PrivateKeyInfo + var capture = {}; + var errors = []; + if(asn1.validate(obj, privateKeyValidator, capture, errors)) { + obj = asn1.fromDer(forge.util.createBuffer(capture.privateKey)); } -} - -class AsyncWriter { - constructor ({ socket, request, contentLength, client, expectsPayload, header }) { - this.socket = socket - this.request = request - this.contentLength = contentLength - this.client = client - this.bytesWritten = 0 - this.expectsPayload = expectsPayload - this.header = header - socket[kWriting] = true + // get RSAPrivateKey + capture = {}; + errors = []; + if(!asn1.validate(obj, rsaPrivateKeyValidator, capture, errors)) { + var error = new Error('Cannot read private key. ' + + 'ASN.1 object does not contain an RSAPrivateKey.'); + error.errors = errors; + throw error; } - write (chunk) { - const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this + // Note: Version is currently ignored. + // capture.privateKeyVersion + // FIXME: inefficient, get a BigInteger that uses byte strings + var n, e, d, p, q, dP, dQ, qInv; + n = forge.util.createBuffer(capture.privateKeyModulus).toHex(); + e = forge.util.createBuffer(capture.privateKeyPublicExponent).toHex(); + d = forge.util.createBuffer(capture.privateKeyPrivateExponent).toHex(); + p = forge.util.createBuffer(capture.privateKeyPrime1).toHex(); + q = forge.util.createBuffer(capture.privateKeyPrime2).toHex(); + dP = forge.util.createBuffer(capture.privateKeyExponent1).toHex(); + dQ = forge.util.createBuffer(capture.privateKeyExponent2).toHex(); + qInv = forge.util.createBuffer(capture.privateKeyCoefficient).toHex(); - if (socket[kError]) { - throw socket[kError] - } + // set private key + return pki.setRsaPrivateKey( + new BigInteger(n, 16), + new BigInteger(e, 16), + new BigInteger(d, 16), + new BigInteger(p, 16), + new BigInteger(q, 16), + new BigInteger(dP, 16), + new BigInteger(dQ, 16), + new BigInteger(qInv, 16)); +}; - if (socket.destroyed) { - return false - } +/** + * Converts a private key to an ASN.1 RSAPrivateKey. + * + * @param key the private key. + * + * @return the ASN.1 representation of an RSAPrivateKey. + */ +pki.privateKeyToAsn1 = pki.privateKeyToRSAPrivateKey = function(key) { + // RSAPrivateKey + return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ + // version (0 = only 2 primes, 1 multiple primes) + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, + asn1.integerToDer(0).getBytes()), + // modulus (n) + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, + _bnToBytes(key.n)), + // publicExponent (e) + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, + _bnToBytes(key.e)), + // privateExponent (d) + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, + _bnToBytes(key.d)), + // privateKeyPrime1 (p) + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, + _bnToBytes(key.p)), + // privateKeyPrime2 (q) + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, + _bnToBytes(key.q)), + // privateKeyExponent1 (dP) + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, + _bnToBytes(key.dP)), + // privateKeyExponent2 (dQ) + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, + _bnToBytes(key.dQ)), + // coefficient (qInv) + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, + _bnToBytes(key.qInv)) + ]); +}; - const len = Buffer.byteLength(chunk) - if (!len) { - return true +/** + * Converts a public key from an ASN.1 SubjectPublicKeyInfo or RSAPublicKey. + * + * @param obj the asn1 representation of a SubjectPublicKeyInfo or RSAPublicKey. + * + * @return the public key. + */ +pki.publicKeyFromAsn1 = function(obj) { + // get SubjectPublicKeyInfo + var capture = {}; + var errors = []; + if(asn1.validate(obj, publicKeyValidator, capture, errors)) { + // get oid + var oid = asn1.derToOid(capture.publicKeyOid); + if(oid !== pki.oids.rsaEncryption) { + var error = new Error('Cannot read public key. Unknown OID.'); + error.oid = oid; + throw error; } + obj = capture.rsaPublicKey; + } - // We should defer writing chunks. - if (contentLength !== null && bytesWritten + len > contentLength) { - if (client[kStrictContentLength]) { - throw new RequestContentLengthMismatchError() - } + // get RSA params + errors = []; + if(!asn1.validate(obj, rsaPublicKeyValidator, capture, errors)) { + var error = new Error('Cannot read public key. ' + + 'ASN.1 object does not contain an RSAPublicKey.'); + error.errors = errors; + throw error; + } + + // FIXME: inefficient, get a BigInteger that uses byte strings + var n = forge.util.createBuffer(capture.publicKeyModulus).toHex(); + var e = forge.util.createBuffer(capture.publicKeyExponent).toHex(); + + // set public key + return pki.setRsaPublicKey( + new BigInteger(n, 16), + new BigInteger(e, 16)); +}; + +/** + * Converts a public key to an ASN.1 SubjectPublicKeyInfo. + * + * @param key the public key. + * + * @return the asn1 representation of a SubjectPublicKeyInfo. + */ +pki.publicKeyToAsn1 = pki.publicKeyToSubjectPublicKeyInfo = function(key) { + // SubjectPublicKeyInfo + return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ + // AlgorithmIdentifier + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ + // algorithm + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, + asn1.oidToDer(pki.oids.rsaEncryption).getBytes()), + // parameters (null) + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') + ]), + // subjectPublicKey + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, [ + pki.publicKeyToRSAPublicKey(key) + ]) + ]); +}; - process.emitWarning(new RequestContentLengthMismatchError()) - } +/** + * Converts a public key to an ASN.1 RSAPublicKey. + * + * @param key the public key. + * + * @return the asn1 representation of a RSAPublicKey. + */ +pki.publicKeyToRSAPublicKey = function(key) { + // RSAPublicKey + return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ + // modulus (n) + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, + _bnToBytes(key.n)), + // publicExponent (e) + asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, + _bnToBytes(key.e)) + ]); +}; - socket.cork() +/** + * Encodes a message using PKCS#1 v1.5 padding. + * + * @param m the message to encode. + * @param key the RSA key to use. + * @param bt the block type to use, i.e. either 0x01 (for signing) or 0x02 + * (for encryption). + * + * @return the padded byte buffer. + */ +function _encodePkcs1_v1_5(m, key, bt) { + var eb = forge.util.createBuffer(); - if (bytesWritten === 0) { - if (!expectsPayload) { - socket[kReset] = true - } + // get the length of the modulus in bytes + var k = Math.ceil(key.n.bitLength() / 8); - if (contentLength === null) { - socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1') - } else { - socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') - } - } + /* use PKCS#1 v1.5 padding */ + if(m.length > (k - 11)) { + var error = new Error('Message is too long for PKCS#1 v1.5 padding.'); + error.length = m.length; + error.max = k - 11; + throw error; + } - if (contentLength === null) { - socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1') - } + /* A block type BT, a padding string PS, and the data D shall be + formatted into an octet string EB, the encryption block: - this.bytesWritten += len + EB = 00 || BT || PS || 00 || D - const ret = socket.write(chunk) + The block type BT shall be a single octet indicating the structure of + the encryption block. For this version of the document it shall have + value 00, 01, or 02. For a private-key operation, the block type + shall be 00 or 01. For a public-key operation, it shall be 02. - socket.uncork() + The padding string PS shall consist of k-3-||D|| octets. For block + type 00, the octets shall have value 00; for block type 01, they + shall have value FF; and for block type 02, they shall be + pseudorandomly generated and nonzero. This makes the length of the + encryption block EB equal to k. */ - request.onBodySent(chunk) + // build the encryption block + eb.putByte(0x00); + eb.putByte(bt); - if (!ret) { - if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { - // istanbul ignore else: only for jest - if (socket[kParser].timeout.refresh) { - socket[kParser].timeout.refresh() + // create the padding + var padNum = k - 3 - m.length; + var padByte; + // private key op + if(bt === 0x00 || bt === 0x01) { + padByte = (bt === 0x00) ? 0x00 : 0xFF; + for(var i = 0; i < padNum; ++i) { + eb.putByte(padByte); + } + } else { + // public key op + // pad with random non-zero values + while(padNum > 0) { + var numZeros = 0; + var padBytes = forge.random.getBytes(padNum); + for(var i = 0; i < padNum; ++i) { + padByte = padBytes.charCodeAt(i); + if(padByte === 0) { + ++numZeros; + } else { + eb.putByte(padByte); } } + padNum = numZeros; } - - return ret } - end () { - const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this - request.onRequestSent() + // zero followed by message + eb.putByte(0x00); + eb.putBytes(m); - socket[kWriting] = false + return eb; +} - if (socket[kError]) { - throw socket[kError] - } +/** + * Decodes a message using PKCS#1 v1.5 padding. + * + * @param em the message to decode. + * @param key the RSA key to use. + * @param pub true if the key is a public key, false if it is private. + * @param ml the message length, if specified. + * + * @return the decoded bytes. + */ +function _decodePkcs1_v1_5(em, key, pub, ml) { + // get the length of the modulus in bytes + var k = Math.ceil(key.n.bitLength() / 8); - if (socket.destroyed) { - return - } + /* It is an error if any of the following conditions occurs: - if (bytesWritten === 0) { - if (expectsPayload) { - // https://tools.ietf.org/html/rfc7230#section-3.3.2 - // A user agent SHOULD send a Content-Length in a request message when - // no Transfer-Encoding is sent and the request method defines a meaning - // for an enclosed payload body. + 1. The encryption block EB cannot be parsed unambiguously. + 2. The padding string PS consists of fewer than eight octets + or is inconsisent with the block type BT. + 3. The decryption process is a public-key operation and the block + type BT is not 00 or 01, or the decryption process is a + private-key operation and the block type is not 02. + */ - socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1') - } else { - socket.write(`${header}\r\n`, 'latin1') + // parse the encryption block + var eb = forge.util.createBuffer(em); + var first = eb.getByte(); + var bt = eb.getByte(); + if(first !== 0x00 || + (pub && bt !== 0x00 && bt !== 0x01) || + (!pub && bt != 0x02) || + (pub && bt === 0x00 && typeof(ml) === 'undefined')) { + throw new Error('Encryption block is invalid.'); + } + + var padNum = 0; + if(bt === 0x00) { + // check all padding bytes for 0x00 + padNum = k - 3 - ml; + for(var i = 0; i < padNum; ++i) { + if(eb.getByte() !== 0x00) { + throw new Error('Encryption block is invalid.'); } - } else if (contentLength === null) { - socket.write('\r\n0\r\n\r\n', 'latin1') } - - if (contentLength !== null && bytesWritten !== contentLength) { - if (client[kStrictContentLength]) { - throw new RequestContentLengthMismatchError() - } else { - process.emitWarning(new RequestContentLengthMismatchError()) + } else if(bt === 0x01) { + // find the first byte that isn't 0xFF, should be after all padding + padNum = 0; + while(eb.length() > 1) { + if(eb.getByte() !== 0xFF) { + --eb.read; + break; } + ++padNum; } - - if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { - // istanbul ignore else: only for jest - if (socket[kParser].timeout.refresh) { - socket[kParser].timeout.refresh() + } else if(bt === 0x02) { + // look for 0x00 byte + padNum = 0; + while(eb.length() > 1) { + if(eb.getByte() === 0x00) { + --eb.read; + break; } + ++padNum; } + } - resume(client) + // zero must be 0x00 and padNum must be (k - 3 - message length) + var zero = eb.getByte(); + if(zero !== 0x00 || padNum !== (k - 3 - eb.length())) { + throw new Error('Encryption block is invalid.'); } - destroy (err) { - const { socket, client } = this + return eb.getBytes(); +} - socket[kWriting] = false +/** + * Runs the key-generation algorithm asynchronously, either in the background + * via Web Workers, or using the main thread and setImmediate. + * + * @param state the key-pair generation state. + * @param [options] options for key-pair generation: + * workerScript the worker script URL. + * workers the number of web workers (if supported) to use, + * (default: 2, -1 to use estimated cores minus one). + * workLoad the size of the work load, ie: number of possible prime + * numbers for each web worker to check per work assignment, + * (default: 100). + * @param callback(err, keypair) called once the operation completes. + */ +function _generateKeyPair(state, options, callback) { + if(typeof options === 'function') { + callback = options; + options = {}; + } + options = options || {}; - if (err) { - assert(client[kRunning] <= 1, 'pipeline should only contain this request') - util.destroy(socket, err) + var opts = { + algorithm: { + name: options.algorithm || 'PRIMEINC', + options: { + workers: options.workers || 2, + workLoad: options.workLoad || 100, + workerScript: options.workerScript + } } + }; + if('prng' in options) { + opts.prng = options.prng; } -} -function errorRequest (client, request, err) { - try { - request.onError(err) - assert(request.aborted) - } catch (err) { - client.emit('error', err) + generate(); + + function generate() { + // find p and then q (done in series to simplify) + getPrime(state.pBits, function(err, num) { + if(err) { + return callback(err); + } + state.p = num; + if(state.q !== null) { + return finish(err, state.q); + } + getPrime(state.qBits, finish); + }); } -} -module.exports = Client + function getPrime(bits, callback) { + forge.prime.generateProbablePrime(bits, opts, callback); + } + function finish(err, num) { + if(err) { + return callback(err); + } -/***/ }), + // set q + state.q = num; -/***/ 71744: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // ensure p is larger than q (swap them if not) + if(state.p.compareTo(state.q) < 0) { + var tmp = state.p; + state.p = state.q; + state.q = tmp; + } + // ensure p is coprime with e + if(state.p.subtract(BigInteger.ONE).gcd(state.e) + .compareTo(BigInteger.ONE) !== 0) { + state.p = null; + generate(); + return; + } + // ensure q is coprime with e + if(state.q.subtract(BigInteger.ONE).gcd(state.e) + .compareTo(BigInteger.ONE) !== 0) { + state.q = null; + getPrime(state.qBits, finish); + return; + } -/* istanbul ignore file: only for Node 12 */ + // compute phi: (p - 1)(q - 1) (Euler's totient function) + state.p1 = state.p.subtract(BigInteger.ONE); + state.q1 = state.q.subtract(BigInteger.ONE); + state.phi = state.p1.multiply(state.q1); -const { kConnected, kSize } = __nccwpck_require__(48039) + // ensure e and phi are coprime + if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) !== 0) { + // phi and e aren't coprime, so generate a new p and q + state.p = state.q = null; + generate(); + return; + } -class CompatWeakRef { - constructor (value) { - this.value = value - } + // create n, ensure n is has the right number of bits + state.n = state.p.multiply(state.q); + if(state.n.bitLength() !== state.bits) { + // failed, get new q + state.q = null; + getPrime(state.qBits, finish); + return; + } - deref () { - return this.value[kConnected] === 0 && this.value[kSize] === 0 - ? undefined - : this.value + // set keys + var d = state.e.modInverse(state.phi); + state.keys = { + privateKey: pki.rsa.setPrivateKey( + state.n, state.e, d, state.p, state.q, + d.mod(state.p1), d.mod(state.q1), + state.q.modInverse(state.p)), + publicKey: pki.rsa.setPublicKey(state.n, state.e) + }; + + callback(null, state.keys); } } -class CompatFinalizer { - constructor (finalizer) { - this.finalizer = finalizer +/** + * Converts a positive BigInteger into 2's-complement big-endian bytes. + * + * @param b the big integer to convert. + * + * @return the bytes. + */ +function _bnToBytes(b) { + // prepend 0x00 if first byte >= 0x80 + var hex = b.toString(16); + if(hex[0] >= '8') { + hex = '00' + hex; } + var bytes = forge.util.hexToBytes(hex); - register (dispatcher, key) { - if (dispatcher.on) { - dispatcher.on('disconnect', () => { - if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) { - this.finalizer(key) - } - }) - } + // ensure integer is minimally-encoded + if(bytes.length > 1 && + // leading 0x00 for positive integer + ((bytes.charCodeAt(0) === 0 && + (bytes.charCodeAt(1) & 0x80) === 0) || + // leading 0xFF for negative integer + (bytes.charCodeAt(0) === 0xFF && + (bytes.charCodeAt(1) & 0x80) === 0x80))) { + return bytes.substr(1); } + return bytes; } -module.exports = function () { - // FIXME: remove workaround when the Node bug is fixed - // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308 - if (process.env.NODE_V8_COVERAGE) { - return { - WeakRef: CompatWeakRef, - FinalizationRegistry: CompatFinalizer - } - } - return { - WeakRef: global.WeakRef || CompatWeakRef, - FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer - } +/** + * Returns the required number of Miller-Rabin tests to generate a + * prime with an error probability of (1/2)^80. + * + * See Handbook of Applied Cryptography Chapter 4, Table 4.4. + * + * @param bits the bit size. + * + * @return the required number of iterations. + */ +function _getMillerRabinTests(bits) { + if(bits <= 100) return 27; + if(bits <= 150) return 18; + if(bits <= 200) return 15; + if(bits <= 250) return 12; + if(bits <= 300) return 9; + if(bits <= 350) return 8; + if(bits <= 400) return 7; + if(bits <= 500) return 6; + if(bits <= 600) return 5; + if(bits <= 800) return 4; + if(bits <= 1250) return 3; + return 2; } - -/***/ }), - -/***/ 84014: -/***/ ((module) => { - - - -// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size -const maxAttributeValueSize = 1024 - -// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size -const maxNameValuePairSize = 4096 - -module.exports = { - maxAttributeValueSize, - maxNameValuePairSize +/** + * Performs feature detection on the Node crypto interface. + * + * @param fn the feature (function) to detect. + * + * @return true if detected, false if not. + */ +function _detectNodeCrypto(fn) { + return forge.util.isNodejs && typeof _crypto[fn] === 'function'; } - -/***/ }), - -/***/ 15389: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - - -const { parseSetCookie } = __nccwpck_require__(32849) -const { stringify, getHeadersList } = __nccwpck_require__(30733) -const { webidl } = __nccwpck_require__(96138) -const { Headers } = __nccwpck_require__(23245) - /** - * @typedef {Object} Cookie - * @property {string} name - * @property {string} value - * @property {Date|number|undefined} expires - * @property {number|undefined} maxAge - * @property {string|undefined} domain - * @property {string|undefined} path - * @property {boolean|undefined} secure - * @property {boolean|undefined} httpOnly - * @property {'Strict'|'Lax'|'None'} sameSite - * @property {string[]} unparsed + * Performs feature detection on the SubtleCrypto interface. + * + * @param fn the feature (function) to detect. + * + * @return true if detected, false if not. */ +function _detectSubtleCrypto(fn) { + return (typeof util.globalScope !== 'undefined' && + typeof util.globalScope.crypto === 'object' && + typeof util.globalScope.crypto.subtle === 'object' && + typeof util.globalScope.crypto.subtle[fn] === 'function'); +} /** - * @param {Headers} headers - * @returns {Record} + * Performs feature detection on the deprecated Microsoft Internet Explorer + * outdated SubtleCrypto interface. This function should only be used after + * checking for the modern, standard SubtleCrypto interface. + * + * @param fn the feature (function) to detect. + * + * @return true if detected, false if not. */ -function getCookies (headers) { - webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' }) - - webidl.brandCheck(headers, Headers, { strict: false }) - - const cookie = headers.get('cookie') - const out = {} +function _detectSubtleMsCrypto(fn) { + return (typeof util.globalScope !== 'undefined' && + typeof util.globalScope.msCrypto === 'object' && + typeof util.globalScope.msCrypto.subtle === 'object' && + typeof util.globalScope.msCrypto.subtle[fn] === 'function'); +} - if (!cookie) { - return out +function _intToUint8Array(x) { + var bytes = forge.util.hexToBytes(x.toString(16)); + var buffer = new Uint8Array(bytes.length); + for(var i = 0; i < bytes.length; ++i) { + buffer[i] = bytes.charCodeAt(i); } + return buffer; +} - for (const piece of cookie.split(';')) { - const [name, ...value] = piece.split('=') - - out[name.trim()] = value.join('=') +function _privateKeyFromJwk(jwk) { + if(jwk.kty !== 'RSA') { + throw new Error( + 'Unsupported key algorithm "' + jwk.kty + '"; algorithm must be "RSA".'); } + return pki.setRsaPrivateKey( + _base64ToBigInt(jwk.n), + _base64ToBigInt(jwk.e), + _base64ToBigInt(jwk.d), + _base64ToBigInt(jwk.p), + _base64ToBigInt(jwk.q), + _base64ToBigInt(jwk.dp), + _base64ToBigInt(jwk.dq), + _base64ToBigInt(jwk.qi)); +} - return out +function _publicKeyFromJwk(jwk) { + if(jwk.kty !== 'RSA') { + throw new Error('Key algorithm must be "RSA".'); + } + return pki.setRsaPublicKey( + _base64ToBigInt(jwk.n), + _base64ToBigInt(jwk.e)); } -/** - * @param {Headers} headers - * @param {string} name - * @param {{ path?: string, domain?: string }|undefined} attributes - * @returns {void} - */ -function deleteCookie (headers, name, attributes) { - webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' }) +function _base64ToBigInt(b64) { + return new BigInteger(forge.util.bytesToHex(forge.util.decode64(b64)), 16); +} - webidl.brandCheck(headers, Headers, { strict: false }) - name = webidl.converters.DOMString(name) - attributes = webidl.converters.DeleteCookieAttributes(attributes) +/***/ }), - // Matches behavior of - // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278 - setCookie(headers, { - name, - value: '', - expires: new Date(0), - ...attributes - }) -} +/***/ 56274: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /** - * @param {Headers} headers - * @returns {Cookie[]} + * Secure Hash Algorithm with 160-bit digest (SHA-1) implementation. + * + * @author Dave Longley + * + * Copyright (c) 2010-2015 Digital Bazaar, Inc. */ -function getSetCookies (headers) { - webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' }) - - webidl.brandCheck(headers, Headers, { strict: false }) - - const cookies = getHeadersList(headers).cookies - - if (!cookies) { - return [] - } +var forge = __nccwpck_require__(56389); +__nccwpck_require__(48622); +__nccwpck_require__(65138); - // In older versions of undici, cookies is a list of name:value. - return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair)) -} +var sha1 = module.exports = forge.sha1 = forge.sha1 || {}; +forge.md.sha1 = forge.md.algorithms.sha1 = sha1; /** - * @param {Headers} headers - * @param {Cookie} cookie - * @returns {void} + * Creates a SHA-1 message digest object. + * + * @return a message digest object. */ -function setCookie (headers, cookie) { - webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' }) +sha1.create = function() { + // do initialization as necessary + if(!_initialized) { + _init(); + } - webidl.brandCheck(headers, Headers, { strict: false }) + // SHA-1 state contains five 32-bit integers + var _state = null; - cookie = webidl.converters.Cookie(cookie) + // input buffer + var _input = forge.util.createBuffer(); - const str = stringify(cookie) + // used for word storage + var _w = new Array(80); - if (str) { - headers.append('Set-Cookie', stringify(cookie)) - } -} + // message digest object + var md = { + algorithm: 'sha1', + blockLength: 64, + digestLength: 20, + // 56-bit length of message so far (does not including padding) + messageLength: 0, + // true message length + fullMessageLength: null, + // size of message length in bytes + messageLengthSize: 8 + }; -webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([ - { - converter: webidl.nullableConverter(webidl.converters.DOMString), - key: 'path', - defaultValue: null - }, - { - converter: webidl.nullableConverter(webidl.converters.DOMString), - key: 'domain', - defaultValue: null - } -]) + /** + * Starts the digest. + * + * @return this digest object. + */ + md.start = function() { + // up to 56-bit message length for convenience + md.messageLength = 0; -webidl.converters.Cookie = webidl.dictionaryConverter([ - { - converter: webidl.converters.DOMString, - key: 'name' - }, - { - converter: webidl.converters.DOMString, - key: 'value' - }, - { - converter: webidl.nullableConverter((value) => { - if (typeof value === 'number') { - return webidl.converters['unsigned long long'](value) - } + // full message length (set md.messageLength64 for backwards-compatibility) + md.fullMessageLength = md.messageLength64 = []; + var int32s = md.messageLengthSize / 4; + for(var i = 0; i < int32s; ++i) { + md.fullMessageLength.push(0); + } + _input = forge.util.createBuffer(); + _state = { + h0: 0x67452301, + h1: 0xEFCDAB89, + h2: 0x98BADCFE, + h3: 0x10325476, + h4: 0xC3D2E1F0 + }; + return md; + }; + // start digest automatically for first time + md.start(); - return new Date(value) - }), - key: 'expires', - defaultValue: null - }, - { - converter: webidl.nullableConverter(webidl.converters['long long']), - key: 'maxAge', - defaultValue: null - }, - { - converter: webidl.nullableConverter(webidl.converters.DOMString), - key: 'domain', - defaultValue: null - }, - { - converter: webidl.nullableConverter(webidl.converters.DOMString), - key: 'path', - defaultValue: null - }, - { - converter: webidl.nullableConverter(webidl.converters.boolean), - key: 'secure', - defaultValue: null - }, - { - converter: webidl.nullableConverter(webidl.converters.boolean), - key: 'httpOnly', - defaultValue: null - }, - { - converter: webidl.converters.USVString, - key: 'sameSite', - allowedValues: ['Strict', 'Lax', 'None'] - }, - { - converter: webidl.sequenceConverter(webidl.converters.DOMString), - key: 'unparsed', - defaultValue: [] - } -]) + /** + * Updates the digest with the given message input. The given input can + * treated as raw input (no encoding will be applied) or an encoding of + * 'utf8' maybe given to encode the input using UTF-8. + * + * @param msg the message input to update with. + * @param encoding the encoding to use (default: 'raw', other: 'utf8'). + * + * @return this digest object. + */ + md.update = function(msg, encoding) { + if(encoding === 'utf8') { + msg = forge.util.encodeUtf8(msg); + } -module.exports = { - getCookies, - deleteCookie, - getSetCookies, - setCookie -} + // update message length + var len = msg.length; + md.messageLength += len; + len = [(len / 0x100000000) >>> 0, len >>> 0]; + for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { + md.fullMessageLength[i] += len[1]; + len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0); + md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; + len[0] = ((len[1] / 0x100000000) >>> 0); + } + // add bytes to input buffer + _input.putBytes(msg); -/***/ }), + // process bytes + _update(_state, _w, _input); -/***/ 32849: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // compact input buffer every 2K or if empty + if(_input.read > 2048 || _input.length() === 0) { + _input.compact(); + } + return md; + }; + /** + * Produces the digest. + * + * @return a byte buffer containing the digest value. + */ + md.digest = function() { + /* Note: Here we copy the remaining bytes in the input buffer and + add the appropriate SHA-1 padding. Then we do the final update + on a copy of the state so that if the user wants to get + intermediate digests they can do so. */ -const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(84014) -const { isCTLExcludingHtab } = __nccwpck_require__(30733) -const { collectASequenceOfCodePointsFast } = __nccwpck_require__(50096) -const assert = __nccwpck_require__(39491) + /* Determine the number of bytes that must be added to the message + to ensure its length is congruent to 448 mod 512. In other words, + the data to be digested must be a multiple of 512 bits (or 128 bytes). + This data includes the message, some padding, and the length of the + message. Since the length of the message will be encoded as 8 bytes (64 + bits), that means that the last segment of the data must have 56 bytes + (448 bits) of message and padding. Therefore, the length of the message + plus the padding must be congruent to 448 mod 512 because + 512 - 128 = 448. -/** - * @description Parses the field-value attributes of a set-cookie header string. - * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4 - * @param {string} header - * @returns if the header is invalid, null will be returned - */ -function parseSetCookie (header) { - // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F - // character (CTL characters excluding HTAB): Abort these steps and - // ignore the set-cookie-string entirely. - if (isCTLExcludingHtab(header)) { - return null - } + In order to fill up the message length it must be filled with + padding that begins with 1 bit followed by all 0 bits. Padding + must *always* be present, so if the message length is already + congruent to 448 mod 512, then 512 padding bits must be added. */ - let nameValuePair = '' - let unparsedAttributes = '' - let name = '' - let value = '' + var finalBlock = forge.util.createBuffer(); + finalBlock.putBytes(_input.bytes()); - // 2. If the set-cookie-string contains a %x3B (";") character: - if (header.includes(';')) { - // 1. The name-value-pair string consists of the characters up to, - // but not including, the first %x3B (";"), and the unparsed- - // attributes consist of the remainder of the set-cookie-string - // (including the %x3B (";") in question). - const position = { position: 0 } + // compute remaining size to be digested (include message length size) + var remaining = ( + md.fullMessageLength[md.fullMessageLength.length - 1] + + md.messageLengthSize); - nameValuePair = collectASequenceOfCodePointsFast(';', header, position) - unparsedAttributes = header.slice(position.position) - } else { - // Otherwise: + // add padding for overflow blockSize - overflow + // _padding starts with 1 byte with first bit is set (byte value 128), then + // there may be up to (blockSize - 1) other pad bytes + var overflow = remaining & (md.blockLength - 1); + finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); - // 1. The name-value-pair string consists of all the characters - // contained in the set-cookie-string, and the unparsed- - // attributes is the empty string. - nameValuePair = header - } + // serialize message length in bits in big-endian order; since length + // is stored in bytes we multiply by 8 and add carry from next int + var next, carry; + var bits = md.fullMessageLength[0] * 8; + for(var i = 0; i < md.fullMessageLength.length - 1; ++i) { + next = md.fullMessageLength[i + 1] * 8; + carry = (next / 0x100000000) >>> 0; + bits += carry; + finalBlock.putInt32(bits >>> 0); + bits = next >>> 0; + } + finalBlock.putInt32(bits); - // 3. If the name-value-pair string lacks a %x3D ("=") character, then - // the name string is empty, and the value string is the value of - // name-value-pair. - if (!nameValuePair.includes('=')) { - value = nameValuePair - } else { - // Otherwise, the name string consists of the characters up to, but - // not including, the first %x3D ("=") character, and the (possibly - // empty) value string consists of the characters after the first - // %x3D ("=") character. - const position = { position: 0 } - name = collectASequenceOfCodePointsFast( - '=', - nameValuePair, - position - ) - value = nameValuePair.slice(position.position + 1) - } + var s2 = { + h0: _state.h0, + h1: _state.h1, + h2: _state.h2, + h3: _state.h3, + h4: _state.h4 + }; + _update(s2, _w, finalBlock); + var rval = forge.util.createBuffer(); + rval.putInt32(s2.h0); + rval.putInt32(s2.h1); + rval.putInt32(s2.h2); + rval.putInt32(s2.h3); + rval.putInt32(s2.h4); + return rval; + }; - // 4. Remove any leading or trailing WSP characters from the name - // string and the value string. - name = name.trim() - value = value.trim() + return md; +}; - // 5. If the sum of the lengths of the name string and the value string - // is more than 4096 octets, abort these steps and ignore the set- - // cookie-string entirely. - if (name.length + value.length > maxNameValuePairSize) { - return null - } +// sha-1 padding bytes not initialized yet +var _padding = null; +var _initialized = false; - // 6. The cookie-name is the name string, and the cookie-value is the - // value string. - return { - name, value, ...parseUnparsedAttributes(unparsedAttributes) - } +/** + * Initializes the constant tables. + */ +function _init() { + // create padding + _padding = String.fromCharCode(128); + _padding += forge.util.fillString(String.fromCharCode(0x00), 64); + + // now initialized + _initialized = true; } /** - * Parses the remaining attributes of a set-cookie header - * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4 - * @param {string} unparsedAttributes - * @param {[Object.]={}} cookieAttributeList + * Updates a SHA-1 state with the given byte buffer. + * + * @param s the SHA-1 state to update. + * @param w the array to use to store words. + * @param bytes the byte buffer to update with. */ -function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) { - // 1. If the unparsed-attributes string is empty, skip the rest of - // these steps. - if (unparsedAttributes.length === 0) { - return cookieAttributeList - } +function _update(s, w, bytes) { + // consume 512 bit (64 byte) chunks + var t, a, b, c, d, e, f, i; + var len = bytes.length(); + while(len >= 64) { + // the w array will be populated with sixteen 32-bit big-endian words + // and then extended into 80 32-bit words according to SHA-1 algorithm + // and for 32-79 using Max Locktyukhin's optimization - // 2. Discard the first character of the unparsed-attributes (which - // will be a %x3B (";") character). - assert(unparsedAttributes[0] === ';') - unparsedAttributes = unparsedAttributes.slice(1) + // initialize hash value for this chunk + a = s.h0; + b = s.h1; + c = s.h2; + d = s.h3; + e = s.h4; - let cookieAv = '' + // round 1 + for(i = 0; i < 16; ++i) { + t = bytes.getInt32(); + w[i] = t; + f = d ^ (b & (c ^ d)); + t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t; + e = d; + d = c; + // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug + c = ((b << 30) | (b >>> 2)) >>> 0; + b = a; + a = t; + } + for(; i < 20; ++i) { + t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]); + t = (t << 1) | (t >>> 31); + w[i] = t; + f = d ^ (b & (c ^ d)); + t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t; + e = d; + d = c; + // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug + c = ((b << 30) | (b >>> 2)) >>> 0; + b = a; + a = t; + } + // round 2 + for(; i < 32; ++i) { + t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]); + t = (t << 1) | (t >>> 31); + w[i] = t; + f = b ^ c ^ d; + t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t; + e = d; + d = c; + // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug + c = ((b << 30) | (b >>> 2)) >>> 0; + b = a; + a = t; + } + for(; i < 40; ++i) { + t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); + t = (t << 2) | (t >>> 30); + w[i] = t; + f = b ^ c ^ d; + t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t; + e = d; + d = c; + // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug + c = ((b << 30) | (b >>> 2)) >>> 0; + b = a; + a = t; + } + // round 3 + for(; i < 60; ++i) { + t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); + t = (t << 2) | (t >>> 30); + w[i] = t; + f = (b & c) | (d & (b ^ c)); + t = ((a << 5) | (a >>> 27)) + f + e + 0x8F1BBCDC + t; + e = d; + d = c; + // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug + c = ((b << 30) | (b >>> 2)) >>> 0; + b = a; + a = t; + } + // round 4 + for(; i < 80; ++i) { + t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); + t = (t << 2) | (t >>> 30); + w[i] = t; + f = b ^ c ^ d; + t = ((a << 5) | (a >>> 27)) + f + e + 0xCA62C1D6 + t; + e = d; + d = c; + // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug + c = ((b << 30) | (b >>> 2)) >>> 0; + b = a; + a = t; + } - // 3. If the remaining unparsed-attributes contains a %x3B (";") - // character: - if (unparsedAttributes.includes(';')) { - // 1. Consume the characters of the unparsed-attributes up to, but - // not including, the first %x3B (";") character. - cookieAv = collectASequenceOfCodePointsFast( - ';', - unparsedAttributes, - { position: 0 } - ) - unparsedAttributes = unparsedAttributes.slice(cookieAv.length) - } else { - // Otherwise: + // update hash state + s.h0 = (s.h0 + a) | 0; + s.h1 = (s.h1 + b) | 0; + s.h2 = (s.h2 + c) | 0; + s.h3 = (s.h3 + d) | 0; + s.h4 = (s.h4 + e) | 0; - // 1. Consume the remainder of the unparsed-attributes. - cookieAv = unparsedAttributes - unparsedAttributes = '' + len -= 64; } +} - // Let the cookie-av string be the characters consumed in this step. - - let attributeName = '' - let attributeValue = '' - // 4. If the cookie-av string contains a %x3D ("=") character: - if (cookieAv.includes('=')) { - // 1. The (possibly empty) attribute-name string consists of the - // characters up to, but not including, the first %x3D ("=") - // character, and the (possibly empty) attribute-value string - // consists of the characters after the first %x3D ("=") - // character. - const position = { position: 0 } +/***/ }), - attributeName = collectASequenceOfCodePointsFast( - '=', - cookieAv, - position - ) - attributeValue = cookieAv.slice(position.position + 1) - } else { - // Otherwise: +/***/ 56798: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // 1. The attribute-name string consists of the entire cookie-av - // string, and the attribute-value string is empty. - attributeName = cookieAv - } +/** + * Secure Hash Algorithm with 256-bit digest (SHA-256) implementation. + * + * See FIPS 180-2 for details. + * + * @author Dave Longley + * + * Copyright (c) 2010-2015 Digital Bazaar, Inc. + */ +var forge = __nccwpck_require__(56389); +__nccwpck_require__(48622); +__nccwpck_require__(65138); - // 5. Remove any leading or trailing WSP characters from the attribute- - // name string and the attribute-value string. - attributeName = attributeName.trim() - attributeValue = attributeValue.trim() +var sha256 = module.exports = forge.sha256 = forge.sha256 || {}; +forge.md.sha256 = forge.md.algorithms.sha256 = sha256; - // 6. If the attribute-value is longer than 1024 octets, ignore the - // cookie-av string and return to Step 1 of this algorithm. - if (attributeValue.length > maxAttributeValueSize) { - return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) +/** + * Creates a SHA-256 message digest object. + * + * @return a message digest object. + */ +sha256.create = function() { + // do initialization as necessary + if(!_initialized) { + _init(); } - // 7. Process the attribute-name and attribute-value according to the - // requirements in the following subsections. (Notice that - // attributes with unrecognized attribute-names are ignored.) - const attributeNameLowercase = attributeName.toLowerCase() + // SHA-256 state contains eight 32-bit integers + var _state = null; - // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1 - // If the attribute-name case-insensitively matches the string - // "Expires", the user agent MUST process the cookie-av as follows. - if (attributeNameLowercase === 'expires') { - // 1. Let the expiry-time be the result of parsing the attribute-value - // as cookie-date (see Section 5.1.1). - const expiryTime = new Date(attributeValue) + // input buffer + var _input = forge.util.createBuffer(); - // 2. If the attribute-value failed to parse as a cookie date, ignore - // the cookie-av. + // used for word storage + var _w = new Array(64); - cookieAttributeList.expires = expiryTime - } else if (attributeNameLowercase === 'max-age') { - // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2 - // If the attribute-name case-insensitively matches the string "Max- - // Age", the user agent MUST process the cookie-av as follows. + // message digest object + var md = { + algorithm: 'sha256', + blockLength: 64, + digestLength: 32, + // 56-bit length of message so far (does not including padding) + messageLength: 0, + // true message length + fullMessageLength: null, + // size of message length in bytes + messageLengthSize: 8 + }; - // 1. If the first character of the attribute-value is not a DIGIT or a - // "-" character, ignore the cookie-av. - const charCode = attributeValue.charCodeAt(0) + /** + * Starts the digest. + * + * @return this digest object. + */ + md.start = function() { + // up to 56-bit message length for convenience + md.messageLength = 0; - if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') { - return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) + // full message length (set md.messageLength64 for backwards-compatibility) + md.fullMessageLength = md.messageLength64 = []; + var int32s = md.messageLengthSize / 4; + for(var i = 0; i < int32s; ++i) { + md.fullMessageLength.push(0); } + _input = forge.util.createBuffer(); + _state = { + h0: 0x6A09E667, + h1: 0xBB67AE85, + h2: 0x3C6EF372, + h3: 0xA54FF53A, + h4: 0x510E527F, + h5: 0x9B05688C, + h6: 0x1F83D9AB, + h7: 0x5BE0CD19 + }; + return md; + }; + // start digest automatically for first time + md.start(); - // 2. If the remainder of attribute-value contains a non-DIGIT - // character, ignore the cookie-av. - if (!/^\d+$/.test(attributeValue)) { - return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) + /** + * Updates the digest with the given message input. The given input can + * treated as raw input (no encoding will be applied) or an encoding of + * 'utf8' maybe given to encode the input using UTF-8. + * + * @param msg the message input to update with. + * @param encoding the encoding to use (default: 'raw', other: 'utf8'). + * + * @return this digest object. + */ + md.update = function(msg, encoding) { + if(encoding === 'utf8') { + msg = forge.util.encodeUtf8(msg); } - // 3. Let delta-seconds be the attribute-value converted to an integer. - const deltaSeconds = Number(attributeValue) + // update message length + var len = msg.length; + md.messageLength += len; + len = [(len / 0x100000000) >>> 0, len >>> 0]; + for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { + md.fullMessageLength[i] += len[1]; + len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0); + md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; + len[0] = ((len[1] / 0x100000000) >>> 0); + } - // 4. Let cookie-age-limit be the maximum age of the cookie (which - // SHOULD be 400 days or less, see Section 4.1.2.2). + // add bytes to input buffer + _input.putBytes(msg); - // 5. Set delta-seconds to the smaller of its present value and cookie- - // age-limit. - // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs) + // process bytes + _update(_state, _w, _input); - // 6. If delta-seconds is less than or equal to zero (0), let expiry- - // time be the earliest representable date and time. Otherwise, let - // the expiry-time be the current date and time plus delta-seconds - // seconds. - // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds + // compact input buffer every 2K or if empty + if(_input.read > 2048 || _input.length() === 0) { + _input.compact(); + } - // 7. Append an attribute to the cookie-attribute-list with an - // attribute-name of Max-Age and an attribute-value of expiry-time. - cookieAttributeList.maxAge = deltaSeconds - } else if (attributeNameLowercase === 'domain') { - // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3 - // If the attribute-name case-insensitively matches the string "Domain", - // the user agent MUST process the cookie-av as follows. + return md; + }; - // 1. Let cookie-domain be the attribute-value. - let cookieDomain = attributeValue + /** + * Produces the digest. + * + * @return a byte buffer containing the digest value. + */ + md.digest = function() { + /* Note: Here we copy the remaining bytes in the input buffer and + add the appropriate SHA-256 padding. Then we do the final update + on a copy of the state so that if the user wants to get + intermediate digests they can do so. */ - // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be - // cookie-domain without its leading %x2E ("."). - if (cookieDomain[0] === '.') { - cookieDomain = cookieDomain.slice(1) - } + /* Determine the number of bytes that must be added to the message + to ensure its length is congruent to 448 mod 512. In other words, + the data to be digested must be a multiple of 512 bits (or 128 bytes). + This data includes the message, some padding, and the length of the + message. Since the length of the message will be encoded as 8 bytes (64 + bits), that means that the last segment of the data must have 56 bytes + (448 bits) of message and padding. Therefore, the length of the message + plus the padding must be congruent to 448 mod 512 because + 512 - 128 = 448. - // 3. Convert the cookie-domain to lower case. - cookieDomain = cookieDomain.toLowerCase() + In order to fill up the message length it must be filled with + padding that begins with 1 bit followed by all 0 bits. Padding + must *always* be present, so if the message length is already + congruent to 448 mod 512, then 512 padding bits must be added. */ - // 4. Append an attribute to the cookie-attribute-list with an - // attribute-name of Domain and an attribute-value of cookie-domain. - cookieAttributeList.domain = cookieDomain - } else if (attributeNameLowercase === 'path') { - // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4 - // If the attribute-name case-insensitively matches the string "Path", - // the user agent MUST process the cookie-av as follows. + var finalBlock = forge.util.createBuffer(); + finalBlock.putBytes(_input.bytes()); - // 1. If the attribute-value is empty or if the first character of the - // attribute-value is not %x2F ("/"): - let cookiePath = '' - if (attributeValue.length === 0 || attributeValue[0] !== '/') { - // 1. Let cookie-path be the default-path. - cookiePath = '/' - } else { - // Otherwise: + // compute remaining size to be digested (include message length size) + var remaining = ( + md.fullMessageLength[md.fullMessageLength.length - 1] + + md.messageLengthSize); - // 1. Let cookie-path be the attribute-value. - cookiePath = attributeValue + // add padding for overflow blockSize - overflow + // _padding starts with 1 byte with first bit is set (byte value 128), then + // there may be up to (blockSize - 1) other pad bytes + var overflow = remaining & (md.blockLength - 1); + finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); + + // serialize message length in bits in big-endian order; since length + // is stored in bytes we multiply by 8 and add carry from next int + var next, carry; + var bits = md.fullMessageLength[0] * 8; + for(var i = 0; i < md.fullMessageLength.length - 1; ++i) { + next = md.fullMessageLength[i + 1] * 8; + carry = (next / 0x100000000) >>> 0; + bits += carry; + finalBlock.putInt32(bits >>> 0); + bits = next >>> 0; } + finalBlock.putInt32(bits); - // 2. Append an attribute to the cookie-attribute-list with an - // attribute-name of Path and an attribute-value of cookie-path. - cookieAttributeList.path = cookiePath - } else if (attributeNameLowercase === 'secure') { - // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5 - // If the attribute-name case-insensitively matches the string "Secure", - // the user agent MUST append an attribute to the cookie-attribute-list - // with an attribute-name of Secure and an empty attribute-value. + var s2 = { + h0: _state.h0, + h1: _state.h1, + h2: _state.h2, + h3: _state.h3, + h4: _state.h4, + h5: _state.h5, + h6: _state.h6, + h7: _state.h7 + }; + _update(s2, _w, finalBlock); + var rval = forge.util.createBuffer(); + rval.putInt32(s2.h0); + rval.putInt32(s2.h1); + rval.putInt32(s2.h2); + rval.putInt32(s2.h3); + rval.putInt32(s2.h4); + rval.putInt32(s2.h5); + rval.putInt32(s2.h6); + rval.putInt32(s2.h7); + return rval; + }; - cookieAttributeList.secure = true - } else if (attributeNameLowercase === 'httponly') { - // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6 - // If the attribute-name case-insensitively matches the string - // "HttpOnly", the user agent MUST append an attribute to the cookie- - // attribute-list with an attribute-name of HttpOnly and an empty - // attribute-value. + return md; +}; - cookieAttributeList.httpOnly = true - } else if (attributeNameLowercase === 'samesite') { - // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7 - // If the attribute-name case-insensitively matches the string - // "SameSite", the user agent MUST process the cookie-av as follows: +// sha-256 padding bytes not initialized yet +var _padding = null; +var _initialized = false; - // 1. Let enforcement be "Default". - let enforcement = 'Default' +// table of constants +var _k = null; - const attributeValueLowercase = attributeValue.toLowerCase() - // 2. If cookie-av's attribute-value is a case-insensitive match for - // "None", set enforcement to "None". - if (attributeValueLowercase.includes('none')) { - enforcement = 'None' - } +/** + * Initializes the constant tables. + */ +function _init() { + // create padding + _padding = String.fromCharCode(128); + _padding += forge.util.fillString(String.fromCharCode(0x00), 64); - // 3. If cookie-av's attribute-value is a case-insensitive match for - // "Strict", set enforcement to "Strict". - if (attributeValueLowercase.includes('strict')) { - enforcement = 'Strict' - } + // create K table for SHA-256 + _k = [ + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, + 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, + 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, + 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, + 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]; - // 4. If cookie-av's attribute-value is a case-insensitive match for - // "Lax", set enforcement to "Lax". - if (attributeValueLowercase.includes('lax')) { - enforcement = 'Lax' + // now initialized + _initialized = true; +} + +/** + * Updates a SHA-256 state with the given byte buffer. + * + * @param s the SHA-256 state to update. + * @param w the array to use to store words. + * @param bytes the byte buffer to update with. + */ +function _update(s, w, bytes) { + // consume 512 bit (64 byte) chunks + var t1, t2, s0, s1, ch, maj, i, a, b, c, d, e, f, g, h; + var len = bytes.length(); + while(len >= 64) { + // the w array will be populated with sixteen 32-bit big-endian words + // and then extended into 64 32-bit words according to SHA-256 + for(i = 0; i < 16; ++i) { + w[i] = bytes.getInt32(); + } + for(; i < 64; ++i) { + // XOR word 2 words ago rot right 17, rot right 19, shft right 10 + t1 = w[i - 2]; + t1 = + ((t1 >>> 17) | (t1 << 15)) ^ + ((t1 >>> 19) | (t1 << 13)) ^ + (t1 >>> 10); + // XOR word 15 words ago rot right 7, rot right 18, shft right 3 + t2 = w[i - 15]; + t2 = + ((t2 >>> 7) | (t2 << 25)) ^ + ((t2 >>> 18) | (t2 << 14)) ^ + (t2 >>> 3); + // sum(t1, word 7 ago, t2, word 16 ago) modulo 2^32 + w[i] = (t1 + w[i - 7] + t2 + w[i - 16]) | 0; } - // 5. Append an attribute to the cookie-attribute-list with an - // attribute-name of "SameSite" and an attribute-value of - // enforcement. - cookieAttributeList.sameSite = enforcement - } else { - cookieAttributeList.unparsed ??= [] + // initialize hash value for this chunk + a = s.h0; + b = s.h1; + c = s.h2; + d = s.h3; + e = s.h4; + f = s.h5; + g = s.h6; + h = s.h7; - cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`) - } + // round function + for(i = 0; i < 64; ++i) { + // Sum1(e) + s1 = + ((e >>> 6) | (e << 26)) ^ + ((e >>> 11) | (e << 21)) ^ + ((e >>> 25) | (e << 7)); + // Ch(e, f, g) (optimized the same way as SHA-1) + ch = g ^ (e & (f ^ g)); + // Sum0(a) + s0 = + ((a >>> 2) | (a << 30)) ^ + ((a >>> 13) | (a << 19)) ^ + ((a >>> 22) | (a << 10)); + // Maj(a, b, c) (optimized the same way as SHA-1) + maj = (a & b) | (c & (a ^ b)); - // 8. Return to Step 1 of this algorithm. - return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) -} + // main algorithm + t1 = h + s1 + ch + _k[i] + w[i]; + t2 = s0 + maj; + h = g; + g = f; + f = e; + // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug + // can't truncate with `| 0` + e = (d + t1) >>> 0; + d = c; + c = b; + b = a; + // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug + // can't truncate with `| 0` + a = (t1 + t2) >>> 0; + } -module.exports = { - parseSetCookie, - parseUnparsedAttributes + // update hash state + s.h0 = (s.h0 + a) | 0; + s.h1 = (s.h1 + b) | 0; + s.h2 = (s.h2 + c) | 0; + s.h3 = (s.h3 + d) | 0; + s.h4 = (s.h4 + e) | 0; + s.h5 = (s.h5 + f) | 0; + s.h6 = (s.h6 + g) | 0; + s.h7 = (s.h7 + h) | 0; + len -= 64; + } } /***/ }), -/***/ 30733: +/***/ 7841: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * Secure Hash Algorithm with a 1024-bit block size implementation. + * + * This includes: SHA-512, SHA-384, SHA-512/224, and SHA-512/256. For + * SHA-256 (block size 512 bits), see sha256.js. + * + * See FIPS 180-4 for details. + * + * @author Dave Longley + * + * Copyright (c) 2014-2015 Digital Bazaar, Inc. + */ +var forge = __nccwpck_require__(56389); +__nccwpck_require__(48622); +__nccwpck_require__(65138); +var sha512 = module.exports = forge.sha512 = forge.sha512 || {}; -const assert = __nccwpck_require__(39491) -const { kHeadersList } = __nccwpck_require__(48039) - -function isCTLExcludingHtab (value) { - if (value.length === 0) { - return false - } +// SHA-512 +forge.md.sha512 = forge.md.algorithms.sha512 = sha512; - for (const char of value) { - const code = char.charCodeAt(0) +// SHA-384 +var sha384 = forge.sha384 = forge.sha512.sha384 = forge.sha512.sha384 || {}; +sha384.create = function() { + return sha512.create('SHA-384'); +}; +forge.md.sha384 = forge.md.algorithms.sha384 = sha384; - if ( - (code >= 0x00 || code <= 0x08) || - (code >= 0x0A || code <= 0x1F) || - code === 0x7F - ) { - return false - } +// SHA-512/256 +forge.sha512.sha256 = forge.sha512.sha256 || { + create: function() { + return sha512.create('SHA-512/256'); } -} - -/** - CHAR = - token = 1* - separators = "(" | ")" | "<" | ">" | "@" - | "," | ";" | ":" | "\" | <"> - | "/" | "[" | "]" | "?" | "=" - | "{" | "}" | SP | HT - * @param {string} name - */ -function validateCookieName (name) { - for (const char of name) { - const code = char.charCodeAt(0) +}; +forge.md['sha512/256'] = forge.md.algorithms['sha512/256'] = + forge.sha512.sha256; - if ( - (code <= 0x20 || code > 0x7F) || - char === '(' || - char === ')' || - char === '>' || - char === '<' || - char === '@' || - char === ',' || - char === ';' || - char === ':' || - char === '\\' || - char === '"' || - char === '/' || - char === '[' || - char === ']' || - char === '?' || - char === '=' || - char === '{' || - char === '}' - ) { - throw new Error('Invalid cookie name') - } +// SHA-512/224 +forge.sha512.sha224 = forge.sha512.sha224 || { + create: function() { + return sha512.create('SHA-512/224'); } -} +}; +forge.md['sha512/224'] = forge.md.algorithms['sha512/224'] = + forge.sha512.sha224; /** - cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) - cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E - ; US-ASCII characters excluding CTLs, - ; whitespace DQUOTE, comma, semicolon, - ; and backslash - * @param {string} value + * Creates a SHA-2 message digest object. + * + * @param algorithm the algorithm to use (SHA-512, SHA-384, SHA-512/224, + * SHA-512/256). + * + * @return a message digest object. */ -function validateCookieValue (value) { - for (const char of value) { - const code = char.charCodeAt(0) - - if ( - code < 0x21 || // exclude CTLs (0-31) - code === 0x22 || - code === 0x2C || - code === 0x3B || - code === 0x5C || - code > 0x7E // non-ascii - ) { - throw new Error('Invalid header value') - } +sha512.create = function(algorithm) { + // do initialization as necessary + if(!_initialized) { + _init(); } -} - -/** - * path-value = - * @param {string} path - */ -function validateCookiePath (path) { - for (const char of path) { - const code = char.charCodeAt(0) - if (code < 0x21 || char === ';') { - throw new Error('Invalid cookie path') - } + if(typeof algorithm === 'undefined') { + algorithm = 'SHA-512'; } -} -/** - * I have no idea why these values aren't allowed to be honest, - * but Deno tests these. - Khafra - * @param {string} domain - */ -function validateCookieDomain (domain) { - if ( - domain.startsWith('-') || - domain.endsWith('.') || - domain.endsWith('-') - ) { - throw new Error('Invalid cookie domain') + if(!(algorithm in _states)) { + throw new Error('Invalid SHA-512 algorithm: ' + algorithm); } -} - -/** - * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1 - * @param {number|Date} date - IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT - ; fixed length/zone/capitalization subset of the format - ; see Section 3.3 of [RFC5322] - - day-name = %x4D.6F.6E ; "Mon", case-sensitive - / %x54.75.65 ; "Tue", case-sensitive - / %x57.65.64 ; "Wed", case-sensitive - / %x54.68.75 ; "Thu", case-sensitive - / %x46.72.69 ; "Fri", case-sensitive - / %x53.61.74 ; "Sat", case-sensitive - / %x53.75.6E ; "Sun", case-sensitive - date1 = day SP month SP year - ; e.g., 02 Jun 1982 - - day = 2DIGIT - month = %x4A.61.6E ; "Jan", case-sensitive - / %x46.65.62 ; "Feb", case-sensitive - / %x4D.61.72 ; "Mar", case-sensitive - / %x41.70.72 ; "Apr", case-sensitive - / %x4D.61.79 ; "May", case-sensitive - / %x4A.75.6E ; "Jun", case-sensitive - / %x4A.75.6C ; "Jul", case-sensitive - / %x41.75.67 ; "Aug", case-sensitive - / %x53.65.70 ; "Sep", case-sensitive - / %x4F.63.74 ; "Oct", case-sensitive - / %x4E.6F.76 ; "Nov", case-sensitive - / %x44.65.63 ; "Dec", case-sensitive - year = 4DIGIT - GMT = %x47.4D.54 ; "GMT", case-sensitive + // SHA-512 state contains eight 64-bit integers (each as two 32-bit ints) + var _state = _states[algorithm]; + var _h = null; - time-of-day = hour ":" minute ":" second - ; 00:00:00 - 23:59:60 (leap second) + // input buffer + var _input = forge.util.createBuffer(); - hour = 2DIGIT - minute = 2DIGIT - second = 2DIGIT - */ -function toIMFDate (date) { - if (typeof date === 'number') { - date = new Date(date) + // used for 64-bit word storage + var _w = new Array(80); + for(var wi = 0; wi < 80; ++wi) { + _w[wi] = new Array(2); } - const days = [ - 'Sun', 'Mon', 'Tue', 'Wed', - 'Thu', 'Fri', 'Sat' - ] + // determine digest length by algorithm name (default) + var digestLength = 64; + switch(algorithm) { + case 'SHA-384': + digestLength = 48; + break; + case 'SHA-512/256': + digestLength = 32; + break; + case 'SHA-512/224': + digestLength = 28; + break; + } - const months = [ - 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', - 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' - ] + // message digest object + var md = { + // SHA-512 => sha512 + algorithm: algorithm.replace('-', '').toLowerCase(), + blockLength: 128, + digestLength: digestLength, + // 56-bit length of message so far (does not including padding) + messageLength: 0, + // true message length + fullMessageLength: null, + // size of message length in bytes + messageLengthSize: 16 + }; - const dayName = days[date.getUTCDay()] - const day = date.getUTCDate().toString().padStart(2, '0') - const month = months[date.getUTCMonth()] - const year = date.getUTCFullYear() - const hour = date.getUTCHours().toString().padStart(2, '0') - const minute = date.getUTCMinutes().toString().padStart(2, '0') - const second = date.getUTCSeconds().toString().padStart(2, '0') + /** + * Starts the digest. + * + * @return this digest object. + */ + md.start = function() { + // up to 56-bit message length for convenience + md.messageLength = 0; - return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT` -} + // full message length (set md.messageLength128 for backwards-compatibility) + md.fullMessageLength = md.messageLength128 = []; + var int32s = md.messageLengthSize / 4; + for(var i = 0; i < int32s; ++i) { + md.fullMessageLength.push(0); + } + _input = forge.util.createBuffer(); + _h = new Array(_state.length); + for(var i = 0; i < _state.length; ++i) { + _h[i] = _state[i].slice(0); + } + return md; + }; + // start digest automatically for first time + md.start(); -/** - max-age-av = "Max-Age=" non-zero-digit *DIGIT - ; In practice, both expires-av and max-age-av - ; are limited to dates representable by the - ; user agent. - * @param {number} maxAge - */ -function validateCookieMaxAge (maxAge) { - if (maxAge < 0) { - throw new Error('Invalid cookie max-age') - } -} + /** + * Updates the digest with the given message input. The given input can + * treated as raw input (no encoding will be applied) or an encoding of + * 'utf8' maybe given to encode the input using UTF-8. + * + * @param msg the message input to update with. + * @param encoding the encoding to use (default: 'raw', other: 'utf8'). + * + * @return this digest object. + */ + md.update = function(msg, encoding) { + if(encoding === 'utf8') { + msg = forge.util.encodeUtf8(msg); + } -/** - * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1 - * @param {import('./index').Cookie} cookie - */ -function stringify (cookie) { - if (cookie.name.length === 0) { - return null - } + // update message length + var len = msg.length; + md.messageLength += len; + len = [(len / 0x100000000) >>> 0, len >>> 0]; + for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { + md.fullMessageLength[i] += len[1]; + len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0); + md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; + len[0] = ((len[1] / 0x100000000) >>> 0); + } - validateCookieName(cookie.name) - validateCookieValue(cookie.value) + // add bytes to input buffer + _input.putBytes(msg); - const out = [`${cookie.name}=${cookie.value}`] + // process bytes + _update(_h, _w, _input); - // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1 - // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2 - if (cookie.name.startsWith('__Secure-')) { - cookie.secure = true - } + // compact input buffer every 2K or if empty + if(_input.read > 2048 || _input.length() === 0) { + _input.compact(); + } - if (cookie.name.startsWith('__Host-')) { - cookie.secure = true - cookie.domain = null - cookie.path = '/' - } + return md; + }; - if (cookie.secure) { - out.push('Secure') - } + /** + * Produces the digest. + * + * @return a byte buffer containing the digest value. + */ + md.digest = function() { + /* Note: Here we copy the remaining bytes in the input buffer and + add the appropriate SHA-512 padding. Then we do the final update + on a copy of the state so that if the user wants to get + intermediate digests they can do so. */ - if (cookie.httpOnly) { - out.push('HttpOnly') - } + /* Determine the number of bytes that must be added to the message + to ensure its length is congruent to 896 mod 1024. In other words, + the data to be digested must be a multiple of 1024 bits (or 128 bytes). + This data includes the message, some padding, and the length of the + message. Since the length of the message will be encoded as 16 bytes (128 + bits), that means that the last segment of the data must have 112 bytes + (896 bits) of message and padding. Therefore, the length of the message + plus the padding must be congruent to 896 mod 1024 because + 1024 - 128 = 896. - if (typeof cookie.maxAge === 'number') { - validateCookieMaxAge(cookie.maxAge) - out.push(`Max-Age=${cookie.maxAge}`) - } + In order to fill up the message length it must be filled with + padding that begins with 1 bit followed by all 0 bits. Padding + must *always* be present, so if the message length is already + congruent to 896 mod 1024, then 1024 padding bits must be added. */ - if (cookie.domain) { - validateCookieDomain(cookie.domain) - out.push(`Domain=${cookie.domain}`) - } + var finalBlock = forge.util.createBuffer(); + finalBlock.putBytes(_input.bytes()); - if (cookie.path) { - validateCookiePath(cookie.path) - out.push(`Path=${cookie.path}`) - } + // compute remaining size to be digested (include message length size) + var remaining = ( + md.fullMessageLength[md.fullMessageLength.length - 1] + + md.messageLengthSize); - if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') { - out.push(`Expires=${toIMFDate(cookie.expires)}`) - } + // add padding for overflow blockSize - overflow + // _padding starts with 1 byte with first bit is set (byte value 128), then + // there may be up to (blockSize - 1) other pad bytes + var overflow = remaining & (md.blockLength - 1); + finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); - if (cookie.sameSite) { - out.push(`SameSite=${cookie.sameSite}`) - } + // serialize message length in bits in big-endian order; since length + // is stored in bytes we multiply by 8 and add carry from next int + var next, carry; + var bits = md.fullMessageLength[0] * 8; + for(var i = 0; i < md.fullMessageLength.length - 1; ++i) { + next = md.fullMessageLength[i + 1] * 8; + carry = (next / 0x100000000) >>> 0; + bits += carry; + finalBlock.putInt32(bits >>> 0); + bits = next >>> 0; + } + finalBlock.putInt32(bits); - for (const part of cookie.unparsed) { - if (!part.includes('=')) { - throw new Error('Invalid unparsed') + var h = new Array(_h.length); + for(var i = 0; i < _h.length; ++i) { + h[i] = _h[i].slice(0); + } + _update(h, _w, finalBlock); + var rval = forge.util.createBuffer(); + var hlen; + if(algorithm === 'SHA-512') { + hlen = h.length; + } else if(algorithm === 'SHA-384') { + hlen = h.length - 2; + } else { + hlen = h.length - 4; + } + for(var i = 0; i < hlen; ++i) { + rval.putInt32(h[i][0]); + if(i !== hlen - 1 || algorithm !== 'SHA-512/224') { + rval.putInt32(h[i][1]); + } } + return rval; + }; - const [key, ...value] = part.split('=') + return md; +}; - out.push(`${key.trim()}=${value.join('=')}`) - } +// sha-512 padding bytes not initialized yet +var _padding = null; +var _initialized = false; - return out.join('; ') -} +// table of constants +var _k = null; -let kHeadersListNode +// initial hash states +var _states = null; -function getHeadersList (headers) { - if (headers[kHeadersList]) { - return headers[kHeadersList] - } +/** + * Initializes the constant tables. + */ +function _init() { + // create padding + _padding = String.fromCharCode(128); + _padding += forge.util.fillString(String.fromCharCode(0x00), 128); - if (!kHeadersListNode) { - kHeadersListNode = Object.getOwnPropertySymbols(headers).find( - (symbol) => symbol.description === 'headers list' - ) + // create K table for SHA-512 + _k = [ + [0x428a2f98, 0xd728ae22], [0x71374491, 0x23ef65cd], + [0xb5c0fbcf, 0xec4d3b2f], [0xe9b5dba5, 0x8189dbbc], + [0x3956c25b, 0xf348b538], [0x59f111f1, 0xb605d019], + [0x923f82a4, 0xaf194f9b], [0xab1c5ed5, 0xda6d8118], + [0xd807aa98, 0xa3030242], [0x12835b01, 0x45706fbe], + [0x243185be, 0x4ee4b28c], [0x550c7dc3, 0xd5ffb4e2], + [0x72be5d74, 0xf27b896f], [0x80deb1fe, 0x3b1696b1], + [0x9bdc06a7, 0x25c71235], [0xc19bf174, 0xcf692694], + [0xe49b69c1, 0x9ef14ad2], [0xefbe4786, 0x384f25e3], + [0x0fc19dc6, 0x8b8cd5b5], [0x240ca1cc, 0x77ac9c65], + [0x2de92c6f, 0x592b0275], [0x4a7484aa, 0x6ea6e483], + [0x5cb0a9dc, 0xbd41fbd4], [0x76f988da, 0x831153b5], + [0x983e5152, 0xee66dfab], [0xa831c66d, 0x2db43210], + [0xb00327c8, 0x98fb213f], [0xbf597fc7, 0xbeef0ee4], + [0xc6e00bf3, 0x3da88fc2], [0xd5a79147, 0x930aa725], + [0x06ca6351, 0xe003826f], [0x14292967, 0x0a0e6e70], + [0x27b70a85, 0x46d22ffc], [0x2e1b2138, 0x5c26c926], + [0x4d2c6dfc, 0x5ac42aed], [0x53380d13, 0x9d95b3df], + [0x650a7354, 0x8baf63de], [0x766a0abb, 0x3c77b2a8], + [0x81c2c92e, 0x47edaee6], [0x92722c85, 0x1482353b], + [0xa2bfe8a1, 0x4cf10364], [0xa81a664b, 0xbc423001], + [0xc24b8b70, 0xd0f89791], [0xc76c51a3, 0x0654be30], + [0xd192e819, 0xd6ef5218], [0xd6990624, 0x5565a910], + [0xf40e3585, 0x5771202a], [0x106aa070, 0x32bbd1b8], + [0x19a4c116, 0xb8d2d0c8], [0x1e376c08, 0x5141ab53], + [0x2748774c, 0xdf8eeb99], [0x34b0bcb5, 0xe19b48a8], + [0x391c0cb3, 0xc5c95a63], [0x4ed8aa4a, 0xe3418acb], + [0x5b9cca4f, 0x7763e373], [0x682e6ff3, 0xd6b2b8a3], + [0x748f82ee, 0x5defb2fc], [0x78a5636f, 0x43172f60], + [0x84c87814, 0xa1f0ab72], [0x8cc70208, 0x1a6439ec], + [0x90befffa, 0x23631e28], [0xa4506ceb, 0xde82bde9], + [0xbef9a3f7, 0xb2c67915], [0xc67178f2, 0xe372532b], + [0xca273ece, 0xea26619c], [0xd186b8c7, 0x21c0c207], + [0xeada7dd6, 0xcde0eb1e], [0xf57d4f7f, 0xee6ed178], + [0x06f067aa, 0x72176fba], [0x0a637dc5, 0xa2c898a6], + [0x113f9804, 0xbef90dae], [0x1b710b35, 0x131c471b], + [0x28db77f5, 0x23047d84], [0x32caab7b, 0x40c72493], + [0x3c9ebe0a, 0x15c9bebc], [0x431d67c4, 0x9c100d4c], + [0x4cc5d4be, 0xcb3e42b6], [0x597f299c, 0xfc657e2a], + [0x5fcb6fab, 0x3ad6faec], [0x6c44198c, 0x4a475817] + ]; - assert(kHeadersListNode, 'Headers cannot be parsed') - } + // initial hash states + _states = {}; + _states['SHA-512'] = [ + [0x6a09e667, 0xf3bcc908], + [0xbb67ae85, 0x84caa73b], + [0x3c6ef372, 0xfe94f82b], + [0xa54ff53a, 0x5f1d36f1], + [0x510e527f, 0xade682d1], + [0x9b05688c, 0x2b3e6c1f], + [0x1f83d9ab, 0xfb41bd6b], + [0x5be0cd19, 0x137e2179] + ]; + _states['SHA-384'] = [ + [0xcbbb9d5d, 0xc1059ed8], + [0x629a292a, 0x367cd507], + [0x9159015a, 0x3070dd17], + [0x152fecd8, 0xf70e5939], + [0x67332667, 0xffc00b31], + [0x8eb44a87, 0x68581511], + [0xdb0c2e0d, 0x64f98fa7], + [0x47b5481d, 0xbefa4fa4] + ]; + _states['SHA-512/256'] = [ + [0x22312194, 0xFC2BF72C], + [0x9F555FA3, 0xC84C64C2], + [0x2393B86B, 0x6F53B151], + [0x96387719, 0x5940EABD], + [0x96283EE2, 0xA88EFFE3], + [0xBE5E1E25, 0x53863992], + [0x2B0199FC, 0x2C85B8AA], + [0x0EB72DDC, 0x81C52CA2] + ]; + _states['SHA-512/224'] = [ + [0x8C3D37C8, 0x19544DA2], + [0x73E19966, 0x89DCD4D6], + [0x1DFAB7AE, 0x32FF9C82], + [0x679DD514, 0x582F9FCF], + [0x0F6D2B69, 0x7BD44DA8], + [0x77E36F73, 0x04C48942], + [0x3F9D85A8, 0x6A1D36C8], + [0x1112E6AD, 0x91D692A1] + ]; - const headersList = headers[kHeadersListNode] - assert(headersList) + // now initialized + _initialized = true; +} + +/** + * Updates a SHA-512 state with the given byte buffer. + * + * @param s the SHA-512 state to update. + * @param w the array to use to store words. + * @param bytes the byte buffer to update with. + */ +function _update(s, w, bytes) { + // consume 512 bit (128 byte) chunks + var t1_hi, t1_lo; + var t2_hi, t2_lo; + var s0_hi, s0_lo; + var s1_hi, s1_lo; + var ch_hi, ch_lo; + var maj_hi, maj_lo; + var a_hi, a_lo; + var b_hi, b_lo; + var c_hi, c_lo; + var d_hi, d_lo; + var e_hi, e_lo; + var f_hi, f_lo; + var g_hi, g_lo; + var h_hi, h_lo; + var i, hi, lo, w2, w7, w15, w16; + var len = bytes.length(); + while(len >= 128) { + // the w array will be populated with sixteen 64-bit big-endian words + // and then extended into 64 64-bit words according to SHA-512 + for(i = 0; i < 16; ++i) { + w[i][0] = bytes.getInt32() >>> 0; + w[i][1] = bytes.getInt32() >>> 0; + } + for(; i < 80; ++i) { + // for word 2 words ago: ROTR 19(x) ^ ROTR 61(x) ^ SHR 6(x) + w2 = w[i - 2]; + hi = w2[0]; + lo = w2[1]; - return headersList -} + // high bits + t1_hi = ( + ((hi >>> 19) | (lo << 13)) ^ // ROTR 19 + ((lo >>> 29) | (hi << 3)) ^ // ROTR 61/(swap + ROTR 29) + (hi >>> 6)) >>> 0; // SHR 6 + // low bits + t1_lo = ( + ((hi << 13) | (lo >>> 19)) ^ // ROTR 19 + ((lo << 3) | (hi >>> 29)) ^ // ROTR 61/(swap + ROTR 29) + ((hi << 26) | (lo >>> 6))) >>> 0; // SHR 6 -module.exports = { - isCTLExcludingHtab, - stringify, - getHeadersList -} + // for word 15 words ago: ROTR 1(x) ^ ROTR 8(x) ^ SHR 7(x) + w15 = w[i - 15]; + hi = w15[0]; + lo = w15[1]; + // high bits + t2_hi = ( + ((hi >>> 1) | (lo << 31)) ^ // ROTR 1 + ((hi >>> 8) | (lo << 24)) ^ // ROTR 8 + (hi >>> 7)) >>> 0; // SHR 7 + // low bits + t2_lo = ( + ((hi << 31) | (lo >>> 1)) ^ // ROTR 1 + ((hi << 24) | (lo >>> 8)) ^ // ROTR 8 + ((hi << 25) | (lo >>> 7))) >>> 0; // SHR 7 -/***/ }), + // sum(t1, word 7 ago, t2, word 16 ago) modulo 2^64 (carry lo overflow) + w7 = w[i - 7]; + w16 = w[i - 16]; + lo = (t1_lo + w7[1] + t2_lo + w16[1]); + w[i][0] = (t1_hi + w7[0] + t2_hi + w16[0] + + ((lo / 0x100000000) >>> 0)) >>> 0; + w[i][1] = lo >>> 0; + } -/***/ 2209: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // initialize hash value for this chunk + a_hi = s[0][0]; + a_lo = s[0][1]; + b_hi = s[1][0]; + b_lo = s[1][1]; + c_hi = s[2][0]; + c_lo = s[2][1]; + d_hi = s[3][0]; + d_lo = s[3][1]; + e_hi = s[4][0]; + e_lo = s[4][1]; + f_hi = s[5][0]; + f_lo = s[5][1]; + g_hi = s[6][0]; + g_lo = s[6][1]; + h_hi = s[7][0]; + h_lo = s[7][1]; + // round function + for(i = 0; i < 80; ++i) { + // Sum1(e) = ROTR 14(e) ^ ROTR 18(e) ^ ROTR 41(e) + s1_hi = ( + ((e_hi >>> 14) | (e_lo << 18)) ^ // ROTR 14 + ((e_hi >>> 18) | (e_lo << 14)) ^ // ROTR 18 + ((e_lo >>> 9) | (e_hi << 23))) >>> 0; // ROTR 41/(swap + ROTR 9) + s1_lo = ( + ((e_hi << 18) | (e_lo >>> 14)) ^ // ROTR 14 + ((e_hi << 14) | (e_lo >>> 18)) ^ // ROTR 18 + ((e_lo << 23) | (e_hi >>> 9))) >>> 0; // ROTR 41/(swap + ROTR 9) + // Ch(e, f, g) (optimized the same way as SHA-1) + ch_hi = (g_hi ^ (e_hi & (f_hi ^ g_hi))) >>> 0; + ch_lo = (g_lo ^ (e_lo & (f_lo ^ g_lo))) >>> 0; -const net = __nccwpck_require__(41808) -const assert = __nccwpck_require__(39491) -const util = __nccwpck_require__(67468) -const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(46339) + // Sum0(a) = ROTR 28(a) ^ ROTR 34(a) ^ ROTR 39(a) + s0_hi = ( + ((a_hi >>> 28) | (a_lo << 4)) ^ // ROTR 28 + ((a_lo >>> 2) | (a_hi << 30)) ^ // ROTR 34/(swap + ROTR 2) + ((a_lo >>> 7) | (a_hi << 25))) >>> 0; // ROTR 39/(swap + ROTR 7) + s0_lo = ( + ((a_hi << 4) | (a_lo >>> 28)) ^ // ROTR 28 + ((a_lo << 30) | (a_hi >>> 2)) ^ // ROTR 34/(swap + ROTR 2) + ((a_lo << 25) | (a_hi >>> 7))) >>> 0; // ROTR 39/(swap + ROTR 7) -let tls // include tls conditionally since it is not always available + // Maj(a, b, c) (optimized the same way as SHA-1) + maj_hi = ((a_hi & b_hi) | (c_hi & (a_hi ^ b_hi))) >>> 0; + maj_lo = ((a_lo & b_lo) | (c_lo & (a_lo ^ b_lo))) >>> 0; -// TODO: session re-use does not wait for the first -// connection to resolve the session and might therefore -// resolve the same servername multiple times even when -// re-use is enabled. + // main algorithm + // t1 = (h + s1 + ch + _k[i] + _w[i]) modulo 2^64 (carry lo overflow) + lo = (h_lo + s1_lo + ch_lo + _k[i][1] + w[i][1]); + t1_hi = (h_hi + s1_hi + ch_hi + _k[i][0] + w[i][0] + + ((lo / 0x100000000) >>> 0)) >>> 0; + t1_lo = lo >>> 0; -let SessionCache -// FIXME: remove workaround when the Node bug is fixed -// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308 -if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) { - SessionCache = class WeakSessionCache { - constructor (maxCachedSessions) { - this._maxCachedSessions = maxCachedSessions - this._sessionCache = new Map() - this._sessionRegistry = new global.FinalizationRegistry((key) => { - if (this._sessionCache.size < this._maxCachedSessions) { - return - } + // t2 = s0 + maj modulo 2^64 (carry lo overflow) + lo = s0_lo + maj_lo; + t2_hi = (s0_hi + maj_hi + ((lo / 0x100000000) >>> 0)) >>> 0; + t2_lo = lo >>> 0; - const ref = this._sessionCache.get(key) - if (ref !== undefined && ref.deref() === undefined) { - this._sessionCache.delete(key) - } - }) - } + h_hi = g_hi; + h_lo = g_lo; - get (sessionKey) { - const ref = this._sessionCache.get(sessionKey) - return ref ? ref.deref() : null - } + g_hi = f_hi; + g_lo = f_lo; - set (sessionKey, session) { - if (this._maxCachedSessions === 0) { - return - } + f_hi = e_hi; + f_lo = e_lo; - this._sessionCache.set(sessionKey, new WeakRef(session)) - this._sessionRegistry.register(session, sessionKey) - } - } -} else { - SessionCache = class SimpleSessionCache { - constructor (maxCachedSessions) { - this._maxCachedSessions = maxCachedSessions - this._sessionCache = new Map() - } + // e = (d + t1) modulo 2^64 (carry lo overflow) + lo = d_lo + t1_lo; + e_hi = (d_hi + t1_hi + ((lo / 0x100000000) >>> 0)) >>> 0; + e_lo = lo >>> 0; - get (sessionKey) { - return this._sessionCache.get(sessionKey) - } + d_hi = c_hi; + d_lo = c_lo; - set (sessionKey, session) { - if (this._maxCachedSessions === 0) { - return - } + c_hi = b_hi; + c_lo = b_lo; - if (this._sessionCache.size >= this._maxCachedSessions) { - // remove the oldest session - const { value: oldestKey } = this._sessionCache.keys().next() - this._sessionCache.delete(oldestKey) - } + b_hi = a_hi; + b_lo = a_lo; - this._sessionCache.set(sessionKey, session) + // a = (t1 + t2) modulo 2^64 (carry lo overflow) + lo = t1_lo + t2_lo; + a_hi = (t1_hi + t2_hi + ((lo / 0x100000000) >>> 0)) >>> 0; + a_lo = lo >>> 0; } - } -} - -function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) { - if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) { - throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero') - } - - const options = { path: socketPath, ...opts } - const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions) - timeout = timeout == null ? 10e3 : timeout - allowH2 = allowH2 != null ? allowH2 : false - return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) { - let socket - if (protocol === 'https:') { - if (!tls) { - tls = __nccwpck_require__(24404) - } - servername = servername || options.servername || util.getServerName(host) || null - - const sessionKey = servername || hostname - const session = sessionCache.get(sessionKey) || null - - assert(sessionKey) - - socket = tls.connect({ - highWaterMark: 16384, // TLS in node can't have bigger HWM anyway... - ...options, - servername, - session, - localAddress, - // TODO(HTTP/2): Add support for h2c - ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'], - socket: httpSocket, // upgrade socket connection - port: port || 443, - host: hostname - }) - socket - .on('session', function (session) { - // TODO (fix): Can a session become invalid once established? Don't think so? - sessionCache.set(sessionKey, session) - }) - } else { - assert(!httpSocket, 'httpSocket can only be sent on TLS update') - socket = net.connect({ - highWaterMark: 64 * 1024, // Same as nodejs fs streams. - ...options, - localAddress, - port: port || 80, - host: hostname - }) - } + // update hash state (additional modulo 2^64) + lo = s[0][1] + a_lo; + s[0][0] = (s[0][0] + a_hi + ((lo / 0x100000000) >>> 0)) >>> 0; + s[0][1] = lo >>> 0; - // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket - if (options.keepAlive == null || options.keepAlive) { - const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay - socket.setKeepAlive(true, keepAliveInitialDelay) - } + lo = s[1][1] + b_lo; + s[1][0] = (s[1][0] + b_hi + ((lo / 0x100000000) >>> 0)) >>> 0; + s[1][1] = lo >>> 0; - const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout) + lo = s[2][1] + c_lo; + s[2][0] = (s[2][0] + c_hi + ((lo / 0x100000000) >>> 0)) >>> 0; + s[2][1] = lo >>> 0; - socket - .setNoDelay(true) - .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () { - cancelTimeout() + lo = s[3][1] + d_lo; + s[3][0] = (s[3][0] + d_hi + ((lo / 0x100000000) >>> 0)) >>> 0; + s[3][1] = lo >>> 0; - if (callback) { - const cb = callback - callback = null - cb(null, this) - } - }) - .on('error', function (err) { - cancelTimeout() + lo = s[4][1] + e_lo; + s[4][0] = (s[4][0] + e_hi + ((lo / 0x100000000) >>> 0)) >>> 0; + s[4][1] = lo >>> 0; - if (callback) { - const cb = callback - callback = null - cb(err) - } - }) + lo = s[5][1] + f_lo; + s[5][0] = (s[5][0] + f_hi + ((lo / 0x100000000) >>> 0)) >>> 0; + s[5][1] = lo >>> 0; - return socket - } -} + lo = s[6][1] + g_lo; + s[6][0] = (s[6][0] + g_hi + ((lo / 0x100000000) >>> 0)) >>> 0; + s[6][1] = lo >>> 0; -function setupTimeout (onConnectTimeout, timeout) { - if (!timeout) { - return () => {} - } + lo = s[7][1] + h_lo; + s[7][0] = (s[7][0] + h_hi + ((lo / 0x100000000) >>> 0)) >>> 0; + s[7][1] = lo >>> 0; - let s1 = null - let s2 = null - const timeoutId = setTimeout(() => { - // setImmediate is added to make sure that we priotorise socket error events over timeouts - s1 = setImmediate(() => { - if (process.platform === 'win32') { - // Windows needs an extra setImmediate probably due to implementation differences in the socket logic - s2 = setImmediate(() => onConnectTimeout()) - } else { - onConnectTimeout() - } - }) - }, timeout) - return () => { - clearTimeout(timeoutId) - clearImmediate(s1) - clearImmediate(s2) + len -= 128; } } -function onConnectTimeout (socket) { - util.destroy(socket, new ConnectTimeoutError()) -} - -module.exports = buildConnector - /***/ }), -/***/ 46339: -/***/ ((module) => { +/***/ 65138: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * Utility functions for web applications. + * + * @author Dave Longley + * + * Copyright (c) 2010-2018 Digital Bazaar, Inc. + */ +var forge = __nccwpck_require__(56389); +var baseN = __nccwpck_require__(31182); +/* Utilities API */ +var util = module.exports = forge.util = forge.util || {}; -class UndiciError extends Error { - constructor (message) { - super(message) - this.name = 'UndiciError' - this.code = 'UND_ERR' +// define setImmediate and nextTick +(function() { + // use native nextTick (unless we're in webpack) + // webpack (or better node-libs-browser polyfill) sets process.browser. + // this way we can detect webpack properly + if(typeof process !== 'undefined' && process.nextTick && !process.browser) { + util.nextTick = process.nextTick; + if(typeof setImmediate === 'function') { + util.setImmediate = setImmediate; + } else { + // polyfill setImmediate with nextTick, older versions of node + // (those w/o setImmediate) won't totally starve IO + util.setImmediate = util.nextTick; + } + return; } -} -class ConnectTimeoutError extends UndiciError { - constructor (message) { - super(message) - Error.captureStackTrace(this, ConnectTimeoutError) - this.name = 'ConnectTimeoutError' - this.message = message || 'Connect Timeout Error' - this.code = 'UND_ERR_CONNECT_TIMEOUT' + // polyfill nextTick with native setImmediate + if(typeof setImmediate === 'function') { + util.setImmediate = function() { return setImmediate.apply(undefined, arguments); }; + util.nextTick = function(callback) { + return setImmediate(callback); + }; + return; } -} -class HeadersTimeoutError extends UndiciError { - constructor (message) { - super(message) - Error.captureStackTrace(this, HeadersTimeoutError) - this.name = 'HeadersTimeoutError' - this.message = message || 'Headers Timeout Error' - this.code = 'UND_ERR_HEADERS_TIMEOUT' - } -} + /* Note: A polyfill upgrade pattern is used here to allow combining + polyfills. For example, MutationObserver is fast, but blocks UI updates, + so it needs to allow UI updates periodically, so it falls back on + postMessage or setTimeout. */ -class HeadersOverflowError extends UndiciError { - constructor (message) { - super(message) - Error.captureStackTrace(this, HeadersOverflowError) - this.name = 'HeadersOverflowError' - this.message = message || 'Headers Overflow Error' - this.code = 'UND_ERR_HEADERS_OVERFLOW' - } -} + // polyfill with setTimeout + util.setImmediate = function(callback) { + setTimeout(callback, 0); + }; -class BodyTimeoutError extends UndiciError { - constructor (message) { - super(message) - Error.captureStackTrace(this, BodyTimeoutError) - this.name = 'BodyTimeoutError' - this.message = message || 'Body Timeout Error' - this.code = 'UND_ERR_BODY_TIMEOUT' + // upgrade polyfill to use postMessage + if(typeof window !== 'undefined' && + typeof window.postMessage === 'function') { + var msg = 'forge.setImmediate'; + var callbacks = []; + util.setImmediate = function(callback) { + callbacks.push(callback); + // only send message when one hasn't been sent in + // the current turn of the event loop + if(callbacks.length === 1) { + window.postMessage(msg, '*'); + } + }; + function handler(event) { + if(event.source === window && event.data === msg) { + event.stopPropagation(); + var copy = callbacks.slice(); + callbacks.length = 0; + copy.forEach(function(callback) { + callback(); + }); + } + } + window.addEventListener('message', handler, true); } -} -class ResponseStatusCodeError extends UndiciError { - constructor (message, statusCode, headers, body) { - super(message) - Error.captureStackTrace(this, ResponseStatusCodeError) - this.name = 'ResponseStatusCodeError' - this.message = message || 'Response Status Code Error' - this.code = 'UND_ERR_RESPONSE_STATUS_CODE' - this.body = body - this.status = statusCode - this.statusCode = statusCode - this.headers = headers + // upgrade polyfill to use MutationObserver + if(typeof MutationObserver !== 'undefined') { + // polyfill with MutationObserver + var now = Date.now(); + var attr = true; + var div = document.createElement('div'); + var callbacks = []; + new MutationObserver(function() { + var copy = callbacks.slice(); + callbacks.length = 0; + copy.forEach(function(callback) { + callback(); + }); + }).observe(div, {attributes: true}); + var oldSetImmediate = util.setImmediate; + util.setImmediate = function(callback) { + if(Date.now() - now > 15) { + now = Date.now(); + oldSetImmediate(callback); + } else { + callbacks.push(callback); + // only trigger observer when it hasn't been triggered in + // the current turn of the event loop + if(callbacks.length === 1) { + div.setAttribute('a', attr = !attr); + } + } + }; } -} -class InvalidArgumentError extends UndiciError { - constructor (message) { - super(message) - Error.captureStackTrace(this, InvalidArgumentError) - this.name = 'InvalidArgumentError' - this.message = message || 'Invalid Argument Error' - this.code = 'UND_ERR_INVALID_ARG' - } -} + util.nextTick = util.setImmediate; +})(); -class InvalidReturnValueError extends UndiciError { - constructor (message) { - super(message) - Error.captureStackTrace(this, InvalidReturnValueError) - this.name = 'InvalidReturnValueError' - this.message = message || 'Invalid Return Value Error' - this.code = 'UND_ERR_INVALID_RETURN_VALUE' - } -} +// check if running under Node.js +util.isNodejs = + typeof process !== 'undefined' && process.versions && process.versions.node; -class RequestAbortedError extends UndiciError { - constructor (message) { - super(message) - Error.captureStackTrace(this, RequestAbortedError) - this.name = 'AbortError' - this.message = message || 'Request aborted' - this.code = 'UND_ERR_ABORTED' - } -} -class InformationalError extends UndiciError { - constructor (message) { - super(message) - Error.captureStackTrace(this, InformationalError) - this.name = 'InformationalError' - this.message = message || 'Request information' - this.code = 'UND_ERR_INFO' +// 'self' will also work in Web Workers (instance of WorkerGlobalScope) while +// it will point to `window` in the main thread. +// To remain compatible with older browsers, we fall back to 'window' if 'self' +// is not available. +util.globalScope = (function() { + if(util.isNodejs) { + return global; } -} -class RequestContentLengthMismatchError extends UndiciError { - constructor (message) { - super(message) - Error.captureStackTrace(this, RequestContentLengthMismatchError) - this.name = 'RequestContentLengthMismatchError' - this.message = message || 'Request body length does not match content-length header' - this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH' - } -} + return typeof self === 'undefined' ? window : self; +})(); -class ResponseContentLengthMismatchError extends UndiciError { - constructor (message) { - super(message) - Error.captureStackTrace(this, ResponseContentLengthMismatchError) - this.name = 'ResponseContentLengthMismatchError' - this.message = message || 'Response body length does not match content-length header' - this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH' - } -} +// define isArray +util.isArray = Array.isArray || function(x) { + return Object.prototype.toString.call(x) === '[object Array]'; +}; -class ClientDestroyedError extends UndiciError { - constructor (message) { - super(message) - Error.captureStackTrace(this, ClientDestroyedError) - this.name = 'ClientDestroyedError' - this.message = message || 'The client is destroyed' - this.code = 'UND_ERR_DESTROYED' - } -} +// define isArrayBuffer +util.isArrayBuffer = function(x) { + return typeof ArrayBuffer !== 'undefined' && x instanceof ArrayBuffer; +}; -class ClientClosedError extends UndiciError { - constructor (message) { - super(message) - Error.captureStackTrace(this, ClientClosedError) - this.name = 'ClientClosedError' - this.message = message || 'The client is closed' - this.code = 'UND_ERR_CLOSED' - } -} +// define isArrayBufferView +util.isArrayBufferView = function(x) { + return x && util.isArrayBuffer(x.buffer) && x.byteLength !== undefined; +}; -class SocketError extends UndiciError { - constructor (message, socket) { - super(message) - Error.captureStackTrace(this, SocketError) - this.name = 'SocketError' - this.message = message || 'Socket error' - this.code = 'UND_ERR_SOCKET' - this.socket = socket +/** + * Ensure a bits param is 8, 16, 24, or 32. Used to validate input for + * algorithms where bit manipulation, JavaScript limitations, and/or algorithm + * design only allow for byte operations of a limited size. + * + * @param n number of bits. + * + * Throw Error if n invalid. + */ +function _checkBitsParam(n) { + if(!(n === 8 || n === 16 || n === 24 || n === 32)) { + throw new Error('Only 8, 16, 24, or 32 bits supported: ' + n); } } -class NotSupportedError extends UndiciError { - constructor (message) { - super(message) - Error.captureStackTrace(this, NotSupportedError) - this.name = 'NotSupportedError' - this.message = message || 'Not supported error' - this.code = 'UND_ERR_NOT_SUPPORTED' - } -} +// TODO: set ByteBuffer to best available backing +util.ByteBuffer = ByteStringBuffer; -class BalancedPoolMissingUpstreamError extends UndiciError { - constructor (message) { - super(message) - Error.captureStackTrace(this, NotSupportedError) - this.name = 'MissingUpstreamError' - this.message = message || 'No upstream has been added to the BalancedPool' - this.code = 'UND_ERR_BPL_MISSING_UPSTREAM' - } -} +/** Buffer w/BinaryString backing */ -class HTTPParserError extends Error { - constructor (message, code, data) { - super(message) - Error.captureStackTrace(this, HTTPParserError) - this.name = 'HTTPParserError' - this.code = code ? `HPE_${code}` : undefined - this.data = data ? data.toString() : undefined - } -} +/** + * Constructor for a binary string backed byte buffer. + * + * @param [b] the bytes to wrap (either encoded as string, one byte per + * character, or as an ArrayBuffer or Typed Array). + */ +function ByteStringBuffer(b) { + // TODO: update to match DataBuffer API -class ResponseExceededMaxSizeError extends UndiciError { - constructor (message) { - super(message) - Error.captureStackTrace(this, ResponseExceededMaxSizeError) - this.name = 'ResponseExceededMaxSizeError' - this.message = message || 'Response content exceeded max size' - this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE' - } -} + // the data in this buffer + this.data = ''; + // the pointer for reading from this buffer + this.read = 0; -class RequestRetryError extends UndiciError { - constructor (message, code, { headers, data }) { - super(message) - Error.captureStackTrace(this, RequestRetryError) - this.name = 'RequestRetryError' - this.message = message || 'Request retry error' - this.code = 'UND_ERR_REQ_RETRY' - this.statusCode = code - this.data = data - this.headers = headers + if(typeof b === 'string') { + this.data = b; + } else if(util.isArrayBuffer(b) || util.isArrayBufferView(b)) { + if(typeof Buffer !== 'undefined' && b instanceof Buffer) { + this.data = b.toString('binary'); + } else { + // convert native buffer to forge buffer + // FIXME: support native buffers internally instead + var arr = new Uint8Array(b); + try { + this.data = String.fromCharCode.apply(null, arr); + } catch(e) { + for(var i = 0; i < arr.length; ++i) { + this.putByte(arr[i]); + } + } + } + } else if(b instanceof ByteStringBuffer || + (typeof b === 'object' && typeof b.data === 'string' && + typeof b.read === 'number')) { + // copy existing buffer + this.data = b.data; + this.read = b.read; } -} -module.exports = { - HTTPParserError, - UndiciError, - HeadersTimeoutError, - HeadersOverflowError, - BodyTimeoutError, - RequestContentLengthMismatchError, - ConnectTimeoutError, - ResponseStatusCodeError, - InvalidArgumentError, - InvalidReturnValueError, - RequestAbortedError, - ClientDestroyedError, - ClientClosedError, - InformationalError, - SocketError, - NotSupportedError, - ResponseContentLengthMismatchError, - BalancedPoolMissingUpstreamError, - ResponseExceededMaxSizeError, - RequestRetryError + // used for v8 optimization + this._constructedStringLength = 0; } +util.ByteStringBuffer = ByteStringBuffer; - -/***/ }), - -/***/ 38325: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - - -const { - InvalidArgumentError, - NotSupportedError -} = __nccwpck_require__(46339) -const assert = __nccwpck_require__(39491) -const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(48039) -const util = __nccwpck_require__(67468) - -// tokenRegExp and headerCharRegex have been lifted from -// https://github.com/nodejs/node/blob/main/lib/_http_common.js +/* Note: This is an optimization for V8-based browsers. When V8 concatenates + a string, the strings are only joined logically using a "cons string" or + "constructed/concatenated string". These containers keep references to one + another and can result in very large memory usage. For example, if a 2MB + string is constructed by concatenating 4 bytes together at a time, the + memory usage will be ~44MB; so ~22x increase. The strings are only joined + together when an operation requiring their joining takes place, such as + substr(). This function is called when adding data to this buffer to ensure + these types of strings are periodically joined to reduce the memory + footprint. */ +var _MAX_CONSTRUCTED_STRING_LENGTH = 4096; +util.ByteStringBuffer.prototype._optimizeConstructedString = function(x) { + this._constructedStringLength += x; + if(this._constructedStringLength > _MAX_CONSTRUCTED_STRING_LENGTH) { + // this substr() should cause the constructed string to join + this.data.substr(0, 1); + this._constructedStringLength = 0; + } +}; /** - * Verifies that the given val is a valid HTTP token - * per the rules defined in RFC 7230 - * See https://tools.ietf.org/html/rfc7230#section-3.2.6 + * Gets the number of bytes in this buffer. + * + * @return the number of bytes in this buffer. */ -const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/ +util.ByteStringBuffer.prototype.length = function() { + return this.data.length - this.read; +}; /** - * Matches if val contains an invalid field-vchar - * field-value = *( field-content / obs-fold ) - * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] - * field-vchar = VCHAR / obs-text + * Gets whether or not this buffer is empty. + * + * @return true if this buffer is empty, false if not. */ -const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/ - -// Verifies that a given path is valid does not contain control chars \x00 to \x20 -const invalidPathRegex = /[^\u0021-\u00ff]/ - -const kHandler = Symbol('handler') - -const channels = {} - -let extractBody - -try { - const diagnosticsChannel = __nccwpck_require__(67643) - channels.create = diagnosticsChannel.channel('undici:request:create') - channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent') - channels.headers = diagnosticsChannel.channel('undici:request:headers') - channels.trailers = diagnosticsChannel.channel('undici:request:trailers') - channels.error = diagnosticsChannel.channel('undici:request:error') -} catch { - channels.create = { hasSubscribers: false } - channels.bodySent = { hasSubscribers: false } - channels.headers = { hasSubscribers: false } - channels.trailers = { hasSubscribers: false } - channels.error = { hasSubscribers: false } -} - -class Request { - constructor (origin, { - path, - method, - body, - headers, - query, - idempotent, - blocking, - upgrade, - headersTimeout, - bodyTimeout, - reset, - throwOnError, - expectContinue - }, handler) { - if (typeof path !== 'string') { - throw new InvalidArgumentError('path must be a string') - } else if ( - path[0] !== '/' && - !(path.startsWith('http://') || path.startsWith('https://')) && - method !== 'CONNECT' - ) { - throw new InvalidArgumentError('path must be an absolute URL or start with a slash') - } else if (invalidPathRegex.exec(path) !== null) { - throw new InvalidArgumentError('invalid request path') - } - - if (typeof method !== 'string') { - throw new InvalidArgumentError('method must be a string') - } else if (tokenRegExp.exec(method) === null) { - throw new InvalidArgumentError('invalid request method') - } - - if (upgrade && typeof upgrade !== 'string') { - throw new InvalidArgumentError('upgrade must be a string') - } - - if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) { - throw new InvalidArgumentError('invalid headersTimeout') - } - - if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) { - throw new InvalidArgumentError('invalid bodyTimeout') - } +util.ByteStringBuffer.prototype.isEmpty = function() { + return this.length() <= 0; +}; - if (reset != null && typeof reset !== 'boolean') { - throw new InvalidArgumentError('invalid reset') - } +/** + * Puts a byte in this buffer. + * + * @param b the byte to put. + * + * @return this buffer. + */ +util.ByteStringBuffer.prototype.putByte = function(b) { + return this.putBytes(String.fromCharCode(b)); +}; - if (expectContinue != null && typeof expectContinue !== 'boolean') { - throw new InvalidArgumentError('invalid expectContinue') +/** + * Puts a byte in this buffer N times. + * + * @param b the byte to put. + * @param n the number of bytes of value b to put. + * + * @return this buffer. + */ +util.ByteStringBuffer.prototype.fillWithByte = function(b, n) { + b = String.fromCharCode(b); + var d = this.data; + while(n > 0) { + if(n & 1) { + d += b; } - - this.headersTimeout = headersTimeout - - this.bodyTimeout = bodyTimeout - - this.throwOnError = throwOnError === true - - this.method = method - - this.abort = null - - if (body == null) { - this.body = null - } else if (util.isStream(body)) { - this.body = body - - const rState = this.body._readableState - if (!rState || !rState.autoDestroy) { - this.endHandler = function autoDestroy () { - util.destroy(this) - } - this.body.on('end', this.endHandler) - } - - this.errorHandler = err => { - if (this.abort) { - this.abort(err) - } else { - this.error = err - } - } - this.body.on('error', this.errorHandler) - } else if (util.isBuffer(body)) { - this.body = body.byteLength ? body : null - } else if (ArrayBuffer.isView(body)) { - this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null - } else if (body instanceof ArrayBuffer) { - this.body = body.byteLength ? Buffer.from(body) : null - } else if (typeof body === 'string') { - this.body = body.length ? Buffer.from(body) : null - } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) { - this.body = body - } else { - throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable') + n >>>= 1; + if(n > 0) { + b += b; } + } + this.data = d; + this._optimizeConstructedString(n); + return this; +}; - this.completed = false - - this.aborted = false - - this.upgrade = upgrade || null - - this.path = query ? util.buildURL(path, query) : path - - this.origin = origin - - this.idempotent = idempotent == null - ? method === 'HEAD' || method === 'GET' - : idempotent - - this.blocking = blocking == null ? false : blocking - - this.reset = reset == null ? null : reset +/** + * Puts bytes in this buffer. + * + * @param bytes the bytes (as a binary encoded string) to put. + * + * @return this buffer. + */ +util.ByteStringBuffer.prototype.putBytes = function(bytes) { + this.data += bytes; + this._optimizeConstructedString(bytes.length); + return this; +}; - this.host = null +/** + * Puts a UTF-16 encoded string into this buffer. + * + * @param str the string to put. + * + * @return this buffer. + */ +util.ByteStringBuffer.prototype.putString = function(str) { + return this.putBytes(util.encodeUtf8(str)); +}; - this.contentLength = null +/** + * Puts a 16-bit integer in this buffer in big-endian order. + * + * @param i the 16-bit integer. + * + * @return this buffer. + */ +util.ByteStringBuffer.prototype.putInt16 = function(i) { + return this.putBytes( + String.fromCharCode(i >> 8 & 0xFF) + + String.fromCharCode(i & 0xFF)); +}; - this.contentType = null +/** + * Puts a 24-bit integer in this buffer in big-endian order. + * + * @param i the 24-bit integer. + * + * @return this buffer. + */ +util.ByteStringBuffer.prototype.putInt24 = function(i) { + return this.putBytes( + String.fromCharCode(i >> 16 & 0xFF) + + String.fromCharCode(i >> 8 & 0xFF) + + String.fromCharCode(i & 0xFF)); +}; - this.headers = '' +/** + * Puts a 32-bit integer in this buffer in big-endian order. + * + * @param i the 32-bit integer. + * + * @return this buffer. + */ +util.ByteStringBuffer.prototype.putInt32 = function(i) { + return this.putBytes( + String.fromCharCode(i >> 24 & 0xFF) + + String.fromCharCode(i >> 16 & 0xFF) + + String.fromCharCode(i >> 8 & 0xFF) + + String.fromCharCode(i & 0xFF)); +}; - // Only for H2 - this.expectContinue = expectContinue != null ? expectContinue : false +/** + * Puts a 16-bit integer in this buffer in little-endian order. + * + * @param i the 16-bit integer. + * + * @return this buffer. + */ +util.ByteStringBuffer.prototype.putInt16Le = function(i) { + return this.putBytes( + String.fromCharCode(i & 0xFF) + + String.fromCharCode(i >> 8 & 0xFF)); +}; - if (Array.isArray(headers)) { - if (headers.length % 2 !== 0) { - throw new InvalidArgumentError('headers array must be even') - } - for (let i = 0; i < headers.length; i += 2) { - processHeader(this, headers[i], headers[i + 1]) - } - } else if (headers && typeof headers === 'object') { - const keys = Object.keys(headers) - for (let i = 0; i < keys.length; i++) { - const key = keys[i] - processHeader(this, key, headers[key]) - } - } else if (headers != null) { - throw new InvalidArgumentError('headers must be an object or an array') - } +/** + * Puts a 24-bit integer in this buffer in little-endian order. + * + * @param i the 24-bit integer. + * + * @return this buffer. + */ +util.ByteStringBuffer.prototype.putInt24Le = function(i) { + return this.putBytes( + String.fromCharCode(i & 0xFF) + + String.fromCharCode(i >> 8 & 0xFF) + + String.fromCharCode(i >> 16 & 0xFF)); +}; - if (util.isFormDataLike(this.body)) { - if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) { - throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.') - } +/** + * Puts a 32-bit integer in this buffer in little-endian order. + * + * @param i the 32-bit integer. + * + * @return this buffer. + */ +util.ByteStringBuffer.prototype.putInt32Le = function(i) { + return this.putBytes( + String.fromCharCode(i & 0xFF) + + String.fromCharCode(i >> 8 & 0xFF) + + String.fromCharCode(i >> 16 & 0xFF) + + String.fromCharCode(i >> 24 & 0xFF)); +}; - if (!extractBody) { - extractBody = (__nccwpck_require__(62494).extractBody) - } +/** + * Puts an n-bit integer in this buffer in big-endian order. + * + * @param i the n-bit integer. + * @param n the number of bits in the integer (8, 16, 24, or 32). + * + * @return this buffer. + */ +util.ByteStringBuffer.prototype.putInt = function(i, n) { + _checkBitsParam(n); + var bytes = ''; + do { + n -= 8; + bytes += String.fromCharCode((i >> n) & 0xFF); + } while(n > 0); + return this.putBytes(bytes); +}; - const [bodyStream, contentType] = extractBody(body) - if (this.contentType == null) { - this.contentType = contentType - this.headers += `content-type: ${contentType}\r\n` - } - this.body = bodyStream.stream - this.contentLength = bodyStream.length - } else if (util.isBlobLike(body) && this.contentType == null && body.type) { - this.contentType = body.type - this.headers += `content-type: ${body.type}\r\n` - } +/** + * Puts a signed n-bit integer in this buffer in big-endian order. Two's + * complement representation is used. + * + * @param i the n-bit integer. + * @param n the number of bits in the integer (8, 16, 24, or 32). + * + * @return this buffer. + */ +util.ByteStringBuffer.prototype.putSignedInt = function(i, n) { + // putInt checks n + if(i < 0) { + i += 2 << (n - 1); + } + return this.putInt(i, n); +}; - util.validateHandler(handler, method, upgrade) +/** + * Puts the given buffer into this buffer. + * + * @param buffer the buffer to put into this one. + * + * @return this buffer. + */ +util.ByteStringBuffer.prototype.putBuffer = function(buffer) { + return this.putBytes(buffer.getBytes()); +}; - this.servername = util.getServerName(this.host) +/** + * Gets a byte from this buffer and advances the read pointer by 1. + * + * @return the byte. + */ +util.ByteStringBuffer.prototype.getByte = function() { + return this.data.charCodeAt(this.read++); +}; - this[kHandler] = handler +/** + * Gets a uint16 from this buffer in big-endian order and advances the read + * pointer by 2. + * + * @return the uint16. + */ +util.ByteStringBuffer.prototype.getInt16 = function() { + var rval = ( + this.data.charCodeAt(this.read) << 8 ^ + this.data.charCodeAt(this.read + 1)); + this.read += 2; + return rval; +}; - if (channels.create.hasSubscribers) { - channels.create.publish({ request: this }) - } - } +/** + * Gets a uint24 from this buffer in big-endian order and advances the read + * pointer by 3. + * + * @return the uint24. + */ +util.ByteStringBuffer.prototype.getInt24 = function() { + var rval = ( + this.data.charCodeAt(this.read) << 16 ^ + this.data.charCodeAt(this.read + 1) << 8 ^ + this.data.charCodeAt(this.read + 2)); + this.read += 3; + return rval; +}; - onBodySent (chunk) { - if (this[kHandler].onBodySent) { - try { - return this[kHandler].onBodySent(chunk) - } catch (err) { - this.abort(err) - } - } - } +/** + * Gets a uint32 from this buffer in big-endian order and advances the read + * pointer by 4. + * + * @return the word. + */ +util.ByteStringBuffer.prototype.getInt32 = function() { + var rval = ( + this.data.charCodeAt(this.read) << 24 ^ + this.data.charCodeAt(this.read + 1) << 16 ^ + this.data.charCodeAt(this.read + 2) << 8 ^ + this.data.charCodeAt(this.read + 3)); + this.read += 4; + return rval; +}; - onRequestSent () { - if (channels.bodySent.hasSubscribers) { - channels.bodySent.publish({ request: this }) - } +/** + * Gets a uint16 from this buffer in little-endian order and advances the read + * pointer by 2. + * + * @return the uint16. + */ +util.ByteStringBuffer.prototype.getInt16Le = function() { + var rval = ( + this.data.charCodeAt(this.read) ^ + this.data.charCodeAt(this.read + 1) << 8); + this.read += 2; + return rval; +}; - if (this[kHandler].onRequestSent) { - try { - return this[kHandler].onRequestSent() - } catch (err) { - this.abort(err) - } - } - } +/** + * Gets a uint24 from this buffer in little-endian order and advances the read + * pointer by 3. + * + * @return the uint24. + */ +util.ByteStringBuffer.prototype.getInt24Le = function() { + var rval = ( + this.data.charCodeAt(this.read) ^ + this.data.charCodeAt(this.read + 1) << 8 ^ + this.data.charCodeAt(this.read + 2) << 16); + this.read += 3; + return rval; +}; - onConnect (abort) { - assert(!this.aborted) - assert(!this.completed) +/** + * Gets a uint32 from this buffer in little-endian order and advances the read + * pointer by 4. + * + * @return the word. + */ +util.ByteStringBuffer.prototype.getInt32Le = function() { + var rval = ( + this.data.charCodeAt(this.read) ^ + this.data.charCodeAt(this.read + 1) << 8 ^ + this.data.charCodeAt(this.read + 2) << 16 ^ + this.data.charCodeAt(this.read + 3) << 24); + this.read += 4; + return rval; +}; - if (this.error) { - abort(this.error) - } else { - this.abort = abort - return this[kHandler].onConnect(abort) - } +/** + * Gets an n-bit integer from this buffer in big-endian order and advances the + * read pointer by ceil(n/8). + * + * @param n the number of bits in the integer (8, 16, 24, or 32). + * + * @return the integer. + */ +util.ByteStringBuffer.prototype.getInt = function(n) { + _checkBitsParam(n); + var rval = 0; + do { + // TODO: Use (rval * 0x100) if adding support for 33 to 53 bits. + rval = (rval << 8) + this.data.charCodeAt(this.read++); + n -= 8; + } while(n > 0); + return rval; +}; + +/** + * Gets a signed n-bit integer from this buffer in big-endian order, using + * two's complement, and advances the read pointer by n/8. + * + * @param n the number of bits in the integer (8, 16, 24, or 32). + * + * @return the integer. + */ +util.ByteStringBuffer.prototype.getSignedInt = function(n) { + // getInt checks n + var x = this.getInt(n); + var max = 2 << (n - 2); + if(x >= max) { + x -= max << 1; } + return x; +}; - onHeaders (statusCode, headers, resume, statusText) { - assert(!this.aborted) - assert(!this.completed) +/** + * Reads bytes out as a binary encoded string and clears them from the + * buffer. Note that the resulting string is binary encoded (in node.js this + * encoding is referred to as `binary`, it is *not* `utf8`). + * + * @param count the number of bytes to read, undefined or null for all. + * + * @return a binary encoded string of bytes. + */ +util.ByteStringBuffer.prototype.getBytes = function(count) { + var rval; + if(count) { + // read count bytes + count = Math.min(this.length(), count); + rval = this.data.slice(this.read, this.read + count); + this.read += count; + } else if(count === 0) { + rval = ''; + } else { + // read all bytes, optimize to only copy when needed + rval = (this.read === 0) ? this.data : this.data.slice(this.read); + this.clear(); + } + return rval; +}; - if (channels.headers.hasSubscribers) { - channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }) - } +/** + * Gets a binary encoded string of the bytes from this buffer without + * modifying the read pointer. + * + * @param count the number of bytes to get, omit to get all. + * + * @return a string full of binary encoded characters. + */ +util.ByteStringBuffer.prototype.bytes = function(count) { + return (typeof(count) === 'undefined' ? + this.data.slice(this.read) : + this.data.slice(this.read, this.read + count)); +}; - try { - return this[kHandler].onHeaders(statusCode, headers, resume, statusText) - } catch (err) { - this.abort(err) - } - } +/** + * Gets a byte at the given index without modifying the read pointer. + * + * @param i the byte index. + * + * @return the byte. + */ +util.ByteStringBuffer.prototype.at = function(i) { + return this.data.charCodeAt(this.read + i); +}; - onData (chunk) { - assert(!this.aborted) - assert(!this.completed) +/** + * Puts a byte at the given index without modifying the read pointer. + * + * @param i the byte index. + * @param b the byte to put. + * + * @return this buffer. + */ +util.ByteStringBuffer.prototype.setAt = function(i, b) { + this.data = this.data.substr(0, this.read + i) + + String.fromCharCode(b) + + this.data.substr(this.read + i + 1); + return this; +}; - try { - return this[kHandler].onData(chunk) - } catch (err) { - this.abort(err) - return false - } - } +/** + * Gets the last byte without modifying the read pointer. + * + * @return the last byte. + */ +util.ByteStringBuffer.prototype.last = function() { + return this.data.charCodeAt(this.data.length - 1); +}; - onUpgrade (statusCode, headers, socket) { - assert(!this.aborted) - assert(!this.completed) +/** + * Creates a copy of this buffer. + * + * @return the copy. + */ +util.ByteStringBuffer.prototype.copy = function() { + var c = util.createBuffer(this.data); + c.read = this.read; + return c; +}; - return this[kHandler].onUpgrade(statusCode, headers, socket) +/** + * Compacts this buffer. + * + * @return this buffer. + */ +util.ByteStringBuffer.prototype.compact = function() { + if(this.read > 0) { + this.data = this.data.slice(this.read); + this.read = 0; } + return this; +}; - onComplete (trailers) { - this.onFinally() - - assert(!this.aborted) +/** + * Clears this buffer. + * + * @return this buffer. + */ +util.ByteStringBuffer.prototype.clear = function() { + this.data = ''; + this.read = 0; + return this; +}; - this.completed = true - if (channels.trailers.hasSubscribers) { - channels.trailers.publish({ request: this, trailers }) - } +/** + * Shortens this buffer by triming bytes off of the end of this buffer. + * + * @param count the number of bytes to trim off. + * + * @return this buffer. + */ +util.ByteStringBuffer.prototype.truncate = function(count) { + var len = Math.max(0, this.length() - count); + this.data = this.data.substr(this.read, len); + this.read = 0; + return this; +}; - try { - return this[kHandler].onComplete(trailers) - } catch (err) { - // TODO (fix): This might be a bad idea? - this.onError(err) +/** + * Converts this buffer to a hexadecimal string. + * + * @return a hexadecimal string. + */ +util.ByteStringBuffer.prototype.toHex = function() { + var rval = ''; + for(var i = this.read; i < this.data.length; ++i) { + var b = this.data.charCodeAt(i); + if(b < 16) { + rval += '0'; } + rval += b.toString(16); } + return rval; +}; - onError (error) { - this.onFinally() +/** + * Converts this buffer to a UTF-16 string (standard JavaScript string). + * + * @return a UTF-16 string. + */ +util.ByteStringBuffer.prototype.toString = function() { + return util.decodeUtf8(this.bytes()); +}; - if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error }) - } +/** End Buffer w/BinaryString backing */ - if (this.aborted) { - return - } - this.aborted = true +/** Buffer w/UInt8Array backing */ - return this[kHandler].onError(error) - } +/** + * FIXME: Experimental. Do not use yet. + * + * Constructor for an ArrayBuffer-backed byte buffer. + * + * The buffer may be constructed from a string, an ArrayBuffer, DataView, or a + * TypedArray. + * + * If a string is given, its encoding should be provided as an option, + * otherwise it will default to 'binary'. A 'binary' string is encoded such + * that each character is one byte in length and size. + * + * If an ArrayBuffer, DataView, or TypedArray is given, it will be used + * *directly* without any copying. Note that, if a write to the buffer requires + * more space, the buffer will allocate a new backing ArrayBuffer to + * accommodate. The starting read and write offsets for the buffer may be + * given as options. + * + * @param [b] the initial bytes for this buffer. + * @param options the options to use: + * [readOffset] the starting read offset to use (default: 0). + * [writeOffset] the starting write offset to use (default: the + * length of the first parameter). + * [growSize] the minimum amount, in bytes, to grow the buffer by to + * accommodate writes (default: 1024). + * [encoding] the encoding ('binary', 'utf8', 'utf16', 'hex') for the + * first parameter, if it is a string (default: 'binary'). + */ +function DataBuffer(b, options) { + // default options + options = options || {}; - onFinally () { - if (this.errorHandler) { - this.body.off('error', this.errorHandler) - this.errorHandler = null - } + // pointers for read from/write to buffer + this.read = options.readOffset || 0; + this.growSize = options.growSize || 1024; - if (this.endHandler) { - this.body.off('end', this.endHandler) - this.endHandler = null + var isArrayBuffer = util.isArrayBuffer(b); + var isArrayBufferView = util.isArrayBufferView(b); + if(isArrayBuffer || isArrayBufferView) { + // use ArrayBuffer directly + if(isArrayBuffer) { + this.data = new DataView(b); + } else { + // TODO: adjust read/write offset based on the type of view + // or specify that this must be done in the options ... that the + // offsets are byte-based + this.data = new DataView(b.buffer, b.byteOffset, b.byteLength); } + this.write = ('writeOffset' in options ? + options.writeOffset : this.data.byteLength); + return; } - // TODO: adjust to support H2 - addHeader (key, value) { - processHeader(this, key, value) - return this - } + // initialize to empty array buffer and add any given bytes using putBytes + this.data = new DataView(new ArrayBuffer(0)); + this.write = 0; - static [kHTTP1BuildRequest] (origin, opts, handler) { - // TODO: Migrate header parsing here, to make Requests - // HTTP agnostic - return new Request(origin, opts, handler) + if(b !== null && b !== undefined) { + this.putBytes(b); } - static [kHTTP2BuildRequest] (origin, opts, handler) { - const headers = opts.headers - opts = { ...opts, headers: null } - - const request = new Request(origin, opts, handler) + if('writeOffset' in options) { + this.write = options.writeOffset; + } +} +util.DataBuffer = DataBuffer; - request.headers = {} +/** + * Gets the number of bytes in this buffer. + * + * @return the number of bytes in this buffer. + */ +util.DataBuffer.prototype.length = function() { + return this.write - this.read; +}; - if (Array.isArray(headers)) { - if (headers.length % 2 !== 0) { - throw new InvalidArgumentError('headers array must be even') - } - for (let i = 0; i < headers.length; i += 2) { - processHeader(request, headers[i], headers[i + 1], true) - } - } else if (headers && typeof headers === 'object') { - const keys = Object.keys(headers) - for (let i = 0; i < keys.length; i++) { - const key = keys[i] - processHeader(request, key, headers[key], true) - } - } else if (headers != null) { - throw new InvalidArgumentError('headers must be an object or an array') - } +/** + * Gets whether or not this buffer is empty. + * + * @return true if this buffer is empty, false if not. + */ +util.DataBuffer.prototype.isEmpty = function() { + return this.length() <= 0; +}; - return request +/** + * Ensures this buffer has enough empty space to accommodate the given number + * of bytes. An optional parameter may be given that indicates a minimum + * amount to grow the buffer if necessary. If the parameter is not given, + * the buffer will be grown by some previously-specified default amount + * or heuristic. + * + * @param amount the number of bytes to accommodate. + * @param [growSize] the minimum amount, in bytes, to grow the buffer by if + * necessary. + */ +util.DataBuffer.prototype.accommodate = function(amount, growSize) { + if(this.length() >= amount) { + return this; } + growSize = Math.max(growSize || this.growSize, amount); - static [kHTTP2CopyHeaders] (raw) { - const rawHeaders = raw.split('\r\n') - const headers = {} - - for (const header of rawHeaders) { - const [key, value] = header.split(': ') + // grow buffer + var src = new Uint8Array( + this.data.buffer, this.data.byteOffset, this.data.byteLength); + var dst = new Uint8Array(this.length() + growSize); + dst.set(src); + this.data = new DataView(dst.buffer); - if (value == null || value.length === 0) continue + return this; +}; - if (headers[key]) headers[key] += `,${value}` - else headers[key] = value - } +/** + * Puts a byte in this buffer. + * + * @param b the byte to put. + * + * @return this buffer. + */ +util.DataBuffer.prototype.putByte = function(b) { + this.accommodate(1); + this.data.setUint8(this.write++, b); + return this; +}; - return headers +/** + * Puts a byte in this buffer N times. + * + * @param b the byte to put. + * @param n the number of bytes of value b to put. + * + * @return this buffer. + */ +util.DataBuffer.prototype.fillWithByte = function(b, n) { + this.accommodate(n); + for(var i = 0; i < n; ++i) { + this.data.setUint8(b); } -} + return this; +}; -function processHeaderValue (key, val, skipAppend) { - if (val && typeof val === 'object') { - throw new InvalidArgumentError(`invalid ${key} header`) +/** + * Puts bytes in this buffer. The bytes may be given as a string, an + * ArrayBuffer, a DataView, or a TypedArray. + * + * @param bytes the bytes to put. + * @param [encoding] the encoding for the first parameter ('binary', 'utf8', + * 'utf16', 'hex'), if it is a string (default: 'binary'). + * + * @return this buffer. + */ +util.DataBuffer.prototype.putBytes = function(bytes, encoding) { + if(util.isArrayBufferView(bytes)) { + var src = new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.byteLength); + var len = src.byteLength - src.byteOffset; + this.accommodate(len); + var dst = new Uint8Array(this.data.buffer, this.write); + dst.set(src); + this.write += len; + return this; } - val = val != null ? `${val}` : '' - - if (headerCharRegex.exec(val) !== null) { - throw new InvalidArgumentError(`invalid ${key} header`) + if(util.isArrayBuffer(bytes)) { + var src = new Uint8Array(bytes); + this.accommodate(src.byteLength); + var dst = new Uint8Array(this.data.buffer); + dst.set(src, this.write); + this.write += src.byteLength; + return this; } - return skipAppend ? val : `${key}: ${val}\r\n` -} + // bytes is a util.DataBuffer or equivalent + if(bytes instanceof util.DataBuffer || + (typeof bytes === 'object' && + typeof bytes.read === 'number' && typeof bytes.write === 'number' && + util.isArrayBufferView(bytes.data))) { + var src = new Uint8Array(bytes.data.byteLength, bytes.read, bytes.length()); + this.accommodate(src.byteLength); + var dst = new Uint8Array(bytes.data.byteLength, this.write); + dst.set(src); + this.write += src.byteLength; + return this; + } -function processHeader (request, key, val, skipAppend = false) { - if (val && (typeof val === 'object' && !Array.isArray(val))) { - throw new InvalidArgumentError(`invalid ${key} header`) - } else if (val === undefined) { - return + if(bytes instanceof util.ByteStringBuffer) { + // copy binary string and process as the same as a string parameter below + bytes = bytes.data; + encoding = 'binary'; } - if ( - request.host === null && - key.length === 4 && - key.toLowerCase() === 'host' - ) { - if (headerCharRegex.exec(val) !== null) { - throw new InvalidArgumentError(`invalid ${key} header`) + // string conversion + encoding = encoding || 'binary'; + if(typeof bytes === 'string') { + var view; + + // decode from string + if(encoding === 'hex') { + this.accommodate(Math.ceil(bytes.length / 2)); + view = new Uint8Array(this.data.buffer, this.write); + this.write += util.binary.hex.decode(bytes, view, this.write); + return this; } - // Consumed by Client - request.host = val - } else if ( - request.contentLength === null && - key.length === 14 && - key.toLowerCase() === 'content-length' - ) { - request.contentLength = parseInt(val, 10) - if (!Number.isFinite(request.contentLength)) { - throw new InvalidArgumentError('invalid content-length header') + if(encoding === 'base64') { + this.accommodate(Math.ceil(bytes.length / 4) * 3); + view = new Uint8Array(this.data.buffer, this.write); + this.write += util.binary.base64.decode(bytes, view, this.write); + return this; } - } else if ( - request.contentType === null && - key.length === 12 && - key.toLowerCase() === 'content-type' - ) { - request.contentType = val - if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend) - else request.headers += processHeaderValue(key, val) - } else if ( - key.length === 17 && - key.toLowerCase() === 'transfer-encoding' - ) { - throw new InvalidArgumentError('invalid transfer-encoding header') - } else if ( - key.length === 10 && - key.toLowerCase() === 'connection' - ) { - const value = typeof val === 'string' ? val.toLowerCase() : null - if (value !== 'close' && value !== 'keep-alive') { - throw new InvalidArgumentError('invalid connection header') - } else if (value === 'close') { - request.reset = true + + // encode text as UTF-8 bytes + if(encoding === 'utf8') { + // encode as UTF-8 then decode string as raw binary + bytes = util.encodeUtf8(bytes); + encoding = 'binary'; } - } else if ( - key.length === 10 && - key.toLowerCase() === 'keep-alive' - ) { - throw new InvalidArgumentError('invalid keep-alive header') - } else if ( - key.length === 7 && - key.toLowerCase() === 'upgrade' - ) { - throw new InvalidArgumentError('invalid upgrade header') - } else if ( - key.length === 6 && - key.toLowerCase() === 'expect' - ) { - throw new NotSupportedError('expect header not supported') - } else if (tokenRegExp.exec(key) === null) { - throw new InvalidArgumentError('invalid header key') - } else { - if (Array.isArray(val)) { - for (let i = 0; i < val.length; i++) { - if (skipAppend) { - if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}` - else request.headers[key] = processHeaderValue(key, val[i], skipAppend) - } else { - request.headers += processHeaderValue(key, val[i]) - } - } - } else { - if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend) - else request.headers += processHeaderValue(key, val) + + // decode string as raw binary + if(encoding === 'binary' || encoding === 'raw') { + // one byte per character + this.accommodate(bytes.length); + view = new Uint8Array(this.data.buffer, this.write); + this.write += util.binary.raw.decode(view); + return this; } - } -} -module.exports = Request + // encode text as UTF-16 bytes + if(encoding === 'utf16') { + // two bytes per character + this.accommodate(bytes.length * 2); + view = new Uint16Array(this.data.buffer, this.write); + this.write += util.text.utf16.encode(view); + return this; + } + throw new Error('Invalid encoding: ' + encoding); + } -/***/ }), + throw Error('Invalid parameter: ' + bytes); +}; -/***/ 48039: -/***/ ((module) => { +/** + * Puts the given buffer into this buffer. + * + * @param buffer the buffer to put into this one. + * + * @return this buffer. + */ +util.DataBuffer.prototype.putBuffer = function(buffer) { + this.putBytes(buffer); + buffer.clear(); + return this; +}; -module.exports = { - kClose: Symbol('close'), - kDestroy: Symbol('destroy'), - kDispatch: Symbol('dispatch'), - kUrl: Symbol('url'), - kWriting: Symbol('writing'), - kResuming: Symbol('resuming'), - kQueue: Symbol('queue'), - kConnect: Symbol('connect'), - kConnecting: Symbol('connecting'), - kHeadersList: Symbol('headers list'), - kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'), - kKeepAliveMaxTimeout: Symbol('max keep alive timeout'), - kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'), - kKeepAliveTimeoutValue: Symbol('keep alive timeout'), - kKeepAlive: Symbol('keep alive'), - kHeadersTimeout: Symbol('headers timeout'), - kBodyTimeout: Symbol('body timeout'), - kServerName: Symbol('server name'), - kLocalAddress: Symbol('local address'), - kHost: Symbol('host'), - kNoRef: Symbol('no ref'), - kBodyUsed: Symbol('used'), - kRunning: Symbol('running'), - kBlocking: Symbol('blocking'), - kPending: Symbol('pending'), - kSize: Symbol('size'), - kBusy: Symbol('busy'), - kQueued: Symbol('queued'), - kFree: Symbol('free'), - kConnected: Symbol('connected'), - kClosed: Symbol('closed'), - kNeedDrain: Symbol('need drain'), - kReset: Symbol('reset'), - kDestroyed: Symbol.for('nodejs.stream.destroyed'), - kMaxHeadersSize: Symbol('max headers size'), - kRunningIdx: Symbol('running index'), - kPendingIdx: Symbol('pending index'), - kError: Symbol('error'), - kClients: Symbol('clients'), - kClient: Symbol('client'), - kParser: Symbol('parser'), - kOnDestroyed: Symbol('destroy callbacks'), - kPipelining: Symbol('pipelining'), - kSocket: Symbol('socket'), - kHostHeader: Symbol('host header'), - kConnector: Symbol('connector'), - kStrictContentLength: Symbol('strict content length'), - kMaxRedirections: Symbol('maxRedirections'), - kMaxRequests: Symbol('maxRequestsPerClient'), - kProxy: Symbol('proxy agent options'), - kCounter: Symbol('socket request counter'), - kInterceptors: Symbol('dispatch interceptors'), - kMaxResponseSize: Symbol('max response size'), - kHTTP2Session: Symbol('http2Session'), - kHTTP2SessionState: Symbol('http2Session state'), - kHTTP2BuildRequest: Symbol('http2 build request'), - kHTTP1BuildRequest: Symbol('http1 build request'), - kHTTP2CopyHeaders: Symbol('http2 copy headers'), - kHTTPConnVersion: Symbol('http connection version'), - kRetryHandlerDefaultRetry: Symbol('retry agent default retry'), - kConstruct: Symbol('constructable') -} +/** + * Puts a string into this buffer. + * + * @param str the string to put. + * @param [encoding] the encoding for the string (default: 'utf16'). + * + * @return this buffer. + */ +util.DataBuffer.prototype.putString = function(str) { + return this.putBytes(str, 'utf16'); +}; +/** + * Puts a 16-bit integer in this buffer in big-endian order. + * + * @param i the 16-bit integer. + * + * @return this buffer. + */ +util.DataBuffer.prototype.putInt16 = function(i) { + this.accommodate(2); + this.data.setInt16(this.write, i); + this.write += 2; + return this; +}; -/***/ }), +/** + * Puts a 24-bit integer in this buffer in big-endian order. + * + * @param i the 24-bit integer. + * + * @return this buffer. + */ +util.DataBuffer.prototype.putInt24 = function(i) { + this.accommodate(3); + this.data.setInt16(this.write, i >> 8 & 0xFFFF); + this.data.setInt8(this.write, i >> 16 & 0xFF); + this.write += 3; + return this; +}; -/***/ 67468: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * Puts a 32-bit integer in this buffer in big-endian order. + * + * @param i the 32-bit integer. + * + * @return this buffer. + */ +util.DataBuffer.prototype.putInt32 = function(i) { + this.accommodate(4); + this.data.setInt32(this.write, i); + this.write += 4; + return this; +}; +/** + * Puts a 16-bit integer in this buffer in little-endian order. + * + * @param i the 16-bit integer. + * + * @return this buffer. + */ +util.DataBuffer.prototype.putInt16Le = function(i) { + this.accommodate(2); + this.data.setInt16(this.write, i, true); + this.write += 2; + return this; +}; +/** + * Puts a 24-bit integer in this buffer in little-endian order. + * + * @param i the 24-bit integer. + * + * @return this buffer. + */ +util.DataBuffer.prototype.putInt24Le = function(i) { + this.accommodate(3); + this.data.setInt8(this.write, i >> 16 & 0xFF); + this.data.setInt16(this.write, i >> 8 & 0xFFFF, true); + this.write += 3; + return this; +}; -const assert = __nccwpck_require__(39491) -const { kDestroyed, kBodyUsed } = __nccwpck_require__(48039) -const { IncomingMessage } = __nccwpck_require__(13685) -const stream = __nccwpck_require__(12781) -const net = __nccwpck_require__(41808) -const { InvalidArgumentError } = __nccwpck_require__(46339) -const { Blob } = __nccwpck_require__(14300) -const nodeUtil = __nccwpck_require__(73837) -const { stringify } = __nccwpck_require__(63477) +/** + * Puts a 32-bit integer in this buffer in little-endian order. + * + * @param i the 32-bit integer. + * + * @return this buffer. + */ +util.DataBuffer.prototype.putInt32Le = function(i) { + this.accommodate(4); + this.data.setInt32(this.write, i, true); + this.write += 4; + return this; +}; -const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v)) +/** + * Puts an n-bit integer in this buffer in big-endian order. + * + * @param i the n-bit integer. + * @param n the number of bits in the integer (8, 16, 24, or 32). + * + * @return this buffer. + */ +util.DataBuffer.prototype.putInt = function(i, n) { + _checkBitsParam(n); + this.accommodate(n / 8); + do { + n -= 8; + this.data.setInt8(this.write++, (i >> n) & 0xFF); + } while(n > 0); + return this; +}; -function nop () {} +/** + * Puts a signed n-bit integer in this buffer in big-endian order. Two's + * complement representation is used. + * + * @param i the n-bit integer. + * @param n the number of bits in the integer. + * + * @return this buffer. + */ +util.DataBuffer.prototype.putSignedInt = function(i, n) { + _checkBitsParam(n); + this.accommodate(n / 8); + if(i < 0) { + i += 2 << (n - 1); + } + return this.putInt(i, n); +}; -function isStream (obj) { - return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function' -} +/** + * Gets a byte from this buffer and advances the read pointer by 1. + * + * @return the byte. + */ +util.DataBuffer.prototype.getByte = function() { + return this.data.getInt8(this.read++); +}; -// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License) -function isBlobLike (object) { - return (Blob && object instanceof Blob) || ( - object && - typeof object === 'object' && - (typeof object.stream === 'function' || - typeof object.arrayBuffer === 'function') && - /^(Blob|File)$/.test(object[Symbol.toStringTag]) - ) -} +/** + * Gets a uint16 from this buffer in big-endian order and advances the read + * pointer by 2. + * + * @return the uint16. + */ +util.DataBuffer.prototype.getInt16 = function() { + var rval = this.data.getInt16(this.read); + this.read += 2; + return rval; +}; -function buildURL (url, queryParams) { - if (url.includes('?') || url.includes('#')) { - throw new Error('Query params cannot be passed when url already contains "?" or "#".') - } +/** + * Gets a uint24 from this buffer in big-endian order and advances the read + * pointer by 3. + * + * @return the uint24. + */ +util.DataBuffer.prototype.getInt24 = function() { + var rval = ( + this.data.getInt16(this.read) << 8 ^ + this.data.getInt8(this.read + 2)); + this.read += 3; + return rval; +}; - const stringified = stringify(queryParams) +/** + * Gets a uint32 from this buffer in big-endian order and advances the read + * pointer by 4. + * + * @return the word. + */ +util.DataBuffer.prototype.getInt32 = function() { + var rval = this.data.getInt32(this.read); + this.read += 4; + return rval; +}; - if (stringified) { - url += '?' + stringified - } +/** + * Gets a uint16 from this buffer in little-endian order and advances the read + * pointer by 2. + * + * @return the uint16. + */ +util.DataBuffer.prototype.getInt16Le = function() { + var rval = this.data.getInt16(this.read, true); + this.read += 2; + return rval; +}; - return url -} +/** + * Gets a uint24 from this buffer in little-endian order and advances the read + * pointer by 3. + * + * @return the uint24. + */ +util.DataBuffer.prototype.getInt24Le = function() { + var rval = ( + this.data.getInt8(this.read) ^ + this.data.getInt16(this.read + 1, true) << 8); + this.read += 3; + return rval; +}; -function parseURL (url) { - if (typeof url === 'string') { - url = new URL(url) +/** + * Gets a uint32 from this buffer in little-endian order and advances the read + * pointer by 4. + * + * @return the word. + */ +util.DataBuffer.prototype.getInt32Le = function() { + var rval = this.data.getInt32(this.read, true); + this.read += 4; + return rval; +}; - if (!/^https?:/.test(url.origin || url.protocol)) { - throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.') - } +/** + * Gets an n-bit integer from this buffer in big-endian order and advances the + * read pointer by n/8. + * + * @param n the number of bits in the integer (8, 16, 24, or 32). + * + * @return the integer. + */ +util.DataBuffer.prototype.getInt = function(n) { + _checkBitsParam(n); + var rval = 0; + do { + // TODO: Use (rval * 0x100) if adding support for 33 to 53 bits. + rval = (rval << 8) + this.data.getInt8(this.read++); + n -= 8; + } while(n > 0); + return rval; +}; - return url +/** + * Gets a signed n-bit integer from this buffer in big-endian order, using + * two's complement, and advances the read pointer by n/8. + * + * @param n the number of bits in the integer (8, 16, 24, or 32). + * + * @return the integer. + */ +util.DataBuffer.prototype.getSignedInt = function(n) { + // getInt checks n + var x = this.getInt(n); + var max = 2 << (n - 2); + if(x >= max) { + x -= max << 1; } + return x; +}; - if (!url || typeof url !== 'object') { - throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.') +/** + * Reads bytes out as a binary encoded string and clears them from the + * buffer. + * + * @param count the number of bytes to read, undefined or null for all. + * + * @return a binary encoded string of bytes. + */ +util.DataBuffer.prototype.getBytes = function(count) { + // TODO: deprecate this method, it is poorly named and + // this.toString('binary') replaces it + // add a toTypedArray()/toArrayBuffer() function + var rval; + if(count) { + // read count bytes + count = Math.min(this.length(), count); + rval = this.data.slice(this.read, this.read + count); + this.read += count; + } else if(count === 0) { + rval = ''; + } else { + // read all bytes, optimize to only copy when needed + rval = (this.read === 0) ? this.data : this.data.slice(this.read); + this.clear(); } + return rval; +}; - if (!/^https?:/.test(url.origin || url.protocol)) { - throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.') - } +/** + * Gets a binary encoded string of the bytes from this buffer without + * modifying the read pointer. + * + * @param count the number of bytes to get, omit to get all. + * + * @return a string full of binary encoded characters. + */ +util.DataBuffer.prototype.bytes = function(count) { + // TODO: deprecate this method, it is poorly named, add "getString()" + return (typeof(count) === 'undefined' ? + this.data.slice(this.read) : + this.data.slice(this.read, this.read + count)); +}; - if (!(url instanceof URL)) { - if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) { - throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.') - } +/** + * Gets a byte at the given index without modifying the read pointer. + * + * @param i the byte index. + * + * @return the byte. + */ +util.DataBuffer.prototype.at = function(i) { + return this.data.getUint8(this.read + i); +}; - if (url.path != null && typeof url.path !== 'string') { - throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.') - } +/** + * Puts a byte at the given index without modifying the read pointer. + * + * @param i the byte index. + * @param b the byte to put. + * + * @return this buffer. + */ +util.DataBuffer.prototype.setAt = function(i, b) { + this.data.setUint8(i, b); + return this; +}; - if (url.pathname != null && typeof url.pathname !== 'string') { - throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.') - } +/** + * Gets the last byte without modifying the read pointer. + * + * @return the last byte. + */ +util.DataBuffer.prototype.last = function() { + return this.data.getUint8(this.write - 1); +}; - if (url.hostname != null && typeof url.hostname !== 'string') { - throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.') - } +/** + * Creates a copy of this buffer. + * + * @return the copy. + */ +util.DataBuffer.prototype.copy = function() { + return new util.DataBuffer(this); +}; - if (url.origin != null && typeof url.origin !== 'string') { - throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.') - } +/** + * Compacts this buffer. + * + * @return this buffer. + */ +util.DataBuffer.prototype.compact = function() { + if(this.read > 0) { + var src = new Uint8Array(this.data.buffer, this.read); + var dst = new Uint8Array(src.byteLength); + dst.set(src); + this.data = new DataView(dst); + this.write -= this.read; + this.read = 0; + } + return this; +}; - const port = url.port != null - ? url.port - : (url.protocol === 'https:' ? 443 : 80) - let origin = url.origin != null - ? url.origin - : `${url.protocol}//${url.hostname}:${port}` - let path = url.path != null - ? url.path - : `${url.pathname || ''}${url.search || ''}` +/** + * Clears this buffer. + * + * @return this buffer. + */ +util.DataBuffer.prototype.clear = function() { + this.data = new DataView(new ArrayBuffer(0)); + this.read = this.write = 0; + return this; +}; - if (origin.endsWith('/')) { - origin = origin.substring(0, origin.length - 1) - } +/** + * Shortens this buffer by triming bytes off of the end of this buffer. + * + * @param count the number of bytes to trim off. + * + * @return this buffer. + */ +util.DataBuffer.prototype.truncate = function(count) { + this.write = Math.max(0, this.length() - count); + this.read = Math.min(this.read, this.write); + return this; +}; - if (path && !path.startsWith('/')) { - path = `/${path}` +/** + * Converts this buffer to a hexadecimal string. + * + * @return a hexadecimal string. + */ +util.DataBuffer.prototype.toHex = function() { + var rval = ''; + for(var i = this.read; i < this.data.byteLength; ++i) { + var b = this.data.getUint8(i); + if(b < 16) { + rval += '0'; } - // new URL(path, origin) is unsafe when `path` contains an absolute URL - // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL: - // If first parameter is a relative URL, second param is required, and will be used as the base URL. - // If first parameter is an absolute URL, a given second param will be ignored. - url = new URL(origin + path) + rval += b.toString(16); } + return rval; +}; - return url -} - -function parseOrigin (url) { - url = parseURL(url) +/** + * Converts this buffer to a string, using the given encoding. If no + * encoding is given, 'utf8' (UTF-8) is used. + * + * @param [encoding] the encoding to use: 'binary', 'utf8', 'utf16', 'hex', + * 'base64' (default: 'utf8'). + * + * @return a string representation of the bytes in this buffer. + */ +util.DataBuffer.prototype.toString = function(encoding) { + var view = new Uint8Array(this.data, this.read, this.length()); + encoding = encoding || 'utf8'; - if (url.pathname !== '/' || url.search || url.hash) { - throw new InvalidArgumentError('invalid url') + // encode to string + if(encoding === 'binary' || encoding === 'raw') { + return util.binary.raw.encode(view); } - - return url -} - -function getHostname (host) { - if (host[0] === '[') { - const idx = host.indexOf(']') - - assert(idx !== -1) - return host.substring(1, idx) + if(encoding === 'hex') { + return util.binary.hex.encode(view); } - - const idx = host.indexOf(':') - if (idx === -1) return host - - return host.substring(0, idx) -} - -// IP addresses are not valid server names per RFC6066 -// > Currently, the only server names supported are DNS hostnames -function getServerName (host) { - if (!host) { - return null + if(encoding === 'base64') { + return util.binary.base64.encode(view); } - assert.strictEqual(typeof host, 'string') - - const servername = getHostname(host) - if (net.isIP(servername)) { - return '' + // decode to text + if(encoding === 'utf8') { + return util.text.utf8.decode(view); } - - return servername -} - -function deepClone (obj) { - return JSON.parse(JSON.stringify(obj)) -} - -function isAsyncIterable (obj) { - return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function') -} - -function isIterable (obj) { - return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function')) -} - -function bodyLength (body) { - if (body == null) { - return 0 - } else if (isStream(body)) { - const state = body._readableState - return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length) - ? state.length - : null - } else if (isBlobLike(body)) { - return body.size != null ? body.size : null - } else if (isBuffer(body)) { - return body.byteLength + if(encoding === 'utf16') { + return util.text.utf16.decode(view); } - return null -} - -function isDestroyed (stream) { - return !stream || !!(stream.destroyed || stream[kDestroyed]) -} + throw new Error('Invalid encoding: ' + encoding); +}; -function isReadableAborted (stream) { - const state = stream && stream._readableState - return isDestroyed(stream) && state && !state.endEmitted -} +/** End Buffer w/UInt8Array backing */ -function destroy (stream, err) { - if (stream == null || !isStream(stream) || isDestroyed(stream)) { - return +/** + * Creates a buffer that stores bytes. A value may be given to populate the + * buffer with data. This value can either be string of encoded bytes or a + * regular string of characters. When passing a string of binary encoded + * bytes, the encoding `raw` should be given. This is also the default. When + * passing a string of characters, the encoding `utf8` should be given. + * + * @param [input] a string with encoded bytes to store in the buffer. + * @param [encoding] (default: 'raw', other: 'utf8'). + */ +util.createBuffer = function(input, encoding) { + // TODO: deprecate, use new ByteBuffer() instead + encoding = encoding || 'raw'; + if(input !== undefined && encoding === 'utf8') { + input = util.encodeUtf8(input); } + return new util.ByteBuffer(input); +}; - if (typeof stream.destroy === 'function') { - if (Object.getPrototypeOf(stream).constructor === IncomingMessage) { - // See: https://github.com/nodejs/node/pull/38505/files - stream.socket = null +/** + * Fills a string with a particular value. If you want the string to be a byte + * string, pass in String.fromCharCode(theByte). + * + * @param c the character to fill the string with, use String.fromCharCode + * to fill the string with a byte value. + * @param n the number of characters of value c to fill with. + * + * @return the filled string. + */ +util.fillString = function(c, n) { + var s = ''; + while(n > 0) { + if(n & 1) { + s += c; + } + n >>>= 1; + if(n > 0) { + c += c; } - - stream.destroy(err) - } else if (err) { - process.nextTick((stream, err) => { - stream.emit('error', err) - }, stream, err) - } - - if (stream.destroyed !== true) { - stream[kDestroyed] = true } -} - -const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/ -function parseKeepAliveTimeout (val) { - const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR) - return m ? parseInt(m[1], 10) * 1000 : null -} - -function parseHeaders (headers, obj = {}) { - // For H2 support - if (!Array.isArray(headers)) return headers - - for (let i = 0; i < headers.length; i += 2) { - const key = headers[i].toString().toLowerCase() - let val = obj[key] + return s; +}; - if (!val) { - if (Array.isArray(headers[i + 1])) { - obj[key] = headers[i + 1].map(x => x.toString('utf8')) - } else { - obj[key] = headers[i + 1].toString('utf8') - } - } else { - if (!Array.isArray(val)) { - val = [val] - obj[key] = val - } - val.push(headers[i + 1].toString('utf8')) +/** + * Performs a per byte XOR between two byte strings and returns the result as a + * string of bytes. + * + * @param s1 first string of bytes. + * @param s2 second string of bytes. + * @param n the number of bytes to XOR. + * + * @return the XOR'd result. + */ +util.xorBytes = function(s1, s2, n) { + var s3 = ''; + var b = ''; + var t = ''; + var i = 0; + var c = 0; + for(; n > 0; --n, ++i) { + b = s1.charCodeAt(i) ^ s2.charCodeAt(i); + if(c >= 10) { + s3 += t; + t = ''; + c = 0; } + t += String.fromCharCode(b); + ++c; } + s3 += t; + return s3; +}; - // See https://github.com/nodejs/node/pull/46528 - if ('content-length' in obj && 'content-disposition' in obj) { - obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1') +/** + * Converts a hex string into a 'binary' encoded string of bytes. + * + * @param hex the hexadecimal string to convert. + * + * @return the binary-encoded string of bytes. + */ +util.hexToBytes = function(hex) { + // TODO: deprecate: "Deprecated. Use util.binary.hex.decode instead." + var rval = ''; + var i = 0; + if(hex.length & 1 == 1) { + // odd number of characters, convert first character alone + i = 1; + rval += String.fromCharCode(parseInt(hex[0], 16)); + } + // convert 2 characters (1 byte) at a time + for(; i < hex.length; i += 2) { + rval += String.fromCharCode(parseInt(hex.substr(i, 2), 16)); } + return rval; +}; - return obj -} +/** + * Converts a 'binary' encoded string of bytes to hex. + * + * @param bytes the byte string to convert. + * + * @return the string of hexadecimal characters. + */ +util.bytesToHex = function(bytes) { + // TODO: deprecate: "Deprecated. Use util.binary.hex.encode instead." + return util.createBuffer(bytes).toHex(); +}; -function parseRawHeaders (headers) { - const ret = [] - let hasContentLength = false - let contentDispositionIdx = -1 +/** + * Converts an 32-bit integer to 4-big-endian byte string. + * + * @param i the integer. + * + * @return the byte string. + */ +util.int32ToBytes = function(i) { + return ( + String.fromCharCode(i >> 24 & 0xFF) + + String.fromCharCode(i >> 16 & 0xFF) + + String.fromCharCode(i >> 8 & 0xFF) + + String.fromCharCode(i & 0xFF)); +}; - for (let n = 0; n < headers.length; n += 2) { - const key = headers[n + 0].toString() - const val = headers[n + 1].toString('utf8') +// base64 characters, reverse mapping +var _base64 = + 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; +var _base64Idx = [ +/*43 -43 = 0*/ +/*'+', 1, 2, 3,'/' */ + 62, -1, -1, -1, 63, - if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) { - ret.push(key, val) - hasContentLength = true - } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) { - contentDispositionIdx = ret.push(key, val) - 1 - } else { - ret.push(key, val) - } - } +/*'0','1','2','3','4','5','6','7','8','9' */ + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - // See https://github.com/nodejs/node/pull/46528 - if (hasContentLength && contentDispositionIdx !== -1) { - ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1') - } +/*15, 16, 17,'=', 19, 20, 21 */ + -1, -1, -1, 64, -1, -1, -1, - return ret -} +/*65 - 43 = 22*/ +/*'A','B','C','D','E','F','G','H','I','J','K','L','M', */ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, -function isBuffer (buffer) { - // See, https://github.com/mcollina/undici/pull/319 - return buffer instanceof Uint8Array || Buffer.isBuffer(buffer) -} +/*'N','O','P','Q','R','S','T','U','V','W','X','Y','Z' */ + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -function validateHandler (handler, method, upgrade) { - if (!handler || typeof handler !== 'object') { - throw new InvalidArgumentError('handler must be an object') - } +/*91 - 43 = 48 */ +/*48, 49, 50, 51, 52, 53 */ + -1, -1, -1, -1, -1, -1, - if (typeof handler.onConnect !== 'function') { - throw new InvalidArgumentError('invalid onConnect method') - } +/*97 - 43 = 54*/ +/*'a','b','c','d','e','f','g','h','i','j','k','l','m' */ + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - if (typeof handler.onError !== 'function') { - throw new InvalidArgumentError('invalid onError method') - } +/*'n','o','p','q','r','s','t','u','v','w','x','y','z' */ + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 +]; - if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) { - throw new InvalidArgumentError('invalid onBodySent method') - } +// base58 characters (Bitcoin alphabet) +var _base58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; - if (upgrade || method === 'CONNECT') { - if (typeof handler.onUpgrade !== 'function') { - throw new InvalidArgumentError('invalid onUpgrade method') - } - } else { - if (typeof handler.onHeaders !== 'function') { - throw new InvalidArgumentError('invalid onHeaders method') - } +/** + * Base64 encodes a 'binary' encoded string of bytes. + * + * @param input the binary encoded string of bytes to base64-encode. + * @param maxline the maximum number of encoded characters per line to use, + * defaults to none. + * + * @return the base64-encoded output. + */ +util.encode64 = function(input, maxline) { + // TODO: deprecate: "Deprecated. Use util.binary.base64.encode instead." + var line = ''; + var output = ''; + var chr1, chr2, chr3; + var i = 0; + while(i < input.length) { + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); - if (typeof handler.onData !== 'function') { - throw new InvalidArgumentError('invalid onData method') + // encode 4 character group + line += _base64.charAt(chr1 >> 2); + line += _base64.charAt(((chr1 & 3) << 4) | (chr2 >> 4)); + if(isNaN(chr2)) { + line += '=='; + } else { + line += _base64.charAt(((chr2 & 15) << 2) | (chr3 >> 6)); + line += isNaN(chr3) ? '=' : _base64.charAt(chr3 & 63); } - if (typeof handler.onComplete !== 'function') { - throw new InvalidArgumentError('invalid onComplete method') + if(maxline && line.length > maxline) { + output += line.substr(0, maxline) + '\r\n'; + line = line.substr(maxline); } } -} - -// A body is disturbed if it has been read from and it cannot -// be re-used without losing state or data. -function isDisturbed (body) { - return !!(body && ( - stream.isDisturbed - ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed? - : body[kBodyUsed] || - body.readableDidRead || - (body._readableState && body._readableState.dataEmitted) || - isReadableAborted(body) - )) -} - -function isErrored (body) { - return !!(body && ( - stream.isErrored - ? stream.isErrored(body) - : /state: 'errored'/.test(nodeUtil.inspect(body) - ))) -} - -function isReadable (body) { - return !!(body && ( - stream.isReadable - ? stream.isReadable(body) - : /state: 'readable'/.test(nodeUtil.inspect(body) - ))) -} + output += line; + return output; +}; -function getSocketInfo (socket) { - return { - localAddress: socket.localAddress, - localPort: socket.localPort, - remoteAddress: socket.remoteAddress, - remotePort: socket.remotePort, - remoteFamily: socket.remoteFamily, - timeout: socket.timeout, - bytesWritten: socket.bytesWritten, - bytesRead: socket.bytesRead - } -} +/** + * Base64 decodes a string into a 'binary' encoded string of bytes. + * + * @param input the base64-encoded input. + * + * @return the binary encoded string. + */ +util.decode64 = function(input) { + // TODO: deprecate: "Deprecated. Use util.binary.base64.decode instead." -async function * convertIterableToBuffer (iterable) { - for await (const chunk of iterable) { - yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk) - } -} + // remove all non-base64 characters + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ''); -let ReadableStream -function ReadableStreamFrom (iterable) { - if (!ReadableStream) { - ReadableStream = (__nccwpck_require__(35356).ReadableStream) - } + var output = ''; + var enc1, enc2, enc3, enc4; + var i = 0; - if (ReadableStream.from) { - return ReadableStream.from(convertIterableToBuffer(iterable)) - } + while(i < input.length) { + enc1 = _base64Idx[input.charCodeAt(i++) - 43]; + enc2 = _base64Idx[input.charCodeAt(i++) - 43]; + enc3 = _base64Idx[input.charCodeAt(i++) - 43]; + enc4 = _base64Idx[input.charCodeAt(i++) - 43]; - let iterator - return new ReadableStream( - { - async start () { - iterator = iterable[Symbol.asyncIterator]() - }, - async pull (controller) { - const { done, value } = await iterator.next() - if (done) { - queueMicrotask(() => { - controller.close() - }) - } else { - const buf = Buffer.isBuffer(value) ? value : Buffer.from(value) - controller.enqueue(new Uint8Array(buf)) - } - return controller.desiredSize > 0 - }, - async cancel (reason) { - await iterator.return() + output += String.fromCharCode((enc1 << 2) | (enc2 >> 4)); + if(enc3 !== 64) { + // decoded at least 2 bytes + output += String.fromCharCode(((enc2 & 15) << 4) | (enc3 >> 2)); + if(enc4 !== 64) { + // decoded 3 bytes + output += String.fromCharCode(((enc3 & 3) << 6) | enc4); } - }, - 0 - ) -} - -// The chunk should be a FormData instance and contains -// all the required methods. -function isFormDataLike (object) { - return ( - object && - typeof object === 'object' && - typeof object.append === 'function' && - typeof object.delete === 'function' && - typeof object.get === 'function' && - typeof object.getAll === 'function' && - typeof object.has === 'function' && - typeof object.set === 'function' && - object[Symbol.toStringTag] === 'FormData' - ) -} - -function throwIfAborted (signal) { - if (!signal) { return } - if (typeof signal.throwIfAborted === 'function') { - signal.throwIfAborted() - } else { - if (signal.aborted) { - // DOMException not available < v17.0.0 - const err = new Error('The operation was aborted') - err.name = 'AbortError' - throw err } } -} - -function addAbortListener (signal, listener) { - if ('addEventListener' in signal) { - signal.addEventListener('abort', listener, { once: true }) - return () => signal.removeEventListener('abort', listener) - } - signal.addListener('abort', listener) - return () => signal.removeListener('abort', listener) -} -const hasToWellFormed = !!String.prototype.toWellFormed + return output; +}; /** - * @param {string} val + * Encodes the given string of characters (a standard JavaScript + * string) as a binary encoded string where the bytes represent + * a UTF-8 encoded string of characters. Non-ASCII characters will be + * encoded as multiple bytes according to UTF-8. + * + * @param str a standard string of characters to encode. + * + * @return the binary encoded string. */ -function toUSVString (val) { - if (hasToWellFormed) { - return `${val}`.toWellFormed() - } else if (nodeUtil.toUSVString) { - return nodeUtil.toUSVString(val) - } - - return `${val}` -} - -// Parsed accordingly to RFC 9110 -// https://www.rfc-editor.org/rfc/rfc9110#field.content-range -function parseRangeHeader (range) { - if (range == null || range === '') return { start: 0, end: null, size: null } - - const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null - return m - ? { - start: parseInt(m[1]), - end: m[2] ? parseInt(m[2]) : null, - size: m[3] ? parseInt(m[3]) : null - } - : null -} - -const kEnumerableProperty = Object.create(null) -kEnumerableProperty.enumerable = true - -module.exports = { - kEnumerableProperty, - nop, - isDisturbed, - isErrored, - isReadable, - toUSVString, - isReadableAborted, - isBlobLike, - parseOrigin, - parseURL, - getServerName, - isStream, - isIterable, - isAsyncIterable, - isDestroyed, - parseRawHeaders, - parseHeaders, - parseKeepAliveTimeout, - destroy, - bodyLength, - deepClone, - ReadableStreamFrom, - isBuffer, - validateHandler, - getSocketInfo, - isFormDataLike, - buildURL, - throwIfAborted, - addAbortListener, - parseRangeHeader, - nodeMajor, - nodeMinor, - nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13), - safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE'] -} - - -/***/ }), - -/***/ 32426: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - - -const Dispatcher = __nccwpck_require__(73272) -const { - ClientDestroyedError, - ClientClosedError, - InvalidArgumentError -} = __nccwpck_require__(46339) -const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(48039) - -const kDestroyed = Symbol('destroyed') -const kClosed = Symbol('closed') -const kOnDestroyed = Symbol('onDestroyed') -const kOnClosed = Symbol('onClosed') -const kInterceptedDispatch = Symbol('Intercepted Dispatch') +util.encodeUtf8 = function(str) { + return unescape(encodeURIComponent(str)); +}; -class DispatcherBase extends Dispatcher { - constructor () { - super() +/** + * Decodes a binary encoded string that contains bytes that + * represent a UTF-8 encoded string of characters -- into a + * string of characters (a standard JavaScript string). + * + * @param str the binary encoded string to decode. + * + * @return the resulting standard string of characters. + */ +util.decodeUtf8 = function(str) { + return decodeURIComponent(escape(str)); +}; - this[kDestroyed] = false - this[kOnDestroyed] = null - this[kClosed] = false - this[kOnClosed] = [] +// binary encoding/decoding tools +// FIXME: Experimental. Do not use yet. +util.binary = { + raw: {}, + hex: {}, + base64: {}, + base58: {}, + baseN : { + encode: baseN.encode, + decode: baseN.decode } +}; - get destroyed () { - return this[kDestroyed] - } +/** + * Encodes a Uint8Array as a binary-encoded string. This encoding uses + * a value between 0 and 255 for each character. + * + * @param bytes the Uint8Array to encode. + * + * @return the binary-encoded string. + */ +util.binary.raw.encode = function(bytes) { + return String.fromCharCode.apply(null, bytes); +}; - get closed () { - return this[kClosed] +/** + * Decodes a binary-encoded string to a Uint8Array. This encoding uses + * a value between 0 and 255 for each character. + * + * @param str the binary-encoded string to decode. + * @param [output] an optional Uint8Array to write the output to; if it + * is too small, an exception will be thrown. + * @param [offset] the start offset for writing to the output (default: 0). + * + * @return the Uint8Array or the number of bytes written if output was given. + */ +util.binary.raw.decode = function(str, output, offset) { + var out = output; + if(!out) { + out = new Uint8Array(str.length); } - - get interceptors () { - return this[kInterceptors] + offset = offset || 0; + var j = offset; + for(var i = 0; i < str.length; ++i) { + out[j++] = str.charCodeAt(i); } + return output ? (j - offset) : out; +}; - set interceptors (newInterceptors) { - if (newInterceptors) { - for (let i = newInterceptors.length - 1; i >= 0; i--) { - const interceptor = this[kInterceptors][i] - if (typeof interceptor !== 'function') { - throw new InvalidArgumentError('interceptor must be an function') - } - } - } +/** + * Encodes a 'binary' string, ArrayBuffer, DataView, TypedArray, or + * ByteBuffer as a string of hexadecimal characters. + * + * @param bytes the bytes to convert. + * + * @return the string of hexadecimal characters. + */ +util.binary.hex.encode = util.bytesToHex; - this[kInterceptors] = newInterceptors +/** + * Decodes a hex-encoded string to a Uint8Array. + * + * @param hex the hexadecimal string to convert. + * @param [output] an optional Uint8Array to write the output to; if it + * is too small, an exception will be thrown. + * @param [offset] the start offset for writing to the output (default: 0). + * + * @return the Uint8Array or the number of bytes written if output was given. + */ +util.binary.hex.decode = function(hex, output, offset) { + var out = output; + if(!out) { + out = new Uint8Array(Math.ceil(hex.length / 2)); } + offset = offset || 0; + var i = 0, j = offset; + if(hex.length & 1) { + // odd number of characters, convert first character alone + i = 1; + out[j++] = parseInt(hex[0], 16); + } + // convert 2 characters (1 byte) at a time + for(; i < hex.length; i += 2) { + out[j++] = parseInt(hex.substr(i, 2), 16); + } + return output ? (j - offset) : out; +}; - close (callback) { - if (callback === undefined) { - return new Promise((resolve, reject) => { - this.close((err, data) => { - return err ? reject(err) : resolve(data) - }) - }) - } - - if (typeof callback !== 'function') { - throw new InvalidArgumentError('invalid callback') - } - - if (this[kDestroyed]) { - queueMicrotask(() => callback(new ClientDestroyedError(), null)) - return - } - - if (this[kClosed]) { - if (this[kOnClosed]) { - this[kOnClosed].push(callback) - } else { - queueMicrotask(() => callback(null, null)) - } - return - } +/** + * Base64-encodes a Uint8Array. + * + * @param input the Uint8Array to encode. + * @param maxline the maximum number of encoded characters per line to use, + * defaults to none. + * + * @return the base64-encoded output string. + */ +util.binary.base64.encode = function(input, maxline) { + var line = ''; + var output = ''; + var chr1, chr2, chr3; + var i = 0; + while(i < input.byteLength) { + chr1 = input[i++]; + chr2 = input[i++]; + chr3 = input[i++]; - this[kClosed] = true - this[kOnClosed].push(callback) + // encode 4 character group + line += _base64.charAt(chr1 >> 2); + line += _base64.charAt(((chr1 & 3) << 4) | (chr2 >> 4)); + if(isNaN(chr2)) { + line += '=='; + } else { + line += _base64.charAt(((chr2 & 15) << 2) | (chr3 >> 6)); + line += isNaN(chr3) ? '=' : _base64.charAt(chr3 & 63); + } - const onClosed = () => { - const callbacks = this[kOnClosed] - this[kOnClosed] = null - for (let i = 0; i < callbacks.length; i++) { - callbacks[i](null, null) - } + if(maxline && line.length > maxline) { + output += line.substr(0, maxline) + '\r\n'; + line = line.substr(maxline); } + } + output += line; + return output; +}; - // Should not error. - this[kClose]() - .then(() => this.destroy()) - .then(() => { - queueMicrotask(onClosed) - }) +/** + * Decodes a base64-encoded string to a Uint8Array. + * + * @param input the base64-encoded input string. + * @param [output] an optional Uint8Array to write the output to; if it + * is too small, an exception will be thrown. + * @param [offset] the start offset for writing to the output (default: 0). + * + * @return the Uint8Array or the number of bytes written if output was given. + */ +util.binary.base64.decode = function(input, output, offset) { + var out = output; + if(!out) { + out = new Uint8Array(Math.ceil(input.length / 4) * 3); } - destroy (err, callback) { - if (typeof err === 'function') { - callback = err - err = null - } + // remove all non-base64 characters + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ''); - if (callback === undefined) { - return new Promise((resolve, reject) => { - this.destroy(err, (err, data) => { - return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data) - }) - }) - } + offset = offset || 0; + var enc1, enc2, enc3, enc4; + var i = 0, j = offset; - if (typeof callback !== 'function') { - throw new InvalidArgumentError('invalid callback') - } + while(i < input.length) { + enc1 = _base64Idx[input.charCodeAt(i++) - 43]; + enc2 = _base64Idx[input.charCodeAt(i++) - 43]; + enc3 = _base64Idx[input.charCodeAt(i++) - 43]; + enc4 = _base64Idx[input.charCodeAt(i++) - 43]; - if (this[kDestroyed]) { - if (this[kOnDestroyed]) { - this[kOnDestroyed].push(callback) - } else { - queueMicrotask(() => callback(null, null)) + out[j++] = (enc1 << 2) | (enc2 >> 4); + if(enc3 !== 64) { + // decoded at least 2 bytes + out[j++] = ((enc2 & 15) << 4) | (enc3 >> 2); + if(enc4 !== 64) { + // decoded 3 bytes + out[j++] = ((enc3 & 3) << 6) | enc4; } - return } + } - if (!err) { - err = new ClientDestroyedError() - } + // make sure result is the exact decoded length + return output ? (j - offset) : out.subarray(0, j); +}; - this[kDestroyed] = true - this[kOnDestroyed] = this[kOnDestroyed] || [] - this[kOnDestroyed].push(callback) +// add support for base58 encoding/decoding with Bitcoin alphabet +util.binary.base58.encode = function(input, maxline) { + return util.binary.baseN.encode(input, _base58, maxline); +}; +util.binary.base58.decode = function(input, maxline) { + return util.binary.baseN.decode(input, _base58, maxline); +}; - const onDestroyed = () => { - const callbacks = this[kOnDestroyed] - this[kOnDestroyed] = null - for (let i = 0; i < callbacks.length; i++) { - callbacks[i](null, null) - } - } +// text encoding/decoding tools +// FIXME: Experimental. Do not use yet. +util.text = { + utf8: {}, + utf16: {} +}; - // Should not error. - this[kDestroy](err).then(() => { - queueMicrotask(onDestroyed) - }) +/** + * Encodes the given string as UTF-8 in a Uint8Array. + * + * @param str the string to encode. + * @param [output] an optional Uint8Array to write the output to; if it + * is too small, an exception will be thrown. + * @param [offset] the start offset for writing to the output (default: 0). + * + * @return the Uint8Array or the number of bytes written if output was given. + */ +util.text.utf8.encode = function(str, output, offset) { + str = util.encodeUtf8(str); + var out = output; + if(!out) { + out = new Uint8Array(str.length); } - - [kInterceptedDispatch] (opts, handler) { - if (!this[kInterceptors] || this[kInterceptors].length === 0) { - this[kInterceptedDispatch] = this[kDispatch] - return this[kDispatch](opts, handler) - } - - let dispatch = this[kDispatch].bind(this) - for (let i = this[kInterceptors].length - 1; i >= 0; i--) { - dispatch = this[kInterceptors][i](dispatch) - } - this[kInterceptedDispatch] = dispatch - return dispatch(opts, handler) + offset = offset || 0; + var j = offset; + for(var i = 0; i < str.length; ++i) { + out[j++] = str.charCodeAt(i); } + return output ? (j - offset) : out; +}; - dispatch (opts, handler) { - if (!handler || typeof handler !== 'object') { - throw new InvalidArgumentError('handler must be an object') - } - - try { - if (!opts || typeof opts !== 'object') { - throw new InvalidArgumentError('opts must be an object.') - } - - if (this[kDestroyed] || this[kOnDestroyed]) { - throw new ClientDestroyedError() - } +/** + * Decodes the UTF-8 contents from a Uint8Array. + * + * @param bytes the Uint8Array to decode. + * + * @return the resulting string. + */ +util.text.utf8.decode = function(bytes) { + return util.decodeUtf8(String.fromCharCode.apply(null, bytes)); +}; - if (this[kClosed]) { - throw new ClientClosedError() - } +/** + * Encodes the given string as UTF-16 in a Uint8Array. + * + * @param str the string to encode. + * @param [output] an optional Uint8Array to write the output to; if it + * is too small, an exception will be thrown. + * @param [offset] the start offset for writing to the output (default: 0). + * + * @return the Uint8Array or the number of bytes written if output was given. + */ +util.text.utf16.encode = function(str, output, offset) { + var out = output; + if(!out) { + out = new Uint8Array(str.length * 2); + } + var view = new Uint16Array(out.buffer); + offset = offset || 0; + var j = offset; + var k = offset; + for(var i = 0; i < str.length; ++i) { + view[k++] = str.charCodeAt(i); + j += 2; + } + return output ? (j - offset) : out; +}; - return this[kInterceptedDispatch](opts, handler) - } catch (err) { - if (typeof handler.onError !== 'function') { - throw new InvalidArgumentError('invalid onError method') - } +/** + * Decodes the UTF-16 contents from a Uint8Array. + * + * @param bytes the Uint8Array to decode. + * + * @return the resulting string. + */ +util.text.utf16.decode = function(bytes) { + return String.fromCharCode.apply(null, new Uint16Array(bytes.buffer)); +}; - handler.onError(err) +/** + * Deflates the given data using a flash interface. + * + * @param api the flash interface. + * @param bytes the data. + * @param raw true to return only raw deflate data, false to include zlib + * header and trailer. + * + * @return the deflated data as a string. + */ +util.deflate = function(api, bytes, raw) { + bytes = util.decode64(api.deflate(util.encode64(bytes)).rval); - return false + // strip zlib header and trailer if necessary + if(raw) { + // zlib header is 2 bytes (CMF,FLG) where FLG indicates that + // there is a 4-byte DICT (alder-32) block before the data if + // its 5th bit is set + var start = 2; + var flg = bytes.charCodeAt(1); + if(flg & 0x20) { + start = 6; } + // zlib trailer is 4 bytes of adler-32 + bytes = bytes.substring(start, bytes.length - 4); } -} - -module.exports = DispatcherBase - - -/***/ }), - -/***/ 73272: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - + return bytes; +}; -const EventEmitter = __nccwpck_require__(82361) +/** + * Inflates the given data using a flash interface. + * + * @param api the flash interface. + * @param bytes the data. + * @param raw true if the incoming data has no zlib header or trailer and is + * raw DEFLATE data. + * + * @return the inflated data as a string, null on error. + */ +util.inflate = function(api, bytes, raw) { + // TODO: add zlib header and trailer if necessary/possible + var rval = api.inflate(util.encode64(bytes)).rval; + return (rval === null) ? null : util.decode64(rval); +}; -class Dispatcher extends EventEmitter { - dispatch () { - throw new Error('not implemented') +/** + * Sets a storage object. + * + * @param api the storage interface. + * @param id the storage ID to use. + * @param obj the storage object, null to remove. + */ +var _setStorageObject = function(api, id, obj) { + if(!api) { + throw new Error('WebStorage not available.'); } - close () { - throw new Error('not implemented') + var rval; + if(obj === null) { + rval = api.removeItem(id); + } else { + // json-encode and base64-encode object + obj = util.encode64(JSON.stringify(obj)); + rval = api.setItem(id, obj); } - destroy () { - throw new Error('not implemented') + // handle potential flash error + if(typeof(rval) !== 'undefined' && rval.rval !== true) { + var error = new Error(rval.error.message); + error.id = rval.error.id; + error.name = rval.error.name; + throw error; } -} - -module.exports = Dispatcher - - -/***/ }), - -/***/ 62494: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - +}; -const Busboy = __nccwpck_require__(52612) -const util = __nccwpck_require__(67468) -const { - ReadableStreamFrom, - isBlobLike, - isReadableStreamLike, - readableStreamClose, - createDeferredPromise, - fullyReadBody -} = __nccwpck_require__(79453) -const { FormData } = __nccwpck_require__(12692) -const { kState } = __nccwpck_require__(46938) -const { webidl } = __nccwpck_require__(96138) -const { DOMException, structuredClone } = __nccwpck_require__(93541) -const { Blob, File: NativeFile } = __nccwpck_require__(14300) -const { kBodyUsed } = __nccwpck_require__(48039) -const assert = __nccwpck_require__(39491) -const { isErrored } = __nccwpck_require__(67468) -const { isUint8Array, isArrayBuffer } = __nccwpck_require__(29830) -const { File: UndiciFile } = __nccwpck_require__(96670) -const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(50096) +/** + * Gets a storage object. + * + * @param api the storage interface. + * @param id the storage ID to use. + * + * @return the storage object entry or null if none exists. + */ +var _getStorageObject = function(api, id) { + if(!api) { + throw new Error('WebStorage not available.'); + } -let ReadableStream = globalThis.ReadableStream + // get the existing entry + var rval = api.getItem(id); -/** @type {globalThis['File']} */ -const File = NativeFile ?? UndiciFile -const textEncoder = new TextEncoder() -const textDecoder = new TextDecoder() + /* Note: We check api.init because we can't do (api == localStorage) + on IE because of "Class doesn't support Automation" exception. Only + the flash api has an init method so this works too, but we need a + better solution in the future. */ -// https://fetch.spec.whatwg.org/#concept-bodyinit-extract -function extractBody (object, keepalive = false) { - if (!ReadableStream) { - ReadableStream = (__nccwpck_require__(35356).ReadableStream) + // flash returns item wrapped in an object, handle special case + if(api.init) { + if(rval.rval === null) { + if(rval.error) { + var error = new Error(rval.error.message); + error.id = rval.error.id; + error.name = rval.error.name; + throw error; + } + // no error, but also no item + rval = null; + } else { + rval = rval.rval; + } } - // 1. Let stream be null. - let stream = null - - // 2. If object is a ReadableStream object, then set stream to object. - if (object instanceof ReadableStream) { - stream = object - } else if (isBlobLike(object)) { - // 3. Otherwise, if object is a Blob object, set stream to the - // result of running object’s get stream. - stream = object.stream() - } else { - // 4. Otherwise, set stream to a new ReadableStream object, and set - // up stream. - stream = new ReadableStream({ - async pull (controller) { - controller.enqueue( - typeof source === 'string' ? textEncoder.encode(source) : source - ) - queueMicrotask(() => readableStreamClose(controller)) - }, - start () {}, - type: undefined - }) + // handle decoding + if(rval !== null) { + // base64-decode and json-decode data + rval = JSON.parse(util.decode64(rval)); } - // 5. Assert: stream is a ReadableStream object. - assert(isReadableStreamLike(stream)) - - // 6. Let action be null. - let action = null - - // 7. Let source be null. - let source = null - - // 8. Let length be null. - let length = null - - // 9. Let type be null. - let type = null + return rval; +}; - // 10. Switch on object: - if (typeof object === 'string') { - // Set source to the UTF-8 encoding of object. - // Note: setting source to a Uint8Array here breaks some mocking assumptions. - source = object +/** + * Stores an item in local storage. + * + * @param api the storage interface. + * @param id the storage ID to use. + * @param key the key for the item. + * @param data the data for the item (any javascript object/primitive). + */ +var _setItem = function(api, id, key, data) { + // get storage object + var obj = _getStorageObject(api, id); + if(obj === null) { + // create a new storage object + obj = {}; + } + // update key + obj[key] = data; - // Set type to `text/plain;charset=UTF-8`. - type = 'text/plain;charset=UTF-8' - } else if (object instanceof URLSearchParams) { - // URLSearchParams + // set storage object + _setStorageObject(api, id, obj); +}; - // spec says to run application/x-www-form-urlencoded on body.list - // this is implemented in Node.js as apart of an URLSearchParams instance toString method - // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490 - // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100 +/** + * Gets an item from local storage. + * + * @param api the storage interface. + * @param id the storage ID to use. + * @param key the key for the item. + * + * @return the item. + */ +var _getItem = function(api, id, key) { + // get storage object + var rval = _getStorageObject(api, id); + if(rval !== null) { + // return data at key + rval = (key in rval) ? rval[key] : null; + } - // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list. - source = object.toString() + return rval; +}; - // Set type to `application/x-www-form-urlencoded;charset=UTF-8`. - type = 'application/x-www-form-urlencoded;charset=UTF-8' - } else if (isArrayBuffer(object)) { - // BufferSource/ArrayBuffer +/** + * Removes an item from local storage. + * + * @param api the storage interface. + * @param id the storage ID to use. + * @param key the key for the item. + */ +var _removeItem = function(api, id, key) { + // get storage object + var obj = _getStorageObject(api, id); + if(obj !== null && key in obj) { + // remove key + delete obj[key]; - // Set source to a copy of the bytes held by object. - source = new Uint8Array(object.slice()) - } else if (ArrayBuffer.isView(object)) { - // BufferSource/ArrayBufferView + // see if entry has no keys remaining + var empty = true; + for(var prop in obj) { + empty = false; + break; + } + if(empty) { + // remove entry entirely if no keys are left + obj = null; + } - // Set source to a copy of the bytes held by object. - source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength)) - } else if (util.isFormDataLike(object)) { - const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}` - const prefix = `--${boundary}\r\nContent-Disposition: form-data` + // set storage object + _setStorageObject(api, id, obj); + } +}; - /*! formdata-polyfill. MIT License. Jimmy Wärting */ - const escape = (str) => - str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22') - const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n') +/** + * Clears the local disk storage identified by the given ID. + * + * @param api the storage interface. + * @param id the storage ID to use. + */ +var _clearItems = function(api, id) { + _setStorageObject(api, id, null); +}; - // Set action to this step: run the multipart/form-data - // encoding algorithm, with object’s entry list and UTF-8. - // - This ensures that the body is immutable and can't be changed afterwords - // - That the content-length is calculated in advance. - // - And that all parts are pre-encoded and ready to be sent. +/** + * Calls a storage function. + * + * @param func the function to call. + * @param args the arguments for the function. + * @param location the location argument. + * + * @return the return value from the function. + */ +var _callStorageFunction = function(func, args, location) { + var rval = null; - const blobParts = [] - const rn = new Uint8Array([13, 10]) // '\r\n' - length = 0 - let hasUnknownSizeValue = false + // default storage types + if(typeof(location) === 'undefined') { + location = ['web', 'flash']; + } - for (const [name, value] of object) { - if (typeof value === 'string') { - const chunk = textEncoder.encode(prefix + - `; name="${escape(normalizeLinefeeds(name))}"` + - `\r\n\r\n${normalizeLinefeeds(value)}\r\n`) - blobParts.push(chunk) - length += chunk.byteLength - } else { - const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` + - (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' + - `Content-Type: ${ - value.type || 'application/octet-stream' - }\r\n\r\n`) - blobParts.push(chunk, value, rn) - if (typeof value.size === 'number') { - length += chunk.byteLength + value.size + rn.byteLength - } else { - hasUnknownSizeValue = true + // apply storage types in order of preference + var type; + var done = false; + var exception = null; + for(var idx in location) { + type = location[idx]; + try { + if(type === 'flash' || type === 'both') { + if(args[0] === null) { + throw new Error('Flash local storage not available.'); } + rval = func.apply(this, args); + done = (type === 'flash'); } - } - - const chunk = textEncoder.encode(`--${boundary}--`) - blobParts.push(chunk) - length += chunk.byteLength - if (hasUnknownSizeValue) { - length = null - } - - // Set source to object. - source = object - - action = async function * () { - for (const part of blobParts) { - if (part.stream) { - yield * part.stream() - } else { - yield part - } + if(type === 'web' || type === 'both') { + args[0] = localStorage; + rval = func.apply(this, args); + done = true; } + } catch(ex) { + exception = ex; } - - // Set type to `multipart/form-data; boundary=`, - // followed by the multipart/form-data boundary string generated - // by the multipart/form-data encoding algorithm. - type = 'multipart/form-data; boundary=' + boundary - } else if (isBlobLike(object)) { - // Blob - - // Set source to object. - source = object - - // Set length to object’s size. - length = object.size - - // If object’s type attribute is not the empty byte sequence, set - // type to its value. - if (object.type) { - type = object.type - } - } else if (typeof object[Symbol.asyncIterator] === 'function') { - // If keepalive is true, then throw a TypeError. - if (keepalive) { - throw new TypeError('keepalive') - } - - // If object is disturbed or locked, then throw a TypeError. - if (util.isDisturbed(object) || object.locked) { - throw new TypeError( - 'Response body object should not be disturbed or locked' - ) + if(done) { + break; } - - stream = - object instanceof ReadableStream ? object : ReadableStreamFrom(object) - } - - // 11. If source is a byte sequence, then set action to a - // step that returns source and length to source’s length. - if (typeof source === 'string' || util.isBuffer(source)) { - length = Buffer.byteLength(source) - } - - // 12. If action is non-null, then run these steps in in parallel: - if (action != null) { - // Run action. - let iterator - stream = new ReadableStream({ - async start () { - iterator = action(object)[Symbol.asyncIterator]() - }, - async pull (controller) { - const { value, done } = await iterator.next() - if (done) { - // When running action is done, close stream. - queueMicrotask(() => { - controller.close() - }) - } else { - // Whenever one or more bytes are available and stream is not errored, - // enqueue a Uint8Array wrapping an ArrayBuffer containing the available - // bytes into stream. - if (!isErrored(stream)) { - controller.enqueue(new Uint8Array(value)) - } - } - return controller.desiredSize > 0 - }, - async cancel (reason) { - await iterator.return() - }, - type: undefined - }) - } - - // 13. Let body be a body whose stream is stream, source is source, - // and length is length. - const body = { stream, source, length } - - // 14. Return (body, type). - return [body, type] -} - -// https://fetch.spec.whatwg.org/#bodyinit-safely-extract -function safelyExtractBody (object, keepalive = false) { - if (!ReadableStream) { - // istanbul ignore next - ReadableStream = (__nccwpck_require__(35356).ReadableStream) } - // To safely extract a body and a `Content-Type` value from - // a byte sequence or BodyInit object object, run these steps: - - // 1. If object is a ReadableStream object, then: - if (object instanceof ReadableStream) { - // Assert: object is neither disturbed nor locked. - // istanbul ignore next - assert(!util.isDisturbed(object), 'The body has already been consumed.') - // istanbul ignore next - assert(!object.locked, 'The stream is locked.') + if(!done) { + throw exception; } - // 2. Return the results of extracting object. - return extractBody(object, keepalive) -} + return rval; +}; -function cloneBody (body) { - // To clone a body body, run these steps: +/** + * Stores an item on local disk. + * + * The available types of local storage include 'flash', 'web', and 'both'. + * + * The type 'flash' refers to flash local storage (SharedObject). In order + * to use flash local storage, the 'api' parameter must be valid. The type + * 'web' refers to WebStorage, if supported by the browser. The type 'both' + * refers to storing using both 'flash' and 'web', not just one or the + * other. + * + * The location array should list the storage types to use in order of + * preference: + * + * ['flash']: flash only storage + * ['web']: web only storage + * ['both']: try to store in both + * ['flash','web']: store in flash first, but if not available, 'web' + * ['web','flash']: store in web first, but if not available, 'flash' + * + * The location array defaults to: ['web', 'flash'] + * + * @param api the flash interface, null to use only WebStorage. + * @param id the storage ID to use. + * @param key the key for the item. + * @param data the data for the item (any javascript object/primitive). + * @param location an array with the preferred types of storage to use. + */ +util.setItem = function(api, id, key, data, location) { + _callStorageFunction(_setItem, arguments, location); +}; - // https://fetch.spec.whatwg.org/#concept-body-clone +/** + * Gets an item on local disk. + * + * Set setItem() for details on storage types. + * + * @param api the flash interface, null to use only WebStorage. + * @param id the storage ID to use. + * @param key the key for the item. + * @param location an array with the preferred types of storage to use. + * + * @return the item. + */ +util.getItem = function(api, id, key, location) { + return _callStorageFunction(_getItem, arguments, location); +}; - // 1. Let « out1, out2 » be the result of teeing body’s stream. - const [out1, out2] = body.stream.tee() - const out2Clone = structuredClone(out2, { transfer: [out2] }) - // This, for whatever reasons, unrefs out2Clone which allows - // the process to exit by itself. - const [, finalClone] = out2Clone.tee() +/** + * Removes an item on local disk. + * + * Set setItem() for details on storage types. + * + * @param api the flash interface. + * @param id the storage ID to use. + * @param key the key for the item. + * @param location an array with the preferred types of storage to use. + */ +util.removeItem = function(api, id, key, location) { + _callStorageFunction(_removeItem, arguments, location); +}; - // 2. Set body’s stream to out1. - body.stream = out1 +/** + * Clears the local disk storage identified by the given ID. + * + * Set setItem() for details on storage types. + * + * @param api the flash interface if flash is available. + * @param id the storage ID to use. + * @param location an array with the preferred types of storage to use. + */ +util.clearItems = function(api, id, location) { + _callStorageFunction(_clearItems, arguments, location); +}; - // 3. Return a body whose stream is out2 and other members are copied from body. - return { - stream: finalClone, - length: body.length, - source: body.source +/** + * Parses the scheme, host, and port from an http(s) url. + * + * @param str the url string. + * + * @return the parsed url object or null if the url is invalid. + */ +util.parseUrl = function(str) { + // FIXME: this regex looks a bit broken + var regex = /^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g; + regex.lastIndex = 0; + var m = regex.exec(str); + var url = (m === null) ? null : { + full: str, + scheme: m[1], + host: m[2], + port: m[3], + path: m[4] + }; + if(url) { + url.fullHost = url.host; + if(url.port) { + if(url.port !== 80 && url.scheme === 'http') { + url.fullHost += ':' + url.port; + } else if(url.port !== 443 && url.scheme === 'https') { + url.fullHost += ':' + url.port; + } + } else if(url.scheme === 'http') { + url.port = 80; + } else if(url.scheme === 'https') { + url.port = 443; + } + url.full = url.scheme + '://' + url.fullHost; } -} + return url; +}; -async function * consumeBody (body) { - if (body) { - if (isUint8Array(body)) { - yield body - } else { - const stream = body.stream +/* Storage for query variables */ +var _queryVariables = null; - if (util.isDisturbed(stream)) { - throw new TypeError('The body has already been consumed.') +/** + * Returns the window location query variables. Query is parsed on the first + * call and the same object is returned on subsequent calls. The mapping + * is from keys to an array of values. Parameters without values will have + * an object key set but no value added to the value array. Values are + * unescaped. + * + * ...?k1=v1&k2=v2: + * { + * "k1": ["v1"], + * "k2": ["v2"] + * } + * + * ...?k1=v1&k1=v2: + * { + * "k1": ["v1", "v2"] + * } + * + * ...?k1=v1&k2: + * { + * "k1": ["v1"], + * "k2": [] + * } + * + * ...?k1=v1&k1: + * { + * "k1": ["v1"] + * } + * + * ...?k1&k1: + * { + * "k1": [] + * } + * + * @param query the query string to parse (optional, default to cached + * results from parsing window location search query). + * + * @return object mapping keys to variables. + */ +util.getQueryVariables = function(query) { + var parse = function(q) { + var rval = {}; + var kvpairs = q.split('&'); + for(var i = 0; i < kvpairs.length; i++) { + var pos = kvpairs[i].indexOf('='); + var key; + var val; + if(pos > 0) { + key = kvpairs[i].substring(0, pos); + val = kvpairs[i].substring(pos + 1); + } else { + key = kvpairs[i]; + val = null; } - - if (stream.locked) { - throw new TypeError('The stream is locked.') + if(!(key in rval)) { + rval[key] = []; + } + // disallow overriding object prototype keys + if(!(key in Object.prototype) && val !== null) { + rval[key].push(unescape(val)); } + } + return rval; + }; - // Compat. - stream[kBodyUsed] = true + var rval; + if(typeof(query) === 'undefined') { + // set cached variables if needed + if(_queryVariables === null) { + if(typeof(window) !== 'undefined' && window.location && window.location.search) { + // parse window search query + _queryVariables = parse(window.location.search.substring(1)); + } else { + // no query variables available + _queryVariables = {}; + } + } + rval = _queryVariables; + } else { + // parse given query + rval = parse(query); + } + return rval; +}; - yield * stream - } +/** + * Parses a fragment into a path and query. This method will take a URI + * fragment and break it up as if it were the main URI. For example: + * /bar/baz?a=1&b=2 + * results in: + * { + * path: ["bar", "baz"], + * query: {"k1": ["v1"], "k2": ["v2"]} + * } + * + * @return object with a path array and query object. + */ +util.parseFragment = function(fragment) { + // default to whole fragment + var fp = fragment; + var fq = ''; + // split into path and query if possible at the first '?' + var pos = fragment.indexOf('?'); + if(pos > 0) { + fp = fragment.substring(0, pos); + fq = fragment.substring(pos + 1); } -} - -function throwIfAborted (state) { - if (state.aborted) { - throw new DOMException('The operation was aborted.', 'AbortError') + // split path based on '/' and ignore first element if empty + var path = fp.split('/'); + if(path.length > 0 && path[0] === '') { + path.shift(); } -} - -function bodyMixinMethods (instance) { - const methods = { - blob () { - // The blob() method steps are to return the result of - // running consume body with this and the following step - // given a byte sequence bytes: return a Blob whose - // contents are bytes and whose type attribute is this’s - // MIME type. - return specConsumeBody(this, (bytes) => { - let mimeType = bodyMimeType(this) - - if (mimeType === 'failure') { - mimeType = '' - } else if (mimeType) { - mimeType = serializeAMimeType(mimeType) - } - - // Return a Blob whose contents are bytes and type attribute - // is mimeType. - return new Blob([bytes], { type: mimeType }) - }, instance) - }, - - arrayBuffer () { - // The arrayBuffer() method steps are to return the result - // of running consume body with this and the following step - // given a byte sequence bytes: return a new ArrayBuffer - // whose contents are bytes. - return specConsumeBody(this, (bytes) => { - return new Uint8Array(bytes).buffer - }, instance) - }, + // convert query into object + var query = (fq === '') ? {} : util.getQueryVariables(fq); - text () { - // The text() method steps are to return the result of running - // consume body with this and UTF-8 decode. - return specConsumeBody(this, utf8DecodeBytes, instance) - }, + return { + pathString: fp, + queryString: fq, + path: path, + query: query + }; +}; - json () { - // The json() method steps are to return the result of running - // consume body with this and parse JSON from bytes. - return specConsumeBody(this, parseJSONFromBytes, instance) +/** + * Makes a request out of a URI-like request string. This is intended to + * be used where a fragment id (after a URI '#') is parsed as a URI with + * path and query parts. The string should have a path beginning and + * delimited by '/' and optional query parameters following a '?'. The + * query should be a standard URL set of key value pairs delimited by + * '&'. For backwards compatibility the initial '/' on the path is not + * required. The request object has the following API, (fully described + * in the method code): + * { + * path: . + * query: , + * getPath(i): get part or all of the split path array, + * getQuery(k, i): get part or all of a query key array, + * getQueryLast(k, _default): get last element of a query key array. + * } + * + * @return object with request parameters. + */ +util.makeRequest = function(reqString) { + var frag = util.parseFragment(reqString); + var req = { + // full path string + path: frag.pathString, + // full query string + query: frag.queryString, + /** + * Get path or element in path. + * + * @param i optional path index. + * + * @return path or part of path if i provided. + */ + getPath: function(i) { + return (typeof(i) === 'undefined') ? frag.path : frag.path[i]; }, - - async formData () { - webidl.brandCheck(this, instance) - - throwIfAborted(this[kState]) - - const contentType = this.headers.get('Content-Type') - - // If mimeType’s essence is "multipart/form-data", then: - if (/multipart\/form-data/.test(contentType)) { - const headers = {} - for (const [key, value] of this.headers) headers[key.toLowerCase()] = value - - const responseFormData = new FormData() - - let busboy - - try { - busboy = new Busboy({ - headers, - preservePath: true - }) - } catch (err) { - throw new DOMException(`${err}`, 'AbortError') + /** + * Get query, values for a key, or value for a key index. + * + * @param k optional query key. + * @param i optional query key index. + * + * @return query, values for a key, or value for a key index. + */ + getQuery: function(k, i) { + var rval; + if(typeof(k) === 'undefined') { + rval = frag.query; + } else { + rval = frag.query[k]; + if(rval && typeof(i) !== 'undefined') { + rval = rval[i]; } + } + return rval; + }, + getQueryLast: function(k, _default) { + var rval; + var vals = req.getQuery(k); + if(vals) { + rval = vals[vals.length - 1]; + } else { + rval = _default; + } + return rval; + } + }; + return req; +}; - busboy.on('field', (name, value) => { - responseFormData.append(name, value) - }) - busboy.on('file', (name, value, filename, encoding, mimeType) => { - const chunks = [] - - if (encoding === 'base64' || encoding.toLowerCase() === 'base64') { - let base64chunk = '' - - value.on('data', (chunk) => { - base64chunk += chunk.toString().replace(/[\r\n]/gm, '') - - const end = base64chunk.length - base64chunk.length % 4 - chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64')) - - base64chunk = base64chunk.slice(end) - }) - value.on('end', () => { - chunks.push(Buffer.from(base64chunk, 'base64')) - responseFormData.append(name, new File(chunks, filename, { type: mimeType })) - }) - } else { - value.on('data', (chunk) => { - chunks.push(chunk) - }) - value.on('end', () => { - responseFormData.append(name, new File(chunks, filename, { type: mimeType })) - }) - } - }) - - const busboyResolve = new Promise((resolve, reject) => { - busboy.on('finish', resolve) - busboy.on('error', (err) => reject(new TypeError(err))) - }) - - if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk) - busboy.end() - await busboyResolve - - return responseFormData - } else if (/application\/x-www-form-urlencoded/.test(contentType)) { - // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then: - - // 1. Let entries be the result of parsing bytes. - let entries - try { - let text = '' - // application/x-www-form-urlencoded parser will keep the BOM. - // https://url.spec.whatwg.org/#concept-urlencoded-parser - // Note that streaming decoder is stateful and cannot be reused - const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true }) - - for await (const chunk of consumeBody(this[kState].body)) { - if (!isUint8Array(chunk)) { - throw new TypeError('Expected Uint8Array chunk') - } - text += streamingDecoder.decode(chunk, { stream: true }) - } - text += streamingDecoder.decode() - entries = new URLSearchParams(text) - } catch (err) { - // istanbul ignore next: Unclear when new URLSearchParams can fail on a string. - // 2. If entries is failure, then throw a TypeError. - throw Object.assign(new TypeError(), { cause: err }) - } +/** + * Makes a URI out of a path, an object with query parameters, and a + * fragment. Uses jQuery.param() internally for query string creation. + * If the path is an array, it will be joined with '/'. + * + * @param path string path or array of strings. + * @param query object with query parameters. (optional) + * @param fragment fragment string. (optional) + * + * @return string object with request parameters. + */ +util.makeLink = function(path, query, fragment) { + // join path parts if needed + path = jQuery.isArray(path) ? path.join('/') : path; - // 3. Return a new FormData object whose entries are entries. - const formData = new FormData() - for (const [name, value] of entries) { - formData.append(name, value) - } - return formData - } else { - // Wait a tick before checking if the request has been aborted. - // Otherwise, a TypeError can be thrown when an AbortError should. - await Promise.resolve() + var qstr = jQuery.param(query || {}); + fragment = fragment || ''; + return path + + ((qstr.length > 0) ? ('?' + qstr) : '') + + ((fragment.length > 0) ? ('#' + fragment) : ''); +}; - throwIfAborted(this[kState]) +/** + * Check if an object is empty. + * + * Taken from: + * http://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object-from-json/679937#679937 + * + * @param object the object to check. + */ +util.isEmpty = function(obj) { + for(var prop in obj) { + if(obj.hasOwnProperty(prop)) { + return false; + } + } + return true; +}; - // Otherwise, throw a TypeError. - throw webidl.errors.exception({ - header: `${instance.name}.formData`, - message: 'Could not parse content as FormData.' - }) +/** + * Format with simple printf-style interpolation. + * + * %%: literal '%' + * %s,%o: convert next argument into a string. + * + * @param format the string to format. + * @param ... arguments to interpolate into the format string. + */ +util.format = function(format) { + var re = /%./g; + // current match + var match; + // current part + var part; + // current arg index + var argi = 0; + // collected parts to recombine later + var parts = []; + // last index found + var last = 0; + // loop while matches remain + while((match = re.exec(format))) { + part = format.substring(last, re.lastIndex - 2); + // don't add empty strings (ie, parts between %s%s) + if(part.length > 0) { + parts.push(part); + } + last = re.lastIndex; + // switch on % code + var code = match[0][1]; + switch(code) { + case 's': + case 'o': + // check if enough arguments were given + if(argi < arguments.length) { + parts.push(arguments[argi++ + 1]); + } else { + parts.push(''); } + break; + // FIXME: do proper formating for numbers, etc + //case 'f': + //case 'd': + case '%': + parts.push('%'); + break; + default: + parts.push('<%' + code + '?>'); } } - - return methods -} - -function mixinBody (prototype) { - Object.assign(prototype.prototype, bodyMixinMethods(prototype)) -} + // add trailing part of format string + parts.push(format.substring(last)); + return parts.join(''); +}; /** - * @see https://fetch.spec.whatwg.org/#concept-body-consume-body - * @param {Response|Request} object - * @param {(value: unknown) => unknown} convertBytesToJSValue - * @param {Response|Request} instance + * Formats a number. + * + * http://snipplr.com/view/5945/javascript-numberformat--ported-from-php/ */ -async function specConsumeBody (object, convertBytesToJSValue, instance) { - webidl.brandCheck(object, instance) +util.formatNumber = function(number, decimals, dec_point, thousands_sep) { + // http://kevin.vanzonneveld.net + // + original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) + // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + bugfix by: Michael White (http://crestidg.com) + // + bugfix by: Benjamin Lupton + // + bugfix by: Allan Jensen (http://www.winternet.no) + // + revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) + // * example 1: number_format(1234.5678, 2, '.', ''); + // * returns 1: 1234.57 - throwIfAborted(object[kState]) + var n = number, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals; + var d = dec_point === undefined ? ',' : dec_point; + var t = thousands_sep === undefined ? + '.' : thousands_sep, s = n < 0 ? '-' : ''; + var i = parseInt((n = Math.abs(+n || 0).toFixed(c)), 10) + ''; + var j = (i.length > 3) ? i.length % 3 : 0; + return s + (j ? i.substr(0, j) + t : '') + + i.substr(j).replace(/(\d{3})(?=\d)/g, '$1' + t) + + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ''); +}; - // 1. If object is unusable, then return a promise rejected - // with a TypeError. - if (bodyUnusable(object[kState].body)) { - throw new TypeError('Body is unusable') +/** + * Formats a byte size. + * + * http://snipplr.com/view/5949/format-humanize-file-byte-size-presentation-in-javascript/ + */ +util.formatSize = function(size) { + if(size >= 1073741824) { + size = util.formatNumber(size / 1073741824, 2, '.', '') + ' GiB'; + } else if(size >= 1048576) { + size = util.formatNumber(size / 1048576, 2, '.', '') + ' MiB'; + } else if(size >= 1024) { + size = util.formatNumber(size / 1024, 0) + ' KiB'; + } else { + size = util.formatNumber(size, 0) + ' bytes'; } + return size; +}; - // 2. Let promise be a new promise. - const promise = createDeferredPromise() - - // 3. Let errorSteps given error be to reject promise with error. - const errorSteps = (error) => promise.reject(error) +/** + * Converts an IPv4 or IPv6 string representation into bytes (in network order). + * + * @param ip the IPv4 or IPv6 address to convert. + * + * @return the 4-byte IPv6 or 16-byte IPv6 address or null if the address can't + * be parsed. + */ +util.bytesFromIP = function(ip) { + if(ip.indexOf('.') !== -1) { + return util.bytesFromIPv4(ip); + } + if(ip.indexOf(':') !== -1) { + return util.bytesFromIPv6(ip); + } + return null; +}; - // 4. Let successSteps given a byte sequence data be to resolve - // promise with the result of running convertBytesToJSValue - // with data. If that threw an exception, then run errorSteps - // with that exception. - const successSteps = (data) => { - try { - promise.resolve(convertBytesToJSValue(data)) - } catch (e) { - errorSteps(e) +/** + * Converts an IPv4 string representation into bytes (in network order). + * + * @param ip the IPv4 address to convert. + * + * @return the 4-byte address or null if the address can't be parsed. + */ +util.bytesFromIPv4 = function(ip) { + ip = ip.split('.'); + if(ip.length !== 4) { + return null; + } + var b = util.createBuffer(); + for(var i = 0; i < ip.length; ++i) { + var num = parseInt(ip[i], 10); + if(isNaN(num)) { + return null; } + b.putByte(num); } + return b.getBytes(); +}; - // 5. If object’s body is null, then run successSteps with an - // empty byte sequence. - if (object[kState].body == null) { - successSteps(new Uint8Array()) - return promise.promise +/** + * Converts an IPv6 string representation into bytes (in network order). + * + * @param ip the IPv6 address to convert. + * + * @return the 16-byte address or null if the address can't be parsed. + */ +util.bytesFromIPv6 = function(ip) { + var blanks = 0; + ip = ip.split(':').filter(function(e) { + if(e.length === 0) ++blanks; + return true; + }); + var zeros = (8 - ip.length + blanks) * 2; + var b = util.createBuffer(); + for(var i = 0; i < 8; ++i) { + if(!ip[i] || ip[i].length === 0) { + b.fillWithByte(0, zeros); + zeros = 0; + continue; + } + var bytes = util.hexToBytes(ip[i]); + if(bytes.length < 2) { + b.putByte(0); + } + b.putBytes(bytes); } - - // 6. Otherwise, fully read object’s body given successSteps, - // errorSteps, and object’s relevant global object. - await fullyReadBody(object[kState].body, successSteps, errorSteps) - - // 7. Return promise. - return promise.promise -} - -// https://fetch.spec.whatwg.org/#body-unusable -function bodyUnusable (body) { - // An object including the Body interface mixin is - // said to be unusable if its body is non-null and - // its body’s stream is disturbed or locked. - return body != null && (body.stream.locked || util.isDisturbed(body.stream)) -} + return b.getBytes(); +}; /** - * @see https://encoding.spec.whatwg.org/#utf-8-decode - * @param {Buffer} buffer + * Converts 4-bytes into an IPv4 string representation or 16-bytes into + * an IPv6 string representation. The bytes must be in network order. + * + * @param bytes the bytes to convert. + * + * @return the IPv4 or IPv6 string representation if 4 or 16 bytes, + * respectively, are given, otherwise null. */ -function utf8DecodeBytes (buffer) { - if (buffer.length === 0) { - return '' +util.bytesToIP = function(bytes) { + if(bytes.length === 4) { + return util.bytesToIPv4(bytes); } - - // 1. Let buffer be the result of peeking three bytes from - // ioQueue, converted to a byte sequence. - - // 2. If buffer is 0xEF 0xBB 0xBF, then read three - // bytes from ioQueue. (Do nothing with those bytes.) - if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) { - buffer = buffer.subarray(3) + if(bytes.length === 16) { + return util.bytesToIPv6(bytes); } - - // 3. Process a queue with an instance of UTF-8’s - // decoder, ioQueue, output, and "replacement". - const output = textDecoder.decode(buffer) - - // 4. Return output. - return output -} + return null; +}; /** - * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value - * @param {Uint8Array} bytes + * Converts 4-bytes into an IPv4 string representation. The bytes must be + * in network order. + * + * @param bytes the bytes to convert. + * + * @return the IPv4 string representation or null for an invalid # of bytes. */ -function parseJSONFromBytes (bytes) { - return JSON.parse(utf8DecodeBytes(bytes)) -} +util.bytesToIPv4 = function(bytes) { + if(bytes.length !== 4) { + return null; + } + var ip = []; + for(var i = 0; i < bytes.length; ++i) { + ip.push(bytes.charCodeAt(i)); + } + return ip.join('.'); +}; /** - * @see https://fetch.spec.whatwg.org/#concept-body-mime-type - * @param {import('./response').Response|import('./request').Request} object + * Converts 16-bytes into an IPv16 string representation. The bytes must be + * in network order. + * + * @param bytes the bytes to convert. + * + * @return the IPv16 string representation or null for an invalid # of bytes. */ -function bodyMimeType (object) { - const { headersList } = object[kState] - const contentType = headersList.get('content-type') - - if (contentType === null) { - return 'failure' +util.bytesToIPv6 = function(bytes) { + if(bytes.length !== 16) { + return null; } + var ip = []; + var zeroGroups = []; + var zeroMaxGroup = 0; + for(var i = 0; i < bytes.length; i += 2) { + var hex = util.bytesToHex(bytes[i] + bytes[i + 1]); + // canonicalize zero representation + while(hex[0] === '0' && hex !== '0') { + hex = hex.substr(1); + } + if(hex === '0') { + var last = zeroGroups[zeroGroups.length - 1]; + var idx = ip.length; + if(!last || idx !== last.end + 1) { + zeroGroups.push({start: idx, end: idx}); + } else { + last.end = idx; + if((last.end - last.start) > + (zeroGroups[zeroMaxGroup].end - zeroGroups[zeroMaxGroup].start)) { + zeroMaxGroup = zeroGroups.length - 1; + } + } + } + ip.push(hex); + } + if(zeroGroups.length > 0) { + var group = zeroGroups[zeroMaxGroup]; + // only shorten group of length > 0 + if(group.end - group.start > 0) { + ip.splice(group.start, group.end - group.start + 1, ''); + if(group.start === 0) { + ip.unshift(''); + } + if(group.end === 7) { + ip.push(''); + } + } + } + return ip.join(':'); +}; - return parseMIMEType(contentType) -} - -module.exports = { - extractBody, - safelyExtractBody, - cloneBody, - mixinBody -} - - -/***/ }), - -/***/ 93541: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - - -const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(71267) - -const corsSafeListedMethods = ['GET', 'HEAD', 'POST'] -const corsSafeListedMethodsSet = new Set(corsSafeListedMethods) - -const nullBodyStatus = [101, 204, 205, 304] - -const redirectStatus = [301, 302, 303, 307, 308] -const redirectStatusSet = new Set(redirectStatus) - -// https://fetch.spec.whatwg.org/#block-bad-port -const badPorts = [ - '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79', - '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137', - '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532', - '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723', - '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697', - '10080' -] - -const badPortsSet = new Set(badPorts) - -// https://w3c.github.io/webappsec-referrer-policy/#referrer-policies -const referrerPolicy = [ - '', - 'no-referrer', - 'no-referrer-when-downgrade', - 'same-origin', - 'origin', - 'strict-origin', - 'origin-when-cross-origin', - 'strict-origin-when-cross-origin', - 'unsafe-url' -] -const referrerPolicySet = new Set(referrerPolicy) - -const requestRedirect = ['follow', 'manual', 'error'] - -const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE'] -const safeMethodsSet = new Set(safeMethods) - -const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors'] - -const requestCredentials = ['omit', 'same-origin', 'include'] - -const requestCache = [ - 'default', - 'no-store', - 'reload', - 'no-cache', - 'force-cache', - 'only-if-cached' -] - -// https://fetch.spec.whatwg.org/#request-body-header-name -const requestBodyHeader = [ - 'content-encoding', - 'content-language', - 'content-location', - 'content-type', - // See https://github.com/nodejs/undici/issues/2021 - // 'Content-Length' is a forbidden header name, which is typically - // removed in the Headers implementation. However, undici doesn't - // filter out headers, so we add it here. - 'content-length' -] - -// https://fetch.spec.whatwg.org/#enumdef-requestduplex -const requestDuplex = [ - 'half' -] +/** + * Estimates the number of processes that can be run concurrently. If + * creating Web Workers, keep in mind that the main JavaScript process needs + * its own core. + * + * @param options the options to use: + * update true to force an update (not use the cached value). + * @param callback(err, max) called once the operation completes. + */ +util.estimateCores = function(options, callback) { + if(typeof options === 'function') { + callback = options; + options = {}; + } + options = options || {}; + if('cores' in util && !options.update) { + return callback(null, util.cores); + } + if(typeof navigator !== 'undefined' && + 'hardwareConcurrency' in navigator && + navigator.hardwareConcurrency > 0) { + util.cores = navigator.hardwareConcurrency; + return callback(null, util.cores); + } + if(typeof Worker === 'undefined') { + // workers not available + util.cores = 1; + return callback(null, util.cores); + } + if(typeof Blob === 'undefined') { + // can't estimate, default to 2 + util.cores = 2; + return callback(null, util.cores); + } -// http://fetch.spec.whatwg.org/#forbidden-method -const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK'] -const forbiddenMethodsSet = new Set(forbiddenMethods) + // create worker concurrency estimation code as blob + var blobUrl = URL.createObjectURL(new Blob(['(', + function() { + self.addEventListener('message', function(e) { + // run worker for 4 ms + var st = Date.now(); + var et = st + 4; + while(Date.now() < et); + self.postMessage({st: st, et: et}); + }); + }.toString(), + ')()'], {type: 'application/javascript'})); -const subresource = [ - 'audio', - 'audioworklet', - 'font', - 'image', - 'manifest', - 'paintworklet', - 'script', - 'style', - 'track', - 'video', - 'xslt', - '' -] -const subresourceSet = new Set(subresource) + // take 5 samples using 16 workers + sample([], 5, 16); -/** @type {globalThis['DOMException']} */ -const DOMException = globalThis.DOMException ?? (() => { - // DOMException was only made a global in Node v17.0.0, - // but fetch supports >= v16.8. - try { - atob('~') - } catch (err) { - return Object.getPrototypeOf(err).constructor + function sample(max, samples, numWorkers) { + if(samples === 0) { + // get overlap average + var avg = Math.floor(max.reduce(function(avg, x) { + return avg + x; + }, 0) / max.length); + util.cores = Math.max(1, avg); + URL.revokeObjectURL(blobUrl); + return callback(null, util.cores); + } + map(numWorkers, function(err, results) { + max.push(reduce(numWorkers, results)); + sample(max, samples - 1, numWorkers); + }); } -})() -let channel - -/** @type {globalThis['structuredClone']} */ -const structuredClone = - globalThis.structuredClone ?? - // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js - // structuredClone was added in v17.0.0, but fetch supports v16.8 - function structuredClone (value, options = undefined) { - if (arguments.length === 0) { - throw new TypeError('missing argument') + function map(numWorkers, callback) { + var workers = []; + var results = []; + for(var i = 0; i < numWorkers; ++i) { + var worker = new Worker(blobUrl); + worker.addEventListener('message', function(e) { + results.push(e.data); + if(results.length === numWorkers) { + for(var i = 0; i < numWorkers; ++i) { + workers[i].terminate(); + } + callback(null, results); + } + }); + workers.push(worker); } - - if (!channel) { - channel = new MessageChannel() + for(var i = 0; i < numWorkers; ++i) { + workers[i].postMessage(i); } - channel.port1.unref() - channel.port2.unref() - channel.port1.postMessage(value, options?.transfer) - return receiveMessageOnPort(channel.port2).message } -module.exports = { - DOMException, - structuredClone, - subresource, - forbiddenMethods, - requestBodyHeader, - referrerPolicy, - requestRedirect, - requestMode, - requestCredentials, - requestCache, - redirectStatus, - corsSafeListedMethods, - nullBodyStatus, - safeMethods, - badPorts, - requestDuplex, - subresourceSet, - badPortsSet, - redirectStatusSet, - corsSafeListedMethodsSet, - safeMethodsSet, - forbiddenMethodsSet, - referrerPolicySet -} + function reduce(numWorkers, results) { + // find overlapping time windows + var overlaps = []; + for(var n = 0; n < numWorkers; ++n) { + var r1 = results[n]; + var overlap = overlaps[n] = []; + for(var i = 0; i < numWorkers; ++i) { + if(n === i) { + continue; + } + var r2 = results[i]; + if((r1.st > r2.st && r1.st < r2.et) || + (r2.st > r1.st && r2.st < r1.et)) { + overlap.push(i); + } + } + } + // get maximum overlaps ... don't include overlapping worker itself + // as the main JS process was also being scheduled during the work and + // would have to be subtracted from the estimate anyway + return overlaps.reduce(function(max, overlap) { + return Math.max(max, overlap.length); + }, 0); + } +}; /***/ }), -/***/ 50096: +/***/ 79816: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const assert = __nccwpck_require__(39491) -const { atob } = __nccwpck_require__(14300) -const { isomorphicDecode } = __nccwpck_require__(79453) +var wrappy = __nccwpck_require__(48655) +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) -const encoder = new TextEncoder() +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) -/** - * @see https://mimesniff.spec.whatwg.org/#http-token-code-point - */ -const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/ -const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line -/** - * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point - */ -const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) -// https://fetch.spec.whatwg.org/#data-url-processor -/** @param {URL} dataURL */ -function dataURLProcessor (dataURL) { - // 1. Assert: dataURL’s scheme is "data". - assert(dataURL.protocol === 'data:') +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} - // 2. Let input be the result of running the URL - // serializer on dataURL with exclude fragment - // set to true. - let input = URLSerializer(dataURL, true) +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} - // 3. Remove the leading "data:" string from input. - input = input.slice(5) - // 4. Let position point at the start of input. - const position = { position: 0 } +/***/ }), - // 5. Let mimeType be the result of collecting a - // sequence of code points that are not equal - // to U+002C (,), given position. - let mimeType = collectASequenceOfCodePointsFast( - ',', - input, - position - ) +/***/ 3425: +/***/ ((module) => { - // 6. Strip leading and trailing ASCII whitespace - // from mimeType. - // Undici implementation note: we need to store the - // length because if the mimetype has spaces removed, - // the wrong amount will be sliced from the input in - // step #9 - const mimeTypeLength = mimeType.length - mimeType = removeASCIIWhitespace(mimeType, true, true) - // 7. If position is past the end of input, then - // return failure - if (position.position >= input.length) { - return 'failure' - } - // 8. Advance position by 1. - position.position++ +const pDefer = () => { + const deferred = {}; - // 9. Let encodedBody be the remainder of input. - const encodedBody = input.slice(mimeTypeLength + 1) + deferred.promise = new Promise((resolve, reject) => { + deferred.resolve = resolve; + deferred.reject = reject; + }); - // 10. Let body be the percent-decoding of encodedBody. - let body = stringPercentDecode(encodedBody) + return deferred; +}; - // 11. If mimeType ends with U+003B (;), followed by - // zero or more U+0020 SPACE, followed by an ASCII - // case-insensitive match for "base64", then: - if (/;(\u0020){0,}base64$/i.test(mimeType)) { - // 1. Let stringBody be the isomorphic decode of body. - const stringBody = isomorphicDecode(body) +module.exports = pDefer; - // 2. Set body to the forgiving-base64 decode of - // stringBody. - body = forgivingBase64(stringBody) - // 3. If body is failure, then return failure. - if (body === 'failure') { - return 'failure' - } +/***/ }), - // 4. Remove the last 6 code points from mimeType. - mimeType = mimeType.slice(0, -6) +/***/ 54968: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // 5. Remove trailing U+0020 SPACE code points from mimeType, - // if any. - mimeType = mimeType.replace(/(\u0020)+$/, '') +const Fifo = __nccwpck_require__(36938) +const defer = __nccwpck_require__(3425) - // 6. Remove the last U+003B (;) code point from mimeType. - mimeType = mimeType.slice(0, -1) +module.exports = class PFifo { + constructor () { + this._buffer = new Fifo() + this._waitingConsumers = new Fifo() } - // 12. If mimeType starts with U+003B (;), then prepend - // "text/plain" to mimeType. - if (mimeType.startsWith(';')) { - mimeType = 'text/plain' + mimeType + push (chunk) { + const { promise, resolve } = defer() + this._buffer.push({ chunk, resolve }) + this._consume() + return promise } - // 13. Let mimeTypeRecord be the result of parsing - // mimeType. - let mimeTypeRecord = parseMIMEType(mimeType) - - // 14. If mimeTypeRecord is failure, then set - // mimeTypeRecord to text/plain;charset=US-ASCII. - if (mimeTypeRecord === 'failure') { - mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII') + _consume () { + while (!this._waitingConsumers.isEmpty() && !this._buffer.isEmpty()) { + const nextConsumer = this._waitingConsumers.shift() + const nextChunk = this._buffer.shift() + nextConsumer.resolve(nextChunk.chunk) + nextChunk.resolve() + } } - // 15. Return a new data: URL struct whose MIME - // type is mimeTypeRecord and body is body. - // https://fetch.spec.whatwg.org/#data-url-struct - return { mimeType: mimeTypeRecord, body } -} - -// https://url.spec.whatwg.org/#concept-url-serializer -/** - * @param {URL} url - * @param {boolean} excludeFragment - */ -function URLSerializer (url, excludeFragment = false) { - if (!excludeFragment) { - return url.href + shift () { + const { promise, resolve } = defer() + this._waitingConsumers.push({ resolve }) + this._consume() + return promise } - const href = url.href - const hashLength = url.hash.length - - return hashLength === 0 ? href : href.substring(0, href.length - hashLength) + isEmpty () { + return this._buffer.isEmpty() + } } -// https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points -/** - * @param {(char: string) => boolean} condition - * @param {string} input - * @param {{ position: number }} position - */ -function collectASequenceOfCodePoints (condition, input, position) { - // 1. Let result be the empty string. - let result = '' - - // 2. While position doesn’t point past the end of input and the - // code point at position within input meets the condition condition: - while (position.position < input.length && condition(input[position.position])) { - // 1. Append that code point to the end of result. - result += input[position.position] - // 2. Advance position by 1. - position.position++ - } +/***/ }), - // 3. Return result. - return result -} +/***/ 31728: +/***/ ((module, exports, __nccwpck_require__) => { -/** - * A faster collectASequenceOfCodePoints that only works when comparing a single character. - * @param {string} char - * @param {string} input - * @param {{ position: number }} position +/* + * Id is an object representation of a peer Id. a peer Id is a multihash */ -function collectASequenceOfCodePointsFast (char, input, position) { - const idx = input.indexOf(char, position.position) - const start = position.position - if (idx === -1) { - position.position = input.length - return input.slice(start) - } - position.position = idx - return input.slice(start, position.position) -} -// https://url.spec.whatwg.org/#string-percent-decode -/** @param {string} input */ -function stringPercentDecode (input) { - // 1. Let bytes be the UTF-8 encoding of input. - const bytes = encoder.encode(input) +const { CID } = __nccwpck_require__(62058) +const b32 = __nccwpck_require__(40281) +const b36 = __nccwpck_require__(51970) +const b58 = __nccwpck_require__(96229) +const b64 = __nccwpck_require__(62561) +const { base58btc } = __nccwpck_require__(96229) +const { base32 } = __nccwpck_require__(40281) +const { base16 } = __nccwpck_require__(50515) +const Digest = __nccwpck_require__(91428) +const cryptoKeys = __nccwpck_require__(19428) +const withIs = __nccwpck_require__(48965) +const { PeerIdProto } = __nccwpck_require__(63796) +const { equals: uint8ArrayEquals } = __nccwpck_require__(13872) +const { fromString: uint8ArrayFromString } = __nccwpck_require__(7433) +const { toString: uint8ArrayToString } = __nccwpck_require__(43840) +const { identity } = __nccwpck_require__(8930) - // 2. Return the percent-decoding of bytes. - return percentDecode(bytes) +const bases = { + ...b32, + ...b36, + ...b58, + ...b64 } +const baseDecoder = Object.keys(bases).reduce( + (acc, curr) => acc.or(bases[curr]), + base32.decoder +) -// https://url.spec.whatwg.org/#percent-decode -/** @param {Uint8Array} input */ -function percentDecode (input) { - // 1. Let output be an empty byte sequence. - /** @type {number[]} */ - const output = [] - - // 2. For each byte byte in input: - for (let i = 0; i < input.length; i++) { - const byte = input[i] - - // 1. If byte is not 0x25 (%), then append byte to output. - if (byte !== 0x25) { - output.push(byte) - - // 2. Otherwise, if byte is 0x25 (%) and the next two bytes - // after byte in input are not in the ranges - // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F), - // and 0x61 (a) to 0x66 (f), all inclusive, append byte - // to output. - } else if ( - byte === 0x25 && - !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2])) - ) { - output.push(0x25) - - // 3. Otherwise: - } else { - // 1. Let bytePoint be the two bytes after byte in input, - // decoded, and then interpreted as hexadecimal number. - const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2]) - const bytePoint = Number.parseInt(nextTwoBytes, 16) - - // 2. Append a byte whose value is bytePoint to output. - output.push(bytePoint) +// these values are from https://github.com/multiformats/multicodec/blob/master/table.csv +const DAG_PB_CODE = 0x70 +const LIBP2P_KEY_CODE = 0x72 - // 3. Skip the next two bytes in input. - i += 2 +class PeerId { + constructor (id, privKey, pubKey) { + if (!(id instanceof Uint8Array)) { + throw new Error('invalid id provided') } - } - - // 3. Return output. - return Uint8Array.from(output) -} - -// https://mimesniff.spec.whatwg.org/#parse-a-mime-type -/** @param {string} input */ -function parseMIMEType (input) { - // 1. Remove any leading and trailing HTTP whitespace - // from input. - input = removeHTTPWhitespace(input, true, true) - - // 2. Let position be a position variable for input, - // initially pointing at the start of input. - const position = { position: 0 } - // 3. Let type be the result of collecting a sequence - // of code points that are not U+002F (/) from - // input, given position. - const type = collectASequenceOfCodePointsFast( - '/', - input, - position - ) + if (privKey && pubKey && !uint8ArrayEquals(privKey.public.bytes, pubKey.bytes)) { + throw new Error('inconsistent arguments') + } - // 4. If type is the empty string or does not solely - // contain HTTP token code points, then return failure. - // https://mimesniff.spec.whatwg.org/#http-token-code-point - if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) { - return 'failure' + this._id = id + this._idB58String = base58btc.encode(this.id).substring(1) + this._privKey = privKey + this._pubKey = pubKey } - // 5. If position is past the end of input, then return - // failure - if (position.position > input.length) { - return 'failure' + get id () { + return this._id } - // 6. Advance position by 1. (This skips past U+002F (/).) - position.position++ - - // 7. Let subtype be the result of collecting a sequence of - // code points that are not U+003B (;) from input, given - // position. - let subtype = collectASequenceOfCodePointsFast( - ';', - input, - position - ) - - // 8. Remove any trailing HTTP whitespace from subtype. - subtype = removeHTTPWhitespace(subtype, false, true) - - // 9. If subtype is the empty string or does not solely - // contain HTTP token code points, then return failure. - if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) { - return 'failure' + set id (val) { + throw new Error('Id is immutable') } - const typeLowercase = type.toLowerCase() - const subtypeLowercase = subtype.toLowerCase() - - // 10. Let mimeType be a new MIME type record whose type - // is type, in ASCII lowercase, and subtype is subtype, - // in ASCII lowercase. - // https://mimesniff.spec.whatwg.org/#mime-type - const mimeType = { - type: typeLowercase, - subtype: subtypeLowercase, - /** @type {Map} */ - parameters: new Map(), - // https://mimesniff.spec.whatwg.org/#mime-type-essence - essence: `${typeLowercase}/${subtypeLowercase}` + get privKey () { + return this._privKey } - // 11. While position is not past the end of input: - while (position.position < input.length) { - // 1. Advance position by 1. (This skips past U+003B (;).) - position.position++ - - // 2. Collect a sequence of code points that are HTTP - // whitespace from input given position. - collectASequenceOfCodePoints( - // https://fetch.spec.whatwg.org/#http-whitespace - char => HTTP_WHITESPACE_REGEX.test(char), - input, - position - ) - - // 3. Let parameterName be the result of collecting a - // sequence of code points that are not U+003B (;) - // or U+003D (=) from input, given position. - let parameterName = collectASequenceOfCodePoints( - (char) => char !== ';' && char !== '=', - input, - position - ) - - // 4. Set parameterName to parameterName, in ASCII - // lowercase. - parameterName = parameterName.toLowerCase() - - // 5. If position is not past the end of input, then: - if (position.position < input.length) { - // 1. If the code point at position within input is - // U+003B (;), then continue. - if (input[position.position] === ';') { - continue - } + set privKey (privKey) { + this._privKey = privKey + } - // 2. Advance position by 1. (This skips past U+003D (=).) - position.position++ + get pubKey () { + if (this._pubKey) { + return this._pubKey } - // 6. If position is past the end of input, then break. - if (position.position > input.length) { - break + if (this._privKey) { + return this._privKey.public } - // 7. Let parameterValue be null. - let parameterValue = null - - // 8. If the code point at position within input is - // U+0022 ("), then: - if (input[position.position] === '"') { - // 1. Set parameterValue to the result of collecting - // an HTTP quoted string from input, given position - // and the extract-value flag. - parameterValue = collectAnHTTPQuotedString(input, position, true) - - // 2. Collect a sequence of code points that are not - // U+003B (;) from input, given position. - collectASequenceOfCodePointsFast( - ';', - input, - position - ) - - // 9. Otherwise: - } else { - // 1. Set parameterValue to the result of collecting - // a sequence of code points that are not U+003B (;) - // from input, given position. - parameterValue = collectASequenceOfCodePointsFast( - ';', - input, - position - ) - - // 2. Remove any trailing HTTP whitespace from parameterValue. - parameterValue = removeHTTPWhitespace(parameterValue, false, true) + try { + const decoded = Digest.decode(this.id) - // 3. If parameterValue is the empty string, then continue. - if (parameterValue.length === 0) { - continue + if (decoded.code === identity.code) { + this._pubKey = cryptoKeys.unmarshalPublicKey(decoded.digest) } + } catch (_) { + // Ignore, there is no valid public key } - // 10. If all of the following are true - // - parameterName is not the empty string - // - parameterName solely contains HTTP token code points - // - parameterValue solely contains HTTP quoted-string token code points - // - mimeType’s parameters[parameterName] does not exist - // then set mimeType’s parameters[parameterName] to parameterValue. - if ( - parameterName.length !== 0 && - HTTP_TOKEN_CODEPOINTS.test(parameterName) && - (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) && - !mimeType.parameters.has(parameterName) - ) { - mimeType.parameters.set(parameterName, parameterValue) - } + return this._pubKey } - // 12. Return mimeType. - return mimeType -} - -// https://infra.spec.whatwg.org/#forgiving-base64-decode -/** @param {string} data */ -function forgivingBase64 (data) { - // 1. Remove all ASCII whitespace from data. - data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line + set pubKey (pubKey) { + this._pubKey = pubKey + } - // 2. If data’s code point length divides by 4 leaving - // no remainder, then: - if (data.length % 4 === 0) { - // 1. If data ends with one or two U+003D (=) code points, - // then remove them from data. - data = data.replace(/=?=$/, '') + // Return the protobuf version of the public key, matching go ipfs formatting + marshalPubKey () { + if (this.pubKey) { + return cryptoKeys.marshalPublicKey(this.pubKey) + } } - // 3. If data’s code point length divides by 4 leaving - // a remainder of 1, then return failure. - if (data.length % 4 === 1) { - return 'failure' + // Return the protobuf version of the private key, matching go ipfs formatting + marshalPrivKey () { + if (this.privKey) { + return cryptoKeys.marshalPrivateKey(this.privKey) + } } - // 4. If data contains a code point that is not one of - // U+002B (+) - // U+002F (/) - // ASCII alphanumeric - // then return failure. - if (/[^+/0-9A-Za-z]/.test(data)) { - return 'failure' + // Return the protobuf version of the peer-id + marshal (excludePriv) { + return PeerIdProto.encode({ + id: this.toBytes(), + pubKey: this.marshalPubKey(), + privKey: excludePriv ? null : this.marshalPrivKey() + }).finish() } - const binary = atob(data) - const bytes = new Uint8Array(binary.length) + toPrint () { + let pid = this.toB58String() + // All sha256 nodes start with Qm + // We can skip the Qm to make the peer.ID more useful + if (pid.startsWith('Qm')) { + pid = pid.slice(2) + } + let maxRunes = 6 + if (pid.length < maxRunes) { + maxRunes = pid.length + } - for (let byte = 0; byte < binary.length; byte++) { - bytes[byte] = binary.charCodeAt(byte) + return '' } - return bytes -} + // return the jsonified version of the key, matching the formatting + // of go-ipfs for its config file + toJSON () { + return { + id: this.toB58String(), + privKey: toB64Opt(this.marshalPrivKey()), + pubKey: toB64Opt(this.marshalPubKey()) + } + } -// https://fetch.spec.whatwg.org/#collect-an-http-quoted-string -// tests: https://fetch.spec.whatwg.org/#example-http-quoted-string -/** - * @param {string} input - * @param {{ position: number }} position - * @param {boolean?} extractValue - */ -function collectAnHTTPQuotedString (input, position, extractValue) { - // 1. Let positionStart be position. - const positionStart = position.position + // encode/decode functions + toHexString () { + return base16.encode(this.id).substring(1) + } - // 2. Let value be the empty string. - let value = '' + toBytes () { + return this.id + } - // 3. Assert: the code point at position within input - // is U+0022 ("). - assert(input[position.position] === '"') + toB58String () { + return this._idB58String + } - // 4. Advance position by 1. - position.position++ + // return self-describing String representation + // in default format from RFC 0001: https://github.com/libp2p/specs/pull/209 + toString () { + if (!this._idCIDString) { + const cid = CID.createV1(LIBP2P_KEY_CODE, Digest.decode(this.id)) - // 5. While true: - while (true) { - // 1. Append the result of collecting a sequence of code points - // that are not U+0022 (") or U+005C (\) from input, given - // position, to value. - value += collectASequenceOfCodePoints( - (char) => char !== '"' && char !== '\\', - input, - position - ) + Object.defineProperty(this, '_idCIDString', { + value: cid.toString(), + enumerable: false + }) + } + return this._idCIDString + } - // 2. If position is past the end of input, then break. - if (position.position >= input.length) { - break + /** + * Checks the equality of `this` peer against a given PeerId. + * + * @param {Uint8Array|PeerId} id + * @returns {boolean} + */ + equals (id) { + if (id instanceof Uint8Array) { + return uint8ArrayEquals(this.id, id) + } else if (id.id) { + return uint8ArrayEquals(this.id, id.id) + } else { + throw new Error('not valid Id') } + } - // 3. Let quoteOrBackslash be the code point at position within - // input. - const quoteOrBackslash = input[position.position] + /** + * Checks the equality of `this` peer against a given PeerId. + * + * @deprecated Use `.equals` + * @param {Uint8Array|PeerId} id + * @returns {boolean} + */ + isEqual (id) { + return this.equals(id) + } - // 4. Advance position by 1. - position.position++ + /* + * Check if this PeerId instance is valid (privKey -> pubKey -> Id) + */ + isValid () { + // TODO: needs better checking + return Boolean(this.privKey && + this.privKey.public && + this.privKey.public.bytes && + this.pubKey.bytes instanceof Uint8Array && + uint8ArrayEquals(this.privKey.public.bytes, this.pubKey.bytes)) + } - // 5. If quoteOrBackslash is U+005C (\), then: - if (quoteOrBackslash === '\\') { - // 1. If position is past the end of input, then append - // U+005C (\) to value and break. - if (position.position >= input.length) { - value += '\\' - break - } + /** + * Check if the PeerId has an inline public key. + * + * @returns {boolean} + */ + hasInlinePublicKey () { + try { + const decoded = Digest.decode(this.id) - // 2. Append the code point at position within input to value. - value += input[position.position] + if (decoded.code === identity.code) { + return true + } + } catch (_) { + // Ignore, there is no valid public key + } - // 3. Advance position by 1. - position.position++ + return false + } +} - // 6. Otherwise: - } else { - // 1. Assert: quoteOrBackslash is U+0022 ("). - assert(quoteOrBackslash === '"') +const PeerIdWithIs = withIs(PeerId, { + className: 'PeerId', + symbolName: '@libp2p/js-peer-id/PeerId' +}) - // 2. Break. - break - } - } +exports = module.exports = PeerIdWithIs - // 6. If the extract-value flag is set, then return value. - if (extractValue) { - return value +const computeDigest = (pubKey) => { + if (pubKey.bytes.length <= 42) { + return Digest.create(identity.code, pubKey.bytes).bytes + } else { + return pubKey.hash() } - - // 7. Return the code points from positionStart to position, - // inclusive, within input. - return input.slice(positionStart, position.position) } -/** - * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type - */ -function serializeAMimeType (mimeType) { - assert(mimeType !== 'failure') - const { parameters, essence } = mimeType +const computePeerId = async (privKey, pubKey) => { + const digest = await computeDigest(pubKey) + return new PeerIdWithIs(digest, privKey, pubKey) +} - // 1. Let serialization be the concatenation of mimeType’s - // type, U+002F (/), and mimeType’s subtype. - let serialization = essence +// generation +exports.create = async (opts) => { + opts = opts || {} + opts.bits = opts.bits || 2048 + opts.keyType = opts.keyType || 'RSA' - // 2. For each name → value of mimeType’s parameters: - for (let [name, value] of parameters.entries()) { - // 1. Append U+003B (;) to serialization. - serialization += ';' + const key = await cryptoKeys.generateKeyPair(opts.keyType, opts.bits) + return computePeerId(key, key.public) +} - // 2. Append name to serialization. - serialization += name +exports.createFromHexString = (str) => { + return new PeerIdWithIs(base16.decode('f' + str)) +} - // 3. Append U+003D (=) to serialization. - serialization += '=' +exports.createFromBytes = (buf) => { + try { + const cid = CID.decode(buf) - // 4. If value does not solely contain HTTP token code - // points or value is the empty string, then: - if (!HTTP_TOKEN_CODEPOINTS.test(value)) { - // 1. Precede each occurence of U+0022 (") or - // U+005C (\) in value with U+005C (\). - value = value.replace(/(\\|")/g, '\\$1') + if (!validMulticodec(cid)) { + throw new Error('Supplied PeerID CID is invalid') + } - // 2. Prepend U+0022 (") to value. - value = '"' + value + return exports.createFromCID(cid) + } catch { + const digest = Digest.decode(buf) - // 3. Append U+0022 (") to value. - value += '"' + if (digest.code !== identity.code) { + throw new Error('Supplied PeerID CID is invalid') } - // 5. Append value to serialization. - serialization += value + return new PeerIdWithIs(buf) } - - // 3. Return serialization. - return serialization } -/** - * @see https://fetch.spec.whatwg.org/#http-whitespace - * @param {string} char - */ -function isHTTPWhiteSpace (char) { - return char === '\r' || char === '\n' || char === '\t' || char === ' ' +exports.createFromB58String = (str) => { + return exports.createFromBytes(base58btc.decode('z' + str)) } -/** - * @see https://fetch.spec.whatwg.org/#http-whitespace - * @param {string} str - */ -function removeHTTPWhitespace (str, leading = true, trailing = true) { - let lead = 0 - let trail = str.length - 1 +const validMulticodec = (cid) => { + // supported: 'libp2p-key' (CIDv1) and 'dag-pb' (CIDv0 converted to CIDv1) + return cid.code === LIBP2P_KEY_CODE || cid.code === DAG_PB_CODE +} - if (leading) { - for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++); - } +exports.createFromCID = (cid) => { + cid = CID.asCID(cid) - if (trailing) { - for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--); + if (!cid || !validMulticodec(cid)) { + throw new Error('Supplied PeerID CID is invalid') } - return str.slice(lead, trail + 1) -} - -/** - * @see https://infra.spec.whatwg.org/#ascii-whitespace - * @param {string} char - */ -function isASCIIWhitespace (char) { - return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' ' + return new PeerIdWithIs(cid.multihash.bytes) } -/** - * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace - */ -function removeASCIIWhitespace (str, leading = true, trailing = true) { - let lead = 0 - let trail = str.length - 1 +// Public Key input will be a Uint8Array +exports.createFromPubKey = async (key) => { + let buf = key - if (leading) { - for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++); + if (typeof buf === 'string') { + buf = uint8ArrayFromString(key, 'base64pad') } - if (trailing) { - for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--); + if (!(buf instanceof Uint8Array)) { + throw new Error('Supplied key is neither a base64 string nor a Uint8Array') } - return str.slice(lead, trail + 1) + const pubKey = await cryptoKeys.unmarshalPublicKey(buf) + return computePeerId(undefined, pubKey) } -module.exports = { - dataURLProcessor, - URLSerializer, - collectASequenceOfCodePoints, - collectASequenceOfCodePointsFast, - stringPercentDecode, - parseMIMEType, - collectAnHTTPQuotedString, - serializeAMimeType +// Private key input will be a string +exports.createFromPrivKey = async (key) => { + if (typeof key === 'string') { + key = uint8ArrayFromString(key, 'base64pad') + } + + if (!(key instanceof Uint8Array)) { + throw new Error('Supplied key is neither a base64 string nor a Uint8Array') + } + + const privKey = await cryptoKeys.unmarshalPrivateKey(key) + return computePeerId(privKey, privKey.public) } +exports.createFromJSON = async (obj) => { + const id = base58btc.decode('z' + obj.id) + const rawPrivKey = obj.privKey && uint8ArrayFromString(obj.privKey, 'base64pad') + const rawPubKey = obj.pubKey && uint8ArrayFromString(obj.pubKey, 'base64pad') + const pub = rawPubKey && await cryptoKeys.unmarshalPublicKey(rawPubKey) -/***/ }), + if (!rawPrivKey) { + return new PeerIdWithIs(id, undefined, pub) + } -/***/ 96670: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + const privKey = await cryptoKeys.unmarshalPrivateKey(rawPrivKey) + const privDigest = await computeDigest(privKey.public) + let pubDigest + if (pub) { + pubDigest = await computeDigest(pub) + } -const { Blob, File: NativeFile } = __nccwpck_require__(14300) -const { types } = __nccwpck_require__(73837) -const { kState } = __nccwpck_require__(46938) -const { isBlobLike } = __nccwpck_require__(79453) -const { webidl } = __nccwpck_require__(96138) -const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(50096) -const { kEnumerableProperty } = __nccwpck_require__(67468) -const encoder = new TextEncoder() + if (pub && !uint8ArrayEquals(privDigest, pubDigest)) { + throw new Error('Public and private key do not match') + } -class File extends Blob { - constructor (fileBits, fileName, options = {}) { - // The File constructor is invoked with two or three parameters, depending - // on whether the optional dictionary parameter is used. When the File() - // constructor is invoked, user agents must run the following steps: - webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' }) + if (id && !uint8ArrayEquals(privDigest, id)) { + throw new Error('Id and private key do not match') + } - fileBits = webidl.converters['sequence'](fileBits) - fileName = webidl.converters.USVString(fileName) - options = webidl.converters.FilePropertyBag(options) + return new PeerIdWithIs(id, privKey, pub) +} - // 1. Let bytes be the result of processing blob parts given fileBits and - // options. - // Note: Blob handles this for us +exports.createFromProtobuf = async (buf) => { + if (typeof buf === 'string') { + buf = uint8ArrayFromString(buf, 'base16') + } - // 2. Let n be the fileName argument to the constructor. - const n = fileName + let { id, privKey, pubKey } = PeerIdProto.decode(buf) - // 3. Process FilePropertyBag dictionary argument by running the following - // substeps: + privKey = privKey ? await cryptoKeys.unmarshalPrivateKey(privKey) : false + pubKey = pubKey ? await cryptoKeys.unmarshalPublicKey(pubKey) : false - // 1. If the type member is provided and is not the empty string, let t - // be set to the type dictionary member. If t contains any characters - // outside the range U+0020 to U+007E, then set t to the empty string - // and return from these substeps. - // 2. Convert every character in t to ASCII lowercase. - let t = options.type - let d + let pubDigest + let privDigest - // eslint-disable-next-line no-labels - substep: { - if (t) { - t = parseMIMEType(t) + if (privKey) { + privDigest = await computeDigest(privKey.public) + } - if (t === 'failure') { - t = '' - // eslint-disable-next-line no-labels - break substep - } + if (pubKey) { + pubDigest = await computeDigest(pubKey) + } - t = serializeAMimeType(t).toLowerCase() + if (privKey) { + if (pubKey) { + if (!uint8ArrayEquals(privDigest, pubDigest)) { + throw new Error('Public and private key do not match') } - - // 3. If the lastModified member is provided, let d be set to the - // lastModified dictionary member. If it is not provided, set d to the - // current date and time represented as the number of milliseconds since - // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]). - d = options.lastModified } + return new PeerIdWithIs(privDigest, privKey, privKey.public) + } - // 4. Return a new File object F such that: - // F refers to the bytes byte sequence. - // F.size is set to the number of total bytes in bytes. - // F.name is set to n. - // F.type is set to t. - // F.lastModified is set to d. + // TODO: val id and pubDigest - super(processBlobParts(fileBits, options), { type: t }) - this[kState] = { - name: n, - lastModified: d, - type: t - } + if (pubKey) { + return new PeerIdWithIs(pubDigest, undefined, pubKey) } - get name () { - webidl.brandCheck(this, File) - - return this[kState].name + if (id) { + return new PeerIdWithIs(id) } - get lastModified () { - webidl.brandCheck(this, File) + throw new Error('Protobuf did not contain any usable key material') +} - return this[kState].lastModified +exports.parse = (str) => { + if (str.charAt(0) === '1' || str.charAt(0) === 'Q') { + // identity hash ed25519 key or sha2-256 hash of rsa public key + // base58btc encoded either way + str = `z${str}` } - get type () { - webidl.brandCheck(this, File) + return exports.createFromBytes(baseDecoder.decode(str)) +} - return this[kState].type +exports.isPeerId = (peerId) => { + return Boolean(typeof peerId === 'object' && + peerId._id && + peerId._idB58String) +} + +function toB64Opt (val) { + if (val) { + return uint8ArrayToString(val, 'base64pad') } } -class FileLike { - constructor (blobLike, fileName, options = {}) { - // TODO: argument idl type check - // The File constructor is invoked with two or three parameters, depending - // on whether the optional dictionary parameter is used. When the File() - // constructor is invoked, user agents must run the following steps: +/***/ }), - // 1. Let bytes be the result of processing blob parts given fileBits and - // options. +/***/ 63796: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // 2. Let n be the fileName argument to the constructor. - const n = fileName +/*eslint-disable*/ - // 3. Process FilePropertyBag dictionary argument by running the following - // substeps: - // 1. If the type member is provided and is not the empty string, let t - // be set to the type dictionary member. If t contains any characters - // outside the range U+0020 to U+007E, then set t to the empty string - // and return from these substeps. - // TODO - const t = options.type +var $protobuf = __nccwpck_require__(73295); - // 2. Convert every character in t to ASCII lowercase. - // TODO +// Common aliases +var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - // 3. If the lastModified member is provided, let d be set to the - // lastModified dictionary member. If it is not provided, set d to the - // current date and time represented as the number of milliseconds since - // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]). - const d = options.lastModified ?? Date.now() +// Exported root namespace +var $root = $protobuf.roots["libp2p-peer-id"] || ($protobuf.roots["libp2p-peer-id"] = {}); - // 4. Return a new File object F such that: - // F refers to the bytes byte sequence. - // F.size is set to the number of total bytes in bytes. - // F.name is set to n. - // F.type is set to t. - // F.lastModified is set to d. +$root.PeerIdProto = (function() { - this[kState] = { - blobLike, - name: n, - type: t, - lastModified: d + /** + * Properties of a PeerIdProto. + * @exports IPeerIdProto + * @interface IPeerIdProto + * @property {Uint8Array} id PeerIdProto id + * @property {Uint8Array|null} [pubKey] PeerIdProto pubKey + * @property {Uint8Array|null} [privKey] PeerIdProto privKey + */ + + /** + * Constructs a new PeerIdProto. + * @exports PeerIdProto + * @classdesc Represents a PeerIdProto. + * @implements IPeerIdProto + * @constructor + * @param {IPeerIdProto=} [p] Properties to set + */ + function PeerIdProto(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; } - } - stream (...args) { - webidl.brandCheck(this, FileLike) + /** + * PeerIdProto id. + * @member {Uint8Array} id + * @memberof PeerIdProto + * @instance + */ + PeerIdProto.prototype.id = $util.newBuffer([]); - return this[kState].blobLike.stream(...args) - } + /** + * PeerIdProto pubKey. + * @member {Uint8Array} pubKey + * @memberof PeerIdProto + * @instance + */ + PeerIdProto.prototype.pubKey = $util.newBuffer([]); - arrayBuffer (...args) { - webidl.brandCheck(this, FileLike) + /** + * PeerIdProto privKey. + * @member {Uint8Array} privKey + * @memberof PeerIdProto + * @instance + */ + PeerIdProto.prototype.privKey = $util.newBuffer([]); - return this[kState].blobLike.arrayBuffer(...args) - } + /** + * Encodes the specified PeerIdProto message. Does not implicitly {@link PeerIdProto.verify|verify} messages. + * @function encode + * @memberof PeerIdProto + * @static + * @param {IPeerIdProto} m PeerIdProto message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PeerIdProto.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + w.uint32(10).bytes(m.id); + if (m.pubKey != null && Object.hasOwnProperty.call(m, "pubKey")) + w.uint32(18).bytes(m.pubKey); + if (m.privKey != null && Object.hasOwnProperty.call(m, "privKey")) + w.uint32(26).bytes(m.privKey); + return w; + }; - slice (...args) { - webidl.brandCheck(this, FileLike) + /** + * Decodes a PeerIdProto message from the specified reader or buffer. + * @function decode + * @memberof PeerIdProto + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {PeerIdProto} PeerIdProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PeerIdProto.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.PeerIdProto(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.id = r.bytes(); + break; + case 2: + m.pubKey = r.bytes(); + break; + case 3: + m.privKey = r.bytes(); + break; + default: + r.skipType(t & 7); + break; + } + } + if (!m.hasOwnProperty("id")) + throw $util.ProtocolError("missing required 'id'", { instance: m }); + return m; + }; - return this[kState].blobLike.slice(...args) - } + /** + * Creates a PeerIdProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof PeerIdProto + * @static + * @param {Object.} d Plain object + * @returns {PeerIdProto} PeerIdProto + */ + PeerIdProto.fromObject = function fromObject(d) { + if (d instanceof $root.PeerIdProto) + return d; + var m = new $root.PeerIdProto(); + if (d.id != null) { + if (typeof d.id === "string") + $util.base64.decode(d.id, m.id = $util.newBuffer($util.base64.length(d.id)), 0); + else if (d.id.length) + m.id = d.id; + } + if (d.pubKey != null) { + if (typeof d.pubKey === "string") + $util.base64.decode(d.pubKey, m.pubKey = $util.newBuffer($util.base64.length(d.pubKey)), 0); + else if (d.pubKey.length) + m.pubKey = d.pubKey; + } + if (d.privKey != null) { + if (typeof d.privKey === "string") + $util.base64.decode(d.privKey, m.privKey = $util.newBuffer($util.base64.length(d.privKey)), 0); + else if (d.privKey.length) + m.privKey = d.privKey; + } + return m; + }; - text (...args) { - webidl.brandCheck(this, FileLike) + /** + * Creates a plain object from a PeerIdProto message. Also converts values to other types if specified. + * @function toObject + * @memberof PeerIdProto + * @static + * @param {PeerIdProto} m PeerIdProto + * @param {$protobuf.IConversionOptions} [o] Conversion options + * @returns {Object.} Plain object + */ + PeerIdProto.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.defaults) { + if (o.bytes === String) + d.id = ""; + else { + d.id = []; + if (o.bytes !== Array) + d.id = $util.newBuffer(d.id); + } + if (o.bytes === String) + d.pubKey = ""; + else { + d.pubKey = []; + if (o.bytes !== Array) + d.pubKey = $util.newBuffer(d.pubKey); + } + if (o.bytes === String) + d.privKey = ""; + else { + d.privKey = []; + if (o.bytes !== Array) + d.privKey = $util.newBuffer(d.privKey); + } + } + if (m.id != null && m.hasOwnProperty("id")) { + d.id = o.bytes === String ? $util.base64.encode(m.id, 0, m.id.length) : o.bytes === Array ? Array.prototype.slice.call(m.id) : m.id; + } + if (m.pubKey != null && m.hasOwnProperty("pubKey")) { + d.pubKey = o.bytes === String ? $util.base64.encode(m.pubKey, 0, m.pubKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.pubKey) : m.pubKey; + } + if (m.privKey != null && m.hasOwnProperty("privKey")) { + d.privKey = o.bytes === String ? $util.base64.encode(m.privKey, 0, m.privKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.privKey) : m.privKey; + } + return d; + }; - return this[kState].blobLike.text(...args) - } + /** + * Converts this PeerIdProto to JSON. + * @function toJSON + * @memberof PeerIdProto + * @instance + * @returns {Object.} JSON object + */ + PeerIdProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - get size () { - webidl.brandCheck(this, FileLike) + return PeerIdProto; +})(); - return this[kState].blobLike.size - } +module.exports = $root; - get type () { - webidl.brandCheck(this, FileLike) - return this[kState].blobLike.type - } +/***/ }), - get name () { - webidl.brandCheck(this, FileLike) +/***/ 73295: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return this[kState].name - } +// minimal library entry point. - get lastModified () { - webidl.brandCheck(this, FileLike) - return this[kState].lastModified - } +module.exports = __nccwpck_require__(73107); - get [Symbol.toStringTag] () { - return 'File' - } -} -Object.defineProperties(File.prototype, { - [Symbol.toStringTag]: { - value: 'File', - configurable: true - }, - name: kEnumerableProperty, - lastModified: kEnumerableProperty -}) +/***/ }), -webidl.converters.Blob = webidl.interfaceConverter(Blob) +/***/ 73107: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -webidl.converters.BlobPart = function (V, opts) { - if (webidl.util.Type(V) === 'Object') { - if (isBlobLike(V)) { - return webidl.converters.Blob(V, { strict: false }) - } - if ( - ArrayBuffer.isView(V) || - types.isAnyArrayBuffer(V) - ) { - return webidl.converters.BufferSource(V, opts) - } - } +var protobuf = exports; - return webidl.converters.USVString(V, opts) +/** + * Build type, one of `"full"`, `"light"` or `"minimal"`. + * @name build + * @type {string} + * @const + */ +protobuf.build = "minimal"; + +// Serialization +protobuf.Writer = __nccwpck_require__(35699); +protobuf.BufferWriter = __nccwpck_require__(10955); +protobuf.Reader = __nccwpck_require__(39044); +protobuf.BufferReader = __nccwpck_require__(79779); + +// Utility +protobuf.util = __nccwpck_require__(61452); +protobuf.rpc = __nccwpck_require__(61091); +protobuf.roots = __nccwpck_require__(20656); +protobuf.configure = configure; + +/* istanbul ignore next */ +/** + * Reconfigures the library according to the environment. + * @returns {undefined} + */ +function configure() { + protobuf.util._configure(); + protobuf.Writer._configure(protobuf.BufferWriter); + protobuf.Reader._configure(protobuf.BufferReader); } -webidl.converters['sequence'] = webidl.sequenceConverter( - webidl.converters.BlobPart -) +// Set up buffer utility according to the environment +configure(); -// https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag -webidl.converters.FilePropertyBag = webidl.dictionaryConverter([ - { - key: 'lastModified', - converter: webidl.converters['long long'], - get defaultValue () { - return Date.now() - } - }, - { - key: 'type', - converter: webidl.converters.DOMString, - defaultValue: '' - }, - { - key: 'endings', - converter: (value) => { - value = webidl.converters.DOMString(value) - value = value.toLowerCase() - if (value !== 'native') { - value = 'transparent' - } +/***/ }), - return value - }, - defaultValue: 'transparent' - } -]) +/***/ 39044: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * @see https://www.w3.org/TR/FileAPI/#process-blob-parts - * @param {(NodeJS.TypedArray|Blob|string)[]} parts - * @param {{ type: string, endings: string }} options - */ -function processBlobParts (parts, options) { - // 1. Let bytes be an empty sequence of bytes. - /** @type {NodeJS.TypedArray[]} */ - const bytes = [] - // 2. For each element in parts: - for (const element of parts) { - // 1. If element is a USVString, run the following substeps: - if (typeof element === 'string') { - // 1. Let s be element. - let s = element +module.exports = Reader; - // 2. If the endings member of options is "native", set s - // to the result of converting line endings to native - // of element. - if (options.endings === 'native') { - s = convertLineEndingsNative(s) - } +var util = __nccwpck_require__(61452); - // 3. Append the result of UTF-8 encoding s to bytes. - bytes.push(encoder.encode(s)) - } else if ( - types.isAnyArrayBuffer(element) || - types.isTypedArray(element) - ) { - // 2. If element is a BufferSource, get a copy of the - // bytes held by the buffer source, and append those - // bytes to bytes. - if (!element.buffer) { // ArrayBuffer - bytes.push(new Uint8Array(element)) - } else { - bytes.push( - new Uint8Array(element.buffer, element.byteOffset, element.byteLength) - ) - } - } else if (isBlobLike(element)) { - // 3. If element is a Blob, append the bytes it represents - // to bytes. - bytes.push(element) - } - } +var BufferReader; // cyclic - // 3. Return bytes. - return bytes +var LongBits = util.LongBits, + utf8 = util.utf8; + +/* istanbul ignore next */ +function indexOutOfRange(reader, writeLength) { + return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); } /** - * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native - * @param {string} s + * Constructs a new reader instance using the specified buffer. + * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. + * @constructor + * @param {Uint8Array} buffer Buffer to read from */ -function convertLineEndingsNative (s) { - // 1. Let native line ending be be the code point U+000A LF. - let nativeLineEnding = '\n' +function Reader(buffer) { - // 2. If the underlying platform’s conventions are to - // represent newlines as a carriage return and line feed - // sequence, set native line ending to the code point - // U+000D CR followed by the code point U+000A LF. - if (process.platform === 'win32') { - nativeLineEnding = '\r\n' - } + /** + * Read buffer. + * @type {Uint8Array} + */ + this.buf = buffer; - return s.replace(/\r?\n/g, nativeLineEnding) -} + /** + * Read buffer position. + * @type {number} + */ + this.pos = 0; -// If this function is moved to ./util.js, some tools (such as -// rollup) will warn about circular dependencies. See: -// https://github.com/nodejs/undici/issues/1629 -function isFileLike (object) { - return ( - (NativeFile && object instanceof NativeFile) || - object instanceof File || ( - object && - (typeof object.stream === 'function' || - typeof object.arrayBuffer === 'function') && - object[Symbol.toStringTag] === 'File' - ) - ) + /** + * Read buffer length. + * @type {number} + */ + this.len = buffer.length; } -module.exports = { File, FileLike, isFileLike } +var create_array = typeof Uint8Array !== "undefined" + ? function create_typed_array(buffer) { + if (buffer instanceof Uint8Array || Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + } + /* istanbul ignore next */ + : function create_array(buffer) { + if (Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + }; + +var create = function create() { + return util.Buffer + ? function create_buffer_setup(buffer) { + return (Reader.create = function create_buffer(buffer) { + return util.Buffer.isBuffer(buffer) + ? new BufferReader(buffer) + /* istanbul ignore next */ + : create_array(buffer); + })(buffer); + } + /* istanbul ignore next */ + : create_array; +}; + +/** + * Creates a new reader using the specified buffer. + * @function + * @param {Uint8Array|Buffer} buffer Buffer to read from + * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} + * @throws {Error} If `buffer` is not a valid buffer + */ +Reader.create = create(); +Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; -/***/ }), +/** + * Reads a varint as an unsigned 32 bit value. + * @function + * @returns {number} Value read + */ +Reader.prototype.uint32 = (function read_uint32_setup() { + var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) + return function read_uint32() { + value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; + + /* istanbul ignore if */ + if ((this.pos += 5) > this.len) { + this.pos = this.len; + throw indexOutOfRange(this, 10); + } + return value; + }; +})(); -/***/ 12692: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * Reads a varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.int32 = function read_int32() { + return this.uint32() | 0; +}; +/** + * Reads a zig-zag encoded varint as a signed 32 bit value. + * @returns {number} Value read + */ +Reader.prototype.sint32 = function read_sint32() { + var value = this.uint32(); + return value >>> 1 ^ -(value & 1) | 0; +}; +/* eslint-disable no-invalid-this */ -const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(79453) -const { kState } = __nccwpck_require__(46938) -const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(96670) -const { webidl } = __nccwpck_require__(96138) -const { Blob, File: NativeFile } = __nccwpck_require__(14300) +function readLongVarint() { + // tends to deopt with local vars for octet etc. + var bits = new LongBits(0, 0); + var i = 0; + if (this.len - this.pos > 4) { // fast route (lo) + for (; i < 4; ++i) { + // 1st..4th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 5th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + i = 0; + } else { + for (; i < 3; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 1st..3th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + // 4th + bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; + return bits; + } + if (this.len - this.pos > 4) { // fast route (hi) + for (; i < 5; ++i) { + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } else { + for (; i < 5; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } + /* istanbul ignore next */ + throw Error("invalid varint encoding"); +} -/** @type {globalThis['File']} */ -const File = NativeFile ?? UndiciFile +/* eslint-enable no-invalid-this */ -// https://xhr.spec.whatwg.org/#formdata -class FormData { - constructor (form) { - if (form !== undefined) { - throw webidl.errors.conversionFailed({ - prefix: 'FormData constructor', - argument: 'Argument 1', - types: ['undefined'] - }) - } +/** + * Reads a varint as a signed 64 bit value. + * @name Reader#int64 + * @function + * @returns {Long} Value read + */ - this[kState] = [] - } +/** + * Reads a varint as an unsigned 64 bit value. + * @name Reader#uint64 + * @function + * @returns {Long} Value read + */ - append (name, value, filename = undefined) { - webidl.brandCheck(this, FormData) +/** + * Reads a zig-zag encoded varint as a signed 64 bit value. + * @name Reader#sint64 + * @function + * @returns {Long} Value read + */ - webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' }) +/** + * Reads a varint as a boolean. + * @returns {boolean} Value read + */ +Reader.prototype.bool = function read_bool() { + return this.uint32() !== 0; +}; - if (arguments.length === 3 && !isBlobLike(value)) { - throw new TypeError( - "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'" - ) - } +function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` + return (buf[end - 4] + | buf[end - 3] << 8 + | buf[end - 2] << 16 + | buf[end - 1] << 24) >>> 0; +} - // 1. Let value be value if given; otherwise blobValue. +/** + * Reads fixed 32 bits as an unsigned 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.fixed32 = function read_fixed32() { - name = webidl.converters.USVString(name) - value = isBlobLike(value) - ? webidl.converters.Blob(value, { strict: false }) - : webidl.converters.USVString(value) - filename = arguments.length === 3 - ? webidl.converters.USVString(filename) - : undefined + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); - // 2. Let entry be the result of creating an entry with - // name, value, and filename if given. - const entry = makeEntry(name, value, filename) + return readFixed32_end(this.buf, this.pos += 4); +}; - // 3. Append entry to this’s entry list. - this[kState].push(entry) - } +/** + * Reads fixed 32 bits as a signed 32 bit integer. + * @returns {number} Value read + */ +Reader.prototype.sfixed32 = function read_sfixed32() { - delete (name) { - webidl.brandCheck(this, FormData) + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); - webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' }) + return readFixed32_end(this.buf, this.pos += 4) | 0; +}; - name = webidl.converters.USVString(name) +/* eslint-disable no-invalid-this */ - // The delete(name) method steps are to remove all entries whose name - // is name from this’s entry list. - this[kState] = this[kState].filter(entry => entry.name !== name) - } +function readFixed64(/* this: Reader */) { - get (name) { - webidl.brandCheck(this, FormData) + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 8); - webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' }) + return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); +} - name = webidl.converters.USVString(name) +/* eslint-enable no-invalid-this */ - // 1. If there is no entry whose name is name in this’s entry list, - // then return null. - const idx = this[kState].findIndex((entry) => entry.name === name) - if (idx === -1) { - return null - } +/** + * Reads fixed 64 bits. + * @name Reader#fixed64 + * @function + * @returns {Long} Value read + */ - // 2. Return the value of the first entry whose name is name from - // this’s entry list. - return this[kState][idx].value - } +/** + * Reads zig-zag encoded fixed 64 bits. + * @name Reader#sfixed64 + * @function + * @returns {Long} Value read + */ - getAll (name) { - webidl.brandCheck(this, FormData) +/** + * Reads a float (32 bit) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.float = function read_float() { - webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' }) + /* istanbul ignore if */ + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); - name = webidl.converters.USVString(name) + var value = util.float.readFloatLE(this.buf, this.pos); + this.pos += 4; + return value; +}; - // 1. If there is no entry whose name is name in this’s entry list, - // then return the empty list. - // 2. Return the values of all entries whose name is name, in order, - // from this’s entry list. - return this[kState] - .filter((entry) => entry.name === name) - .map((entry) => entry.value) - } +/** + * Reads a double (64 bit float) as a number. + * @function + * @returns {number} Value read + */ +Reader.prototype.double = function read_double() { - has (name) { - webidl.brandCheck(this, FormData) + /* istanbul ignore if */ + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 4); - webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' }) + var value = util.float.readDoubleLE(this.buf, this.pos); + this.pos += 8; + return value; +}; - name = webidl.converters.USVString(name) +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @returns {Uint8Array} Value read + */ +Reader.prototype.bytes = function read_bytes() { + var length = this.uint32(), + start = this.pos, + end = this.pos + length; - // The has(name) method steps are to return true if there is an entry - // whose name is name in this’s entry list; otherwise false. - return this[kState].findIndex((entry) => entry.name === name) !== -1 - } + /* istanbul ignore if */ + if (end > this.len) + throw indexOutOfRange(this, length); - set (name, value, filename = undefined) { - webidl.brandCheck(this, FormData) + this.pos += length; + if (Array.isArray(this.buf)) // plain array + return this.buf.slice(start, end); + return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 + ? new this.buf.constructor(0) + : this._slice.call(this.buf, start, end); +}; - webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' }) +/** + * Reads a string preceeded by its byte length as a varint. + * @returns {string} Value read + */ +Reader.prototype.string = function read_string() { + var bytes = this.bytes(); + return utf8.read(bytes, 0, bytes.length); +}; - if (arguments.length === 3 && !isBlobLike(value)) { - throw new TypeError( - "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'" - ) +/** + * Skips the specified number of bytes if specified, otherwise skips a varint. + * @param {number} [length] Length if known, otherwise a varint is assumed + * @returns {Reader} `this` + */ +Reader.prototype.skip = function skip(length) { + if (typeof length === "number") { + /* istanbul ignore if */ + if (this.pos + length > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + /* istanbul ignore if */ + if (this.pos >= this.len) + throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); } + return this; +}; - // The set(name, value) and set(name, blobValue, filename) method steps - // are: +/** + * Skips the next element of the specified wire type. + * @param {number} wireType Wire type received + * @returns {Reader} `this` + */ +Reader.prototype.skipType = function(wireType) { + switch (wireType) { + case 0: + this.skip(); + break; + case 1: + this.skip(8); + break; + case 2: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case 5: + this.skip(4); + break; - // 1. Let value be value if given; otherwise blobValue. + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; +}; - name = webidl.converters.USVString(name) - value = isBlobLike(value) - ? webidl.converters.Blob(value, { strict: false }) - : webidl.converters.USVString(value) - filename = arguments.length === 3 - ? toUSVString(filename) - : undefined +Reader._configure = function(BufferReader_) { + BufferReader = BufferReader_; + Reader.create = create(); + BufferReader._configure(); - // 2. Let entry be the result of creating an entry with name, value, and - // filename if given. - const entry = makeEntry(name, value, filename) + var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; + util.merge(Reader.prototype, { - // 3. If there are entries in this’s entry list whose name is name, then - // replace the first such entry with entry and remove the others. - const idx = this[kState].findIndex((entry) => entry.name === name) - if (idx !== -1) { - this[kState] = [ - ...this[kState].slice(0, idx), - entry, - ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name) - ] - } else { - // 4. Otherwise, append entry to this’s entry list. - this[kState].push(entry) - } - } + int64: function read_int64() { + return readLongVarint.call(this)[fn](false); + }, - entries () { - webidl.brandCheck(this, FormData) + uint64: function read_uint64() { + return readLongVarint.call(this)[fn](true); + }, - return makeIterator( - () => this[kState].map(pair => [pair.name, pair.value]), - 'FormData', - 'key+value' - ) - } + sint64: function read_sint64() { + return readLongVarint.call(this).zzDecode()[fn](false); + }, - keys () { - webidl.brandCheck(this, FormData) + fixed64: function read_fixed64() { + return readFixed64.call(this)[fn](true); + }, - return makeIterator( - () => this[kState].map(pair => [pair.name, pair.value]), - 'FormData', - 'key' - ) - } + sfixed64: function read_sfixed64() { + return readFixed64.call(this)[fn](false); + } - values () { - webidl.brandCheck(this, FormData) + }); +}; - return makeIterator( - () => this[kState].map(pair => [pair.name, pair.value]), - 'FormData', - 'value' - ) - } - /** - * @param {(value: string, key: string, self: FormData) => void} callbackFn - * @param {unknown} thisArg - */ - forEach (callbackFn, thisArg = globalThis) { - webidl.brandCheck(this, FormData) +/***/ }), - webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' }) +/***/ 79779: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (typeof callbackFn !== 'function') { - throw new TypeError( - "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'." - ) - } - for (const [key, value] of this) { - callbackFn.apply(thisArg, [value, key, this]) - } - } -} +module.exports = BufferReader; -FormData.prototype[Symbol.iterator] = FormData.prototype.entries +// extends Reader +var Reader = __nccwpck_require__(39044); +(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; -Object.defineProperties(FormData.prototype, { - [Symbol.toStringTag]: { - value: 'FormData', - configurable: true - } -}) +var util = __nccwpck_require__(61452); /** - * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry - * @param {string} name - * @param {string|Blob} value - * @param {?string} filename - * @returns + * Constructs a new buffer reader instance. + * @classdesc Wire format reader using node buffers. + * @extends Reader + * @constructor + * @param {Buffer} buffer Buffer to read from */ -function makeEntry (name, value, filename) { - // 1. Set name to the result of converting name into a scalar value string. - // "To convert a string into a scalar value string, replace any surrogates - // with U+FFFD." - // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end - name = Buffer.from(name).toString('utf8') +function BufferReader(buffer) { + Reader.call(this, buffer); - // 2. If value is a string, then set value to the result of converting - // value into a scalar value string. - if (typeof value === 'string') { - value = Buffer.from(value).toString('utf8') - } else { - // 3. Otherwise: + /** + * Read buffer. + * @name BufferReader#buf + * @type {Buffer} + */ +} - // 1. If value is not a File object, then set value to a new File object, - // representing the same bytes, whose name attribute value is "blob" - if (!isFileLike(value)) { - value = value instanceof Blob - ? new File([value], 'blob', { type: value.type }) - : new FileLike(value, 'blob', { type: value.type }) - } +BufferReader._configure = function () { + /* istanbul ignore else */ + if (util.Buffer) + BufferReader.prototype._slice = util.Buffer.prototype.slice; +}; - // 2. If filename is given, then set value to a new File object, - // representing the same bytes, whose name attribute is filename. - if (filename !== undefined) { - /** @type {FilePropertyBag} */ - const options = { - type: value.type, - lastModified: value.lastModified - } - value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile - ? new File([value], filename, options) - : new FileLike(value, filename, options) - } - } +/** + * @override + */ +BufferReader.prototype.string = function read_string_buffer() { + var len = this.uint32(); // modifies pos + return this.buf.utf8Slice + ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) + : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); +}; - // 4. Return an entry whose name is name and whose value is value. - return { name, value } -} +/** + * Reads a sequence of bytes preceeded by its length as a varint. + * @name BufferReader#bytes + * @function + * @returns {Buffer} Value read + */ -module.exports = { FormData } +BufferReader._configure(); /***/ }), -/***/ 64110: +/***/ 20656: /***/ ((module) => { +module.exports = {}; -// In case of breaking changes, increase the version -// number to avoid conflicts. -const globalOrigin = Symbol.for('undici.globalOrigin.1') +/** + * Named roots. + * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). + * Can also be used manually to make roots available accross modules. + * @name roots + * @type {Object.} + * @example + * // pbjs -r myroot -o compiled.js ... + * + * // in another module: + * require("./compiled.js"); + * + * // in any subsequent module: + * var root = protobuf.roots["myroot"]; + */ -function getGlobalOrigin () { - return globalThis[globalOrigin] -} -function setGlobalOrigin (newOrigin) { - if (newOrigin === undefined) { - Object.defineProperty(globalThis, globalOrigin, { - value: undefined, - writable: true, - enumerable: false, - configurable: false - }) +/***/ }), - return - } +/***/ 61091: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - const parsedURL = new URL(newOrigin) - if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') { - throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`) - } - Object.defineProperty(globalThis, globalOrigin, { - value: parsedURL, - writable: true, - enumerable: false, - configurable: false - }) -} +/** + * Streaming RPC helpers. + * @namespace + */ +var rpc = exports; -module.exports = { - getGlobalOrigin, - setGlobalOrigin -} +/** + * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. + * @typedef RPCImpl + * @type {function} + * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called + * @param {Uint8Array} requestData Request data + * @param {RPCImplCallback} callback Callback function + * @returns {undefined} + * @example + * function rpcImpl(method, requestData, callback) { + * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code + * throw Error("no such method"); + * asynchronouslyObtainAResponse(requestData, function(err, responseData) { + * callback(err, responseData); + * }); + * } + */ + +/** + * Node-style callback as used by {@link RPCImpl}. + * @typedef RPCImplCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error + * @returns {undefined} + */ + +rpc.Service = __nccwpck_require__(16594); /***/ }), -/***/ 23245: +/***/ 16594: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// https://github.com/Ethan-Arrowood/undici-fetch - +module.exports = Service; -const { kHeadersList, kConstruct } = __nccwpck_require__(48039) -const { kGuard } = __nccwpck_require__(46938) -const { kEnumerableProperty } = __nccwpck_require__(67468) -const { - makeIterator, - isValidHeaderName, - isValidHeaderValue -} = __nccwpck_require__(79453) -const { webidl } = __nccwpck_require__(96138) -const assert = __nccwpck_require__(39491) +var util = __nccwpck_require__(61452); -const kHeadersMap = Symbol('headers map') -const kHeadersSortedMap = Symbol('headers map sorted') +// Extends EventEmitter +(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; /** - * @param {number} code + * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * + * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. + * @typedef rpc.ServiceMethodCallback + * @template TRes extends Message + * @type {function} + * @param {Error|null} error Error, if any + * @param {TRes} [response] Response message + * @returns {undefined} */ -function isHTTPWhiteSpaceCharCode (code) { - return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020 -} /** - * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize - * @param {string} potentialValue + * A service method part of a {@link rpc.Service} as created by {@link Service.create}. + * @typedef rpc.ServiceMethod + * @template TReq extends Message + * @template TRes extends Message + * @type {function} + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message + * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` */ -function headerValueNormalize (potentialValue) { - // To normalize a byte sequence potentialValue, remove - // any leading and trailing HTTP whitespace bytes from - // potentialValue. - let i = 0; let j = potentialValue.length - while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j - while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i +/** + * Constructs a new RPC service instance. + * @classdesc An RPC service as returned by {@link Service#create}. + * @exports rpc.Service + * @extends util.EventEmitter + * @constructor + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ +function Service(rpcImpl, requestDelimited, responseDelimited) { - return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j) -} + if (typeof rpcImpl !== "function") + throw TypeError("rpcImpl must be a function"); -function fill (headers, object) { - // To fill a Headers object headers with a given object object, run these steps: + util.EventEmitter.call(this); - // 1. If object is a sequence, then for each header in object: - // Note: webidl conversion to array has already been done. - if (Array.isArray(object)) { - for (let i = 0; i < object.length; ++i) { - const header = object[i] - // 1. If header does not contain exactly two items, then throw a TypeError. - if (header.length !== 2) { - throw webidl.errors.exception({ - header: 'Headers constructor', - message: `expected name/value pair to be length 2, found ${header.length}.` - }) - } + /** + * RPC implementation. Becomes `null` once the service is ended. + * @type {RPCImpl|null} + */ + this.rpcImpl = rpcImpl; - // 2. Append (header’s first item, header’s second item) to headers. - appendHeader(headers, header[0], header[1]) - } - } else if (typeof object === 'object' && object !== null) { - // Note: null should throw + /** + * Whether requests are length-delimited. + * @type {boolean} + */ + this.requestDelimited = Boolean(requestDelimited); - // 2. Otherwise, object is a record, then for each key → value in object, - // append (key, value) to headers - const keys = Object.keys(object) - for (let i = 0; i < keys.length; ++i) { - appendHeader(headers, keys[i], object[keys[i]]) - } - } else { - throw webidl.errors.conversionFailed({ - prefix: 'Headers constructor', - argument: 'Argument 1', - types: ['sequence>', 'record'] - }) - } + /** + * Whether responses are length-delimited. + * @type {boolean} + */ + this.responseDelimited = Boolean(responseDelimited); } /** - * @see https://fetch.spec.whatwg.org/#concept-headers-append + * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. + * @param {Method|rpc.ServiceMethod} method Reflected or static method + * @param {Constructor} requestCtor Request constructor + * @param {Constructor} responseCtor Response constructor + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} callback Service callback + * @returns {undefined} + * @template TReq extends Message + * @template TRes extends Message */ -function appendHeader (headers, name, value) { - // 1. Normalize value. - value = headerValueNormalize(value) - - // 2. If name is not a header name or value is not a - // header value, then throw a TypeError. - if (!isValidHeaderName(name)) { - throw webidl.errors.invalidArgument({ - prefix: 'Headers.append', - value: name, - type: 'header name' - }) - } else if (!isValidHeaderValue(value)) { - throw webidl.errors.invalidArgument({ - prefix: 'Headers.append', - value, - type: 'header value' - }) - } - - // 3. If headers’s guard is "immutable", then throw a TypeError. - // 4. Otherwise, if headers’s guard is "request" and name is a - // forbidden header name, return. - // Note: undici does not implement forbidden header names - if (headers[kGuard] === 'immutable') { - throw new TypeError('immutable') - } else if (headers[kGuard] === 'request-no-cors') { - // 5. Otherwise, if headers’s guard is "request-no-cors": - // TODO - } - - // 6. Otherwise, if headers’s guard is "response" and name is a - // forbidden response-header name, return. - - // 7. Append (name, value) to headers’s header list. - return headers[kHeadersList].append(name, value) +Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { - // 8. If headers’s guard is "request-no-cors", then remove - // privileged no-CORS request headers from headers -} + if (!request) + throw TypeError("request must be specified"); -class HeadersList { - /** @type {[string, string][]|null} */ - cookies = null + var self = this; + if (!callback) + return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); - constructor (init) { - if (init instanceof HeadersList) { - this[kHeadersMap] = new Map(init[kHeadersMap]) - this[kHeadersSortedMap] = init[kHeadersSortedMap] - this.cookies = init.cookies === null ? null : [...init.cookies] - } else { - this[kHeadersMap] = new Map(init) - this[kHeadersSortedMap] = null + if (!self.rpcImpl) { + setTimeout(function() { callback(Error("already ended")); }, 0); + return undefined; } - } - - // https://fetch.spec.whatwg.org/#header-list-contains - contains (name) { - // A header list list contains a header name name if list - // contains a header whose name is a byte-case-insensitive - // match for name. - name = name.toLowerCase() - - return this[kHeadersMap].has(name) - } - clear () { - this[kHeadersMap].clear() - this[kHeadersSortedMap] = null - this.cookies = null - } + try { + return self.rpcImpl( + method, + requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), + function rpcCallback(err, response) { - // https://fetch.spec.whatwg.org/#concept-header-list-append - append (name, value) { - this[kHeadersSortedMap] = null + if (err) { + self.emit("error", err, method); + return callback(err); + } - // 1. If list contains name, then set name to the first such - // header’s name. - const lowercaseName = name.toLowerCase() - const exists = this[kHeadersMap].get(lowercaseName) + if (response === null) { + self.end(/* endedByRPC */ true); + return undefined; + } - // 2. Append (name, value) to list. - if (exists) { - const delimiter = lowercaseName === 'cookie' ? '; ' : ', ' - this[kHeadersMap].set(lowercaseName, { - name: exists.name, - value: `${exists.value}${delimiter}${value}` - }) - } else { - this[kHeadersMap].set(lowercaseName, { name, value }) - } + if (!(response instanceof responseCtor)) { + try { + response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); + } catch (err) { + self.emit("error", err, method); + return callback(err); + } + } - if (lowercaseName === 'set-cookie') { - this.cookies ??= [] - this.cookies.push(value) + self.emit("data", response, method); + return callback(null, response); + } + ); + } catch (err) { + self.emit("error", err, method); + setTimeout(function() { callback(err); }, 0); + return undefined; } - } - - // https://fetch.spec.whatwg.org/#concept-header-list-set - set (name, value) { - this[kHeadersSortedMap] = null - const lowercaseName = name.toLowerCase() +}; - if (lowercaseName === 'set-cookie') { - this.cookies = [value] +/** + * Ends this service and emits the `end` event. + * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. + * @returns {rpc.Service} `this` + */ +Service.prototype.end = function end(endedByRPC) { + if (this.rpcImpl) { + if (!endedByRPC) // signal end to rpcImpl + this.rpcImpl(null, null, null); + this.rpcImpl = null; + this.emit("end").off(); } + return this; +}; - // 1. If list contains name, then set the value of - // the first such header to value and remove the - // others. - // 2. Otherwise, append header (name, value) to list. - this[kHeadersMap].set(lowercaseName, { name, value }) - } - - // https://fetch.spec.whatwg.org/#concept-header-list-delete - delete (name) { - this[kHeadersSortedMap] = null - name = name.toLowerCase() +/***/ }), - if (name === 'set-cookie') { - this.cookies = null - } +/***/ 13737: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - this[kHeadersMap].delete(name) - } - // https://fetch.spec.whatwg.org/#concept-header-list-get - get (name) { - const value = this[kHeadersMap].get(name.toLowerCase()) +module.exports = LongBits; - // 1. If list does not contain name, then return null. - // 2. Return the values of all headers in list whose name - // is a byte-case-insensitive match for name, - // separated from each other by 0x2C 0x20, in order. - return value === undefined ? null : value.value - } +var util = __nccwpck_require__(61452); - * [Symbol.iterator] () { - // use the lowercased name - for (const [name, { value }] of this[kHeadersMap]) { - yield [name, value] - } - } +/** + * Constructs new long bits. + * @classdesc Helper class for working with the low and high bits of a 64 bit value. + * @memberof util + * @constructor + * @param {number} lo Low 32 bits, unsigned + * @param {number} hi High 32 bits, unsigned + */ +function LongBits(lo, hi) { - get entries () { - const headers = {} + // note that the casts below are theoretically unnecessary as of today, but older statically + // generated converter code might still call the ctor with signed 32bits. kept for compat. - if (this[kHeadersMap].size) { - for (const { name, value } of this[kHeadersMap].values()) { - headers[name] = value - } - } + /** + * Low bits. + * @type {number} + */ + this.lo = lo >>> 0; - return headers - } + /** + * High bits. + * @type {number} + */ + this.hi = hi >>> 0; } -// https://fetch.spec.whatwg.org/#headers-class -class Headers { - constructor (init = undefined) { - if (init === kConstruct) { - return - } - this[kHeadersList] = new HeadersList() - - // The new Headers(init) constructor steps are: - - // 1. Set this’s guard to "none". - this[kGuard] = 'none' - - // 2. If init is given, then fill this with init. - if (init !== undefined) { - init = webidl.converters.HeadersInit(init) - fill(this, init) - } - } - - // https://fetch.spec.whatwg.org/#dom-headers-append - append (name, value) { - webidl.brandCheck(this, Headers) - - webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' }) - - name = webidl.converters.ByteString(name) - value = webidl.converters.ByteString(value) - - return appendHeader(this, name, value) - } - - // https://fetch.spec.whatwg.org/#dom-headers-delete - delete (name) { - webidl.brandCheck(this, Headers) +/** + * Zero bits. + * @memberof util.LongBits + * @type {util.LongBits} + */ +var zero = LongBits.zero = new LongBits(0, 0); - webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' }) +zero.toNumber = function() { return 0; }; +zero.zzEncode = zero.zzDecode = function() { return this; }; +zero.length = function() { return 1; }; - name = webidl.converters.ByteString(name) +/** + * Zero hash. + * @memberof util.LongBits + * @type {string} + */ +var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; - // 1. If name is not a header name, then throw a TypeError. - if (!isValidHeaderName(name)) { - throw webidl.errors.invalidArgument({ - prefix: 'Headers.delete', - value: name, - type: 'header name' - }) +/** + * Constructs new long bits from the specified number. + * @param {number} value Value + * @returns {util.LongBits} Instance + */ +LongBits.fromNumber = function fromNumber(value) { + if (value === 0) + return zero; + var sign = value < 0; + if (sign) + value = -value; + var lo = value >>> 0, + hi = (value - lo) / 4294967296 >>> 0; + if (sign) { + hi = ~hi >>> 0; + lo = ~lo >>> 0; + if (++lo > 4294967295) { + lo = 0; + if (++hi > 4294967295) + hi = 0; + } } + return new LongBits(lo, hi); +}; - // 2. If this’s guard is "immutable", then throw a TypeError. - // 3. Otherwise, if this’s guard is "request" and name is a - // forbidden header name, return. - // 4. Otherwise, if this’s guard is "request-no-cors", name - // is not a no-CORS-safelisted request-header name, and - // name is not a privileged no-CORS request-header name, - // return. - // 5. Otherwise, if this’s guard is "response" and name is - // a forbidden response-header name, return. - // Note: undici does not implement forbidden header names - if (this[kGuard] === 'immutable') { - throw new TypeError('immutable') - } else if (this[kGuard] === 'request-no-cors') { - // TODO +/** + * Constructs new long bits from a number, long or string. + * @param {Long|number|string} value Value + * @returns {util.LongBits} Instance + */ +LongBits.from = function from(value) { + if (typeof value === "number") + return LongBits.fromNumber(value); + if (util.isString(value)) { + /* istanbul ignore else */ + if (util.Long) + value = util.Long.fromString(value); + else + return LongBits.fromNumber(parseInt(value, 10)); } + return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; +}; - // 6. If this’s header list does not contain name, then - // return. - if (!this[kHeadersList].contains(name)) { - return +/** + * Converts this long bits to a possibly unsafe JavaScript number. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {number} Possibly unsafe number + */ +LongBits.prototype.toNumber = function toNumber(unsigned) { + if (!unsigned && this.hi >>> 31) { + var lo = ~this.lo + 1 >>> 0, + hi = ~this.hi >>> 0; + if (!lo) + hi = hi + 1 >>> 0; + return -(lo + hi * 4294967296); } + return this.lo + this.hi * 4294967296; +}; - // 7. Delete name from this’s header list. - // 8. If this’s guard is "request-no-cors", then remove - // privileged no-CORS request headers from this. - this[kHeadersList].delete(name) - } - - // https://fetch.spec.whatwg.org/#dom-headers-get - get (name) { - webidl.brandCheck(this, Headers) - - webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' }) - - name = webidl.converters.ByteString(name) - - // 1. If name is not a header name, then throw a TypeError. - if (!isValidHeaderName(name)) { - throw webidl.errors.invalidArgument({ - prefix: 'Headers.get', - value: name, - type: 'header name' - }) - } +/** + * Converts this long bits to a long. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long} Long + */ +LongBits.prototype.toLong = function toLong(unsigned) { + return util.Long + ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) + /* istanbul ignore next */ + : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; +}; - // 2. Return the result of getting name from this’s header - // list. - return this[kHeadersList].get(name) - } +var charCodeAt = String.prototype.charCodeAt; - // https://fetch.spec.whatwg.org/#dom-headers-has - has (name) { - webidl.brandCheck(this, Headers) +/** + * Constructs new long bits from the specified 8 characters long hash. + * @param {string} hash Hash + * @returns {util.LongBits} Bits + */ +LongBits.fromHash = function fromHash(hash) { + if (hash === zeroHash) + return zero; + return new LongBits( + ( charCodeAt.call(hash, 0) + | charCodeAt.call(hash, 1) << 8 + | charCodeAt.call(hash, 2) << 16 + | charCodeAt.call(hash, 3) << 24) >>> 0 + , + ( charCodeAt.call(hash, 4) + | charCodeAt.call(hash, 5) << 8 + | charCodeAt.call(hash, 6) << 16 + | charCodeAt.call(hash, 7) << 24) >>> 0 + ); +}; - webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' }) +/** + * Converts this long bits to a 8 characters long hash. + * @returns {string} Hash + */ +LongBits.prototype.toHash = function toHash() { + return String.fromCharCode( + this.lo & 255, + this.lo >>> 8 & 255, + this.lo >>> 16 & 255, + this.lo >>> 24 , + this.hi & 255, + this.hi >>> 8 & 255, + this.hi >>> 16 & 255, + this.hi >>> 24 + ); +}; - name = webidl.converters.ByteString(name) +/** + * Zig-zag encodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzEncode = function zzEncode() { + var mask = this.hi >> 31; + this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; + this.lo = ( this.lo << 1 ^ mask) >>> 0; + return this; +}; - // 1. If name is not a header name, then throw a TypeError. - if (!isValidHeaderName(name)) { - throw webidl.errors.invalidArgument({ - prefix: 'Headers.has', - value: name, - type: 'header name' - }) - } +/** + * Zig-zag decodes this long bits. + * @returns {util.LongBits} `this` + */ +LongBits.prototype.zzDecode = function zzDecode() { + var mask = -(this.lo & 1); + this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; + this.hi = ( this.hi >>> 1 ^ mask) >>> 0; + return this; +}; - // 2. Return true if this’s header list contains name; - // otherwise false. - return this[kHeadersList].contains(name) - } +/** + * Calculates the length of this longbits when encoded as a varint. + * @returns {number} Length + */ +LongBits.prototype.length = function length() { + var part0 = this.lo, + part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, + part2 = this.hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 ? 1 : 2 + : part0 < 2097152 ? 3 : 4 + : part1 < 16384 + ? part1 < 128 ? 5 : 6 + : part1 < 2097152 ? 7 : 8 + : part2 < 128 ? 9 : 10; +}; - // https://fetch.spec.whatwg.org/#dom-headers-set - set (name, value) { - webidl.brandCheck(this, Headers) - webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' }) +/***/ }), - name = webidl.converters.ByteString(name) - value = webidl.converters.ByteString(value) +/***/ 61452: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - // 1. Normalize value. - value = headerValueNormalize(value) - // 2. If name is not a header name or value is not a - // header value, then throw a TypeError. - if (!isValidHeaderName(name)) { - throw webidl.errors.invalidArgument({ - prefix: 'Headers.set', - value: name, - type: 'header name' - }) - } else if (!isValidHeaderValue(value)) { - throw webidl.errors.invalidArgument({ - prefix: 'Headers.set', - value, - type: 'header value' - }) - } +var util = exports; - // 3. If this’s guard is "immutable", then throw a TypeError. - // 4. Otherwise, if this’s guard is "request" and name is a - // forbidden header name, return. - // 5. Otherwise, if this’s guard is "request-no-cors" and - // name/value is not a no-CORS-safelisted request-header, - // return. - // 6. Otherwise, if this’s guard is "response" and name is a - // forbidden response-header name, return. - // Note: undici does not implement forbidden header names - if (this[kGuard] === 'immutable') { - throw new TypeError('immutable') - } else if (this[kGuard] === 'request-no-cors') { - // TODO - } +// used to return a Promise where callback is omitted +util.asPromise = __nccwpck_require__(78969); - // 7. Set (name, value) in this’s header list. - // 8. If this’s guard is "request-no-cors", then remove - // privileged no-CORS request headers from this - this[kHeadersList].set(name, value) - } +// converts to / from base64 encoded strings +util.base64 = __nccwpck_require__(57738); - // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie - getSetCookie () { - webidl.brandCheck(this, Headers) +// base class of rpc.Service +util.EventEmitter = __nccwpck_require__(62403); - // 1. If this’s header list does not contain `Set-Cookie`, then return « ». - // 2. Return the values of all headers in this’s header list whose name is - // a byte-case-insensitive match for `Set-Cookie`, in order. +// float handling accross browsers +util.float = __nccwpck_require__(44775); - const list = this[kHeadersList].cookies +// requires modules optionally and hides the call from bundlers +util.inquire = __nccwpck_require__(43287); - if (list) { - return [...list] - } +// converts to / from utf8 encoded strings +util.utf8 = __nccwpck_require__(32581); - return [] - } +// provides a node-like buffer pool in the browser +util.pool = __nccwpck_require__(52487); - // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine - get [kHeadersSortedMap] () { - if (this[kHeadersList][kHeadersSortedMap]) { - return this[kHeadersList][kHeadersSortedMap] - } +// utility to work with the low and high bits of a 64 bit value +util.LongBits = __nccwpck_require__(13737); - // 1. Let headers be an empty list of headers with the key being the name - // and value the value. - const headers = [] +/** + * Whether running within node or not. + * @memberof util + * @type {boolean} + */ +util.isNode = Boolean(typeof global !== "undefined" + && global + && global.process + && global.process.versions + && global.process.versions.node); - // 2. Let names be the result of convert header names to a sorted-lowercase - // set with all the names of the headers in list. - const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1) - const cookies = this[kHeadersList].cookies +/** + * Global object reference. + * @memberof util + * @type {Object} + */ +util.global = util.isNode && global + || typeof window !== "undefined" && window + || typeof self !== "undefined" && self + || this; // eslint-disable-line no-invalid-this - // 3. For each name of names: - for (let i = 0; i < names.length; ++i) { - const [name, value] = names[i] - // 1. If name is `set-cookie`, then: - if (name === 'set-cookie') { - // 1. Let values be a list of all values of headers in list whose name - // is a byte-case-insensitive match for name, in order. +/** + * An immuable empty array. + * @memberof util + * @type {Array.<*>} + * @const + */ +util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes - // 2. For each value of values: - // 1. Append (name, value) to headers. - for (let j = 0; j < cookies.length; ++j) { - headers.push([name, cookies[j]]) - } - } else { - // 2. Otherwise: +/** + * An immutable empty object. + * @type {Object} + * @const + */ +util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes - // 1. Let value be the result of getting name from list. +/** + * Tests if the specified value is an integer. + * @function + * @param {*} value Value to test + * @returns {boolean} `true` if the value is an integer + */ +util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { + return typeof value === "number" && isFinite(value) && Math.floor(value) === value; +}; - // 2. Assert: value is non-null. - assert(value !== null) +/** + * Tests if the specified value is a string. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a string + */ +util.isString = function isString(value) { + return typeof value === "string" || value instanceof String; +}; - // 3. Append (name, value) to headers. - headers.push([name, value]) - } - } +/** + * Tests if the specified value is a non-null object. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a non-null object + */ +util.isObject = function isObject(value) { + return value && typeof value === "object"; +}; - this[kHeadersList][kHeadersSortedMap] = headers +/** + * Checks if a property on a message is considered to be present. + * This is an alias of {@link util.isSet}. + * @function + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isset = - // 4. Return headers. - return headers - } +/** + * Checks if a property on a message is considered to be present. + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ +util.isSet = function isSet(obj, prop) { + var value = obj[prop]; + if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins + return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; + return false; +}; - keys () { - webidl.brandCheck(this, Headers) +/** + * Any compatible Buffer instance. + * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. + * @interface Buffer + * @extends Uint8Array + */ - if (this[kGuard] === 'immutable') { - const value = this[kHeadersSortedMap] - return makeIterator(() => value, 'Headers', - 'key') +/** + * Node's Buffer class if available. + * @type {Constructor} + */ +util.Buffer = (function() { + try { + var Buffer = util.inquire("buffer").Buffer; + // refuse to use non-node buffers if not explicitly assigned (perf reasons): + return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; + } catch (e) { + /* istanbul ignore next */ + return null; } +})(); - return makeIterator( - () => [...this[kHeadersSortedMap].values()], - 'Headers', - 'key' - ) - } - - values () { - webidl.brandCheck(this, Headers) +// Internal alias of or polyfull for Buffer.from. +util._Buffer_from = null; - if (this[kGuard] === 'immutable') { - const value = this[kHeadersSortedMap] - return makeIterator(() => value, 'Headers', - 'value') - } +// Internal alias of or polyfill for Buffer.allocUnsafe. +util._Buffer_allocUnsafe = null; - return makeIterator( - () => [...this[kHeadersSortedMap].values()], - 'Headers', - 'value' - ) - } +/** + * Creates a new buffer of whatever type supported by the environment. + * @param {number|number[]} [sizeOrArray=0] Buffer size or number array + * @returns {Uint8Array|Buffer} Buffer + */ +util.newBuffer = function newBuffer(sizeOrArray) { + /* istanbul ignore next */ + return typeof sizeOrArray === "number" + ? util.Buffer + ? util._Buffer_allocUnsafe(sizeOrArray) + : new util.Array(sizeOrArray) + : util.Buffer + ? util._Buffer_from(sizeOrArray) + : typeof Uint8Array === "undefined" + ? sizeOrArray + : new Uint8Array(sizeOrArray); +}; - entries () { - webidl.brandCheck(this, Headers) +/** + * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. + * @type {Constructor} + */ +util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; - if (this[kGuard] === 'immutable') { - const value = this[kHeadersSortedMap] - return makeIterator(() => value, 'Headers', - 'key+value') - } +/** + * Any compatible Long instance. + * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. + * @interface Long + * @property {number} low Low bits + * @property {number} high High bits + * @property {boolean} unsigned Whether unsigned or not + */ - return makeIterator( - () => [...this[kHeadersSortedMap].values()], - 'Headers', - 'key+value' - ) - } +/** + * Long.js's Long class if available. + * @type {Constructor} + */ +util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long + || /* istanbul ignore next */ util.global.Long + || util.inquire("long"); - /** - * @param {(value: string, key: string, self: Headers) => void} callbackFn - * @param {unknown} thisArg - */ - forEach (callbackFn, thisArg = globalThis) { - webidl.brandCheck(this, Headers) +/** + * Regular expression used to verify 2 bit (`bool`) map keys. + * @type {RegExp} + * @const + */ +util.key2Re = /^true|false|0|1$/; - webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' }) +/** + * Regular expression used to verify 32 bit (`int32` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; - if (typeof callbackFn !== 'function') { - throw new TypeError( - "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'." - ) - } +/** + * Regular expression used to verify 64 bit (`int64` etc.) map keys. + * @type {RegExp} + * @const + */ +util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; - for (const [key, value] of this) { - callbackFn.apply(thisArg, [value, key, this]) - } - } +/** + * Converts a number or long to an 8 characters long hash string. + * @param {Long|number} value Value to convert + * @returns {string} Hash + */ +util.longToHash = function longToHash(value) { + return value + ? util.LongBits.from(value).toHash() + : util.LongBits.zeroHash; +}; - [Symbol.for('nodejs.util.inspect.custom')] () { - webidl.brandCheck(this, Headers) +/** + * Converts an 8 characters long hash string to a long or number. + * @param {string} hash Hash + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long|number} Original value + */ +util.longFromHash = function longFromHash(hash, unsigned) { + var bits = util.LongBits.fromHash(hash); + if (util.Long) + return util.Long.fromBits(bits.lo, bits.hi, unsigned); + return bits.toNumber(Boolean(unsigned)); +}; - return this[kHeadersList] - } +/** + * Merges the properties of the source object into the destination object. + * @memberof util + * @param {Object.} dst Destination object + * @param {Object.} src Source object + * @param {boolean} [ifNotSet=false] Merges only if the key is not already set + * @returns {Object.} Destination object + */ +function merge(dst, src, ifNotSet) { // used by converters + for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) + if (dst[keys[i]] === undefined || !ifNotSet) + dst[keys[i]] = src[keys[i]]; + return dst; } -Headers.prototype[Symbol.iterator] = Headers.prototype.entries - -Object.defineProperties(Headers.prototype, { - append: kEnumerableProperty, - delete: kEnumerableProperty, - get: kEnumerableProperty, - has: kEnumerableProperty, - set: kEnumerableProperty, - getSetCookie: kEnumerableProperty, - keys: kEnumerableProperty, - values: kEnumerableProperty, - entries: kEnumerableProperty, - forEach: kEnumerableProperty, - [Symbol.iterator]: { enumerable: false }, - [Symbol.toStringTag]: { - value: 'Headers', - configurable: true - } -}) - -webidl.converters.HeadersInit = function (V) { - if (webidl.util.Type(V) === 'Object') { - if (V[Symbol.iterator]) { - return webidl.converters['sequence>'](V) - } - - return webidl.converters['record'](V) - } +util.merge = merge; - throw webidl.errors.conversionFailed({ - prefix: 'Headers constructor', - argument: 'Argument 1', - types: ['sequence>', 'record'] - }) -} +/** + * Converts the first character of a string to lower case. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.lcFirst = function lcFirst(str) { + return str.charAt(0).toLowerCase() + str.substring(1); +}; -module.exports = { - fill, - Headers, - HeadersList -} +/** + * Creates a custom error constructor. + * @memberof util + * @param {string} name Error name + * @returns {Constructor} Custom error constructor + */ +function newError(name) { + function CustomError(message, properties) { -/***/ }), + if (!(this instanceof CustomError)) + return new CustomError(message, properties); -/***/ 72748: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // Error.call(this, message); + // ^ just returns a new error instance because the ctor can be called as a function -// https://github.com/Ethan-Arrowood/undici-fetch + Object.defineProperty(this, "message", { get: function() { return message; } }); + /* istanbul ignore next */ + if (Error.captureStackTrace) // node + Error.captureStackTrace(this, CustomError); + else + Object.defineProperty(this, "stack", { value: new Error().stack || "" }); + if (properties) + merge(this, properties); + } -const { - Response, - makeNetworkError, - makeAppropriateNetworkError, - filterResponse, - makeResponse -} = __nccwpck_require__(58846) -const { Headers } = __nccwpck_require__(23245) -const { Request, makeRequest } = __nccwpck_require__(7288) -const zlib = __nccwpck_require__(59796) -const { - bytesMatch, - makePolicyContainer, - clonePolicyContainer, - requestBadPort, - TAOCheck, - appendRequestOriginHeader, - responseLocationURL, - requestCurrentURL, - setRequestReferrerPolicyOnRedirect, - tryUpgradeRequestToAPotentiallyTrustworthyURL, - createOpaqueTimingInfo, - appendFetchMetadata, - corsCheck, - crossOriginResourcePolicyCheck, - determineRequestsReferrer, - coarsenedSharedCurrentTime, - createDeferredPromise, - isBlobLike, - sameOrigin, - isCancelled, - isAborted, - isErrorLike, - fullyReadBody, - readableStreamClose, - isomorphicEncode, - urlIsLocal, - urlIsHttpHttpsScheme, - urlHasHttpsScheme -} = __nccwpck_require__(79453) -const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(46938) -const assert = __nccwpck_require__(39491) -const { safelyExtractBody } = __nccwpck_require__(62494) -const { - redirectStatusSet, - nullBodyStatus, - safeMethodsSet, - requestBodyHeader, - subresourceSet, - DOMException -} = __nccwpck_require__(93541) -const { kHeadersList } = __nccwpck_require__(48039) -const EE = __nccwpck_require__(82361) -const { Readable, pipeline } = __nccwpck_require__(12781) -const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(67468) -const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(50096) -const { TransformStream } = __nccwpck_require__(35356) -const { getGlobalDispatcher } = __nccwpck_require__(29102) -const { webidl } = __nccwpck_require__(96138) -const { STATUS_CODES } = __nccwpck_require__(13685) -const GET_OR_HEAD = ['GET', 'HEAD'] + (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError; -/** @type {import('buffer').resolveObjectURL} */ -let resolveObjectURL -let ReadableStream = globalThis.ReadableStream + Object.defineProperty(CustomError.prototype, "name", { get: function() { return name; } }); -class Fetch extends EE { - constructor (dispatcher) { - super() + CustomError.prototype.toString = function toString() { + return this.name + ": " + this.message; + }; - this.dispatcher = dispatcher - this.connection = null - this.dump = false - this.state = 'ongoing' - // 2 terminated listeners get added per request, - // but only 1 gets removed. If there are 20 redirects, - // 21 listeners will be added. - // See https://github.com/nodejs/undici/issues/1711 - // TODO (fix): Find and fix root cause for leaked listener. - this.setMaxListeners(21) - } + return CustomError; +} - terminate (reason) { - if (this.state !== 'ongoing') { - return - } +util.newError = newError; - this.state = 'terminated' - this.connection?.destroy(reason) - this.emit('terminated', reason) - } +/** + * Constructs a new protocol error. + * @classdesc Error subclass indicating a protocol specifc error. + * @memberof util + * @extends Error + * @template T extends Message + * @constructor + * @param {string} message Error message + * @param {Object.} [properties] Additional properties + * @example + * try { + * MyMessage.decode(someBuffer); // throws if required fields are missing + * } catch (e) { + * if (e instanceof ProtocolError && e.instance) + * console.log("decoded so far: " + JSON.stringify(e.instance)); + * } + */ +util.ProtocolError = newError("ProtocolError"); - // https://fetch.spec.whatwg.org/#fetch-controller-abort - abort (error) { - if (this.state !== 'ongoing') { - return - } +/** + * So far decoded message instance. + * @name util.ProtocolError#instance + * @type {Message} + */ - // 1. Set controller’s state to "aborted". - this.state = 'aborted' +/** + * A OneOf getter as returned by {@link util.oneOfGetter}. + * @typedef OneOfGetter + * @type {function} + * @returns {string|undefined} Set field name, if any + */ - // 2. Let fallbackError be an "AbortError" DOMException. - // 3. Set error to fallbackError if it is not given. - if (!error) { - error = new DOMException('The operation was aborted.', 'AbortError') - } +/** + * Builds a getter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfGetter} Unbound getter + */ +util.oneOfGetter = function getOneOf(fieldNames) { + var fieldMap = {}; + for (var i = 0; i < fieldNames.length; ++i) + fieldMap[fieldNames[i]] = 1; - // 4. Let serializedError be StructuredSerialize(error). - // If that threw an exception, catch it, and let - // serializedError be StructuredSerialize(fallbackError). + /** + * @returns {string|undefined} Set field name, if any + * @this Object + * @ignore + */ + return function() { // eslint-disable-line consistent-return + for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) + if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) + return keys[i]; + }; +}; - // 5. Set controller’s serialized abort reason to serializedError. - this.serializedAbortReason = error +/** + * A OneOf setter as returned by {@link util.oneOfSetter}. + * @typedef OneOfSetter + * @type {function} + * @param {string|undefined} value Field name + * @returns {undefined} + */ - this.connection?.destroy(error) - this.emit('terminated', error) - } -} +/** + * Builds a setter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfSetter} Unbound setter + */ +util.oneOfSetter = function setOneOf(fieldNames) { -// https://fetch.spec.whatwg.org/#fetch-method -function fetch (input, init = {}) { - webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' }) + /** + * @param {string} name Field name + * @returns {undefined} + * @this Object + * @ignore + */ + return function(name) { + for (var i = 0; i < fieldNames.length; ++i) + if (fieldNames[i] !== name) + delete this[fieldNames[i]]; + }; +}; - // 1. Let p be a new promise. - const p = createDeferredPromise() +/** + * Default conversion options used for {@link Message#toJSON} implementations. + * + * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: + * + * - Longs become strings + * - Enums become string keys + * - Bytes become base64 encoded strings + * - (Sub-)Messages become plain objects + * - Maps become plain objects with all string keys + * - Repeated fields become arrays + * - NaN and Infinity for float and double fields become strings + * + * @type {IConversionOptions} + * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json + */ +util.toJSONOptions = { + longs: String, + enums: String, + bytes: String, + json: true +}; - // 2. Let requestObject be the result of invoking the initial value of - // Request as constructor with input and init as arguments. If this throws - // an exception, reject p with it and return p. - let requestObject +// Sets up buffer utility according to the environment (called in index-minimal) +util._configure = function() { + var Buffer = util.Buffer; + /* istanbul ignore if */ + if (!Buffer) { + util._Buffer_from = util._Buffer_allocUnsafe = null; + return; + } + // because node 4.x buffers are incompatible & immutable + // see: https://github.com/dcodeIO/protobuf.js/pull/665 + util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || + /* istanbul ignore next */ + function Buffer_from(value, encoding) { + return new Buffer(value, encoding); + }; + util._Buffer_allocUnsafe = Buffer.allocUnsafe || + /* istanbul ignore next */ + function Buffer_allocUnsafe(size) { + return new Buffer(size); + }; +}; - try { - requestObject = new Request(input, init) - } catch (e) { - p.reject(e) - return p.promise - } - // 3. Let request be requestObject’s request. - const request = requestObject[kState] +/***/ }), - // 4. If requestObject’s signal’s aborted flag is set, then: - if (requestObject.signal.aborted) { - // 1. Abort the fetch() call with p, request, null, and - // requestObject’s signal’s abort reason. - abortFetch(p, request, null, requestObject.signal.reason) +/***/ 35699: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // 2. Return p. - return p.promise - } - // 5. Let globalObject be request’s client’s global object. - const globalObject = request.client.globalObject +module.exports = Writer; - // 6. If globalObject is a ServiceWorkerGlobalScope object, then set - // request’s service-workers mode to "none". - if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') { - request.serviceWorkers = 'none' - } +var util = __nccwpck_require__(61452); - // 7. Let responseObject be null. - let responseObject = null +var BufferWriter; // cyclic - // 8. Let relevantRealm be this’s relevant Realm. - const relevantRealm = null +var LongBits = util.LongBits, + base64 = util.base64, + utf8 = util.utf8; - // 9. Let locallyAborted be false. - let locallyAborted = false +/** + * Constructs a new writer operation instance. + * @classdesc Scheduled writer operation. + * @constructor + * @param {function(*, Uint8Array, number)} fn Function to call + * @param {number} len Value byte length + * @param {*} val Value to write + * @ignore + */ +function Op(fn, len, val) { - // 10. Let controller be null. - let controller = null + /** + * Function to call. + * @type {function(Uint8Array, number, *)} + */ + this.fn = fn; - // 11. Add the following abort steps to requestObject’s signal: - addAbortListener( - requestObject.signal, - () => { - // 1. Set locallyAborted to true. - locallyAborted = true + /** + * Value byte length. + * @type {number} + */ + this.len = len; - // 2. Assert: controller is non-null. - assert(controller != null) + /** + * Next operation. + * @type {Writer.Op|undefined} + */ + this.next = undefined; - // 3. Abort controller with requestObject’s signal’s abort reason. - controller.abort(requestObject.signal.reason) + /** + * Value to write. + * @type {*} + */ + this.val = val; // type varies +} - // 4. Abort the fetch() call with p, request, responseObject, - // and requestObject’s signal’s abort reason. - abortFetch(p, request, responseObject, requestObject.signal.reason) - } - ) +/* istanbul ignore next */ +function noop() {} // eslint-disable-line no-empty-function - // 12. Let handleFetchDone given response response be to finalize and - // report timing with response, globalObject, and "fetch". - const handleFetchDone = (response) => - finalizeAndReportTiming(response, 'fetch') +/** + * Constructs a new writer state instance. + * @classdesc Copied writer state. + * @memberof Writer + * @constructor + * @param {Writer} writer Writer to copy state from + * @ignore + */ +function State(writer) { - // 13. Set controller to the result of calling fetch given request, - // with processResponseEndOfBody set to handleFetchDone, and processResponse - // given response being these substeps: + /** + * Current head. + * @type {Writer.Op} + */ + this.head = writer.head; - const processResponse = (response) => { - // 1. If locallyAborted is true, terminate these substeps. - if (locallyAborted) { - return Promise.resolve() - } + /** + * Current tail. + * @type {Writer.Op} + */ + this.tail = writer.tail; - // 2. If response’s aborted flag is set, then: - if (response.aborted) { - // 1. Let deserializedError be the result of deserialize a serialized - // abort reason given controller’s serialized abort reason and - // relevantRealm. + /** + * Current buffer length. + * @type {number} + */ + this.len = writer.len; - // 2. Abort the fetch() call with p, request, responseObject, and - // deserializedError. + /** + * Next state. + * @type {State|null} + */ + this.next = writer.states; +} - abortFetch(p, request, responseObject, controller.serializedAbortReason) - return Promise.resolve() - } +/** + * Constructs a new writer instance. + * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. + * @constructor + */ +function Writer() { - // 3. If response is a network error, then reject p with a TypeError - // and terminate these substeps. - if (response.type === 'error') { - p.reject( - Object.assign(new TypeError('fetch failed'), { cause: response.error }) - ) - return Promise.resolve() - } + /** + * Current length. + * @type {number} + */ + this.len = 0; - // 4. Set responseObject to the result of creating a Response object, - // given response, "immutable", and relevantRealm. - responseObject = new Response() - responseObject[kState] = response - responseObject[kRealm] = relevantRealm - responseObject[kHeaders][kHeadersList] = response.headersList - responseObject[kHeaders][kGuard] = 'immutable' - responseObject[kHeaders][kRealm] = relevantRealm + /** + * Operations head. + * @type {Object} + */ + this.head = new Op(noop, 0, 0); - // 5. Resolve p with responseObject. - p.resolve(responseObject) - } + /** + * Operations tail + * @type {Object} + */ + this.tail = this.head; - controller = fetching({ - request, - processResponseEndOfBody: handleFetchDone, - processResponse, - dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici - }) + /** + * Linked forked states. + * @type {Object|null} + */ + this.states = null; - // 14. Return p. - return p.promise + // When a value is written, the writer calculates its byte length and puts it into a linked + // list of operations to perform when finish() is called. This both allows us to allocate + // buffers of the exact required size and reduces the amount of work we have to do compared + // to first calculating over objects and then encoding over objects. In our case, the encoding + // part is just a linked list walk calling operations with already prepared values. } -// https://fetch.spec.whatwg.org/#finalize-and-report-timing -function finalizeAndReportTiming (response, initiatorType = 'other') { - // 1. If response is an aborted network error, then return. - if (response.type === 'error' && response.aborted) { - return - } +var create = function create() { + return util.Buffer + ? function create_buffer_setup() { + return (Writer.create = function create_buffer() { + return new BufferWriter(); + })(); + } + /* istanbul ignore next */ + : function create_array() { + return new Writer(); + }; +}; - // 2. If response’s URL list is null or empty, then return. - if (!response.urlList?.length) { - return - } +/** + * Creates a new writer. + * @function + * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} + */ +Writer.create = create(); - // 3. Let originalURL be response’s URL list[0]. - const originalURL = response.urlList[0] +/** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ +Writer.alloc = function alloc(size) { + return new util.Array(size); +}; - // 4. Let timingInfo be response’s timing info. - let timingInfo = response.timingInfo +// Use Uint8Array buffer pool in the browser, just like node does with buffers +/* istanbul ignore else */ +if (util.Array !== Array) + Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); - // 5. Let cacheState be response’s cache state. - let cacheState = response.cacheState +/** + * Pushes a new operation to the queue. + * @param {function(Uint8Array, number, *)} fn Function to call + * @param {number} len Value byte length + * @param {number} val Value to write + * @returns {Writer} `this` + * @private + */ +Writer.prototype._push = function push(fn, len, val) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; +}; - // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return. - if (!urlIsHttpHttpsScheme(originalURL)) { - return - } +function writeByte(val, buf, pos) { + buf[pos] = val & 255; +} - // 7. If timingInfo is null, then return. - if (timingInfo === null) { - return - } +function writeVarint32(val, buf, pos) { + while (val > 127) { + buf[pos++] = val & 127 | 128; + val >>>= 7; + } + buf[pos] = val; +} - // 8. If response’s timing allow passed flag is not set, then: - if (!response.timingAllowPassed) { - // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo. - timingInfo = createOpaqueTimingInfo({ - startTime: timingInfo.startTime - }) +/** + * Constructs a new varint writer operation instance. + * @classdesc Scheduled varint writer operation. + * @extends Op + * @constructor + * @param {number} len Value byte length + * @param {number} val Value to write + * @ignore + */ +function VarintOp(len, val) { + this.len = len; + this.next = undefined; + this.val = val; +} - // 2. Set cacheState to the empty string. - cacheState = '' - } +VarintOp.prototype = Object.create(Op.prototype); +VarintOp.prototype.fn = writeVarint32; - // 9. Set timingInfo’s end time to the coarsened shared current time - // given global’s relevant settings object’s cross-origin isolated - // capability. - // TODO: given global’s relevant settings object’s cross-origin isolated - // capability? - timingInfo.endTime = coarsenedSharedCurrentTime() +/** + * Writes an unsigned 32 bit value as a varint. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.uint32 = function write_uint32(value) { + // here, the call to this.push has been inlined and a varint specific Op subclass is used. + // uint32 is by far the most frequently used operation and benefits significantly from this. + this.len += (this.tail = this.tail.next = new VarintOp( + (value = value >>> 0) + < 128 ? 1 + : value < 16384 ? 2 + : value < 2097152 ? 3 + : value < 268435456 ? 4 + : 5, + value)).len; + return this; +}; - // 10. Set response’s timing info to timingInfo. - response.timingInfo = timingInfo +/** + * Writes a signed 32 bit value as a varint. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.int32 = function write_int32(value) { + return value < 0 + ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec + : this.uint32(value); +}; - // 11. Mark resource timing for timingInfo, originalURL, initiatorType, - // global, and cacheState. - markResourceTiming( - timingInfo, - originalURL, - initiatorType, - globalThis, - cacheState - ) -} +/** + * Writes a 32 bit value as a varint, zig-zag encoded. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sint32 = function write_sint32(value) { + return this.uint32((value << 1 ^ value >> 31) >>> 0); +}; -// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing -function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) { - if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) { - performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState) - } +function writeVarint64(val, buf, pos) { + while (val.hi) { + buf[pos++] = val.lo & 127 | 128; + val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = val.lo & 127 | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; } -// https://fetch.spec.whatwg.org/#abort-fetch -function abortFetch (p, request, responseObject, error) { - // Note: AbortSignal.reason was added in node v17.2.0 - // which would give us an undefined error to reject with. - // Remove this once node v16 is no longer supported. - if (!error) { - error = new DOMException('The operation was aborted.', 'AbortError') - } - - // 1. Reject promise with error. - p.reject(error) +/** + * Writes an unsigned 64 bit value as a varint. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.uint64 = function write_uint64(value) { + var bits = LongBits.from(value); + return this._push(writeVarint64, bits.length(), bits); +}; - // 2. If request’s body is not null and is readable, then cancel request’s - // body with error. - if (request.body != null && isReadable(request.body?.stream)) { - request.body.stream.cancel(error).catch((err) => { - if (err.code === 'ERR_INVALID_STATE') { - // Node bug? - return - } - throw err - }) - } +/** + * Writes a signed 64 bit value as a varint. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.int64 = Writer.prototype.uint64; - // 3. If responseObject is null, then return. - if (responseObject == null) { - return - } +/** + * Writes a signed 64 bit value as a varint, zig-zag encoded. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sint64 = function write_sint64(value) { + var bits = LongBits.from(value).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); +}; - // 4. Let response be responseObject’s response. - const response = responseObject[kState] +/** + * Writes a boolish value as a varint. + * @param {boolean} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.bool = function write_bool(value) { + return this._push(writeByte, 1, value ? 1 : 0); +}; - // 5. If response’s body is not null and is readable, then error response’s - // body with error. - if (response.body != null && isReadable(response.body?.stream)) { - response.body.stream.cancel(error).catch((err) => { - if (err.code === 'ERR_INVALID_STATE') { - // Node bug? - return - } - throw err - }) - } +function writeFixed32(val, buf, pos) { + buf[pos ] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; } -// https://fetch.spec.whatwg.org/#fetching -function fetching ({ - request, - processRequestBodyChunkLength, - processRequestEndOfBody, - processResponse, - processResponseEndOfBody, - processResponseConsumeBody, - useParallelQueue = false, - dispatcher // undici -}) { - // 1. Let taskDestination be null. - let taskDestination = null - - // 2. Let crossOriginIsolatedCapability be false. - let crossOriginIsolatedCapability = false +/** + * Writes an unsigned 32 bit value as fixed 32 bits. + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.fixed32 = function write_fixed32(value) { + return this._push(writeFixed32, 4, value >>> 0); +}; - // 3. If request’s client is non-null, then: - if (request.client != null) { - // 1. Set taskDestination to request’s client’s global object. - taskDestination = request.client.globalObject +/** + * Writes a signed 32 bit value as fixed 32 bits. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.sfixed32 = Writer.prototype.fixed32; - // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin - // isolated capability. - crossOriginIsolatedCapability = - request.client.crossOriginIsolatedCapability - } +/** + * Writes an unsigned 64 bit value as fixed 64 bits. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.fixed64 = function write_fixed64(value) { + var bits = LongBits.from(value); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); +}; - // 4. If useParallelQueue is true, then set taskDestination to the result of - // starting a new parallel queue. - // TODO +/** + * Writes a signed 64 bit value as fixed 64 bits. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ +Writer.prototype.sfixed64 = Writer.prototype.fixed64; - // 5. Let timingInfo be a new fetch timing info whose start time and - // post-redirect start time are the coarsened shared current time given - // crossOriginIsolatedCapability. - const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability) - const timingInfo = createOpaqueTimingInfo({ - startTime: currenTime - }) +/** + * Writes a float (32 bit). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.float = function write_float(value) { + return this._push(util.float.writeFloatLE, 4, value); +}; - // 6. Let fetchParams be a new fetch params whose - // request is request, - // timing info is timingInfo, - // process request body chunk length is processRequestBodyChunkLength, - // process request end-of-body is processRequestEndOfBody, - // process response is processResponse, - // process response consume body is processResponseConsumeBody, - // process response end-of-body is processResponseEndOfBody, - // task destination is taskDestination, - // and cross-origin isolated capability is crossOriginIsolatedCapability. - const fetchParams = { - controller: new Fetch(dispatcher), - request, - timingInfo, - processRequestBodyChunkLength, - processRequestEndOfBody, - processResponse, - processResponseConsumeBody, - processResponseEndOfBody, - taskDestination, - crossOriginIsolatedCapability - } +/** + * Writes a double (64 bit float). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.double = function write_double(value) { + return this._push(util.float.writeDoubleLE, 8, value); +}; - // 7. If request’s body is a byte sequence, then set request’s body to - // request’s body as a body. - // NOTE: Since fetching is only called from fetch, body should already be - // extracted. - assert(!request.body || request.body.stream) +var writeBytes = util.Array.prototype.set + ? function writeBytes_set(val, buf, pos) { + buf.set(val, pos); // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytes_for(val, buf, pos) { + for (var i = 0; i < val.length; ++i) + buf[pos + i] = val[i]; + }; - // 8. If request’s window is "client", then set request’s window to request’s - // client, if request’s client’s global object is a Window object; otherwise - // "no-window". - if (request.window === 'client') { - // TODO: What if request.client is null? - request.window = - request.client?.globalObject?.constructor?.name === 'Window' - ? request.client - : 'no-window' - } +/** + * Writes a sequence of bytes. + * @param {Uint8Array|string} value Buffer or base64 encoded string to write + * @returns {Writer} `this` + */ +Writer.prototype.bytes = function write_bytes(value) { + var len = value.length >>> 0; + if (!len) + return this._push(writeByte, 1, 0); + if (util.isString(value)) { + var buf = Writer.alloc(len = base64.length(value)); + base64.decode(value, buf, 0); + value = buf; + } + return this.uint32(len)._push(writeBytes, len, value); +}; - // 9. If request’s origin is "client", then set request’s origin to request’s - // client’s origin. - if (request.origin === 'client') { - // TODO: What if request.client is null? - request.origin = request.client?.origin - } +/** + * Writes a string. + * @param {string} value Value to write + * @returns {Writer} `this` + */ +Writer.prototype.string = function write_string(value) { + var len = utf8.length(value); + return len + ? this.uint32(len)._push(utf8.write, len, value) + : this._push(writeByte, 1, 0); +}; - // 10. If all of the following conditions are true: - // TODO +/** + * Forks this writer's state by pushing it to a stack. + * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. + * @returns {Writer} `this` + */ +Writer.prototype.fork = function fork() { + this.states = new State(this); + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + return this; +}; - // 11. If request’s policy container is "client", then: - if (request.policyContainer === 'client') { - // 1. If request’s client is non-null, then set request’s policy - // container to a clone of request’s client’s policy container. [HTML] - if (request.client != null) { - request.policyContainer = clonePolicyContainer( - request.client.policyContainer - ) +/** + * Resets this instance to the last state. + * @returns {Writer} `this` + */ +Writer.prototype.reset = function reset() { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; } else { - // 2. Otherwise, set request’s policy container to a new policy - // container. - request.policyContainer = makePolicyContainer() + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; } - } + return this; +}; - // 12. If request’s header list does not contain `Accept`, then: - if (!request.headersList.contains('accept')) { - // 1. Let value be `*/*`. - const value = '*/*' +/** + * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. + * @returns {Writer} `this` + */ +Writer.prototype.ldelim = function ldelim() { + var head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; +}; - // 2. A user agent should set value to the first matching statement, if - // any, switching on request’s destination: - // "document" - // "frame" - // "iframe" - // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8` - // "image" - // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5` - // "style" - // `text/css,*/*;q=0.1` - // TODO +/** + * Finishes the write operation. + * @returns {Uint8Array} Finished buffer + */ +Writer.prototype.finish = function finish() { + var head = this.head.next, // skip noop + buf = this.constructor.alloc(this.len), + pos = 0; + while (head) { + head.fn(head.val, buf, pos); + pos += head.len; + head = head.next; + } + // this.head = this.tail = null; + return buf; +}; - // 3. Append `Accept`/value to request’s header list. - request.headersList.append('accept', value) - } +Writer._configure = function(BufferWriter_) { + BufferWriter = BufferWriter_; + Writer.create = create(); + BufferWriter._configure(); +}; - // 13. If request’s header list does not contain `Accept-Language`, then - // user agents should append `Accept-Language`/an appropriate value to - // request’s header list. - if (!request.headersList.contains('accept-language')) { - request.headersList.append('accept-language', '*') - } - // 14. If request’s priority is null, then use request’s initiator and - // destination appropriately in setting request’s priority to a - // user-agent-defined object. - if (request.priority === null) { - // TODO - } +/***/ }), - // 15. If request is a subresource request, then: - if (subresourceSet.has(request.destination)) { - // TODO - } +/***/ 10955: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // 16. Run main fetch given fetchParams. - mainFetch(fetchParams) - .catch(err => { - fetchParams.controller.terminate(err) - }) - // 17. Return fetchParam's controller - return fetchParams.controller -} +module.exports = BufferWriter; -// https://fetch.spec.whatwg.org/#concept-main-fetch -async function mainFetch (fetchParams, recursive = false) { - // 1. Let request be fetchParams’s request. - const request = fetchParams.request +// extends Writer +var Writer = __nccwpck_require__(35699); +(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; - // 2. Let response be null. - let response = null +var util = __nccwpck_require__(61452); - // 3. If request’s local-URLs-only flag is set and request’s current URL is - // not local, then set response to a network error. - if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) { - response = makeNetworkError('local URLs only') - } +/** + * Constructs a new buffer writer instance. + * @classdesc Wire format writer using node buffers. + * @extends Writer + * @constructor + */ +function BufferWriter() { + Writer.call(this); +} - // 4. Run report Content Security Policy violations for request. - // TODO +BufferWriter._configure = function () { + /** + * Allocates a buffer of the specified size. + * @function + * @param {number} size Buffer size + * @returns {Buffer} Buffer + */ + BufferWriter.alloc = util._Buffer_allocUnsafe; - // 5. Upgrade request to a potentially trustworthy URL, if appropriate. - tryUpgradeRequestToAPotentiallyTrustworthyURL(request) + BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" + ? function writeBytesBuffer_set(val, buf, pos) { + buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) + // also works for plain array values + } + /* istanbul ignore next */ + : function writeBytesBuffer_copy(val, buf, pos) { + if (val.copy) // Buffer values + val.copy(buf, pos, 0, val.length); + else for (var i = 0; i < val.length;) // plain array values + buf[pos++] = val[i++]; + }; +}; - // 6. If should request be blocked due to a bad port, should fetching request - // be blocked as mixed content, or should request be blocked by Content - // Security Policy returns blocked, then set response to a network error. - if (requestBadPort(request) === 'blocked') { - response = makeNetworkError('bad port') - } - // TODO: should fetching request be blocked as mixed content? - // TODO: should request be blocked by Content Security Policy? - // 7. If request’s referrer policy is the empty string, then set request’s - // referrer policy to request’s policy container’s referrer policy. - if (request.referrerPolicy === '') { - request.referrerPolicy = request.policyContainer.referrerPolicy - } +/** + * @override + */ +BufferWriter.prototype.bytes = function write_bytes_buffer(value) { + if (util.isString(value)) + value = util._Buffer_from(value, "base64"); + var len = value.length >>> 0; + this.uint32(len); + if (len) + this._push(BufferWriter.writeBytesBuffer, len, value); + return this; +}; - // 8. If request’s referrer is not "no-referrer", then set request’s - // referrer to the result of invoking determine request’s referrer. - if (request.referrer !== 'no-referrer') { - request.referrer = determineRequestsReferrer(request) - } +function writeStringBuffer(val, buf, pos) { + if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) + util.utf8.write(val, buf, pos); + else if (buf.utf8Write) + buf.utf8Write(val, pos); + else + buf.write(val, pos); +} - // 9. Set request’s current URL’s scheme to "https" if all of the following - // conditions are true: - // - request’s current URL’s scheme is "http" - // - request’s current URL’s host is a domain - // - Matching request’s current URL’s host per Known HSTS Host Domain Name - // Matching results in either a superdomain match with an asserted - // includeSubDomains directive or a congruent match (with or without an - // asserted includeSubDomains directive). [HSTS] - // TODO +/** + * @override + */ +BufferWriter.prototype.string = function write_string_buffer(value) { + var len = util.Buffer.byteLength(value); + this.uint32(len); + if (len) + this._push(writeStringBuffer, len, value); + return this; +}; - // 10. If recursive is false, then run the remaining steps in parallel. - // TODO - // 11. If response is null, then set response to the result of running - // the steps corresponding to the first matching statement: - if (response === null) { - response = await (async () => { - const currentURL = requestCurrentURL(request) +/** + * Finishes the write operation. + * @name BufferWriter#finish + * @function + * @returns {Buffer} Finished buffer + */ - if ( - // - request’s current URL’s origin is same origin with request’s origin, - // and request’s response tainting is "basic" - (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') || - // request’s current URL’s scheme is "data" - (currentURL.protocol === 'data:') || - // - request’s mode is "navigate" or "websocket" - (request.mode === 'navigate' || request.mode === 'websocket') - ) { - // 1. Set request’s response tainting to "basic". - request.responseTainting = 'basic' +BufferWriter._configure(); - // 2. Return the result of running scheme fetch given fetchParams. - return await schemeFetch(fetchParams) - } - // request’s mode is "same-origin" - if (request.mode === 'same-origin') { - // 1. Return a network error. - return makeNetworkError('request mode cannot be "same-origin"') - } +/***/ }), - // request’s mode is "no-cors" - if (request.mode === 'no-cors') { - // 1. If request’s redirect mode is not "follow", then return a network - // error. - if (request.redirect !== 'follow') { - return makeNetworkError( - 'redirect mode cannot be "follow" for "no-cors" request' - ) - } +/***/ 24774: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // 2. Set request’s response tainting to "opaque". - request.responseTainting = 'opaque' - // 3. Return the result of running scheme fetch given fetchParams. - return await schemeFetch(fetchParams) - } - // request’s current URL’s scheme is not an HTTP(S) scheme - if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) { - // Return a network error. - return makeNetworkError('URL scheme must be a HTTP(S) scheme') - } +var parseUrl = (__nccwpck_require__(57310).parse); - // - request’s use-CORS-preflight flag is set - // - request’s unsafe-request flag is set and either request’s method is - // not a CORS-safelisted method or CORS-unsafe request-header names with - // request’s header list is not empty - // 1. Set request’s response tainting to "cors". - // 2. Let corsWithPreflightResponse be the result of running HTTP fetch - // given fetchParams and true. - // 3. If corsWithPreflightResponse is a network error, then clear cache - // entries using request. - // 4. Return corsWithPreflightResponse. - // TODO +var DEFAULT_PORTS = { + ftp: 21, + gopher: 70, + http: 80, + https: 443, + ws: 80, + wss: 443, +}; - // Otherwise - // 1. Set request’s response tainting to "cors". - request.responseTainting = 'cors' +var stringEndsWith = String.prototype.endsWith || function(s) { + return s.length <= this.length && + this.indexOf(s, this.length - s.length) !== -1; +}; - // 2. Return the result of running HTTP fetch given fetchParams. - return await httpFetch(fetchParams) - })() +/** + * @param {string|object} url - The URL, or the result from url.parse. + * @return {string} The URL of the proxy that should handle the request to the + * given URL. If no proxy is set, this will be an empty string. + */ +function getProxyForUrl(url) { + var parsedUrl = typeof url === 'string' ? parseUrl(url) : url || {}; + var proto = parsedUrl.protocol; + var hostname = parsedUrl.host; + var port = parsedUrl.port; + if (typeof hostname !== 'string' || !hostname || typeof proto !== 'string') { + return ''; // Don't proxy URLs without a valid scheme or host. } - // 12. If recursive is true, then return response. - if (recursive) { - return response + proto = proto.split(':', 1)[0]; + // Stripping ports in this way instead of using parsedUrl.hostname to make + // sure that the brackets around IPv6 addresses are kept. + hostname = hostname.replace(/:\d*$/, ''); + port = parseInt(port) || DEFAULT_PORTS[proto] || 0; + if (!shouldProxy(hostname, port)) { + return ''; // Don't proxy URLs that match NO_PROXY. } - // 13. If response is not a network error and response is not a filtered - // response, then: - if (response.status !== 0 && !response.internalResponse) { - // If request’s response tainting is "cors", then: - if (request.responseTainting === 'cors') { - // 1. Let headerNames be the result of extracting header list values - // given `Access-Control-Expose-Headers` and response’s header list. - // TODO - // 2. If request’s credentials mode is not "include" and headerNames - // contains `*`, then set response’s CORS-exposed header-name list to - // all unique header names in response’s header list. - // TODO - // 3. Otherwise, if headerNames is not null or failure, then set - // response’s CORS-exposed header-name list to headerNames. - // TODO + var proxy = + getEnv('npm_config_' + proto + '_proxy') || + getEnv(proto + '_proxy') || + getEnv('npm_config_proxy') || + getEnv('all_proxy'); + if (proxy && proxy.indexOf('://') === -1) { + // Missing scheme in proxy, default to the requested URL's scheme. + proxy = proto + '://' + proxy; + } + return proxy; +} + +/** + * Determines whether a given URL should be proxied. + * + * @param {string} hostname - The host name of the URL. + * @param {number} port - The effective port of the URL. + * @returns {boolean} Whether the given URL should be proxied. + * @private + */ +function shouldProxy(hostname, port) { + var NO_PROXY = + (getEnv('npm_config_no_proxy') || getEnv('no_proxy')).toLowerCase(); + if (!NO_PROXY) { + return true; // Always proxy if NO_PROXY is not set. + } + if (NO_PROXY === '*') { + return false; // Never proxy if wildcard is set. + } + + return NO_PROXY.split(/[,\s]/).every(function(proxy) { + if (!proxy) { + return true; // Skip zero-length hosts. + } + var parsedProxy = proxy.match(/^(.+):(\d+)$/); + var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy; + var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0; + if (parsedProxyPort && parsedProxyPort !== port) { + return true; // Skip if ports don't match. } - // Set response to the following filtered response with response as its - // internal response, depending on request’s response tainting: - if (request.responseTainting === 'basic') { - response = filterResponse(response, 'basic') - } else if (request.responseTainting === 'cors') { - response = filterResponse(response, 'cors') - } else if (request.responseTainting === 'opaque') { - response = filterResponse(response, 'opaque') - } else { - assert(false) + if (!/^[.*]/.test(parsedProxyHostname)) { + // No wildcards, so stop proxying if there is an exact match. + return hostname !== parsedProxyHostname; } - } - // 14. Let internalResponse be response, if response is a network error, - // and response’s internal response otherwise. - let internalResponse = - response.status === 0 ? response : response.internalResponse + if (parsedProxyHostname.charAt(0) === '*') { + // Remove leading wildcard. + parsedProxyHostname = parsedProxyHostname.slice(1); + } + // Stop proxying if the hostname ends with the no_proxy host. + return !stringEndsWith.call(hostname, parsedProxyHostname); + }); +} - // 15. If internalResponse’s URL list is empty, then set it to a clone of - // request’s URL list. - if (internalResponse.urlList.length === 0) { - internalResponse.urlList.push(...request.urlList) - } +/** + * Get the value for an environment variable. + * + * @param {string} key - The name of the environment variable. + * @return {string} The value of the environment variable. + * @private + */ +function getEnv(key) { + return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || ''; +} - // 16. If request’s timing allow failed flag is unset, then set - // internalResponse’s timing allow passed flag. - if (!request.timingAllowFailed) { - response.timingAllowPassed = true - } +exports.j = getProxyForUrl; - // 17. If response is not a network error and any of the following returns - // blocked - // - should internalResponse to request be blocked as mixed content - // - should internalResponse to request be blocked by Content Security Policy - // - should internalResponse to request be blocked due to its MIME type - // - should internalResponse to request be blocked due to nosniff - // TODO - // 18. If response’s type is "opaque", internalResponse’s status is 206, - // internalResponse’s range-requested flag is set, and request’s header - // list does not contain `Range`, then set response and internalResponse - // to a network error. - if ( - response.type === 'opaque' && - internalResponse.status === 206 && - internalResponse.rangeRequested && - !request.headers.contains('range') - ) { - response = internalResponse = makeNetworkError() - } +/***/ }), - // 19. If response is not a network error and either request’s method is - // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status, - // set internalResponse’s body to null and disregard any enqueuing toward - // it (if any). - if ( - response.status !== 0 && - (request.method === 'HEAD' || - request.method === 'CONNECT' || - nullBodyStatus.includes(internalResponse.status)) - ) { - internalResponse.body = null - fetchParams.controller.dump = true - } +/***/ 68762: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // 20. If request’s integrity metadata is not the empty string, then: - if (request.integrity) { - // 1. Let processBodyError be this step: run fetch finale given fetchParams - // and a network error. - const processBodyError = (reason) => - fetchFinale(fetchParams, makeNetworkError(reason)) - // 2. If request’s response tainting is "opaque", or response’s body is null, - // then run processBodyError and abort these steps. - if (request.responseTainting === 'opaque' || response.body == null) { - processBodyError(response.error) - return - } +const { instantiateSync } = __nccwpck_require__(27503); +const fs = __nccwpck_require__(57147) - // 3. Let processBody given bytes be these steps: - const processBody = (bytes) => { - // 1. If bytes do not match request’s integrity metadata, - // then run processBodyError and abort these steps. [SRI] - if (!bytesMatch(bytes, request.integrity)) { - processBodyError('integrity mismatch') - return - } +loadWebAssembly.supported = typeof WebAssembly !== 'undefined' - // 2. Set response’s body to bytes as a body. - response.body = safelyExtractBody(bytes)[0] +async function loadWebAssembly (imp = {}) { + if (!loadWebAssembly.supported) return null + + return instantiateSync(fs.readFileSync(__nccwpck_require__.ab + "rabin.wasm"), imp); +} +module.exports = loadWebAssembly - // 3. Run fetch finale given fetchParams and response. - fetchFinale(fetchParams, response) - } - // 4. Fully read response’s body given processBody and processBodyError. - await fullyReadBody(response.body, processBody, processBodyError) - } else { - // 21. Otherwise, run fetch finale given fetchParams and response. - fetchFinale(fetchParams, response) - } +/***/ }), + +/***/ 92477: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Rabin = __nccwpck_require__(90359) +const getRabin = __nccwpck_require__(68762) + +const create = async (avg, min, max, windowSize, polynomial) => { + const compiled = await getRabin() + return new Rabin(compiled, avg, min, max, windowSize, polynomial) } -// https://fetch.spec.whatwg.org/#concept-scheme-fetch -// given a fetch params fetchParams -function schemeFetch (fetchParams) { - // Note: since the connection is destroyed on redirect, which sets fetchParams to a - // cancelled state, we do not want this condition to trigger *unless* there have been - // no redirects. See https://github.com/nodejs/undici/issues/1776 - // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams. - if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) { - return Promise.resolve(makeAppropriateNetworkError(fetchParams)) - } +module.exports = { + Rabin, + create +} - // 2. Let request be fetchParams’s request. - const { request } = fetchParams - const { protocol: scheme } = requestCurrentURL(request) +/***/ }), - // 3. Switch on request’s current URL’s scheme and run the associated steps: - switch (scheme) { - case 'about:': { - // If request’s current URL’s path is the string "blank", then return a new response - // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) », - // and body is the empty byte sequence as a body. +/***/ 90359: +/***/ ((module) => { - // Otherwise, return a network error. - return Promise.resolve(makeNetworkError('about scheme is not supported')) +/** + * Rabin fingerprinting + * + * @class Rabin + */ +class Rabin { + /** + * Creates an instance of Rabin. + * @param { import("./../dist/rabin-wasm") } asModule + * @param {number} [bits=12] + * @param {number} [min=8 * 1024] + * @param {number} [max=32 * 1024] + * @param {number} polynomial + * @memberof Rabin + */ + constructor(asModule, bits = 12, min = 8 * 1024, max = 32 * 1024, windowSize = 64, polynomial) { + this.bits = bits + this.min = min + this.max = max + this.asModule = asModule + this.rabin = new asModule.Rabin(bits, min, max, windowSize, polynomial) + this.polynomial = polynomial } - case 'blob:': { - if (!resolveObjectURL) { - resolveObjectURL = (__nccwpck_require__(14300).resolveObjectURL) - } - // 1. Let blobURLEntry be request’s current URL’s blob URL entry. - const blobURLEntry = requestCurrentURL(request) + /** + * Fingerprints the buffer + * + * @param {Uint8Array} buf + * @returns {Array} + * @memberof Rabin + */ + fingerprint(buf) { + const { + __retain, + __release, + __allocArray, + __getInt32Array, + Int32Array_ID, + Uint8Array_ID + } = this.asModule - // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56 - // Buffer.resolveObjectURL does not ignore URL queries. - if (blobURLEntry.search.length !== 0) { - return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.')) - } + const lengths = new Int32Array(Math.ceil(buf.length/this.min)) + const lengthsPtr = __retain(__allocArray(Int32Array_ID, lengths)) + const pointer = __retain(__allocArray(Uint8Array_ID, buf)) - const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString()) + const out = this.rabin.fingerprint(pointer, lengthsPtr) + const processed = __getInt32Array(out) - // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s - // object is not a Blob object, then return a network error. - if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) { - return Promise.resolve(makeNetworkError('invalid method')) - } + __release(pointer) + __release(lengthsPtr) - // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object. - const bodyWithType = safelyExtractBody(blobURLEntryObject) + const end = processed.indexOf(0); + return end >= 0 ? processed.subarray(0, end) : processed; + } +} - // 4. Let body be bodyWithType’s body. - const body = bodyWithType[0] +module.exports = Rabin - // 5. Let length be body’s length, serialized and isomorphic encoded. - const length = isomorphicEncode(`${body.length}`) +/***/ }), - // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence. - const type = bodyWithType[1] ?? '' +/***/ 17120: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // 7. Return a new response whose status message is `OK`, header list is - // « (`Content-Length`, length), (`Content-Type`, type) », and body is body. - const response = makeResponse({ - statusText: 'OK', - headersList: [ - ['content-length', { name: 'Content-Length', value: length }], - ['content-type', { name: 'Content-Type', value: type }] - ] - }) +/* eslint-disable node/no-deprecated-api */ + + + +var buffer = __nccwpck_require__(14300) +var Buffer = buffer.Buffer - response.body = body +var safer = {} - return Promise.resolve(response) - } - case 'data:': { - // 1. Let dataURLStruct be the result of running the - // data: URL processor on request’s current URL. - const currentURL = requestCurrentURL(request) - const dataURLStruct = dataURLProcessor(currentURL) +var key - // 2. If dataURLStruct is failure, then return a - // network error. - if (dataURLStruct === 'failure') { - return Promise.resolve(makeNetworkError('failed to fetch the data URL')) - } +for (key in buffer) { + if (!buffer.hasOwnProperty(key)) continue + if (key === 'SlowBuffer' || key === 'Buffer') continue + safer[key] = buffer[key] +} - // 3. Let mimeType be dataURLStruct’s MIME type, serialized. - const mimeType = serializeAMimeType(dataURLStruct.mimeType) +var Safer = safer.Buffer = {} +for (key in Buffer) { + if (!Buffer.hasOwnProperty(key)) continue + if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue + Safer[key] = Buffer[key] +} - // 4. Return a response whose status message is `OK`, - // header list is « (`Content-Type`, mimeType) », - // and body is dataURLStruct’s body as a body. - return Promise.resolve(makeResponse({ - statusText: 'OK', - headersList: [ - ['content-type', { name: 'Content-Type', value: mimeType }] - ], - body: safelyExtractBody(dataURLStruct.body)[0] - })) +safer.Buffer.prototype = Buffer.prototype + +if (!Safer.from || Safer.from === Uint8Array.from) { + Safer.from = function (value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) } - case 'file:': { - // For now, unfortunate as it is, file URLs are left as an exercise for the reader. - // When in doubt, return a network error. - return Promise.resolve(makeNetworkError('not implemented... yet...')) + if (value && typeof value.length === 'undefined') { + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value) } - case 'http:': - case 'https:': { - // Return the result of running HTTP fetch given fetchParams. + return Buffer(value, encodingOrOffset, length) + } +} - return httpFetch(fetchParams) - .catch((err) => makeNetworkError(err)) +if (!Safer.alloc) { + Safer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) } - default: { - return Promise.resolve(makeNetworkError('unknown scheme')) + if (size < 0 || size >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + var buf = Buffer(size) + if (!fill || fill.length === 0) { + buf.fill(0) + } else if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) } + return buf } } -// https://fetch.spec.whatwg.org/#finalize-response -function finalizeResponse (fetchParams, response) { - // 1. Set fetchParams’s request’s done flag. - fetchParams.request.done = true - - // 2, If fetchParams’s process response done is not null, then queue a fetch - // task to run fetchParams’s process response done given response, with - // fetchParams’s task destination. - if (fetchParams.processResponseDone != null) { - queueMicrotask(() => fetchParams.processResponseDone(response)) +if (!safer.kStringMaxLength) { + try { + safer.kStringMaxLength = process.binding('buffer').kStringMaxLength + } catch (e) { + // we can't determine kStringMaxLength in environments where process.binding + // is unsupported, so let's not set it } } -// https://fetch.spec.whatwg.org/#fetch-finale -function fetchFinale (fetchParams, response) { - // 1. If response is a network error, then: - if (response.type === 'error') { - // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ». - response.urlList = [fetchParams.request.urlList[0]] - - // 2. Set response’s timing info to the result of creating an opaque timing - // info for fetchParams’s timing info. - response.timingInfo = createOpaqueTimingInfo({ - startTime: fetchParams.timingInfo.startTime - }) +if (!safer.constants) { + safer.constants = { + MAX_LENGTH: safer.kMaxLength } - - // 2. Let processResponseEndOfBody be the following steps: - const processResponseEndOfBody = () => { - // 1. Set fetchParams’s request’s done flag. - fetchParams.request.done = true - - // If fetchParams’s process response end-of-body is not null, - // then queue a fetch task to run fetchParams’s process response - // end-of-body given response with fetchParams’s task destination. - if (fetchParams.processResponseEndOfBody != null) { - queueMicrotask(() => fetchParams.processResponseEndOfBody(response)) - } + if (safer.kStringMaxLength) { + safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength } +} - // 3. If fetchParams’s process response is non-null, then queue a fetch task - // to run fetchParams’s process response given response, with fetchParams’s - // task destination. - if (fetchParams.processResponse != null) { - queueMicrotask(() => fetchParams.processResponse(response)) - } +module.exports = safer - // 4. If response’s body is null, then run processResponseEndOfBody. - if (response.body == null) { - processResponseEndOfBody() - } else { - // 5. Otherwise: - // 1. Let transformStream be a new a TransformStream. +/***/ }), - // 2. Let identityTransformAlgorithm be an algorithm which, given chunk, - // enqueues chunk in transformStream. - const identityTransformAlgorithm = (chunk, controller) => { - controller.enqueue(chunk) - } +/***/ 20028: +/***/ ((module) => { - // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm - // and flushAlgorithm set to processResponseEndOfBody. - const transformStream = new TransformStream({ - start () {}, - transform: identityTransformAlgorithm, - flush: processResponseEndOfBody - }, { - size () { - return 1 - } - }, { - size () { - return 1 - } - }) - // 4. Set response’s body to the result of piping response’s body through transformStream. - response.body = { stream: response.body.stream.pipeThrough(transformStream) } - } - // 6. If fetchParams’s process response consume body is non-null, then: - if (fetchParams.processResponseConsumeBody != null) { - // 1. Let processBody given nullOrBytes be this step: run fetchParams’s - // process response consume body given response and nullOrBytes. - const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes) +// JS treats subjects of bitwise operators as SIGNED 32 bit numbers, +// which means the maximum amount of bits we can store inside each byte +// is 7.. +const BITS_PER_BYTE = 7 - // 2. Let processBodyError be this step: run fetchParams’s process - // response consume body given response and failure. - const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure) +module.exports = class SparseArray { + constructor () { + this._bitArrays = [] + this._data = [] + this._length = 0 + this._changedLength = false + this._changedData = false + } - // 3. If response’s body is null, then queue a fetch task to run processBody - // given null, with fetchParams’s task destination. - if (response.body == null) { - queueMicrotask(() => processBody(null)) + set (index, value) { + let pos = this._internalPositionFor(index, false) + if (value === undefined) { + // unsetting + if (pos !== -1) { + // remove item from bit array and array itself + this._unsetInternalPos(pos) + this._unsetBit(index) + this._changedLength = true + this._changedData = true + } } else { - // 4. Otherwise, fully read response’s body given processBody, processBodyError, - // and fetchParams’s task destination. - return fullyReadBody(response.body, processBody, processBodyError) + let needsSort = false + if (pos === -1) { + pos = this._data.length + this._setBit(index) + this._changedData = true + } else { + needsSort = true + } + this._setInternalPos(pos, index, value, needsSort) + this._changedLength = true } - return Promise.resolve() } -} -// https://fetch.spec.whatwg.org/#http-fetch -async function httpFetch (fetchParams) { - // 1. Let request be fetchParams’s request. - const request = fetchParams.request + unset (index) { + this.set(index, undefined) + } - // 2. Let response be null. - let response = null + get (index) { + this._sortData() + const pos = this._internalPositionFor(index, true) + if (pos === -1) { + return undefined + } + return this._data[pos][1] + } - // 3. Let actualResponse be null. - let actualResponse = null + push (value) { + this.set(this.length, value) + return this.length + } - // 4. Let timingInfo be fetchParams’s timing info. - const timingInfo = fetchParams.timingInfo + get length () { + this._sortData() + if (this._changedLength) { + const last = this._data[this._data.length - 1] + this._length = last ? last[0] + 1 : 0 + this._changedLength = false + } + return this._length + } - // 5. If request’s service-workers mode is "all", then: - if (request.serviceWorkers === 'all') { - // TODO + forEach (iterator) { + let i = 0 + while(i < this.length) { + iterator(this.get(i), i, this) + i++ + } } - // 6. If response is null, then: - if (response === null) { - // 1. If makeCORSPreflight is true and one of these conditions is true: - // TODO + map (iterator) { + let i = 0 + let mapped = new Array(this.length) + while(i < this.length) { + mapped[i] = iterator(this.get(i), i, this) + i++ + } + return mapped + } - // 2. If request’s redirect mode is "follow", then set request’s - // service-workers mode to "none". - if (request.redirect === 'follow') { - request.serviceWorkers = 'none' + reduce (reducer, initialValue) { + let i = 0 + let acc = initialValue + while(i < this.length) { + const value = this.get(i) + acc = reducer(acc, value, i) + i++ } + return acc + } - // 3. Set response and actualResponse to the result of running - // HTTP-network-or-cache fetch given fetchParams. - actualResponse = response = await httpNetworkOrCacheFetch(fetchParams) + find (finder) { + let i = 0, found, last + while ((i < this.length) && !found) { + last = this.get(i) + found = finder(last) + i++ + } + return found ? last : undefined + } - // 4. If request’s response tainting is "cors" and a CORS check - // for request and response returns failure, then return a network error. - if ( - request.responseTainting === 'cors' && - corsCheck(request, response) === 'failure' - ) { - return makeNetworkError('cors failure') + _internalPositionFor (index, noCreate) { + const bytePos = this._bytePosFor(index, noCreate) + if (bytePos >= this._bitArrays.length) { + return -1 + } + const byte = this._bitArrays[bytePos] + const bitPos = index - bytePos * BITS_PER_BYTE + const exists = (byte & (1 << bitPos)) > 0 + if (!exists) { + return -1 } + const previousPopCount = this._bitArrays.slice(0, bytePos).reduce(popCountReduce, 0) - // 5. If the TAO check for request and response returns failure, then set - // request’s timing allow failed flag. - if (TAOCheck(request, response) === 'failure') { - request.timingAllowFailed = true + const mask = ~(0xffffffff << (bitPos + 1)) + const bytePopCount = popCount(byte & mask) + const arrayPos = previousPopCount + bytePopCount - 1 + return arrayPos + } + + _bytePosFor (index, noCreate) { + const bytePos = Math.floor(index / BITS_PER_BYTE) + const targetLength = bytePos + 1 + while (!noCreate && this._bitArrays.length < targetLength) { + this._bitArrays.push(0) } + return bytePos } - // 7. If either request’s response tainting or response’s type - // is "opaque", and the cross-origin resource policy check with - // request’s origin, request’s client, request’s destination, - // and actualResponse returns blocked, then return a network error. - if ( - (request.responseTainting === 'opaque' || response.type === 'opaque') && - crossOriginResourcePolicyCheck( - request.origin, - request.client, - request.destination, - actualResponse - ) === 'blocked' - ) { - return makeNetworkError('blocked') + _setBit (index) { + const bytePos = this._bytePosFor(index, false) + this._bitArrays[bytePos] |= (1 << (index - (bytePos * BITS_PER_BYTE))) } - // 8. If actualResponse’s status is a redirect status, then: - if (redirectStatusSet.has(actualResponse.status)) { - // 1. If actualResponse’s status is not 303, request’s body is not null, - // and the connection uses HTTP/2, then user agents may, and are even - // encouraged to, transmit an RST_STREAM frame. - // See, https://github.com/whatwg/fetch/issues/1288 - if (request.redirect !== 'manual') { - fetchParams.controller.connection.destroy() - } + _unsetBit(index) { + const bytePos = this._bytePosFor(index, false) + this._bitArrays[bytePos] &= ~(1 << (index - (bytePos * BITS_PER_BYTE))) + } - // 2. Switch on request’s redirect mode: - if (request.redirect === 'error') { - // Set response to a network error. - response = makeNetworkError('unexpected redirect') - } else if (request.redirect === 'manual') { - // Set response to an opaque-redirect filtered response whose internal - // response is actualResponse. - // NOTE(spec): On the web this would return an `opaqueredirect` response, - // but that doesn't make sense server side. - // See https://github.com/nodejs/undici/issues/1193. - response = actualResponse - } else if (request.redirect === 'follow') { - // Set response to the result of running HTTP-redirect fetch given - // fetchParams and response. - response = await httpRedirectFetch(fetchParams, response) + _setInternalPos(pos, index, value, needsSort) { + const data =this._data + const elem = [index, value] + if (needsSort) { + this._sortData() + data[pos] = elem } else { - assert(false) + // new element. just shove it into the array + // but be nice about where we shove it + // in order to make sorting it later easier + if (data.length) { + if (data[data.length - 1][0] >= index) { + data.push(elem) + } else if (data[0][0] <= index) { + data.unshift(elem) + } else { + const randomIndex = Math.round(data.length / 2) + this._data = data.slice(0, randomIndex).concat(elem).concat(data.slice(randomIndex)) + } + } else { + this._data.push(elem) + } + this._changedData = true + this._changedLength = true } } - // 9. Set response’s timing info to timingInfo. - response.timingInfo = timingInfo + _unsetInternalPos (pos) { + this._data.splice(pos, 1) + } - // 10. Return response. - return response -} + _sortData () { + if (this._changedData) { + this._data.sort(sortInternal) + } -// https://fetch.spec.whatwg.org/#http-redirect-fetch -function httpRedirectFetch (fetchParams, response) { - // 1. Let request be fetchParams’s request. - const request = fetchParams.request + this._changedData = false + } - // 2. Let actualResponse be response, if response is not a filtered response, - // and response’s internal response otherwise. - const actualResponse = response.internalResponse - ? response.internalResponse - : response + bitField () { + const bytes = [] + let pendingBitsForResultingByte = 8 + let pendingBitsForNewByte = 0 + let resultingByte = 0 + let newByte + const pending = this._bitArrays.slice() + while (pending.length || pendingBitsForNewByte) { + if (pendingBitsForNewByte === 0) { + newByte = pending.shift() + pendingBitsForNewByte = 7 + } - // 3. Let locationURL be actualResponse’s location URL given request’s current - // URL’s fragment. - let locationURL + const usingBits = Math.min(pendingBitsForNewByte, pendingBitsForResultingByte) + const mask = ~(0b11111111 << usingBits) + const masked = newByte & mask + resultingByte |= masked << (8 - pendingBitsForResultingByte) + newByte = newByte >>> usingBits + pendingBitsForNewByte -= usingBits + pendingBitsForResultingByte -= usingBits - try { - locationURL = responseLocationURL( - actualResponse, - requestCurrentURL(request).hash - ) + if (!pendingBitsForResultingByte || (!pendingBitsForNewByte && !pending.length)) { + bytes.push(resultingByte) + resultingByte = 0 + pendingBitsForResultingByte = 8 + } + } - // 4. If locationURL is null, then return response. - if (locationURL == null) { - return response + // remove trailing zeroes + for(var i = bytes.length - 1; i > 0; i--) { + const value = bytes[i] + if (value === 0) { + bytes.pop() + } else { + break + } } - } catch (err) { - // 5. If locationURL is failure, then return a network error. - return Promise.resolve(makeNetworkError(err)) - } - // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network - // error. - if (!urlIsHttpHttpsScheme(locationURL)) { - return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme')) + return bytes } - // 7. If request’s redirect count is 20, then return a network error. - if (request.redirectCount === 20) { - return Promise.resolve(makeNetworkError('redirect count exceeded')) + compactArray () { + this._sortData() + return this._data.map(valueOnly) } +} - // 8. Increase request’s redirect count by 1. - request.redirectCount += 1 +function popCountReduce (count, byte) { + return count + popCount(byte) +} - // 9. If request’s mode is "cors", locationURL includes credentials, and - // request’s origin is not same origin with locationURL’s origin, then return - // a network error. - if ( - request.mode === 'cors' && - (locationURL.username || locationURL.password) && - !sameOrigin(request, locationURL) - ) { - return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"')) - } +function popCount(_v) { + let v = _v + v = v - ((v >> 1) & 0x55555555) // reuse input as temporary + v = (v & 0x33333333) + ((v >> 2) & 0x33333333) // temp + return ((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >> 24 +} - // 10. If request’s response tainting is "cors" and locationURL includes - // credentials, then return a network error. - if ( - request.responseTainting === 'cors' && - (locationURL.username || locationURL.password) - ) { - return Promise.resolve(makeNetworkError( - 'URL cannot contain credentials for request mode "cors"' - )) - } +function sortInternal (a, b) { + return a[0] - b[0] +} - // 11. If actualResponse’s status is not 303, request’s body is non-null, - // and request’s body’s source is null, then return a network error. - if ( - actualResponse.status !== 303 && - request.body != null && - request.body.source == null - ) { - return Promise.resolve(makeNetworkError()) - } +function valueOnly (elem) { + return elem[1] +} - // 12. If one of the following is true - // - actualResponse’s status is 301 or 302 and request’s method is `POST` - // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD` - if ( - ([301, 302].includes(actualResponse.status) && request.method === 'POST') || - (actualResponse.status === 303 && - !GET_OR_HEAD.includes(request.method)) - ) { - // then: - // 1. Set request’s method to `GET` and request’s body to null. - request.method = 'GET' - request.body = null +/***/ }), - // 2. For each headerName of request-body-header name, delete headerName from - // request’s header list. - for (const headerName of requestBodyHeader) { - request.headersList.delete(headerName) - } - } +/***/ 76051: +/***/ ((module) => { - // 13. If request’s current URL’s origin is not same origin with locationURL’s - // origin, then for each headerName of CORS non-wildcard request-header name, - // delete headerName from request’s header list. - if (!sameOrigin(requestCurrentURL(request), locationURL)) { - // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name - request.headersList.delete('authorization') +module.exports = readable => { + // Node.js stream + if (readable[Symbol.asyncIterator]) return readable - // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement. - request.headersList.delete('cookie') - request.headersList.delete('host') - } + // Browser ReadableStream + if (readable.getReader) { + return (async function * () { + const reader = readable.getReader() - // 14. If request’s body is non-null, then set request’s body to the first return - // value of safely extracting request’s body’s source. - if (request.body != null) { - assert(request.body.source != null) - request.body = safelyExtractBody(request.body.source)[0] + try { + while (true) { + const { done, value } = await reader.read() + if (done) return + yield value + } + } finally { + reader.releaseLock() + } + })() } - // 15. Let timingInfo be fetchParams’s timing info. - const timingInfo = fetchParams.timingInfo + throw new Error('unknown stream') +} - // 16. Set timingInfo’s redirect end time and post-redirect start time to the - // coarsened shared current time given fetchParams’s cross-origin isolated - // capability. - timingInfo.redirectEndTime = timingInfo.postRedirectStartTime = - coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability) - // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s - // redirect start time to timingInfo’s start time. - if (timingInfo.redirectStartTime === 0) { - timingInfo.redirectStartTime = timingInfo.startTime - } +/***/ }), - // 18. Append locationURL to request’s URL list. - request.urlList.push(locationURL) +/***/ 44739: +/***/ ((module) => { - // 19. Invoke set request’s referrer policy on redirect on request and - // actualResponse. - setRequestReferrerPolicyOnRedirect(request, actualResponse) +const hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; +const numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/; +// const octRegex = /0x[a-z0-9]+/; +// const binRegex = /0x[a-z0-9]+/; - // 20. Return the result of running main fetch given fetchParams and true. - return mainFetch(fetchParams, true) + +//polyfill +if (!Number.parseInt && window.parseInt) { + Number.parseInt = window.parseInt; +} +if (!Number.parseFloat && window.parseFloat) { + Number.parseFloat = window.parseFloat; } -// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch -async function httpNetworkOrCacheFetch ( - fetchParams, - isAuthenticationFetch = false, - isNewConnectionFetch = false -) { - // 1. Let request be fetchParams’s request. - const request = fetchParams.request + +const consider = { + hex : true, + leadingZeros: true, + decimalPoint: "\.", + eNotation: true + //skipLike: /regex/ +}; - // 2. Let httpFetchParams be null. - let httpFetchParams = null +function toNumber(str, options = {}){ + // const options = Object.assign({}, consider); + // if(opt.leadingZeros === false){ + // options.leadingZeros = false; + // }else if(opt.hex === false){ + // options.hex = false; + // } - // 3. Let httpRequest be null. - let httpRequest = null + options = Object.assign({}, consider, options ); + if(!str || typeof str !== "string" ) return str; + + let trimmedStr = str.trim(); + // if(trimmedStr === "0.0") return 0; + // else if(trimmedStr === "+0.0") return 0; + // else if(trimmedStr === "-0.0") return -0; - // 4. Let response be null. - let response = null + if(options.skipLike !== undefined && options.skipLike.test(trimmedStr)) return str; + else if (options.hex && hexRegex.test(trimmedStr)) { + return Number.parseInt(trimmedStr, 16); + // } else if (options.parseOct && octRegex.test(str)) { + // return Number.parseInt(val, 8); + // }else if (options.parseBin && binRegex.test(str)) { + // return Number.parseInt(val, 2); + }else{ + //separate negative sign, leading zeros, and rest number + const match = numRegex.exec(trimmedStr); + if(match){ + const sign = match[1]; + const leadingZeros = match[2]; + let numTrimmedByZeros = trimZeros(match[3]); //complete num without leading zeros + //trim ending zeros for floating number + + const eNotation = match[4] || match[6]; + if(!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str; //-0123 + else if(!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str; //0123 + else{//no leading zeros or leading zeros are allowed + const num = Number(trimmedStr); + const numStr = "" + num; + if(numStr.search(/[eE]/) !== -1){ //given number is long and parsed to eNotation + if(options.eNotation) return num; + else return str; + }else if(eNotation){ //given number has enotation + if(options.eNotation) return num; + else return str; + }else if(trimmedStr.indexOf(".") !== -1){ //floating number + // const decimalPart = match[5].substr(1); + // const intPart = trimmedStr.substr(0,trimmedStr.indexOf(".")); - // 5. Let storedResponse be null. - // TODO: cache + + // const p = numStr.indexOf("."); + // const givenIntPart = numStr.substr(0,p); + // const givenDecPart = numStr.substr(p+1); + if(numStr === "0" && (numTrimmedByZeros === "") ) return num; //0.0 + else if(numStr === numTrimmedByZeros) return num; //0.456. 0.79000 + else if( sign && numStr === "-"+numTrimmedByZeros) return num; + else return str; + } + + if(leadingZeros){ + // if(numTrimmedByZeros === numStr){ + // if(options.leadingZeros) return num; + // else return str; + // }else return str; + if(numTrimmedByZeros === numStr) return num; + else if(sign+numTrimmedByZeros === numStr) return num; + else return str; + } - // 6. Let httpCache be null. - const httpCache = null + if(trimmedStr === numStr) return num; + else if(trimmedStr === sign+numStr) return num; + // else{ + // //number with +/- sign + // trimmedStr.test(/[-+][0-9]); - // 7. Let the revalidatingFlag be unset. - const revalidatingFlag = false + // } + return str; + } + // else if(!eNotation && trimmedStr && trimmedStr !== Number(trimmedStr) ) return str; + + }else{ //non-numeric string + return str; + } + } +} - // 8. Run these steps, but abort when the ongoing fetch is terminated: +/** + * + * @param {string} numStr without leading zeros + * @returns + */ +function trimZeros(numStr){ + if(numStr && numStr.indexOf(".") !== -1){//float + numStr = numStr.replace(/0+$/, ""); //remove ending zeros + if(numStr === ".") numStr = "0"; + else if(numStr[0] === ".") numStr = "0"+numStr; + else if(numStr[numStr.length-1] === ".") numStr = numStr.substr(0,numStr.length-1); + return numStr; + } + return numStr; +} +module.exports = toNumber - // 1. If request’s window is "no-window" and request’s redirect mode is - // "error", then set httpFetchParams to fetchParams and httpRequest to - // request. - if (request.window === 'no-window' && request.redirect === 'error') { - httpFetchParams = fetchParams - httpRequest = request - } else { - // Otherwise: - // 1. Set httpRequest to a clone of request. - httpRequest = makeRequest(request) +/***/ }), - // 2. Set httpFetchParams to a copy of fetchParams. - httpFetchParams = { ...fetchParams } +/***/ 66164: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // 3. Set httpFetchParams’s request to httpRequest. - httpFetchParams.request = httpRequest - } - // 3. Let includeCredentials be true if one of - const includeCredentials = - request.credentials === 'include' || - (request.credentials === 'same-origin' && - request.responseTainting === 'basic') +const os = __nccwpck_require__(22037); +const hasFlag = __nccwpck_require__(72852); - // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s - // body is non-null; otherwise null. - const contentLength = httpRequest.body ? httpRequest.body.length : null +const env = process.env; - // 5. Let contentLengthHeaderValue be null. - let contentLengthHeaderValue = null +let forceColor; +if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false')) { + forceColor = false; +} else if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + forceColor = true; +} +if ('FORCE_COLOR' in env) { + forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; +} - // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or - // `PUT`, then set contentLengthHeaderValue to `0`. - if ( - httpRequest.body == null && - ['POST', 'PUT'].includes(httpRequest.method) - ) { - contentLengthHeaderValue = '0' - } +function translateLevel(level) { + if (level === 0) { + return false; + } - // 7. If contentLength is non-null, then set contentLengthHeaderValue to - // contentLength, serialized and isomorphic encoded. - if (contentLength != null) { - contentLengthHeaderValue = isomorphicEncode(`${contentLength}`) - } + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; +} - // 8. If contentLengthHeaderValue is non-null, then append - // `Content-Length`/contentLengthHeaderValue to httpRequest’s header - // list. - if (contentLengthHeaderValue != null) { - httpRequest.headersList.append('content-length', contentLengthHeaderValue) - } +function supportsColor(stream) { + if (forceColor === false) { + return 0; + } - // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`, - // contentLengthHeaderValue) to httpRequest’s header list. + if (hasFlag('color=16m') || + hasFlag('color=full') || + hasFlag('color=truecolor')) { + return 3; + } - // 10. If contentLength is non-null and httpRequest’s keepalive is true, - // then: - if (contentLength != null && httpRequest.keepalive) { - // NOTE: keepalive is a noop outside of browser context. - } + if (hasFlag('color=256')) { + return 2; + } - // 11. If httpRequest’s referrer is a URL, then append - // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded, - // to httpRequest’s header list. - if (httpRequest.referrer instanceof URL) { - httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href)) - } + if (stream && !stream.isTTY && forceColor !== true) { + return 0; + } - // 12. Append a request `Origin` header for httpRequest. - appendRequestOriginHeader(httpRequest) + const min = forceColor ? 1 : 0; - // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA] - appendFetchMetadata(httpRequest) + if (process.platform === 'win32') { + // Node.js 7.5.0 is the first version of Node.js to include a patch to + // libuv that enables 256 color output on Windows. Anything earlier and it + // won't work. However, here we target Node.js 8 at minimum as it is an LTS + // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows + // release that supports 256 colors. Windows 10 build 14931 is the first release + // that supports 16m/TrueColor. + const osRelease = os.release().split('.'); + if ( + Number(process.versions.node.split('.')[0]) >= 8 && + Number(osRelease[0]) >= 10 && + Number(osRelease[2]) >= 10586 + ) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } - // 14. If httpRequest’s header list does not contain `User-Agent`, then - // user agents should append `User-Agent`/default `User-Agent` value to - // httpRequest’s header list. - if (!httpRequest.headersList.contains('user-agent')) { - httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node') - } + return 1; + } - // 15. If httpRequest’s cache mode is "default" and httpRequest’s header - // list contains `If-Modified-Since`, `If-None-Match`, - // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set - // httpRequest’s cache mode to "no-store". - if ( - httpRequest.cache === 'default' && - (httpRequest.headersList.contains('if-modified-since') || - httpRequest.headersList.contains('if-none-match') || - httpRequest.headersList.contains('if-unmodified-since') || - httpRequest.headersList.contains('if-match') || - httpRequest.headersList.contains('if-range')) - ) { - httpRequest.cache = 'no-store' - } + if ('CI' in env) { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + return 1; + } - // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent - // no-cache cache-control header modification flag is unset, and - // httpRequest’s header list does not contain `Cache-Control`, then append - // `Cache-Control`/`max-age=0` to httpRequest’s header list. - if ( - httpRequest.cache === 'no-cache' && - !httpRequest.preventNoCacheCacheControlHeaderModification && - !httpRequest.headersList.contains('cache-control') - ) { - httpRequest.headersList.append('cache-control', 'max-age=0') - } + return min; + } - // 17. If httpRequest’s cache mode is "no-store" or "reload", then: - if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') { - // 1. If httpRequest’s header list does not contain `Pragma`, then append - // `Pragma`/`no-cache` to httpRequest’s header list. - if (!httpRequest.headersList.contains('pragma')) { - httpRequest.headersList.append('pragma', 'no-cache') - } + if ('TEAMCITY_VERSION' in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } - // 2. If httpRequest’s header list does not contain `Cache-Control`, - // then append `Cache-Control`/`no-cache` to httpRequest’s header list. - if (!httpRequest.headersList.contains('cache-control')) { - httpRequest.headersList.append('cache-control', 'no-cache') - } - } + if (env.COLORTERM === 'truecolor') { + return 3; + } - // 18. If httpRequest’s header list contains `Range`, then append - // `Accept-Encoding`/`identity` to httpRequest’s header list. - if (httpRequest.headersList.contains('range')) { - httpRequest.headersList.append('accept-encoding', 'identity') - } + if ('TERM_PROGRAM' in env) { + const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); - // 19. Modify httpRequest’s header list per HTTP. Do not append a given - // header if httpRequest’s header list contains that header’s name. - // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129 - if (!httpRequest.headersList.contains('accept-encoding')) { - if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) { - httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate') - } else { - httpRequest.headersList.append('accept-encoding', 'gzip, deflate') + switch (env.TERM_PROGRAM) { + case 'iTerm.app': + return version >= 3 ? 3 : 2; + case 'Apple_Terminal': + return 2; + // No default + } + } + + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + + if ('COLORTERM' in env) { + return 1; + } + + if (env.TERM === 'dumb') { + return min; + } + + return min; +} + +function getSupportLevel(stream) { + const level = supportsColor(stream); + return translateLevel(level); +} + +module.exports = { + supportsColor: getSupportLevel, + stdout: getSupportLevel(process.stdout), + stderr: getSupportLevel(process.stderr) +}; + + +/***/ }), + +/***/ 47754: +/***/ ((module) => { + +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global global, define, Symbol, Reflect, Promise, SuppressedError */ +var __extends; +var __assign; +var __rest; +var __decorate; +var __param; +var __esDecorate; +var __runInitializers; +var __propKey; +var __setFunctionName; +var __metadata; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __spreadArrays; +var __spreadArray; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; +var __importDefault; +var __classPrivateFieldGet; +var __classPrivateFieldSet; +var __classPrivateFieldIn; +var __createBinding; +var __addDisposableResource; +var __disposeResources; +(function (factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + } + else if ( true && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } + else { + factory(createExporter(root)); } - } - - httpRequest.headersList.delete('host') - - // 20. If includeCredentials is true, then: - if (includeCredentials) { - // 1. If the user agent is not configured to block cookies for httpRequest - // (see section 7 of [COOKIES]), then: - // TODO: credentials - // 2. If httpRequest’s header list does not contain `Authorization`, then: - // TODO: credentials - } - - // 21. If there’s a proxy-authentication entry, use it as appropriate. - // TODO: proxy-authentication - - // 22. Set httpCache to the result of determining the HTTP cache - // partition, given httpRequest. - // TODO: cache - - // 23. If httpCache is null, then set httpRequest’s cache mode to - // "no-store". - if (httpCache == null) { - httpRequest.cache = 'no-store' - } - - // 24. If httpRequest’s cache mode is neither "no-store" nor "reload", - // then: - if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') { - // TODO: cache - } - - // 9. If aborted, then return the appropriate network error for fetchParams. - // TODO - - // 10. If response is null, then: - if (response == null) { - // 1. If httpRequest’s cache mode is "only-if-cached", then return a - // network error. - if (httpRequest.mode === 'only-if-cached') { - return makeNetworkError('only if cached') + function createExporter(exports, previous) { + if (exports !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports, "__esModule", { value: true }); + } + else { + exports.__esModule = true; + } + } + return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; } +}) +(function (exporter) { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - // 2. Let forwardResponse be the result of running HTTP-network fetch - // given httpFetchParams, includeCredentials, and isNewConnectionFetch. - const forwardResponse = await httpNetworkFetch( - httpFetchParams, - includeCredentials, - isNewConnectionFetch - ) + __extends = function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; - // 3. If httpRequest’s method is unsafe and forwardResponse’s status is - // in the range 200 to 399, inclusive, invalidate appropriate stored - // responses in httpCache, as per the "Invalidation" chapter of HTTP - // Caching, and set storedResponse to null. [HTTP-CACHING] - if ( - !safeMethodsSet.has(httpRequest.method) && - forwardResponse.status >= 200 && - forwardResponse.status <= 399 - ) { - // TODO: cache - } + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; - // 4. If the revalidatingFlag is set and forwardResponse’s status is 304, - // then: - if (revalidatingFlag && forwardResponse.status === 304) { - // TODO: cache - } + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; - // 5. If response is null, then: - if (response == null) { - // 1. Set response to forwardResponse. - response = forwardResponse + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; - // 2. Store httpRequest and forwardResponse in httpCache, as per the - // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING] - // TODO: cache - } - } + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; - // 11. Set response’s URL list to a clone of httpRequest’s URL list. - response.urlList = [...httpRequest.urlList] + __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; + }; - // 12. If httpRequest’s header list contains `Range`, then set response’s - // range-requested flag. - if (httpRequest.headersList.contains('range')) { - response.rangeRequested = true - } + __runInitializers = function (thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; + }; - // 13. Set response’s request-includes-credentials to includeCredentials. - response.requestIncludesCredentials = includeCredentials + __propKey = function (x) { + return typeof x === "symbol" ? x : "".concat(x); + }; - // 14. If response’s status is 401, httpRequest’s response tainting is not - // "cors", includeCredentials is true, and request’s window is an environment - // settings object, then: - // TODO + __setFunctionName = function (f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); + }; - // 15. If response’s status is 407, then: - if (response.status === 407) { - // 1. If request’s window is "no-window", then return a network error. - if (request.window === 'no-window') { - return makeNetworkError() - } + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; - // 2. ??? + __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()); + }); + }; - // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams. - if (isCancelled(fetchParams)) { - return makeAppropriateNetworkError(fetchParams) - } + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; - // 4. Prompt the end user as appropriate in request’s window and store - // the result as a proxy-authentication entry. [HTTP-AUTH] - // TODO: Invoke some kind of callback? + __exportStar = function(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); + }; - // 5. Set response to the result of running HTTP-network-or-cache fetch given - // fetchParams. - // TODO - return makeNetworkError('proxy authentication required') - } + __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); - // 16. If all of the following are true - if ( - // response’s status is 421 - response.status === 421 && - // isNewConnectionFetch is false - !isNewConnectionFetch && - // request’s body is null, or request’s body is non-null and request’s body’s source is non-null - (request.body == null || request.body.source != null) - ) { - // then: + __values = function (o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; - // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams. - if (isCancelled(fetchParams)) { - return makeAppropriateNetworkError(fetchParams) - } + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; - // 2. Set response to the result of running HTTP-network-or-cache - // fetch given fetchParams, isAuthenticationFetch, and true. + /** @deprecated */ + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; - // TODO (spec): The spec doesn't specify this but we need to cancel - // the active response before we can start a new one. - // https://github.com/whatwg/fetch/issues/1293 - fetchParams.controller.connection.destroy() + /** @deprecated */ + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; - response = await httpNetworkOrCacheFetch( - fetchParams, - isAuthenticationFetch, - true - ) - } + __spreadArray = function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + }; - // 17. If isAuthenticationFetch is true, then create an authentication entry - if (isAuthenticationFetch) { - // TODO - } + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; - // 18. Return response. - return response -} + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; -// https://fetch.spec.whatwg.org/#http-network-fetch -async function httpNetworkFetch ( - fetchParams, - includeCredentials = false, - forceNewConnection = false -) { - assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed) + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } + }; - fetchParams.controller.connection = { - abort: null, - destroyed: false, - destroy (err) { - if (!this.destroyed) { - this.destroyed = true - this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError')) - } - } - } + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; - // 1. Let request be fetchParams’s request. - const request = fetchParams.request + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; - // 2. Let response be null. - let response = null + var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }; - // 3. Let timingInfo be fetchParams’s timing info. - const timingInfo = fetchParams.timingInfo + __importStar = function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; - // 4. Let httpCache be the result of determining the HTTP cache partition, - // given request. - // TODO: cache - const httpCache = null + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; - // 5. If httpCache is null, then set request’s cache mode to "no-store". - if (httpCache == null) { - request.cache = 'no-store' - } + __classPrivateFieldGet = function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); + }; - // 6. Let networkPartitionKey be the result of determining the network - // partition key given request. - // TODO + __classPrivateFieldSet = function (receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; + }; - // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise - // "no". - const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars + __classPrivateFieldIn = function (state, receiver) { + if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); + }; - // 8. Switch on request’s mode: - if (request.mode === 'websocket') { - // Let connection be the result of obtaining a WebSocket connection, - // given request’s current URL. - // TODO - } else { - // Let connection be the result of obtaining a connection, given - // networkPartitionKey, request’s current URL’s origin, - // includeCredentials, and forceNewConnection. - // TODO - } + __addDisposableResource = function (env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + env.stack.push({ value: value, dispose: dispose, async: async }); + } + else if (async) { + env.stack.push({ async: true }); + } + return value; + }; - // 9. Run these steps, but abort when the ongoing fetch is terminated: + var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; + }; - // 1. If connection is failure, then return a network error. + __disposeResources = function (env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + function next() { + while (env.stack.length) { + var rec = env.stack.pop(); + try { + var result = rec.dispose && rec.dispose.call(rec.value); + if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + } + catch (e) { + fail(e); + } + } + if (env.hasError) throw env.error; + } + return next(); + }; - // 2. Set timingInfo’s final connection timing info to the result of - // calling clamp and coarsen connection timing info with connection’s - // timing info, timingInfo’s post-redirect start time, and fetchParams’s - // cross-origin isolated capability. + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__esDecorate", __esDecorate); + exporter("__runInitializers", __runInitializers); + exporter("__propKey", __propKey); + exporter("__setFunctionName", __setFunctionName); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__spreadArray", __spreadArray); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); + exporter("__classPrivateFieldGet", __classPrivateFieldGet); + exporter("__classPrivateFieldSet", __classPrivateFieldSet); + exporter("__classPrivateFieldIn", __classPrivateFieldIn); + exporter("__addDisposableResource", __addDisposableResource); + exporter("__disposeResources", __disposeResources); +}); - // 3. If connection is not an HTTP/2 connection, request’s body is non-null, - // and request’s body’s source is null, then append (`Transfer-Encoding`, - // `chunked`) to request’s header list. - // 4. Set timingInfo’s final network-request start time to the coarsened - // shared current time given fetchParams’s cross-origin isolated - // capability. +/***/ }), - // 5. Set response to the result of making an HTTP request over connection - // using request with the following caveats: +/***/ 12469: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS] - // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH] +module.exports = __nccwpck_require__(13713); - // - If request’s body is non-null, and request’s body’s source is null, - // then the user agent may have a buffer of up to 64 kibibytes and store - // a part of request’s body in that buffer. If the user agent reads from - // request’s body beyond that buffer’s size and the user agent needs to - // resend request, then instead return a network error. - // - Set timingInfo’s final network-response start time to the coarsened - // shared current time given fetchParams’s cross-origin isolated capability, - // immediately after the user agent’s HTTP parser receives the first byte - // of the response (e.g., frame header bytes for HTTP/2 or response status - // line for HTTP/1.x). +/***/ }), - // - Wait until all the headers are transmitted. +/***/ 13713: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // - Any responses whose status is in the range 100 to 199, inclusive, - // and is not 101, are to be ignored, except for the purposes of setting - // timingInfo’s final network-response start time above. - // - If request’s header list contains `Transfer-Encoding`/`chunked` and - // response is transferred via HTTP/1.0 or older, then return a network - // error. - // - If the HTTP request results in a TLS client certificate dialog, then: +var net = __nccwpck_require__(41808); +var tls = __nccwpck_require__(24404); +var http = __nccwpck_require__(13685); +var https = __nccwpck_require__(95687); +var events = __nccwpck_require__(82361); +var assert = __nccwpck_require__(39491); +var util = __nccwpck_require__(73837); - // 1. If request’s window is an environment settings object, make the - // dialog available in request’s window. - // 2. Otherwise, return a network error. +exports.httpOverHttp = httpOverHttp; +exports.httpsOverHttp = httpsOverHttp; +exports.httpOverHttps = httpOverHttps; +exports.httpsOverHttps = httpsOverHttps; - // To transmit request’s body body, run these steps: - let requestBody = null - // 1. If body is null and fetchParams’s process request end-of-body is - // non-null, then queue a fetch task given fetchParams’s process request - // end-of-body and fetchParams’s task destination. - if (request.body == null && fetchParams.processRequestEndOfBody) { - queueMicrotask(() => fetchParams.processRequestEndOfBody()) - } else if (request.body != null) { - // 2. Otherwise, if body is non-null: - // 1. Let processBodyChunk given bytes be these steps: - const processBodyChunk = async function * (bytes) { - // 1. If the ongoing fetch is terminated, then abort these steps. - if (isCancelled(fetchParams)) { - return - } +function httpOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + return agent; +} - // 2. Run this step in parallel: transmit bytes. - yield bytes +function httpsOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; +} - // 3. If fetchParams’s process request body is non-null, then run - // fetchParams’s process request body given bytes’s length. - fetchParams.processRequestBodyChunkLength?.(bytes.byteLength) - } +function httpOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + return agent; +} - // 2. Let processEndOfBody be these steps: - const processEndOfBody = () => { - // 1. If fetchParams is canceled, then abort these steps. - if (isCancelled(fetchParams)) { - return - } +function httpsOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; +} - // 2. If fetchParams’s process request end-of-body is non-null, - // then run fetchParams’s process request end-of-body. - if (fetchParams.processRequestEndOfBody) { - fetchParams.processRequestEndOfBody() - } - } - // 3. Let processBodyError given e be these steps: - const processBodyError = (e) => { - // 1. If fetchParams is canceled, then abort these steps. - if (isCancelled(fetchParams)) { - return - } +function TunnelingAgent(options) { + var self = this; + self.options = options || {}; + self.proxyOptions = self.options.proxy || {}; + self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets; + self.requests = []; + self.sockets = []; - // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller. - if (e.name === 'AbortError') { - fetchParams.controller.abort() - } else { - fetchParams.controller.terminate(e) + self.on('free', function onFree(socket, host, port, localAddress) { + var options = toOptions(host, port, localAddress); + for (var i = 0, len = self.requests.length; i < len; ++i) { + var pending = self.requests[i]; + if (pending.host === options.host && pending.port === options.port) { + // Detect the request to connect same origin server, + // reuse the connection. + self.requests.splice(i, 1); + pending.request.onSocket(socket); + return; } } + socket.destroy(); + self.removeSocket(socket); + }); +} +util.inherits(TunnelingAgent, events.EventEmitter); - // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody, - // processBodyError, and fetchParams’s task destination. - requestBody = (async function * () { - try { - for await (const bytes of request.body.stream) { - yield * processBodyChunk(bytes) - } - processEndOfBody() - } catch (err) { - processBodyError(err) - } - })() - } +TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { + var self = this; + var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress)); - try { - // socket is only provided for websockets - const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody }) + if (self.sockets.length >= this.maxSockets) { + // We are over limit so we'll add it to the queue. + self.requests.push(options); + return; + } - if (socket) { - response = makeResponse({ status, statusText, headersList, socket }) - } else { - const iterator = body[Symbol.asyncIterator]() - fetchParams.controller.next = () => iterator.next() + // If we are under maxSockets create a new one. + self.createSocket(options, function(socket) { + socket.on('free', onFree); + socket.on('close', onCloseOrRemove); + socket.on('agentRemove', onCloseOrRemove); + req.onSocket(socket); - response = makeResponse({ status, statusText, headersList }) + function onFree() { + self.emit('free', socket, options); } - } catch (err) { - // 10. If aborted, then: - if (err.name === 'AbortError') { - // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame. - fetchParams.controller.connection.destroy() - // 2. Return the appropriate network error for fetchParams. - return makeAppropriateNetworkError(fetchParams, err) + function onCloseOrRemove(err) { + self.removeSocket(socket); + socket.removeListener('free', onFree); + socket.removeListener('close', onCloseOrRemove); + socket.removeListener('agentRemove', onCloseOrRemove); } + }); +}; - return makeNetworkError(err) - } +TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { + var self = this; + var placeholder = {}; + self.sockets.push(placeholder); - // 11. Let pullAlgorithm be an action that resumes the ongoing fetch - // if it is suspended. - const pullAlgorithm = () => { - fetchParams.controller.resume() + var connectOptions = mergeOptions({}, self.proxyOptions, { + method: 'CONNECT', + path: options.host + ':' + options.port, + agent: false, + headers: { + host: options.host + ':' + options.port + } + }); + if (options.localAddress) { + connectOptions.localAddress = options.localAddress; } - - // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s - // controller with reason, given reason. - const cancelAlgorithm = (reason) => { - fetchParams.controller.abort(reason) + if (connectOptions.proxyAuth) { + connectOptions.headers = connectOptions.headers || {}; + connectOptions.headers['Proxy-Authorization'] = 'Basic ' + + new Buffer(connectOptions.proxyAuth).toString('base64'); } - // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by - // the user agent. - // TODO - - // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object - // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent. - // TODO + debug('making CONNECT request'); + var connectReq = self.request(connectOptions); + connectReq.useChunkedEncodingByDefault = false; // for v0.6 + connectReq.once('response', onResponse); // for v0.6 + connectReq.once('upgrade', onUpgrade); // for v0.6 + connectReq.once('connect', onConnect); // for v0.7 or later + connectReq.once('error', onError); + connectReq.end(); - // 15. Let stream be a new ReadableStream. - // 16. Set up stream with pullAlgorithm set to pullAlgorithm, - // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to - // highWaterMark, and sizeAlgorithm set to sizeAlgorithm. - if (!ReadableStream) { - ReadableStream = (__nccwpck_require__(35356).ReadableStream) + function onResponse(res) { + // Very hacky. This is necessary to avoid http-parser leaks. + res.upgrade = true; } - const stream = new ReadableStream( - { - async start (controller) { - fetchParams.controller.controller = controller - }, - async pull (controller) { - await pullAlgorithm(controller) - }, - async cancel (reason) { - await cancelAlgorithm(reason) - } - }, - { - highWaterMark: 0, - size () { - return 1 - } - } - ) + function onUpgrade(res, socket, head) { + // Hacky. + process.nextTick(function() { + onConnect(res, socket, head); + }); + } - // 17. Run these steps, but abort when the ongoing fetch is terminated: + function onConnect(res, socket, head) { + connectReq.removeAllListeners(); + socket.removeAllListeners(); - // 1. Set response’s body to a new body whose stream is stream. - response.body = { stream } + if (res.statusCode !== 200) { + debug('tunneling socket could not be established, statusCode=%d', + res.statusCode); + socket.destroy(); + var error = new Error('tunneling socket could not be established, ' + + 'statusCode=' + res.statusCode); + error.code = 'ECONNRESET'; + options.request.emit('error', error); + self.removeSocket(placeholder); + return; + } + if (head.length > 0) { + debug('got illegal response body from proxy'); + socket.destroy(); + var error = new Error('got illegal response body from proxy'); + error.code = 'ECONNRESET'; + options.request.emit('error', error); + self.removeSocket(placeholder); + return; + } + debug('tunneling connection has established'); + self.sockets[self.sockets.indexOf(placeholder)] = socket; + return cb(socket); + } - // 2. If response is not a network error and request’s cache mode is - // not "no-store", then update response in httpCache for request. - // TODO + function onError(cause) { + connectReq.removeAllListeners(); - // 3. If includeCredentials is true and the user agent is not configured - // to block cookies for request (see section 7 of [COOKIES]), then run the - // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on - // the value of each header whose name is a byte-case-insensitive match for - // `Set-Cookie` in response’s header list, if any, and request’s current URL. - // TODO + debug('tunneling socket could not be established, cause=%s\n', + cause.message, cause.stack); + var error = new Error('tunneling socket could not be established, ' + + 'cause=' + cause.message); + error.code = 'ECONNRESET'; + options.request.emit('error', error); + self.removeSocket(placeholder); + } +}; - // 18. If aborted, then: - // TODO +TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { + var pos = this.sockets.indexOf(socket) + if (pos === -1) { + return; + } + this.sockets.splice(pos, 1); - // 19. Run these steps in parallel: + var pending = this.requests.shift(); + if (pending) { + // If we have pending requests and a socket gets closed a new one + // needs to be created to take over in the pool for the one that closed. + this.createSocket(pending, function(socket) { + pending.request.onSocket(socket); + }); + } +}; - // 1. Run these steps, but abort when fetchParams is canceled: - fetchParams.controller.on('terminated', onAborted) - fetchParams.controller.resume = async () => { - // 1. While true - while (true) { - // 1-3. See onData... +function createSecureSocket(options, cb) { + var self = this; + TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { + var hostHeader = options.request.getHeader('host'); + var tlsOptions = mergeOptions({}, self.options, { + socket: socket, + servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host + }); - // 4. Set bytes to the result of handling content codings given - // codings and bytes. - let bytes - let isFailure - try { - const { done, value } = await fetchParams.controller.next() + // 0 is dummy port for v0.6 + var secureSocket = tls.connect(0, tlsOptions); + self.sockets[self.sockets.indexOf(socket)] = secureSocket; + cb(secureSocket); + }); +} - if (isAborted(fetchParams)) { - break - } - bytes = done ? undefined : value - } catch (err) { - if (fetchParams.controller.ended && !timingInfo.encodedBodySize) { - // zlib doesn't like empty streams. - bytes = undefined - } else { - bytes = err +function toOptions(host, port, localAddress) { + if (typeof host === 'string') { // since v0.10 + return { + host: host, + port: port, + localAddress: localAddress + }; + } + return host; // for v0.11 or later +} - // err may be propagated from the result of calling readablestream.cancel, - // which might not be an error. https://github.com/nodejs/undici/issues/2009 - isFailure = true +function mergeOptions(target) { + for (var i = 1, len = arguments.length; i < len; ++i) { + var overrides = arguments[i]; + if (typeof overrides === 'object') { + var keys = Object.keys(overrides); + for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { + var k = keys[j]; + if (overrides[k] !== undefined) { + target[k] = overrides[k]; } } - - if (bytes === undefined) { - // 2. Otherwise, if the bytes transmission for response’s message - // body is done normally and stream is readable, then close - // stream, finalize response for fetchParams and response, and - // abort these in-parallel steps. - readableStreamClose(fetchParams.controller.controller) - - finalizeResponse(fetchParams, response) - - return - } - - // 5. Increase timingInfo’s decoded body size by bytes’s length. - timingInfo.decodedBodySize += bytes?.byteLength ?? 0 - - // 6. If bytes is failure, then terminate fetchParams’s controller. - if (isFailure) { - fetchParams.controller.terminate(bytes) - return - } - - // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes - // into stream. - fetchParams.controller.controller.enqueue(new Uint8Array(bytes)) - - // 8. If stream is errored, then terminate the ongoing fetch. - if (isErrored(stream)) { - fetchParams.controller.terminate() - return - } - - // 9. If stream doesn’t need more data ask the user agent to suspend - // the ongoing fetch. - if (!fetchParams.controller.controller.desiredSize) { - return - } } } + return target; +} - // 2. If aborted, then: - function onAborted (reason) { - // 2. If fetchParams is aborted, then: - if (isAborted(fetchParams)) { - // 1. Set response’s aborted flag. - response.aborted = true - // 2. If stream is readable, then error stream with the result of - // deserialize a serialized abort reason given fetchParams’s - // controller’s serialized abort reason and an - // implementation-defined realm. - if (isReadable(stream)) { - fetchParams.controller.controller.error( - fetchParams.controller.serializedAbortReason - ) - } +var debug; +if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { + debug = function() { + var args = Array.prototype.slice.call(arguments); + if (typeof args[0] === 'string') { + args[0] = 'TUNNEL: ' + args[0]; } else { - // 3. Otherwise, if stream is readable, error stream with a TypeError. - if (isReadable(stream)) { - fetchParams.controller.controller.error(new TypeError('terminated', { - cause: isErrorLike(reason) ? reason : undefined - })) - } + args.unshift('TUNNEL:'); } - - // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame. - // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so. - fetchParams.controller.connection.destroy() + console.error.apply(console, args); } +} else { + debug = function() {}; +} +exports.debug = debug; // for test - // 20. Return response. - return response - - async function dispatch ({ body }) { - const url = requestCurrentURL(request) - /** @type {import('../..').Agent} */ - const agent = fetchParams.controller.dispatcher - - return new Promise((resolve, reject) => agent.dispatch( - { - path: url.pathname + url.search, - origin: url.origin, - method: request.method, - body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body, - headers: request.headersList.entries, - maxRedirections: 0, - upgrade: request.mode === 'websocket' ? 'websocket' : undefined - }, - { - body: null, - abort: null, - - onConnect (abort) { - // TODO (fix): Do we need connection here? - const { connection } = fetchParams.controller - - if (connection.destroyed) { - abort(new DOMException('The operation was aborted.', 'AbortError')) - } else { - fetchParams.controller.on('terminated', abort) - this.abort = connection.abort = abort - } - }, - - onHeaders (status, headersList, resume, statusText) { - if (status < 200) { - return - } - let codings = [] - let location = '' +/***/ }), - const headers = new Headers() +/***/ 85991: +/***/ ((__unused_webpack_module, exports) => { - // For H2, the headers are a plain JS object - // We distinguish between them and iterate accordingly - if (Array.isArray(headersList)) { - for (let n = 0; n < headersList.length; n += 2) { - const key = headersList[n + 0].toString('latin1') - const val = headersList[n + 1].toString('latin1') - if (key.toLowerCase() === 'content-encoding') { - // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1 - // "All content-coding values are case-insensitive..." - codings = val.toLowerCase().split(',').map((x) => x.trim()) - } else if (key.toLowerCase() === 'location') { - location = val - } - headers[kHeadersList].append(key, val) - } - } else { - const keys = Object.keys(headersList) - for (const key of keys) { - const val = headersList[key] - if (key.toLowerCase() === 'content-encoding') { - // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1 - // "All content-coding values are case-insensitive..." - codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse() - } else if (key.toLowerCase() === 'location') { - location = val - } - headers[kHeadersList].append(key, val) - } - } +Object.defineProperty(exports, "__esModule", ({ value: true })); - this.body = new Readable({ read: resume }) +function concat(arrays, length) { + if (!length) { + length = arrays.reduce((acc, curr) => acc + curr.length, 0); + } + const output = new Uint8Array(length); + let offset = 0; + for (const arr of arrays) { + output.set(arr, offset); + offset += arr.length; + } + return output; +} - const decoders = [] +exports.concat = concat; - const willFollow = request.redirect === 'follow' && - location && - redirectStatusSet.has(status) - // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding - if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) { - for (const coding of codings) { - // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2 - if (coding === 'x-gzip' || coding === 'gzip') { - decoders.push(zlib.createGunzip({ - // Be less strict when decoding compressed responses, since sometimes - // servers send slightly invalid responses that are still accepted - // by common browsers. - // Always using Z_SYNC_FLUSH is what cURL does. - flush: zlib.constants.Z_SYNC_FLUSH, - finishFlush: zlib.constants.Z_SYNC_FLUSH - })) - } else if (coding === 'deflate') { - decoders.push(zlib.createInflate()) - } else if (coding === 'br') { - decoders.push(zlib.createBrotliDecompress()) - } else { - decoders.length = 0 - break - } - } - } +/***/ }), - resolve({ - status, - statusText, - headersList: headers[kHeadersList], - body: decoders.length - ? pipeline(this.body, ...decoders, () => { }) - : this.body.on('error', () => {}) - }) +/***/ 13872: +/***/ ((__unused_webpack_module, exports) => { - return true - }, - onData (chunk) { - if (fetchParams.controller.dump) { - return - } - // 1. If one or more bytes have been transmitted from response’s - // message body, then: +Object.defineProperty(exports, "__esModule", ({ value: true })); - // 1. Let bytes be the transmitted bytes. - const bytes = chunk +function equals(a, b) { + if (a === b) { + return true; + } + if (a.byteLength !== b.byteLength) { + return false; + } + for (let i = 0; i < a.byteLength; i++) { + if (a[i] !== b[i]) { + return false; + } + } + return true; +} - // 2. Let codings be the result of extracting header list values - // given `Content-Encoding` and response’s header list. - // See pullAlgorithm. +exports.equals = equals; - // 3. Increase timingInfo’s encoded body size by bytes’s length. - timingInfo.encodedBodySize += bytes.byteLength - // 4. See pullAlgorithm... +/***/ }), - return this.body.push(bytes) - }, +/***/ 7433: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - onComplete () { - if (this.abort) { - fetchParams.controller.off('terminated', this.abort) - } - fetchParams.controller.ended = true - this.body.push(null) - }, +Object.defineProperty(exports, "__esModule", ({ value: true })); - onError (error) { - if (this.abort) { - fetchParams.controller.off('terminated', this.abort) - } +var bases = __nccwpck_require__(24053); - this.body?.destroy(error) +function fromString(string, encoding = 'utf8') { + const base = bases[encoding]; + if (!base) { + throw new Error(`Unsupported encoding "${ encoding }"`); + } + return base.decoder.decode(`${ base.prefix }${ string }`); +} - fetchParams.controller.terminate(error) +exports.fromString = fromString; - reject(error) - }, - onUpgrade (status, headersList, socket) { - if (status !== 101) { - return - } +/***/ }), - const headers = new Headers() +/***/ 43840: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - for (let n = 0; n < headersList.length; n += 2) { - const key = headersList[n + 0].toString('latin1') - const val = headersList[n + 1].toString('latin1') - headers[kHeadersList].append(key, val) - } - resolve({ - status, - statusText: STATUS_CODES[status], - headersList: headers[kHeadersList], - socket - }) +Object.defineProperty(exports, "__esModule", ({ value: true })); - return true - } - } - )) +var bases = __nccwpck_require__(24053); + +function toString(array, encoding = 'utf8') { + const base = bases[encoding]; + if (!base) { + throw new Error(`Unsupported encoding "${ encoding }"`); } + return base.encoder.encode(array).substring(1); } -module.exports = { - fetch, - Fetch, - fetching, - finalizeAndReportTiming -} +exports.toString = toString; /***/ }), -/***/ 7288: +/***/ 24053: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/* globals AbortController */ +var basics = __nccwpck_require__(41019); -const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(62494) -const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(23245) -const { FinalizationRegistry } = __nccwpck_require__(71744)() -const util = __nccwpck_require__(67468) -const { - isValidHTTPToken, - sameOrigin, - normalizeMethod, - makePolicyContainer, - normalizeMethodRecord -} = __nccwpck_require__(79453) -const { - forbiddenMethodsSet, - corsSafeListedMethodsSet, - referrerPolicy, - requestRedirect, - requestMode, - requestCredentials, - requestCache, - requestDuplex -} = __nccwpck_require__(93541) -const { kEnumerableProperty } = util -const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(46938) -const { webidl } = __nccwpck_require__(96138) -const { getGlobalOrigin } = __nccwpck_require__(64110) -const { URLSerializer } = __nccwpck_require__(50096) -const { kHeadersList, kConstruct } = __nccwpck_require__(48039) -const assert = __nccwpck_require__(39491) -const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(82361) +function createCodec(name, prefix, encode, decode) { + return { + name, + prefix, + encoder: { + name, + prefix, + encode + }, + decoder: { decode } + }; +} +const string = createCodec('utf8', 'u', buf => { + const decoder = new TextDecoder('utf8'); + return 'u' + decoder.decode(buf); +}, str => { + const encoder = new TextEncoder(); + return encoder.encode(str.substring(1)); +}); +const ascii = createCodec('ascii', 'a', buf => { + let string = 'a'; + for (let i = 0; i < buf.length; i++) { + string += String.fromCharCode(buf[i]); + } + return string; +}, str => { + str = str.substring(1); + const buf = new Uint8Array(str.length); + 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 +}; -let TransformStream = globalThis.TransformStream +module.exports = BASES; -const kAbortController = Symbol('abortController') -const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { - signal.removeEventListener('abort', abort) -}) +/***/ }), -// https://fetch.spec.whatwg.org/#request-class -class Request { - // https://fetch.spec.whatwg.org/#dom-request - constructor (input, init = {}) { - if (input === kConstruct) { - return - } +/***/ 20394: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' }) - input = webidl.converters.RequestInfo(input) - init = webidl.converters.RequestInit(init) - // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object - this[kRealm] = { - settingsObject: { - baseUrl: getGlobalOrigin(), - get origin () { - return this.baseUrl?.origin - }, - policyContainer: makePolicyContainer() - } - } +const Client = __nccwpck_require__(41421) +const Dispatcher = __nccwpck_require__(13624) +const errors = __nccwpck_require__(70867) +const Pool = __nccwpck_require__(59310) +const BalancedPool = __nccwpck_require__(53477) +const Agent = __nccwpck_require__(83272) +const util = __nccwpck_require__(43061) +const { InvalidArgumentError } = errors +const api = __nccwpck_require__(3617) +const buildConnector = __nccwpck_require__(46183) +const MockClient = __nccwpck_require__(43851) +const MockAgent = __nccwpck_require__(36351) +const MockPool = __nccwpck_require__(34448) +const mockErrors = __nccwpck_require__(28560) +const ProxyAgent = __nccwpck_require__(46118) +const RetryHandler = __nccwpck_require__(4448) +const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(94330) +const DecoratorHandler = __nccwpck_require__(25817) +const RedirectHandler = __nccwpck_require__(10411) +const createRedirectInterceptor = __nccwpck_require__(8734) - // 1. Let request be null. - let request = null +let hasCrypto +try { + __nccwpck_require__(6113) + hasCrypto = true +} catch { + hasCrypto = false +} - // 2. Let fallbackMode be null. - let fallbackMode = null +Object.assign(Dispatcher.prototype, api) - // 3. Let baseURL be this’s relevant settings object’s API base URL. - const baseUrl = this[kRealm].settingsObject.baseUrl +module.exports.Dispatcher = Dispatcher +module.exports.Client = Client +module.exports.Pool = Pool +module.exports.BalancedPool = BalancedPool +module.exports.Agent = Agent +module.exports.ProxyAgent = ProxyAgent +module.exports.RetryHandler = RetryHandler - // 4. Let signal be null. - let signal = null +module.exports.DecoratorHandler = DecoratorHandler +module.exports.RedirectHandler = RedirectHandler +module.exports.createRedirectInterceptor = createRedirectInterceptor - // 5. If input is a string, then: - if (typeof input === 'string') { - // 1. Let parsedURL be the result of parsing input with baseURL. - // 2. If parsedURL is failure, then throw a TypeError. - let parsedURL - try { - parsedURL = new URL(input, baseUrl) - } catch (err) { - throw new TypeError('Failed to parse URL from ' + input, { cause: err }) - } +module.exports.buildConnector = buildConnector +module.exports.errors = errors - // 3. If parsedURL includes credentials, then throw a TypeError. - if (parsedURL.username || parsedURL.password) { - throw new TypeError( - 'Request cannot be constructed from a URL that includes credentials: ' + - input - ) +function makeDispatcher (fn) { + return (url, opts, handler) => { + if (typeof opts === 'function') { + handler = opts + opts = null + } + + if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) { + throw new InvalidArgumentError('invalid url') + } + + if (opts != null && typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + if (opts && opts.path != null) { + if (typeof opts.path !== 'string') { + throw new InvalidArgumentError('invalid opts.path') } - // 4. Set request to a new request whose URL is parsedURL. - request = makeRequest({ urlList: [parsedURL] }) + let path = opts.path + if (!opts.path.startsWith('/')) { + path = `/${path}` + } - // 5. Set fallbackMode to "cors". - fallbackMode = 'cors' + url = new URL(util.parseOrigin(url).origin + path) } else { - // 6. Otherwise: + if (!opts) { + opts = typeof url === 'object' ? url : {} + } - // 7. Assert: input is a Request object. - assert(input instanceof Request) + url = util.parseURL(url) + } - // 8. Set request to input’s request. - request = input[kState] + const { agent, dispatcher = getGlobalDispatcher() } = opts - // 9. Set signal to input’s signal. - signal = input[kSignal] + if (agent) { + throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?') } - // 7. Let origin be this’s relevant settings object’s origin. - const origin = this[kRealm].settingsObject.origin + return fn.call(dispatcher, { + ...opts, + origin: url.origin, + path: url.search ? `${url.pathname}${url.search}` : url.pathname, + method: opts.method || (opts.body ? 'PUT' : 'GET') + }, handler) + } +} - // 8. Let window be "client". - let window = 'client' +module.exports.setGlobalDispatcher = setGlobalDispatcher +module.exports.getGlobalDispatcher = getGlobalDispatcher - // 9. If request’s window is an environment settings object and its origin - // is same origin with origin, then set window to request’s window. - if ( - request.window?.constructor?.name === 'EnvironmentSettingsObject' && - sameOrigin(request.window, origin) - ) { - window = request.window +if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) { + let fetchImpl = null + module.exports.fetch = async function fetch (resource) { + if (!fetchImpl) { + fetchImpl = (__nccwpck_require__(37215).fetch) } - // 10. If init["window"] exists and is non-null, then throw a TypeError. - if (init.window != null) { - throw new TypeError(`'window' option '${window}' must be null`) - } + try { + return await fetchImpl(...arguments) + } catch (err) { + if (typeof err === 'object') { + Error.captureStackTrace(err, this) + } - // 11. If init["window"] exists, then set window to "no-window". - if ('window' in init) { - window = 'no-window' + throw err } + } + module.exports.Headers = __nccwpck_require__(13915).Headers + module.exports.Response = __nccwpck_require__(40599).Response + module.exports.Request = __nccwpck_require__(20366).Request + module.exports.FormData = __nccwpck_require__(12787).FormData + module.exports.File = __nccwpck_require__(99698).File + module.exports.FileReader = __nccwpck_require__(99701).FileReader - // 12. Set request to a new request with the following properties: - request = makeRequest({ - // URL request’s URL. - // undici implementation note: this is set as the first item in request's urlList in makeRequest - // method request’s method. - method: request.method, - // header list A copy of request’s header list. - // undici implementation note: headersList is cloned in makeRequest - headersList: request.headersList, - // unsafe-request flag Set. - unsafeRequest: request.unsafeRequest, - // client This’s relevant settings object. - client: this[kRealm].settingsObject, - // window window. - window, - // priority request’s priority. - priority: request.priority, - // origin request’s origin. The propagation of the origin is only significant for navigation requests - // being handled by a service worker. In this scenario a request can have an origin that is different - // from the current client. - origin: request.origin, - // referrer request’s referrer. - referrer: request.referrer, - // referrer policy request’s referrer policy. - referrerPolicy: request.referrerPolicy, - // mode request’s mode. - mode: request.mode, - // credentials mode request’s credentials mode. - credentials: request.credentials, - // cache mode request’s cache mode. - cache: request.cache, - // redirect mode request’s redirect mode. - redirect: request.redirect, - // integrity metadata request’s integrity metadata. - integrity: request.integrity, - // keepalive request’s keepalive. - keepalive: request.keepalive, - // reload-navigation flag request’s reload-navigation flag. - reloadNavigation: request.reloadNavigation, - // history-navigation flag request’s history-navigation flag. - historyNavigation: request.historyNavigation, - // URL list A clone of request’s URL list. - urlList: [...request.urlList] - }) + const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(48582) - const initHasKey = Object.keys(init).length !== 0 + module.exports.setGlobalOrigin = setGlobalOrigin + module.exports.getGlobalOrigin = getGlobalOrigin - // 13. If init is not empty, then: - if (initHasKey) { - // 1. If request’s mode is "navigate", then set it to "same-origin". - if (request.mode === 'navigate') { - request.mode = 'same-origin' - } + const { CacheStorage } = __nccwpck_require__(38540) + const { kConstruct } = __nccwpck_require__(99483) - // 2. Unset request’s reload-navigation flag. - request.reloadNavigation = false + // Cache & CacheStorage are tightly coupled with fetch. Even if it may run + // in an older version of Node, it doesn't have any use without fetch. + module.exports.caches = new CacheStorage(kConstruct) +} - // 3. Unset request’s history-navigation flag. - request.historyNavigation = false +if (util.nodeMajor >= 16) { + const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(8914) - // 4. Set request’s origin to "client". - request.origin = 'client' + module.exports.deleteCookie = deleteCookie + module.exports.getCookies = getCookies + module.exports.getSetCookies = getSetCookies + module.exports.setCookie = setCookie - // 5. Set request’s referrer to "client" - request.referrer = 'client' + const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(16306) - // 6. Set request’s referrer policy to the empty string. - request.referrerPolicy = '' + module.exports.parseMIMEType = parseMIMEType + module.exports.serializeAMimeType = serializeAMimeType +} - // 7. Set request’s URL to request’s current URL. - request.url = request.urlList[request.urlList.length - 1] +if (util.nodeMajor >= 18 && hasCrypto) { + const { WebSocket } = __nccwpck_require__(59724) - // 8. Set request’s URL list to « request’s URL ». - request.urlList = [request.url] - } + module.exports.WebSocket = WebSocket +} - // 14. If init["referrer"] exists, then: - if (init.referrer !== undefined) { - // 1. Let referrer be init["referrer"]. - const referrer = init.referrer +module.exports.request = makeDispatcher(api.request) +module.exports.stream = makeDispatcher(api.stream) +module.exports.pipeline = makeDispatcher(api.pipeline) +module.exports.connect = makeDispatcher(api.connect) +module.exports.upgrade = makeDispatcher(api.upgrade) - // 2. If referrer is the empty string, then set request’s referrer to "no-referrer". - if (referrer === '') { - request.referrer = 'no-referrer' - } else { - // 1. Let parsedReferrer be the result of parsing referrer with - // baseURL. - // 2. If parsedReferrer is failure, then throw a TypeError. - let parsedReferrer - try { - parsedReferrer = new URL(referrer, baseUrl) - } catch (err) { - throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err }) - } +module.exports.MockClient = MockClient +module.exports.MockPool = MockPool +module.exports.MockAgent = MockAgent +module.exports.mockErrors = mockErrors - // 3. If one of the following is true - // - parsedReferrer’s scheme is "about" and path is the string "client" - // - parsedReferrer’s origin is not same origin with origin - // then set request’s referrer to "client". - if ( - (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') || - (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl)) - ) { - request.referrer = 'client' - } else { - // 4. Otherwise, set request’s referrer to parsedReferrer. - request.referrer = parsedReferrer - } - } - } - // 15. If init["referrerPolicy"] exists, then set request’s referrer policy - // to it. - if (init.referrerPolicy !== undefined) { - request.referrerPolicy = init.referrerPolicy - } +/***/ }), - // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise. - let mode - if (init.mode !== undefined) { - mode = init.mode - } else { - mode = fallbackMode - } +/***/ 83272: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // 17. If mode is "navigate", then throw a TypeError. - if (mode === 'navigate') { - throw webidl.errors.exception({ - header: 'Request constructor', - message: 'invalid request mode navigate.' - }) - } - // 18. If mode is non-null, set request’s mode to mode. - if (mode != null) { - request.mode = mode - } - // 19. If init["credentials"] exists, then set request’s credentials mode - // to it. - if (init.credentials !== undefined) { - request.credentials = init.credentials - } +const { InvalidArgumentError } = __nccwpck_require__(70867) +const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(69898) +const DispatcherBase = __nccwpck_require__(33090) +const Pool = __nccwpck_require__(59310) +const Client = __nccwpck_require__(41421) +const util = __nccwpck_require__(43061) +const createRedirectInterceptor = __nccwpck_require__(8734) +const { WeakRef, FinalizationRegistry } = __nccwpck_require__(49694)() - // 18. If init["cache"] exists, then set request’s cache mode to it. - if (init.cache !== undefined) { - request.cache = init.cache - } +const kOnConnect = Symbol('onConnect') +const kOnDisconnect = Symbol('onDisconnect') +const kOnConnectionError = Symbol('onConnectionError') +const kMaxRedirections = Symbol('maxRedirections') +const kOnDrain = Symbol('onDrain') +const kFactory = Symbol('factory') +const kFinalizer = Symbol('finalizer') +const kOptions = Symbol('options') - // 21. If request’s cache mode is "only-if-cached" and request’s mode is - // not "same-origin", then throw a TypeError. - if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') { - throw new TypeError( - "'only-if-cached' can be set only with 'same-origin' mode" - ) - } +function defaultFactory (origin, opts) { + return opts && opts.connections === 1 + ? new Client(origin, opts) + : new Pool(origin, opts) +} - // 22. If init["redirect"] exists, then set request’s redirect mode to it. - if (init.redirect !== undefined) { - request.redirect = init.redirect +class Agent extends DispatcherBase { + constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { + super() + + if (typeof factory !== 'function') { + throw new InvalidArgumentError('factory must be a function.') } - // 23. If init["integrity"] exists, then set request’s integrity metadata to it. - if (init.integrity != null) { - request.integrity = String(init.integrity) + if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { + throw new InvalidArgumentError('connect must be a function or an object') } - // 24. If init["keepalive"] exists, then set request’s keepalive to it. - if (init.keepalive !== undefined) { - request.keepalive = Boolean(init.keepalive) + if (!Number.isInteger(maxRedirections) || maxRedirections < 0) { + throw new InvalidArgumentError('maxRedirections must be a positive number') } - // 25. If init["method"] exists, then: - if (init.method !== undefined) { - // 1. Let method be init["method"]. - let method = init.method + if (connect && typeof connect !== 'function') { + connect = { ...connect } + } - // 2. If method is not a method or method is a forbidden method, then - // throw a TypeError. - if (!isValidHTTPToken(method)) { - throw new TypeError(`'${method}' is not a valid HTTP method.`) - } + this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent) + ? options.interceptors.Agent + : [createRedirectInterceptor({ maxRedirections })] - if (forbiddenMethodsSet.has(method.toUpperCase())) { - throw new TypeError(`'${method}' HTTP method is unsupported.`) + this[kOptions] = { ...util.deepClone(options), connect } + this[kOptions].interceptors = options.interceptors + ? { ...options.interceptors } + : undefined + this[kMaxRedirections] = maxRedirections + this[kFactory] = factory + this[kClients] = new Map() + this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => { + const ref = this[kClients].get(key) + if (ref !== undefined && ref.deref() === undefined) { + this[kClients].delete(key) } + }) - // 3. Normalize method. - method = normalizeMethodRecord[method] ?? normalizeMethod(method) + const agent = this - // 4. Set request’s method to method. - request.method = method + this[kOnDrain] = (origin, targets) => { + agent.emit('drain', origin, [agent, ...targets]) } - // 26. If init["signal"] exists, then set signal to it. - if (init.signal !== undefined) { - signal = init.signal + this[kOnConnect] = (origin, targets) => { + agent.emit('connect', origin, [agent, ...targets]) } - // 27. Set this’s request to request. - this[kState] = request + this[kOnDisconnect] = (origin, targets, err) => { + agent.emit('disconnect', origin, [agent, ...targets], err) + } - // 28. Set this’s signal to a new AbortSignal object with this’s relevant - // Realm. - // TODO: could this be simplified with AbortSignal.any - // (https://dom.spec.whatwg.org/#dom-abortsignal-any) - const ac = new AbortController() - this[kSignal] = ac.signal - this[kSignal][kRealm] = this[kRealm] + this[kOnConnectionError] = (origin, targets, err) => { + agent.emit('connectionError', origin, [agent, ...targets], err) + } + } - // 29. If signal is not null, then make this’s signal follow signal. - if (signal != null) { - if ( - !signal || - typeof signal.aborted !== 'boolean' || - typeof signal.addEventListener !== 'function' - ) { - throw new TypeError( - "Failed to construct 'Request': member signal is not of type AbortSignal." - ) + get [kRunning] () { + let ret = 0 + for (const ref of this[kClients].values()) { + const client = ref.deref() + /* istanbul ignore next: gc is undeterministic */ + if (client) { + ret += client[kRunning] } + } + return ret + } - if (signal.aborted) { - ac.abort(signal.reason) - } else { - // Keep a strong ref to ac while request object - // is alive. This is needed to prevent AbortController - // from being prematurely garbage collected. - // See, https://github.com/nodejs/undici/issues/1926. - this[kAbortController] = ac - - const acRef = new WeakRef(ac) - const abort = function () { - const ac = acRef.deref() - if (ac !== undefined) { - ac.abort(this.reason) - } - } - - // Third-party AbortControllers may not work with these. - // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619. - try { - // If the max amount of listeners is equal to the default, increase it - // This is only available in node >= v19.9.0 - if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) { - setMaxListeners(100, signal) - } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) { - setMaxListeners(100, signal) - } - } catch {} - - util.addAbortListener(signal, abort) - requestFinalizer.register(ac, { signal, abort }) - } + [kDispatch] (opts, handler) { + let key + if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) { + key = String(opts.origin) + } else { + throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.') } - // 30. Set this’s headers to a new Headers object with this’s relevant - // Realm, whose header list is request’s header list and guard is - // "request". - this[kHeaders] = new Headers(kConstruct) - this[kHeaders][kHeadersList] = request.headersList - this[kHeaders][kGuard] = 'request' - this[kHeaders][kRealm] = this[kRealm] + const ref = this[kClients].get(key) - // 31. If this’s request’s mode is "no-cors", then: - if (mode === 'no-cors') { - // 1. If this’s request’s method is not a CORS-safelisted method, - // then throw a TypeError. - if (!corsSafeListedMethodsSet.has(request.method)) { - throw new TypeError( - `'${request.method} is unsupported in no-cors mode.` - ) - } + let dispatcher = ref ? ref.deref() : null + if (!dispatcher) { + dispatcher = this[kFactory](opts.origin, this[kOptions]) + .on('drain', this[kOnDrain]) + .on('connect', this[kOnConnect]) + .on('disconnect', this[kOnDisconnect]) + .on('connectionError', this[kOnConnectionError]) - // 2. Set this’s headers’s guard to "request-no-cors". - this[kHeaders][kGuard] = 'request-no-cors' + this[kClients].set(key, new WeakRef(dispatcher)) + this[kFinalizer].register(dispatcher, key) } - // 32. If init is not empty, then: - if (initHasKey) { - /** @type {HeadersList} */ - const headersList = this[kHeaders][kHeadersList] - // 1. Let headers be a copy of this’s headers and its associated header - // list. - // 2. If init["headers"] exists, then set headers to init["headers"]. - const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList) - - // 3. Empty this’s headers’s header list. - headersList.clear() + return dispatcher.dispatch(opts, handler) + } - // 4. If headers is a Headers object, then for each header in its header - // list, append header’s name/header’s value to this’s headers. - if (headers instanceof HeadersList) { - for (const [key, val] of headers) { - headersList.append(key, val) - } - // Note: Copy the `set-cookie` meta-data. - headersList.cookies = headers.cookies - } else { - // 5. Otherwise, fill this’s headers with headers. - fillHeaders(this[kHeaders], headers) + async [kClose] () { + const closePromises = [] + for (const ref of this[kClients].values()) { + const client = ref.deref() + /* istanbul ignore else: gc is undeterministic */ + if (client) { + closePromises.push(client.close()) } } - // 33. Let inputBody be input’s request’s body if input is a Request - // object; otherwise null. - const inputBody = input instanceof Request ? input[kState].body : null + await Promise.all(closePromises) + } - // 34. If either init["body"] exists and is non-null or inputBody is - // non-null, and request’s method is `GET` or `HEAD`, then throw a - // TypeError. - if ( - (init.body != null || inputBody != null) && - (request.method === 'GET' || request.method === 'HEAD') - ) { - throw new TypeError('Request with GET/HEAD method cannot have body.') + async [kDestroy] (err) { + const destroyPromises = [] + for (const ref of this[kClients].values()) { + const client = ref.deref() + /* istanbul ignore else: gc is undeterministic */ + if (client) { + destroyPromises.push(client.destroy(err)) + } } - // 35. Let initBody be null. - let initBody = null + await Promise.all(destroyPromises) + } +} - // 36. If init["body"] exists and is non-null, then: - if (init.body != null) { - // 1. Let Content-Type be null. - // 2. Set initBody and Content-Type to the result of extracting - // init["body"], with keepalive set to request’s keepalive. - const [extractedBody, contentType] = extractBody( - init.body, - request.keepalive - ) - initBody = extractedBody +module.exports = Agent - // 3, If Content-Type is non-null and this’s headers’s header list does - // not contain `Content-Type`, then append `Content-Type`/Content-Type to - // this’s headers. - if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) { - this[kHeaders].append('content-type', contentType) - } - } - // 37. Let inputOrInitBody be initBody if it is non-null; otherwise - // inputBody. - const inputOrInitBody = initBody ?? inputBody +/***/ }), - // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is - // null, then: - if (inputOrInitBody != null && inputOrInitBody.source == null) { - // 1. If initBody is non-null and init["duplex"] does not exist, - // then throw a TypeError. - if (initBody != null && init.duplex == null) { - throw new TypeError('RequestInit: duplex option is required when sending a body.') - } +/***/ 46468: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // 2. If this’s request’s mode is neither "same-origin" nor "cors", - // then throw a TypeError. - if (request.mode !== 'same-origin' && request.mode !== 'cors') { - throw new TypeError( - 'If request is made from ReadableStream, mode should be "same-origin" or "cors"' - ) - } +const { addAbortListener } = __nccwpck_require__(43061) +const { RequestAbortedError } = __nccwpck_require__(70867) - // 3. Set this’s request’s use-CORS-preflight flag. - request.useCORSPreflightFlag = true - } +const kListener = Symbol('kListener') +const kSignal = Symbol('kSignal') - // 39. Let finalBody be inputOrInitBody. - let finalBody = inputOrInitBody +function abort (self) { + if (self.abort) { + self.abort() + } else { + self.onError(new RequestAbortedError()) + } +} - // 40. If initBody is null and inputBody is non-null, then: - if (initBody == null && inputBody != null) { - // 1. If input is unusable, then throw a TypeError. - if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) { - throw new TypeError( - 'Cannot construct a Request with a Request object that has already been used.' - ) - } +function addSignal (self, signal) { + self[kSignal] = null + self[kListener] = null - // 2. Set finalBody to the result of creating a proxy for inputBody. - if (!TransformStream) { - TransformStream = (__nccwpck_require__(35356).TransformStream) - } + if (!signal) { + return + } - // https://streams.spec.whatwg.org/#readablestream-create-a-proxy - const identityTransform = new TransformStream() - inputBody.stream.pipeThrough(identityTransform) - finalBody = { - source: inputBody.source, - length: inputBody.length, - stream: identityTransform.readable - } - } + if (signal.aborted) { + abort(self) + return + } - // 41. Set this’s request’s body to finalBody. - this[kState].body = finalBody + self[kSignal] = signal + self[kListener] = () => { + abort(self) } - // Returns request’s HTTP method, which is "GET" by default. - get method () { - webidl.brandCheck(this, Request) + addAbortListener(self[kSignal], self[kListener]) +} - // The method getter steps are to return this’s request’s method. - return this[kState].method +function removeSignal (self) { + if (!self[kSignal]) { + return } - // Returns the URL of request as a string. - get url () { - webidl.brandCheck(this, Request) - - // The url getter steps are to return this’s request’s URL, serialized. - return URLSerializer(this[kState].url) + if ('removeEventListener' in self[kSignal]) { + self[kSignal].removeEventListener('abort', self[kListener]) + } else { + self[kSignal].removeListener('abort', self[kListener]) } - // Returns a Headers object consisting of the headers associated with request. - // Note that headers added in the network layer by the user agent will not - // be accounted for in this object, e.g., the "Host" header. - get headers () { - webidl.brandCheck(this, Request) + self[kSignal] = null + self[kListener] = null +} - // The headers getter steps are to return this’s headers. - return this[kHeaders] - } +module.exports = { + addSignal, + removeSignal +} - // Returns the kind of resource requested by request, e.g., "document" - // or "script". - get destination () { - webidl.brandCheck(this, Request) - // The destination getter are to return this’s request’s destination. - return this[kState].destination - } +/***/ }), - // Returns the referrer of request. Its value can be a same-origin URL if - // explicitly set in init, the empty string to indicate no referrer, and - // "about:client" when defaulting to the global’s default. This is used - // during fetching to determine the value of the `Referer` header of the - // request being made. - get referrer () { - webidl.brandCheck(this, Request) +/***/ 58114: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // 1. If this’s request’s referrer is "no-referrer", then return the - // empty string. - if (this[kState].referrer === 'no-referrer') { - return '' - } - // 2. If this’s request’s referrer is "client", then return - // "about:client". - if (this[kState].referrer === 'client') { - return 'about:client' - } - // Return this’s request’s referrer, serialized. - return this[kState].referrer.toString() - } +const { AsyncResource } = __nccwpck_require__(50852) +const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(70867) +const util = __nccwpck_require__(43061) +const { addSignal, removeSignal } = __nccwpck_require__(46468) - // Returns the referrer policy associated with request. - // This is used during fetching to compute the value of the request’s - // referrer. - get referrerPolicy () { - webidl.brandCheck(this, Request) +class ConnectHandler extends AsyncResource { + constructor (opts, callback) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } - // The referrerPolicy getter steps are to return this’s request’s referrer policy. - return this[kState].referrerPolicy - } + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } - // Returns the mode associated with request, which is a string indicating - // whether the request will use CORS, or will be restricted to same-origin - // URLs. - get mode () { - webidl.brandCheck(this, Request) + const { signal, opaque, responseHeaders } = opts - // The mode getter steps are to return this’s request’s mode. - return this[kState].mode - } + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } - // Returns the credentials mode associated with request, - // which is a string indicating whether credentials will be sent with the - // request always, never, or only when sent to a same-origin URL. - get credentials () { - // The credentials getter steps are to return this’s request’s credentials mode. - return this[kState].credentials - } + super('UNDICI_CONNECT') - // Returns the cache mode associated with request, - // which is a string indicating how the request will - // interact with the browser’s cache when fetching. - get cache () { - webidl.brandCheck(this, Request) + this.opaque = opaque || null + this.responseHeaders = responseHeaders || null + this.callback = callback + this.abort = null - // The cache getter steps are to return this’s request’s cache mode. - return this[kState].cache + addSignal(this, signal) } - // Returns the redirect mode associated with request, - // which is a string indicating how redirects for the - // request will be handled during fetching. A request - // will follow redirects by default. - get redirect () { - webidl.brandCheck(this, Request) + onConnect (abort, context) { + if (!this.callback) { + throw new RequestAbortedError() + } - // The redirect getter steps are to return this’s request’s redirect mode. - return this[kState].redirect + this.abort = abort + this.context = context } - // Returns request’s subresource integrity metadata, which is a - // cryptographic hash of the resource being fetched. Its value - // consists of multiple hashes separated by whitespace. [SRI] - get integrity () { - webidl.brandCheck(this, Request) - - // The integrity getter steps are to return this’s request’s integrity - // metadata. - return this[kState].integrity + onHeaders () { + throw new SocketError('bad connect', null) } - // Returns a boolean indicating whether or not request can outlive the - // global in which it was created. - get keepalive () { - webidl.brandCheck(this, Request) + onUpgrade (statusCode, rawHeaders, socket) { + const { callback, opaque, context } = this - // The keepalive getter steps are to return this’s request’s keepalive. - return this[kState].keepalive - } + removeSignal(this) - // Returns a boolean indicating whether or not request is for a reload - // navigation. - get isReloadNavigation () { - webidl.brandCheck(this, Request) + this.callback = null - // The isReloadNavigation getter steps are to return true if this’s - // request’s reload-navigation flag is set; otherwise false. - return this[kState].reloadNavigation + let headers = rawHeaders + // Indicates is an HTTP2Session + if (headers != null) { + headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + } + + this.runInAsyncScope(callback, null, null, { + statusCode, + headers, + socket, + opaque, + context + }) } - // Returns a boolean indicating whether or not request is for a history - // navigation (a.k.a. back-foward navigation). - get isHistoryNavigation () { - webidl.brandCheck(this, Request) + onError (err) { + const { callback, opaque } = this - // The isHistoryNavigation getter steps are to return true if this’s request’s - // history-navigation flag is set; otherwise false. - return this[kState].historyNavigation + removeSignal(this) + + if (callback) { + this.callback = null + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }) + }) + } } +} - // Returns the signal associated with request, which is an AbortSignal - // object indicating whether or not request has been aborted, and its - // abort event handler. - get signal () { - webidl.brandCheck(this, Request) +function connect (opts, callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + connect.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } - // The signal getter steps are to return this’s signal. - return this[kSignal] + try { + const connectHandler = new ConnectHandler(opts, callback) + this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler) + } catch (err) { + if (typeof callback !== 'function') { + throw err + } + const opaque = opts && opts.opaque + queueMicrotask(() => callback(err, { opaque })) } +} - get body () { - webidl.brandCheck(this, Request) +module.exports = connect - return this[kState].body ? this[kState].body.stream : null - } - get bodyUsed () { - webidl.brandCheck(this, Request) +/***/ }), - return !!this[kState].body && util.isDisturbed(this[kState].body.stream) - } +/***/ 77860: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - get duplex () { - webidl.brandCheck(this, Request) - return 'half' - } - // Returns a clone of request. - clone () { - webidl.brandCheck(this, Request) +const { + Readable, + Duplex, + PassThrough +} = __nccwpck_require__(12781) +const { + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError +} = __nccwpck_require__(70867) +const util = __nccwpck_require__(43061) +const { AsyncResource } = __nccwpck_require__(50852) +const { addSignal, removeSignal } = __nccwpck_require__(46468) +const assert = __nccwpck_require__(39491) - // 1. If this is unusable, then throw a TypeError. - if (this.bodyUsed || this.body?.locked) { - throw new TypeError('unusable') - } +const kResume = Symbol('resume') - // 2. Let clonedRequest be the result of cloning this’s request. - const clonedRequest = cloneRequest(this[kState]) +class PipelineRequest extends Readable { + constructor () { + super({ autoDestroy: true }) - // 3. Let clonedRequestObject be the result of creating a Request object, - // given clonedRequest, this’s headers’s guard, and this’s relevant Realm. - const clonedRequestObject = new Request(kConstruct) - clonedRequestObject[kState] = clonedRequest - clonedRequestObject[kRealm] = this[kRealm] - clonedRequestObject[kHeaders] = new Headers(kConstruct) - clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList - clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard] - clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm] + this[kResume] = null + } - // 4. Make clonedRequestObject’s signal follow this’s signal. - const ac = new AbortController() - if (this.signal.aborted) { - ac.abort(this.signal.reason) - } else { - util.addAbortListener( - this.signal, - () => { - ac.abort(this.signal.reason) - } - ) - } - clonedRequestObject[kSignal] = ac.signal + _read () { + const { [kResume]: resume } = this - // 4. Return clonedRequestObject. - return clonedRequestObject + if (resume) { + this[kResume] = null + resume() + } } -} -mixinBody(Request) + _destroy (err, callback) { + this._read() -function makeRequest (init) { - // https://fetch.spec.whatwg.org/#requests - const request = { - method: 'GET', - localURLsOnly: false, - unsafeRequest: false, - body: null, - client: null, - reservedClient: null, - replacesClientId: '', - window: 'client', - keepalive: false, - serviceWorkers: 'all', - initiator: '', - destination: '', - priority: null, - origin: 'client', - policyContainer: 'client', - referrer: 'client', - referrerPolicy: '', - mode: 'no-cors', - useCORSPreflightFlag: false, - credentials: 'same-origin', - useCredentials: false, - cache: 'default', - redirect: 'follow', - integrity: '', - cryptoGraphicsNonceMetadata: '', - parserMetadata: '', - reloadNavigation: false, - historyNavigation: false, - userActivation: false, - taintedOrigin: false, - redirectCount: 0, - responseTainting: 'basic', - preventNoCacheCacheControlHeaderModification: false, - done: false, - timingAllowFailed: false, - ...init, - headersList: init.headersList - ? new HeadersList(init.headersList) - : new HeadersList() + callback(err) } - request.url = request.urlList[0] - return request } -// https://fetch.spec.whatwg.org/#concept-request-clone -function cloneRequest (request) { - // To clone a request request, run these steps: - - // 1. Let newRequest be a copy of request, except for its body. - const newRequest = makeRequest({ ...request, body: null }) +class PipelineResponse extends Readable { + constructor (resume) { + super({ autoDestroy: true }) + this[kResume] = resume + } - // 2. If request’s body is non-null, set newRequest’s body to the - // result of cloning request’s body. - if (request.body != null) { - newRequest.body = cloneBody(request.body) + _read () { + this[kResume]() } - // 3. Return newRequest. - return newRequest -} + _destroy (err, callback) { + if (!err && !this._readableState.endEmitted) { + err = new RequestAbortedError() + } -Object.defineProperties(Request.prototype, { - method: kEnumerableProperty, - url: kEnumerableProperty, - headers: kEnumerableProperty, - redirect: kEnumerableProperty, - clone: kEnumerableProperty, - signal: kEnumerableProperty, - duplex: kEnumerableProperty, - destination: kEnumerableProperty, - body: kEnumerableProperty, - bodyUsed: kEnumerableProperty, - isHistoryNavigation: kEnumerableProperty, - isReloadNavigation: kEnumerableProperty, - keepalive: kEnumerableProperty, - integrity: kEnumerableProperty, - cache: kEnumerableProperty, - credentials: kEnumerableProperty, - attribute: kEnumerableProperty, - referrerPolicy: kEnumerableProperty, - referrer: kEnumerableProperty, - mode: kEnumerableProperty, - [Symbol.toStringTag]: { - value: 'Request', - configurable: true + callback(err) } -}) +} -webidl.converters.Request = webidl.interfaceConverter( - Request -) +class PipelineHandler extends AsyncResource { + constructor (opts, handler) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } -// https://fetch.spec.whatwg.org/#requestinfo -webidl.converters.RequestInfo = function (V) { - if (typeof V === 'string') { - return webidl.converters.USVString(V) - } + if (typeof handler !== 'function') { + throw new InvalidArgumentError('invalid handler') + } - if (V instanceof Request) { - return webidl.converters.Request(V) - } + const { signal, method, opaque, onInfo, responseHeaders } = opts - return webidl.converters.USVString(V) -} + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } -webidl.converters.AbortSignal = webidl.interfaceConverter( - AbortSignal -) + if (method === 'CONNECT') { + throw new InvalidArgumentError('invalid method') + } -// https://fetch.spec.whatwg.org/#requestinit -webidl.converters.RequestInit = webidl.dictionaryConverter([ - { - key: 'method', - converter: webidl.converters.ByteString - }, - { - key: 'headers', - converter: webidl.converters.HeadersInit - }, - { - key: 'body', - converter: webidl.nullableConverter( - webidl.converters.BodyInit - ) - }, - { - key: 'referrer', - converter: webidl.converters.USVString - }, - { - key: 'referrerPolicy', - converter: webidl.converters.DOMString, - // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy - allowedValues: referrerPolicy - }, - { - key: 'mode', - converter: webidl.converters.DOMString, - // https://fetch.spec.whatwg.org/#concept-request-mode - allowedValues: requestMode - }, - { - key: 'credentials', - converter: webidl.converters.DOMString, - // https://fetch.spec.whatwg.org/#requestcredentials - allowedValues: requestCredentials - }, - { - key: 'cache', - converter: webidl.converters.DOMString, - // https://fetch.spec.whatwg.org/#requestcache - allowedValues: requestCache - }, - { - key: 'redirect', - converter: webidl.converters.DOMString, - // https://fetch.spec.whatwg.org/#requestredirect - allowedValues: requestRedirect - }, - { - key: 'integrity', - converter: webidl.converters.DOMString - }, - { - key: 'keepalive', - converter: webidl.converters.boolean - }, - { - key: 'signal', - converter: webidl.nullableConverter( - (signal) => webidl.converters.AbortSignal( - signal, - { strict: false } - ) - ) - }, - { - key: 'window', - converter: webidl.converters.any - }, - { - key: 'duplex', - converter: webidl.converters.DOMString, - allowedValues: requestDuplex - } -]) + if (onInfo && typeof onInfo !== 'function') { + throw new InvalidArgumentError('invalid onInfo callback') + } -module.exports = { Request, makeRequest } + super('UNDICI_PIPELINE') + this.opaque = opaque || null + this.responseHeaders = responseHeaders || null + this.handler = handler + this.abort = null + this.context = null + this.onInfo = onInfo || null -/***/ }), + this.req = new PipelineRequest().on('error', util.nop) -/***/ 58846: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + this.ret = new Duplex({ + readableObjectMode: opts.objectMode, + autoDestroy: true, + read: () => { + const { body } = this + + if (body && body.resume) { + body.resume() + } + }, + write: (chunk, encoding, callback) => { + const { req } = this + if (req.push(chunk, encoding) || req._readableState.destroyed) { + callback() + } else { + req[kResume] = callback + } + }, + destroy: (err, callback) => { + const { body, req, res, ret, abort } = this + if (!err && !ret._readableState.endEmitted) { + err = new RequestAbortedError() + } -const { Headers, HeadersList, fill } = __nccwpck_require__(23245) -const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(62494) -const util = __nccwpck_require__(67468) -const { kEnumerableProperty } = util -const { - isValidReasonPhrase, - isCancelled, - isAborted, - isBlobLike, - serializeJavascriptValueToJSONString, - isErrorLike, - isomorphicEncode -} = __nccwpck_require__(79453) -const { - redirectStatusSet, - nullBodyStatus, - DOMException -} = __nccwpck_require__(93541) -const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(46938) -const { webidl } = __nccwpck_require__(96138) -const { FormData } = __nccwpck_require__(12692) -const { getGlobalOrigin } = __nccwpck_require__(64110) -const { URLSerializer } = __nccwpck_require__(50096) -const { kHeadersList, kConstruct } = __nccwpck_require__(48039) -const assert = __nccwpck_require__(39491) -const { types } = __nccwpck_require__(73837) + if (abort && err) { + abort() + } -const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(35356).ReadableStream) -const textEncoder = new TextEncoder('utf-8') + util.destroy(body, err) + util.destroy(req, err) + util.destroy(res, err) -// https://fetch.spec.whatwg.org/#response-class -class Response { - // Creates network error Response. - static error () { - // TODO - const relevantRealm = { settingsObject: {} } + removeSignal(this) - // The static error() method steps are to return the result of creating a - // Response object, given a new network error, "immutable", and this’s - // relevant Realm. - const responseObject = new Response() - responseObject[kState] = makeNetworkError() - responseObject[kRealm] = relevantRealm - responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList - responseObject[kHeaders][kGuard] = 'immutable' - responseObject[kHeaders][kRealm] = relevantRealm - return responseObject - } + callback(err) + } + }).on('prefinish', () => { + const { req } = this - // https://fetch.spec.whatwg.org/#dom-response-json - static json (data, init = {}) { - webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' }) + // Node < 15 does not call _final in same tick. + req.push(null) + }) - if (init !== null) { - init = webidl.converters.ResponseInit(init) - } + this.res = null - // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data. - const bytes = textEncoder.encode( - serializeJavascriptValueToJSONString(data) - ) + addSignal(this, signal) + } - // 2. Let body be the result of extracting bytes. - const body = extractBody(bytes) + onConnect (abort, context) { + const { ret, res } = this - // 3. Let responseObject be the result of creating a Response object, given a new response, - // "response", and this’s relevant Realm. - const relevantRealm = { settingsObject: {} } - const responseObject = new Response() - responseObject[kRealm] = relevantRealm - responseObject[kHeaders][kGuard] = 'response' - responseObject[kHeaders][kRealm] = relevantRealm + assert(!res, 'pipeline cannot be retried') - // 4. Perform initialize a response given responseObject, init, and (body, "application/json"). - initializeResponse(responseObject, init, { body: body[0], type: 'application/json' }) + if (ret.destroyed) { + throw new RequestAbortedError() + } - // 5. Return responseObject. - return responseObject + this.abort = abort + this.context = context } - // Creates a redirect Response that redirects to url with status status. - static redirect (url, status = 302) { - const relevantRealm = { settingsObject: {} } + onHeaders (statusCode, rawHeaders, resume) { + const { opaque, handler, context } = this - webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' }) + if (statusCode < 200) { + if (this.onInfo) { + const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + this.onInfo({ statusCode, headers }) + } + return + } - url = webidl.converters.USVString(url) - status = webidl.converters['unsigned short'](status) + this.res = new PipelineResponse(resume) - // 1. Let parsedURL be the result of parsing url with current settings - // object’s API base URL. - // 2. If parsedURL is failure, then throw a TypeError. - // TODO: base-URL? - let parsedURL + let body try { - parsedURL = new URL(url, getGlobalOrigin()) - } catch (err) { - throw Object.assign(new TypeError('Failed to parse URL from ' + url), { - cause: err + this.handler = null + const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + body = this.runInAsyncScope(handler, null, { + statusCode, + headers, + opaque, + body: this.res, + context }) + } catch (err) { + this.res.on('error', util.nop) + throw err } - // 3. If status is not a redirect status, then throw a RangeError. - if (!redirectStatusSet.has(status)) { - throw new RangeError('Invalid status code ' + status) + if (!body || typeof body.on !== 'function') { + throw new InvalidReturnValueError('expected Readable') } - // 4. Let responseObject be the result of creating a Response object, - // given a new response, "immutable", and this’s relevant Realm. - const responseObject = new Response() - responseObject[kRealm] = relevantRealm - responseObject[kHeaders][kGuard] = 'immutable' - responseObject[kHeaders][kRealm] = relevantRealm + body + .on('data', (chunk) => { + const { ret, body } = this - // 5. Set responseObject’s response’s status to status. - responseObject[kState].status = status + if (!ret.push(chunk) && body.pause) { + body.pause() + } + }) + .on('error', (err) => { + const { ret } = this - // 6. Let value be parsedURL, serialized and isomorphic encoded. - const value = isomorphicEncode(URLSerializer(parsedURL)) + util.destroy(ret, err) + }) + .on('end', () => { + const { ret } = this - // 7. Append `Location`/value to responseObject’s response’s header list. - responseObject[kState].headersList.append('location', value) + ret.push(null) + }) + .on('close', () => { + const { ret } = this - // 8. Return responseObject. - return responseObject + if (!ret._readableState.ended) { + util.destroy(ret, new RequestAbortedError()) + } + }) + + this.body = body } - // https://fetch.spec.whatwg.org/#dom-response - constructor (body = null, init = {}) { - if (body !== null) { - body = webidl.converters.BodyInit(body) - } + onData (chunk) { + const { res } = this + return res.push(chunk) + } - init = webidl.converters.ResponseInit(init) + onComplete (trailers) { + const { res } = this + res.push(null) + } - // TODO - this[kRealm] = { settingsObject: {} } + onError (err) { + const { ret } = this + this.handler = null + util.destroy(ret, err) + } +} - // 1. Set this’s response to a new response. - this[kState] = makeResponse({}) +function pipeline (opts, handler) { + try { + const pipelineHandler = new PipelineHandler(opts, handler) + this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler) + return pipelineHandler.ret + } catch (err) { + return new PassThrough().destroy(err) + } +} - // 2. Set this’s headers to a new Headers object with this’s relevant - // Realm, whose header list is this’s response’s header list and guard - // is "response". - this[kHeaders] = new Headers(kConstruct) - this[kHeaders][kGuard] = 'response' - this[kHeaders][kHeadersList] = this[kState].headersList - this[kHeaders][kRealm] = this[kRealm] +module.exports = pipeline - // 3. Let bodyWithType be null. - let bodyWithType = null - // 4. If body is non-null, then set bodyWithType to the result of extracting body. - if (body != null) { - const [extractedBody, type] = extractBody(body) - bodyWithType = { body: extractedBody, type } +/***/ }), + +/***/ 61226: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const Readable = __nccwpck_require__(96704) +const { + InvalidArgumentError, + RequestAbortedError +} = __nccwpck_require__(70867) +const util = __nccwpck_require__(43061) +const { getResolveErrorBodyCallback } = __nccwpck_require__(48542) +const { AsyncResource } = __nccwpck_require__(50852) +const { addSignal, removeSignal } = __nccwpck_require__(46468) + +class RequestHandler extends AsyncResource { + constructor (opts, callback) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') } - // 5. Perform initialize a response given this, init, and bodyWithType. - initializeResponse(this, init, bodyWithType) - } + const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts - // Returns response’s type, e.g., "cors". - get type () { - webidl.brandCheck(this, Response) + try { + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } - // The type getter steps are to return this’s response’s type. - return this[kState].type - } + if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) { + throw new InvalidArgumentError('invalid highWaterMark') + } - // Returns response’s URL, if it has one; otherwise the empty string. - get url () { - webidl.brandCheck(this, Response) + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } - const urlList = this[kState].urlList + if (method === 'CONNECT') { + throw new InvalidArgumentError('invalid method') + } - // The url getter steps are to return the empty string if this’s - // response’s URL is null; otherwise this’s response’s URL, - // serialized with exclude fragment set to true. - const url = urlList[urlList.length - 1] ?? null + if (onInfo && typeof onInfo !== 'function') { + throw new InvalidArgumentError('invalid onInfo callback') + } - if (url === null) { - return '' + super('UNDICI_REQUEST') + } catch (err) { + if (util.isStream(body)) { + util.destroy(body.on('error', util.nop), err) + } + throw err } - return URLSerializer(url, true) - } + this.responseHeaders = responseHeaders || null + this.opaque = opaque || null + this.callback = callback + this.res = null + this.abort = null + this.body = body + this.trailers = {} + this.context = null + this.onInfo = onInfo || null + this.throwOnError = throwOnError + this.highWaterMark = highWaterMark - // Returns whether response was obtained through a redirect. - get redirected () { - webidl.brandCheck(this, Response) + if (util.isStream(body)) { + body.on('error', (err) => { + this.onError(err) + }) + } - // The redirected getter steps are to return true if this’s response’s URL - // list has more than one item; otherwise false. - return this[kState].urlList.length > 1 + addSignal(this, signal) } - // Returns response’s status. - get status () { - webidl.brandCheck(this, Response) + onConnect (abort, context) { + if (!this.callback) { + throw new RequestAbortedError() + } - // The status getter steps are to return this’s response’s status. - return this[kState].status + this.abort = abort + this.context = context } - // Returns whether response’s status is an ok status. - get ok () { - webidl.brandCheck(this, Response) + onHeaders (statusCode, rawHeaders, resume, statusMessage) { + const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this - // The ok getter steps are to return true if this’s response’s status is an - // ok status; otherwise false. - return this[kState].status >= 200 && this[kState].status <= 299 - } + const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) - // Returns response’s status message. - get statusText () { - webidl.brandCheck(this, Response) + if (statusCode < 200) { + if (this.onInfo) { + this.onInfo({ statusCode, headers }) + } + return + } - // The statusText getter steps are to return this’s response’s status - // message. - return this[kState].statusText - } + const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers + const contentType = parsedHeaders['content-type'] + const body = new Readable({ resume, abort, contentType, highWaterMark }) - // Returns response’s headers as Headers. - get headers () { - webidl.brandCheck(this, Response) + this.callback = null + this.res = body + if (callback !== null) { + if (this.throwOnError && statusCode >= 400) { + this.runInAsyncScope(getResolveErrorBodyCallback, null, + { callback, body, contentType, statusCode, statusMessage, headers } + ) + } else { + this.runInAsyncScope(callback, null, null, { + statusCode, + headers, + trailers: this.trailers, + opaque, + body, + context + }) + } + } + } - // The headers getter steps are to return this’s headers. - return this[kHeaders] + onData (chunk) { + const { res } = this + return res.push(chunk) } - get body () { - webidl.brandCheck(this, Response) + onComplete (trailers) { + const { res } = this - return this[kState].body ? this[kState].body.stream : null - } + removeSignal(this) - get bodyUsed () { - webidl.brandCheck(this, Response) + util.parseHeaders(trailers, this.trailers) - return !!this[kState].body && util.isDisturbed(this[kState].body.stream) + res.push(null) } - // Returns a clone of response. - clone () { - webidl.brandCheck(this, Response) + onError (err) { + const { res, callback, body, opaque } = this - // 1. If this is unusable, then throw a TypeError. - if (this.bodyUsed || (this.body && this.body.locked)) { - throw webidl.errors.exception({ - header: 'Response.clone', - message: 'Body has already been consumed.' + removeSignal(this) + + if (callback) { + // TODO: Does this need queueMicrotask? + this.callback = null + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }) }) } - // 2. Let clonedResponse be the result of cloning this’s response. - const clonedResponse = cloneResponse(this[kState]) - - // 3. Return the result of creating a Response object, given - // clonedResponse, this’s headers’s guard, and this’s relevant Realm. - const clonedResponseObject = new Response() - clonedResponseObject[kState] = clonedResponse - clonedResponseObject[kRealm] = this[kRealm] - clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList - clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard] - clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm] + if (res) { + this.res = null + // Ensure all queued handlers are invoked before destroying res. + queueMicrotask(() => { + util.destroy(res, err) + }) + } - return clonedResponseObject + if (body) { + this.body = null + util.destroy(body, err) + } } } -mixinBody(Response) - -Object.defineProperties(Response.prototype, { - type: kEnumerableProperty, - url: kEnumerableProperty, - status: kEnumerableProperty, - ok: kEnumerableProperty, - redirected: kEnumerableProperty, - statusText: kEnumerableProperty, - headers: kEnumerableProperty, - clone: kEnumerableProperty, - body: kEnumerableProperty, - bodyUsed: kEnumerableProperty, - [Symbol.toStringTag]: { - value: 'Response', - configurable: true +function request (opts, callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + request.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data) + }) + }) } -}) - -Object.defineProperties(Response, { - json: kEnumerableProperty, - redirect: kEnumerableProperty, - error: kEnumerableProperty -}) - -// https://fetch.spec.whatwg.org/#concept-response-clone -function cloneResponse (response) { - // To clone a response response, run these steps: - // 1. If response is a filtered response, then return a new identical - // filtered response whose internal response is a clone of response’s - // internal response. - if (response.internalResponse) { - return filterResponse( - cloneResponse(response.internalResponse), - response.type - ) + try { + this.dispatch(opts, new RequestHandler(opts, callback)) + } catch (err) { + if (typeof callback !== 'function') { + throw err + } + const opaque = opts && opts.opaque + queueMicrotask(() => callback(err, { opaque })) } +} - // 2. Let newResponse be a copy of response, except for its body. - const newResponse = makeResponse({ ...response, body: null }) +module.exports = request +module.exports.RequestHandler = RequestHandler - // 3. If response’s body is non-null, then set newResponse’s body to the - // result of cloning response’s body. - if (response.body != null) { - newResponse.body = cloneBody(response.body) - } - // 4. Return newResponse. - return newResponse -} +/***/ }), -function makeResponse (init) { - return { - aborted: false, - rangeRequested: false, - timingAllowPassed: false, - requestIncludesCredentials: false, - type: 'default', - status: 200, - timingInfo: null, - cacheState: '', - statusText: '', - ...init, - headersList: init.headersList - ? new HeadersList(init.headersList) - : new HeadersList(), - urlList: init.urlList ? [...init.urlList] : [] - } -} +/***/ 75009: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function makeNetworkError (reason) { - const isError = isErrorLike(reason) - return makeResponse({ - type: 'error', - status: 0, - error: isError - ? reason - : new Error(reason ? String(reason) : reason), - aborted: reason && reason.name === 'AbortError' - }) -} -function makeFilteredResponse (response, state) { - state = { - internalResponse: response, - ...state - } - return new Proxy(response, { - get (target, p) { - return p in state ? state[p] : target[p] - }, - set (target, p, value) { - assert(!(p in state)) - target[p] = value - return true +const { finished, PassThrough } = __nccwpck_require__(12781) +const { + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError +} = __nccwpck_require__(70867) +const util = __nccwpck_require__(43061) +const { getResolveErrorBodyCallback } = __nccwpck_require__(48542) +const { AsyncResource } = __nccwpck_require__(50852) +const { addSignal, removeSignal } = __nccwpck_require__(46468) + +class StreamHandler extends AsyncResource { + constructor (opts, factory, callback) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') } - }) -} -// https://fetch.spec.whatwg.org/#concept-filtered-response -function filterResponse (response, type) { - // Set response to the following filtered response with response as its - // internal response, depending on request’s response tainting: - if (type === 'basic') { - // A basic filtered response is a filtered response whose type is "basic" - // and header list excludes any headers in internal response’s header list - // whose name is a forbidden response-header name. + const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts - // Note: undici does not implement forbidden response-header names - return makeFilteredResponse(response, { - type: 'basic', - headersList: response.headersList - }) - } else if (type === 'cors') { - // A CORS filtered response is a filtered response whose type is "cors" - // and header list excludes any headers in internal response’s header - // list whose name is not a CORS-safelisted response-header name, given - // internal response’s CORS-exposed header-name list. + try { + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } - // Note: undici does not implement CORS-safelisted response-header names - return makeFilteredResponse(response, { - type: 'cors', - headersList: response.headersList - }) - } else if (type === 'opaque') { - // An opaque filtered response is a filtered response whose type is - // "opaque", URL list is the empty list, status is 0, status message - // is the empty byte sequence, header list is empty, and body is null. + if (typeof factory !== 'function') { + throw new InvalidArgumentError('invalid factory') + } - return makeFilteredResponse(response, { - type: 'opaque', - urlList: Object.freeze([]), - status: 0, - statusText: '', - body: null - }) - } else if (type === 'opaqueredirect') { - // An opaque-redirect filtered response is a filtered response whose type - // is "opaqueredirect", status is 0, status message is the empty byte - // sequence, header list is empty, and body is null. + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } - return makeFilteredResponse(response, { - type: 'opaqueredirect', - status: 0, - statusText: '', - headersList: [], - body: null - }) - } else { - assert(false) - } -} + if (method === 'CONNECT') { + throw new InvalidArgumentError('invalid method') + } -// https://fetch.spec.whatwg.org/#appropriate-network-error -function makeAppropriateNetworkError (fetchParams, err = null) { - // 1. Assert: fetchParams is canceled. - assert(isCancelled(fetchParams)) + if (onInfo && typeof onInfo !== 'function') { + throw new InvalidArgumentError('invalid onInfo callback') + } - // 2. Return an aborted network error if fetchParams is aborted; - // otherwise return a network error. - return isAborted(fetchParams) - ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err })) - : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err })) -} + super('UNDICI_STREAM') + } catch (err) { + if (util.isStream(body)) { + util.destroy(body.on('error', util.nop), err) + } + throw err + } -// https://whatpr.org/fetch/1392.html#initialize-a-response -function initializeResponse (response, init, body) { - // 1. If init["status"] is not in the range 200 to 599, inclusive, then - // throw a RangeError. - if (init.status !== null && (init.status < 200 || init.status > 599)) { - throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.') + this.responseHeaders = responseHeaders || null + this.opaque = opaque || null + this.factory = factory + this.callback = callback + this.res = null + this.abort = null + this.context = null + this.trailers = null + this.body = body + this.onInfo = onInfo || null + this.throwOnError = throwOnError || false + + if (util.isStream(body)) { + body.on('error', (err) => { + this.onError(err) + }) + } + + addSignal(this, signal) } - // 2. If init["statusText"] does not match the reason-phrase token production, - // then throw a TypeError. - if ('statusText' in init && init.statusText != null) { - // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2: - // reason-phrase = *( HTAB / SP / VCHAR / obs-text ) - if (!isValidReasonPhrase(String(init.statusText))) { - throw new TypeError('Invalid statusText') + onConnect (abort, context) { + if (!this.callback) { + throw new RequestAbortedError() } - } - // 3. Set response’s response’s status to init["status"]. - if ('status' in init && init.status != null) { - response[kState].status = init.status + this.abort = abort + this.context = context } - // 4. Set response’s response’s status message to init["statusText"]. - if ('statusText' in init && init.statusText != null) { - response[kState].statusText = init.statusText - } + onHeaders (statusCode, rawHeaders, resume, statusMessage) { + const { factory, opaque, context, callback, responseHeaders } = this - // 5. If init["headers"] exists, then fill response’s headers with init["headers"]. - if ('headers' in init && init.headers != null) { - fill(response[kHeaders], init.headers) - } + const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) - // 6. If body was given, then: - if (body) { - // 1. If response's status is a null body status, then throw a TypeError. - if (nullBodyStatus.includes(response.status)) { - throw webidl.errors.exception({ - header: 'Response constructor', - message: 'Invalid response status code ' + response.status - }) + if (statusCode < 200) { + if (this.onInfo) { + this.onInfo({ statusCode, headers }) + } + return } - // 2. Set response's body to body's body. - response[kState].body = body.body + this.factory = null - // 3. If body's type is non-null and response's header list does not contain - // `Content-Type`, then append (`Content-Type`, body's type) to response's header list. - if (body.type != null && !response[kState].headersList.contains('Content-Type')) { - response[kState].headersList.append('content-type', body.type) - } - } -} + let res -webidl.converters.ReadableStream = webidl.interfaceConverter( - ReadableStream -) + if (this.throwOnError && statusCode >= 400) { + const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers + const contentType = parsedHeaders['content-type'] + res = new PassThrough() -webidl.converters.FormData = webidl.interfaceConverter( - FormData -) + this.callback = null + this.runInAsyncScope(getResolveErrorBodyCallback, null, + { callback, body: res, contentType, statusCode, statusMessage, headers } + ) + } else { + if (factory === null) { + return + } -webidl.converters.URLSearchParams = webidl.interfaceConverter( - URLSearchParams -) + res = this.runInAsyncScope(factory, null, { + statusCode, + headers, + opaque, + context + }) -// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit -webidl.converters.XMLHttpRequestBodyInit = function (V) { - if (typeof V === 'string') { - return webidl.converters.USVString(V) - } + if ( + !res || + typeof res.write !== 'function' || + typeof res.end !== 'function' || + typeof res.on !== 'function' + ) { + throw new InvalidReturnValueError('expected Writable') + } - if (isBlobLike(V)) { - return webidl.converters.Blob(V, { strict: false }) - } + // TODO: Avoid finished. It registers an unnecessary amount of listeners. + finished(res, { readable: false }, (err) => { + const { callback, res, opaque, trailers, abort } = this - if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) { - return webidl.converters.BufferSource(V) - } + this.res = null + if (err || !res.readable) { + util.destroy(res, err) + } - if (util.isFormDataLike(V)) { - return webidl.converters.FormData(V, { strict: false }) - } + this.callback = null + this.runInAsyncScope(callback, null, err || null, { opaque, trailers }) - if (V instanceof URLSearchParams) { - return webidl.converters.URLSearchParams(V) - } + if (err) { + abort() + } + }) + } - return webidl.converters.DOMString(V) -} + res.on('drain', resume) -// https://fetch.spec.whatwg.org/#bodyinit -webidl.converters.BodyInit = function (V) { - if (V instanceof ReadableStream) { - return webidl.converters.ReadableStream(V) + this.res = res + + const needDrain = res.writableNeedDrain !== undefined + ? res.writableNeedDrain + : res._writableState && res._writableState.needDrain + + return needDrain !== true } - // Note: the spec doesn't include async iterables, - // this is an undici extension. - if (V?.[Symbol.asyncIterator]) { - return V + onData (chunk) { + const { res } = this + + return res ? res.write(chunk) : true } - return webidl.converters.XMLHttpRequestBodyInit(V) -} + onComplete (trailers) { + const { res } = this -webidl.converters.ResponseInit = webidl.dictionaryConverter([ - { - key: 'status', - converter: webidl.converters['unsigned short'], - defaultValue: 200 - }, - { - key: 'statusText', - converter: webidl.converters.ByteString, - defaultValue: '' - }, - { - key: 'headers', - converter: webidl.converters.HeadersInit + removeSignal(this) + + if (!res) { + return + } + + this.trailers = util.parseHeaders(trailers) + + res.end() } -]) -module.exports = { - makeNetworkError, - makeResponse, - makeAppropriateNetworkError, - filterResponse, - Response, - cloneResponse -} + onError (err) { + const { res, callback, opaque, body } = this + removeSignal(this) -/***/ }), + this.factory = null -/***/ 46938: -/***/ ((module) => { + if (res) { + this.res = null + util.destroy(res, err) + } else if (callback) { + this.callback = null + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }) + }) + } + if (body) { + this.body = null + util.destroy(body, err) + } + } +} +function stream (opts, factory, callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + stream.call(this, opts, factory, (err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } -module.exports = { - kUrl: Symbol('url'), - kHeaders: Symbol('headers'), - kSignal: Symbol('signal'), - kState: Symbol('state'), - kGuard: Symbol('guard'), - kRealm: Symbol('realm') + try { + this.dispatch(opts, new StreamHandler(opts, factory, callback)) + } catch (err) { + if (typeof callback !== 'function') { + throw err + } + const opaque = opts && opts.opaque + queueMicrotask(() => callback(err, { opaque })) + } } +module.exports = stream + /***/ }), -/***/ 79453: +/***/ 94215: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(93541) -const { getGlobalOrigin } = __nccwpck_require__(64110) -const { performance } = __nccwpck_require__(4074) -const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(67468) +const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(70867) +const { AsyncResource } = __nccwpck_require__(50852) +const util = __nccwpck_require__(43061) +const { addSignal, removeSignal } = __nccwpck_require__(46468) const assert = __nccwpck_require__(39491) -const { isUint8Array } = __nccwpck_require__(29830) -// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable -/** @type {import('crypto')|undefined} */ -let crypto +class UpgradeHandler extends AsyncResource { + constructor (opts, callback) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } -try { - crypto = __nccwpck_require__(6113) -} catch { + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } -} + const { signal, opaque, responseHeaders } = opts -function responseURL (response) { - // https://fetch.spec.whatwg.org/#responses - // A response has an associated URL. It is a pointer to the last URL - // in response’s URL list and null if response’s URL list is empty. - const urlList = response.urlList - const length = urlList.length - return length === 0 ? null : urlList[length - 1].toString() -} + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } -// https://fetch.spec.whatwg.org/#concept-response-location-url -function responseLocationURL (response, requestFragment) { - // 1. If response’s status is not a redirect status, then return null. - if (!redirectStatusSet.has(response.status)) { - return null + super('UNDICI_UPGRADE') + + this.responseHeaders = responseHeaders || null + this.opaque = opaque || null + this.callback = callback + this.abort = null + this.context = null + + addSignal(this, signal) } - // 2. Let location be the result of extracting header list values given - // `Location` and response’s header list. - let location = response.headersList.get('location') + onConnect (abort, context) { + if (!this.callback) { + throw new RequestAbortedError() + } - // 3. If location is a header value, then set location to the result of - // parsing location with response’s URL. - if (location !== null && isValidHeaderValue(location)) { - location = new URL(location, responseURL(response)) + this.abort = abort + this.context = null } - // 4. If location is a URL whose fragment is null, then set location’s - // fragment to requestFragment. - if (location && !location.hash) { - location.hash = requestFragment + onHeaders () { + throw new SocketError('bad upgrade', null) } - // 5. Return location. - return location -} + onUpgrade (statusCode, rawHeaders, socket) { + const { callback, opaque, context } = this -/** @returns {URL} */ -function requestCurrentURL (request) { - return request.urlList[request.urlList.length - 1] -} + assert.strictEqual(statusCode, 101) -function requestBadPort (request) { - // 1. Let url be request’s current URL. - const url = requestCurrentURL(request) + removeSignal(this) - // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port, - // then return blocked. - if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) { - return 'blocked' + this.callback = null + const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + this.runInAsyncScope(callback, null, null, { + headers, + socket, + opaque, + context + }) } - // 3. Return allowed. - return 'allowed' -} + onError (err) { + const { callback, opaque } = this -function isErrorLike (object) { - return object instanceof Error || ( - object?.constructor?.name === 'Error' || - object?.constructor?.name === 'DOMException' - ) -} + removeSignal(this) -// Check whether |statusText| is a ByteString and -// matches the Reason-Phrase token production. -// RFC 2616: https://tools.ietf.org/html/rfc2616 -// RFC 7230: https://tools.ietf.org/html/rfc7230 -// "reason-phrase = *( HTAB / SP / VCHAR / obs-text )" -// https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116 -function isValidReasonPhrase (statusText) { - for (let i = 0; i < statusText.length; ++i) { - const c = statusText.charCodeAt(i) - if ( - !( - ( - c === 0x09 || // HTAB - (c >= 0x20 && c <= 0x7e) || // SP / VCHAR - (c >= 0x80 && c <= 0xff) - ) // obs-text - ) - ) { - return false + if (callback) { + this.callback = null + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }) + }) } } - return true } -/** - * @see https://tools.ietf.org/html/rfc7230#section-3.2.6 - * @param {number} c - */ -function isTokenCharCode (c) { - switch (c) { - case 0x22: - case 0x28: - case 0x29: - case 0x2c: - case 0x2f: - case 0x3a: - case 0x3b: - case 0x3c: - case 0x3d: - case 0x3e: - case 0x3f: - case 0x40: - case 0x5b: - case 0x5c: - case 0x5d: - case 0x7b: - case 0x7d: - // DQUOTE and "(),/:;<=>?@[\]{}" - return false - default: - // VCHAR %x21-7E - return c >= 0x21 && c <= 0x7e +function upgrade (opts, callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + upgrade.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data) + }) + }) } -} -/** - * @param {string} characters - */ -function isValidHTTPToken (characters) { - if (characters.length === 0) { - return false - } - for (let i = 0; i < characters.length; ++i) { - if (!isTokenCharCode(characters.charCodeAt(i))) { - return false + try { + const upgradeHandler = new UpgradeHandler(opts, callback) + this.dispatch({ + ...opts, + method: opts.method || 'GET', + upgrade: opts.protocol || 'Websocket' + }, upgradeHandler) + } catch (err) { + if (typeof callback !== 'function') { + throw err } + const opaque = opts && opts.opaque + queueMicrotask(() => callback(err, { opaque })) } - return true } -/** - * @see https://fetch.spec.whatwg.org/#header-name - * @param {string} potentialValue - */ -function isValidHeaderName (potentialValue) { - return isValidHTTPToken(potentialValue) -} +module.exports = upgrade -/** - * @see https://fetch.spec.whatwg.org/#header-value - * @param {string} potentialValue - */ -function isValidHeaderValue (potentialValue) { - // - Has no leading or trailing HTTP tab or space bytes. - // - Contains no 0x00 (NUL) or HTTP newline bytes. - if ( - potentialValue.startsWith('\t') || - potentialValue.startsWith(' ') || - potentialValue.endsWith('\t') || - potentialValue.endsWith(' ') - ) { - return false - } - if ( - potentialValue.includes('\0') || - potentialValue.includes('\r') || - potentialValue.includes('\n') - ) { - return false - } +/***/ }), - return true -} +/***/ 3617: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect -function setRequestReferrerPolicyOnRedirect (request, actualResponse) { - // Given a request request and a response actualResponse, this algorithm - // updates request’s referrer policy according to the Referrer-Policy - // header (if any) in actualResponse. - // 1. Let policy be the result of executing § 8.1 Parse a referrer policy - // from a Referrer-Policy header on actualResponse. - // 8.1 Parse a referrer policy from a Referrer-Policy header - // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list. - const { headersList } = actualResponse - // 2. Let policy be the empty string. - // 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token. - // 4. Return policy. - const policyHeader = (headersList.get('referrer-policy') ?? '').split(',') +module.exports.request = __nccwpck_require__(61226) +module.exports.stream = __nccwpck_require__(75009) +module.exports.pipeline = __nccwpck_require__(77860) +module.exports.upgrade = __nccwpck_require__(94215) +module.exports.connect = __nccwpck_require__(58114) - // Note: As the referrer-policy can contain multiple policies - // separated by comma, we need to loop through all of them - // and pick the first valid one. - // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy - let policy = '' - if (policyHeader.length > 0) { - // The right-most policy takes precedence. - // The left-most policy is the fallback. - for (let i = policyHeader.length; i !== 0; i--) { - const token = policyHeader[i - 1].trim() - if (referrerPolicyTokens.has(token)) { - policy = token - break - } - } - } - // 2. If policy is not the empty string, then set request’s referrer policy to policy. - if (policy !== '') { - request.referrerPolicy = policy - } -} +/***/ }), -// https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check -function crossOriginResourcePolicyCheck () { - // TODO - return 'allowed' -} +/***/ 96704: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// https://fetch.spec.whatwg.org/#concept-cors-check -function corsCheck () { - // TODO - return 'success' -} +// Ported from https://github.com/nodejs/undici/pull/907 -// https://fetch.spec.whatwg.org/#concept-tao-check -function TAOCheck () { - // TODO - return 'success' -} -function appendFetchMetadata (httpRequest) { - // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header - // TODO - // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header +const assert = __nccwpck_require__(39491) +const { Readable } = __nccwpck_require__(12781) +const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(70867) +const util = __nccwpck_require__(43061) +const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(43061) - // 1. Assert: r’s url is a potentially trustworthy URL. - // TODO +let Blob - // 2. Let header be a Structured Header whose value is a token. - let header = null +const kConsume = Symbol('kConsume') +const kReading = Symbol('kReading') +const kBody = Symbol('kBody') +const kAbort = Symbol('abort') +const kContentType = Symbol('kContentType') - // 3. Set header’s value to r’s mode. - header = httpRequest.mode +const noop = () => {} - // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list. - httpRequest.headersList.set('sec-fetch-mode', header) +module.exports = class BodyReadable extends Readable { + constructor ({ + resume, + abort, + contentType = '', + highWaterMark = 64 * 1024 // Same as nodejs fs streams. + }) { + super({ + autoDestroy: true, + read: resume, + highWaterMark + }) - // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header - // TODO + this._readableState.dataEmitted = false - // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header - // TODO -} + this[kAbort] = abort + this[kConsume] = null + this[kBody] = null + this[kContentType] = contentType -// https://fetch.spec.whatwg.org/#append-a-request-origin-header -function appendRequestOriginHeader (request) { - // 1. Let serializedOrigin be the result of byte-serializing a request origin with request. - let serializedOrigin = request.origin + // Is stream being consumed through Readable API? + // This is an optimization so that we avoid checking + // for 'data' and 'readable' listeners in the hot path + // inside push(). + this[kReading] = false + } - // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list. - if (request.responseTainting === 'cors' || request.mode === 'websocket') { - if (serializedOrigin) { - request.headersList.append('origin', serializedOrigin) + destroy (err) { + if (this.destroyed) { + // Node < 16 + return this } - // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then: - } else if (request.method !== 'GET' && request.method !== 'HEAD') { - // 1. Switch on request’s referrer policy: - switch (request.referrerPolicy) { - case 'no-referrer': - // Set serializedOrigin to `null`. - serializedOrigin = null - break - case 'no-referrer-when-downgrade': - case 'strict-origin': - case 'strict-origin-when-cross-origin': - // If request’s origin is a tuple origin, its scheme is "https", and request’s current URL’s scheme is not "https", then set serializedOrigin to `null`. - if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) { - serializedOrigin = null - } - break - case 'same-origin': - // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`. - if (!sameOrigin(request, requestCurrentURL(request))) { - serializedOrigin = null - } - break - default: - // Do nothing. + if (!err && !this._readableState.endEmitted) { + err = new RequestAbortedError() } - if (serializedOrigin) { - // 2. Append (`Origin`, serializedOrigin) to request’s header list. - request.headersList.append('origin', serializedOrigin) + if (err) { + this[kAbort]() } - } -} - -function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) { - // TODO - return performance.now() -} -// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info -function createOpaqueTimingInfo (timingInfo) { - return { - startTime: timingInfo.startTime ?? 0, - redirectStartTime: 0, - redirectEndTime: 0, - postRedirectStartTime: timingInfo.startTime ?? 0, - finalServiceWorkerStartTime: 0, - finalNetworkResponseStartTime: 0, - finalNetworkRequestStartTime: 0, - endTime: 0, - encodedBodySize: 0, - decodedBodySize: 0, - finalConnectionTimingInfo: null + return super.destroy(err) } -} -// https://html.spec.whatwg.org/multipage/origin.html#policy-container -function makePolicyContainer () { - // Note: the fetch spec doesn't make use of embedder policy or CSP list - return { - referrerPolicy: 'strict-origin-when-cross-origin' + emit (ev, ...args) { + if (ev === 'data') { + // Node < 16.7 + this._readableState.dataEmitted = true + } else if (ev === 'error') { + // Node < 16 + this._readableState.errorEmitted = true + } + return super.emit(ev, ...args) } -} -// https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container -function clonePolicyContainer (policyContainer) { - return { - referrerPolicy: policyContainer.referrerPolicy + on (ev, ...args) { + if (ev === 'data' || ev === 'readable') { + this[kReading] = true + } + return super.on(ev, ...args) } -} - -// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer -function determineRequestsReferrer (request) { - // 1. Let policy be request's referrer policy. - const policy = request.referrerPolicy - - // Note: policy cannot (shouldn't) be null or an empty string. - assert(policy) - // 2. Let environment be request’s client. - - let referrerSource = null + addListener (ev, ...args) { + return this.on(ev, ...args) + } - // 3. Switch on request’s referrer: - if (request.referrer === 'client') { - // Note: node isn't a browser and doesn't implement document/iframes, - // so we bypass this step and replace it with our own. + off (ev, ...args) { + const ret = super.off(ev, ...args) + if (ev === 'data' || ev === 'readable') { + this[kReading] = ( + this.listenerCount('data') > 0 || + this.listenerCount('readable') > 0 + ) + } + return ret + } - const globalOrigin = getGlobalOrigin() + removeListener (ev, ...args) { + return this.off(ev, ...args) + } - if (!globalOrigin || globalOrigin.origin === 'null') { - return 'no-referrer' + push (chunk) { + if (this[kConsume] && chunk !== null && this.readableLength === 0) { + consumePush(this[kConsume], chunk) + return this[kReading] ? super.push(chunk) : true } + return super.push(chunk) + } - // note: we need to clone it as it's mutated - referrerSource = new URL(globalOrigin) - } else if (request.referrer instanceof URL) { - // Let referrerSource be request’s referrer. - referrerSource = request.referrer + // https://fetch.spec.whatwg.org/#dom-body-text + async text () { + return consume(this, 'text') } - // 4. Let request’s referrerURL be the result of stripping referrerSource for - // use as a referrer. - let referrerURL = stripURLForReferrer(referrerSource) + // https://fetch.spec.whatwg.org/#dom-body-json + async json () { + return consume(this, 'json') + } - // 5. Let referrerOrigin be the result of stripping referrerSource for use as - // a referrer, with the origin-only flag set to true. - const referrerOrigin = stripURLForReferrer(referrerSource, true) + // https://fetch.spec.whatwg.org/#dom-body-blob + async blob () { + return consume(this, 'blob') + } - // 6. If the result of serializing referrerURL is a string whose length is - // greater than 4096, set referrerURL to referrerOrigin. - if (referrerURL.toString().length > 4096) { - referrerURL = referrerOrigin + // https://fetch.spec.whatwg.org/#dom-body-arraybuffer + async arrayBuffer () { + return consume(this, 'arrayBuffer') } - const areSameOrigin = sameOrigin(request, referrerURL) - const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) && - !isURLPotentiallyTrustworthy(request.url) + // https://fetch.spec.whatwg.org/#dom-body-formdata + async formData () { + // TODO: Implement. + throw new NotSupportedError() + } - // 8. Execute the switch statements corresponding to the value of policy: - switch (policy) { - case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true) - case 'unsafe-url': return referrerURL - case 'same-origin': - return areSameOrigin ? referrerOrigin : 'no-referrer' - case 'origin-when-cross-origin': - return areSameOrigin ? referrerURL : referrerOrigin - case 'strict-origin-when-cross-origin': { - const currentURL = requestCurrentURL(request) + // https://fetch.spec.whatwg.org/#dom-body-bodyused + get bodyUsed () { + return util.isDisturbed(this) + } - // 1. If the origin of referrerURL and the origin of request’s current - // URL are the same, then return referrerURL. - if (sameOrigin(referrerURL, currentURL)) { - return referrerURL + // https://fetch.spec.whatwg.org/#dom-body-body + get body () { + if (!this[kBody]) { + this[kBody] = ReadableStreamFrom(this) + if (this[kConsume]) { + // TODO: Is this the best way to force a lock? + this[kBody].getReader() // Ensure stream is locked. + assert(this[kBody].locked) } + } + return this[kBody] + } - // 2. If referrerURL is a potentially trustworthy URL and request’s - // current URL is not a potentially trustworthy URL, then return no - // referrer. - if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) { - return 'no-referrer' + dump (opts) { + let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144 + const signal = opts && opts.signal + + if (signal) { + try { + if (typeof signal !== 'object' || !('aborted' in signal)) { + throw new InvalidArgumentError('signal must be an AbortSignal') + } + util.throwIfAborted(signal) + } catch (err) { + return Promise.reject(err) } + } - // 3. Return referrerOrigin. - return referrerOrigin + if (this.closed) { + return Promise.resolve(null) } - case 'strict-origin': // eslint-disable-line - /** - * 1. If referrerURL is a potentially trustworthy URL and - * request’s current URL is not a potentially trustworthy URL, - * then return no referrer. - * 2. Return referrerOrigin - */ - case 'no-referrer-when-downgrade': // eslint-disable-line - /** - * 1. If referrerURL is a potentially trustworthy URL and - * request’s current URL is not a potentially trustworthy URL, - * then return no referrer. - * 2. Return referrerOrigin - */ - default: // eslint-disable-line - return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin + return new Promise((resolve, reject) => { + const signalListenerCleanup = signal + ? util.addAbortListener(signal, () => { + this.destroy() + }) + : noop + + this + .on('close', function () { + signalListenerCleanup() + if (signal && signal.aborted) { + reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' })) + } else { + resolve(null) + } + }) + .on('error', noop) + .on('data', function (chunk) { + limit -= chunk.length + if (limit <= 0) { + this.destroy() + } + }) + .resume() + }) } } -/** - * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url - * @param {URL} url - * @param {boolean|undefined} originOnly - */ -function stripURLForReferrer (url, originOnly) { - // 1. Assert: url is a URL. - assert(url instanceof URL) +// https://streams.spec.whatwg.org/#readablestream-locked +function isLocked (self) { + // Consume is an implicit lock. + return (self[kBody] && self[kBody].locked === true) || self[kConsume] +} - // 2. If url’s scheme is a local scheme, then return no referrer. - if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') { - return 'no-referrer' +// https://fetch.spec.whatwg.org/#body-unusable +function isUnusable (self) { + return util.isDisturbed(self) || isLocked(self) +} + +async function consume (stream, type) { + if (isUnusable(stream)) { + throw new TypeError('unusable') } - // 3. Set url’s username to the empty string. - url.username = '' + assert(!stream[kConsume]) - // 4. Set url’s password to the empty string. - url.password = '' + return new Promise((resolve, reject) => { + stream[kConsume] = { + type, + stream, + resolve, + reject, + length: 0, + body: [] + } - // 5. Set url’s fragment to null. - url.hash = '' + stream + .on('error', function (err) { + consumeFinish(this[kConsume], err) + }) + .on('close', function () { + if (this[kConsume].body !== null) { + consumeFinish(this[kConsume], new RequestAbortedError()) + } + }) - // 6. If the origin-only flag is true, then: - if (originOnly) { - // 1. Set url’s path to « the empty string ». - url.pathname = '' + process.nextTick(consumeStart, stream[kConsume]) + }) +} - // 2. Set url’s query to null. - url.search = '' +function consumeStart (consume) { + if (consume.body === null) { + return } - // 7. Return url. - return url -} + const { _readableState: state } = consume.stream -function isURLPotentiallyTrustworthy (url) { - if (!(url instanceof URL)) { - return false + for (const chunk of state.buffer) { + consumePush(consume, chunk) } - // If child of about, return true - if (url.href === 'about:blank' || url.href === 'about:srcdoc') { - return true + if (state.endEmitted) { + consumeEnd(this[kConsume]) + } else { + consume.stream.on('end', function () { + consumeEnd(this[kConsume]) + }) } - // If scheme is data, return true - if (url.protocol === 'data:') return true - - // If file, return true - if (url.protocol === 'file:') return true + consume.stream.resume() - return isOriginPotentiallyTrustworthy(url.origin) + while (consume.stream.read() != null) { + // Loop + } +} - function isOriginPotentiallyTrustworthy (origin) { - // If origin is explicitly null, return false - if (origin == null || origin === 'null') return false +function consumeEnd (consume) { + const { type, body, resolve, stream, length } = consume - const originAsURL = new URL(origin) + try { + if (type === 'text') { + resolve(toUSVString(Buffer.concat(body))) + } else if (type === 'json') { + resolve(JSON.parse(Buffer.concat(body))) + } else if (type === 'arrayBuffer') { + const dst = new Uint8Array(length) - // If secure, return true - if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') { - return true - } + let pos = 0 + for (const buf of body) { + dst.set(buf, pos) + pos += buf.byteLength + } - // If localhost or variants, return true - if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) || - (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) || - (originAsURL.hostname.endsWith('.localhost'))) { - return true + resolve(dst.buffer) + } else if (type === 'blob') { + if (!Blob) { + Blob = (__nccwpck_require__(14300).Blob) + } + resolve(new Blob(body, { type: stream[kContentType] })) } - // If any other, return false - return false + consumeFinish(consume) + } catch (err) { + stream.destroy(err) } } -/** - * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist - * @param {Uint8Array} bytes - * @param {string} metadataList - */ -function bytesMatch (bytes, metadataList) { - // If node is not built with OpenSSL support, we cannot check - // a request's integrity, so allow it by default (the spec will - // allow requests if an invalid hash is given, as precedence). - /* istanbul ignore if: only if node is built with --without-ssl */ - if (crypto === undefined) { - return true +function consumePush (consume, chunk) { + consume.length += chunk.length + consume.body.push(chunk) +} + +function consumeFinish (consume, err) { + if (consume.body === null) { + return } - // 1. Let parsedMetadata be the result of parsing metadataList. - const parsedMetadata = parseMetadata(metadataList) + if (err) { + consume.reject(err) + } else { + consume.resolve() + } - // 2. If parsedMetadata is no metadata, return true. - if (parsedMetadata === 'no metadata') { - return true + consume.type = null + consume.stream = null + consume.resolve = null + consume.reject = null + consume.length = 0 + consume.body = null +} + + +/***/ }), + +/***/ 48542: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const assert = __nccwpck_require__(39491) +const { + ResponseStatusCodeError +} = __nccwpck_require__(70867) +const { toUSVString } = __nccwpck_require__(43061) + +async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) { + assert(body) + + let chunks = [] + let limit = 0 + + for await (const chunk of body) { + chunks.push(chunk) + limit += chunk.length + if (limit > 128 * 1024) { + chunks = null + break + } } - // 3. If parsedMetadata is the empty set, return true. - if (parsedMetadata.length === 0) { - return true + if (statusCode === 204 || !contentType || !chunks) { + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers)) + return } - // 4. Let metadata be the result of getting the strongest - // metadata from parsedMetadata. - const list = parsedMetadata.sort((c, d) => d.algo.localeCompare(c.algo)) - // get the strongest algorithm - const strongest = list[0].algo - // get all entries that use the strongest algorithm; ignore weaker - const metadata = list.filter((item) => item.algo === strongest) + try { + if (contentType.startsWith('application/json')) { + const payload = JSON.parse(toUSVString(Buffer.concat(chunks))) + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload)) + return + } - // 5. For each item in metadata: - for (const item of metadata) { - // 1. Let algorithm be the alg component of item. - const algorithm = item.algo + if (contentType.startsWith('text/')) { + const payload = toUSVString(Buffer.concat(chunks)) + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload)) + return + } + } catch (err) { + // Process in a fallback if error + } - // 2. Let expectedValue be the val component of item. - let expectedValue = item.hash + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers)) +} - // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e - // "be liberal with padding". This is annoying, and it's not even in the spec. +module.exports = { getResolveErrorBodyCallback } - if (expectedValue.endsWith('==')) { - expectedValue = expectedValue.slice(0, -2) - } - // 3. Let actualValue be the result of applying algorithm to bytes. - let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64') +/***/ }), - if (actualValue.endsWith('==')) { - actualValue = actualValue.slice(0, -2) - } +/***/ 53477: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // 4. If actualValue is a case-sensitive match for expectedValue, - // return true. - if (actualValue === expectedValue) { - return true - } - let actualBase64URL = crypto.createHash(algorithm).update(bytes).digest('base64url') - if (actualBase64URL.endsWith('==')) { - actualBase64URL = actualBase64URL.slice(0, -2) - } +const { + BalancedPoolMissingUpstreamError, + InvalidArgumentError +} = __nccwpck_require__(70867) +const { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kRemoveClient, + kGetDispatcher +} = __nccwpck_require__(76620) +const Pool = __nccwpck_require__(59310) +const { kUrl, kInterceptors } = __nccwpck_require__(69898) +const { parseOrigin } = __nccwpck_require__(43061) +const kFactory = Symbol('factory') - if (actualBase64URL === expectedValue) { - return true - } - } +const kOptions = Symbol('options') +const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor') +const kCurrentWeight = Symbol('kCurrentWeight') +const kIndex = Symbol('kIndex') +const kWeight = Symbol('kWeight') +const kMaxWeightPerServer = Symbol('kMaxWeightPerServer') +const kErrorPenalty = Symbol('kErrorPenalty') - // 6. Return false. - return false +function getGreatestCommonDivisor (a, b) { + if (b === 0) return a + return getGreatestCommonDivisor(b, a % b) } -// https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options -// https://www.w3.org/TR/CSP2/#source-list-syntax -// https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1 -const parseHashWithOptions = /((?sha256|sha384|sha512)-(?[A-z0-9+/]{1}.*={0,2}))( +[\x21-\x7e]?)?/i - -/** - * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata - * @param {string} metadata - */ -function parseMetadata (metadata) { - // 1. Let result be the empty set. - /** @type {{ algo: string, hash: string }[]} */ - const result = [] +function defaultFactory (origin, opts) { + return new Pool(origin, opts) +} - // 2. Let empty be equal to true. - let empty = true +class BalancedPool extends PoolBase { + constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) { + super() - const supportedHashes = crypto.getHashes() + this[kOptions] = opts + this[kIndex] = -1 + this[kCurrentWeight] = 0 - // 3. For each token returned by splitting metadata on spaces: - for (const token of metadata.split(' ')) { - // 1. Set empty to false. - empty = false + this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100 + this[kErrorPenalty] = this[kOptions].errorPenalty || 15 - // 2. Parse token as a hash-with-options. - const parsedToken = parseHashWithOptions.exec(token) + if (!Array.isArray(upstreams)) { + upstreams = [upstreams] + } - // 3. If token does not parse, continue to the next token. - if (parsedToken === null || parsedToken.groups === undefined) { - // Note: Chromium blocks the request at this point, but Firefox - // gives a warning that an invalid integrity was given. The - // correct behavior is to ignore these, and subsequently not - // check the integrity of the resource. - continue + if (typeof factory !== 'function') { + throw new InvalidArgumentError('factory must be a function.') } - // 4. Let algorithm be the hash-algo component of token. - const algorithm = parsedToken.groups.algo + this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool) + ? opts.interceptors.BalancedPool + : [] + this[kFactory] = factory - // 5. If algorithm is a hash function recognized by the user - // agent, add the parsed token to result. - if (supportedHashes.includes(algorithm.toLowerCase())) { - result.push(parsedToken.groups) + for (const upstream of upstreams) { + this.addUpstream(upstream) } + this._updateBalancedPoolStats() } - // 4. Return no metadata if empty is true, otherwise return result. - if (empty === true) { - return 'no metadata' - } - - return result -} + addUpstream (upstream) { + const upstreamOrigin = parseOrigin(upstream).origin -// https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request -function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) { - // TODO -} + if (this[kClients].find((pool) => ( + pool[kUrl].origin === upstreamOrigin && + pool.closed !== true && + pool.destroyed !== true + ))) { + return this + } + const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions])) -/** - * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin} - * @param {URL} A - * @param {URL} B - */ -function sameOrigin (A, B) { - // 1. If A and B are the same opaque origin, then return true. - if (A.origin === B.origin && A.origin === 'null') { - return true - } + this[kAddClient](pool) + pool.on('connect', () => { + pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty]) + }) - // 2. If A and B are both tuple origins and their schemes, - // hosts, and port are identical, then return true. - if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) { - return true - } + pool.on('connectionError', () => { + pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]) + this._updateBalancedPoolStats() + }) - // 3. Return false. - return false -} + pool.on('disconnect', (...args) => { + const err = args[2] + if (err && err.code === 'UND_ERR_SOCKET') { + // decrease the weight of the pool. + pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]) + this._updateBalancedPoolStats() + } + }) -function createDeferredPromise () { - let res - let rej - const promise = new Promise((resolve, reject) => { - res = resolve - rej = reject - }) + for (const client of this[kClients]) { + client[kWeight] = this[kMaxWeightPerServer] + } - return { promise, resolve: res, reject: rej } -} + this._updateBalancedPoolStats() -function isAborted (fetchParams) { - return fetchParams.controller.state === 'aborted' -} + return this + } -function isCancelled (fetchParams) { - return fetchParams.controller.state === 'aborted' || - fetchParams.controller.state === 'terminated' -} + _updateBalancedPoolStats () { + this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0) + } -const normalizeMethodRecord = { - delete: 'DELETE', - DELETE: 'DELETE', - get: 'GET', - GET: 'GET', - head: 'HEAD', - HEAD: 'HEAD', - options: 'OPTIONS', - OPTIONS: 'OPTIONS', - post: 'POST', - POST: 'POST', - put: 'PUT', - PUT: 'PUT' -} + removeUpstream (upstream) { + const upstreamOrigin = parseOrigin(upstream).origin -// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`. -Object.setPrototypeOf(normalizeMethodRecord, null) + const pool = this[kClients].find((pool) => ( + pool[kUrl].origin === upstreamOrigin && + pool.closed !== true && + pool.destroyed !== true + )) -/** - * @see https://fetch.spec.whatwg.org/#concept-method-normalize - * @param {string} method - */ -function normalizeMethod (method) { - return normalizeMethodRecord[method.toLowerCase()] ?? method -} + if (pool) { + this[kRemoveClient](pool) + } -// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string -function serializeJavascriptValueToJSONString (value) { - // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »). - const result = JSON.stringify(value) + return this + } - // 2. If result is undefined, then throw a TypeError. - if (result === undefined) { - throw new TypeError('Value is not JSON serializable') + get upstreams () { + return this[kClients] + .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true) + .map((p) => p[kUrl].origin) } - // 3. Assert: result is a string. - assert(typeof result === 'string') + [kGetDispatcher] () { + // We validate that pools is greater than 0, + // otherwise we would have to wait until an upstream + // is added, which might never happen. + if (this[kClients].length === 0) { + throw new BalancedPoolMissingUpstreamError() + } - // 4. Return result. - return result -} + const dispatcher = this[kClients].find(dispatcher => ( + !dispatcher[kNeedDrain] && + dispatcher.closed !== true && + dispatcher.destroyed !== true + )) -// https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object -const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())) + if (!dispatcher) { + return + } -/** - * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object - * @param {() => unknown[]} iterator - * @param {string} name name of the instance - * @param {'key'|'value'|'key+value'} kind - */ -function makeIterator (iterator, name, kind) { - const object = { - index: 0, - kind, - target: iterator - } + const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true) - const i = { - next () { - // 1. Let interface be the interface for which the iterator prototype object exists. + if (allClientsBusy) { + return + } - // 2. Let thisValue be the this value. + let counter = 0 - // 3. Let object be ? ToObject(thisValue). + let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain]) - // 4. If object is a platform object, then perform a security - // check, passing: + while (counter++ < this[kClients].length) { + this[kIndex] = (this[kIndex] + 1) % this[kClients].length + const pool = this[kClients][this[kIndex]] - // 5. If object is not a default iterator object for interface, - // then throw a TypeError. - if (Object.getPrototypeOf(this) !== i) { - throw new TypeError( - `'next' called on an object that does not implement interface ${name} Iterator.` - ) + // find pool index with the largest weight + if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) { + maxWeightIndex = this[kIndex] } - // 6. Let index be object’s index. - // 7. Let kind be object’s kind. - // 8. Let values be object’s target's value pairs to iterate over. - const { index, kind, target } = object - const values = target() - - // 9. Let len be the length of values. - const len = values.length + // decrease the current weight every `this[kClients].length`. + if (this[kIndex] === 0) { + // Set the current weight to the next lower weight. + this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor] - // 10. If index is greater than or equal to len, then return - // CreateIterResultObject(undefined, true). - if (index >= len) { - return { value: undefined, done: true } + if (this[kCurrentWeight] <= 0) { + this[kCurrentWeight] = this[kMaxWeightPerServer] + } + } + if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) { + return pool } + } - // 11. Let pair be the entry in values at index index. - const pair = values[index] + this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight] + this[kIndex] = maxWeightIndex + return this[kClients][maxWeightIndex] + } +} - // 12. Set object’s index to index + 1. - object.index = index + 1 +module.exports = BalancedPool - // 13. Return the iterator result for pair and kind. - return iteratorResult(pair, kind) - }, - // The class string of an iterator prototype object for a given interface is the - // result of concatenating the identifier of the interface and the string " Iterator". - [Symbol.toStringTag]: `${name} Iterator` - } - // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%. - Object.setPrototypeOf(i, esIteratorPrototype) - // esIteratorPrototype needs to be the prototype of i - // which is the prototype of an empty object. Yes, it's confusing. - return Object.setPrototypeOf({}, i) -} +/***/ }), -// https://webidl.spec.whatwg.org/#iterator-result -function iteratorResult (pair, kind) { - let result +/***/ 33272: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // 1. Let result be a value determined by the value of kind: - switch (kind) { - case 'key': { - // 1. Let idlKey be pair’s key. - // 2. Let key be the result of converting idlKey to an - // ECMAScript value. - // 3. result is key. - result = pair[0] - break - } - case 'value': { - // 1. Let idlValue be pair’s value. - // 2. Let value be the result of converting idlValue to - // an ECMAScript value. - // 3. result is value. - result = pair[1] - break - } - case 'key+value': { - // 1. Let idlKey be pair’s key. - // 2. Let idlValue be pair’s value. - // 3. Let key be the result of converting idlKey to an - // ECMAScript value. - // 4. Let value be the result of converting idlValue to - // an ECMAScript value. - // 5. Let array be ! ArrayCreate(2). - // 6. Call ! CreateDataProperty(array, "0", key). - // 7. Call ! CreateDataProperty(array, "1", value). - // 8. result is array. - result = pair - break - } - } - // 2. Return CreateIterResultObject(result, false). - return { value: result, done: false } -} + +const { kConstruct } = __nccwpck_require__(99483) +const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(86417) +const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(43061) +const { kHeadersList } = __nccwpck_require__(69898) +const { webidl } = __nccwpck_require__(7000) +const { Response, cloneResponse } = __nccwpck_require__(40599) +const { Request } = __nccwpck_require__(20366) +const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(10730) +const { fetching } = __nccwpck_require__(37215) +const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(47794) +const assert = __nccwpck_require__(39491) +const { getGlobalDispatcher } = __nccwpck_require__(94330) /** - * @see https://fetch.spec.whatwg.org/#body-fully-read + * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation + * @typedef {Object} CacheBatchOperation + * @property {'delete' | 'put'} type + * @property {any} request + * @property {any} response + * @property {import('../../types/cache').CacheQueryOptions} options */ -async function fullyReadBody (body, processBody, processBodyError) { - // 1. If taskDestination is null, then set taskDestination to - // the result of starting a new parallel queue. - // 2. Let successSteps given a byte sequence bytes be to queue a - // fetch task to run processBody given bytes, with taskDestination. - const successSteps = processBody +/** + * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list + * @typedef {[any, any][]} requestResponseList + */ - // 3. Let errorSteps be to queue a fetch task to run processBodyError, - // with taskDestination. - const errorSteps = processBodyError +class Cache { + /** + * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list + * @type {requestResponseList} + */ + #relevantRequestResponseList - // 4. Let reader be the result of getting a reader for body’s stream. - // If that threw an exception, then run errorSteps with that - // exception and return. - let reader + constructor () { + if (arguments[0] !== kConstruct) { + webidl.illegalConstructor() + } - try { - reader = body.stream.getReader() - } catch (e) { - errorSteps(e) - return + this.#relevantRequestResponseList = arguments[1] } - // 5. Read all bytes from reader, given successSteps and errorSteps. - try { - const result = await readAllBytes(reader) - successSteps(result) - } catch (e) { - errorSteps(e) - } -} + async match (request, options = {}) { + webidl.brandCheck(this, Cache) + webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' }) -/** @type {ReadableStream} */ -let ReadableStream = globalThis.ReadableStream + request = webidl.converters.RequestInfo(request) + options = webidl.converters.CacheQueryOptions(options) -function isReadableStreamLike (stream) { - if (!ReadableStream) { - ReadableStream = (__nccwpck_require__(35356).ReadableStream) - } + const p = await this.matchAll(request, options) - return stream instanceof ReadableStream || ( - stream[Symbol.toStringTag] === 'ReadableStream' && - typeof stream.tee === 'function' - ) -} + if (p.length === 0) { + return + } -const MAXIMUM_ARGUMENT_LENGTH = 65535 + return p[0] + } -/** - * @see https://infra.spec.whatwg.org/#isomorphic-decode - * @param {number[]|Uint8Array} input - */ -function isomorphicDecode (input) { - // 1. To isomorphic decode a byte sequence input, return a string whose code point - // length is equal to input’s length and whose code points have the same values - // as the values of input’s bytes, in the same order. + async matchAll (request = undefined, options = {}) { + webidl.brandCheck(this, Cache) - if (input.length < MAXIMUM_ARGUMENT_LENGTH) { - return String.fromCharCode(...input) - } + if (request !== undefined) request = webidl.converters.RequestInfo(request) + options = webidl.converters.CacheQueryOptions(options) - return input.reduce((previous, current) => previous + String.fromCharCode(current), '') -} + // 1. + let r = null -/** - * @param {ReadableStreamController} controller - */ -function readableStreamClose (controller) { - try { - controller.close() - } catch (err) { - // TODO: add comment explaining why this error occurs. - if (!err.message.includes('Controller is already closed')) { - throw err + // 2. + if (request !== undefined) { + if (request instanceof Request) { + // 2.1.1 + r = request[kState] + + // 2.1.2 + if (r.method !== 'GET' && !options.ignoreMethod) { + return [] + } + } else if (typeof request === 'string') { + // 2.2.1 + r = new Request(request)[kState] + } } - } -} -/** - * @see https://infra.spec.whatwg.org/#isomorphic-encode - * @param {string} input - */ -function isomorphicEncode (input) { - // 1. Assert: input contains no code points greater than U+00FF. - for (let i = 0; i < input.length; i++) { - assert(input.charCodeAt(i) <= 0xFF) - } + // 5. + // 5.1 + const responses = [] - // 2. Return a byte sequence whose length is equal to input’s code - // point length and whose bytes have the same values as the - // values of input’s code points, in the same order - return input -} + // 5.2 + if (request === undefined) { + // 5.2.1 + for (const requestResponse of this.#relevantRequestResponseList) { + responses.push(requestResponse[1]) + } + } else { // 5.3 + // 5.3.1 + const requestResponses = this.#queryCache(r, options) -/** - * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes - * @see https://streams.spec.whatwg.org/#read-loop - * @param {ReadableStreamDefaultReader} reader - */ -async function readAllBytes (reader) { - const bytes = [] - let byteLength = 0 + // 5.3.2 + for (const requestResponse of requestResponses) { + responses.push(requestResponse[1]) + } + } - while (true) { - const { done, value: chunk } = await reader.read() + // 5.4 + // We don't implement CORs so we don't need to loop over the responses, yay! - if (done) { - // 1. Call successSteps with bytes. - return Buffer.concat(bytes, byteLength) - } + // 5.5.1 + const responseList = [] - // 1. If chunk is not a Uint8Array object, call failureSteps - // with a TypeError and abort these steps. - if (!isUint8Array(chunk)) { - throw new TypeError('Received non-Uint8Array chunk') - } + // 5.5.2 + for (const response of responses) { + // 5.5.2.1 + const responseObject = new Response(response.body?.source ?? null) + const body = responseObject[kState].body + responseObject[kState] = response + responseObject[kState].body = body + responseObject[kHeaders][kHeadersList] = response.headersList + responseObject[kHeaders][kGuard] = 'immutable' - // 2. Append the bytes represented by chunk to bytes. - bytes.push(chunk) - byteLength += chunk.length + responseList.push(responseObject) + } - // 3. Read-loop given reader, bytes, successSteps, and failureSteps. + // 6. + return Object.freeze(responseList) } -} -/** - * @see https://fetch.spec.whatwg.org/#is-local - * @param {URL} url - */ -function urlIsLocal (url) { - assert('protocol' in url) // ensure it's a url object + async add (request) { + webidl.brandCheck(this, Cache) + webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' }) - const protocol = url.protocol + request = webidl.converters.RequestInfo(request) - return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:' -} + // 1. + const requests = [request] -/** - * @param {string|URL} url - */ -function urlHasHttpsScheme (url) { - if (typeof url === 'string') { - return url.startsWith('https:') + // 2. + const responseArrayPromise = this.addAll(requests) + + // 3. + return await responseArrayPromise } - return url.protocol === 'https:' -} + async addAll (requests) { + webidl.brandCheck(this, Cache) + webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' }) -/** - * @see https://fetch.spec.whatwg.org/#http-scheme - * @param {URL} url - */ -function urlIsHttpHttpsScheme (url) { - assert('protocol' in url) // ensure it's a url object + requests = webidl.converters['sequence'](requests) - const protocol = url.protocol + // 1. + const responsePromises = [] - return protocol === 'http:' || protocol === 'https:' -} + // 2. + const requestList = [] -/** - * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0. - */ -const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key)) + // 3. + for (const request of requests) { + if (typeof request === 'string') { + continue + } -module.exports = { - isAborted, - isCancelled, - createDeferredPromise, - ReadableStreamFrom, - toUSVString, - tryUpgradeRequestToAPotentiallyTrustworthyURL, - coarsenedSharedCurrentTime, - determineRequestsReferrer, - makePolicyContainer, - clonePolicyContainer, - appendFetchMetadata, - appendRequestOriginHeader, - TAOCheck, - corsCheck, - crossOriginResourcePolicyCheck, - createOpaqueTimingInfo, - setRequestReferrerPolicyOnRedirect, - isValidHTTPToken, - requestBadPort, - requestCurrentURL, - responseURL, - responseLocationURL, - isBlobLike, - isURLPotentiallyTrustworthy, - isValidReasonPhrase, - sameOrigin, - normalizeMethod, - serializeJavascriptValueToJSONString, - makeIterator, - isValidHeaderName, - isValidHeaderValue, - hasOwn, - isErrorLike, - fullyReadBody, - bytesMatch, - isReadableStreamLike, - readableStreamClose, - isomorphicEncode, - isomorphicDecode, - urlIsLocal, - urlHasHttpsScheme, - urlIsHttpHttpsScheme, - readAllBytes, - normalizeMethodRecord -} + // 3.1 + const r = request[kState] + // 3.2 + if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') { + throw webidl.errors.exception({ + header: 'Cache.addAll', + message: 'Expected http/s scheme when method is not GET.' + }) + } + } -/***/ }), + // 4. + /** @type {ReturnType[]} */ + const fetchControllers = [] -/***/ 96138: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // 5. + for (const request of requests) { + // 5.1 + const r = new Request(request)[kState] + // 5.2 + if (!urlIsHttpHttpsScheme(r.url)) { + throw webidl.errors.exception({ + header: 'Cache.addAll', + message: 'Expected http/s scheme.' + }) + } + // 5.4 + r.initiator = 'fetch' + r.destination = 'subresource' -const { types } = __nccwpck_require__(73837) -const { hasOwn, toUSVString } = __nccwpck_require__(79453) + // 5.5 + requestList.push(r) -/** @type {import('../../types/webidl').Webidl} */ -const webidl = {} -webidl.converters = {} -webidl.util = {} -webidl.errors = {} + // 5.6 + const responsePromise = createDeferredPromise() -webidl.errors.exception = function (message) { - return new TypeError(`${message.header}: ${message.message}`) -} + // 5.7 + fetchControllers.push(fetching({ + request: r, + dispatcher: getGlobalDispatcher(), + processResponse (response) { + // 1. + if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) { + responsePromise.reject(webidl.errors.exception({ + header: 'Cache.addAll', + message: 'Received an invalid status code or the request failed.' + })) + } else if (response.headersList.contains('vary')) { // 2. + // 2.1 + const fieldValues = getFieldValues(response.headersList.get('vary')) -webidl.errors.conversionFailed = function (context) { - const plural = context.types.length === 1 ? '' : ' one of' - const message = - `${context.argument} could not be converted to` + - `${plural}: ${context.types.join(', ')}.` + // 2.2 + for (const fieldValue of fieldValues) { + // 2.2.1 + if (fieldValue === '*') { + responsePromise.reject(webidl.errors.exception({ + header: 'Cache.addAll', + message: 'invalid vary field value' + })) - return webidl.errors.exception({ - header: context.prefix, - message - }) -} + for (const controller of fetchControllers) { + controller.abort() + } -webidl.errors.invalidArgument = function (context) { - return webidl.errors.exception({ - header: context.prefix, - message: `"${context.value}" is an invalid ${context.type}.` - }) -} + return + } + } + } + }, + processResponseEndOfBody (response) { + // 1. + if (response.aborted) { + responsePromise.reject(new DOMException('aborted', 'AbortError')) + return + } -// https://webidl.spec.whatwg.org/#implements -webidl.brandCheck = function (V, I, opts = undefined) { - if (opts?.strict !== false && !(V instanceof I)) { - throw new TypeError('Illegal invocation') - } else { - return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag] - } -} + // 2. + responsePromise.resolve(response) + } + })) -webidl.argumentLengthCheck = function ({ length }, min, ctx) { - if (length < min) { - throw webidl.errors.exception({ - message: `${min} argument${min !== 1 ? 's' : ''} required, ` + - `but${length ? ' only' : ''} ${length} found.`, - ...ctx - }) - } -} + // 5.8 + responsePromises.push(responsePromise.promise) + } -webidl.illegalConstructor = function () { - throw webidl.errors.exception({ - header: 'TypeError', - message: 'Illegal constructor' - }) -} + // 6. + const p = Promise.all(responsePromises) -// https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values -webidl.util.Type = function (V) { - switch (typeof V) { - case 'undefined': return 'Undefined' - case 'boolean': return 'Boolean' - case 'string': return 'String' - case 'symbol': return 'Symbol' - case 'number': return 'Number' - case 'bigint': return 'BigInt' - case 'function': - case 'object': { - if (V === null) { - return 'Null' + // 7. + const responses = await p + + // 7.1 + const operations = [] + + // 7.2 + let index = 0 + + // 7.3 + for (const response of responses) { + // 7.3.1 + /** @type {CacheBatchOperation} */ + const operation = { + type: 'put', // 7.3.2 + request: requestList[index], // 7.3.3 + response // 7.3.4 } - return 'Object' + operations.push(operation) // 7.3.5 + + index++ // 7.3.6 } - } -} -// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint -webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) { - let upperBound - let lowerBound + // 7.5 + const cacheJobPromise = createDeferredPromise() - // 1. If bitLength is 64, then: - if (bitLength === 64) { - // 1. Let upperBound be 2^53 − 1. - upperBound = Math.pow(2, 53) - 1 + // 7.6.1 + let errorData = null - // 2. If signedness is "unsigned", then let lowerBound be 0. - if (signedness === 'unsigned') { - lowerBound = 0 - } else { - // 3. Otherwise let lowerBound be −2^53 + 1. - lowerBound = Math.pow(-2, 53) + 1 + // 7.6.2 + try { + this.#batchCacheOperations(operations) + } catch (e) { + errorData = e } - } else if (signedness === 'unsigned') { - // 2. Otherwise, if signedness is "unsigned", then: - // 1. Let lowerBound be 0. - lowerBound = 0 + // 7.6.3 + queueMicrotask(() => { + // 7.6.3.1 + if (errorData === null) { + cacheJobPromise.resolve(undefined) + } else { + // 7.6.3.2 + cacheJobPromise.reject(errorData) + } + }) - // 2. Let upperBound be 2^bitLength − 1. - upperBound = Math.pow(2, bitLength) - 1 - } else { - // 3. Otherwise: + // 7.7 + return cacheJobPromise.promise + } - // 1. Let lowerBound be -2^bitLength − 1. - lowerBound = Math.pow(-2, bitLength) - 1 + async put (request, response) { + webidl.brandCheck(this, Cache) + webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' }) - // 2. Let upperBound be 2^bitLength − 1 − 1. - upperBound = Math.pow(2, bitLength - 1) - 1 - } + request = webidl.converters.RequestInfo(request) + response = webidl.converters.Response(response) - // 4. Let x be ? ToNumber(V). - let x = Number(V) + // 1. + let innerRequest = null - // 5. If x is −0, then set x to +0. - if (x === 0) { - x = 0 - } + // 2. + if (request instanceof Request) { + innerRequest = request[kState] + } else { // 3. + innerRequest = new Request(request)[kState] + } - // 6. If the conversion is to an IDL type associated - // with the [EnforceRange] extended attribute, then: - if (opts.enforceRange === true) { - // 1. If x is NaN, +∞, or −∞, then throw a TypeError. - if ( - Number.isNaN(x) || - x === Number.POSITIVE_INFINITY || - x === Number.NEGATIVE_INFINITY - ) { + // 4. + if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') { throw webidl.errors.exception({ - header: 'Integer conversion', - message: `Could not convert ${V} to an integer.` + header: 'Cache.put', + message: 'Expected an http/s scheme when method is not GET' }) } - // 2. Set x to IntegerPart(x). - x = webidl.util.IntegerPart(x) + // 5. + const innerResponse = response[kState] - // 3. If x < lowerBound or x > upperBound, then - // throw a TypeError. - if (x < lowerBound || x > upperBound) { + // 6. + if (innerResponse.status === 206) { throw webidl.errors.exception({ - header: 'Integer conversion', - message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.` + header: 'Cache.put', + message: 'Got 206 status' }) } - // 4. Return x. - return x - } + // 7. + if (innerResponse.headersList.contains('vary')) { + // 7.1. + const fieldValues = getFieldValues(innerResponse.headersList.get('vary')) - // 7. If x is not NaN and the conversion is to an IDL - // type associated with the [Clamp] extended - // attribute, then: - if (!Number.isNaN(x) && opts.clamp === true) { - // 1. Set x to min(max(x, lowerBound), upperBound). - x = Math.min(Math.max(x, lowerBound), upperBound) + // 7.2. + for (const fieldValue of fieldValues) { + // 7.2.1 + if (fieldValue === '*') { + throw webidl.errors.exception({ + header: 'Cache.put', + message: 'Got * vary field value' + }) + } + } + } - // 2. Round x to the nearest integer, choosing the - // even integer if it lies halfway between two, - // and choosing +0 rather than −0. - if (Math.floor(x) % 2 === 0) { - x = Math.floor(x) + // 8. + if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) { + throw webidl.errors.exception({ + header: 'Cache.put', + message: 'Response body is locked or disturbed' + }) + } + + // 9. + const clonedResponse = cloneResponse(innerResponse) + + // 10. + const bodyReadPromise = createDeferredPromise() + + // 11. + if (innerResponse.body != null) { + // 11.1 + const stream = innerResponse.body.stream + + // 11.2 + const reader = stream.getReader() + + // 11.3 + readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject) } else { - x = Math.ceil(x) + bodyReadPromise.resolve(undefined) } - // 3. Return x. - return x - } + // 12. + /** @type {CacheBatchOperation[]} */ + const operations = [] - // 8. If x is NaN, +0, +∞, or −∞, then return +0. - if ( - Number.isNaN(x) || - (x === 0 && Object.is(0, x)) || - x === Number.POSITIVE_INFINITY || - x === Number.NEGATIVE_INFINITY - ) { - return 0 - } + // 13. + /** @type {CacheBatchOperation} */ + const operation = { + type: 'put', // 14. + request: innerRequest, // 15. + response: clonedResponse // 16. + } + + // 17. + operations.push(operation) + + // 19. + const bytes = await bodyReadPromise.promise + + if (clonedResponse.body != null) { + clonedResponse.body.source = bytes + } + + // 19.1 + const cacheJobPromise = createDeferredPromise() + + // 19.2.1 + let errorData = null - // 9. Set x to IntegerPart(x). - x = webidl.util.IntegerPart(x) + // 19.2.2 + try { + this.#batchCacheOperations(operations) + } catch (e) { + errorData = e + } - // 10. Set x to x modulo 2^bitLength. - x = x % Math.pow(2, bitLength) + // 19.2.3 + queueMicrotask(() => { + // 19.2.3.1 + if (errorData === null) { + cacheJobPromise.resolve() + } else { // 19.2.3.2 + cacheJobPromise.reject(errorData) + } + }) - // 11. If signedness is "signed" and x ≥ 2^bitLength − 1, - // then return x − 2^bitLength. - if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) { - return x - Math.pow(2, bitLength) + return cacheJobPromise.promise } - // 12. Otherwise, return x. - return x -} + async delete (request, options = {}) { + webidl.brandCheck(this, Cache) + webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' }) -// https://webidl.spec.whatwg.org/#abstract-opdef-integerpart -webidl.util.IntegerPart = function (n) { - // 1. Let r be floor(abs(n)). - const r = Math.floor(Math.abs(n)) + request = webidl.converters.RequestInfo(request) + options = webidl.converters.CacheQueryOptions(options) - // 2. If n < 0, then return -1 × r. - if (n < 0) { - return -1 * r - } + /** + * @type {Request} + */ + let r = null - // 3. Otherwise, return r. - return r -} + if (request instanceof Request) { + r = request[kState] -// https://webidl.spec.whatwg.org/#es-sequence -webidl.sequenceConverter = function (converter) { - return (V) => { - // 1. If Type(V) is not Object, throw a TypeError. - if (webidl.util.Type(V) !== 'Object') { - throw webidl.errors.exception({ - header: 'Sequence', - message: `Value of type ${webidl.util.Type(V)} is not an Object.` - }) + if (r.method !== 'GET' && !options.ignoreMethod) { + return false + } + } else { + assert(typeof request === 'string') + + r = new Request(request)[kState] } - // 2. Let method be ? GetMethod(V, @@iterator). - /** @type {Generator} */ - const method = V?.[Symbol.iterator]?.() - const seq = [] + /** @type {CacheBatchOperation[]} */ + const operations = [] - // 3. If method is undefined, throw a TypeError. - if ( - method === undefined || - typeof method.next !== 'function' - ) { - throw webidl.errors.exception({ - header: 'Sequence', - message: 'Object is not an iterator.' - }) + /** @type {CacheBatchOperation} */ + const operation = { + type: 'delete', + request: r, + options } - // https://webidl.spec.whatwg.org/#create-sequence-from-iterable - while (true) { - const { done, value } = method.next() + operations.push(operation) - if (done) { - break - } + const cacheJobPromise = createDeferredPromise() - seq.push(converter(value)) + let errorData = null + let requestResponses + + try { + requestResponses = this.#batchCacheOperations(operations) + } catch (e) { + errorData = e } - return seq - } -} + queueMicrotask(() => { + if (errorData === null) { + cacheJobPromise.resolve(!!requestResponses?.length) + } else { + cacheJobPromise.reject(errorData) + } + }) -// https://webidl.spec.whatwg.org/#es-to-record -webidl.recordConverter = function (keyConverter, valueConverter) { - return (O) => { - // 1. If Type(O) is not Object, throw a TypeError. - if (webidl.util.Type(O) !== 'Object') { - throw webidl.errors.exception({ - header: 'Record', - message: `Value of type ${webidl.util.Type(O)} is not an Object.` - }) - } + return cacheJobPromise.promise + } - // 2. Let result be a new empty instance of record. - const result = {} + /** + * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys + * @param {any} request + * @param {import('../../types/cache').CacheQueryOptions} options + * @returns {readonly Request[]} + */ + async keys (request = undefined, options = {}) { + webidl.brandCheck(this, Cache) - if (!types.isProxy(O)) { - // Object.keys only returns enumerable properties - const keys = Object.keys(O) + if (request !== undefined) request = webidl.converters.RequestInfo(request) + options = webidl.converters.CacheQueryOptions(options) - for (const key of keys) { - // 1. Let typedKey be key converted to an IDL value of type K. - const typedKey = keyConverter(key) + // 1. + let r = null - // 2. Let value be ? Get(O, key). - // 3. Let typedValue be value converted to an IDL value of type V. - const typedValue = valueConverter(O[key]) + // 2. + if (request !== undefined) { + // 2.1 + if (request instanceof Request) { + // 2.1.1 + r = request[kState] - // 4. Set result[typedKey] to typedValue. - result[typedKey] = typedValue + // 2.1.2 + if (r.method !== 'GET' && !options.ignoreMethod) { + return [] + } + } else if (typeof request === 'string') { // 2.2 + r = new Request(request)[kState] } - - // 5. Return result. - return result } - // 3. Let keys be ? O.[[OwnPropertyKeys]](). - const keys = Reflect.ownKeys(O) - - // 4. For each key of keys. - for (const key of keys) { - // 1. Let desc be ? O.[[GetOwnProperty]](key). - const desc = Reflect.getOwnPropertyDescriptor(O, key) + // 4. + const promise = createDeferredPromise() - // 2. If desc is not undefined and desc.[[Enumerable]] is true: - if (desc?.enumerable) { - // 1. Let typedKey be key converted to an IDL value of type K. - const typedKey = keyConverter(key) + // 5. + // 5.1 + const requests = [] - // 2. Let value be ? Get(O, key). - // 3. Let typedValue be value converted to an IDL value of type V. - const typedValue = valueConverter(O[key]) + // 5.2 + if (request === undefined) { + // 5.2.1 + for (const requestResponse of this.#relevantRequestResponseList) { + // 5.2.1.1 + requests.push(requestResponse[0]) + } + } else { // 5.3 + // 5.3.1 + const requestResponses = this.#queryCache(r, options) - // 4. Set result[typedKey] to typedValue. - result[typedKey] = typedValue + // 5.3.2 + for (const requestResponse of requestResponses) { + // 5.3.2.1 + requests.push(requestResponse[0]) } } - // 5. Return result. - return result - } -} + // 5.4 + queueMicrotask(() => { + // 5.4.1 + const requestList = [] -webidl.interfaceConverter = function (i) { - return (V, opts = {}) => { - if (opts.strict !== false && !(V instanceof i)) { - throw webidl.errors.exception({ - header: i.name, - message: `Expected ${V} to be an instance of ${i.name}.` - }) - } + // 5.4.2 + for (const request of requests) { + const requestObject = new Request('https://a') + requestObject[kState] = request + requestObject[kHeaders][kHeadersList] = request.headersList + requestObject[kHeaders][kGuard] = 'immutable' + requestObject[kRealm] = request.client - return V + // 5.4.2.1 + requestList.push(requestObject) + } + + // 5.4.3 + promise.resolve(Object.freeze(requestList)) + }) + + return promise.promise } -} -webidl.dictionaryConverter = function (converters) { - return (dictionary) => { - const type = webidl.util.Type(dictionary) - const dict = {} + /** + * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm + * @param {CacheBatchOperation[]} operations + * @returns {requestResponseList} + */ + #batchCacheOperations (operations) { + // 1. + const cache = this.#relevantRequestResponseList - if (type === 'Null' || type === 'Undefined') { - return dict - } else if (type !== 'Object') { - throw webidl.errors.exception({ - header: 'Dictionary', - message: `Expected ${dictionary} to be one of: Null, Undefined, Object.` - }) - } + // 2. + const backupCache = [...cache] - for (const options of converters) { - const { key, defaultValue, required, converter } = options + // 3. + const addedItems = [] - if (required === true) { - if (!hasOwn(dictionary, key)) { + // 4.1 + const resultList = [] + + try { + // 4.2 + for (const operation of operations) { + // 4.2.1 + if (operation.type !== 'delete' && operation.type !== 'put') { throw webidl.errors.exception({ - header: 'Dictionary', - message: `Missing required key "${key}".` + header: 'Cache.#batchCacheOperations', + message: 'operation type does not match "delete" or "put"' }) } - } - - let value = dictionary[key] - const hasDefault = hasOwn(options, 'defaultValue') - - // Only use defaultValue if value is undefined and - // a defaultValue options was provided. - if (hasDefault && value !== null) { - value = value ?? defaultValue - } - - // A key can be optional and have no default value. - // When this happens, do not perform a conversion, - // and do not assign the key a value. - if (required || hasDefault || value !== undefined) { - value = converter(value) - if ( - options.allowedValues && - !options.allowedValues.includes(value) - ) { + // 4.2.2 + if (operation.type === 'delete' && operation.response != null) { throw webidl.errors.exception({ - header: 'Dictionary', - message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.` + header: 'Cache.#batchCacheOperations', + message: 'delete operation should not have an associated response' }) } - dict[key] = value - } - } - - return dict - } -} + // 4.2.3 + if (this.#queryCache(operation.request, operation.options, addedItems).length) { + throw new DOMException('???', 'InvalidStateError') + } -webidl.nullableConverter = function (converter) { - return (V) => { - if (V === null) { - return V - } + // 4.2.4 + let requestResponses - return converter(V) - } -} + // 4.2.5 + if (operation.type === 'delete') { + // 4.2.5.1 + requestResponses = this.#queryCache(operation.request, operation.options) -// https://webidl.spec.whatwg.org/#es-DOMString -webidl.converters.DOMString = function (V, opts = {}) { - // 1. If V is null and the conversion is to an IDL type - // associated with the [LegacyNullToEmptyString] - // extended attribute, then return the DOMString value - // that represents the empty string. - if (V === null && opts.legacyNullToEmptyString) { - return '' - } + // TODO: the spec is wrong, this is needed to pass WPTs + if (requestResponses.length === 0) { + return [] + } - // 2. Let x be ? ToString(V). - if (typeof V === 'symbol') { - throw new TypeError('Could not convert argument of type symbol to string.') - } + // 4.2.5.2 + for (const requestResponse of requestResponses) { + const idx = cache.indexOf(requestResponse) + assert(idx !== -1) - // 3. Return the IDL DOMString value that represents the - // same sequence of code units as the one the - // ECMAScript String value x represents. - return String(V) -} + // 4.2.5.2.1 + cache.splice(idx, 1) + } + } else if (operation.type === 'put') { // 4.2.6 + // 4.2.6.1 + if (operation.response == null) { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'put operation should have an associated response' + }) + } -// https://webidl.spec.whatwg.org/#es-ByteString -webidl.converters.ByteString = function (V) { - // 1. Let x be ? ToString(V). - // Note: DOMString converter perform ? ToString(V) - const x = webidl.converters.DOMString(V) + // 4.2.6.2 + const r = operation.request - // 2. If the value of any element of x is greater than - // 255, then throw a TypeError. - for (let index = 0; index < x.length; index++) { - if (x.charCodeAt(index) > 255) { - throw new TypeError( - 'Cannot convert argument to a ByteString because the character at ' + - `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.` - ) - } - } + // 4.2.6.3 + if (!urlIsHttpHttpsScheme(r.url)) { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'expected http or https scheme' + }) + } - // 3. Return an IDL ByteString value whose length is the - // length of x, and where the value of each element is - // the value of the corresponding element of x. - return x -} + // 4.2.6.4 + if (r.method !== 'GET') { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'not get method' + }) + } -// https://webidl.spec.whatwg.org/#es-USVString -webidl.converters.USVString = toUSVString + // 4.2.6.5 + if (operation.options != null) { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'options must not be defined' + }) + } -// https://webidl.spec.whatwg.org/#es-boolean -webidl.converters.boolean = function (V) { - // 1. Let x be the result of computing ToBoolean(V). - const x = Boolean(V) + // 4.2.6.6 + requestResponses = this.#queryCache(operation.request) - // 2. Return the IDL boolean value that is the one that represents - // the same truth value as the ECMAScript Boolean value x. - return x -} + // 4.2.6.7 + for (const requestResponse of requestResponses) { + const idx = cache.indexOf(requestResponse) + assert(idx !== -1) -// https://webidl.spec.whatwg.org/#es-any -webidl.converters.any = function (V) { - return V -} + // 4.2.6.7.1 + cache.splice(idx, 1) + } -// https://webidl.spec.whatwg.org/#es-long-long -webidl.converters['long long'] = function (V) { - // 1. Let x be ? ConvertToInt(V, 64, "signed"). - const x = webidl.util.ConvertToInt(V, 64, 'signed') + // 4.2.6.8 + cache.push([operation.request, operation.response]) - // 2. Return the IDL long long value that represents - // the same numeric value as x. - return x -} + // 4.2.6.10 + addedItems.push([operation.request, operation.response]) + } -// https://webidl.spec.whatwg.org/#es-unsigned-long-long -webidl.converters['unsigned long long'] = function (V) { - // 1. Let x be ? ConvertToInt(V, 64, "unsigned"). - const x = webidl.util.ConvertToInt(V, 64, 'unsigned') + // 4.2.7 + resultList.push([operation.request, operation.response]) + } - // 2. Return the IDL unsigned long long value that - // represents the same numeric value as x. - return x -} + // 4.3 + return resultList + } catch (e) { // 5. + // 5.1 + this.#relevantRequestResponseList.length = 0 -// https://webidl.spec.whatwg.org/#es-unsigned-long -webidl.converters['unsigned long'] = function (V) { - // 1. Let x be ? ConvertToInt(V, 32, "unsigned"). - const x = webidl.util.ConvertToInt(V, 32, 'unsigned') + // 5.2 + this.#relevantRequestResponseList = backupCache - // 2. Return the IDL unsigned long value that - // represents the same numeric value as x. - return x -} + // 5.3 + throw e + } + } -// https://webidl.spec.whatwg.org/#es-unsigned-short -webidl.converters['unsigned short'] = function (V, opts) { - // 1. Let x be ? ConvertToInt(V, 16, "unsigned"). - const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts) + /** + * @see https://w3c.github.io/ServiceWorker/#query-cache + * @param {any} requestQuery + * @param {import('../../types/cache').CacheQueryOptions} options + * @param {requestResponseList} targetStorage + * @returns {requestResponseList} + */ + #queryCache (requestQuery, options, targetStorage) { + /** @type {requestResponseList} */ + const resultList = [] - // 2. Return the IDL unsigned short value that represents - // the same numeric value as x. - return x -} + const storage = targetStorage ?? this.#relevantRequestResponseList -// https://webidl.spec.whatwg.org/#idl-ArrayBuffer -webidl.converters.ArrayBuffer = function (V, opts = {}) { - // 1. If Type(V) is not Object, or V does not have an - // [[ArrayBufferData]] internal slot, then throw a - // TypeError. - // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances - // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances - if ( - webidl.util.Type(V) !== 'Object' || - !types.isAnyArrayBuffer(V) - ) { - throw webidl.errors.conversionFailed({ - prefix: `${V}`, - argument: `${V}`, - types: ['ArrayBuffer'] - }) - } + for (const requestResponse of storage) { + const [cachedRequest, cachedResponse] = requestResponse + if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) { + resultList.push(requestResponse) + } + } - // 2. If the conversion is not to an IDL type associated - // with the [AllowShared] extended attribute, and - // IsSharedArrayBuffer(V) is true, then throw a - // TypeError. - if (opts.allowShared === false && types.isSharedArrayBuffer(V)) { - throw webidl.errors.exception({ - header: 'ArrayBuffer', - message: 'SharedArrayBuffer is not allowed.' - }) + return resultList } - // 3. If the conversion is not to an IDL type associated - // with the [AllowResizable] extended attribute, and - // IsResizableArrayBuffer(V) is true, then throw a - // TypeError. - // Note: resizable ArrayBuffers are currently a proposal. + /** + * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm + * @param {any} requestQuery + * @param {any} request + * @param {any | null} response + * @param {import('../../types/cache').CacheQueryOptions | undefined} options + * @returns {boolean} + */ + #requestMatchesCachedItem (requestQuery, request, response = null, options) { + // if (options?.ignoreMethod === false && request.method === 'GET') { + // return false + // } - // 4. Return the IDL ArrayBuffer value that is a - // reference to the same object as V. - return V -} + const queryURL = new URL(requestQuery.url) -webidl.converters.TypedArray = function (V, T, opts = {}) { - // 1. Let T be the IDL type V is being converted to. + const cachedURL = new URL(request.url) - // 2. If Type(V) is not Object, or V does not have a - // [[TypedArrayName]] internal slot with a value - // equal to T’s name, then throw a TypeError. - if ( - webidl.util.Type(V) !== 'Object' || - !types.isTypedArray(V) || - V.constructor.name !== T.name - ) { - throw webidl.errors.conversionFailed({ - prefix: `${T.name}`, - argument: `${V}`, - types: [T.name] - }) - } + if (options?.ignoreSearch) { + cachedURL.search = '' - // 3. If the conversion is not to an IDL type associated - // with the [AllowShared] extended attribute, and - // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is - // true, then throw a TypeError. - if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) { - throw webidl.errors.exception({ - header: 'ArrayBuffer', - message: 'SharedArrayBuffer is not allowed.' - }) - } + queryURL.search = '' + } - // 4. If the conversion is not to an IDL type associated - // with the [AllowResizable] extended attribute, and - // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is - // true, then throw a TypeError. - // Note: resizable array buffers are currently a proposal + if (!urlEquals(queryURL, cachedURL, true)) { + return false + } - // 5. Return the IDL value of type T that is a reference - // to the same object as V. - return V -} + if ( + response == null || + options?.ignoreVary || + !response.headersList.contains('vary') + ) { + return true + } -webidl.converters.DataView = function (V, opts = {}) { - // 1. If Type(V) is not Object, or V does not have a - // [[DataView]] internal slot, then throw a TypeError. - if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) { - throw webidl.errors.exception({ - header: 'DataView', - message: 'Object is not a DataView.' - }) - } + const fieldValues = getFieldValues(response.headersList.get('vary')) - // 2. If the conversion is not to an IDL type associated - // with the [AllowShared] extended attribute, and - // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true, - // then throw a TypeError. - if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) { - throw webidl.errors.exception({ - header: 'ArrayBuffer', - message: 'SharedArrayBuffer is not allowed.' - }) - } + for (const fieldValue of fieldValues) { + if (fieldValue === '*') { + return false + } - // 3. If the conversion is not to an IDL type associated - // with the [AllowResizable] extended attribute, and - // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is - // true, then throw a TypeError. - // Note: resizable ArrayBuffers are currently a proposal + const requestValue = request.headersList.get(fieldValue) + const queryValue = requestQuery.headersList.get(fieldValue) - // 4. Return the IDL DataView value that is a reference - // to the same object as V. - return V -} + // If one has the header and the other doesn't, or one has + // a different value than the other, return false + if (requestValue !== queryValue) { + return false + } + } -// https://webidl.spec.whatwg.org/#BufferSource -webidl.converters.BufferSource = function (V, opts = {}) { - if (types.isAnyArrayBuffer(V)) { - return webidl.converters.ArrayBuffer(V, opts) + return true } +} - if (types.isTypedArray(V)) { - return webidl.converters.TypedArray(V, V.constructor) - } +Object.defineProperties(Cache.prototype, { + [Symbol.toStringTag]: { + value: 'Cache', + configurable: true + }, + match: kEnumerableProperty, + matchAll: kEnumerableProperty, + add: kEnumerableProperty, + addAll: kEnumerableProperty, + put: kEnumerableProperty, + delete: kEnumerableProperty, + keys: kEnumerableProperty +}) - if (types.isDataView(V)) { - return webidl.converters.DataView(V, opts) +const cacheQueryOptionConverters = [ + { + key: 'ignoreSearch', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'ignoreMethod', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'ignoreVary', + converter: webidl.converters.boolean, + defaultValue: false } +] - throw new TypeError(`Could not convert ${V} to a BufferSource.`) -} +webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters) -webidl.converters['sequence'] = webidl.sequenceConverter( - webidl.converters.ByteString -) +webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([ + ...cacheQueryOptionConverters, + { + key: 'cacheName', + converter: webidl.converters.DOMString + } +]) -webidl.converters['sequence>'] = webidl.sequenceConverter( - webidl.converters['sequence'] -) +webidl.converters.Response = webidl.interfaceConverter(Response) -webidl.converters['record'] = webidl.recordConverter( - webidl.converters.ByteString, - webidl.converters.ByteString +webidl.converters['sequence'] = webidl.sequenceConverter( + webidl.converters.RequestInfo ) module.exports = { - webidl + Cache } /***/ }), -/***/ 71282: -/***/ ((module) => { +/***/ 38540: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * @see https://encoding.spec.whatwg.org/#concept-encoding-get - * @param {string|undefined} label - */ -function getEncoding (label) { - if (!label) { - return 'failure' - } +const { kConstruct } = __nccwpck_require__(99483) +const { Cache } = __nccwpck_require__(33272) +const { webidl } = __nccwpck_require__(7000) +const { kEnumerableProperty } = __nccwpck_require__(43061) - // 1. Remove any leading and trailing ASCII whitespace from label. - // 2. If label is an ASCII case-insensitive match for any of the - // labels listed in the table below, then return the - // corresponding encoding; otherwise return failure. - switch (label.trim().toLowerCase()) { - case 'unicode-1-1-utf-8': - case 'unicode11utf8': - case 'unicode20utf8': - case 'utf-8': - case 'utf8': - case 'x-unicode20utf8': - return 'UTF-8' - case '866': - case 'cp866': - case 'csibm866': - case 'ibm866': - return 'IBM866' - case 'csisolatin2': - case 'iso-8859-2': - case 'iso-ir-101': - case 'iso8859-2': - case 'iso88592': - case 'iso_8859-2': - case 'iso_8859-2:1987': - case 'l2': - case 'latin2': - return 'ISO-8859-2' - case 'csisolatin3': - case 'iso-8859-3': - case 'iso-ir-109': - case 'iso8859-3': - case 'iso88593': - case 'iso_8859-3': - case 'iso_8859-3:1988': - case 'l3': - case 'latin3': - return 'ISO-8859-3' - case 'csisolatin4': - case 'iso-8859-4': - case 'iso-ir-110': - case 'iso8859-4': - case 'iso88594': - case 'iso_8859-4': - case 'iso_8859-4:1988': - case 'l4': - case 'latin4': - return 'ISO-8859-4' - case 'csisolatincyrillic': - case 'cyrillic': - case 'iso-8859-5': - case 'iso-ir-144': - case 'iso8859-5': - case 'iso88595': - case 'iso_8859-5': - case 'iso_8859-5:1988': - return 'ISO-8859-5' - case 'arabic': - case 'asmo-708': - case 'csiso88596e': - case 'csiso88596i': - case 'csisolatinarabic': - case 'ecma-114': - case 'iso-8859-6': - case 'iso-8859-6-e': - case 'iso-8859-6-i': - case 'iso-ir-127': - case 'iso8859-6': - case 'iso88596': - case 'iso_8859-6': - case 'iso_8859-6:1987': - return 'ISO-8859-6' - case 'csisolatingreek': - case 'ecma-118': - case 'elot_928': - case 'greek': - case 'greek8': - case 'iso-8859-7': - case 'iso-ir-126': - case 'iso8859-7': - case 'iso88597': - case 'iso_8859-7': - case 'iso_8859-7:1987': - case 'sun_eu_greek': - return 'ISO-8859-7' - case 'csiso88598e': - case 'csisolatinhebrew': - case 'hebrew': - case 'iso-8859-8': - case 'iso-8859-8-e': - case 'iso-ir-138': - case 'iso8859-8': - case 'iso88598': - case 'iso_8859-8': - case 'iso_8859-8:1988': - case 'visual': - return 'ISO-8859-8' - case 'csiso88598i': - case 'iso-8859-8-i': - case 'logical': - return 'ISO-8859-8-I' - case 'csisolatin6': - case 'iso-8859-10': - case 'iso-ir-157': - case 'iso8859-10': - case 'iso885910': - case 'l6': - case 'latin6': - return 'ISO-8859-10' - case 'iso-8859-13': - case 'iso8859-13': - case 'iso885913': - return 'ISO-8859-13' - case 'iso-8859-14': - case 'iso8859-14': - case 'iso885914': - return 'ISO-8859-14' - case 'csisolatin9': - case 'iso-8859-15': - case 'iso8859-15': - case 'iso885915': - case 'iso_8859-15': - case 'l9': - return 'ISO-8859-15' - case 'iso-8859-16': - return 'ISO-8859-16' - case 'cskoi8r': - case 'koi': - case 'koi8': - case 'koi8-r': - case 'koi8_r': - return 'KOI8-R' - case 'koi8-ru': - case 'koi8-u': - return 'KOI8-U' - case 'csmacintosh': - case 'mac': - case 'macintosh': - case 'x-mac-roman': - return 'macintosh' - case 'iso-8859-11': - case 'iso8859-11': - case 'iso885911': - case 'tis-620': - case 'windows-874': - return 'windows-874' - case 'cp1250': - case 'windows-1250': - case 'x-cp1250': - return 'windows-1250' - case 'cp1251': - case 'windows-1251': - case 'x-cp1251': - return 'windows-1251' - case 'ansi_x3.4-1968': - case 'ascii': - case 'cp1252': - case 'cp819': - case 'csisolatin1': - case 'ibm819': - case 'iso-8859-1': - case 'iso-ir-100': - case 'iso8859-1': - case 'iso88591': - case 'iso_8859-1': - case 'iso_8859-1:1987': - case 'l1': - case 'latin1': - case 'us-ascii': - case 'windows-1252': - case 'x-cp1252': - return 'windows-1252' - case 'cp1253': - case 'windows-1253': - case 'x-cp1253': - return 'windows-1253' - case 'cp1254': - case 'csisolatin5': - case 'iso-8859-9': - case 'iso-ir-148': - case 'iso8859-9': - case 'iso88599': - case 'iso_8859-9': - case 'iso_8859-9:1989': - case 'l5': - case 'latin5': - case 'windows-1254': - case 'x-cp1254': - return 'windows-1254' - case 'cp1255': - case 'windows-1255': - case 'x-cp1255': - return 'windows-1255' - case 'cp1256': - case 'windows-1256': - case 'x-cp1256': - return 'windows-1256' - case 'cp1257': - case 'windows-1257': - case 'x-cp1257': - return 'windows-1257' - case 'cp1258': - case 'windows-1258': - case 'x-cp1258': - return 'windows-1258' - case 'x-mac-cyrillic': - case 'x-mac-ukrainian': - return 'x-mac-cyrillic' - case 'chinese': - case 'csgb2312': - case 'csiso58gb231280': - case 'gb2312': - case 'gb_2312': - case 'gb_2312-80': - case 'gbk': - case 'iso-ir-58': - case 'x-gbk': - return 'GBK' - case 'gb18030': - return 'gb18030' - case 'big5': - case 'big5-hkscs': - case 'cn-big5': - case 'csbig5': - case 'x-x-big5': - return 'Big5' - case 'cseucpkdfmtjapanese': - case 'euc-jp': - case 'x-euc-jp': - return 'EUC-JP' - case 'csiso2022jp': - case 'iso-2022-jp': - return 'ISO-2022-JP' - case 'csshiftjis': - case 'ms932': - case 'ms_kanji': - case 'shift-jis': - case 'shift_jis': - case 'sjis': - case 'windows-31j': - case 'x-sjis': - return 'Shift_JIS' - case 'cseuckr': - case 'csksc56011987': - case 'euc-kr': - case 'iso-ir-149': - case 'korean': - case 'ks_c_5601-1987': - case 'ks_c_5601-1989': - case 'ksc5601': - case 'ksc_5601': - case 'windows-949': - return 'EUC-KR' - case 'csiso2022kr': - case 'hz-gb-2312': - case 'iso-2022-cn': - case 'iso-2022-cn-ext': - case 'iso-2022-kr': - case 'replacement': - return 'replacement' - case 'unicodefffe': - case 'utf-16be': - return 'UTF-16BE' - case 'csunicode': - case 'iso-10646-ucs-2': - case 'ucs-2': - case 'unicode': - case 'unicodefeff': - case 'utf-16': - case 'utf-16le': - return 'UTF-16LE' - case 'x-user-defined': - return 'x-user-defined' - default: return 'failure' +class CacheStorage { + /** + * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map + * @type {Map} + */ + async has (cacheName) { + webidl.brandCheck(this, CacheStorage) + webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' }) -/***/ }), + cacheName = webidl.converters.DOMString(cacheName) -/***/ 8317: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // 2.1.1 + // 2.2 + return this.#caches.has(cacheName) + } + /** + * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open + * @param {string} cacheName + * @returns {Promise} + */ + async open (cacheName) { + webidl.brandCheck(this, CacheStorage) + webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' }) + cacheName = webidl.converters.DOMString(cacheName) -const { - staticPropertyDescriptors, - readOperation, - fireAProgressEvent -} = __nccwpck_require__(47859) -const { - kState, - kError, - kResult, - kEvents, - kAborted -} = __nccwpck_require__(13816) -const { webidl } = __nccwpck_require__(96138) -const { kEnumerableProperty } = __nccwpck_require__(67468) + // 2.1 + if (this.#caches.has(cacheName)) { + // await caches.open('v1') !== await caches.open('v1') -class FileReader extends EventTarget { - constructor () { - super() + // 2.1.1 + const cache = this.#caches.get(cacheName) - this[kState] = 'empty' - this[kResult] = null - this[kError] = null - this[kEvents] = { - loadend: null, - error: null, - abort: null, - load: null, - progress: null, - loadstart: null + // 2.1.1.1 + return new Cache(kConstruct, cache) } + + // 2.2 + const cache = [] + + // 2.3 + this.#caches.set(cacheName, cache) + + // 2.4 + return new Cache(kConstruct, cache) } /** - * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer - * @param {import('buffer').Blob} blob + * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete + * @param {string} cacheName + * @returns {Promise} */ - readAsArrayBuffer (blob) { - webidl.brandCheck(this, FileReader) - - webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' }) + async delete (cacheName) { + webidl.brandCheck(this, CacheStorage) + webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' }) - blob = webidl.converters.Blob(blob, { strict: false }) + cacheName = webidl.converters.DOMString(cacheName) - // The readAsArrayBuffer(blob) method, when invoked, - // must initiate a read operation for blob with ArrayBuffer. - readOperation(this, blob, 'ArrayBuffer') + return this.#caches.delete(cacheName) } /** - * @see https://w3c.github.io/FileAPI/#readAsBinaryString - * @param {import('buffer').Blob} blob + * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys + * @returns {string[]} */ - readAsBinaryString (blob) { - webidl.brandCheck(this, FileReader) - - webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' }) + async keys () { + webidl.brandCheck(this, CacheStorage) - blob = webidl.converters.Blob(blob, { strict: false }) + // 2.1 + const keys = this.#caches.keys() - // The readAsBinaryString(blob) method, when invoked, - // must initiate a read operation for blob with BinaryString. - readOperation(this, blob, 'BinaryString') + // 2.2 + return [...keys] } +} - /** - * @see https://w3c.github.io/FileAPI/#readAsDataText - * @param {import('buffer').Blob} blob - * @param {string?} encoding - */ - readAsText (blob, encoding = undefined) { - webidl.brandCheck(this, FileReader) +Object.defineProperties(CacheStorage.prototype, { + [Symbol.toStringTag]: { + value: 'CacheStorage', + configurable: true + }, + match: kEnumerableProperty, + has: kEnumerableProperty, + open: kEnumerableProperty, + delete: kEnumerableProperty, + keys: kEnumerableProperty +}) - webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' }) +module.exports = { + CacheStorage +} - blob = webidl.converters.Blob(blob, { strict: false }) - if (encoding !== undefined) { - encoding = webidl.converters.DOMString(encoding) +/***/ }), + +/***/ 99483: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +module.exports = { + kConstruct: (__nccwpck_require__(69898).kConstruct) +} + + +/***/ }), + +/***/ 86417: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const assert = __nccwpck_require__(39491) +const { URLSerializer } = __nccwpck_require__(16306) +const { isValidHeaderName } = __nccwpck_require__(47794) + +/** + * @see https://url.spec.whatwg.org/#concept-url-equals + * @param {URL} A + * @param {URL} B + * @param {boolean | undefined} excludeFragment + * @returns {boolean} + */ +function urlEquals (A, B, excludeFragment = false) { + const serializedA = URLSerializer(A, excludeFragment) + + const serializedB = URLSerializer(B, excludeFragment) + + return serializedA === serializedB +} + +/** + * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262 + * @param {string} header + */ +function fieldValues (header) { + assert(header !== null) + + const values = [] + + for (let value of header.split(',')) { + value = value.trim() + + if (!value.length) { + continue + } else if (!isValidHeaderName(value)) { + continue } - // The readAsText(blob, encoding) method, when invoked, - // must initiate a read operation for blob with Text and encoding. - readOperation(this, blob, 'Text', encoding) + values.push(value) } - /** - * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL - * @param {import('buffer').Blob} blob - */ - readAsDataURL (blob) { - webidl.brandCheck(this, FileReader) + return values +} - webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' }) +module.exports = { + urlEquals, + fieldValues +} - blob = webidl.converters.Blob(blob, { strict: false }) - // The readAsDataURL(blob) method, when invoked, must - // initiate a read operation for blob with DataURL. - readOperation(this, blob, 'DataURL') +/***/ }), + +/***/ 41421: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// @ts-check + + + +/* global WebAssembly */ + +const assert = __nccwpck_require__(39491) +const net = __nccwpck_require__(41808) +const http = __nccwpck_require__(13685) +const { pipeline } = __nccwpck_require__(12781) +const util = __nccwpck_require__(43061) +const timers = __nccwpck_require__(19402) +const Request = __nccwpck_require__(8072) +const DispatcherBase = __nccwpck_require__(33090) +const { + RequestContentLengthMismatchError, + ResponseContentLengthMismatchError, + InvalidArgumentError, + RequestAbortedError, + HeadersTimeoutError, + HeadersOverflowError, + SocketError, + InformationalError, + BodyTimeoutError, + HTTPParserError, + ResponseExceededMaxSizeError, + ClientDestroyedError +} = __nccwpck_require__(70867) +const buildConnector = __nccwpck_require__(46183) +const { + kUrl, + kReset, + kServerName, + kClient, + kBusy, + kParser, + kConnect, + kBlocking, + kResuming, + kRunning, + kPending, + kSize, + kWriting, + kQueue, + kConnected, + kConnecting, + kNeedDrain, + kNoRef, + kKeepAliveDefaultTimeout, + kHostHeader, + kPendingIdx, + kRunningIdx, + kError, + kPipelining, + kSocket, + kKeepAliveTimeoutValue, + kMaxHeadersSize, + kKeepAliveMaxTimeout, + kKeepAliveTimeoutThreshold, + kHeadersTimeout, + kBodyTimeout, + kStrictContentLength, + kConnector, + kMaxRedirections, + kMaxRequests, + kCounter, + kClose, + kDestroy, + kDispatch, + kInterceptors, + kLocalAddress, + kMaxResponseSize, + kHTTPConnVersion, + // HTTP2 + kHost, + kHTTP2Session, + kHTTP2SessionState, + kHTTP2BuildRequest, + kHTTP2CopyHeaders, + kHTTP1BuildRequest +} = __nccwpck_require__(69898) + +/** @type {import('http2')} */ +let http2 +try { + http2 = __nccwpck_require__(85158) +} catch { + // @ts-ignore + http2 = { constants: {} } +} + +const { + constants: { + HTTP2_HEADER_AUTHORITY, + HTTP2_HEADER_METHOD, + HTTP2_HEADER_PATH, + HTTP2_HEADER_SCHEME, + HTTP2_HEADER_CONTENT_LENGTH, + HTTP2_HEADER_EXPECT, + HTTP2_HEADER_STATUS } +} = http2 + +// Experimental +let h2ExperimentalWarned = false + +const FastBuffer = Buffer[Symbol.species] + +const kClosedResolve = Symbol('kClosedResolve') + +const channels = {} + +try { + const diagnosticsChannel = __nccwpck_require__(67643) + channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders') + channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect') + channels.connectError = diagnosticsChannel.channel('undici:client:connectError') + channels.connected = diagnosticsChannel.channel('undici:client:connected') +} catch { + channels.sendHeaders = { hasSubscribers: false } + channels.beforeConnect = { hasSubscribers: false } + channels.connectError = { hasSubscribers: false } + channels.connected = { hasSubscribers: false } +} +/** + * @type {import('../types/client').default} + */ +class Client extends DispatcherBase { /** - * @see https://w3c.github.io/FileAPI/#dfn-abort + * + * @param {string|URL} url + * @param {import('../types/client').Client.Options} options */ - abort () { - // 1. If this's state is "empty" or if this's state is - // "done" set this's result to null and terminate - // this algorithm. - if (this[kState] === 'empty' || this[kState] === 'done') { - this[kResult] = null - return + constructor (url, { + interceptors, + maxHeaderSize, + headersTimeout, + socketTimeout, + requestTimeout, + connectTimeout, + bodyTimeout, + idleTimeout, + keepAlive, + keepAliveTimeout, + maxKeepAliveTimeout, + keepAliveMaxTimeout, + keepAliveTimeoutThreshold, + socketPath, + pipelining, + tls, + strictContentLength, + maxCachedSessions, + maxRedirections, + connect, + maxRequestsPerClient, + localAddress, + maxResponseSize, + autoSelectFamily, + autoSelectFamilyAttemptTimeout, + // h2 + allowH2, + maxConcurrentStreams + } = {}) { + super() + + if (keepAlive !== undefined) { + throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead') } - // 2. If this's state is "loading" set this's state to - // "done" and set this's result to null. - if (this[kState] === 'loading') { - this[kState] = 'done' - this[kResult] = null + if (socketTimeout !== undefined) { + throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead') } - // 3. If there are any tasks from this on the file reading - // task source in an affiliated task queue, then remove - // those tasks from that task queue. - this[kAborted] = true + if (requestTimeout !== undefined) { + throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead') + } - // 4. Terminate the algorithm for the read method being processed. - // TODO + if (idleTimeout !== undefined) { + throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead') + } - // 5. Fire a progress event called abort at this. - fireAProgressEvent('abort', this) + if (maxKeepAliveTimeout !== undefined) { + throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead') + } - // 6. If this's state is not "loading", fire a progress - // event called loadend at this. - if (this[kState] !== 'loading') { - fireAProgressEvent('loadend', this) + if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) { + throw new InvalidArgumentError('invalid maxHeaderSize') } - } - /** - * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate - */ - get readyState () { - webidl.brandCheck(this, FileReader) + if (socketPath != null && typeof socketPath !== 'string') { + throw new InvalidArgumentError('invalid socketPath') + } - switch (this[kState]) { - case 'empty': return this.EMPTY - case 'loading': return this.LOADING - case 'done': return this.DONE + if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) { + throw new InvalidArgumentError('invalid connectTimeout') } - } - /** - * @see https://w3c.github.io/FileAPI/#dom-filereader-result - */ - get result () { - webidl.brandCheck(this, FileReader) + if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) { + throw new InvalidArgumentError('invalid keepAliveTimeout') + } - // The result attribute’s getter, when invoked, must return - // this's result. - return this[kResult] - } + if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) { + throw new InvalidArgumentError('invalid keepAliveMaxTimeout') + } - /** - * @see https://w3c.github.io/FileAPI/#dom-filereader-error - */ - get error () { - webidl.brandCheck(this, FileReader) + if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) { + throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold') + } - // The error attribute’s getter, when invoked, must return - // this's error. - return this[kError] - } + if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) { + throw new InvalidArgumentError('headersTimeout must be a positive integer or zero') + } - get onloadend () { - webidl.brandCheck(this, FileReader) + if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) { + throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero') + } - return this[kEvents].loadend - } + if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { + throw new InvalidArgumentError('connect must be a function or an object') + } - set onloadend (fn) { - webidl.brandCheck(this, FileReader) + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { + throw new InvalidArgumentError('maxRedirections must be a positive number') + } - if (this[kEvents].loadend) { - this.removeEventListener('loadend', this[kEvents].loadend) + if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) { + throw new InvalidArgumentError('maxRequestsPerClient must be a positive number') } - if (typeof fn === 'function') { - this[kEvents].loadend = fn - this.addEventListener('loadend', fn) - } else { - this[kEvents].loadend = null + if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) { + throw new InvalidArgumentError('localAddress must be valid string IP address') } - } - get onerror () { - webidl.brandCheck(this, FileReader) + if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) { + throw new InvalidArgumentError('maxResponseSize must be a positive number') + } - return this[kEvents].error - } + if ( + autoSelectFamilyAttemptTimeout != null && + (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1) + ) { + throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number') + } - set onerror (fn) { - webidl.brandCheck(this, FileReader) + // h2 + if (allowH2 != null && typeof allowH2 !== 'boolean') { + throw new InvalidArgumentError('allowH2 must be a valid boolean value') + } - if (this[kEvents].error) { - this.removeEventListener('error', this[kEvents].error) + if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) { + throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0') } - if (typeof fn === 'function') { - this[kEvents].error = fn - this.addEventListener('error', fn) - } else { - this[kEvents].error = null + if (typeof connect !== 'function') { + connect = buildConnector({ + ...tls, + maxCachedSessions, + allowH2, + socketPath, + timeout: connectTimeout, + ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), + ...connect + }) } + + this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client) + ? interceptors.Client + : [createRedirectInterceptor({ maxRedirections })] + this[kUrl] = util.parseOrigin(url) + this[kConnector] = connect + this[kSocket] = null + this[kPipelining] = pipelining != null ? pipelining : 1 + this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize + this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout + this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout + this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold + this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout] + this[kServerName] = null + this[kLocalAddress] = localAddress != null ? localAddress : null + this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming + this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming + this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n` + this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3 + this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3 + this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength + this[kMaxRedirections] = maxRedirections + this[kMaxRequests] = maxRequestsPerClient + this[kClosedResolve] = null + this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1 + this[kHTTPConnVersion] = 'h1' + + // HTTP/2 + this[kHTTP2Session] = null + this[kHTTP2SessionState] = !allowH2 + ? null + : { + // streams: null, // Fixed queue of streams - For future support of `push` + openStreams: 0, // Keep track of them to decide wether or not unref the session + maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server + } + this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}` + + // kQueue is built up of 3 sections separated by + // the kRunningIdx and kPendingIdx indices. + // | complete | running | pending | + // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length + // kRunningIdx points to the first running element. + // kPendingIdx points to the first pending element. + // This implements a fast queue with an amortized + // time of O(1). + + this[kQueue] = [] + this[kRunningIdx] = 0 + this[kPendingIdx] = 0 } - get onloadstart () { - webidl.brandCheck(this, FileReader) + get pipelining () { + return this[kPipelining] + } - return this[kEvents].loadstart + set pipelining (value) { + this[kPipelining] = value + resume(this, true) } - set onloadstart (fn) { - webidl.brandCheck(this, FileReader) + get [kPending] () { + return this[kQueue].length - this[kPendingIdx] + } - if (this[kEvents].loadstart) { - this.removeEventListener('loadstart', this[kEvents].loadstart) - } + get [kRunning] () { + return this[kPendingIdx] - this[kRunningIdx] + } - if (typeof fn === 'function') { - this[kEvents].loadstart = fn - this.addEventListener('loadstart', fn) - } else { - this[kEvents].loadstart = null - } + get [kSize] () { + return this[kQueue].length - this[kRunningIdx] } - get onprogress () { - webidl.brandCheck(this, FileReader) + get [kConnected] () { + return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed + } - return this[kEvents].progress + get [kBusy] () { + const socket = this[kSocket] + return ( + (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) || + (this[kSize] >= (this[kPipelining] || 1)) || + this[kPending] > 0 + ) } - set onprogress (fn) { - webidl.brandCheck(this, FileReader) + /* istanbul ignore: only used for test */ + [kConnect] (cb) { + connect(this) + this.once('connect', cb) + } - if (this[kEvents].progress) { - this.removeEventListener('progress', this[kEvents].progress) - } + [kDispatch] (opts, handler) { + const origin = opts.origin || this[kUrl].origin - if (typeof fn === 'function') { - this[kEvents].progress = fn - this.addEventListener('progress', fn) + const request = this[kHTTPConnVersion] === 'h2' + ? Request[kHTTP2BuildRequest](origin, opts, handler) + : Request[kHTTP1BuildRequest](origin, opts, handler) + + this[kQueue].push(request) + if (this[kResuming]) { + // Do nothing. + } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) { + // Wait a tick in case stream/iterator is ended in the same tick. + this[kResuming] = 1 + process.nextTick(resume, this) } else { - this[kEvents].progress = null + resume(this, true) } - } - get onload () { - webidl.brandCheck(this, FileReader) + if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) { + this[kNeedDrain] = 2 + } - return this[kEvents].load + return this[kNeedDrain] < 2 } - set onload (fn) { - webidl.brandCheck(this, FileReader) + async [kClose] () { + // TODO: for H2 we need to gracefully flush the remaining enqueued + // request and close each stream. + return new Promise((resolve) => { + if (!this[kSize]) { + resolve(null) + } else { + this[kClosedResolve] = resolve + } + }) + } - if (this[kEvents].load) { - this.removeEventListener('load', this[kEvents].load) - } + async [kDestroy] (err) { + return new Promise((resolve) => { + const requests = this[kQueue].splice(this[kPendingIdx]) + for (let i = 0; i < requests.length; i++) { + const request = requests[i] + errorRequest(this, request, err) + } - if (typeof fn === 'function') { - this[kEvents].load = fn - this.addEventListener('load', fn) - } else { - this[kEvents].load = null - } + const callback = () => { + if (this[kClosedResolve]) { + // TODO (fix): Should we error here with ClientDestroyedError? + this[kClosedResolve]() + this[kClosedResolve] = null + } + resolve() + } + + if (this[kHTTP2Session] != null) { + util.destroy(this[kHTTP2Session], err) + this[kHTTP2Session] = null + this[kHTTP2SessionState] = null + } + + if (!this[kSocket]) { + queueMicrotask(callback) + } else { + util.destroy(this[kSocket].on('close', callback), err) + } + + resume(this) + }) } +} - get onabort () { - webidl.brandCheck(this, FileReader) +function onHttp2SessionError (err) { + assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID') - return this[kEvents].abort + this[kSocket][kError] = err + + onError(this[kClient], err) +} + +function onHttp2FrameError (type, code, id) { + const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`) + + if (id === 0) { + this[kSocket][kError] = err + onError(this[kClient], err) } +} - set onabort (fn) { - webidl.brandCheck(this, FileReader) +function onHttp2SessionEnd () { + util.destroy(this, new SocketError('other side closed')) + util.destroy(this[kSocket], new SocketError('other side closed')) +} - if (this[kEvents].abort) { - this.removeEventListener('abort', this[kEvents].abort) - } +function onHTTP2GoAway (code) { + const client = this[kClient] + const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`) + client[kSocket] = null + client[kHTTP2Session] = null - if (typeof fn === 'function') { - this[kEvents].abort = fn - this.addEventListener('abort', fn) - } else { - this[kEvents].abort = null + if (client.destroyed) { + assert(this[kPending] === 0) + + // Fail entire queue. + const requests = client[kQueue].splice(client[kRunningIdx]) + for (let i = 0; i < requests.length; i++) { + const request = requests[i] + errorRequest(this, request, err) } + } else if (client[kRunning] > 0) { + // Fail head of pipeline. + const request = client[kQueue][client[kRunningIdx]] + client[kQueue][client[kRunningIdx]++] = null + + errorRequest(client, request, err) } + + client[kPendingIdx] = client[kRunningIdx] + + assert(client[kRunning] === 0) + + client.emit('disconnect', + client[kUrl], + [client], + err + ) + + resume(client) } -// https://w3c.github.io/FileAPI/#dom-filereader-empty -FileReader.EMPTY = FileReader.prototype.EMPTY = 0 -// https://w3c.github.io/FileAPI/#dom-filereader-loading -FileReader.LOADING = FileReader.prototype.LOADING = 1 -// https://w3c.github.io/FileAPI/#dom-filereader-done -FileReader.DONE = FileReader.prototype.DONE = 2 +const constants = __nccwpck_require__(29110) +const createRedirectInterceptor = __nccwpck_require__(8734) +const EMPTY_BUF = Buffer.alloc(0) -Object.defineProperties(FileReader.prototype, { - EMPTY: staticPropertyDescriptors, - LOADING: staticPropertyDescriptors, - DONE: staticPropertyDescriptors, - readAsArrayBuffer: kEnumerableProperty, - readAsBinaryString: kEnumerableProperty, - readAsText: kEnumerableProperty, - readAsDataURL: kEnumerableProperty, - abort: kEnumerableProperty, - readyState: kEnumerableProperty, - result: kEnumerableProperty, - error: kEnumerableProperty, - onloadstart: kEnumerableProperty, - onprogress: kEnumerableProperty, - onload: kEnumerableProperty, - onabort: kEnumerableProperty, - onerror: kEnumerableProperty, - onloadend: kEnumerableProperty, - [Symbol.toStringTag]: { - value: 'FileReader', - writable: false, - enumerable: false, - configurable: true +async function lazyllhttp () { + const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(87503) : undefined + + let mod + try { + mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(72682), 'base64')) + } catch (e) { + /* istanbul ignore next */ + + // We could check if the error was caused by the simd option not + // being enabled, but the occurring of this other error + // * https://github.com/emscripten-core/emscripten/issues/11495 + // got me to remove that check to avoid breaking Node 12. + mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(87503), 'base64')) } -}) -Object.defineProperties(FileReader, { - EMPTY: staticPropertyDescriptors, - LOADING: staticPropertyDescriptors, - DONE: staticPropertyDescriptors -}) + return await WebAssembly.instantiate(mod, { + env: { + /* eslint-disable camelcase */ -module.exports = { - FileReader + wasm_on_url: (p, at, len) => { + /* istanbul ignore next */ + return 0 + }, + wasm_on_status: (p, at, len) => { + assert.strictEqual(currentParser.ptr, p) + const start = at - currentBufferPtr + currentBufferRef.byteOffset + return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 + }, + wasm_on_message_begin: (p) => { + assert.strictEqual(currentParser.ptr, p) + return currentParser.onMessageBegin() || 0 + }, + wasm_on_header_field: (p, at, len) => { + assert.strictEqual(currentParser.ptr, p) + const start = at - currentBufferPtr + currentBufferRef.byteOffset + return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 + }, + wasm_on_header_value: (p, at, len) => { + assert.strictEqual(currentParser.ptr, p) + const start = at - currentBufferPtr + currentBufferRef.byteOffset + return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 + }, + wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => { + assert.strictEqual(currentParser.ptr, p) + return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0 + }, + wasm_on_body: (p, at, len) => { + assert.strictEqual(currentParser.ptr, p) + const start = at - currentBufferPtr + currentBufferRef.byteOffset + return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 + }, + wasm_on_message_complete: (p) => { + assert.strictEqual(currentParser.ptr, p) + return currentParser.onMessageComplete() || 0 + } + + /* eslint-enable camelcase */ + } + }) } +let llhttpInstance = null +let llhttpPromise = lazyllhttp() +llhttpPromise.catch() -/***/ }), +let currentParser = null +let currentBufferRef = null +let currentBufferSize = 0 +let currentBufferPtr = null -/***/ 92987: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +const TIMEOUT_HEADERS = 1 +const TIMEOUT_BODY = 2 +const TIMEOUT_IDLE = 3 +class Parser { + constructor (client, socket, { exports }) { + assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0) + this.llhttp = exports + this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE) + this.client = client + this.socket = socket + this.timeout = null + this.timeoutValue = null + this.timeoutType = null + this.statusCode = null + this.statusText = '' + this.upgrade = false + this.headers = [] + this.headersSize = 0 + this.headersMaxSize = client[kMaxHeadersSize] + this.shouldKeepAlive = false + this.paused = false + this.resume = this.resume.bind(this) -const { webidl } = __nccwpck_require__(96138) + this.bytesRead = 0 -const kState = Symbol('ProgressEvent state') + this.keepAlive = '' + this.contentLength = '' + this.connection = '' + this.maxResponseSize = client[kMaxResponseSize] + } -/** - * @see https://xhr.spec.whatwg.org/#progressevent - */ -class ProgressEvent extends Event { - constructor (type, eventInitDict = {}) { - type = webidl.converters.DOMString(type) - eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {}) + setTimeout (value, type) { + this.timeoutType = type + if (value !== this.timeoutValue) { + timers.clearTimeout(this.timeout) + if (value) { + this.timeout = timers.setTimeout(onParserTimeout, value, this) + // istanbul ignore else: only for jest + if (this.timeout.unref) { + this.timeout.unref() + } + } else { + this.timeout = null + } + this.timeoutValue = value + } else if (this.timeout) { + // istanbul ignore else: only for jest + if (this.timeout.refresh) { + this.timeout.refresh() + } + } + } - super(type, eventInitDict) + resume () { + if (this.socket.destroyed || !this.paused) { + return + } - this[kState] = { - lengthComputable: eventInitDict.lengthComputable, - loaded: eventInitDict.loaded, - total: eventInitDict.total + assert(this.ptr != null) + assert(currentParser == null) + + this.llhttp.llhttp_resume(this.ptr) + + assert(this.timeoutType === TIMEOUT_BODY) + if (this.timeout) { + // istanbul ignore else: only for jest + if (this.timeout.refresh) { + this.timeout.refresh() + } } - } - get lengthComputable () { - webidl.brandCheck(this, ProgressEvent) + this.paused = false + this.execute(this.socket.read() || EMPTY_BUF) // Flush parser. + this.readMore() + } - return this[kState].lengthComputable + readMore () { + while (!this.paused && this.ptr) { + const chunk = this.socket.read() + if (chunk === null) { + break + } + this.execute(chunk) + } } - get loaded () { - webidl.brandCheck(this, ProgressEvent) + execute (data) { + assert(this.ptr != null) + assert(currentParser == null) + assert(!this.paused) - return this[kState].loaded - } + const { socket, llhttp } = this - get total () { - webidl.brandCheck(this, ProgressEvent) + if (data.length > currentBufferSize) { + if (currentBufferPtr) { + llhttp.free(currentBufferPtr) + } + currentBufferSize = Math.ceil(data.length / 4096) * 4096 + currentBufferPtr = llhttp.malloc(currentBufferSize) + } - return this[kState].total - } -} + new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data) -webidl.converters.ProgressEventInit = webidl.dictionaryConverter([ - { - key: 'lengthComputable', - converter: webidl.converters.boolean, - defaultValue: false - }, - { - key: 'loaded', - converter: webidl.converters['unsigned long long'], - defaultValue: 0 - }, - { - key: 'total', - converter: webidl.converters['unsigned long long'], - defaultValue: 0 - }, - { - key: 'bubbles', - converter: webidl.converters.boolean, - defaultValue: false - }, - { - key: 'cancelable', - converter: webidl.converters.boolean, - defaultValue: false - }, - { - key: 'composed', - converter: webidl.converters.boolean, - defaultValue: false + // Call `execute` on the wasm parser. + // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data, + // and finally the length of bytes to parse. + // The return value is an error code or `constants.ERROR.OK`. + try { + let ret + + try { + currentBufferRef = data + currentParser = this + ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length) + /* eslint-disable-next-line no-useless-catch */ + } catch (err) { + /* istanbul ignore next: difficult to make a test case for */ + throw err + } finally { + currentParser = null + currentBufferRef = null + } + + const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr + + if (ret === constants.ERROR.PAUSED_UPGRADE) { + this.onUpgrade(data.slice(offset)) + } else if (ret === constants.ERROR.PAUSED) { + this.paused = true + socket.unshift(data.slice(offset)) + } else if (ret !== constants.ERROR.OK) { + const ptr = llhttp.llhttp_get_error_reason(this.ptr) + let message = '' + /* istanbul ignore else: difficult to make a test case for */ + if (ptr) { + const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) + message = + 'Response does not match the HTTP/1.1 protocol (' + + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + + ')' + } + throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset)) + } + } catch (err) { + util.destroy(socket, err) + } } -]) -module.exports = { - ProgressEvent -} + destroy () { + assert(this.ptr != null) + assert(currentParser == null) + this.llhttp.llhttp_free(this.ptr) + this.ptr = null -/***/ }), + timers.clearTimeout(this.timeout) + this.timeout = null + this.timeoutValue = null + this.timeoutType = null -/***/ 13816: -/***/ ((module) => { + this.paused = false + } + onStatus (buf) { + this.statusText = buf.toString() + } + onMessageBegin () { + const { socket, client } = this -module.exports = { - kState: Symbol('FileReader state'), - kResult: Symbol('FileReader result'), - kError: Symbol('FileReader error'), - kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'), - kEvents: Symbol('FileReader events'), - kAborted: Symbol('FileReader aborted') -} + /* istanbul ignore next: difficult to make a test case for */ + if (socket.destroyed) { + return -1 + } + const request = client[kQueue][client[kRunningIdx]] + if (!request) { + return -1 + } + } -/***/ }), + onHeaderField (buf) { + const len = this.headers.length -/***/ 47859: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if ((len & 1) === 0) { + this.headers.push(buf) + } else { + this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]) + } + this.trackHeader(buf.length) + } + onHeaderValue (buf) { + let len = this.headers.length -const { - kState, - kError, - kResult, - kAborted, - kLastProgressEventFired -} = __nccwpck_require__(13816) -const { ProgressEvent } = __nccwpck_require__(92987) -const { getEncoding } = __nccwpck_require__(71282) -const { DOMException } = __nccwpck_require__(93541) -const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(50096) -const { types } = __nccwpck_require__(73837) -const { StringDecoder } = __nccwpck_require__(71576) -const { btoa } = __nccwpck_require__(14300) + if ((len & 1) === 1) { + this.headers.push(buf) + len += 1 + } else { + this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]) + } -/** @type {PropertyDescriptor} */ -const staticPropertyDescriptors = { - enumerable: true, - writable: false, - configurable: false -} + const key = this.headers[len - 2] + if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') { + this.keepAlive += buf.toString() + } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') { + this.connection += buf.toString() + } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') { + this.contentLength += buf.toString() + } -/** - * @see https://w3c.github.io/FileAPI/#readOperation - * @param {import('./filereader').FileReader} fr - * @param {import('buffer').Blob} blob - * @param {string} type - * @param {string?} encodingName - */ -function readOperation (fr, blob, type, encodingName) { - // 1. If fr’s state is "loading", throw an InvalidStateError - // DOMException. - if (fr[kState] === 'loading') { - throw new DOMException('Invalid state', 'InvalidStateError') + this.trackHeader(buf.length) } - // 2. Set fr’s state to "loading". - fr[kState] = 'loading' - - // 3. Set fr’s result to null. - fr[kResult] = null + trackHeader (len) { + this.headersSize += len + if (this.headersSize >= this.headersMaxSize) { + util.destroy(this.socket, new HeadersOverflowError()) + } + } - // 4. Set fr’s error to null. - fr[kError] = null + onUpgrade (head) { + const { upgrade, client, socket, headers, statusCode } = this - // 5. Let stream be the result of calling get stream on blob. - /** @type {import('stream/web').ReadableStream} */ - const stream = blob.stream() + assert(upgrade) - // 6. Let reader be the result of getting a reader from stream. - const reader = stream.getReader() + const request = client[kQueue][client[kRunningIdx]] + assert(request) - // 7. Let bytes be an empty byte sequence. - /** @type {Uint8Array[]} */ - const bytes = [] + assert(!socket.destroyed) + assert(socket === client[kSocket]) + assert(!this.paused) + assert(request.upgrade || request.method === 'CONNECT') - // 8. Let chunkPromise be the result of reading a chunk from - // stream with reader. - let chunkPromise = reader.read() + this.statusCode = null + this.statusText = '' + this.shouldKeepAlive = null - // 9. Let isFirstChunk be true. - let isFirstChunk = true + assert(this.headers.length % 2 === 0) + this.headers = [] + this.headersSize = 0 - // 10. In parallel, while true: - // Note: "In parallel" just means non-blocking - // Note 2: readOperation itself cannot be async as double - // reading the body would then reject the promise, instead - // of throwing an error. - ;(async () => { - while (!fr[kAborted]) { - // 1. Wait for chunkPromise to be fulfilled or rejected. - try { - const { done, value } = await chunkPromise + socket.unshift(head) - // 2. If chunkPromise is fulfilled, and isFirstChunk is - // true, queue a task to fire a progress event called - // loadstart at fr. - if (isFirstChunk && !fr[kAborted]) { - queueMicrotask(() => { - fireAProgressEvent('loadstart', fr) - }) - } + socket[kParser].destroy() + socket[kParser] = null - // 3. Set isFirstChunk to false. - isFirstChunk = false + socket[kClient] = null + socket[kError] = null + socket + .removeListener('error', onSocketError) + .removeListener('readable', onSocketReadable) + .removeListener('end', onSocketEnd) + .removeListener('close', onSocketClose) - // 4. If chunkPromise is fulfilled with an object whose - // done property is false and whose value property is - // a Uint8Array object, run these steps: - if (!done && types.isUint8Array(value)) { - // 1. Let bs be the byte sequence represented by the - // Uint8Array object. + client[kSocket] = null + client[kQueue][client[kRunningIdx]++] = null + client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade')) - // 2. Append bs to bytes. - bytes.push(value) + try { + request.onUpgrade(statusCode, headers, socket) + } catch (err) { + util.destroy(socket, err) + } - // 3. If roughly 50ms have passed since these steps - // were last invoked, queue a task to fire a - // progress event called progress at fr. - if ( - ( - fr[kLastProgressEventFired] === undefined || - Date.now() - fr[kLastProgressEventFired] >= 50 - ) && - !fr[kAborted] - ) { - fr[kLastProgressEventFired] = Date.now() - queueMicrotask(() => { - fireAProgressEvent('progress', fr) - }) - } + resume(client) + } - // 4. Set chunkPromise to the result of reading a - // chunk from stream with reader. - chunkPromise = reader.read() - } else if (done) { - // 5. Otherwise, if chunkPromise is fulfilled with an - // object whose done property is true, queue a task - // to run the following steps and abort this algorithm: - queueMicrotask(() => { - // 1. Set fr’s state to "done". - fr[kState] = 'done' + onHeadersComplete (statusCode, upgrade, shouldKeepAlive) { + const { client, socket, headers, statusText } = this - // 2. Let result be the result of package data given - // bytes, type, blob’s type, and encodingName. - try { - const result = packageData(bytes, type, blob.type, encodingName) + /* istanbul ignore next: difficult to make a test case for */ + if (socket.destroyed) { + return -1 + } - // 4. Else: + const request = client[kQueue][client[kRunningIdx]] - if (fr[kAborted]) { - return - } + /* istanbul ignore next: difficult to make a test case for */ + if (!request) { + return -1 + } - // 1. Set fr’s result to result. - fr[kResult] = result + assert(!this.upgrade) + assert(this.statusCode < 200) - // 2. Fire a progress event called load at the fr. - fireAProgressEvent('load', fr) - } catch (error) { - // 3. If package data threw an exception error: + if (statusCode === 100) { + util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) + return -1 + } - // 1. Set fr’s error to error. - fr[kError] = error + /* this can only happen if server is misbehaving */ + if (upgrade && !request.upgrade) { + util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket))) + return -1 + } - // 2. Fire a progress event called error at fr. - fireAProgressEvent('error', fr) - } + assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS) - // 5. If fr’s state is not "loading", fire a progress - // event called loadend at the fr. - if (fr[kState] !== 'loading') { - fireAProgressEvent('loadend', fr) - } - }) + this.statusCode = statusCode + this.shouldKeepAlive = ( + shouldKeepAlive || + // Override llhttp value which does not allow keepAlive for HEAD. + (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive') + ) - break - } - } catch (error) { - if (fr[kAborted]) { - return - } + if (this.statusCode >= 200) { + const bodyTimeout = request.bodyTimeout != null + ? request.bodyTimeout + : client[kBodyTimeout] + this.setTimeout(bodyTimeout, TIMEOUT_BODY) + } else if (this.timeout) { + // istanbul ignore else: only for jest + if (this.timeout.refresh) { + this.timeout.refresh() + } + } - // 6. Otherwise, if chunkPromise is rejected with an - // error error, queue a task to run the following - // steps and abort this algorithm: - queueMicrotask(() => { - // 1. Set fr’s state to "done". - fr[kState] = 'done' + if (request.method === 'CONNECT') { + assert(client[kRunning] === 1) + this.upgrade = true + return 2 + } - // 2. Set fr’s error to error. - fr[kError] = error + if (upgrade) { + assert(client[kRunning] === 1) + this.upgrade = true + return 2 + } - // 3. Fire a progress event called error at fr. - fireAProgressEvent('error', fr) + assert(this.headers.length % 2 === 0) + this.headers = [] + this.headersSize = 0 - // 4. If fr’s state is not "loading", fire a progress - // event called loadend at fr. - if (fr[kState] !== 'loading') { - fireAProgressEvent('loadend', fr) - } - }) + if (this.shouldKeepAlive && client[kPipelining]) { + const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null - break + if (keepAliveTimeout != null) { + const timeout = Math.min( + keepAliveTimeout - client[kKeepAliveTimeoutThreshold], + client[kKeepAliveMaxTimeout] + ) + if (timeout <= 0) { + socket[kReset] = true + } else { + client[kKeepAliveTimeoutValue] = timeout + } + } else { + client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout] } + } else { + // Stop more requests from being dispatched. + socket[kReset] = true } - })() -} -/** - * @see https://w3c.github.io/FileAPI/#fire-a-progress-event - * @see https://dom.spec.whatwg.org/#concept-event-fire - * @param {string} e The name of the event - * @param {import('./filereader').FileReader} reader - */ -function fireAProgressEvent (e, reader) { - // The progress event e does not bubble. e.bubbles must be false - // The progress event e is NOT cancelable. e.cancelable must be false - const event = new ProgressEvent(e, { - bubbles: false, - cancelable: false - }) + const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false - reader.dispatchEvent(event) -} + if (request.aborted) { + return -1 + } -/** - * @see https://w3c.github.io/FileAPI/#blob-package-data - * @param {Uint8Array[]} bytes - * @param {string} type - * @param {string?} mimeType - * @param {string?} encodingName - */ -function packageData (bytes, type, mimeType, encodingName) { - // 1. A Blob has an associated package data algorithm, given - // bytes, a type, a optional mimeType, and a optional - // encodingName, which switches on type and runs the - // associated steps: + if (request.method === 'HEAD') { + return 1 + } - switch (type) { - case 'DataURL': { - // 1. Return bytes as a DataURL [RFC2397] subject to - // the considerations below: - // * Use mimeType as part of the Data URL if it is - // available in keeping with the Data URL - // specification [RFC2397]. - // * If mimeType is not available return a Data URL - // without a media-type. [RFC2397]. + if (statusCode < 200) { + return 1 + } - // https://datatracker.ietf.org/doc/html/rfc2397#section-3 - // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data - // mediatype := [ type "/" subtype ] *( ";" parameter ) - // data := *urlchar - // parameter := attribute "=" value - let dataURL = 'data:' + if (socket[kBlocking]) { + socket[kBlocking] = false + resume(client) + } - const parsed = parseMIMEType(mimeType || 'application/octet-stream') + return pause ? constants.ERROR.PAUSED : 0 + } - if (parsed !== 'failure') { - dataURL += serializeAMimeType(parsed) - } + onBody (buf) { + const { client, socket, statusCode, maxResponseSize } = this - dataURL += ';base64,' + if (socket.destroyed) { + return -1 + } - const decoder = new StringDecoder('latin1') + const request = client[kQueue][client[kRunningIdx]] + assert(request) - for (const chunk of bytes) { - dataURL += btoa(decoder.write(chunk)) + assert.strictEqual(this.timeoutType, TIMEOUT_BODY) + if (this.timeout) { + // istanbul ignore else: only for jest + if (this.timeout.refresh) { + this.timeout.refresh() } + } - dataURL += btoa(decoder.end()) + assert(statusCode >= 200) - return dataURL + if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { + util.destroy(socket, new ResponseExceededMaxSizeError()) + return -1 } - case 'Text': { - // 1. Let encoding be failure - let encoding = 'failure' - - // 2. If the encodingName is present, set encoding to the - // result of getting an encoding from encodingName. - if (encodingName) { - encoding = getEncoding(encodingName) - } - // 3. If encoding is failure, and mimeType is present: - if (encoding === 'failure' && mimeType) { - // 1. Let type be the result of parse a MIME type - // given mimeType. - const type = parseMIMEType(mimeType) + this.bytesRead += buf.length - // 2. If type is not failure, set encoding to the result - // of getting an encoding from type’s parameters["charset"]. - if (type !== 'failure') { - encoding = getEncoding(type.parameters.get('charset')) - } - } + if (request.onData(buf) === false) { + return constants.ERROR.PAUSED + } + } - // 4. If encoding is failure, then set encoding to UTF-8. - if (encoding === 'failure') { - encoding = 'UTF-8' - } + onMessageComplete () { + const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this - // 5. Decode bytes using fallback encoding encoding, and - // return the result. - return decode(bytes, encoding) + if (socket.destroyed && (!statusCode || shouldKeepAlive)) { + return -1 } - case 'ArrayBuffer': { - // Return a new ArrayBuffer whose contents are bytes. - const sequence = combineByteSequences(bytes) - return sequence.buffer + if (upgrade) { + return } - case 'BinaryString': { - // Return bytes as a binary string, in which every byte - // is represented by a code unit of equal value [0..255]. - let binaryString = '' - const decoder = new StringDecoder('latin1') + const request = client[kQueue][client[kRunningIdx]] + assert(request) - for (const chunk of bytes) { - binaryString += decoder.write(chunk) - } + assert(statusCode >= 100) - binaryString += decoder.end() + this.statusCode = null + this.statusText = '' + this.bytesRead = 0 + this.contentLength = '' + this.keepAlive = '' + this.connection = '' - return binaryString - } - } -} + assert(this.headers.length % 2 === 0) + this.headers = [] + this.headersSize = 0 -/** - * @see https://encoding.spec.whatwg.org/#decode - * @param {Uint8Array[]} ioQueue - * @param {string} encoding - */ -function decode (ioQueue, encoding) { - const bytes = combineByteSequences(ioQueue) + if (statusCode < 200) { + return + } - // 1. Let BOMEncoding be the result of BOM sniffing ioQueue. - const BOMEncoding = BOMSniffing(bytes) + /* istanbul ignore next: should be handled by llhttp? */ + if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) { + util.destroy(socket, new ResponseContentLengthMismatchError()) + return -1 + } - let slice = 0 + request.onComplete(headers) - // 2. If BOMEncoding is non-null: - if (BOMEncoding !== null) { - // 1. Set encoding to BOMEncoding. - encoding = BOMEncoding + client[kQueue][client[kRunningIdx]++] = null - // 2. Read three bytes from ioQueue, if BOMEncoding is - // UTF-8; otherwise read two bytes. - // (Do nothing with those bytes.) - slice = BOMEncoding === 'UTF-8' ? 3 : 2 + if (socket[kWriting]) { + assert.strictEqual(client[kRunning], 0) + // Response completed before request. + util.destroy(socket, new InformationalError('reset')) + return constants.ERROR.PAUSED + } else if (!shouldKeepAlive) { + util.destroy(socket, new InformationalError('reset')) + return constants.ERROR.PAUSED + } else if (socket[kReset] && client[kRunning] === 0) { + // Destroy socket once all requests have completed. + // The request at the tail of the pipeline is the one + // that requested reset and no further requests should + // have been queued since then. + util.destroy(socket, new InformationalError('reset')) + return constants.ERROR.PAUSED + } else if (client[kPipelining] === 1) { + // We must wait a full event loop cycle to reuse this socket to make sure + // that non-spec compliant servers are not closing the connection even if they + // said they won't. + setImmediate(resume, client) + } else { + resume(client) + } } +} - // 3. Process a queue with an instance of encoding’s - // decoder, ioQueue, output, and "replacement". +function onParserTimeout (parser) { + const { socket, timeoutType, client } = parser - // 4. Return output. + /* istanbul ignore else */ + if (timeoutType === TIMEOUT_HEADERS) { + if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { + assert(!parser.paused, 'cannot be paused while waiting for headers') + util.destroy(socket, new HeadersTimeoutError()) + } + } else if (timeoutType === TIMEOUT_BODY) { + if (!parser.paused) { + util.destroy(socket, new BodyTimeoutError()) + } + } else if (timeoutType === TIMEOUT_IDLE) { + assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]) + util.destroy(socket, new InformationalError('socket idle timeout')) + } +} - const sliced = bytes.slice(slice) - return new TextDecoder(encoding).decode(sliced) +function onSocketReadable () { + const { [kParser]: parser } = this + if (parser) { + parser.readMore() + } } -/** - * @see https://encoding.spec.whatwg.org/#bom-sniff - * @param {Uint8Array} ioQueue - */ -function BOMSniffing (ioQueue) { - // 1. Let BOM be the result of peeking 3 bytes from ioQueue, - // converted to a byte sequence. - const [a, b, c] = ioQueue +function onSocketError (err) { + const { [kClient]: client, [kParser]: parser } = this - // 2. For each of the rows in the table below, starting with - // the first one and going down, if BOM starts with the - // bytes given in the first column, then return the - // encoding given in the cell in the second column of that - // row. Otherwise, return null. - if (a === 0xEF && b === 0xBB && c === 0xBF) { - return 'UTF-8' - } else if (a === 0xFE && b === 0xFF) { - return 'UTF-16BE' - } else if (a === 0xFF && b === 0xFE) { - return 'UTF-16LE' + assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID') + + if (client[kHTTPConnVersion] !== 'h2') { + // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded + // to the user. + if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) { + // We treat all incoming data so for as a valid response. + parser.onMessageComplete() + return + } } - return null + this[kError] = err + + onError(this[kClient], err) } -/** - * @param {Uint8Array[]} sequences - */ -function combineByteSequences (sequences) { - const size = sequences.reduce((a, b) => { - return a + b.byteLength - }, 0) +function onError (client, err) { + if ( + client[kRunning] === 0 && + err.code !== 'UND_ERR_INFO' && + err.code !== 'UND_ERR_SOCKET' + ) { + // Error is not caused by running request and not a recoverable + // socket error. - let offset = 0 + assert(client[kPendingIdx] === client[kRunningIdx]) - return sequences.reduce((a, b) => { - a.set(b, offset) - offset += b.byteLength - return a - }, new Uint8Array(size)) + const requests = client[kQueue].splice(client[kRunningIdx]) + for (let i = 0; i < requests.length; i++) { + const request = requests[i] + errorRequest(client, request, err) + } + assert(client[kSize] === 0) + } } -module.exports = { - staticPropertyDescriptors, - readOperation, - fireAProgressEvent -} +function onSocketEnd () { + const { [kParser]: parser, [kClient]: client } = this + if (client[kHTTPConnVersion] !== 'h2') { + if (parser.statusCode && !parser.shouldKeepAlive) { + // We treat all incoming data so far as a valid response. + parser.onMessageComplete() + return + } + } -/***/ }), + util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this))) +} -/***/ 29102: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +function onSocketClose () { + const { [kClient]: client, [kParser]: parser } = this + if (client[kHTTPConnVersion] === 'h1' && parser) { + if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { + // We treat all incoming data so far as a valid response. + parser.onMessageComplete() + } + this[kParser].destroy() + this[kParser] = null + } -// We include a version number for the Dispatcher API. In case of breaking changes, -// this version number must be increased to avoid conflicts. -const globalDispatcher = Symbol.for('undici.globalDispatcher.1') -const { InvalidArgumentError } = __nccwpck_require__(46339) -const Agent = __nccwpck_require__(97464) + const err = this[kError] || new SocketError('closed', util.getSocketInfo(this)) -if (getGlobalDispatcher() === undefined) { - setGlobalDispatcher(new Agent()) -} + client[kSocket] = null -function setGlobalDispatcher (agent) { - if (!agent || typeof agent.dispatch !== 'function') { - throw new InvalidArgumentError('Argument agent must implement Agent') - } - Object.defineProperty(globalThis, globalDispatcher, { - value: agent, - writable: true, - enumerable: false, - configurable: false - }) -} + if (client.destroyed) { + assert(client[kPending] === 0) -function getGlobalDispatcher () { - return globalThis[globalDispatcher] -} + // Fail entire queue. + const requests = client[kQueue].splice(client[kRunningIdx]) + for (let i = 0; i < requests.length; i++) { + const request = requests[i] + errorRequest(client, request, err) + } + } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') { + // Fail head of pipeline. + const request = client[kQueue][client[kRunningIdx]] + client[kQueue][client[kRunningIdx]++] = null -module.exports = { - setGlobalDispatcher, - getGlobalDispatcher -} + errorRequest(client, request, err) + } + client[kPendingIdx] = client[kRunningIdx] -/***/ }), + assert(client[kRunning] === 0) -/***/ 68640: -/***/ ((module) => { + client.emit('disconnect', client[kUrl], [client], err) + resume(client) +} +async function connect (client) { + assert(!client[kConnecting]) + assert(!client[kSocket]) -module.exports = class DecoratorHandler { - constructor (handler) { - this.handler = handler - } + let { host, hostname, protocol, port } = client[kUrl] - onConnect (...args) { - return this.handler.onConnect(...args) - } + // Resolve ipv6 + if (hostname[0] === '[') { + const idx = hostname.indexOf(']') - onError (...args) { - return this.handler.onError(...args) - } + assert(idx !== -1) + const ip = hostname.substring(1, idx) - onUpgrade (...args) { - return this.handler.onUpgrade(...args) + assert(net.isIP(ip)) + hostname = ip } - onHeaders (...args) { - return this.handler.onHeaders(...args) - } + client[kConnecting] = true - onData (...args) { - return this.handler.onData(...args) + if (channels.beforeConnect.hasSubscribers) { + channels.beforeConnect.publish({ + connectParams: { + host, + hostname, + protocol, + port, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector] + }) } - onComplete (...args) { - return this.handler.onComplete(...args) - } + try { + const socket = await new Promise((resolve, reject) => { + client[kConnector]({ + host, + hostname, + protocol, + port, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, (err, socket) => { + if (err) { + reject(err) + } else { + resolve(socket) + } + }) + }) - onBodySent (...args) { - return this.handler.onBodySent(...args) - } -} + if (client.destroyed) { + util.destroy(socket.on('error', () => {}), new ClientDestroyedError()) + return + } + client[kConnecting] = false -/***/ }), + assert(socket) -/***/ 59660: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + const isH2 = socket.alpnProtocol === 'h2' + if (isH2) { + if (!h2ExperimentalWarned) { + h2ExperimentalWarned = true + process.emitWarning('H2 support is experimental, expect them to change at any time.', { + code: 'UNDICI-H2' + }) + } + const session = http2.connect(client[kUrl], { + createConnection: () => socket, + peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams + }) + client[kHTTPConnVersion] = 'h2' + session[kClient] = client + session[kSocket] = socket + session.on('error', onHttp2SessionError) + session.on('frameError', onHttp2FrameError) + session.on('end', onHttp2SessionEnd) + session.on('goaway', onHTTP2GoAway) + session.on('close', onSocketClose) + session.unref() -const util = __nccwpck_require__(67468) -const { kBodyUsed } = __nccwpck_require__(48039) -const assert = __nccwpck_require__(39491) -const { InvalidArgumentError } = __nccwpck_require__(46339) -const EE = __nccwpck_require__(82361) + client[kHTTP2Session] = session + socket[kHTTP2Session] = session + } else { + if (!llhttpInstance) { + llhttpInstance = await llhttpPromise + llhttpPromise = null + } -const redirectableStatusCodes = [300, 301, 302, 303, 307, 308] + socket[kNoRef] = false + socket[kWriting] = false + socket[kReset] = false + socket[kBlocking] = false + socket[kParser] = new Parser(client, socket, llhttpInstance) + } -const kBody = Symbol('body') + socket[kCounter] = 0 + socket[kMaxRequests] = client[kMaxRequests] + socket[kClient] = client + socket[kError] = null -class BodyAsyncIterable { - constructor (body) { - this[kBody] = body - this[kBodyUsed] = false - } + socket + .on('error', onSocketError) + .on('readable', onSocketReadable) + .on('end', onSocketEnd) + .on('close', onSocketClose) - async * [Symbol.asyncIterator] () { - assert(!this[kBodyUsed], 'disturbed') - this[kBodyUsed] = true - yield * this[kBody] - } -} + client[kSocket] = socket -class RedirectHandler { - constructor (dispatch, maxRedirections, opts, handler) { - if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { - throw new InvalidArgumentError('maxRedirections must be a positive number') + if (channels.connected.hasSubscribers) { + channels.connected.publish({ + connectParams: { + host, + hostname, + protocol, + port, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector], + socket + }) + } + client.emit('connect', client[kUrl], [client]) + } catch (err) { + if (client.destroyed) { + return } - util.validateHandler(handler, opts.method, opts.upgrade) - - this.dispatch = dispatch - this.location = null - this.abort = null - this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy - this.maxRedirections = maxRedirections - this.handler = handler - this.history = [] + client[kConnecting] = false - if (util.isStream(this.opts.body)) { - // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp - // so that it can be dispatched again? - // TODO (fix): Do we need 100-expect support to provide a way to do this properly? - if (util.bodyLength(this.opts.body) === 0) { - this.opts.body - .on('data', function () { - assert(false) - }) - } + if (channels.connectError.hasSubscribers) { + channels.connectError.publish({ + connectParams: { + host, + hostname, + protocol, + port, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector], + error: err + }) + } - if (typeof this.opts.body.readableDidRead !== 'boolean') { - this.opts.body[kBodyUsed] = false - EE.prototype.on.call(this.opts.body, 'data', function () { - this[kBodyUsed] = true - }) + if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') { + assert(client[kRunning] === 0) + while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { + const request = client[kQueue][client[kPendingIdx]++] + errorRequest(client, request, err) } - } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') { - // TODO (fix): We can't access ReadableStream internal state - // to determine whether or not it has been disturbed. This is just - // a workaround. - this.opts.body = new BodyAsyncIterable(this.opts.body) - } else if ( - this.opts.body && - typeof this.opts.body !== 'string' && - !ArrayBuffer.isView(this.opts.body) && - util.isIterable(this.opts.body) - ) { - // TODO: Should we allow re-using iterable if !this.opts.idempotent - // or through some other flag? - this.opts.body = new BodyAsyncIterable(this.opts.body) + } else { + onError(client, err) } - } - onConnect (abort) { - this.abort = abort - this.handler.onConnect(abort, { history: this.history }) + client.emit('connectionError', client[kUrl], [client], err) } - onUpgrade (statusCode, headers, socket) { - this.handler.onUpgrade(statusCode, headers, socket) - } + resume(client) +} - onError (error) { - this.handler.onError(error) +function emitDrain (client) { + client[kNeedDrain] = 0 + client.emit('drain', client[kUrl], [client]) +} + +function resume (client, sync) { + if (client[kResuming] === 2) { + return } - onHeaders (statusCode, headers, resume, statusText) { - this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) - ? null - : parseLocation(statusCode, headers) + client[kResuming] = 2 - if (this.opts.origin) { - this.history.push(new URL(this.opts.path, this.opts.origin)) + _resume(client, sync) + client[kResuming] = 0 + + if (client[kRunningIdx] > 256) { + client[kQueue].splice(0, client[kRunningIdx]) + client[kPendingIdx] -= client[kRunningIdx] + client[kRunningIdx] = 0 + } +} + +function _resume (client, sync) { + while (true) { + if (client.destroyed) { + assert(client[kPending] === 0) + return } - if (!this.location) { - return this.handler.onHeaders(statusCode, headers, resume, statusText) + if (client[kClosedResolve] && !client[kSize]) { + client[kClosedResolve]() + client[kClosedResolve] = null + return } - const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))) - const path = search ? `${pathname}${search}` : pathname + const socket = client[kSocket] - // Remove headers referring to the original URL. - // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers. - // https://tools.ietf.org/html/rfc7231#section-6.4 - this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin) - this.opts.path = path - this.opts.origin = origin - this.opts.maxRedirections = 0 - this.opts.query = null + if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') { + if (client[kSize] === 0) { + if (!socket[kNoRef] && socket.unref) { + socket.unref() + socket[kNoRef] = true + } + } else if (socket[kNoRef] && socket.ref) { + socket.ref() + socket[kNoRef] = false + } - // https://tools.ietf.org/html/rfc7231#section-6.4.4 - // In case of HTTP 303, always replace method to be either HEAD or GET - if (statusCode === 303 && this.opts.method !== 'HEAD') { - this.opts.method = 'GET' - this.opts.body = null + if (client[kSize] === 0) { + if (socket[kParser].timeoutType !== TIMEOUT_IDLE) { + socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE) + } + } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) { + if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) { + const request = client[kQueue][client[kRunningIdx]] + const headersTimeout = request.headersTimeout != null + ? request.headersTimeout + : client[kHeadersTimeout] + socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS) + } + } + } + + if (client[kBusy]) { + client[kNeedDrain] = 2 + } else if (client[kNeedDrain] === 2) { + if (sync) { + client[kNeedDrain] = 1 + process.nextTick(emitDrain, client) + } else { + emitDrain(client) + } + continue } - } - onData (chunk) { - if (this.location) { - /* - https://tools.ietf.org/html/rfc7231#section-6.4 + if (client[kPending] === 0) { + return + } - TLDR: undici always ignores 3xx response bodies. + if (client[kRunning] >= (client[kPipelining] || 1)) { + return + } - Redirection is used to serve the requested resource from another URL, so it is assumes that - no body is generated (and thus can be ignored). Even though generating a body is not prohibited. + const request = client[kQueue][client[kPendingIdx]] - For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually - (which means it's optional and not mandated) contain just an hyperlink to the value of - the Location response header, so the body can be ignored safely. + if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) { + if (client[kRunning] > 0) { + return + } - For status 300, which is "Multiple Choices", the spec mentions both generating a Location - response header AND a response body with the other possible location to follow. - Since the spec explicitily chooses not to specify a format for such body and leave it to - servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it. - */ - } else { - return this.handler.onData(chunk) - } - } + client[kServerName] = request.servername - onComplete (trailers) { - if (this.location) { - /* - https://tools.ietf.org/html/rfc7231#section-6.4 + if (socket && socket.servername !== request.servername) { + util.destroy(socket, new InformationalError('servername changed')) + return + } + } - TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections - and neither are useful if present. + if (client[kConnecting]) { + return + } - See comment on onData method above for more detailed informations. - */ + if (!socket && !client[kHTTP2Session]) { + connect(client) + return + } - this.location = null - this.abort = null + if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) { + return + } - this.dispatch(this.opts, this) - } else { - this.handler.onComplete(trailers) + if (client[kRunning] > 0 && !request.idempotent) { + // Non-idempotent request cannot be retried. + // Ensure that no other requests are inflight and + // could cause failure. + return } - } - onBodySent (chunk) { - if (this.handler.onBodySent) { - this.handler.onBodySent(chunk) + if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) { + // Don't dispatch an upgrade until all preceding requests have completed. + // A misbehaving server might upgrade the connection before all pipelined + // request has completed. + return } - } -} -function parseLocation (statusCode, headers) { - if (redirectableStatusCodes.indexOf(statusCode) === -1) { - return null - } + if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 && + (util.isStream(request.body) || util.isAsyncIterable(request.body))) { + // Request with stream or iterator body can error while other requests + // are inflight and indirectly error those as well. + // Ensure this doesn't happen by waiting for inflight + // to complete before dispatching. - for (let i = 0; i < headers.length; i += 2) { - if (headers[i].toString().toLowerCase() === 'location') { - return headers[i + 1] + // Request with stream or iterator body cannot be retried. + // Ensure that no other requests are inflight and + // could cause failure. + return + } + + if (!request.aborted && write(client, request)) { + client[kPendingIdx]++ + } else { + client[kQueue].splice(client[kPendingIdx], 1) } } } -// https://tools.ietf.org/html/rfc7231#section-6.4.4 -function shouldRemoveHeader (header, removeContent, unknownOrigin) { - return ( - (header.length === 4 && header.toString().toLowerCase() === 'host') || - (removeContent && header.toString().toLowerCase().indexOf('content-') === 0) || - (unknownOrigin && header.length === 13 && header.toString().toLowerCase() === 'authorization') || - (unknownOrigin && header.length === 6 && header.toString().toLowerCase() === 'cookie') - ) +// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2 +function shouldSendContentLength (method) { + return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT' } -// https://tools.ietf.org/html/rfc7231#section-6.4 -function cleanRequestHeaders (headers, removeContent, unknownOrigin) { - const ret = [] - if (Array.isArray(headers)) { - for (let i = 0; i < headers.length; i += 2) { - if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) { - ret.push(headers[i], headers[i + 1]) - } - } - } else if (headers && typeof headers === 'object') { - for (const key of Object.keys(headers)) { - if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) { - ret.push(key, headers[key]) - } - } - } else { - assert(headers == null, 'headers must be an object or an array') +function write (client, request) { + if (client[kHTTPConnVersion] === 'h2') { + writeH2(client, client[kHTTP2Session], request) + return } - return ret -} -module.exports = RedirectHandler + const { body, method, path, host, upgrade, headers, blocking, reset } = request + // https://tools.ietf.org/html/rfc7231#section-4.3.1 + // https://tools.ietf.org/html/rfc7231#section-4.3.2 + // https://tools.ietf.org/html/rfc7231#section-4.3.5 -/***/ }), + // Sending a payload body on a request that does not + // expect it can cause undefined behavior on some + // servers and corrupt connection state. Do not + // re-use the connection for further requests. -/***/ 74989: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + const expectsPayload = ( + method === 'PUT' || + method === 'POST' || + method === 'PATCH' + ) -const assert = __nccwpck_require__(39491) + if (body && typeof body.read === 'function') { + // Try to read EOF in order to get length. + body.read(0) + } -const { kRetryHandlerDefaultRetry } = __nccwpck_require__(48039) -const { RequestRetryError } = __nccwpck_require__(46339) -const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(67468) + const bodyLength = util.bodyLength(body) -function calculateRetryAfterHeader (retryAfter) { - const current = Date.now() - const diff = new Date(retryAfter).getTime() - current + let contentLength = bodyLength - return diff -} + if (contentLength === null) { + contentLength = request.contentLength + } -class RetryHandler { - constructor (opts, handlers) { - const { retryOptions, ...dispatchOpts } = opts - const { - // Retry scoped - retry: retryFn, - maxRetries, - maxTimeout, - minTimeout, - timeoutFactor, - // Response scoped - methods, - errorCodes, - retryAfter, - statusCodes - } = retryOptions ?? {} + if (contentLength === 0 && !expectsPayload) { + // https://tools.ietf.org/html/rfc7230#section-3.3.2 + // A user agent SHOULD NOT send a Content-Length header field when + // the request message does not contain a payload body and the method + // semantics do not anticipate such a body. - this.dispatch = handlers.dispatch - this.handler = handlers.handler - this.opts = dispatchOpts - this.abort = null - this.aborted = false - this.retryOpts = { - retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry], - retryAfter: retryAfter ?? true, - maxTimeout: maxTimeout ?? 30 * 1000, // 30s, - timeout: minTimeout ?? 500, // .5s - timeoutFactor: timeoutFactor ?? 2, - maxRetries: maxRetries ?? 5, - // What errors we should retry - methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'], - // Indicates which errors to retry - statusCodes: statusCodes ?? [500, 502, 503, 504, 429], - // List of errors to retry - errorCodes: errorCodes ?? [ - 'ECONNRESET', - 'ECONNREFUSED', - 'ENOTFOUND', - 'ENETDOWN', - 'ENETUNREACH', - 'EHOSTDOWN', - 'EHOSTUNREACH', - 'EPIPE' - ] + contentLength = null + } + + // https://github.com/nodejs/undici/issues/2046 + // A user agent may send a Content-Length header with 0 value, this should be allowed. + if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) { + if (client[kStrictContentLength]) { + errorRequest(client, request, new RequestContentLengthMismatchError()) + return false } - this.retryCount = 0 - this.start = 0 - this.end = null - this.etag = null - this.resume = null + process.emitWarning(new RequestContentLengthMismatchError()) + } - // Handle possible onConnect duplication - this.handler.onConnect(reason => { - this.aborted = true - if (this.abort) { - this.abort(reason) - } else { - this.reason = reason + const socket = client[kSocket] + + try { + request.onConnect((err) => { + if (request.aborted || request.completed) { + return } + + errorRequest(client, request, err || new RequestAbortedError()) + + util.destroy(socket, new InformationalError('aborted')) }) + } catch (err) { + errorRequest(client, request, err) } - onRequestSent () { - if (this.handler.onRequestSent) { - this.handler.onRequestSent() - } + if (request.aborted) { + return false } - onUpgrade (statusCode, headers, socket) { - if (this.handler.onUpgrade) { - this.handler.onUpgrade(statusCode, headers, socket) - } - } + if (method === 'HEAD') { + // https://github.com/mcollina/undici/issues/258 + // Close after a HEAD request to interop with misbehaving servers + // that may send a body in the response. - onConnect (abort) { - if (this.aborted) { - abort(this.reason) - } else { - this.abort = abort - } + socket[kReset] = true } - onBodySent (chunk) { - if (this.handler.onBodySent) return this.handler.onBodySent(chunk) + if (upgrade || method === 'CONNECT') { + // On CONNECT or upgrade, block pipeline from dispatching further + // requests on this connection. + + socket[kReset] = true } - static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) { - const { statusCode, code, headers } = err - const { method, retryOptions } = opts - const { - maxRetries, - timeout, - maxTimeout, - timeoutFactor, - statusCodes, - errorCodes, - methods - } = retryOptions - let { counter, currentTimeout } = state + if (reset != null) { + socket[kReset] = reset + } - currentTimeout = - currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout + if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) { + socket[kReset] = true + } - // Any code that is not a Undici's originated and allowed to retry - if ( - code && - code !== 'UND_ERR_REQ_RETRY' && - code !== 'UND_ERR_SOCKET' && - !errorCodes.includes(code) - ) { - cb(err) - return - } + if (blocking) { + socket[kBlocking] = true + } - // If a set of method are provided and the current method is not in the list - if (Array.isArray(methods) && !methods.includes(method)) { - cb(err) - return - } + let header = `${method} ${path} HTTP/1.1\r\n` - // If a set of status code are provided and the current status code is not in the list - if ( - statusCode != null && - Array.isArray(statusCodes) && - !statusCodes.includes(statusCode) - ) { - cb(err) - return - } + if (typeof host === 'string') { + header += `host: ${host}\r\n` + } else { + header += client[kHostHeader] + } - // If we reached the max number of retries - if (counter > maxRetries) { - cb(err) - return - } + if (upgrade) { + header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n` + } else if (client[kPipelining] && !socket[kReset]) { + header += 'connection: keep-alive\r\n' + } else { + header += 'connection: close\r\n' + } - let retryAfterHeader = headers != null && headers['retry-after'] - if (retryAfterHeader) { - retryAfterHeader = Number(retryAfterHeader) - retryAfterHeader = isNaN(retryAfterHeader) - ? calculateRetryAfterHeader(retryAfterHeader) - : retryAfterHeader * 1e3 // Retry-After is in seconds - } + if (headers) { + header += headers + } - const retryTimeout = - retryAfterHeader > 0 - ? Math.min(retryAfterHeader, maxTimeout) - : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout) + if (channels.sendHeaders.hasSubscribers) { + channels.sendHeaders.publish({ request, headers: header, socket }) + } - state.currentTimeout = retryTimeout + /* istanbul ignore else: assertion */ + if (!body || bodyLength === 0) { + if (contentLength === 0) { + socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1') + } else { + assert(contentLength === null, 'no body must not have content length') + socket.write(`${header}\r\n`, 'latin1') + } + request.onRequestSent() + } else if (util.isBuffer(body)) { + assert(contentLength === body.byteLength, 'buffer body must have content length') - setTimeout(() => cb(null), retryTimeout) + socket.cork() + socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') + socket.write(body) + socket.uncork() + request.onBodySent(body) + request.onRequestSent() + if (!expectsPayload) { + socket[kReset] = true + } + } else if (util.isBlobLike(body)) { + if (typeof body.stream === 'function') { + writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload }) + } else { + writeBlob({ body, client, request, socket, contentLength, header, expectsPayload }) + } + } else if (util.isStream(body)) { + writeStream({ body, client, request, socket, contentLength, header, expectsPayload }) + } else if (util.isIterable(body)) { + writeIterable({ body, client, request, socket, contentLength, header, expectsPayload }) + } else { + assert(false) } - onHeaders (statusCode, rawHeaders, resume, statusMessage) { - const headers = parseHeaders(rawHeaders) + return true +} - this.retryCount += 1 +function writeH2 (client, session, request) { + const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request - if (statusCode >= 300) { - this.abort( - new RequestRetryError('Request failed', statusCode, { - headers, - count: this.retryCount - }) - ) - return false - } + let headers + if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim()) + else headers = reqHeaders - // Checkpoint for resume from where we left it - if (this.resume != null) { - this.resume = null + if (upgrade) { + errorRequest(client, request, new Error('Upgrade not supported for H2')) + return false + } - if (statusCode !== 206) { - return true + try { + // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event? + request.onConnect((err) => { + if (request.aborted || request.completed) { + return } - const contentRange = parseRangeHeader(headers['content-range']) - // If no content range - if (!contentRange) { - this.abort( - new RequestRetryError('Content-Range mismatch', statusCode, { - headers, - count: this.retryCount - }) - ) - return false - } + errorRequest(client, request, err || new RequestAbortedError()) + }) + } catch (err) { + errorRequest(client, request, err) + } - // Let's start with a weak etag check - if (this.etag != null && this.etag !== headers.etag) { - this.abort( - new RequestRetryError('ETag mismatch', statusCode, { - headers, - count: this.retryCount - }) - ) - return false - } + if (request.aborted) { + return false + } - const { start, size, end = size } = contentRange + /** @type {import('node:http2').ClientHttp2Stream} */ + let stream + const h2State = client[kHTTP2SessionState] - assert(this.start === start, 'content-range mismatch') - assert(this.end == null || this.end === end, 'content-range mismatch') + headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost] + headers[HTTP2_HEADER_METHOD] = method - this.resume = resume - return true + if (method === 'CONNECT') { + session.ref() + // we are already connected, streams are pending, first request + // will create a new stream. We trigger a request to create the stream and wait until + // `ready` event is triggered + // We disabled endStream to allow the user to write to the stream + stream = session.request(headers, { endStream: false, signal }) + + if (stream.id && !stream.pending) { + request.onUpgrade(null, null, stream) + ++h2State.openStreams + } else { + stream.once('ready', () => { + request.onUpgrade(null, null, stream) + ++h2State.openStreams + }) } - if (this.end == null) { - if (statusCode === 206) { - // First time we receive 206 - const range = parseRangeHeader(headers['content-range']) + stream.once('close', () => { + h2State.openStreams -= 1 + // TODO(HTTP/2): unref only if current streams count is 0 + if (h2State.openStreams === 0) session.unref() + }) - if (range == null) { - return this.handler.onHeaders( - statusCode, - rawHeaders, - resume, - statusMessage - ) - } + return true + } - const { start, size, end = size } = range + // https://tools.ietf.org/html/rfc7540#section-8.3 + // :path and :scheme headers must be omited when sending CONNECT - assert( - start != null && Number.isFinite(start) && this.start !== start, - 'content-range mismatch' - ) - assert(Number.isFinite(start)) - assert( - end != null && Number.isFinite(end) && this.end !== end, - 'invalid content-length' - ) + headers[HTTP2_HEADER_PATH] = path + headers[HTTP2_HEADER_SCHEME] = 'https' - this.start = start - this.end = end - } + // https://tools.ietf.org/html/rfc7231#section-4.3.1 + // https://tools.ietf.org/html/rfc7231#section-4.3.2 + // https://tools.ietf.org/html/rfc7231#section-4.3.5 - // We make our best to checkpoint the body for further range headers - if (this.end == null) { - const contentLength = headers['content-length'] - this.end = contentLength != null ? Number(contentLength) : null - } + // Sending a payload body on a request that does not + // expect it can cause undefined behavior on some + // servers and corrupt connection state. Do not + // re-use the connection for further requests. - assert(Number.isFinite(this.start)) - assert( - this.end == null || Number.isFinite(this.end), - 'invalid content-length' - ) + const expectsPayload = ( + method === 'PUT' || + method === 'POST' || + method === 'PATCH' + ) - this.resume = resume - this.etag = headers.etag != null ? headers.etag : null + if (body && typeof body.read === 'function') { + // Try to read EOF in order to get length. + body.read(0) + } - return this.handler.onHeaders( - statusCode, - rawHeaders, - resume, - statusMessage - ) - } + let contentLength = util.bodyLength(body) - const err = new RequestRetryError('Request failed', statusCode, { - headers, - count: this.retryCount - }) + if (contentLength == null) { + contentLength = request.contentLength + } - this.abort(err) + if (contentLength === 0 || !expectsPayload) { + // https://tools.ietf.org/html/rfc7230#section-3.3.2 + // A user agent SHOULD NOT send a Content-Length header field when + // the request message does not contain a payload body and the method + // semantics do not anticipate such a body. - return false + contentLength = null } - onData (chunk) { - this.start += chunk.length + // https://github.com/nodejs/undici/issues/2046 + // A user agent may send a Content-Length header with 0 value, this should be allowed. + if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) { + if (client[kStrictContentLength]) { + errorRequest(client, request, new RequestContentLengthMismatchError()) + return false + } - return this.handler.onData(chunk) + process.emitWarning(new RequestContentLengthMismatchError()) } - onComplete (rawTrailers) { - this.retryCount = 0 - return this.handler.onComplete(rawTrailers) + if (contentLength != null) { + assert(body, 'no body must not have content length') + headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}` } - onError (err) { - if (this.aborted || isDisturbed(this.opts.body)) { - return this.handler.onError(err) - } - - this.retryOpts.retry( - err, - { - state: { counter: this.retryCount++, currentTimeout: this.retryAfter }, - opts: { retryOptions: this.retryOpts, ...this.opts } - }, - onRetry.bind(this) - ) - - function onRetry (err) { - if (err != null || this.aborted || isDisturbed(this.opts.body)) { - return this.handler.onError(err) - } + session.ref() - if (this.start !== 0) { - this.opts = { - ...this.opts, - headers: { - ...this.opts.headers, - range: `bytes=${this.start}-${this.end ?? ''}` - } - } - } + const shouldEndStream = method === 'GET' || method === 'HEAD' + if (expectContinue) { + headers[HTTP2_HEADER_EXPECT] = '100-continue' + stream = session.request(headers, { endStream: shouldEndStream, signal }) - try { - this.dispatch(this.opts, this) - } catch (err) { - this.handler.onError(err) - } - } + stream.once('continue', writeBodyH2) + } else { + stream = session.request(headers, { + endStream: shouldEndStream, + signal + }) + writeBodyH2() } -} - -module.exports = RetryHandler + // Increment counter as we have new several streams open + ++h2State.openStreams -/***/ }), + stream.once('response', headers => { + const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers -/***/ 72509: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) { + stream.pause() + } + }) + stream.once('end', () => { + request.onComplete([]) + }) + stream.on('data', (chunk) => { + if (request.onData(chunk) === false) { + stream.pause() + } + }) -const RedirectHandler = __nccwpck_require__(59660) + stream.once('close', () => { + h2State.openStreams -= 1 + // TODO(HTTP/2): unref only if current streams count is 0 + if (h2State.openStreams === 0) { + session.unref() + } + }) -function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) { - return (dispatch) => { - return function Intercept (opts, handler) { - const { maxRedirections = defaultMaxRedirections } = opts + stream.once('error', function (err) { + if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { + h2State.streams -= 1 + util.destroy(stream, err) + } + }) - if (!maxRedirections) { - return dispatch(opts, handler) - } + stream.once('frameError', (type, code) => { + const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`) + errorRequest(client, request, err) - const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler) - opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting. - return dispatch(opts, redirectHandler) + if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { + h2State.streams -= 1 + util.destroy(stream, err) } - } -} - -module.exports = createRedirectInterceptor + }) + // stream.on('aborted', () => { + // // TODO(HTTP/2): Support aborted + // }) -/***/ }), + // stream.on('timeout', () => { + // // TODO(HTTP/2): Support timeout + // }) -/***/ 49614: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + // stream.on('push', headers => { + // // TODO(HTTP/2): Suppor push + // }) + // stream.on('trailers', headers => { + // // TODO(HTTP/2): Support trailers + // }) -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; -const utils_1 = __nccwpck_require__(29451); -// C headers -var ERROR; -(function (ERROR) { - ERROR[ERROR["OK"] = 0] = "OK"; - ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL"; - ERROR[ERROR["STRICT"] = 2] = "STRICT"; - ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED"; - ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH"; - ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION"; - ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD"; - ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL"; - ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT"; - ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION"; - ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN"; - ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH"; - ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE"; - ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS"; - ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE"; - ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING"; - ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN"; - ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE"; - ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE"; - ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER"; - ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE"; - ERROR[ERROR["PAUSED"] = 21] = "PAUSED"; - ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE"; - ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE"; - ERROR[ERROR["USER"] = 24] = "USER"; -})(ERROR = exports.ERROR || (exports.ERROR = {})); -var TYPE; -(function (TYPE) { - TYPE[TYPE["BOTH"] = 0] = "BOTH"; - TYPE[TYPE["REQUEST"] = 1] = "REQUEST"; - TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE"; -})(TYPE = exports.TYPE || (exports.TYPE = {})); -var FLAGS; -(function (FLAGS) { - FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE"; - FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE"; - FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE"; - FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED"; - FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE"; - FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH"; - FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY"; - FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING"; - // 1 << 8 is unused - FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING"; -})(FLAGS = exports.FLAGS || (exports.FLAGS = {})); -var LENIENT_FLAGS; -(function (LENIENT_FLAGS) { - LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS"; - LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH"; - LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE"; -})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {})); -var METHODS; -(function (METHODS) { - METHODS[METHODS["DELETE"] = 0] = "DELETE"; - METHODS[METHODS["GET"] = 1] = "GET"; - METHODS[METHODS["HEAD"] = 2] = "HEAD"; - METHODS[METHODS["POST"] = 3] = "POST"; - METHODS[METHODS["PUT"] = 4] = "PUT"; - /* pathological */ - METHODS[METHODS["CONNECT"] = 5] = "CONNECT"; - METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS"; - METHODS[METHODS["TRACE"] = 7] = "TRACE"; - /* WebDAV */ - METHODS[METHODS["COPY"] = 8] = "COPY"; - METHODS[METHODS["LOCK"] = 9] = "LOCK"; - METHODS[METHODS["MKCOL"] = 10] = "MKCOL"; - METHODS[METHODS["MOVE"] = 11] = "MOVE"; - METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND"; - METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH"; - METHODS[METHODS["SEARCH"] = 14] = "SEARCH"; - METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK"; - METHODS[METHODS["BIND"] = 16] = "BIND"; - METHODS[METHODS["REBIND"] = 17] = "REBIND"; - METHODS[METHODS["UNBIND"] = 18] = "UNBIND"; - METHODS[METHODS["ACL"] = 19] = "ACL"; - /* subversion */ - METHODS[METHODS["REPORT"] = 20] = "REPORT"; - METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY"; - METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT"; - METHODS[METHODS["MERGE"] = 23] = "MERGE"; - /* upnp */ - METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH"; - METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY"; - METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE"; - METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE"; - /* RFC-5789 */ - METHODS[METHODS["PATCH"] = 28] = "PATCH"; - METHODS[METHODS["PURGE"] = 29] = "PURGE"; - /* CalDAV */ - METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR"; - /* RFC-2068, section 19.6.1.2 */ - METHODS[METHODS["LINK"] = 31] = "LINK"; - METHODS[METHODS["UNLINK"] = 32] = "UNLINK"; - /* icecast */ - METHODS[METHODS["SOURCE"] = 33] = "SOURCE"; - /* RFC-7540, section 11.6 */ - METHODS[METHODS["PRI"] = 34] = "PRI"; - /* RFC-2326 RTSP */ - METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE"; - METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE"; - METHODS[METHODS["SETUP"] = 37] = "SETUP"; - METHODS[METHODS["PLAY"] = 38] = "PLAY"; - METHODS[METHODS["PAUSE"] = 39] = "PAUSE"; - METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN"; - METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER"; - METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER"; - METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT"; - METHODS[METHODS["RECORD"] = 44] = "RECORD"; - /* RAOP */ - METHODS[METHODS["FLUSH"] = 45] = "FLUSH"; -})(METHODS = exports.METHODS || (exports.METHODS = {})); -exports.METHODS_HTTP = [ - METHODS.DELETE, - METHODS.GET, - METHODS.HEAD, - METHODS.POST, - METHODS.PUT, - METHODS.CONNECT, - METHODS.OPTIONS, - METHODS.TRACE, - METHODS.COPY, - METHODS.LOCK, - METHODS.MKCOL, - METHODS.MOVE, - METHODS.PROPFIND, - METHODS.PROPPATCH, - METHODS.SEARCH, - METHODS.UNLOCK, - METHODS.BIND, - METHODS.REBIND, - METHODS.UNBIND, - METHODS.ACL, - METHODS.REPORT, - METHODS.MKACTIVITY, - METHODS.CHECKOUT, - METHODS.MERGE, - METHODS['M-SEARCH'], - METHODS.NOTIFY, - METHODS.SUBSCRIBE, - METHODS.UNSUBSCRIBE, - METHODS.PATCH, - METHODS.PURGE, - METHODS.MKCALENDAR, - METHODS.LINK, - METHODS.UNLINK, - METHODS.PRI, - // TODO(indutny): should we allow it with HTTP? - METHODS.SOURCE, -]; -exports.METHODS_ICE = [ - METHODS.SOURCE, -]; -exports.METHODS_RTSP = [ - METHODS.OPTIONS, - METHODS.DESCRIBE, - METHODS.ANNOUNCE, - METHODS.SETUP, - METHODS.PLAY, - METHODS.PAUSE, - METHODS.TEARDOWN, - METHODS.GET_PARAMETER, - METHODS.SET_PARAMETER, - METHODS.REDIRECT, - METHODS.RECORD, - METHODS.FLUSH, - // For AirPlay - METHODS.GET, - METHODS.POST, -]; -exports.METHOD_MAP = utils_1.enumToMap(METHODS); -exports.H_METHOD_MAP = {}; -Object.keys(exports.METHOD_MAP).forEach((key) => { - if (/^H/.test(key)) { - exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key]; - } -}); -var FINISH; -(function (FINISH) { - FINISH[FINISH["SAFE"] = 0] = "SAFE"; - FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB"; - FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE"; -})(FINISH = exports.FINISH || (exports.FINISH = {})); -exports.ALPHA = []; -for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) { - // Upper case - exports.ALPHA.push(String.fromCharCode(i)); - // Lower case - exports.ALPHA.push(String.fromCharCode(i + 0x20)); -} -exports.NUM_MAP = { - 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, - 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, -}; -exports.HEX_MAP = { - 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, - 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, - A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF, - a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf, -}; -exports.NUM = [ - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', -]; -exports.ALPHANUM = exports.ALPHA.concat(exports.NUM); -exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')']; -exports.USERINFO_CHARS = exports.ALPHANUM - .concat(exports.MARK) - .concat(['%', ';', ':', '&', '=', '+', '$', ',']); -// TODO(indutny): use RFC -exports.STRICT_URL_CHAR = [ - '!', '"', '$', '%', '&', '\'', - '(', ')', '*', '+', ',', '-', '.', '/', - ':', ';', '<', '=', '>', - '@', '[', '\\', ']', '^', '_', - '`', - '{', '|', '}', '~', -].concat(exports.ALPHANUM); -exports.URL_CHAR = exports.STRICT_URL_CHAR - .concat(['\t', '\f']); -// All characters with 0x80 bit set to 1 -for (let i = 0x80; i <= 0xff; i++) { - exports.URL_CHAR.push(i); -} -exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']); -/* Tokens as defined by rfc 2616. Also lowercases them. - * token = 1* - * separators = "(" | ")" | "<" | ">" | "@" - * | "," | ";" | ":" | "\" | <"> - * | "/" | "[" | "]" | "?" | "=" - * | "{" | "}" | SP | HT - */ -exports.STRICT_TOKEN = [ - '!', '#', '$', '%', '&', '\'', - '*', '+', '-', '.', - '^', '_', '`', - '|', '~', -].concat(exports.ALPHANUM); -exports.TOKEN = exports.STRICT_TOKEN.concat([' ']); -/* - * Verify that a char is a valid visible (printable) US-ASCII - * character or %x80-FF - */ -exports.HEADER_CHARS = ['\t']; -for (let i = 32; i <= 255; i++) { - if (i !== 127) { - exports.HEADER_CHARS.push(i); - } -} -// ',' = \x44 -exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44); -exports.MAJOR = exports.NUM_MAP; -exports.MINOR = exports.MAJOR; -var HEADER_STATE; -(function (HEADER_STATE) { - HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL"; - HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION"; - HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH"; - HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING"; - HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE"; - HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE"; - HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE"; - HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE"; - HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED"; -})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {})); -exports.SPECIAL_HEADERS = { - 'connection': HEADER_STATE.CONNECTION, - 'content-length': HEADER_STATE.CONTENT_LENGTH, - 'proxy-connection': HEADER_STATE.CONNECTION, - 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING, - 'upgrade': HEADER_STATE.UPGRADE, -}; -//# sourceMappingURL=constants.js.map + return true -/***/ }), + function writeBodyH2 () { + /* istanbul ignore else: assertion */ + if (!body) { + request.onRequestSent() + } else if (util.isBuffer(body)) { + assert(contentLength === body.byteLength, 'buffer body must have content length') + stream.cork() + stream.write(body) + stream.uncork() + stream.end() + request.onBodySent(body) + request.onRequestSent() + } else if (util.isBlobLike(body)) { + if (typeof body.stream === 'function') { + writeIterable({ + client, + request, + contentLength, + h2stream: stream, + expectsPayload, + body: body.stream(), + socket: client[kSocket], + header: '' + }) + } else { + writeBlob({ + body, + client, + request, + contentLength, + expectsPayload, + h2stream: stream, + header: '', + socket: client[kSocket] + }) + } + } else if (util.isStream(body)) { + writeStream({ + body, + client, + request, + contentLength, + expectsPayload, + socket: client[kSocket], + h2stream: stream, + header: '' + }) + } else if (util.isIterable(body)) { + writeIterable({ + body, + client, + request, + contentLength, + expectsPayload, + header: '', + h2stream: stream, + socket: client[kSocket] + }) + } else { + assert(false) + } + } +} -/***/ 35099: -/***/ ((module) => { +function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { + assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined') -module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub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AX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACEMSAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvk8wEDDn8DfgR/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgACgCHCIQQX9qDt0B2gEB2QECAwQFBgcICQoLDA0O2AEPENcBERLWARMUFRYXGBkaG+AB3wEcHR7VAR8gISIjJCXUASYnKCkqKyzTAdIBLS7RAdABLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVG2wFHSElKzwHOAUvNAUzMAU1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1+f4ABgQGCAYMBhAGFAYYBhwGIAYkBigGLAYwB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RAMDwtBtQEhEAwOC0G2ASEQDA0LQbcBIRAMDAtBuAEhEAwLC0G5ASEQDAoLQboBIRAMCQtBuwEhEAwIC0HGASEQDAcLQbwBIRAMBgtBvQEhEAwFC0G+ASEQDAQLQb8BIRAMAwtBwAEhEAwCC0HCASEQDAELQcEBIRALA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQ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IRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAUNgIUIAAgATYCDEEAIRAMogELIABBADYCHCAAIBQ2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKEBCyAAQQA2AhwgACABNgIUIABBw4+AgAA2AhAgAEEHNgIMQQAhEAygAQtBACEQIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgwMnwELIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgxBACEQDJ4BCyAAQQA2AhwgACAUNgIUIABB/pGAgAA2AhAgAEEHNgIMQQAhEAydAQsgAEEANgIcIAAgATYCFCAAQY6bgIAANgIQIABBBjYCDEEAIRAMnAELIBBBFUYNVyAAQQA2AhwgACABNgIUIABBzI6AgAA2AhAgAEEgNgIMQQAhEAybAQsgAEEANgIAIBBBAWohAUEkIRALIAAgEDoAKSAAKAIEIRAgAEEANgIEIAAgECABEKuAgIAAIhANVCABIQEMPgsgAEEANgIAC0EAIRAgAEEAN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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAIAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABOT1VOQ0VFQ0tPVVRORUNURVRFQ1JJQkVMVVNIRVRFQURTRUFSQ0hSR0VDVElWSVRZTEVOREFSVkVPVElGWVBUSU9OU0NIU0VBWVNUQVRDSEdFT1JESVJFQ1RPUlRSQ0hQQVJBTUVURVJVUkNFQlNDUklCRUFSRE9XTkFDRUlORE5LQ0tVQlNDUklCRUhUVFAvQURUUC8=' + if (client[kHTTPConnVersion] === 'h2') { + // For HTTP/2, is enough to pipe the stream + const pipe = pipeline( + body, + h2stream, + (err) => { + if (err) { + util.destroy(body, err) + util.destroy(h2stream, err) + } else { + request.onRequestSent() + } + } + ) + pipe.on('data', onPipeData) + pipe.once('end', () => { + pipe.removeListener('data', onPipeData) + util.destroy(pipe) + }) -/***/ }), + function onPipeData (chunk) { + request.onBodySent(chunk) + } -/***/ 43315: -/***/ ((module) => { + return + } -module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub3IAEBFsbGh0dHBfZ2V0X21ldGhvZAARFmxsaHR0cF9nZXRfc3RhdHVzX2NvZGUAEhJsbGh0dHBfZ2V0X3VwZ3JhZGUAEwxsbGh0dHBfcmVzZXQAFA5sbGh0dHBfZXhlY3V0ZQAVFGxsaHR0cF9zZXR0aW5nc19pbml0ABYNbGxodH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AJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ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EGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQEMCgsgASIBIAJHDQZBGyEQDOADCwJAIAEiASACRw0AQRYhEAzgAwsgAEGKgICAADYCCCAAIAE2AgQgACABIAIQuICAgAAiEA3qASABIQFBICEQDMYDCwJAIAEiASACRg0AA0ACQCABLQAAQfC3gIAAai0AACIQQQJGDQACQCAQQX9qDgTlAewBAOsB7AELIAFBAWohAUEIIRAMyAMLIAFBAWoiASACRw0AC0EVIRAM3wMLQRUhEAzeAwsDQAJAIAEtAABB8LmAgABqLQAAIhBBAkYNACAQQX9qDgTeAewB4AHrAewBCyABQQFqIgEgAkcNAAtBGCEQDN0DCwJAIAEiASACRg0AIABBi4CAgAA2AgggACABNgIEIAEhAUEHIRAMxAMLQRkhEAzcAwsgAUEBaiEBDAILAkAgASIUIAJHDQBBGiEQDNsDCyAUIQECQCAULQAAQXNqDhTdAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAgDuAgtBACEQIABBADYCHCAAQa+LgIAANgIQIAB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ACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDK0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDKwBCyAAQQA2AhwgACABNgIUIABB3IiAgAA2AhAgAEEHNgIMQQAhEAyrAQsgEEE/Rw0BIAFBAWohAQtBBSEQDJABC0EAIRAgAEEANgIcIAAgATYCFCAAQf2SgIAANgIQIABBBzYCDAyoAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAynAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAymAQsgACgCBCEQ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IhAAwBCyACKAIIIQALIAAgATYCDCACIAE2AgggASACNgIMIAEgADYCCA8LQR8hAgJAIABB////B0sNACAAQQh2IgIgAkGA/j9qQRB2QQhxIgJ0IgQgBEGA4B9qQRB2QQRxIgR0IgYgBkGAgA9qQRB2QQJxIgZ0QQ92IAIgBHIgBnJrIgJBAXQgACACQRVqdkEBcXJBHGohAgsgASACNgIcIAFCADcCECACQQJ0QbjSgIAAaiEEAkACQEEAKAKM0ICAACIGQQEgAnQiA3ENACAEIAE2AgBBACAGIANyNgKM0ICAACABIAQ2AhggASABNgIIIAEgATYCDAwBCyAAQQBBGSACQQF2ayACQR9GG3QhAiAEKAIAIQYCQANAIAYiBCgCBEF4cSAARg0BIAJBHXYhBiACQQF0IQIgBCAGQQRxakEQaiIDKAIAIgYNAAsgAyABNgIAIAEgBDYCGCABIAE2AgwgASABNgIIDAELIAQoAggiACABNgIMIAQgATYCCCABQQA2AhggASAENgIMIAEgADYCCAtBAEEAKAKo0ICAAEF/aiIBQX8gARs2AqjQgIAACwsEAAAAC04AAkAgAA0APwBBEHQPCwJAIABB//8DcQ0AIABBf0wNAAJAIABBEHZAACIAQX9HDQBBAEEwNgL404CAAEF/DwsgAEEQdA8LEMqAgIAAAAvyAgIDfwF+AkAgAkUNACAAIAE6AAAgAiAAaiIDQX9qIAE6AAAgAkEDSQ0AIAAgAToAAiAAIAE6AAEgA0F9aiABOgAAIANBfmogAToAACACQQdJDQAgACABOgADIANBfGogAToAACACQQlJDQAgAEEAIABrQQNxIgRqIgMgAUH/AXFBgYKECGwiATYCACADIAIgBGtBfHEiBGoiAkF8aiABNgIAIARBCUkNACADIAE2AgggAyABNgIEIAJBeGogATYCACACQXRqIAE2AgAgBEEZSQ0AIAMgATYCGCADIAE2AhQgAyABNgIQIAMgATYCDCACQXBqIAE2AgAgAkFsaiABNgIAIAJBaGogATYCACACQWRqIAE2AgAgBCADQQRxQRhyIgVrIgJBIEkNACABrUKBgICAEH4hBiADIAVqIQEDQCABIAY3A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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAgAAAAACAAAAAAAAAAAAAAAAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==' + let finished = false + const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header }) -/***/ }), + const onData = function (chunk) { + if (finished) { + return + } -/***/ 29451: -/***/ ((__unused_webpack_module, exports) => { + try { + if (!writer.write(chunk) && this.pause) { + this.pause() + } + } catch (err) { + util.destroy(this, err) + } + } + const onDrain = function () { + if (finished) { + return + } + if (body.resume) { + body.resume() + } + } + const onAbort = function () { + if (finished) { + return + } + const err = new RequestAbortedError() + queueMicrotask(() => onFinished(err)) + } + const onFinished = function (err) { + if (finished) { + return + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.enumToMap = void 0; -function enumToMap(obj) { - const res = {}; - Object.keys(obj).forEach((key) => { - const value = obj[key]; - if (typeof value === 'number') { - res[key] = value; - } - }); - return res; -} -exports.enumToMap = enumToMap; -//# sourceMappingURL=utils.js.map + finished = true -/***/ }), + assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1)) -/***/ 21627: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + socket + .off('drain', onDrain) + .off('error', onFinished) + body + .removeListener('data', onData) + .removeListener('end', onFinished) + .removeListener('error', onFinished) + .removeListener('close', onAbort) + if (!err) { + try { + writer.end() + } catch (er) { + err = er + } + } -const { kClients } = __nccwpck_require__(48039) -const Agent = __nccwpck_require__(97464) -const { - kAgent, - kMockAgentSet, - kMockAgentGet, - kDispatches, - kIsMockActive, - kNetConnect, - kGetNetConnect, - kOptions, - kFactory -} = __nccwpck_require__(50865) -const MockClient = __nccwpck_require__(52905) -const MockPool = __nccwpck_require__(28511) -const { matchValue, buildMockOptions } = __nccwpck_require__(63643) -const { InvalidArgumentError, UndiciError } = __nccwpck_require__(46339) -const Dispatcher = __nccwpck_require__(73272) -const Pluralizer = __nccwpck_require__(70764) -const PendingInterceptorsFormatter = __nccwpck_require__(79197) + writer.destroy(err) -class FakeWeakRef { - constructor (value) { - this.value = value + if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) { + util.destroy(body, err) + } else { + util.destroy(body) + } } - deref () { - return this.value + body + .on('data', onData) + .on('end', onFinished) + .on('error', onFinished) + .on('close', onAbort) + + if (body.resume) { + body.resume() } + + socket + .on('drain', onDrain) + .on('error', onFinished) } -class MockAgent extends Dispatcher { - constructor (opts) { - super(opts) +async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { + assert(contentLength === body.size, 'blob body must have content length') - this[kNetConnect] = true - this[kIsMockActive] = true + const isH2 = client[kHTTPConnVersion] === 'h2' + try { + if (contentLength != null && contentLength !== body.size) { + throw new RequestContentLengthMismatchError() + } - // Instantiate Agent and encapsulate - if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) { - throw new InvalidArgumentError('Argument opts.agent must implement Agent') + const buffer = Buffer.from(await body.arrayBuffer()) + + if (isH2) { + h2stream.cork() + h2stream.write(buffer) + h2stream.uncork() + } else { + socket.cork() + socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') + socket.write(buffer) + socket.uncork() } - const agent = opts && opts.agent ? opts.agent : new Agent(opts) - this[kAgent] = agent - this[kClients] = agent[kClients] - this[kOptions] = buildMockOptions(opts) + request.onBodySent(buffer) + request.onRequestSent() + + if (!expectsPayload) { + socket[kReset] = true + } + + resume(client) + } catch (err) { + util.destroy(isH2 ? h2stream : socket, err) } +} - get (origin) { - let dispatcher = this[kMockAgentGet](origin) +async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { + assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined') - if (!dispatcher) { - dispatcher = this[kFactory](origin) - this[kMockAgentSet](origin, dispatcher) + let callback = null + function onDrain () { + if (callback) { + const cb = callback + callback = null + cb() } - return dispatcher } - dispatch (opts, handler) { - // Call MockAgent.get to perform additional setup before dispatching as normal - this.get(opts.origin) - return this[kAgent].dispatch(opts, handler) - } + const waitForDrain = () => new Promise((resolve, reject) => { + assert(callback === null) - async close () { - await this[kAgent].close() - this[kClients].clear() - } + if (socket[kError]) { + reject(socket[kError]) + } else { + callback = resolve + } + }) - deactivate () { - this[kIsMockActive] = false - } + if (client[kHTTPConnVersion] === 'h2') { + h2stream + .on('close', onDrain) + .on('drain', onDrain) - activate () { - this[kIsMockActive] = true - } + try { + // It's up to the user to somehow abort the async iterable. + for await (const chunk of body) { + if (socket[kError]) { + throw socket[kError] + } - enableNetConnect (matcher) { - if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) { - if (Array.isArray(this[kNetConnect])) { - this[kNetConnect].push(matcher) - } else { - this[kNetConnect] = [matcher] + const res = h2stream.write(chunk) + request.onBodySent(chunk) + if (!res) { + await waitForDrain() + } } - } else if (typeof matcher === 'undefined') { - this[kNetConnect] = true - } else { - throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.') + } catch (err) { + h2stream.destroy(err) + } finally { + request.onRequestSent() + h2stream.end() + h2stream + .off('close', onDrain) + .off('drain', onDrain) } - } - disableNetConnect () { - this[kNetConnect] = false + return } - // This is required to bypass issues caused by using global symbols - see: - // https://github.com/nodejs/undici/issues/1447 - get isMockActive () { - return this[kIsMockActive] - } + socket + .on('close', onDrain) + .on('drain', onDrain) - [kMockAgentSet] (origin, dispatcher) { - this[kClients].set(origin, new FakeWeakRef(dispatcher)) + const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header }) + try { + // It's up to the user to somehow abort the async iterable. + for await (const chunk of body) { + if (socket[kError]) { + throw socket[kError] + } + + if (!writer.write(chunk)) { + await waitForDrain() + } + } + + writer.end() + } catch (err) { + writer.destroy(err) + } finally { + socket + .off('close', onDrain) + .off('drain', onDrain) } +} - [kFactory] (origin) { - const mockOptions = Object.assign({ agent: this }, this[kOptions]) - return this[kOptions] && this[kOptions].connections === 1 - ? new MockClient(origin, mockOptions) - : new MockPool(origin, mockOptions) +class AsyncWriter { + constructor ({ socket, request, contentLength, client, expectsPayload, header }) { + this.socket = socket + this.request = request + this.contentLength = contentLength + this.client = client + this.bytesWritten = 0 + this.expectsPayload = expectsPayload + this.header = header + + socket[kWriting] = true } - [kMockAgentGet] (origin) { - // First check if we can immediately find it - const ref = this[kClients].get(origin) - if (ref) { - return ref.deref() + write (chunk) { + const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this + + if (socket[kError]) { + throw socket[kError] } - // If the origin is not a string create a dummy parent pool and return to user - if (typeof origin !== 'string') { - const dispatcher = this[kFactory]('http://localhost:9999') - this[kMockAgentSet](origin, dispatcher) - return dispatcher + if (socket.destroyed) { + return false } - // If we match, create a pool and assign the same dispatches - for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) { - const nonExplicitDispatcher = nonExplicitRef.deref() - if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) { - const dispatcher = this[kFactory](origin) - this[kMockAgentSet](origin, dispatcher) - dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches] - return dispatcher + const len = Buffer.byteLength(chunk) + if (!len) { + return true + } + + // We should defer writing chunks. + if (contentLength !== null && bytesWritten + len > contentLength) { + if (client[kStrictContentLength]) { + throw new RequestContentLengthMismatchError() } + + process.emitWarning(new RequestContentLengthMismatchError()) } - } - [kGetNetConnect] () { - return this[kNetConnect] - } + socket.cork() - pendingInterceptors () { - const mockAgentClients = this[kClients] + if (bytesWritten === 0) { + if (!expectsPayload) { + socket[kReset] = true + } - return Array.from(mockAgentClients.entries()) - .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin }))) - .filter(({ pending }) => pending) + if (contentLength === null) { + socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1') + } else { + socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') + } + } + + if (contentLength === null) { + socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1') + } + + this.bytesWritten += len + + const ret = socket.write(chunk) + + socket.uncork() + + request.onBodySent(chunk) + + if (!ret) { + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { + // istanbul ignore else: only for jest + if (socket[kParser].timeout.refresh) { + socket[kParser].timeout.refresh() + } + } + } + + return ret } - assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) { - const pending = this.pendingInterceptors() + end () { + const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this + request.onRequestSent() - if (pending.length === 0) { + socket[kWriting] = false + + if (socket[kError]) { + throw socket[kError] + } + + if (socket.destroyed) { return } - const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length) + if (bytesWritten === 0) { + if (expectsPayload) { + // https://tools.ietf.org/html/rfc7230#section-3.3.2 + // A user agent SHOULD send a Content-Length in a request message when + // no Transfer-Encoding is sent and the request method defines a meaning + // for an enclosed payload body. - throw new UndiciError(` -${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending: + socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1') + } else { + socket.write(`${header}\r\n`, 'latin1') + } + } else if (contentLength === null) { + socket.write('\r\n0\r\n\r\n', 'latin1') + } -${pendingInterceptorsFormatter.format(pending)} -`.trim()) + if (contentLength !== null && bytesWritten !== contentLength) { + if (client[kStrictContentLength]) { + throw new RequestContentLengthMismatchError() + } else { + process.emitWarning(new RequestContentLengthMismatchError()) + } + } + + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { + // istanbul ignore else: only for jest + if (socket[kParser].timeout.refresh) { + socket[kParser].timeout.refresh() + } + } + + resume(client) + } + + destroy (err) { + const { socket, client } = this + + socket[kWriting] = false + + if (err) { + assert(client[kRunning] <= 1, 'pipeline should only contain this request') + util.destroy(socket, err) + } } } -module.exports = MockAgent +function errorRequest (client, request, err) { + try { + request.onError(err) + assert(request.aborted) + } catch (err) { + client.emit('error', err) + } +} + +module.exports = Client /***/ }), -/***/ 52905: +/***/ 49694: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { promisify } = __nccwpck_require__(73837) -const Client = __nccwpck_require__(52463) -const { buildMockDispatch } = __nccwpck_require__(63643) -const { - kDispatches, - kMockAgent, - kClose, - kOriginalClose, - kOrigin, - kOriginalDispatch, - kConnected -} = __nccwpck_require__(50865) -const { MockInterceptor } = __nccwpck_require__(6418) -const Symbols = __nccwpck_require__(48039) -const { InvalidArgumentError } = __nccwpck_require__(46339) - -/** - * MockClient provides an API that extends the Client to influence the mockDispatches. - */ -class MockClient extends Client { - constructor (origin, opts) { - super(origin, opts) +/* istanbul ignore file: only for Node 12 */ - if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') { - throw new InvalidArgumentError('Argument opts.agent must implement Agent') - } +const { kConnected, kSize } = __nccwpck_require__(69898) - this[kMockAgent] = opts.agent - this[kOrigin] = origin - this[kDispatches] = [] - this[kConnected] = 1 - this[kOriginalDispatch] = this.dispatch - this[kOriginalClose] = this.close.bind(this) +class CompatWeakRef { + constructor (value) { + this.value = value + } - this.dispatch = buildMockDispatch.call(this) - this.close = this[kClose] + deref () { + return this.value[kConnected] === 0 && this.value[kSize] === 0 + ? undefined + : this.value } +} - get [Symbols.kConnected] () { - return this[kConnected] +class CompatFinalizer { + constructor (finalizer) { + this.finalizer = finalizer } - /** - * Sets up the base interceptor for mocking replies from undici. - */ - intercept (opts) { - return new MockInterceptor(opts, this[kDispatches]) + register (dispatcher, key) { + if (dispatcher.on) { + dispatcher.on('disconnect', () => { + if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) { + this.finalizer(key) + } + }) + } } +} - async [kClose] () { - await promisify(this[kOriginalClose])() - this[kConnected] = 0 - this[kMockAgent][Symbols.kClients].delete(this[kOrigin]) +module.exports = function () { + // FIXME: remove workaround when the Node bug is fixed + // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308 + if (process.env.NODE_V8_COVERAGE) { + return { + WeakRef: CompatWeakRef, + FinalizationRegistry: CompatFinalizer + } + } + return { + WeakRef: global.WeakRef || CompatWeakRef, + FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer } } -module.exports = MockClient + +/***/ }), + +/***/ 77698: +/***/ ((module) => { + + + +// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size +const maxAttributeValueSize = 1024 + +// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size +const maxNameValuePairSize = 4096 + +module.exports = { + maxAttributeValueSize, + maxNameValuePairSize +} /***/ }), -/***/ 31816: +/***/ 8914: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { UndiciError } = __nccwpck_require__(46339) +const { parseSetCookie } = __nccwpck_require__(75506) +const { stringify, getHeadersList } = __nccwpck_require__(87843) +const { webidl } = __nccwpck_require__(7000) +const { Headers } = __nccwpck_require__(13915) -class MockNotMatchedError extends UndiciError { - constructor (message) { - super(message) - Error.captureStackTrace(this, MockNotMatchedError) - this.name = 'MockNotMatchedError' - this.message = message || 'The request does not match any registered mock dispatches' - this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED' +/** + * @typedef {Object} Cookie + * @property {string} name + * @property {string} value + * @property {Date|number|undefined} expires + * @property {number|undefined} maxAge + * @property {string|undefined} domain + * @property {string|undefined} path + * @property {boolean|undefined} secure + * @property {boolean|undefined} httpOnly + * @property {'Strict'|'Lax'|'None'} sameSite + * @property {string[]} unparsed + */ + +/** + * @param {Headers} headers + * @returns {Record} + */ +function getCookies (headers) { + webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' }) + + webidl.brandCheck(headers, Headers, { strict: false }) + + const cookie = headers.get('cookie') + const out = {} + + if (!cookie) { + return out + } + + for (const piece of cookie.split(';')) { + const [name, ...value] = piece.split('=') + + out[name.trim()] = value.join('=') + } + + return out +} + +/** + * @param {Headers} headers + * @param {string} name + * @param {{ path?: string, domain?: string }|undefined} attributes + * @returns {void} + */ +function deleteCookie (headers, name, attributes) { + webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' }) + + webidl.brandCheck(headers, Headers, { strict: false }) + + name = webidl.converters.DOMString(name) + attributes = webidl.converters.DeleteCookieAttributes(attributes) + + // Matches behavior of + // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278 + setCookie(headers, { + name, + value: '', + expires: new Date(0), + ...attributes + }) +} + +/** + * @param {Headers} headers + * @returns {Cookie[]} + */ +function getSetCookies (headers) { + webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' }) + + webidl.brandCheck(headers, Headers, { strict: false }) + + const cookies = getHeadersList(headers).cookies + + if (!cookies) { + return [] + } + + // In older versions of undici, cookies is a list of name:value. + return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair)) +} + +/** + * @param {Headers} headers + * @param {Cookie} cookie + * @returns {void} + */ +function setCookie (headers, cookie) { + webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' }) + + webidl.brandCheck(headers, Headers, { strict: false }) + + cookie = webidl.converters.Cookie(cookie) + + const str = stringify(cookie) + + if (str) { + headers.append('Set-Cookie', stringify(cookie)) } } +webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([ + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'path', + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'domain', + defaultValue: null + } +]) + +webidl.converters.Cookie = webidl.dictionaryConverter([ + { + converter: webidl.converters.DOMString, + key: 'name' + }, + { + converter: webidl.converters.DOMString, + key: 'value' + }, + { + converter: webidl.nullableConverter((value) => { + if (typeof value === 'number') { + return webidl.converters['unsigned long long'](value) + } + + return new Date(value) + }), + key: 'expires', + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters['long long']), + key: 'maxAge', + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'domain', + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'path', + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.boolean), + key: 'secure', + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.boolean), + key: 'httpOnly', + defaultValue: null + }, + { + converter: webidl.converters.USVString, + key: 'sameSite', + allowedValues: ['Strict', 'Lax', 'None'] + }, + { + converter: webidl.sequenceConverter(webidl.converters.DOMString), + key: 'unparsed', + defaultValue: [] + } +]) + module.exports = { - MockNotMatchedError + getCookies, + deleteCookie, + getSetCookies, + setCookie } /***/ }), -/***/ 6418: +/***/ 75506: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(63643) -const { - kDispatches, - kDispatchKey, - kDefaultHeaders, - kDefaultTrailers, - kContentLength, - kMockDispatch -} = __nccwpck_require__(50865) -const { InvalidArgumentError } = __nccwpck_require__(46339) -const { buildURL } = __nccwpck_require__(67468) +const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(77698) +const { isCTLExcludingHtab } = __nccwpck_require__(87843) +const { collectASequenceOfCodePointsFast } = __nccwpck_require__(16306) +const assert = __nccwpck_require__(39491) /** - * Defines the scope API for an interceptor reply + * @description Parses the field-value attributes of a set-cookie header string. + * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4 + * @param {string} header + * @returns if the header is invalid, null will be returned */ -class MockScope { - constructor (mockDispatch) { - this[kMockDispatch] = mockDispatch +function parseSetCookie (header) { + // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F + // character (CTL characters excluding HTAB): Abort these steps and + // ignore the set-cookie-string entirely. + if (isCTLExcludingHtab(header)) { + return null } - /** - * Delay a reply by a set amount in ms. - */ - delay (waitInMs) { - if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) { - throw new InvalidArgumentError('waitInMs must be a valid integer > 0') - } + let nameValuePair = '' + let unparsedAttributes = '' + let name = '' + let value = '' - this[kMockDispatch].delay = waitInMs - return this + // 2. If the set-cookie-string contains a %x3B (";") character: + if (header.includes(';')) { + // 1. The name-value-pair string consists of the characters up to, + // but not including, the first %x3B (";"), and the unparsed- + // attributes consist of the remainder of the set-cookie-string + // (including the %x3B (";") in question). + const position = { position: 0 } + + nameValuePair = collectASequenceOfCodePointsFast(';', header, position) + unparsedAttributes = header.slice(position.position) + } else { + // Otherwise: + + // 1. The name-value-pair string consists of all the characters + // contained in the set-cookie-string, and the unparsed- + // attributes is the empty string. + nameValuePair = header } - /** - * For a defined reply, never mark as consumed. - */ - persist () { - this[kMockDispatch].persist = true - return this + // 3. If the name-value-pair string lacks a %x3D ("=") character, then + // the name string is empty, and the value string is the value of + // name-value-pair. + if (!nameValuePair.includes('=')) { + value = nameValuePair + } else { + // Otherwise, the name string consists of the characters up to, but + // not including, the first %x3D ("=") character, and the (possibly + // empty) value string consists of the characters after the first + // %x3D ("=") character. + const position = { position: 0 } + name = collectASequenceOfCodePointsFast( + '=', + nameValuePair, + position + ) + value = nameValuePair.slice(position.position + 1) } - /** - * Allow one to define a reply for a set amount of matching requests. - */ - times (repeatTimes) { - if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) { - throw new InvalidArgumentError('repeatTimes must be a valid integer > 0') - } + // 4. Remove any leading or trailing WSP characters from the name + // string and the value string. + name = name.trim() + value = value.trim() - this[kMockDispatch].times = repeatTimes - return this + // 5. If the sum of the lengths of the name string and the value string + // is more than 4096 octets, abort these steps and ignore the set- + // cookie-string entirely. + if (name.length + value.length > maxNameValuePairSize) { + return null + } + + // 6. The cookie-name is the name string, and the cookie-value is the + // value string. + return { + name, value, ...parseUnparsedAttributes(unparsedAttributes) } } /** - * Defines an interceptor for a Mock + * Parses the remaining attributes of a set-cookie header + * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4 + * @param {string} unparsedAttributes + * @param {[Object.]={}} cookieAttributeList */ -class MockInterceptor { - constructor (opts, mockDispatches) { - if (typeof opts !== 'object') { - throw new InvalidArgumentError('opts must be an object') - } - if (typeof opts.path === 'undefined') { - throw new InvalidArgumentError('opts.path must be defined') - } - if (typeof opts.method === 'undefined') { - opts.method = 'GET' - } - // See https://github.com/nodejs/undici/issues/1245 - // As per RFC 3986, clients are not supposed to send URI - // fragments to servers when they retrieve a document, - if (typeof opts.path === 'string') { - if (opts.query) { - opts.path = buildURL(opts.path, opts.query) - } else { - // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811 - const parsedURL = new URL(opts.path, 'data://') - opts.path = parsedURL.pathname + parsedURL.search - } - } - if (typeof opts.method === 'string') { - opts.method = opts.method.toUpperCase() - } - - this[kDispatchKey] = buildKey(opts) - this[kDispatches] = mockDispatches - this[kDefaultHeaders] = {} - this[kDefaultTrailers] = {} - this[kContentLength] = false +function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) { + // 1. If the unparsed-attributes string is empty, skip the rest of + // these steps. + if (unparsedAttributes.length === 0) { + return cookieAttributeList } - createMockScopeDispatchData (statusCode, data, responseOptions = {}) { - const responseData = getResponseData(data) - const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {} - const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers } - const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers } + // 2. Discard the first character of the unparsed-attributes (which + // will be a %x3B (";") character). + assert(unparsedAttributes[0] === ';') + unparsedAttributes = unparsedAttributes.slice(1) - return { statusCode, data, headers, trailers } - } + let cookieAv = '' - validateReplyParameters (statusCode, data, responseOptions) { - if (typeof statusCode === 'undefined') { - throw new InvalidArgumentError('statusCode must be defined') - } - if (typeof data === 'undefined') { - throw new InvalidArgumentError('data must be defined') - } - if (typeof responseOptions !== 'object') { - throw new InvalidArgumentError('responseOptions must be an object') - } - } + // 3. If the remaining unparsed-attributes contains a %x3B (";") + // character: + if (unparsedAttributes.includes(';')) { + // 1. Consume the characters of the unparsed-attributes up to, but + // not including, the first %x3B (";") character. + cookieAv = collectASequenceOfCodePointsFast( + ';', + unparsedAttributes, + { position: 0 } + ) + unparsedAttributes = unparsedAttributes.slice(cookieAv.length) + } else { + // Otherwise: - /** - * Mock an undici request with a defined reply. - */ - reply (replyData) { - // Values of reply aren't available right now as they - // can only be available when the reply callback is invoked. - if (typeof replyData === 'function') { - // We'll first wrap the provided callback in another function, - // this function will properly resolve the data from the callback - // when invoked. - const wrappedDefaultsCallback = (opts) => { - // Our reply options callback contains the parameter for statusCode, data and options. - const resolvedData = replyData(opts) + // 1. Consume the remainder of the unparsed-attributes. + cookieAv = unparsedAttributes + unparsedAttributes = '' + } - // Check if it is in the right format - if (typeof resolvedData !== 'object') { - throw new InvalidArgumentError('reply options callback must return an object') - } + // Let the cookie-av string be the characters consumed in this step. - const { statusCode, data = '', responseOptions = {} } = resolvedData - this.validateReplyParameters(statusCode, data, responseOptions) - // Since the values can be obtained immediately we return them - // from this higher order function that will be resolved later. - return { - ...this.createMockScopeDispatchData(statusCode, data, responseOptions) - } - } + let attributeName = '' + let attributeValue = '' - // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data. - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback) - return new MockScope(newMockDispatch) - } + // 4. If the cookie-av string contains a %x3D ("=") character: + if (cookieAv.includes('=')) { + // 1. The (possibly empty) attribute-name string consists of the + // characters up to, but not including, the first %x3D ("=") + // character, and the (possibly empty) attribute-value string + // consists of the characters after the first %x3D ("=") + // character. + const position = { position: 0 } - // We can have either one or three parameters, if we get here, - // we should have 1-3 parameters. So we spread the arguments of - // this function to obtain the parameters, since replyData will always - // just be the statusCode. - const [statusCode, data = '', responseOptions = {}] = [...arguments] - this.validateReplyParameters(statusCode, data, responseOptions) + attributeName = collectASequenceOfCodePointsFast( + '=', + cookieAv, + position + ) + attributeValue = cookieAv.slice(position.position + 1) + } else { + // Otherwise: - // Send in-already provided data like usual - const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions) - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData) - return new MockScope(newMockDispatch) + // 1. The attribute-name string consists of the entire cookie-av + // string, and the attribute-value string is empty. + attributeName = cookieAv } - /** - * Mock an undici request with a defined error. - */ - replyWithError (error) { - if (typeof error === 'undefined') { - throw new InvalidArgumentError('error must be defined') - } + // 5. Remove any leading or trailing WSP characters from the attribute- + // name string and the attribute-value string. + attributeName = attributeName.trim() + attributeValue = attributeValue.trim() - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error }) - return new MockScope(newMockDispatch) + // 6. If the attribute-value is longer than 1024 octets, ignore the + // cookie-av string and return to Step 1 of this algorithm. + if (attributeValue.length > maxAttributeValueSize) { + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) } - /** - * Set default reply headers on the interceptor for subsequent replies - */ - defaultReplyHeaders (headers) { - if (typeof headers === 'undefined') { - throw new InvalidArgumentError('headers must be defined') + // 7. Process the attribute-name and attribute-value according to the + // requirements in the following subsections. (Notice that + // attributes with unrecognized attribute-names are ignored.) + const attributeNameLowercase = attributeName.toLowerCase() + + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1 + // If the attribute-name case-insensitively matches the string + // "Expires", the user agent MUST process the cookie-av as follows. + if (attributeNameLowercase === 'expires') { + // 1. Let the expiry-time be the result of parsing the attribute-value + // as cookie-date (see Section 5.1.1). + const expiryTime = new Date(attributeValue) + + // 2. If the attribute-value failed to parse as a cookie date, ignore + // the cookie-av. + + cookieAttributeList.expires = expiryTime + } else if (attributeNameLowercase === 'max-age') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2 + // If the attribute-name case-insensitively matches the string "Max- + // Age", the user agent MUST process the cookie-av as follows. + + // 1. If the first character of the attribute-value is not a DIGIT or a + // "-" character, ignore the cookie-av. + const charCode = attributeValue.charCodeAt(0) + + if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') { + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) } - this[kDefaultHeaders] = headers - return this - } - - /** - * Set default reply trailers on the interceptor for subsequent replies - */ - defaultReplyTrailers (trailers) { - if (typeof trailers === 'undefined') { - throw new InvalidArgumentError('trailers must be defined') + // 2. If the remainder of attribute-value contains a non-DIGIT + // character, ignore the cookie-av. + if (!/^\d+$/.test(attributeValue)) { + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) } - this[kDefaultTrailers] = trailers - return this - } + // 3. Let delta-seconds be the attribute-value converted to an integer. + const deltaSeconds = Number(attributeValue) - /** - * Set reply content length header for replies on the interceptor - */ - replyContentLength () { - this[kContentLength] = true - return this - } -} + // 4. Let cookie-age-limit be the maximum age of the cookie (which + // SHOULD be 400 days or less, see Section 4.1.2.2). -module.exports.MockInterceptor = MockInterceptor -module.exports.MockScope = MockScope + // 5. Set delta-seconds to the smaller of its present value and cookie- + // age-limit. + // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs) + // 6. If delta-seconds is less than or equal to zero (0), let expiry- + // time be the earliest representable date and time. Otherwise, let + // the expiry-time be the current date and time plus delta-seconds + // seconds. + // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds -/***/ }), + // 7. Append an attribute to the cookie-attribute-list with an + // attribute-name of Max-Age and an attribute-value of expiry-time. + cookieAttributeList.maxAge = deltaSeconds + } else if (attributeNameLowercase === 'domain') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3 + // If the attribute-name case-insensitively matches the string "Domain", + // the user agent MUST process the cookie-av as follows. -/***/ 28511: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // 1. Let cookie-domain be the attribute-value. + let cookieDomain = attributeValue + // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be + // cookie-domain without its leading %x2E ("."). + if (cookieDomain[0] === '.') { + cookieDomain = cookieDomain.slice(1) + } + // 3. Convert the cookie-domain to lower case. + cookieDomain = cookieDomain.toLowerCase() -const { promisify } = __nccwpck_require__(73837) -const Pool = __nccwpck_require__(85186) -const { buildMockDispatch } = __nccwpck_require__(63643) -const { - kDispatches, - kMockAgent, - kClose, - kOriginalClose, - kOrigin, - kOriginalDispatch, - kConnected -} = __nccwpck_require__(50865) -const { MockInterceptor } = __nccwpck_require__(6418) -const Symbols = __nccwpck_require__(48039) -const { InvalidArgumentError } = __nccwpck_require__(46339) + // 4. Append an attribute to the cookie-attribute-list with an + // attribute-name of Domain and an attribute-value of cookie-domain. + cookieAttributeList.domain = cookieDomain + } else if (attributeNameLowercase === 'path') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4 + // If the attribute-name case-insensitively matches the string "Path", + // the user agent MUST process the cookie-av as follows. -/** - * MockPool provides an API that extends the Pool to influence the mockDispatches. - */ -class MockPool extends Pool { - constructor (origin, opts) { - super(origin, opts) + // 1. If the attribute-value is empty or if the first character of the + // attribute-value is not %x2F ("/"): + let cookiePath = '' + if (attributeValue.length === 0 || attributeValue[0] !== '/') { + // 1. Let cookie-path be the default-path. + cookiePath = '/' + } else { + // Otherwise: - if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') { - throw new InvalidArgumentError('Argument opts.agent must implement Agent') + // 1. Let cookie-path be the attribute-value. + cookiePath = attributeValue } - this[kMockAgent] = opts.agent - this[kOrigin] = origin - this[kDispatches] = [] - this[kConnected] = 1 - this[kOriginalDispatch] = this.dispatch - this[kOriginalClose] = this.close.bind(this) - - this.dispatch = buildMockDispatch.call(this) - this.close = this[kClose] - } + // 2. Append an attribute to the cookie-attribute-list with an + // attribute-name of Path and an attribute-value of cookie-path. + cookieAttributeList.path = cookiePath + } else if (attributeNameLowercase === 'secure') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5 + // If the attribute-name case-insensitively matches the string "Secure", + // the user agent MUST append an attribute to the cookie-attribute-list + // with an attribute-name of Secure and an empty attribute-value. - get [Symbols.kConnected] () { - return this[kConnected] - } + cookieAttributeList.secure = true + } else if (attributeNameLowercase === 'httponly') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6 + // If the attribute-name case-insensitively matches the string + // "HttpOnly", the user agent MUST append an attribute to the cookie- + // attribute-list with an attribute-name of HttpOnly and an empty + // attribute-value. - /** - * Sets up the base interceptor for mocking replies from undici. - */ - intercept (opts) { - return new MockInterceptor(opts, this[kDispatches]) - } + cookieAttributeList.httpOnly = true + } else if (attributeNameLowercase === 'samesite') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7 + // If the attribute-name case-insensitively matches the string + // "SameSite", the user agent MUST process the cookie-av as follows: - async [kClose] () { - await promisify(this[kOriginalClose])() - this[kConnected] = 0 - this[kMockAgent][Symbols.kClients].delete(this[kOrigin]) - } -} + // 1. Let enforcement be "Default". + let enforcement = 'Default' -module.exports = MockPool + const attributeValueLowercase = attributeValue.toLowerCase() + // 2. If cookie-av's attribute-value is a case-insensitive match for + // "None", set enforcement to "None". + if (attributeValueLowercase.includes('none')) { + enforcement = 'None' + } + // 3. If cookie-av's attribute-value is a case-insensitive match for + // "Strict", set enforcement to "Strict". + if (attributeValueLowercase.includes('strict')) { + enforcement = 'Strict' + } -/***/ }), + // 4. If cookie-av's attribute-value is a case-insensitive match for + // "Lax", set enforcement to "Lax". + if (attributeValueLowercase.includes('lax')) { + enforcement = 'Lax' + } -/***/ 50865: -/***/ ((module) => { + // 5. Append an attribute to the cookie-attribute-list with an + // attribute-name of "SameSite" and an attribute-value of + // enforcement. + cookieAttributeList.sameSite = enforcement + } else { + cookieAttributeList.unparsed ??= [] + cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`) + } + // 8. Return to Step 1 of this algorithm. + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) +} module.exports = { - kAgent: Symbol('agent'), - kOptions: Symbol('options'), - kFactory: Symbol('factory'), - kDispatches: Symbol('dispatches'), - kDispatchKey: Symbol('dispatch key'), - kDefaultHeaders: Symbol('default headers'), - kDefaultTrailers: Symbol('default trailers'), - kContentLength: Symbol('content length'), - kMockAgent: Symbol('mock agent'), - kMockAgentSet: Symbol('mock agent set'), - kMockAgentGet: Symbol('mock agent get'), - kMockDispatch: Symbol('mock dispatch'), - kClose: Symbol('close'), - kOriginalClose: Symbol('original agent close'), - kOrigin: Symbol('origin'), - kIsMockActive: Symbol('is mock active'), - kNetConnect: Symbol('net connect'), - kGetNetConnect: Symbol('get net connect'), - kConnected: Symbol('connected') + parseSetCookie, + parseUnparsedAttributes } /***/ }), -/***/ 63643: +/***/ 87843: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { MockNotMatchedError } = __nccwpck_require__(31816) -const { - kDispatches, - kMockAgent, - kOriginalDispatch, - kOrigin, - kGetNetConnect -} = __nccwpck_require__(50865) -const { buildURL, nop } = __nccwpck_require__(67468) -const { STATUS_CODES } = __nccwpck_require__(13685) -const { - types: { - isPromise - } -} = __nccwpck_require__(73837) +const assert = __nccwpck_require__(39491) +const { kHeadersList } = __nccwpck_require__(69898) -function matchValue (match, value) { - if (typeof match === 'string') { - return match === value - } - if (match instanceof RegExp) { - return match.test(value) - } - if (typeof match === 'function') { - return match(value) === true +function isCTLExcludingHtab (value) { + if (value.length === 0) { + return false } - return false -} -function lowerCaseEntries (headers) { - return Object.fromEntries( - Object.entries(headers).map(([headerName, headerValue]) => { - return [headerName.toLocaleLowerCase(), headerValue] - }) - ) -} + for (const char of value) { + const code = char.charCodeAt(0) -/** - * @param {import('../../index').Headers|string[]|Record} headers - * @param {string} key - */ -function getHeaderByName (headers, key) { - if (Array.isArray(headers)) { - for (let i = 0; i < headers.length; i += 2) { - if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) { - return headers[i + 1] - } + if ( + (code >= 0x00 || code <= 0x08) || + (code >= 0x0A || code <= 0x1F) || + code === 0x7F + ) { + return false } - - return undefined - } else if (typeof headers.get === 'function') { - return headers.get(key) - } else { - return lowerCaseEntries(headers)[key.toLocaleLowerCase()] } } -/** @param {string[]} headers */ -function buildHeadersFromArray (headers) { // fetch HeadersList - const clone = headers.slice() - const entries = [] - for (let index = 0; index < clone.length; index += 2) { - entries.push([clone[index], clone[index + 1]]) - } - return Object.fromEntries(entries) -} +/** + CHAR = + token = 1* + separators = "(" | ")" | "<" | ">" | "@" + | "," | ";" | ":" | "\" | <"> + | "/" | "[" | "]" | "?" | "=" + | "{" | "}" | SP | HT + * @param {string} name + */ +function validateCookieName (name) { + for (const char of name) { + const code = char.charCodeAt(0) -function matchHeaders (mockDispatch, headers) { - if (typeof mockDispatch.headers === 'function') { - if (Array.isArray(headers)) { // fetch HeadersList - headers = buildHeadersFromArray(headers) + if ( + (code <= 0x20 || code > 0x7F) || + char === '(' || + char === ')' || + char === '>' || + char === '<' || + char === '@' || + char === ',' || + char === ';' || + char === ':' || + char === '\\' || + char === '"' || + char === '/' || + char === '[' || + char === ']' || + char === '?' || + char === '=' || + char === '{' || + char === '}' + ) { + throw new Error('Invalid cookie name') } - return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {}) - } - if (typeof mockDispatch.headers === 'undefined') { - return true - } - if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') { - return false } +} - for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) { - const headerValue = getHeaderByName(headers, matchHeaderName) +/** + cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) + cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E + ; US-ASCII characters excluding CTLs, + ; whitespace DQUOTE, comma, semicolon, + ; and backslash + * @param {string} value + */ +function validateCookieValue (value) { + for (const char of value) { + const code = char.charCodeAt(0) - if (!matchValue(matchHeaderValue, headerValue)) { - return false + if ( + code < 0x21 || // exclude CTLs (0-31) + code === 0x22 || + code === 0x2C || + code === 0x3B || + code === 0x5C || + code > 0x7E // non-ascii + ) { + throw new Error('Invalid header value') } } - return true } -function safeUrl (path) { - if (typeof path !== 'string') { - return path - } - - const pathSegments = path.split('?') +/** + * path-value = + * @param {string} path + */ +function validateCookiePath (path) { + for (const char of path) { + const code = char.charCodeAt(0) - if (pathSegments.length !== 2) { - return path + if (code < 0x21 || char === ';') { + throw new Error('Invalid cookie path') + } } - - const qp = new URLSearchParams(pathSegments.pop()) - qp.sort() - return [...pathSegments, qp.toString()].join('?') -} - -function matchKey (mockDispatch, { path, method, body, headers }) { - const pathMatch = matchValue(mockDispatch.path, path) - const methodMatch = matchValue(mockDispatch.method, method) - const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true - const headersMatch = matchHeaders(mockDispatch, headers) - return pathMatch && methodMatch && bodyMatch && headersMatch } -function getResponseData (data) { - if (Buffer.isBuffer(data)) { - return data - } else if (typeof data === 'object') { - return JSON.stringify(data) - } else { - return data.toString() +/** + * I have no idea why these values aren't allowed to be honest, + * but Deno tests these. - Khafra + * @param {string} domain + */ +function validateCookieDomain (domain) { + if ( + domain.startsWith('-') || + domain.endsWith('.') || + domain.endsWith('-') + ) { + throw new Error('Invalid cookie domain') } } -function getMockDispatch (mockDispatches, key) { - const basePath = key.query ? buildURL(key.path, key.query) : key.path - const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath +/** + * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1 + * @param {number|Date} date + IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT + ; fixed length/zone/capitalization subset of the format + ; see Section 3.3 of [RFC5322] - // Match path - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath)) - if (matchedMockDispatches.length === 0) { - throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`) - } + day-name = %x4D.6F.6E ; "Mon", case-sensitive + / %x54.75.65 ; "Tue", case-sensitive + / %x57.65.64 ; "Wed", case-sensitive + / %x54.68.75 ; "Thu", case-sensitive + / %x46.72.69 ; "Fri", case-sensitive + / %x53.61.74 ; "Sat", case-sensitive + / %x53.75.6E ; "Sun", case-sensitive + date1 = day SP month SP year + ; e.g., 02 Jun 1982 - // Match method - matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method)) - if (matchedMockDispatches.length === 0) { - throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`) - } + day = 2DIGIT + month = %x4A.61.6E ; "Jan", case-sensitive + / %x46.65.62 ; "Feb", case-sensitive + / %x4D.61.72 ; "Mar", case-sensitive + / %x41.70.72 ; "Apr", case-sensitive + / %x4D.61.79 ; "May", case-sensitive + / %x4A.75.6E ; "Jun", case-sensitive + / %x4A.75.6C ; "Jul", case-sensitive + / %x41.75.67 ; "Aug", case-sensitive + / %x53.65.70 ; "Sep", case-sensitive + / %x4F.63.74 ; "Oct", case-sensitive + / %x4E.6F.76 ; "Nov", case-sensitive + / %x44.65.63 ; "Dec", case-sensitive + year = 4DIGIT - // Match body - matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true) - if (matchedMockDispatches.length === 0) { - throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`) - } + GMT = %x47.4D.54 ; "GMT", case-sensitive - // Match headers - matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers)) - if (matchedMockDispatches.length === 0) { - throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`) - } + time-of-day = hour ":" minute ":" second + ; 00:00:00 - 23:59:60 (leap second) - return matchedMockDispatches[0] -} + hour = 2DIGIT + minute = 2DIGIT + second = 2DIGIT + */ +function toIMFDate (date) { + if (typeof date === 'number') { + date = new Date(date) + } -function addMockDispatch (mockDispatches, key, data) { - const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false } - const replyData = typeof data === 'function' ? { callback: data } : { ...data } - const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } } - mockDispatches.push(newMockDispatch) - return newMockDispatch -} + const days = [ + 'Sun', 'Mon', 'Tue', 'Wed', + 'Thu', 'Fri', 'Sat' + ] -function deleteMockDispatch (mockDispatches, key) { - const index = mockDispatches.findIndex(dispatch => { - if (!dispatch.consumed) { - return false - } - return matchKey(dispatch, key) - }) - if (index !== -1) { - mockDispatches.splice(index, 1) - } -} + const months = [ + 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' + ] -function buildKey (opts) { - const { path, method, body, headers, query } = opts - return { - path, - method, - body, - headers, - query - } -} + const dayName = days[date.getUTCDay()] + const day = date.getUTCDate().toString().padStart(2, '0') + const month = months[date.getUTCMonth()] + const year = date.getUTCFullYear() + const hour = date.getUTCHours().toString().padStart(2, '0') + const minute = date.getUTCMinutes().toString().padStart(2, '0') + const second = date.getUTCSeconds().toString().padStart(2, '0') -function generateKeyValues (data) { - return Object.entries(data).reduce((keyValuePairs, [key, value]) => [ - ...keyValuePairs, - Buffer.from(`${key}`), - Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`) - ], []) + return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT` } /** - * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status - * @param {number} statusCode + max-age-av = "Max-Age=" non-zero-digit *DIGIT + ; In practice, both expires-av and max-age-av + ; are limited to dates representable by the + ; user agent. + * @param {number} maxAge */ -function getStatusText (statusCode) { - return STATUS_CODES[statusCode] || 'unknown' -} - -async function getResponse (body) { - const buffers = [] - for await (const data of body) { - buffers.push(data) +function validateCookieMaxAge (maxAge) { + if (maxAge < 0) { + throw new Error('Invalid cookie max-age') } - return Buffer.concat(buffers).toString('utf8') } /** - * Mock dispatch function used to simulate undici dispatches + * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1 + * @param {import('./index').Cookie} cookie */ -function mockDispatch (opts, handler) { - // Get mock dispatch from built key - const key = buildKey(opts) - const mockDispatch = getMockDispatch(this[kDispatches], key) - - mockDispatch.timesInvoked++ - - // Here's where we resolve a callback if a callback is present for the dispatch data. - if (mockDispatch.data.callback) { - mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) } +function stringify (cookie) { + if (cookie.name.length === 0) { + return null } - // Parse mockDispatch data - const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch - const { timesInvoked, times } = mockDispatch + validateCookieName(cookie.name) + validateCookieValue(cookie.value) - // If it's used up and not persistent, mark as consumed - mockDispatch.consumed = !persist && timesInvoked >= times - mockDispatch.pending = timesInvoked < times + const out = [`${cookie.name}=${cookie.value}`] - // If specified, trigger dispatch error - if (error !== null) { - deleteMockDispatch(this[kDispatches], key) - handler.onError(error) - return true + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1 + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2 + if (cookie.name.startsWith('__Secure-')) { + cookie.secure = true } - // Handle the request with a delay if necessary - if (typeof delay === 'number' && delay > 0) { - setTimeout(() => { - handleReply(this[kDispatches]) - }, delay) - } else { - handleReply(this[kDispatches]) + if (cookie.name.startsWith('__Host-')) { + cookie.secure = true + cookie.domain = null + cookie.path = '/' } - function handleReply (mockDispatches, _data = data) { - // fetch's HeadersList is a 1D string array - const optsHeaders = Array.isArray(opts.headers) - ? buildHeadersFromArray(opts.headers) - : opts.headers - const body = typeof _data === 'function' - ? _data({ ...opts, headers: optsHeaders }) - : _data - - // util.types.isPromise is likely needed for jest. - if (isPromise(body)) { - // If handleReply is asynchronous, throwing an error - // in the callback will reject the promise, rather than - // synchronously throw the error, which breaks some tests. - // Rather, we wait for the callback to resolve if it is a - // promise, and then re-run handleReply with the new body. - body.then((newData) => handleReply(mockDispatches, newData)) - return - } - - const responseData = getResponseData(body) - const responseHeaders = generateKeyValues(headers) - const responseTrailers = generateKeyValues(trailers) - - handler.abort = nop - handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode)) - handler.onData(Buffer.from(responseData)) - handler.onComplete(responseTrailers) - deleteMockDispatch(mockDispatches, key) + if (cookie.secure) { + out.push('Secure') } - function resume () {} - - return true -} - -function buildMockDispatch () { - const agent = this[kMockAgent] - const origin = this[kOrigin] - const originalDispatch = this[kOriginalDispatch] - - return function dispatch (opts, handler) { - if (agent.isMockActive) { - try { - mockDispatch.call(this, opts, handler) - } catch (error) { - if (error instanceof MockNotMatchedError) { - const netConnect = agent[kGetNetConnect]() - if (netConnect === false) { - throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`) - } - if (checkNetConnect(netConnect, origin)) { - originalDispatch.call(this, opts, handler) - } else { - throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`) - } - } else { - throw error - } - } - } else { - originalDispatch.call(this, opts, handler) - } + if (cookie.httpOnly) { + out.push('HttpOnly') } -} -function checkNetConnect (netConnect, origin) { - const url = new URL(origin) - if (netConnect === true) { - return true - } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) { - return true + if (typeof cookie.maxAge === 'number') { + validateCookieMaxAge(cookie.maxAge) + out.push(`Max-Age=${cookie.maxAge}`) } - return false -} -function buildMockOptions (opts) { - if (opts) { - const { agent, ...mockOptions } = opts - return mockOptions + if (cookie.domain) { + validateCookieDomain(cookie.domain) + out.push(`Domain=${cookie.domain}`) } -} - -module.exports = { - getResponseData, - getMockDispatch, - addMockDispatch, - deleteMockDispatch, - buildKey, - generateKeyValues, - matchValue, - getResponse, - getStatusText, - mockDispatch, - buildMockDispatch, - checkNetConnect, - buildMockOptions, - getHeaderByName -} + if (cookie.path) { + validateCookiePath(cookie.path) + out.push(`Path=${cookie.path}`) + } -/***/ }), - -/***/ 79197: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - + if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') { + out.push(`Expires=${toIMFDate(cookie.expires)}`) + } + if (cookie.sameSite) { + out.push(`SameSite=${cookie.sameSite}`) + } -const { Transform } = __nccwpck_require__(12781) -const { Console } = __nccwpck_require__(96206) + for (const part of cookie.unparsed) { + if (!part.includes('=')) { + throw new Error('Invalid unparsed') + } -/** - * Gets the output of `console.table(…)` as a string. - */ -module.exports = class PendingInterceptorsFormatter { - constructor ({ disableColors } = {}) { - this.transform = new Transform({ - transform (chunk, _enc, cb) { - cb(null, chunk) - } - }) + const [key, ...value] = part.split('=') - this.logger = new Console({ - stdout: this.transform, - inspectOptions: { - colors: !disableColors && !process.env.CI - } - }) + out.push(`${key.trim()}=${value.join('=')}`) } - format (pendingInterceptors) { - const withPrettyHeaders = pendingInterceptors.map( - ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ - Method: method, - Origin: origin, - Path: path, - 'Status code': statusCode, - Persistent: persist ? '✅' : '❌', - Invocations: timesInvoked, - Remaining: persist ? Infinity : times - timesInvoked - })) - - this.logger.table(withPrettyHeaders) - return this.transform.read().toString() - } + return out.join('; ') } +let kHeadersListNode -/***/ }), - -/***/ 70764: -/***/ ((module) => { +function getHeadersList (headers) { + if (headers[kHeadersList]) { + return headers[kHeadersList] + } + if (!kHeadersListNode) { + kHeadersListNode = Object.getOwnPropertySymbols(headers).find( + (symbol) => symbol.description === 'headers list' + ) + assert(kHeadersListNode, 'Headers cannot be parsed') + } -const singulars = { - pronoun: 'it', - is: 'is', - was: 'was', - this: 'this' -} + const headersList = headers[kHeadersListNode] + assert(headersList) -const plurals = { - pronoun: 'they', - is: 'are', - was: 'were', - this: 'these' + return headersList } -module.exports = class Pluralizer { - constructor (singular, plural) { - this.singular = singular - this.plural = plural - } - - pluralize (count) { - const one = count === 1 - const keys = one ? singulars : plurals - const noun = one ? this.singular : this.plural - return { ...keys, count, noun } - } +module.exports = { + isCTLExcludingHtab, + stringify, + getHeadersList } /***/ }), -/***/ 82046: -/***/ ((module) => { +/***/ 46183: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/* eslint-disable */ +const net = __nccwpck_require__(41808) +const assert = __nccwpck_require__(39491) +const util = __nccwpck_require__(43061) +const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(70867) -// Extracted from node/lib/internal/fixed_queue.js +let tls // include tls conditionally since it is not always available -// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two. -const kSize = 2048; -const kMask = kSize - 1; +// TODO: session re-use does not wait for the first +// connection to resolve the session and might therefore +// resolve the same servername multiple times even when +// re-use is enabled. -// The FixedQueue is implemented as a singly-linked list of fixed-size -// circular buffers. It looks something like this: -// -// head tail -// | | -// v v -// +-----------+ <-----\ +-----------+ <------\ +-----------+ -// | [null] | \----- | next | \------- | next | -// +-----------+ +-----------+ +-----------+ -// | item | <-- bottom | item | <-- bottom | [empty] | -// | item | | item | | [empty] | -// | item | | item | | [empty] | -// | item | | item | | [empty] | -// | item | | item | bottom --> | item | -// | item | | item | | item | -// | ... | | ... | | ... | -// | item | | item | | item | -// | item | | item | | item | -// | [empty] | <-- top | item | | item | -// | [empty] | | item | | item | -// | [empty] | | [empty] | <-- top top --> | [empty] | -// +-----------+ +-----------+ +-----------+ -// -// Or, if there is only one circular buffer, it looks something -// like either of these: -// -// head tail head tail -// | | | | -// v v v v -// +-----------+ +-----------+ -// | [null] | | [null] | -// +-----------+ +-----------+ -// | [empty] | | item | -// | [empty] | | item | -// | item | <-- bottom top --> | [empty] | -// | item | | [empty] | -// | [empty] | <-- top bottom --> | item | -// | [empty] | | item | -// +-----------+ +-----------+ -// -// Adding a value means moving `top` forward by one, removing means -// moving `bottom` forward by one. After reaching the end, the queue -// wraps around. -// -// When `top === bottom` the current queue is empty and when -// `top + 1 === bottom` it's full. This wastes a single space of storage -// but allows much quicker checks. +let SessionCache +// FIXME: remove workaround when the Node bug is fixed +// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308 +if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) { + SessionCache = class WeakSessionCache { + constructor (maxCachedSessions) { + this._maxCachedSessions = maxCachedSessions + this._sessionCache = new Map() + this._sessionRegistry = new global.FinalizationRegistry((key) => { + if (this._sessionCache.size < this._maxCachedSessions) { + return + } -class FixedCircularBuffer { - constructor() { - this.bottom = 0; - this.top = 0; - this.list = new Array(kSize); - this.next = null; - } + const ref = this._sessionCache.get(key) + if (ref !== undefined && ref.deref() === undefined) { + this._sessionCache.delete(key) + } + }) + } - isEmpty() { - return this.top === this.bottom; - } + get (sessionKey) { + const ref = this._sessionCache.get(sessionKey) + return ref ? ref.deref() : null + } - isFull() { - return ((this.top + 1) & kMask) === this.bottom; - } + set (sessionKey, session) { + if (this._maxCachedSessions === 0) { + return + } - push(data) { - this.list[this.top] = data; - this.top = (this.top + 1) & kMask; + this._sessionCache.set(sessionKey, new WeakRef(session)) + this._sessionRegistry.register(session, sessionKey) + } } +} else { + SessionCache = class SimpleSessionCache { + constructor (maxCachedSessions) { + this._maxCachedSessions = maxCachedSessions + this._sessionCache = new Map() + } - shift() { - const nextItem = this.list[this.bottom]; - if (nextItem === undefined) - return null; - this.list[this.bottom] = undefined; - this.bottom = (this.bottom + 1) & kMask; - return nextItem; - } -} + get (sessionKey) { + return this._sessionCache.get(sessionKey) + } -module.exports = class FixedQueue { - constructor() { - this.head = this.tail = new FixedCircularBuffer(); - } + set (sessionKey, session) { + if (this._maxCachedSessions === 0) { + return + } - isEmpty() { - return this.head.isEmpty(); - } + if (this._sessionCache.size >= this._maxCachedSessions) { + // remove the oldest session + const { value: oldestKey } = this._sessionCache.keys().next() + this._sessionCache.delete(oldestKey) + } - push(data) { - if (this.head.isFull()) { - // Head is full: Creates a new queue, sets the old queue's `.next` to it, - // and sets it as the new main queue. - this.head = this.head.next = new FixedCircularBuffer(); + this._sessionCache.set(sessionKey, session) } - this.head.push(data); } +} - shift() { - const tail = this.tail; - const next = tail.shift(); - if (tail.isEmpty() && tail.next !== null) { - // If there is another queue, it forms the new tail. - this.tail = tail.next; - } - return next; +function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) { + if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) { + throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero') } -}; + const options = { path: socketPath, ...opts } + const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions) + timeout = timeout == null ? 10e3 : timeout + allowH2 = allowH2 != null ? allowH2 : false + return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) { + let socket + if (protocol === 'https:') { + if (!tls) { + tls = __nccwpck_require__(24404) + } + servername = servername || options.servername || util.getServerName(host) || null -/***/ }), + const sessionKey = servername || hostname + const session = sessionCache.get(sessionKey) || null -/***/ 68504: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + assert(sessionKey) + socket = tls.connect({ + highWaterMark: 16384, // TLS in node can't have bigger HWM anyway... + ...options, + servername, + session, + localAddress, + // TODO(HTTP/2): Add support for h2c + ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'], + socket: httpSocket, // upgrade socket connection + port: port || 443, + host: hostname + }) + socket + .on('session', function (session) { + // TODO (fix): Can a session become invalid once established? Don't think so? + sessionCache.set(sessionKey, session) + }) + } else { + assert(!httpSocket, 'httpSocket can only be sent on TLS update') + socket = net.connect({ + highWaterMark: 64 * 1024, // Same as nodejs fs streams. + ...options, + localAddress, + port: port || 80, + host: hostname + }) + } -const DispatcherBase = __nccwpck_require__(32426) -const FixedQueue = __nccwpck_require__(82046) -const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(48039) -const PoolStats = __nccwpck_require__(44226) + // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket + if (options.keepAlive == null || options.keepAlive) { + const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay + socket.setKeepAlive(true, keepAliveInitialDelay) + } -const kClients = Symbol('clients') -const kNeedDrain = Symbol('needDrain') -const kQueue = Symbol('queue') -const kClosedResolve = Symbol('closed resolve') -const kOnDrain = Symbol('onDrain') -const kOnConnect = Symbol('onConnect') -const kOnDisconnect = Symbol('onDisconnect') -const kOnConnectionError = Symbol('onConnectionError') -const kGetDispatcher = Symbol('get dispatcher') -const kAddClient = Symbol('add client') -const kRemoveClient = Symbol('remove client') -const kStats = Symbol('stats') + const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout) -class PoolBase extends DispatcherBase { - constructor () { - super() + socket + .setNoDelay(true) + .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () { + cancelTimeout() - this[kQueue] = new FixedQueue() - this[kClients] = [] - this[kQueued] = 0 + if (callback) { + const cb = callback + callback = null + cb(null, this) + } + }) + .on('error', function (err) { + cancelTimeout() - const pool = this + if (callback) { + const cb = callback + callback = null + cb(err) + } + }) - this[kOnDrain] = function onDrain (origin, targets) { - const queue = pool[kQueue] + return socket + } +} - let needDrain = false +function setupTimeout (onConnectTimeout, timeout) { + if (!timeout) { + return () => {} + } - while (!needDrain) { - const item = queue.shift() - if (!item) { - break - } - pool[kQueued]-- - needDrain = !this.dispatch(item.opts, item.handler) + let s1 = null + let s2 = null + const timeoutId = setTimeout(() => { + // setImmediate is added to make sure that we priotorise socket error events over timeouts + s1 = setImmediate(() => { + if (process.platform === 'win32') { + // Windows needs an extra setImmediate probably due to implementation differences in the socket logic + s2 = setImmediate(() => onConnectTimeout()) + } else { + onConnectTimeout() } + }) + }, timeout) + return () => { + clearTimeout(timeoutId) + clearImmediate(s1) + clearImmediate(s2) + } +} - this[kNeedDrain] = needDrain +function onConnectTimeout (socket) { + util.destroy(socket, new ConnectTimeoutError()) +} - if (!this[kNeedDrain] && pool[kNeedDrain]) { - pool[kNeedDrain] = false - pool.emit('drain', origin, [pool, ...targets]) - } +module.exports = buildConnector - if (pool[kClosedResolve] && queue.isEmpty()) { - Promise - .all(pool[kClients].map(c => c.close())) - .then(pool[kClosedResolve]) - } - } - this[kOnConnect] = (origin, targets) => { - pool.emit('connect', origin, [pool, ...targets]) - } +/***/ }), - this[kOnDisconnect] = (origin, targets, err) => { - pool.emit('disconnect', origin, [pool, ...targets], err) - } +/***/ 70867: +/***/ ((module) => { - this[kOnConnectionError] = (origin, targets, err) => { - pool.emit('connectionError', origin, [pool, ...targets], err) - } - this[kStats] = new PoolStats(this) - } - get [kBusy] () { - return this[kNeedDrain] +class UndiciError extends Error { + constructor (message) { + super(message) + this.name = 'UndiciError' + this.code = 'UND_ERR' } +} - get [kConnected] () { - return this[kClients].filter(client => client[kConnected]).length +class ConnectTimeoutError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, ConnectTimeoutError) + this.name = 'ConnectTimeoutError' + this.message = message || 'Connect Timeout Error' + this.code = 'UND_ERR_CONNECT_TIMEOUT' } +} - get [kFree] () { - return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length +class HeadersTimeoutError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, HeadersTimeoutError) + this.name = 'HeadersTimeoutError' + this.message = message || 'Headers Timeout Error' + this.code = 'UND_ERR_HEADERS_TIMEOUT' } +} - get [kPending] () { - let ret = this[kQueued] - for (const { [kPending]: pending } of this[kClients]) { - ret += pending - } - return ret +class HeadersOverflowError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, HeadersOverflowError) + this.name = 'HeadersOverflowError' + this.message = message || 'Headers Overflow Error' + this.code = 'UND_ERR_HEADERS_OVERFLOW' } +} - get [kRunning] () { - let ret = 0 - for (const { [kRunning]: running } of this[kClients]) { - ret += running - } - return ret +class BodyTimeoutError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, BodyTimeoutError) + this.name = 'BodyTimeoutError' + this.message = message || 'Body Timeout Error' + this.code = 'UND_ERR_BODY_TIMEOUT' } +} - get [kSize] () { - let ret = this[kQueued] - for (const { [kSize]: size } of this[kClients]) { - ret += size - } - return ret +class ResponseStatusCodeError extends UndiciError { + constructor (message, statusCode, headers, body) { + super(message) + Error.captureStackTrace(this, ResponseStatusCodeError) + this.name = 'ResponseStatusCodeError' + this.message = message || 'Response Status Code Error' + this.code = 'UND_ERR_RESPONSE_STATUS_CODE' + this.body = body + this.status = statusCode + this.statusCode = statusCode + this.headers = headers } +} - get stats () { - return this[kStats] +class InvalidArgumentError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, InvalidArgumentError) + this.name = 'InvalidArgumentError' + this.message = message || 'Invalid Argument Error' + this.code = 'UND_ERR_INVALID_ARG' } +} - async [kClose] () { - if (this[kQueue].isEmpty()) { - return Promise.all(this[kClients].map(c => c.close())) - } else { - return new Promise((resolve) => { - this[kClosedResolve] = resolve - }) - } +class InvalidReturnValueError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, InvalidReturnValueError) + this.name = 'InvalidReturnValueError' + this.message = message || 'Invalid Return Value Error' + this.code = 'UND_ERR_INVALID_RETURN_VALUE' } +} - async [kDestroy] (err) { - while (true) { - const item = this[kQueue].shift() - if (!item) { - break - } - item.handler.onError(err) - } - - return Promise.all(this[kClients].map(c => c.destroy(err))) +class RequestAbortedError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, RequestAbortedError) + this.name = 'AbortError' + this.message = message || 'Request aborted' + this.code = 'UND_ERR_ABORTED' } +} - [kDispatch] (opts, handler) { - const dispatcher = this[kGetDispatcher]() - - if (!dispatcher) { - this[kNeedDrain] = true - this[kQueue].push({ opts, handler }) - this[kQueued]++ - } else if (!dispatcher.dispatch(opts, handler)) { - dispatcher[kNeedDrain] = true - this[kNeedDrain] = !this[kGetDispatcher]() - } - - return !this[kNeedDrain] +class InformationalError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, InformationalError) + this.name = 'InformationalError' + this.message = message || 'Request information' + this.code = 'UND_ERR_INFO' } +} - [kAddClient] (client) { - client - .on('drain', this[kOnDrain]) - .on('connect', this[kOnConnect]) - .on('disconnect', this[kOnDisconnect]) - .on('connectionError', this[kOnConnectionError]) - - this[kClients].push(client) - - if (this[kNeedDrain]) { - process.nextTick(() => { - if (this[kNeedDrain]) { - this[kOnDrain](client[kUrl], [this, client]) - } - }) - } - - return this +class RequestContentLengthMismatchError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, RequestContentLengthMismatchError) + this.name = 'RequestContentLengthMismatchError' + this.message = message || 'Request body length does not match content-length header' + this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH' } +} - [kRemoveClient] (client) { - client.close(() => { - const idx = this[kClients].indexOf(client) - if (idx !== -1) { - this[kClients].splice(idx, 1) - } - }) - - this[kNeedDrain] = this[kClients].some(dispatcher => ( - !dispatcher[kNeedDrain] && - dispatcher.closed !== true && - dispatcher.destroyed !== true - )) +class ResponseContentLengthMismatchError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, ResponseContentLengthMismatchError) + this.name = 'ResponseContentLengthMismatchError' + this.message = message || 'Response body length does not match content-length header' + this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH' } } -module.exports = { - PoolBase, - kClients, - kNeedDrain, - kAddClient, - kRemoveClient, - kGetDispatcher +class ClientDestroyedError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, ClientDestroyedError) + this.name = 'ClientDestroyedError' + this.message = message || 'The client is destroyed' + this.code = 'UND_ERR_DESTROYED' + } } - -/***/ }), - -/***/ 44226: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(48039) -const kPool = Symbol('pool') - -class PoolStats { - constructor (pool) { - this[kPool] = pool +class ClientClosedError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, ClientClosedError) + this.name = 'ClientClosedError' + this.message = message || 'The client is closed' + this.code = 'UND_ERR_CLOSED' } +} - get connected () { - return this[kPool][kConnected] +class SocketError extends UndiciError { + constructor (message, socket) { + super(message) + Error.captureStackTrace(this, SocketError) + this.name = 'SocketError' + this.message = message || 'Socket error' + this.code = 'UND_ERR_SOCKET' + this.socket = socket } +} - get free () { - return this[kPool][kFree] +class NotSupportedError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, NotSupportedError) + this.name = 'NotSupportedError' + this.message = message || 'Not supported error' + this.code = 'UND_ERR_NOT_SUPPORTED' } +} - get pending () { - return this[kPool][kPending] +class BalancedPoolMissingUpstreamError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, NotSupportedError) + this.name = 'MissingUpstreamError' + this.message = message || 'No upstream has been added to the BalancedPool' + this.code = 'UND_ERR_BPL_MISSING_UPSTREAM' } +} - get queued () { - return this[kPool][kQueued] +class HTTPParserError extends Error { + constructor (message, code, data) { + super(message) + Error.captureStackTrace(this, HTTPParserError) + this.name = 'HTTPParserError' + this.code = code ? `HPE_${code}` : undefined + this.data = data ? data.toString() : undefined } +} - get running () { - return this[kPool][kRunning] +class ResponseExceededMaxSizeError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, ResponseExceededMaxSizeError) + this.name = 'ResponseExceededMaxSizeError' + this.message = message || 'Response content exceeded max size' + this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE' } +} - get size () { - return this[kPool][kSize] +class RequestRetryError extends UndiciError { + constructor (message, code, { headers, data }) { + super(message) + Error.captureStackTrace(this, RequestRetryError) + this.name = 'RequestRetryError' + this.message = message || 'Request retry error' + this.code = 'UND_ERR_REQ_RETRY' + this.statusCode = code + this.data = data + this.headers = headers } } -module.exports = PoolStats +module.exports = { + HTTPParserError, + UndiciError, + HeadersTimeoutError, + HeadersOverflowError, + BodyTimeoutError, + RequestContentLengthMismatchError, + ConnectTimeoutError, + ResponseStatusCodeError, + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError, + ClientDestroyedError, + ClientClosedError, + InformationalError, + SocketError, + NotSupportedError, + ResponseContentLengthMismatchError, + BalancedPoolMissingUpstreamError, + ResponseExceededMaxSizeError, + RequestRetryError +} /***/ }), -/***/ 85186: +/***/ 8072: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { - PoolBase, - kClients, - kNeedDrain, - kAddClient, - kGetDispatcher -} = __nccwpck_require__(68504) -const Client = __nccwpck_require__(52463) -const { - InvalidArgumentError -} = __nccwpck_require__(46339) -const util = __nccwpck_require__(67468) -const { kUrl, kInterceptors } = __nccwpck_require__(48039) -const buildConnector = __nccwpck_require__(2209) + InvalidArgumentError, + NotSupportedError +} = __nccwpck_require__(70867) +const assert = __nccwpck_require__(39491) +const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(69898) +const util = __nccwpck_require__(43061) -const kOptions = Symbol('options') -const kConnections = Symbol('connections') -const kFactory = Symbol('factory') +// tokenRegExp and headerCharRegex have been lifted from +// https://github.com/nodejs/node/blob/main/lib/_http_common.js -function defaultFactory (origin, opts) { - return new Client(origin, opts) +/** + * Verifies that the given val is a valid HTTP token + * per the rules defined in RFC 7230 + * See https://tools.ietf.org/html/rfc7230#section-3.2.6 + */ +const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/ + +/** + * Matches if val contains an invalid field-vchar + * field-value = *( field-content / obs-fold ) + * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] + * field-vchar = VCHAR / obs-text + */ +const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/ + +// Verifies that a given path is valid does not contain control chars \x00 to \x20 +const invalidPathRegex = /[^\u0021-\u00ff]/ + +const kHandler = Symbol('handler') + +const channels = {} + +let extractBody + +try { + const diagnosticsChannel = __nccwpck_require__(67643) + channels.create = diagnosticsChannel.channel('undici:request:create') + channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent') + channels.headers = diagnosticsChannel.channel('undici:request:headers') + channels.trailers = diagnosticsChannel.channel('undici:request:trailers') + channels.error = diagnosticsChannel.channel('undici:request:error') +} catch { + channels.create = { hasSubscribers: false } + channels.bodySent = { hasSubscribers: false } + channels.headers = { hasSubscribers: false } + channels.trailers = { hasSubscribers: false } + channels.error = { hasSubscribers: false } } -class Pool extends PoolBase { +class Request { constructor (origin, { - connections, - factory = defaultFactory, - connect, - connectTimeout, - tls, - maxCachedSessions, - socketPath, - autoSelectFamily, - autoSelectFamilyAttemptTimeout, - allowH2, - ...options - } = {}) { - super() - - if (connections != null && (!Number.isFinite(connections) || connections < 0)) { - throw new InvalidArgumentError('invalid connections') + path, + method, + body, + headers, + query, + idempotent, + blocking, + upgrade, + headersTimeout, + bodyTimeout, + reset, + throwOnError, + expectContinue + }, handler) { + if (typeof path !== 'string') { + throw new InvalidArgumentError('path must be a string') + } else if ( + path[0] !== '/' && + !(path.startsWith('http://') || path.startsWith('https://')) && + method !== 'CONNECT' + ) { + throw new InvalidArgumentError('path must be an absolute URL or start with a slash') + } else if (invalidPathRegex.exec(path) !== null) { + throw new InvalidArgumentError('invalid request path') } - if (typeof factory !== 'function') { - throw new InvalidArgumentError('factory must be a function.') + if (typeof method !== 'string') { + throw new InvalidArgumentError('method must be a string') + } else if (tokenRegExp.exec(method) === null) { + throw new InvalidArgumentError('invalid request method') } - if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { - throw new InvalidArgumentError('connect must be a function or an object') + if (upgrade && typeof upgrade !== 'string') { + throw new InvalidArgumentError('upgrade must be a string') } - if (typeof connect !== 'function') { - connect = buildConnector({ - ...tls, - maxCachedSessions, - allowH2, - socketPath, - timeout: connectTimeout, - ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), - ...connect - }) + if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) { + throw new InvalidArgumentError('invalid headersTimeout') } - this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool) - ? options.interceptors.Pool - : [] - this[kConnections] = connections || null - this[kUrl] = util.parseOrigin(origin) - this[kOptions] = { ...util.deepClone(options), connect, allowH2 } - this[kOptions].interceptors = options.interceptors - ? { ...options.interceptors } - : undefined - this[kFactory] = factory - } - - [kGetDispatcher] () { - let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain]) + if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) { + throw new InvalidArgumentError('invalid bodyTimeout') + } - if (dispatcher) { - return dispatcher + if (reset != null && typeof reset !== 'boolean') { + throw new InvalidArgumentError('invalid reset') } - if (!this[kConnections] || this[kClients].length < this[kConnections]) { - dispatcher = this[kFactory](this[kUrl], this[kOptions]) - this[kAddClient](dispatcher) + if (expectContinue != null && typeof expectContinue !== 'boolean') { + throw new InvalidArgumentError('invalid expectContinue') } - return dispatcher - } -} + this.headersTimeout = headersTimeout -module.exports = Pool + this.bodyTimeout = bodyTimeout + this.throwOnError = throwOnError === true -/***/ }), + this.method = method -/***/ 44417: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + this.abort = null + if (body == null) { + this.body = null + } else if (util.isStream(body)) { + this.body = body + const rState = this.body._readableState + if (!rState || !rState.autoDestroy) { + this.endHandler = function autoDestroy () { + util.destroy(this) + } + this.body.on('end', this.endHandler) + } -const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(48039) -const { URL } = __nccwpck_require__(57310) -const Agent = __nccwpck_require__(97464) -const Pool = __nccwpck_require__(85186) -const DispatcherBase = __nccwpck_require__(32426) -const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(46339) -const buildConnector = __nccwpck_require__(2209) + this.errorHandler = err => { + if (this.abort) { + this.abort(err) + } else { + this.error = err + } + } + this.body.on('error', this.errorHandler) + } else if (util.isBuffer(body)) { + this.body = body.byteLength ? body : null + } else if (ArrayBuffer.isView(body)) { + this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null + } else if (body instanceof ArrayBuffer) { + this.body = body.byteLength ? Buffer.from(body) : null + } else if (typeof body === 'string') { + this.body = body.length ? Buffer.from(body) : null + } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) { + this.body = body + } else { + throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable') + } -const kAgent = Symbol('proxy agent') -const kClient = Symbol('proxy client') -const kProxyHeaders = Symbol('proxy headers') -const kRequestTls = Symbol('request tls settings') -const kProxyTls = Symbol('proxy tls settings') -const kConnectEndpoint = Symbol('connect endpoint function') + this.completed = false -function defaultProtocolPort (protocol) { - return protocol === 'https:' ? 443 : 80 -} + this.aborted = false -function buildProxyOptions (opts) { - if (typeof opts === 'string') { - opts = { uri: opts } - } + this.upgrade = upgrade || null - if (!opts || !opts.uri) { - throw new InvalidArgumentError('Proxy opts.uri is mandatory') - } + this.path = query ? util.buildURL(path, query) : path - return { - uri: opts.uri, - protocol: opts.protocol || 'https' - } -} + this.origin = origin -function defaultFactory (origin, opts) { - return new Pool(origin, opts) -} + this.idempotent = idempotent == null + ? method === 'HEAD' || method === 'GET' + : idempotent -class ProxyAgent extends DispatcherBase { - constructor (opts) { - super(opts) - this[kProxy] = buildProxyOptions(opts) - this[kAgent] = new Agent(opts) - this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent) - ? opts.interceptors.ProxyAgent - : [] + this.blocking = blocking == null ? false : blocking - if (typeof opts === 'string') { - opts = { uri: opts } - } + this.reset = reset == null ? null : reset - if (!opts || !opts.uri) { - throw new InvalidArgumentError('Proxy opts.uri is mandatory') + this.host = null + + this.contentLength = null + + this.contentType = null + + this.headers = '' + + // Only for H2 + this.expectContinue = expectContinue != null ? expectContinue : false + + if (Array.isArray(headers)) { + if (headers.length % 2 !== 0) { + throw new InvalidArgumentError('headers array must be even') + } + for (let i = 0; i < headers.length; i += 2) { + processHeader(this, headers[i], headers[i + 1]) + } + } else if (headers && typeof headers === 'object') { + const keys = Object.keys(headers) + for (let i = 0; i < keys.length; i++) { + const key = keys[i] + processHeader(this, key, headers[key]) + } + } else if (headers != null) { + throw new InvalidArgumentError('headers must be an object or an array') } - const { clientFactory = defaultFactory } = opts + if (util.isFormDataLike(this.body)) { + if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) { + throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.') + } - if (typeof clientFactory !== 'function') { - throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.') + if (!extractBody) { + extractBody = (__nccwpck_require__(42173).extractBody) + } + + const [bodyStream, contentType] = extractBody(body) + if (this.contentType == null) { + this.contentType = contentType + this.headers += `content-type: ${contentType}\r\n` + } + this.body = bodyStream.stream + this.contentLength = bodyStream.length + } else if (util.isBlobLike(body) && this.contentType == null && body.type) { + this.contentType = body.type + this.headers += `content-type: ${body.type}\r\n` } - this[kRequestTls] = opts.requestTls - this[kProxyTls] = opts.proxyTls - this[kProxyHeaders] = opts.headers || {} + util.validateHandler(handler, method, upgrade) - const resolvedUrl = new URL(opts.uri) - const { origin, port, host, username, password } = resolvedUrl + this.servername = util.getServerName(this.host) - if (opts.auth && opts.token) { - throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token') - } else if (opts.auth) { - /* @deprecated in favour of opts.token */ - this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}` - } else if (opts.token) { - this[kProxyHeaders]['proxy-authorization'] = opts.token - } else if (username && password) { - this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}` + this[kHandler] = handler + + if (channels.create.hasSubscribers) { + channels.create.publish({ request: this }) } + } - const connect = buildConnector({ ...opts.proxyTls }) - this[kConnectEndpoint] = buildConnector({ ...opts.requestTls }) - this[kClient] = clientFactory(resolvedUrl, { connect }) - this[kAgent] = new Agent({ - ...opts, - connect: async (opts, callback) => { - let requestedHost = opts.host - if (!opts.port) { - requestedHost += `:${defaultProtocolPort(opts.protocol)}` - } - try { - const { socket, statusCode } = await this[kClient].connect({ - origin, - port, - path: requestedHost, - signal: opts.signal, - headers: { - ...this[kProxyHeaders], - host - } - }) - if (statusCode !== 200) { - socket.on('error', () => {}).destroy() - callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`)) - } - if (opts.protocol !== 'https:') { - callback(null, socket) - return - } - let servername - if (this[kRequestTls]) { - servername = this[kRequestTls].servername - } else { - servername = opts.servername - } - this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback) - } catch (err) { - callback(err) - } + onBodySent (chunk) { + if (this[kHandler].onBodySent) { + try { + return this[kHandler].onBodySent(chunk) + } catch (err) { + this.abort(err) } - }) + } } - dispatch (opts, handler) { - const { host } = new URL(opts.origin) - const headers = buildHeaders(opts.headers) - throwIfProxyAuthIsSent(headers) - return this[kAgent].dispatch( - { - ...opts, - headers: { - ...headers, - host - } - }, - handler - ) - } + onRequestSent () { + if (channels.bodySent.hasSubscribers) { + channels.bodySent.publish({ request: this }) + } - async [kClose] () { - await this[kAgent].close() - await this[kClient].close() + if (this[kHandler].onRequestSent) { + try { + return this[kHandler].onRequestSent() + } catch (err) { + this.abort(err) + } + } } - async [kDestroy] () { - await this[kAgent].destroy() - await this[kClient].destroy() + onConnect (abort) { + assert(!this.aborted) + assert(!this.completed) + + if (this.error) { + abort(this.error) + } else { + this.abort = abort + return this[kHandler].onConnect(abort) + } } -} -/** - * @param {string[] | Record} headers - * @returns {Record} - */ -function buildHeaders (headers) { - // When using undici.fetch, the headers list is stored - // as an array. - if (Array.isArray(headers)) { - /** @type {Record} */ - const headersPair = {} + onHeaders (statusCode, headers, resume, statusText) { + assert(!this.aborted) + assert(!this.completed) - for (let i = 0; i < headers.length; i += 2) { - headersPair[headers[i]] = headers[i + 1] + if (channels.headers.hasSubscribers) { + channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }) } - return headersPair + try { + return this[kHandler].onHeaders(statusCode, headers, resume, statusText) + } catch (err) { + this.abort(err) + } } - return headers -} + onData (chunk) { + assert(!this.aborted) + assert(!this.completed) -/** - * @param {Record} headers - * - * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers - * Nevertheless, it was changed and to avoid a security vulnerability by end users - * this check was created. - * It should be removed in the next major version for performance reasons - */ -function throwIfProxyAuthIsSent (headers) { - const existProxyAuth = headers && Object.keys(headers) - .find((key) => key.toLowerCase() === 'proxy-authorization') - if (existProxyAuth) { - throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor') + try { + return this[kHandler].onData(chunk) + } catch (err) { + this.abort(err) + return false + } } -} -module.exports = ProxyAgent + onUpgrade (statusCode, headers, socket) { + assert(!this.aborted) + assert(!this.completed) + return this[kHandler].onUpgrade(statusCode, headers, socket) + } -/***/ }), + onComplete (trailers) { + this.onFinally() -/***/ 38965: -/***/ ((module) => { + assert(!this.aborted) + this.completed = true + if (channels.trailers.hasSubscribers) { + channels.trailers.publish({ request: this, trailers }) + } + try { + return this[kHandler].onComplete(trailers) + } catch (err) { + // TODO (fix): This might be a bad idea? + this.onError(err) + } + } -let fastNow = Date.now() -let fastNowTimeout + onError (error) { + this.onFinally() -const fastTimers = [] + if (channels.error.hasSubscribers) { + channels.error.publish({ request: this, error }) + } -function onTimeout () { - fastNow = Date.now() + if (this.aborted) { + return + } + this.aborted = true - let len = fastTimers.length - let idx = 0 - while (idx < len) { - const timer = fastTimers[idx] + return this[kHandler].onError(error) + } - if (timer.state === 0) { - timer.state = fastNow + timer.delay - } else if (timer.state > 0 && fastNow >= timer.state) { - timer.state = -1 - timer.callback(timer.opaque) + onFinally () { + if (this.errorHandler) { + this.body.off('error', this.errorHandler) + this.errorHandler = null } - if (timer.state === -1) { - timer.state = -2 - if (idx !== len - 1) { - fastTimers[idx] = fastTimers.pop() - } else { - fastTimers.pop() - } - len -= 1 - } else { - idx += 1 + if (this.endHandler) { + this.body.off('end', this.endHandler) + this.endHandler = null } } - if (fastTimers.length > 0) { - refreshTimeout() + // TODO: adjust to support H2 + addHeader (key, value) { + processHeader(this, key, value) + return this } -} -function refreshTimeout () { - if (fastNowTimeout && fastNowTimeout.refresh) { - fastNowTimeout.refresh() - } else { - clearTimeout(fastNowTimeout) - fastNowTimeout = setTimeout(onTimeout, 1e3) - if (fastNowTimeout.unref) { - fastNowTimeout.unref() - } + static [kHTTP1BuildRequest] (origin, opts, handler) { + // TODO: Migrate header parsing here, to make Requests + // HTTP agnostic + return new Request(origin, opts, handler) } -} -class Timeout { - constructor (callback, delay, opaque) { - this.callback = callback - this.delay = delay - this.opaque = opaque + static [kHTTP2BuildRequest] (origin, opts, handler) { + const headers = opts.headers + opts = { ...opts, headers: null } - // -2 not in timer list - // -1 in timer list but inactive - // 0 in timer list waiting for time - // > 0 in timer list waiting for time to expire - this.state = -2 + const request = new Request(origin, opts, handler) - this.refresh() - } + request.headers = {} - refresh () { - if (this.state === -2) { - fastTimers.push(this) - if (!fastNowTimeout || fastTimers.length === 1) { - refreshTimeout() + if (Array.isArray(headers)) { + if (headers.length % 2 !== 0) { + throw new InvalidArgumentError('headers array must be even') + } + for (let i = 0; i < headers.length; i += 2) { + processHeader(request, headers[i], headers[i + 1], true) } + } else if (headers && typeof headers === 'object') { + const keys = Object.keys(headers) + for (let i = 0; i < keys.length; i++) { + const key = keys[i] + processHeader(request, key, headers[key], true) + } + } else if (headers != null) { + throw new InvalidArgumentError('headers must be an object or an array') } - this.state = 0 + return request } - clear () { - this.state = -1 + static [kHTTP2CopyHeaders] (raw) { + const rawHeaders = raw.split('\r\n') + const headers = {} + + for (const header of rawHeaders) { + const [key, value] = header.split(': ') + + if (value == null || value.length === 0) continue + + if (headers[key]) headers[key] += `,${value}` + else headers[key] = value + } + + return headers } } -module.exports = { - setTimeout (callback, delay, opaque) { - return delay < 1e3 - ? setTimeout(callback, delay, opaque) - : new Timeout(callback, delay, opaque) - }, - clearTimeout (timeout) { - if (timeout instanceof Timeout) { - timeout.clear() +function processHeaderValue (key, val, skipAppend) { + if (val && typeof val === 'object') { + throw new InvalidArgumentError(`invalid ${key} header`) + } + + val = val != null ? `${val}` : '' + + if (headerCharRegex.exec(val) !== null) { + throw new InvalidArgumentError(`invalid ${key} header`) + } + + return skipAppend ? val : `${key}: ${val}\r\n` +} + +function processHeader (request, key, val, skipAppend = false) { + if (val && (typeof val === 'object' && !Array.isArray(val))) { + throw new InvalidArgumentError(`invalid ${key} header`) + } else if (val === undefined) { + return + } + + if ( + request.host === null && + key.length === 4 && + key.toLowerCase() === 'host' + ) { + if (headerCharRegex.exec(val) !== null) { + throw new InvalidArgumentError(`invalid ${key} header`) + } + // Consumed by Client + request.host = val + } else if ( + request.contentLength === null && + key.length === 14 && + key.toLowerCase() === 'content-length' + ) { + request.contentLength = parseInt(val, 10) + if (!Number.isFinite(request.contentLength)) { + throw new InvalidArgumentError('invalid content-length header') + } + } else if ( + request.contentType === null && + key.length === 12 && + key.toLowerCase() === 'content-type' + ) { + request.contentType = val + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend) + else request.headers += processHeaderValue(key, val) + } else if ( + key.length === 17 && + key.toLowerCase() === 'transfer-encoding' + ) { + throw new InvalidArgumentError('invalid transfer-encoding header') + } else if ( + key.length === 10 && + key.toLowerCase() === 'connection' + ) { + const value = typeof val === 'string' ? val.toLowerCase() : null + if (value !== 'close' && value !== 'keep-alive') { + throw new InvalidArgumentError('invalid connection header') + } else if (value === 'close') { + request.reset = true + } + } else if ( + key.length === 10 && + key.toLowerCase() === 'keep-alive' + ) { + throw new InvalidArgumentError('invalid keep-alive header') + } else if ( + key.length === 7 && + key.toLowerCase() === 'upgrade' + ) { + throw new InvalidArgumentError('invalid upgrade header') + } else if ( + key.length === 6 && + key.toLowerCase() === 'expect' + ) { + throw new NotSupportedError('expect header not supported') + } else if (tokenRegExp.exec(key) === null) { + throw new InvalidArgumentError('invalid header key') + } else { + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { + if (skipAppend) { + if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}` + else request.headers[key] = processHeaderValue(key, val[i], skipAppend) + } else { + request.headers += processHeaderValue(key, val[i]) + } + } } else { - clearTimeout(timeout) + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend) + else request.headers += processHeaderValue(key, val) } } } +module.exports = Request -/***/ }), - -/***/ 60337: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - - -const diagnosticsChannel = __nccwpck_require__(67643) -const { uid, states } = __nccwpck_require__(6246) -const { - kReadyState, - kSentClose, - kByteParser, - kReceivedClose -} = __nccwpck_require__(18099) -const { fireEvent, failWebsocketConnection } = __nccwpck_require__(72125) -const { CloseEvent } = __nccwpck_require__(28381) -const { makeRequest } = __nccwpck_require__(7288) -const { fetching } = __nccwpck_require__(72748) -const { Headers } = __nccwpck_require__(23245) -const { getGlobalDispatcher } = __nccwpck_require__(29102) -const { kHeadersList } = __nccwpck_require__(48039) -const channels = {} -channels.open = diagnosticsChannel.channel('undici:websocket:open') -channels.close = diagnosticsChannel.channel('undici:websocket:close') -channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error') +/***/ }), -/** @type {import('crypto')} */ -let crypto -try { - crypto = __nccwpck_require__(6113) -} catch { +/***/ 69898: +/***/ ((module) => { +module.exports = { + kClose: Symbol('close'), + kDestroy: Symbol('destroy'), + kDispatch: Symbol('dispatch'), + kUrl: Symbol('url'), + kWriting: Symbol('writing'), + kResuming: Symbol('resuming'), + kQueue: Symbol('queue'), + kConnect: Symbol('connect'), + kConnecting: Symbol('connecting'), + kHeadersList: Symbol('headers list'), + kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'), + kKeepAliveMaxTimeout: Symbol('max keep alive timeout'), + kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'), + kKeepAliveTimeoutValue: Symbol('keep alive timeout'), + kKeepAlive: Symbol('keep alive'), + kHeadersTimeout: Symbol('headers timeout'), + kBodyTimeout: Symbol('body timeout'), + kServerName: Symbol('server name'), + kLocalAddress: Symbol('local address'), + kHost: Symbol('host'), + kNoRef: Symbol('no ref'), + kBodyUsed: Symbol('used'), + kRunning: Symbol('running'), + kBlocking: Symbol('blocking'), + kPending: Symbol('pending'), + kSize: Symbol('size'), + kBusy: Symbol('busy'), + kQueued: Symbol('queued'), + kFree: Symbol('free'), + kConnected: Symbol('connected'), + kClosed: Symbol('closed'), + kNeedDrain: Symbol('need drain'), + kReset: Symbol('reset'), + kDestroyed: Symbol.for('nodejs.stream.destroyed'), + kMaxHeadersSize: Symbol('max headers size'), + kRunningIdx: Symbol('running index'), + kPendingIdx: Symbol('pending index'), + kError: Symbol('error'), + kClients: Symbol('clients'), + kClient: Symbol('client'), + kParser: Symbol('parser'), + kOnDestroyed: Symbol('destroy callbacks'), + kPipelining: Symbol('pipelining'), + kSocket: Symbol('socket'), + kHostHeader: Symbol('host header'), + kConnector: Symbol('connector'), + kStrictContentLength: Symbol('strict content length'), + kMaxRedirections: Symbol('maxRedirections'), + kMaxRequests: Symbol('maxRequestsPerClient'), + kProxy: Symbol('proxy agent options'), + kCounter: Symbol('socket request counter'), + kInterceptors: Symbol('dispatch interceptors'), + kMaxResponseSize: Symbol('max response size'), + kHTTP2Session: Symbol('http2Session'), + kHTTP2SessionState: Symbol('http2Session state'), + kHTTP2BuildRequest: Symbol('http2 build request'), + kHTTP1BuildRequest: Symbol('http1 build request'), + kHTTP2CopyHeaders: Symbol('http2 copy headers'), + kHTTPConnVersion: Symbol('http connection version'), + kRetryHandlerDefaultRetry: Symbol('retry agent default retry'), + kConstruct: Symbol('constructable') } -/** - * @see https://websockets.spec.whatwg.org/#concept-websocket-establish - * @param {URL} url - * @param {string|string[]} protocols - * @param {import('./websocket').WebSocket} ws - * @param {(response: any) => void} onEstablish - * @param {Partial} options - */ -function establishWebSocketConnection (url, protocols, ws, onEstablish, options) { - // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s - // scheme is "ws", and to "https" otherwise. - const requestURL = url - requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:' +/***/ }), - // 2. Let request be a new request, whose URL is requestURL, client is client, - // service-workers mode is "none", referrer is "no-referrer", mode is - // "websocket", credentials mode is "include", cache mode is "no-store" , - // and redirect mode is "error". - const request = makeRequest({ - urlList: [requestURL], - serviceWorkers: 'none', - referrer: 'no-referrer', - mode: 'websocket', - credentials: 'include', - cache: 'no-store', - redirect: 'error' - }) +/***/ 43061: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // Note: undici extension, allow setting custom headers. - if (options.headers) { - const headersList = new Headers(options.headers)[kHeadersList] - request.headersList = headersList - } - // 3. Append (`Upgrade`, `websocket`) to request’s header list. - // 4. Append (`Connection`, `Upgrade`) to request’s header list. - // Note: both of these are handled by undici currently. - // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397 +const assert = __nccwpck_require__(39491) +const { kDestroyed, kBodyUsed } = __nccwpck_require__(69898) +const { IncomingMessage } = __nccwpck_require__(13685) +const stream = __nccwpck_require__(12781) +const net = __nccwpck_require__(41808) +const { InvalidArgumentError } = __nccwpck_require__(70867) +const { Blob } = __nccwpck_require__(14300) +const nodeUtil = __nccwpck_require__(73837) +const { stringify } = __nccwpck_require__(63477) - // 5. Let keyValue be a nonce consisting of a randomly selected - // 16-byte value that has been forgiving-base64-encoded and - // isomorphic encoded. - const keyValue = crypto.randomBytes(16).toString('base64') +const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v)) - // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s - // header list. - request.headersList.append('sec-websocket-key', keyValue) +function nop () {} - // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s - // header list. - request.headersList.append('sec-websocket-version', '13') +function isStream (obj) { + return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function' +} - // 8. For each protocol in protocols, combine - // (`Sec-WebSocket-Protocol`, protocol) in request’s header - // list. - for (const protocol of protocols) { - request.headersList.append('sec-websocket-protocol', protocol) +// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License) +function isBlobLike (object) { + return (Blob && object instanceof Blob) || ( + object && + typeof object === 'object' && + (typeof object.stream === 'function' || + typeof object.arrayBuffer === 'function') && + /^(Blob|File)$/.test(object[Symbol.toStringTag]) + ) +} + +function buildURL (url, queryParams) { + if (url.includes('?') || url.includes('#')) { + throw new Error('Query params cannot be passed when url already contains "?" or "#".') } - // 9. Let permessageDeflate be a user-agent defined - // "permessage-deflate" extension header value. - // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673 - // TODO: enable once permessage-deflate is supported - const permessageDeflate = '' // 'permessage-deflate; 15' + const stringified = stringify(queryParams) - // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to - // request’s header list. - // request.headersList.append('sec-websocket-extensions', permessageDeflate) + if (stringified) { + url += '?' + stringified + } - // 11. Fetch request with useParallelQueue set to true, and - // processResponse given response being these steps: - const controller = fetching({ - request, - useParallelQueue: true, - dispatcher: options.dispatcher ?? getGlobalDispatcher(), - processResponse (response) { - // 1. If response is a network error or its status is not 101, - // fail the WebSocket connection. - if (response.type === 'error' || response.status !== 101) { - failWebsocketConnection(ws, 'Received network error or non-101 status code.') - return - } + return url +} - // 2. If protocols is not the empty list and extracting header - // list values given `Sec-WebSocket-Protocol` and response’s - // header list results in null, failure, or the empty byte - // sequence, then fail the WebSocket connection. - if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) { - failWebsocketConnection(ws, 'Server did not respond with sent protocols.') - return - } +function parseURL (url) { + if (typeof url === 'string') { + url = new URL(url) - // 3. Follow the requirements stated step 2 to step 6, inclusive, - // of the last set of steps in section 4.1 of The WebSocket - // Protocol to validate response. This either results in fail - // the WebSocket connection or the WebSocket connection is - // established. + if (!/^https?:/.test(url.origin || url.protocol)) { + throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.') + } - // 2. If the response lacks an |Upgrade| header field or the |Upgrade| - // header field contains a value that is not an ASCII case- - // insensitive match for the value "websocket", the client MUST - // _Fail the WebSocket Connection_. - if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') { - failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".') - return - } + return url + } - // 3. If the response lacks a |Connection| header field or the - // |Connection| header field doesn't contain a token that is an - // ASCII case-insensitive match for the value "Upgrade", the client - // MUST _Fail the WebSocket Connection_. - if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') { - failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".') - return - } + if (!url || typeof url !== 'object') { + throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.') + } - // 4. If the response lacks a |Sec-WebSocket-Accept| header field or - // the |Sec-WebSocket-Accept| contains a value other than the - // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket- - // Key| (as a string, not base64-decoded) with the string "258EAFA5- - // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and - // trailing whitespace, the client MUST _Fail the WebSocket - // Connection_. - const secWSAccept = response.headersList.get('Sec-WebSocket-Accept') - const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64') - if (secWSAccept !== digest) { - failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.') - return - } + if (!/^https?:/.test(url.origin || url.protocol)) { + throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.') + } - // 5. If the response includes a |Sec-WebSocket-Extensions| header - // field and this header field indicates the use of an extension - // that was not present in the client's handshake (the server has - // indicated an extension not requested by the client), the client - // MUST _Fail the WebSocket Connection_. (The parsing of this - // header field to determine which extensions are requested is - // discussed in Section 9.1.) - const secExtension = response.headersList.get('Sec-WebSocket-Extensions') + if (!(url instanceof URL)) { + if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) { + throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.') + } - if (secExtension !== null && secExtension !== permessageDeflate) { - failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.') - return - } + if (url.path != null && typeof url.path !== 'string') { + throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.') + } - // 6. If the response includes a |Sec-WebSocket-Protocol| header field - // and this header field indicates the use of a subprotocol that was - // not present in the client's handshake (the server has indicated a - // subprotocol not requested by the client), the client MUST _Fail - // the WebSocket Connection_. - const secProtocol = response.headersList.get('Sec-WebSocket-Protocol') + if (url.pathname != null && typeof url.pathname !== 'string') { + throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.') + } - if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) { - failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.') - return - } + if (url.hostname != null && typeof url.hostname !== 'string') { + throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.') + } - response.socket.on('data', onSocketData) - response.socket.on('close', onSocketClose) - response.socket.on('error', onSocketError) + if (url.origin != null && typeof url.origin !== 'string') { + throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.') + } - if (channels.open.hasSubscribers) { - channels.open.publish({ - address: response.socket.address(), - protocol: secProtocol, - extensions: secExtension - }) - } + const port = url.port != null + ? url.port + : (url.protocol === 'https:' ? 443 : 80) + let origin = url.origin != null + ? url.origin + : `${url.protocol}//${url.hostname}:${port}` + let path = url.path != null + ? url.path + : `${url.pathname || ''}${url.search || ''}` - onEstablish(response) + if (origin.endsWith('/')) { + origin = origin.substring(0, origin.length - 1) } - }) - return controller -} - -/** - * @param {Buffer} chunk - */ -function onSocketData (chunk) { - if (!this.ws[kByteParser].write(chunk)) { - this.pause() + if (path && !path.startsWith('/')) { + path = `/${path}` + } + // new URL(path, origin) is unsafe when `path` contains an absolute URL + // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL: + // If first parameter is a relative URL, second param is required, and will be used as the base URL. + // If first parameter is an absolute URL, a given second param will be ignored. + url = new URL(origin + path) } + + return url } -/** - * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol - * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4 - */ -function onSocketClose () { - const { ws } = this +function parseOrigin (url) { + url = parseURL(url) - // If the TCP connection was closed after the - // WebSocket closing handshake was completed, the WebSocket connection - // is said to have been closed _cleanly_. - const wasClean = ws[kSentClose] && ws[kReceivedClose] + if (url.pathname !== '/' || url.search || url.hash) { + throw new InvalidArgumentError('invalid url') + } - let code = 1005 - let reason = '' + return url +} - const result = ws[kByteParser].closingInfo +function getHostname (host) { + if (host[0] === '[') { + const idx = host.indexOf(']') - if (result) { - code = result.code ?? 1005 - reason = result.reason - } else if (!ws[kSentClose]) { - // If _The WebSocket - // Connection is Closed_ and no Close control frame was received by the - // endpoint (such as could occur if the underlying transport connection - // is lost), _The WebSocket Connection Close Code_ is considered to be - // 1006. - code = 1006 + assert(idx !== -1) + return host.substring(1, idx) } - // 1. Change the ready state to CLOSED (3). - ws[kReadyState] = states.CLOSED - - // 2. If the user agent was required to fail the WebSocket - // connection, or if the WebSocket connection was closed - // after being flagged as full, fire an event named error - // at the WebSocket object. - // TODO - - // 3. Fire an event named close at the WebSocket object, - // using CloseEvent, with the wasClean attribute - // initialized to true if the connection closed cleanly - // and false otherwise, the code attribute initialized to - // the WebSocket connection close code, and the reason - // attribute initialized to the result of applying UTF-8 - // decode without BOM to the WebSocket connection close - // reason. - fireEvent('close', ws, CloseEvent, { - wasClean, code, reason - }) + const idx = host.indexOf(':') + if (idx === -1) return host - if (channels.close.hasSubscribers) { - channels.close.publish({ - websocket: ws, - code, - reason - }) - } + return host.substring(0, idx) } -function onSocketError (error) { - const { ws } = this +// IP addresses are not valid server names per RFC6066 +// > Currently, the only server names supported are DNS hostnames +function getServerName (host) { + if (!host) { + return null + } - ws[kReadyState] = states.CLOSING + assert.strictEqual(typeof host, 'string') - if (channels.socketError.hasSubscribers) { - channels.socketError.publish(error) + const servername = getHostname(host) + if (net.isIP(servername)) { + return '' } - this.destroy() + return servername } -module.exports = { - establishWebSocketConnection +function deepClone (obj) { + return JSON.parse(JSON.stringify(obj)) } +function isAsyncIterable (obj) { + return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function') +} -/***/ }), - -/***/ 6246: -/***/ ((module) => { - - +function isIterable (obj) { + return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function')) +} -// This is a Globally Unique Identifier unique used -// to validate that the endpoint accepts websocket -// connections. -// See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3 -const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11' +function bodyLength (body) { + if (body == null) { + return 0 + } else if (isStream(body)) { + const state = body._readableState + return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length) + ? state.length + : null + } else if (isBlobLike(body)) { + return body.size != null ? body.size : null + } else if (isBuffer(body)) { + return body.byteLength + } -/** @type {PropertyDescriptor} */ -const staticPropertyDescriptors = { - enumerable: true, - writable: false, - configurable: false + return null } -const states = { - CONNECTING: 0, - OPEN: 1, - CLOSING: 2, - CLOSED: 3 +function isDestroyed (stream) { + return !stream || !!(stream.destroyed || stream[kDestroyed]) } -const opcodes = { - CONTINUATION: 0x0, - TEXT: 0x1, - BINARY: 0x2, - CLOSE: 0x8, - PING: 0x9, - PONG: 0xA +function isReadableAborted (stream) { + const state = stream && stream._readableState + return isDestroyed(stream) && state && !state.endEmitted } -const maxUnsigned16Bit = 2 ** 16 - 1 // 65535 +function destroy (stream, err) { + if (stream == null || !isStream(stream) || isDestroyed(stream)) { + return + } -const parserStates = { - INFO: 0, - PAYLOADLENGTH_16: 2, - PAYLOADLENGTH_64: 3, - READ_DATA: 4 -} + if (typeof stream.destroy === 'function') { + if (Object.getPrototypeOf(stream).constructor === IncomingMessage) { + // See: https://github.com/nodejs/node/pull/38505/files + stream.socket = null + } -const emptyBuffer = Buffer.allocUnsafe(0) + stream.destroy(err) + } else if (err) { + process.nextTick((stream, err) => { + stream.emit('error', err) + }, stream, err) + } -module.exports = { - uid, - staticPropertyDescriptors, - states, - opcodes, - maxUnsigned16Bit, - parserStates, - emptyBuffer + if (stream.destroyed !== true) { + stream[kDestroyed] = true + } } +const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/ +function parseKeepAliveTimeout (val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR) + return m ? parseInt(m[1], 10) * 1000 : null +} -/***/ }), - -/***/ 28381: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - +function parseHeaders (headers, obj = {}) { + // For H2 support + if (!Array.isArray(headers)) return headers + for (let i = 0; i < headers.length; i += 2) { + const key = headers[i].toString().toLowerCase() + let val = obj[key] -const { webidl } = __nccwpck_require__(96138) -const { kEnumerableProperty } = __nccwpck_require__(67468) -const { MessagePort } = __nccwpck_require__(71267) + if (!val) { + if (Array.isArray(headers[i + 1])) { + obj[key] = headers[i + 1].map(x => x.toString('utf8')) + } else { + obj[key] = headers[i + 1].toString('utf8') + } + } else { + if (!Array.isArray(val)) { + val = [val] + obj[key] = val + } + val.push(headers[i + 1].toString('utf8')) + } + } -/** - * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent - */ -class MessageEvent extends Event { - #eventInit + // See https://github.com/nodejs/node/pull/46528 + if ('content-length' in obj && 'content-disposition' in obj) { + obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1') + } - constructor (type, eventInitDict = {}) { - webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' }) + return obj +} - type = webidl.converters.DOMString(type) - eventInitDict = webidl.converters.MessageEventInit(eventInitDict) +function parseRawHeaders (headers) { + const ret = [] + let hasContentLength = false + let contentDispositionIdx = -1 - super(type, eventInitDict) + for (let n = 0; n < headers.length; n += 2) { + const key = headers[n + 0].toString() + const val = headers[n + 1].toString('utf8') - this.#eventInit = eventInitDict + if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) { + ret.push(key, val) + hasContentLength = true + } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) { + contentDispositionIdx = ret.push(key, val) - 1 + } else { + ret.push(key, val) + } } - get data () { - webidl.brandCheck(this, MessageEvent) - - return this.#eventInit.data + // See https://github.com/nodejs/node/pull/46528 + if (hasContentLength && contentDispositionIdx !== -1) { + ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1') } - get origin () { - webidl.brandCheck(this, MessageEvent) - - return this.#eventInit.origin - } + return ret +} - get lastEventId () { - webidl.brandCheck(this, MessageEvent) +function isBuffer (buffer) { + // See, https://github.com/mcollina/undici/pull/319 + return buffer instanceof Uint8Array || Buffer.isBuffer(buffer) +} - return this.#eventInit.lastEventId +function validateHandler (handler, method, upgrade) { + if (!handler || typeof handler !== 'object') { + throw new InvalidArgumentError('handler must be an object') } - get source () { - webidl.brandCheck(this, MessageEvent) - - return this.#eventInit.source + if (typeof handler.onConnect !== 'function') { + throw new InvalidArgumentError('invalid onConnect method') } - get ports () { - webidl.brandCheck(this, MessageEvent) - - if (!Object.isFrozen(this.#eventInit.ports)) { - Object.freeze(this.#eventInit.ports) - } + if (typeof handler.onError !== 'function') { + throw new InvalidArgumentError('invalid onError method') + } - return this.#eventInit.ports + if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) { + throw new InvalidArgumentError('invalid onBodySent method') } - initMessageEvent ( - type, - bubbles = false, - cancelable = false, - data = null, - origin = '', - lastEventId = '', - source = null, - ports = [] - ) { - webidl.brandCheck(this, MessageEvent) + if (upgrade || method === 'CONNECT') { + if (typeof handler.onUpgrade !== 'function') { + throw new InvalidArgumentError('invalid onUpgrade method') + } + } else { + if (typeof handler.onHeaders !== 'function') { + throw new InvalidArgumentError('invalid onHeaders method') + } - webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' }) + if (typeof handler.onData !== 'function') { + throw new InvalidArgumentError('invalid onData method') + } - return new MessageEvent(type, { - bubbles, cancelable, data, origin, lastEventId, source, ports - }) + if (typeof handler.onComplete !== 'function') { + throw new InvalidArgumentError('invalid onComplete method') + } } } -/** - * @see https://websockets.spec.whatwg.org/#the-closeevent-interface - */ -class CloseEvent extends Event { - #eventInit - - constructor (type, eventInitDict = {}) { - webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' }) +// A body is disturbed if it has been read from and it cannot +// be re-used without losing state or data. +function isDisturbed (body) { + return !!(body && ( + stream.isDisturbed + ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed? + : body[kBodyUsed] || + body.readableDidRead || + (body._readableState && body._readableState.dataEmitted) || + isReadableAborted(body) + )) +} - type = webidl.converters.DOMString(type) - eventInitDict = webidl.converters.CloseEventInit(eventInitDict) +function isErrored (body) { + return !!(body && ( + stream.isErrored + ? stream.isErrored(body) + : /state: 'errored'/.test(nodeUtil.inspect(body) + ))) +} - super(type, eventInitDict) +function isReadable (body) { + return !!(body && ( + stream.isReadable + ? stream.isReadable(body) + : /state: 'readable'/.test(nodeUtil.inspect(body) + ))) +} - this.#eventInit = eventInitDict +function getSocketInfo (socket) { + return { + localAddress: socket.localAddress, + localPort: socket.localPort, + remoteAddress: socket.remoteAddress, + remotePort: socket.remotePort, + remoteFamily: socket.remoteFamily, + timeout: socket.timeout, + bytesWritten: socket.bytesWritten, + bytesRead: socket.bytesRead } +} - get wasClean () { - webidl.brandCheck(this, CloseEvent) - - return this.#eventInit.wasClean +async function * convertIterableToBuffer (iterable) { + for await (const chunk of iterable) { + yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk) } +} - get code () { - webidl.brandCheck(this, CloseEvent) - - return this.#eventInit.code +let ReadableStream +function ReadableStreamFrom (iterable) { + if (!ReadableStream) { + ReadableStream = (__nccwpck_require__(35356).ReadableStream) } - get reason () { - webidl.brandCheck(this, CloseEvent) - - return this.#eventInit.reason + if (ReadableStream.from) { + return ReadableStream.from(convertIterableToBuffer(iterable)) } -} -// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface -class ErrorEvent extends Event { - #eventInit - - constructor (type, eventInitDict) { - webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' }) + let iterator + return new ReadableStream( + { + async start () { + iterator = iterable[Symbol.asyncIterator]() + }, + async pull (controller) { + const { done, value } = await iterator.next() + if (done) { + queueMicrotask(() => { + controller.close() + }) + } else { + const buf = Buffer.isBuffer(value) ? value : Buffer.from(value) + controller.enqueue(new Uint8Array(buf)) + } + return controller.desiredSize > 0 + }, + async cancel (reason) { + await iterator.return() + } + }, + 0 + ) +} - super(type, eventInitDict) +// The chunk should be a FormData instance and contains +// all the required methods. +function isFormDataLike (object) { + return ( + object && + typeof object === 'object' && + typeof object.append === 'function' && + typeof object.delete === 'function' && + typeof object.get === 'function' && + typeof object.getAll === 'function' && + typeof object.has === 'function' && + typeof object.set === 'function' && + object[Symbol.toStringTag] === 'FormData' + ) +} - type = webidl.converters.DOMString(type) - eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {}) +function throwIfAborted (signal) { + if (!signal) { return } + if (typeof signal.throwIfAborted === 'function') { + signal.throwIfAborted() + } else { + if (signal.aborted) { + // DOMException not available < v17.0.0 + const err = new Error('The operation was aborted') + err.name = 'AbortError' + throw err + } + } +} - this.#eventInit = eventInitDict +function addAbortListener (signal, listener) { + if ('addEventListener' in signal) { + signal.addEventListener('abort', listener, { once: true }) + return () => signal.removeEventListener('abort', listener) } + signal.addListener('abort', listener) + return () => signal.removeListener('abort', listener) +} - get message () { - webidl.brandCheck(this, ErrorEvent) +const hasToWellFormed = !!String.prototype.toWellFormed - return this.#eventInit.message +/** + * @param {string} val + */ +function toUSVString (val) { + if (hasToWellFormed) { + return `${val}`.toWellFormed() + } else if (nodeUtil.toUSVString) { + return nodeUtil.toUSVString(val) } - get filename () { - webidl.brandCheck(this, ErrorEvent) + return `${val}` +} - return this.#eventInit.filename - } +// Parsed accordingly to RFC 9110 +// https://www.rfc-editor.org/rfc/rfc9110#field.content-range +function parseRangeHeader (range) { + if (range == null || range === '') return { start: 0, end: null, size: null } - get lineno () { - webidl.brandCheck(this, ErrorEvent) + const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null + return m + ? { + start: parseInt(m[1]), + end: m[2] ? parseInt(m[2]) : null, + size: m[3] ? parseInt(m[3]) : null + } + : null +} - return this.#eventInit.lineno - } +const kEnumerableProperty = Object.create(null) +kEnumerableProperty.enumerable = true - get colno () { - webidl.brandCheck(this, ErrorEvent) +module.exports = { + kEnumerableProperty, + nop, + isDisturbed, + isErrored, + isReadable, + toUSVString, + isReadableAborted, + isBlobLike, + parseOrigin, + parseURL, + getServerName, + isStream, + isIterable, + isAsyncIterable, + isDestroyed, + parseRawHeaders, + parseHeaders, + parseKeepAliveTimeout, + destroy, + bodyLength, + deepClone, + ReadableStreamFrom, + isBuffer, + validateHandler, + getSocketInfo, + isFormDataLike, + buildURL, + throwIfAborted, + addAbortListener, + parseRangeHeader, + nodeMajor, + nodeMinor, + nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13), + safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE'] +} - return this.#eventInit.colno - } - get error () { - webidl.brandCheck(this, ErrorEvent) +/***/ }), - return this.#eventInit.error - } -} +/***/ 33090: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -Object.defineProperties(MessageEvent.prototype, { - [Symbol.toStringTag]: { - value: 'MessageEvent', - configurable: true - }, - data: kEnumerableProperty, - origin: kEnumerableProperty, - lastEventId: kEnumerableProperty, - source: kEnumerableProperty, - ports: kEnumerableProperty, - initMessageEvent: kEnumerableProperty -}) -Object.defineProperties(CloseEvent.prototype, { - [Symbol.toStringTag]: { - value: 'CloseEvent', - configurable: true - }, - reason: kEnumerableProperty, - code: kEnumerableProperty, - wasClean: kEnumerableProperty -}) -Object.defineProperties(ErrorEvent.prototype, { - [Symbol.toStringTag]: { - value: 'ErrorEvent', - configurable: true - }, - message: kEnumerableProperty, - filename: kEnumerableProperty, - lineno: kEnumerableProperty, - colno: kEnumerableProperty, - error: kEnumerableProperty -}) +const Dispatcher = __nccwpck_require__(13624) +const { + ClientDestroyedError, + ClientClosedError, + InvalidArgumentError +} = __nccwpck_require__(70867) +const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(69898) -webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort) +const kDestroyed = Symbol('destroyed') +const kClosed = Symbol('closed') +const kOnDestroyed = Symbol('onDestroyed') +const kOnClosed = Symbol('onClosed') +const kInterceptedDispatch = Symbol('Intercepted Dispatch') -webidl.converters['sequence'] = webidl.sequenceConverter( - webidl.converters.MessagePort -) +class DispatcherBase extends Dispatcher { + constructor () { + super() -const eventInit = [ - { - key: 'bubbles', - converter: webidl.converters.boolean, - defaultValue: false - }, - { - key: 'cancelable', - converter: webidl.converters.boolean, - defaultValue: false - }, - { - key: 'composed', - converter: webidl.converters.boolean, - defaultValue: false + this[kDestroyed] = false + this[kOnDestroyed] = null + this[kClosed] = false + this[kOnClosed] = [] } -] -webidl.converters.MessageEventInit = webidl.dictionaryConverter([ - ...eventInit, - { - key: 'data', - converter: webidl.converters.any, - defaultValue: null - }, - { - key: 'origin', - converter: webidl.converters.USVString, - defaultValue: '' - }, - { - key: 'lastEventId', - converter: webidl.converters.DOMString, - defaultValue: '' - }, - { - key: 'source', - // Node doesn't implement WindowProxy or ServiceWorker, so the only - // valid value for source is a MessagePort. - converter: webidl.nullableConverter(webidl.converters.MessagePort), - defaultValue: null - }, - { - key: 'ports', - converter: webidl.converters['sequence'], - get defaultValue () { - return [] - } + get destroyed () { + return this[kDestroyed] } -]) -webidl.converters.CloseEventInit = webidl.dictionaryConverter([ - ...eventInit, - { - key: 'wasClean', - converter: webidl.converters.boolean, - defaultValue: false - }, - { - key: 'code', - converter: webidl.converters['unsigned short'], - defaultValue: 0 - }, - { - key: 'reason', - converter: webidl.converters.USVString, - defaultValue: '' + get closed () { + return this[kClosed] } -]) -webidl.converters.ErrorEventInit = webidl.dictionaryConverter([ - ...eventInit, - { - key: 'message', - converter: webidl.converters.DOMString, - defaultValue: '' - }, - { - key: 'filename', - converter: webidl.converters.USVString, - defaultValue: '' - }, - { - key: 'lineno', - converter: webidl.converters['unsigned long'], - defaultValue: 0 - }, - { - key: 'colno', - converter: webidl.converters['unsigned long'], - defaultValue: 0 - }, - { - key: 'error', - converter: webidl.converters.any + get interceptors () { + return this[kInterceptors] } -]) - -module.exports = { - MessageEvent, - CloseEvent, - ErrorEvent -} + set interceptors (newInterceptors) { + if (newInterceptors) { + for (let i = newInterceptors.length - 1; i >= 0; i--) { + const interceptor = this[kInterceptors][i] + if (typeof interceptor !== 'function') { + throw new InvalidArgumentError('interceptor must be an function') + } + } + } -/***/ }), + this[kInterceptors] = newInterceptors + } -/***/ 15020: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + close (callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + this.close((err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + if (this[kDestroyed]) { + queueMicrotask(() => callback(new ClientDestroyedError(), null)) + return + } -const { maxUnsigned16Bit } = __nccwpck_require__(6246) + if (this[kClosed]) { + if (this[kOnClosed]) { + this[kOnClosed].push(callback) + } else { + queueMicrotask(() => callback(null, null)) + } + return + } -/** @type {import('crypto')} */ -let crypto -try { - crypto = __nccwpck_require__(6113) -} catch { + this[kClosed] = true + this[kOnClosed].push(callback) -} + const onClosed = () => { + const callbacks = this[kOnClosed] + this[kOnClosed] = null + for (let i = 0; i < callbacks.length; i++) { + callbacks[i](null, null) + } + } -class WebsocketFrameSend { - /** - * @param {Buffer|undefined} data - */ - constructor (data) { - this.frameData = data - this.maskKey = crypto.randomBytes(4) + // Should not error. + this[kClose]() + .then(() => this.destroy()) + .then(() => { + queueMicrotask(onClosed) + }) } - createFrame (opcode) { - const bodyLength = this.frameData?.byteLength ?? 0 - - /** @type {number} */ - let payloadLength = bodyLength // 0-125 - let offset = 6 + destroy (err, callback) { + if (typeof err === 'function') { + callback = err + err = null + } - if (bodyLength > maxUnsigned16Bit) { - offset += 8 // payload length is next 8 bytes - payloadLength = 127 - } else if (bodyLength > 125) { - offset += 2 // payload length is next 2 bytes - payloadLength = 126 + if (callback === undefined) { + return new Promise((resolve, reject) => { + this.destroy(err, (err, data) => { + return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data) + }) + }) } - const buffer = Buffer.allocUnsafe(bodyLength + offset) + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } - // Clear first 2 bytes, everything else is overwritten - buffer[0] = buffer[1] = 0 - buffer[0] |= 0x80 // FIN - buffer[0] = (buffer[0] & 0xF0) + opcode // opcode + if (this[kDestroyed]) { + if (this[kOnDestroyed]) { + this[kOnDestroyed].push(callback) + } else { + queueMicrotask(() => callback(null, null)) + } + return + } - /*! ws. MIT License. Einar Otto Stangvik */ - buffer[offset - 4] = this.maskKey[0] - buffer[offset - 3] = this.maskKey[1] - buffer[offset - 2] = this.maskKey[2] - buffer[offset - 1] = this.maskKey[3] + if (!err) { + err = new ClientDestroyedError() + } - buffer[1] = payloadLength + this[kDestroyed] = true + this[kOnDestroyed] = this[kOnDestroyed] || [] + this[kOnDestroyed].push(callback) - if (payloadLength === 126) { - buffer.writeUInt16BE(bodyLength, 2) - } else if (payloadLength === 127) { - // Clear extended payload length - buffer[2] = buffer[3] = 0 - buffer.writeUIntBE(bodyLength, 4, 6) + const onDestroyed = () => { + const callbacks = this[kOnDestroyed] + this[kOnDestroyed] = null + for (let i = 0; i < callbacks.length; i++) { + callbacks[i](null, null) + } } - buffer[1] |= 0x80 // MASK + // Should not error. + this[kDestroy](err).then(() => { + queueMicrotask(onDestroyed) + }) + } - // mask body - for (let i = 0; i < bodyLength; i++) { - buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4] + [kInterceptedDispatch] (opts, handler) { + if (!this[kInterceptors] || this[kInterceptors].length === 0) { + this[kInterceptedDispatch] = this[kDispatch] + return this[kDispatch](opts, handler) } - return buffer + let dispatch = this[kDispatch].bind(this) + for (let i = this[kInterceptors].length - 1; i >= 0; i--) { + dispatch = this[kInterceptors][i](dispatch) + } + this[kInterceptedDispatch] = dispatch + return dispatch(opts, handler) } -} -module.exports = { - WebsocketFrameSend -} + dispatch (opts, handler) { + if (!handler || typeof handler !== 'object') { + throw new InvalidArgumentError('handler must be an object') + } + + try { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('opts must be an object.') + } + if (this[kDestroyed] || this[kOnDestroyed]) { + throw new ClientDestroyedError() + } -/***/ }), + if (this[kClosed]) { + throw new ClientClosedError() + } -/***/ 59808: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + return this[kInterceptedDispatch](opts, handler) + } catch (err) { + if (typeof handler.onError !== 'function') { + throw new InvalidArgumentError('invalid onError method') + } + handler.onError(err) + return false + } + } +} -const { Writable } = __nccwpck_require__(12781) -const diagnosticsChannel = __nccwpck_require__(67643) -const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(6246) -const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(18099) -const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(72125) -const { WebsocketFrameSend } = __nccwpck_require__(15020) +module.exports = DispatcherBase -// This code was influenced by ws released under the MIT license. -// Copyright (c) 2011 Einar Otto Stangvik -// Copyright (c) 2013 Arnout Kazemier and contributors -// Copyright (c) 2016 Luigi Pinca and contributors -const channels = {} -channels.ping = diagnosticsChannel.channel('undici:websocket:ping') -channels.pong = diagnosticsChannel.channel('undici:websocket:pong') +/***/ }), -class ByteParser extends Writable { - #buffers = [] - #byteOffset = 0 +/***/ 13624: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - #state = parserStates.INFO - #info = {} - #fragments = [] - constructor (ws) { - super() +const EventEmitter = __nccwpck_require__(82361) - this.ws = ws +class Dispatcher extends EventEmitter { + dispatch () { + throw new Error('not implemented') } - /** - * @param {Buffer} chunk - * @param {() => void} callback - */ - _write (chunk, _, callback) { - this.#buffers.push(chunk) - this.#byteOffset += chunk.length + close () { + throw new Error('not implemented') + } - this.run(callback) + destroy () { + throw new Error('not implemented') } +} - /** - * Runs whenever a new chunk is received. - * Callback is called whenever there are no more chunks buffering, - * or not enough bytes are buffered to parse. - */ - run (callback) { - while (true) { - if (this.#state === parserStates.INFO) { - // If there aren't enough bytes to parse the payload length, etc. - if (this.#byteOffset < 2) { - return callback() - } +module.exports = Dispatcher - const buffer = this.consume(2) - this.#info.fin = (buffer[0] & 0x80) !== 0 - this.#info.opcode = buffer[0] & 0x0F +/***/ }), - // If we receive a fragmented message, we use the type of the first - // frame to parse the full message as binary/text, when it's terminated - this.#info.originalOpcode ??= this.#info.opcode +/***/ 42173: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION - if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) { - // Only text and binary frames can be fragmented - failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.') - return - } - const payloadLength = buffer[1] & 0x7F +const Busboy = __nccwpck_require__(74487) +const util = __nccwpck_require__(43061) +const { + ReadableStreamFrom, + isBlobLike, + isReadableStreamLike, + readableStreamClose, + createDeferredPromise, + fullyReadBody +} = __nccwpck_require__(47794) +const { FormData } = __nccwpck_require__(12787) +const { kState } = __nccwpck_require__(10730) +const { webidl } = __nccwpck_require__(7000) +const { DOMException, structuredClone } = __nccwpck_require__(20075) +const { Blob, File: NativeFile } = __nccwpck_require__(14300) +const { kBodyUsed } = __nccwpck_require__(69898) +const assert = __nccwpck_require__(39491) +const { isErrored } = __nccwpck_require__(43061) +const { isUint8Array, isArrayBuffer } = __nccwpck_require__(29830) +const { File: UndiciFile } = __nccwpck_require__(99698) +const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(16306) - if (payloadLength <= 125) { - this.#info.payloadLength = payloadLength - this.#state = parserStates.READ_DATA - } else if (payloadLength === 126) { - this.#state = parserStates.PAYLOADLENGTH_16 - } else if (payloadLength === 127) { - this.#state = parserStates.PAYLOADLENGTH_64 - } +let ReadableStream = globalThis.ReadableStream - if (this.#info.fragmented && payloadLength > 125) { - // A fragmented frame can't be fragmented itself - failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.') - return - } else if ( - (this.#info.opcode === opcodes.PING || - this.#info.opcode === opcodes.PONG || - this.#info.opcode === opcodes.CLOSE) && - payloadLength > 125 - ) { - // Control frames can have a payload length of 125 bytes MAX - failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.') - return - } else if (this.#info.opcode === opcodes.CLOSE) { - if (payloadLength === 1) { - failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.') - return - } +/** @type {globalThis['File']} */ +const File = NativeFile ?? UndiciFile +const textEncoder = new TextEncoder() +const textDecoder = new TextDecoder() - const body = this.consume(payloadLength) +// https://fetch.spec.whatwg.org/#concept-bodyinit-extract +function extractBody (object, keepalive = false) { + if (!ReadableStream) { + ReadableStream = (__nccwpck_require__(35356).ReadableStream) + } - this.#info.closeInfo = this.parseCloseBody(false, body) + // 1. Let stream be null. + let stream = null - if (!this.ws[kSentClose]) { - // If an endpoint receives a Close frame and did not previously send a - // Close frame, the endpoint MUST send a Close frame in response. (When - // sending a Close frame in response, the endpoint typically echos the - // status code it received.) - const body = Buffer.allocUnsafe(2) - body.writeUInt16BE(this.#info.closeInfo.code, 0) - const closeFrame = new WebsocketFrameSend(body) + // 2. If object is a ReadableStream object, then set stream to object. + if (object instanceof ReadableStream) { + stream = object + } else if (isBlobLike(object)) { + // 3. Otherwise, if object is a Blob object, set stream to the + // result of running object’s get stream. + stream = object.stream() + } else { + // 4. Otherwise, set stream to a new ReadableStream object, and set + // up stream. + stream = new ReadableStream({ + async pull (controller) { + controller.enqueue( + typeof source === 'string' ? textEncoder.encode(source) : source + ) + queueMicrotask(() => readableStreamClose(controller)) + }, + start () {}, + type: undefined + }) + } - this.ws[kResponse].socket.write( - closeFrame.createFrame(opcodes.CLOSE), - (err) => { - if (!err) { - this.ws[kSentClose] = true - } - } - ) - } + // 5. Assert: stream is a ReadableStream object. + assert(isReadableStreamLike(stream)) - // Upon either sending or receiving a Close control frame, it is said - // that _The WebSocket Closing Handshake is Started_ and that the - // WebSocket connection is in the CLOSING state. - this.ws[kReadyState] = states.CLOSING - this.ws[kReceivedClose] = true + // 6. Let action be null. + let action = null - this.end() + // 7. Let source be null. + let source = null - return - } else if (this.#info.opcode === opcodes.PING) { - // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in - // response, unless it already received a Close frame. - // A Pong frame sent in response to a Ping frame must have identical - // "Application data" + // 8. Let length be null. + let length = null - const body = this.consume(payloadLength) + // 9. Let type be null. + let type = null - if (!this.ws[kReceivedClose]) { - const frame = new WebsocketFrameSend(body) + // 10. Switch on object: + if (typeof object === 'string') { + // Set source to the UTF-8 encoding of object. + // Note: setting source to a Uint8Array here breaks some mocking assumptions. + source = object - this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG)) + // Set type to `text/plain;charset=UTF-8`. + type = 'text/plain;charset=UTF-8' + } else if (object instanceof URLSearchParams) { + // URLSearchParams - if (channels.ping.hasSubscribers) { - channels.ping.publish({ - payload: body - }) - } - } + // spec says to run application/x-www-form-urlencoded on body.list + // this is implemented in Node.js as apart of an URLSearchParams instance toString method + // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490 + // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100 - this.#state = parserStates.INFO + // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list. + source = object.toString() - if (this.#byteOffset > 0) { - continue - } else { - callback() - return - } - } else if (this.#info.opcode === opcodes.PONG) { - // A Pong frame MAY be sent unsolicited. This serves as a - // unidirectional heartbeat. A response to an unsolicited Pong frame is - // not expected. + // Set type to `application/x-www-form-urlencoded;charset=UTF-8`. + type = 'application/x-www-form-urlencoded;charset=UTF-8' + } else if (isArrayBuffer(object)) { + // BufferSource/ArrayBuffer - const body = this.consume(payloadLength) + // Set source to a copy of the bytes held by object. + source = new Uint8Array(object.slice()) + } else if (ArrayBuffer.isView(object)) { + // BufferSource/ArrayBufferView - if (channels.pong.hasSubscribers) { - channels.pong.publish({ - payload: body - }) - } + // Set source to a copy of the bytes held by object. + source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength)) + } else if (util.isFormDataLike(object)) { + const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}` + const prefix = `--${boundary}\r\nContent-Disposition: form-data` - if (this.#byteOffset > 0) { - continue - } else { - callback() - return - } - } - } else if (this.#state === parserStates.PAYLOADLENGTH_16) { - if (this.#byteOffset < 2) { - return callback() - } + /*! formdata-polyfill. MIT License. Jimmy Wärting */ + const escape = (str) => + str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22') + const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n') - const buffer = this.consume(2) + // Set action to this step: run the multipart/form-data + // encoding algorithm, with object’s entry list and UTF-8. + // - This ensures that the body is immutable and can't be changed afterwords + // - That the content-length is calculated in advance. + // - And that all parts are pre-encoded and ready to be sent. - this.#info.payloadLength = buffer.readUInt16BE(0) - this.#state = parserStates.READ_DATA - } else if (this.#state === parserStates.PAYLOADLENGTH_64) { - if (this.#byteOffset < 8) { - return callback() + const blobParts = [] + const rn = new Uint8Array([13, 10]) // '\r\n' + length = 0 + let hasUnknownSizeValue = false + + for (const [name, value] of object) { + if (typeof value === 'string') { + const chunk = textEncoder.encode(prefix + + `; name="${escape(normalizeLinefeeds(name))}"` + + `\r\n\r\n${normalizeLinefeeds(value)}\r\n`) + blobParts.push(chunk) + length += chunk.byteLength + } else { + const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` + + (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' + + `Content-Type: ${ + value.type || 'application/octet-stream' + }\r\n\r\n`) + blobParts.push(chunk, value, rn) + if (typeof value.size === 'number') { + length += chunk.byteLength + value.size + rn.byteLength + } else { + hasUnknownSizeValue = true } + } + } - const buffer = this.consume(8) - const upper = buffer.readUInt32BE(0) + const chunk = textEncoder.encode(`--${boundary}--`) + blobParts.push(chunk) + length += chunk.byteLength + if (hasUnknownSizeValue) { + length = null + } - // 2^31 is the maxinimum bytes an arraybuffer can contain - // on 32-bit systems. Although, on 64-bit systems, this is - // 2^53-1 bytes. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length - // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275 - // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e - if (upper > 2 ** 31 - 1) { - failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.') - return + // Set source to object. + source = object + + action = async function * () { + for (const part of blobParts) { + if (part.stream) { + yield * part.stream() + } else { + yield part } + } + } - const lower = buffer.readUInt32BE(4) + // Set type to `multipart/form-data; boundary=`, + // followed by the multipart/form-data boundary string generated + // by the multipart/form-data encoding algorithm. + type = 'multipart/form-data; boundary=' + boundary + } else if (isBlobLike(object)) { + // Blob - this.#info.payloadLength = (upper << 8) + lower - this.#state = parserStates.READ_DATA - } else if (this.#state === parserStates.READ_DATA) { - if (this.#byteOffset < this.#info.payloadLength) { - // If there is still more data in this chunk that needs to be read - return callback() - } else if (this.#byteOffset >= this.#info.payloadLength) { - // If the server sent multiple frames in a single chunk + // Set source to object. + source = object - const body = this.consume(this.#info.payloadLength) + // Set length to object’s size. + length = object.size - this.#fragments.push(body) + // If object’s type attribute is not the empty byte sequence, set + // type to its value. + if (object.type) { + type = object.type + } + } else if (typeof object[Symbol.asyncIterator] === 'function') { + // If keepalive is true, then throw a TypeError. + if (keepalive) { + throw new TypeError('keepalive') + } - // If the frame is unfragmented, or a fragmented frame was terminated, - // a message was received - if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) { - const fullMessage = Buffer.concat(this.#fragments) + // If object is disturbed or locked, then throw a TypeError. + if (util.isDisturbed(object) || object.locked) { + throw new TypeError( + 'Response body object should not be disturbed or locked' + ) + } - websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage) + stream = + object instanceof ReadableStream ? object : ReadableStreamFrom(object) + } - this.#info = {} - this.#fragments.length = 0 - } + // 11. If source is a byte sequence, then set action to a + // step that returns source and length to source’s length. + if (typeof source === 'string' || util.isBuffer(source)) { + length = Buffer.byteLength(source) + } - this.#state = parserStates.INFO + // 12. If action is non-null, then run these steps in in parallel: + if (action != null) { + // Run action. + let iterator + stream = new ReadableStream({ + async start () { + iterator = action(object)[Symbol.asyncIterator]() + }, + async pull (controller) { + const { value, done } = await iterator.next() + if (done) { + // When running action is done, close stream. + queueMicrotask(() => { + controller.close() + }) + } else { + // Whenever one or more bytes are available and stream is not errored, + // enqueue a Uint8Array wrapping an ArrayBuffer containing the available + // bytes into stream. + if (!isErrored(stream)) { + controller.enqueue(new Uint8Array(value)) + } } - } - - if (this.#byteOffset > 0) { - continue - } else { - callback() - break - } - } + return controller.desiredSize > 0 + }, + async cancel (reason) { + await iterator.return() + }, + type: undefined + }) } - /** - * Take n bytes from the buffered Buffers - * @param {number} n - * @returns {Buffer|null} - */ - consume (n) { - if (n > this.#byteOffset) { - return null - } else if (n === 0) { - return emptyBuffer - } + // 13. Let body be a body whose stream is stream, source is source, + // and length is length. + const body = { stream, source, length } - if (this.#buffers[0].length === n) { - this.#byteOffset -= this.#buffers[0].length - return this.#buffers.shift() - } + // 14. Return (body, type). + return [body, type] +} - const buffer = Buffer.allocUnsafe(n) - let offset = 0 +// https://fetch.spec.whatwg.org/#bodyinit-safely-extract +function safelyExtractBody (object, keepalive = false) { + if (!ReadableStream) { + // istanbul ignore next + ReadableStream = (__nccwpck_require__(35356).ReadableStream) + } - while (offset !== n) { - const next = this.#buffers[0] - const { length } = next + // To safely extract a body and a `Content-Type` value from + // a byte sequence or BodyInit object object, run these steps: - if (length + offset === n) { - buffer.set(this.#buffers.shift(), offset) - break - } else if (length + offset > n) { - buffer.set(next.subarray(0, n - offset), offset) - this.#buffers[0] = next.subarray(n - offset) - break - } else { - buffer.set(this.#buffers.shift(), offset) - offset += next.length - } - } + // 1. If object is a ReadableStream object, then: + if (object instanceof ReadableStream) { + // Assert: object is neither disturbed nor locked. + // istanbul ignore next + assert(!util.isDisturbed(object), 'The body has already been consumed.') + // istanbul ignore next + assert(!object.locked, 'The stream is locked.') + } - this.#byteOffset -= n + // 2. Return the results of extracting object. + return extractBody(object, keepalive) +} - return buffer - } +function cloneBody (body) { + // To clone a body body, run these steps: - parseCloseBody (onlyCode, data) { - // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5 - /** @type {number|undefined} */ - let code + // https://fetch.spec.whatwg.org/#concept-body-clone - if (data.length >= 2) { - // _The WebSocket Connection Close Code_ is - // defined as the status code (Section 7.4) contained in the first Close - // control frame received by the application - code = data.readUInt16BE(0) - } + // 1. Let « out1, out2 » be the result of teeing body’s stream. + const [out1, out2] = body.stream.tee() + const out2Clone = structuredClone(out2, { transfer: [out2] }) + // This, for whatever reasons, unrefs out2Clone which allows + // the process to exit by itself. + const [, finalClone] = out2Clone.tee() - if (onlyCode) { - if (!isValidStatusCode(code)) { - return null - } + // 2. Set body’s stream to out1. + body.stream = out1 - return { code } - } + // 3. Return a body whose stream is out2 and other members are copied from body. + return { + stream: finalClone, + length: body.length, + source: body.source + } +} - // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6 - /** @type {Buffer} */ - let reason = data.subarray(2) +async function * consumeBody (body) { + if (body) { + if (isUint8Array(body)) { + yield body + } else { + const stream = body.stream - // Remove BOM - if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) { - reason = reason.subarray(3) - } + if (util.isDisturbed(stream)) { + throw new TypeError('The body has already been consumed.') + } - if (code !== undefined && !isValidStatusCode(code)) { - return null - } + if (stream.locked) { + throw new TypeError('The stream is locked.') + } - try { - // TODO: optimize this - reason = new TextDecoder('utf-8', { fatal: true }).decode(reason) - } catch { - return null - } + // Compat. + stream[kBodyUsed] = true - return { code, reason } + yield * stream + } } +} - get closingInfo () { - return this.#info.closeInfo +function throwIfAborted (state) { + if (state.aborted) { + throw new DOMException('The operation was aborted.', 'AbortError') } } -module.exports = { - ByteParser -} +function bodyMixinMethods (instance) { + const methods = { + blob () { + // The blob() method steps are to return the result of + // running consume body with this and the following step + // given a byte sequence bytes: return a Blob whose + // contents are bytes and whose type attribute is this’s + // MIME type. + return specConsumeBody(this, (bytes) => { + let mimeType = bodyMimeType(this) + if (mimeType === 'failure') { + mimeType = '' + } else if (mimeType) { + mimeType = serializeAMimeType(mimeType) + } -/***/ }), + // Return a Blob whose contents are bytes and type attribute + // is mimeType. + return new Blob([bytes], { type: mimeType }) + }, instance) + }, -/***/ 18099: -/***/ ((module) => { + arrayBuffer () { + // The arrayBuffer() method steps are to return the result + // of running consume body with this and the following step + // given a byte sequence bytes: return a new ArrayBuffer + // whose contents are bytes. + return specConsumeBody(this, (bytes) => { + return new Uint8Array(bytes).buffer + }, instance) + }, + text () { + // The text() method steps are to return the result of running + // consume body with this and UTF-8 decode. + return specConsumeBody(this, utf8DecodeBytes, instance) + }, + json () { + // The json() method steps are to return the result of running + // consume body with this and parse JSON from bytes. + return specConsumeBody(this, parseJSONFromBytes, instance) + }, -module.exports = { - kWebSocketURL: Symbol('url'), - kReadyState: Symbol('ready state'), - kController: Symbol('controller'), - kResponse: Symbol('response'), - kBinaryType: Symbol('binary type'), - kSentClose: Symbol('sent close'), - kReceivedClose: Symbol('received close'), - kByteParser: Symbol('byte parser') -} + async formData () { + webidl.brandCheck(this, instance) + throwIfAborted(this[kState]) -/***/ }), + const contentType = this.headers.get('Content-Type') -/***/ 72125: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // If mimeType’s essence is "multipart/form-data", then: + if (/multipart\/form-data/.test(contentType)) { + const headers = {} + for (const [key, value] of this.headers) headers[key.toLowerCase()] = value + + const responseFormData = new FormData() + let busboy + try { + busboy = new Busboy({ + headers, + preservePath: true + }) + } catch (err) { + throw new DOMException(`${err}`, 'AbortError') + } -const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(18099) -const { states, opcodes } = __nccwpck_require__(6246) -const { MessageEvent, ErrorEvent } = __nccwpck_require__(28381) + busboy.on('field', (name, value) => { + responseFormData.append(name, value) + }) + busboy.on('file', (name, value, filename, encoding, mimeType) => { + const chunks = [] -/* globals Blob */ + if (encoding === 'base64' || encoding.toLowerCase() === 'base64') { + let base64chunk = '' -/** - * @param {import('./websocket').WebSocket} ws - */ -function isEstablished (ws) { - // If the server's response is validated as provided for above, it is - // said that _The WebSocket Connection is Established_ and that the - // WebSocket Connection is in the OPEN state. - return ws[kReadyState] === states.OPEN -} + value.on('data', (chunk) => { + base64chunk += chunk.toString().replace(/[\r\n]/gm, '') -/** - * @param {import('./websocket').WebSocket} ws - */ -function isClosing (ws) { - // Upon either sending or receiving a Close control frame, it is said - // that _The WebSocket Closing Handshake is Started_ and that the - // WebSocket connection is in the CLOSING state. - return ws[kReadyState] === states.CLOSING -} + const end = base64chunk.length - base64chunk.length % 4 + chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64')) -/** - * @param {import('./websocket').WebSocket} ws - */ -function isClosed (ws) { - return ws[kReadyState] === states.CLOSED -} + base64chunk = base64chunk.slice(end) + }) + value.on('end', () => { + chunks.push(Buffer.from(base64chunk, 'base64')) + responseFormData.append(name, new File(chunks, filename, { type: mimeType })) + }) + } else { + value.on('data', (chunk) => { + chunks.push(chunk) + }) + value.on('end', () => { + responseFormData.append(name, new File(chunks, filename, { type: mimeType })) + }) + } + }) -/** - * @see https://dom.spec.whatwg.org/#concept-event-fire - * @param {string} e - * @param {EventTarget} target - * @param {EventInit | undefined} eventInitDict - */ -function fireEvent (e, target, eventConstructor = Event, eventInitDict) { - // 1. If eventConstructor is not given, then let eventConstructor be Event. + const busboyResolve = new Promise((resolve, reject) => { + busboy.on('finish', resolve) + busboy.on('error', (err) => reject(new TypeError(err))) + }) - // 2. Let event be the result of creating an event given eventConstructor, - // in the relevant realm of target. - // 3. Initialize event’s type attribute to e. - const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap + if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk) + busboy.end() + await busboyResolve - // 4. Initialize any other IDL attributes of event as described in the - // invocation of this algorithm. + return responseFormData + } else if (/application\/x-www-form-urlencoded/.test(contentType)) { + // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then: - // 5. Return the result of dispatching event at target, with legacy target - // override flag set if set. - target.dispatchEvent(event) -} + // 1. Let entries be the result of parsing bytes. + let entries + try { + let text = '' + // application/x-www-form-urlencoded parser will keep the BOM. + // https://url.spec.whatwg.org/#concept-urlencoded-parser + // Note that streaming decoder is stateful and cannot be reused + const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true }) -/** - * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol - * @param {import('./websocket').WebSocket} ws - * @param {number} type Opcode - * @param {Buffer} data application data - */ -function websocketMessageReceived (ws, type, data) { - // 1. If ready state is not OPEN (1), then return. - if (ws[kReadyState] !== states.OPEN) { - return - } + for await (const chunk of consumeBody(this[kState].body)) { + if (!isUint8Array(chunk)) { + throw new TypeError('Expected Uint8Array chunk') + } + text += streamingDecoder.decode(chunk, { stream: true }) + } + text += streamingDecoder.decode() + entries = new URLSearchParams(text) + } catch (err) { + // istanbul ignore next: Unclear when new URLSearchParams can fail on a string. + // 2. If entries is failure, then throw a TypeError. + throw Object.assign(new TypeError(), { cause: err }) + } - // 2. Let dataForEvent be determined by switching on type and binary type: - let dataForEvent + // 3. Return a new FormData object whose entries are entries. + const formData = new FormData() + for (const [name, value] of entries) { + formData.append(name, value) + } + return formData + } else { + // Wait a tick before checking if the request has been aborted. + // Otherwise, a TypeError can be thrown when an AbortError should. + await Promise.resolve() - if (type === opcodes.TEXT) { - // -> type indicates that the data is Text - // a new DOMString containing data - try { - dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data) - } catch { - failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.') - return - } - } else if (type === opcodes.BINARY) { - if (ws[kBinaryType] === 'blob') { - // -> type indicates that the data is Binary and binary type is "blob" - // a new Blob object, created in the relevant Realm of the WebSocket - // object, that represents data as its raw data - dataForEvent = new Blob([data]) - } else { - // -> type indicates that the data is Binary and binary type is "arraybuffer" - // a new ArrayBuffer object, created in the relevant Realm of the - // WebSocket object, whose contents are data - dataForEvent = new Uint8Array(data).buffer + throwIfAborted(this[kState]) + + // Otherwise, throw a TypeError. + throw webidl.errors.exception({ + header: `${instance.name}.formData`, + message: 'Could not parse content as FormData.' + }) + } } } - // 3. Fire an event named message at the WebSocket object, using MessageEvent, - // with the origin attribute initialized to the serialization of the WebSocket - // object’s url's origin, and the data attribute initialized to dataForEvent. - fireEvent('message', ws, MessageEvent, { - origin: ws[kWebSocketURL].origin, - data: dataForEvent - }) + return methods +} + +function mixinBody (prototype) { + Object.assign(prototype.prototype, bodyMixinMethods(prototype)) } /** - * @see https://datatracker.ietf.org/doc/html/rfc6455 - * @see https://datatracker.ietf.org/doc/html/rfc2616 - * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407 - * @param {string} protocol + * @see https://fetch.spec.whatwg.org/#concept-body-consume-body + * @param {Response|Request} object + * @param {(value: unknown) => unknown} convertBytesToJSValue + * @param {Response|Request} instance */ -function isValidSubprotocol (protocol) { - // If present, this value indicates one - // or more comma-separated subprotocol the client wishes to speak, - // ordered by preference. The elements that comprise this value - // MUST be non-empty strings with characters in the range U+0021 to - // U+007E not including separator characters as defined in - // [RFC2616] and MUST all be unique strings. - if (protocol.length === 0) { - return false +async function specConsumeBody (object, convertBytesToJSValue, instance) { + webidl.brandCheck(object, instance) + + throwIfAborted(object[kState]) + + // 1. If object is unusable, then return a promise rejected + // with a TypeError. + if (bodyUnusable(object[kState].body)) { + throw new TypeError('Body is unusable') } - for (const char of protocol) { - const code = char.charCodeAt(0) + // 2. Let promise be a new promise. + const promise = createDeferredPromise() - if ( - code < 0x21 || - code > 0x7E || - char === '(' || - char === ')' || - char === '<' || - char === '>' || - char === '@' || - char === ',' || - char === ';' || - char === ':' || - char === '\\' || - char === '"' || - char === '/' || - char === '[' || - char === ']' || - char === '?' || - char === '=' || - char === '{' || - char === '}' || - code === 32 || // SP - code === 9 // HT - ) { - return false + // 3. Let errorSteps given error be to reject promise with error. + const errorSteps = (error) => promise.reject(error) + + // 4. Let successSteps given a byte sequence data be to resolve + // promise with the result of running convertBytesToJSValue + // with data. If that threw an exception, then run errorSteps + // with that exception. + const successSteps = (data) => { + try { + promise.resolve(convertBytesToJSValue(data)) + } catch (e) { + errorSteps(e) } } - return true + // 5. If object’s body is null, then run successSteps with an + // empty byte sequence. + if (object[kState].body == null) { + successSteps(new Uint8Array()) + return promise.promise + } + + // 6. Otherwise, fully read object’s body given successSteps, + // errorSteps, and object’s relevant global object. + await fullyReadBody(object[kState].body, successSteps, errorSteps) + + // 7. Return promise. + return promise.promise +} + +// https://fetch.spec.whatwg.org/#body-unusable +function bodyUnusable (body) { + // An object including the Body interface mixin is + // said to be unusable if its body is non-null and + // its body’s stream is disturbed or locked. + return body != null && (body.stream.locked || util.isDisturbed(body.stream)) } /** - * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4 - * @param {number} code + * @see https://encoding.spec.whatwg.org/#utf-8-decode + * @param {Buffer} buffer */ -function isValidStatusCode (code) { - if (code >= 1000 && code < 1015) { - return ( - code !== 1004 && // reserved - code !== 1005 && // "MUST NOT be set as a status code" - code !== 1006 // "MUST NOT be set as a status code" - ) +function utf8DecodeBytes (buffer) { + if (buffer.length === 0) { + return '' } - return code >= 3000 && code <= 4999 + // 1. Let buffer be the result of peeking three bytes from + // ioQueue, converted to a byte sequence. + + // 2. If buffer is 0xEF 0xBB 0xBF, then read three + // bytes from ioQueue. (Do nothing with those bytes.) + if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) { + buffer = buffer.subarray(3) + } + + // 3. Process a queue with an instance of UTF-8’s + // decoder, ioQueue, output, and "replacement". + const output = textDecoder.decode(buffer) + + // 4. Return output. + return output } /** - * @param {import('./websocket').WebSocket} ws - * @param {string|undefined} reason + * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value + * @param {Uint8Array} bytes */ -function failWebsocketConnection (ws, reason) { - const { [kController]: controller, [kResponse]: response } = ws +function parseJSONFromBytes (bytes) { + return JSON.parse(utf8DecodeBytes(bytes)) +} - controller.abort() +/** + * @see https://fetch.spec.whatwg.org/#concept-body-mime-type + * @param {import('./response').Response|import('./request').Request} object + */ +function bodyMimeType (object) { + const { headersList } = object[kState] + const contentType = headersList.get('content-type') - if (response?.socket && !response.socket.destroyed) { - response.socket.destroy() + if (contentType === null) { + return 'failure' } - if (reason) { - fireEvent('error', ws, ErrorEvent, { - error: new Error(reason) - }) - } + return parseMIMEType(contentType) } module.exports = { - isEstablished, - isClosing, - isClosed, - fireEvent, - isValidSubprotocol, - isValidStatusCode, - failWebsocketConnection, - websocketMessageReceived + extractBody, + safelyExtractBody, + cloneBody, + mixinBody } /***/ }), -/***/ 53726: +/***/ 20075: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { webidl } = __nccwpck_require__(96138) -const { DOMException } = __nccwpck_require__(93541) -const { URLSerializer } = __nccwpck_require__(50096) -const { getGlobalOrigin } = __nccwpck_require__(64110) -const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(6246) -const { - kWebSocketURL, - kReadyState, - kController, - kBinaryType, - kResponse, - kSentClose, - kByteParser -} = __nccwpck_require__(18099) -const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(72125) -const { establishWebSocketConnection } = __nccwpck_require__(60337) -const { WebsocketFrameSend } = __nccwpck_require__(15020) -const { ByteParser } = __nccwpck_require__(59808) -const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(67468) -const { getGlobalDispatcher } = __nccwpck_require__(29102) -const { types } = __nccwpck_require__(73837) - -let experimentalWarned = false - -// https://websockets.spec.whatwg.org/#interface-definition -class WebSocket extends EventTarget { - #events = { - open: null, - error: null, - close: null, - message: null - } - - #bufferedAmount = 0 - #protocol = '' - #extensions = '' - - /** - * @param {string} url - * @param {string|string[]} protocols - */ - constructor (url, protocols = []) { - super() - - webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' }) - - if (!experimentalWarned) { - experimentalWarned = true - process.emitWarning('WebSockets are experimental, expect them to change at any time.', { - code: 'UNDICI-WS' - }) - } - - const options = webidl.converters['DOMString or sequence or WebSocketInit'](protocols) - - url = webidl.converters.USVString(url) - protocols = options.protocols - - // 1. Let baseURL be this's relevant settings object's API base URL. - const baseURL = getGlobalOrigin() +const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(71267) - // 1. Let urlRecord be the result of applying the URL parser to url with baseURL. - let urlRecord +const corsSafeListedMethods = ['GET', 'HEAD', 'POST'] +const corsSafeListedMethodsSet = new Set(corsSafeListedMethods) - try { - urlRecord = new URL(url, baseURL) - } catch (e) { - // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException. - throw new DOMException(e, 'SyntaxError') - } +const nullBodyStatus = [101, 204, 205, 304] - // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws". - if (urlRecord.protocol === 'http:') { - urlRecord.protocol = 'ws:' - } else if (urlRecord.protocol === 'https:') { - // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss". - urlRecord.protocol = 'wss:' - } +const redirectStatus = [301, 302, 303, 307, 308] +const redirectStatusSet = new Set(redirectStatus) - // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException. - if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') { - throw new DOMException( - `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`, - 'SyntaxError' - ) - } +// https://fetch.spec.whatwg.org/#block-bad-port +const badPorts = [ + '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79', + '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137', + '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532', + '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723', + '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697', + '10080' +] - // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError" - // DOMException. - if (urlRecord.hash || urlRecord.href.endsWith('#')) { - throw new DOMException('Got fragment', 'SyntaxError') - } +const badPortsSet = new Set(badPorts) - // 8. If protocols is a string, set protocols to a sequence consisting - // of just that string. - if (typeof protocols === 'string') { - protocols = [protocols] - } +// https://w3c.github.io/webappsec-referrer-policy/#referrer-policies +const referrerPolicy = [ + '', + 'no-referrer', + 'no-referrer-when-downgrade', + 'same-origin', + 'origin', + 'strict-origin', + 'origin-when-cross-origin', + 'strict-origin-when-cross-origin', + 'unsafe-url' +] +const referrerPolicySet = new Set(referrerPolicy) - // 9. If any of the values in protocols occur more than once or otherwise - // fail to match the requirements for elements that comprise the value - // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket - // protocol, then throw a "SyntaxError" DOMException. - if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) { - throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError') - } +const requestRedirect = ['follow', 'manual', 'error'] - if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) { - throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError') - } +const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE'] +const safeMethodsSet = new Set(safeMethods) - // 10. Set this's url to urlRecord. - this[kWebSocketURL] = new URL(urlRecord.href) +const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors'] - // 11. Let client be this's relevant settings object. +const requestCredentials = ['omit', 'same-origin', 'include'] - // 12. Run this step in parallel: +const requestCache = [ + 'default', + 'no-store', + 'reload', + 'no-cache', + 'force-cache', + 'only-if-cached' +] - // 1. Establish a WebSocket connection given urlRecord, protocols, - // and client. - this[kController] = establishWebSocketConnection( - urlRecord, - protocols, - this, - (response) => this.#onConnectionEstablished(response), - options - ) +// https://fetch.spec.whatwg.org/#request-body-header-name +const requestBodyHeader = [ + 'content-encoding', + 'content-language', + 'content-location', + 'content-type', + // See https://github.com/nodejs/undici/issues/2021 + // 'Content-Length' is a forbidden header name, which is typically + // removed in the Headers implementation. However, undici doesn't + // filter out headers, so we add it here. + 'content-length' +] - // Each WebSocket object has an associated ready state, which is a - // number representing the state of the connection. Initially it must - // be CONNECTING (0). - this[kReadyState] = WebSocket.CONNECTING +// https://fetch.spec.whatwg.org/#enumdef-requestduplex +const requestDuplex = [ + 'half' +] - // The extensions attribute must initially return the empty string. +// http://fetch.spec.whatwg.org/#forbidden-method +const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK'] +const forbiddenMethodsSet = new Set(forbiddenMethods) - // The protocol attribute must initially return the empty string. +const subresource = [ + 'audio', + 'audioworklet', + 'font', + 'image', + 'manifest', + 'paintworklet', + 'script', + 'style', + 'track', + 'video', + 'xslt', + '' +] +const subresourceSet = new Set(subresource) - // Each WebSocket object has an associated binary type, which is a - // BinaryType. Initially it must be "blob". - this[kBinaryType] = 'blob' +/** @type {globalThis['DOMException']} */ +const DOMException = globalThis.DOMException ?? (() => { + // DOMException was only made a global in Node v17.0.0, + // but fetch supports >= v16.8. + try { + atob('~') + } catch (err) { + return Object.getPrototypeOf(err).constructor } +})() - /** - * @see https://websockets.spec.whatwg.org/#dom-websocket-close - * @param {number|undefined} code - * @param {string|undefined} reason - */ - close (code = undefined, reason = undefined) { - webidl.brandCheck(this, WebSocket) - - if (code !== undefined) { - code = webidl.converters['unsigned short'](code, { clamp: true }) - } - - if (reason !== undefined) { - reason = webidl.converters.USVString(reason) - } +let channel - // 1. If code is present, but is neither an integer equal to 1000 nor an - // integer in the range 3000 to 4999, inclusive, throw an - // "InvalidAccessError" DOMException. - if (code !== undefined) { - if (code !== 1000 && (code < 3000 || code > 4999)) { - throw new DOMException('invalid code', 'InvalidAccessError') - } +/** @type {globalThis['structuredClone']} */ +const structuredClone = + globalThis.structuredClone ?? + // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js + // structuredClone was added in v17.0.0, but fetch supports v16.8 + function structuredClone (value, options = undefined) { + if (arguments.length === 0) { + throw new TypeError('missing argument') } - let reasonByteLength = 0 - - // 2. If reason is present, then run these substeps: - if (reason !== undefined) { - // 1. Let reasonBytes be the result of encoding reason. - // 2. If reasonBytes is longer than 123 bytes, then throw a - // "SyntaxError" DOMException. - reasonByteLength = Buffer.byteLength(reason) - - if (reasonByteLength > 123) { - throw new DOMException( - `Reason must be less than 123 bytes; received ${reasonByteLength}`, - 'SyntaxError' - ) - } + if (!channel) { + channel = new MessageChannel() } + channel.port1.unref() + channel.port2.unref() + channel.port1.postMessage(value, options?.transfer) + return receiveMessageOnPort(channel.port2).message + } - // 3. Run the first matching steps from the following list: - if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) { - // If this's ready state is CLOSING (2) or CLOSED (3) - // Do nothing. - } else if (!isEstablished(this)) { - // If the WebSocket connection is not yet established - // Fail the WebSocket connection and set this's ready state - // to CLOSING (2). - failWebsocketConnection(this, 'Connection was closed before it was established.') - this[kReadyState] = WebSocket.CLOSING - } else if (!isClosing(this)) { - // If the WebSocket closing handshake has not yet been started - // Start the WebSocket closing handshake and set this's ready - // state to CLOSING (2). - // - If neither code nor reason is present, the WebSocket Close - // message must not have a body. - // - If code is present, then the status code to use in the - // WebSocket Close message must be the integer given by code. - // - If reason is also present, then reasonBytes must be - // provided in the Close message after the status code. - - const frame = new WebsocketFrameSend() - - // If neither code nor reason is present, the WebSocket Close - // message must not have a body. - - // If code is present, then the status code to use in the - // WebSocket Close message must be the integer given by code. - if (code !== undefined && reason === undefined) { - frame.frameData = Buffer.allocUnsafe(2) - frame.frameData.writeUInt16BE(code, 0) - } else if (code !== undefined && reason !== undefined) { - // If reason is also present, then reasonBytes must be - // provided in the Close message after the status code. - frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength) - frame.frameData.writeUInt16BE(code, 0) - // the body MAY contain UTF-8-encoded data with value /reason/ - frame.frameData.write(reason, 2, 'utf-8') - } else { - frame.frameData = emptyBuffer - } - - /** @type {import('stream').Duplex} */ - const socket = this[kResponse].socket - - socket.write(frame.createFrame(opcodes.CLOSE), (err) => { - if (!err) { - this[kSentClose] = true - } - }) +module.exports = { + DOMException, + structuredClone, + subresource, + forbiddenMethods, + requestBodyHeader, + referrerPolicy, + requestRedirect, + requestMode, + requestCredentials, + requestCache, + redirectStatus, + corsSafeListedMethods, + nullBodyStatus, + safeMethods, + badPorts, + requestDuplex, + subresourceSet, + badPortsSet, + redirectStatusSet, + corsSafeListedMethodsSet, + safeMethodsSet, + forbiddenMethodsSet, + referrerPolicySet +} - // Upon either sending or receiving a Close control frame, it is said - // that _The WebSocket Closing Handshake is Started_ and that the - // WebSocket connection is in the CLOSING state. - this[kReadyState] = states.CLOSING - } else { - // Otherwise - // Set this's ready state to CLOSING (2). - this[kReadyState] = WebSocket.CLOSING - } - } - /** - * @see https://websockets.spec.whatwg.org/#dom-websocket-send - * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data - */ - send (data) { - webidl.brandCheck(this, WebSocket) +/***/ }), - webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' }) +/***/ 16306: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - data = webidl.converters.WebSocketSendData(data) +const assert = __nccwpck_require__(39491) +const { atob } = __nccwpck_require__(14300) +const { isomorphicDecode } = __nccwpck_require__(47794) - // 1. If this's ready state is CONNECTING, then throw an - // "InvalidStateError" DOMException. - if (this[kReadyState] === WebSocket.CONNECTING) { - throw new DOMException('Sent before connected.', 'InvalidStateError') - } +const encoder = new TextEncoder() - // 2. Run the appropriate set of steps from the following list: - // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1 - // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2 +/** + * @see https://mimesniff.spec.whatwg.org/#http-token-code-point + */ +const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/ +const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line +/** + * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point + */ +const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line - if (!isEstablished(this) || isClosing(this)) { - return - } +// https://fetch.spec.whatwg.org/#data-url-processor +/** @param {URL} dataURL */ +function dataURLProcessor (dataURL) { + // 1. Assert: dataURL’s scheme is "data". + assert(dataURL.protocol === 'data:') - /** @type {import('stream').Duplex} */ - const socket = this[kResponse].socket + // 2. Let input be the result of running the URL + // serializer on dataURL with exclude fragment + // set to true. + let input = URLSerializer(dataURL, true) - // If data is a string - if (typeof data === 'string') { - // If the WebSocket connection is established and the WebSocket - // closing handshake has not yet started, then the user agent - // must send a WebSocket Message comprised of the data argument - // using a text frame opcode; if the data cannot be sent, e.g. - // because it would need to be buffered but the buffer is full, - // the user agent must flag the WebSocket as full and then close - // the WebSocket connection. Any invocation of this method with a - // string argument that does not throw an exception must increase - // the bufferedAmount attribute by the number of bytes needed to - // express the argument as UTF-8. + // 3. Remove the leading "data:" string from input. + input = input.slice(5) - const value = Buffer.from(data) - const frame = new WebsocketFrameSend(value) - const buffer = frame.createFrame(opcodes.TEXT) + // 4. Let position point at the start of input. + const position = { position: 0 } - this.#bufferedAmount += value.byteLength - socket.write(buffer, () => { - this.#bufferedAmount -= value.byteLength - }) - } else if (types.isArrayBuffer(data)) { - // If the WebSocket connection is established, and the WebSocket - // closing handshake has not yet started, then the user agent must - // send a WebSocket Message comprised of data using a binary frame - // opcode; if the data cannot be sent, e.g. because it would need - // to be buffered but the buffer is full, the user agent must flag - // the WebSocket as full and then close the WebSocket connection. - // The data to be sent is the data stored in the buffer described - // by the ArrayBuffer object. Any invocation of this method with an - // ArrayBuffer argument that does not throw an exception must - // increase the bufferedAmount attribute by the length of the - // ArrayBuffer in bytes. + // 5. Let mimeType be the result of collecting a + // sequence of code points that are not equal + // to U+002C (,), given position. + let mimeType = collectASequenceOfCodePointsFast( + ',', + input, + position + ) - const value = Buffer.from(data) - const frame = new WebsocketFrameSend(value) - const buffer = frame.createFrame(opcodes.BINARY) + // 6. Strip leading and trailing ASCII whitespace + // from mimeType. + // Undici implementation note: we need to store the + // length because if the mimetype has spaces removed, + // the wrong amount will be sliced from the input in + // step #9 + const mimeTypeLength = mimeType.length + mimeType = removeASCIIWhitespace(mimeType, true, true) - this.#bufferedAmount += value.byteLength - socket.write(buffer, () => { - this.#bufferedAmount -= value.byteLength - }) - } else if (ArrayBuffer.isView(data)) { - // If the WebSocket connection is established, and the WebSocket - // closing handshake has not yet started, then the user agent must - // send a WebSocket Message comprised of data using a binary frame - // opcode; if the data cannot be sent, e.g. because it would need to - // be buffered but the buffer is full, the user agent must flag the - // WebSocket as full and then close the WebSocket connection. The - // data to be sent is the data stored in the section of the buffer - // described by the ArrayBuffer object that data references. Any - // invocation of this method with this kind of argument that does - // not throw an exception must increase the bufferedAmount attribute - // by the length of data’s buffer in bytes. + // 7. If position is past the end of input, then + // return failure + if (position.position >= input.length) { + return 'failure' + } - const ab = Buffer.from(data, data.byteOffset, data.byteLength) + // 8. Advance position by 1. + position.position++ - const frame = new WebsocketFrameSend(ab) - const buffer = frame.createFrame(opcodes.BINARY) + // 9. Let encodedBody be the remainder of input. + const encodedBody = input.slice(mimeTypeLength + 1) - this.#bufferedAmount += ab.byteLength - socket.write(buffer, () => { - this.#bufferedAmount -= ab.byteLength - }) - } else if (isBlobLike(data)) { - // If the WebSocket connection is established, and the WebSocket - // closing handshake has not yet started, then the user agent must - // send a WebSocket Message comprised of data using a binary frame - // opcode; if the data cannot be sent, e.g. because it would need to - // be buffered but the buffer is full, the user agent must flag the - // WebSocket as full and then close the WebSocket connection. The data - // to be sent is the raw data represented by the Blob object. Any - // invocation of this method with a Blob argument that does not throw - // an exception must increase the bufferedAmount attribute by the size - // of the Blob object’s raw data, in bytes. + // 10. Let body be the percent-decoding of encodedBody. + let body = stringPercentDecode(encodedBody) - const frame = new WebsocketFrameSend() + // 11. If mimeType ends with U+003B (;), followed by + // zero or more U+0020 SPACE, followed by an ASCII + // case-insensitive match for "base64", then: + if (/;(\u0020){0,}base64$/i.test(mimeType)) { + // 1. Let stringBody be the isomorphic decode of body. + const stringBody = isomorphicDecode(body) - data.arrayBuffer().then((ab) => { - const value = Buffer.from(ab) - frame.frameData = value - const buffer = frame.createFrame(opcodes.BINARY) + // 2. Set body to the forgiving-base64 decode of + // stringBody. + body = forgivingBase64(stringBody) - this.#bufferedAmount += value.byteLength - socket.write(buffer, () => { - this.#bufferedAmount -= value.byteLength - }) - }) + // 3. If body is failure, then return failure. + if (body === 'failure') { + return 'failure' } - } - - get readyState () { - webidl.brandCheck(this, WebSocket) - // The readyState getter steps are to return this's ready state. - return this[kReadyState] - } + // 4. Remove the last 6 code points from mimeType. + mimeType = mimeType.slice(0, -6) - get bufferedAmount () { - webidl.brandCheck(this, WebSocket) + // 5. Remove trailing U+0020 SPACE code points from mimeType, + // if any. + mimeType = mimeType.replace(/(\u0020)+$/, '') - return this.#bufferedAmount + // 6. Remove the last U+003B (;) code point from mimeType. + mimeType = mimeType.slice(0, -1) } - get url () { - webidl.brandCheck(this, WebSocket) - - // The url getter steps are to return this's url, serialized. - return URLSerializer(this[kWebSocketURL]) + // 12. If mimeType starts with U+003B (;), then prepend + // "text/plain" to mimeType. + if (mimeType.startsWith(';')) { + mimeType = 'text/plain' + mimeType } - get extensions () { - webidl.brandCheck(this, WebSocket) + // 13. Let mimeTypeRecord be the result of parsing + // mimeType. + let mimeTypeRecord = parseMIMEType(mimeType) - return this.#extensions + // 14. If mimeTypeRecord is failure, then set + // mimeTypeRecord to text/plain;charset=US-ASCII. + if (mimeTypeRecord === 'failure') { + mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII') } - get protocol () { - webidl.brandCheck(this, WebSocket) + // 15. Return a new data: URL struct whose MIME + // type is mimeTypeRecord and body is body. + // https://fetch.spec.whatwg.org/#data-url-struct + return { mimeType: mimeTypeRecord, body } +} - return this.#protocol +// https://url.spec.whatwg.org/#concept-url-serializer +/** + * @param {URL} url + * @param {boolean} excludeFragment + */ +function URLSerializer (url, excludeFragment = false) { + if (!excludeFragment) { + return url.href } - get onopen () { - webidl.brandCheck(this, WebSocket) + const href = url.href + const hashLength = url.hash.length - return this.#events.open - } + return hashLength === 0 ? href : href.substring(0, href.length - hashLength) +} - set onopen (fn) { - webidl.brandCheck(this, WebSocket) +// https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points +/** + * @param {(char: string) => boolean} condition + * @param {string} input + * @param {{ position: number }} position + */ +function collectASequenceOfCodePoints (condition, input, position) { + // 1. Let result be the empty string. + let result = '' - if (this.#events.open) { - this.removeEventListener('open', this.#events.open) - } + // 2. While position doesn’t point past the end of input and the + // code point at position within input meets the condition condition: + while (position.position < input.length && condition(input[position.position])) { + // 1. Append that code point to the end of result. + result += input[position.position] - if (typeof fn === 'function') { - this.#events.open = fn - this.addEventListener('open', fn) - } else { - this.#events.open = null - } + // 2. Advance position by 1. + position.position++ } - get onerror () { - webidl.brandCheck(this, WebSocket) + // 3. Return result. + return result +} - return this.#events.error +/** + * A faster collectASequenceOfCodePoints that only works when comparing a single character. + * @param {string} char + * @param {string} input + * @param {{ position: number }} position + */ +function collectASequenceOfCodePointsFast (char, input, position) { + const idx = input.indexOf(char, position.position) + const start = position.position + + if (idx === -1) { + position.position = input.length + return input.slice(start) } - set onerror (fn) { - webidl.brandCheck(this, WebSocket) + position.position = idx + return input.slice(start, position.position) +} - if (this.#events.error) { - this.removeEventListener('error', this.#events.error) - } +// https://url.spec.whatwg.org/#string-percent-decode +/** @param {string} input */ +function stringPercentDecode (input) { + // 1. Let bytes be the UTF-8 encoding of input. + const bytes = encoder.encode(input) - if (typeof fn === 'function') { - this.#events.error = fn - this.addEventListener('error', fn) - } else { - this.#events.error = null - } - } + // 2. Return the percent-decoding of bytes. + return percentDecode(bytes) +} - get onclose () { - webidl.brandCheck(this, WebSocket) +// https://url.spec.whatwg.org/#percent-decode +/** @param {Uint8Array} input */ +function percentDecode (input) { + // 1. Let output be an empty byte sequence. + /** @type {number[]} */ + const output = [] - return this.#events.close - } + // 2. For each byte byte in input: + for (let i = 0; i < input.length; i++) { + const byte = input[i] - set onclose (fn) { - webidl.brandCheck(this, WebSocket) + // 1. If byte is not 0x25 (%), then append byte to output. + if (byte !== 0x25) { + output.push(byte) - if (this.#events.close) { - this.removeEventListener('close', this.#events.close) - } + // 2. Otherwise, if byte is 0x25 (%) and the next two bytes + // after byte in input are not in the ranges + // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F), + // and 0x61 (a) to 0x66 (f), all inclusive, append byte + // to output. + } else if ( + byte === 0x25 && + !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2])) + ) { + output.push(0x25) - if (typeof fn === 'function') { - this.#events.close = fn - this.addEventListener('close', fn) + // 3. Otherwise: } else { - this.#events.close = null - } - } + // 1. Let bytePoint be the two bytes after byte in input, + // decoded, and then interpreted as hexadecimal number. + const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2]) + const bytePoint = Number.parseInt(nextTwoBytes, 16) - get onmessage () { - webidl.brandCheck(this, WebSocket) + // 2. Append a byte whose value is bytePoint to output. + output.push(bytePoint) - return this.#events.message + // 3. Skip the next two bytes in input. + i += 2 + } } - set onmessage (fn) { - webidl.brandCheck(this, WebSocket) + // 3. Return output. + return Uint8Array.from(output) +} - if (this.#events.message) { - this.removeEventListener('message', this.#events.message) - } +// https://mimesniff.spec.whatwg.org/#parse-a-mime-type +/** @param {string} input */ +function parseMIMEType (input) { + // 1. Remove any leading and trailing HTTP whitespace + // from input. + input = removeHTTPWhitespace(input, true, true) - if (typeof fn === 'function') { - this.#events.message = fn - this.addEventListener('message', fn) - } else { - this.#events.message = null - } - } + // 2. Let position be a position variable for input, + // initially pointing at the start of input. + const position = { position: 0 } - get binaryType () { - webidl.brandCheck(this, WebSocket) + // 3. Let type be the result of collecting a sequence + // of code points that are not U+002F (/) from + // input, given position. + const type = collectASequenceOfCodePointsFast( + '/', + input, + position + ) - return this[kBinaryType] + // 4. If type is the empty string or does not solely + // contain HTTP token code points, then return failure. + // https://mimesniff.spec.whatwg.org/#http-token-code-point + if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) { + return 'failure' } - set binaryType (type) { - webidl.brandCheck(this, WebSocket) - - if (type !== 'blob' && type !== 'arraybuffer') { - this[kBinaryType] = 'blob' - } else { - this[kBinaryType] = type - } + // 5. If position is past the end of input, then return + // failure + if (position.position > input.length) { + return 'failure' } - /** - * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol - */ - #onConnectionEstablished (response) { - // processResponse is called when the "response’s header list has been received and initialized." - // once this happens, the connection is open - this[kResponse] = response - - const parser = new ByteParser(this) - parser.on('drain', function onParserDrain () { - this.ws[kResponse].socket.resume() - }) - - response.socket.ws = this - this[kByteParser] = parser - - // 1. Change the ready state to OPEN (1). - this[kReadyState] = states.OPEN - - // 2. Change the extensions attribute’s value to the extensions in use, if - // it is not the null value. - // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1 - const extensions = response.headersList.get('sec-websocket-extensions') - - if (extensions !== null) { - this.#extensions = extensions - } + // 6. Advance position by 1. (This skips past U+002F (/).) + position.position++ - // 3. Change the protocol attribute’s value to the subprotocol in use, if - // it is not the null value. - // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9 - const protocol = response.headersList.get('sec-websocket-protocol') + // 7. Let subtype be the result of collecting a sequence of + // code points that are not U+003B (;) from input, given + // position. + let subtype = collectASequenceOfCodePointsFast( + ';', + input, + position + ) - if (protocol !== null) { - this.#protocol = protocol - } + // 8. Remove any trailing HTTP whitespace from subtype. + subtype = removeHTTPWhitespace(subtype, false, true) - // 4. Fire an event named open at the WebSocket object. - fireEvent('open', this) + // 9. If subtype is the empty string or does not solely + // contain HTTP token code points, then return failure. + if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) { + return 'failure' } -} -// https://websockets.spec.whatwg.org/#dom-websocket-connecting -WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING -// https://websockets.spec.whatwg.org/#dom-websocket-open -WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN -// https://websockets.spec.whatwg.org/#dom-websocket-closing -WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING -// https://websockets.spec.whatwg.org/#dom-websocket-closed -WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED + const typeLowercase = type.toLowerCase() + const subtypeLowercase = subtype.toLowerCase() -Object.defineProperties(WebSocket.prototype, { - CONNECTING: staticPropertyDescriptors, - OPEN: staticPropertyDescriptors, - CLOSING: staticPropertyDescriptors, - CLOSED: staticPropertyDescriptors, - url: kEnumerableProperty, - readyState: kEnumerableProperty, - bufferedAmount: kEnumerableProperty, - onopen: kEnumerableProperty, - onerror: kEnumerableProperty, - onclose: kEnumerableProperty, - close: kEnumerableProperty, - onmessage: kEnumerableProperty, - binaryType: kEnumerableProperty, - send: kEnumerableProperty, - extensions: kEnumerableProperty, - protocol: kEnumerableProperty, - [Symbol.toStringTag]: { - value: 'WebSocket', - writable: false, - enumerable: false, - configurable: true + // 10. Let mimeType be a new MIME type record whose type + // is type, in ASCII lowercase, and subtype is subtype, + // in ASCII lowercase. + // https://mimesniff.spec.whatwg.org/#mime-type + const mimeType = { + type: typeLowercase, + subtype: subtypeLowercase, + /** @type {Map} */ + parameters: new Map(), + // https://mimesniff.spec.whatwg.org/#mime-type-essence + essence: `${typeLowercase}/${subtypeLowercase}` } -}) - -Object.defineProperties(WebSocket, { - CONNECTING: staticPropertyDescriptors, - OPEN: staticPropertyDescriptors, - CLOSING: staticPropertyDescriptors, - CLOSED: staticPropertyDescriptors -}) - -webidl.converters['sequence'] = webidl.sequenceConverter( - webidl.converters.DOMString -) -webidl.converters['DOMString or sequence'] = function (V) { - if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) { - return webidl.converters['sequence'](V) - } + // 11. While position is not past the end of input: + while (position.position < input.length) { + // 1. Advance position by 1. (This skips past U+003B (;).) + position.position++ - return webidl.converters.DOMString(V) -} + // 2. Collect a sequence of code points that are HTTP + // whitespace from input given position. + collectASequenceOfCodePoints( + // https://fetch.spec.whatwg.org/#http-whitespace + char => HTTP_WHITESPACE_REGEX.test(char), + input, + position + ) -// This implements the propsal made in https://github.com/whatwg/websockets/issues/42 -webidl.converters.WebSocketInit = webidl.dictionaryConverter([ - { - key: 'protocols', - converter: webidl.converters['DOMString or sequence'], - get defaultValue () { - return [] - } - }, - { - key: 'dispatcher', - converter: (V) => V, - get defaultValue () { - return getGlobalDispatcher() - } - }, - { - key: 'headers', - converter: webidl.nullableConverter(webidl.converters.HeadersInit) - } -]) + // 3. Let parameterName be the result of collecting a + // sequence of code points that are not U+003B (;) + // or U+003D (=) from input, given position. + let parameterName = collectASequenceOfCodePoints( + (char) => char !== ';' && char !== '=', + input, + position + ) -webidl.converters['DOMString or sequence or WebSocketInit'] = function (V) { - if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) { - return webidl.converters.WebSocketInit(V) - } + // 4. Set parameterName to parameterName, in ASCII + // lowercase. + parameterName = parameterName.toLowerCase() - return { protocols: webidl.converters['DOMString or sequence'](V) } -} + // 5. If position is not past the end of input, then: + if (position.position < input.length) { + // 1. If the code point at position within input is + // U+003B (;), then continue. + if (input[position.position] === ';') { + continue + } -webidl.converters.WebSocketSendData = function (V) { - if (webidl.util.Type(V) === 'Object') { - if (isBlobLike(V)) { - return webidl.converters.Blob(V, { strict: false }) + // 2. Advance position by 1. (This skips past U+003D (=).) + position.position++ } - if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) { - return webidl.converters.BufferSource(V) + // 6. If position is past the end of input, then break. + if (position.position > input.length) { + break } - } - - return webidl.converters.USVString(V) -} - -module.exports = { - WebSocket -} - - -/***/ }), -/***/ 60031: -/***/ ((__unused_webpack_module, exports) => { + // 7. Let parameterValue be null. + let parameterValue = null -======= -/***/ 35770: -/***/ ((__unused_webpack_module, exports) => { + // 8. If the code point at position within input is + // U+0022 ("), then: + if (input[position.position] === '"') { + // 1. Set parameterValue to the result of collecting + // an HTTP quoted string from input, given position + // and the extract-value flag. + parameterValue = collectAnHTTPQuotedString(input, position, true) -"use strict"; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + // 2. Collect a sequence of code points that are not + // U+003B (;) from input, given position. + collectASequenceOfCodePointsFast( + ';', + input, + position + ) + // 9. Otherwise: + } else { + // 1. Set parameterValue to the result of collecting + // a sequence of code points that are not U+003B (;) + // from input, given position. + parameterValue = collectASequenceOfCodePointsFast( + ';', + input, + position + ) -Object.defineProperty(exports, "__esModule", ({ value: true })); + // 2. Remove any trailing HTTP whitespace from parameterValue. + parameterValue = removeHTTPWhitespace(parameterValue, false, true) -function getUserAgent() { - if (typeof navigator === "object" && "userAgent" in navigator) { - return navigator.userAgent; - } + // 3. If parameterValue is the empty string, then continue. + if (parameterValue.length === 0) { + continue + } + } -<<<<<<< HEAD - if (typeof process === "object" && process.version !== undefined) { -======= - if (typeof process === "object" && "version" in process) { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; + // 10. If all of the following are true + // - parameterName is not the empty string + // - parameterName solely contains HTTP token code points + // - parameterValue solely contains HTTP quoted-string token code points + // - mimeType’s parameters[parameterName] does not exist + // then set mimeType’s parameters[parameterName] to parameterValue. + if ( + parameterName.length !== 0 && + HTTP_TOKEN_CODEPOINTS.test(parameterName) && + (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) && + !mimeType.parameters.has(parameterName) + ) { + mimeType.parameters.set(parameterName, parameterValue) + } } - return ""; + // 12. Return mimeType. + return mimeType } -exports.getUserAgent = getUserAgent; -//# sourceMappingURL=index.js.map - +// https://infra.spec.whatwg.org/#forgiving-base64-decode +/** @param {string} data */ +function forgivingBase64 (data) { + // 1. Remove all ASCII whitespace from data. + data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line -/***/ }), + // 2. If data’s code point length divides by 4 leaving + // no remainder, then: + if (data.length % 4 === 0) { + // 1. If data ends with one or two U+003D (=) code points, + // then remove them from data. + data = data.replace(/=?=$/, '') + } -<<<<<<< HEAD -/***/ 13472: -======= -/***/ 49360: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + // 3. If data’s code point length divides by 4 leaving + // a remainder of 1, then return failure. + if (data.length % 4 === 1) { + return 'failure' + } + // 4. If data contains a code point that is not one of + // U+002B (+) + // U+002F (/) + // ASCII alphanumeric + // then return failure. + if (/[^+/0-9A-Za-z]/.test(data)) { + return 'failure' + } + const binary = atob(data) + const bytes = new Uint8Array(binary.length) -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; + for (let byte = 0; byte < binary.length; byte++) { + bytes[byte] = binary.charCodeAt(byte) } -})); - -<<<<<<< HEAD -var _v = _interopRequireDefault(__nccwpck_require__(39635)); -var _v2 = _interopRequireDefault(__nccwpck_require__(69432)); + return bytes +} -var _v3 = _interopRequireDefault(__nccwpck_require__(47505)); +// https://fetch.spec.whatwg.org/#collect-an-http-quoted-string +// tests: https://fetch.spec.whatwg.org/#example-http-quoted-string +/** + * @param {string} input + * @param {{ position: number }} position + * @param {boolean?} extractValue + */ +function collectAnHTTPQuotedString (input, position, extractValue) { + // 1. Let positionStart be position. + const positionStart = position.position -var _v4 = _interopRequireDefault(__nccwpck_require__(37492)); + // 2. Let value be the empty string. + let value = '' -var _nil = _interopRequireDefault(__nccwpck_require__(98316)); + // 3. Assert: the code point at position within input + // is U+0022 ("). + assert(input[position.position] === '"') -var _version = _interopRequireDefault(__nccwpck_require__(5110)); + // 4. Advance position by 1. + position.position++ -var _validate = _interopRequireDefault(__nccwpck_require__(92441)); + // 5. While true: + while (true) { + // 1. Append the result of collecting a sequence of code points + // that are not U+0022 (") or U+005C (\) from input, given + // position, to value. + value += collectASequenceOfCodePoints( + (char) => char !== '"' && char !== '\\', + input, + position + ) -var _stringify = _interopRequireDefault(__nccwpck_require__(21590)); + // 2. If position is past the end of input, then break. + if (position.position >= input.length) { + break + } -var _parse = _interopRequireDefault(__nccwpck_require__(19956)); -======= -var _v = _interopRequireDefault(__nccwpck_require__(89125)); + // 3. Let quoteOrBackslash be the code point at position within + // input. + const quoteOrBackslash = input[position.position] -var _v2 = _interopRequireDefault(__nccwpck_require__(46530)); + // 4. Advance position by 1. + position.position++ -var _v3 = _interopRequireDefault(__nccwpck_require__(33930)); + // 5. If quoteOrBackslash is U+005C (\), then: + if (quoteOrBackslash === '\\') { + // 1. If position is past the end of input, then append + // U+005C (\) to value and break. + if (position.position >= input.length) { + value += '\\' + break + } -var _v4 = _interopRequireDefault(__nccwpck_require__(22681)); + // 2. Append the code point at position within input to value. + value += input[position.position] -var _nil = _interopRequireDefault(__nccwpck_require__(51361)); + // 3. Advance position by 1. + position.position++ -var _version = _interopRequireDefault(__nccwpck_require__(28987)); + // 6. Otherwise: + } else { + // 1. Assert: quoteOrBackslash is U+0022 ("). + assert(quoteOrBackslash === '"') -var _validate = _interopRequireDefault(__nccwpck_require__(67848)); + // 2. Break. + break + } + } -var _stringify = _interopRequireDefault(__nccwpck_require__(39004)); + // 6. If the extract-value flag is set, then return value. + if (extractValue) { + return value + } -var _parse = _interopRequireDefault(__nccwpck_require__(72615)); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + // 7. Return the code points from positionStart to position, + // inclusive, within input. + return input.slice(positionStart, position.position) +} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/** + * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type + */ +function serializeAMimeType (mimeType) { + assert(mimeType !== 'failure') + const { parameters, essence } = mimeType -/***/ }), + // 1. Let serialization be the concatenation of mimeType’s + // type, U+002F (/), and mimeType’s subtype. + let serialization = essence -<<<<<<< HEAD -/***/ 59621: -======= -/***/ 1611: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + // 2. For each name → value of mimeType’s parameters: + for (let [name, value] of parameters.entries()) { + // 1. Append U+003B (;) to serialization. + serialization += ';' + // 2. Append name to serialization. + serialization += name + // 3. Append U+003D (=) to serialization. + serialization += '=' -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + // 4. If value does not solely contain HTTP token code + // points or value is the empty string, then: + if (!HTTP_TOKEN_CODEPOINTS.test(value)) { + // 1. Precede each occurence of U+0022 (") or + // U+005C (\) in value with U+005C (\). + value = value.replace(/(\\|")/g, '\\$1') -var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + // 2. Prepend U+0022 (") to value. + value = '"' + value -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + // 3. Append U+0022 (") to value. + value += '"' + } -function md5(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); + // 5. Append value to serialization. + serialization += value } - return _crypto.default.createHash('md5').update(bytes).digest(); + // 3. Return serialization. + return serialization } -var _default = md5; -exports["default"] = _default; - -/***/ }), - -<<<<<<< HEAD -/***/ 98316: -======= -/***/ 51361: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { - - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _default = '00000000-0000-0000-0000-000000000000'; -exports["default"] = _default; - -/***/ }), +/** + * @see https://fetch.spec.whatwg.org/#http-whitespace + * @param {string} char + */ +function isHTTPWhiteSpace (char) { + return char === '\r' || char === '\n' || char === '\t' || char === ' ' +} -<<<<<<< HEAD -/***/ 19956: -======= -/***/ 72615: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/** + * @see https://fetch.spec.whatwg.org/#http-whitespace + * @param {string} str + */ +function removeHTTPWhitespace (str, leading = true, trailing = true) { + let lead = 0 + let trail = str.length - 1 + if (leading) { + for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++); + } + if (trailing) { + for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--); + } -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + return str.slice(lead, trail + 1) +} -<<<<<<< HEAD -var _validate = _interopRequireDefault(__nccwpck_require__(92441)); -======= -var _validate = _interopRequireDefault(__nccwpck_require__(67848)); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/** + * @see https://infra.spec.whatwg.org/#ascii-whitespace + * @param {string} char + */ +function isASCIIWhitespace (char) { + return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' ' +} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/** + * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace + */ +function removeASCIIWhitespace (str, leading = true, trailing = true) { + let lead = 0 + let trail = str.length - 1 -function parse(uuid) { - if (!(0, _validate.default)(uuid)) { - throw TypeError('Invalid UUID'); + if (leading) { + for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++); } - 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 ........-....-....-####-............ + if (trailing) { + for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--); + } - 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) + return str.slice(lead, trail + 1) +} - 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; +module.exports = { + dataURLProcessor, + URLSerializer, + collectASequenceOfCodePoints, + collectASequenceOfCodePointsFast, + stringPercentDecode, + parseMIMEType, + collectAnHTTPQuotedString, + serializeAMimeType } -var _default = parse; -exports["default"] = _default; /***/ }), -<<<<<<< HEAD -/***/ 33654: -======= -/***/ 73270: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports) => { - - +/***/ 99698: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -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; -/***/ }), -<<<<<<< HEAD -/***/ 5618: -======= -/***/ 32714: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +const { Blob, File: NativeFile } = __nccwpck_require__(14300) +const { types } = __nccwpck_require__(73837) +const { kState } = __nccwpck_require__(10730) +const { isBlobLike } = __nccwpck_require__(47794) +const { webidl } = __nccwpck_require__(7000) +const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(16306) +const { kEnumerableProperty } = __nccwpck_require__(43061) +const encoder = new TextEncoder() +class File extends Blob { + constructor (fileBits, fileName, options = {}) { + // The File constructor is invoked with two or three parameters, depending + // on whether the optional dictionary parameter is used. When the File() + // constructor is invoked, user agents must run the following steps: + webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' }) + fileBits = webidl.converters['sequence'](fileBits) + fileName = webidl.converters.USVString(fileName) + options = webidl.converters.FilePropertyBag(options) -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = rng; + // 1. Let bytes be the result of processing blob parts given fileBits and + // options. + // Note: Blob handles this for us -var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + // 2. Let n be the fileName argument to the constructor. + const n = fileName -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + // 3. Process FilePropertyBag dictionary argument by running the following + // substeps: -const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate + // 1. If the type member is provided and is not the empty string, let t + // be set to the type dictionary member. If t contains any characters + // outside the range U+0020 to U+007E, then set t to the empty string + // and return from these substeps. + // 2. Convert every character in t to ASCII lowercase. + let t = options.type + let d -let poolPtr = rnds8Pool.length; + // eslint-disable-next-line no-labels + substep: { + if (t) { + t = parseMIMEType(t) -function rng() { - if (poolPtr > rnds8Pool.length - 16) { - _crypto.default.randomFillSync(rnds8Pool); + if (t === 'failure') { + t = '' + // eslint-disable-next-line no-labels + break substep + } - poolPtr = 0; - } + t = serializeAMimeType(t).toLowerCase() + } - return rnds8Pool.slice(poolPtr, poolPtr += 16); -} + // 3. If the lastModified member is provided, let d be set to the + // lastModified dictionary member. If it is not provided, set d to the + // current date and time represented as the number of milliseconds since + // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]). + d = options.lastModified + } -/***/ }), + // 4. Return a new File object F such that: + // F refers to the bytes byte sequence. + // F.size is set to the number of total bytes in bytes. + // F.name is set to n. + // F.type is set to t. + // F.lastModified is set to d. -<<<<<<< HEAD -/***/ 88645: -======= -/***/ 39908: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + super(processBlobParts(fileBits, options), { type: t }) + this[kState] = { + name: n, + lastModified: d, + type: t + } + } + get name () { + webidl.brandCheck(this, File) + return this[kState].name + } -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + get lastModified () { + webidl.brandCheck(this, File) -var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + return this[kState].lastModified + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + get type () { + webidl.brandCheck(this, File) -function sha1(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); + return this[kState].type } - - return _crypto.default.createHash('sha1').update(bytes).digest(); } -var _default = sha1; -exports["default"] = _default; +class FileLike { + constructor (blobLike, fileName, options = {}) { + // TODO: argument idl type check -/***/ }), + // The File constructor is invoked with two or three parameters, depending + // on whether the optional dictionary parameter is used. When the File() + // constructor is invoked, user agents must run the following steps: -<<<<<<< HEAD -/***/ 21590: -======= -/***/ 39004: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + // 1. Let bytes be the result of processing blob parts given fileBits and + // options. + // 2. Let n be the fileName argument to the constructor. + const n = fileName + // 3. Process FilePropertyBag dictionary argument by running the following + // substeps: -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + // 1. If the type member is provided and is not the empty string, let t + // be set to the type dictionary member. If t contains any characters + // outside the range U+0020 to U+007E, then set t to the empty string + // and return from these substeps. + // TODO + const t = options.type -<<<<<<< HEAD -var _validate = _interopRequireDefault(__nccwpck_require__(92441)); -======= -var _validate = _interopRequireDefault(__nccwpck_require__(67848)); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + // 2. Convert every character in t to ASCII lowercase. + // TODO -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + // 3. If the lastModified member is provided, let d be set to the + // lastModified dictionary member. If it is not provided, set d to the + // current date and time represented as the number of milliseconds since + // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]). + const d = options.lastModified ?? Date.now() -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ -const byteToHex = []; + // 4. Return a new File object F such that: + // F refers to the bytes byte sequence. + // F.size is set to the number of total bytes in bytes. + // F.name is set to n. + // F.type is set to t. + // F.lastModified is set to d. -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).substr(1)); -} + this[kState] = { + blobLike, + name: n, + type: t, + lastModified: d + } + } -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 + stream (...args) { + webidl.brandCheck(this, FileLike) - if (!(0, _validate.default)(uuid)) { - throw TypeError('Stringified UUID is invalid'); + return this[kState].blobLike.stream(...args) } - return uuid; -} + arrayBuffer (...args) { + webidl.brandCheck(this, FileLike) -var _default = stringify; -exports["default"] = _default; + return this[kState].blobLike.arrayBuffer(...args) + } -/***/ }), + slice (...args) { + webidl.brandCheck(this, FileLike) -<<<<<<< HEAD -/***/ 39635: -======= -/***/ 89125: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + return this[kState].blobLike.slice(...args) + } + text (...args) { + webidl.brandCheck(this, FileLike) + return this[kState].blobLike.text(...args) + } -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + get size () { + webidl.brandCheck(this, FileLike) -<<<<<<< HEAD -var _rng = _interopRequireDefault(__nccwpck_require__(5618)); + return this[kState].blobLike.size + } -var _stringify = _interopRequireDefault(__nccwpck_require__(21590)); -======= -var _rng = _interopRequireDefault(__nccwpck_require__(32714)); + get type () { + webidl.brandCheck(this, FileLike) -var _stringify = _interopRequireDefault(__nccwpck_require__(39004)); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + return this[kState].blobLike.type + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + get name () { + webidl.brandCheck(this, FileLike) -// **`v1()` - Generate time-based UUID** -// -// Inspired by https://github.com/LiosK/UUID.js -// and http://docs.python.org/library/uuid.html -let _nodeId; + return this[kState].name + } -let _clockseq; // Previous uuid creation time + get lastModified () { + webidl.brandCheck(this, FileLike) + return this[kState].lastModified + } -let _lastMSecs = 0; -let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details + get [Symbol.toStringTag] () { + return 'File' + } +} -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 +Object.defineProperties(File.prototype, { + [Symbol.toStringTag]: { + value: 'File', + configurable: true + }, + name: kEnumerableProperty, + lastModified: kEnumerableProperty +}) - if (node == null || clockseq == null) { - const seedBytes = options.random || (options.rng || _rng.default)(); +webidl.converters.Blob = webidl.interfaceConverter(Blob) - 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]]; +webidl.converters.BlobPart = function (V, opts) { + if (webidl.util.Type(V) === 'Object') { + if (isBlobLike(V)) { + return webidl.converters.Blob(V, { strict: false }) } - if (clockseq == null) { - // Per 4.2.2, randomize (14 bit) clockseq - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; + if ( + ArrayBuffer.isView(V) || + types.isAnyArrayBuffer(V) + ) { + return webidl.converters.BufferSource(V, opts) } - } // 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. + } + return webidl.converters.USVString(V, opts) +} - 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 +webidl.converters['sequence'] = webidl.sequenceConverter( + webidl.converters.BlobPart +) - let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) +// https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag +webidl.converters.FilePropertyBag = webidl.dictionaryConverter([ + { + key: 'lastModified', + converter: webidl.converters['long long'], + get defaultValue () { + return Date.now() + } + }, + { + key: 'type', + converter: webidl.converters.DOMString, + defaultValue: '' + }, + { + key: 'endings', + converter: (value) => { + value = webidl.converters.DOMString(value) + value = value.toLowerCase() - const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression + if (value !== 'native') { + value = 'transparent' + } - 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 + return value + }, + defaultValue: 'transparent' + } +]) +/** + * @see https://www.w3.org/TR/FileAPI/#process-blob-parts + * @param {(NodeJS.TypedArray|Blob|string)[]} parts + * @param {{ type: string, endings: string }} options + */ +function processBlobParts (parts, options) { + // 1. Let bytes be an empty sequence of bytes. + /** @type {NodeJS.TypedArray[]} */ + const bytes = [] - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } // Per 4.2.1.2 Throw error if too many uuids are requested + // 2. For each element in parts: + for (const element of parts) { + // 1. If element is a USVString, run the following substeps: + if (typeof element === 'string') { + // 1. Let s be element. + let s = element + // 2. If the endings member of options is "native", set s + // to the result of converting line endings to native + // of element. + if (options.endings === 'native') { + s = convertLineEndingsNative(s) + } - if (nsecs >= 10000) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + // 3. Append the result of UTF-8 encoding s to bytes. + bytes.push(encoder.encode(s)) + } else if ( + types.isAnyArrayBuffer(element) || + types.isTypedArray(element) + ) { + // 2. If element is a BufferSource, get a copy of the + // bytes held by the buffer source, and append those + // bytes to bytes. + if (!element.buffer) { // ArrayBuffer + bytes.push(new Uint8Array(element)) + } else { + bytes.push( + new Uint8Array(element.buffer, element.byteOffset, element.byteLength) + ) + } + } else if (isBlobLike(element)) { + // 3. If element is a Blob, append the bytes it represents + // to bytes. + bytes.push(element) + } } - _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` + // 3. Return bytes. + return bytes +} - const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; // `time_high_and_version` +/** + * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native + * @param {string} s + */ +function convertLineEndingsNative (s) { + // 1. Let native line ending be be the code point U+000A LF. + let nativeLineEnding = '\n' - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + // 2. If the underlying platform’s conventions are to + // represent newlines as a carriage return and line feed + // sequence, set native line ending to the code point + // U+000D CR followed by the code point U+000A LF. + if (process.platform === 'win32') { + nativeLineEnding = '\r\n' + } - b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + return s.replace(/\r?\n/g, nativeLineEnding) +} - b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` +// If this function is moved to ./util.js, some tools (such as +// rollup) will warn about circular dependencies. See: +// https://github.com/nodejs/undici/issues/1629 +function isFileLike (object) { + return ( + (NativeFile && object instanceof NativeFile) || + object instanceof File || ( + object && + (typeof object.stream === 'function' || + typeof object.arrayBuffer === 'function') && + object[Symbol.toStringTag] === 'File' + ) + ) +} - b[i++] = clockseq & 0xff; // `node` +module.exports = { File, FileLike, isFileLike } - for (let n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } - return buf || (0, _stringify.default)(b); -} +/***/ }), -var _default = v1; -exports["default"] = _default; +/***/ 12787: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ }), -<<<<<<< HEAD -/***/ 69432: -======= -/***/ 46530: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(47794) +const { kState } = __nccwpck_require__(10730) +const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(99698) +const { webidl } = __nccwpck_require__(7000) +const { Blob, File: NativeFile } = __nccwpck_require__(14300) +/** @type {globalThis['File']} */ +const File = NativeFile ?? UndiciFile -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; +// https://xhr.spec.whatwg.org/#formdata +class FormData { + constructor (form) { + if (form !== undefined) { + throw webidl.errors.conversionFailed({ + prefix: 'FormData constructor', + argument: 'Argument 1', + types: ['undefined'] + }) + } -<<<<<<< HEAD -var _v = _interopRequireDefault(__nccwpck_require__(41893)); + this[kState] = [] + } -var _md = _interopRequireDefault(__nccwpck_require__(59621)); -======= -var _v = _interopRequireDefault(__nccwpck_require__(60535)); + append (name, value, filename = undefined) { + webidl.brandCheck(this, FormData) -var _md = _interopRequireDefault(__nccwpck_require__(1611)); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' }) -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + if (arguments.length === 3 && !isBlobLike(value)) { + throw new TypeError( + "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'" + ) + } -const v3 = (0, _v.default)('v3', 0x30, _md.default); -var _default = v3; -exports["default"] = _default; + // 1. Let value be value if given; otherwise blobValue. -/***/ }), + name = webidl.converters.USVString(name) + value = isBlobLike(value) + ? webidl.converters.Blob(value, { strict: false }) + : webidl.converters.USVString(value) + filename = arguments.length === 3 + ? webidl.converters.USVString(filename) + : undefined -<<<<<<< HEAD -/***/ 41893: -======= -/***/ 60535: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + // 2. Let entry be the result of creating an entry with + // name, value, and filename if given. + const entry = makeEntry(name, value, filename) + // 3. Append entry to this’s entry list. + this[kState].push(entry) + } + delete (name) { + webidl.brandCheck(this, FormData) -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -exports.URL = exports.DNS = void 0; + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' }) -<<<<<<< HEAD -var _stringify = _interopRequireDefault(__nccwpck_require__(21590)); + name = webidl.converters.USVString(name) -var _parse = _interopRequireDefault(__nccwpck_require__(19956)); -======= -var _stringify = _interopRequireDefault(__nccwpck_require__(39004)); + // The delete(name) method steps are to remove all entries whose name + // is name from this’s entry list. + this[kState] = this[kState].filter(entry => entry.name !== name) + } -var _parse = _interopRequireDefault(__nccwpck_require__(72615)); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + get (name) { + webidl.brandCheck(this, FormData) -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' }) -function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); // UTF8 escape + name = webidl.converters.USVString(name) - const bytes = []; + // 1. If there is no entry whose name is name in this’s entry list, + // then return null. + const idx = this[kState].findIndex((entry) => entry.name === name) + if (idx === -1) { + return null + } - for (let i = 0; i < str.length; ++i) { - bytes.push(str.charCodeAt(i)); + // 2. Return the value of the first entry whose name is name from + // this’s entry list. + return this[kState][idx].value } - return bytes; -} + getAll (name) { + webidl.brandCheck(this, FormData) -const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; -exports.DNS = DNS; -const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; -exports.URL = URL; + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' }) -function _default(name, version, hashfunc) { - function generateUUID(value, namespace, buf, offset) { - if (typeof value === 'string') { - value = stringToBytes(value); - } + name = webidl.converters.USVString(name) - if (typeof namespace === 'string') { - namespace = (0, _parse.default)(namespace); - } + // 1. If there is no entry whose name is name in this’s entry list, + // then return the empty list. + // 2. Return the values of all entries whose name is name, in order, + // from this’s entry list. + return this[kState] + .filter((entry) => entry.name === name) + .map((entry) => entry.value) + } - 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])` + has (name) { + webidl.brandCheck(this, FormData) + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' }) - 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; + name = webidl.converters.USVString(name) - if (buf) { - offset = offset || 0; + // The has(name) method steps are to return true if there is an entry + // whose name is name in this’s entry list; otherwise false. + return this[kState].findIndex((entry) => entry.name === name) !== -1 + } - for (let i = 0; i < 16; ++i) { - buf[offset + i] = bytes[i]; - } + set (name, value, filename = undefined) { + webidl.brandCheck(this, FormData) - return buf; + webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' }) + + if (arguments.length === 3 && !isBlobLike(value)) { + throw new TypeError( + "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'" + ) } - return (0, _stringify.default)(bytes); - } // Function#name is not settable on some platforms (#270) + // The set(name, value) and set(name, blobValue, filename) method steps + // are: + // 1. Let value be value if given; otherwise blobValue. - try { - generateUUID.name = name; // eslint-disable-next-line no-empty - } catch (err) {} // For CommonJS default export support + name = webidl.converters.USVString(name) + value = isBlobLike(value) + ? webidl.converters.Blob(value, { strict: false }) + : webidl.converters.USVString(value) + filename = arguments.length === 3 + ? toUSVString(filename) + : undefined + // 2. Let entry be the result of creating an entry with name, value, and + // filename if given. + const entry = makeEntry(name, value, filename) - generateUUID.DNS = DNS; - generateUUID.URL = URL; - return generateUUID; -} + // 3. If there are entries in this’s entry list whose name is name, then + // replace the first such entry with entry and remove the others. + const idx = this[kState].findIndex((entry) => entry.name === name) + if (idx !== -1) { + this[kState] = [ + ...this[kState].slice(0, idx), + entry, + ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name) + ] + } else { + // 4. Otherwise, append entry to this’s entry list. + this[kState].push(entry) + } + } -/***/ }), + entries () { + webidl.brandCheck(this, FormData) -<<<<<<< HEAD -/***/ 47505: -======= -/***/ 33930: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + return makeIterator( + () => this[kState].map(pair => [pair.name, pair.value]), + 'FormData', + 'key+value' + ) + } + keys () { + webidl.brandCheck(this, FormData) + + return makeIterator( + () => this[kState].map(pair => [pair.name, pair.value]), + 'FormData', + 'key' + ) + } + values () { + webidl.brandCheck(this, FormData) -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + return makeIterator( + () => this[kState].map(pair => [pair.name, pair.value]), + 'FormData', + 'value' + ) + } -<<<<<<< HEAD -var _rng = _interopRequireDefault(__nccwpck_require__(5618)); + /** + * @param {(value: string, key: string, self: FormData) => void} callbackFn + * @param {unknown} thisArg + */ + forEach (callbackFn, thisArg = globalThis) { + webidl.brandCheck(this, FormData) -var _stringify = _interopRequireDefault(__nccwpck_require__(21590)); -======= -var _rng = _interopRequireDefault(__nccwpck_require__(32714)); + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' }) -var _stringify = _interopRequireDefault(__nccwpck_require__(39004)); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + if (typeof callbackFn !== 'function') { + throw new TypeError( + "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'." + ) + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + for (const [key, value] of this) { + callbackFn.apply(thisArg, [value, key, this]) + } + } +} -function v4(options, buf, offset) { - options = options || {}; +FormData.prototype[Symbol.iterator] = FormData.prototype.entries - const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` +Object.defineProperties(FormData.prototype, { + [Symbol.toStringTag]: { + value: 'FormData', + configurable: true + } +}) + +/** + * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry + * @param {string} name + * @param {string|Blob} value + * @param {?string} filename + * @returns + */ +function makeEntry (name, value, filename) { + // 1. Set name to the result of converting name into a scalar value string. + // "To convert a string into a scalar value string, replace any surrogates + // with U+FFFD." + // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end + name = Buffer.from(name).toString('utf8') + // 2. If value is a string, then set value to the result of converting + // value into a scalar value string. + if (typeof value === 'string') { + value = Buffer.from(value).toString('utf8') + } else { + // 3. Otherwise: - rnds[6] = rnds[6] & 0x0f | 0x40; - rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + // 1. If value is not a File object, then set value to a new File object, + // representing the same bytes, whose name attribute value is "blob" + if (!isFileLike(value)) { + value = value instanceof Blob + ? new File([value], 'blob', { type: value.type }) + : new FileLike(value, 'blob', { type: value.type }) + } - if (buf) { - offset = offset || 0; + // 2. If filename is given, then set value to a new File object, + // representing the same bytes, whose name attribute is filename. + if (filename !== undefined) { + /** @type {FilePropertyBag} */ + const options = { + type: value.type, + lastModified: value.lastModified + } - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; + value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile + ? new File([value], filename, options) + : new FileLike(value, filename, options) } - - return buf; } - return (0, _stringify.default)(rnds); + // 4. Return an entry whose name is name and whose value is value. + return { name, value } } -var _default = v4; -exports["default"] = _default; +module.exports = { FormData } + /***/ }), -<<<<<<< HEAD -/***/ 37492: -======= -/***/ 22681: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 48582: +/***/ ((module) => { -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; +// In case of breaking changes, increase the version +// number to avoid conflicts. +const globalOrigin = Symbol.for('undici.globalOrigin.1') -<<<<<<< HEAD -var _v = _interopRequireDefault(__nccwpck_require__(41893)); +function getGlobalOrigin () { + return globalThis[globalOrigin] +} -var _sha = _interopRequireDefault(__nccwpck_require__(88645)); -======= -var _v = _interopRequireDefault(__nccwpck_require__(60535)); +function setGlobalOrigin (newOrigin) { + if (newOrigin === undefined) { + Object.defineProperty(globalThis, globalOrigin, { + value: undefined, + writable: true, + enumerable: false, + configurable: false + }) -var _sha = _interopRequireDefault(__nccwpck_require__(39908)); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + return + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + const parsedURL = new URL(newOrigin) -const v5 = (0, _v.default)('v5', 0x50, _sha.default); -var _default = v5; -exports["default"] = _default; + if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') { + throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`) + } -/***/ }), + Object.defineProperty(globalThis, globalOrigin, { + value: parsedURL, + writable: true, + enumerable: false, + configurable: false + }) +} -<<<<<<< HEAD -/***/ 92441: -======= -/***/ 67848: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +module.exports = { + getGlobalOrigin, + setGlobalOrigin +} +/***/ }), -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; +/***/ 13915: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -<<<<<<< HEAD -var _regex = _interopRequireDefault(__nccwpck_require__(33654)); -======= -var _regex = _interopRequireDefault(__nccwpck_require__(73270)); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +// https://github.com/Ethan-Arrowood/undici-fetch -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; +const { kHeadersList, kConstruct } = __nccwpck_require__(69898) +const { kGuard } = __nccwpck_require__(10730) +const { kEnumerableProperty } = __nccwpck_require__(43061) +const { + makeIterator, + isValidHeaderName, + isValidHeaderValue +} = __nccwpck_require__(47794) +const { webidl } = __nccwpck_require__(7000) +const assert = __nccwpck_require__(39491) -/***/ }), +const kHeadersMap = Symbol('headers map') +const kHeadersSortedMap = Symbol('headers map sorted') -<<<<<<< HEAD -/***/ 5110: -======= -/***/ 28987: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/** + * @param {number} code + */ +function isHTTPWhiteSpaceCharCode (code) { + return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020 +} +/** + * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize + * @param {string} potentialValue + */ +function headerValueNormalize (potentialValue) { + // To normalize a byte sequence potentialValue, remove + // any leading and trailing HTTP whitespace bytes from + // potentialValue. + let i = 0; let j = potentialValue.length + while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j + while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; + return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j) +} -<<<<<<< HEAD -var _validate = _interopRequireDefault(__nccwpck_require__(92441)); -======= -var _validate = _interopRequireDefault(__nccwpck_require__(67848)); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +function fill (headers, object) { + // To fill a Headers object headers with a given object object, run these steps: -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + // 1. If object is a sequence, then for each header in object: + // Note: webidl conversion to array has already been done. + if (Array.isArray(object)) { + for (let i = 0; i < object.length; ++i) { + const header = object[i] + // 1. If header does not contain exactly two items, then throw a TypeError. + if (header.length !== 2) { + throw webidl.errors.exception({ + header: 'Headers constructor', + message: `expected name/value pair to be length 2, found ${header.length}.` + }) + } -function version(uuid) { - if (!(0, _validate.default)(uuid)) { - throw TypeError('Invalid UUID'); - } + // 2. Append (header’s first item, header’s second item) to headers. + appendHeader(headers, header[0], header[1]) + } + } else if (typeof object === 'object' && object !== null) { + // Note: null should throw - return parseInt(uuid.substr(14, 1), 16); + // 2. Otherwise, object is a record, then for each key → value in object, + // append (key, value) to headers + const keys = Object.keys(object) + for (let i = 0; i < keys.length; ++i) { + appendHeader(headers, keys[i], object[keys[i]]) + } + } else { + throw webidl.errors.conversionFailed({ + prefix: 'Headers constructor', + argument: 'Argument 1', + types: ['sequence>', 'record'] + }) + } } -var _default = version; -exports["default"] = _default; +/** + * @see https://fetch.spec.whatwg.org/#concept-headers-append + */ +function appendHeader (headers, name, value) { + // 1. Normalize value. + value = headerValueNormalize(value) -/***/ }), + // 2. If name is not a header name or value is not a + // header value, then throw a TypeError. + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.append', + value: name, + type: 'header name' + }) + } else if (!isValidHeaderValue(value)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.append', + value, + type: 'header value' + }) + } -<<<<<<< HEAD -/***/ 8909: -======= -/***/ 21628: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + // 3. If headers’s guard is "immutable", then throw a TypeError. + // 4. Otherwise, if headers’s guard is "request" and name is a + // forbidden header name, return. + // Note: undici does not implement forbidden header names + if (headers[kGuard] === 'immutable') { + throw new TypeError('immutable') + } else if (headers[kGuard] === 'request-no-cors') { + // 5. Otherwise, if headers’s guard is "request-no-cors": + // TODO + } -"use strict"; + // 6. Otherwise, if headers’s guard is "response" and name is a + // forbidden response-header name, return. + // 7. Append (name, value) to headers’s header list. + return headers[kHeadersList].append(name, value) -exports.TextEncoder = - typeof TextEncoder !== "undefined" ? TextEncoder : (__nccwpck_require__(73837).TextEncoder) + // 8. If headers’s guard is "request-no-cors", then remove + // privileged no-CORS request headers from headers +} -exports.TextDecoder = - typeof TextDecoder !== "undefined" ? TextDecoder : (__nccwpck_require__(73837).TextDecoder) +class HeadersList { + /** @type {[string, string][]|null} */ + cookies = null + constructor (init) { + if (init instanceof HeadersList) { + this[kHeadersMap] = new Map(init[kHeadersMap]) + this[kHeadersSortedMap] = init[kHeadersSortedMap] + this.cookies = init.cookies === null ? null : [...init.cookies] + } else { + this[kHeadersMap] = new Map(init) + this[kHeadersSortedMap] = null + } + } -/***/ }), + // https://fetch.spec.whatwg.org/#header-list-contains + contains (name) { + // A header list list contains a header name name if list + // contains a header whose name is a byte-case-insensitive + // match for name. + name = name.toLowerCase() -/***/ 10078: -/***/ (function(__unused_webpack_module, exports) { + return this[kHeadersMap].has(name) + } -/** - * web-streams-polyfill v3.2.1 - */ -(function (global, factory) { - true ? factory(exports) : - 0; -}(this, (function (exports) { 'use strict'; + clear () { + this[kHeadersMap].clear() + this[kHeadersSortedMap] = null + this.cookies = null + } - /// - var SymbolPolyfill = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? - Symbol : - function (description) { return "Symbol(" + description + ")"; }; + // https://fetch.spec.whatwg.org/#concept-header-list-append + append (name, value) { + this[kHeadersSortedMap] = null - /// - function noop() { - return undefined; - } - function getGlobals() { - if (typeof self !== 'undefined') { - return self; - } - else if (typeof window !== 'undefined') { - return window; - } - else if (typeof global !== 'undefined') { - return global; - } - return undefined; - } - var globals = getGlobals(); + // 1. If list contains name, then set name to the first such + // header’s name. + const lowercaseName = name.toLowerCase() + const exists = this[kHeadersMap].get(lowercaseName) - function typeIsObject(x) { - return (typeof x === 'object' && x !== null) || typeof x === 'function'; + // 2. Append (name, value) to list. + if (exists) { + const delimiter = lowercaseName === 'cookie' ? '; ' : ', ' + this[kHeadersMap].set(lowercaseName, { + name: exists.name, + value: `${exists.value}${delimiter}${value}` + }) + } else { + this[kHeadersMap].set(lowercaseName, { name, value }) } - var rethrowAssertionErrorRejection = noop; - var originalPromise = Promise; - var originalPromiseThen = Promise.prototype.then; - var originalPromiseResolve = Promise.resolve.bind(originalPromise); - var originalPromiseReject = Promise.reject.bind(originalPromise); - function newPromise(executor) { - return new originalPromise(executor); - } - function promiseResolvedWith(value) { - return originalPromiseResolve(value); - } - function promiseRejectedWith(reason) { - return originalPromiseReject(reason); - } - function PerformPromiseThen(promise, onFulfilled, onRejected) { - // There doesn't appear to be any way to correctly emulate the behaviour from JavaScript, so this is just an - // approximation. - return originalPromiseThen.call(promise, onFulfilled, onRejected); - } - function uponPromise(promise, onFulfilled, onRejected) { - PerformPromiseThen(PerformPromiseThen(promise, onFulfilled, onRejected), undefined, rethrowAssertionErrorRejection); - } - function uponFulfillment(promise, onFulfilled) { - uponPromise(promise, onFulfilled); - } - function uponRejection(promise, onRejected) { - uponPromise(promise, undefined, onRejected); - } - function transformPromiseWith(promise, fulfillmentHandler, rejectionHandler) { - return PerformPromiseThen(promise, fulfillmentHandler, rejectionHandler); - } - function setPromiseIsHandledToTrue(promise) { - PerformPromiseThen(promise, undefined, rethrowAssertionErrorRejection); - } - var queueMicrotask = (function () { - var globalQueueMicrotask = globals && globals.queueMicrotask; - if (typeof globalQueueMicrotask === 'function') { - return globalQueueMicrotask; - } - var resolvedPromise = promiseResolvedWith(undefined); - return function (fn) { return PerformPromiseThen(resolvedPromise, fn); }; - })(); - function reflectCall(F, V, args) { - if (typeof F !== 'function') { - throw new TypeError('Argument is not a function'); - } - return Function.prototype.apply.call(F, V, args); - } - function promiseCall(F, V, args) { - try { - return promiseResolvedWith(reflectCall(F, V, args)); - } - catch (value) { - return promiseRejectedWith(value); - } + if (lowercaseName === 'set-cookie') { + this.cookies ??= [] + this.cookies.push(value) } + } - // Original from Chromium - // https://chromium.googlesource.com/chromium/src/+/0aee4434a4dba42a42abaea9bfbc0cd196a63bc1/third_party/blink/renderer/core/streams/SimpleQueue.js - var QUEUE_MAX_ARRAY_SIZE = 16384; - /** - * Simple queue structure. - * - * Avoids scalability issues with using a packed array directly by using - * multiple arrays in a linked list and keeping the array size bounded. - */ - var SimpleQueue = /** @class */ (function () { - function SimpleQueue() { - this._cursor = 0; - this._size = 0; - // _front and _back are always defined. - this._front = { - _elements: [], - _next: undefined - }; - this._back = this._front; - // The cursor is used to avoid calling Array.shift(). - // It contains the index of the front element of the array inside the - // front-most node. It is always in the range [0, QUEUE_MAX_ARRAY_SIZE). - this._cursor = 0; - // When there is only one node, size === elements.length - cursor. - this._size = 0; - } - Object.defineProperty(SimpleQueue.prototype, "length", { - get: function () { - return this._size; - }, - enumerable: false, - configurable: true - }); - // For exception safety, this method is structured in order: - // 1. Read state - // 2. Calculate required state mutations - // 3. Perform state mutations - SimpleQueue.prototype.push = function (element) { - var oldBack = this._back; - var newBack = oldBack; - if (oldBack._elements.length === QUEUE_MAX_ARRAY_SIZE - 1) { - newBack = { - _elements: [], - _next: undefined - }; - } - // push() is the mutation most likely to throw an exception, so it - // goes first. - oldBack._elements.push(element); - if (newBack !== oldBack) { - this._back = newBack; - oldBack._next = newBack; - } - ++this._size; - }; - // Like push(), shift() follows the read -> calculate -> mutate pattern for - // exception safety. - SimpleQueue.prototype.shift = function () { // must not be called on an empty queue - var oldFront = this._front; - var newFront = oldFront; - var oldCursor = this._cursor; - var newCursor = oldCursor + 1; - var elements = oldFront._elements; - var element = elements[oldCursor]; - if (newCursor === QUEUE_MAX_ARRAY_SIZE) { - newFront = oldFront._next; - newCursor = 0; - } - // No mutations before this point. - --this._size; - this._cursor = newCursor; - if (oldFront !== newFront) { - this._front = newFront; - } - // Permit shifted element to be garbage collected. - elements[oldCursor] = undefined; - return element; - }; - // The tricky thing about forEach() is that it can be called - // re-entrantly. The queue may be mutated inside the callback. It is easy to - // see that push() within the callback has no negative effects since the end - // of the queue is checked for on every iteration. If shift() is called - // repeatedly within the callback then the next iteration may return an - // element that has been removed. In this case the callback will be called - // with undefined values until we either "catch up" with elements that still - // exist or reach the back of the queue. - SimpleQueue.prototype.forEach = function (callback) { - var i = this._cursor; - var node = this._front; - var elements = node._elements; - while (i !== elements.length || node._next !== undefined) { - if (i === elements.length) { - node = node._next; - elements = node._elements; - i = 0; - if (elements.length === 0) { - break; - } - } - callback(elements[i]); - ++i; - } - }; - // Return the element that would be returned if shift() was called now, - // without modifying the queue. - SimpleQueue.prototype.peek = function () { // must not be called on an empty queue - var front = this._front; - var cursor = this._cursor; - return front._elements[cursor]; - }; - return SimpleQueue; - }()); + // https://fetch.spec.whatwg.org/#concept-header-list-set + set (name, value) { + this[kHeadersSortedMap] = null + const lowercaseName = name.toLowerCase() - function ReadableStreamReaderGenericInitialize(reader, stream) { - reader._ownerReadableStream = stream; - stream._reader = reader; - if (stream._state === 'readable') { - defaultReaderClosedPromiseInitialize(reader); - } - else if (stream._state === 'closed') { - defaultReaderClosedPromiseInitializeAsResolved(reader); - } - else { - defaultReaderClosedPromiseInitializeAsRejected(reader, stream._storedError); - } - } - // A client of ReadableStreamDefaultReader and ReadableStreamBYOBReader may use these functions directly to bypass state - // check. - function ReadableStreamReaderGenericCancel(reader, reason) { - var stream = reader._ownerReadableStream; - return ReadableStreamCancel(stream, reason); - } - function ReadableStreamReaderGenericRelease(reader) { - if (reader._ownerReadableStream._state === 'readable') { - defaultReaderClosedPromiseReject(reader, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")); - } - else { - defaultReaderClosedPromiseResetToRejected(reader, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")); - } - reader._ownerReadableStream._reader = undefined; - reader._ownerReadableStream = undefined; - } - // Helper functions for the readers. - function readerLockException(name) { - return new TypeError('Cannot ' + name + ' a stream using a released reader'); - } - // Helper functions for the ReadableStreamDefaultReader. - function defaultReaderClosedPromiseInitialize(reader) { - reader._closedPromise = newPromise(function (resolve, reject) { - reader._closedPromise_resolve = resolve; - reader._closedPromise_reject = reject; - }); - } - function defaultReaderClosedPromiseInitializeAsRejected(reader, reason) { - defaultReaderClosedPromiseInitialize(reader); - defaultReaderClosedPromiseReject(reader, reason); - } - function defaultReaderClosedPromiseInitializeAsResolved(reader) { - defaultReaderClosedPromiseInitialize(reader); - defaultReaderClosedPromiseResolve(reader); - } - function defaultReaderClosedPromiseReject(reader, reason) { - if (reader._closedPromise_reject === undefined) { - return; - } - setPromiseIsHandledToTrue(reader._closedPromise); - reader._closedPromise_reject(reason); - reader._closedPromise_resolve = undefined; - reader._closedPromise_reject = undefined; - } - function defaultReaderClosedPromiseResetToRejected(reader, reason) { - defaultReaderClosedPromiseInitializeAsRejected(reader, reason); - } - function defaultReaderClosedPromiseResolve(reader) { - if (reader._closedPromise_resolve === undefined) { - return; - } - reader._closedPromise_resolve(undefined); - reader._closedPromise_resolve = undefined; - reader._closedPromise_reject = undefined; + if (lowercaseName === 'set-cookie') { + this.cookies = [value] } - var AbortSteps = SymbolPolyfill('[[AbortSteps]]'); - var ErrorSteps = SymbolPolyfill('[[ErrorSteps]]'); - var CancelSteps = SymbolPolyfill('[[CancelSteps]]'); - var PullSteps = SymbolPolyfill('[[PullSteps]]'); - - /// - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#Polyfill - var NumberIsFinite = Number.isFinite || function (x) { - return typeof x === 'number' && isFinite(x); - }; - - /// - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc#Polyfill - var MathTrunc = Math.trunc || function (v) { - return v < 0 ? Math.ceil(v) : Math.floor(v); - }; - - // https://heycam.github.io/webidl/#idl-dictionaries - function isDictionary(x) { - return typeof x === 'object' || typeof x === 'function'; - } - function assertDictionary(obj, context) { - if (obj !== undefined && !isDictionary(obj)) { - throw new TypeError(context + " is not an object."); - } - } - // https://heycam.github.io/webidl/#idl-callback-functions - function assertFunction(x, context) { - if (typeof x !== 'function') { - throw new TypeError(context + " is not a function."); - } - } - // https://heycam.github.io/webidl/#idl-object - function isObject(x) { - return (typeof x === 'object' && x !== null) || typeof x === 'function'; - } - function assertObject(x, context) { - if (!isObject(x)) { - throw new TypeError(context + " is not an object."); - } - } - function assertRequiredArgument(x, position, context) { - if (x === undefined) { - throw new TypeError("Parameter " + position + " is required in '" + context + "'."); - } - } - function assertRequiredField(x, field, context) { - if (x === undefined) { - throw new TypeError(field + " is required in '" + context + "'."); - } - } - // https://heycam.github.io/webidl/#idl-unrestricted-double - function convertUnrestrictedDouble(value) { - return Number(value); - } - function censorNegativeZero(x) { - return x === 0 ? 0 : x; - } - function integerPart(x) { - return censorNegativeZero(MathTrunc(x)); - } - // https://heycam.github.io/webidl/#idl-unsigned-long-long - function convertUnsignedLongLongWithEnforceRange(value, context) { - var lowerBound = 0; - var upperBound = Number.MAX_SAFE_INTEGER; - var x = Number(value); - x = censorNegativeZero(x); - if (!NumberIsFinite(x)) { - throw new TypeError(context + " is not a finite number"); - } - x = integerPart(x); - if (x < lowerBound || x > upperBound) { - throw new TypeError(context + " is outside the accepted range of " + lowerBound + " to " + upperBound + ", inclusive"); - } - if (!NumberIsFinite(x) || x === 0) { - return 0; - } - // TODO Use BigInt if supported? - // let xBigInt = BigInt(integerPart(x)); - // xBigInt = BigInt.asUintN(64, xBigInt); - // return Number(xBigInt); - return x; - } + // 1. If list contains name, then set the value of + // the first such header to value and remove the + // others. + // 2. Otherwise, append header (name, value) to list. + this[kHeadersMap].set(lowercaseName, { name, value }) + } - function assertReadableStream(x, context) { - if (!IsReadableStream(x)) { - throw new TypeError(context + " is not a ReadableStream."); - } - } + // https://fetch.spec.whatwg.org/#concept-header-list-delete + delete (name) { + this[kHeadersSortedMap] = null - // Abstract operations for the ReadableStream. - function AcquireReadableStreamDefaultReader(stream) { - return new ReadableStreamDefaultReader(stream); - } - // ReadableStream API exposed for controllers. - function ReadableStreamAddReadRequest(stream, readRequest) { - stream._reader._readRequests.push(readRequest); - } - function ReadableStreamFulfillReadRequest(stream, chunk, done) { - var reader = stream._reader; - var readRequest = reader._readRequests.shift(); - if (done) { - readRequest._closeSteps(); - } - else { - readRequest._chunkSteps(chunk); - } - } - function ReadableStreamGetNumReadRequests(stream) { - return stream._reader._readRequests.length; - } - function ReadableStreamHasDefaultReader(stream) { - var reader = stream._reader; - if (reader === undefined) { - return false; - } - if (!IsReadableStreamDefaultReader(reader)) { - return false; - } - return true; - } - /** - * A default reader vended by a {@link ReadableStream}. - * - * @public - */ - var ReadableStreamDefaultReader = /** @class */ (function () { - function ReadableStreamDefaultReader(stream) { - assertRequiredArgument(stream, 1, 'ReadableStreamDefaultReader'); - assertReadableStream(stream, 'First parameter'); - if (IsReadableStreamLocked(stream)) { - throw new TypeError('This stream has already been locked for exclusive reading by another reader'); - } - ReadableStreamReaderGenericInitialize(this, stream); - this._readRequests = new SimpleQueue(); - } - Object.defineProperty(ReadableStreamDefaultReader.prototype, "closed", { - /** - * Returns a promise that will be fulfilled when the stream becomes closed, - * or rejected if the stream ever errors or the reader's lock is released before the stream finishes closing. - */ - get: function () { - if (!IsReadableStreamDefaultReader(this)) { - return promiseRejectedWith(defaultReaderBrandCheckException('closed')); - } - return this._closedPromise; - }, - enumerable: false, - configurable: true - }); - /** - * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}. - */ - ReadableStreamDefaultReader.prototype.cancel = function (reason) { - if (reason === void 0) { reason = undefined; } - if (!IsReadableStreamDefaultReader(this)) { - return promiseRejectedWith(defaultReaderBrandCheckException('cancel')); - } - if (this._ownerReadableStream === undefined) { - return promiseRejectedWith(readerLockException('cancel')); - } - return ReadableStreamReaderGenericCancel(this, reason); - }; - /** - * Returns a promise that allows access to the next chunk from the stream's internal queue, if available. - * - * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source. - */ - ReadableStreamDefaultReader.prototype.read = function () { - if (!IsReadableStreamDefaultReader(this)) { - return promiseRejectedWith(defaultReaderBrandCheckException('read')); - } - if (this._ownerReadableStream === undefined) { - return promiseRejectedWith(readerLockException('read from')); - } - var resolvePromise; - var rejectPromise; - var promise = newPromise(function (resolve, reject) { - resolvePromise = resolve; - rejectPromise = reject; - }); - var readRequest = { - _chunkSteps: function (chunk) { return resolvePromise({ value: chunk, done: false }); }, - _closeSteps: function () { return resolvePromise({ value: undefined, done: true }); }, - _errorSteps: function (e) { return rejectPromise(e); } - }; - ReadableStreamDefaultReaderRead(this, readRequest); - return promise; - }; - /** - * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active. - * If the associated stream is errored when the lock is released, the reader will appear errored in the same way - * from now on; otherwise, the reader will appear closed. - * - * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by - * the reader's {@link ReadableStreamDefaultReader.read | read()} method has not yet been settled. Attempting to - * do so will throw a `TypeError` and leave the reader locked to the stream. - */ - ReadableStreamDefaultReader.prototype.releaseLock = function () { - if (!IsReadableStreamDefaultReader(this)) { - throw defaultReaderBrandCheckException('releaseLock'); - } - if (this._ownerReadableStream === undefined) { - return; - } - if (this._readRequests.length > 0) { - throw new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled'); - } - ReadableStreamReaderGenericRelease(this); - }; - return ReadableStreamDefaultReader; - }()); - Object.defineProperties(ReadableStreamDefaultReader.prototype, { - cancel: { enumerable: true }, - read: { enumerable: true }, - releaseLock: { enumerable: true }, - closed: { enumerable: true } - }); - if (typeof SymbolPolyfill.toStringTag === 'symbol') { - Object.defineProperty(ReadableStreamDefaultReader.prototype, SymbolPolyfill.toStringTag, { - value: 'ReadableStreamDefaultReader', - configurable: true - }); - } - // Abstract operations for the readers. - function IsReadableStreamDefaultReader(x) { - if (!typeIsObject(x)) { - return false; - } - if (!Object.prototype.hasOwnProperty.call(x, '_readRequests')) { - return false; - } - return x instanceof ReadableStreamDefaultReader; - } - function ReadableStreamDefaultReaderRead(reader, readRequest) { - var stream = reader._ownerReadableStream; - stream._disturbed = true; - if (stream._state === 'closed') { - readRequest._closeSteps(); - } - else if (stream._state === 'errored') { - readRequest._errorSteps(stream._storedError); - } - else { - stream._readableStreamController[PullSteps](readRequest); - } - } - // Helper functions for the ReadableStreamDefaultReader. - function defaultReaderBrandCheckException(name) { - return new TypeError("ReadableStreamDefaultReader.prototype." + name + " can only be used on a ReadableStreamDefaultReader"); - } + name = name.toLowerCase() - /// - var _a; - var AsyncIteratorPrototype; - if (typeof SymbolPolyfill.asyncIterator === 'symbol') { - // We're running inside a ES2018+ environment, but we're compiling to an older syntax. - // We cannot access %AsyncIteratorPrototype% without non-ES2018 syntax, but we can re-create it. - AsyncIteratorPrototype = (_a = {}, - // 25.1.3.1 %AsyncIteratorPrototype% [ @@asyncIterator ] ( ) - // https://tc39.github.io/ecma262/#sec-asynciteratorprototype-asynciterator - _a[SymbolPolyfill.asyncIterator] = function () { - return this; - }, - _a); - Object.defineProperty(AsyncIteratorPrototype, SymbolPolyfill.asyncIterator, { enumerable: false }); - } - - /// - var ReadableStreamAsyncIteratorImpl = /** @class */ (function () { - function ReadableStreamAsyncIteratorImpl(reader, preventCancel) { - this._ongoingPromise = undefined; - this._isFinished = false; - this._reader = reader; - this._preventCancel = preventCancel; - } - ReadableStreamAsyncIteratorImpl.prototype.next = function () { - var _this = this; - var nextSteps = function () { return _this._nextSteps(); }; - this._ongoingPromise = this._ongoingPromise ? - transformPromiseWith(this._ongoingPromise, nextSteps, nextSteps) : - nextSteps(); - return this._ongoingPromise; - }; - ReadableStreamAsyncIteratorImpl.prototype.return = function (value) { - var _this = this; - var returnSteps = function () { return _this._returnSteps(value); }; - return this._ongoingPromise ? - transformPromiseWith(this._ongoingPromise, returnSteps, returnSteps) : - returnSteps(); - }; - ReadableStreamAsyncIteratorImpl.prototype._nextSteps = function () { - var _this = this; - if (this._isFinished) { - return Promise.resolve({ value: undefined, done: true }); - } - var reader = this._reader; - if (reader._ownerReadableStream === undefined) { - return promiseRejectedWith(readerLockException('iterate')); - } - var resolvePromise; - var rejectPromise; - var promise = newPromise(function (resolve, reject) { - resolvePromise = resolve; - rejectPromise = reject; - }); - var readRequest = { - _chunkSteps: function (chunk) { - _this._ongoingPromise = undefined; - // This needs to be delayed by one microtask, otherwise we stop pulling too early which breaks a test. - // FIXME Is this a bug in the specification, or in the test? - queueMicrotask(function () { return resolvePromise({ value: chunk, done: false }); }); - }, - _closeSteps: function () { - _this._ongoingPromise = undefined; - _this._isFinished = true; - ReadableStreamReaderGenericRelease(reader); - resolvePromise({ value: undefined, done: true }); - }, - _errorSteps: function (reason) { - _this._ongoingPromise = undefined; - _this._isFinished = true; - ReadableStreamReaderGenericRelease(reader); - rejectPromise(reason); - } - }; - ReadableStreamDefaultReaderRead(reader, readRequest); - return promise; - }; - ReadableStreamAsyncIteratorImpl.prototype._returnSteps = function (value) { - if (this._isFinished) { - return Promise.resolve({ value: value, done: true }); - } - this._isFinished = true; - var reader = this._reader; - if (reader._ownerReadableStream === undefined) { - return promiseRejectedWith(readerLockException('finish iterating')); - } - if (!this._preventCancel) { - var result = ReadableStreamReaderGenericCancel(reader, value); - ReadableStreamReaderGenericRelease(reader); - return transformPromiseWith(result, function () { return ({ value: value, done: true }); }); - } - ReadableStreamReaderGenericRelease(reader); - return promiseResolvedWith({ value: value, done: true }); - }; - return ReadableStreamAsyncIteratorImpl; - }()); - var ReadableStreamAsyncIteratorPrototype = { - next: function () { - if (!IsReadableStreamAsyncIterator(this)) { - return promiseRejectedWith(streamAsyncIteratorBrandCheckException('next')); - } - return this._asyncIteratorImpl.next(); - }, - return: function (value) { - if (!IsReadableStreamAsyncIterator(this)) { - return promiseRejectedWith(streamAsyncIteratorBrandCheckException('return')); - } - return this._asyncIteratorImpl.return(value); - } - }; - if (AsyncIteratorPrototype !== undefined) { - Object.setPrototypeOf(ReadableStreamAsyncIteratorPrototype, AsyncIteratorPrototype); - } - // Abstract operations for the ReadableStream. - function AcquireReadableStreamAsyncIterator(stream, preventCancel) { - var reader = AcquireReadableStreamDefaultReader(stream); - var impl = new ReadableStreamAsyncIteratorImpl(reader, preventCancel); - var iterator = Object.create(ReadableStreamAsyncIteratorPrototype); - iterator._asyncIteratorImpl = impl; - return iterator; - } - function IsReadableStreamAsyncIterator(x) { - if (!typeIsObject(x)) { - return false; - } - if (!Object.prototype.hasOwnProperty.call(x, '_asyncIteratorImpl')) { - return false; - } - try { - // noinspection SuspiciousTypeOfGuard - return x._asyncIteratorImpl instanceof - ReadableStreamAsyncIteratorImpl; - } - catch (_a) { - return false; - } - } - // Helper functions for the ReadableStream. - function streamAsyncIteratorBrandCheckException(name) { - return new TypeError("ReadableStreamAsyncIterator." + name + " can only be used on a ReadableSteamAsyncIterator"); + if (name === 'set-cookie') { + this.cookies = null } - /// - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN#Polyfill - var NumberIsNaN = Number.isNaN || function (x) { - // eslint-disable-next-line no-self-compare - return x !== x; - }; + this[kHeadersMap].delete(name) + } - function CreateArrayFromList(elements) { - // We use arrays to represent lists, so this is basically a no-op. - // Do a slice though just in case we happen to depend on the unique-ness. - return elements.slice(); - } - function CopyDataBlockBytes(dest, destOffset, src, srcOffset, n) { - new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset); - } - // Not implemented correctly - function TransferArrayBuffer(O) { - return O; - } - // Not implemented correctly - // eslint-disable-next-line @typescript-eslint/no-unused-vars - function IsDetachedBuffer(O) { - return false; - } - function ArrayBufferSlice(buffer, begin, end) { - // ArrayBuffer.prototype.slice is not available on IE10 - // https://www.caniuse.com/mdn-javascript_builtins_arraybuffer_slice - if (buffer.slice) { - return buffer.slice(begin, end); - } - var length = end - begin; - var slice = new ArrayBuffer(length); - CopyDataBlockBytes(slice, 0, buffer, begin, length); - return slice; - } + // https://fetch.spec.whatwg.org/#concept-header-list-get + get (name) { + const value = this[kHeadersMap].get(name.toLowerCase()) - function IsNonNegativeNumber(v) { - if (typeof v !== 'number') { - return false; - } - if (NumberIsNaN(v)) { - return false; - } - if (v < 0) { - return false; - } - return true; - } - function CloneAsUint8Array(O) { - var buffer = ArrayBufferSlice(O.buffer, O.byteOffset, O.byteOffset + O.byteLength); - return new Uint8Array(buffer); - } + // 1. If list does not contain name, then return null. + // 2. Return the values of all headers in list whose name + // is a byte-case-insensitive match for name, + // separated from each other by 0x2C 0x20, in order. + return value === undefined ? null : value.value + } - function DequeueValue(container) { - var pair = container._queue.shift(); - container._queueTotalSize -= pair.size; - if (container._queueTotalSize < 0) { - container._queueTotalSize = 0; - } - return pair.value; - } - function EnqueueValueWithSize(container, value, size) { - if (!IsNonNegativeNumber(size) || size === Infinity) { - throw new RangeError('Size must be a finite, non-NaN, non-negative number.'); - } - container._queue.push({ value: value, size: size }); - container._queueTotalSize += size; - } - function PeekQueueValue(container) { - var pair = container._queue.peek(); - return pair.value; - } - function ResetQueue(container) { - container._queue = new SimpleQueue(); - container._queueTotalSize = 0; + * [Symbol.iterator] () { + // use the lowercased name + for (const [name, { value }] of this[kHeadersMap]) { + yield [name, value] } + } - /** - * A pull-into request in a {@link ReadableByteStreamController}. - * - * @public - */ - var ReadableStreamBYOBRequest = /** @class */ (function () { - function ReadableStreamBYOBRequest() { - throw new TypeError('Illegal constructor'); - } - Object.defineProperty(ReadableStreamBYOBRequest.prototype, "view", { - /** - * Returns the view for writing in to, or `null` if the BYOB request has already been responded to. - */ - get: function () { - if (!IsReadableStreamBYOBRequest(this)) { - throw byobRequestBrandCheckException('view'); - } - return this._view; - }, - enumerable: false, - configurable: true - }); - ReadableStreamBYOBRequest.prototype.respond = function (bytesWritten) { - if (!IsReadableStreamBYOBRequest(this)) { - throw byobRequestBrandCheckException('respond'); - } - assertRequiredArgument(bytesWritten, 1, 'respond'); - bytesWritten = convertUnsignedLongLongWithEnforceRange(bytesWritten, 'First parameter'); - if (this._associatedReadableByteStreamController === undefined) { - throw new TypeError('This BYOB request has been invalidated'); - } - if (IsDetachedBuffer(this._view.buffer)) ; - ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController, bytesWritten); - }; - ReadableStreamBYOBRequest.prototype.respondWithNewView = function (view) { - if (!IsReadableStreamBYOBRequest(this)) { - throw byobRequestBrandCheckException('respondWithNewView'); - } - assertRequiredArgument(view, 1, 'respondWithNewView'); - if (!ArrayBuffer.isView(view)) { - throw new TypeError('You can only respond with array buffer views'); - } - if (this._associatedReadableByteStreamController === undefined) { - throw new TypeError('This BYOB request has been invalidated'); - } - if (IsDetachedBuffer(view.buffer)) ; - ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController, view); - }; - return ReadableStreamBYOBRequest; - }()); - Object.defineProperties(ReadableStreamBYOBRequest.prototype, { - respond: { enumerable: true }, - respondWithNewView: { enumerable: true }, - view: { enumerable: true } - }); - if (typeof SymbolPolyfill.toStringTag === 'symbol') { - Object.defineProperty(ReadableStreamBYOBRequest.prototype, SymbolPolyfill.toStringTag, { - value: 'ReadableStreamBYOBRequest', - configurable: true - }); - } - /** - * Allows control of a {@link ReadableStream | readable byte stream}'s state and internal queue. - * - * @public - */ - var ReadableByteStreamController = /** @class */ (function () { - function ReadableByteStreamController() { - throw new TypeError('Illegal constructor'); - } - Object.defineProperty(ReadableByteStreamController.prototype, "byobRequest", { - /** - * Returns the current BYOB pull request, or `null` if there isn't one. - */ - get: function () { - if (!IsReadableByteStreamController(this)) { - throw byteStreamControllerBrandCheckException('byobRequest'); - } - return ReadableByteStreamControllerGetBYOBRequest(this); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ReadableByteStreamController.prototype, "desiredSize", { - /** - * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is - * over-full. An underlying byte source ought to use this information to determine when and how to apply backpressure. - */ - get: function () { - if (!IsReadableByteStreamController(this)) { - throw byteStreamControllerBrandCheckException('desiredSize'); - } - return ReadableByteStreamControllerGetDesiredSize(this); - }, - enumerable: false, - configurable: true - }); - /** - * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from - * the stream, but once those are read, the stream will become closed. - */ - ReadableByteStreamController.prototype.close = function () { - if (!IsReadableByteStreamController(this)) { - throw byteStreamControllerBrandCheckException('close'); - } - if (this._closeRequested) { - throw new TypeError('The stream has already been closed; do not close it again!'); - } - var state = this._controlledReadableByteStream._state; - if (state !== 'readable') { - throw new TypeError("The stream (in " + state + " state) is not in the readable state and cannot be closed"); - } - ReadableByteStreamControllerClose(this); - }; - ReadableByteStreamController.prototype.enqueue = function (chunk) { - if (!IsReadableByteStreamController(this)) { - throw byteStreamControllerBrandCheckException('enqueue'); - } - assertRequiredArgument(chunk, 1, 'enqueue'); - if (!ArrayBuffer.isView(chunk)) { - throw new TypeError('chunk must be an array buffer view'); - } - if (chunk.byteLength === 0) { - throw new TypeError('chunk must have non-zero byteLength'); - } - if (chunk.buffer.byteLength === 0) { - throw new TypeError("chunk's buffer must have non-zero byteLength"); - } - if (this._closeRequested) { - throw new TypeError('stream is closed or draining'); - } - var state = this._controlledReadableByteStream._state; - if (state !== 'readable') { - throw new TypeError("The stream (in " + state + " state) is not in the readable state and cannot be enqueued to"); - } - ReadableByteStreamControllerEnqueue(this, chunk); - }; - /** - * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`. - */ - ReadableByteStreamController.prototype.error = function (e) { - if (e === void 0) { e = undefined; } - if (!IsReadableByteStreamController(this)) { - throw byteStreamControllerBrandCheckException('error'); - } - ReadableByteStreamControllerError(this, e); - }; - /** @internal */ - ReadableByteStreamController.prototype[CancelSteps] = function (reason) { - ReadableByteStreamControllerClearPendingPullIntos(this); - ResetQueue(this); - var result = this._cancelAlgorithm(reason); - ReadableByteStreamControllerClearAlgorithms(this); - return result; - }; - /** @internal */ - ReadableByteStreamController.prototype[PullSteps] = function (readRequest) { - var stream = this._controlledReadableByteStream; - if (this._queueTotalSize > 0) { - var entry = this._queue.shift(); - this._queueTotalSize -= entry.byteLength; - ReadableByteStreamControllerHandleQueueDrain(this); - var view = new Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength); - readRequest._chunkSteps(view); - return; - } - var autoAllocateChunkSize = this._autoAllocateChunkSize; - if (autoAllocateChunkSize !== undefined) { - var buffer = void 0; - try { - buffer = new ArrayBuffer(autoAllocateChunkSize); - } - catch (bufferE) { - readRequest._errorSteps(bufferE); - return; - } - var pullIntoDescriptor = { - buffer: buffer, - bufferByteLength: autoAllocateChunkSize, - byteOffset: 0, - byteLength: autoAllocateChunkSize, - bytesFilled: 0, - elementSize: 1, - viewConstructor: Uint8Array, - readerType: 'default' - }; - this._pendingPullIntos.push(pullIntoDescriptor); - } - ReadableStreamAddReadRequest(stream, readRequest); - ReadableByteStreamControllerCallPullIfNeeded(this); - }; - return ReadableByteStreamController; - }()); - Object.defineProperties(ReadableByteStreamController.prototype, { - close: { enumerable: true }, - enqueue: { enumerable: true }, - error: { enumerable: true }, - byobRequest: { enumerable: true }, - desiredSize: { enumerable: true } - }); - if (typeof SymbolPolyfill.toStringTag === 'symbol') { - Object.defineProperty(ReadableByteStreamController.prototype, SymbolPolyfill.toStringTag, { - value: 'ReadableByteStreamController', - configurable: true - }); - } - // Abstract operations for the ReadableByteStreamController. - function IsReadableByteStreamController(x) { - if (!typeIsObject(x)) { - return false; - } - if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableByteStream')) { - return false; - } - return x instanceof ReadableByteStreamController; - } - function IsReadableStreamBYOBRequest(x) { - if (!typeIsObject(x)) { - return false; - } - if (!Object.prototype.hasOwnProperty.call(x, '_associatedReadableByteStreamController')) { - return false; - } - return x instanceof ReadableStreamBYOBRequest; - } - function ReadableByteStreamControllerCallPullIfNeeded(controller) { - var shouldPull = ReadableByteStreamControllerShouldCallPull(controller); - if (!shouldPull) { - return; - } - if (controller._pulling) { - controller._pullAgain = true; - return; - } - controller._pulling = true; - // TODO: Test controller argument - var pullPromise = controller._pullAlgorithm(); - uponPromise(pullPromise, function () { - controller._pulling = false; - if (controller._pullAgain) { - controller._pullAgain = false; - ReadableByteStreamControllerCallPullIfNeeded(controller); - } - }, function (e) { - ReadableByteStreamControllerError(controller, e); - }); - } - function ReadableByteStreamControllerClearPendingPullIntos(controller) { - ReadableByteStreamControllerInvalidateBYOBRequest(controller); - controller._pendingPullIntos = new SimpleQueue(); - } - function ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor) { - var done = false; - if (stream._state === 'closed') { - done = true; - } - var filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor); - if (pullIntoDescriptor.readerType === 'default') { - ReadableStreamFulfillReadRequest(stream, filledView, done); - } - else { - ReadableStreamFulfillReadIntoRequest(stream, filledView, done); - } - } - function ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor) { - var bytesFilled = pullIntoDescriptor.bytesFilled; - var elementSize = pullIntoDescriptor.elementSize; - return new pullIntoDescriptor.viewConstructor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, bytesFilled / elementSize); - } - function ReadableByteStreamControllerEnqueueChunkToQueue(controller, buffer, byteOffset, byteLength) { - controller._queue.push({ buffer: buffer, byteOffset: byteOffset, byteLength: byteLength }); - controller._queueTotalSize += byteLength; - } - function ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) { - var elementSize = pullIntoDescriptor.elementSize; - var currentAlignedBytes = pullIntoDescriptor.bytesFilled - pullIntoDescriptor.bytesFilled % elementSize; - var maxBytesToCopy = Math.min(controller._queueTotalSize, pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled); - var maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy; - var maxAlignedBytes = maxBytesFilled - maxBytesFilled % elementSize; - var totalBytesToCopyRemaining = maxBytesToCopy; - var ready = false; - if (maxAlignedBytes > currentAlignedBytes) { - totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled; - ready = true; - } - var queue = controller._queue; - while (totalBytesToCopyRemaining > 0) { - var headOfQueue = queue.peek(); - var bytesToCopy = Math.min(totalBytesToCopyRemaining, headOfQueue.byteLength); - var destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled; - CopyDataBlockBytes(pullIntoDescriptor.buffer, destStart, headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy); - if (headOfQueue.byteLength === bytesToCopy) { - queue.shift(); - } - else { - headOfQueue.byteOffset += bytesToCopy; - headOfQueue.byteLength -= bytesToCopy; - } - controller._queueTotalSize -= bytesToCopy; - ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesToCopy, pullIntoDescriptor); - totalBytesToCopyRemaining -= bytesToCopy; - } - return ready; - } - function ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, size, pullIntoDescriptor) { - pullIntoDescriptor.bytesFilled += size; - } - function ReadableByteStreamControllerHandleQueueDrain(controller) { - if (controller._queueTotalSize === 0 && controller._closeRequested) { - ReadableByteStreamControllerClearAlgorithms(controller); - ReadableStreamClose(controller._controlledReadableByteStream); - } - else { - ReadableByteStreamControllerCallPullIfNeeded(controller); - } - } - function ReadableByteStreamControllerInvalidateBYOBRequest(controller) { - if (controller._byobRequest === null) { - return; - } - controller._byobRequest._associatedReadableByteStreamController = undefined; - controller._byobRequest._view = null; - controller._byobRequest = null; - } - function ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller) { - while (controller._pendingPullIntos.length > 0) { - if (controller._queueTotalSize === 0) { - return; - } - var pullIntoDescriptor = controller._pendingPullIntos.peek(); - if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) { - ReadableByteStreamControllerShiftPendingPullInto(controller); - ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor); - } - } - } - function ReadableByteStreamControllerPullInto(controller, view, readIntoRequest) { - var stream = controller._controlledReadableByteStream; - var elementSize = 1; - if (view.constructor !== DataView) { - elementSize = view.constructor.BYTES_PER_ELEMENT; - } - var ctor = view.constructor; - // try { - var buffer = TransferArrayBuffer(view.buffer); - // } catch (e) { - // readIntoRequest._errorSteps(e); - // return; - // } - var pullIntoDescriptor = { - buffer: buffer, - bufferByteLength: buffer.byteLength, - byteOffset: view.byteOffset, - byteLength: view.byteLength, - bytesFilled: 0, - elementSize: elementSize, - viewConstructor: ctor, - readerType: 'byob' - }; - if (controller._pendingPullIntos.length > 0) { - controller._pendingPullIntos.push(pullIntoDescriptor); - // No ReadableByteStreamControllerCallPullIfNeeded() call since: - // - No change happens on desiredSize - // - The source has already been notified of that there's at least 1 pending read(view) - ReadableStreamAddReadIntoRequest(stream, readIntoRequest); - return; - } - if (stream._state === 'closed') { - var emptyView = new ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0); - readIntoRequest._closeSteps(emptyView); - return; - } - if (controller._queueTotalSize > 0) { - if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) { - var filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor); - ReadableByteStreamControllerHandleQueueDrain(controller); - readIntoRequest._chunkSteps(filledView); - return; - } - if (controller._closeRequested) { - var e = new TypeError('Insufficient bytes to fill elements in the given buffer'); - ReadableByteStreamControllerError(controller, e); - readIntoRequest._errorSteps(e); - return; - } - } - controller._pendingPullIntos.push(pullIntoDescriptor); - ReadableStreamAddReadIntoRequest(stream, readIntoRequest); - ReadableByteStreamControllerCallPullIfNeeded(controller); - } - function ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor) { - var stream = controller._controlledReadableByteStream; - if (ReadableStreamHasBYOBReader(stream)) { - while (ReadableStreamGetNumReadIntoRequests(stream) > 0) { - var pullIntoDescriptor = ReadableByteStreamControllerShiftPendingPullInto(controller); - ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor); - } - } - } - function ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, pullIntoDescriptor) { - ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten, pullIntoDescriptor); - if (pullIntoDescriptor.bytesFilled < pullIntoDescriptor.elementSize) { - return; - } - ReadableByteStreamControllerShiftPendingPullInto(controller); - var remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize; - if (remainderSize > 0) { - var end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled; - var remainder = ArrayBufferSlice(pullIntoDescriptor.buffer, end - remainderSize, end); - ReadableByteStreamControllerEnqueueChunkToQueue(controller, remainder, 0, remainder.byteLength); - } - pullIntoDescriptor.bytesFilled -= remainderSize; - ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor); - ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller); - } - function ReadableByteStreamControllerRespondInternal(controller, bytesWritten) { - var firstDescriptor = controller._pendingPullIntos.peek(); - ReadableByteStreamControllerInvalidateBYOBRequest(controller); - var state = controller._controlledReadableByteStream._state; - if (state === 'closed') { - ReadableByteStreamControllerRespondInClosedState(controller); - } - else { - ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor); - } - ReadableByteStreamControllerCallPullIfNeeded(controller); - } - function ReadableByteStreamControllerShiftPendingPullInto(controller) { - var descriptor = controller._pendingPullIntos.shift(); - return descriptor; - } - function ReadableByteStreamControllerShouldCallPull(controller) { - var stream = controller._controlledReadableByteStream; - if (stream._state !== 'readable') { - return false; - } - if (controller._closeRequested) { - return false; - } - if (!controller._started) { - return false; - } - if (ReadableStreamHasDefaultReader(stream) && ReadableStreamGetNumReadRequests(stream) > 0) { - return true; - } - if (ReadableStreamHasBYOBReader(stream) && ReadableStreamGetNumReadIntoRequests(stream) > 0) { - return true; - } - var desiredSize = ReadableByteStreamControllerGetDesiredSize(controller); - if (desiredSize > 0) { - return true; - } - return false; - } - function ReadableByteStreamControllerClearAlgorithms(controller) { - controller._pullAlgorithm = undefined; - controller._cancelAlgorithm = undefined; - } - // A client of ReadableByteStreamController may use these functions directly to bypass state check. - function ReadableByteStreamControllerClose(controller) { - var stream = controller._controlledReadableByteStream; - if (controller._closeRequested || stream._state !== 'readable') { - return; - } - if (controller._queueTotalSize > 0) { - controller._closeRequested = true; - return; - } - if (controller._pendingPullIntos.length > 0) { - var firstPendingPullInto = controller._pendingPullIntos.peek(); - if (firstPendingPullInto.bytesFilled > 0) { - var e = new TypeError('Insufficient bytes to fill elements in the given buffer'); - ReadableByteStreamControllerError(controller, e); - throw e; - } - } - ReadableByteStreamControllerClearAlgorithms(controller); - ReadableStreamClose(stream); - } - function ReadableByteStreamControllerEnqueue(controller, chunk) { - var stream = controller._controlledReadableByteStream; - if (controller._closeRequested || stream._state !== 'readable') { - return; - } - var buffer = chunk.buffer; - var byteOffset = chunk.byteOffset; - var byteLength = chunk.byteLength; - var transferredBuffer = TransferArrayBuffer(buffer); - if (controller._pendingPullIntos.length > 0) { - var firstPendingPullInto = controller._pendingPullIntos.peek(); - if (IsDetachedBuffer(firstPendingPullInto.buffer)) ; - firstPendingPullInto.buffer = TransferArrayBuffer(firstPendingPullInto.buffer); - } - ReadableByteStreamControllerInvalidateBYOBRequest(controller); - if (ReadableStreamHasDefaultReader(stream)) { - if (ReadableStreamGetNumReadRequests(stream) === 0) { - ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); - } - else { - if (controller._pendingPullIntos.length > 0) { - ReadableByteStreamControllerShiftPendingPullInto(controller); - } - var transferredView = new Uint8Array(transferredBuffer, byteOffset, byteLength); - ReadableStreamFulfillReadRequest(stream, transferredView, false); - } - } - else if (ReadableStreamHasBYOBReader(stream)) { - // TODO: Ideally in this branch detaching should happen only if the buffer is not consumed fully. - ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); - ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller); - } - else { - ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); - } - ReadableByteStreamControllerCallPullIfNeeded(controller); - } - function ReadableByteStreamControllerError(controller, e) { - var stream = controller._controlledReadableByteStream; - if (stream._state !== 'readable') { - return; - } - ReadableByteStreamControllerClearPendingPullIntos(controller); - ResetQueue(controller); - ReadableByteStreamControllerClearAlgorithms(controller); - ReadableStreamError(stream, e); - } - function ReadableByteStreamControllerGetBYOBRequest(controller) { - if (controller._byobRequest === null && controller._pendingPullIntos.length > 0) { - var firstDescriptor = controller._pendingPullIntos.peek(); - var view = new Uint8Array(firstDescriptor.buffer, firstDescriptor.byteOffset + firstDescriptor.bytesFilled, firstDescriptor.byteLength - firstDescriptor.bytesFilled); - var byobRequest = Object.create(ReadableStreamBYOBRequest.prototype); - SetUpReadableStreamBYOBRequest(byobRequest, controller, view); - controller._byobRequest = byobRequest; - } - return controller._byobRequest; - } - function ReadableByteStreamControllerGetDesiredSize(controller) { - var state = controller._controlledReadableByteStream._state; - if (state === 'errored') { - return null; - } - if (state === 'closed') { - return 0; - } - return controller._strategyHWM - controller._queueTotalSize; - } - function ReadableByteStreamControllerRespond(controller, bytesWritten) { - var firstDescriptor = controller._pendingPullIntos.peek(); - var state = controller._controlledReadableByteStream._state; - if (state === 'closed') { - if (bytesWritten !== 0) { - throw new TypeError('bytesWritten must be 0 when calling respond() on a closed stream'); - } - } - else { - if (bytesWritten === 0) { - throw new TypeError('bytesWritten must be greater than 0 when calling respond() on a readable stream'); - } - if (firstDescriptor.bytesFilled + bytesWritten > firstDescriptor.byteLength) { - throw new RangeError('bytesWritten out of range'); - } - } - firstDescriptor.buffer = TransferArrayBuffer(firstDescriptor.buffer); - ReadableByteStreamControllerRespondInternal(controller, bytesWritten); - } - function ReadableByteStreamControllerRespondWithNewView(controller, view) { - var firstDescriptor = controller._pendingPullIntos.peek(); - var state = controller._controlledReadableByteStream._state; - if (state === 'closed') { - if (view.byteLength !== 0) { - throw new TypeError('The view\'s length must be 0 when calling respondWithNewView() on a closed stream'); - } - } - else { - if (view.byteLength === 0) { - throw new TypeError('The view\'s length must be greater than 0 when calling respondWithNewView() on a readable stream'); - } - } - if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset) { - throw new RangeError('The region specified by view does not match byobRequest'); - } - if (firstDescriptor.bufferByteLength !== view.buffer.byteLength) { - throw new RangeError('The buffer of view has different capacity than byobRequest'); - } - if (firstDescriptor.bytesFilled + view.byteLength > firstDescriptor.byteLength) { - throw new RangeError('The region specified by view is larger than byobRequest'); - } - var viewByteLength = view.byteLength; - firstDescriptor.buffer = TransferArrayBuffer(view.buffer); - ReadableByteStreamControllerRespondInternal(controller, viewByteLength); - } - function SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize) { - controller._controlledReadableByteStream = stream; - controller._pullAgain = false; - controller._pulling = false; - controller._byobRequest = null; - // Need to set the slots so that the assert doesn't fire. In the spec the slots already exist implicitly. - controller._queue = controller._queueTotalSize = undefined; - ResetQueue(controller); - controller._closeRequested = false; - controller._started = false; - controller._strategyHWM = highWaterMark; - controller._pullAlgorithm = pullAlgorithm; - controller._cancelAlgorithm = cancelAlgorithm; - controller._autoAllocateChunkSize = autoAllocateChunkSize; - controller._pendingPullIntos = new SimpleQueue(); - stream._readableStreamController = controller; - var startResult = startAlgorithm(); - uponPromise(promiseResolvedWith(startResult), function () { - controller._started = true; - ReadableByteStreamControllerCallPullIfNeeded(controller); - }, function (r) { - ReadableByteStreamControllerError(controller, r); - }); - } - function SetUpReadableByteStreamControllerFromUnderlyingSource(stream, underlyingByteSource, highWaterMark) { - var controller = Object.create(ReadableByteStreamController.prototype); - var startAlgorithm = function () { return undefined; }; - var pullAlgorithm = function () { return promiseResolvedWith(undefined); }; - var cancelAlgorithm = function () { return promiseResolvedWith(undefined); }; - if (underlyingByteSource.start !== undefined) { - startAlgorithm = function () { return underlyingByteSource.start(controller); }; - } - if (underlyingByteSource.pull !== undefined) { - pullAlgorithm = function () { return underlyingByteSource.pull(controller); }; - } - if (underlyingByteSource.cancel !== undefined) { - cancelAlgorithm = function (reason) { return underlyingByteSource.cancel(reason); }; - } - var autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize; - if (autoAllocateChunkSize === 0) { - throw new TypeError('autoAllocateChunkSize must be greater than 0'); - } - SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize); - } - function SetUpReadableStreamBYOBRequest(request, controller, view) { - request._associatedReadableByteStreamController = controller; - request._view = view; - } - // Helper functions for the ReadableStreamBYOBRequest. - function byobRequestBrandCheckException(name) { - return new TypeError("ReadableStreamBYOBRequest.prototype." + name + " can only be used on a ReadableStreamBYOBRequest"); - } - // Helper functions for the ReadableByteStreamController. - function byteStreamControllerBrandCheckException(name) { - return new TypeError("ReadableByteStreamController.prototype." + name + " can only be used on a ReadableByteStreamController"); - } + get entries () { + const headers = {} - // Abstract operations for the ReadableStream. - function AcquireReadableStreamBYOBReader(stream) { - return new ReadableStreamBYOBReader(stream); - } - // ReadableStream API exposed for controllers. - function ReadableStreamAddReadIntoRequest(stream, readIntoRequest) { - stream._reader._readIntoRequests.push(readIntoRequest); - } - function ReadableStreamFulfillReadIntoRequest(stream, chunk, done) { - var reader = stream._reader; - var readIntoRequest = reader._readIntoRequests.shift(); - if (done) { - readIntoRequest._closeSteps(chunk); - } - else { - readIntoRequest._chunkSteps(chunk); - } - } - function ReadableStreamGetNumReadIntoRequests(stream) { - return stream._reader._readIntoRequests.length; - } - function ReadableStreamHasBYOBReader(stream) { - var reader = stream._reader; - if (reader === undefined) { - return false; - } - if (!IsReadableStreamBYOBReader(reader)) { - return false; - } - return true; - } - /** - * A BYOB reader vended by a {@link ReadableStream}. - * - * @public - */ - var ReadableStreamBYOBReader = /** @class */ (function () { - function ReadableStreamBYOBReader(stream) { - assertRequiredArgument(stream, 1, 'ReadableStreamBYOBReader'); - assertReadableStream(stream, 'First parameter'); - if (IsReadableStreamLocked(stream)) { - throw new TypeError('This stream has already been locked for exclusive reading by another reader'); - } - if (!IsReadableByteStreamController(stream._readableStreamController)) { - throw new TypeError('Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte ' + - 'source'); - } - ReadableStreamReaderGenericInitialize(this, stream); - this._readIntoRequests = new SimpleQueue(); - } - Object.defineProperty(ReadableStreamBYOBReader.prototype, "closed", { - /** - * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or - * the reader's lock is released before the stream finishes closing. - */ - get: function () { - if (!IsReadableStreamBYOBReader(this)) { - return promiseRejectedWith(byobReaderBrandCheckException('closed')); - } - return this._closedPromise; - }, - enumerable: false, - configurable: true - }); - /** - * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}. - */ - ReadableStreamBYOBReader.prototype.cancel = function (reason) { - if (reason === void 0) { reason = undefined; } - if (!IsReadableStreamBYOBReader(this)) { - return promiseRejectedWith(byobReaderBrandCheckException('cancel')); - } - if (this._ownerReadableStream === undefined) { - return promiseRejectedWith(readerLockException('cancel')); - } - return ReadableStreamReaderGenericCancel(this, reason); - }; - /** - * Attempts to reads bytes into view, and returns a promise resolved with the result. - * - * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source. - */ - ReadableStreamBYOBReader.prototype.read = function (view) { - if (!IsReadableStreamBYOBReader(this)) { - return promiseRejectedWith(byobReaderBrandCheckException('read')); - } - if (!ArrayBuffer.isView(view)) { - return promiseRejectedWith(new TypeError('view must be an array buffer view')); - } - if (view.byteLength === 0) { - return promiseRejectedWith(new TypeError('view must have non-zero byteLength')); - } - if (view.buffer.byteLength === 0) { - return promiseRejectedWith(new TypeError("view's buffer must have non-zero byteLength")); - } - if (IsDetachedBuffer(view.buffer)) ; - if (this._ownerReadableStream === undefined) { - return promiseRejectedWith(readerLockException('read from')); - } - var resolvePromise; - var rejectPromise; - var promise = newPromise(function (resolve, reject) { - resolvePromise = resolve; - rejectPromise = reject; - }); - var readIntoRequest = { - _chunkSteps: function (chunk) { return resolvePromise({ value: chunk, done: false }); }, - _closeSteps: function (chunk) { return resolvePromise({ value: chunk, done: true }); }, - _errorSteps: function (e) { return rejectPromise(e); } - }; - ReadableStreamBYOBReaderRead(this, view, readIntoRequest); - return promise; - }; - /** - * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active. - * If the associated stream is errored when the lock is released, the reader will appear errored in the same way - * from now on; otherwise, the reader will appear closed. - * - * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by - * the reader's {@link ReadableStreamBYOBReader.read | read()} method has not yet been settled. Attempting to - * do so will throw a `TypeError` and leave the reader locked to the stream. - */ - ReadableStreamBYOBReader.prototype.releaseLock = function () { - if (!IsReadableStreamBYOBReader(this)) { - throw byobReaderBrandCheckException('releaseLock'); - } - if (this._ownerReadableStream === undefined) { - return; - } - if (this._readIntoRequests.length > 0) { - throw new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled'); - } - ReadableStreamReaderGenericRelease(this); - }; - return ReadableStreamBYOBReader; - }()); - Object.defineProperties(ReadableStreamBYOBReader.prototype, { - cancel: { enumerable: true }, - read: { enumerable: true }, - releaseLock: { enumerable: true }, - closed: { enumerable: true } - }); - if (typeof SymbolPolyfill.toStringTag === 'symbol') { - Object.defineProperty(ReadableStreamBYOBReader.prototype, SymbolPolyfill.toStringTag, { - value: 'ReadableStreamBYOBReader', - configurable: true - }); - } - // Abstract operations for the readers. - function IsReadableStreamBYOBReader(x) { - if (!typeIsObject(x)) { - return false; - } - if (!Object.prototype.hasOwnProperty.call(x, '_readIntoRequests')) { - return false; - } - return x instanceof ReadableStreamBYOBReader; - } - function ReadableStreamBYOBReaderRead(reader, view, readIntoRequest) { - var stream = reader._ownerReadableStream; - stream._disturbed = true; - if (stream._state === 'errored') { - readIntoRequest._errorSteps(stream._storedError); - } - else { - ReadableByteStreamControllerPullInto(stream._readableStreamController, view, readIntoRequest); - } - } - // Helper functions for the ReadableStreamBYOBReader. - function byobReaderBrandCheckException(name) { - return new TypeError("ReadableStreamBYOBReader.prototype." + name + " can only be used on a ReadableStreamBYOBReader"); + if (this[kHeadersMap].size) { + for (const { name, value } of this[kHeadersMap].values()) { + headers[name] = value + } } - function ExtractHighWaterMark(strategy, defaultHWM) { - var highWaterMark = strategy.highWaterMark; - if (highWaterMark === undefined) { - return defaultHWM; - } - if (NumberIsNaN(highWaterMark) || highWaterMark < 0) { - throw new RangeError('Invalid highWaterMark'); - } - return highWaterMark; - } - function ExtractSizeAlgorithm(strategy) { - var size = strategy.size; - if (!size) { - return function () { return 1; }; - } - return size; - } + return headers + } +} - function convertQueuingStrategy(init, context) { - assertDictionary(init, context); - var highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark; - var size = init === null || init === void 0 ? void 0 : init.size; - return { - highWaterMark: highWaterMark === undefined ? undefined : convertUnrestrictedDouble(highWaterMark), - size: size === undefined ? undefined : convertQueuingStrategySize(size, context + " has member 'size' that") - }; - } - function convertQueuingStrategySize(fn, context) { - assertFunction(fn, context); - return function (chunk) { return convertUnrestrictedDouble(fn(chunk)); }; +// https://fetch.spec.whatwg.org/#headers-class +class Headers { + constructor (init = undefined) { + if (init === kConstruct) { + return } + this[kHeadersList] = new HeadersList() - function convertUnderlyingSink(original, context) { - assertDictionary(original, context); - var abort = original === null || original === void 0 ? void 0 : original.abort; - var close = original === null || original === void 0 ? void 0 : original.close; - var start = original === null || original === void 0 ? void 0 : original.start; - var type = original === null || original === void 0 ? void 0 : original.type; - var write = original === null || original === void 0 ? void 0 : original.write; - return { - abort: abort === undefined ? - undefined : - convertUnderlyingSinkAbortCallback(abort, original, context + " has member 'abort' that"), - close: close === undefined ? - undefined : - convertUnderlyingSinkCloseCallback(close, original, context + " has member 'close' that"), - start: start === undefined ? - undefined : - convertUnderlyingSinkStartCallback(start, original, context + " has member 'start' that"), - write: write === undefined ? - undefined : - convertUnderlyingSinkWriteCallback(write, original, context + " has member 'write' that"), - type: type - }; - } - function convertUnderlyingSinkAbortCallback(fn, original, context) { - assertFunction(fn, context); - return function (reason) { return promiseCall(fn, original, [reason]); }; - } - function convertUnderlyingSinkCloseCallback(fn, original, context) { - assertFunction(fn, context); - return function () { return promiseCall(fn, original, []); }; - } - function convertUnderlyingSinkStartCallback(fn, original, context) { - assertFunction(fn, context); - return function (controller) { return reflectCall(fn, original, [controller]); }; - } - function convertUnderlyingSinkWriteCallback(fn, original, context) { - assertFunction(fn, context); - return function (chunk, controller) { return promiseCall(fn, original, [chunk, controller]); }; - } + // The new Headers(init) constructor steps are: - function assertWritableStream(x, context) { - if (!IsWritableStream(x)) { - throw new TypeError(context + " is not a WritableStream."); - } - } + // 1. Set this’s guard to "none". + this[kGuard] = 'none' - function isAbortSignal(value) { - if (typeof value !== 'object' || value === null) { - return false; - } - try { - return typeof value.aborted === 'boolean'; - } - catch (_a) { - // AbortSignal.prototype.aborted throws if its brand check fails - return false; - } - } - var supportsAbortController = typeof AbortController === 'function'; - /** - * Construct a new AbortController, if supported by the platform. - * - * @internal - */ - function createAbortController() { - if (supportsAbortController) { - return new AbortController(); - } - return undefined; + // 2. If init is given, then fill this with init. + if (init !== undefined) { + init = webidl.converters.HeadersInit(init) + fill(this, init) } + } - /** - * A writable stream represents a destination for data, into which you can write. - * - * @public - */ - var WritableStream = /** @class */ (function () { - function WritableStream(rawUnderlyingSink, rawStrategy) { - if (rawUnderlyingSink === void 0) { rawUnderlyingSink = {}; } - if (rawStrategy === void 0) { rawStrategy = {}; } - if (rawUnderlyingSink === undefined) { - rawUnderlyingSink = null; - } - else { - assertObject(rawUnderlyingSink, 'First parameter'); - } - var strategy = convertQueuingStrategy(rawStrategy, 'Second parameter'); - var underlyingSink = convertUnderlyingSink(rawUnderlyingSink, 'First parameter'); - InitializeWritableStream(this); - var type = underlyingSink.type; - if (type !== undefined) { - throw new RangeError('Invalid type is specified'); - } - var sizeAlgorithm = ExtractSizeAlgorithm(strategy); - var highWaterMark = ExtractHighWaterMark(strategy, 1); - SetUpWritableStreamDefaultControllerFromUnderlyingSink(this, underlyingSink, highWaterMark, sizeAlgorithm); - } - Object.defineProperty(WritableStream.prototype, "locked", { - /** - * Returns whether or not the writable stream is locked to a writer. - */ - get: function () { - if (!IsWritableStream(this)) { - throw streamBrandCheckException$2('locked'); - } - return IsWritableStreamLocked(this); - }, - enumerable: false, - configurable: true - }); - /** - * Aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be - * immediately moved to an errored state, with any queued-up writes discarded. This will also execute any abort - * mechanism of the underlying sink. - * - * The returned promise will fulfill if the stream shuts down successfully, or reject if the underlying sink signaled - * that there was an error doing so. Additionally, it will reject with a `TypeError` (without attempting to cancel - * the stream) if the stream is currently locked. - */ - WritableStream.prototype.abort = function (reason) { - if (reason === void 0) { reason = undefined; } - if (!IsWritableStream(this)) { - return promiseRejectedWith(streamBrandCheckException$2('abort')); - } - if (IsWritableStreamLocked(this)) { - return promiseRejectedWith(new TypeError('Cannot abort a stream that already has a writer')); - } - return WritableStreamAbort(this, reason); - }; - /** - * Closes the stream. The underlying sink will finish processing any previously-written chunks, before invoking its - * close behavior. During this time any further attempts to write will fail (without erroring the stream). - * - * The method returns a promise that will fulfill if all remaining chunks are successfully written and the stream - * successfully closes, or rejects if an error is encountered during this process. Additionally, it will reject with - * a `TypeError` (without attempting to cancel the stream) if the stream is currently locked. - */ - WritableStream.prototype.close = function () { - if (!IsWritableStream(this)) { - return promiseRejectedWith(streamBrandCheckException$2('close')); - } - if (IsWritableStreamLocked(this)) { - return promiseRejectedWith(new TypeError('Cannot close a stream that already has a writer')); - } - if (WritableStreamCloseQueuedOrInFlight(this)) { - return promiseRejectedWith(new TypeError('Cannot close an already-closing stream')); - } - return WritableStreamClose(this); - }; - /** - * Creates a {@link WritableStreamDefaultWriter | writer} and locks the stream to the new writer. While the stream - * is locked, no other writer can be acquired until this one is released. - * - * This functionality is especially useful for creating abstractions that desire the ability to write to a stream - * without interruption or interleaving. By getting a writer for the stream, you can ensure nobody else can write at - * the same time, which would cause the resulting written data to be unpredictable and probably useless. - */ - WritableStream.prototype.getWriter = function () { - if (!IsWritableStream(this)) { - throw streamBrandCheckException$2('getWriter'); - } - return AcquireWritableStreamDefaultWriter(this); - }; - return WritableStream; - }()); - Object.defineProperties(WritableStream.prototype, { - abort: { enumerable: true }, - close: { enumerable: true }, - getWriter: { enumerable: true }, - locked: { enumerable: true } - }); - if (typeof SymbolPolyfill.toStringTag === 'symbol') { - Object.defineProperty(WritableStream.prototype, SymbolPolyfill.toStringTag, { - value: 'WritableStream', - configurable: true - }); - } - // Abstract operations for the WritableStream. - function AcquireWritableStreamDefaultWriter(stream) { - return new WritableStreamDefaultWriter(stream); - } - // Throws if and only if startAlgorithm throws. - function CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) { - if (highWaterMark === void 0) { highWaterMark = 1; } - if (sizeAlgorithm === void 0) { sizeAlgorithm = function () { return 1; }; } - var stream = Object.create(WritableStream.prototype); - InitializeWritableStream(stream); - var controller = Object.create(WritableStreamDefaultController.prototype); - SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm); - return stream; - } - function InitializeWritableStream(stream) { - stream._state = 'writable'; - // The error that will be reported by new method calls once the state becomes errored. Only set when [[state]] is - // 'erroring' or 'errored'. May be set to an undefined value. - stream._storedError = undefined; - stream._writer = undefined; - // Initialize to undefined first because the constructor of the controller checks this - // variable to validate the caller. - stream._writableStreamController = undefined; - // This queue is placed here instead of the writer class in order to allow for passing a writer to the next data - // producer without waiting for the queued writes to finish. - stream._writeRequests = new SimpleQueue(); - // Write requests are removed from _writeRequests when write() is called on the underlying sink. This prevents - // them from being erroneously rejected on error. If a write() call is in-flight, the request is stored here. - stream._inFlightWriteRequest = undefined; - // The promise that was returned from writer.close(). Stored here because it may be fulfilled after the writer - // has been detached. - stream._closeRequest = undefined; - // Close request is removed from _closeRequest when close() is called on the underlying sink. This prevents it - // from being erroneously rejected on error. If a close() call is in-flight, the request is stored here. - stream._inFlightCloseRequest = undefined; - // The promise that was returned from writer.abort(). This may also be fulfilled after the writer has detached. - stream._pendingAbortRequest = undefined; - // The backpressure signal set by the controller. - stream._backpressure = false; - } - function IsWritableStream(x) { - if (!typeIsObject(x)) { - return false; - } - if (!Object.prototype.hasOwnProperty.call(x, '_writableStreamController')) { - return false; - } - return x instanceof WritableStream; - } - function IsWritableStreamLocked(stream) { - if (stream._writer === undefined) { - return false; - } - return true; - } - function WritableStreamAbort(stream, reason) { - var _a; - if (stream._state === 'closed' || stream._state === 'errored') { - return promiseResolvedWith(undefined); - } - stream._writableStreamController._abortReason = reason; - (_a = stream._writableStreamController._abortController) === null || _a === void 0 ? void 0 : _a.abort(); - // TypeScript narrows the type of `stream._state` down to 'writable' | 'erroring', - // but it doesn't know that signaling abort runs author code that might have changed the state. - // Widen the type again by casting to WritableStreamState. - var state = stream._state; - if (state === 'closed' || state === 'errored') { - return promiseResolvedWith(undefined); - } - if (stream._pendingAbortRequest !== undefined) { - return stream._pendingAbortRequest._promise; - } - var wasAlreadyErroring = false; - if (state === 'erroring') { - wasAlreadyErroring = true; - // reason will not be used, so don't keep a reference to it. - reason = undefined; - } - var promise = newPromise(function (resolve, reject) { - stream._pendingAbortRequest = { - _promise: undefined, - _resolve: resolve, - _reject: reject, - _reason: reason, - _wasAlreadyErroring: wasAlreadyErroring - }; - }); - stream._pendingAbortRequest._promise = promise; - if (!wasAlreadyErroring) { - WritableStreamStartErroring(stream, reason); - } - return promise; - } - function WritableStreamClose(stream) { - var state = stream._state; - if (state === 'closed' || state === 'errored') { - return promiseRejectedWith(new TypeError("The stream (in " + state + " state) is not in the writable state and cannot be closed")); - } - var promise = newPromise(function (resolve, reject) { - var closeRequest = { - _resolve: resolve, - _reject: reject - }; - stream._closeRequest = closeRequest; - }); - var writer = stream._writer; - if (writer !== undefined && stream._backpressure && state === 'writable') { - defaultWriterReadyPromiseResolve(writer); - } - WritableStreamDefaultControllerClose(stream._writableStreamController); - return promise; - } - // WritableStream API exposed for controllers. - function WritableStreamAddWriteRequest(stream) { - var promise = newPromise(function (resolve, reject) { - var writeRequest = { - _resolve: resolve, - _reject: reject - }; - stream._writeRequests.push(writeRequest); - }); - return promise; - } - function WritableStreamDealWithRejection(stream, error) { - var state = stream._state; - if (state === 'writable') { - WritableStreamStartErroring(stream, error); - return; - } - WritableStreamFinishErroring(stream); - } - function WritableStreamStartErroring(stream, reason) { - var controller = stream._writableStreamController; - stream._state = 'erroring'; - stream._storedError = reason; - var writer = stream._writer; - if (writer !== undefined) { - WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason); - } - if (!WritableStreamHasOperationMarkedInFlight(stream) && controller._started) { - WritableStreamFinishErroring(stream); - } - } - function WritableStreamFinishErroring(stream) { - stream._state = 'errored'; - stream._writableStreamController[ErrorSteps](); - var storedError = stream._storedError; - stream._writeRequests.forEach(function (writeRequest) { - writeRequest._reject(storedError); - }); - stream._writeRequests = new SimpleQueue(); - if (stream._pendingAbortRequest === undefined) { - WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); - return; - } - var abortRequest = stream._pendingAbortRequest; - stream._pendingAbortRequest = undefined; - if (abortRequest._wasAlreadyErroring) { - abortRequest._reject(storedError); - WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); - return; - } - var promise = stream._writableStreamController[AbortSteps](abortRequest._reason); - uponPromise(promise, function () { - abortRequest._resolve(); - WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); - }, function (reason) { - abortRequest._reject(reason); - WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); - }); - } - function WritableStreamFinishInFlightWrite(stream) { - stream._inFlightWriteRequest._resolve(undefined); - stream._inFlightWriteRequest = undefined; - } - function WritableStreamFinishInFlightWriteWithError(stream, error) { - stream._inFlightWriteRequest._reject(error); - stream._inFlightWriteRequest = undefined; - WritableStreamDealWithRejection(stream, error); - } - function WritableStreamFinishInFlightClose(stream) { - stream._inFlightCloseRequest._resolve(undefined); - stream._inFlightCloseRequest = undefined; - var state = stream._state; - if (state === 'erroring') { - // The error was too late to do anything, so it is ignored. - stream._storedError = undefined; - if (stream._pendingAbortRequest !== undefined) { - stream._pendingAbortRequest._resolve(); - stream._pendingAbortRequest = undefined; - } - } - stream._state = 'closed'; - var writer = stream._writer; - if (writer !== undefined) { - defaultWriterClosedPromiseResolve(writer); - } - } - function WritableStreamFinishInFlightCloseWithError(stream, error) { - stream._inFlightCloseRequest._reject(error); - stream._inFlightCloseRequest = undefined; - // Never execute sink abort() after sink close(). - if (stream._pendingAbortRequest !== undefined) { - stream._pendingAbortRequest._reject(error); - stream._pendingAbortRequest = undefined; - } - WritableStreamDealWithRejection(stream, error); - } - // TODO(ricea): Fix alphabetical order. - function WritableStreamCloseQueuedOrInFlight(stream) { - if (stream._closeRequest === undefined && stream._inFlightCloseRequest === undefined) { - return false; - } - return true; - } - function WritableStreamHasOperationMarkedInFlight(stream) { - if (stream._inFlightWriteRequest === undefined && stream._inFlightCloseRequest === undefined) { - return false; - } - return true; - } - function WritableStreamMarkCloseRequestInFlight(stream) { - stream._inFlightCloseRequest = stream._closeRequest; - stream._closeRequest = undefined; - } - function WritableStreamMarkFirstWriteRequestInFlight(stream) { - stream._inFlightWriteRequest = stream._writeRequests.shift(); - } - function WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream) { - if (stream._closeRequest !== undefined) { - stream._closeRequest._reject(stream._storedError); - stream._closeRequest = undefined; - } - var writer = stream._writer; - if (writer !== undefined) { - defaultWriterClosedPromiseReject(writer, stream._storedError); - } - } - function WritableStreamUpdateBackpressure(stream, backpressure) { - var writer = stream._writer; - if (writer !== undefined && backpressure !== stream._backpressure) { - if (backpressure) { - defaultWriterReadyPromiseReset(writer); - } - else { - defaultWriterReadyPromiseResolve(writer); - } - } - stream._backpressure = backpressure; - } - /** - * A default writer vended by a {@link WritableStream}. - * - * @public - */ - var WritableStreamDefaultWriter = /** @class */ (function () { - function WritableStreamDefaultWriter(stream) { - assertRequiredArgument(stream, 1, 'WritableStreamDefaultWriter'); - assertWritableStream(stream, 'First parameter'); - if (IsWritableStreamLocked(stream)) { - throw new TypeError('This stream has already been locked for exclusive writing by another writer'); - } - this._ownerWritableStream = stream; - stream._writer = this; - var state = stream._state; - if (state === 'writable') { - if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._backpressure) { - defaultWriterReadyPromiseInitialize(this); - } - else { - defaultWriterReadyPromiseInitializeAsResolved(this); - } - defaultWriterClosedPromiseInitialize(this); - } - else if (state === 'erroring') { - defaultWriterReadyPromiseInitializeAsRejected(this, stream._storedError); - defaultWriterClosedPromiseInitialize(this); - } - else if (state === 'closed') { - defaultWriterReadyPromiseInitializeAsResolved(this); - defaultWriterClosedPromiseInitializeAsResolved(this); - } - else { - var storedError = stream._storedError; - defaultWriterReadyPromiseInitializeAsRejected(this, storedError); - defaultWriterClosedPromiseInitializeAsRejected(this, storedError); - } - } - Object.defineProperty(WritableStreamDefaultWriter.prototype, "closed", { - /** - * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or - * the writer’s lock is released before the stream finishes closing. - */ - get: function () { - if (!IsWritableStreamDefaultWriter(this)) { - return promiseRejectedWith(defaultWriterBrandCheckException('closed')); - } - return this._closedPromise; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(WritableStreamDefaultWriter.prototype, "desiredSize", { - /** - * Returns the desired size to fill the stream’s internal queue. It can be negative, if the queue is over-full. - * A producer can use this information to determine the right amount of data to write. - * - * It will be `null` if the stream cannot be successfully written to (due to either being errored, or having an abort - * queued up). It will return zero if the stream is closed. And the getter will throw an exception if invoked when - * the writer’s lock is released. - */ - get: function () { - if (!IsWritableStreamDefaultWriter(this)) { - throw defaultWriterBrandCheckException('desiredSize'); - } - if (this._ownerWritableStream === undefined) { - throw defaultWriterLockException('desiredSize'); - } - return WritableStreamDefaultWriterGetDesiredSize(this); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(WritableStreamDefaultWriter.prototype, "ready", { - /** - * Returns a promise that will be fulfilled when the desired size to fill the stream’s internal queue transitions - * from non-positive to positive, signaling that it is no longer applying backpressure. Once the desired size dips - * back to zero or below, the getter will return a new promise that stays pending until the next transition. - * - * If the stream becomes errored or aborted, or the writer’s lock is released, the returned promise will become - * rejected. - */ - get: function () { - if (!IsWritableStreamDefaultWriter(this)) { - return promiseRejectedWith(defaultWriterBrandCheckException('ready')); - } - return this._readyPromise; - }, - enumerable: false, - configurable: true - }); - /** - * If the reader is active, behaves the same as {@link WritableStream.abort | stream.abort(reason)}. - */ - WritableStreamDefaultWriter.prototype.abort = function (reason) { - if (reason === void 0) { reason = undefined; } - if (!IsWritableStreamDefaultWriter(this)) { - return promiseRejectedWith(defaultWriterBrandCheckException('abort')); - } - if (this._ownerWritableStream === undefined) { - return promiseRejectedWith(defaultWriterLockException('abort')); - } - return WritableStreamDefaultWriterAbort(this, reason); - }; - /** - * If the reader is active, behaves the same as {@link WritableStream.close | stream.close()}. - */ - WritableStreamDefaultWriter.prototype.close = function () { - if (!IsWritableStreamDefaultWriter(this)) { - return promiseRejectedWith(defaultWriterBrandCheckException('close')); - } - var stream = this._ownerWritableStream; - if (stream === undefined) { - return promiseRejectedWith(defaultWriterLockException('close')); - } - if (WritableStreamCloseQueuedOrInFlight(stream)) { - return promiseRejectedWith(new TypeError('Cannot close an already-closing stream')); - } - return WritableStreamDefaultWriterClose(this); - }; - /** - * Releases the writer’s lock on the corresponding stream. After the lock is released, the writer is no longer active. - * If the associated stream is errored when the lock is released, the writer will appear errored in the same way from - * now on; otherwise, the writer will appear closed. - * - * Note that the lock can still be released even if some ongoing writes have not yet finished (i.e. even if the - * promises returned from previous calls to {@link WritableStreamDefaultWriter.write | write()} have not yet settled). - * It’s not necessary to hold the lock on the writer for the duration of the write; the lock instead simply prevents - * other producers from writing in an interleaved manner. - */ - WritableStreamDefaultWriter.prototype.releaseLock = function () { - if (!IsWritableStreamDefaultWriter(this)) { - throw defaultWriterBrandCheckException('releaseLock'); - } - var stream = this._ownerWritableStream; - if (stream === undefined) { - return; - } - WritableStreamDefaultWriterRelease(this); - }; - WritableStreamDefaultWriter.prototype.write = function (chunk) { - if (chunk === void 0) { chunk = undefined; } - if (!IsWritableStreamDefaultWriter(this)) { - return promiseRejectedWith(defaultWriterBrandCheckException('write')); - } - if (this._ownerWritableStream === undefined) { - return promiseRejectedWith(defaultWriterLockException('write to')); - } - return WritableStreamDefaultWriterWrite(this, chunk); - }; - return WritableStreamDefaultWriter; - }()); - Object.defineProperties(WritableStreamDefaultWriter.prototype, { - abort: { enumerable: true }, - close: { enumerable: true }, - releaseLock: { enumerable: true }, - write: { enumerable: true }, - closed: { enumerable: true }, - desiredSize: { enumerable: true }, - ready: { enumerable: true } - }); - if (typeof SymbolPolyfill.toStringTag === 'symbol') { - Object.defineProperty(WritableStreamDefaultWriter.prototype, SymbolPolyfill.toStringTag, { - value: 'WritableStreamDefaultWriter', - configurable: true - }); - } - // Abstract operations for the WritableStreamDefaultWriter. - function IsWritableStreamDefaultWriter(x) { - if (!typeIsObject(x)) { - return false; - } - if (!Object.prototype.hasOwnProperty.call(x, '_ownerWritableStream')) { - return false; - } - return x instanceof WritableStreamDefaultWriter; - } - // A client of WritableStreamDefaultWriter may use these functions directly to bypass state check. - function WritableStreamDefaultWriterAbort(writer, reason) { - var stream = writer._ownerWritableStream; - return WritableStreamAbort(stream, reason); - } - function WritableStreamDefaultWriterClose(writer) { - var stream = writer._ownerWritableStream; - return WritableStreamClose(stream); - } - function WritableStreamDefaultWriterCloseWithErrorPropagation(writer) { - var stream = writer._ownerWritableStream; - var state = stream._state; - if (WritableStreamCloseQueuedOrInFlight(stream) || state === 'closed') { - return promiseResolvedWith(undefined); - } - if (state === 'errored') { - return promiseRejectedWith(stream._storedError); - } - return WritableStreamDefaultWriterClose(writer); - } - function WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, error) { - if (writer._closedPromiseState === 'pending') { - defaultWriterClosedPromiseReject(writer, error); - } - else { - defaultWriterClosedPromiseResetToRejected(writer, error); - } - } - function WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, error) { - if (writer._readyPromiseState === 'pending') { - defaultWriterReadyPromiseReject(writer, error); - } - else { - defaultWriterReadyPromiseResetToRejected(writer, error); - } - } - function WritableStreamDefaultWriterGetDesiredSize(writer) { - var stream = writer._ownerWritableStream; - var state = stream._state; - if (state === 'errored' || state === 'erroring') { - return null; - } - if (state === 'closed') { - return 0; - } - return WritableStreamDefaultControllerGetDesiredSize(stream._writableStreamController); - } - function WritableStreamDefaultWriterRelease(writer) { - var stream = writer._ownerWritableStream; - var releasedError = new TypeError("Writer was released and can no longer be used to monitor the stream's closedness"); - WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError); - // The state transitions to "errored" before the sink abort() method runs, but the writer.closed promise is not - // rejected until afterwards. This means that simply testing state will not work. - WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError); - stream._writer = undefined; - writer._ownerWritableStream = undefined; - } - function WritableStreamDefaultWriterWrite(writer, chunk) { - var stream = writer._ownerWritableStream; - var controller = stream._writableStreamController; - var chunkSize = WritableStreamDefaultControllerGetChunkSize(controller, chunk); - if (stream !== writer._ownerWritableStream) { - return promiseRejectedWith(defaultWriterLockException('write to')); - } - var state = stream._state; - if (state === 'errored') { - return promiseRejectedWith(stream._storedError); - } - if (WritableStreamCloseQueuedOrInFlight(stream) || state === 'closed') { - return promiseRejectedWith(new TypeError('The stream is closing or closed and cannot be written to')); - } - if (state === 'erroring') { - return promiseRejectedWith(stream._storedError); - } - var promise = WritableStreamAddWriteRequest(stream); - WritableStreamDefaultControllerWrite(controller, chunk, chunkSize); - return promise; - } - var closeSentinel = {}; - /** - * Allows control of a {@link WritableStream | writable stream}'s state and internal queue. - * - * @public - */ - var WritableStreamDefaultController = /** @class */ (function () { - function WritableStreamDefaultController() { - throw new TypeError('Illegal constructor'); - } - Object.defineProperty(WritableStreamDefaultController.prototype, "abortReason", { - /** - * The reason which was passed to `WritableStream.abort(reason)` when the stream was aborted. - * - * @deprecated - * This property has been removed from the specification, see https://github.com/whatwg/streams/pull/1177. - * Use {@link WritableStreamDefaultController.signal}'s `reason` instead. - */ - get: function () { - if (!IsWritableStreamDefaultController(this)) { - throw defaultControllerBrandCheckException$2('abortReason'); - } - return this._abortReason; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(WritableStreamDefaultController.prototype, "signal", { - /** - * An `AbortSignal` that can be used to abort the pending write or close operation when the stream is aborted. - */ - get: function () { - if (!IsWritableStreamDefaultController(this)) { - throw defaultControllerBrandCheckException$2('signal'); - } - if (this._abortController === undefined) { - // Older browsers or older Node versions may not support `AbortController` or `AbortSignal`. - // We don't want to bundle and ship an `AbortController` polyfill together with our polyfill, - // so instead we only implement support for `signal` if we find a global `AbortController` constructor. - throw new TypeError('WritableStreamDefaultController.prototype.signal is not supported'); - } - return this._abortController.signal; - }, - enumerable: false, - configurable: true - }); - /** - * Closes the controlled writable stream, making all future interactions with it fail with the given error `e`. - * - * This method is rarely used, since usually it suffices to return a rejected promise from one of the underlying - * sink's methods. However, it can be useful for suddenly shutting down a stream in response to an event outside the - * normal lifecycle of interactions with the underlying sink. - */ - WritableStreamDefaultController.prototype.error = function (e) { - if (e === void 0) { e = undefined; } - if (!IsWritableStreamDefaultController(this)) { - throw defaultControllerBrandCheckException$2('error'); - } - var state = this._controlledWritableStream._state; - if (state !== 'writable') { - // The stream is closed, errored or will be soon. The sink can't do anything useful if it gets an error here, so - // just treat it as a no-op. - return; - } - WritableStreamDefaultControllerError(this, e); - }; - /** @internal */ - WritableStreamDefaultController.prototype[AbortSteps] = function (reason) { - var result = this._abortAlgorithm(reason); - WritableStreamDefaultControllerClearAlgorithms(this); - return result; - }; - /** @internal */ - WritableStreamDefaultController.prototype[ErrorSteps] = function () { - ResetQueue(this); - }; - return WritableStreamDefaultController; - }()); - Object.defineProperties(WritableStreamDefaultController.prototype, { - abortReason: { enumerable: true }, - signal: { enumerable: true }, - error: { enumerable: true } - }); - if (typeof SymbolPolyfill.toStringTag === 'symbol') { - Object.defineProperty(WritableStreamDefaultController.prototype, SymbolPolyfill.toStringTag, { - value: 'WritableStreamDefaultController', - configurable: true - }); - } - // Abstract operations implementing interface required by the WritableStream. - function IsWritableStreamDefaultController(x) { - if (!typeIsObject(x)) { - return false; - } - if (!Object.prototype.hasOwnProperty.call(x, '_controlledWritableStream')) { - return false; - } - return x instanceof WritableStreamDefaultController; - } - function SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) { - controller._controlledWritableStream = stream; - stream._writableStreamController = controller; - // Need to set the slots so that the assert doesn't fire. In the spec the slots already exist implicitly. - controller._queue = undefined; - controller._queueTotalSize = undefined; - ResetQueue(controller); - controller._abortReason = undefined; - controller._abortController = createAbortController(); - controller._started = false; - controller._strategySizeAlgorithm = sizeAlgorithm; - controller._strategyHWM = highWaterMark; - controller._writeAlgorithm = writeAlgorithm; - controller._closeAlgorithm = closeAlgorithm; - controller._abortAlgorithm = abortAlgorithm; - var backpressure = WritableStreamDefaultControllerGetBackpressure(controller); - WritableStreamUpdateBackpressure(stream, backpressure); - var startResult = startAlgorithm(); - var startPromise = promiseResolvedWith(startResult); - uponPromise(startPromise, function () { - controller._started = true; - WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); - }, function (r) { - controller._started = true; - WritableStreamDealWithRejection(stream, r); - }); - } - function SetUpWritableStreamDefaultControllerFromUnderlyingSink(stream, underlyingSink, highWaterMark, sizeAlgorithm) { - var controller = Object.create(WritableStreamDefaultController.prototype); - var startAlgorithm = function () { return undefined; }; - var writeAlgorithm = function () { return promiseResolvedWith(undefined); }; - var closeAlgorithm = function () { return promiseResolvedWith(undefined); }; - var abortAlgorithm = function () { return promiseResolvedWith(undefined); }; - if (underlyingSink.start !== undefined) { - startAlgorithm = function () { return underlyingSink.start(controller); }; - } - if (underlyingSink.write !== undefined) { - writeAlgorithm = function (chunk) { return underlyingSink.write(chunk, controller); }; - } - if (underlyingSink.close !== undefined) { - closeAlgorithm = function () { return underlyingSink.close(); }; - } - if (underlyingSink.abort !== undefined) { - abortAlgorithm = function (reason) { return underlyingSink.abort(reason); }; - } - SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm); - } - // ClearAlgorithms may be called twice. Erroring the same stream in multiple ways will often result in redundant calls. - function WritableStreamDefaultControllerClearAlgorithms(controller) { - controller._writeAlgorithm = undefined; - controller._closeAlgorithm = undefined; - controller._abortAlgorithm = undefined; - controller._strategySizeAlgorithm = undefined; - } - function WritableStreamDefaultControllerClose(controller) { - EnqueueValueWithSize(controller, closeSentinel, 0); - WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); - } - function WritableStreamDefaultControllerGetChunkSize(controller, chunk) { - try { - return controller._strategySizeAlgorithm(chunk); - } - catch (chunkSizeE) { - WritableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE); - return 1; - } - } - function WritableStreamDefaultControllerGetDesiredSize(controller) { - return controller._strategyHWM - controller._queueTotalSize; - } - function WritableStreamDefaultControllerWrite(controller, chunk, chunkSize) { - try { - EnqueueValueWithSize(controller, chunk, chunkSize); - } - catch (enqueueE) { - WritableStreamDefaultControllerErrorIfNeeded(controller, enqueueE); - return; - } - var stream = controller._controlledWritableStream; - if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._state === 'writable') { - var backpressure = WritableStreamDefaultControllerGetBackpressure(controller); - WritableStreamUpdateBackpressure(stream, backpressure); - } - WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); - } - // Abstract operations for the WritableStreamDefaultController. - function WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller) { - var stream = controller._controlledWritableStream; - if (!controller._started) { - return; - } - if (stream._inFlightWriteRequest !== undefined) { - return; - } - var state = stream._state; - if (state === 'erroring') { - WritableStreamFinishErroring(stream); - return; - } - if (controller._queue.length === 0) { - return; - } - var value = PeekQueueValue(controller); - if (value === closeSentinel) { - WritableStreamDefaultControllerProcessClose(controller); - } - else { - WritableStreamDefaultControllerProcessWrite(controller, value); - } - } - function WritableStreamDefaultControllerErrorIfNeeded(controller, error) { - if (controller._controlledWritableStream._state === 'writable') { - WritableStreamDefaultControllerError(controller, error); - } - } - function WritableStreamDefaultControllerProcessClose(controller) { - var stream = controller._controlledWritableStream; - WritableStreamMarkCloseRequestInFlight(stream); - DequeueValue(controller); - var sinkClosePromise = controller._closeAlgorithm(); - WritableStreamDefaultControllerClearAlgorithms(controller); - uponPromise(sinkClosePromise, function () { - WritableStreamFinishInFlightClose(stream); - }, function (reason) { - WritableStreamFinishInFlightCloseWithError(stream, reason); - }); - } - function WritableStreamDefaultControllerProcessWrite(controller, chunk) { - var stream = controller._controlledWritableStream; - WritableStreamMarkFirstWriteRequestInFlight(stream); - var sinkWritePromise = controller._writeAlgorithm(chunk); - uponPromise(sinkWritePromise, function () { - WritableStreamFinishInFlightWrite(stream); - var state = stream._state; - DequeueValue(controller); - if (!WritableStreamCloseQueuedOrInFlight(stream) && state === 'writable') { - var backpressure = WritableStreamDefaultControllerGetBackpressure(controller); - WritableStreamUpdateBackpressure(stream, backpressure); - } - WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); - }, function (reason) { - if (stream._state === 'writable') { - WritableStreamDefaultControllerClearAlgorithms(controller); - } - WritableStreamFinishInFlightWriteWithError(stream, reason); - }); - } - function WritableStreamDefaultControllerGetBackpressure(controller) { - var desiredSize = WritableStreamDefaultControllerGetDesiredSize(controller); - return desiredSize <= 0; - } - // A client of WritableStreamDefaultController may use these functions directly to bypass state check. - function WritableStreamDefaultControllerError(controller, error) { - var stream = controller._controlledWritableStream; - WritableStreamDefaultControllerClearAlgorithms(controller); - WritableStreamStartErroring(stream, error); - } - // Helper functions for the WritableStream. - function streamBrandCheckException$2(name) { - return new TypeError("WritableStream.prototype." + name + " can only be used on a WritableStream"); - } - // Helper functions for the WritableStreamDefaultController. - function defaultControllerBrandCheckException$2(name) { - return new TypeError("WritableStreamDefaultController.prototype." + name + " can only be used on a WritableStreamDefaultController"); - } - // Helper functions for the WritableStreamDefaultWriter. - function defaultWriterBrandCheckException(name) { - return new TypeError("WritableStreamDefaultWriter.prototype." + name + " can only be used on a WritableStreamDefaultWriter"); - } - function defaultWriterLockException(name) { - return new TypeError('Cannot ' + name + ' a stream using a released writer'); - } - function defaultWriterClosedPromiseInitialize(writer) { - writer._closedPromise = newPromise(function (resolve, reject) { - writer._closedPromise_resolve = resolve; - writer._closedPromise_reject = reject; - writer._closedPromiseState = 'pending'; - }); - } - function defaultWriterClosedPromiseInitializeAsRejected(writer, reason) { - defaultWriterClosedPromiseInitialize(writer); - defaultWriterClosedPromiseReject(writer, reason); - } - function defaultWriterClosedPromiseInitializeAsResolved(writer) { - defaultWriterClosedPromiseInitialize(writer); - defaultWriterClosedPromiseResolve(writer); - } - function defaultWriterClosedPromiseReject(writer, reason) { - if (writer._closedPromise_reject === undefined) { - return; - } - setPromiseIsHandledToTrue(writer._closedPromise); - writer._closedPromise_reject(reason); - writer._closedPromise_resolve = undefined; - writer._closedPromise_reject = undefined; - writer._closedPromiseState = 'rejected'; - } - function defaultWriterClosedPromiseResetToRejected(writer, reason) { - defaultWriterClosedPromiseInitializeAsRejected(writer, reason); + // https://fetch.spec.whatwg.org/#dom-headers-append + append (name, value) { + webidl.brandCheck(this, Headers) + + webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' }) + + name = webidl.converters.ByteString(name) + value = webidl.converters.ByteString(value) + + return appendHeader(this, name, value) + } + + // https://fetch.spec.whatwg.org/#dom-headers-delete + delete (name) { + webidl.brandCheck(this, Headers) + + webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' }) + + name = webidl.converters.ByteString(name) + + // 1. If name is not a header name, then throw a TypeError. + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.delete', + value: name, + type: 'header name' + }) } - function defaultWriterClosedPromiseResolve(writer) { - if (writer._closedPromise_resolve === undefined) { - return; - } - writer._closedPromise_resolve(undefined); - writer._closedPromise_resolve = undefined; - writer._closedPromise_reject = undefined; - writer._closedPromiseState = 'resolved'; + + // 2. If this’s guard is "immutable", then throw a TypeError. + // 3. Otherwise, if this’s guard is "request" and name is a + // forbidden header name, return. + // 4. Otherwise, if this’s guard is "request-no-cors", name + // is not a no-CORS-safelisted request-header name, and + // name is not a privileged no-CORS request-header name, + // return. + // 5. Otherwise, if this’s guard is "response" and name is + // a forbidden response-header name, return. + // Note: undici does not implement forbidden header names + if (this[kGuard] === 'immutable') { + throw new TypeError('immutable') + } else if (this[kGuard] === 'request-no-cors') { + // TODO } - function defaultWriterReadyPromiseInitialize(writer) { - writer._readyPromise = newPromise(function (resolve, reject) { - writer._readyPromise_resolve = resolve; - writer._readyPromise_reject = reject; - }); - writer._readyPromiseState = 'pending'; + + // 6. If this’s header list does not contain name, then + // return. + if (!this[kHeadersList].contains(name)) { + return } - function defaultWriterReadyPromiseInitializeAsRejected(writer, reason) { - defaultWriterReadyPromiseInitialize(writer); - defaultWriterReadyPromiseReject(writer, reason); + + // 7. Delete name from this’s header list. + // 8. If this’s guard is "request-no-cors", then remove + // privileged no-CORS request headers from this. + this[kHeadersList].delete(name) + } + + // https://fetch.spec.whatwg.org/#dom-headers-get + get (name) { + webidl.brandCheck(this, Headers) + + webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' }) + + name = webidl.converters.ByteString(name) + + // 1. If name is not a header name, then throw a TypeError. + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.get', + value: name, + type: 'header name' + }) } - function defaultWriterReadyPromiseInitializeAsResolved(writer) { - defaultWriterReadyPromiseInitialize(writer); - defaultWriterReadyPromiseResolve(writer); + + // 2. Return the result of getting name from this’s header + // list. + return this[kHeadersList].get(name) + } + + // https://fetch.spec.whatwg.org/#dom-headers-has + has (name) { + webidl.brandCheck(this, Headers) + + webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' }) + + name = webidl.converters.ByteString(name) + + // 1. If name is not a header name, then throw a TypeError. + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.has', + value: name, + type: 'header name' + }) } - function defaultWriterReadyPromiseReject(writer, reason) { - if (writer._readyPromise_reject === undefined) { - return; - } - setPromiseIsHandledToTrue(writer._readyPromise); - writer._readyPromise_reject(reason); - writer._readyPromise_resolve = undefined; - writer._readyPromise_reject = undefined; - writer._readyPromiseState = 'rejected'; + + // 2. Return true if this’s header list contains name; + // otherwise false. + return this[kHeadersList].contains(name) + } + + // https://fetch.spec.whatwg.org/#dom-headers-set + set (name, value) { + webidl.brandCheck(this, Headers) + + webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' }) + + name = webidl.converters.ByteString(name) + value = webidl.converters.ByteString(value) + + // 1. Normalize value. + value = headerValueNormalize(value) + + // 2. If name is not a header name or value is not a + // header value, then throw a TypeError. + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.set', + value: name, + type: 'header name' + }) + } else if (!isValidHeaderValue(value)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.set', + value, + type: 'header value' + }) } - function defaultWriterReadyPromiseReset(writer) { - defaultWriterReadyPromiseInitialize(writer); + + // 3. If this’s guard is "immutable", then throw a TypeError. + // 4. Otherwise, if this’s guard is "request" and name is a + // forbidden header name, return. + // 5. Otherwise, if this’s guard is "request-no-cors" and + // name/value is not a no-CORS-safelisted request-header, + // return. + // 6. Otherwise, if this’s guard is "response" and name is a + // forbidden response-header name, return. + // Note: undici does not implement forbidden header names + if (this[kGuard] === 'immutable') { + throw new TypeError('immutable') + } else if (this[kGuard] === 'request-no-cors') { + // TODO } - function defaultWriterReadyPromiseResetToRejected(writer, reason) { - defaultWriterReadyPromiseInitializeAsRejected(writer, reason); + + // 7. Set (name, value) in this’s header list. + // 8. If this’s guard is "request-no-cors", then remove + // privileged no-CORS request headers from this + this[kHeadersList].set(name, value) + } + + // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie + getSetCookie () { + webidl.brandCheck(this, Headers) + + // 1. If this’s header list does not contain `Set-Cookie`, then return « ». + // 2. Return the values of all headers in this’s header list whose name is + // a byte-case-insensitive match for `Set-Cookie`, in order. + + const list = this[kHeadersList].cookies + + if (list) { + return [...list] } - function defaultWriterReadyPromiseResolve(writer) { - if (writer._readyPromise_resolve === undefined) { - return; - } - writer._readyPromise_resolve(undefined); - writer._readyPromise_resolve = undefined; - writer._readyPromise_reject = undefined; - writer._readyPromiseState = 'fulfilled'; + + return [] + } + + // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine + get [kHeadersSortedMap] () { + if (this[kHeadersList][kHeadersSortedMap]) { + return this[kHeadersList][kHeadersSortedMap] } - /// - var NativeDOMException = typeof DOMException !== 'undefined' ? DOMException : undefined; + // 1. Let headers be an empty list of headers with the key being the name + // and value the value. + const headers = [] - /// - function isDOMExceptionConstructor(ctor) { - if (!(typeof ctor === 'function' || typeof ctor === 'object')) { - return false; - } - try { - new ctor(); - return true; - } - catch (_a) { - return false; + // 2. Let names be the result of convert header names to a sorted-lowercase + // set with all the names of the headers in list. + const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1) + const cookies = this[kHeadersList].cookies + + // 3. For each name of names: + for (let i = 0; i < names.length; ++i) { + const [name, value] = names[i] + // 1. If name is `set-cookie`, then: + if (name === 'set-cookie') { + // 1. Let values be a list of all values of headers in list whose name + // is a byte-case-insensitive match for name, in order. + + // 2. For each value of values: + // 1. Append (name, value) to headers. + for (let j = 0; j < cookies.length; ++j) { + headers.push([name, cookies[j]]) } + } else { + // 2. Otherwise: + + // 1. Let value be the result of getting name from list. + + // 2. Assert: value is non-null. + assert(value !== null) + + // 3. Append (name, value) to headers. + headers.push([name, value]) + } } - function createDOMExceptionPolyfill() { - // eslint-disable-next-line no-shadow - var ctor = function DOMException(message, name) { - this.message = message || ''; - this.name = name || 'Error'; - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - }; - ctor.prototype = Object.create(Error.prototype); - Object.defineProperty(ctor.prototype, 'constructor', { value: ctor, writable: true, configurable: true }); - return ctor; - } - // eslint-disable-next-line no-redeclare - var DOMException$1 = isDOMExceptionConstructor(NativeDOMException) ? NativeDOMException : createDOMExceptionPolyfill(); - - function ReadableStreamPipeTo(source, dest, preventClose, preventAbort, preventCancel, signal) { - var reader = AcquireReadableStreamDefaultReader(source); - var writer = AcquireWritableStreamDefaultWriter(dest); - source._disturbed = true; - var shuttingDown = false; - // This is used to keep track of the spec's requirement that we wait for ongoing writes during shutdown. - var currentWrite = promiseResolvedWith(undefined); - return newPromise(function (resolve, reject) { - var abortAlgorithm; - if (signal !== undefined) { - abortAlgorithm = function () { - var error = new DOMException$1('Aborted', 'AbortError'); - var actions = []; - if (!preventAbort) { - actions.push(function () { - if (dest._state === 'writable') { - return WritableStreamAbort(dest, error); - } - return promiseResolvedWith(undefined); - }); - } - if (!preventCancel) { - actions.push(function () { - if (source._state === 'readable') { - return ReadableStreamCancel(source, error); - } - return promiseResolvedWith(undefined); - }); - } - shutdownWithAction(function () { return Promise.all(actions.map(function (action) { return action(); })); }, true, error); - }; - if (signal.aborted) { - abortAlgorithm(); - return; - } - signal.addEventListener('abort', abortAlgorithm); - } - // Using reader and writer, read all chunks from this and write them to dest - // - Backpressure must be enforced - // - Shutdown must stop all activity - function pipeLoop() { - return newPromise(function (resolveLoop, rejectLoop) { - function next(done) { - if (done) { - resolveLoop(); - } - else { - // Use `PerformPromiseThen` instead of `uponPromise` to avoid - // adding unnecessary `.catch(rethrowAssertionErrorRejection)` handlers - PerformPromiseThen(pipeStep(), next, rejectLoop); - } - } - next(false); - }); - } - function pipeStep() { - if (shuttingDown) { - return promiseResolvedWith(true); - } - return PerformPromiseThen(writer._readyPromise, function () { - return newPromise(function (resolveRead, rejectRead) { - ReadableStreamDefaultReaderRead(reader, { - _chunkSteps: function (chunk) { - currentWrite = PerformPromiseThen(WritableStreamDefaultWriterWrite(writer, chunk), undefined, noop); - resolveRead(false); - }, - _closeSteps: function () { return resolveRead(true); }, - _errorSteps: rejectRead - }); - }); - }); - } - // Errors must be propagated forward - isOrBecomesErrored(source, reader._closedPromise, function (storedError) { - if (!preventAbort) { - shutdownWithAction(function () { return WritableStreamAbort(dest, storedError); }, true, storedError); - } - else { - shutdown(true, storedError); - } - }); - // Errors must be propagated backward - isOrBecomesErrored(dest, writer._closedPromise, function (storedError) { - if (!preventCancel) { - shutdownWithAction(function () { return ReadableStreamCancel(source, storedError); }, true, storedError); - } - else { - shutdown(true, storedError); - } - }); - // Closing must be propagated forward - isOrBecomesClosed(source, reader._closedPromise, function () { - if (!preventClose) { - shutdownWithAction(function () { return WritableStreamDefaultWriterCloseWithErrorPropagation(writer); }); - } - else { - shutdown(); - } - }); - // Closing must be propagated backward - if (WritableStreamCloseQueuedOrInFlight(dest) || dest._state === 'closed') { - var destClosed_1 = new TypeError('the destination writable stream closed before all data could be piped to it'); - if (!preventCancel) { - shutdownWithAction(function () { return ReadableStreamCancel(source, destClosed_1); }, true, destClosed_1); - } - else { - shutdown(true, destClosed_1); - } - } - setPromiseIsHandledToTrue(pipeLoop()); - function waitForWritesToFinish() { - // Another write may have started while we were waiting on this currentWrite, so we have to be sure to wait - // for that too. - var oldCurrentWrite = currentWrite; - return PerformPromiseThen(currentWrite, function () { return oldCurrentWrite !== currentWrite ? waitForWritesToFinish() : undefined; }); - } - function isOrBecomesErrored(stream, promise, action) { - if (stream._state === 'errored') { - action(stream._storedError); - } - else { - uponRejection(promise, action); - } - } - function isOrBecomesClosed(stream, promise, action) { - if (stream._state === 'closed') { - action(); - } - else { - uponFulfillment(promise, action); - } - } - function shutdownWithAction(action, originalIsError, originalError) { - if (shuttingDown) { - return; - } - shuttingDown = true; - if (dest._state === 'writable' && !WritableStreamCloseQueuedOrInFlight(dest)) { - uponFulfillment(waitForWritesToFinish(), doTheRest); - } - else { - doTheRest(); - } - function doTheRest() { - uponPromise(action(), function () { return finalize(originalIsError, originalError); }, function (newError) { return finalize(true, newError); }); - } - } - function shutdown(isError, error) { - if (shuttingDown) { - return; - } - shuttingDown = true; - if (dest._state === 'writable' && !WritableStreamCloseQueuedOrInFlight(dest)) { - uponFulfillment(waitForWritesToFinish(), function () { return finalize(isError, error); }); - } - else { - finalize(isError, error); - } - } - function finalize(isError, error) { - WritableStreamDefaultWriterRelease(writer); - ReadableStreamReaderGenericRelease(reader); - if (signal !== undefined) { - signal.removeEventListener('abort', abortAlgorithm); - } - if (isError) { - reject(error); - } - else { - resolve(undefined); - } - } - }); + + this[kHeadersList][kHeadersSortedMap] = headers + + // 4. Return headers. + return headers + } + + keys () { + webidl.brandCheck(this, Headers) + + if (this[kGuard] === 'immutable') { + const value = this[kHeadersSortedMap] + return makeIterator(() => value, 'Headers', + 'key') } - /** - * Allows control of a {@link ReadableStream | readable stream}'s state and internal queue. - * - * @public - */ - var ReadableStreamDefaultController = /** @class */ (function () { - function ReadableStreamDefaultController() { - throw new TypeError('Illegal constructor'); - } - Object.defineProperty(ReadableStreamDefaultController.prototype, "desiredSize", { - /** - * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is - * over-full. An underlying source ought to use this information to determine when and how to apply backpressure. - */ - get: function () { - if (!IsReadableStreamDefaultController(this)) { - throw defaultControllerBrandCheckException$1('desiredSize'); - } - return ReadableStreamDefaultControllerGetDesiredSize(this); - }, - enumerable: false, - configurable: true - }); - /** - * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from - * the stream, but once those are read, the stream will become closed. - */ - ReadableStreamDefaultController.prototype.close = function () { - if (!IsReadableStreamDefaultController(this)) { - throw defaultControllerBrandCheckException$1('close'); - } - if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) { - throw new TypeError('The stream is not in a state that permits close'); - } - ReadableStreamDefaultControllerClose(this); - }; - ReadableStreamDefaultController.prototype.enqueue = function (chunk) { - if (chunk === void 0) { chunk = undefined; } - if (!IsReadableStreamDefaultController(this)) { - throw defaultControllerBrandCheckException$1('enqueue'); - } - if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) { - throw new TypeError('The stream is not in a state that permits enqueue'); - } - return ReadableStreamDefaultControllerEnqueue(this, chunk); - }; - /** - * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`. - */ - ReadableStreamDefaultController.prototype.error = function (e) { - if (e === void 0) { e = undefined; } - if (!IsReadableStreamDefaultController(this)) { - throw defaultControllerBrandCheckException$1('error'); - } - ReadableStreamDefaultControllerError(this, e); - }; - /** @internal */ - ReadableStreamDefaultController.prototype[CancelSteps] = function (reason) { - ResetQueue(this); - var result = this._cancelAlgorithm(reason); - ReadableStreamDefaultControllerClearAlgorithms(this); - return result; - }; - /** @internal */ - ReadableStreamDefaultController.prototype[PullSteps] = function (readRequest) { - var stream = this._controlledReadableStream; - if (this._queue.length > 0) { - var chunk = DequeueValue(this); - if (this._closeRequested && this._queue.length === 0) { - ReadableStreamDefaultControllerClearAlgorithms(this); - ReadableStreamClose(stream); - } - else { - ReadableStreamDefaultControllerCallPullIfNeeded(this); - } - readRequest._chunkSteps(chunk); - } - else { - ReadableStreamAddReadRequest(stream, readRequest); - ReadableStreamDefaultControllerCallPullIfNeeded(this); - } - }; - return ReadableStreamDefaultController; - }()); - Object.defineProperties(ReadableStreamDefaultController.prototype, { - close: { enumerable: true }, - enqueue: { enumerable: true }, - error: { enumerable: true }, - desiredSize: { enumerable: true } - }); - if (typeof SymbolPolyfill.toStringTag === 'symbol') { - Object.defineProperty(ReadableStreamDefaultController.prototype, SymbolPolyfill.toStringTag, { - value: 'ReadableStreamDefaultController', - configurable: true - }); + return makeIterator( + () => [...this[kHeadersSortedMap].values()], + 'Headers', + 'key' + ) + } + + values () { + webidl.brandCheck(this, Headers) + + if (this[kGuard] === 'immutable') { + const value = this[kHeadersSortedMap] + return makeIterator(() => value, 'Headers', + 'value') } - // Abstract operations for the ReadableStreamDefaultController. - function IsReadableStreamDefaultController(x) { - if (!typeIsObject(x)) { - return false; - } - if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableStream')) { - return false; - } - return x instanceof ReadableStreamDefaultController; + + return makeIterator( + () => [...this[kHeadersSortedMap].values()], + 'Headers', + 'value' + ) + } + + entries () { + webidl.brandCheck(this, Headers) + + if (this[kGuard] === 'immutable') { + const value = this[kHeadersSortedMap] + return makeIterator(() => value, 'Headers', + 'key+value') } - function ReadableStreamDefaultControllerCallPullIfNeeded(controller) { - var shouldPull = ReadableStreamDefaultControllerShouldCallPull(controller); - if (!shouldPull) { - return; - } - if (controller._pulling) { - controller._pullAgain = true; - return; - } - controller._pulling = true; - var pullPromise = controller._pullAlgorithm(); - uponPromise(pullPromise, function () { - controller._pulling = false; - if (controller._pullAgain) { - controller._pullAgain = false; - ReadableStreamDefaultControllerCallPullIfNeeded(controller); - } - }, function (e) { - ReadableStreamDefaultControllerError(controller, e); - }); + + return makeIterator( + () => [...this[kHeadersSortedMap].values()], + 'Headers', + 'key+value' + ) + } + + /** + * @param {(value: string, key: string, self: Headers) => void} callbackFn + * @param {unknown} thisArg + */ + forEach (callbackFn, thisArg = globalThis) { + webidl.brandCheck(this, Headers) + + webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' }) + + if (typeof callbackFn !== 'function') { + throw new TypeError( + "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'." + ) } - function ReadableStreamDefaultControllerShouldCallPull(controller) { - var stream = controller._controlledReadableStream; - if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) { - return false; - } - if (!controller._started) { - return false; - } - if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) { - return true; - } - var desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller); - if (desiredSize > 0) { - return true; - } - return false; + + for (const [key, value] of this) { + callbackFn.apply(thisArg, [value, key, this]) } - function ReadableStreamDefaultControllerClearAlgorithms(controller) { - controller._pullAlgorithm = undefined; - controller._cancelAlgorithm = undefined; - controller._strategySizeAlgorithm = undefined; + } + + [Symbol.for('nodejs.util.inspect.custom')] () { + webidl.brandCheck(this, Headers) + + return this[kHeadersList] + } +} + +Headers.prototype[Symbol.iterator] = Headers.prototype.entries + +Object.defineProperties(Headers.prototype, { + append: kEnumerableProperty, + delete: kEnumerableProperty, + get: kEnumerableProperty, + has: kEnumerableProperty, + set: kEnumerableProperty, + getSetCookie: kEnumerableProperty, + keys: kEnumerableProperty, + values: kEnumerableProperty, + entries: kEnumerableProperty, + forEach: kEnumerableProperty, + [Symbol.iterator]: { enumerable: false }, + [Symbol.toStringTag]: { + value: 'Headers', + configurable: true + } +}) + +webidl.converters.HeadersInit = function (V) { + if (webidl.util.Type(V) === 'Object') { + if (V[Symbol.iterator]) { + return webidl.converters['sequence>'](V) } - // A client of ReadableStreamDefaultController may use these functions directly to bypass state check. - function ReadableStreamDefaultControllerClose(controller) { - if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) { - return; - } - var stream = controller._controlledReadableStream; - controller._closeRequested = true; - if (controller._queue.length === 0) { - ReadableStreamDefaultControllerClearAlgorithms(controller); - ReadableStreamClose(stream); - } + + return webidl.converters['record'](V) + } + + throw webidl.errors.conversionFailed({ + prefix: 'Headers constructor', + argument: 'Argument 1', + types: ['sequence>', 'record'] + }) +} + +module.exports = { + fill, + Headers, + HeadersList +} + + +/***/ }), + +/***/ 37215: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// https://github.com/Ethan-Arrowood/undici-fetch + + + +const { + Response, + makeNetworkError, + makeAppropriateNetworkError, + filterResponse, + makeResponse +} = __nccwpck_require__(40599) +const { Headers } = __nccwpck_require__(13915) +const { Request, makeRequest } = __nccwpck_require__(20366) +const zlib = __nccwpck_require__(59796) +const { + bytesMatch, + makePolicyContainer, + clonePolicyContainer, + requestBadPort, + TAOCheck, + appendRequestOriginHeader, + responseLocationURL, + requestCurrentURL, + setRequestReferrerPolicyOnRedirect, + tryUpgradeRequestToAPotentiallyTrustworthyURL, + createOpaqueTimingInfo, + appendFetchMetadata, + corsCheck, + crossOriginResourcePolicyCheck, + determineRequestsReferrer, + coarsenedSharedCurrentTime, + createDeferredPromise, + isBlobLike, + sameOrigin, + isCancelled, + isAborted, + isErrorLike, + fullyReadBody, + readableStreamClose, + isomorphicEncode, + urlIsLocal, + urlIsHttpHttpsScheme, + urlHasHttpsScheme +} = __nccwpck_require__(47794) +const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(10730) +const assert = __nccwpck_require__(39491) +const { safelyExtractBody } = __nccwpck_require__(42173) +const { + redirectStatusSet, + nullBodyStatus, + safeMethodsSet, + requestBodyHeader, + subresourceSet, + DOMException +} = __nccwpck_require__(20075) +const { kHeadersList } = __nccwpck_require__(69898) +const EE = __nccwpck_require__(82361) +const { Readable, pipeline } = __nccwpck_require__(12781) +const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(43061) +const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(16306) +const { TransformStream } = __nccwpck_require__(35356) +const { getGlobalDispatcher } = __nccwpck_require__(94330) +const { webidl } = __nccwpck_require__(7000) +const { STATUS_CODES } = __nccwpck_require__(13685) +const GET_OR_HEAD = ['GET', 'HEAD'] + +/** @type {import('buffer').resolveObjectURL} */ +let resolveObjectURL +let ReadableStream = globalThis.ReadableStream + +class Fetch extends EE { + constructor (dispatcher) { + super() + + this.dispatcher = dispatcher + this.connection = null + this.dump = false + this.state = 'ongoing' + // 2 terminated listeners get added per request, + // but only 1 gets removed. If there are 20 redirects, + // 21 listeners will be added. + // See https://github.com/nodejs/undici/issues/1711 + // TODO (fix): Find and fix root cause for leaked listener. + this.setMaxListeners(21) + } + + terminate (reason) { + if (this.state !== 'ongoing') { + return } - function ReadableStreamDefaultControllerEnqueue(controller, chunk) { - if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) { - return; - } - var stream = controller._controlledReadableStream; - if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) { - ReadableStreamFulfillReadRequest(stream, chunk, false); - } - else { - var chunkSize = void 0; - try { - chunkSize = controller._strategySizeAlgorithm(chunk); - } - catch (chunkSizeE) { - ReadableStreamDefaultControllerError(controller, chunkSizeE); - throw chunkSizeE; - } - try { - EnqueueValueWithSize(controller, chunk, chunkSize); - } - catch (enqueueE) { - ReadableStreamDefaultControllerError(controller, enqueueE); - throw enqueueE; - } - } - ReadableStreamDefaultControllerCallPullIfNeeded(controller); + + this.state = 'terminated' + this.connection?.destroy(reason) + this.emit('terminated', reason) + } + + // https://fetch.spec.whatwg.org/#fetch-controller-abort + abort (error) { + if (this.state !== 'ongoing') { + return } - function ReadableStreamDefaultControllerError(controller, e) { - var stream = controller._controlledReadableStream; - if (stream._state !== 'readable') { - return; - } - ResetQueue(controller); - ReadableStreamDefaultControllerClearAlgorithms(controller); - ReadableStreamError(stream, e); + + // 1. Set controller’s state to "aborted". + this.state = 'aborted' + + // 2. Let fallbackError be an "AbortError" DOMException. + // 3. Set error to fallbackError if it is not given. + if (!error) { + error = new DOMException('The operation was aborted.', 'AbortError') } - function ReadableStreamDefaultControllerGetDesiredSize(controller) { - var state = controller._controlledReadableStream._state; - if (state === 'errored') { - return null; - } - if (state === 'closed') { - return 0; - } - return controller._strategyHWM - controller._queueTotalSize; + + // 4. Let serializedError be StructuredSerialize(error). + // If that threw an exception, catch it, and let + // serializedError be StructuredSerialize(fallbackError). + + // 5. Set controller’s serialized abort reason to serializedError. + this.serializedAbortReason = error + + this.connection?.destroy(error) + this.emit('terminated', error) + } +} + +// https://fetch.spec.whatwg.org/#fetch-method +function fetch (input, init = {}) { + webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' }) + + // 1. Let p be a new promise. + const p = createDeferredPromise() + + // 2. Let requestObject be the result of invoking the initial value of + // Request as constructor with input and init as arguments. If this throws + // an exception, reject p with it and return p. + let requestObject + + try { + requestObject = new Request(input, init) + } catch (e) { + p.reject(e) + return p.promise + } + + // 3. Let request be requestObject’s request. + const request = requestObject[kState] + + // 4. If requestObject’s signal’s aborted flag is set, then: + if (requestObject.signal.aborted) { + // 1. Abort the fetch() call with p, request, null, and + // requestObject’s signal’s abort reason. + abortFetch(p, request, null, requestObject.signal.reason) + + // 2. Return p. + return p.promise + } + + // 5. Let globalObject be request’s client’s global object. + const globalObject = request.client.globalObject + + // 6. If globalObject is a ServiceWorkerGlobalScope object, then set + // request’s service-workers mode to "none". + if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') { + request.serviceWorkers = 'none' + } + + // 7. Let responseObject be null. + let responseObject = null + + // 8. Let relevantRealm be this’s relevant Realm. + const relevantRealm = null + + // 9. Let locallyAborted be false. + let locallyAborted = false + + // 10. Let controller be null. + let controller = null + + // 11. Add the following abort steps to requestObject’s signal: + addAbortListener( + requestObject.signal, + () => { + // 1. Set locallyAborted to true. + locallyAborted = true + + // 2. Assert: controller is non-null. + assert(controller != null) + + // 3. Abort controller with requestObject’s signal’s abort reason. + controller.abort(requestObject.signal.reason) + + // 4. Abort the fetch() call with p, request, responseObject, + // and requestObject’s signal’s abort reason. + abortFetch(p, request, responseObject, requestObject.signal.reason) } - // This is used in the implementation of TransformStream. - function ReadableStreamDefaultControllerHasBackpressure(controller) { - if (ReadableStreamDefaultControllerShouldCallPull(controller)) { - return false; - } - return true; + ) + + // 12. Let handleFetchDone given response response be to finalize and + // report timing with response, globalObject, and "fetch". + const handleFetchDone = (response) => + finalizeAndReportTiming(response, 'fetch') + + // 13. Set controller to the result of calling fetch given request, + // with processResponseEndOfBody set to handleFetchDone, and processResponse + // given response being these substeps: + + const processResponse = (response) => { + // 1. If locallyAborted is true, terminate these substeps. + if (locallyAborted) { + return Promise.resolve() } - function ReadableStreamDefaultControllerCanCloseOrEnqueue(controller) { - var state = controller._controlledReadableStream._state; - if (!controller._closeRequested && state === 'readable') { - return true; - } - return false; + + // 2. If response’s aborted flag is set, then: + if (response.aborted) { + // 1. Let deserializedError be the result of deserialize a serialized + // abort reason given controller’s serialized abort reason and + // relevantRealm. + + // 2. Abort the fetch() call with p, request, responseObject, and + // deserializedError. + + abortFetch(p, request, responseObject, controller.serializedAbortReason) + return Promise.resolve() } - function SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm) { - controller._controlledReadableStream = stream; - controller._queue = undefined; - controller._queueTotalSize = undefined; - ResetQueue(controller); - controller._started = false; - controller._closeRequested = false; - controller._pullAgain = false; - controller._pulling = false; - controller._strategySizeAlgorithm = sizeAlgorithm; - controller._strategyHWM = highWaterMark; - controller._pullAlgorithm = pullAlgorithm; - controller._cancelAlgorithm = cancelAlgorithm; - stream._readableStreamController = controller; - var startResult = startAlgorithm(); - uponPromise(promiseResolvedWith(startResult), function () { - controller._started = true; - ReadableStreamDefaultControllerCallPullIfNeeded(controller); - }, function (r) { - ReadableStreamDefaultControllerError(controller, r); - }); + + // 3. If response is a network error, then reject p with a TypeError + // and terminate these substeps. + if (response.type === 'error') { + p.reject( + Object.assign(new TypeError('fetch failed'), { cause: response.error }) + ) + return Promise.resolve() } - function SetUpReadableStreamDefaultControllerFromUnderlyingSource(stream, underlyingSource, highWaterMark, sizeAlgorithm) { - var controller = Object.create(ReadableStreamDefaultController.prototype); - var startAlgorithm = function () { return undefined; }; - var pullAlgorithm = function () { return promiseResolvedWith(undefined); }; - var cancelAlgorithm = function () { return promiseResolvedWith(undefined); }; - if (underlyingSource.start !== undefined) { - startAlgorithm = function () { return underlyingSource.start(controller); }; - } - if (underlyingSource.pull !== undefined) { - pullAlgorithm = function () { return underlyingSource.pull(controller); }; - } - if (underlyingSource.cancel !== undefined) { - cancelAlgorithm = function (reason) { return underlyingSource.cancel(reason); }; - } - SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm); - } - // Helper functions for the ReadableStreamDefaultController. - function defaultControllerBrandCheckException$1(name) { - return new TypeError("ReadableStreamDefaultController.prototype." + name + " can only be used on a ReadableStreamDefaultController"); - } - - function ReadableStreamTee(stream, cloneForBranch2) { - if (IsReadableByteStreamController(stream._readableStreamController)) { - return ReadableByteStreamTee(stream); - } - return ReadableStreamDefaultTee(stream); - } - function ReadableStreamDefaultTee(stream, cloneForBranch2) { - var reader = AcquireReadableStreamDefaultReader(stream); - var reading = false; - var readAgain = false; - var canceled1 = false; - var canceled2 = false; - var reason1; - var reason2; - var branch1; - var branch2; - var resolveCancelPromise; - var cancelPromise = newPromise(function (resolve) { - resolveCancelPromise = resolve; - }); - function pullAlgorithm() { - if (reading) { - readAgain = true; - return promiseResolvedWith(undefined); - } - reading = true; - var readRequest = { - _chunkSteps: function (chunk) { - // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using - // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let - // successful synchronously-available reads get ahead of asynchronously-available errors. - queueMicrotask(function () { - readAgain = false; - var chunk1 = chunk; - var chunk2 = chunk; - // There is no way to access the cloning code right now in the reference implementation. - // If we add one then we'll need an implementation for serializable objects. - // if (!canceled2 && cloneForBranch2) { - // chunk2 = StructuredDeserialize(StructuredSerialize(chunk2)); - // } - if (!canceled1) { - ReadableStreamDefaultControllerEnqueue(branch1._readableStreamController, chunk1); - } - if (!canceled2) { - ReadableStreamDefaultControllerEnqueue(branch2._readableStreamController, chunk2); - } - reading = false; - if (readAgain) { - pullAlgorithm(); - } - }); - }, - _closeSteps: function () { - reading = false; - if (!canceled1) { - ReadableStreamDefaultControllerClose(branch1._readableStreamController); - } - if (!canceled2) { - ReadableStreamDefaultControllerClose(branch2._readableStreamController); - } - if (!canceled1 || !canceled2) { - resolveCancelPromise(undefined); - } - }, - _errorSteps: function () { - reading = false; - } - }; - ReadableStreamDefaultReaderRead(reader, readRequest); - return promiseResolvedWith(undefined); - } - function cancel1Algorithm(reason) { - canceled1 = true; - reason1 = reason; - if (canceled2) { - var compositeReason = CreateArrayFromList([reason1, reason2]); - var cancelResult = ReadableStreamCancel(stream, compositeReason); - resolveCancelPromise(cancelResult); - } - return cancelPromise; - } - function cancel2Algorithm(reason) { - canceled2 = true; - reason2 = reason; - if (canceled1) { - var compositeReason = CreateArrayFromList([reason1, reason2]); - var cancelResult = ReadableStreamCancel(stream, compositeReason); - resolveCancelPromise(cancelResult); - } - return cancelPromise; - } - function startAlgorithm() { - // do nothing - } - branch1 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel1Algorithm); - branch2 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel2Algorithm); - uponRejection(reader._closedPromise, function (r) { - ReadableStreamDefaultControllerError(branch1._readableStreamController, r); - ReadableStreamDefaultControllerError(branch2._readableStreamController, r); - if (!canceled1 || !canceled2) { - resolveCancelPromise(undefined); - } - }); - return [branch1, branch2]; - } - function ReadableByteStreamTee(stream) { - var reader = AcquireReadableStreamDefaultReader(stream); - var reading = false; - var readAgainForBranch1 = false; - var readAgainForBranch2 = false; - var canceled1 = false; - var canceled2 = false; - var reason1; - var reason2; - var branch1; - var branch2; - var resolveCancelPromise; - var cancelPromise = newPromise(function (resolve) { - resolveCancelPromise = resolve; - }); - function forwardReaderError(thisReader) { - uponRejection(thisReader._closedPromise, function (r) { - if (thisReader !== reader) { - return; - } - ReadableByteStreamControllerError(branch1._readableStreamController, r); - ReadableByteStreamControllerError(branch2._readableStreamController, r); - if (!canceled1 || !canceled2) { - resolveCancelPromise(undefined); - } - }); - } - function pullWithDefaultReader() { - if (IsReadableStreamBYOBReader(reader)) { - ReadableStreamReaderGenericRelease(reader); - reader = AcquireReadableStreamDefaultReader(stream); - forwardReaderError(reader); - } - var readRequest = { - _chunkSteps: function (chunk) { - // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using - // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let - // successful synchronously-available reads get ahead of asynchronously-available errors. - queueMicrotask(function () { - readAgainForBranch1 = false; - readAgainForBranch2 = false; - var chunk1 = chunk; - var chunk2 = chunk; - if (!canceled1 && !canceled2) { - try { - chunk2 = CloneAsUint8Array(chunk); - } - catch (cloneE) { - ReadableByteStreamControllerError(branch1._readableStreamController, cloneE); - ReadableByteStreamControllerError(branch2._readableStreamController, cloneE); - resolveCancelPromise(ReadableStreamCancel(stream, cloneE)); - return; - } - } - if (!canceled1) { - ReadableByteStreamControllerEnqueue(branch1._readableStreamController, chunk1); - } - if (!canceled2) { - ReadableByteStreamControllerEnqueue(branch2._readableStreamController, chunk2); - } - reading = false; - if (readAgainForBranch1) { - pull1Algorithm(); - } - else if (readAgainForBranch2) { - pull2Algorithm(); - } - }); - }, - _closeSteps: function () { - reading = false; - if (!canceled1) { - ReadableByteStreamControllerClose(branch1._readableStreamController); - } - if (!canceled2) { - ReadableByteStreamControllerClose(branch2._readableStreamController); - } - if (branch1._readableStreamController._pendingPullIntos.length > 0) { - ReadableByteStreamControllerRespond(branch1._readableStreamController, 0); - } - if (branch2._readableStreamController._pendingPullIntos.length > 0) { - ReadableByteStreamControllerRespond(branch2._readableStreamController, 0); - } - if (!canceled1 || !canceled2) { - resolveCancelPromise(undefined); - } - }, - _errorSteps: function () { - reading = false; - } - }; - ReadableStreamDefaultReaderRead(reader, readRequest); - } - function pullWithBYOBReader(view, forBranch2) { - if (IsReadableStreamDefaultReader(reader)) { - ReadableStreamReaderGenericRelease(reader); - reader = AcquireReadableStreamBYOBReader(stream); - forwardReaderError(reader); - } - var byobBranch = forBranch2 ? branch2 : branch1; - var otherBranch = forBranch2 ? branch1 : branch2; - var readIntoRequest = { - _chunkSteps: function (chunk) { - // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using - // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let - // successful synchronously-available reads get ahead of asynchronously-available errors. - queueMicrotask(function () { - readAgainForBranch1 = false; - readAgainForBranch2 = false; - var byobCanceled = forBranch2 ? canceled2 : canceled1; - var otherCanceled = forBranch2 ? canceled1 : canceled2; - if (!otherCanceled) { - var clonedChunk = void 0; - try { - clonedChunk = CloneAsUint8Array(chunk); - } - catch (cloneE) { - ReadableByteStreamControllerError(byobBranch._readableStreamController, cloneE); - ReadableByteStreamControllerError(otherBranch._readableStreamController, cloneE); - resolveCancelPromise(ReadableStreamCancel(stream, cloneE)); - return; - } - if (!byobCanceled) { - ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk); - } - ReadableByteStreamControllerEnqueue(otherBranch._readableStreamController, clonedChunk); - } - else if (!byobCanceled) { - ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk); - } - reading = false; - if (readAgainForBranch1) { - pull1Algorithm(); - } - else if (readAgainForBranch2) { - pull2Algorithm(); - } - }); - }, - _closeSteps: function (chunk) { - reading = false; - var byobCanceled = forBranch2 ? canceled2 : canceled1; - var otherCanceled = forBranch2 ? canceled1 : canceled2; - if (!byobCanceled) { - ReadableByteStreamControllerClose(byobBranch._readableStreamController); - } - if (!otherCanceled) { - ReadableByteStreamControllerClose(otherBranch._readableStreamController); - } - if (chunk !== undefined) { - if (!byobCanceled) { - ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk); - } - if (!otherCanceled && otherBranch._readableStreamController._pendingPullIntos.length > 0) { - ReadableByteStreamControllerRespond(otherBranch._readableStreamController, 0); - } - } - if (!byobCanceled || !otherCanceled) { - resolveCancelPromise(undefined); - } - }, - _errorSteps: function () { - reading = false; - } - }; - ReadableStreamBYOBReaderRead(reader, view, readIntoRequest); - } - function pull1Algorithm() { - if (reading) { - readAgainForBranch1 = true; - return promiseResolvedWith(undefined); - } - reading = true; - var byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch1._readableStreamController); - if (byobRequest === null) { - pullWithDefaultReader(); - } - else { - pullWithBYOBReader(byobRequest._view, false); - } - return promiseResolvedWith(undefined); - } - function pull2Algorithm() { - if (reading) { - readAgainForBranch2 = true; - return promiseResolvedWith(undefined); - } - reading = true; - var byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch2._readableStreamController); - if (byobRequest === null) { - pullWithDefaultReader(); - } - else { - pullWithBYOBReader(byobRequest._view, true); - } - return promiseResolvedWith(undefined); - } - function cancel1Algorithm(reason) { - canceled1 = true; - reason1 = reason; - if (canceled2) { - var compositeReason = CreateArrayFromList([reason1, reason2]); - var cancelResult = ReadableStreamCancel(stream, compositeReason); - resolveCancelPromise(cancelResult); - } - return cancelPromise; - } - function cancel2Algorithm(reason) { - canceled2 = true; - reason2 = reason; - if (canceled1) { - var compositeReason = CreateArrayFromList([reason1, reason2]); - var cancelResult = ReadableStreamCancel(stream, compositeReason); - resolveCancelPromise(cancelResult); - } - return cancelPromise; - } - function startAlgorithm() { - return; - } - branch1 = CreateReadableByteStream(startAlgorithm, pull1Algorithm, cancel1Algorithm); - branch2 = CreateReadableByteStream(startAlgorithm, pull2Algorithm, cancel2Algorithm); - forwardReaderError(reader); - return [branch1, branch2]; + + // 4. Set responseObject to the result of creating a Response object, + // given response, "immutable", and relevantRealm. + responseObject = new Response() + responseObject[kState] = response + responseObject[kRealm] = relevantRealm + responseObject[kHeaders][kHeadersList] = response.headersList + responseObject[kHeaders][kGuard] = 'immutable' + responseObject[kHeaders][kRealm] = relevantRealm + + // 5. Resolve p with responseObject. + p.resolve(responseObject) + } + + controller = fetching({ + request, + processResponseEndOfBody: handleFetchDone, + processResponse, + dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici + }) + + // 14. Return p. + return p.promise +} + +// https://fetch.spec.whatwg.org/#finalize-and-report-timing +function finalizeAndReportTiming (response, initiatorType = 'other') { + // 1. If response is an aborted network error, then return. + if (response.type === 'error' && response.aborted) { + return + } + + // 2. If response’s URL list is null or empty, then return. + if (!response.urlList?.length) { + return + } + + // 3. Let originalURL be response’s URL list[0]. + const originalURL = response.urlList[0] + + // 4. Let timingInfo be response’s timing info. + let timingInfo = response.timingInfo + + // 5. Let cacheState be response’s cache state. + let cacheState = response.cacheState + + // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return. + if (!urlIsHttpHttpsScheme(originalURL)) { + return + } + + // 7. If timingInfo is null, then return. + if (timingInfo === null) { + return + } + + // 8. If response’s timing allow passed flag is not set, then: + if (!response.timingAllowPassed) { + // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo. + timingInfo = createOpaqueTimingInfo({ + startTime: timingInfo.startTime + }) + + // 2. Set cacheState to the empty string. + cacheState = '' + } + + // 9. Set timingInfo’s end time to the coarsened shared current time + // given global’s relevant settings object’s cross-origin isolated + // capability. + // TODO: given global’s relevant settings object’s cross-origin isolated + // capability? + timingInfo.endTime = coarsenedSharedCurrentTime() + + // 10. Set response’s timing info to timingInfo. + response.timingInfo = timingInfo + + // 11. Mark resource timing for timingInfo, originalURL, initiatorType, + // global, and cacheState. + markResourceTiming( + timingInfo, + originalURL, + initiatorType, + globalThis, + cacheState + ) +} + +// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing +function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) { + if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) { + performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState) + } +} + +// https://fetch.spec.whatwg.org/#abort-fetch +function abortFetch (p, request, responseObject, error) { + // Note: AbortSignal.reason was added in node v17.2.0 + // which would give us an undefined error to reject with. + // Remove this once node v16 is no longer supported. + if (!error) { + error = new DOMException('The operation was aborted.', 'AbortError') + } + + // 1. Reject promise with error. + p.reject(error) + + // 2. If request’s body is not null and is readable, then cancel request’s + // body with error. + if (request.body != null && isReadable(request.body?.stream)) { + request.body.stream.cancel(error).catch((err) => { + if (err.code === 'ERR_INVALID_STATE') { + // Node bug? + return + } + throw err + }) + } + + // 3. If responseObject is null, then return. + if (responseObject == null) { + return + } + + // 4. Let response be responseObject’s response. + const response = responseObject[kState] + + // 5. If response’s body is not null and is readable, then error response’s + // body with error. + if (response.body != null && isReadable(response.body?.stream)) { + response.body.stream.cancel(error).catch((err) => { + if (err.code === 'ERR_INVALID_STATE') { + // Node bug? + return + } + throw err + }) + } +} + +// https://fetch.spec.whatwg.org/#fetching +function fetching ({ + request, + processRequestBodyChunkLength, + processRequestEndOfBody, + processResponse, + processResponseEndOfBody, + processResponseConsumeBody, + useParallelQueue = false, + dispatcher // undici +}) { + // 1. Let taskDestination be null. + let taskDestination = null + + // 2. Let crossOriginIsolatedCapability be false. + let crossOriginIsolatedCapability = false + + // 3. If request’s client is non-null, then: + if (request.client != null) { + // 1. Set taskDestination to request’s client’s global object. + taskDestination = request.client.globalObject + + // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin + // isolated capability. + crossOriginIsolatedCapability = + request.client.crossOriginIsolatedCapability + } + + // 4. If useParallelQueue is true, then set taskDestination to the result of + // starting a new parallel queue. + // TODO + + // 5. Let timingInfo be a new fetch timing info whose start time and + // post-redirect start time are the coarsened shared current time given + // crossOriginIsolatedCapability. + const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability) + const timingInfo = createOpaqueTimingInfo({ + startTime: currenTime + }) + + // 6. Let fetchParams be a new fetch params whose + // request is request, + // timing info is timingInfo, + // process request body chunk length is processRequestBodyChunkLength, + // process request end-of-body is processRequestEndOfBody, + // process response is processResponse, + // process response consume body is processResponseConsumeBody, + // process response end-of-body is processResponseEndOfBody, + // task destination is taskDestination, + // and cross-origin isolated capability is crossOriginIsolatedCapability. + const fetchParams = { + controller: new Fetch(dispatcher), + request, + timingInfo, + processRequestBodyChunkLength, + processRequestEndOfBody, + processResponse, + processResponseConsumeBody, + processResponseEndOfBody, + taskDestination, + crossOriginIsolatedCapability + } + + // 7. If request’s body is a byte sequence, then set request’s body to + // request’s body as a body. + // NOTE: Since fetching is only called from fetch, body should already be + // extracted. + assert(!request.body || request.body.stream) + + // 8. If request’s window is "client", then set request’s window to request’s + // client, if request’s client’s global object is a Window object; otherwise + // "no-window". + if (request.window === 'client') { + // TODO: What if request.client is null? + request.window = + request.client?.globalObject?.constructor?.name === 'Window' + ? request.client + : 'no-window' + } + + // 9. If request’s origin is "client", then set request’s origin to request’s + // client’s origin. + if (request.origin === 'client') { + // TODO: What if request.client is null? + request.origin = request.client?.origin + } + + // 10. If all of the following conditions are true: + // TODO + + // 11. If request’s policy container is "client", then: + if (request.policyContainer === 'client') { + // 1. If request’s client is non-null, then set request’s policy + // container to a clone of request’s client’s policy container. [HTML] + if (request.client != null) { + request.policyContainer = clonePolicyContainer( + request.client.policyContainer + ) + } else { + // 2. Otherwise, set request’s policy container to a new policy + // container. + request.policyContainer = makePolicyContainer() } + } + + // 12. If request’s header list does not contain `Accept`, then: + if (!request.headersList.contains('accept')) { + // 1. Let value be `*/*`. + const value = '*/*' + + // 2. A user agent should set value to the first matching statement, if + // any, switching on request’s destination: + // "document" + // "frame" + // "iframe" + // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8` + // "image" + // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5` + // "style" + // `text/css,*/*;q=0.1` + // TODO + + // 3. Append `Accept`/value to request’s header list. + request.headersList.append('accept', value) + } - function convertUnderlyingDefaultOrByteSource(source, context) { - assertDictionary(source, context); - var original = source; - var autoAllocateChunkSize = original === null || original === void 0 ? void 0 : original.autoAllocateChunkSize; - var cancel = original === null || original === void 0 ? void 0 : original.cancel; - var pull = original === null || original === void 0 ? void 0 : original.pull; - var start = original === null || original === void 0 ? void 0 : original.start; - var type = original === null || original === void 0 ? void 0 : original.type; - return { - autoAllocateChunkSize: autoAllocateChunkSize === undefined ? - undefined : - convertUnsignedLongLongWithEnforceRange(autoAllocateChunkSize, context + " has member 'autoAllocateChunkSize' that"), - cancel: cancel === undefined ? - undefined : - convertUnderlyingSourceCancelCallback(cancel, original, context + " has member 'cancel' that"), - pull: pull === undefined ? - undefined : - convertUnderlyingSourcePullCallback(pull, original, context + " has member 'pull' that"), - start: start === undefined ? - undefined : - convertUnderlyingSourceStartCallback(start, original, context + " has member 'start' that"), - type: type === undefined ? undefined : convertReadableStreamType(type, context + " has member 'type' that") - }; - } - function convertUnderlyingSourceCancelCallback(fn, original, context) { - assertFunction(fn, context); - return function (reason) { return promiseCall(fn, original, [reason]); }; - } - function convertUnderlyingSourcePullCallback(fn, original, context) { - assertFunction(fn, context); - return function (controller) { return promiseCall(fn, original, [controller]); }; - } - function convertUnderlyingSourceStartCallback(fn, original, context) { - assertFunction(fn, context); - return function (controller) { return reflectCall(fn, original, [controller]); }; - } - function convertReadableStreamType(type, context) { - type = "" + type; - if (type !== 'bytes') { - throw new TypeError(context + " '" + type + "' is not a valid enumeration value for ReadableStreamType"); - } - return type; - } + // 13. If request’s header list does not contain `Accept-Language`, then + // user agents should append `Accept-Language`/an appropriate value to + // request’s header list. + if (!request.headersList.contains('accept-language')) { + request.headersList.append('accept-language', '*') + } - function convertReaderOptions(options, context) { - assertDictionary(options, context); - var mode = options === null || options === void 0 ? void 0 : options.mode; - return { - mode: mode === undefined ? undefined : convertReadableStreamReaderMode(mode, context + " has member 'mode' that") - }; - } - function convertReadableStreamReaderMode(mode, context) { - mode = "" + mode; - if (mode !== 'byob') { - throw new TypeError(context + " '" + mode + "' is not a valid enumeration value for ReadableStreamReaderMode"); - } - return mode; - } + // 14. If request’s priority is null, then use request’s initiator and + // destination appropriately in setting request’s priority to a + // user-agent-defined object. + if (request.priority === null) { + // TODO + } - function convertIteratorOptions(options, context) { - assertDictionary(options, context); - var preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel; - return { preventCancel: Boolean(preventCancel) }; - } + // 15. If request is a subresource request, then: + if (subresourceSet.has(request.destination)) { + // TODO + } - function convertPipeOptions(options, context) { - assertDictionary(options, context); - var preventAbort = options === null || options === void 0 ? void 0 : options.preventAbort; - var preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel; - var preventClose = options === null || options === void 0 ? void 0 : options.preventClose; - var signal = options === null || options === void 0 ? void 0 : options.signal; - if (signal !== undefined) { - assertAbortSignal(signal, context + " has member 'signal' that"); - } - return { - preventAbort: Boolean(preventAbort), - preventCancel: Boolean(preventCancel), - preventClose: Boolean(preventClose), - signal: signal - }; - } - function assertAbortSignal(signal, context) { - if (!isAbortSignal(signal)) { - throw new TypeError(context + " is not an AbortSignal."); - } - } + // 16. Run main fetch given fetchParams. + mainFetch(fetchParams) + .catch(err => { + fetchParams.controller.terminate(err) + }) - function convertReadableWritablePair(pair, context) { - assertDictionary(pair, context); - var readable = pair === null || pair === void 0 ? void 0 : pair.readable; - assertRequiredField(readable, 'readable', 'ReadableWritablePair'); - assertReadableStream(readable, context + " has member 'readable' that"); - var writable = pair === null || pair === void 0 ? void 0 : pair.writable; - assertRequiredField(writable, 'writable', 'ReadableWritablePair'); - assertWritableStream(writable, context + " has member 'writable' that"); - return { readable: readable, writable: writable }; - } + // 17. Return fetchParam's controller + return fetchParams.controller +} - /** - * A readable stream represents a source of data, from which you can read. - * - * @public - */ - var ReadableStream = /** @class */ (function () { - function ReadableStream(rawUnderlyingSource, rawStrategy) { - if (rawUnderlyingSource === void 0) { rawUnderlyingSource = {}; } - if (rawStrategy === void 0) { rawStrategy = {}; } - if (rawUnderlyingSource === undefined) { - rawUnderlyingSource = null; - } - else { - assertObject(rawUnderlyingSource, 'First parameter'); - } - var strategy = convertQueuingStrategy(rawStrategy, 'Second parameter'); - var underlyingSource = convertUnderlyingDefaultOrByteSource(rawUnderlyingSource, 'First parameter'); - InitializeReadableStream(this); - if (underlyingSource.type === 'bytes') { - if (strategy.size !== undefined) { - throw new RangeError('The strategy for a byte stream cannot have a size function'); - } - var highWaterMark = ExtractHighWaterMark(strategy, 0); - SetUpReadableByteStreamControllerFromUnderlyingSource(this, underlyingSource, highWaterMark); - } - else { - var sizeAlgorithm = ExtractSizeAlgorithm(strategy); - var highWaterMark = ExtractHighWaterMark(strategy, 1); - SetUpReadableStreamDefaultControllerFromUnderlyingSource(this, underlyingSource, highWaterMark, sizeAlgorithm); - } - } - Object.defineProperty(ReadableStream.prototype, "locked", { - /** - * Whether or not the readable stream is locked to a {@link ReadableStreamDefaultReader | reader}. - */ - get: function () { - if (!IsReadableStream(this)) { - throw streamBrandCheckException$1('locked'); - } - return IsReadableStreamLocked(this); - }, - enumerable: false, - configurable: true - }); - /** - * Cancels the stream, signaling a loss of interest in the stream by a consumer. - * - * The supplied `reason` argument will be given to the underlying source's {@link UnderlyingSource.cancel | cancel()} - * method, which might or might not use it. - */ - ReadableStream.prototype.cancel = function (reason) { - if (reason === void 0) { reason = undefined; } - if (!IsReadableStream(this)) { - return promiseRejectedWith(streamBrandCheckException$1('cancel')); - } - if (IsReadableStreamLocked(this)) { - return promiseRejectedWith(new TypeError('Cannot cancel a stream that already has a reader')); - } - return ReadableStreamCancel(this, reason); - }; - ReadableStream.prototype.getReader = function (rawOptions) { - if (rawOptions === void 0) { rawOptions = undefined; } - if (!IsReadableStream(this)) { - throw streamBrandCheckException$1('getReader'); - } - var options = convertReaderOptions(rawOptions, 'First parameter'); - if (options.mode === undefined) { - return AcquireReadableStreamDefaultReader(this); - } - return AcquireReadableStreamBYOBReader(this); - }; - ReadableStream.prototype.pipeThrough = function (rawTransform, rawOptions) { - if (rawOptions === void 0) { rawOptions = {}; } - if (!IsReadableStream(this)) { - throw streamBrandCheckException$1('pipeThrough'); - } - assertRequiredArgument(rawTransform, 1, 'pipeThrough'); - var transform = convertReadableWritablePair(rawTransform, 'First parameter'); - var options = convertPipeOptions(rawOptions, 'Second parameter'); - if (IsReadableStreamLocked(this)) { - throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream'); - } - if (IsWritableStreamLocked(transform.writable)) { - throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream'); - } - var promise = ReadableStreamPipeTo(this, transform.writable, options.preventClose, options.preventAbort, options.preventCancel, options.signal); - setPromiseIsHandledToTrue(promise); - return transform.readable; - }; - ReadableStream.prototype.pipeTo = function (destination, rawOptions) { - if (rawOptions === void 0) { rawOptions = {}; } - if (!IsReadableStream(this)) { - return promiseRejectedWith(streamBrandCheckException$1('pipeTo')); - } - if (destination === undefined) { - return promiseRejectedWith("Parameter 1 is required in 'pipeTo'."); - } - if (!IsWritableStream(destination)) { - return promiseRejectedWith(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream")); - } - var options; - try { - options = convertPipeOptions(rawOptions, 'Second parameter'); - } - catch (e) { - return promiseRejectedWith(e); - } - if (IsReadableStreamLocked(this)) { - return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream')); - } - if (IsWritableStreamLocked(destination)) { - return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream')); - } - return ReadableStreamPipeTo(this, destination, options.preventClose, options.preventAbort, options.preventCancel, options.signal); - }; - /** - * Tees this readable stream, returning a two-element array containing the two resulting branches as - * new {@link ReadableStream} instances. - * - * Teeing a stream will lock it, preventing any other consumer from acquiring a reader. - * To cancel the stream, cancel both of the resulting branches; a composite cancellation reason will then be - * propagated to the stream's underlying source. - * - * Note that the chunks seen in each branch will be the same object. If the chunks are not immutable, - * this could allow interference between the two branches. - */ - ReadableStream.prototype.tee = function () { - if (!IsReadableStream(this)) { - throw streamBrandCheckException$1('tee'); - } - var branches = ReadableStreamTee(this); - return CreateArrayFromList(branches); - }; - ReadableStream.prototype.values = function (rawOptions) { - if (rawOptions === void 0) { rawOptions = undefined; } - if (!IsReadableStream(this)) { - throw streamBrandCheckException$1('values'); - } - var options = convertIteratorOptions(rawOptions, 'First parameter'); - return AcquireReadableStreamAsyncIterator(this, options.preventCancel); - }; - return ReadableStream; - }()); - Object.defineProperties(ReadableStream.prototype, { - cancel: { enumerable: true }, - getReader: { enumerable: true }, - pipeThrough: { enumerable: true }, - pipeTo: { enumerable: true }, - tee: { enumerable: true }, - values: { enumerable: true }, - locked: { enumerable: true } - }); - if (typeof SymbolPolyfill.toStringTag === 'symbol') { - Object.defineProperty(ReadableStream.prototype, SymbolPolyfill.toStringTag, { - value: 'ReadableStream', - configurable: true - }); - } - if (typeof SymbolPolyfill.asyncIterator === 'symbol') { - Object.defineProperty(ReadableStream.prototype, SymbolPolyfill.asyncIterator, { - value: ReadableStream.prototype.values, - writable: true, - configurable: true - }); - } - // Abstract operations for the ReadableStream. - // Throws if and only if startAlgorithm throws. - function CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm) { - if (highWaterMark === void 0) { highWaterMark = 1; } - if (sizeAlgorithm === void 0) { sizeAlgorithm = function () { return 1; }; } - var stream = Object.create(ReadableStream.prototype); - InitializeReadableStream(stream); - var controller = Object.create(ReadableStreamDefaultController.prototype); - SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm); - return stream; - } - // Throws if and only if startAlgorithm throws. - function CreateReadableByteStream(startAlgorithm, pullAlgorithm, cancelAlgorithm) { - var stream = Object.create(ReadableStream.prototype); - InitializeReadableStream(stream); - var controller = Object.create(ReadableByteStreamController.prototype); - SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, 0, undefined); - return stream; - } - function InitializeReadableStream(stream) { - stream._state = 'readable'; - stream._reader = undefined; - stream._storedError = undefined; - stream._disturbed = false; - } - function IsReadableStream(x) { - if (!typeIsObject(x)) { - return false; - } - if (!Object.prototype.hasOwnProperty.call(x, '_readableStreamController')) { - return false; - } - return x instanceof ReadableStream; - } - function IsReadableStreamLocked(stream) { - if (stream._reader === undefined) { - return false; - } - return true; - } - // ReadableStream API exposed for controllers. - function ReadableStreamCancel(stream, reason) { - stream._disturbed = true; - if (stream._state === 'closed') { - return promiseResolvedWith(undefined); - } - if (stream._state === 'errored') { - return promiseRejectedWith(stream._storedError); - } - ReadableStreamClose(stream); - var reader = stream._reader; - if (reader !== undefined && IsReadableStreamBYOBReader(reader)) { - reader._readIntoRequests.forEach(function (readIntoRequest) { - readIntoRequest._closeSteps(undefined); - }); - reader._readIntoRequests = new SimpleQueue(); - } - var sourceCancelPromise = stream._readableStreamController[CancelSteps](reason); - return transformPromiseWith(sourceCancelPromise, noop); - } - function ReadableStreamClose(stream) { - stream._state = 'closed'; - var reader = stream._reader; - if (reader === undefined) { - return; - } - defaultReaderClosedPromiseResolve(reader); - if (IsReadableStreamDefaultReader(reader)) { - reader._readRequests.forEach(function (readRequest) { - readRequest._closeSteps(); - }); - reader._readRequests = new SimpleQueue(); - } - } - function ReadableStreamError(stream, e) { - stream._state = 'errored'; - stream._storedError = e; - var reader = stream._reader; - if (reader === undefined) { - return; - } - defaultReaderClosedPromiseReject(reader, e); - if (IsReadableStreamDefaultReader(reader)) { - reader._readRequests.forEach(function (readRequest) { - readRequest._errorSteps(e); - }); - reader._readRequests = new SimpleQueue(); - } - else { - reader._readIntoRequests.forEach(function (readIntoRequest) { - readIntoRequest._errorSteps(e); - }); - reader._readIntoRequests = new SimpleQueue(); - } - } - // Helper functions for the ReadableStream. - function streamBrandCheckException$1(name) { - return new TypeError("ReadableStream.prototype." + name + " can only be used on a ReadableStream"); - } +// https://fetch.spec.whatwg.org/#concept-main-fetch +async function mainFetch (fetchParams, recursive = false) { + // 1. Let request be fetchParams’s request. + const request = fetchParams.request - function convertQueuingStrategyInit(init, context) { - assertDictionary(init, context); - var highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark; - assertRequiredField(highWaterMark, 'highWaterMark', 'QueuingStrategyInit'); - return { - highWaterMark: convertUnrestrictedDouble(highWaterMark) - }; - } + // 2. Let response be null. + let response = null - // The size function must not have a prototype property nor be a constructor - var byteLengthSizeFunction = function (chunk) { - return chunk.byteLength; - }; - try { - Object.defineProperty(byteLengthSizeFunction, 'name', { - value: 'size', - configurable: true - }); - } - catch (_a) { - // This property is non-configurable in older browsers, so ignore if this throws. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name#browser_compatibility - } - /** - * A queuing strategy that counts the number of bytes in each chunk. - * - * @public - */ - var ByteLengthQueuingStrategy = /** @class */ (function () { - function ByteLengthQueuingStrategy(options) { - assertRequiredArgument(options, 1, 'ByteLengthQueuingStrategy'); - options = convertQueuingStrategyInit(options, 'First parameter'); - this._byteLengthQueuingStrategyHighWaterMark = options.highWaterMark; - } - Object.defineProperty(ByteLengthQueuingStrategy.prototype, "highWaterMark", { - /** - * Returns the high water mark provided to the constructor. - */ - get: function () { - if (!IsByteLengthQueuingStrategy(this)) { - throw byteLengthBrandCheckException('highWaterMark'); - } - return this._byteLengthQueuingStrategyHighWaterMark; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ByteLengthQueuingStrategy.prototype, "size", { - /** - * Measures the size of `chunk` by returning the value of its `byteLength` property. - */ - get: function () { - if (!IsByteLengthQueuingStrategy(this)) { - throw byteLengthBrandCheckException('size'); - } - return byteLengthSizeFunction; - }, - enumerable: false, - configurable: true - }); - return ByteLengthQueuingStrategy; - }()); - Object.defineProperties(ByteLengthQueuingStrategy.prototype, { - highWaterMark: { enumerable: true }, - size: { enumerable: true } - }); - if (typeof SymbolPolyfill.toStringTag === 'symbol') { - Object.defineProperty(ByteLengthQueuingStrategy.prototype, SymbolPolyfill.toStringTag, { - value: 'ByteLengthQueuingStrategy', - configurable: true - }); - } - // Helper functions for the ByteLengthQueuingStrategy. - function byteLengthBrandCheckException(name) { - return new TypeError("ByteLengthQueuingStrategy.prototype." + name + " can only be used on a ByteLengthQueuingStrategy"); - } - function IsByteLengthQueuingStrategy(x) { - if (!typeIsObject(x)) { - return false; - } - if (!Object.prototype.hasOwnProperty.call(x, '_byteLengthQueuingStrategyHighWaterMark')) { - return false; - } - return x instanceof ByteLengthQueuingStrategy; - } + // 3. If request’s local-URLs-only flag is set and request’s current URL is + // not local, then set response to a network error. + if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) { + response = makeNetworkError('local URLs only') + } - // The size function must not have a prototype property nor be a constructor - var countSizeFunction = function () { - return 1; - }; - try { - Object.defineProperty(countSizeFunction, 'name', { - value: 'size', - configurable: true - }); - } - catch (_a) { - // This property is non-configurable in older browsers, so ignore if this throws. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name#browser_compatibility - } - /** - * A queuing strategy that counts the number of chunks. - * - * @public - */ - var CountQueuingStrategy = /** @class */ (function () { - function CountQueuingStrategy(options) { - assertRequiredArgument(options, 1, 'CountQueuingStrategy'); - options = convertQueuingStrategyInit(options, 'First parameter'); - this._countQueuingStrategyHighWaterMark = options.highWaterMark; - } - Object.defineProperty(CountQueuingStrategy.prototype, "highWaterMark", { - /** - * Returns the high water mark provided to the constructor. - */ - get: function () { - if (!IsCountQueuingStrategy(this)) { - throw countBrandCheckException('highWaterMark'); - } - return this._countQueuingStrategyHighWaterMark; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CountQueuingStrategy.prototype, "size", { - /** - * Measures the size of `chunk` by always returning 1. - * This ensures that the total queue size is a count of the number of chunks in the queue. - */ - get: function () { - if (!IsCountQueuingStrategy(this)) { - throw countBrandCheckException('size'); - } - return countSizeFunction; - }, - enumerable: false, - configurable: true - }); - return CountQueuingStrategy; - }()); - Object.defineProperties(CountQueuingStrategy.prototype, { - highWaterMark: { enumerable: true }, - size: { enumerable: true } - }); - if (typeof SymbolPolyfill.toStringTag === 'symbol') { - Object.defineProperty(CountQueuingStrategy.prototype, SymbolPolyfill.toStringTag, { - value: 'CountQueuingStrategy', - configurable: true - }); - } - // Helper functions for the CountQueuingStrategy. - function countBrandCheckException(name) { - return new TypeError("CountQueuingStrategy.prototype." + name + " can only be used on a CountQueuingStrategy"); - } - function IsCountQueuingStrategy(x) { - if (!typeIsObject(x)) { - return false; - } - if (!Object.prototype.hasOwnProperty.call(x, '_countQueuingStrategyHighWaterMark')) { - return false; - } - return x instanceof CountQueuingStrategy; - } + // 4. Run report Content Security Policy violations for request. + // TODO - function convertTransformer(original, context) { - assertDictionary(original, context); - var flush = original === null || original === void 0 ? void 0 : original.flush; - var readableType = original === null || original === void 0 ? void 0 : original.readableType; - var start = original === null || original === void 0 ? void 0 : original.start; - var transform = original === null || original === void 0 ? void 0 : original.transform; - var writableType = original === null || original === void 0 ? void 0 : original.writableType; - return { - flush: flush === undefined ? - undefined : - convertTransformerFlushCallback(flush, original, context + " has member 'flush' that"), - readableType: readableType, - start: start === undefined ? - undefined : - convertTransformerStartCallback(start, original, context + " has member 'start' that"), - transform: transform === undefined ? - undefined : - convertTransformerTransformCallback(transform, original, context + " has member 'transform' that"), - writableType: writableType - }; - } - function convertTransformerFlushCallback(fn, original, context) { - assertFunction(fn, context); - return function (controller) { return promiseCall(fn, original, [controller]); }; - } - function convertTransformerStartCallback(fn, original, context) { - assertFunction(fn, context); - return function (controller) { return reflectCall(fn, original, [controller]); }; - } - function convertTransformerTransformCallback(fn, original, context) { - assertFunction(fn, context); - return function (chunk, controller) { return promiseCall(fn, original, [chunk, controller]); }; - } + // 5. Upgrade request to a potentially trustworthy URL, if appropriate. + tryUpgradeRequestToAPotentiallyTrustworthyURL(request) - // Class TransformStream - /** - * A transform stream consists of a pair of streams: a {@link WritableStream | writable stream}, - * known as its writable side, and a {@link ReadableStream | readable stream}, known as its readable side. - * In a manner specific to the transform stream in question, writes to the writable side result in new data being - * made available for reading from the readable side. - * - * @public - */ - var TransformStream = /** @class */ (function () { - function TransformStream(rawTransformer, rawWritableStrategy, rawReadableStrategy) { - if (rawTransformer === void 0) { rawTransformer = {}; } - if (rawWritableStrategy === void 0) { rawWritableStrategy = {}; } - if (rawReadableStrategy === void 0) { rawReadableStrategy = {}; } - if (rawTransformer === undefined) { - rawTransformer = null; - } - var writableStrategy = convertQueuingStrategy(rawWritableStrategy, 'Second parameter'); - var readableStrategy = convertQueuingStrategy(rawReadableStrategy, 'Third parameter'); - var transformer = convertTransformer(rawTransformer, 'First parameter'); - if (transformer.readableType !== undefined) { - throw new RangeError('Invalid readableType specified'); - } - if (transformer.writableType !== undefined) { - throw new RangeError('Invalid writableType specified'); - } - var readableHighWaterMark = ExtractHighWaterMark(readableStrategy, 0); - var readableSizeAlgorithm = ExtractSizeAlgorithm(readableStrategy); - var writableHighWaterMark = ExtractHighWaterMark(writableStrategy, 1); - var writableSizeAlgorithm = ExtractSizeAlgorithm(writableStrategy); - var startPromise_resolve; - var startPromise = newPromise(function (resolve) { - startPromise_resolve = resolve; - }); - InitializeTransformStream(this, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm); - SetUpTransformStreamDefaultControllerFromTransformer(this, transformer); - if (transformer.start !== undefined) { - startPromise_resolve(transformer.start(this._transformStreamController)); - } - else { - startPromise_resolve(undefined); - } - } - Object.defineProperty(TransformStream.prototype, "readable", { - /** - * The readable side of the transform stream. - */ - get: function () { - if (!IsTransformStream(this)) { - throw streamBrandCheckException('readable'); - } - return this._readable; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(TransformStream.prototype, "writable", { - /** - * The writable side of the transform stream. - */ - get: function () { - if (!IsTransformStream(this)) { - throw streamBrandCheckException('writable'); - } - return this._writable; - }, - enumerable: false, - configurable: true - }); - return TransformStream; - }()); - Object.defineProperties(TransformStream.prototype, { - readable: { enumerable: true }, - writable: { enumerable: true } - }); - if (typeof SymbolPolyfill.toStringTag === 'symbol') { - Object.defineProperty(TransformStream.prototype, SymbolPolyfill.toStringTag, { - value: 'TransformStream', - configurable: true - }); - } - function InitializeTransformStream(stream, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm) { - function startAlgorithm() { - return startPromise; - } - function writeAlgorithm(chunk) { - return TransformStreamDefaultSinkWriteAlgorithm(stream, chunk); - } - function abortAlgorithm(reason) { - return TransformStreamDefaultSinkAbortAlgorithm(stream, reason); - } - function closeAlgorithm() { - return TransformStreamDefaultSinkCloseAlgorithm(stream); - } - stream._writable = CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, writableHighWaterMark, writableSizeAlgorithm); - function pullAlgorithm() { - return TransformStreamDefaultSourcePullAlgorithm(stream); - } - function cancelAlgorithm(reason) { - TransformStreamErrorWritableAndUnblockWrite(stream, reason); - return promiseResolvedWith(undefined); - } - stream._readable = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, readableHighWaterMark, readableSizeAlgorithm); - // The [[backpressure]] slot is set to undefined so that it can be initialised by TransformStreamSetBackpressure. - stream._backpressure = undefined; - stream._backpressureChangePromise = undefined; - stream._backpressureChangePromise_resolve = undefined; - TransformStreamSetBackpressure(stream, true); - stream._transformStreamController = undefined; - } - function IsTransformStream(x) { - if (!typeIsObject(x)) { - return false; - } - if (!Object.prototype.hasOwnProperty.call(x, '_transformStreamController')) { - return false; - } - return x instanceof TransformStream; - } - // This is a no-op if both sides are already errored. - function TransformStreamError(stream, e) { - ReadableStreamDefaultControllerError(stream._readable._readableStreamController, e); - TransformStreamErrorWritableAndUnblockWrite(stream, e); - } - function TransformStreamErrorWritableAndUnblockWrite(stream, e) { - TransformStreamDefaultControllerClearAlgorithms(stream._transformStreamController); - WritableStreamDefaultControllerErrorIfNeeded(stream._writable._writableStreamController, e); - if (stream._backpressure) { - // Pretend that pull() was called to permit any pending write() calls to complete. TransformStreamSetBackpressure() - // cannot be called from enqueue() or pull() once the ReadableStream is errored, so this will will be the final time - // _backpressure is set. - TransformStreamSetBackpressure(stream, false); - } - } - function TransformStreamSetBackpressure(stream, backpressure) { - // Passes also when called during construction. - if (stream._backpressureChangePromise !== undefined) { - stream._backpressureChangePromise_resolve(); + // 6. If should request be blocked due to a bad port, should fetching request + // be blocked as mixed content, or should request be blocked by Content + // Security Policy returns blocked, then set response to a network error. + if (requestBadPort(request) === 'blocked') { + response = makeNetworkError('bad port') + } + // TODO: should fetching request be blocked as mixed content? + // TODO: should request be blocked by Content Security Policy? + + // 7. If request’s referrer policy is the empty string, then set request’s + // referrer policy to request’s policy container’s referrer policy. + if (request.referrerPolicy === '') { + request.referrerPolicy = request.policyContainer.referrerPolicy + } + + // 8. If request’s referrer is not "no-referrer", then set request’s + // referrer to the result of invoking determine request’s referrer. + if (request.referrer !== 'no-referrer') { + request.referrer = determineRequestsReferrer(request) + } + + // 9. Set request’s current URL’s scheme to "https" if all of the following + // conditions are true: + // - request’s current URL’s scheme is "http" + // - request’s current URL’s host is a domain + // - Matching request’s current URL’s host per Known HSTS Host Domain Name + // Matching results in either a superdomain match with an asserted + // includeSubDomains directive or a congruent match (with or without an + // asserted includeSubDomains directive). [HSTS] + // TODO + + // 10. If recursive is false, then run the remaining steps in parallel. + // TODO + + // 11. If response is null, then set response to the result of running + // the steps corresponding to the first matching statement: + if (response === null) { + response = await (async () => { + const currentURL = requestCurrentURL(request) + + if ( + // - request’s current URL’s origin is same origin with request’s origin, + // and request’s response tainting is "basic" + (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') || + // request’s current URL’s scheme is "data" + (currentURL.protocol === 'data:') || + // - request’s mode is "navigate" or "websocket" + (request.mode === 'navigate' || request.mode === 'websocket') + ) { + // 1. Set request’s response tainting to "basic". + request.responseTainting = 'basic' + + // 2. Return the result of running scheme fetch given fetchParams. + return await schemeFetch(fetchParams) + } + + // request’s mode is "same-origin" + if (request.mode === 'same-origin') { + // 1. Return a network error. + return makeNetworkError('request mode cannot be "same-origin"') + } + + // request’s mode is "no-cors" + if (request.mode === 'no-cors') { + // 1. If request’s redirect mode is not "follow", then return a network + // error. + if (request.redirect !== 'follow') { + return makeNetworkError( + 'redirect mode cannot be "follow" for "no-cors" request' + ) } - stream._backpressureChangePromise = newPromise(function (resolve) { - stream._backpressureChangePromise_resolve = resolve; - }); - stream._backpressure = backpressure; + + // 2. Set request’s response tainting to "opaque". + request.responseTainting = 'opaque' + + // 3. Return the result of running scheme fetch given fetchParams. + return await schemeFetch(fetchParams) + } + + // request’s current URL’s scheme is not an HTTP(S) scheme + if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) { + // Return a network error. + return makeNetworkError('URL scheme must be a HTTP(S) scheme') + } + + // - request’s use-CORS-preflight flag is set + // - request’s unsafe-request flag is set and either request’s method is + // not a CORS-safelisted method or CORS-unsafe request-header names with + // request’s header list is not empty + // 1. Set request’s response tainting to "cors". + // 2. Let corsWithPreflightResponse be the result of running HTTP fetch + // given fetchParams and true. + // 3. If corsWithPreflightResponse is a network error, then clear cache + // entries using request. + // 4. Return corsWithPreflightResponse. + // TODO + + // Otherwise + // 1. Set request’s response tainting to "cors". + request.responseTainting = 'cors' + + // 2. Return the result of running HTTP fetch given fetchParams. + return await httpFetch(fetchParams) + })() + } + + // 12. If recursive is true, then return response. + if (recursive) { + return response + } + + // 13. If response is not a network error and response is not a filtered + // response, then: + if (response.status !== 0 && !response.internalResponse) { + // If request’s response tainting is "cors", then: + if (request.responseTainting === 'cors') { + // 1. Let headerNames be the result of extracting header list values + // given `Access-Control-Expose-Headers` and response’s header list. + // TODO + // 2. If request’s credentials mode is not "include" and headerNames + // contains `*`, then set response’s CORS-exposed header-name list to + // all unique header names in response’s header list. + // TODO + // 3. Otherwise, if headerNames is not null or failure, then set + // response’s CORS-exposed header-name list to headerNames. + // TODO } - // Class TransformStreamDefaultController - /** - * Allows control of the {@link ReadableStream} and {@link WritableStream} of the associated {@link TransformStream}. - * - * @public - */ - var TransformStreamDefaultController = /** @class */ (function () { - function TransformStreamDefaultController() { - throw new TypeError('Illegal constructor'); - } - Object.defineProperty(TransformStreamDefaultController.prototype, "desiredSize", { - /** - * Returns the desired size to fill the readable side’s internal queue. It can be negative, if the queue is over-full. - */ - get: function () { - if (!IsTransformStreamDefaultController(this)) { - throw defaultControllerBrandCheckException('desiredSize'); - } - var readableController = this._controlledTransformStream._readable._readableStreamController; - return ReadableStreamDefaultControllerGetDesiredSize(readableController); - }, - enumerable: false, - configurable: true - }); - TransformStreamDefaultController.prototype.enqueue = function (chunk) { - if (chunk === void 0) { chunk = undefined; } - if (!IsTransformStreamDefaultController(this)) { - throw defaultControllerBrandCheckException('enqueue'); - } - TransformStreamDefaultControllerEnqueue(this, chunk); - }; - /** - * Errors both the readable side and the writable side of the controlled transform stream, making all future - * interactions with it fail with the given error `e`. Any chunks queued for transformation will be discarded. - */ - TransformStreamDefaultController.prototype.error = function (reason) { - if (reason === void 0) { reason = undefined; } - if (!IsTransformStreamDefaultController(this)) { - throw defaultControllerBrandCheckException('error'); - } - TransformStreamDefaultControllerError(this, reason); - }; - /** - * Closes the readable side and errors the writable side of the controlled transform stream. This is useful when the - * transformer only needs to consume a portion of the chunks written to the writable side. - */ - TransformStreamDefaultController.prototype.terminate = function () { - if (!IsTransformStreamDefaultController(this)) { - throw defaultControllerBrandCheckException('terminate'); - } - TransformStreamDefaultControllerTerminate(this); - }; - return TransformStreamDefaultController; - }()); - Object.defineProperties(TransformStreamDefaultController.prototype, { - enqueue: { enumerable: true }, - error: { enumerable: true }, - terminate: { enumerable: true }, - desiredSize: { enumerable: true } - }); - if (typeof SymbolPolyfill.toStringTag === 'symbol') { - Object.defineProperty(TransformStreamDefaultController.prototype, SymbolPolyfill.toStringTag, { - value: 'TransformStreamDefaultController', - configurable: true - }); + + // Set response to the following filtered response with response as its + // internal response, depending on request’s response tainting: + if (request.responseTainting === 'basic') { + response = filterResponse(response, 'basic') + } else if (request.responseTainting === 'cors') { + response = filterResponse(response, 'cors') + } else if (request.responseTainting === 'opaque') { + response = filterResponse(response, 'opaque') + } else { + assert(false) } - // Transform Stream Default Controller Abstract Operations - function IsTransformStreamDefaultController(x) { - if (!typeIsObject(x)) { - return false; - } - if (!Object.prototype.hasOwnProperty.call(x, '_controlledTransformStream')) { - return false; - } - return x instanceof TransformStreamDefaultController; + } + + // 14. Let internalResponse be response, if response is a network error, + // and response’s internal response otherwise. + let internalResponse = + response.status === 0 ? response : response.internalResponse + + // 15. If internalResponse’s URL list is empty, then set it to a clone of + // request’s URL list. + if (internalResponse.urlList.length === 0) { + internalResponse.urlList.push(...request.urlList) + } + + // 16. If request’s timing allow failed flag is unset, then set + // internalResponse’s timing allow passed flag. + if (!request.timingAllowFailed) { + response.timingAllowPassed = true + } + + // 17. If response is not a network error and any of the following returns + // blocked + // - should internalResponse to request be blocked as mixed content + // - should internalResponse to request be blocked by Content Security Policy + // - should internalResponse to request be blocked due to its MIME type + // - should internalResponse to request be blocked due to nosniff + // TODO + + // 18. If response’s type is "opaque", internalResponse’s status is 206, + // internalResponse’s range-requested flag is set, and request’s header + // list does not contain `Range`, then set response and internalResponse + // to a network error. + if ( + response.type === 'opaque' && + internalResponse.status === 206 && + internalResponse.rangeRequested && + !request.headers.contains('range') + ) { + response = internalResponse = makeNetworkError() + } + + // 19. If response is not a network error and either request’s method is + // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status, + // set internalResponse’s body to null and disregard any enqueuing toward + // it (if any). + if ( + response.status !== 0 && + (request.method === 'HEAD' || + request.method === 'CONNECT' || + nullBodyStatus.includes(internalResponse.status)) + ) { + internalResponse.body = null + fetchParams.controller.dump = true + } + + // 20. If request’s integrity metadata is not the empty string, then: + if (request.integrity) { + // 1. Let processBodyError be this step: run fetch finale given fetchParams + // and a network error. + const processBodyError = (reason) => + fetchFinale(fetchParams, makeNetworkError(reason)) + + // 2. If request’s response tainting is "opaque", or response’s body is null, + // then run processBodyError and abort these steps. + if (request.responseTainting === 'opaque' || response.body == null) { + processBodyError(response.error) + return } - function SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm) { - controller._controlledTransformStream = stream; - stream._transformStreamController = controller; - controller._transformAlgorithm = transformAlgorithm; - controller._flushAlgorithm = flushAlgorithm; + + // 3. Let processBody given bytes be these steps: + const processBody = (bytes) => { + // 1. If bytes do not match request’s integrity metadata, + // then run processBodyError and abort these steps. [SRI] + if (!bytesMatch(bytes, request.integrity)) { + processBodyError('integrity mismatch') + return + } + + // 2. Set response’s body to bytes as a body. + response.body = safelyExtractBody(bytes)[0] + + // 3. Run fetch finale given fetchParams and response. + fetchFinale(fetchParams, response) } - function SetUpTransformStreamDefaultControllerFromTransformer(stream, transformer) { - var controller = Object.create(TransformStreamDefaultController.prototype); - var transformAlgorithm = function (chunk) { - try { - TransformStreamDefaultControllerEnqueue(controller, chunk); - return promiseResolvedWith(undefined); - } - catch (transformResultE) { - return promiseRejectedWith(transformResultE); - } - }; - var flushAlgorithm = function () { return promiseResolvedWith(undefined); }; - if (transformer.transform !== undefined) { - transformAlgorithm = function (chunk) { return transformer.transform(chunk, controller); }; - } - if (transformer.flush !== undefined) { - flushAlgorithm = function () { return transformer.flush(controller); }; - } - SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm); + + // 4. Fully read response’s body given processBody and processBodyError. + await fullyReadBody(response.body, processBody, processBodyError) + } else { + // 21. Otherwise, run fetch finale given fetchParams and response. + fetchFinale(fetchParams, response) + } +} + +// https://fetch.spec.whatwg.org/#concept-scheme-fetch +// given a fetch params fetchParams +function schemeFetch (fetchParams) { + // Note: since the connection is destroyed on redirect, which sets fetchParams to a + // cancelled state, we do not want this condition to trigger *unless* there have been + // no redirects. See https://github.com/nodejs/undici/issues/1776 + // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams. + if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) { + return Promise.resolve(makeAppropriateNetworkError(fetchParams)) + } + + // 2. Let request be fetchParams’s request. + const { request } = fetchParams + + const { protocol: scheme } = requestCurrentURL(request) + + // 3. Switch on request’s current URL’s scheme and run the associated steps: + switch (scheme) { + case 'about:': { + // If request’s current URL’s path is the string "blank", then return a new response + // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) », + // and body is the empty byte sequence as a body. + + // Otherwise, return a network error. + return Promise.resolve(makeNetworkError('about scheme is not supported')) } - function TransformStreamDefaultControllerClearAlgorithms(controller) { - controller._transformAlgorithm = undefined; - controller._flushAlgorithm = undefined; + case 'blob:': { + if (!resolveObjectURL) { + resolveObjectURL = (__nccwpck_require__(14300).resolveObjectURL) + } + + // 1. Let blobURLEntry be request’s current URL’s blob URL entry. + const blobURLEntry = requestCurrentURL(request) + + // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56 + // Buffer.resolveObjectURL does not ignore URL queries. + if (blobURLEntry.search.length !== 0) { + return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.')) + } + + const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString()) + + // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s + // object is not a Blob object, then return a network error. + if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) { + return Promise.resolve(makeNetworkError('invalid method')) + } + + // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object. + const bodyWithType = safelyExtractBody(blobURLEntryObject) + + // 4. Let body be bodyWithType’s body. + const body = bodyWithType[0] + + // 5. Let length be body’s length, serialized and isomorphic encoded. + const length = isomorphicEncode(`${body.length}`) + + // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence. + const type = bodyWithType[1] ?? '' + + // 7. Return a new response whose status message is `OK`, header list is + // « (`Content-Length`, length), (`Content-Type`, type) », and body is body. + const response = makeResponse({ + statusText: 'OK', + headersList: [ + ['content-length', { name: 'Content-Length', value: length }], + ['content-type', { name: 'Content-Type', value: type }] + ] + }) + + response.body = body + + return Promise.resolve(response) } - function TransformStreamDefaultControllerEnqueue(controller, chunk) { - var stream = controller._controlledTransformStream; - var readableController = stream._readable._readableStreamController; - if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(readableController)) { - throw new TypeError('Readable side is not in a state that permits enqueue'); - } - // We throttle transform invocations based on the backpressure of the ReadableStream, but we still - // accept TransformStreamDefaultControllerEnqueue() calls. - try { - ReadableStreamDefaultControllerEnqueue(readableController, chunk); - } - catch (e) { - // This happens when readableStrategy.size() throws. - TransformStreamErrorWritableAndUnblockWrite(stream, e); - throw stream._readable._storedError; - } - var backpressure = ReadableStreamDefaultControllerHasBackpressure(readableController); - if (backpressure !== stream._backpressure) { - TransformStreamSetBackpressure(stream, true); - } + case 'data:': { + // 1. Let dataURLStruct be the result of running the + // data: URL processor on request’s current URL. + const currentURL = requestCurrentURL(request) + const dataURLStruct = dataURLProcessor(currentURL) + + // 2. If dataURLStruct is failure, then return a + // network error. + if (dataURLStruct === 'failure') { + return Promise.resolve(makeNetworkError('failed to fetch the data URL')) + } + + // 3. Let mimeType be dataURLStruct’s MIME type, serialized. + const mimeType = serializeAMimeType(dataURLStruct.mimeType) + + // 4. Return a response whose status message is `OK`, + // header list is « (`Content-Type`, mimeType) », + // and body is dataURLStruct’s body as a body. + return Promise.resolve(makeResponse({ + statusText: 'OK', + headersList: [ + ['content-type', { name: 'Content-Type', value: mimeType }] + ], + body: safelyExtractBody(dataURLStruct.body)[0] + })) } - function TransformStreamDefaultControllerError(controller, e) { - TransformStreamError(controller._controlledTransformStream, e); + case 'file:': { + // For now, unfortunate as it is, file URLs are left as an exercise for the reader. + // When in doubt, return a network error. + return Promise.resolve(makeNetworkError('not implemented... yet...')) } - function TransformStreamDefaultControllerPerformTransform(controller, chunk) { - var transformPromise = controller._transformAlgorithm(chunk); - return transformPromiseWith(transformPromise, undefined, function (r) { - TransformStreamError(controller._controlledTransformStream, r); - throw r; - }); + case 'http:': + case 'https:': { + // Return the result of running HTTP fetch given fetchParams. + + return httpFetch(fetchParams) + .catch((err) => makeNetworkError(err)) } - function TransformStreamDefaultControllerTerminate(controller) { - var stream = controller._controlledTransformStream; - var readableController = stream._readable._readableStreamController; - ReadableStreamDefaultControllerClose(readableController); - var error = new TypeError('TransformStream terminated'); - TransformStreamErrorWritableAndUnblockWrite(stream, error); - } - // TransformStreamDefaultSink Algorithms - function TransformStreamDefaultSinkWriteAlgorithm(stream, chunk) { - var controller = stream._transformStreamController; - if (stream._backpressure) { - var backpressureChangePromise = stream._backpressureChangePromise; - return transformPromiseWith(backpressureChangePromise, function () { - var writable = stream._writable; - var state = writable._state; - if (state === 'erroring') { - throw writable._storedError; - } - return TransformStreamDefaultControllerPerformTransform(controller, chunk); - }); - } - return TransformStreamDefaultControllerPerformTransform(controller, chunk); - } - function TransformStreamDefaultSinkAbortAlgorithm(stream, reason) { - // abort() is not called synchronously, so it is possible for abort() to be called when the stream is already - // errored. - TransformStreamError(stream, reason); - return promiseResolvedWith(undefined); - } - function TransformStreamDefaultSinkCloseAlgorithm(stream) { - // stream._readable cannot change after construction, so caching it across a call to user code is safe. - var readable = stream._readable; - var controller = stream._transformStreamController; - var flushPromise = controller._flushAlgorithm(); - TransformStreamDefaultControllerClearAlgorithms(controller); - // Return a promise that is fulfilled with undefined on success. - return transformPromiseWith(flushPromise, function () { - if (readable._state === 'errored') { - throw readable._storedError; - } - ReadableStreamDefaultControllerClose(readable._readableStreamController); - }, function (r) { - TransformStreamError(stream, r); - throw readable._storedError; - }); + default: { + return Promise.resolve(makeNetworkError('unknown scheme')) } - // TransformStreamDefaultSource Algorithms - function TransformStreamDefaultSourcePullAlgorithm(stream) { - // Invariant. Enforced by the promises returned by start() and pull(). - TransformStreamSetBackpressure(stream, false); - // Prevent the next pull() call until there is backpressure. - return stream._backpressureChangePromise; + } +} + +// https://fetch.spec.whatwg.org/#finalize-response +function finalizeResponse (fetchParams, response) { + // 1. Set fetchParams’s request’s done flag. + fetchParams.request.done = true + + // 2, If fetchParams’s process response done is not null, then queue a fetch + // task to run fetchParams’s process response done given response, with + // fetchParams’s task destination. + if (fetchParams.processResponseDone != null) { + queueMicrotask(() => fetchParams.processResponseDone(response)) + } +} + +// https://fetch.spec.whatwg.org/#fetch-finale +function fetchFinale (fetchParams, response) { + // 1. If response is a network error, then: + if (response.type === 'error') { + // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ». + response.urlList = [fetchParams.request.urlList[0]] + + // 2. Set response’s timing info to the result of creating an opaque timing + // info for fetchParams’s timing info. + response.timingInfo = createOpaqueTimingInfo({ + startTime: fetchParams.timingInfo.startTime + }) + } + + // 2. Let processResponseEndOfBody be the following steps: + const processResponseEndOfBody = () => { + // 1. Set fetchParams’s request’s done flag. + fetchParams.request.done = true + + // If fetchParams’s process response end-of-body is not null, + // then queue a fetch task to run fetchParams’s process response + // end-of-body given response with fetchParams’s task destination. + if (fetchParams.processResponseEndOfBody != null) { + queueMicrotask(() => fetchParams.processResponseEndOfBody(response)) } - // Helper functions for the TransformStreamDefaultController. - function defaultControllerBrandCheckException(name) { - return new TypeError("TransformStreamDefaultController.prototype." + name + " can only be used on a TransformStreamDefaultController"); + } + + // 3. If fetchParams’s process response is non-null, then queue a fetch task + // to run fetchParams’s process response given response, with fetchParams’s + // task destination. + if (fetchParams.processResponse != null) { + queueMicrotask(() => fetchParams.processResponse(response)) + } + + // 4. If response’s body is null, then run processResponseEndOfBody. + if (response.body == null) { + processResponseEndOfBody() + } else { + // 5. Otherwise: + + // 1. Let transformStream be a new a TransformStream. + + // 2. Let identityTransformAlgorithm be an algorithm which, given chunk, + // enqueues chunk in transformStream. + const identityTransformAlgorithm = (chunk, controller) => { + controller.enqueue(chunk) } - // Helper functions for the TransformStream. - function streamBrandCheckException(name) { - return new TypeError("TransformStream.prototype." + name + " can only be used on a TransformStream"); + + // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm + // and flushAlgorithm set to processResponseEndOfBody. + const transformStream = new TransformStream({ + start () {}, + transform: identityTransformAlgorithm, + flush: processResponseEndOfBody + }, { + size () { + return 1 + } + }, { + size () { + return 1 + } + }) + + // 4. Set response’s body to the result of piping response’s body through transformStream. + response.body = { stream: response.body.stream.pipeThrough(transformStream) } + } + + // 6. If fetchParams’s process response consume body is non-null, then: + if (fetchParams.processResponseConsumeBody != null) { + // 1. Let processBody given nullOrBytes be this step: run fetchParams’s + // process response consume body given response and nullOrBytes. + const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes) + + // 2. Let processBodyError be this step: run fetchParams’s process + // response consume body given response and failure. + const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure) + + // 3. If response’s body is null, then queue a fetch task to run processBody + // given null, with fetchParams’s task destination. + if (response.body == null) { + queueMicrotask(() => processBody(null)) + } else { + // 4. Otherwise, fully read response’s body given processBody, processBodyError, + // and fetchParams’s task destination. + return fullyReadBody(response.body, processBody, processBodyError) } + return Promise.resolve() + } +} - exports.ByteLengthQueuingStrategy = ByteLengthQueuingStrategy; - exports.CountQueuingStrategy = CountQueuingStrategy; - exports.ReadableByteStreamController = ReadableByteStreamController; - exports.ReadableStream = ReadableStream; - exports.ReadableStreamBYOBReader = ReadableStreamBYOBReader; - exports.ReadableStreamBYOBRequest = ReadableStreamBYOBRequest; - exports.ReadableStreamDefaultController = ReadableStreamDefaultController; - exports.ReadableStreamDefaultReader = ReadableStreamDefaultReader; - exports.TransformStream = TransformStream; - exports.TransformStreamDefaultController = TransformStreamDefaultController; - exports.WritableStream = WritableStream; - exports.WritableStreamDefaultController = WritableStreamDefaultController; - exports.WritableStreamDefaultWriter = WritableStreamDefaultWriter; +// https://fetch.spec.whatwg.org/#http-fetch +async function httpFetch (fetchParams) { + // 1. Let request be fetchParams’s request. + const request = fetchParams.request - Object.defineProperty(exports, '__esModule', { value: true }); + // 2. Let response be null. + let response = null -}))); -//# sourceMappingURL=ponyfill.js.map + // 3. Let actualResponse be null. + let actualResponse = null + // 4. Let timingInfo be fetchParams’s timing info. + const timingInfo = fetchParams.timingInfo -/***/ }), + // 5. If request’s service-workers mode is "all", then: + if (request.serviceWorkers === 'all') { + // TODO + } -/***/ 79019: ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 -/***/ ((module) => { + // 6. If response is null, then: + if (response === null) { + // 1. If makeCORSPreflight is true and one of these conditions is true: + // TODO -// Returns a wrapper function that returns a wrapped callback -// The wrapper function should do some stuff, and return a -// presumably different callback function. -// This makes sure that own properties are retained, so that -// decorations and such are not lost along the way. -module.exports = wrappy -function wrappy (fn, cb) { - if (fn && cb) return wrappy(fn)(cb) + // 2. If request’s redirect mode is "follow", then set request’s + // service-workers mode to "none". + if (request.redirect === 'follow') { + request.serviceWorkers = 'none' + } - if (typeof fn !== 'function') - throw new TypeError('need wrapper function') + // 3. Set response and actualResponse to the result of running + // HTTP-network-or-cache fetch given fetchParams. + actualResponse = response = await httpNetworkOrCacheFetch(fetchParams) - Object.keys(fn).forEach(function (k) { - wrapper[k] = fn[k] - }) + // 4. If request’s response tainting is "cors" and a CORS check + // for request and response returns failure, then return a network error. + if ( + request.responseTainting === 'cors' && + corsCheck(request, response) === 'failure' + ) { + return makeNetworkError('cors failure') + } - return wrapper + // 5. If the TAO check for request and response returns failure, then set + // request’s timing allow failed flag. + if (TAOCheck(request, response) === 'failure') { + request.timingAllowFailed = true + } + } - function wrapper() { - var args = new Array(arguments.length) - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i] + // 7. If either request’s response tainting or response’s type + // is "opaque", and the cross-origin resource policy check with + // request’s origin, request’s client, request’s destination, + // and actualResponse returns blocked, then return a network error. + if ( + (request.responseTainting === 'opaque' || response.type === 'opaque') && + crossOriginResourcePolicyCheck( + request.origin, + request.client, + request.destination, + actualResponse + ) === 'blocked' + ) { + return makeNetworkError('blocked') + } + + // 8. If actualResponse’s status is a redirect status, then: + if (redirectStatusSet.has(actualResponse.status)) { + // 1. If actualResponse’s status is not 303, request’s body is not null, + // and the connection uses HTTP/2, then user agents may, and are even + // encouraged to, transmit an RST_STREAM frame. + // See, https://github.com/whatwg/fetch/issues/1288 + if (request.redirect !== 'manual') { + fetchParams.controller.connection.destroy() } - var ret = fn.apply(this, args) - var cb = args[args.length-1] - if (typeof ret === 'function' && ret !== cb) { - Object.keys(cb).forEach(function (k) { - ret[k] = cb[k] - }) + + // 2. Switch on request’s redirect mode: + if (request.redirect === 'error') { + // Set response to a network error. + response = makeNetworkError('unexpected redirect') + } else if (request.redirect === 'manual') { + // Set response to an opaque-redirect filtered response whose internal + // response is actualResponse. + // NOTE(spec): On the web this would return an `opaqueredirect` response, + // but that doesn't make sense server side. + // See https://github.com/nodejs/undici/issues/1193. + response = actualResponse + } else if (request.redirect === 'follow') { + // Set response to the result of running HTTP-redirect fetch given + // fetchParams and response. + response = await httpRedirectFetch(fetchParams, response) + } else { + assert(false) } - return ret } + + // 9. Set response’s timing info to timingInfo. + response.timingInfo = timingInfo + + // 10. Return response. + return response } +// https://fetch.spec.whatwg.org/#http-redirect-fetch +function httpRedirectFetch (fetchParams, response) { + // 1. Let request be fetchParams’s request. + const request = fetchParams.request -/***/ }), + // 2. Let actualResponse be response, if response is not a filtered response, + // and response’s internal response otherwise. + const actualResponse = response.internalResponse + ? response.internalResponse + : response -<<<<<<< HEAD -/***/ 83251: -/***/ ((module) => { + // 3. Let locationURL be actualResponse’s location URL given request’s current + // URL’s fragment. + let locationURL -module.exports = eval("require")("electron"); + try { + locationURL = responseLocationURL( + actualResponse, + requestCurrentURL(request).hash + ) + // 4. If locationURL is null, then return response. + if (locationURL == null) { + return response + } + } catch (err) { + // 5. If locationURL is failure, then return a network error. + return Promise.resolve(makeNetworkError(err)) + } -/***/ }), + // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network + // error. + if (!urlIsHttpHttpsScheme(locationURL)) { + return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme')) + } -/***/ 39491: -/***/ ((module) => { + // 7. If request’s redirect count is 20, then return a network error. + if (request.redirectCount === 20) { + return Promise.resolve(makeNetworkError('redirect count exceeded')) + } -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("assert"); + // 8. Increase request’s redirect count by 1. + request.redirectCount += 1 -/***/ }), + // 9. If request’s mode is "cors", locationURL includes credentials, and + // request’s origin is not same origin with locationURL’s origin, then return + // a network error. + if ( + request.mode === 'cors' && + (locationURL.username || locationURL.password) && + !sameOrigin(request, locationURL) + ) { + return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"')) + } -/***/ 50852: -/***/ ((module) => { + // 10. If request’s response tainting is "cors" and locationURL includes + // credentials, then return a network error. + if ( + request.responseTainting === 'cors' && + (locationURL.username || locationURL.password) + ) { + return Promise.resolve(makeNetworkError( + 'URL cannot contain credentials for request mode "cors"' + )) + } -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("async_hooks"); + // 11. If actualResponse’s status is not 303, request’s body is non-null, + // and request’s body’s source is null, then return a network error. + if ( + actualResponse.status !== 303 && + request.body != null && + request.body.source == null + ) { + return Promise.resolve(makeNetworkError()) + } -/***/ }), + // 12. If one of the following is true + // - actualResponse’s status is 301 or 302 and request’s method is `POST` + // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD` + if ( + ([301, 302].includes(actualResponse.status) && request.method === 'POST') || + (actualResponse.status === 303 && + !GET_OR_HEAD.includes(request.method)) + ) { + // then: + // 1. Set request’s method to `GET` and request’s body to null. + request.method = 'GET' + request.body = null -/***/ 14300: -/***/ ((module) => { + // 2. For each headerName of request-body-header name, delete headerName from + // request’s header list. + for (const headerName of requestBodyHeader) { + request.headersList.delete(headerName) + } + } -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("buffer"); + // 13. If request’s current URL’s origin is not same origin with locationURL’s + // origin, then for each headerName of CORS non-wildcard request-header name, + // delete headerName from request’s header list. + if (!sameOrigin(requestCurrentURL(request), locationURL)) { + // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name + request.headersList.delete('authorization') -/***/ }), + // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement. + request.headersList.delete('cookie') + request.headersList.delete('host') + } -/***/ 32081: -/***/ ((module) => { + // 14. If request’s body is non-null, then set request’s body to the first return + // value of safely extracting request’s body’s source. + if (request.body != null) { + assert(request.body.source != null) + request.body = safelyExtractBody(request.body.source)[0] + } -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("child_process"); + // 15. Let timingInfo be fetchParams’s timing info. + const timingInfo = fetchParams.timingInfo -/***/ }), + // 16. Set timingInfo’s redirect end time and post-redirect start time to the + // coarsened shared current time given fetchParams’s cross-origin isolated + // capability. + timingInfo.redirectEndTime = timingInfo.postRedirectStartTime = + coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability) -/***/ 96206: -/***/ ((module) => { + // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s + // redirect start time to timingInfo’s start time. + if (timingInfo.redirectStartTime === 0) { + timingInfo.redirectStartTime = timingInfo.startTime + } -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("console"); + // 18. Append locationURL to request’s URL list. + request.urlList.push(locationURL) -/***/ }), + // 19. Invoke set request’s referrer policy on redirect on request and + // actualResponse. + setRequestReferrerPolicyOnRedirect(request, actualResponse) -/***/ 22057: -/***/ ((module) => { + // 20. Return the result of running main fetch given fetchParams and true. + return mainFetch(fetchParams, true) +} -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("constants"); +// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch +async function httpNetworkOrCacheFetch ( + fetchParams, + isAuthenticationFetch = false, + isNewConnectionFetch = false +) { + // 1. Let request be fetchParams’s request. + const request = fetchParams.request -/***/ }), + // 2. Let httpFetchParams be null. + let httpFetchParams = null -/***/ 6113: -/***/ ((module) => { + // 3. Let httpRequest be null. + let httpRequest = null -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("crypto"); + // 4. Let response be null. + let response = null -/***/ }), + // 5. Let storedResponse be null. + // TODO: cache -/***/ 67643: -/***/ ((module) => { + // 6. Let httpCache be null. + const httpCache = null -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("diagnostics_channel"); + // 7. Let the revalidatingFlag be unset. + const revalidatingFlag = false -/***/ }), + // 8. Run these steps, but abort when the ongoing fetch is terminated: + + // 1. If request’s window is "no-window" and request’s redirect mode is + // "error", then set httpFetchParams to fetchParams and httpRequest to + // request. + if (request.window === 'no-window' && request.redirect === 'error') { + httpFetchParams = fetchParams + httpRequest = request + } else { + // Otherwise: + + // 1. Set httpRequest to a clone of request. + httpRequest = makeRequest(request) -/***/ 82361: -/***/ ((module) => { + // 2. Set httpFetchParams to a copy of fetchParams. + httpFetchParams = { ...fetchParams } -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("events"); + // 3. Set httpFetchParams’s request to httpRequest. + httpFetchParams.request = httpRequest + } -/***/ }), + // 3. Let includeCredentials be true if one of + const includeCredentials = + request.credentials === 'include' || + (request.credentials === 'same-origin' && + request.responseTainting === 'basic') -/***/ 57147: -/***/ ((module) => { + // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s + // body is non-null; otherwise null. + const contentLength = httpRequest.body ? httpRequest.body.length : null -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs"); + // 5. Let contentLengthHeaderValue be null. + let contentLengthHeaderValue = null -/***/ }), + // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or + // `PUT`, then set contentLengthHeaderValue to `0`. + if ( + httpRequest.body == null && + ['POST', 'PUT'].includes(httpRequest.method) + ) { + contentLengthHeaderValue = '0' + } -/***/ 13685: -/***/ ((module) => { + // 7. If contentLength is non-null, then set contentLengthHeaderValue to + // contentLength, serialized and isomorphic encoded. + if (contentLength != null) { + contentLengthHeaderValue = isomorphicEncode(`${contentLength}`) + } -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http"); + // 8. If contentLengthHeaderValue is non-null, then append + // `Content-Length`/contentLengthHeaderValue to httpRequest’s header + // list. + if (contentLengthHeaderValue != null) { + httpRequest.headersList.append('content-length', contentLengthHeaderValue) + } -/***/ }), + // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`, + // contentLengthHeaderValue) to httpRequest’s header list. -/***/ 85158: -/***/ ((module) => { + // 10. If contentLength is non-null and httpRequest’s keepalive is true, + // then: + if (contentLength != null && httpRequest.keepalive) { + // NOTE: keepalive is a noop outside of browser context. + } -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http2"); + // 11. If httpRequest’s referrer is a URL, then append + // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded, + // to httpRequest’s header list. + if (httpRequest.referrer instanceof URL) { + httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href)) + } -/***/ }), + // 12. Append a request `Origin` header for httpRequest. + appendRequestOriginHeader(httpRequest) -/***/ 95687: -/***/ ((module) => { + // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA] + appendFetchMetadata(httpRequest) -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("https"); + // 14. If httpRequest’s header list does not contain `User-Agent`, then + // user agents should append `User-Agent`/default `User-Agent` value to + // httpRequest’s header list. + if (!httpRequest.headersList.contains('user-agent')) { + httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node') + } -/***/ }), + // 15. If httpRequest’s cache mode is "default" and httpRequest’s header + // list contains `If-Modified-Since`, `If-None-Match`, + // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set + // httpRequest’s cache mode to "no-store". + if ( + httpRequest.cache === 'default' && + (httpRequest.headersList.contains('if-modified-since') || + httpRequest.headersList.contains('if-none-match') || + httpRequest.headersList.contains('if-unmodified-since') || + httpRequest.headersList.contains('if-match') || + httpRequest.headersList.contains('if-range')) + ) { + httpRequest.cache = 'no-store' + } -/***/ 41808: -/***/ ((module) => { + // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent + // no-cache cache-control header modification flag is unset, and + // httpRequest’s header list does not contain `Cache-Control`, then append + // `Cache-Control`/`max-age=0` to httpRequest’s header list. + if ( + httpRequest.cache === 'no-cache' && + !httpRequest.preventNoCacheCacheControlHeaderModification && + !httpRequest.headersList.contains('cache-control') + ) { + httpRequest.headersList.append('cache-control', 'max-age=0') + } -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("net"); + // 17. If httpRequest’s cache mode is "no-store" or "reload", then: + if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') { + // 1. If httpRequest’s header list does not contain `Pragma`, then append + // `Pragma`/`no-cache` to httpRequest’s header list. + if (!httpRequest.headersList.contains('pragma')) { + httpRequest.headersList.append('pragma', 'no-cache') + } -/***/ }), + // 2. If httpRequest’s header list does not contain `Cache-Control`, + // then append `Cache-Control`/`no-cache` to httpRequest’s header list. + if (!httpRequest.headersList.contains('cache-control')) { + httpRequest.headersList.append('cache-control', 'no-cache') + } + } -/***/ 15673: -/***/ ((module) => { + // 18. If httpRequest’s header list contains `Range`, then append + // `Accept-Encoding`/`identity` to httpRequest’s header list. + if (httpRequest.headersList.contains('range')) { + httpRequest.headersList.append('accept-encoding', 'identity') + } -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:events"); + // 19. Modify httpRequest’s header list per HTTP. Do not append a given + // header if httpRequest’s header list contains that header’s name. + // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129 + if (!httpRequest.headersList.contains('accept-encoding')) { + if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) { + httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate') + } else { + httpRequest.headersList.append('accept-encoding', 'gzip, deflate') + } + } -/***/ }), + httpRequest.headersList.delete('host') -/***/ 84492: -/***/ ((module) => { + // 20. If includeCredentials is true, then: + if (includeCredentials) { + // 1. If the user agent is not configured to block cookies for httpRequest + // (see section 7 of [COOKIES]), then: + // TODO: credentials + // 2. If httpRequest’s header list does not contain `Authorization`, then: + // TODO: credentials + } -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream"); + // 21. If there’s a proxy-authentication entry, use it as appropriate. + // TODO: proxy-authentication -/***/ }), + // 22. Set httpCache to the result of determining the HTTP cache + // partition, given httpRequest. + // TODO: cache -/***/ 47261: -/***/ ((module) => { + // 23. If httpCache is null, then set httpRequest’s cache mode to + // "no-store". + if (httpCache == null) { + httpRequest.cache = 'no-store' + } -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:util"); + // 24. If httpRequest’s cache mode is neither "no-store" nor "reload", + // then: + if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') { + // TODO: cache + } -/***/ }), + // 9. If aborted, then return the appropriate network error for fetchParams. + // TODO -/***/ 22037: -/***/ ((module) => { + // 10. If response is null, then: + if (response == null) { + // 1. If httpRequest’s cache mode is "only-if-cached", then return a + // network error. + if (httpRequest.mode === 'only-if-cached') { + return makeNetworkError('only if cached') + } -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("os"); + // 2. Let forwardResponse be the result of running HTTP-network fetch + // given httpFetchParams, includeCredentials, and isNewConnectionFetch. + const forwardResponse = await httpNetworkFetch( + httpFetchParams, + includeCredentials, + isNewConnectionFetch + ) -/***/ }), + // 3. If httpRequest’s method is unsafe and forwardResponse’s status is + // in the range 200 to 399, inclusive, invalidate appropriate stored + // responses in httpCache, as per the "Invalidation" chapter of HTTP + // Caching, and set storedResponse to null. [HTTP-CACHING] + if ( + !safeMethodsSet.has(httpRequest.method) && + forwardResponse.status >= 200 && + forwardResponse.status <= 399 + ) { + // TODO: cache + } -/***/ 71017: -/***/ ((module) => { + // 4. If the revalidatingFlag is set and forwardResponse’s status is 304, + // then: + if (revalidatingFlag && forwardResponse.status === 304) { + // TODO: cache + } -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("path"); + // 5. If response is null, then: + if (response == null) { + // 1. Set response to forwardResponse. + response = forwardResponse -/***/ }), + // 2. Store httpRequest and forwardResponse in httpCache, as per the + // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING] + // TODO: cache + } + } -/***/ 4074: -/***/ ((module) => { + // 11. Set response’s URL list to a clone of httpRequest’s URL list. + response.urlList = [...httpRequest.urlList] -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("perf_hooks"); + // 12. If httpRequest’s header list contains `Range`, then set response’s + // range-requested flag. + if (httpRequest.headersList.contains('range')) { + response.rangeRequested = true + } -/***/ }), + // 13. Set response’s request-includes-credentials to includeCredentials. + response.requestIncludesCredentials = includeCredentials -/***/ 77282: -/***/ ((module) => { + // 14. If response’s status is 401, httpRequest’s response tainting is not + // "cors", includeCredentials is true, and request’s window is an environment + // settings object, then: + // TODO -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("process"); + // 15. If response’s status is 407, then: + if (response.status === 407) { + // 1. If request’s window is "no-window", then return a network error. + if (request.window === 'no-window') { + return makeNetworkError() + } -/***/ }), + // 2. ??? -/***/ 63477: -/***/ ((module) => { + // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams. + if (isCancelled(fetchParams)) { + return makeAppropriateNetworkError(fetchParams) + } -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("querystring"); + // 4. Prompt the end user as appropriate in request’s window and store + // the result as a proxy-authentication entry. [HTTP-AUTH] + // TODO: Invoke some kind of callback? -/***/ }), + // 5. Set response to the result of running HTTP-network-or-cache fetch given + // fetchParams. + // TODO + return makeNetworkError('proxy authentication required') + } -/***/ 12781: -/***/ ((module) => { + // 16. If all of the following are true + if ( + // response’s status is 421 + response.status === 421 && + // isNewConnectionFetch is false + !isNewConnectionFetch && + // request’s body is null, or request’s body is non-null and request’s body’s source is non-null + (request.body == null || request.body.source != null) + ) { + // then: -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream"); + // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams. + if (isCancelled(fetchParams)) { + return makeAppropriateNetworkError(fetchParams) + } -/***/ }), + // 2. Set response to the result of running HTTP-network-or-cache + // fetch given fetchParams, isAuthenticationFetch, and true. -/***/ 35356: -/***/ ((module) => { + // TODO (spec): The spec doesn't specify this but we need to cancel + // the active response before we can start a new one. + // https://github.com/whatwg/fetch/issues/1293 + fetchParams.controller.connection.destroy() -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream/web"); + response = await httpNetworkOrCacheFetch( + fetchParams, + isAuthenticationFetch, + true + ) + } -/***/ }), + // 17. If isAuthenticationFetch is true, then create an authentication entry + if (isAuthenticationFetch) { + // TODO + } -/***/ 71576: -/***/ ((module) => { + // 18. Return response. + return response +} -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("string_decoder"); +// https://fetch.spec.whatwg.org/#http-network-fetch +async function httpNetworkFetch ( + fetchParams, + includeCredentials = false, + forceNewConnection = false +) { + assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed) -/***/ }), + fetchParams.controller.connection = { + abort: null, + destroyed: false, + destroy (err) { + if (!this.destroyed) { + this.destroyed = true + this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError')) + } + } + } -/***/ 24404: -/***/ ((module) => { + // 1. Let request be fetchParams’s request. + const request = fetchParams.request -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("tls"); + // 2. Let response be null. + let response = null -/***/ }), + // 3. Let timingInfo be fetchParams’s timing info. + const timingInfo = fetchParams.timingInfo -/***/ 76224: -/***/ ((module) => { + // 4. Let httpCache be the result of determining the HTTP cache partition, + // given request. + // TODO: cache + const httpCache = null -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("tty"); + // 5. If httpCache is null, then set request’s cache mode to "no-store". + if (httpCache == null) { + request.cache = 'no-store' + } -/***/ }), + // 6. Let networkPartitionKey be the result of determining the network + // partition key given request. + // TODO -/***/ 57310: -/***/ ((module) => { + // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise + // "no". + const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("url"); + // 8. Switch on request’s mode: + if (request.mode === 'websocket') { + // Let connection be the result of obtaining a WebSocket connection, + // given request’s current URL. + // TODO + } else { + // Let connection be the result of obtaining a connection, given + // networkPartitionKey, request’s current URL’s origin, + // includeCredentials, and forceNewConnection. + // TODO + } -/***/ }), + // 9. Run these steps, but abort when the ongoing fetch is terminated: -/***/ 73837: -/***/ ((module) => { + // 1. If connection is failure, then return a network error. -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("util"); + // 2. Set timingInfo’s final connection timing info to the result of + // calling clamp and coarsen connection timing info with connection’s + // timing info, timingInfo’s post-redirect start time, and fetchParams’s + // cross-origin isolated capability. -/***/ }), + // 3. If connection is not an HTTP/2 connection, request’s body is non-null, + // and request’s body’s source is null, then append (`Transfer-Encoding`, + // `chunked`) to request’s header list. -/***/ 29830: -/***/ ((module) => { + // 4. Set timingInfo’s final network-request start time to the coarsened + // shared current time given fetchParams’s cross-origin isolated + // capability. -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("util/types"); + // 5. Set response to the result of making an HTTP request over connection + // using request with the following caveats: -/***/ }), + // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS] + // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH] -/***/ 71267: -/***/ ((module) => { + // - If request’s body is non-null, and request’s body’s source is null, + // then the user agent may have a buffer of up to 64 kibibytes and store + // a part of request’s body in that buffer. If the user agent reads from + // request’s body beyond that buffer’s size and the user agent needs to + // resend request, then instead return a network error. -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("worker_threads"); + // - Set timingInfo’s final network-response start time to the coarsened + // shared current time given fetchParams’s cross-origin isolated capability, + // immediately after the user agent’s HTTP parser receives the first byte + // of the response (e.g., frame header bytes for HTTP/2 or response status + // line for HTTP/1.x). -/***/ }), + // - Wait until all the headers are transmitted. -/***/ 59796: -/***/ ((module) => { + // - Any responses whose status is in the range 100 to 199, inclusive, + // and is not 101, are to be ignored, except for the purposes of setting + // timingInfo’s final network-response start time above. -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("zlib"); + // - If request’s header list contains `Transfer-Encoding`/`chunked` and + // response is transferred via HTTP/1.0 or older, then return a network + // error. -/***/ }), + // - If the HTTP request results in a TLS client certificate dialog, then: -/***/ 94438: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // 1. If request’s window is an environment settings object, make the + // dialog available in request’s window. + // 2. Otherwise, return a network error. + // To transmit request’s body body, run these steps: + let requestBody = null + // 1. If body is null and fetchParams’s process request end-of-body is + // non-null, then queue a fetch task given fetchParams’s process request + // end-of-body and fetchParams’s task destination. + if (request.body == null && fetchParams.processRequestEndOfBody) { + queueMicrotask(() => fetchParams.processRequestEndOfBody()) + } else if (request.body != null) { + // 2. Otherwise, if body is non-null: -const WritableStream = (__nccwpck_require__(84492).Writable) -const inherits = (__nccwpck_require__(47261).inherits) + // 1. Let processBodyChunk given bytes be these steps: + const processBodyChunk = async function * (bytes) { + // 1. If the ongoing fetch is terminated, then abort these steps. + if (isCancelled(fetchParams)) { + return + } -const StreamSearch = __nccwpck_require__(10004) + // 2. Run this step in parallel: transmit bytes. + yield bytes -const PartStream = __nccwpck_require__(20453) -const HeaderParser = __nccwpck_require__(21200) + // 3. If fetchParams’s process request body is non-null, then run + // fetchParams’s process request body given bytes’s length. + fetchParams.processRequestBodyChunkLength?.(bytes.byteLength) + } -const DASH = 45 -const B_ONEDASH = Buffer.from('-') -const B_CRLF = Buffer.from('\r\n') -const EMPTY_FN = function () {} + // 2. Let processEndOfBody be these steps: + const processEndOfBody = () => { + // 1. If fetchParams is canceled, then abort these steps. + if (isCancelled(fetchParams)) { + return + } -function Dicer (cfg) { - if (!(this instanceof Dicer)) { return new Dicer(cfg) } - WritableStream.call(this, cfg) + // 2. If fetchParams’s process request end-of-body is non-null, + // then run fetchParams’s process request end-of-body. + if (fetchParams.processRequestEndOfBody) { + fetchParams.processRequestEndOfBody() + } + } - if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') } + // 3. Let processBodyError given e be these steps: + const processBodyError = (e) => { + // 1. If fetchParams is canceled, then abort these steps. + if (isCancelled(fetchParams)) { + return + } - if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined } + // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller. + if (e.name === 'AbortError') { + fetchParams.controller.abort() + } else { + fetchParams.controller.terminate(e) + } + } - this._headerFirst = cfg.headerFirst + // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody, + // processBodyError, and fetchParams’s task destination. + requestBody = (async function * () { + try { + for await (const bytes of request.body.stream) { + yield * processBodyChunk(bytes) + } + processEndOfBody() + } catch (err) { + processBodyError(err) + } + })() + } - this._dashes = 0 - this._parts = 0 - this._finished = false - this._realFinish = false - this._isPreamble = true - this._justMatched = false - this._firstWrite = true - this._inHeader = true - this._part = undefined - this._cb = undefined - this._ignoreData = false - this._partOpts = { highWaterMark: cfg.partHwm } - this._pause = false + try { + // socket is only provided for websockets + const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody }) - const self = this - this._hparser = new HeaderParser(cfg) - this._hparser.on('header', function (header) { - self._inHeader = false - self._part.emit('header', header) - }) -} -inherits(Dicer, WritableStream) + if (socket) { + response = makeResponse({ status, statusText, headersList, socket }) + } else { + const iterator = body[Symbol.asyncIterator]() + fetchParams.controller.next = () => iterator.next() -Dicer.prototype.emit = function (ev) { - if (ev === 'finish' && !this._realFinish) { - if (!this._finished) { - const self = this - process.nextTick(function () { - self.emit('error', new Error('Unexpected end of multipart data')) - if (self._part && !self._ignoreData) { - const type = (self._isPreamble ? 'Preamble' : 'Part') - self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data')) - self._part.push(null) - process.nextTick(function () { - self._realFinish = true - self.emit('finish') - self._realFinish = false - }) - return - } - self._realFinish = true - self.emit('finish') - self._realFinish = false - }) + response = makeResponse({ status, statusText, headersList }) } - } else { WritableStream.prototype.emit.apply(this, arguments) } -} - -Dicer.prototype._write = function (data, encoding, cb) { - // ignore unexpected data (e.g. extra trailer data after finished) - if (!this._hparser && !this._bparser) { return cb() } + } catch (err) { + // 10. If aborted, then: + if (err.name === 'AbortError') { + // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame. + fetchParams.controller.connection.destroy() - if (this._headerFirst && this._isPreamble) { - if (!this._part) { - this._part = new PartStream(this._partOpts) - if (this._events.preamble) { this.emit('preamble', this._part) } else { this._ignore() } + // 2. Return the appropriate network error for fetchParams. + return makeAppropriateNetworkError(fetchParams, err) } - const r = this._hparser.push(data) - if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() } - } - // allows for "easier" testing - if (this._firstWrite) { - this._bparser.push(B_CRLF) - this._firstWrite = false + return makeNetworkError(err) } - this._bparser.push(data) + // 11. Let pullAlgorithm be an action that resumes the ongoing fetch + // if it is suspended. + const pullAlgorithm = () => { + fetchParams.controller.resume() + } - if (this._pause) { this._cb = cb } else { cb() } -} + // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s + // controller with reason, given reason. + const cancelAlgorithm = (reason) => { + fetchParams.controller.abort(reason) + } -Dicer.prototype.reset = function () { - this._part = undefined - this._bparser = undefined - this._hparser = undefined -} + // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by + // the user agent. + // TODO -Dicer.prototype.setBoundary = function (boundary) { - const self = this - this._bparser = new StreamSearch('\r\n--' + boundary) - this._bparser.on('info', function (isMatch, data, start, end) { - self._oninfo(isMatch, data, start, end) - }) -} + // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object + // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent. + // TODO -Dicer.prototype._ignore = function () { - if (this._part && !this._ignoreData) { - this._ignoreData = true - this._part.on('error', EMPTY_FN) - // we must perform some kind of read on the stream even though we are - // ignoring the data, otherwise node's Readable stream will not emit 'end' - // after pushing null to the stream - this._part.resume() + // 15. Let stream be a new ReadableStream. + // 16. Set up stream with pullAlgorithm set to pullAlgorithm, + // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to + // highWaterMark, and sizeAlgorithm set to sizeAlgorithm. + if (!ReadableStream) { + ReadableStream = (__nccwpck_require__(35356).ReadableStream) } -} - -Dicer.prototype._oninfo = function (isMatch, data, start, end) { - let buf; const self = this; let i = 0; let r; let shouldWriteMore = true - if (!this._part && this._justMatched && data) { - while (this._dashes < 2 && (start + i) < end) { - if (data[start + i] === DASH) { - ++i - ++this._dashes - } else { - if (this._dashes) { buf = B_ONEDASH } - this._dashes = 0 - break - } - } - if (this._dashes === 2) { - if ((start + i) < end && this._events.trailer) { this.emit('trailer', data.slice(start + i, end)) } - this.reset() - this._finished = true - // no more parts will be added - if (self._parts === 0) { - self._realFinish = true - self.emit('finish') - self._realFinish = false + const stream = new ReadableStream( + { + async start (controller) { + fetchParams.controller.controller = controller + }, + async pull (controller) { + await pullAlgorithm(controller) + }, + async cancel (reason) { + await cancelAlgorithm(reason) } - } - if (this._dashes) { return } - } - if (this._justMatched) { this._justMatched = false } - if (!this._part) { - this._part = new PartStream(this._partOpts) - this._part._read = function (n) { - self._unpause() - } - if (this._isPreamble && this._events.preamble) { this.emit('preamble', this._part) } else if (this._isPreamble !== true && this._events.part) { this.emit('part', this._part) } else { this._ignore() } - if (!this._isPreamble) { this._inHeader = true } - } - if (data && start < end && !this._ignoreData) { - if (this._isPreamble || !this._inHeader) { - if (buf) { shouldWriteMore = this._part.push(buf) } - shouldWriteMore = this._part.push(data.slice(start, end)) - if (!shouldWriteMore) { this._pause = true } - } else if (!this._isPreamble && this._inHeader) { - if (buf) { this._hparser.push(buf) } - r = this._hparser.push(data.slice(start, end)) - if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) } - } - } - if (isMatch) { - this._hparser.reset() - if (this._isPreamble) { this._isPreamble = false } else { - if (start !== end) { - ++this._parts - this._part.on('end', function () { - if (--self._parts === 0) { - if (self._finished) { - self._realFinish = true - self.emit('finish') - self._realFinish = false - } else { - self._unpause() - } - } - }) + }, + { + highWaterMark: 0, + size () { + return 1 } } - this._part.push(null) - this._part = undefined - this._ignoreData = false - this._justMatched = true - this._dashes = 0 - } -} + ) -Dicer.prototype._unpause = function () { - if (!this._pause) { return } + // 17. Run these steps, but abort when the ongoing fetch is terminated: - this._pause = false - if (this._cb) { - const cb = this._cb - this._cb = undefined - cb() - } -} + // 1. Set response’s body to a new body whose stream is stream. + response.body = { stream } -module.exports = Dicer -======= -/***/ 38682: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // 2. If response is not a network error and request’s cache mode is + // not "no-store", then update response in httpCache for request. + // TODO -const { FilebaseClient } = __nccwpck_require__(5369); -const { filesFromPath } = __nccwpck_require__(29857); + // 3. If includeCredentials is true and the user agent is not configured + // to block cookies for request (see section 7 of [COOKIES]), then run the + // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on + // the value of each header whose name is a byte-case-insensitive match for + // `Set-Cookie` in response’s header list, if any, and request’s current URL. + // TODO -module.exports = { - name: "Filebase", - builder: async (options) => { - const { filebaseKey, filebaseSecret, filebaseBucket } = options; + // 18. If aborted, then: + // TODO - if (!filebaseKey) { - throw new Error("[filebase] Key is empty. (input `filebaseKey`)"); - } + // 19. Run these steps in parallel: - if (!filebaseSecret) { - throw new Error("[filebase] Secret is empty. (input `filebaseSecret`)"); - } + // 1. Run these steps, but abort when fetchParams is canceled: + fetchParams.controller.on('terminated', onAborted) + fetchParams.controller.resume = async () => { + // 1. While true + while (true) { + // 1-3. See onData... - if (!filebaseBucket) { - throw new Error("[filebase] Bucket is empty. (input `filebaseBucket`)"); - } + // 4. Set bytes to the result of handling content codings given + // codings and bytes. + let bytes + let isFailure + try { + const { done, value } = await fetchParams.controller.next() - return { key: filebaseKey, secret: filebaseSecret, bucket: filebaseBucket }; - }, - upload: async (api, options) => { - console.log(`Parsing options...`); - const { path, pinName, verbose } = options; + if (isAborted(fetchParams)) { + break + } - console.log(`Adding files...`); - const files = []; - for await (const file of filesFromPath(path, { pathPrefix: path })) { - files.push(file); - if (verbose) { - console.log(`Added File: ${JSON.stringify(file)}`); + bytes = done ? undefined : value + } catch (err) { + if (fetchParams.controller.ended && !timingInfo.encodedBodySize) { + // zlib doesn't like empty streams. + bytes = undefined + } else { + bytes = err + + // err may be propagated from the result of calling readablestream.cancel, + // which might not be an error. https://github.com/nodejs/undici/issues/2009 + isFailure = true + } } - } - console.log(`Storing files...`); - let tokenString = `${api.key}:${api.secret}:${api.bucket}`; - let cid = await FilebaseClient.storeDirectory( - { - endpoint: "https://s3.filebase.com", - token: Buffer.from(tokenString).toString("base64"), - }, - files, - pinName - ); - console.log(`Stored files...`); - console.log(`CID: ${cid}`); - console.log(`Done`); + if (bytes === undefined) { + // 2. Otherwise, if the bytes transmission for response’s message + // body is done normally and stream is readable, then close + // stream, finalize response for fetchParams and response, and + // abort these in-parallel steps. + readableStreamClose(fetchParams.controller.controller) - return { - cid: cid, - ipfs: cid, - }; - }, -}; ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + finalizeResponse(fetchParams, response) + return + } -/***/ }), + // 5. Increase timingInfo’s decoded body size by bytes’s length. + timingInfo.decodedBodySize += bytes?.byteLength ?? 0 -<<<<<<< HEAD -/***/ 21200: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // 6. If bytes is failure, then terminate fetchParams’s controller. + if (isFailure) { + fetchParams.controller.terminate(bytes) + return + } + // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes + // into stream. + fetchParams.controller.controller.enqueue(new Uint8Array(bytes)) + // 8. If stream is errored, then terminate the ongoing fetch. + if (isErrored(stream)) { + fetchParams.controller.terminate() + return + } -const EventEmitter = (__nccwpck_require__(15673).EventEmitter) -const inherits = (__nccwpck_require__(47261).inherits) -const getLimit = __nccwpck_require__(21619) + // 9. If stream doesn’t need more data ask the user agent to suspend + // the ongoing fetch. + if (!fetchParams.controller.controller.desiredSize) { + return + } + } + } -const StreamSearch = __nccwpck_require__(10004) + // 2. If aborted, then: + function onAborted (reason) { + // 2. If fetchParams is aborted, then: + if (isAborted(fetchParams)) { + // 1. Set response’s aborted flag. + response.aborted = true -const B_DCRLF = Buffer.from('\r\n\r\n') -const RE_CRLF = /\r\n/g -const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex + // 2. If stream is readable, then error stream with the result of + // deserialize a serialized abort reason given fetchParams’s + // controller’s serialized abort reason and an + // implementation-defined realm. + if (isReadable(stream)) { + fetchParams.controller.controller.error( + fetchParams.controller.serializedAbortReason + ) + } + } else { + // 3. Otherwise, if stream is readable, error stream with a TypeError. + if (isReadable(stream)) { + fetchParams.controller.controller.error(new TypeError('terminated', { + cause: isErrorLike(reason) ? reason : undefined + })) + } + } -function HeaderParser (cfg) { - EventEmitter.call(this) + // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame. + // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so. + fetchParams.controller.connection.destroy() + } - cfg = cfg || {} - const self = this - this.nread = 0 - this.maxed = false - this.npairs = 0 - this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000) - this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024) - this.buffer = '' - this.header = {} - this.finished = false - this.ss = new StreamSearch(B_DCRLF) - this.ss.on('info', function (isMatch, data, start, end) { - if (data && !self.maxed) { - if (self.nread + end - start >= self.maxHeaderSize) { - end = self.maxHeaderSize - self.nread + start - self.nread = self.maxHeaderSize - self.maxed = true - } else { self.nread += (end - start) } + // 20. Return response. + return response - self.buffer += data.toString('binary', start, end) - } - if (isMatch) { self._finish() } - }) -} -inherits(HeaderParser, EventEmitter) + async function dispatch ({ body }) { + const url = requestCurrentURL(request) + /** @type {import('../..').Agent} */ + const agent = fetchParams.controller.dispatcher -HeaderParser.prototype.push = function (data) { - const r = this.ss.push(data) - if (this.finished) { return r } -} + return new Promise((resolve, reject) => agent.dispatch( + { + path: url.pathname + url.search, + origin: url.origin, + method: request.method, + body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body, + headers: request.headersList.entries, + maxRedirections: 0, + upgrade: request.mode === 'websocket' ? 'websocket' : undefined + }, + { + body: null, + abort: null, -HeaderParser.prototype.reset = function () { - this.finished = false - this.buffer = '' - this.header = {} - this.ss.reset() -} + onConnect (abort) { + // TODO (fix): Do we need connection here? + const { connection } = fetchParams.controller -HeaderParser.prototype._finish = function () { - if (this.buffer) { this._parseHeader() } - this.ss.matches = this.ss.maxMatches - const header = this.header - this.header = {} - this.buffer = '' - this.finished = true - this.nread = this.npairs = 0 - this.maxed = false - this.emit('header', header) -} + if (connection.destroyed) { + abort(new DOMException('The operation was aborted.', 'AbortError')) + } else { + fetchParams.controller.on('terminated', abort) + this.abort = connection.abort = abort + } + }, -HeaderParser.prototype._parseHeader = function () { - if (this.npairs === this.maxHeaderPairs) { return } + onHeaders (status, headersList, resume, statusText) { + if (status < 200) { + return + } - const lines = this.buffer.split(RE_CRLF) - const len = lines.length - let m, h + let codings = [] + let location = '' - for (var i = 0; i < len; ++i) { // eslint-disable-line no-var - if (lines[i].length === 0) { continue } - if (lines[i][0] === '\t' || lines[i][0] === ' ') { - // folded header content - // RFC2822 says to just remove the CRLF and not the whitespace following - // it, so we follow the RFC and include the leading whitespace ... - if (h) { - this.header[h][this.header[h].length - 1] += lines[i] - continue - } - } + const headers = new Headers() - const posColon = lines[i].indexOf(':') - if ( - posColon === -1 || - posColon === 0 - ) { - return - } - m = RE_HDR.exec(lines[i]) - h = m[1].toLowerCase() - this.header[h] = this.header[h] || [] - this.header[h].push((m[2] || '')) - if (++this.npairs === this.maxHeaderPairs) { break } - } -} + // For H2, the headers are a plain JS object + // We distinguish between them and iterate accordingly + if (Array.isArray(headersList)) { + for (let n = 0; n < headersList.length; n += 2) { + const key = headersList[n + 0].toString('latin1') + const val = headersList[n + 1].toString('latin1') + if (key.toLowerCase() === 'content-encoding') { + // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1 + // "All content-coding values are case-insensitive..." + codings = val.toLowerCase().split(',').map((x) => x.trim()) + } else if (key.toLowerCase() === 'location') { + location = val + } -module.exports = HeaderParser + headers[kHeadersList].append(key, val) + } + } else { + const keys = Object.keys(headersList) + for (const key of keys) { + const val = headersList[key] + if (key.toLowerCase() === 'content-encoding') { + // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1 + // "All content-coding values are case-insensitive..." + codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse() + } else if (key.toLowerCase() === 'location') { + location = val + } + + headers[kHeadersList].append(key, val) + } + } + this.body = new Readable({ read: resume }) -/***/ }), + const decoders = [] -/***/ 20453: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + const willFollow = request.redirect === 'follow' && + location && + redirectStatusSet.has(status) + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding + if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) { + for (const coding of codings) { + // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2 + if (coding === 'x-gzip' || coding === 'gzip') { + decoders.push(zlib.createGunzip({ + // Be less strict when decoding compressed responses, since sometimes + // servers send slightly invalid responses that are still accepted + // by common browsers. + // Always using Z_SYNC_FLUSH is what cURL does. + flush: zlib.constants.Z_SYNC_FLUSH, + finishFlush: zlib.constants.Z_SYNC_FLUSH + })) + } else if (coding === 'deflate') { + decoders.push(zlib.createInflate()) + } else if (coding === 'br') { + decoders.push(zlib.createBrotliDecompress()) + } else { + decoders.length = 0 + break + } + } + } + resolve({ + status, + statusText, + headersList: headers[kHeadersList], + body: decoders.length + ? pipeline(this.body, ...decoders, () => { }) + : this.body.on('error', () => {}) + }) -const inherits = (__nccwpck_require__(47261).inherits) -const ReadableStream = (__nccwpck_require__(84492).Readable) + return true + }, -function PartStream (opts) { - ReadableStream.call(this, opts) -} -inherits(PartStream, ReadableStream) + onData (chunk) { + if (fetchParams.controller.dump) { + return + } -PartStream.prototype._read = function (n) {} + // 1. If one or more bytes have been transmitted from response’s + // message body, then: -module.exports = PartStream + // 1. Let bytes be the transmitted bytes. + const bytes = chunk + // 2. Let codings be the result of extracting header list values + // given `Content-Encoding` and response’s header list. + // See pullAlgorithm. -/***/ }), + // 3. Increase timingInfo’s encoded body size by bytes’s length. + timingInfo.encodedBodySize += bytes.byteLength -/***/ 10004: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // 4. See pullAlgorithm... + return this.body.push(bytes) + }, + onComplete () { + if (this.abort) { + fetchParams.controller.off('terminated', this.abort) + } -/** - * Copyright Brian White. All rights reserved. - * - * @see https://github.com/mscdex/streamsearch - * - * 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. - * - * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation - * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool - */ -const EventEmitter = (__nccwpck_require__(15673).EventEmitter) -const inherits = (__nccwpck_require__(47261).inherits) + fetchParams.controller.ended = true -function SBMH (needle) { - if (typeof needle === 'string') { - needle = Buffer.from(needle) - } + this.body.push(null) + }, - if (!Buffer.isBuffer(needle)) { - throw new TypeError('The needle has to be a String or a Buffer.') - } + onError (error) { + if (this.abort) { + fetchParams.controller.off('terminated', this.abort) + } - const needleLength = needle.length + this.body?.destroy(error) - if (needleLength === 0) { - throw new Error('The needle cannot be an empty String/Buffer.') - } + fetchParams.controller.terminate(error) - if (needleLength > 256) { - throw new Error('The needle cannot have a length bigger than 256.') - } + reject(error) + }, - this.maxMatches = Infinity - this.matches = 0 + onUpgrade (status, headersList, socket) { + if (status !== 101) { + return + } - this._occ = new Array(256) - .fill(needleLength) // Initialize occurrence table. - this._lookbehind_size = 0 - this._needle = needle - this._bufpos = 0 + const headers = new Headers() - this._lookbehind = Buffer.alloc(needleLength) + for (let n = 0; n < headersList.length; n += 2) { + const key = headersList[n + 0].toString('latin1') + const val = headersList[n + 1].toString('latin1') - // Populate occurrence table with analysis of the needle, - // ignoring last letter. - for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var - this._occ[needle[i]] = needleLength - 1 - i - } -} -inherits(SBMH, EventEmitter) + headers[kHeadersList].append(key, val) + } -SBMH.prototype.reset = function () { - this._lookbehind_size = 0 - this.matches = 0 - this._bufpos = 0 -} + resolve({ + status, + statusText: STATUS_CODES[status], + headersList: headers[kHeadersList], + socket + }) -SBMH.prototype.push = function (chunk, pos) { - if (!Buffer.isBuffer(chunk)) { - chunk = Buffer.from(chunk, 'binary') + return true + } + } + )) } - const chlen = chunk.length - this._bufpos = pos || 0 - let r - while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) } - return r } -SBMH.prototype._sbmh_feed = function (data) { - const len = data.length - const needle = this._needle - const needleLength = needle.length - const lastNeedleChar = needle[needleLength - 1] - - // Positive: points to a position in `data` - // pos == 3 points to data[3] - // Negative: points to a position in the lookbehind buffer - // pos == -2 points to lookbehind[lookbehind_size - 2] - let pos = -this._lookbehind_size - let ch +module.exports = { + fetch, + Fetch, + fetching, + finalizeAndReportTiming +} - if (pos < 0) { - // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool - // search with character lookup code that considers both the - // lookbehind buffer and the current round's haystack data. - // - // Loop until - // there is a match. - // or until - // we've moved past the position that requires the - // lookbehind buffer. In this case we switch to the - // optimized loop. - // or until - // the character to look at lies outside the haystack. - while (pos < 0 && pos <= len - needleLength) { - ch = this._sbmh_lookup_char(data, pos + needleLength - 1) - if ( - ch === lastNeedleChar && - this._sbmh_memcmp(data, pos, needleLength - 1) - ) { - this._lookbehind_size = 0 - ++this.matches - this.emit('info', true) +/***/ }), - return (this._bufpos = pos + needleLength) - } - pos += this._occ[ch] -======= -/***/ 78700: +/***/ 20366: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const make = __nccwpck_require__(76333); +/* globals AbortController */ -module.exports = { - ipfs: make(__nccwpck_require__(12820)), - pinata: make(__nccwpck_require__(95067)), - infura: make(__nccwpck_require__(7855)), - filebase: make(__nccwpck_require__(38682)) -}; -/***/ }), +const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(42173) +const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(13915) +const { FinalizationRegistry } = __nccwpck_require__(49694)() +const util = __nccwpck_require__(43061) +const { + isValidHTTPToken, + sameOrigin, + normalizeMethod, + makePolicyContainer, + normalizeMethodRecord +} = __nccwpck_require__(47794) +const { + forbiddenMethodsSet, + corsSafeListedMethodsSet, + referrerPolicy, + requestRedirect, + requestMode, + requestCredentials, + requestCache, + requestDuplex +} = __nccwpck_require__(20075) +const { kEnumerableProperty } = util +const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(10730) +const { webidl } = __nccwpck_require__(7000) +const { getGlobalOrigin } = __nccwpck_require__(48582) +const { URLSerializer } = __nccwpck_require__(16306) +const { kHeadersList, kConstruct } = __nccwpck_require__(69898) +const assert = __nccwpck_require__(39491) +const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(82361) -/***/ 7855: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +let TransformStream = globalThis.TransformStream -const { create, globSource } = __nccwpck_require__(21719); -const last = __nccwpck_require__(28741); -const fsPath = __nccwpck_require__(71017); +const kAbortController = Symbol('abortController') -module.exports = { - name: "Infura", - builder: async (options) => { - const { infuraProjectId, infuraProjectSecret, headers, timeout } = options; - if (!infuraProjectId) { - throw new Error("[infura] ProjectId is empty. (input `infuraProjectId`)"); - } +const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { + signal.removeEventListener('abort', abort) +}) - if (!infuraProjectSecret) { - throw new Error( - "[infura] ProjectSecret is empty. (input `infuraProjectSecret`)" - ); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +// https://fetch.spec.whatwg.org/#request-class +class Request { + // https://fetch.spec.whatwg.org/#dom-request + constructor (input, init = {}) { + if (input === kConstruct) { + return } - // No match. + webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' }) - if (pos < 0) { - // There's too few data for Boyer-Moore-Horspool to run, - // so let's use a different algorithm to skip as much as - // we can. - // Forward pos until - // the trailing part of lookbehind + data - // looks like the beginning of the needle - // or until - // pos == 0 - while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos } - } + input = webidl.converters.RequestInfo(input) + init = webidl.converters.RequestInit(init) - if (pos >= 0) { - // Discard lookbehind buffer. - this.emit('info', false, this._lookbehind, 0, this._lookbehind_size) - this._lookbehind_size = 0 - } else { - // Cut off part of the lookbehind buffer that has - // been processed and append the entire haystack - // into it. - const bytesToCutOff = this._lookbehind_size + pos - if (bytesToCutOff > 0) { - // The cut off data is guaranteed not to contain the needle. - this.emit('info', false, this._lookbehind, 0, bytesToCutOff) + // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object + this[kRealm] = { + settingsObject: { + baseUrl: getGlobalOrigin(), + get origin () { + return this.baseUrl?.origin + }, + policyContainer: makePolicyContainer() } + } - this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff, - this._lookbehind_size - bytesToCutOff) - this._lookbehind_size -= bytesToCutOff + // 1. Let request be null. + let request = null - data.copy(this._lookbehind, this._lookbehind_size) - this._lookbehind_size += len + // 2. Let fallbackMode be null. + let fallbackMode = null - this._bufpos = len - return len - } - } + // 3. Let baseURL be this’s relevant settings object’s API base URL. + const baseUrl = this[kRealm].settingsObject.baseUrl - pos += (pos >= 0) * this._bufpos + // 4. Let signal be null. + let signal = null - // Lookbehind buffer is now empty. We only need to check if the - // needle is in the haystack. - if (data.indexOf(needle, pos) !== -1) { - pos = data.indexOf(needle, pos) - ++this.matches - if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) } + // 5. If input is a string, then: + if (typeof input === 'string') { + // 1. Let parsedURL be the result of parsing input with baseURL. + // 2. If parsedURL is failure, then throw a TypeError. + let parsedURL + try { + parsedURL = new URL(input, baseUrl) + } catch (err) { + throw new TypeError('Failed to parse URL from ' + input, { cause: err }) + } - return (this._bufpos = pos + needleLength) - } else { - pos = len - needleLength - } + // 3. If parsedURL includes credentials, then throw a TypeError. + if (parsedURL.username || parsedURL.password) { + throw new TypeError( + 'Request cannot be constructed from a URL that includes credentials: ' + + input + ) + } - // There was no match. If there's trailing haystack data that we cannot - // match yet using the Boyer-Moore-Horspool algorithm (because the trailing - // data is less than the needle size) then match using a modified - // algorithm that starts matching from the beginning instead of the end. - // Whatever trailing data is left after running this algorithm is added to - // the lookbehind buffer. - while ( - pos < len && - ( - data[pos] !== needle[0] || - ( - (Buffer.compare( - data.subarray(pos, pos + len - pos), - needle.subarray(0, len - pos) - ) !== 0) - ) - ) - ) { - ++pos - } - if (pos < len) { - data.copy(this._lookbehind, 0, pos, pos + (len - pos)) - this._lookbehind_size = len - pos - } + // 4. Set request to a new request whose URL is parsedURL. + request = makeRequest({ urlList: [parsedURL] }) - // Everything until pos is guaranteed not to contain needle data. - if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) } + // 5. Set fallbackMode to "cors". + fallbackMode = 'cors' + } else { + // 6. Otherwise: - this._bufpos = len - return len -} + // 7. Assert: input is a Request object. + assert(input instanceof Request) -SBMH.prototype._sbmh_lookup_char = function (data, pos) { - return (pos < 0) - ? this._lookbehind[this._lookbehind_size + pos] - : data[pos] -} + // 8. Set request to input’s request. + request = input[kState] -SBMH.prototype._sbmh_memcmp = function (data, pos, len) { - for (var i = 0; i < len; ++i) { // eslint-disable-line no-var - if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false } - } - return true -} + // 9. Set signal to input’s signal. + signal = input[kSignal] + } -module.exports = SBMH + // 7. Let origin be this’s relevant settings object’s origin. + const origin = this[kRealm].settingsObject.origin + + // 8. Let window be "client". + let window = 'client' + // 9. If request’s window is an environment settings object and its origin + // is same origin with origin, then set window to request’s window. + if ( + request.window?.constructor?.name === 'EnvironmentSettingsObject' && + sameOrigin(request.window, origin) + ) { + window = request.window + } -/***/ }), + // 10. If init["window"] exists and is non-null, then throw a TypeError. + if (init.window != null) { + throw new TypeError(`'window' option '${window}' must be null`) + } -/***/ 52612: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // 11. If init["window"] exists, then set window to "no-window". + if ('window' in init) { + window = 'no-window' + } + // 12. Set request to a new request with the following properties: + request = makeRequest({ + // URL request’s URL. + // undici implementation note: this is set as the first item in request's urlList in makeRequest + // method request’s method. + method: request.method, + // header list A copy of request’s header list. + // undici implementation note: headersList is cloned in makeRequest + headersList: request.headersList, + // unsafe-request flag Set. + unsafeRequest: request.unsafeRequest, + // client This’s relevant settings object. + client: this[kRealm].settingsObject, + // window window. + window, + // priority request’s priority. + priority: request.priority, + // origin request’s origin. The propagation of the origin is only significant for navigation requests + // being handled by a service worker. In this scenario a request can have an origin that is different + // from the current client. + origin: request.origin, + // referrer request’s referrer. + referrer: request.referrer, + // referrer policy request’s referrer policy. + referrerPolicy: request.referrerPolicy, + // mode request’s mode. + mode: request.mode, + // credentials mode request’s credentials mode. + credentials: request.credentials, + // cache mode request’s cache mode. + cache: request.cache, + // redirect mode request’s redirect mode. + redirect: request.redirect, + // integrity metadata request’s integrity metadata. + integrity: request.integrity, + // keepalive request’s keepalive. + keepalive: request.keepalive, + // reload-navigation flag request’s reload-navigation flag. + reloadNavigation: request.reloadNavigation, + // history-navigation flag request’s history-navigation flag. + historyNavigation: request.historyNavigation, + // URL list A clone of request’s URL list. + urlList: [...request.urlList] + }) + const initHasKey = Object.keys(init).length !== 0 -const WritableStream = (__nccwpck_require__(84492).Writable) -const { inherits } = __nccwpck_require__(47261) -const Dicer = __nccwpck_require__(94438) + // 13. If init is not empty, then: + if (initHasKey) { + // 1. If request’s mode is "navigate", then set it to "same-origin". + if (request.mode === 'navigate') { + request.mode = 'same-origin' + } -const MultipartParser = __nccwpck_require__(28045) -const UrlencodedParser = __nccwpck_require__(86563) -const parseParams = __nccwpck_require__(73411) + // 2. Unset request’s reload-navigation flag. + request.reloadNavigation = false -function Busboy (opts) { - if (!(this instanceof Busboy)) { return new Busboy(opts) } + // 3. Unset request’s history-navigation flag. + request.historyNavigation = false - if (typeof opts !== 'object') { - throw new TypeError('Busboy expected an options-Object.') - } - if (typeof opts.headers !== 'object') { - throw new TypeError('Busboy expected an options-Object with headers-attribute.') - } - if (typeof opts.headers['content-type'] !== 'string') { - throw new TypeError('Missing Content-Type-header.') - } + // 4. Set request’s origin to "client". + request.origin = 'client' - const { - headers, - ...streamOptions - } = opts + // 5. Set request’s referrer to "client" + request.referrer = 'client' - this.opts = { - autoDestroy: false, - ...streamOptions - } - WritableStream.call(this, this.opts) + // 6. Set request’s referrer policy to the empty string. + request.referrerPolicy = '' - this._done = false - this._parser = this.getParserByHeaders(headers) - this._finished = false -} -inherits(Busboy, WritableStream) + // 7. Set request’s URL to request’s current URL. + request.url = request.urlList[request.urlList.length - 1] -Busboy.prototype.emit = function (ev) { - if (ev === 'finish') { - if (!this._done) { - this._parser?.end() - return - } else if (this._finished) { - return + // 8. Set request’s URL list to « request’s URL ». + request.urlList = [request.url] } - this._finished = true - } - WritableStream.prototype.emit.apply(this, arguments) -} -Busboy.prototype.getParserByHeaders = function (headers) { - const parsed = parseParams(headers['content-type']) + // 14. If init["referrer"] exists, then: + if (init.referrer !== undefined) { + // 1. Let referrer be init["referrer"]. + const referrer = init.referrer - const cfg = { - defCharset: this.opts.defCharset, - fileHwm: this.opts.fileHwm, - headers, - highWaterMark: this.opts.highWaterMark, - isPartAFile: this.opts.isPartAFile, - limits: this.opts.limits, - parsedConType: parsed, - preservePath: this.opts.preservePath - } + // 2. If referrer is the empty string, then set request’s referrer to "no-referrer". + if (referrer === '') { + request.referrer = 'no-referrer' + } else { + // 1. Let parsedReferrer be the result of parsing referrer with + // baseURL. + // 2. If parsedReferrer is failure, then throw a TypeError. + let parsedReferrer + try { + parsedReferrer = new URL(referrer, baseUrl) + } catch (err) { + throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err }) + } - if (MultipartParser.detect.test(parsed[0])) { - return new MultipartParser(this, cfg) - } - if (UrlencodedParser.detect.test(parsed[0])) { - return new UrlencodedParser(this, cfg) - } - throw new Error('Unsupported Content-Type.') -} + // 3. If one of the following is true + // - parsedReferrer’s scheme is "about" and path is the string "client" + // - parsedReferrer’s origin is not same origin with origin + // then set request’s referrer to "client". + if ( + (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') || + (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl)) + ) { + request.referrer = 'client' + } else { + // 4. Otherwise, set request’s referrer to parsedReferrer. + request.referrer = parsedReferrer + } + } + } -Busboy.prototype._write = function (chunk, encoding, cb) { - this._parser.write(chunk, cb) -} + // 15. If init["referrerPolicy"] exists, then set request’s referrer policy + // to it. + if (init.referrerPolicy !== undefined) { + request.referrerPolicy = init.referrerPolicy + } -module.exports = Busboy -module.exports["default"] = Busboy -module.exports.Busboy = Busboy + // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise. + let mode + if (init.mode !== undefined) { + mode = init.mode + } else { + mode = fallbackMode + } -module.exports.Dicer = Dicer + // 17. If mode is "navigate", then throw a TypeError. + if (mode === 'navigate') { + throw webidl.errors.exception({ + header: 'Request constructor', + message: 'invalid request mode navigate.' + }) + } + // 18. If mode is non-null, set request’s mode to mode. + if (mode != null) { + request.mode = mode + } -/***/ }), + // 19. If init["credentials"] exists, then set request’s credentials mode + // to it. + if (init.credentials !== undefined) { + request.credentials = init.credentials + } -/***/ 28045: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // 18. If init["cache"] exists, then set request’s cache mode to it. + if (init.cache !== undefined) { + request.cache = init.cache + } + // 21. If request’s cache mode is "only-if-cached" and request’s mode is + // not "same-origin", then throw a TypeError. + if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') { + throw new TypeError( + "'only-if-cached' can be set only with 'same-origin' mode" + ) + } + // 22. If init["redirect"] exists, then set request’s redirect mode to it. + if (init.redirect !== undefined) { + request.redirect = init.redirect + } -// TODO: -// * support 1 nested multipart level -// (see second multipart example here: -// http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data) -// * support limits.fieldNameSize -// -- this will require modifications to utils.parseParams + // 23. If init["integrity"] exists, then set request’s integrity metadata to it. + if (init.integrity != null) { + request.integrity = String(init.integrity) + } -const { Readable } = __nccwpck_require__(84492) -const { inherits } = __nccwpck_require__(47261) + // 24. If init["keepalive"] exists, then set request’s keepalive to it. + if (init.keepalive !== undefined) { + request.keepalive = Boolean(init.keepalive) + } -const Dicer = __nccwpck_require__(94438) + // 25. If init["method"] exists, then: + if (init.method !== undefined) { + // 1. Let method be init["method"]. + let method = init.method -const parseParams = __nccwpck_require__(73411) -const decodeText = __nccwpck_require__(92892) -const basename = __nccwpck_require__(58054) -const getLimit = __nccwpck_require__(21619) + // 2. If method is not a method or method is a forbidden method, then + // throw a TypeError. + if (!isValidHTTPToken(method)) { + throw new TypeError(`'${method}' is not a valid HTTP method.`) + } -const RE_BOUNDARY = /^boundary$/i -const RE_FIELD = /^form-data$/i -const RE_CHARSET = /^charset$/i -const RE_FILENAME = /^filename$/i -const RE_NAME = /^name$/i + if (forbiddenMethodsSet.has(method.toUpperCase())) { + throw new TypeError(`'${method}' HTTP method is unsupported.`) + } -Multipart.detect = /^multipart\/form-data/i -function Multipart (boy, cfg) { - let i - let len - const self = this - let boundary - const limits = cfg.limits - const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined)) - const parsedConType = cfg.parsedConType || [] - const defCharset = cfg.defCharset || 'utf8' - const preservePath = cfg.preservePath - const fileOpts = { highWaterMark: cfg.fileHwm } + // 3. Normalize method. + method = normalizeMethodRecord[method] ?? normalizeMethod(method) - for (i = 0, len = parsedConType.length; i < len; ++i) { - if (Array.isArray(parsedConType[i]) && - RE_BOUNDARY.test(parsedConType[i][0])) { - boundary = parsedConType[i][1] - break + // 4. Set request’s method to method. + request.method = method } - } - function checkFinished () { - if (nends === 0 && finished && !boy._done) { - finished = false - self.end() + // 26. If init["signal"] exists, then set signal to it. + if (init.signal !== undefined) { + signal = init.signal } - } - if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') } + // 27. Set this’s request to request. + this[kState] = request - const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024) - const fileSizeLimit = getLimit(limits, 'fileSize', Infinity) - const filesLimit = getLimit(limits, 'files', Infinity) - const fieldsLimit = getLimit(limits, 'fields', Infinity) - const partsLimit = getLimit(limits, 'parts', Infinity) - const headerPairsLimit = getLimit(limits, 'headerPairs', 2000) - const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024) + // 28. Set this’s signal to a new AbortSignal object with this’s relevant + // Realm. + // TODO: could this be simplified with AbortSignal.any + // (https://dom.spec.whatwg.org/#dom-abortsignal-any) + const ac = new AbortController() + this[kSignal] = ac.signal + this[kSignal][kRealm] = this[kRealm] - let nfiles = 0 - let nfields = 0 - let nends = 0 - let curFile - let curField - let finished = false + // 29. If signal is not null, then make this’s signal follow signal. + if (signal != null) { + if ( + !signal || + typeof signal.aborted !== 'boolean' || + typeof signal.addEventListener !== 'function' + ) { + throw new TypeError( + "Failed to construct 'Request': member signal is not of type AbortSignal." + ) + } - this._needDrain = false - this._pause = false - this._cb = undefined - this._nparts = 0 - this._boy = boy + if (signal.aborted) { + ac.abort(signal.reason) + } else { + // Keep a strong ref to ac while request object + // is alive. This is needed to prevent AbortController + // from being prematurely garbage collected. + // See, https://github.com/nodejs/undici/issues/1926. + this[kAbortController] = ac - const parserCfg = { - boundary, - maxHeaderPairs: headerPairsLimit, - maxHeaderSize: headerSizeLimit, - partHwm: fileOpts.highWaterMark, - highWaterMark: cfg.highWaterMark - } + const acRef = new WeakRef(ac) + const abort = function () { + const ac = acRef.deref() + if (ac !== undefined) { + ac.abort(this.reason) + } + } - this.parser = new Dicer(parserCfg) - this.parser.on('drain', function () { - self._needDrain = false - if (self._cb && !self._pause) { - const cb = self._cb - self._cb = undefined - cb() - } - }).on('part', function onPart (part) { - if (++self._nparts > partsLimit) { - self.parser.removeListener('part', onPart) - self.parser.on('part', skipPart) - boy.hitPartsLimit = true - boy.emit('partsLimit') - return skipPart(part) - } + // Third-party AbortControllers may not work with these. + // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619. + try { + // If the max amount of listeners is equal to the default, increase it + // This is only available in node >= v19.9.0 + if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) { + setMaxListeners(100, signal) + } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) { + setMaxListeners(100, signal) + } + } catch {} - // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let - // us emit 'end' early since we know the part has ended if we are already - // seeing the next part - if (curField) { - const field = curField - field.emit('end') - field.removeAllListeners('end') + util.addAbortListener(signal, abort) + requestFinalizer.register(ac, { signal, abort }) + } } - part.on('header', function (header) { - let contype - let fieldname - let parsed - let charset - let encoding - let filename - let nsize = 0 + // 30. Set this’s headers to a new Headers object with this’s relevant + // Realm, whose header list is request’s header list and guard is + // "request". + this[kHeaders] = new Headers(kConstruct) + this[kHeaders][kHeadersList] = request.headersList + this[kHeaders][kGuard] = 'request' + this[kHeaders][kRealm] = this[kRealm] - if (header['content-type']) { - parsed = parseParams(header['content-type'][0]) - if (parsed[0]) { - contype = parsed[0].toLowerCase() - for (i = 0, len = parsed.length; i < len; ++i) { - if (RE_CHARSET.test(parsed[i][0])) { - charset = parsed[i][1].toLowerCase() - break - } - } - } + // 31. If this’s request’s mode is "no-cors", then: + if (mode === 'no-cors') { + // 1. If this’s request’s method is not a CORS-safelisted method, + // then throw a TypeError. + if (!corsSafeListedMethodsSet.has(request.method)) { + throw new TypeError( + `'${request.method} is unsupported in no-cors mode.` + ) } - if (contype === undefined) { contype = 'text/plain' } - if (charset === undefined) { charset = defCharset } + // 2. Set this’s headers’s guard to "request-no-cors". + this[kHeaders][kGuard] = 'request-no-cors' + } - if (header['content-disposition']) { - parsed = parseParams(header['content-disposition'][0]) - if (!RE_FIELD.test(parsed[0])) { return skipPart(part) } - for (i = 0, len = parsed.length; i < len; ++i) { - if (RE_NAME.test(parsed[i][0])) { - fieldname = parsed[i][1] - } else if (RE_FILENAME.test(parsed[i][0])) { - filename = parsed[i][1] - if (!preservePath) { filename = basename(filename) } - } + // 32. If init is not empty, then: + if (initHasKey) { + /** @type {HeadersList} */ + const headersList = this[kHeaders][kHeadersList] + // 1. Let headers be a copy of this’s headers and its associated header + // list. + // 2. If init["headers"] exists, then set headers to init["headers"]. + const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList) + + // 3. Empty this’s headers’s header list. + headersList.clear() + + // 4. If headers is a Headers object, then for each header in its header + // list, append header’s name/header’s value to this’s headers. + if (headers instanceof HeadersList) { + for (const [key, val] of headers) { + headersList.append(key, val) } - } else { return skipPart(part) } + // Note: Copy the `set-cookie` meta-data. + headersList.cookies = headers.cookies + } else { + // 5. Otherwise, fill this’s headers with headers. + fillHeaders(this[kHeaders], headers) + } + } - if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' } + // 33. Let inputBody be input’s request’s body if input is a Request + // object; otherwise null. + const inputBody = input instanceof Request ? input[kState].body : null - let onData, - onEnd + // 34. If either init["body"] exists and is non-null or inputBody is + // non-null, and request’s method is `GET` or `HEAD`, then throw a + // TypeError. + if ( + (init.body != null || inputBody != null) && + (request.method === 'GET' || request.method === 'HEAD') + ) { + throw new TypeError('Request with GET/HEAD method cannot have body.') + } - if (isPartAFile(fieldname, contype, filename)) { - // file/binary field - if (nfiles === filesLimit) { - if (!boy.hitFilesLimit) { - boy.hitFilesLimit = true - boy.emit('filesLimit') - } - return skipPart(part) - } + // 35. Let initBody be null. + let initBody = null - ++nfiles + // 36. If init["body"] exists and is non-null, then: + if (init.body != null) { + // 1. Let Content-Type be null. + // 2. Set initBody and Content-Type to the result of extracting + // init["body"], with keepalive set to request’s keepalive. + const [extractedBody, contentType] = extractBody( + init.body, + request.keepalive + ) + initBody = extractedBody - if (!boy._events.file) { - self.parser._ignore() - return - } + // 3, If Content-Type is non-null and this’s headers’s header list does + // not contain `Content-Type`, then append `Content-Type`/Content-Type to + // this’s headers. + if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) { + this[kHeaders].append('content-type', contentType) + } + } - ++nends - const file = new FileStream(fileOpts) - curFile = file - file.on('end', function () { - --nends - self._pause = false - checkFinished() - if (self._cb && !self._needDrain) { - const cb = self._cb - self._cb = undefined - cb() - } - }) - file._read = function (n) { - if (!self._pause) { return } - self._pause = false - if (self._cb && !self._needDrain) { - const cb = self._cb - self._cb = undefined - cb() - } - } - boy.emit('file', fieldname, file, filename, encoding, contype) + // 37. Let inputOrInitBody be initBody if it is non-null; otherwise + // inputBody. + const inputOrInitBody = initBody ?? inputBody - onData = function (data) { - if ((nsize += data.length) > fileSizeLimit) { - const extralen = fileSizeLimit - nsize + data.length - if (extralen > 0) { file.push(data.slice(0, extralen)) } - file.truncated = true - file.bytesRead = fileSizeLimit - part.removeAllListeners('data') - file.emit('limit') - return - } else if (!file.push(data)) { self._pause = true } + // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is + // null, then: + if (inputOrInitBody != null && inputOrInitBody.source == null) { + // 1. If initBody is non-null and init["duplex"] does not exist, + // then throw a TypeError. + if (initBody != null && init.duplex == null) { + throw new TypeError('RequestInit: duplex option is required when sending a body.') + } - file.bytesRead = nsize - } + // 2. If this’s request’s mode is neither "same-origin" nor "cors", + // then throw a TypeError. + if (request.mode !== 'same-origin' && request.mode !== 'cors') { + throw new TypeError( + 'If request is made from ReadableStream, mode should be "same-origin" or "cors"' + ) + } - onEnd = function () { - curFile = undefined - file.push(null) - } - } else { - // non-file field - if (nfields === fieldsLimit) { - if (!boy.hitFieldsLimit) { - boy.hitFieldsLimit = true - boy.emit('fieldsLimit') - } - return skipPart(part) - } + // 3. Set this’s request’s use-CORS-preflight flag. + request.useCORSPreflightFlag = true + } - ++nfields - ++nends - let buffer = '' - let truncated = false - curField = part + // 39. Let finalBody be inputOrInitBody. + let finalBody = inputOrInitBody - onData = function (data) { - if ((nsize += data.length) > fieldSizeLimit) { - const extralen = (fieldSizeLimit - (nsize - data.length)) - buffer += data.toString('binary', 0, extralen) - truncated = true - part.removeAllListeners('data') - } else { buffer += data.toString('binary') } - } + // 40. If initBody is null and inputBody is non-null, then: + if (initBody == null && inputBody != null) { + // 1. If input is unusable, then throw a TypeError. + if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) { + throw new TypeError( + 'Cannot construct a Request with a Request object that has already been used.' + ) + } - onEnd = function () { - curField = undefined - if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) } - boy.emit('field', fieldname, buffer, false, truncated, encoding, contype) - --nends - checkFinished() - } + // 2. Set finalBody to the result of creating a proxy for inputBody. + if (!TransformStream) { + TransformStream = (__nccwpck_require__(35356).TransformStream) } - /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become - broken. Streams2/streams3 is a huge black box of confusion, but - somehow overriding the sync state seems to fix things again (and still - seems to work for previous node versions). - */ - part._readableState.sync = false + // https://streams.spec.whatwg.org/#readablestream-create-a-proxy + const identityTransform = new TransformStream() + inputBody.stream.pipeThrough(identityTransform) + finalBody = { + source: inputBody.source, + length: inputBody.length, + stream: identityTransform.readable + } + } - part.on('data', onData) - part.on('end', onEnd) - }).on('error', function (err) { - if (curFile) { curFile.emit('error', err) } - }) - }).on('error', function (err) { - boy.emit('error', err) - }).on('finish', function () { - finished = true - checkFinished() - }) -} + // 41. Set this’s request’s body to finalBody. + this[kState].body = finalBody + } + + // Returns request’s HTTP method, which is "GET" by default. + get method () { + webidl.brandCheck(this, Request) + + // The method getter steps are to return this’s request’s method. + return this[kState].method + } + + // Returns the URL of request as a string. + get url () { + webidl.brandCheck(this, Request) + + // The url getter steps are to return this’s request’s URL, serialized. + return URLSerializer(this[kState].url) + } -Multipart.prototype.write = function (chunk, cb) { - const r = this.parser.write(chunk) - if (r && !this._pause) { - cb() - } else { - this._needDrain = !r - this._cb = cb + // Returns a Headers object consisting of the headers associated with request. + // Note that headers added in the network layer by the user agent will not + // be accounted for in this object, e.g., the "Host" header. + get headers () { + webidl.brandCheck(this, Request) + + // The headers getter steps are to return this’s headers. + return this[kHeaders] } -} -Multipart.prototype.end = function () { - const self = this + // Returns the kind of resource requested by request, e.g., "document" + // or "script". + get destination () { + webidl.brandCheck(this, Request) - if (self.parser.writable) { - self.parser.end() - } else if (!self._boy._done) { - process.nextTick(function () { - self._boy._done = true - self._boy.emit('finish') - }) + // The destination getter are to return this’s request’s destination. + return this[kState].destination } -} -function skipPart (part) { - part.resume() -} + // Returns the referrer of request. Its value can be a same-origin URL if + // explicitly set in init, the empty string to indicate no referrer, and + // "about:client" when defaulting to the global’s default. This is used + // during fetching to determine the value of the `Referer` header of the + // request being made. + get referrer () { + webidl.brandCheck(this, Request) -function FileStream (opts) { - Readable.call(this, opts) + // 1. If this’s request’s referrer is "no-referrer", then return the + // empty string. + if (this[kState].referrer === 'no-referrer') { + return '' + } - this.bytesRead = 0 + // 2. If this’s request’s referrer is "client", then return + // "about:client". + if (this[kState].referrer === 'client') { + return 'about:client' + } - this.truncated = false -} + // Return this’s request’s referrer, serialized. + return this[kState].referrer.toString() + } -inherits(FileStream, Readable) + // Returns the referrer policy associated with request. + // This is used during fetching to compute the value of the request’s + // referrer. + get referrerPolicy () { + webidl.brandCheck(this, Request) -FileStream.prototype._read = function (n) {} + // The referrerPolicy getter steps are to return this’s request’s referrer policy. + return this[kState].referrerPolicy + } -module.exports = Multipart + // Returns the mode associated with request, which is a string indicating + // whether the request will use CORS, or will be restricted to same-origin + // URLs. + get mode () { + webidl.brandCheck(this, Request) + // The mode getter steps are to return this’s request’s mode. + return this[kState].mode + } -/***/ }), + // Returns the credentials mode associated with request, + // which is a string indicating whether credentials will be sent with the + // request always, never, or only when sent to a same-origin URL. + get credentials () { + // The credentials getter steps are to return this’s request’s credentials mode. + return this[kState].credentials + } -/***/ 86563: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // Returns the cache mode associated with request, + // which is a string indicating how the request will + // interact with the browser’s cache when fetching. + get cache () { + webidl.brandCheck(this, Request) + // The cache getter steps are to return this’s request’s cache mode. + return this[kState].cache + } + // Returns the redirect mode associated with request, + // which is a string indicating how redirects for the + // request will be handled during fetching. A request + // will follow redirects by default. + get redirect () { + webidl.brandCheck(this, Request) -const Decoder = __nccwpck_require__(58926) -const decodeText = __nccwpck_require__(92892) -const getLimit = __nccwpck_require__(21619) + // The redirect getter steps are to return this’s request’s redirect mode. + return this[kState].redirect + } -const RE_CHARSET = /^charset$/i + // Returns request’s subresource integrity metadata, which is a + // cryptographic hash of the resource being fetched. Its value + // consists of multiple hashes separated by whitespace. [SRI] + get integrity () { + webidl.brandCheck(this, Request) -UrlEncoded.detect = /^application\/x-www-form-urlencoded/i -function UrlEncoded (boy, cfg) { - const limits = cfg.limits - const parsedConType = cfg.parsedConType - this.boy = boy + // The integrity getter steps are to return this’s request’s integrity + // metadata. + return this[kState].integrity + } - this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024) - this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100) - this.fieldsLimit = getLimit(limits, 'fields', Infinity) + // Returns a boolean indicating whether or not request can outlive the + // global in which it was created. + get keepalive () { + webidl.brandCheck(this, Request) - let charset - for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var - if (Array.isArray(parsedConType[i]) && - RE_CHARSET.test(parsedConType[i][0])) { - charset = parsedConType[i][1].toLowerCase() - break - } + // The keepalive getter steps are to return this’s request’s keepalive. + return this[kState].keepalive } - if (charset === undefined) { charset = cfg.defCharset || 'utf8' } + // Returns a boolean indicating whether or not request is for a reload + // navigation. + get isReloadNavigation () { + webidl.brandCheck(this, Request) - this.decoder = new Decoder() - this.charset = charset - this._fields = 0 - this._state = 'key' - this._checkingBytes = true - this._bytesKey = 0 - this._bytesVal = 0 - this._key = '' - this._val = '' - this._keyTrunc = false - this._valTrunc = false - this._hitLimit = false -} + // The isReloadNavigation getter steps are to return true if this’s + // request’s reload-navigation flag is set; otherwise false. + return this[kState].reloadNavigation + } -UrlEncoded.prototype.write = function (data, cb) { - if (this._fields === this.fieldsLimit) { - if (!this.boy.hitFieldsLimit) { - this.boy.hitFieldsLimit = true - this.boy.emit('fieldsLimit') - } - return cb() + // Returns a boolean indicating whether or not request is for a history + // navigation (a.k.a. back-foward navigation). + get isHistoryNavigation () { + webidl.brandCheck(this, Request) + + // The isHistoryNavigation getter steps are to return true if this’s request’s + // history-navigation flag is set; otherwise false. + return this[kState].historyNavigation } - let idxeq; let idxamp; let i; let p = 0; const len = data.length + // Returns the signal associated with request, which is an AbortSignal + // object indicating whether or not request has been aborted, and its + // abort event handler. + get signal () { + webidl.brandCheck(this, Request) - while (p < len) { - if (this._state === 'key') { - idxeq = idxamp = undefined - for (i = p; i < len; ++i) { - if (!this._checkingBytes) { ++p } - if (data[i] === 0x3D/* = */) { - idxeq = i - break - } else if (data[i] === 0x26/* & */) { - idxamp = i - break - } - if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) { - this._hitLimit = true - break - } else if (this._checkingBytes) { ++this._bytesKey } - } + // The signal getter steps are to return this’s signal. + return this[kSignal] + } - if (idxeq !== undefined) { - // key with assignment - if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) } - this._state = 'val' + get body () { + webidl.brandCheck(this, Request) - this._hitLimit = false - this._checkingBytes = true - this._val = '' - this._bytesVal = 0 - this._valTrunc = false - this.decoder.reset() + return this[kState].body ? this[kState].body.stream : null + } - p = idxeq + 1 - } else if (idxamp !== undefined) { - // key with no assignment - ++this._fields - let key; const keyTrunc = this._keyTrunc - if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key } + get bodyUsed () { + webidl.brandCheck(this, Request) - this._hitLimit = false - this._checkingBytes = true - this._key = '' - this._bytesKey = 0 - this._keyTrunc = false - this.decoder.reset() + return !!this[kState].body && util.isDisturbed(this[kState].body.stream) + } - if (key.length) { - this.boy.emit('field', decodeText(key, 'binary', this.charset), - '', - keyTrunc, - false) - } + get duplex () { + webidl.brandCheck(this, Request) - p = idxamp + 1 - if (this._fields === this.fieldsLimit) { return cb() } - } else if (this._hitLimit) { - // we may not have hit the actual limit if there are encoded bytes... - if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) } - p = i - if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) { - // yep, we actually did hit the limit - this._checkingBytes = false - this._keyTrunc = true - } - } else { - if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) } - p = len - } - } else { - idxamp = undefined - for (i = p; i < len; ++i) { - if (!this._checkingBytes) { ++p } - if (data[i] === 0x26/* & */) { - idxamp = i - break - } - if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) { - this._hitLimit = true - break - } else if (this._checkingBytes) { ++this._bytesVal } - } + return 'half' + } - if (idxamp !== undefined) { - ++this._fields - if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) } - this.boy.emit('field', decodeText(this._key, 'binary', this.charset), - decodeText(this._val, 'binary', this.charset), - this._keyTrunc, - this._valTrunc) - this._state = 'key' + // Returns a clone of request. + clone () { + webidl.brandCheck(this, Request) - this._hitLimit = false - this._checkingBytes = true - this._key = '' - this._bytesKey = 0 - this._keyTrunc = false - this.decoder.reset() + // 1. If this is unusable, then throw a TypeError. + if (this.bodyUsed || this.body?.locked) { + throw new TypeError('unusable') + } - p = idxamp + 1 - if (this._fields === this.fieldsLimit) { return cb() } - } else if (this._hitLimit) { - // we may not have hit the actual limit if there are encoded bytes... - if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) } - p = i - if ((this._val === '' && this.fieldSizeLimit === 0) || - (this._bytesVal = this._val.length) === this.fieldSizeLimit) { - // yep, we actually did hit the limit - this._checkingBytes = false - this._valTrunc = true + // 2. Let clonedRequest be the result of cloning this’s request. + const clonedRequest = cloneRequest(this[kState]) + + // 3. Let clonedRequestObject be the result of creating a Request object, + // given clonedRequest, this’s headers’s guard, and this’s relevant Realm. + const clonedRequestObject = new Request(kConstruct) + clonedRequestObject[kState] = clonedRequest + clonedRequestObject[kRealm] = this[kRealm] + clonedRequestObject[kHeaders] = new Headers(kConstruct) + clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList + clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard] + clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm] + + // 4. Make clonedRequestObject’s signal follow this’s signal. + const ac = new AbortController() + if (this.signal.aborted) { + ac.abort(this.signal.reason) + } else { + util.addAbortListener( + this.signal, + () => { + ac.abort(this.signal.reason) } - } else { - if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) } - p = len - } + ) } + clonedRequestObject[kSignal] = ac.signal + + // 4. Return clonedRequestObject. + return clonedRequestObject } - cb() } -UrlEncoded.prototype.end = function () { - if (this.boy._done) { return } +mixinBody(Request) - if (this._state === 'key' && this._key.length > 0) { - this.boy.emit('field', decodeText(this._key, 'binary', this.charset), - '', - this._keyTrunc, - false) - } else if (this._state === 'val') { - this.boy.emit('field', decodeText(this._key, 'binary', this.charset), - decodeText(this._val, 'binary', this.charset), - this._keyTrunc, - this._valTrunc) +function makeRequest (init) { + // https://fetch.spec.whatwg.org/#requests + const request = { + method: 'GET', + localURLsOnly: false, + unsafeRequest: false, + body: null, + client: null, + reservedClient: null, + replacesClientId: '', + window: 'client', + keepalive: false, + serviceWorkers: 'all', + initiator: '', + destination: '', + priority: null, + origin: 'client', + policyContainer: 'client', + referrer: 'client', + referrerPolicy: '', + mode: 'no-cors', + useCORSPreflightFlag: false, + credentials: 'same-origin', + useCredentials: false, + cache: 'default', + redirect: 'follow', + integrity: '', + cryptoGraphicsNonceMetadata: '', + parserMetadata: '', + reloadNavigation: false, + historyNavigation: false, + userActivation: false, + taintedOrigin: false, + redirectCount: 0, + responseTainting: 'basic', + preventNoCacheCacheControlHeaderModification: false, + done: false, + timingAllowFailed: false, + ...init, + headersList: init.headersList + ? new HeadersList(init.headersList) + : new HeadersList() } - this.boy._done = true - this.boy.emit('finish') + request.url = request.urlList[0] + return request } -module.exports = UrlEncoded +// https://fetch.spec.whatwg.org/#concept-request-clone +function cloneRequest (request) { + // To clone a request request, run these steps: + // 1. Let newRequest be a copy of request, except for its body. + const newRequest = makeRequest({ ...request, body: null }) -/***/ }), + // 2. If request’s body is non-null, set newRequest’s body to the + // result of cloning request’s body. + if (request.body != null) { + newRequest.body = cloneBody(request.body) + } -/***/ 58926: -/***/ ((module) => { + // 3. Return newRequest. + return newRequest +} +Object.defineProperties(Request.prototype, { + method: kEnumerableProperty, + url: kEnumerableProperty, + headers: kEnumerableProperty, + redirect: kEnumerableProperty, + clone: kEnumerableProperty, + signal: kEnumerableProperty, + duplex: kEnumerableProperty, + destination: kEnumerableProperty, + body: kEnumerableProperty, + bodyUsed: kEnumerableProperty, + isHistoryNavigation: kEnumerableProperty, + isReloadNavigation: kEnumerableProperty, + keepalive: kEnumerableProperty, + integrity: kEnumerableProperty, + cache: kEnumerableProperty, + credentials: kEnumerableProperty, + attribute: kEnumerableProperty, + referrerPolicy: kEnumerableProperty, + referrer: kEnumerableProperty, + mode: kEnumerableProperty, + [Symbol.toStringTag]: { + value: 'Request', + configurable: true + } +}) +webidl.converters.Request = webidl.interfaceConverter( + Request +) -const RE_PLUS = /\+/g +// https://fetch.spec.whatwg.org/#requestinfo +webidl.converters.RequestInfo = function (V) { + if (typeof V === 'string') { + return webidl.converters.USVString(V) + } -const HEX = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -] + if (V instanceof Request) { + return webidl.converters.Request(V) + } -function Decoder () { - this.buffer = undefined + return webidl.converters.USVString(V) } -Decoder.prototype.write = function (str) { - // Replace '+' with ' ' before decoding - str = str.replace(RE_PLUS, ' ') - let res = '' - let i = 0; let p = 0; const len = str.length - for (; i < len; ++i) { - if (this.buffer !== undefined) { - if (!HEX[str.charCodeAt(i)]) { - res += '%' + this.buffer - this.buffer = undefined - --i // retry character - } else { - this.buffer += str[i] - ++p - if (this.buffer.length === 2) { - res += String.fromCharCode(parseInt(this.buffer, 16)) - this.buffer = undefined - } - } - } else if (str[i] === '%') { - if (i > p) { - res += str.substring(p, i) - p = i - } - this.buffer = '' - ++p - } + +webidl.converters.AbortSignal = webidl.interfaceConverter( + AbortSignal +) + +// https://fetch.spec.whatwg.org/#requestinit +webidl.converters.RequestInit = webidl.dictionaryConverter([ + { + key: 'method', + converter: webidl.converters.ByteString + }, + { + key: 'headers', + converter: webidl.converters.HeadersInit + }, + { + key: 'body', + converter: webidl.nullableConverter( + webidl.converters.BodyInit + ) + }, + { + key: 'referrer', + converter: webidl.converters.USVString + }, + { + key: 'referrerPolicy', + converter: webidl.converters.DOMString, + // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy + allowedValues: referrerPolicy + }, + { + key: 'mode', + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#concept-request-mode + allowedValues: requestMode + }, + { + key: 'credentials', + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#requestcredentials + allowedValues: requestCredentials + }, + { + key: 'cache', + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#requestcache + allowedValues: requestCache + }, + { + key: 'redirect', + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#requestredirect + allowedValues: requestRedirect + }, + { + key: 'integrity', + converter: webidl.converters.DOMString + }, + { + key: 'keepalive', + converter: webidl.converters.boolean + }, + { + key: 'signal', + converter: webidl.nullableConverter( + (signal) => webidl.converters.AbortSignal( + signal, + { strict: false } + ) + ) + }, + { + key: 'window', + converter: webidl.converters.any + }, + { + key: 'duplex', + converter: webidl.converters.DOMString, + allowedValues: requestDuplex } - if (p < len && this.buffer === undefined) { res += str.substring(p) } - return res -} -Decoder.prototype.reset = function () { - this.buffer = undefined -} +]) -module.exports = Decoder +module.exports = { Request, makeRequest } /***/ }), -/***/ 58054: -/***/ ((module) => { +/***/ 40599: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = function basename (path) { - if (typeof path !== 'string') { return '' } - for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var - switch (path.charCodeAt(i)) { - case 0x2F: // '/' - case 0x5C: // '\' - path = path.slice(i + 1) - return (path === '..' || path === '.' ? '' : path) - } +const { Headers, HeadersList, fill } = __nccwpck_require__(13915) +const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(42173) +const util = __nccwpck_require__(43061) +const { kEnumerableProperty } = util +const { + isValidReasonPhrase, + isCancelled, + isAborted, + isBlobLike, + serializeJavascriptValueToJSONString, + isErrorLike, + isomorphicEncode +} = __nccwpck_require__(47794) +const { + redirectStatusSet, + nullBodyStatus, + DOMException +} = __nccwpck_require__(20075) +const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(10730) +const { webidl } = __nccwpck_require__(7000) +const { FormData } = __nccwpck_require__(12787) +const { getGlobalOrigin } = __nccwpck_require__(48582) +const { URLSerializer } = __nccwpck_require__(16306) +const { kHeadersList, kConstruct } = __nccwpck_require__(69898) +const assert = __nccwpck_require__(39491) +const { types } = __nccwpck_require__(73837) + +const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(35356).ReadableStream) +const textEncoder = new TextEncoder('utf-8') + +// https://fetch.spec.whatwg.org/#response-class +class Response { + // Creates network error Response. + static error () { + // TODO + const relevantRealm = { settingsObject: {} } + + // The static error() method steps are to return the result of creating a + // Response object, given a new network error, "immutable", and this’s + // relevant Realm. + const responseObject = new Response() + responseObject[kState] = makeNetworkError() + responseObject[kRealm] = relevantRealm + responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList + responseObject[kHeaders][kGuard] = 'immutable' + responseObject[kHeaders][kRealm] = relevantRealm + return responseObject } - return (path === '..' || path === '.' ? '' : path) -} + // https://fetch.spec.whatwg.org/#dom-response-json + static json (data, init = {}) { + webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' }) -/***/ }), + if (init !== null) { + init = webidl.converters.ResponseInit(init) + } -/***/ 92892: -/***/ (function(module) { + // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data. + const bytes = textEncoder.encode( + serializeJavascriptValueToJSONString(data) + ) + // 2. Let body be the result of extracting bytes. + const body = extractBody(bytes) + // 3. Let responseObject be the result of creating a Response object, given a new response, + // "response", and this’s relevant Realm. + const relevantRealm = { settingsObject: {} } + const responseObject = new Response() + responseObject[kRealm] = relevantRealm + responseObject[kHeaders][kGuard] = 'response' + responseObject[kHeaders][kRealm] = relevantRealm -// Node has always utf-8 -const utf8Decoder = new TextDecoder('utf-8') -const textDecoders = new Map([ - ['utf-8', utf8Decoder], - ['utf8', utf8Decoder] -]) + // 4. Perform initialize a response given responseObject, init, and (body, "application/json"). + initializeResponse(responseObject, init, { body: body[0], type: 'application/json' }) -function getDecoder (charset) { - let lc - while (true) { - switch (charset) { - case 'utf-8': - case 'utf8': - return decoders.utf8 - case 'latin1': - case 'ascii': // TODO: Make these a separate, strict decoder? - case 'us-ascii': - case 'iso-8859-1': - case 'iso8859-1': - case 'iso88591': - case 'iso_8859-1': - case 'windows-1252': - case 'iso_8859-1:1987': - case 'cp1252': - case 'x-cp1252': - return decoders.latin1 - case 'utf16le': - case 'utf-16le': - case 'ucs2': - case 'ucs-2': - return decoders.utf16le - case 'base64': - return decoders.base64 - default: - if (lc === undefined) { - lc = true - charset = charset.toLowerCase() - continue - } - return decoders.other.bind(charset) - } + // 5. Return responseObject. + return responseObject } -} - -const decoders = { - utf8: (data, sourceEncoding) => { - if (data.length === 0) { - return '' - } - if (typeof data === 'string') { - data = Buffer.from(data, sourceEncoding) - } - return data.utf8Slice(0, data.length) - }, -<<<<<<< HEAD - latin1: (data, sourceEncoding) => { - if (data.length === 0) { - return '' - } - if (typeof data === 'string') { - return data - } - return data.latin1Slice(0, data.length) - }, + // Creates a redirect Response that redirects to url with status status. + static redirect (url, status = 302) { + const relevantRealm = { settingsObject: {} } - utf16le: (data, sourceEncoding) => { - if (data.length === 0) { - return '' - } - if (typeof data === 'string') { - data = Buffer.from(data, sourceEncoding) - } - return data.ucs2Slice(0, data.length) - }, + webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' }) - base64: (data, sourceEncoding) => { - if (data.length === 0) { - return '' - } - if (typeof data === 'string') { - data = Buffer.from(data, sourceEncoding) - } - return data.base64Slice(0, data.length) - }, + url = webidl.converters.USVString(url) + status = webidl.converters['unsigned short'](status) - other: (data, sourceEncoding) => { - if (data.length === 0) { - return '' - } - if (typeof data === 'string') { - data = Buffer.from(data, sourceEncoding) + // 1. Let parsedURL be the result of parsing url with current settings + // object’s API base URL. + // 2. If parsedURL is failure, then throw a TypeError. + // TODO: base-URL? + let parsedURL + try { + parsedURL = new URL(url, getGlobalOrigin()) + } catch (err) { + throw Object.assign(new TypeError('Failed to parse URL from ' + url), { + cause: err + }) } - if (textDecoders.has(this.toString())) { - try { - return textDecoders.get(this).decode(data) - } catch (e) { } + // 3. If status is not a redirect status, then throw a RangeError. + if (!redirectStatusSet.has(status)) { + throw new RangeError('Invalid status code ' + status) } - return typeof data === 'string' - ? data - : data.toString() - } -} -function decodeText (text, sourceEncoding, destEncoding) { - if (text) { - return getDecoder(destEncoding)(text, sourceEncoding) - } - return text -} + // 4. Let responseObject be the result of creating a Response object, + // given a new response, "immutable", and this’s relevant Realm. + const responseObject = new Response() + responseObject[kRealm] = relevantRealm + responseObject[kHeaders][kGuard] = 'immutable' + responseObject[kHeaders][kRealm] = relevantRealm -module.exports = decodeText + // 5. Set responseObject’s response’s status to status. + responseObject[kState].status = status + // 6. Let value be parsedURL, serialized and isomorphic encoded. + const value = isomorphicEncode(URLSerializer(parsedURL)) -/***/ }), + // 7. Append `Location`/value to responseObject’s response’s header list. + responseObject[kState].headersList.append('location', value) -/***/ 21619: -/***/ ((module) => { + // 8. Return responseObject. + return responseObject + } + // https://fetch.spec.whatwg.org/#dom-response + constructor (body = null, init = {}) { + if (body !== null) { + body = webidl.converters.BodyInit(body) + } + init = webidl.converters.ResponseInit(init) -module.exports = function getLimit (limits, name, defaultLimit) { - if ( - !limits || - limits[name] === undefined || - limits[name] === null - ) { return defaultLimit } + // TODO + this[kRealm] = { settingsObject: {} } - if ( - typeof limits[name] !== 'number' || - isNaN(limits[name]) - ) { throw new TypeError('Limit ' + name + ' is not a valid number') } + // 1. Set this’s response to a new response. + this[kState] = makeResponse({}) - return limits[name] -} + // 2. Set this’s headers to a new Headers object with this’s relevant + // Realm, whose header list is this’s response’s header list and guard + // is "response". + this[kHeaders] = new Headers(kConstruct) + this[kHeaders][kGuard] = 'response' + this[kHeaders][kHeadersList] = this[kState].headersList + this[kHeaders][kRealm] = this[kRealm] + // 3. Let bodyWithType be null. + let bodyWithType = null -/***/ }), + // 4. If body is non-null, then set bodyWithType to the result of extracting body. + if (body != null) { + const [extractedBody, type] = extractBody(body) + bodyWithType = { body: extractedBody, type } + } -/***/ 73411: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // 5. Perform initialize a response given this, init, and bodyWithType. + initializeResponse(this, init, bodyWithType) + } -/* eslint-disable object-property-newline */ + // Returns response’s type, e.g., "cors". + get type () { + webidl.brandCheck(this, Response) + // The type getter steps are to return this’s response’s type. + return this[kState].type + } -const decodeText = __nccwpck_require__(92892) + // Returns response’s URL, if it has one; otherwise the empty string. + get url () { + webidl.brandCheck(this, Response) -const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g + const urlList = this[kState].urlList -const EncodedLookup = { - '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04', - '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09', - '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c', - '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e', - '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12', - '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17', - '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b', - '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d', - '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20', - '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25', - '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a', - '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c', - '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f', - '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33', - '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38', - '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b', - '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e', - '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41', - '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46', - '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a', - '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d', - '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f', - '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54', - '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59', - '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c', - '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e', - '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62', - '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67', - '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b', - '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d', - '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70', - '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75', - '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a', - '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c', - '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f', - '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83', - '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88', - '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b', - '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e', - '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91', - '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96', - '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a', - '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d', - '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f', - '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2', - '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4', - '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7', - '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9', - '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab', - '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac', - '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad', - '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae', - '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0', - '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2', - '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5', - '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7', - '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba', - '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb', - '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc', - '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd', - '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf', - '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0', - '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3', - '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5', - '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8', - '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca', - '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb', - '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc', - '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce', - '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf', - '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1', - '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3', - '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6', - '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8', - '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda', - '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb', - '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd', - '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde', - '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf', - '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1', - '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4', - '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6', - '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9', - '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea', - '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec', - '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed', - '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee', - '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef', - '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2', - '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4', - '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7', - '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9', - '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb', - '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc', - '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd', - '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe', - '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff' -} + // The url getter steps are to return the empty string if this’s + // response’s URL is null; otherwise this’s response’s URL, + // serialized with exclude fragment set to true. + const url = urlList[urlList.length - 1] ?? null -function encodedReplacer (match) { - return EncodedLookup[match] -} + if (url === null) { + return '' + } -const STATE_KEY = 0 -const STATE_VALUE = 1 -const STATE_CHARSET = 2 -const STATE_LANG = 3 + return URLSerializer(url, true) + } -function parseParams (str) { - const res = [] - let state = STATE_KEY - let charset = '' - let inquote = false - let escaping = false - let p = 0 - let tmp = '' - const len = str.length + // Returns whether response was obtained through a redirect. + get redirected () { + webidl.brandCheck(this, Response) - for (var i = 0; i < len; ++i) { // eslint-disable-line no-var - const char = str[i] - if (char === '\\' && inquote) { - if (escaping) { escaping = false } else { - escaping = true - continue - } - } else if (char === '"') { - if (!escaping) { - if (inquote) { - inquote = false - state = STATE_KEY - } else { inquote = true } - continue - } else { escaping = false } - } else { - if (escaping && inquote) { tmp += '\\' } - escaping = false - if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") { - if (state === STATE_CHARSET) { - state = STATE_LANG - charset = tmp.substring(1) - } else { state = STATE_VALUE } - tmp = '' - continue - } else if (state === STATE_KEY && - (char === '*' || char === '=') && - res.length) { - state = char === '*' - ? STATE_CHARSET - : STATE_VALUE - res[p] = [tmp, undefined] - tmp = '' - continue - } else if (!inquote && char === ';') { - state = STATE_KEY - if (charset) { - if (tmp.length) { - tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer), - 'binary', - charset) - } - charset = '' - } else if (tmp.length) { - tmp = decodeText(tmp, 'binary', 'utf8') - } - if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp } - tmp = '' - ++p - continue - } else if (!inquote && (char === ' ' || char === '\t')) { continue } - } - tmp += char + // The redirected getter steps are to return true if this’s response’s URL + // list has more than one item; otherwise false. + return this[kState].urlList.length > 1 + } + + // Returns response’s status. + get status () { + webidl.brandCheck(this, Response) + + // The status getter steps are to return this’s response’s status. + return this[kState].status } - if (charset && tmp.length) { - tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer), - 'binary', - charset) - } else if (tmp) { - tmp = decodeText(tmp, 'binary', 'utf8') + + // Returns whether response’s status is an ok status. + get ok () { + webidl.brandCheck(this, Response) + + // The ok getter steps are to return true if this’s response’s status is an + // ok status; otherwise false. + return this[kState].status >= 200 && this[kState].status <= 299 } - if (res[p] === undefined) { - if (tmp) { res[p] = tmp } - } else { res[p][1] = tmp } + // Returns response’s status message. + get statusText () { + webidl.brandCheck(this, Response) - return res + // The statusText getter steps are to return this’s response’s status + // message. + return this[kState].statusText + } + + // Returns response’s headers as Headers. + get headers () { + webidl.brandCheck(this, Response) + + // The headers getter steps are to return this’s headers. + return this[kHeaders] + } + + get body () { + webidl.brandCheck(this, Response) + + return this[kState].body ? this[kState].body.stream : null + } + + get bodyUsed () { + webidl.brandCheck(this, Response) + + return !!this[kState].body && util.isDisturbed(this[kState].body.stream) + } + + // Returns a clone of response. + clone () { + webidl.brandCheck(this, Response) + + // 1. If this is unusable, then throw a TypeError. + if (this.bodyUsed || (this.body && this.body.locked)) { + throw webidl.errors.exception({ + header: 'Response.clone', + message: 'Body has already been consumed.' + }) + } + + // 2. Let clonedResponse be the result of cloning this’s response. + const clonedResponse = cloneResponse(this[kState]) + + // 3. Return the result of creating a Response object, given + // clonedResponse, this’s headers’s guard, and this’s relevant Realm. + const clonedResponseObject = new Response() + clonedResponseObject[kState] = clonedResponse + clonedResponseObject[kRealm] = this[kRealm] + clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList + clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard] + clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm] + + return clonedResponseObject + } } -module.exports = parseParams +mixinBody(Response) +Object.defineProperties(Response.prototype, { + type: kEnumerableProperty, + url: kEnumerableProperty, + status: kEnumerableProperty, + ok: kEnumerableProperty, + redirected: kEnumerableProperty, + statusText: kEnumerableProperty, + headers: kEnumerableProperty, + clone: kEnumerableProperty, + body: kEnumerableProperty, + bodyUsed: kEnumerableProperty, + [Symbol.toStringTag]: { + value: 'Response', + configurable: true + } +}) -/***/ }), +Object.defineProperties(Response, { + json: kEnumerableProperty, + redirect: kEnumerableProperty, + error: kEnumerableProperty +}) -/***/ 58686: -/***/ ((__webpack_module__, __unused_webpack___webpack_exports__, __nccwpck_require__) => { +// https://fetch.spec.whatwg.org/#concept-response-clone +function cloneResponse (response) { + // To clone a response response, run these steps: -__nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { -/* harmony import */ var _runner_js__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(10762); + // 1. If response is a filtered response, then return a new identical + // filtered response whose internal response is a clone of response’s + // internal response. + if (response.internalResponse) { + return filterResponse( + cloneResponse(response.internalResponse), + response.type + ) + } + // 2. Let newResponse be a copy of response, except for its body. + const newResponse = makeResponse({ ...response, body: null }) -await (0,_runner_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(); -__webpack_async_result__(); -} catch(e) { __webpack_async_result__(e); } }, 1); + // 3. If response’s body is non-null, then set newResponse’s body to the + // result of cloning response’s body. + if (response.body != null) { + newResponse.body = cloneBody(response.body) + } -/***/ }), + // 4. Return newResponse. + return newResponse +} -/***/ 10762: -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => { +function makeResponse (init) { + return { + aborted: false, + rangeRequested: false, + timingAllowPassed: false, + requestIncludesCredentials: false, + type: 'default', + status: 200, + timingInfo: null, + cacheState: '', + statusText: '', + ...init, + headersList: init.headersList + ? new HeadersList(init.headersList) + : new HeadersList(), + urlList: init.urlList ? [...init.urlList] : [] + } +} +function makeNetworkError (reason) { + const isError = isErrorLike(reason) + return makeResponse({ + type: 'error', + status: 0, + error: isError + ? reason + : new Error(reason ? String(reason) : reason), + aborted: reason && reason.name === 'AbortError' + }) +} -// EXPORTS -__nccwpck_require__.d(__webpack_exports__, { - "Z": () => (/* binding */ runner) -}); +function makeFilteredResponse (response, state) { + state = { + internalResponse: response, + ...state + } -// NAMESPACE OBJECT: ./node_modules/@ipld/dag-pb/src/index.js -var src_namespaceObject = {}; -__nccwpck_require__.r(src_namespaceObject); -__nccwpck_require__.d(src_namespaceObject, { - "code": () => (code), - "createLink": () => (createLink), - "createNode": () => (createNode), - "decode": () => (src_decode), - "encode": () => (src_encode), - "name": () => (src_name), - "prepare": () => (prepare), - "validate": () => (validate) -}); + return new Proxy(response, { + get (target, p) { + return p in state ? state[p] : target[p] + }, + set (target, p, value) { + assert(!(p in state)) + target[p] = value + return true + } + }) +} -// NAMESPACE OBJECT: ./node_modules/@ipld/dag-cbor/src/index.js -var dag_cbor_src_namespaceObject = {}; -__nccwpck_require__.r(dag_cbor_src_namespaceObject); -__nccwpck_require__.d(dag_cbor_src_namespaceObject, { - "code": () => (src_code), - "decode": () => (dag_cbor_src_decode), - "encode": () => (dag_cbor_src_encode), - "name": () => (dag_cbor_src_name) -}); +// https://fetch.spec.whatwg.org/#concept-filtered-response +function filterResponse (response, type) { + // Set response to the following filtered response with response as its + // internal response, depending on request’s response tainting: + if (type === 'basic') { + // A basic filtered response is a filtered response whose type is "basic" + // and header list excludes any headers in internal response’s header list + // whose name is a forbidden response-header name. -// NAMESPACE OBJECT: ./node_modules/@ipld/dag-json/src/index.js -var dag_json_src_namespaceObject = {}; -__nccwpck_require__.r(dag_json_src_namespaceObject); -__nccwpck_require__.d(dag_json_src_namespaceObject, { - "code": () => (dag_json_src_code), - "decode": () => (dag_json_src_decode), - "encode": () => (dag_json_src_encode), - "format": () => (src_format), - "name": () => (dag_json_src_name), - "parse": () => (parse), - "stringify": () => (src_format) -}); + // Note: undici does not implement forbidden response-header names + return makeFilteredResponse(response, { + type: 'basic', + headersList: response.headersList + }) + } else if (type === 'cors') { + // A CORS filtered response is a filtered response whose type is "cors" + // and header list excludes any headers in internal response’s header + // list whose name is not a CORS-safelisted response-header name, given + // internal response’s CORS-exposed header-name list. -// NAMESPACE OBJECT: ./node_modules/dag-jose/lib/index.js -var lib_namespaceObject = {}; -__nccwpck_require__.r(lib_namespaceObject); -__nccwpck_require__.d(lib_namespaceObject, { - "code": () => (lib_code), - "decode": () => (lib_decode), - "encode": () => (lib_encode), - "name": () => (lib_name), - "toGeneral": () => (toGeneral) -}); + // Note: undici does not implement CORS-safelisted response-header names + return makeFilteredResponse(response, { + type: 'cors', + headersList: response.headersList + }) + } else if (type === 'opaque') { + // An opaque filtered response is a filtered response whose type is + // "opaque", URL list is the empty list, status is 0, status message + // is the empty byte sequence, header list is empty, and body is null. -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/hashes/identity.js -var identity_namespaceObject = {}; -__nccwpck_require__.r(identity_namespaceObject); -__nccwpck_require__.d(identity_namespaceObject, { - "identity": () => (identity_identity) -}); + return makeFilteredResponse(response, { + type: 'opaque', + urlList: Object.freeze([]), + status: 0, + statusText: '', + body: null + }) + } else if (type === 'opaqueredirect') { + // An opaque-redirect filtered response is a filtered response whose type + // is "opaqueredirect", status is 0, status message is the empty byte + // sequence, header list is empty, and body is null. -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/identity.js -var bases_identity_namespaceObject = {}; -__nccwpck_require__.r(bases_identity_namespaceObject); -__nccwpck_require__.d(bases_identity_namespaceObject, { - "identity": () => (bases_identity_identity) -}); + return makeFilteredResponse(response, { + type: 'opaqueredirect', + status: 0, + statusText: '', + headersList: [], + body: null + }) + } else { + assert(false) + } +} -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base2.js -var base2_namespaceObject = {}; -__nccwpck_require__.r(base2_namespaceObject); -__nccwpck_require__.d(base2_namespaceObject, { - "base2": () => (base2) -}); +// https://fetch.spec.whatwg.org/#appropriate-network-error +function makeAppropriateNetworkError (fetchParams, err = null) { + // 1. Assert: fetchParams is canceled. + assert(isCancelled(fetchParams)) -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base8.js -var base8_namespaceObject = {}; -__nccwpck_require__.r(base8_namespaceObject); -__nccwpck_require__.d(base8_namespaceObject, { - "base8": () => (base8) -}); + // 2. Return an aborted network error if fetchParams is aborted; + // otherwise return a network error. + return isAborted(fetchParams) + ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err })) + : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err })) +} -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base10.js -var base10_namespaceObject = {}; -__nccwpck_require__.r(base10_namespaceObject); -__nccwpck_require__.d(base10_namespaceObject, { - "base10": () => (base10) -}); +// https://whatpr.org/fetch/1392.html#initialize-a-response +function initializeResponse (response, init, body) { + // 1. If init["status"] is not in the range 200 to 599, inclusive, then + // throw a RangeError. + if (init.status !== null && (init.status < 200 || init.status > 599)) { + throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.') + } -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base16.js -var base16_namespaceObject = {}; -__nccwpck_require__.r(base16_namespaceObject); -__nccwpck_require__.d(base16_namespaceObject, { - "base16": () => (base16), - "base16upper": () => (base16upper) -}); + // 2. If init["statusText"] does not match the reason-phrase token production, + // then throw a TypeError. + if ('statusText' in init && init.statusText != null) { + // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2: + // reason-phrase = *( HTAB / SP / VCHAR / obs-text ) + if (!isValidReasonPhrase(String(init.statusText))) { + throw new TypeError('Invalid statusText') + } + } -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base32.js -var node_modules_multiformats_src_bases_base32_namespaceObject = {}; -__nccwpck_require__.r(node_modules_multiformats_src_bases_base32_namespaceObject); -__nccwpck_require__.d(node_modules_multiformats_src_bases_base32_namespaceObject, { - "base32": () => (node_modules_multiformats_src_bases_base32_base32), - "base32hex": () => (multiformats_src_bases_base32_base32hex), - "base32hexpad": () => (multiformats_src_bases_base32_base32hexpad), - "base32hexpadupper": () => (multiformats_src_bases_base32_base32hexpadupper), - "base32hexupper": () => (multiformats_src_bases_base32_base32hexupper), - "base32pad": () => (multiformats_src_bases_base32_base32pad), - "base32padupper": () => (multiformats_src_bases_base32_base32padupper), - "base32upper": () => (node_modules_multiformats_src_bases_base32_base32upper), - "base32z": () => (multiformats_src_bases_base32_base32z) -}); + // 3. Set response’s response’s status to init["status"]. + if ('status' in init && init.status != null) { + response[kState].status = init.status + } -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base36.js -var base36_namespaceObject = {}; -__nccwpck_require__.r(base36_namespaceObject); -__nccwpck_require__.d(base36_namespaceObject, { - "base36": () => (base36), - "base36upper": () => (base36upper) -}); + // 4. Set response’s response’s status message to init["statusText"]. + if ('statusText' in init && init.statusText != null) { + response[kState].statusText = init.statusText + } -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base58.js -var node_modules_multiformats_src_bases_base58_namespaceObject = {}; -__nccwpck_require__.r(node_modules_multiformats_src_bases_base58_namespaceObject); -__nccwpck_require__.d(node_modules_multiformats_src_bases_base58_namespaceObject, { - "base58btc": () => (node_modules_multiformats_src_bases_base58_base58btc), - "base58flickr": () => (multiformats_src_bases_base58_base58flickr) -}); + // 5. If init["headers"] exists, then fill response’s headers with init["headers"]. + if ('headers' in init && init.headers != null) { + fill(response[kHeaders], init.headers) + } -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base64.js -var src_bases_base64_namespaceObject = {}; -__nccwpck_require__.r(src_bases_base64_namespaceObject); -__nccwpck_require__.d(src_bases_base64_namespaceObject, { - "base64": () => (bases_base64_base64), - "base64pad": () => (bases_base64_base64pad), - "base64url": () => (bases_base64_base64url), - "base64urlpad": () => (bases_base64_base64urlpad) -}); + // 6. If body was given, then: + if (body) { + // 1. If response's status is a null body status, then throw a TypeError. + if (nullBodyStatus.includes(response.status)) { + throw webidl.errors.exception({ + header: 'Response constructor', + message: 'Invalid response status code ' + response.status + }) + } -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base256emoji.js -var base256emoji_namespaceObject = {}; -__nccwpck_require__.r(base256emoji_namespaceObject); -__nccwpck_require__.d(base256emoji_namespaceObject, { - "base256emoji": () => (base256emoji) -}); + // 2. Set response's body to body's body. + response[kState].body = body.body -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/hashes/sha2.js -var sha2_namespaceObject = {}; -__nccwpck_require__.r(sha2_namespaceObject); -__nccwpck_require__.d(sha2_namespaceObject, { - "sha256": () => (sha2_sha256), - "sha512": () => (sha512) -}); + // 3. If body's type is non-null and response's header list does not contain + // `Content-Type`, then append (`Content-Type`, body's type) to response's header list. + if (body.type != null && !response[kState].headersList.contains('Content-Type')) { + response[kState].headersList.append('content-type', body.type) + } + } +} -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/codecs/raw.js -var raw_namespaceObject = {}; -__nccwpck_require__.r(raw_namespaceObject); -__nccwpck_require__.d(raw_namespaceObject, { - "code": () => (raw_code), - "decode": () => (raw_decode), - "encode": () => (raw_encode), - "name": () => (raw_name) -}); +webidl.converters.ReadableStream = webidl.interfaceConverter( + ReadableStream +) -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/codecs/json.js -var codecs_json_namespaceObject = {}; -__nccwpck_require__.r(codecs_json_namespaceObject); -__nccwpck_require__.d(codecs_json_namespaceObject, { - "code": () => (json_code), - "decode": () => (json_decode), - "encode": () => (json_encode), - "name": () => (json_name) -}); +webidl.converters.FormData = webidl.interfaceConverter( + FormData +) -// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base58.js -var dist_src_bases_base58_namespaceObject = {}; -__nccwpck_require__.r(dist_src_bases_base58_namespaceObject); -__nccwpck_require__.d(dist_src_bases_base58_namespaceObject, { - "base58btc": () => (dist_src_bases_base58_base58btc), - "base58flickr": () => (dist_src_bases_base58_base58flickr) -}); +webidl.converters.URLSearchParams = webidl.interfaceConverter( + URLSearchParams +) -// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base32.js -var dist_src_bases_base32_namespaceObject = {}; -__nccwpck_require__.r(dist_src_bases_base32_namespaceObject); -__nccwpck_require__.d(dist_src_bases_base32_namespaceObject, { - "base32": () => (dist_src_bases_base32_base32), - "base32hex": () => (dist_src_bases_base32_base32hex), - "base32hexpad": () => (dist_src_bases_base32_base32hexpad), - "base32hexpadupper": () => (dist_src_bases_base32_base32hexpadupper), - "base32hexupper": () => (dist_src_bases_base32_base32hexupper), - "base32pad": () => (dist_src_bases_base32_base32pad), - "base32padupper": () => (dist_src_bases_base32_base32padupper), - "base32upper": () => (dist_src_bases_base32_base32upper), - "base32z": () => (dist_src_bases_base32_base32z) -}); +// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit +webidl.converters.XMLHttpRequestBodyInit = function (V) { + if (typeof V === 'string') { + return webidl.converters.USVString(V) + } -// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base10.js -var bases_base10_namespaceObject = {}; -__nccwpck_require__.r(bases_base10_namespaceObject); -__nccwpck_require__.d(bases_base10_namespaceObject, { - "base10": () => (base10_base10) -}); + if (isBlobLike(V)) { + return webidl.converters.Blob(V, { strict: false }) + } -// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base16.js -var bases_base16_namespaceObject = {}; -__nccwpck_require__.r(bases_base16_namespaceObject); -__nccwpck_require__.d(bases_base16_namespaceObject, { - "base16": () => (base16_base16), - "base16upper": () => (base16_base16upper) -}); + if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) { + return webidl.converters.BufferSource(V) + } -// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base2.js -var bases_base2_namespaceObject = {}; -__nccwpck_require__.r(bases_base2_namespaceObject); -__nccwpck_require__.d(bases_base2_namespaceObject, { - "base2": () => (base2_base2) -}); + if (util.isFormDataLike(V)) { + return webidl.converters.FormData(V, { strict: false }) + } -// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base256emoji.js -var bases_base256emoji_namespaceObject = {}; -__nccwpck_require__.r(bases_base256emoji_namespaceObject); -__nccwpck_require__.d(bases_base256emoji_namespaceObject, { - "base256emoji": () => (base256emoji_base256emoji) -}); + if (V instanceof URLSearchParams) { + return webidl.converters.URLSearchParams(V) + } -// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base36.js -var bases_base36_namespaceObject = {}; -__nccwpck_require__.r(bases_base36_namespaceObject); -__nccwpck_require__.d(bases_base36_namespaceObject, { - "base36": () => (base36_base36), - "base36upper": () => (base36_base36upper) -}); + return webidl.converters.DOMString(V) +} -// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base64.js -var dist_src_bases_base64_namespaceObject = {}; -__nccwpck_require__.r(dist_src_bases_base64_namespaceObject); -__nccwpck_require__.d(dist_src_bases_base64_namespaceObject, { - "base64": () => (src_bases_base64_base64), - "base64pad": () => (src_bases_base64_base64pad), - "base64url": () => (src_bases_base64_base64url), - "base64urlpad": () => (src_bases_base64_base64urlpad) -}); +// https://fetch.spec.whatwg.org/#bodyinit +webidl.converters.BodyInit = function (V) { + if (V instanceof ReadableStream) { + return webidl.converters.ReadableStream(V) + } -// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base8.js -var bases_base8_namespaceObject = {}; -__nccwpck_require__.r(bases_base8_namespaceObject); -__nccwpck_require__.d(bases_base8_namespaceObject, { - "base8": () => (base8_base8) -}); + // Note: the spec doesn't include async iterables, + // this is an undici extension. + if (V?.[Symbol.asyncIterator]) { + return V + } -// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/identity.js -var src_bases_identity_namespaceObject = {}; -__nccwpck_require__.r(src_bases_identity_namespaceObject); -__nccwpck_require__.d(src_bases_identity_namespaceObject, { - "identity": () => (src_bases_identity_identity) -}); + return webidl.converters.XMLHttpRequestBodyInit(V) +} -// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/codecs/json.js -var src_codecs_json_namespaceObject = {}; -__nccwpck_require__.r(src_codecs_json_namespaceObject); -__nccwpck_require__.d(src_codecs_json_namespaceObject, { - "code": () => (codecs_json_code), - "decode": () => (codecs_json_decode), - "encode": () => (codecs_json_encode), - "name": () => (codecs_json_name) -}); +webidl.converters.ResponseInit = webidl.dictionaryConverter([ + { + key: 'status', + converter: webidl.converters['unsigned short'], + defaultValue: 200 + }, + { + key: 'statusText', + converter: webidl.converters.ByteString, + defaultValue: '' + }, + { + key: 'headers', + converter: webidl.converters.HeadersInit + } +]) -// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/codecs/raw.js -var codecs_raw_namespaceObject = {}; -__nccwpck_require__.r(codecs_raw_namespaceObject); -__nccwpck_require__.d(codecs_raw_namespaceObject, { - "code": () => (codecs_raw_code), - "decode": () => (codecs_raw_decode), - "encode": () => (codecs_raw_encode), - "name": () => (codecs_raw_name) -}); +module.exports = { + makeNetworkError, + makeResponse, + makeAppropriateNetworkError, + filterResponse, + Response, + cloneResponse +} -// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/hashes/identity.js -var hashes_identity_namespaceObject = {}; -__nccwpck_require__.r(hashes_identity_namespaceObject); -__nccwpck_require__.d(hashes_identity_namespaceObject, { - "identity": () => (hashes_identity_identity) -}); -// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/hashes/sha2.js -var hashes_sha2_namespaceObject = {}; -__nccwpck_require__.r(hashes_sha2_namespaceObject); -__nccwpck_require__.d(hashes_sha2_namespaceObject, { - "sha256": () => (hashes_sha2_sha256), - "sha512": () => (sha2_sha512) -}); +/***/ }), -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base10.js -var src_bases_base10_namespaceObject = {}; -__nccwpck_require__.r(src_bases_base10_namespaceObject); -__nccwpck_require__.d(src_bases_base10_namespaceObject, { - "base10": () => (bases_base10_base10) -}); +/***/ 10730: +/***/ ((module) => { -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base16.js -var src_bases_base16_namespaceObject = {}; -__nccwpck_require__.r(src_bases_base16_namespaceObject); -__nccwpck_require__.d(src_bases_base16_namespaceObject, { - "base16": () => (bases_base16_base16), - "base16upper": () => (bases_base16_base16upper) -}); -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base2.js -var src_bases_base2_namespaceObject = {}; -__nccwpck_require__.r(src_bases_base2_namespaceObject); -__nccwpck_require__.d(src_bases_base2_namespaceObject, { - "base2": () => (bases_base2_base2) -}); -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base256emoji.js -var src_bases_base256emoji_namespaceObject = {}; -__nccwpck_require__.r(src_bases_base256emoji_namespaceObject); -__nccwpck_require__.d(src_bases_base256emoji_namespaceObject, { - "base256emoji": () => (bases_base256emoji_base256emoji) -}); +module.exports = { + kUrl: Symbol('url'), + kHeaders: Symbol('headers'), + kSignal: Symbol('signal'), + kState: Symbol('state'), + kGuard: Symbol('guard'), + kRealm: Symbol('realm') +} -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base32.js -var uint8arrays_node_modules_multiformats_src_bases_base32_namespaceObject = {}; -__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_base32_namespaceObject); -__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_base32_namespaceObject, { - "base32": () => (uint8arrays_node_modules_multiformats_src_bases_base32_base32), - "base32hex": () => (node_modules_multiformats_src_bases_base32_base32hex), - "base32hexpad": () => (node_modules_multiformats_src_bases_base32_base32hexpad), - "base32hexpadupper": () => (node_modules_multiformats_src_bases_base32_base32hexpadupper), - "base32hexupper": () => (node_modules_multiformats_src_bases_base32_base32hexupper), - "base32pad": () => (node_modules_multiformats_src_bases_base32_base32pad), - "base32padupper": () => (node_modules_multiformats_src_bases_base32_base32padupper), - "base32upper": () => (uint8arrays_node_modules_multiformats_src_bases_base32_base32upper), - "base32z": () => (node_modules_multiformats_src_bases_base32_base32z) -}); -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base36.js -var src_bases_base36_namespaceObject = {}; -__nccwpck_require__.r(src_bases_base36_namespaceObject); -__nccwpck_require__.d(src_bases_base36_namespaceObject, { - "base36": () => (bases_base36_base36), - "base36upper": () => (bases_base36_base36upper) -}); +/***/ }), -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base58.js -var uint8arrays_node_modules_multiformats_src_bases_base58_namespaceObject = {}; -__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_base58_namespaceObject); -__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_base58_namespaceObject, { - "base58btc": () => (uint8arrays_node_modules_multiformats_src_bases_base58_base58btc), - "base58flickr": () => (node_modules_multiformats_src_bases_base58_base58flickr) -}); +/***/ 47794: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base64.js -var multiformats_src_bases_base64_namespaceObject = {}; -__nccwpck_require__.r(multiformats_src_bases_base64_namespaceObject); -__nccwpck_require__.d(multiformats_src_bases_base64_namespaceObject, { - "base64": () => (multiformats_src_bases_base64_base64), - "base64pad": () => (multiformats_src_bases_base64_base64pad), - "base64url": () => (multiformats_src_bases_base64_base64url), - "base64urlpad": () => (multiformats_src_bases_base64_base64urlpad) -}); -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base8.js -var src_bases_base8_namespaceObject = {}; -__nccwpck_require__.r(src_bases_base8_namespaceObject); -__nccwpck_require__.d(src_bases_base8_namespaceObject, { - "base8": () => (bases_base8_base8) -}); -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/identity.js -var multiformats_src_bases_identity_namespaceObject = {}; -__nccwpck_require__.r(multiformats_src_bases_identity_namespaceObject); -__nccwpck_require__.d(multiformats_src_bases_identity_namespaceObject, { - "identity": () => (multiformats_src_bases_identity_identity) -}); +const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(20075) +const { getGlobalOrigin } = __nccwpck_require__(48582) +const { performance } = __nccwpck_require__(4074) +const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(43061) +const assert = __nccwpck_require__(39491) +const { isUint8Array } = __nccwpck_require__(29830) -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/codecs/json.js -var multiformats_src_codecs_json_namespaceObject = {}; -__nccwpck_require__.r(multiformats_src_codecs_json_namespaceObject); -__nccwpck_require__.d(multiformats_src_codecs_json_namespaceObject, { - "code": () => (src_codecs_json_code), - "decode": () => (src_codecs_json_decode), - "encode": () => (src_codecs_json_encode), - "name": () => (src_codecs_json_name) -}); +// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable +/** @type {import('crypto')|undefined} */ +let crypto -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/codecs/raw.js -var src_codecs_raw_namespaceObject = {}; -__nccwpck_require__.r(src_codecs_raw_namespaceObject); -__nccwpck_require__.d(src_codecs_raw_namespaceObject, { - "code": () => (src_codecs_raw_code), - "decode": () => (src_codecs_raw_decode), - "encode": () => (src_codecs_raw_encode), - "name": () => (src_codecs_raw_name) -}); +try { + crypto = __nccwpck_require__(6113) +} catch { -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/hashes/identity.js -var src_hashes_identity_namespaceObject = {}; -__nccwpck_require__.r(src_hashes_identity_namespaceObject); -__nccwpck_require__.d(src_hashes_identity_namespaceObject, { - "identity": () => (src_hashes_identity_identity) -}); +} -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/hashes/sha2.js -var src_hashes_sha2_namespaceObject = {}; -__nccwpck_require__.r(src_hashes_sha2_namespaceObject); -__nccwpck_require__.d(src_hashes_sha2_namespaceObject, { - "sha256": () => (src_hashes_sha2_sha256), - "sha512": () => (hashes_sha2_sha512) -}); +function responseURL (response) { + // https://fetch.spec.whatwg.org/#responses + // A response has an associated URL. It is a pointer to the last URL + // in response’s URL list and null if response’s URL list is empty. + const urlList = response.urlList + const length = urlList.length + return length === 0 ? null : urlList[length - 1].toString() +} -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base58.js -var ipfs_core_utils_node_modules_multiformats_src_bases_base58_namespaceObject = {}; -__nccwpck_require__.r(ipfs_core_utils_node_modules_multiformats_src_bases_base58_namespaceObject); -__nccwpck_require__.d(ipfs_core_utils_node_modules_multiformats_src_bases_base58_namespaceObject, { - "base58btc": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc), - "base58flickr": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58flickr) -}); +// https://fetch.spec.whatwg.org/#concept-response-location-url +function responseLocationURL (response, requestFragment) { + // 1. If response’s status is not a redirect status, then return null. + if (!redirectStatusSet.has(response.status)) { + return null + } -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base32.js -var ipfs_core_utils_node_modules_multiformats_src_bases_base32_namespaceObject = {}; -__nccwpck_require__.r(ipfs_core_utils_node_modules_multiformats_src_bases_base32_namespaceObject); -__nccwpck_require__.d(ipfs_core_utils_node_modules_multiformats_src_bases_base32_namespaceObject, { - "base32": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32), - "base32hex": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32hex), - "base32hexpad": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32hexpad), - "base32hexpadupper": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32hexpadupper), - "base32hexupper": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32hexupper), - "base32pad": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32pad), - "base32padupper": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32padupper), - "base32upper": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32upper), - "base32z": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32z) -}); + // 2. Let location be the result of extracting header list values given + // `Location` and response’s header list. + let location = response.headersList.get('location') -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/identity.js -var node_modules_multiformats_src_bases_identity_namespaceObject = {}; -__nccwpck_require__.r(node_modules_multiformats_src_bases_identity_namespaceObject); -__nccwpck_require__.d(node_modules_multiformats_src_bases_identity_namespaceObject, { - "identity": () => (node_modules_multiformats_src_bases_identity_identity) -}); + // 3. If location is a header value, then set location to the result of + // parsing location with response’s URL. + if (location !== null && isValidHeaderValue(location)) { + location = new URL(location, responseURL(response)) + } -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base2.js -var multiformats_src_bases_base2_namespaceObject = {}; -__nccwpck_require__.r(multiformats_src_bases_base2_namespaceObject); -__nccwpck_require__.d(multiformats_src_bases_base2_namespaceObject, { - "base2": () => (src_bases_base2_base2) -}); + // 4. If location is a URL whose fragment is null, then set location’s + // fragment to requestFragment. + if (location && !location.hash) { + location.hash = requestFragment + } -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base8.js -var multiformats_src_bases_base8_namespaceObject = {}; -__nccwpck_require__.r(multiformats_src_bases_base8_namespaceObject); -__nccwpck_require__.d(multiformats_src_bases_base8_namespaceObject, { - "base8": () => (src_bases_base8_base8) -}); + // 5. Return location. + return location +} -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base10.js -var multiformats_src_bases_base10_namespaceObject = {}; -__nccwpck_require__.r(multiformats_src_bases_base10_namespaceObject); -__nccwpck_require__.d(multiformats_src_bases_base10_namespaceObject, { - "base10": () => (src_bases_base10_base10) -}); +/** @returns {URL} */ +function requestCurrentURL (request) { + return request.urlList[request.urlList.length - 1] +} -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base16.js -var multiformats_src_bases_base16_namespaceObject = {}; -__nccwpck_require__.r(multiformats_src_bases_base16_namespaceObject); -__nccwpck_require__.d(multiformats_src_bases_base16_namespaceObject, { - "base16": () => (src_bases_base16_base16), - "base16upper": () => (src_bases_base16_base16upper) -}); +function requestBadPort (request) { + // 1. Let url be request’s current URL. + const url = requestCurrentURL(request) -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base36.js -var multiformats_src_bases_base36_namespaceObject = {}; -__nccwpck_require__.r(multiformats_src_bases_base36_namespaceObject); -__nccwpck_require__.d(multiformats_src_bases_base36_namespaceObject, { - "base36": () => (src_bases_base36_base36), - "base36upper": () => (src_bases_base36_base36upper) -}); + // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port, + // then return blocked. + if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) { + return 'blocked' + } -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base64.js -var node_modules_multiformats_src_bases_base64_namespaceObject = {}; -__nccwpck_require__.r(node_modules_multiformats_src_bases_base64_namespaceObject); -__nccwpck_require__.d(node_modules_multiformats_src_bases_base64_namespaceObject, { - "base64": () => (node_modules_multiformats_src_bases_base64_base64), - "base64pad": () => (node_modules_multiformats_src_bases_base64_base64pad), - "base64url": () => (node_modules_multiformats_src_bases_base64_base64url), - "base64urlpad": () => (node_modules_multiformats_src_bases_base64_base64urlpad) -}); + // 3. Return allowed. + return 'allowed' +} -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base256emoji.js -var multiformats_src_bases_base256emoji_namespaceObject = {}; -__nccwpck_require__.r(multiformats_src_bases_base256emoji_namespaceObject); -__nccwpck_require__.d(multiformats_src_bases_base256emoji_namespaceObject, { - "base256emoji": () => (src_bases_base256emoji_base256emoji) -}); +function isErrorLike (object) { + return object instanceof Error || ( + object?.constructor?.name === 'Error' || + object?.constructor?.name === 'DOMException' + ) +} -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/hashes/sha2.js -var multiformats_src_hashes_sha2_namespaceObject = {}; -__nccwpck_require__.r(multiformats_src_hashes_sha2_namespaceObject); -__nccwpck_require__.d(multiformats_src_hashes_sha2_namespaceObject, { - "sha256": () => (multiformats_src_hashes_sha2_sha256), - "sha512": () => (src_hashes_sha2_sha512) -}); +// Check whether |statusText| is a ByteString and +// matches the Reason-Phrase token production. +// RFC 2616: https://tools.ietf.org/html/rfc2616 +// RFC 7230: https://tools.ietf.org/html/rfc7230 +// "reason-phrase = *( HTAB / SP / VCHAR / obs-text )" +// https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116 +function isValidReasonPhrase (statusText) { + for (let i = 0; i < statusText.length; ++i) { + const c = statusText.charCodeAt(i) + if ( + !( + ( + c === 0x09 || // HTAB + (c >= 0x20 && c <= 0x7e) || // SP / VCHAR + (c >= 0x80 && c <= 0xff) + ) // obs-text + ) + ) { + return false + } + } + return true +} -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/hashes/identity.js -var multiformats_src_hashes_identity_namespaceObject = {}; -__nccwpck_require__.r(multiformats_src_hashes_identity_namespaceObject); -__nccwpck_require__.d(multiformats_src_hashes_identity_namespaceObject, { - "identity": () => (multiformats_src_hashes_identity_identity) -}); +/** + * @see https://tools.ietf.org/html/rfc7230#section-3.2.6 + * @param {number} c + */ +function isTokenCharCode (c) { + switch (c) { + case 0x22: + case 0x28: + case 0x29: + case 0x2c: + case 0x2f: + case 0x3a: + case 0x3b: + case 0x3c: + case 0x3d: + case 0x3e: + case 0x3f: + case 0x40: + case 0x5b: + case 0x5c: + case 0x5d: + case 0x7b: + case 0x7d: + // DQUOTE and "(),/:;<=>?@[\]{}" + return false + default: + // VCHAR %x21-7E + return c >= 0x21 && c <= 0x7e + } +} -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/codecs/raw.js -var multiformats_src_codecs_raw_namespaceObject = {}; -__nccwpck_require__.r(multiformats_src_codecs_raw_namespaceObject); -__nccwpck_require__.d(multiformats_src_codecs_raw_namespaceObject, { - "code": () => (multiformats_src_codecs_raw_code), - "decode": () => (multiformats_src_codecs_raw_decode), - "encode": () => (multiformats_src_codecs_raw_encode), - "name": () => (multiformats_src_codecs_raw_name) -}); +/** + * @param {string} characters + */ +function isValidHTTPToken (characters) { + if (characters.length === 0) { + return false + } + for (let i = 0; i < characters.length; ++i) { + if (!isTokenCharCode(characters.charCodeAt(i))) { + return false + } + } + return true +} -// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/codecs/json.js -var node_modules_multiformats_src_codecs_json_namespaceObject = {}; -__nccwpck_require__.r(node_modules_multiformats_src_codecs_json_namespaceObject); -__nccwpck_require__.d(node_modules_multiformats_src_codecs_json_namespaceObject, { - "code": () => (multiformats_src_codecs_json_code), - "decode": () => (multiformats_src_codecs_json_decode), - "encode": () => (multiformats_src_codecs_json_encode), - "name": () => (multiformats_src_codecs_json_name) -}); +/** + * @see https://fetch.spec.whatwg.org/#header-name + * @param {string} potentialValue + */ +function isValidHeaderName (potentialValue) { + return isValidHTTPToken(potentialValue) +} -// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base58.js -var peer_id_node_modules_multiformats_src_bases_base58_namespaceObject = {}; -__nccwpck_require__.r(peer_id_node_modules_multiformats_src_bases_base58_namespaceObject); -__nccwpck_require__.d(peer_id_node_modules_multiformats_src_bases_base58_namespaceObject, { - "base58btc": () => (peer_id_node_modules_multiformats_src_bases_base58_base58btc), - "base58flickr": () => (peer_id_node_modules_multiformats_src_bases_base58_base58flickr) -}); +/** + * @see https://fetch.spec.whatwg.org/#header-value + * @param {string} potentialValue + */ +function isValidHeaderValue (potentialValue) { + // - Has no leading or trailing HTTP tab or space bytes. + // - Contains no 0x00 (NUL) or HTTP newline bytes. + if ( + potentialValue.startsWith('\t') || + potentialValue.startsWith(' ') || + potentialValue.endsWith('\t') || + potentialValue.endsWith(' ') + ) { + return false + } -// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/identity.js -var peer_id_node_modules_multiformats_src_bases_identity_namespaceObject = {}; -__nccwpck_require__.r(peer_id_node_modules_multiformats_src_bases_identity_namespaceObject); -__nccwpck_require__.d(peer_id_node_modules_multiformats_src_bases_identity_namespaceObject, { - "identity": () => (peer_id_node_modules_multiformats_src_bases_identity_identity) -}); + if ( + potentialValue.includes('\0') || + potentialValue.includes('\r') || + potentialValue.includes('\n') + ) { + return false + } -// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base2.js -var node_modules_multiformats_src_bases_base2_namespaceObject = {}; -__nccwpck_require__.r(node_modules_multiformats_src_bases_base2_namespaceObject); -__nccwpck_require__.d(node_modules_multiformats_src_bases_base2_namespaceObject, { - "base2": () => (multiformats_src_bases_base2_base2) -}); + return true +} -// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base8.js -var node_modules_multiformats_src_bases_base8_namespaceObject = {}; -__nccwpck_require__.r(node_modules_multiformats_src_bases_base8_namespaceObject); -__nccwpck_require__.d(node_modules_multiformats_src_bases_base8_namespaceObject, { - "base8": () => (multiformats_src_bases_base8_base8) -}); +// https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect +function setRequestReferrerPolicyOnRedirect (request, actualResponse) { + // Given a request request and a response actualResponse, this algorithm + // updates request’s referrer policy according to the Referrer-Policy + // header (if any) in actualResponse. + + // 1. Let policy be the result of executing § 8.1 Parse a referrer policy + // from a Referrer-Policy header on actualResponse. + + // 8.1 Parse a referrer policy from a Referrer-Policy header + // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list. + const { headersList } = actualResponse + // 2. Let policy be the empty string. + // 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token. + // 4. Return policy. + const policyHeader = (headersList.get('referrer-policy') ?? '').split(',') -// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base10.js -var node_modules_multiformats_src_bases_base10_namespaceObject = {}; -__nccwpck_require__.r(node_modules_multiformats_src_bases_base10_namespaceObject); -__nccwpck_require__.d(node_modules_multiformats_src_bases_base10_namespaceObject, { - "base10": () => (multiformats_src_bases_base10_base10) -}); + // Note: As the referrer-policy can contain multiple policies + // separated by comma, we need to loop through all of them + // and pick the first valid one. + // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy + let policy = '' + if (policyHeader.length > 0) { + // The right-most policy takes precedence. + // The left-most policy is the fallback. + for (let i = policyHeader.length; i !== 0; i--) { + const token = policyHeader[i - 1].trim() + if (referrerPolicyTokens.has(token)) { + policy = token + break + } + } + } -// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base16.js -var node_modules_multiformats_src_bases_base16_namespaceObject = {}; -__nccwpck_require__.r(node_modules_multiformats_src_bases_base16_namespaceObject); -__nccwpck_require__.d(node_modules_multiformats_src_bases_base16_namespaceObject, { - "base16": () => (multiformats_src_bases_base16_base16), - "base16upper": () => (multiformats_src_bases_base16_base16upper) -}); + // 2. If policy is not the empty string, then set request’s referrer policy to policy. + if (policy !== '') { + request.referrerPolicy = policy + } +} -// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base32.js -var peer_id_node_modules_multiformats_src_bases_base32_namespaceObject = {}; -__nccwpck_require__.r(peer_id_node_modules_multiformats_src_bases_base32_namespaceObject); -__nccwpck_require__.d(peer_id_node_modules_multiformats_src_bases_base32_namespaceObject, { - "base32": () => (peer_id_node_modules_multiformats_src_bases_base32_base32), - "base32hex": () => (peer_id_node_modules_multiformats_src_bases_base32_base32hex), - "base32hexpad": () => (peer_id_node_modules_multiformats_src_bases_base32_base32hexpad), - "base32hexpadupper": () => (peer_id_node_modules_multiformats_src_bases_base32_base32hexpadupper), - "base32hexupper": () => (peer_id_node_modules_multiformats_src_bases_base32_base32hexupper), - "base32pad": () => (peer_id_node_modules_multiformats_src_bases_base32_base32pad), - "base32padupper": () => (peer_id_node_modules_multiformats_src_bases_base32_base32padupper), - "base32upper": () => (peer_id_node_modules_multiformats_src_bases_base32_base32upper), - "base32z": () => (peer_id_node_modules_multiformats_src_bases_base32_base32z) -}); +// https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check +function crossOriginResourcePolicyCheck () { + // TODO + return 'allowed' +} -// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base36.js -var node_modules_multiformats_src_bases_base36_namespaceObject = {}; -__nccwpck_require__.r(node_modules_multiformats_src_bases_base36_namespaceObject); -__nccwpck_require__.d(node_modules_multiformats_src_bases_base36_namespaceObject, { - "base36": () => (multiformats_src_bases_base36_base36), - "base36upper": () => (multiformats_src_bases_base36_base36upper) -}); +// https://fetch.spec.whatwg.org/#concept-cors-check +function corsCheck () { + // TODO + return 'success' +} -// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base64.js -var peer_id_node_modules_multiformats_src_bases_base64_namespaceObject = {}; -__nccwpck_require__.r(peer_id_node_modules_multiformats_src_bases_base64_namespaceObject); -__nccwpck_require__.d(peer_id_node_modules_multiformats_src_bases_base64_namespaceObject, { - "base64": () => (peer_id_node_modules_multiformats_src_bases_base64_base64), - "base64pad": () => (peer_id_node_modules_multiformats_src_bases_base64_base64pad), - "base64url": () => (peer_id_node_modules_multiformats_src_bases_base64_base64url), - "base64urlpad": () => (peer_id_node_modules_multiformats_src_bases_base64_base64urlpad) -}); +// https://fetch.spec.whatwg.org/#concept-tao-check +function TAOCheck () { + // TODO + return 'success' +} -// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base256emoji.js -var node_modules_multiformats_src_bases_base256emoji_namespaceObject = {}; -__nccwpck_require__.r(node_modules_multiformats_src_bases_base256emoji_namespaceObject); -__nccwpck_require__.d(node_modules_multiformats_src_bases_base256emoji_namespaceObject, { - "base256emoji": () => (multiformats_src_bases_base256emoji_base256emoji) -}); +function appendFetchMetadata (httpRequest) { + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header + // TODO -// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/hashes/sha2.js -var node_modules_multiformats_src_hashes_sha2_namespaceObject = {}; -__nccwpck_require__.r(node_modules_multiformats_src_hashes_sha2_namespaceObject); -__nccwpck_require__.d(node_modules_multiformats_src_hashes_sha2_namespaceObject, { - "sha256": () => (node_modules_multiformats_src_hashes_sha2_sha256), - "sha512": () => (multiformats_src_hashes_sha2_sha512) -}); + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header -// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/hashes/identity.js -var node_modules_multiformats_src_hashes_identity_namespaceObject = {}; -__nccwpck_require__.r(node_modules_multiformats_src_hashes_identity_namespaceObject); -__nccwpck_require__.d(node_modules_multiformats_src_hashes_identity_namespaceObject, { - "identity": () => (node_modules_multiformats_src_hashes_identity_identity) -}); + // 1. Assert: r’s url is a potentially trustworthy URL. + // TODO -// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/codecs/raw.js -var node_modules_multiformats_src_codecs_raw_namespaceObject = {}; -__nccwpck_require__.r(node_modules_multiformats_src_codecs_raw_namespaceObject); -__nccwpck_require__.d(node_modules_multiformats_src_codecs_raw_namespaceObject, { - "code": () => (node_modules_multiformats_src_codecs_raw_code), - "decode": () => (node_modules_multiformats_src_codecs_raw_decode), - "encode": () => (node_modules_multiformats_src_codecs_raw_encode), - "name": () => (node_modules_multiformats_src_codecs_raw_name) -}); + // 2. Let header be a Structured Header whose value is a token. + let header = null -// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/codecs/json.js -var peer_id_node_modules_multiformats_src_codecs_json_namespaceObject = {}; -__nccwpck_require__.r(peer_id_node_modules_multiformats_src_codecs_json_namespaceObject); -__nccwpck_require__.d(peer_id_node_modules_multiformats_src_codecs_json_namespaceObject, { - "code": () => (node_modules_multiformats_src_codecs_json_code), - "decode": () => (node_modules_multiformats_src_codecs_json_decode), - "encode": () => (node_modules_multiformats_src_codecs_json_encode), - "name": () => (node_modules_multiformats_src_codecs_json_name) -}); + // 3. Set header’s value to r’s mode. + header = httpRequest.mode -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base10.js -var uint8arrays_node_modules_multiformats_src_bases_base10_namespaceObject = {}; -__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_base10_namespaceObject); -__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_base10_namespaceObject, { - "base10": () => (node_modules_multiformats_src_bases_base10_base10) -}); + // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list. + httpRequest.headersList.set('sec-fetch-mode', header) -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base16.js -var uint8arrays_node_modules_multiformats_src_bases_base16_namespaceObject = {}; -__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_base16_namespaceObject); -__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_base16_namespaceObject, { - "base16": () => (node_modules_multiformats_src_bases_base16_base16), - "base16upper": () => (node_modules_multiformats_src_bases_base16_base16upper) -}); + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header + // TODO -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base2.js -var uint8arrays_node_modules_multiformats_src_bases_base2_namespaceObject = {}; -__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_base2_namespaceObject); -__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_base2_namespaceObject, { - "base2": () => (node_modules_multiformats_src_bases_base2_base2) -}); + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header + // TODO +} -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base256emoji.js -var uint8arrays_node_modules_multiformats_src_bases_base256emoji_namespaceObject = {}; -__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_base256emoji_namespaceObject); -__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_base256emoji_namespaceObject, { - "base256emoji": () => (node_modules_multiformats_src_bases_base256emoji_base256emoji) -}); +// https://fetch.spec.whatwg.org/#append-a-request-origin-header +function appendRequestOriginHeader (request) { + // 1. Let serializedOrigin be the result of byte-serializing a request origin with request. + let serializedOrigin = request.origin -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base32.js -var node_modules_uint8arrays_node_modules_multiformats_src_bases_base32_namespaceObject = {}; -__nccwpck_require__.r(node_modules_uint8arrays_node_modules_multiformats_src_bases_base32_namespaceObject); -__nccwpck_require__.d(node_modules_uint8arrays_node_modules_multiformats_src_bases_base32_namespaceObject, { - "base32": () => (node_modules_uint8arrays_node_modules_multiformats_src_bases_base32_base32), - "base32hex": () => (uint8arrays_node_modules_multiformats_src_bases_base32_base32hex), - "base32hexpad": () => (uint8arrays_node_modules_multiformats_src_bases_base32_base32hexpad), - "base32hexpadupper": () => (uint8arrays_node_modules_multiformats_src_bases_base32_base32hexpadupper), - "base32hexupper": () => (uint8arrays_node_modules_multiformats_src_bases_base32_base32hexupper), - "base32pad": () => (uint8arrays_node_modules_multiformats_src_bases_base32_base32pad), - "base32padupper": () => (uint8arrays_node_modules_multiformats_src_bases_base32_base32padupper), - "base32upper": () => (node_modules_uint8arrays_node_modules_multiformats_src_bases_base32_base32upper), - "base32z": () => (uint8arrays_node_modules_multiformats_src_bases_base32_base32z) -}); + // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list. + if (request.responseTainting === 'cors' || request.mode === 'websocket') { + if (serializedOrigin) { + request.headersList.append('origin', serializedOrigin) + } -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base36.js -var uint8arrays_node_modules_multiformats_src_bases_base36_namespaceObject = {}; -__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_base36_namespaceObject); -__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_base36_namespaceObject, { - "base36": () => (node_modules_multiformats_src_bases_base36_base36), - "base36upper": () => (node_modules_multiformats_src_bases_base36_base36upper) -}); + // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then: + } else if (request.method !== 'GET' && request.method !== 'HEAD') { + // 1. Switch on request’s referrer policy: + switch (request.referrerPolicy) { + case 'no-referrer': + // Set serializedOrigin to `null`. + serializedOrigin = null + break + case 'no-referrer-when-downgrade': + case 'strict-origin': + case 'strict-origin-when-cross-origin': + // If request’s origin is a tuple origin, its scheme is "https", and request’s current URL’s scheme is not "https", then set serializedOrigin to `null`. + if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) { + serializedOrigin = null + } + break + case 'same-origin': + // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`. + if (!sameOrigin(request, requestCurrentURL(request))) { + serializedOrigin = null + } + break + default: + // Do nothing. + } -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base58.js -var node_modules_uint8arrays_node_modules_multiformats_src_bases_base58_namespaceObject = {}; -__nccwpck_require__.r(node_modules_uint8arrays_node_modules_multiformats_src_bases_base58_namespaceObject); -__nccwpck_require__.d(node_modules_uint8arrays_node_modules_multiformats_src_bases_base58_namespaceObject, { - "base58btc": () => (node_modules_uint8arrays_node_modules_multiformats_src_bases_base58_base58btc), - "base58flickr": () => (uint8arrays_node_modules_multiformats_src_bases_base58_base58flickr) -}); + if (serializedOrigin) { + // 2. Append (`Origin`, serializedOrigin) to request’s header list. + request.headersList.append('origin', serializedOrigin) + } + } +} -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base64.js -var uint8arrays_node_modules_multiformats_src_bases_base64_namespaceObject = {}; -__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_base64_namespaceObject); -__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_base64_namespaceObject, { - "base64": () => (uint8arrays_node_modules_multiformats_src_bases_base64_base64), - "base64pad": () => (uint8arrays_node_modules_multiformats_src_bases_base64_base64pad), - "base64url": () => (uint8arrays_node_modules_multiformats_src_bases_base64_base64url), - "base64urlpad": () => (uint8arrays_node_modules_multiformats_src_bases_base64_base64urlpad) -}); +function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) { + // TODO + return performance.now() +} -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base8.js -var uint8arrays_node_modules_multiformats_src_bases_base8_namespaceObject = {}; -__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_base8_namespaceObject); -__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_base8_namespaceObject, { - "base8": () => (node_modules_multiformats_src_bases_base8_base8) -}); +// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info +function createOpaqueTimingInfo (timingInfo) { + return { + startTime: timingInfo.startTime ?? 0, + redirectStartTime: 0, + redirectEndTime: 0, + postRedirectStartTime: timingInfo.startTime ?? 0, + finalServiceWorkerStartTime: 0, + finalNetworkResponseStartTime: 0, + finalNetworkRequestStartTime: 0, + endTime: 0, + encodedBodySize: 0, + decodedBodySize: 0, + finalConnectionTimingInfo: null + } +} -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/identity.js -var uint8arrays_node_modules_multiformats_src_bases_identity_namespaceObject = {}; -__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_identity_namespaceObject); -__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_identity_namespaceObject, { - "identity": () => (uint8arrays_node_modules_multiformats_src_bases_identity_identity) -}); +// https://html.spec.whatwg.org/multipage/origin.html#policy-container +function makePolicyContainer () { + // Note: the fetch spec doesn't make use of embedder policy or CSP list + return { + referrerPolicy: 'strict-origin-when-cross-origin' + } +} -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/codecs/json.js -var uint8arrays_node_modules_multiformats_src_codecs_json_namespaceObject = {}; -__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_codecs_json_namespaceObject); -__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_codecs_json_namespaceObject, { - "code": () => (uint8arrays_node_modules_multiformats_src_codecs_json_code), - "decode": () => (uint8arrays_node_modules_multiformats_src_codecs_json_decode), - "encode": () => (uint8arrays_node_modules_multiformats_src_codecs_json_encode), - "name": () => (uint8arrays_node_modules_multiformats_src_codecs_json_name) -}); +// https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container +function clonePolicyContainer (policyContainer) { + return { + referrerPolicy: policyContainer.referrerPolicy + } +} -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/codecs/raw.js -var uint8arrays_node_modules_multiformats_src_codecs_raw_namespaceObject = {}; -__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_codecs_raw_namespaceObject); -__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_codecs_raw_namespaceObject, { - "code": () => (uint8arrays_node_modules_multiformats_src_codecs_raw_code), - "decode": () => (uint8arrays_node_modules_multiformats_src_codecs_raw_decode), - "encode": () => (uint8arrays_node_modules_multiformats_src_codecs_raw_encode), - "name": () => (uint8arrays_node_modules_multiformats_src_codecs_raw_name) -}); +// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer +function determineRequestsReferrer (request) { + // 1. Let policy be request's referrer policy. + const policy = request.referrerPolicy -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/hashes/identity.js -var uint8arrays_node_modules_multiformats_src_hashes_identity_namespaceObject = {}; -__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_hashes_identity_namespaceObject); -__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_hashes_identity_namespaceObject, { - "identity": () => (uint8arrays_node_modules_multiformats_src_hashes_identity_identity) -}); + // Note: policy cannot (shouldn't) be null or an empty string. + assert(policy) -// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/hashes/sha2.js -var uint8arrays_node_modules_multiformats_src_hashes_sha2_namespaceObject = {}; -__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_hashes_sha2_namespaceObject); -__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_hashes_sha2_namespaceObject, { - "sha256": () => (uint8arrays_node_modules_multiformats_src_hashes_sha2_sha256), - "sha512": () => (node_modules_multiformats_src_hashes_sha2_sha512) -}); + // 2. Let environment be request’s client. -// NAMESPACE OBJECT: ./node_modules/@filebase/sdk/node_modules/axios/lib/platform/common/utils.js -var common_utils_namespaceObject = {}; -__nccwpck_require__.r(common_utils_namespaceObject); -__nccwpck_require__.d(common_utils_namespaceObject, { - "hasBrowserEnv": () => (hasBrowserEnv), - "hasStandardBrowserEnv": () => (hasStandardBrowserEnv), - "hasStandardBrowserWebWorkerEnv": () => (hasStandardBrowserWebWorkerEnv) -}); + let referrerSource = null -// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base10.js -var protons_runtime_node_modules_multiformats_src_bases_base10_namespaceObject = {}; -__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_base10_namespaceObject); -__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_base10_namespaceObject, { - "base10": () => (protons_runtime_node_modules_multiformats_src_bases_base10_base10) -}); + // 3. Switch on request’s referrer: + if (request.referrer === 'client') { + // Note: node isn't a browser and doesn't implement document/iframes, + // so we bypass this step and replace it with our own. -// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base16.js -var protons_runtime_node_modules_multiformats_src_bases_base16_namespaceObject = {}; -__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_base16_namespaceObject); -__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_base16_namespaceObject, { - "base16": () => (protons_runtime_node_modules_multiformats_src_bases_base16_base16), - "base16upper": () => (protons_runtime_node_modules_multiformats_src_bases_base16_base16upper) -}); + const globalOrigin = getGlobalOrigin() -// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base2.js -var protons_runtime_node_modules_multiformats_src_bases_base2_namespaceObject = {}; -__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_base2_namespaceObject); -__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_base2_namespaceObject, { - "base2": () => (protons_runtime_node_modules_multiformats_src_bases_base2_base2) -}); + if (!globalOrigin || globalOrigin.origin === 'null') { + return 'no-referrer' + } -// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base256emoji.js -var protons_runtime_node_modules_multiformats_src_bases_base256emoji_namespaceObject = {}; -__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_base256emoji_namespaceObject); -__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_base256emoji_namespaceObject, { - "base256emoji": () => (protons_runtime_node_modules_multiformats_src_bases_base256emoji_base256emoji) -}); + // note: we need to clone it as it's mutated + referrerSource = new URL(globalOrigin) + } else if (request.referrer instanceof URL) { + // Let referrerSource be request’s referrer. + referrerSource = request.referrer + } -// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base32.js -var protons_runtime_node_modules_multiformats_src_bases_base32_namespaceObject = {}; -__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_base32_namespaceObject); -__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_base32_namespaceObject, { - "base32": () => (protons_runtime_node_modules_multiformats_src_bases_base32_base32), - "base32hex": () => (protons_runtime_node_modules_multiformats_src_bases_base32_base32hex), - "base32hexpad": () => (protons_runtime_node_modules_multiformats_src_bases_base32_base32hexpad), - "base32hexpadupper": () => (protons_runtime_node_modules_multiformats_src_bases_base32_base32hexpadupper), - "base32hexupper": () => (protons_runtime_node_modules_multiformats_src_bases_base32_base32hexupper), - "base32pad": () => (protons_runtime_node_modules_multiformats_src_bases_base32_base32pad), - "base32padupper": () => (protons_runtime_node_modules_multiformats_src_bases_base32_base32padupper), - "base32upper": () => (protons_runtime_node_modules_multiformats_src_bases_base32_base32upper), - "base32z": () => (protons_runtime_node_modules_multiformats_src_bases_base32_base32z) -}); + // 4. Let request’s referrerURL be the result of stripping referrerSource for + // use as a referrer. + let referrerURL = stripURLForReferrer(referrerSource) -// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base36.js -var protons_runtime_node_modules_multiformats_src_bases_base36_namespaceObject = {}; -__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_base36_namespaceObject); -__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_base36_namespaceObject, { - "base36": () => (protons_runtime_node_modules_multiformats_src_bases_base36_base36), - "base36upper": () => (protons_runtime_node_modules_multiformats_src_bases_base36_base36upper) -}); + // 5. Let referrerOrigin be the result of stripping referrerSource for use as + // a referrer, with the origin-only flag set to true. + const referrerOrigin = stripURLForReferrer(referrerSource, true) -// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base58.js -var protons_runtime_node_modules_multiformats_src_bases_base58_namespaceObject = {}; -__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_base58_namespaceObject); -__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_base58_namespaceObject, { - "base58btc": () => (protons_runtime_node_modules_multiformats_src_bases_base58_base58btc), - "base58flickr": () => (protons_runtime_node_modules_multiformats_src_bases_base58_base58flickr) -}); + // 6. If the result of serializing referrerURL is a string whose length is + // greater than 4096, set referrerURL to referrerOrigin. + if (referrerURL.toString().length > 4096) { + referrerURL = referrerOrigin + } -// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base64.js -var protons_runtime_node_modules_multiformats_src_bases_base64_namespaceObject = {}; -__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_base64_namespaceObject); -__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_base64_namespaceObject, { - "base64": () => (protons_runtime_node_modules_multiformats_src_bases_base64_base64), - "base64pad": () => (protons_runtime_node_modules_multiformats_src_bases_base64_base64pad), - "base64url": () => (protons_runtime_node_modules_multiformats_src_bases_base64_base64url), - "base64urlpad": () => (protons_runtime_node_modules_multiformats_src_bases_base64_base64urlpad) -}); + const areSameOrigin = sameOrigin(request, referrerURL) + const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) && + !isURLPotentiallyTrustworthy(request.url) -// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base8.js -var protons_runtime_node_modules_multiformats_src_bases_base8_namespaceObject = {}; -__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_base8_namespaceObject); -__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_base8_namespaceObject, { - "base8": () => (protons_runtime_node_modules_multiformats_src_bases_base8_base8) -}); + // 8. Execute the switch statements corresponding to the value of policy: + switch (policy) { + case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true) + case 'unsafe-url': return referrerURL + case 'same-origin': + return areSameOrigin ? referrerOrigin : 'no-referrer' + case 'origin-when-cross-origin': + return areSameOrigin ? referrerURL : referrerOrigin + case 'strict-origin-when-cross-origin': { + const currentURL = requestCurrentURL(request) -// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/identity.js -var protons_runtime_node_modules_multiformats_src_bases_identity_namespaceObject = {}; -__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_identity_namespaceObject); -__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_identity_namespaceObject, { - "identity": () => (protons_runtime_node_modules_multiformats_src_bases_identity_identity) -}); + // 1. If the origin of referrerURL and the origin of request’s current + // URL are the same, then return referrerURL. + if (sameOrigin(referrerURL, currentURL)) { + return referrerURL + } -// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/codecs/json.js -var protons_runtime_node_modules_multiformats_src_codecs_json_namespaceObject = {}; -__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_codecs_json_namespaceObject); -__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_codecs_json_namespaceObject, { - "code": () => (protons_runtime_node_modules_multiformats_src_codecs_json_code), - "decode": () => (protons_runtime_node_modules_multiformats_src_codecs_json_decode), - "encode": () => (protons_runtime_node_modules_multiformats_src_codecs_json_encode), - "name": () => (protons_runtime_node_modules_multiformats_src_codecs_json_name) -}); + // 2. If referrerURL is a potentially trustworthy URL and request’s + // current URL is not a potentially trustworthy URL, then return no + // referrer. + if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) { + return 'no-referrer' + } -// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/codecs/raw.js -var protons_runtime_node_modules_multiformats_src_codecs_raw_namespaceObject = {}; -__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_codecs_raw_namespaceObject); -__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_codecs_raw_namespaceObject, { - "code": () => (protons_runtime_node_modules_multiformats_src_codecs_raw_code), - "decode": () => (protons_runtime_node_modules_multiformats_src_codecs_raw_decode), - "encode": () => (protons_runtime_node_modules_multiformats_src_codecs_raw_encode), - "name": () => (protons_runtime_node_modules_multiformats_src_codecs_raw_name) -}); + // 3. Return referrerOrigin. + return referrerOrigin + } + case 'strict-origin': // eslint-disable-line + /** + * 1. If referrerURL is a potentially trustworthy URL and + * request’s current URL is not a potentially trustworthy URL, + * then return no referrer. + * 2. Return referrerOrigin + */ + case 'no-referrer-when-downgrade': // eslint-disable-line + /** + * 1. If referrerURL is a potentially trustworthy URL and + * request’s current URL is not a potentially trustworthy URL, + * then return no referrer. + * 2. Return referrerOrigin + */ -// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/hashes/identity.js -var protons_runtime_node_modules_multiformats_src_hashes_identity_namespaceObject = {}; -__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_hashes_identity_namespaceObject); -__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_hashes_identity_namespaceObject, { - "identity": () => (protons_runtime_node_modules_multiformats_src_hashes_identity_identity) -}); + default: // eslint-disable-line + return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin + } +} -// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/hashes/sha2.js -var protons_runtime_node_modules_multiformats_src_hashes_sha2_namespaceObject = {}; -__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_hashes_sha2_namespaceObject); -__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_hashes_sha2_namespaceObject, { - "sha256": () => (protons_runtime_node_modules_multiformats_src_hashes_sha2_sha256), - "sha512": () => (protons_runtime_node_modules_multiformats_src_hashes_sha2_sha512) -}); +/** + * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url + * @param {URL} url + * @param {boolean|undefined} originOnly + */ +function stripURLForReferrer (url, originOnly) { + // 1. Assert: url is a URL. + assert(url instanceof URL) -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/codecs/raw.js -var dist_src_codecs_raw_namespaceObject = {}; -__nccwpck_require__.r(dist_src_codecs_raw_namespaceObject); -__nccwpck_require__.d(dist_src_codecs_raw_namespaceObject, { - "code": () => (dist_src_codecs_raw_code), - "decode": () => (dist_src_codecs_raw_decode), - "encode": () => (dist_src_codecs_raw_encode), - "name": () => (dist_src_codecs_raw_name) -}); + // 2. If url’s scheme is a local scheme, then return no referrer. + if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') { + return 'no-referrer' + } -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base32.js -var multiformats_dist_src_bases_base32_namespaceObject = {}; -__nccwpck_require__.r(multiformats_dist_src_bases_base32_namespaceObject); -__nccwpck_require__.d(multiformats_dist_src_bases_base32_namespaceObject, { - "base32": () => (multiformats_dist_src_bases_base32_base32), - "base32hex": () => (multiformats_dist_src_bases_base32_base32hex), - "base32hexpad": () => (multiformats_dist_src_bases_base32_base32hexpad), - "base32hexpadupper": () => (multiformats_dist_src_bases_base32_base32hexpadupper), - "base32hexupper": () => (multiformats_dist_src_bases_base32_base32hexupper), - "base32pad": () => (multiformats_dist_src_bases_base32_base32pad), - "base32padupper": () => (multiformats_dist_src_bases_base32_base32padupper), - "base32upper": () => (multiformats_dist_src_bases_base32_base32upper), - "base32z": () => (multiformats_dist_src_bases_base32_base32z) -}); + // 3. Set url’s username to the empty string. + url.username = '' -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base58.js -var multiformats_dist_src_bases_base58_namespaceObject = {}; -__nccwpck_require__.r(multiformats_dist_src_bases_base58_namespaceObject); -__nccwpck_require__.d(multiformats_dist_src_bases_base58_namespaceObject, { - "base58btc": () => (multiformats_dist_src_bases_base58_base58btc), - "base58flickr": () => (multiformats_dist_src_bases_base58_base58flickr) -}); + // 4. Set url’s password to the empty string. + url.password = '' -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/hashes/sha2.js -var dist_src_hashes_sha2_namespaceObject = {}; -__nccwpck_require__.r(dist_src_hashes_sha2_namespaceObject); -__nccwpck_require__.d(dist_src_hashes_sha2_namespaceObject, { - "sha256": () => (dist_src_hashes_sha2_sha256), - "sha512": () => (dist_src_hashes_sha2_sha512) -}); + // 5. Set url’s fragment to null. + url.hash = '' -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base10.js -var dist_src_bases_base10_namespaceObject = {}; -__nccwpck_require__.r(dist_src_bases_base10_namespaceObject); -__nccwpck_require__.d(dist_src_bases_base10_namespaceObject, { - "base10": () => (dist_src_bases_base10_base10) -}); + // 6. If the origin-only flag is true, then: + if (originOnly) { + // 1. Set url’s path to « the empty string ». + url.pathname = '' -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base16.js -var dist_src_bases_base16_namespaceObject = {}; -__nccwpck_require__.r(dist_src_bases_base16_namespaceObject); -__nccwpck_require__.d(dist_src_bases_base16_namespaceObject, { - "base16": () => (dist_src_bases_base16_base16), - "base16upper": () => (dist_src_bases_base16_base16upper) -}); + // 2. Set url’s query to null. + url.search = '' + } -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base2.js -var dist_src_bases_base2_namespaceObject = {}; -__nccwpck_require__.r(dist_src_bases_base2_namespaceObject); -__nccwpck_require__.d(dist_src_bases_base2_namespaceObject, { - "base2": () => (dist_src_bases_base2_base2) -}); + // 7. Return url. + return url +} -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base256emoji.js -var dist_src_bases_base256emoji_namespaceObject = {}; -__nccwpck_require__.r(dist_src_bases_base256emoji_namespaceObject); -__nccwpck_require__.d(dist_src_bases_base256emoji_namespaceObject, { - "base256emoji": () => (dist_src_bases_base256emoji_base256emoji) -}); +function isURLPotentiallyTrustworthy (url) { + if (!(url instanceof URL)) { + return false + } -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base36.js -var dist_src_bases_base36_namespaceObject = {}; -__nccwpck_require__.r(dist_src_bases_base36_namespaceObject); -__nccwpck_require__.d(dist_src_bases_base36_namespaceObject, { - "base36": () => (dist_src_bases_base36_base36), - "base36upper": () => (dist_src_bases_base36_base36upper) -}); + // If child of about, return true + if (url.href === 'about:blank' || url.href === 'about:srcdoc') { + return true + } -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base64.js -var multiformats_dist_src_bases_base64_namespaceObject = {}; -__nccwpck_require__.r(multiformats_dist_src_bases_base64_namespaceObject); -__nccwpck_require__.d(multiformats_dist_src_bases_base64_namespaceObject, { - "base64": () => (dist_src_bases_base64_base64), - "base64pad": () => (dist_src_bases_base64_base64pad), - "base64url": () => (dist_src_bases_base64_base64url), - "base64urlpad": () => (dist_src_bases_base64_base64urlpad) -}); + // If scheme is data, return true + if (url.protocol === 'data:') return true -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base8.js -var dist_src_bases_base8_namespaceObject = {}; -__nccwpck_require__.r(dist_src_bases_base8_namespaceObject); -__nccwpck_require__.d(dist_src_bases_base8_namespaceObject, { - "base8": () => (dist_src_bases_base8_base8) -}); + // If file, return true + if (url.protocol === 'file:') return true -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/identity.js -var dist_src_bases_identity_namespaceObject = {}; -__nccwpck_require__.r(dist_src_bases_identity_namespaceObject); -__nccwpck_require__.d(dist_src_bases_identity_namespaceObject, { - "identity": () => (dist_src_bases_identity_identity) -}); + return isOriginPotentiallyTrustworthy(url.origin) -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/codecs/json.js -var dist_src_codecs_json_namespaceObject = {}; -__nccwpck_require__.r(dist_src_codecs_json_namespaceObject); -__nccwpck_require__.d(dist_src_codecs_json_namespaceObject, { - "code": () => (dist_src_codecs_json_code), - "decode": () => (dist_src_codecs_json_decode), - "encode": () => (dist_src_codecs_json_encode), - "name": () => (dist_src_codecs_json_name) -}); + function isOriginPotentiallyTrustworthy (origin) { + // If origin is explicitly null, return false + if (origin == null || origin === 'null') return false -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/hashes/identity.js -var dist_src_hashes_identity_namespaceObject = {}; -__nccwpck_require__.r(dist_src_hashes_identity_namespaceObject); -__nccwpck_require__.d(dist_src_hashes_identity_namespaceObject, { - "identity": () => (dist_src_hashes_identity_identity) -}); + const originAsURL = new URL(origin) -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base32.js -var unixfs_node_modules_multiformats_src_bases_base32_namespaceObject = {}; -__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_base32_namespaceObject); -__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_base32_namespaceObject, { - "base32": () => (unixfs_node_modules_multiformats_src_bases_base32_base32), - "base32hex": () => (unixfs_node_modules_multiformats_src_bases_base32_base32hex), - "base32hexpad": () => (unixfs_node_modules_multiformats_src_bases_base32_base32hexpad), - "base32hexpadupper": () => (unixfs_node_modules_multiformats_src_bases_base32_base32hexpadupper), - "base32hexupper": () => (unixfs_node_modules_multiformats_src_bases_base32_base32hexupper), - "base32pad": () => (unixfs_node_modules_multiformats_src_bases_base32_base32pad), - "base32padupper": () => (unixfs_node_modules_multiformats_src_bases_base32_base32padupper), - "base32upper": () => (unixfs_node_modules_multiformats_src_bases_base32_base32upper), - "base32z": () => (unixfs_node_modules_multiformats_src_bases_base32_base32z) -}); + // If secure, return true + if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') { + return true + } -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base58.js -var unixfs_node_modules_multiformats_src_bases_base58_namespaceObject = {}; -__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_base58_namespaceObject); -__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_base58_namespaceObject, { - "base58btc": () => (unixfs_node_modules_multiformats_src_bases_base58_base58btc), - "base58flickr": () => (unixfs_node_modules_multiformats_src_bases_base58_base58flickr) -}); + // If localhost or variants, return true + if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) || + (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) || + (originAsURL.hostname.endsWith('.localhost'))) { + return true + } -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base10.js -var unixfs_node_modules_multiformats_src_bases_base10_namespaceObject = {}; -__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_base10_namespaceObject); -__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_base10_namespaceObject, { - "base10": () => (unixfs_node_modules_multiformats_src_bases_base10_base10) -}); + // If any other, return false + return false + } +} -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base16.js -var unixfs_node_modules_multiformats_src_bases_base16_namespaceObject = {}; -__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_base16_namespaceObject); -__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_base16_namespaceObject, { - "base16": () => (unixfs_node_modules_multiformats_src_bases_base16_base16), - "base16upper": () => (unixfs_node_modules_multiformats_src_bases_base16_base16upper) -}); +/** + * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist + * @param {Uint8Array} bytes + * @param {string} metadataList + */ +function bytesMatch (bytes, metadataList) { + // If node is not built with OpenSSL support, we cannot check + // a request's integrity, so allow it by default (the spec will + // allow requests if an invalid hash is given, as precedence). + /* istanbul ignore if: only if node is built with --without-ssl */ + if (crypto === undefined) { + return true + } -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base2.js -var unixfs_node_modules_multiformats_src_bases_base2_namespaceObject = {}; -__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_base2_namespaceObject); -__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_base2_namespaceObject, { - "base2": () => (unixfs_node_modules_multiformats_src_bases_base2_base2) -}); + // 1. Let parsedMetadata be the result of parsing metadataList. + const parsedMetadata = parseMetadata(metadataList) -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base256emoji.js -var unixfs_node_modules_multiformats_src_bases_base256emoji_namespaceObject = {}; -__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_base256emoji_namespaceObject); -__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_base256emoji_namespaceObject, { - "base256emoji": () => (unixfs_node_modules_multiformats_src_bases_base256emoji_base256emoji) -}); + // 2. If parsedMetadata is no metadata, return true. + if (parsedMetadata === 'no metadata') { + return true + } -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base36.js -var unixfs_node_modules_multiformats_src_bases_base36_namespaceObject = {}; -__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_base36_namespaceObject); -__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_base36_namespaceObject, { - "base36": () => (unixfs_node_modules_multiformats_src_bases_base36_base36), - "base36upper": () => (unixfs_node_modules_multiformats_src_bases_base36_base36upper) -}); + // 3. If parsedMetadata is the empty set, return true. + if (parsedMetadata.length === 0) { + return true + } -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base64.js -var unixfs_node_modules_multiformats_src_bases_base64_namespaceObject = {}; -__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_base64_namespaceObject); -__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_base64_namespaceObject, { - "base64": () => (unixfs_node_modules_multiformats_src_bases_base64_base64), - "base64pad": () => (unixfs_node_modules_multiformats_src_bases_base64_base64pad), - "base64url": () => (unixfs_node_modules_multiformats_src_bases_base64_base64url), - "base64urlpad": () => (unixfs_node_modules_multiformats_src_bases_base64_base64urlpad) -}); + // 4. Let metadata be the result of getting the strongest + // metadata from parsedMetadata. + const list = parsedMetadata.sort((c, d) => d.algo.localeCompare(c.algo)) + // get the strongest algorithm + const strongest = list[0].algo + // get all entries that use the strongest algorithm; ignore weaker + const metadata = list.filter((item) => item.algo === strongest) -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base8.js -var unixfs_node_modules_multiformats_src_bases_base8_namespaceObject = {}; -__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_base8_namespaceObject); -__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_base8_namespaceObject, { - "base8": () => (unixfs_node_modules_multiformats_src_bases_base8_base8) -}); + // 5. For each item in metadata: + for (const item of metadata) { + // 1. Let algorithm be the alg component of item. + const algorithm = item.algo -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/identity.js -var unixfs_node_modules_multiformats_src_bases_identity_namespaceObject = {}; -__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_identity_namespaceObject); -__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_identity_namespaceObject, { - "identity": () => (unixfs_node_modules_multiformats_src_bases_identity_identity) -}); + // 2. Let expectedValue be the val component of item. + let expectedValue = item.hash -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/codecs/json.js -var unixfs_node_modules_multiformats_src_codecs_json_namespaceObject = {}; -__nccwpck_require__.r(unixfs_node_modules_multiformats_src_codecs_json_namespaceObject); -__nccwpck_require__.d(unixfs_node_modules_multiformats_src_codecs_json_namespaceObject, { - "code": () => (unixfs_node_modules_multiformats_src_codecs_json_code), - "decode": () => (unixfs_node_modules_multiformats_src_codecs_json_decode), - "encode": () => (unixfs_node_modules_multiformats_src_codecs_json_encode), - "name": () => (unixfs_node_modules_multiformats_src_codecs_json_name) -}); + // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e + // "be liberal with padding". This is annoying, and it's not even in the spec. -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/codecs/raw.js -var unixfs_node_modules_multiformats_src_codecs_raw_namespaceObject = {}; -__nccwpck_require__.r(unixfs_node_modules_multiformats_src_codecs_raw_namespaceObject); -__nccwpck_require__.d(unixfs_node_modules_multiformats_src_codecs_raw_namespaceObject, { - "code": () => (unixfs_node_modules_multiformats_src_codecs_raw_code), - "decode": () => (unixfs_node_modules_multiformats_src_codecs_raw_decode), - "encode": () => (unixfs_node_modules_multiformats_src_codecs_raw_encode), - "name": () => (unixfs_node_modules_multiformats_src_codecs_raw_name) -}); + if (expectedValue.endsWith('==')) { + expectedValue = expectedValue.slice(0, -2) + } -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/hashes/identity.js -var unixfs_node_modules_multiformats_src_hashes_identity_namespaceObject = {}; -__nccwpck_require__.r(unixfs_node_modules_multiformats_src_hashes_identity_namespaceObject); -__nccwpck_require__.d(unixfs_node_modules_multiformats_src_hashes_identity_namespaceObject, { - "identity": () => (unixfs_node_modules_multiformats_src_hashes_identity_identity) -}); + // 3. Let actualValue be the result of applying algorithm to bytes. + let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64') -// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/hashes/sha2.js -var unixfs_node_modules_multiformats_src_hashes_sha2_namespaceObject = {}; -__nccwpck_require__.r(unixfs_node_modules_multiformats_src_hashes_sha2_namespaceObject); -__nccwpck_require__.d(unixfs_node_modules_multiformats_src_hashes_sha2_namespaceObject, { - "sha256": () => (unixfs_node_modules_multiformats_src_hashes_sha2_sha256), - "sha512": () => (unixfs_node_modules_multiformats_src_hashes_sha2_sha512) -}); + if (actualValue.endsWith('==')) { + actualValue = actualValue.slice(0, -2) + } -// NAMESPACE OBJECT: ./node_modules/blockstore-fs/node_modules/blockstore-core/dist/src/errors.js -var blockstore_core_dist_src_errors_namespaceObject = {}; -__nccwpck_require__.r(blockstore_core_dist_src_errors_namespaceObject); -__nccwpck_require__.d(blockstore_core_dist_src_errors_namespaceObject, { - "abortedError": () => (abortedError), - "closeFailedError": () => (closeFailedError), - "deleteFailedError": () => (deleteFailedError), - "getFailedError": () => (getFailedError), - "hasFailedError": () => (hasFailedError), - "notFoundError": () => (notFoundError), - "openFailedError": () => (openFailedError), - "putFailedError": () => (putFailedError) -}); + // 4. If actualValue is a case-sensitive match for expectedValue, + // return true. + if (actualValue === expectedValue) { + return true + } -// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js -var core = __nccwpck_require__(47514); -// EXTERNAL MODULE: ./node_modules/@actions/github/lib/github.js -var github = __nccwpck_require__(29592); -;// CONCATENATED MODULE: ./pinners/maker.js -/* harmony default export */ const maker = (({ builder, upload }) => - async (options) => { - const api = await builder(options); + let actualBase64URL = crypto.createHash(algorithm).update(bytes).digest('base64url') -======= - upload: async (api, options) => { - const { path, pattern, pin } = options; - const { cid } = await last( - api.addAll(globSource(fsPath.dirname(path), pattern), { pin }) - ); + if (actualBase64URL.endsWith('==')) { + actualBase64URL = actualBase64URL.slice(0, -2) + } - if (!cid) throw new Error("Content hash is not found."); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - return { - upload: async (options) => { - const { path } = options; - if (!path) { - throw new Error("Path is empty"); - } + if (actualBase64URL === expectedValue) { + return true + } + } - return upload(api, options); - }, - }; - }); + // 6. Return false. + return false +} -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/multibases.js -/** - * @typedef {import('multiformats/bases/interface').MultibaseCodec} MultibaseCodec - * @typedef {import('./types').LoadBaseFn} LoadBaseFn - * @typedef {import('ipfs-core-types/src/utils').AbortOptions} AbortOptions - */ +// https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options +// https://www.w3.org/TR/CSP2/#source-list-syntax +// https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1 +const parseHashWithOptions = /((?sha256|sha384|sha512)-(?[A-z0-9+/]{1}.*={0,2}))( +[\x21-\x7e]?)?/i /** - * @type {LoadBaseFn} + * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata + * @param {string} metadata */ -const LOAD_BASE = (name) => Promise.reject(new Error(`No base found for "${name}"`)) +function parseMetadata (metadata) { + // 1. Let result be the empty set. + /** @type {{ algo: string, hash: string }[]} */ + const result = [] -class Multibases { - /** - * @param {object} options - * @param {LoadBaseFn} [options.loadBase] - * @param {MultibaseCodec[]} options.bases - */ - constructor (options) { - // Object with current list of active resolvers - /** @type {Record}} */ - this._basesByName = {} + // 2. Let empty be equal to true. + let empty = true - // Object with current list of active resolvers - /** @type {Record}} */ - this._basesByPrefix = {} + const supportedHashes = crypto.getHashes() - this._loadBase = options.loadBase || LOAD_BASE + // 3. For each token returned by splitting metadata on spaces: + for (const token of metadata.split(' ')) { + // 1. Set empty to false. + empty = false - // Enable all supplied codecs - for (const base of options.bases) { - this.addBase(base) + // 2. Parse token as a hash-with-options. + const parsedToken = parseHashWithOptions.exec(token) + + // 3. If token does not parse, continue to the next token. + if (parsedToken === null || parsedToken.groups === undefined) { + // Note: Chromium blocks the request at this point, but Firefox + // gives a warning that an invalid integrity was given. The + // correct behavior is to ignore these, and subsequently not + // check the integrity of the resource. + continue } - } - /** - * Add support for a multibase codec - * - * @param {MultibaseCodec} base - */ - addBase (base) { - if (this._basesByName[base.name] || this._basesByPrefix[base.prefix]) { - throw new Error(`Codec already exists for codec "${base.name}"`) + // 4. Let algorithm be the hash-algo component of token. + const algorithm = parsedToken.groups.algo + + // 5. If algorithm is a hash function recognized by the user + // agent, add the parsed token to result. + if (supportedHashes.includes(algorithm.toLowerCase())) { + result.push(parsedToken.groups) } + } - this._basesByName[base.name] = base - this._basesByPrefix[base.prefix] = base + // 4. Return no metadata if empty is true, otherwise return result. + if (empty === true) { + return 'no metadata' } - /** - * Remove support for a multibase codec - * - * @param {MultibaseCodec} base - */ - removeBase (base) { - delete this._basesByName[base.name] - delete this._basesByPrefix[base.prefix] + return result +} + +// https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request +function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) { + // TODO +} + +/** + * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin} + * @param {URL} A + * @param {URL} B + */ +function sameOrigin (A, B) { + // 1. If A and B are the same opaque origin, then return true. + if (A.origin === B.origin && A.origin === 'null') { + return true } - /** - * @param {string} nameOrPrefix - */ - async getBase (nameOrPrefix) { - if (this._basesByName[nameOrPrefix]) { - return this._basesByName[nameOrPrefix] - } + // 2. If A and B are both tuple origins and their schemes, + // hosts, and port are identical, then return true. + if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) { + return true + } - if (this._basesByPrefix[nameOrPrefix]) { - return this._basesByPrefix[nameOrPrefix] - } + // 3. Return false. + return false +} - // If not supported, attempt to dynamically load this codec - const base = await this._loadBase(nameOrPrefix) +function createDeferredPromise () { + let res + let rej + const promise = new Promise((resolve, reject) => { + res = resolve + rej = reject + }) + + return { promise, resolve: res, reject: rej } +} + +function isAborted (fetchParams) { + return fetchParams.controller.state === 'aborted' +} + +function isCancelled (fetchParams) { + return fetchParams.controller.state === 'aborted' || + fetchParams.controller.state === 'terminated' +} + +const normalizeMethodRecord = { + delete: 'DELETE', + DELETE: 'DELETE', + get: 'GET', + GET: 'GET', + head: 'HEAD', + HEAD: 'HEAD', + options: 'OPTIONS', + OPTIONS: 'OPTIONS', + post: 'POST', + POST: 'POST', + put: 'PUT', + PUT: 'PUT' +} + +// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`. +Object.setPrototypeOf(normalizeMethodRecord, null) + +/** + * @see https://fetch.spec.whatwg.org/#concept-method-normalize + * @param {string} method + */ +function normalizeMethod (method) { + return normalizeMethodRecord[method.toLowerCase()] ?? method +} - if (this._basesByName[base.name] == null && this._basesByPrefix[base.prefix] == null) { - this.addBase(base) - } +// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string +function serializeJavascriptValueToJSONString (value) { + // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »). + const result = JSON.stringify(value) - return base + // 2. If result is undefined, then throw a TypeError. + if (result === undefined) { + throw new TypeError('Value is not JSON serializable') } - listBases () { - return Object.values(this._basesByName) - } + // 3. Assert: result is a string. + assert(typeof result === 'string') + + // 4. Return result. + return result } -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/multicodecs.js -/** - * @typedef {import('multiformats/codecs/interface').BlockCodec} BlockCodec - * @typedef {import('./types').LoadCodecFn} LoadCodecFn - * @typedef {import('ipfs-core-types/src/utils').AbortOptions} AbortOptions - */ +// https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object +const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())) /** - * @type {LoadCodecFn} + * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object + * @param {() => unknown[]} iterator + * @param {string} name name of the instance + * @param {'key'|'value'|'key+value'} kind */ -const LOAD_CODEC = (codeOrName) => Promise.reject(new Error(`No codec found for "${codeOrName}"`)) - -class Multicodecs { - /** - * @param {object} options - * @param {LoadCodecFn} [options.loadCodec] - * @param {BlockCodec[]} options.codecs - */ - constructor (options) { - // Object with current list of active resolvers - /** @type {Record}} */ - this._codecsByName = {} +function makeIterator (iterator, name, kind) { + const object = { + index: 0, + kind, + target: iterator + } - // Object with current list of active resolvers - /** @type {Record}} */ - this._codecsByCode = {} + const i = { + next () { + // 1. Let interface be the interface for which the iterator prototype object exists. - this._loadCodec = options.loadCodec || LOAD_CODEC + // 2. Let thisValue be the this value. - // Enable all supplied codecs - for (const codec of options.codecs) { - this.addCodec(codec) - } - } + // 3. Let object be ? ToObject(thisValue). - /** - * Add support for a block codec - * - * @param {BlockCodec} codec - */ - addCodec (codec) { - if (this._codecsByName[codec.name] || this._codecsByCode[codec.code]) { - throw new Error(`Resolver already exists for codec "${codec.name}"`) - } + // 4. If object is a platform object, then perform a security + // check, passing: - this._codecsByName[codec.name] = codec - this._codecsByCode[codec.code] = codec - } + // 5. If object is not a default iterator object for interface, + // then throw a TypeError. + if (Object.getPrototypeOf(this) !== i) { + throw new TypeError( + `'next' called on an object that does not implement interface ${name} Iterator.` + ) + } - /** - * Remove support for a block codec - * - * @param {BlockCodec} codec - */ - removeCodec (codec) { - delete this._codecsByName[codec.name] - delete this._codecsByCode[codec.code] - } + // 6. Let index be object’s index. + // 7. Let kind be object’s kind. + // 8. Let values be object’s target's value pairs to iterate over. + const { index, kind, target } = object + const values = target() - /** - * @param {number | string} code - */ - async getCodec (code) { - const table = typeof code === 'string' ? this._codecsByName : this._codecsByCode + // 9. Let len be the length of values. + const len = values.length - if (table[code]) { - return table[code] - } + // 10. If index is greater than or equal to len, then return + // CreateIterResultObject(undefined, true). + if (index >= len) { + return { value: undefined, done: true } + } - // If not supported, attempt to dynamically load this codec - const codec = await this._loadCodec(code) + // 11. Let pair be the entry in values at index index. + const pair = values[index] - if (table[code] == null) { - this.addCodec(codec) - } + // 12. Set object’s index to index + 1. + object.index = index + 1 - return codec + // 13. Return the iterator result for pair and kind. + return iteratorResult(pair, kind) + }, + // The class string of an iterator prototype object for a given interface is the + // result of concatenating the identifier of the interface and the string " Iterator". + [Symbol.toStringTag]: `${name} Iterator` } - listCodecs () { - return Object.values(this._codecsByName) - } + // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%. + Object.setPrototypeOf(i, esIteratorPrototype) + // esIteratorPrototype needs to be the prototype of i + // which is the prototype of an empty object. Yes, it's confusing. + return Object.setPrototypeOf({}, i) } -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/multihashes.js -/** - * @typedef {import('multiformats/hashes/interface').MultihashHasher} MultihashHasher - * @typedef {import('./types').LoadHasherFn} LoadHasherFn - * @typedef {import('ipfs-core-types/src/utils').AbortOptions} AbortOptions - */ +// https://webidl.spec.whatwg.org/#iterator-result +function iteratorResult (pair, kind) { + let result + + // 1. Let result be a value determined by the value of kind: + switch (kind) { + case 'key': { + // 1. Let idlKey be pair’s key. + // 2. Let key be the result of converting idlKey to an + // ECMAScript value. + // 3. result is key. + result = pair[0] + break + } + case 'value': { + // 1. Let idlValue be pair’s value. + // 2. Let value be the result of converting idlValue to + // an ECMAScript value. + // 3. result is value. + result = pair[1] + break + } + case 'key+value': { + // 1. Let idlKey be pair’s key. + // 2. Let idlValue be pair’s value. + // 3. Let key be the result of converting idlKey to an + // ECMAScript value. + // 4. Let value be the result of converting idlValue to + // an ECMAScript value. + // 5. Let array be ! ArrayCreate(2). + // 6. Call ! CreateDataProperty(array, "0", key). + // 7. Call ! CreateDataProperty(array, "1", value). + // 8. result is array. + result = pair + break + } + } + + // 2. Return CreateIterResultObject(result, false). + return { value: result, done: false } +} /** - * @type {LoadHasherFn} + * @see https://fetch.spec.whatwg.org/#body-fully-read */ -const LOAD_HASHER = (codeOrName) => Promise.reject(new Error(`No hasher found for "${codeOrName}"`)) +async function fullyReadBody (body, processBody, processBodyError) { + // 1. If taskDestination is null, then set taskDestination to + // the result of starting a new parallel queue. -class Multihashes { - /** - * @param {object} options - * @param {LoadHasherFn} [options.loadHasher] - * @param {MultihashHasher[]} options.hashers - */ - constructor (options) { - // Object with current list of active hashers - /** @type {Record}} */ - this._hashersByName = {} + // 2. Let successSteps given a byte sequence bytes be to queue a + // fetch task to run processBody given bytes, with taskDestination. + const successSteps = processBody - // Object with current list of active hashers - /** @type {Record}} */ - this._hashersByCode = {} + // 3. Let errorSteps be to queue a fetch task to run processBodyError, + // with taskDestination. + const errorSteps = processBodyError - this._loadHasher = options.loadHasher || LOAD_HASHER + // 4. Let reader be the result of getting a reader for body’s stream. + // If that threw an exception, then run errorSteps with that + // exception and return. + let reader - // Enable all supplied hashers - for (const hasher of options.hashers) { - this.addHasher(hasher) - } + try { + reader = body.stream.getReader() + } catch (e) { + errorSteps(e) + return } - /** - * Add support for a multibase hasher - * - * @param {MultihashHasher} hasher - */ - addHasher (hasher) { - if (this._hashersByName[hasher.name] || this._hashersByCode[hasher.code]) { - throw new Error(`Resolver already exists for codec "${hasher.name}"`) - } - - this._hashersByName[hasher.name] = hasher - this._hashersByCode[hasher.code] = hasher + // 5. Read all bytes from reader, given successSteps and errorSteps. + try { + const result = await readAllBytes(reader) + successSteps(result) + } catch (e) { + errorSteps(e) } +} - /** - * Remove support for a multibase hasher - * - * @param {MultihashHasher} hasher - */ - removeHasher (hasher) { - delete this._hashersByName[hasher.name] - delete this._hashersByCode[hasher.code] - } +/** @type {ReadableStream} */ +let ReadableStream = globalThis.ReadableStream - /** - * @param {number | string} code - */ - async getHasher (code) { - const table = typeof code === 'string' ? this._hashersByName : this._hashersByCode +function isReadableStreamLike (stream) { + if (!ReadableStream) { + ReadableStream = (__nccwpck_require__(35356).ReadableStream) + } - if (table[code]) { - return table[code] - } + return stream instanceof ReadableStream || ( + stream[Symbol.toStringTag] === 'ReadableStream' && + typeof stream.tee === 'function' + ) +} - // If not supported, attempt to dynamically load this hasher - const hasher = await this._loadHasher(code) +const MAXIMUM_ARGUMENT_LENGTH = 65535 - if (table[code] == null) { - this.addHasher(hasher) - } +/** + * @see https://infra.spec.whatwg.org/#isomorphic-decode + * @param {number[]|Uint8Array} input + */ +function isomorphicDecode (input) { + // 1. To isomorphic decode a byte sequence input, return a string whose code point + // length is equal to input’s length and whose code points have the same values + // as the values of input’s bytes, in the same order. - return hasher + if (input.length < MAXIMUM_ARGUMENT_LENGTH) { + return String.fromCharCode(...input) } - listHashers () { - return Object.values(this._hashersByName) - } + return input.reduce((previous, current) => previous + String.fromCharCode(current), '') } -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/node_modules/multiformats/dist/src/bytes.js -const empty = new Uint8Array(0); -function toHex(d) { - return d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), ''); -} -function fromHex(hex) { - const hexes = hex.match(/../g); - return hexes != null ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : empty; -} -function equals(aa, bb) { - if (aa === bb) - return true; - if (aa.byteLength !== bb.byteLength) { - return false; - } - for (let ii = 0; ii < aa.byteLength; ii++) { - if (aa[ii] !== bb[ii]) { - return false; - } - } - return true; -} -function bytes_coerce(o) { - if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') - return o; - if (o instanceof ArrayBuffer) - return new Uint8Array(o); - if (ArrayBuffer.isView(o)) { - return new Uint8Array(o.buffer, o.byteOffset, o.byteLength); - } - throw new Error('Unknown type, must be binary type'); -} -function isBinary(o) { - return o instanceof ArrayBuffer || ArrayBuffer.isView(o); -} -function fromString(str) { - return new TextEncoder().encode(str); -} -function bytes_toString(b) { - return new TextDecoder().decode(b); -} -//# sourceMappingURL=bytes.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/node_modules/multiformats/dist/src/vendor/base-x.js -/* eslint-disable */ -// base-x encoding / decoding -// Copyright (c) 2018 base-x contributors -// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) -// Distributed under the MIT software license, see the accompanying -// file LICENSE or http://www.opensource.org/licenses/mit-license.php. /** - * @param {string} ALPHABET - * @param {any} name + * @param {ReadableStreamController} controller */ -function base(ALPHABET, name) { - if (ALPHABET.length >= 255) { - throw new TypeError('Alphabet too long'); - } - var BASE_MAP = new Uint8Array(256); - for (var j = 0; j < BASE_MAP.length; j++) { - BASE_MAP[j] = 255; - } - for (var i = 0; i < ALPHABET.length; i++) { - var x = ALPHABET.charAt(i); - var xc = x.charCodeAt(0); - if (BASE_MAP[xc] !== 255) { - throw new TypeError(x + ' is ambiguous'); - } - BASE_MAP[xc] = i; - } - var BASE = ALPHABET.length; - var LEADER = ALPHABET.charAt(0); - var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up - var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up - /** - * @param {any[] | Iterable} source - */ - function encode(source) { - // @ts-ignore - if (source instanceof Uint8Array) - ; - else if (ArrayBuffer.isView(source)) { - source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); - } - else if (Array.isArray(source)) { - source = Uint8Array.from(source); - } - if (!(source instanceof Uint8Array)) { - throw new TypeError('Expected Uint8Array'); - } - if (source.length === 0) { - return ''; - } - // Skip & count leading zeroes. - var zeroes = 0; - var length = 0; - var pbegin = 0; - var pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; - } - // Allocate enough space in big-endian base58 representation. - var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; - var b58 = new Uint8Array(size); - // Process the bytes. - while (pbegin !== pend) { - var carry = source[pbegin]; - // Apply "b58 = b58 * 256 + ch". - var i = 0; - for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { - carry += (256 * b58[it1]) >>> 0; - b58[it1] = (carry % BASE) >>> 0; - carry = (carry / BASE) >>> 0; - } - if (carry !== 0) { - throw new Error('Non-zero carry'); - } - length = i; - pbegin++; - } - // Skip leading zeroes in base58 result. - var it2 = size - length; - while (it2 !== size && b58[it2] === 0) { - it2++; - } - // Translate the result into a string. - var str = LEADER.repeat(zeroes); - for (; it2 < size; ++it2) { - str += ALPHABET.charAt(b58[it2]); - } - return str; - } - /** - * @param {string | string[]} source - */ - function decodeUnsafe(source) { - if (typeof source !== 'string') { - throw new TypeError('Expected String'); - } - if (source.length === 0) { - return new Uint8Array(); - } - var psz = 0; - // Skip leading spaces. - if (source[psz] === ' ') { - return; - } - // Skip and count leading '1's. - var zeroes = 0; - var length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; - } - // Allocate enough space in big-endian base256 representation. - var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. - var b256 = new Uint8Array(size); - // Process the characters. - while (source[psz]) { - // Decode character - var carry = BASE_MAP[source.charCodeAt(psz)]; - // Invalid character - if (carry === 255) { - return; - } - var i = 0; - for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { - carry += (BASE * b256[it3]) >>> 0; - b256[it3] = (carry % 256) >>> 0; - carry = (carry / 256) >>> 0; - } - if (carry !== 0) { - throw new Error('Non-zero carry'); - } - length = i; - psz++; - } - // Skip trailing spaces. - if (source[psz] === ' ') { - return; - } - // Skip leading zeroes in b256. - var it4 = size - length; - while (it4 !== size && b256[it4] === 0) { - it4++; - } - var vch = new Uint8Array(zeroes + (size - it4)); - var j = zeroes; - while (it4 !== size) { - vch[j++] = b256[it4++]; - } - return vch; - } - /** - * @param {string | string[]} string - */ - function decode(string) { - var buffer = decodeUnsafe(string); - if (buffer) { - return buffer; - } - throw new Error(`Non-${name} character`); +function readableStreamClose (controller) { + try { + controller.close() + } catch (err) { + // TODO: add comment explaining why this error occurs. + if (!err.message.includes('Controller is already closed')) { + throw err } - return { - encode: encode, - decodeUnsafe: decodeUnsafe, - decode: decode - }; + } } -var src = base; -var _brrp__multiformats_scope_baseX = src; -/* harmony default export */ const base_x = (_brrp__multiformats_scope_baseX); -//# sourceMappingURL=base-x.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/node_modules/multiformats/dist/src/bases/base.js - -/** - * Class represents both BaseEncoder and MultibaseEncoder meaning it - * can be used to encode to multibase or base encode without multibase - * prefix. - */ -class Encoder { - name; - prefix; - baseEncode; - constructor(name, prefix, baseEncode) { - this.name = name; - this.prefix = prefix; - this.baseEncode = baseEncode; - } - encode(bytes) { - if (bytes instanceof Uint8Array) { - return `${this.prefix}${this.baseEncode(bytes)}`; - } - else { - throw Error('Unknown type, must be binary type'); - } - } -} /** - * Class represents both BaseDecoder and MultibaseDecoder so it could be used - * to decode multibases (with matching prefix) or just base decode strings - * with corresponding base encoding. + * @see https://infra.spec.whatwg.org/#isomorphic-encode + * @param {string} input */ -class Decoder { - name; - prefix; - baseDecode; - prefixCodePoint; - constructor(name, prefix, baseDecode) { - this.name = name; - this.prefix = prefix; - /* c8 ignore next 3 */ - if (prefix.codePointAt(0) === undefined) { - throw new Error('Invalid prefix character'); - } - this.prefixCodePoint = prefix.codePointAt(0); - this.baseDecode = baseDecode; - } - decode(text) { - if (typeof text === 'string') { - if (text.codePointAt(0) !== this.prefixCodePoint) { - throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); - } - return this.baseDecode(text.slice(this.prefix.length)); - } - else { - throw Error('Can only multibase decode strings'); - } - } - or(decoder) { - return or(this, decoder); - } -} -class ComposedDecoder { - decoders; - constructor(decoders) { - this.decoders = decoders; - } - or(decoder) { - return or(this, decoder); - } - decode(input) { - const prefix = input[0]; - const decoder = this.decoders[prefix]; - if (decoder != null) { - return decoder.decode(input); - } - else { - throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); - } - } -} -function or(left, right) { - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - return new ComposedDecoder({ - ...(left.decoders ?? { [left.prefix]: left }), - ...(right.decoders ?? { [right.prefix]: right }) - }); -} -class Codec { - name; - prefix; - baseEncode; - baseDecode; - encoder; - decoder; - constructor(name, prefix, baseEncode, baseDecode) { - this.name = name; - this.prefix = prefix; - this.baseEncode = baseEncode; - this.baseDecode = baseDecode; - this.encoder = new Encoder(name, prefix, baseEncode); - this.decoder = new Decoder(name, prefix, baseDecode); - } - encode(input) { - return this.encoder.encode(input); - } - decode(input) { - return this.decoder.decode(input); - } -} -function from({ name, prefix, encode, decode }) { - return new Codec(name, prefix, encode, decode); -} -function baseX({ name, prefix, alphabet }) { - const { encode, decode } = base_x(alphabet, name); - return from({ - prefix, - name, - encode, - decode: (text) => bytes_coerce(decode(text)) - }); -} -function decode(string, alphabet, bitsPerChar, name) { - // Build the character lookup table: - const codes = {}; - for (let i = 0; i < alphabet.length; ++i) { - codes[alphabet[i]] = i; - } - // Count the padding bytes: - let end = string.length; - while (string[end - 1] === '=') { - --end; - } - // Allocate the output: - const out = new Uint8Array((end * bitsPerChar / 8) | 0); - // Parse the data: - let bits = 0; // Number of bits currently in the buffer - let buffer = 0; // Bits waiting to be written out, MSB first - let written = 0; // Next byte to write - for (let i = 0; i < end; ++i) { - // Read one character from the string: - const value = codes[string[i]]; - if (value === undefined) { - throw new SyntaxError(`Non-${name} character`); - } - // Append the bits to the buffer: - buffer = (buffer << bitsPerChar) | value; - bits += bitsPerChar; - // Write out some bits if the buffer has a byte's worth: - if (bits >= 8) { - bits -= 8; - out[written++] = 0xff & (buffer >> bits); - } - } - // Verify that we have received just enough bits: - if (bits >= bitsPerChar || (0xff & (buffer << (8 - bits))) !== 0) { - throw new SyntaxError('Unexpected end of data'); - } - return out; -} -function encode(data, alphabet, bitsPerChar) { - const pad = alphabet[alphabet.length - 1] === '='; - const mask = (1 << bitsPerChar) - 1; - let out = ''; - let bits = 0; // Number of bits currently in the buffer - let buffer = 0; // Bits waiting to be written out, MSB first - for (let i = 0; i < data.length; ++i) { - // Slurp data into the buffer: - buffer = (buffer << 8) | data[i]; - bits += 8; - // Write out as much as we can: - while (bits > bitsPerChar) { - bits -= bitsPerChar; - out += alphabet[mask & (buffer >> bits)]; - } - } - // Partial character: - if (bits !== 0) { - out += alphabet[mask & (buffer << (bitsPerChar - bits))]; - } - // Add padding characters until we hit a byte boundary: - if (pad) { - while (((out.length * bitsPerChar) & 7) !== 0) { - out += '='; - } - } - return out; +function isomorphicEncode (input) { + // 1. Assert: input contains no code points greater than U+00FF. + for (let i = 0; i < input.length; i++) { + assert(input.charCodeAt(i) <= 0xFF) + } + + // 2. Return a byte sequence whose length is equal to input’s code + // point length and whose bytes have the same values as the + // values of input’s code points, in the same order + return input } + /** - * RFC4648 Factory + * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes + * @see https://streams.spec.whatwg.org/#read-loop + * @param {ReadableStreamDefaultReader} reader */ -function rfc4648({ name, prefix, bitsPerChar, alphabet }) { - return from({ - prefix, - name, - encode(input) { - return encode(input, alphabet, bitsPerChar); - }, - decode(input) { - return decode(input, alphabet, bitsPerChar, name); - } - }); -} -//# sourceMappingURL=base.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/node_modules/multiformats/dist/src/bases/base32.js +async function readAllBytes (reader) { + const bytes = [] + let byteLength = 0 -const base32_base32 = rfc4648({ - prefix: 'b', - name: 'base32', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567', - bitsPerChar: 5 -}); -const base32_base32upper = rfc4648({ - prefix: 'B', - name: 'base32upper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', - bitsPerChar: 5 -}); -const base32pad = rfc4648({ - prefix: 'c', - name: 'base32pad', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', - bitsPerChar: 5 -}); -const base32padupper = rfc4648({ - prefix: 'C', - name: 'base32padupper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', - bitsPerChar: 5 -}); -const base32hex = rfc4648({ - prefix: 'v', - name: 'base32hex', - alphabet: '0123456789abcdefghijklmnopqrstuv', - bitsPerChar: 5 -}); -const base32hexupper = rfc4648({ - prefix: 'V', - name: 'base32hexupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', - bitsPerChar: 5 -}); -const base32hexpad = rfc4648({ - prefix: 't', - name: 'base32hexpad', - alphabet: '0123456789abcdefghijklmnopqrstuv=', - bitsPerChar: 5 -}); -const base32hexpadupper = rfc4648({ - prefix: 'T', - name: 'base32hexpadupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', - bitsPerChar: 5 -}); -const base32z = rfc4648({ - prefix: 'h', - name: 'base32z', - alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', - bitsPerChar: 5 -}); -//# sourceMappingURL=base32.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/node_modules/multiformats/dist/src/bases/base58.js + while (true) { + const { done, value: chunk } = await reader.read() -const base58_base58btc = baseX({ - name: 'base58btc', - prefix: 'z', - alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -}); -const base58flickr = baseX({ - name: 'base58flickr', - prefix: 'Z', - alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -}); -//# sourceMappingURL=base58.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/node_modules/multiformats/dist/src/vendor/varint.js -/* eslint-disable */ -var encode_1 = varint_encode; -var MSB = 0x80, REST = 0x7F, MSBALL = ~REST, INT = Math.pow(2, 31); -/** - * @param {number} num - * @param {number[]} out - * @param {number} offset - */ -function varint_encode(num, out, offset) { - out = out || []; - offset = offset || 0; - var oldOffset = offset; - while (num >= INT) { - out[offset++] = (num & 0xFF) | MSB; - num /= 128; + if (done) { + // 1. Call successSteps with bytes. + return Buffer.concat(bytes, byteLength) } - while (num & MSBALL) { - out[offset++] = (num & 0xFF) | MSB; - num >>>= 7; + + // 1. If chunk is not a Uint8Array object, call failureSteps + // with a TypeError and abort these steps. + if (!isUint8Array(chunk)) { + throw new TypeError('Received non-Uint8Array chunk') } - out[offset] = num | 0; - // @ts-ignore - varint_encode.bytes = offset - oldOffset + 1; - return out; + + // 2. Append the bytes represented by chunk to bytes. + bytes.push(chunk) + byteLength += chunk.length + + // 3. Read-loop given reader, bytes, successSteps, and failureSteps. + } } -var varint_decode = read; -var MSB$1 = 0x80, REST$1 = 0x7F; + /** - * @param {string | any[]} buf - * @param {number} offset + * @see https://fetch.spec.whatwg.org/#is-local + * @param {URL} url */ -function read(buf, offset) { - var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length; - do { - if (counter >= l) { - // @ts-ignore - read.bytes = 0; - throw new RangeError('Could not decode varint'); - } - b = buf[counter++]; - res += shift < 28 - ? (b & REST$1) << shift - : (b & REST$1) * Math.pow(2, shift); - shift += 7; - } while (b >= MSB$1); - // @ts-ignore - read.bytes = counter - offset; - return res; -} -var N1 = Math.pow(2, 7); -var N2 = Math.pow(2, 14); -var N3 = Math.pow(2, 21); -var N4 = Math.pow(2, 28); -var N5 = Math.pow(2, 35); -var N6 = Math.pow(2, 42); -var N7 = Math.pow(2, 49); -var N8 = Math.pow(2, 56); -var N9 = Math.pow(2, 63); -var varint_length = function (/** @type {number} */ value) { - 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); -}; -var varint_varint = { - encode: encode_1, - decode: varint_decode, - encodingLength: varint_length -}; -var _brrp_varint = varint_varint; -/* harmony default export */ const vendor_varint = (_brrp_varint); -//# sourceMappingURL=varint.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/node_modules/multiformats/dist/src/varint.js +function urlIsLocal (url) { + assert('protocol' in url) // ensure it's a url object -function src_varint_decode(data, offset = 0) { - const code = vendor_varint.decode(data, offset); - return [code, vendor_varint.decode.bytes]; -} -function encodeTo(int, target, offset = 0) { - vendor_varint.encode(int, target, offset); - return target; -} -function encodingLength(int) { - return vendor_varint.encodingLength(int); -} -//# sourceMappingURL=varint.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/node_modules/multiformats/dist/src/hashes/digest.js + const protocol = url.protocol + return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:' +} /** - * Creates a multihash digest. + * @param {string|URL} url */ -function digest_create(code, digest) { - const size = digest.byteLength; - const sizeOffset = encodingLength(code); - const digestOffset = sizeOffset + encodingLength(size); - const bytes = new Uint8Array(digestOffset + size); - encodeTo(code, bytes, 0); - encodeTo(size, bytes, sizeOffset); - bytes.set(digest, digestOffset); - return new digest_Digest(code, size, digest, bytes); +function urlHasHttpsScheme (url) { + if (typeof url === 'string') { + return url.startsWith('https:') + } + + return url.protocol === 'https:' } + /** - * Turns bytes representation of multihash digest into an instance. + * @see https://fetch.spec.whatwg.org/#http-scheme + * @param {URL} url */ -function digest_decode(multihash) { - const bytes = bytes_coerce(multihash); - const [code, sizeOffset] = src_varint_decode(bytes); - const [size, digestOffset] = src_varint_decode(bytes.subarray(sizeOffset)); - const digest = bytes.subarray(sizeOffset + digestOffset); - if (digest.byteLength !== size) { - throw new Error('Incorrect length'); - } - return new digest_Digest(code, size, digest, bytes); -} -function digest_equals(a, b) { - if (a === b) { - return true; - } - else { - const data = b; - return (a.code === data.code && - a.size === data.size && - data.bytes instanceof Uint8Array && - equals(a.bytes, data.bytes)); - } +function urlIsHttpHttpsScheme (url) { + assert('protocol' in url) // ensure it's a url object + + const protocol = url.protocol + + return protocol === 'http:' || protocol === 'https:' } + /** - * Represents a multihash digest which carries information about the - * hashing algorithm and an actual hash digest. + * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0. */ -class digest_Digest { - code; - size; - digest; - bytes; - /** - * Creates a multihash digest. - */ - constructor(code, size, digest, bytes) { - this.code = code; - this.size = size; - this.digest = digest; - this.bytes = bytes; - } +const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key)) + +module.exports = { + isAborted, + isCancelled, + createDeferredPromise, + ReadableStreamFrom, + toUSVString, + tryUpgradeRequestToAPotentiallyTrustworthyURL, + coarsenedSharedCurrentTime, + determineRequestsReferrer, + makePolicyContainer, + clonePolicyContainer, + appendFetchMetadata, + appendRequestOriginHeader, + TAOCheck, + corsCheck, + crossOriginResourcePolicyCheck, + createOpaqueTimingInfo, + setRequestReferrerPolicyOnRedirect, + isValidHTTPToken, + requestBadPort, + requestCurrentURL, + responseURL, + responseLocationURL, + isBlobLike, + isURLPotentiallyTrustworthy, + isValidReasonPhrase, + sameOrigin, + normalizeMethod, + serializeJavascriptValueToJSONString, + makeIterator, + isValidHeaderName, + isValidHeaderValue, + hasOwn, + isErrorLike, + fullyReadBody, + bytesMatch, + isReadableStreamLike, + readableStreamClose, + isomorphicEncode, + isomorphicDecode, + urlIsLocal, + urlHasHttpsScheme, + urlIsHttpHttpsScheme, + readAllBytes, + normalizeMethodRecord } -//# sourceMappingURL=digest.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/node_modules/multiformats/dist/src/cid.js +/***/ }), +/***/ 7000: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// This way TS will also expose all the types from module -function format(link, base) { - const { bytes, version } = link; - switch (version) { - case 0: - return toStringV0(bytes, baseCache(link), base ?? base58_base58btc.encoder); - default: - return toStringV1(bytes, baseCache(link), (base ?? base32_base32.encoder)); - } +const { types } = __nccwpck_require__(73837) +const { hasOwn, toUSVString } = __nccwpck_require__(47794) + +/** @type {import('../../types/webidl').Webidl} */ +const webidl = {} +webidl.converters = {} +webidl.util = {} +webidl.errors = {} + +webidl.errors.exception = function (message) { + return new TypeError(`${message.header}: ${message.message}`) } -function toJSON(link) { - return { - '/': format(link) - }; + +webidl.errors.conversionFailed = function (context) { + const plural = context.types.length === 1 ? '' : ' one of' + const message = + `${context.argument} could not be converted to` + + `${plural}: ${context.types.join(', ')}.` + + return webidl.errors.exception({ + header: context.prefix, + message + }) } -function fromJSON(json) { - return cid_CID.parse(json['/']); + +webidl.errors.invalidArgument = function (context) { + return webidl.errors.exception({ + header: context.prefix, + message: `"${context.value}" is an invalid ${context.type}.` + }) } -const cache = new WeakMap(); -function baseCache(cid) { - const baseCache = cache.get(cid); - if (baseCache == null) { - const baseCache = new Map(); - cache.set(cid, baseCache); - return baseCache; - } - return baseCache; + +// https://webidl.spec.whatwg.org/#implements +webidl.brandCheck = function (V, I, opts = undefined) { + if (opts?.strict !== false && !(V instanceof I)) { + throw new TypeError('Illegal invocation') + } else { + return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag] + } } -class cid_CID { - code; - version; - multihash; - bytes; - '/'; - /** - * @param version - Version of the CID - * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param multihash - (Multi)hash of the of the content. - */ - constructor(version, code, multihash, bytes) { - this.code = code; - this.version = version; - this.multihash = multihash; - this.bytes = bytes; - // flag to serializers that this is a CID and - // should be treated specially - this['/'] = bytes; - } - /** - * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` - * please either use `CID.asCID(cid)` or switch to new signalling mechanism - * - * @deprecated - */ - get asCID() { - return this; - } - // ArrayBufferView - get byteOffset() { - return this.bytes.byteOffset; - } - // ArrayBufferView - get byteLength() { - return this.bytes.byteLength; - } - toV0() { - switch (this.version) { - case 0: { - return this; - } - case 1: { - const { code, multihash } = this; - if (code !== DAG_PB_CODE) { - throw new Error('Cannot convert a non dag-pb CID to CIDv0'); - } - // sha2-256 - if (multihash.code !== SHA_256_CODE) { - throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0'); - } - return (cid_CID.createV0(multihash)); - } - default: { - throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`); - } - } - } - toV1() { - switch (this.version) { - case 0: { - const { code, digest } = this.multihash; - const multihash = digest_create(code, digest); - return (cid_CID.createV1(this.code, multihash)); - } - case 1: { - return this; - } - default: { - throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`); - } - } + +webidl.argumentLengthCheck = function ({ length }, min, ctx) { + if (length < min) { + throw webidl.errors.exception({ + message: `${min} argument${min !== 1 ? 's' : ''} required, ` + + `but${length ? ' only' : ''} ${length} found.`, + ...ctx + }) + } +} + +webidl.illegalConstructor = function () { + throw webidl.errors.exception({ + header: 'TypeError', + message: 'Illegal constructor' + }) +} + +// https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values +webidl.util.Type = function (V) { + switch (typeof V) { + case 'undefined': return 'Undefined' + case 'boolean': return 'Boolean' + case 'string': return 'String' + case 'symbol': return 'Symbol' + case 'number': return 'Number' + case 'bigint': return 'BigInt' + case 'function': + case 'object': { + if (V === null) { + return 'Null' + } + + return 'Object' } - equals(other) { - return cid_CID.equals(this, other); + } +} + +// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint +webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) { + let upperBound + let lowerBound + + // 1. If bitLength is 64, then: + if (bitLength === 64) { + // 1. Let upperBound be 2^53 − 1. + upperBound = Math.pow(2, 53) - 1 + + // 2. If signedness is "unsigned", then let lowerBound be 0. + if (signedness === 'unsigned') { + lowerBound = 0 + } else { + // 3. Otherwise let lowerBound be −2^53 + 1. + lowerBound = Math.pow(-2, 53) + 1 } - static equals(self, other) { - const unknown = other; - return (unknown != null && - self.code === unknown.code && - self.version === unknown.version && - digest_equals(self.multihash, unknown.multihash)); + } else if (signedness === 'unsigned') { + // 2. Otherwise, if signedness is "unsigned", then: + + // 1. Let lowerBound be 0. + lowerBound = 0 + + // 2. Let upperBound be 2^bitLength − 1. + upperBound = Math.pow(2, bitLength) - 1 + } else { + // 3. Otherwise: + + // 1. Let lowerBound be -2^bitLength − 1. + lowerBound = Math.pow(-2, bitLength) - 1 + + // 2. Let upperBound be 2^bitLength − 1 − 1. + upperBound = Math.pow(2, bitLength - 1) - 1 + } + + // 4. Let x be ? ToNumber(V). + let x = Number(V) + + // 5. If x is −0, then set x to +0. + if (x === 0) { + x = 0 + } + + // 6. If the conversion is to an IDL type associated + // with the [EnforceRange] extended attribute, then: + if (opts.enforceRange === true) { + // 1. If x is NaN, +∞, or −∞, then throw a TypeError. + if ( + Number.isNaN(x) || + x === Number.POSITIVE_INFINITY || + x === Number.NEGATIVE_INFINITY + ) { + throw webidl.errors.exception({ + header: 'Integer conversion', + message: `Could not convert ${V} to an integer.` + }) } - toString(base) { - return format(this, base); + + // 2. Set x to IntegerPart(x). + x = webidl.util.IntegerPart(x) + + // 3. If x < lowerBound or x > upperBound, then + // throw a TypeError. + if (x < lowerBound || x > upperBound) { + throw webidl.errors.exception({ + header: 'Integer conversion', + message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.` + }) } - toJSON() { - return { '/': format(this) }; + + // 4. Return x. + return x + } + + // 7. If x is not NaN and the conversion is to an IDL + // type associated with the [Clamp] extended + // attribute, then: + if (!Number.isNaN(x) && opts.clamp === true) { + // 1. Set x to min(max(x, lowerBound), upperBound). + x = Math.min(Math.max(x, lowerBound), upperBound) + + // 2. Round x to the nearest integer, choosing the + // even integer if it lies halfway between two, + // and choosing +0 rather than −0. + if (Math.floor(x) % 2 === 0) { + x = Math.floor(x) + } else { + x = Math.ceil(x) } - link() { - return this; + + // 3. Return x. + return x + } + + // 8. If x is NaN, +0, +∞, or −∞, then return +0. + if ( + Number.isNaN(x) || + (x === 0 && Object.is(0, x)) || + x === Number.POSITIVE_INFINITY || + x === Number.NEGATIVE_INFINITY + ) { + return 0 + } + + // 9. Set x to IntegerPart(x). + x = webidl.util.IntegerPart(x) + + // 10. Set x to x modulo 2^bitLength. + x = x % Math.pow(2, bitLength) + + // 11. If signedness is "signed" and x ≥ 2^bitLength − 1, + // then return x − 2^bitLength. + if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) { + return x - Math.pow(2, bitLength) + } + + // 12. Otherwise, return x. + return x +} + +// https://webidl.spec.whatwg.org/#abstract-opdef-integerpart +webidl.util.IntegerPart = function (n) { + // 1. Let r be floor(abs(n)). + const r = Math.floor(Math.abs(n)) + + // 2. If n < 0, then return -1 × r. + if (n < 0) { + return -1 * r + } + + // 3. Otherwise, return r. + return r +} + +// https://webidl.spec.whatwg.org/#es-sequence +webidl.sequenceConverter = function (converter) { + return (V) => { + // 1. If Type(V) is not Object, throw a TypeError. + if (webidl.util.Type(V) !== 'Object') { + throw webidl.errors.exception({ + header: 'Sequence', + message: `Value of type ${webidl.util.Type(V)} is not an Object.` + }) } - [Symbol.toStringTag] = 'CID'; - // Legacy - [Symbol.for('nodejs.util.inspect.custom')]() { - return `CID(${this.toString()})`; + + // 2. Let method be ? GetMethod(V, @@iterator). + /** @type {Generator} */ + const method = V?.[Symbol.iterator]?.() + const seq = [] + + // 3. If method is undefined, throw a TypeError. + if ( + method === undefined || + typeof method.next !== 'function' + ) { + throw webidl.errors.exception({ + header: 'Sequence', + message: 'Object is not an iterator.' + }) } - /** - * Takes any input `value` and returns a `CID` instance if it was - * a `CID` otherwise returns `null`. If `value` is instanceof `CID` - * it will return value back. If `value` is not instance of this CID - * class, but is compatible CID it will return new instance of this - * `CID` class. Otherwise returns null. - * - * This allows two different incompatible versions of CID library to - * co-exist and interop as long as binary interface is compatible. - */ - static asCID(input) { - if (input == null) { - return null; - } - const value = input; - if (value instanceof cid_CID) { - // If value is instance of CID then we're all set. - return value; - } - else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { - // If value isn't instance of this CID class but `this.asCID === this` or - // `value['/'] === value.bytes` is true it is CID instance coming from a - // different implementation (diff version or duplicate). In that case we - // rebase it to this `CID` implementation so caller is guaranteed to get - // instance with expected API. - const { version, code, multihash, bytes } = value; - return new cid_CID(version, code, multihash, bytes ?? encodeCID(version, code, multihash.bytes)); - } - else if (value[cidSymbol] === true) { - // If value is a CID from older implementation that used to be tagged via - // symbol we still rebase it to the this `CID` implementation by - // delegating that to a constructor. - const { version, multihash, code } = value; - const digest = digest_decode(multihash); - return cid_CID.create(version, code, digest); - } - else { - // Otherwise value is not a CID (or an incompatible version of it) in - // which case we return `null`. - return null; - } + + // https://webidl.spec.whatwg.org/#create-sequence-from-iterable + while (true) { + const { done, value } = method.next() + + if (done) { + break + } + + seq.push(converter(value)) } - /** - * @param version - Version of the CID - * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param digest - (Multi)hash of the of the content. - */ - static create(version, code, digest) { - if (typeof code !== 'number') { - throw new Error('String codecs are no longer supported'); - } - if (!(digest.bytes instanceof Uint8Array)) { - throw new Error('Invalid digest'); - } - switch (version) { - case 0: { - if (code !== DAG_PB_CODE) { - throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`); - } - else { - return new cid_CID(version, code, digest, digest.bytes); - } - } - case 1: { - const bytes = encodeCID(version, code, digest.bytes); - return new cid_CID(version, code, digest, bytes); - } - default: { - throw new Error('Invalid version'); - } - } + + return seq + } +} + +// https://webidl.spec.whatwg.org/#es-to-record +webidl.recordConverter = function (keyConverter, valueConverter) { + return (O) => { + // 1. If Type(O) is not Object, throw a TypeError. + if (webidl.util.Type(O) !== 'Object') { + throw webidl.errors.exception({ + header: 'Record', + message: `Value of type ${webidl.util.Type(O)} is not an Object.` + }) } - /** - * Simplified version of `create` for CIDv0. - */ - static createV0(digest) { - return cid_CID.create(0, DAG_PB_CODE, digest); + + // 2. Let result be a new empty instance of record. + const result = {} + + if (!types.isProxy(O)) { + // Object.keys only returns enumerable properties + const keys = Object.keys(O) + + for (const key of keys) { + // 1. Let typedKey be key converted to an IDL value of type K. + const typedKey = keyConverter(key) + + // 2. Let value be ? Get(O, key). + // 3. Let typedValue be value converted to an IDL value of type V. + const typedValue = valueConverter(O[key]) + + // 4. Set result[typedKey] to typedValue. + result[typedKey] = typedValue + } + + // 5. Return result. + return result } - /** - * Simplified version of `create` for CIDv1. - * - * @param code - Content encoding format code. - * @param digest - Multihash of the content. - */ - static createV1(code, digest) { - return cid_CID.create(1, code, digest); + + // 3. Let keys be ? O.[[OwnPropertyKeys]](). + const keys = Reflect.ownKeys(O) + + // 4. For each key of keys. + for (const key of keys) { + // 1. Let desc be ? O.[[GetOwnProperty]](key). + const desc = Reflect.getOwnPropertyDescriptor(O, key) + + // 2. If desc is not undefined and desc.[[Enumerable]] is true: + if (desc?.enumerable) { + // 1. Let typedKey be key converted to an IDL value of type K. + const typedKey = keyConverter(key) + + // 2. Let value be ? Get(O, key). + // 3. Let typedValue be value converted to an IDL value of type V. + const typedValue = valueConverter(O[key]) + + // 4. Set result[typedKey] to typedValue. + result[typedKey] = typedValue + } } - /** - * Decoded a CID from its binary representation. The byte array must contain - * only the CID with no additional bytes. - * - * An error will be thrown if the bytes provided do not contain a valid - * binary representation of a CID. - */ - static decode(bytes) { - const [cid, remainder] = cid_CID.decodeFirst(bytes); - if (remainder.length !== 0) { - throw new Error('Incorrect length'); - } - return cid; + + // 5. Return result. + return result + } +} + +webidl.interfaceConverter = function (i) { + return (V, opts = {}) => { + if (opts.strict !== false && !(V instanceof i)) { + throw webidl.errors.exception({ + header: i.name, + message: `Expected ${V} to be an instance of ${i.name}.` + }) } - /** - * Decoded a CID from its binary representation at the beginning of a byte - * array. - * - * Returns an array with the first element containing the CID and the second - * element containing the remainder of the original byte array. The remainder - * will be a zero-length byte array if the provided bytes only contained a - * binary CID representation. - */ - static decodeFirst(bytes) { - const specs = cid_CID.inspectBytes(bytes); - const prefixSize = specs.size - specs.multihashSize; - const multihashBytes = bytes_coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize)); - if (multihashBytes.byteLength !== specs.multihashSize) { - throw new Error('Incorrect length'); - } - const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize); - const digest = new digest_Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); - const cid = specs.version === 0 - ? cid_CID.createV0(digest) - : cid_CID.createV1(specs.codec, digest); - return [cid, bytes.subarray(specs.size)]; + + return V + } +} + +webidl.dictionaryConverter = function (converters) { + return (dictionary) => { + const type = webidl.util.Type(dictionary) + const dict = {} + + if (type === 'Null' || type === 'Undefined') { + return dict + } else if (type !== 'Object') { + throw webidl.errors.exception({ + header: 'Dictionary', + message: `Expected ${dictionary} to be one of: Null, Undefined, Object.` + }) } - /** - * Inspect the initial bytes of a CID to determine its properties. - * - * Involves decoding up to 4 varints. Typically this will require only 4 to 6 - * bytes but for larger multicodec code values and larger multihash digest - * lengths these varints can be quite large. It is recommended that at least - * 10 bytes be made available in the `initialBytes` argument for a complete - * inspection. - */ - static inspectBytes(initialBytes) { - let offset = 0; - const next = () => { - const [i, length] = src_varint_decode(initialBytes.subarray(offset)); - offset += length; - return i; - }; - let version = next(); - let codec = DAG_PB_CODE; - if (version === 18) { - // CIDv0 - version = 0; - offset = 0; - } - else { - codec = next(); - } - if (version !== 0 && version !== 1) { - throw new RangeError(`Invalid CID version ${version}`); + + for (const options of converters) { + const { key, defaultValue, required, converter } = options + + if (required === true) { + if (!hasOwn(dictionary, key)) { + throw webidl.errors.exception({ + header: 'Dictionary', + message: `Missing required key "${key}".` + }) } - const prefixSize = offset; - const multihashCode = next(); // multihash code - const digestSize = next(); // multihash length - const size = offset + digestSize; - const multihashSize = size - prefixSize; - return { version, codec, multihashCode, digestSize, multihashSize, size }; - } - /** - * Takes cid in a string representation and creates an instance. If `base` - * decoder is not provided will use a default from the configuration. It will - * throw an error if encoding of the CID is not compatible with supplied (or - * a default decoder). - */ - static parse(source, base) { - const [prefix, bytes] = parseCIDtoBytes(source, base); - const cid = cid_CID.decode(bytes); - if (cid.version === 0 && source[0] !== 'Q') { - throw Error('Version 0 CID string must not include multibase prefix'); + } + + let value = dictionary[key] + const hasDefault = hasOwn(options, 'defaultValue') + + // Only use defaultValue if value is undefined and + // a defaultValue options was provided. + if (hasDefault && value !== null) { + value = value ?? defaultValue + } + + // A key can be optional and have no default value. + // When this happens, do not perform a conversion, + // and do not assign the key a value. + if (required || hasDefault || value !== undefined) { + value = converter(value) + + if ( + options.allowedValues && + !options.allowedValues.includes(value) + ) { + throw webidl.errors.exception({ + header: 'Dictionary', + message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.` + }) } - // Cache string representation to avoid computing it on `this.toString()` - baseCache(cid).set(prefix, source); - return cid; + + dict[key] = value + } } + + return dict + } } -function parseCIDtoBytes(source, base) { - switch (source[0]) { - // CIDv0 is parsed differently - case 'Q': { - const decoder = base ?? base58_base58btc; - return [ - base58_base58btc.prefix, - decoder.decode(`${base58_base58btc.prefix}${source}`) - ]; - } - case base58_base58btc.prefix: { - const decoder = base ?? base58_base58btc; - return [base58_base58btc.prefix, decoder.decode(source)]; - } - case base32_base32.prefix: { - const decoder = base ?? base32_base32; - return [base32_base32.prefix, decoder.decode(source)]; - } - default: { - if (base == null) { - throw Error('To parse non base32 or base58btc encoded CID multibase decoder must be provided'); - } - return [source[0], base.decode(source)]; - } + +webidl.nullableConverter = function (converter) { + return (V) => { + if (V === null) { + return V } + + return converter(V) + } } -function toStringV0(bytes, cache, base) { - const { prefix } = base; - if (prefix !== base58_base58btc.prefix) { - throw Error(`Cannot string encode V0 in ${base.name} encoding`); - } - const cid = cache.get(prefix); - if (cid == null) { - const cid = base.encode(bytes).slice(1); - cache.set(prefix, cid); - return cid; - } - else { - return cid; - } + +// https://webidl.spec.whatwg.org/#es-DOMString +webidl.converters.DOMString = function (V, opts = {}) { + // 1. If V is null and the conversion is to an IDL type + // associated with the [LegacyNullToEmptyString] + // extended attribute, then return the DOMString value + // that represents the empty string. + if (V === null && opts.legacyNullToEmptyString) { + return '' + } + + // 2. Let x be ? ToString(V). + if (typeof V === 'symbol') { + throw new TypeError('Could not convert argument of type symbol to string.') + } + + // 3. Return the IDL DOMString value that represents the + // same sequence of code units as the one the + // ECMAScript String value x represents. + return String(V) } -function toStringV1(bytes, cache, base) { - const { prefix } = base; - const cid = cache.get(prefix); - if (cid == null) { - const cid = base.encode(bytes); - cache.set(prefix, cid); - return cid; - } - else { - return cid; + +// https://webidl.spec.whatwg.org/#es-ByteString +webidl.converters.ByteString = function (V) { + // 1. Let x be ? ToString(V). + // Note: DOMString converter perform ? ToString(V) + const x = webidl.converters.DOMString(V) + + // 2. If the value of any element of x is greater than + // 255, then throw a TypeError. + for (let index = 0; index < x.length; index++) { + if (x.charCodeAt(index) > 255) { + throw new TypeError( + 'Cannot convert argument to a ByteString because the character at ' + + `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.` + ) } + } + + // 3. Return an IDL ByteString value whose length is the + // length of x, and where the value of each element is + // the value of the corresponding element of x. + return x } -const DAG_PB_CODE = 0x70; -const SHA_256_CODE = 0x12; -function encodeCID(version, code, multihash) { - const codeOffset = encodingLength(version); - const hashOffset = codeOffset + encodingLength(code); - const bytes = new Uint8Array(hashOffset + multihash.byteLength); - encodeTo(version, bytes, 0); - encodeTo(code, bytes, codeOffset); - bytes.set(multihash, hashOffset); - return bytes; -} -const cidSymbol = Symbol.for('@ipld/js-cid/CID'); -//# sourceMappingURL=cid.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/src/pb-decode.js -const textDecoder = new TextDecoder() -/** - * @typedef {import('./interface.js').RawPBLink} RawPBLink - */ +// https://webidl.spec.whatwg.org/#es-USVString +webidl.converters.USVString = toUSVString -/** - * @typedef {import('./interface.js').RawPBNode} RawPBNode - */ +// https://webidl.spec.whatwg.org/#es-boolean +webidl.converters.boolean = function (V) { + // 1. Let x be the result of computing ToBoolean(V). + const x = Boolean(V) -/** - * @param {Uint8Array} bytes - * @param {number} offset - * @returns {[number, number]} - */ -function pb_decode_decodeVarint (bytes, offset) { - let v = 0 + // 2. Return the IDL boolean value that is the one that represents + // the same truth value as the ECMAScript Boolean value x. + return x +} - for (let shift = 0; ; shift += 7) { - /* c8 ignore next 3 */ - if (shift >= 64) { - throw new Error('protobuf: varint overflow') - } - /* c8 ignore next 3 */ - if (offset >= bytes.length) { - throw new Error('protobuf: unexpected end of data') - } +// https://webidl.spec.whatwg.org/#es-any +webidl.converters.any = function (V) { + return V +} - const b = bytes[offset++] - v += shift < 28 ? (b & 0x7f) << shift : (b & 0x7f) * (2 ** shift) - if (b < 0x80) { - break - } - } - return [v, offset] +// https://webidl.spec.whatwg.org/#es-long-long +webidl.converters['long long'] = function (V) { + // 1. Let x be ? ConvertToInt(V, 64, "signed"). + const x = webidl.util.ConvertToInt(V, 64, 'signed') + + // 2. Return the IDL long long value that represents + // the same numeric value as x. + return x } -/** - * @param {Uint8Array} bytes - * @param {number} offset - * @returns {[Uint8Array, number]} - */ -function decodeBytes (bytes, offset) { - let byteLen - ;[byteLen, offset] = pb_decode_decodeVarint(bytes, offset) - const postOffset = offset + byteLen +// https://webidl.spec.whatwg.org/#es-unsigned-long-long +webidl.converters['unsigned long long'] = function (V) { + // 1. Let x be ? ConvertToInt(V, 64, "unsigned"). + const x = webidl.util.ConvertToInt(V, 64, 'unsigned') - /* c8 ignore next 3 */ - if (byteLen < 0 || postOffset < 0) { - throw new Error('protobuf: invalid length') - } - /* c8 ignore next 3 */ - if (postOffset > bytes.length) { - throw new Error('protobuf: unexpected end of data') - } + // 2. Return the IDL unsigned long long value that + // represents the same numeric value as x. + return x +} - return [bytes.subarray(offset, postOffset), postOffset] +// https://webidl.spec.whatwg.org/#es-unsigned-long +webidl.converters['unsigned long'] = function (V) { + // 1. Let x be ? ConvertToInt(V, 32, "unsigned"). + const x = webidl.util.ConvertToInt(V, 32, 'unsigned') + + // 2. Return the IDL unsigned long value that + // represents the same numeric value as x. + return x } -/** - * @param {Uint8Array} bytes - * @param {number} index - * @returns {[number, number, number]} - */ -function decodeKey (bytes, index) { - let wire - ;[wire, index] = pb_decode_decodeVarint(bytes, index) - // [wireType, fieldNum, newIndex] - return [wire & 0x7, wire >> 3, index] +// https://webidl.spec.whatwg.org/#es-unsigned-short +webidl.converters['unsigned short'] = function (V, opts) { + // 1. Let x be ? ConvertToInt(V, 16, "unsigned"). + const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts) + + // 2. Return the IDL unsigned short value that represents + // the same numeric value as x. + return x } -/** - * @param {Uint8Array} bytes - * @returns {RawPBLink} - */ -function decodeLink (bytes) { - /** @type {RawPBLink} */ - const link = {} - const l = bytes.length - let index = 0 +// https://webidl.spec.whatwg.org/#idl-ArrayBuffer +webidl.converters.ArrayBuffer = function (V, opts = {}) { + // 1. If Type(V) is not Object, or V does not have an + // [[ArrayBufferData]] internal slot, then throw a + // TypeError. + // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances + // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances + if ( + webidl.util.Type(V) !== 'Object' || + !types.isAnyArrayBuffer(V) + ) { + throw webidl.errors.conversionFailed({ + prefix: `${V}`, + argument: `${V}`, + types: ['ArrayBuffer'] + }) + } - while (index < l) { - let wireType, fieldNum - ;[wireType, fieldNum, index] = decodeKey(bytes, index) + // 2. If the conversion is not to an IDL type associated + // with the [AllowShared] extended attribute, and + // IsSharedArrayBuffer(V) is true, then throw a + // TypeError. + if (opts.allowShared === false && types.isSharedArrayBuffer(V)) { + throw webidl.errors.exception({ + header: 'ArrayBuffer', + message: 'SharedArrayBuffer is not allowed.' + }) + } - if (fieldNum === 1) { - if (link.Hash) { - throw new Error('protobuf: (PBLink) duplicate Hash section') - } - if (wireType !== 2) { - throw new Error(`protobuf: (PBLink) wrong wireType (${wireType}) for Hash`) - } - if (link.Name !== undefined) { - throw new Error('protobuf: (PBLink) invalid order, found Name before Hash') - } - if (link.Tsize !== undefined) { - throw new Error('protobuf: (PBLink) invalid order, found Tsize before Hash') - } + // 3. If the conversion is not to an IDL type associated + // with the [AllowResizable] extended attribute, and + // IsResizableArrayBuffer(V) is true, then throw a + // TypeError. + // Note: resizable ArrayBuffers are currently a proposal. - [link.Hash, index] = decodeBytes(bytes, index) - } else if (fieldNum === 2) { - if (link.Name !== undefined) { - throw new Error('protobuf: (PBLink) duplicate Name section') - } - if (wireType !== 2) { - throw new Error(`protobuf: (PBLink) wrong wireType (${wireType}) for Name`) - } - if (link.Tsize !== undefined) { - throw new Error('protobuf: (PBLink) invalid order, found Tsize before Name') - } + // 4. Return the IDL ArrayBuffer value that is a + // reference to the same object as V. + return V +} - let byts - ;[byts, index] = decodeBytes(bytes, index) - link.Name = textDecoder.decode(byts) - } else if (fieldNum === 3) { - if (link.Tsize !== undefined) { - throw new Error('protobuf: (PBLink) duplicate Tsize section') - } - if (wireType !== 0) { - throw new Error(`protobuf: (PBLink) wrong wireType (${wireType}) for Tsize`) - } +webidl.converters.TypedArray = function (V, T, opts = {}) { + // 1. Let T be the IDL type V is being converted to. - [link.Tsize, index] = pb_decode_decodeVarint(bytes, index) - } else { - throw new Error(`protobuf: (PBLink) invalid fieldNumber, expected 1, 2 or 3, got ${fieldNum}`) - } + // 2. If Type(V) is not Object, or V does not have a + // [[TypedArrayName]] internal slot with a value + // equal to T’s name, then throw a TypeError. + if ( + webidl.util.Type(V) !== 'Object' || + !types.isTypedArray(V) || + V.constructor.name !== T.name + ) { + throw webidl.errors.conversionFailed({ + prefix: `${T.name}`, + argument: `${V}`, + types: [T.name] + }) } - /* c8 ignore next 3 */ - if (index > l) { - throw new Error('protobuf: (PBLink) unexpected end of data') + // 3. If the conversion is not to an IDL type associated + // with the [AllowShared] extended attribute, and + // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is + // true, then throw a TypeError. + if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) { + throw webidl.errors.exception({ + header: 'ArrayBuffer', + message: 'SharedArrayBuffer is not allowed.' + }) } - return link + // 4. If the conversion is not to an IDL type associated + // with the [AllowResizable] extended attribute, and + // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is + // true, then throw a TypeError. + // Note: resizable array buffers are currently a proposal + + // 5. Return the IDL value of type T that is a reference + // to the same object as V. + return V } -/** - * @param {Uint8Array} bytes - * @returns {RawPBNode} - */ -function decodeNode (bytes) { - const l = bytes.length - let index = 0 - /** @type {RawPBLink[]|void} */ - let links = undefined // eslint-disable-line no-undef-init - let linksBeforeData = false - /** @type {Uint8Array|void} */ - let data = undefined // eslint-disable-line no-undef-init +webidl.converters.DataView = function (V, opts = {}) { + // 1. If Type(V) is not Object, or V does not have a + // [[DataView]] internal slot, then throw a TypeError. + if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) { + throw webidl.errors.exception({ + header: 'DataView', + message: 'Object is not a DataView.' + }) + } - while (index < l) { - let wireType, fieldNum - ;[wireType, fieldNum, index] = decodeKey(bytes, index) + // 2. If the conversion is not to an IDL type associated + // with the [AllowShared] extended attribute, and + // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true, + // then throw a TypeError. + if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) { + throw webidl.errors.exception({ + header: 'ArrayBuffer', + message: 'SharedArrayBuffer is not allowed.' + }) + } - if (wireType !== 2) { - throw new Error(`protobuf: (PBNode) invalid wireType, expected 2, got ${wireType}`) - } + // 3. If the conversion is not to an IDL type associated + // with the [AllowResizable] extended attribute, and + // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is + // true, then throw a TypeError. + // Note: resizable ArrayBuffers are currently a proposal - if (fieldNum === 1) { - if (data) { - throw new Error('protobuf: (PBNode) duplicate Data section') - } + // 4. Return the IDL DataView value that is a reference + // to the same object as V. + return V +} - [data, index] = decodeBytes(bytes, index) - if (links) { - linksBeforeData = true - } - } else if (fieldNum === 2) { - if (linksBeforeData) { // interleaved Links/Data/Links - throw new Error('protobuf: (PBNode) duplicate Links section') - } else if (!links) { - links = [] - } - let byts - ;[byts, index] = decodeBytes(bytes, index) - links.push(decodeLink(byts)) - } else { - throw new Error(`protobuf: (PBNode) invalid fieldNumber, expected 1 or 2, got ${fieldNum}`) - } +// https://webidl.spec.whatwg.org/#BufferSource +webidl.converters.BufferSource = function (V, opts = {}) { + if (types.isAnyArrayBuffer(V)) { + return webidl.converters.ArrayBuffer(V, opts) } - /* c8 ignore next 3 */ - if (index > l) { - throw new Error('protobuf: (PBNode) unexpected end of data') + if (types.isTypedArray(V)) { + return webidl.converters.TypedArray(V, V.constructor) } - /** @type {RawPBNode} */ - const node = {} - if (data) { - node.Data = data + if (types.isDataView(V)) { + return webidl.converters.DataView(V, opts) } - node.Links = links || [] - return node + + throw new TypeError(`Could not convert ${V} to a BufferSource.`) } -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/src/pb-encode.js -const textEncoder = new TextEncoder() -const maxInt32 = 2 ** 32 -const maxUInt32 = 2 ** 31 +webidl.converters['sequence'] = webidl.sequenceConverter( + webidl.converters.ByteString +) -/** - * @typedef {import('./interface.js').RawPBLink} RawPBLink - */ +webidl.converters['sequence>'] = webidl.sequenceConverter( + webidl.converters['sequence'] +) -/** - * @typedef {import('./interface.js').RawPBNode} RawPBNode - */ +webidl.converters['record'] = webidl.recordConverter( + webidl.converters.ByteString, + webidl.converters.ByteString +) -// the encoders work backward from the end of the bytes array +module.exports = { + webidl +} -/** - * encodeLink() is passed a slice of the parent byte array that ends where this - * link needs to end, so it packs to the right-most part of the passed `bytes` - * - * @param {RawPBLink} link - * @param {Uint8Array} bytes - * @returns {number} - */ -function encodeLink (link, bytes) { - let i = bytes.length - if (typeof link.Tsize === 'number') { - if (link.Tsize < 0) { - throw new Error('Tsize cannot be negative') - } - if (!Number.isSafeInteger(link.Tsize)) { - throw new Error('Tsize too large for encoding') - } - i = encodeVarint(bytes, i, link.Tsize) - 1 - bytes[i] = 0x18 - } +/***/ }), - if (typeof link.Name === 'string') { - const nameBytes = textEncoder.encode(link.Name) - i -= nameBytes.length - bytes.set(nameBytes, i) - i = encodeVarint(bytes, i, nameBytes.length) - 1 - bytes[i] = 0x12 - } +/***/ 69348: +/***/ ((module) => { - if (link.Hash) { - i -= link.Hash.length - bytes.set(link.Hash, i) - i = encodeVarint(bytes, i, link.Hash.length) - 1 - bytes[i] = 0xa - } - return bytes.length - i -} /** - * Encodes a PBNode into a new byte array of precisely the correct size - * - * @param {RawPBNode} node - * @returns {Uint8Array} + * @see https://encoding.spec.whatwg.org/#concept-encoding-get + * @param {string|undefined} label */ -function encodeNode (node) { - const size = sizeNode(node) - const bytes = new Uint8Array(size) - let i = size - - if (node.Data) { - i -= node.Data.length - bytes.set(node.Data, i) - i = encodeVarint(bytes, i, node.Data.length) - 1 - bytes[i] = 0xa +function getEncoding (label) { + if (!label) { + return 'failure' } - if (node.Links) { - for (let index = node.Links.length - 1; index >= 0; index--) { - const size = encodeLink(node.Links[index], bytes.subarray(0, i)) - i -= size - i = encodeVarint(bytes, i, size) - 1 - bytes[i] = 0x12 - } + // 1. Remove any leading and trailing ASCII whitespace from label. + // 2. If label is an ASCII case-insensitive match for any of the + // labels listed in the table below, then return the + // corresponding encoding; otherwise return failure. + switch (label.trim().toLowerCase()) { + case 'unicode-1-1-utf-8': + case 'unicode11utf8': + case 'unicode20utf8': + case 'utf-8': + case 'utf8': + case 'x-unicode20utf8': + return 'UTF-8' + case '866': + case 'cp866': + case 'csibm866': + case 'ibm866': + return 'IBM866' + case 'csisolatin2': + case 'iso-8859-2': + case 'iso-ir-101': + case 'iso8859-2': + case 'iso88592': + case 'iso_8859-2': + case 'iso_8859-2:1987': + case 'l2': + case 'latin2': + return 'ISO-8859-2' + case 'csisolatin3': + case 'iso-8859-3': + case 'iso-ir-109': + case 'iso8859-3': + case 'iso88593': + case 'iso_8859-3': + case 'iso_8859-3:1988': + case 'l3': + case 'latin3': + return 'ISO-8859-3' + case 'csisolatin4': + case 'iso-8859-4': + case 'iso-ir-110': + case 'iso8859-4': + case 'iso88594': + case 'iso_8859-4': + case 'iso_8859-4:1988': + case 'l4': + case 'latin4': + return 'ISO-8859-4' + case 'csisolatincyrillic': + case 'cyrillic': + case 'iso-8859-5': + case 'iso-ir-144': + case 'iso8859-5': + case 'iso88595': + case 'iso_8859-5': + case 'iso_8859-5:1988': + return 'ISO-8859-5' + case 'arabic': + case 'asmo-708': + case 'csiso88596e': + case 'csiso88596i': + case 'csisolatinarabic': + case 'ecma-114': + case 'iso-8859-6': + case 'iso-8859-6-e': + case 'iso-8859-6-i': + case 'iso-ir-127': + case 'iso8859-6': + case 'iso88596': + case 'iso_8859-6': + case 'iso_8859-6:1987': + return 'ISO-8859-6' + case 'csisolatingreek': + case 'ecma-118': + case 'elot_928': + case 'greek': + case 'greek8': + case 'iso-8859-7': + case 'iso-ir-126': + case 'iso8859-7': + case 'iso88597': + case 'iso_8859-7': + case 'iso_8859-7:1987': + case 'sun_eu_greek': + return 'ISO-8859-7' + case 'csiso88598e': + case 'csisolatinhebrew': + case 'hebrew': + case 'iso-8859-8': + case 'iso-8859-8-e': + case 'iso-ir-138': + case 'iso8859-8': + case 'iso88598': + case 'iso_8859-8': + case 'iso_8859-8:1988': + case 'visual': + return 'ISO-8859-8' + case 'csiso88598i': + case 'iso-8859-8-i': + case 'logical': + return 'ISO-8859-8-I' + case 'csisolatin6': + case 'iso-8859-10': + case 'iso-ir-157': + case 'iso8859-10': + case 'iso885910': + case 'l6': + case 'latin6': + return 'ISO-8859-10' + case 'iso-8859-13': + case 'iso8859-13': + case 'iso885913': + return 'ISO-8859-13' + case 'iso-8859-14': + case 'iso8859-14': + case 'iso885914': + return 'ISO-8859-14' + case 'csisolatin9': + case 'iso-8859-15': + case 'iso8859-15': + case 'iso885915': + case 'iso_8859-15': + case 'l9': + return 'ISO-8859-15' + case 'iso-8859-16': + return 'ISO-8859-16' + case 'cskoi8r': + case 'koi': + case 'koi8': + case 'koi8-r': + case 'koi8_r': + return 'KOI8-R' + case 'koi8-ru': + case 'koi8-u': + return 'KOI8-U' + case 'csmacintosh': + case 'mac': + case 'macintosh': + case 'x-mac-roman': + return 'macintosh' + case 'iso-8859-11': + case 'iso8859-11': + case 'iso885911': + case 'tis-620': + case 'windows-874': + return 'windows-874' + case 'cp1250': + case 'windows-1250': + case 'x-cp1250': + return 'windows-1250' + case 'cp1251': + case 'windows-1251': + case 'x-cp1251': + return 'windows-1251' + case 'ansi_x3.4-1968': + case 'ascii': + case 'cp1252': + case 'cp819': + case 'csisolatin1': + case 'ibm819': + case 'iso-8859-1': + case 'iso-ir-100': + case 'iso8859-1': + case 'iso88591': + case 'iso_8859-1': + case 'iso_8859-1:1987': + case 'l1': + case 'latin1': + case 'us-ascii': + case 'windows-1252': + case 'x-cp1252': + return 'windows-1252' + case 'cp1253': + case 'windows-1253': + case 'x-cp1253': + return 'windows-1253' + case 'cp1254': + case 'csisolatin5': + case 'iso-8859-9': + case 'iso-ir-148': + case 'iso8859-9': + case 'iso88599': + case 'iso_8859-9': + case 'iso_8859-9:1989': + case 'l5': + case 'latin5': + case 'windows-1254': + case 'x-cp1254': + return 'windows-1254' + case 'cp1255': + case 'windows-1255': + case 'x-cp1255': + return 'windows-1255' + case 'cp1256': + case 'windows-1256': + case 'x-cp1256': + return 'windows-1256' + case 'cp1257': + case 'windows-1257': + case 'x-cp1257': + return 'windows-1257' + case 'cp1258': + case 'windows-1258': + case 'x-cp1258': + return 'windows-1258' + case 'x-mac-cyrillic': + case 'x-mac-ukrainian': + return 'x-mac-cyrillic' + case 'chinese': + case 'csgb2312': + case 'csiso58gb231280': + case 'gb2312': + case 'gb_2312': + case 'gb_2312-80': + case 'gbk': + case 'iso-ir-58': + case 'x-gbk': + return 'GBK' + case 'gb18030': + return 'gb18030' + case 'big5': + case 'big5-hkscs': + case 'cn-big5': + case 'csbig5': + case 'x-x-big5': + return 'Big5' + case 'cseucpkdfmtjapanese': + case 'euc-jp': + case 'x-euc-jp': + return 'EUC-JP' + case 'csiso2022jp': + case 'iso-2022-jp': + return 'ISO-2022-JP' + case 'csshiftjis': + case 'ms932': + case 'ms_kanji': + case 'shift-jis': + case 'shift_jis': + case 'sjis': + case 'windows-31j': + case 'x-sjis': + return 'Shift_JIS' + case 'cseuckr': + case 'csksc56011987': + case 'euc-kr': + case 'iso-ir-149': + case 'korean': + case 'ks_c_5601-1987': + case 'ks_c_5601-1989': + case 'ksc5601': + case 'ksc_5601': + case 'windows-949': + return 'EUC-KR' + case 'csiso2022kr': + case 'hz-gb-2312': + case 'iso-2022-cn': + case 'iso-2022-cn-ext': + case 'iso-2022-kr': + case 'replacement': + return 'replacement' + case 'unicodefffe': + case 'utf-16be': + return 'UTF-16BE' + case 'csunicode': + case 'iso-10646-ucs-2': + case 'ucs-2': + case 'unicode': + case 'unicodefeff': + case 'utf-16': + case 'utf-16le': + return 'UTF-16LE' + case 'x-user-defined': + return 'x-user-defined' + default: return 'failure' } +} - return bytes +module.exports = { + getEncoding } -/** - * work out exactly how many bytes this link takes up - * - * @param {RawPBLink} link - * @returns - */ -function sizeLink (link) { - let n = 0 - if (link.Hash) { - const l = link.Hash.length - n += 1 + l + sov(l) - } +/***/ }), - if (typeof link.Name === 'string') { - const l = textEncoder.encode(link.Name).length - n += 1 + l + sov(l) - } +/***/ 99701: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (typeof link.Tsize === 'number') { - n += 1 + sov(link.Tsize) - } - return n -} -/** - * Work out exactly how many bytes this node takes up - * - * @param {RawPBNode} node - * @returns {number} - */ -function sizeNode (node) { - let n = 0 +const { + staticPropertyDescriptors, + readOperation, + fireAProgressEvent +} = __nccwpck_require__(2316) +const { + kState, + kError, + kResult, + kEvents, + kAborted +} = __nccwpck_require__(85050) +const { webidl } = __nccwpck_require__(7000) +const { kEnumerableProperty } = __nccwpck_require__(43061) - if (node.Data) { - const l = node.Data.length - n += 1 + l + sov(l) - } +class FileReader extends EventTarget { + constructor () { + super() - if (node.Links) { - for (const link of node.Links) { - const l = sizeLink(link) - n += 1 + l + sov(l) + this[kState] = 'empty' + this[kResult] = null + this[kError] = null + this[kEvents] = { + loadend: null, + error: null, + abort: null, + load: null, + progress: null, + loadstart: null } } - return n -} + /** + * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer + * @param {import('buffer').Blob} blob + */ + readAsArrayBuffer (blob) { + webidl.brandCheck(this, FileReader) -/** - * @param {Uint8Array} bytes - * @param {number} offset - * @param {number} v - * @returns {number} - */ -function encodeVarint (bytes, offset, v) { - offset -= sov(v) - const base = offset + webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' }) - while (v >= maxUInt32) { - bytes[offset++] = (v & 0x7f) | 0x80 - v /= 128 - } + blob = webidl.converters.Blob(blob, { strict: false }) - while (v >= 128) { - bytes[offset++] = (v & 0x7f) | 0x80 - v >>>= 7 + // The readAsArrayBuffer(blob) method, when invoked, + // must initiate a read operation for blob with ArrayBuffer. + readOperation(this, blob, 'ArrayBuffer') } - bytes[offset] = v + /** + * @see https://w3c.github.io/FileAPI/#readAsBinaryString + * @param {import('buffer').Blob} blob + */ + readAsBinaryString (blob) { + webidl.brandCheck(this, FileReader) - return base -} + webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' }) -/** - * size of varint - * - * @param {number} x - * @returns {number} - */ -function sov (x) { - if (x % 2 === 0) { - x++ - } - return Math.floor((len64(x) + 6) / 7) -} + blob = webidl.converters.Blob(blob, { strict: false }) -/** - * golang math/bits, how many bits does it take to represent this integer? - * - * @param {number} x - * @returns {number} - */ -function len64 (x) { - let n = 0 - if (x >= maxInt32) { - x = Math.floor(x / maxInt32) - n = 32 - } - if (x >= (1 << 16)) { - x >>>= 16 - n += 16 - } - if (x >= (1 << 8)) { - x >>>= 8 - n += 8 + // The readAsBinaryString(blob) method, when invoked, + // must initiate a read operation for blob with BinaryString. + readOperation(this, blob, 'BinaryString') } - return n + len8tab[x] -} - -// golang math/bits -const len8tab = [ - 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 -] - -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/src/util.js + /** + * @see https://w3c.github.io/FileAPI/#readAsDataText + * @param {import('buffer').Blob} blob + * @param {string?} encoding + */ + readAsText (blob, encoding = undefined) { + webidl.brandCheck(this, FileReader) -/** - * @typedef {import('./interface.js').PBLink} PBLink - * @typedef {import('./interface.js').PBNode} PBNode - */ + webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' }) -const pbNodeProperties = ['Data', 'Links'] -const pbLinkProperties = ['Hash', 'Name', 'Tsize'] + blob = webidl.converters.Blob(blob, { strict: false }) -const util_textEncoder = new TextEncoder() + if (encoding !== undefined) { + encoding = webidl.converters.DOMString(encoding) + } -/** - * @param {PBLink} a - * @param {PBLink} b - * @returns {number} - */ -function linkComparator (a, b) { - if (a === b) { - return 0 + // The readAsText(blob, encoding) method, when invoked, + // must initiate a read operation for blob with Text and encoding. + readOperation(this, blob, 'Text', encoding) } - const abuf = a.Name ? util_textEncoder.encode(a.Name) : [] - const bbuf = b.Name ? util_textEncoder.encode(b.Name) : [] + /** + * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL + * @param {import('buffer').Blob} blob + */ + readAsDataURL (blob) { + webidl.brandCheck(this, FileReader) - let x = abuf.length - let y = bbuf.length + webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' }) - for (let i = 0, len = Math.min(x, y); i < len; ++i) { - if (abuf[i] !== bbuf[i]) { - x = abuf[i] - y = bbuf[i] - break - } - } + blob = webidl.converters.Blob(blob, { strict: false }) - return x < y ? -1 : y < x ? 1 : 0 -} + // The readAsDataURL(blob) method, when invoked, must + // initiate a read operation for blob with DataURL. + readOperation(this, blob, 'DataURL') + } -/** - * @param {any} node - * @param {string[]} properties - * @returns {boolean} - */ -function hasOnlyProperties (node, properties) { - return !Object.keys(node).some((p) => !properties.includes(p)) -} + /** + * @see https://w3c.github.io/FileAPI/#dfn-abort + */ + abort () { + // 1. If this's state is "empty" or if this's state is + // "done" set this's result to null and terminate + // this algorithm. + if (this[kState] === 'empty' || this[kState] === 'done') { + this[kResult] = null + return + } -/** - * Converts a CID, or a PBLink-like object to a PBLink - * - * @param {any} link - * @returns {PBLink} - */ -function asLink (link) { - if (typeof link.asCID === 'object') { - const Hash = cid_CID.asCID(link) - if (!Hash) { - throw new TypeError('Invalid DAG-PB form') + // 2. If this's state is "loading" set this's state to + // "done" and set this's result to null. + if (this[kState] === 'loading') { + this[kState] = 'done' + this[kResult] = null } - return { Hash } - } - if (typeof link !== 'object' || Array.isArray(link)) { - throw new TypeError('Invalid DAG-PB form') - } + // 3. If there are any tasks from this on the file reading + // task source in an affiliated task queue, then remove + // those tasks from that task queue. + this[kAborted] = true - const pbl = {} + // 4. Terminate the algorithm for the read method being processed. + // TODO - if (link.Hash) { - let cid = cid_CID.asCID(link.Hash) - try { - if (!cid) { - if (typeof link.Hash === 'string') { - cid = cid_CID.parse(link.Hash) - } else if (link.Hash instanceof Uint8Array) { - cid = cid_CID.decode(link.Hash) - } - } - } catch (/** @type {any} */ e) { - throw new TypeError(`Invalid DAG-PB form: ${e.message}`) - } + // 5. Fire a progress event called abort at this. + fireAProgressEvent('abort', this) - if (cid) { - pbl.Hash = cid + // 6. If this's state is not "loading", fire a progress + // event called loadend at this. + if (this[kState] !== 'loading') { + fireAProgressEvent('loadend', this) } } - if (!pbl.Hash) { - throw new TypeError('Invalid DAG-PB form') - } + /** + * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate + */ + get readyState () { + webidl.brandCheck(this, FileReader) - if (typeof link.Name === 'string') { - pbl.Name = link.Name + switch (this[kState]) { + case 'empty': return this.EMPTY + case 'loading': return this.LOADING + case 'done': return this.DONE + } } - if (typeof link.Tsize === 'number') { - pbl.Tsize = link.Tsize + /** + * @see https://w3c.github.io/FileAPI/#dom-filereader-result + */ + get result () { + webidl.brandCheck(this, FileReader) + + // The result attribute’s getter, when invoked, must return + // this's result. + return this[kResult] } - return pbl -} + /** + * @see https://w3c.github.io/FileAPI/#dom-filereader-error + */ + get error () { + webidl.brandCheck(this, FileReader) -/** - * @param {any} node - * @returns {PBNode} - */ -function prepare (node) { - if (node instanceof Uint8Array || typeof node === 'string') { - node = { Data: node } + // The error attribute’s getter, when invoked, must return + // this's error. + return this[kError] } - if (typeof node !== 'object' || Array.isArray(node)) { - throw new TypeError('Invalid DAG-PB form') + get onloadend () { + webidl.brandCheck(this, FileReader) + + return this[kEvents].loadend } - /** @type {PBNode} */ - const pbn = {} + set onloadend (fn) { + webidl.brandCheck(this, FileReader) - if (node.Data !== undefined) { - if (typeof node.Data === 'string') { - pbn.Data = util_textEncoder.encode(node.Data) - } else if (node.Data instanceof Uint8Array) { - pbn.Data = node.Data - } else { - throw new TypeError('Invalid DAG-PB form') + if (this[kEvents].loadend) { + this.removeEventListener('loadend', this[kEvents].loadend) } - } - if (node.Links !== undefined) { - if (Array.isArray(node.Links)) { - pbn.Links = node.Links.map(asLink) - pbn.Links.sort(linkComparator) + if (typeof fn === 'function') { + this[kEvents].loadend = fn + this.addEventListener('loadend', fn) } else { - throw new TypeError('Invalid DAG-PB form') + this[kEvents].loadend = null } - } else { - pbn.Links = [] } - return pbn -} + get onerror () { + webidl.brandCheck(this, FileReader) -/** - * @param {PBNode} node - */ -function validate (node) { - /* - type PBLink struct { - Hash optional Link - Name optional String - Tsize optional Int + return this[kEvents].error } - type PBNode struct { - Links [PBLink] - Data optional Bytes - } - */ - // @ts-ignore private property for TS - if (!node || typeof node !== 'object' || Array.isArray(node) || node instanceof Uint8Array || (node['/'] && node['/'] === node.bytes)) { - throw new TypeError('Invalid DAG-PB form') - } + set onerror (fn) { + webidl.brandCheck(this, FileReader) - if (!hasOnlyProperties(node, pbNodeProperties)) { - throw new TypeError('Invalid DAG-PB form (extraneous properties)') - } + if (this[kEvents].error) { + this.removeEventListener('error', this[kEvents].error) + } - if (node.Data !== undefined && !(node.Data instanceof Uint8Array)) { - throw new TypeError('Invalid DAG-PB form (Data must be bytes)') + if (typeof fn === 'function') { + this[kEvents].error = fn + this.addEventListener('error', fn) + } else { + this[kEvents].error = null + } } - if (!Array.isArray(node.Links)) { - throw new TypeError('Invalid DAG-PB form (Links must be a list)') + get onloadstart () { + webidl.brandCheck(this, FileReader) + + return this[kEvents].loadstart } - for (let i = 0; i < node.Links.length; i++) { - const link = node.Links[i] - // @ts-ignore private property for TS - if (!link || typeof link !== 'object' || Array.isArray(link) || link instanceof Uint8Array || (link['/'] && link['/'] === link.bytes)) { - throw new TypeError('Invalid DAG-PB form (bad link)') - } + set onloadstart (fn) { + webidl.brandCheck(this, FileReader) - if (!hasOnlyProperties(link, pbLinkProperties)) { - throw new TypeError('Invalid DAG-PB form (extraneous properties on link)') + if (this[kEvents].loadstart) { + this.removeEventListener('loadstart', this[kEvents].loadstart) } - if (link.Hash === undefined) { - throw new TypeError('Invalid DAG-PB form (link must have a Hash)') + if (typeof fn === 'function') { + this[kEvents].loadstart = fn + this.addEventListener('loadstart', fn) + } else { + this[kEvents].loadstart = null } + } - // @ts-ignore private property for TS - if (link.Hash == null || !link.Hash['/'] || link.Hash['/'] !== link.Hash.bytes) { - throw new TypeError('Invalid DAG-PB form (link Hash must be a CID)') - } + get onprogress () { + webidl.brandCheck(this, FileReader) - if (link.Name !== undefined && typeof link.Name !== 'string') { - throw new TypeError('Invalid DAG-PB form (link Name must be a string)') - } + return this[kEvents].progress + } - if (link.Tsize !== undefined) { - if (typeof link.Tsize !== 'number' || link.Tsize % 1 !== 0) { - throw new TypeError('Invalid DAG-PB form (link Tsize must be an integer)') - } - if (link.Tsize < 0) { - throw new TypeError('Invalid DAG-PB form (link Tsize cannot be negative)') - } + set onprogress (fn) { + webidl.brandCheck(this, FileReader) + + if (this[kEvents].progress) { + this.removeEventListener('progress', this[kEvents].progress) } - if (i > 0 && linkComparator(link, node.Links[i - 1]) === -1) { - throw new TypeError('Invalid DAG-PB form (links must be sorted by Name bytes)') + if (typeof fn === 'function') { + this[kEvents].progress = fn + this.addEventListener('progress', fn) + } else { + this[kEvents].progress = null } } -} - -/** - * @param {Uint8Array} data - * @param {PBLink[]} [links=[]] - * @returns {PBNode} - */ -function createNode (data, links = []) { - return prepare({ Data: data, Links: links }) -} - -/** - * @param {string} name - * @param {number} size - * @param {CID} cid - * @returns {PBLink} - */ -function createLink (name, size, cid) { - return asLink({ Hash: cid, Name: name, Tsize: size }) -} -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/src/index.js + get onload () { + webidl.brandCheck(this, FileReader) + return this[kEvents].load + } + set onload (fn) { + webidl.brandCheck(this, FileReader) + if (this[kEvents].load) { + this.removeEventListener('load', this[kEvents].load) + } + if (typeof fn === 'function') { + this[kEvents].load = fn + this.addEventListener('load', fn) + } else { + this[kEvents].load = null + } + } -/** - * @template T - * @typedef {import('multiformats/codecs/interface').ByteView} ByteView - */ + get onabort () { + webidl.brandCheck(this, FileReader) -/** - * @typedef {import('./interface.js').PBLink} PBLink - * @typedef {import('./interface.js').PBNode} PBNode - */ + return this[kEvents].abort + } -const src_name = 'dag-pb' -const code = 0x70 + set onabort (fn) { + webidl.brandCheck(this, FileReader) -/** - * @param {PBNode} node - * @returns {ByteView} - */ -function src_encode (node) { - validate(node) + if (this[kEvents].abort) { + this.removeEventListener('abort', this[kEvents].abort) + } - const pbn = {} - if (node.Links) { - pbn.Links = node.Links.map((l) => { - const link = {} - if (l.Hash) { - link.Hash = l.Hash.bytes // cid -> bytes - } - if (l.Name !== undefined) { - link.Name = l.Name - } - if (l.Tsize !== undefined) { - link.Tsize = l.Tsize - } - return link - }) - } - if (node.Data) { - pbn.Data = node.Data + if (typeof fn === 'function') { + this[kEvents].abort = fn + this.addEventListener('abort', fn) + } else { + this[kEvents].abort = null + } } - - return encodeNode(pbn) } -/** - * @param {ByteView} bytes - * @returns {PBNode} - */ -function src_decode (bytes) { - const pbn = decodeNode(bytes) - - const node = {} +// https://w3c.github.io/FileAPI/#dom-filereader-empty +FileReader.EMPTY = FileReader.prototype.EMPTY = 0 +// https://w3c.github.io/FileAPI/#dom-filereader-loading +FileReader.LOADING = FileReader.prototype.LOADING = 1 +// https://w3c.github.io/FileAPI/#dom-filereader-done +FileReader.DONE = FileReader.prototype.DONE = 2 - if (pbn.Data) { - node.Data = pbn.Data +Object.defineProperties(FileReader.prototype, { + EMPTY: staticPropertyDescriptors, + LOADING: staticPropertyDescriptors, + DONE: staticPropertyDescriptors, + readAsArrayBuffer: kEnumerableProperty, + readAsBinaryString: kEnumerableProperty, + readAsText: kEnumerableProperty, + readAsDataURL: kEnumerableProperty, + abort: kEnumerableProperty, + readyState: kEnumerableProperty, + result: kEnumerableProperty, + error: kEnumerableProperty, + onloadstart: kEnumerableProperty, + onprogress: kEnumerableProperty, + onload: kEnumerableProperty, + onabort: kEnumerableProperty, + onerror: kEnumerableProperty, + onloadend: kEnumerableProperty, + [Symbol.toStringTag]: { + value: 'FileReader', + writable: false, + enumerable: false, + configurable: true } +}) - if (pbn.Links) { - node.Links = pbn.Links.map((l) => { - const link = {} - try { - link.Hash = cid_CID.decode(l.Hash) - } catch (e) {} - if (!link.Hash) { - throw new Error('Invalid Hash field found in link, expected CID') - } - if (l.Name !== undefined) { - link.Name = l.Name - } - if (l.Tsize !== undefined) { - link.Tsize = l.Tsize - } - return link - }) - } +Object.defineProperties(FileReader, { + EMPTY: staticPropertyDescriptors, + LOADING: staticPropertyDescriptors, + DONE: staticPropertyDescriptors +}) - return node +module.exports = { + FileReader } +/***/ }), + +/***/ 66045: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + -;// CONCATENATED MODULE: ./node_modules/cborg/lib/is.js -// This is an unfortunate replacement for @sindresorhus/is that we need to -// re-implement for performance purposes. In particular the is.observable() -// check is expensive, and unnecessary for our purposes. The values returned -// are compatible with @sindresorhus/is, however. -const typeofs = [ - 'string', - 'number', - 'bigint', - 'symbol' -] +const { webidl } = __nccwpck_require__(7000) -const objectTypeNames = [ - 'Function', - 'Generator', - 'AsyncGenerator', - 'GeneratorFunction', - 'AsyncGeneratorFunction', - 'AsyncFunction', - 'Observable', - 'Array', - 'Buffer', - 'Object', - 'RegExp', - 'Date', - 'Error', - 'Map', - 'Set', - 'WeakMap', - 'WeakSet', - 'ArrayBuffer', - 'SharedArrayBuffer', - 'DataView', - 'Promise', - 'URL', - 'HTMLElement', - 'Int8Array', - 'Uint8Array', - 'Uint8ClampedArray', - 'Int16Array', - 'Uint16Array', - 'Int32Array', - 'Uint32Array', - 'Float32Array', - 'Float64Array', - 'BigInt64Array', - 'BigUint64Array' -] +const kState = Symbol('ProgressEvent state') /** - * @param {any} value - * @returns {string} + * @see https://xhr.spec.whatwg.org/#progressevent */ -function is (value) { - if (value === null) { - return 'null' - } - if (value === undefined) { - return 'undefined' - } - if (value === true || value === false) { - return 'boolean' - } - const typeOf = typeof value - if (typeofs.includes(typeOf)) { - return typeOf - } - /* c8 ignore next 4 */ - // not going to bother testing this, it's not going to be valid anyway - if (typeOf === 'function') { - return 'Function' - } - if (Array.isArray(value)) { - return 'Array' - } - if (isBuffer(value)) { - return 'Buffer' - } - const objectType = getObjectType(value) - if (objectType) { - return objectType +class ProgressEvent extends Event { + constructor (type, eventInitDict = {}) { + type = webidl.converters.DOMString(type) + eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {}) + + super(type, eventInitDict) + + this[kState] = { + lengthComputable: eventInitDict.lengthComputable, + loaded: eventInitDict.loaded, + total: eventInitDict.total + } } - /* c8 ignore next */ - return 'Object' -} -/** - * @param {any} value - * @returns {boolean} - */ -function isBuffer (value) { - return value && value.constructor && value.constructor.isBuffer && value.constructor.isBuffer.call(null, value) -} + get lengthComputable () { + webidl.brandCheck(this, ProgressEvent) -/** - * @param {any} value - * @returns {string|undefined} - */ -function getObjectType (value) { - const objectTypeName = Object.prototype.toString.call(value).slice(8, -1) - if (objectTypeNames.includes(objectTypeName)) { - return objectTypeName + return this[kState].lengthComputable } - /* c8 ignore next */ - return undefined -} -;// CONCATENATED MODULE: ./node_modules/cborg/lib/token.js -class token_Type { - /** - * @param {number} major - * @param {string} name - * @param {boolean} terminal - */ - constructor (major, name, terminal) { - this.major = major - this.majorEncoded = major << 5 - this.name = name - this.terminal = terminal + get loaded () { + webidl.brandCheck(this, ProgressEvent) + + return this[kState].loaded } - /* c8 ignore next 3 */ - toString () { - return `Type[${this.major}].${this.name}` + get total () { + webidl.brandCheck(this, ProgressEvent) + + return this[kState].total } +} - /** - * @param {Type} typ - * @returns {number} - */ - compare (typ) { - /* c8 ignore next 1 */ - return this.major < typ.major ? -1 : this.major > typ.major ? 1 : 0 +webidl.converters.ProgressEventInit = webidl.dictionaryConverter([ + { + key: 'lengthComputable', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'loaded', + converter: webidl.converters['unsigned long long'], + defaultValue: 0 + }, + { + key: 'total', + converter: webidl.converters['unsigned long long'], + defaultValue: 0 + }, + { + key: 'bubbles', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'cancelable', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'composed', + converter: webidl.converters.boolean, + defaultValue: false } +]) + +module.exports = { + ProgressEvent } -// convert to static fields when better supported -token_Type.uint = new token_Type(0, 'uint', true) -token_Type.negint = new token_Type(1, 'negint', true) -token_Type.bytes = new token_Type(2, 'bytes', true) -token_Type.string = new token_Type(3, 'string', true) -token_Type.array = new token_Type(4, 'array', false) -token_Type.map = new token_Type(5, 'map', false) -token_Type.tag = new token_Type(6, 'tag', false) // terminal? -token_Type.float = new token_Type(7, 'float', true) -token_Type.false = new token_Type(7, 'false', true) -token_Type.true = new token_Type(7, 'true', true) -token_Type.null = new token_Type(7, 'null', true) -token_Type.undefined = new token_Type(7, 'undefined', true) -token_Type.break = new token_Type(7, 'break', true) -// Type.indefiniteLength = new Type(0, 'indefiniteLength', true) -class token_Token { - /** - * @param {Type} type - * @param {any} [value] - * @param {number} [encodedLength] - */ - constructor (type, value, encodedLength) { - this.type = type - this.value = value - this.encodedLength = encodedLength - /** @type {Uint8Array|undefined} */ - this.encodedBytes = undefined - /** @type {Uint8Array|undefined} */ - this.byteValue = undefined - } +/***/ }), - /* c8 ignore next 3 */ - toString () { - return `Token[${this.type}].${this.value}` - } +/***/ 85050: +/***/ ((module) => { + + + +module.exports = { + kState: Symbol('FileReader state'), + kResult: Symbol('FileReader result'), + kError: Symbol('FileReader error'), + kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'), + kEvents: Symbol('FileReader events'), + kAborted: Symbol('FileReader aborted') } +/***/ }), -;// CONCATENATED MODULE: ./node_modules/cborg/lib/byte-utils.js -// Use Uint8Array directly in the browser, use Buffer in Node.js but don't -// speak its name directly to avoid bundlers pulling in the `Buffer` polyfill +/***/ 2316: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// @ts-ignore -const useBuffer = globalThis.process && - // @ts-ignore - !globalThis.process.browser && - // @ts-ignore - globalThis.Buffer && - // @ts-ignore - typeof globalThis.Buffer.isBuffer === 'function' -const byte_utils_textDecoder = new TextDecoder() -const byte_utils_textEncoder = new TextEncoder() -/** - * @param {Uint8Array} buf - * @returns {boolean} - */ -function byte_utils_isBuffer (buf) { - // @ts-ignore - return useBuffer && globalThis.Buffer.isBuffer(buf) +const { + kState, + kError, + kResult, + kAborted, + kLastProgressEventFired +} = __nccwpck_require__(85050) +const { ProgressEvent } = __nccwpck_require__(66045) +const { getEncoding } = __nccwpck_require__(69348) +const { DOMException } = __nccwpck_require__(20075) +const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(16306) +const { types } = __nccwpck_require__(73837) +const { StringDecoder } = __nccwpck_require__(71576) +const { btoa } = __nccwpck_require__(14300) + +/** @type {PropertyDescriptor} */ +const staticPropertyDescriptors = { + enumerable: true, + writable: false, + configurable: false } /** - * @param {Uint8Array|number[]} buf - * @returns {Uint8Array} + * @see https://w3c.github.io/FileAPI/#readOperation + * @param {import('./filereader').FileReader} fr + * @param {import('buffer').Blob} blob + * @param {string} type + * @param {string?} encodingName */ -function asU8A (buf) { - /* c8 ignore next */ - if (!(buf instanceof Uint8Array)) { - return Uint8Array.from(buf) +function readOperation (fr, blob, type, encodingName) { + // 1. If fr’s state is "loading", throw an InvalidStateError + // DOMException. + if (fr[kState] === 'loading') { + throw new DOMException('Invalid state', 'InvalidStateError') } - return byte_utils_isBuffer(buf) ? new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength) : buf -} -const byte_utils_toString = useBuffer - ? // eslint-disable-line operator-linebreak - /** - * @param {Uint8Array} bytes - * @param {number} start - * @param {number} end - */ - (bytes, start, end) => { - return end - start > 64 - ? // eslint-disable-line operator-linebreak - // @ts-ignore - globalThis.Buffer.from(bytes.subarray(start, end)).toString('utf8') - : utf8Slice(bytes, start, end) - } - /* c8 ignore next 11 */ - : // eslint-disable-line operator-linebreak - /** - * @param {Uint8Array} bytes - * @param {number} start - * @param {number} end - */ - (bytes, start, end) => { - return end - start > 64 - ? byte_utils_textDecoder.decode(bytes.subarray(start, end)) - : utf8Slice(bytes, start, end) - } + // 2. Set fr’s state to "loading". + fr[kState] = 'loading' -const byte_utils_fromString = useBuffer - ? // eslint-disable-line operator-linebreak - /** - * @param {string} string - */ - (string) => { - return string.length > 64 - ? // eslint-disable-line operator-linebreak - // @ts-ignore - globalThis.Buffer.from(string) - : utf8ToBytes(string) - } - /* c8 ignore next 7 */ - : // eslint-disable-line operator-linebreak - /** - * @param {string} string - */ - (string) => { - return string.length > 64 ? byte_utils_textEncoder.encode(string) : utf8ToBytes(string) - } + // 3. Set fr’s result to null. + fr[kResult] = null -/** - * Buffer variant not fast enough for what we need - * @param {number[]} arr - * @returns {Uint8Array} - */ -const fromArray = (arr) => { - return Uint8Array.from(arr) -} + // 4. Set fr’s error to null. + fr[kError] = null -const slice = useBuffer - ? // eslint-disable-line operator-linebreak - /** - * @param {Uint8Array} bytes - * @param {number} start - * @param {number} end - */ - (bytes, start, end) => { - if (byte_utils_isBuffer(bytes)) { - return new Uint8Array(bytes.subarray(start, end)) - } - return bytes.slice(start, end) - } - /* c8 ignore next 9 */ - : // eslint-disable-line operator-linebreak - /** - * @param {Uint8Array} bytes - * @param {number} start - * @param {number} end - */ - (bytes, start, end) => { - return bytes.slice(start, end) - } + // 5. Let stream be the result of calling get stream on blob. + /** @type {import('stream/web').ReadableStream} */ + const stream = blob.stream() -const concat = useBuffer - ? // eslint-disable-line operator-linebreak - /** - * @param {Uint8Array[]} chunks - * @param {number} length - * @returns {Uint8Array} - */ - (chunks, length) => { - // might get a stray plain Array here - /* c8 ignore next 1 */ - chunks = chunks.map((c) => c instanceof Uint8Array - ? c - // this case is occasionally missed during test runs so becomes coverage-flaky - /* c8 ignore next 4 */ - : // eslint-disable-line operator-linebreak - // @ts-ignore - globalThis.Buffer.from(c)) - // @ts-ignore - return asU8A(globalThis.Buffer.concat(chunks, length)) - } - /* c8 ignore next 19 */ - : // eslint-disable-line operator-linebreak - /** - * @param {Uint8Array[]} chunks - * @param {number} length - * @returns {Uint8Array} - */ - (chunks, length) => { - const out = new Uint8Array(length) - let off = 0 - for (let b of chunks) { - if (off + b.length > out.length) { - // final chunk that's bigger than we need - b = b.subarray(0, out.length - off) + // 6. Let reader be the result of getting a reader from stream. + const reader = stream.getReader() + + // 7. Let bytes be an empty byte sequence. + /** @type {Uint8Array[]} */ + const bytes = [] + + // 8. Let chunkPromise be the result of reading a chunk from + // stream with reader. + let chunkPromise = reader.read() + + // 9. Let isFirstChunk be true. + let isFirstChunk = true + + // 10. In parallel, while true: + // Note: "In parallel" just means non-blocking + // Note 2: readOperation itself cannot be async as double + // reading the body would then reject the promise, instead + // of throwing an error. + ;(async () => { + while (!fr[kAborted]) { + // 1. Wait for chunkPromise to be fulfilled or rejected. + try { + const { done, value } = await chunkPromise + + // 2. If chunkPromise is fulfilled, and isFirstChunk is + // true, queue a task to fire a progress event called + // loadstart at fr. + if (isFirstChunk && !fr[kAborted]) { + queueMicrotask(() => { + fireAProgressEvent('loadstart', fr) + }) } - out.set(b, off) - off += b.length - } - return out - } -const alloc = useBuffer - ? // eslint-disable-line operator-linebreak - /** - * @param {number} size - * @returns {Uint8Array} - */ - (size) => { - // we always write over the contents we expose so this should be safe - // @ts-ignore - return globalThis.Buffer.allocUnsafe(size) - } - /* c8 ignore next 8 */ - : // eslint-disable-line operator-linebreak - /** - * @param {number} size - * @returns {Uint8Array} - */ - (size) => { - return new Uint8Array(size) - } + // 3. Set isFirstChunk to false. + isFirstChunk = false -const byte_utils_toHex = (/* unused pure expression or super */ null && (useBuffer - ? // eslint-disable-line operator-linebreak - /** - * @param {Uint8Array} d - * @returns {string} - */ - (d) => { - if (typeof d === 'string') { - return d - } - // @ts-ignore - return globalThis.Buffer.from(toBytes(d)).toString('hex') - } - /* c8 ignore next 12 */ - : // eslint-disable-line operator-linebreak - /** - * @param {Uint8Array} d - * @returns {string} - */ - (d) => { - if (typeof d === 'string') { - return d - } - // @ts-ignore not smart enough to figure this out - return Array.prototype.reduce.call(toBytes(d), (p, c) => `${p}${c.toString(16).padStart(2, '0')}`, '') - })) + // 4. If chunkPromise is fulfilled with an object whose + // done property is false and whose value property is + // a Uint8Array object, run these steps: + if (!done && types.isUint8Array(value)) { + // 1. Let bs be the byte sequence represented by the + // Uint8Array object. -const byte_utils_fromHex = (/* unused pure expression or super */ null && (useBuffer - ? // eslint-disable-line operator-linebreak - /** - * @param {string|Uint8Array} hex - * @returns {Uint8Array} - */ - (hex) => { - if (hex instanceof Uint8Array) { - return hex - } - // @ts-ignore - return globalThis.Buffer.from(hex, 'hex') - } - /* c8 ignore next 17 */ - : // eslint-disable-line operator-linebreak - /** - * @param {string|Uint8Array} hex - * @returns {Uint8Array} - */ - (hex) => { - if (hex instanceof Uint8Array) { - return hex - } - if (!hex.length) { - return new Uint8Array(0) - } - return new Uint8Array(hex.split('') - .map((/** @type {string} */ c, /** @type {number} */ i, /** @type {string[]} */ d) => i % 2 === 0 ? `0x${c}${d[i + 1]}` : '') - .filter(Boolean) - .map((/** @type {string} */ e) => parseInt(e, 16))) - })) + // 2. Append bs to bytes. + bytes.push(value) -/** - * @param {Uint8Array|ArrayBuffer|ArrayBufferView} obj - * @returns {Uint8Array} - */ -function toBytes (obj) { - if (obj instanceof Uint8Array && obj.constructor.name === 'Uint8Array') { - return obj - } - if (obj instanceof ArrayBuffer) { - return new Uint8Array(obj) - } - if (ArrayBuffer.isView(obj)) { - return new Uint8Array(obj.buffer, obj.byteOffset, obj.byteLength) - } - /* c8 ignore next */ - throw new Error('Unknown type, must be binary type') -} + // 3. If roughly 50ms have passed since these steps + // were last invoked, queue a task to fire a + // progress event called progress at fr. + if ( + ( + fr[kLastProgressEventFired] === undefined || + Date.now() - fr[kLastProgressEventFired] >= 50 + ) && + !fr[kAborted] + ) { + fr[kLastProgressEventFired] = Date.now() + queueMicrotask(() => { + fireAProgressEvent('progress', fr) + }) + } -/** - * @param {Uint8Array} b1 - * @param {Uint8Array} b2 - * @returns {number} - */ -function compare (b1, b2) { - /* c8 ignore next 5 */ - if (byte_utils_isBuffer(b1) && byte_utils_isBuffer(b2)) { - // probably not possible to get here in the current API - // @ts-ignore Buffer - return b1.compare(b2) - } - for (let i = 0; i < b1.length; i++) { - if (b1[i] === b2[i]) { - continue - } - return b1[i] < b2[i] ? -1 : 1 - } /* c8 ignore next 3 */ - return 0 -} + // 4. Set chunkPromise to the result of reading a + // chunk from stream with reader. + chunkPromise = reader.read() + } else if (done) { + // 5. Otherwise, if chunkPromise is fulfilled with an + // object whose done property is true, queue a task + // to run the following steps and abort this algorithm: + queueMicrotask(() => { + // 1. Set fr’s state to "done". + fr[kState] = 'done' -// The below code is taken from https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143 -// Licensed Apache-2.0. + // 2. Let result be the result of package data given + // bytes, type, blob’s type, and encodingName. + try { + const result = packageData(bytes, type, blob.type, encodingName) -/** - * @param {string} str - * @returns {number[]} - */ -function utf8ToBytes (str) { - const out = [] - let p = 0 - for (let i = 0; i < str.length; i++) { - let c = str.charCodeAt(i) - if (c < 128) { - out[p++] = c - } else if (c < 2048) { - out[p++] = (c >> 6) | 192 - out[p++] = (c & 63) | 128 - } else if ( - ((c & 0xFC00) === 0xD800) && (i + 1) < str.length && - ((str.charCodeAt(i + 1) & 0xFC00) === 0xDC00)) { - // Surrogate Pair - c = 0x10000 + ((c & 0x03FF) << 10) + (str.charCodeAt(++i) & 0x03FF) - out[p++] = (c >> 18) | 240 - out[p++] = ((c >> 12) & 63) | 128 - out[p++] = ((c >> 6) & 63) | 128 - out[p++] = (c & 63) | 128 - } else { - out[p++] = (c >> 12) | 224 - out[p++] = ((c >> 6) & 63) | 128 - out[p++] = (c & 63) | 128 - } - } - return out -} + // 4. Else: -// The below code is mostly taken from https://github.com/feross/buffer -// Licensed MIT. Copyright (c) Feross Aboukhadijeh + if (fr[kAborted]) { + return + } -/** - * @param {Uint8Array} buf - * @param {number} offset - * @param {number} end - * @returns {string} - */ -function utf8Slice (buf, offset, end) { - const res = [] + // 1. Set fr’s result to result. + fr[kResult] = result - while (offset < end) { - const firstByte = buf[offset] - let codePoint = null - let bytesPerSequence = (firstByte > 0xef) ? 4 : (firstByte > 0xdf) ? 3 : (firstByte > 0xbf) ? 2 : 1 + // 2. Fire a progress event called load at the fr. + fireAProgressEvent('load', fr) + } catch (error) { + // 3. If package data threw an exception error: - if (offset + bytesPerSequence <= end) { - let secondByte, thirdByte, fourthByte, tempCodePoint + // 1. Set fr’s error to error. + fr[kError] = error - switch (bytesPerSequence) { - case 1: - if (firstByte < 0x80) { - codePoint = firstByte - } - break - case 2: - secondByte = buf[offset + 1] - if ((secondByte & 0xc0) === 0x80) { - tempCodePoint = (firstByte & 0x1f) << 0x6 | (secondByte & 0x3f) - if (tempCodePoint > 0x7f) { - codePoint = tempCodePoint + // 2. Fire a progress event called error at fr. + fireAProgressEvent('error', fr) } - } - break - case 3: - secondByte = buf[offset + 1] - thirdByte = buf[offset + 2] - if ((secondByte & 0xc0) === 0x80 && (thirdByte & 0xc0) === 0x80) { - tempCodePoint = (firstByte & 0xf) << 0xc | (secondByte & 0x3f) << 0x6 | (thirdByte & 0x3f) - /* c8 ignore next 3 */ - if (tempCodePoint > 0x7ff && (tempCodePoint < 0xd800 || tempCodePoint > 0xdfff)) { - codePoint = tempCodePoint + + // 5. If fr’s state is not "loading", fire a progress + // event called loadend at the fr. + if (fr[kState] !== 'loading') { + fireAProgressEvent('loadend', fr) } - } + }) + break - case 4: - secondByte = buf[offset + 1] - thirdByte = buf[offset + 2] - fourthByte = buf[offset + 3] - if ((secondByte & 0xc0) === 0x80 && (thirdByte & 0xc0) === 0x80 && (fourthByte & 0xc0) === 0x80) { - tempCodePoint = (firstByte & 0xf) << 0x12 | (secondByte & 0x3f) << 0xc | (thirdByte & 0x3f) << 0x6 | (fourthByte & 0x3f) - if (tempCodePoint > 0xffff && tempCodePoint < 0x110000) { - codePoint = tempCodePoint - } - } - } - } + } + } catch (error) { + if (fr[kAborted]) { + return + } - /* c8 ignore next 5 */ - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 0xfffd - bytesPerSequence = 1 - } else if (codePoint > 0xffff) { - // encode to utf16 (surrogate pair dance) - codePoint -= 0x10000 - res.push(codePoint >>> 10 & 0x3ff | 0xd800) - codePoint = 0xdc00 | codePoint & 0x3ff - } + // 6. Otherwise, if chunkPromise is rejected with an + // error error, queue a task to run the following + // steps and abort this algorithm: + queueMicrotask(() => { + // 1. Set fr’s state to "done". + fr[kState] = 'done' - res.push(codePoint) - offset += bytesPerSequence - } + // 2. Set fr’s error to error. + fr[kError] = error - return decodeCodePointsArray(res) -} + // 3. Fire a progress event called error at fr. + fireAProgressEvent('error', fr) -// Based on http://stackoverflow.com/a/22747272/680742, the browser with -// the lowest limit is Chrome, with 0x10000 args. -// We go 1 magnitude less, for safety -const MAX_ARGUMENTS_LENGTH = 0x1000 + // 4. If fr’s state is not "loading", fire a progress + // event called loadend at fr. + if (fr[kState] !== 'loading') { + fireAProgressEvent('loadend', fr) + } + }) -/** - * @param {number[]} codePoints - * @returns {string} - */ -function decodeCodePointsArray (codePoints) { - const len = codePoints.length - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints) // avoid extra slice() - } - /* c8 ignore next 10 */ - // Decode in chunks to avoid "call stack size exceeded". - let res = '' - let i = 0 - while (i < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) - ) - } - return res + break + } + } + })() } -;// CONCATENATED MODULE: ./node_modules/cborg/lib/bl.js /** - * Bl is a list of byte chunks, similar to https://github.com/rvagg/bl but for - * writing rather than reading. - * A Bl object accepts set() operations for individual bytes and copyTo() for - * inserting byte arrays. These write operations don't automatically increment - * the internal cursor so its "length" won't be changed. Instead, increment() - * must be called to extend its length to cover the inserted data. - * The toBytes() call will convert all internal memory to a single Uint8Array of - * the correct length, truncating any data that is stored but hasn't been - * included by an increment(). - * get() can retrieve a single byte. - * All operations (except toBytes()) take an "offset" argument that will perform - * the write at the offset _from the current cursor_. For most operations this - * will be `0` to write at the current cursor position but it can be ahead of - * the current cursor. Negative offsets probably work but are untested. + * @see https://w3c.github.io/FileAPI/#fire-a-progress-event + * @see https://dom.spec.whatwg.org/#concept-event-fire + * @param {string} e The name of the event + * @param {import('./filereader').FileReader} reader */ +function fireAProgressEvent (e, reader) { + // The progress event e does not bubble. e.bubbles must be false + // The progress event e is NOT cancelable. e.cancelable must be false + const event = new ProgressEvent(e, { + bubbles: false, + cancelable: false + }) -// TODO: ipjs doesn't support this, only for test files: https://github.com/mikeal/ipjs/blob/master/src/package/testFile.js#L39 - - -// the ts-ignores in this file are almost all for the `Uint8Array|number[]` duality that exists -// for perf reasons. Consider better approaches to this or removing it entirely, it is quite -// risky because of some assumptions about small chunks === number[] and everything else === Uint8Array. + reader.dispatchEvent(event) +} -const defaultChunkSize = 256 +/** + * @see https://w3c.github.io/FileAPI/#blob-package-data + * @param {Uint8Array[]} bytes + * @param {string} type + * @param {string?} mimeType + * @param {string?} encodingName + */ +function packageData (bytes, type, mimeType, encodingName) { + // 1. A Blob has an associated package data algorithm, given + // bytes, a type, a optional mimeType, and a optional + // encodingName, which switches on type and runs the + // associated steps: -class Bl { - /** - * @param {number} [chunkSize] - */ - constructor (chunkSize = defaultChunkSize) { - this.chunkSize = chunkSize - /** @type {number} */ - this.cursor = 0 - /** @type {number} */ - this.maxCursor = -1 - /** @type {(Uint8Array|number[])[]} */ - this.chunks = [] - // keep the first chunk around if we can to save allocations for future encodes - /** @type {Uint8Array|number[]|null} */ - this._initReuseChunk = null - } + switch (type) { + case 'DataURL': { + // 1. Return bytes as a DataURL [RFC2397] subject to + // the considerations below: + // * Use mimeType as part of the Data URL if it is + // available in keeping with the Data URL + // specification [RFC2397]. + // * If mimeType is not available return a Data URL + // without a media-type. [RFC2397]. - reset () { - this.cursor = 0 - this.maxCursor = -1 - if (this.chunks.length) { - this.chunks = [] - } - if (this._initReuseChunk !== null) { - this.chunks.push(this._initReuseChunk) - this.maxCursor = this._initReuseChunk.length - 1 - } - } + // https://datatracker.ietf.org/doc/html/rfc2397#section-3 + // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data + // mediatype := [ type "/" subtype ] *( ";" parameter ) + // data := *urlchar + // parameter := attribute "=" value + let dataURL = 'data:' - /** - * @param {Uint8Array|number[]} bytes - */ - push (bytes) { - let topChunk = this.chunks[this.chunks.length - 1] - const newMax = this.cursor + bytes.length - if (newMax <= this.maxCursor + 1) { - // we have at least one chunk and we can fit these bytes into that chunk - const chunkPos = topChunk.length - (this.maxCursor - this.cursor) - 1 - // @ts-ignore - topChunk.set(bytes, chunkPos) - } else { - // can't fit it in - if (topChunk) { - // trip the last chunk to `cursor` if we need to - const chunkPos = topChunk.length - (this.maxCursor - this.cursor) - 1 - if (chunkPos < topChunk.length) { - // @ts-ignore - this.chunks[this.chunks.length - 1] = topChunk.subarray(0, chunkPos) - this.maxCursor = this.cursor - 1 - } - } - if (bytes.length < 64 && bytes.length < this.chunkSize) { - // make a new chunk and copy the new one into it - topChunk = alloc(this.chunkSize) - this.chunks.push(topChunk) - this.maxCursor += topChunk.length - if (this._initReuseChunk === null) { - this._initReuseChunk = topChunk - } - // @ts-ignore - topChunk.set(bytes, 0) - } else { - // push the new bytes in as its own chunk - this.chunks.push(bytes) - this.maxCursor += bytes.length - } - } - this.cursor += bytes.length - } + const parsed = parseMIMEType(mimeType || 'application/octet-stream') - /** - * @param {boolean} [reset] - * @returns {Uint8Array} - */ - toBytes (reset = false) { - let byts - if (this.chunks.length === 1) { - const chunk = this.chunks[0] - if (reset && this.cursor > chunk.length / 2) { - /* c8 ignore next 2 */ - // @ts-ignore - byts = this.cursor === chunk.length ? chunk : chunk.subarray(0, this.cursor) - this._initReuseChunk = null - this.chunks = [] - } else { - // @ts-ignore - byts = slice(chunk, 0, this.cursor) + if (parsed !== 'failure') { + dataURL += serializeAMimeType(parsed) } - } else { - // @ts-ignore - byts = concat(this.chunks, this.cursor) - } - if (reset) { - this.reset() - } - return byts - } -} -;// CONCATENATED MODULE: ./node_modules/cborg/lib/common.js -const decodeErrPrefix = 'CBOR decode error:' -const encodeErrPrefix = 'CBOR encode error:' + dataURL += ';base64,' -const uintMinorPrefixBytes = [] -uintMinorPrefixBytes[23] = 1 -uintMinorPrefixBytes[24] = 2 -uintMinorPrefixBytes[25] = 3 -uintMinorPrefixBytes[26] = 5 -uintMinorPrefixBytes[27] = 9 + const decoder = new StringDecoder('latin1') -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} need - */ -function assertEnoughData (data, pos, need) { - if (data.length - pos < need) { - throw new Error(`${decodeErrPrefix} not enough data for type`) - } -} + for (const chunk of bytes) { + dataURL += btoa(decoder.write(chunk)) + } + dataURL += btoa(decoder.end()) + return dataURL + } + case 'Text': { + // 1. Let encoding be failure + let encoding = 'failure' -;// CONCATENATED MODULE: ./node_modules/cborg/lib/0uint.js -/* globals BigInt */ + // 2. If the encodingName is present, set encoding to the + // result of getting an encoding from encodingName. + if (encodingName) { + encoding = getEncoding(encodingName) + } + // 3. If encoding is failure, and mimeType is present: + if (encoding === 'failure' && mimeType) { + // 1. Let type be the result of parse a MIME type + // given mimeType. + const type = parseMIMEType(mimeType) + // 2. If type is not failure, set encoding to the result + // of getting an encoding from type’s parameters["charset"]. + if (type !== 'failure') { + encoding = getEncoding(type.parameters.get('charset')) + } + } + // 4. If encoding is failure, then set encoding to UTF-8. + if (encoding === 'failure') { + encoding = 'UTF-8' + } -const uintBoundaries = [24, 256, 65536, 4294967296, BigInt('18446744073709551616')] + // 5. Decode bytes using fallback encoding encoding, and + // return the result. + return decode(bytes, encoding) + } + case 'ArrayBuffer': { + // Return a new ArrayBuffer whose contents are bytes. + const sequence = combineByteSequences(bytes) -/** - * @typedef {import('./bl.js').Bl} Bl - * @typedef {import('../interface').DecodeOptions} DecodeOptions - */ + return sequence.buffer + } + case 'BinaryString': { + // Return bytes as a binary string, in which every byte + // is represented by a code unit of equal value [0..255]. + let binaryString = '' -/** - * @param {Uint8Array} data - * @param {number} offset - * @param {DecodeOptions} options - * @returns {number} - */ -function readUint8 (data, offset, options) { - assertEnoughData(data, offset, 1) - const value = data[offset] - if (options.strict === true && value < uintBoundaries[0]) { - throw new Error(`${decodeErrPrefix} integer encoded in more bytes than necessary (strict decode)`) - } - return value -} + const decoder = new StringDecoder('latin1') -/** - * @param {Uint8Array} data - * @param {number} offset - * @param {DecodeOptions} options - * @returns {number} - */ -function readUint16 (data, offset, options) { - assertEnoughData(data, offset, 2) - const value = (data[offset] << 8) | data[offset + 1] - if (options.strict === true && value < uintBoundaries[1]) { - throw new Error(`${decodeErrPrefix} integer encoded in more bytes than necessary (strict decode)`) - } - return value -} + for (const chunk of bytes) { + binaryString += decoder.write(chunk) + } -/** - * @param {Uint8Array} data - * @param {number} offset - * @param {DecodeOptions} options - * @returns {number} - */ -function readUint32 (data, offset, options) { - assertEnoughData(data, offset, 4) - const value = (data[offset] * 16777216 /* 2 ** 24 */) + (data[offset + 1] << 16) + (data[offset + 2] << 8) + data[offset + 3] - if (options.strict === true && value < uintBoundaries[2]) { - throw new Error(`${decodeErrPrefix} integer encoded in more bytes than necessary (strict decode)`) + binaryString += decoder.end() + + return binaryString + } } - return value } /** - * @param {Uint8Array} data - * @param {number} offset - * @param {DecodeOptions} options - * @returns {number|bigint} + * @see https://encoding.spec.whatwg.org/#decode + * @param {Uint8Array[]} ioQueue + * @param {string} encoding */ -function readUint64 (data, offset, options) { - // assume BigInt, convert back to Number if within safe range - assertEnoughData(data, offset, 8) - const hi = (data[offset] * 16777216 /* 2 ** 24 */) + (data[offset + 1] << 16) + (data[offset + 2] << 8) + data[offset + 3] - const lo = (data[offset + 4] * 16777216 /* 2 ** 24 */) + (data[offset + 5] << 16) + (data[offset + 6] << 8) + data[offset + 7] - const value = (BigInt(hi) << BigInt(32)) + BigInt(lo) - if (options.strict === true && value < uintBoundaries[3]) { - throw new Error(`${decodeErrPrefix} integer encoded in more bytes than necessary (strict decode)`) - } - if (value <= Number.MAX_SAFE_INTEGER) { - return Number(value) - } - if (options.allowBigInt === true) { - return value - } - throw new Error(`${decodeErrPrefix} integers outside of the safe integer range are not supported`) -} +function decode (ioQueue, encoding) { + const bytes = combineByteSequences(ioQueue) -/* not required thanks to quick[] list -const oneByteTokens = new Array(24).fill(0).map((v, i) => new Token(Type.uint, i, 1)) -export function decodeUintCompact (data, pos, minor, options) { - return oneByteTokens[minor] -} -*/ + // 1. Let BOMEncoding be the result of BOM sniffing ioQueue. + const BOMEncoding = BOMSniffing(bytes) -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeUint8 (data, pos, _minor, options) { - return new token_Token(token_Type.uint, readUint8(data, pos + 1, options), 2) -} + let slice = 0 -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeUint16 (data, pos, _minor, options) { - return new token_Token(token_Type.uint, readUint16(data, pos + 1, options), 3) -} + // 2. If BOMEncoding is non-null: + if (BOMEncoding !== null) { + // 1. Set encoding to BOMEncoding. + encoding = BOMEncoding -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeUint32 (data, pos, _minor, options) { - return new token_Token(token_Type.uint, readUint32(data, pos + 1, options), 5) -} + // 2. Read three bytes from ioQueue, if BOMEncoding is + // UTF-8; otherwise read two bytes. + // (Do nothing with those bytes.) + slice = BOMEncoding === 'UTF-8' ? 3 : 2 + } -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeUint64 (data, pos, _minor, options) { - return new token_Token(token_Type.uint, readUint64(data, pos + 1, options), 9) -} + // 3. Process a queue with an instance of encoding’s + // decoder, ioQueue, output, and "replacement". -/** - * @param {Bl} buf - * @param {Token} token - */ -function encodeUint (buf, token) { - return encodeUintValue(buf, 0, token.value) + // 4. Return output. + + const sliced = bytes.slice(slice) + return new TextDecoder(encoding).decode(sliced) } /** - * @param {Bl} buf - * @param {number} major - * @param {number|bigint} uint + * @see https://encoding.spec.whatwg.org/#bom-sniff + * @param {Uint8Array} ioQueue */ -function encodeUintValue (buf, major, uint) { - if (uint < uintBoundaries[0]) { - const nuint = Number(uint) - // pack into one byte, minor=0, additional=value - buf.push([major | nuint]) - } else if (uint < uintBoundaries[1]) { - const nuint = Number(uint) - // pack into two byte, minor=0, additional=24 - buf.push([major | 24, nuint]) - } else if (uint < uintBoundaries[2]) { - const nuint = Number(uint) - // pack into three byte, minor=0, additional=25 - buf.push([major | 25, nuint >>> 8, nuint & 0xff]) - } else if (uint < uintBoundaries[3]) { - const nuint = Number(uint) - // pack into five byte, minor=0, additional=26 - buf.push([major | 26, (nuint >>> 24) & 0xff, (nuint >>> 16) & 0xff, (nuint >>> 8) & 0xff, nuint & 0xff]) - } else { - const buint = BigInt(uint) - if (buint < uintBoundaries[4]) { - // pack into nine byte, minor=0, additional=27 - const set = [major | 27, 0, 0, 0, 0, 0, 0, 0] - // simulate bitwise above 32 bits - let lo = Number(buint & BigInt(0xffffffff)) - let hi = Number(buint >> BigInt(32) & BigInt(0xffffffff)) - set[8] = lo & 0xff - lo = lo >> 8 - set[7] = lo & 0xff - lo = lo >> 8 - set[6] = lo & 0xff - lo = lo >> 8 - set[5] = lo & 0xff - set[4] = hi & 0xff - hi = hi >> 8 - set[3] = hi & 0xff - hi = hi >> 8 - set[2] = hi & 0xff - hi = hi >> 8 - set[1] = hi & 0xff - buf.push(set) - } else { - throw new Error(`${decodeErrPrefix} encountered BigInt larger than allowable range`) - } +function BOMSniffing (ioQueue) { + // 1. Let BOM be the result of peeking 3 bytes from ioQueue, + // converted to a byte sequence. + const [a, b, c] = ioQueue + + // 2. For each of the rows in the table below, starting with + // the first one and going down, if BOM starts with the + // bytes given in the first column, then return the + // encoding given in the cell in the second column of that + // row. Otherwise, return null. + if (a === 0xEF && b === 0xBB && c === 0xBF) { + return 'UTF-8' + } else if (a === 0xFE && b === 0xFF) { + return 'UTF-16BE' + } else if (a === 0xFF && b === 0xFE) { + return 'UTF-16LE' } -} -/** - * @param {Token} token - * @returns {number} - */ -encodeUint.encodedSize = function encodedSize (token) { - return encodeUintValue.encodedSize(token.value) + return null } /** - * @param {number} uint - * @returns {number} + * @param {Uint8Array[]} sequences */ -encodeUintValue.encodedSize = function encodedSize (uint) { - if (uint < uintBoundaries[0]) { - return 1 - } - if (uint < uintBoundaries[1]) { - return 2 - } - if (uint < uintBoundaries[2]) { - return 3 - } - if (uint < uintBoundaries[3]) { - return 5 - } - return 9 +function combineByteSequences (sequences) { + const size = sequences.reduce((a, b) => { + return a + b.byteLength + }, 0) + + let offset = 0 + + return sequences.reduce((a, b) => { + a.set(b, offset) + offset += b.byteLength + return a + }, new Uint8Array(size)) } -/** - * @param {Token} tok1 - * @param {Token} tok2 - * @returns {number} - */ -encodeUint.compareTokens = function compareTokens (tok1, tok2) { - return tok1.value < tok2.value ? -1 : tok1.value > tok2.value ? 1 : /* c8 ignore next */ 0 +module.exports = { + staticPropertyDescriptors, + readOperation, + fireAProgressEvent } -;// CONCATENATED MODULE: ./node_modules/cborg/lib/1negint.js -/* eslint-env es2020 */ +/***/ }), +/***/ 94330: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * @typedef {import('./bl.js').Bl} Bl - * @typedef {import('../interface').DecodeOptions} DecodeOptions - */ +// We include a version number for the Dispatcher API. In case of breaking changes, +// this version number must be increased to avoid conflicts. +const globalDispatcher = Symbol.for('undici.globalDispatcher.1') +const { InvalidArgumentError } = __nccwpck_require__(70867) +const Agent = __nccwpck_require__(83272) -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeNegint8 (data, pos, _minor, options) { - return new token_Token(token_Type.negint, -1 - readUint8(data, pos + 1, options), 2) +if (getGlobalDispatcher() === undefined) { + setGlobalDispatcher(new Agent()) } -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeNegint16 (data, pos, _minor, options) { - return new token_Token(token_Type.negint, -1 - readUint16(data, pos + 1, options), 3) +function setGlobalDispatcher (agent) { + if (!agent || typeof agent.dispatch !== 'function') { + throw new InvalidArgumentError('Argument agent must implement Agent') + } + Object.defineProperty(globalThis, globalDispatcher, { + value: agent, + writable: true, + enumerable: false, + configurable: false + }) } -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeNegint32 (data, pos, _minor, options) { - return new token_Token(token_Type.negint, -1 - readUint32(data, pos + 1, options), 5) +function getGlobalDispatcher () { + return globalThis[globalDispatcher] } -const neg1b = BigInt(-1) -const pos1b = BigInt(1) +module.exports = { + setGlobalDispatcher, + getGlobalDispatcher +} -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeNegint64 (data, pos, _minor, options) { - const int = readUint64(data, pos + 1, options) - if (typeof int !== 'bigint') { - const value = -1 - int - if (value >= Number.MIN_SAFE_INTEGER) { - return new token_Token(token_Type.negint, value, 9) - } + +/***/ }), + +/***/ 25817: +/***/ ((module) => { + + + +module.exports = class DecoratorHandler { + constructor (handler) { + this.handler = handler } - if (options.allowBigInt !== true) { - throw new Error(`${decodeErrPrefix} integers outside of the safe integer range are not supported`) + + onConnect (...args) { + return this.handler.onConnect(...args) } - return new token_Token(token_Type.negint, neg1b - BigInt(int), 9) -} -/** - * @param {Bl} buf - * @param {Token} token - */ -function encodeNegint (buf, token) { - const negint = token.value - const unsigned = (typeof negint === 'bigint' ? (negint * neg1b - pos1b) : (negint * -1 - 1)) - encodeUintValue(buf, token.type.majorEncoded, unsigned) -} + onError (...args) { + return this.handler.onError(...args) + } -/** - * @param {Token} token - * @returns {number} - */ -encodeNegint.encodedSize = function encodedSize (token) { - const negint = token.value - const unsigned = (typeof negint === 'bigint' ? (negint * neg1b - pos1b) : (negint * -1 - 1)) - /* c8 ignore next 4 */ - // handled by quickEncode, we shouldn't get here but it's included for completeness - if (unsigned < uintBoundaries[0]) { - return 1 + onUpgrade (...args) { + return this.handler.onUpgrade(...args) } - if (unsigned < uintBoundaries[1]) { - return 2 + + onHeaders (...args) { + return this.handler.onHeaders(...args) } - if (unsigned < uintBoundaries[2]) { - return 3 + + onData (...args) { + return this.handler.onData(...args) } - if (unsigned < uintBoundaries[3]) { - return 5 + + onComplete (...args) { + return this.handler.onComplete(...args) } - return 9 -} -/** - * @param {Token} tok1 - * @param {Token} tok2 - * @returns {number} - */ -encodeNegint.compareTokens = function compareTokens (tok1, tok2) { - // opposite of the uint comparison since we store the uint version in bytes - return tok1.value < tok2.value ? 1 : tok1.value > tok2.value ? -1 : /* c8 ignore next */ 0 + onBodySent (...args) { + return this.handler.onBodySent(...args) + } } -;// CONCATENATED MODULE: ./node_modules/cborg/lib/2bytes.js +/***/ }), +/***/ 10411: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * @typedef {import('./bl.js').Bl} Bl - * @typedef {import('../interface').DecodeOptions} DecodeOptions - */ +const util = __nccwpck_require__(43061) +const { kBodyUsed } = __nccwpck_require__(69898) +const assert = __nccwpck_require__(39491) +const { InvalidArgumentError } = __nccwpck_require__(70867) +const EE = __nccwpck_require__(82361) -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} prefix - * @param {number} length - * @returns {Token} - */ -function toToken (data, pos, prefix, length) { - assertEnoughData(data, pos, prefix + length) - const buf = slice(data, pos + prefix, pos + prefix + length) - return new token_Token(token_Type.bytes, buf, prefix + length) -} +const redirectableStatusCodes = [300, 301, 302, 303, 307, 308] -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} minor - * @param {DecodeOptions} _options - * @returns {Token} - */ -function decodeBytesCompact (data, pos, minor, _options) { - return toToken(data, pos, 1, minor) -} +const kBody = Symbol('body') -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeBytes8 (data, pos, _minor, options) { - return toToken(data, pos, 2, readUint8(data, pos + 1, options)) -} +class BodyAsyncIterable { + constructor (body) { + this[kBody] = body + this[kBodyUsed] = false + } -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeBytes16 (data, pos, _minor, options) { - return toToken(data, pos, 3, readUint16(data, pos + 1, options)) + async * [Symbol.asyncIterator] () { + assert(!this[kBodyUsed], 'disturbed') + this[kBodyUsed] = true + yield * this[kBody] + } } -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeBytes32 (data, pos, _minor, options) { - return toToken(data, pos, 5, readUint32(data, pos + 1, options)) -} +class RedirectHandler { + constructor (dispatch, maxRedirections, opts, handler) { + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { + throw new InvalidArgumentError('maxRedirections must be a positive number') + } -// TODO: maybe we shouldn't support this .. -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeBytes64 (data, pos, _minor, options) { - const l = readUint64(data, pos + 1, options) - if (typeof l === 'bigint') { - throw new Error(`${decodeErrPrefix} 64-bit integer bytes lengths not supported`) + util.validateHandler(handler, opts.method, opts.upgrade) + + this.dispatch = dispatch + this.location = null + this.abort = null + this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy + this.maxRedirections = maxRedirections + this.handler = handler + this.history = [] + + if (util.isStream(this.opts.body)) { + // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp + // so that it can be dispatched again? + // TODO (fix): Do we need 100-expect support to provide a way to do this properly? + if (util.bodyLength(this.opts.body) === 0) { + this.opts.body + .on('data', function () { + assert(false) + }) + } + + if (typeof this.opts.body.readableDidRead !== 'boolean') { + this.opts.body[kBodyUsed] = false + EE.prototype.on.call(this.opts.body, 'data', function () { + this[kBodyUsed] = true + }) + } + } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') { + // TODO (fix): We can't access ReadableStream internal state + // to determine whether or not it has been disturbed. This is just + // a workaround. + this.opts.body = new BodyAsyncIterable(this.opts.body) + } else if ( + this.opts.body && + typeof this.opts.body !== 'string' && + !ArrayBuffer.isView(this.opts.body) && + util.isIterable(this.opts.body) + ) { + // TODO: Should we allow re-using iterable if !this.opts.idempotent + // or through some other flag? + this.opts.body = new BodyAsyncIterable(this.opts.body) + } } - return toToken(data, pos, 9, l) -} -/** - * `encodedBytes` allows for caching when we do a byte version of a string - * for key sorting purposes - * @param {Token} token - * @returns {Uint8Array} - */ -function tokenBytes (token) { - if (token.encodedBytes === undefined) { - token.encodedBytes = token.type === token_Type.string ? byte_utils_fromString(token.value) : token.value + onConnect (abort) { + this.abort = abort + this.handler.onConnect(abort, { history: this.history }) } - // @ts-ignore c'mon - return token.encodedBytes -} -/** - * @param {Bl} buf - * @param {Token} token - */ -function encodeBytes (buf, token) { - const bytes = tokenBytes(token) - encodeUintValue(buf, token.type.majorEncoded, bytes.length) - buf.push(bytes) -} + onUpgrade (statusCode, headers, socket) { + this.handler.onUpgrade(statusCode, headers, socket) + } -/** - * @param {Token} token - * @returns {number} - */ -encodeBytes.encodedSize = function encodedSize (token) { - const bytes = tokenBytes(token) - return encodeUintValue.encodedSize(bytes.length) + bytes.length -} + onError (error) { + this.handler.onError(error) + } -/** - * @param {Token} tok1 - * @param {Token} tok2 - * @returns {number} - */ -encodeBytes.compareTokens = function compareTokens (tok1, tok2) { - return compareBytes(tokenBytes(tok1), tokenBytes(tok2)) -} + onHeaders (statusCode, headers, resume, statusText) { + this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) + ? null + : parseLocation(statusCode, headers) -/** - * @param {Uint8Array} b1 - * @param {Uint8Array} b2 - * @returns {number} - */ -function compareBytes (b1, b2) { - return b1.length < b2.length ? -1 : b1.length > b2.length ? 1 : compare(b1, b2) -} + if (this.opts.origin) { + this.history.push(new URL(this.opts.path, this.opts.origin)) + } -;// CONCATENATED MODULE: ./node_modules/cborg/lib/3string.js + if (!this.location) { + return this.handler.onHeaders(statusCode, headers, resume, statusText) + } + const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))) + const path = search ? `${pathname}${search}` : pathname + + // Remove headers referring to the original URL. + // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers. + // https://tools.ietf.org/html/rfc7231#section-6.4 + this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin) + this.opts.path = path + this.opts.origin = origin + this.opts.maxRedirections = 0 + this.opts.query = null + // https://tools.ietf.org/html/rfc7231#section-6.4.4 + // In case of HTTP 303, always replace method to be either HEAD or GET + if (statusCode === 303 && this.opts.method !== 'HEAD') { + this.opts.method = 'GET' + this.opts.body = null + } + } + onData (chunk) { + if (this.location) { + /* + https://tools.ietf.org/html/rfc7231#section-6.4 + TLDR: undici always ignores 3xx response bodies. + Redirection is used to serve the requested resource from another URL, so it is assumes that + no body is generated (and thus can be ignored). Even though generating a body is not prohibited. -/** - * @typedef {import('./bl.js').Bl} Bl - * @typedef {import('../interface').DecodeOptions} DecodeOptions - */ + For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually + (which means it's optional and not mandated) contain just an hyperlink to the value of + the Location response header, so the body can be ignored safely. -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} prefix - * @param {number} length - * @param {DecodeOptions} options - * @returns {Token} - */ -function _3string_toToken (data, pos, prefix, length, options) { - const totLength = prefix + length - assertEnoughData(data, pos, totLength) - const tok = new token_Token(token_Type.string, byte_utils_toString(data, pos + prefix, pos + totLength), totLength) - if (options.retainStringBytes === true) { - tok.byteValue = slice(data, pos + prefix, pos + totLength) + For status 300, which is "Multiple Choices", the spec mentions both generating a Location + response header AND a response body with the other possible location to follow. + Since the spec explicitily chooses not to specify a format for such body and leave it to + servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it. + */ + } else { + return this.handler.onData(chunk) + } } - return tok -} -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeStringCompact (data, pos, minor, options) { - return _3string_toToken(data, pos, 1, minor, options) -} + onComplete (trailers) { + if (this.location) { + /* + https://tools.ietf.org/html/rfc7231#section-6.4 -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeString8 (data, pos, _minor, options) { - return _3string_toToken(data, pos, 2, readUint8(data, pos + 1, options), options) + TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections + and neither are useful if present. + + See comment on onData method above for more detailed informations. + */ + + this.location = null + this.abort = null + + this.dispatch(this.opts, this) + } else { + this.handler.onComplete(trailers) + } + } + + onBodySent (chunk) { + if (this.handler.onBodySent) { + this.handler.onBodySent(chunk) + } + } } -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeString16 (data, pos, _minor, options) { - return _3string_toToken(data, pos, 3, readUint16(data, pos + 1, options), options) +function parseLocation (statusCode, headers) { + if (redirectableStatusCodes.indexOf(statusCode) === -1) { + return null + } + + for (let i = 0; i < headers.length; i += 2) { + if (headers[i].toString().toLowerCase() === 'location') { + return headers[i + 1] + } + } } -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeString32 (data, pos, _minor, options) { - return _3string_toToken(data, pos, 5, readUint32(data, pos + 1, options), options) +// https://tools.ietf.org/html/rfc7231#section-6.4.4 +function shouldRemoveHeader (header, removeContent, unknownOrigin) { + return ( + (header.length === 4 && header.toString().toLowerCase() === 'host') || + (removeContent && header.toString().toLowerCase().indexOf('content-') === 0) || + (unknownOrigin && header.length === 13 && header.toString().toLowerCase() === 'authorization') || + (unknownOrigin && header.length === 6 && header.toString().toLowerCase() === 'cookie') + ) } -// TODO: maybe we shouldn't support this .. -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeString64 (data, pos, _minor, options) { - const l = readUint64(data, pos + 1, options) - if (typeof l === 'bigint') { - throw new Error(`${decodeErrPrefix} 64-bit integer string lengths not supported`) +// https://tools.ietf.org/html/rfc7231#section-6.4 +function cleanRequestHeaders (headers, removeContent, unknownOrigin) { + const ret = [] + if (Array.isArray(headers)) { + for (let i = 0; i < headers.length; i += 2) { + if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) { + ret.push(headers[i], headers[i + 1]) + } + } + } else if (headers && typeof headers === 'object') { + for (const key of Object.keys(headers)) { + if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) { + ret.push(key, headers[key]) + } + } + } else { + assert(headers == null, 'headers must be an object or an array') } - return _3string_toToken(data, pos, 9, l, options) + return ret } -const encodeString = encodeBytes +module.exports = RedirectHandler -;// CONCATENATED MODULE: ./node_modules/cborg/lib/4array.js +/***/ }), +/***/ 4448: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +const assert = __nccwpck_require__(39491) -/** - * @typedef {import('./bl.js').Bl} Bl - * @typedef {import('../interface').DecodeOptions} DecodeOptions - */ +const { kRetryHandlerDefaultRetry } = __nccwpck_require__(69898) +const { RequestRetryError } = __nccwpck_require__(70867) +const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(43061) -/** - * @param {Uint8Array} _data - * @param {number} _pos - * @param {number} prefix - * @param {number} length - * @returns {Token} - */ -function _4array_toToken (_data, _pos, prefix, length) { - return new token_Token(token_Type.array, length, prefix) -} +function calculateRetryAfterHeader (retryAfter) { + const current = Date.now() + const diff = new Date(retryAfter).getTime() - current -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} minor - * @param {DecodeOptions} _options - * @returns {Token} - */ -function decodeArrayCompact (data, pos, minor, _options) { - return _4array_toToken(data, pos, 1, minor) + return diff } -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeArray8 (data, pos, _minor, options) { - return _4array_toToken(data, pos, 2, readUint8(data, pos + 1, options)) -} +class RetryHandler { + constructor (opts, handlers) { + const { retryOptions, ...dispatchOpts } = opts + const { + // Retry scoped + retry: retryFn, + maxRetries, + maxTimeout, + minTimeout, + timeoutFactor, + // Response scoped + methods, + errorCodes, + retryAfter, + statusCodes + } = retryOptions ?? {} -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeArray16 (data, pos, _minor, options) { - return _4array_toToken(data, pos, 3, readUint16(data, pos + 1, options)) -} + this.dispatch = handlers.dispatch + this.handler = handlers.handler + this.opts = dispatchOpts + this.abort = null + this.aborted = false + this.retryOpts = { + retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry], + retryAfter: retryAfter ?? true, + maxTimeout: maxTimeout ?? 30 * 1000, // 30s, + timeout: minTimeout ?? 500, // .5s + timeoutFactor: timeoutFactor ?? 2, + maxRetries: maxRetries ?? 5, + // What errors we should retry + methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'], + // Indicates which errors to retry + statusCodes: statusCodes ?? [500, 502, 503, 504, 429], + // List of errors to retry + errorCodes: errorCodes ?? [ + 'ECONNRESET', + 'ECONNREFUSED', + 'ENOTFOUND', + 'ENETDOWN', + 'ENETUNREACH', + 'EHOSTDOWN', + 'EHOSTUNREACH', + 'EPIPE' + ] + } -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeArray32 (data, pos, _minor, options) { - return _4array_toToken(data, pos, 5, readUint32(data, pos + 1, options)) -} + this.retryCount = 0 + this.start = 0 + this.end = null + this.etag = null + this.resume = null -// TODO: maybe we shouldn't support this .. -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeArray64 (data, pos, _minor, options) { - const l = readUint64(data, pos + 1, options) - if (typeof l === 'bigint') { - throw new Error(`${decodeErrPrefix} 64-bit integer array lengths not supported`) + // Handle possible onConnect duplication + this.handler.onConnect(reason => { + this.aborted = true + if (this.abort) { + this.abort(reason) + } else { + this.reason = reason + } + }) } - return _4array_toToken(data, pos, 9, l) -} -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeArrayIndefinite (data, pos, _minor, options) { - if (options.allowIndefinite === false) { - throw new Error(`${decodeErrPrefix} indefinite length items not allowed`) + onRequestSent () { + if (this.handler.onRequestSent) { + this.handler.onRequestSent() + } } - return _4array_toToken(data, pos, 1, Infinity) -} - -/** - * @param {Bl} buf - * @param {Token} token - */ -function encodeArray (buf, token) { - encodeUintValue(buf, token_Type.array.majorEncoded, token.value) -} -// using an array as a map key, are you sure about this? we can only sort -// by map length here, it's up to the encoder to decide to look deeper -encodeArray.compareTokens = encodeUint.compareTokens + onUpgrade (statusCode, headers, socket) { + if (this.handler.onUpgrade) { + this.handler.onUpgrade(statusCode, headers, socket) + } + } -/** - * @param {Token} token - * @returns {number} - */ -encodeArray.encodedSize = function encodedSize (token) { - return encodeUintValue.encodedSize(token.value) -} + onConnect (abort) { + if (this.aborted) { + abort(this.reason) + } else { + this.abort = abort + } + } -;// CONCATENATED MODULE: ./node_modules/cborg/lib/5map.js + onBodySent (chunk) { + if (this.handler.onBodySent) return this.handler.onBodySent(chunk) + } + static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) { + const { statusCode, code, headers } = err + const { method, retryOptions } = opts + const { + maxRetries, + timeout, + maxTimeout, + timeoutFactor, + statusCodes, + errorCodes, + methods + } = retryOptions + let { counter, currentTimeout } = state + currentTimeout = + currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout + // Any code that is not a Undici's originated and allowed to retry + if ( + code && + code !== 'UND_ERR_REQ_RETRY' && + code !== 'UND_ERR_SOCKET' && + !errorCodes.includes(code) + ) { + cb(err) + return + } -/** - * @typedef {import('./bl.js').Bl} Bl - * @typedef {import('../interface').DecodeOptions} DecodeOptions - */ + // If a set of method are provided and the current method is not in the list + if (Array.isArray(methods) && !methods.includes(method)) { + cb(err) + return + } -/** - * @param {Uint8Array} _data - * @param {number} _pos - * @param {number} prefix - * @param {number} length - * @returns {Token} - */ -function _5map_toToken (_data, _pos, prefix, length) { - return new token_Token(token_Type.map, length, prefix) -} + // If a set of status code are provided and the current status code is not in the list + if ( + statusCode != null && + Array.isArray(statusCodes) && + !statusCodes.includes(statusCode) + ) { + cb(err) + return + } -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} minor - * @param {DecodeOptions} _options - * @returns {Token} - */ -function decodeMapCompact (data, pos, minor, _options) { - return _5map_toToken(data, pos, 1, minor) -} + // If we reached the max number of retries + if (counter > maxRetries) { + cb(err) + return + } -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeMap8 (data, pos, _minor, options) { - return _5map_toToken(data, pos, 2, readUint8(data, pos + 1, options)) -} + let retryAfterHeader = headers != null && headers['retry-after'] + if (retryAfterHeader) { + retryAfterHeader = Number(retryAfterHeader) + retryAfterHeader = isNaN(retryAfterHeader) + ? calculateRetryAfterHeader(retryAfterHeader) + : retryAfterHeader * 1e3 // Retry-After is in seconds + } -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeMap16 (data, pos, _minor, options) { - return _5map_toToken(data, pos, 3, readUint16(data, pos + 1, options)) -} + const retryTimeout = + retryAfterHeader > 0 + ? Math.min(retryAfterHeader, maxTimeout) + : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout) -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeMap32 (data, pos, _minor, options) { - return _5map_toToken(data, pos, 5, readUint32(data, pos + 1, options)) -} + state.currentTimeout = retryTimeout -// TODO: maybe we shouldn't support this .. -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeMap64 (data, pos, _minor, options) { - const l = readUint64(data, pos + 1, options) - if (typeof l === 'bigint') { - throw new Error(`${decodeErrPrefix} 64-bit integer map lengths not supported`) + setTimeout(() => cb(null), retryTimeout) } - return _5map_toToken(data, pos, 9, l) -} -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeMapIndefinite (data, pos, _minor, options) { - if (options.allowIndefinite === false) { - throw new Error(`${decodeErrPrefix} indefinite length items not allowed`) - } - return _5map_toToken(data, pos, 1, Infinity) -} + onHeaders (statusCode, rawHeaders, resume, statusMessage) { + const headers = parseHeaders(rawHeaders) -/** - * @param {Bl} buf - * @param {Token} token - */ -function encodeMap (buf, token) { - encodeUintValue(buf, token_Type.map.majorEncoded, token.value) -} + this.retryCount += 1 -// using a map as a map key, are you sure about this? we can only sort -// by map length here, it's up to the encoder to decide to look deeper -encodeMap.compareTokens = encodeUint.compareTokens + if (statusCode >= 300) { + this.abort( + new RequestRetryError('Request failed', statusCode, { + headers, + count: this.retryCount + }) + ) + return false + } -/** - * @param {Token} token - * @returns {number} - */ -encodeMap.encodedSize = function encodedSize (token) { - return encodeUintValue.encodedSize(token.value) -} + // Checkpoint for resume from where we left it + if (this.resume != null) { + this.resume = null -;// CONCATENATED MODULE: ./node_modules/cborg/lib/6tag.js + if (statusCode !== 206) { + return true + } + const contentRange = parseRangeHeader(headers['content-range']) + // If no content range + if (!contentRange) { + this.abort( + new RequestRetryError('Content-Range mismatch', statusCode, { + headers, + count: this.retryCount + }) + ) + return false + } + // Let's start with a weak etag check + if (this.etag != null && this.etag !== headers.etag) { + this.abort( + new RequestRetryError('ETag mismatch', statusCode, { + headers, + count: this.retryCount + }) + ) + return false + } -/** - * @typedef {import('./bl.js').Bl} Bl - * @typedef {import('../interface').DecodeOptions} DecodeOptions - */ + const { start, size, end = size } = contentRange -/** - * @param {Uint8Array} _data - * @param {number} _pos - * @param {number} minor - * @param {DecodeOptions} _options - * @returns {Token} - */ -function decodeTagCompact (_data, _pos, minor, _options) { - return new token_Token(token_Type.tag, minor, 1) -} + assert(this.start === start, 'content-range mismatch') + assert(this.end == null || this.end === end, 'content-range mismatch') -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeTag8 (data, pos, _minor, options) { - return new token_Token(token_Type.tag, readUint8(data, pos + 1, options), 2) -} + this.resume = resume + return true + } -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeTag16 (data, pos, _minor, options) { - return new token_Token(token_Type.tag, readUint16(data, pos + 1, options), 3) -} + if (this.end == null) { + if (statusCode === 206) { + // First time we receive 206 + const range = parseRangeHeader(headers['content-range']) -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeTag32 (data, pos, _minor, options) { - return new token_Token(token_Type.tag, readUint32(data, pos + 1, options), 5) -} + if (range == null) { + return this.handler.onHeaders( + statusCode, + rawHeaders, + resume, + statusMessage + ) + } -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeTag64 (data, pos, _minor, options) { - return new token_Token(token_Type.tag, readUint64(data, pos + 1, options), 9) -} + const { start, size, end = size } = range -/** - * @param {Bl} buf - * @param {Token} token - */ -function encodeTag (buf, token) { - encodeUintValue(buf, token_Type.tag.majorEncoded, token.value) -} + assert( + start != null && Number.isFinite(start) && this.start !== start, + 'content-range mismatch' + ) + assert(Number.isFinite(start)) + assert( + end != null && Number.isFinite(end) && this.end !== end, + 'invalid content-length' + ) -encodeTag.compareTokens = encodeUint.compareTokens + this.start = start + this.end = end + } -/** - * @param {Token} token - * @returns {number} - */ -encodeTag.encodedSize = function encodedSize (token) { - return encodeUintValue.encodedSize(token.value) -} + // We make our best to checkpoint the body for further range headers + if (this.end == null) { + const contentLength = headers['content-length'] + this.end = contentLength != null ? Number(contentLength) : null + } -;// CONCATENATED MODULE: ./node_modules/cborg/lib/7float.js -// TODO: shift some of the bytes logic to bytes-utils so we can use Buffer -// where possible + assert(Number.isFinite(this.start)) + assert( + this.end == null || Number.isFinite(this.end), + 'invalid content-length' + ) + this.resume = resume + this.etag = headers.etag != null ? headers.etag : null + return this.handler.onHeaders( + statusCode, + rawHeaders, + resume, + statusMessage + ) + } + const err = new RequestRetryError('Request failed', statusCode, { + headers, + count: this.retryCount + }) + this.abort(err) -/** - * @typedef {import('./bl.js').Bl} Bl - * @typedef {import('../interface').DecodeOptions} DecodeOptions - * @typedef {import('../interface').EncodeOptions} EncodeOptions - */ + return false + } -const MINOR_FALSE = 20 -const MINOR_TRUE = 21 -const MINOR_NULL = 22 -const MINOR_UNDEFINED = 23 + onData (chunk) { + this.start += chunk.length -/** - * @param {Uint8Array} _data - * @param {number} _pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeUndefined (_data, _pos, _minor, options) { - if (options.allowUndefined === false) { - throw new Error(`${decodeErrPrefix} undefined values are not supported`) - } else if (options.coerceUndefinedToNull === true) { - return new token_Token(token_Type["null"], null, 1) + return this.handler.onData(chunk) } - return new token_Token(token_Type.undefined, undefined, 1) -} -/** - * @param {Uint8Array} _data - * @param {number} _pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeBreak (_data, _pos, _minor, options) { - if (options.allowIndefinite === false) { - throw new Error(`${decodeErrPrefix} indefinite length items not allowed`) + onComplete (rawTrailers) { + this.retryCount = 0 + return this.handler.onComplete(rawTrailers) } - return new token_Token(token_Type["break"], undefined, 1) -} -/** - * @param {number} value - * @param {number} bytes - * @param {DecodeOptions} options - * @returns {Token} - */ -function createToken (value, bytes, options) { - if (options) { - if (options.allowNaN === false && Number.isNaN(value)) { - throw new Error(`${decodeErrPrefix} NaN values are not supported`) - } - if (options.allowInfinity === false && (value === Infinity || value === -Infinity)) { - throw new Error(`${decodeErrPrefix} Infinity values are not supported`) + onError (err) { + if (this.aborted || isDisturbed(this.opts.body)) { + return this.handler.onError(err) } - } - return new token_Token(token_Type.float, value, bytes) -} - -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeFloat16 (data, pos, _minor, options) { - return createToken(readFloat16(data, pos + 1), 3, options) -} - -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeFloat32 (data, pos, _minor, options) { - return createToken(readFloat32(data, pos + 1), 5, options) -} -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} _minor - * @param {DecodeOptions} options - * @returns {Token} - */ -function decodeFloat64 (data, pos, _minor, options) { - return createToken(readFloat64(data, pos + 1), 9, options) -} + this.retryOpts.retry( + err, + { + state: { counter: this.retryCount++, currentTimeout: this.retryAfter }, + opts: { retryOptions: this.retryOpts, ...this.opts } + }, + onRetry.bind(this) + ) -/** - * @param {Bl} buf - * @param {Token} token - * @param {EncodeOptions} options - */ -function encodeFloat (buf, token, options) { - const float = token.value + function onRetry (err) { + if (err != null || this.aborted || isDisturbed(this.opts.body)) { + return this.handler.onError(err) + } - if (float === false) { - buf.push([token_Type.float.majorEncoded | MINOR_FALSE]) - } else if (float === true) { - buf.push([token_Type.float.majorEncoded | MINOR_TRUE]) - } else if (float === null) { - buf.push([token_Type.float.majorEncoded | MINOR_NULL]) - } else if (float === undefined) { - buf.push([token_Type.float.majorEncoded | MINOR_UNDEFINED]) - } else { - let decoded - let success = false - if (!options || options.float64 !== true) { - encodeFloat16(float) - decoded = readFloat16(ui8a, 1) - if (float === decoded || Number.isNaN(float)) { - ui8a[0] = 0xf9 - buf.push(ui8a.slice(0, 3)) - success = true - } else { - encodeFloat32(float) - decoded = readFloat32(ui8a, 1) - if (float === decoded) { - ui8a[0] = 0xfa - buf.push(ui8a.slice(0, 5)) - success = true + if (this.start !== 0) { + this.opts = { + ...this.opts, + headers: { + ...this.opts.headers, + range: `bytes=${this.start}-${this.end ?? ''}` + } } } - } - if (!success) { - encodeFloat64(float) - decoded = readFloat64(ui8a, 1) - ui8a[0] = 0xfb - buf.push(ui8a.slice(0, 9)) + + try { + this.dispatch(this.opts, this) + } catch (err) { + this.handler.onError(err) + } } } } -/** - * @param {Token} token - * @param {EncodeOptions} options - * @returns {number} - */ -encodeFloat.encodedSize = function encodedSize (token, options) { - const float = token.value +module.exports = RetryHandler - if (float === false || float === true || float === null || float === undefined) { - return 1 - } - if (!options || options.float64 !== true) { - encodeFloat16(float) - let decoded = readFloat16(ui8a, 1) - if (float === decoded || Number.isNaN(float)) { - return 3 - } - encodeFloat32(float) - decoded = readFloat32(ui8a, 1) - if (float === decoded) { - return 5 - } - } - return 9 -} +/***/ }), -const buffer = new ArrayBuffer(9) -const dataView = new DataView(buffer, 1) -const ui8a = new Uint8Array(buffer, 0) +/***/ 8734: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * @param {number} inp - */ -function encodeFloat16 (inp) { - if (inp === Infinity) { - dataView.setUint16(0, 0x7c00, false) - } else if (inp === -Infinity) { - dataView.setUint16(0, 0xfc00, false) - } else if (Number.isNaN(inp)) { - dataView.setUint16(0, 0x7e00, false) - } else { - dataView.setFloat32(0, inp) - const valu32 = dataView.getUint32(0) - const exponent = (valu32 & 0x7f800000) >> 23 - const mantissa = valu32 & 0x7fffff - /* c8 ignore next 6 */ - if (exponent === 0xff) { - // too big, Infinity, but this should be hard (impossible?) to trigger - dataView.setUint16(0, 0x7c00, false) - } else if (exponent === 0x00) { - // 0.0, -0.0 and subnormals, shouldn't be possible to get here because 0.0 should be counted as an int - dataView.setUint16(0, ((inp & 0x80000000) >> 16) | (mantissa >> 13), false) - } else { // standard numbers - // chunks of logic here borrowed from https://github.com/PJK/libcbor/blob/c78f437182533e3efa8d963ff4b945bb635c2284/src/cbor/encoding.c#L127 - const logicalExponent = exponent - 127 - // Now we know that 2^exponent <= 0 logically - /* c8 ignore next 6 */ - if (logicalExponent < -24) { - /* No unambiguous representation exists, this float is not a half float - and is too small to be represented using a half, round off to zero. - Consistent with the reference implementation. */ - // should be difficult (impossible?) to get here in JS - dataView.setUint16(0, 0) - } else if (logicalExponent < -14) { - /* Offset the remaining decimal places by shifting the significand, the - value is lost. This is an implementation decision that works around the - absence of standard half-float in the language. */ - dataView.setUint16(0, ((valu32 & 0x80000000) >> 16) | /* sign bit */ (1 << (24 + logicalExponent)), false) - } else { - dataView.setUint16(0, ((valu32 & 0x80000000) >> 16) | ((logicalExponent + 15) << 10) | (mantissa >> 13), false) + +const RedirectHandler = __nccwpck_require__(10411) + +function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) { + return (dispatch) => { + return function Intercept (opts, handler) { + const { maxRedirections = defaultMaxRedirections } = opts + + if (!maxRedirections) { + return dispatch(opts, handler) } + + const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler) + opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting. + return dispatch(opts, redirectHandler) } } } -/** - * @param {Uint8Array} ui8a - * @param {number} pos - * @returns {number} - */ -function readFloat16 (ui8a, pos) { - if (ui8a.length - pos < 2) { - throw new Error(`${decodeErrPrefix} not enough data for float16`) - } +module.exports = createRedirectInterceptor - const half = (ui8a[pos] << 8) + ui8a[pos + 1] - if (half === 0x7c00) { - return Infinity - } - if (half === 0xfc00) { - return -Infinity - } - if (half === 0x7e00) { - return NaN - } - const exp = (half >> 10) & 0x1f - const mant = half & 0x3ff - let val - if (exp === 0) { - val = mant * (2 ** -24) - } else if (exp !== 31) { - val = (mant + 1024) * (2 ** (exp - 25)) - /* c8 ignore next 4 */ - } else { - // may not be possible to get here - val = mant === 0 ? Infinity : NaN - } - return (half & 0x8000) ? -val : val -} -/** - * @param {number} inp - */ -function encodeFloat32 (inp) { - dataView.setFloat32(0, inp, false) -} +/***/ }), -/** - * @param {Uint8Array} ui8a - * @param {number} pos - * @returns {number} - */ -function readFloat32 (ui8a, pos) { - if (ui8a.length - pos < 4) { - throw new Error(`${decodeErrPrefix} not enough data for float32`) - } - const offset = (ui8a.byteOffset || 0) + pos - return new DataView(ui8a.buffer, offset, 4).getFloat32(0, false) -} +/***/ 29110: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * @param {number} inp - */ -function encodeFloat64 (inp) { - dataView.setFloat64(0, inp, false) -} -/** - * @param {Uint8Array} ui8a - * @param {number} pos - * @returns {number} - */ -function readFloat64 (ui8a, pos) { - if (ui8a.length - pos < 8) { - throw new Error(`${decodeErrPrefix} not enough data for float64`) - } - const offset = (ui8a.byteOffset || 0) + pos - return new DataView(ui8a.buffer, offset, 8).getFloat64(0, false) +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; +const utils_1 = __nccwpck_require__(22043); +// C headers +var ERROR; +(function (ERROR) { + ERROR[ERROR["OK"] = 0] = "OK"; + ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL"; + ERROR[ERROR["STRICT"] = 2] = "STRICT"; + ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED"; + ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH"; + ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION"; + ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD"; + ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL"; + ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT"; + ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION"; + ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN"; + ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH"; + ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE"; + ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS"; + ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE"; + ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING"; + ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN"; + ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE"; + ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE"; + ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER"; + ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE"; + ERROR[ERROR["PAUSED"] = 21] = "PAUSED"; + ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE"; + ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE"; + ERROR[ERROR["USER"] = 24] = "USER"; +})(ERROR = exports.ERROR || (exports.ERROR = {})); +var TYPE; +(function (TYPE) { + TYPE[TYPE["BOTH"] = 0] = "BOTH"; + TYPE[TYPE["REQUEST"] = 1] = "REQUEST"; + TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE"; +})(TYPE = exports.TYPE || (exports.TYPE = {})); +var FLAGS; +(function (FLAGS) { + FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE"; + FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE"; + FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE"; + FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED"; + FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE"; + FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH"; + FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY"; + FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING"; + // 1 << 8 is unused + FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING"; +})(FLAGS = exports.FLAGS || (exports.FLAGS = {})); +var LENIENT_FLAGS; +(function (LENIENT_FLAGS) { + LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS"; + LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH"; + LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE"; +})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {})); +var METHODS; +(function (METHODS) { + METHODS[METHODS["DELETE"] = 0] = "DELETE"; + METHODS[METHODS["GET"] = 1] = "GET"; + METHODS[METHODS["HEAD"] = 2] = "HEAD"; + METHODS[METHODS["POST"] = 3] = "POST"; + METHODS[METHODS["PUT"] = 4] = "PUT"; + /* pathological */ + METHODS[METHODS["CONNECT"] = 5] = "CONNECT"; + METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS"; + METHODS[METHODS["TRACE"] = 7] = "TRACE"; + /* WebDAV */ + METHODS[METHODS["COPY"] = 8] = "COPY"; + METHODS[METHODS["LOCK"] = 9] = "LOCK"; + METHODS[METHODS["MKCOL"] = 10] = "MKCOL"; + METHODS[METHODS["MOVE"] = 11] = "MOVE"; + METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND"; + METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH"; + METHODS[METHODS["SEARCH"] = 14] = "SEARCH"; + METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK"; + METHODS[METHODS["BIND"] = 16] = "BIND"; + METHODS[METHODS["REBIND"] = 17] = "REBIND"; + METHODS[METHODS["UNBIND"] = 18] = "UNBIND"; + METHODS[METHODS["ACL"] = 19] = "ACL"; + /* subversion */ + METHODS[METHODS["REPORT"] = 20] = "REPORT"; + METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY"; + METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT"; + METHODS[METHODS["MERGE"] = 23] = "MERGE"; + /* upnp */ + METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH"; + METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY"; + METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE"; + METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE"; + /* RFC-5789 */ + METHODS[METHODS["PATCH"] = 28] = "PATCH"; + METHODS[METHODS["PURGE"] = 29] = "PURGE"; + /* CalDAV */ + METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR"; + /* RFC-2068, section 19.6.1.2 */ + METHODS[METHODS["LINK"] = 31] = "LINK"; + METHODS[METHODS["UNLINK"] = 32] = "UNLINK"; + /* icecast */ + METHODS[METHODS["SOURCE"] = 33] = "SOURCE"; + /* RFC-7540, section 11.6 */ + METHODS[METHODS["PRI"] = 34] = "PRI"; + /* RFC-2326 RTSP */ + METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE"; + METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE"; + METHODS[METHODS["SETUP"] = 37] = "SETUP"; + METHODS[METHODS["PLAY"] = 38] = "PLAY"; + METHODS[METHODS["PAUSE"] = 39] = "PAUSE"; + METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN"; + METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER"; + METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER"; + METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT"; + METHODS[METHODS["RECORD"] = 44] = "RECORD"; + /* RAOP */ + METHODS[METHODS["FLUSH"] = 45] = "FLUSH"; +})(METHODS = exports.METHODS || (exports.METHODS = {})); +exports.METHODS_HTTP = [ + METHODS.DELETE, + METHODS.GET, + METHODS.HEAD, + METHODS.POST, + METHODS.PUT, + METHODS.CONNECT, + METHODS.OPTIONS, + METHODS.TRACE, + METHODS.COPY, + METHODS.LOCK, + METHODS.MKCOL, + METHODS.MOVE, + METHODS.PROPFIND, + METHODS.PROPPATCH, + METHODS.SEARCH, + METHODS.UNLOCK, + METHODS.BIND, + METHODS.REBIND, + METHODS.UNBIND, + METHODS.ACL, + METHODS.REPORT, + METHODS.MKACTIVITY, + METHODS.CHECKOUT, + METHODS.MERGE, + METHODS['M-SEARCH'], + METHODS.NOTIFY, + METHODS.SUBSCRIBE, + METHODS.UNSUBSCRIBE, + METHODS.PATCH, + METHODS.PURGE, + METHODS.MKCALENDAR, + METHODS.LINK, + METHODS.UNLINK, + METHODS.PRI, + // TODO(indutny): should we allow it with HTTP? + METHODS.SOURCE, +]; +exports.METHODS_ICE = [ + METHODS.SOURCE, +]; +exports.METHODS_RTSP = [ + METHODS.OPTIONS, + METHODS.DESCRIBE, + METHODS.ANNOUNCE, + METHODS.SETUP, + METHODS.PLAY, + METHODS.PAUSE, + METHODS.TEARDOWN, + METHODS.GET_PARAMETER, + METHODS.SET_PARAMETER, + METHODS.REDIRECT, + METHODS.RECORD, + METHODS.FLUSH, + // For AirPlay + METHODS.GET, + METHODS.POST, +]; +exports.METHOD_MAP = utils_1.enumToMap(METHODS); +exports.H_METHOD_MAP = {}; +Object.keys(exports.METHOD_MAP).forEach((key) => { + if (/^H/.test(key)) { + exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key]; + } +}); +var FINISH; +(function (FINISH) { + FINISH[FINISH["SAFE"] = 0] = "SAFE"; + FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB"; + FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE"; +})(FINISH = exports.FINISH || (exports.FINISH = {})); +exports.ALPHA = []; +for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) { + // Upper case + exports.ALPHA.push(String.fromCharCode(i)); + // Lower case + exports.ALPHA.push(String.fromCharCode(i + 0x20)); } - -/** - * @param {Token} _tok1 - * @param {Token} _tok2 - * @returns {number} +exports.NUM_MAP = { + 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, + 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, +}; +exports.HEX_MAP = { + 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, + 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, + A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF, + a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf, +}; +exports.NUM = [ + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', +]; +exports.ALPHANUM = exports.ALPHA.concat(exports.NUM); +exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')']; +exports.USERINFO_CHARS = exports.ALPHANUM + .concat(exports.MARK) + .concat(['%', ';', ':', '&', '=', '+', '$', ',']); +// TODO(indutny): use RFC +exports.STRICT_URL_CHAR = [ + '!', '"', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + ':', ';', '<', '=', '>', + '@', '[', '\\', ']', '^', '_', + '`', + '{', '|', '}', '~', +].concat(exports.ALPHANUM); +exports.URL_CHAR = exports.STRICT_URL_CHAR + .concat(['\t', '\f']); +// All characters with 0x80 bit set to 1 +for (let i = 0x80; i <= 0xff; i++) { + exports.URL_CHAR.push(i); +} +exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']); +/* Tokens as defined by rfc 2616. Also lowercases them. + * token = 1* + * separators = "(" | ")" | "<" | ">" | "@" + * | "," | ";" | ":" | "\" | <"> + * | "/" | "[" | "]" | "?" | "=" + * | "{" | "}" | SP | HT */ -encodeFloat.compareTokens = encodeUint.compareTokens +exports.STRICT_TOKEN = [ + '!', '#', '$', '%', '&', '\'', + '*', '+', '-', '.', + '^', '_', '`', + '|', '~', +].concat(exports.ALPHANUM); +exports.TOKEN = exports.STRICT_TOKEN.concat([' ']); /* -encodeFloat.compareTokens = function compareTokens (_tok1, _tok2) { - return _tok1 - throw new Error(`${encodeErrPrefix} cannot use floats as map keys`) + * Verify that a char is a valid visible (printable) US-ASCII + * character or %x80-FF + */ +exports.HEADER_CHARS = ['\t']; +for (let i = 32; i <= 255; i++) { + if (i !== 127) { + exports.HEADER_CHARS.push(i); + } } -*/ +// ',' = \x44 +exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44); +exports.MAJOR = exports.NUM_MAP; +exports.MINOR = exports.MAJOR; +var HEADER_STATE; +(function (HEADER_STATE) { + HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL"; + HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION"; + HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH"; + HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING"; + HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE"; + HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE"; + HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE"; + HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE"; + HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED"; +})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {})); +exports.SPECIAL_HEADERS = { + 'connection': HEADER_STATE.CONNECTION, + 'content-length': HEADER_STATE.CONTENT_LENGTH, + 'proxy-connection': HEADER_STATE.CONNECTION, + 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING, + 'upgrade': HEADER_STATE.UPGRADE, +}; +//# sourceMappingURL=constants.js.map -;// CONCATENATED MODULE: ./node_modules/cborg/lib/jump.js +/***/ }), +/***/ 87503: +/***/ ((module) => { +module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYU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WxsaHR0cF9zZXRfbGVuaWVudF9rZWVwX2FsaXZlACQkbGxodHRwX3NldF9sZW5pZW50X3RyYW5zZmVyX2VuY29kaW5nACUYbGxodHRwX21lc3NhZ2VfbmVlZHNfZW9mAD8JFwEAQQELEQECAwQFCwYHNTk3MS8tJyspCsLgAkUCAAsIABCIgICAAAsZACAAEMKAgIAAGiAAIAI2AjggACABOgAoCxwAIAAgAC8BMiAALQAuIAAQwYCAgAAQgICAgAALKgEBf0HAABDGgICAACIBEMKAgIAAGiABQYCIgIAANgI4IAEgADoAKCABCwoAIAAQyICAgAALBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LRQEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABDCgICAABogACAENgI4IAAgAzoAKCAAIAI6AC0gACABNgIYCxEAIAAgASABIAJqEMOAgIAACxAAIABBAEHcABDMgICAABoLZwEBf0EAIQECQCAAKAIMDQACQAJAAkACQCAALQAvDgMBAAMCCyAAKAI4IgFFDQAgASgCLCIBRQ0AIAAgARGAgICAAAAiAQ0DC0EADwsQyoCAgAAACyAAQcOWgIAANgIQQQ4hAQsgAQseAAJAIAAoAgwNACAAQdGbgIAANgIQIABBFTYCDAsLFgACQCAAKAIMQRVHDQAgAEEANgIMCwsWAAJAIAAoAgxBFkcNACAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsiAAJAIABBJEkNABDKgICAAAALIABBAnRBoLOAgABqKAIACyIAAkAgAEEuSQ0AEMqAgIAAAAsgAEECdEGwtICAAGooAgAL7gsBAX9B66iAgAAhAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAA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8BMCIEQQJxRQ0BDAILQQAhAyAALwEwIgRBAXFFDQELQQEhAyAALQAoQQFGDQAgAC8BMkH//wNxIgVBnH9qQeQASQ0AIAVBzAFGDQAgBUGwAkYNACAEQcAAcQ0AQQAhAyAEQYgEcUGABEYNACAEQShxQQBHIQMLIABBADsBMCAAQQA6AC8gAwuZAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQBBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC1kAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEHdATYCHEEAC3sBAX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACEMSAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvk8wEDDn8DfgR/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAk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QAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQDscBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxweHyAhIyUoP0BBREVGR0hJSktMTU9QUVJT3gNXWVtcXWBiZWZnaGlqa2xtb3BxcnN0dXZ3eHl6e3x9foABggGFAYYBhwGJAYsBjAGNAY4BjwGQAZEBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAc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0AIAEhAQxNCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDLEBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxRCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLABCyAAQQA2AhwgACABNgIUIABBxoqAgAA2AhAgAEEHNgIMQQAhEAyvAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAU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AAAAAAAAAAAAACIB/QsDACAAIAH9CwMAIABBMGogAf0LAwAgAEEgaiAB/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAKAIcIhBBf2oO3QHaAQHZAQIDBAUGBwgJCgsMDQ7YAQ8Q1wEREtYBExQVFhcYGRob4AHfARwdHtUBHyAhIiMkJdQBJicoKSorLNMB0gEtLtEB0AEvMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUbbAUdISUrPAc4BS80BTMwBTU5PUFFSU1RVVldYWVpbXF1eX2B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EhEAwVC0GvASEQDBQLQbABIRAMEwtBsQEhEAwSC0GzASEQDBELQbIBIRAMEAtBtAEhEAwPC0G1ASEQDA4LQbYBIRAMDQtBtwEhEAwMC0G4ASEQDAsLQbkBIRAMCgtBugEhEAwJC0G7ASEQDAgLQcYBIRAMBwtBvAEhEAwGC0G9ASEQDAULQb4BIRAMBAtBvwEhEAwDC0HAASEQDAILQcIBIRAMAQtBwQEhEAsDQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJA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UFBMSEQDPMDCyAALQAuQQFGDesDDIcCCyAAIAEiASACEMCAgIAAQQFHDeYBIABCADcDIAznAQsgACABIgEgAhC0gICAACIQDecBIAEhAQz1AgsCQCABIgEgAkcNAEEGIRAM8AMLIAAgAUEBaiIBIAIQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQEMCgsgASIBIAJHDQZBGyEQDOADCwJAIAEiASACRw0AQRYhEAzgAwsgAEGKgICAADYCCCAAIAE2AgQgACABIAIQuICAgAAiEA3qASABIQFBICEQDMYDCwJAIAEiASACRg0AA0ACQCABLQAAQfC3gIAAai0AACIQQQJGDQACQCAQQX9qDgTlAewBAOsB7AELIAFBAWohAUEIIRAMyAMLIAFBAWoiASACRw0AC0EVIRAM3wMLQRUhEAzeAwsDQAJAIAEtAABB8LmAgABqLQ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hAgAEEINgIMQQAhEAy5AQsgAEEANgIAC0EAIRAgAEEANgIcIAAgATYCFCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDK0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDKwBCyAAQQA2AhwgACABNgIUIABB3IiAgAA2AhAgAEEHNgIMQQ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: true })); +exports.enumToMap = void 0; +function enumToMap(obj) { + const res = {}; + Object.keys(obj).forEach((key) => { + const value = obj[key]; + if (typeof value === 'number') { + res[key] = value; + } + }); + return res; +} +exports.enumToMap = enumToMap; +//# sourceMappingURL=utils.js.map -/** - * @typedef {import('../interface').DecodeOptions} DecodeOptions - */ +/***/ }), -/** - * @param {Uint8Array} data - * @param {number} pos - * @param {number} minor - */ -function invalidMinor (data, pos, minor) { - throw new Error(`${decodeErrPrefix} encountered invalid minor (${minor}) for major ${data[pos] >>> 5}`) -} +/***/ 36351: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * @param {string} msg - * @returns {()=>any} - */ -function errorer (msg) { - return () => { throw new Error(`${decodeErrPrefix} ${msg}`) } -} -/** @type {((data:Uint8Array, pos:number, minor:number, options?:DecodeOptions) => any)[]} */ -const jump = [] -// unsigned integer, 0x00..0x17 (0..23) -for (let i = 0; i <= 0x17; i++) { - jump[i] = invalidMinor // uint.decodeUintCompact, handled by quick[] -} -jump[0x18] = decodeUint8 // unsigned integer, one-byte uint8_t follows -jump[0x19] = decodeUint16 // unsigned integer, two-byte uint16_t follows -jump[0x1a] = decodeUint32 // unsigned integer, four-byte uint32_t follows -jump[0x1b] = decodeUint64 // unsigned integer, eight-byte uint64_t follows -jump[0x1c] = invalidMinor -jump[0x1d] = invalidMinor -jump[0x1e] = invalidMinor -jump[0x1f] = invalidMinor -// negative integer, -1-0x00..-1-0x17 (-1..-24) -for (let i = 0x20; i <= 0x37; i++) { - jump[i] = invalidMinor // negintDecode, handled by quick[] -} -jump[0x38] = decodeNegint8 // negative integer, -1-n one-byte uint8_t for n follows -jump[0x39] = decodeNegint16 // negative integer, -1-n two-byte uint16_t for n follows -jump[0x3a] = decodeNegint32 // negative integer, -1-n four-byte uint32_t for follows -jump[0x3b] = decodeNegint64 // negative integer, -1-n eight-byte uint64_t for follows -jump[0x3c] = invalidMinor -jump[0x3d] = invalidMinor -jump[0x3e] = invalidMinor -jump[0x3f] = invalidMinor -// byte string, 0x00..0x17 bytes follow -for (let i = 0x40; i <= 0x57; i++) { - jump[i] = decodeBytesCompact -} -jump[0x58] = decodeBytes8 // byte string, one-byte uint8_t for n, and then n bytes follow -jump[0x59] = decodeBytes16 // byte string, two-byte uint16_t for n, and then n bytes follow -jump[0x5a] = decodeBytes32 // byte string, four-byte uint32_t for n, and then n bytes follow -jump[0x5b] = decodeBytes64 // byte string, eight-byte uint64_t for n, and then n bytes follow -jump[0x5c] = invalidMinor -jump[0x5d] = invalidMinor -jump[0x5e] = invalidMinor -jump[0x5f] = errorer('indefinite length bytes/strings are not supported') // byte string, byte strings follow, terminated by "break" -// UTF-8 string 0x00..0x17 bytes follow -for (let i = 0x60; i <= 0x77; i++) { - jump[i] = decodeStringCompact -} -jump[0x78] = decodeString8 // UTF-8 string, one-byte uint8_t for n, and then n bytes follow -jump[0x79] = decodeString16 // UTF-8 string, two-byte uint16_t for n, and then n bytes follow -jump[0x7a] = decodeString32 // UTF-8 string, four-byte uint32_t for n, and then n bytes follow -jump[0x7b] = decodeString64 // UTF-8 string, eight-byte uint64_t for n, and then n bytes follow -jump[0x7c] = invalidMinor -jump[0x7d] = invalidMinor -jump[0x7e] = invalidMinor -jump[0x7f] = errorer('indefinite length bytes/strings are not supported') // UTF-8 strings follow, terminated by "break" -// array, 0x00..0x17 data items follow -for (let i = 0x80; i <= 0x97; i++) { - jump[i] = decodeArrayCompact -} -jump[0x98] = decodeArray8 // array, one-byte uint8_t for n, and then n data items follow -jump[0x99] = decodeArray16 // array, two-byte uint16_t for n, and then n data items follow -jump[0x9a] = decodeArray32 // array, four-byte uint32_t for n, and then n data items follow -jump[0x9b] = decodeArray64 // array, eight-byte uint64_t for n, and then n data items follow -jump[0x9c] = invalidMinor -jump[0x9d] = invalidMinor -jump[0x9e] = invalidMinor -jump[0x9f] = decodeArrayIndefinite // array, data items follow, terminated by "break" -// map, 0x00..0x17 pairs of data items follow -for (let i = 0xa0; i <= 0xb7; i++) { - jump[i] = decodeMapCompact -} -jump[0xb8] = decodeMap8 // map, one-byte uint8_t for n, and then n pairs of data items follow -jump[0xb9] = decodeMap16 // map, two-byte uint16_t for n, and then n pairs of data items follow -jump[0xba] = decodeMap32 // map, four-byte uint32_t for n, and then n pairs of data items follow -jump[0xbb] = decodeMap64 // map, eight-byte uint64_t for n, and then n pairs of data items follow -jump[0xbc] = invalidMinor -jump[0xbd] = invalidMinor -jump[0xbe] = invalidMinor -jump[0xbf] = decodeMapIndefinite // map, pairs of data items follow, terminated by "break" -// tags -for (let i = 0xc0; i <= 0xd7; i++) { - jump[i] = decodeTagCompact -} -jump[0xd8] = decodeTag8 -jump[0xd9] = decodeTag16 -jump[0xda] = decodeTag32 -jump[0xdb] = decodeTag64 -jump[0xdc] = invalidMinor -jump[0xdd] = invalidMinor -jump[0xde] = invalidMinor -jump[0xdf] = invalidMinor -// 0xe0..0xf3 simple values, unsupported -for (let i = 0xe0; i <= 0xf3; i++) { - jump[i] = errorer('simple values are not supported') -} -jump[0xf4] = invalidMinor // false, handled by quick[] -jump[0xf5] = invalidMinor // true, handled by quick[] -jump[0xf6] = invalidMinor // null, handled by quick[] -jump[0xf7] = decodeUndefined // undefined -jump[0xf8] = errorer('simple values are not supported') // simple value, one byte follows, unsupported -jump[0xf9] = decodeFloat16 // half-precision float (two-byte IEEE 754) -jump[0xfa] = decodeFloat32 // single-precision float (four-byte IEEE 754) -jump[0xfb] = decodeFloat64 // double-precision float (eight-byte IEEE 754) -jump[0xfc] = invalidMinor -jump[0xfd] = invalidMinor -jump[0xfe] = invalidMinor -jump[0xff] = decodeBreak // "break" stop code +const { kClients } = __nccwpck_require__(69898) +const Agent = __nccwpck_require__(83272) +const { + kAgent, + kMockAgentSet, + kMockAgentGet, + kDispatches, + kIsMockActive, + kNetConnect, + kGetNetConnect, + kOptions, + kFactory +} = __nccwpck_require__(93889) +const MockClient = __nccwpck_require__(43851) +const MockPool = __nccwpck_require__(34448) +const { matchValue, buildMockOptions } = __nccwpck_require__(64263) +const { InvalidArgumentError, UndiciError } = __nccwpck_require__(70867) +const Dispatcher = __nccwpck_require__(13624) +const Pluralizer = __nccwpck_require__(53753) +const PendingInterceptorsFormatter = __nccwpck_require__(78868) -/** @type {Token[]} */ -const quick = [] -// ints <24 -for (let i = 0; i < 24; i++) { - quick[i] = new token_Token(token_Type.uint, i, 1) -} -// negints >= -24 -for (let i = -1; i >= -24; i--) { - quick[31 - i] = new token_Token(token_Type.negint, i, 1) +class FakeWeakRef { + constructor (value) { + this.value = value + } + + deref () { + return this.value + } } -// empty bytes -quick[0x40] = new token_Token(token_Type.bytes, new Uint8Array(0), 1) -// empty string -quick[0x60] = new token_Token(token_Type.string, '', 1) -// empty list -quick[0x80] = new token_Token(token_Type.array, 0, 1) -// empty map -quick[0xa0] = new token_Token(token_Type.map, 0, 1) -// false -quick[0xf4] = new token_Token(token_Type["false"], false, 1) -// true -quick[0xf5] = new token_Token(token_Type["true"], true, 1) -// null -quick[0xf6] = new token_Token(token_Type["null"], null, 1) -/** - * @param {Token} token - * @returns {Uint8Array|undefined} - */ -function quickEncodeToken (token) { - switch (token.type) { - case token_Type["false"]: - return fromArray([0xf4]) - case token_Type["true"]: - return fromArray([0xf5]) - case token_Type["null"]: - return fromArray([0xf6]) - case token_Type.bytes: - if (!token.value.length) { - return fromArray([0x40]) - } - return - case token_Type.string: - if (token.value === '') { - return fromArray([0x60]) - } - return - case token_Type.array: - if (token.value === 0) { - return fromArray([0x80]) - } - /* c8 ignore next 2 */ - // shouldn't be possible if this were called when there was only one token - return - case token_Type.map: - if (token.value === 0) { - return fromArray([0xa0]) +class MockAgent extends Dispatcher { + constructor (opts) { + super(opts) + + this[kNetConnect] = true + this[kIsMockActive] = true + + // Instantiate Agent and encapsulate + if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) { + throw new InvalidArgumentError('Argument opts.agent must implement Agent') + } + const agent = opts && opts.agent ? opts.agent : new Agent(opts) + this[kAgent] = agent + + this[kClients] = agent[kClients] + this[kOptions] = buildMockOptions(opts) + } + + get (origin) { + let dispatcher = this[kMockAgentGet](origin) + + if (!dispatcher) { + dispatcher = this[kFactory](origin) + this[kMockAgentSet](origin, dispatcher) + } + return dispatcher + } + + dispatch (opts, handler) { + // Call MockAgent.get to perform additional setup before dispatching as normal + this.get(opts.origin) + return this[kAgent].dispatch(opts, handler) + } + + async close () { + await this[kAgent].close() + this[kClients].clear() + } + + deactivate () { + this[kIsMockActive] = false + } + + activate () { + this[kIsMockActive] = true + } + + enableNetConnect (matcher) { + if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) { + if (Array.isArray(this[kNetConnect])) { + this[kNetConnect].push(matcher) + } else { + this[kNetConnect] = [matcher] } - /* c8 ignore next 2 */ - // shouldn't be possible if this were called when there was only one token - return - case token_Type.uint: - if (token.value < 24) { - return fromArray([Number(token.value)]) + } else if (typeof matcher === 'undefined') { + this[kNetConnect] = true + } else { + throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.') + } + } + + disableNetConnect () { + this[kNetConnect] = false + } + + // This is required to bypass issues caused by using global symbols - see: + // https://github.com/nodejs/undici/issues/1447 + get isMockActive () { + return this[kIsMockActive] + } + + [kMockAgentSet] (origin, dispatcher) { + this[kClients].set(origin, new FakeWeakRef(dispatcher)) + } + + [kFactory] (origin) { + const mockOptions = Object.assign({ agent: this }, this[kOptions]) + return this[kOptions] && this[kOptions].connections === 1 + ? new MockClient(origin, mockOptions) + : new MockPool(origin, mockOptions) + } + + [kMockAgentGet] (origin) { + // First check if we can immediately find it + const ref = this[kClients].get(origin) + if (ref) { + return ref.deref() + } + + // If the origin is not a string create a dummy parent pool and return to user + if (typeof origin !== 'string') { + const dispatcher = this[kFactory]('http://localhost:9999') + this[kMockAgentSet](origin, dispatcher) + return dispatcher + } + + // If we match, create a pool and assign the same dispatches + for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) { + const nonExplicitDispatcher = nonExplicitRef.deref() + if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) { + const dispatcher = this[kFactory](origin) + this[kMockAgentSet](origin, dispatcher) + dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches] + return dispatcher } + } + } + + [kGetNetConnect] () { + return this[kNetConnect] + } + + pendingInterceptors () { + const mockAgentClients = this[kClients] + + return Array.from(mockAgentClients.entries()) + .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin }))) + .filter(({ pending }) => pending) + } + + assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) { + const pending = this.pendingInterceptors() + + if (pending.length === 0) { return - case token_Type.negint: - if (token.value >= -24) { - return fromArray([31 - Number(token.value)]) - } + } + + const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length) + + throw new UndiciError(` +${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending: + +${pendingInterceptorsFormatter.format(pending)} +`.trim()) } } -;// CONCATENATED MODULE: ./node_modules/cborg/lib/encode.js +module.exports = MockAgent +/***/ }), +/***/ 43851: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +const { promisify } = __nccwpck_require__(73837) +const Client = __nccwpck_require__(41421) +const { buildMockDispatch } = __nccwpck_require__(64263) +const { + kDispatches, + kMockAgent, + kClose, + kOriginalClose, + kOrigin, + kOriginalDispatch, + kConnected +} = __nccwpck_require__(93889) +const { MockInterceptor } = __nccwpck_require__(5489) +const Symbols = __nccwpck_require__(69898) +const { InvalidArgumentError } = __nccwpck_require__(70867) +/** + * MockClient provides an API that extends the Client to influence the mockDispatches. + */ +class MockClient extends Client { + constructor (origin, opts) { + super(origin, opts) + if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') { + throw new InvalidArgumentError('Argument opts.agent must implement Agent') + } + this[kMockAgent] = opts.agent + this[kOrigin] = origin + this[kDispatches] = [] + this[kConnected] = 1 + this[kOriginalDispatch] = this.dispatch + this[kOriginalClose] = this.close.bind(this) + this.dispatch = buildMockDispatch.call(this) + this.close = this[kClose] + } + get [Symbols.kConnected] () { + return this[kConnected] + } + /** + * Sets up the base interceptor for mocking replies from undici. + */ + intercept (opts) { + return new MockInterceptor(opts, this[kDispatches]) + } + async [kClose] () { + await promisify(this[kOriginalClose])() + this[kConnected] = 0 + this[kMockAgent][Symbols.kClients].delete(this[kOrigin]) + } +} +module.exports = MockClient -/** - * @typedef {import('../interface').EncodeOptions} EncodeOptions - * @typedef {import('../interface').OptionalTypeEncoder} OptionalTypeEncoder - * @typedef {import('../interface').Reference} Reference - * @typedef {import('../interface').StrictTypeEncoder} StrictTypeEncoder - * @typedef {import('../interface').TokenTypeEncoder} TokenTypeEncoder - * @typedef {import('../interface').TokenOrNestedTokens} TokenOrNestedTokens - */ +/***/ }), -/** @type {EncodeOptions} */ -const defaultEncodeOptions = { - float64: false, - mapSorter, - quickEncodeToken: quickEncodeToken +/***/ 28560: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const { UndiciError } = __nccwpck_require__(70867) + +class MockNotMatchedError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, MockNotMatchedError) + this.name = 'MockNotMatchedError' + this.message = message || 'The request does not match any registered mock dispatches' + this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED' + } } -/** @returns {TokenTypeEncoder[]} */ -function makeCborEncoders () { - const encoders = [] - encoders[token_Type.uint.major] = encodeUint - encoders[token_Type.negint.major] = encodeNegint - encoders[token_Type.bytes.major] = encodeBytes - encoders[token_Type.string.major] = encodeString - encoders[token_Type.array.major] = encodeArray - encoders[token_Type.map.major] = encodeMap - encoders[token_Type.tag.major] = encodeTag - encoders[token_Type.float.major] = encodeFloat - return encoders +module.exports = { + MockNotMatchedError } -const cborEncoders = makeCborEncoders() -const buf = new Bl() +/***/ }), + +/***/ 5489: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(64263) +const { + kDispatches, + kDispatchKey, + kDefaultHeaders, + kDefaultTrailers, + kContentLength, + kMockDispatch +} = __nccwpck_require__(93889) +const { InvalidArgumentError } = __nccwpck_require__(70867) +const { buildURL } = __nccwpck_require__(43061) + +/** + * Defines the scope API for an interceptor reply + */ +class MockScope { + constructor (mockDispatch) { + this[kMockDispatch] = mockDispatch + } -/** @implements {Reference} */ -class Ref { /** - * @param {object|any[]} obj - * @param {Reference|undefined} parent + * Delay a reply by a set amount in ms. */ - constructor (obj, parent) { - this.obj = obj - this.parent = parent + delay (waitInMs) { + if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) { + throw new InvalidArgumentError('waitInMs must be a valid integer > 0') + } + + this[kMockDispatch].delay = waitInMs + return this } /** - * @param {object|any[]} obj - * @returns {boolean} + * For a defined reply, never mark as consumed. */ - includes (obj) { - /** @type {Reference|undefined} */ - let p = this - do { - if (p.obj === obj) { - return true - } - } while (p = p.parent) // eslint-disable-line - return false + persist () { + this[kMockDispatch].persist = true + return this } /** - * @param {Reference|undefined} stack - * @param {object|any[]} obj - * @returns {Reference} + * Allow one to define a reply for a set amount of matching requests. */ - static createCheck (stack, obj) { - if (stack && stack.includes(obj)) { - throw new Error(`${encodeErrPrefix} object contains circular references`) + times (repeatTimes) { + if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) { + throw new InvalidArgumentError('repeatTimes must be a valid integer > 0') } - return new Ref(obj, stack) + + this[kMockDispatch].times = repeatTimes + return this } } -const simpleTokens = { - null: new token_Token(token_Type["null"], null), - undefined: new token_Token(token_Type.undefined, undefined), - true: new token_Token(token_Type["true"], true), - false: new token_Token(token_Type["false"], false), - emptyArray: new token_Token(token_Type.array, 0), - emptyMap: new token_Token(token_Type.map, 0) -} +/** + * Defines an interceptor for a Mock + */ +class MockInterceptor { + constructor (opts, mockDispatches) { + if (typeof opts !== 'object') { + throw new InvalidArgumentError('opts must be an object') + } + if (typeof opts.path === 'undefined') { + throw new InvalidArgumentError('opts.path must be defined') + } + if (typeof opts.method === 'undefined') { + opts.method = 'GET' + } + // See https://github.com/nodejs/undici/issues/1245 + // As per RFC 3986, clients are not supposed to send URI + // fragments to servers when they retrieve a document, + if (typeof opts.path === 'string') { + if (opts.query) { + opts.path = buildURL(opts.path, opts.query) + } else { + // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811 + const parsedURL = new URL(opts.path, 'data://') + opts.path = parsedURL.pathname + parsedURL.search + } + } + if (typeof opts.method === 'string') { + opts.method = opts.method.toUpperCase() + } -/** @type {{[typeName: string]: StrictTypeEncoder}} */ -const typeEncoders = { - /** - * @param {any} obj - * @param {string} _typ - * @param {EncodeOptions} _options - * @param {Reference} [_refStack] - * @returns {TokenOrNestedTokens} - */ - number (obj, _typ, _options, _refStack) { - if (!Number.isInteger(obj) || !Number.isSafeInteger(obj)) { - return new token_Token(token_Type.float, obj) - } else if (obj >= 0) { - return new token_Token(token_Type.uint, obj) - } else { - return new token_Token(token_Type.negint, obj) + this[kDispatchKey] = buildKey(opts) + this[kDispatches] = mockDispatches + this[kDefaultHeaders] = {} + this[kDefaultTrailers] = {} + this[kContentLength] = false + } + + createMockScopeDispatchData (statusCode, data, responseOptions = {}) { + const responseData = getResponseData(data) + const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {} + const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers } + const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers } + + return { statusCode, data, headers, trailers } + } + + validateReplyParameters (statusCode, data, responseOptions) { + if (typeof statusCode === 'undefined') { + throw new InvalidArgumentError('statusCode must be defined') } - }, + if (typeof data === 'undefined') { + throw new InvalidArgumentError('data must be defined') + } + if (typeof responseOptions !== 'object') { + throw new InvalidArgumentError('responseOptions must be an object') + } + } /** - * @param {any} obj - * @param {string} _typ - * @param {EncodeOptions} _options - * @param {Reference} [_refStack] - * @returns {TokenOrNestedTokens} + * Mock an undici request with a defined reply. */ - bigint (obj, _typ, _options, _refStack) { - if (obj >= BigInt(0)) { - return new token_Token(token_Type.uint, obj) - } else { - return new token_Token(token_Type.negint, obj) + reply (replyData) { + // Values of reply aren't available right now as they + // can only be available when the reply callback is invoked. + if (typeof replyData === 'function') { + // We'll first wrap the provided callback in another function, + // this function will properly resolve the data from the callback + // when invoked. + const wrappedDefaultsCallback = (opts) => { + // Our reply options callback contains the parameter for statusCode, data and options. + const resolvedData = replyData(opts) + + // Check if it is in the right format + if (typeof resolvedData !== 'object') { + throw new InvalidArgumentError('reply options callback must return an object') + } + + const { statusCode, data = '', responseOptions = {} } = resolvedData + this.validateReplyParameters(statusCode, data, responseOptions) + // Since the values can be obtained immediately we return them + // from this higher order function that will be resolved later. + return { + ...this.createMockScopeDispatchData(statusCode, data, responseOptions) + } + } + + // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data. + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback) + return new MockScope(newMockDispatch) } - }, - /** - * @param {any} obj - * @param {string} _typ - * @param {EncodeOptions} _options - * @param {Reference} [_refStack] - * @returns {TokenOrNestedTokens} - */ - Uint8Array (obj, _typ, _options, _refStack) { - return new token_Token(token_Type.bytes, obj) - }, + // We can have either one or three parameters, if we get here, + // we should have 1-3 parameters. So we spread the arguments of + // this function to obtain the parameters, since replyData will always + // just be the statusCode. + const [statusCode, data = '', responseOptions = {}] = [...arguments] + this.validateReplyParameters(statusCode, data, responseOptions) - /** - * @param {any} obj - * @param {string} _typ - * @param {EncodeOptions} _options - * @param {Reference} [_refStack] - * @returns {TokenOrNestedTokens} - */ - string (obj, _typ, _options, _refStack) { - return new token_Token(token_Type.string, obj) - }, + // Send in-already provided data like usual + const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions) + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData) + return new MockScope(newMockDispatch) + } /** - * @param {any} obj - * @param {string} _typ - * @param {EncodeOptions} _options - * @param {Reference} [_refStack] - * @returns {TokenOrNestedTokens} + * Mock an undici request with a defined error. */ - boolean (obj, _typ, _options, _refStack) { - return obj ? simpleTokens.true : simpleTokens.false - }, + replyWithError (error) { + if (typeof error === 'undefined') { + throw new InvalidArgumentError('error must be defined') + } - /** - * @param {any} _obj - * @param {string} _typ - * @param {EncodeOptions} _options - * @param {Reference} [_refStack] - * @returns {TokenOrNestedTokens} - */ - null (_obj, _typ, _options, _refStack) { - return simpleTokens.null - }, + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error }) + return new MockScope(newMockDispatch) + } /** - * @param {any} _obj - * @param {string} _typ - * @param {EncodeOptions} _options - * @param {Reference} [_refStack] - * @returns {TokenOrNestedTokens} + * Set default reply headers on the interceptor for subsequent replies */ - undefined (_obj, _typ, _options, _refStack) { - return simpleTokens.undefined - }, + defaultReplyHeaders (headers) { + if (typeof headers === 'undefined') { + throw new InvalidArgumentError('headers must be defined') + } - /** - * @param {any} obj - * @param {string} _typ - * @param {EncodeOptions} _options - * @param {Reference} [_refStack] - * @returns {TokenOrNestedTokens} - */ - ArrayBuffer (obj, _typ, _options, _refStack) { - return new token_Token(token_Type.bytes, new Uint8Array(obj)) - }, + this[kDefaultHeaders] = headers + return this + } /** - * @param {any} obj - * @param {string} _typ - * @param {EncodeOptions} _options - * @param {Reference} [_refStack] - * @returns {TokenOrNestedTokens} + * Set default reply trailers on the interceptor for subsequent replies */ - DataView (obj, _typ, _options, _refStack) { - return new token_Token(token_Type.bytes, new Uint8Array(obj.buffer, obj.byteOffset, obj.byteLength)) - }, + defaultReplyTrailers (trailers) { + if (typeof trailers === 'undefined') { + throw new InvalidArgumentError('trailers must be defined') + } + + this[kDefaultTrailers] = trailers + return this + } /** - * @param {any} obj - * @param {string} _typ - * @param {EncodeOptions} options - * @param {Reference} [refStack] - * @returns {TokenOrNestedTokens} + * Set reply content length header for replies on the interceptor */ - Array (obj, _typ, options, refStack) { - if (!obj.length) { - if (options.addBreakTokens === true) { - return [simpleTokens.emptyArray, new token_Token(token_Type["break"])] - } - return simpleTokens.emptyArray - } - refStack = Ref.createCheck(refStack, obj) - const entries = [] - let i = 0 - for (const e of obj) { - entries[i++] = encode_objectToTokens(e, options, refStack) - } - if (options.addBreakTokens) { - return [new token_Token(token_Type.array, obj.length), entries, new token_Token(token_Type["break"])] + replyContentLength () { + this[kContentLength] = true + return this + } +} + +module.exports.MockInterceptor = MockInterceptor +module.exports.MockScope = MockScope + + +/***/ }), + +/***/ 34448: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const { promisify } = __nccwpck_require__(73837) +const Pool = __nccwpck_require__(59310) +const { buildMockDispatch } = __nccwpck_require__(64263) +const { + kDispatches, + kMockAgent, + kClose, + kOriginalClose, + kOrigin, + kOriginalDispatch, + kConnected +} = __nccwpck_require__(93889) +const { MockInterceptor } = __nccwpck_require__(5489) +const Symbols = __nccwpck_require__(69898) +const { InvalidArgumentError } = __nccwpck_require__(70867) + +/** + * MockPool provides an API that extends the Pool to influence the mockDispatches. + */ +class MockPool extends Pool { + constructor (origin, opts) { + super(origin, opts) + + if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') { + throw new InvalidArgumentError('Argument opts.agent must implement Agent') } - return [new token_Token(token_Type.array, obj.length), entries] - }, + + this[kMockAgent] = opts.agent + this[kOrigin] = origin + this[kDispatches] = [] + this[kConnected] = 1 + this[kOriginalDispatch] = this.dispatch + this[kOriginalClose] = this.close.bind(this) + + this.dispatch = buildMockDispatch.call(this) + this.close = this[kClose] + } + + get [Symbols.kConnected] () { + return this[kConnected] + } /** - * @param {any} obj - * @param {string} typ - * @param {EncodeOptions} options - * @param {Reference} [refStack] - * @returns {TokenOrNestedTokens} + * Sets up the base interceptor for mocking replies from undici. */ - Object (obj, typ, options, refStack) { - // could be an Object or a Map - const isMap = typ !== 'Object' - // it's slightly quicker to use Object.keys() than Object.entries() - const keys = isMap ? obj.keys() : Object.keys(obj) - const length = isMap ? obj.size : keys.length - if (!length) { - if (options.addBreakTokens === true) { - return [simpleTokens.emptyMap, new token_Token(token_Type["break"])] - } - return simpleTokens.emptyMap - } - refStack = Ref.createCheck(refStack, obj) - /** @type {TokenOrNestedTokens[]} */ - const entries = [] - let i = 0 - for (const key of keys) { - entries[i++] = [ - encode_objectToTokens(key, options, refStack), - encode_objectToTokens(isMap ? obj.get(key) : obj[key], options, refStack) - ] - } - sortMapEntries(entries, options) - if (options.addBreakTokens) { - return [new token_Token(token_Type.map, length), entries, new token_Token(token_Type["break"])] - } - return [new token_Token(token_Type.map, length), entries] + intercept (opts) { + return new MockInterceptor(opts, this[kDispatches]) + } + + async [kClose] () { + await promisify(this[kOriginalClose])() + this[kConnected] = 0 + this[kMockAgent][Symbols.kClients].delete(this[kOrigin]) } } -typeEncoders.Map = typeEncoders.Object -typeEncoders.Buffer = typeEncoders.Uint8Array -for (const typ of 'Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64'.split(' ')) { - typeEncoders[`${typ}Array`] = typeEncoders.DataView +module.exports = MockPool + + +/***/ }), + +/***/ 93889: +/***/ ((module) => { + + + +module.exports = { + kAgent: Symbol('agent'), + kOptions: Symbol('options'), + kFactory: Symbol('factory'), + kDispatches: Symbol('dispatches'), + kDispatchKey: Symbol('dispatch key'), + kDefaultHeaders: Symbol('default headers'), + kDefaultTrailers: Symbol('default trailers'), + kContentLength: Symbol('content length'), + kMockAgent: Symbol('mock agent'), + kMockAgentSet: Symbol('mock agent set'), + kMockAgentGet: Symbol('mock agent get'), + kMockDispatch: Symbol('mock dispatch'), + kClose: Symbol('close'), + kOriginalClose: Symbol('original agent close'), + kOrigin: Symbol('origin'), + kIsMockActive: Symbol('is mock active'), + kNetConnect: Symbol('net connect'), + kGetNetConnect: Symbol('get net connect'), + kConnected: Symbol('connected') +} + + +/***/ }), + +/***/ 64263: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const { MockNotMatchedError } = __nccwpck_require__(28560) +const { + kDispatches, + kMockAgent, + kOriginalDispatch, + kOrigin, + kGetNetConnect +} = __nccwpck_require__(93889) +const { buildURL, nop } = __nccwpck_require__(43061) +const { STATUS_CODES } = __nccwpck_require__(13685) +const { + types: { + isPromise + } +} = __nccwpck_require__(73837) + +function matchValue (match, value) { + if (typeof match === 'string') { + return match === value + } + if (match instanceof RegExp) { + return match.test(value) + } + if (typeof match === 'function') { + return match(value) === true + } + return false +} + +function lowerCaseEntries (headers) { + return Object.fromEntries( + Object.entries(headers).map(([headerName, headerValue]) => { + return [headerName.toLocaleLowerCase(), headerValue] + }) + ) } /** - * @param {any} obj - * @param {EncodeOptions} [options] - * @param {Reference} [refStack] - * @returns {TokenOrNestedTokens} + * @param {import('../../index').Headers|string[]|Record} headers + * @param {string} key */ -function encode_objectToTokens (obj, options = {}, refStack) { - const typ = is(obj) - const customTypeEncoder = (options && options.typeEncoders && /** @type {OptionalTypeEncoder} */ options.typeEncoders[typ]) || typeEncoders[typ] - if (typeof customTypeEncoder === 'function') { - const tokens = customTypeEncoder(obj, typ, options, refStack) - if (tokens != null) { - return tokens +function getHeaderByName (headers, key) { + if (Array.isArray(headers)) { + for (let i = 0; i < headers.length; i += 2) { + if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) { + return headers[i + 1] + } } + + return undefined + } else if (typeof headers.get === 'function') { + return headers.get(key) + } else { + return lowerCaseEntries(headers)[key.toLocaleLowerCase()] } - const typeEncoder = typeEncoders[typ] - if (!typeEncoder) { - throw new Error(`${encodeErrPrefix} unsupported type: ${typ}`) +} + +/** @param {string[]} headers */ +function buildHeadersFromArray (headers) { // fetch HeadersList + const clone = headers.slice() + const entries = [] + for (let index = 0; index < clone.length; index += 2) { + entries.push([clone[index], clone[index + 1]]) } - return typeEncoder(obj, typ, options, refStack) + return Object.fromEntries(entries) } -/* -CBOR key sorting is a mess. +function matchHeaders (mockDispatch, headers) { + if (typeof mockDispatch.headers === 'function') { + if (Array.isArray(headers)) { // fetch HeadersList + headers = buildHeadersFromArray(headers) + } + return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {}) + } + if (typeof mockDispatch.headers === 'undefined') { + return true + } + if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') { + return false + } -The canonicalisation recommendation from https://tools.ietf.org/html/rfc7049#section-3.9 -includes the wording: + for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) { + const headerValue = getHeaderByName(headers, matchHeaderName) -> The keys in every map must be sorted lowest value to highest. -> Sorting is performed on the bytes of the representation of the key -> data items without paying attention to the 3/5 bit splitting for -> major types. -> ... -> * If two keys have different lengths, the shorter one sorts - earlier; -> * If two keys have the same length, the one with the lower value - in (byte-wise) lexical order sorts earlier. + if (!matchValue(matchHeaderValue, headerValue)) { + return false + } + } + return true +} -1. It is not clear what "bytes of the representation of the key" means: is it - the CBOR representation, or the binary representation of the object itself? - Consider the int and uint difference here. -2. It is not clear what "without paying attention to" means: do we include it - and compare on that? Or do we omit the special prefix byte, (mostly) treating - the key in its plain binary representation form. +function safeUrl (path) { + if (typeof path !== 'string') { + return path + } -The FIDO 2.0: Client To Authenticator Protocol spec takes the original CBOR -wording and clarifies it according to their understanding. -https://fidoalliance.org/specs/fido-v2.0-rd-20170927/fido-client-to-authenticator-protocol-v2.0-rd-20170927.html#message-encoding + const pathSegments = path.split('?') -> The keys in every map must be sorted lowest value to highest. Sorting is -> performed on the bytes of the representation of the key data items without -> paying attention to the 3/5 bit splitting for major types. The sorting rules -> are: -> * If the major types are different, the one with the lower value in numerical -> order sorts earlier. -> * If two keys have different lengths, the shorter one sorts earlier; -> * If two keys have the same length, the one with the lower value in -> (byte-wise) lexical order sorts earlier. + if (pathSegments.length !== 2) { + return path + } -Some other implementations, such as borc, do a full encode then do a -length-first, byte-wise-second comparison: -https://github.com/dignifiedquire/borc/blob/b6bae8b0bcde7c3976b0f0f0957208095c392a36/src/encoder.js#L358 -https://github.com/dignifiedquire/borc/blob/b6bae8b0bcde7c3976b0f0f0957208095c392a36/src/utils.js#L143-L151 + const qp = new URLSearchParams(pathSegments.pop()) + qp.sort() + return [...pathSegments, qp.toString()].join('?') +} -This has the benefit of being able to easily handle arbitrary keys, including -complex types (maps and arrays). +function matchKey (mockDispatch, { path, method, body, headers }) { + const pathMatch = matchValue(mockDispatch.path, path) + const methodMatch = matchValue(mockDispatch.method, method) + const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true + const headersMatch = matchHeaders(mockDispatch, headers) + return pathMatch && methodMatch && bodyMatch && headersMatch +} -We'll opt for the FIDO approach, since it affords some efficies since we don't -need a full encode of each key to determine order and can defer to the types -to determine how to most efficiently order their values (i.e. int and uint -ordering can be done on the numbers, no need for byte-wise, for example). +function getResponseData (data) { + if (Buffer.isBuffer(data)) { + return data + } else if (typeof data === 'object') { + return JSON.stringify(data) + } else { + return data.toString() + } +} -Recommendation: stick to single key types or you'll get into trouble, and prefer -string keys because it's much simpler that way. -*/ +function getMockDispatch (mockDispatches, key) { + const basePath = key.query ? buildURL(key.path, key.query) : key.path + const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath -/* -(UPDATE, Dec 2020) -https://tools.ietf.org/html/rfc8949 is the updated CBOR spec and clarifies some -of the questions above with a new recommendation for sorting order being much -closer to what would be expected in other environments (i.e. no length-first -weirdness). -This new sorting order is not yet implemented here but could be added as an -option. "Determinism" (canonicity) is system dependent and it's difficult to -change existing systems that are built with existing expectations. So if a new -ordering is introduced here, the old needs to be kept as well with the user -having the option. -*/ + // Match path + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath)) + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`) + } + + // Match method + matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method)) + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`) + } + + // Match body + matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true) + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`) + } + + // Match headers + matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers)) + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`) + } + + return matchedMockDispatches[0] +} + +function addMockDispatch (mockDispatches, key, data) { + const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false } + const replyData = typeof data === 'function' ? { callback: data } : { ...data } + const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } } + mockDispatches.push(newMockDispatch) + return newMockDispatch +} + +function deleteMockDispatch (mockDispatches, key) { + const index = mockDispatches.findIndex(dispatch => { + if (!dispatch.consumed) { + return false + } + return matchKey(dispatch, key) + }) + if (index !== -1) { + mockDispatches.splice(index, 1) + } +} + +function buildKey (opts) { + const { path, method, body, headers, query } = opts + return { + path, + method, + body, + headers, + query + } +} + +function generateKeyValues (data) { + return Object.entries(data).reduce((keyValuePairs, [key, value]) => [ + ...keyValuePairs, + Buffer.from(`${key}`), + Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`) + ], []) +} /** - * @param {TokenOrNestedTokens[]} entries - * @param {EncodeOptions} options + * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status + * @param {number} statusCode */ -function sortMapEntries (entries, options) { - if (options.mapSorter) { - entries.sort(options.mapSorter) +function getStatusText (statusCode) { + return STATUS_CODES[statusCode] || 'unknown' +} + +async function getResponse (body) { + const buffers = [] + for await (const data of body) { + buffers.push(data) } + return Buffer.concat(buffers).toString('utf8') } /** - * @param {(Token|Token[])[]} e1 - * @param {(Token|Token[])[]} e2 - * @returns {number} + * Mock dispatch function used to simulate undici dispatches */ -function mapSorter (e1, e2) { - // the key position ([0]) could have a single token or an array - // almost always it'll be a single token but complex key might get involved - /* c8 ignore next 2 */ - const keyToken1 = Array.isArray(e1[0]) ? e1[0][0] : e1[0] - const keyToken2 = Array.isArray(e2[0]) ? e2[0][0] : e2[0] +function mockDispatch (opts, handler) { + // Get mock dispatch from built key + const key = buildKey(opts) + const mockDispatch = getMockDispatch(this[kDispatches], key) - // different key types - if (keyToken1.type !== keyToken2.type) { - return keyToken1.type.compare(keyToken2.type) + mockDispatch.timesInvoked++ + + // Here's where we resolve a callback if a callback is present for the dispatch data. + if (mockDispatch.data.callback) { + mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) } } - const major = keyToken1.type.major - // TODO: handle case where cmp === 0 but there are more keyToken e. complex type) - const tcmp = cborEncoders[major].compareTokens(keyToken1, keyToken2) - /* c8 ignore next 5 */ - if (tcmp === 0) { - // duplicate key or complex type where the first token matched, - // i.e. a map or array and we're only comparing the opening token - console.warn('WARNING: complex key types used, CBOR key sorting guarantees are gone') + // Parse mockDispatch data + const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch + const { timesInvoked, times } = mockDispatch + + // If it's used up and not persistent, mark as consumed + mockDispatch.consumed = !persist && timesInvoked >= times + mockDispatch.pending = timesInvoked < times + + // If specified, trigger dispatch error + if (error !== null) { + deleteMockDispatch(this[kDispatches], key) + handler.onError(error) + return true } - return tcmp -} -/** - * @param {Bl} buf - * @param {TokenOrNestedTokens} tokens - * @param {TokenTypeEncoder[]} encoders - * @param {EncodeOptions} options - */ -function tokensToEncoded (buf, tokens, encoders, options) { - if (Array.isArray(tokens)) { - for (const token of tokens) { - tokensToEncoded(buf, token, encoders, options) - } + // Handle the request with a delay if necessary + if (typeof delay === 'number' && delay > 0) { + setTimeout(() => { + handleReply(this[kDispatches]) + }, delay) } else { - encoders[tokens.type.major](buf, tokens, options) + handleReply(this[kDispatches]) + } + + function handleReply (mockDispatches, _data = data) { + // fetch's HeadersList is a 1D string array + const optsHeaders = Array.isArray(opts.headers) + ? buildHeadersFromArray(opts.headers) + : opts.headers + const body = typeof _data === 'function' + ? _data({ ...opts, headers: optsHeaders }) + : _data + + // util.types.isPromise is likely needed for jest. + if (isPromise(body)) { + // If handleReply is asynchronous, throwing an error + // in the callback will reject the promise, rather than + // synchronously throw the error, which breaks some tests. + // Rather, we wait for the callback to resolve if it is a + // promise, and then re-run handleReply with the new body. + body.then((newData) => handleReply(mockDispatches, newData)) + return + } + + const responseData = getResponseData(body) + const responseHeaders = generateKeyValues(headers) + const responseTrailers = generateKeyValues(trailers) + + handler.abort = nop + handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode)) + handler.onData(Buffer.from(responseData)) + handler.onComplete(responseTrailers) + deleteMockDispatch(mockDispatches, key) } + + function resume () {} + + return true } -/** - * @param {any} data - * @param {TokenTypeEncoder[]} encoders - * @param {EncodeOptions} options - * @returns {Uint8Array} - */ -function encodeCustom (data, encoders, options) { - const tokens = encode_objectToTokens(data, options) - if (!Array.isArray(tokens) && options.quickEncodeToken) { - const quickBytes = options.quickEncodeToken(tokens) - if (quickBytes) { - return quickBytes - } - const encoder = encoders[tokens.type.major] - if (encoder.encodedSize) { - const size = encoder.encodedSize(tokens, options) - const buf = new Bl(size) - encoder(buf, tokens, options) - /* c8 ignore next 4 */ - // this would be a problem with encodedSize() functions - if (buf.chunks.length !== 1) { - throw new Error(`Unexpected error: pre-calculated length for ${tokens} was wrong`) +function buildMockDispatch () { + const agent = this[kMockAgent] + const origin = this[kOrigin] + const originalDispatch = this[kOriginalDispatch] + + return function dispatch (opts, handler) { + if (agent.isMockActive) { + try { + mockDispatch.call(this, opts, handler) + } catch (error) { + if (error instanceof MockNotMatchedError) { + const netConnect = agent[kGetNetConnect]() + if (netConnect === false) { + throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`) + } + if (checkNetConnect(netConnect, origin)) { + originalDispatch.call(this, opts, handler) + } else { + throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`) + } + } else { + throw error + } } - return asU8A(buf.chunks[0]) + } else { + originalDispatch.call(this, opts, handler) } } - buf.reset() - tokensToEncoded(buf, tokens, encoders, options) - return buf.toBytes(true) } -/** - * @param {any} data - * @param {EncodeOptions} [options] - * @returns {Uint8Array} - */ -function encode_encode (data, options) { - options = Object.assign({}, defaultEncodeOptions, options) - return encodeCustom(data, cborEncoders, options) +function checkNetConnect (netConnect, origin) { + const url = new URL(origin) + if (netConnect === true) { + return true + } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) { + return true + } + return false } +function buildMockOptions (opts) { + if (opts) { + const { agent, ...mockOptions } = opts + return mockOptions + } +} +module.exports = { + getResponseData, + getMockDispatch, + addMockDispatch, + deleteMockDispatch, + buildKey, + generateKeyValues, + matchValue, + getResponse, + getStatusText, + mockDispatch, + buildMockDispatch, + checkNetConnect, + buildMockOptions, + getHeaderByName +} -;// CONCATENATED MODULE: ./node_modules/cborg/lib/decode.js +/***/ }), +/***/ 78868: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * @typedef {import('./token.js').Token} Token - * @typedef {import('../interface').DecodeOptions} DecodeOptions - * @typedef {import('../interface').DecodeTokenizer} DecodeTokenizer - */ -const defaultDecodeOptions = { - strict: false, - allowIndefinite: true, - allowUndefined: true, - allowBigInt: true -} +const { Transform } = __nccwpck_require__(12781) +const { Console } = __nccwpck_require__(96206) /** - * @implements {DecodeTokenizer} + * Gets the output of `console.table(…)` as a string. */ -class Tokeniser { - /** - * @param {Uint8Array} data - * @param {DecodeOptions} options - */ - constructor (data, options = {}) { - this._pos = 0 - this.data = data - this.options = options - } +module.exports = class PendingInterceptorsFormatter { + constructor ({ disableColors } = {}) { + this.transform = new Transform({ + transform (chunk, _enc, cb) { + cb(null, chunk) + } + }) - pos () { - return this._pos + this.logger = new Console({ + stdout: this.transform, + inspectOptions: { + colors: !disableColors && !process.env.CI + } + }) } - done () { - return this._pos >= this.data.length - } + format (pendingInterceptors) { + const withPrettyHeaders = pendingInterceptors.map( + ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + Method: method, + Origin: origin, + Path: path, + 'Status code': statusCode, + Persistent: persist ? '✅' : '❌', + Invocations: timesInvoked, + Remaining: persist ? Infinity : times - timesInvoked + })) - next () { - const byt = this.data[this._pos] - let token = quick[byt] - if (token === undefined) { - const decoder = jump[byt] - /* c8 ignore next 4 */ - // if we're here then there's something wrong with our jump or quick lists! - if (!decoder) { - throw new Error(`${decodeErrPrefix} no decoder for major type ${byt >>> 5} (byte 0x${byt.toString(16).padStart(2, '0')})`) - } - const minor = byt & 31 - token = decoder(this.data, this._pos, minor, this.options) - } - // @ts-ignore we get to assume encodedLength is set (crossing fingers slightly) - this._pos += token.encodedLength - return token + this.logger.table(withPrettyHeaders) + return this.transform.read().toString() } } -const DONE = Symbol.for('DONE') -const BREAK = Symbol.for('BREAK') -/** - * @param {Token} token - * @param {DecodeTokenizer} tokeniser - * @param {DecodeOptions} options - * @returns {any|BREAK|DONE} - */ -function tokenToArray (token, tokeniser, options) { - const arr = [] - for (let i = 0; i < token.value; i++) { - const value = tokensToObject(tokeniser, options) - if (value === BREAK) { - if (token.value === Infinity) { - // normal end to indefinite length array - break - } - throw new Error(`${decodeErrPrefix} got unexpected break to lengthed array`) - } - if (value === DONE) { - throw new Error(`${decodeErrPrefix} found array but not enough entries (got ${i}, expected ${token.value})`) - } - arr[i] = value - } - return arr +/***/ }), + +/***/ 53753: +/***/ ((module) => { + + + +const singulars = { + pronoun: 'it', + is: 'is', + was: 'was', + this: 'this' } -/** - * @param {Token} token - * @param {DecodeTokenizer} tokeniser - * @param {DecodeOptions} options - * @returns {any|BREAK|DONE} - */ -function tokenToMap (token, tokeniser, options) { - const useMaps = options.useMaps === true - const obj = useMaps ? undefined : {} - const m = useMaps ? new Map() : undefined - for (let i = 0; i < token.value; i++) { - const key = tokensToObject(tokeniser, options) - if (key === BREAK) { - if (token.value === Infinity) { - // normal end to indefinite length map - break - } - throw new Error(`${decodeErrPrefix} got unexpected break to lengthed map`) - } - if (key === DONE) { - throw new Error(`${decodeErrPrefix} found map but not enough entries (got ${i} [no key], expected ${token.value})`) - } - if (useMaps !== true && typeof key !== 'string') { - throw new Error(`${decodeErrPrefix} non-string keys not supported (got ${typeof key})`) - } - if (options.rejectDuplicateMapKeys === true) { - // @ts-ignore - if ((useMaps && m.has(key)) || (!useMaps && (key in obj))) { - throw new Error(`${decodeErrPrefix} found repeat map key "${key}"`) - } - } - const value = tokensToObject(tokeniser, options) - if (value === DONE) { - throw new Error(`${decodeErrPrefix} found map but not enough entries (got ${i} [no value], expected ${token.value})`) - } - if (useMaps) { - // @ts-ignore TODO reconsider this .. maybe needs to be strict about key types - m.set(key, value) - } else { - // @ts-ignore TODO reconsider this .. maybe needs to be strict about key types - obj[key] = value - } - } - // @ts-ignore c'mon man - return useMaps ? m : obj +const plurals = { + pronoun: 'they', + is: 'are', + was: 'were', + this: 'these' } -/** - * @param {DecodeTokenizer} tokeniser - * @param {DecodeOptions} options - * @returns {any|BREAK|DONE} - */ -function tokensToObject (tokeniser, options) { - // should we support array as an argument? - // check for tokenIter[Symbol.iterator] and replace tokenIter with what that returns? - if (tokeniser.done()) { - return DONE +module.exports = class Pluralizer { + constructor (singular, plural) { + this.singular = singular + this.plural = plural } - const token = tokeniser.next() + pluralize (count) { + const one = count === 1 + const keys = one ? singulars : plurals + const noun = one ? this.singular : this.plural + return { ...keys, count, noun } + } +} - if (token.type === token_Type["break"]) { - return BREAK + +/***/ }), + +/***/ 88472: +/***/ ((module) => { + +/* eslint-disable */ + + + +// Extracted from node/lib/internal/fixed_queue.js + +// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two. +const kSize = 2048; +const kMask = kSize - 1; + +// The FixedQueue is implemented as a singly-linked list of fixed-size +// circular buffers. It looks something like this: +// +// head tail +// | | +// v v +// +-----------+ <-----\ +-----------+ <------\ +-----------+ +// | [null] | \----- | next | \------- | next | +// +-----------+ +-----------+ +-----------+ +// | item | <-- bottom | item | <-- bottom | [empty] | +// | item | | item | | [empty] | +// | item | | item | | [empty] | +// | item | | item | | [empty] | +// | item | | item | bottom --> | item | +// | item | | item | | item | +// | ... | | ... | | ... | +// | item | | item | | item | +// | item | | item | | item | +// | [empty] | <-- top | item | | item | +// | [empty] | | item | | item | +// | [empty] | | [empty] | <-- top top --> | [empty] | +// +-----------+ +-----------+ +-----------+ +// +// Or, if there is only one circular buffer, it looks something +// like either of these: +// +// head tail head tail +// | | | | +// v v v v +// +-----------+ +-----------+ +// | [null] | | [null] | +// +-----------+ +-----------+ +// | [empty] | | item | +// | [empty] | | item | +// | item | <-- bottom top --> | [empty] | +// | item | | [empty] | +// | [empty] | <-- top bottom --> | item | +// | [empty] | | item | +// +-----------+ +-----------+ +// +// Adding a value means moving `top` forward by one, removing means +// moving `bottom` forward by one. After reaching the end, the queue +// wraps around. +// +// When `top === bottom` the current queue is empty and when +// `top + 1 === bottom` it's full. This wastes a single space of storage +// but allows much quicker checks. + +class FixedCircularBuffer { + constructor() { + this.bottom = 0; + this.top = 0; + this.list = new Array(kSize); + this.next = null; } - if (token.type.terminal) { - return token.value + isEmpty() { + return this.top === this.bottom; } - if (token.type === token_Type.array) { - return tokenToArray(token, tokeniser, options) + isFull() { + return ((this.top + 1) & kMask) === this.bottom; } - if (token.type === token_Type.map) { - return tokenToMap(token, tokeniser, options) + push(data) { + this.list[this.top] = data; + this.top = (this.top + 1) & kMask; } - if (token.type === token_Type.tag) { - if (options.tags && typeof options.tags[token.value] === 'function') { - const tagged = tokensToObject(tokeniser, options) - return options.tags[token.value](tagged) - } - throw new Error(`${decodeErrPrefix} tag not supported (${token.value})`) + shift() { + const nextItem = this.list[this.bottom]; + if (nextItem === undefined) + return null; + this.list[this.bottom] = undefined; + this.bottom = (this.bottom + 1) & kMask; + return nextItem; } - /* c8 ignore next */ - throw new Error('unsupported') } -/** - * @param {Uint8Array} data - * @param {DecodeOptions} [options] - * @returns {[any, Uint8Array]} - */ -function decodeFirst (data, options) { - if (!(data instanceof Uint8Array)) { - throw new Error(`${decodeErrPrefix} data to decode must be a Uint8Array`) - } - options = Object.assign({}, defaultDecodeOptions, options) - const tokeniser = options.tokenizer || new Tokeniser(data, options) - const decoded = tokensToObject(tokeniser, options) - if (decoded === DONE) { - throw new Error(`${decodeErrPrefix} did not find any content to decode`) - } - if (decoded === BREAK) { - throw new Error(`${decodeErrPrefix} got unexpected break`) +module.exports = class FixedQueue { + constructor() { + this.head = this.tail = new FixedCircularBuffer(); } - return [decoded, data.subarray(tokeniser.pos())] -} -/** - * @param {Uint8Array} data - * @param {DecodeOptions} [options] - * @returns {any} - */ -function decode_decode (data, options) { - const [decoded, remainder] = decodeFirst(data, options) - if (remainder.length > 0) { - throw new Error(`${decodeErrPrefix} too many terminals, data makes no sense`) + isEmpty() { + return this.head.isEmpty(); } - return decoded -} + push(data) { + if (this.head.isFull()) { + // Head is full: Creates a new queue, sets the old queue's `.next` to it, + // and sets it as the new main queue. + this.head = this.head.next = new FixedCircularBuffer(); + } + this.head.push(data); + } + shift() { + const tail = this.tail; + const next = tail.shift(); + if (tail.isEmpty() && tail.next !== null) { + // If there is another queue, it forms the new tail. + this.tail = tail.next; + } + return next; + } +}; -;// CONCATENATED MODULE: ./node_modules/cborg/cborg.js +/***/ }), +/***/ 76620: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Export the types that were present in the original manual cborg.d.ts - * @typedef {import('./interface').TagDecoder} TagDecoder - * There was originally just `TypeEncoder` so don't break types by renaming or not exporting - * @typedef {import('./interface').OptionalTypeEncoder} TypeEncoder - * @typedef {import('./interface').DecodeOptions} DecodeOptions - * @typedef {import('./interface').EncodeOptions} EncodeOptions - */ +const DispatcherBase = __nccwpck_require__(33090) +const FixedQueue = __nccwpck_require__(88472) +const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(69898) +const PoolStats = __nccwpck_require__(70443) +const kClients = Symbol('clients') +const kNeedDrain = Symbol('needDrain') +const kQueue = Symbol('queue') +const kClosedResolve = Symbol('closed resolve') +const kOnDrain = Symbol('onDrain') +const kOnConnect = Symbol('onConnect') +const kOnDisconnect = Symbol('onDisconnect') +const kOnConnectionError = Symbol('onConnectionError') +const kGetDispatcher = Symbol('get dispatcher') +const kAddClient = Symbol('add client') +const kRemoveClient = Symbol('remove client') +const kStats = Symbol('stats') -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/node_modules/multiformats/dist/src/bytes.js -const bytes_empty = new Uint8Array(0); -function bytes_toHex(d) { - return d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), ''); -} -function bytes_fromHex(hex) { - const hexes = hex.match(/../g); - return hexes != null ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : bytes_empty; -} -function bytes_equals(aa, bb) { - if (aa === bb) - return true; - if (aa.byteLength !== bb.byteLength) { - return false; - } - for (let ii = 0; ii < aa.byteLength; ii++) { - if (aa[ii] !== bb[ii]) { - return false; - } - } - return true; -} -function src_bytes_coerce(o) { - if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') - return o; - if (o instanceof ArrayBuffer) - return new Uint8Array(o); - if (ArrayBuffer.isView(o)) { - return new Uint8Array(o.buffer, o.byteOffset, o.byteLength); - } - throw new Error('Unknown type, must be binary type'); -} -function bytes_isBinary(o) { - return o instanceof ArrayBuffer || ArrayBuffer.isView(o); -} -function bytes_fromString(str) { - return new TextEncoder().encode(str); -} -function src_bytes_toString(b) { - return new TextDecoder().decode(b); -} -//# sourceMappingURL=bytes.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/node_modules/multiformats/dist/src/vendor/base-x.js -/* eslint-disable */ -// base-x encoding / decoding -// Copyright (c) 2018 base-x contributors -// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) -// Distributed under the MIT software license, see the accompanying -// file LICENSE or http://www.opensource.org/licenses/mit-license.php. -/** - * @param {string} ALPHABET - * @param {any} name - */ -function base_x_base(ALPHABET, name) { - if (ALPHABET.length >= 255) { - throw new TypeError('Alphabet too long'); - } - var BASE_MAP = new Uint8Array(256); - for (var j = 0; j < BASE_MAP.length; j++) { - BASE_MAP[j] = 255; - } - for (var i = 0; i < ALPHABET.length; i++) { - var x = ALPHABET.charAt(i); - var xc = x.charCodeAt(0); - if (BASE_MAP[xc] !== 255) { - throw new TypeError(x + ' is ambiguous'); - } - BASE_MAP[xc] = i; - } - var BASE = ALPHABET.length; - var LEADER = ALPHABET.charAt(0); - var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up - var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up - /** - * @param {any[] | Iterable} source - */ - function encode(source) { - // @ts-ignore - if (source instanceof Uint8Array) - ; - else if (ArrayBuffer.isView(source)) { - source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); - } - else if (Array.isArray(source)) { - source = Uint8Array.from(source); - } - if (!(source instanceof Uint8Array)) { - throw new TypeError('Expected Uint8Array'); - } - if (source.length === 0) { - return ''; - } - // Skip & count leading zeroes. - var zeroes = 0; - var length = 0; - var pbegin = 0; - var pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; - } - // Allocate enough space in big-endian base58 representation. - var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; - var b58 = new Uint8Array(size); - // Process the bytes. - while (pbegin !== pend) { - var carry = source[pbegin]; - // Apply "b58 = b58 * 256 + ch". - var i = 0; - for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { - carry += (256 * b58[it1]) >>> 0; - b58[it1] = (carry % BASE) >>> 0; - carry = (carry / BASE) >>> 0; - } - if (carry !== 0) { - throw new Error('Non-zero carry'); - } - length = i; - pbegin++; - } - // Skip leading zeroes in base58 result. - var it2 = size - length; - while (it2 !== size && b58[it2] === 0) { - it2++; - } - // Translate the result into a string. - var str = LEADER.repeat(zeroes); - for (; it2 < size; ++it2) { - str += ALPHABET.charAt(b58[it2]); - } - return str; - } - /** - * @param {string | string[]} source - */ - function decodeUnsafe(source) { - if (typeof source !== 'string') { - throw new TypeError('Expected String'); - } - if (source.length === 0) { - return new Uint8Array(); - } - var psz = 0; - // Skip leading spaces. - if (source[psz] === ' ') { - return; - } - // Skip and count leading '1's. - var zeroes = 0; - var length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; - } - // Allocate enough space in big-endian base256 representation. - var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. - var b256 = new Uint8Array(size); - // Process the characters. - while (source[psz]) { - // Decode character - var carry = BASE_MAP[source.charCodeAt(psz)]; - // Invalid character - if (carry === 255) { - return; - } - var i = 0; - for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { - carry += (BASE * b256[it3]) >>> 0; - b256[it3] = (carry % 256) >>> 0; - carry = (carry / 256) >>> 0; - } - if (carry !== 0) { - throw new Error('Non-zero carry'); - } - length = i; - psz++; - } - // Skip trailing spaces. - if (source[psz] === ' ') { - return; - } - // Skip leading zeroes in b256. - var it4 = size - length; - while (it4 !== size && b256[it4] === 0) { - it4++; - } - var vch = new Uint8Array(zeroes + (size - it4)); - var j = zeroes; - while (it4 !== size) { - vch[j++] = b256[it4++]; - } - return vch; - } - /** - * @param {string | string[]} string - */ - function decode(string) { - var buffer = decodeUnsafe(string); - if (buffer) { - return buffer; - } - throw new Error(`Non-${name} character`); - } - return { - encode: encode, - decodeUnsafe: decodeUnsafe, - decode: decode - }; -} -var base_x_src = base_x_base; -var base_x_brrp_multiformats_scope_baseX = base_x_src; -/* harmony default export */ const vendor_base_x = (base_x_brrp_multiformats_scope_baseX); -//# sourceMappingURL=base-x.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/node_modules/multiformats/dist/src/bases/base.js +class PoolBase extends DispatcherBase { + constructor () { + super() + this[kQueue] = new FixedQueue() + this[kClients] = [] + this[kQueued] = 0 -/** - * Class represents both BaseEncoder and MultibaseEncoder meaning it - * can be used to encode to multibase or base encode without multibase - * prefix. - */ -class base_Encoder { - name; - prefix; - baseEncode; - constructor(name, prefix, baseEncode) { - this.name = name; - this.prefix = prefix; - this.baseEncode = baseEncode; - } - encode(bytes) { - if (bytes instanceof Uint8Array) { - return `${this.prefix}${this.baseEncode(bytes)}`; - } - else { - throw Error('Unknown type, must be binary type'); - } - } -} -/** - * Class represents both BaseDecoder and MultibaseDecoder so it could be used - * to decode multibases (with matching prefix) or just base decode strings - * with corresponding base encoding. - */ -class base_Decoder { - name; - prefix; - baseDecode; - prefixCodePoint; - constructor(name, prefix, baseDecode) { - this.name = name; - this.prefix = prefix; - /* c8 ignore next 3 */ - if (prefix.codePointAt(0) === undefined) { - throw new Error('Invalid prefix character'); - } - this.prefixCodePoint = prefix.codePointAt(0); - this.baseDecode = baseDecode; - } - decode(text) { - if (typeof text === 'string') { - if (text.codePointAt(0) !== this.prefixCodePoint) { - throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); - } - return this.baseDecode(text.slice(this.prefix.length)); - } - else { - throw Error('Can only multibase decode strings'); - } - } - or(decoder) { - return base_or(this, decoder); - } -} -class base_ComposedDecoder { - decoders; - constructor(decoders) { - this.decoders = decoders; - } - or(decoder) { - return base_or(this, decoder); - } - decode(input) { - const prefix = input[0]; - const decoder = this.decoders[prefix]; - if (decoder != null) { - return decoder.decode(input); - } - else { - throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); - } - } -} -function base_or(left, right) { - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - return new base_ComposedDecoder({ - ...(left.decoders ?? { [left.prefix]: left }), - ...(right.decoders ?? { [right.prefix]: right }) - }); -} -class base_Codec { - name; - prefix; - baseEncode; - baseDecode; - encoder; - decoder; - constructor(name, prefix, baseEncode, baseDecode) { - this.name = name; - this.prefix = prefix; - this.baseEncode = baseEncode; - this.baseDecode = baseDecode; - this.encoder = new base_Encoder(name, prefix, baseEncode); - this.decoder = new base_Decoder(name, prefix, baseDecode); - } - encode(input) { - return this.encoder.encode(input); - } - decode(input) { - return this.decoder.decode(input); - } -} -function base_from({ name, prefix, encode, decode }) { - return new base_Codec(name, prefix, encode, decode); -} -function base_baseX({ name, prefix, alphabet }) { - const { encode, decode } = vendor_base_x(alphabet, name); - return base_from({ - prefix, - name, - encode, - decode: (text) => src_bytes_coerce(decode(text)) - }); -} -function base_decode(string, alphabet, bitsPerChar, name) { - // Build the character lookup table: - const codes = {}; - for (let i = 0; i < alphabet.length; ++i) { - codes[alphabet[i]] = i; - } - // Count the padding bytes: - let end = string.length; - while (string[end - 1] === '=') { - --end; - } - // Allocate the output: - const out = new Uint8Array((end * bitsPerChar / 8) | 0); - // Parse the data: - let bits = 0; // Number of bits currently in the buffer - let buffer = 0; // Bits waiting to be written out, MSB first - let written = 0; // Next byte to write - for (let i = 0; i < end; ++i) { - // Read one character from the string: - const value = codes[string[i]]; - if (value === undefined) { - throw new SyntaxError(`Non-${name} character`); - } - // Append the bits to the buffer: - buffer = (buffer << bitsPerChar) | value; - bits += bitsPerChar; - // Write out some bits if the buffer has a byte's worth: - if (bits >= 8) { - bits -= 8; - out[written++] = 0xff & (buffer >> bits); - } - } - // Verify that we have received just enough bits: - if (bits >= bitsPerChar || (0xff & (buffer << (8 - bits))) !== 0) { - throw new SyntaxError('Unexpected end of data'); - } - return out; -} -function base_encode(data, alphabet, bitsPerChar) { - const pad = alphabet[alphabet.length - 1] === '='; - const mask = (1 << bitsPerChar) - 1; - let out = ''; - let bits = 0; // Number of bits currently in the buffer - let buffer = 0; // Bits waiting to be written out, MSB first - for (let i = 0; i < data.length; ++i) { - // Slurp data into the buffer: - buffer = (buffer << 8) | data[i]; - bits += 8; - // Write out as much as we can: - while (bits > bitsPerChar) { - bits -= bitsPerChar; - out += alphabet[mask & (buffer >> bits)]; - } - } - // Partial character: - if (bits !== 0) { - out += alphabet[mask & (buffer << (bitsPerChar - bits))]; - } - // Add padding characters until we hit a byte boundary: - if (pad) { - while (((out.length * bitsPerChar) & 7) !== 0) { - out += '='; - } - } - return out; -} -/** - * RFC4648 Factory - */ -function base_rfc4648({ name, prefix, bitsPerChar, alphabet }) { - return base_from({ - prefix, - name, - encode(input) { - return base_encode(input, alphabet, bitsPerChar); - }, - decode(input) { - return base_decode(input, alphabet, bitsPerChar, name); - } - }); -} -//# sourceMappingURL=base.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/node_modules/multiformats/dist/src/bases/base32.js + const pool = this -const bases_base32_base32 = base_rfc4648({ - prefix: 'b', - name: 'base32', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567', - bitsPerChar: 5 -}); -const bases_base32_base32upper = base_rfc4648({ - prefix: 'B', - name: 'base32upper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', - bitsPerChar: 5 -}); -const base32_base32pad = base_rfc4648({ - prefix: 'c', - name: 'base32pad', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', - bitsPerChar: 5 -}); -const base32_base32padupper = base_rfc4648({ - prefix: 'C', - name: 'base32padupper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', - bitsPerChar: 5 -}); -const base32_base32hex = base_rfc4648({ - prefix: 'v', - name: 'base32hex', - alphabet: '0123456789abcdefghijklmnopqrstuv', - bitsPerChar: 5 -}); -const base32_base32hexupper = base_rfc4648({ - prefix: 'V', - name: 'base32hexupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', - bitsPerChar: 5 -}); -const base32_base32hexpad = base_rfc4648({ - prefix: 't', - name: 'base32hexpad', - alphabet: '0123456789abcdefghijklmnopqrstuv=', - bitsPerChar: 5 -}); -const base32_base32hexpadupper = base_rfc4648({ - prefix: 'T', - name: 'base32hexpadupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', - bitsPerChar: 5 -}); -const base32_base32z = base_rfc4648({ - prefix: 'h', - name: 'base32z', - alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', - bitsPerChar: 5 -}); -//# sourceMappingURL=base32.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/node_modules/multiformats/dist/src/bases/base58.js + this[kOnDrain] = function onDrain (origin, targets) { + const queue = pool[kQueue] -const bases_base58_base58btc = base_baseX({ - name: 'base58btc', - prefix: 'z', - alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -}); -const base58_base58flickr = base_baseX({ - name: 'base58flickr', - prefix: 'Z', - alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -}); -//# sourceMappingURL=base58.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/node_modules/multiformats/dist/src/vendor/varint.js -/* eslint-disable */ -var varint_encode_1 = vendor_varint_encode; -var varint_MSB = 0x80, varint_REST = 0x7F, varint_MSBALL = ~varint_REST, varint_INT = Math.pow(2, 31); -/** - * @param {number} num - * @param {number[]} out - * @param {number} offset - */ -function vendor_varint_encode(num, out, offset) { - out = out || []; - offset = offset || 0; - var oldOffset = offset; - while (num >= varint_INT) { - out[offset++] = (num & 0xFF) | varint_MSB; - num /= 128; - } - while (num & varint_MSBALL) { - out[offset++] = (num & 0xFF) | varint_MSB; - num >>>= 7; - } - out[offset] = num | 0; - // @ts-ignore - vendor_varint_encode.bytes = offset - oldOffset + 1; - return out; -} -var vendor_varint_decode = varint_read; -var varint_MSB$1 = 0x80, varint_REST$1 = 0x7F; -/** - * @param {string | any[]} buf - * @param {number} offset - */ -function varint_read(buf, offset) { - var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length; - do { - if (counter >= l) { - // @ts-ignore - varint_read.bytes = 0; - throw new RangeError('Could not decode varint'); - } - b = buf[counter++]; - res += shift < 28 - ? (b & varint_REST$1) << shift - : (b & varint_REST$1) * Math.pow(2, shift); - shift += 7; - } while (b >= varint_MSB$1); - // @ts-ignore - varint_read.bytes = counter - offset; - return res; -} -var varint_N1 = Math.pow(2, 7); -var varint_N2 = Math.pow(2, 14); -var varint_N3 = Math.pow(2, 21); -var varint_N4 = Math.pow(2, 28); -var varint_N5 = Math.pow(2, 35); -var varint_N6 = Math.pow(2, 42); -var varint_N7 = Math.pow(2, 49); -var varint_N8 = Math.pow(2, 56); -var varint_N9 = Math.pow(2, 63); -var vendor_varint_length = function (/** @type {number} */ value) { - return (value < varint_N1 ? 1 - : value < varint_N2 ? 2 - : value < varint_N3 ? 3 - : value < varint_N4 ? 4 - : value < varint_N5 ? 5 - : value < varint_N6 ? 6 - : value < varint_N7 ? 7 - : value < varint_N8 ? 8 - : value < varint_N9 ? 9 - : 10); -}; -var vendor_varint_varint = { - encode: varint_encode_1, - decode: vendor_varint_decode, - encodingLength: vendor_varint_length -}; -var varint_brrp_varint = vendor_varint_varint; -/* harmony default export */ const src_vendor_varint = (varint_brrp_varint); -//# sourceMappingURL=varint.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/node_modules/multiformats/dist/src/varint.js + let needDrain = false -function dist_src_varint_decode(data, offset = 0) { - const code = src_vendor_varint.decode(data, offset); - return [code, src_vendor_varint.decode.bytes]; -} -function varint_encodeTo(int, target, offset = 0) { - src_vendor_varint.encode(int, target, offset); - return target; -} -function varint_encodingLength(int) { - return src_vendor_varint.encodingLength(int); -} -//# sourceMappingURL=varint.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/node_modules/multiformats/dist/src/hashes/digest.js + while (!needDrain) { + const item = queue.shift() + if (!item) { + break + } + pool[kQueued]-- + needDrain = !this.dispatch(item.opts, item.handler) + } + this[kNeedDrain] = needDrain -/** - * Creates a multihash digest. - */ -function hashes_digest_create(code, digest) { - const size = digest.byteLength; - const sizeOffset = varint_encodingLength(code); - const digestOffset = sizeOffset + varint_encodingLength(size); - const bytes = new Uint8Array(digestOffset + size); - varint_encodeTo(code, bytes, 0); - varint_encodeTo(size, bytes, sizeOffset); - bytes.set(digest, digestOffset); - return new hashes_digest_Digest(code, size, digest, bytes); -} -/** - * Turns bytes representation of multihash digest into an instance. - */ -function hashes_digest_decode(multihash) { - const bytes = src_bytes_coerce(multihash); - const [code, sizeOffset] = dist_src_varint_decode(bytes); - const [size, digestOffset] = dist_src_varint_decode(bytes.subarray(sizeOffset)); - const digest = bytes.subarray(sizeOffset + digestOffset); - if (digest.byteLength !== size) { - throw new Error('Incorrect length'); - } - return new hashes_digest_Digest(code, size, digest, bytes); -} -function hashes_digest_equals(a, b) { - if (a === b) { - return true; + if (!this[kNeedDrain] && pool[kNeedDrain]) { + pool[kNeedDrain] = false + pool.emit('drain', origin, [pool, ...targets]) + } + + if (pool[kClosedResolve] && queue.isEmpty()) { + Promise + .all(pool[kClients].map(c => c.close())) + .then(pool[kClosedResolve]) + } } - else { - const data = b; - return (a.code === data.code && - a.size === data.size && - data.bytes instanceof Uint8Array && - bytes_equals(a.bytes, data.bytes)); + + this[kOnConnect] = (origin, targets) => { + pool.emit('connect', origin, [pool, ...targets]) } -} -/** - * Represents a multihash digest which carries information about the - * hashing algorithm and an actual hash digest. - */ -class hashes_digest_Digest { - code; - size; - digest; - bytes; - /** - * Creates a multihash digest. - */ - constructor(code, size, digest, bytes) { - this.code = code; - this.size = size; - this.digest = digest; - this.bytes = bytes; + + this[kOnDisconnect] = (origin, targets, err) => { + pool.emit('disconnect', origin, [pool, ...targets], err) } -} -//# sourceMappingURL=digest.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/node_modules/multiformats/dist/src/cid.js + this[kOnConnectionError] = (origin, targets, err) => { + pool.emit('connectionError', origin, [pool, ...targets], err) + } + this[kStats] = new PoolStats(this) + } + get [kBusy] () { + return this[kNeedDrain] + } + get [kConnected] () { + return this[kClients].filter(client => client[kConnected]).length + } -// This way TS will also expose all the types from module + get [kFree] () { + return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length + } -function cid_format(link, base) { - const { bytes, version } = link; - switch (version) { - case 0: - return cid_toStringV0(bytes, cid_baseCache(link), base ?? bases_base58_base58btc.encoder); - default: - return cid_toStringV1(bytes, cid_baseCache(link), (base ?? bases_base32_base32.encoder)); - } -} -function cid_toJSON(link) { - return { - '/': cid_format(link) - }; -} -function cid_fromJSON(json) { - return src_cid_CID.parse(json['/']); -} -const cid_cache = new WeakMap(); -function cid_baseCache(cid) { - const baseCache = cid_cache.get(cid); - if (baseCache == null) { - const baseCache = new Map(); - cid_cache.set(cid, baseCache); - return baseCache; + get [kPending] () { + let ret = this[kQueued] + for (const { [kPending]: pending } of this[kClients]) { + ret += pending } - return baseCache; -} -class src_cid_CID { - code; - version; - multihash; - bytes; - '/'; - /** - * @param version - Version of the CID - * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param multihash - (Multi)hash of the of the content. - */ - constructor(version, code, multihash, bytes) { - this.code = code; - this.version = version; - this.multihash = multihash; - this.bytes = bytes; - // flag to serializers that this is a CID and - // should be treated specially - this['/'] = bytes; + return ret + } + + get [kRunning] () { + let ret = 0 + for (const { [kRunning]: running } of this[kClients]) { + ret += running } - /** - * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` - * please either use `CID.asCID(cid)` or switch to new signalling mechanism - * - * @deprecated - */ - get asCID() { - return this; + return ret + } + + get [kSize] () { + let ret = this[kQueued] + for (const { [kSize]: size } of this[kClients]) { + ret += size } - // ArrayBufferView - get byteOffset() { - return this.bytes.byteOffset; + return ret + } + + get stats () { + return this[kStats] + } + + async [kClose] () { + if (this[kQueue].isEmpty()) { + return Promise.all(this[kClients].map(c => c.close())) + } else { + return new Promise((resolve) => { + this[kClosedResolve] = resolve + }) } - // ArrayBufferView - get byteLength() { - return this.bytes.byteLength; + } + + async [kDestroy] (err) { + while (true) { + const item = this[kQueue].shift() + if (!item) { + break + } + item.handler.onError(err) } - toV0() { - switch (this.version) { - case 0: { - return this; - } - case 1: { - const { code, multihash } = this; - if (code !== cid_DAG_PB_CODE) { - throw new Error('Cannot convert a non dag-pb CID to CIDv0'); - } - // sha2-256 - if (multihash.code !== cid_SHA_256_CODE) { - throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0'); - } - return (src_cid_CID.createV0(multihash)); - } - default: { - throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`); - } - } + + return Promise.all(this[kClients].map(c => c.destroy(err))) + } + + [kDispatch] (opts, handler) { + const dispatcher = this[kGetDispatcher]() + + if (!dispatcher) { + this[kNeedDrain] = true + this[kQueue].push({ opts, handler }) + this[kQueued]++ + } else if (!dispatcher.dispatch(opts, handler)) { + dispatcher[kNeedDrain] = true + this[kNeedDrain] = !this[kGetDispatcher]() } - toV1() { - switch (this.version) { - case 0: { - const { code, digest } = this.multihash; - const multihash = hashes_digest_create(code, digest); - return (src_cid_CID.createV1(this.code, multihash)); - } - case 1: { - return this; - } - default: { - throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`); - } + + return !this[kNeedDrain] + } + + [kAddClient] (client) { + client + .on('drain', this[kOnDrain]) + .on('connect', this[kOnConnect]) + .on('disconnect', this[kOnDisconnect]) + .on('connectionError', this[kOnConnectionError]) + + this[kClients].push(client) + + if (this[kNeedDrain]) { + process.nextTick(() => { + if (this[kNeedDrain]) { + this[kOnDrain](client[kUrl], [this, client]) } + }) } - equals(other) { - return src_cid_CID.equals(this, other); - } - static equals(self, other) { - const unknown = other; - return (unknown != null && - self.code === unknown.code && - self.version === unknown.version && - hashes_digest_equals(self.multihash, unknown.multihash)); - } - toString(base) { - return cid_format(this, base); + + return this + } + + [kRemoveClient] (client) { + client.close(() => { + const idx = this[kClients].indexOf(client) + if (idx !== -1) { + this[kClients].splice(idx, 1) + } + }) + + this[kNeedDrain] = this[kClients].some(dispatcher => ( + !dispatcher[kNeedDrain] && + dispatcher.closed !== true && + dispatcher.destroyed !== true + )) + } +} + +module.exports = { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kRemoveClient, + kGetDispatcher +} + + +/***/ }), + +/***/ 70443: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(69898) +const kPool = Symbol('pool') + +class PoolStats { + constructor (pool) { + this[kPool] = pool + } + + get connected () { + return this[kPool][kConnected] + } + + get free () { + return this[kPool][kFree] + } + + get pending () { + return this[kPool][kPending] + } + + get queued () { + return this[kPool][kQueued] + } + + get running () { + return this[kPool][kRunning] + } + + get size () { + return this[kPool][kSize] + } +} + +module.exports = PoolStats + + +/***/ }), + +/***/ 59310: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kGetDispatcher +} = __nccwpck_require__(76620) +const Client = __nccwpck_require__(41421) +const { + InvalidArgumentError +} = __nccwpck_require__(70867) +const util = __nccwpck_require__(43061) +const { kUrl, kInterceptors } = __nccwpck_require__(69898) +const buildConnector = __nccwpck_require__(46183) + +const kOptions = Symbol('options') +const kConnections = Symbol('connections') +const kFactory = Symbol('factory') + +function defaultFactory (origin, opts) { + return new Client(origin, opts) +} + +class Pool extends PoolBase { + constructor (origin, { + connections, + factory = defaultFactory, + connect, + connectTimeout, + tls, + maxCachedSessions, + socketPath, + autoSelectFamily, + autoSelectFamilyAttemptTimeout, + allowH2, + ...options + } = {}) { + super() + + if (connections != null && (!Number.isFinite(connections) || connections < 0)) { + throw new InvalidArgumentError('invalid connections') } - toJSON() { - return { '/': cid_format(this) }; + + if (typeof factory !== 'function') { + throw new InvalidArgumentError('factory must be a function.') } - link() { - return this; + + if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { + throw new InvalidArgumentError('connect must be a function or an object') } - [Symbol.toStringTag] = 'CID'; - // Legacy - [Symbol.for('nodejs.util.inspect.custom')]() { - return `CID(${this.toString()})`; + + if (typeof connect !== 'function') { + connect = buildConnector({ + ...tls, + maxCachedSessions, + allowH2, + socketPath, + timeout: connectTimeout, + ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), + ...connect + }) } - /** - * Takes any input `value` and returns a `CID` instance if it was - * a `CID` otherwise returns `null`. If `value` is instanceof `CID` - * it will return value back. If `value` is not instance of this CID - * class, but is compatible CID it will return new instance of this - * `CID` class. Otherwise returns null. - * - * This allows two different incompatible versions of CID library to - * co-exist and interop as long as binary interface is compatible. - */ - static asCID(input) { - if (input == null) { - return null; - } - const value = input; - if (value instanceof src_cid_CID) { - // If value is instance of CID then we're all set. - return value; - } - else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { - // If value isn't instance of this CID class but `this.asCID === this` or - // `value['/'] === value.bytes` is true it is CID instance coming from a - // different implementation (diff version or duplicate). In that case we - // rebase it to this `CID` implementation so caller is guaranteed to get - // instance with expected API. - const { version, code, multihash, bytes } = value; - return new src_cid_CID(version, code, multihash, bytes ?? cid_encodeCID(version, code, multihash.bytes)); - } - else if (value[cid_cidSymbol] === true) { - // If value is a CID from older implementation that used to be tagged via - // symbol we still rebase it to the this `CID` implementation by - // delegating that to a constructor. - const { version, multihash, code } = value; - const digest = hashes_digest_decode(multihash); - return src_cid_CID.create(version, code, digest); - } - else { - // Otherwise value is not a CID (or an incompatible version of it) in - // which case we return `null`. - return null; - } + + this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool) + ? options.interceptors.Pool + : [] + this[kConnections] = connections || null + this[kUrl] = util.parseOrigin(origin) + this[kOptions] = { ...util.deepClone(options), connect, allowH2 } + this[kOptions].interceptors = options.interceptors + ? { ...options.interceptors } + : undefined + this[kFactory] = factory + } + + [kGetDispatcher] () { + let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain]) + + if (dispatcher) { + return dispatcher } - /** - * @param version - Version of the CID - * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param digest - (Multi)hash of the of the content. - */ - static create(version, code, digest) { - if (typeof code !== 'number') { - throw new Error('String codecs are no longer supported'); - } - if (!(digest.bytes instanceof Uint8Array)) { - throw new Error('Invalid digest'); - } - switch (version) { - case 0: { - if (code !== cid_DAG_PB_CODE) { - throw new Error(`Version 0 CID must use dag-pb (code: ${cid_DAG_PB_CODE}) block encoding`); - } - else { - return new src_cid_CID(version, code, digest, digest.bytes); - } - } - case 1: { - const bytes = cid_encodeCID(version, code, digest.bytes); - return new src_cid_CID(version, code, digest, bytes); - } - default: { - throw new Error('Invalid version'); - } - } + + if (!this[kConnections] || this[kClients].length < this[kConnections]) { + dispatcher = this[kFactory](this[kUrl], this[kOptions]) + this[kAddClient](dispatcher) } - /** - * Simplified version of `create` for CIDv0. - */ - static createV0(digest) { - return src_cid_CID.create(0, cid_DAG_PB_CODE, digest); + + return dispatcher + } +} + +module.exports = Pool + + +/***/ }), + +/***/ 46118: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(69898) +const { URL } = __nccwpck_require__(57310) +const Agent = __nccwpck_require__(83272) +const Pool = __nccwpck_require__(59310) +const DispatcherBase = __nccwpck_require__(33090) +const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(70867) +const buildConnector = __nccwpck_require__(46183) + +const kAgent = Symbol('proxy agent') +const kClient = Symbol('proxy client') +const kProxyHeaders = Symbol('proxy headers') +const kRequestTls = Symbol('request tls settings') +const kProxyTls = Symbol('proxy tls settings') +const kConnectEndpoint = Symbol('connect endpoint function') + +function defaultProtocolPort (protocol) { + return protocol === 'https:' ? 443 : 80 +} + +function buildProxyOptions (opts) { + if (typeof opts === 'string') { + opts = { uri: opts } + } + + if (!opts || !opts.uri) { + throw new InvalidArgumentError('Proxy opts.uri is mandatory') + } + + return { + uri: opts.uri, + protocol: opts.protocol || 'https' + } +} + +function defaultFactory (origin, opts) { + return new Pool(origin, opts) +} + +class ProxyAgent extends DispatcherBase { + constructor (opts) { + super(opts) + this[kProxy] = buildProxyOptions(opts) + this[kAgent] = new Agent(opts) + this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent) + ? opts.interceptors.ProxyAgent + : [] + + if (typeof opts === 'string') { + opts = { uri: opts } } - /** - * Simplified version of `create` for CIDv1. - * - * @param code - Content encoding format code. - * @param digest - Multihash of the content. - */ - static createV1(code, digest) { - return src_cid_CID.create(1, code, digest); + + if (!opts || !opts.uri) { + throw new InvalidArgumentError('Proxy opts.uri is mandatory') } - /** - * Decoded a CID from its binary representation. The byte array must contain - * only the CID with no additional bytes. - * - * An error will be thrown if the bytes provided do not contain a valid - * binary representation of a CID. - */ - static decode(bytes) { - const [cid, remainder] = src_cid_CID.decodeFirst(bytes); - if (remainder.length !== 0) { - throw new Error('Incorrect length'); - } - return cid; + + const { clientFactory = defaultFactory } = opts + + if (typeof clientFactory !== 'function') { + throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.') } - /** - * Decoded a CID from its binary representation at the beginning of a byte - * array. - * - * Returns an array with the first element containing the CID and the second - * element containing the remainder of the original byte array. The remainder - * will be a zero-length byte array if the provided bytes only contained a - * binary CID representation. - */ - static decodeFirst(bytes) { - const specs = src_cid_CID.inspectBytes(bytes); - const prefixSize = specs.size - specs.multihashSize; - const multihashBytes = src_bytes_coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize)); - if (multihashBytes.byteLength !== specs.multihashSize) { - throw new Error('Incorrect length'); - } - const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize); - const digest = new hashes_digest_Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); - const cid = specs.version === 0 - ? src_cid_CID.createV0(digest) - : src_cid_CID.createV1(specs.codec, digest); - return [cid, bytes.subarray(specs.size)]; + + this[kRequestTls] = opts.requestTls + this[kProxyTls] = opts.proxyTls + this[kProxyHeaders] = opts.headers || {} + + const resolvedUrl = new URL(opts.uri) + const { origin, port, host, username, password } = resolvedUrl + + if (opts.auth && opts.token) { + throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token') + } else if (opts.auth) { + /* @deprecated in favour of opts.token */ + this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}` + } else if (opts.token) { + this[kProxyHeaders]['proxy-authorization'] = opts.token + } else if (username && password) { + this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}` } - /** - * Inspect the initial bytes of a CID to determine its properties. - * - * Involves decoding up to 4 varints. Typically this will require only 4 to 6 - * bytes but for larger multicodec code values and larger multihash digest - * lengths these varints can be quite large. It is recommended that at least - * 10 bytes be made available in the `initialBytes` argument for a complete - * inspection. - */ - static inspectBytes(initialBytes) { - let offset = 0; - const next = () => { - const [i, length] = dist_src_varint_decode(initialBytes.subarray(offset)); - offset += length; - return i; - }; - let version = next(); - let codec = cid_DAG_PB_CODE; - if (version === 18) { - // CIDv0 - version = 0; - offset = 0; - } - else { - codec = next(); + + const connect = buildConnector({ ...opts.proxyTls }) + this[kConnectEndpoint] = buildConnector({ ...opts.requestTls }) + this[kClient] = clientFactory(resolvedUrl, { connect }) + this[kAgent] = new Agent({ + ...opts, + connect: async (opts, callback) => { + let requestedHost = opts.host + if (!opts.port) { + requestedHost += `:${defaultProtocolPort(opts.protocol)}` } - if (version !== 0 && version !== 1) { - throw new RangeError(`Invalid CID version ${version}`); + try { + const { socket, statusCode } = await this[kClient].connect({ + origin, + port, + path: requestedHost, + signal: opts.signal, + headers: { + ...this[kProxyHeaders], + host + } + }) + if (statusCode !== 200) { + socket.on('error', () => {}).destroy() + callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`)) + } + if (opts.protocol !== 'https:') { + callback(null, socket) + return + } + let servername + if (this[kRequestTls]) { + servername = this[kRequestTls].servername + } else { + servername = opts.servername + } + this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback) + } catch (err) { + callback(err) } - const prefixSize = offset; - const multihashCode = next(); // multihash code - const digestSize = next(); // multihash length - const size = offset + digestSize; - const multihashSize = size - prefixSize; - return { version, codec, multihashCode, digestSize, multihashSize, size }; - } - /** - * Takes cid in a string representation and creates an instance. If `base` - * decoder is not provided will use a default from the configuration. It will - * throw an error if encoding of the CID is not compatible with supplied (or - * a default decoder). - */ - static parse(source, base) { - const [prefix, bytes] = cid_parseCIDtoBytes(source, base); - const cid = src_cid_CID.decode(bytes); - if (cid.version === 0 && source[0] !== 'Q') { - throw Error('Version 0 CID string must not include multibase prefix'); + } + }) + } + + dispatch (opts, handler) { + const { host } = new URL(opts.origin) + const headers = buildHeaders(opts.headers) + throwIfProxyAuthIsSent(headers) + return this[kAgent].dispatch( + { + ...opts, + headers: { + ...headers, + host } - // Cache string representation to avoid computing it on `this.toString()` - cid_baseCache(cid).set(prefix, source); - return cid; - } + }, + handler + ) + } + + async [kClose] () { + await this[kAgent].close() + await this[kClient].close() + } + + async [kDestroy] () { + await this[kAgent].destroy() + await this[kClient].destroy() + } } -function cid_parseCIDtoBytes(source, base) { - switch (source[0]) { - // CIDv0 is parsed differently - case 'Q': { - const decoder = base ?? bases_base58_base58btc; - return [ - bases_base58_base58btc.prefix, - decoder.decode(`${bases_base58_base58btc.prefix}${source}`) - ]; - } - case bases_base58_base58btc.prefix: { - const decoder = base ?? bases_base58_base58btc; - return [bases_base58_base58btc.prefix, decoder.decode(source)]; - } - case bases_base32_base32.prefix: { - const decoder = base ?? bases_base32_base32; - return [bases_base32_base32.prefix, decoder.decode(source)]; - } - default: { - if (base == null) { - throw Error('To parse non base32 or base58btc encoded CID multibase decoder must be provided'); - } - return [source[0], base.decode(source)]; - } + +/** + * @param {string[] | Record} headers + * @returns {Record} + */ +function buildHeaders (headers) { + // When using undici.fetch, the headers list is stored + // as an array. + if (Array.isArray(headers)) { + /** @type {Record} */ + const headersPair = {} + + for (let i = 0; i < headers.length; i += 2) { + headersPair[headers[i]] = headers[i + 1] } + + return headersPair + } + + return headers } -function cid_toStringV0(bytes, cache, base) { - const { prefix } = base; - if (prefix !== bases_base58_base58btc.prefix) { - throw Error(`Cannot string encode V0 in ${base.name} encoding`); + +/** + * @param {Record} headers + * + * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers + * Nevertheless, it was changed and to avoid a security vulnerability by end users + * this check was created. + * It should be removed in the next major version for performance reasons + */ +function throwIfProxyAuthIsSent (headers) { + const existProxyAuth = headers && Object.keys(headers) + .find((key) => key.toLowerCase() === 'proxy-authorization') + if (existProxyAuth) { + throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor') + } +} + +module.exports = ProxyAgent + + +/***/ }), + +/***/ 19402: +/***/ ((module) => { + + + +let fastNow = Date.now() +let fastNowTimeout + +const fastTimers = [] + +function onTimeout () { + fastNow = Date.now() + + let len = fastTimers.length + let idx = 0 + while (idx < len) { + const timer = fastTimers[idx] + + if (timer.state === 0) { + timer.state = fastNow + timer.delay + } else if (timer.state > 0 && fastNow >= timer.state) { + timer.state = -1 + timer.callback(timer.opaque) } - const cid = cache.get(prefix); - if (cid == null) { - const cid = base.encode(bytes).slice(1); - cache.set(prefix, cid); - return cid; + + if (timer.state === -1) { + timer.state = -2 + if (idx !== len - 1) { + fastTimers[idx] = fastTimers.pop() + } else { + fastTimers.pop() + } + len -= 1 + } else { + idx += 1 } - else { - return cid; + } + + if (fastTimers.length > 0) { + refreshTimeout() + } +} + +function refreshTimeout () { + if (fastNowTimeout && fastNowTimeout.refresh) { + fastNowTimeout.refresh() + } else { + clearTimeout(fastNowTimeout) + fastNowTimeout = setTimeout(onTimeout, 1e3) + if (fastNowTimeout.unref) { + fastNowTimeout.unref() } + } } -function cid_toStringV1(bytes, cache, base) { - const { prefix } = base; - const cid = cache.get(prefix); - if (cid == null) { - const cid = base.encode(bytes); - cache.set(prefix, cid); - return cid; + +class Timeout { + constructor (callback, delay, opaque) { + this.callback = callback + this.delay = delay + this.opaque = opaque + + // -2 not in timer list + // -1 in timer list but inactive + // 0 in timer list waiting for time + // > 0 in timer list waiting for time to expire + this.state = -2 + + this.refresh() + } + + refresh () { + if (this.state === -2) { + fastTimers.push(this) + if (!fastNowTimeout || fastTimers.length === 1) { + refreshTimeout() + } } - else { - return cid; + + this.state = 0 + } + + clear () { + this.state = -1 + } +} + +module.exports = { + setTimeout (callback, delay, opaque) { + return delay < 1e3 + ? setTimeout(callback, delay, opaque) + : new Timeout(callback, delay, opaque) + }, + clearTimeout (timeout) { + if (timeout instanceof Timeout) { + timeout.clear() + } else { + clearTimeout(timeout) } + } } -const cid_DAG_PB_CODE = 0x70; -const cid_SHA_256_CODE = 0x12; -function cid_encodeCID(version, code, multihash) { - const codeOffset = varint_encodingLength(version); - const hashOffset = codeOffset + varint_encodingLength(code); - const bytes = new Uint8Array(hashOffset + multihash.byteLength); - varint_encodeTo(version, bytes, 0); - varint_encodeTo(code, bytes, codeOffset); - bytes.set(multihash, hashOffset); - return bytes; + + +/***/ }), + +/***/ 24100: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const diagnosticsChannel = __nccwpck_require__(67643) +const { uid, states } = __nccwpck_require__(29832) +const { + kReadyState, + kSentClose, + kByteParser, + kReceivedClose +} = __nccwpck_require__(42700) +const { fireEvent, failWebsocketConnection } = __nccwpck_require__(93694) +const { CloseEvent } = __nccwpck_require__(38173) +const { makeRequest } = __nccwpck_require__(20366) +const { fetching } = __nccwpck_require__(37215) +const { Headers } = __nccwpck_require__(13915) +const { getGlobalDispatcher } = __nccwpck_require__(94330) +const { kHeadersList } = __nccwpck_require__(69898) + +const channels = {} +channels.open = diagnosticsChannel.channel('undici:websocket:open') +channels.close = diagnosticsChannel.channel('undici:websocket:close') +channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error') + +/** @type {import('crypto')} */ +let crypto +try { + crypto = __nccwpck_require__(6113) +} catch { + } -const cid_cidSymbol = Symbol.for('@ipld/js-cid/CID'); -//# sourceMappingURL=cid.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/src/index.js +/** + * @see https://websockets.spec.whatwg.org/#concept-websocket-establish + * @param {URL} url + * @param {string|string[]} protocols + * @param {import('./websocket').WebSocket} ws + * @param {(response: any) => void} onEstablish + * @param {Partial} options + */ +function establishWebSocketConnection (url, protocols, ws, onEstablish, options) { + // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s + // scheme is "ws", and to "https" otherwise. + const requestURL = url + + requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:' + + // 2. Let request be a new request, whose URL is requestURL, client is client, + // service-workers mode is "none", referrer is "no-referrer", mode is + // "websocket", credentials mode is "include", cache mode is "no-store" , + // and redirect mode is "error". + const request = makeRequest({ + urlList: [requestURL], + serviceWorkers: 'none', + referrer: 'no-referrer', + mode: 'websocket', + credentials: 'include', + cache: 'no-store', + redirect: 'error' + }) + + // Note: undici extension, allow setting custom headers. + if (options.headers) { + const headersList = new Headers(options.headers)[kHeadersList] + + request.headersList = headersList + } + + // 3. Append (`Upgrade`, `websocket`) to request’s header list. + // 4. Append (`Connection`, `Upgrade`) to request’s header list. + // Note: both of these are handled by undici currently. + // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397 + + // 5. Let keyValue be a nonce consisting of a randomly selected + // 16-byte value that has been forgiving-base64-encoded and + // isomorphic encoded. + const keyValue = crypto.randomBytes(16).toString('base64') + + // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s + // header list. + request.headersList.append('sec-websocket-key', keyValue) + + // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s + // header list. + request.headersList.append('sec-websocket-version', '13') + // 8. For each protocol in protocols, combine + // (`Sec-WebSocket-Protocol`, protocol) in request’s header + // list. + for (const protocol of protocols) { + request.headersList.append('sec-websocket-protocol', protocol) + } -// https://github.com/ipfs/go-ipfs/issues/3570#issuecomment-273931692 -const CID_CBOR_TAG = 42 + // 9. Let permessageDeflate be a user-agent defined + // "permessage-deflate" extension header value. + // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673 + // TODO: enable once permessage-deflate is supported + const permessageDeflate = '' // 'permessage-deflate; 15' -/** - * @template T - * @typedef {import('multiformats/codecs/interface').ByteView} ByteView - */ + // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to + // request’s header list. + // request.headersList.append('sec-websocket-extensions', permessageDeflate) -/** - * cidEncoder will receive all Objects during encode, it needs to filter out - * anything that's not a CID and return `null` for that so it's encoded as - * normal. - * - * @param {any} obj - * @returns {cborg.Token[]|null} - */ -function cidEncoder (obj) { - if (obj.asCID !== obj && obj['/'] !== obj.bytes) { - return null // any other kind of object - } - const cid = src_cid_CID.asCID(obj) - /* c8 ignore next 4 */ - // very unlikely case, and it'll probably throw a recursion error in cborg - if (!cid) { - return null - } - const bytes = new Uint8Array(cid.bytes.byteLength + 1) - bytes.set(cid.bytes, 1) // prefix is 0x00, for historical reasons - return [ - new token_Token(token_Type.tag, CID_CBOR_TAG), - new token_Token(token_Type.bytes, bytes) - ] + // 11. Fetch request with useParallelQueue set to true, and + // processResponse given response being these steps: + const controller = fetching({ + request, + useParallelQueue: true, + dispatcher: options.dispatcher ?? getGlobalDispatcher(), + processResponse (response) { + // 1. If response is a network error or its status is not 101, + // fail the WebSocket connection. + if (response.type === 'error' || response.status !== 101) { + failWebsocketConnection(ws, 'Received network error or non-101 status code.') + return + } + + // 2. If protocols is not the empty list and extracting header + // list values given `Sec-WebSocket-Protocol` and response’s + // header list results in null, failure, or the empty byte + // sequence, then fail the WebSocket connection. + if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) { + failWebsocketConnection(ws, 'Server did not respond with sent protocols.') + return + } + + // 3. Follow the requirements stated step 2 to step 6, inclusive, + // of the last set of steps in section 4.1 of The WebSocket + // Protocol to validate response. This either results in fail + // the WebSocket connection or the WebSocket connection is + // established. + + // 2. If the response lacks an |Upgrade| header field or the |Upgrade| + // header field contains a value that is not an ASCII case- + // insensitive match for the value "websocket", the client MUST + // _Fail the WebSocket Connection_. + if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') { + failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".') + return + } + + // 3. If the response lacks a |Connection| header field or the + // |Connection| header field doesn't contain a token that is an + // ASCII case-insensitive match for the value "Upgrade", the client + // MUST _Fail the WebSocket Connection_. + if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') { + failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".') + return + } + + // 4. If the response lacks a |Sec-WebSocket-Accept| header field or + // the |Sec-WebSocket-Accept| contains a value other than the + // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket- + // Key| (as a string, not base64-decoded) with the string "258EAFA5- + // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and + // trailing whitespace, the client MUST _Fail the WebSocket + // Connection_. + const secWSAccept = response.headersList.get('Sec-WebSocket-Accept') + const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64') + if (secWSAccept !== digest) { + failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.') + return + } + + // 5. If the response includes a |Sec-WebSocket-Extensions| header + // field and this header field indicates the use of an extension + // that was not present in the client's handshake (the server has + // indicated an extension not requested by the client), the client + // MUST _Fail the WebSocket Connection_. (The parsing of this + // header field to determine which extensions are requested is + // discussed in Section 9.1.) + const secExtension = response.headersList.get('Sec-WebSocket-Extensions') + + if (secExtension !== null && secExtension !== permessageDeflate) { + failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.') + return + } + + // 6. If the response includes a |Sec-WebSocket-Protocol| header field + // and this header field indicates the use of a subprotocol that was + // not present in the client's handshake (the server has indicated a + // subprotocol not requested by the client), the client MUST _Fail + // the WebSocket Connection_. + const secProtocol = response.headersList.get('Sec-WebSocket-Protocol') + + if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) { + failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.') + return + } + + response.socket.on('data', onSocketData) + response.socket.on('close', onSocketClose) + response.socket.on('error', onSocketError) + + if (channels.open.hasSubscribers) { + channels.open.publish({ + address: response.socket.address(), + protocol: secProtocol, + extensions: secExtension + }) + } + + onEstablish(response) + } + }) + + return controller } -// eslint-disable-next-line jsdoc/require-returns-check /** - * Intercept all `undefined` values from an object walk and reject the entire - * object if we find one. - * - * @returns {null} + * @param {Buffer} chunk */ -function undefinedEncoder () { - throw new Error('`undefined` is not supported by the IPLD Data Model and cannot be encoded') +function onSocketData (chunk) { + if (!this.ws[kByteParser].write(chunk)) { + this.pause() + } } /** - * Intercept all `number` values from an object walk and reject the entire - * object if we find something that doesn't fit the IPLD data model (NaN & - * Infinity). - * - * @param {number} num - * @returns {null} + * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol + * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4 */ -function numberEncoder (num) { - if (Number.isNaN(num)) { - throw new Error('`NaN` is not supported by the IPLD Data Model and cannot be encoded') +function onSocketClose () { + const { ws } = this + + // If the TCP connection was closed after the + // WebSocket closing handshake was completed, the WebSocket connection + // is said to have been closed _cleanly_. + const wasClean = ws[kSentClose] && ws[kReceivedClose] + + let code = 1005 + let reason = '' + + const result = ws[kByteParser].closingInfo + + if (result) { + code = result.code ?? 1005 + reason = result.reason + } else if (!ws[kSentClose]) { + // If _The WebSocket + // Connection is Closed_ and no Close control frame was received by the + // endpoint (such as could occur if the underlying transport connection + // is lost), _The WebSocket Connection Close Code_ is considered to be + // 1006. + code = 1006 } - if (num === Infinity || num === -Infinity) { - throw new Error('`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded') + + // 1. Change the ready state to CLOSED (3). + ws[kReadyState] = states.CLOSED + + // 2. If the user agent was required to fail the WebSocket + // connection, or if the WebSocket connection was closed + // after being flagged as full, fire an event named error + // at the WebSocket object. + // TODO + + // 3. Fire an event named close at the WebSocket object, + // using CloseEvent, with the wasClean attribute + // initialized to true if the connection closed cleanly + // and false otherwise, the code attribute initialized to + // the WebSocket connection close code, and the reason + // attribute initialized to the result of applying UTF-8 + // decode without BOM to the WebSocket connection close + // reason. + fireEvent('close', ws, CloseEvent, { + wasClean, code, reason + }) + + if (channels.close.hasSubscribers) { + channels.close.publish({ + websocket: ws, + code, + reason + }) } - return null } -const encodeOptions = { - float64: true, - typeEncoders: { - Object: cidEncoder, - undefined: undefinedEncoder, - number: numberEncoder +function onSocketError (error) { + const { ws } = this + + ws[kReadyState] = states.CLOSING + + if (channels.socketError.hasSubscribers) { + channels.socketError.publish(error) } + + this.destroy() } -/** - * @param {Uint8Array} bytes - * @returns {CID} - */ -function cidDecoder (bytes) { - if (bytes[0] !== 0) { - throw new Error('Invalid CID for CBOR tag 42; expected leading 0x00') - } - return src_cid_CID.decode(bytes.subarray(1)) // ignore leading 0x00 +module.exports = { + establishWebSocketConnection } -const decodeOptions = { - allowIndefinite: false, - coerceUndefinedToNull: true, - allowNaN: false, - allowInfinity: false, - allowBigInt: true, // this will lead to BigInt for ints outside of - // safe-integer range, which may surprise users - strict: true, - useMaps: false, - rejectDuplicateMapKeys: true, - /** @type {import('cborg').TagDecoder[]} */ - tags: [] + +/***/ }), + +/***/ 29832: +/***/ ((module) => { + + + +// This is a Globally Unique Identifier unique used +// to validate that the endpoint accepts websocket +// connections. +// See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3 +const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11' + +/** @type {PropertyDescriptor} */ +const staticPropertyDescriptors = { + enumerable: true, + writable: false, + configurable: false } -decodeOptions.tags[CID_CBOR_TAG] = cidDecoder -const dag_cbor_src_name = 'dag-cbor' -const src_code = 0x71 +const states = { + CONNECTING: 0, + OPEN: 1, + CLOSING: 2, + CLOSED: 3 +} -/** - * @template T - * @param {T} node - * @returns {ByteView} - */ -const dag_cbor_src_encode = (node) => encode_encode(node, encodeOptions) +const opcodes = { + CONTINUATION: 0x0, + TEXT: 0x1, + BINARY: 0x2, + CLOSE: 0x8, + PING: 0x9, + PONG: 0xA +} -/** - * @template T - * @param {ByteView} data - * @returns {T} - */ -const dag_cbor_src_decode = (data) => decode_decode(data, decodeOptions) +const maxUnsigned16Bit = 2 ** 16 - 1 // 65535 -;// CONCATENATED MODULE: ./node_modules/cborg/lib/json/encode.js +const parserStates = { + INFO: 0, + PAYLOADLENGTH_16: 2, + PAYLOADLENGTH_64: 3, + READ_DATA: 4 +} + +const emptyBuffer = Buffer.allocUnsafe(0) + +module.exports = { + uid, + staticPropertyDescriptors, + states, + opcodes, + maxUnsigned16Bit, + parserStates, + emptyBuffer +} + + +/***/ }), +/***/ 38173: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +const { webidl } = __nccwpck_require__(7000) +const { kEnumerableProperty } = __nccwpck_require__(43061) +const { MessagePort } = __nccwpck_require__(71267) /** - * @typedef {import('../../interface').EncodeOptions} EncodeOptions - * @typedef {import('../token').Token} Token - * @typedef {import('../bl').Bl} Bl + * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent */ +class MessageEvent extends Event { + #eventInit -class JSONEncoder extends Array { - constructor () { - super() - /** @type {{type:Type,elements:number}[]} */ - this.inRecursive = [] - } + constructor (type, eventInitDict = {}) { + webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' }) - /** - * @param {Bl} buf - */ - prefix (buf) { - const recurs = this.inRecursive[this.inRecursive.length - 1] - if (recurs) { - if (recurs.type === token_Type.array) { - recurs.elements++ - if (recurs.elements !== 1) { // >first - buf.push([44]) // ',' - } - } - if (recurs.type === token_Type.map) { - recurs.elements++ - if (recurs.elements !== 1) { // >first - if (recurs.elements % 2 === 1) { // key - buf.push([44]) // ',' - } else { - buf.push([58]) // ':' - } - } - } - } - } + type = webidl.converters.DOMString(type) + eventInitDict = webidl.converters.MessageEventInit(eventInitDict) - /** - * @param {Bl} buf - * @param {Token} token - */ - [token_Type.uint.major] (buf, token) { - this.prefix(buf) - const is = String(token.value) - const isa = [] - for (let i = 0; i < is.length; i++) { - isa[i] = is.charCodeAt(i) - } - buf.push(isa) - } + super(type, eventInitDict) - /** - * @param {Bl} buf - * @param {Token} token - */ - [token_Type.negint.major] (buf, token) { - // @ts-ignore hack - this[token_Type.uint.major](buf, token) + this.#eventInit = eventInitDict } - /** - * @param {Bl} _buf - * @param {Token} _token - */ - [token_Type.bytes.major] (_buf, _token) { - throw new Error(`${encodeErrPrefix} unsupported type: Uint8Array`) + get data () { + webidl.brandCheck(this, MessageEvent) + + return this.#eventInit.data } - /** - * @param {Bl} buf - * @param {Token} token - */ - [token_Type.string.major] (buf, token) { - this.prefix(buf) - // buf.push(34) // '"' - // encodeUtf8(token.value, byts) - // buf.push(34) // '"' - const byts = byte_utils_fromString(JSON.stringify(token.value)) - buf.push(byts.length > 32 ? asU8A(byts) : byts) + get origin () { + webidl.brandCheck(this, MessageEvent) + + return this.#eventInit.origin } - /** - * @param {Bl} buf - * @param {Token} _token - */ - [token_Type.array.major] (buf, _token) { - this.prefix(buf) - this.inRecursive.push({ type: token_Type.array, elements: 0 }) - buf.push([91]) // '[' + get lastEventId () { + webidl.brandCheck(this, MessageEvent) + + return this.#eventInit.lastEventId } - /** - * @param {Bl} buf - * @param {Token} _token - */ - [token_Type.map.major] (buf, _token) { - this.prefix(buf) - this.inRecursive.push({ type: token_Type.map, elements: 0 }) - buf.push([123]) // '{' + get source () { + webidl.brandCheck(this, MessageEvent) + + return this.#eventInit.source } - /** - * @param {Bl} _buf - * @param {Token} _token - */ - [token_Type.tag.major] (_buf, _token) {} + get ports () { + webidl.brandCheck(this, MessageEvent) - /** - * @param {Bl} buf - * @param {Token} token - */ - [token_Type.float.major] (buf, token) { - if (token.type.name === 'break') { - const recurs = this.inRecursive.pop() - if (recurs) { - if (recurs.type === token_Type.array) { - buf.push([93]) // ']' - } else if (recurs.type === token_Type.map) { - buf.push([125]) // '}' - /* c8 ignore next 3 */ - } else { - throw new Error('Unexpected recursive type; this should not happen!') - } - return - } - /* c8 ignore next 2 */ - throw new Error('Unexpected break; this should not happen!') - } - if (token.value === undefined) { - throw new Error(`${encodeErrPrefix} unsupported type: undefined`) + if (!Object.isFrozen(this.#eventInit.ports)) { + Object.freeze(this.#eventInit.ports) } - this.prefix(buf) - if (token.type.name === 'true') { - buf.push([116, 114, 117, 101]) // 'true' - return - } else if (token.type.name === 'false') { - buf.push([102, 97, 108, 115, 101]) // 'false' - return - } else if (token.type.name === 'null') { - buf.push([110, 117, 108, 108]) // 'null' - return - } + return this.#eventInit.ports + } - // number - const is = String(token.value) - const isa = [] - let dp = false - for (let i = 0; i < is.length; i++) { - isa[i] = is.charCodeAt(i) - if (!dp && (isa[i] === 46 || isa[i] === 101 || isa[i] === 69)) { // '[.eE]' - dp = true - } - } - if (!dp) { // need a decimal point for floats - isa.push(46) // '.' - isa.push(48) // '0' - } - buf.push(isa) + initMessageEvent ( + type, + bubbles = false, + cancelable = false, + data = null, + origin = '', + lastEventId = '', + source = null, + ports = [] + ) { + webidl.brandCheck(this, MessageEvent) + + webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' }) + + return new MessageEvent(type, { + bubbles, cancelable, data, origin, lastEventId, source, ports + }) } } -// The below code is mostly taken and modified from https://github.com/feross/buffer -// Licensed MIT. Copyright (c) Feross Aboukhadijeh -// function encodeUtf8 (string, byts) { -// let codePoint -// const length = string.length -// let leadSurrogate = null +/** + * @see https://websockets.spec.whatwg.org/#the-closeevent-interface + */ +class CloseEvent extends Event { + #eventInit -// for (let i = 0; i < length; ++i) { -// codePoint = string.charCodeAt(i) + constructor (type, eventInitDict = {}) { + webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' }) -// // is surrogate component -// if (codePoint > 0xd7ff && codePoint < 0xe000) { -// // last char was a lead -// if (!leadSurrogate) { -// // no lead yet -// /* c8 ignore next 9 */ -// if (codePoint > 0xdbff) { -// // unexpected trail -// byts.push(0xef, 0xbf, 0xbd) -// continue -// } else if (i + 1 === length) { -// // unpaired lead -// byts.push(0xef, 0xbf, 0xbd) -// continue -// } + type = webidl.converters.DOMString(type) + eventInitDict = webidl.converters.CloseEventInit(eventInitDict) -// // valid lead -// leadSurrogate = codePoint + super(type, eventInitDict) -// continue -// } + this.#eventInit = eventInitDict + } -// // 2 leads in a row -// /* c8 ignore next 5 */ -// if (codePoint < 0xdc00) { -// byts.push(0xef, 0xbf, 0xbd) -// leadSurrogate = codePoint -// continue -// } + get wasClean () { + webidl.brandCheck(this, CloseEvent) -// // valid surrogate pair -// codePoint = (leadSurrogate - 0xd800 << 10 | codePoint - 0xdc00) + 0x10000 -// /* c8 ignore next 4 */ -// } else if (leadSurrogate) { -// // valid bmp char, but last char was a lead -// byts.push(0xef, 0xbf, 0xbd) -// } + return this.#eventInit.wasClean + } -// leadSurrogate = null + get code () { + webidl.brandCheck(this, CloseEvent) -// // encode utf8 -// if (codePoint < 0x80) { -// // special JSON escapes -// switch (codePoint) { -// case 8: // '\b' -// byts.push(92, 98) // '\\b' -// continue -// case 9: // '\t' -// byts.push(92, 116) // '\\t' -// continue -// case 10: // '\n' -// byts.push(92, 110) // '\\n' -// continue -// case 12: // '\f' -// byts.push(92, 102) // '\\f' -// continue -// case 13: // '\r' -// byts.push(92, 114) // '\\r' -// continue -// case 34: // '"' -// byts.push(92, 34) // '\\"' -// continue -// case 92: // '\\' -// byts.push(92, 92) // '\\\\' -// continue -// } + return this.#eventInit.code + } -// byts.push(codePoint) -// } else if (codePoint < 0x800) { -// /* c8 ignore next 1 */ -// byts.push( -// codePoint >> 0x6 | 0xc0, -// codePoint & 0x3f | 0x80 -// ) -// } else if (codePoint < 0x10000) { -// /* c8 ignore next 1 */ -// byts.push( -// codePoint >> 0xc | 0xe0, -// codePoint >> 0x6 & 0x3f | 0x80, -// codePoint & 0x3f | 0x80 -// ) -// /* c8 ignore next 9 */ -// } else if (codePoint < 0x110000) { -// byts.push( -// codePoint >> 0x12 | 0xf0, -// codePoint >> 0xc & 0x3f | 0x80, -// codePoint >> 0x6 & 0x3f | 0x80, -// codePoint & 0x3f | 0x80 -// ) -// } else { -// /* c8 ignore next 2 */ -// throw new Error('Invalid code point') -// } -// } -// } + get reason () { + webidl.brandCheck(this, CloseEvent) -/** - * @param {(Token|Token[])[]} e1 - * @param {(Token|Token[])[]} e2 - * @returns {number} - */ -function encode_mapSorter (e1, e2) { - if (Array.isArray(e1[0]) || Array.isArray(e2[0])) { - throw new Error(`${encodeErrPrefix} complex map keys are not supported`) - } - const keyToken1 = e1[0] - const keyToken2 = e2[0] - if (keyToken1.type !== token_Type.string || keyToken2.type !== token_Type.string) { - throw new Error(`${encodeErrPrefix} non-string map keys are not supported`) - } - if (keyToken1 < keyToken2) { - return -1 - } - if (keyToken1 > keyToken2) { - return 1 + return this.#eventInit.reason } - /* c8 ignore next 1 */ - throw new Error(`${encodeErrPrefix} unexpected duplicate map keys, this is not supported`) } -const encode_defaultEncodeOptions = { addBreakTokens: true, mapSorter: encode_mapSorter } +// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface +class ErrorEvent extends Event { + #eventInit -/** - * @param {any} data - * @param {EncodeOptions} [options] - * @returns {Uint8Array} - */ -function json_encode_encode (data, options) { - options = Object.assign({}, encode_defaultEncodeOptions, options) - return encodeCustom(data, new JSONEncoder(), options) -} + constructor (type, eventInitDict) { + webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' }) + super(type, eventInitDict) + type = webidl.converters.DOMString(type) + eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {}) -;// CONCATENATED MODULE: ./node_modules/cborg/lib/json/decode.js + this.#eventInit = eventInitDict + } + get message () { + webidl.brandCheck(this, ErrorEvent) + return this.#eventInit.message + } + get filename () { + webidl.brandCheck(this, ErrorEvent) + return this.#eventInit.filename + } -/** - * @typedef {import('../../interface').DecodeOptions} DecodeOptions - * @typedef {import('../../interface').DecodeTokenizer} DecodeTokenizer - */ + get lineno () { + webidl.brandCheck(this, ErrorEvent) -/** - * @implements {DecodeTokenizer} - */ -class Tokenizer { - /** - * @param {Uint8Array} data - * @param {DecodeOptions} options - */ - constructor (data, options = {}) { - this._pos = 0 - this.data = data - this.options = options - /** @type {string[]} */ - this.modeStack = ['value'] - this.lastToken = '' + return this.#eventInit.lineno } - pos () { - return this._pos - } + get colno () { + webidl.brandCheck(this, ErrorEvent) - /** - * @returns {boolean} - */ - done () { - return this._pos >= this.data.length + return this.#eventInit.colno } - /** - * @returns {number} - */ - ch () { - return this.data[this._pos] + get error () { + webidl.brandCheck(this, ErrorEvent) + + return this.#eventInit.error } +} - /** - * @returns {string} - */ - currentMode () { - return this.modeStack[this.modeStack.length - 1] +Object.defineProperties(MessageEvent.prototype, { + [Symbol.toStringTag]: { + value: 'MessageEvent', + configurable: true + }, + data: kEnumerableProperty, + origin: kEnumerableProperty, + lastEventId: kEnumerableProperty, + source: kEnumerableProperty, + ports: kEnumerableProperty, + initMessageEvent: kEnumerableProperty +}) + +Object.defineProperties(CloseEvent.prototype, { + [Symbol.toStringTag]: { + value: 'CloseEvent', + configurable: true + }, + reason: kEnumerableProperty, + code: kEnumerableProperty, + wasClean: kEnumerableProperty +}) + +Object.defineProperties(ErrorEvent.prototype, { + [Symbol.toStringTag]: { + value: 'ErrorEvent', + configurable: true + }, + message: kEnumerableProperty, + filename: kEnumerableProperty, + lineno: kEnumerableProperty, + colno: kEnumerableProperty, + error: kEnumerableProperty +}) + +webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort) + +webidl.converters['sequence'] = webidl.sequenceConverter( + webidl.converters.MessagePort +) + +const eventInit = [ + { + key: 'bubbles', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'cancelable', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'composed', + converter: webidl.converters.boolean, + defaultValue: false } +] - skipWhitespace () { - let c = this.ch() - // @ts-ignore - while (c === 32 /* ' ' */ || c === 9 /* '\t' */ || c === 13 /* '\r' */ || c === 10 /* '\n' */) { - c = this.data[++this._pos] +webidl.converters.MessageEventInit = webidl.dictionaryConverter([ + ...eventInit, + { + key: 'data', + converter: webidl.converters.any, + defaultValue: null + }, + { + key: 'origin', + converter: webidl.converters.USVString, + defaultValue: '' + }, + { + key: 'lastEventId', + converter: webidl.converters.DOMString, + defaultValue: '' + }, + { + key: 'source', + // Node doesn't implement WindowProxy or ServiceWorker, so the only + // valid value for source is a MessagePort. + converter: webidl.nullableConverter(webidl.converters.MessagePort), + defaultValue: null + }, + { + key: 'ports', + converter: webidl.converters['sequence'], + get defaultValue () { + return [] } } +]) - /** - * @param {number[]} str - */ - expect (str) { - if (this.data.length - this._pos < str.length) { - throw new Error(`${decodeErrPrefix} unexpected end of input at position ${this._pos}`) - } - for (let i = 0; i < str.length; i++) { - if (this.data[this._pos++] !== str[i]) { - throw new Error(`${decodeErrPrefix} unexpected token at position ${this._pos}, expected to find '${String.fromCharCode(...str)}'`) - } - } +webidl.converters.CloseEventInit = webidl.dictionaryConverter([ + ...eventInit, + { + key: 'wasClean', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'code', + converter: webidl.converters['unsigned short'], + defaultValue: 0 + }, + { + key: 'reason', + converter: webidl.converters.USVString, + defaultValue: '' } +]) - parseNumber () { - const startPos = this._pos - let negative = false - let float = false +webidl.converters.ErrorEventInit = webidl.dictionaryConverter([ + ...eventInit, + { + key: 'message', + converter: webidl.converters.DOMString, + defaultValue: '' + }, + { + key: 'filename', + converter: webidl.converters.USVString, + defaultValue: '' + }, + { + key: 'lineno', + converter: webidl.converters['unsigned long'], + defaultValue: 0 + }, + { + key: 'colno', + converter: webidl.converters['unsigned long'], + defaultValue: 0 + }, + { + key: 'error', + converter: webidl.converters.any + } +]) - /** - * @param {number[]} chars - */ - const swallow = (chars) => { - while (!this.done()) { - const ch = this.ch() - if (chars.includes(ch)) { - this._pos++ - } else { - break - } - } - } +module.exports = { + MessageEvent, + CloseEvent, + ErrorEvent +} - // lead - if (this.ch() === 45) { // '-' - negative = true - this._pos++ - } - if (this.ch() === 48) { // '0' - this._pos++ - if (this.ch() === 46) { // '.' - this._pos++ - float = true - } else { - return new token_Token(token_Type.uint, 0, this._pos - startPos) - } - } - swallow([48, 49, 50, 51, 52, 53, 54, 55, 56, 57]) // DIGIT - if (negative && this._pos === startPos + 1) { - throw new Error(`${decodeErrPrefix} unexpected token at position ${this._pos}`) - } - if (!this.done() && this.ch() === 46) { // '.' - if (float) { - throw new Error(`${decodeErrPrefix} unexpected token at position ${this._pos}`) - } - float = true - this._pos++ - swallow([48, 49, 50, 51, 52, 53, 54, 55, 56, 57]) // DIGIT - } - if (!this.done() && (this.ch() === 101 || this.ch() === 69)) { // '[eE]' - float = true - this._pos++ - if (!this.done() && (this.ch() === 43 || this.ch() === 45)) { // '+', '-' - this._pos++ - } - swallow([48, 49, 50, 51, 52, 53, 54, 55, 56, 57]) // DIGIT - } - // @ts-ignore - const numStr = String.fromCharCode.apply(null, this.data.subarray(startPos, this._pos)) - const num = parseFloat(numStr) - if (float) { - return new token_Token(token_Type.float, num, this._pos - startPos) - } - if (this.options.allowBigInt !== true || Number.isSafeInteger(num)) { - return new token_Token(num >= 0 ? token_Type.uint : token_Type.negint, num, this._pos - startPos) - } - return new token_Token(num >= 0 ? token_Type.uint : token_Type.negint, BigInt(numStr), this._pos - startPos) - } +/***/ }), + +/***/ 47206: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const { maxUnsigned16Bit } = __nccwpck_require__(29832) + +/** @type {import('crypto')} */ +let crypto +try { + crypto = __nccwpck_require__(6113) +} catch { + +} + +class WebsocketFrameSend { /** - * @returns {Token} + * @param {Buffer|undefined} data */ - parseString () { - /* c8 ignore next 4 */ - if (this.ch() !== 34) { // '"' - // this would be a programming error - throw new Error(`${decodeErrPrefix} unexpected character at position ${this._pos}; this shouldn't happen`) + constructor (data) { + this.frameData = data + this.maskKey = crypto.randomBytes(4) + } + + createFrame (opcode) { + const bodyLength = this.frameData?.byteLength ?? 0 + + /** @type {number} */ + let payloadLength = bodyLength // 0-125 + let offset = 6 + + if (bodyLength > maxUnsigned16Bit) { + offset += 8 // payload length is next 8 bytes + payloadLength = 127 + } else if (bodyLength > 125) { + offset += 2 // payload length is next 2 bytes + payloadLength = 126 } - this._pos++ - // check for simple fast-path, all printable ascii, no escapes - // >0x10000 elements may fail fn.apply() (http://stackoverflow.com/a/22747272/680742) - for (let i = this._pos, l = 0; i < this.data.length && l < 0x10000; i++, l++) { - const ch = this.data[i] - if (ch === 92 || ch < 32 || ch >= 128) { // '\', ' ', control-chars or non-trivial - break - } - if (ch === 34) { // '"' - // @ts-ignore - const str = String.fromCharCode.apply(null, this.data.subarray(this._pos, i)) - this._pos = i + 1 - return new token_Token(token_Type.string, str, l) - } + const buffer = Buffer.allocUnsafe(bodyLength + offset) + + // Clear first 2 bytes, everything else is overwritten + buffer[0] = buffer[1] = 0 + buffer[0] |= 0x80 // FIN + buffer[0] = (buffer[0] & 0xF0) + opcode // opcode + + /*! ws. MIT License. Einar Otto Stangvik */ + buffer[offset - 4] = this.maskKey[0] + buffer[offset - 3] = this.maskKey[1] + buffer[offset - 2] = this.maskKey[2] + buffer[offset - 1] = this.maskKey[3] + + buffer[1] = payloadLength + + if (payloadLength === 126) { + buffer.writeUInt16BE(bodyLength, 2) + } else if (payloadLength === 127) { + // Clear extended payload length + buffer[2] = buffer[3] = 0 + buffer.writeUIntBE(bodyLength, 4, 6) } - const startPos = this._pos - const chars = [] + buffer[1] |= 0x80 // MASK - const readu4 = () => { - if (this._pos + 4 >= this.data.length) { - throw new Error(`${decodeErrPrefix} unexpected end of unicode escape sequence at position ${this._pos}`) - } - let u4 = 0 - for (let i = 0; i < 4; i++) { - let ch = this.ch() - if (ch >= 48 && ch <= 57) { // '0' && '9' - ch -= 48 - } else if (ch >= 97 && ch <= 102) { // 'a' && 'f' - ch = ch - 97 + 10 - } else if (ch >= 65 && ch <= 70) { // 'A' && 'F' - ch = ch - 65 + 10 - } else { - throw new Error(`${decodeErrPrefix} unexpected unicode escape character at position ${this._pos}`) - } - u4 = u4 * 16 + ch - this._pos++ - } - return u4 + // mask body + for (let i = 0; i < bodyLength; i++) { + buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4] } - // mostly taken from feross/buffer and adjusted to fit - const readUtf8Char = () => { - const firstByte = this.ch() - let codePoint = null - /* c8 ignore next 1 */ - let bytesPerSequence = (firstByte > 0xef) ? 4 : (firstByte > 0xdf) ? 3 : (firstByte > 0xbf) ? 2 : 1 + return buffer + } +} - if (this._pos + bytesPerSequence > this.data.length) { - throw new Error(`${decodeErrPrefix} unexpected unicode sequence at position ${this._pos}`) - } +module.exports = { + WebsocketFrameSend +} - let secondByte, thirdByte, fourthByte, tempCodePoint - switch (bytesPerSequence) { - /* c8 ignore next 6 */ - // this case is dealt with by the caller function - case 1: - if (firstByte < 0x80) { - codePoint = firstByte - } - break - case 2: - secondByte = this.data[this._pos + 1] - if ((secondByte & 0xc0) === 0x80) { - tempCodePoint = (firstByte & 0x1f) << 0x6 | (secondByte & 0x3f) - if (tempCodePoint > 0x7f) { - codePoint = tempCodePoint - } - } - break - case 3: - secondByte = this.data[this._pos + 1] - thirdByte = this.data[this._pos + 2] - if ((secondByte & 0xc0) === 0x80 && (thirdByte & 0xc0) === 0x80) { - tempCodePoint = (firstByte & 0xf) << 0xc | (secondByte & 0x3f) << 0x6 | (thirdByte & 0x3f) - /* c8 ignore next 3 */ - if (tempCodePoint > 0x7ff && (tempCodePoint < 0xd800 || tempCodePoint > 0xdfff)) { - codePoint = tempCodePoint - } - } - break - case 4: - secondByte = this.data[this._pos + 1] - thirdByte = this.data[this._pos + 2] - fourthByte = this.data[this._pos + 3] - if ((secondByte & 0xc0) === 0x80 && (thirdByte & 0xc0) === 0x80 && (fourthByte & 0xc0) === 0x80) { - tempCodePoint = (firstByte & 0xf) << 0x12 | (secondByte & 0x3f) << 0xc | (thirdByte & 0x3f) << 0x6 | (fourthByte & 0x3f) - if (tempCodePoint > 0xffff && tempCodePoint < 0x110000) { - codePoint = tempCodePoint - } - } - } +/***/ }), - /* c8 ignore next 5 */ - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 0xfffd - bytesPerSequence = 1 - } else if (codePoint > 0xffff) { - // encode to utf16 (surrogate pair dance) - codePoint -= 0x10000 - chars.push(codePoint >>> 10 & 0x3ff | 0xd800) - codePoint = 0xdc00 | codePoint & 0x3ff - } +/***/ 61746: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - chars.push(codePoint) - this._pos += bytesPerSequence - } - // TODO: could take the approach of a quick first scan for special chars like encoding/json/decode.go#unquoteBytes - // and converting all of the ascii chars from the base array in bulk - while (!this.done()) { - const ch = this.ch() - let ch1 - switch (ch) { - case 92: // '\' - this._pos++ - if (this.done()) { - throw new Error(`${decodeErrPrefix} unexpected string termination at position ${this._pos}`) - } - ch1 = this.ch() - this._pos++ - switch (ch1) { - case 34: // '"' - case 39: // '\'' - case 92: // '\' - case 47: // '/' - chars.push(ch1) - break - case 98: // 'b' - chars.push(8) - break - case 116: // 't' - chars.push(9) - break - case 110: // 'n' - chars.push(10) - break - case 102: // 'f' - chars.push(12) - break - case 114: // 'r' - chars.push(13) - break - case 117: // 'u' - chars.push(readu4()) - break - default: - throw new Error(`${decodeErrPrefix} unexpected string escape character at position ${this._pos}`) - } - break - case 34: // '"' - this._pos++ - return new token_Token(token_Type.string, decodeCodePointsArray(chars), this._pos - startPos) - default: - if (ch < 32) { // ' ' - throw new Error(`${decodeErrPrefix} invalid control character at position ${this._pos}`) - } else if (ch < 0x80) { - chars.push(ch) - this._pos++ - } else { - readUtf8Char() - } - } - } - throw new Error(`${decodeErrPrefix} unexpected end of string at position ${this._pos}`) +const { Writable } = __nccwpck_require__(12781) +const diagnosticsChannel = __nccwpck_require__(67643) +const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(29832) +const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(42700) +const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(93694) +const { WebsocketFrameSend } = __nccwpck_require__(47206) + +// This code was influenced by ws released under the MIT license. +// Copyright (c) 2011 Einar Otto Stangvik +// Copyright (c) 2013 Arnout Kazemier and contributors +// Copyright (c) 2016 Luigi Pinca and contributors + +const channels = {} +channels.ping = diagnosticsChannel.channel('undici:websocket:ping') +channels.pong = diagnosticsChannel.channel('undici:websocket:pong') + +class ByteParser extends Writable { + #buffers = [] + #byteOffset = 0 + + #state = parserStates.INFO + + #info = {} + #fragments = [] + + constructor (ws) { + super() + + this.ws = ws } /** - * @returns {Token} + * @param {Buffer} chunk + * @param {() => void} callback */ - parseValue () { - switch (this.ch()) { - case 123: // '{' - this.modeStack.push('obj-start') - this._pos++ - return new token_Token(token_Type.map, Infinity, 1) - case 91: // '[' - this.modeStack.push('array-start') - this._pos++ - return new token_Token(token_Type.array, Infinity, 1) - case 34: { // '"' - return this.parseString() - } - case 110: // 'n' / null - this.expect([110, 117, 108, 108]) // 'null' - return new token_Token(token_Type["null"], null, 4) - case 102: // 'f' / // false - this.expect([102, 97, 108, 115, 101]) // 'false' - return new token_Token(token_Type["false"], false, 5) - case 116: // 't' / // true - this.expect([116, 114, 117, 101]) // 'true' - return new token_Token(token_Type["true"], true, 4) - case 45: // '-' - case 48: // '0' - case 49: // '1' - case 50: // '2' - case 51: // '3' - case 52: // '4' - case 53: // '5' - case 54: // '6' - case 55: // '7' - case 56: // '8' - case 57: // '9' - return this.parseNumber() - default: - throw new Error(`${decodeErrPrefix} unexpected character at position ${this._pos}`) - } + _write (chunk, _, callback) { + this.#buffers.push(chunk) + this.#byteOffset += chunk.length + + this.run(callback) } /** - * @returns {Token} + * Runs whenever a new chunk is received. + * Callback is called whenever there are no more chunks buffering, + * or not enough bytes are buffered to parse. */ - next () { - this.skipWhitespace() - switch (this.currentMode()) { - case 'value': - this.modeStack.pop() - return this.parseValue() - case 'array-value': { - this.modeStack.pop() - if (this.ch() === 93) { // ']' - this._pos++ - this.skipWhitespace() - return new token_Token(token_Type["break"], undefined, 1) - } - if (this.ch() !== 44) { // ',' - throw new Error(`${decodeErrPrefix} unexpected character at position ${this._pos}, was expecting array delimiter but found '${String.fromCharCode(this.ch())}'`) - } - this._pos++ - this.modeStack.push('array-value') - this.skipWhitespace() - return this.parseValue() - } - case 'array-start': { - this.modeStack.pop() - if (this.ch() === 93) { // ']' - this._pos++ - this.skipWhitespace() - return new token_Token(token_Type["break"], undefined, 1) - } - this.modeStack.push('array-value') - this.skipWhitespace() - return this.parseValue() - } - // @ts-ignore - case 'obj-key': - if (this.ch() === 125) { // '}' - this.modeStack.pop() - this._pos++ - this.skipWhitespace() - return new token_Token(token_Type["break"], undefined, 1) - } - if (this.ch() !== 44) { // ',' - throw new Error(`${decodeErrPrefix} unexpected character at position ${this._pos}, was expecting object delimiter but found '${String.fromCharCode(this.ch())}'`) + run (callback) { + while (true) { + if (this.#state === parserStates.INFO) { + // If there aren't enough bytes to parse the payload length, etc. + if (this.#byteOffset < 2) { + return callback() } - this._pos++ - this.skipWhitespace() - case 'obj-start': { // eslint-disable-line no-fallthrough - this.modeStack.pop() - if (this.ch() === 125) { // '}' - this._pos++ - this.skipWhitespace() - return new token_Token(token_Type["break"], undefined, 1) + + const buffer = this.consume(2) + + this.#info.fin = (buffer[0] & 0x80) !== 0 + this.#info.opcode = buffer[0] & 0x0F + + // If we receive a fragmented message, we use the type of the first + // frame to parse the full message as binary/text, when it's terminated + this.#info.originalOpcode ??= this.#info.opcode + + this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION + + if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) { + // Only text and binary frames can be fragmented + failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.') + return } - const token = this.parseString() - this.skipWhitespace() - if (this.ch() !== 58) { // ':' - throw new Error(`${decodeErrPrefix} unexpected character at position ${this._pos}, was expecting key/value delimiter ':' but found '${String.fromCharCode(this.ch())}'`) + + const payloadLength = buffer[1] & 0x7F + + if (payloadLength <= 125) { + this.#info.payloadLength = payloadLength + this.#state = parserStates.READ_DATA + } else if (payloadLength === 126) { + this.#state = parserStates.PAYLOADLENGTH_16 + } else if (payloadLength === 127) { + this.#state = parserStates.PAYLOADLENGTH_64 } - this._pos++ - this.modeStack.push('obj-value') - return token - } - case 'obj-value': { - this.modeStack.pop() - this.modeStack.push('obj-key') - this.skipWhitespace() - return this.parseValue() - } - /* c8 ignore next 2 */ - default: - throw new Error(`${decodeErrPrefix} unexpected parse state at position ${this._pos}; this shouldn't happen`) - } - } -} -/** - * @param {Uint8Array} data - * @param {DecodeOptions} [options] - * @returns {any} - */ -function json_decode_decode (data, options) { - options = Object.assign({ tokenizer: new Tokenizer(data, options) }, options) - return decode_decode(data, options) -} + if (this.#info.fragmented && payloadLength > 125) { + // A fragmented frame can't be fragmented itself + failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.') + return + } else if ( + (this.#info.opcode === opcodes.PING || + this.#info.opcode === opcodes.PONG || + this.#info.opcode === opcodes.CLOSE) && + payloadLength > 125 + ) { + // Control frames can have a payload length of 125 bytes MAX + failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.') + return + } else if (this.#info.opcode === opcodes.CLOSE) { + if (payloadLength === 1) { + failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.') + return + } -/** - * @param {Uint8Array} data - * @param {DecodeOptions} [options] - * @returns {[any, Uint8Array]} - */ -function decode_decodeFirst (data, options) { - options = Object.assign({ tokenizer: new Tokenizer(data, options) }, options) - return _decodeFirst(data, options) -} + const body = this.consume(payloadLength) + this.#info.closeInfo = this.parseCloseBody(false, body) + if (!this.ws[kSentClose]) { + // If an endpoint receives a Close frame and did not previously send a + // Close frame, the endpoint MUST send a Close frame in response. (When + // sending a Close frame in response, the endpoint typically echos the + // status code it received.) + const body = Buffer.allocUnsafe(2) + body.writeUInt16BE(this.#info.closeInfo.code, 0) + const closeFrame = new WebsocketFrameSend(body) -;// CONCATENATED MODULE: ./node_modules/cborg/lib/json/json.js + this.ws[kResponse].socket.write( + closeFrame.createFrame(opcodes.CLOSE), + (err) => { + if (!err) { + this.ws[kSentClose] = true + } + } + ) + } + // Upon either sending or receiving a Close control frame, it is said + // that _The WebSocket Closing Handshake is Started_ and that the + // WebSocket connection is in the CLOSING state. + this.ws[kReadyState] = states.CLOSING + this.ws[kReceivedClose] = true + this.end() + return + } else if (this.#info.opcode === opcodes.PING) { + // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in + // response, unless it already received a Close frame. + // A Pong frame sent in response to a Ping frame must have identical + // "Application data" + const body = this.consume(payloadLength) -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/bytes.js -const src_bytes_empty = new Uint8Array(0); -function src_bytes_toHex(d) { - return d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), ''); -} -function src_bytes_fromHex(hex) { - const hexes = hex.match(/../g); - return hexes != null ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : src_bytes_empty; -} -function src_bytes_equals(aa, bb) { - if (aa === bb) - return true; - if (aa.byteLength !== bb.byteLength) { - return false; - } - for (let ii = 0; ii < aa.byteLength; ii++) { - if (aa[ii] !== bb[ii]) { - return false; - } - } - return true; -} -function dist_src_bytes_coerce(o) { - if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') - return o; - if (o instanceof ArrayBuffer) - return new Uint8Array(o); - if (ArrayBuffer.isView(o)) { - return new Uint8Array(o.buffer, o.byteOffset, o.byteLength); - } - throw new Error('Unknown type, must be binary type'); -} -function src_bytes_isBinary(o) { - return o instanceof ArrayBuffer || ArrayBuffer.isView(o); -} -function src_bytes_fromString(str) { - return new TextEncoder().encode(str); -} -function dist_src_bytes_toString(b) { - return new TextDecoder().decode(b); -} -//# sourceMappingURL=bytes.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/vendor/base-x.js -/* eslint-disable */ -// base-x encoding / decoding -// Copyright (c) 2018 base-x contributors -// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) -// Distributed under the MIT software license, see the accompanying -// file LICENSE or http://www.opensource.org/licenses/mit-license.php. -/** - * @param {string} ALPHABET - * @param {any} name - */ -function vendor_base_x_base(ALPHABET, name) { - if (ALPHABET.length >= 255) { - throw new TypeError('Alphabet too long'); - } - var BASE_MAP = new Uint8Array(256); - for (var j = 0; j < BASE_MAP.length; j++) { - BASE_MAP[j] = 255; - } - for (var i = 0; i < ALPHABET.length; i++) { - var x = ALPHABET.charAt(i); - var xc = x.charCodeAt(0); - if (BASE_MAP[xc] !== 255) { - throw new TypeError(x + ' is ambiguous'); - } - BASE_MAP[xc] = i; - } - var BASE = ALPHABET.length; - var LEADER = ALPHABET.charAt(0); - var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up - var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up - /** - * @param {any[] | Iterable} source - */ - function encode(source) { - // @ts-ignore - if (source instanceof Uint8Array) - ; - else if (ArrayBuffer.isView(source)) { - source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); - } - else if (Array.isArray(source)) { - source = Uint8Array.from(source); - } - if (!(source instanceof Uint8Array)) { - throw new TypeError('Expected Uint8Array'); - } - if (source.length === 0) { - return ''; - } - // Skip & count leading zeroes. - var zeroes = 0; - var length = 0; - var pbegin = 0; - var pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; - } - // Allocate enough space in big-endian base58 representation. - var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; - var b58 = new Uint8Array(size); - // Process the bytes. - while (pbegin !== pend) { - var carry = source[pbegin]; - // Apply "b58 = b58 * 256 + ch". - var i = 0; - for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { - carry += (256 * b58[it1]) >>> 0; - b58[it1] = (carry % BASE) >>> 0; - carry = (carry / BASE) >>> 0; - } - if (carry !== 0) { - throw new Error('Non-zero carry'); - } - length = i; - pbegin++; - } - // Skip leading zeroes in base58 result. - var it2 = size - length; - while (it2 !== size && b58[it2] === 0) { - it2++; - } - // Translate the result into a string. - var str = LEADER.repeat(zeroes); - for (; it2 < size; ++it2) { - str += ALPHABET.charAt(b58[it2]); - } - return str; - } - /** - * @param {string | string[]} source - */ - function decodeUnsafe(source) { - if (typeof source !== 'string') { - throw new TypeError('Expected String'); - } - if (source.length === 0) { - return new Uint8Array(); - } - var psz = 0; - // Skip leading spaces. - if (source[psz] === ' ') { - return; - } - // Skip and count leading '1's. - var zeroes = 0; - var length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; - } - // Allocate enough space in big-endian base256 representation. - var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. - var b256 = new Uint8Array(size); - // Process the characters. - while (source[psz]) { - // Decode character - var carry = BASE_MAP[source.charCodeAt(psz)]; - // Invalid character - if (carry === 255) { - return; - } - var i = 0; - for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { - carry += (BASE * b256[it3]) >>> 0; - b256[it3] = (carry % 256) >>> 0; - carry = (carry / 256) >>> 0; - } - if (carry !== 0) { - throw new Error('Non-zero carry'); + if (!this.ws[kReceivedClose]) { + const frame = new WebsocketFrameSend(body) + + this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG)) + + if (channels.ping.hasSubscribers) { + channels.ping.publish({ + payload: body + }) } - length = i; - psz++; - } - // Skip trailing spaces. - if (source[psz] === ' ') { - return; - } - // Skip leading zeroes in b256. - var it4 = size - length; - while (it4 !== size && b256[it4] === 0) { - it4++; - } - var vch = new Uint8Array(zeroes + (size - it4)); - var j = zeroes; - while (it4 !== size) { - vch[j++] = b256[it4++]; - } - return vch; - } - /** - * @param {string | string[]} string - */ - function decode(string) { - var buffer = decodeUnsafe(string); - if (buffer) { - return buffer; - } - throw new Error(`Non-${name} character`); - } - return { - encode: encode, - decodeUnsafe: decodeUnsafe, - decode: decode - }; -} -var vendor_base_x_src = vendor_base_x_base; -var vendor_base_x_brrp_multiformats_scope_baseX = vendor_base_x_src; -/* harmony default export */ const src_vendor_base_x = (vendor_base_x_brrp_multiformats_scope_baseX); -//# sourceMappingURL=base-x.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/bases/base.js + } + this.#state = parserStates.INFO -/** - * Class represents both BaseEncoder and MultibaseEncoder meaning it - * can be used to encode to multibase or base encode without multibase - * prefix. - */ -class bases_base_Encoder { - name; - prefix; - baseEncode; - constructor(name, prefix, baseEncode) { - this.name = name; - this.prefix = prefix; - this.baseEncode = baseEncode; - } - encode(bytes) { - if (bytes instanceof Uint8Array) { - return `${this.prefix}${this.baseEncode(bytes)}`; - } - else { - throw Error('Unknown type, must be binary type'); - } - } -} -/** - * Class represents both BaseDecoder and MultibaseDecoder so it could be used - * to decode multibases (with matching prefix) or just base decode strings - * with corresponding base encoding. - */ -class bases_base_Decoder { - name; - prefix; - baseDecode; - prefixCodePoint; - constructor(name, prefix, baseDecode) { - this.name = name; - this.prefix = prefix; - /* c8 ignore next 3 */ - if (prefix.codePointAt(0) === undefined) { - throw new Error('Invalid prefix character'); + if (this.#byteOffset > 0) { + continue + } else { + callback() + return + } + } else if (this.#info.opcode === opcodes.PONG) { + // A Pong frame MAY be sent unsolicited. This serves as a + // unidirectional heartbeat. A response to an unsolicited Pong frame is + // not expected. + + const body = this.consume(payloadLength) + + if (channels.pong.hasSubscribers) { + channels.pong.publish({ + payload: body + }) + } + + if (this.#byteOffset > 0) { + continue + } else { + callback() + return + } } - this.prefixCodePoint = prefix.codePointAt(0); - this.baseDecode = baseDecode; - } - decode(text) { - if (typeof text === 'string') { - if (text.codePointAt(0) !== this.prefixCodePoint) { - throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); - } - return this.baseDecode(text.slice(this.prefix.length)); + } else if (this.#state === parserStates.PAYLOADLENGTH_16) { + if (this.#byteOffset < 2) { + return callback() } - else { - throw Error('Can only multibase decode strings'); + + const buffer = this.consume(2) + + this.#info.payloadLength = buffer.readUInt16BE(0) + this.#state = parserStates.READ_DATA + } else if (this.#state === parserStates.PAYLOADLENGTH_64) { + if (this.#byteOffset < 8) { + return callback() } - } - or(decoder) { - return bases_base_or(this, decoder); - } -} -class bases_base_ComposedDecoder { - decoders; - constructor(decoders) { - this.decoders = decoders; - } - or(decoder) { - return bases_base_or(this, decoder); - } - decode(input) { - const prefix = input[0]; - const decoder = this.decoders[prefix]; - if (decoder != null) { - return decoder.decode(input); + + const buffer = this.consume(8) + const upper = buffer.readUInt32BE(0) + + // 2^31 is the maxinimum bytes an arraybuffer can contain + // on 32-bit systems. Although, on 64-bit systems, this is + // 2^53-1 bytes. + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length + // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275 + // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e + if (upper > 2 ** 31 - 1) { + failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.') + return } - else { - throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); + + const lower = buffer.readUInt32BE(4) + + this.#info.payloadLength = (upper << 8) + lower + this.#state = parserStates.READ_DATA + } else if (this.#state === parserStates.READ_DATA) { + if (this.#byteOffset < this.#info.payloadLength) { + // If there is still more data in this chunk that needs to be read + return callback() + } else if (this.#byteOffset >= this.#info.payloadLength) { + // If the server sent multiple frames in a single chunk + + const body = this.consume(this.#info.payloadLength) + + this.#fragments.push(body) + + // If the frame is unfragmented, or a fragmented frame was terminated, + // a message was received + if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) { + const fullMessage = Buffer.concat(this.#fragments) + + websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage) + + this.#info = {} + this.#fragments.length = 0 + } + + this.#state = parserStates.INFO } + } + + if (this.#byteOffset > 0) { + continue + } else { + callback() + break + } } -} -function bases_base_or(left, right) { - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - return new bases_base_ComposedDecoder({ - ...(left.decoders ?? { [left.prefix]: left }), - ...(right.decoders ?? { [right.prefix]: right }) - }); -} -class bases_base_Codec { - name; - prefix; - baseEncode; - baseDecode; - encoder; - decoder; - constructor(name, prefix, baseEncode, baseDecode) { - this.name = name; - this.prefix = prefix; - this.baseEncode = baseEncode; - this.baseDecode = baseDecode; - this.encoder = new bases_base_Encoder(name, prefix, baseEncode); - this.decoder = new bases_base_Decoder(name, prefix, baseDecode); - } - encode(input) { - return this.encoder.encode(input); - } - decode(input) { - return this.decoder.decode(input); - } -} -function bases_base_from({ name, prefix, encode, decode }) { - return new bases_base_Codec(name, prefix, encode, decode); -} -function bases_base_baseX({ name, prefix, alphabet }) { - const { encode, decode } = src_vendor_base_x(alphabet, name); - return bases_base_from({ - prefix, - name, - encode, - decode: (text) => dist_src_bytes_coerce(decode(text)) - }); -} -function bases_base_decode(string, alphabet, bitsPerChar, name) { - // Build the character lookup table: - const codes = {}; - for (let i = 0; i < alphabet.length; ++i) { - codes[alphabet[i]] = i; - } - // Count the padding bytes: - let end = string.length; - while (string[end - 1] === '=') { - --end; - } - // Allocate the output: - const out = new Uint8Array((end * bitsPerChar / 8) | 0); - // Parse the data: - let bits = 0; // Number of bits currently in the buffer - let buffer = 0; // Bits waiting to be written out, MSB first - let written = 0; // Next byte to write - for (let i = 0; i < end; ++i) { - // Read one character from the string: - const value = codes[string[i]]; - if (value === undefined) { - throw new SyntaxError(`Non-${name} character`); - } - // Append the bits to the buffer: - buffer = (buffer << bitsPerChar) | value; - bits += bitsPerChar; - // Write out some bits if the buffer has a byte's worth: - if (bits >= 8) { - bits -= 8; - out[written++] = 0xff & (buffer >> bits); - } + } + + /** + * Take n bytes from the buffered Buffers + * @param {number} n + * @returns {Buffer|null} + */ + consume (n) { + if (n > this.#byteOffset) { + return null + } else if (n === 0) { + return emptyBuffer } - // Verify that we have received just enough bits: - if (bits >= bitsPerChar || (0xff & (buffer << (8 - bits))) !== 0) { - throw new SyntaxError('Unexpected end of data'); + + if (this.#buffers[0].length === n) { + this.#byteOffset -= this.#buffers[0].length + return this.#buffers.shift() } - return out; -} -function bases_base_encode(data, alphabet, bitsPerChar) { - const pad = alphabet[alphabet.length - 1] === '='; - const mask = (1 << bitsPerChar) - 1; - let out = ''; - let bits = 0; // Number of bits currently in the buffer - let buffer = 0; // Bits waiting to be written out, MSB first - for (let i = 0; i < data.length; ++i) { - // Slurp data into the buffer: - buffer = (buffer << 8) | data[i]; - bits += 8; - // Write out as much as we can: - while (bits > bitsPerChar) { - bits -= bitsPerChar; - out += alphabet[mask & (buffer >> bits)]; - } + + const buffer = Buffer.allocUnsafe(n) + let offset = 0 + + while (offset !== n) { + const next = this.#buffers[0] + const { length } = next + + if (length + offset === n) { + buffer.set(this.#buffers.shift(), offset) + break + } else if (length + offset > n) { + buffer.set(next.subarray(0, n - offset), offset) + this.#buffers[0] = next.subarray(n - offset) + break + } else { + buffer.set(this.#buffers.shift(), offset) + offset += next.length + } } - // Partial character: - if (bits !== 0) { - out += alphabet[mask & (buffer << (bitsPerChar - bits))]; + + this.#byteOffset -= n + + return buffer + } + + parseCloseBody (onlyCode, data) { + // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5 + /** @type {number|undefined} */ + let code + + if (data.length >= 2) { + // _The WebSocket Connection Close Code_ is + // defined as the status code (Section 7.4) contained in the first Close + // control frame received by the application + code = data.readUInt16BE(0) } - // Add padding characters until we hit a byte boundary: - if (pad) { - while (((out.length * bitsPerChar) & 7) !== 0) { - out += '='; - } + + if (onlyCode) { + if (!isValidStatusCode(code)) { + return null + } + + return { code } } - return out; -} -/** - * RFC4648 Factory - */ -function bases_base_rfc4648({ name, prefix, bitsPerChar, alphabet }) { - return bases_base_from({ - prefix, - name, - encode(input) { - return bases_base_encode(input, alphabet, bitsPerChar); - }, - decode(input) { - return bases_base_decode(input, alphabet, bitsPerChar, name); - } - }); -} -//# sourceMappingURL=base.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/bases/base32.js -const src_bases_base32_base32 = bases_base_rfc4648({ - prefix: 'b', - name: 'base32', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567', - bitsPerChar: 5 -}); -const src_bases_base32_base32upper = bases_base_rfc4648({ - prefix: 'B', - name: 'base32upper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', - bitsPerChar: 5 -}); -const bases_base32_base32pad = bases_base_rfc4648({ - prefix: 'c', - name: 'base32pad', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', - bitsPerChar: 5 -}); -const bases_base32_base32padupper = bases_base_rfc4648({ - prefix: 'C', - name: 'base32padupper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', - bitsPerChar: 5 -}); -const bases_base32_base32hex = bases_base_rfc4648({ - prefix: 'v', - name: 'base32hex', - alphabet: '0123456789abcdefghijklmnopqrstuv', - bitsPerChar: 5 -}); -const bases_base32_base32hexupper = bases_base_rfc4648({ - prefix: 'V', - name: 'base32hexupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', - bitsPerChar: 5 -}); -const bases_base32_base32hexpad = bases_base_rfc4648({ - prefix: 't', - name: 'base32hexpad', - alphabet: '0123456789abcdefghijklmnopqrstuv=', - bitsPerChar: 5 -}); -const bases_base32_base32hexpadupper = bases_base_rfc4648({ - prefix: 'T', - name: 'base32hexpadupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', - bitsPerChar: 5 -}); -const bases_base32_base32z = bases_base_rfc4648({ - prefix: 'h', - name: 'base32z', - alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', - bitsPerChar: 5 -}); -//# sourceMappingURL=base32.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/bases/base58.js + // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6 + /** @type {Buffer} */ + let reason = data.subarray(2) -const src_bases_base58_base58btc = bases_base_baseX({ - name: 'base58btc', - prefix: 'z', - alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -}); -const bases_base58_base58flickr = bases_base_baseX({ - name: 'base58flickr', - prefix: 'Z', - alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -}); -//# sourceMappingURL=base58.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/vendor/varint.js -/* eslint-disable */ -var vendor_varint_encode_1 = src_vendor_varint_encode; -var vendor_varint_MSB = 0x80, vendor_varint_REST = 0x7F, vendor_varint_MSBALL = ~vendor_varint_REST, vendor_varint_INT = Math.pow(2, 31); -/** - * @param {number} num - * @param {number[]} out - * @param {number} offset - */ -function src_vendor_varint_encode(num, out, offset) { - out = out || []; - offset = offset || 0; - var oldOffset = offset; - while (num >= vendor_varint_INT) { - out[offset++] = (num & 0xFF) | vendor_varint_MSB; - num /= 128; + // Remove BOM + if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) { + reason = reason.subarray(3) } - while (num & vendor_varint_MSBALL) { - out[offset++] = (num & 0xFF) | vendor_varint_MSB; - num >>>= 7; + + if (code !== undefined && !isValidStatusCode(code)) { + return null } - out[offset] = num | 0; - // @ts-ignore - src_vendor_varint_encode.bytes = offset - oldOffset + 1; - return out; -} -var src_vendor_varint_decode = vendor_varint_read; -var vendor_varint_MSB$1 = 0x80, vendor_varint_REST$1 = 0x7F; -/** - * @param {string | any[]} buf - * @param {number} offset - */ -function vendor_varint_read(buf, offset) { - var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length; - do { - if (counter >= l) { - // @ts-ignore - vendor_varint_read.bytes = 0; - throw new RangeError('Could not decode varint'); - } - b = buf[counter++]; - res += shift < 28 - ? (b & vendor_varint_REST$1) << shift - : (b & vendor_varint_REST$1) * Math.pow(2, shift); - shift += 7; - } while (b >= vendor_varint_MSB$1); - // @ts-ignore - vendor_varint_read.bytes = counter - offset; - return res; + + try { + // TODO: optimize this + reason = new TextDecoder('utf-8', { fatal: true }).decode(reason) + } catch { + return null + } + + return { code, reason } + } + + get closingInfo () { + return this.#info.closeInfo + } } -var vendor_varint_N1 = Math.pow(2, 7); -var vendor_varint_N2 = Math.pow(2, 14); -var vendor_varint_N3 = Math.pow(2, 21); -var vendor_varint_N4 = Math.pow(2, 28); -var vendor_varint_N5 = Math.pow(2, 35); -var vendor_varint_N6 = Math.pow(2, 42); -var vendor_varint_N7 = Math.pow(2, 49); -var vendor_varint_N8 = Math.pow(2, 56); -var vendor_varint_N9 = Math.pow(2, 63); -var src_vendor_varint_length = function (/** @type {number} */ value) { - return (value < vendor_varint_N1 ? 1 - : value < vendor_varint_N2 ? 2 - : value < vendor_varint_N3 ? 3 - : value < vendor_varint_N4 ? 4 - : value < vendor_varint_N5 ? 5 - : value < vendor_varint_N6 ? 6 - : value < vendor_varint_N7 ? 7 - : value < vendor_varint_N8 ? 8 - : value < vendor_varint_N9 ? 9 - : 10); -}; -var src_vendor_varint_varint = { - encode: vendor_varint_encode_1, - decode: src_vendor_varint_decode, - encodingLength: src_vendor_varint_length -}; -var vendor_varint_brrp_varint = src_vendor_varint_varint; -/* harmony default export */ const dist_src_vendor_varint = (vendor_varint_brrp_varint); -//# sourceMappingURL=varint.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/varint.js -function multiformats_dist_src_varint_decode(data, offset = 0) { - const code = dist_src_vendor_varint.decode(data, offset); - return [code, dist_src_vendor_varint.decode.bytes]; +module.exports = { + ByteParser } -function src_varint_encodeTo(int, target, offset = 0) { - dist_src_vendor_varint.encode(int, target, offset); - return target; + + +/***/ }), + +/***/ 42700: +/***/ ((module) => { + + + +module.exports = { + kWebSocketURL: Symbol('url'), + kReadyState: Symbol('ready state'), + kController: Symbol('controller'), + kResponse: Symbol('response'), + kBinaryType: Symbol('binary type'), + kSentClose: Symbol('sent close'), + kReceivedClose: Symbol('received close'), + kByteParser: Symbol('byte parser') } -function src_varint_encodingLength(int) { - return dist_src_vendor_varint.encodingLength(int); + + +/***/ }), + +/***/ 93694: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(42700) +const { states, opcodes } = __nccwpck_require__(29832) +const { MessageEvent, ErrorEvent } = __nccwpck_require__(38173) + +/* globals Blob */ + +/** + * @param {import('./websocket').WebSocket} ws + */ +function isEstablished (ws) { + // If the server's response is validated as provided for above, it is + // said that _The WebSocket Connection is Established_ and that the + // WebSocket Connection is in the OPEN state. + return ws[kReadyState] === states.OPEN } -//# sourceMappingURL=varint.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/hashes/digest.js +/** + * @param {import('./websocket').WebSocket} ws + */ +function isClosing (ws) { + // Upon either sending or receiving a Close control frame, it is said + // that _The WebSocket Closing Handshake is Started_ and that the + // WebSocket connection is in the CLOSING state. + return ws[kReadyState] === states.CLOSING +} /** - * Creates a multihash digest. + * @param {import('./websocket').WebSocket} ws */ -function src_hashes_digest_create(code, digest) { - const size = digest.byteLength; - const sizeOffset = src_varint_encodingLength(code); - const digestOffset = sizeOffset + src_varint_encodingLength(size); - const bytes = new Uint8Array(digestOffset + size); - src_varint_encodeTo(code, bytes, 0); - src_varint_encodeTo(size, bytes, sizeOffset); - bytes.set(digest, digestOffset); - return new src_hashes_digest_Digest(code, size, digest, bytes); +function isClosed (ws) { + return ws[kReadyState] === states.CLOSED } + /** - * Turns bytes representation of multihash digest into an instance. + * @see https://dom.spec.whatwg.org/#concept-event-fire + * @param {string} e + * @param {EventTarget} target + * @param {EventInit | undefined} eventInitDict */ -function src_hashes_digest_decode(multihash) { - const bytes = dist_src_bytes_coerce(multihash); - const [code, sizeOffset] = multiformats_dist_src_varint_decode(bytes); - const [size, digestOffset] = multiformats_dist_src_varint_decode(bytes.subarray(sizeOffset)); - const digest = bytes.subarray(sizeOffset + digestOffset); - if (digest.byteLength !== size) { - throw new Error('Incorrect length'); - } - return new src_hashes_digest_Digest(code, size, digest, bytes); +function fireEvent (e, target, eventConstructor = Event, eventInitDict) { + // 1. If eventConstructor is not given, then let eventConstructor be Event. + + // 2. Let event be the result of creating an event given eventConstructor, + // in the relevant realm of target. + // 3. Initialize event’s type attribute to e. + const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap + + // 4. Initialize any other IDL attributes of event as described in the + // invocation of this algorithm. + + // 5. Return the result of dispatching event at target, with legacy target + // override flag set if set. + target.dispatchEvent(event) } -function src_hashes_digest_equals(a, b) { - if (a === b) { - return true; + +/** + * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol + * @param {import('./websocket').WebSocket} ws + * @param {number} type Opcode + * @param {Buffer} data application data + */ +function websocketMessageReceived (ws, type, data) { + // 1. If ready state is not OPEN (1), then return. + if (ws[kReadyState] !== states.OPEN) { + return + } + + // 2. Let dataForEvent be determined by switching on type and binary type: + let dataForEvent + + if (type === opcodes.TEXT) { + // -> type indicates that the data is Text + // a new DOMString containing data + try { + dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data) + } catch { + failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.') + return } - else { - const data = b; - return (a.code === data.code && - a.size === data.size && - data.bytes instanceof Uint8Array && - src_bytes_equals(a.bytes, data.bytes)); + } else if (type === opcodes.BINARY) { + if (ws[kBinaryType] === 'blob') { + // -> type indicates that the data is Binary and binary type is "blob" + // a new Blob object, created in the relevant Realm of the WebSocket + // object, that represents data as its raw data + dataForEvent = new Blob([data]) + } else { + // -> type indicates that the data is Binary and binary type is "arraybuffer" + // a new ArrayBuffer object, created in the relevant Realm of the + // WebSocket object, whose contents are data + dataForEvent = new Uint8Array(data).buffer } + } + + // 3. Fire an event named message at the WebSocket object, using MessageEvent, + // with the origin attribute initialized to the serialization of the WebSocket + // object’s url's origin, and the data attribute initialized to dataForEvent. + fireEvent('message', ws, MessageEvent, { + origin: ws[kWebSocketURL].origin, + data: dataForEvent + }) } + /** - * Represents a multihash digest which carries information about the - * hashing algorithm and an actual hash digest. + * @see https://datatracker.ietf.org/doc/html/rfc6455 + * @see https://datatracker.ietf.org/doc/html/rfc2616 + * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407 + * @param {string} protocol */ -class src_hashes_digest_Digest { - code; - size; - digest; - bytes; - /** - * Creates a multihash digest. - */ - constructor(code, size, digest, bytes) { - this.code = code; - this.size = size; - this.digest = digest; - this.bytes = bytes; +function isValidSubprotocol (protocol) { + // If present, this value indicates one + // or more comma-separated subprotocol the client wishes to speak, + // ordered by preference. The elements that comprise this value + // MUST be non-empty strings with characters in the range U+0021 to + // U+007E not including separator characters as defined in + // [RFC2616] and MUST all be unique strings. + if (protocol.length === 0) { + return false + } + + for (const char of protocol) { + const code = char.charCodeAt(0) + + if ( + code < 0x21 || + code > 0x7E || + char === '(' || + char === ')' || + char === '<' || + char === '>' || + char === '@' || + char === ',' || + char === ';' || + char === ':' || + char === '\\' || + char === '"' || + char === '/' || + char === '[' || + char === ']' || + char === '?' || + char === '=' || + char === '{' || + char === '}' || + code === 32 || // SP + code === 9 // HT + ) { + return false } + } + + return true } -//# sourceMappingURL=digest.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/cid.js +/** + * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4 + * @param {number} code + */ +function isValidStatusCode (code) { + if (code >= 1000 && code < 1015) { + return ( + code !== 1004 && // reserved + code !== 1005 && // "MUST NOT be set as a status code" + code !== 1006 // "MUST NOT be set as a status code" + ) + } + return code >= 3000 && code <= 4999 +} +/** + * @param {import('./websocket').WebSocket} ws + * @param {string|undefined} reason + */ +function failWebsocketConnection (ws, reason) { + const { [kController]: controller, [kResponse]: response } = ws + controller.abort() -// This way TS will also expose all the types from module + if (response?.socket && !response.socket.destroyed) { + response.socket.destroy() + } -function src_cid_format(link, base) { - const { bytes, version } = link; - switch (version) { - case 0: - return src_cid_toStringV0(bytes, src_cid_baseCache(link), base ?? src_bases_base58_base58btc.encoder); - default: - return src_cid_toStringV1(bytes, src_cid_baseCache(link), (base ?? src_bases_base32_base32.encoder)); - } -} -function src_cid_toJSON(link) { - return { - '/': src_cid_format(link) - }; -} -function src_cid_fromJSON(json) { - return dist_src_cid_CID.parse(json['/']); + if (reason) { + fireEvent('error', ws, ErrorEvent, { + error: new Error(reason) + }) + } } -const src_cid_cache = new WeakMap(); -function src_cid_baseCache(cid) { - const baseCache = src_cid_cache.get(cid); - if (baseCache == null) { - const baseCache = new Map(); - src_cid_cache.set(cid, baseCache); - return baseCache; - } - return baseCache; + +module.exports = { + isEstablished, + isClosing, + isClosed, + fireEvent, + isValidSubprotocol, + isValidStatusCode, + failWebsocketConnection, + websocketMessageReceived } -class dist_src_cid_CID { - code; - version; - multihash; - bytes; - '/'; - /** - * @param version - Version of the CID - * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param multihash - (Multi)hash of the of the content. - */ - constructor(version, code, multihash, bytes) { - this.code = code; - this.version = version; - this.multihash = multihash; - this.bytes = bytes; - // flag to serializers that this is a CID and - // should be treated specially - this['/'] = bytes; + + +/***/ }), + +/***/ 59724: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const { webidl } = __nccwpck_require__(7000) +const { DOMException } = __nccwpck_require__(20075) +const { URLSerializer } = __nccwpck_require__(16306) +const { getGlobalOrigin } = __nccwpck_require__(48582) +const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(29832) +const { + kWebSocketURL, + kReadyState, + kController, + kBinaryType, + kResponse, + kSentClose, + kByteParser +} = __nccwpck_require__(42700) +const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(93694) +const { establishWebSocketConnection } = __nccwpck_require__(24100) +const { WebsocketFrameSend } = __nccwpck_require__(47206) +const { ByteParser } = __nccwpck_require__(61746) +const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(43061) +const { getGlobalDispatcher } = __nccwpck_require__(94330) +const { types } = __nccwpck_require__(73837) + +let experimentalWarned = false + +// https://websockets.spec.whatwg.org/#interface-definition +class WebSocket extends EventTarget { + #events = { + open: null, + error: null, + close: null, + message: null + } + + #bufferedAmount = 0 + #protocol = '' + #extensions = '' + + /** + * @param {string} url + * @param {string|string[]} protocols + */ + constructor (url, protocols = []) { + super() + + webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' }) + + if (!experimentalWarned) { + experimentalWarned = true + process.emitWarning('WebSockets are experimental, expect them to change at any time.', { + code: 'UNDICI-WS' + }) } - /** - * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` - * please either use `CID.asCID(cid)` or switch to new signalling mechanism - * - * @deprecated - */ - get asCID() { - return this; + + const options = webidl.converters['DOMString or sequence or WebSocketInit'](protocols) + + url = webidl.converters.USVString(url) + protocols = options.protocols + + // 1. Let baseURL be this's relevant settings object's API base URL. + const baseURL = getGlobalOrigin() + + // 1. Let urlRecord be the result of applying the URL parser to url with baseURL. + let urlRecord + + try { + urlRecord = new URL(url, baseURL) + } catch (e) { + // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException. + throw new DOMException(e, 'SyntaxError') } - // ArrayBufferView - get byteOffset() { - return this.bytes.byteOffset; + + // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws". + if (urlRecord.protocol === 'http:') { + urlRecord.protocol = 'ws:' + } else if (urlRecord.protocol === 'https:') { + // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss". + urlRecord.protocol = 'wss:' } - // ArrayBufferView - get byteLength() { - return this.bytes.byteLength; + + // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException. + if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') { + throw new DOMException( + `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`, + 'SyntaxError' + ) } - toV0() { - switch (this.version) { - case 0: { - return this; - } - case 1: { - const { code, multihash } = this; - if (code !== src_cid_DAG_PB_CODE) { - throw new Error('Cannot convert a non dag-pb CID to CIDv0'); - } - // sha2-256 - if (multihash.code !== src_cid_SHA_256_CODE) { - throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0'); - } - return (dist_src_cid_CID.createV0(multihash)); - } - default: { - throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`); - } - } + + // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError" + // DOMException. + if (urlRecord.hash || urlRecord.href.endsWith('#')) { + throw new DOMException('Got fragment', 'SyntaxError') } - toV1() { - switch (this.version) { - case 0: { - const { code, digest } = this.multihash; - const multihash = src_hashes_digest_create(code, digest); - return (dist_src_cid_CID.createV1(this.code, multihash)); - } - case 1: { - return this; - } - default: { - throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`); - } - } + + // 8. If protocols is a string, set protocols to a sequence consisting + // of just that string. + if (typeof protocols === 'string') { + protocols = [protocols] } - equals(other) { - return dist_src_cid_CID.equals(this, other); + + // 9. If any of the values in protocols occur more than once or otherwise + // fail to match the requirements for elements that comprise the value + // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket + // protocol, then throw a "SyntaxError" DOMException. + if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) { + throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError') } - static equals(self, other) { - const unknown = other; - return (unknown != null && - self.code === unknown.code && - self.version === unknown.version && - src_hashes_digest_equals(self.multihash, unknown.multihash)); + + if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) { + throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError') } - toString(base) { - return src_cid_format(this, base); + + // 10. Set this's url to urlRecord. + this[kWebSocketURL] = new URL(urlRecord.href) + + // 11. Let client be this's relevant settings object. + + // 12. Run this step in parallel: + + // 1. Establish a WebSocket connection given urlRecord, protocols, + // and client. + this[kController] = establishWebSocketConnection( + urlRecord, + protocols, + this, + (response) => this.#onConnectionEstablished(response), + options + ) + + // Each WebSocket object has an associated ready state, which is a + // number representing the state of the connection. Initially it must + // be CONNECTING (0). + this[kReadyState] = WebSocket.CONNECTING + + // The extensions attribute must initially return the empty string. + + // The protocol attribute must initially return the empty string. + + // Each WebSocket object has an associated binary type, which is a + // BinaryType. Initially it must be "blob". + this[kBinaryType] = 'blob' + } + + /** + * @see https://websockets.spec.whatwg.org/#dom-websocket-close + * @param {number|undefined} code + * @param {string|undefined} reason + */ + close (code = undefined, reason = undefined) { + webidl.brandCheck(this, WebSocket) + + if (code !== undefined) { + code = webidl.converters['unsigned short'](code, { clamp: true }) } - toJSON() { - return { '/': src_cid_format(this) }; + + if (reason !== undefined) { + reason = webidl.converters.USVString(reason) } - link() { - return this; + + // 1. If code is present, but is neither an integer equal to 1000 nor an + // integer in the range 3000 to 4999, inclusive, throw an + // "InvalidAccessError" DOMException. + if (code !== undefined) { + if (code !== 1000 && (code < 3000 || code > 4999)) { + throw new DOMException('invalid code', 'InvalidAccessError') + } } - [Symbol.toStringTag] = 'CID'; - // Legacy - [Symbol.for('nodejs.util.inspect.custom')]() { - return `CID(${this.toString()})`; + + let reasonByteLength = 0 + + // 2. If reason is present, then run these substeps: + if (reason !== undefined) { + // 1. Let reasonBytes be the result of encoding reason. + // 2. If reasonBytes is longer than 123 bytes, then throw a + // "SyntaxError" DOMException. + reasonByteLength = Buffer.byteLength(reason) + + if (reasonByteLength > 123) { + throw new DOMException( + `Reason must be less than 123 bytes; received ${reasonByteLength}`, + 'SyntaxError' + ) + } } - /** - * Takes any input `value` and returns a `CID` instance if it was - * a `CID` otherwise returns `null`. If `value` is instanceof `CID` - * it will return value back. If `value` is not instance of this CID - * class, but is compatible CID it will return new instance of this - * `CID` class. Otherwise returns null. - * - * This allows two different incompatible versions of CID library to - * co-exist and interop as long as binary interface is compatible. - */ - static asCID(input) { - if (input == null) { - return null; - } - const value = input; - if (value instanceof dist_src_cid_CID) { - // If value is instance of CID then we're all set. - return value; - } - else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { - // If value isn't instance of this CID class but `this.asCID === this` or - // `value['/'] === value.bytes` is true it is CID instance coming from a - // different implementation (diff version or duplicate). In that case we - // rebase it to this `CID` implementation so caller is guaranteed to get - // instance with expected API. - const { version, code, multihash, bytes } = value; - return new dist_src_cid_CID(version, code, multihash, bytes ?? src_cid_encodeCID(version, code, multihash.bytes)); - } - else if (value[src_cid_cidSymbol] === true) { - // If value is a CID from older implementation that used to be tagged via - // symbol we still rebase it to the this `CID` implementation by - // delegating that to a constructor. - const { version, multihash, code } = value; - const digest = src_hashes_digest_decode(multihash); - return dist_src_cid_CID.create(version, code, digest); - } - else { - // Otherwise value is not a CID (or an incompatible version of it) in - // which case we return `null`. - return null; + + // 3. Run the first matching steps from the following list: + if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) { + // If this's ready state is CLOSING (2) or CLOSED (3) + // Do nothing. + } else if (!isEstablished(this)) { + // If the WebSocket connection is not yet established + // Fail the WebSocket connection and set this's ready state + // to CLOSING (2). + failWebsocketConnection(this, 'Connection was closed before it was established.') + this[kReadyState] = WebSocket.CLOSING + } else if (!isClosing(this)) { + // If the WebSocket closing handshake has not yet been started + // Start the WebSocket closing handshake and set this's ready + // state to CLOSING (2). + // - If neither code nor reason is present, the WebSocket Close + // message must not have a body. + // - If code is present, then the status code to use in the + // WebSocket Close message must be the integer given by code. + // - If reason is also present, then reasonBytes must be + // provided in the Close message after the status code. + + const frame = new WebsocketFrameSend() + + // If neither code nor reason is present, the WebSocket Close + // message must not have a body. + + // If code is present, then the status code to use in the + // WebSocket Close message must be the integer given by code. + if (code !== undefined && reason === undefined) { + frame.frameData = Buffer.allocUnsafe(2) + frame.frameData.writeUInt16BE(code, 0) + } else if (code !== undefined && reason !== undefined) { + // If reason is also present, then reasonBytes must be + // provided in the Close message after the status code. + frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength) + frame.frameData.writeUInt16BE(code, 0) + // the body MAY contain UTF-8-encoded data with value /reason/ + frame.frameData.write(reason, 2, 'utf-8') + } else { + frame.frameData = emptyBuffer + } + + /** @type {import('stream').Duplex} */ + const socket = this[kResponse].socket + + socket.write(frame.createFrame(opcodes.CLOSE), (err) => { + if (!err) { + this[kSentClose] = true } + }) + + // Upon either sending or receiving a Close control frame, it is said + // that _The WebSocket Closing Handshake is Started_ and that the + // WebSocket connection is in the CLOSING state. + this[kReadyState] = states.CLOSING + } else { + // Otherwise + // Set this's ready state to CLOSING (2). + this[kReadyState] = WebSocket.CLOSING } - /** - * @param version - Version of the CID - * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param digest - (Multi)hash of the of the content. - */ - static create(version, code, digest) { - if (typeof code !== 'number') { - throw new Error('String codecs are no longer supported'); - } - if (!(digest.bytes instanceof Uint8Array)) { - throw new Error('Invalid digest'); - } - switch (version) { - case 0: { - if (code !== src_cid_DAG_PB_CODE) { - throw new Error(`Version 0 CID must use dag-pb (code: ${src_cid_DAG_PB_CODE}) block encoding`); - } - else { - return new dist_src_cid_CID(version, code, digest, digest.bytes); - } - } - case 1: { - const bytes = src_cid_encodeCID(version, code, digest.bytes); - return new dist_src_cid_CID(version, code, digest, bytes); - } - default: { - throw new Error('Invalid version'); - } - } + } + + /** + * @see https://websockets.spec.whatwg.org/#dom-websocket-send + * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data + */ + send (data) { + webidl.brandCheck(this, WebSocket) + + webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' }) + + data = webidl.converters.WebSocketSendData(data) + + // 1. If this's ready state is CONNECTING, then throw an + // "InvalidStateError" DOMException. + if (this[kReadyState] === WebSocket.CONNECTING) { + throw new DOMException('Sent before connected.', 'InvalidStateError') } - /** - * Simplified version of `create` for CIDv0. - */ - static createV0(digest) { - return dist_src_cid_CID.create(0, src_cid_DAG_PB_CODE, digest); + + // 2. Run the appropriate set of steps from the following list: + // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1 + // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2 + + if (!isEstablished(this) || isClosing(this)) { + return } - /** - * Simplified version of `create` for CIDv1. - * - * @param code - Content encoding format code. - * @param digest - Multihash of the content. - */ - static createV1(code, digest) { - return dist_src_cid_CID.create(1, code, digest); + + /** @type {import('stream').Duplex} */ + const socket = this[kResponse].socket + + // If data is a string + if (typeof data === 'string') { + // If the WebSocket connection is established and the WebSocket + // closing handshake has not yet started, then the user agent + // must send a WebSocket Message comprised of the data argument + // using a text frame opcode; if the data cannot be sent, e.g. + // because it would need to be buffered but the buffer is full, + // the user agent must flag the WebSocket as full and then close + // the WebSocket connection. Any invocation of this method with a + // string argument that does not throw an exception must increase + // the bufferedAmount attribute by the number of bytes needed to + // express the argument as UTF-8. + + const value = Buffer.from(data) + const frame = new WebsocketFrameSend(value) + const buffer = frame.createFrame(opcodes.TEXT) + + this.#bufferedAmount += value.byteLength + socket.write(buffer, () => { + this.#bufferedAmount -= value.byteLength + }) + } else if (types.isArrayBuffer(data)) { + // If the WebSocket connection is established, and the WebSocket + // closing handshake has not yet started, then the user agent must + // send a WebSocket Message comprised of data using a binary frame + // opcode; if the data cannot be sent, e.g. because it would need + // to be buffered but the buffer is full, the user agent must flag + // the WebSocket as full and then close the WebSocket connection. + // The data to be sent is the data stored in the buffer described + // by the ArrayBuffer object. Any invocation of this method with an + // ArrayBuffer argument that does not throw an exception must + // increase the bufferedAmount attribute by the length of the + // ArrayBuffer in bytes. + + const value = Buffer.from(data) + const frame = new WebsocketFrameSend(value) + const buffer = frame.createFrame(opcodes.BINARY) + + this.#bufferedAmount += value.byteLength + socket.write(buffer, () => { + this.#bufferedAmount -= value.byteLength + }) + } else if (ArrayBuffer.isView(data)) { + // If the WebSocket connection is established, and the WebSocket + // closing handshake has not yet started, then the user agent must + // send a WebSocket Message comprised of data using a binary frame + // opcode; if the data cannot be sent, e.g. because it would need to + // be buffered but the buffer is full, the user agent must flag the + // WebSocket as full and then close the WebSocket connection. The + // data to be sent is the data stored in the section of the buffer + // described by the ArrayBuffer object that data references. Any + // invocation of this method with this kind of argument that does + // not throw an exception must increase the bufferedAmount attribute + // by the length of data’s buffer in bytes. + + const ab = Buffer.from(data, data.byteOffset, data.byteLength) + + const frame = new WebsocketFrameSend(ab) + const buffer = frame.createFrame(opcodes.BINARY) + + this.#bufferedAmount += ab.byteLength + socket.write(buffer, () => { + this.#bufferedAmount -= ab.byteLength + }) + } else if (isBlobLike(data)) { + // If the WebSocket connection is established, and the WebSocket + // closing handshake has not yet started, then the user agent must + // send a WebSocket Message comprised of data using a binary frame + // opcode; if the data cannot be sent, e.g. because it would need to + // be buffered but the buffer is full, the user agent must flag the + // WebSocket as full and then close the WebSocket connection. The data + // to be sent is the raw data represented by the Blob object. Any + // invocation of this method with a Blob argument that does not throw + // an exception must increase the bufferedAmount attribute by the size + // of the Blob object’s raw data, in bytes. + + const frame = new WebsocketFrameSend() + + data.arrayBuffer().then((ab) => { + const value = Buffer.from(ab) + frame.frameData = value + const buffer = frame.createFrame(opcodes.BINARY) + + this.#bufferedAmount += value.byteLength + socket.write(buffer, () => { + this.#bufferedAmount -= value.byteLength + }) + }) } - /** - * Decoded a CID from its binary representation. The byte array must contain - * only the CID with no additional bytes. - * - * An error will be thrown if the bytes provided do not contain a valid - * binary representation of a CID. - */ - static decode(bytes) { - const [cid, remainder] = dist_src_cid_CID.decodeFirst(bytes); - if (remainder.length !== 0) { - throw new Error('Incorrect length'); - } - return cid; + } + + get readyState () { + webidl.brandCheck(this, WebSocket) + + // The readyState getter steps are to return this's ready state. + return this[kReadyState] + } + + get bufferedAmount () { + webidl.brandCheck(this, WebSocket) + + return this.#bufferedAmount + } + + get url () { + webidl.brandCheck(this, WebSocket) + + // The url getter steps are to return this's url, serialized. + return URLSerializer(this[kWebSocketURL]) + } + + get extensions () { + webidl.brandCheck(this, WebSocket) + + return this.#extensions + } + + get protocol () { + webidl.brandCheck(this, WebSocket) + + return this.#protocol + } + + get onopen () { + webidl.brandCheck(this, WebSocket) + + return this.#events.open + } + + set onopen (fn) { + webidl.brandCheck(this, WebSocket) + + if (this.#events.open) { + this.removeEventListener('open', this.#events.open) } - /** - * Decoded a CID from its binary representation at the beginning of a byte - * array. - * - * Returns an array with the first element containing the CID and the second - * element containing the remainder of the original byte array. The remainder - * will be a zero-length byte array if the provided bytes only contained a - * binary CID representation. - */ - static decodeFirst(bytes) { - const specs = dist_src_cid_CID.inspectBytes(bytes); - const prefixSize = specs.size - specs.multihashSize; - const multihashBytes = dist_src_bytes_coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize)); - if (multihashBytes.byteLength !== specs.multihashSize) { - throw new Error('Incorrect length'); - } - const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize); - const digest = new src_hashes_digest_Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); - const cid = specs.version === 0 - ? dist_src_cid_CID.createV0(digest) - : dist_src_cid_CID.createV1(specs.codec, digest); - return [cid, bytes.subarray(specs.size)]; + + if (typeof fn === 'function') { + this.#events.open = fn + this.addEventListener('open', fn) + } else { + this.#events.open = null } - /** - * Inspect the initial bytes of a CID to determine its properties. - * - * Involves decoding up to 4 varints. Typically this will require only 4 to 6 - * bytes but for larger multicodec code values and larger multihash digest - * lengths these varints can be quite large. It is recommended that at least - * 10 bytes be made available in the `initialBytes` argument for a complete - * inspection. - */ - static inspectBytes(initialBytes) { - let offset = 0; - const next = () => { - const [i, length] = multiformats_dist_src_varint_decode(initialBytes.subarray(offset)); - offset += length; - return i; - }; - let version = next(); - let codec = src_cid_DAG_PB_CODE; - if (version === 18) { - // CIDv0 - version = 0; - offset = 0; - } - else { - codec = next(); - } - if (version !== 0 && version !== 1) { - throw new RangeError(`Invalid CID version ${version}`); - } - const prefixSize = offset; - const multihashCode = next(); // multihash code - const digestSize = next(); // multihash length - const size = offset + digestSize; - const multihashSize = size - prefixSize; - return { version, codec, multihashCode, digestSize, multihashSize, size }; + } + + get onerror () { + webidl.brandCheck(this, WebSocket) + + return this.#events.error + } + + set onerror (fn) { + webidl.brandCheck(this, WebSocket) + + if (this.#events.error) { + this.removeEventListener('error', this.#events.error) } - /** - * Takes cid in a string representation and creates an instance. If `base` - * decoder is not provided will use a default from the configuration. It will - * throw an error if encoding of the CID is not compatible with supplied (or - * a default decoder). - */ - static parse(source, base) { - const [prefix, bytes] = src_cid_parseCIDtoBytes(source, base); - const cid = dist_src_cid_CID.decode(bytes); - if (cid.version === 0 && source[0] !== 'Q') { - throw Error('Version 0 CID string must not include multibase prefix'); - } - // Cache string representation to avoid computing it on `this.toString()` - src_cid_baseCache(cid).set(prefix, source); - return cid; + + if (typeof fn === 'function') { + this.#events.error = fn + this.addEventListener('error', fn) + } else { + this.#events.error = null } -} -function src_cid_parseCIDtoBytes(source, base) { - switch (source[0]) { - // CIDv0 is parsed differently - case 'Q': { - const decoder = base ?? src_bases_base58_base58btc; - return [ - src_bases_base58_base58btc.prefix, - decoder.decode(`${src_bases_base58_base58btc.prefix}${source}`) - ]; - } - case src_bases_base58_base58btc.prefix: { - const decoder = base ?? src_bases_base58_base58btc; - return [src_bases_base58_base58btc.prefix, decoder.decode(source)]; - } - case src_bases_base32_base32.prefix: { - const decoder = base ?? src_bases_base32_base32; - return [src_bases_base32_base32.prefix, decoder.decode(source)]; - } - default: { - if (base == null) { - throw Error('To parse non base32 or base58btc encoded CID multibase decoder must be provided'); - } - return [source[0], base.decode(source)]; - } + } + + get onclose () { + webidl.brandCheck(this, WebSocket) + + return this.#events.close + } + + set onclose (fn) { + webidl.brandCheck(this, WebSocket) + + if (this.#events.close) { + this.removeEventListener('close', this.#events.close) } -} -function src_cid_toStringV0(bytes, cache, base) { - const { prefix } = base; - if (prefix !== src_bases_base58_base58btc.prefix) { - throw Error(`Cannot string encode V0 in ${base.name} encoding`); + + if (typeof fn === 'function') { + this.#events.close = fn + this.addEventListener('close', fn) + } else { + this.#events.close = null } - const cid = cache.get(prefix); - if (cid == null) { - const cid = base.encode(bytes).slice(1); - cache.set(prefix, cid); - return cid; + } + + get onmessage () { + webidl.brandCheck(this, WebSocket) + + return this.#events.message + } + + set onmessage (fn) { + webidl.brandCheck(this, WebSocket) + + if (this.#events.message) { + this.removeEventListener('message', this.#events.message) } - else { - return cid; + + if (typeof fn === 'function') { + this.#events.message = fn + this.addEventListener('message', fn) + } else { + this.#events.message = null } -} -function src_cid_toStringV1(bytes, cache, base) { - const { prefix } = base; - const cid = cache.get(prefix); - if (cid == null) { - const cid = base.encode(bytes); - cache.set(prefix, cid); - return cid; + } + + get binaryType () { + webidl.brandCheck(this, WebSocket) + + return this[kBinaryType] + } + + set binaryType (type) { + webidl.brandCheck(this, WebSocket) + + if (type !== 'blob' && type !== 'arraybuffer') { + this[kBinaryType] = 'blob' + } else { + this[kBinaryType] = type } - else { - return cid; + } + + /** + * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol + */ + #onConnectionEstablished (response) { + // processResponse is called when the "response’s header list has been received and initialized." + // once this happens, the connection is open + this[kResponse] = response + + const parser = new ByteParser(this) + parser.on('drain', function onParserDrain () { + this.ws[kResponse].socket.resume() + }) + + response.socket.ws = this + this[kByteParser] = parser + + // 1. Change the ready state to OPEN (1). + this[kReadyState] = states.OPEN + + // 2. Change the extensions attribute’s value to the extensions in use, if + // it is not the null value. + // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1 + const extensions = response.headersList.get('sec-websocket-extensions') + + if (extensions !== null) { + this.#extensions = extensions + } + + // 3. Change the protocol attribute’s value to the subprotocol in use, if + // it is not the null value. + // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9 + const protocol = response.headersList.get('sec-websocket-protocol') + + if (protocol !== null) { + this.#protocol = protocol } + + // 4. Fire an event named open at the WebSocket object. + fireEvent('open', this) + } } -const src_cid_DAG_PB_CODE = 0x70; -const src_cid_SHA_256_CODE = 0x12; -function src_cid_encodeCID(version, code, multihash) { - const codeOffset = src_varint_encodingLength(version); - const hashOffset = codeOffset + src_varint_encodingLength(code); - const bytes = new Uint8Array(hashOffset + multihash.byteLength); - src_varint_encodeTo(version, bytes, 0); - src_varint_encodeTo(code, bytes, codeOffset); - bytes.set(multihash, hashOffset); - return bytes; + +// https://websockets.spec.whatwg.org/#dom-websocket-connecting +WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING +// https://websockets.spec.whatwg.org/#dom-websocket-open +WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN +// https://websockets.spec.whatwg.org/#dom-websocket-closing +WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING +// https://websockets.spec.whatwg.org/#dom-websocket-closed +WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED + +Object.defineProperties(WebSocket.prototype, { + CONNECTING: staticPropertyDescriptors, + OPEN: staticPropertyDescriptors, + CLOSING: staticPropertyDescriptors, + CLOSED: staticPropertyDescriptors, + url: kEnumerableProperty, + readyState: kEnumerableProperty, + bufferedAmount: kEnumerableProperty, + onopen: kEnumerableProperty, + onerror: kEnumerableProperty, + onclose: kEnumerableProperty, + close: kEnumerableProperty, + onmessage: kEnumerableProperty, + binaryType: kEnumerableProperty, + send: kEnumerableProperty, + extensions: kEnumerableProperty, + protocol: kEnumerableProperty, + [Symbol.toStringTag]: { + value: 'WebSocket', + writable: false, + enumerable: false, + configurable: true + } +}) + +Object.defineProperties(WebSocket, { + CONNECTING: staticPropertyDescriptors, + OPEN: staticPropertyDescriptors, + CLOSING: staticPropertyDescriptors, + CLOSED: staticPropertyDescriptors +}) + +webidl.converters['sequence'] = webidl.sequenceConverter( + webidl.converters.DOMString +) + +webidl.converters['DOMString or sequence'] = function (V) { + if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) { + return webidl.converters['sequence'](V) + } + + return webidl.converters.DOMString(V) } -const src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID'); -//# sourceMappingURL=cid.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/hashes/hasher.js -function hasher_from({ name, code, encode }) { - return new Hasher(name, code, encode); +// This implements the propsal made in https://github.com/whatwg/websockets/issues/42 +webidl.converters.WebSocketInit = webidl.dictionaryConverter([ + { + key: 'protocols', + converter: webidl.converters['DOMString or sequence'], + get defaultValue () { + return [] + } + }, + { + key: 'dispatcher', + converter: (V) => V, + get defaultValue () { + return getGlobalDispatcher() + } + }, + { + key: 'headers', + converter: webidl.nullableConverter(webidl.converters.HeadersInit) + } +]) + +webidl.converters['DOMString or sequence or WebSocketInit'] = function (V) { + if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) { + return webidl.converters.WebSocketInit(V) + } + + return { protocols: webidl.converters['DOMString or sequence'](V) } } -/** - * Hasher represents a hashing algorithm implementation that produces as - * `MultihashDigest`. - */ -class Hasher { - name; - code; - encode; - constructor(name, code, encode) { - this.name = name; - this.code = code; - this.encode = encode; + +webidl.converters.WebSocketSendData = function (V) { + if (webidl.util.Type(V) === 'Object') { + if (isBlobLike(V)) { + return webidl.converters.Blob(V, { strict: false }) } - digest(input) { - if (input instanceof Uint8Array) { - const result = this.encode(input); - return result instanceof Uint8Array - ? Digest.create(this.code, result) - /* c8 ignore next 1 */ - : result.then(digest => Digest.create(this.code, digest)); - } - else { - throw Error('Unknown type, must be binary type'); - /* c8 ignore next 1 */ - } + + if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) { + return webidl.converters.BufferSource(V) } + } + + return webidl.converters.USVString(V) +} + +module.exports = { + WebSocket } -//# sourceMappingURL=hasher.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/index.js -/** - * @packageDocumentation - * - * This library defines common interfaces and low level building blocks for various interrelated multiformat technologies (multicodec, multihash, multibase, and CID). They can be used to implement custom base encoders / decoders / codecs, codec encoders /decoders and multihash hashers that comply to the interface that layers above assume. - * - * This library provides implementations for most basics and many others can be found in linked repositories. - * - * ```TypeScript - * import { CID } from 'multiformats/cid' - * import * as json from 'multiformats/codecs/json' - * import { sha256 } from 'multiformats/hashes/sha2' - * - * const bytes = json.encode({ hello: 'world' }) - * - * const hash = await sha256.digest(bytes) - * const cid = CID.create(1, json.code, hash) - * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) - * ``` - * - * ## Creating Blocks - * - * ```TypeScript - * import * as Block from 'multiformats/block' - * import * as codec from '@ipld/dag-cbor' - * import { sha256 as hasher } from 'multiformats/hashes/sha2' - * - * const value = { hello: 'world' } - * - * // encode a block - * let block = await Block.encode({ value, codec, hasher }) - * - * block.value // { hello: 'world' } - * block.bytes // Uint8Array - * block.cid // CID() w/ sha2-256 hash address and dag-cbor codec - * - * // you can also decode blocks from their binary state - * block = await Block.decode({ bytes: block.bytes, codec, hasher }) - * - * // if you have the cid you can also verify the hash on decode - * block = await Block.create({ bytes: block.bytes, cid: block.cid, codec, hasher }) - * ``` - * - * ## Multibase Encoders / Decoders / Codecs - * - * CIDs can be serialized to string representation using multibase encoders that implement [`MultibaseEncoder`](https://github.com/multiformats/js-multiformats/blob/master/src/bases/interface.ts) interface. This library provides quite a few implementations that can be imported: - * - * ```TypeScript - * import { base64 } from "multiformats/bases/base64" - * cid.toString(base64.encoder) - * //> 'mAYAEEiCTojlxqRTl6svwqNJRVM2jCcPBxy+7mRTUfGDzy2gViA' - * ``` - * - * Parsing CID string serialized CIDs requires multibase decoder that implements [`MultibaseDecoder`](https://github.com/multiformats/js-multiformats/blob/master/src/bases/interface.ts) interface. This library provides a decoder for every encoder it provides: - * - * ```TypeScript - * CID.parse('mAYAEEiCTojlxqRTl6svwqNJRVM2jCcPBxy+7mRTUfGDzy2gViA', base64.decoder) - * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) - * ``` - * - * Dual of multibase encoder & decoder is defined as multibase codec and it exposes - * them as `encoder` and `decoder` properties. For added convenience codecs also - * implement `MultibaseEncoder` and `MultibaseDecoder` interfaces so they could be - * used as either or both: - * - * ```TypeScript - * cid.toString(base64) - * CID.parse(cid.toString(base64), base64) - * ``` - * - * **Note:** CID implementation comes bundled with `base32` and `base58btc` - * multibase codecs so that CIDs can be base serialized to (version specific) - * default base encoding and parsed without having to supply base encoders/decoders: - * - * ```TypeScript - * const v1 = CID.parse('bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea') - * v1.toString() - * //> 'bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea' - * - * const v0 = CID.parse('QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n') - * v0.toString() - * //> 'QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n' - * v0.toV1().toString() - * //> 'bafybeihdwdcefgh4dqkjv67uzcmw7ojee6xedzdetojuzjevtenxquvyku' - * ``` - * - * ## Multicodec Encoders / Decoders / Codecs - * - * This library defines [`BlockEncoder`, `BlockDecoder` and `BlockCodec` interfaces](https://github.com/multiformats/js-multiformats/blob/master/src/codecs/interface.ts). - * Codec implementations should conform to the `BlockCodec` interface which implements both `BlockEncoder` and `BlockDecoder`. - * Here is an example implementation of JSON `BlockCodec`. - * - * ```TypeScript - * export const { name, code, encode, decode } = { - * name: 'json', - * code: 0x0200, - * encode: json => new TextEncoder().encode(JSON.stringify(json)), - * decode: bytes => JSON.parse(new TextDecoder().decode(bytes)) - * } - * ``` - * - * ## Multihash Hashers - * - * This library defines [`MultihashHasher` and `MultihashDigest` interfaces](https://github.com/multiformats/js-multiformats/blob/master/src/hashes/interface.ts) and convinient function for implementing them: - * - * ```TypeScript - * import * as hasher from 'multiformats/hashes/hasher' - * - * const sha256 = hasher.from({ - * // As per multiformats table - * // https://github.com/multiformats/multicodec/blob/master/table.csv#L9 - * name: 'sha2-256', - * code: 0x12, - * - * encode: (input) => new Uint8Array(crypto.createHash('sha256').update(input).digest()) - * }) - * - * const hash = await sha256.digest(json.encode({ hello: 'world' })) - * CID.create(1, json.code, hash) - * - * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) - * ``` - * - * ## Traversal - * - * This library contains higher-order functions for traversing graphs of data easily. - * - * `walk()` walks through the links in each block of a DAG calling a user-supplied loader function for each one, in depth-first order with no duplicate block visits. The loader should return a `Block` object and can be used to inspect and collect block ordering for a full DAG walk. The loader should `throw` on error, and return `null` if a block should be skipped by `walk()`. - * - * ```TypeScript - * import { walk } from 'multiformats/traversal' - * import * as Block from 'multiformats/block' - * import * as codec from 'multiformats/codecs/json' - * import { sha256 as hasher } from 'multiformats/hashes/sha2' - * - * // build a DAG (a single block for this simple example) - * const value = { hello: 'world' } - * const block = await Block.encode({ value, codec, hasher }) - * const { cid } = block - * console.log(cid) - * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) - * - * // create a loader function that also collects CIDs of blocks in - * // their traversal order - * const load = (cid, blocks) => async (cid) => { - * // fetch a block using its cid - * // e.g.: const block = await fetchBlockByCID(cid) - * blocks.push(cid) - * return block - * } - * - * // collect blocks in this DAG starting from the root `cid` - * const blocks = [] - * await walk({ cid, load: load(cid, blocks) }) - * - * console.log(blocks) - * //> [CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea)] - * ``` - * - * ## Legacy interface - * - * [`blockcodec-to-ipld-format`](https://github.com/ipld/js-blockcodec-to-ipld-format) converts a multiformats [`BlockCodec`](https://github.com/multiformats/js-multiformats/blob/master/src/codecs/interface.ts#L21) into an - * [`interface-ipld-format`](https://github.com/ipld/interface-ipld-format) for use with the [`ipld`](https://github.com/ipld/ipld) package. This can help bridge IPLD codecs implemented using the structure and interfaces defined here to existing code that assumes, or requires `interface-ipld-format`. This bridge also includes the relevant TypeScript definitions. - * - * ## Implementations - * - * By default, no base encodings (other than base32 & base58btc), hash functions, - * or codec implementations are exposed by `multiformats`, you need to - * import the ones you need yourself. - * - * ### Multibase codecs - * - * | bases | import | repo | - * | ------------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------- | - * | `base16` | `multiformats/bases/base16` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | - * | `base32`, `base32pad`, `base32hex`, `base32hexpad`, `base32z` | `multiformats/bases/base32` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | - * | `base64`, `base64pad`, `base64url`, `base64urlpad` | `multiformats/bases/base64` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | - * | `base58btc`, `base58flick4` | `multiformats/bases/base58` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | - * - * Other (less useful) bases implemented in [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) include: `base2`, `base8`, `base10`, `base36` and `base256emoji`. - * - * ### Multihash hashers - * - * | hashes | import | repo | - * | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------ | - * | `sha2-256`, `sha2-512` | `multiformats/hashes/sha2` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/hashes) | - * | `sha3-224`, `sha3-256`, `sha3-384`,`sha3-512`, `shake-128`, `shake-256`, `keccak-224`, `keccak-256`, `keccak-384`, `keccak-512` | `@multiformats/sha3` | [multiformats/js-sha3](https://github.com/multiformats/js-sha3) | - * | `identity` | `multiformats/hashes/identity` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/hashes/identity.js) | - * | `murmur3-128`, `murmur3-32` | `@multiformats/murmur3` | [multiformats/js-murmur3](https://github.com/multiformats/js-murmur3) | - * | `blake2b-*`, `blake2s-*` | `@multiformats/blake2` | [multiformats/js-blake2](https://github.com/multiformats/js-blake2) | - * - * ### IPLD codecs (multicodec) - * - * | codec | import | repo | - * | ---------- | -------------------------- | ------------------------------------------------------------------------------------------------------ | - * | `raw` | `multiformats/codecs/raw` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/codecs) | - * | `json` | `multiformats/codecs/json` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/codecs) | - * | `dag-cbor` | `@ipld/dag-cbor` | [ipld/js-dag-cbor](https://github.com/ipld/js-dag-cbor) | - * | `dag-json` | `@ipld/dag-json` | [ipld/js-dag-json](https://github.com/ipld/js-dag-json) | - * | `dag-pb` | `@ipld/dag-pb` | [ipld/js-dag-pb](https://github.com/ipld/js-dag-pb) | - * | `dag-jose` | `dag-jose` | [ceramicnetwork/js-dag-jose](https://github.com/ceramicnetwork/js-dag-jose) | - */ +/***/ }), + +/***/ 89637: +/***/ ((__unused_webpack_module, exports) => { -// This way TS will also expose all the types from module +Object.defineProperty(exports, "__esModule", ({ value: true })); + +function getUserAgent() { + if (typeof navigator === "object" && "userAgent" in navigator) { + return navigator.userAgent; + } + + if (typeof process === "object" && process.version !== undefined) { + return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; + } + return ""; +} +exports.getUserAgent = getUserAgent; //# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/bases/base64.js -const base64 = bases_base_rfc4648({ - prefix: 'm', - name: 'base64', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', - bitsPerChar: 6 -}); -const base64pad = bases_base_rfc4648({ - prefix: 'M', - name: 'base64pad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', - bitsPerChar: 6 -}); -const base64url = bases_base_rfc4648({ - prefix: 'u', - name: 'base64url', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', - bitsPerChar: 6 -}); -const base64urlpad = bases_base_rfc4648({ - prefix: 'U', - name: 'base64urlpad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', - bitsPerChar: 6 -}); -//# sourceMappingURL=base64.js.map -;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/src/index.js -/* eslint max-depth: ["error", 7] */ +/***/ }), +/***/ 48398: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * @template T - * @typedef {import('multiformats/codecs/interface').ByteView} ByteView - */ -/** - * @template T - * @typedef {import('multiformats').ToString} ToString - */ -/** - * @typedef {import('cborg/interface').DecodeTokenizer} DecodeTokenizer - */ +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; + } +})); -/** - * cidEncoder will receive all Objects during encode, it needs to filter out - * anything that's not a CID and return `null` for that so it's encoded as - * normal. Encoding a CID means replacing it with a `{"/":"}` - * object as per the DAG-JSON spec. - * - * @param {any} obj - * @returns {Token[]|null} - */ -function src_cidEncoder (obj) { - if (obj.asCID !== obj && obj['/'] !== obj.bytes) { - return null // any other kind of object +var _v = _interopRequireDefault(__nccwpck_require__(29871)); + +var _v2 = _interopRequireDefault(__nccwpck_require__(69695)); + +var _v3 = _interopRequireDefault(__nccwpck_require__(48641)); + +var _v4 = _interopRequireDefault(__nccwpck_require__(70438)); + +var _nil = _interopRequireDefault(__nccwpck_require__(90309)); + +var _version = _interopRequireDefault(__nccwpck_require__(91458)); + +var _validate = _interopRequireDefault(__nccwpck_require__(12584)); + +var _stringify = _interopRequireDefault(__nccwpck_require__(82024)); + +var _parse = _interopRequireDefault(__nccwpck_require__(98622)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/***/ }), + +/***/ 74741: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +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'); } - const cid = dist_src_cid_CID.asCID(obj) - /* c8 ignore next 4 */ - // very unlikely case, and it'll probably throw a recursion error in cborg - if (!cid) { - return null + + return _crypto.default.createHash('md5').update(bytes).digest(); +} + +var _default = md5; +exports["default"] = _default; + +/***/ }), + +/***/ 90309: +/***/ ((__unused_webpack_module, exports) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = '00000000-0000-0000-0000-000000000000'; +exports["default"] = _default; + +/***/ }), + +/***/ 98622: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _validate = _interopRequireDefault(__nccwpck_require__(12584)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function parse(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError('Invalid UUID'); } - const cidString = cid.toString() - return [ - new token_Token(token_Type.map, Infinity, 1), - new token_Token(token_Type.string, '/', 1), // key - new token_Token(token_Type.string, cidString, cidString.length), // value - new token_Token(token_Type["break"], undefined, 1) - ] + 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; } -/** - * bytesEncoder will receive all Uint8Arrays (and friends) during encode, it - * needs to replace it with a `{"/":{"bytes":"Base64ByteString"}}` object as - * per the DAG-JSON spec. - * - * @param {Uint8Array} bytes - * @returns {Token[]|null} - */ -function bytesEncoder (bytes) { - const bytesString = base64.encode(bytes).slice(1) // no mbase prefix - return [ - new token_Token(token_Type.map, Infinity, 1), - new token_Token(token_Type.string, '/', 1), // key - new token_Token(token_Type.map, Infinity, 1), // value - new token_Token(token_Type.string, 'bytes', 5), // inner key - new token_Token(token_Type.string, bytesString, bytesString.length), // inner value - new token_Token(token_Type["break"], undefined, 1), - new token_Token(token_Type["break"], undefined, 1) - ] +var _default = parse; +exports["default"] = _default; + +/***/ }), + +/***/ 59079: +/***/ ((__unused_webpack_module, exports) => { + + + +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; + +/***/ }), + +/***/ 98007: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +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); } -/** - * taBytesEncoder wraps bytesEncoder() but for the more exotic typed arrays so - * that we access the underlying ArrayBuffer data - * - * @param {Int8Array|Uint16Array|Int16Array|Uint32Array|Int32Array|Float32Array|Float64Array|Uint8ClampedArray|BigInt64Array|BigUint64Array} obj - * @returns {Token[]|null} - */ -function taBytesEncoder (obj) { - return bytesEncoder(new Uint8Array(obj.buffer, obj.byteOffset, obj.byteLength)) +/***/ }), + +/***/ 82407: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +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; + +/***/ }), + +/***/ 82024: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _validate = _interopRequireDefault(__nccwpck_require__(12584)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /** - * abBytesEncoder wraps bytesEncoder() but for plain ArrayBuffers - * - * @param {ArrayBuffer} ab - * @returns {Token[]|null} + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ -function abBytesEncoder (ab) { - return bytesEncoder(new Uint8Array(ab)) +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; + +/***/ }), + +/***/ 29871: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _rng = _interopRequireDefault(__nccwpck_require__(98007)); + +var _stringify = _interopRequireDefault(__nccwpck_require__(82024)); + +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); } -// eslint-disable-next-line jsdoc/require-returns-check -/** - * Intercept all `undefined` values from an object walk and reject the entire - * object if we find one. - * - * @returns {null} - */ -function src_undefinedEncoder () { - throw new Error('`undefined` is not supported by the IPLD Data Model and cannot be encoded') -} +var _default = v1; +exports["default"] = _default; + +/***/ }), + +/***/ 69695: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _v = _interopRequireDefault(__nccwpck_require__(82627)); + +var _md = _interopRequireDefault(__nccwpck_require__(74741)); + +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; + +/***/ }), + +/***/ 82627: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = _default; +exports.URL = exports.DNS = void 0; + +var _stringify = _interopRequireDefault(__nccwpck_require__(82024)); + +var _parse = _interopRequireDefault(__nccwpck_require__(98622)); -/** - * Intercept all `number` values from an object walk and reject the entire - * object if we find something that doesn't fit the IPLD data model (NaN & - * Infinity). - * - * @param {number} num - * @returns {null} - */ -function src_numberEncoder (num) { - if (Number.isNaN(num)) { - throw new Error('`NaN` is not supported by the IPLD Data Model and cannot be encoded') - } - if (num === Infinity || num === -Infinity) { - throw new Error('`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded') - } - return null // process with standard number encoder -} +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const src_encodeOptions = { - typeEncoders: { - Object: src_cidEncoder, - Buffer: bytesEncoder, - Uint8Array: bytesEncoder, - Int8Array: taBytesEncoder, - Uint16Array: taBytesEncoder, - Int16Array: taBytesEncoder, - Uint32Array: taBytesEncoder, - Int32Array: taBytesEncoder, - Float32Array: taBytesEncoder, - Float64Array: taBytesEncoder, - Uint8ClampedArray: taBytesEncoder, - BigInt64Array: taBytesEncoder, - BigUint64Array: taBytesEncoder, - DataView: taBytesEncoder, - ArrayBuffer: abBytesEncoder, - undefined: src_undefinedEncoder, - number: src_numberEncoder +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; } -/** - * @implements {DecodeTokenizer} - */ -class DagJsonTokenizer extends Tokenizer { - /** - * @param {Uint8Array} data - * @param {object} [options] - */ - constructor (data, options) { - super(data, options) - /** @type {Token[]} */ - this.tokenBuffer = [] - } +const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +exports.DNS = DNS; +const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +exports.URL = URL; - /** - * @returns {boolean} - */ - done () { - return this.tokenBuffer.length === 0 && super.done() - } +function _default(name, version, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + if (typeof value === 'string') { + value = stringToBytes(value); + } - /** - * @returns {Token} - */ - _next () { - if (this.tokenBuffer.length > 0) { - // @ts-ignore https://github.com/Microsoft/TypeScript/issues/30406 - return this.tokenBuffer.pop() + if (typeof namespace === 'string') { + namespace = (0, _parse.default)(namespace); } - return super.next() - } - /** - * Implements rules outlined in https://github.com/ipld/specs/pull/356 - * - * @returns {Token} - */ - next () { - const token = this._next() + 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])` - if (token.type === token_Type.map) { - const keyToken = this._next() - if (keyToken.type === token_Type.string && keyToken.value === '/') { - const valueToken = this._next() - if (valueToken.type === token_Type.string) { // *must* be a CID - const breakToken = this._next() // swallow the end-of-map token - if (breakToken.type !== token_Type["break"]) { - throw new Error('Invalid encoded CID form') - } - this.tokenBuffer.push(valueToken) // CID.parse will pick this up after our tag token - return new token_Token(token_Type.tag, 42, 0) - } - if (valueToken.type === token_Type.map) { - const innerKeyToken = this._next() - if (innerKeyToken.type === token_Type.string && innerKeyToken.value === 'bytes') { - const innerValueToken = this._next() - if (innerValueToken.type === token_Type.string) { // *must* be Bytes - for (let i = 0; i < 2; i++) { - const breakToken = this._next() // swallow two end-of-map tokens - if (breakToken.type !== token_Type["break"]) { - throw new Error('Invalid encoded Bytes form') - } - } - const bytes = base64.decode(`m${innerValueToken.value}`) - return new token_Token(token_Type.bytes, bytes, innerValueToken.value.length) - } - this.tokenBuffer.push(innerValueToken) // bail - } - this.tokenBuffer.push(innerKeyToken) // bail - } - this.tokenBuffer.push(valueToken) // bail + + 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]; } - this.tokenBuffer.push(keyToken) // bail + + return buf; } - return token - } -} -const src_decodeOptions = { - allowIndefinite: false, - allowUndefined: false, - allowNaN: false, - allowInfinity: false, - allowBigInt: true, // this will lead to BigInt for ints outside of - // safe-integer range, which may surprise users - strict: true, - useMaps: false, - rejectDuplicateMapKeys: true, - /** @type {import('cborg').TagDecoder[]} */ - tags: [] -} + return (0, _stringify.default)(bytes); + } // Function#name is not settable on some platforms (#270) -// we're going to get TAG(42)STRING("bafy...") from the tokenizer so we only need -// to deal with the STRING("bafy...") at this point -src_decodeOptions.tags[42] = dist_src_cid_CID.parse -const dag_json_src_name = 'dag-json' -const dag_json_src_code = 0x0129 + try { + generateUUID.name = name; // eslint-disable-next-line no-empty + } catch (err) {} // For CommonJS default export support -/** - * @template T - * @param {T} node - * @returns {ByteView} - */ -const dag_json_src_encode = (node) => json_encode_encode(node, src_encodeOptions) -/** - * @template T - * @param {ByteView} data - * @returns {T} - */ -const dag_json_src_decode = (data) => { - // the tokenizer is stateful so we need a single instance of it - const options = Object.assign(src_decodeOptions, { tokenizer: new DagJsonTokenizer(data, src_decodeOptions) }) - return json_decode_decode(data, options) + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; } -/** - * @template T - * @param {T} node - * @returns {ToString} - */ -const src_format = (node) => utf8Decoder.decode(dag_json_src_encode(node)) +/***/ }), -const utf8Decoder = new TextDecoder() +/***/ 48641: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * @template T - * @param {ToString} data - * @returns {T} - */ -const parse = (data) => dag_json_src_decode(utf8Encoder.encode(data)) -const utf8Encoder = new TextEncoder() -;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/vendor/base-x.js -// base-x encoding / decoding -// Copyright (c) 2018 base-x contributors -// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) -// Distributed under the MIT software license, see the accompanying -// file LICENSE or http://www.opensource.org/licenses/mit-license.php. -function multiformats_vendor_base_x_base (ALPHABET, name) { - if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } - var BASE_MAP = new Uint8Array(256); - for (var j = 0; j < BASE_MAP.length; j++) { - BASE_MAP[j] = 255; - } - for (var i = 0; i < ALPHABET.length; i++) { - var x = ALPHABET.charAt(i); - var xc = x.charCodeAt(0); - if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') } - BASE_MAP[xc] = i; - } - var BASE = ALPHABET.length; - var LEADER = ALPHABET.charAt(0); - var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up - var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up - function encode (source) { - if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) { - source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); - } else if (Array.isArray(source)) { - source = Uint8Array.from(source); - } - if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') } - if (source.length === 0) { return '' } - // Skip & count leading zeroes. - var zeroes = 0; - var length = 0; - var pbegin = 0; - var pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; - } - // Allocate enough space in big-endian base58 representation. - var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; - var b58 = new Uint8Array(size); - // Process the bytes. - while (pbegin !== pend) { - var carry = source[pbegin]; - // Apply "b58 = b58 * 256 + ch". - var i = 0; - for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { - carry += (256 * b58[it1]) >>> 0; - b58[it1] = (carry % BASE) >>> 0; - carry = (carry / BASE) >>> 0; - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - pbegin++; - } - // Skip leading zeroes in base58 result. - var it2 = size - length; - while (it2 !== size && b58[it2] === 0) { - it2++; - } - // Translate the result into a string. - var str = LEADER.repeat(zeroes); - for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); } - return str - } - function decodeUnsafe (source) { - if (typeof source !== 'string') { throw new TypeError('Expected String') } - if (source.length === 0) { return new Uint8Array() } - var psz = 0; - // Skip leading spaces. - if (source[psz] === ' ') { return } - // Skip and count leading '1's. - var zeroes = 0; - var length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; - } - // Allocate enough space in big-endian base256 representation. - var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. - var b256 = new Uint8Array(size); - // Process the characters. - while (source[psz]) { - // Decode character - var carry = BASE_MAP[source.charCodeAt(psz)]; - // Invalid character - if (carry === 255) { return } - var i = 0; - for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { - carry += (BASE * b256[it3]) >>> 0; - b256[it3] = (carry % 256) >>> 0; - carry = (carry / 256) >>> 0; - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - psz++; - } - // Skip trailing spaces. - if (source[psz] === ' ') { return } - // Skip leading zeroes in b256. - var it4 = size - length; - while (it4 !== size && b256[it4] === 0) { - it4++; - } - var vch = new Uint8Array(zeroes + (size - it4)); - var j = zeroes; - while (it4 !== size) { - vch[j++] = b256[it4++]; - } - return vch - } - function decode (string) { - var buffer = decodeUnsafe(string); - if (buffer) { return buffer } - throw new Error(`Non-${name} character`) - } - return { - encode: encode, - decodeUnsafe: decodeUnsafe, - decode: decode - } -} -var multiformats_vendor_base_x_src = multiformats_vendor_base_x_base; -var multiformats_vendor_base_x_brrp_multiformats_scope_baseX = multiformats_vendor_base_x_src; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; -/* harmony default export */ const multiformats_vendor_base_x = (multiformats_vendor_base_x_brrp_multiformats_scope_baseX); +var _rng = _interopRequireDefault(__nccwpck_require__(98007)); -;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/src/bytes.js -const multiformats_src_bytes_empty = new Uint8Array(0) +var _stringify = _interopRequireDefault(__nccwpck_require__(82024)); -/** - * @param {Uint8Array} d - */ -const multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/** - * @param {string} hex - */ -const multiformats_src_bytes_fromHex = hex => { - const hexes = hex.match(/../g) - return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : multiformats_src_bytes_empty -} +function v4(options, buf, offset) { + options = options || {}; -/** - * @param {Uint8Array} aa - * @param {Uint8Array} bb - */ -const multiformats_src_bytes_equals = (aa, bb) => { - if (aa === bb) return true - if (aa.byteLength !== bb.byteLength) { - return false - } + const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - for (let ii = 0; ii < aa.byteLength; ii++) { - if (aa[ii] !== bb[ii]) { - return false + + 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 true + return (0, _stringify.default)(rnds); } -/** - * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o - * @returns {Uint8Array} - */ -const multiformats_src_bytes_coerce = o => { - if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o - if (o instanceof ArrayBuffer) return new Uint8Array(o) - if (ArrayBuffer.isView(o)) { - return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) - } - throw new Error('Unknown type, must be binary type') -} +var _default = v4; +exports["default"] = _default; -/** - * @param {any} o - * @returns {o is ArrayBuffer|ArrayBufferView} - */ -const multiformats_src_bytes_isBinary = o => - o instanceof ArrayBuffer || ArrayBuffer.isView(o) +/***/ }), -/** - * @param {string} str - * @returns {Uint8Array} - */ -const multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) +/***/ 70438: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * @param {Uint8Array} b - * @returns {string} - */ -const multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; -;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/src/bases/base.js +var _v = _interopRequireDefault(__nccwpck_require__(82627)); +var _sha = _interopRequireDefault(__nccwpck_require__(82407)); -// Linter can't see that API is used in types. -// eslint-disable-next-line +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; -/** - * Class represents both BaseEncoder and MultibaseEncoder meaning it - * can be used to encode to multibase or base encode without multibase - * prefix. - * - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseEncoder} - * @implements {API.BaseEncoder} - */ -class src_bases_base_Encoder { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(bytes:Uint8Array) => string} baseEncode - */ - constructor (name, prefix, baseEncode) { - this.name = name - this.prefix = prefix - this.baseEncode = baseEncode - } +/***/ }), - /** - * @param {Uint8Array} bytes - * @returns {API.Multibase} - */ - encode (bytes) { - if (bytes instanceof Uint8Array) { - return `${this.prefix}${this.baseEncode(bytes)}` - } else { - throw Error('Unknown type, must be binary type') - } - } -} +/***/ 12584: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * @template {string} Prefix - */ -/** - * Class represents both BaseDecoder and MultibaseDecoder so it could be used - * to decode multibases (with matching prefix) or just base decode strings - * with corresponding base encoding. - * - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseDecoder} - * @implements {API.UnibaseDecoder} - * @implements {API.BaseDecoder} - */ -class src_bases_base_Decoder { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(text:string) => Uint8Array} baseDecode - */ - constructor (name, prefix, baseDecode) { - this.name = name - this.prefix = prefix - /* c8 ignore next 3 */ - if (prefix.codePointAt(0) === undefined) { - throw new Error('Invalid prefix character') - } - /** @private */ - this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0)) - this.baseDecode = baseDecode - } - /** - * @param {string} text - */ - decode (text) { - if (typeof text === 'string') { - if (text.codePointAt(0) !== this.prefixCodePoint) { - throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`) - } - return this.baseDecode(text.slice(this.prefix.length)) - } else { - throw Error('Can only multibase decode strings') - } - } - /** - * @template {string} OtherPrefix - * @param {API.UnibaseDecoder|ComposedDecoder} decoder - * @returns {ComposedDecoder} - */ - or (decoder) { - return src_bases_base_or(this, decoder) - } +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _regex = _interopRequireDefault(__nccwpck_require__(59079)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function validate(uuid) { + return typeof uuid === 'string' && _regex.default.test(uuid); } -/** - * @template {string} Prefix - * @typedef {Record>} Decoders - */ +var _default = validate; +exports["default"] = _default; -/** - * @template {string} Prefix - * @implements {API.MultibaseDecoder} - * @implements {API.CombobaseDecoder} - */ -class src_bases_base_ComposedDecoder { - /** - * @param {Decoders} decoders - */ - constructor (decoders) { - this.decoders = decoders - } +/***/ }), - /** - * @template {string} OtherPrefix - * @param {API.UnibaseDecoder|ComposedDecoder} decoder - * @returns {ComposedDecoder} - */ - or (decoder) { - return src_bases_base_or(this, decoder) - } +/***/ 91458: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * @param {string} input - * @returns {Uint8Array} - */ - decode (input) { - const prefix = /** @type {Prefix} */ (input[0]) - const decoder = this.decoders[prefix] - if (decoder) { - return decoder.decode(input) - } else { - throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`) - } - } -} -/** - * @template {string} L - * @template {string} R - * @param {API.UnibaseDecoder|API.CombobaseDecoder} left - * @param {API.UnibaseDecoder|API.CombobaseDecoder} right - * @returns {ComposedDecoder} - */ -const src_bases_base_or = (left, right) => new src_bases_base_ComposedDecoder(/** @type {Decoders} */({ - ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }), - ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right }) -})) -/** - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseCodec} - * @implements {API.MultibaseEncoder} - * @implements {API.MultibaseDecoder} - * @implements {API.BaseCodec} - * @implements {API.BaseEncoder} - * @implements {API.BaseDecoder} - */ -class src_bases_base_Codec { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(bytes:Uint8Array) => string} baseEncode - * @param {(text:string) => Uint8Array} baseDecode - */ - constructor (name, prefix, baseEncode, baseDecode) { - this.name = name - this.prefix = prefix - this.baseEncode = baseEncode - this.baseDecode = baseDecode - this.encoder = new src_bases_base_Encoder(name, prefix, baseEncode) - this.decoder = new src_bases_base_Decoder(name, prefix, baseDecode) - } +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; - /** - * @param {Uint8Array} input - */ - encode (input) { - return this.encoder.encode(input) - } +var _validate = _interopRequireDefault(__nccwpck_require__(12584)); - /** - * @param {string} input - */ - decode (input) { - return this.decoder.decode(input) +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function version(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError('Invalid UUID'); } + + return parseInt(uuid.substr(14, 1), 16); } -/** - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {(bytes:Uint8Array) => string} options.encode - * @param {(input:string) => Uint8Array} options.decode - * @returns {Codec} - */ -const src_bases_base_from = ({ name, prefix, encode, decode }) => - new src_bases_base_Codec(name, prefix, encode, decode) +var _default = version; +exports["default"] = _default; -/** - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {string} options.alphabet - * @returns {Codec} - */ -const src_bases_base_baseX = ({ prefix, name, alphabet }) => { - const { encode, decode } = multiformats_vendor_base_x(alphabet, name) - return src_bases_base_from({ - prefix, - name, - encode, - /** - * @param {string} text - */ - decode: text => multiformats_src_bytes_coerce(decode(text)) - }) -} +/***/ }), -/** - * @param {string} string - * @param {string} alphabet - * @param {number} bitsPerChar - * @param {string} name - * @returns {Uint8Array} - */ -const src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { - // Build the character lookup table: - /** @type {Record} */ - const codes = {} - for (let i = 0; i < alphabet.length; ++i) { - codes[alphabet[i]] = i - } +/***/ 48655: +/***/ ((module) => { - // Count the padding bytes: - let end = string.length - while (string[end - 1] === '=') { - --end - } +// Returns a wrapper function that returns a wrapped callback +// The wrapper function should do some stuff, and return a +// presumably different callback function. +// This makes sure that own properties are retained, so that +// decorations and such are not lost along the way. +module.exports = wrappy +function wrappy (fn, cb) { + if (fn && cb) return wrappy(fn)(cb) - // Allocate the output: - const out = new Uint8Array((end * bitsPerChar / 8) | 0) + if (typeof fn !== 'function') + throw new TypeError('need wrapper function') - // Parse the data: - let bits = 0 // Number of bits currently in the buffer - let buffer = 0 // Bits waiting to be written out, MSB first - let written = 0 // Next byte to write - for (let i = 0; i < end; ++i) { - // Read one character from the string: - const value = codes[string[i]] - if (value === undefined) { - throw new SyntaxError(`Non-${name} character`) - } + Object.keys(fn).forEach(function (k) { + wrapper[k] = fn[k] + }) - // Append the bits to the buffer: - buffer = (buffer << bitsPerChar) | value - bits += bitsPerChar + return wrapper - // Write out some bits if the buffer has a byte's worth: - if (bits >= 8) { - bits -= 8 - out[written++] = 0xff & (buffer >> bits) + function wrapper() { + var args = new Array(arguments.length) + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + var ret = fn.apply(this, args) + var cb = args[args.length-1] + if (typeof ret === 'function' && ret !== cb) { + Object.keys(cb).forEach(function (k) { + ret[k] = cb[k] + }) } + return ret } +} - // Verify that we have received just enough bits: - if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) { - throw new SyntaxError('Unexpected end of data') - } - return out -} +/***/ }), -/** - * @param {Uint8Array} data - * @param {string} alphabet - * @param {number} bitsPerChar - * @returns {string} - */ -const src_bases_base_encode = (data, alphabet, bitsPerChar) => { - const pad = alphabet[alphabet.length - 1] === '=' - const mask = (1 << bitsPerChar) - 1 - let out = '' +/***/ 81614: +/***/ ((module) => { - let bits = 0 // Number of bits currently in the buffer - let buffer = 0 // Bits waiting to be written out, MSB first - for (let i = 0; i < data.length; ++i) { - // Slurp data into the buffer: - buffer = (buffer << 8) | data[i] - bits += 8 +module.exports = eval("require")("electron"); - // Write out as much as we can: - while (bits > bitsPerChar) { - bits -= bitsPerChar - out += alphabet[mask & (buffer >> bits)] - } - } - // Partial character: - if (bits) { - out += alphabet[mask & (buffer << (bitsPerChar - bits))] - } +/***/ }), - // Add padding characters until we hit a byte boundary: - if (pad) { - while ((out.length * bitsPerChar) & 7) { - out += '=' - } - } +/***/ 39491: +/***/ ((module) => { - return out -} +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("assert"); -/** - * RFC4648 Factory - * - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {string} options.alphabet - * @param {number} options.bitsPerChar - */ -const src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { - return src_bases_base_from({ - prefix, - name, - encode (input) { - return src_bases_base_encode(input, alphabet, bitsPerChar) - }, - decode (input) { - return src_bases_base_decode(input, alphabet, bitsPerChar, name) - } - }) -} +/***/ }), -;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/src/bases/base64.js -// @ts-check +/***/ 50852: +/***/ ((module) => { +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("async_hooks"); +/***/ }), -const base64_base64 = src_bases_base_rfc4648({ - prefix: 'm', - name: 'base64', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', - bitsPerChar: 6 -}) +/***/ 14300: +/***/ ((module) => { -const base64_base64pad = src_bases_base_rfc4648({ - prefix: 'M', - name: 'base64pad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', - bitsPerChar: 6 -}) +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("buffer"); -const base64_base64url = src_bases_base_rfc4648({ - prefix: 'u', - name: 'base64url', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', - bitsPerChar: 6 -}) +/***/ }), -const base64_base64urlpad = src_bases_base_rfc4648({ - prefix: 'U', - name: 'base64urlpad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', - bitsPerChar: 6 -}) +/***/ 32081: +/***/ ((module) => { -;// CONCATENATED MODULE: ./node_modules/dag-jose/lib/utils.js +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("child_process"); -function toBase64url(b) { - return base64_base64url.encode(b).slice(1); -} -function fromBase64url(s) { - return base64_base64url.decode(`u${s}`); -} -//# sourceMappingURL=utils.js.map -;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/vendor/varint.js -var multiformats_vendor_varint_encode_1 = multiformats_vendor_varint_encode; +/***/ }), -var multiformats_vendor_varint_MSB = 0x80 - , multiformats_vendor_varint_REST = 0x7F - , multiformats_vendor_varint_MSBALL = ~multiformats_vendor_varint_REST - , multiformats_vendor_varint_INT = Math.pow(2, 31); +/***/ 96206: +/***/ ((module) => { -function multiformats_vendor_varint_encode(num, out, offset) { - out = out || []; - offset = offset || 0; - var oldOffset = offset; +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("console"); - while(num >= multiformats_vendor_varint_INT) { - out[offset++] = (num & 0xFF) | multiformats_vendor_varint_MSB; - num /= 128; - } - while(num & multiformats_vendor_varint_MSBALL) { - out[offset++] = (num & 0xFF) | multiformats_vendor_varint_MSB; - num >>>= 7; - } - out[offset] = num | 0; - - multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; - - return out -} +/***/ }), -var multiformats_vendor_varint_decode = multiformats_vendor_varint_read; +/***/ 22057: +/***/ ((module) => { -var multiformats_vendor_varint_MSB$1 = 0x80 - , multiformats_vendor_varint_REST$1 = 0x7F; +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("constants"); -function multiformats_vendor_varint_read(buf, offset) { - var res = 0 - , offset = offset || 0 - , shift = 0 - , counter = offset - , b - , l = buf.length; +/***/ }), - do { - if (counter >= l) { - multiformats_vendor_varint_read.bytes = 0; - throw new RangeError('Could not decode varint') - } - b = buf[counter++]; - res += shift < 28 - ? (b & multiformats_vendor_varint_REST$1) << shift - : (b & multiformats_vendor_varint_REST$1) * Math.pow(2, shift); - shift += 7; - } while (b >= multiformats_vendor_varint_MSB$1) +/***/ 6113: +/***/ ((module) => { - multiformats_vendor_varint_read.bytes = counter - offset; +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("crypto"); - return res -} +/***/ }), -var multiformats_vendor_varint_N1 = Math.pow(2, 7); -var multiformats_vendor_varint_N2 = Math.pow(2, 14); -var multiformats_vendor_varint_N3 = Math.pow(2, 21); -var multiformats_vendor_varint_N4 = Math.pow(2, 28); -var multiformats_vendor_varint_N5 = Math.pow(2, 35); -var multiformats_vendor_varint_N6 = Math.pow(2, 42); -var multiformats_vendor_varint_N7 = Math.pow(2, 49); -var multiformats_vendor_varint_N8 = Math.pow(2, 56); -var multiformats_vendor_varint_N9 = Math.pow(2, 63); +/***/ 67643: +/***/ ((module) => { -var multiformats_vendor_varint_length = function (value) { - return ( - value < multiformats_vendor_varint_N1 ? 1 - : value < multiformats_vendor_varint_N2 ? 2 - : value < multiformats_vendor_varint_N3 ? 3 - : value < multiformats_vendor_varint_N4 ? 4 - : value < multiformats_vendor_varint_N5 ? 5 - : value < multiformats_vendor_varint_N6 ? 6 - : value < multiformats_vendor_varint_N7 ? 7 - : value < multiformats_vendor_varint_N8 ? 8 - : value < multiformats_vendor_varint_N9 ? 9 - : 10 - ) -}; +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("diagnostics_channel"); -var multiformats_vendor_varint_varint = { - encode: multiformats_vendor_varint_encode_1 - , decode: multiformats_vendor_varint_decode - , encodingLength: multiformats_vendor_varint_length -}; +/***/ }), -var multiformats_vendor_varint_brrp_varint = multiformats_vendor_varint_varint; +/***/ 82361: +/***/ ((module) => { -<<<<<<< HEAD -/* harmony default export */ const multiformats_vendor_varint = (multiformats_vendor_varint_brrp_varint); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("events"); -;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/src/varint.js -======= -/***/ 12820: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ }), -const { create, globSource } = __nccwpck_require__(21719); -const PeerId = __nccwpck_require__(63923); -const last = __nccwpck_require__(28741); -const fsPath = __nccwpck_require__(71017); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +/***/ 57147: +/***/ ((module) => { +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs"); -/** - * @param {Uint8Array} data - * @param {number} [offset=0] - * @returns {[number, number]} - */ -const multiformats_src_varint_decode = (data, offset = 0) => { - const code = multiformats_vendor_varint.decode(data, offset) - return [code, multiformats_vendor_varint.decode.bytes] -} +/***/ }), -/** - * @param {number} int - * @param {Uint8Array} target - * @param {number} [offset=0] - */ -const multiformats_src_varint_encodeTo = (int, target, offset = 0) => { - multiformats_vendor_varint.encode(int, target, offset) - return target -} +/***/ 13685: +/***/ ((module) => { -/** - * @param {number} int - * @returns {number} - */ -const multiformats_src_varint_encodingLength = (int) => { - return multiformats_vendor_varint.encodingLength(int) -} +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http"); -;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/src/hashes/digest.js +/***/ }), +/***/ 85158: +/***/ ((module) => { +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http2"); -/** - * Creates a multihash digest. - * - * @template {number} Code - * @param {Code} code - * @param {Uint8Array} digest - */ -const multiformats_src_hashes_digest_create = (code, digest) => { - const size = digest.byteLength - const sizeOffset = multiformats_src_varint_encodingLength(code) - const digestOffset = sizeOffset + multiformats_src_varint_encodingLength(size) +/***/ }), - const bytes = new Uint8Array(digestOffset + size) - multiformats_src_varint_encodeTo(code, bytes, 0) - multiformats_src_varint_encodeTo(size, bytes, sizeOffset) - bytes.set(digest, digestOffset) +/***/ 95687: +/***/ ((module) => { - return new multiformats_src_hashes_digest_Digest(code, size, digest, bytes) -} +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("https"); -/** - * Turns bytes representation of multihash digest into an instance. - * - * @param {Uint8Array} multihash - * @returns {MultihashDigest} - */ -const multiformats_src_hashes_digest_decode = (multihash) => { - const bytes = multiformats_src_bytes_coerce(multihash) - const [code, sizeOffset] = multiformats_src_varint_decode(bytes) - const [size, digestOffset] = multiformats_src_varint_decode(bytes.subarray(sizeOffset)) - const digest = bytes.subarray(sizeOffset + digestOffset) +/***/ }), + +/***/ 41808: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("net"); + +/***/ }), - if (digest.byteLength !== size) { - throw new Error('Incorrect length') - } +/***/ 15673: +/***/ ((module) => { - return new multiformats_src_hashes_digest_Digest(code, size, digest, bytes) -} +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:events"); -/** - * @param {MultihashDigest} a - * @param {unknown} b - * @returns {b is MultihashDigest} - */ -const multiformats_src_hashes_digest_equals = (a, b) => { - if (a === b) { - return true - } else { - const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) +/***/ }), - return ( - a.code === data.code && - a.size === data.size && - data.bytes instanceof Uint8Array && - multiformats_src_bytes_equals(a.bytes, data.bytes) - ) - } -} +/***/ 84492: +/***/ ((module) => { -/** - * @typedef {import('./interface.js').MultihashDigest} MultihashDigest - */ +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream"); -/** - * Represents a multihash digest which carries information about the - * hashing algorithm and an actual hash digest. - * - * @template {number} Code - * @template {number} Size - * @class - * @implements {MultihashDigest} - */ -class multiformats_src_hashes_digest_Digest { - /** - * Creates a multihash digest. - * - * @param {Code} code - * @param {Size} size - * @param {Uint8Array} digest - * @param {Uint8Array} bytes - */ - constructor (code, size, digest, bytes) { - this.code = code - this.size = size - this.digest = digest - this.bytes = bytes - } -} +/***/ }), -;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/src/bases/base58.js +/***/ 47261: +/***/ ((module) => { +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:util"); -const multiformats_src_bases_base58_base58btc = src_bases_base_baseX({ - name: 'base58btc', - prefix: 'z', - alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -}) +/***/ }), -const src_bases_base58_base58flickr = src_bases_base_baseX({ - name: 'base58flickr', - prefix: 'Z', - alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -}) +/***/ 22037: +/***/ ((module) => { -;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/src/bases/base32.js +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("os"); +/***/ }), -const multiformats_src_bases_base32_base32 = src_bases_base_rfc4648({ - prefix: 'b', - name: 'base32', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567', - bitsPerChar: 5 -}) +/***/ 71017: +/***/ ((module) => { -const multiformats_src_bases_base32_base32upper = src_bases_base_rfc4648({ - prefix: 'B', - name: 'base32upper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', - bitsPerChar: 5 -}) +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("path"); -const src_bases_base32_base32pad = src_bases_base_rfc4648({ - prefix: 'c', - name: 'base32pad', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', - bitsPerChar: 5 -}) +/***/ }), -const src_bases_base32_base32padupper = src_bases_base_rfc4648({ - prefix: 'C', - name: 'base32padupper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', - bitsPerChar: 5 -}) +/***/ 4074: +/***/ ((module) => { -const src_bases_base32_base32hex = src_bases_base_rfc4648({ - prefix: 'v', - name: 'base32hex', - alphabet: '0123456789abcdefghijklmnopqrstuv', - bitsPerChar: 5 -}) +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("perf_hooks"); -const src_bases_base32_base32hexupper = src_bases_base_rfc4648({ - prefix: 'V', - name: 'base32hexupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', - bitsPerChar: 5 -}) +/***/ }), -const src_bases_base32_base32hexpad = src_bases_base_rfc4648({ - prefix: 't', - name: 'base32hexpad', - alphabet: '0123456789abcdefghijklmnopqrstuv=', - bitsPerChar: 5 -}) +/***/ 77282: +/***/ ((module) => { -const src_bases_base32_base32hexpadupper = src_bases_base_rfc4648({ - prefix: 'T', - name: 'base32hexpadupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', - bitsPerChar: 5 -}) +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("process"); -const src_bases_base32_base32z = src_bases_base_rfc4648({ - prefix: 'h', - name: 'base32z', - alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', - bitsPerChar: 5 -}) +/***/ }), -;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/src/cid.js +/***/ 63477: +/***/ ((module) => { +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("querystring"); +/***/ }), +/***/ 12781: +/***/ ((module) => { +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream"); -// Linter can see that API is used in types. -// eslint-disable-next-line +/***/ }), +/***/ 35356: +/***/ ((module) => { -// This way TS will also expose all the types from module +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream/web"); +/***/ }), -/** - * @template {API.Link} T - * @template {string} Prefix - * @param {T} link - * @param {API.MultibaseEncoder} [base] - * @returns {API.ToString} - */ -const multiformats_src_cid_format = (link, base) => { - const { bytes, version } = link - switch (version) { - case 0: - return multiformats_src_cid_toStringV0( - bytes, - multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder<"z">} */ (base) || multiformats_src_bases_base58_base58btc.encoder - ) - default: - return multiformats_src_cid_toStringV1( - bytes, - multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder} */ (base || multiformats_src_bases_base32_base32.encoder) - ) - } -} +/***/ 71576: +/***/ ((module) => { -/** - * @template {API.UnknownLink} Link - * @param {Link} link - * @returns {API.LinkJSON} - */ -const multiformats_src_cid_toJSON = (link) => ({ - '/': multiformats_src_cid_format(link) -}) +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("string_decoder"); -/** - * @template {API.UnknownLink} Link - * @param {API.LinkJSON} json - */ -const multiformats_src_cid_fromJSON = (json) => - multiformats_src_cid_CID.parse(json['/']) +/***/ }), -/** @type {WeakMap>} */ -const multiformats_src_cid_cache = new WeakMap() +/***/ 24404: +/***/ ((module) => { -/** - * @param {API.UnknownLink} cid - * @returns {Map} - */ -const multiformats_src_cid_baseCache = cid => { - const baseCache = multiformats_src_cid_cache.get(cid) - if (baseCache == null) { - const baseCache = new Map() - multiformats_src_cid_cache.set(cid, baseCache) - return baseCache - } - return baseCache -} +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("tls"); -/** - * @template {unknown} [Data=unknown] - * @template {number} [Format=number] - * @template {number} [Alg=number] - * @template {API.Version} [Version=API.Version] - * @implements {API.Link} - */ +/***/ }), -class multiformats_src_cid_CID { - /** - * @param {Version} version - Version of the CID - * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content. - * @param {Uint8Array} bytes - * - */ - constructor (version, code, multihash, bytes) { - /** @readonly */ - this.code = code - /** @readonly */ - this.version = version - /** @readonly */ - this.multihash = multihash - /** @readonly */ - this.bytes = bytes +/***/ 76224: +/***/ ((module) => { - // flag to serializers that this is a CID and - // should be treated specially - /** @readonly */ - this['/'] = bytes - } +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("tty"); - /** - * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` - * please either use `CID.asCID(cid)` or switch to new signalling mechanism - * - * @deprecated - */ - get asCID () { - return this - } +/***/ }), - // ArrayBufferView - get byteOffset () { - return this.bytes.byteOffset - } +/***/ 57310: +/***/ ((module) => { - // ArrayBufferView - get byteLength () { - return this.bytes.byteLength - } +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("url"); - /** - * @returns {CID} - */ - toV0 () { - switch (this.version) { - case 0: { - return /** @type {CID} */ (this) - } - case 1: { - const { code, multihash } = this +/***/ }), - if (code !== multiformats_src_cid_DAG_PB_CODE) { - throw new Error('Cannot convert a non dag-pb CID to CIDv0') - } +/***/ 73837: +/***/ ((module) => { - // sha2-256 - if (multihash.code !== multiformats_src_cid_SHA_256_CODE) { - throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') - } +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("util"); - return /** @type {CID} */ ( - multiformats_src_cid_CID.createV0( - /** @type {API.MultihashDigest} */ (multihash) - ) - ) - } - default: { - throw Error( - `Can not convert CID version ${this.version} to version 0. This is a bug please report` - ) - } - } - } +/***/ }), - /** - * @returns {CID} - */ - toV1 () { - switch (this.version) { - case 0: { - const { code, digest } = this.multihash - const multihash = multiformats_src_hashes_digest_create(code, digest) - return /** @type {CID} */ ( - multiformats_src_cid_CID.createV1(this.code, multihash) - ) - } - case 1: { - return /** @type {CID} */ (this) - } - default: { - throw Error( - `Can not convert CID version ${this.version} to version 1. This is a bug please report` - ) - } - } - } +/***/ 29830: +/***/ ((module) => { - /** - * @param {unknown} other - * @returns {other is CID} - */ - equals (other) { - return multiformats_src_cid_CID.equals(this, other) - } +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("util/types"); - /** - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @param {API.Link} self - * @param {unknown} other - * @returns {other is CID} - */ - static equals (self, other) { - const unknown = - /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ ( - other - ) - return ( - unknown && - self.code === unknown.code && - self.version === unknown.version && - multiformats_src_hashes_digest_equals(self.multihash, unknown.multihash) - ) - } +/***/ }), - /** - * @param {API.MultibaseEncoder} [base] - * @returns {string} - */ - toString (base) { - return multiformats_src_cid_format(this, base) - } +/***/ 71267: +/***/ ((module) => { - toJSON () { - return { '/': multiformats_src_cid_format(this) } - } +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("worker_threads"); - link () { - return this - } +/***/ }), - get [Symbol.toStringTag] () { - return 'CID' - } +/***/ 59796: +/***/ ((module) => { - // Legacy +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("zlib"); - [Symbol.for('nodejs.util.inspect.custom')] () { - return `CID(${this.toString()})` - } +/***/ }), - /** - * Takes any input `value` and returns a `CID` instance if it was - * a `CID` otherwise returns `null`. If `value` is instanceof `CID` - * it will return value back. If `value` is not instance of this CID - * class, but is compatible CID it will return new instance of this - * `CID` class. Otherwise returns null. - * - * This allows two different incompatible versions of CID library to - * co-exist and interop as long as binary interface is compatible. - * - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @template {unknown} U - * @param {API.Link|U} input - * @returns {CID|null} - */ - static asCID (input) { - if (input == null) { - return null - } +/***/ 84636: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const value = /** @type {any} */ (input) - if (value instanceof multiformats_src_cid_CID) { - // If value is instance of CID then we're all set. - return value - } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { - // If value isn't instance of this CID class but `this.asCID === this` or - // `value['/'] === value.bytes` is true it is CID instance coming from a - // different implementation (diff version or duplicate). In that case we - // rebase it to this `CID` implementation so caller is guaranteed to get - // instance with expected API. - const { version, code, multihash, bytes } = value - return new multiformats_src_cid_CID( - version, - code, - /** @type {API.MultihashDigest} */ (multihash), - bytes || multiformats_src_cid_encodeCID(version, code, multihash.bytes) - ) - } else if (value[multiformats_src_cid_cidSymbol] === true) { - // If value is a CID from older implementation that used to be tagged via - // symbol we still rebase it to the this `CID` implementation by - // delegating that to a constructor. - const { version, multihash, code } = value - const digest = - /** @type {API.MultihashDigest} */ - (multiformats_src_hashes_digest_decode(multihash)) - return multiformats_src_cid_CID.create(version, code, digest) - } else { - // Otherwise value is not a CID (or an incompatible version of it) in - // which case we return `null`. - return null - } - } - /** - * - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @param {Version} version - Version of the CID - * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param {API.MultihashDigest} digest - (Multi)hash of the of the content. - * @returns {CID} - */ - static create (version, code, digest) { - if (typeof code !== 'number') { - throw new Error('String codecs are no longer supported') - } - if (!(digest.bytes instanceof Uint8Array)) { - throw new Error('Invalid digest') - } +const WritableStream = (__nccwpck_require__(84492).Writable) +const inherits = (__nccwpck_require__(47261).inherits) - switch (version) { - case 0: { - if (code !== multiformats_src_cid_DAG_PB_CODE) { - throw new Error( - `Version 0 CID must use dag-pb (code: ${multiformats_src_cid_DAG_PB_CODE}) block encoding` - ) - } else { - return new multiformats_src_cid_CID(version, code, digest, digest.bytes) - } - } - case 1: { - const bytes = multiformats_src_cid_encodeCID(version, code, digest.bytes) - return new multiformats_src_cid_CID(version, code, digest, bytes) - } - default: { - throw new Error('Invalid version') - } - } - } +const StreamSearch = __nccwpck_require__(10807) - /** - * Simplified version of `create` for CIDv0. - * - * @template {unknown} [T=unknown] - * @param {API.MultihashDigest} digest - Multihash. - * @returns {CID} - */ - static createV0 (digest) { - return multiformats_src_cid_CID.create(0, multiformats_src_cid_DAG_PB_CODE, digest) - } +const PartStream = __nccwpck_require__(45970) +const HeaderParser = __nccwpck_require__(97848) - /** - * Simplified version of `create` for CIDv1. - * - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @param {Code} code - Content encoding format code. - * @param {API.MultihashDigest} digest - Miltihash of the content. - * @returns {CID} - */ - static createV1 (code, digest) { - return multiformats_src_cid_CID.create(1, code, digest) - } +const DASH = 45 +const B_ONEDASH = Buffer.from('-') +const B_CRLF = Buffer.from('\r\n') +const EMPTY_FN = function () {} - /** - * Decoded a CID from its binary representation. The byte array must contain - * only the CID with no additional bytes. - * - * An error will be thrown if the bytes provided do not contain a valid - * binary representation of a CID. - * - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ByteView>} bytes - * @returns {CID} - */ - static decode (bytes) { - const [cid, remainder] = multiformats_src_cid_CID.decodeFirst(bytes) - if (remainder.length) { - throw new Error('Incorrect length') - } - return cid - } +function Dicer (cfg) { + if (!(this instanceof Dicer)) { return new Dicer(cfg) } + WritableStream.call(this, cfg) - /** - * Decoded a CID from its binary representation at the beginning of a byte - * array. - * - * Returns an array with the first element containing the CID and the second - * element containing the remainder of the original byte array. The remainder - * will be a zero-length byte array if the provided bytes only contained a - * binary CID representation. - * - * @template {unknown} T - * @template {number} C - * @template {number} A - * @template {API.Version} V - * @param {API.ByteView>} bytes - * @returns {[CID, Uint8Array]} - */ - static decodeFirst (bytes) { - const specs = multiformats_src_cid_CID.inspectBytes(bytes) - const prefixSize = specs.size - specs.multihashSize - const multihashBytes = multiformats_src_bytes_coerce( - bytes.subarray(prefixSize, prefixSize + specs.multihashSize) - ) - if (multihashBytes.byteLength !== specs.multihashSize) { - throw new Error('Incorrect length') - } - const digestBytes = multihashBytes.subarray( - specs.multihashSize - specs.digestSize - ) - const digest = new multiformats_src_hashes_digest_Digest( - specs.multihashCode, - specs.digestSize, - digestBytes, - multihashBytes - ) - const cid = - specs.version === 0 - ? multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) - : multiformats_src_cid_CID.createV1(specs.codec, digest) - return [/** @type {CID} */(cid), bytes.subarray(specs.size)] - } + if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') } - /** - * Inspect the initial bytes of a CID to determine its properties. - * - * Involves decoding up to 4 varints. Typically this will require only 4 to 6 - * bytes but for larger multicodec code values and larger multihash digest - * lengths these varints can be quite large. It is recommended that at least - * 10 bytes be made available in the `initialBytes` argument for a complete - * inspection. - * - * @template {unknown} T - * @template {number} C - * @template {number} A - * @template {API.Version} V - * @param {API.ByteView>} initialBytes - * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }} - */ - static inspectBytes (initialBytes) { - let offset = 0 - const next = () => { - const [i, length] = multiformats_src_varint_decode(initialBytes.subarray(offset)) - offset += length - return i - } + if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined } - let version = /** @type {V} */ (next()) - let codec = /** @type {C} */ (multiformats_src_cid_DAG_PB_CODE) - if (/** @type {number} */(version) === 18) { - // CIDv0 - version = /** @type {V} */ (0) - offset = 0 - } else { - codec = /** @type {C} */ (next()) - } + this._headerFirst = cfg.headerFirst - if (version !== 0 && version !== 1) { - throw new RangeError(`Invalid CID version ${version}`) + this._dashes = 0 + this._parts = 0 + this._finished = false + this._realFinish = false + this._isPreamble = true + this._justMatched = false + this._firstWrite = true + this._inHeader = true + this._part = undefined + this._cb = undefined + this._ignoreData = false + this._partOpts = { highWaterMark: cfg.partHwm } + this._pause = false + + const self = this + this._hparser = new HeaderParser(cfg) + this._hparser.on('header', function (header) { + self._inHeader = false + self._part.emit('header', header) + }) +} +inherits(Dicer, WritableStream) + +Dicer.prototype.emit = function (ev) { + if (ev === 'finish' && !this._realFinish) { + if (!this._finished) { + const self = this + process.nextTick(function () { + self.emit('error', new Error('Unexpected end of multipart data')) + if (self._part && !self._ignoreData) { + const type = (self._isPreamble ? 'Preamble' : 'Part') + self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data')) + self._part.push(null) + process.nextTick(function () { + self._realFinish = true + self.emit('finish') + self._realFinish = false + }) + return + } + self._realFinish = true + self.emit('finish') + self._realFinish = false + }) } + } else { WritableStream.prototype.emit.apply(this, arguments) } +} - const prefixSize = offset - const multihashCode = /** @type {A} */ (next()) // multihash code - const digestSize = next() // multihash length - const size = offset + digestSize - const multihashSize = size - prefixSize +Dicer.prototype._write = function (data, encoding, cb) { + // ignore unexpected data (e.g. extra trailer data after finished) + if (!this._hparser && !this._bparser) { return cb() } - return { version, codec, multihashCode, digestSize, multihashSize, size } + if (this._headerFirst && this._isPreamble) { + if (!this._part) { + this._part = new PartStream(this._partOpts) + if (this._events.preamble) { this.emit('preamble', this._part) } else { this._ignore() } + } + const r = this._hparser.push(data) + if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() } } - /** - * Takes cid in a string representation and creates an instance. If `base` - * decoder is not provided will use a default from the configuration. It will - * throw an error if encoding of the CID is not compatible with supplied (or - * a default decoder). - * - * @template {string} Prefix - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ToString, Prefix>} source - * @param {API.MultibaseDecoder} [base] - * @returns {CID} - */ - static parse (source, base) { - const [prefix, bytes] = multiformats_src_cid_parseCIDtoBytes(source, base) + // allows for "easier" testing + if (this._firstWrite) { + this._bparser.push(B_CRLF) + this._firstWrite = false + } - const cid = multiformats_src_cid_CID.decode(bytes) + this._bparser.push(data) - if (cid.version === 0 && source[0] !== 'Q') { - throw Error('Version 0 CID string must not include multibase prefix') - } + if (this._pause) { this._cb = cb } else { cb() } +} - // Cache string representation to avoid computing it on `this.toString()` - multiformats_src_cid_baseCache(cid).set(prefix, source) +Dicer.prototype.reset = function () { + this._part = undefined + this._bparser = undefined + this._hparser = undefined +} - return cid +Dicer.prototype.setBoundary = function (boundary) { + const self = this + this._bparser = new StreamSearch('\r\n--' + boundary) + this._bparser.on('info', function (isMatch, data, start, end) { + self._oninfo(isMatch, data, start, end) + }) +} + +Dicer.prototype._ignore = function () { + if (this._part && !this._ignoreData) { + this._ignoreData = true + this._part.on('error', EMPTY_FN) + // we must perform some kind of read on the stream even though we are + // ignoring the data, otherwise node's Readable stream will not emit 'end' + // after pushing null to the stream + this._part.resume() } } -/** - * @template {string} Prefix - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ToString, Prefix>} source - * @param {API.MultibaseDecoder} [base] - * @returns {[Prefix, API.ByteView>]} - */ -const multiformats_src_cid_parseCIDtoBytes = (source, base) => { - switch (source[0]) { - // CIDv0 is parsed differently - case 'Q': { - const decoder = base || multiformats_src_bases_base58_base58btc - return [ - /** @type {Prefix} */ (multiformats_src_bases_base58_base58btc.prefix), - decoder.decode(`${multiformats_src_bases_base58_base58btc.prefix}${source}`) - ] +Dicer.prototype._oninfo = function (isMatch, data, start, end) { + let buf; const self = this; let i = 0; let r; let shouldWriteMore = true + + if (!this._part && this._justMatched && data) { + while (this._dashes < 2 && (start + i) < end) { + if (data[start + i] === DASH) { + ++i + ++this._dashes + } else { + if (this._dashes) { buf = B_ONEDASH } + this._dashes = 0 + break + } } - case multiformats_src_bases_base58_base58btc.prefix: { - const decoder = base || multiformats_src_bases_base58_base58btc - return [/** @type {Prefix} */(multiformats_src_bases_base58_base58btc.prefix), decoder.decode(source)] + if (this._dashes === 2) { + if ((start + i) < end && this._events.trailer) { this.emit('trailer', data.slice(start + i, end)) } + this.reset() + this._finished = true + // no more parts will be added + if (self._parts === 0) { + self._realFinish = true + self.emit('finish') + self._realFinish = false + } } - case multiformats_src_bases_base32_base32.prefix: { - const decoder = base || multiformats_src_bases_base32_base32 - return [/** @type {Prefix} */(multiformats_src_bases_base32_base32.prefix), decoder.decode(source)] + if (this._dashes) { return } + } + if (this._justMatched) { this._justMatched = false } + if (!this._part) { + this._part = new PartStream(this._partOpts) + this._part._read = function (n) { + self._unpause() } - default: { - if (base == null) { - throw Error( - 'To parse non base32 or base58btc encoded CID multibase decoder must be provided' - ) + if (this._isPreamble && this._events.preamble) { this.emit('preamble', this._part) } else if (this._isPreamble !== true && this._events.part) { this.emit('part', this._part) } else { this._ignore() } + if (!this._isPreamble) { this._inHeader = true } + } + if (data && start < end && !this._ignoreData) { + if (this._isPreamble || !this._inHeader) { + if (buf) { shouldWriteMore = this._part.push(buf) } + shouldWriteMore = this._part.push(data.slice(start, end)) + if (!shouldWriteMore) { this._pause = true } + } else if (!this._isPreamble && this._inHeader) { + if (buf) { this._hparser.push(buf) } + r = this._hparser.push(data.slice(start, end)) + if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) } + } + } + if (isMatch) { + this._hparser.reset() + if (this._isPreamble) { this._isPreamble = false } else { + if (start !== end) { + ++this._parts + this._part.on('end', function () { + if (--self._parts === 0) { + if (self._finished) { + self._realFinish = true + self.emit('finish') + self._realFinish = false + } else { + self._unpause() + } + } + }) } - return [/** @type {Prefix} */(source[0]), base.decode(source)] } + this._part.push(null) + this._part = undefined + this._ignoreData = false + this._justMatched = true + this._dashes = 0 } } -/** - * - * @param {Uint8Array} bytes - * @param {Map} cache - * @param {API.MultibaseEncoder<'z'>} base - */ -const multiformats_src_cid_toStringV0 = (bytes, cache, base) => { - const { prefix } = base - if (prefix !== multiformats_src_bases_base58_base58btc.prefix) { - throw Error(`Cannot string encode V0 in ${base.name} encoding`) - } +Dicer.prototype._unpause = function () { + if (!this._pause) { return } - const cid = cache.get(prefix) - if (cid == null) { - const cid = base.encode(bytes).slice(1) - cache.set(prefix, cid) - return cid - } else { - return cid + this._pause = false + if (this._cb) { + const cb = this._cb + this._cb = undefined + cb() } } -/** - * @template {string} Prefix - * @param {Uint8Array} bytes - * @param {Map} cache - * @param {API.MultibaseEncoder} base - */ -const multiformats_src_cid_toStringV1 = (bytes, cache, base) => { - const { prefix } = base - const cid = cache.get(prefix) - if (cid == null) { - const cid = base.encode(bytes) - cache.set(prefix, cid) - return cid - } else { - return cid - } -} +module.exports = Dicer -const multiformats_src_cid_DAG_PB_CODE = 0x70 -const multiformats_src_cid_SHA_256_CODE = 0x12 -/** - * @param {API.Version} version - * @param {number} code - * @param {Uint8Array} multihash - * @returns {Uint8Array} - */ -const multiformats_src_cid_encodeCID = (version, code, multihash) => { - const codeOffset = multiformats_src_varint_encodingLength(version) - const hashOffset = codeOffset + multiformats_src_varint_encodingLength(code) - const bytes = new Uint8Array(hashOffset + multihash.byteLength) - multiformats_src_varint_encodeTo(version, bytes, 0) - multiformats_src_varint_encodeTo(code, bytes, codeOffset) - bytes.set(multihash, hashOffset) - return bytes -} +/***/ }), -const multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') +/***/ 97848: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -;// CONCATENATED MODULE: ./node_modules/dag-jose/lib/signing.js -function fromSplit(split) { - const [protectedHeader, payload, signature] = split; - return { - payload, - signatures: [{ protected: protectedHeader, signature }], - link: multiformats_src_cid_CID.decode(fromBase64url(payload)), - }; -} -function encodeSignature(signature) { - const encoded = { - signature: fromBase64url(signature.signature), - }; - if (signature.header) - encoded.header = signature.header; - if (signature.protected) - encoded.protected = fromBase64url(signature.protected); - return encoded; -} -function signing_encode(jws) { - const payload = fromBase64url(jws.payload); - try { - multiformats_src_cid_CID.decode(payload); - } - catch (e) { - throw new Error('Not a valid DagJWS'); - } - return { - payload, - signatures: jws.signatures.map(encodeSignature), - }; -} -function decodeSignature(encoded) { - const sign = { - signature: toBase64url(encoded.signature), - }; - if (encoded.header) - sign.header = encoded.header; - if (encoded.protected) - sign.protected = toBase64url(encoded.protected); - return sign; -} -function signing_decode(encoded) { - const decoded = { - payload: toBase64url(encoded.payload), - signatures: encoded.signatures.map(decodeSignature), - }; - decoded.link = multiformats_src_cid_CID.decode(new Uint8Array(encoded.payload)); - return decoded; -} -//# sourceMappingURL=signing.js.map -;// CONCATENATED MODULE: ./node_modules/dag-jose/lib/encryption.js +const EventEmitter = (__nccwpck_require__(15673).EventEmitter) +const inherits = (__nccwpck_require__(47261).inherits) +const getLimit = __nccwpck_require__(59149) -function encryption_fromSplit(split) { - const [protectedHeader, encrypted_key, iv, ciphertext, tag] = split; - const jwe = { - ciphertext, - iv, - protected: protectedHeader, - tag, - }; - if (encrypted_key) - jwe.recipients = [{ encrypted_key }]; - return jwe; -} -function encodeRecipient(recipient) { - const encRec = {}; - if (recipient.encrypted_key) - encRec.encrypted_key = fromBase64url(recipient.encrypted_key); - if (recipient.header) - encRec.header = recipient.header; - return encRec; -} -function encryption_encode(jwe) { - const encJwe = { - ciphertext: fromBase64url(jwe.ciphertext), - protected: fromBase64url(jwe.protected), - iv: fromBase64url(jwe.iv), - tag: fromBase64url(jwe.tag), - }; - if (jwe.aad) - encJwe.aad = fromBase64url(jwe.aad); - if (jwe.recipients) - encJwe.recipients = jwe.recipients.map(encodeRecipient); - if (jwe.unprotected) - encJwe.unprotected = jwe.unprotected; - return encJwe; -} -function decodeRecipient(encoded) { - const recipient = {}; - if (encoded.encrypted_key) - recipient.encrypted_key = toBase64url(encoded.encrypted_key); - if (encoded.header) - recipient.header = encoded.header; - return recipient; -} -function encryption_decode(encoded) { - const jwe = { - ciphertext: toBase64url(encoded.ciphertext), - protected: toBase64url(encoded.protected), - iv: toBase64url(encoded.iv), - tag: toBase64url(encoded.tag), - }; - if (encoded.aad) - jwe.aad = toBase64url(encoded.aad); - if (encoded.recipients) - jwe.recipients = encoded.recipients.map(decodeRecipient); - if (encoded.unprotected) - jwe.unprotected = encoded.unprotected; - return jwe; -} -//# sourceMappingURL=encryption.js.map -;// CONCATENATED MODULE: ./node_modules/dag-jose/lib/index.js +const StreamSearch = __nccwpck_require__(10807) + +const B_DCRLF = Buffer.from('\r\n\r\n') +const RE_CRLF = /\r\n/g +const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex +function HeaderParser (cfg) { + EventEmitter.call(this) + cfg = cfg || {} + const self = this + this.nread = 0 + this.maxed = false + this.npairs = 0 + this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000) + this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024) + this.buffer = '' + this.header = {} + this.finished = false + this.ss = new StreamSearch(B_DCRLF) + this.ss.on('info', function (isMatch, data, start, end) { + if (data && !self.maxed) { + if (self.nread + end - start >= self.maxHeaderSize) { + end = self.maxHeaderSize - self.nread + start + self.nread = self.maxHeaderSize + self.maxed = true + } else { self.nread += (end - start) } -const lib_name = 'dag-jose'; -const lib_code = 133; -function isDagJWS(jose) { - return ('payload' in jose && - typeof jose.payload === 'string' && - 'signatures' in jose && - Array.isArray(jose.signatures)); -} -function isEncodedJWS(jose) { - return ('payload' in jose && - jose.payload instanceof Uint8Array && - 'signatures' in jose && - Array.isArray(jose.signatures)); -} -function isEncodedJWE(jose) { - return ('ciphertext' in jose && - jose.ciphertext instanceof Uint8Array && - 'iv' in jose && - jose.iv instanceof Uint8Array && - 'protected' in jose && - jose.protected instanceof Uint8Array && - 'tag' in jose && - jose.tag instanceof Uint8Array); + self.buffer += data.toString('binary', start, end) + } + if (isMatch) { self._finish() } + }) } -function isDagJWE(jose) { - return ('ciphertext' in jose && - typeof jose.ciphertext === 'string' && - 'iv' in jose && - typeof jose.iv === 'string' && - 'protected' in jose && - typeof jose.protected === 'string' && - 'tag' in jose && - typeof jose.tag === 'string'); +inherits(HeaderParser, EventEmitter) + +HeaderParser.prototype.push = function (data) { + const r = this.ss.push(data) + if (this.finished) { return r } } -function toGeneral(jose) { - if (typeof jose === 'string') { - const split = jose.split('.'); - if (split.length === 3) { - return fromSplit(split); - } - else if (split.length === 5) { - return encryption_fromSplit(split); - } - throw new Error('Not a valid JOSE string'); - } - if (isDagJWS(jose) || isDagJWE(jose)) { - return jose; - } - throw new Error('Not a valid unencoded JOSE object'); + +HeaderParser.prototype.reset = function () { + this.finished = false + this.buffer = '' + this.header = {} + this.ss.reset() } -function lib_encode(obj) { - if (typeof obj === 'string') { - obj = toGeneral(obj); - } - let encodedJose; - if (isDagJWS(obj)) { - encodedJose = signing_encode(obj); - } - else if (isDagJWE(obj)) { - encodedJose = encryption_encode(obj); - } - else { - throw new Error('Not a valid JOSE object'); - } - return new Uint8Array(dag_cbor_src_encode(encodedJose)); + +HeaderParser.prototype._finish = function () { + if (this.buffer) { this._parseHeader() } + this.ss.matches = this.ss.maxMatches + const header = this.header + this.header = {} + this.buffer = '' + this.finished = true + this.nread = this.npairs = 0 + this.maxed = false + this.emit('header', header) } -function lib_decode(data) { - let encoded; - try { - encoded = dag_cbor_src_decode(data); - } - catch (e) { - throw new Error('Not a valid DAG-JOSE object'); - } - if (isEncodedJWS(encoded)) { - return signing_decode(encoded); - } - else if (isEncodedJWE(encoded)) { - return encryption_decode(encoded); + +HeaderParser.prototype._parseHeader = function () { + if (this.npairs === this.maxHeaderPairs) { return } + + const lines = this.buffer.split(RE_CRLF) + const len = lines.length + let m, h + + for (var i = 0; i < len; ++i) { // eslint-disable-line no-var + if (lines[i].length === 0) { continue } + if (lines[i][0] === '\t' || lines[i][0] === ' ') { + // folded header content + // RFC2822 says to just remove the CRLF and not the whitespace following + // it, so we follow the RFC and include the leading whitespace ... + if (h) { + this.header[h][this.header[h].length - 1] += lines[i] + continue + } } - else { - throw new Error('Not a valid DAG-JOSE object'); + + const posColon = lines[i].indexOf(':') + if ( + posColon === -1 || + posColon === 0 + ) { + return } + m = RE_HDR.exec(lines[i]) + h = m[1].toLowerCase() + this.header[h] = this.header[h] || [] + this.header[h].push((m[2] || '')) + if (++this.npairs === this.maxHeaderPairs) { break } + } } -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bytes.js -const node_modules_multiformats_src_bytes_empty = new Uint8Array(0) -/** - * @param {Uint8Array} d - */ -const node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') +module.exports = HeaderParser -/** - * @param {string} hex - */ -const node_modules_multiformats_src_bytes_fromHex = hex => { - const hexes = hex.match(/../g) - return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : node_modules_multiformats_src_bytes_empty -} -/** - * @param {Uint8Array} aa - * @param {Uint8Array} bb - */ -const node_modules_multiformats_src_bytes_equals = (aa, bb) => { - if (aa === bb) return true - if (aa.byteLength !== bb.byteLength) { - return false - } +/***/ }), - for (let ii = 0; ii < aa.byteLength; ii++) { - if (aa[ii] !== bb[ii]) { - return false - } - } +/***/ 45970: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return true -} -/** - * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o - * @returns {Uint8Array} - */ -const node_modules_multiformats_src_bytes_coerce = o => { - if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o - if (o instanceof ArrayBuffer) return new Uint8Array(o) - if (ArrayBuffer.isView(o)) { - return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) - } - throw new Error('Unknown type, must be binary type') + +const inherits = (__nccwpck_require__(47261).inherits) +const ReadableStream = (__nccwpck_require__(84492).Readable) + +function PartStream (opts) { + ReadableStream.call(this, opts) } +inherits(PartStream, ReadableStream) + +PartStream.prototype._read = function (n) {} + +module.exports = PartStream + + +/***/ }), + +/***/ 10807: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * @param {any} o - * @returns {o is ArrayBuffer|ArrayBufferView} - */ -const node_modules_multiformats_src_bytes_isBinary = o => - o instanceof ArrayBuffer || ArrayBuffer.isView(o) -/** - * @param {string} str - * @returns {Uint8Array} - */ -const node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) /** - * @param {Uint8Array} b - * @returns {string} + * Copyright Brian White. All rights reserved. + * + * @see https://github.com/mscdex/streamsearch + * + * 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. + * + * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation + * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool */ -const node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) +const EventEmitter = (__nccwpck_require__(15673).EventEmitter) +const inherits = (__nccwpck_require__(47261).inherits) +function SBMH (needle) { + if (typeof needle === 'string') { + needle = Buffer.from(needle) + } + if (!Buffer.isBuffer(needle)) { + throw new TypeError('The needle has to be a String or a Buffer.') + } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/vendor/varint.js -var node_modules_multiformats_vendor_varint_encode_1 = node_modules_multiformats_vendor_varint_encode; + const needleLength = needle.length -var node_modules_multiformats_vendor_varint_MSB = 0x80 - , node_modules_multiformats_vendor_varint_REST = 0x7F - , node_modules_multiformats_vendor_varint_MSBALL = ~node_modules_multiformats_vendor_varint_REST - , node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31); + if (needleLength === 0) { + throw new Error('The needle cannot be an empty String/Buffer.') + } -function node_modules_multiformats_vendor_varint_encode(num, out, offset) { - out = out || []; - offset = offset || 0; - var oldOffset = offset; + if (needleLength > 256) { + throw new Error('The needle cannot have a length bigger than 256.') + } - while(num >= node_modules_multiformats_vendor_varint_INT) { - out[offset++] = (num & 0xFF) | node_modules_multiformats_vendor_varint_MSB; - num /= 128; + this.maxMatches = Infinity + this.matches = 0 + + this._occ = new Array(256) + .fill(needleLength) // Initialize occurrence table. + this._lookbehind_size = 0 + this._needle = needle + this._bufpos = 0 + + this._lookbehind = Buffer.alloc(needleLength) + + // Populate occurrence table with analysis of the needle, + // ignoring last letter. + for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var + this._occ[needle[i]] = needleLength - 1 - i } - while(num & node_modules_multiformats_vendor_varint_MSBALL) { - out[offset++] = (num & 0xFF) | node_modules_multiformats_vendor_varint_MSB; - num >>>= 7; +} +inherits(SBMH, EventEmitter) + +SBMH.prototype.reset = function () { + this._lookbehind_size = 0 + this.matches = 0 + this._bufpos = 0 +} + +SBMH.prototype.push = function (chunk, pos) { + if (!Buffer.isBuffer(chunk)) { + chunk = Buffer.from(chunk, 'binary') } - out[offset] = num | 0; - - node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; - - return out + const chlen = chunk.length + this._bufpos = pos || 0 + let r + while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) } + return r } -var node_modules_multiformats_vendor_varint_decode = node_modules_multiformats_vendor_varint_read; +SBMH.prototype._sbmh_feed = function (data) { + const len = data.length + const needle = this._needle + const needleLength = needle.length + const lastNeedleChar = needle[needleLength - 1] -var node_modules_multiformats_vendor_varint_MSB$1 = 0x80 - , node_modules_multiformats_vendor_varint_REST$1 = 0x7F; + // Positive: points to a position in `data` + // pos == 3 points to data[3] + // Negative: points to a position in the lookbehind buffer + // pos == -2 points to lookbehind[lookbehind_size - 2] + let pos = -this._lookbehind_size + let ch -function node_modules_multiformats_vendor_varint_read(buf, offset) { - var res = 0 - , offset = offset || 0 - , shift = 0 - , counter = offset - , b - , l = buf.length; + if (pos < 0) { + // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool + // search with character lookup code that considers both the + // lookbehind buffer and the current round's haystack data. + // + // Loop until + // there is a match. + // or until + // we've moved past the position that requires the + // lookbehind buffer. In this case we switch to the + // optimized loop. + // or until + // the character to look at lies outside the haystack. + while (pos < 0 && pos <= len - needleLength) { + ch = this._sbmh_lookup_char(data, pos + needleLength - 1) - do { - if (counter >= l) { - node_modules_multiformats_vendor_varint_read.bytes = 0; - throw new RangeError('Could not decode varint') + if ( + ch === lastNeedleChar && + this._sbmh_memcmp(data, pos, needleLength - 1) + ) { + this._lookbehind_size = 0 + ++this.matches + this.emit('info', true) + + return (this._bufpos = pos + needleLength) + } + pos += this._occ[ch] } - b = buf[counter++]; - res += shift < 28 - ? (b & node_modules_multiformats_vendor_varint_REST$1) << shift - : (b & node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift); - shift += 7; - } while (b >= node_modules_multiformats_vendor_varint_MSB$1) - node_modules_multiformats_vendor_varint_read.bytes = counter - offset; + // No match. - return res -} + if (pos < 0) { + // There's too few data for Boyer-Moore-Horspool to run, + // so let's use a different algorithm to skip as much as + // we can. + // Forward pos until + // the trailing part of lookbehind + data + // looks like the beginning of the needle + // or until + // pos == 0 + while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos } + } -var node_modules_multiformats_vendor_varint_N1 = Math.pow(2, 7); -var node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14); -var node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21); -var node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28); -var node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35); -var node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42); -var node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49); -var node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56); -var node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63); + if (pos >= 0) { + // Discard lookbehind buffer. + this.emit('info', false, this._lookbehind, 0, this._lookbehind_size) + this._lookbehind_size = 0 + } else { + // Cut off part of the lookbehind buffer that has + // been processed and append the entire haystack + // into it. + const bytesToCutOff = this._lookbehind_size + pos + if (bytesToCutOff > 0) { + // The cut off data is guaranteed not to contain the needle. + this.emit('info', false, this._lookbehind, 0, bytesToCutOff) + } -var node_modules_multiformats_vendor_varint_length = function (value) { - return ( - value < node_modules_multiformats_vendor_varint_N1 ? 1 - : value < node_modules_multiformats_vendor_varint_N2 ? 2 - : value < node_modules_multiformats_vendor_varint_N3 ? 3 - : value < node_modules_multiformats_vendor_varint_N4 ? 4 - : value < node_modules_multiformats_vendor_varint_N5 ? 5 - : value < node_modules_multiformats_vendor_varint_N6 ? 6 - : value < node_modules_multiformats_vendor_varint_N7 ? 7 - : value < node_modules_multiformats_vendor_varint_N8 ? 8 - : value < node_modules_multiformats_vendor_varint_N9 ? 9 - : 10 - ) -}; + this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff, + this._lookbehind_size - bytesToCutOff) + this._lookbehind_size -= bytesToCutOff -var node_modules_multiformats_vendor_varint_varint = { - encode: node_modules_multiformats_vendor_varint_encode_1 - , decode: node_modules_multiformats_vendor_varint_decode - , encodingLength: node_modules_multiformats_vendor_varint_length -}; + data.copy(this._lookbehind, this._lookbehind_size) + this._lookbehind_size += len -var node_modules_multiformats_vendor_varint_brrp_varint = node_modules_multiformats_vendor_varint_varint; + this._bufpos = len + return len + } + } -/* harmony default export */ const node_modules_multiformats_vendor_varint = (node_modules_multiformats_vendor_varint_brrp_varint); + pos += (pos >= 0) * this._bufpos -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/varint.js + // Lookbehind buffer is now empty. We only need to check if the + // needle is in the haystack. + if (data.indexOf(needle, pos) !== -1) { + pos = data.indexOf(needle, pos) + ++this.matches + if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) } + return (this._bufpos = pos + needleLength) + } else { + pos = len - needleLength + } -/** - * @param {Uint8Array} data - * @param {number} [offset=0] - * @returns {[number, number]} - */ -const node_modules_multiformats_src_varint_decode = (data, offset = 0) => { - const code = node_modules_multiformats_vendor_varint.decode(data, offset) - return [code, node_modules_multiformats_vendor_varint.decode.bytes] + // There was no match. If there's trailing haystack data that we cannot + // match yet using the Boyer-Moore-Horspool algorithm (because the trailing + // data is less than the needle size) then match using a modified + // algorithm that starts matching from the beginning instead of the end. + // Whatever trailing data is left after running this algorithm is added to + // the lookbehind buffer. + while ( + pos < len && + ( + data[pos] !== needle[0] || + ( + (Buffer.compare( + data.subarray(pos, pos + len - pos), + needle.subarray(0, len - pos) + ) !== 0) + ) + ) + ) { + ++pos + } + if (pos < len) { + data.copy(this._lookbehind, 0, pos, pos + (len - pos)) + this._lookbehind_size = len - pos + } + + // Everything until pos is guaranteed not to contain needle data. + if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) } + + this._bufpos = len + return len } -/** - * @param {number} int - * @param {Uint8Array} target - * @param {number} [offset=0] - */ -const node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => { - node_modules_multiformats_vendor_varint.encode(int, target, offset) - return target +SBMH.prototype._sbmh_lookup_char = function (data, pos) { + return (pos < 0) + ? this._lookbehind[this._lookbehind_size + pos] + : data[pos] } -/** - * @param {number} int - * @returns {number} - */ -const node_modules_multiformats_src_varint_encodingLength = (int) => { - return node_modules_multiformats_vendor_varint.encodingLength(int) +SBMH.prototype._sbmh_memcmp = function (data, pos, len) { + for (var i = 0; i < len; ++i) { // eslint-disable-line no-var + if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false } + } + return true } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/hashes/digest.js +module.exports = SBMH +/***/ }), -/** - * Creates a multihash digest. - * - * @template {number} Code - * @param {Code} code - * @param {Uint8Array} digest - */ -const node_modules_multiformats_src_hashes_digest_create = (code, digest) => { - const size = digest.byteLength - const sizeOffset = node_modules_multiformats_src_varint_encodingLength(code) - const digestOffset = sizeOffset + node_modules_multiformats_src_varint_encodingLength(size) +/***/ 74487: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const bytes = new Uint8Array(digestOffset + size) - node_modules_multiformats_src_varint_encodeTo(code, bytes, 0) - node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset) - bytes.set(digest, digestOffset) - return new node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) -} -/** - * Turns bytes representation of multihash digest into an instance. - * - * @param {Uint8Array} multihash - * @returns {MultihashDigest} - */ -const node_modules_multiformats_src_hashes_digest_decode = (multihash) => { - const bytes = node_modules_multiformats_src_bytes_coerce(multihash) - const [code, sizeOffset] = node_modules_multiformats_src_varint_decode(bytes) - const [size, digestOffset] = node_modules_multiformats_src_varint_decode(bytes.subarray(sizeOffset)) - const digest = bytes.subarray(sizeOffset + digestOffset) +const WritableStream = (__nccwpck_require__(84492).Writable) +const { inherits } = __nccwpck_require__(47261) +const Dicer = __nccwpck_require__(84636) - if (digest.byteLength !== size) { - throw new Error('Incorrect length') +const MultipartParser = __nccwpck_require__(79164) +const UrlencodedParser = __nccwpck_require__(29802) +const parseParams = __nccwpck_require__(4420) + +function Busboy (opts) { + if (!(this instanceof Busboy)) { return new Busboy(opts) } + + if (typeof opts !== 'object') { + throw new TypeError('Busboy expected an options-Object.') + } + if (typeof opts.headers !== 'object') { + throw new TypeError('Busboy expected an options-Object with headers-attribute.') + } + if (typeof opts.headers['content-type'] !== 'string') { + throw new TypeError('Missing Content-Type-header.') } - return new node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) -} + const { + headers, + ...streamOptions + } = opts -/** - * @param {MultihashDigest} a - * @param {unknown} b - * @returns {b is MultihashDigest} - */ -const node_modules_multiformats_src_hashes_digest_equals = (a, b) => { - if (a === b) { - return true - } else { - const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) + this.opts = { + autoDestroy: false, + ...streamOptions + } + WritableStream.call(this, this.opts) - return ( - a.code === data.code && - a.size === data.size && - data.bytes instanceof Uint8Array && - node_modules_multiformats_src_bytes_equals(a.bytes, data.bytes) - ) + this._done = false + this._parser = this.getParserByHeaders(headers) + this._finished = false +} +inherits(Busboy, WritableStream) + +Busboy.prototype.emit = function (ev) { + if (ev === 'finish') { + if (!this._done) { + this._parser?.end() + return + } else if (this._finished) { + return + } + this._finished = true } + WritableStream.prototype.emit.apply(this, arguments) } -/** - * @typedef {import('./interface.js').MultihashDigest} MultihashDigest - */ +Busboy.prototype.getParserByHeaders = function (headers) { + const parsed = parseParams(headers['content-type']) -/** - * Represents a multihash digest which carries information about the - * hashing algorithm and an actual hash digest. - * - * @template {number} Code - * @template {number} Size - * @class - * @implements {MultihashDigest} - */ -class node_modules_multiformats_src_hashes_digest_Digest { - /** - * Creates a multihash digest. - * - * @param {Code} code - * @param {Size} size - * @param {Uint8Array} digest - * @param {Uint8Array} bytes - */ - constructor (code, size, digest, bytes) { - this.code = code - this.size = size - this.digest = digest - this.bytes = bytes + const cfg = { + defCharset: this.opts.defCharset, + fileHwm: this.opts.fileHwm, + headers, + highWaterMark: this.opts.highWaterMark, + isPartAFile: this.opts.isPartAFile, + limits: this.opts.limits, + parsedConType: parsed, + preservePath: this.opts.preservePath + } + + if (MultipartParser.detect.test(parsed[0])) { + return new MultipartParser(this, cfg) + } + if (UrlencodedParser.detect.test(parsed[0])) { + return new UrlencodedParser(this, cfg) } + throw new Error('Unsupported Content-Type.') } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/hashes/identity.js +Busboy.prototype._write = function (chunk, encoding, cb) { + this._parser.write(chunk, cb) +} +module.exports = Busboy +module.exports["default"] = Busboy +module.exports.Busboy = Busboy +module.exports.Dicer = Dicer -const identity_code = 0x0 -const identity_name = 'identity' -/** @type {(input:Uint8Array) => Uint8Array} */ -const identity_encode = node_modules_multiformats_src_bytes_coerce +/***/ }), -/** - * @param {Uint8Array} input - * @returns {Digest.Digest} - */ -const digest = (input) => node_modules_multiformats_src_hashes_digest_create(identity_code, identity_encode(input)) +/***/ 79164: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const identity_identity = { code: identity_code, name: identity_name, encode: identity_encode, digest } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/vendor/base-x.js -// base-x encoding / decoding -// Copyright (c) 2018 base-x contributors -// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) -// Distributed under the MIT software license, see the accompanying -// file LICENSE or http://www.opensource.org/licenses/mit-license.php. -function node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { - if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } - var BASE_MAP = new Uint8Array(256); - for (var j = 0; j < BASE_MAP.length; j++) { - BASE_MAP[j] = 255; - } - for (var i = 0; i < ALPHABET.length; i++) { - var x = ALPHABET.charAt(i); - var xc = x.charCodeAt(0); - if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') } - BASE_MAP[xc] = i; - } - var BASE = ALPHABET.length; - var LEADER = ALPHABET.charAt(0); - var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up - var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up - function encode (source) { - if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) { - source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); - } else if (Array.isArray(source)) { - source = Uint8Array.from(source); - } - if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') } - if (source.length === 0) { return '' } - // Skip & count leading zeroes. - var zeroes = 0; - var length = 0; - var pbegin = 0; - var pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; - } - // Allocate enough space in big-endian base58 representation. - var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; - var b58 = new Uint8Array(size); - // Process the bytes. - while (pbegin !== pend) { - var carry = source[pbegin]; - // Apply "b58 = b58 * 256 + ch". - var i = 0; - for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { - carry += (256 * b58[it1]) >>> 0; - b58[it1] = (carry % BASE) >>> 0; - carry = (carry / BASE) >>> 0; - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - pbegin++; - } - // Skip leading zeroes in base58 result. - var it2 = size - length; - while (it2 !== size && b58[it2] === 0) { - it2++; + +// TODO: +// * support 1 nested multipart level +// (see second multipart example here: +// http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data) +// * support limits.fieldNameSize +// -- this will require modifications to utils.parseParams + +const { Readable } = __nccwpck_require__(84492) +const { inherits } = __nccwpck_require__(47261) + +const Dicer = __nccwpck_require__(84636) + +const parseParams = __nccwpck_require__(4420) +const decodeText = __nccwpck_require__(77101) +const basename = __nccwpck_require__(52213) +const getLimit = __nccwpck_require__(59149) + +const RE_BOUNDARY = /^boundary$/i +const RE_FIELD = /^form-data$/i +const RE_CHARSET = /^charset$/i +const RE_FILENAME = /^filename$/i +const RE_NAME = /^name$/i + +Multipart.detect = /^multipart\/form-data/i +function Multipart (boy, cfg) { + let i + let len + const self = this + let boundary + const limits = cfg.limits + const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined)) + const parsedConType = cfg.parsedConType || [] + const defCharset = cfg.defCharset || 'utf8' + const preservePath = cfg.preservePath + const fileOpts = { highWaterMark: cfg.fileHwm } + + for (i = 0, len = parsedConType.length; i < len; ++i) { + if (Array.isArray(parsedConType[i]) && + RE_BOUNDARY.test(parsedConType[i][0])) { + boundary = parsedConType[i][1] + break } - // Translate the result into a string. - var str = LEADER.repeat(zeroes); - for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); } - return str } - function decodeUnsafe (source) { - if (typeof source !== 'string') { throw new TypeError('Expected String') } - if (source.length === 0) { return new Uint8Array() } - var psz = 0; - // Skip leading spaces. - if (source[psz] === ' ') { return } - // Skip and count leading '1's. - var zeroes = 0; - var length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; + + function checkFinished () { + if (nends === 0 && finished && !boy._done) { + finished = false + self.end() } - // Allocate enough space in big-endian base256 representation. - var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. - var b256 = new Uint8Array(size); - // Process the characters. - while (source[psz]) { - // Decode character - var carry = BASE_MAP[source.charCodeAt(psz)]; - // Invalid character - if (carry === 255) { return } - var i = 0; - for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { - carry += (BASE * b256[it3]) >>> 0; - b256[it3] = (carry % 256) >>> 0; - carry = (carry / 256) >>> 0; - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - psz++; + } + + if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') } + + const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024) + const fileSizeLimit = getLimit(limits, 'fileSize', Infinity) + const filesLimit = getLimit(limits, 'files', Infinity) + const fieldsLimit = getLimit(limits, 'fields', Infinity) + const partsLimit = getLimit(limits, 'parts', Infinity) + const headerPairsLimit = getLimit(limits, 'headerPairs', 2000) + const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024) + + let nfiles = 0 + let nfields = 0 + let nends = 0 + let curFile + let curField + let finished = false + + this._needDrain = false + this._pause = false + this._cb = undefined + this._nparts = 0 + this._boy = boy + + const parserCfg = { + boundary, + maxHeaderPairs: headerPairsLimit, + maxHeaderSize: headerSizeLimit, + partHwm: fileOpts.highWaterMark, + highWaterMark: cfg.highWaterMark + } + + this.parser = new Dicer(parserCfg) + this.parser.on('drain', function () { + self._needDrain = false + if (self._cb && !self._pause) { + const cb = self._cb + self._cb = undefined + cb() } - // Skip trailing spaces. - if (source[psz] === ' ') { return } - // Skip leading zeroes in b256. - var it4 = size - length; - while (it4 !== size && b256[it4] === 0) { - it4++; + }).on('part', function onPart (part) { + if (++self._nparts > partsLimit) { + self.parser.removeListener('part', onPart) + self.parser.on('part', skipPart) + boy.hitPartsLimit = true + boy.emit('partsLimit') + return skipPart(part) } - var vch = new Uint8Array(zeroes + (size - it4)); - var j = zeroes; - while (it4 !== size) { - vch[j++] = b256[it4++]; + + // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let + // us emit 'end' early since we know the part has ended if we are already + // seeing the next part + if (curField) { + const field = curField + field.emit('end') + field.removeAllListeners('end') } - return vch - } - function decode (string) { - var buffer = decodeUnsafe(string); - if (buffer) { return buffer } - throw new Error(`Non-${name} character`) + + part.on('header', function (header) { + let contype + let fieldname + let parsed + let charset + let encoding + let filename + let nsize = 0 + + if (header['content-type']) { + parsed = parseParams(header['content-type'][0]) + if (parsed[0]) { + contype = parsed[0].toLowerCase() + for (i = 0, len = parsed.length; i < len; ++i) { + if (RE_CHARSET.test(parsed[i][0])) { + charset = parsed[i][1].toLowerCase() + break + } + } + } + } + + if (contype === undefined) { contype = 'text/plain' } + if (charset === undefined) { charset = defCharset } + + if (header['content-disposition']) { + parsed = parseParams(header['content-disposition'][0]) + if (!RE_FIELD.test(parsed[0])) { return skipPart(part) } + for (i = 0, len = parsed.length; i < len; ++i) { + if (RE_NAME.test(parsed[i][0])) { + fieldname = parsed[i][1] + } else if (RE_FILENAME.test(parsed[i][0])) { + filename = parsed[i][1] + if (!preservePath) { filename = basename(filename) } + } + } + } else { return skipPart(part) } + + if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' } + + let onData, + onEnd + + if (isPartAFile(fieldname, contype, filename)) { + // file/binary field + if (nfiles === filesLimit) { + if (!boy.hitFilesLimit) { + boy.hitFilesLimit = true + boy.emit('filesLimit') + } + return skipPart(part) + } + + ++nfiles + + if (!boy._events.file) { + self.parser._ignore() + return + } + + ++nends + const file = new FileStream(fileOpts) + curFile = file + file.on('end', function () { + --nends + self._pause = false + checkFinished() + if (self._cb && !self._needDrain) { + const cb = self._cb + self._cb = undefined + cb() + } + }) + file._read = function (n) { + if (!self._pause) { return } + self._pause = false + if (self._cb && !self._needDrain) { + const cb = self._cb + self._cb = undefined + cb() + } + } + boy.emit('file', fieldname, file, filename, encoding, contype) + + onData = function (data) { + if ((nsize += data.length) > fileSizeLimit) { + const extralen = fileSizeLimit - nsize + data.length + if (extralen > 0) { file.push(data.slice(0, extralen)) } + file.truncated = true + file.bytesRead = fileSizeLimit + part.removeAllListeners('data') + file.emit('limit') + return + } else if (!file.push(data)) { self._pause = true } + + file.bytesRead = nsize + } + + onEnd = function () { + curFile = undefined + file.push(null) + } + } else { + // non-file field + if (nfields === fieldsLimit) { + if (!boy.hitFieldsLimit) { + boy.hitFieldsLimit = true + boy.emit('fieldsLimit') + } + return skipPart(part) + } + + ++nfields + ++nends + let buffer = '' + let truncated = false + curField = part + + onData = function (data) { + if ((nsize += data.length) > fieldSizeLimit) { + const extralen = (fieldSizeLimit - (nsize - data.length)) + buffer += data.toString('binary', 0, extralen) + truncated = true + part.removeAllListeners('data') + } else { buffer += data.toString('binary') } + } + + onEnd = function () { + curField = undefined + if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) } + boy.emit('field', fieldname, buffer, false, truncated, encoding, contype) + --nends + checkFinished() + } + } + + /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become + broken. Streams2/streams3 is a huge black box of confusion, but + somehow overriding the sync state seems to fix things again (and still + seems to work for previous node versions). + */ + part._readableState.sync = false + + part.on('data', onData) + part.on('end', onEnd) + }).on('error', function (err) { + if (curFile) { curFile.emit('error', err) } + }) + }).on('error', function (err) { + boy.emit('error', err) + }).on('finish', function () { + finished = true + checkFinished() + }) +} + +Multipart.prototype.write = function (chunk, cb) { + const r = this.parser.write(chunk) + if (r && !this._pause) { + cb() + } else { + this._needDrain = !r + this._cb = cb } - return { - encode: encode, - decodeUnsafe: decodeUnsafe, - decode: decode +} + +Multipart.prototype.end = function () { + const self = this + + if (self.parser.writable) { + self.parser.end() + } else if (!self._boy._done) { + process.nextTick(function () { + self._boy._done = true + self._boy.emit('finish') + }) } } -var node_modules_multiformats_vendor_base_x_src = node_modules_multiformats_vendor_base_x_base; -var node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = node_modules_multiformats_vendor_base_x_src; +function skipPart (part) { + part.resume() +} -/* harmony default export */ const node_modules_multiformats_vendor_base_x = (node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX); +function FileStream (opts) { + Readable.call(this, opts) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base.js + this.bytesRead = 0 + this.truncated = false +} -// Linter can't see that API is used in types. -// eslint-disable-next-line +inherits(FileStream, Readable) +FileStream.prototype._read = function (n) {} -/** - * Class represents both BaseEncoder and MultibaseEncoder meaning it - * can be used to encode to multibase or base encode without multibase - * prefix. - * - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseEncoder} - * @implements {API.BaseEncoder} - */ -class multiformats_src_bases_base_Encoder { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(bytes:Uint8Array) => string} baseEncode - */ - constructor (name, prefix, baseEncode) { - this.name = name - this.prefix = prefix - this.baseEncode = baseEncode - } +module.exports = Multipart - /** - * @param {Uint8Array} bytes - * @returns {API.Multibase} - */ - encode (bytes) { - if (bytes instanceof Uint8Array) { - return `${this.prefix}${this.baseEncode(bytes)}` - } else { - throw Error('Unknown type, must be binary type') + +/***/ }), + +/***/ 29802: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const Decoder = __nccwpck_require__(30826) +const decodeText = __nccwpck_require__(77101) +const getLimit = __nccwpck_require__(59149) + +const RE_CHARSET = /^charset$/i + +UrlEncoded.detect = /^application\/x-www-form-urlencoded/i +function UrlEncoded (boy, cfg) { + const limits = cfg.limits + const parsedConType = cfg.parsedConType + this.boy = boy + + this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024) + this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100) + this.fieldsLimit = getLimit(limits, 'fields', Infinity) + + let charset + for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var + if (Array.isArray(parsedConType[i]) && + RE_CHARSET.test(parsedConType[i][0])) { + charset = parsedConType[i][1].toLowerCase() + break } } + + if (charset === undefined) { charset = cfg.defCharset || 'utf8' } + + this.decoder = new Decoder() + this.charset = charset + this._fields = 0 + this._state = 'key' + this._checkingBytes = true + this._bytesKey = 0 + this._bytesVal = 0 + this._key = '' + this._val = '' + this._keyTrunc = false + this._valTrunc = false + this._hitLimit = false } -/** - * @template {string} Prefix - */ -/** - * Class represents both BaseDecoder and MultibaseDecoder so it could be used - * to decode multibases (with matching prefix) or just base decode strings - * with corresponding base encoding. - * - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseDecoder} - * @implements {API.UnibaseDecoder} - * @implements {API.BaseDecoder} - */ -class multiformats_src_bases_base_Decoder { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(text:string) => Uint8Array} baseDecode - */ - constructor (name, prefix, baseDecode) { - this.name = name - this.prefix = prefix - /* c8 ignore next 3 */ - if (prefix.codePointAt(0) === undefined) { - throw new Error('Invalid prefix character') +UrlEncoded.prototype.write = function (data, cb) { + if (this._fields === this.fieldsLimit) { + if (!this.boy.hitFieldsLimit) { + this.boy.hitFieldsLimit = true + this.boy.emit('fieldsLimit') } - /** @private */ - this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0)) - this.baseDecode = baseDecode + return cb() } - /** - * @param {string} text - */ - decode (text) { - if (typeof text === 'string') { - if (text.codePointAt(0) !== this.prefixCodePoint) { - throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`) + let idxeq; let idxamp; let i; let p = 0; const len = data.length + + while (p < len) { + if (this._state === 'key') { + idxeq = idxamp = undefined + for (i = p; i < len; ++i) { + if (!this._checkingBytes) { ++p } + if (data[i] === 0x3D/* = */) { + idxeq = i + break + } else if (data[i] === 0x26/* & */) { + idxamp = i + break + } + if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) { + this._hitLimit = true + break + } else if (this._checkingBytes) { ++this._bytesKey } + } + + if (idxeq !== undefined) { + // key with assignment + if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) } + this._state = 'val' + + this._hitLimit = false + this._checkingBytes = true + this._val = '' + this._bytesVal = 0 + this._valTrunc = false + this.decoder.reset() + + p = idxeq + 1 + } else if (idxamp !== undefined) { + // key with no assignment + ++this._fields + let key; const keyTrunc = this._keyTrunc + if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key } + + this._hitLimit = false + this._checkingBytes = true + this._key = '' + this._bytesKey = 0 + this._keyTrunc = false + this.decoder.reset() + + if (key.length) { + this.boy.emit('field', decodeText(key, 'binary', this.charset), + '', + keyTrunc, + false) + } + + p = idxamp + 1 + if (this._fields === this.fieldsLimit) { return cb() } + } else if (this._hitLimit) { + // we may not have hit the actual limit if there are encoded bytes... + if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) } + p = i + if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) { + // yep, we actually did hit the limit + this._checkingBytes = false + this._keyTrunc = true + } + } else { + if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) } + p = len } - return this.baseDecode(text.slice(this.prefix.length)) } else { - throw Error('Can only multibase decode strings') + idxamp = undefined + for (i = p; i < len; ++i) { + if (!this._checkingBytes) { ++p } + if (data[i] === 0x26/* & */) { + idxamp = i + break + } + if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) { + this._hitLimit = true + break + } else if (this._checkingBytes) { ++this._bytesVal } + } + + if (idxamp !== undefined) { + ++this._fields + if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) } + this.boy.emit('field', decodeText(this._key, 'binary', this.charset), + decodeText(this._val, 'binary', this.charset), + this._keyTrunc, + this._valTrunc) + this._state = 'key' + + this._hitLimit = false + this._checkingBytes = true + this._key = '' + this._bytesKey = 0 + this._keyTrunc = false + this.decoder.reset() + + p = idxamp + 1 + if (this._fields === this.fieldsLimit) { return cb() } + } else if (this._hitLimit) { + // we may not have hit the actual limit if there are encoded bytes... + if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) } + p = i + if ((this._val === '' && this.fieldSizeLimit === 0) || + (this._bytesVal = this._val.length) === this.fieldSizeLimit) { + // yep, we actually did hit the limit + this._checkingBytes = false + this._valTrunc = true + } + } else { + if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) } + p = len + } } } + cb() +} - /** - * @template {string} OtherPrefix - * @param {API.UnibaseDecoder|ComposedDecoder} decoder - * @returns {ComposedDecoder} - */ - or (decoder) { - return multiformats_src_bases_base_or(this, decoder) +UrlEncoded.prototype.end = function () { + if (this.boy._done) { return } + + if (this._state === 'key' && this._key.length > 0) { + this.boy.emit('field', decodeText(this._key, 'binary', this.charset), + '', + this._keyTrunc, + false) + } else if (this._state === 'val') { + this.boy.emit('field', decodeText(this._key, 'binary', this.charset), + decodeText(this._val, 'binary', this.charset), + this._keyTrunc, + this._valTrunc) } + this.boy._done = true + this.boy.emit('finish') } -/** - * @template {string} Prefix - * @typedef {Record>} Decoders - */ +module.exports = UrlEncoded -/** - * @template {string} Prefix - * @implements {API.MultibaseDecoder} - * @implements {API.CombobaseDecoder} - */ -class multiformats_src_bases_base_ComposedDecoder { - /** - * @param {Decoders} decoders - */ - constructor (decoders) { - this.decoders = decoders - } - /** - * @template {string} OtherPrefix - * @param {API.UnibaseDecoder|ComposedDecoder} decoder - * @returns {ComposedDecoder} - */ - or (decoder) { - return multiformats_src_bases_base_or(this, decoder) - } +/***/ }), - /** - * @param {string} input - * @returns {Uint8Array} - */ - decode (input) { - const prefix = /** @type {Prefix} */ (input[0]) - const decoder = this.decoders[prefix] - if (decoder) { - return decoder.decode(input) - } else { - throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`) +/***/ 30826: +/***/ ((module) => { + + + +const RE_PLUS = /\+/g + +const HEX = [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +] + +function Decoder () { + this.buffer = undefined +} +Decoder.prototype.write = function (str) { + // Replace '+' with ' ' before decoding + str = str.replace(RE_PLUS, ' ') + let res = '' + let i = 0; let p = 0; const len = str.length + for (; i < len; ++i) { + if (this.buffer !== undefined) { + if (!HEX[str.charCodeAt(i)]) { + res += '%' + this.buffer + this.buffer = undefined + --i // retry character + } else { + this.buffer += str[i] + ++p + if (this.buffer.length === 2) { + res += String.fromCharCode(parseInt(this.buffer, 16)) + this.buffer = undefined + } + } + } else if (str[i] === '%') { + if (i > p) { + res += str.substring(p, i) + p = i + } + this.buffer = '' + ++p } } + if (p < len && this.buffer === undefined) { res += str.substring(p) } + return res +} +Decoder.prototype.reset = function () { + this.buffer = undefined } -/** - * @template {string} L - * @template {string} R - * @param {API.UnibaseDecoder|API.CombobaseDecoder} left - * @param {API.UnibaseDecoder|API.CombobaseDecoder} right - * @returns {ComposedDecoder} - */ -const multiformats_src_bases_base_or = (left, right) => new multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({ - ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }), - ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right }) -})) +module.exports = Decoder -/** - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseCodec} - * @implements {API.MultibaseEncoder} - * @implements {API.MultibaseDecoder} - * @implements {API.BaseCodec} - * @implements {API.BaseEncoder} - * @implements {API.BaseDecoder} - */ -class multiformats_src_bases_base_Codec { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(bytes:Uint8Array) => string} baseEncode - * @param {(text:string) => Uint8Array} baseDecode - */ - constructor (name, prefix, baseEncode, baseDecode) { - this.name = name - this.prefix = prefix - this.baseEncode = baseEncode - this.baseDecode = baseDecode - this.encoder = new multiformats_src_bases_base_Encoder(name, prefix, baseEncode) - this.decoder = new multiformats_src_bases_base_Decoder(name, prefix, baseDecode) - } - /** - * @param {Uint8Array} input - */ - encode (input) { - return this.encoder.encode(input) - } +/***/ }), - /** - * @param {string} input - */ - decode (input) { - return this.decoder.decode(input) - } -} +/***/ 52213: +/***/ ((module) => { -/** - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {(bytes:Uint8Array) => string} options.encode - * @param {(input:string) => Uint8Array} options.decode - * @returns {Codec} - */ -const multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) => - new multiformats_src_bases_base_Codec(name, prefix, encode, decode) -/** - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {string} options.alphabet - * @returns {Codec} - */ -const multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => { - const { encode, decode } = node_modules_multiformats_vendor_base_x(alphabet, name) - return multiformats_src_bases_base_from({ - prefix, - name, - encode, - /** - * @param {string} text - */ - decode: text => node_modules_multiformats_src_bytes_coerce(decode(text)) - }) -} -/** - * @param {string} string - * @param {string} alphabet - * @param {number} bitsPerChar - * @param {string} name - * @returns {Uint8Array} - */ -const multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { - // Build the character lookup table: - /** @type {Record} */ - const codes = {} - for (let i = 0; i < alphabet.length; ++i) { - codes[alphabet[i]] = i +module.exports = function basename (path) { + if (typeof path !== 'string') { return '' } + for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var + switch (path.charCodeAt(i)) { + case 0x2F: // '/' + case 0x5C: // '\' + path = path.slice(i + 1) + return (path === '..' || path === '.' ? '' : path) + } } + return (path === '..' || path === '.' ? '' : path) +} - // Count the padding bytes: - let end = string.length - while (string[end - 1] === '=') { - --end - } - // Allocate the output: - const out = new Uint8Array((end * bitsPerChar / 8) | 0) +/***/ }), - // Parse the data: - let bits = 0 // Number of bits currently in the buffer - let buffer = 0 // Bits waiting to be written out, MSB first - let written = 0 // Next byte to write - for (let i = 0; i < end; ++i) { - // Read one character from the string: - const value = codes[string[i]] - if (value === undefined) { - throw new SyntaxError(`Non-${name} character`) - } +/***/ 77101: +/***/ (function(module) { - // Append the bits to the buffer: - buffer = (buffer << bitsPerChar) | value - bits += bitsPerChar - // Write out some bits if the buffer has a byte's worth: - if (bits >= 8) { - bits -= 8 - out[written++] = 0xff & (buffer >> bits) - } - } - // Verify that we have received just enough bits: - if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) { - throw new SyntaxError('Unexpected end of data') - } +// Node has always utf-8 +const utf8Decoder = new TextDecoder('utf-8') +const textDecoders = new Map([ + ['utf-8', utf8Decoder], + ['utf8', utf8Decoder] +]) - return out +function getDecoder (charset) { + let lc + while (true) { + switch (charset) { + case 'utf-8': + case 'utf8': + return decoders.utf8 + case 'latin1': + case 'ascii': // TODO: Make these a separate, strict decoder? + case 'us-ascii': + case 'iso-8859-1': + case 'iso8859-1': + case 'iso88591': + case 'iso_8859-1': + case 'windows-1252': + case 'iso_8859-1:1987': + case 'cp1252': + case 'x-cp1252': + return decoders.latin1 + case 'utf16le': + case 'utf-16le': + case 'ucs2': + case 'ucs-2': + return decoders.utf16le + case 'base64': + return decoders.base64 + default: + if (lc === undefined) { + lc = true + charset = charset.toLowerCase() + continue + } + return decoders.other.bind(charset) + } + } } -/** - * @param {Uint8Array} data - * @param {string} alphabet - * @param {number} bitsPerChar - * @returns {string} - */ -const multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => { - const pad = alphabet[alphabet.length - 1] === '=' - const mask = (1 << bitsPerChar) - 1 - let out = '' +const decoders = { + utf8: (data, sourceEncoding) => { + if (data.length === 0) { + return '' + } + if (typeof data === 'string') { + data = Buffer.from(data, sourceEncoding) + } + return data.utf8Slice(0, data.length) + }, - let bits = 0 // Number of bits currently in the buffer - let buffer = 0 // Bits waiting to be written out, MSB first - for (let i = 0; i < data.length; ++i) { - // Slurp data into the buffer: - buffer = (buffer << 8) | data[i] - bits += 8 + latin1: (data, sourceEncoding) => { + if (data.length === 0) { + return '' + } + if (typeof data === 'string') { + return data + } + return data.latin1Slice(0, data.length) + }, - // Write out as much as we can: - while (bits > bitsPerChar) { - bits -= bitsPerChar - out += alphabet[mask & (buffer >> bits)] + utf16le: (data, sourceEncoding) => { + if (data.length === 0) { + return '' } - } + if (typeof data === 'string') { + data = Buffer.from(data, sourceEncoding) + } + return data.ucs2Slice(0, data.length) + }, - // Partial character: - if (bits) { - out += alphabet[mask & (buffer << (bitsPerChar - bits))] - } + base64: (data, sourceEncoding) => { + if (data.length === 0) { + return '' + } + if (typeof data === 'string') { + data = Buffer.from(data, sourceEncoding) + } + return data.base64Slice(0, data.length) + }, - // Add padding characters until we hit a byte boundary: - if (pad) { - while ((out.length * bitsPerChar) & 7) { - out += '=' + other: (data, sourceEncoding) => { + if (data.length === 0) { + return '' + } + if (typeof data === 'string') { + data = Buffer.from(data, sourceEncoding) } - } - return out + if (textDecoders.has(this.toString())) { + try { + return textDecoders.get(this).decode(data) + } catch (e) { } + } + return typeof data === 'string' + ? data + : data.toString() + } } -/** - * RFC4648 Factory - * - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {string} options.alphabet - * @param {number} options.bitsPerChar - */ -const multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { - return multiformats_src_bases_base_from({ - prefix, - name, - encode (input) { - return multiformats_src_bases_base_encode(input, alphabet, bitsPerChar) - }, - decode (input) { - return multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name) - } - }) +function decodeText (text, sourceEncoding, destEncoding) { + if (text) { + return getDecoder(destEncoding)(text, sourceEncoding) + } + return text } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/identity.js -// @ts-check +module.exports = decodeText +/***/ }), +/***/ 59149: +/***/ ((module) => { -const bases_identity_identity = multiformats_src_bases_base_from({ - prefix: '\x00', - name: 'identity', - encode: (buf) => node_modules_multiformats_src_bytes_toString(buf), - decode: (str) => node_modules_multiformats_src_bytes_fromString(str) -}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base2.js -// @ts-check +module.exports = function getLimit (limits, name, defaultLimit) { + if ( + !limits || + limits[name] === undefined || + limits[name] === null + ) { return defaultLimit } + if ( + typeof limits[name] !== 'number' || + isNaN(limits[name]) + ) { throw new TypeError('Limit ' + name + ' is not a valid number') } -const base2 = multiformats_src_bases_base_rfc4648({ - prefix: '0', - name: 'base2', - alphabet: '01', - bitsPerChar: 1 -}) + return limits[name] +} -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base8.js -// @ts-check +/***/ }), +/***/ 4420: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const base8 = multiformats_src_bases_base_rfc4648({ - prefix: '7', - name: 'base8', - alphabet: '01234567', - bitsPerChar: 3 -}) +/* eslint-disable object-property-newline */ -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base10.js +const decodeText = __nccwpck_require__(77101) -const base10 = multiformats_src_bases_base_baseX({ - prefix: '9', - name: 'base10', - alphabet: '0123456789' -}) +const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base16.js -// @ts-check +const EncodedLookup = { + '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04', + '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09', + '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c', + '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e', + '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12', + '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17', + '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b', + '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d', + '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20', + '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25', + '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a', + '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c', + '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f', + '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33', + '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38', + '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b', + '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e', + '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41', + '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46', + '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a', + '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d', + '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f', + '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54', + '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59', + '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c', + '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e', + '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62', + '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67', + '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b', + '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d', + '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70', + '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75', + '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a', + '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c', + '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f', + '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83', + '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88', + '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b', + '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e', + '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91', + '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96', + '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a', + '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d', + '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f', + '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2', + '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4', + '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7', + '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9', + '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab', + '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac', + '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad', + '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae', + '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0', + '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2', + '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5', + '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7', + '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba', + '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb', + '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc', + '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd', + '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf', + '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0', + '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3', + '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5', + '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8', + '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca', + '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb', + '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc', + '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce', + '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf', + '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1', + '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3', + '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6', + '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8', + '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda', + '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb', + '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd', + '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde', + '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf', + '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1', + '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4', + '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6', + '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9', + '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea', + '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec', + '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed', + '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee', + '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef', + '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2', + '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4', + '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7', + '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9', + '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb', + '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc', + '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd', + '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe', + '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff' +} +function encodedReplacer (match) { + return EncodedLookup[match] +} +const STATE_KEY = 0 +const STATE_VALUE = 1 +const STATE_CHARSET = 2 +const STATE_LANG = 3 -const base16 = multiformats_src_bases_base_rfc4648({ - prefix: 'f', - name: 'base16', - alphabet: '0123456789abcdef', - bitsPerChar: 4 -}) +function parseParams (str) { + const res = [] + let state = STATE_KEY + let charset = '' + let inquote = false + let escaping = false + let p = 0 + let tmp = '' + const len = str.length -const base16upper = multiformats_src_bases_base_rfc4648({ - prefix: 'F', - name: 'base16upper', - alphabet: '0123456789ABCDEF', - bitsPerChar: 4 -}) + for (var i = 0; i < len; ++i) { // eslint-disable-line no-var + const char = str[i] + if (char === '\\' && inquote) { + if (escaping) { escaping = false } else { + escaping = true + continue + } + } else if (char === '"') { + if (!escaping) { + if (inquote) { + inquote = false + state = STATE_KEY + } else { inquote = true } + continue + } else { escaping = false } + } else { + if (escaping && inquote) { tmp += '\\' } + escaping = false + if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") { + if (state === STATE_CHARSET) { + state = STATE_LANG + charset = tmp.substring(1) + } else { state = STATE_VALUE } + tmp = '' + continue + } else if (state === STATE_KEY && + (char === '*' || char === '=') && + res.length) { + state = char === '*' + ? STATE_CHARSET + : STATE_VALUE + res[p] = [tmp, undefined] + tmp = '' + continue + } else if (!inquote && char === ';') { + state = STATE_KEY + if (charset) { + if (tmp.length) { + tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer), + 'binary', + charset) + } + charset = '' + } else if (tmp.length) { + tmp = decodeText(tmp, 'binary', 'utf8') + } + if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp } + tmp = '' + ++p + continue + } else if (!inquote && (char === ' ' || char === '\t')) { continue } + } + tmp += char + } + if (charset && tmp.length) { + tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer), + 'binary', + charset) + } else if (tmp) { + tmp = decodeText(tmp, 'binary', 'utf8') + } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base32.js + if (res[p] === undefined) { + if (tmp) { res[p] = tmp } + } else { res[p][1] = tmp } + return res +} -const node_modules_multiformats_src_bases_base32_base32 = multiformats_src_bases_base_rfc4648({ - prefix: 'b', - name: 'base32', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567', - bitsPerChar: 5 -}) +module.exports = parseParams -const node_modules_multiformats_src_bases_base32_base32upper = multiformats_src_bases_base_rfc4648({ - prefix: 'B', - name: 'base32upper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', - bitsPerChar: 5 -}) -const multiformats_src_bases_base32_base32pad = multiformats_src_bases_base_rfc4648({ - prefix: 'c', - name: 'base32pad', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', - bitsPerChar: 5 -}) +/***/ }), -const multiformats_src_bases_base32_base32padupper = multiformats_src_bases_base_rfc4648({ - prefix: 'C', - name: 'base32padupper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', - bitsPerChar: 5 -}) +/***/ 5393: +/***/ ((__webpack_module__, __unused_webpack___webpack_exports__, __nccwpck_require__) => { -const multiformats_src_bases_base32_base32hex = multiformats_src_bases_base_rfc4648({ - prefix: 'v', - name: 'base32hex', - alphabet: '0123456789abcdefghijklmnopqrstuv', - bitsPerChar: 5 -}) +__nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { +/* harmony import */ var _runner_js__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(79355); -const multiformats_src_bases_base32_base32hexupper = multiformats_src_bases_base_rfc4648({ - prefix: 'V', - name: 'base32hexupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', - bitsPerChar: 5 -}) -const multiformats_src_bases_base32_base32hexpad = multiformats_src_bases_base_rfc4648({ - prefix: 't', - name: 'base32hexpad', - alphabet: '0123456789abcdefghijklmnopqrstuv=', - bitsPerChar: 5 -}) +await (0,_runner_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(); +__webpack_async_result__(); +} catch(e) { __webpack_async_result__(e); } }, 1); -const multiformats_src_bases_base32_base32hexpadupper = multiformats_src_bases_base_rfc4648({ - prefix: 'T', - name: 'base32hexpadupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', - bitsPerChar: 5 -}) +/***/ }), -const multiformats_src_bases_base32_base32z = multiformats_src_bases_base_rfc4648({ - prefix: 'h', - name: 'base32z', - alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', - bitsPerChar: 5 -}) +/***/ 79355: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => { -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base36.js +// EXPORTS +__nccwpck_require__.d(__webpack_exports__, { + "Z": () => (/* binding */ runner) +}); + +// NAMESPACE OBJECT: ./node_modules/@ipld/dag-pb/src/index.js +var src_namespaceObject = {}; +__nccwpck_require__.r(src_namespaceObject); +__nccwpck_require__.d(src_namespaceObject, { + "code": () => (code), + "createLink": () => (createLink), + "createNode": () => (createNode), + "decode": () => (src_decode), + "encode": () => (src_encode), + "name": () => (src_name), + "prepare": () => (prepare), + "validate": () => (validate) +}); + +// NAMESPACE OBJECT: ./node_modules/@ipld/dag-cbor/src/index.js +var dag_cbor_src_namespaceObject = {}; +__nccwpck_require__.r(dag_cbor_src_namespaceObject); +__nccwpck_require__.d(dag_cbor_src_namespaceObject, { + "code": () => (src_code), + "decode": () => (dag_cbor_src_decode), + "encode": () => (dag_cbor_src_encode), + "name": () => (dag_cbor_src_name) +}); + +// NAMESPACE OBJECT: ./node_modules/@ipld/dag-json/src/index.js +var dag_json_src_namespaceObject = {}; +__nccwpck_require__.r(dag_json_src_namespaceObject); +__nccwpck_require__.d(dag_json_src_namespaceObject, { + "code": () => (dag_json_src_code), + "decode": () => (dag_json_src_decode), + "encode": () => (dag_json_src_encode), + "format": () => (src_format), + "name": () => (dag_json_src_name), + "parse": () => (parse), + "stringify": () => (src_format) +}); + +// NAMESPACE OBJECT: ./node_modules/dag-jose/lib/index.js +var lib_namespaceObject = {}; +__nccwpck_require__.r(lib_namespaceObject); +__nccwpck_require__.d(lib_namespaceObject, { + "code": () => (lib_code), + "decode": () => (lib_decode), + "encode": () => (lib_encode), + "name": () => (lib_name), + "toGeneral": () => (toGeneral) +}); -const base36 = multiformats_src_bases_base_baseX({ - prefix: 'k', - name: 'base36', - alphabet: '0123456789abcdefghijklmnopqrstuvwxyz' -}) +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/hashes/identity.js +var identity_namespaceObject = {}; +__nccwpck_require__.r(identity_namespaceObject); +__nccwpck_require__.d(identity_namespaceObject, { + "identity": () => (identity_identity) +}); -const base36upper = multiformats_src_bases_base_baseX({ - prefix: 'K', - name: 'base36upper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' -}) +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/identity.js +var bases_identity_namespaceObject = {}; +__nccwpck_require__.r(bases_identity_namespaceObject); +__nccwpck_require__.d(bases_identity_namespaceObject, { + "identity": () => (bases_identity_identity) +}); -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base58.js +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base2.js +var base2_namespaceObject = {}; +__nccwpck_require__.r(base2_namespaceObject); +__nccwpck_require__.d(base2_namespaceObject, { + "base2": () => (base2) +}); +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base8.js +var base8_namespaceObject = {}; +__nccwpck_require__.r(base8_namespaceObject); +__nccwpck_require__.d(base8_namespaceObject, { + "base8": () => (base8) +}); -const node_modules_multiformats_src_bases_base58_base58btc = multiformats_src_bases_base_baseX({ - name: 'base58btc', - prefix: 'z', - alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -}) +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base10.js +var base10_namespaceObject = {}; +__nccwpck_require__.r(base10_namespaceObject); +__nccwpck_require__.d(base10_namespaceObject, { + "base10": () => (base10) +}); -const multiformats_src_bases_base58_base58flickr = multiformats_src_bases_base_baseX({ - name: 'base58flickr', - prefix: 'Z', - alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -}) +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base16.js +var base16_namespaceObject = {}; +__nccwpck_require__.r(base16_namespaceObject); +__nccwpck_require__.d(base16_namespaceObject, { + "base16": () => (base16), + "base16upper": () => (base16upper) +}); -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base64.js -// @ts-check +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base32.js +var node_modules_multiformats_src_bases_base32_namespaceObject = {}; +__nccwpck_require__.r(node_modules_multiformats_src_bases_base32_namespaceObject); +__nccwpck_require__.d(node_modules_multiformats_src_bases_base32_namespaceObject, { + "base32": () => (node_modules_multiformats_src_bases_base32_base32), + "base32hex": () => (multiformats_src_bases_base32_base32hex), + "base32hexpad": () => (multiformats_src_bases_base32_base32hexpad), + "base32hexpadupper": () => (multiformats_src_bases_base32_base32hexpadupper), + "base32hexupper": () => (multiformats_src_bases_base32_base32hexupper), + "base32pad": () => (multiformats_src_bases_base32_base32pad), + "base32padupper": () => (multiformats_src_bases_base32_base32padupper), + "base32upper": () => (node_modules_multiformats_src_bases_base32_base32upper), + "base32z": () => (multiformats_src_bases_base32_base32z) +}); +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base36.js +var base36_namespaceObject = {}; +__nccwpck_require__.r(base36_namespaceObject); +__nccwpck_require__.d(base36_namespaceObject, { + "base36": () => (base36), + "base36upper": () => (base36upper) +}); +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base58.js +var node_modules_multiformats_src_bases_base58_namespaceObject = {}; +__nccwpck_require__.r(node_modules_multiformats_src_bases_base58_namespaceObject); +__nccwpck_require__.d(node_modules_multiformats_src_bases_base58_namespaceObject, { + "base58btc": () => (node_modules_multiformats_src_bases_base58_base58btc), + "base58flickr": () => (multiformats_src_bases_base58_base58flickr) +}); -const bases_base64_base64 = multiformats_src_bases_base_rfc4648({ - prefix: 'm', - name: 'base64', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', - bitsPerChar: 6 -}) +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base64.js +var src_bases_base64_namespaceObject = {}; +__nccwpck_require__.r(src_bases_base64_namespaceObject); +__nccwpck_require__.d(src_bases_base64_namespaceObject, { + "base64": () => (bases_base64_base64), + "base64pad": () => (bases_base64_base64pad), + "base64url": () => (bases_base64_base64url), + "base64urlpad": () => (bases_base64_base64urlpad) +}); -const bases_base64_base64pad = multiformats_src_bases_base_rfc4648({ - prefix: 'M', - name: 'base64pad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', - bitsPerChar: 6 -}) +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base256emoji.js +var base256emoji_namespaceObject = {}; +__nccwpck_require__.r(base256emoji_namespaceObject); +__nccwpck_require__.d(base256emoji_namespaceObject, { + "base256emoji": () => (base256emoji) +}); -const bases_base64_base64url = multiformats_src_bases_base_rfc4648({ - prefix: 'u', - name: 'base64url', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', - bitsPerChar: 6 -}) +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/hashes/sha2.js +var sha2_namespaceObject = {}; +__nccwpck_require__.r(sha2_namespaceObject); +__nccwpck_require__.d(sha2_namespaceObject, { + "sha256": () => (sha2_sha256), + "sha512": () => (sha512) +}); -const bases_base64_base64urlpad = multiformats_src_bases_base_rfc4648({ - prefix: 'U', - name: 'base64urlpad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', - bitsPerChar: 6 -}) +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/codecs/raw.js +var raw_namespaceObject = {}; +__nccwpck_require__.r(raw_namespaceObject); +__nccwpck_require__.d(raw_namespaceObject, { + "code": () => (raw_code), + "decode": () => (raw_decode), + "encode": () => (raw_encode), + "name": () => (raw_name) +}); -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base256emoji.js +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/codecs/json.js +var codecs_json_namespaceObject = {}; +__nccwpck_require__.r(codecs_json_namespaceObject); +__nccwpck_require__.d(codecs_json_namespaceObject, { + "code": () => (json_code), + "decode": () => (json_decode), + "encode": () => (json_encode), + "name": () => (json_name) +}); +// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base58.js +var dist_src_bases_base58_namespaceObject = {}; +__nccwpck_require__.r(dist_src_bases_base58_namespaceObject); +__nccwpck_require__.d(dist_src_bases_base58_namespaceObject, { + "base58btc": () => (dist_src_bases_base58_base58btc), + "base58flickr": () => (dist_src_bases_base58_base58flickr) +}); -const alphabet = Array.from('🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂') -const alphabetBytesToChars = /** @type {string[]} */ (alphabet.reduce((p, c, i) => { p[i] = c; return p }, /** @type {string[]} */([]))) -const alphabetCharsToBytes = /** @type {number[]} */ (alphabet.reduce((p, c, i) => { p[/** @type {number} */ (c.codePointAt(0))] = i; return p }, /** @type {number[]} */([]))) +// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base32.js +var dist_src_bases_base32_namespaceObject = {}; +__nccwpck_require__.r(dist_src_bases_base32_namespaceObject); +__nccwpck_require__.d(dist_src_bases_base32_namespaceObject, { + "base32": () => (dist_src_bases_base32_base32), + "base32hex": () => (dist_src_bases_base32_base32hex), + "base32hexpad": () => (dist_src_bases_base32_base32hexpad), + "base32hexpadupper": () => (dist_src_bases_base32_base32hexpadupper), + "base32hexupper": () => (dist_src_bases_base32_base32hexupper), + "base32pad": () => (dist_src_bases_base32_base32pad), + "base32padupper": () => (dist_src_bases_base32_base32padupper), + "base32upper": () => (dist_src_bases_base32_base32upper), + "base32z": () => (dist_src_bases_base32_base32z) +}); -/** - * @param {Uint8Array} data - * @returns {string} - */ -function base256emoji_encode (data) { - return data.reduce((p, c) => { - p += alphabetBytesToChars[c] - return p - }, '') -} +// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base10.js +var bases_base10_namespaceObject = {}; +__nccwpck_require__.r(bases_base10_namespaceObject); +__nccwpck_require__.d(bases_base10_namespaceObject, { + "base10": () => (base10_base10) +}); -/** - * @param {string} str - * @returns {Uint8Array} - */ -function base256emoji_decode (str) { - const byts = [] - for (const char of str) { - const byt = alphabetCharsToBytes[/** @type {number} */ (char.codePointAt(0))] - if (byt === undefined) { - throw new Error(`Non-base256emoji character: ${char}`) - } - byts.push(byt) - } - return new Uint8Array(byts) -} +// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base16.js +var bases_base16_namespaceObject = {}; +__nccwpck_require__.r(bases_base16_namespaceObject); +__nccwpck_require__.d(bases_base16_namespaceObject, { + "base16": () => (base16_base16), + "base16upper": () => (base16_base16upper) +}); -const base256emoji = multiformats_src_bases_base_from({ - prefix: '🚀', - name: 'base256emoji', - encode: base256emoji_encode, - decode: base256emoji_decode -}) +// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base2.js +var bases_base2_namespaceObject = {}; +__nccwpck_require__.r(bases_base2_namespaceObject); +__nccwpck_require__.d(bases_base2_namespaceObject, { + "base2": () => (base2_base2) +}); -// EXTERNAL MODULE: external "crypto" -var external_crypto_ = __nccwpck_require__(6113); -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/hashes/hasher.js +// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base256emoji.js +var bases_base256emoji_namespaceObject = {}; +__nccwpck_require__.r(bases_base256emoji_namespaceObject); +__nccwpck_require__.d(bases_base256emoji_namespaceObject, { + "base256emoji": () => (base256emoji_base256emoji) +}); +// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base36.js +var bases_base36_namespaceObject = {}; +__nccwpck_require__.r(bases_base36_namespaceObject); +__nccwpck_require__.d(bases_base36_namespaceObject, { + "base36": () => (base36_base36), + "base36upper": () => (base36_base36upper) +}); -/** - * @template {string} Name - * @template {number} Code - * @param {object} options - * @param {Name} options.name - * @param {Code} options.code - * @param {(input: Uint8Array) => Await} options.encode - */ -const hashes_hasher_from = ({ name, code, encode }) => new hasher_Hasher(name, code, encode) +// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base64.js +var dist_src_bases_base64_namespaceObject = {}; +__nccwpck_require__.r(dist_src_bases_base64_namespaceObject); +__nccwpck_require__.d(dist_src_bases_base64_namespaceObject, { + "base64": () => (src_bases_base64_base64), + "base64pad": () => (src_bases_base64_base64pad), + "base64url": () => (src_bases_base64_base64url), + "base64urlpad": () => (src_bases_base64_base64urlpad) +}); -/** - * Hasher represents a hashing algorithm implementation that produces as - * `MultihashDigest`. - * - * @template {string} Name - * @template {number} Code - * @class - * @implements {MultihashHasher} - */ -class hasher_Hasher { - /** - * - * @param {Name} name - * @param {Code} code - * @param {(input: Uint8Array) => Await} encode - */ - constructor (name, code, encode) { - this.name = name - this.code = code - this.encode = encode - } +// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base8.js +var bases_base8_namespaceObject = {}; +__nccwpck_require__.r(bases_base8_namespaceObject); +__nccwpck_require__.d(bases_base8_namespaceObject, { + "base8": () => (base8_base8) +}); - /** - * @param {Uint8Array} input - * @returns {Await>} - */ - digest (input) { - if (input instanceof Uint8Array) { - const result = this.encode(input) - return result instanceof Uint8Array - ? node_modules_multiformats_src_hashes_digest_create(this.code, result) - /* c8 ignore next 1 */ - : result.then(digest => node_modules_multiformats_src_hashes_digest_create(this.code, digest)) - } else { - throw Error('Unknown type, must be binary type') - /* c8 ignore next 1 */ - } - } -} +// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/identity.js +var src_bases_identity_namespaceObject = {}; +__nccwpck_require__.r(src_bases_identity_namespaceObject); +__nccwpck_require__.d(src_bases_identity_namespaceObject, { + "identity": () => (src_bases_identity_identity) +}); -/** - * @template {number} Alg - * @typedef {import('./interface.js').MultihashHasher} MultihashHasher - */ +// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/codecs/json.js +var src_codecs_json_namespaceObject = {}; +__nccwpck_require__.r(src_codecs_json_namespaceObject); +__nccwpck_require__.d(src_codecs_json_namespaceObject, { + "code": () => (codecs_json_code), + "decode": () => (codecs_json_decode), + "encode": () => (codecs_json_encode), + "name": () => (codecs_json_name) +}); -/** - * @template T - * @typedef {Promise|T} Await - */ +// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/codecs/raw.js +var codecs_raw_namespaceObject = {}; +__nccwpck_require__.r(codecs_raw_namespaceObject); +__nccwpck_require__.d(codecs_raw_namespaceObject, { + "code": () => (codecs_raw_code), + "decode": () => (codecs_raw_decode), + "encode": () => (codecs_raw_encode), + "name": () => (codecs_raw_name) +}); -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/hashes/sha2.js -// @ts-check +// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/hashes/identity.js +var hashes_identity_namespaceObject = {}; +__nccwpck_require__.r(hashes_identity_namespaceObject); +__nccwpck_require__.d(hashes_identity_namespaceObject, { + "identity": () => (hashes_identity_identity) +}); +// NAMESPACE OBJECT: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/hashes/sha2.js +var hashes_sha2_namespaceObject = {}; +__nccwpck_require__.r(hashes_sha2_namespaceObject); +__nccwpck_require__.d(hashes_sha2_namespaceObject, { + "sha256": () => (hashes_sha2_sha256), + "sha512": () => (sha2_sha512) +}); +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base10.js +var src_bases_base10_namespaceObject = {}; +__nccwpck_require__.r(src_bases_base10_namespaceObject); +__nccwpck_require__.d(src_bases_base10_namespaceObject, { + "base10": () => (bases_base10_base10) +}); +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base16.js +var src_bases_base16_namespaceObject = {}; +__nccwpck_require__.r(src_bases_base16_namespaceObject); +__nccwpck_require__.d(src_bases_base16_namespaceObject, { + "base16": () => (bases_base16_base16), + "base16upper": () => (bases_base16_base16upper) +}); +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base2.js +var src_bases_base2_namespaceObject = {}; +__nccwpck_require__.r(src_bases_base2_namespaceObject); +__nccwpck_require__.d(src_bases_base2_namespaceObject, { + "base2": () => (bases_base2_base2) +}); -const sha2_sha256 = hashes_hasher_from({ - name: 'sha2-256', - code: 0x12, - encode: (input) => node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha256').update(input).digest()) -}) +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base256emoji.js +var src_bases_base256emoji_namespaceObject = {}; +__nccwpck_require__.r(src_bases_base256emoji_namespaceObject); +__nccwpck_require__.d(src_bases_base256emoji_namespaceObject, { + "base256emoji": () => (bases_base256emoji_base256emoji) +}); -const sha512 = hashes_hasher_from({ - name: 'sha2-512', - code: 0x13, - encode: input => node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha512').update(input).digest()) -}) +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base32.js +var uint8arrays_node_modules_multiformats_src_bases_base32_namespaceObject = {}; +__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_base32_namespaceObject); +__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_base32_namespaceObject, { + "base32": () => (uint8arrays_node_modules_multiformats_src_bases_base32_base32), + "base32hex": () => (node_modules_multiformats_src_bases_base32_base32hex), + "base32hexpad": () => (node_modules_multiformats_src_bases_base32_base32hexpad), + "base32hexpadupper": () => (node_modules_multiformats_src_bases_base32_base32hexpadupper), + "base32hexupper": () => (node_modules_multiformats_src_bases_base32_base32hexupper), + "base32pad": () => (node_modules_multiformats_src_bases_base32_base32pad), + "base32padupper": () => (node_modules_multiformats_src_bases_base32_base32padupper), + "base32upper": () => (uint8arrays_node_modules_multiformats_src_bases_base32_base32upper), + "base32z": () => (node_modules_multiformats_src_bases_base32_base32z) +}); -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/codecs/raw.js -// @ts-check +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base36.js +var src_bases_base36_namespaceObject = {}; +__nccwpck_require__.r(src_bases_base36_namespaceObject); +__nccwpck_require__.d(src_bases_base36_namespaceObject, { + "base36": () => (bases_base36_base36), + "base36upper": () => (bases_base36_base36upper) +}); +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base58.js +var uint8arrays_node_modules_multiformats_src_bases_base58_namespaceObject = {}; +__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_base58_namespaceObject); +__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_base58_namespaceObject, { + "base58btc": () => (uint8arrays_node_modules_multiformats_src_bases_base58_base58btc), + "base58flickr": () => (node_modules_multiformats_src_bases_base58_base58flickr) +}); +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base64.js +var multiformats_src_bases_base64_namespaceObject = {}; +__nccwpck_require__.r(multiformats_src_bases_base64_namespaceObject); +__nccwpck_require__.d(multiformats_src_bases_base64_namespaceObject, { + "base64": () => (multiformats_src_bases_base64_base64), + "base64pad": () => (multiformats_src_bases_base64_base64pad), + "base64url": () => (multiformats_src_bases_base64_base64url), + "base64urlpad": () => (multiformats_src_bases_base64_base64urlpad) +}); -/** - * @template T - * @typedef {import('./interface.js').ByteView} ByteView - */ +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base8.js +var src_bases_base8_namespaceObject = {}; +__nccwpck_require__.r(src_bases_base8_namespaceObject); +__nccwpck_require__.d(src_bases_base8_namespaceObject, { + "base8": () => (bases_base8_base8) +}); -const raw_name = 'raw' -const raw_code = 0x55 +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/identity.js +var multiformats_src_bases_identity_namespaceObject = {}; +__nccwpck_require__.r(multiformats_src_bases_identity_namespaceObject); +__nccwpck_require__.d(multiformats_src_bases_identity_namespaceObject, { + "identity": () => (multiformats_src_bases_identity_identity) +}); -/** - * @param {Uint8Array} node - * @returns {ByteView} - */ -const raw_encode = (node) => node_modules_multiformats_src_bytes_coerce(node) +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/codecs/json.js +var multiformats_src_codecs_json_namespaceObject = {}; +__nccwpck_require__.r(multiformats_src_codecs_json_namespaceObject); +__nccwpck_require__.d(multiformats_src_codecs_json_namespaceObject, { + "code": () => (src_codecs_json_code), + "decode": () => (src_codecs_json_decode), + "encode": () => (src_codecs_json_encode), + "name": () => (src_codecs_json_name) +}); -/** - * @param {ByteView} data - * @returns {Uint8Array} - */ -const raw_decode = (data) => node_modules_multiformats_src_bytes_coerce(data) +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/codecs/raw.js +var src_codecs_raw_namespaceObject = {}; +__nccwpck_require__.r(src_codecs_raw_namespaceObject); +__nccwpck_require__.d(src_codecs_raw_namespaceObject, { + "code": () => (src_codecs_raw_code), + "decode": () => (src_codecs_raw_decode), + "encode": () => (src_codecs_raw_encode), + "name": () => (src_codecs_raw_name) +}); -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/codecs/json.js -// @ts-check +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/hashes/identity.js +var src_hashes_identity_namespaceObject = {}; +__nccwpck_require__.r(src_hashes_identity_namespaceObject); +__nccwpck_require__.d(src_hashes_identity_namespaceObject, { + "identity": () => (src_hashes_identity_identity) +}); -/** - * @template T - * @typedef {import('./interface.js').ByteView} ByteView - */ +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/hashes/sha2.js +var src_hashes_sha2_namespaceObject = {}; +__nccwpck_require__.r(src_hashes_sha2_namespaceObject); +__nccwpck_require__.d(src_hashes_sha2_namespaceObject, { + "sha256": () => (src_hashes_sha2_sha256), + "sha512": () => (hashes_sha2_sha512) +}); -const json_textEncoder = new TextEncoder() -const json_textDecoder = new TextDecoder() +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base58.js +var ipfs_core_utils_node_modules_multiformats_src_bases_base58_namespaceObject = {}; +__nccwpck_require__.r(ipfs_core_utils_node_modules_multiformats_src_bases_base58_namespaceObject); +__nccwpck_require__.d(ipfs_core_utils_node_modules_multiformats_src_bases_base58_namespaceObject, { + "base58btc": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc), + "base58flickr": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58flickr) +}); -const json_name = 'json' -const json_code = 0x0200 +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base32.js +var ipfs_core_utils_node_modules_multiformats_src_bases_base32_namespaceObject = {}; +__nccwpck_require__.r(ipfs_core_utils_node_modules_multiformats_src_bases_base32_namespaceObject); +__nccwpck_require__.d(ipfs_core_utils_node_modules_multiformats_src_bases_base32_namespaceObject, { + "base32": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32), + "base32hex": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32hex), + "base32hexpad": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32hexpad), + "base32hexpadupper": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32hexpadupper), + "base32hexupper": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32hexupper), + "base32pad": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32pad), + "base32padupper": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32padupper), + "base32upper": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32upper), + "base32z": () => (ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32z) +}); -/** - * @template T - * @param {T} node - * @returns {ByteView} - */ -const json_encode = (node) => json_textEncoder.encode(JSON.stringify(node)) +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/identity.js +var node_modules_multiformats_src_bases_identity_namespaceObject = {}; +__nccwpck_require__.r(node_modules_multiformats_src_bases_identity_namespaceObject); +__nccwpck_require__.d(node_modules_multiformats_src_bases_identity_namespaceObject, { + "identity": () => (node_modules_multiformats_src_bases_identity_identity) +}); -/** - * @template T - * @param {ByteView} data - * @returns {T} - */ -const json_decode = (data) => JSON.parse(json_textDecoder.decode(data)) +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base2.js +var multiformats_src_bases_base2_namespaceObject = {}; +__nccwpck_require__.r(multiformats_src_bases_base2_namespaceObject); +__nccwpck_require__.d(multiformats_src_bases_base2_namespaceObject, { + "base2": () => (src_bases_base2_base2) +}); -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/cid.js +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base8.js +var multiformats_src_bases_base8_namespaceObject = {}; +__nccwpck_require__.r(multiformats_src_bases_base8_namespaceObject); +__nccwpck_require__.d(multiformats_src_bases_base8_namespaceObject, { + "base8": () => (src_bases_base8_base8) +}); +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base10.js +var multiformats_src_bases_base10_namespaceObject = {}; +__nccwpck_require__.r(multiformats_src_bases_base10_namespaceObject); +__nccwpck_require__.d(multiformats_src_bases_base10_namespaceObject, { + "base10": () => (src_bases_base10_base10) +}); +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base16.js +var multiformats_src_bases_base16_namespaceObject = {}; +__nccwpck_require__.r(multiformats_src_bases_base16_namespaceObject); +__nccwpck_require__.d(multiformats_src_bases_base16_namespaceObject, { + "base16": () => (src_bases_base16_base16), + "base16upper": () => (src_bases_base16_base16upper) +}); +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base36.js +var multiformats_src_bases_base36_namespaceObject = {}; +__nccwpck_require__.r(multiformats_src_bases_base36_namespaceObject); +__nccwpck_require__.d(multiformats_src_bases_base36_namespaceObject, { + "base36": () => (src_bases_base36_base36), + "base36upper": () => (src_bases_base36_base36upper) +}); +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base64.js +var node_modules_multiformats_src_bases_base64_namespaceObject = {}; +__nccwpck_require__.r(node_modules_multiformats_src_bases_base64_namespaceObject); +__nccwpck_require__.d(node_modules_multiformats_src_bases_base64_namespaceObject, { + "base64": () => (node_modules_multiformats_src_bases_base64_base64), + "base64pad": () => (node_modules_multiformats_src_bases_base64_base64pad), + "base64url": () => (node_modules_multiformats_src_bases_base64_base64url), + "base64urlpad": () => (node_modules_multiformats_src_bases_base64_base64urlpad) +}); -// Linter can see that API is used in types. -// eslint-disable-next-line +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base256emoji.js +var multiformats_src_bases_base256emoji_namespaceObject = {}; +__nccwpck_require__.r(multiformats_src_bases_base256emoji_namespaceObject); +__nccwpck_require__.d(multiformats_src_bases_base256emoji_namespaceObject, { + "base256emoji": () => (src_bases_base256emoji_base256emoji) +}); +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/hashes/sha2.js +var multiformats_src_hashes_sha2_namespaceObject = {}; +__nccwpck_require__.r(multiformats_src_hashes_sha2_namespaceObject); +__nccwpck_require__.d(multiformats_src_hashes_sha2_namespaceObject, { + "sha256": () => (multiformats_src_hashes_sha2_sha256), + "sha512": () => (src_hashes_sha2_sha512) +}); -// This way TS will also expose all the types from module +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/hashes/identity.js +var multiformats_src_hashes_identity_namespaceObject = {}; +__nccwpck_require__.r(multiformats_src_hashes_identity_namespaceObject); +__nccwpck_require__.d(multiformats_src_hashes_identity_namespaceObject, { + "identity": () => (multiformats_src_hashes_identity_identity) +}); +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/codecs/raw.js +var multiformats_src_codecs_raw_namespaceObject = {}; +__nccwpck_require__.r(multiformats_src_codecs_raw_namespaceObject); +__nccwpck_require__.d(multiformats_src_codecs_raw_namespaceObject, { + "code": () => (multiformats_src_codecs_raw_code), + "decode": () => (multiformats_src_codecs_raw_decode), + "encode": () => (multiformats_src_codecs_raw_encode), + "name": () => (multiformats_src_codecs_raw_name) +}); -/** - * @template {API.Link} T - * @template {string} Prefix - * @param {T} link - * @param {API.MultibaseEncoder} [base] - * @returns {API.ToString} - */ -const node_modules_multiformats_src_cid_format = (link, base) => { - const { bytes, version } = link - switch (version) { - case 0: - return node_modules_multiformats_src_cid_toStringV0( - bytes, - node_modules_multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder<"z">} */ (base) || node_modules_multiformats_src_bases_base58_base58btc.encoder - ) - default: - return node_modules_multiformats_src_cid_toStringV1( - bytes, - node_modules_multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder} */ (base || node_modules_multiformats_src_bases_base32_base32.encoder) - ) - } -} +// NAMESPACE OBJECT: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/codecs/json.js +var node_modules_multiformats_src_codecs_json_namespaceObject = {}; +__nccwpck_require__.r(node_modules_multiformats_src_codecs_json_namespaceObject); +__nccwpck_require__.d(node_modules_multiformats_src_codecs_json_namespaceObject, { + "code": () => (multiformats_src_codecs_json_code), + "decode": () => (multiformats_src_codecs_json_decode), + "encode": () => (multiformats_src_codecs_json_encode), + "name": () => (multiformats_src_codecs_json_name) +}); -/** - * @template {API.UnknownLink} Link - * @param {Link} link - * @returns {API.LinkJSON} - */ -const node_modules_multiformats_src_cid_toJSON = (link) => ({ - '/': node_modules_multiformats_src_cid_format(link) -}) +// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base58.js +var peer_id_node_modules_multiformats_src_bases_base58_namespaceObject = {}; +__nccwpck_require__.r(peer_id_node_modules_multiformats_src_bases_base58_namespaceObject); +__nccwpck_require__.d(peer_id_node_modules_multiformats_src_bases_base58_namespaceObject, { + "base58btc": () => (peer_id_node_modules_multiformats_src_bases_base58_base58btc), + "base58flickr": () => (peer_id_node_modules_multiformats_src_bases_base58_base58flickr) +}); -/** - * @template {API.UnknownLink} Link - * @param {API.LinkJSON} json - */ -const node_modules_multiformats_src_cid_fromJSON = (json) => - node_modules_multiformats_src_cid_CID.parse(json['/']) +// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/identity.js +var peer_id_node_modules_multiformats_src_bases_identity_namespaceObject = {}; +__nccwpck_require__.r(peer_id_node_modules_multiformats_src_bases_identity_namespaceObject); +__nccwpck_require__.d(peer_id_node_modules_multiformats_src_bases_identity_namespaceObject, { + "identity": () => (peer_id_node_modules_multiformats_src_bases_identity_identity) +}); -/** @type {WeakMap>} */ -const node_modules_multiformats_src_cid_cache = new WeakMap() +// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base2.js +var node_modules_multiformats_src_bases_base2_namespaceObject = {}; +__nccwpck_require__.r(node_modules_multiformats_src_bases_base2_namespaceObject); +__nccwpck_require__.d(node_modules_multiformats_src_bases_base2_namespaceObject, { + "base2": () => (multiformats_src_bases_base2_base2) +}); -/** - * @param {API.UnknownLink} cid - * @returns {Map} - */ -const node_modules_multiformats_src_cid_baseCache = cid => { - const baseCache = node_modules_multiformats_src_cid_cache.get(cid) - if (baseCache == null) { - const baseCache = new Map() - node_modules_multiformats_src_cid_cache.set(cid, baseCache) - return baseCache - } - return baseCache -} +// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base8.js +var node_modules_multiformats_src_bases_base8_namespaceObject = {}; +__nccwpck_require__.r(node_modules_multiformats_src_bases_base8_namespaceObject); +__nccwpck_require__.d(node_modules_multiformats_src_bases_base8_namespaceObject, { + "base8": () => (multiformats_src_bases_base8_base8) +}); -/** - * @template {unknown} [Data=unknown] - * @template {number} [Format=number] - * @template {number} [Alg=number] - * @template {API.Version} [Version=API.Version] - * @implements {API.Link} - */ +// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base10.js +var node_modules_multiformats_src_bases_base10_namespaceObject = {}; +__nccwpck_require__.r(node_modules_multiformats_src_bases_base10_namespaceObject); +__nccwpck_require__.d(node_modules_multiformats_src_bases_base10_namespaceObject, { + "base10": () => (multiformats_src_bases_base10_base10) +}); -class node_modules_multiformats_src_cid_CID { - /** - * @param {Version} version - Version of the CID - * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content. - * @param {Uint8Array} bytes - * - */ - constructor (version, code, multihash, bytes) { - /** @readonly */ - this.code = code - /** @readonly */ - this.version = version - /** @readonly */ - this.multihash = multihash - /** @readonly */ - this.bytes = bytes +// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base16.js +var node_modules_multiformats_src_bases_base16_namespaceObject = {}; +__nccwpck_require__.r(node_modules_multiformats_src_bases_base16_namespaceObject); +__nccwpck_require__.d(node_modules_multiformats_src_bases_base16_namespaceObject, { + "base16": () => (multiformats_src_bases_base16_base16), + "base16upper": () => (multiformats_src_bases_base16_base16upper) +}); - // flag to serializers that this is a CID and - // should be treated specially - /** @readonly */ - this['/'] = bytes - } +// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base32.js +var peer_id_node_modules_multiformats_src_bases_base32_namespaceObject = {}; +__nccwpck_require__.r(peer_id_node_modules_multiformats_src_bases_base32_namespaceObject); +__nccwpck_require__.d(peer_id_node_modules_multiformats_src_bases_base32_namespaceObject, { + "base32": () => (peer_id_node_modules_multiformats_src_bases_base32_base32), + "base32hex": () => (peer_id_node_modules_multiformats_src_bases_base32_base32hex), + "base32hexpad": () => (peer_id_node_modules_multiformats_src_bases_base32_base32hexpad), + "base32hexpadupper": () => (peer_id_node_modules_multiformats_src_bases_base32_base32hexpadupper), + "base32hexupper": () => (peer_id_node_modules_multiformats_src_bases_base32_base32hexupper), + "base32pad": () => (peer_id_node_modules_multiformats_src_bases_base32_base32pad), + "base32padupper": () => (peer_id_node_modules_multiformats_src_bases_base32_base32padupper), + "base32upper": () => (peer_id_node_modules_multiformats_src_bases_base32_base32upper), + "base32z": () => (peer_id_node_modules_multiformats_src_bases_base32_base32z) +}); - /** - * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` - * please either use `CID.asCID(cid)` or switch to new signalling mechanism - * - * @deprecated - */ - get asCID () { - return this - } +// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base36.js +var node_modules_multiformats_src_bases_base36_namespaceObject = {}; +__nccwpck_require__.r(node_modules_multiformats_src_bases_base36_namespaceObject); +__nccwpck_require__.d(node_modules_multiformats_src_bases_base36_namespaceObject, { + "base36": () => (multiformats_src_bases_base36_base36), + "base36upper": () => (multiformats_src_bases_base36_base36upper) +}); - // ArrayBufferView - get byteOffset () { - return this.bytes.byteOffset - } +// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base64.js +var peer_id_node_modules_multiformats_src_bases_base64_namespaceObject = {}; +__nccwpck_require__.r(peer_id_node_modules_multiformats_src_bases_base64_namespaceObject); +__nccwpck_require__.d(peer_id_node_modules_multiformats_src_bases_base64_namespaceObject, { + "base64": () => (peer_id_node_modules_multiformats_src_bases_base64_base64), + "base64pad": () => (peer_id_node_modules_multiformats_src_bases_base64_base64pad), + "base64url": () => (peer_id_node_modules_multiformats_src_bases_base64_base64url), + "base64urlpad": () => (peer_id_node_modules_multiformats_src_bases_base64_base64urlpad) +}); - // ArrayBufferView - get byteLength () { - return this.bytes.byteLength - } +// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base256emoji.js +var node_modules_multiformats_src_bases_base256emoji_namespaceObject = {}; +__nccwpck_require__.r(node_modules_multiformats_src_bases_base256emoji_namespaceObject); +__nccwpck_require__.d(node_modules_multiformats_src_bases_base256emoji_namespaceObject, { + "base256emoji": () => (multiformats_src_bases_base256emoji_base256emoji) +}); - /** - * @returns {CID} - */ - toV0 () { - switch (this.version) { - case 0: { - return /** @type {CID} */ (this) - } - case 1: { - const { code, multihash } = this +// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/hashes/sha2.js +var node_modules_multiformats_src_hashes_sha2_namespaceObject = {}; +__nccwpck_require__.r(node_modules_multiformats_src_hashes_sha2_namespaceObject); +__nccwpck_require__.d(node_modules_multiformats_src_hashes_sha2_namespaceObject, { + "sha256": () => (node_modules_multiformats_src_hashes_sha2_sha256), + "sha512": () => (multiformats_src_hashes_sha2_sha512) +}); - if (code !== node_modules_multiformats_src_cid_DAG_PB_CODE) { - throw new Error('Cannot convert a non dag-pb CID to CIDv0') - } +// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/hashes/identity.js +var node_modules_multiformats_src_hashes_identity_namespaceObject = {}; +__nccwpck_require__.r(node_modules_multiformats_src_hashes_identity_namespaceObject); +__nccwpck_require__.d(node_modules_multiformats_src_hashes_identity_namespaceObject, { + "identity": () => (node_modules_multiformats_src_hashes_identity_identity) +}); - // sha2-256 - if (multihash.code !== node_modules_multiformats_src_cid_SHA_256_CODE) { - throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') - } +// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/codecs/raw.js +var node_modules_multiformats_src_codecs_raw_namespaceObject = {}; +__nccwpck_require__.r(node_modules_multiformats_src_codecs_raw_namespaceObject); +__nccwpck_require__.d(node_modules_multiformats_src_codecs_raw_namespaceObject, { + "code": () => (node_modules_multiformats_src_codecs_raw_code), + "decode": () => (node_modules_multiformats_src_codecs_raw_decode), + "encode": () => (node_modules_multiformats_src_codecs_raw_encode), + "name": () => (node_modules_multiformats_src_codecs_raw_name) +}); - return /** @type {CID} */ ( - node_modules_multiformats_src_cid_CID.createV0( - /** @type {API.MultihashDigest} */ (multihash) - ) - ) - } - default: { - throw Error( - `Can not convert CID version ${this.version} to version 0. This is a bug please report` - ) - } - } - } +// NAMESPACE OBJECT: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/codecs/json.js +var peer_id_node_modules_multiformats_src_codecs_json_namespaceObject = {}; +__nccwpck_require__.r(peer_id_node_modules_multiformats_src_codecs_json_namespaceObject); +__nccwpck_require__.d(peer_id_node_modules_multiformats_src_codecs_json_namespaceObject, { + "code": () => (node_modules_multiformats_src_codecs_json_code), + "decode": () => (node_modules_multiformats_src_codecs_json_decode), + "encode": () => (node_modules_multiformats_src_codecs_json_encode), + "name": () => (node_modules_multiformats_src_codecs_json_name) +}); - /** - * @returns {CID} - */ - toV1 () { - switch (this.version) { - case 0: { - const { code, digest } = this.multihash - const multihash = node_modules_multiformats_src_hashes_digest_create(code, digest) - return /** @type {CID} */ ( - node_modules_multiformats_src_cid_CID.createV1(this.code, multihash) - ) - } - case 1: { - return /** @type {CID} */ (this) - } - default: { - throw Error( - `Can not convert CID version ${this.version} to version 1. This is a bug please report` - ) - } - } - } +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base10.js +var uint8arrays_node_modules_multiformats_src_bases_base10_namespaceObject = {}; +__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_base10_namespaceObject); +__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_base10_namespaceObject, { + "base10": () => (node_modules_multiformats_src_bases_base10_base10) +}); - /** - * @param {unknown} other - * @returns {other is CID} - */ - equals (other) { - return node_modules_multiformats_src_cid_CID.equals(this, other) - } +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base16.js +var uint8arrays_node_modules_multiformats_src_bases_base16_namespaceObject = {}; +__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_base16_namespaceObject); +__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_base16_namespaceObject, { + "base16": () => (node_modules_multiformats_src_bases_base16_base16), + "base16upper": () => (node_modules_multiformats_src_bases_base16_base16upper) +}); - /** - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @param {API.Link} self - * @param {unknown} other - * @returns {other is CID} - */ - static equals (self, other) { - const unknown = - /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ ( - other - ) - return ( - unknown && - self.code === unknown.code && - self.version === unknown.version && - node_modules_multiformats_src_hashes_digest_equals(self.multihash, unknown.multihash) - ) - } +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base2.js +var uint8arrays_node_modules_multiformats_src_bases_base2_namespaceObject = {}; +__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_base2_namespaceObject); +__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_base2_namespaceObject, { + "base2": () => (node_modules_multiformats_src_bases_base2_base2) +}); - /** - * @param {API.MultibaseEncoder} [base] - * @returns {string} - */ - toString (base) { - return node_modules_multiformats_src_cid_format(this, base) - } +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base256emoji.js +var uint8arrays_node_modules_multiformats_src_bases_base256emoji_namespaceObject = {}; +__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_base256emoji_namespaceObject); +__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_base256emoji_namespaceObject, { + "base256emoji": () => (node_modules_multiformats_src_bases_base256emoji_base256emoji) +}); - toJSON () { - return { '/': node_modules_multiformats_src_cid_format(this) } - } +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base32.js +var node_modules_uint8arrays_node_modules_multiformats_src_bases_base32_namespaceObject = {}; +__nccwpck_require__.r(node_modules_uint8arrays_node_modules_multiformats_src_bases_base32_namespaceObject); +__nccwpck_require__.d(node_modules_uint8arrays_node_modules_multiformats_src_bases_base32_namespaceObject, { + "base32": () => (node_modules_uint8arrays_node_modules_multiformats_src_bases_base32_base32), + "base32hex": () => (uint8arrays_node_modules_multiformats_src_bases_base32_base32hex), + "base32hexpad": () => (uint8arrays_node_modules_multiformats_src_bases_base32_base32hexpad), + "base32hexpadupper": () => (uint8arrays_node_modules_multiformats_src_bases_base32_base32hexpadupper), + "base32hexupper": () => (uint8arrays_node_modules_multiformats_src_bases_base32_base32hexupper), + "base32pad": () => (uint8arrays_node_modules_multiformats_src_bases_base32_base32pad), + "base32padupper": () => (uint8arrays_node_modules_multiformats_src_bases_base32_base32padupper), + "base32upper": () => (node_modules_uint8arrays_node_modules_multiformats_src_bases_base32_base32upper), + "base32z": () => (uint8arrays_node_modules_multiformats_src_bases_base32_base32z) +}); - link () { - return this - } +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base36.js +var uint8arrays_node_modules_multiformats_src_bases_base36_namespaceObject = {}; +__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_base36_namespaceObject); +__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_base36_namespaceObject, { + "base36": () => (node_modules_multiformats_src_bases_base36_base36), + "base36upper": () => (node_modules_multiformats_src_bases_base36_base36upper) +}); - get [Symbol.toStringTag] () { - return 'CID' - } +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base58.js +var node_modules_uint8arrays_node_modules_multiformats_src_bases_base58_namespaceObject = {}; +__nccwpck_require__.r(node_modules_uint8arrays_node_modules_multiformats_src_bases_base58_namespaceObject); +__nccwpck_require__.d(node_modules_uint8arrays_node_modules_multiformats_src_bases_base58_namespaceObject, { + "base58btc": () => (node_modules_uint8arrays_node_modules_multiformats_src_bases_base58_base58btc), + "base58flickr": () => (uint8arrays_node_modules_multiformats_src_bases_base58_base58flickr) +}); - // Legacy +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base64.js +var uint8arrays_node_modules_multiformats_src_bases_base64_namespaceObject = {}; +__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_base64_namespaceObject); +__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_base64_namespaceObject, { + "base64": () => (uint8arrays_node_modules_multiformats_src_bases_base64_base64), + "base64pad": () => (uint8arrays_node_modules_multiformats_src_bases_base64_base64pad), + "base64url": () => (uint8arrays_node_modules_multiformats_src_bases_base64_base64url), + "base64urlpad": () => (uint8arrays_node_modules_multiformats_src_bases_base64_base64urlpad) +}); - [Symbol.for('nodejs.util.inspect.custom')] () { - return `CID(${this.toString()})` - } +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base8.js +var uint8arrays_node_modules_multiformats_src_bases_base8_namespaceObject = {}; +__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_base8_namespaceObject); +__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_base8_namespaceObject, { + "base8": () => (node_modules_multiformats_src_bases_base8_base8) +}); - /** - * Takes any input `value` and returns a `CID` instance if it was - * a `CID` otherwise returns `null`. If `value` is instanceof `CID` - * it will return value back. If `value` is not instance of this CID - * class, but is compatible CID it will return new instance of this - * `CID` class. Otherwise returns null. - * - * This allows two different incompatible versions of CID library to - * co-exist and interop as long as binary interface is compatible. - * - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @template {unknown} U - * @param {API.Link|U} input - * @returns {CID|null} - */ - static asCID (input) { - if (input == null) { - return null - } +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/identity.js +var uint8arrays_node_modules_multiformats_src_bases_identity_namespaceObject = {}; +__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_bases_identity_namespaceObject); +__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_bases_identity_namespaceObject, { + "identity": () => (uint8arrays_node_modules_multiformats_src_bases_identity_identity) +}); - const value = /** @type {any} */ (input) - if (value instanceof node_modules_multiformats_src_cid_CID) { - // If value is instance of CID then we're all set. - return value - } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { - // If value isn't instance of this CID class but `this.asCID === this` or - // `value['/'] === value.bytes` is true it is CID instance coming from a - // different implementation (diff version or duplicate). In that case we - // rebase it to this `CID` implementation so caller is guaranteed to get - // instance with expected API. - const { version, code, multihash, bytes } = value - return new node_modules_multiformats_src_cid_CID( - version, - code, - /** @type {API.MultihashDigest} */ (multihash), - bytes || node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes) - ) - } else if (value[node_modules_multiformats_src_cid_cidSymbol] === true) { - // If value is a CID from older implementation that used to be tagged via - // symbol we still rebase it to the this `CID` implementation by - // delegating that to a constructor. - const { version, multihash, code } = value - const digest = - /** @type {API.MultihashDigest} */ - (node_modules_multiformats_src_hashes_digest_decode(multihash)) - return node_modules_multiformats_src_cid_CID.create(version, code, digest) - } else { - // Otherwise value is not a CID (or an incompatible version of it) in - // which case we return `null`. - return null - } - } +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/codecs/json.js +var uint8arrays_node_modules_multiformats_src_codecs_json_namespaceObject = {}; +__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_codecs_json_namespaceObject); +__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_codecs_json_namespaceObject, { + "code": () => (uint8arrays_node_modules_multiformats_src_codecs_json_code), + "decode": () => (uint8arrays_node_modules_multiformats_src_codecs_json_decode), + "encode": () => (uint8arrays_node_modules_multiformats_src_codecs_json_encode), + "name": () => (uint8arrays_node_modules_multiformats_src_codecs_json_name) +}); - /** - * - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @param {Version} version - Version of the CID - * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param {API.MultihashDigest} digest - (Multi)hash of the of the content. - * @returns {CID} - */ - static create (version, code, digest) { - if (typeof code !== 'number') { - throw new Error('String codecs are no longer supported') - } +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/codecs/raw.js +var uint8arrays_node_modules_multiformats_src_codecs_raw_namespaceObject = {}; +__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_codecs_raw_namespaceObject); +__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_codecs_raw_namespaceObject, { + "code": () => (uint8arrays_node_modules_multiformats_src_codecs_raw_code), + "decode": () => (uint8arrays_node_modules_multiformats_src_codecs_raw_decode), + "encode": () => (uint8arrays_node_modules_multiformats_src_codecs_raw_encode), + "name": () => (uint8arrays_node_modules_multiformats_src_codecs_raw_name) +}); - if (!(digest.bytes instanceof Uint8Array)) { - throw new Error('Invalid digest') - } +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/hashes/identity.js +var uint8arrays_node_modules_multiformats_src_hashes_identity_namespaceObject = {}; +__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_hashes_identity_namespaceObject); +__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_hashes_identity_namespaceObject, { + "identity": () => (uint8arrays_node_modules_multiformats_src_hashes_identity_identity) +}); - switch (version) { - case 0: { - if (code !== node_modules_multiformats_src_cid_DAG_PB_CODE) { - throw new Error( - `Version 0 CID must use dag-pb (code: ${node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding` - ) - } else { - return new node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes) - } - } - case 1: { - const bytes = node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes) - return new node_modules_multiformats_src_cid_CID(version, code, digest, bytes) - } - default: { - throw new Error('Invalid version') - } - } - } +// NAMESPACE OBJECT: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/hashes/sha2.js +var uint8arrays_node_modules_multiformats_src_hashes_sha2_namespaceObject = {}; +__nccwpck_require__.r(uint8arrays_node_modules_multiformats_src_hashes_sha2_namespaceObject); +__nccwpck_require__.d(uint8arrays_node_modules_multiformats_src_hashes_sha2_namespaceObject, { + "sha256": () => (uint8arrays_node_modules_multiformats_src_hashes_sha2_sha256), + "sha512": () => (node_modules_multiformats_src_hashes_sha2_sha512) +}); - /** - * Simplified version of `create` for CIDv0. - * - * @template {unknown} [T=unknown] - * @param {API.MultihashDigest} digest - Multihash. - * @returns {CID} - */ - static createV0 (digest) { - return node_modules_multiformats_src_cid_CID.create(0, node_modules_multiformats_src_cid_DAG_PB_CODE, digest) - } +// NAMESPACE OBJECT: ./node_modules/@filebase/sdk/node_modules/axios/lib/platform/common/utils.js +var common_utils_namespaceObject = {}; +__nccwpck_require__.r(common_utils_namespaceObject); +__nccwpck_require__.d(common_utils_namespaceObject, { + "hasBrowserEnv": () => (hasBrowserEnv), + "hasStandardBrowserEnv": () => (hasStandardBrowserEnv), + "hasStandardBrowserWebWorkerEnv": () => (hasStandardBrowserWebWorkerEnv) +}); - /** - * Simplified version of `create` for CIDv1. - * - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @param {Code} code - Content encoding format code. - * @param {API.MultihashDigest} digest - Miltihash of the content. - * @returns {CID} - */ - static createV1 (code, digest) { - return node_modules_multiformats_src_cid_CID.create(1, code, digest) - } +// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base10.js +var protons_runtime_node_modules_multiformats_src_bases_base10_namespaceObject = {}; +__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_base10_namespaceObject); +__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_base10_namespaceObject, { + "base10": () => (protons_runtime_node_modules_multiformats_src_bases_base10_base10) +}); - /** - * Decoded a CID from its binary representation. The byte array must contain - * only the CID with no additional bytes. - * - * An error will be thrown if the bytes provided do not contain a valid - * binary representation of a CID. - * - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ByteView>} bytes - * @returns {CID} - */ - static decode (bytes) { - const [cid, remainder] = node_modules_multiformats_src_cid_CID.decodeFirst(bytes) - if (remainder.length) { - throw new Error('Incorrect length') - } - return cid - } +// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base16.js +var protons_runtime_node_modules_multiformats_src_bases_base16_namespaceObject = {}; +__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_base16_namespaceObject); +__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_base16_namespaceObject, { + "base16": () => (protons_runtime_node_modules_multiformats_src_bases_base16_base16), + "base16upper": () => (protons_runtime_node_modules_multiformats_src_bases_base16_base16upper) +}); - /** - * Decoded a CID from its binary representation at the beginning of a byte - * array. - * - * Returns an array with the first element containing the CID and the second - * element containing the remainder of the original byte array. The remainder - * will be a zero-length byte array if the provided bytes only contained a - * binary CID representation. - * - * @template {unknown} T - * @template {number} C - * @template {number} A - * @template {API.Version} V - * @param {API.ByteView>} bytes - * @returns {[CID, Uint8Array]} - */ - static decodeFirst (bytes) { - const specs = node_modules_multiformats_src_cid_CID.inspectBytes(bytes) - const prefixSize = specs.size - specs.multihashSize - const multihashBytes = node_modules_multiformats_src_bytes_coerce( - bytes.subarray(prefixSize, prefixSize + specs.multihashSize) - ) - if (multihashBytes.byteLength !== specs.multihashSize) { - throw new Error('Incorrect length') - } - const digestBytes = multihashBytes.subarray( - specs.multihashSize - specs.digestSize - ) - const digest = new node_modules_multiformats_src_hashes_digest_Digest( - specs.multihashCode, - specs.digestSize, - digestBytes, - multihashBytes - ) - const cid = - specs.version === 0 - ? node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) - : node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest) - return [/** @type {CID} */(cid), bytes.subarray(specs.size)] - } +// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base2.js +var protons_runtime_node_modules_multiformats_src_bases_base2_namespaceObject = {}; +__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_base2_namespaceObject); +__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_base2_namespaceObject, { + "base2": () => (protons_runtime_node_modules_multiformats_src_bases_base2_base2) +}); - /** - * Inspect the initial bytes of a CID to determine its properties. - * - * Involves decoding up to 4 varints. Typically this will require only 4 to 6 - * bytes but for larger multicodec code values and larger multihash digest - * lengths these varints can be quite large. It is recommended that at least - * 10 bytes be made available in the `initialBytes` argument for a complete - * inspection. - * - * @template {unknown} T - * @template {number} C - * @template {number} A - * @template {API.Version} V - * @param {API.ByteView>} initialBytes - * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }} - */ - static inspectBytes (initialBytes) { - let offset = 0 - const next = () => { - const [i, length] = node_modules_multiformats_src_varint_decode(initialBytes.subarray(offset)) - offset += length - return i - } +// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base256emoji.js +var protons_runtime_node_modules_multiformats_src_bases_base256emoji_namespaceObject = {}; +__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_base256emoji_namespaceObject); +__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_base256emoji_namespaceObject, { + "base256emoji": () => (protons_runtime_node_modules_multiformats_src_bases_base256emoji_base256emoji) +}); - let version = /** @type {V} */ (next()) - let codec = /** @type {C} */ (node_modules_multiformats_src_cid_DAG_PB_CODE) - if (/** @type {number} */(version) === 18) { - // CIDv0 - version = /** @type {V} */ (0) - offset = 0 - } else { - codec = /** @type {C} */ (next()) - } +// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base32.js +var protons_runtime_node_modules_multiformats_src_bases_base32_namespaceObject = {}; +__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_base32_namespaceObject); +__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_base32_namespaceObject, { + "base32": () => (protons_runtime_node_modules_multiformats_src_bases_base32_base32), + "base32hex": () => (protons_runtime_node_modules_multiformats_src_bases_base32_base32hex), + "base32hexpad": () => (protons_runtime_node_modules_multiformats_src_bases_base32_base32hexpad), + "base32hexpadupper": () => (protons_runtime_node_modules_multiformats_src_bases_base32_base32hexpadupper), + "base32hexupper": () => (protons_runtime_node_modules_multiformats_src_bases_base32_base32hexupper), + "base32pad": () => (protons_runtime_node_modules_multiformats_src_bases_base32_base32pad), + "base32padupper": () => (protons_runtime_node_modules_multiformats_src_bases_base32_base32padupper), + "base32upper": () => (protons_runtime_node_modules_multiformats_src_bases_base32_base32upper), + "base32z": () => (protons_runtime_node_modules_multiformats_src_bases_base32_base32z) +}); - if (version !== 0 && version !== 1) { - throw new RangeError(`Invalid CID version ${version}`) - } +// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base36.js +var protons_runtime_node_modules_multiformats_src_bases_base36_namespaceObject = {}; +__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_base36_namespaceObject); +__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_base36_namespaceObject, { + "base36": () => (protons_runtime_node_modules_multiformats_src_bases_base36_base36), + "base36upper": () => (protons_runtime_node_modules_multiformats_src_bases_base36_base36upper) +}); - const prefixSize = offset - const multihashCode = /** @type {A} */ (next()) // multihash code - const digestSize = next() // multihash length - const size = offset + digestSize - const multihashSize = size - prefixSize +// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base58.js +var protons_runtime_node_modules_multiformats_src_bases_base58_namespaceObject = {}; +__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_base58_namespaceObject); +__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_base58_namespaceObject, { + "base58btc": () => (protons_runtime_node_modules_multiformats_src_bases_base58_base58btc), + "base58flickr": () => (protons_runtime_node_modules_multiformats_src_bases_base58_base58flickr) +}); - return { version, codec, multihashCode, digestSize, multihashSize, size } - } +// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base64.js +var protons_runtime_node_modules_multiformats_src_bases_base64_namespaceObject = {}; +__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_base64_namespaceObject); +__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_base64_namespaceObject, { + "base64": () => (protons_runtime_node_modules_multiformats_src_bases_base64_base64), + "base64pad": () => (protons_runtime_node_modules_multiformats_src_bases_base64_base64pad), + "base64url": () => (protons_runtime_node_modules_multiformats_src_bases_base64_base64url), + "base64urlpad": () => (protons_runtime_node_modules_multiformats_src_bases_base64_base64urlpad) +}); - /** - * Takes cid in a string representation and creates an instance. If `base` - * decoder is not provided will use a default from the configuration. It will - * throw an error if encoding of the CID is not compatible with supplied (or - * a default decoder). - * - * @template {string} Prefix - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ToString, Prefix>} source - * @param {API.MultibaseDecoder} [base] - * @returns {CID} - */ - static parse (source, base) { - const [prefix, bytes] = node_modules_multiformats_src_cid_parseCIDtoBytes(source, base) +// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base8.js +var protons_runtime_node_modules_multiformats_src_bases_base8_namespaceObject = {}; +__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_base8_namespaceObject); +__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_base8_namespaceObject, { + "base8": () => (protons_runtime_node_modules_multiformats_src_bases_base8_base8) +}); - const cid = node_modules_multiformats_src_cid_CID.decode(bytes) +// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/identity.js +var protons_runtime_node_modules_multiformats_src_bases_identity_namespaceObject = {}; +__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_bases_identity_namespaceObject); +__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_bases_identity_namespaceObject, { + "identity": () => (protons_runtime_node_modules_multiformats_src_bases_identity_identity) +}); - if (cid.version === 0 && source[0] !== 'Q') { - throw Error('Version 0 CID string must not include multibase prefix') - } +// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/codecs/json.js +var protons_runtime_node_modules_multiformats_src_codecs_json_namespaceObject = {}; +__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_codecs_json_namespaceObject); +__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_codecs_json_namespaceObject, { + "code": () => (protons_runtime_node_modules_multiformats_src_codecs_json_code), + "decode": () => (protons_runtime_node_modules_multiformats_src_codecs_json_decode), + "encode": () => (protons_runtime_node_modules_multiformats_src_codecs_json_encode), + "name": () => (protons_runtime_node_modules_multiformats_src_codecs_json_name) +}); - // Cache string representation to avoid computing it on `this.toString()` - node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source) +// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/codecs/raw.js +var protons_runtime_node_modules_multiformats_src_codecs_raw_namespaceObject = {}; +__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_codecs_raw_namespaceObject); +__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_codecs_raw_namespaceObject, { + "code": () => (protons_runtime_node_modules_multiformats_src_codecs_raw_code), + "decode": () => (protons_runtime_node_modules_multiformats_src_codecs_raw_decode), + "encode": () => (protons_runtime_node_modules_multiformats_src_codecs_raw_encode), + "name": () => (protons_runtime_node_modules_multiformats_src_codecs_raw_name) +}); - return cid - } -} +// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/hashes/identity.js +var protons_runtime_node_modules_multiformats_src_hashes_identity_namespaceObject = {}; +__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_hashes_identity_namespaceObject); +__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_hashes_identity_namespaceObject, { + "identity": () => (protons_runtime_node_modules_multiformats_src_hashes_identity_identity) +}); -/** - * @template {string} Prefix - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ToString, Prefix>} source - * @param {API.MultibaseDecoder} [base] - * @returns {[Prefix, API.ByteView>]} - */ -const node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => { - switch (source[0]) { - // CIDv0 is parsed differently - case 'Q': { - const decoder = base || node_modules_multiformats_src_bases_base58_base58btc - return [ - /** @type {Prefix} */ (node_modules_multiformats_src_bases_base58_base58btc.prefix), - decoder.decode(`${node_modules_multiformats_src_bases_base58_base58btc.prefix}${source}`) - ] - } - case node_modules_multiformats_src_bases_base58_base58btc.prefix: { - const decoder = base || node_modules_multiformats_src_bases_base58_base58btc - return [/** @type {Prefix} */(node_modules_multiformats_src_bases_base58_base58btc.prefix), decoder.decode(source)] - } - case node_modules_multiformats_src_bases_base32_base32.prefix: { - const decoder = base || node_modules_multiformats_src_bases_base32_base32 - return [/** @type {Prefix} */(node_modules_multiformats_src_bases_base32_base32.prefix), decoder.decode(source)] - } - default: { - if (base == null) { - throw Error( - 'To parse non base32 or base58btc encoded CID multibase decoder must be provided' - ) - } - return [/** @type {Prefix} */(source[0]), base.decode(source)] - } - } -} +// NAMESPACE OBJECT: ./node_modules/protons-runtime/node_modules/multiformats/src/hashes/sha2.js +var protons_runtime_node_modules_multiformats_src_hashes_sha2_namespaceObject = {}; +__nccwpck_require__.r(protons_runtime_node_modules_multiformats_src_hashes_sha2_namespaceObject); +__nccwpck_require__.d(protons_runtime_node_modules_multiformats_src_hashes_sha2_namespaceObject, { + "sha256": () => (protons_runtime_node_modules_multiformats_src_hashes_sha2_sha256), + "sha512": () => (protons_runtime_node_modules_multiformats_src_hashes_sha2_sha512) +}); -/** - * - * @param {Uint8Array} bytes - * @param {Map} cache - * @param {API.MultibaseEncoder<'z'>} base - */ -const node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => { - const { prefix } = base - if (prefix !== node_modules_multiformats_src_bases_base58_base58btc.prefix) { - throw Error(`Cannot string encode V0 in ${base.name} encoding`) - } +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/codecs/raw.js +var dist_src_codecs_raw_namespaceObject = {}; +__nccwpck_require__.r(dist_src_codecs_raw_namespaceObject); +__nccwpck_require__.d(dist_src_codecs_raw_namespaceObject, { + "code": () => (dist_src_codecs_raw_code), + "decode": () => (dist_src_codecs_raw_decode), + "encode": () => (dist_src_codecs_raw_encode), + "name": () => (dist_src_codecs_raw_name) +}); - const cid = cache.get(prefix) - if (cid == null) { - const cid = base.encode(bytes).slice(1) - cache.set(prefix, cid) - return cid - } else { - return cid - } -} +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base32.js +var multiformats_dist_src_bases_base32_namespaceObject = {}; +__nccwpck_require__.r(multiformats_dist_src_bases_base32_namespaceObject); +__nccwpck_require__.d(multiformats_dist_src_bases_base32_namespaceObject, { + "base32": () => (multiformats_dist_src_bases_base32_base32), + "base32hex": () => (multiformats_dist_src_bases_base32_base32hex), + "base32hexpad": () => (multiformats_dist_src_bases_base32_base32hexpad), + "base32hexpadupper": () => (multiformats_dist_src_bases_base32_base32hexpadupper), + "base32hexupper": () => (multiformats_dist_src_bases_base32_base32hexupper), + "base32pad": () => (multiformats_dist_src_bases_base32_base32pad), + "base32padupper": () => (multiformats_dist_src_bases_base32_base32padupper), + "base32upper": () => (multiformats_dist_src_bases_base32_base32upper), + "base32z": () => (multiformats_dist_src_bases_base32_base32z) +}); -/** - * @template {string} Prefix - * @param {Uint8Array} bytes - * @param {Map} cache - * @param {API.MultibaseEncoder} base - */ -const node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => { - const { prefix } = base - const cid = cache.get(prefix) - if (cid == null) { - const cid = base.encode(bytes) - cache.set(prefix, cid) - return cid - } else { - return cid - } -} +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base58.js +var multiformats_dist_src_bases_base58_namespaceObject = {}; +__nccwpck_require__.r(multiformats_dist_src_bases_base58_namespaceObject); +__nccwpck_require__.d(multiformats_dist_src_bases_base58_namespaceObject, { + "base58btc": () => (multiformats_dist_src_bases_base58_base58btc), + "base58flickr": () => (multiformats_dist_src_bases_base58_base58flickr) +}); -const node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70 -const node_modules_multiformats_src_cid_SHA_256_CODE = 0x12 +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/hashes/sha2.js +var dist_src_hashes_sha2_namespaceObject = {}; +__nccwpck_require__.r(dist_src_hashes_sha2_namespaceObject); +__nccwpck_require__.d(dist_src_hashes_sha2_namespaceObject, { + "sha256": () => (dist_src_hashes_sha2_sha256), + "sha512": () => (dist_src_hashes_sha2_sha512) +}); -/** - * @param {API.Version} version - * @param {number} code - * @param {Uint8Array} multihash - * @returns {Uint8Array} - */ -const node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => { - const codeOffset = node_modules_multiformats_src_varint_encodingLength(version) - const hashOffset = codeOffset + node_modules_multiformats_src_varint_encodingLength(code) - const bytes = new Uint8Array(hashOffset + multihash.byteLength) - node_modules_multiformats_src_varint_encodeTo(version, bytes, 0) - node_modules_multiformats_src_varint_encodeTo(code, bytes, codeOffset) - bytes.set(multihash, hashOffset) - return bytes -} +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base10.js +var dist_src_bases_base10_namespaceObject = {}; +__nccwpck_require__.r(dist_src_bases_base10_namespaceObject); +__nccwpck_require__.d(dist_src_bases_base10_namespaceObject, { + "base10": () => (dist_src_bases_base10_base10) +}); -const node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base16.js +var dist_src_bases_base16_namespaceObject = {}; +__nccwpck_require__.r(dist_src_bases_base16_namespaceObject); +__nccwpck_require__.d(dist_src_bases_base16_namespaceObject, { + "base16": () => (dist_src_bases_base16_base16), + "base16upper": () => (dist_src_bases_base16_base16upper) +}); -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/index.js +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base2.js +var dist_src_bases_base2_namespaceObject = {}; +__nccwpck_require__.r(dist_src_bases_base2_namespaceObject); +__nccwpck_require__.d(dist_src_bases_base2_namespaceObject, { + "base2": () => (dist_src_bases_base2_base2) +}); +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base256emoji.js +var dist_src_bases_base256emoji_namespaceObject = {}; +__nccwpck_require__.r(dist_src_bases_base256emoji_namespaceObject); +__nccwpck_require__.d(dist_src_bases_base256emoji_namespaceObject, { + "base256emoji": () => (dist_src_bases_base256emoji_base256emoji) +}); +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base36.js +var dist_src_bases_base36_namespaceObject = {}; +__nccwpck_require__.r(dist_src_bases_base36_namespaceObject); +__nccwpck_require__.d(dist_src_bases_base36_namespaceObject, { + "base36": () => (dist_src_bases_base36_base36), + "base36upper": () => (dist_src_bases_base36_base36upper) +}); +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base64.js +var multiformats_dist_src_bases_base64_namespaceObject = {}; +__nccwpck_require__.r(multiformats_dist_src_bases_base64_namespaceObject); +__nccwpck_require__.d(multiformats_dist_src_bases_base64_namespaceObject, { + "base64": () => (dist_src_bases_base64_base64), + "base64pad": () => (dist_src_bases_base64_base64pad), + "base64url": () => (dist_src_bases_base64_base64url), + "base64urlpad": () => (dist_src_bases_base64_base64urlpad) +}); +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base8.js +var dist_src_bases_base8_namespaceObject = {}; +__nccwpck_require__.r(dist_src_bases_base8_namespaceObject); +__nccwpck_require__.d(dist_src_bases_base8_namespaceObject, { + "base8": () => (dist_src_bases_base8_base8) +}); -// This way TS will also expose all the types from module +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/identity.js +var dist_src_bases_identity_namespaceObject = {}; +__nccwpck_require__.r(dist_src_bases_identity_namespaceObject); +__nccwpck_require__.d(dist_src_bases_identity_namespaceObject, { + "identity": () => (dist_src_bases_identity_identity) +}); +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/codecs/json.js +var dist_src_codecs_json_namespaceObject = {}; +__nccwpck_require__.r(dist_src_codecs_json_namespaceObject); +__nccwpck_require__.d(dist_src_codecs_json_namespaceObject, { + "code": () => (dist_src_codecs_json_code), + "decode": () => (dist_src_codecs_json_decode), + "encode": () => (dist_src_codecs_json_encode), + "name": () => (dist_src_codecs_json_name) +}); +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/hashes/identity.js +var dist_src_hashes_identity_namespaceObject = {}; +__nccwpck_require__.r(dist_src_hashes_identity_namespaceObject); +__nccwpck_require__.d(dist_src_hashes_identity_namespaceObject, { + "identity": () => (dist_src_hashes_identity_identity) +}); +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base32.js +var unixfs_node_modules_multiformats_src_bases_base32_namespaceObject = {}; +__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_base32_namespaceObject); +__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_base32_namespaceObject, { + "base32": () => (unixfs_node_modules_multiformats_src_bases_base32_base32), + "base32hex": () => (unixfs_node_modules_multiformats_src_bases_base32_base32hex), + "base32hexpad": () => (unixfs_node_modules_multiformats_src_bases_base32_base32hexpad), + "base32hexpadupper": () => (unixfs_node_modules_multiformats_src_bases_base32_base32hexpadupper), + "base32hexupper": () => (unixfs_node_modules_multiformats_src_bases_base32_base32hexupper), + "base32pad": () => (unixfs_node_modules_multiformats_src_bases_base32_base32pad), + "base32padupper": () => (unixfs_node_modules_multiformats_src_bases_base32_base32padupper), + "base32upper": () => (unixfs_node_modules_multiformats_src_bases_base32_base32upper), + "base32z": () => (unixfs_node_modules_multiformats_src_bases_base32_base32z) +}); -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/basics.js -// @ts-check +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base58.js +var unixfs_node_modules_multiformats_src_bases_base58_namespaceObject = {}; +__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_base58_namespaceObject); +__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_base58_namespaceObject, { + "base58btc": () => (unixfs_node_modules_multiformats_src_bases_base58_base58btc), + "base58flickr": () => (unixfs_node_modules_multiformats_src_bases_base58_base58flickr) +}); +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base10.js +var unixfs_node_modules_multiformats_src_bases_base10_namespaceObject = {}; +__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_base10_namespaceObject); +__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_base10_namespaceObject, { + "base10": () => (unixfs_node_modules_multiformats_src_bases_base10_base10) +}); +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base16.js +var unixfs_node_modules_multiformats_src_bases_base16_namespaceObject = {}; +__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_base16_namespaceObject); +__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_base16_namespaceObject, { + "base16": () => (unixfs_node_modules_multiformats_src_bases_base16_base16), + "base16upper": () => (unixfs_node_modules_multiformats_src_bases_base16_base16upper) +}); +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base2.js +var unixfs_node_modules_multiformats_src_bases_base2_namespaceObject = {}; +__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_base2_namespaceObject); +__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_base2_namespaceObject, { + "base2": () => (unixfs_node_modules_multiformats_src_bases_base2_base2) +}); +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base256emoji.js +var unixfs_node_modules_multiformats_src_bases_base256emoji_namespaceObject = {}; +__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_base256emoji_namespaceObject); +__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_base256emoji_namespaceObject, { + "base256emoji": () => (unixfs_node_modules_multiformats_src_bases_base256emoji_base256emoji) +}); +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base36.js +var unixfs_node_modules_multiformats_src_bases_base36_namespaceObject = {}; +__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_base36_namespaceObject); +__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_base36_namespaceObject, { + "base36": () => (unixfs_node_modules_multiformats_src_bases_base36_base36), + "base36upper": () => (unixfs_node_modules_multiformats_src_bases_base36_base36upper) +}); +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base64.js +var unixfs_node_modules_multiformats_src_bases_base64_namespaceObject = {}; +__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_base64_namespaceObject); +__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_base64_namespaceObject, { + "base64": () => (unixfs_node_modules_multiformats_src_bases_base64_base64), + "base64pad": () => (unixfs_node_modules_multiformats_src_bases_base64_base64pad), + "base64url": () => (unixfs_node_modules_multiformats_src_bases_base64_base64url), + "base64urlpad": () => (unixfs_node_modules_multiformats_src_bases_base64_base64urlpad) +}); +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base8.js +var unixfs_node_modules_multiformats_src_bases_base8_namespaceObject = {}; +__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_base8_namespaceObject); +__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_base8_namespaceObject, { + "base8": () => (unixfs_node_modules_multiformats_src_bases_base8_base8) +}); +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/identity.js +var unixfs_node_modules_multiformats_src_bases_identity_namespaceObject = {}; +__nccwpck_require__.r(unixfs_node_modules_multiformats_src_bases_identity_namespaceObject); +__nccwpck_require__.d(unixfs_node_modules_multiformats_src_bases_identity_namespaceObject, { + "identity": () => (unixfs_node_modules_multiformats_src_bases_identity_identity) +}); +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/codecs/json.js +var unixfs_node_modules_multiformats_src_codecs_json_namespaceObject = {}; +__nccwpck_require__.r(unixfs_node_modules_multiformats_src_codecs_json_namespaceObject); +__nccwpck_require__.d(unixfs_node_modules_multiformats_src_codecs_json_namespaceObject, { + "code": () => (unixfs_node_modules_multiformats_src_codecs_json_code), + "decode": () => (unixfs_node_modules_multiformats_src_codecs_json_decode), + "encode": () => (unixfs_node_modules_multiformats_src_codecs_json_encode), + "name": () => (unixfs_node_modules_multiformats_src_codecs_json_name) +}); +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/codecs/raw.js +var unixfs_node_modules_multiformats_src_codecs_raw_namespaceObject = {}; +__nccwpck_require__.r(unixfs_node_modules_multiformats_src_codecs_raw_namespaceObject); +__nccwpck_require__.d(unixfs_node_modules_multiformats_src_codecs_raw_namespaceObject, { + "code": () => (unixfs_node_modules_multiformats_src_codecs_raw_code), + "decode": () => (unixfs_node_modules_multiformats_src_codecs_raw_decode), + "encode": () => (unixfs_node_modules_multiformats_src_codecs_raw_encode), + "name": () => (unixfs_node_modules_multiformats_src_codecs_raw_name) +}); +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/hashes/identity.js +var unixfs_node_modules_multiformats_src_hashes_identity_namespaceObject = {}; +__nccwpck_require__.r(unixfs_node_modules_multiformats_src_hashes_identity_namespaceObject); +__nccwpck_require__.d(unixfs_node_modules_multiformats_src_hashes_identity_namespaceObject, { + "identity": () => (unixfs_node_modules_multiformats_src_hashes_identity_identity) +}); +// NAMESPACE OBJECT: ./node_modules/@helia/unixfs/node_modules/multiformats/src/hashes/sha2.js +var unixfs_node_modules_multiformats_src_hashes_sha2_namespaceObject = {}; +__nccwpck_require__.r(unixfs_node_modules_multiformats_src_hashes_sha2_namespaceObject); +__nccwpck_require__.d(unixfs_node_modules_multiformats_src_hashes_sha2_namespaceObject, { + "sha256": () => (unixfs_node_modules_multiformats_src_hashes_sha2_sha256), + "sha512": () => (unixfs_node_modules_multiformats_src_hashes_sha2_sha512) +}); +// NAMESPACE OBJECT: ./node_modules/blockstore-fs/node_modules/blockstore-core/dist/src/errors.js +var blockstore_core_dist_src_errors_namespaceObject = {}; +__nccwpck_require__.r(blockstore_core_dist_src_errors_namespaceObject); +__nccwpck_require__.d(blockstore_core_dist_src_errors_namespaceObject, { + "abortedError": () => (abortedError), + "closeFailedError": () => (closeFailedError), + "deleteFailedError": () => (deleteFailedError), + "getFailedError": () => (getFailedError), + "hasFailedError": () => (hasFailedError), + "notFoundError": () => (notFoundError), + "openFailedError": () => (openFailedError), + "putFailedError": () => (putFailedError) +}); +// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js +var core = __nccwpck_require__(42704); +// EXTERNAL MODULE: ./node_modules/@actions/github/lib/github.js +var github = __nccwpck_require__(53266); +;// CONCATENATED MODULE: external "node:fs" +const external_node_fs_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs"); +;// CONCATENATED MODULE: external "node:path" +const external_node_path_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path"); +;// CONCATENATED MODULE: ./pinners/maker.js +/* harmony default export */ const maker = (({ builder, upload }) => + async (options) => { + const api = await builder(options); + return { + upload: async (options) => { + const { path } = options; + if (!path) { + throw new Error("Path is empty"); + } -const bases = { ...bases_identity_namespaceObject, ...base2_namespaceObject, ...base8_namespaceObject, ...base10_namespaceObject, ...base16_namespaceObject, ...node_modules_multiformats_src_bases_base32_namespaceObject, ...base36_namespaceObject, ...node_modules_multiformats_src_bases_base58_namespaceObject, ...src_bases_base64_namespaceObject, ...base256emoji_namespaceObject } -const hashes = { ...sha2_namespaceObject, ...identity_namespaceObject } -const codecs = { raw: raw_namespaceObject, json: codecs_json_namespaceObject } + let source = path; + if (!external_node_path_namespaceObject.isAbsolute(source)) { + const dir = ( + process.env.GITHUB_WORKSPACE || process.cwd() + ).toString(); + source = external_node_path_namespaceObject.join(dir, source); + } + const pattern = external_node_fs_namespaceObject.lstatSync(source).isDirectory() + ? `${external_node_path_namespaceObject.basename(source)}/**/*` + : external_node_path_namespaceObject.basename(source); + return upload(api, { ...options, path: source, pattern }); + }, + }; + }); -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/connection/index.js -const connectionSymbol = Symbol.for('@libp2p/connection'); -function isConnection(other) { - return other != null && Boolean(other[connectionSymbol]); -} -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/content-routing/index.js -/** - * Any object that implements this Symbol as a property should return a - * ContentRouting instance as the property value, similar to how - * `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. - * - * @example - * - * ```js - * import { contentRoutingSymbol, ContentRouting } from '@libp2p/content-routing' - * - * class MyContentRouter implements ContentRouting { - * get [contentRoutingSymbol] () { - * return this - * } - * - * // ...other methods - * } - * ``` - */ -const contentRoutingSymbol = Symbol.for('@libp2p/content-routing'); -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/peer-discovery/index.js -/** - * Any object that implements this Symbol as a property should return a - * PeerDiscovery instance as the property value, similar to how - * `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. - * - * @example - * - * ```js - * import { peerDiscovery, PeerDiscovery } from '@libp2p/peer-discovery' - * - * class MyPeerDiscoverer implements PeerDiscovery { - * get [peerDiscovery] () { - * return this - * } - * - * // ...other methods - * } - * ``` - */ -const peerDiscoverySymbol = Symbol.for('@libp2p/peer-discovery'); -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/peer-id/index.js -const peerIdSymbol = Symbol.for('@libp2p/peer-id'); -function isPeerId(other) { - return other != null && Boolean(other[peerIdSymbol]); -} -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/peer-routing/index.js -/** - * Any object that implements this Symbol as a property should return a - * PeerRouting instance as the property value, similar to how - * `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. - * - * @example - * - * ```js - * import { peerRouting, PeerRouting } from '@libp2p/peer-routing' - * - * class MyPeerRouter implements PeerRouting { - * get [peerRouting] () { - * return this - * } - * - * // ...other methods - * } - * ``` - */ -const peerRoutingSymbol = Symbol.for('@libp2p/peer-routing'); -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/pubsub/index.js -/** - * On the producing side: - * * Build messages with the signature, key (from may be enough for certain inlineable public key types), from and seqno fields. - * - * On the consuming side: - * * Enforce the fields to be present, reject otherwise. - * * Propagate only if the fields are valid and signature can be verified, reject otherwise. - */ -const StrictSign = 'StrictSign'; -/** - * On the producing side: - * * Build messages without the signature, key, from and seqno fields. - * * The corresponding protobuf key-value pairs are absent from the marshalled message, not just empty. - * - * On the consuming side: - * * Enforce the fields to be absent, reject otherwise. - * * Propagate only if the fields are absent, reject otherwise. - * * A message_id function will not be able to use the above fields, and should instead rely on the data field. A commonplace strategy is to calculate a hash. - */ -const StrictNoSign = 'StrictNoSign'; -var TopicValidatorResult; -(function (TopicValidatorResult) { - /** - * The message is considered valid, and it should be delivered and forwarded to the network - */ - TopicValidatorResult["Accept"] = "accept"; - /** - * The message is neither delivered nor forwarded to the network - */ - TopicValidatorResult["Ignore"] = "ignore"; - /** - * The message is considered invalid, and it should be rejected - */ - TopicValidatorResult["Reject"] = "reject"; -})(TopicValidatorResult || (TopicValidatorResult = {})); -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/transport/index.js -const transportSymbol = Symbol.for('@libp2p/transport'); -function isTransport(other) { - return other != null && Boolean(other[transportSymbol]); -} +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/multibases.js /** - * Enum Transport Manager Fault Tolerance values + * @typedef {import('multiformats/bases/interface').MultibaseCodec} MultibaseCodec + * @typedef {import('./types').LoadBaseFn} LoadBaseFn + * @typedef {import('ipfs-core-types/src/utils').AbortOptions} AbortOptions */ -var FaultTolerance; -(function (FaultTolerance) { - /** - * should be used for failing in any listen circumstance - */ - FaultTolerance[FaultTolerance["FATAL_ALL"] = 0] = "FATAL_ALL"; - /** - * should be used for not failing when not listening - */ - FaultTolerance[FaultTolerance["NO_FATAL"] = 1] = "NO_FATAL"; -})(FaultTolerance || (FaultTolerance = {})); -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/errors.js + /** - * When this error is thrown it means an operation was aborted, - * usually in response to the `abort` event being emitted by an - * AbortSignal. + * @type {LoadBaseFn} */ -class AbortError extends Error { - code; - type; - constructor(message = 'The operation was aborted') { - super(message); - this.code = AbortError.code; - this.type = AbortError.type; +const LOAD_BASE = (name) => Promise.reject(new Error(`No base found for "${name}"`)) + +class Multibases { + /** + * @param {object} options + * @param {LoadBaseFn} [options.loadBase] + * @param {MultibaseCodec[]} options.bases + */ + constructor (options) { + // Object with current list of active resolvers + /** @type {Record}} */ + this._basesByName = {} + + // Object with current list of active resolvers + /** @type {Record}} */ + this._basesByPrefix = {} + + this._loadBase = options.loadBase || LOAD_BASE + + // Enable all supplied codecs + for (const base of options.bases) { + this.addBase(base) } - static code = (/* unused pure expression or super */ null && ('ABORT_ERR')); - static type = (/* unused pure expression or super */ null && ('aborted')); -} -class errors_CodeError extends Error { - code; - props; - constructor(message, code, props) { - super(message); - this.code = code; - this.name = props?.name ?? 'CodeError'; - this.props = props ?? {}; // eslint-disable-line @typescript-eslint/consistent-type-assertions + } + + /** + * Add support for a multibase codec + * + * @param {MultibaseCodec} base + */ + addBase (base) { + if (this._basesByName[base.name] || this._basesByPrefix[base.prefix]) { + throw new Error(`Codec already exists for codec "${base.name}"`) } -} -class UnexpectedPeerError extends Error { - code; - constructor(message = 'Unexpected Peer') { - super(message); - this.code = UnexpectedPeerError.code; + + this._basesByName[base.name] = base + this._basesByPrefix[base.prefix] = base + } + + /** + * Remove support for a multibase codec + * + * @param {MultibaseCodec} base + */ + removeBase (base) { + delete this._basesByName[base.name] + delete this._basesByPrefix[base.prefix] + } + + /** + * @param {string} nameOrPrefix + */ + async getBase (nameOrPrefix) { + if (this._basesByName[nameOrPrefix]) { + return this._basesByName[nameOrPrefix] } - static code = (/* unused pure expression or super */ null && ('ERR_UNEXPECTED_PEER')); -} -class InvalidCryptoExchangeError extends Error { - code; - constructor(message = 'Invalid crypto exchange') { - super(message); - this.code = InvalidCryptoExchangeError.code; + + if (this._basesByPrefix[nameOrPrefix]) { + return this._basesByPrefix[nameOrPrefix] } - static code = (/* unused pure expression or super */ null && ('ERR_INVALID_CRYPTO_EXCHANGE')); -} -class InvalidCryptoTransmissionError extends Error { - code; - constructor(message = 'Invalid crypto transmission') { - super(message); - this.code = InvalidCryptoTransmissionError.code; + + // If not supported, attempt to dynamically load this codec + const base = await this._loadBase(nameOrPrefix) + + if (this._basesByName[base.name] == null && this._basesByPrefix[base.prefix] == null) { + this.addBase(base) } - static code = (/* unused pure expression or super */ null && ('ERR_INVALID_CRYPTO_TRANSMISSION')); + + return base + } + + listBases () { + return Object.values(this._basesByName) + } } -// Error codes -const ERR_TIMEOUT = 'ERR_TIMEOUT'; -const ERR_INVALID_PARAMETERS = 'ERR_INVALID_PARAMETERS'; -const ERR_NOT_FOUND = 'ERR_NOT_FOUND'; -const ERR_INVALID_MESSAGE = 'ERR_INVALID_MESSAGE'; -//# sourceMappingURL=errors.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/event-target.js + +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/multicodecs.js /** - * An implementation of a typed event target - * etc - */ -class TypedEventEmitter extends EventTarget { - #listeners = new Map(); - listenerCount(type) { - const listeners = this.#listeners.get(type); - if (listeners == null) { - return 0; - } - return listeners.length; - } - addEventListener(type, listener, options) { - super.addEventListener(type, listener, options); - let list = this.#listeners.get(type); - if (list == null) { - list = []; - this.#listeners.set(type, list); - } - list.push({ - callback: listener, - once: (options !== true && options !== false && options?.once) ?? false - }); - } - removeEventListener(type, listener, options) { - super.removeEventListener(type.toString(), listener ?? null, options); - let list = this.#listeners.get(type); - if (list == null) { - return; - } - list = list.filter(({ callback }) => callback !== listener); - this.#listeners.set(type, list); - } - dispatchEvent(event) { - const result = super.dispatchEvent(event); - let list = this.#listeners.get(event.type); - if (list == null) { - return result; - } - list = list.filter(({ once }) => !once); - this.#listeners.set(event.type, list); - return result; - } - safeDispatchEvent(type, detail) { - return this.dispatchEvent(new CustomEvent(type, detail)); - } -} + * @typedef {import('multiformats/codecs/interface').BlockCodec} BlockCodec + * @typedef {import('./types').LoadCodecFn} LoadCodecFn + * @typedef {import('ipfs-core-types/src/utils').AbortOptions} AbortOptions + */ + /** - * CustomEvent is a standard event but it's not supported by node. - * - * Remove this when https://github.com/nodejs/node/issues/40678 is closed. - * - * Ref: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent + * @type {LoadCodecFn} */ -class CustomEventPolyfill extends Event { - /** Returns any custom data event was created with. Typically used for synthetic events. */ - detail; - constructor(message, data) { - super(message, data); - // @ts-expect-error could be undefined - this.detail = data?.detail; - } -} -const CustomEvent = globalThis.CustomEvent ?? CustomEventPolyfill; -//# sourceMappingURL=event-target.js.map -// EXTERNAL MODULE: external "events" -var external_events_ = __nccwpck_require__(82361); -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/events.js +const LOAD_CODEC = (codeOrName) => Promise.reject(new Error(`No codec found for "${codeOrName}"`)) -// create a setMaxListeners that doesn't break browser usage -const setMaxListeners = (n, ...eventTargets) => { - try { - nodeSetMaxListeners(n, ...eventTargets); +class Multicodecs { + /** + * @param {object} options + * @param {LoadCodecFn} [options.loadCodec] + * @param {BlockCodec[]} options.codecs + */ + constructor (options) { + // Object with current list of active resolvers + /** @type {Record}} */ + this._codecsByName = {} + + // Object with current list of active resolvers + /** @type {Record}} */ + this._codecsByCode = {} + + this._loadCodec = options.loadCodec || LOAD_CODEC + + // Enable all supplied codecs + for (const codec of options.codecs) { + this.addCodec(codec) } - catch { - // swallow error, gulp + } + + /** + * Add support for a block codec + * + * @param {BlockCodec} codec + */ + addCodec (codec) { + if (this._codecsByName[codec.name] || this._codecsByCode[codec.code]) { + throw new Error(`Resolver already exists for codec "${codec.name}"`) } -}; -//# sourceMappingURL=events.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/index.js -/** - * @packageDocumentation - * - * Exports a `Libp2p` type for modules to use as a type argument. - * - * @example - * - * ```typescript - * import type { Libp2p } from '@libp2p/interface' - * - * function doSomethingWithLibp2p (node: Libp2p) { - * // ... - * } - * ``` - */ + this._codecsByName[codec.name] = codec + this._codecsByCode[codec.code] = codec + } + + /** + * Remove support for a block codec + * + * @param {BlockCodec} codec + */ + removeCodec (codec) { + delete this._codecsByName[codec.name] + delete this._codecsByCode[codec.code] + } + + /** + * @param {number | string} code + */ + async getCodec (code) { + const table = typeof code === 'string' ? this._codecsByName : this._codecsByCode + if (table[code]) { + return table[code] + } + // If not supported, attempt to dynamically load this codec + const codec = await this._loadCodec(code) + if (table[code] == null) { + this.addCodec(codec) + } + return codec + } + listCodecs () { + return Object.values(this._codecsByName) + } +} +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/multihashes.js +/** + * @typedef {import('multiformats/hashes/interface').MultihashHasher} MultihashHasher + * @typedef {import('./types').LoadHasherFn} LoadHasherFn + * @typedef {import('ipfs-core-types/src/utils').AbortOptions} AbortOptions + */ +/** + * @type {LoadHasherFn} + */ +const LOAD_HASHER = (codeOrName) => Promise.reject(new Error(`No hasher found for "${codeOrName}"`)) +class Multihashes { + /** + * @param {object} options + * @param {LoadHasherFn} [options.loadHasher] + * @param {MultihashHasher[]} options.hashers + */ + constructor (options) { + // Object with current list of active hashers + /** @type {Record}} */ + this._hashersByName = {} + // Object with current list of active hashers + /** @type {Record}} */ + this._hashersByCode = {} + this._loadHasher = options.loadHasher || LOAD_HASHER + // Enable all supplied hashers + for (const hasher of options.hashers) { + this.addHasher(hasher) + } + } + /** + * Add support for a multibase hasher + * + * @param {MultihashHasher} hasher + */ + addHasher (hasher) { + if (this._hashersByName[hasher.name] || this._hashersByCode[hasher.code]) { + throw new Error(`Resolver already exists for codec "${hasher.name}"`) + } + this._hashersByName[hasher.name] = hasher + this._hashersByCode[hasher.code] = hasher + } + /** + * Remove support for a multibase hasher + * + * @param {MultihashHasher} hasher + */ + removeHasher (hasher) { + delete this._hashersByName[hasher.name] + delete this._hashersByCode[hasher.code] + } + /** + * @param {number | string} code + */ + async getHasher (code) { + const table = typeof code === 'string' ? this._hashersByName : this._hashersByCode + if (table[code]) { + return table[code] + } + // If not supported, attempt to dynamically load this hasher + const hasher = await this._loadHasher(code) + if (table[code] == null) { + this.addHasher(hasher) + } + return hasher + } + listHashers () { + return Object.values(this._hashersByName) + } +} -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bytes.js -const dist_src_bytes_empty = new Uint8Array(0); -function dist_src_bytes_toHex(d) { +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/node_modules/multiformats/dist/src/bytes.js +const empty = new Uint8Array(0); +function toHex(d) { return d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), ''); } -function dist_src_bytes_fromHex(hex) { +function fromHex(hex) { const hexes = hex.match(/../g); - return hexes != null ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : dist_src_bytes_empty; + return hexes != null ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : empty; } -function dist_src_bytes_equals(aa, bb) { +function equals(aa, bb) { if (aa === bb) return true; if (aa.byteLength !== bb.byteLength) { @@ -219941,7 +138324,7 @@ function dist_src_bytes_equals(aa, bb) { } return true; } -function multiformats_dist_src_bytes_coerce(o) { +function bytes_coerce(o) { if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o; if (o instanceof ArrayBuffer) @@ -219951,17 +138334,17 @@ function multiformats_dist_src_bytes_coerce(o) { } throw new Error('Unknown type, must be binary type'); } -function dist_src_bytes_isBinary(o) { +function isBinary(o) { return o instanceof ArrayBuffer || ArrayBuffer.isView(o); } -function dist_src_bytes_fromString(str) { +function fromString(str) { return new TextEncoder().encode(str); } -function multiformats_dist_src_bytes_toString(b) { +function bytes_toString(b) { return new TextDecoder().decode(b); } //# sourceMappingURL=bytes.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/vendor/base-x.js +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/node_modules/multiformats/dist/src/vendor/base-x.js /* eslint-disable */ // base-x encoding / decoding // Copyright (c) 2018 base-x contributors @@ -219972,7 +138355,7 @@ function multiformats_dist_src_bytes_toString(b) { * @param {string} ALPHABET * @param {any} name */ -function src_vendor_base_x_base(ALPHABET, name) { +function base(ALPHABET, name) { if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long'); } @@ -220128,11 +138511,11 @@ function src_vendor_base_x_base(ALPHABET, name) { decode: decode }; } -var src_vendor_base_x_src = src_vendor_base_x_base; -var src_vendor_base_x_brrp_multiformats_scope_baseX = src_vendor_base_x_src; -/* harmony default export */ const dist_src_vendor_base_x = (src_vendor_base_x_brrp_multiformats_scope_baseX); +var src = base; +var _brrp__multiformats_scope_baseX = src; +/* harmony default export */ const base_x = (_brrp__multiformats_scope_baseX); //# sourceMappingURL=base-x.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base.js +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/node_modules/multiformats/dist/src/bases/base.js /** @@ -220140,7 +138523,7 @@ var src_vendor_base_x_brrp_multiformats_scope_baseX = src_vendor_base_x_src; * can be used to encode to multibase or base encode without multibase * prefix. */ -class dist_src_bases_base_Encoder { +class Encoder { name; prefix; baseEncode; @@ -220163,7 +138546,7 @@ class dist_src_bases_base_Encoder { * to decode multibases (with matching prefix) or just base decode strings * with corresponding base encoding. */ -class dist_src_bases_base_Decoder { +class Decoder { name; prefix; baseDecode; @@ -220190,16 +138573,16 @@ class dist_src_bases_base_Decoder { } } or(decoder) { - return dist_src_bases_base_or(this, decoder); + return or(this, decoder); } } -class dist_src_bases_base_ComposedDecoder { +class ComposedDecoder { decoders; constructor(decoders) { this.decoders = decoders; } or(decoder) { - return dist_src_bases_base_or(this, decoder); + return or(this, decoder); } decode(input) { const prefix = input[0]; @@ -220212,14 +138595,14 @@ class dist_src_bases_base_ComposedDecoder { } } } -function dist_src_bases_base_or(left, right) { +function or(left, right) { // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - return new dist_src_bases_base_ComposedDecoder({ + return new ComposedDecoder({ ...(left.decoders ?? { [left.prefix]: left }), ...(right.decoders ?? { [right.prefix]: right }) }); } -class dist_src_bases_base_Codec { +class Codec { name; prefix; baseEncode; @@ -220231,8 +138614,8 @@ class dist_src_bases_base_Codec { this.prefix = prefix; this.baseEncode = baseEncode; this.baseDecode = baseDecode; - this.encoder = new dist_src_bases_base_Encoder(name, prefix, baseEncode); - this.decoder = new dist_src_bases_base_Decoder(name, prefix, baseDecode); + this.encoder = new Encoder(name, prefix, baseEncode); + this.decoder = new Decoder(name, prefix, baseDecode); } encode(input) { return this.encoder.encode(input); @@ -220241,19 +138624,19 @@ class dist_src_bases_base_Codec { return this.decoder.decode(input); } } -function dist_src_bases_base_from({ name, prefix, encode, decode }) { - return new dist_src_bases_base_Codec(name, prefix, encode, decode); +function from({ name, prefix, encode, decode }) { + return new Codec(name, prefix, encode, decode); } -function dist_src_bases_base_baseX({ name, prefix, alphabet }) { - const { encode, decode } = dist_src_vendor_base_x(alphabet, name); - return dist_src_bases_base_from({ +function baseX({ name, prefix, alphabet }) { + const { encode, decode } = base_x(alphabet, name); + return from({ prefix, name, encode, - decode: (text) => multiformats_dist_src_bytes_coerce(decode(text)) + decode: (text) => bytes_coerce(decode(text)) }); } -function dist_src_bases_base_decode(string, alphabet, bitsPerChar, name) { +function decode(string, alphabet, bitsPerChar, name) { // Build the character lookup table: const codes = {}; for (let i = 0; i < alphabet.length; ++i) { @@ -220291,7 +138674,7 @@ function dist_src_bases_base_decode(string, alphabet, bitsPerChar, name) { } return out; } -function dist_src_bases_base_encode(data, alphabet, bitsPerChar) { +function encode(data, alphabet, bitsPerChar) { const pad = alphabet[alphabet.length - 1] === '='; const mask = (1 << bitsPerChar) - 1; let out = ''; @@ -220322,212 +138705,212 @@ function dist_src_bases_base_encode(data, alphabet, bitsPerChar) { /** * RFC4648 Factory */ -function dist_src_bases_base_rfc4648({ name, prefix, bitsPerChar, alphabet }) { - return dist_src_bases_base_from({ +function rfc4648({ name, prefix, bitsPerChar, alphabet }) { + return from({ prefix, name, encode(input) { - return dist_src_bases_base_encode(input, alphabet, bitsPerChar); + return encode(input, alphabet, bitsPerChar); }, decode(input) { - return dist_src_bases_base_decode(input, alphabet, bitsPerChar, name); + return decode(input, alphabet, bitsPerChar, name); } }); } //# sourceMappingURL=base.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base58.js - -const dist_src_bases_base58_base58btc = dist_src_bases_base_baseX({ - name: 'base58btc', - prefix: 'z', - alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -}); -const dist_src_bases_base58_base58flickr = dist_src_bases_base_baseX({ - name: 'base58flickr', - prefix: 'Z', - alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -}); -//# sourceMappingURL=base58.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base32.js +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/node_modules/multiformats/dist/src/bases/base32.js -const dist_src_bases_base32_base32 = dist_src_bases_base_rfc4648({ +const base32_base32 = rfc4648({ prefix: 'b', name: 'base32', alphabet: 'abcdefghijklmnopqrstuvwxyz234567', bitsPerChar: 5 }); -const dist_src_bases_base32_base32upper = dist_src_bases_base_rfc4648({ +const base32_base32upper = rfc4648({ prefix: 'B', name: 'base32upper', alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', bitsPerChar: 5 }); -const dist_src_bases_base32_base32pad = dist_src_bases_base_rfc4648({ +const base32pad = rfc4648({ prefix: 'c', name: 'base32pad', alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', bitsPerChar: 5 }); -const dist_src_bases_base32_base32padupper = dist_src_bases_base_rfc4648({ +const base32padupper = rfc4648({ prefix: 'C', name: 'base32padupper', alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', bitsPerChar: 5 }); -const dist_src_bases_base32_base32hex = dist_src_bases_base_rfc4648({ +const base32hex = rfc4648({ prefix: 'v', name: 'base32hex', alphabet: '0123456789abcdefghijklmnopqrstuv', bitsPerChar: 5 }); -const dist_src_bases_base32_base32hexupper = dist_src_bases_base_rfc4648({ +const base32hexupper = rfc4648({ prefix: 'V', name: 'base32hexupper', alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', bitsPerChar: 5 }); -const dist_src_bases_base32_base32hexpad = dist_src_bases_base_rfc4648({ +const base32hexpad = rfc4648({ prefix: 't', name: 'base32hexpad', alphabet: '0123456789abcdefghijklmnopqrstuv=', bitsPerChar: 5 }); -const dist_src_bases_base32_base32hexpadupper = dist_src_bases_base_rfc4648({ +const base32hexpadupper = rfc4648({ prefix: 'T', name: 'base32hexpadupper', alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', bitsPerChar: 5 }); -const dist_src_bases_base32_base32z = dist_src_bases_base_rfc4648({ +const base32z = rfc4648({ prefix: 'h', name: 'base32z', alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', bitsPerChar: 5 }); //# sourceMappingURL=base32.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/vendor/varint.js +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/node_modules/multiformats/dist/src/bases/base58.js + +const base58_base58btc = baseX({ + name: 'base58btc', + prefix: 'z', + alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +}); +const base58flickr = baseX({ + name: 'base58flickr', + prefix: 'Z', + alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' +}); +//# sourceMappingURL=base58.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/node_modules/multiformats/dist/src/vendor/varint.js /* eslint-disable */ -var src_vendor_varint_encode_1 = dist_src_vendor_varint_encode; -var src_vendor_varint_MSB = 0x80, src_vendor_varint_REST = 0x7F, src_vendor_varint_MSBALL = ~src_vendor_varint_REST, src_vendor_varint_INT = Math.pow(2, 31); +var encode_1 = varint_encode; +var MSB = 0x80, REST = 0x7F, MSBALL = ~REST, INT = Math.pow(2, 31); /** * @param {number} num * @param {number[]} out * @param {number} offset */ -function dist_src_vendor_varint_encode(num, out, offset) { +function varint_encode(num, out, offset) { out = out || []; offset = offset || 0; var oldOffset = offset; - while (num >= src_vendor_varint_INT) { - out[offset++] = (num & 0xFF) | src_vendor_varint_MSB; + while (num >= INT) { + out[offset++] = (num & 0xFF) | MSB; num /= 128; } - while (num & src_vendor_varint_MSBALL) { - out[offset++] = (num & 0xFF) | src_vendor_varint_MSB; + while (num & MSBALL) { + out[offset++] = (num & 0xFF) | MSB; num >>>= 7; } out[offset] = num | 0; // @ts-ignore - dist_src_vendor_varint_encode.bytes = offset - oldOffset + 1; + varint_encode.bytes = offset - oldOffset + 1; return out; } -var dist_src_vendor_varint_decode = src_vendor_varint_read; -var src_vendor_varint_MSB$1 = 0x80, src_vendor_varint_REST$1 = 0x7F; +var varint_decode = read; +var MSB$1 = 0x80, REST$1 = 0x7F; /** * @param {string | any[]} buf * @param {number} offset */ -function src_vendor_varint_read(buf, offset) { +function read(buf, offset) { var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length; do { if (counter >= l) { // @ts-ignore - src_vendor_varint_read.bytes = 0; + read.bytes = 0; throw new RangeError('Could not decode varint'); } b = buf[counter++]; res += shift < 28 - ? (b & src_vendor_varint_REST$1) << shift - : (b & src_vendor_varint_REST$1) * Math.pow(2, shift); + ? (b & REST$1) << shift + : (b & REST$1) * Math.pow(2, shift); shift += 7; - } while (b >= src_vendor_varint_MSB$1); + } while (b >= MSB$1); // @ts-ignore - src_vendor_varint_read.bytes = counter - offset; + read.bytes = counter - offset; return res; } -var src_vendor_varint_N1 = Math.pow(2, 7); -var src_vendor_varint_N2 = Math.pow(2, 14); -var src_vendor_varint_N3 = Math.pow(2, 21); -var src_vendor_varint_N4 = Math.pow(2, 28); -var src_vendor_varint_N5 = Math.pow(2, 35); -var src_vendor_varint_N6 = Math.pow(2, 42); -var src_vendor_varint_N7 = Math.pow(2, 49); -var src_vendor_varint_N8 = Math.pow(2, 56); -var src_vendor_varint_N9 = Math.pow(2, 63); -var dist_src_vendor_varint_length = function (/** @type {number} */ value) { - return (value < src_vendor_varint_N1 ? 1 - : value < src_vendor_varint_N2 ? 2 - : value < src_vendor_varint_N3 ? 3 - : value < src_vendor_varint_N4 ? 4 - : value < src_vendor_varint_N5 ? 5 - : value < src_vendor_varint_N6 ? 6 - : value < src_vendor_varint_N7 ? 7 - : value < src_vendor_varint_N8 ? 8 - : value < src_vendor_varint_N9 ? 9 +var N1 = Math.pow(2, 7); +var N2 = Math.pow(2, 14); +var N3 = Math.pow(2, 21); +var N4 = Math.pow(2, 28); +var N5 = Math.pow(2, 35); +var N6 = Math.pow(2, 42); +var N7 = Math.pow(2, 49); +var N8 = Math.pow(2, 56); +var N9 = Math.pow(2, 63); +var varint_length = function (/** @type {number} */ value) { + 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); }; -var dist_src_vendor_varint_varint = { - encode: src_vendor_varint_encode_1, - decode: dist_src_vendor_varint_decode, - encodingLength: dist_src_vendor_varint_length +var varint_varint = { + encode: encode_1, + decode: varint_decode, + encodingLength: varint_length }; -var src_vendor_varint_brrp_varint = dist_src_vendor_varint_varint; -/* harmony default export */ const multiformats_dist_src_vendor_varint = (src_vendor_varint_brrp_varint); +var _brrp_varint = varint_varint; +/* harmony default export */ const vendor_varint = (_brrp_varint); //# sourceMappingURL=varint.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/varint.js +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/node_modules/multiformats/dist/src/varint.js -function node_modules_multiformats_dist_src_varint_decode(data, offset = 0) { - const code = multiformats_dist_src_vendor_varint.decode(data, offset); - return [code, multiformats_dist_src_vendor_varint.decode.bytes]; +function src_varint_decode(data, offset = 0) { + const code = vendor_varint.decode(data, offset); + return [code, vendor_varint.decode.bytes]; } -function dist_src_varint_encodeTo(int, target, offset = 0) { - multiformats_dist_src_vendor_varint.encode(int, target, offset); +function encodeTo(int, target, offset = 0) { + vendor_varint.encode(int, target, offset); return target; } -function dist_src_varint_encodingLength(int) { - return multiformats_dist_src_vendor_varint.encodingLength(int); +function encodingLength(int) { + return vendor_varint.encodingLength(int); } //# sourceMappingURL=varint.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/hashes/digest.js +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/node_modules/multiformats/dist/src/hashes/digest.js /** * Creates a multihash digest. */ -function dist_src_hashes_digest_create(code, digest) { +function digest_create(code, digest) { const size = digest.byteLength; - const sizeOffset = dist_src_varint_encodingLength(code); - const digestOffset = sizeOffset + dist_src_varint_encodingLength(size); + const sizeOffset = encodingLength(code); + const digestOffset = sizeOffset + encodingLength(size); const bytes = new Uint8Array(digestOffset + size); - dist_src_varint_encodeTo(code, bytes, 0); - dist_src_varint_encodeTo(size, bytes, sizeOffset); + encodeTo(code, bytes, 0); + encodeTo(size, bytes, sizeOffset); bytes.set(digest, digestOffset); - return new dist_src_hashes_digest_Digest(code, size, digest, bytes); + return new digest_Digest(code, size, digest, bytes); } /** * Turns bytes representation of multihash digest into an instance. */ -function dist_src_hashes_digest_decode(multihash) { - const bytes = multiformats_dist_src_bytes_coerce(multihash); - const [code, sizeOffset] = node_modules_multiformats_dist_src_varint_decode(bytes); - const [size, digestOffset] = node_modules_multiformats_dist_src_varint_decode(bytes.subarray(sizeOffset)); +function digest_decode(multihash) { + const bytes = bytes_coerce(multihash); + const [code, sizeOffset] = src_varint_decode(bytes); + const [size, digestOffset] = src_varint_decode(bytes.subarray(sizeOffset)); const digest = bytes.subarray(sizeOffset + digestOffset); if (digest.byteLength !== size) { throw new Error('Incorrect length'); } - return new dist_src_hashes_digest_Digest(code, size, digest, bytes); + return new digest_Digest(code, size, digest, bytes); } -function dist_src_hashes_digest_equals(a, b) { +function digest_equals(a, b) { if (a === b) { return true; } @@ -220536,14 +138919,14 @@ function dist_src_hashes_digest_equals(a, b) { return (a.code === data.code && a.size === data.size && data.bytes instanceof Uint8Array && - dist_src_bytes_equals(a.bytes, data.bytes)); + equals(a.bytes, data.bytes)); } } /** * Represents a multihash digest which carries information about the * hashing algorithm and an actual hash digest. */ -class dist_src_hashes_digest_Digest { +class digest_Digest { code; size; digest; @@ -220559,7 +138942,7 @@ class dist_src_hashes_digest_Digest { } } //# sourceMappingURL=digest.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/cid.js +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/node_modules/multiformats/dist/src/cid.js @@ -220567,34 +138950,34 @@ class dist_src_hashes_digest_Digest { // This way TS will also expose all the types from module -function dist_src_cid_format(link, base) { +function format(link, base) { const { bytes, version } = link; switch (version) { case 0: - return dist_src_cid_toStringV0(bytes, dist_src_cid_baseCache(link), base ?? dist_src_bases_base58_base58btc.encoder); + return toStringV0(bytes, baseCache(link), base ?? base58_base58btc.encoder); default: - return dist_src_cid_toStringV1(bytes, dist_src_cid_baseCache(link), (base ?? dist_src_bases_base32_base32.encoder)); + return toStringV1(bytes, baseCache(link), (base ?? base32_base32.encoder)); } } -function dist_src_cid_toJSON(link) { +function toJSON(link) { return { - '/': dist_src_cid_format(link) + '/': format(link) }; } -function dist_src_cid_fromJSON(json) { - return multiformats_dist_src_cid_CID.parse(json['/']); +function fromJSON(json) { + return cid_CID.parse(json['/']); } -const dist_src_cid_cache = new WeakMap(); -function dist_src_cid_baseCache(cid) { - const baseCache = dist_src_cid_cache.get(cid); +const cache = new WeakMap(); +function baseCache(cid) { + const baseCache = cache.get(cid); if (baseCache == null) { const baseCache = new Map(); - dist_src_cid_cache.set(cid, baseCache); + cache.set(cid, baseCache); return baseCache; } return baseCache; } -class multiformats_dist_src_cid_CID { +class cid_CID { code; version; multihash; @@ -220638,14 +139021,14 @@ class multiformats_dist_src_cid_CID { } case 1: { const { code, multihash } = this; - if (code !== dist_src_cid_DAG_PB_CODE) { + if (code !== DAG_PB_CODE) { throw new Error('Cannot convert a non dag-pb CID to CIDv0'); } // sha2-256 - if (multihash.code !== dist_src_cid_SHA_256_CODE) { + if (multihash.code !== SHA_256_CODE) { throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0'); } - return (multiformats_dist_src_cid_CID.createV0(multihash)); + return (cid_CID.createV0(multihash)); } default: { throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`); @@ -220656,8 +139039,8 @@ class multiformats_dist_src_cid_CID { switch (this.version) { case 0: { const { code, digest } = this.multihash; - const multihash = dist_src_hashes_digest_create(code, digest); - return (multiformats_dist_src_cid_CID.createV1(this.code, multihash)); + const multihash = digest_create(code, digest); + return (cid_CID.createV1(this.code, multihash)); } case 1: { return this; @@ -220668,20 +139051,20 @@ class multiformats_dist_src_cid_CID { } } equals(other) { - return multiformats_dist_src_cid_CID.equals(this, other); + return cid_CID.equals(this, other); } static equals(self, other) { const unknown = other; return (unknown != null && self.code === unknown.code && self.version === unknown.version && - dist_src_hashes_digest_equals(self.multihash, unknown.multihash)); + digest_equals(self.multihash, unknown.multihash)); } toString(base) { - return dist_src_cid_format(this, base); + return format(this, base); } toJSON() { - return { '/': dist_src_cid_format(this) }; + return { '/': format(this) }; } link() { return this; @@ -220706,7 +139089,7 @@ class multiformats_dist_src_cid_CID { return null; } const value = input; - if (value instanceof multiformats_dist_src_cid_CID) { + if (value instanceof cid_CID) { // If value is instance of CID then we're all set. return value; } @@ -220717,15 +139100,15 @@ class multiformats_dist_src_cid_CID { // rebase it to this `CID` implementation so caller is guaranteed to get // instance with expected API. const { version, code, multihash, bytes } = value; - return new multiformats_dist_src_cid_CID(version, code, multihash, bytes ?? dist_src_cid_encodeCID(version, code, multihash.bytes)); + return new cid_CID(version, code, multihash, bytes ?? encodeCID(version, code, multihash.bytes)); } - else if (value[dist_src_cid_cidSymbol] === true) { + else if (value[cidSymbol] === true) { // If value is a CID from older implementation that used to be tagged via // symbol we still rebase it to the this `CID` implementation by // delegating that to a constructor. const { version, multihash, code } = value; - const digest = dist_src_hashes_digest_decode(multihash); - return multiformats_dist_src_cid_CID.create(version, code, digest); + const digest = digest_decode(multihash); + return cid_CID.create(version, code, digest); } else { // Otherwise value is not a CID (or an incompatible version of it) in @@ -220747,16 +139130,16 @@ class multiformats_dist_src_cid_CID { } switch (version) { case 0: { - if (code !== dist_src_cid_DAG_PB_CODE) { - throw new Error(`Version 0 CID must use dag-pb (code: ${dist_src_cid_DAG_PB_CODE}) block encoding`); + if (code !== DAG_PB_CODE) { + throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`); } else { - return new multiformats_dist_src_cid_CID(version, code, digest, digest.bytes); + return new cid_CID(version, code, digest, digest.bytes); } } case 1: { - const bytes = dist_src_cid_encodeCID(version, code, digest.bytes); - return new multiformats_dist_src_cid_CID(version, code, digest, bytes); + const bytes = encodeCID(version, code, digest.bytes); + return new cid_CID(version, code, digest, bytes); } default: { throw new Error('Invalid version'); @@ -220767,7 +139150,7 @@ class multiformats_dist_src_cid_CID { * Simplified version of `create` for CIDv0. */ static createV0(digest) { - return multiformats_dist_src_cid_CID.create(0, dist_src_cid_DAG_PB_CODE, digest); + return cid_CID.create(0, DAG_PB_CODE, digest); } /** * Simplified version of `create` for CIDv1. @@ -220776,7 +139159,7 @@ class multiformats_dist_src_cid_CID { * @param digest - Multihash of the content. */ static createV1(code, digest) { - return multiformats_dist_src_cid_CID.create(1, code, digest); + return cid_CID.create(1, code, digest); } /** * Decoded a CID from its binary representation. The byte array must contain @@ -220786,7 +139169,7 @@ class multiformats_dist_src_cid_CID { * binary representation of a CID. */ static decode(bytes) { - const [cid, remainder] = multiformats_dist_src_cid_CID.decodeFirst(bytes); + const [cid, remainder] = cid_CID.decodeFirst(bytes); if (remainder.length !== 0) { throw new Error('Incorrect length'); } @@ -220802,17 +139185,17 @@ class multiformats_dist_src_cid_CID { * binary CID representation. */ static decodeFirst(bytes) { - const specs = multiformats_dist_src_cid_CID.inspectBytes(bytes); + const specs = cid_CID.inspectBytes(bytes); const prefixSize = specs.size - specs.multihashSize; - const multihashBytes = multiformats_dist_src_bytes_coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize)); + const multihashBytes = bytes_coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize)); if (multihashBytes.byteLength !== specs.multihashSize) { throw new Error('Incorrect length'); } const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize); - const digest = new dist_src_hashes_digest_Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); + const digest = new digest_Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); const cid = specs.version === 0 - ? multiformats_dist_src_cid_CID.createV0(digest) - : multiformats_dist_src_cid_CID.createV1(specs.codec, digest); + ? cid_CID.createV0(digest) + : cid_CID.createV1(specs.codec, digest); return [cid, bytes.subarray(specs.size)]; } /** @@ -220827,12 +139210,12 @@ class multiformats_dist_src_cid_CID { static inspectBytes(initialBytes) { let offset = 0; const next = () => { - const [i, length] = node_modules_multiformats_dist_src_varint_decode(initialBytes.subarray(offset)); + const [i, length] = src_varint_decode(initialBytes.subarray(offset)); offset += length; return i; }; let version = next(); - let codec = dist_src_cid_DAG_PB_CODE; + let codec = DAG_PB_CODE; if (version === 18) { // CIDv0 version = 0; @@ -220858,33 +139241,33 @@ class multiformats_dist_src_cid_CID { * a default decoder). */ static parse(source, base) { - const [prefix, bytes] = dist_src_cid_parseCIDtoBytes(source, base); - const cid = multiformats_dist_src_cid_CID.decode(bytes); + const [prefix, bytes] = parseCIDtoBytes(source, base); + const cid = cid_CID.decode(bytes); if (cid.version === 0 && source[0] !== 'Q') { throw Error('Version 0 CID string must not include multibase prefix'); } // Cache string representation to avoid computing it on `this.toString()` - dist_src_cid_baseCache(cid).set(prefix, source); + baseCache(cid).set(prefix, source); return cid; } } -function dist_src_cid_parseCIDtoBytes(source, base) { +function parseCIDtoBytes(source, base) { switch (source[0]) { // CIDv0 is parsed differently case 'Q': { - const decoder = base ?? dist_src_bases_base58_base58btc; + const decoder = base ?? base58_base58btc; return [ - dist_src_bases_base58_base58btc.prefix, - decoder.decode(`${dist_src_bases_base58_base58btc.prefix}${source}`) + base58_base58btc.prefix, + decoder.decode(`${base58_base58btc.prefix}${source}`) ]; } - case dist_src_bases_base58_base58btc.prefix: { - const decoder = base ?? dist_src_bases_base58_base58btc; - return [dist_src_bases_base58_base58btc.prefix, decoder.decode(source)]; + case base58_base58btc.prefix: { + const decoder = base ?? base58_base58btc; + return [base58_base58btc.prefix, decoder.decode(source)]; } - case dist_src_bases_base32_base32.prefix: { - const decoder = base ?? dist_src_bases_base32_base32; - return [dist_src_bases_base32_base32.prefix, decoder.decode(source)]; + case base32_base32.prefix: { + const decoder = base ?? base32_base32; + return [base32_base32.prefix, decoder.decode(source)]; } default: { if (base == null) { @@ -220894,9 +139277,9 @@ function dist_src_cid_parseCIDtoBytes(source, base) { } } } -function dist_src_cid_toStringV0(bytes, cache, base) { +function toStringV0(bytes, cache, base) { const { prefix } = base; - if (prefix !== dist_src_bases_base58_base58btc.prefix) { + if (prefix !== base58_base58btc.prefix) { throw Error(`Cannot string encode V0 in ${base.name} encoding`); } const cid = cache.get(prefix); @@ -220909,7 +139292,7 @@ function dist_src_cid_toStringV0(bytes, cache, base) { return cid; } } -function dist_src_cid_toStringV1(bytes, cache, base) { +function toStringV1(bytes, cache, base) { const { prefix } = base; const cid = cache.get(prefix); if (cid == null) { @@ -220921,8007 +139304,9067 @@ function dist_src_cid_toStringV1(bytes, cache, base) { return cid; } } -const dist_src_cid_DAG_PB_CODE = 0x70; -const dist_src_cid_SHA_256_CODE = 0x12; -function dist_src_cid_encodeCID(version, code, multihash) { - const codeOffset = dist_src_varint_encodingLength(version); - const hashOffset = codeOffset + dist_src_varint_encodingLength(code); +const DAG_PB_CODE = 0x70; +const SHA_256_CODE = 0x12; +function encodeCID(version, code, multihash) { + const codeOffset = encodingLength(version); + const hashOffset = codeOffset + encodingLength(code); const bytes = new Uint8Array(hashOffset + multihash.byteLength); - dist_src_varint_encodeTo(version, bytes, 0); - dist_src_varint_encodeTo(code, bytes, codeOffset); + encodeTo(version, bytes, 0); + encodeTo(code, bytes, codeOffset); bytes.set(multihash, hashOffset); return bytes; } -const dist_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID'); +const cidSymbol = Symbol.for('@ipld/js-cid/CID'); //# sourceMappingURL=cid.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/uint8arrays/dist/src/equals.js +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/src/pb-decode.js +const textDecoder = new TextDecoder() + /** - * Returns true if the two passed Uint8Arrays have the same content + * @typedef {import('./interface.js').RawPBLink} RawPBLink */ -function equals_equals(a, b) { - if (a === b) { - return true; - } - if (a.byteLength !== b.byteLength) { - return false; - } - for (let i = 0; i < a.byteLength; i++) { - if (a[i] !== b[i]) { - return false; - } - } - return true; -} -//# sourceMappingURL=equals.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base10.js - -const base10_base10 = dist_src_bases_base_baseX({ - prefix: '9', - name: 'base10', - alphabet: '0123456789' -}); -//# sourceMappingURL=base10.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base16.js -const base16_base16 = dist_src_bases_base_rfc4648({ - prefix: 'f', - name: 'base16', - alphabet: '0123456789abcdef', - bitsPerChar: 4 -}); -const base16_base16upper = dist_src_bases_base_rfc4648({ - prefix: 'F', - name: 'base16upper', - alphabet: '0123456789ABCDEF', - bitsPerChar: 4 -}); -//# sourceMappingURL=base16.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base2.js +/** + * @typedef {import('./interface.js').RawPBNode} RawPBNode + */ -const base2_base2 = dist_src_bases_base_rfc4648({ - prefix: '0', - name: 'base2', - alphabet: '01', - bitsPerChar: 1 -}); -//# sourceMappingURL=base2.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base256emoji.js +/** + * @param {Uint8Array} bytes + * @param {number} offset + * @returns {[number, number]} + */ +function pb_decode_decodeVarint (bytes, offset) { + let v = 0 -const base256emoji_alphabet = Array.from('🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂'); -const base256emoji_alphabetBytesToChars = (base256emoji_alphabet.reduce((p, c, i) => { p[i] = c; return p; }, ([]))); -const base256emoji_alphabetCharsToBytes = (base256emoji_alphabet.reduce((p, c, i) => { p[c.codePointAt(0)] = i; return p; }, ([]))); -function bases_base256emoji_encode(data) { - return data.reduce((p, c) => { - p += base256emoji_alphabetBytesToChars[c]; - return p; - }, ''); -} -function bases_base256emoji_decode(str) { - const byts = []; - for (const char of str) { - const byt = base256emoji_alphabetCharsToBytes[char.codePointAt(0)]; - if (byt === undefined) { - throw new Error(`Non-base256emoji character: ${char}`); - } - byts.push(byt); + for (let shift = 0; ; shift += 7) { + /* c8 ignore next 3 */ + if (shift >= 64) { + throw new Error('protobuf: varint overflow') + } + /* c8 ignore next 3 */ + if (offset >= bytes.length) { + throw new Error('protobuf: unexpected end of data') } - return new Uint8Array(byts); -} -const base256emoji_base256emoji = dist_src_bases_base_from({ - prefix: '🚀', - name: 'base256emoji', - encode: bases_base256emoji_encode, - decode: bases_base256emoji_decode -}); -//# sourceMappingURL=base256emoji.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base36.js - -const base36_base36 = dist_src_bases_base_baseX({ - prefix: 'k', - name: 'base36', - alphabet: '0123456789abcdefghijklmnopqrstuvwxyz' -}); -const base36_base36upper = dist_src_bases_base_baseX({ - prefix: 'K', - name: 'base36upper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' -}); -//# sourceMappingURL=base36.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base64.js - -const src_bases_base64_base64 = dist_src_bases_base_rfc4648({ - prefix: 'm', - name: 'base64', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', - bitsPerChar: 6 -}); -const src_bases_base64_base64pad = dist_src_bases_base_rfc4648({ - prefix: 'M', - name: 'base64pad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', - bitsPerChar: 6 -}); -const src_bases_base64_base64url = dist_src_bases_base_rfc4648({ - prefix: 'u', - name: 'base64url', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', - bitsPerChar: 6 -}); -const src_bases_base64_base64urlpad = dist_src_bases_base_rfc4648({ - prefix: 'U', - name: 'base64urlpad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', - bitsPerChar: 6 -}); -//# sourceMappingURL=base64.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base8.js - -const base8_base8 = dist_src_bases_base_rfc4648({ - prefix: '7', - name: 'base8', - alphabet: '01234567', - bitsPerChar: 3 -}); -//# sourceMappingURL=base8.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/identity.js - -const src_bases_identity_identity = dist_src_bases_base_from({ - prefix: '\x00', - name: 'identity', - encode: (buf) => multiformats_dist_src_bytes_toString(buf), - decode: (str) => dist_src_bytes_fromString(str) -}); -//# sourceMappingURL=identity.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/codecs/json.js -const codecs_json_textEncoder = new TextEncoder(); -const codecs_json_textDecoder = new TextDecoder(); -const codecs_json_name = 'json'; -const codecs_json_code = 0x0200; -function codecs_json_encode(node) { - return codecs_json_textEncoder.encode(JSON.stringify(node)); -} -function codecs_json_decode(data) { - return JSON.parse(codecs_json_textDecoder.decode(data)); + const b = bytes[offset++] + v += shift < 28 ? (b & 0x7f) << shift : (b & 0x7f) * (2 ** shift) + if (b < 0x80) { + break + } + } + return [v, offset] } -//# sourceMappingURL=json.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/codecs/raw.js -const codecs_raw_name = 'raw'; -const codecs_raw_code = 0x55; -function codecs_raw_encode(node) { - return multiformats_dist_src_bytes_coerce(node); -} -function codecs_raw_decode(data) { - return multiformats_dist_src_bytes_coerce(data); -} -//# sourceMappingURL=raw.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/hashes/identity.js +/** + * @param {Uint8Array} bytes + * @param {number} offset + * @returns {[Uint8Array, number]} + */ +function decodeBytes (bytes, offset) { + let byteLen + ;[byteLen, offset] = pb_decode_decodeVarint(bytes, offset) + const postOffset = offset + byteLen + /* c8 ignore next 3 */ + if (byteLen < 0 || postOffset < 0) { + throw new Error('protobuf: invalid length') + } + /* c8 ignore next 3 */ + if (postOffset > bytes.length) { + throw new Error('protobuf: unexpected end of data') + } -const hashes_identity_code = 0x0; -const hashes_identity_name = 'identity'; -const hashes_identity_encode = multiformats_dist_src_bytes_coerce; -function identity_digest(input) { - return dist_src_hashes_digest_create(hashes_identity_code, hashes_identity_encode(input)); + return [bytes.subarray(offset, postOffset), postOffset] } -const hashes_identity_identity = { code: hashes_identity_code, name: hashes_identity_name, encode: hashes_identity_encode, digest: identity_digest }; -//# sourceMappingURL=identity.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/hashes/hasher.js -function src_hashes_hasher_from({ name, code, encode }) { - return new hashes_hasher_Hasher(name, code, encode); -} /** - * Hasher represents a hashing algorithm implementation that produces as - * `MultihashDigest`. + * @param {Uint8Array} bytes + * @param {number} index + * @returns {[number, number, number]} */ -class hashes_hasher_Hasher { - name; - code; - encode; - constructor(name, code, encode) { - this.name = name; - this.code = code; - this.encode = encode; - } - digest(input) { - if (input instanceof Uint8Array) { - const result = this.encode(input); - return result instanceof Uint8Array - ? dist_src_hashes_digest_create(this.code, result) - /* c8 ignore next 1 */ - : result.then(digest => dist_src_hashes_digest_create(this.code, digest)); - } - else { - throw Error('Unknown type, must be binary type'); - /* c8 ignore next 1 */ - } - } +function decodeKey (bytes, index) { + let wire + ;[wire, index] = pb_decode_decodeVarint(bytes, index) + // [wireType, fieldNum, newIndex] + return [wire & 0x7, wire >> 3, index] } -//# sourceMappingURL=hasher.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/hashes/sha2.js - - -const hashes_sha2_sha256 = src_hashes_hasher_from({ - name: 'sha2-256', - code: 0x12, - encode: (input) => multiformats_dist_src_bytes_coerce(external_crypto_.createHash('sha256').update(input).digest()) -}); -const sha2_sha512 = src_hashes_hasher_from({ - name: 'sha2-512', - code: 0x13, - encode: input => multiformats_dist_src_bytes_coerce(external_crypto_.createHash('sha512').update(input).digest()) -}); -//# sourceMappingURL=sha2.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/index.js -/** - * @packageDocumentation - * - * This library defines common interfaces and low level building blocks for various interrelated multiformat technologies (multicodec, multihash, multibase, and CID). They can be used to implement custom base encoders / decoders / codecs, codec encoders /decoders and multihash hashers that comply to the interface that layers above assume. - * - * This library provides implementations for most basics and many others can be found in linked repositories. - * - * ```TypeScript - * import { CID } from 'multiformats/cid' - * import * as json from 'multiformats/codecs/json' - * import { sha256 } from 'multiformats/hashes/sha2' - * - * const bytes = json.encode({ hello: 'world' }) - * - * const hash = await sha256.digest(bytes) - * const cid = CID.create(1, json.code, hash) - * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) - * ``` - * - * ## Creating Blocks - * - * ```TypeScript - * import * as Block from 'multiformats/block' - * import * as codec from '@ipld/dag-cbor' - * import { sha256 as hasher } from 'multiformats/hashes/sha2' - * - * const value = { hello: 'world' } - * - * // encode a block - * let block = await Block.encode({ value, codec, hasher }) - * - * block.value // { hello: 'world' } - * block.bytes // Uint8Array - * block.cid // CID() w/ sha2-256 hash address and dag-cbor codec - * - * // you can also decode blocks from their binary state - * block = await Block.decode({ bytes: block.bytes, codec, hasher }) - * - * // if you have the cid you can also verify the hash on decode - * block = await Block.create({ bytes: block.bytes, cid: block.cid, codec, hasher }) - * ``` - * - * ## Multibase Encoders / Decoders / Codecs - * - * CIDs can be serialized to string representation using multibase encoders that implement [`MultibaseEncoder`](https://github.com/multiformats/js-multiformats/blob/master/src/bases/interface.ts) interface. This library provides quite a few implementations that can be imported: - * - * ```TypeScript - * import { base64 } from "multiformats/bases/base64" - * cid.toString(base64.encoder) - * //> 'mAYAEEiCTojlxqRTl6svwqNJRVM2jCcPBxy+7mRTUfGDzy2gViA' - * ``` - * - * Parsing CID string serialized CIDs requires multibase decoder that implements [`MultibaseDecoder`](https://github.com/multiformats/js-multiformats/blob/master/src/bases/interface.ts) interface. This library provides a decoder for every encoder it provides: - * - * ```TypeScript - * CID.parse('mAYAEEiCTojlxqRTl6svwqNJRVM2jCcPBxy+7mRTUfGDzy2gViA', base64.decoder) - * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) - * ``` - * - * Dual of multibase encoder & decoder is defined as multibase codec and it exposes - * them as `encoder` and `decoder` properties. For added convenience codecs also - * implement `MultibaseEncoder` and `MultibaseDecoder` interfaces so they could be - * used as either or both: - * - * ```TypeScript - * cid.toString(base64) - * CID.parse(cid.toString(base64), base64) - * ``` - * - * **Note:** CID implementation comes bundled with `base32` and `base58btc` - * multibase codecs so that CIDs can be base serialized to (version specific) - * default base encoding and parsed without having to supply base encoders/decoders: - * - * ```TypeScript - * const v1 = CID.parse('bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea') - * v1.toString() - * //> 'bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea' - * - * const v0 = CID.parse('QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n') - * v0.toString() - * //> 'QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n' - * v0.toV1().toString() - * //> 'bafybeihdwdcefgh4dqkjv67uzcmw7ojee6xedzdetojuzjevtenxquvyku' - * ``` - * - * ## Multicodec Encoders / Decoders / Codecs - * - * This library defines [`BlockEncoder`, `BlockDecoder` and `BlockCodec` interfaces](https://github.com/multiformats/js-multiformats/blob/master/src/codecs/interface.ts). - * Codec implementations should conform to the `BlockCodec` interface which implements both `BlockEncoder` and `BlockDecoder`. - * Here is an example implementation of JSON `BlockCodec`. - * - * ```TypeScript - * export const { name, code, encode, decode } = { - * name: 'json', - * code: 0x0200, - * encode: json => new TextEncoder().encode(JSON.stringify(json)), - * decode: bytes => JSON.parse(new TextDecoder().decode(bytes)) - * } - * ``` - * - * ## Multihash Hashers - * - * This library defines [`MultihashHasher` and `MultihashDigest` interfaces](https://github.com/multiformats/js-multiformats/blob/master/src/hashes/interface.ts) and convinient function for implementing them: - * - * ```TypeScript - * import * as hasher from 'multiformats/hashes/hasher' - * - * const sha256 = hasher.from({ - * // As per multiformats table - * // https://github.com/multiformats/multicodec/blob/master/table.csv#L9 - * name: 'sha2-256', - * code: 0x12, - * - * encode: (input) => new Uint8Array(crypto.createHash('sha256').update(input).digest()) - * }) - * - * const hash = await sha256.digest(json.encode({ hello: 'world' })) - * CID.create(1, json.code, hash) - * - * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) - * ``` - * - * ## Traversal - * - * This library contains higher-order functions for traversing graphs of data easily. - * - * `walk()` walks through the links in each block of a DAG calling a user-supplied loader function for each one, in depth-first order with no duplicate block visits. The loader should return a `Block` object and can be used to inspect and collect block ordering for a full DAG walk. The loader should `throw` on error, and return `null` if a block should be skipped by `walk()`. - * - * ```TypeScript - * import { walk } from 'multiformats/traversal' - * import * as Block from 'multiformats/block' - * import * as codec from 'multiformats/codecs/json' - * import { sha256 as hasher } from 'multiformats/hashes/sha2' - * - * // build a DAG (a single block for this simple example) - * const value = { hello: 'world' } - * const block = await Block.encode({ value, codec, hasher }) - * const { cid } = block - * console.log(cid) - * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) - * - * // create a loader function that also collects CIDs of blocks in - * // their traversal order - * const load = (cid, blocks) => async (cid) => { - * // fetch a block using its cid - * // e.g.: const block = await fetchBlockByCID(cid) - * blocks.push(cid) - * return block - * } - * - * // collect blocks in this DAG starting from the root `cid` - * const blocks = [] - * await walk({ cid, load: load(cid, blocks) }) - * - * console.log(blocks) - * //> [CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea)] - * ``` - * - * ## Legacy interface - * - * [`blockcodec-to-ipld-format`](https://github.com/ipld/js-blockcodec-to-ipld-format) converts a multiformats [`BlockCodec`](https://github.com/multiformats/js-multiformats/blob/master/src/codecs/interface.ts#L21) into an - * [`interface-ipld-format`](https://github.com/ipld/interface-ipld-format) for use with the [`ipld`](https://github.com/ipld/ipld) package. This can help bridge IPLD codecs implemented using the structure and interfaces defined here to existing code that assumes, or requires `interface-ipld-format`. This bridge also includes the relevant TypeScript definitions. - * - * ## Implementations - * - * By default, no base encodings (other than base32 & base58btc), hash functions, - * or codec implementations are exposed by `multiformats`, you need to - * import the ones you need yourself. - * - * ### Multibase codecs - * - * | bases | import | repo | - * | ------------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------- | - * | `base16` | `multiformats/bases/base16` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | - * | `base32`, `base32pad`, `base32hex`, `base32hexpad`, `base32z` | `multiformats/bases/base32` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | - * | `base64`, `base64pad`, `base64url`, `base64urlpad` | `multiformats/bases/base64` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | - * | `base58btc`, `base58flick4` | `multiformats/bases/base58` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | - * - * Other (less useful) bases implemented in [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) include: `base2`, `base8`, `base10`, `base36` and `base256emoji`. - * - * ### Multihash hashers - * - * | hashes | import | repo | - * | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------ | - * | `sha2-256`, `sha2-512` | `multiformats/hashes/sha2` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/hashes) | - * | `sha3-224`, `sha3-256`, `sha3-384`,`sha3-512`, `shake-128`, `shake-256`, `keccak-224`, `keccak-256`, `keccak-384`, `keccak-512` | `@multiformats/sha3` | [multiformats/js-sha3](https://github.com/multiformats/js-sha3) | - * | `identity` | `multiformats/hashes/identity` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/hashes/identity.js) | - * | `murmur3-128`, `murmur3-32` | `@multiformats/murmur3` | [multiformats/js-murmur3](https://github.com/multiformats/js-murmur3) | - * | `blake2b-*`, `blake2s-*` | `@multiformats/blake2` | [multiformats/js-blake2](https://github.com/multiformats/js-blake2) | - * - * ### IPLD codecs (multicodec) - * - * | codec | import | repo | - * | ---------- | -------------------------- | ------------------------------------------------------------------------------------------------------ | - * | `raw` | `multiformats/codecs/raw` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/codecs) | - * | `json` | `multiformats/codecs/json` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/codecs) | - * | `dag-cbor` | `@ipld/dag-cbor` | [ipld/js-dag-cbor](https://github.com/ipld/js-dag-cbor) | - * | `dag-json` | `@ipld/dag-json` | [ipld/js-dag-json](https://github.com/ipld/js-dag-json) | - * | `dag-pb` | `@ipld/dag-pb` | [ipld/js-dag-pb](https://github.com/ipld/js-dag-pb) | - * | `dag-jose` | `dag-jose` | [ceramicnetwork/js-dag-jose](https://github.com/ceramicnetwork/js-dag-jose) | +/** + * @param {Uint8Array} bytes + * @returns {RawPBLink} */ +function decodeLink (bytes) { + /** @type {RawPBLink} */ + const link = {} + const l = bytes.length + let index = 0 + while (index < l) { + let wireType, fieldNum + ;[wireType, fieldNum, index] = decodeKey(bytes, index) + + if (fieldNum === 1) { + if (link.Hash) { + throw new Error('protobuf: (PBLink) duplicate Hash section') + } + if (wireType !== 2) { + throw new Error(`protobuf: (PBLink) wrong wireType (${wireType}) for Hash`) + } + if (link.Name !== undefined) { + throw new Error('protobuf: (PBLink) invalid order, found Name before Hash') + } + if (link.Tsize !== undefined) { + throw new Error('protobuf: (PBLink) invalid order, found Tsize before Hash') + } + [link.Hash, index] = decodeBytes(bytes, index) + } else if (fieldNum === 2) { + if (link.Name !== undefined) { + throw new Error('protobuf: (PBLink) duplicate Name section') + } + if (wireType !== 2) { + throw new Error(`protobuf: (PBLink) wrong wireType (${wireType}) for Name`) + } + if (link.Tsize !== undefined) { + throw new Error('protobuf: (PBLink) invalid order, found Tsize before Name') + } + let byts + ;[byts, index] = decodeBytes(bytes, index) + link.Name = textDecoder.decode(byts) + } else if (fieldNum === 3) { + if (link.Tsize !== undefined) { + throw new Error('protobuf: (PBLink) duplicate Tsize section') + } + if (wireType !== 0) { + throw new Error(`protobuf: (PBLink) wrong wireType (${wireType}) for Tsize`) + } + [link.Tsize, index] = pb_decode_decodeVarint(bytes, index) + } else { + throw new Error(`protobuf: (PBLink) invalid fieldNumber, expected 1, 2 or 3, got ${fieldNum}`) + } + } -// This way TS will also expose all the types from module + /* c8 ignore next 3 */ + if (index > l) { + throw new Error('protobuf: (PBLink) unexpected end of data') + } + return link +} -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/basics.js +/** + * @param {Uint8Array} bytes + * @returns {RawPBNode} + */ +function decodeNode (bytes) { + const l = bytes.length + let index = 0 + /** @type {RawPBLink[]|void} */ + let links = undefined // eslint-disable-line no-undef-init + let linksBeforeData = false + /** @type {Uint8Array|void} */ + let data = undefined // eslint-disable-line no-undef-init + while (index < l) { + let wireType, fieldNum + ;[wireType, fieldNum, index] = decodeKey(bytes, index) + if (wireType !== 2) { + throw new Error(`protobuf: (PBNode) invalid wireType, expected 2, got ${wireType}`) + } + if (fieldNum === 1) { + if (data) { + throw new Error('protobuf: (PBNode) duplicate Data section') + } + [data, index] = decodeBytes(bytes, index) + if (links) { + linksBeforeData = true + } + } else if (fieldNum === 2) { + if (linksBeforeData) { // interleaved Links/Data/Links + throw new Error('protobuf: (PBNode) duplicate Links section') + } else if (!links) { + links = [] + } + let byts + ;[byts, index] = decodeBytes(bytes, index) + links.push(decodeLink(byts)) + } else { + throw new Error(`protobuf: (PBNode) invalid fieldNumber, expected 1 or 2, got ${fieldNum}`) + } + } + /* c8 ignore next 3 */ + if (index > l) { + throw new Error('protobuf: (PBNode) unexpected end of data') + } + /** @type {RawPBNode} */ + const node = {} + if (data) { + node.Data = data + } + node.Links = links || [] + return node +} +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/src/pb-encode.js +const textEncoder = new TextEncoder() +const maxInt32 = 2 ** 32 +const maxUInt32 = 2 ** 31 +/** + * @typedef {import('./interface.js').RawPBLink} RawPBLink + */ +/** + * @typedef {import('./interface.js').RawPBNode} RawPBNode + */ +// the encoders work backward from the end of the bytes array +/** + * encodeLink() is passed a slice of the parent byte array that ends where this + * link needs to end, so it packs to the right-most part of the passed `bytes` + * + * @param {RawPBLink} link + * @param {Uint8Array} bytes + * @returns {number} + */ +function encodeLink (link, bytes) { + let i = bytes.length + if (typeof link.Tsize === 'number') { + if (link.Tsize < 0) { + throw new Error('Tsize cannot be negative') + } + if (!Number.isSafeInteger(link.Tsize)) { + throw new Error('Tsize too large for encoding') + } + i = encodeVarint(bytes, i, link.Tsize) - 1 + bytes[i] = 0x18 + } + if (typeof link.Name === 'string') { + const nameBytes = textEncoder.encode(link.Name) + i -= nameBytes.length + bytes.set(nameBytes, i) + i = encodeVarint(bytes, i, nameBytes.length) - 1 + bytes[i] = 0x12 + } + if (link.Hash) { + i -= link.Hash.length + bytes.set(link.Hash, i) + i = encodeVarint(bytes, i, link.Hash.length) - 1 + bytes[i] = 0xa + } -const basics_bases = { ...src_bases_identity_namespaceObject, ...bases_base2_namespaceObject, ...bases_base8_namespaceObject, ...bases_base10_namespaceObject, ...bases_base16_namespaceObject, ...dist_src_bases_base32_namespaceObject, ...bases_base36_namespaceObject, ...dist_src_bases_base58_namespaceObject, ...dist_src_bases_base64_namespaceObject, ...bases_base256emoji_namespaceObject }; -const basics_hashes = { ...hashes_sha2_namespaceObject, ...hashes_identity_namespaceObject }; -const basics_codecs = { raw: codecs_raw_namespaceObject, json: src_codecs_json_namespaceObject }; + return bytes.length - i +} -//# sourceMappingURL=basics.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/uint8arrays/dist/src/util/as-uint8array.js /** - * To guarantee Uint8Array semantics, convert nodejs Buffers - * into vanilla Uint8Arrays + * Encodes a PBNode into a new byte array of precisely the correct size + * + * @param {RawPBNode} node + * @returns {Uint8Array} */ -function as_uint8array_asUint8Array(buf) { - if (globalThis.Buffer != null) { - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); +function encodeNode (node) { + const size = sizeNode(node) + const bytes = new Uint8Array(size) + let i = size + + if (node.Data) { + i -= node.Data.length + bytes.set(node.Data, i) + i = encodeVarint(bytes, i, node.Data.length) - 1 + bytes[i] = 0xa + } + + if (node.Links) { + for (let index = node.Links.length - 1; index >= 0; index--) { + const size = encodeLink(node.Links[index], bytes.subarray(0, i)) + i -= size + i = encodeVarint(bytes, i, size) - 1 + bytes[i] = 0x12 } - return buf; + } + + return bytes } -//# sourceMappingURL=as-uint8array.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/uint8arrays/dist/src/alloc.js /** - * Returns a `Uint8Array` of the requested size. Referenced memory will - * be initialized to 0. + * work out exactly how many bytes this link takes up + * + * @param {RawPBLink} link + * @returns */ -function alloc_alloc(size = 0) { - if (globalThis.Buffer?.alloc != null) { - return asUint8Array(globalThis.Buffer.alloc(size)); - } - return new Uint8Array(size); +function sizeLink (link) { + let n = 0 + + if (link.Hash) { + const l = link.Hash.length + n += 1 + l + sov(l) + } + + if (typeof link.Name === 'string') { + const l = textEncoder.encode(link.Name).length + n += 1 + l + sov(l) + } + + if (typeof link.Tsize === 'number') { + n += 1 + sov(link.Tsize) + } + + return n } + /** - * Where possible returns a Uint8Array of the requested size that references - * uninitialized memory. Only use if you are certain you will immediately - * overwrite every value in the returned `Uint8Array`. + * Work out exactly how many bytes this node takes up + * + * @param {RawPBNode} node + * @returns {number} */ -function allocUnsafe(size = 0) { - if (globalThis.Buffer?.allocUnsafe != null) { - return as_uint8array_asUint8Array(globalThis.Buffer.allocUnsafe(size)); +function sizeNode (node) { + let n = 0 + + if (node.Data) { + const l = node.Data.length + n += 1 + l + sov(l) + } + + if (node.Links) { + for (const link of node.Links) { + const l = sizeLink(link) + n += 1 + l + sov(l) } - return new Uint8Array(size); + } + + return n } -//# sourceMappingURL=alloc.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/uint8arrays/dist/src/util/bases.js +/** + * @param {Uint8Array} bytes + * @param {number} offset + * @param {number} v + * @returns {number} + */ +function encodeVarint (bytes, offset, v) { + offset -= sov(v) + const base = offset + + while (v >= maxUInt32) { + bytes[offset++] = (v & 0x7f) | 0x80 + v /= 128 + } -function createCodec(name, prefix, encode, decode) { - return { - name, - prefix, - encoder: { - name, - prefix, - encode - }, - decoder: { - decode - } - }; + while (v >= 128) { + bytes[offset++] = (v & 0x7f) | 0x80 + v >>>= 7 + } + + bytes[offset] = v + + return base } -const string = createCodec('utf8', 'u', (buf) => { - const decoder = new TextDecoder('utf8'); - return 'u' + decoder.decode(buf); -}, (str) => { - const encoder = new TextEncoder(); - return encoder.encode(str.substring(1)); -}); -const ascii = createCodec('ascii', 'a', (buf) => { - let string = 'a'; - for (let i = 0; i < buf.length; i++) { - string += String.fromCharCode(buf[i]); - } - return string; -}, (str) => { - str = str.substring(1); - const buf = allocUnsafe(str.length); - 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, - binary: ascii, - ...basics_bases -}; -/* harmony default export */ const util_bases = (BASES); -//# sourceMappingURL=bases.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/uint8arrays/dist/src/to-string.js /** - * Turns a `Uint8Array` into a string. - * - * Supports `utf8`, `utf-8` and any encoding supported by the multibase module. + * size of varint * - * Also `ascii` which is similar to node's 'binary' encoding. + * @param {number} x + * @returns {number} */ -function to_string_toString(array, encoding = 'utf8') { - const base = util_bases[encoding]; - if (base == null) { - throw new Error(`Unsupported encoding "${encoding}"`); - } - if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) { - return globalThis.Buffer.from(array.buffer, array.byteOffset, array.byteLength).toString('utf8'); - } - // strip multibase prefix - return base.encoder.encode(array).substring(1); +function sov (x) { + if (x % 2 === 0) { + x++ + } + return Math.floor((len64(x) + 6) / 7) } -//# sourceMappingURL=to-string.js.map -;// CONCATENATED MODULE: ./node_modules/uint8-varint/node_modules/uint8arrays/dist/src/util/as-uint8array.js + /** - * To guarantee Uint8Array semantics, convert nodejs Buffers - * into vanilla Uint8Arrays + * golang math/bits, how many bits does it take to represent this integer? + * + * @param {number} x + * @returns {number} */ -function util_as_uint8array_asUint8Array(buf) { - if (globalThis.Buffer != null) { - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); - } - return buf; +function len64 (x) { + let n = 0 + if (x >= maxInt32) { + x = Math.floor(x / maxInt32) + n = 32 + } + if (x >= (1 << 16)) { + x >>>= 16 + n += 16 + } + if (x >= (1 << 8)) { + x >>>= 8 + n += 8 + } + return n + len8tab[x] } -//# sourceMappingURL=as-uint8array.js.map -;// CONCATENATED MODULE: ./node_modules/uint8-varint/node_modules/uint8arrays/dist/src/alloc.js + +// golang math/bits +const len8tab = [ + 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 +] + +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/src/util.js + /** - * Returns a `Uint8Array` of the requested size. Referenced memory will - * be initialized to 0. + * @typedef {import('./interface.js').PBLink} PBLink + * @typedef {import('./interface.js').PBNode} PBNode */ -function src_alloc_alloc(size = 0) { - if (globalThis.Buffer?.alloc != null) { - return asUint8Array(globalThis.Buffer.alloc(size)); + +const pbNodeProperties = ['Data', 'Links'] +const pbLinkProperties = ['Hash', 'Name', 'Tsize'] + +const util_textEncoder = new TextEncoder() + +/** + * @param {PBLink} a + * @param {PBLink} b + * @returns {number} + */ +function linkComparator (a, b) { + if (a === b) { + return 0 + } + + const abuf = a.Name ? util_textEncoder.encode(a.Name) : [] + const bbuf = b.Name ? util_textEncoder.encode(b.Name) : [] + + let x = abuf.length + let y = bbuf.length + + for (let i = 0, len = Math.min(x, y); i < len; ++i) { + if (abuf[i] !== bbuf[i]) { + x = abuf[i] + y = bbuf[i] + break } - return new Uint8Array(size); + } + + return x < y ? -1 : y < x ? 1 : 0 } + /** - * Where possible returns a Uint8Array of the requested size that references - * uninitialized memory. Only use if you are certain you will immediately - * overwrite every value in the returned `Uint8Array`. + * @param {any} node + * @param {string[]} properties + * @returns {boolean} */ -function alloc_allocUnsafe(size = 0) { - if (globalThis.Buffer?.allocUnsafe != null) { - return util_as_uint8array_asUint8Array(globalThis.Buffer.allocUnsafe(size)); - } - return new Uint8Array(size); +function hasOnlyProperties (node, properties) { + return !Object.keys(node).some((p) => !properties.includes(p)) } -//# sourceMappingURL=alloc.js.map -;// CONCATENATED MODULE: ./node_modules/uint8-varint/dist/src/index.js -/* eslint-disable no-fallthrough */ -const src_N1 = Math.pow(2, 7); -const src_N2 = Math.pow(2, 14); -const src_N3 = Math.pow(2, 21); -const src_N4 = Math.pow(2, 28); -const src_N5 = Math.pow(2, 35); -const src_N6 = Math.pow(2, 42); -const src_N7 = Math.pow(2, 49); -/** Most significant bit of a byte */ -const src_MSB = 0x80; -/** Rest of the bits in a byte */ -const src_REST = 0x7f; -function src_encodingLength(value) { - if (value < src_N1) { - return 1; - } - if (value < src_N2) { - return 2; - } - if (value < src_N3) { - return 3; - } - if (value < src_N4) { - return 4; - } - if (value < src_N5) { - return 5; - } - if (value < src_N6) { - return 6; - } - if (value < src_N7) { - return 7; - } - if (Number.MAX_SAFE_INTEGER != null && value > Number.MAX_SAFE_INTEGER) { - throw new RangeError('Could not encode varint'); +/** + * Converts a CID, or a PBLink-like object to a PBLink + * + * @param {any} link + * @returns {PBLink} + */ +function asLink (link) { + if (typeof link.asCID === 'object') { + const Hash = cid_CID.asCID(link) + if (!Hash) { + throw new TypeError('Invalid DAG-PB form') } - return 8; -} -function encodeUint8Array(value, buf, offset = 0) { - switch (src_encodingLength(value)) { - case 8: { - buf[offset++] = (value & 0xFF) | src_MSB; - value /= 128; - } - case 7: { - buf[offset++] = (value & 0xFF) | src_MSB; - value /= 128; - } - case 6: { - buf[offset++] = (value & 0xFF) | src_MSB; - value /= 128; - } - case 5: { - buf[offset++] = (value & 0xFF) | src_MSB; - value /= 128; - } - case 4: { - buf[offset++] = (value & 0xFF) | src_MSB; - value >>>= 7; - } - case 3: { - buf[offset++] = (value & 0xFF) | src_MSB; - value >>>= 7; - } - case 2: { - buf[offset++] = (value & 0xFF) | src_MSB; - value >>>= 7; - } - case 1: { - buf[offset++] = (value & 0xFF); - value >>>= 7; - break; + return { Hash } + } + + if (typeof link !== 'object' || Array.isArray(link)) { + throw new TypeError('Invalid DAG-PB form') + } + + const pbl = {} + + if (link.Hash) { + let cid = cid_CID.asCID(link.Hash) + try { + if (!cid) { + if (typeof link.Hash === 'string') { + cid = cid_CID.parse(link.Hash) + } else if (link.Hash instanceof Uint8Array) { + cid = cid_CID.decode(link.Hash) } - default: throw new Error('unreachable'); + } + } catch (/** @type {any} */ e) { + throw new TypeError(`Invalid DAG-PB form: ${e.message}`) } - return buf; -} -function encodeUint8ArrayList(value, buf, offset = 0) { - switch (src_encodingLength(value)) { - case 8: { - buf.set(offset++, (value & 0xFF) | src_MSB); - value /= 128; - } - case 7: { - buf.set(offset++, (value & 0xFF) | src_MSB); - value /= 128; - } - case 6: { - buf.set(offset++, (value & 0xFF) | src_MSB); - value /= 128; - } - case 5: { - buf.set(offset++, (value & 0xFF) | src_MSB); - value /= 128; - } - case 4: { - buf.set(offset++, (value & 0xFF) | src_MSB); - value >>>= 7; - } - case 3: { - buf.set(offset++, (value & 0xFF) | src_MSB); - value >>>= 7; - } - case 2: { - buf.set(offset++, (value & 0xFF) | src_MSB); - value >>>= 7; - } - case 1: { - buf.set(offset++, (value & 0xFF)); - value >>>= 7; - break; - } - default: throw new Error('unreachable'); + + if (cid) { + pbl.Hash = cid } - return buf; + } + + if (!pbl.Hash) { + throw new TypeError('Invalid DAG-PB form') + } + + if (typeof link.Name === 'string') { + pbl.Name = link.Name + } + + if (typeof link.Tsize === 'number') { + pbl.Tsize = link.Tsize + } + + return pbl } -function decodeUint8Array(buf, offset) { - let b = buf[offset]; - let res = 0; - res += b & src_REST; - if (b < src_MSB) { - return res; - } - b = buf[offset + 1]; - res += (b & src_REST) << 7; - if (b < src_MSB) { - return res; - } - b = buf[offset + 2]; - res += (b & src_REST) << 14; - if (b < src_MSB) { - return res; - } - b = buf[offset + 3]; - res += (b & src_REST) << 21; - if (b < src_MSB) { - return res; - } - b = buf[offset + 4]; - res += (b & src_REST) * src_N4; - if (b < src_MSB) { - return res; - } - b = buf[offset + 5]; - res += (b & src_REST) * src_N5; - if (b < src_MSB) { - return res; - } - b = buf[offset + 6]; - res += (b & src_REST) * src_N6; - if (b < src_MSB) { - return res; + +/** + * @param {any} node + * @returns {PBNode} + */ +function prepare (node) { + if (node instanceof Uint8Array || typeof node === 'string') { + node = { Data: node } + } + + if (typeof node !== 'object' || Array.isArray(node)) { + throw new TypeError('Invalid DAG-PB form') + } + + /** @type {PBNode} */ + const pbn = {} + + if (node.Data !== undefined) { + if (typeof node.Data === 'string') { + pbn.Data = util_textEncoder.encode(node.Data) + } else if (node.Data instanceof Uint8Array) { + pbn.Data = node.Data + } else { + throw new TypeError('Invalid DAG-PB form') } - b = buf[offset + 7]; - res += (b & src_REST) * src_N7; - if (b < src_MSB) { - return res; + } + + if (node.Links !== undefined) { + if (Array.isArray(node.Links)) { + pbn.Links = node.Links.map(asLink) + pbn.Links.sort(linkComparator) + } else { + throw new TypeError('Invalid DAG-PB form') } - throw new RangeError('Could not decode varint'); + } else { + pbn.Links = [] + } + + return pbn } -function decodeUint8ArrayList(buf, offset) { - let b = buf.get(offset); - let res = 0; - res += b & src_REST; - if (b < src_MSB) { - return res; - } - b = buf.get(offset + 1); - res += (b & src_REST) << 7; - if (b < src_MSB) { - return res; + +/** + * @param {PBNode} node + */ +function validate (node) { + /* + type PBLink struct { + Hash optional Link + Name optional String + Tsize optional Int + } + + type PBNode struct { + Links [PBLink] + Data optional Bytes + } + */ + // @ts-ignore private property for TS + if (!node || typeof node !== 'object' || Array.isArray(node) || node instanceof Uint8Array || (node['/'] && node['/'] === node.bytes)) { + throw new TypeError('Invalid DAG-PB form') + } + + if (!hasOnlyProperties(node, pbNodeProperties)) { + throw new TypeError('Invalid DAG-PB form (extraneous properties)') + } + + if (node.Data !== undefined && !(node.Data instanceof Uint8Array)) { + throw new TypeError('Invalid DAG-PB form (Data must be bytes)') + } + + if (!Array.isArray(node.Links)) { + throw new TypeError('Invalid DAG-PB form (Links must be a list)') + } + + for (let i = 0; i < node.Links.length; i++) { + const link = node.Links[i] + // @ts-ignore private property for TS + if (!link || typeof link !== 'object' || Array.isArray(link) || link instanceof Uint8Array || (link['/'] && link['/'] === link.bytes)) { + throw new TypeError('Invalid DAG-PB form (bad link)') } - b = buf.get(offset + 2); - res += (b & src_REST) << 14; - if (b < src_MSB) { - return res; + + if (!hasOnlyProperties(link, pbLinkProperties)) { + throw new TypeError('Invalid DAG-PB form (extraneous properties on link)') } - b = buf.get(offset + 3); - res += (b & src_REST) << 21; - if (b < src_MSB) { - return res; + + if (link.Hash === undefined) { + throw new TypeError('Invalid DAG-PB form (link must have a Hash)') } - b = buf.get(offset + 4); - res += (b & src_REST) * src_N4; - if (b < src_MSB) { - return res; + + // @ts-ignore private property for TS + if (link.Hash == null || !link.Hash['/'] || link.Hash['/'] !== link.Hash.bytes) { + throw new TypeError('Invalid DAG-PB form (link Hash must be a CID)') } - b = buf.get(offset + 5); - res += (b & src_REST) * src_N5; - if (b < src_MSB) { - return res; + + if (link.Name !== undefined && typeof link.Name !== 'string') { + throw new TypeError('Invalid DAG-PB form (link Name must be a string)') } - b = buf.get(offset + 6); - res += (b & src_REST) * src_N6; - if (b < src_MSB) { - return res; + + if (link.Tsize !== undefined) { + if (typeof link.Tsize !== 'number' || link.Tsize % 1 !== 0) { + throw new TypeError('Invalid DAG-PB form (link Tsize must be an integer)') + } + if (link.Tsize < 0) { + throw new TypeError('Invalid DAG-PB form (link Tsize cannot be negative)') + } } - b = buf.get(offset + 7); - res += (b & src_REST) * src_N7; - if (b < src_MSB) { - return res; + + if (i > 0 && linkComparator(link, node.Links[i - 1]) === -1) { + throw new TypeError('Invalid DAG-PB form (links must be sorted by Name bytes)') } - throw new RangeError('Could not decode varint'); + } } -function dist_src_encode(value, buf, offset = 0) { - if (buf == null) { - buf = alloc_allocUnsafe(src_encodingLength(value)); - } - if (buf instanceof Uint8Array) { - return encodeUint8Array(value, buf, offset); - } - else { - return encodeUint8ArrayList(value, buf, offset); - } + +/** + * @param {Uint8Array} data + * @param {PBLink[]} [links=[]] + * @returns {PBNode} + */ +function createNode (data, links = []) { + return prepare({ Data: data, Links: links }) +} + +/** + * @param {string} name + * @param {number} size + * @param {CID} cid + * @returns {PBLink} + */ +function createLink (name, size, cid) { + return asLink({ Hash: cid, Name: name, Tsize: size }) +} + +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-pb/src/index.js + + + + + +/** + * @template T + * @typedef {import('multiformats/codecs/interface').ByteView} ByteView + */ + +/** + * @typedef {import('./interface.js').PBLink} PBLink + * @typedef {import('./interface.js').PBNode} PBNode + */ + +const src_name = 'dag-pb' +const code = 0x70 + +/** + * @param {PBNode} node + * @returns {ByteView} + */ +function src_encode (node) { + validate(node) + + const pbn = {} + if (node.Links) { + pbn.Links = node.Links.map((l) => { + const link = {} + if (l.Hash) { + link.Hash = l.Hash.bytes // cid -> bytes + } + if (l.Name !== undefined) { + link.Name = l.Name + } + if (l.Tsize !== undefined) { + link.Tsize = l.Tsize + } + return link + }) + } + if (node.Data) { + pbn.Data = node.Data + } + + return encodeNode(pbn) +} + +/** + * @param {ByteView} bytes + * @returns {PBNode} + */ +function src_decode (bytes) { + const pbn = decodeNode(bytes) + + const node = {} + + if (pbn.Data) { + node.Data = pbn.Data + } + + if (pbn.Links) { + node.Links = pbn.Links.map((l) => { + const link = {} + try { + link.Hash = cid_CID.decode(l.Hash) + } catch (e) {} + if (!link.Hash) { + throw new Error('Invalid Hash field found in link, expected CID') + } + if (l.Name !== undefined) { + link.Name = l.Name + } + if (l.Tsize !== undefined) { + link.Tsize = l.Tsize + } + return link + }) + } + + return node +} + + + +;// CONCATENATED MODULE: ./node_modules/cborg/lib/is.js +// This is an unfortunate replacement for @sindresorhus/is that we need to +// re-implement for performance purposes. In particular the is.observable() +// check is expensive, and unnecessary for our purposes. The values returned +// are compatible with @sindresorhus/is, however. + +const typeofs = [ + 'string', + 'number', + 'bigint', + 'symbol' +] + +const objectTypeNames = [ + 'Function', + 'Generator', + 'AsyncGenerator', + 'GeneratorFunction', + 'AsyncGeneratorFunction', + 'AsyncFunction', + 'Observable', + 'Array', + 'Buffer', + 'Object', + 'RegExp', + 'Date', + 'Error', + 'Map', + 'Set', + 'WeakMap', + 'WeakSet', + 'ArrayBuffer', + 'SharedArrayBuffer', + 'DataView', + 'Promise', + 'URL', + 'HTMLElement', + 'Int8Array', + 'Uint8Array', + 'Uint8ClampedArray', + 'Int16Array', + 'Uint16Array', + 'Int32Array', + 'Uint32Array', + 'Float32Array', + 'Float64Array', + 'BigInt64Array', + 'BigUint64Array' +] + +/** + * @param {any} value + * @returns {string} + */ +function is (value) { + if (value === null) { + return 'null' + } + if (value === undefined) { + return 'undefined' + } + if (value === true || value === false) { + return 'boolean' + } + const typeOf = typeof value + if (typeofs.includes(typeOf)) { + return typeOf + } + /* c8 ignore next 4 */ + // not going to bother testing this, it's not going to be valid anyway + if (typeOf === 'function') { + return 'Function' + } + if (Array.isArray(value)) { + return 'Array' + } + if (isBuffer(value)) { + return 'Buffer' + } + const objectType = getObjectType(value) + if (objectType) { + return objectType + } + /* c8 ignore next */ + return 'Object' +} + +/** + * @param {any} value + * @returns {boolean} + */ +function isBuffer (value) { + return value && value.constructor && value.constructor.isBuffer && value.constructor.isBuffer.call(null, value) +} + +/** + * @param {any} value + * @returns {string|undefined} + */ +function getObjectType (value) { + const objectTypeName = Object.prototype.toString.call(value).slice(8, -1) + if (objectTypeNames.includes(objectTypeName)) { + return objectTypeName + } + /* c8 ignore next */ + return undefined +} + +;// CONCATENATED MODULE: ./node_modules/cborg/lib/token.js +class token_Type { + /** + * @param {number} major + * @param {string} name + * @param {boolean} terminal + */ + constructor (major, name, terminal) { + this.major = major + this.majorEncoded = major << 5 + this.name = name + this.terminal = terminal + } + + /* c8 ignore next 3 */ + toString () { + return `Type[${this.major}].${this.name}` + } + + /** + * @param {Type} typ + * @returns {number} + */ + compare (typ) { + /* c8 ignore next 1 */ + return this.major < typ.major ? -1 : this.major > typ.major ? 1 : 0 + } } -function dist_src_decode(buf, offset = 0) { - if (buf instanceof Uint8Array) { - return decodeUint8Array(buf, offset); - } - else { - return decodeUint8ArrayList(buf, offset); - } + +// convert to static fields when better supported +token_Type.uint = new token_Type(0, 'uint', true) +token_Type.negint = new token_Type(1, 'negint', true) +token_Type.bytes = new token_Type(2, 'bytes', true) +token_Type.string = new token_Type(3, 'string', true) +token_Type.array = new token_Type(4, 'array', false) +token_Type.map = new token_Type(5, 'map', false) +token_Type.tag = new token_Type(6, 'tag', false) // terminal? +token_Type.float = new token_Type(7, 'float', true) +token_Type.false = new token_Type(7, 'false', true) +token_Type.true = new token_Type(7, 'true', true) +token_Type.null = new token_Type(7, 'null', true) +token_Type.undefined = new token_Type(7, 'undefined', true) +token_Type.break = new token_Type(7, 'break', true) +// Type.indefiniteLength = new Type(0, 'indefiniteLength', true) + +class token_Token { + /** + * @param {Type} type + * @param {any} [value] + * @param {number} [encodedLength] + */ + constructor (type, value, encodedLength) { + this.type = type + this.value = value + this.encodedLength = encodedLength + /** @type {Uint8Array|undefined} */ + this.encodedBytes = undefined + /** @type {Uint8Array|undefined} */ + this.byteValue = undefined + } + + /* c8 ignore next 3 */ + toString () { + return `Token[${this.type}].${this.value}` + } } -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/uint8arrays/dist/src/concat.js + +;// CONCATENATED MODULE: ./node_modules/cborg/lib/byte-utils.js +// Use Uint8Array directly in the browser, use Buffer in Node.js but don't +// speak its name directly to avoid bundlers pulling in the `Buffer` polyfill + +// @ts-ignore +const useBuffer = globalThis.process && + // @ts-ignore + !globalThis.process.browser && + // @ts-ignore + globalThis.Buffer && + // @ts-ignore + typeof globalThis.Buffer.isBuffer === 'function' + +const byte_utils_textDecoder = new TextDecoder() +const byte_utils_textEncoder = new TextEncoder() + /** - * Returns a new Uint8Array created by concatenating the passed Uint8Arrays + * @param {Uint8Array} buf + * @returns {boolean} */ -function concat_concat(arrays, length) { - if (globalThis.Buffer != null) { - return as_uint8array_asUint8Array(globalThis.Buffer.concat(arrays, length)); - } - if (length == null) { - length = arrays.reduce((acc, curr) => acc + curr.length, 0); - } - const output = allocUnsafe(length); - let offset = 0; - for (const arr of arrays) { - output.set(arr, offset); - offset += arr.length; - } - return as_uint8array_asUint8Array(output); +function byte_utils_isBuffer (buf) { + // @ts-ignore + return useBuffer && globalThis.Buffer.isBuffer(buf) } -//# sourceMappingURL=concat.js.map -;// CONCATENATED MODULE: ./node_modules/@chainsafe/is-ip/lib/parser.js -/* eslint-disable @typescript-eslint/no-unsafe-return */ -class Parser { - index = 0; - input = ""; - new(input) { - this.index = 0; - this.input = input; - return this; - } - /** Run a parser, and restore the pre-parse state if it fails. */ - readAtomically(fn) { - const index = this.index; - const result = fn(); - if (result === undefined) { - this.index = index; - } - return result; - } - /** Run a parser, but fail if the entire input wasn't consumed. Doesn't run atomically. */ - parseWith(fn) { - const result = fn(); - if (this.index !== this.input.length) { - return undefined; - } - return result; - } - /** Peek the next character from the input */ - peekChar() { - if (this.index >= this.input.length) { - return undefined; - } - return this.input[this.index]; - } - /** Read the next character from the input */ - readChar() { - if (this.index >= this.input.length) { - return undefined; - } - return this.input[this.index++]; - } - /** Read the next character from the input if it matches the target. */ - readGivenChar(target) { - return this.readAtomically(() => { - const char = this.readChar(); - if (char !== target) { - return undefined; - } - return char; - }); + +/** + * @param {Uint8Array|number[]} buf + * @returns {Uint8Array} + */ +function asU8A (buf) { + /* c8 ignore next */ + if (!(buf instanceof Uint8Array)) { + return Uint8Array.from(buf) + } + return byte_utils_isBuffer(buf) ? new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength) : buf +} + +const byte_utils_toString = useBuffer + ? // eslint-disable-line operator-linebreak + /** + * @param {Uint8Array} bytes + * @param {number} start + * @param {number} end + */ + (bytes, start, end) => { + return end - start > 64 + ? // eslint-disable-line operator-linebreak + // @ts-ignore + globalThis.Buffer.from(bytes.subarray(start, end)).toString('utf8') + : utf8Slice(bytes, start, end) } + /* c8 ignore next 11 */ + : // eslint-disable-line operator-linebreak /** - * Helper for reading separators in an indexed loop. Reads the separator - * character iff index > 0, then runs the parser. When used in a loop, - * the separator character will only be read on index > 0 (see - * readIPv4Addr for an example) + * @param {Uint8Array} bytes + * @param {number} start + * @param {number} end */ - readSeparator(sep, index, inner) { - return this.readAtomically(() => { - if (index > 0) { - if (this.readGivenChar(sep) === undefined) { - return undefined; - } - } - return inner(); - }); + (bytes, start, end) => { + return end - start > 64 + ? byte_utils_textDecoder.decode(bytes.subarray(start, end)) + : utf8Slice(bytes, start, end) } + +const byte_utils_fromString = useBuffer + ? // eslint-disable-line operator-linebreak /** - * Read a number off the front of the input in the given radix, stopping - * at the first non-digit character or eof. Fails if the number has more - * digits than max_digits or if there is no number. + * @param {string} string */ - readNumber(radix, maxDigits, allowZeroPrefix, maxBytes) { - return this.readAtomically(() => { - let result = 0; - let digitCount = 0; - const leadingChar = this.peekChar(); - if (leadingChar === undefined) { - return undefined; - } - const hasLeadingZero = leadingChar === "0"; - const maxValue = 2 ** (8 * maxBytes) - 1; - // eslint-disable-next-line no-constant-condition - while (true) { - const digit = this.readAtomically(() => { - const char = this.readChar(); - if (char === undefined) { - return undefined; - } - const num = Number.parseInt(char, radix); - if (Number.isNaN(num)) { - return undefined; - } - return num; - }); - if (digit === undefined) { - break; - } - result *= radix; - result += digit; - if (result > maxValue) { - return undefined; - } - digitCount += 1; - if (maxDigits !== undefined) { - if (digitCount > maxDigits) { - return undefined; - } - } - } - if (digitCount === 0) { - return undefined; - } - else if (!allowZeroPrefix && hasLeadingZero && digitCount > 1) { - return undefined; - } - else { - return result; - } - }); + (string) => { + return string.length > 64 + ? // eslint-disable-line operator-linebreak + // @ts-ignore + globalThis.Buffer.from(string) + : utf8ToBytes(string) } - /** Read an IPv4 address. */ - readIPv4Addr() { - return this.readAtomically(() => { - const out = new Uint8Array(4); - for (let i = 0; i < out.length; i++) { - const ix = this.readSeparator(".", i, () => this.readNumber(10, 3, false, 1)); - if (ix === undefined) { - return undefined; - } - out[i] = ix; - } - return out; - }); + /* c8 ignore next 7 */ + : // eslint-disable-line operator-linebreak + /** + * @param {string} string + */ + (string) => { + return string.length > 64 ? byte_utils_textEncoder.encode(string) : utf8ToBytes(string) } - /** Read an IPv6 Address. */ - readIPv6Addr() { - /** - * Read a chunk of an IPv6 address into `groups`. Returns the number - * of groups read, along with a bool indicating if an embedded - * trailing IPv4 address was read. Specifically, read a series of - * colon-separated IPv6 groups (0x0000 - 0xFFFF), with an optional - * trailing embedded IPv4 address. - */ - const readGroups = (groups) => { - for (let i = 0; i < groups.length / 2; i++) { - const ix = i * 2; - // Try to read a trailing embedded IPv4 address. There must be at least 4 groups left. - if (i < groups.length - 3) { - const ipv4 = this.readSeparator(":", i, () => this.readIPv4Addr()); - if (ipv4 !== undefined) { - groups[ix] = ipv4[0]; - groups[ix + 1] = ipv4[1]; - groups[ix + 2] = ipv4[2]; - groups[ix + 3] = ipv4[3]; - return [ix + 4, true]; - } - } - const group = this.readSeparator(":", i, () => this.readNumber(16, 4, true, 2)); - if (group === undefined) { - return [ix, false]; - } - groups[ix] = group >> 8; - groups[ix + 1] = group & 255; - } - return [groups.length, false]; - }; - return this.readAtomically(() => { - // Read the front part of the address; either the whole thing, or up to the first :: - const head = new Uint8Array(16); - const [headSize, headIp4] = readGroups(head); - if (headSize === 16) { - return head; - } - // IPv4 part is not allowed before `::` - if (headIp4) { - return undefined; - } - // Read `::` if previous code parsed less than 8 groups. - // `::` indicates one or more groups of 16 bits of zeros. - if (this.readGivenChar(":") === undefined) { - return undefined; - } - if (this.readGivenChar(":") === undefined) { - return undefined; - } - // Read the back part of the address. The :: must contain at least one - // set of zeroes, so our max length is 7. - const tail = new Uint8Array(14); - const limit = 16 - (headSize + 2); - const [tailSize] = readGroups(tail.subarray(0, limit)); - // Concat the head and tail of the IP address - head.set(tail.subarray(0, tailSize), 16 - tailSize); - return head; - }); + +/** + * Buffer variant not fast enough for what we need + * @param {number[]} arr + * @returns {Uint8Array} + */ +const fromArray = (arr) => { + return Uint8Array.from(arr) +} + +const slice = useBuffer + ? // eslint-disable-line operator-linebreak + /** + * @param {Uint8Array} bytes + * @param {number} start + * @param {number} end + */ + (bytes, start, end) => { + if (byte_utils_isBuffer(bytes)) { + return new Uint8Array(bytes.subarray(start, end)) + } + return bytes.slice(start, end) } - /** Read an IP Address, either IPv4 or IPv6. */ - readIPAddr() { - return this.readIPv4Addr() ?? this.readIPv6Addr(); + /* c8 ignore next 9 */ + : // eslint-disable-line operator-linebreak + /** + * @param {Uint8Array} bytes + * @param {number} start + * @param {number} end + */ + (bytes, start, end) => { + return bytes.slice(start, end) } -} -//# sourceMappingURL=parser.js.map -;// CONCATENATED MODULE: ./node_modules/@chainsafe/is-ip/lib/parse.js -// See https://stackoverflow.com/questions/166132/maximum-length-of-the-textual-representation-of-an-ipv6-address -const MAX_IPV6_LENGTH = 45; -const MAX_IPV4_LENGTH = 15; -const parser = new Parser(); -/** Parse `input` into IPv4 bytes. */ -function parse_parseIPv4(input) { - if (input.length > MAX_IPV4_LENGTH) { - return undefined; +const concat = useBuffer + ? // eslint-disable-line operator-linebreak + /** + * @param {Uint8Array[]} chunks + * @param {number} length + * @returns {Uint8Array} + */ + (chunks, length) => { + // might get a stray plain Array here + /* c8 ignore next 1 */ + chunks = chunks.map((c) => c instanceof Uint8Array + ? c + // this case is occasionally missed during test runs so becomes coverage-flaky + /* c8 ignore next 4 */ + : // eslint-disable-line operator-linebreak + // @ts-ignore + globalThis.Buffer.from(c)) + // @ts-ignore + return asU8A(globalThis.Buffer.concat(chunks, length)) } - return parser.new(input).parseWith(() => parser.readIPv4Addr()); -} -/** Parse `input` into IPv6 bytes. */ -function parse_parseIPv6(input) { - // strip zone index if it is present - if (input.includes("%")) { - input = input.split("%")[0]; + /* c8 ignore next 19 */ + : // eslint-disable-line operator-linebreak + /** + * @param {Uint8Array[]} chunks + * @param {number} length + * @returns {Uint8Array} + */ + (chunks, length) => { + const out = new Uint8Array(length) + let off = 0 + for (let b of chunks) { + if (off + b.length > out.length) { + // final chunk that's bigger than we need + b = b.subarray(0, out.length - off) + } + out.set(b, off) + off += b.length + } + return out } - if (input.length > MAX_IPV6_LENGTH) { - return undefined; + +const alloc = useBuffer + ? // eslint-disable-line operator-linebreak + /** + * @param {number} size + * @returns {Uint8Array} + */ + (size) => { + // we always write over the contents we expose so this should be safe + // @ts-ignore + return globalThis.Buffer.allocUnsafe(size) } - return parser.new(input).parseWith(() => parser.readIPv6Addr()); -} -/** Parse `input` into IPv4 or IPv6 bytes. */ -function parse_parseIP(input) { - // strip zone index if it is present - if (input.includes("%")) { - input = input.split("%")[0]; + /* c8 ignore next 8 */ + : // eslint-disable-line operator-linebreak + /** + * @param {number} size + * @returns {Uint8Array} + */ + (size) => { + return new Uint8Array(size) } - if (input.length > MAX_IPV6_LENGTH) { - return undefined; + +const byte_utils_toHex = (/* unused pure expression or super */ null && (useBuffer + ? // eslint-disable-line operator-linebreak + /** + * @param {Uint8Array} d + * @returns {string} + */ + (d) => { + if (typeof d === 'string') { + return d + } + // @ts-ignore + return globalThis.Buffer.from(toBytes(d)).toString('hex') } - return parser.new(input).parseWith(() => parser.readIPAddr()); -} -//# sourceMappingURL=parse.js.map -;// CONCATENATED MODULE: ./node_modules/@chainsafe/netmask/dist/src/util.js + /* c8 ignore next 12 */ + : // eslint-disable-line operator-linebreak + /** + * @param {Uint8Array} d + * @returns {string} + */ + (d) => { + if (typeof d === 'string') { + return d + } + // @ts-ignore not smart enough to figure this out + return Array.prototype.reduce.call(toBytes(d), (p, c) => `${p}${c.toString(16).padStart(2, '0')}`, '') + })) -function util_allFF(a, from, to) { - let i = 0; - for (const e of a) { - if (i < from) - continue; - if (i > to) - break; - if (e !== 0xff) - return false; - i++; +const byte_utils_fromHex = (/* unused pure expression or super */ null && (useBuffer + ? // eslint-disable-line operator-linebreak + /** + * @param {string|Uint8Array} hex + * @returns {Uint8Array} + */ + (hex) => { + if (hex instanceof Uint8Array) { + return hex + } + // @ts-ignore + return globalThis.Buffer.from(hex, 'hex') } - return true; + /* c8 ignore next 17 */ + : // eslint-disable-line operator-linebreak + /** + * @param {string|Uint8Array} hex + * @returns {Uint8Array} + */ + (hex) => { + if (hex instanceof Uint8Array) { + return hex + } + if (!hex.length) { + return new Uint8Array(0) + } + return new Uint8Array(hex.split('') + .map((/** @type {string} */ c, /** @type {number} */ i, /** @type {string[]} */ d) => i % 2 === 0 ? `0x${c}${d[i + 1]}` : '') + .filter(Boolean) + .map((/** @type {string} */ e) => parseInt(e, 16))) + })) + +/** + * @param {Uint8Array|ArrayBuffer|ArrayBufferView} obj + * @returns {Uint8Array} + */ +function toBytes (obj) { + if (obj instanceof Uint8Array && obj.constructor.name === 'Uint8Array') { + return obj + } + if (obj instanceof ArrayBuffer) { + return new Uint8Array(obj) + } + if (ArrayBuffer.isView(obj)) { + return new Uint8Array(obj.buffer, obj.byteOffset, obj.byteLength) + } + /* c8 ignore next */ + throw new Error('Unknown type, must be binary type') } -function util_deepEqual(a, b, from, to) { - let i = 0; - for (const e of a) { - if (i < from) - continue; - if (i > to) - break; - if (e !== b[i]) - return false; - i++; + +/** + * @param {Uint8Array} b1 + * @param {Uint8Array} b2 + * @returns {number} + */ +function compare (b1, b2) { + /* c8 ignore next 5 */ + if (byte_utils_isBuffer(b1) && byte_utils_isBuffer(b2)) { + // probably not possible to get here in the current API + // @ts-ignore Buffer + return b1.compare(b2) + } + for (let i = 0; i < b1.length; i++) { + if (b1[i] === b2[i]) { + continue } - return true; + return b1[i] < b2[i] ? -1 : 1 + } /* c8 ignore next 3 */ + return 0 } -/*** - * Returns long ip format + +// The below code is taken from https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143 +// Licensed Apache-2.0. + +/** + * @param {string} str + * @returns {number[]} */ -function util_ipToString(ip) { - switch (ip.length) { - case IPv4Len: { - return ip.join("."); - } - case IPv6Len: { - const result = []; - for (let i = 0; i < ip.length; i++) { - if (i % 2 === 0) { - result.push(ip[i].toString(16).padStart(2, "0") + - ip[i + 1].toString(16).padStart(2, "0")); - } - } - return result.join(":"); - } - default: { - throw new Error("Invalid ip length"); - } +function utf8ToBytes (str) { + const out = [] + let p = 0 + for (let i = 0; i < str.length; i++) { + let c = str.charCodeAt(i) + if (c < 128) { + out[p++] = c + } else if (c < 2048) { + out[p++] = (c >> 6) | 192 + out[p++] = (c & 63) | 128 + } else if ( + ((c & 0xFC00) === 0xD800) && (i + 1) < str.length && + ((str.charCodeAt(i + 1) & 0xFC00) === 0xDC00)) { + // Surrogate Pair + c = 0x10000 + ((c & 0x03FF) << 10) + (str.charCodeAt(++i) & 0x03FF) + out[p++] = (c >> 18) | 240 + out[p++] = ((c >> 12) & 63) | 128 + out[p++] = ((c >> 6) & 63) | 128 + out[p++] = (c & 63) | 128 + } else { + out[p++] = (c >> 12) | 224 + out[p++] = ((c >> 6) & 63) | 128 + out[p++] = (c & 63) | 128 } + } + return out } + +// The below code is mostly taken from https://github.com/feross/buffer +// Licensed MIT. Copyright (c) Feross Aboukhadijeh + /** - * If mask is a sequence of 1 bits followed by 0 bits, return number of 1 bits else -1 + * @param {Uint8Array} buf + * @param {number} offset + * @param {number} end + * @returns {string} */ -function util_simpleMaskLength(mask) { - let ones = 0; - // eslint-disable-next-line prefer-const - for (let [index, byte] of mask.entries()) { - if (byte === 0xff) { - ones += 8; - continue; - } - while ((byte & 0x80) != 0) { - ones++; - byte = byte << 1; - } - if ((byte & 0x80) != 0) { - return -1; - } - for (let i = index + 1; i < mask.length; i++) { - if (mask[i] != 0) { - return -1; +function utf8Slice (buf, offset, end) { + const res = [] + + while (offset < end) { + const firstByte = buf[offset] + let codePoint = null + let bytesPerSequence = (firstByte > 0xef) ? 4 : (firstByte > 0xdf) ? 3 : (firstByte > 0xbf) ? 2 : 1 + + if (offset + bytesPerSequence <= end) { + let secondByte, thirdByte, fourthByte, tempCodePoint + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte + } + break + case 2: + secondByte = buf[offset + 1] + if ((secondByte & 0xc0) === 0x80) { + tempCodePoint = (firstByte & 0x1f) << 0x6 | (secondByte & 0x3f) + if (tempCodePoint > 0x7f) { + codePoint = tempCodePoint } - } - break; + } + break + case 3: + secondByte = buf[offset + 1] + thirdByte = buf[offset + 2] + if ((secondByte & 0xc0) === 0x80 && (thirdByte & 0xc0) === 0x80) { + tempCodePoint = (firstByte & 0xf) << 0xc | (secondByte & 0x3f) << 0x6 | (thirdByte & 0x3f) + /* c8 ignore next 3 */ + if (tempCodePoint > 0x7ff && (tempCodePoint < 0xd800 || tempCodePoint > 0xdfff)) { + codePoint = tempCodePoint + } + } + break + case 4: + secondByte = buf[offset + 1] + thirdByte = buf[offset + 2] + fourthByte = buf[offset + 3] + if ((secondByte & 0xc0) === 0x80 && (thirdByte & 0xc0) === 0x80 && (fourthByte & 0xc0) === 0x80) { + tempCodePoint = (firstByte & 0xf) << 0x12 | (secondByte & 0x3f) << 0xc | (thirdByte & 0x3f) << 0x6 | (fourthByte & 0x3f) + if (tempCodePoint > 0xffff && tempCodePoint < 0x110000) { + codePoint = tempCodePoint + } + } + } } - return ones; -} -function util_maskToHex(mask) { - let hex = "0x"; - for (const byte of mask) { - hex += (byte >> 4).toString(16) + (byte & 0x0f).toString(16); + + /* c8 ignore next 5 */ + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xfffd + bytesPerSequence = 1 + } else if (codePoint > 0xffff) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000 + res.push(codePoint >>> 10 & 0x3ff | 0xd800) + codePoint = 0xdc00 | codePoint & 0x3ff } - return hex; -} -//# sourceMappingURL=util.js.map -;// CONCATENATED MODULE: ./node_modules/@chainsafe/netmask/dist/src/ip.js + res.push(codePoint) + offset += bytesPerSequence + } -const ip_IPv4Len = 4; -const ip_IPv6Len = 16; -const maxIPv6Octet = parseInt("0xFFFF", 16); -const ipv4Prefix = new Uint8Array([ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, -]); -function ip_maskIp(ip, mask) { - if (mask.length === ip_IPv6Len && ip.length === ip_IPv4Len && allFF(mask, 0, 11)) { - mask = mask.slice(12); - } - if (mask.length === ip_IPv4Len && - ip.length === ip_IPv6Len && - deepEqual(ip, ipv4Prefix, 0, 11)) { - ip = ip.slice(12); - } - const n = ip.length; - if (n != mask.length) { - throw new Error("Failed to mask ip"); - } - const out = new Uint8Array(n); - for (let i = 0; i < n; i++) { - out[i] = ip[i] & mask[i]; - } - return out; -} -function ip_containsIp(net, ip) { - if (typeof ip === "string") { - ip = parseIP(ip); - } - if (ip == null) - throw new Error("Invalid ip"); - if (ip.length !== net.network.length) { - return false; - } - for (let i = 0; i < ip.length; i++) { - if ((net.network[i] & net.mask[i]) !== (ip[i] & net.mask[i])) { - return false; - } - } - return true; -} -function iPv4FromIPv6(ip) { - if (!isIPv4mappedIPv6(ip)) { - throw new Error("Must have 0xffff prefix"); - } - return ip.slice(12); -} -function isIPv4mappedIPv6(ip) { - return deepEqual(ip, ipv4Prefix, 0, 11); + return decodeCodePointsArray(res) } -//# sourceMappingURL=ip.js.map -;// CONCATENATED MODULE: ./node_modules/@chainsafe/netmask/dist/src/cidr.js +// Based on http://stackoverflow.com/a/22747272/680742, the browser with +// the lowest limit is Chrome, with 0x10000 args. +// We go 1 magnitude less, for safety +const MAX_ARGUMENTS_LENGTH = 0x1000 -function cidr_parseCidr(s) { - const [address, maskString] = s.split("/"); - if (!address || !maskString) - throw new Error("Failed to parse given CIDR: " + s); - let ipLength = IPv4Len; - let ip = parseIPv4(address); - if (ip == null) { - ipLength = IPv6Len; - ip = parseIPv6(address); - if (ip == null) - throw new Error("Failed to parse given CIDR: " + s); - } - const m = parseInt(maskString, 10); - if (Number.isNaN(m) || - String(m).length !== maskString.length || - m < 0 || - m > ipLength * 8) { - throw new Error("Failed to parse given CIDR: " + s); - } - const mask = cidr_cidrMask(m, 8 * ipLength); - return { - network: maskIp(ip, mask), - mask, - }; -} -function cidr_cidrMask(ones, bits) { - if (bits !== 8 * IPv4Len && bits !== 8 * IPv6Len) - throw new Error("Invalid CIDR mask"); - if (ones < 0 || ones > bits) - throw new Error("Invalid CIDR mask"); - const l = bits / 8; - const m = new Uint8Array(l); - for (let i = 0; i < l; i++) { - if (ones >= 8) { - m[i] = 0xff; - ones -= 8; - continue; - } - m[i] = 255 - (0xff >> ones); - ones = 0; - } - return m; +/** + * @param {number[]} codePoints + * @returns {string} + */ +function decodeCodePointsArray (codePoints) { + const len = codePoints.length + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } + /* c8 ignore next 10 */ + // Decode in chunks to avoid "call stack size exceeded". + let res = '' + let i = 0 + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ) + } + return res } -//# sourceMappingURL=cidr.js.map -;// CONCATENATED MODULE: ./node_modules/@chainsafe/netmask/dist/src/ipnet.js +;// CONCATENATED MODULE: ./node_modules/cborg/lib/bl.js +/** + * Bl is a list of byte chunks, similar to https://github.com/rvagg/bl but for + * writing rather than reading. + * A Bl object accepts set() operations for individual bytes and copyTo() for + * inserting byte arrays. These write operations don't automatically increment + * the internal cursor so its "length" won't be changed. Instead, increment() + * must be called to extend its length to cover the inserted data. + * The toBytes() call will convert all internal memory to a single Uint8Array of + * the correct length, truncating any data that is stored but hasn't been + * included by an increment(). + * get() can retrieve a single byte. + * All operations (except toBytes()) take an "offset" argument that will perform + * the write at the offset _from the current cursor_. For most operations this + * will be `0` to write at the current cursor position but it can be ahead of + * the current cursor. Negative offsets probably work but are untested. + */ + +// TODO: ipjs doesn't support this, only for test files: https://github.com/mikeal/ipjs/blob/master/src/package/testFile.js#L39 +// the ts-ignores in this file are almost all for the `Uint8Array|number[]` duality that exists +// for perf reasons. Consider better approaches to this or removing it entirely, it is quite +// risky because of some assumptions about small chunks === number[] and everything else === Uint8Array. -class ipnet_IpNet { - /** - * - * @param ipOrCidr either network ip or full cidr address - * @param mask in case ipOrCidr is network this can be either mask in decimal format or as ip address - */ - constructor(ipOrCidr, mask) { - if (mask == null) { - ({ network: this.network, mask: this.mask } = parseCidr(ipOrCidr)); +const defaultChunkSize = 256 + +class Bl { + /** + * @param {number} [chunkSize] + */ + constructor (chunkSize = defaultChunkSize) { + this.chunkSize = chunkSize + /** @type {number} */ + this.cursor = 0 + /** @type {number} */ + this.maxCursor = -1 + /** @type {(Uint8Array|number[])[]} */ + this.chunks = [] + // keep the first chunk around if we can to save allocations for future encodes + /** @type {Uint8Array|number[]|null} */ + this._initReuseChunk = null + } + + reset () { + this.cursor = 0 + this.maxCursor = -1 + if (this.chunks.length) { + this.chunks = [] + } + if (this._initReuseChunk !== null) { + this.chunks.push(this._initReuseChunk) + this.maxCursor = this._initReuseChunk.length - 1 + } + } + + /** + * @param {Uint8Array|number[]} bytes + */ + push (bytes) { + let topChunk = this.chunks[this.chunks.length - 1] + const newMax = this.cursor + bytes.length + if (newMax <= this.maxCursor + 1) { + // we have at least one chunk and we can fit these bytes into that chunk + const chunkPos = topChunk.length - (this.maxCursor - this.cursor) - 1 + // @ts-ignore + topChunk.set(bytes, chunkPos) + } else { + // can't fit it in + if (topChunk) { + // trip the last chunk to `cursor` if we need to + const chunkPos = topChunk.length - (this.maxCursor - this.cursor) - 1 + if (chunkPos < topChunk.length) { + // @ts-ignore + this.chunks[this.chunks.length - 1] = topChunk.subarray(0, chunkPos) + this.maxCursor = this.cursor - 1 } - else { - const ipResult = parseIP(ipOrCidr); - if (ipResult == null) { - throw new Error("Failed to parse network"); - } - mask = String(mask); - const m = parseInt(mask, 10); - if (Number.isNaN(m) || - String(m).length !== mask.length || - m < 0 || - m > ipResult.length * 8) { - const maskResult = parseIP(mask); - if (maskResult == null) { - throw new Error("Failed to parse mask"); - } - this.mask = maskResult; - } - else { - this.mask = cidrMask(m, 8 * ipResult.length); - } - this.network = maskIp(ipResult, this.mask); + } + if (bytes.length < 64 && bytes.length < this.chunkSize) { + // make a new chunk and copy the new one into it + topChunk = alloc(this.chunkSize) + this.chunks.push(topChunk) + this.maxCursor += topChunk.length + if (this._initReuseChunk === null) { + this._initReuseChunk = topChunk } + // @ts-ignore + topChunk.set(bytes, 0) + } else { + // push the new bytes in as its own chunk + this.chunks.push(bytes) + this.maxCursor += bytes.length + } } - /** - * Checks if netmask contains ip address - * @param ip - * @returns - */ - contains(ip) { - return containsIp({ network: this.network, mask: this.mask }, ip); + this.cursor += bytes.length + } + + /** + * @param {boolean} [reset] + * @returns {Uint8Array} + */ + toBytes (reset = false) { + let byts + if (this.chunks.length === 1) { + const chunk = this.chunks[0] + if (reset && this.cursor > chunk.length / 2) { + /* c8 ignore next 2 */ + // @ts-ignore + byts = this.cursor === chunk.length ? chunk : chunk.subarray(0, this.cursor) + this._initReuseChunk = null + this.chunks = [] + } else { + // @ts-ignore + byts = slice(chunk, 0, this.cursor) + } + } else { + // @ts-ignore + byts = concat(this.chunks, this.cursor) } - /**Serializes back to string format */ - toString() { - const l = simpleMaskLength(this.mask); - const mask = l !== -1 ? String(l) : maskToHex(this.mask); - return ipToString(this.network) + "/" + mask; + if (reset) { + this.reset() } + return byts + } +} + +;// CONCATENATED MODULE: ./node_modules/cborg/lib/common.js +const decodeErrPrefix = 'CBOR decode error:' +const encodeErrPrefix = 'CBOR encode error:' + +const uintMinorPrefixBytes = [] +uintMinorPrefixBytes[23] = 1 +uintMinorPrefixBytes[24] = 2 +uintMinorPrefixBytes[25] = 3 +uintMinorPrefixBytes[26] = 5 +uintMinorPrefixBytes[27] = 9 + +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} need + */ +function assertEnoughData (data, pos, need) { + if (data.length - pos < need) { + throw new Error(`${decodeErrPrefix} not enough data for type`) + } } -//# sourceMappingURL=ipnet.js.map -;// CONCATENATED MODULE: ./node_modules/@chainsafe/netmask/dist/src/index.js + + + +;// CONCATENATED MODULE: ./node_modules/cborg/lib/0uint.js +/* globals BigInt */ +const uintBoundaries = [24, 256, 65536, 4294967296, BigInt('18446744073709551616')] /** - * Checks if cidr block contains ip address - * @param cidr ipv4 or ipv6 formatted cidr . Example 198.51.100.14/24 or 2001:db8::/48 - * @param ip ipv4 or ipv6 address Example 198.51.100.14 or 2001:db8:: - * + * @typedef {import('./bl.js').Bl} Bl + * @typedef {import('../interface').DecodeOptions} DecodeOptions */ -function cidrContains(cidr, ip) { - const ipnet = new IpNet(cidr); - return ipnet.contains(ip); + +/** + * @param {Uint8Array} data + * @param {number} offset + * @param {DecodeOptions} options + * @returns {number} + */ +function readUint8 (data, offset, options) { + assertEnoughData(data, offset, 1) + const value = data[offset] + if (options.strict === true && value < uintBoundaries[0]) { + throw new Error(`${decodeErrPrefix} integer encoded in more bytes than necessary (strict decode)`) + } + return value } -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/uint8arrays/dist/src/from-string.js +/** + * @param {Uint8Array} data + * @param {number} offset + * @param {DecodeOptions} options + * @returns {number} + */ +function readUint16 (data, offset, options) { + assertEnoughData(data, offset, 2) + const value = (data[offset] << 8) | data[offset + 1] + if (options.strict === true && value < uintBoundaries[1]) { + throw new Error(`${decodeErrPrefix} integer encoded in more bytes than necessary (strict decode)`) + } + return value +} /** - * Create a `Uint8Array` from the passed string - * - * Supports `utf8`, `utf-8`, `hex`, and any encoding supported by the multiformats module. - * - * Also `ascii` which is similar to node's 'binary' encoding. + * @param {Uint8Array} data + * @param {number} offset + * @param {DecodeOptions} options + * @returns {number} */ -function from_string_fromString(string, encoding = 'utf8') { - const base = util_bases[encoding]; - if (base == null) { - throw new Error(`Unsupported encoding "${encoding}"`); - } - if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) { - return as_uint8array_asUint8Array(globalThis.Buffer.from(string, 'utf-8')); - } - // add multibase prefix - return base.decoder.decode(`${base.prefix}${string}`); // eslint-disable-line @typescript-eslint/restrict-template-expressions +function readUint32 (data, offset, options) { + assertEnoughData(data, offset, 4) + const value = (data[offset] * 16777216 /* 2 ** 24 */) + (data[offset + 1] << 16) + (data[offset + 2] << 8) + data[offset + 3] + if (options.strict === true && value < uintBoundaries[2]) { + throw new Error(`${decodeErrPrefix} integer encoded in more bytes than necessary (strict decode)`) + } + return value } -//# sourceMappingURL=from-string.js.map -;// CONCATENATED MODULE: external "node:net" -const external_node_net_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:net"); -;// CONCATENATED MODULE: ./node_modules/@chainsafe/is-ip/lib/is-ip.node.js +/** + * @param {Uint8Array} data + * @param {number} offset + * @param {DecodeOptions} options + * @returns {number|bigint} + */ +function readUint64 (data, offset, options) { + // assume BigInt, convert back to Number if within safe range + assertEnoughData(data, offset, 8) + const hi = (data[offset] * 16777216 /* 2 ** 24 */) + (data[offset + 1] << 16) + (data[offset + 2] << 8) + data[offset + 3] + const lo = (data[offset + 4] * 16777216 /* 2 ** 24 */) + (data[offset + 5] << 16) + (data[offset + 6] << 8) + data[offset + 7] + const value = (BigInt(hi) << BigInt(32)) + BigInt(lo) + if (options.strict === true && value < uintBoundaries[3]) { + throw new Error(`${decodeErrPrefix} integer encoded in more bytes than necessary (strict decode)`) + } + if (value <= Number.MAX_SAFE_INTEGER) { + return Number(value) + } + if (options.allowBigInt === true) { + return value + } + throw new Error(`${decodeErrPrefix} integers outside of the safe integer range are not supported`) +} -/** Check if `input` is IPv4 or IPv6. */ -function isIP(input) { - return Boolean((0,external_node_net_namespaceObject.isIP)(input)); +/* not required thanks to quick[] list +const oneByteTokens = new Array(24).fill(0).map((v, i) => new Token(Type.uint, i, 1)) +export function decodeUintCompact (data, pos, minor, options) { + return oneByteTokens[minor] } -//# sourceMappingURL=is-ip.node.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/dist/src/ip.js +*/ +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeUint8 (data, pos, _minor, options) { + return new token_Token(token_Type.uint, readUint8(data, pos + 1, options), 2) +} +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeUint16 (data, pos, _minor, options) { + return new token_Token(token_Type.uint, readUint16(data, pos + 1, options), 3) +} -const isV4 = external_node_net_namespaceObject.isIPv4; -const isV6 = external_node_net_namespaceObject.isIPv6; -// Copied from https://github.com/indutny/node-ip/blob/master/lib/ip.js#L7 -// but with buf/offset args removed because we don't use them -const ip_toBytes = function (ip) { - let offset = 0; - ip = ip.toString().trim(); - if (isV4(ip)) { - const bytes = new Uint8Array(offset + 4); - ip.split(/\./g).forEach((byte) => { - bytes[offset++] = parseInt(byte, 10) & 0xff; - }); - return bytes; - } - if (isV6(ip)) { - const sections = ip.split(':', 8); - let i; - for (i = 0; i < sections.length; i++) { - const isv4 = isV4(sections[i]); - let v4Buffer; - if (isv4) { - v4Buffer = ip_toBytes(sections[i]); - sections[i] = to_string_toString(v4Buffer.slice(0, 2), 'base16'); - } - if (v4Buffer != null && ++i < 8) { - sections.splice(i, 0, to_string_toString(v4Buffer.slice(2, 4), 'base16')); - } - } - if (sections[0] === '') { - while (sections.length < 8) - sections.unshift('0'); - } - else if (sections[sections.length - 1] === '') { - while (sections.length < 8) - sections.push('0'); - } - else if (sections.length < 8) { - for (i = 0; i < sections.length && sections[i] !== ''; i++) - ; - const argv = [i, 1]; - for (i = 9 - sections.length; i > 0; i--) { - argv.push('0'); - } - sections.splice.apply(sections, argv); - } - const bytes = new Uint8Array(offset + 16); - for (i = 0; i < sections.length; i++) { - const word = parseInt(sections[i], 16); - bytes[offset++] = (word >> 8) & 0xff; - bytes[offset++] = word & 0xff; - } - return bytes; - } - throw new Error('invalid ip address'); -}; -// Copied from https://github.com/indutny/node-ip/blob/master/lib/ip.js#L63 -const ip_toString = function (buf, offset = 0, length) { - offset = ~~offset; - length = length ?? (buf.length - offset); - const view = new DataView(buf.buffer); - if (length === 4) { - const result = []; - // IPv4 - for (let i = 0; i < length; i++) { - result.push(buf[offset + i]); - } - return result.join('.'); - } - if (length === 16) { - const result = []; - // IPv6 - for (let i = 0; i < length; i += 2) { - result.push(view.getUint16(offset + i).toString(16)); - } - return result.join(':') - .replace(/(^|:)0(:0)*:0(:|$)/, '$1::$3') - .replace(/:{3,4}/, '::'); - } - return ''; -}; -//# sourceMappingURL=ip.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/dist/src/protocols-table.js -const V = -1; -const names = {}; -const codes = {}; -const table = [ - [4, 32, 'ip4'], - [6, 16, 'tcp'], - [33, 16, 'dccp'], - [41, 128, 'ip6'], - [42, V, 'ip6zone'], - [43, 8, 'ipcidr'], - [53, V, 'dns', true], - [54, V, 'dns4', true], - [55, V, 'dns6', true], - [56, V, 'dnsaddr', true], - [132, 16, 'sctp'], - [273, 16, 'udp'], - [275, 0, 'p2p-webrtc-star'], - [276, 0, 'p2p-webrtc-direct'], - [277, 0, 'p2p-stardust'], - [280, 0, 'webrtc-direct'], - [281, 0, 'webrtc'], - [290, 0, 'p2p-circuit'], - [301, 0, 'udt'], - [302, 0, 'utp'], - [400, V, 'unix', false, true], - // `ipfs` is added before `p2p` for legacy support. - // All text representations will default to `p2p`, but `ipfs` will - // still be supported - [421, V, 'ipfs'], - // `p2p` is the preferred name for 421, and is now the default - [421, V, 'p2p'], - [443, 0, 'https'], - [444, 96, 'onion'], - [445, 296, 'onion3'], - [446, V, 'garlic64'], - [448, 0, 'tls'], - [449, V, 'sni'], - [460, 0, 'quic'], - [461, 0, 'quic-v1'], - [465, 0, 'webtransport'], - [466, V, 'certhash'], - [477, 0, 'ws'], - [478, 0, 'wss'], - [479, 0, 'p2p-websocket-star'], - [480, 0, 'http'], - [777, V, 'memory'] -]; -// populate tables -table.forEach(row => { - const proto = createProtocol(...row); - codes[proto.code] = proto; - names[proto.name] = proto; -}); -function createProtocol(code, size, name, resolvable, path) { - return { - code, - size, - name, - resolvable: Boolean(resolvable), - path: Boolean(path) - }; +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeUint32 (data, pos, _minor, options) { + return new token_Token(token_Type.uint, readUint32(data, pos + 1, options), 5) } + /** - * For the passed proto string or number, return a {@link Protocol} - * - * @example - * - * ```js - * import { protocol } from '@multiformats/multiaddr' - * - * console.info(protocol(4)) - * // { code: 4, size: 32, name: 'ip4', resolvable: false, path: false } - * ``` + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} */ -function protocols_table_getProtocol(proto) { - if (typeof proto === 'number') { - if (codes[proto] != null) { - return codes[proto]; - } - throw new Error(`no protocol with code: ${proto}`); - } - else if (typeof proto === 'string') { - if (names[proto] != null) { - return names[proto]; - } - throw new Error(`no protocol with name: ${proto}`); - } - throw new Error(`invalid protocol id type: ${typeof proto}`); +function decodeUint64 (data, pos, _minor, options) { + return new token_Token(token_Type.uint, readUint64(data, pos + 1, options), 9) } -//# sourceMappingURL=protocols-table.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/dist/src/convert.js + /** - * @packageDocumentation - * - * Provides methods for converting + * @param {Bl} buf + * @param {Token} token */ +function encodeUint (buf, token) { + return encodeUintValue(buf, 0, token.value) +} +/** + * @param {Bl} buf + * @param {number} major + * @param {number|bigint} uint + */ +function encodeUintValue (buf, major, uint) { + if (uint < uintBoundaries[0]) { + const nuint = Number(uint) + // pack into one byte, minor=0, additional=value + buf.push([major | nuint]) + } else if (uint < uintBoundaries[1]) { + const nuint = Number(uint) + // pack into two byte, minor=0, additional=24 + buf.push([major | 24, nuint]) + } else if (uint < uintBoundaries[2]) { + const nuint = Number(uint) + // pack into three byte, minor=0, additional=25 + buf.push([major | 25, nuint >>> 8, nuint & 0xff]) + } else if (uint < uintBoundaries[3]) { + const nuint = Number(uint) + // pack into five byte, minor=0, additional=26 + buf.push([major | 26, (nuint >>> 24) & 0xff, (nuint >>> 16) & 0xff, (nuint >>> 8) & 0xff, nuint & 0xff]) + } else { + const buint = BigInt(uint) + if (buint < uintBoundaries[4]) { + // pack into nine byte, minor=0, additional=27 + const set = [major | 27, 0, 0, 0, 0, 0, 0, 0] + // simulate bitwise above 32 bits + let lo = Number(buint & BigInt(0xffffffff)) + let hi = Number(buint >> BigInt(32) & BigInt(0xffffffff)) + set[8] = lo & 0xff + lo = lo >> 8 + set[7] = lo & 0xff + lo = lo >> 8 + set[6] = lo & 0xff + lo = lo >> 8 + set[5] = lo & 0xff + set[4] = hi & 0xff + hi = hi >> 8 + set[3] = hi & 0xff + hi = hi >> 8 + set[2] = hi & 0xff + hi = hi >> 8 + set[1] = hi & 0xff + buf.push(set) + } else { + throw new Error(`${decodeErrPrefix} encountered BigInt larger than allowable range`) + } + } +} +/** + * @param {Token} token + * @returns {number} + */ +encodeUint.encodedSize = function encodedSize (token) { + return encodeUintValue.encodedSize(token.value) +} +/** + * @param {number} uint + * @returns {number} + */ +encodeUintValue.encodedSize = function encodedSize (uint) { + if (uint < uintBoundaries[0]) { + return 1 + } + if (uint < uintBoundaries[1]) { + return 2 + } + if (uint < uintBoundaries[2]) { + return 3 + } + if (uint < uintBoundaries[3]) { + return 5 + } + return 9 +} +/** + * @param {Token} tok1 + * @param {Token} tok2 + * @returns {number} + */ +encodeUint.compareTokens = function compareTokens (tok1, tok2) { + return tok1.value < tok2.value ? -1 : tok1.value > tok2.value ? 1 : /* c8 ignore next */ 0 +} +;// CONCATENATED MODULE: ./node_modules/cborg/lib/1negint.js +/* eslint-env es2020 */ +/** + * @typedef {import('./bl.js').Bl} Bl + * @typedef {import('../interface').DecodeOptions} DecodeOptions + */ +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeNegint8 (data, pos, _minor, options) { + return new token_Token(token_Type.negint, -1 - readUint8(data, pos + 1, options), 2) +} -const ip4Protocol = protocols_table_getProtocol('ip4'); -const ip6Protocol = protocols_table_getProtocol('ip6'); -const ipcidrProtocol = protocols_table_getProtocol('ipcidr'); -function convert(proto, a) { - if (a instanceof Uint8Array) { - return convertToString(proto, a); - } - else { - return convertToBytes(proto, a); - } +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeNegint16 (data, pos, _minor, options) { + return new token_Token(token_Type.negint, -1 - readUint16(data, pos + 1, options), 3) } + /** - * Convert [code,Uint8Array] to string + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} */ -function convertToString(proto, buf) { - const protocol = protocols_table_getProtocol(proto); - switch (protocol.code) { - case 4: // ipv4 - case 41: // ipv6 - return bytes2ip(buf); - case 42: // ipv6zone - return bytes2str(buf); - case 6: // tcp - case 273: // udp - case 33: // dccp - case 132: // sctp - return bytes2port(buf).toString(); - case 53: // dns - case 54: // dns4 - case 55: // dns6 - case 56: // dnsaddr - case 400: // unix - case 449: // sni - case 777: // memory - return bytes2str(buf); - case 421: // ipfs - return bytes2mh(buf); - case 444: // onion - return bytes2onion(buf); - case 445: // onion3 - return bytes2onion(buf); - case 466: // certhash - return bytes2mb(buf); - default: - return to_string_toString(buf, 'base16'); // no clue. convert to hex - } +function decodeNegint32 (data, pos, _minor, options) { + return new token_Token(token_Type.negint, -1 - readUint32(data, pos + 1, options), 5) } -function convertToBytes(proto, str) { - const protocol = protocols_table_getProtocol(proto); - switch (protocol.code) { - case 4: // ipv4 - return ip2bytes(str); - case 41: // ipv6 - return ip2bytes(str); - case 42: // ipv6zone - return str2bytes(str); - case 6: // tcp - case 273: // udp - case 33: // dccp - case 132: // sctp - return port2bytes(parseInt(str, 10)); - case 53: // dns - case 54: // dns4 - case 55: // dns6 - case 56: // dnsaddr - case 400: // unix - case 449: // sni - case 777: // memory - return str2bytes(str); - case 421: // ipfs - return mh2bytes(str); - case 444: // onion - return onion2bytes(str); - case 445: // onion3 - return onion32bytes(str); - case 466: // certhash - return mb2bytes(str); - default: - return from_string_fromString(str, 'base16'); // no clue. convert from hex + +const neg1b = BigInt(-1) +const pos1b = BigInt(1) + +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeNegint64 (data, pos, _minor, options) { + const int = readUint64(data, pos + 1, options) + if (typeof int !== 'bigint') { + const value = -1 - int + if (value >= Number.MIN_SAFE_INTEGER) { + return new token_Token(token_Type.negint, value, 9) } + } + if (options.allowBigInt !== true) { + throw new Error(`${decodeErrPrefix} integers outside of the safe integer range are not supported`) + } + return new token_Token(token_Type.negint, neg1b - BigInt(int), 9) } -function convert_convertToIpNet(multiaddr) { - let mask; - let addr; - multiaddr.stringTuples().forEach(([code, value]) => { - if (code === ip4Protocol.code || code === ip6Protocol.code) { - addr = value; - } - if (code === ipcidrProtocol.code) { - mask = value; - } - }); - if (mask == null || addr == null) { - throw new Error('Invalid multiaddr'); - } - return new IpNet(addr, mask); + +/** + * @param {Bl} buf + * @param {Token} token + */ +function encodeNegint (buf, token) { + const negint = token.value + const unsigned = (typeof negint === 'bigint' ? (negint * neg1b - pos1b) : (negint * -1 - 1)) + encodeUintValue(buf, token.type.majorEncoded, unsigned) } -const decoders = Object.values(basics_bases).map((c) => c.decoder); -const anybaseDecoder = (function () { - let acc = decoders[0].or(decoders[1]); - decoders.slice(2).forEach((d) => (acc = acc.or(d))); - return acc; -})(); -function ip2bytes(ipString) { - if (!isIP(ipString)) { - throw new Error('invalid ip address'); - } - return ip_toBytes(ipString); + +/** + * @param {Token} token + * @returns {number} + */ +encodeNegint.encodedSize = function encodedSize (token) { + const negint = token.value + const unsigned = (typeof negint === 'bigint' ? (negint * neg1b - pos1b) : (negint * -1 - 1)) + /* c8 ignore next 4 */ + // handled by quickEncode, we shouldn't get here but it's included for completeness + if (unsigned < uintBoundaries[0]) { + return 1 + } + if (unsigned < uintBoundaries[1]) { + return 2 + } + if (unsigned < uintBoundaries[2]) { + return 3 + } + if (unsigned < uintBoundaries[3]) { + return 5 + } + return 9 } -function bytes2ip(ipBuff) { - const ipString = ip_toString(ipBuff, 0, ipBuff.length); - if (ipString == null) { - throw new Error('ipBuff is required'); - } - if (!isIP(ipString)) { - throw new Error('invalid ip address'); - } - return ipString; + +/** + * @param {Token} tok1 + * @param {Token} tok2 + * @returns {number} + */ +encodeNegint.compareTokens = function compareTokens (tok1, tok2) { + // opposite of the uint comparison since we store the uint version in bytes + return tok1.value < tok2.value ? 1 : tok1.value > tok2.value ? -1 : /* c8 ignore next */ 0 } -function port2bytes(port) { - const buf = new ArrayBuffer(2); - const view = new DataView(buf); - view.setUint16(0, port); - return new Uint8Array(buf); + +;// CONCATENATED MODULE: ./node_modules/cborg/lib/2bytes.js + + + + + +/** + * @typedef {import('./bl.js').Bl} Bl + * @typedef {import('../interface').DecodeOptions} DecodeOptions + */ + +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} prefix + * @param {number} length + * @returns {Token} + */ +function toToken (data, pos, prefix, length) { + assertEnoughData(data, pos, prefix + length) + const buf = slice(data, pos + prefix, pos + prefix + length) + return new token_Token(token_Type.bytes, buf, prefix + length) } -function bytes2port(buf) { - const view = new DataView(buf.buffer); - return view.getUint16(buf.byteOffset); + +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} minor + * @param {DecodeOptions} _options + * @returns {Token} + */ +function decodeBytesCompact (data, pos, minor, _options) { + return toToken(data, pos, 1, minor) } -function str2bytes(str) { - const buf = from_string_fromString(str); - const size = Uint8Array.from(dist_src_encode(buf.length)); - return concat_concat([size, buf], size.length + buf.length); + +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeBytes8 (data, pos, _minor, options) { + return toToken(data, pos, 2, readUint8(data, pos + 1, options)) } -function bytes2str(buf) { - const size = dist_src_decode(buf); - buf = buf.slice(src_encodingLength(size)); - if (buf.length !== size) { - throw new Error('inconsistent lengths'); - } - return to_string_toString(buf); + +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeBytes16 (data, pos, _minor, options) { + return toToken(data, pos, 3, readUint16(data, pos + 1, options)) } -function mh2bytes(hash) { - let mh; - if (hash[0] === 'Q' || hash[0] === '1') { - mh = dist_src_hashes_digest_decode(dist_src_bases_base58_base58btc.decode(`z${hash}`)).bytes; - } - else { - mh = multiformats_dist_src_cid_CID.parse(hash).multihash.bytes; - } - // the address is a varint prefixed multihash string representation - const size = Uint8Array.from(dist_src_encode(mh.length)); - return concat_concat([size, mh], size.length + mh.length); + +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeBytes32 (data, pos, _minor, options) { + return toToken(data, pos, 5, readUint32(data, pos + 1, options)) } -function mb2bytes(mbstr) { - const mb = anybaseDecoder.decode(mbstr); - const size = Uint8Array.from(dist_src_encode(mb.length)); - return concat_concat([size, mb], size.length + mb.length); + +// TODO: maybe we shouldn't support this .. +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeBytes64 (data, pos, _minor, options) { + const l = readUint64(data, pos + 1, options) + if (typeof l === 'bigint') { + throw new Error(`${decodeErrPrefix} 64-bit integer bytes lengths not supported`) + } + return toToken(data, pos, 9, l) } -function bytes2mb(buf) { - const size = dist_src_decode(buf); - const hash = buf.slice(src_encodingLength(size)); - if (hash.length !== size) { - throw new Error('inconsistent lengths'); - } - return 'u' + to_string_toString(hash, 'base64url'); + +/** + * `encodedBytes` allows for caching when we do a byte version of a string + * for key sorting purposes + * @param {Token} token + * @returns {Uint8Array} + */ +function tokenBytes (token) { + if (token.encodedBytes === undefined) { + token.encodedBytes = token.type === token_Type.string ? byte_utils_fromString(token.value) : token.value + } + // @ts-ignore c'mon + return token.encodedBytes } + /** - * Converts bytes to bas58btc string + * @param {Bl} buf + * @param {Token} token */ -function bytes2mh(buf) { - const size = dist_src_decode(buf); - const address = buf.slice(src_encodingLength(size)); - if (address.length !== size) { - throw new Error('inconsistent lengths'); - } - return to_string_toString(address, 'base58btc'); +function encodeBytes (buf, token) { + const bytes = tokenBytes(token) + encodeUintValue(buf, token.type.majorEncoded, bytes.length) + buf.push(bytes) } -function onion2bytes(str) { - const addr = str.split(':'); - if (addr.length !== 2) { - throw new Error(`failed to parse onion addr: ["'${addr.join('", "')}'"]' does not contain a port number`); - } - if (addr[0].length !== 16) { - throw new Error(`failed to parse onion addr: ${addr[0]} not a Tor onion address.`); - } - // onion addresses do not include the multibase prefix, add it before decoding - const buf = dist_src_bases_base32_base32.decode('b' + addr[0]); - // onion port number - const port = parseInt(addr[1], 10); - if (port < 1 || port > 65536) { - throw new Error('Port number is not in range(1, 65536)'); - } - const portBuf = port2bytes(port); - return concat_concat([buf, portBuf], buf.length + portBuf.length); + +/** + * @param {Token} token + * @returns {number} + */ +encodeBytes.encodedSize = function encodedSize (token) { + const bytes = tokenBytes(token) + return encodeUintValue.encodedSize(bytes.length) + bytes.length } -function onion32bytes(str) { - const addr = str.split(':'); - if (addr.length !== 2) { - throw new Error(`failed to parse onion addr: ["'${addr.join('", "')}'"]' does not contain a port number`); - } - if (addr[0].length !== 56) { - throw new Error(`failed to parse onion addr: ${addr[0]} not a Tor onion3 address.`); - } - // onion addresses do not include the multibase prefix, add it before decoding - const buf = dist_src_bases_base32_base32.decode(`b${addr[0]}`); - // onion port number - const port = parseInt(addr[1], 10); - if (port < 1 || port > 65536) { - throw new Error('Port number is not in range(1, 65536)'); - } - const portBuf = port2bytes(port); - return concat_concat([buf, portBuf], buf.length + portBuf.length); + +/** + * @param {Token} tok1 + * @param {Token} tok2 + * @returns {number} + */ +encodeBytes.compareTokens = function compareTokens (tok1, tok2) { + return compareBytes(tokenBytes(tok1), tokenBytes(tok2)) } -function bytes2onion(buf) { - const addrBytes = buf.slice(0, buf.length - 2); - const portBytes = buf.slice(buf.length - 2); - const addr = to_string_toString(addrBytes, 'base32'); - const port = bytes2port(portBytes); - return `${addr}:${port}`; + +/** + * @param {Uint8Array} b1 + * @param {Uint8Array} b2 + * @returns {number} + */ +function compareBytes (b1, b2) { + return b1.length < b2.length ? -1 : b1.length > b2.length ? 1 : compare(b1, b2) } -//# sourceMappingURL=convert.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/dist/src/codec.js + +;// CONCATENATED MODULE: ./node_modules/cborg/lib/3string.js + -function stringToMultiaddrParts(str) { - str = cleanPath(str); - const tuples = []; - const stringTuples = []; - let path = null; - const parts = str.split('/').slice(1); - if (parts.length === 1 && parts[0] === '') { - return { - bytes: new Uint8Array(), - string: '/', - tuples: [], - stringTuples: [], - path: null - }; - } - for (let p = 0; p < parts.length; p++) { - const part = parts[p]; - const proto = protocols_table_getProtocol(part); - if (proto.size === 0) { - tuples.push([proto.code]); - stringTuples.push([proto.code]); - // eslint-disable-next-line no-continue - continue; - } - p++; // advance addr part - if (p >= parts.length) { - throw ParseError('invalid address: ' + str); - } - // if it's a path proto, take the rest - if (proto.path === true) { - // should we need to check each path part to see if it's a proto? - // This would allow for other protocols to be added after a unix path, - // however it would have issues if the path had a protocol name in the path - path = cleanPath(parts.slice(p).join('/')); - tuples.push([proto.code, convertToBytes(proto.code, path)]); - stringTuples.push([proto.code, path]); - break; - } - const bytes = convertToBytes(proto.code, parts[p]); - tuples.push([proto.code, bytes]); - stringTuples.push([proto.code, convertToString(proto.code, bytes)]); - } - return { - string: stringTuplesToString(stringTuples), - bytes: tuplesToBytes(tuples), - tuples, - stringTuples, - path - }; -} -function bytesToMultiaddrParts(bytes) { - const tuples = []; - const stringTuples = []; - let path = null; - let i = 0; - while (i < bytes.length) { - const code = dist_src_decode(bytes, i); - const n = src_encodingLength(code); - const p = protocols_table_getProtocol(code); - const size = sizeForAddr(p, bytes.slice(i + n)); - if (size === 0) { - tuples.push([code]); - stringTuples.push([code]); - i += n; - // eslint-disable-next-line no-continue - continue; - } - const addr = bytes.slice(i + n, i + n + size); - i += (size + n); - if (i > bytes.length) { // did not end _exactly_ at buffer.length - throw ParseError('Invalid address Uint8Array: ' + to_string_toString(bytes, 'base16')); - } - // ok, tuple seems good. - tuples.push([code, addr]); - const stringAddr = convertToString(code, addr); - stringTuples.push([code, stringAddr]); - if (p.path === true) { - // should we need to check each path part to see if it's a proto? - // This would allow for other protocols to be added after a unix path, - // however it would have issues if the path had a protocol name in the path - path = stringAddr; - break; - } - } - return { - bytes: Uint8Array.from(bytes), - string: stringTuplesToString(stringTuples), - tuples, - stringTuples, - path - }; -} /** - * [[str name, str addr]... ] -> string + * @typedef {import('./bl.js').Bl} Bl + * @typedef {import('../interface').DecodeOptions} DecodeOptions */ -function stringTuplesToString(tuples) { - const parts = []; - tuples.map((tup) => { - const proto = protocols_table_getProtocol(tup[0]); - parts.push(proto.name); - if (tup.length > 1 && tup[1] != null) { - parts.push(tup[1]); - } - return null; - }); - return cleanPath(parts.join('/')); -} + /** - * [[int code, Uint8Array ]... ] -> Uint8Array + * @param {Uint8Array} data + * @param {number} pos + * @param {number} prefix + * @param {number} length + * @param {DecodeOptions} options + * @returns {Token} */ -function tuplesToBytes(tuples) { - return concat_concat(tuples.map((tup) => { - const proto = protocols_table_getProtocol(tup[0]); - let buf = Uint8Array.from(dist_src_encode(proto.code)); - if (tup.length > 1 && tup[1] != null) { - buf = concat_concat([buf, tup[1]]); // add address buffer - } - return buf; - })); +function _3string_toToken (data, pos, prefix, length, options) { + const totLength = prefix + length + assertEnoughData(data, pos, totLength) + const tok = new token_Token(token_Type.string, byte_utils_toString(data, pos + prefix, pos + totLength), totLength) + if (options.retainStringBytes === true) { + tok.byteValue = slice(data, pos + prefix, pos + totLength) + } + return tok } + /** - * For the passed address, return the serialized size + * @param {Uint8Array} data + * @param {number} pos + * @param {number} minor + * @param {DecodeOptions} options + * @returns {Token} */ -function sizeForAddr(p, addr) { - if (p.size > 0) { - return p.size / 8; - } - else if (p.size === 0) { - return 0; - } - else { - const size = dist_src_decode(addr instanceof Uint8Array ? addr : Uint8Array.from(addr)); - return size + src_encodingLength(size); - } -} -function bytesToTuples(buf) { - const tuples = []; - let i = 0; - while (i < buf.length) { - const code = varint.decode(buf, i); - const n = varint.encodingLength(code); - const p = getProtocol(code); - const size = sizeForAddr(p, buf.slice(i + n)); - if (size === 0) { - tuples.push([code]); - i += n; - // eslint-disable-next-line no-continue - continue; - } - const addr = buf.slice(i + n, i + n + size); - i += (size + n); - if (i > buf.length) { // did not end _exactly_ at buffer.length - throw ParseError('Invalid address Uint8Array: ' + uint8ArrayToString(buf, 'base16')); - } - // ok, tuple seems good. - tuples.push([code, addr]); - } - return tuples; +function decodeStringCompact (data, pos, minor, options) { + return _3string_toToken(data, pos, 1, minor, options) } -function cleanPath(str) { - return '/' + str.trim().split('/').filter((a) => a).join('/'); + +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeString8 (data, pos, _minor, options) { + return _3string_toToken(data, pos, 2, readUint8(data, pos + 1, options), options) } -function ParseError(str) { - return new Error('Error parsing address: ' + str); + +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeString16 (data, pos, _minor, options) { + return _3string_toToken(data, pos, 3, readUint16(data, pos + 1, options), options) } -//# sourceMappingURL=codec.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/dist/src/multiaddr.js + /** - * @packageDocumentation - * - * An implementation of a Multiaddr in JavaScript - * - * @example - * - * ```js - * import { multiaddr } from '@multiformats/multiaddr' - * - * const ma = multiaddr('/ip4/127.0.0.1/tcp/1234') - * ``` + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} */ +function decodeString32 (data, pos, _minor, options) { + return _3string_toToken(data, pos, 5, readUint32(data, pos + 1, options), options) +} +// TODO: maybe we shouldn't support this .. +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeString64 (data, pos, _minor, options) { + const l = readUint64(data, pos + 1, options) + if (typeof l === 'bigint') { + throw new Error(`${decodeErrPrefix} 64-bit integer string lengths not supported`) + } + return _3string_toToken(data, pos, 9, l, options) +} +const encodeString = encodeBytes +;// CONCATENATED MODULE: ./node_modules/cborg/lib/4array.js +/** + * @typedef {import('./bl.js').Bl} Bl + * @typedef {import('../interface').DecodeOptions} DecodeOptions + */ -const inspect = Symbol.for('nodejs.util.inspect.custom'); -const symbol = Symbol.for('@multiformats/js-multiaddr/multiaddr'); -const DNS_CODES = [ - protocols_table_getProtocol('dns').code, - protocols_table_getProtocol('dns4').code, - protocols_table_getProtocol('dns6').code, - protocols_table_getProtocol('dnsaddr').code -]; /** - * Creates a {@link Multiaddr} from a {@link MultiaddrInput} + * @param {Uint8Array} _data + * @param {number} _pos + * @param {number} prefix + * @param {number} length + * @returns {Token} */ -class Multiaddr { - bytes; - #string; - #tuples; - #stringTuples; - #path; - [symbol] = true; - constructor(addr) { - // default - if (addr == null) { - addr = ''; - } - let parts; - if (addr instanceof Uint8Array) { - parts = bytesToMultiaddrParts(addr); - } - else if (typeof addr === 'string') { - if (addr.length > 0 && addr.charAt(0) !== '/') { - throw new Error(`multiaddr "${addr}" must start with a "/"`); - } - parts = stringToMultiaddrParts(addr); - } - else if (isMultiaddr(addr)) { // Multiaddr - parts = bytesToMultiaddrParts(addr.bytes); - } - else { - throw new Error('addr must be a string, Buffer, or another Multiaddr'); - } - this.bytes = parts.bytes; - this.#string = parts.string; - this.#tuples = parts.tuples; - this.#stringTuples = parts.stringTuples; - this.#path = parts.path; - } - toString() { - return this.#string; - } - toJSON() { - return this.toString(); - } - toOptions() { - let family; - let transport; - let host; - let port; - let zone = ''; - const tcp = protocols_table_getProtocol('tcp'); - const udp = protocols_table_getProtocol('udp'); - const ip4 = protocols_table_getProtocol('ip4'); - const ip6 = protocols_table_getProtocol('ip6'); - const dns6 = protocols_table_getProtocol('dns6'); - const ip6zone = protocols_table_getProtocol('ip6zone'); - for (const [code, value] of this.stringTuples()) { - if (code === ip6zone.code) { - zone = `%${value ?? ''}`; - } - // default to https when protocol & port are omitted from DNS addrs - if (DNS_CODES.includes(code)) { - transport = tcp.name; - port = 443; - host = `${value ?? ''}${zone}`; - family = code === dns6.code ? 6 : 4; - } - if (code === tcp.code || code === udp.code) { - transport = protocols_table_getProtocol(code).name; - port = parseInt(value ?? ''); - } - if (code === ip4.code || code === ip6.code) { - transport = protocols_table_getProtocol(code).name; - host = `${value ?? ''}${zone}`; - family = code === ip6.code ? 6 : 4; - } - } - if (family == null || transport == null || host == null || port == null) { - throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".'); - } - const opts = { - family, - host, - transport, - port - }; - return opts; - } - protos() { - return this.#tuples.map(([code]) => Object.assign({}, protocols_table_getProtocol(code))); - } - protoCodes() { - return this.#tuples.map(([code]) => code); - } - protoNames() { - return this.#tuples.map(([code]) => protocols_table_getProtocol(code).name); - } - tuples() { - return this.#tuples; - } - stringTuples() { - return this.#stringTuples; - } - encapsulate(addr) { - addr = new Multiaddr(addr); - return new Multiaddr(this.toString() + addr.toString()); - } - decapsulate(addr) { - const addrString = addr.toString(); - const s = this.toString(); - const i = s.lastIndexOf(addrString); - if (i < 0) { - throw new Error(`Address ${this.toString()} does not contain subaddress: ${addr.toString()}`); - } - return new Multiaddr(s.slice(0, i)); - } - decapsulateCode(code) { - const tuples = this.tuples(); - for (let i = tuples.length - 1; i >= 0; i--) { - if (tuples[i][0] === code) { - return new Multiaddr(tuplesToBytes(tuples.slice(0, i))); - } - } - return this; - } - getPeerId() { - try { - let tuples = []; - this.stringTuples().forEach(([code, name]) => { - if (code === names.p2p.code) { - tuples.push([code, name]); - } - // if this is a p2p-circuit address, return the target peer id if present - // not the peer id of the relay - if (code === names["p2p-circuit"].code) { - tuples = []; - } - }); - // Get the last ipfs tuple ['p2p', 'peerid string'] - const tuple = tuples.pop(); - if (tuple?.[1] != null) { - const peerIdStr = tuple[1]; - // peer id is base58btc encoded string but not multibase encoded so add the `z` - // prefix so we can validate that it is correctly encoded - if (peerIdStr[0] === 'Q' || peerIdStr[0] === '1') { - return to_string_toString(dist_src_bases_base58_base58btc.decode(`z${peerIdStr}`), 'base58btc'); - } - // try to parse peer id as CID - return to_string_toString(multiformats_dist_src_cid_CID.parse(peerIdStr).multihash.bytes, 'base58btc'); - } - return null; - } - catch (e) { - return null; - } - } - getPath() { - return this.#path; - } - equals(addr) { - return equals_equals(this.bytes, addr.bytes); - } - async resolve(options) { - const resolvableProto = this.protos().find((p) => p.resolvable); - // Multiaddr is not resolvable? - if (resolvableProto == null) { - return [this]; - } - const resolver = resolvers.get(resolvableProto.name); - if (resolver == null) { - throw new errors_CodeError(`no available resolver for ${resolvableProto.name}`, 'ERR_NO_AVAILABLE_RESOLVER'); - } - const addresses = await resolver(this, options); - return addresses.map((a) => new Multiaddr(a)); - } - nodeAddress() { - const options = this.toOptions(); - if (options.transport !== 'tcp' && options.transport !== 'udp') { - throw new Error(`multiaddr must have a valid format - no protocol with name: "${options.transport}". Must have a valid transport protocol: "{tcp, udp}"`); - } - return { - family: options.family, - address: options.host, - port: options.port - }; - } - isThinWaistAddress(addr) { - const protos = (addr ?? this).protos(); - if (protos.length !== 2) { - return false; - } - if (protos[0].code !== 4 && protos[0].code !== 41) { - return false; - } - if (protos[1].code !== 6 && protos[1].code !== 273) { - return false; - } - return true; - } - /** - * Returns Multiaddr as a human-readable string - * https://nodejs.org/api/util.html#utilinspectcustom - * - * @example - * ```js - * import { multiaddr } from '@multiformats/multiaddr' - * - * console.info(multiaddr('/ip4/127.0.0.1/tcp/4001')) - * // 'Multiaddr(/ip4/127.0.0.1/tcp/4001)' - * ``` - */ - [inspect]() { - return `Multiaddr(${this.#string})`; - } +function _4array_toToken (_data, _pos, prefix, length) { + return new token_Token(token_Type.array, length, prefix) } -//# sourceMappingURL=multiaddr.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.js - /** - * A utility class to determine if a Multiaddr contains another - * multiaddr. - * - * This can be used with ipcidr ranges to determine if a given - * multiaddr is in a ipcidr range. - * - * @example - * - * ```js - * import { multiaddr, MultiaddrFilter } from '@multiformats/multiaddr' - * - * const range = multiaddr('/ip4/192.168.10.10/ipcidr/24') - * const filter = new MultiaddrFilter(range) - * - * const input = multiaddr('/ip4/192.168.10.2/udp/60') - * console.info(filter.contains(input)) // true - * ``` + * @param {Uint8Array} data + * @param {number} pos + * @param {number} minor + * @param {DecodeOptions} _options + * @returns {Token} */ -class MultiaddrFilter { - multiaddr; - netmask; - constructor(input) { - this.multiaddr = multiaddr(input); - this.netmask = convertToIpNet(this.multiaddr); - } - contains(input) { - if (input == null) - return false; - const m = multiaddr(input); - let ip; - for (const [code, value] of m.stringTuples()) { - if (code === 4 || code === 41) { - ip = value; - break; - } - } - if (ip === undefined) - return false; - return this.netmask.contains(ip); - } +function decodeArrayCompact (data, pos, minor, _options) { + return _4array_toToken(data, pos, 1, minor) } -//# sourceMappingURL=multiaddr-filter.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/dist/src/index.js + /** - * @packageDocumentation - * - * A standard way to represent addresses that - * - * - support any standard network protocol - * - are self-describing - * - have a binary packed format - * - have a nice string representation - * - encapsulate well - * - * @example - * - * ```js - * import { multiaddr } from '@multiformats/multiaddr' - * const addr = multiaddr("/ip4/127.0.0.1/udp/1234") - * // Multiaddr(/ip4/127.0.0.1/udp/1234) - * - * const addr = multiaddr("/ip4/127.0.0.1/udp/1234") - * // Multiaddr(/ip4/127.0.0.1/udp/1234) - * - * addr.bytes - * // - * - * addr.toString() - * // '/ip4/127.0.0.1/udp/1234' - * - * addr.protos() - * // [ - * // {code: 4, name: 'ip4', size: 32}, - * // {code: 273, name: 'udp', size: 16} - * // ] - * - * // gives you an object that is friendly with what Node.js core modules expect for addresses - * addr.nodeAddress() - * // { - * // family: 4, - * // port: 1234, - * // address: "127.0.0.1" - * // } - * - * addr.encapsulate('/sctp/5678') - * // Multiaddr(/ip4/127.0.0.1/udp/1234/sctp/5678) - * ``` - * - * ## Resolvers - * - * `multiaddr` allows multiaddrs to be resolved when appropriate resolvers are provided. This module already has resolvers available, but you can also create your own. Resolvers should always be set in the same module that is calling `multiaddr.resolve()` to avoid conflicts if multiple versions of `multiaddr` are in your dependency tree. - * - * To provide multiaddr resolvers you can do: - * - * ```js - * import { resolvers } from '@multiformats/multiaddr' - * - * resolvers.set('dnsaddr', resolvers.dnsaddrResolver) - * ``` - * - * The available resolvers are: - * - * | Name | type | Description | - * | ----------------- | --------- | ----------------------------------- | - * | `dnsaddrResolver` | `dnsaddr` | dnsaddr resolution with TXT Records | - * - * A resolver receives a `Multiaddr` as a parameter and returns a `Promise>`. + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} */ - +function decodeArray8 (data, pos, _minor, options) { + return _4array_toToken(data, pos, 2, readUint8(data, pos + 1, options)) +} /** - * All configured {@link Resolver}s + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} */ -const resolvers = new Map(); +function decodeArray16 (data, pos, _minor, options) { + return _4array_toToken(data, pos, 3, readUint16(data, pos + 1, options)) +} /** - * Creates a Multiaddr from a node-friendly address object - * - * @example - * ```js - * import { fromNodeAddress } from '@multiformats/multiaddr' - * - * fromNodeAddress({address: '127.0.0.1', port: '4001'}, 'tcp') - * // Multiaddr(/ip4/127.0.0.1/tcp/4001) - * ``` + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} */ -function fromNodeAddress(addr, transport) { - if (addr == null) { - throw new Error('requires node address object'); - } - if (transport == null) { - throw new Error('requires transport protocol'); - } - let ip; - let host = addr.address; - switch (addr.family) { - case 4: - ip = 'ip4'; - break; - case 6: - ip = 'ip6'; - if (host.includes('%')) { - const parts = host.split('%'); - if (parts.length !== 2) { - throw Error('Multiple ip6 zones in multiaddr'); - } - host = parts[0]; - const zone = parts[1]; - ip = `/ip6zone/${zone}/ip6`; - } - break; - default: - throw Error('Invalid addr family, should be 4 or 6.'); - } - return new MultiaddrClass('/' + [ip, host, transport, addr.port].join('/')); +function decodeArray32 (data, pos, _minor, options) { + return _4array_toToken(data, pos, 5, readUint32(data, pos + 1, options)) } + +// TODO: maybe we shouldn't support this .. /** - * Returns if something is a {@link Multiaddr} that is a resolvable name - * - * @example - * - * ```js - * import { isName, multiaddr } from '@multiformats/multiaddr' - * - * isName(multiaddr('/ip4/127.0.0.1')) - * // false - * isName(multiaddr('/dns/ipfs.io')) - * // true - * ``` + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} */ -function isName(addr) { - if (!isMultiaddr(addr)) { - return false; - } - // if a part of the multiaddr is resolvable, then return true - return addr.protos().some((proto) => proto.resolvable); +function decodeArray64 (data, pos, _minor, options) { + const l = readUint64(data, pos + 1, options) + if (typeof l === 'bigint') { + throw new Error(`${decodeErrPrefix} 64-bit integer array lengths not supported`) + } + return _4array_toToken(data, pos, 9, l) } + /** - * Check if object is a {@link Multiaddr} instance - * - * @example - * - * ```js - * import { isMultiaddr, multiaddr } from '@multiformats/multiaddr' - * - * isMultiaddr(5) - * // false - * isMultiaddr(multiaddr('/ip4/127.0.0.1')) - * // true - * ``` + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} */ -function isMultiaddr(value) { - return Boolean(value?.[symbol]); +function decodeArrayIndefinite (data, pos, _minor, options) { + if (options.allowIndefinite === false) { + throw new Error(`${decodeErrPrefix} indefinite length items not allowed`) + } + return _4array_toToken(data, pos, 1, Infinity) } + /** - * A function that takes a {@link MultiaddrInput} and returns a {@link Multiaddr} - * - * @example - * ```js - * import { multiaddr } from '@libp2p/multiaddr' - * - * multiaddr('/ip4/127.0.0.1/tcp/4001') - * // Multiaddr(/ip4/127.0.0.1/tcp/4001) - * ``` - * - * @param {MultiaddrInput} [addr] - If String or Uint8Array, needs to adhere to the address format of a [multiaddr](https://github.com/multiformats/multiaddr#string-format) + * @param {Bl} buf + * @param {Token} token */ -function src_multiaddr(addr) { - return new Multiaddr(addr); +function encodeArray (buf, token) { + encodeUintValue(buf, token_Type.array.majorEncoded, token.value) } -//# sourceMappingURL=index.js.map -// EXTERNAL MODULE: ./node_modules/ipfs-utils/src/env.js -var env = __nccwpck_require__(75062); -;// CONCATENATED MODULE: ./node_modules/parse-duration/index.mjs -let durationRE = /(-?(?:\d+\.?\d*|\d*\.?\d+)(?:e[-+]?\d+)?)\s*([\p{L}]*)/uig - +// using an array as a map key, are you sure about this? we can only sort +// by map length here, it's up to the encoder to decide to look deeper +encodeArray.compareTokens = encodeUint.compareTokens /** - * conversion ratios + * @param {Token} token + * @returns {number} */ +encodeArray.encodedSize = function encodedSize (token) { + return encodeUintValue.encodedSize(token.value) +} -parse_duration_parse.nanosecond = -parse_duration_parse.ns = 1 / 1e6 - -parse_duration_parse['µs'] = -parse_duration_parse['μs'] = -parse_duration_parse.us = -parse_duration_parse.microsecond = 1 / 1e3 +;// CONCATENATED MODULE: ./node_modules/cborg/lib/5map.js -parse_duration_parse.millisecond = -parse_duration_parse.ms = -parse_duration_parse[''] = 1 -parse_duration_parse.second = -parse_duration_parse.sec = -parse_duration_parse.s = parse_duration_parse.ms * 1000 -parse_duration_parse.minute = -parse_duration_parse.min = -parse_duration_parse.m = parse_duration_parse.s * 60 -parse_duration_parse.hour = -parse_duration_parse.hr = -parse_duration_parse.h = parse_duration_parse.m * 60 +/** + * @typedef {import('./bl.js').Bl} Bl + * @typedef {import('../interface').DecodeOptions} DecodeOptions + */ -parse_duration_parse.day = -parse_duration_parse.d = parse_duration_parse.h * 24 +/** + * @param {Uint8Array} _data + * @param {number} _pos + * @param {number} prefix + * @param {number} length + * @returns {Token} + */ +function _5map_toToken (_data, _pos, prefix, length) { + return new token_Token(token_Type.map, length, prefix) +} -parse_duration_parse.week = -parse_duration_parse.wk = -parse_duration_parse.w = parse_duration_parse.d * 7 +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} minor + * @param {DecodeOptions} _options + * @returns {Token} + */ +function decodeMapCompact (data, pos, minor, _options) { + return _5map_toToken(data, pos, 1, minor) +} -parse_duration_parse.month = -parse_duration_parse.b = -parse_duration_parse.d * (365.25 / 12) +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeMap8 (data, pos, _minor, options) { + return _5map_toToken(data, pos, 2, readUint8(data, pos + 1, options)) +} -parse_duration_parse.year = -parse_duration_parse.yr = -parse_duration_parse.y = parse_duration_parse.d * 365.25 +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeMap16 (data, pos, _minor, options) { + return _5map_toToken(data, pos, 3, readUint16(data, pos + 1, options)) +} /** - * convert `str` to ms - * - * @param {String} str - * @param {String} format - * @return {Number} + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} */ +function decodeMap32 (data, pos, _minor, options) { + return _5map_toToken(data, pos, 5, readUint32(data, pos + 1, options)) +} -function parse_duration_parse(str='', format='ms'){ - var result = null - // ignore commas/placeholders - str = (str+'').replace(/(\d)[,_](\d)/g, '$1$2') - var isNegative = str[0] === '-'; - str.replace(durationRE, function(_, n, units){ - units = unitRatio(units) - if (units) result = (result || 0) + Math.abs(parseFloat(n, 10)) * units - }) +// TODO: maybe we shouldn't support this .. +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeMap64 (data, pos, _minor, options) { + const l = readUint64(data, pos + 1, options) + if (typeof l === 'bigint') { + throw new Error(`${decodeErrPrefix} 64-bit integer map lengths not supported`) + } + return _5map_toToken(data, pos, 9, l) +} - return result && ((result / (unitRatio(format) || 1)) * (isNegative ? -1 : 1)) +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeMapIndefinite (data, pos, _minor, options) { + if (options.allowIndefinite === false) { + throw new Error(`${decodeErrPrefix} indefinite length items not allowed`) + } + return _5map_toToken(data, pos, 1, Infinity) } -function unitRatio(str) { - return parse_duration_parse[str] || parse_duration_parse[str.toLowerCase().replace(/s$/, '')] +/** + * @param {Bl} buf + * @param {Token} token + */ +function encodeMap (buf, token) { + encodeUintValue(buf, token_Type.map.majorEncoded, token.value) } -/* harmony default export */ const parse_duration = (parse_duration_parse); +// using a map as a map key, are you sure about this? we can only sort +// by map length here, it's up to the encoder to decide to look deeper +encodeMap.compareTokens = encodeUint.compareTokens -// EXTERNAL MODULE: ./node_modules/debug/src/index.js -var debug_src = __nccwpck_require__(80908); -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/@libp2p/logger/dist/src/index.js +/** + * @param {Token} token + * @returns {number} + */ +encodeMap.encodedSize = function encodedSize (token) { + return encodeUintValue.encodedSize(token.value) +} +;// CONCATENATED MODULE: ./node_modules/cborg/lib/6tag.js -// Add a formatter for converting to a base58 string -debug_src.formatters.b = (v) => { - return v == null ? 'undefined' : node_modules_multiformats_src_bases_base58_base58btc.baseEncode(v); -}; -// Add a formatter for converting to a base32 string -debug_src.formatters.t = (v) => { - return v == null ? 'undefined' : node_modules_multiformats_src_bases_base32_base32.baseEncode(v); -}; -// Add a formatter for converting to a base64 string -debug_src.formatters.m = (v) => { - return v == null ? 'undefined' : bases_base64_base64.baseEncode(v); -}; -// Add a formatter for stringifying peer ids -debug_src.formatters.p = (v) => { - return v == null ? 'undefined' : v.toString(); -}; -// Add a formatter for stringifying CIDs -debug_src.formatters.c = (v) => { - return v == null ? 'undefined' : v.toString(); -}; -// Add a formatter for stringifying Datastore keys -debug_src.formatters.k = (v) => { - return v == null ? 'undefined' : v.toString(); -}; -// Add a formatter for stringifying Multiaddrs -debug_src.formatters.a = (v) => { - return v == null ? 'undefined' : v.toString(); -}; -function createDisabledLogger(namespace) { - const logger = () => { }; - logger.enabled = false; - logger.color = ''; - logger.diff = 0; - logger.log = () => { }; - logger.namespace = namespace; - logger.destroy = () => true; - logger.extend = () => logger; - return logger; -} -function logger(name) { - // trace logging is a no-op by default - let trace = createDisabledLogger(`${name}:trace`); - // look at all the debug names and see if trace logging has explicitly been enabled - if (debug_src.enabled(`${name}:trace`) && debug_src.names.map(r => r.toString()).find(n => n.includes(':trace')) != null) { - trace = debug_src(`${name}:trace`); - } - return Object.assign(debug_src(name), { - error: debug_src(`${name}:error`), - trace - }); +/** + * @typedef {import('./bl.js').Bl} Bl + * @typedef {import('../interface').DecodeOptions} DecodeOptions + */ + +/** + * @param {Uint8Array} _data + * @param {number} _pos + * @param {number} minor + * @param {DecodeOptions} _options + * @returns {Token} + */ +function decodeTagCompact (_data, _pos, minor, _options) { + return new token_Token(token_Type.tag, minor, 1) } -function disable() { - debug.disable(); + +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeTag8 (data, pos, _minor, options) { + return new token_Token(token_Type.tag, readUint8(data, pos + 1, options), 2) } -function enable(namespaces) { - debug.enable(namespaces); + +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeTag16 (data, pos, _minor, options) { + return new token_Token(token_Type.tag, readUint16(data, pos + 1, options), 3) } -function enabled(namespaces) { - return debug.enabled(namespaces); + +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} + */ +function decodeTag32 (data, pos, _minor, options) { + return new token_Token(token_Type.tag, readUint32(data, pos + 1, options), 5) } -//# sourceMappingURL=index.js.map -// EXTERNAL MODULE: ./node_modules/ipfs-utils/src/http.js -var http = __nccwpck_require__(8530); -// EXTERNAL MODULE: ./node_modules/merge-options/index.js -var merge_options = __nccwpck_require__(67270); -;// CONCATENATED MODULE: ./node_modules/merge-options/index.mjs + /** - * Thin ESM wrapper for CJS named exports. - * - * Ref: https://redfin.engineering/node-modules-at-war-why-commonjs-and-es-modules-cant-get-along-9617135eeca1 + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} */ +function decodeTag64 (data, pos, _minor, options) { + return new token_Token(token_Type.tag, readUint64(data, pos + 1, options), 9) +} +/** + * @param {Bl} buf + * @param {Token} token + */ +function encodeTag (buf, token) { + encodeUintValue(buf, token_Type.tag.majorEncoded, token.value) +} -/* harmony default export */ const node_modules_merge_options = (merge_options); +encodeTag.compareTokens = encodeUint.compareTokens -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/vendor/base-x.js -// base-x encoding / decoding -// Copyright (c) 2018 base-x contributors -// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) -// Distributed under the MIT software license, see the accompanying -// file LICENSE or http://www.opensource.org/licenses/mit-license.php. -function uint8arrays_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { - if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } - var BASE_MAP = new Uint8Array(256); - for (var j = 0; j < BASE_MAP.length; j++) { - BASE_MAP[j] = 255; - } - for (var i = 0; i < ALPHABET.length; i++) { - var x = ALPHABET.charAt(i); - var xc = x.charCodeAt(0); - if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') } - BASE_MAP[xc] = i; - } - var BASE = ALPHABET.length; - var LEADER = ALPHABET.charAt(0); - var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up - var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up - function encode (source) { - if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) { - source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); - } else if (Array.isArray(source)) { - source = Uint8Array.from(source); - } - if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') } - if (source.length === 0) { return '' } - // Skip & count leading zeroes. - var zeroes = 0; - var length = 0; - var pbegin = 0; - var pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; - } - // Allocate enough space in big-endian base58 representation. - var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; - var b58 = new Uint8Array(size); - // Process the bytes. - while (pbegin !== pend) { - var carry = source[pbegin]; - // Apply "b58 = b58 * 256 + ch". - var i = 0; - for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { - carry += (256 * b58[it1]) >>> 0; - b58[it1] = (carry % BASE) >>> 0; - carry = (carry / BASE) >>> 0; - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - pbegin++; - } - // Skip leading zeroes in base58 result. - var it2 = size - length; - while (it2 !== size && b58[it2] === 0) { - it2++; - } - // Translate the result into a string. - var str = LEADER.repeat(zeroes); - for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); } - return str - } - function decodeUnsafe (source) { - if (typeof source !== 'string') { throw new TypeError('Expected String') } - if (source.length === 0) { return new Uint8Array() } - var psz = 0; - // Skip leading spaces. - if (source[psz] === ' ') { return } - // Skip and count leading '1's. - var zeroes = 0; - var length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; - } - // Allocate enough space in big-endian base256 representation. - var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. - var b256 = new Uint8Array(size); - // Process the characters. - while (source[psz]) { - // Decode character - var carry = BASE_MAP[source.charCodeAt(psz)]; - // Invalid character - if (carry === 255) { return } - var i = 0; - for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { - carry += (BASE * b256[it3]) >>> 0; - b256[it3] = (carry % 256) >>> 0; - carry = (carry / 256) >>> 0; - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - psz++; - } - // Skip trailing spaces. - if (source[psz] === ' ') { return } - // Skip leading zeroes in b256. - var it4 = size - length; - while (it4 !== size && b256[it4] === 0) { - it4++; - } - var vch = new Uint8Array(zeroes + (size - it4)); - var j = zeroes; - while (it4 !== size) { - vch[j++] = b256[it4++]; - } - return vch - } - function decode (string) { - var buffer = decodeUnsafe(string); - if (buffer) { return buffer } - throw new Error(`Non-${name} character`) - } - return { - encode: encode, - decodeUnsafe: decodeUnsafe, - decode: decode - } +/** + * @param {Token} token + * @returns {number} + */ +encodeTag.encodedSize = function encodedSize (token) { + return encodeUintValue.encodedSize(token.value) } -var uint8arrays_node_modules_multiformats_vendor_base_x_src = uint8arrays_node_modules_multiformats_vendor_base_x_base; -var uint8arrays_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = uint8arrays_node_modules_multiformats_vendor_base_x_src; +;// CONCATENATED MODULE: ./node_modules/cborg/lib/7float.js +// TODO: shift some of the bytes logic to bytes-utils so we can use Buffer +// where possible + + -/* harmony default export */ const uint8arrays_node_modules_multiformats_vendor_base_x = (uint8arrays_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX); -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bytes.js -const uint8arrays_node_modules_multiformats_src_bytes_empty = new Uint8Array(0) /** - * @param {Uint8Array} d + * @typedef {import('./bl.js').Bl} Bl + * @typedef {import('../interface').DecodeOptions} DecodeOptions + * @typedef {import('../interface').EncodeOptions} EncodeOptions */ -const uint8arrays_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') + +const MINOR_FALSE = 20 +const MINOR_TRUE = 21 +const MINOR_NULL = 22 +const MINOR_UNDEFINED = 23 /** - * @param {string} hex + * @param {Uint8Array} _data + * @param {number} _pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} */ -const uint8arrays_node_modules_multiformats_src_bytes_fromHex = hex => { - const hexes = hex.match(/../g) - return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : uint8arrays_node_modules_multiformats_src_bytes_empty +function decodeUndefined (_data, _pos, _minor, options) { + if (options.allowUndefined === false) { + throw new Error(`${decodeErrPrefix} undefined values are not supported`) + } else if (options.coerceUndefinedToNull === true) { + return new token_Token(token_Type["null"], null, 1) + } + return new token_Token(token_Type.undefined, undefined, 1) } /** - * @param {Uint8Array} aa - * @param {Uint8Array} bb + * @param {Uint8Array} _data + * @param {number} _pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} */ -const uint8arrays_node_modules_multiformats_src_bytes_equals = (aa, bb) => { - if (aa === bb) return true - if (aa.byteLength !== bb.byteLength) { - return false - } - - for (let ii = 0; ii < aa.byteLength; ii++) { - if (aa[ii] !== bb[ii]) { - return false - } +function decodeBreak (_data, _pos, _minor, options) { + if (options.allowIndefinite === false) { + throw new Error(`${decodeErrPrefix} indefinite length items not allowed`) } - - return true + return new token_Token(token_Type["break"], undefined, 1) } /** - * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o - * @returns {Uint8Array} + * @param {number} value + * @param {number} bytes + * @param {DecodeOptions} options + * @returns {Token} */ -const uint8arrays_node_modules_multiformats_src_bytes_coerce = o => { - if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o - if (o instanceof ArrayBuffer) return new Uint8Array(o) - if (ArrayBuffer.isView(o)) { - return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) +function createToken (value, bytes, options) { + if (options) { + if (options.allowNaN === false && Number.isNaN(value)) { + throw new Error(`${decodeErrPrefix} NaN values are not supported`) + } + if (options.allowInfinity === false && (value === Infinity || value === -Infinity)) { + throw new Error(`${decodeErrPrefix} Infinity values are not supported`) + } } - throw new Error('Unknown type, must be binary type') + return new token_Token(token_Type.float, value, bytes) } /** - * @param {any} o - * @returns {o is ArrayBuffer|ArrayBufferView} + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} */ -const uint8arrays_node_modules_multiformats_src_bytes_isBinary = o => - o instanceof ArrayBuffer || ArrayBuffer.isView(o) +function decodeFloat16 (data, pos, _minor, options) { + return createToken(readFloat16(data, pos + 1), 3, options) +} /** - * @param {string} str - * @returns {Uint8Array} + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} */ -const uint8arrays_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) +function decodeFloat32 (data, pos, _minor, options) { + return createToken(readFloat32(data, pos + 1), 5, options) +} /** - * @param {Uint8Array} b - * @returns {string} + * @param {Uint8Array} data + * @param {number} pos + * @param {number} _minor + * @param {DecodeOptions} options + * @returns {Token} */ -const uint8arrays_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) - - - -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base.js - - -// Linter can't see that API is used in types. -// eslint-disable-next-line - +function decodeFloat64 (data, pos, _minor, options) { + return createToken(readFloat64(data, pos + 1), 9, options) +} /** - * Class represents both BaseEncoder and MultibaseEncoder meaning it - * can be used to encode to multibase or base encode without multibase - * prefix. - * - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseEncoder} - * @implements {API.BaseEncoder} + * @param {Bl} buf + * @param {Token} token + * @param {EncodeOptions} options */ -class node_modules_multiformats_src_bases_base_Encoder { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(bytes:Uint8Array) => string} baseEncode - */ - constructor (name, prefix, baseEncode) { - this.name = name - this.prefix = prefix - this.baseEncode = baseEncode - } +function encodeFloat (buf, token, options) { + const float = token.value - /** - * @param {Uint8Array} bytes - * @returns {API.Multibase} - */ - encode (bytes) { - if (bytes instanceof Uint8Array) { - return `${this.prefix}${this.baseEncode(bytes)}` - } else { - throw Error('Unknown type, must be binary type') + if (float === false) { + buf.push([token_Type.float.majorEncoded | MINOR_FALSE]) + } else if (float === true) { + buf.push([token_Type.float.majorEncoded | MINOR_TRUE]) + } else if (float === null) { + buf.push([token_Type.float.majorEncoded | MINOR_NULL]) + } else if (float === undefined) { + buf.push([token_Type.float.majorEncoded | MINOR_UNDEFINED]) + } else { + let decoded + let success = false + if (!options || options.float64 !== true) { + encodeFloat16(float) + decoded = readFloat16(ui8a, 1) + if (float === decoded || Number.isNaN(float)) { + ui8a[0] = 0xf9 + buf.push(ui8a.slice(0, 3)) + success = true + } else { + encodeFloat32(float) + decoded = readFloat32(ui8a, 1) + if (float === decoded) { + ui8a[0] = 0xfa + buf.push(ui8a.slice(0, 5)) + success = true + } + } + } + if (!success) { + encodeFloat64(float) + decoded = readFloat64(ui8a, 1) + ui8a[0] = 0xfb + buf.push(ui8a.slice(0, 9)) } } } /** - * @template {string} Prefix - */ -/** - * Class represents both BaseDecoder and MultibaseDecoder so it could be used - * to decode multibases (with matching prefix) or just base decode strings - * with corresponding base encoding. - * - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseDecoder} - * @implements {API.UnibaseDecoder} - * @implements {API.BaseDecoder} + * @param {Token} token + * @param {EncodeOptions} options + * @returns {number} */ -class node_modules_multiformats_src_bases_base_Decoder { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(text:string) => Uint8Array} baseDecode - */ - constructor (name, prefix, baseDecode) { - this.name = name - this.prefix = prefix - /* c8 ignore next 3 */ - if (prefix.codePointAt(0) === undefined) { - throw new Error('Invalid prefix character') - } - /** @private */ - this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0)) - this.baseDecode = baseDecode - } +encodeFloat.encodedSize = function encodedSize (token, options) { + const float = token.value - /** - * @param {string} text - */ - decode (text) { - if (typeof text === 'string') { - if (text.codePointAt(0) !== this.prefixCodePoint) { - throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`) - } - return this.baseDecode(text.slice(this.prefix.length)) - } else { - throw Error('Can only multibase decode strings') - } + if (float === false || float === true || float === null || float === undefined) { + return 1 } - /** - * @template {string} OtherPrefix - * @param {API.UnibaseDecoder|ComposedDecoder} decoder - * @returns {ComposedDecoder} - */ - or (decoder) { - return node_modules_multiformats_src_bases_base_or(this, decoder) + if (!options || options.float64 !== true) { + encodeFloat16(float) + let decoded = readFloat16(ui8a, 1) + if (float === decoded || Number.isNaN(float)) { + return 3 + } + encodeFloat32(float) + decoded = readFloat32(ui8a, 1) + if (float === decoded) { + return 5 + } } + return 9 } +const buffer = new ArrayBuffer(9) +const dataView = new DataView(buffer, 1) +const ui8a = new Uint8Array(buffer, 0) + /** - * @template {string} Prefix - * @typedef {Record>} Decoders + * @param {number} inp */ +function encodeFloat16 (inp) { + if (inp === Infinity) { + dataView.setUint16(0, 0x7c00, false) + } else if (inp === -Infinity) { + dataView.setUint16(0, 0xfc00, false) + } else if (Number.isNaN(inp)) { + dataView.setUint16(0, 0x7e00, false) + } else { + dataView.setFloat32(0, inp) + const valu32 = dataView.getUint32(0) + const exponent = (valu32 & 0x7f800000) >> 23 + const mantissa = valu32 & 0x7fffff + + /* c8 ignore next 6 */ + if (exponent === 0xff) { + // too big, Infinity, but this should be hard (impossible?) to trigger + dataView.setUint16(0, 0x7c00, false) + } else if (exponent === 0x00) { + // 0.0, -0.0 and subnormals, shouldn't be possible to get here because 0.0 should be counted as an int + dataView.setUint16(0, ((inp & 0x80000000) >> 16) | (mantissa >> 13), false) + } else { // standard numbers + // chunks of logic here borrowed from https://github.com/PJK/libcbor/blob/c78f437182533e3efa8d963ff4b945bb635c2284/src/cbor/encoding.c#L127 + const logicalExponent = exponent - 127 + // Now we know that 2^exponent <= 0 logically + /* c8 ignore next 6 */ + if (logicalExponent < -24) { + /* No unambiguous representation exists, this float is not a half float + and is too small to be represented using a half, round off to zero. + Consistent with the reference implementation. */ + // should be difficult (impossible?) to get here in JS + dataView.setUint16(0, 0) + } else if (logicalExponent < -14) { + /* Offset the remaining decimal places by shifting the significand, the + value is lost. This is an implementation decision that works around the + absence of standard half-float in the language. */ + dataView.setUint16(0, ((valu32 & 0x80000000) >> 16) | /* sign bit */ (1 << (24 + logicalExponent)), false) + } else { + dataView.setUint16(0, ((valu32 & 0x80000000) >> 16) | ((logicalExponent + 15) << 10) | (mantissa >> 13), false) + } + } + } +} /** - * @template {string} Prefix - * @implements {API.MultibaseDecoder} - * @implements {API.CombobaseDecoder} + * @param {Uint8Array} ui8a + * @param {number} pos + * @returns {number} */ -class node_modules_multiformats_src_bases_base_ComposedDecoder { - /** - * @param {Decoders} decoders - */ - constructor (decoders) { - this.decoders = decoders +function readFloat16 (ui8a, pos) { + if (ui8a.length - pos < 2) { + throw new Error(`${decodeErrPrefix} not enough data for float16`) } - /** - * @template {string} OtherPrefix - * @param {API.UnibaseDecoder|ComposedDecoder} decoder - * @returns {ComposedDecoder} - */ - or (decoder) { - return node_modules_multiformats_src_bases_base_or(this, decoder) + const half = (ui8a[pos] << 8) + ui8a[pos + 1] + if (half === 0x7c00) { + return Infinity } - - /** - * @param {string} input - * @returns {Uint8Array} - */ - decode (input) { - const prefix = /** @type {Prefix} */ (input[0]) - const decoder = this.decoders[prefix] - if (decoder) { - return decoder.decode(input) - } else { - throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`) - } + if (half === 0xfc00) { + return -Infinity + } + if (half === 0x7e00) { + return NaN + } + const exp = (half >> 10) & 0x1f + const mant = half & 0x3ff + let val + if (exp === 0) { + val = mant * (2 ** -24) + } else if (exp !== 31) { + val = (mant + 1024) * (2 ** (exp - 25)) + /* c8 ignore next 4 */ + } else { + // may not be possible to get here + val = mant === 0 ? Infinity : NaN } + return (half & 0x8000) ? -val : val } /** - * @template {string} L - * @template {string} R - * @param {API.UnibaseDecoder|API.CombobaseDecoder} left - * @param {API.UnibaseDecoder|API.CombobaseDecoder} right - * @returns {ComposedDecoder} + * @param {number} inp */ -const node_modules_multiformats_src_bases_base_or = (left, right) => new node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({ - ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }), - ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right }) -})) +function encodeFloat32 (inp) { + dataView.setFloat32(0, inp, false) +} /** - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseCodec} - * @implements {API.MultibaseEncoder} - * @implements {API.MultibaseDecoder} - * @implements {API.BaseCodec} - * @implements {API.BaseEncoder} - * @implements {API.BaseDecoder} + * @param {Uint8Array} ui8a + * @param {number} pos + * @returns {number} */ -class node_modules_multiformats_src_bases_base_Codec { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(bytes:Uint8Array) => string} baseEncode - * @param {(text:string) => Uint8Array} baseDecode - */ - constructor (name, prefix, baseEncode, baseDecode) { - this.name = name - this.prefix = prefix - this.baseEncode = baseEncode - this.baseDecode = baseDecode - this.encoder = new node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode) - this.decoder = new node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode) - } - - /** - * @param {Uint8Array} input - */ - encode (input) { - return this.encoder.encode(input) - } - - /** - * @param {string} input - */ - decode (input) { - return this.decoder.decode(input) +function readFloat32 (ui8a, pos) { + if (ui8a.length - pos < 4) { + throw new Error(`${decodeErrPrefix} not enough data for float32`) } + const offset = (ui8a.byteOffset || 0) + pos + return new DataView(ui8a.buffer, offset, 4).getFloat32(0, false) } /** - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {(bytes:Uint8Array) => string} options.encode - * @param {(input:string) => Uint8Array} options.decode - * @returns {Codec} + * @param {number} inp */ -const node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) => - new node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode) +function encodeFloat64 (inp) { + dataView.setFloat64(0, inp, false) +} /** - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {string} options.alphabet - * @returns {Codec} + * @param {Uint8Array} ui8a + * @param {number} pos + * @returns {number} */ -const node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => { - const { encode, decode } = uint8arrays_node_modules_multiformats_vendor_base_x(alphabet, name) - return node_modules_multiformats_src_bases_base_from({ - prefix, - name, - encode, - /** - * @param {string} text - */ - decode: text => uint8arrays_node_modules_multiformats_src_bytes_coerce(decode(text)) - }) +function readFloat64 (ui8a, pos) { + if (ui8a.length - pos < 8) { + throw new Error(`${decodeErrPrefix} not enough data for float64`) + } + const offset = (ui8a.byteOffset || 0) + pos + return new DataView(ui8a.buffer, offset, 8).getFloat64(0, false) } /** - * @param {string} string - * @param {string} alphabet - * @param {number} bitsPerChar - * @param {string} name - * @returns {Uint8Array} + * @param {Token} _tok1 + * @param {Token} _tok2 + * @returns {number} */ -const node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { - // Build the character lookup table: - /** @type {Record} */ - const codes = {} - for (let i = 0; i < alphabet.length; ++i) { - codes[alphabet[i]] = i - } +encodeFloat.compareTokens = encodeUint.compareTokens +/* +encodeFloat.compareTokens = function compareTokens (_tok1, _tok2) { + return _tok1 + throw new Error(`${encodeErrPrefix} cannot use floats as map keys`) +} +*/ + +;// CONCATENATED MODULE: ./node_modules/cborg/lib/jump.js + + + + - // Count the padding bytes: - let end = string.length - while (string[end - 1] === '=') { - --end - } - // Allocate the output: - const out = new Uint8Array((end * bitsPerChar / 8) | 0) - // Parse the data: - let bits = 0 // Number of bits currently in the buffer - let buffer = 0 // Bits waiting to be written out, MSB first - let written = 0 // Next byte to write - for (let i = 0; i < end; ++i) { - // Read one character from the string: - const value = codes[string[i]] - if (value === undefined) { - throw new SyntaxError(`Non-${name} character`) - } - // Append the bits to the buffer: - buffer = (buffer << bitsPerChar) | value - bits += bitsPerChar - // Write out some bits if the buffer has a byte's worth: - if (bits >= 8) { - bits -= 8 - out[written++] = 0xff & (buffer >> bits) - } - } - // Verify that we have received just enough bits: - if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) { - throw new SyntaxError('Unexpected end of data') - } - return out -} /** - * @param {Uint8Array} data - * @param {string} alphabet - * @param {number} bitsPerChar - * @returns {string} + * @typedef {import('../interface').DecodeOptions} DecodeOptions */ -const node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => { - const pad = alphabet[alphabet.length - 1] === '=' - const mask = (1 << bitsPerChar) - 1 - let out = '' - let bits = 0 // Number of bits currently in the buffer - let buffer = 0 // Bits waiting to be written out, MSB first - for (let i = 0; i < data.length; ++i) { - // Slurp data into the buffer: - buffer = (buffer << 8) | data[i] - bits += 8 +/** + * @param {Uint8Array} data + * @param {number} pos + * @param {number} minor + */ +function invalidMinor (data, pos, minor) { + throw new Error(`${decodeErrPrefix} encountered invalid minor (${minor}) for major ${data[pos] >>> 5}`) +} - // Write out as much as we can: - while (bits > bitsPerChar) { - bits -= bitsPerChar - out += alphabet[mask & (buffer >> bits)] - } - } +/** + * @param {string} msg + * @returns {()=>any} + */ +function errorer (msg) { + return () => { throw new Error(`${decodeErrPrefix} ${msg}`) } +} - // Partial character: - if (bits) { - out += alphabet[mask & (buffer << (bitsPerChar - bits))] - } +/** @type {((data:Uint8Array, pos:number, minor:number, options?:DecodeOptions) => any)[]} */ +const jump = [] - // Add padding characters until we hit a byte boundary: - if (pad) { - while ((out.length * bitsPerChar) & 7) { - out += '=' - } - } +// unsigned integer, 0x00..0x17 (0..23) +for (let i = 0; i <= 0x17; i++) { + jump[i] = invalidMinor // uint.decodeUintCompact, handled by quick[] +} +jump[0x18] = decodeUint8 // unsigned integer, one-byte uint8_t follows +jump[0x19] = decodeUint16 // unsigned integer, two-byte uint16_t follows +jump[0x1a] = decodeUint32 // unsigned integer, four-byte uint32_t follows +jump[0x1b] = decodeUint64 // unsigned integer, eight-byte uint64_t follows +jump[0x1c] = invalidMinor +jump[0x1d] = invalidMinor +jump[0x1e] = invalidMinor +jump[0x1f] = invalidMinor +// negative integer, -1-0x00..-1-0x17 (-1..-24) +for (let i = 0x20; i <= 0x37; i++) { + jump[i] = invalidMinor // negintDecode, handled by quick[] +} +jump[0x38] = decodeNegint8 // negative integer, -1-n one-byte uint8_t for n follows +jump[0x39] = decodeNegint16 // negative integer, -1-n two-byte uint16_t for n follows +jump[0x3a] = decodeNegint32 // negative integer, -1-n four-byte uint32_t for follows +jump[0x3b] = decodeNegint64 // negative integer, -1-n eight-byte uint64_t for follows +jump[0x3c] = invalidMinor +jump[0x3d] = invalidMinor +jump[0x3e] = invalidMinor +jump[0x3f] = invalidMinor +// byte string, 0x00..0x17 bytes follow +for (let i = 0x40; i <= 0x57; i++) { + jump[i] = decodeBytesCompact +} +jump[0x58] = decodeBytes8 // byte string, one-byte uint8_t for n, and then n bytes follow +jump[0x59] = decodeBytes16 // byte string, two-byte uint16_t for n, and then n bytes follow +jump[0x5a] = decodeBytes32 // byte string, four-byte uint32_t for n, and then n bytes follow +jump[0x5b] = decodeBytes64 // byte string, eight-byte uint64_t for n, and then n bytes follow +jump[0x5c] = invalidMinor +jump[0x5d] = invalidMinor +jump[0x5e] = invalidMinor +jump[0x5f] = errorer('indefinite length bytes/strings are not supported') // byte string, byte strings follow, terminated by "break" +// UTF-8 string 0x00..0x17 bytes follow +for (let i = 0x60; i <= 0x77; i++) { + jump[i] = decodeStringCompact +} +jump[0x78] = decodeString8 // UTF-8 string, one-byte uint8_t for n, and then n bytes follow +jump[0x79] = decodeString16 // UTF-8 string, two-byte uint16_t for n, and then n bytes follow +jump[0x7a] = decodeString32 // UTF-8 string, four-byte uint32_t for n, and then n bytes follow +jump[0x7b] = decodeString64 // UTF-8 string, eight-byte uint64_t for n, and then n bytes follow +jump[0x7c] = invalidMinor +jump[0x7d] = invalidMinor +jump[0x7e] = invalidMinor +jump[0x7f] = errorer('indefinite length bytes/strings are not supported') // UTF-8 strings follow, terminated by "break" +// array, 0x00..0x17 data items follow +for (let i = 0x80; i <= 0x97; i++) { + jump[i] = decodeArrayCompact +} +jump[0x98] = decodeArray8 // array, one-byte uint8_t for n, and then n data items follow +jump[0x99] = decodeArray16 // array, two-byte uint16_t for n, and then n data items follow +jump[0x9a] = decodeArray32 // array, four-byte uint32_t for n, and then n data items follow +jump[0x9b] = decodeArray64 // array, eight-byte uint64_t for n, and then n data items follow +jump[0x9c] = invalidMinor +jump[0x9d] = invalidMinor +jump[0x9e] = invalidMinor +jump[0x9f] = decodeArrayIndefinite // array, data items follow, terminated by "break" +// map, 0x00..0x17 pairs of data items follow +for (let i = 0xa0; i <= 0xb7; i++) { + jump[i] = decodeMapCompact +} +jump[0xb8] = decodeMap8 // map, one-byte uint8_t for n, and then n pairs of data items follow +jump[0xb9] = decodeMap16 // map, two-byte uint16_t for n, and then n pairs of data items follow +jump[0xba] = decodeMap32 // map, four-byte uint32_t for n, and then n pairs of data items follow +jump[0xbb] = decodeMap64 // map, eight-byte uint64_t for n, and then n pairs of data items follow +jump[0xbc] = invalidMinor +jump[0xbd] = invalidMinor +jump[0xbe] = invalidMinor +jump[0xbf] = decodeMapIndefinite // map, pairs of data items follow, terminated by "break" +// tags +for (let i = 0xc0; i <= 0xd7; i++) { + jump[i] = decodeTagCompact +} +jump[0xd8] = decodeTag8 +jump[0xd9] = decodeTag16 +jump[0xda] = decodeTag32 +jump[0xdb] = decodeTag64 +jump[0xdc] = invalidMinor +jump[0xdd] = invalidMinor +jump[0xde] = invalidMinor +jump[0xdf] = invalidMinor +// 0xe0..0xf3 simple values, unsupported +for (let i = 0xe0; i <= 0xf3; i++) { + jump[i] = errorer('simple values are not supported') +} +jump[0xf4] = invalidMinor // false, handled by quick[] +jump[0xf5] = invalidMinor // true, handled by quick[] +jump[0xf6] = invalidMinor // null, handled by quick[] +jump[0xf7] = decodeUndefined // undefined +jump[0xf8] = errorer('simple values are not supported') // simple value, one byte follows, unsupported +jump[0xf9] = decodeFloat16 // half-precision float (two-byte IEEE 754) +jump[0xfa] = decodeFloat32 // single-precision float (four-byte IEEE 754) +jump[0xfb] = decodeFloat64 // double-precision float (eight-byte IEEE 754) +jump[0xfc] = invalidMinor +jump[0xfd] = invalidMinor +jump[0xfe] = invalidMinor +jump[0xff] = decodeBreak // "break" stop code - return out +/** @type {Token[]} */ +const quick = [] +// ints <24 +for (let i = 0; i < 24; i++) { + quick[i] = new token_Token(token_Type.uint, i, 1) +} +// negints >= -24 +for (let i = -1; i >= -24; i--) { + quick[31 - i] = new token_Token(token_Type.negint, i, 1) } +// empty bytes +quick[0x40] = new token_Token(token_Type.bytes, new Uint8Array(0), 1) +// empty string +quick[0x60] = new token_Token(token_Type.string, '', 1) +// empty list +quick[0x80] = new token_Token(token_Type.array, 0, 1) +// empty map +quick[0xa0] = new token_Token(token_Type.map, 0, 1) +// false +quick[0xf4] = new token_Token(token_Type["false"], false, 1) +// true +quick[0xf5] = new token_Token(token_Type["true"], true, 1) +// null +quick[0xf6] = new token_Token(token_Type["null"], null, 1) /** - * RFC4648 Factory - * - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {string} options.alphabet - * @param {number} options.bitsPerChar + * @param {Token} token + * @returns {Uint8Array|undefined} */ -const node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { - return node_modules_multiformats_src_bases_base_from({ - prefix, - name, - encode (input) { - return node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar) - }, - decode (input) { - return node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name) - } - }) +function quickEncodeToken (token) { + switch (token.type) { + case token_Type["false"]: + return fromArray([0xf4]) + case token_Type["true"]: + return fromArray([0xf5]) + case token_Type["null"]: + return fromArray([0xf6]) + case token_Type.bytes: + if (!token.value.length) { + return fromArray([0x40]) + } + return + case token_Type.string: + if (token.value === '') { + return fromArray([0x60]) + } + return + case token_Type.array: + if (token.value === 0) { + return fromArray([0x80]) + } + /* c8 ignore next 2 */ + // shouldn't be possible if this were called when there was only one token + return + case token_Type.map: + if (token.value === 0) { + return fromArray([0xa0]) + } + /* c8 ignore next 2 */ + // shouldn't be possible if this were called when there was only one token + return + case token_Type.uint: + if (token.value < 24) { + return fromArray([Number(token.value)]) + } + return + case token_Type.negint: + if (token.value >= -24) { + return fromArray([31 - Number(token.value)]) + } + } } -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base10.js +;// CONCATENATED MODULE: ./node_modules/cborg/lib/encode.js + -const bases_base10_base10 = node_modules_multiformats_src_bases_base_baseX({ - prefix: '9', - name: 'base10', - alphabet: '0123456789' -}) -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base16.js -// @ts-check -const bases_base16_base16 = node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'f', - name: 'base16', - alphabet: '0123456789abcdef', - bitsPerChar: 4 -}) -const bases_base16_base16upper = node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'F', - name: 'base16upper', - alphabet: '0123456789ABCDEF', - bitsPerChar: 4 -}) -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base2.js -// @ts-check -const bases_base2_base2 = node_modules_multiformats_src_bases_base_rfc4648({ - prefix: '0', - name: 'base2', - alphabet: '01', - bitsPerChar: 1 -}) -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base256emoji.js -const bases_base256emoji_alphabet = Array.from('🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂') -const bases_base256emoji_alphabetBytesToChars = /** @type {string[]} */ (bases_base256emoji_alphabet.reduce((p, c, i) => { p[i] = c; return p }, /** @type {string[]} */([]))) -const bases_base256emoji_alphabetCharsToBytes = /** @type {number[]} */ (bases_base256emoji_alphabet.reduce((p, c, i) => { p[/** @type {number} */ (c.codePointAt(0))] = i; return p }, /** @type {number[]} */([]))) /** - * @param {Uint8Array} data - * @returns {string} + * @typedef {import('../interface').EncodeOptions} EncodeOptions + * @typedef {import('../interface').OptionalTypeEncoder} OptionalTypeEncoder + * @typedef {import('../interface').Reference} Reference + * @typedef {import('../interface').StrictTypeEncoder} StrictTypeEncoder + * @typedef {import('../interface').TokenTypeEncoder} TokenTypeEncoder + * @typedef {import('../interface').TokenOrNestedTokens} TokenOrNestedTokens */ -function src_bases_base256emoji_encode (data) { - return data.reduce((p, c) => { - p += bases_base256emoji_alphabetBytesToChars[c] - return p - }, '') + +/** @type {EncodeOptions} */ +const defaultEncodeOptions = { + float64: false, + mapSorter, + quickEncodeToken: quickEncodeToken } -/** - * @param {string} str - * @returns {Uint8Array} - */ -function src_bases_base256emoji_decode (str) { - const byts = [] - for (const char of str) { - const byt = bases_base256emoji_alphabetCharsToBytes[/** @type {number} */ (char.codePointAt(0))] - if (byt === undefined) { - throw new Error(`Non-base256emoji character: ${char}`) +/** @returns {TokenTypeEncoder[]} */ +function makeCborEncoders () { + const encoders = [] + encoders[token_Type.uint.major] = encodeUint + encoders[token_Type.negint.major] = encodeNegint + encoders[token_Type.bytes.major] = encodeBytes + encoders[token_Type.string.major] = encodeString + encoders[token_Type.array.major] = encodeArray + encoders[token_Type.map.major] = encodeMap + encoders[token_Type.tag.major] = encodeTag + encoders[token_Type.float.major] = encodeFloat + return encoders +} + +const cborEncoders = makeCborEncoders() + +const buf = new Bl() + +/** @implements {Reference} */ +class Ref { + /** + * @param {object|any[]} obj + * @param {Reference|undefined} parent + */ + constructor (obj, parent) { + this.obj = obj + this.parent = parent + } + + /** + * @param {object|any[]} obj + * @returns {boolean} + */ + includes (obj) { + /** @type {Reference|undefined} */ + let p = this + do { + if (p.obj === obj) { + return true + } + } while (p = p.parent) // eslint-disable-line + return false + } + + /** + * @param {Reference|undefined} stack + * @param {object|any[]} obj + * @returns {Reference} + */ + static createCheck (stack, obj) { + if (stack && stack.includes(obj)) { + throw new Error(`${encodeErrPrefix} object contains circular references`) } - byts.push(byt) + return new Ref(obj, stack) } - return new Uint8Array(byts) } -const bases_base256emoji_base256emoji = node_modules_multiformats_src_bases_base_from({ - prefix: '🚀', - name: 'base256emoji', - encode: src_bases_base256emoji_encode, - decode: src_bases_base256emoji_decode -}) +const simpleTokens = { + null: new token_Token(token_Type["null"], null), + undefined: new token_Token(token_Type.undefined, undefined), + true: new token_Token(token_Type["true"], true), + false: new token_Token(token_Type["false"], false), + emptyArray: new token_Token(token_Type.array, 0), + emptyMap: new token_Token(token_Type.map, 0) +} -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base32.js +/** @type {{[typeName: string]: StrictTypeEncoder}} */ +const typeEncoders = { + /** + * @param {any} obj + * @param {string} _typ + * @param {EncodeOptions} _options + * @param {Reference} [_refStack] + * @returns {TokenOrNestedTokens} + */ + number (obj, _typ, _options, _refStack) { + if (!Number.isInteger(obj) || !Number.isSafeInteger(obj)) { + return new token_Token(token_Type.float, obj) + } else if (obj >= 0) { + return new token_Token(token_Type.uint, obj) + } else { + return new token_Token(token_Type.negint, obj) + } + }, + /** + * @param {any} obj + * @param {string} _typ + * @param {EncodeOptions} _options + * @param {Reference} [_refStack] + * @returns {TokenOrNestedTokens} + */ + bigint (obj, _typ, _options, _refStack) { + if (obj >= BigInt(0)) { + return new token_Token(token_Type.uint, obj) + } else { + return new token_Token(token_Type.negint, obj) + } + }, -const uint8arrays_node_modules_multiformats_src_bases_base32_base32 = node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'b', - name: 'base32', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567', - bitsPerChar: 5 -}) + /** + * @param {any} obj + * @param {string} _typ + * @param {EncodeOptions} _options + * @param {Reference} [_refStack] + * @returns {TokenOrNestedTokens} + */ + Uint8Array (obj, _typ, _options, _refStack) { + return new token_Token(token_Type.bytes, obj) + }, -const uint8arrays_node_modules_multiformats_src_bases_base32_base32upper = node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'B', - name: 'base32upper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', - bitsPerChar: 5 -}) + /** + * @param {any} obj + * @param {string} _typ + * @param {EncodeOptions} _options + * @param {Reference} [_refStack] + * @returns {TokenOrNestedTokens} + */ + string (obj, _typ, _options, _refStack) { + return new token_Token(token_Type.string, obj) + }, -const node_modules_multiformats_src_bases_base32_base32pad = node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'c', - name: 'base32pad', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', - bitsPerChar: 5 -}) + /** + * @param {any} obj + * @param {string} _typ + * @param {EncodeOptions} _options + * @param {Reference} [_refStack] + * @returns {TokenOrNestedTokens} + */ + boolean (obj, _typ, _options, _refStack) { + return obj ? simpleTokens.true : simpleTokens.false + }, -const node_modules_multiformats_src_bases_base32_base32padupper = node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'C', - name: 'base32padupper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', - bitsPerChar: 5 -}) + /** + * @param {any} _obj + * @param {string} _typ + * @param {EncodeOptions} _options + * @param {Reference} [_refStack] + * @returns {TokenOrNestedTokens} + */ + null (_obj, _typ, _options, _refStack) { + return simpleTokens.null + }, -const node_modules_multiformats_src_bases_base32_base32hex = node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'v', - name: 'base32hex', - alphabet: '0123456789abcdefghijklmnopqrstuv', - bitsPerChar: 5 -}) + /** + * @param {any} _obj + * @param {string} _typ + * @param {EncodeOptions} _options + * @param {Reference} [_refStack] + * @returns {TokenOrNestedTokens} + */ + undefined (_obj, _typ, _options, _refStack) { + return simpleTokens.undefined + }, -const node_modules_multiformats_src_bases_base32_base32hexupper = node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'V', - name: 'base32hexupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', - bitsPerChar: 5 -}) + /** + * @param {any} obj + * @param {string} _typ + * @param {EncodeOptions} _options + * @param {Reference} [_refStack] + * @returns {TokenOrNestedTokens} + */ + ArrayBuffer (obj, _typ, _options, _refStack) { + return new token_Token(token_Type.bytes, new Uint8Array(obj)) + }, -const node_modules_multiformats_src_bases_base32_base32hexpad = node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 't', - name: 'base32hexpad', - alphabet: '0123456789abcdefghijklmnopqrstuv=', - bitsPerChar: 5 -}) + /** + * @param {any} obj + * @param {string} _typ + * @param {EncodeOptions} _options + * @param {Reference} [_refStack] + * @returns {TokenOrNestedTokens} + */ + DataView (obj, _typ, _options, _refStack) { + return new token_Token(token_Type.bytes, new Uint8Array(obj.buffer, obj.byteOffset, obj.byteLength)) + }, -const node_modules_multiformats_src_bases_base32_base32hexpadupper = node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'T', - name: 'base32hexpadupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', - bitsPerChar: 5 -}) + /** + * @param {any} obj + * @param {string} _typ + * @param {EncodeOptions} options + * @param {Reference} [refStack] + * @returns {TokenOrNestedTokens} + */ + Array (obj, _typ, options, refStack) { + if (!obj.length) { + if (options.addBreakTokens === true) { + return [simpleTokens.emptyArray, new token_Token(token_Type["break"])] + } + return simpleTokens.emptyArray + } + refStack = Ref.createCheck(refStack, obj) + const entries = [] + let i = 0 + for (const e of obj) { + entries[i++] = encode_objectToTokens(e, options, refStack) + } + if (options.addBreakTokens) { + return [new token_Token(token_Type.array, obj.length), entries, new token_Token(token_Type["break"])] + } + return [new token_Token(token_Type.array, obj.length), entries] + }, + + /** + * @param {any} obj + * @param {string} typ + * @param {EncodeOptions} options + * @param {Reference} [refStack] + * @returns {TokenOrNestedTokens} + */ + Object (obj, typ, options, refStack) { + // could be an Object or a Map + const isMap = typ !== 'Object' + // it's slightly quicker to use Object.keys() than Object.entries() + const keys = isMap ? obj.keys() : Object.keys(obj) + const length = isMap ? obj.size : keys.length + if (!length) { + if (options.addBreakTokens === true) { + return [simpleTokens.emptyMap, new token_Token(token_Type["break"])] + } + return simpleTokens.emptyMap + } + refStack = Ref.createCheck(refStack, obj) + /** @type {TokenOrNestedTokens[]} */ + const entries = [] + let i = 0 + for (const key of keys) { + entries[i++] = [ + encode_objectToTokens(key, options, refStack), + encode_objectToTokens(isMap ? obj.get(key) : obj[key], options, refStack) + ] + } + sortMapEntries(entries, options) + if (options.addBreakTokens) { + return [new token_Token(token_Type.map, length), entries, new token_Token(token_Type["break"])] + } + return [new token_Token(token_Type.map, length), entries] + } +} -const node_modules_multiformats_src_bases_base32_base32z = node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'h', - name: 'base32z', - alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', - bitsPerChar: 5 -}) +typeEncoders.Map = typeEncoders.Object +typeEncoders.Buffer = typeEncoders.Uint8Array +for (const typ of 'Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64'.split(' ')) { + typeEncoders[`${typ}Array`] = typeEncoders.DataView +} -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base36.js +/** + * @param {any} obj + * @param {EncodeOptions} [options] + * @param {Reference} [refStack] + * @returns {TokenOrNestedTokens} + */ +function encode_objectToTokens (obj, options = {}, refStack) { + const typ = is(obj) + const customTypeEncoder = (options && options.typeEncoders && /** @type {OptionalTypeEncoder} */ options.typeEncoders[typ]) || typeEncoders[typ] + if (typeof customTypeEncoder === 'function') { + const tokens = customTypeEncoder(obj, typ, options, refStack) + if (tokens != null) { + return tokens + } + } + const typeEncoder = typeEncoders[typ] + if (!typeEncoder) { + throw new Error(`${encodeErrPrefix} unsupported type: ${typ}`) + } + return typeEncoder(obj, typ, options, refStack) +} +/* +CBOR key sorting is a mess. -const bases_base36_base36 = node_modules_multiformats_src_bases_base_baseX({ - prefix: 'k', - name: 'base36', - alphabet: '0123456789abcdefghijklmnopqrstuvwxyz' -}) +The canonicalisation recommendation from https://tools.ietf.org/html/rfc7049#section-3.9 +includes the wording: -const bases_base36_base36upper = node_modules_multiformats_src_bases_base_baseX({ - prefix: 'K', - name: 'base36upper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' -}) +> The keys in every map must be sorted lowest value to highest. +> Sorting is performed on the bytes of the representation of the key +> data items without paying attention to the 3/5 bit splitting for +> major types. +> ... +> * If two keys have different lengths, the shorter one sorts + earlier; +> * If two keys have the same length, the one with the lower value + in (byte-wise) lexical order sorts earlier. -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base58.js +1. It is not clear what "bytes of the representation of the key" means: is it + the CBOR representation, or the binary representation of the object itself? + Consider the int and uint difference here. +2. It is not clear what "without paying attention to" means: do we include it + and compare on that? Or do we omit the special prefix byte, (mostly) treating + the key in its plain binary representation form. +The FIDO 2.0: Client To Authenticator Protocol spec takes the original CBOR +wording and clarifies it according to their understanding. +https://fidoalliance.org/specs/fido-v2.0-rd-20170927/fido-client-to-authenticator-protocol-v2.0-rd-20170927.html#message-encoding -const uint8arrays_node_modules_multiformats_src_bases_base58_base58btc = node_modules_multiformats_src_bases_base_baseX({ - name: 'base58btc', - prefix: 'z', - alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -}) +> The keys in every map must be sorted lowest value to highest. Sorting is +> performed on the bytes of the representation of the key data items without +> paying attention to the 3/5 bit splitting for major types. The sorting rules +> are: +> * If the major types are different, the one with the lower value in numerical +> order sorts earlier. +> * If two keys have different lengths, the shorter one sorts earlier; +> * If two keys have the same length, the one with the lower value in +> (byte-wise) lexical order sorts earlier. -const node_modules_multiformats_src_bases_base58_base58flickr = node_modules_multiformats_src_bases_base_baseX({ - name: 'base58flickr', - prefix: 'Z', - alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -}) +Some other implementations, such as borc, do a full encode then do a +length-first, byte-wise-second comparison: +https://github.com/dignifiedquire/borc/blob/b6bae8b0bcde7c3976b0f0f0957208095c392a36/src/encoder.js#L358 +https://github.com/dignifiedquire/borc/blob/b6bae8b0bcde7c3976b0f0f0957208095c392a36/src/utils.js#L143-L151 -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base64.js -// @ts-check +This has the benefit of being able to easily handle arbitrary keys, including +complex types (maps and arrays). +We'll opt for the FIDO approach, since it affords some efficies since we don't +need a full encode of each key to determine order and can defer to the types +to determine how to most efficiently order their values (i.e. int and uint +ordering can be done on the numbers, no need for byte-wise, for example). +Recommendation: stick to single key types or you'll get into trouble, and prefer +string keys because it's much simpler that way. +*/ -const multiformats_src_bases_base64_base64 = node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'm', - name: 'base64', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', - bitsPerChar: 6 -}) +/* +(UPDATE, Dec 2020) +https://tools.ietf.org/html/rfc8949 is the updated CBOR spec and clarifies some +of the questions above with a new recommendation for sorting order being much +closer to what would be expected in other environments (i.e. no length-first +weirdness). +This new sorting order is not yet implemented here but could be added as an +option. "Determinism" (canonicity) is system dependent and it's difficult to +change existing systems that are built with existing expectations. So if a new +ordering is introduced here, the old needs to be kept as well with the user +having the option. +*/ -const multiformats_src_bases_base64_base64pad = node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'M', - name: 'base64pad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', - bitsPerChar: 6 -}) +/** + * @param {TokenOrNestedTokens[]} entries + * @param {EncodeOptions} options + */ +function sortMapEntries (entries, options) { + if (options.mapSorter) { + entries.sort(options.mapSorter) + } +} -const multiformats_src_bases_base64_base64url = node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'u', - name: 'base64url', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', - bitsPerChar: 6 -}) +/** + * @param {(Token|Token[])[]} e1 + * @param {(Token|Token[])[]} e2 + * @returns {number} + */ +function mapSorter (e1, e2) { + // the key position ([0]) could have a single token or an array + // almost always it'll be a single token but complex key might get involved + /* c8 ignore next 2 */ + const keyToken1 = Array.isArray(e1[0]) ? e1[0][0] : e1[0] + const keyToken2 = Array.isArray(e2[0]) ? e2[0][0] : e2[0] -const multiformats_src_bases_base64_base64urlpad = node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'U', - name: 'base64urlpad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', - bitsPerChar: 6 -}) + // different key types + if (keyToken1.type !== keyToken2.type) { + return keyToken1.type.compare(keyToken2.type) + } -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base8.js -// @ts-check + const major = keyToken1.type.major + // TODO: handle case where cmp === 0 but there are more keyToken e. complex type) + const tcmp = cborEncoders[major].compareTokens(keyToken1, keyToken2) + /* c8 ignore next 5 */ + if (tcmp === 0) { + // duplicate key or complex type where the first token matched, + // i.e. a map or array and we're only comparing the opening token + console.warn('WARNING: complex key types used, CBOR key sorting guarantees are gone') + } + return tcmp +} +/** + * @param {Bl} buf + * @param {TokenOrNestedTokens} tokens + * @param {TokenTypeEncoder[]} encoders + * @param {EncodeOptions} options + */ +function tokensToEncoded (buf, tokens, encoders, options) { + if (Array.isArray(tokens)) { + for (const token of tokens) { + tokensToEncoded(buf, token, encoders, options) + } + } else { + encoders[tokens.type.major](buf, tokens, options) + } +} +/** + * @param {any} data + * @param {TokenTypeEncoder[]} encoders + * @param {EncodeOptions} options + * @returns {Uint8Array} + */ +function encodeCustom (data, encoders, options) { + const tokens = encode_objectToTokens(data, options) + if (!Array.isArray(tokens) && options.quickEncodeToken) { + const quickBytes = options.quickEncodeToken(tokens) + if (quickBytes) { + return quickBytes + } + const encoder = encoders[tokens.type.major] + if (encoder.encodedSize) { + const size = encoder.encodedSize(tokens, options) + const buf = new Bl(size) + encoder(buf, tokens, options) + /* c8 ignore next 4 */ + // this would be a problem with encodedSize() functions + if (buf.chunks.length !== 1) { + throw new Error(`Unexpected error: pre-calculated length for ${tokens} was wrong`) + } + return asU8A(buf.chunks[0]) + } + } + buf.reset() + tokensToEncoded(buf, tokens, encoders, options) + return buf.toBytes(true) +} -const bases_base8_base8 = node_modules_multiformats_src_bases_base_rfc4648({ - prefix: '7', - name: 'base8', - alphabet: '01234567', - bitsPerChar: 3 -}) +/** + * @param {any} data + * @param {EncodeOptions} [options] + * @returns {Uint8Array} + */ +function encode_encode (data, options) { + options = Object.assign({}, defaultEncodeOptions, options) + return encodeCustom(data, cborEncoders, options) +} -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/identity.js -// @ts-check +;// CONCATENATED MODULE: ./node_modules/cborg/lib/decode.js -const multiformats_src_bases_identity_identity = node_modules_multiformats_src_bases_base_from({ - prefix: '\x00', - name: 'identity', - encode: (buf) => uint8arrays_node_modules_multiformats_src_bytes_toString(buf), - decode: (str) => uint8arrays_node_modules_multiformats_src_bytes_fromString(str) -}) -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/codecs/json.js -// @ts-check /** - * @template T - * @typedef {import('./interface.js').ByteView} ByteView + * @typedef {import('./token.js').Token} Token + * @typedef {import('../interface').DecodeOptions} DecodeOptions + * @typedef {import('../interface').DecodeTokenizer} DecodeTokenizer */ -const src_codecs_json_textEncoder = new TextEncoder() -const src_codecs_json_textDecoder = new TextDecoder() - -const src_codecs_json_name = 'json' -const src_codecs_json_code = 0x0200 +const defaultDecodeOptions = { + strict: false, + allowIndefinite: true, + allowUndefined: true, + allowBigInt: true +} /** - * @template T - * @param {T} node - * @returns {ByteView} + * @implements {DecodeTokenizer} */ -const src_codecs_json_encode = (node) => src_codecs_json_textEncoder.encode(JSON.stringify(node)) +class Tokeniser { + /** + * @param {Uint8Array} data + * @param {DecodeOptions} options + */ + constructor (data, options = {}) { + this._pos = 0 + this.data = data + this.options = options + } -/** - * @template T - * @param {ByteView} data - * @returns {T} - */ -const src_codecs_json_decode = (data) => JSON.parse(src_codecs_json_textDecoder.decode(data)) + pos () { + return this._pos + } -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/codecs/raw.js -// @ts-check + done () { + return this._pos >= this.data.length + } + next () { + const byt = this.data[this._pos] + let token = quick[byt] + if (token === undefined) { + const decoder = jump[byt] + /* c8 ignore next 4 */ + // if we're here then there's something wrong with our jump or quick lists! + if (!decoder) { + throw new Error(`${decodeErrPrefix} no decoder for major type ${byt >>> 5} (byte 0x${byt.toString(16).padStart(2, '0')})`) + } + const minor = byt & 31 + token = decoder(this.data, this._pos, minor, this.options) + } + // @ts-ignore we get to assume encodedLength is set (crossing fingers slightly) + this._pos += token.encodedLength + return token + } +} +const DONE = Symbol.for('DONE') +const BREAK = Symbol.for('BREAK') /** - * @template T - * @typedef {import('./interface.js').ByteView} ByteView + * @param {Token} token + * @param {DecodeTokenizer} tokeniser + * @param {DecodeOptions} options + * @returns {any|BREAK|DONE} */ - -const src_codecs_raw_name = 'raw' -const src_codecs_raw_code = 0x55 +function tokenToArray (token, tokeniser, options) { + const arr = [] + for (let i = 0; i < token.value; i++) { + const value = tokensToObject(tokeniser, options) + if (value === BREAK) { + if (token.value === Infinity) { + // normal end to indefinite length array + break + } + throw new Error(`${decodeErrPrefix} got unexpected break to lengthed array`) + } + if (value === DONE) { + throw new Error(`${decodeErrPrefix} found array but not enough entries (got ${i}, expected ${token.value})`) + } + arr[i] = value + } + return arr +} /** - * @param {Uint8Array} node - * @returns {ByteView} + * @param {Token} token + * @param {DecodeTokenizer} tokeniser + * @param {DecodeOptions} options + * @returns {any|BREAK|DONE} */ -const src_codecs_raw_encode = (node) => uint8arrays_node_modules_multiformats_src_bytes_coerce(node) +function tokenToMap (token, tokeniser, options) { + const useMaps = options.useMaps === true + const obj = useMaps ? undefined : {} + const m = useMaps ? new Map() : undefined + for (let i = 0; i < token.value; i++) { + const key = tokensToObject(tokeniser, options) + if (key === BREAK) { + if (token.value === Infinity) { + // normal end to indefinite length map + break + } + throw new Error(`${decodeErrPrefix} got unexpected break to lengthed map`) + } + if (key === DONE) { + throw new Error(`${decodeErrPrefix} found map but not enough entries (got ${i} [no key], expected ${token.value})`) + } + if (useMaps !== true && typeof key !== 'string') { + throw new Error(`${decodeErrPrefix} non-string keys not supported (got ${typeof key})`) + } + if (options.rejectDuplicateMapKeys === true) { + // @ts-ignore + if ((useMaps && m.has(key)) || (!useMaps && (key in obj))) { + throw new Error(`${decodeErrPrefix} found repeat map key "${key}"`) + } + } + const value = tokensToObject(tokeniser, options) + if (value === DONE) { + throw new Error(`${decodeErrPrefix} found map but not enough entries (got ${i} [no value], expected ${token.value})`) + } + if (useMaps) { + // @ts-ignore TODO reconsider this .. maybe needs to be strict about key types + m.set(key, value) + } else { + // @ts-ignore TODO reconsider this .. maybe needs to be strict about key types + obj[key] = value + } + } + // @ts-ignore c'mon man + return useMaps ? m : obj +} /** - * @param {ByteView} data - * @returns {Uint8Array} + * @param {DecodeTokenizer} tokeniser + * @param {DecodeOptions} options + * @returns {any|BREAK|DONE} */ -const src_codecs_raw_decode = (data) => uint8arrays_node_modules_multiformats_src_bytes_coerce(data) +function tokensToObject (tokeniser, options) { + // should we support array as an argument? + // check for tokenIter[Symbol.iterator] and replace tokenIter with what that returns? + if (tokeniser.done()) { + return DONE + } -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/vendor/varint.js -var uint8arrays_node_modules_multiformats_vendor_varint_encode_1 = uint8arrays_node_modules_multiformats_vendor_varint_encode; + const token = tokeniser.next() -var uint8arrays_node_modules_multiformats_vendor_varint_MSB = 0x80 - , uint8arrays_node_modules_multiformats_vendor_varint_REST = 0x7F - , uint8arrays_node_modules_multiformats_vendor_varint_MSBALL = ~uint8arrays_node_modules_multiformats_vendor_varint_REST - , uint8arrays_node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31); + if (token.type === token_Type["break"]) { + return BREAK + } -function uint8arrays_node_modules_multiformats_vendor_varint_encode(num, out, offset) { - out = out || []; - offset = offset || 0; - var oldOffset = offset; + if (token.type.terminal) { + return token.value + } - while(num >= uint8arrays_node_modules_multiformats_vendor_varint_INT) { - out[offset++] = (num & 0xFF) | uint8arrays_node_modules_multiformats_vendor_varint_MSB; - num /= 128; + if (token.type === token_Type.array) { + return tokenToArray(token, tokeniser, options) } - while(num & uint8arrays_node_modules_multiformats_vendor_varint_MSBALL) { - out[offset++] = (num & 0xFF) | uint8arrays_node_modules_multiformats_vendor_varint_MSB; - num >>>= 7; + + if (token.type === token_Type.map) { + return tokenToMap(token, tokeniser, options) } - out[offset] = num | 0; - - uint8arrays_node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; - - return out + + if (token.type === token_Type.tag) { + if (options.tags && typeof options.tags[token.value] === 'function') { + const tagged = tokensToObject(tokeniser, options) + return options.tags[token.value](tagged) + } + throw new Error(`${decodeErrPrefix} tag not supported (${token.value})`) + } + /* c8 ignore next */ + throw new Error('unsupported') } -var uint8arrays_node_modules_multiformats_vendor_varint_decode = uint8arrays_node_modules_multiformats_vendor_varint_read; +/** + * @param {Uint8Array} data + * @param {DecodeOptions} [options] + * @returns {[any, Uint8Array]} + */ +function decodeFirst (data, options) { + if (!(data instanceof Uint8Array)) { + throw new Error(`${decodeErrPrefix} data to decode must be a Uint8Array`) + } + options = Object.assign({}, defaultDecodeOptions, options) + const tokeniser = options.tokenizer || new Tokeniser(data, options) + const decoded = tokensToObject(tokeniser, options) + if (decoded === DONE) { + throw new Error(`${decodeErrPrefix} did not find any content to decode`) + } + if (decoded === BREAK) { + throw new Error(`${decodeErrPrefix} got unexpected break`) + } + return [decoded, data.subarray(tokeniser.pos())] +} -var uint8arrays_node_modules_multiformats_vendor_varint_MSB$1 = 0x80 - , uint8arrays_node_modules_multiformats_vendor_varint_REST$1 = 0x7F; +/** + * @param {Uint8Array} data + * @param {DecodeOptions} [options] + * @returns {any} + */ +function decode_decode (data, options) { + const [decoded, remainder] = decodeFirst(data, options) + if (remainder.length > 0) { + throw new Error(`${decodeErrPrefix} too many terminals, data makes no sense`) + } + return decoded +} -function uint8arrays_node_modules_multiformats_vendor_varint_read(buf, offset) { - var res = 0 - , offset = offset || 0 - , shift = 0 - , counter = offset - , b - , l = buf.length; - do { - if (counter >= l) { - uint8arrays_node_modules_multiformats_vendor_varint_read.bytes = 0; - throw new RangeError('Could not decode varint') - } - b = buf[counter++]; - res += shift < 28 - ? (b & uint8arrays_node_modules_multiformats_vendor_varint_REST$1) << shift - : (b & uint8arrays_node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift); - shift += 7; - } while (b >= uint8arrays_node_modules_multiformats_vendor_varint_MSB$1) - uint8arrays_node_modules_multiformats_vendor_varint_read.bytes = counter - offset; +;// CONCATENATED MODULE: ./node_modules/cborg/cborg.js - return res -} -var uint8arrays_node_modules_multiformats_vendor_varint_N1 = Math.pow(2, 7); -var uint8arrays_node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14); -var uint8arrays_node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21); -var uint8arrays_node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28); -var uint8arrays_node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35); -var uint8arrays_node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42); -var uint8arrays_node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49); -var uint8arrays_node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56); -var uint8arrays_node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63); -var uint8arrays_node_modules_multiformats_vendor_varint_length = function (value) { - return ( - value < uint8arrays_node_modules_multiformats_vendor_varint_N1 ? 1 - : value < uint8arrays_node_modules_multiformats_vendor_varint_N2 ? 2 - : value < uint8arrays_node_modules_multiformats_vendor_varint_N3 ? 3 - : value < uint8arrays_node_modules_multiformats_vendor_varint_N4 ? 4 - : value < uint8arrays_node_modules_multiformats_vendor_varint_N5 ? 5 - : value < uint8arrays_node_modules_multiformats_vendor_varint_N6 ? 6 - : value < uint8arrays_node_modules_multiformats_vendor_varint_N7 ? 7 - : value < uint8arrays_node_modules_multiformats_vendor_varint_N8 ? 8 - : value < uint8arrays_node_modules_multiformats_vendor_varint_N9 ? 9 - : 10 - ) -}; -var uint8arrays_node_modules_multiformats_vendor_varint_varint = { - encode: uint8arrays_node_modules_multiformats_vendor_varint_encode_1 - , decode: uint8arrays_node_modules_multiformats_vendor_varint_decode - , encodingLength: uint8arrays_node_modules_multiformats_vendor_varint_length -}; +/** + * Export the types that were present in the original manual cborg.d.ts + * @typedef {import('./interface').TagDecoder} TagDecoder + * There was originally just `TypeEncoder` so don't break types by renaming or not exporting + * @typedef {import('./interface').OptionalTypeEncoder} TypeEncoder + * @typedef {import('./interface').DecodeOptions} DecodeOptions + * @typedef {import('./interface').EncodeOptions} EncodeOptions + */ -var uint8arrays_node_modules_multiformats_vendor_varint_brrp_varint = uint8arrays_node_modules_multiformats_vendor_varint_varint; -/* harmony default export */ const uint8arrays_node_modules_multiformats_vendor_varint = (uint8arrays_node_modules_multiformats_vendor_varint_brrp_varint); -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/varint.js +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/node_modules/multiformats/dist/src/bytes.js +const bytes_empty = new Uint8Array(0); +function bytes_toHex(d) { + return d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), ''); +} +function bytes_fromHex(hex) { + const hexes = hex.match(/../g); + return hexes != null ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : bytes_empty; +} +function bytes_equals(aa, bb) { + if (aa === bb) + return true; + if (aa.byteLength !== bb.byteLength) { + return false; + } + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false; + } + } + return true; +} +function src_bytes_coerce(o) { + if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') + return o; + if (o instanceof ArrayBuffer) + return new Uint8Array(o); + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength); + } + throw new Error('Unknown type, must be binary type'); +} +function bytes_isBinary(o) { + return o instanceof ArrayBuffer || ArrayBuffer.isView(o); +} +function bytes_fromString(str) { + return new TextEncoder().encode(str); +} +function src_bytes_toString(b) { + return new TextDecoder().decode(b); +} +//# sourceMappingURL=bytes.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/node_modules/multiformats/dist/src/vendor/base-x.js +/* eslint-disable */ +// base-x encoding / decoding +// Copyright (c) 2018 base-x contributors +// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) +// Distributed under the MIT software license, see the accompanying +// file LICENSE or http://www.opensource.org/licenses/mit-license.php. +/** + * @param {string} ALPHABET + * @param {any} name + */ +function base_x_base(ALPHABET, name) { + if (ALPHABET.length >= 255) { + throw new TypeError('Alphabet too long'); + } + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; + } + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { + throw new TypeError(x + ' is ambiguous'); + } + BASE_MAP[xc] = i; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up + var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up + /** + * @param {any[] | Iterable} source + */ + function encode(source) { + // @ts-ignore + if (source instanceof Uint8Array) + ; + else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } + else if (Array.isArray(source)) { + source = Uint8Array.from(source); + } + if (!(source instanceof Uint8Array)) { + throw new TypeError('Expected Uint8Array'); + } + if (source.length === 0) { + return ''; + } + // Skip & count leading zeroes. + var zeroes = 0; + var length = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } + // Allocate enough space in big-endian base58 representation. + var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; + var b58 = new Uint8Array(size); + // Process the bytes. + while (pbegin !== pend) { + var carry = source[pbegin]; + // Apply "b58 = b58 * 256 + ch". + var i = 0; + for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { + carry += (256 * b58[it1]) >>> 0; + b58[it1] = (carry % BASE) >>> 0; + carry = (carry / BASE) >>> 0; + } + if (carry !== 0) { + throw new Error('Non-zero carry'); + } + length = i; + pbegin++; + } + // Skip leading zeroes in base58 result. + var it2 = size - length; + while (it2 !== size && b58[it2] === 0) { + it2++; + } + // Translate the result into a string. + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { + str += ALPHABET.charAt(b58[it2]); + } + return str; + } + /** + * @param {string | string[]} source + */ + function decodeUnsafe(source) { + if (typeof source !== 'string') { + throw new TypeError('Expected String'); + } + if (source.length === 0) { + return new Uint8Array(); + } + var psz = 0; + // Skip leading spaces. + if (source[psz] === ' ') { + return; + } + // Skip and count leading '1's. + var zeroes = 0; + var length = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; + } + // Allocate enough space in big-endian base256 representation. + var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. + var b256 = new Uint8Array(size); + // Process the characters. + while (source[psz]) { + // Decode character + var carry = BASE_MAP[source.charCodeAt(psz)]; + // Invalid character + if (carry === 255) { + return; + } + var i = 0; + for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { + carry += (BASE * b256[it3]) >>> 0; + b256[it3] = (carry % 256) >>> 0; + carry = (carry / 256) >>> 0; + } + if (carry !== 0) { + throw new Error('Non-zero carry'); + } + length = i; + psz++; + } + // Skip trailing spaces. + if (source[psz] === ' ') { + return; + } + // Skip leading zeroes in b256. + var it4 = size - length; + while (it4 !== size && b256[it4] === 0) { + it4++; + } + var vch = new Uint8Array(zeroes + (size - it4)); + var j = zeroes; + while (it4 !== size) { + vch[j++] = b256[it4++]; + } + return vch; + } + /** + * @param {string | string[]} string + */ + function decode(string) { + var buffer = decodeUnsafe(string); + if (buffer) { + return buffer; + } + throw new Error(`Non-${name} character`); + } + return { + encode: encode, + decodeUnsafe: decodeUnsafe, + decode: decode + }; +} +var base_x_src = base_x_base; +var base_x_brrp_multiformats_scope_baseX = base_x_src; +/* harmony default export */ const vendor_base_x = (base_x_brrp_multiformats_scope_baseX); +//# sourceMappingURL=base-x.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/node_modules/multiformats/dist/src/bases/base.js /** - * @param {Uint8Array} data - * @param {number} [offset=0] - * @returns {[number, number]} + * Class represents both BaseEncoder and MultibaseEncoder meaning it + * can be used to encode to multibase or base encode without multibase + * prefix. */ -const uint8arrays_node_modules_multiformats_src_varint_decode = (data, offset = 0) => { - const code = varint.decode(data, offset) - return [code, varint.decode.bytes] +class base_Encoder { + name; + prefix; + baseEncode; + constructor(name, prefix, baseEncode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + } + encode(bytes) { + if (bytes instanceof Uint8Array) { + return `${this.prefix}${this.baseEncode(bytes)}`; + } + else { + throw Error('Unknown type, must be binary type'); + } + } +} +/** + * Class represents both BaseDecoder and MultibaseDecoder so it could be used + * to decode multibases (with matching prefix) or just base decode strings + * with corresponding base encoding. + */ +class base_Decoder { + name; + prefix; + baseDecode; + prefixCodePoint; + constructor(name, prefix, baseDecode) { + this.name = name; + this.prefix = prefix; + /* c8 ignore next 3 */ + if (prefix.codePointAt(0) === undefined) { + throw new Error('Invalid prefix character'); + } + this.prefixCodePoint = prefix.codePointAt(0); + this.baseDecode = baseDecode; + } + decode(text) { + if (typeof text === 'string') { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); + } + return this.baseDecode(text.slice(this.prefix.length)); + } + else { + throw Error('Can only multibase decode strings'); + } + } + or(decoder) { + return base_or(this, decoder); + } +} +class base_ComposedDecoder { + decoders; + constructor(decoders) { + this.decoders = decoders; + } + or(decoder) { + return base_or(this, decoder); + } + decode(input) { + const prefix = input[0]; + const decoder = this.decoders[prefix]; + if (decoder != null) { + return decoder.decode(input); + } + else { + throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); + } + } +} +function base_or(left, right) { + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + return new base_ComposedDecoder({ + ...(left.decoders ?? { [left.prefix]: left }), + ...(right.decoders ?? { [right.prefix]: right }) + }); +} +class base_Codec { + name; + prefix; + baseEncode; + baseDecode; + encoder; + decoder; + constructor(name, prefix, baseEncode, baseDecode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + this.baseDecode = baseDecode; + this.encoder = new base_Encoder(name, prefix, baseEncode); + this.decoder = new base_Decoder(name, prefix, baseDecode); + } + encode(input) { + return this.encoder.encode(input); + } + decode(input) { + return this.decoder.decode(input); + } +} +function base_from({ name, prefix, encode, decode }) { + return new base_Codec(name, prefix, encode, decode); +} +function base_baseX({ name, prefix, alphabet }) { + const { encode, decode } = vendor_base_x(alphabet, name); + return base_from({ + prefix, + name, + encode, + decode: (text) => src_bytes_coerce(decode(text)) + }); +} +function base_decode(string, alphabet, bitsPerChar, name) { + // Build the character lookup table: + const codes = {}; + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i; + } + // Count the padding bytes: + let end = string.length; + while (string[end - 1] === '=') { + --end; + } + // Allocate the output: + const out = new Uint8Array((end * bitsPerChar / 8) | 0); + // Parse the data: + let bits = 0; // Number of bits currently in the buffer + let buffer = 0; // Bits waiting to be written out, MSB first + let written = 0; // Next byte to write + for (let i = 0; i < end; ++i) { + // Read one character from the string: + const value = codes[string[i]]; + if (value === undefined) { + throw new SyntaxError(`Non-${name} character`); + } + // Append the bits to the buffer: + buffer = (buffer << bitsPerChar) | value; + bits += bitsPerChar; + // Write out some bits if the buffer has a byte's worth: + if (bits >= 8) { + bits -= 8; + out[written++] = 0xff & (buffer >> bits); + } + } + // Verify that we have received just enough bits: + if (bits >= bitsPerChar || (0xff & (buffer << (8 - bits))) !== 0) { + throw new SyntaxError('Unexpected end of data'); + } + return out; +} +function base_encode(data, alphabet, bitsPerChar) { + const pad = alphabet[alphabet.length - 1] === '='; + const mask = (1 << bitsPerChar) - 1; + let out = ''; + let bits = 0; // Number of bits currently in the buffer + let buffer = 0; // Bits waiting to be written out, MSB first + for (let i = 0; i < data.length; ++i) { + // Slurp data into the buffer: + buffer = (buffer << 8) | data[i]; + bits += 8; + // Write out as much as we can: + while (bits > bitsPerChar) { + bits -= bitsPerChar; + out += alphabet[mask & (buffer >> bits)]; + } + } + // Partial character: + if (bits !== 0) { + out += alphabet[mask & (buffer << (bitsPerChar - bits))]; + } + // Add padding characters until we hit a byte boundary: + if (pad) { + while (((out.length * bitsPerChar) & 7) !== 0) { + out += '='; + } + } + return out; +} +/** + * RFC4648 Factory + */ +function base_rfc4648({ name, prefix, bitsPerChar, alphabet }) { + return base_from({ + prefix, + name, + encode(input) { + return base_encode(input, alphabet, bitsPerChar); + }, + decode(input) { + return base_decode(input, alphabet, bitsPerChar, name); + } + }); } +//# sourceMappingURL=base.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/node_modules/multiformats/dist/src/bases/base32.js + +const bases_base32_base32 = base_rfc4648({ + prefix: 'b', + name: 'base32', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567', + bitsPerChar: 5 +}); +const bases_base32_base32upper = base_rfc4648({ + prefix: 'B', + name: 'base32upper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', + bitsPerChar: 5 +}); +const base32_base32pad = base_rfc4648({ + prefix: 'c', + name: 'base32pad', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', + bitsPerChar: 5 +}); +const base32_base32padupper = base_rfc4648({ + prefix: 'C', + name: 'base32padupper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', + bitsPerChar: 5 +}); +const base32_base32hex = base_rfc4648({ + prefix: 'v', + name: 'base32hex', + alphabet: '0123456789abcdefghijklmnopqrstuv', + bitsPerChar: 5 +}); +const base32_base32hexupper = base_rfc4648({ + prefix: 'V', + name: 'base32hexupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', + bitsPerChar: 5 +}); +const base32_base32hexpad = base_rfc4648({ + prefix: 't', + name: 'base32hexpad', + alphabet: '0123456789abcdefghijklmnopqrstuv=', + bitsPerChar: 5 +}); +const base32_base32hexpadupper = base_rfc4648({ + prefix: 'T', + name: 'base32hexpadupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', + bitsPerChar: 5 +}); +const base32_base32z = base_rfc4648({ + prefix: 'h', + name: 'base32z', + alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', + bitsPerChar: 5 +}); +//# sourceMappingURL=base32.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/node_modules/multiformats/dist/src/bases/base58.js +const bases_base58_base58btc = base_baseX({ + name: 'base58btc', + prefix: 'z', + alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +}); +const base58_base58flickr = base_baseX({ + name: 'base58flickr', + prefix: 'Z', + alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' +}); +//# sourceMappingURL=base58.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/node_modules/multiformats/dist/src/vendor/varint.js +/* eslint-disable */ +var varint_encode_1 = vendor_varint_encode; +var varint_MSB = 0x80, varint_REST = 0x7F, varint_MSBALL = ~varint_REST, varint_INT = Math.pow(2, 31); /** - * @param {number} int - * @param {Uint8Array} target - * @param {number} [offset=0] + * @param {number} num + * @param {number[]} out + * @param {number} offset */ -const uint8arrays_node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => { - uint8arrays_node_modules_multiformats_vendor_varint.encode(int, target, offset) - return target +function vendor_varint_encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; + while (num >= varint_INT) { + out[offset++] = (num & 0xFF) | varint_MSB; + num /= 128; + } + while (num & varint_MSBALL) { + out[offset++] = (num & 0xFF) | varint_MSB; + num >>>= 7; + } + out[offset] = num | 0; + // @ts-ignore + vendor_varint_encode.bytes = offset - oldOffset + 1; + return out; } - +var vendor_varint_decode = varint_read; +var varint_MSB$1 = 0x80, varint_REST$1 = 0x7F; /** - * @param {number} int - * @returns {number} + * @param {string | any[]} buf + * @param {number} offset */ -const uint8arrays_node_modules_multiformats_src_varint_encodingLength = (int) => { - return uint8arrays_node_modules_multiformats_vendor_varint.encodingLength(int) +function varint_read(buf, offset) { + var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length; + do { + if (counter >= l) { + // @ts-ignore + varint_read.bytes = 0; + throw new RangeError('Could not decode varint'); + } + b = buf[counter++]; + res += shift < 28 + ? (b & varint_REST$1) << shift + : (b & varint_REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= varint_MSB$1); + // @ts-ignore + varint_read.bytes = counter - offset; + return res; } +var varint_N1 = Math.pow(2, 7); +var varint_N2 = Math.pow(2, 14); +var varint_N3 = Math.pow(2, 21); +var varint_N4 = Math.pow(2, 28); +var varint_N5 = Math.pow(2, 35); +var varint_N6 = Math.pow(2, 42); +var varint_N7 = Math.pow(2, 49); +var varint_N8 = Math.pow(2, 56); +var varint_N9 = Math.pow(2, 63); +var vendor_varint_length = function (/** @type {number} */ value) { + return (value < varint_N1 ? 1 + : value < varint_N2 ? 2 + : value < varint_N3 ? 3 + : value < varint_N4 ? 4 + : value < varint_N5 ? 5 + : value < varint_N6 ? 6 + : value < varint_N7 ? 7 + : value < varint_N8 ? 8 + : value < varint_N9 ? 9 + : 10); +}; +var vendor_varint_varint = { + encode: varint_encode_1, + decode: vendor_varint_decode, + encodingLength: vendor_varint_length +}; +var varint_brrp_varint = vendor_varint_varint; +/* harmony default export */ const src_vendor_varint = (varint_brrp_varint); +//# sourceMappingURL=varint.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/node_modules/multiformats/dist/src/varint.js -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/hashes/digest.js - +function dist_src_varint_decode(data, offset = 0) { + const code = src_vendor_varint.decode(data, offset); + return [code, src_vendor_varint.decode.bytes]; +} +function varint_encodeTo(int, target, offset = 0) { + src_vendor_varint.encode(int, target, offset); + return target; +} +function varint_encodingLength(int) { + return src_vendor_varint.encodingLength(int); +} +//# sourceMappingURL=varint.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/node_modules/multiformats/dist/src/hashes/digest.js /** * Creates a multihash digest. - * - * @template {number} Code - * @param {Code} code - * @param {Uint8Array} digest */ -const uint8arrays_node_modules_multiformats_src_hashes_digest_create = (code, digest) => { - const size = digest.byteLength - const sizeOffset = uint8arrays_node_modules_multiformats_src_varint_encodingLength(code) - const digestOffset = sizeOffset + uint8arrays_node_modules_multiformats_src_varint_encodingLength(size) - - const bytes = new Uint8Array(digestOffset + size) - uint8arrays_node_modules_multiformats_src_varint_encodeTo(code, bytes, 0) - uint8arrays_node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset) - bytes.set(digest, digestOffset) - - return new uint8arrays_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) +function hashes_digest_create(code, digest) { + const size = digest.byteLength; + const sizeOffset = varint_encodingLength(code); + const digestOffset = sizeOffset + varint_encodingLength(size); + const bytes = new Uint8Array(digestOffset + size); + varint_encodeTo(code, bytes, 0); + varint_encodeTo(size, bytes, sizeOffset); + bytes.set(digest, digestOffset); + return new hashes_digest_Digest(code, size, digest, bytes); } - /** * Turns bytes representation of multihash digest into an instance. - * - * @param {Uint8Array} multihash - * @returns {MultihashDigest} */ -const uint8arrays_node_modules_multiformats_src_hashes_digest_decode = (multihash) => { - const bytes = coerce(multihash) - const [code, sizeOffset] = varint.decode(bytes) - const [size, digestOffset] = varint.decode(bytes.subarray(sizeOffset)) - const digest = bytes.subarray(sizeOffset + digestOffset) - - if (digest.byteLength !== size) { - throw new Error('Incorrect length') - } - - return new uint8arrays_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) +function hashes_digest_decode(multihash) { + const bytes = src_bytes_coerce(multihash); + const [code, sizeOffset] = dist_src_varint_decode(bytes); + const [size, digestOffset] = dist_src_varint_decode(bytes.subarray(sizeOffset)); + const digest = bytes.subarray(sizeOffset + digestOffset); + if (digest.byteLength !== size) { + throw new Error('Incorrect length'); + } + return new hashes_digest_Digest(code, size, digest, bytes); } - -/** - * @param {MultihashDigest} a - * @param {unknown} b - * @returns {b is MultihashDigest} - */ -const uint8arrays_node_modules_multiformats_src_hashes_digest_equals = (a, b) => { - if (a === b) { - return true - } else { - const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) - - return ( - a.code === data.code && - a.size === data.size && - data.bytes instanceof Uint8Array && - equalBytes(a.bytes, data.bytes) - ) - } +function hashes_digest_equals(a, b) { + if (a === b) { + return true; + } + else { + const data = b; + return (a.code === data.code && + a.size === data.size && + data.bytes instanceof Uint8Array && + bytes_equals(a.bytes, data.bytes)); + } } - -/** - * @typedef {import('./interface.js').MultihashDigest} MultihashDigest - */ - /** * Represents a multihash digest which carries information about the * hashing algorithm and an actual hash digest. - * - * @template {number} Code - * @template {number} Size - * @class - * @implements {MultihashDigest} - */ -class uint8arrays_node_modules_multiformats_src_hashes_digest_Digest { - /** - * Creates a multihash digest. - * - * @param {Code} code - * @param {Size} size - * @param {Uint8Array} digest - * @param {Uint8Array} bytes - */ - constructor (code, size, digest, bytes) { - this.code = code - this.size = size - this.digest = digest - this.bytes = bytes - } -} - -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/hashes/identity.js - - - -const src_hashes_identity_code = 0x0 -const src_hashes_identity_name = 'identity' - -/** @type {(input:Uint8Array) => Uint8Array} */ -const src_hashes_identity_encode = uint8arrays_node_modules_multiformats_src_bytes_coerce - -/** - * @param {Uint8Array} input - * @returns {Digest.Digest} - */ -const hashes_identity_digest = (input) => uint8arrays_node_modules_multiformats_src_hashes_digest_create(src_hashes_identity_code, src_hashes_identity_encode(input)) - -const src_hashes_identity_identity = { code: src_hashes_identity_code, name: src_hashes_identity_name, encode: src_hashes_identity_encode, digest: hashes_identity_digest } - -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/hashes/hasher.js - - -/** - * @template {string} Name - * @template {number} Code - * @param {object} options - * @param {Name} options.name - * @param {Code} options.code - * @param {(input: Uint8Array) => Await} options.encode - */ -const multiformats_src_hashes_hasher_from = ({ name, code, encode }) => new src_hashes_hasher_Hasher(name, code, encode) - -/** - * Hasher represents a hashing algorithm implementation that produces as - * `MultihashDigest`. - * - * @template {string} Name - * @template {number} Code - * @class - * @implements {MultihashHasher} */ -class src_hashes_hasher_Hasher { - /** - * - * @param {Name} name - * @param {Code} code - * @param {(input: Uint8Array) => Await} encode - */ - constructor (name, code, encode) { - this.name = name - this.code = code - this.encode = encode - } - - /** - * @param {Uint8Array} input - * @returns {Await>} - */ - digest (input) { - if (input instanceof Uint8Array) { - const result = this.encode(input) - return result instanceof Uint8Array - ? uint8arrays_node_modules_multiformats_src_hashes_digest_create(this.code, result) - /* c8 ignore next 1 */ - : result.then(digest => uint8arrays_node_modules_multiformats_src_hashes_digest_create(this.code, digest)) - } else { - throw Error('Unknown type, must be binary type') - /* c8 ignore next 1 */ +class hashes_digest_Digest { + code; + size; + digest; + bytes; + /** + * Creates a multihash digest. + */ + constructor(code, size, digest, bytes) { + this.code = code; + this.size = size; + this.digest = digest; + this.bytes = bytes; } - } } - -/** - * @template {number} Alg - * @typedef {import('./interface.js').MultihashHasher} MultihashHasher - */ - -/** - * @template T - * @typedef {Promise|T} Await - */ - -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/hashes/sha2.js -// @ts-check - - - - - -const src_hashes_sha2_sha256 = multiformats_src_hashes_hasher_from({ - name: 'sha2-256', - code: 0x12, - encode: (input) => uint8arrays_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha256').update(input).digest()) -}) - -const hashes_sha2_sha512 = multiformats_src_hashes_hasher_from({ - name: 'sha2-512', - code: 0x13, - encode: input => uint8arrays_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha512').update(input).digest()) -}) - -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/cid.js - - +//# sourceMappingURL=digest.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/node_modules/multiformats/dist/src/cid.js -// Linter can see that API is used in types. -// eslint-disable-next-line // This way TS will also expose all the types from module - -/** - * @template {API.Link} T - * @template {string} Prefix - * @param {T} link - * @param {API.MultibaseEncoder} [base] - * @returns {API.ToString} - */ -const uint8arrays_node_modules_multiformats_src_cid_format = (link, base) => { - const { bytes, version } = link - switch (version) { - case 0: - return uint8arrays_node_modules_multiformats_src_cid_toStringV0( - bytes, - uint8arrays_node_modules_multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder<"z">} */ (base) || base58btc.encoder - ) - default: - return uint8arrays_node_modules_multiformats_src_cid_toStringV1( - bytes, - uint8arrays_node_modules_multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder} */ (base || base32.encoder) - ) - } +function cid_format(link, base) { + const { bytes, version } = link; + switch (version) { + case 0: + return cid_toStringV0(bytes, cid_baseCache(link), base ?? bases_base58_base58btc.encoder); + default: + return cid_toStringV1(bytes, cid_baseCache(link), (base ?? bases_base32_base32.encoder)); + } } - -/** - * @template {API.UnknownLink} Link - * @param {Link} link - * @returns {API.LinkJSON} - */ -const uint8arrays_node_modules_multiformats_src_cid_toJSON = (link) => ({ - '/': uint8arrays_node_modules_multiformats_src_cid_format(link) -}) - -/** - * @template {API.UnknownLink} Link - * @param {API.LinkJSON} json - */ -const uint8arrays_node_modules_multiformats_src_cid_fromJSON = (json) => - uint8arrays_node_modules_multiformats_src_cid_CID.parse(json['/']) - -/** @type {WeakMap>} */ -const uint8arrays_node_modules_multiformats_src_cid_cache = new WeakMap() - -/** - * @param {API.UnknownLink} cid - * @returns {Map} - */ -const uint8arrays_node_modules_multiformats_src_cid_baseCache = cid => { - const baseCache = uint8arrays_node_modules_multiformats_src_cid_cache.get(cid) - if (baseCache == null) { - const baseCache = new Map() - uint8arrays_node_modules_multiformats_src_cid_cache.set(cid, baseCache) - return baseCache - } - return baseCache +function cid_toJSON(link) { + return { + '/': cid_format(link) + }; } - -/** - * @template {unknown} [Data=unknown] - * @template {number} [Format=number] - * @template {number} [Alg=number] - * @template {API.Version} [Version=API.Version] - * @implements {API.Link} - */ - -class uint8arrays_node_modules_multiformats_src_cid_CID { - /** - * @param {Version} version - Version of the CID - * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content. - * @param {Uint8Array} bytes - */ - constructor (version, code, multihash, bytes) { - /** @readonly */ - this.code = code - /** @readonly */ - this.version = version - /** @readonly */ - this.multihash = multihash - /** @readonly */ - this.bytes = bytes - - // flag to serializers that this is a CID and - // should be treated specially - /** @readonly */ - this['/'] = bytes - } - - /** - * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` - * please either use `CID.asCID(cid)` or switch to new signalling mechanism - * - * @deprecated - */ - get asCID () { - return this - } - - // ArrayBufferView - get byteOffset () { - return this.bytes.byteOffset - } - - // ArrayBufferView - get byteLength () { - return this.bytes.byteLength - } - - /** - * @returns {CID} - */ - toV0 () { - switch (this.version) { - case 0: { - return /** @type {CID} */ (this) - } - case 1: { - const { code, multihash } = this - - if (code !== uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE) { - throw new Error('Cannot convert a non dag-pb CID to CIDv0') +function cid_fromJSON(json) { + return src_cid_CID.parse(json['/']); +} +const cid_cache = new WeakMap(); +function cid_baseCache(cid) { + const baseCache = cid_cache.get(cid); + if (baseCache == null) { + const baseCache = new Map(); + cid_cache.set(cid, baseCache); + return baseCache; + } + return baseCache; +} +class src_cid_CID { + code; + version; + multihash; + bytes; + '/'; + /** + * @param version - Version of the CID + * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param multihash - (Multi)hash of the of the content. + */ + constructor(version, code, multihash, bytes) { + this.code = code; + this.version = version; + this.multihash = multihash; + this.bytes = bytes; + // flag to serializers that this is a CID and + // should be treated specially + this['/'] = bytes; + } + /** + * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` + * please either use `CID.asCID(cid)` or switch to new signalling mechanism + * + * @deprecated + */ + get asCID() { + return this; + } + // ArrayBufferView + get byteOffset() { + return this.bytes.byteOffset; + } + // ArrayBufferView + get byteLength() { + return this.bytes.byteLength; + } + toV0() { + switch (this.version) { + case 0: { + return this; + } + case 1: { + const { code, multihash } = this; + if (code !== cid_DAG_PB_CODE) { + throw new Error('Cannot convert a non dag-pb CID to CIDv0'); + } + // sha2-256 + if (multihash.code !== cid_SHA_256_CODE) { + throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0'); + } + return (src_cid_CID.createV0(multihash)); + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`); + } } - - // sha2-256 - if (multihash.code !== uint8arrays_node_modules_multiformats_src_cid_SHA_256_CODE) { - throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') + } + toV1() { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash; + const multihash = hashes_digest_create(code, digest); + return (src_cid_CID.createV1(this.code, multihash)); + } + case 1: { + return this; + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`); + } } - - return /** @type {CID} */ ( - uint8arrays_node_modules_multiformats_src_cid_CID.createV0( - /** @type {API.MultihashDigest} */ (multihash) - ) - ) - } - default: { - throw Error( - `Can not convert CID version ${this.version} to version 0. This is a bug please report` - ) - } } - } - - /** - * @returns {CID} - */ - toV1 () { - switch (this.version) { - case 0: { - const { code, digest } = this.multihash - const multihash = Digest.create(code, digest) - return /** @type {CID} */ ( - uint8arrays_node_modules_multiformats_src_cid_CID.createV1(this.code, multihash) - ) - } - case 1: { - return /** @type {CID} */ (this) - } - default: { - throw Error( - `Can not convert CID version ${this.version} to version 1. This is a bug please report` - ) - } + equals(other) { + return src_cid_CID.equals(this, other); } - } - - /** - * @param {unknown} other - * @returns {other is CID} - */ - equals (other) { - return uint8arrays_node_modules_multiformats_src_cid_CID.equals(this, other) - } - - /** - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @param {API.Link} self - * @param {unknown} other - * @returns {other is CID} - */ - static equals (self, other) { - const unknown = - /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ ( - other - ) - return ( - unknown && - self.code === unknown.code && - self.version === unknown.version && - Digest.equals(self.multihash, unknown.multihash) - ) - } - - /** - * @param {API.MultibaseEncoder} [base] - * @returns {string} - */ - toString (base) { - return uint8arrays_node_modules_multiformats_src_cid_format(this, base) - } - - /** - * @returns {API.LinkJSON} - */ - toJSON () { - return { '/': uint8arrays_node_modules_multiformats_src_cid_format(this) } - } - - link () { - return this - } - - get [Symbol.toStringTag] () { - return 'CID' - } - - // Legacy - - [Symbol.for('nodejs.util.inspect.custom')] () { - return `CID(${this.toString()})` - } - - /** - * Takes any input `value` and returns a `CID` instance if it was - * a `CID` otherwise returns `null`. If `value` is instanceof `CID` - * it will return value back. If `value` is not instance of this CID - * class, but is compatible CID it will return new instance of this - * `CID` class. Otherwise returns null. - * - * This allows two different incompatible versions of CID library to - * co-exist and interop as long as binary interface is compatible. - * - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @template {unknown} U - * @param {API.Link|U} input - * @returns {CID|null} - */ - static asCID (input) { - if (input == null) { - return null + static equals(self, other) { + const unknown = other; + return (unknown != null && + self.code === unknown.code && + self.version === unknown.version && + hashes_digest_equals(self.multihash, unknown.multihash)); } - - const value = /** @type {any} */ (input) - if (value instanceof uint8arrays_node_modules_multiformats_src_cid_CID) { - // If value is instance of CID then we're all set. - return value - } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { - // If value isn't instance of this CID class but `this.asCID === this` or - // `value['/'] === value.bytes` is true it is CID instance coming from a - // different implementation (diff version or duplicate). In that case we - // rebase it to this `CID` implementation so caller is guaranteed to get - // instance with expected API. - const { version, code, multihash, bytes } = value - return new uint8arrays_node_modules_multiformats_src_cid_CID( - version, - code, - /** @type {API.MultihashDigest} */ (multihash), - bytes || uint8arrays_node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes) - ) - } else if (value[uint8arrays_node_modules_multiformats_src_cid_cidSymbol] === true) { - // If value is a CID from older implementation that used to be tagged via - // symbol we still rebase it to the this `CID` implementation by - // delegating that to a constructor. - const { version, multihash, code } = value - const digest = - /** @type {API.MultihashDigest} */ - (Digest.decode(multihash)) - return uint8arrays_node_modules_multiformats_src_cid_CID.create(version, code, digest) - } else { - // Otherwise value is not a CID (or an incompatible version of it) in - // which case we return `null`. - return null + toString(base) { + return cid_format(this, base); } - } - - /** - * - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @param {Version} version - Version of the CID - * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param {API.MultihashDigest} digest - (Multi)hash of the of the content. - * @returns {CID} - */ - static create (version, code, digest) { - if (typeof code !== 'number') { - throw new Error('String codecs are no longer supported') + toJSON() { + return { '/': cid_format(this) }; } - - if (!(digest.bytes instanceof Uint8Array)) { - throw new Error('Invalid digest') + link() { + return this; } - - switch (version) { - case 0: { - if (code !== uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE) { - throw new Error( - `Version 0 CID must use dag-pb (code: ${uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding` - ) - } else { - return new uint8arrays_node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes) + [Symbol.toStringTag] = 'CID'; + // Legacy + [Symbol.for('nodejs.util.inspect.custom')]() { + return `CID(${this.toString()})`; + } + /** + * Takes any input `value` and returns a `CID` instance if it was + * a `CID` otherwise returns `null`. If `value` is instanceof `CID` + * it will return value back. If `value` is not instance of this CID + * class, but is compatible CID it will return new instance of this + * `CID` class. Otherwise returns null. + * + * This allows two different incompatible versions of CID library to + * co-exist and interop as long as binary interface is compatible. + */ + static asCID(input) { + if (input == null) { + return null; + } + const value = input; + if (value instanceof src_cid_CID) { + // If value is instance of CID then we're all set. + return value; + } + else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { + // If value isn't instance of this CID class but `this.asCID === this` or + // `value['/'] === value.bytes` is true it is CID instance coming from a + // different implementation (diff version or duplicate). In that case we + // rebase it to this `CID` implementation so caller is guaranteed to get + // instance with expected API. + const { version, code, multihash, bytes } = value; + return new src_cid_CID(version, code, multihash, bytes ?? cid_encodeCID(version, code, multihash.bytes)); + } + else if (value[cid_cidSymbol] === true) { + // If value is a CID from older implementation that used to be tagged via + // symbol we still rebase it to the this `CID` implementation by + // delegating that to a constructor. + const { version, multihash, code } = value; + const digest = hashes_digest_decode(multihash); + return src_cid_CID.create(version, code, digest); + } + else { + // Otherwise value is not a CID (or an incompatible version of it) in + // which case we return `null`. + return null; } - } - case 1: { - const bytes = uint8arrays_node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes) - return new uint8arrays_node_modules_multiformats_src_cid_CID(version, code, digest, bytes) - } - default: { - throw new Error('Invalid version') - } } - } - - /** - * Simplified version of `create` for CIDv0. - * - * @template {unknown} [T=unknown] - * @param {API.MultihashDigest} digest - Multihash. - * @returns {CID} - */ - static createV0 (digest) { - return uint8arrays_node_modules_multiformats_src_cid_CID.create(0, uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE, digest) - } - - /** - * Simplified version of `create` for CIDv1. - * - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @param {Code} code - Content encoding format code. - * @param {API.MultihashDigest} digest - Miltihash of the content. - * @returns {CID} - */ - static createV1 (code, digest) { - return uint8arrays_node_modules_multiformats_src_cid_CID.create(1, code, digest) - } - - /** - * Decoded a CID from its binary representation. The byte array must contain - * only the CID with no additional bytes. - * - * An error will be thrown if the bytes provided do not contain a valid - * binary representation of a CID. - * - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ByteView>} bytes - * @returns {CID} - */ - static decode (bytes) { - const [cid, remainder] = uint8arrays_node_modules_multiformats_src_cid_CID.decodeFirst(bytes) - if (remainder.length) { - throw new Error('Incorrect length') + /** + * @param version - Version of the CID + * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param digest - (Multi)hash of the of the content. + */ + static create(version, code, digest) { + if (typeof code !== 'number') { + throw new Error('String codecs are no longer supported'); + } + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error('Invalid digest'); + } + switch (version) { + case 0: { + if (code !== cid_DAG_PB_CODE) { + throw new Error(`Version 0 CID must use dag-pb (code: ${cid_DAG_PB_CODE}) block encoding`); + } + else { + return new src_cid_CID(version, code, digest, digest.bytes); + } + } + case 1: { + const bytes = cid_encodeCID(version, code, digest.bytes); + return new src_cid_CID(version, code, digest, bytes); + } + default: { + throw new Error('Invalid version'); + } + } } - return cid - } - - /** - * Decoded a CID from its binary representation at the beginning of a byte - * array. - * - * Returns an array with the first element containing the CID and the second - * element containing the remainder of the original byte array. The remainder - * will be a zero-length byte array if the provided bytes only contained a - * binary CID representation. - * - * @template {unknown} T - * @template {number} C - * @template {number} A - * @template {API.Version} V - * @param {API.ByteView>} bytes - * @returns {[CID, Uint8Array]} - */ - static decodeFirst (bytes) { - const specs = uint8arrays_node_modules_multiformats_src_cid_CID.inspectBytes(bytes) - const prefixSize = specs.size - specs.multihashSize - const multihashBytes = coerce( - bytes.subarray(prefixSize, prefixSize + specs.multihashSize) - ) - if (multihashBytes.byteLength !== specs.multihashSize) { - throw new Error('Incorrect length') + /** + * Simplified version of `create` for CIDv0. + */ + static createV0(digest) { + return src_cid_CID.create(0, cid_DAG_PB_CODE, digest); + } + /** + * Simplified version of `create` for CIDv1. + * + * @param code - Content encoding format code. + * @param digest - Multihash of the content. + */ + static createV1(code, digest) { + return src_cid_CID.create(1, code, digest); + } + /** + * Decoded a CID from its binary representation. The byte array must contain + * only the CID with no additional bytes. + * + * An error will be thrown if the bytes provided do not contain a valid + * binary representation of a CID. + */ + static decode(bytes) { + const [cid, remainder] = src_cid_CID.decodeFirst(bytes); + if (remainder.length !== 0) { + throw new Error('Incorrect length'); + } + return cid; + } + /** + * Decoded a CID from its binary representation at the beginning of a byte + * array. + * + * Returns an array with the first element containing the CID and the second + * element containing the remainder of the original byte array. The remainder + * will be a zero-length byte array if the provided bytes only contained a + * binary CID representation. + */ + static decodeFirst(bytes) { + const specs = src_cid_CID.inspectBytes(bytes); + const prefixSize = specs.size - specs.multihashSize; + const multihashBytes = src_bytes_coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize)); + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error('Incorrect length'); + } + const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize); + const digest = new hashes_digest_Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); + const cid = specs.version === 0 + ? src_cid_CID.createV0(digest) + : src_cid_CID.createV1(specs.codec, digest); + return [cid, bytes.subarray(specs.size)]; + } + /** + * Inspect the initial bytes of a CID to determine its properties. + * + * Involves decoding up to 4 varints. Typically this will require only 4 to 6 + * bytes but for larger multicodec code values and larger multihash digest + * lengths these varints can be quite large. It is recommended that at least + * 10 bytes be made available in the `initialBytes` argument for a complete + * inspection. + */ + static inspectBytes(initialBytes) { + let offset = 0; + const next = () => { + const [i, length] = dist_src_varint_decode(initialBytes.subarray(offset)); + offset += length; + return i; + }; + let version = next(); + let codec = cid_DAG_PB_CODE; + if (version === 18) { + // CIDv0 + version = 0; + offset = 0; + } + else { + codec = next(); + } + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`); + } + const prefixSize = offset; + const multihashCode = next(); // multihash code + const digestSize = next(); // multihash length + const size = offset + digestSize; + const multihashSize = size - prefixSize; + return { version, codec, multihashCode, digestSize, multihashSize, size }; + } + /** + * Takes cid in a string representation and creates an instance. If `base` + * decoder is not provided will use a default from the configuration. It will + * throw an error if encoding of the CID is not compatible with supplied (or + * a default decoder). + */ + static parse(source, base) { + const [prefix, bytes] = cid_parseCIDtoBytes(source, base); + const cid = src_cid_CID.decode(bytes); + if (cid.version === 0 && source[0] !== 'Q') { + throw Error('Version 0 CID string must not include multibase prefix'); + } + // Cache string representation to avoid computing it on `this.toString()` + cid_baseCache(cid).set(prefix, source); + return cid; + } +} +function cid_parseCIDtoBytes(source, base) { + switch (source[0]) { + // CIDv0 is parsed differently + case 'Q': { + const decoder = base ?? bases_base58_base58btc; + return [ + bases_base58_base58btc.prefix, + decoder.decode(`${bases_base58_base58btc.prefix}${source}`) + ]; + } + case bases_base58_base58btc.prefix: { + const decoder = base ?? bases_base58_base58btc; + return [bases_base58_base58btc.prefix, decoder.decode(source)]; + } + case bases_base32_base32.prefix: { + const decoder = base ?? bases_base32_base32; + return [bases_base32_base32.prefix, decoder.decode(source)]; + } + default: { + if (base == null) { + throw Error('To parse non base32 or base58btc encoded CID multibase decoder must be provided'); + } + return [source[0], base.decode(source)]; + } + } +} +function cid_toStringV0(bytes, cache, base) { + const { prefix } = base; + if (prefix !== bases_base58_base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base.name} encoding`); + } + const cid = cache.get(prefix); + if (cid == null) { + const cid = base.encode(bytes).slice(1); + cache.set(prefix, cid); + return cid; } - const digestBytes = multihashBytes.subarray( - specs.multihashSize - specs.digestSize - ) - const digest = new Digest.Digest( - specs.multihashCode, - specs.digestSize, - digestBytes, - multihashBytes - ) - const cid = - specs.version === 0 - ? uint8arrays_node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) - : uint8arrays_node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest) - return [/** @type {CID} */(cid), bytes.subarray(specs.size)] - } - - /** - * Inspect the initial bytes of a CID to determine its properties. - * - * Involves decoding up to 4 varints. Typically this will require only 4 to 6 - * bytes but for larger multicodec code values and larger multihash digest - * lengths these varints can be quite large. It is recommended that at least - * 10 bytes be made available in the `initialBytes` argument for a complete - * inspection. - * - * @template {unknown} T - * @template {number} C - * @template {number} A - * @template {API.Version} V - * @param {API.ByteView>} initialBytes - * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }} - */ - static inspectBytes (initialBytes) { - let offset = 0 - const next = () => { - const [i, length] = varint.decode(initialBytes.subarray(offset)) - offset += length - return i + else { + return cid; } - - let version = /** @type {V} */ (next()) - let codec = /** @type {C} */ (uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE) - if (/** @type {number} */(version) === 18) { - // CIDv0 - version = /** @type {V} */ (0) - offset = 0 - } else { - codec = /** @type {C} */ (next()) +} +function cid_toStringV1(bytes, cache, base) { + const { prefix } = base; + const cid = cache.get(prefix); + if (cid == null) { + const cid = base.encode(bytes); + cache.set(prefix, cid); + return cid; } - - if (version !== 0 && version !== 1) { - throw new RangeError(`Invalid CID version ${version}`) + else { + return cid; } +} +const cid_DAG_PB_CODE = 0x70; +const cid_SHA_256_CODE = 0x12; +function cid_encodeCID(version, code, multihash) { + const codeOffset = varint_encodingLength(version); + const hashOffset = codeOffset + varint_encodingLength(code); + const bytes = new Uint8Array(hashOffset + multihash.byteLength); + varint_encodeTo(version, bytes, 0); + varint_encodeTo(code, bytes, codeOffset); + bytes.set(multihash, hashOffset); + return bytes; +} +const cid_cidSymbol = Symbol.for('@ipld/js-cid/CID'); +//# sourceMappingURL=cid.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-cbor/src/index.js - const prefixSize = offset - const multihashCode = /** @type {A} */ (next()) // multihash code - const digestSize = next() // multihash length - const size = offset + digestSize - const multihashSize = size - prefixSize - - return { version, codec, multihashCode, digestSize, multihashSize, size } - } - - /** - * Takes cid in a string representation and creates an instance. If `base` - * decoder is not provided will use a default from the configuration. It will - * throw an error if encoding of the CID is not compatible with supplied (or - * a default decoder). - * - * @template {string} Prefix - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ToString, Prefix>} source - * @param {API.MultibaseDecoder} [base] - * @returns {CID} - */ - static parse (source, base) { - const [prefix, bytes] = uint8arrays_node_modules_multiformats_src_cid_parseCIDtoBytes(source, base) - const cid = uint8arrays_node_modules_multiformats_src_cid_CID.decode(bytes) - if (cid.version === 0 && source[0] !== 'Q') { - throw Error('Version 0 CID string must not include multibase prefix') - } +// https://github.com/ipfs/go-ipfs/issues/3570#issuecomment-273931692 +const CID_CBOR_TAG = 42 - // Cache string representation to avoid computing it on `this.toString()` - uint8arrays_node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source) +/** + * @template T + * @typedef {import('multiformats/codecs/interface').ByteView} ByteView + */ - return cid +/** + * cidEncoder will receive all Objects during encode, it needs to filter out + * anything that's not a CID and return `null` for that so it's encoded as + * normal. + * + * @param {any} obj + * @returns {cborg.Token[]|null} + */ +function cidEncoder (obj) { + if (obj.asCID !== obj && obj['/'] !== obj.bytes) { + return null // any other kind of object + } + const cid = src_cid_CID.asCID(obj) + /* c8 ignore next 4 */ + // very unlikely case, and it'll probably throw a recursion error in cborg + if (!cid) { + return null } + const bytes = new Uint8Array(cid.bytes.byteLength + 1) + bytes.set(cid.bytes, 1) // prefix is 0x00, for historical reasons + return [ + new token_Token(token_Type.tag, CID_CBOR_TAG), + new token_Token(token_Type.bytes, bytes) + ] } +// eslint-disable-next-line jsdoc/require-returns-check /** - * @template {string} Prefix - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ToString, Prefix>} source - * @param {API.MultibaseDecoder} [base] - * @returns {[Prefix, API.ByteView>]} + * Intercept all `undefined` values from an object walk and reject the entire + * object if we find one. + * + * @returns {null} */ -const uint8arrays_node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => { - switch (source[0]) { - // CIDv0 is parsed differently - case 'Q': { - const decoder = base || base58btc - return [ - /** @type {Prefix} */ (base58btc.prefix), - decoder.decode(`${base58btc.prefix}${source}`) - ] - } - case base58btc.prefix: { - const decoder = base || base58btc - return [/** @type {Prefix} */(base58btc.prefix), decoder.decode(source)] - } - case base32.prefix: { - const decoder = base || base32 - return [/** @type {Prefix} */(base32.prefix), decoder.decode(source)] - } - default: { - if (base == null) { - throw Error( - 'To parse non base32 or base58btc encoded CID multibase decoder must be provided' - ) - } - return [/** @type {Prefix} */(source[0]), base.decode(source)] - } - } +function undefinedEncoder () { + throw new Error('`undefined` is not supported by the IPLD Data Model and cannot be encoded') } /** + * Intercept all `number` values from an object walk and reject the entire + * object if we find something that doesn't fit the IPLD data model (NaN & + * Infinity). * - * @param {Uint8Array} bytes - * @param {Map} cache - * @param {API.MultibaseEncoder<'z'>} base + * @param {number} num + * @returns {null} */ -const uint8arrays_node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => { - const { prefix } = base - if (prefix !== base58btc.prefix) { - throw Error(`Cannot string encode V0 in ${base.name} encoding`) +function numberEncoder (num) { + if (Number.isNaN(num)) { + throw new Error('`NaN` is not supported by the IPLD Data Model and cannot be encoded') } + if (num === Infinity || num === -Infinity) { + throw new Error('`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded') + } + return null +} - const cid = cache.get(prefix) - if (cid == null) { - const cid = base.encode(bytes).slice(1) - cache.set(prefix, cid) - return cid - } else { - return cid +const encodeOptions = { + float64: true, + typeEncoders: { + Object: cidEncoder, + undefined: undefinedEncoder, + number: numberEncoder } } /** - * @template {string} Prefix * @param {Uint8Array} bytes - * @param {Map} cache - * @param {API.MultibaseEncoder} base + * @returns {CID} */ -const uint8arrays_node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => { - const { prefix } = base - const cid = cache.get(prefix) - if (cid == null) { - const cid = base.encode(bytes) - cache.set(prefix, cid) - return cid - } else { - return cid +function cidDecoder (bytes) { + if (bytes[0] !== 0) { + throw new Error('Invalid CID for CBOR tag 42; expected leading 0x00') } + return src_cid_CID.decode(bytes.subarray(1)) // ignore leading 0x00 } -const uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70 -const uint8arrays_node_modules_multiformats_src_cid_SHA_256_CODE = 0x12 - -/** - * @param {API.Version} version - * @param {number} code - * @param {Uint8Array} multihash - * @returns {Uint8Array} - */ -const uint8arrays_node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => { - const codeOffset = varint.encodingLength(version) - const hashOffset = codeOffset + varint.encodingLength(code) - const bytes = new Uint8Array(hashOffset + multihash.byteLength) - varint.encodeTo(version, bytes, 0) - varint.encodeTo(code, bytes, codeOffset) - bytes.set(multihash, hashOffset) - return bytes +const decodeOptions = { + allowIndefinite: false, + coerceUndefinedToNull: true, + allowNaN: false, + allowInfinity: false, + allowBigInt: true, // this will lead to BigInt for ints outside of + // safe-integer range, which may surprise users + strict: true, + useMaps: false, + rejectDuplicateMapKeys: true, + /** @type {import('cborg').TagDecoder[]} */ + tags: [] } +decodeOptions.tags[CID_CBOR_TAG] = cidDecoder -const uint8arrays_node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') +const dag_cbor_src_name = 'dag-cbor' +const src_code = 0x71 -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/index.js +/** + * @template T + * @param {T} node + * @returns {ByteView} + */ +const dag_cbor_src_encode = (node) => encode_encode(node, encodeOptions) +/** + * @template T + * @param {ByteView} data + * @returns {T} + */ +const dag_cbor_src_decode = (data) => decode_decode(data, decodeOptions) +;// CONCATENATED MODULE: ./node_modules/cborg/lib/json/encode.js -// This way TS will also expose all the types from module +/** + * @typedef {import('../../interface').EncodeOptions} EncodeOptions + * @typedef {import('../token').Token} Token + * @typedef {import('../bl').Bl} Bl + */ +class JSONEncoder extends Array { + constructor () { + super() + /** @type {{type:Type,elements:number}[]} */ + this.inRecursive = [] + } + /** + * @param {Bl} buf + */ + prefix (buf) { + const recurs = this.inRecursive[this.inRecursive.length - 1] + if (recurs) { + if (recurs.type === token_Type.array) { + recurs.elements++ + if (recurs.elements !== 1) { // >first + buf.push([44]) // ',' + } + } + if (recurs.type === token_Type.map) { + recurs.elements++ + if (recurs.elements !== 1) { // >first + if (recurs.elements % 2 === 1) { // key + buf.push([44]) // ',' + } else { + buf.push([58]) // ':' + } + } + } + } + } -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/basics.js -// @ts-check + /** + * @param {Bl} buf + * @param {Token} token + */ + [token_Type.uint.major] (buf, token) { + this.prefix(buf) + const is = String(token.value) + const isa = [] + for (let i = 0; i < is.length; i++) { + isa[i] = is.charCodeAt(i) + } + buf.push(isa) + } + /** + * @param {Bl} buf + * @param {Token} token + */ + [token_Type.negint.major] (buf, token) { + // @ts-ignore hack + this[token_Type.uint.major](buf, token) + } + /** + * @param {Bl} _buf + * @param {Token} _token + */ + [token_Type.bytes.major] (_buf, _token) { + throw new Error(`${encodeErrPrefix} unsupported type: Uint8Array`) + } + /** + * @param {Bl} buf + * @param {Token} token + */ + [token_Type.string.major] (buf, token) { + this.prefix(buf) + // buf.push(34) // '"' + // encodeUtf8(token.value, byts) + // buf.push(34) // '"' + const byts = byte_utils_fromString(JSON.stringify(token.value)) + buf.push(byts.length > 32 ? asU8A(byts) : byts) + } + /** + * @param {Bl} buf + * @param {Token} _token + */ + [token_Type.array.major] (buf, _token) { + this.prefix(buf) + this.inRecursive.push({ type: token_Type.array, elements: 0 }) + buf.push([91]) // '[' + } + /** + * @param {Bl} buf + * @param {Token} _token + */ + [token_Type.map.major] (buf, _token) { + this.prefix(buf) + this.inRecursive.push({ type: token_Type.map, elements: 0 }) + buf.push([123]) // '{' + } + /** + * @param {Bl} _buf + * @param {Token} _token + */ + [token_Type.tag.major] (_buf, _token) {} + /** + * @param {Bl} buf + * @param {Token} token + */ + [token_Type.float.major] (buf, token) { + if (token.type.name === 'break') { + const recurs = this.inRecursive.pop() + if (recurs) { + if (recurs.type === token_Type.array) { + buf.push([93]) // ']' + } else if (recurs.type === token_Type.map) { + buf.push([125]) // '}' + /* c8 ignore next 3 */ + } else { + throw new Error('Unexpected recursive type; this should not happen!') + } + return + } + /* c8 ignore next 2 */ + throw new Error('Unexpected break; this should not happen!') + } + if (token.value === undefined) { + throw new Error(`${encodeErrPrefix} unsupported type: undefined`) + } + this.prefix(buf) + if (token.type.name === 'true') { + buf.push([116, 114, 117, 101]) // 'true' + return + } else if (token.type.name === 'false') { + buf.push([102, 97, 108, 115, 101]) // 'false' + return + } else if (token.type.name === 'null') { + buf.push([110, 117, 108, 108]) // 'null' + return + } + // number + const is = String(token.value) + const isa = [] + let dp = false + for (let i = 0; i < is.length; i++) { + isa[i] = is.charCodeAt(i) + if (!dp && (isa[i] === 46 || isa[i] === 101 || isa[i] === 69)) { // '[.eE]' + dp = true + } + } + if (!dp) { // need a decimal point for floats + isa.push(46) // '.' + isa.push(48) // '0' + } + buf.push(isa) + } +} +// The below code is mostly taken and modified from https://github.com/feross/buffer +// Licensed MIT. Copyright (c) Feross Aboukhadijeh +// function encodeUtf8 (string, byts) { +// let codePoint +// const length = string.length +// let leadSurrogate = null +// for (let i = 0; i < length; ++i) { +// codePoint = string.charCodeAt(i) +// // is surrogate component +// if (codePoint > 0xd7ff && codePoint < 0xe000) { +// // last char was a lead +// if (!leadSurrogate) { +// // no lead yet +// /* c8 ignore next 9 */ +// if (codePoint > 0xdbff) { +// // unexpected trail +// byts.push(0xef, 0xbf, 0xbd) +// continue +// } else if (i + 1 === length) { +// // unpaired lead +// byts.push(0xef, 0xbf, 0xbd) +// continue +// } +// // valid lead +// leadSurrogate = codePoint +// continue +// } +// // 2 leads in a row +// /* c8 ignore next 5 */ +// if (codePoint < 0xdc00) { +// byts.push(0xef, 0xbf, 0xbd) +// leadSurrogate = codePoint +// continue +// } +// // valid surrogate pair +// codePoint = (leadSurrogate - 0xd800 << 10 | codePoint - 0xdc00) + 0x10000 +// /* c8 ignore next 4 */ +// } else if (leadSurrogate) { +// // valid bmp char, but last char was a lead +// byts.push(0xef, 0xbf, 0xbd) +// } -const src_basics_bases = { ...multiformats_src_bases_identity_namespaceObject, ...src_bases_base2_namespaceObject, ...src_bases_base8_namespaceObject, ...src_bases_base10_namespaceObject, ...src_bases_base16_namespaceObject, ...uint8arrays_node_modules_multiformats_src_bases_base32_namespaceObject, ...src_bases_base36_namespaceObject, ...uint8arrays_node_modules_multiformats_src_bases_base58_namespaceObject, ...multiformats_src_bases_base64_namespaceObject, ...src_bases_base256emoji_namespaceObject } -const src_basics_hashes = { ...src_hashes_sha2_namespaceObject, ...src_hashes_identity_namespaceObject } -const src_basics_codecs = { raw: src_codecs_raw_namespaceObject, json: multiformats_src_codecs_json_namespaceObject } +// leadSurrogate = null +// // encode utf8 +// if (codePoint < 0x80) { +// // special JSON escapes +// switch (codePoint) { +// case 8: // '\b' +// byts.push(92, 98) // '\\b' +// continue +// case 9: // '\t' +// byts.push(92, 116) // '\\t' +// continue +// case 10: // '\n' +// byts.push(92, 110) // '\\n' +// continue +// case 12: // '\f' +// byts.push(92, 102) // '\\f' +// continue +// case 13: // '\r' +// byts.push(92, 114) // '\\r' +// continue +// case 34: // '"' +// byts.push(92, 34) // '\\"' +// continue +// case 92: // '\\' +// byts.push(92, 92) // '\\\\' +// continue +// } +// byts.push(codePoint) +// } else if (codePoint < 0x800) { +// /* c8 ignore next 1 */ +// byts.push( +// codePoint >> 0x6 | 0xc0, +// codePoint & 0x3f | 0x80 +// ) +// } else if (codePoint < 0x10000) { +// /* c8 ignore next 1 */ +// byts.push( +// codePoint >> 0xc | 0xe0, +// codePoint >> 0x6 & 0x3f | 0x80, +// codePoint & 0x3f | 0x80 +// ) +// /* c8 ignore next 9 */ +// } else if (codePoint < 0x110000) { +// byts.push( +// codePoint >> 0x12 | 0xf0, +// codePoint >> 0xc & 0x3f | 0x80, +// codePoint >> 0x6 & 0x3f | 0x80, +// codePoint & 0x3f | 0x80 +// ) +// } else { +// /* c8 ignore next 2 */ +// throw new Error('Invalid code point') +// } +// } +// } -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/dist/src/util/as-uint8array.js /** - * To guarantee Uint8Array semantics, convert nodejs Buffers - * into vanilla Uint8Arrays + * @param {(Token|Token[])[]} e1 + * @param {(Token|Token[])[]} e2 + * @returns {number} */ -function src_util_as_uint8array_asUint8Array(buf) { - if (globalThis.Buffer != null) { - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); - } - return buf; +function encode_mapSorter (e1, e2) { + if (Array.isArray(e1[0]) || Array.isArray(e2[0])) { + throw new Error(`${encodeErrPrefix} complex map keys are not supported`) + } + const keyToken1 = e1[0] + const keyToken2 = e2[0] + if (keyToken1.type !== token_Type.string || keyToken2.type !== token_Type.string) { + throw new Error(`${encodeErrPrefix} non-string map keys are not supported`) + } + if (keyToken1 < keyToken2) { + return -1 + } + if (keyToken1 > keyToken2) { + return 1 + } + /* c8 ignore next 1 */ + throw new Error(`${encodeErrPrefix} unexpected duplicate map keys, this is not supported`) } -//# sourceMappingURL=as-uint8array.js.map -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/dist/src/alloc.js + +const encode_defaultEncodeOptions = { addBreakTokens: true, mapSorter: encode_mapSorter } /** - * Returns a `Uint8Array` of the requested size. Referenced memory will - * be initialized to 0. - */ -function dist_src_alloc_alloc(size = 0) { - if (globalThis.Buffer?.alloc != null) { - return asUint8Array(globalThis.Buffer.alloc(size)); - } - return new Uint8Array(size); -} -/** - * Where possible returns a Uint8Array of the requested size that references - * uninitialized memory. Only use if you are certain you will immediately - * overwrite every value in the returned `Uint8Array`. + * @param {any} data + * @param {EncodeOptions} [options] + * @returns {Uint8Array} */ -function src_alloc_allocUnsafe(size = 0) { - if (globalThis.Buffer?.allocUnsafe != null) { - return src_util_as_uint8array_asUint8Array(globalThis.Buffer.allocUnsafe(size)); - } - return new Uint8Array(size); +function json_encode_encode (data, options) { + options = Object.assign({}, encode_defaultEncodeOptions, options) + return encodeCustom(data, new JSONEncoder(), options) } -//# sourceMappingURL=alloc.js.map -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/dist/src/util/bases.js -function bases_createCodec(name, prefix, encode, decode) { - return { - name, - prefix, - encoder: { - name, - prefix, - encode - }, - decoder: { - decode - } - }; -} -const bases_string = bases_createCodec('utf8', 'u', (buf) => { - const decoder = new TextDecoder('utf8'); - return 'u' + decoder.decode(buf); -}, (str) => { - const encoder = new TextEncoder(); - return encoder.encode(str.substring(1)); -}); -const bases_ascii = bases_createCodec('ascii', 'a', (buf) => { - let string = 'a'; - for (let i = 0; i < buf.length; i++) { - string += String.fromCharCode(buf[i]); - } - return string; -}, (str) => { - str = str.substring(1); - const buf = src_alloc_allocUnsafe(str.length); - for (let i = 0; i < str.length; i++) { - buf[i] = str.charCodeAt(i); - } - return buf; -}); -const bases_BASES = { - utf8: bases_string, - 'utf-8': bases_string, - hex: src_basics_bases.base16, - latin1: bases_ascii, - ascii: bases_ascii, - binary: bases_ascii, - ...src_basics_bases -}; -/* harmony default export */ const src_util_bases = (bases_BASES); -//# sourceMappingURL=bases.js.map -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/dist/src/to-string.js -/** - * Turns a `Uint8Array` into a string. - * - * Supports `utf8`, `utf-8` and any encoding supported by the multibase module. - * - * Also `ascii` which is similar to node's 'binary' encoding. - */ -function src_to_string_toString(array, encoding = 'utf8') { - const base = src_util_bases[encoding]; - if (base == null) { - throw new Error(`Unsupported encoding "${encoding}"`); - } - if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) { - return globalThis.Buffer.from(array.buffer, array.byteOffset, array.byteLength).toString('utf8'); - } - // strip multibase prefix - return base.encoder.encode(array).substring(1); -} -//# sourceMappingURL=to-string.js.map -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/@multiformats/multiaddr/dist/src/ip.js +;// CONCATENATED MODULE: ./node_modules/cborg/lib/json/decode.js -const ip_isV4 = external_node_net_namespaceObject.isIPv4; -const ip_isV6 = external_node_net_namespaceObject.isIPv6; -// Copied from https://github.com/indutny/node-ip/blob/master/lib/ip.js#L7 -// but with buf/offset args removed because we don't use them -const src_ip_toBytes = function (ip) { - let offset = 0; - ip = ip.toString().trim(); - if (ip_isV4(ip)) { - const bytes = new Uint8Array(offset + 4); - ip.split(/\./g).forEach((byte) => { - bytes[offset++] = parseInt(byte, 10) & 0xff; - }); - return bytes; - } - if (ip_isV6(ip)) { - const sections = ip.split(':', 8); - let i; - for (i = 0; i < sections.length; i++) { - const isv4 = ip_isV4(sections[i]); - let v4Buffer; - if (isv4) { - v4Buffer = src_ip_toBytes(sections[i]); - sections[i] = src_to_string_toString(v4Buffer.slice(0, 2), 'base16'); - } - if (v4Buffer != null && ++i < 8) { - sections.splice(i, 0, src_to_string_toString(v4Buffer.slice(2, 4), 'base16')); - } - } - if (sections[0] === '') { - while (sections.length < 8) - sections.unshift('0'); - } - else if (sections[sections.length - 1] === '') { - while (sections.length < 8) - sections.push('0'); - } - else if (sections.length < 8) { - for (i = 0; i < sections.length && sections[i] !== ''; i++) - ; - const argv = [i, 1]; - for (i = 9 - sections.length; i > 0; i--) { - argv.push('0'); - } - sections.splice.apply(sections, argv); - } - const bytes = new Uint8Array(offset + 16); - for (i = 0; i < sections.length; i++) { - const word = parseInt(sections[i], 16); - bytes[offset++] = (word >> 8) & 0xff; - bytes[offset++] = word & 0xff; - } - return bytes; - } - throw new Error('invalid ip address'); -}; -// Copied from https://github.com/indutny/node-ip/blob/master/lib/ip.js#L63 -const src_ip_toString = function (buf, offset = 0, length) { - offset = ~~offset; - length = length ?? (buf.length - offset); - const view = new DataView(buf.buffer); - if (length === 4) { - const result = []; - // IPv4 - for (let i = 0; i < length; i++) { - result.push(buf[offset + i]); - } - return result.join('.'); - } - if (length === 16) { - const result = []; - // IPv6 - for (let i = 0; i < length; i += 2) { - result.push(view.getUint16(offset + i).toString(16)); - } - return result.join(':') - .replace(/(^|:)0(:0)*:0(:|$)/, '$1::$3') - .replace(/:{3,4}/, '::'); - } - return ''; -}; -//# sourceMappingURL=ip.js.map -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/@multiformats/multiaddr/dist/src/protocols-table.js -const protocols_table_V = -1; -const protocols_table_names = {}; -const protocols_table_codes = {}; -const protocols_table_table = [ - [4, 32, 'ip4'], - [6, 16, 'tcp'], - [33, 16, 'dccp'], - [41, 128, 'ip6'], - [42, protocols_table_V, 'ip6zone'], - [43, 8, 'ipcidr'], - [53, protocols_table_V, 'dns', true], - [54, protocols_table_V, 'dns4', true], - [55, protocols_table_V, 'dns6', true], - [56, protocols_table_V, 'dnsaddr', true], - [132, 16, 'sctp'], - [273, 16, 'udp'], - [275, 0, 'p2p-webrtc-star'], - [276, 0, 'p2p-webrtc-direct'], - [277, 0, 'p2p-stardust'], - [280, 0, 'webrtc'], - [281, 0, 'webrtc-w3c'], - [290, 0, 'p2p-circuit'], - [301, 0, 'udt'], - [302, 0, 'utp'], - [400, protocols_table_V, 'unix', false, true], - // `ipfs` is added before `p2p` for legacy support. - // All text representations will default to `p2p`, but `ipfs` will - // still be supported - [421, protocols_table_V, 'ipfs'], - // `p2p` is the preferred name for 421, and is now the default - [421, protocols_table_V, 'p2p'], - [443, 0, 'https'], - [444, 96, 'onion'], - [445, 296, 'onion3'], - [446, protocols_table_V, 'garlic64'], - [448, 0, 'tls'], - [449, protocols_table_V, 'sni'], - [460, 0, 'quic'], - [461, 0, 'quic-v1'], - [465, 0, 'webtransport'], - [466, protocols_table_V, 'certhash'], - [477, 0, 'ws'], - [478, 0, 'wss'], - [479, 0, 'p2p-websocket-star'], - [480, 0, 'http'], - [777, protocols_table_V, 'memory'] -]; -// populate tables -protocols_table_table.forEach(row => { - const proto = protocols_table_createProtocol(...row); - protocols_table_codes[proto.code] = proto; - protocols_table_names[proto.name] = proto; -}); -function protocols_table_createProtocol(code, size, name, resolvable, path) { - return { - code, - size, - name, - resolvable: Boolean(resolvable), - path: Boolean(path) - }; -} -/** - * For the passed proto string or number, return a {@link Protocol} - * - * @example - * - * ```js - * import { protocol } from '@multiformats/multiaddr' - * - * console.info(protocol(4)) - * // { code: 4, size: 32, name: 'ip4', resolvable: false, path: false } - * ``` - */ -function src_protocols_table_getProtocol(proto) { - if (typeof proto === 'number') { - if (protocols_table_codes[proto] != null) { - return protocols_table_codes[proto]; - } - throw new Error(`no protocol with code: ${proto}`); - } - else if (typeof proto === 'string') { - if (protocols_table_names[proto] != null) { - return protocols_table_names[proto]; - } - throw new Error(`no protocol with name: ${proto}`); - } - throw new Error(`invalid protocol id type: ${typeof proto}`); -} -//# sourceMappingURL=protocols-table.js.map -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/vendor/varint.js -var ipfs_core_utils_node_modules_multiformats_vendor_varint_encode_1 = ipfs_core_utils_node_modules_multiformats_vendor_varint_encode; -var ipfs_core_utils_node_modules_multiformats_vendor_varint_MSB = 0x80 - , ipfs_core_utils_node_modules_multiformats_vendor_varint_REST = 0x7F - , ipfs_core_utils_node_modules_multiformats_vendor_varint_MSBALL = ~ipfs_core_utils_node_modules_multiformats_vendor_varint_REST - , ipfs_core_utils_node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31); -function ipfs_core_utils_node_modules_multiformats_vendor_varint_encode(num, out, offset) { - out = out || []; - offset = offset || 0; - var oldOffset = offset; +/** + * @typedef {import('../../interface').DecodeOptions} DecodeOptions + * @typedef {import('../../interface').DecodeTokenizer} DecodeTokenizer + */ - while(num >= ipfs_core_utils_node_modules_multiformats_vendor_varint_INT) { - out[offset++] = (num & 0xFF) | ipfs_core_utils_node_modules_multiformats_vendor_varint_MSB; - num /= 128; +/** + * @implements {DecodeTokenizer} + */ +class Tokenizer { + /** + * @param {Uint8Array} data + * @param {DecodeOptions} options + */ + constructor (data, options = {}) { + this._pos = 0 + this.data = data + this.options = options + /** @type {string[]} */ + this.modeStack = ['value'] + this.lastToken = '' } - while(num & ipfs_core_utils_node_modules_multiformats_vendor_varint_MSBALL) { - out[offset++] = (num & 0xFF) | ipfs_core_utils_node_modules_multiformats_vendor_varint_MSB; - num >>>= 7; + + pos () { + return this._pos } - out[offset] = num | 0; - - ipfs_core_utils_node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; - - return out -} -var ipfs_core_utils_node_modules_multiformats_vendor_varint_decode = ipfs_core_utils_node_modules_multiformats_vendor_varint_read; + /** + * @returns {boolean} + */ + done () { + return this._pos >= this.data.length + } -var ipfs_core_utils_node_modules_multiformats_vendor_varint_MSB$1 = 0x80 - , ipfs_core_utils_node_modules_multiformats_vendor_varint_REST$1 = 0x7F; + /** + * @returns {number} + */ + ch () { + return this.data[this._pos] + } -function ipfs_core_utils_node_modules_multiformats_vendor_varint_read(buf, offset) { - var res = 0 - , offset = offset || 0 - , shift = 0 - , counter = offset - , b - , l = buf.length; + /** + * @returns {string} + */ + currentMode () { + return this.modeStack[this.modeStack.length - 1] + } - do { - if (counter >= l) { - ipfs_core_utils_node_modules_multiformats_vendor_varint_read.bytes = 0; - throw new RangeError('Could not decode varint') + skipWhitespace () { + let c = this.ch() + // @ts-ignore + while (c === 32 /* ' ' */ || c === 9 /* '\t' */ || c === 13 /* '\r' */ || c === 10 /* '\n' */) { + c = this.data[++this._pos] } - b = buf[counter++]; - res += shift < 28 - ? (b & ipfs_core_utils_node_modules_multiformats_vendor_varint_REST$1) << shift - : (b & ipfs_core_utils_node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift); - shift += 7; - } while (b >= ipfs_core_utils_node_modules_multiformats_vendor_varint_MSB$1) - - ipfs_core_utils_node_modules_multiformats_vendor_varint_read.bytes = counter - offset; + } - return res -} + /** + * @param {number[]} str + */ + expect (str) { + if (this.data.length - this._pos < str.length) { + throw new Error(`${decodeErrPrefix} unexpected end of input at position ${this._pos}`) + } + for (let i = 0; i < str.length; i++) { + if (this.data[this._pos++] !== str[i]) { + throw new Error(`${decodeErrPrefix} unexpected token at position ${this._pos}, expected to find '${String.fromCharCode(...str)}'`) + } + } + } -var ipfs_core_utils_node_modules_multiformats_vendor_varint_N1 = Math.pow(2, 7); -var ipfs_core_utils_node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14); -var ipfs_core_utils_node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21); -var ipfs_core_utils_node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28); -var ipfs_core_utils_node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35); -var ipfs_core_utils_node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42); -var ipfs_core_utils_node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49); -var ipfs_core_utils_node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56); -var ipfs_core_utils_node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63); + parseNumber () { + const startPos = this._pos + let negative = false + let float = false -var ipfs_core_utils_node_modules_multiformats_vendor_varint_length = function (value) { - return ( - value < ipfs_core_utils_node_modules_multiformats_vendor_varint_N1 ? 1 - : value < ipfs_core_utils_node_modules_multiformats_vendor_varint_N2 ? 2 - : value < ipfs_core_utils_node_modules_multiformats_vendor_varint_N3 ? 3 - : value < ipfs_core_utils_node_modules_multiformats_vendor_varint_N4 ? 4 - : value < ipfs_core_utils_node_modules_multiformats_vendor_varint_N5 ? 5 - : value < ipfs_core_utils_node_modules_multiformats_vendor_varint_N6 ? 6 - : value < ipfs_core_utils_node_modules_multiformats_vendor_varint_N7 ? 7 - : value < ipfs_core_utils_node_modules_multiformats_vendor_varint_N8 ? 8 - : value < ipfs_core_utils_node_modules_multiformats_vendor_varint_N9 ? 9 - : 10 - ) -}; + /** + * @param {number[]} chars + */ + const swallow = (chars) => { + while (!this.done()) { + const ch = this.ch() + if (chars.includes(ch)) { + this._pos++ + } else { + break + } + } + } -var ipfs_core_utils_node_modules_multiformats_vendor_varint_varint = { - encode: ipfs_core_utils_node_modules_multiformats_vendor_varint_encode_1 - , decode: ipfs_core_utils_node_modules_multiformats_vendor_varint_decode - , encodingLength: ipfs_core_utils_node_modules_multiformats_vendor_varint_length -}; + // lead + if (this.ch() === 45) { // '-' + negative = true + this._pos++ + } + if (this.ch() === 48) { // '0' + this._pos++ + if (this.ch() === 46) { // '.' + this._pos++ + float = true + } else { + return new token_Token(token_Type.uint, 0, this._pos - startPos) + } + } + swallow([48, 49, 50, 51, 52, 53, 54, 55, 56, 57]) // DIGIT + if (negative && this._pos === startPos + 1) { + throw new Error(`${decodeErrPrefix} unexpected token at position ${this._pos}`) + } + if (!this.done() && this.ch() === 46) { // '.' + if (float) { + throw new Error(`${decodeErrPrefix} unexpected token at position ${this._pos}`) + } + float = true + this._pos++ + swallow([48, 49, 50, 51, 52, 53, 54, 55, 56, 57]) // DIGIT + } + if (!this.done() && (this.ch() === 101 || this.ch() === 69)) { // '[eE]' + float = true + this._pos++ + if (!this.done() && (this.ch() === 43 || this.ch() === 45)) { // '+', '-' + this._pos++ + } + swallow([48, 49, 50, 51, 52, 53, 54, 55, 56, 57]) // DIGIT + } + // @ts-ignore + const numStr = String.fromCharCode.apply(null, this.data.subarray(startPos, this._pos)) + const num = parseFloat(numStr) + if (float) { + return new token_Token(token_Type.float, num, this._pos - startPos) + } + if (this.options.allowBigInt !== true || Number.isSafeInteger(num)) { + return new token_Token(num >= 0 ? token_Type.uint : token_Type.negint, num, this._pos - startPos) + } + return new token_Token(num >= 0 ? token_Type.uint : token_Type.negint, BigInt(numStr), this._pos - startPos) + } -var ipfs_core_utils_node_modules_multiformats_vendor_varint_brrp_varint = ipfs_core_utils_node_modules_multiformats_vendor_varint_varint; + /** + * @returns {Token} + */ + parseString () { + /* c8 ignore next 4 */ + if (this.ch() !== 34) { // '"' + // this would be a programming error + throw new Error(`${decodeErrPrefix} unexpected character at position ${this._pos}; this shouldn't happen`) + } + this._pos++ -/* harmony default export */ const ipfs_core_utils_node_modules_multiformats_vendor_varint = (ipfs_core_utils_node_modules_multiformats_vendor_varint_brrp_varint); + // check for simple fast-path, all printable ascii, no escapes + // >0x10000 elements may fail fn.apply() (http://stackoverflow.com/a/22747272/680742) + for (let i = this._pos, l = 0; i < this.data.length && l < 0x10000; i++, l++) { + const ch = this.data[i] + if (ch === 92 || ch < 32 || ch >= 128) { // '\', ' ', control-chars or non-trivial + break + } + if (ch === 34) { // '"' + // @ts-ignore + const str = String.fromCharCode.apply(null, this.data.subarray(this._pos, i)) + this._pos = i + 1 + return new token_Token(token_Type.string, str, l) + } + } -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/varint.js + const startPos = this._pos + const chars = [] + const readu4 = () => { + if (this._pos + 4 >= this.data.length) { + throw new Error(`${decodeErrPrefix} unexpected end of unicode escape sequence at position ${this._pos}`) + } + let u4 = 0 + for (let i = 0; i < 4; i++) { + let ch = this.ch() + if (ch >= 48 && ch <= 57) { // '0' && '9' + ch -= 48 + } else if (ch >= 97 && ch <= 102) { // 'a' && 'f' + ch = ch - 97 + 10 + } else if (ch >= 65 && ch <= 70) { // 'A' && 'F' + ch = ch - 65 + 10 + } else { + throw new Error(`${decodeErrPrefix} unexpected unicode escape character at position ${this._pos}`) + } + u4 = u4 * 16 + ch + this._pos++ + } + return u4 + } -/** - * @param {Uint8Array} data - * @param {number} [offset=0] - * @returns {[number, number]} - */ -const ipfs_core_utils_node_modules_multiformats_src_varint_decode = (data, offset = 0) => { - const code = ipfs_core_utils_node_modules_multiformats_vendor_varint.decode(data, offset) - return [code, ipfs_core_utils_node_modules_multiformats_vendor_varint.decode.bytes] -} + // mostly taken from feross/buffer and adjusted to fit + const readUtf8Char = () => { + const firstByte = this.ch() + let codePoint = null + /* c8 ignore next 1 */ + let bytesPerSequence = (firstByte > 0xef) ? 4 : (firstByte > 0xdf) ? 3 : (firstByte > 0xbf) ? 2 : 1 -/** - * @param {number} int - * @param {Uint8Array} target - * @param {number} [offset=0] - */ -const ipfs_core_utils_node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => { - ipfs_core_utils_node_modules_multiformats_vendor_varint.encode(int, target, offset) - return target -} + if (this._pos + bytesPerSequence > this.data.length) { + throw new Error(`${decodeErrPrefix} unexpected unicode sequence at position ${this._pos}`) + } -/** - * @param {number} int - * @returns {number} - */ -const ipfs_core_utils_node_modules_multiformats_src_varint_encodingLength = (int) => { - return ipfs_core_utils_node_modules_multiformats_vendor_varint.encodingLength(int) -} + let secondByte, thirdByte, fourthByte, tempCodePoint -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bytes.js -const ipfs_core_utils_node_modules_multiformats_src_bytes_empty = new Uint8Array(0) + switch (bytesPerSequence) { + /* c8 ignore next 6 */ + // this case is dealt with by the caller function + case 1: + if (firstByte < 0x80) { + codePoint = firstByte + } + break + case 2: + secondByte = this.data[this._pos + 1] + if ((secondByte & 0xc0) === 0x80) { + tempCodePoint = (firstByte & 0x1f) << 0x6 | (secondByte & 0x3f) + if (tempCodePoint > 0x7f) { + codePoint = tempCodePoint + } + } + break + case 3: + secondByte = this.data[this._pos + 1] + thirdByte = this.data[this._pos + 2] + if ((secondByte & 0xc0) === 0x80 && (thirdByte & 0xc0) === 0x80) { + tempCodePoint = (firstByte & 0xf) << 0xc | (secondByte & 0x3f) << 0x6 | (thirdByte & 0x3f) + /* c8 ignore next 3 */ + if (tempCodePoint > 0x7ff && (tempCodePoint < 0xd800 || tempCodePoint > 0xdfff)) { + codePoint = tempCodePoint + } + } + break + case 4: + secondByte = this.data[this._pos + 1] + thirdByte = this.data[this._pos + 2] + fourthByte = this.data[this._pos + 3] + if ((secondByte & 0xc0) === 0x80 && (thirdByte & 0xc0) === 0x80 && (fourthByte & 0xc0) === 0x80) { + tempCodePoint = (firstByte & 0xf) << 0x12 | (secondByte & 0x3f) << 0xc | (thirdByte & 0x3f) << 0x6 | (fourthByte & 0x3f) + if (tempCodePoint > 0xffff && tempCodePoint < 0x110000) { + codePoint = tempCodePoint + } + } + } -/** - * @param {Uint8Array} d - */ -const ipfs_core_utils_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') + /* c8 ignore next 5 */ + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xfffd + bytesPerSequence = 1 + } else if (codePoint > 0xffff) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000 + chars.push(codePoint >>> 10 & 0x3ff | 0xd800) + codePoint = 0xdc00 | codePoint & 0x3ff + } -/** - * @param {string} hex - */ -const ipfs_core_utils_node_modules_multiformats_src_bytes_fromHex = hex => { - const hexes = hex.match(/../g) - return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : ipfs_core_utils_node_modules_multiformats_src_bytes_empty -} + chars.push(codePoint) + this._pos += bytesPerSequence + } -/** - * @param {Uint8Array} aa - * @param {Uint8Array} bb - */ -const ipfs_core_utils_node_modules_multiformats_src_bytes_equals = (aa, bb) => { - if (aa === bb) return true - if (aa.byteLength !== bb.byteLength) { - return false + // TODO: could take the approach of a quick first scan for special chars like encoding/json/decode.go#unquoteBytes + // and converting all of the ascii chars from the base array in bulk + while (!this.done()) { + const ch = this.ch() + let ch1 + switch (ch) { + case 92: // '\' + this._pos++ + if (this.done()) { + throw new Error(`${decodeErrPrefix} unexpected string termination at position ${this._pos}`) + } + ch1 = this.ch() + this._pos++ + switch (ch1) { + case 34: // '"' + case 39: // '\'' + case 92: // '\' + case 47: // '/' + chars.push(ch1) + break + case 98: // 'b' + chars.push(8) + break + case 116: // 't' + chars.push(9) + break + case 110: // 'n' + chars.push(10) + break + case 102: // 'f' + chars.push(12) + break + case 114: // 'r' + chars.push(13) + break + case 117: // 'u' + chars.push(readu4()) + break + default: + throw new Error(`${decodeErrPrefix} unexpected string escape character at position ${this._pos}`) + } + break + case 34: // '"' + this._pos++ + return new token_Token(token_Type.string, decodeCodePointsArray(chars), this._pos - startPos) + default: + if (ch < 32) { // ' ' + throw new Error(`${decodeErrPrefix} invalid control character at position ${this._pos}`) + } else if (ch < 0x80) { + chars.push(ch) + this._pos++ + } else { + readUtf8Char() + } + } + } + + throw new Error(`${decodeErrPrefix} unexpected end of string at position ${this._pos}`) } - for (let ii = 0; ii < aa.byteLength; ii++) { - if (aa[ii] !== bb[ii]) { - return false + /** + * @returns {Token} + */ + parseValue () { + switch (this.ch()) { + case 123: // '{' + this.modeStack.push('obj-start') + this._pos++ + return new token_Token(token_Type.map, Infinity, 1) + case 91: // '[' + this.modeStack.push('array-start') + this._pos++ + return new token_Token(token_Type.array, Infinity, 1) + case 34: { // '"' + return this.parseString() + } + case 110: // 'n' / null + this.expect([110, 117, 108, 108]) // 'null' + return new token_Token(token_Type["null"], null, 4) + case 102: // 'f' / // false + this.expect([102, 97, 108, 115, 101]) // 'false' + return new token_Token(token_Type["false"], false, 5) + case 116: // 't' / // true + this.expect([116, 114, 117, 101]) // 'true' + return new token_Token(token_Type["true"], true, 4) + case 45: // '-' + case 48: // '0' + case 49: // '1' + case 50: // '2' + case 51: // '3' + case 52: // '4' + case 53: // '5' + case 54: // '6' + case 55: // '7' + case 56: // '8' + case 57: // '9' + return this.parseNumber() + default: + throw new Error(`${decodeErrPrefix} unexpected character at position ${this._pos}`) } } - return true -} - -/** - * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o - * @returns {Uint8Array} - */ -const ipfs_core_utils_node_modules_multiformats_src_bytes_coerce = o => { - if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o - if (o instanceof ArrayBuffer) return new Uint8Array(o) - if (ArrayBuffer.isView(o)) { - return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) + /** + * @returns {Token} + */ + next () { + this.skipWhitespace() + switch (this.currentMode()) { + case 'value': + this.modeStack.pop() + return this.parseValue() + case 'array-value': { + this.modeStack.pop() + if (this.ch() === 93) { // ']' + this._pos++ + this.skipWhitespace() + return new token_Token(token_Type["break"], undefined, 1) + } + if (this.ch() !== 44) { // ',' + throw new Error(`${decodeErrPrefix} unexpected character at position ${this._pos}, was expecting array delimiter but found '${String.fromCharCode(this.ch())}'`) + } + this._pos++ + this.modeStack.push('array-value') + this.skipWhitespace() + return this.parseValue() + } + case 'array-start': { + this.modeStack.pop() + if (this.ch() === 93) { // ']' + this._pos++ + this.skipWhitespace() + return new token_Token(token_Type["break"], undefined, 1) + } + this.modeStack.push('array-value') + this.skipWhitespace() + return this.parseValue() + } + // @ts-ignore + case 'obj-key': + if (this.ch() === 125) { // '}' + this.modeStack.pop() + this._pos++ + this.skipWhitespace() + return new token_Token(token_Type["break"], undefined, 1) + } + if (this.ch() !== 44) { // ',' + throw new Error(`${decodeErrPrefix} unexpected character at position ${this._pos}, was expecting object delimiter but found '${String.fromCharCode(this.ch())}'`) + } + this._pos++ + this.skipWhitespace() + case 'obj-start': { // eslint-disable-line no-fallthrough + this.modeStack.pop() + if (this.ch() === 125) { // '}' + this._pos++ + this.skipWhitespace() + return new token_Token(token_Type["break"], undefined, 1) + } + const token = this.parseString() + this.skipWhitespace() + if (this.ch() !== 58) { // ':' + throw new Error(`${decodeErrPrefix} unexpected character at position ${this._pos}, was expecting key/value delimiter ':' but found '${String.fromCharCode(this.ch())}'`) + } + this._pos++ + this.modeStack.push('obj-value') + return token + } + case 'obj-value': { + this.modeStack.pop() + this.modeStack.push('obj-key') + this.skipWhitespace() + return this.parseValue() + } + /* c8 ignore next 2 */ + default: + throw new Error(`${decodeErrPrefix} unexpected parse state at position ${this._pos}; this shouldn't happen`) + } } - throw new Error('Unknown type, must be binary type') } /** - * @param {any} o - * @returns {o is ArrayBuffer|ArrayBufferView} - */ -const ipfs_core_utils_node_modules_multiformats_src_bytes_isBinary = o => - o instanceof ArrayBuffer || ArrayBuffer.isView(o) - -/** - * @param {string} str - * @returns {Uint8Array} + * @param {Uint8Array} data + * @param {DecodeOptions} [options] + * @returns {any} */ -const ipfs_core_utils_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) +function json_decode_decode (data, options) { + options = Object.assign({ tokenizer: new Tokenizer(data, options) }, options) + return decode_decode(data, options) +} /** - * @param {Uint8Array} b - * @returns {string} + * @param {Uint8Array} data + * @param {DecodeOptions} [options] + * @returns {[any, Uint8Array]} */ -const ipfs_core_utils_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) +function decode_decodeFirst (data, options) { + options = Object.assign({ tokenizer: new Tokenizer(data, options) }, options) + return _decodeFirst(data, options) +} -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/hashes/digest.js +;// CONCATENATED MODULE: ./node_modules/cborg/lib/json/json.js -/** - * Creates a multihash digest. - * - * @template {number} Code - * @param {Code} code - * @param {Uint8Array} digest - */ -const ipfs_core_utils_node_modules_multiformats_src_hashes_digest_create = (code, digest) => { - const size = digest.byteLength - const sizeOffset = ipfs_core_utils_node_modules_multiformats_src_varint_encodingLength(code) - const digestOffset = sizeOffset + ipfs_core_utils_node_modules_multiformats_src_varint_encodingLength(size) - const bytes = new Uint8Array(digestOffset + size) - ipfs_core_utils_node_modules_multiformats_src_varint_encodeTo(code, bytes, 0) - ipfs_core_utils_node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset) - bytes.set(digest, digestOffset) - return new ipfs_core_utils_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/bytes.js +const src_bytes_empty = new Uint8Array(0); +function src_bytes_toHex(d) { + return d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), ''); } - -/** - * Turns bytes representation of multihash digest into an instance. - * - * @param {Uint8Array} multihash - * @returns {MultihashDigest} - */ -const ipfs_core_utils_node_modules_multiformats_src_hashes_digest_decode = (multihash) => { - const bytes = ipfs_core_utils_node_modules_multiformats_src_bytes_coerce(multihash) - const [code, sizeOffset] = ipfs_core_utils_node_modules_multiformats_src_varint_decode(bytes) - const [size, digestOffset] = ipfs_core_utils_node_modules_multiformats_src_varint_decode(bytes.subarray(sizeOffset)) - const digest = bytes.subarray(sizeOffset + digestOffset) - - if (digest.byteLength !== size) { - throw new Error('Incorrect length') - } - - return new ipfs_core_utils_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) +function src_bytes_fromHex(hex) { + const hexes = hex.match(/../g); + return hexes != null ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : src_bytes_empty; } - -/** - * @param {MultihashDigest} a - * @param {unknown} b - * @returns {b is MultihashDigest} - */ -const ipfs_core_utils_node_modules_multiformats_src_hashes_digest_equals = (a, b) => { - if (a === b) { - return true - } else { - const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) - - return ( - a.code === data.code && - a.size === data.size && - data.bytes instanceof Uint8Array && - ipfs_core_utils_node_modules_multiformats_src_bytes_equals(a.bytes, data.bytes) - ) - } +function src_bytes_equals(aa, bb) { + if (aa === bb) + return true; + if (aa.byteLength !== bb.byteLength) { + return false; + } + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false; + } + } + return true; } - -/** - * @typedef {import('./interface.js').MultihashDigest} MultihashDigest - */ - -/** - * Represents a multihash digest which carries information about the - * hashing algorithm and an actual hash digest. - * - * @template {number} Code - * @template {number} Size - * @class - * @implements {MultihashDigest} - */ -class ipfs_core_utils_node_modules_multiformats_src_hashes_digest_Digest { - /** - * Creates a multihash digest. - * - * @param {Code} code - * @param {Size} size - * @param {Uint8Array} digest - * @param {Uint8Array} bytes - */ - constructor (code, size, digest, bytes) { - this.code = code - this.size = size - this.digest = digest - this.bytes = bytes - } +function dist_src_bytes_coerce(o) { + if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') + return o; + if (o instanceof ArrayBuffer) + return new Uint8Array(o); + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength); + } + throw new Error('Unknown type, must be binary type'); } - -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/vendor/base-x.js +function src_bytes_isBinary(o) { + return o instanceof ArrayBuffer || ArrayBuffer.isView(o); +} +function src_bytes_fromString(str) { + return new TextEncoder().encode(str); +} +function dist_src_bytes_toString(b) { + return new TextDecoder().decode(b); +} +//# sourceMappingURL=bytes.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/vendor/base-x.js +/* eslint-disable */ // base-x encoding / decoding // Copyright (c) 2018 base-x contributors // Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) // Distributed under the MIT software license, see the accompanying // file LICENSE or http://www.opensource.org/licenses/mit-license.php. -function ipfs_core_utils_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { - if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } - var BASE_MAP = new Uint8Array(256); - for (var j = 0; j < BASE_MAP.length; j++) { - BASE_MAP[j] = 255; - } - for (var i = 0; i < ALPHABET.length; i++) { - var x = ALPHABET.charAt(i); - var xc = x.charCodeAt(0); - if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') } - BASE_MAP[xc] = i; - } - var BASE = ALPHABET.length; - var LEADER = ALPHABET.charAt(0); - var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up - var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up - function encode (source) { - if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) { - source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); - } else if (Array.isArray(source)) { - source = Uint8Array.from(source); +/** + * @param {string} ALPHABET + * @param {any} name + */ +function vendor_base_x_base(ALPHABET, name) { + if (ALPHABET.length >= 255) { + throw new TypeError('Alphabet too long'); } - if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') } - if (source.length === 0) { return '' } - // Skip & count leading zeroes. - var zeroes = 0; - var length = 0; - var pbegin = 0; - var pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; } + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { + throw new TypeError(x + ' is ambiguous'); + } + BASE_MAP[xc] = i; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up + var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up + /** + * @param {any[] | Iterable} source + */ + function encode(source) { + // @ts-ignore + if (source instanceof Uint8Array) + ; + else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } + else if (Array.isArray(source)) { + source = Uint8Array.from(source); + } + if (!(source instanceof Uint8Array)) { + throw new TypeError('Expected Uint8Array'); + } + if (source.length === 0) { + return ''; + } + // Skip & count leading zeroes. + var zeroes = 0; + var length = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } // Allocate enough space in big-endian base58 representation. - var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; - var b58 = new Uint8Array(size); + var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; + var b58 = new Uint8Array(size); // Process the bytes. - while (pbegin !== pend) { - var carry = source[pbegin]; + while (pbegin !== pend) { + var carry = source[pbegin]; // Apply "b58 = b58 * 256 + ch". - var i = 0; - for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { - carry += (256 * b58[it1]) >>> 0; - b58[it1] = (carry % BASE) >>> 0; - carry = (carry / BASE) >>> 0; - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - pbegin++; - } + var i = 0; + for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { + carry += (256 * b58[it1]) >>> 0; + b58[it1] = (carry % BASE) >>> 0; + carry = (carry / BASE) >>> 0; + } + if (carry !== 0) { + throw new Error('Non-zero carry'); + } + length = i; + pbegin++; + } // Skip leading zeroes in base58 result. - var it2 = size - length; - while (it2 !== size && b58[it2] === 0) { - it2++; - } + var it2 = size - length; + while (it2 !== size && b58[it2] === 0) { + it2++; + } // Translate the result into a string. - var str = LEADER.repeat(zeroes); - for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); } - return str - } - function decodeUnsafe (source) { - if (typeof source !== 'string') { throw new TypeError('Expected String') } - if (source.length === 0) { return new Uint8Array() } - var psz = 0; + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { + str += ALPHABET.charAt(b58[it2]); + } + return str; + } + /** + * @param {string | string[]} source + */ + function decodeUnsafe(source) { + if (typeof source !== 'string') { + throw new TypeError('Expected String'); + } + if (source.length === 0) { + return new Uint8Array(); + } + var psz = 0; // Skip leading spaces. - if (source[psz] === ' ') { return } + if (source[psz] === ' ') { + return; + } // Skip and count leading '1's. - var zeroes = 0; - var length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; - } + var zeroes = 0; + var length = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; + } // Allocate enough space in big-endian base256 representation. - var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. - var b256 = new Uint8Array(size); + var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. + var b256 = new Uint8Array(size); // Process the characters. - while (source[psz]) { + while (source[psz]) { // Decode character - var carry = BASE_MAP[source.charCodeAt(psz)]; + var carry = BASE_MAP[source.charCodeAt(psz)]; // Invalid character - if (carry === 255) { return } - var i = 0; - for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { - carry += (BASE * b256[it3]) >>> 0; - b256[it3] = (carry % 256) >>> 0; - carry = (carry / 256) >>> 0; - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - psz++; - } + if (carry === 255) { + return; + } + var i = 0; + for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { + carry += (BASE * b256[it3]) >>> 0; + b256[it3] = (carry % 256) >>> 0; + carry = (carry / 256) >>> 0; + } + if (carry !== 0) { + throw new Error('Non-zero carry'); + } + length = i; + psz++; + } // Skip trailing spaces. - if (source[psz] === ' ') { return } + if (source[psz] === ' ') { + return; + } // Skip leading zeroes in b256. - var it4 = size - length; - while (it4 !== size && b256[it4] === 0) { - it4++; + var it4 = size - length; + while (it4 !== size && b256[it4] === 0) { + it4++; + } + var vch = new Uint8Array(zeroes + (size - it4)); + var j = zeroes; + while (it4 !== size) { + vch[j++] = b256[it4++]; + } + return vch; } - var vch = new Uint8Array(zeroes + (size - it4)); - var j = zeroes; - while (it4 !== size) { - vch[j++] = b256[it4++]; + /** + * @param {string | string[]} string + */ + function decode(string) { + var buffer = decodeUnsafe(string); + if (buffer) { + return buffer; + } + throw new Error(`Non-${name} character`); } - return vch - } - function decode (string) { - var buffer = decodeUnsafe(string); - if (buffer) { return buffer } - throw new Error(`Non-${name} character`) - } - return { - encode: encode, - decodeUnsafe: decodeUnsafe, - decode: decode - } + return { + encode: encode, + decodeUnsafe: decodeUnsafe, + decode: decode + }; } -var ipfs_core_utils_node_modules_multiformats_vendor_base_x_src = ipfs_core_utils_node_modules_multiformats_vendor_base_x_base; - -var ipfs_core_utils_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = ipfs_core_utils_node_modules_multiformats_vendor_base_x_src; - -/* harmony default export */ const ipfs_core_utils_node_modules_multiformats_vendor_base_x = (ipfs_core_utils_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX); - -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base.js - - -// Linter can't see that API is used in types. -// eslint-disable-next-line +var vendor_base_x_src = vendor_base_x_base; +var vendor_base_x_brrp_multiformats_scope_baseX = vendor_base_x_src; +/* harmony default export */ const src_vendor_base_x = (vendor_base_x_brrp_multiformats_scope_baseX); +//# sourceMappingURL=base-x.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/bases/base.js /** * Class represents both BaseEncoder and MultibaseEncoder meaning it * can be used to encode to multibase or base encode without multibase * prefix. - * - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseEncoder} - * @implements {API.BaseEncoder} */ -class ipfs_core_utils_node_modules_multiformats_src_bases_base_Encoder { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(bytes:Uint8Array) => string} baseEncode - */ - constructor (name, prefix, baseEncode) { - this.name = name - this.prefix = prefix - this.baseEncode = baseEncode - } - - /** - * @param {Uint8Array} bytes - * @returns {API.Multibase} - */ - encode (bytes) { - if (bytes instanceof Uint8Array) { - return `${this.prefix}${this.baseEncode(bytes)}` - } else { - throw Error('Unknown type, must be binary type') +class bases_base_Encoder { + name; + prefix; + baseEncode; + constructor(name, prefix, baseEncode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; } - } + encode(bytes) { + if (bytes instanceof Uint8Array) { + return `${this.prefix}${this.baseEncode(bytes)}`; + } + else { + throw Error('Unknown type, must be binary type'); + } + } +} +/** + * Class represents both BaseDecoder and MultibaseDecoder so it could be used + * to decode multibases (with matching prefix) or just base decode strings + * with corresponding base encoding. + */ +class bases_base_Decoder { + name; + prefix; + baseDecode; + prefixCodePoint; + constructor(name, prefix, baseDecode) { + this.name = name; + this.prefix = prefix; + /* c8 ignore next 3 */ + if (prefix.codePointAt(0) === undefined) { + throw new Error('Invalid prefix character'); + } + this.prefixCodePoint = prefix.codePointAt(0); + this.baseDecode = baseDecode; + } + decode(text) { + if (typeof text === 'string') { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); + } + return this.baseDecode(text.slice(this.prefix.length)); + } + else { + throw Error('Can only multibase decode strings'); + } + } + or(decoder) { + return bases_base_or(this, decoder); + } +} +class bases_base_ComposedDecoder { + decoders; + constructor(decoders) { + this.decoders = decoders; + } + or(decoder) { + return bases_base_or(this, decoder); + } + decode(input) { + const prefix = input[0]; + const decoder = this.decoders[prefix]; + if (decoder != null) { + return decoder.decode(input); + } + else { + throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); + } + } +} +function bases_base_or(left, right) { + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + return new bases_base_ComposedDecoder({ + ...(left.decoders ?? { [left.prefix]: left }), + ...(right.decoders ?? { [right.prefix]: right }) + }); +} +class bases_base_Codec { + name; + prefix; + baseEncode; + baseDecode; + encoder; + decoder; + constructor(name, prefix, baseEncode, baseDecode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + this.baseDecode = baseDecode; + this.encoder = new bases_base_Encoder(name, prefix, baseEncode); + this.decoder = new bases_base_Decoder(name, prefix, baseDecode); + } + encode(input) { + return this.encoder.encode(input); + } + decode(input) { + return this.decoder.decode(input); + } +} +function bases_base_from({ name, prefix, encode, decode }) { + return new bases_base_Codec(name, prefix, encode, decode); +} +function bases_base_baseX({ name, prefix, alphabet }) { + const { encode, decode } = src_vendor_base_x(alphabet, name); + return bases_base_from({ + prefix, + name, + encode, + decode: (text) => dist_src_bytes_coerce(decode(text)) + }); +} +function bases_base_decode(string, alphabet, bitsPerChar, name) { + // Build the character lookup table: + const codes = {}; + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i; + } + // Count the padding bytes: + let end = string.length; + while (string[end - 1] === '=') { + --end; + } + // Allocate the output: + const out = new Uint8Array((end * bitsPerChar / 8) | 0); + // Parse the data: + let bits = 0; // Number of bits currently in the buffer + let buffer = 0; // Bits waiting to be written out, MSB first + let written = 0; // Next byte to write + for (let i = 0; i < end; ++i) { + // Read one character from the string: + const value = codes[string[i]]; + if (value === undefined) { + throw new SyntaxError(`Non-${name} character`); + } + // Append the bits to the buffer: + buffer = (buffer << bitsPerChar) | value; + bits += bitsPerChar; + // Write out some bits if the buffer has a byte's worth: + if (bits >= 8) { + bits -= 8; + out[written++] = 0xff & (buffer >> bits); + } + } + // Verify that we have received just enough bits: + if (bits >= bitsPerChar || (0xff & (buffer << (8 - bits))) !== 0) { + throw new SyntaxError('Unexpected end of data'); + } + return out; +} +function bases_base_encode(data, alphabet, bitsPerChar) { + const pad = alphabet[alphabet.length - 1] === '='; + const mask = (1 << bitsPerChar) - 1; + let out = ''; + let bits = 0; // Number of bits currently in the buffer + let buffer = 0; // Bits waiting to be written out, MSB first + for (let i = 0; i < data.length; ++i) { + // Slurp data into the buffer: + buffer = (buffer << 8) | data[i]; + bits += 8; + // Write out as much as we can: + while (bits > bitsPerChar) { + bits -= bitsPerChar; + out += alphabet[mask & (buffer >> bits)]; + } + } + // Partial character: + if (bits !== 0) { + out += alphabet[mask & (buffer << (bitsPerChar - bits))]; + } + // Add padding characters until we hit a byte boundary: + if (pad) { + while (((out.length * bitsPerChar) & 7) !== 0) { + out += '='; + } + } + return out; +} +/** + * RFC4648 Factory + */ +function bases_base_rfc4648({ name, prefix, bitsPerChar, alphabet }) { + return bases_base_from({ + prefix, + name, + encode(input) { + return bases_base_encode(input, alphabet, bitsPerChar); + }, + decode(input) { + return bases_base_decode(input, alphabet, bitsPerChar, name); + } + }); } +//# sourceMappingURL=base.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/bases/base32.js + +const src_bases_base32_base32 = bases_base_rfc4648({ + prefix: 'b', + name: 'base32', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567', + bitsPerChar: 5 +}); +const src_bases_base32_base32upper = bases_base_rfc4648({ + prefix: 'B', + name: 'base32upper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', + bitsPerChar: 5 +}); +const bases_base32_base32pad = bases_base_rfc4648({ + prefix: 'c', + name: 'base32pad', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', + bitsPerChar: 5 +}); +const bases_base32_base32padupper = bases_base_rfc4648({ + prefix: 'C', + name: 'base32padupper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', + bitsPerChar: 5 +}); +const bases_base32_base32hex = bases_base_rfc4648({ + prefix: 'v', + name: 'base32hex', + alphabet: '0123456789abcdefghijklmnopqrstuv', + bitsPerChar: 5 +}); +const bases_base32_base32hexupper = bases_base_rfc4648({ + prefix: 'V', + name: 'base32hexupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', + bitsPerChar: 5 +}); +const bases_base32_base32hexpad = bases_base_rfc4648({ + prefix: 't', + name: 'base32hexpad', + alphabet: '0123456789abcdefghijklmnopqrstuv=', + bitsPerChar: 5 +}); +const bases_base32_base32hexpadupper = bases_base_rfc4648({ + prefix: 'T', + name: 'base32hexpadupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', + bitsPerChar: 5 +}); +const bases_base32_base32z = bases_base_rfc4648({ + prefix: 'h', + name: 'base32z', + alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', + bitsPerChar: 5 +}); +//# sourceMappingURL=base32.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/bases/base58.js +const src_bases_base58_base58btc = bases_base_baseX({ + name: 'base58btc', + prefix: 'z', + alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +}); +const bases_base58_base58flickr = bases_base_baseX({ + name: 'base58flickr', + prefix: 'Z', + alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' +}); +//# sourceMappingURL=base58.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/vendor/varint.js +/* eslint-disable */ +var vendor_varint_encode_1 = src_vendor_varint_encode; +var vendor_varint_MSB = 0x80, vendor_varint_REST = 0x7F, vendor_varint_MSBALL = ~vendor_varint_REST, vendor_varint_INT = Math.pow(2, 31); /** - * @template {string} Prefix - */ -/** - * Class represents both BaseDecoder and MultibaseDecoder so it could be used - * to decode multibases (with matching prefix) or just base decode strings - * with corresponding base encoding. - * - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseDecoder} - * @implements {API.UnibaseDecoder} - * @implements {API.BaseDecoder} + * @param {number} num + * @param {number[]} out + * @param {number} offset */ -class ipfs_core_utils_node_modules_multiformats_src_bases_base_Decoder { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(text:string) => Uint8Array} baseDecode - */ - constructor (name, prefix, baseDecode) { - this.name = name - this.prefix = prefix - /* c8 ignore next 3 */ - if (prefix.codePointAt(0) === undefined) { - throw new Error('Invalid prefix character') +function src_vendor_varint_encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; + while (num >= vendor_varint_INT) { + out[offset++] = (num & 0xFF) | vendor_varint_MSB; + num /= 128; } - /** @private */ - this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0)) - this.baseDecode = baseDecode - } - - /** - * @param {string} text - */ - decode (text) { - if (typeof text === 'string') { - if (text.codePointAt(0) !== this.prefixCodePoint) { - throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`) - } - return this.baseDecode(text.slice(this.prefix.length)) - } else { - throw Error('Can only multibase decode strings') + while (num & vendor_varint_MSBALL) { + out[offset++] = (num & 0xFF) | vendor_varint_MSB; + num >>>= 7; } - } - - /** - * @template {string} OtherPrefix - * @param {API.UnibaseDecoder|ComposedDecoder} decoder - * @returns {ComposedDecoder} - */ - or (decoder) { - return ipfs_core_utils_node_modules_multiformats_src_bases_base_or(this, decoder) - } + out[offset] = num | 0; + // @ts-ignore + src_vendor_varint_encode.bytes = offset - oldOffset + 1; + return out; } - -/** - * @template {string} Prefix - * @typedef {Record>} Decoders - */ - +var src_vendor_varint_decode = vendor_varint_read; +var vendor_varint_MSB$1 = 0x80, vendor_varint_REST$1 = 0x7F; /** - * @template {string} Prefix - * @implements {API.MultibaseDecoder} - * @implements {API.CombobaseDecoder} + * @param {string | any[]} buf + * @param {number} offset */ -class ipfs_core_utils_node_modules_multiformats_src_bases_base_ComposedDecoder { - /** - * @param {Decoders} decoders - */ - constructor (decoders) { - this.decoders = decoders - } - - /** - * @template {string} OtherPrefix - * @param {API.UnibaseDecoder|ComposedDecoder} decoder - * @returns {ComposedDecoder} - */ - or (decoder) { - return ipfs_core_utils_node_modules_multiformats_src_bases_base_or(this, decoder) - } +function vendor_varint_read(buf, offset) { + var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length; + do { + if (counter >= l) { + // @ts-ignore + vendor_varint_read.bytes = 0; + throw new RangeError('Could not decode varint'); + } + b = buf[counter++]; + res += shift < 28 + ? (b & vendor_varint_REST$1) << shift + : (b & vendor_varint_REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= vendor_varint_MSB$1); + // @ts-ignore + vendor_varint_read.bytes = counter - offset; + return res; +} +var vendor_varint_N1 = Math.pow(2, 7); +var vendor_varint_N2 = Math.pow(2, 14); +var vendor_varint_N3 = Math.pow(2, 21); +var vendor_varint_N4 = Math.pow(2, 28); +var vendor_varint_N5 = Math.pow(2, 35); +var vendor_varint_N6 = Math.pow(2, 42); +var vendor_varint_N7 = Math.pow(2, 49); +var vendor_varint_N8 = Math.pow(2, 56); +var vendor_varint_N9 = Math.pow(2, 63); +var src_vendor_varint_length = function (/** @type {number} */ value) { + return (value < vendor_varint_N1 ? 1 + : value < vendor_varint_N2 ? 2 + : value < vendor_varint_N3 ? 3 + : value < vendor_varint_N4 ? 4 + : value < vendor_varint_N5 ? 5 + : value < vendor_varint_N6 ? 6 + : value < vendor_varint_N7 ? 7 + : value < vendor_varint_N8 ? 8 + : value < vendor_varint_N9 ? 9 + : 10); +}; +var src_vendor_varint_varint = { + encode: vendor_varint_encode_1, + decode: src_vendor_varint_decode, + encodingLength: src_vendor_varint_length +}; +var vendor_varint_brrp_varint = src_vendor_varint_varint; +/* harmony default export */ const dist_src_vendor_varint = (vendor_varint_brrp_varint); +//# sourceMappingURL=varint.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/varint.js - /** - * @param {string} input - * @returns {Uint8Array} - */ - decode (input) { - const prefix = /** @type {Prefix} */ (input[0]) - const decoder = this.decoders[prefix] - if (decoder) { - return decoder.decode(input) - } else { - throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`) - } - } +function multiformats_dist_src_varint_decode(data, offset = 0) { + const code = dist_src_vendor_varint.decode(data, offset); + return [code, dist_src_vendor_varint.decode.bytes]; +} +function src_varint_encodeTo(int, target, offset = 0) { + dist_src_vendor_varint.encode(int, target, offset); + return target; +} +function src_varint_encodingLength(int) { + return dist_src_vendor_varint.encodingLength(int); } +//# sourceMappingURL=varint.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/hashes/digest.js -/** - * @template {string} L - * @template {string} R - * @param {API.UnibaseDecoder|API.CombobaseDecoder} left - * @param {API.UnibaseDecoder|API.CombobaseDecoder} right - * @returns {ComposedDecoder} - */ -const ipfs_core_utils_node_modules_multiformats_src_bases_base_or = (left, right) => new ipfs_core_utils_node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({ - ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }), - ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right }) -})) /** - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseCodec} - * @implements {API.MultibaseEncoder} - * @implements {API.MultibaseDecoder} - * @implements {API.BaseCodec} - * @implements {API.BaseEncoder} - * @implements {API.BaseDecoder} + * Creates a multihash digest. */ -class ipfs_core_utils_node_modules_multiformats_src_bases_base_Codec { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(bytes:Uint8Array) => string} baseEncode - * @param {(text:string) => Uint8Array} baseDecode - */ - constructor (name, prefix, baseEncode, baseDecode) { - this.name = name - this.prefix = prefix - this.baseEncode = baseEncode - this.baseDecode = baseDecode - this.encoder = new ipfs_core_utils_node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode) - this.decoder = new ipfs_core_utils_node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode) - } - - /** - * @param {Uint8Array} input - */ - encode (input) { - return this.encoder.encode(input) - } - - /** - * @param {string} input - */ - decode (input) { - return this.decoder.decode(input) - } +function src_hashes_digest_create(code, digest) { + const size = digest.byteLength; + const sizeOffset = src_varint_encodingLength(code); + const digestOffset = sizeOffset + src_varint_encodingLength(size); + const bytes = new Uint8Array(digestOffset + size); + src_varint_encodeTo(code, bytes, 0); + src_varint_encodeTo(size, bytes, sizeOffset); + bytes.set(digest, digestOffset); + return new src_hashes_digest_Digest(code, size, digest, bytes); } - /** - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {(bytes:Uint8Array) => string} options.encode - * @param {(input:string) => Uint8Array} options.decode - * @returns {Codec} + * Turns bytes representation of multihash digest into an instance. */ -const ipfs_core_utils_node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) => - new ipfs_core_utils_node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode) - +function src_hashes_digest_decode(multihash) { + const bytes = dist_src_bytes_coerce(multihash); + const [code, sizeOffset] = multiformats_dist_src_varint_decode(bytes); + const [size, digestOffset] = multiformats_dist_src_varint_decode(bytes.subarray(sizeOffset)); + const digest = bytes.subarray(sizeOffset + digestOffset); + if (digest.byteLength !== size) { + throw new Error('Incorrect length'); + } + return new src_hashes_digest_Digest(code, size, digest, bytes); +} +function src_hashes_digest_equals(a, b) { + if (a === b) { + return true; + } + else { + const data = b; + return (a.code === data.code && + a.size === data.size && + data.bytes instanceof Uint8Array && + src_bytes_equals(a.bytes, data.bytes)); + } +} /** - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {string} options.alphabet - * @returns {Codec} + * Represents a multihash digest which carries information about the + * hashing algorithm and an actual hash digest. */ -const ipfs_core_utils_node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => { - const { encode, decode } = ipfs_core_utils_node_modules_multiformats_vendor_base_x(alphabet, name) - return ipfs_core_utils_node_modules_multiformats_src_bases_base_from({ - prefix, - name, - encode, +class src_hashes_digest_Digest { + code; + size; + digest; + bytes; /** - * @param {string} text + * Creates a multihash digest. */ - decode: text => ipfs_core_utils_node_modules_multiformats_src_bytes_coerce(decode(text)) - }) + constructor(code, size, digest, bytes) { + this.code = code; + this.size = size; + this.digest = digest; + this.bytes = bytes; + } } +//# sourceMappingURL=digest.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/cid.js -/** - * @param {string} string - * @param {string} alphabet - * @param {number} bitsPerChar - * @param {string} name - * @returns {Uint8Array} - */ -const ipfs_core_utils_node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { - // Build the character lookup table: - /** @type {Record} */ - const codes = {} - for (let i = 0; i < alphabet.length; ++i) { - codes[alphabet[i]] = i - } - // Count the padding bytes: - let end = string.length - while (string[end - 1] === '=') { - --end - } - // Allocate the output: - const out = new Uint8Array((end * bitsPerChar / 8) | 0) - // Parse the data: - let bits = 0 // Number of bits currently in the buffer - let buffer = 0 // Bits waiting to be written out, MSB first - let written = 0 // Next byte to write - for (let i = 0; i < end; ++i) { - // Read one character from the string: - const value = codes[string[i]] - if (value === undefined) { - throw new SyntaxError(`Non-${name} character`) - } - // Append the bits to the buffer: - buffer = (buffer << bitsPerChar) | value - bits += bitsPerChar +// This way TS will also expose all the types from module - // Write out some bits if the buffer has a byte's worth: - if (bits >= 8) { - bits -= 8 - out[written++] = 0xff & (buffer >> bits) +function src_cid_format(link, base) { + const { bytes, version } = link; + switch (version) { + case 0: + return src_cid_toStringV0(bytes, src_cid_baseCache(link), base ?? src_bases_base58_base58btc.encoder); + default: + return src_cid_toStringV1(bytes, src_cid_baseCache(link), (base ?? src_bases_base32_base32.encoder)); } - } - - // Verify that we have received just enough bits: - if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) { - throw new SyntaxError('Unexpected end of data') - } - - return out } - -/** - * @param {Uint8Array} data - * @param {string} alphabet - * @param {number} bitsPerChar - * @returns {string} - */ -const ipfs_core_utils_node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => { - const pad = alphabet[alphabet.length - 1] === '=' - const mask = (1 << bitsPerChar) - 1 - let out = '' - - let bits = 0 // Number of bits currently in the buffer - let buffer = 0 // Bits waiting to be written out, MSB first - for (let i = 0; i < data.length; ++i) { - // Slurp data into the buffer: - buffer = (buffer << 8) | data[i] - bits += 8 - - // Write out as much as we can: - while (bits > bitsPerChar) { - bits -= bitsPerChar - out += alphabet[mask & (buffer >> bits)] +function src_cid_toJSON(link) { + return { + '/': src_cid_format(link) + }; +} +function src_cid_fromJSON(json) { + return dist_src_cid_CID.parse(json['/']); +} +const src_cid_cache = new WeakMap(); +function src_cid_baseCache(cid) { + const baseCache = src_cid_cache.get(cid); + if (baseCache == null) { + const baseCache = new Map(); + src_cid_cache.set(cid, baseCache); + return baseCache; } - } - - // Partial character: - if (bits) { - out += alphabet[mask & (buffer << (bitsPerChar - bits))] - } - - // Add padding characters until we hit a byte boundary: - if (pad) { - while ((out.length * bitsPerChar) & 7) { - out += '=' + return baseCache; +} +class dist_src_cid_CID { + code; + version; + multihash; + bytes; + '/'; + /** + * @param version - Version of the CID + * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param multihash - (Multi)hash of the of the content. + */ + constructor(version, code, multihash, bytes) { + this.code = code; + this.version = version; + this.multihash = multihash; + this.bytes = bytes; + // flag to serializers that this is a CID and + // should be treated specially + this['/'] = bytes; } - } - - return out + /** + * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` + * please either use `CID.asCID(cid)` or switch to new signalling mechanism + * + * @deprecated + */ + get asCID() { + return this; + } + // ArrayBufferView + get byteOffset() { + return this.bytes.byteOffset; + } + // ArrayBufferView + get byteLength() { + return this.bytes.byteLength; + } + toV0() { + switch (this.version) { + case 0: { + return this; + } + case 1: { + const { code, multihash } = this; + if (code !== src_cid_DAG_PB_CODE) { + throw new Error('Cannot convert a non dag-pb CID to CIDv0'); + } + // sha2-256 + if (multihash.code !== src_cid_SHA_256_CODE) { + throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0'); + } + return (dist_src_cid_CID.createV0(multihash)); + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`); + } + } + } + toV1() { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash; + const multihash = src_hashes_digest_create(code, digest); + return (dist_src_cid_CID.createV1(this.code, multihash)); + } + case 1: { + return this; + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`); + } + } + } + equals(other) { + return dist_src_cid_CID.equals(this, other); + } + static equals(self, other) { + const unknown = other; + return (unknown != null && + self.code === unknown.code && + self.version === unknown.version && + src_hashes_digest_equals(self.multihash, unknown.multihash)); + } + toString(base) { + return src_cid_format(this, base); + } + toJSON() { + return { '/': src_cid_format(this) }; + } + link() { + return this; + } + [Symbol.toStringTag] = 'CID'; + // Legacy + [Symbol.for('nodejs.util.inspect.custom')]() { + return `CID(${this.toString()})`; + } + /** + * Takes any input `value` and returns a `CID` instance if it was + * a `CID` otherwise returns `null`. If `value` is instanceof `CID` + * it will return value back. If `value` is not instance of this CID + * class, but is compatible CID it will return new instance of this + * `CID` class. Otherwise returns null. + * + * This allows two different incompatible versions of CID library to + * co-exist and interop as long as binary interface is compatible. + */ + static asCID(input) { + if (input == null) { + return null; + } + const value = input; + if (value instanceof dist_src_cid_CID) { + // If value is instance of CID then we're all set. + return value; + } + else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { + // If value isn't instance of this CID class but `this.asCID === this` or + // `value['/'] === value.bytes` is true it is CID instance coming from a + // different implementation (diff version or duplicate). In that case we + // rebase it to this `CID` implementation so caller is guaranteed to get + // instance with expected API. + const { version, code, multihash, bytes } = value; + return new dist_src_cid_CID(version, code, multihash, bytes ?? src_cid_encodeCID(version, code, multihash.bytes)); + } + else if (value[src_cid_cidSymbol] === true) { + // If value is a CID from older implementation that used to be tagged via + // symbol we still rebase it to the this `CID` implementation by + // delegating that to a constructor. + const { version, multihash, code } = value; + const digest = src_hashes_digest_decode(multihash); + return dist_src_cid_CID.create(version, code, digest); + } + else { + // Otherwise value is not a CID (or an incompatible version of it) in + // which case we return `null`. + return null; + } + } + /** + * @param version - Version of the CID + * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param digest - (Multi)hash of the of the content. + */ + static create(version, code, digest) { + if (typeof code !== 'number') { + throw new Error('String codecs are no longer supported'); + } + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error('Invalid digest'); + } + switch (version) { + case 0: { + if (code !== src_cid_DAG_PB_CODE) { + throw new Error(`Version 0 CID must use dag-pb (code: ${src_cid_DAG_PB_CODE}) block encoding`); + } + else { + return new dist_src_cid_CID(version, code, digest, digest.bytes); + } + } + case 1: { + const bytes = src_cid_encodeCID(version, code, digest.bytes); + return new dist_src_cid_CID(version, code, digest, bytes); + } + default: { + throw new Error('Invalid version'); + } + } + } + /** + * Simplified version of `create` for CIDv0. + */ + static createV0(digest) { + return dist_src_cid_CID.create(0, src_cid_DAG_PB_CODE, digest); + } + /** + * Simplified version of `create` for CIDv1. + * + * @param code - Content encoding format code. + * @param digest - Multihash of the content. + */ + static createV1(code, digest) { + return dist_src_cid_CID.create(1, code, digest); + } + /** + * Decoded a CID from its binary representation. The byte array must contain + * only the CID with no additional bytes. + * + * An error will be thrown if the bytes provided do not contain a valid + * binary representation of a CID. + */ + static decode(bytes) { + const [cid, remainder] = dist_src_cid_CID.decodeFirst(bytes); + if (remainder.length !== 0) { + throw new Error('Incorrect length'); + } + return cid; + } + /** + * Decoded a CID from its binary representation at the beginning of a byte + * array. + * + * Returns an array with the first element containing the CID and the second + * element containing the remainder of the original byte array. The remainder + * will be a zero-length byte array if the provided bytes only contained a + * binary CID representation. + */ + static decodeFirst(bytes) { + const specs = dist_src_cid_CID.inspectBytes(bytes); + const prefixSize = specs.size - specs.multihashSize; + const multihashBytes = dist_src_bytes_coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize)); + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error('Incorrect length'); + } + const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize); + const digest = new src_hashes_digest_Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); + const cid = specs.version === 0 + ? dist_src_cid_CID.createV0(digest) + : dist_src_cid_CID.createV1(specs.codec, digest); + return [cid, bytes.subarray(specs.size)]; + } + /** + * Inspect the initial bytes of a CID to determine its properties. + * + * Involves decoding up to 4 varints. Typically this will require only 4 to 6 + * bytes but for larger multicodec code values and larger multihash digest + * lengths these varints can be quite large. It is recommended that at least + * 10 bytes be made available in the `initialBytes` argument for a complete + * inspection. + */ + static inspectBytes(initialBytes) { + let offset = 0; + const next = () => { + const [i, length] = multiformats_dist_src_varint_decode(initialBytes.subarray(offset)); + offset += length; + return i; + }; + let version = next(); + let codec = src_cid_DAG_PB_CODE; + if (version === 18) { + // CIDv0 + version = 0; + offset = 0; + } + else { + codec = next(); + } + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`); + } + const prefixSize = offset; + const multihashCode = next(); // multihash code + const digestSize = next(); // multihash length + const size = offset + digestSize; + const multihashSize = size - prefixSize; + return { version, codec, multihashCode, digestSize, multihashSize, size }; + } + /** + * Takes cid in a string representation and creates an instance. If `base` + * decoder is not provided will use a default from the configuration. It will + * throw an error if encoding of the CID is not compatible with supplied (or + * a default decoder). + */ + static parse(source, base) { + const [prefix, bytes] = src_cid_parseCIDtoBytes(source, base); + const cid = dist_src_cid_CID.decode(bytes); + if (cid.version === 0 && source[0] !== 'Q') { + throw Error('Version 0 CID string must not include multibase prefix'); + } + // Cache string representation to avoid computing it on `this.toString()` + src_cid_baseCache(cid).set(prefix, source); + return cid; + } +} +function src_cid_parseCIDtoBytes(source, base) { + switch (source[0]) { + // CIDv0 is parsed differently + case 'Q': { + const decoder = base ?? src_bases_base58_base58btc; + return [ + src_bases_base58_base58btc.prefix, + decoder.decode(`${src_bases_base58_base58btc.prefix}${source}`) + ]; + } + case src_bases_base58_base58btc.prefix: { + const decoder = base ?? src_bases_base58_base58btc; + return [src_bases_base58_base58btc.prefix, decoder.decode(source)]; + } + case src_bases_base32_base32.prefix: { + const decoder = base ?? src_bases_base32_base32; + return [src_bases_base32_base32.prefix, decoder.decode(source)]; + } + default: { + if (base == null) { + throw Error('To parse non base32 or base58btc encoded CID multibase decoder must be provided'); + } + return [source[0], base.decode(source)]; + } + } +} +function src_cid_toStringV0(bytes, cache, base) { + const { prefix } = base; + if (prefix !== src_bases_base58_base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base.name} encoding`); + } + const cid = cache.get(prefix); + if (cid == null) { + const cid = base.encode(bytes).slice(1); + cache.set(prefix, cid); + return cid; + } + else { + return cid; + } +} +function src_cid_toStringV1(bytes, cache, base) { + const { prefix } = base; + const cid = cache.get(prefix); + if (cid == null) { + const cid = base.encode(bytes); + cache.set(prefix, cid); + return cid; + } + else { + return cid; + } +} +const src_cid_DAG_PB_CODE = 0x70; +const src_cid_SHA_256_CODE = 0x12; +function src_cid_encodeCID(version, code, multihash) { + const codeOffset = src_varint_encodingLength(version); + const hashOffset = codeOffset + src_varint_encodingLength(code); + const bytes = new Uint8Array(hashOffset + multihash.byteLength); + src_varint_encodeTo(version, bytes, 0); + src_varint_encodeTo(code, bytes, codeOffset); + bytes.set(multihash, hashOffset); + return bytes; } +const src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID'); +//# sourceMappingURL=cid.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/hashes/hasher.js +function hasher_from({ name, code, encode }) { + return new Hasher(name, code, encode); +} /** - * RFC4648 Factory - * - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {string} options.alphabet - * @param {number} options.bitsPerChar + * Hasher represents a hashing algorithm implementation that produces as + * `MultihashDigest`. */ -const ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { - return ipfs_core_utils_node_modules_multiformats_src_bases_base_from({ - prefix, - name, - encode (input) { - return ipfs_core_utils_node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar) - }, - decode (input) { - return ipfs_core_utils_node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name) +class Hasher { + name; + code; + encode; + constructor(name, code, encode) { + this.name = name; + this.code = code; + this.encode = encode; + } + digest(input) { + if (input instanceof Uint8Array) { + const result = this.encode(input); + return result instanceof Uint8Array + ? Digest.create(this.code, result) + /* c8 ignore next 1 */ + : result.then(digest => Digest.create(this.code, digest)); + } + else { + throw Error('Unknown type, must be binary type'); + /* c8 ignore next 1 */ + } } - }) } +//# sourceMappingURL=hasher.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/index.js +/** + * @packageDocumentation + * + * This library defines common interfaces and low level building blocks for various interrelated multiformat technologies (multicodec, multihash, multibase, and CID). They can be used to implement custom base encoders / decoders / codecs, codec encoders /decoders and multihash hashers that comply to the interface that layers above assume. + * + * This library provides implementations for most basics and many others can be found in linked repositories. + * + * ```TypeScript + * import { CID } from 'multiformats/cid' + * import * as json from 'multiformats/codecs/json' + * import { sha256 } from 'multiformats/hashes/sha2' + * + * const bytes = json.encode({ hello: 'world' }) + * + * const hash = await sha256.digest(bytes) + * const cid = CID.create(1, json.code, hash) + * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) + * ``` + * + * ## Creating Blocks + * + * ```TypeScript + * import * as Block from 'multiformats/block' + * import * as codec from '@ipld/dag-cbor' + * import { sha256 as hasher } from 'multiformats/hashes/sha2' + * + * const value = { hello: 'world' } + * + * // encode a block + * let block = await Block.encode({ value, codec, hasher }) + * + * block.value // { hello: 'world' } + * block.bytes // Uint8Array + * block.cid // CID() w/ sha2-256 hash address and dag-cbor codec + * + * // you can also decode blocks from their binary state + * block = await Block.decode({ bytes: block.bytes, codec, hasher }) + * + * // if you have the cid you can also verify the hash on decode + * block = await Block.create({ bytes: block.bytes, cid: block.cid, codec, hasher }) + * ``` + * + * ## Multibase Encoders / Decoders / Codecs + * + * CIDs can be serialized to string representation using multibase encoders that implement [`MultibaseEncoder`](https://github.com/multiformats/js-multiformats/blob/master/src/bases/interface.ts) interface. This library provides quite a few implementations that can be imported: + * + * ```TypeScript + * import { base64 } from "multiformats/bases/base64" + * cid.toString(base64.encoder) + * //> 'mAYAEEiCTojlxqRTl6svwqNJRVM2jCcPBxy+7mRTUfGDzy2gViA' + * ``` + * + * Parsing CID string serialized CIDs requires multibase decoder that implements [`MultibaseDecoder`](https://github.com/multiformats/js-multiformats/blob/master/src/bases/interface.ts) interface. This library provides a decoder for every encoder it provides: + * + * ```TypeScript + * CID.parse('mAYAEEiCTojlxqRTl6svwqNJRVM2jCcPBxy+7mRTUfGDzy2gViA', base64.decoder) + * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) + * ``` + * + * Dual of multibase encoder & decoder is defined as multibase codec and it exposes + * them as `encoder` and `decoder` properties. For added convenience codecs also + * implement `MultibaseEncoder` and `MultibaseDecoder` interfaces so they could be + * used as either or both: + * + * ```TypeScript + * cid.toString(base64) + * CID.parse(cid.toString(base64), base64) + * ``` + * + * **Note:** CID implementation comes bundled with `base32` and `base58btc` + * multibase codecs so that CIDs can be base serialized to (version specific) + * default base encoding and parsed without having to supply base encoders/decoders: + * + * ```TypeScript + * const v1 = CID.parse('bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea') + * v1.toString() + * //> 'bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea' + * + * const v0 = CID.parse('QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n') + * v0.toString() + * //> 'QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n' + * v0.toV1().toString() + * //> 'bafybeihdwdcefgh4dqkjv67uzcmw7ojee6xedzdetojuzjevtenxquvyku' + * ``` + * + * ## Multicodec Encoders / Decoders / Codecs + * + * This library defines [`BlockEncoder`, `BlockDecoder` and `BlockCodec` interfaces](https://github.com/multiformats/js-multiformats/blob/master/src/codecs/interface.ts). + * Codec implementations should conform to the `BlockCodec` interface which implements both `BlockEncoder` and `BlockDecoder`. + * Here is an example implementation of JSON `BlockCodec`. + * + * ```TypeScript + * export const { name, code, encode, decode } = { + * name: 'json', + * code: 0x0200, + * encode: json => new TextEncoder().encode(JSON.stringify(json)), + * decode: bytes => JSON.parse(new TextDecoder().decode(bytes)) + * } + * ``` + * + * ## Multihash Hashers + * + * This library defines [`MultihashHasher` and `MultihashDigest` interfaces](https://github.com/multiformats/js-multiformats/blob/master/src/hashes/interface.ts) and convinient function for implementing them: + * + * ```TypeScript + * import * as hasher from 'multiformats/hashes/hasher' + * + * const sha256 = hasher.from({ + * // As per multiformats table + * // https://github.com/multiformats/multicodec/blob/master/table.csv#L9 + * name: 'sha2-256', + * code: 0x12, + * + * encode: (input) => new Uint8Array(crypto.createHash('sha256').update(input).digest()) + * }) + * + * const hash = await sha256.digest(json.encode({ hello: 'world' })) + * CID.create(1, json.code, hash) + * + * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) + * ``` + * + * ## Traversal + * + * This library contains higher-order functions for traversing graphs of data easily. + * + * `walk()` walks through the links in each block of a DAG calling a user-supplied loader function for each one, in depth-first order with no duplicate block visits. The loader should return a `Block` object and can be used to inspect and collect block ordering for a full DAG walk. The loader should `throw` on error, and return `null` if a block should be skipped by `walk()`. + * + * ```TypeScript + * import { walk } from 'multiformats/traversal' + * import * as Block from 'multiformats/block' + * import * as codec from 'multiformats/codecs/json' + * import { sha256 as hasher } from 'multiformats/hashes/sha2' + * + * // build a DAG (a single block for this simple example) + * const value = { hello: 'world' } + * const block = await Block.encode({ value, codec, hasher }) + * const { cid } = block + * console.log(cid) + * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) + * + * // create a loader function that also collects CIDs of blocks in + * // their traversal order + * const load = (cid, blocks) => async (cid) => { + * // fetch a block using its cid + * // e.g.: const block = await fetchBlockByCID(cid) + * blocks.push(cid) + * return block + * } + * + * // collect blocks in this DAG starting from the root `cid` + * const blocks = [] + * await walk({ cid, load: load(cid, blocks) }) + * + * console.log(blocks) + * //> [CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea)] + * ``` + * + * ## Legacy interface + * + * [`blockcodec-to-ipld-format`](https://github.com/ipld/js-blockcodec-to-ipld-format) converts a multiformats [`BlockCodec`](https://github.com/multiformats/js-multiformats/blob/master/src/codecs/interface.ts#L21) into an + * [`interface-ipld-format`](https://github.com/ipld/interface-ipld-format) for use with the [`ipld`](https://github.com/ipld/ipld) package. This can help bridge IPLD codecs implemented using the structure and interfaces defined here to existing code that assumes, or requires `interface-ipld-format`. This bridge also includes the relevant TypeScript definitions. + * + * ## Implementations + * + * By default, no base encodings (other than base32 & base58btc), hash functions, + * or codec implementations are exposed by `multiformats`, you need to + * import the ones you need yourself. + * + * ### Multibase codecs + * + * | bases | import | repo | + * | ------------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------- | + * | `base16` | `multiformats/bases/base16` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | + * | `base32`, `base32pad`, `base32hex`, `base32hexpad`, `base32z` | `multiformats/bases/base32` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | + * | `base64`, `base64pad`, `base64url`, `base64urlpad` | `multiformats/bases/base64` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | + * | `base58btc`, `base58flick4` | `multiformats/bases/base58` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | + * + * Other (less useful) bases implemented in [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) include: `base2`, `base8`, `base10`, `base36` and `base256emoji`. + * + * ### Multihash hashers + * + * | hashes | import | repo | + * | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------ | + * | `sha2-256`, `sha2-512` | `multiformats/hashes/sha2` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/hashes) | + * | `sha3-224`, `sha3-256`, `sha3-384`,`sha3-512`, `shake-128`, `shake-256`, `keccak-224`, `keccak-256`, `keccak-384`, `keccak-512` | `@multiformats/sha3` | [multiformats/js-sha3](https://github.com/multiformats/js-sha3) | + * | `identity` | `multiformats/hashes/identity` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/hashes/identity.js) | + * | `murmur3-128`, `murmur3-32` | `@multiformats/murmur3` | [multiformats/js-murmur3](https://github.com/multiformats/js-murmur3) | + * | `blake2b-*`, `blake2s-*` | `@multiformats/blake2` | [multiformats/js-blake2](https://github.com/multiformats/js-blake2) | + * + * ### IPLD codecs (multicodec) + * + * | codec | import | repo | + * | ---------- | -------------------------- | ------------------------------------------------------------------------------------------------------ | + * | `raw` | `multiformats/codecs/raw` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/codecs) | + * | `json` | `multiformats/codecs/json` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/codecs) | + * | `dag-cbor` | `@ipld/dag-cbor` | [ipld/js-dag-cbor](https://github.com/ipld/js-dag-cbor) | + * | `dag-json` | `@ipld/dag-json` | [ipld/js-dag-json](https://github.com/ipld/js-dag-json) | + * | `dag-pb` | `@ipld/dag-pb` | [ipld/js-dag-pb](https://github.com/ipld/js-dag-pb) | + * | `dag-jose` | `dag-jose` | [ceramicnetwork/js-dag-jose](https://github.com/ceramicnetwork/js-dag-jose) | + */ -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base58.js - - -const ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc = ipfs_core_utils_node_modules_multiformats_src_bases_base_baseX({ - name: 'base58btc', - prefix: 'z', - alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -}) - -const ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58flickr = ipfs_core_utils_node_modules_multiformats_src_bases_base_baseX({ - name: 'base58flickr', - prefix: 'Z', - alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -}) - -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base32.js - - -const ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32 = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'b', - name: 'base32', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567', - bitsPerChar: 5 -}) - -const ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32upper = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'B', - name: 'base32upper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', - bitsPerChar: 5 -}) - -const ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32pad = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'c', - name: 'base32pad', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', - bitsPerChar: 5 -}) - -const ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32padupper = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'C', - name: 'base32padupper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', - bitsPerChar: 5 -}) - -const ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32hex = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'v', - name: 'base32hex', - alphabet: '0123456789abcdefghijklmnopqrstuv', - bitsPerChar: 5 -}) - -const ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32hexupper = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'V', - name: 'base32hexupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', - bitsPerChar: 5 -}) -const ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32hexpad = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 't', - name: 'base32hexpad', - alphabet: '0123456789abcdefghijklmnopqrstuv=', - bitsPerChar: 5 -}) -const ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32hexpadupper = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'T', - name: 'base32hexpadupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', - bitsPerChar: 5 -}) -const ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32z = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'h', - name: 'base32z', - alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', - bitsPerChar: 5 -}) -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/cid.js +// This way TS will also expose all the types from module +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/node_modules/multiformats/dist/src/bases/base64.js +const base64 = bases_base_rfc4648({ + prefix: 'm', + name: 'base64', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + bitsPerChar: 6 +}); +const base64pad = bases_base_rfc4648({ + prefix: 'M', + name: 'base64pad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', + bitsPerChar: 6 +}); +const base64url = bases_base_rfc4648({ + prefix: 'u', + name: 'base64url', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', + bitsPerChar: 6 +}); +const base64urlpad = bases_base_rfc4648({ + prefix: 'U', + name: 'base64urlpad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', + bitsPerChar: 6 +}); +//# sourceMappingURL=base64.js.map +;// CONCATENATED MODULE: ./node_modules/@ipld/dag-json/src/index.js +/* eslint max-depth: ["error", 7] */ -// Linter can see that API is used in types. -// eslint-disable-next-line -// This way TS will also expose all the types from module +/** + * @template T + * @typedef {import('multiformats/codecs/interface').ByteView} ByteView + */ +/** + * @template T + * @typedef {import('multiformats').ToString} ToString + */ +/** + * @typedef {import('cborg/interface').DecodeTokenizer} DecodeTokenizer + */ /** - * @template {API.Link} T - * @template {string} Prefix - * @param {T} link - * @param {API.MultibaseEncoder} [base] - * @returns {API.ToString} + * cidEncoder will receive all Objects during encode, it needs to filter out + * anything that's not a CID and return `null` for that so it's encoded as + * normal. Encoding a CID means replacing it with a `{"/":"}` + * object as per the DAG-JSON spec. + * + * @param {any} obj + * @returns {Token[]|null} */ -const ipfs_core_utils_node_modules_multiformats_src_cid_format = (link, base) => { - const { bytes, version } = link - switch (version) { - case 0: - return ipfs_core_utils_node_modules_multiformats_src_cid_toStringV0( - bytes, - ipfs_core_utils_node_modules_multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder<"z">} */ (base) || ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc.encoder - ) - default: - return ipfs_core_utils_node_modules_multiformats_src_cid_toStringV1( - bytes, - ipfs_core_utils_node_modules_multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder} */ (base || ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32.encoder) - ) +function src_cidEncoder (obj) { + if (obj.asCID !== obj && obj['/'] !== obj.bytes) { + return null // any other kind of object + } + const cid = dist_src_cid_CID.asCID(obj) + /* c8 ignore next 4 */ + // very unlikely case, and it'll probably throw a recursion error in cborg + if (!cid) { + return null } + const cidString = cid.toString() + + return [ + new token_Token(token_Type.map, Infinity, 1), + new token_Token(token_Type.string, '/', 1), // key + new token_Token(token_Type.string, cidString, cidString.length), // value + new token_Token(token_Type["break"], undefined, 1) + ] } /** - * @template {API.UnknownLink} Link - * @param {Link} link - * @returns {API.LinkJSON} + * bytesEncoder will receive all Uint8Arrays (and friends) during encode, it + * needs to replace it with a `{"/":{"bytes":"Base64ByteString"}}` object as + * per the DAG-JSON spec. + * + * @param {Uint8Array} bytes + * @returns {Token[]|null} */ -const ipfs_core_utils_node_modules_multiformats_src_cid_toJSON = (link) => ({ - '/': ipfs_core_utils_node_modules_multiformats_src_cid_format(link) -}) +function bytesEncoder (bytes) { + const bytesString = base64.encode(bytes).slice(1) // no mbase prefix + return [ + new token_Token(token_Type.map, Infinity, 1), + new token_Token(token_Type.string, '/', 1), // key + new token_Token(token_Type.map, Infinity, 1), // value + new token_Token(token_Type.string, 'bytes', 5), // inner key + new token_Token(token_Type.string, bytesString, bytesString.length), // inner value + new token_Token(token_Type["break"], undefined, 1), + new token_Token(token_Type["break"], undefined, 1) + ] +} /** - * @template {API.UnknownLink} Link - * @param {API.LinkJSON} json + * taBytesEncoder wraps bytesEncoder() but for the more exotic typed arrays so + * that we access the underlying ArrayBuffer data + * + * @param {Int8Array|Uint16Array|Int16Array|Uint32Array|Int32Array|Float32Array|Float64Array|Uint8ClampedArray|BigInt64Array|BigUint64Array} obj + * @returns {Token[]|null} */ -const ipfs_core_utils_node_modules_multiformats_src_cid_fromJSON = (json) => - ipfs_core_utils_node_modules_multiformats_src_cid_CID.parse(json['/']) - -/** @type {WeakMap>} */ -const ipfs_core_utils_node_modules_multiformats_src_cid_cache = new WeakMap() +function taBytesEncoder (obj) { + return bytesEncoder(new Uint8Array(obj.buffer, obj.byteOffset, obj.byteLength)) +} /** - * @param {API.UnknownLink} cid - * @returns {Map} + * abBytesEncoder wraps bytesEncoder() but for plain ArrayBuffers + * + * @param {ArrayBuffer} ab + * @returns {Token[]|null} */ -const ipfs_core_utils_node_modules_multiformats_src_cid_baseCache = cid => { - const baseCache = ipfs_core_utils_node_modules_multiformats_src_cid_cache.get(cid) - if (baseCache == null) { - const baseCache = new Map() - ipfs_core_utils_node_modules_multiformats_src_cid_cache.set(cid, baseCache) - return baseCache - } - return baseCache +function abBytesEncoder (ab) { + return bytesEncoder(new Uint8Array(ab)) } +// eslint-disable-next-line jsdoc/require-returns-check /** - * @template {unknown} [Data=unknown] - * @template {number} [Format=number] - * @template {number} [Alg=number] - * @template {API.Version} [Version=API.Version] - * @implements {API.Link} + * Intercept all `undefined` values from an object walk and reject the entire + * object if we find one. + * + * @returns {null} */ +function src_undefinedEncoder () { + throw new Error('`undefined` is not supported by the IPLD Data Model and cannot be encoded') +} -class ipfs_core_utils_node_modules_multiformats_src_cid_CID { - /** - * @param {Version} version - Version of the CID - * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content. - * @param {Uint8Array} bytes - * - */ - constructor (version, code, multihash, bytes) { - /** @readonly */ - this.code = code - /** @readonly */ - this.version = version - /** @readonly */ - this.multihash = multihash - /** @readonly */ - this.bytes = bytes - - // flag to serializers that this is a CID and - // should be treated specially - /** @readonly */ - this['/'] = bytes - } - - /** - * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` - * please either use `CID.asCID(cid)` or switch to new signalling mechanism - * - * @deprecated - */ - get asCID () { - return this - } - - // ArrayBufferView - get byteOffset () { - return this.bytes.byteOffset - } - - // ArrayBufferView - get byteLength () { - return this.bytes.byteLength - } - - /** - * @returns {CID} - */ - toV0 () { - switch (this.version) { - case 0: { - return /** @type {CID} */ (this) - } - case 1: { - const { code, multihash } = this - - if (code !== ipfs_core_utils_node_modules_multiformats_src_cid_DAG_PB_CODE) { - throw new Error('Cannot convert a non dag-pb CID to CIDv0') - } - - // sha2-256 - if (multihash.code !== ipfs_core_utils_node_modules_multiformats_src_cid_SHA_256_CODE) { - throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') - } - - return /** @type {CID} */ ( - ipfs_core_utils_node_modules_multiformats_src_cid_CID.createV0( - /** @type {API.MultihashDigest} */ (multihash) - ) - ) - } - default: { - throw Error( - `Can not convert CID version ${this.version} to version 0. This is a bug please report` - ) - } - } +/** + * Intercept all `number` values from an object walk and reject the entire + * object if we find something that doesn't fit the IPLD data model (NaN & + * Infinity). + * + * @param {number} num + * @returns {null} + */ +function src_numberEncoder (num) { + if (Number.isNaN(num)) { + throw new Error('`NaN` is not supported by the IPLD Data Model and cannot be encoded') } - - /** - * @returns {CID} - */ - toV1 () { - switch (this.version) { - case 0: { - const { code, digest } = this.multihash - const multihash = ipfs_core_utils_node_modules_multiformats_src_hashes_digest_create(code, digest) - return /** @type {CID} */ ( - ipfs_core_utils_node_modules_multiformats_src_cid_CID.createV1(this.code, multihash) - ) - } - case 1: { - return /** @type {CID} */ (this) - } - default: { - throw Error( - `Can not convert CID version ${this.version} to version 1. This is a bug please report` - ) - } - } + if (num === Infinity || num === -Infinity) { + throw new Error('`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded') } + return null // process with standard number encoder +} - /** - * @param {unknown} other - * @returns {other is CID} - */ - equals (other) { - return ipfs_core_utils_node_modules_multiformats_src_cid_CID.equals(this, other) +const src_encodeOptions = { + typeEncoders: { + Object: src_cidEncoder, + Buffer: bytesEncoder, + Uint8Array: bytesEncoder, + Int8Array: taBytesEncoder, + Uint16Array: taBytesEncoder, + Int16Array: taBytesEncoder, + Uint32Array: taBytesEncoder, + Int32Array: taBytesEncoder, + Float32Array: taBytesEncoder, + Float64Array: taBytesEncoder, + Uint8ClampedArray: taBytesEncoder, + BigInt64Array: taBytesEncoder, + BigUint64Array: taBytesEncoder, + DataView: taBytesEncoder, + ArrayBuffer: abBytesEncoder, + undefined: src_undefinedEncoder, + number: src_numberEncoder } +} +/** + * @implements {DecodeTokenizer} + */ +class DagJsonTokenizer extends Tokenizer { /** - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @param {API.Link} self - * @param {unknown} other - * @returns {other is CID} + * @param {Uint8Array} data + * @param {object} [options] */ - static equals (self, other) { - const unknown = - /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ ( - other - ) - return ( - unknown && - self.code === unknown.code && - self.version === unknown.version && - ipfs_core_utils_node_modules_multiformats_src_hashes_digest_equals(self.multihash, unknown.multihash) - ) + constructor (data, options) { + super(data, options) + /** @type {Token[]} */ + this.tokenBuffer = [] } /** - * @param {API.MultibaseEncoder} [base] - * @returns {string} + * @returns {boolean} */ - toString (base) { - return ipfs_core_utils_node_modules_multiformats_src_cid_format(this, base) - } - - toJSON () { - return { '/': ipfs_core_utils_node_modules_multiformats_src_cid_format(this) } - } - - link () { - return this - } - - get [Symbol.toStringTag] () { - return 'CID' - } - - // Legacy - - [Symbol.for('nodejs.util.inspect.custom')] () { - return `CID(${this.toString()})` + done () { + return this.tokenBuffer.length === 0 && super.done() } /** - * Takes any input `value` and returns a `CID` instance if it was - * a `CID` otherwise returns `null`. If `value` is instanceof `CID` - * it will return value back. If `value` is not instance of this CID - * class, but is compatible CID it will return new instance of this - * `CID` class. Otherwise returns null. - * - * This allows two different incompatible versions of CID library to - * co-exist and interop as long as binary interface is compatible. - * - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @template {unknown} U - * @param {API.Link|U} input - * @returns {CID|null} + * @returns {Token} */ - static asCID (input) { - if (input == null) { - return null - } - - const value = /** @type {any} */ (input) - if (value instanceof ipfs_core_utils_node_modules_multiformats_src_cid_CID) { - // If value is instance of CID then we're all set. - return value - } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { - // If value isn't instance of this CID class but `this.asCID === this` or - // `value['/'] === value.bytes` is true it is CID instance coming from a - // different implementation (diff version or duplicate). In that case we - // rebase it to this `CID` implementation so caller is guaranteed to get - // instance with expected API. - const { version, code, multihash, bytes } = value - return new ipfs_core_utils_node_modules_multiformats_src_cid_CID( - version, - code, - /** @type {API.MultihashDigest} */ (multihash), - bytes || ipfs_core_utils_node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes) - ) - } else if (value[ipfs_core_utils_node_modules_multiformats_src_cid_cidSymbol] === true) { - // If value is a CID from older implementation that used to be tagged via - // symbol we still rebase it to the this `CID` implementation by - // delegating that to a constructor. - const { version, multihash, code } = value - const digest = - /** @type {API.MultihashDigest} */ - (ipfs_core_utils_node_modules_multiformats_src_hashes_digest_decode(multihash)) - return ipfs_core_utils_node_modules_multiformats_src_cid_CID.create(version, code, digest) - } else { - // Otherwise value is not a CID (or an incompatible version of it) in - // which case we return `null`. - return null + _next () { + if (this.tokenBuffer.length > 0) { + // @ts-ignore https://github.com/Microsoft/TypeScript/issues/30406 + return this.tokenBuffer.pop() } + return super.next() } /** + * Implements rules outlined in https://github.com/ipld/specs/pull/356 * - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @param {Version} version - Version of the CID - * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param {API.MultihashDigest} digest - (Multi)hash of the of the content. - * @returns {CID} + * @returns {Token} */ - static create (version, code, digest) { - if (typeof code !== 'number') { - throw new Error('String codecs are no longer supported') - } - - if (!(digest.bytes instanceof Uint8Array)) { - throw new Error('Invalid digest') - } + next () { + const token = this._next() - switch (version) { - case 0: { - if (code !== ipfs_core_utils_node_modules_multiformats_src_cid_DAG_PB_CODE) { - throw new Error( - `Version 0 CID must use dag-pb (code: ${ipfs_core_utils_node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding` - ) - } else { - return new ipfs_core_utils_node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes) + if (token.type === token_Type.map) { + const keyToken = this._next() + if (keyToken.type === token_Type.string && keyToken.value === '/') { + const valueToken = this._next() + if (valueToken.type === token_Type.string) { // *must* be a CID + const breakToken = this._next() // swallow the end-of-map token + if (breakToken.type !== token_Type["break"]) { + throw new Error('Invalid encoded CID form') + } + this.tokenBuffer.push(valueToken) // CID.parse will pick this up after our tag token + return new token_Token(token_Type.tag, 42, 0) } + if (valueToken.type === token_Type.map) { + const innerKeyToken = this._next() + if (innerKeyToken.type === token_Type.string && innerKeyToken.value === 'bytes') { + const innerValueToken = this._next() + if (innerValueToken.type === token_Type.string) { // *must* be Bytes + for (let i = 0; i < 2; i++) { + const breakToken = this._next() // swallow two end-of-map tokens + if (breakToken.type !== token_Type["break"]) { + throw new Error('Invalid encoded Bytes form') + } + } + const bytes = base64.decode(`m${innerValueToken.value}`) + return new token_Token(token_Type.bytes, bytes, innerValueToken.value.length) + } + this.tokenBuffer.push(innerValueToken) // bail + } + this.tokenBuffer.push(innerKeyToken) // bail + } + this.tokenBuffer.push(valueToken) // bail } - case 1: { - const bytes = ipfs_core_utils_node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes) - return new ipfs_core_utils_node_modules_multiformats_src_cid_CID(version, code, digest, bytes) - } - default: { - throw new Error('Invalid version') - } - } - } - - /** - * Simplified version of `create` for CIDv0. - * - * @template {unknown} [T=unknown] - * @param {API.MultihashDigest} digest - Multihash. - * @returns {CID} - */ - static createV0 (digest) { - return ipfs_core_utils_node_modules_multiformats_src_cid_CID.create(0, ipfs_core_utils_node_modules_multiformats_src_cid_DAG_PB_CODE, digest) - } - - /** - * Simplified version of `create` for CIDv1. - * - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @param {Code} code - Content encoding format code. - * @param {API.MultihashDigest} digest - Miltihash of the content. - * @returns {CID} - */ - static createV1 (code, digest) { - return ipfs_core_utils_node_modules_multiformats_src_cid_CID.create(1, code, digest) - } - - /** - * Decoded a CID from its binary representation. The byte array must contain - * only the CID with no additional bytes. - * - * An error will be thrown if the bytes provided do not contain a valid - * binary representation of a CID. - * - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ByteView>} bytes - * @returns {CID} - */ - static decode (bytes) { - const [cid, remainder] = ipfs_core_utils_node_modules_multiformats_src_cid_CID.decodeFirst(bytes) - if (remainder.length) { - throw new Error('Incorrect length') - } - return cid - } - - /** - * Decoded a CID from its binary representation at the beginning of a byte - * array. - * - * Returns an array with the first element containing the CID and the second - * element containing the remainder of the original byte array. The remainder - * will be a zero-length byte array if the provided bytes only contained a - * binary CID representation. - * - * @template {unknown} T - * @template {number} C - * @template {number} A - * @template {API.Version} V - * @param {API.ByteView>} bytes - * @returns {[CID, Uint8Array]} - */ - static decodeFirst (bytes) { - const specs = ipfs_core_utils_node_modules_multiformats_src_cid_CID.inspectBytes(bytes) - const prefixSize = specs.size - specs.multihashSize - const multihashBytes = ipfs_core_utils_node_modules_multiformats_src_bytes_coerce( - bytes.subarray(prefixSize, prefixSize + specs.multihashSize) - ) - if (multihashBytes.byteLength !== specs.multihashSize) { - throw new Error('Incorrect length') - } - const digestBytes = multihashBytes.subarray( - specs.multihashSize - specs.digestSize - ) - const digest = new ipfs_core_utils_node_modules_multiformats_src_hashes_digest_Digest( - specs.multihashCode, - specs.digestSize, - digestBytes, - multihashBytes - ) - const cid = - specs.version === 0 - ? ipfs_core_utils_node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) - : ipfs_core_utils_node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest) - return [/** @type {CID} */(cid), bytes.subarray(specs.size)] - } - - /** - * Inspect the initial bytes of a CID to determine its properties. - * - * Involves decoding up to 4 varints. Typically this will require only 4 to 6 - * bytes but for larger multicodec code values and larger multihash digest - * lengths these varints can be quite large. It is recommended that at least - * 10 bytes be made available in the `initialBytes` argument for a complete - * inspection. - * - * @template {unknown} T - * @template {number} C - * @template {number} A - * @template {API.Version} V - * @param {API.ByteView>} initialBytes - * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }} - */ - static inspectBytes (initialBytes) { - let offset = 0 - const next = () => { - const [i, length] = ipfs_core_utils_node_modules_multiformats_src_varint_decode(initialBytes.subarray(offset)) - offset += length - return i - } - - let version = /** @type {V} */ (next()) - let codec = /** @type {C} */ (ipfs_core_utils_node_modules_multiformats_src_cid_DAG_PB_CODE) - if (/** @type {number} */(version) === 18) { - // CIDv0 - version = /** @type {V} */ (0) - offset = 0 - } else { - codec = /** @type {C} */ (next()) - } - - if (version !== 0 && version !== 1) { - throw new RangeError(`Invalid CID version ${version}`) + this.tokenBuffer.push(keyToken) // bail } - - const prefixSize = offset - const multihashCode = /** @type {A} */ (next()) // multihash code - const digestSize = next() // multihash length - const size = offset + digestSize - const multihashSize = size - prefixSize - - return { version, codec, multihashCode, digestSize, multihashSize, size } + return token } +} - /** - * Takes cid in a string representation and creates an instance. If `base` - * decoder is not provided will use a default from the configuration. It will - * throw an error if encoding of the CID is not compatible with supplied (or - * a default decoder). - * - * @template {string} Prefix - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ToString, Prefix>} source - * @param {API.MultibaseDecoder} [base] - * @returns {CID} - */ - static parse (source, base) { - const [prefix, bytes] = ipfs_core_utils_node_modules_multiformats_src_cid_parseCIDtoBytes(source, base) - - const cid = ipfs_core_utils_node_modules_multiformats_src_cid_CID.decode(bytes) - - if (cid.version === 0 && source[0] !== 'Q') { - throw Error('Version 0 CID string must not include multibase prefix') - } +const src_decodeOptions = { + allowIndefinite: false, + allowUndefined: false, + allowNaN: false, + allowInfinity: false, + allowBigInt: true, // this will lead to BigInt for ints outside of + // safe-integer range, which may surprise users + strict: true, + useMaps: false, + rejectDuplicateMapKeys: true, + /** @type {import('cborg').TagDecoder[]} */ + tags: [] +} - // Cache string representation to avoid computing it on `this.toString()` - ipfs_core_utils_node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source) +// we're going to get TAG(42)STRING("bafy...") from the tokenizer so we only need +// to deal with the STRING("bafy...") at this point +src_decodeOptions.tags[42] = dist_src_cid_CID.parse - return cid - } -} +const dag_json_src_name = 'dag-json' +const dag_json_src_code = 0x0129 /** - * @template {string} Prefix - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ToString, Prefix>} source - * @param {API.MultibaseDecoder} [base] - * @returns {[Prefix, API.ByteView>]} + * @template T + * @param {T} node + * @returns {ByteView} */ -const ipfs_core_utils_node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => { - switch (source[0]) { - // CIDv0 is parsed differently - case 'Q': { - const decoder = base || ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc - return [ - /** @type {Prefix} */ (ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc.prefix), - decoder.decode(`${ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc.prefix}${source}`) - ] - } - case ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc.prefix: { - const decoder = base || ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc - return [/** @type {Prefix} */(ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc.prefix), decoder.decode(source)] - } - case ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32.prefix: { - const decoder = base || ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32 - return [/** @type {Prefix} */(ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32.prefix), decoder.decode(source)] - } - default: { - if (base == null) { - throw Error( - 'To parse non base32 or base58btc encoded CID multibase decoder must be provided' - ) - } - return [/** @type {Prefix} */(source[0]), base.decode(source)] - } - } -} +const dag_json_src_encode = (node) => json_encode_encode(node, src_encodeOptions) /** - * - * @param {Uint8Array} bytes - * @param {Map} cache - * @param {API.MultibaseEncoder<'z'>} base + * @template T + * @param {ByteView} data + * @returns {T} */ -const ipfs_core_utils_node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => { - const { prefix } = base - if (prefix !== ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc.prefix) { - throw Error(`Cannot string encode V0 in ${base.name} encoding`) - } - - const cid = cache.get(prefix) - if (cid == null) { - const cid = base.encode(bytes).slice(1) - cache.set(prefix, cid) - return cid - } else { - return cid - } +const dag_json_src_decode = (data) => { + // the tokenizer is stateful so we need a single instance of it + const options = Object.assign(src_decodeOptions, { tokenizer: new DagJsonTokenizer(data, src_decodeOptions) }) + return json_decode_decode(data, options) } /** - * @template {string} Prefix - * @param {Uint8Array} bytes - * @param {Map} cache - * @param {API.MultibaseEncoder} base + * @template T + * @param {T} node + * @returns {ToString} */ -const ipfs_core_utils_node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => { - const { prefix } = base - const cid = cache.get(prefix) - if (cid == null) { - const cid = base.encode(bytes) - cache.set(prefix, cid) - return cid - } else { - return cid - } -} +const src_format = (node) => utf8Decoder.decode(dag_json_src_encode(node)) -const ipfs_core_utils_node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70 -const ipfs_core_utils_node_modules_multiformats_src_cid_SHA_256_CODE = 0x12 +const utf8Decoder = new TextDecoder() /** - * @param {API.Version} version - * @param {number} code - * @param {Uint8Array} multihash - * @returns {Uint8Array} + * @template T + * @param {ToString} data + * @returns {T} */ -const ipfs_core_utils_node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => { - const codeOffset = ipfs_core_utils_node_modules_multiformats_src_varint_encodingLength(version) - const hashOffset = codeOffset + ipfs_core_utils_node_modules_multiformats_src_varint_encodingLength(code) - const bytes = new Uint8Array(hashOffset + multihash.byteLength) - ipfs_core_utils_node_modules_multiformats_src_varint_encodeTo(version, bytes, 0) - ipfs_core_utils_node_modules_multiformats_src_varint_encodeTo(code, bytes, codeOffset) - bytes.set(multihash, hashOffset) - return bytes -} - -const ipfs_core_utils_node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') - -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/identity.js -// @ts-check - - - - -const node_modules_multiformats_src_bases_identity_identity = ipfs_core_utils_node_modules_multiformats_src_bases_base_from({ - prefix: '\x00', - name: 'identity', - encode: (buf) => ipfs_core_utils_node_modules_multiformats_src_bytes_toString(buf), - decode: (str) => ipfs_core_utils_node_modules_multiformats_src_bytes_fromString(str) -}) - -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base2.js -// @ts-check - - - -const src_bases_base2_base2 = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: '0', - name: 'base2', - alphabet: '01', - bitsPerChar: 1 -}) - -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base8.js -// @ts-check - - - -const src_bases_base8_base8 = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: '7', - name: 'base8', - alphabet: '01234567', - bitsPerChar: 3 -}) - -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base10.js - - -const src_bases_base10_base10 = ipfs_core_utils_node_modules_multiformats_src_bases_base_baseX({ - prefix: '9', - name: 'base10', - alphabet: '0123456789' -}) - -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base16.js -// @ts-check - - - -const src_bases_base16_base16 = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'f', - name: 'base16', - alphabet: '0123456789abcdef', - bitsPerChar: 4 -}) - -const src_bases_base16_base16upper = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'F', - name: 'base16upper', - alphabet: '0123456789ABCDEF', - bitsPerChar: 4 -}) - -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base36.js - - -const src_bases_base36_base36 = ipfs_core_utils_node_modules_multiformats_src_bases_base_baseX({ - prefix: 'k', - name: 'base36', - alphabet: '0123456789abcdefghijklmnopqrstuvwxyz' -}) - -const src_bases_base36_base36upper = ipfs_core_utils_node_modules_multiformats_src_bases_base_baseX({ - prefix: 'K', - name: 'base36upper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' -}) - -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base64.js -// @ts-check +const parse = (data) => dag_json_src_decode(utf8Encoder.encode(data)) +const utf8Encoder = new TextEncoder() +;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/vendor/base-x.js +// base-x encoding / decoding +// Copyright (c) 2018 base-x contributors +// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) +// Distributed under the MIT software license, see the accompanying +// file LICENSE or http://www.opensource.org/licenses/mit-license.php. +function multiformats_vendor_base_x_base (ALPHABET, name) { + if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; + } + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') } + BASE_MAP[xc] = i; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up + var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up + function encode (source) { + if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } else if (Array.isArray(source)) { + source = Uint8Array.from(source); + } + if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') } + if (source.length === 0) { return '' } + // Skip & count leading zeroes. + var zeroes = 0; + var length = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } + // Allocate enough space in big-endian base58 representation. + var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; + var b58 = new Uint8Array(size); + // Process the bytes. + while (pbegin !== pend) { + var carry = source[pbegin]; + // Apply "b58 = b58 * 256 + ch". + var i = 0; + for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { + carry += (256 * b58[it1]) >>> 0; + b58[it1] = (carry % BASE) >>> 0; + carry = (carry / BASE) >>> 0; + } + if (carry !== 0) { throw new Error('Non-zero carry') } + length = i; + pbegin++; + } + // Skip leading zeroes in base58 result. + var it2 = size - length; + while (it2 !== size && b58[it2] === 0) { + it2++; + } + // Translate the result into a string. + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); } + return str + } + function decodeUnsafe (source) { + if (typeof source !== 'string') { throw new TypeError('Expected String') } + if (source.length === 0) { return new Uint8Array() } + var psz = 0; + // Skip leading spaces. + if (source[psz] === ' ') { return } + // Skip and count leading '1's. + var zeroes = 0; + var length = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; + } + // Allocate enough space in big-endian base256 representation. + var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. + var b256 = new Uint8Array(size); + // Process the characters. + while (source[psz]) { + // Decode character + var carry = BASE_MAP[source.charCodeAt(psz)]; + // Invalid character + if (carry === 255) { return } + var i = 0; + for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { + carry += (BASE * b256[it3]) >>> 0; + b256[it3] = (carry % 256) >>> 0; + carry = (carry / 256) >>> 0; + } + if (carry !== 0) { throw new Error('Non-zero carry') } + length = i; + psz++; + } + // Skip trailing spaces. + if (source[psz] === ' ') { return } + // Skip leading zeroes in b256. + var it4 = size - length; + while (it4 !== size && b256[it4] === 0) { + it4++; + } + var vch = new Uint8Array(zeroes + (size - it4)); + var j = zeroes; + while (it4 !== size) { + vch[j++] = b256[it4++]; + } + return vch + } + function decode (string) { + var buffer = decodeUnsafe(string); + if (buffer) { return buffer } + throw new Error(`Non-${name} character`) + } + return { + encode: encode, + decodeUnsafe: decodeUnsafe, + decode: decode + } +} +var multiformats_vendor_base_x_src = multiformats_vendor_base_x_base; +var multiformats_vendor_base_x_brrp_multiformats_scope_baseX = multiformats_vendor_base_x_src; -const node_modules_multiformats_src_bases_base64_base64 = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'm', - name: 'base64', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', - bitsPerChar: 6 -}) +/* harmony default export */ const multiformats_vendor_base_x = (multiformats_vendor_base_x_brrp_multiformats_scope_baseX); -const node_modules_multiformats_src_bases_base64_base64pad = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'M', - name: 'base64pad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', - bitsPerChar: 6 -}) +;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/src/bytes.js +const multiformats_src_bytes_empty = new Uint8Array(0) -const node_modules_multiformats_src_bases_base64_base64url = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'u', - name: 'base64url', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', - bitsPerChar: 6 -}) +/** + * @param {Uint8Array} d + */ +const multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') -const node_modules_multiformats_src_bases_base64_base64urlpad = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'U', - name: 'base64urlpad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', - bitsPerChar: 6 -}) +/** + * @param {string} hex + */ +const multiformats_src_bytes_fromHex = hex => { + const hexes = hex.match(/../g) + return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : multiformats_src_bytes_empty +} -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base256emoji.js +/** + * @param {Uint8Array} aa + * @param {Uint8Array} bb + */ +const multiformats_src_bytes_equals = (aa, bb) => { + if (aa === bb) return true + if (aa.byteLength !== bb.byteLength) { + return false + } + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false + } + } -const src_bases_base256emoji_alphabet = Array.from('🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂') -const src_bases_base256emoji_alphabetBytesToChars = /** @type {string[]} */ (src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[i] = c; return p }, /** @type {string[]} */([]))) -const src_bases_base256emoji_alphabetCharsToBytes = /** @type {number[]} */ (src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[/** @type {number} */ (c.codePointAt(0))] = i; return p }, /** @type {number[]} */([]))) + return true +} /** - * @param {Uint8Array} data - * @returns {string} + * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o + * @returns {Uint8Array} */ -function multiformats_src_bases_base256emoji_encode (data) { - return data.reduce((p, c) => { - p += src_bases_base256emoji_alphabetBytesToChars[c] - return p - }, '') +const multiformats_src_bytes_coerce = o => { + if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o + if (o instanceof ArrayBuffer) return new Uint8Array(o) + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) + } + throw new Error('Unknown type, must be binary type') } +/** + * @param {any} o + * @returns {o is ArrayBuffer|ArrayBufferView} + */ +const multiformats_src_bytes_isBinary = o => + o instanceof ArrayBuffer || ArrayBuffer.isView(o) + /** * @param {string} str * @returns {Uint8Array} */ -function multiformats_src_bases_base256emoji_decode (str) { - const byts = [] - for (const char of str) { - const byt = src_bases_base256emoji_alphabetCharsToBytes[/** @type {number} */ (char.codePointAt(0))] - if (byt === undefined) { - throw new Error(`Non-base256emoji character: ${char}`) - } - byts.push(byt) - } - return new Uint8Array(byts) -} +const multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) -const src_bases_base256emoji_base256emoji = ipfs_core_utils_node_modules_multiformats_src_bases_base_from({ - prefix: '🚀', - name: 'base256emoji', - encode: multiformats_src_bases_base256emoji_encode, - decode: multiformats_src_bases_base256emoji_decode -}) +/** + * @param {Uint8Array} b + * @returns {string} + */ +const multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/hashes/hasher.js -/** - * @template {string} Name - * @template {number} Code - * @param {object} options - * @param {Name} options.name - * @param {Code} options.code - * @param {(input: Uint8Array) => Await} options.encode - */ -const node_modules_multiformats_src_hashes_hasher_from = ({ name, code, encode }) => new multiformats_src_hashes_hasher_Hasher(name, code, encode) +;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/src/bases/base.js + + +// Linter can't see that API is used in types. +// eslint-disable-next-line + /** - * Hasher represents a hashing algorithm implementation that produces as - * `MultihashDigest`. + * Class represents both BaseEncoder and MultibaseEncoder meaning it + * can be used to encode to multibase or base encode without multibase + * prefix. * - * @template {string} Name - * @template {number} Code * @class - * @implements {MultihashHasher} + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseEncoder} + * @implements {API.BaseEncoder} */ -class multiformats_src_hashes_hasher_Hasher { +class src_bases_base_Encoder { /** - * - * @param {Name} name - * @param {Code} code - * @param {(input: Uint8Array) => Await} encode + * @param {Base} name + * @param {Prefix} prefix + * @param {(bytes:Uint8Array) => string} baseEncode */ - constructor (name, code, encode) { + constructor (name, prefix, baseEncode) { this.name = name - this.code = code - this.encode = encode + this.prefix = prefix + this.baseEncode = baseEncode } /** - * @param {Uint8Array} input - * @returns {Await>} + * @param {Uint8Array} bytes + * @returns {API.Multibase} */ - digest (input) { - if (input instanceof Uint8Array) { - const result = this.encode(input) - return result instanceof Uint8Array - ? ipfs_core_utils_node_modules_multiformats_src_hashes_digest_create(this.code, result) - /* c8 ignore next 1 */ - : result.then(digest => ipfs_core_utils_node_modules_multiformats_src_hashes_digest_create(this.code, digest)) + encode (bytes) { + if (bytes instanceof Uint8Array) { + return `${this.prefix}${this.baseEncode(bytes)}` } else { throw Error('Unknown type, must be binary type') - /* c8 ignore next 1 */ } } } /** - * @template {number} Alg - * @typedef {import('./interface.js').MultihashHasher} MultihashHasher + * @template {string} Prefix */ - /** - * @template T - * @typedef {Promise|T} Await + * Class represents both BaseDecoder and MultibaseDecoder so it could be used + * to decode multibases (with matching prefix) or just base decode strings + * with corresponding base encoding. + * + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseDecoder} + * @implements {API.UnibaseDecoder} + * @implements {API.BaseDecoder} */ +class src_bases_base_Decoder { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(text:string) => Uint8Array} baseDecode + */ + constructor (name, prefix, baseDecode) { + this.name = name + this.prefix = prefix + /* c8 ignore next 3 */ + if (prefix.codePointAt(0) === undefined) { + throw new Error('Invalid prefix character') + } + /** @private */ + this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0)) + this.baseDecode = baseDecode + } -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/hashes/sha2.js -// @ts-check - - - - - -const multiformats_src_hashes_sha2_sha256 = node_modules_multiformats_src_hashes_hasher_from({ - name: 'sha2-256', - code: 0x12, - encode: (input) => ipfs_core_utils_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha256').update(input).digest()) -}) - -const src_hashes_sha2_sha512 = node_modules_multiformats_src_hashes_hasher_from({ - name: 'sha2-512', - code: 0x13, - encode: input => ipfs_core_utils_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha512').update(input).digest()) -}) - -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/hashes/identity.js - - - -const multiformats_src_hashes_identity_code = 0x0 -const multiformats_src_hashes_identity_name = 'identity' + /** + * @param {string} text + */ + decode (text) { + if (typeof text === 'string') { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`) + } + return this.baseDecode(text.slice(this.prefix.length)) + } else { + throw Error('Can only multibase decode strings') + } + } -/** @type {(input:Uint8Array) => Uint8Array} */ -const multiformats_src_hashes_identity_encode = ipfs_core_utils_node_modules_multiformats_src_bytes_coerce + /** + * @template {string} OtherPrefix + * @param {API.UnibaseDecoder|ComposedDecoder} decoder + * @returns {ComposedDecoder} + */ + or (decoder) { + return src_bases_base_or(this, decoder) + } +} /** - * @param {Uint8Array} input - * @returns {Digest.Digest} + * @template {string} Prefix + * @typedef {Record>} Decoders */ -const src_hashes_identity_digest = (input) => ipfs_core_utils_node_modules_multiformats_src_hashes_digest_create(multiformats_src_hashes_identity_code, multiformats_src_hashes_identity_encode(input)) - -const multiformats_src_hashes_identity_identity = { code: multiformats_src_hashes_identity_code, name: multiformats_src_hashes_identity_name, encode: multiformats_src_hashes_identity_encode, digest: src_hashes_identity_digest } - -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/codecs/raw.js -// @ts-check - - /** - * @template T - * @typedef {import('./interface.js').ByteView} ByteView + * @template {string} Prefix + * @implements {API.MultibaseDecoder} + * @implements {API.CombobaseDecoder} */ +class src_bases_base_ComposedDecoder { + /** + * @param {Decoders} decoders + */ + constructor (decoders) { + this.decoders = decoders + } -const multiformats_src_codecs_raw_name = 'raw' -const multiformats_src_codecs_raw_code = 0x55 + /** + * @template {string} OtherPrefix + * @param {API.UnibaseDecoder|ComposedDecoder} decoder + * @returns {ComposedDecoder} + */ + or (decoder) { + return src_bases_base_or(this, decoder) + } -/** - * @param {Uint8Array} node - * @returns {ByteView} - */ -const multiformats_src_codecs_raw_encode = (node) => ipfs_core_utils_node_modules_multiformats_src_bytes_coerce(node) + /** + * @param {string} input + * @returns {Uint8Array} + */ + decode (input) { + const prefix = /** @type {Prefix} */ (input[0]) + const decoder = this.decoders[prefix] + if (decoder) { + return decoder.decode(input) + } else { + throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`) + } + } +} /** - * @param {ByteView} data - * @returns {Uint8Array} + * @template {string} L + * @template {string} R + * @param {API.UnibaseDecoder|API.CombobaseDecoder} left + * @param {API.UnibaseDecoder|API.CombobaseDecoder} right + * @returns {ComposedDecoder} */ -const multiformats_src_codecs_raw_decode = (data) => ipfs_core_utils_node_modules_multiformats_src_bytes_coerce(data) - -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/codecs/json.js -// @ts-check +const src_bases_base_or = (left, right) => new src_bases_base_ComposedDecoder(/** @type {Decoders} */({ + ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }), + ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right }) +})) /** - * @template T - * @typedef {import('./interface.js').ByteView} ByteView + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseCodec} + * @implements {API.MultibaseEncoder} + * @implements {API.MultibaseDecoder} + * @implements {API.BaseCodec} + * @implements {API.BaseEncoder} + * @implements {API.BaseDecoder} */ +class src_bases_base_Codec { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(bytes:Uint8Array) => string} baseEncode + * @param {(text:string) => Uint8Array} baseDecode + */ + constructor (name, prefix, baseEncode, baseDecode) { + this.name = name + this.prefix = prefix + this.baseEncode = baseEncode + this.baseDecode = baseDecode + this.encoder = new src_bases_base_Encoder(name, prefix, baseEncode) + this.decoder = new src_bases_base_Decoder(name, prefix, baseDecode) + } -const multiformats_src_codecs_json_textEncoder = new TextEncoder() -const multiformats_src_codecs_json_textDecoder = new TextDecoder() + /** + * @param {Uint8Array} input + */ + encode (input) { + return this.encoder.encode(input) + } -const multiformats_src_codecs_json_name = 'json' -const multiformats_src_codecs_json_code = 0x0200 + /** + * @param {string} input + */ + decode (input) { + return this.decoder.decode(input) + } +} /** - * @template T - * @param {T} node - * @returns {ByteView} + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {(bytes:Uint8Array) => string} options.encode + * @param {(input:string) => Uint8Array} options.decode + * @returns {Codec} */ -const multiformats_src_codecs_json_encode = (node) => multiformats_src_codecs_json_textEncoder.encode(JSON.stringify(node)) +const src_bases_base_from = ({ name, prefix, encode, decode }) => + new src_bases_base_Codec(name, prefix, encode, decode) /** - * @template T - * @param {ByteView} data - * @returns {T} + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {string} options.alphabet + * @returns {Codec} */ -const multiformats_src_codecs_json_decode = (data) => JSON.parse(multiformats_src_codecs_json_textDecoder.decode(data)) - -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/index.js - - +const src_bases_base_baseX = ({ prefix, name, alphabet }) => { + const { encode, decode } = multiformats_vendor_base_x(alphabet, name) + return src_bases_base_from({ + prefix, + name, + encode, + /** + * @param {string} text + */ + decode: text => multiformats_src_bytes_coerce(decode(text)) + }) +} +/** + * @param {string} string + * @param {string} alphabet + * @param {number} bitsPerChar + * @param {string} name + * @returns {Uint8Array} + */ +const src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { + // Build the character lookup table: + /** @type {Record} */ + const codes = {} + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i + } + // Count the padding bytes: + let end = string.length + while (string[end - 1] === '=') { + --end + } -// This way TS will also expose all the types from module + // Allocate the output: + const out = new Uint8Array((end * bitsPerChar / 8) | 0) + // Parse the data: + let bits = 0 // Number of bits currently in the buffer + let buffer = 0 // Bits waiting to be written out, MSB first + let written = 0 // Next byte to write + for (let i = 0; i < end; ++i) { + // Read one character from the string: + const value = codes[string[i]] + if (value === undefined) { + throw new SyntaxError(`Non-${name} character`) + } + // Append the bits to the buffer: + buffer = (buffer << bitsPerChar) | value + bits += bitsPerChar + // Write out some bits if the buffer has a byte's worth: + if (bits >= 8) { + bits -= 8 + out[written++] = 0xff & (buffer >> bits) + } + } -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/basics.js -// @ts-check + // Verify that we have received just enough bits: + if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) { + throw new SyntaxError('Unexpected end of data') + } + return out +} +/** + * @param {Uint8Array} data + * @param {string} alphabet + * @param {number} bitsPerChar + * @returns {string} + */ +const src_bases_base_encode = (data, alphabet, bitsPerChar) => { + const pad = alphabet[alphabet.length - 1] === '=' + const mask = (1 << bitsPerChar) - 1 + let out = '' + let bits = 0 // Number of bits currently in the buffer + let buffer = 0 // Bits waiting to be written out, MSB first + for (let i = 0; i < data.length; ++i) { + // Slurp data into the buffer: + buffer = (buffer << 8) | data[i] + bits += 8 + // Write out as much as we can: + while (bits > bitsPerChar) { + bits -= bitsPerChar + out += alphabet[mask & (buffer >> bits)] + } + } + // Partial character: + if (bits) { + out += alphabet[mask & (buffer << (bitsPerChar - bits))] + } + // Add padding characters until we hit a byte boundary: + if (pad) { + while ((out.length * bitsPerChar) & 7) { + out += '=' + } + } + return out +} +/** + * RFC4648 Factory + * + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {string} options.alphabet + * @param {number} options.bitsPerChar + */ +const src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { + return src_bases_base_from({ + prefix, + name, + encode (input) { + return src_bases_base_encode(input, alphabet, bitsPerChar) + }, + decode (input) { + return src_bases_base_decode(input, alphabet, bitsPerChar, name) + } + }) +} +;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/src/bases/base64.js +// @ts-check +const base64_base64 = src_bases_base_rfc4648({ + prefix: 'm', + name: 'base64', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + bitsPerChar: 6 +}) +const base64_base64pad = src_bases_base_rfc4648({ + prefix: 'M', + name: 'base64pad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', + bitsPerChar: 6 +}) +const base64_base64url = src_bases_base_rfc4648({ + prefix: 'u', + name: 'base64url', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', + bitsPerChar: 6 +}) +const base64_base64urlpad = src_bases_base_rfc4648({ + prefix: 'U', + name: 'base64urlpad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', + bitsPerChar: 6 +}) +;// CONCATENATED MODULE: ./node_modules/dag-jose/lib/utils.js +function toBase64url(b) { + return base64_base64url.encode(b).slice(1); +} +function fromBase64url(s) { + return base64_base64url.decode(`u${s}`); +} +//# sourceMappingURL=utils.js.map +;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/vendor/varint.js +var multiformats_vendor_varint_encode_1 = multiformats_vendor_varint_encode; +var multiformats_vendor_varint_MSB = 0x80 + , multiformats_vendor_varint_REST = 0x7F + , multiformats_vendor_varint_MSBALL = ~multiformats_vendor_varint_REST + , multiformats_vendor_varint_INT = Math.pow(2, 31); -const multiformats_src_basics_bases = { ...node_modules_multiformats_src_bases_identity_namespaceObject, ...multiformats_src_bases_base2_namespaceObject, ...multiformats_src_bases_base8_namespaceObject, ...multiformats_src_bases_base10_namespaceObject, ...multiformats_src_bases_base16_namespaceObject, ...ipfs_core_utils_node_modules_multiformats_src_bases_base32_namespaceObject, ...multiformats_src_bases_base36_namespaceObject, ...ipfs_core_utils_node_modules_multiformats_src_bases_base58_namespaceObject, ...node_modules_multiformats_src_bases_base64_namespaceObject, ...multiformats_src_bases_base256emoji_namespaceObject } -const multiformats_src_basics_hashes = { ...multiformats_src_hashes_sha2_namespaceObject, ...multiformats_src_hashes_identity_namespaceObject } -const multiformats_src_basics_codecs = { raw: multiformats_src_codecs_raw_namespaceObject, json: node_modules_multiformats_src_codecs_json_namespaceObject } +function multiformats_vendor_varint_encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; + while(num >= multiformats_vendor_varint_INT) { + out[offset++] = (num & 0xFF) | multiformats_vendor_varint_MSB; + num /= 128; + } + while(num & multiformats_vendor_varint_MSBALL) { + out[offset++] = (num & 0xFF) | multiformats_vendor_varint_MSB; + num >>>= 7; + } + out[offset] = num | 0; + + multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; + + return out +} +var multiformats_vendor_varint_decode = multiformats_vendor_varint_read; -// EXTERNAL MODULE: ./node_modules/ipfs-core-utils/node_modules/varint/index.js -var node_modules_varint = __nccwpck_require__(86941); -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/dist/src/from-string.js +var multiformats_vendor_varint_MSB$1 = 0x80 + , multiformats_vendor_varint_REST$1 = 0x7F; +function multiformats_vendor_varint_read(buf, offset) { + var res = 0 + , offset = offset || 0 + , shift = 0 + , counter = offset + , b + , l = buf.length; -/** - * Create a `Uint8Array` from the passed string - * - * Supports `utf8`, `utf-8`, `hex`, and any encoding supported by the multiformats module. - * - * Also `ascii` which is similar to node's 'binary' encoding. - */ -function src_from_string_fromString(string, encoding = 'utf8') { - const base = src_util_bases[encoding]; - if (base == null) { - throw new Error(`Unsupported encoding "${encoding}"`); - } - if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) { - return src_util_as_uint8array_asUint8Array(globalThis.Buffer.from(string, 'utf-8')); + do { + if (counter >= l) { + multiformats_vendor_varint_read.bytes = 0; + throw new RangeError('Could not decode varint') } - // add multibase prefix - return base.decoder.decode(`${base.prefix}${string}`); // eslint-disable-line @typescript-eslint/restrict-template-expressions -} -//# sourceMappingURL=from-string.js.map -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/dist/src/concat.js + b = buf[counter++]; + res += shift < 28 + ? (b & multiformats_vendor_varint_REST$1) << shift + : (b & multiformats_vendor_varint_REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= multiformats_vendor_varint_MSB$1) + multiformats_vendor_varint_read.bytes = counter - offset; -/** - * Returns a new Uint8Array created by concatenating the passed ArrayLikes - */ -function src_concat_concat(arrays, length) { - if (length == null) { - length = arrays.reduce((acc, curr) => acc + curr.length, 0); - } - const output = src_alloc_allocUnsafe(length); - let offset = 0; - for (const arr of arrays) { - output.set(arr, offset); - offset += arr.length; - } - return src_util_as_uint8array_asUint8Array(output); + return res } -//# sourceMappingURL=concat.js.map -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/@multiformats/multiaddr/dist/src/convert.js -/** - * @packageDocumentation - * - * Provides methods for converting - */ - - - +var multiformats_vendor_varint_N1 = Math.pow(2, 7); +var multiformats_vendor_varint_N2 = Math.pow(2, 14); +var multiformats_vendor_varint_N3 = Math.pow(2, 21); +var multiformats_vendor_varint_N4 = Math.pow(2, 28); +var multiformats_vendor_varint_N5 = Math.pow(2, 35); +var multiformats_vendor_varint_N6 = Math.pow(2, 42); +var multiformats_vendor_varint_N7 = Math.pow(2, 49); +var multiformats_vendor_varint_N8 = Math.pow(2, 56); +var multiformats_vendor_varint_N9 = Math.pow(2, 63); +var multiformats_vendor_varint_length = function (value) { + return ( + value < multiformats_vendor_varint_N1 ? 1 + : value < multiformats_vendor_varint_N2 ? 2 + : value < multiformats_vendor_varint_N3 ? 3 + : value < multiformats_vendor_varint_N4 ? 4 + : value < multiformats_vendor_varint_N5 ? 5 + : value < multiformats_vendor_varint_N6 ? 6 + : value < multiformats_vendor_varint_N7 ? 7 + : value < multiformats_vendor_varint_N8 ? 8 + : value < multiformats_vendor_varint_N9 ? 9 + : 10 + ) +}; +var multiformats_vendor_varint_varint = { + encode: multiformats_vendor_varint_encode_1 + , decode: multiformats_vendor_varint_decode + , encodingLength: multiformats_vendor_varint_length +}; +var multiformats_vendor_varint_brrp_varint = multiformats_vendor_varint_varint; +/* harmony default export */ const multiformats_vendor_varint = (multiformats_vendor_varint_brrp_varint); +;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/src/varint.js -function convert_convert(proto, a) { - if (a instanceof Uint8Array) { - return convert_convertToString(proto, a); - } - else { - return convert_convertToBytes(proto, a); - } -} -/** - * Convert [code,Uint8Array] to string - */ -function convert_convertToString(proto, buf) { - const protocol = src_protocols_table_getProtocol(proto); - switch (protocol.code) { - case 4: // ipv4 - case 41: // ipv6 - return convert_bytes2ip(buf); - case 42: // ipv6zone - return convert_bytes2str(buf); - case 6: // tcp - case 273: // udp - case 33: // dccp - case 132: // sctp - return convert_bytes2port(buf).toString(); - case 53: // dns - case 54: // dns4 - case 55: // dns6 - case 56: // dnsaddr - case 400: // unix - case 449: // sni - case 777: // memory - return convert_bytes2str(buf); - case 421: // ipfs - return convert_bytes2mh(buf); - case 444: // onion - return convert_bytes2onion(buf); - case 445: // onion3 - return convert_bytes2onion(buf); - case 466: // certhash - return convert_bytes2mb(buf); - default: - return src_to_string_toString(buf, 'base16'); // no clue. convert to hex - } -} -function convert_convertToBytes(proto, str) { - const protocol = src_protocols_table_getProtocol(proto); - switch (protocol.code) { - case 4: // ipv4 - return convert_ip2bytes(str); - case 41: // ipv6 - return convert_ip2bytes(str); - case 42: // ipv6zone - return convert_str2bytes(str); - case 6: // tcp - case 273: // udp - case 33: // dccp - case 132: // sctp - return convert_port2bytes(parseInt(str, 10)); - case 53: // dns - case 54: // dns4 - case 55: // dns6 - case 56: // dnsaddr - case 400: // unix - case 449: // sni - case 777: // memory - return convert_str2bytes(str); - case 421: // ipfs - return convert_mh2bytes(str); - case 444: // onion - return convert_onion2bytes(str); - case 445: // onion3 - return convert_onion32bytes(str); - case 466: // certhash - return convert_mb2bytes(str); - default: - return src_from_string_fromString(str, 'base16'); // no clue. convert from hex - } -} -const convert_decoders = Object.values(multiformats_src_basics_bases).map((c) => c.decoder); -const convert_anybaseDecoder = (function () { - let acc = convert_decoders[0].or(convert_decoders[1]); - convert_decoders.slice(2).forEach((d) => (acc = acc.or(d))); - return acc; -})(); -function convert_ip2bytes(ipString) { - if (!isIP(ipString)) { - throw new Error('invalid ip address'); - } - return src_ip_toBytes(ipString); -} -function convert_bytes2ip(ipBuff) { - const ipString = src_ip_toString(ipBuff, 0, ipBuff.length); - if (ipString == null) { - throw new Error('ipBuff is required'); - } - if (!isIP(ipString)) { - throw new Error('invalid ip address'); - } - return ipString; -} -function convert_port2bytes(port) { - const buf = new ArrayBuffer(2); - const view = new DataView(buf); - view.setUint16(0, port); - return new Uint8Array(buf); -} -function convert_bytes2port(buf) { - const view = new DataView(buf.buffer); - return view.getUint16(buf.byteOffset); -} -function convert_str2bytes(str) { - const buf = src_from_string_fromString(str); - const size = Uint8Array.from(node_modules_varint.encode(buf.length)); - return src_concat_concat([size, buf], size.length + buf.length); -} -function convert_bytes2str(buf) { - const size = node_modules_varint.decode(buf); - buf = buf.slice(node_modules_varint.decode.bytes); - if (buf.length !== size) { - throw new Error('inconsistent lengths'); - } - return src_to_string_toString(buf); -} -function convert_mh2bytes(hash) { - let mh; - if (hash[0] === 'Q' || hash[0] === '1') { - mh = ipfs_core_utils_node_modules_multiformats_src_hashes_digest_decode(ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc.decode(`z${hash}`)).bytes; - } - else { - mh = ipfs_core_utils_node_modules_multiformats_src_cid_CID.parse(hash).multihash.bytes; - } - // the address is a varint prefixed multihash string representation - const size = Uint8Array.from(node_modules_varint.encode(mh.length)); - return src_concat_concat([size, mh], size.length + mh.length); -} -function convert_mb2bytes(mbstr) { - const mb = convert_anybaseDecoder.decode(mbstr); - const size = Uint8Array.from(node_modules_varint.encode(mb.length)); - return src_concat_concat([size, mb], size.length + mb.length); -} -function convert_bytes2mb(buf) { - const size = node_modules_varint.decode(buf); - const hash = buf.slice(node_modules_varint.decode.bytes); - if (hash.length !== size) { - throw new Error('inconsistent lengths'); - } - return 'u' + src_to_string_toString(hash, 'base64url'); -} /** - * Converts bytes to bas58btc string + * @param {Uint8Array} data + * @param {number} [offset=0] + * @returns {[number, number]} */ -function convert_bytes2mh(buf) { - const size = node_modules_varint.decode(buf); - const address = buf.slice(node_modules_varint.decode.bytes); - if (address.length !== size) { - throw new Error('inconsistent lengths'); - } - return src_to_string_toString(address, 'base58btc'); -} -function convert_onion2bytes(str) { - const addr = str.split(':'); - if (addr.length !== 2) { - throw new Error(`failed to parse onion addr: ["'${addr.join('", "')}'"]' does not contain a port number`); - } - if (addr[0].length !== 16) { - throw new Error(`failed to parse onion addr: ${addr[0]} not a Tor onion address.`); - } - // onion addresses do not include the multibase prefix, add it before decoding - const buf = ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32.decode('b' + addr[0]); - // onion port number - const port = parseInt(addr[1], 10); - if (port < 1 || port > 65536) { - throw new Error('Port number is not in range(1, 65536)'); - } - const portBuf = convert_port2bytes(port); - return src_concat_concat([buf, portBuf], buf.length + portBuf.length); -} -function convert_onion32bytes(str) { - const addr = str.split(':'); - if (addr.length !== 2) { - throw new Error(`failed to parse onion addr: ["'${addr.join('", "')}'"]' does not contain a port number`); - } - if (addr[0].length !== 56) { - throw new Error(`failed to parse onion addr: ${addr[0]} not a Tor onion3 address.`); - } - // onion addresses do not include the multibase prefix, add it before decoding - const buf = ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32.decode(`b${addr[0]}`); - // onion port number - const port = parseInt(addr[1], 10); - if (port < 1 || port > 65536) { - throw new Error('Port number is not in range(1, 65536)'); - } - const portBuf = convert_port2bytes(port); - return src_concat_concat([buf, portBuf], buf.length + portBuf.length); -} -function convert_bytes2onion(buf) { - const addrBytes = buf.slice(0, buf.length - 2); - const portBytes = buf.slice(buf.length - 2); - const addr = src_to_string_toString(addrBytes, 'base32'); - const port = convert_bytes2port(portBytes); - return `${addr}:${port}`; +const multiformats_src_varint_decode = (data, offset = 0) => { + const code = multiformats_vendor_varint.decode(data, offset) + return [code, multiformats_vendor_varint.decode.bytes] } -//# sourceMappingURL=convert.js.map -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/@multiformats/multiaddr/dist/src/codec.js - - - - -/** - * string -> [[str name, str addr]... ] - */ -function stringToStringTuples(str) { - const tuples = []; - const parts = str.split('/').slice(1); // skip first empty elem - if (parts.length === 1 && parts[0] === '') { - return []; - } - for (let p = 0; p < parts.length; p++) { - const part = parts[p]; - const proto = src_protocols_table_getProtocol(part); - if (proto.size === 0) { - tuples.push([part]); - // eslint-disable-next-line no-continue - continue; - } - p++; // advance addr part - if (p >= parts.length) { - throw codec_ParseError('invalid address: ' + str); - } - // if it's a path proto, take the rest - if (proto.path === true) { - tuples.push([ - part, - // should we need to check each path part to see if it's a proto? - // This would allow for other protocols to be added after a unix path, - // however it would have issues if the path had a protocol name in the path - codec_cleanPath(parts.slice(p).join('/')) - ]); - break; - } - tuples.push([part, parts[p]]); - } - return tuples; -} -/** - * [[str name, str addr]... ] -> string - */ -function codec_stringTuplesToString(tuples) { - const parts = []; - tuples.map((tup) => { - const proto = protoFromTuple(tup); - parts.push(proto.name); - if (tup.length > 1 && tup[1] != null) { - parts.push(tup[1]); - } - return null; - }); - return codec_cleanPath(parts.join('/')); -} -/** - * [[str name, str addr]... ] -> [[int code, Uint8Array]... ] - */ -function stringTuplesToTuples(tuples) { - return tuples.map((tup) => { - if (!Array.isArray(tup)) { - tup = [tup]; - } - const proto = protoFromTuple(tup); - if (tup.length > 1) { - return [proto.code, convert_convertToBytes(proto.code, tup[1])]; - } - return [proto.code]; - }); -} -/** - * Convert tuples to string tuples - * - * [[int code, Uint8Array]... ] -> [[int code, str addr]... ] - */ -function tuplesToStringTuples(tuples) { - return tuples.map(tup => { - const proto = protoFromTuple(tup); - if (tup[1] != null) { - return [proto.code, convert_convertToString(proto.code, tup[1])]; - } - return [proto.code]; - }); -} -/** - * [[int code, Uint8Array ]... ] -> Uint8Array - */ -function codec_tuplesToBytes(tuples) { - return fromBytes(src_concat_concat(tuples.map((tup) => { - const proto = protoFromTuple(tup); - let buf = Uint8Array.from(node_modules_varint.encode(proto.code)); - if (tup.length > 1 && tup[1] != null) { - buf = src_concat_concat([buf, tup[1]]); // add address buffer - } - return buf; - }))); -} /** - * For the passed address, return the serialized size + * @param {number} int + * @param {Uint8Array} target + * @param {number} [offset=0] */ -function codec_sizeForAddr(p, addr) { - if (p.size > 0) { - return p.size / 8; - } - else if (p.size === 0) { - return 0; - } - else { - const size = node_modules_varint.decode(addr); - return size + (node_modules_varint.decode.bytes ?? 0); - } -} -function codec_bytesToTuples(buf) { - const tuples = []; - let i = 0; - while (i < buf.length) { - const code = node_modules_varint.decode(buf, i); - const n = node_modules_varint.decode.bytes ?? 0; - const p = src_protocols_table_getProtocol(code); - const size = codec_sizeForAddr(p, buf.slice(i + n)); - if (size === 0) { - tuples.push([code]); - i += n; - // eslint-disable-next-line no-continue - continue; - } - const addr = buf.slice(i + n, i + n + size); - i += (size + n); - if (i > buf.length) { // did not end _exactly_ at buffer.length - throw codec_ParseError('Invalid address Uint8Array: ' + src_to_string_toString(buf, 'base16')); - } - // ok, tuple seems good. - tuples.push([code, addr]); - } - return tuples; +const multiformats_src_varint_encodeTo = (int, target, offset = 0) => { + multiformats_vendor_varint.encode(int, target, offset) + return target } + /** - * Uint8Array -> String + * @param {number} int + * @returns {number} */ -function bytesToString(buf) { - const a = codec_bytesToTuples(buf); - const b = tuplesToStringTuples(a); - return codec_stringTuplesToString(b); +const multiformats_src_varint_encodingLength = (int) => { + return multiformats_vendor_varint.encodingLength(int) } + +;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/src/hashes/digest.js + + + /** - * String -> Uint8Array + * Creates a multihash digest. + * + * @template {number} Code + * @param {Code} code + * @param {Uint8Array} digest */ -function stringToBytes(str) { - str = codec_cleanPath(str); - const a = stringToStringTuples(str); - const b = stringTuplesToTuples(a); - return codec_tuplesToBytes(b); +const multiformats_src_hashes_digest_create = (code, digest) => { + const size = digest.byteLength + const sizeOffset = multiformats_src_varint_encodingLength(code) + const digestOffset = sizeOffset + multiformats_src_varint_encodingLength(size) + + const bytes = new Uint8Array(digestOffset + size) + multiformats_src_varint_encodeTo(code, bytes, 0) + multiformats_src_varint_encodeTo(size, bytes, sizeOffset) + bytes.set(digest, digestOffset) + + return new multiformats_src_hashes_digest_Digest(code, size, digest, bytes) } + /** - * String -> Uint8Array + * Turns bytes representation of multihash digest into an instance. + * + * @param {Uint8Array} multihash + * @returns {MultihashDigest} */ -function codec_fromString(str) { - return stringToBytes(str); +const multiformats_src_hashes_digest_decode = (multihash) => { + const bytes = multiformats_src_bytes_coerce(multihash) + const [code, sizeOffset] = multiformats_src_varint_decode(bytes) + const [size, digestOffset] = multiformats_src_varint_decode(bytes.subarray(sizeOffset)) + const digest = bytes.subarray(sizeOffset + digestOffset) + + if (digest.byteLength !== size) { + throw new Error('Incorrect length') + } + + return new multiformats_src_hashes_digest_Digest(code, size, digest, bytes) } + /** - * Uint8Array -> Uint8Array + * @param {MultihashDigest} a + * @param {unknown} b + * @returns {b is MultihashDigest} */ -function fromBytes(buf) { - const err = validateBytes(buf); - if (err != null) { - throw err; - } - return Uint8Array.from(buf); // copy -} -function validateBytes(buf) { - try { - codec_bytesToTuples(buf); // try to parse. will throw if breaks - } - catch (err) { - return err; - } -} -function isValidBytes(buf) { - return validateBytes(buf) === undefined; -} -function codec_cleanPath(str) { - return '/' + str.trim().split('/').filter((a) => a).join('/'); -} -function codec_ParseError(str) { - return new Error('Error parsing address: ' + str); -} -function protoFromTuple(tup) { - const proto = src_protocols_table_getProtocol(tup[0]); - return proto; +const multiformats_src_hashes_digest_equals = (a, b) => { + if (a === b) { + return true + } else { + const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) + + return ( + a.code === data.code && + a.size === data.size && + data.bytes instanceof Uint8Array && + multiformats_src_bytes_equals(a.bytes, data.bytes) + ) + } } -//# sourceMappingURL=codec.js.map -// EXTERNAL MODULE: ./node_modules/err-code/index.js -var err_code = __nccwpck_require__(22077); -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/dist/src/equals.js + /** - * Returns true if the two passed Uint8Arrays have the same content + * @typedef {import('./interface.js').MultihashDigest} MultihashDigest */ -function src_equals_equals(a, b) { - if (a === b) { - return true; - } - if (a.byteLength !== b.byteLength) { - return false; - } - for (let i = 0; i < a.byteLength; i++) { - if (a[i] !== b[i]) { - return false; - } - } - return true; -} -//# sourceMappingURL=equals.js.map -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/@multiformats/multiaddr/dist/src/index.js + /** - * @packageDocumentation - * - * An implementation of a Multiaddr in JavaScript - * - * @example - * - * ```js - * import { multiaddr } from '@multiformats/multiaddr' + * Represents a multihash digest which carries information about the + * hashing algorithm and an actual hash digest. * - * const ma = multiaddr('/ip4/127.0.0.1/tcp/1234') - * ``` + * @template {number} Code + * @template {number} Size + * @class + * @implements {MultihashDigest} */ -var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -}; -var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -}; -var _DefaultMultiaddr_string, _DefaultMultiaddr_tuples, _DefaultMultiaddr_stringTuples, _a; +class multiformats_src_hashes_digest_Digest { + /** + * Creates a multihash digest. + * + * @param {Code} code + * @param {Size} size + * @param {Uint8Array} digest + * @param {Uint8Array} bytes + */ + constructor (code, size, digest, bytes) { + this.code = code + this.size = size + this.digest = digest + this.bytes = bytes + } +} +;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/src/bases/base58.js +const multiformats_src_bases_base58_base58btc = src_bases_base_baseX({ + name: 'base58btc', + prefix: 'z', + alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +}) +const src_bases_base58_base58flickr = src_bases_base_baseX({ + name: 'base58flickr', + prefix: 'Z', + alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' +}) +;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/src/bases/base32.js +const multiformats_src_bases_base32_base32 = src_bases_base_rfc4648({ + prefix: 'b', + name: 'base32', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567', + bitsPerChar: 5 +}) + +const multiformats_src_bases_base32_base32upper = src_bases_base_rfc4648({ + prefix: 'B', + name: 'base32upper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', + bitsPerChar: 5 +}) + +const src_bases_base32_base32pad = src_bases_base_rfc4648({ + prefix: 'c', + name: 'base32pad', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', + bitsPerChar: 5 +}) + +const src_bases_base32_base32padupper = src_bases_base_rfc4648({ + prefix: 'C', + name: 'base32padupper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', + bitsPerChar: 5 +}) + +const src_bases_base32_base32hex = src_bases_base_rfc4648({ + prefix: 'v', + name: 'base32hex', + alphabet: '0123456789abcdefghijklmnopqrstuv', + bitsPerChar: 5 +}) + +const src_bases_base32_base32hexupper = src_bases_base_rfc4648({ + prefix: 'V', + name: 'base32hexupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', + bitsPerChar: 5 +}) + +const src_bases_base32_base32hexpad = src_bases_base_rfc4648({ + prefix: 't', + name: 'base32hexpad', + alphabet: '0123456789abcdefghijklmnopqrstuv=', + bitsPerChar: 5 +}) + +const src_bases_base32_base32hexpadupper = src_bases_base_rfc4648({ + prefix: 'T', + name: 'base32hexpadupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', + bitsPerChar: 5 +}) + +const src_bases_base32_base32z = src_bases_base_rfc4648({ + prefix: 'h', + name: 'base32z', + alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', + bitsPerChar: 5 +}) + +;// CONCATENATED MODULE: ./node_modules/dag-jose/node_modules/multiformats/src/cid.js + + + + + +// Linter can see that API is used in types. +// eslint-disable-next-line + + +// This way TS will also expose all the types from module + -const src_inspect = Symbol.for('nodejs.util.inspect.custom'); -const src_DNS_CODES = [ - src_protocols_table_getProtocol('dns').code, - src_protocols_table_getProtocol('dns4').code, - src_protocols_table_getProtocol('dns6').code, - src_protocols_table_getProtocol('dnsaddr').code -]; -/** - * All configured {@link Resolver}s - */ -const src_resolvers = new Map(); -const src_symbol = Symbol.for('@multiformats/js-multiaddr/multiaddr'); /** - * Creates a Multiaddr from a node-friendly address object - * - * @example - * ```js - * import { fromNodeAddress } from '@multiformats/multiaddr' - * - * fromNodeAddress({address: '127.0.0.1', port: '4001'}, 'tcp') - * // Multiaddr(/ip4/127.0.0.1/tcp/4001) - * ``` + * @template {API.Link} T + * @template {string} Prefix + * @param {T} link + * @param {API.MultibaseEncoder} [base] + * @returns {API.ToString} */ -function src_fromNodeAddress(addr, transport) { - if (addr == null) { - throw new Error('requires node address object'); - } - if (transport == null) { - throw new Error('requires transport protocol'); - } - let ip; - let host = addr.address; - switch (addr.family) { - case 4: - ip = 'ip4'; - break; - case 6: - ip = 'ip6'; - if (host.includes('%')) { - const parts = host.split('%'); - if (parts.length !== 2) { - throw Error('Multiple ip6 zones in multiaddr'); - } - host = parts[0]; - const zone = parts[1]; - ip = `/ip6zone/${zone}/ip6`; - } - break; - default: - throw Error('Invalid addr family, should be 4 or 6.'); - } - return new DefaultMultiaddr('/' + [ip, host, transport, addr.port].join('/')); +const multiformats_src_cid_format = (link, base) => { + const { bytes, version } = link + switch (version) { + case 0: + return multiformats_src_cid_toStringV0( + bytes, + multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder<"z">} */ (base) || multiformats_src_bases_base58_base58btc.encoder + ) + default: + return multiformats_src_cid_toStringV1( + bytes, + multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder} */ (base || multiformats_src_bases_base32_base32.encoder) + ) + } } + /** - * Returns if something is a {@link Multiaddr} that is a resolvable name - * - * @example - * - * ```js - * import { isName, multiaddr } from '@multiformats/multiaddr' - * - * isName(multiaddr('/ip4/127.0.0.1')) - * // false - * isName(multiaddr('/dns/ipfs.io')) - * // true - * ``` + * @template {API.UnknownLink} Link + * @param {Link} link + * @returns {API.LinkJSON} */ -function src_isName(addr) { - if (!src_isMultiaddr(addr)) { - return false; - } - // if a part of the multiaddr is resolvable, then return true - return addr.protos().some((proto) => proto.resolvable); -} +const multiformats_src_cid_toJSON = (link) => ({ + '/': multiformats_src_cid_format(link) +}) + /** - * Check if object is a {@link Multiaddr} instance - * - * @example - * - * ```js - * import { isMultiaddr, multiaddr } from '@multiformats/multiaddr' - * - * isMultiaddr(5) - * // false - * isMultiaddr(multiaddr('/ip4/127.0.0.1')) - * // true - * ``` + * @template {API.UnknownLink} Link + * @param {API.LinkJSON} json */ -function src_isMultiaddr(value) { - return Boolean(value?.[src_symbol]); -} +const multiformats_src_cid_fromJSON = (json) => + multiformats_src_cid_CID.parse(json['/']) + +/** @type {WeakMap>} */ +const multiformats_src_cid_cache = new WeakMap() + /** - * Creates a {@link Multiaddr} from a {@link MultiaddrInput} + * @param {API.UnknownLink} cid + * @returns {Map} */ -class DefaultMultiaddr { - constructor(addr) { - _DefaultMultiaddr_string.set(this, void 0); - _DefaultMultiaddr_tuples.set(this, void 0); - _DefaultMultiaddr_stringTuples.set(this, void 0); - this[_a] = true; - // default - if (addr == null) { - addr = ''; - } - if (addr instanceof Uint8Array) { - this.bytes = fromBytes(addr); - } - else if (typeof addr === 'string') { - if (addr.length > 0 && addr.charAt(0) !== '/') { - throw new Error(`multiaddr "${addr}" must start with a "/"`); - } - this.bytes = codec_fromString(addr); - } - else if (src_isMultiaddr(addr)) { // Multiaddr - this.bytes = fromBytes(addr.bytes); // validate + copy buffer - } - else { - throw new Error('addr must be a string, Buffer, or another Multiaddr'); - } - } - toString() { - if (__classPrivateFieldGet(this, _DefaultMultiaddr_string, "f") == null) { - __classPrivateFieldSet(this, _DefaultMultiaddr_string, bytesToString(this.bytes), "f"); - } - return __classPrivateFieldGet(this, _DefaultMultiaddr_string, "f"); - } - toJSON() { - return this.toString(); - } - toOptions() { - let family; - let transport; - let host; - let port; - let zone = ''; - const tcp = src_protocols_table_getProtocol('tcp'); - const udp = src_protocols_table_getProtocol('udp'); - const ip4 = src_protocols_table_getProtocol('ip4'); - const ip6 = src_protocols_table_getProtocol('ip6'); - const dns6 = src_protocols_table_getProtocol('dns6'); - const ip6zone = src_protocols_table_getProtocol('ip6zone'); - for (const [code, value] of this.stringTuples()) { - if (code === ip6zone.code) { - zone = `%${value ?? ''}`; - } - // default to https when protocol & port are omitted from DNS addrs - if (src_DNS_CODES.includes(code)) { - transport = tcp.name; - port = 443; - host = `${value ?? ''}${zone}`; - family = code === dns6.code ? 6 : 4; - } - if (code === tcp.code || code === udp.code) { - transport = src_protocols_table_getProtocol(code).name; - port = parseInt(value ?? ''); - } - if (code === ip4.code || code === ip6.code) { - transport = src_protocols_table_getProtocol(code).name; - host = `${value ?? ''}${zone}`; - family = code === ip6.code ? 6 : 4; - } - } - if (family == null || transport == null || host == null || port == null) { - throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".'); - } - const opts = { - family, - host, - transport, - port - }; - return opts; - } - protos() { - return this.protoCodes().map(code => Object.assign({}, src_protocols_table_getProtocol(code))); - } - protoCodes() { - const codes = []; - const buf = this.bytes; - let i = 0; - while (i < buf.length) { - const code = node_modules_varint.decode(buf, i); - const n = node_modules_varint.decode.bytes ?? 0; - const p = src_protocols_table_getProtocol(code); - const size = codec_sizeForAddr(p, buf.slice(i + n)); - i += (size + n); - codes.push(code); - } - return codes; - } - protoNames() { - return this.protos().map(proto => proto.name); - } - tuples() { - if (__classPrivateFieldGet(this, _DefaultMultiaddr_tuples, "f") == null) { - __classPrivateFieldSet(this, _DefaultMultiaddr_tuples, codec_bytesToTuples(this.bytes), "f"); - } - return __classPrivateFieldGet(this, _DefaultMultiaddr_tuples, "f"); - } - stringTuples() { - if (__classPrivateFieldGet(this, _DefaultMultiaddr_stringTuples, "f") == null) { - __classPrivateFieldSet(this, _DefaultMultiaddr_stringTuples, tuplesToStringTuples(this.tuples()), "f"); - } - return __classPrivateFieldGet(this, _DefaultMultiaddr_stringTuples, "f"); - } - encapsulate(addr) { - addr = new DefaultMultiaddr(addr); - return new DefaultMultiaddr(this.toString() + addr.toString()); - } - decapsulate(addr) { - const addrString = addr.toString(); - const s = this.toString(); - const i = s.lastIndexOf(addrString); - if (i < 0) { - throw new Error(`Address ${this.toString()} does not contain subaddress: ${addr.toString()}`); - } - return new DefaultMultiaddr(s.slice(0, i)); - } - decapsulateCode(code) { - const tuples = this.tuples(); - for (let i = tuples.length - 1; i >= 0; i--) { - if (tuples[i][0] === code) { - return new DefaultMultiaddr(codec_tuplesToBytes(tuples.slice(0, i))); - } - } - return this; - } - getPeerId() { - try { - const tuples = this.stringTuples().filter((tuple) => { - if (tuple[0] === protocols_table_names.ipfs.code) { - return true; - } - return false; - }); - // Get the last ipfs tuple ['ipfs', 'peerid string'] - const tuple = tuples.pop(); - if (tuple?.[1] != null) { - const peerIdStr = tuple[1]; - // peer id is base58btc encoded string but not multibase encoded so add the `z` - // prefix so we can validate that it is correctly encoded - if (peerIdStr[0] === 'Q' || peerIdStr[0] === '1') { - return src_to_string_toString(ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc.decode(`z${peerIdStr}`), 'base58btc'); - } - // try to parse peer id as CID - return src_to_string_toString(ipfs_core_utils_node_modules_multiformats_src_cid_CID.parse(peerIdStr).multihash.bytes, 'base58btc'); - } - return null; - } - catch (e) { - return null; - } - } - getPath() { - let path = null; - try { - path = this.stringTuples().filter((tuple) => { - const proto = src_protocols_table_getProtocol(tuple[0]); - if (proto.path === true) { - return true; - } - return false; - })[0][1]; - if (path == null) { - path = null; - } - } - catch { - path = null; - } - return path; - } - equals(addr) { - return src_equals_equals(this.bytes, addr.bytes); - } - async resolve(options) { - const resolvableProto = this.protos().find((p) => p.resolvable); - // Multiaddr is not resolvable? - if (resolvableProto == null) { - return [this]; - } - const resolver = src_resolvers.get(resolvableProto.name); - if (resolver == null) { - throw err_code(new Error(`no available resolver for ${resolvableProto.name}`), 'ERR_NO_AVAILABLE_RESOLVER'); - } - const addresses = await resolver(this, options); - return addresses.map((a) => new DefaultMultiaddr(a)); - } - nodeAddress() { - const options = this.toOptions(); - if (options.transport !== 'tcp' && options.transport !== 'udp') { - throw new Error(`multiaddr must have a valid format - no protocol with name: "${options.transport}". Must have a valid transport protocol: "{tcp, udp}"`); - } - return { - family: options.family, - address: options.host, - port: options.port - }; - } - isThinWaistAddress(addr) { - const protos = (addr ?? this).protos(); - if (protos.length !== 2) { - return false; - } - if (protos[0].code !== 4 && protos[0].code !== 41) { - return false; - } - if (protos[1].code !== 6 && protos[1].code !== 273) { - return false; - } - return true; - } - /** - * Returns Multiaddr as a human-readable string - * https://nodejs.org/api/util.html#utilinspectcustom - * - * @example - * ```js - * import { multiaddr } from '@multiformats/multiaddr' - * - * console.info(multiaddr('/ip4/127.0.0.1/tcp/4001')) - * // 'Multiaddr(/ip4/127.0.0.1/tcp/4001)' - * ``` - */ - [(_DefaultMultiaddr_string = new WeakMap(), _DefaultMultiaddr_tuples = new WeakMap(), _DefaultMultiaddr_stringTuples = new WeakMap(), _a = src_symbol, src_inspect)]() { - return `Multiaddr(${bytesToString(this.bytes)})`; - } +const multiformats_src_cid_baseCache = cid => { + const baseCache = multiformats_src_cid_cache.get(cid) + if (baseCache == null) { + const baseCache = new Map() + multiformats_src_cid_cache.set(cid, baseCache) + return baseCache + } + return baseCache } + /** - * A function that takes a {@link MultiaddrInput} and returns a {@link Multiaddr} - * - * @example - * ```js - * import { multiaddr } from '@libp2p/multiaddr' - * - * multiaddr('/ip4/127.0.0.1/tcp/4001') - * // Multiaddr(/ip4/127.0.0.1/tcp/4001) - * ``` - * - * @param {MultiaddrInput} [addr] - If String or Uint8Array, needs to adhere to the address format of a [multiaddr](https://github.com/multiformats/multiaddr#string-format) + * @template {unknown} [Data=unknown] + * @template {number} [Format=number] + * @template {number} [Alg=number] + * @template {API.Version} [Version=API.Version] + * @implements {API.Link} */ -function dist_src_multiaddr(addr) { - return new DefaultMultiaddr(addr); -} -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr-to-uri/dist/src/index.js +class multiformats_src_cid_CID { + /** + * @param {Version} version - Version of the CID + * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content. + * @param {Uint8Array} bytes + * + */ + constructor (version, code, multihash, bytes) { + /** @readonly */ + this.code = code + /** @readonly */ + this.version = version + /** @readonly */ + this.multihash = multihash + /** @readonly */ + this.bytes = bytes -function extractSNI(ma) { - let sniProtoCode; - try { - sniProtoCode = protocols_table_getProtocol('sni').code; - } - catch (e) { - // No SNI protocol in multiaddr - return null; - } - for (const [proto, value] of ma) { - if (proto === sniProtoCode && value !== undefined) { - return value; - } - } - return null; -} -function hasTLS(ma) { - return ma.some(([proto, _]) => proto === protocols_table_getProtocol('tls').code); -} -function interpretNext(headProtoCode, headProtoVal, restMa) { - const interpreter = interpreters[protocols_table_getProtocol(headProtoCode).name]; - if (interpreter === undefined) { - throw new Error(`Can't interpret protocol ${protocols_table_getProtocol(headProtoCode).name}`); - } - const restVal = interpreter(headProtoVal, restMa); - if (headProtoCode === protocols_table_getProtocol('ip6').code) { - return `[${restVal}]`; - } - return restVal; -} -const interpreters = { - ip4: (value, restMa) => value, - ip6: (value, restMa) => { - if (restMa.length === 0) { - return value; - } - return `[${value}]`; - }, - tcp: (value, restMa) => { - const tailProto = restMa.pop(); - if (tailProto === undefined) { - throw new Error('Unexpected end of multiaddr'); - } - return `tcp://${interpretNext(tailProto[0], tailProto[1] ?? '', restMa)}:${value}`; - }, - udp: (value, restMa) => { - const tailProto = restMa.pop(); - if (tailProto === undefined) { - throw new Error('Unexpected end of multiaddr'); - } - return `udp://${interpretNext(tailProto[0], tailProto[1] ?? '', restMa)}:${value}`; - }, - dnsaddr: (value, restMa) => value, - dns4: (value, restMa) => value, - dns6: (value, restMa) => value, - dns: (value, restMa) => value, - ipfs: (value, restMa) => { - const tailProto = restMa.pop(); - if (tailProto === undefined) { - throw new Error('Unexpected end of multiaddr'); - } - return `${interpretNext(tailProto[0], tailProto[1] ?? '', restMa)}/ipfs/${value}`; - }, - p2p: (value, restMa) => { - const tailProto = restMa.pop(); - if (tailProto === undefined) { - throw new Error('Unexpected end of multiaddr'); - } - return `${interpretNext(tailProto[0], tailProto[1] ?? '', restMa)}/p2p/${value}`; - }, - http: (value, restMa) => { - const maHasTLS = hasTLS(restMa); - const sni = extractSNI(restMa); - if (maHasTLS && sni !== null) { - return `https://${sni}`; - } - const protocol = maHasTLS ? 'https://' : 'http://'; - const tailProto = restMa.pop(); - if (tailProto === undefined) { - throw new Error('Unexpected end of multiaddr'); - } - let baseVal = interpretNext(tailProto[0], tailProto[1] ?? '', restMa); - // We are reinterpreting the base as http, so we need to remove the tcp:// if it's there - baseVal = baseVal.replace('tcp://', ''); - return `${protocol}${baseVal}`; - }, - tls: (value, restMa) => { - // Noop, the parent context knows that it's tls. We don't need to do - // anything here - const tailProto = restMa.pop(); - if (tailProto === undefined) { - throw new Error('Unexpected end of multiaddr'); - } - return interpretNext(tailProto[0], tailProto[1] ?? '', restMa); - }, - sni: (value, restMa) => { - // Noop, the parent context uses the sni information, we don't need to do - // anything here - const tailProto = restMa.pop(); - if (tailProto === undefined) { - throw new Error('Unexpected end of multiaddr'); - } - return interpretNext(tailProto[0], tailProto[1] ?? '', restMa); - }, - https: (value, restMa) => { - const tailProto = restMa.pop(); - if (tailProto === undefined) { - throw new Error('Unexpected end of multiaddr'); - } - let baseVal = interpretNext(tailProto[0], tailProto[1] ?? '', restMa); - // We are reinterpreting the base as http, so we need to remove the tcp:// if it's there - baseVal = baseVal.replace('tcp://', ''); - return `https://${baseVal}`; - }, - ws: (value, restMa) => { - const maHasTLS = hasTLS(restMa); - const sni = extractSNI(restMa); - if (maHasTLS && sni !== null) { - return `wss://${sni}`; - } - const protocol = maHasTLS ? 'wss://' : 'ws://'; - const tailProto = restMa.pop(); - if (tailProto === undefined) { - throw new Error('Unexpected end of multiaddr'); - } - let baseVal = interpretNext(tailProto[0], tailProto[1] ?? '', restMa); - // We are reinterpreting the base, so we need to remove the tcp:// if it's there - baseVal = baseVal.replace('tcp://', ''); - return `${protocol}${baseVal}`; - }, - wss: (value, restMa) => { - const tailProto = restMa.pop(); - if (tailProto === undefined) { - throw new Error('Unexpected end of multiaddr'); - } - let baseVal = interpretNext(tailProto[0], tailProto[1] ?? '', restMa); - // We are reinterpreting the base as http, so we need to remove the tcp:// if it's there - baseVal = baseVal.replace('tcp://', ''); - return `wss://${baseVal}`; - }, - 'p2p-websocket-star': (value, restMa) => { - const tailProto = restMa.pop(); - if (tailProto === undefined) { - throw new Error('Unexpected end of multiaddr'); - } - return `${interpretNext(tailProto[0], tailProto[1] ?? '', restMa)}/p2p-websocket-star`; - }, - 'p2p-webrtc-star': (value, restMa) => { - const tailProto = restMa.pop(); - if (tailProto === undefined) { - throw new Error('Unexpected end of multiaddr'); - } - return `${interpretNext(tailProto[0], tailProto[1] ?? '', restMa)}/p2p-webrtc-star`; - }, - 'p2p-webrtc-direct': (value, restMa) => { - const tailProto = restMa.pop(); - if (tailProto === undefined) { - throw new Error('Unexpected end of multiaddr'); - } - return `${interpretNext(tailProto[0], tailProto[1] ?? '', restMa)}/p2p-webrtc-direct`; - } -}; -function multiaddrToUri(input, opts) { - const ma = src_multiaddr(input); - const parts = ma.stringTuples(); - const head = parts.pop(); - if (head === undefined) { - throw new Error('Unexpected end of multiaddr'); - } - const protocol = protocols_table_getProtocol(head[0]); - const interpreter = interpreters[protocol.name]; - if (interpreter == null) { - throw new Error(`No interpreter found for ${protocol.name}`); - } - let uri = interpreter(head[1] ?? '', parts); - if (opts?.assumeHttp !== false && head[0] === protocols_table_getProtocol('tcp').code) { - // If rightmost proto is tcp, we assume http here - uri = uri.replace('tcp://', 'http://'); - if (head[1] === '443' || head[1] === '80') { - if (head[1] === '443') { - uri = uri.replace('http://', 'https://'); - } - // Drop the port - uri = uri.substring(0, uri.lastIndexOf(':')); - } - } - return uri; -} -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/to-url-string.js + // flag to serializers that this is a CID and + // should be treated specially + /** @readonly */ + this['/'] = bytes + } + /** + * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` + * please either use `CID.asCID(cid)` or switch to new signalling mechanism + * + * @deprecated + */ + get asCID () { + return this + } + // ArrayBufferView + get byteOffset () { + return this.bytes.byteOffset + } -/** - * @typedef {import('@multiformats/multiaddr').Multiaddr} Multiaddr - */ + // ArrayBufferView + get byteLength () { + return this.bytes.byteLength + } -/** - * @param {string|Multiaddr|URL} url - A string, multiaddr or URL to convert to a url string - * @returns {string} - */ -function toUrlString (url) { - try { - // @ts-expect-error - url = multiaddrToUri(dist_src_multiaddr(url)) - } catch (/** @type {any} */ err) { } + /** + * @returns {CID} + */ + toV0 () { + switch (this.version) { + case 0: { + return /** @type {CID} */ (this) + } + case 1: { + const { code, multihash } = this - url = url.toString() + if (code !== multiformats_src_cid_DAG_PB_CODE) { + throw new Error('Cannot convert a non dag-pb CID to CIDv0') + } - return url -} + // sha2-256 + if (multihash.code !== multiformats_src_cid_SHA_256_CODE) { + throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') + } -// EXTERNAL MODULE: external "http" -var external_http_ = __nccwpck_require__(13685); -// EXTERNAL MODULE: external "https" -var external_https_ = __nccwpck_require__(95687); -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/agent.js + return /** @type {CID} */ ( + multiformats_src_cid_CID.createV0( + /** @type {API.MultihashDigest} */ (multihash) + ) + ) + } + default: { + throw Error( + `Can not convert CID version ${this.version} to version 0. This is a bug please report` + ) + } + } + } + /** + * @returns {CID} + */ + toV1 () { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash + const multihash = multiformats_src_hashes_digest_create(code, digest) + return /** @type {CID} */ ( + multiformats_src_cid_CID.createV1(this.code, multihash) + ) + } + case 1: { + return /** @type {CID} */ (this) + } + default: { + throw Error( + `Can not convert CID version ${this.version} to version 1. This is a bug please report` + ) + } + } + } + /** + * @param {unknown} other + * @returns {other is CID} + */ + equals (other) { + return multiformats_src_cid_CID.equals(this, other) + } -/** - * @param {URL} [url] - */ -/* harmony default export */ const src_agent = ((url) => { - if (!url) { - throw new Error('URL required') + /** + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @param {API.Link} self + * @param {unknown} other + * @returns {other is CID} + */ + static equals (self, other) { + const unknown = + /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ ( + other + ) + return ( + unknown && + self.code === unknown.code && + self.version === unknown.version && + multiformats_src_hashes_digest_equals(self.multihash, unknown.multihash) + ) } - return url.protocol.startsWith('https') ? external_https_.Agent : external_http_.Agent -}); + /** + * @param {API.MultibaseEncoder} [base] + * @returns {string} + */ + toString (base) { + return multiformats_src_cid_format(this, base) + } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/core.js + toJSON () { + return { '/': multiformats_src_cid_format(this) } + } -/* eslint-env browser */ + link () { + return this + } + get [Symbol.toStringTag] () { + return 'CID' + } + // Legacy + [Symbol.for('nodejs.util.inspect.custom')] () { + return `CID(${this.toString()})` + } + /** + * Takes any input `value` and returns a `CID` instance if it was + * a `CID` otherwise returns `null`. If `value` is instanceof `CID` + * it will return value back. If `value` is not instance of this CID + * class, but is compatible CID it will return new instance of this + * `CID` class. Otherwise returns null. + * + * This allows two different incompatible versions of CID library to + * co-exist and interop as long as binary interface is compatible. + * + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @template {unknown} U + * @param {API.Link|U} input + * @returns {CID|null} + */ + static asCID (input) { + if (input == null) { + return null + } + const value = /** @type {any} */ (input) + if (value instanceof multiformats_src_cid_CID) { + // If value is instance of CID then we're all set. + return value + } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { + // If value isn't instance of this CID class but `this.asCID === this` or + // `value['/'] === value.bytes` is true it is CID instance coming from a + // different implementation (diff version or duplicate). In that case we + // rebase it to this `CID` implementation so caller is guaranteed to get + // instance with expected API. + const { version, code, multihash, bytes } = value + return new multiformats_src_cid_CID( + version, + code, + /** @type {API.MultihashDigest} */ (multihash), + bytes || multiformats_src_cid_encodeCID(version, code, multihash.bytes) + ) + } else if (value[multiformats_src_cid_cidSymbol] === true) { + // If value is a CID from older implementation that used to be tagged via + // symbol we still rebase it to the this `CID` implementation by + // delegating that to a constructor. + const { version, multihash, code } = value + const digest = + /** @type {API.MultihashDigest} */ + (multiformats_src_hashes_digest_decode(multihash)) + return multiformats_src_cid_CID.create(version, code, digest) + } else { + // Otherwise value is not a CID (or an incompatible version of it) in + // which case we return `null`. + return null + } + } + /** + * + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @param {Version} version - Version of the CID + * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param {API.MultihashDigest} digest - (Multi)hash of the of the content. + * @returns {CID} + */ + static create (version, code, digest) { + if (typeof code !== 'number') { + throw new Error('String codecs are no longer supported') + } + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error('Invalid digest') + } + switch (version) { + case 0: { + if (code !== multiformats_src_cid_DAG_PB_CODE) { + throw new Error( + `Version 0 CID must use dag-pb (code: ${multiformats_src_cid_DAG_PB_CODE}) block encoding` + ) + } else { + return new multiformats_src_cid_CID(version, code, digest, digest.bytes) + } + } + case 1: { + const bytes = multiformats_src_cid_encodeCID(version, code, digest.bytes) + return new multiformats_src_cid_CID(version, code, digest, bytes) + } + default: { + throw new Error('Invalid version') + } + } + } + /** + * Simplified version of `create` for CIDv0. + * + * @template {unknown} [T=unknown] + * @param {API.MultihashDigest} digest - Multihash. + * @returns {CID} + */ + static createV0 (digest) { + return multiformats_src_cid_CID.create(0, multiformats_src_cid_DAG_PB_CODE, digest) + } -const log = logger('js-kubo-rpc-client:lib:error-handler') -const core_merge = node_modules_merge_options.bind({ ignoreUndefined: true }) + /** + * Simplified version of `create` for CIDv1. + * + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @param {Code} code - Content encoding format code. + * @param {API.MultihashDigest} digest - Miltihash of the content. + * @returns {CID} + */ + static createV1 (code, digest) { + return multiformats_src_cid_CID.create(1, code, digest) + } -const DEFAULT_PROTOCOL = env.isBrowser || env.isWebWorker ? location.protocol : 'http' -const DEFAULT_HOST = env.isBrowser || env.isWebWorker ? location.hostname : 'localhost' -const DEFAULT_PORT = env.isBrowser || env.isWebWorker ? location.port : '5001' + /** + * Decoded a CID from its binary representation. The byte array must contain + * only the CID with no additional bytes. + * + * An error will be thrown if the bytes provided do not contain a valid + * binary representation of a CID. + * + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ByteView>} bytes + * @returns {CID} + */ + static decode (bytes) { + const [cid, remainder] = multiformats_src_cid_CID.decodeFirst(bytes) + if (remainder.length) { + throw new Error('Incorrect length') + } + return cid + } -/** - * @typedef {import('../types').Options} Options - */ + /** + * Decoded a CID from its binary representation at the beginning of a byte + * array. + * + * Returns an array with the first element containing the CID and the second + * element containing the remainder of the original byte array. The remainder + * will be a zero-length byte array if the provided bytes only contained a + * binary CID representation. + * + * @template {unknown} T + * @template {number} C + * @template {number} A + * @template {API.Version} V + * @param {API.ByteView>} bytes + * @returns {[CID, Uint8Array]} + */ + static decodeFirst (bytes) { + const specs = multiformats_src_cid_CID.inspectBytes(bytes) + const prefixSize = specs.size - specs.multihashSize + const multihashBytes = multiformats_src_bytes_coerce( + bytes.subarray(prefixSize, prefixSize + specs.multihashSize) + ) + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error('Incorrect length') + } + const digestBytes = multihashBytes.subarray( + specs.multihashSize - specs.digestSize + ) + const digest = new multiformats_src_hashes_digest_Digest( + specs.multihashCode, + specs.digestSize, + digestBytes, + multihashBytes + ) + const cid = + specs.version === 0 + ? multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) + : multiformats_src_cid_CID.createV1(specs.codec, digest) + return [/** @type {CID} */(cid), bytes.subarray(specs.size)] + } -/** - * @typedef {import('../types').Multiaddr} Multiaddr - */ + /** + * Inspect the initial bytes of a CID to determine its properties. + * + * Involves decoding up to 4 varints. Typically this will require only 4 to 6 + * bytes but for larger multicodec code values and larger multihash digest + * lengths these varints can be quite large. It is recommended that at least + * 10 bytes be made available in the `initialBytes` argument for a complete + * inspection. + * + * @template {unknown} T + * @template {number} C + * @template {number} A + * @template {API.Version} V + * @param {API.ByteView>} initialBytes + * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }} + */ + static inspectBytes (initialBytes) { + let offset = 0 + const next = () => { + const [i, length] = multiformats_src_varint_decode(initialBytes.subarray(offset)) + offset += length + return i + } -/** - * @param {Options|URL|Multiaddr|string} [options] - * @returns {Options} - */ -const normalizeOptions = (options = {}) => { - let url - /** @type {Options} */ - let opts = {} - let agent + let version = /** @type {V} */ (next()) + let codec = /** @type {C} */ (multiformats_src_cid_DAG_PB_CODE) + if (/** @type {number} */(version) === 18) { + // CIDv0 + version = /** @type {V} */ (0) + offset = 0 + } else { + codec = /** @type {C} */ (next()) + } - if (typeof options === 'string' || isMultiaddr(options)) { - url = new URL(toUrlString(options)) - } else if (options instanceof URL) { - url = options - } else if (typeof options.url === 'string' || isMultiaddr(options.url)) { - url = new URL(toUrlString(options.url)) - opts = options - } else if (options.url instanceof URL) { - url = options.url - opts = options - } else { - opts = options || {} + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`) + } - const protocol = (opts.protocol || DEFAULT_PROTOCOL).replace(':', '') - const host = (opts.host || DEFAULT_HOST).split(':')[0] - const port = (opts.port || DEFAULT_PORT) + const prefixSize = offset + const multihashCode = /** @type {A} */ (next()) // multihash code + const digestSize = next() // multihash length + const size = offset + digestSize + const multihashSize = size - prefixSize - url = new URL(`${protocol}://${host}:${port}`) + return { version, codec, multihashCode, digestSize, multihashSize, size } } - if (opts.apiPath) { - url.pathname = opts.apiPath - } else if (url.pathname === '/' || url.pathname === undefined) { - url.pathname = 'api/v0' - } + /** + * Takes cid in a string representation and creates an instance. If `base` + * decoder is not provided will use a default from the configuration. It will + * throw an error if encoding of the CID is not compatible with supplied (or + * a default decoder). + * + * @template {string} Prefix + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ToString, Prefix>} source + * @param {API.MultibaseDecoder} [base] + * @returns {CID} + */ + static parse (source, base) { + const [prefix, bytes] = multiformats_src_cid_parseCIDtoBytes(source, base) - if (env.isNode) { - const Agent = src_agent(url) + const cid = multiformats_src_cid_CID.decode(bytes) - agent = opts.agent || new Agent({ - keepAlive: true, - // Similar to browsers which limit connections to six per host - maxSockets: 6 - }) - } + if (cid.version === 0 && source[0] !== 'Q') { + throw Error('Version 0 CID string must not include multibase prefix') + } - return { - ...opts, - host: url.host, - protocol: url.protocol.replace(':', ''), - port: Number(url.port), - apiPath: url.pathname, - url, - agent + // Cache string representation to avoid computing it on `this.toString()` + multiformats_src_cid_baseCache(cid).set(prefix, source) + + return cid } } /** - * @param {Response} response + * @template {string} Prefix + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ToString, Prefix>} source + * @param {API.MultibaseDecoder} [base] + * @returns {[Prefix, API.ByteView>]} */ -const errorHandler = async (response) => { - let msg - - try { - if ((response.headers.get('Content-Type') || '').startsWith('application/json')) { - const data = await response.json() - log(data) - msg = data.Message || data.message - } else { - msg = await response.text() +const multiformats_src_cid_parseCIDtoBytes = (source, base) => { + switch (source[0]) { + // CIDv0 is parsed differently + case 'Q': { + const decoder = base || multiformats_src_bases_base58_base58btc + return [ + /** @type {Prefix} */ (multiformats_src_bases_base58_base58btc.prefix), + decoder.decode(`${multiformats_src_bases_base58_base58btc.prefix}${source}`) + ] } - } catch (/** @type {any} */ err) { - log('Failed to parse error response', err) - // Failed to extract/parse error message from response - msg = err.message - } - - /** @type {Error} */ - let error = new http.HTTPError(response) - - if (msg) { - // This is what rs-ipfs returns where there's a timeout - if (msg.includes('deadline has elapsed')) { - error = new http.TimeoutError() + case multiformats_src_bases_base58_base58btc.prefix: { + const decoder = base || multiformats_src_bases_base58_base58btc + return [/** @type {Prefix} */(multiformats_src_bases_base58_base58btc.prefix), decoder.decode(source)] } - - // This is what go-ipfs returns where there's a timeout - if (msg && msg.includes('context deadline exceeded')) { - error = new http.TimeoutError() + case multiformats_src_bases_base32_base32.prefix: { + const decoder = base || multiformats_src_bases_base32_base32 + return [/** @type {Prefix} */(multiformats_src_bases_base32_base32.prefix), decoder.decode(source)] + } + default: { + if (base == null) { + throw Error( + 'To parse non base32 or base58btc encoded CID multibase decoder must be provided' + ) + } + return [/** @type {Prefix} */(source[0]), base.decode(source)] } } +} - // This also gets returned - if (msg && msg.includes('request timed out')) { - error = new http.TimeoutError() +/** + * + * @param {Uint8Array} bytes + * @param {Map} cache + * @param {API.MultibaseEncoder<'z'>} base + */ +const multiformats_src_cid_toStringV0 = (bytes, cache, base) => { + const { prefix } = base + if (prefix !== multiformats_src_bases_base58_base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base.name} encoding`) } - // If we managed to extract a message from the response, use it - if (msg) { - error.message = msg + const cid = cache.get(prefix) + if (cid == null) { + const cid = base.encode(bytes).slice(1) + cache.set(prefix, cid) + return cid + } else { + return cid } - - throw error } -const KEBAB_REGEX = /[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g - /** - * @param {string} str + * @template {string} Prefix + * @param {Uint8Array} bytes + * @param {Map} cache + * @param {API.MultibaseEncoder} base */ -const kebabCase = (str) => { - return str.replace(KEBAB_REGEX, function (match) { - return '-' + match.toLowerCase() - }) +const multiformats_src_cid_toStringV1 = (bytes, cache, base) => { + const { prefix } = base + const cid = cache.get(prefix) + if (cid == null) { + const cid = base.encode(bytes) + cache.set(prefix, cid) + return cid + } else { + return cid + } } +const multiformats_src_cid_DAG_PB_CODE = 0x70 +const multiformats_src_cid_SHA_256_CODE = 0x12 + /** - * @param {string | number} value + * @param {API.Version} version + * @param {number} code + * @param {Uint8Array} multihash + * @returns {Uint8Array} */ -const parseTimeout = (value) => { - return typeof value === 'string' ? parse_duration(value) : value +const multiformats_src_cid_encodeCID = (version, code, multihash) => { + const codeOffset = multiformats_src_varint_encodingLength(version) + const hashOffset = codeOffset + multiformats_src_varint_encodingLength(code) + const bytes = new Uint8Array(hashOffset + multihash.byteLength) + multiformats_src_varint_encodeTo(version, bytes, 0) + multiformats_src_varint_encodeTo(code, bytes, codeOffset) + bytes.set(multihash, hashOffset) + return bytes } -class Client extends http { - /** - * @param {Options|URL|Multiaddr|string} [options] - */ - constructor (options = {}) { - const opts = normalizeOptions(options) - - super({ - timeout: parseTimeout(opts.timeout || 0) || undefined, - headers: opts.headers, - base: `${opts.url}`, - handleError: errorHandler, - transformSearchParams: (search) => { - const out = new URLSearchParams() +const multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') - for (const [key, value] of search) { - if ( - value !== 'undefined' && - value !== 'null' && - key !== 'signal' - ) { - out.append(kebabCase(key), value) - } +;// CONCATENATED MODULE: ./node_modules/dag-jose/lib/signing.js - // @ts-expect-error server timeouts are strings - if (key === 'timeout' && !isNaN(value)) { - out.append(kebabCase(key), value) - } - } - return out - }, - // @ts-expect-error this can be a https agent or a http agent - agent: opts.agent - }) +function fromSplit(split) { + const [protectedHeader, payload, signature] = split; + return { + payload, + signatures: [{ protected: protectedHeader, signature }], + link: multiformats_src_cid_CID.decode(fromBase64url(payload)), + }; +} +function encodeSignature(signature) { + const encoded = { + signature: fromBase64url(signature.signature), + }; + if (signature.header) + encoded.header = signature.header; + if (signature.protected) + encoded.protected = fromBase64url(signature.protected); + return encoded; +} +function signing_encode(jws) { + const payload = fromBase64url(jws.payload); + try { + multiformats_src_cid_CID.decode(payload); + } + catch (e) { + throw new Error('Not a valid DagJWS'); + } + return { + payload, + signatures: jws.signatures.map(encodeSignature), + }; +} +function decodeSignature(encoded) { + const sign = { + signature: toBase64url(encoded.signature), + }; + if (encoded.header) + sign.header = encoded.header; + if (encoded.protected) + sign.protected = toBase64url(encoded.protected); + return sign; +} +function signing_decode(encoded) { + const decoded = { + payload: toBase64url(encoded.payload), + signatures: encoded.signatures.map(decodeSignature), + }; + decoded.link = multiformats_src_cid_CID.decode(new Uint8Array(encoded.payload)); + return decoded; +} +//# sourceMappingURL=signing.js.map +;// CONCATENATED MODULE: ./node_modules/dag-jose/lib/encryption.js - // @ts-expect-error - cannot delete no-optional fields - delete this.get - // @ts-expect-error - cannot delete no-optional fields - delete this.put - // @ts-expect-error - cannot delete no-optional fields - delete this.delete - // @ts-expect-error - cannot delete no-optional fields - delete this.options +function encryption_fromSplit(split) { + const [protectedHeader, encrypted_key, iv, ciphertext, tag] = split; + const jwe = { + ciphertext, + iv, + protected: protectedHeader, + tag, + }; + if (encrypted_key) + jwe.recipients = [{ encrypted_key }]; + return jwe; +} +function encodeRecipient(recipient) { + const encRec = {}; + if (recipient.encrypted_key) + encRec.encrypted_key = fromBase64url(recipient.encrypted_key); + if (recipient.header) + encRec.header = recipient.header; + return encRec; +} +function encryption_encode(jwe) { + const encJwe = { + ciphertext: fromBase64url(jwe.ciphertext), + protected: fromBase64url(jwe.protected), + iv: fromBase64url(jwe.iv), + tag: fromBase64url(jwe.tag), + }; + if (jwe.aad) + encJwe.aad = fromBase64url(jwe.aad); + if (jwe.recipients) + encJwe.recipients = jwe.recipients.map(encodeRecipient); + if (jwe.unprotected) + encJwe.unprotected = jwe.unprotected; + return encJwe; +} +function decodeRecipient(encoded) { + const recipient = {}; + if (encoded.encrypted_key) + recipient.encrypted_key = toBase64url(encoded.encrypted_key); + if (encoded.header) + recipient.header = encoded.header; + return recipient; +} +function encryption_decode(encoded) { + const jwe = { + ciphertext: toBase64url(encoded.ciphertext), + protected: toBase64url(encoded.protected), + iv: toBase64url(encoded.iv), + tag: toBase64url(encoded.tag), + }; + if (encoded.aad) + jwe.aad = toBase64url(encoded.aad); + if (encoded.recipients) + jwe.recipients = encoded.recipients.map(decodeRecipient); + if (encoded.unprotected) + jwe.unprotected = encoded.unprotected; + return jwe; +} +//# sourceMappingURL=encryption.js.map +;// CONCATENATED MODULE: ./node_modules/dag-jose/lib/index.js - const fetch = this.fetch - /** - * @param {string | Request} resource - * @param {import('../types').HTTPOptions} options - */ - this.fetch = (resource, options = {}) => { - if (typeof resource === 'string' && !resource.startsWith('/')) { - resource = `${opts.url}/${resource}` - } - return fetch.call(this, resource, core_merge(options, { - method: 'POST' - })) +const lib_name = 'dag-jose'; +const lib_code = 133; +function isDagJWS(jose) { + return ('payload' in jose && + typeof jose.payload === 'string' && + 'signatures' in jose && + Array.isArray(jose.signatures)); +} +function isEncodedJWS(jose) { + return ('payload' in jose && + jose.payload instanceof Uint8Array && + 'signatures' in jose && + Array.isArray(jose.signatures)); +} +function isEncodedJWE(jose) { + return ('ciphertext' in jose && + jose.ciphertext instanceof Uint8Array && + 'iv' in jose && + jose.iv instanceof Uint8Array && + 'protected' in jose && + jose.protected instanceof Uint8Array && + 'tag' in jose && + jose.tag instanceof Uint8Array); +} +function isDagJWE(jose) { + return ('ciphertext' in jose && + typeof jose.ciphertext === 'string' && + 'iv' in jose && + typeof jose.iv === 'string' && + 'protected' in jose && + typeof jose.protected === 'string' && + 'tag' in jose && + typeof jose.tag === 'string'); +} +function toGeneral(jose) { + if (typeof jose === 'string') { + const split = jose.split('.'); + if (split.length === 3) { + return fromSplit(split); + } + else if (split.length === 5) { + return encryption_fromSplit(split); + } + throw new Error('Not a valid JOSE string'); } - } + if (isDagJWS(jose) || isDagJWE(jose)) { + return jose; + } + throw new Error('Not a valid unencoded JOSE object'); } +function lib_encode(obj) { + if (typeof obj === 'string') { + obj = toGeneral(obj); + } + let encodedJose; + if (isDagJWS(obj)) { + encodedJose = signing_encode(obj); + } + else if (isDagJWE(obj)) { + encodedJose = encryption_encode(obj); + } + else { + throw new Error('Not a valid JOSE object'); + } + return new Uint8Array(dag_cbor_src_encode(encodedJose)); +} +function lib_decode(data) { + let encoded; + try { + encoded = dag_cbor_src_decode(data); + } + catch (e) { + throw new Error('Not a valid DAG-JOSE object'); + } + if (isEncodedJWS(encoded)) { + return signing_decode(encoded); + } + else if (isEncodedJWE(encoded)) { + return encryption_decode(encoded); + } + else { + throw new Error('Not a valid DAG-JOSE object'); + } +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bytes.js +const node_modules_multiformats_src_bytes_empty = new Uint8Array(0) -const HTTPError = http.HTTPError - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/configure.js -/* eslint-env browser */ - +/** + * @param {Uint8Array} d + */ +const node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') /** - * Set default configuration and call create function with them - * - * @template T - * @param {import('../types').ConfigureFn} fn - * @returns {import('../types').ConfigureFactory} + * @param {string} hex */ -const configure = (fn) => { - return (options) => { - return fn(new Client(options), options) - } +const node_modules_multiformats_src_bytes_fromHex = hex => { + const hexes = hex.match(/../g) + return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : node_modules_multiformats_src_bytes_empty } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/mode-to-string.js - /** - * @param {number | string | undefined} mode + * @param {Uint8Array} aa + * @param {Uint8Array} bb */ -function modeToString (mode) { - if (mode == null) { - return undefined +const node_modules_multiformats_src_bytes_equals = (aa, bb) => { + if (aa === bb) return true + if (aa.byteLength !== bb.byteLength) { + return false } - if (typeof mode === 'string') { - return mode + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false + } } - return mode.toString(8).padStart(4, '0') + return true } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/parse-mtime.js +/** + * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o + * @returns {Uint8Array} + */ +const node_modules_multiformats_src_bytes_coerce = o => { + if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o + if (o instanceof ArrayBuffer) return new Uint8Array(o) + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) + } + throw new Error('Unknown type, must be binary type') +} +/** + * @param {any} o + * @returns {o is ArrayBuffer|ArrayBufferView} + */ +const node_modules_multiformats_src_bytes_isBinary = o => + o instanceof ArrayBuffer || ArrayBuffer.isView(o) /** - * @param {any} input + * @param {string} str + * @returns {Uint8Array} */ -function parseMtime (input) { - if (input == null) { - return undefined - } +const node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) - /** @type {{ secs: number, nsecs?: number } | undefined} */ - let mtime +/** + * @param {Uint8Array} b + * @returns {string} + */ +const node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) - // { secs, nsecs } - if (input.secs != null) { - mtime = { - secs: input.secs, - nsecs: input.nsecs - } - } - // UnixFS TimeSpec - if (input.Seconds != null) { - mtime = { - secs: input.Seconds, - nsecs: input.FractionalNanoseconds - } - } - // process.hrtime() - if (Array.isArray(input)) { - mtime = { - secs: input[0], - nsecs: input[1] - } - } +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/vendor/varint.js +var node_modules_multiformats_vendor_varint_encode_1 = node_modules_multiformats_vendor_varint_encode; - // Javascript Date - if (input instanceof Date) { - const ms = input.getTime() - const secs = Math.floor(ms / 1000) +var node_modules_multiformats_vendor_varint_MSB = 0x80 + , node_modules_multiformats_vendor_varint_REST = 0x7F + , node_modules_multiformats_vendor_varint_MSBALL = ~node_modules_multiformats_vendor_varint_REST + , node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31); - mtime = { - secs, - nsecs: (ms - (secs * 1000)) * 1000 - } +function node_modules_multiformats_vendor_varint_encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; + + while(num >= node_modules_multiformats_vendor_varint_INT) { + out[offset++] = (num & 0xFF) | node_modules_multiformats_vendor_varint_MSB; + num /= 128; + } + while(num & node_modules_multiformats_vendor_varint_MSBALL) { + out[offset++] = (num & 0xFF) | node_modules_multiformats_vendor_varint_MSB; + num >>>= 7; } + out[offset] = num | 0; + + node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; + + return out +} - /* - TODO: https://github.com/ipfs/aegir/issues/487 +var node_modules_multiformats_vendor_varint_decode = node_modules_multiformats_vendor_varint_read; - // process.hrtime.bigint() - if (input instanceof BigInt) { - const secs = input / BigInt(1e9) - const nsecs = input - (secs * BigInt(1e9)) +var node_modules_multiformats_vendor_varint_MSB$1 = 0x80 + , node_modules_multiformats_vendor_varint_REST$1 = 0x7F; - mtime = { - secs: parseInt(secs.toString()), - nsecs: parseInt(nsecs.toString()) - } - } - */ +function node_modules_multiformats_vendor_varint_read(buf, offset) { + var res = 0 + , offset = offset || 0 + , shift = 0 + , counter = offset + , b + , l = buf.length; - if (!Object.prototype.hasOwnProperty.call(mtime, 'secs')) { - return undefined - } + do { + if (counter >= l) { + node_modules_multiformats_vendor_varint_read.bytes = 0; + throw new RangeError('Could not decode varint') + } + b = buf[counter++]; + res += shift < 28 + ? (b & node_modules_multiformats_vendor_varint_REST$1) << shift + : (b & node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= node_modules_multiformats_vendor_varint_MSB$1) - if (mtime != null && mtime.nsecs != null && (mtime.nsecs < 0 || mtime.nsecs > 999999999)) { - throw err_code(new Error('mtime-nsecs must be within the range [0,999999999]'), 'ERR_INVALID_MTIME_NSECS') - } + node_modules_multiformats_vendor_varint_read.bytes = counter - offset; - return mtime + return res } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/to-url-search-params.js +var node_modules_multiformats_vendor_varint_N1 = Math.pow(2, 7); +var node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14); +var node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21); +var node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28); +var node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35); +var node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42); +var node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49); +var node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56); +var node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63); + +var node_modules_multiformats_vendor_varint_length = function (value) { + return ( + value < node_modules_multiformats_vendor_varint_N1 ? 1 + : value < node_modules_multiformats_vendor_varint_N2 ? 2 + : value < node_modules_multiformats_vendor_varint_N3 ? 3 + : value < node_modules_multiformats_vendor_varint_N4 ? 4 + : value < node_modules_multiformats_vendor_varint_N5 ? 5 + : value < node_modules_multiformats_vendor_varint_N6 ? 6 + : value < node_modules_multiformats_vendor_varint_N7 ? 7 + : value < node_modules_multiformats_vendor_varint_N8 ? 8 + : value < node_modules_multiformats_vendor_varint_N9 ? 9 + : 10 + ) +}; +var node_modules_multiformats_vendor_varint_varint = { + encode: node_modules_multiformats_vendor_varint_encode_1 + , decode: node_modules_multiformats_vendor_varint_decode + , encodingLength: node_modules_multiformats_vendor_varint_length +}; + +var node_modules_multiformats_vendor_varint_brrp_varint = node_modules_multiformats_vendor_varint_varint; + +/* harmony default export */ const node_modules_multiformats_vendor_varint = (node_modules_multiformats_vendor_varint_brrp_varint); + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/varint.js /** - * @param {*} params - * @returns {URLSearchParams} + * @param {Uint8Array} data + * @param {number} [offset=0] + * @returns {[number, number]} */ -function toUrlSearchParams ({ arg, searchParams, hashAlg, mtime, mode, ...options } = {}) { - if (searchParams) { - options = { - ...options, - ...searchParams - } - } - - if (hashAlg) { - options.hash = hashAlg - } +const node_modules_multiformats_src_varint_decode = (data, offset = 0) => { + const code = node_modules_multiformats_vendor_varint.decode(data, offset) + return [code, node_modules_multiformats_vendor_varint.decode.bytes] +} - if (mtime != null) { - mtime = parseMtime(mtime) +/** + * @param {number} int + * @param {Uint8Array} target + * @param {number} [offset=0] + */ +const node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => { + node_modules_multiformats_vendor_varint.encode(int, target, offset) + return target +} - options.mtime = mtime.secs - options.mtimeNsecs = mtime.nsecs - } +/** + * @param {number} int + * @returns {number} + */ +const node_modules_multiformats_src_varint_encodingLength = (int) => { + return node_modules_multiformats_vendor_varint.encodingLength(int) +} - if (mode != null) { - options.mode = modeToString(mode) - } +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/hashes/digest.js - if (options.timeout && !isNaN(options.timeout)) { - // server API expects timeouts as strings - options.timeout = `${options.timeout}ms` - } - if (arg === undefined || arg === null) { - arg = [] - } else if (!Array.isArray(arg)) { - arg = [arg] - } - const urlSearchParams = new URLSearchParams(options) +/** + * Creates a multihash digest. + * + * @template {number} Code + * @param {Code} code + * @param {Uint8Array} digest + */ +const node_modules_multiformats_src_hashes_digest_create = (code, digest) => { + const size = digest.byteLength + const sizeOffset = node_modules_multiformats_src_varint_encodingLength(code) + const digestOffset = sizeOffset + node_modules_multiformats_src_varint_encodingLength(size) - arg.forEach((/** @type {any} */ arg) => urlSearchParams.append('arg', arg)) + const bytes = new Uint8Array(digestOffset + size) + node_modules_multiformats_src_varint_encodeTo(code, bytes, 0) + node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset) + bytes.set(digest, digestOffset) - return urlSearchParams + return new node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/bitswap/wantlist.js +/** + * Turns bytes representation of multihash digest into an instance. + * + * @param {Uint8Array} multihash + * @returns {MultihashDigest} + */ +const node_modules_multiformats_src_hashes_digest_decode = (multihash) => { + const bytes = node_modules_multiformats_src_bytes_coerce(multihash) + const [code, sizeOffset] = node_modules_multiformats_src_varint_decode(bytes) + const [size, digestOffset] = node_modules_multiformats_src_varint_decode(bytes.subarray(sizeOffset)) + const digest = bytes.subarray(sizeOffset + digestOffset) + if (digest.byteLength !== size) { + throw new Error('Incorrect length') + } + return new node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) +} +/** + * @param {MultihashDigest} a + * @param {unknown} b + * @returns {b is MultihashDigest} + */ +const node_modules_multiformats_src_hashes_digest_equals = (a, b) => { + if (a === b) { + return true + } else { + const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) -const createWantlist = configure(api => { + return ( + a.code === data.code && + a.size === data.size && + data.bytes instanceof Uint8Array && + node_modules_multiformats_src_bytes_equals(a.bytes, data.bytes) + ) + } +} + +/** + * @typedef {import('./interface.js').MultihashDigest} MultihashDigest + */ + +/** + * Represents a multihash digest which carries information about the + * hashing algorithm and an actual hash digest. + * + * @template {number} Code + * @template {number} Size + * @class + * @implements {MultihashDigest} + */ +class node_modules_multiformats_src_hashes_digest_Digest { /** - * @type {import('../types').BitswapAPI["wantlist"]} + * Creates a multihash digest. + * + * @param {Code} code + * @param {Size} size + * @param {Uint8Array} digest + * @param {Uint8Array} bytes */ - async function wantlist (options = {}) { - const res = await (await api.post('bitswap/wantlist', { - signal: options.signal, - searchParams: toUrlSearchParams(options), - headers: options.headers - })).json() - - return (res.Keys || []).map((/** @type {{ '/': string }} */ k) => node_modules_multiformats_src_cid_CID.parse(k['/'])) + constructor (code, size, digest, bytes) { + this.code = code + this.size = size + this.digest = digest + this.bytes = bytes } - return wantlist -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/bitswap/wantlist-for-peer.js +} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/hashes/identity.js -const createWantlistForPeer = configure(api => { - /** - * @type {import('../types').BitswapAPI["wantlistForPeer"]} - */ - async function wantlistForPeer (peerId, options = {}) { - const res = await (await api.post('bitswap/wantlist', { - signal: options.signal, - searchParams: toUrlSearchParams({ - ...options, - peer: peerId.toString() - }), - headers: options.headers - })).json() +const identity_code = 0x0 +const identity_name = 'identity' - return (res.Keys || []).map((/** @type {{ '/': string }} */ k) => node_modules_multiformats_src_cid_CID.parse(k['/'])) - } - return wantlistForPeer -}) +/** @type {(input:Uint8Array) => Uint8Array} */ +const identity_encode = node_modules_multiformats_src_bytes_coerce -;// CONCATENATED MODULE: ./node_modules/@libp2p/interface-peer-id/dist/src/index.js -const dist_src_symbol = Symbol.for('@libp2p/peer-id'); -function src_isPeerId(other) { - return other != null && Boolean(other[dist_src_symbol]); -} -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@libp2p/interfaces/dist/src/errors.js /** - * When this error is thrown it means an operation was aborted, - * usually in response to the `abort` event being emitted by an - * AbortSignal. + * @param {Uint8Array} input + * @returns {Digest.Digest} */ -class errors_AbortError extends Error { - code; - type; - constructor(message = 'The operation was aborted') { - super(message); - this.code = errors_AbortError.code; - this.type = errors_AbortError.type; - } - static code = (/* unused pure expression or super */ null && ('ABORT_ERR')); - static type = (/* unused pure expression or super */ null && ('aborted')); -} -class src_errors_CodeError extends Error { - code; - props; - constructor(message, code, props) { - super(message); - this.code = code; - this.name = props?.name ?? 'CodeError'; - this.props = props ?? {}; // eslint-disable-line @typescript-eslint/consistent-type-assertions - } -} -//# sourceMappingURL=errors.js.map -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/vendor/base-x.js +const digest = (input) => node_modules_multiformats_src_hashes_digest_create(identity_code, identity_encode(input)) + +const identity_identity = { code: identity_code, name: identity_name, encode: identity_encode, digest } + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/vendor/base-x.js // base-x encoding / decoding // Copyright (c) 2018 base-x contributors // Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) // Distributed under the MIT software license, see the accompanying // file LICENSE or http://www.opensource.org/licenses/mit-license.php. -function peer_id_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { +function node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } var BASE_MAP = new Uint8Array(256); for (var j = 0; j < BASE_MAP.length; j++) { @@ -229038,82 +148481,13 @@ function peer_id_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { decode: decode } } -var peer_id_node_modules_multiformats_vendor_base_x_src = peer_id_node_modules_multiformats_vendor_base_x_base; - -var peer_id_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = peer_id_node_modules_multiformats_vendor_base_x_src; - -/* harmony default export */ const peer_id_node_modules_multiformats_vendor_base_x = (peer_id_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX); - -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bytes.js -const peer_id_node_modules_multiformats_src_bytes_empty = new Uint8Array(0) - -/** - * @param {Uint8Array} d - */ -const peer_id_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') - -/** - * @param {string} hex - */ -const peer_id_node_modules_multiformats_src_bytes_fromHex = hex => { - const hexes = hex.match(/../g) - return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : peer_id_node_modules_multiformats_src_bytes_empty -} - -/** - * @param {Uint8Array} aa - * @param {Uint8Array} bb - */ -const peer_id_node_modules_multiformats_src_bytes_equals = (aa, bb) => { - if (aa === bb) return true - if (aa.byteLength !== bb.byteLength) { - return false - } - - for (let ii = 0; ii < aa.byteLength; ii++) { - if (aa[ii] !== bb[ii]) { - return false - } - } - - return true -} - -/** - * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o - * @returns {Uint8Array} - */ -const peer_id_node_modules_multiformats_src_bytes_coerce = o => { - if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o - if (o instanceof ArrayBuffer) return new Uint8Array(o) - if (ArrayBuffer.isView(o)) { - return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) - } - throw new Error('Unknown type, must be binary type') -} - -/** - * @param {any} o - * @returns {o is ArrayBuffer|ArrayBufferView} - */ -const peer_id_node_modules_multiformats_src_bytes_isBinary = o => - o instanceof ArrayBuffer || ArrayBuffer.isView(o) - -/** - * @param {string} str - * @returns {Uint8Array} - */ -const peer_id_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) - -/** - * @param {Uint8Array} b - * @returns {string} - */ -const peer_id_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) +var node_modules_multiformats_vendor_base_x_src = node_modules_multiformats_vendor_base_x_base; +var node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = node_modules_multiformats_vendor_base_x_src; +/* harmony default export */ const node_modules_multiformats_vendor_base_x = (node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX); -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base.js // Linter can't see that API is used in types. @@ -229131,7 +148505,7 @@ const peer_id_node_modules_multiformats_src_bytes_toString = b => (new TextDecod * @implements {API.MultibaseEncoder} * @implements {API.BaseEncoder} */ -class peer_id_node_modules_multiformats_src_bases_base_Encoder { +class multiformats_src_bases_base_Encoder { /** * @param {Base} name * @param {Prefix} prefix @@ -229171,7 +148545,7 @@ class peer_id_node_modules_multiformats_src_bases_base_Encoder { * @implements {API.UnibaseDecoder} * @implements {API.BaseDecoder} */ -class peer_id_node_modules_multiformats_src_bases_base_Decoder { +class multiformats_src_bases_base_Decoder { /** * @param {Base} name * @param {Prefix} prefix @@ -229209,7 +148583,7 @@ class peer_id_node_modules_multiformats_src_bases_base_Decoder { * @returns {ComposedDecoder} */ or (decoder) { - return peer_id_node_modules_multiformats_src_bases_base_or(this, decoder) + return multiformats_src_bases_base_or(this, decoder) } } @@ -229223,7 +148597,7 @@ class peer_id_node_modules_multiformats_src_bases_base_Decoder { * @implements {API.MultibaseDecoder} * @implements {API.CombobaseDecoder} */ -class peer_id_node_modules_multiformats_src_bases_base_ComposedDecoder { +class multiformats_src_bases_base_ComposedDecoder { /** * @param {Decoders} decoders */ @@ -229237,7 +148611,7 @@ class peer_id_node_modules_multiformats_src_bases_base_ComposedDecoder { * @returns {ComposedDecoder} */ or (decoder) { - return peer_id_node_modules_multiformats_src_bases_base_or(this, decoder) + return multiformats_src_bases_base_or(this, decoder) } /** @@ -229262,7 +148636,7 @@ class peer_id_node_modules_multiformats_src_bases_base_ComposedDecoder { * @param {API.UnibaseDecoder|API.CombobaseDecoder} right * @returns {ComposedDecoder} */ -const peer_id_node_modules_multiformats_src_bases_base_or = (left, right) => new peer_id_node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({ +const multiformats_src_bases_base_or = (left, right) => new multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({ ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }), ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right }) })) @@ -229278,7 +148652,7 @@ const peer_id_node_modules_multiformats_src_bases_base_or = (left, right) => new * @implements {API.BaseEncoder} * @implements {API.BaseDecoder} */ -class peer_id_node_modules_multiformats_src_bases_base_Codec { +class multiformats_src_bases_base_Codec { /** * @param {Base} name * @param {Prefix} prefix @@ -229290,8 +148664,8 @@ class peer_id_node_modules_multiformats_src_bases_base_Codec { this.prefix = prefix this.baseEncode = baseEncode this.baseDecode = baseDecode - this.encoder = new peer_id_node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode) - this.decoder = new peer_id_node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode) + this.encoder = new multiformats_src_bases_base_Encoder(name, prefix, baseEncode) + this.decoder = new multiformats_src_bases_base_Decoder(name, prefix, baseDecode) } /** @@ -229319,8 +148693,8 @@ class peer_id_node_modules_multiformats_src_bases_base_Codec { * @param {(input:string) => Uint8Array} options.decode * @returns {Codec} */ -const peer_id_node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) => - new peer_id_node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode) +const multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) => + new multiformats_src_bases_base_Codec(name, prefix, encode, decode) /** * @template {string} Base @@ -229331,16 +148705,16 @@ const peer_id_node_modules_multiformats_src_bases_base_from = ({ name, prefix, e * @param {string} options.alphabet * @returns {Codec} */ -const peer_id_node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => { - const { encode, decode } = peer_id_node_modules_multiformats_vendor_base_x(alphabet, name) - return peer_id_node_modules_multiformats_src_bases_base_from({ +const multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => { + const { encode, decode } = node_modules_multiformats_vendor_base_x(alphabet, name) + return multiformats_src_bases_base_from({ prefix, name, encode, /** * @param {string} text */ - decode: text => peer_id_node_modules_multiformats_src_bytes_coerce(decode(text)) + decode: text => node_modules_multiformats_src_bytes_coerce(decode(text)) }) } @@ -229351,7 +148725,7 @@ const peer_id_node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, * @param {string} name * @returns {Uint8Array} */ -const peer_id_node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { +const multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { // Build the character lookup table: /** @type {Record} */ const codes = {} @@ -229404,7 +148778,7 @@ const peer_id_node_modules_multiformats_src_bases_base_decode = (string, alphabe * @param {number} bitsPerChar * @returns {string} */ -const peer_id_node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => { +const multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => { const pad = alphabet[alphabet.length - 1] === '=' const mask = (1 << bitsPerChar) - 1 let out = '' @@ -229449,227 +148823,227 @@ const peer_id_node_modules_multiformats_src_bases_base_encode = (data, alphabet, * @param {string} options.alphabet * @param {number} options.bitsPerChar */ -const peer_id_node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { - return peer_id_node_modules_multiformats_src_bases_base_from({ +const multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { + return multiformats_src_bases_base_from({ prefix, name, encode (input) { - return peer_id_node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar) + return multiformats_src_bases_base_encode(input, alphabet, bitsPerChar) }, decode (input) { - return peer_id_node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name) + return multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name) } }) } -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base58.js - - -const peer_id_node_modules_multiformats_src_bases_base58_base58btc = peer_id_node_modules_multiformats_src_bases_base_baseX({ - name: 'base58btc', - prefix: 'z', - alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -}) - -const peer_id_node_modules_multiformats_src_bases_base58_base58flickr = peer_id_node_modules_multiformats_src_bases_base_baseX({ - name: 'base58flickr', - prefix: 'Z', - alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -}) - -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/identity.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/identity.js // @ts-check -const peer_id_node_modules_multiformats_src_bases_identity_identity = peer_id_node_modules_multiformats_src_bases_base_from({ +const bases_identity_identity = multiformats_src_bases_base_from({ prefix: '\x00', name: 'identity', - encode: (buf) => peer_id_node_modules_multiformats_src_bytes_toString(buf), - decode: (str) => peer_id_node_modules_multiformats_src_bytes_fromString(str) + encode: (buf) => node_modules_multiformats_src_bytes_toString(buf), + decode: (str) => node_modules_multiformats_src_bytes_fromString(str) }) -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base2.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base2.js // @ts-check -const multiformats_src_bases_base2_base2 = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ +const base2 = multiformats_src_bases_base_rfc4648({ prefix: '0', name: 'base2', alphabet: '01', bitsPerChar: 1 }) -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base8.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base8.js // @ts-check -const multiformats_src_bases_base8_base8 = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ +const base8 = multiformats_src_bases_base_rfc4648({ prefix: '7', name: 'base8', alphabet: '01234567', bitsPerChar: 3 }) -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base10.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base10.js -const multiformats_src_bases_base10_base10 = peer_id_node_modules_multiformats_src_bases_base_baseX({ +const base10 = multiformats_src_bases_base_baseX({ prefix: '9', name: 'base10', alphabet: '0123456789' }) -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base16.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base16.js // @ts-check -const multiformats_src_bases_base16_base16 = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ +const base16 = multiformats_src_bases_base_rfc4648({ prefix: 'f', name: 'base16', alphabet: '0123456789abcdef', bitsPerChar: 4 }) -const multiformats_src_bases_base16_base16upper = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ +const base16upper = multiformats_src_bases_base_rfc4648({ prefix: 'F', name: 'base16upper', alphabet: '0123456789ABCDEF', bitsPerChar: 4 }) -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base32.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base32.js -const peer_id_node_modules_multiformats_src_bases_base32_base32 = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ +const node_modules_multiformats_src_bases_base32_base32 = multiformats_src_bases_base_rfc4648({ prefix: 'b', name: 'base32', alphabet: 'abcdefghijklmnopqrstuvwxyz234567', bitsPerChar: 5 }) -const peer_id_node_modules_multiformats_src_bases_base32_base32upper = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ +const node_modules_multiformats_src_bases_base32_base32upper = multiformats_src_bases_base_rfc4648({ prefix: 'B', name: 'base32upper', alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', bitsPerChar: 5 }) -const peer_id_node_modules_multiformats_src_bases_base32_base32pad = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ +const multiformats_src_bases_base32_base32pad = multiformats_src_bases_base_rfc4648({ prefix: 'c', name: 'base32pad', alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', bitsPerChar: 5 }) -const peer_id_node_modules_multiformats_src_bases_base32_base32padupper = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ +const multiformats_src_bases_base32_base32padupper = multiformats_src_bases_base_rfc4648({ prefix: 'C', name: 'base32padupper', alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', bitsPerChar: 5 }) -const peer_id_node_modules_multiformats_src_bases_base32_base32hex = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ +const multiformats_src_bases_base32_base32hex = multiformats_src_bases_base_rfc4648({ prefix: 'v', name: 'base32hex', alphabet: '0123456789abcdefghijklmnopqrstuv', bitsPerChar: 5 }) -const peer_id_node_modules_multiformats_src_bases_base32_base32hexupper = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ +const multiformats_src_bases_base32_base32hexupper = multiformats_src_bases_base_rfc4648({ prefix: 'V', name: 'base32hexupper', alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', bitsPerChar: 5 }) -const peer_id_node_modules_multiformats_src_bases_base32_base32hexpad = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ +const multiformats_src_bases_base32_base32hexpad = multiformats_src_bases_base_rfc4648({ prefix: 't', name: 'base32hexpad', alphabet: '0123456789abcdefghijklmnopqrstuv=', bitsPerChar: 5 }) -const peer_id_node_modules_multiformats_src_bases_base32_base32hexpadupper = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ +const multiformats_src_bases_base32_base32hexpadupper = multiformats_src_bases_base_rfc4648({ prefix: 'T', name: 'base32hexpadupper', alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', bitsPerChar: 5 }) -const peer_id_node_modules_multiformats_src_bases_base32_base32z = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ +const multiformats_src_bases_base32_base32z = multiformats_src_bases_base_rfc4648({ prefix: 'h', name: 'base32z', alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', bitsPerChar: 5 }) -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base36.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base36.js -const multiformats_src_bases_base36_base36 = peer_id_node_modules_multiformats_src_bases_base_baseX({ +const base36 = multiformats_src_bases_base_baseX({ prefix: 'k', name: 'base36', alphabet: '0123456789abcdefghijklmnopqrstuvwxyz' }) -const multiformats_src_bases_base36_base36upper = peer_id_node_modules_multiformats_src_bases_base_baseX({ +const base36upper = multiformats_src_bases_base_baseX({ prefix: 'K', name: 'base36upper', alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' }) -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base64.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base58.js + + +const node_modules_multiformats_src_bases_base58_base58btc = multiformats_src_bases_base_baseX({ + name: 'base58btc', + prefix: 'z', + alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +}) + +const multiformats_src_bases_base58_base58flickr = multiformats_src_bases_base_baseX({ + name: 'base58flickr', + prefix: 'Z', + alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' +}) + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base64.js // @ts-check -const peer_id_node_modules_multiformats_src_bases_base64_base64 = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ +const bases_base64_base64 = multiformats_src_bases_base_rfc4648({ prefix: 'm', name: 'base64', alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', bitsPerChar: 6 }) -const peer_id_node_modules_multiformats_src_bases_base64_base64pad = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ +const bases_base64_base64pad = multiformats_src_bases_base_rfc4648({ prefix: 'M', name: 'base64pad', alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', bitsPerChar: 6 }) -const peer_id_node_modules_multiformats_src_bases_base64_base64url = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ +const bases_base64_base64url = multiformats_src_bases_base_rfc4648({ prefix: 'u', name: 'base64url', alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', bitsPerChar: 6 }) -const peer_id_node_modules_multiformats_src_bases_base64_base64urlpad = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ +const bases_base64_base64urlpad = multiformats_src_bases_base_rfc4648({ prefix: 'U', name: 'base64urlpad', alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', bitsPerChar: 6 }) -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base256emoji.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/bases/base256emoji.js -const multiformats_src_bases_base256emoji_alphabet = Array.from('🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂') -const multiformats_src_bases_base256emoji_alphabetBytesToChars = /** @type {string[]} */ (multiformats_src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[i] = c; return p }, /** @type {string[]} */([]))) -const multiformats_src_bases_base256emoji_alphabetCharsToBytes = /** @type {number[]} */ (multiformats_src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[/** @type {number} */ (c.codePointAt(0))] = i; return p }, /** @type {number[]} */([]))) +const alphabet = Array.from('🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂') +const alphabetBytesToChars = /** @type {string[]} */ (alphabet.reduce((p, c, i) => { p[i] = c; return p }, /** @type {string[]} */([]))) +const alphabetCharsToBytes = /** @type {number[]} */ (alphabet.reduce((p, c, i) => { p[/** @type {number} */ (c.codePointAt(0))] = i; return p }, /** @type {number[]} */([]))) /** * @param {Uint8Array} data * @returns {string} */ -function node_modules_multiformats_src_bases_base256emoji_encode (data) { +function base256emoji_encode (data) { return data.reduce((p, c) => { - p += multiformats_src_bases_base256emoji_alphabetBytesToChars[c] + p += alphabetBytesToChars[c] return p }, '') } @@ -229678,10 +149052,10 @@ function node_modules_multiformats_src_bases_base256emoji_encode (data) { * @param {string} str * @returns {Uint8Array} */ -function node_modules_multiformats_src_bases_base256emoji_decode (str) { +function base256emoji_decode (str) { const byts = [] for (const char of str) { - const byt = multiformats_src_bases_base256emoji_alphabetCharsToBytes[/** @type {number} */ (char.codePointAt(0))] + const byt = alphabetCharsToBytes[/** @type {number} */ (char.codePointAt(0))] if (byt === undefined) { throw new Error(`Non-base256emoji character: ${char}`) } @@ -229690,999 +149064,3667 @@ function node_modules_multiformats_src_bases_base256emoji_decode (str) { return new Uint8Array(byts) } -const multiformats_src_bases_base256emoji_base256emoji = peer_id_node_modules_multiformats_src_bases_base_from({ - prefix: '🚀', - name: 'base256emoji', - encode: node_modules_multiformats_src_bases_base256emoji_encode, - decode: node_modules_multiformats_src_bases_base256emoji_decode -}) +const base256emoji = multiformats_src_bases_base_from({ + prefix: '🚀', + name: 'base256emoji', + encode: base256emoji_encode, + decode: base256emoji_decode +}) + +// EXTERNAL MODULE: external "crypto" +var external_crypto_ = __nccwpck_require__(6113); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/hashes/hasher.js + + +/** + * @template {string} Name + * @template {number} Code + * @param {object} options + * @param {Name} options.name + * @param {Code} options.code + * @param {(input: Uint8Array) => Await} options.encode + */ +const hashes_hasher_from = ({ name, code, encode }) => new hasher_Hasher(name, code, encode) + +/** + * Hasher represents a hashing algorithm implementation that produces as + * `MultihashDigest`. + * + * @template {string} Name + * @template {number} Code + * @class + * @implements {MultihashHasher} + */ +class hasher_Hasher { + /** + * + * @param {Name} name + * @param {Code} code + * @param {(input: Uint8Array) => Await} encode + */ + constructor (name, code, encode) { + this.name = name + this.code = code + this.encode = encode + } + + /** + * @param {Uint8Array} input + * @returns {Await>} + */ + digest (input) { + if (input instanceof Uint8Array) { + const result = this.encode(input) + return result instanceof Uint8Array + ? node_modules_multiformats_src_hashes_digest_create(this.code, result) + /* c8 ignore next 1 */ + : result.then(digest => node_modules_multiformats_src_hashes_digest_create(this.code, digest)) + } else { + throw Error('Unknown type, must be binary type') + /* c8 ignore next 1 */ + } + } +} + +/** + * @template {number} Alg + * @typedef {import('./interface.js').MultihashHasher} MultihashHasher + */ + +/** + * @template T + * @typedef {Promise|T} Await + */ + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/hashes/sha2.js +// @ts-check + + + + + +const sha2_sha256 = hashes_hasher_from({ + name: 'sha2-256', + code: 0x12, + encode: (input) => node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha256').update(input).digest()) +}) + +const sha512 = hashes_hasher_from({ + name: 'sha2-512', + code: 0x13, + encode: input => node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha512').update(input).digest()) +}) + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/codecs/raw.js +// @ts-check + + + +/** + * @template T + * @typedef {import('./interface.js').ByteView} ByteView + */ + +const raw_name = 'raw' +const raw_code = 0x55 + +/** + * @param {Uint8Array} node + * @returns {ByteView} + */ +const raw_encode = (node) => node_modules_multiformats_src_bytes_coerce(node) + +/** + * @param {ByteView} data + * @returns {Uint8Array} + */ +const raw_decode = (data) => node_modules_multiformats_src_bytes_coerce(data) + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/codecs/json.js +// @ts-check + +/** + * @template T + * @typedef {import('./interface.js').ByteView} ByteView + */ + +const json_textEncoder = new TextEncoder() +const json_textDecoder = new TextDecoder() + +const json_name = 'json' +const json_code = 0x0200 + +/** + * @template T + * @param {T} node + * @returns {ByteView} + */ +const json_encode = (node) => json_textEncoder.encode(JSON.stringify(node)) + +/** + * @template T + * @param {ByteView} data + * @returns {T} + */ +const json_decode = (data) => JSON.parse(json_textDecoder.decode(data)) + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/cid.js + + + + + +// Linter can see that API is used in types. +// eslint-disable-next-line + + +// This way TS will also expose all the types from module + + +/** + * @template {API.Link} T + * @template {string} Prefix + * @param {T} link + * @param {API.MultibaseEncoder} [base] + * @returns {API.ToString} + */ +const node_modules_multiformats_src_cid_format = (link, base) => { + const { bytes, version } = link + switch (version) { + case 0: + return node_modules_multiformats_src_cid_toStringV0( + bytes, + node_modules_multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder<"z">} */ (base) || node_modules_multiformats_src_bases_base58_base58btc.encoder + ) + default: + return node_modules_multiformats_src_cid_toStringV1( + bytes, + node_modules_multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder} */ (base || node_modules_multiformats_src_bases_base32_base32.encoder) + ) + } +} + +/** + * @template {API.UnknownLink} Link + * @param {Link} link + * @returns {API.LinkJSON} + */ +const node_modules_multiformats_src_cid_toJSON = (link) => ({ + '/': node_modules_multiformats_src_cid_format(link) +}) + +/** + * @template {API.UnknownLink} Link + * @param {API.LinkJSON} json + */ +const node_modules_multiformats_src_cid_fromJSON = (json) => + node_modules_multiformats_src_cid_CID.parse(json['/']) + +/** @type {WeakMap>} */ +const node_modules_multiformats_src_cid_cache = new WeakMap() + +/** + * @param {API.UnknownLink} cid + * @returns {Map} + */ +const node_modules_multiformats_src_cid_baseCache = cid => { + const baseCache = node_modules_multiformats_src_cid_cache.get(cid) + if (baseCache == null) { + const baseCache = new Map() + node_modules_multiformats_src_cid_cache.set(cid, baseCache) + return baseCache + } + return baseCache +} + +/** + * @template {unknown} [Data=unknown] + * @template {number} [Format=number] + * @template {number} [Alg=number] + * @template {API.Version} [Version=API.Version] + * @implements {API.Link} + */ + +class node_modules_multiformats_src_cid_CID { + /** + * @param {Version} version - Version of the CID + * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content. + * @param {Uint8Array} bytes + * + */ + constructor (version, code, multihash, bytes) { + /** @readonly */ + this.code = code + /** @readonly */ + this.version = version + /** @readonly */ + this.multihash = multihash + /** @readonly */ + this.bytes = bytes + + // flag to serializers that this is a CID and + // should be treated specially + /** @readonly */ + this['/'] = bytes + } + + /** + * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` + * please either use `CID.asCID(cid)` or switch to new signalling mechanism + * + * @deprecated + */ + get asCID () { + return this + } + + // ArrayBufferView + get byteOffset () { + return this.bytes.byteOffset + } + + // ArrayBufferView + get byteLength () { + return this.bytes.byteLength + } + + /** + * @returns {CID} + */ + toV0 () { + switch (this.version) { + case 0: { + return /** @type {CID} */ (this) + } + case 1: { + const { code, multihash } = this + + if (code !== node_modules_multiformats_src_cid_DAG_PB_CODE) { + throw new Error('Cannot convert a non dag-pb CID to CIDv0') + } + + // sha2-256 + if (multihash.code !== node_modules_multiformats_src_cid_SHA_256_CODE) { + throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') + } + + return /** @type {CID} */ ( + node_modules_multiformats_src_cid_CID.createV0( + /** @type {API.MultihashDigest} */ (multihash) + ) + ) + } + default: { + throw Error( + `Can not convert CID version ${this.version} to version 0. This is a bug please report` + ) + } + } + } + + /** + * @returns {CID} + */ + toV1 () { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash + const multihash = node_modules_multiformats_src_hashes_digest_create(code, digest) + return /** @type {CID} */ ( + node_modules_multiformats_src_cid_CID.createV1(this.code, multihash) + ) + } + case 1: { + return /** @type {CID} */ (this) + } + default: { + throw Error( + `Can not convert CID version ${this.version} to version 1. This is a bug please report` + ) + } + } + } + + /** + * @param {unknown} other + * @returns {other is CID} + */ + equals (other) { + return node_modules_multiformats_src_cid_CID.equals(this, other) + } + + /** + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @param {API.Link} self + * @param {unknown} other + * @returns {other is CID} + */ + static equals (self, other) { + const unknown = + /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ ( + other + ) + return ( + unknown && + self.code === unknown.code && + self.version === unknown.version && + node_modules_multiformats_src_hashes_digest_equals(self.multihash, unknown.multihash) + ) + } + + /** + * @param {API.MultibaseEncoder} [base] + * @returns {string} + */ + toString (base) { + return node_modules_multiformats_src_cid_format(this, base) + } + + toJSON () { + return { '/': node_modules_multiformats_src_cid_format(this) } + } + + link () { + return this + } + + get [Symbol.toStringTag] () { + return 'CID' + } + + // Legacy + + [Symbol.for('nodejs.util.inspect.custom')] () { + return `CID(${this.toString()})` + } + + /** + * Takes any input `value` and returns a `CID` instance if it was + * a `CID` otherwise returns `null`. If `value` is instanceof `CID` + * it will return value back. If `value` is not instance of this CID + * class, but is compatible CID it will return new instance of this + * `CID` class. Otherwise returns null. + * + * This allows two different incompatible versions of CID library to + * co-exist and interop as long as binary interface is compatible. + * + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @template {unknown} U + * @param {API.Link|U} input + * @returns {CID|null} + */ + static asCID (input) { + if (input == null) { + return null + } + + const value = /** @type {any} */ (input) + if (value instanceof node_modules_multiformats_src_cid_CID) { + // If value is instance of CID then we're all set. + return value + } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { + // If value isn't instance of this CID class but `this.asCID === this` or + // `value['/'] === value.bytes` is true it is CID instance coming from a + // different implementation (diff version or duplicate). In that case we + // rebase it to this `CID` implementation so caller is guaranteed to get + // instance with expected API. + const { version, code, multihash, bytes } = value + return new node_modules_multiformats_src_cid_CID( + version, + code, + /** @type {API.MultihashDigest} */ (multihash), + bytes || node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes) + ) + } else if (value[node_modules_multiformats_src_cid_cidSymbol] === true) { + // If value is a CID from older implementation that used to be tagged via + // symbol we still rebase it to the this `CID` implementation by + // delegating that to a constructor. + const { version, multihash, code } = value + const digest = + /** @type {API.MultihashDigest} */ + (node_modules_multiformats_src_hashes_digest_decode(multihash)) + return node_modules_multiformats_src_cid_CID.create(version, code, digest) + } else { + // Otherwise value is not a CID (or an incompatible version of it) in + // which case we return `null`. + return null + } + } + + /** + * + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @param {Version} version - Version of the CID + * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param {API.MultihashDigest} digest - (Multi)hash of the of the content. + * @returns {CID} + */ + static create (version, code, digest) { + if (typeof code !== 'number') { + throw new Error('String codecs are no longer supported') + } + + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error('Invalid digest') + } + + switch (version) { + case 0: { + if (code !== node_modules_multiformats_src_cid_DAG_PB_CODE) { + throw new Error( + `Version 0 CID must use dag-pb (code: ${node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding` + ) + } else { + return new node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes) + } + } + case 1: { + const bytes = node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes) + return new node_modules_multiformats_src_cid_CID(version, code, digest, bytes) + } + default: { + throw new Error('Invalid version') + } + } + } + + /** + * Simplified version of `create` for CIDv0. + * + * @template {unknown} [T=unknown] + * @param {API.MultihashDigest} digest - Multihash. + * @returns {CID} + */ + static createV0 (digest) { + return node_modules_multiformats_src_cid_CID.create(0, node_modules_multiformats_src_cid_DAG_PB_CODE, digest) + } + + /** + * Simplified version of `create` for CIDv1. + * + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @param {Code} code - Content encoding format code. + * @param {API.MultihashDigest} digest - Miltihash of the content. + * @returns {CID} + */ + static createV1 (code, digest) { + return node_modules_multiformats_src_cid_CID.create(1, code, digest) + } + + /** + * Decoded a CID from its binary representation. The byte array must contain + * only the CID with no additional bytes. + * + * An error will be thrown if the bytes provided do not contain a valid + * binary representation of a CID. + * + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ByteView>} bytes + * @returns {CID} + */ + static decode (bytes) { + const [cid, remainder] = node_modules_multiformats_src_cid_CID.decodeFirst(bytes) + if (remainder.length) { + throw new Error('Incorrect length') + } + return cid + } + + /** + * Decoded a CID from its binary representation at the beginning of a byte + * array. + * + * Returns an array with the first element containing the CID and the second + * element containing the remainder of the original byte array. The remainder + * will be a zero-length byte array if the provided bytes only contained a + * binary CID representation. + * + * @template {unknown} T + * @template {number} C + * @template {number} A + * @template {API.Version} V + * @param {API.ByteView>} bytes + * @returns {[CID, Uint8Array]} + */ + static decodeFirst (bytes) { + const specs = node_modules_multiformats_src_cid_CID.inspectBytes(bytes) + const prefixSize = specs.size - specs.multihashSize + const multihashBytes = node_modules_multiformats_src_bytes_coerce( + bytes.subarray(prefixSize, prefixSize + specs.multihashSize) + ) + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error('Incorrect length') + } + const digestBytes = multihashBytes.subarray( + specs.multihashSize - specs.digestSize + ) + const digest = new node_modules_multiformats_src_hashes_digest_Digest( + specs.multihashCode, + specs.digestSize, + digestBytes, + multihashBytes + ) + const cid = + specs.version === 0 + ? node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) + : node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest) + return [/** @type {CID} */(cid), bytes.subarray(specs.size)] + } + + /** + * Inspect the initial bytes of a CID to determine its properties. + * + * Involves decoding up to 4 varints. Typically this will require only 4 to 6 + * bytes but for larger multicodec code values and larger multihash digest + * lengths these varints can be quite large. It is recommended that at least + * 10 bytes be made available in the `initialBytes` argument for a complete + * inspection. + * + * @template {unknown} T + * @template {number} C + * @template {number} A + * @template {API.Version} V + * @param {API.ByteView>} initialBytes + * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }} + */ + static inspectBytes (initialBytes) { + let offset = 0 + const next = () => { + const [i, length] = node_modules_multiformats_src_varint_decode(initialBytes.subarray(offset)) + offset += length + return i + } + + let version = /** @type {V} */ (next()) + let codec = /** @type {C} */ (node_modules_multiformats_src_cid_DAG_PB_CODE) + if (/** @type {number} */(version) === 18) { + // CIDv0 + version = /** @type {V} */ (0) + offset = 0 + } else { + codec = /** @type {C} */ (next()) + } + + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`) + } + + const prefixSize = offset + const multihashCode = /** @type {A} */ (next()) // multihash code + const digestSize = next() // multihash length + const size = offset + digestSize + const multihashSize = size - prefixSize + + return { version, codec, multihashCode, digestSize, multihashSize, size } + } + + /** + * Takes cid in a string representation and creates an instance. If `base` + * decoder is not provided will use a default from the configuration. It will + * throw an error if encoding of the CID is not compatible with supplied (or + * a default decoder). + * + * @template {string} Prefix + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ToString, Prefix>} source + * @param {API.MultibaseDecoder} [base] + * @returns {CID} + */ + static parse (source, base) { + const [prefix, bytes] = node_modules_multiformats_src_cid_parseCIDtoBytes(source, base) + + const cid = node_modules_multiformats_src_cid_CID.decode(bytes) + + if (cid.version === 0 && source[0] !== 'Q') { + throw Error('Version 0 CID string must not include multibase prefix') + } + + // Cache string representation to avoid computing it on `this.toString()` + node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source) + + return cid + } +} + +/** + * @template {string} Prefix + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ToString, Prefix>} source + * @param {API.MultibaseDecoder} [base] + * @returns {[Prefix, API.ByteView>]} + */ +const node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => { + switch (source[0]) { + // CIDv0 is parsed differently + case 'Q': { + const decoder = base || node_modules_multiformats_src_bases_base58_base58btc + return [ + /** @type {Prefix} */ (node_modules_multiformats_src_bases_base58_base58btc.prefix), + decoder.decode(`${node_modules_multiformats_src_bases_base58_base58btc.prefix}${source}`) + ] + } + case node_modules_multiformats_src_bases_base58_base58btc.prefix: { + const decoder = base || node_modules_multiformats_src_bases_base58_base58btc + return [/** @type {Prefix} */(node_modules_multiformats_src_bases_base58_base58btc.prefix), decoder.decode(source)] + } + case node_modules_multiformats_src_bases_base32_base32.prefix: { + const decoder = base || node_modules_multiformats_src_bases_base32_base32 + return [/** @type {Prefix} */(node_modules_multiformats_src_bases_base32_base32.prefix), decoder.decode(source)] + } + default: { + if (base == null) { + throw Error( + 'To parse non base32 or base58btc encoded CID multibase decoder must be provided' + ) + } + return [/** @type {Prefix} */(source[0]), base.decode(source)] + } + } +} + +/** + * + * @param {Uint8Array} bytes + * @param {Map} cache + * @param {API.MultibaseEncoder<'z'>} base + */ +const node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => { + const { prefix } = base + if (prefix !== node_modules_multiformats_src_bases_base58_base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base.name} encoding`) + } + + const cid = cache.get(prefix) + if (cid == null) { + const cid = base.encode(bytes).slice(1) + cache.set(prefix, cid) + return cid + } else { + return cid + } +} + +/** + * @template {string} Prefix + * @param {Uint8Array} bytes + * @param {Map} cache + * @param {API.MultibaseEncoder} base + */ +const node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => { + const { prefix } = base + const cid = cache.get(prefix) + if (cid == null) { + const cid = base.encode(bytes) + cache.set(prefix, cid) + return cid + } else { + return cid + } +} + +const node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70 +const node_modules_multiformats_src_cid_SHA_256_CODE = 0x12 + +/** + * @param {API.Version} version + * @param {number} code + * @param {Uint8Array} multihash + * @returns {Uint8Array} + */ +const node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => { + const codeOffset = node_modules_multiformats_src_varint_encodingLength(version) + const hashOffset = codeOffset + node_modules_multiformats_src_varint_encodingLength(code) + const bytes = new Uint8Array(hashOffset + multihash.byteLength) + node_modules_multiformats_src_varint_encodeTo(version, bytes, 0) + node_modules_multiformats_src_varint_encodeTo(code, bytes, codeOffset) + bytes.set(multihash, hashOffset) + return bytes +} + +const node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/index.js + + + + + +// This way TS will also expose all the types from module + -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/vendor/varint.js -var peer_id_node_modules_multiformats_vendor_varint_encode_1 = peer_id_node_modules_multiformats_vendor_varint_encode; -var peer_id_node_modules_multiformats_vendor_varint_MSB = 0x80 - , peer_id_node_modules_multiformats_vendor_varint_REST = 0x7F - , peer_id_node_modules_multiformats_vendor_varint_MSBALL = ~peer_id_node_modules_multiformats_vendor_varint_REST - , peer_id_node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31); -function peer_id_node_modules_multiformats_vendor_varint_encode(num, out, offset) { - out = out || []; - offset = offset || 0; - var oldOffset = offset; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/multiformats/src/basics.js +// @ts-check - while(num >= peer_id_node_modules_multiformats_vendor_varint_INT) { - out[offset++] = (num & 0xFF) | peer_id_node_modules_multiformats_vendor_varint_MSB; - num /= 128; - } - while(num & peer_id_node_modules_multiformats_vendor_varint_MSBALL) { - out[offset++] = (num & 0xFF) | peer_id_node_modules_multiformats_vendor_varint_MSB; - num >>>= 7; - } - out[offset] = num | 0; - - peer_id_node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; - - return out -} -var peer_id_node_modules_multiformats_vendor_varint_decode = peer_id_node_modules_multiformats_vendor_varint_read; -var peer_id_node_modules_multiformats_vendor_varint_MSB$1 = 0x80 - , peer_id_node_modules_multiformats_vendor_varint_REST$1 = 0x7F; -function peer_id_node_modules_multiformats_vendor_varint_read(buf, offset) { - var res = 0 - , offset = offset || 0 - , shift = 0 - , counter = offset - , b - , l = buf.length; - do { - if (counter >= l) { - peer_id_node_modules_multiformats_vendor_varint_read.bytes = 0; - throw new RangeError('Could not decode varint') - } - b = buf[counter++]; - res += shift < 28 - ? (b & peer_id_node_modules_multiformats_vendor_varint_REST$1) << shift - : (b & peer_id_node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift); - shift += 7; - } while (b >= peer_id_node_modules_multiformats_vendor_varint_MSB$1) - peer_id_node_modules_multiformats_vendor_varint_read.bytes = counter - offset; - return res -} -var peer_id_node_modules_multiformats_vendor_varint_N1 = Math.pow(2, 7); -var peer_id_node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14); -var peer_id_node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21); -var peer_id_node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28); -var peer_id_node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35); -var peer_id_node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42); -var peer_id_node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49); -var peer_id_node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56); -var peer_id_node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63); -var peer_id_node_modules_multiformats_vendor_varint_length = function (value) { - return ( - value < peer_id_node_modules_multiformats_vendor_varint_N1 ? 1 - : value < peer_id_node_modules_multiformats_vendor_varint_N2 ? 2 - : value < peer_id_node_modules_multiformats_vendor_varint_N3 ? 3 - : value < peer_id_node_modules_multiformats_vendor_varint_N4 ? 4 - : value < peer_id_node_modules_multiformats_vendor_varint_N5 ? 5 - : value < peer_id_node_modules_multiformats_vendor_varint_N6 ? 6 - : value < peer_id_node_modules_multiformats_vendor_varint_N7 ? 7 - : value < peer_id_node_modules_multiformats_vendor_varint_N8 ? 8 - : value < peer_id_node_modules_multiformats_vendor_varint_N9 ? 9 - : 10 - ) -}; -var peer_id_node_modules_multiformats_vendor_varint_varint = { - encode: peer_id_node_modules_multiformats_vendor_varint_encode_1 - , decode: peer_id_node_modules_multiformats_vendor_varint_decode - , encodingLength: peer_id_node_modules_multiformats_vendor_varint_length -}; -var peer_id_node_modules_multiformats_vendor_varint_brrp_varint = peer_id_node_modules_multiformats_vendor_varint_varint; -/* harmony default export */ const peer_id_node_modules_multiformats_vendor_varint = (peer_id_node_modules_multiformats_vendor_varint_brrp_varint); -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/varint.js -/** - * @param {Uint8Array} data - * @param {number} [offset=0] - * @returns {[number, number]} - */ -const peer_id_node_modules_multiformats_src_varint_decode = (data, offset = 0) => { - const code = peer_id_node_modules_multiformats_vendor_varint.decode(data, offset) - return [code, peer_id_node_modules_multiformats_vendor_varint.decode.bytes] -} -/** - * @param {number} int - * @param {Uint8Array} target - * @param {number} [offset=0] - */ -const peer_id_node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => { - peer_id_node_modules_multiformats_vendor_varint.encode(int, target, offset) - return target -} -/** - * @param {number} int - * @returns {number} - */ -const peer_id_node_modules_multiformats_src_varint_encodingLength = (int) => { - return peer_id_node_modules_multiformats_vendor_varint.encodingLength(int) -} -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/hashes/digest.js + +const bases = { ...bases_identity_namespaceObject, ...base2_namespaceObject, ...base8_namespaceObject, ...base10_namespaceObject, ...base16_namespaceObject, ...node_modules_multiformats_src_bases_base32_namespaceObject, ...base36_namespaceObject, ...node_modules_multiformats_src_bases_base58_namespaceObject, ...src_bases_base64_namespaceObject, ...base256emoji_namespaceObject } +const hashes = { ...sha2_namespaceObject, ...identity_namespaceObject } +const codecs = { raw: raw_namespaceObject, json: codecs_json_namespaceObject } +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/connection/index.js +const connectionSymbol = Symbol.for('@libp2p/connection'); +function isConnection(other) { + return other != null && Boolean(other[connectionSymbol]); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/content-routing/index.js /** - * Creates a multihash digest. + * Any object that implements this Symbol as a property should return a + * ContentRouting instance as the property value, similar to how + * `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. * - * @template {number} Code - * @param {Code} code - * @param {Uint8Array} digest + * @example + * + * ```js + * import { contentRoutingSymbol, ContentRouting } from '@libp2p/content-routing' + * + * class MyContentRouter implements ContentRouting { + * get [contentRoutingSymbol] () { + * return this + * } + * + * // ...other methods + * } + * ``` */ -const peer_id_node_modules_multiformats_src_hashes_digest_create = (code, digest) => { - const size = digest.byteLength - const sizeOffset = peer_id_node_modules_multiformats_src_varint_encodingLength(code) - const digestOffset = sizeOffset + peer_id_node_modules_multiformats_src_varint_encodingLength(size) - - const bytes = new Uint8Array(digestOffset + size) - peer_id_node_modules_multiformats_src_varint_encodeTo(code, bytes, 0) - peer_id_node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset) - bytes.set(digest, digestOffset) - - return new peer_id_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) -} - +const contentRoutingSymbol = Symbol.for('@libp2p/content-routing'); +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/peer-discovery/index.js /** - * Turns bytes representation of multihash digest into an instance. + * Any object that implements this Symbol as a property should return a + * PeerDiscovery instance as the property value, similar to how + * `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. * - * @param {Uint8Array} multihash - * @returns {MultihashDigest} + * @example + * + * ```js + * import { peerDiscovery, PeerDiscovery } from '@libp2p/peer-discovery' + * + * class MyPeerDiscoverer implements PeerDiscovery { + * get [peerDiscovery] () { + * return this + * } + * + * // ...other methods + * } + * ``` */ -const peer_id_node_modules_multiformats_src_hashes_digest_decode = (multihash) => { - const bytes = peer_id_node_modules_multiformats_src_bytes_coerce(multihash) - const [code, sizeOffset] = peer_id_node_modules_multiformats_src_varint_decode(bytes) - const [size, digestOffset] = peer_id_node_modules_multiformats_src_varint_decode(bytes.subarray(sizeOffset)) - const digest = bytes.subarray(sizeOffset + digestOffset) - - if (digest.byteLength !== size) { - throw new Error('Incorrect length') - } - - return new peer_id_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) +const peerDiscoverySymbol = Symbol.for('@libp2p/peer-discovery'); +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/peer-id/index.js +const peerIdSymbol = Symbol.for('@libp2p/peer-id'); +function isPeerId(other) { + return other != null && Boolean(other[peerIdSymbol]); } - +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/peer-routing/index.js /** - * @param {MultihashDigest} a - * @param {unknown} b - * @returns {b is MultihashDigest} + * Any object that implements this Symbol as a property should return a + * PeerRouting instance as the property value, similar to how + * `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`. + * + * @example + * + * ```js + * import { peerRouting, PeerRouting } from '@libp2p/peer-routing' + * + * class MyPeerRouter implements PeerRouting { + * get [peerRouting] () { + * return this + * } + * + * // ...other methods + * } + * ``` */ -const peer_id_node_modules_multiformats_src_hashes_digest_equals = (a, b) => { - if (a === b) { - return true - } else { - const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) - - return ( - a.code === data.code && - a.size === data.size && - data.bytes instanceof Uint8Array && - peer_id_node_modules_multiformats_src_bytes_equals(a.bytes, data.bytes) - ) - } -} - +const peerRoutingSymbol = Symbol.for('@libp2p/peer-routing'); +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/pubsub/index.js /** - * @typedef {import('./interface.js').MultihashDigest} MultihashDigest + * On the producing side: + * * Build messages with the signature, key (from may be enough for certain inlineable public key types), from and seqno fields. + * + * On the consuming side: + * * Enforce the fields to be present, reject otherwise. + * * Propagate only if the fields are valid and signature can be verified, reject otherwise. */ - +const StrictSign = 'StrictSign'; /** - * Represents a multihash digest which carries information about the - * hashing algorithm and an actual hash digest. + * On the producing side: + * * Build messages without the signature, key, from and seqno fields. + * * The corresponding protobuf key-value pairs are absent from the marshalled message, not just empty. * - * @template {number} Code - * @template {number} Size - * @class - * @implements {MultihashDigest} + * On the consuming side: + * * Enforce the fields to be absent, reject otherwise. + * * Propagate only if the fields are absent, reject otherwise. + * * A message_id function will not be able to use the above fields, and should instead rely on the data field. A commonplace strategy is to calculate a hash. */ -class peer_id_node_modules_multiformats_src_hashes_digest_Digest { - /** - * Creates a multihash digest. - * - * @param {Code} code - * @param {Size} size - * @param {Uint8Array} digest - * @param {Uint8Array} bytes - */ - constructor (code, size, digest, bytes) { - this.code = code - this.size = size - this.digest = digest - this.bytes = bytes - } +const StrictNoSign = 'StrictNoSign'; +var TopicValidatorResult; +(function (TopicValidatorResult) { + /** + * The message is considered valid, and it should be delivered and forwarded to the network + */ + TopicValidatorResult["Accept"] = "accept"; + /** + * The message is neither delivered nor forwarded to the network + */ + TopicValidatorResult["Ignore"] = "ignore"; + /** + * The message is considered invalid, and it should be rejected + */ + TopicValidatorResult["Reject"] = "reject"; +})(TopicValidatorResult || (TopicValidatorResult = {})); +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/transport/index.js +const transportSymbol = Symbol.for('@libp2p/transport'); +function isTransport(other) { + return other != null && Boolean(other[transportSymbol]); } - -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/hashes/hasher.js - - /** - * @template {string} Name - * @template {number} Code - * @param {object} options - * @param {Name} options.name - * @param {Code} options.code - * @param {(input: Uint8Array) => Await} options.encode + * Enum Transport Manager Fault Tolerance values */ -const peer_id_node_modules_multiformats_src_hashes_hasher_from = ({ name, code, encode }) => new node_modules_multiformats_src_hashes_hasher_Hasher(name, code, encode) - +var FaultTolerance; +(function (FaultTolerance) { + /** + * should be used for failing in any listen circumstance + */ + FaultTolerance[FaultTolerance["FATAL_ALL"] = 0] = "FATAL_ALL"; + /** + * should be used for not failing when not listening + */ + FaultTolerance[FaultTolerance["NO_FATAL"] = 1] = "NO_FATAL"; +})(FaultTolerance || (FaultTolerance = {})); +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/errors.js /** - * Hasher represents a hashing algorithm implementation that produces as - * `MultihashDigest`. - * - * @template {string} Name - * @template {number} Code - * @class - * @implements {MultihashHasher} + * When this error is thrown it means an operation was aborted, + * usually in response to the `abort` event being emitted by an + * AbortSignal. */ -class node_modules_multiformats_src_hashes_hasher_Hasher { - /** - * - * @param {Name} name - * @param {Code} code - * @param {(input: Uint8Array) => Await} encode - */ - constructor (name, code, encode) { - this.name = name - this.code = code - this.encode = encode - } - - /** - * @param {Uint8Array} input - * @returns {Await>} - */ - digest (input) { - if (input instanceof Uint8Array) { - const result = this.encode(input) - return result instanceof Uint8Array - ? peer_id_node_modules_multiformats_src_hashes_digest_create(this.code, result) - /* c8 ignore next 1 */ - : result.then(digest => peer_id_node_modules_multiformats_src_hashes_digest_create(this.code, digest)) - } else { - throw Error('Unknown type, must be binary type') - /* c8 ignore next 1 */ +class AbortError extends Error { + code; + type; + constructor(message = 'The operation was aborted') { + super(message); + this.code = AbortError.code; + this.type = AbortError.type; } - } + static code = (/* unused pure expression or super */ null && ('ABORT_ERR')); + static type = (/* unused pure expression or super */ null && ('aborted')); } - +class errors_CodeError extends Error { + code; + props; + constructor(message, code, props) { + super(message); + this.code = code; + this.name = props?.name ?? 'CodeError'; + this.props = props ?? {}; // eslint-disable-line @typescript-eslint/consistent-type-assertions + } +} +class UnexpectedPeerError extends Error { + code; + constructor(message = 'Unexpected Peer') { + super(message); + this.code = UnexpectedPeerError.code; + } + static code = (/* unused pure expression or super */ null && ('ERR_UNEXPECTED_PEER')); +} +class InvalidCryptoExchangeError extends Error { + code; + constructor(message = 'Invalid crypto exchange') { + super(message); + this.code = InvalidCryptoExchangeError.code; + } + static code = (/* unused pure expression or super */ null && ('ERR_INVALID_CRYPTO_EXCHANGE')); +} +class InvalidCryptoTransmissionError extends Error { + code; + constructor(message = 'Invalid crypto transmission') { + super(message); + this.code = InvalidCryptoTransmissionError.code; + } + static code = (/* unused pure expression or super */ null && ('ERR_INVALID_CRYPTO_TRANSMISSION')); +} +// Error codes +const ERR_TIMEOUT = 'ERR_TIMEOUT'; +const ERR_INVALID_PARAMETERS = 'ERR_INVALID_PARAMETERS'; +const ERR_NOT_FOUND = 'ERR_NOT_FOUND'; +const ERR_INVALID_MESSAGE = 'ERR_INVALID_MESSAGE'; +//# sourceMappingURL=errors.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/event-target.js /** - * @template {number} Alg - * @typedef {import('./interface.js').MultihashHasher} MultihashHasher + * An implementation of a typed event target + * etc + */ +class TypedEventEmitter extends EventTarget { + #listeners = new Map(); + listenerCount(type) { + const listeners = this.#listeners.get(type); + if (listeners == null) { + return 0; + } + return listeners.length; + } + addEventListener(type, listener, options) { + super.addEventListener(type, listener, options); + let list = this.#listeners.get(type); + if (list == null) { + list = []; + this.#listeners.set(type, list); + } + list.push({ + callback: listener, + once: (options !== true && options !== false && options?.once) ?? false + }); + } + removeEventListener(type, listener, options) { + super.removeEventListener(type.toString(), listener ?? null, options); + let list = this.#listeners.get(type); + if (list == null) { + return; + } + list = list.filter(({ callback }) => callback !== listener); + this.#listeners.set(type, list); + } + dispatchEvent(event) { + const result = super.dispatchEvent(event); + let list = this.#listeners.get(event.type); + if (list == null) { + return result; + } + list = list.filter(({ once }) => !once); + this.#listeners.set(event.type, list); + return result; + } + safeDispatchEvent(type, detail) { + return this.dispatchEvent(new CustomEvent(type, detail)); + } +} +/** + * CustomEvent is a standard event but it's not supported by node. + * + * Remove this when https://github.com/nodejs/node/issues/40678 is closed. + * + * Ref: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent */ +class CustomEventPolyfill extends Event { + /** Returns any custom data event was created with. Typically used for synthetic events. */ + detail; + constructor(message, data) { + super(message, data); + // @ts-expect-error could be undefined + this.detail = data?.detail; + } +} +const CustomEvent = globalThis.CustomEvent ?? CustomEventPolyfill; +//# sourceMappingURL=event-target.js.map +// EXTERNAL MODULE: external "events" +var external_events_ = __nccwpck_require__(82361); +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/events.js +// create a setMaxListeners that doesn't break browser usage +const setMaxListeners = (n, ...eventTargets) => { + try { + nodeSetMaxListeners(n, ...eventTargets); + } + catch { + // swallow error, gulp + } +}; +//# sourceMappingURL=events.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface/dist/src/index.js /** - * @template T - * @typedef {Promise|T} Await + * @packageDocumentation + * + * Exports a `Libp2p` type for modules to use as a type argument. + * + * @example + * + * ```typescript + * import type { Libp2p } from '@libp2p/interface' + * + * function doSomethingWithLibp2p (node: Libp2p) { + * // ... + * } + * ``` */ -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/hashes/sha2.js -// @ts-check -const node_modules_multiformats_src_hashes_sha2_sha256 = peer_id_node_modules_multiformats_src_hashes_hasher_from({ - name: 'sha2-256', - code: 0x12, - encode: (input) => peer_id_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha256').update(input).digest()) -}) -const multiformats_src_hashes_sha2_sha512 = peer_id_node_modules_multiformats_src_hashes_hasher_from({ - name: 'sha2-512', - code: 0x13, - encode: input => peer_id_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha512').update(input).digest()) -}) -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/hashes/identity.js -const node_modules_multiformats_src_hashes_identity_code = 0x0 -const node_modules_multiformats_src_hashes_identity_name = 'identity' -/** @type {(input:Uint8Array) => Uint8Array} */ -const node_modules_multiformats_src_hashes_identity_encode = peer_id_node_modules_multiformats_src_bytes_coerce + + + + + + + + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bytes.js +const dist_src_bytes_empty = new Uint8Array(0); +function dist_src_bytes_toHex(d) { + return d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), ''); +} +function dist_src_bytes_fromHex(hex) { + const hexes = hex.match(/../g); + return hexes != null ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : dist_src_bytes_empty; +} +function dist_src_bytes_equals(aa, bb) { + if (aa === bb) + return true; + if (aa.byteLength !== bb.byteLength) { + return false; + } + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false; + } + } + return true; +} +function multiformats_dist_src_bytes_coerce(o) { + if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') + return o; + if (o instanceof ArrayBuffer) + return new Uint8Array(o); + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength); + } + throw new Error('Unknown type, must be binary type'); +} +function dist_src_bytes_isBinary(o) { + return o instanceof ArrayBuffer || ArrayBuffer.isView(o); +} +function dist_src_bytes_fromString(str) { + return new TextEncoder().encode(str); +} +function multiformats_dist_src_bytes_toString(b) { + return new TextDecoder().decode(b); +} +//# sourceMappingURL=bytes.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/vendor/base-x.js +/* eslint-disable */ +// base-x encoding / decoding +// Copyright (c) 2018 base-x contributors +// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) +// Distributed under the MIT software license, see the accompanying +// file LICENSE or http://www.opensource.org/licenses/mit-license.php. +/** + * @param {string} ALPHABET + * @param {any} name + */ +function src_vendor_base_x_base(ALPHABET, name) { + if (ALPHABET.length >= 255) { + throw new TypeError('Alphabet too long'); + } + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; + } + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { + throw new TypeError(x + ' is ambiguous'); + } + BASE_MAP[xc] = i; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up + var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up + /** + * @param {any[] | Iterable} source + */ + function encode(source) { + // @ts-ignore + if (source instanceof Uint8Array) + ; + else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } + else if (Array.isArray(source)) { + source = Uint8Array.from(source); + } + if (!(source instanceof Uint8Array)) { + throw new TypeError('Expected Uint8Array'); + } + if (source.length === 0) { + return ''; + } + // Skip & count leading zeroes. + var zeroes = 0; + var length = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } + // Allocate enough space in big-endian base58 representation. + var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; + var b58 = new Uint8Array(size); + // Process the bytes. + while (pbegin !== pend) { + var carry = source[pbegin]; + // Apply "b58 = b58 * 256 + ch". + var i = 0; + for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { + carry += (256 * b58[it1]) >>> 0; + b58[it1] = (carry % BASE) >>> 0; + carry = (carry / BASE) >>> 0; + } + if (carry !== 0) { + throw new Error('Non-zero carry'); + } + length = i; + pbegin++; + } + // Skip leading zeroes in base58 result. + var it2 = size - length; + while (it2 !== size && b58[it2] === 0) { + it2++; + } + // Translate the result into a string. + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { + str += ALPHABET.charAt(b58[it2]); + } + return str; + } + /** + * @param {string | string[]} source + */ + function decodeUnsafe(source) { + if (typeof source !== 'string') { + throw new TypeError('Expected String'); + } + if (source.length === 0) { + return new Uint8Array(); + } + var psz = 0; + // Skip leading spaces. + if (source[psz] === ' ') { + return; + } + // Skip and count leading '1's. + var zeroes = 0; + var length = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; + } + // Allocate enough space in big-endian base256 representation. + var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. + var b256 = new Uint8Array(size); + // Process the characters. + while (source[psz]) { + // Decode character + var carry = BASE_MAP[source.charCodeAt(psz)]; + // Invalid character + if (carry === 255) { + return; + } + var i = 0; + for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { + carry += (BASE * b256[it3]) >>> 0; + b256[it3] = (carry % 256) >>> 0; + carry = (carry / 256) >>> 0; + } + if (carry !== 0) { + throw new Error('Non-zero carry'); + } + length = i; + psz++; + } + // Skip trailing spaces. + if (source[psz] === ' ') { + return; + } + // Skip leading zeroes in b256. + var it4 = size - length; + while (it4 !== size && b256[it4] === 0) { + it4++; + } + var vch = new Uint8Array(zeroes + (size - it4)); + var j = zeroes; + while (it4 !== size) { + vch[j++] = b256[it4++]; + } + return vch; + } + /** + * @param {string | string[]} string + */ + function decode(string) { + var buffer = decodeUnsafe(string); + if (buffer) { + return buffer; + } + throw new Error(`Non-${name} character`); + } + return { + encode: encode, + decodeUnsafe: decodeUnsafe, + decode: decode + }; +} +var src_vendor_base_x_src = src_vendor_base_x_base; +var src_vendor_base_x_brrp_multiformats_scope_baseX = src_vendor_base_x_src; +/* harmony default export */ const dist_src_vendor_base_x = (src_vendor_base_x_brrp_multiformats_scope_baseX); +//# sourceMappingURL=base-x.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base.js + + +/** + * Class represents both BaseEncoder and MultibaseEncoder meaning it + * can be used to encode to multibase or base encode without multibase + * prefix. + */ +class dist_src_bases_base_Encoder { + name; + prefix; + baseEncode; + constructor(name, prefix, baseEncode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + } + encode(bytes) { + if (bytes instanceof Uint8Array) { + return `${this.prefix}${this.baseEncode(bytes)}`; + } + else { + throw Error('Unknown type, must be binary type'); + } + } +} +/** + * Class represents both BaseDecoder and MultibaseDecoder so it could be used + * to decode multibases (with matching prefix) or just base decode strings + * with corresponding base encoding. + */ +class dist_src_bases_base_Decoder { + name; + prefix; + baseDecode; + prefixCodePoint; + constructor(name, prefix, baseDecode) { + this.name = name; + this.prefix = prefix; + /* c8 ignore next 3 */ + if (prefix.codePointAt(0) === undefined) { + throw new Error('Invalid prefix character'); + } + this.prefixCodePoint = prefix.codePointAt(0); + this.baseDecode = baseDecode; + } + decode(text) { + if (typeof text === 'string') { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); + } + return this.baseDecode(text.slice(this.prefix.length)); + } + else { + throw Error('Can only multibase decode strings'); + } + } + or(decoder) { + return dist_src_bases_base_or(this, decoder); + } +} +class dist_src_bases_base_ComposedDecoder { + decoders; + constructor(decoders) { + this.decoders = decoders; + } + or(decoder) { + return dist_src_bases_base_or(this, decoder); + } + decode(input) { + const prefix = input[0]; + const decoder = this.decoders[prefix]; + if (decoder != null) { + return decoder.decode(input); + } + else { + throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); + } + } +} +function dist_src_bases_base_or(left, right) { + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + return new dist_src_bases_base_ComposedDecoder({ + ...(left.decoders ?? { [left.prefix]: left }), + ...(right.decoders ?? { [right.prefix]: right }) + }); +} +class dist_src_bases_base_Codec { + name; + prefix; + baseEncode; + baseDecode; + encoder; + decoder; + constructor(name, prefix, baseEncode, baseDecode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + this.baseDecode = baseDecode; + this.encoder = new dist_src_bases_base_Encoder(name, prefix, baseEncode); + this.decoder = new dist_src_bases_base_Decoder(name, prefix, baseDecode); + } + encode(input) { + return this.encoder.encode(input); + } + decode(input) { + return this.decoder.decode(input); + } +} +function dist_src_bases_base_from({ name, prefix, encode, decode }) { + return new dist_src_bases_base_Codec(name, prefix, encode, decode); +} +function dist_src_bases_base_baseX({ name, prefix, alphabet }) { + const { encode, decode } = dist_src_vendor_base_x(alphabet, name); + return dist_src_bases_base_from({ + prefix, + name, + encode, + decode: (text) => multiformats_dist_src_bytes_coerce(decode(text)) + }); +} +function dist_src_bases_base_decode(string, alphabet, bitsPerChar, name) { + // Build the character lookup table: + const codes = {}; + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i; + } + // Count the padding bytes: + let end = string.length; + while (string[end - 1] === '=') { + --end; + } + // Allocate the output: + const out = new Uint8Array((end * bitsPerChar / 8) | 0); + // Parse the data: + let bits = 0; // Number of bits currently in the buffer + let buffer = 0; // Bits waiting to be written out, MSB first + let written = 0; // Next byte to write + for (let i = 0; i < end; ++i) { + // Read one character from the string: + const value = codes[string[i]]; + if (value === undefined) { + throw new SyntaxError(`Non-${name} character`); + } + // Append the bits to the buffer: + buffer = (buffer << bitsPerChar) | value; + bits += bitsPerChar; + // Write out some bits if the buffer has a byte's worth: + if (bits >= 8) { + bits -= 8; + out[written++] = 0xff & (buffer >> bits); + } + } + // Verify that we have received just enough bits: + if (bits >= bitsPerChar || (0xff & (buffer << (8 - bits))) !== 0) { + throw new SyntaxError('Unexpected end of data'); + } + return out; +} +function dist_src_bases_base_encode(data, alphabet, bitsPerChar) { + const pad = alphabet[alphabet.length - 1] === '='; + const mask = (1 << bitsPerChar) - 1; + let out = ''; + let bits = 0; // Number of bits currently in the buffer + let buffer = 0; // Bits waiting to be written out, MSB first + for (let i = 0; i < data.length; ++i) { + // Slurp data into the buffer: + buffer = (buffer << 8) | data[i]; + bits += 8; + // Write out as much as we can: + while (bits > bitsPerChar) { + bits -= bitsPerChar; + out += alphabet[mask & (buffer >> bits)]; + } + } + // Partial character: + if (bits !== 0) { + out += alphabet[mask & (buffer << (bitsPerChar - bits))]; + } + // Add padding characters until we hit a byte boundary: + if (pad) { + while (((out.length * bitsPerChar) & 7) !== 0) { + out += '='; + } + } + return out; +} +/** + * RFC4648 Factory + */ +function dist_src_bases_base_rfc4648({ name, prefix, bitsPerChar, alphabet }) { + return dist_src_bases_base_from({ + prefix, + name, + encode(input) { + return dist_src_bases_base_encode(input, alphabet, bitsPerChar); + }, + decode(input) { + return dist_src_bases_base_decode(input, alphabet, bitsPerChar, name); + } + }); +} +//# sourceMappingURL=base.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base58.js + +const dist_src_bases_base58_base58btc = dist_src_bases_base_baseX({ + name: 'base58btc', + prefix: 'z', + alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +}); +const dist_src_bases_base58_base58flickr = dist_src_bases_base_baseX({ + name: 'base58flickr', + prefix: 'Z', + alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' +}); +//# sourceMappingURL=base58.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base32.js + +const dist_src_bases_base32_base32 = dist_src_bases_base_rfc4648({ + prefix: 'b', + name: 'base32', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567', + bitsPerChar: 5 +}); +const dist_src_bases_base32_base32upper = dist_src_bases_base_rfc4648({ + prefix: 'B', + name: 'base32upper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', + bitsPerChar: 5 +}); +const dist_src_bases_base32_base32pad = dist_src_bases_base_rfc4648({ + prefix: 'c', + name: 'base32pad', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', + bitsPerChar: 5 +}); +const dist_src_bases_base32_base32padupper = dist_src_bases_base_rfc4648({ + prefix: 'C', + name: 'base32padupper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', + bitsPerChar: 5 +}); +const dist_src_bases_base32_base32hex = dist_src_bases_base_rfc4648({ + prefix: 'v', + name: 'base32hex', + alphabet: '0123456789abcdefghijklmnopqrstuv', + bitsPerChar: 5 +}); +const dist_src_bases_base32_base32hexupper = dist_src_bases_base_rfc4648({ + prefix: 'V', + name: 'base32hexupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', + bitsPerChar: 5 +}); +const dist_src_bases_base32_base32hexpad = dist_src_bases_base_rfc4648({ + prefix: 't', + name: 'base32hexpad', + alphabet: '0123456789abcdefghijklmnopqrstuv=', + bitsPerChar: 5 +}); +const dist_src_bases_base32_base32hexpadupper = dist_src_bases_base_rfc4648({ + prefix: 'T', + name: 'base32hexpadupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', + bitsPerChar: 5 +}); +const dist_src_bases_base32_base32z = dist_src_bases_base_rfc4648({ + prefix: 'h', + name: 'base32z', + alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', + bitsPerChar: 5 +}); +//# sourceMappingURL=base32.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/vendor/varint.js +/* eslint-disable */ +var src_vendor_varint_encode_1 = dist_src_vendor_varint_encode; +var src_vendor_varint_MSB = 0x80, src_vendor_varint_REST = 0x7F, src_vendor_varint_MSBALL = ~src_vendor_varint_REST, src_vendor_varint_INT = Math.pow(2, 31); +/** + * @param {number} num + * @param {number[]} out + * @param {number} offset + */ +function dist_src_vendor_varint_encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; + while (num >= src_vendor_varint_INT) { + out[offset++] = (num & 0xFF) | src_vendor_varint_MSB; + num /= 128; + } + while (num & src_vendor_varint_MSBALL) { + out[offset++] = (num & 0xFF) | src_vendor_varint_MSB; + num >>>= 7; + } + out[offset] = num | 0; + // @ts-ignore + dist_src_vendor_varint_encode.bytes = offset - oldOffset + 1; + return out; +} +var dist_src_vendor_varint_decode = src_vendor_varint_read; +var src_vendor_varint_MSB$1 = 0x80, src_vendor_varint_REST$1 = 0x7F; /** - * @param {Uint8Array} input - * @returns {Digest.Digest} + * @param {string | any[]} buf + * @param {number} offset */ -const multiformats_src_hashes_identity_digest = (input) => peer_id_node_modules_multiformats_src_hashes_digest_create(node_modules_multiformats_src_hashes_identity_code, node_modules_multiformats_src_hashes_identity_encode(input)) - -const node_modules_multiformats_src_hashes_identity_identity = { code: node_modules_multiformats_src_hashes_identity_code, name: node_modules_multiformats_src_hashes_identity_name, encode: node_modules_multiformats_src_hashes_identity_encode, digest: multiformats_src_hashes_identity_digest } - -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/codecs/raw.js -// @ts-check +function src_vendor_varint_read(buf, offset) { + var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length; + do { + if (counter >= l) { + // @ts-ignore + src_vendor_varint_read.bytes = 0; + throw new RangeError('Could not decode varint'); + } + b = buf[counter++]; + res += shift < 28 + ? (b & src_vendor_varint_REST$1) << shift + : (b & src_vendor_varint_REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= src_vendor_varint_MSB$1); + // @ts-ignore + src_vendor_varint_read.bytes = counter - offset; + return res; +} +var src_vendor_varint_N1 = Math.pow(2, 7); +var src_vendor_varint_N2 = Math.pow(2, 14); +var src_vendor_varint_N3 = Math.pow(2, 21); +var src_vendor_varint_N4 = Math.pow(2, 28); +var src_vendor_varint_N5 = Math.pow(2, 35); +var src_vendor_varint_N6 = Math.pow(2, 42); +var src_vendor_varint_N7 = Math.pow(2, 49); +var src_vendor_varint_N8 = Math.pow(2, 56); +var src_vendor_varint_N9 = Math.pow(2, 63); +var dist_src_vendor_varint_length = function (/** @type {number} */ value) { + return (value < src_vendor_varint_N1 ? 1 + : value < src_vendor_varint_N2 ? 2 + : value < src_vendor_varint_N3 ? 3 + : value < src_vendor_varint_N4 ? 4 + : value < src_vendor_varint_N5 ? 5 + : value < src_vendor_varint_N6 ? 6 + : value < src_vendor_varint_N7 ? 7 + : value < src_vendor_varint_N8 ? 8 + : value < src_vendor_varint_N9 ? 9 + : 10); +}; +var dist_src_vendor_varint_varint = { + encode: src_vendor_varint_encode_1, + decode: dist_src_vendor_varint_decode, + encodingLength: dist_src_vendor_varint_length +}; +var src_vendor_varint_brrp_varint = dist_src_vendor_varint_varint; +/* harmony default export */ const multiformats_dist_src_vendor_varint = (src_vendor_varint_brrp_varint); +//# sourceMappingURL=varint.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/varint.js +function node_modules_multiformats_dist_src_varint_decode(data, offset = 0) { + const code = multiformats_dist_src_vendor_varint.decode(data, offset); + return [code, multiformats_dist_src_vendor_varint.decode.bytes]; +} +function dist_src_varint_encodeTo(int, target, offset = 0) { + multiformats_dist_src_vendor_varint.encode(int, target, offset); + return target; +} +function dist_src_varint_encodingLength(int) { + return multiformats_dist_src_vendor_varint.encodingLength(int); +} +//# sourceMappingURL=varint.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/hashes/digest.js /** - * @template T - * @typedef {import('./interface.js').ByteView} ByteView + * Creates a multihash digest. */ - -const node_modules_multiformats_src_codecs_raw_name = 'raw' -const node_modules_multiformats_src_codecs_raw_code = 0x55 - +function dist_src_hashes_digest_create(code, digest) { + const size = digest.byteLength; + const sizeOffset = dist_src_varint_encodingLength(code); + const digestOffset = sizeOffset + dist_src_varint_encodingLength(size); + const bytes = new Uint8Array(digestOffset + size); + dist_src_varint_encodeTo(code, bytes, 0); + dist_src_varint_encodeTo(size, bytes, sizeOffset); + bytes.set(digest, digestOffset); + return new dist_src_hashes_digest_Digest(code, size, digest, bytes); +} /** - * @param {Uint8Array} node - * @returns {ByteView} + * Turns bytes representation of multihash digest into an instance. */ -const node_modules_multiformats_src_codecs_raw_encode = (node) => peer_id_node_modules_multiformats_src_bytes_coerce(node) - +function dist_src_hashes_digest_decode(multihash) { + const bytes = multiformats_dist_src_bytes_coerce(multihash); + const [code, sizeOffset] = node_modules_multiformats_dist_src_varint_decode(bytes); + const [size, digestOffset] = node_modules_multiformats_dist_src_varint_decode(bytes.subarray(sizeOffset)); + const digest = bytes.subarray(sizeOffset + digestOffset); + if (digest.byteLength !== size) { + throw new Error('Incorrect length'); + } + return new dist_src_hashes_digest_Digest(code, size, digest, bytes); +} +function dist_src_hashes_digest_equals(a, b) { + if (a === b) { + return true; + } + else { + const data = b; + return (a.code === data.code && + a.size === data.size && + data.bytes instanceof Uint8Array && + dist_src_bytes_equals(a.bytes, data.bytes)); + } +} /** - * @param {ByteView} data - * @returns {Uint8Array} + * Represents a multihash digest which carries information about the + * hashing algorithm and an actual hash digest. */ -const node_modules_multiformats_src_codecs_raw_decode = (data) => peer_id_node_modules_multiformats_src_bytes_coerce(data) +class dist_src_hashes_digest_Digest { + code; + size; + digest; + bytes; + /** + * Creates a multihash digest. + */ + constructor(code, size, digest, bytes) { + this.code = code; + this.size = size; + this.digest = digest; + this.bytes = bytes; + } +} +//# sourceMappingURL=digest.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/cid.js -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/codecs/json.js -// @ts-check -/** - * @template T - * @typedef {import('./interface.js').ByteView} ByteView - */ -const node_modules_multiformats_src_codecs_json_textEncoder = new TextEncoder() -const node_modules_multiformats_src_codecs_json_textDecoder = new TextDecoder() -const node_modules_multiformats_src_codecs_json_name = 'json' -const node_modules_multiformats_src_codecs_json_code = 0x0200 -/** - * @template T - * @param {T} node - * @returns {ByteView} - */ -const node_modules_multiformats_src_codecs_json_encode = (node) => node_modules_multiformats_src_codecs_json_textEncoder.encode(JSON.stringify(node)) +// This way TS will also expose all the types from module +function dist_src_cid_format(link, base) { + const { bytes, version } = link; + switch (version) { + case 0: + return dist_src_cid_toStringV0(bytes, dist_src_cid_baseCache(link), base ?? dist_src_bases_base58_base58btc.encoder); + default: + return dist_src_cid_toStringV1(bytes, dist_src_cid_baseCache(link), (base ?? dist_src_bases_base32_base32.encoder)); + } +} +function dist_src_cid_toJSON(link) { + return { + '/': dist_src_cid_format(link) + }; +} +function dist_src_cid_fromJSON(json) { + return multiformats_dist_src_cid_CID.parse(json['/']); +} +const dist_src_cid_cache = new WeakMap(); +function dist_src_cid_baseCache(cid) { + const baseCache = dist_src_cid_cache.get(cid); + if (baseCache == null) { + const baseCache = new Map(); + dist_src_cid_cache.set(cid, baseCache); + return baseCache; + } + return baseCache; +} +class multiformats_dist_src_cid_CID { + code; + version; + multihash; + bytes; + '/'; + /** + * @param version - Version of the CID + * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param multihash - (Multi)hash of the of the content. + */ + constructor(version, code, multihash, bytes) { + this.code = code; + this.version = version; + this.multihash = multihash; + this.bytes = bytes; + // flag to serializers that this is a CID and + // should be treated specially + this['/'] = bytes; + } + /** + * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` + * please either use `CID.asCID(cid)` or switch to new signalling mechanism + * + * @deprecated + */ + get asCID() { + return this; + } + // ArrayBufferView + get byteOffset() { + return this.bytes.byteOffset; + } + // ArrayBufferView + get byteLength() { + return this.bytes.byteLength; + } + toV0() { + switch (this.version) { + case 0: { + return this; + } + case 1: { + const { code, multihash } = this; + if (code !== dist_src_cid_DAG_PB_CODE) { + throw new Error('Cannot convert a non dag-pb CID to CIDv0'); + } + // sha2-256 + if (multihash.code !== dist_src_cid_SHA_256_CODE) { + throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0'); + } + return (multiformats_dist_src_cid_CID.createV0(multihash)); + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`); + } + } + } + toV1() { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash; + const multihash = dist_src_hashes_digest_create(code, digest); + return (multiformats_dist_src_cid_CID.createV1(this.code, multihash)); + } + case 1: { + return this; + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`); + } + } + } + equals(other) { + return multiformats_dist_src_cid_CID.equals(this, other); + } + static equals(self, other) { + const unknown = other; + return (unknown != null && + self.code === unknown.code && + self.version === unknown.version && + dist_src_hashes_digest_equals(self.multihash, unknown.multihash)); + } + toString(base) { + return dist_src_cid_format(this, base); + } + toJSON() { + return { '/': dist_src_cid_format(this) }; + } + link() { + return this; + } + [Symbol.toStringTag] = 'CID'; + // Legacy + [Symbol.for('nodejs.util.inspect.custom')]() { + return `CID(${this.toString()})`; + } + /** + * Takes any input `value` and returns a `CID` instance if it was + * a `CID` otherwise returns `null`. If `value` is instanceof `CID` + * it will return value back. If `value` is not instance of this CID + * class, but is compatible CID it will return new instance of this + * `CID` class. Otherwise returns null. + * + * This allows two different incompatible versions of CID library to + * co-exist and interop as long as binary interface is compatible. + */ + static asCID(input) { + if (input == null) { + return null; + } + const value = input; + if (value instanceof multiformats_dist_src_cid_CID) { + // If value is instance of CID then we're all set. + return value; + } + else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { + // If value isn't instance of this CID class but `this.asCID === this` or + // `value['/'] === value.bytes` is true it is CID instance coming from a + // different implementation (diff version or duplicate). In that case we + // rebase it to this `CID` implementation so caller is guaranteed to get + // instance with expected API. + const { version, code, multihash, bytes } = value; + return new multiformats_dist_src_cid_CID(version, code, multihash, bytes ?? dist_src_cid_encodeCID(version, code, multihash.bytes)); + } + else if (value[dist_src_cid_cidSymbol] === true) { + // If value is a CID from older implementation that used to be tagged via + // symbol we still rebase it to the this `CID` implementation by + // delegating that to a constructor. + const { version, multihash, code } = value; + const digest = dist_src_hashes_digest_decode(multihash); + return multiformats_dist_src_cid_CID.create(version, code, digest); + } + else { + // Otherwise value is not a CID (or an incompatible version of it) in + // which case we return `null`. + return null; + } + } + /** + * @param version - Version of the CID + * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param digest - (Multi)hash of the of the content. + */ + static create(version, code, digest) { + if (typeof code !== 'number') { + throw new Error('String codecs are no longer supported'); + } + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error('Invalid digest'); + } + switch (version) { + case 0: { + if (code !== dist_src_cid_DAG_PB_CODE) { + throw new Error(`Version 0 CID must use dag-pb (code: ${dist_src_cid_DAG_PB_CODE}) block encoding`); + } + else { + return new multiformats_dist_src_cid_CID(version, code, digest, digest.bytes); + } + } + case 1: { + const bytes = dist_src_cid_encodeCID(version, code, digest.bytes); + return new multiformats_dist_src_cid_CID(version, code, digest, bytes); + } + default: { + throw new Error('Invalid version'); + } + } + } + /** + * Simplified version of `create` for CIDv0. + */ + static createV0(digest) { + return multiformats_dist_src_cid_CID.create(0, dist_src_cid_DAG_PB_CODE, digest); + } + /** + * Simplified version of `create` for CIDv1. + * + * @param code - Content encoding format code. + * @param digest - Multihash of the content. + */ + static createV1(code, digest) { + return multiformats_dist_src_cid_CID.create(1, code, digest); + } + /** + * Decoded a CID from its binary representation. The byte array must contain + * only the CID with no additional bytes. + * + * An error will be thrown if the bytes provided do not contain a valid + * binary representation of a CID. + */ + static decode(bytes) { + const [cid, remainder] = multiformats_dist_src_cid_CID.decodeFirst(bytes); + if (remainder.length !== 0) { + throw new Error('Incorrect length'); + } + return cid; + } + /** + * Decoded a CID from its binary representation at the beginning of a byte + * array. + * + * Returns an array with the first element containing the CID and the second + * element containing the remainder of the original byte array. The remainder + * will be a zero-length byte array if the provided bytes only contained a + * binary CID representation. + */ + static decodeFirst(bytes) { + const specs = multiformats_dist_src_cid_CID.inspectBytes(bytes); + const prefixSize = specs.size - specs.multihashSize; + const multihashBytes = multiformats_dist_src_bytes_coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize)); + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error('Incorrect length'); + } + const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize); + const digest = new dist_src_hashes_digest_Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); + const cid = specs.version === 0 + ? multiformats_dist_src_cid_CID.createV0(digest) + : multiformats_dist_src_cid_CID.createV1(specs.codec, digest); + return [cid, bytes.subarray(specs.size)]; + } + /** + * Inspect the initial bytes of a CID to determine its properties. + * + * Involves decoding up to 4 varints. Typically this will require only 4 to 6 + * bytes but for larger multicodec code values and larger multihash digest + * lengths these varints can be quite large. It is recommended that at least + * 10 bytes be made available in the `initialBytes` argument for a complete + * inspection. + */ + static inspectBytes(initialBytes) { + let offset = 0; + const next = () => { + const [i, length] = node_modules_multiformats_dist_src_varint_decode(initialBytes.subarray(offset)); + offset += length; + return i; + }; + let version = next(); + let codec = dist_src_cid_DAG_PB_CODE; + if (version === 18) { + // CIDv0 + version = 0; + offset = 0; + } + else { + codec = next(); + } + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`); + } + const prefixSize = offset; + const multihashCode = next(); // multihash code + const digestSize = next(); // multihash length + const size = offset + digestSize; + const multihashSize = size - prefixSize; + return { version, codec, multihashCode, digestSize, multihashSize, size }; + } + /** + * Takes cid in a string representation and creates an instance. If `base` + * decoder is not provided will use a default from the configuration. It will + * throw an error if encoding of the CID is not compatible with supplied (or + * a default decoder). + */ + static parse(source, base) { + const [prefix, bytes] = dist_src_cid_parseCIDtoBytes(source, base); + const cid = multiformats_dist_src_cid_CID.decode(bytes); + if (cid.version === 0 && source[0] !== 'Q') { + throw Error('Version 0 CID string must not include multibase prefix'); + } + // Cache string representation to avoid computing it on `this.toString()` + dist_src_cid_baseCache(cid).set(prefix, source); + return cid; + } +} +function dist_src_cid_parseCIDtoBytes(source, base) { + switch (source[0]) { + // CIDv0 is parsed differently + case 'Q': { + const decoder = base ?? dist_src_bases_base58_base58btc; + return [ + dist_src_bases_base58_base58btc.prefix, + decoder.decode(`${dist_src_bases_base58_base58btc.prefix}${source}`) + ]; + } + case dist_src_bases_base58_base58btc.prefix: { + const decoder = base ?? dist_src_bases_base58_base58btc; + return [dist_src_bases_base58_base58btc.prefix, decoder.decode(source)]; + } + case dist_src_bases_base32_base32.prefix: { + const decoder = base ?? dist_src_bases_base32_base32; + return [dist_src_bases_base32_base32.prefix, decoder.decode(source)]; + } + default: { + if (base == null) { + throw Error('To parse non base32 or base58btc encoded CID multibase decoder must be provided'); + } + return [source[0], base.decode(source)]; + } + } +} +function dist_src_cid_toStringV0(bytes, cache, base) { + const { prefix } = base; + if (prefix !== dist_src_bases_base58_base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base.name} encoding`); + } + const cid = cache.get(prefix); + if (cid == null) { + const cid = base.encode(bytes).slice(1); + cache.set(prefix, cid); + return cid; + } + else { + return cid; + } +} +function dist_src_cid_toStringV1(bytes, cache, base) { + const { prefix } = base; + const cid = cache.get(prefix); + if (cid == null) { + const cid = base.encode(bytes); + cache.set(prefix, cid); + return cid; + } + else { + return cid; + } +} +const dist_src_cid_DAG_PB_CODE = 0x70; +const dist_src_cid_SHA_256_CODE = 0x12; +function dist_src_cid_encodeCID(version, code, multihash) { + const codeOffset = dist_src_varint_encodingLength(version); + const hashOffset = codeOffset + dist_src_varint_encodingLength(code); + const bytes = new Uint8Array(hashOffset + multihash.byteLength); + dist_src_varint_encodeTo(version, bytes, 0); + dist_src_varint_encodeTo(code, bytes, codeOffset); + bytes.set(multihash, hashOffset); + return bytes; +} +const dist_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID'); +//# sourceMappingURL=cid.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/uint8arrays/dist/src/equals.js /** - * @template T - * @param {ByteView} data - * @returns {T} + * Returns true if the two passed Uint8Arrays have the same content */ -const node_modules_multiformats_src_codecs_json_decode = (data) => JSON.parse(node_modules_multiformats_src_codecs_json_textDecoder.decode(data)) - -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/cid.js +function equals_equals(a, b) { + if (a === b) { + return true; + } + if (a.byteLength !== b.byteLength) { + return false; + } + for (let i = 0; i < a.byteLength; i++) { + if (a[i] !== b[i]) { + return false; + } + } + return true; +} +//# sourceMappingURL=equals.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base10.js +const base10_base10 = dist_src_bases_base_baseX({ + prefix: '9', + name: 'base10', + alphabet: '0123456789' +}); +//# sourceMappingURL=base10.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base16.js +const base16_base16 = dist_src_bases_base_rfc4648({ + prefix: 'f', + name: 'base16', + alphabet: '0123456789abcdef', + bitsPerChar: 4 +}); +const base16_base16upper = dist_src_bases_base_rfc4648({ + prefix: 'F', + name: 'base16upper', + alphabet: '0123456789ABCDEF', + bitsPerChar: 4 +}); +//# sourceMappingURL=base16.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base2.js +const base2_base2 = dist_src_bases_base_rfc4648({ + prefix: '0', + name: 'base2', + alphabet: '01', + bitsPerChar: 1 +}); +//# sourceMappingURL=base2.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base256emoji.js +const base256emoji_alphabet = Array.from('🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂'); +const base256emoji_alphabetBytesToChars = (base256emoji_alphabet.reduce((p, c, i) => { p[i] = c; return p; }, ([]))); +const base256emoji_alphabetCharsToBytes = (base256emoji_alphabet.reduce((p, c, i) => { p[c.codePointAt(0)] = i; return p; }, ([]))); +function bases_base256emoji_encode(data) { + return data.reduce((p, c) => { + p += base256emoji_alphabetBytesToChars[c]; + return p; + }, ''); +} +function bases_base256emoji_decode(str) { + const byts = []; + for (const char of str) { + const byt = base256emoji_alphabetCharsToBytes[char.codePointAt(0)]; + if (byt === undefined) { + throw new Error(`Non-base256emoji character: ${char}`); + } + byts.push(byt); + } + return new Uint8Array(byts); +} +const base256emoji_base256emoji = dist_src_bases_base_from({ + prefix: '🚀', + name: 'base256emoji', + encode: bases_base256emoji_encode, + decode: bases_base256emoji_decode +}); +//# sourceMappingURL=base256emoji.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base36.js -// Linter can see that API is used in types. -// eslint-disable-next-line +const base36_base36 = dist_src_bases_base_baseX({ + prefix: 'k', + name: 'base36', + alphabet: '0123456789abcdefghijklmnopqrstuvwxyz' +}); +const base36_base36upper = dist_src_bases_base_baseX({ + prefix: 'K', + name: 'base36upper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' +}); +//# sourceMappingURL=base36.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base64.js +const src_bases_base64_base64 = dist_src_bases_base_rfc4648({ + prefix: 'm', + name: 'base64', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + bitsPerChar: 6 +}); +const src_bases_base64_base64pad = dist_src_bases_base_rfc4648({ + prefix: 'M', + name: 'base64pad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', + bitsPerChar: 6 +}); +const src_bases_base64_base64url = dist_src_bases_base_rfc4648({ + prefix: 'u', + name: 'base64url', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', + bitsPerChar: 6 +}); +const src_bases_base64_base64urlpad = dist_src_bases_base_rfc4648({ + prefix: 'U', + name: 'base64urlpad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', + bitsPerChar: 6 +}); +//# sourceMappingURL=base64.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/base8.js -// This way TS will also expose all the types from module +const base8_base8 = dist_src_bases_base_rfc4648({ + prefix: '7', + name: 'base8', + alphabet: '01234567', + bitsPerChar: 3 +}); +//# sourceMappingURL=base8.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/bases/identity.js -/** - * @template {API.Link} T - * @template {string} Prefix - * @param {T} link - * @param {API.MultibaseEncoder} [base] - * @returns {API.ToString} - */ -const peer_id_node_modules_multiformats_src_cid_format = (link, base) => { - const { bytes, version } = link - switch (version) { - case 0: - return peer_id_node_modules_multiformats_src_cid_toStringV0( - bytes, - peer_id_node_modules_multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder<"z">} */ (base) || peer_id_node_modules_multiformats_src_bases_base58_base58btc.encoder - ) - default: - return peer_id_node_modules_multiformats_src_cid_toStringV1( - bytes, - peer_id_node_modules_multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder} */ (base || peer_id_node_modules_multiformats_src_bases_base32_base32.encoder) - ) - } +const src_bases_identity_identity = dist_src_bases_base_from({ + prefix: '\x00', + name: 'identity', + encode: (buf) => multiformats_dist_src_bytes_toString(buf), + decode: (str) => dist_src_bytes_fromString(str) +}); +//# sourceMappingURL=identity.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/codecs/json.js +const codecs_json_textEncoder = new TextEncoder(); +const codecs_json_textDecoder = new TextDecoder(); +const codecs_json_name = 'json'; +const codecs_json_code = 0x0200; +function codecs_json_encode(node) { + return codecs_json_textEncoder.encode(JSON.stringify(node)); +} +function codecs_json_decode(data) { + return JSON.parse(codecs_json_textDecoder.decode(data)); } +//# sourceMappingURL=json.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/codecs/raw.js -/** - * @template {API.UnknownLink} Link - * @param {Link} link - * @returns {API.LinkJSON} - */ -const peer_id_node_modules_multiformats_src_cid_toJSON = (link) => ({ - '/': peer_id_node_modules_multiformats_src_cid_format(link) -}) +const codecs_raw_name = 'raw'; +const codecs_raw_code = 0x55; +function codecs_raw_encode(node) { + return multiformats_dist_src_bytes_coerce(node); +} +function codecs_raw_decode(data) { + return multiformats_dist_src_bytes_coerce(data); +} +//# sourceMappingURL=raw.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/hashes/identity.js -/** - * @template {API.UnknownLink} Link - * @param {API.LinkJSON} json - */ -const peer_id_node_modules_multiformats_src_cid_fromJSON = (json) => - peer_id_node_modules_multiformats_src_cid_CID.parse(json['/']) -/** @type {WeakMap>} */ -const peer_id_node_modules_multiformats_src_cid_cache = new WeakMap() +const hashes_identity_code = 0x0; +const hashes_identity_name = 'identity'; +const hashes_identity_encode = multiformats_dist_src_bytes_coerce; +function identity_digest(input) { + return dist_src_hashes_digest_create(hashes_identity_code, hashes_identity_encode(input)); +} +const hashes_identity_identity = { code: hashes_identity_code, name: hashes_identity_name, encode: hashes_identity_encode, digest: identity_digest }; +//# sourceMappingURL=identity.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/hashes/hasher.js +function src_hashes_hasher_from({ name, code, encode }) { + return new hashes_hasher_Hasher(name, code, encode); +} /** - * @param {API.UnknownLink} cid - * @returns {Map} + * Hasher represents a hashing algorithm implementation that produces as + * `MultihashDigest`. */ -const peer_id_node_modules_multiformats_src_cid_baseCache = cid => { - const baseCache = peer_id_node_modules_multiformats_src_cid_cache.get(cid) - if (baseCache == null) { - const baseCache = new Map() - peer_id_node_modules_multiformats_src_cid_cache.set(cid, baseCache) - return baseCache - } - return baseCache +class hashes_hasher_Hasher { + name; + code; + encode; + constructor(name, code, encode) { + this.name = name; + this.code = code; + this.encode = encode; + } + digest(input) { + if (input instanceof Uint8Array) { + const result = this.encode(input); + return result instanceof Uint8Array + ? dist_src_hashes_digest_create(this.code, result) + /* c8 ignore next 1 */ + : result.then(digest => dist_src_hashes_digest_create(this.code, digest)); + } + else { + throw Error('Unknown type, must be binary type'); + /* c8 ignore next 1 */ + } + } } +//# sourceMappingURL=hasher.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/hashes/sha2.js -/** - * @template {unknown} [Data=unknown] - * @template {number} [Format=number] - * @template {number} [Alg=number] - * @template {API.Version} [Version=API.Version] - * @implements {API.Link} - */ -class peer_id_node_modules_multiformats_src_cid_CID { - /** - * @param {Version} version - Version of the CID - * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content. - * @param {Uint8Array} bytes - * - */ - constructor (version, code, multihash, bytes) { - /** @readonly */ - this.code = code - /** @readonly */ - this.version = version - /** @readonly */ - this.multihash = multihash - /** @readonly */ - this.bytes = bytes - // flag to serializers that this is a CID and - // should be treated specially - /** @readonly */ - this['/'] = bytes - } +const hashes_sha2_sha256 = src_hashes_hasher_from({ + name: 'sha2-256', + code: 0x12, + encode: (input) => multiformats_dist_src_bytes_coerce(external_crypto_.createHash('sha256').update(input).digest()) +}); +const sha2_sha512 = src_hashes_hasher_from({ + name: 'sha2-512', + code: 0x13, + encode: input => multiformats_dist_src_bytes_coerce(external_crypto_.createHash('sha512').update(input).digest()) +}); +//# sourceMappingURL=sha2.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/index.js +/** + * @packageDocumentation + * + * This library defines common interfaces and low level building blocks for various interrelated multiformat technologies (multicodec, multihash, multibase, and CID). They can be used to implement custom base encoders / decoders / codecs, codec encoders /decoders and multihash hashers that comply to the interface that layers above assume. + * + * This library provides implementations for most basics and many others can be found in linked repositories. + * + * ```TypeScript + * import { CID } from 'multiformats/cid' + * import * as json from 'multiformats/codecs/json' + * import { sha256 } from 'multiformats/hashes/sha2' + * + * const bytes = json.encode({ hello: 'world' }) + * + * const hash = await sha256.digest(bytes) + * const cid = CID.create(1, json.code, hash) + * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) + * ``` + * + * ## Creating Blocks + * + * ```TypeScript + * import * as Block from 'multiformats/block' + * import * as codec from '@ipld/dag-cbor' + * import { sha256 as hasher } from 'multiformats/hashes/sha2' + * + * const value = { hello: 'world' } + * + * // encode a block + * let block = await Block.encode({ value, codec, hasher }) + * + * block.value // { hello: 'world' } + * block.bytes // Uint8Array + * block.cid // CID() w/ sha2-256 hash address and dag-cbor codec + * + * // you can also decode blocks from their binary state + * block = await Block.decode({ bytes: block.bytes, codec, hasher }) + * + * // if you have the cid you can also verify the hash on decode + * block = await Block.create({ bytes: block.bytes, cid: block.cid, codec, hasher }) + * ``` + * + * ## Multibase Encoders / Decoders / Codecs + * + * CIDs can be serialized to string representation using multibase encoders that implement [`MultibaseEncoder`](https://github.com/multiformats/js-multiformats/blob/master/src/bases/interface.ts) interface. This library provides quite a few implementations that can be imported: + * + * ```TypeScript + * import { base64 } from "multiformats/bases/base64" + * cid.toString(base64.encoder) + * //> 'mAYAEEiCTojlxqRTl6svwqNJRVM2jCcPBxy+7mRTUfGDzy2gViA' + * ``` + * + * Parsing CID string serialized CIDs requires multibase decoder that implements [`MultibaseDecoder`](https://github.com/multiformats/js-multiformats/blob/master/src/bases/interface.ts) interface. This library provides a decoder for every encoder it provides: + * + * ```TypeScript + * CID.parse('mAYAEEiCTojlxqRTl6svwqNJRVM2jCcPBxy+7mRTUfGDzy2gViA', base64.decoder) + * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) + * ``` + * + * Dual of multibase encoder & decoder is defined as multibase codec and it exposes + * them as `encoder` and `decoder` properties. For added convenience codecs also + * implement `MultibaseEncoder` and `MultibaseDecoder` interfaces so they could be + * used as either or both: + * + * ```TypeScript + * cid.toString(base64) + * CID.parse(cid.toString(base64), base64) + * ``` + * + * **Note:** CID implementation comes bundled with `base32` and `base58btc` + * multibase codecs so that CIDs can be base serialized to (version specific) + * default base encoding and parsed without having to supply base encoders/decoders: + * + * ```TypeScript + * const v1 = CID.parse('bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea') + * v1.toString() + * //> 'bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea' + * + * const v0 = CID.parse('QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n') + * v0.toString() + * //> 'QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n' + * v0.toV1().toString() + * //> 'bafybeihdwdcefgh4dqkjv67uzcmw7ojee6xedzdetojuzjevtenxquvyku' + * ``` + * + * ## Multicodec Encoders / Decoders / Codecs + * + * This library defines [`BlockEncoder`, `BlockDecoder` and `BlockCodec` interfaces](https://github.com/multiformats/js-multiformats/blob/master/src/codecs/interface.ts). + * Codec implementations should conform to the `BlockCodec` interface which implements both `BlockEncoder` and `BlockDecoder`. + * Here is an example implementation of JSON `BlockCodec`. + * + * ```TypeScript + * export const { name, code, encode, decode } = { + * name: 'json', + * code: 0x0200, + * encode: json => new TextEncoder().encode(JSON.stringify(json)), + * decode: bytes => JSON.parse(new TextDecoder().decode(bytes)) + * } + * ``` + * + * ## Multihash Hashers + * + * This library defines [`MultihashHasher` and `MultihashDigest` interfaces](https://github.com/multiformats/js-multiformats/blob/master/src/hashes/interface.ts) and convinient function for implementing them: + * + * ```TypeScript + * import * as hasher from 'multiformats/hashes/hasher' + * + * const sha256 = hasher.from({ + * // As per multiformats table + * // https://github.com/multiformats/multicodec/blob/master/table.csv#L9 + * name: 'sha2-256', + * code: 0x12, + * + * encode: (input) => new Uint8Array(crypto.createHash('sha256').update(input).digest()) + * }) + * + * const hash = await sha256.digest(json.encode({ hello: 'world' })) + * CID.create(1, json.code, hash) + * + * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) + * ``` + * + * ## Traversal + * + * This library contains higher-order functions for traversing graphs of data easily. + * + * `walk()` walks through the links in each block of a DAG calling a user-supplied loader function for each one, in depth-first order with no duplicate block visits. The loader should return a `Block` object and can be used to inspect and collect block ordering for a full DAG walk. The loader should `throw` on error, and return `null` if a block should be skipped by `walk()`. + * + * ```TypeScript + * import { walk } from 'multiformats/traversal' + * import * as Block from 'multiformats/block' + * import * as codec from 'multiformats/codecs/json' + * import { sha256 as hasher } from 'multiformats/hashes/sha2' + * + * // build a DAG (a single block for this simple example) + * const value = { hello: 'world' } + * const block = await Block.encode({ value, codec, hasher }) + * const { cid } = block + * console.log(cid) + * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) + * + * // create a loader function that also collects CIDs of blocks in + * // their traversal order + * const load = (cid, blocks) => async (cid) => { + * // fetch a block using its cid + * // e.g.: const block = await fetchBlockByCID(cid) + * blocks.push(cid) + * return block + * } + * + * // collect blocks in this DAG starting from the root `cid` + * const blocks = [] + * await walk({ cid, load: load(cid, blocks) }) + * + * console.log(blocks) + * //> [CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea)] + * ``` + * + * ## Legacy interface + * + * [`blockcodec-to-ipld-format`](https://github.com/ipld/js-blockcodec-to-ipld-format) converts a multiformats [`BlockCodec`](https://github.com/multiformats/js-multiformats/blob/master/src/codecs/interface.ts#L21) into an + * [`interface-ipld-format`](https://github.com/ipld/interface-ipld-format) for use with the [`ipld`](https://github.com/ipld/ipld) package. This can help bridge IPLD codecs implemented using the structure and interfaces defined here to existing code that assumes, or requires `interface-ipld-format`. This bridge also includes the relevant TypeScript definitions. + * + * ## Implementations + * + * By default, no base encodings (other than base32 & base58btc), hash functions, + * or codec implementations are exposed by `multiformats`, you need to + * import the ones you need yourself. + * + * ### Multibase codecs + * + * | bases | import | repo | + * | ------------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------- | + * | `base16` | `multiformats/bases/base16` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | + * | `base32`, `base32pad`, `base32hex`, `base32hexpad`, `base32z` | `multiformats/bases/base32` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | + * | `base64`, `base64pad`, `base64url`, `base64urlpad` | `multiformats/bases/base64` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | + * | `base58btc`, `base58flick4` | `multiformats/bases/base58` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | + * + * Other (less useful) bases implemented in [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) include: `base2`, `base8`, `base10`, `base36` and `base256emoji`. + * + * ### Multihash hashers + * + * | hashes | import | repo | + * | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------ | + * | `sha2-256`, `sha2-512` | `multiformats/hashes/sha2` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/hashes) | + * | `sha3-224`, `sha3-256`, `sha3-384`,`sha3-512`, `shake-128`, `shake-256`, `keccak-224`, `keccak-256`, `keccak-384`, `keccak-512` | `@multiformats/sha3` | [multiformats/js-sha3](https://github.com/multiformats/js-sha3) | + * | `identity` | `multiformats/hashes/identity` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/hashes/identity.js) | + * | `murmur3-128`, `murmur3-32` | `@multiformats/murmur3` | [multiformats/js-murmur3](https://github.com/multiformats/js-murmur3) | + * | `blake2b-*`, `blake2s-*` | `@multiformats/blake2` | [multiformats/js-blake2](https://github.com/multiformats/js-blake2) | + * + * ### IPLD codecs (multicodec) + * + * | codec | import | repo | + * | ---------- | -------------------------- | ------------------------------------------------------------------------------------------------------ | + * | `raw` | `multiformats/codecs/raw` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/codecs) | + * | `json` | `multiformats/codecs/json` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/codecs) | + * | `dag-cbor` | `@ipld/dag-cbor` | [ipld/js-dag-cbor](https://github.com/ipld/js-dag-cbor) | + * | `dag-json` | `@ipld/dag-json` | [ipld/js-dag-json](https://github.com/ipld/js-dag-json) | + * | `dag-pb` | `@ipld/dag-pb` | [ipld/js-dag-pb](https://github.com/ipld/js-dag-pb) | + * | `dag-jose` | `dag-jose` | [ceramicnetwork/js-dag-jose](https://github.com/ceramicnetwork/js-dag-jose) | + */ + - /** - * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` - * please either use `CID.asCID(cid)` or switch to new signalling mechanism - * - * @deprecated - */ - get asCID () { - return this - } - // ArrayBufferView - get byteOffset () { - return this.bytes.byteOffset - } - // ArrayBufferView - get byteLength () { - return this.bytes.byteLength - } - /** - * @returns {CID} - */ - toV0 () { - switch (this.version) { - case 0: { - return /** @type {CID} */ (this) - } - case 1: { - const { code, multihash } = this +// This way TS will also expose all the types from module - if (code !== peer_id_node_modules_multiformats_src_cid_DAG_PB_CODE) { - throw new Error('Cannot convert a non dag-pb CID to CIDv0') - } - // sha2-256 - if (multihash.code !== peer_id_node_modules_multiformats_src_cid_SHA_256_CODE) { - throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') - } +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/multiformats/dist/src/basics.js - return /** @type {CID} */ ( - peer_id_node_modules_multiformats_src_cid_CID.createV0( - /** @type {API.MultihashDigest} */ (multihash) - ) - ) - } - default: { - throw Error( - `Can not convert CID version ${this.version} to version 0. This is a bug please report` - ) - } - } - } - /** - * @returns {CID} - */ - toV1 () { - switch (this.version) { - case 0: { - const { code, digest } = this.multihash - const multihash = peer_id_node_modules_multiformats_src_hashes_digest_create(code, digest) - return /** @type {CID} */ ( - peer_id_node_modules_multiformats_src_cid_CID.createV1(this.code, multihash) - ) - } - case 1: { - return /** @type {CID} */ (this) - } - default: { - throw Error( - `Can not convert CID version ${this.version} to version 1. This is a bug please report` - ) - } - } - } - /** - * @param {unknown} other - * @returns {other is CID} - */ - equals (other) { - return peer_id_node_modules_multiformats_src_cid_CID.equals(this, other) - } - /** - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @param {API.Link} self - * @param {unknown} other - * @returns {other is CID} - */ - static equals (self, other) { - const unknown = - /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ ( - other - ) - return ( - unknown && - self.code === unknown.code && - self.version === unknown.version && - peer_id_node_modules_multiformats_src_hashes_digest_equals(self.multihash, unknown.multihash) - ) - } - /** - * @param {API.MultibaseEncoder} [base] - * @returns {string} - */ - toString (base) { - return peer_id_node_modules_multiformats_src_cid_format(this, base) - } - toJSON () { - return { '/': peer_id_node_modules_multiformats_src_cid_format(this) } - } - link () { - return this - } - get [Symbol.toStringTag] () { - return 'CID' - } - // Legacy - [Symbol.for('nodejs.util.inspect.custom')] () { - return `CID(${this.toString()})` - } - /** - * Takes any input `value` and returns a `CID` instance if it was - * a `CID` otherwise returns `null`. If `value` is instanceof `CID` - * it will return value back. If `value` is not instance of this CID - * class, but is compatible CID it will return new instance of this - * `CID` class. Otherwise returns null. - * - * This allows two different incompatible versions of CID library to - * co-exist and interop as long as binary interface is compatible. - * - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @template {unknown} U - * @param {API.Link|U} input - * @returns {CID|null} - */ - static asCID (input) { - if (input == null) { - return null - } - const value = /** @type {any} */ (input) - if (value instanceof peer_id_node_modules_multiformats_src_cid_CID) { - // If value is instance of CID then we're all set. - return value - } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { - // If value isn't instance of this CID class but `this.asCID === this` or - // `value['/'] === value.bytes` is true it is CID instance coming from a - // different implementation (diff version or duplicate). In that case we - // rebase it to this `CID` implementation so caller is guaranteed to get - // instance with expected API. - const { version, code, multihash, bytes } = value - return new peer_id_node_modules_multiformats_src_cid_CID( - version, - code, - /** @type {API.MultihashDigest} */ (multihash), - bytes || peer_id_node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes) - ) - } else if (value[peer_id_node_modules_multiformats_src_cid_cidSymbol] === true) { - // If value is a CID from older implementation that used to be tagged via - // symbol we still rebase it to the this `CID` implementation by - // delegating that to a constructor. - const { version, multihash, code } = value - const digest = - /** @type {API.MultihashDigest} */ - (peer_id_node_modules_multiformats_src_hashes_digest_decode(multihash)) - return peer_id_node_modules_multiformats_src_cid_CID.create(version, code, digest) - } else { - // Otherwise value is not a CID (or an incompatible version of it) in - // which case we return `null`. - return null - } - } - /** - * - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @param {Version} version - Version of the CID - * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param {API.MultihashDigest} digest - (Multi)hash of the of the content. - * @returns {CID} - */ - static create (version, code, digest) { - if (typeof code !== 'number') { - throw new Error('String codecs are no longer supported') - } - if (!(digest.bytes instanceof Uint8Array)) { - throw new Error('Invalid digest') - } - switch (version) { - case 0: { - if (code !== peer_id_node_modules_multiformats_src_cid_DAG_PB_CODE) { - throw new Error( - `Version 0 CID must use dag-pb (code: ${peer_id_node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding` - ) - } else { - return new peer_id_node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes) - } - } - case 1: { - const bytes = peer_id_node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes) - return new peer_id_node_modules_multiformats_src_cid_CID(version, code, digest, bytes) - } - default: { - throw new Error('Invalid version') - } +const basics_bases = { ...src_bases_identity_namespaceObject, ...bases_base2_namespaceObject, ...bases_base8_namespaceObject, ...bases_base10_namespaceObject, ...bases_base16_namespaceObject, ...dist_src_bases_base32_namespaceObject, ...bases_base36_namespaceObject, ...dist_src_bases_base58_namespaceObject, ...dist_src_bases_base64_namespaceObject, ...bases_base256emoji_namespaceObject }; +const basics_hashes = { ...hashes_sha2_namespaceObject, ...hashes_identity_namespaceObject }; +const basics_codecs = { raw: codecs_raw_namespaceObject, json: src_codecs_json_namespaceObject }; + +//# sourceMappingURL=basics.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/uint8arrays/dist/src/util/as-uint8array.js +/** + * To guarantee Uint8Array semantics, convert nodejs Buffers + * into vanilla Uint8Arrays + */ +function as_uint8array_asUint8Array(buf) { + if (globalThis.Buffer != null) { + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); } - } + return buf; +} +//# sourceMappingURL=as-uint8array.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/uint8arrays/dist/src/alloc.js - /** - * Simplified version of `create` for CIDv0. - * - * @template {unknown} [T=unknown] - * @param {API.MultihashDigest} digest - Multihash. - * @returns {CID} - */ - static createV0 (digest) { - return peer_id_node_modules_multiformats_src_cid_CID.create(0, peer_id_node_modules_multiformats_src_cid_DAG_PB_CODE, digest) - } +/** + * Returns a `Uint8Array` of the requested size. Referenced memory will + * be initialized to 0. + */ +function alloc_alloc(size = 0) { + if (globalThis.Buffer?.alloc != null) { + return asUint8Array(globalThis.Buffer.alloc(size)); + } + return new Uint8Array(size); +} +/** + * Where possible returns a Uint8Array of the requested size that references + * uninitialized memory. Only use if you are certain you will immediately + * overwrite every value in the returned `Uint8Array`. + */ +function allocUnsafe(size = 0) { + if (globalThis.Buffer?.allocUnsafe != null) { + return as_uint8array_asUint8Array(globalThis.Buffer.allocUnsafe(size)); + } + return new Uint8Array(size); +} +//# sourceMappingURL=alloc.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/uint8arrays/dist/src/util/bases.js - /** - * Simplified version of `create` for CIDv1. - * - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @param {Code} code - Content encoding format code. - * @param {API.MultihashDigest} digest - Miltihash of the content. - * @returns {CID} - */ - static createV1 (code, digest) { - return peer_id_node_modules_multiformats_src_cid_CID.create(1, code, digest) - } - /** - * Decoded a CID from its binary representation. The byte array must contain - * only the CID with no additional bytes. - * - * An error will be thrown if the bytes provided do not contain a valid - * binary representation of a CID. - * - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ByteView>} bytes - * @returns {CID} - */ - static decode (bytes) { - const [cid, remainder] = peer_id_node_modules_multiformats_src_cid_CID.decodeFirst(bytes) - if (remainder.length) { - throw new Error('Incorrect length') +function createCodec(name, prefix, encode, decode) { + return { + name, + prefix, + encoder: { + name, + prefix, + encode + }, + decoder: { + decode + } + }; +} +const string = createCodec('utf8', 'u', (buf) => { + const decoder = new TextDecoder('utf8'); + return 'u' + decoder.decode(buf); +}, (str) => { + const encoder = new TextEncoder(); + return encoder.encode(str.substring(1)); +}); +const ascii = createCodec('ascii', 'a', (buf) => { + let string = 'a'; + for (let i = 0; i < buf.length; i++) { + string += String.fromCharCode(buf[i]); } - return cid - } - - /** - * Decoded a CID from its binary representation at the beginning of a byte - * array. - * - * Returns an array with the first element containing the CID and the second - * element containing the remainder of the original byte array. The remainder - * will be a zero-length byte array if the provided bytes only contained a - * binary CID representation. - * - * @template {unknown} T - * @template {number} C - * @template {number} A - * @template {API.Version} V - * @param {API.ByteView>} bytes - * @returns {[CID, Uint8Array]} - */ - static decodeFirst (bytes) { - const specs = peer_id_node_modules_multiformats_src_cid_CID.inspectBytes(bytes) - const prefixSize = specs.size - specs.multihashSize - const multihashBytes = peer_id_node_modules_multiformats_src_bytes_coerce( - bytes.subarray(prefixSize, prefixSize + specs.multihashSize) - ) - if (multihashBytes.byteLength !== specs.multihashSize) { - throw new Error('Incorrect length') + return string; +}, (str) => { + str = str.substring(1); + const buf = allocUnsafe(str.length); + for (let i = 0; i < str.length; i++) { + buf[i] = str.charCodeAt(i); } - const digestBytes = multihashBytes.subarray( - specs.multihashSize - specs.digestSize - ) - const digest = new peer_id_node_modules_multiformats_src_hashes_digest_Digest( - specs.multihashCode, - specs.digestSize, - digestBytes, - multihashBytes - ) - const cid = - specs.version === 0 - ? peer_id_node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) - : peer_id_node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest) - return [/** @type {CID} */(cid), bytes.subarray(specs.size)] - } + return buf; +}); +const BASES = { + utf8: string, + 'utf-8': string, + hex: basics_bases.base16, + latin1: ascii, + ascii, + binary: ascii, + ...basics_bases +}; +/* harmony default export */ const util_bases = (BASES); +//# sourceMappingURL=bases.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/uint8arrays/dist/src/to-string.js - /** - * Inspect the initial bytes of a CID to determine its properties. - * - * Involves decoding up to 4 varints. Typically this will require only 4 to 6 - * bytes but for larger multicodec code values and larger multihash digest - * lengths these varints can be quite large. It is recommended that at least - * 10 bytes be made available in the `initialBytes` argument for a complete - * inspection. - * - * @template {unknown} T - * @template {number} C - * @template {number} A - * @template {API.Version} V - * @param {API.ByteView>} initialBytes - * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }} - */ - static inspectBytes (initialBytes) { - let offset = 0 - const next = () => { - const [i, length] = peer_id_node_modules_multiformats_src_varint_decode(initialBytes.subarray(offset)) - offset += length - return i +/** + * Turns a `Uint8Array` into a string. + * + * Supports `utf8`, `utf-8` and any encoding supported by the multibase module. + * + * Also `ascii` which is similar to node's 'binary' encoding. + */ +function to_string_toString(array, encoding = 'utf8') { + const base = util_bases[encoding]; + if (base == null) { + throw new Error(`Unsupported encoding "${encoding}"`); } - - let version = /** @type {V} */ (next()) - let codec = /** @type {C} */ (peer_id_node_modules_multiformats_src_cid_DAG_PB_CODE) - if (/** @type {number} */(version) === 18) { - // CIDv0 - version = /** @type {V} */ (0) - offset = 0 - } else { - codec = /** @type {C} */ (next()) + if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) { + return globalThis.Buffer.from(array.buffer, array.byteOffset, array.byteLength).toString('utf8'); + } + // strip multibase prefix + return base.encoder.encode(array).substring(1); +} +//# sourceMappingURL=to-string.js.map +;// CONCATENATED MODULE: ./node_modules/uint8-varint/node_modules/uint8arrays/dist/src/util/as-uint8array.js +/** + * To guarantee Uint8Array semantics, convert nodejs Buffers + * into vanilla Uint8Arrays + */ +function util_as_uint8array_asUint8Array(buf) { + if (globalThis.Buffer != null) { + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); } + return buf; +} +//# sourceMappingURL=as-uint8array.js.map +;// CONCATENATED MODULE: ./node_modules/uint8-varint/node_modules/uint8arrays/dist/src/alloc.js - if (version !== 0 && version !== 1) { - throw new RangeError(`Invalid CID version ${version}`) +/** + * Returns a `Uint8Array` of the requested size. Referenced memory will + * be initialized to 0. + */ +function src_alloc_alloc(size = 0) { + if (globalThis.Buffer?.alloc != null) { + return asUint8Array(globalThis.Buffer.alloc(size)); + } + return new Uint8Array(size); +} +/** + * Where possible returns a Uint8Array of the requested size that references + * uninitialized memory. Only use if you are certain you will immediately + * overwrite every value in the returned `Uint8Array`. + */ +function alloc_allocUnsafe(size = 0) { + if (globalThis.Buffer?.allocUnsafe != null) { + return util_as_uint8array_asUint8Array(globalThis.Buffer.allocUnsafe(size)); } + return new Uint8Array(size); +} +//# sourceMappingURL=alloc.js.map +;// CONCATENATED MODULE: ./node_modules/uint8-varint/dist/src/index.js +/* eslint-disable no-fallthrough */ - const prefixSize = offset - const multihashCode = /** @type {A} */ (next()) // multihash code - const digestSize = next() // multihash length - const size = offset + digestSize - const multihashSize = size - prefixSize +const src_N1 = Math.pow(2, 7); +const src_N2 = Math.pow(2, 14); +const src_N3 = Math.pow(2, 21); +const src_N4 = Math.pow(2, 28); +const src_N5 = Math.pow(2, 35); +const src_N6 = Math.pow(2, 42); +const src_N7 = Math.pow(2, 49); +/** Most significant bit of a byte */ +const src_MSB = 0x80; +/** Rest of the bits in a byte */ +const src_REST = 0x7f; +function src_encodingLength(value) { + if (value < src_N1) { + return 1; + } + if (value < src_N2) { + return 2; + } + if (value < src_N3) { + return 3; + } + if (value < src_N4) { + return 4; + } + if (value < src_N5) { + return 5; + } + if (value < src_N6) { + return 6; + } + if (value < src_N7) { + return 7; + } + if (Number.MAX_SAFE_INTEGER != null && value > Number.MAX_SAFE_INTEGER) { + throw new RangeError('Could not encode varint'); + } + return 8; +} +function encodeUint8Array(value, buf, offset = 0) { + switch (src_encodingLength(value)) { + case 8: { + buf[offset++] = (value & 0xFF) | src_MSB; + value /= 128; + } + case 7: { + buf[offset++] = (value & 0xFF) | src_MSB; + value /= 128; + } + case 6: { + buf[offset++] = (value & 0xFF) | src_MSB; + value /= 128; + } + case 5: { + buf[offset++] = (value & 0xFF) | src_MSB; + value /= 128; + } + case 4: { + buf[offset++] = (value & 0xFF) | src_MSB; + value >>>= 7; + } + case 3: { + buf[offset++] = (value & 0xFF) | src_MSB; + value >>>= 7; + } + case 2: { + buf[offset++] = (value & 0xFF) | src_MSB; + value >>>= 7; + } + case 1: { + buf[offset++] = (value & 0xFF); + value >>>= 7; + break; + } + default: throw new Error('unreachable'); + } + return buf; +} +function encodeUint8ArrayList(value, buf, offset = 0) { + switch (src_encodingLength(value)) { + case 8: { + buf.set(offset++, (value & 0xFF) | src_MSB); + value /= 128; + } + case 7: { + buf.set(offset++, (value & 0xFF) | src_MSB); + value /= 128; + } + case 6: { + buf.set(offset++, (value & 0xFF) | src_MSB); + value /= 128; + } + case 5: { + buf.set(offset++, (value & 0xFF) | src_MSB); + value /= 128; + } + case 4: { + buf.set(offset++, (value & 0xFF) | src_MSB); + value >>>= 7; + } + case 3: { + buf.set(offset++, (value & 0xFF) | src_MSB); + value >>>= 7; + } + case 2: { + buf.set(offset++, (value & 0xFF) | src_MSB); + value >>>= 7; + } + case 1: { + buf.set(offset++, (value & 0xFF)); + value >>>= 7; + break; + } + default: throw new Error('unreachable'); + } + return buf; +} +function decodeUint8Array(buf, offset) { + let b = buf[offset]; + let res = 0; + res += b & src_REST; + if (b < src_MSB) { + return res; + } + b = buf[offset + 1]; + res += (b & src_REST) << 7; + if (b < src_MSB) { + return res; + } + b = buf[offset + 2]; + res += (b & src_REST) << 14; + if (b < src_MSB) { + return res; + } + b = buf[offset + 3]; + res += (b & src_REST) << 21; + if (b < src_MSB) { + return res; + } + b = buf[offset + 4]; + res += (b & src_REST) * src_N4; + if (b < src_MSB) { + return res; + } + b = buf[offset + 5]; + res += (b & src_REST) * src_N5; + if (b < src_MSB) { + return res; + } + b = buf[offset + 6]; + res += (b & src_REST) * src_N6; + if (b < src_MSB) { + return res; + } + b = buf[offset + 7]; + res += (b & src_REST) * src_N7; + if (b < src_MSB) { + return res; + } + throw new RangeError('Could not decode varint'); +} +function decodeUint8ArrayList(buf, offset) { + let b = buf.get(offset); + let res = 0; + res += b & src_REST; + if (b < src_MSB) { + return res; + } + b = buf.get(offset + 1); + res += (b & src_REST) << 7; + if (b < src_MSB) { + return res; + } + b = buf.get(offset + 2); + res += (b & src_REST) << 14; + if (b < src_MSB) { + return res; + } + b = buf.get(offset + 3); + res += (b & src_REST) << 21; + if (b < src_MSB) { + return res; + } + b = buf.get(offset + 4); + res += (b & src_REST) * src_N4; + if (b < src_MSB) { + return res; + } + b = buf.get(offset + 5); + res += (b & src_REST) * src_N5; + if (b < src_MSB) { + return res; + } + b = buf.get(offset + 6); + res += (b & src_REST) * src_N6; + if (b < src_MSB) { + return res; + } + b = buf.get(offset + 7); + res += (b & src_REST) * src_N7; + if (b < src_MSB) { + return res; + } + throw new RangeError('Could not decode varint'); +} +function dist_src_encode(value, buf, offset = 0) { + if (buf == null) { + buf = alloc_allocUnsafe(src_encodingLength(value)); + } + if (buf instanceof Uint8Array) { + return encodeUint8Array(value, buf, offset); + } + else { + return encodeUint8ArrayList(value, buf, offset); + } +} +function dist_src_decode(buf, offset = 0) { + if (buf instanceof Uint8Array) { + return decodeUint8Array(buf, offset); + } + else { + return decodeUint8ArrayList(buf, offset); + } +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/uint8arrays/dist/src/concat.js - return { version, codec, multihashCode, digestSize, multihashSize, size } - } - /** - * Takes cid in a string representation and creates an instance. If `base` - * decoder is not provided will use a default from the configuration. It will - * throw an error if encoding of the CID is not compatible with supplied (or - * a default decoder). - * - * @template {string} Prefix - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ToString, Prefix>} source - * @param {API.MultibaseDecoder} [base] - * @returns {CID} - */ - static parse (source, base) { - const [prefix, bytes] = peer_id_node_modules_multiformats_src_cid_parseCIDtoBytes(source, base) +/** + * Returns a new Uint8Array created by concatenating the passed Uint8Arrays + */ +function concat_concat(arrays, length) { + if (globalThis.Buffer != null) { + return as_uint8array_asUint8Array(globalThis.Buffer.concat(arrays, length)); + } + if (length == null) { + length = arrays.reduce((acc, curr) => acc + curr.length, 0); + } + const output = allocUnsafe(length); + let offset = 0; + for (const arr of arrays) { + output.set(arr, offset); + offset += arr.length; + } + return as_uint8array_asUint8Array(output); +} +//# sourceMappingURL=concat.js.map +;// CONCATENATED MODULE: ./node_modules/@chainsafe/is-ip/lib/parser.js +/* eslint-disable @typescript-eslint/no-unsafe-return */ +class Parser { + index = 0; + input = ""; + new(input) { + this.index = 0; + this.input = input; + return this; + } + /** Run a parser, and restore the pre-parse state if it fails. */ + readAtomically(fn) { + const index = this.index; + const result = fn(); + if (result === undefined) { + this.index = index; + } + return result; + } + /** Run a parser, but fail if the entire input wasn't consumed. Doesn't run atomically. */ + parseWith(fn) { + const result = fn(); + if (this.index !== this.input.length) { + return undefined; + } + return result; + } + /** Peek the next character from the input */ + peekChar() { + if (this.index >= this.input.length) { + return undefined; + } + return this.input[this.index]; + } + /** Read the next character from the input */ + readChar() { + if (this.index >= this.input.length) { + return undefined; + } + return this.input[this.index++]; + } + /** Read the next character from the input if it matches the target. */ + readGivenChar(target) { + return this.readAtomically(() => { + const char = this.readChar(); + if (char !== target) { + return undefined; + } + return char; + }); + } + /** + * Helper for reading separators in an indexed loop. Reads the separator + * character iff index > 0, then runs the parser. When used in a loop, + * the separator character will only be read on index > 0 (see + * readIPv4Addr for an example) + */ + readSeparator(sep, index, inner) { + return this.readAtomically(() => { + if (index > 0) { + if (this.readGivenChar(sep) === undefined) { + return undefined; + } + } + return inner(); + }); + } + /** + * Read a number off the front of the input in the given radix, stopping + * at the first non-digit character or eof. Fails if the number has more + * digits than max_digits or if there is no number. + */ + readNumber(radix, maxDigits, allowZeroPrefix, maxBytes) { + return this.readAtomically(() => { + let result = 0; + let digitCount = 0; + const leadingChar = this.peekChar(); + if (leadingChar === undefined) { + return undefined; + } + const hasLeadingZero = leadingChar === "0"; + const maxValue = 2 ** (8 * maxBytes) - 1; + // eslint-disable-next-line no-constant-condition + while (true) { + const digit = this.readAtomically(() => { + const char = this.readChar(); + if (char === undefined) { + return undefined; + } + const num = Number.parseInt(char, radix); + if (Number.isNaN(num)) { + return undefined; + } + return num; + }); + if (digit === undefined) { + break; + } + result *= radix; + result += digit; + if (result > maxValue) { + return undefined; + } + digitCount += 1; + if (maxDigits !== undefined) { + if (digitCount > maxDigits) { + return undefined; + } + } + } + if (digitCount === 0) { + return undefined; + } + else if (!allowZeroPrefix && hasLeadingZero && digitCount > 1) { + return undefined; + } + else { + return result; + } + }); + } + /** Read an IPv4 address. */ + readIPv4Addr() { + return this.readAtomically(() => { + const out = new Uint8Array(4); + for (let i = 0; i < out.length; i++) { + const ix = this.readSeparator(".", i, () => this.readNumber(10, 3, false, 1)); + if (ix === undefined) { + return undefined; + } + out[i] = ix; + } + return out; + }); + } + /** Read an IPv6 Address. */ + readIPv6Addr() { + /** + * Read a chunk of an IPv6 address into `groups`. Returns the number + * of groups read, along with a bool indicating if an embedded + * trailing IPv4 address was read. Specifically, read a series of + * colon-separated IPv6 groups (0x0000 - 0xFFFF), with an optional + * trailing embedded IPv4 address. + */ + const readGroups = (groups) => { + for (let i = 0; i < groups.length / 2; i++) { + const ix = i * 2; + // Try to read a trailing embedded IPv4 address. There must be at least 4 groups left. + if (i < groups.length - 3) { + const ipv4 = this.readSeparator(":", i, () => this.readIPv4Addr()); + if (ipv4 !== undefined) { + groups[ix] = ipv4[0]; + groups[ix + 1] = ipv4[1]; + groups[ix + 2] = ipv4[2]; + groups[ix + 3] = ipv4[3]; + return [ix + 4, true]; + } + } + const group = this.readSeparator(":", i, () => this.readNumber(16, 4, true, 2)); + if (group === undefined) { + return [ix, false]; + } + groups[ix] = group >> 8; + groups[ix + 1] = group & 255; + } + return [groups.length, false]; + }; + return this.readAtomically(() => { + // Read the front part of the address; either the whole thing, or up to the first :: + const head = new Uint8Array(16); + const [headSize, headIp4] = readGroups(head); + if (headSize === 16) { + return head; + } + // IPv4 part is not allowed before `::` + if (headIp4) { + return undefined; + } + // Read `::` if previous code parsed less than 8 groups. + // `::` indicates one or more groups of 16 bits of zeros. + if (this.readGivenChar(":") === undefined) { + return undefined; + } + if (this.readGivenChar(":") === undefined) { + return undefined; + } + // Read the back part of the address. The :: must contain at least one + // set of zeroes, so our max length is 7. + const tail = new Uint8Array(14); + const limit = 16 - (headSize + 2); + const [tailSize] = readGroups(tail.subarray(0, limit)); + // Concat the head and tail of the IP address + head.set(tail.subarray(0, tailSize), 16 - tailSize); + return head; + }); + } + /** Read an IP Address, either IPv4 or IPv6. */ + readIPAddr() { + return this.readIPv4Addr() ?? this.readIPv6Addr(); + } +} +//# sourceMappingURL=parser.js.map +;// CONCATENATED MODULE: ./node_modules/@chainsafe/is-ip/lib/parse.js - const cid = peer_id_node_modules_multiformats_src_cid_CID.decode(bytes) +// See https://stackoverflow.com/questions/166132/maximum-length-of-the-textual-representation-of-an-ipv6-address +const MAX_IPV6_LENGTH = 45; +const MAX_IPV4_LENGTH = 15; +const parser = new Parser(); +/** Parse `input` into IPv4 bytes. */ +function parse_parseIPv4(input) { + if (input.length > MAX_IPV4_LENGTH) { + return undefined; + } + return parser.new(input).parseWith(() => parser.readIPv4Addr()); +} +/** Parse `input` into IPv6 bytes. */ +function parse_parseIPv6(input) { + // strip zone index if it is present + if (input.includes("%")) { + input = input.split("%")[0]; + } + if (input.length > MAX_IPV6_LENGTH) { + return undefined; + } + return parser.new(input).parseWith(() => parser.readIPv6Addr()); +} +/** Parse `input` into IPv4 or IPv6 bytes. */ +function parse_parseIP(input) { + // strip zone index if it is present + if (input.includes("%")) { + input = input.split("%")[0]; + } + if (input.length > MAX_IPV6_LENGTH) { + return undefined; + } + return parser.new(input).parseWith(() => parser.readIPAddr()); +} +//# sourceMappingURL=parse.js.map +;// CONCATENATED MODULE: ./node_modules/@chainsafe/netmask/dist/src/util.js - if (cid.version === 0 && source[0] !== 'Q') { - throw Error('Version 0 CID string must not include multibase prefix') +function util_allFF(a, from, to) { + let i = 0; + for (const e of a) { + if (i < from) + continue; + if (i > to) + break; + if (e !== 0xff) + return false; + i++; + } + return true; +} +function util_deepEqual(a, b, from, to) { + let i = 0; + for (const e of a) { + if (i < from) + continue; + if (i > to) + break; + if (e !== b[i]) + return false; + i++; + } + return true; +} +/*** + * Returns long ip format + */ +function util_ipToString(ip) { + switch (ip.length) { + case IPv4Len: { + return ip.join("."); + } + case IPv6Len: { + const result = []; + for (let i = 0; i < ip.length; i++) { + if (i % 2 === 0) { + result.push(ip[i].toString(16).padStart(2, "0") + + ip[i + 1].toString(16).padStart(2, "0")); + } + } + return result.join(":"); + } + default: { + throw new Error("Invalid ip length"); + } } - - // Cache string representation to avoid computing it on `this.toString()` - peer_id_node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source) - - return cid - } } - /** - * @template {string} Prefix - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ToString, Prefix>} source - * @param {API.MultibaseDecoder} [base] - * @returns {[Prefix, API.ByteView>]} + * If mask is a sequence of 1 bits followed by 0 bits, return number of 1 bits else -1 */ -const peer_id_node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => { - switch (source[0]) { - // CIDv0 is parsed differently - case 'Q': { - const decoder = base || peer_id_node_modules_multiformats_src_bases_base58_base58btc - return [ - /** @type {Prefix} */ (peer_id_node_modules_multiformats_src_bases_base58_base58btc.prefix), - decoder.decode(`${peer_id_node_modules_multiformats_src_bases_base58_base58btc.prefix}${source}`) - ] - } - case peer_id_node_modules_multiformats_src_bases_base58_base58btc.prefix: { - const decoder = base || peer_id_node_modules_multiformats_src_bases_base58_base58btc - return [/** @type {Prefix} */(peer_id_node_modules_multiformats_src_bases_base58_base58btc.prefix), decoder.decode(source)] - } - case peer_id_node_modules_multiformats_src_bases_base32_base32.prefix: { - const decoder = base || peer_id_node_modules_multiformats_src_bases_base32_base32 - return [/** @type {Prefix} */(peer_id_node_modules_multiformats_src_bases_base32_base32.prefix), decoder.decode(source)] +function util_simpleMaskLength(mask) { + let ones = 0; + // eslint-disable-next-line prefer-const + for (let [index, byte] of mask.entries()) { + if (byte === 0xff) { + ones += 8; + continue; + } + while ((byte & 0x80) != 0) { + ones++; + byte = byte << 1; + } + if ((byte & 0x80) != 0) { + return -1; + } + for (let i = index + 1; i < mask.length; i++) { + if (mask[i] != 0) { + return -1; + } + } + break; } - default: { - if (base == null) { - throw Error( - 'To parse non base32 or base58btc encoded CID multibase decoder must be provided' - ) - } - return [/** @type {Prefix} */(source[0]), base.decode(source)] + return ones; +} +function util_maskToHex(mask) { + let hex = "0x"; + for (const byte of mask) { + hex += (byte >> 4).toString(16) + (byte & 0x0f).toString(16); } - } + return hex; } +//# sourceMappingURL=util.js.map +;// CONCATENATED MODULE: ./node_modules/@chainsafe/netmask/dist/src/ip.js -/** - * - * @param {Uint8Array} bytes - * @param {Map} cache - * @param {API.MultibaseEncoder<'z'>} base - */ -const peer_id_node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => { - const { prefix } = base - if (prefix !== peer_id_node_modules_multiformats_src_bases_base58_base58btc.prefix) { - throw Error(`Cannot string encode V0 in ${base.name} encoding`) - } - const cid = cache.get(prefix) - if (cid == null) { - const cid = base.encode(bytes).slice(1) - cache.set(prefix, cid) - return cid - } else { - return cid - } +const ip_IPv4Len = 4; +const ip_IPv6Len = 16; +const maxIPv6Octet = parseInt("0xFFFF", 16); +const ipv4Prefix = new Uint8Array([ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, +]); +function ip_maskIp(ip, mask) { + if (mask.length === ip_IPv6Len && ip.length === ip_IPv4Len && allFF(mask, 0, 11)) { + mask = mask.slice(12); + } + if (mask.length === ip_IPv4Len && + ip.length === ip_IPv6Len && + deepEqual(ip, ipv4Prefix, 0, 11)) { + ip = ip.slice(12); + } + const n = ip.length; + if (n != mask.length) { + throw new Error("Failed to mask ip"); + } + const out = new Uint8Array(n); + for (let i = 0; i < n; i++) { + out[i] = ip[i] & mask[i]; + } + return out; } - -/** - * @template {string} Prefix - * @param {Uint8Array} bytes - * @param {Map} cache - * @param {API.MultibaseEncoder} base - */ -const peer_id_node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => { - const { prefix } = base - const cid = cache.get(prefix) - if (cid == null) { - const cid = base.encode(bytes) - cache.set(prefix, cid) - return cid - } else { - return cid - } +function ip_containsIp(net, ip) { + if (typeof ip === "string") { + ip = parseIP(ip); + } + if (ip == null) + throw new Error("Invalid ip"); + if (ip.length !== net.network.length) { + return false; + } + for (let i = 0; i < ip.length; i++) { + if ((net.network[i] & net.mask[i]) !== (ip[i] & net.mask[i])) { + return false; + } + } + return true; +} +function iPv4FromIPv6(ip) { + if (!isIPv4mappedIPv6(ip)) { + throw new Error("Must have 0xffff prefix"); + } + return ip.slice(12); +} +function isIPv4mappedIPv6(ip) { + return deepEqual(ip, ipv4Prefix, 0, 11); } +//# sourceMappingURL=ip.js.map +;// CONCATENATED MODULE: ./node_modules/@chainsafe/netmask/dist/src/cidr.js -const peer_id_node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70 -const peer_id_node_modules_multiformats_src_cid_SHA_256_CODE = 0x12 -/** - * @param {API.Version} version - * @param {number} code - * @param {Uint8Array} multihash - * @returns {Uint8Array} - */ -const peer_id_node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => { - const codeOffset = peer_id_node_modules_multiformats_src_varint_encodingLength(version) - const hashOffset = codeOffset + peer_id_node_modules_multiformats_src_varint_encodingLength(code) - const bytes = new Uint8Array(hashOffset + multihash.byteLength) - peer_id_node_modules_multiformats_src_varint_encodeTo(version, bytes, 0) - peer_id_node_modules_multiformats_src_varint_encodeTo(code, bytes, codeOffset) - bytes.set(multihash, hashOffset) - return bytes +function cidr_parseCidr(s) { + const [address, maskString] = s.split("/"); + if (!address || !maskString) + throw new Error("Failed to parse given CIDR: " + s); + let ipLength = IPv4Len; + let ip = parseIPv4(address); + if (ip == null) { + ipLength = IPv6Len; + ip = parseIPv6(address); + if (ip == null) + throw new Error("Failed to parse given CIDR: " + s); + } + const m = parseInt(maskString, 10); + if (Number.isNaN(m) || + String(m).length !== maskString.length || + m < 0 || + m > ipLength * 8) { + throw new Error("Failed to parse given CIDR: " + s); + } + const mask = cidr_cidrMask(m, 8 * ipLength); + return { + network: maskIp(ip, mask), + mask, + }; +} +function cidr_cidrMask(ones, bits) { + if (bits !== 8 * IPv4Len && bits !== 8 * IPv6Len) + throw new Error("Invalid CIDR mask"); + if (ones < 0 || ones > bits) + throw new Error("Invalid CIDR mask"); + const l = bits / 8; + const m = new Uint8Array(l); + for (let i = 0; i < l; i++) { + if (ones >= 8) { + m[i] = 0xff; + ones -= 8; + continue; + } + m[i] = 255 - (0xff >> ones); + ones = 0; + } + return m; } +//# sourceMappingURL=cidr.js.map +;// CONCATENATED MODULE: ./node_modules/@chainsafe/netmask/dist/src/ipnet.js -const peer_id_node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/index.js +class ipnet_IpNet { + /** + * + * @param ipOrCidr either network ip or full cidr address + * @param mask in case ipOrCidr is network this can be either mask in decimal format or as ip address + */ + constructor(ipOrCidr, mask) { + if (mask == null) { + ({ network: this.network, mask: this.mask } = parseCidr(ipOrCidr)); + } + else { + const ipResult = parseIP(ipOrCidr); + if (ipResult == null) { + throw new Error("Failed to parse network"); + } + mask = String(mask); + const m = parseInt(mask, 10); + if (Number.isNaN(m) || + String(m).length !== mask.length || + m < 0 || + m > ipResult.length * 8) { + const maskResult = parseIP(mask); + if (maskResult == null) { + throw new Error("Failed to parse mask"); + } + this.mask = maskResult; + } + else { + this.mask = cidrMask(m, 8 * ipResult.length); + } + this.network = maskIp(ipResult, this.mask); + } + } + /** + * Checks if netmask contains ip address + * @param ip + * @returns + */ + contains(ip) { + return containsIp({ network: this.network, mask: this.mask }, ip); + } + /**Serializes back to string format */ + toString() { + const l = simpleMaskLength(this.mask); + const mask = l !== -1 ? String(l) : maskToHex(this.mask); + return ipToString(this.network) + "/" + mask; + } +} +//# sourceMappingURL=ipnet.js.map +;// CONCATENATED MODULE: ./node_modules/@chainsafe/netmask/dist/src/index.js -// This way TS will also expose all the types from module +/** + * Checks if cidr block contains ip address + * @param cidr ipv4 or ipv6 formatted cidr . Example 198.51.100.14/24 or 2001:db8::/48 + * @param ip ipv4 or ipv6 address Example 198.51.100.14 or 2001:db8:: + * + */ +function cidrContains(cidr, ip) { + const ipnet = new IpNet(cidr); + return ipnet.contains(ip); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/node_modules/uint8arrays/dist/src/from-string.js -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/basics.js -// @ts-check +/** + * Create a `Uint8Array` from the passed string + * + * Supports `utf8`, `utf-8`, `hex`, and any encoding supported by the multiformats module. + * + * Also `ascii` which is similar to node's 'binary' encoding. + */ +function from_string_fromString(string, encoding = 'utf8') { + const base = util_bases[encoding]; + if (base == null) { + throw new Error(`Unsupported encoding "${encoding}"`); + } + if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) { + return as_uint8array_asUint8Array(globalThis.Buffer.from(string, 'utf-8')); + } + // add multibase prefix + return base.decoder.decode(`${base.prefix}${string}`); // eslint-disable-line @typescript-eslint/restrict-template-expressions +} +//# sourceMappingURL=from-string.js.map +;// CONCATENATED MODULE: external "node:net" +const external_node_net_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:net"); +;// CONCATENATED MODULE: ./node_modules/@chainsafe/is-ip/lib/is-ip.node.js +/** Check if `input` is IPv4 or IPv6. */ +function isIP(input) { + return Boolean((0,external_node_net_namespaceObject.isIP)(input)); +} +//# sourceMappingURL=is-ip.node.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/dist/src/ip.js +const isV4 = external_node_net_namespaceObject.isIPv4; +const isV6 = external_node_net_namespaceObject.isIPv6; +// Copied from https://github.com/indutny/node-ip/blob/master/lib/ip.js#L7 +// but with buf/offset args removed because we don't use them +const ip_toBytes = function (ip) { + let offset = 0; + ip = ip.toString().trim(); + if (isV4(ip)) { + const bytes = new Uint8Array(offset + 4); + ip.split(/\./g).forEach((byte) => { + bytes[offset++] = parseInt(byte, 10) & 0xff; + }); + return bytes; + } + if (isV6(ip)) { + const sections = ip.split(':', 8); + let i; + for (i = 0; i < sections.length; i++) { + const isv4 = isV4(sections[i]); + let v4Buffer; + if (isv4) { + v4Buffer = ip_toBytes(sections[i]); + sections[i] = to_string_toString(v4Buffer.slice(0, 2), 'base16'); + } + if (v4Buffer != null && ++i < 8) { + sections.splice(i, 0, to_string_toString(v4Buffer.slice(2, 4), 'base16')); + } + } + if (sections[0] === '') { + while (sections.length < 8) + sections.unshift('0'); + } + else if (sections[sections.length - 1] === '') { + while (sections.length < 8) + sections.push('0'); + } + else if (sections.length < 8) { + for (i = 0; i < sections.length && sections[i] !== ''; i++) + ; + const argv = [i, 1]; + for (i = 9 - sections.length; i > 0; i--) { + argv.push('0'); + } + sections.splice.apply(sections, argv); + } + const bytes = new Uint8Array(offset + 16); + for (i = 0; i < sections.length; i++) { + const word = parseInt(sections[i], 16); + bytes[offset++] = (word >> 8) & 0xff; + bytes[offset++] = word & 0xff; + } + return bytes; + } + throw new Error('invalid ip address'); +}; +// Copied from https://github.com/indutny/node-ip/blob/master/lib/ip.js#L63 +const ip_toString = function (buf, offset = 0, length) { + offset = ~~offset; + length = length ?? (buf.length - offset); + const view = new DataView(buf.buffer); + if (length === 4) { + const result = []; + // IPv4 + for (let i = 0; i < length; i++) { + result.push(buf[offset + i]); + } + return result.join('.'); + } + if (length === 16) { + const result = []; + // IPv6 + for (let i = 0; i < length; i += 2) { + result.push(view.getUint16(offset + i).toString(16)); + } + return result.join(':') + .replace(/(^|:)0(:0)*:0(:|$)/, '$1::$3') + .replace(/:{3,4}/, '::'); + } + return ''; +}; +//# sourceMappingURL=ip.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/dist/src/protocols-table.js +const V = -1; +const names = {}; +const codes = {}; +const table = [ + [4, 32, 'ip4'], + [6, 16, 'tcp'], + [33, 16, 'dccp'], + [41, 128, 'ip6'], + [42, V, 'ip6zone'], + [43, 8, 'ipcidr'], + [53, V, 'dns', true], + [54, V, 'dns4', true], + [55, V, 'dns6', true], + [56, V, 'dnsaddr', true], + [132, 16, 'sctp'], + [273, 16, 'udp'], + [275, 0, 'p2p-webrtc-star'], + [276, 0, 'p2p-webrtc-direct'], + [277, 0, 'p2p-stardust'], + [280, 0, 'webrtc-direct'], + [281, 0, 'webrtc'], + [290, 0, 'p2p-circuit'], + [301, 0, 'udt'], + [302, 0, 'utp'], + [400, V, 'unix', false, true], + // `ipfs` is added before `p2p` for legacy support. + // All text representations will default to `p2p`, but `ipfs` will + // still be supported + [421, V, 'ipfs'], + // `p2p` is the preferred name for 421, and is now the default + [421, V, 'p2p'], + [443, 0, 'https'], + [444, 96, 'onion'], + [445, 296, 'onion3'], + [446, V, 'garlic64'], + [448, 0, 'tls'], + [449, V, 'sni'], + [460, 0, 'quic'], + [461, 0, 'quic-v1'], + [465, 0, 'webtransport'], + [466, V, 'certhash'], + [477, 0, 'ws'], + [478, 0, 'wss'], + [479, 0, 'p2p-websocket-star'], + [480, 0, 'http'], + [777, V, 'memory'] +]; +// populate tables +table.forEach(row => { + const proto = createProtocol(...row); + codes[proto.code] = proto; + names[proto.name] = proto; +}); +function createProtocol(code, size, name, resolvable, path) { + return { + code, + size, + name, + resolvable: Boolean(resolvable), + path: Boolean(path) + }; +} +/** + * For the passed proto string or number, return a {@link Protocol} + * + * @example + * + * ```js + * import { protocol } from '@multiformats/multiaddr' + * + * console.info(protocol(4)) + * // { code: 4, size: 32, name: 'ip4', resolvable: false, path: false } + * ``` + */ +function protocols_table_getProtocol(proto) { + if (typeof proto === 'number') { + if (codes[proto] != null) { + return codes[proto]; + } + throw new Error(`no protocol with code: ${proto}`); + } + else if (typeof proto === 'string') { + if (names[proto] != null) { + return names[proto]; + } + throw new Error(`no protocol with name: ${proto}`); + } + throw new Error(`invalid protocol id type: ${typeof proto}`); +} +//# sourceMappingURL=protocols-table.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/dist/src/convert.js +/** + * @packageDocumentation + * + * Provides methods for converting + */ @@ -230695,35 +152737,414 @@ const peer_id_node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js +const ip4Protocol = protocols_table_getProtocol('ip4'); +const ip6Protocol = protocols_table_getProtocol('ip6'); +const ipcidrProtocol = protocols_table_getProtocol('ipcidr'); +function convert(proto, a) { + if (a instanceof Uint8Array) { + return convertToString(proto, a); + } + else { + return convertToBytes(proto, a); + } +} +/** + * Convert [code,Uint8Array] to string + */ +function convertToString(proto, buf) { + const protocol = protocols_table_getProtocol(proto); + switch (protocol.code) { + case 4: // ipv4 + case 41: // ipv6 + return bytes2ip(buf); + case 42: // ipv6zone + return bytes2str(buf); + case 6: // tcp + case 273: // udp + case 33: // dccp + case 132: // sctp + return bytes2port(buf).toString(); + case 53: // dns + case 54: // dns4 + case 55: // dns6 + case 56: // dnsaddr + case 400: // unix + case 449: // sni + case 777: // memory + return bytes2str(buf); + case 421: // ipfs + return bytes2mh(buf); + case 444: // onion + return bytes2onion(buf); + case 445: // onion3 + return bytes2onion(buf); + case 466: // certhash + return bytes2mb(buf); + default: + return to_string_toString(buf, 'base16'); // no clue. convert to hex + } +} +function convertToBytes(proto, str) { + const protocol = protocols_table_getProtocol(proto); + switch (protocol.code) { + case 4: // ipv4 + return ip2bytes(str); + case 41: // ipv6 + return ip2bytes(str); + case 42: // ipv6zone + return str2bytes(str); + case 6: // tcp + case 273: // udp + case 33: // dccp + case 132: // sctp + return port2bytes(parseInt(str, 10)); + case 53: // dns + case 54: // dns4 + case 55: // dns6 + case 56: // dnsaddr + case 400: // unix + case 449: // sni + case 777: // memory + return str2bytes(str); + case 421: // ipfs + return mh2bytes(str); + case 444: // onion + return onion2bytes(str); + case 445: // onion3 + return onion32bytes(str); + case 466: // certhash + return mb2bytes(str); + default: + return from_string_fromString(str, 'base16'); // no clue. convert from hex + } +} +function convert_convertToIpNet(multiaddr) { + let mask; + let addr; + multiaddr.stringTuples().forEach(([code, value]) => { + if (code === ip4Protocol.code || code === ip6Protocol.code) { + addr = value; + } + if (code === ipcidrProtocol.code) { + mask = value; + } + }); + if (mask == null || addr == null) { + throw new Error('Invalid multiaddr'); + } + return new IpNet(addr, mask); +} +const decoders = Object.values(basics_bases).map((c) => c.decoder); +const anybaseDecoder = (function () { + let acc = decoders[0].or(decoders[1]); + decoders.slice(2).forEach((d) => (acc = acc.or(d))); + return acc; +})(); +function ip2bytes(ipString) { + if (!isIP(ipString)) { + throw new Error('invalid ip address'); + } + return ip_toBytes(ipString); +} +function bytes2ip(ipBuff) { + const ipString = ip_toString(ipBuff, 0, ipBuff.length); + if (ipString == null) { + throw new Error('ipBuff is required'); + } + if (!isIP(ipString)) { + throw new Error('invalid ip address'); + } + return ipString; +} +function port2bytes(port) { + const buf = new ArrayBuffer(2); + const view = new DataView(buf); + view.setUint16(0, port); + return new Uint8Array(buf); +} +function bytes2port(buf) { + const view = new DataView(buf.buffer); + return view.getUint16(buf.byteOffset); +} +function str2bytes(str) { + const buf = from_string_fromString(str); + const size = Uint8Array.from(dist_src_encode(buf.length)); + return concat_concat([size, buf], size.length + buf.length); +} +function bytes2str(buf) { + const size = dist_src_decode(buf); + buf = buf.slice(src_encodingLength(size)); + if (buf.length !== size) { + throw new Error('inconsistent lengths'); + } + return to_string_toString(buf); +} +function mh2bytes(hash) { + let mh; + if (hash[0] === 'Q' || hash[0] === '1') { + mh = dist_src_hashes_digest_decode(dist_src_bases_base58_base58btc.decode(`z${hash}`)).bytes; + } + else { + mh = multiformats_dist_src_cid_CID.parse(hash).multihash.bytes; + } + // the address is a varint prefixed multihash string representation + const size = Uint8Array.from(dist_src_encode(mh.length)); + return concat_concat([size, mh], size.length + mh.length); +} +function mb2bytes(mbstr) { + const mb = anybaseDecoder.decode(mbstr); + const size = Uint8Array.from(dist_src_encode(mb.length)); + return concat_concat([size, mb], size.length + mb.length); +} +function bytes2mb(buf) { + const size = dist_src_decode(buf); + const hash = buf.slice(src_encodingLength(size)); + if (hash.length !== size) { + throw new Error('inconsistent lengths'); + } + return 'u' + to_string_toString(hash, 'base64url'); +} +/** + * Converts bytes to bas58btc string + */ +function bytes2mh(buf) { + const size = dist_src_decode(buf); + const address = buf.slice(src_encodingLength(size)); + if (address.length !== size) { + throw new Error('inconsistent lengths'); + } + return to_string_toString(address, 'base58btc'); +} +function onion2bytes(str) { + const addr = str.split(':'); + if (addr.length !== 2) { + throw new Error(`failed to parse onion addr: ["'${addr.join('", "')}'"]' does not contain a port number`); + } + if (addr[0].length !== 16) { + throw new Error(`failed to parse onion addr: ${addr[0]} not a Tor onion address.`); + } + // onion addresses do not include the multibase prefix, add it before decoding + const buf = dist_src_bases_base32_base32.decode('b' + addr[0]); + // onion port number + const port = parseInt(addr[1], 10); + if (port < 1 || port > 65536) { + throw new Error('Port number is not in range(1, 65536)'); + } + const portBuf = port2bytes(port); + return concat_concat([buf, portBuf], buf.length + portBuf.length); +} +function onion32bytes(str) { + const addr = str.split(':'); + if (addr.length !== 2) { + throw new Error(`failed to parse onion addr: ["'${addr.join('", "')}'"]' does not contain a port number`); + } + if (addr[0].length !== 56) { + throw new Error(`failed to parse onion addr: ${addr[0]} not a Tor onion3 address.`); + } + // onion addresses do not include the multibase prefix, add it before decoding + const buf = dist_src_bases_base32_base32.decode(`b${addr[0]}`); + // onion port number + const port = parseInt(addr[1], 10); + if (port < 1 || port > 65536) { + throw new Error('Port number is not in range(1, 65536)'); + } + const portBuf = port2bytes(port); + return concat_concat([buf, portBuf], buf.length + portBuf.length); +} +function bytes2onion(buf) { + const addrBytes = buf.slice(0, buf.length - 2); + const portBytes = buf.slice(buf.length - 2); + const addr = to_string_toString(addrBytes, 'base32'); + const port = bytes2port(portBytes); + return `${addr}:${port}`; +} +//# sourceMappingURL=convert.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/dist/src/codec.js -const node_modules_multiformats_src_basics_bases = { ...peer_id_node_modules_multiformats_src_bases_identity_namespaceObject, ...node_modules_multiformats_src_bases_base2_namespaceObject, ...node_modules_multiformats_src_bases_base8_namespaceObject, ...node_modules_multiformats_src_bases_base10_namespaceObject, ...node_modules_multiformats_src_bases_base16_namespaceObject, ...peer_id_node_modules_multiformats_src_bases_base32_namespaceObject, ...node_modules_multiformats_src_bases_base36_namespaceObject, ...peer_id_node_modules_multiformats_src_bases_base58_namespaceObject, ...peer_id_node_modules_multiformats_src_bases_base64_namespaceObject, ...node_modules_multiformats_src_bases_base256emoji_namespaceObject } -const node_modules_multiformats_src_basics_hashes = { ...node_modules_multiformats_src_hashes_sha2_namespaceObject, ...node_modules_multiformats_src_hashes_identity_namespaceObject } -const node_modules_multiformats_src_basics_codecs = { raw: node_modules_multiformats_src_codecs_raw_namespaceObject, json: peer_id_node_modules_multiformats_src_codecs_json_namespaceObject } -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/uint8arrays/dist/src/equals.js +function stringToMultiaddrParts(str) { + str = cleanPath(str); + const tuples = []; + const stringTuples = []; + let path = null; + const parts = str.split('/').slice(1); + if (parts.length === 1 && parts[0] === '') { + return { + bytes: new Uint8Array(), + string: '/', + tuples: [], + stringTuples: [], + path: null + }; + } + for (let p = 0; p < parts.length; p++) { + const part = parts[p]; + const proto = protocols_table_getProtocol(part); + if (proto.size === 0) { + tuples.push([proto.code]); + stringTuples.push([proto.code]); + // eslint-disable-next-line no-continue + continue; + } + p++; // advance addr part + if (p >= parts.length) { + throw ParseError('invalid address: ' + str); + } + // if it's a path proto, take the rest + if (proto.path === true) { + // should we need to check each path part to see if it's a proto? + // This would allow for other protocols to be added after a unix path, + // however it would have issues if the path had a protocol name in the path + path = cleanPath(parts.slice(p).join('/')); + tuples.push([proto.code, convertToBytes(proto.code, path)]); + stringTuples.push([proto.code, path]); + break; + } + const bytes = convertToBytes(proto.code, parts[p]); + tuples.push([proto.code, bytes]); + stringTuples.push([proto.code, convertToString(proto.code, bytes)]); + } + return { + string: stringTuplesToString(stringTuples), + bytes: tuplesToBytes(tuples), + tuples, + stringTuples, + path + }; +} +function bytesToMultiaddrParts(bytes) { + const tuples = []; + const stringTuples = []; + let path = null; + let i = 0; + while (i < bytes.length) { + const code = dist_src_decode(bytes, i); + const n = src_encodingLength(code); + const p = protocols_table_getProtocol(code); + const size = sizeForAddr(p, bytes.slice(i + n)); + if (size === 0) { + tuples.push([code]); + stringTuples.push([code]); + i += n; + // eslint-disable-next-line no-continue + continue; + } + const addr = bytes.slice(i + n, i + n + size); + i += (size + n); + if (i > bytes.length) { // did not end _exactly_ at buffer.length + throw ParseError('Invalid address Uint8Array: ' + to_string_toString(bytes, 'base16')); + } + // ok, tuple seems good. + tuples.push([code, addr]); + const stringAddr = convertToString(code, addr); + stringTuples.push([code, stringAddr]); + if (p.path === true) { + // should we need to check each path part to see if it's a proto? + // This would allow for other protocols to be added after a unix path, + // however it would have issues if the path had a protocol name in the path + path = stringAddr; + break; + } + } + return { + bytes: Uint8Array.from(bytes), + string: stringTuplesToString(stringTuples), + tuples, + stringTuples, + path + }; +} /** - * Returns true if the two passed Uint8Arrays have the same content + * [[str name, str addr]... ] -> string */ -function dist_src_equals_equals(a, b) { - if (a === b) { - return true; +function stringTuplesToString(tuples) { + const parts = []; + tuples.map((tup) => { + const proto = protocols_table_getProtocol(tup[0]); + parts.push(proto.name); + if (tup.length > 1 && tup[1] != null) { + parts.push(tup[1]); + } + return null; + }); + return cleanPath(parts.join('/')); +} +/** + * [[int code, Uint8Array ]... ] -> Uint8Array + */ +function tuplesToBytes(tuples) { + return concat_concat(tuples.map((tup) => { + const proto = protocols_table_getProtocol(tup[0]); + let buf = Uint8Array.from(dist_src_encode(proto.code)); + if (tup.length > 1 && tup[1] != null) { + buf = concat_concat([buf, tup[1]]); // add address buffer + } + return buf; + })); +} +/** + * For the passed address, return the serialized size + */ +function sizeForAddr(p, addr) { + if (p.size > 0) { + return p.size / 8; } - if (a.byteLength !== b.byteLength) { - return false; + else if (p.size === 0) { + return 0; } - for (let i = 0; i < a.byteLength; i++) { - if (a[i] !== b[i]) { - return false; + else { + const size = dist_src_decode(addr instanceof Uint8Array ? addr : Uint8Array.from(addr)); + return size + src_encodingLength(size); + } +} +function bytesToTuples(buf) { + const tuples = []; + let i = 0; + while (i < buf.length) { + const code = varint.decode(buf, i); + const n = varint.encodingLength(code); + const p = getProtocol(code); + const size = sizeForAddr(p, buf.slice(i + n)); + if (size === 0) { + tuples.push([code]); + i += n; + // eslint-disable-next-line no-continue + continue; + } + const addr = buf.slice(i + n, i + n + size); + i += (size + n); + if (i > buf.length) { // did not end _exactly_ at buffer.length + throw ParseError('Invalid address Uint8Array: ' + uint8ArrayToString(buf, 'base16')); } + // ok, tuple seems good. + tuples.push([code, addr]); } - return true; + return tuples; } -//# sourceMappingURL=equals.js.map -;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/dist/src/index.js - +function cleanPath(str) { + return '/' + str.trim().split('/').filter((a) => a).join('/'); +} +function ParseError(str) { + return new Error('Error parsing address: ' + str); +} +//# sourceMappingURL=codec.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/dist/src/multiaddr.js +/** + * @packageDocumentation + * + * An implementation of a Multiaddr in JavaScript + * + * @example + * + * ```js + * import { multiaddr } from '@multiformats/multiaddr' + * + * const ma = multiaddr('/ip4/127.0.0.1/tcp/1234') + * ``` + */ @@ -230732,2565 +153153,2967 @@ function dist_src_equals_equals(a, b) { -const dist_src_inspect = Symbol.for('nodejs.util.inspect.custom'); -const baseDecoder = Object - .values(node_modules_multiformats_src_basics_bases) - .map(codec => codec.decoder) - // @ts-expect-error https://github.com/multiformats/js-multiformats/issues/141 - .reduce((acc, curr) => acc.or(curr), node_modules_multiformats_src_basics_bases.identity.decoder); -// these values are from https://github.com/multiformats/multicodec/blob/master/table.csv -const LIBP2P_KEY_CODE = 0x72; -const MARSHALLED_ED225519_PUBLIC_KEY_LENGTH = 36; -const MARSHALLED_SECP256K1_PUBLIC_KEY_LENGTH = 37; -class PeerIdImpl { - type; - multihash; - privateKey; - publicKey; - string; - constructor(init) { - this.type = init.type; - this.multihash = init.multihash; - this.privateKey = init.privateKey; - // mark string cache as non-enumerable - Object.defineProperty(this, 'string', { - enumerable: false, - writable: true - }); - } - get [Symbol.toStringTag]() { - return `PeerId(${this.toString()})`; - } - [dist_src_symbol] = true; - toString() { - if (this.string == null) { - this.string = peer_id_node_modules_multiformats_src_bases_base58_base58btc.encode(this.multihash.bytes).slice(1); +const inspect = Symbol.for('nodejs.util.inspect.custom'); +const symbol = Symbol.for('@multiformats/js-multiaddr/multiaddr'); +const DNS_CODES = [ + protocols_table_getProtocol('dns').code, + protocols_table_getProtocol('dns4').code, + protocols_table_getProtocol('dns6').code, + protocols_table_getProtocol('dnsaddr').code +]; +/** + * Creates a {@link Multiaddr} from a {@link MultiaddrInput} + */ +class Multiaddr { + bytes; + #string; + #tuples; + #stringTuples; + #path; + [symbol] = true; + constructor(addr) { + // default + if (addr == null) { + addr = ''; } - return this.string; - } - // return self-describing String representation - // in default format from RFC 0001: https://github.com/libp2p/specs/pull/209 - toCID() { - return peer_id_node_modules_multiformats_src_cid_CID.createV1(LIBP2P_KEY_CODE, this.multihash); - } - toBytes() { - return this.multihash.bytes; - } - /** - * Returns Multiaddr as a JSON string - */ - toJSON() { - return this.toString(); - } - /** - * Checks the equality of `this` peer against a given PeerId - */ - equals(id) { - if (id instanceof Uint8Array) { - return dist_src_equals_equals(this.multihash.bytes, id); + let parts; + if (addr instanceof Uint8Array) { + parts = bytesToMultiaddrParts(addr); } - else if (typeof id === 'string') { - return peerIdFromString(id).equals(this); + else if (typeof addr === 'string') { + if (addr.length > 0 && addr.charAt(0) !== '/') { + throw new Error(`multiaddr "${addr}" must start with a "/"`); + } + parts = stringToMultiaddrParts(addr); } - else if (id?.multihash?.bytes != null) { - return dist_src_equals_equals(this.multihash.bytes, id.multihash.bytes); + else if (isMultiaddr(addr)) { // Multiaddr + parts = bytesToMultiaddrParts(addr.bytes); } else { - throw new Error('not valid Id'); + throw new Error('addr must be a string, Buffer, or another Multiaddr'); } + this.bytes = parts.bytes; + this.#string = parts.string; + this.#tuples = parts.tuples; + this.#stringTuples = parts.stringTuples; + this.#path = parts.path; } - /** - * Returns PeerId as a human-readable string - * https://nodejs.org/api/util.html#utilinspectcustom - * - * @example - * ```js - * import { peerIdFromString } from '@libp2p/peer-id' - * - * console.info(peerIdFromString('QmFoo')) - * // 'PeerId(QmFoo)' - * ``` - */ - [dist_src_inspect]() { - return `PeerId(${this.toString()})`; - } -} -class RSAPeerIdImpl extends PeerIdImpl { - type = 'RSA'; - publicKey; - constructor(init) { - super({ ...init, type: 'RSA' }); - this.publicKey = init.publicKey; - } -} -class Ed25519PeerIdImpl extends PeerIdImpl { - type = 'Ed25519'; - publicKey; - constructor(init) { - super({ ...init, type: 'Ed25519' }); - this.publicKey = init.multihash.digest; + toString() { + return this.#string; } -} -class Secp256k1PeerIdImpl extends PeerIdImpl { - type = 'secp256k1'; - publicKey; - constructor(init) { - super({ ...init, type: 'secp256k1' }); - this.publicKey = init.multihash.digest; + toJSON() { + return this.toString(); } -} -function createPeerId(init) { - if (init.type === 'RSA') { - return new RSAPeerIdImpl(init); + toOptions() { + let family; + let transport; + let host; + let port; + let zone = ''; + const tcp = protocols_table_getProtocol('tcp'); + const udp = protocols_table_getProtocol('udp'); + const ip4 = protocols_table_getProtocol('ip4'); + const ip6 = protocols_table_getProtocol('ip6'); + const dns6 = protocols_table_getProtocol('dns6'); + const ip6zone = protocols_table_getProtocol('ip6zone'); + for (const [code, value] of this.stringTuples()) { + if (code === ip6zone.code) { + zone = `%${value ?? ''}`; + } + // default to https when protocol & port are omitted from DNS addrs + if (DNS_CODES.includes(code)) { + transport = tcp.name; + port = 443; + host = `${value ?? ''}${zone}`; + family = code === dns6.code ? 6 : 4; + } + if (code === tcp.code || code === udp.code) { + transport = protocols_table_getProtocol(code).name; + port = parseInt(value ?? ''); + } + if (code === ip4.code || code === ip6.code) { + transport = protocols_table_getProtocol(code).name; + host = `${value ?? ''}${zone}`; + family = code === ip6.code ? 6 : 4; + } + } + if (family == null || transport == null || host == null || port == null) { + throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".'); + } + const opts = { + family, + host, + transport, + port + }; + return opts; } - if (init.type === 'Ed25519') { - return new Ed25519PeerIdImpl(init); + protos() { + return this.#tuples.map(([code]) => Object.assign({}, protocols_table_getProtocol(code))); } - if (init.type === 'secp256k1') { - return new Secp256k1PeerIdImpl(init); + protoCodes() { + return this.#tuples.map(([code]) => code); } - throw new CodeError('Type must be "RSA", "Ed25519" or "secp256k1"', 'ERR_INVALID_PARAMETERS'); -} -function peerIdFromPeerId(other) { - if (other.type === 'RSA') { - return new RSAPeerIdImpl(other); + protoNames() { + return this.#tuples.map(([code]) => protocols_table_getProtocol(code).name); } - if (other.type === 'Ed25519') { - return new Ed25519PeerIdImpl(other); + tuples() { + return this.#tuples; } - if (other.type === 'secp256k1') { - return new Secp256k1PeerIdImpl(other); + stringTuples() { + return this.#stringTuples; } - throw new CodeError('Not a PeerId', 'ERR_INVALID_PARAMETERS'); -} -function peerIdFromString(str, decoder) { - decoder = decoder ?? baseDecoder; - if (str.charAt(0) === '1' || str.charAt(0) === 'Q') { - // identity hash ed25519/secp256k1 key or sha2-256 hash of - // rsa public key - base58btc encoded either way - const multihash = peer_id_node_modules_multiformats_src_hashes_digest_decode(peer_id_node_modules_multiformats_src_bases_base58_base58btc.decode(`z${str}`)); - if (str.startsWith('12D')) { - return new Ed25519PeerIdImpl({ multihash }); - } - else if (str.startsWith('16U')) { - return new Secp256k1PeerIdImpl({ multihash }); - } - else { - return new RSAPeerIdImpl({ multihash }); + encapsulate(addr) { + addr = new Multiaddr(addr); + return new Multiaddr(this.toString() + addr.toString()); + } + decapsulate(addr) { + const addrString = addr.toString(); + const s = this.toString(); + const i = s.lastIndexOf(addrString); + if (i < 0) { + throw new Error(`Address ${this.toString()} does not contain subaddress: ${addr.toString()}`); } + return new Multiaddr(s.slice(0, i)); } - return peerIdFromBytes(baseDecoder.decode(str)); -} -function peerIdFromBytes(buf) { - try { - const multihash = peer_id_node_modules_multiformats_src_hashes_digest_decode(buf); - if (multihash.code === node_modules_multiformats_src_hashes_identity_identity.code) { - if (multihash.digest.length === MARSHALLED_ED225519_PUBLIC_KEY_LENGTH) { - return new Ed25519PeerIdImpl({ multihash }); + decapsulateCode(code) { + const tuples = this.tuples(); + for (let i = tuples.length - 1; i >= 0; i--) { + if (tuples[i][0] === code) { + return new Multiaddr(tuplesToBytes(tuples.slice(0, i))); } - else if (multihash.digest.length === MARSHALLED_SECP256K1_PUBLIC_KEY_LENGTH) { - return new Secp256k1PeerIdImpl({ multihash }); + } + return this; + } + getPeerId() { + try { + let tuples = []; + this.stringTuples().forEach(([code, name]) => { + if (code === names.p2p.code) { + tuples.push([code, name]); + } + // if this is a p2p-circuit address, return the target peer id if present + // not the peer id of the relay + if (code === names["p2p-circuit"].code) { + tuples = []; + } + }); + // Get the last ipfs tuple ['p2p', 'peerid string'] + const tuple = tuples.pop(); + if (tuple?.[1] != null) { + const peerIdStr = tuple[1]; + // peer id is base58btc encoded string but not multibase encoded so add the `z` + // prefix so we can validate that it is correctly encoded + if (peerIdStr[0] === 'Q' || peerIdStr[0] === '1') { + return to_string_toString(dist_src_bases_base58_base58btc.decode(`z${peerIdStr}`), 'base58btc'); + } + // try to parse peer id as CID + return to_string_toString(multiformats_dist_src_cid_CID.parse(peerIdStr).multihash.bytes, 'base58btc'); } + return null; } - if (multihash.code === node_modules_multiformats_src_hashes_sha2_sha256.code) { - return new RSAPeerIdImpl({ multihash }); + catch (e) { + return null; } } - catch { - return peerIdFromCID(peer_id_node_modules_multiformats_src_cid_CID.decode(buf)); - } - throw new Error('Supplied PeerID CID is invalid'); -} -function peerIdFromCID(cid) { - if (cid == null || cid.multihash == null || cid.version == null || (cid.version === 1 && cid.code !== LIBP2P_KEY_CODE)) { - throw new Error('Supplied PeerID CID is invalid'); + getPath() { + return this.#path; } - const multihash = cid.multihash; - if (multihash.code === node_modules_multiformats_src_hashes_sha2_sha256.code) { - return new RSAPeerIdImpl({ multihash: cid.multihash }); + equals(addr) { + return equals_equals(this.bytes, addr.bytes); } - else if (multihash.code === node_modules_multiformats_src_hashes_identity_identity.code) { - if (multihash.digest.length === MARSHALLED_ED225519_PUBLIC_KEY_LENGTH) { - return new Ed25519PeerIdImpl({ multihash: cid.multihash }); + async resolve(options) { + const resolvableProto = this.protos().find((p) => p.resolvable); + // Multiaddr is not resolvable? + if (resolvableProto == null) { + return [this]; } - else if (multihash.digest.length === MARSHALLED_SECP256K1_PUBLIC_KEY_LENGTH) { - return new Secp256k1PeerIdImpl({ multihash: cid.multihash }); + const resolver = resolvers.get(resolvableProto.name); + if (resolver == null) { + throw new errors_CodeError(`no available resolver for ${resolvableProto.name}`, 'ERR_NO_AVAILABLE_RESOLVER'); } + const addresses = await resolver(this, options); + return addresses.map((a) => new Multiaddr(a)); } - throw new Error('Supplied PeerID CID is invalid'); -} -/** - * @param publicKey - A marshalled public key - * @param privateKey - A marshalled private key - */ -async function peerIdFromKeys(publicKey, privateKey) { - if (publicKey.length === MARSHALLED_ED225519_PUBLIC_KEY_LENGTH) { - return new Ed25519PeerIdImpl({ multihash: Digest.create(identity.code, publicKey), privateKey }); + nodeAddress() { + const options = this.toOptions(); + if (options.transport !== 'tcp' && options.transport !== 'udp') { + throw new Error(`multiaddr must have a valid format - no protocol with name: "${options.transport}". Must have a valid transport protocol: "{tcp, udp}"`); + } + return { + family: options.family, + address: options.host, + port: options.port + }; } - if (publicKey.length === MARSHALLED_SECP256K1_PUBLIC_KEY_LENGTH) { - return new Secp256k1PeerIdImpl({ multihash: Digest.create(identity.code, publicKey), privateKey }); + isThinWaistAddress(addr) { + const protos = (addr ?? this).protos(); + if (protos.length !== 2) { + return false; + } + if (protos[0].code !== 4 && protos[0].code !== 41) { + return false; + } + if (protos[1].code !== 6 && protos[1].code !== 273) { + return false; + } + return true; + } + /** + * Returns Multiaddr as a human-readable string + * https://nodejs.org/api/util.html#utilinspectcustom + * + * @example + * ```js + * import { multiaddr } from '@multiformats/multiaddr' + * + * console.info(multiaddr('/ip4/127.0.0.1/tcp/4001')) + * // 'Multiaddr(/ip4/127.0.0.1/tcp/4001)' + * ``` + */ + [inspect]() { + return `Multiaddr(${this.#string})`; } - return new RSAPeerIdImpl({ multihash: await sha256.digest(publicKey), publicKey, privateKey }); -} -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/bitswap/stat.js - - - - - -const createStat = configure(api => { - /** - * @type {import('../types').BitswapAPI["stat"]} - */ - async function stat (options = {}) { - const res = await api.post('bitswap/stat', { - searchParams: toUrlSearchParams(options), - signal: options.signal, - headers: options.headers - }) - - return toCoreInterface(await res.json()) - } - return stat -}) - -/** - * @param {any} res - */ -function toCoreInterface (res) { - return { - provideBufLen: res.ProvideBufLen, - wantlist: (res.Wantlist || []).map((/** @type {{ '/': string }} */ k) => node_modules_multiformats_src_cid_CID.parse(k['/'])), - peers: (res.Peers || []).map((/** @type {string} */ str) => peerIdFromString(str)), - blocksReceived: BigInt(res.BlocksReceived), - dataReceived: BigInt(res.DataReceived), - blocksSent: BigInt(res.BlocksSent), - dataSent: BigInt(res.DataSent), - dupBlksReceived: BigInt(res.DupBlksReceived), - dupDataReceived: BigInt(res.DupDataReceived) - } } - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/bitswap/index.js - - +//# sourceMappingURL=multiaddr.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/dist/src/filter/multiaddr-filter.js /** - * @param {import('../types').Options} config + * A utility class to determine if a Multiaddr contains another + * multiaddr. + * + * This can be used with ipcidr ranges to determine if a given + * multiaddr is in a ipcidr range. + * + * @example + * + * ```js + * import { multiaddr, MultiaddrFilter } from '@multiformats/multiaddr' + * + * const range = multiaddr('/ip4/192.168.10.10/ipcidr/24') + * const filter = new MultiaddrFilter(range) + * + * const input = multiaddr('/ip4/192.168.10.2/udp/60') + * console.info(filter.contains(input)) // true + * ``` */ -function createBitswap (config) { - return { - /** - * TODO: https://github.com/ipfs/js-kubo-rpc-client/issues/99 - */ - wantlist: createWantlist(config), - wantlistForPeer: createWantlistForPeer(config), - stat: createStat(config) - } +class MultiaddrFilter { + multiaddr; + netmask; + constructor(input) { + this.multiaddr = multiaddr(input); + this.netmask = convertToIpNet(this.multiaddr); + } + contains(input) { + if (input == null) + return false; + const m = multiaddr(input); + let ip; + for (const [code, value] of m.stringTuples()) { + if (code === 4 || code === 41) { + ip = value; + break; + } + } + if (ip === undefined) + return false; + return this.netmask.contains(ip); + } } - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/block/get.js - - - -const createGet = configure(api => { - /** - * @type {import('../types').BlockAPI["get"]} - */ - async function get (cid, options = {}) { - const res = await api.post('block/get', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: cid.toString(), - ...options - }), - headers: options.headers - }) - - return new Uint8Array(await res.arrayBuffer()) - } - return get -}) - -;// CONCATENATED MODULE: ./node_modules/browser-readablestream-to-it/dist/src/index.js +//# sourceMappingURL=multiaddr-filter.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr/dist/src/index.js /** * @packageDocumentation * - * Allows treating a browser readable stream as an async iterator. + * A standard way to represent addresses that + * + * - support any standard network protocol + * - are self-describing + * - have a binary packed format + * - have a nice string representation + * - encapsulate well * * @example * - * ```javascript - * import toIt from 'browser-readablestream-to-it' - * import all from 'it-all' + * ```js + * import { multiaddr } from '@multiformats/multiaddr' + * const addr = multiaddr("/ip4/127.0.0.1/udp/1234") + * // Multiaddr(/ip4/127.0.0.1/udp/1234) * - * const content = [0, 1, 2, 3, 4] + * const addr = multiaddr("/ip4/127.0.0.1/udp/1234") + * // Multiaddr(/ip4/127.0.0.1/udp/1234) * - * const stream = new ReadableStream({ - * start(controller) { - * for (let i = 0; i < content.length; i++) { - * controller.enqueue(content[i]) - * } + * addr.bytes + * // * - * controller.close() - * } - * }) + * addr.toString() + * // '/ip4/127.0.0.1/udp/1234' * - * const arr = await all(toIt(stream)) + * addr.protos() + * // [ + * // {code: 4, name: 'ip4', size: 32}, + * // {code: 273, name: 'udp', size: 16} + * // ] * - * console.info(arr) // 0, 1, 2, 3, 4 + * // gives you an object that is friendly with what Node.js core modules expect for addresses + * addr.nodeAddress() + * // { + * // family: 4, + * // port: 1234, + * // address: "127.0.0.1" + * // } + * + * addr.encapsulate('/sctp/5678') + * // Multiaddr(/ip4/127.0.0.1/udp/1234/sctp/5678) * ``` * - * ## preventCancel + * ## Resolvers * - * By default a readable stream will have [.cancel](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/cancel) called on it once it has ended or - * reading has stopped prematurely. + * `multiaddr` allows multiaddrs to be resolved when appropriate resolvers are provided. This module already has resolvers available, but you can also create your own. Resolvers should always be set in the same module that is calling `multiaddr.resolve()` to avoid conflicts if multiple versions of `multiaddr` are in your dependency tree. * - * To prevent this behaviour, pass `preventCancel: true` as an option: + * To provide multiaddr resolvers you can do: * - * ```javascript - * const arr = await all(toIt(stream, { preventCancel: true })) + * ```js + * import { resolvers } from '@multiformats/multiaddr' * - * console.info(arr) // 0, 1, 2, 3, 4 + * resolvers.set('dnsaddr', resolvers.dnsaddrResolver) * ``` + * + * The available resolvers are: + * + * | Name | type | Description | + * | ----------------- | --------- | ----------------------------------- | + * | `dnsaddrResolver` | `dnsaddr` | dnsaddr resolution with TXT Records | + * + * A resolver receives a `Multiaddr` as a parameter and returns a `Promise>`. */ + + /** - * Turns a browser readable stream into an async iterable. Async iteration over - * returned iterable will lock give stream, preventing any other consumer from - * acquiring a reader. The lock will be released if iteration loop is broken. To - * prevent stream cancelling optional `{ preventCancel: true }` could be passed - * as a second argument. + * All configured {@link Resolver}s */ -async function* browserReadableStreamToIt(stream, options = {}) { - const reader = stream.getReader(); - try { - while (true) { - const result = await reader.read(); - if (result.done) { - return; - } - yield result.value; - } - } - finally { - if (options.preventCancel !== true) { - await reader.cancel(); - } - reader.releaseLock(); - } -} -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/blob-to-it/dist/src/index.js +const resolvers = new Map(); + /** - * @packageDocumentation - * - * Allows reading Blob contents as an async iterator. + * Creates a Multiaddr from a node-friendly address object * * @example + * ```js + * import { fromNodeAddress } from '@multiformats/multiaddr' * - * ```javascript - * import toIt from 'blob-to-it' - * import all from 'it-all' - * - * const content = [ Uint8Array.from([0, 1, 2, 3, 4]) ] - * const blob = new Blob(content) - * const arr = await all(toIt(blob)) - * - * console.info(arr) // [ [ 0, 1, 2, 3, 4 ] ] + * fromNodeAddress({address: '127.0.0.1', port: '4001'}, 'tcp') + * // Multiaddr(/ip4/127.0.0.1/tcp/4001) * ``` */ - -function blobToIt(blob) { - if (typeof blob.stream === 'function') { - return browserReadableStreamToIt(blob.stream()); +function fromNodeAddress(addr, transport) { + if (addr == null) { + throw new Error('requires node address object'); } - // firefox < 69 does not support blob.stream() - // @ts-expect-error - response.body is optional, but in practice it's a stream. - return browserReadableStreamToIt(new Response(blob).body); -} -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/it-peekable/dist/src/index.js -function peekableIterator(iterable) { - // @ts-expect-error - const [iterator, symbol] = iterable[Symbol.asyncIterator] != null - // @ts-expect-error - ? [iterable[Symbol.asyncIterator](), Symbol.asyncIterator] - // @ts-expect-error - : [iterable[Symbol.iterator](), Symbol.iterator]; - const queue = []; - // @ts-expect-error - return { - peek: () => { - return iterator.next(); - }, - push: (value) => { - queue.push(value); - }, - next: () => { - if (queue.length > 0) { - return { - done: false, - value: queue.shift() - }; + if (transport == null) { + throw new Error('requires transport protocol'); + } + let ip; + let host = addr.address; + switch (addr.family) { + case 4: + ip = 'ip4'; + break; + case 6: + ip = 'ip6'; + if (host.includes('%')) { + const parts = host.split('%'); + if (parts.length !== 2) { + throw Error('Multiple ip6 zones in multiaddr'); + } + host = parts[0]; + const zone = parts[1]; + ip = `/ip6zone/${zone}/ip6`; } - return iterator.next(); - }, - [symbol]() { - return this; - } - }; -} -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/it-all/dist/src/index.js -/** - * Collects all values from an (async) iterable and returns them as an array - */ -async function src_all(source) { - const arr = []; - for await (const entry of source) { - arr.push(entry); + break; + default: + throw Error('Invalid addr family, should be 4 or 6.'); } - return arr; + return new MultiaddrClass('/' + [ip, host, transport, addr.port].join('/')); } -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/it-map/dist/src/index.js /** - * Takes an (async) iterable and returns one with each item mapped by the passed - * function + * Returns if something is a {@link Multiaddr} that is a resolvable name + * + * @example + * + * ```js + * import { isName, multiaddr } from '@multiformats/multiaddr' + * + * isName(multiaddr('/ip4/127.0.0.1')) + * // false + * isName(multiaddr('/dns/ipfs.io')) + * // true + * ``` */ -async function* map(source, func) { - for await (const val of source) { - yield func(val); +function isName(addr) { + if (!isMultiaddr(addr)) { + return false; } + // if a part of the multiaddr is resolvable, then return true + return addr.protos().some((proto) => proto.resolvable); } -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/files/utils.js -/** - * @param {any} obj - * @returns {obj is ArrayBufferView|ArrayBuffer} - */ -function isBytes (obj) { - return ArrayBuffer.isView(obj) || obj instanceof ArrayBuffer -} - /** - * @param {any} obj - * @returns {obj is globalThis.Blob} + * Check if object is a {@link Multiaddr} instance + * + * @example + * + * ```js + * import { isMultiaddr, multiaddr } from '@multiformats/multiaddr' + * + * isMultiaddr(5) + * // false + * isMultiaddr(multiaddr('/ip4/127.0.0.1')) + * // true + * ``` */ -function isBlob (obj) { - return obj.constructor && - (obj.constructor.name === 'Blob' || obj.constructor.name === 'File') && - typeof obj.stream === 'function' +function isMultiaddr(value) { + return Boolean(value?.[symbol]); } - /** - * An object with a path or content property + * A function that takes a {@link MultiaddrInput} and returns a {@link Multiaddr} * - * @param {any} obj - * @returns {obj is import('ipfs-core-types/src/utils').ImportCandidate} + * @example + * ```js + * import { multiaddr } from '@libp2p/multiaddr' + * + * multiaddr('/ip4/127.0.0.1/tcp/4001') + * // Multiaddr(/ip4/127.0.0.1/tcp/4001) + * ``` + * + * @param {MultiaddrInput} [addr] - If String or Uint8Array, needs to adhere to the address format of a [multiaddr](https://github.com/multiformats/multiaddr#string-format) */ -function isFileObject (obj) { - return typeof obj === 'object' && (obj.path || obj.content) +function src_multiaddr(addr) { + return new Multiaddr(addr); } +//# sourceMappingURL=index.js.map +// EXTERNAL MODULE: ./node_modules/ipfs-utils/src/env.js +var env = __nccwpck_require__(45221); +;// CONCATENATED MODULE: ./node_modules/parse-duration/index.mjs +let durationRE = /(-?(?:\d+\.?\d*|\d*\.?\d+)(?:e[-+]?\d+)?)\s*([\p{L}]*)/uig + + /** - * @param {any} value - * @returns {value is ReadableStream} + * conversion ratios */ -const isReadableStream = (value) => - value && typeof value.getReader === 'function' -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/files/normalise-content.js +parse_duration_parse.nanosecond = +parse_duration_parse.ns = 1 / 1e6 +parse_duration_parse['µs'] = +parse_duration_parse['μs'] = +parse_duration_parse.us = +parse_duration_parse.microsecond = 1 / 1e3 +parse_duration_parse.millisecond = +parse_duration_parse.ms = +parse_duration_parse[''] = 1 +parse_duration_parse.second = +parse_duration_parse.sec = +parse_duration_parse.s = parse_duration_parse.ms * 1000 +parse_duration_parse.minute = +parse_duration_parse.min = +parse_duration_parse.m = parse_duration_parse.s * 60 +parse_duration_parse.hour = +parse_duration_parse.hr = +parse_duration_parse.h = parse_duration_parse.m * 60 +parse_duration_parse.day = +parse_duration_parse.d = parse_duration_parse.h * 24 +parse_duration_parse.week = +parse_duration_parse.wk = +parse_duration_parse.w = parse_duration_parse.d * 7 +parse_duration_parse.month = +parse_duration_parse.b = +parse_duration_parse.d * (365.25 / 12) -/** - * @template T - * @param {T} thing - */ -async function * toAsyncIterable (thing) { - yield thing -} +parse_duration_parse.year = +parse_duration_parse.yr = +parse_duration_parse.y = parse_duration_parse.d * 365.25 /** - * @param {import('ipfs-core-types/src/utils').ToContent} input + * convert `str` to ms + * + * @param {String} str + * @param {String} format + * @return {Number} */ -async function normaliseContent (input) { - // Bytes | String - if (isBytes(input)) { - return toAsyncIterable(normalise_content_toBytes(input)) - } - if (typeof input === 'string' || input instanceof String) { - return toAsyncIterable(normalise_content_toBytes(input.toString())) - } +function parse_duration_parse(str='', format='ms'){ + var result = null + // ignore commas/placeholders + str = (str+'').replace(/(\d)[,_](\d)/g, '$1$2') + var isNegative = str[0] === '-'; + str.replace(durationRE, function(_, n, units){ + units = unitRatio(units) + if (units) result = (result || 0) + Math.abs(parseFloat(n, 10)) * units + }) - // Blob - if (isBlob(input)) { - return blobToIt(input) - } + return result && ((result / (unitRatio(format) || 1)) * (isNegative ? -1 : 1)) +} - // Browser stream - if (isReadableStream(input)) { - input = browserReadableStreamToIt(input) - } +function unitRatio(str) { + return parse_duration_parse[str] || parse_duration_parse[str.toLowerCase().replace(/s$/, '')] +} - // (Async)Iterator - if (Symbol.iterator in input || Symbol.asyncIterator in input) { - /** @type {any} peekable */ - const peekable = peekableIterator(input) +/* harmony default export */ const parse_duration = (parse_duration_parse); - /** @type {any} value */ - const { value, done } = await peekable.peek() +// EXTERNAL MODULE: ./node_modules/debug/src/index.js +var debug_src = __nccwpck_require__(15057); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/@libp2p/logger/dist/src/index.js - if (done) { - // make sure empty iterators result in empty files - return toAsyncIterable(new Uint8Array(0)) - } - peekable.push(value) - // (Async)Iterable - if (Number.isInteger(value)) { - return toAsyncIterable(Uint8Array.from(await src_all(peekable))) - } - // (Async)Iterable - if (isBytes(value) || typeof value === 'string' || value instanceof String) { - return map(peekable, normalise_content_toBytes) +// Add a formatter for converting to a base58 string +debug_src.formatters.b = (v) => { + return v == null ? 'undefined' : node_modules_multiformats_src_bases_base58_base58btc.baseEncode(v); +}; +// Add a formatter for converting to a base32 string +debug_src.formatters.t = (v) => { + return v == null ? 'undefined' : node_modules_multiformats_src_bases_base32_base32.baseEncode(v); +}; +// Add a formatter for converting to a base64 string +debug_src.formatters.m = (v) => { + return v == null ? 'undefined' : bases_base64_base64.baseEncode(v); +}; +// Add a formatter for stringifying peer ids +debug_src.formatters.p = (v) => { + return v == null ? 'undefined' : v.toString(); +}; +// Add a formatter for stringifying CIDs +debug_src.formatters.c = (v) => { + return v == null ? 'undefined' : v.toString(); +}; +// Add a formatter for stringifying Datastore keys +debug_src.formatters.k = (v) => { + return v == null ? 'undefined' : v.toString(); +}; +// Add a formatter for stringifying Multiaddrs +debug_src.formatters.a = (v) => { + return v == null ? 'undefined' : v.toString(); +}; +function createDisabledLogger(namespace) { + const logger = () => { }; + logger.enabled = false; + logger.color = ''; + logger.diff = 0; + logger.log = () => { }; + logger.namespace = namespace; + logger.destroy = () => true; + logger.extend = () => logger; + return logger; +} +function logger(name) { + // trace logging is a no-op by default + let trace = createDisabledLogger(`${name}:trace`); + // look at all the debug names and see if trace logging has explicitly been enabled + if (debug_src.enabled(`${name}:trace`) && debug_src.names.map(r => r.toString()).find(n => n.includes(':trace')) != null) { + trace = debug_src(`${name}:trace`); } - } - - throw err_code(new Error(`Unexpected input: ${input}`), 'ERR_UNEXPECTED_INPUT') + return Object.assign(debug_src(name), { + error: debug_src(`${name}:error`), + trace + }); } - +function disable() { + debug.disable(); +} +function enable(namespaces) { + debug.enable(namespaces); +} +function enabled(namespaces) { + return debug.enabled(namespaces); +} +//# sourceMappingURL=index.js.map +// EXTERNAL MODULE: ./node_modules/ipfs-utils/src/http.js +var http = __nccwpck_require__(36264); +// EXTERNAL MODULE: ./node_modules/merge-options/index.js +var merge_options = __nccwpck_require__(70395); +;// CONCATENATED MODULE: ./node_modules/merge-options/index.mjs /** - * @param {ArrayBuffer | ArrayBufferView | string | InstanceType | number[]} chunk + * Thin ESM wrapper for CJS named exports. + * + * Ref: https://redfin.engineering/node-modules-at-war-why-commonjs-and-es-modules-cant-get-along-9617135eeca1 */ -function normalise_content_toBytes (chunk) { - if (chunk instanceof Uint8Array) { - return chunk - } - if (ArrayBuffer.isView(chunk)) { - return new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength) - } - if (chunk instanceof ArrayBuffer) { - return new Uint8Array(chunk) - } +/* harmony default export */ const node_modules_merge_options = (merge_options); - if (Array.isArray(chunk)) { - return Uint8Array.from(chunk) +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/vendor/base-x.js +// base-x encoding / decoding +// Copyright (c) 2018 base-x contributors +// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) +// Distributed under the MIT software license, see the accompanying +// file LICENSE or http://www.opensource.org/licenses/mit-license.php. +function uint8arrays_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { + if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; } - - return src_from_string_fromString(chunk.toString()) -} - -// EXTERNAL MODULE: ./node_modules/ipfs-core-utils/node_modules/protobufjs/minimal.js -var minimal = __nccwpck_require__(42413); -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/ipfs-unixfs/src/unixfs.js -/*eslint-disable*/ - - -// Common aliases -const $Reader = minimal.Reader, $Writer = minimal.Writer, $util = minimal.util; - -// Exported root namespace -const $root = minimal.roots["ipfs-unixfs"] || (minimal.roots["ipfs-unixfs"] = {}); - -const Data = $root.Data = (() => { - - /** - * Properties of a Data. - * @exports IData - * @interface IData - * @property {Data.DataType} Type Data Type - * @property {Uint8Array|null} [Data] Data Data - * @property {number|null} [filesize] Data filesize - * @property {Array.|null} [blocksizes] Data blocksizes - * @property {number|null} [hashType] Data hashType - * @property {number|null} [fanout] Data fanout - * @property {number|null} [mode] Data mode - * @property {IUnixTime|null} [mtime] Data mtime - */ - - /** - * Constructs a new Data. - * @exports Data - * @classdesc Represents a Data. - * @implements IData - * @constructor - * @param {IData=} [p] Properties to set - */ - function Data(p) { - this.blocksizes = []; - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) - this[ks[i]] = p[ks[i]]; + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') } + BASE_MAP[xc] = i; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up + var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up + function encode (source) { + if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } else if (Array.isArray(source)) { + source = Uint8Array.from(source); } + if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') } + if (source.length === 0) { return '' } + // Skip & count leading zeroes. + var zeroes = 0; + var length = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } + // Allocate enough space in big-endian base58 representation. + var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; + var b58 = new Uint8Array(size); + // Process the bytes. + while (pbegin !== pend) { + var carry = source[pbegin]; + // Apply "b58 = b58 * 256 + ch". + var i = 0; + for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { + carry += (256 * b58[it1]) >>> 0; + b58[it1] = (carry % BASE) >>> 0; + carry = (carry / BASE) >>> 0; + } + if (carry !== 0) { throw new Error('Non-zero carry') } + length = i; + pbegin++; + } + // Skip leading zeroes in base58 result. + var it2 = size - length; + while (it2 !== size && b58[it2] === 0) { + it2++; + } + // Translate the result into a string. + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); } + return str + } + function decodeUnsafe (source) { + if (typeof source !== 'string') { throw new TypeError('Expected String') } + if (source.length === 0) { return new Uint8Array() } + var psz = 0; + // Skip leading spaces. + if (source[psz] === ' ') { return } + // Skip and count leading '1's. + var zeroes = 0; + var length = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; + } + // Allocate enough space in big-endian base256 representation. + var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. + var b256 = new Uint8Array(size); + // Process the characters. + while (source[psz]) { + // Decode character + var carry = BASE_MAP[source.charCodeAt(psz)]; + // Invalid character + if (carry === 255) { return } + var i = 0; + for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { + carry += (BASE * b256[it3]) >>> 0; + b256[it3] = (carry % 256) >>> 0; + carry = (carry / 256) >>> 0; + } + if (carry !== 0) { throw new Error('Non-zero carry') } + length = i; + psz++; + } + // Skip trailing spaces. + if (source[psz] === ' ') { return } + // Skip leading zeroes in b256. + var it4 = size - length; + while (it4 !== size && b256[it4] === 0) { + it4++; + } + var vch = new Uint8Array(zeroes + (size - it4)); + var j = zeroes; + while (it4 !== size) { + vch[j++] = b256[it4++]; + } + return vch + } + function decode (string) { + var buffer = decodeUnsafe(string); + if (buffer) { return buffer } + throw new Error(`Non-${name} character`) + } + return { + encode: encode, + decodeUnsafe: decodeUnsafe, + decode: decode + } +} +var uint8arrays_node_modules_multiformats_vendor_base_x_src = uint8arrays_node_modules_multiformats_vendor_base_x_base; - /** - * Data Type. - * @member {Data.DataType} Type - * @memberof Data - * @instance - */ - Data.prototype.Type = 0; - - /** - * Data Data. - * @member {Uint8Array} Data - * @memberof Data - * @instance - */ - Data.prototype.Data = $util.newBuffer([]); - - /** - * Data filesize. - * @member {number} filesize - * @memberof Data - * @instance - */ - Data.prototype.filesize = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Data blocksizes. - * @member {Array.} blocksizes - * @memberof Data - * @instance - */ - Data.prototype.blocksizes = $util.emptyArray; - - /** - * Data hashType. - * @member {number} hashType - * @memberof Data - * @instance - */ - Data.prototype.hashType = $util.Long ? $util.Long.fromBits(0,0,true) : 0; +var uint8arrays_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = uint8arrays_node_modules_multiformats_vendor_base_x_src; - /** - * Data fanout. - * @member {number} fanout - * @memberof Data - * @instance - */ - Data.prototype.fanout = $util.Long ? $util.Long.fromBits(0,0,true) : 0; +/* harmony default export */ const uint8arrays_node_modules_multiformats_vendor_base_x = (uint8arrays_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX); - /** - * Data mode. - * @member {number} mode - * @memberof Data - * @instance - */ - Data.prototype.mode = 0; +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bytes.js +const uint8arrays_node_modules_multiformats_src_bytes_empty = new Uint8Array(0) - /** - * Data mtime. - * @member {IUnixTime|null|undefined} mtime - * @memberof Data - * @instance - */ - Data.prototype.mtime = null; +/** + * @param {Uint8Array} d + */ +const uint8arrays_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') - /** - * Encodes the specified Data message. Does not implicitly {@link Data.verify|verify} messages. - * @function encode - * @memberof Data - * @static - * @param {IData} m Data message or plain object to encode - * @param {$protobuf.Writer} [w] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Data.encode = function encode(m, w) { - if (!w) - w = $Writer.create(); - w.uint32(8).int32(m.Type); - if (m.Data != null && Object.hasOwnProperty.call(m, "Data")) - w.uint32(18).bytes(m.Data); - if (m.filesize != null && Object.hasOwnProperty.call(m, "filesize")) - w.uint32(24).uint64(m.filesize); - if (m.blocksizes != null && m.blocksizes.length) { - for (var i = 0; i < m.blocksizes.length; ++i) - w.uint32(32).uint64(m.blocksizes[i]); - } - if (m.hashType != null && Object.hasOwnProperty.call(m, "hashType")) - w.uint32(40).uint64(m.hashType); - if (m.fanout != null && Object.hasOwnProperty.call(m, "fanout")) - w.uint32(48).uint64(m.fanout); - if (m.mode != null && Object.hasOwnProperty.call(m, "mode")) - w.uint32(56).uint32(m.mode); - if (m.mtime != null && Object.hasOwnProperty.call(m, "mtime")) - $root.UnixTime.encode(m.mtime, w.uint32(66).fork()).ldelim(); - return w; - }; +/** + * @param {string} hex + */ +const uint8arrays_node_modules_multiformats_src_bytes_fromHex = hex => { + const hexes = hex.match(/../g) + return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : uint8arrays_node_modules_multiformats_src_bytes_empty +} - /** - * Decodes a Data message from the specified reader or buffer. - * @function decode - * @memberof Data - * @static - * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from - * @param {number} [l] Message length if known beforehand - * @returns {Data} Data - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Data.decode = function decode(r, l) { - if (!(r instanceof $Reader)) - r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, m = new $root.Data(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.Type = r.int32(); - break; - case 2: - m.Data = r.bytes(); - break; - case 3: - m.filesize = r.uint64(); - break; - case 4: - if (!(m.blocksizes && m.blocksizes.length)) - m.blocksizes = []; - if ((t & 7) === 2) { - var c2 = r.uint32() + r.pos; - while (r.pos < c2) - m.blocksizes.push(r.uint64()); - } else - m.blocksizes.push(r.uint64()); - break; - case 5: - m.hashType = r.uint64(); - break; - case 6: - m.fanout = r.uint64(); - break; - case 7: - m.mode = r.uint32(); - break; - case 8: - m.mtime = $root.UnixTime.decode(r, r.uint32()); - break; - default: - r.skipType(t & 7); - break; - } - } - if (!m.hasOwnProperty("Type")) - throw $util.ProtocolError("missing required 'Type'", { instance: m }); - return m; - }; +/** + * @param {Uint8Array} aa + * @param {Uint8Array} bb + */ +const uint8arrays_node_modules_multiformats_src_bytes_equals = (aa, bb) => { + if (aa === bb) return true + if (aa.byteLength !== bb.byteLength) { + return false + } - /** - * Creates a Data message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof Data - * @static - * @param {Object.} d Plain object - * @returns {Data} Data - */ - Data.fromObject = function fromObject(d) { - if (d instanceof $root.Data) - return d; - var m = new $root.Data(); - switch (d.Type) { - case "Raw": - case 0: - m.Type = 0; - break; - case "Directory": - case 1: - m.Type = 1; - break; - case "File": - case 2: - m.Type = 2; - break; - case "Metadata": - case 3: - m.Type = 3; - break; - case "Symlink": - case 4: - m.Type = 4; - break; - case "HAMTShard": - case 5: - m.Type = 5; - break; - } - if (d.Data != null) { - if (typeof d.Data === "string") - $util.base64.decode(d.Data, m.Data = $util.newBuffer($util.base64.length(d.Data)), 0); - else if (d.Data.length) - m.Data = d.Data; - } - if (d.filesize != null) { - if ($util.Long) - (m.filesize = $util.Long.fromValue(d.filesize)).unsigned = true; - else if (typeof d.filesize === "string") - m.filesize = parseInt(d.filesize, 10); - else if (typeof d.filesize === "number") - m.filesize = d.filesize; - else if (typeof d.filesize === "object") - m.filesize = new $util.LongBits(d.filesize.low >>> 0, d.filesize.high >>> 0).toNumber(true); - } - if (d.blocksizes) { - if (!Array.isArray(d.blocksizes)) - throw TypeError(".Data.blocksizes: array expected"); - m.blocksizes = []; - for (var i = 0; i < d.blocksizes.length; ++i) { - if ($util.Long) - (m.blocksizes[i] = $util.Long.fromValue(d.blocksizes[i])).unsigned = true; - else if (typeof d.blocksizes[i] === "string") - m.blocksizes[i] = parseInt(d.blocksizes[i], 10); - else if (typeof d.blocksizes[i] === "number") - m.blocksizes[i] = d.blocksizes[i]; - else if (typeof d.blocksizes[i] === "object") - m.blocksizes[i] = new $util.LongBits(d.blocksizes[i].low >>> 0, d.blocksizes[i].high >>> 0).toNumber(true); - } - } - if (d.hashType != null) { - if ($util.Long) - (m.hashType = $util.Long.fromValue(d.hashType)).unsigned = true; - else if (typeof d.hashType === "string") - m.hashType = parseInt(d.hashType, 10); - else if (typeof d.hashType === "number") - m.hashType = d.hashType; - else if (typeof d.hashType === "object") - m.hashType = new $util.LongBits(d.hashType.low >>> 0, d.hashType.high >>> 0).toNumber(true); - } - if (d.fanout != null) { - if ($util.Long) - (m.fanout = $util.Long.fromValue(d.fanout)).unsigned = true; - else if (typeof d.fanout === "string") - m.fanout = parseInt(d.fanout, 10); - else if (typeof d.fanout === "number") - m.fanout = d.fanout; - else if (typeof d.fanout === "object") - m.fanout = new $util.LongBits(d.fanout.low >>> 0, d.fanout.high >>> 0).toNumber(true); - } - if (d.mode != null) { - m.mode = d.mode >>> 0; - } - if (d.mtime != null) { - if (typeof d.mtime !== "object") - throw TypeError(".Data.mtime: object expected"); - m.mtime = $root.UnixTime.fromObject(d.mtime); - } - return m; - }; + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false + } + } - /** - * Creates a plain object from a Data message. Also converts values to other types if specified. - * @function toObject - * @memberof Data - * @static - * @param {Data} m Data - * @param {$protobuf.IConversionOptions} [o] Conversion options - * @returns {Object.} Plain object - */ - Data.toObject = function toObject(m, o) { - if (!o) - o = {}; - var d = {}; - if (o.arrays || o.defaults) { - d.blocksizes = []; - } - if (o.defaults) { - d.Type = o.enums === String ? "Raw" : 0; - if (o.bytes === String) - d.Data = ""; - else { - d.Data = []; - if (o.bytes !== Array) - d.Data = $util.newBuffer(d.Data); - } - if ($util.Long) { - var n = new $util.Long(0, 0, true); - d.filesize = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n; - } else - d.filesize = o.longs === String ? "0" : 0; - if ($util.Long) { - var n = new $util.Long(0, 0, true); - d.hashType = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n; - } else - d.hashType = o.longs === String ? "0" : 0; - if ($util.Long) { - var n = new $util.Long(0, 0, true); - d.fanout = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n; - } else - d.fanout = o.longs === String ? "0" : 0; - d.mode = 0; - d.mtime = null; - } - if (m.Type != null && m.hasOwnProperty("Type")) { - d.Type = o.enums === String ? $root.Data.DataType[m.Type] : m.Type; - } - if (m.Data != null && m.hasOwnProperty("Data")) { - 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; - } - if (m.filesize != null && m.hasOwnProperty("filesize")) { - if (typeof m.filesize === "number") - d.filesize = o.longs === String ? String(m.filesize) : m.filesize; - else - 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; - } - if (m.blocksizes && m.blocksizes.length) { - d.blocksizes = []; - for (var j = 0; j < m.blocksizes.length; ++j) { - if (typeof m.blocksizes[j] === "number") - d.blocksizes[j] = o.longs === String ? String(m.blocksizes[j]) : m.blocksizes[j]; - else - 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]; - } - } - if (m.hashType != null && m.hasOwnProperty("hashType")) { - if (typeof m.hashType === "number") - d.hashType = o.longs === String ? String(m.hashType) : m.hashType; - else - 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; - } - if (m.fanout != null && m.hasOwnProperty("fanout")) { - if (typeof m.fanout === "number") - d.fanout = o.longs === String ? String(m.fanout) : m.fanout; - else - 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; - } - if (m.mode != null && m.hasOwnProperty("mode")) { - d.mode = m.mode; - } - if (m.mtime != null && m.hasOwnProperty("mtime")) { - d.mtime = $root.UnixTime.toObject(m.mtime, o); - } - return d; - }; + return true +} - /** - * Converts this Data to JSON. - * @function toJSON - * @memberof Data - * @instance - * @returns {Object.} JSON object - */ - Data.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, minimal.util.toJSONOptions); - }; +/** + * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o + * @returns {Uint8Array} + */ +const uint8arrays_node_modules_multiformats_src_bytes_coerce = o => { + if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o + if (o instanceof ArrayBuffer) return new Uint8Array(o) + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) + } + throw new Error('Unknown type, must be binary type') +} - /** - * DataType enum. - * @name Data.DataType - * @enum {number} - * @property {number} Raw=0 Raw value - * @property {number} Directory=1 Directory value - * @property {number} File=2 File value - * @property {number} Metadata=3 Metadata value - * @property {number} Symlink=4 Symlink value - * @property {number} HAMTShard=5 HAMTShard value - */ - Data.DataType = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "Raw"] = 0; - values[valuesById[1] = "Directory"] = 1; - values[valuesById[2] = "File"] = 2; - values[valuesById[3] = "Metadata"] = 3; - values[valuesById[4] = "Symlink"] = 4; - values[valuesById[5] = "HAMTShard"] = 5; - return values; - })(); +/** + * @param {any} o + * @returns {o is ArrayBuffer|ArrayBufferView} + */ +const uint8arrays_node_modules_multiformats_src_bytes_isBinary = o => + o instanceof ArrayBuffer || ArrayBuffer.isView(o) - return Data; -})(); +/** + * @param {string} str + * @returns {Uint8Array} + */ +const uint8arrays_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) -const UnixTime = $root.UnixTime = (() => { +/** + * @param {Uint8Array} b + * @returns {string} + */ +const uint8arrays_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) - /** - * Properties of an UnixTime. - * @exports IUnixTime - * @interface IUnixTime - * @property {number} Seconds UnixTime Seconds - * @property {number|null} [FractionalNanoseconds] UnixTime FractionalNanoseconds - */ - /** - * Constructs a new UnixTime. - * @exports UnixTime - * @classdesc Represents an UnixTime. - * @implements IUnixTime - * @constructor - * @param {IUnixTime=} [p] Properties to set - */ - function UnixTime(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) - this[ks[i]] = p[ks[i]]; - } - /** - * UnixTime Seconds. - * @member {number} Seconds - * @memberof UnixTime - * @instance - */ - UnixTime.prototype.Seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base.js - /** - * UnixTime FractionalNanoseconds. - * @member {number} FractionalNanoseconds - * @memberof UnixTime - * @instance - */ - UnixTime.prototype.FractionalNanoseconds = 0; - /** - * Encodes the specified UnixTime message. Does not implicitly {@link UnixTime.verify|verify} messages. - * @function encode - * @memberof UnixTime - * @static - * @param {IUnixTime} m UnixTime message or plain object to encode - * @param {$protobuf.Writer} [w] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UnixTime.encode = function encode(m, w) { - if (!w) - w = $Writer.create(); - w.uint32(8).int64(m.Seconds); - if (m.FractionalNanoseconds != null && Object.hasOwnProperty.call(m, "FractionalNanoseconds")) - w.uint32(21).fixed32(m.FractionalNanoseconds); - return w; - }; +// Linter can't see that API is used in types. +// eslint-disable-next-line - /** - * Decodes an UnixTime message from the specified reader or buffer. - * @function decode - * @memberof UnixTime - * @static - * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from - * @param {number} [l] Message length if known beforehand - * @returns {UnixTime} UnixTime - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UnixTime.decode = function decode(r, l) { - if (!(r instanceof $Reader)) - r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, m = new $root.UnixTime(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.Seconds = r.int64(); - break; - case 2: - m.FractionalNanoseconds = r.fixed32(); - break; - default: - r.skipType(t & 7); - break; - } - } - if (!m.hasOwnProperty("Seconds")) - throw $util.ProtocolError("missing required 'Seconds'", { instance: m }); - return m; - }; - /** - * Creates an UnixTime message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof UnixTime - * @static - * @param {Object.} d Plain object - * @returns {UnixTime} UnixTime - */ - UnixTime.fromObject = function fromObject(d) { - if (d instanceof $root.UnixTime) - return d; - var m = new $root.UnixTime(); - if (d.Seconds != null) { - if ($util.Long) - (m.Seconds = $util.Long.fromValue(d.Seconds)).unsigned = false; - else if (typeof d.Seconds === "string") - m.Seconds = parseInt(d.Seconds, 10); - else if (typeof d.Seconds === "number") - m.Seconds = d.Seconds; - else if (typeof d.Seconds === "object") - m.Seconds = new $util.LongBits(d.Seconds.low >>> 0, d.Seconds.high >>> 0).toNumber(); - } - if (d.FractionalNanoseconds != null) { - m.FractionalNanoseconds = d.FractionalNanoseconds >>> 0; - } - return m; - }; +/** + * Class represents both BaseEncoder and MultibaseEncoder meaning it + * can be used to encode to multibase or base encode without multibase + * prefix. + * + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseEncoder} + * @implements {API.BaseEncoder} + */ +class node_modules_multiformats_src_bases_base_Encoder { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(bytes:Uint8Array) => string} baseEncode + */ + constructor (name, prefix, baseEncode) { + this.name = name + this.prefix = prefix + this.baseEncode = baseEncode + } - /** - * Creates a plain object from an UnixTime message. Also converts values to other types if specified. - * @function toObject - * @memberof UnixTime - * @static - * @param {UnixTime} m UnixTime - * @param {$protobuf.IConversionOptions} [o] Conversion options - * @returns {Object.} Plain object - */ - UnixTime.toObject = function toObject(m, o) { - if (!o) - o = {}; - var d = {}; - if (o.defaults) { - if ($util.Long) { - var n = new $util.Long(0, 0, false); - d.Seconds = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n; - } else - d.Seconds = o.longs === String ? "0" : 0; - d.FractionalNanoseconds = 0; - } - if (m.Seconds != null && m.hasOwnProperty("Seconds")) { - if (typeof m.Seconds === "number") - d.Seconds = o.longs === String ? String(m.Seconds) : m.Seconds; - else - 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; - } - if (m.FractionalNanoseconds != null && m.hasOwnProperty("FractionalNanoseconds")) { - d.FractionalNanoseconds = m.FractionalNanoseconds; - } - return d; - }; + /** + * @param {Uint8Array} bytes + * @returns {API.Multibase} + */ + encode (bytes) { + if (bytes instanceof Uint8Array) { + return `${this.prefix}${this.baseEncode(bytes)}` + } else { + throw Error('Unknown type, must be binary type') + } + } +} - /** - * Converts this UnixTime to JSON. - * @function toJSON - * @memberof UnixTime - * @instance - * @returns {Object.} JSON object - */ - UnixTime.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, minimal.util.toJSONOptions); - }; +/** + * @template {string} Prefix + */ +/** + * Class represents both BaseDecoder and MultibaseDecoder so it could be used + * to decode multibases (with matching prefix) or just base decode strings + * with corresponding base encoding. + * + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseDecoder} + * @implements {API.UnibaseDecoder} + * @implements {API.BaseDecoder} + */ +class node_modules_multiformats_src_bases_base_Decoder { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(text:string) => Uint8Array} baseDecode + */ + constructor (name, prefix, baseDecode) { + this.name = name + this.prefix = prefix + /* c8 ignore next 3 */ + if (prefix.codePointAt(0) === undefined) { + throw new Error('Invalid prefix character') + } + /** @private */ + this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0)) + this.baseDecode = baseDecode + } - return UnixTime; -})(); + /** + * @param {string} text + */ + decode (text) { + if (typeof text === 'string') { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`) + } + return this.baseDecode(text.slice(this.prefix.length)) + } else { + throw Error('Can only multibase decode strings') + } + } -const Metadata = $root.Metadata = (() => { + /** + * @template {string} OtherPrefix + * @param {API.UnibaseDecoder|ComposedDecoder} decoder + * @returns {ComposedDecoder} + */ + or (decoder) { + return node_modules_multiformats_src_bases_base_or(this, decoder) + } +} - /** - * Properties of a Metadata. - * @exports IMetadata - * @interface IMetadata - * @property {string|null} [MimeType] Metadata MimeType - */ +/** + * @template {string} Prefix + * @typedef {Record>} Decoders + */ - /** - * Constructs a new Metadata. - * @exports Metadata - * @classdesc Represents a Metadata. - * @implements IMetadata - * @constructor - * @param {IMetadata=} [p] Properties to set - */ - function Metadata(p) { - if (p) - for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) - if (p[ks[i]] != null) - this[ks[i]] = p[ks[i]]; +/** + * @template {string} Prefix + * @implements {API.MultibaseDecoder} + * @implements {API.CombobaseDecoder} + */ +class node_modules_multiformats_src_bases_base_ComposedDecoder { + /** + * @param {Decoders} decoders + */ + constructor (decoders) { + this.decoders = decoders + } + + /** + * @template {string} OtherPrefix + * @param {API.UnibaseDecoder|ComposedDecoder} decoder + * @returns {ComposedDecoder} + */ + or (decoder) { + return node_modules_multiformats_src_bases_base_or(this, decoder) + } + + /** + * @param {string} input + * @returns {Uint8Array} + */ + decode (input) { + const prefix = /** @type {Prefix} */ (input[0]) + const decoder = this.decoders[prefix] + if (decoder) { + return decoder.decode(input) + } else { + throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`) } + } +} - /** - * Metadata MimeType. - * @member {string} MimeType - * @memberof Metadata - * @instance - */ - Metadata.prototype.MimeType = ""; +/** + * @template {string} L + * @template {string} R + * @param {API.UnibaseDecoder|API.CombobaseDecoder} left + * @param {API.UnibaseDecoder|API.CombobaseDecoder} right + * @returns {ComposedDecoder} + */ +const node_modules_multiformats_src_bases_base_or = (left, right) => new node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({ + ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }), + ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right }) +})) - /** - * Encodes the specified Metadata message. Does not implicitly {@link Metadata.verify|verify} messages. - * @function encode - * @memberof Metadata - * @static - * @param {IMetadata} m Metadata message or plain object to encode - * @param {$protobuf.Writer} [w] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metadata.encode = function encode(m, w) { - if (!w) - w = $Writer.create(); - if (m.MimeType != null && Object.hasOwnProperty.call(m, "MimeType")) - w.uint32(10).string(m.MimeType); - return w; - }; +/** + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseCodec} + * @implements {API.MultibaseEncoder} + * @implements {API.MultibaseDecoder} + * @implements {API.BaseCodec} + * @implements {API.BaseEncoder} + * @implements {API.BaseDecoder} + */ +class node_modules_multiformats_src_bases_base_Codec { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(bytes:Uint8Array) => string} baseEncode + * @param {(text:string) => Uint8Array} baseDecode + */ + constructor (name, prefix, baseEncode, baseDecode) { + this.name = name + this.prefix = prefix + this.baseEncode = baseEncode + this.baseDecode = baseDecode + this.encoder = new node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode) + this.decoder = new node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode) + } - /** - * Decodes a Metadata message from the specified reader or buffer. - * @function decode - * @memberof Metadata - * @static - * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from - * @param {number} [l] Message length if known beforehand - * @returns {Metadata} Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metadata.decode = function decode(r, l) { - if (!(r instanceof $Reader)) - r = $Reader.create(r); - var c = l === undefined ? r.len : r.pos + l, m = new $root.Metadata(); - while (r.pos < c) { - var t = r.uint32(); - switch (t >>> 3) { - case 1: - m.MimeType = r.string(); - break; - default: - r.skipType(t & 7); - break; - } - } - return m; - }; + /** + * @param {Uint8Array} input + */ + encode (input) { + return this.encoder.encode(input) + } - /** - * Creates a Metadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof Metadata - * @static - * @param {Object.} d Plain object - * @returns {Metadata} Metadata - */ - Metadata.fromObject = function fromObject(d) { - if (d instanceof $root.Metadata) - return d; - var m = new $root.Metadata(); - if (d.MimeType != null) { - m.MimeType = String(d.MimeType); - } - return m; - }; + /** + * @param {string} input + */ + decode (input) { + return this.decoder.decode(input) + } +} - /** - * Creates a plain object from a Metadata message. Also converts values to other types if specified. - * @function toObject - * @memberof Metadata - * @static - * @param {Metadata} m Metadata - * @param {$protobuf.IConversionOptions} [o] Conversion options - * @returns {Object.} Plain object - */ - Metadata.toObject = function toObject(m, o) { - if (!o) - o = {}; - var d = {}; - if (o.defaults) { - d.MimeType = ""; - } - if (m.MimeType != null && m.hasOwnProperty("MimeType")) { - d.MimeType = m.MimeType; - } - return d; - }; +/** + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {(bytes:Uint8Array) => string} options.encode + * @param {(input:string) => Uint8Array} options.decode + * @returns {Codec} + */ +const node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) => + new node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode) +/** + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {string} options.alphabet + * @returns {Codec} + */ +const node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => { + const { encode, decode } = uint8arrays_node_modules_multiformats_vendor_base_x(alphabet, name) + return node_modules_multiformats_src_bases_base_from({ + prefix, + name, + encode, /** - * Converts this Metadata to JSON. - * @function toJSON - * @memberof Metadata - * @instance - * @returns {Object.} JSON object + * @param {string} text */ - Metadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, minimal.util.toJSONOptions); - }; - - return Metadata; -})(); - + decode: text => uint8arrays_node_modules_multiformats_src_bytes_coerce(decode(text)) + }) +} +/** + * @param {string} string + * @param {string} alphabet + * @param {number} bitsPerChar + * @param {string} name + * @returns {Uint8Array} + */ +const node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { + // Build the character lookup table: + /** @type {Record} */ + const codes = {} + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i + } -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/ipfs-unixfs/src/index.js + // Count the padding bytes: + let end = string.length + while (string[end - 1] === '=') { + --end + } + // Allocate the output: + const out = new Uint8Array((end * bitsPerChar / 8) | 0) -const PBData = Data + // Parse the data: + let bits = 0 // Number of bits currently in the buffer + let buffer = 0 // Bits waiting to be written out, MSB first + let written = 0 // Next byte to write + for (let i = 0; i < end; ++i) { + // Read one character from the string: + const value = codes[string[i]] + if (value === undefined) { + throw new SyntaxError(`Non-${name} character`) + } -/** - * @typedef {import('./types').Mtime} Mtime - * @typedef {import('./types').MtimeLike} MtimeLike - */ + // Append the bits to the buffer: + buffer = (buffer << bitsPerChar) | value + bits += bitsPerChar -const types = (/* unused pure expression or super */ null && ([ - 'raw', - 'directory', - 'file', - 'metadata', - 'symlink', - 'hamt-sharded-directory' -])) + // Write out some bits if the buffer has a byte's worth: + if (bits >= 8) { + bits -= 8 + out[written++] = 0xff & (buffer >> bits) + } + } -const dirTypes = (/* unused pure expression or super */ null && ([ - 'directory', - 'hamt-sharded-directory' -])) + // Verify that we have received just enough bits: + if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) { + throw new SyntaxError('Unexpected end of data') + } -const DEFAULT_FILE_MODE = parseInt('0644', 8) -const DEFAULT_DIRECTORY_MODE = parseInt('0755', 8) + return out +} /** - * @param {string | number | undefined} [mode] + * @param {Uint8Array} data + * @param {string} alphabet + * @param {number} bitsPerChar + * @returns {string} */ -function parseMode (mode) { - if (mode == null) { - return undefined - } +const node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => { + const pad = alphabet[alphabet.length - 1] === '=' + const mask = (1 << bitsPerChar) - 1 + let out = '' - if (typeof mode === 'number') { - return mode & 0xFFF + let bits = 0 // Number of bits currently in the buffer + let buffer = 0 // Bits waiting to be written out, MSB first + for (let i = 0; i < data.length; ++i) { + // Slurp data into the buffer: + buffer = (buffer << 8) | data[i] + bits += 8 + + // Write out as much as we can: + while (bits > bitsPerChar) { + bits -= bitsPerChar + out += alphabet[mask & (buffer >> bits)] + } } - mode = mode.toString() + // Partial character: + if (bits) { + out += alphabet[mask & (buffer << (bitsPerChar - bits))] + } - if (mode.substring(0, 1) === '0') { - // octal string - return parseInt(mode, 8) & 0xFFF + // Add padding characters until we hit a byte boundary: + if (pad) { + while ((out.length * bitsPerChar) & 7) { + out += '=' + } } - // decimal string - return parseInt(mode, 10) & 0xFFF + return out } /** - * @param {any} input + * RFC4648 Factory + * + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {string} options.alphabet + * @param {number} options.bitsPerChar */ -function src_parseMtime (input) { - if (input == null) { - return undefined - } +const node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { + return node_modules_multiformats_src_bases_base_from({ + prefix, + name, + encode (input) { + return node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar) + }, + decode (input) { + return node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name) + } + }) +} + +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base10.js + + +const bases_base10_base10 = node_modules_multiformats_src_bases_base_baseX({ + prefix: '9', + name: 'base10', + alphabet: '0123456789' +}) + +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base16.js +// @ts-check + + + +const bases_base16_base16 = node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'f', + name: 'base16', + alphabet: '0123456789abcdef', + bitsPerChar: 4 +}) - /** @type {Mtime | undefined} */ - let mtime +const bases_base16_base16upper = node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'F', + name: 'base16upper', + alphabet: '0123456789ABCDEF', + bitsPerChar: 4 +}) - // { secs, nsecs } - if (input.secs != null) { - mtime = { - secs: input.secs, - nsecs: input.nsecs - } - } +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base2.js +// @ts-check - // UnixFS TimeSpec - if (input.Seconds != null) { - mtime = { - secs: input.Seconds, - nsecs: input.FractionalNanoseconds - } - } - // process.hrtime() - if (Array.isArray(input)) { - mtime = { - secs: input[0], - nsecs: input[1] - } - } - // Javascript Date - if (input instanceof Date) { - const ms = input.getTime() - const secs = Math.floor(ms / 1000) +const bases_base2_base2 = node_modules_multiformats_src_bases_base_rfc4648({ + prefix: '0', + name: 'base2', + alphabet: '01', + bitsPerChar: 1 +}) - mtime = { - secs: secs, - nsecs: (ms - (secs * 1000)) * 1000 - } - } +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base256emoji.js - /* - TODO: https://github.com/ipfs/aegir/issues/487 - // process.hrtime.bigint() - if (input instanceof BigInt) { - const secs = input / BigInt(1e9) - const nsecs = input - (secs * BigInt(1e9)) +const bases_base256emoji_alphabet = Array.from('🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂') +const bases_base256emoji_alphabetBytesToChars = /** @type {string[]} */ (bases_base256emoji_alphabet.reduce((p, c, i) => { p[i] = c; return p }, /** @type {string[]} */([]))) +const bases_base256emoji_alphabetCharsToBytes = /** @type {number[]} */ (bases_base256emoji_alphabet.reduce((p, c, i) => { p[/** @type {number} */ (c.codePointAt(0))] = i; return p }, /** @type {number[]} */([]))) - mtime = { - secs: parseInt(secs.toString()), - nsecs: parseInt(nsecs.toString()) +/** + * @param {Uint8Array} data + * @returns {string} + */ +function src_bases_base256emoji_encode (data) { + return data.reduce((p, c) => { + p += bases_base256emoji_alphabetBytesToChars[c] + return p + }, '') +} + +/** + * @param {string} str + * @returns {Uint8Array} + */ +function src_bases_base256emoji_decode (str) { + const byts = [] + for (const char of str) { + const byt = bases_base256emoji_alphabetCharsToBytes[/** @type {number} */ (char.codePointAt(0))] + if (byt === undefined) { + throw new Error(`Non-base256emoji character: ${char}`) } + byts.push(byt) } - */ + return new Uint8Array(byts) +} - if (!Object.prototype.hasOwnProperty.call(mtime, 'secs')) { - return undefined - } +const bases_base256emoji_base256emoji = node_modules_multiformats_src_bases_base_from({ + prefix: '🚀', + name: 'base256emoji', + encode: src_bases_base256emoji_encode, + decode: src_bases_base256emoji_decode +}) - if (mtime != null && mtime.nsecs != null && (mtime.nsecs < 0 || mtime.nsecs > 999999999)) { - throw err_code(new Error('mtime-nsecs must be within the range [0,999999999]'), 'ERR_INVALID_MTIME_NSECS') - } +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base32.js - return mtime -} -class UnixFS { - /** - * Decode from protobuf https://github.com/ipfs/specs/blob/master/UNIXFS.md - * - * @param {Uint8Array} marshaled - */ - static unmarshal (marshaled) { - const message = PBData.decode(marshaled) - const decoded = PBData.toObject(message, { - defaults: false, - arrays: true, - longs: Number, - objects: false - }) +const uint8arrays_node_modules_multiformats_src_bases_base32_base32 = node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'b', + name: 'base32', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567', + bitsPerChar: 5 +}) - const data = new UnixFS({ - type: types[decoded.Type], - data: decoded.Data, - blockSizes: decoded.blocksizes, - mode: decoded.mode, - mtime: decoded.mtime - ? { - secs: decoded.mtime.Seconds, - nsecs: decoded.mtime.FractionalNanoseconds - } - : undefined - }) +const uint8arrays_node_modules_multiformats_src_bases_base32_base32upper = node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'B', + name: 'base32upper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', + bitsPerChar: 5 +}) - // make sure we honour the original mode - data._originalMode = decoded.mode || 0 +const node_modules_multiformats_src_bases_base32_base32pad = node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'c', + name: 'base32pad', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', + bitsPerChar: 5 +}) - return data - } +const node_modules_multiformats_src_bases_base32_base32padupper = node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'C', + name: 'base32padupper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', + bitsPerChar: 5 +}) - /** - * @param {object} [options] - * @param {string} [options.type='file'] - * @param {Uint8Array} [options.data] - * @param {number[]} [options.blockSizes] - * @param {number} [options.hashType] - * @param {number} [options.fanout] - * @param {MtimeLike | null} [options.mtime] - * @param {number | string} [options.mode] - */ - constructor (options = { - type: 'file' - }) { - const { - type, - data, - blockSizes, - hashType, - fanout, - mtime, - mode - } = options +const node_modules_multiformats_src_bases_base32_base32hex = node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'v', + name: 'base32hex', + alphabet: '0123456789abcdefghijklmnopqrstuv', + bitsPerChar: 5 +}) - if (type && !types.includes(type)) { - throw errcode(new Error('Type: ' + type + ' is not valid'), 'ERR_INVALID_TYPE') - } +const node_modules_multiformats_src_bases_base32_base32hexupper = node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'V', + name: 'base32hexupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', + bitsPerChar: 5 +}) - this.type = type || 'file' - this.data = data - this.hashType = hashType - this.fanout = fanout +const node_modules_multiformats_src_bases_base32_base32hexpad = node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 't', + name: 'base32hexpad', + alphabet: '0123456789abcdefghijklmnopqrstuv=', + bitsPerChar: 5 +}) - /** @type {number[]} */ - this.blockSizes = blockSizes || [] - this._originalMode = 0 - this.mode = parseMode(mode) +const node_modules_multiformats_src_bases_base32_base32hexpadupper = node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'T', + name: 'base32hexpadupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', + bitsPerChar: 5 +}) - if (mtime) { - this.mtime = src_parseMtime(mtime) +const node_modules_multiformats_src_bases_base32_base32z = node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'h', + name: 'base32z', + alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', + bitsPerChar: 5 +}) - if (this.mtime && !this.mtime.nsecs) { - this.mtime.nsecs = 0 - } - } - } +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base36.js - /** - * @param {number | undefined} mode - */ - set mode (mode) { - this._mode = this.isDirectory() ? DEFAULT_DIRECTORY_MODE : DEFAULT_FILE_MODE - const parsedMode = parseMode(mode) +const bases_base36_base36 = node_modules_multiformats_src_bases_base_baseX({ + prefix: 'k', + name: 'base36', + alphabet: '0123456789abcdefghijklmnopqrstuvwxyz' +}) - if (parsedMode !== undefined) { - this._mode = parsedMode - } - } +const bases_base36_base36upper = node_modules_multiformats_src_bases_base_baseX({ + prefix: 'K', + name: 'base36upper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' +}) - /** - * @returns {number | undefined} - */ - get mode () { - return this._mode - } +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base58.js - isDirectory () { - return Boolean(this.type && dirTypes.includes(this.type)) - } - /** - * @param {number} size - */ - addBlockSize (size) { - this.blockSizes.push(size) - } +const uint8arrays_node_modules_multiformats_src_bases_base58_base58btc = node_modules_multiformats_src_bases_base_baseX({ + name: 'base58btc', + prefix: 'z', + alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +}) - /** - * @param {number} index - */ - removeBlockSize (index) { - this.blockSizes.splice(index, 1) - } +const node_modules_multiformats_src_bases_base58_base58flickr = node_modules_multiformats_src_bases_base_baseX({ + name: 'base58flickr', + prefix: 'Z', + alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' +}) - /** - * Returns `0` for directories or `data.length + sum(blockSizes)` for everything else - */ - fileSize () { - if (this.isDirectory()) { - // dirs don't have file size - return 0 - } +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base64.js +// @ts-check - let sum = 0 - this.blockSizes.forEach((size) => { - sum += size - }) - if (this.data) { - sum += this.data.length - } - return sum - } +const multiformats_src_bases_base64_base64 = node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'm', + name: 'base64', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + bitsPerChar: 6 +}) - /** - * encode to protobuf Uint8Array - */ - marshal () { - let type +const multiformats_src_bases_base64_base64pad = node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'M', + name: 'base64pad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', + bitsPerChar: 6 +}) - switch (this.type) { - case 'raw': type = PBData.DataType.Raw; break - case 'directory': type = PBData.DataType.Directory; break - case 'file': type = PBData.DataType.File; break - case 'metadata': type = PBData.DataType.Metadata; break - case 'symlink': type = PBData.DataType.Symlink; break - case 'hamt-sharded-directory': type = PBData.DataType.HAMTShard; break - default: - throw errcode(new Error('Type: ' + type + ' is not valid'), 'ERR_INVALID_TYPE') - } +const multiformats_src_bases_base64_base64url = node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'u', + name: 'base64url', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', + bitsPerChar: 6 +}) - let data = this.data +const multiformats_src_bases_base64_base64urlpad = node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'U', + name: 'base64urlpad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', + bitsPerChar: 6 +}) - if (!this.data || !this.data.length) { - data = undefined - } +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/base8.js +// @ts-check - let mode - if (this.mode != null) { - mode = (this._originalMode & 0xFFFFF000) | (parseMode(this.mode) || 0) - if (mode === DEFAULT_FILE_MODE && !this.isDirectory()) { - mode = undefined - } +const bases_base8_base8 = node_modules_multiformats_src_bases_base_rfc4648({ + prefix: '7', + name: 'base8', + alphabet: '01234567', + bitsPerChar: 3 +}) - if (mode === DEFAULT_DIRECTORY_MODE && this.isDirectory()) { - mode = undefined - } - } +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/bases/identity.js +// @ts-check - let mtime - if (this.mtime != null) { - const parsed = src_parseMtime(this.mtime) - if (parsed) { - mtime = { - Seconds: parsed.secs, - FractionalNanoseconds: parsed.nsecs - } - if (mtime.FractionalNanoseconds === 0) { - delete mtime.FractionalNanoseconds - } - } - } +const multiformats_src_bases_identity_identity = node_modules_multiformats_src_bases_base_from({ + prefix: '\x00', + name: 'identity', + encode: (buf) => uint8arrays_node_modules_multiformats_src_bytes_toString(buf), + decode: (str) => uint8arrays_node_modules_multiformats_src_bytes_fromString(str) +}) - const pbData = { - Type: type, - Data: data, - filesize: this.isDirectory() ? undefined : this.fileSize(), - blocksizes: this.blockSizes, - hashType: this.hashType, - fanout: this.fanout, - mode, - mtime - } +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/codecs/json.js +// @ts-check - return PBData.encode(pbData).finish() - } -} +/** + * @template T + * @typedef {import('./interface.js').ByteView} ByteView + */ +const src_codecs_json_textEncoder = new TextEncoder() +const src_codecs_json_textDecoder = new TextDecoder() +const src_codecs_json_name = 'json' +const src_codecs_json_code = 0x0200 -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/files/normalise-candidate-multiple.js +/** + * @template T + * @param {T} node + * @returns {ByteView} + */ +const src_codecs_json_encode = (node) => src_codecs_json_textEncoder.encode(JSON.stringify(node)) +/** + * @template T + * @param {ByteView} data + * @returns {T} + */ +const src_codecs_json_decode = (data) => JSON.parse(src_codecs_json_textDecoder.decode(data)) +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/codecs/raw.js +// @ts-check +/** + * @template T + * @typedef {import('./interface.js').ByteView} ByteView + */ +const src_codecs_raw_name = 'raw' +const src_codecs_raw_code = 0x55 /** - * @typedef {import('ipfs-core-types/src/utils').ImportCandidate} ImportCandidate - * @typedef {import('ipfs-core-types/src/utils').ToContent} ToContent - * @typedef {import('ipfs-unixfs-importer').ImportCandidate} ImporterImportCandidate - * @typedef {import('ipfs-core-types/src/utils').ImportCandidateStream} ImportCandidateStream + * @param {Uint8Array} node + * @returns {ByteView} */ +const src_codecs_raw_encode = (node) => uint8arrays_node_modules_multiformats_src_bytes_coerce(node) /** - * @param {ImportCandidateStream} input - * @param {(content:ToContent) => Promise>} normaliseContent + * @param {ByteView} data + * @returns {Uint8Array} */ -// eslint-disable-next-line complexity -async function * normaliseCandidateMultiple (input, normaliseContent) { - // String - // Uint8Array|ArrayBuffer|TypedArray - // Blob|File - // fs.ReadStream - // @ts-expect-error _readableState is a property of a node fs.ReadStream - if (typeof input === 'string' || input instanceof String || isBytes(input) || isBlob(input) || input._readableState) { - throw err_code(new Error('Unexpected input: single item passed - if you are using ipfs.addAll, please use ipfs.add instead'), 'ERR_UNEXPECTED_INPUT') - } +const src_codecs_raw_decode = (data) => uint8arrays_node_modules_multiformats_src_bytes_coerce(data) - // Browser ReadableStream - if (isReadableStream(input)) { - input = browserReadableStreamToIt(input) - } +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/vendor/varint.js +var uint8arrays_node_modules_multiformats_vendor_varint_encode_1 = uint8arrays_node_modules_multiformats_vendor_varint_encode; - // Iterable - if (Symbol.iterator in input || Symbol.asyncIterator in input) { - const peekable = peekableIterator(input) - const { value, done } = await peekable.peek() +var uint8arrays_node_modules_multiformats_vendor_varint_MSB = 0x80 + , uint8arrays_node_modules_multiformats_vendor_varint_REST = 0x7F + , uint8arrays_node_modules_multiformats_vendor_varint_MSBALL = ~uint8arrays_node_modules_multiformats_vendor_varint_REST + , uint8arrays_node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31); - if (done) { - // make sure empty iterators result in empty files - yield * [] - return - } +function uint8arrays_node_modules_multiformats_vendor_varint_encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; - peekable.push(value) + while(num >= uint8arrays_node_modules_multiformats_vendor_varint_INT) { + out[offset++] = (num & 0xFF) | uint8arrays_node_modules_multiformats_vendor_varint_MSB; + num /= 128; + } + while(num & uint8arrays_node_modules_multiformats_vendor_varint_MSBALL) { + out[offset++] = (num & 0xFF) | uint8arrays_node_modules_multiformats_vendor_varint_MSB; + num >>>= 7; + } + out[offset] = num | 0; + + uint8arrays_node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; + + return out +} - // (Async)Iterable - // (Async)Iterable - if (Number.isInteger(value)) { - throw err_code(new Error('Unexpected input: single item passed - if you are using ipfs.addAll, please use ipfs.add instead'), 'ERR_UNEXPECTED_INPUT') - } +var uint8arrays_node_modules_multiformats_vendor_varint_decode = uint8arrays_node_modules_multiformats_vendor_varint_read; - // (Async)Iterable - // @ts-expect-error private field - if (value._readableState) { - // @ts-expect-error Node fs.ReadStreams have a `.path` property so we need to pass it as the content - yield * map(peekable, (/** @type {ImportCandidate} */ value) => toFileObject({ content: value }, normaliseContent)) - return - } +var uint8arrays_node_modules_multiformats_vendor_varint_MSB$1 = 0x80 + , uint8arrays_node_modules_multiformats_vendor_varint_REST$1 = 0x7F; - if (isBytes(value)) { - // @ts-expect-error peekable is still an iterable of ImportCandidates - yield toFileObject({ content: peekable }, normaliseContent) - return - } +function uint8arrays_node_modules_multiformats_vendor_varint_read(buf, offset) { + var res = 0 + , offset = offset || 0 + , shift = 0 + , counter = offset + , b + , l = buf.length; - // (Async)Iterable<(Async)Iterable> - // (Async)Iterable> - // ReadableStream<(Async)Iterable> - // ReadableStream> - if (isFileObject(value) || value[Symbol.iterator] || value[Symbol.asyncIterator] || isReadableStream(value) || isBlob(value)) { - yield * map(peekable, (/** @type {ImportCandidate} */ value) => toFileObject(value, normaliseContent)) - return + do { + if (counter >= l) { + uint8arrays_node_modules_multiformats_vendor_varint_read.bytes = 0; + throw new RangeError('Could not decode varint') } - } + b = buf[counter++]; + res += shift < 28 + ? (b & uint8arrays_node_modules_multiformats_vendor_varint_REST$1) << shift + : (b & uint8arrays_node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= uint8arrays_node_modules_multiformats_vendor_varint_MSB$1) - // { path, content: ? } - // Note: Detected _after_ (Async)Iterable because Node.js fs.ReadStreams have a - // `path` property that passes this check. - if (isFileObject(input)) { - throw err_code(new Error('Unexpected input: single item passed - if you are using ipfs.addAll, please use ipfs.add instead'), 'ERR_UNEXPECTED_INPUT') - } + uint8arrays_node_modules_multiformats_vendor_varint_read.bytes = counter - offset; - throw err_code(new Error('Unexpected input: ' + typeof input), 'ERR_UNEXPECTED_INPUT') + return res } -/** - * @param {ImportCandidate} input - * @param {(content:ToContent) => Promise>} normaliseContent - */ -async function toFileObject (input, normaliseContent) { - // @ts-expect-error - Those properties don't exist on most input types - const { path, mode, mtime, content } = input +var uint8arrays_node_modules_multiformats_vendor_varint_N1 = Math.pow(2, 7); +var uint8arrays_node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14); +var uint8arrays_node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21); +var uint8arrays_node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28); +var uint8arrays_node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35); +var uint8arrays_node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42); +var uint8arrays_node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49); +var uint8arrays_node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56); +var uint8arrays_node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63); - /** @type {ImporterImportCandidate} */ - const file = { - path: path || '', - mode: parseMode(mode), - mtime: src_parseMtime(mtime) - } +var uint8arrays_node_modules_multiformats_vendor_varint_length = function (value) { + return ( + value < uint8arrays_node_modules_multiformats_vendor_varint_N1 ? 1 + : value < uint8arrays_node_modules_multiformats_vendor_varint_N2 ? 2 + : value < uint8arrays_node_modules_multiformats_vendor_varint_N3 ? 3 + : value < uint8arrays_node_modules_multiformats_vendor_varint_N4 ? 4 + : value < uint8arrays_node_modules_multiformats_vendor_varint_N5 ? 5 + : value < uint8arrays_node_modules_multiformats_vendor_varint_N6 ? 6 + : value < uint8arrays_node_modules_multiformats_vendor_varint_N7 ? 7 + : value < uint8arrays_node_modules_multiformats_vendor_varint_N8 ? 8 + : value < uint8arrays_node_modules_multiformats_vendor_varint_N9 ? 9 + : 10 + ) +}; - if (content) { - file.content = await normaliseContent(content) - } else if (!path) { // Not already a file object with path or content prop - // @ts-expect-error - input still can be different ToContent - file.content = await normaliseContent(input) - } +var uint8arrays_node_modules_multiformats_vendor_varint_varint = { + encode: uint8arrays_node_modules_multiformats_vendor_varint_encode_1 + , decode: uint8arrays_node_modules_multiformats_vendor_varint_decode + , encodingLength: uint8arrays_node_modules_multiformats_vendor_varint_length +}; - return file -} +var uint8arrays_node_modules_multiformats_vendor_varint_brrp_varint = uint8arrays_node_modules_multiformats_vendor_varint_varint; -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/files/normalise-input-multiple.js +/* harmony default export */ const uint8arrays_node_modules_multiformats_vendor_varint = (uint8arrays_node_modules_multiformats_vendor_varint_brrp_varint); +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/varint.js /** - * @typedef {import('ipfs-core-types/src/utils').ImportCandidateStream} ImportCandidateStream + * @param {Uint8Array} data + * @param {number} [offset=0] + * @returns {[number, number]} */ +const uint8arrays_node_modules_multiformats_src_varint_decode = (data, offset = 0) => { + const code = varint.decode(data, offset) + return [code, varint.decode.bytes] +} /** - * Transforms any of the `ipfs.addAll` input types into - * - * ``` - * AsyncIterable<{ path, mode, mtime, content: AsyncIterable }> - * ``` - * - * See https://github.com/ipfs/js-ipfs/blob/master/docs/core-api/FILES.md#ipfsadddata-options - * - * @param {ImportCandidateStream} input + * @param {number} int + * @param {Uint8Array} target + * @param {number} [offset=0] */ -function normaliseInput (input) { - return normaliseCandidateMultiple(input, normaliseContent) +const uint8arrays_node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => { + uint8arrays_node_modules_multiformats_vendor_varint.encode(int, target, offset) + return target } -;// CONCATENATED MODULE: ./node_modules/nanoid/url-alphabet/index.js -const urlAlphabet = - 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' +/** + * @param {number} int + * @returns {number} + */ +const uint8arrays_node_modules_multiformats_src_varint_encodingLength = (int) => { + return uint8arrays_node_modules_multiformats_vendor_varint.encodingLength(int) +} -;// CONCATENATED MODULE: ./node_modules/nanoid/index.js +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/hashes/digest.js -const POOL_SIZE_MULTIPLIER = 128 -let pool, poolOffset -let fillPool = bytes => { - if (!pool || pool.length < bytes) { - pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER) - ;(0,external_crypto_.randomFillSync)(pool) - poolOffset = 0 - } else if (poolOffset + bytes > pool.length) { - (0,external_crypto_.randomFillSync)(pool) - poolOffset = 0 - } - poolOffset += bytes -} -let random = bytes => { - fillPool((bytes -= 0)) - return pool.subarray(poolOffset - bytes, poolOffset) -} -let customRandom = (alphabet, defaultSize, getRandom) => { - let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1 - let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length) - return (size = defaultSize) => { - let id = '' - while (true) { - let bytes = getRandom(step) - let i = step - while (i--) { - id += alphabet[bytes[i] & mask] || '' - if (id.length === size) return id - } - } - } -} -let customAlphabet = (alphabet, size = 21) => - customRandom(alphabet, size, random) -let nanoid = (size = 21) => { - fillPool((size -= 0)) - let id = '' - for (let i = poolOffset - size; i < poolOffset; i++) { - id += urlAlphabet[pool[i] & 63] - } - return id -} +/** + * Creates a multihash digest. + * + * @template {number} Code + * @param {Code} code + * @param {Uint8Array} digest + */ +const uint8arrays_node_modules_multiformats_src_hashes_digest_create = (code, digest) => { + const size = digest.byteLength + const sizeOffset = uint8arrays_node_modules_multiformats_src_varint_encodingLength(code) + const digestOffset = sizeOffset + uint8arrays_node_modules_multiformats_src_varint_encodingLength(size) -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/mode-to-string.js + const bytes = new Uint8Array(digestOffset + size) + uint8arrays_node_modules_multiformats_src_varint_encodeTo(code, bytes, 0) + uint8arrays_node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset) + bytes.set(digest, digestOffset) + + return new uint8arrays_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) +} /** - * @param {number | string | undefined} mode + * Turns bytes representation of multihash digest into an instance. + * + * @param {Uint8Array} multihash + * @returns {MultihashDigest} */ -function mode_to_string_modeToString (mode) { - if (mode == null) { - return undefined - } +const uint8arrays_node_modules_multiformats_src_hashes_digest_decode = (multihash) => { + const bytes = coerce(multihash) + const [code, sizeOffset] = varint.decode(bytes) + const [size, digestOffset] = varint.decode(bytes.subarray(sizeOffset)) + const digest = bytes.subarray(sizeOffset + digestOffset) - if (typeof mode === 'string') { - return mode + if (digest.byteLength !== size) { + throw new Error('Incorrect length') } - return mode.toString(8).padStart(4, '0') + return new uint8arrays_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) } -// EXTERNAL MODULE: ./node_modules/it-to-stream/src/index.js -var it_to_stream_src = __nccwpck_require__(79620); -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/@libp2p/logger/dist/src/index.js - +/** + * @param {MultihashDigest} a + * @param {unknown} b + * @returns {b is MultihashDigest} + */ +const uint8arrays_node_modules_multiformats_src_hashes_digest_equals = (a, b) => { + if (a === b) { + return true + } else { + const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) + return ( + a.code === data.code && + a.size === data.size && + data.bytes instanceof Uint8Array && + equalBytes(a.bytes, data.bytes) + ) + } +} +/** + * @typedef {import('./interface.js').MultihashDigest} MultihashDigest + */ -// Add a formatter for converting to a base58 string -debug_src.formatters.b = (v) => { - return v == null ? 'undefined' : ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc.baseEncode(v); -}; -// Add a formatter for converting to a base32 string -debug_src.formatters.t = (v) => { - return v == null ? 'undefined' : ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32.baseEncode(v); -}; -// Add a formatter for converting to a base64 string -debug_src.formatters.m = (v) => { - return v == null ? 'undefined' : node_modules_multiformats_src_bases_base64_base64.baseEncode(v); -}; -// Add a formatter for stringifying peer ids -debug_src.formatters.p = (v) => { - return v == null ? 'undefined' : v.toString(); -}; -// Add a formatter for stringifying CIDs -debug_src.formatters.c = (v) => { - return v == null ? 'undefined' : v.toString(); -}; -// Add a formatter for stringifying Datastore keys -debug_src.formatters.k = (v) => { - return v == null ? 'undefined' : v.toString(); -}; -// Add a formatter for stringifying Multiaddrs -debug_src.formatters.a = (v) => { - return v == null ? 'undefined' : v.toString(); -}; -function src_createDisabledLogger(namespace) { - const logger = () => { }; - logger.enabled = false; - logger.color = ''; - logger.diff = 0; - logger.log = () => { }; - logger.namespace = namespace; - logger.destroy = () => true; - logger.extend = () => logger; - return logger; -} -function src_logger(name) { - // trace logging is a no-op by default - let trace = src_createDisabledLogger(`${name}:trace`); - // look at all the debug names and see if trace logging has explicitly been enabled - if (debug_src.enabled(`${name}:trace`) && debug_src.names.map(r => r.toString()).find(n => n.includes(':trace')) != null) { - trace = debug_src(`${name}:trace`); - } - return Object.assign(debug_src(name), { - error: debug_src(`${name}:error`), - trace - }); -} -function src_disable() { - debug.disable(); -} -function src_enable(namespaces) { - debug.enable(namespaces); -} -function src_enabled(namespaces) { - return debug.enabled(namespaces); +/** + * Represents a multihash digest which carries information about the + * hashing algorithm and an actual hash digest. + * + * @template {number} Code + * @template {number} Size + * @class + * @implements {MultihashDigest} + */ +class uint8arrays_node_modules_multiformats_src_hashes_digest_Digest { + /** + * Creates a multihash digest. + * + * @param {Code} code + * @param {Size} size + * @param {Uint8Array} digest + * @param {Uint8Array} bytes + */ + constructor (code, size, digest, bytes) { + this.code = code + this.size = size + this.digest = digest + this.bytes = bytes + } } -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/multipart-request.node.js +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/hashes/identity.js -// @ts-expect-error no types +const src_hashes_identity_code = 0x0 +const src_hashes_identity_name = 'identity' +/** @type {(input:Uint8Array) => Uint8Array} */ +const src_hashes_identity_encode = uint8arrays_node_modules_multiformats_src_bytes_coerce + +/** + * @param {Uint8Array} input + * @returns {Digest.Digest} + */ +const hashes_identity_digest = (input) => uint8arrays_node_modules_multiformats_src_hashes_digest_create(src_hashes_identity_code, src_hashes_identity_encode(input)) +const src_hashes_identity_identity = { code: src_hashes_identity_code, name: src_hashes_identity_name, encode: src_hashes_identity_encode, digest: hashes_identity_digest } +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/hashes/hasher.js -const multipart_request_node_merge = node_modules_merge_options.bind({ ignoreUndefined: true }) -const multipart_request_node_log = src_logger('ipfs:core-utils:multipart-request') /** - * @typedef {import('ipfs-core-types/src/utils').ImportCandidateStream} ImportCandidateStream + * @template {string} Name + * @template {number} Code + * @param {object} options + * @param {Name} options.name + * @param {Code} options.code + * @param {(input: Uint8Array) => Await} options.encode */ +const multiformats_src_hashes_hasher_from = ({ name, code, encode }) => new src_hashes_hasher_Hasher(name, code, encode) /** - * @param {ImportCandidateStream} source - * @param {AbortController} abortController - * @param {Headers|Record} [headers] - * @param {string} [boundary] + * Hasher represents a hashing algorithm implementation that produces as + * `MultihashDigest`. + * + * @template {string} Name + * @template {number} Code + * @class + * @implements {MultihashHasher} */ -async function multipartRequest (source, abortController, headers = {}, boundary = `-----------------------------${nanoid()}`) { +class src_hashes_hasher_Hasher { /** - * @param {ImportCandidateStream} source + * + * @param {Name} name + * @param {Code} code + * @param {(input: Uint8Array) => Await} encode */ - async function * streamFiles (source) { - try { - let index = 0 + constructor (name, code, encode) { + this.name = name + this.code = code + this.encode = encode + } - // @ts-expect-error - for await (const { content, path, mode, mtime } of source) { - let fileSuffix = '' - const type = content ? 'file' : 'dir' + /** + * @param {Uint8Array} input + * @returns {Await>} + */ + digest (input) { + if (input instanceof Uint8Array) { + const result = this.encode(input) + return result instanceof Uint8Array + ? uint8arrays_node_modules_multiformats_src_hashes_digest_create(this.code, result) + /* c8 ignore next 1 */ + : result.then(digest => uint8arrays_node_modules_multiformats_src_hashes_digest_create(this.code, digest)) + } else { + throw Error('Unknown type, must be binary type') + /* c8 ignore next 1 */ + } + } +} - if (index > 0) { - yield '\r\n' +/** + * @template {number} Alg + * @typedef {import('./interface.js').MultihashHasher} MultihashHasher + */ - fileSuffix = `-${index}` - } +/** + * @template T + * @typedef {Promise|T} Await + */ - let fieldName = type + fileSuffix - const qs = [] +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/hashes/sha2.js +// @ts-check - if (mode !== null && mode !== undefined) { - qs.push(`mode=${mode_to_string_modeToString(mode)}`) - } - if (mtime != null) { - const { secs, nsecs } = mtime - qs.push(`mtime=${secs}`) - if (nsecs != null) { - qs.push(`mtime-nsecs=${nsecs}`) - } - } - if (qs.length) { - fieldName = `${fieldName}?${qs.join('&')}` - } +const src_hashes_sha2_sha256 = multiformats_src_hashes_hasher_from({ + name: 'sha2-256', + code: 0x12, + encode: (input) => uint8arrays_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha256').update(input).digest()) +}) - yield `--${boundary}\r\n` - yield `Content-Disposition: form-data; name="${fieldName}"; filename="${encodeURIComponent(path || '')}"\r\n` - yield `Content-Type: ${content ? 'application/octet-stream' : 'application/x-directory'}\r\n` - yield '\r\n' +const hashes_sha2_sha512 = multiformats_src_hashes_hasher_from({ + name: 'sha2-512', + code: 0x13, + encode: input => uint8arrays_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha512').update(input).digest()) +}) - if (content) { - yield * content - } +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/cid.js - index++ - } - } catch (/** @type {any} */ err) { - multipart_request_node_log(err) - // workaround for https://github.com/node-fetch/node-fetch/issues/753 - abortController.abort() - } finally { - yield `\r\n--${boundary}--\r\n` - } - } - // peek at the first value in order to get the input stream moving - // and to validate its contents. - // We cannot do this in the `for await..of` in streamFiles due to - // https://github.com/node-fetch/node-fetch/issues/753 - const peekable = peekableIterator(normaliseInput(source)) - /** @type {any} value **/ - const { value, done } = await peekable.peek() - if (!done) { - peekable.push(value) +// Linter can see that API is used in types. +// eslint-disable-next-line + + + +// This way TS will also expose all the types from module + + +/** + * @template {API.Link} T + * @template {string} Prefix + * @param {T} link + * @param {API.MultibaseEncoder} [base] + * @returns {API.ToString} + */ +const uint8arrays_node_modules_multiformats_src_cid_format = (link, base) => { + const { bytes, version } = link + switch (version) { + case 0: + return uint8arrays_node_modules_multiformats_src_cid_toStringV0( + bytes, + uint8arrays_node_modules_multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder<"z">} */ (base) || base58btc.encoder + ) + default: + return uint8arrays_node_modules_multiformats_src_cid_toStringV1( + bytes, + uint8arrays_node_modules_multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder} */ (base || base32.encoder) + ) } +} - return { - parts: null, - total: -1, - headers: multipart_request_node_merge(headers, { - 'Content-Type': `multipart/form-data; boundary=${boundary}` - }), - // @ts-expect-error normaliseInput returns unixfs importer import candidates - body: it_to_stream_src(streamFiles(peekable)) +/** + * @template {API.UnknownLink} Link + * @param {Link} link + * @returns {API.LinkJSON} + */ +const uint8arrays_node_modules_multiformats_src_cid_toJSON = (link) => ({ + '/': uint8arrays_node_modules_multiformats_src_cid_format(link) +}) + +/** + * @template {API.UnknownLink} Link + * @param {API.LinkJSON} json + */ +const uint8arrays_node_modules_multiformats_src_cid_fromJSON = (json) => + uint8arrays_node_modules_multiformats_src_cid_CID.parse(json['/']) + +/** @type {WeakMap>} */ +const uint8arrays_node_modules_multiformats_src_cid_cache = new WeakMap() + +/** + * @param {API.UnknownLink} cid + * @returns {Map} + */ +const uint8arrays_node_modules_multiformats_src_cid_baseCache = cid => { + const baseCache = uint8arrays_node_modules_multiformats_src_cid_cache.get(cid) + if (baseCache == null) { + const baseCache = new Map() + uint8arrays_node_modules_multiformats_src_cid_cache.set(cid, baseCache) + return baseCache } + return baseCache } -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/files/normalise-content.browser.js - - - - - - /** - * @param {import('ipfs-core-types/src/utils').ToContent} input + * @template {unknown} [Data=unknown] + * @template {number} [Format=number] + * @template {number} [Alg=number] + * @template {API.Version} [Version=API.Version] + * @implements {API.Link} */ -async function normalise_content_browser_normaliseContent (input) { - // Bytes - if (isBytes(input)) { - return new Blob([input]) - } - // String - if (typeof input === 'string' || input instanceof String) { - return new Blob([input.toString()]) +class uint8arrays_node_modules_multiformats_src_cid_CID { + /** + * @param {Version} version - Version of the CID + * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content. + * @param {Uint8Array} bytes + */ + constructor (version, code, multihash, bytes) { + /** @readonly */ + this.code = code + /** @readonly */ + this.version = version + /** @readonly */ + this.multihash = multihash + /** @readonly */ + this.bytes = bytes + + // flag to serializers that this is a CID and + // should be treated specially + /** @readonly */ + this['/'] = bytes } - // Blob | File - if (isBlob(input)) { - return input + /** + * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` + * please either use `CID.asCID(cid)` or switch to new signalling mechanism + * + * @deprecated + */ + get asCID () { + return this } - // Browser stream - if (isReadableStream(input)) { - input = browserReadableStreamToIt(input) + // ArrayBufferView + get byteOffset () { + return this.bytes.byteOffset } - // (Async)Iterator - if (Symbol.iterator in input || Symbol.asyncIterator in input) { - /** @type {any} peekable */ - const peekable = peekableIterator(input) + // ArrayBufferView + get byteLength () { + return this.bytes.byteLength + } - /** @type {any} value **/ - const { value, done } = await peekable.peek() + /** + * @returns {CID} + */ + toV0 () { + switch (this.version) { + case 0: { + return /** @type {CID} */ (this) + } + case 1: { + const { code, multihash } = this - if (done) { - // make sure empty iterators result in empty files - return itToBlob(peekable) - } + if (code !== uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE) { + throw new Error('Cannot convert a non dag-pb CID to CIDv0') + } - peekable.push(value) + // sha2-256 + if (multihash.code !== uint8arrays_node_modules_multiformats_src_cid_SHA_256_CODE) { + throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') + } - // (Async)Iterable - if (Number.isInteger(value)) { - return new Blob([Uint8Array.from(await src_all(peekable))]) + return /** @type {CID} */ ( + uint8arrays_node_modules_multiformats_src_cid_CID.createV0( + /** @type {API.MultihashDigest} */ (multihash) + ) + ) + } + default: { + throw Error( + `Can not convert CID version ${this.version} to version 0. This is a bug please report` + ) + } } + } - // (Async)Iterable - if (isBytes(value) || typeof value === 'string' || value instanceof String) { - return itToBlob(peekable) + /** + * @returns {CID} + */ + toV1 () { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash + const multihash = Digest.create(code, digest) + return /** @type {CID} */ ( + uint8arrays_node_modules_multiformats_src_cid_CID.createV1(this.code, multihash) + ) + } + case 1: { + return /** @type {CID} */ (this) + } + default: { + throw Error( + `Can not convert CID version ${this.version} to version 1. This is a bug please report` + ) + } } } - throw err_code(new Error(`Unexpected input: ${input}`), 'ERR_UNEXPECTED_INPUT') -} - -/** - * @param {AsyncIterable|Iterable} stream - */ -async function itToBlob (stream) { - const parts = [] + /** + * @param {unknown} other + * @returns {other is CID} + */ + equals (other) { + return uint8arrays_node_modules_multiformats_src_cid_CID.equals(this, other) + } - for await (const chunk of stream) { - parts.push(chunk) + /** + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @param {API.Link} self + * @param {unknown} other + * @returns {other is CID} + */ + static equals (self, other) { + const unknown = + /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ ( + other + ) + return ( + unknown && + self.code === unknown.code && + self.version === unknown.version && + Digest.equals(self.multihash, unknown.multihash) + ) } - return new Blob(parts) -} + /** + * @param {API.MultibaseEncoder} [base] + * @returns {string} + */ + toString (base) { + return uint8arrays_node_modules_multiformats_src_cid_format(this, base) + } -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/files/normalise-input-multiple.browser.js + /** + * @returns {API.LinkJSON} + */ + toJSON () { + return { '/': uint8arrays_node_modules_multiformats_src_cid_format(this) } + } + link () { + return this + } + get [Symbol.toStringTag] () { + return 'CID' + } -/** - * @typedef {import('ipfs-core-types/src/utils').ImportCandidateStream} ImportCandidateStream - * @typedef {import('ipfs-core-types/src/utils').BrowserImportCandidate} BrowserImportCandidate - */ + // Legacy -/** - * Transforms any of the `ipfs.addAll` input types into - * - * ``` - * AsyncIterable<{ path, mode, mtime, content: Blob }> - * ``` - * - * See https://github.com/ipfs/js-ipfs/blob/master/docs/core-api/FILES.md#ipfsadddata-options - * - * @param {ImportCandidateStream} input - * @returns {AsyncGenerator} - */ -function normalise_input_multiple_browser_normaliseInput (input) { - // @ts-expect-error browser normaliseContent returns a Blob not an AsyncIterable - return normaliseCandidateMultiple(input, normalise_content_browser_normaliseContent, true) -} + [Symbol.for('nodejs.util.inspect.custom')] () { + return `CID(${this.toString()})` + } -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/multipart-request.browser.js + /** + * Takes any input `value` and returns a `CID` instance if it was + * a `CID` otherwise returns `null`. If `value` is instanceof `CID` + * it will return value back. If `value` is not instance of this CID + * class, but is compatible CID it will return new instance of this + * `CID` class. Otherwise returns null. + * + * This allows two different incompatible versions of CID library to + * co-exist and interop as long as binary interface is compatible. + * + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @template {unknown} U + * @param {API.Link|U} input + * @returns {CID|null} + */ + static asCID (input) { + if (input == null) { + return null + } -// Import browser version otherwise electron-renderer will end up with node -// version and fail. + const value = /** @type {any} */ (input) + if (value instanceof uint8arrays_node_modules_multiformats_src_cid_CID) { + // If value is instance of CID then we're all set. + return value + } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { + // If value isn't instance of this CID class but `this.asCID === this` or + // `value['/'] === value.bytes` is true it is CID instance coming from a + // different implementation (diff version or duplicate). In that case we + // rebase it to this `CID` implementation so caller is guaranteed to get + // instance with expected API. + const { version, code, multihash, bytes } = value + return new uint8arrays_node_modules_multiformats_src_cid_CID( + version, + code, + /** @type {API.MultihashDigest} */ (multihash), + bytes || uint8arrays_node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes) + ) + } else if (value[uint8arrays_node_modules_multiformats_src_cid_cidSymbol] === true) { + // If value is a CID from older implementation that used to be tagged via + // symbol we still rebase it to the this `CID` implementation by + // delegating that to a constructor. + const { version, multihash, code } = value + const digest = + /** @type {API.MultihashDigest} */ + (Digest.decode(multihash)) + return uint8arrays_node_modules_multiformats_src_cid_CID.create(version, code, digest) + } else { + // Otherwise value is not a CID (or an incompatible version of it) in + // which case we return `null`. + return null + } + } + /** + * + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @param {Version} version - Version of the CID + * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param {API.MultihashDigest} digest - (Multi)hash of the of the content. + * @returns {CID} + */ + static create (version, code, digest) { + if (typeof code !== 'number') { + throw new Error('String codecs are no longer supported') + } + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error('Invalid digest') + } -/** - * @typedef {import('ipfs-core-types/src/utils').ImportCandidateStream} ImportCandidateStream - */ + switch (version) { + case 0: { + if (code !== uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE) { + throw new Error( + `Version 0 CID must use dag-pb (code: ${uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding` + ) + } else { + return new uint8arrays_node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes) + } + } + case 1: { + const bytes = uint8arrays_node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes) + return new uint8arrays_node_modules_multiformats_src_cid_CID(version, code, digest, bytes) + } + default: { + throw new Error('Invalid version') + } + } + } -/** - * @param {ImportCandidateStream} source - * @param {AbortController} abortController - * @param {Headers|Record} [headers] - */ -async function multipart_request_browser_multipartRequest (source, abortController, headers = {}) { - const parts = [] - const formData = new FormData() - let index = 0 - let total = 0 + /** + * Simplified version of `create` for CIDv0. + * + * @template {unknown} [T=unknown] + * @param {API.MultihashDigest} digest - Multihash. + * @returns {CID} + */ + static createV0 (digest) { + return uint8arrays_node_modules_multiformats_src_cid_CID.create(0, uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE, digest) + } - for await (const { content, path, mode, mtime } of normalise_input_multiple_browser_normaliseInput(source)) { - let fileSuffix = '' - const type = content ? 'file' : 'dir' + /** + * Simplified version of `create` for CIDv1. + * + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @param {Code} code - Content encoding format code. + * @param {API.MultihashDigest} digest - Miltihash of the content. + * @returns {CID} + */ + static createV1 (code, digest) { + return uint8arrays_node_modules_multiformats_src_cid_CID.create(1, code, digest) + } - if (index > 0) { - fileSuffix = `-${index}` + /** + * Decoded a CID from its binary representation. The byte array must contain + * only the CID with no additional bytes. + * + * An error will be thrown if the bytes provided do not contain a valid + * binary representation of a CID. + * + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ByteView>} bytes + * @returns {CID} + */ + static decode (bytes) { + const [cid, remainder] = uint8arrays_node_modules_multiformats_src_cid_CID.decodeFirst(bytes) + if (remainder.length) { + throw new Error('Incorrect length') } + return cid + } - let fieldName = type + fileSuffix - const qs = [] - - if (mode !== null && mode !== undefined) { - qs.push(`mode=${mode_to_string_modeToString(mode)}`) + /** + * Decoded a CID from its binary representation at the beginning of a byte + * array. + * + * Returns an array with the first element containing the CID and the second + * element containing the remainder of the original byte array. The remainder + * will be a zero-length byte array if the provided bytes only contained a + * binary CID representation. + * + * @template {unknown} T + * @template {number} C + * @template {number} A + * @template {API.Version} V + * @param {API.ByteView>} bytes + * @returns {[CID, Uint8Array]} + */ + static decodeFirst (bytes) { + const specs = uint8arrays_node_modules_multiformats_src_cid_CID.inspectBytes(bytes) + const prefixSize = specs.size - specs.multihashSize + const multihashBytes = coerce( + bytes.subarray(prefixSize, prefixSize + specs.multihashSize) + ) + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error('Incorrect length') } + const digestBytes = multihashBytes.subarray( + specs.multihashSize - specs.digestSize + ) + const digest = new Digest.Digest( + specs.multihashCode, + specs.digestSize, + digestBytes, + multihashBytes + ) + const cid = + specs.version === 0 + ? uint8arrays_node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) + : uint8arrays_node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest) + return [/** @type {CID} */(cid), bytes.subarray(specs.size)] + } - if ((mtime) != null) { - const { secs, nsecs } = (mtime) - - qs.push(`mtime=${secs}`) - - if (nsecs != null) { - qs.push(`mtime-nsecs=${nsecs}`) - } + /** + * Inspect the initial bytes of a CID to determine its properties. + * + * Involves decoding up to 4 varints. Typically this will require only 4 to 6 + * bytes but for larger multicodec code values and larger multihash digest + * lengths these varints can be quite large. It is recommended that at least + * 10 bytes be made available in the `initialBytes` argument for a complete + * inspection. + * + * @template {unknown} T + * @template {number} C + * @template {number} A + * @template {API.Version} V + * @param {API.ByteView>} initialBytes + * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }} + */ + static inspectBytes (initialBytes) { + let offset = 0 + const next = () => { + const [i, length] = varint.decode(initialBytes.subarray(offset)) + offset += length + return i } - if (qs.length) { - fieldName = `${fieldName}?${qs.join('&')}` + let version = /** @type {V} */ (next()) + let codec = /** @type {C} */ (uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE) + if (/** @type {number} */(version) === 18) { + // CIDv0 + version = /** @type {V} */ (0) + offset = 0 + } else { + codec = /** @type {C} */ (next()) } - if (content) { - formData.set(fieldName, content, path != null ? encodeURIComponent(path) : undefined) - const end = total + content.size - parts.push({ name: path, start: total, end }) - total = end - } else if (path != null) { - formData.set(fieldName, new File([''], encodeURIComponent(path), { type: 'application/x-directory' })) - } else { - throw new Error('path or content or both must be set') + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`) } - index++ - } + const prefixSize = offset + const multihashCode = /** @type {A} */ (next()) // multihash code + const digestSize = next() // multihash length + const size = offset + digestSize + const multihashSize = size - prefixSize - return { - total, - parts, - headers, - body: formData + return { version, codec, multihashCode, digestSize, multihashSize, size } } -} -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/multipart-request.js + /** + * Takes cid in a string representation and creates an instance. If `base` + * decoder is not provided will use a default from the configuration. It will + * throw an error if encoding of the CID is not compatible with supplied (or + * a default decoder). + * + * @template {string} Prefix + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ToString, Prefix>} source + * @param {API.MultibaseDecoder} [base] + * @returns {CID} + */ + static parse (source, base) { + const [prefix, bytes] = uint8arrays_node_modules_multiformats_src_cid_parseCIDtoBytes(source, base) + const cid = uint8arrays_node_modules_multiformats_src_cid_CID.decode(bytes) + if (cid.version === 0 && source[0] !== 'Q') { + throw Error('Version 0 CID string must not include multibase prefix') + } + // Cache string representation to avoid computing it on `this.toString()` + uint8arrays_node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source) + return cid + } +} /** - * @typedef {import('ipfs-core-types/src/utils').ImportCandidateStream} ImportCandidateStream + * @template {string} Prefix + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ToString, Prefix>} source + * @param {API.MultibaseDecoder} [base] + * @returns {[Prefix, API.ByteView>]} */ +const uint8arrays_node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => { + switch (source[0]) { + // CIDv0 is parsed differently + case 'Q': { + const decoder = base || base58btc + return [ + /** @type {Prefix} */ (base58btc.prefix), + decoder.decode(`${base58btc.prefix}${source}`) + ] + } + case base58btc.prefix: { + const decoder = base || base58btc + return [/** @type {Prefix} */(base58btc.prefix), decoder.decode(source)] + } + case base32.prefix: { + const decoder = base || base32 + return [/** @type {Prefix} */(base32.prefix), decoder.decode(source)] + } + default: { + if (base == null) { + throw Error( + 'To parse non base32 or base58btc encoded CID multibase decoder must be provided' + ) + } + return [/** @type {Prefix} */(source[0]), base.decode(source)] + } + } +} /** - * @param {ImportCandidateStream} source - * @param {AbortController} abortController - * @param {Headers|Record} [headers] - * @param {string} [boundary] + * + * @param {Uint8Array} bytes + * @param {Map} cache + * @param {API.MultibaseEncoder<'z'>} base */ -async function multipart_request_multipartRequest (source, abortController, headers = {}, boundary = `-----------------------------${nanoid()}`) { - let req = multipartRequest - - // In electron-renderer we use native fetch and should encode body using native - // form data. - if (env.isElectronRenderer) { - // @ts-expect-error types are different - req = multipart_request_browser_multipartRequest +const uint8arrays_node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => { + const { prefix } = base + if (prefix !== base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base.name} encoding`) } - return req(source, abortController, headers, boundary) + const cid = cache.get(prefix) + if (cid == null) { + const cid = base.encode(bytes).slice(1) + cache.set(prefix, cid) + return cid + } else { + return cid + } } -// EXTERNAL MODULE: ./node_modules/any-signal/index.js -var any_signal = __nccwpck_require__(28332); -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/abort-signal.js - - /** - * @param {any[]} signals - * @returns {AbortSignal[]} + * @template {string} Prefix + * @param {Uint8Array} bytes + * @param {Map} cache + * @param {API.MultibaseEncoder} base */ -function abort_signal_filter (signals) { - return signals.filter(Boolean) +const uint8arrays_node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => { + const { prefix } = base + const cid = cache.get(prefix) + if (cid == null) { + const cid = base.encode(bytes) + cache.set(prefix, cid) + return cid + } else { + return cid + } } +const uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70 +const uint8arrays_node_modules_multiformats_src_cid_SHA_256_CODE = 0x12 + /** - * @param {...AbortSignal|undefined} signals + * @param {API.Version} version + * @param {number} code + * @param {Uint8Array} multihash + * @returns {Uint8Array} */ -function abortSignal (...signals) { - return (0,any_signal.anySignal)(abort_signal_filter(signals)) +const uint8arrays_node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => { + const codeOffset = varint.encodingLength(version) + const hashOffset = codeOffset + varint.encodingLength(code) + const bytes = new Uint8Array(hashOffset + multihash.byteLength) + varint.encodeTo(version, bytes, 0) + varint.encodeTo(code, bytes, codeOffset) + bytes.set(multihash, hashOffset) + return bytes } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/block/put.js +const uint8arrays_node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/index.js -const createPut = configure((api, configOptions) => { - /** - * @type {import('../types').BlockAPI["put"]} - * @see https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-block-put - */ - async function put (data, options = {}) { - // allow aborting requests on body errors - const controller = new AbortController() - const signal = abortSignal(controller.signal, options.signal) - let res - try { - const response = await api.post('block/put', { - signal, - searchParams: toUrlSearchParams(options), - ...( - await multipart_request_multipartRequest([data], controller, options.headers) - ) - }) - res = await response.json() - } catch (/** @type {any} */ err) { - // Retry with "protobuf"/"cbor" format for go-ipfs - // TODO: remove when https://github.com/ipfs/go-cid/issues/75 resolved - if (options.format === 'dag-pb') { - return put(data, { ...options, format: 'protobuf' }) - } else if (options.format === 'dag-cbor') { - return put(data, { ...options, format: 'cbor' }) - } +// This way TS will also expose all the types from module - throw err - } - return node_modules_multiformats_src_cid_CID.parse(res.Key) - } - return put -}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/block/rm.js +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/node_modules/multiformats/src/basics.js +// @ts-check -const createRm = configure(api => { - /** - * @type {import('../types').BlockAPI["rm"]} - */ - async function * rm (cid, options = {}) { - if (!Array.isArray(cid)) { - cid = [cid] - } - const res = await api.post('block/rm', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: cid.map(cid => cid.toString()), - 'stream-channels': true, - ...options - }), - headers: options.headers - }) - for await (const removed of res.ndjson()) { - yield rm_toCoreInterface(removed) - } - } - return rm -}) -/** - * @param {*} removed - */ -function rm_toCoreInterface (removed) { - /** @type {import('../types').RmResult} */ - const out = { - cid: node_modules_multiformats_src_cid_CID.parse(removed.Hash) - } - if (removed.Error) { - out.error = new Error(removed.Error) - } - return out -} -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/block/stat.js -const stat_createStat = configure(api => { - /** - * @type {import('../types').BlockAPI["stat"]} - */ - async function stat (cid, options = {}) { - const res = await api.post('block/stat', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: cid.toString(), - ...options - }), - headers: options.headers - }) - const data = await res.json() - return { cid: node_modules_multiformats_src_cid_CID.parse(data.Key), size: data.Size } - } - return stat -}) +const src_basics_bases = { ...multiformats_src_bases_identity_namespaceObject, ...src_bases_base2_namespaceObject, ...src_bases_base8_namespaceObject, ...src_bases_base10_namespaceObject, ...src_bases_base16_namespaceObject, ...uint8arrays_node_modules_multiformats_src_bases_base32_namespaceObject, ...src_bases_base36_namespaceObject, ...uint8arrays_node_modules_multiformats_src_bases_base58_namespaceObject, ...multiformats_src_bases_base64_namespaceObject, ...src_bases_base256emoji_namespaceObject } +const src_basics_hashes = { ...src_hashes_sha2_namespaceObject, ...src_hashes_identity_namespaceObject } +const src_basics_codecs = { raw: src_codecs_raw_namespaceObject, json: multiformats_src_codecs_json_namespaceObject } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/block/index.js +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/dist/src/util/as-uint8array.js +/** + * To guarantee Uint8Array semantics, convert nodejs Buffers + * into vanilla Uint8Arrays + */ +function src_util_as_uint8array_asUint8Array(buf) { + if (globalThis.Buffer != null) { + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); + } + return buf; +} +//# sourceMappingURL=as-uint8array.js.map +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/dist/src/alloc.js + +/** + * Returns a `Uint8Array` of the requested size. Referenced memory will + * be initialized to 0. + */ +function dist_src_alloc_alloc(size = 0) { + if (globalThis.Buffer?.alloc != null) { + return asUint8Array(globalThis.Buffer.alloc(size)); + } + return new Uint8Array(size); +} +/** + * Where possible returns a Uint8Array of the requested size that references + * uninitialized memory. Only use if you are certain you will immediately + * overwrite every value in the returned `Uint8Array`. + */ +function src_alloc_allocUnsafe(size = 0) { + if (globalThis.Buffer?.allocUnsafe != null) { + return src_util_as_uint8array_asUint8Array(globalThis.Buffer.allocUnsafe(size)); + } + return new Uint8Array(size); +} +//# sourceMappingURL=alloc.js.map +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/dist/src/util/bases.js +function bases_createCodec(name, prefix, encode, decode) { + return { + name, + prefix, + encoder: { + name, + prefix, + encode + }, + decoder: { + decode + } + }; +} +const bases_string = bases_createCodec('utf8', 'u', (buf) => { + const decoder = new TextDecoder('utf8'); + return 'u' + decoder.decode(buf); +}, (str) => { + const encoder = new TextEncoder(); + return encoder.encode(str.substring(1)); +}); +const bases_ascii = bases_createCodec('ascii', 'a', (buf) => { + let string = 'a'; + for (let i = 0; i < buf.length; i++) { + string += String.fromCharCode(buf[i]); + } + return string; +}, (str) => { + str = str.substring(1); + const buf = src_alloc_allocUnsafe(str.length); + for (let i = 0; i < str.length; i++) { + buf[i] = str.charCodeAt(i); + } + return buf; +}); +const bases_BASES = { + utf8: bases_string, + 'utf-8': bases_string, + hex: src_basics_bases.base16, + latin1: bases_ascii, + ascii: bases_ascii, + binary: bases_ascii, + ...src_basics_bases +}; +/* harmony default export */ const src_util_bases = (bases_BASES); +//# sourceMappingURL=bases.js.map +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/dist/src/to-string.js /** - * @param {import('../types').Options} config + * Turns a `Uint8Array` into a string. + * + * Supports `utf8`, `utf-8` and any encoding supported by the multibase module. + * + * Also `ascii` which is similar to node's 'binary' encoding. */ -function createBlock (config) { - return { - get: createGet(config), - put: createPut(config), - rm: createRm(config), - stat: stat_createStat(config) - } +function src_to_string_toString(array, encoding = 'utf8') { + const base = src_util_bases[encoding]; + if (base == null) { + throw new Error(`Unsupported encoding "${encoding}"`); + } + if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) { + return globalThis.Buffer.from(array.buffer, array.byteOffset, array.byteLength).toString('utf8'); + } + // strip multibase prefix + return base.encoder.encode(array).substring(1); } - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/bootstrap/add.js +//# sourceMappingURL=to-string.js.map +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/@multiformats/multiaddr/dist/src/ip.js +const ip_isV4 = external_node_net_namespaceObject.isIPv4; +const ip_isV6 = external_node_net_namespaceObject.isIPv6; +// Copied from https://github.com/indutny/node-ip/blob/master/lib/ip.js#L7 +// but with buf/offset args removed because we don't use them +const src_ip_toBytes = function (ip) { + let offset = 0; + ip = ip.toString().trim(); + if (ip_isV4(ip)) { + const bytes = new Uint8Array(offset + 4); + ip.split(/\./g).forEach((byte) => { + bytes[offset++] = parseInt(byte, 10) & 0xff; + }); + return bytes; + } + if (ip_isV6(ip)) { + const sections = ip.split(':', 8); + let i; + for (i = 0; i < sections.length; i++) { + const isv4 = ip_isV4(sections[i]); + let v4Buffer; + if (isv4) { + v4Buffer = src_ip_toBytes(sections[i]); + sections[i] = src_to_string_toString(v4Buffer.slice(0, 2), 'base16'); + } + if (v4Buffer != null && ++i < 8) { + sections.splice(i, 0, src_to_string_toString(v4Buffer.slice(2, 4), 'base16')); + } + } + if (sections[0] === '') { + while (sections.length < 8) + sections.unshift('0'); + } + else if (sections[sections.length - 1] === '') { + while (sections.length < 8) + sections.push('0'); + } + else if (sections.length < 8) { + for (i = 0; i < sections.length && sections[i] !== ''; i++) + ; + const argv = [i, 1]; + for (i = 9 - sections.length; i > 0; i--) { + argv.push('0'); + } + sections.splice.apply(sections, argv); + } + const bytes = new Uint8Array(offset + 16); + for (i = 0; i < sections.length; i++) { + const word = parseInt(sections[i], 16); + bytes[offset++] = (word >> 8) & 0xff; + bytes[offset++] = word & 0xff; + } + return bytes; + } + throw new Error('invalid ip address'); +}; +// Copied from https://github.com/indutny/node-ip/blob/master/lib/ip.js#L63 +const src_ip_toString = function (buf, offset = 0, length) { + offset = ~~offset; + length = length ?? (buf.length - offset); + const view = new DataView(buf.buffer); + if (length === 4) { + const result = []; + // IPv4 + for (let i = 0; i < length; i++) { + result.push(buf[offset + i]); + } + return result.join('.'); + } + if (length === 16) { + const result = []; + // IPv6 + for (let i = 0; i < length; i += 2) { + result.push(view.getUint16(offset + i).toString(16)); + } + return result.join(':') + .replace(/(^|:)0(:0)*:0(:|$)/, '$1::$3') + .replace(/:{3,4}/, '::'); + } + return ''; +}; +//# sourceMappingURL=ip.js.map +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/@multiformats/multiaddr/dist/src/protocols-table.js +const protocols_table_V = -1; +const protocols_table_names = {}; +const protocols_table_codes = {}; +const protocols_table_table = [ + [4, 32, 'ip4'], + [6, 16, 'tcp'], + [33, 16, 'dccp'], + [41, 128, 'ip6'], + [42, protocols_table_V, 'ip6zone'], + [43, 8, 'ipcidr'], + [53, protocols_table_V, 'dns', true], + [54, protocols_table_V, 'dns4', true], + [55, protocols_table_V, 'dns6', true], + [56, protocols_table_V, 'dnsaddr', true], + [132, 16, 'sctp'], + [273, 16, 'udp'], + [275, 0, 'p2p-webrtc-star'], + [276, 0, 'p2p-webrtc-direct'], + [277, 0, 'p2p-stardust'], + [280, 0, 'webrtc'], + [281, 0, 'webrtc-w3c'], + [290, 0, 'p2p-circuit'], + [301, 0, 'udt'], + [302, 0, 'utp'], + [400, protocols_table_V, 'unix', false, true], + // `ipfs` is added before `p2p` for legacy support. + // All text representations will default to `p2p`, but `ipfs` will + // still be supported + [421, protocols_table_V, 'ipfs'], + // `p2p` is the preferred name for 421, and is now the default + [421, protocols_table_V, 'p2p'], + [443, 0, 'https'], + [444, 96, 'onion'], + [445, 296, 'onion3'], + [446, protocols_table_V, 'garlic64'], + [448, 0, 'tls'], + [449, protocols_table_V, 'sni'], + [460, 0, 'quic'], + [461, 0, 'quic-v1'], + [465, 0, 'webtransport'], + [466, protocols_table_V, 'certhash'], + [477, 0, 'ws'], + [478, 0, 'wss'], + [479, 0, 'p2p-websocket-star'], + [480, 0, 'http'], + [777, protocols_table_V, 'memory'] +]; +// populate tables +protocols_table_table.forEach(row => { + const proto = protocols_table_createProtocol(...row); + protocols_table_codes[proto.code] = proto; + protocols_table_names[proto.name] = proto; +}); +function protocols_table_createProtocol(code, size, name, resolvable, path) { + return { + code, + size, + name, + resolvable: Boolean(resolvable), + path: Boolean(path) + }; +} +/** + * For the passed proto string or number, return a {@link Protocol} + * + * @example + * + * ```js + * import { protocol } from '@multiformats/multiaddr' + * + * console.info(protocol(4)) + * // { code: 4, size: 32, name: 'ip4', resolvable: false, path: false } + * ``` + */ +function src_protocols_table_getProtocol(proto) { + if (typeof proto === 'number') { + if (protocols_table_codes[proto] != null) { + return protocols_table_codes[proto]; + } + throw new Error(`no protocol with code: ${proto}`); + } + else if (typeof proto === 'string') { + if (protocols_table_names[proto] != null) { + return protocols_table_names[proto]; + } + throw new Error(`no protocol with name: ${proto}`); + } + throw new Error(`invalid protocol id type: ${typeof proto}`); +} +//# sourceMappingURL=protocols-table.js.map +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/vendor/varint.js +var ipfs_core_utils_node_modules_multiformats_vendor_varint_encode_1 = ipfs_core_utils_node_modules_multiformats_vendor_varint_encode; -const createAdd = configure(api => { - /** - * @type {import('../types').BootstrapAPI["add"]} - */ - async function add (addr, options = {}) { - const res = await api.post('bootstrap/add', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: addr, - ...options - }), - headers: options.headers - }) +var ipfs_core_utils_node_modules_multiformats_vendor_varint_MSB = 0x80 + , ipfs_core_utils_node_modules_multiformats_vendor_varint_REST = 0x7F + , ipfs_core_utils_node_modules_multiformats_vendor_varint_MSBALL = ~ipfs_core_utils_node_modules_multiformats_vendor_varint_REST + , ipfs_core_utils_node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31); - const { Peers } = await res.json() +function ipfs_core_utils_node_modules_multiformats_vendor_varint_encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; - return { Peers: Peers.map((/** @type {string} */ ma) => src_multiaddr(ma)) } + while(num >= ipfs_core_utils_node_modules_multiformats_vendor_varint_INT) { + out[offset++] = (num & 0xFF) | ipfs_core_utils_node_modules_multiformats_vendor_varint_MSB; + num /= 128; + } + while(num & ipfs_core_utils_node_modules_multiformats_vendor_varint_MSBALL) { + out[offset++] = (num & 0xFF) | ipfs_core_utils_node_modules_multiformats_vendor_varint_MSB; + num >>>= 7; } + out[offset] = num | 0; + + ipfs_core_utils_node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; + + return out +} - return add -}) +var ipfs_core_utils_node_modules_multiformats_vendor_varint_decode = ipfs_core_utils_node_modules_multiformats_vendor_varint_read; -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/bootstrap/list.js +var ipfs_core_utils_node_modules_multiformats_vendor_varint_MSB$1 = 0x80 + , ipfs_core_utils_node_modules_multiformats_vendor_varint_REST$1 = 0x7F; +function ipfs_core_utils_node_modules_multiformats_vendor_varint_read(buf, offset) { + var res = 0 + , offset = offset || 0 + , shift = 0 + , counter = offset + , b + , l = buf.length; + do { + if (counter >= l) { + ipfs_core_utils_node_modules_multiformats_vendor_varint_read.bytes = 0; + throw new RangeError('Could not decode varint') + } + b = buf[counter++]; + res += shift < 28 + ? (b & ipfs_core_utils_node_modules_multiformats_vendor_varint_REST$1) << shift + : (b & ipfs_core_utils_node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= ipfs_core_utils_node_modules_multiformats_vendor_varint_MSB$1) + ipfs_core_utils_node_modules_multiformats_vendor_varint_read.bytes = counter - offset; -const createList = configure(api => { - /** - * @type {import('../types').BootstrapAPI["list"]} - */ - async function list (options = {}) { - const res = await api.post('bootstrap/list', { - signal: options.signal, - searchParams: toUrlSearchParams(options), - headers: options.headers - }) + return res +} - const { Peers } = await res.json() +var ipfs_core_utils_node_modules_multiformats_vendor_varint_N1 = Math.pow(2, 7); +var ipfs_core_utils_node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14); +var ipfs_core_utils_node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21); +var ipfs_core_utils_node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28); +var ipfs_core_utils_node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35); +var ipfs_core_utils_node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42); +var ipfs_core_utils_node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49); +var ipfs_core_utils_node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56); +var ipfs_core_utils_node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63); - return { Peers: Peers.map((/** @type {string} */ ma) => src_multiaddr(ma)) } - } +var ipfs_core_utils_node_modules_multiformats_vendor_varint_length = function (value) { + return ( + value < ipfs_core_utils_node_modules_multiformats_vendor_varint_N1 ? 1 + : value < ipfs_core_utils_node_modules_multiformats_vendor_varint_N2 ? 2 + : value < ipfs_core_utils_node_modules_multiformats_vendor_varint_N3 ? 3 + : value < ipfs_core_utils_node_modules_multiformats_vendor_varint_N4 ? 4 + : value < ipfs_core_utils_node_modules_multiformats_vendor_varint_N5 ? 5 + : value < ipfs_core_utils_node_modules_multiformats_vendor_varint_N6 ? 6 + : value < ipfs_core_utils_node_modules_multiformats_vendor_varint_N7 ? 7 + : value < ipfs_core_utils_node_modules_multiformats_vendor_varint_N8 ? 8 + : value < ipfs_core_utils_node_modules_multiformats_vendor_varint_N9 ? 9 + : 10 + ) +}; - return list -}) +var ipfs_core_utils_node_modules_multiformats_vendor_varint_varint = { + encode: ipfs_core_utils_node_modules_multiformats_vendor_varint_encode_1 + , decode: ipfs_core_utils_node_modules_multiformats_vendor_varint_decode + , encodingLength: ipfs_core_utils_node_modules_multiformats_vendor_varint_length +}; -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/bootstrap/rm.js +var ipfs_core_utils_node_modules_multiformats_vendor_varint_brrp_varint = ipfs_core_utils_node_modules_multiformats_vendor_varint_varint; +/* harmony default export */ const ipfs_core_utils_node_modules_multiformats_vendor_varint = (ipfs_core_utils_node_modules_multiformats_vendor_varint_brrp_varint); +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/varint.js -const rm_createRm = configure(api => { - /** - * @type {import('../types').BootstrapAPI["rm"]} - */ - async function rm (addr, options = {}) { - const res = await api.post('bootstrap/rm', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: addr, - ...options - }), - headers: options.headers - }) +/** + * @param {Uint8Array} data + * @param {number} [offset=0] + * @returns {[number, number]} + */ +const ipfs_core_utils_node_modules_multiformats_src_varint_decode = (data, offset = 0) => { + const code = ipfs_core_utils_node_modules_multiformats_vendor_varint.decode(data, offset) + return [code, ipfs_core_utils_node_modules_multiformats_vendor_varint.decode.bytes] +} - const { Peers } = await res.json() +/** + * @param {number} int + * @param {Uint8Array} target + * @param {number} [offset=0] + */ +const ipfs_core_utils_node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => { + ipfs_core_utils_node_modules_multiformats_vendor_varint.encode(int, target, offset) + return target +} - return { Peers: Peers.map((/** @type {string} */ ma) => src_multiaddr(ma)) } - } +/** + * @param {number} int + * @returns {number} + */ +const ipfs_core_utils_node_modules_multiformats_src_varint_encodingLength = (int) => { + return ipfs_core_utils_node_modules_multiformats_vendor_varint.encodingLength(int) +} - return rm -}) +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bytes.js +const ipfs_core_utils_node_modules_multiformats_src_bytes_empty = new Uint8Array(0) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/bootstrap/index.js +/** + * @param {Uint8Array} d + */ +const ipfs_core_utils_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') + +/** + * @param {string} hex + */ +const ipfs_core_utils_node_modules_multiformats_src_bytes_fromHex = hex => { + const hexes = hex.match(/../g) + return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : ipfs_core_utils_node_modules_multiformats_src_bytes_empty +} +/** + * @param {Uint8Array} aa + * @param {Uint8Array} bb + */ +const ipfs_core_utils_node_modules_multiformats_src_bytes_equals = (aa, bb) => { + if (aa === bb) return true + if (aa.byteLength !== bb.byteLength) { + return false + } + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false + } + } + return true +} /** - * @param {import('../types').Options} config + * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o + * @returns {Uint8Array} */ -function createBootstrap (config) { - return { - add: createAdd(config), - list: createList(config), - rm: rm_createRm(config) +const ipfs_core_utils_node_modules_multiformats_src_bytes_coerce = o => { + if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o + if (o instanceof ArrayBuffer) return new Uint8Array(o) + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) } + throw new Error('Unknown type, must be binary type') } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/config/profiles/apply.js +/** + * @param {any} o + * @returns {o is ArrayBuffer|ArrayBufferView} + */ +const ipfs_core_utils_node_modules_multiformats_src_bytes_isBinary = o => + o instanceof ArrayBuffer || ArrayBuffer.isView(o) +/** + * @param {string} str + * @returns {Uint8Array} + */ +const ipfs_core_utils_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) +/** + * @param {Uint8Array} b + * @returns {string} + */ +const ipfs_core_utils_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) -const createApply = configure(api => { - /** - * @type {import('../../types').ConfigProfilesAPI["apply"]} - */ - async function apply (profile, options = {}) { - const res = await api.post('config/profile/apply', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: profile, - ...options - }), - headers: options.headers - }) - const data = await res.json() - return { - original: data.OldCfg, updated: data.NewCfg - } - } - return apply -}) +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/hashes/digest.js -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/config/profiles/index.js /** - * @param {import('../../types').Options} config + * Creates a multihash digest. + * + * @template {number} Code + * @param {Code} code + * @param {Uint8Array} digest */ -function createProfiles (config) { - return { - apply: createApply(config) - } -} - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/config/get.js - +const ipfs_core_utils_node_modules_multiformats_src_hashes_digest_create = (code, digest) => { + const size = digest.byteLength + const sizeOffset = ipfs_core_utils_node_modules_multiformats_src_varint_encodingLength(code) + const digestOffset = sizeOffset + ipfs_core_utils_node_modules_multiformats_src_varint_encodingLength(size) + const bytes = new Uint8Array(digestOffset + size) + ipfs_core_utils_node_modules_multiformats_src_varint_encodeTo(code, bytes, 0) + ipfs_core_utils_node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset) + bytes.set(digest, digestOffset) -const get_createGet = configure(api => { - /** - * @type {import('../types.js').ConfigAPI["get"]} - */ - const get = async (key, options = {}) => { - if (!key) { - throw new Error('key argument is required') - } + return new ipfs_core_utils_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) +} - const res = await api.post('config', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: key, - ...options - }), - headers: options.headers - }) - const data = await res.json() +/** + * Turns bytes representation of multihash digest into an instance. + * + * @param {Uint8Array} multihash + * @returns {MultihashDigest} + */ +const ipfs_core_utils_node_modules_multiformats_src_hashes_digest_decode = (multihash) => { + const bytes = ipfs_core_utils_node_modules_multiformats_src_bytes_coerce(multihash) + const [code, sizeOffset] = ipfs_core_utils_node_modules_multiformats_src_varint_decode(bytes) + const [size, digestOffset] = ipfs_core_utils_node_modules_multiformats_src_varint_decode(bytes.subarray(sizeOffset)) + const digest = bytes.subarray(sizeOffset + digestOffset) - return data.Value + if (digest.byteLength !== size) { + throw new Error('Incorrect length') } - return get -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/config/get-all.js - - + return new ipfs_core_utils_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) +} -const createGetAll = configure(api => { - /** - * @type {import('../types.js').ConfigAPI["getAll"]} - */ - const getAll = async (options = {}) => { - const res = await api.post('config/show', { - signal: options.signal, - searchParams: toUrlSearchParams({ - ...options - }), - headers: options.headers - }) - const data = await res.json() +/** + * @param {MultihashDigest} a + * @param {unknown} b + * @returns {b is MultihashDigest} + */ +const ipfs_core_utils_node_modules_multiformats_src_hashes_digest_equals = (a, b) => { + if (a === b) { + return true + } else { + const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) - return data + return ( + a.code === data.code && + a.size === data.size && + data.bytes instanceof Uint8Array && + ipfs_core_utils_node_modules_multiformats_src_bytes_equals(a.bytes, data.bytes) + ) } +} - return getAll -}) +/** + * @typedef {import('./interface.js').MultihashDigest} MultihashDigest + */ -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/dist/src/util/as-uint8array.js /** - * To guarantee Uint8Array semantics, convert nodejs Buffers - * into vanilla Uint8Arrays + * Represents a multihash digest which carries information about the + * hashing algorithm and an actual hash digest. + * + * @template {number} Code + * @template {number} Size + * @class + * @implements {MultihashDigest} */ -function dist_src_util_as_uint8array_asUint8Array(buf) { - if (globalThis.Buffer != null) { - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); - } - return buf; +class ipfs_core_utils_node_modules_multiformats_src_hashes_digest_Digest { + /** + * Creates a multihash digest. + * + * @param {Code} code + * @param {Size} size + * @param {Uint8Array} digest + * @param {Uint8Array} bytes + */ + constructor (code, size, digest, bytes) { + this.code = code + this.size = size + this.digest = digest + this.bytes = bytes + } } -//# sourceMappingURL=as-uint8array.js.map -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/vendor/base-x.js + +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/vendor/base-x.js // base-x encoding / decoding // Copyright (c) 2018 base-x contributors // Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) // Distributed under the MIT software license, see the accompanying // file LICENSE or http://www.opensource.org/licenses/mit-license.php. -function node_modules_uint8arrays_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { +function ipfs_core_utils_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } var BASE_MAP = new Uint8Array(256); for (var j = 0; j < BASE_MAP.length; j++) { @@ -233407,82 +156230,13 @@ function node_modules_uint8arrays_node_modules_multiformats_vendor_base_x_base ( decode: decode } } -var node_modules_uint8arrays_node_modules_multiformats_vendor_base_x_src = node_modules_uint8arrays_node_modules_multiformats_vendor_base_x_base; - -var node_modules_uint8arrays_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = node_modules_uint8arrays_node_modules_multiformats_vendor_base_x_src; - -/* harmony default export */ const node_modules_uint8arrays_node_modules_multiformats_vendor_base_x = (node_modules_uint8arrays_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX); - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bytes.js -const node_modules_uint8arrays_node_modules_multiformats_src_bytes_empty = new Uint8Array(0) - -/** - * @param {Uint8Array} d - */ -const node_modules_uint8arrays_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') - -/** - * @param {string} hex - */ -const node_modules_uint8arrays_node_modules_multiformats_src_bytes_fromHex = hex => { - const hexes = hex.match(/../g) - return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : node_modules_uint8arrays_node_modules_multiformats_src_bytes_empty -} - -/** - * @param {Uint8Array} aa - * @param {Uint8Array} bb - */ -const node_modules_uint8arrays_node_modules_multiformats_src_bytes_equals = (aa, bb) => { - if (aa === bb) return true - if (aa.byteLength !== bb.byteLength) { - return false - } - - for (let ii = 0; ii < aa.byteLength; ii++) { - if (aa[ii] !== bb[ii]) { - return false - } - } - - return true -} - -/** - * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o - * @returns {Uint8Array} - */ -const node_modules_uint8arrays_node_modules_multiformats_src_bytes_coerce = o => { - if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o - if (o instanceof ArrayBuffer) return new Uint8Array(o) - if (ArrayBuffer.isView(o)) { - return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) - } - throw new Error('Unknown type, must be binary type') -} - -/** - * @param {any} o - * @returns {o is ArrayBuffer|ArrayBufferView} - */ -const node_modules_uint8arrays_node_modules_multiformats_src_bytes_isBinary = o => - o instanceof ArrayBuffer || ArrayBuffer.isView(o) - -/** - * @param {string} str - * @returns {Uint8Array} - */ -const node_modules_uint8arrays_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) - -/** - * @param {Uint8Array} b - * @returns {string} - */ -const node_modules_uint8arrays_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) +var ipfs_core_utils_node_modules_multiformats_vendor_base_x_src = ipfs_core_utils_node_modules_multiformats_vendor_base_x_base; +var ipfs_core_utils_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = ipfs_core_utils_node_modules_multiformats_vendor_base_x_src; +/* harmony default export */ const ipfs_core_utils_node_modules_multiformats_vendor_base_x = (ipfs_core_utils_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX); -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base.js +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base.js // Linter can't see that API is used in types. @@ -233500,7 +156254,7 @@ const node_modules_uint8arrays_node_modules_multiformats_src_bytes_toString = b * @implements {API.MultibaseEncoder} * @implements {API.BaseEncoder} */ -class uint8arrays_node_modules_multiformats_src_bases_base_Encoder { +class ipfs_core_utils_node_modules_multiformats_src_bases_base_Encoder { /** * @param {Base} name * @param {Prefix} prefix @@ -233540,7 +156294,7 @@ class uint8arrays_node_modules_multiformats_src_bases_base_Encoder { * @implements {API.UnibaseDecoder} * @implements {API.BaseDecoder} */ -class uint8arrays_node_modules_multiformats_src_bases_base_Decoder { +class ipfs_core_utils_node_modules_multiformats_src_bases_base_Decoder { /** * @param {Base} name * @param {Prefix} prefix @@ -233578,7 +156332,7 @@ class uint8arrays_node_modules_multiformats_src_bases_base_Decoder { * @returns {ComposedDecoder} */ or (decoder) { - return uint8arrays_node_modules_multiformats_src_bases_base_or(this, decoder) + return ipfs_core_utils_node_modules_multiformats_src_bases_base_or(this, decoder) } } @@ -233592,7 +156346,7 @@ class uint8arrays_node_modules_multiformats_src_bases_base_Decoder { * @implements {API.MultibaseDecoder} * @implements {API.CombobaseDecoder} */ -class uint8arrays_node_modules_multiformats_src_bases_base_ComposedDecoder { +class ipfs_core_utils_node_modules_multiformats_src_bases_base_ComposedDecoder { /** * @param {Decoders} decoders */ @@ -233606,7 +156360,7 @@ class uint8arrays_node_modules_multiformats_src_bases_base_ComposedDecoder { * @returns {ComposedDecoder} */ or (decoder) { - return uint8arrays_node_modules_multiformats_src_bases_base_or(this, decoder) + return ipfs_core_utils_node_modules_multiformats_src_bases_base_or(this, decoder) } /** @@ -233631,7 +156385,7 @@ class uint8arrays_node_modules_multiformats_src_bases_base_ComposedDecoder { * @param {API.UnibaseDecoder|API.CombobaseDecoder} right * @returns {ComposedDecoder} */ -const uint8arrays_node_modules_multiformats_src_bases_base_or = (left, right) => new uint8arrays_node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({ +const ipfs_core_utils_node_modules_multiformats_src_bases_base_or = (left, right) => new ipfs_core_utils_node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({ ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }), ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right }) })) @@ -233647,7 +156401,7 @@ const uint8arrays_node_modules_multiformats_src_bases_base_or = (left, right) => * @implements {API.BaseEncoder} * @implements {API.BaseDecoder} */ -class uint8arrays_node_modules_multiformats_src_bases_base_Codec { +class ipfs_core_utils_node_modules_multiformats_src_bases_base_Codec { /** * @param {Base} name * @param {Prefix} prefix @@ -233659,8 +156413,8 @@ class uint8arrays_node_modules_multiformats_src_bases_base_Codec { this.prefix = prefix this.baseEncode = baseEncode this.baseDecode = baseDecode - this.encoder = new uint8arrays_node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode) - this.decoder = new uint8arrays_node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode) + this.encoder = new ipfs_core_utils_node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode) + this.decoder = new ipfs_core_utils_node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode) } /** @@ -233688,8 +156442,8 @@ class uint8arrays_node_modules_multiformats_src_bases_base_Codec { * @param {(input:string) => Uint8Array} options.decode * @returns {Codec} */ -const uint8arrays_node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) => - new uint8arrays_node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode) +const ipfs_core_utils_node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) => + new ipfs_core_utils_node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode) /** * @template {string} Base @@ -233700,16 +156454,16 @@ const uint8arrays_node_modules_multiformats_src_bases_base_from = ({ name, prefi * @param {string} options.alphabet * @returns {Codec} */ -const uint8arrays_node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => { - const { encode, decode } = node_modules_uint8arrays_node_modules_multiformats_vendor_base_x(alphabet, name) - return uint8arrays_node_modules_multiformats_src_bases_base_from({ +const ipfs_core_utils_node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => { + const { encode, decode } = ipfs_core_utils_node_modules_multiformats_vendor_base_x(alphabet, name) + return ipfs_core_utils_node_modules_multiformats_src_bases_base_from({ prefix, name, encode, /** * @param {string} text */ - decode: text => node_modules_uint8arrays_node_modules_multiformats_src_bytes_coerce(decode(text)) + decode: text => ipfs_core_utils_node_modules_multiformats_src_bytes_coerce(decode(text)) }) } @@ -233720,7 +156474,7 @@ const uint8arrays_node_modules_multiformats_src_bases_base_baseX = ({ prefix, na * @param {string} name * @returns {Uint8Array} */ -const uint8arrays_node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { +const ipfs_core_utils_node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { // Build the character lookup table: /** @type {Record} */ const codes = {} @@ -233773,7 +156527,7 @@ const uint8arrays_node_modules_multiformats_src_bases_base_decode = (string, alp * @param {number} bitsPerChar * @returns {string} */ -const uint8arrays_node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => { +const ipfs_core_utils_node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => { const pad = alphabet[alphabet.length - 1] === '=' const mask = (1 << bitsPerChar) - 1 let out = '' @@ -233818,625 +156572,102 @@ const uint8arrays_node_modules_multiformats_src_bases_base_encode = (data, alpha * @param {string} options.alphabet * @param {number} options.bitsPerChar */ -const uint8arrays_node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { - return uint8arrays_node_modules_multiformats_src_bases_base_from({ +const ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { + return ipfs_core_utils_node_modules_multiformats_src_bases_base_from({ prefix, name, encode (input) { - return uint8arrays_node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar) + return ipfs_core_utils_node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar) }, decode (input) { - return uint8arrays_node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name) + return ipfs_core_utils_node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name) } }) } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base10.js - - -const node_modules_multiformats_src_bases_base10_base10 = uint8arrays_node_modules_multiformats_src_bases_base_baseX({ - prefix: '9', - name: 'base10', - alphabet: '0123456789' -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base16.js -// @ts-check - - - -const node_modules_multiformats_src_bases_base16_base16 = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'f', - name: 'base16', - alphabet: '0123456789abcdef', - bitsPerChar: 4 -}) - -const node_modules_multiformats_src_bases_base16_base16upper = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'F', - name: 'base16upper', - alphabet: '0123456789ABCDEF', - bitsPerChar: 4 -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base2.js -// @ts-check - +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base58.js -const node_modules_multiformats_src_bases_base2_base2 = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: '0', - name: 'base2', - alphabet: '01', - bitsPerChar: 1 +const ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc = ipfs_core_utils_node_modules_multiformats_src_bases_base_baseX({ + name: 'base58btc', + prefix: 'z', + alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' }) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base256emoji.js - - -const node_modules_multiformats_src_bases_base256emoji_alphabet = Array.from('🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂') -const node_modules_multiformats_src_bases_base256emoji_alphabetBytesToChars = /** @type {string[]} */ (node_modules_multiformats_src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[i] = c; return p }, /** @type {string[]} */([]))) -const node_modules_multiformats_src_bases_base256emoji_alphabetCharsToBytes = /** @type {number[]} */ (node_modules_multiformats_src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[/** @type {number} */ (c.codePointAt(0))] = i; return p }, /** @type {number[]} */([]))) - -/** - * @param {Uint8Array} data - * @returns {string} - */ -function uint8arrays_node_modules_multiformats_src_bases_base256emoji_encode (data) { - return data.reduce((p, c) => { - p += node_modules_multiformats_src_bases_base256emoji_alphabetBytesToChars[c] - return p - }, '') -} - -/** - * @param {string} str - * @returns {Uint8Array} - */ -function uint8arrays_node_modules_multiformats_src_bases_base256emoji_decode (str) { - const byts = [] - for (const char of str) { - const byt = node_modules_multiformats_src_bases_base256emoji_alphabetCharsToBytes[/** @type {number} */ (char.codePointAt(0))] - if (byt === undefined) { - throw new Error(`Non-base256emoji character: ${char}`) - } - byts.push(byt) - } - return new Uint8Array(byts) -} - -const node_modules_multiformats_src_bases_base256emoji_base256emoji = uint8arrays_node_modules_multiformats_src_bases_base_from({ - prefix: '🚀', - name: 'base256emoji', - encode: uint8arrays_node_modules_multiformats_src_bases_base256emoji_encode, - decode: uint8arrays_node_modules_multiformats_src_bases_base256emoji_decode +const ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58flickr = ipfs_core_utils_node_modules_multiformats_src_bases_base_baseX({ + name: 'base58flickr', + prefix: 'Z', + alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' }) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base32.js +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base32.js -const node_modules_uint8arrays_node_modules_multiformats_src_bases_base32_base32 = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ +const ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32 = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ prefix: 'b', name: 'base32', alphabet: 'abcdefghijklmnopqrstuvwxyz234567', bitsPerChar: 5 }) -const node_modules_uint8arrays_node_modules_multiformats_src_bases_base32_base32upper = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ +const ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32upper = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ prefix: 'B', name: 'base32upper', alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', bitsPerChar: 5 }) -const uint8arrays_node_modules_multiformats_src_bases_base32_base32pad = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ +const ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32pad = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ prefix: 'c', name: 'base32pad', alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', bitsPerChar: 5 }) -const uint8arrays_node_modules_multiformats_src_bases_base32_base32padupper = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ +const ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32padupper = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ prefix: 'C', name: 'base32padupper', alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', bitsPerChar: 5 }) -const uint8arrays_node_modules_multiformats_src_bases_base32_base32hex = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ +const ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32hex = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ prefix: 'v', name: 'base32hex', alphabet: '0123456789abcdefghijklmnopqrstuv', bitsPerChar: 5 }) -const uint8arrays_node_modules_multiformats_src_bases_base32_base32hexupper = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ +const ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32hexupper = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ prefix: 'V', name: 'base32hexupper', alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', bitsPerChar: 5 }) -const uint8arrays_node_modules_multiformats_src_bases_base32_base32hexpad = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ +const ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32hexpad = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ prefix: 't', name: 'base32hexpad', alphabet: '0123456789abcdefghijklmnopqrstuv=', bitsPerChar: 5 }) -const uint8arrays_node_modules_multiformats_src_bases_base32_base32hexpadupper = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ +const ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32hexpadupper = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ prefix: 'T', name: 'base32hexpadupper', alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', bitsPerChar: 5 }) -const uint8arrays_node_modules_multiformats_src_bases_base32_base32z = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ +const ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32z = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ prefix: 'h', name: 'base32z', alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', bitsPerChar: 5 }) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base36.js - - -const node_modules_multiformats_src_bases_base36_base36 = uint8arrays_node_modules_multiformats_src_bases_base_baseX({ - prefix: 'k', - name: 'base36', - alphabet: '0123456789abcdefghijklmnopqrstuvwxyz' -}) - -const node_modules_multiformats_src_bases_base36_base36upper = uint8arrays_node_modules_multiformats_src_bases_base_baseX({ - prefix: 'K', - name: 'base36upper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base58.js - - -const node_modules_uint8arrays_node_modules_multiformats_src_bases_base58_base58btc = uint8arrays_node_modules_multiformats_src_bases_base_baseX({ - name: 'base58btc', - prefix: 'z', - alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -}) - -const uint8arrays_node_modules_multiformats_src_bases_base58_base58flickr = uint8arrays_node_modules_multiformats_src_bases_base_baseX({ - name: 'base58flickr', - prefix: 'Z', - alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base64.js -// @ts-check - - - -const uint8arrays_node_modules_multiformats_src_bases_base64_base64 = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'm', - name: 'base64', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', - bitsPerChar: 6 -}) - -const uint8arrays_node_modules_multiformats_src_bases_base64_base64pad = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'M', - name: 'base64pad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', - bitsPerChar: 6 -}) - -const uint8arrays_node_modules_multiformats_src_bases_base64_base64url = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'u', - name: 'base64url', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', - bitsPerChar: 6 -}) - -const uint8arrays_node_modules_multiformats_src_bases_base64_base64urlpad = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'U', - name: 'base64urlpad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', - bitsPerChar: 6 -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base8.js -// @ts-check - - - -const node_modules_multiformats_src_bases_base8_base8 = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: '7', - name: 'base8', - alphabet: '01234567', - bitsPerChar: 3 -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/identity.js -// @ts-check - - - - -const uint8arrays_node_modules_multiformats_src_bases_identity_identity = uint8arrays_node_modules_multiformats_src_bases_base_from({ - prefix: '\x00', - name: 'identity', - encode: (buf) => node_modules_uint8arrays_node_modules_multiformats_src_bytes_toString(buf), - decode: (str) => node_modules_uint8arrays_node_modules_multiformats_src_bytes_fromString(str) -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/codecs/json.js -// @ts-check - -/** - * @template T - * @typedef {import('./interface.js').ByteView} ByteView - */ - -const uint8arrays_node_modules_multiformats_src_codecs_json_textEncoder = new TextEncoder() -const uint8arrays_node_modules_multiformats_src_codecs_json_textDecoder = new TextDecoder() - -const uint8arrays_node_modules_multiformats_src_codecs_json_name = 'json' -const uint8arrays_node_modules_multiformats_src_codecs_json_code = 0x0200 - -/** - * @template T - * @param {T} node - * @returns {ByteView} - */ -const uint8arrays_node_modules_multiformats_src_codecs_json_encode = (node) => uint8arrays_node_modules_multiformats_src_codecs_json_textEncoder.encode(JSON.stringify(node)) - -/** - * @template T - * @param {ByteView} data - * @returns {T} - */ -const uint8arrays_node_modules_multiformats_src_codecs_json_decode = (data) => JSON.parse(uint8arrays_node_modules_multiformats_src_codecs_json_textDecoder.decode(data)) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/codecs/raw.js -// @ts-check - - - -/** - * @template T - * @typedef {import('./interface.js').ByteView} ByteView - */ - -const uint8arrays_node_modules_multiformats_src_codecs_raw_name = 'raw' -const uint8arrays_node_modules_multiformats_src_codecs_raw_code = 0x55 - -/** - * @param {Uint8Array} node - * @returns {ByteView} - */ -const uint8arrays_node_modules_multiformats_src_codecs_raw_encode = (node) => node_modules_uint8arrays_node_modules_multiformats_src_bytes_coerce(node) - -/** - * @param {ByteView} data - * @returns {Uint8Array} - */ -const uint8arrays_node_modules_multiformats_src_codecs_raw_decode = (data) => node_modules_uint8arrays_node_modules_multiformats_src_bytes_coerce(data) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/vendor/varint.js -var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_encode_1 = node_modules_uint8arrays_node_modules_multiformats_vendor_varint_encode; - -var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_MSB = 0x80 - , node_modules_uint8arrays_node_modules_multiformats_vendor_varint_REST = 0x7F - , node_modules_uint8arrays_node_modules_multiformats_vendor_varint_MSBALL = ~node_modules_uint8arrays_node_modules_multiformats_vendor_varint_REST - , node_modules_uint8arrays_node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31); - -function node_modules_uint8arrays_node_modules_multiformats_vendor_varint_encode(num, out, offset) { - out = out || []; - offset = offset || 0; - var oldOffset = offset; - - while(num >= node_modules_uint8arrays_node_modules_multiformats_vendor_varint_INT) { - out[offset++] = (num & 0xFF) | node_modules_uint8arrays_node_modules_multiformats_vendor_varint_MSB; - num /= 128; - } - while(num & node_modules_uint8arrays_node_modules_multiformats_vendor_varint_MSBALL) { - out[offset++] = (num & 0xFF) | node_modules_uint8arrays_node_modules_multiformats_vendor_varint_MSB; - num >>>= 7; - } - out[offset] = num | 0; - - node_modules_uint8arrays_node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; - - return out -} - -var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_decode = node_modules_uint8arrays_node_modules_multiformats_vendor_varint_read; - -var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_MSB$1 = 0x80 - , node_modules_uint8arrays_node_modules_multiformats_vendor_varint_REST$1 = 0x7F; - -function node_modules_uint8arrays_node_modules_multiformats_vendor_varint_read(buf, offset) { - var res = 0 - , offset = offset || 0 - , shift = 0 - , counter = offset - , b - , l = buf.length; - - do { - if (counter >= l) { - node_modules_uint8arrays_node_modules_multiformats_vendor_varint_read.bytes = 0; - throw new RangeError('Could not decode varint') - } - b = buf[counter++]; - res += shift < 28 - ? (b & node_modules_uint8arrays_node_modules_multiformats_vendor_varint_REST$1) << shift - : (b & node_modules_uint8arrays_node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift); - shift += 7; - } while (b >= node_modules_uint8arrays_node_modules_multiformats_vendor_varint_MSB$1) - - node_modules_uint8arrays_node_modules_multiformats_vendor_varint_read.bytes = counter - offset; - - return res -} - -var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N1 = Math.pow(2, 7); -var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14); -var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21); -var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28); -var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35); -var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42); -var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49); -var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56); -var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63); - -var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_length = function (value) { - return ( - value < node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N1 ? 1 - : value < node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N2 ? 2 - : value < node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N3 ? 3 - : value < node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N4 ? 4 - : value < node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N5 ? 5 - : value < node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N6 ? 6 - : value < node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N7 ? 7 - : value < node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N8 ? 8 - : value < node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N9 ? 9 - : 10 - ) -}; - -var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_varint = { - encode: node_modules_uint8arrays_node_modules_multiformats_vendor_varint_encode_1 - , decode: node_modules_uint8arrays_node_modules_multiformats_vendor_varint_decode - , encodingLength: node_modules_uint8arrays_node_modules_multiformats_vendor_varint_length -}; - -var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_brrp_varint = node_modules_uint8arrays_node_modules_multiformats_vendor_varint_varint; - -/* harmony default export */ const node_modules_uint8arrays_node_modules_multiformats_vendor_varint = (node_modules_uint8arrays_node_modules_multiformats_vendor_varint_brrp_varint); - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/varint.js - - -/** - * @param {Uint8Array} data - * @param {number} [offset=0] - * @returns {[number, number]} - */ -const node_modules_uint8arrays_node_modules_multiformats_src_varint_decode = (data, offset = 0) => { - const code = varint.decode(data, offset) - return [code, varint.decode.bytes] -} - -/** - * @param {number} int - * @param {Uint8Array} target - * @param {number} [offset=0] - */ -const node_modules_uint8arrays_node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => { - node_modules_uint8arrays_node_modules_multiformats_vendor_varint.encode(int, target, offset) - return target -} - -/** - * @param {number} int - * @returns {number} - */ -const node_modules_uint8arrays_node_modules_multiformats_src_varint_encodingLength = (int) => { - return node_modules_uint8arrays_node_modules_multiformats_vendor_varint.encodingLength(int) -} - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/hashes/digest.js - - - -/** - * Creates a multihash digest. - * - * @template {number} Code - * @param {Code} code - * @param {Uint8Array} digest - */ -const node_modules_uint8arrays_node_modules_multiformats_src_hashes_digest_create = (code, digest) => { - const size = digest.byteLength - const sizeOffset = node_modules_uint8arrays_node_modules_multiformats_src_varint_encodingLength(code) - const digestOffset = sizeOffset + node_modules_uint8arrays_node_modules_multiformats_src_varint_encodingLength(size) - - const bytes = new Uint8Array(digestOffset + size) - node_modules_uint8arrays_node_modules_multiformats_src_varint_encodeTo(code, bytes, 0) - node_modules_uint8arrays_node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset) - bytes.set(digest, digestOffset) - - return new node_modules_uint8arrays_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) -} - -/** - * Turns bytes representation of multihash digest into an instance. - * - * @param {Uint8Array} multihash - * @returns {MultihashDigest} - */ -const node_modules_uint8arrays_node_modules_multiformats_src_hashes_digest_decode = (multihash) => { - const bytes = coerce(multihash) - const [code, sizeOffset] = varint.decode(bytes) - const [size, digestOffset] = varint.decode(bytes.subarray(sizeOffset)) - const digest = bytes.subarray(sizeOffset + digestOffset) - - if (digest.byteLength !== size) { - throw new Error('Incorrect length') - } - - return new node_modules_uint8arrays_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) -} - -/** - * @param {MultihashDigest} a - * @param {unknown} b - * @returns {b is MultihashDigest} - */ -const node_modules_uint8arrays_node_modules_multiformats_src_hashes_digest_equals = (a, b) => { - if (a === b) { - return true - } else { - const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) - - return ( - a.code === data.code && - a.size === data.size && - data.bytes instanceof Uint8Array && - equalBytes(a.bytes, data.bytes) - ) - } -} - -/** - * @typedef {import('./interface.js').MultihashDigest} MultihashDigest - */ - -/** - * Represents a multihash digest which carries information about the - * hashing algorithm and an actual hash digest. - * - * @template {number} Code - * @template {number} Size - * @class - * @implements {MultihashDigest} - */ -class node_modules_uint8arrays_node_modules_multiformats_src_hashes_digest_Digest { - /** - * Creates a multihash digest. - * - * @param {Code} code - * @param {Size} size - * @param {Uint8Array} digest - * @param {Uint8Array} bytes - */ - constructor (code, size, digest, bytes) { - this.code = code - this.size = size - this.digest = digest - this.bytes = bytes - } -} - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/hashes/identity.js - - - -const uint8arrays_node_modules_multiformats_src_hashes_identity_code = 0x0 -const uint8arrays_node_modules_multiformats_src_hashes_identity_name = 'identity' - -/** @type {(input:Uint8Array) => Uint8Array} */ -const uint8arrays_node_modules_multiformats_src_hashes_identity_encode = node_modules_uint8arrays_node_modules_multiformats_src_bytes_coerce - -/** - * @param {Uint8Array} input - * @returns {Digest.Digest} - */ -const node_modules_multiformats_src_hashes_identity_digest = (input) => node_modules_uint8arrays_node_modules_multiformats_src_hashes_digest_create(uint8arrays_node_modules_multiformats_src_hashes_identity_code, uint8arrays_node_modules_multiformats_src_hashes_identity_encode(input)) - -const uint8arrays_node_modules_multiformats_src_hashes_identity_identity = { code: uint8arrays_node_modules_multiformats_src_hashes_identity_code, name: uint8arrays_node_modules_multiformats_src_hashes_identity_name, encode: uint8arrays_node_modules_multiformats_src_hashes_identity_encode, digest: node_modules_multiformats_src_hashes_identity_digest } - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/hashes/hasher.js - - -/** - * @template {string} Name - * @template {number} Code - * @param {object} options - * @param {Name} options.name - * @param {Code} options.code - * @param {(input: Uint8Array) => Await} options.encode - */ -const uint8arrays_node_modules_multiformats_src_hashes_hasher_from = ({ name, code, encode }) => new uint8arrays_node_modules_multiformats_src_hashes_hasher_Hasher(name, code, encode) - -/** - * Hasher represents a hashing algorithm implementation that produces as - * `MultihashDigest`. - * - * @template {string} Name - * @template {number} Code - * @class - * @implements {MultihashHasher} - */ -class uint8arrays_node_modules_multiformats_src_hashes_hasher_Hasher { - /** - * - * @param {Name} name - * @param {Code} code - * @param {(input: Uint8Array) => Await} encode - */ - constructor (name, code, encode) { - this.name = name - this.code = code - this.encode = encode - } - - /** - * @param {Uint8Array} input - * @returns {Await>} - */ - digest (input) { - if (input instanceof Uint8Array) { - const result = this.encode(input) - return result instanceof Uint8Array - ? node_modules_uint8arrays_node_modules_multiformats_src_hashes_digest_create(this.code, result) - /* c8 ignore next 1 */ - : result.then(digest => node_modules_uint8arrays_node_modules_multiformats_src_hashes_digest_create(this.code, digest)) - } else { - throw Error('Unknown type, must be binary type') - /* c8 ignore next 1 */ - } - } -} - -/** - * @template {number} Alg - * @typedef {import('./interface.js').MultihashHasher} MultihashHasher - */ - -/** - * @template T - * @typedef {Promise|T} Await - */ - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/hashes/sha2.js -// @ts-check - - - - - -const uint8arrays_node_modules_multiformats_src_hashes_sha2_sha256 = uint8arrays_node_modules_multiformats_src_hashes_hasher_from({ - name: 'sha2-256', - code: 0x12, - encode: (input) => node_modules_uint8arrays_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha256').update(input).digest()) -}) - -const node_modules_multiformats_src_hashes_sha2_sha512 = uint8arrays_node_modules_multiformats_src_hashes_hasher_from({ - name: 'sha2-512', - code: 0x13, - encode: input => node_modules_uint8arrays_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha512').update(input).digest()) -}) +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/cid.js -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/cid.js @@ -234445,7 +156676,6 @@ const node_modules_multiformats_src_hashes_sha2_sha512 = uint8arrays_node_module // eslint-disable-next-line - // This way TS will also expose all the types from module @@ -234456,20 +156686,20 @@ const node_modules_multiformats_src_hashes_sha2_sha512 = uint8arrays_node_module * @param {API.MultibaseEncoder} [base] * @returns {API.ToString} */ -const node_modules_uint8arrays_node_modules_multiformats_src_cid_format = (link, base) => { +const ipfs_core_utils_node_modules_multiformats_src_cid_format = (link, base) => { const { bytes, version } = link switch (version) { case 0: - return node_modules_uint8arrays_node_modules_multiformats_src_cid_toStringV0( + return ipfs_core_utils_node_modules_multiformats_src_cid_toStringV0( bytes, - node_modules_uint8arrays_node_modules_multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder<"z">} */ (base) || base58btc.encoder + ipfs_core_utils_node_modules_multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder<"z">} */ (base) || ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc.encoder ) default: - return node_modules_uint8arrays_node_modules_multiformats_src_cid_toStringV1( + return ipfs_core_utils_node_modules_multiformats_src_cid_toStringV1( bytes, - node_modules_uint8arrays_node_modules_multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder} */ (base || base32.encoder) + ipfs_core_utils_node_modules_multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder} */ (base || ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32.encoder) ) } } @@ -234479,29 +156709,29 @@ const node_modules_uint8arrays_node_modules_multiformats_src_cid_format = (link, * @param {Link} link * @returns {API.LinkJSON} */ -const node_modules_uint8arrays_node_modules_multiformats_src_cid_toJSON = (link) => ({ - '/': node_modules_uint8arrays_node_modules_multiformats_src_cid_format(link) +const ipfs_core_utils_node_modules_multiformats_src_cid_toJSON = (link) => ({ + '/': ipfs_core_utils_node_modules_multiformats_src_cid_format(link) }) /** * @template {API.UnknownLink} Link * @param {API.LinkJSON} json */ -const node_modules_uint8arrays_node_modules_multiformats_src_cid_fromJSON = (json) => - node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.parse(json['/']) +const ipfs_core_utils_node_modules_multiformats_src_cid_fromJSON = (json) => + ipfs_core_utils_node_modules_multiformats_src_cid_CID.parse(json['/']) /** @type {WeakMap>} */ -const node_modules_uint8arrays_node_modules_multiformats_src_cid_cache = new WeakMap() +const ipfs_core_utils_node_modules_multiformats_src_cid_cache = new WeakMap() /** * @param {API.UnknownLink} cid * @returns {Map} */ -const node_modules_uint8arrays_node_modules_multiformats_src_cid_baseCache = cid => { - const baseCache = node_modules_uint8arrays_node_modules_multiformats_src_cid_cache.get(cid) +const ipfs_core_utils_node_modules_multiformats_src_cid_baseCache = cid => { + const baseCache = ipfs_core_utils_node_modules_multiformats_src_cid_cache.get(cid) if (baseCache == null) { const baseCache = new Map() - node_modules_uint8arrays_node_modules_multiformats_src_cid_cache.set(cid, baseCache) + ipfs_core_utils_node_modules_multiformats_src_cid_cache.set(cid, baseCache) return baseCache } return baseCache @@ -234515,12 +156745,13 @@ const node_modules_uint8arrays_node_modules_multiformats_src_cid_baseCache = cid * @implements {API.Link} */ -class node_modules_uint8arrays_node_modules_multiformats_src_cid_CID { +class ipfs_core_utils_node_modules_multiformats_src_cid_CID { /** * @param {Version} version - Version of the CID * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content. * @param {Uint8Array} bytes + * */ constructor (version, code, multihash, bytes) { /** @readonly */ @@ -234569,17 +156800,17 @@ class node_modules_uint8arrays_node_modules_multiformats_src_cid_CID { case 1: { const { code, multihash } = this - if (code !== node_modules_uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE) { + if (code !== ipfs_core_utils_node_modules_multiformats_src_cid_DAG_PB_CODE) { throw new Error('Cannot convert a non dag-pb CID to CIDv0') } // sha2-256 - if (multihash.code !== node_modules_uint8arrays_node_modules_multiformats_src_cid_SHA_256_CODE) { + if (multihash.code !== ipfs_core_utils_node_modules_multiformats_src_cid_SHA_256_CODE) { throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') } return /** @type {CID} */ ( - node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.createV0( + ipfs_core_utils_node_modules_multiformats_src_cid_CID.createV0( /** @type {API.MultihashDigest} */ (multihash) ) ) @@ -234599,9 +156830,9 @@ class node_modules_uint8arrays_node_modules_multiformats_src_cid_CID { switch (this.version) { case 0: { const { code, digest } = this.multihash - const multihash = Digest.create(code, digest) + const multihash = ipfs_core_utils_node_modules_multiformats_src_hashes_digest_create(code, digest) return /** @type {CID} */ ( - node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.createV1(this.code, multihash) + ipfs_core_utils_node_modules_multiformats_src_cid_CID.createV1(this.code, multihash) ) } case 1: { @@ -234620,7 +156851,7 @@ class node_modules_uint8arrays_node_modules_multiformats_src_cid_CID { * @returns {other is CID} */ equals (other) { - return node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.equals(this, other) + return ipfs_core_utils_node_modules_multiformats_src_cid_CID.equals(this, other) } /** @@ -234641,7 +156872,7 @@ class node_modules_uint8arrays_node_modules_multiformats_src_cid_CID { unknown && self.code === unknown.code && self.version === unknown.version && - Digest.equals(self.multihash, unknown.multihash) + ipfs_core_utils_node_modules_multiformats_src_hashes_digest_equals(self.multihash, unknown.multihash) ) } @@ -234650,14 +156881,11 @@ class node_modules_uint8arrays_node_modules_multiformats_src_cid_CID { * @returns {string} */ toString (base) { - return node_modules_uint8arrays_node_modules_multiformats_src_cid_format(this, base) + return ipfs_core_utils_node_modules_multiformats_src_cid_format(this, base) } - /** - * @returns {API.LinkJSON} - */ toJSON () { - return { '/': node_modules_uint8arrays_node_modules_multiformats_src_cid_format(this) } + return { '/': ipfs_core_utils_node_modules_multiformats_src_cid_format(this) } } link () { @@ -234698,7 +156926,7 @@ class node_modules_uint8arrays_node_modules_multiformats_src_cid_CID { } const value = /** @type {any} */ (input) - if (value instanceof node_modules_uint8arrays_node_modules_multiformats_src_cid_CID) { + if (value instanceof ipfs_core_utils_node_modules_multiformats_src_cid_CID) { // If value is instance of CID then we're all set. return value } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { @@ -234708,21 +156936,21 @@ class node_modules_uint8arrays_node_modules_multiformats_src_cid_CID { // rebase it to this `CID` implementation so caller is guaranteed to get // instance with expected API. const { version, code, multihash, bytes } = value - return new node_modules_uint8arrays_node_modules_multiformats_src_cid_CID( + return new ipfs_core_utils_node_modules_multiformats_src_cid_CID( version, code, /** @type {API.MultihashDigest} */ (multihash), - bytes || node_modules_uint8arrays_node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes) + bytes || ipfs_core_utils_node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes) ) - } else if (value[node_modules_uint8arrays_node_modules_multiformats_src_cid_cidSymbol] === true) { + } else if (value[ipfs_core_utils_node_modules_multiformats_src_cid_cidSymbol] === true) { // If value is a CID from older implementation that used to be tagged via // symbol we still rebase it to the this `CID` implementation by // delegating that to a constructor. const { version, multihash, code } = value const digest = /** @type {API.MultihashDigest} */ - (Digest.decode(multihash)) - return node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.create(version, code, digest) + (ipfs_core_utils_node_modules_multiformats_src_hashes_digest_decode(multihash)) + return ipfs_core_utils_node_modules_multiformats_src_cid_CID.create(version, code, digest) } else { // Otherwise value is not a CID (or an incompatible version of it) in // which case we return `null`. @@ -234752,17 +156980,17 @@ class node_modules_uint8arrays_node_modules_multiformats_src_cid_CID { switch (version) { case 0: { - if (code !== node_modules_uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE) { + if (code !== ipfs_core_utils_node_modules_multiformats_src_cid_DAG_PB_CODE) { throw new Error( - `Version 0 CID must use dag-pb (code: ${node_modules_uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding` + `Version 0 CID must use dag-pb (code: ${ipfs_core_utils_node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding` ) } else { - return new node_modules_uint8arrays_node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes) + return new ipfs_core_utils_node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes) } } case 1: { - const bytes = node_modules_uint8arrays_node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes) - return new node_modules_uint8arrays_node_modules_multiformats_src_cid_CID(version, code, digest, bytes) + const bytes = ipfs_core_utils_node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes) + return new ipfs_core_utils_node_modules_multiformats_src_cid_CID(version, code, digest, bytes) } default: { throw new Error('Invalid version') @@ -234778,7 +157006,7 @@ class node_modules_uint8arrays_node_modules_multiformats_src_cid_CID { * @returns {CID} */ static createV0 (digest) { - return node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.create(0, node_modules_uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE, digest) + return ipfs_core_utils_node_modules_multiformats_src_cid_CID.create(0, ipfs_core_utils_node_modules_multiformats_src_cid_DAG_PB_CODE, digest) } /** @@ -234792,7 +157020,7 @@ class node_modules_uint8arrays_node_modules_multiformats_src_cid_CID { * @returns {CID} */ static createV1 (code, digest) { - return node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.create(1, code, digest) + return ipfs_core_utils_node_modules_multiformats_src_cid_CID.create(1, code, digest) } /** @@ -234810,7 +157038,7 @@ class node_modules_uint8arrays_node_modules_multiformats_src_cid_CID { * @returns {CID} */ static decode (bytes) { - const [cid, remainder] = node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.decodeFirst(bytes) + const [cid, remainder] = ipfs_core_utils_node_modules_multiformats_src_cid_CID.decodeFirst(bytes) if (remainder.length) { throw new Error('Incorrect length') } @@ -234834,9 +157062,9 @@ class node_modules_uint8arrays_node_modules_multiformats_src_cid_CID { * @returns {[CID, Uint8Array]} */ static decodeFirst (bytes) { - const specs = node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.inspectBytes(bytes) + const specs = ipfs_core_utils_node_modules_multiformats_src_cid_CID.inspectBytes(bytes) const prefixSize = specs.size - specs.multihashSize - const multihashBytes = coerce( + const multihashBytes = ipfs_core_utils_node_modules_multiformats_src_bytes_coerce( bytes.subarray(prefixSize, prefixSize + specs.multihashSize) ) if (multihashBytes.byteLength !== specs.multihashSize) { @@ -234845,7 +157073,7 @@ class node_modules_uint8arrays_node_modules_multiformats_src_cid_CID { const digestBytes = multihashBytes.subarray( specs.multihashSize - specs.digestSize ) - const digest = new Digest.Digest( + const digest = new ipfs_core_utils_node_modules_multiformats_src_hashes_digest_Digest( specs.multihashCode, specs.digestSize, digestBytes, @@ -234853,8 +157081,8 @@ class node_modules_uint8arrays_node_modules_multiformats_src_cid_CID { ) const cid = specs.version === 0 - ? node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) - : node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest) + ? ipfs_core_utils_node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) + : ipfs_core_utils_node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest) return [/** @type {CID} */(cid), bytes.subarray(specs.size)] } @@ -234877,13 +157105,13 @@ class node_modules_uint8arrays_node_modules_multiformats_src_cid_CID { static inspectBytes (initialBytes) { let offset = 0 const next = () => { - const [i, length] = varint.decode(initialBytes.subarray(offset)) + const [i, length] = ipfs_core_utils_node_modules_multiformats_src_varint_decode(initialBytes.subarray(offset)) offset += length return i } let version = /** @type {V} */ (next()) - let codec = /** @type {C} */ (node_modules_uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE) + let codec = /** @type {C} */ (ipfs_core_utils_node_modules_multiformats_src_cid_DAG_PB_CODE) if (/** @type {number} */(version) === 18) { // CIDv0 version = /** @type {V} */ (0) @@ -234921,16 +157149,16 @@ class node_modules_uint8arrays_node_modules_multiformats_src_cid_CID { * @returns {CID} */ static parse (source, base) { - const [prefix, bytes] = node_modules_uint8arrays_node_modules_multiformats_src_cid_parseCIDtoBytes(source, base) + const [prefix, bytes] = ipfs_core_utils_node_modules_multiformats_src_cid_parseCIDtoBytes(source, base) - const cid = node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.decode(bytes) + const cid = ipfs_core_utils_node_modules_multiformats_src_cid_CID.decode(bytes) if (cid.version === 0 && source[0] !== 'Q') { throw Error('Version 0 CID string must not include multibase prefix') } // Cache string representation to avoid computing it on `this.toString()` - node_modules_uint8arrays_node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source) + ipfs_core_utils_node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source) return cid } @@ -234946,23 +157174,23 @@ class node_modules_uint8arrays_node_modules_multiformats_src_cid_CID { * @param {API.MultibaseDecoder} [base] * @returns {[Prefix, API.ByteView>]} */ -const node_modules_uint8arrays_node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => { +const ipfs_core_utils_node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => { switch (source[0]) { // CIDv0 is parsed differently case 'Q': { - const decoder = base || base58btc + const decoder = base || ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc return [ - /** @type {Prefix} */ (base58btc.prefix), - decoder.decode(`${base58btc.prefix}${source}`) + /** @type {Prefix} */ (ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc.prefix), + decoder.decode(`${ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc.prefix}${source}`) ] } - case base58btc.prefix: { - const decoder = base || base58btc - return [/** @type {Prefix} */(base58btc.prefix), decoder.decode(source)] + case ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc.prefix: { + const decoder = base || ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc + return [/** @type {Prefix} */(ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc.prefix), decoder.decode(source)] } - case base32.prefix: { - const decoder = base || base32 - return [/** @type {Prefix} */(base32.prefix), decoder.decode(source)] + case ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32.prefix: { + const decoder = base || ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32 + return [/** @type {Prefix} */(ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32.prefix), decoder.decode(source)] } default: { if (base == null) { @@ -234981,9 +157209,9 @@ const node_modules_uint8arrays_node_modules_multiformats_src_cid_parseCIDtoBytes * @param {Map} cache * @param {API.MultibaseEncoder<'z'>} base */ -const node_modules_uint8arrays_node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => { +const ipfs_core_utils_node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => { const { prefix } = base - if (prefix !== base58btc.prefix) { + if (prefix !== ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc.prefix) { throw Error(`Cannot string encode V0 in ${base.name} encoding`) } @@ -235003,7 +157231,7 @@ const node_modules_uint8arrays_node_modules_multiformats_src_cid_toStringV0 = (b * @param {Map} cache * @param {API.MultibaseEncoder} base */ -const node_modules_uint8arrays_node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => { +const ipfs_core_utils_node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => { const { prefix } = base const cid = cache.get(prefix) if (cid == null) { @@ -235015,8 +157243,8 @@ const node_modules_uint8arrays_node_modules_multiformats_src_cid_toStringV1 = (b } } -const node_modules_uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70 -const node_modules_uint8arrays_node_modules_multiformats_src_cid_SHA_256_CODE = 0x12 +const ipfs_core_utils_node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70 +const ipfs_core_utils_node_modules_multiformats_src_cid_SHA_256_CODE = 0x12 /** * @param {API.Version} version @@ -235024,2888 +157252,3675 @@ const node_modules_uint8arrays_node_modules_multiformats_src_cid_SHA_256_CODE = * @param {Uint8Array} multihash * @returns {Uint8Array} */ -const node_modules_uint8arrays_node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => { - const codeOffset = varint.encodingLength(version) - const hashOffset = codeOffset + varint.encodingLength(code) +const ipfs_core_utils_node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => { + const codeOffset = ipfs_core_utils_node_modules_multiformats_src_varint_encodingLength(version) + const hashOffset = codeOffset + ipfs_core_utils_node_modules_multiformats_src_varint_encodingLength(code) const bytes = new Uint8Array(hashOffset + multihash.byteLength) - varint.encodeTo(version, bytes, 0) - varint.encodeTo(code, bytes, codeOffset) + ipfs_core_utils_node_modules_multiformats_src_varint_encodeTo(version, bytes, 0) + ipfs_core_utils_node_modules_multiformats_src_varint_encodeTo(code, bytes, codeOffset) bytes.set(multihash, hashOffset) return bytes } -const node_modules_uint8arrays_node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/index.js +const ipfs_core_utils_node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/identity.js +// @ts-check +const node_modules_multiformats_src_bases_identity_identity = ipfs_core_utils_node_modules_multiformats_src_bases_base_from({ + prefix: '\x00', + name: 'identity', + encode: (buf) => ipfs_core_utils_node_modules_multiformats_src_bytes_toString(buf), + decode: (str) => ipfs_core_utils_node_modules_multiformats_src_bytes_fromString(str) +}) -// This way TS will also expose all the types from module +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base2.js +// @ts-check +const src_bases_base2_base2 = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: '0', + name: 'base2', + alphabet: '01', + bitsPerChar: 1 +}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/basics.js +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base8.js // @ts-check +const src_bases_base8_base8 = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: '7', + name: 'base8', + alphabet: '01234567', + bitsPerChar: 3 +}) + +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base10.js + + +const src_bases_base10_base10 = ipfs_core_utils_node_modules_multiformats_src_bases_base_baseX({ + prefix: '9', + name: 'base10', + alphabet: '0123456789' +}) + +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base16.js +// @ts-check + +const src_bases_base16_base16 = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'f', + name: 'base16', + alphabet: '0123456789abcdef', + bitsPerChar: 4 +}) +const src_bases_base16_base16upper = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'F', + name: 'base16upper', + alphabet: '0123456789ABCDEF', + bitsPerChar: 4 +}) +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base36.js +const src_bases_base36_base36 = ipfs_core_utils_node_modules_multiformats_src_bases_base_baseX({ + prefix: 'k', + name: 'base36', + alphabet: '0123456789abcdefghijklmnopqrstuvwxyz' +}) +const src_bases_base36_base36upper = ipfs_core_utils_node_modules_multiformats_src_bases_base_baseX({ + prefix: 'K', + name: 'base36upper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' +}) +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base64.js +// @ts-check +const node_modules_multiformats_src_bases_base64_base64 = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'm', + name: 'base64', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + bitsPerChar: 6 +}) +const node_modules_multiformats_src_bases_base64_base64pad = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'M', + name: 'base64pad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', + bitsPerChar: 6 +}) +const node_modules_multiformats_src_bases_base64_base64url = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'u', + name: 'base64url', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', + bitsPerChar: 6 +}) -const uint8arrays_node_modules_multiformats_src_basics_bases = { ...uint8arrays_node_modules_multiformats_src_bases_identity_namespaceObject, ...uint8arrays_node_modules_multiformats_src_bases_base2_namespaceObject, ...uint8arrays_node_modules_multiformats_src_bases_base8_namespaceObject, ...uint8arrays_node_modules_multiformats_src_bases_base10_namespaceObject, ...uint8arrays_node_modules_multiformats_src_bases_base16_namespaceObject, ...node_modules_uint8arrays_node_modules_multiformats_src_bases_base32_namespaceObject, ...uint8arrays_node_modules_multiformats_src_bases_base36_namespaceObject, ...node_modules_uint8arrays_node_modules_multiformats_src_bases_base58_namespaceObject, ...uint8arrays_node_modules_multiformats_src_bases_base64_namespaceObject, ...uint8arrays_node_modules_multiformats_src_bases_base256emoji_namespaceObject } -const uint8arrays_node_modules_multiformats_src_basics_hashes = { ...uint8arrays_node_modules_multiformats_src_hashes_sha2_namespaceObject, ...uint8arrays_node_modules_multiformats_src_hashes_identity_namespaceObject } -const uint8arrays_node_modules_multiformats_src_basics_codecs = { raw: uint8arrays_node_modules_multiformats_src_codecs_raw_namespaceObject, json: uint8arrays_node_modules_multiformats_src_codecs_json_namespaceObject } +const node_modules_multiformats_src_bases_base64_base64urlpad = ipfs_core_utils_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'U', + name: 'base64urlpad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', + bitsPerChar: 6 +}) +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/bases/base256emoji.js -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/dist/src/alloc.js +const src_bases_base256emoji_alphabet = Array.from('🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂') +const src_bases_base256emoji_alphabetBytesToChars = /** @type {string[]} */ (src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[i] = c; return p }, /** @type {string[]} */([]))) +const src_bases_base256emoji_alphabetCharsToBytes = /** @type {number[]} */ (src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[/** @type {number} */ (c.codePointAt(0))] = i; return p }, /** @type {number[]} */([]))) /** - * Returns a `Uint8Array` of the requested size. Referenced memory will - * be initialized to 0. + * @param {Uint8Array} data + * @returns {string} */ -function uint8arrays_dist_src_alloc_alloc(size = 0) { - if (globalThis.Buffer?.alloc != null) { - return asUint8Array(globalThis.Buffer.alloc(size)); - } - return new Uint8Array(size); +function multiformats_src_bases_base256emoji_encode (data) { + return data.reduce((p, c) => { + p += src_bases_base256emoji_alphabetBytesToChars[c] + return p + }, '') } + /** - * Where possible returns a Uint8Array of the requested size that references - * uninitialized memory. Only use if you are certain you will immediately - * overwrite every value in the returned `Uint8Array`. + * @param {string} str + * @returns {Uint8Array} */ -function dist_src_alloc_allocUnsafe(size = 0) { - if (globalThis.Buffer?.allocUnsafe != null) { - return dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.allocUnsafe(size)); +function multiformats_src_bases_base256emoji_decode (str) { + const byts = [] + for (const char of str) { + const byt = src_bases_base256emoji_alphabetCharsToBytes[/** @type {number} */ (char.codePointAt(0))] + if (byt === undefined) { + throw new Error(`Non-base256emoji character: ${char}`) } - return new Uint8Array(size); + byts.push(byt) + } + return new Uint8Array(byts) } -//# sourceMappingURL=alloc.js.map -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/dist/src/util/bases.js +const src_bases_base256emoji_base256emoji = ipfs_core_utils_node_modules_multiformats_src_bases_base_from({ + prefix: '🚀', + name: 'base256emoji', + encode: multiformats_src_bases_base256emoji_encode, + decode: multiformats_src_bases_base256emoji_decode +}) -function util_bases_createCodec(name, prefix, encode, decode) { - return { - name, - prefix, - encoder: { - name, - prefix, - encode - }, - decoder: { - decode - } - }; -} -const util_bases_string = util_bases_createCodec('utf8', 'u', (buf) => { - const decoder = new TextDecoder('utf8'); - return 'u' + decoder.decode(buf); -}, (str) => { - const encoder = new TextEncoder(); - return encoder.encode(str.substring(1)); -}); -const util_bases_ascii = util_bases_createCodec('ascii', 'a', (buf) => { - let string = 'a'; - for (let i = 0; i < buf.length; i++) { - string += String.fromCharCode(buf[i]); - } - return string; -}, (str) => { - str = str.substring(1); - const buf = dist_src_alloc_allocUnsafe(str.length); - for (let i = 0; i < str.length; i++) { - buf[i] = str.charCodeAt(i); - } - return buf; -}); -const util_bases_BASES = { - utf8: util_bases_string, - 'utf-8': util_bases_string, - hex: uint8arrays_node_modules_multiformats_src_basics_bases.base16, - latin1: util_bases_ascii, - ascii: util_bases_ascii, - binary: util_bases_ascii, - ...uint8arrays_node_modules_multiformats_src_basics_bases -}; -/* harmony default export */ const dist_src_util_bases = (util_bases_BASES); -//# sourceMappingURL=bases.js.map -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/dist/src/from-string.js +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/hashes/hasher.js /** - * Create a `Uint8Array` from the passed string - * - * Supports `utf8`, `utf-8`, `hex`, and any encoding supported by the multiformats module. + * @template {string} Name + * @template {number} Code + * @param {object} options + * @param {Name} options.name + * @param {Code} options.code + * @param {(input: Uint8Array) => Await} options.encode + */ +const node_modules_multiformats_src_hashes_hasher_from = ({ name, code, encode }) => new multiformats_src_hashes_hasher_Hasher(name, code, encode) + +/** + * Hasher represents a hashing algorithm implementation that produces as + * `MultihashDigest`. * - * Also `ascii` which is similar to node's 'binary' encoding. + * @template {string} Name + * @template {number} Code + * @class + * @implements {MultihashHasher} */ -function dist_src_from_string_fromString(string, encoding = 'utf8') { - const base = dist_src_util_bases[encoding]; - if (base == null) { - throw new Error(`Unsupported encoding "${encoding}"`); - } - if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) { - return dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.from(string, 'utf-8')); +class multiformats_src_hashes_hasher_Hasher { + /** + * + * @param {Name} name + * @param {Code} code + * @param {(input: Uint8Array) => Await} encode + */ + constructor (name, code, encode) { + this.name = name + this.code = code + this.encode = encode + } + + /** + * @param {Uint8Array} input + * @returns {Await>} + */ + digest (input) { + if (input instanceof Uint8Array) { + const result = this.encode(input) + return result instanceof Uint8Array + ? ipfs_core_utils_node_modules_multiformats_src_hashes_digest_create(this.code, result) + /* c8 ignore next 1 */ + : result.then(digest => ipfs_core_utils_node_modules_multiformats_src_hashes_digest_create(this.code, digest)) + } else { + throw Error('Unknown type, must be binary type') + /* c8 ignore next 1 */ } - // add multibase prefix - return base.decoder.decode(`${base.prefix}${string}`); // eslint-disable-line @typescript-eslint/restrict-template-expressions + } } -//# sourceMappingURL=from-string.js.map -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/config/replace.js +/** + * @template {number} Alg + * @typedef {import('./interface.js').MultihashHasher} MultihashHasher + */ +/** + * @template T + * @typedef {Promise|T} Await + */ +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/hashes/sha2.js +// @ts-check -const createReplace = configure(api => { - /** - * @type {import('../types.js').ConfigAPI["replace"]} - */ - const replace = async (config, options = {}) => { - // allow aborting requests on body errors - const controller = new AbortController() - const signal = abortSignal(controller.signal, options.signal) - const res = await api.post('config/replace', { - signal, - searchParams: toUrlSearchParams(options), - ...( - await multipart_request_multipartRequest([dist_src_from_string_fromString(JSON.stringify(config))], controller, options.headers) - ) - }) - await res.text() - } +const multiformats_src_hashes_sha2_sha256 = node_modules_multiformats_src_hashes_hasher_from({ + name: 'sha2-256', + code: 0x12, + encode: (input) => ipfs_core_utils_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha256').update(input).digest()) +}) - return replace +const src_hashes_sha2_sha512 = node_modules_multiformats_src_hashes_hasher_from({ + name: 'sha2-512', + code: 0x13, + encode: input => ipfs_core_utils_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha512').update(input).digest()) }) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/config/set.js +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/hashes/identity.js -const createSet = configure(api => { - /** - * @type {import('../types.js').ConfigAPI["set"]} - */ - const set = async (key, value, options = {}) => { - if (typeof key !== 'string') { - throw new Error('Invalid key type') - } +const multiformats_src_hashes_identity_code = 0x0 +const multiformats_src_hashes_identity_name = 'identity' - const params = { - ...options, - ...encodeParam(key, value) - } +/** @type {(input:Uint8Array) => Uint8Array} */ +const multiformats_src_hashes_identity_encode = ipfs_core_utils_node_modules_multiformats_src_bytes_coerce - const res = await api.post('config', { - signal: options.signal, - searchParams: toUrlSearchParams(params), - headers: options.headers - }) +/** + * @param {Uint8Array} input + * @returns {Digest.Digest} + */ +const src_hashes_identity_digest = (input) => ipfs_core_utils_node_modules_multiformats_src_hashes_digest_create(multiformats_src_hashes_identity_code, multiformats_src_hashes_identity_encode(input)) + +const multiformats_src_hashes_identity_identity = { code: multiformats_src_hashes_identity_code, name: multiformats_src_hashes_identity_name, encode: multiformats_src_hashes_identity_encode, digest: src_hashes_identity_digest } + +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/codecs/raw.js +// @ts-check - await res.text() - } - return set -}) /** - * @param {*} key - * @param {*} value + * @template T + * @typedef {import('./interface.js').ByteView} ByteView */ -const encodeParam = (key, value) => { - switch (typeof value) { - case 'boolean': - return { arg: [key, value.toString()], bool: true } - case 'string': - return { arg: [key, value] } - default: - return { arg: [key, JSON.stringify(value)], json: true } - } -} -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/config/index.js +const multiformats_src_codecs_raw_name = 'raw' +const multiformats_src_codecs_raw_code = 0x55 + +/** + * @param {Uint8Array} node + * @returns {ByteView} + */ +const multiformats_src_codecs_raw_encode = (node) => ipfs_core_utils_node_modules_multiformats_src_bytes_coerce(node) +/** + * @param {ByteView} data + * @returns {Uint8Array} + */ +const multiformats_src_codecs_raw_decode = (data) => ipfs_core_utils_node_modules_multiformats_src_bytes_coerce(data) +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/codecs/json.js +// @ts-check +/** + * @template T + * @typedef {import('./interface.js').ByteView} ByteView + */ +const multiformats_src_codecs_json_textEncoder = new TextEncoder() +const multiformats_src_codecs_json_textDecoder = new TextDecoder() +const multiformats_src_codecs_json_name = 'json' +const multiformats_src_codecs_json_code = 0x0200 /** - * @param {import('../types').Options} config + * @template T + * @param {T} node + * @returns {ByteView} */ -function createConfig (config) { - return { - getAll: createGetAll(config), - get: get_createGet(config), - set: createSet(config), - replace: createReplace(config), - profiles: createProfiles(config) - } -} +const multiformats_src_codecs_json_encode = (node) => multiformats_src_codecs_json_textEncoder.encode(JSON.stringify(node)) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dag/export.js +/** + * @template T + * @param {ByteView} data + * @returns {T} + */ +const multiformats_src_codecs_json_decode = (data) => JSON.parse(multiformats_src_codecs_json_textDecoder.decode(data)) +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/index.js -const createExport = configure(api => { - /** - * @type {import('../types').DAGAPI["export"]} - */ - async function * dagExport (root, options = {}) { - const res = await api.post('dag/export', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: root.toString() - }), - headers: options.headers - }) - yield * res.iterator() - } - return dagExport -}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/resolve.js +// This way TS will also expose all the types from module + +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/multiformats/src/basics.js +// @ts-check + + + + + + + + + + + + + + + + + + + +const multiformats_src_basics_bases = { ...node_modules_multiformats_src_bases_identity_namespaceObject, ...multiformats_src_bases_base2_namespaceObject, ...multiformats_src_bases_base8_namespaceObject, ...multiformats_src_bases_base10_namespaceObject, ...multiformats_src_bases_base16_namespaceObject, ...ipfs_core_utils_node_modules_multiformats_src_bases_base32_namespaceObject, ...multiformats_src_bases_base36_namespaceObject, ...ipfs_core_utils_node_modules_multiformats_src_bases_base58_namespaceObject, ...node_modules_multiformats_src_bases_base64_namespaceObject, ...multiformats_src_bases_base256emoji_namespaceObject } +const multiformats_src_basics_hashes = { ...multiformats_src_hashes_sha2_namespaceObject, ...multiformats_src_hashes_identity_namespaceObject } +const multiformats_src_basics_codecs = { raw: multiformats_src_codecs_raw_namespaceObject, json: node_modules_multiformats_src_codecs_json_namespaceObject } + + + +// EXTERNAL MODULE: ./node_modules/ipfs-core-utils/node_modules/varint/index.js +var node_modules_varint = __nccwpck_require__(57743); +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/dist/src/from-string.js + + /** - * Retrieves IPLD Nodes along the `path` that is rooted at `cid`. + * Create a `Uint8Array` from the passed string * - * @param {CID} cid - the CID where the resolving starts - * @param {string} path - the path that should be resolved - * @param {import('../types').Multicodecs} codecs - * @param {(cid: CID, options?: import('../types').AbortOptions) => Promise} getBlock - * @param {import('../types').AbortOptions} [options] + * Supports `utf8`, `utf-8`, `hex`, and any encoding supported by the multiformats module. + * + * Also `ascii` which is similar to node's 'binary' encoding. */ -async function * resolve (cid, path, codecs, getBlock, options) { - /** - * @param {CID} cid - */ - const load = async (cid) => { - const codec = await codecs.getCodec(cid.code) - const block = await getBlock(cid, options) +function src_from_string_fromString(string, encoding = 'utf8') { + const base = src_util_bases[encoding]; + if (base == null) { + throw new Error(`Unsupported encoding "${encoding}"`); + } + if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) { + return src_util_as_uint8array_asUint8Array(globalThis.Buffer.from(string, 'utf-8')); + } + // add multibase prefix + return base.decoder.decode(`${base.prefix}${string}`); // eslint-disable-line @typescript-eslint/restrict-template-expressions +} +//# sourceMappingURL=from-string.js.map +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/dist/src/concat.js - return codec.decode(block) - } - const parts = path.split('/').filter(Boolean) - let value = await load(cid) - let lastCid = cid +/** + * Returns a new Uint8Array created by concatenating the passed ArrayLikes + */ +function src_concat_concat(arrays, length) { + if (length == null) { + length = arrays.reduce((acc, curr) => acc + curr.length, 0); + } + const output = src_alloc_allocUnsafe(length); + let offset = 0; + for (const arr of arrays) { + output.set(arr, offset); + offset += arr.length; + } + return src_util_as_uint8array_asUint8Array(output); +} +//# sourceMappingURL=concat.js.map +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/@multiformats/multiaddr/dist/src/convert.js +/** + * @packageDocumentation + * + * Provides methods for converting + */ - // End iteration if there isn't a CID to follow any more - while (parts.length) { - const key = parts.shift() - if (!key) { - throw err_code(new Error(`Could not resolve path "${path}"`), 'ERR_INVALID_PATH') - } - if (Object.prototype.hasOwnProperty.call(value, key)) { - value = value[key] - yield { - value, - remainderPath: parts.join('/') - } - } else { - throw err_code(new Error(`no link named "${key}" under ${lastCid}`), 'ERR_NO_LINK') - } - const cid = node_modules_multiformats_src_cid_CID.asCID(value) - if (cid) { - lastCid = cid - value = await load(value) - } - } - yield { - value, - remainderPath: '' - } + + + + +function convert_convert(proto, a) { + if (a instanceof Uint8Array) { + return convert_convertToString(proto, a); + } + else { + return convert_convertToBytes(proto, a); + } +} +/** + * Convert [code,Uint8Array] to string + */ +function convert_convertToString(proto, buf) { + const protocol = src_protocols_table_getProtocol(proto); + switch (protocol.code) { + case 4: // ipv4 + case 41: // ipv6 + return convert_bytes2ip(buf); + case 42: // ipv6zone + return convert_bytes2str(buf); + case 6: // tcp + case 273: // udp + case 33: // dccp + case 132: // sctp + return convert_bytes2port(buf).toString(); + case 53: // dns + case 54: // dns4 + case 55: // dns6 + case 56: // dnsaddr + case 400: // unix + case 449: // sni + case 777: // memory + return convert_bytes2str(buf); + case 421: // ipfs + return convert_bytes2mh(buf); + case 444: // onion + return convert_bytes2onion(buf); + case 445: // onion3 + return convert_bytes2onion(buf); + case 466: // certhash + return convert_bytes2mb(buf); + default: + return src_to_string_toString(buf, 'base16'); // no clue. convert to hex + } +} +function convert_convertToBytes(proto, str) { + const protocol = src_protocols_table_getProtocol(proto); + switch (protocol.code) { + case 4: // ipv4 + return convert_ip2bytes(str); + case 41: // ipv6 + return convert_ip2bytes(str); + case 42: // ipv6zone + return convert_str2bytes(str); + case 6: // tcp + case 273: // udp + case 33: // dccp + case 132: // sctp + return convert_port2bytes(parseInt(str, 10)); + case 53: // dns + case 54: // dns4 + case 55: // dns6 + case 56: // dnsaddr + case 400: // unix + case 449: // sni + case 777: // memory + return convert_str2bytes(str); + case 421: // ipfs + return convert_mh2bytes(str); + case 444: // onion + return convert_onion2bytes(str); + case 445: // onion3 + return convert_onion32bytes(str); + case 466: // certhash + return convert_mb2bytes(str); + default: + return src_from_string_fromString(str, 'base16'); // no clue. convert from hex + } +} +const convert_decoders = Object.values(multiformats_src_basics_bases).map((c) => c.decoder); +const convert_anybaseDecoder = (function () { + let acc = convert_decoders[0].or(convert_decoders[1]); + convert_decoders.slice(2).forEach((d) => (acc = acc.or(d))); + return acc; +})(); +function convert_ip2bytes(ipString) { + if (!isIP(ipString)) { + throw new Error('invalid ip address'); + } + return src_ip_toBytes(ipString); +} +function convert_bytes2ip(ipBuff) { + const ipString = src_ip_toString(ipBuff, 0, ipBuff.length); + if (ipString == null) { + throw new Error('ipBuff is required'); + } + if (!isIP(ipString)) { + throw new Error('invalid ip address'); + } + return ipString; +} +function convert_port2bytes(port) { + const buf = new ArrayBuffer(2); + const view = new DataView(buf); + view.setUint16(0, port); + return new Uint8Array(buf); +} +function convert_bytes2port(buf) { + const view = new DataView(buf.buffer); + return view.getUint16(buf.byteOffset); +} +function convert_str2bytes(str) { + const buf = src_from_string_fromString(str); + const size = Uint8Array.from(node_modules_varint.encode(buf.length)); + return src_concat_concat([size, buf], size.length + buf.length); +} +function convert_bytes2str(buf) { + const size = node_modules_varint.decode(buf); + buf = buf.slice(node_modules_varint.decode.bytes); + if (buf.length !== size) { + throw new Error('inconsistent lengths'); + } + return src_to_string_toString(buf); +} +function convert_mh2bytes(hash) { + let mh; + if (hash[0] === 'Q' || hash[0] === '1') { + mh = ipfs_core_utils_node_modules_multiformats_src_hashes_digest_decode(ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc.decode(`z${hash}`)).bytes; + } + else { + mh = ipfs_core_utils_node_modules_multiformats_src_cid_CID.parse(hash).multihash.bytes; + } + // the address is a varint prefixed multihash string representation + const size = Uint8Array.from(node_modules_varint.encode(mh.length)); + return src_concat_concat([size, mh], size.length + mh.length); +} +function convert_mb2bytes(mbstr) { + const mb = convert_anybaseDecoder.decode(mbstr); + const size = Uint8Array.from(node_modules_varint.encode(mb.length)); + return src_concat_concat([size, mb], size.length + mb.length); +} +function convert_bytes2mb(buf) { + const size = node_modules_varint.decode(buf); + const hash = buf.slice(node_modules_varint.decode.bytes); + if (hash.length !== size) { + throw new Error('inconsistent lengths'); + } + return 'u' + src_to_string_toString(hash, 'base64url'); +} +/** + * Converts bytes to bas58btc string + */ +function convert_bytes2mh(buf) { + const size = node_modules_varint.decode(buf); + const address = buf.slice(node_modules_varint.decode.bytes); + if (address.length !== size) { + throw new Error('inconsistent lengths'); + } + return src_to_string_toString(address, 'base58btc'); +} +function convert_onion2bytes(str) { + const addr = str.split(':'); + if (addr.length !== 2) { + throw new Error(`failed to parse onion addr: ["'${addr.join('", "')}'"]' does not contain a port number`); + } + if (addr[0].length !== 16) { + throw new Error(`failed to parse onion addr: ${addr[0]} not a Tor onion address.`); + } + // onion addresses do not include the multibase prefix, add it before decoding + const buf = ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32.decode('b' + addr[0]); + // onion port number + const port = parseInt(addr[1], 10); + if (port < 1 || port > 65536) { + throw new Error('Port number is not in range(1, 65536)'); + } + const portBuf = convert_port2bytes(port); + return src_concat_concat([buf, portBuf], buf.length + portBuf.length); +} +function convert_onion32bytes(str) { + const addr = str.split(':'); + if (addr.length !== 2) { + throw new Error(`failed to parse onion addr: ["'${addr.join('", "')}'"]' does not contain a port number`); + } + if (addr[0].length !== 56) { + throw new Error(`failed to parse onion addr: ${addr[0]} not a Tor onion3 address.`); + } + // onion addresses do not include the multibase prefix, add it before decoding + const buf = ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32.decode(`b${addr[0]}`); + // onion port number + const port = parseInt(addr[1], 10); + if (port < 1 || port > 65536) { + throw new Error('Port number is not in range(1, 65536)'); + } + const portBuf = convert_port2bytes(port); + return src_concat_concat([buf, portBuf], buf.length + portBuf.length); +} +function convert_bytes2onion(buf) { + const addrBytes = buf.slice(0, buf.length - 2); + const portBytes = buf.slice(buf.length - 2); + const addr = src_to_string_toString(addrBytes, 'base32'); + const port = convert_bytes2port(portBytes); + return `${addr}:${port}`; } +//# sourceMappingURL=convert.js.map +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/@multiformats/multiaddr/dist/src/codec.js -;// CONCATENATED MODULE: ./node_modules/it-first/dist/src/index.js + + + + +/** + * string -> [[str name, str addr]... ] + */ +function stringToStringTuples(str) { + const tuples = []; + const parts = str.split('/').slice(1); // skip first empty elem + if (parts.length === 1 && parts[0] === '') { + return []; + } + for (let p = 0; p < parts.length; p++) { + const part = parts[p]; + const proto = src_protocols_table_getProtocol(part); + if (proto.size === 0) { + tuples.push([part]); + // eslint-disable-next-line no-continue + continue; + } + p++; // advance addr part + if (p >= parts.length) { + throw codec_ParseError('invalid address: ' + str); + } + // if it's a path proto, take the rest + if (proto.path === true) { + tuples.push([ + part, + // should we need to check each path part to see if it's a proto? + // This would allow for other protocols to be added after a unix path, + // however it would have issues if the path had a protocol name in the path + codec_cleanPath(parts.slice(p).join('/')) + ]); + break; + } + tuples.push([part, parts[p]]); + } + return tuples; +} +/** + * [[str name, str addr]... ] -> string + */ +function codec_stringTuplesToString(tuples) { + const parts = []; + tuples.map((tup) => { + const proto = protoFromTuple(tup); + parts.push(proto.name); + if (tup.length > 1 && tup[1] != null) { + parts.push(tup[1]); + } + return null; + }); + return codec_cleanPath(parts.join('/')); +} +/** + * [[str name, str addr]... ] -> [[int code, Uint8Array]... ] + */ +function stringTuplesToTuples(tuples) { + return tuples.map((tup) => { + if (!Array.isArray(tup)) { + tup = [tup]; + } + const proto = protoFromTuple(tup); + if (tup.length > 1) { + return [proto.code, convert_convertToBytes(proto.code, tup[1])]; + } + return [proto.code]; + }); +} +/** + * Convert tuples to string tuples + * + * [[int code, Uint8Array]... ] -> [[int code, str addr]... ] + */ +function tuplesToStringTuples(tuples) { + return tuples.map(tup => { + const proto = protoFromTuple(tup); + if (tup[1] != null) { + return [proto.code, convert_convertToString(proto.code, tup[1])]; + } + return [proto.code]; + }); +} +/** + * [[int code, Uint8Array ]... ] -> Uint8Array + */ +function codec_tuplesToBytes(tuples) { + return fromBytes(src_concat_concat(tuples.map((tup) => { + const proto = protoFromTuple(tup); + let buf = Uint8Array.from(node_modules_varint.encode(proto.code)); + if (tup.length > 1 && tup[1] != null) { + buf = src_concat_concat([buf, tup[1]]); // add address buffer + } + return buf; + }))); +} +/** + * For the passed address, return the serialized size + */ +function codec_sizeForAddr(p, addr) { + if (p.size > 0) { + return p.size / 8; + } + else if (p.size === 0) { + return 0; + } + else { + const size = node_modules_varint.decode(addr); + return size + (node_modules_varint.decode.bytes ?? 0); + } +} +function codec_bytesToTuples(buf) { + const tuples = []; + let i = 0; + while (i < buf.length) { + const code = node_modules_varint.decode(buf, i); + const n = node_modules_varint.decode.bytes ?? 0; + const p = src_protocols_table_getProtocol(code); + const size = codec_sizeForAddr(p, buf.slice(i + n)); + if (size === 0) { + tuples.push([code]); + i += n; + // eslint-disable-next-line no-continue + continue; + } + const addr = buf.slice(i + n, i + n + size); + i += (size + n); + if (i > buf.length) { // did not end _exactly_ at buffer.length + throw codec_ParseError('Invalid address Uint8Array: ' + src_to_string_toString(buf, 'base16')); + } + // ok, tuple seems good. + tuples.push([code, addr]); + } + return tuples; +} +/** + * Uint8Array -> String + */ +function bytesToString(buf) { + const a = codec_bytesToTuples(buf); + const b = tuplesToStringTuples(a); + return codec_stringTuplesToString(b); +} +/** + * String -> Uint8Array + */ +function stringToBytes(str) { + str = codec_cleanPath(str); + const a = stringToStringTuples(str); + const b = stringTuplesToTuples(a); + return codec_tuplesToBytes(b); +} +/** + * String -> Uint8Array + */ +function codec_fromString(str) { + return stringToBytes(str); +} /** - * Returns the first result from an (async) iterable, unless empty, in which - * case returns `undefined` + * Uint8Array -> Uint8Array */ -async function first(source) { - for await (const entry of source) { // eslint-disable-line no-unreachable-loop - return entry; +function fromBytes(buf) { + const err = validateBytes(buf); + if (err != null) { + throw err; } - return undefined; + return Uint8Array.from(buf); // copy } -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/it-last/dist/src/index.js -/** - * Returns the last item of an (async) iterable, unless empty, in which case - * return `undefined` - */ -async function last(source) { - let res; - for await (const entry of source) { - res = entry; +function validateBytes(buf) { + try { + codec_bytesToTuples(buf); // try to parse. will throw if breaks + } + catch (err) { + return err; } - return res; } -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dag/get.js - - - - - - - +function isValidBytes(buf) { + return validateBytes(buf) === undefined; +} +function codec_cleanPath(str) { + return '/' + str.trim().split('/').filter((a) => a).join('/'); +} +function codec_ParseError(str) { + return new Error('Error parsing address: ' + str); +} +function protoFromTuple(tup) { + const proto = src_protocols_table_getProtocol(tup[0]); + return proto; +} +//# sourceMappingURL=codec.js.map +// EXTERNAL MODULE: ./node_modules/err-code/index.js +var err_code = __nccwpck_require__(18598); +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/uint8arrays/dist/src/equals.js /** - * @param {import('../types').Multicodecs} codecs - * @param {import('../types').Options} options + * Returns true if the two passed Uint8Arrays have the same content */ -const dag_get_createGet = (codecs, options) => { - const fn = configure((api, opts) => { - const getBlock = createGet(opts) - - /** - * @type {import('../types').DAGAPI["get"]} - */ - const get = async (cid, options = {}) => { - if (options.path) { - const entry = options.localResolve - ? await first(resolve(cid, options.path, codecs, getBlock, options)) - : await last(resolve(cid, options.path, codecs, getBlock, options)) - /** @type {import('../types').GetResult | undefined} - first and last will return undefined when empty */ - const result = (entry) - - if (!result) { - throw err_code(new Error('Not found'), 'ERR_NOT_FOUND') - } - - return result - } - - const codec = await codecs.getCodec(cid.code) - const block = await getBlock(cid, options) - const node = codec.decode(block) - - return { - value: node, - remainderPath: '' - } +function src_equals_equals(a, b) { + if (a === b) { + return true; } - - return get - }) - - return fn(options) -} - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dag/import.js - - - - - - -const createImport = configure(api => { - /** - * @type {import('../types.js').DAGAPI["import"]} - */ - async function * dagImport (source, options = {}) { - const controller = new AbortController() - const signal = abortSignal(controller.signal, options.signal) - const { headers, body } = await multipart_request_multipartRequest(source, controller, options.headers) - - const res = await api.post('dag/import', { - signal, - headers, - body, - searchParams: toUrlSearchParams({ 'pin-roots': options.pinRoots }) - }) - - for await (const { Root } of res.ndjson()) { - if (Root !== undefined) { - const { Cid: { '/': Cid }, PinErrorMsg } = Root - - yield { - root: { - cid: node_modules_multiformats_src_cid_CID.parse(Cid), - pinErrorMsg: PinErrorMsg - } + if (a.byteLength !== b.byteLength) { + return false; + } + for (let i = 0; i < a.byteLength; i++) { + if (a[i] !== b[i]) { + return false; } - } } - } + return true; +} +//# sourceMappingURL=equals.js.map +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/@multiformats/multiaddr/dist/src/index.js +/** + * @packageDocumentation + * + * An implementation of a Multiaddr in JavaScript + * + * @example + * + * ```js + * import { multiaddr } from '@multiformats/multiaddr' + * + * const ma = multiaddr('/ip4/127.0.0.1/tcp/1234') + * ``` + */ +var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +}; +var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +}; +var _DefaultMultiaddr_string, _DefaultMultiaddr_tuples, _DefaultMultiaddr_stringTuples, _a; - return dagImport -}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dag/put.js +const src_inspect = Symbol.for('nodejs.util.inspect.custom'); +const src_DNS_CODES = [ + src_protocols_table_getProtocol('dns').code, + src_protocols_table_getProtocol('dns4').code, + src_protocols_table_getProtocol('dns6').code, + src_protocols_table_getProtocol('dnsaddr').code +]; /** - * @param {import('../types').Multicodecs} codecs - * @param {import('../types').Options} options + * All configured {@link Resolver}s */ -const put_createPut = (codecs, options) => { - const fn = configure((api) => { - /** - * @type {import('../types').DAGAPI["put"]} - */ - const put = async (dagNode, options = {}) => { - const settings = { - storeCodec: 'dag-cbor', - hashAlg: 'sha2-256', - ...options - } - - let serialized - - if (settings.inputCodec) { - // if you supply an inputCodec, we assume you're passing in a raw, encoded - // block using that codec, so we'll just pass that on to the server and let - // it deal with the decode/encode/store cycle - if (!(dagNode instanceof Uint8Array)) { - throw new Error('Can only inputCodec on raw bytes that can be decoded') - } - serialized = dagNode - } else { - // if you don't supply an inputCodec, we assume you've passed in a JavaScript - // object you want to have encoded using storeCodec, so we'll prepare it for - // you if we have the codec - const storeCodec = await codecs.getCodec(settings.storeCodec) - serialized = storeCodec.encode(dagNode) - // now we have a serialized form, the server should be told to receive it - // in that format - settings.inputCodec = settings.storeCodec - } - - // allow aborting requests on body errors - const controller = new AbortController() - const signal = abortSignal(controller.signal, settings.signal) - - const res = await api.post('dag/put', { - timeout: settings.timeout, - signal, - searchParams: toUrlSearchParams(settings), - ...( - await multipart_request_multipartRequest([serialized], controller, settings.headers) - ) - }) - const data = await res.json() - - return node_modules_multiformats_src_cid_CID.parse(data.Cid['/']) +const src_resolvers = new Map(); +const src_symbol = Symbol.for('@multiformats/js-multiaddr/multiaddr'); +/** + * Creates a Multiaddr from a node-friendly address object + * + * @example + * ```js + * import { fromNodeAddress } from '@multiformats/multiaddr' + * + * fromNodeAddress({address: '127.0.0.1', port: '4001'}, 'tcp') + * // Multiaddr(/ip4/127.0.0.1/tcp/4001) + * ``` + */ +function src_fromNodeAddress(addr, transport) { + if (addr == null) { + throw new Error('requires node address object'); } - - return put - }) - - return fn(options) + if (transport == null) { + throw new Error('requires transport protocol'); + } + let ip; + let host = addr.address; + switch (addr.family) { + case 4: + ip = 'ip4'; + break; + case 6: + ip = 'ip6'; + if (host.includes('%')) { + const parts = host.split('%'); + if (parts.length !== 2) { + throw Error('Multiple ip6 zones in multiaddr'); + } + host = parts[0]; + const zone = parts[1]; + ip = `/ip6zone/${zone}/ip6`; + } + break; + default: + throw Error('Invalid addr family, should be 4 or 6.'); + } + return new DefaultMultiaddr('/' + [ip, host, transport, addr.port].join('/')); } - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dag/resolve.js - - - - -const createResolve = configure(api => { - /** - * @type {import('../types.js').DAGAPI["resolve"]} - */ - const resolve = async (ipfsPath, options = {}) => { - const res = await api.post('dag/resolve', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: `${ipfsPath}${options.path ? `/${options.path}`.replace(/\/[/]+/g, '/') : ''}`, - ...options - }), - headers: options.headers - }) - - const data = await res.json() - - return { cid: node_modules_multiformats_src_cid_CID.parse(data.Cid['/']), remainderPath: data.RemPath } - } - - return resolve -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dag/index.js - - - - - - /** - * @param {import('../types').Multicodecs} codecs - * @param {import('../types').Options} config + * Returns if something is a {@link Multiaddr} that is a resolvable name + * + * @example + * + * ```js + * import { isName, multiaddr } from '@multiformats/multiaddr' + * + * isName(multiaddr('/ip4/127.0.0.1')) + * // false + * isName(multiaddr('/dns/ipfs.io')) + * // true + * ``` */ -function createDag (codecs, config) { - return { - export: createExport(config), - get: dag_get_createGet(codecs, config), - import: createImport(config), - put: put_createPut(codecs, config), - resolve: createResolve(config) - } +function src_isName(addr) { + if (!src_isMultiaddr(addr)) { + return false; + } + // if a part of the multiaddr is resolvable, then return true + return addr.protos().some((proto) => proto.resolvable); } - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dht/response-types.js - -// Response types are defined here = -// https://github.com/libp2p/go-libp2p-core/blob/6e566d10f4a5447317a66d64c7459954b969bdab/routing/query.go#L15-L24 -const SendingQuery = 0 -const PeerResponse = 1 -const FinalPeer = 2 -const QueryError = 3 -const Provider = 4 -const Value = 5 -const AddingPeer = 6 -const DialingPeer = 7 - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dht/map-event.js - - - - - /** - * @typedef {ReturnType} Multiaddr + * Check if object is a {@link Multiaddr} instance + * + * @example + * + * ```js + * import { isMultiaddr, multiaddr } from '@multiformats/multiaddr' + * + * isMultiaddr(5) + * // false + * isMultiaddr(multiaddr('/ip4/127.0.0.1')) + * // true + * ``` */ - +function src_isMultiaddr(value) { + return Boolean(value?.[src_symbol]); +} /** - * @param {import('../types').MapEvent} event - * @returns {import('../types').QueryEvent} + * Creates a {@link Multiaddr} from a {@link MultiaddrInput} */ -const mapEvent = (event) => { - if (event.Type === SendingQuery) { - return { - name: 'SENDING_QUERY', - type: event.Type +class DefaultMultiaddr { + constructor(addr) { + _DefaultMultiaddr_string.set(this, void 0); + _DefaultMultiaddr_tuples.set(this, void 0); + _DefaultMultiaddr_stringTuples.set(this, void 0); + this[_a] = true; + // default + if (addr == null) { + addr = ''; + } + if (addr instanceof Uint8Array) { + this.bytes = fromBytes(addr); + } + else if (typeof addr === 'string') { + if (addr.length > 0 && addr.charAt(0) !== '/') { + throw new Error(`multiaddr "${addr}" must start with a "/"`); + } + this.bytes = codec_fromString(addr); + } + else if (src_isMultiaddr(addr)) { // Multiaddr + this.bytes = fromBytes(addr.bytes); // validate + copy buffer + } + else { + throw new Error('addr must be a string, Buffer, or another Multiaddr'); + } } - } - - if (event.Type === PeerResponse) { - return { - from: peerIdFromString(event.ID), - name: 'PEER_RESPONSE', - type: event.Type, - // TODO: how to infer this from the go-ipfs response - messageType: 0, - // TODO: how to infer this from the go-ipfs response - messageName: 'PUT_VALUE', - closer: (event.Responses || []).map(({ ID, Addrs }) => ({ id: peerIdFromString(ID), multiaddrs: Addrs.map(addr => src_multiaddr(addr)), protocols: [] })), - providers: (event.Responses || []).map(({ ID, Addrs }) => ({ id: peerIdFromString(ID), multiaddrs: Addrs.map(addr => src_multiaddr(addr)), protocols: [] })) - // TODO: how to infer this from the go-ipfs response - // record: ??? + toString() { + if (__classPrivateFieldGet(this, _DefaultMultiaddr_string, "f") == null) { + __classPrivateFieldSet(this, _DefaultMultiaddr_string, bytesToString(this.bytes), "f"); + } + return __classPrivateFieldGet(this, _DefaultMultiaddr_string, "f"); } - } - - if (event.Type === FinalPeer) { - // dht.query ends with a FinalPeer event with no Responses - /** @type {import('../types.js').PeerInfo} */ - let peer = { - // @ts-expect-error go-ipfs does not return this - id: event.ID ?? peerIdFromString(event.ID), - /** @type {Multiaddr[]} */ - multiaddrs: [], - protocols: [] + toJSON() { + return this.toString(); } - - if (event.Responses && event.Responses.length) { - // dht.findPeer has the result in the Responses field - peer = { - id: peerIdFromString(event.Responses[0].ID), - multiaddrs: event.Responses[0].Addrs.map(addr => src_multiaddr(addr)), - protocols: [] - } + toOptions() { + let family; + let transport; + let host; + let port; + let zone = ''; + const tcp = src_protocols_table_getProtocol('tcp'); + const udp = src_protocols_table_getProtocol('udp'); + const ip4 = src_protocols_table_getProtocol('ip4'); + const ip6 = src_protocols_table_getProtocol('ip6'); + const dns6 = src_protocols_table_getProtocol('dns6'); + const ip6zone = src_protocols_table_getProtocol('ip6zone'); + for (const [code, value] of this.stringTuples()) { + if (code === ip6zone.code) { + zone = `%${value ?? ''}`; + } + // default to https when protocol & port are omitted from DNS addrs + if (src_DNS_CODES.includes(code)) { + transport = tcp.name; + port = 443; + host = `${value ?? ''}${zone}`; + family = code === dns6.code ? 6 : 4; + } + if (code === tcp.code || code === udp.code) { + transport = src_protocols_table_getProtocol(code).name; + port = parseInt(value ?? ''); + } + if (code === ip4.code || code === ip6.code) { + transport = src_protocols_table_getProtocol(code).name; + host = `${value ?? ''}${zone}`; + family = code === ip6.code ? 6 : 4; + } + } + if (family == null || transport == null || host == null || port == null) { + throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".'); + } + const opts = { + family, + host, + transport, + port + }; + return opts; } - - return { - name: 'FINAL_PEER', - type: event.Type, - peer + protos() { + return this.protoCodes().map(code => Object.assign({}, src_protocols_table_getProtocol(code))); } - } - - if (event.Type === QueryError) { - return { - name: 'QUERY_ERROR', - type: event.Type, - error: new Error(event.Extra) + protoCodes() { + const codes = []; + const buf = this.bytes; + let i = 0; + while (i < buf.length) { + const code = node_modules_varint.decode(buf, i); + const n = node_modules_varint.decode.bytes ?? 0; + const p = src_protocols_table_getProtocol(code); + const size = codec_sizeForAddr(p, buf.slice(i + n)); + i += (size + n); + codes.push(code); + } + return codes; } - } - - if (event.Type === Provider) { - return { - name: 'PROVIDER', - type: event.Type, - providers: event.Responses.map(({ ID, Addrs }) => ({ id: peerIdFromString(ID), multiaddrs: Addrs.map(addr => src_multiaddr(addr)), protocols: [] })) + protoNames() { + return this.protos().map(proto => proto.name); } - } - - if (event.Type === Value) { - return { - name: 'VALUE', - type: event.Type, - value: dist_src_from_string_fromString(event.Extra, 'base64pad') + tuples() { + if (__classPrivateFieldGet(this, _DefaultMultiaddr_tuples, "f") == null) { + __classPrivateFieldSet(this, _DefaultMultiaddr_tuples, codec_bytesToTuples(this.bytes), "f"); + } + return __classPrivateFieldGet(this, _DefaultMultiaddr_tuples, "f"); } - } - - if (event.Type === AddingPeer) { - const peers = event.Responses.map(({ ID }) => peerIdFromString(ID)) - - if (!peers.length) { - throw new Error('No peer found') + stringTuples() { + if (__classPrivateFieldGet(this, _DefaultMultiaddr_stringTuples, "f") == null) { + __classPrivateFieldSet(this, _DefaultMultiaddr_stringTuples, tuplesToStringTuples(this.tuples()), "f"); + } + return __classPrivateFieldGet(this, _DefaultMultiaddr_stringTuples, "f"); } - - return { - name: 'ADDING_PEER', - type: event.Type, - peer: peers[0] + encapsulate(addr) { + addr = new DefaultMultiaddr(addr); + return new DefaultMultiaddr(this.toString() + addr.toString()); } - } - - if (event.Type === DialingPeer) { - return { - name: 'DIALING_PEER', - type: event.Type, - peer: peerIdFromString(event.ID) + decapsulate(addr) { + const addrString = addr.toString(); + const s = this.toString(); + const i = s.lastIndexOf(addrString); + if (i < 0) { + throw new Error(`Address ${this.toString()} does not contain subaddress: ${addr.toString()}`); + } + return new DefaultMultiaddr(s.slice(0, i)); } - } - - throw new Error('Unknown DHT event type') -} - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dht/find-peer.js - - - - -const createFindPeer = configure(api => { - /** - * @type {import('../types').DHTAPI["findPeer"]} - */ - async function * findPeer (peerId, options = {}) { - const res = await api.post('dht/findpeer', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: peerId, - ...options - }), - headers: options.headers - }) - - for await (const event of res.ndjson()) { - yield mapEvent(event) + decapsulateCode(code) { + const tuples = this.tuples(); + for (let i = tuples.length - 1; i >= 0; i--) { + if (tuples[i][0] === code) { + return new DefaultMultiaddr(codec_tuplesToBytes(tuples.slice(0, i))); + } + } + return this; } - } - - return findPeer -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dht/find-provs.js - - - - -const createFindProvs = configure(api => { - /** - * @type {import('../types.js').DHTAPI["findProvs"]} - */ - async function * findProvs (cid, options = {}) { - const res = await api.post('dht/findprovs', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: cid.toString(), - ...options - }), - headers: options.headers - }) - - for await (const event of res.ndjson()) { - yield mapEvent(event) + getPeerId() { + try { + const tuples = this.stringTuples().filter((tuple) => { + if (tuple[0] === protocols_table_names.ipfs.code) { + return true; + } + return false; + }); + // Get the last ipfs tuple ['ipfs', 'peerid string'] + const tuple = tuples.pop(); + if (tuple?.[1] != null) { + const peerIdStr = tuple[1]; + // peer id is base58btc encoded string but not multibase encoded so add the `z` + // prefix so we can validate that it is correctly encoded + if (peerIdStr[0] === 'Q' || peerIdStr[0] === '1') { + return src_to_string_toString(ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc.decode(`z${peerIdStr}`), 'base58btc'); + } + // try to parse peer id as CID + return src_to_string_toString(ipfs_core_utils_node_modules_multiformats_src_cid_CID.parse(peerIdStr).multihash.bytes, 'base58btc'); + } + return null; + } + catch (e) { + return null; + } } - } - - return findProvs -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/dist/src/to-string.js - + getPath() { + let path = null; + try { + path = this.stringTuples().filter((tuple) => { + const proto = src_protocols_table_getProtocol(tuple[0]); + if (proto.path === true) { + return true; + } + return false; + })[0][1]; + if (path == null) { + path = null; + } + } + catch { + path = null; + } + return path; + } + equals(addr) { + return src_equals_equals(this.bytes, addr.bytes); + } + async resolve(options) { + const resolvableProto = this.protos().find((p) => p.resolvable); + // Multiaddr is not resolvable? + if (resolvableProto == null) { + return [this]; + } + const resolver = src_resolvers.get(resolvableProto.name); + if (resolver == null) { + throw err_code(new Error(`no available resolver for ${resolvableProto.name}`), 'ERR_NO_AVAILABLE_RESOLVER'); + } + const addresses = await resolver(this, options); + return addresses.map((a) => new DefaultMultiaddr(a)); + } + nodeAddress() { + const options = this.toOptions(); + if (options.transport !== 'tcp' && options.transport !== 'udp') { + throw new Error(`multiaddr must have a valid format - no protocol with name: "${options.transport}". Must have a valid transport protocol: "{tcp, udp}"`); + } + return { + family: options.family, + address: options.host, + port: options.port + }; + } + isThinWaistAddress(addr) { + const protos = (addr ?? this).protos(); + if (protos.length !== 2) { + return false; + } + if (protos[0].code !== 4 && protos[0].code !== 41) { + return false; + } + if (protos[1].code !== 6 && protos[1].code !== 273) { + return false; + } + return true; + } + /** + * Returns Multiaddr as a human-readable string + * https://nodejs.org/api/util.html#utilinspectcustom + * + * @example + * ```js + * import { multiaddr } from '@multiformats/multiaddr' + * + * console.info(multiaddr('/ip4/127.0.0.1/tcp/4001')) + * // 'Multiaddr(/ip4/127.0.0.1/tcp/4001)' + * ``` + */ + [(_DefaultMultiaddr_string = new WeakMap(), _DefaultMultiaddr_tuples = new WeakMap(), _DefaultMultiaddr_stringTuples = new WeakMap(), _a = src_symbol, src_inspect)]() { + return `Multiaddr(${bytesToString(this.bytes)})`; + } +} /** - * Turns a `Uint8Array` into a string. + * A function that takes a {@link MultiaddrInput} and returns a {@link Multiaddr} * - * Supports `utf8`, `utf-8` and any encoding supported by the multibase module. + * @example + * ```js + * import { multiaddr } from '@libp2p/multiaddr' * - * Also `ascii` which is similar to node's 'binary' encoding. + * multiaddr('/ip4/127.0.0.1/tcp/4001') + * // Multiaddr(/ip4/127.0.0.1/tcp/4001) + * ``` + * + * @param {MultiaddrInput} [addr] - If String or Uint8Array, needs to adhere to the address format of a [multiaddr](https://github.com/multiformats/multiaddr#string-format) */ -function dist_src_to_string_toString(array, encoding = 'utf8') { - const base = dist_src_util_bases[encoding]; - if (base == null) { - throw new Error(`Unsupported encoding "${encoding}"`); - } - if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) { - return globalThis.Buffer.from(array.buffer, array.byteOffset, array.byteLength).toString('utf8'); - } - // strip multibase prefix - return base.encoder.encode(array).substring(1); +function dist_src_multiaddr(addr) { + return new DefaultMultiaddr(addr); } -//# sourceMappingURL=to-string.js.map -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dht/get.js - - +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@multiformats/multiaddr-to-uri/dist/src/index.js - -const dht_get_createGet = configure(api => { - /** - * @type {import('../types').DHTAPI["get"]} - */ - async function * get (key, options = {}) { - const res = await api.post('dht/get', { - signal: options.signal, - searchParams: toUrlSearchParams({ - // arg: base36.encode(key), - arg: key instanceof Uint8Array ? dist_src_to_string_toString(key) : key.toString(), - ...options - }), - headers: options.headers - }) - - for await (const event of res.ndjson()) { - yield mapEvent(event) +function extractSNI(ma) { + let sniProtoCode; + try { + sniProtoCode = protocols_table_getProtocol('sni').code; } - } - - return get -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dht/provide.js - - - - -const createProvide = configure(api => { - /** - * @type {import('../types').DHTAPI["provide"]} - */ - async function * provide (cids, options = { recursive: false }) { - /** @type {import('../types').CID[]} */ - const cidArr = Array.isArray(cids) ? cids : [cids] - - const res = await api.post('dht/provide', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: cidArr.map(cid => cid.toString()), - ...options - }), - headers: options.headers - }) - - for await (const event of res.ndjson()) { - yield mapEvent(event) + catch (e) { + // No SNI protocol in multiaddr + return null; } - } - - return provide -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dht/put.js - - - - - - - -const dht_put_createPut = configure(api => { - /** - * @type {import('../types.js').DHTAPI["put"]} - */ - async function * put (key, value, options = {}) { - // allow aborting requests on body errors - const controller = new AbortController() - const signal = abortSignal(controller.signal, options.signal) - - const res = await api.post('dht/put', { - signal, - searchParams: toUrlSearchParams({ - arg: key instanceof Uint8Array ? dist_src_to_string_toString(key) : key.toString(), - ...options - }), - ...( - await multipart_request_multipartRequest([value], controller, options.headers) - ) - }) - - for await (const event of res.ndjson()) { - yield mapEvent(event) + for (const [proto, value] of ma) { + if (proto === sniProtoCode && value !== undefined) { + return value; + } + } + return null; +} +function hasTLS(ma) { + return ma.some(([proto, _]) => proto === protocols_table_getProtocol('tls').code); +} +function interpretNext(headProtoCode, headProtoVal, restMa) { + const interpreter = interpreters[protocols_table_getProtocol(headProtoCode).name]; + if (interpreter === undefined) { + throw new Error(`Can't interpret protocol ${protocols_table_getProtocol(headProtoCode).name}`); + } + const restVal = interpreter(headProtoVal, restMa); + if (headProtoCode === protocols_table_getProtocol('ip6').code) { + return `[${restVal}]`; + } + return restVal; +} +const interpreters = { + ip4: (value, restMa) => value, + ip6: (value, restMa) => { + if (restMa.length === 0) { + return value; + } + return `[${value}]`; + }, + tcp: (value, restMa) => { + const tailProto = restMa.pop(); + if (tailProto === undefined) { + throw new Error('Unexpected end of multiaddr'); + } + return `tcp://${interpretNext(tailProto[0], tailProto[1] ?? '', restMa)}:${value}`; + }, + udp: (value, restMa) => { + const tailProto = restMa.pop(); + if (tailProto === undefined) { + throw new Error('Unexpected end of multiaddr'); + } + return `udp://${interpretNext(tailProto[0], tailProto[1] ?? '', restMa)}:${value}`; + }, + dnsaddr: (value, restMa) => value, + dns4: (value, restMa) => value, + dns6: (value, restMa) => value, + dns: (value, restMa) => value, + ipfs: (value, restMa) => { + const tailProto = restMa.pop(); + if (tailProto === undefined) { + throw new Error('Unexpected end of multiaddr'); + } + return `${interpretNext(tailProto[0], tailProto[1] ?? '', restMa)}/ipfs/${value}`; + }, + p2p: (value, restMa) => { + const tailProto = restMa.pop(); + if (tailProto === undefined) { + throw new Error('Unexpected end of multiaddr'); + } + return `${interpretNext(tailProto[0], tailProto[1] ?? '', restMa)}/p2p/${value}`; + }, + http: (value, restMa) => { + const maHasTLS = hasTLS(restMa); + const sni = extractSNI(restMa); + if (maHasTLS && sni !== null) { + return `https://${sni}`; + } + const protocol = maHasTLS ? 'https://' : 'http://'; + const tailProto = restMa.pop(); + if (tailProto === undefined) { + throw new Error('Unexpected end of multiaddr'); + } + let baseVal = interpretNext(tailProto[0], tailProto[1] ?? '', restMa); + // We are reinterpreting the base as http, so we need to remove the tcp:// if it's there + baseVal = baseVal.replace('tcp://', ''); + return `${protocol}${baseVal}`; + }, + tls: (value, restMa) => { + // Noop, the parent context knows that it's tls. We don't need to do + // anything here + const tailProto = restMa.pop(); + if (tailProto === undefined) { + throw new Error('Unexpected end of multiaddr'); + } + return interpretNext(tailProto[0], tailProto[1] ?? '', restMa); + }, + sni: (value, restMa) => { + // Noop, the parent context uses the sni information, we don't need to do + // anything here + const tailProto = restMa.pop(); + if (tailProto === undefined) { + throw new Error('Unexpected end of multiaddr'); + } + return interpretNext(tailProto[0], tailProto[1] ?? '', restMa); + }, + https: (value, restMa) => { + const tailProto = restMa.pop(); + if (tailProto === undefined) { + throw new Error('Unexpected end of multiaddr'); + } + let baseVal = interpretNext(tailProto[0], tailProto[1] ?? '', restMa); + // We are reinterpreting the base as http, so we need to remove the tcp:// if it's there + baseVal = baseVal.replace('tcp://', ''); + return `https://${baseVal}`; + }, + ws: (value, restMa) => { + const maHasTLS = hasTLS(restMa); + const sni = extractSNI(restMa); + if (maHasTLS && sni !== null) { + return `wss://${sni}`; + } + const protocol = maHasTLS ? 'wss://' : 'ws://'; + const tailProto = restMa.pop(); + if (tailProto === undefined) { + throw new Error('Unexpected end of multiaddr'); + } + let baseVal = interpretNext(tailProto[0], tailProto[1] ?? '', restMa); + // We are reinterpreting the base, so we need to remove the tcp:// if it's there + baseVal = baseVal.replace('tcp://', ''); + return `${protocol}${baseVal}`; + }, + wss: (value, restMa) => { + const tailProto = restMa.pop(); + if (tailProto === undefined) { + throw new Error('Unexpected end of multiaddr'); + } + let baseVal = interpretNext(tailProto[0], tailProto[1] ?? '', restMa); + // We are reinterpreting the base as http, so we need to remove the tcp:// if it's there + baseVal = baseVal.replace('tcp://', ''); + return `wss://${baseVal}`; + }, + 'p2p-websocket-star': (value, restMa) => { + const tailProto = restMa.pop(); + if (tailProto === undefined) { + throw new Error('Unexpected end of multiaddr'); + } + return `${interpretNext(tailProto[0], tailProto[1] ?? '', restMa)}/p2p-websocket-star`; + }, + 'p2p-webrtc-star': (value, restMa) => { + const tailProto = restMa.pop(); + if (tailProto === undefined) { + throw new Error('Unexpected end of multiaddr'); + } + return `${interpretNext(tailProto[0], tailProto[1] ?? '', restMa)}/p2p-webrtc-star`; + }, + 'p2p-webrtc-direct': (value, restMa) => { + const tailProto = restMa.pop(); + if (tailProto === undefined) { + throw new Error('Unexpected end of multiaddr'); + } + return `${interpretNext(tailProto[0], tailProto[1] ?? '', restMa)}/p2p-webrtc-direct`; + } +}; +function multiaddrToUri(input, opts) { + const ma = src_multiaddr(input); + const parts = ma.stringTuples(); + const head = parts.pop(); + if (head === undefined) { + throw new Error('Unexpected end of multiaddr'); + } + const protocol = protocols_table_getProtocol(head[0]); + const interpreter = interpreters[protocol.name]; + if (interpreter == null) { + throw new Error(`No interpreter found for ${protocol.name}`); + } + let uri = interpreter(head[1] ?? '', parts); + if (opts?.assumeHttp !== false && head[0] === protocols_table_getProtocol('tcp').code) { + // If rightmost proto is tcp, we assume http here + uri = uri.replace('tcp://', 'http://'); + if (head[1] === '443' || head[1] === '80') { + if (head[1] === '443') { + uri = uri.replace('http://', 'https://'); + } + // Drop the port + uri = uri.substring(0, uri.lastIndexOf(':')); + } } - } - - return put -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dht/query.js - - - - -const createQuery = configure(api => { - /** - * @type {import('../types.js').DHTAPI["query"]} - */ - async function * query (peerId, options = {}) { - const res = await api.post('dht/query', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: peerId.toString(), - ...options - }), - headers: options.headers - }) + return uri; +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/to-url-string.js - for await (const event of res.ndjson()) { - yield mapEvent(event) - } - } - return query -}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dht/index.js +/** + * @typedef {import('@multiformats/multiaddr').Multiaddr} Multiaddr + */ +/** + * @param {string|Multiaddr|URL} url - A string, multiaddr or URL to convert to a url string + * @returns {string} + */ +function toUrlString (url) { + try { + // @ts-expect-error + url = multiaddrToUri(dist_src_multiaddr(url)) + } catch (/** @type {any} */ err) { } + url = url.toString() + return url +} +// EXTERNAL MODULE: external "http" +var external_http_ = __nccwpck_require__(13685); +// EXTERNAL MODULE: external "https" +var external_https_ = __nccwpck_require__(95687); +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/agent.js /** - * @param {import('../types').Options} config + * @param {URL} [url] */ -function createDht (config) { - return { - findPeer: createFindPeer(config), - findProvs: createFindProvs(config), - get: dht_get_createGet(config), - provide: createProvide(config), - put: dht_put_createPut(config), - query: createQuery(config) +/* harmony default export */ const src_agent = ((url) => { + if (!url) { + throw new Error('URL required') } -} - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/diag/cmds.js - - - -const createCmds = configure(api => { - /** - * @type {import('../types').DiagAPI["cmds"]} - */ - async function cmds (options = {}) { - const res = await api.post('diag/cmds', { - signal: options.signal, - searchParams: toUrlSearchParams(options), - headers: options.headers - }) - return res.json() - } - return cmds -}) + return url.protocol.startsWith('https') ? external_https_.Agent : external_http_.Agent +}); -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/diag/net.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/core.js +/* eslint-env browser */ -const createNet = configure(api => { - /** - * @type {import('../types').DiagAPI["net"]} - */ - async function net (options = {}) { - const res = await api.post('diag/net', { - signal: options.signal, - searchParams: toUrlSearchParams(options), - headers: options.headers - }) - return res.json() - } - return net -}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/diag/sys.js -const createSys = configure(api => { - /** - * @type {import('../types').DiagAPI["sys"]} - */ - async function sys (options = {}) { - const res = await api.post('diag/sys', { - signal: options.signal, - searchParams: toUrlSearchParams(options), - headers: options.headers - }) - return res.json() - } - return sys -}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/diag/index.js +const log = logger('js-kubo-rpc-client:lib:error-handler') +const core_merge = node_modules_merge_options.bind({ ignoreUndefined: true }) +const DEFAULT_PROTOCOL = env.isBrowser || env.isWebWorker ? location.protocol : 'http' +const DEFAULT_HOST = env.isBrowser || env.isWebWorker ? location.hostname : 'localhost' +const DEFAULT_PORT = env.isBrowser || env.isWebWorker ? location.port : '5001' /** - * @param {import('../types').Options} config + * @typedef {import('../types').Options} Options */ -function createDiag (config) { - return { - cmds: createCmds(config), - net: createNet(config), - sys: createSys(config) - } -} - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/cp.js - +/** + * @typedef {import('../types').Multiaddr} Multiaddr + */ +/** + * @param {Options|URL|Multiaddr|string} [options] + * @returns {Options} + */ +const normalizeOptions = (options = {}) => { + let url + /** @type {Options} */ + let opts = {} + let agent -const createCp = configure(api => { - /** - * @type {import('../types').FilesAPI["cp"]} - */ - async function cp (sources, destination, options = {}) { - /** @type {import('../types').IPFSPath[]} */ - const sourceArr = Array.isArray(sources) ? sources : [sources] + if (typeof options === 'string' || isMultiaddr(options)) { + url = new URL(toUrlString(options)) + } else if (options instanceof URL) { + url = options + } else if (typeof options.url === 'string' || isMultiaddr(options.url)) { + url = new URL(toUrlString(options.url)) + opts = options + } else if (options.url instanceof URL) { + url = options.url + opts = options + } else { + opts = options || {} - const res = await api.post('files/cp', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: sourceArr.concat(destination).map(src => node_modules_multiformats_src_cid_CID.asCID(src) ? `/ipfs/${src}` : src), - ...options - }), - headers: options.headers - }) + const protocol = (opts.protocol || DEFAULT_PROTOCOL).replace(':', '') + const host = (opts.host || DEFAULT_HOST).split(':')[0] + const port = (opts.port || DEFAULT_PORT) - await res.text() + url = new URL(`${protocol}://${host}:${port}`) } - return cp -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/flush.js - - + if (opts.apiPath) { + url.pathname = opts.apiPath + } else if (url.pathname === '/' || url.pathname === undefined) { + url.pathname = 'api/v0' + } -const createFlush = configure(api => { - /** - * @type {import('../types').FilesAPI["flush"]} - */ - async function flush (path, options = {}) { - if (!path || typeof path !== 'string') { - throw new Error('ipfs.files.flush requires a path') - } + if (env.isNode) { + const Agent = src_agent(url) - const res = await api.post('files/flush', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: path, - ...options - }), - headers: options.headers + agent = opts.agent || new Agent({ + keepAlive: true, + // Similar to browsers which limit connections to six per host + maxSockets: 6 }) - const data = await res.json() - - return node_modules_multiformats_src_cid_CID.parse(data.Cid) } - return flush -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/object-to-camel.js -/** - * Convert object properties to camel case. - * NOT recursive! - * e.g. - * AgentVersion => agentVersion - * ID => id - * - * @param {Record} obj - */ -function objectToCamel (obj) { - if (obj == null) { - return obj + return { + ...opts, + host: url.host, + protocol: url.protocol.replace(':', ''), + port: Number(url.port), + apiPath: url.pathname, + url, + agent } - - const caps = /^[A-Z]+$/ - - /** @type {Record} */ - const output = {} - - return Object.keys(obj).reduce((camelObj, k) => { - if (caps.test(k)) { // all caps - camelObj[k.toLowerCase()] = obj[k] - } else if (caps.test(k[0])) { // pascal - camelObj[k[0].toLowerCase() + k.slice(1)] = obj[k] - } else { - camelObj[k] = obj[k] - } - return camelObj - }, output) } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/object-to-camel-with-metadata.js - - /** - * @param {Record} entry + * @param {Response} response */ -function objectToCamelWithMetadata (entry) { - const file = objectToCamel(entry) - - if (Object.prototype.hasOwnProperty.call(file, 'mode')) { - file.mode = parseInt(file.mode, 8) - } +const errorHandler = async (response) => { + let msg - if (Object.prototype.hasOwnProperty.call(file, 'mtime')) { - file.mtime = { - secs: file.mtime, - nsecs: file.mtimeNsecs || 0 + try { + if ((response.headers.get('Content-Type') || '').startsWith('application/json')) { + const data = await response.json() + log(data) + msg = data.Message || data.message + } else { + msg = await response.text() } - - delete file.mtimeNsecs + } catch (/** @type {any} */ err) { + log('Failed to parse error response', err) + // Failed to extract/parse error message from response + msg = err.message } - return file -} - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/ls.js - - - - + /** @type {Error} */ + let error = new http.HTTPError(response) -const createLs = configure(api => { - /** - * @type {import('../types').FilesAPI["ls"]} - */ - async function * ls (path, options = {}) { - if (!path) { - throw new Error('ipfs.files.ls requires a path') + if (msg) { + // This is what rs-ipfs returns where there's a timeout + if (msg.includes('deadline has elapsed')) { + error = new http.TimeoutError() } - const res = await api.post('files/ls', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: node_modules_multiformats_src_cid_CID.asCID(path) ? `/ipfs/${path}` : path, - // default long to true, diverges from go-ipfs where its false by default - long: true, - ...options, - stream: true - }), - headers: options.headers - }) - - for await (const result of res.ndjson()) { - // go-ipfs does not yet support the "stream" option - if ('Entries' in result) { - for (const entry of result.Entries || []) { - yield ls_toCoreInterface(objectToCamelWithMetadata(entry)) - } - } else { - yield ls_toCoreInterface(objectToCamelWithMetadata(result)) - } + // This is what go-ipfs returns where there's a timeout + if (msg && msg.includes('context deadline exceeded')) { + error = new http.TimeoutError() } } - return ls -}) -/** - * @param {*} entry - */ -function ls_toCoreInterface (entry) { - if (entry.hash) { - entry.cid = node_modules_multiformats_src_cid_CID.parse(entry.hash) + // This also gets returned + if (msg && msg.includes('request timed out')) { + error = new http.TimeoutError() } - delete entry.hash - - entry.type = entry.type === 1 ? 'directory' : 'file' + // If we managed to extract a message from the response, use it + if (msg) { + error.message = msg + } - return entry + throw error } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/mkdir.js - - - -const createMkdir = configure(api => { - /** - * @type {import('../types').FilesAPI["mkdir"]} - */ - async function mkdir (path, options = {}) { - const res = await api.post('files/mkdir', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: path, - ...options - }), - headers: options.headers - }) - - await res.text() - } - return mkdir -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/mv.js +const KEBAB_REGEX = /[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g +/** + * @param {string} str + */ +const kebabCase = (str) => { + return str.replace(KEBAB_REGEX, function (match) { + return '-' + match.toLowerCase() + }) +} +/** + * @param {string | number} value + */ +const parseTimeout = (value) => { + return typeof value === 'string' ? parse_duration(value) : value +} -const createMv = configure(api => { +class Client extends http { /** - * @type {import('../types').FilesAPI["mv"]} + * @param {Options|URL|Multiaddr|string} [options] */ - async function mv (sources, destination, options = {}) { - if (!Array.isArray(sources)) { - sources = [sources] - } - - const res = await api.post('files/mv', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: sources.concat(destination), - ...options - }), - headers: options.headers - }) - await res.text() - } - - return mv -}) - -// EXTERNAL MODULE: ./node_modules/stream-to-it/source.js -var source = __nccwpck_require__(6581); -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/read.js + constructor (options = {}) { + const opts = normalizeOptions(options) + super({ + timeout: parseTimeout(opts.timeout || 0) || undefined, + headers: opts.headers, + base: `${opts.url}`, + handleError: errorHandler, + transformSearchParams: (search) => { + const out = new URLSearchParams() -// @ts-expect-error no types + for (const [key, value] of search) { + if ( + value !== 'undefined' && + value !== 'null' && + key !== 'signal' + ) { + out.append(kebabCase(key), value) + } + // @ts-expect-error server timeouts are strings + if (key === 'timeout' && !isNaN(value)) { + out.append(kebabCase(key), value) + } + } -const createRead = configure(api => { - /** - * @type {import('../types').FilesAPI["read"]} - */ - async function * read (path, options = {}) { - const res = await api.post('files/read', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: path, - count: options.length, - ...options - }), - headers: options.headers + return out + }, + // @ts-expect-error this can be a https agent or a http agent + agent: opts.agent }) - yield * source(res.body) - } - return read -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/rm.js - - + // @ts-expect-error - cannot delete no-optional fields + delete this.get + // @ts-expect-error - cannot delete no-optional fields + delete this.put + // @ts-expect-error - cannot delete no-optional fields + delete this.delete + // @ts-expect-error - cannot delete no-optional fields + delete this.options + const fetch = this.fetch -const files_rm_createRm = configure(api => { - /** - * @type {import('../types').FilesAPI["rm"]} - */ - async function rm (path, options = {}) { - const res = await api.post('files/rm', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: path, - ...options - }), - headers: options.headers - }) + /** + * @param {string | Request} resource + * @param {import('../types').HTTPOptions} options + */ + this.fetch = (resource, options = {}) => { + if (typeof resource === 'string' && !resource.startsWith('/')) { + resource = `${opts.url}/${resource}` + } - const body = await res.text() - // we don't expect text body to be ever present - // (if so, it means an error such as https://github.com/ipfs/go-ipfs/issues/8606) - if (body !== '') { - /** @type {Error} */ - const error = new http.HTTPError(res) - error.message = body - throw error + return fetch.call(this, resource, core_merge(options, { + method: 'POST' + })) } } - return rm -}) +} -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/stat.js +const HTTPError = http.HTTPError +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/configure.js +/* eslint-env browser */ +/** + * Set default configuration and call create function with them + * + * @template T + * @param {import('../types').ConfigureFn} fn + * @returns {import('../types').ConfigureFactory} + */ +const configure = (fn) => { + return (options) => { + return fn(new Client(options), options) + } +} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/mode-to-string.js -const files_stat_createStat = configure(api => { - /** - * @type {import('../types').FilesAPI["stat"]} - */ - async function stat (path, options = {}) { - const res = await api.post('files/stat', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: path, - ...options - }), - headers: options.headers - }) - const data = await res.json() +/** + * @param {number | string | undefined} mode + */ +function modeToString (mode) { + if (mode == null) { + return undefined + } - data.WithLocality = data.WithLocality || false - return stat_toCoreInterface(objectToCamelWithMetadata(data)) + if (typeof mode === 'string') { + return mode } - return stat -}) -/** - * @param {*} entry - */ -function stat_toCoreInterface (entry) { - entry.cid = node_modules_multiformats_src_cid_CID.parse(entry.hash) - delete entry.hash - return entry + return mode.toString(8).padStart(4, '0') } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/write.js - +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/parse-mtime.js +/** + * @param {any} input + */ +function parseMtime (input) { + if (input == null) { + return undefined + } + /** @type {{ secs: number, nsecs?: number } | undefined} */ + let mtime + // { secs, nsecs } + if (input.secs != null) { + mtime = { + secs: input.secs, + nsecs: input.nsecs + } + } + // UnixFS TimeSpec + if (input.Seconds != null) { + mtime = { + secs: input.Seconds, + nsecs: input.FractionalNanoseconds + } + } -const createWrite = configure(api => { - /** - * @type {import('../types').FilesAPI["write"]} - */ - async function write (path, input, options = {}) { - // allow aborting requests on body errors - const controller = new AbortController() - const signal = abortSignal(controller.signal, options.signal) + // process.hrtime() + if (Array.isArray(input)) { + mtime = { + secs: input[0], + nsecs: input[1] + } + } - const res = await api.post('files/write', { - signal, - searchParams: toUrlSearchParams({ - arg: path, - streamChannels: true, - count: options.length, - ...options - }), - ...( - await multipart_request_multipartRequest([{ - content: input, - path: 'arg', - mode: modeToString(options.mode), - mtime: parseMtime(options.mtime) - }], controller, options.headers) - ) - }) + // Javascript Date + if (input instanceof Date) { + const ms = input.getTime() + const secs = Math.floor(ms / 1000) - await res.text() + mtime = { + secs, + nsecs: (ms - (secs * 1000)) * 1000 + } } - return write -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/index.js + /* + TODO: https://github.com/ipfs/aegir/issues/487 + // process.hrtime.bigint() + if (input instanceof BigInt) { + const secs = input / BigInt(1e9) + const nsecs = input - (secs * BigInt(1e9)) + mtime = { + secs: parseInt(secs.toString()), + nsecs: parseInt(nsecs.toString()) + } + } + */ + if (!Object.prototype.hasOwnProperty.call(mtime, 'secs')) { + return undefined + } + if (mtime != null && mtime.nsecs != null && (mtime.nsecs < 0 || mtime.nsecs > 999999999)) { + throw err_code(new Error('mtime-nsecs must be within the range [0,999999999]'), 'ERR_INVALID_MTIME_NSECS') + } + return mtime +} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/to-url-search-params.js /** - * @param {import('../types').Options} config + * @param {*} params + * @returns {URLSearchParams} */ -function createFiles (config) { - return { - cp: createCp(config), - flush: createFlush(config), - ls: createLs(config), - mkdir: createMkdir(config), - mv: createMv(config), - read: createRead(config), - rm: files_rm_createRm(config), - stat: files_stat_createStat(config), - write: createWrite(config) +function toUrlSearchParams ({ arg, searchParams, hashAlg, mtime, mode, ...options } = {}) { + if (searchParams) { + options = { + ...options, + ...searchParams + } } -} - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/key/export.js - - -const export_createExport = configure(api => { - /** - * @type {import('./types.js').KeyAPI['export']} - */ - const exportKey = async (name, password, options = {}) => { - throw err_code(new Error('Not implemented'), 'ERR_NOT_IMPLEMENTED') + if (hashAlg) { + options.hash = hashAlg } - return exportKey -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/key/gen.js - - - - -/** @type {import('./types.js').GenOptions} */ -const defaultOptions = { - type: 'ed25519' -} - -const createGen = configure(api => { - /** - * @type {import('./types.js').KeyAPI['gen']} - */ - async function gen (name, options = defaultOptions) { - const res = await api.post('key/gen', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: name, - ...options - }), - headers: options.headers - }) - const data = await res.json() + if (mtime != null) { + mtime = parseMtime(mtime) - // @ts-expect-error server output is not typed - return objectToCamel(data) + options.mtime = mtime.secs + options.mtimeNsecs = mtime.nsecs } - return gen -}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/key/import.js + if (mode != null) { + options.mode = modeToString(mode) + } + if (options.timeout && !isNaN(options.timeout)) { + // server API expects timeouts as strings + options.timeout = `${options.timeout}ms` + } + if (arg === undefined || arg === null) { + arg = [] + } else if (!Array.isArray(arg)) { + arg = [arg] + } + const urlSearchParams = new URLSearchParams(options) -const import_createImport = configure(api => { - /** - * @type {import('./types.js').KeyAPI['import']} - */ - async function importKey (name, pem, password, options = {}) { - const res = await api.post('key/import', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: name, - pem, - password, - ...options - }), - headers: options.headers - }) - const data = await res.json() + arg.forEach((/** @type {any} */ arg) => urlSearchParams.append('arg', arg)) - // @ts-expect-error server output is not typed - return objectToCamel(data) - } - return importKey -}) + return urlSearchParams +} -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/key/list.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/bitswap/wantlist.js -const list_createList = configure(api => { +const createWantlist = configure(api => { /** - * @type {import('../types.js').KeyAPI["list"]} + * @type {import('../types').BitswapAPI["wantlist"]} */ - async function list (options = {}) { - const res = await api.post('key/list', { + async function wantlist (options = {}) { + const res = await (await api.post('bitswap/wantlist', { signal: options.signal, searchParams: toUrlSearchParams(options), headers: options.headers - }) - const data = await res.json() + })).json() - return (data.Keys || []).map((/** @type {any} **/ k) => objectToCamel(k)) + return (res.Keys || []).map((/** @type {{ '/': string }} */ k) => node_modules_multiformats_src_cid_CID.parse(k['/'])) } - return list + return wantlist }) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/key/rename.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/bitswap/wantlist-for-peer.js -const createRename = configure(api => { +const createWantlistForPeer = configure(api => { /** - * @type {import('./types.js').KeyAPI['rename']} + * @type {import('../types').BitswapAPI["wantlistForPeer"]} */ - async function rename (oldName, newName, options = {}) { - const res = await api.post('key/rename', { + async function wantlistForPeer (peerId, options = {}) { + const res = await (await api.post('bitswap/wantlist', { signal: options.signal, searchParams: toUrlSearchParams({ - arg: [ - oldName, - newName - ], - ...options + ...options, + peer: peerId.toString() }), headers: options.headers - }) + })).json() - // @ts-expect-error server output is not typed - return objectToCamel(await res.json()) + return (res.Keys || []).map((/** @type {{ '/': string }} */ k) => node_modules_multiformats_src_cid_CID.parse(k['/'])) } - return rename + return wantlistForPeer }) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/key/rm.js - - - - -const key_rm_createRm = configure(api => { - /** - * @type {import('../types').KeyAPI["rm"]} - */ - async function rm (name, options = {}) { - const res = await api.post('key/rm', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: name, - ...options - }), - headers: options.headers - }) - const data = await res.json() - - // @ts-expect-error server output is not typed - return objectToCamel(data.Keys[0]) +;// CONCATENATED MODULE: ./node_modules/@libp2p/interface-peer-id/dist/src/index.js +const dist_src_symbol = Symbol.for('@libp2p/peer-id'); +function src_isPeerId(other) { + return other != null && Boolean(other[dist_src_symbol]); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@libp2p/interfaces/dist/src/errors.js +/** + * When this error is thrown it means an operation was aborted, + * usually in response to the `abort` event being emitted by an + * AbortSignal. + */ +class errors_AbortError extends Error { + code; + type; + constructor(message = 'The operation was aborted') { + super(message); + this.code = errors_AbortError.code; + this.type = errors_AbortError.type; + } + static code = (/* unused pure expression or super */ null && ('ABORT_ERR')); + static type = (/* unused pure expression or super */ null && ('aborted')); +} +class src_errors_CodeError extends Error { + code; + props; + constructor(message, code, props) { + super(message); + this.code = code; + this.name = props?.name ?? 'CodeError'; + this.props = props ?? {}; // eslint-disable-line @typescript-eslint/consistent-type-assertions + } +} +//# sourceMappingURL=errors.js.map +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/vendor/base-x.js +// base-x encoding / decoding +// Copyright (c) 2018 base-x contributors +// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) +// Distributed under the MIT software license, see the accompanying +// file LICENSE or http://www.opensource.org/licenses/mit-license.php. +function peer_id_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { + if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; } - return rm -}) + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') } + BASE_MAP[xc] = i; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up + var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up + function encode (source) { + if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } else if (Array.isArray(source)) { + source = Uint8Array.from(source); + } + if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') } + if (source.length === 0) { return '' } + // Skip & count leading zeroes. + var zeroes = 0; + var length = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } + // Allocate enough space in big-endian base58 representation. + var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; + var b58 = new Uint8Array(size); + // Process the bytes. + while (pbegin !== pend) { + var carry = source[pbegin]; + // Apply "b58 = b58 * 256 + ch". + var i = 0; + for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { + carry += (256 * b58[it1]) >>> 0; + b58[it1] = (carry % BASE) >>> 0; + carry = (carry / BASE) >>> 0; + } + if (carry !== 0) { throw new Error('Non-zero carry') } + length = i; + pbegin++; + } + // Skip leading zeroes in base58 result. + var it2 = size - length; + while (it2 !== size && b58[it2] === 0) { + it2++; + } + // Translate the result into a string. + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); } + return str + } + function decodeUnsafe (source) { + if (typeof source !== 'string') { throw new TypeError('Expected String') } + if (source.length === 0) { return new Uint8Array() } + var psz = 0; + // Skip leading spaces. + if (source[psz] === ' ') { return } + // Skip and count leading '1's. + var zeroes = 0; + var length = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; + } + // Allocate enough space in big-endian base256 representation. + var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. + var b256 = new Uint8Array(size); + // Process the characters. + while (source[psz]) { + // Decode character + var carry = BASE_MAP[source.charCodeAt(psz)]; + // Invalid character + if (carry === 255) { return } + var i = 0; + for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { + carry += (BASE * b256[it3]) >>> 0; + b256[it3] = (carry % 256) >>> 0; + carry = (carry / 256) >>> 0; + } + if (carry !== 0) { throw new Error('Non-zero carry') } + length = i; + psz++; + } + // Skip trailing spaces. + if (source[psz] === ' ') { return } + // Skip leading zeroes in b256. + var it4 = size - length; + while (it4 !== size && b256[it4] === 0) { + it4++; + } + var vch = new Uint8Array(zeroes + (size - it4)); + var j = zeroes; + while (it4 !== size) { + vch[j++] = b256[it4++]; + } + return vch + } + function decode (string) { + var buffer = decodeUnsafe(string); + if (buffer) { return buffer } + throw new Error(`Non-${name} character`) + } + return { + encode: encode, + decodeUnsafe: decodeUnsafe, + decode: decode + } +} +var peer_id_node_modules_multiformats_vendor_base_x_src = peer_id_node_modules_multiformats_vendor_base_x_base; -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/key/index.js +var peer_id_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = peer_id_node_modules_multiformats_vendor_base_x_src; + +/* harmony default export */ const peer_id_node_modules_multiformats_vendor_base_x = (peer_id_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX); +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bytes.js +const peer_id_node_modules_multiformats_src_bytes_empty = new Uint8Array(0) +/** + * @param {Uint8Array} d + */ +const peer_id_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') +/** + * @param {string} hex + */ +const peer_id_node_modules_multiformats_src_bytes_fromHex = hex => { + const hexes = hex.match(/../g) + return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : peer_id_node_modules_multiformats_src_bytes_empty +} +/** + * @param {Uint8Array} aa + * @param {Uint8Array} bb + */ +const peer_id_node_modules_multiformats_src_bytes_equals = (aa, bb) => { + if (aa === bb) return true + if (aa.byteLength !== bb.byteLength) { + return false + } + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false + } + } + return true +} /** - * @param {import('../types.js').Options} config - * @returns {import('./types.js').KeyAPI} + * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o + * @returns {Uint8Array} */ -function createKey (config) { - return { - export: export_createExport(config), - gen: createGen(config), - import: import_createImport(config), - list: list_createList(config), - rename: createRename(config), - rm: key_rm_createRm(config) +const peer_id_node_modules_multiformats_src_bytes_coerce = o => { + if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o + if (o instanceof ArrayBuffer) return new Uint8Array(o) + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) } + throw new Error('Unknown type, must be binary type') } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/log/level.js +/** + * @param {any} o + * @returns {o is ArrayBuffer|ArrayBufferView} + */ +const peer_id_node_modules_multiformats_src_bytes_isBinary = o => + o instanceof ArrayBuffer || ArrayBuffer.isView(o) +/** + * @param {string} str + * @returns {Uint8Array} + */ +const peer_id_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) +/** + * @param {Uint8Array} b + * @returns {string} + */ +const peer_id_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) -const createLevel = configure(api => { - /** - * @type {import('../types').LogAPI["level"]} - */ - async function level (subsystem, level, options = {}) { - const res = await api.post('log/level', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: [ - subsystem, - level - ], - ...options - }), - headers: options.headers - }) - return objectToCamel(await res.json()) - } - return level -}) +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base.js -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/log/ls.js +// Linter can't see that API is used in types. +// eslint-disable-next-line -const ls_createLs = configure(api => { +/** + * Class represents both BaseEncoder and MultibaseEncoder meaning it + * can be used to encode to multibase or base encode without multibase + * prefix. + * + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseEncoder} + * @implements {API.BaseEncoder} + */ +class peer_id_node_modules_multiformats_src_bases_base_Encoder { /** - * @type {import('../types').LogAPI["ls"]} + * @param {Base} name + * @param {Prefix} prefix + * @param {(bytes:Uint8Array) => string} baseEncode */ - async function ls (options = {}) { - const res = await api.post('log/ls', { - signal: options.signal, - searchParams: toUrlSearchParams(options), - headers: options.headers - }) - - const data = await res.json() - return data.Strings + constructor (name, prefix, baseEncode) { + this.name = name + this.prefix = prefix + this.baseEncode = baseEncode } - return ls -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/log/tail.js - - -const createTail = configure(api => { /** - * @type {import('../types').LogAPI["tail"]} + * @param {Uint8Array} bytes + * @returns {API.Multibase} */ - async function * tail (options = {}) { - const res = await api.post('log/tail', { - signal: options.signal, - searchParams: toUrlSearchParams(options), - headers: options.headers - }) - - yield * res.ndjson() + encode (bytes) { + if (bytes instanceof Uint8Array) { + return `${this.prefix}${this.baseEncode(bytes)}` + } else { + throw Error('Unknown type, must be binary type') + } } - return tail -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/log/index.js - - - +} /** - * @param {import('../types').Options} config + * @template {string} Prefix */ -function createLog (config) { - return { - level: createLevel(config), - ls: ls_createLs(config), - tail: createTail(config) +/** + * Class represents both BaseDecoder and MultibaseDecoder so it could be used + * to decode multibases (with matching prefix) or just base decode strings + * with corresponding base encoding. + * + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseDecoder} + * @implements {API.UnibaseDecoder} + * @implements {API.BaseDecoder} + */ +class peer_id_node_modules_multiformats_src_bases_base_Decoder { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(text:string) => Uint8Array} baseDecode + */ + constructor (name, prefix, baseDecode) { + this.name = name + this.prefix = prefix + /* c8 ignore next 3 */ + if (prefix.codePointAt(0) === undefined) { + throw new Error('Invalid prefix character') + } + /** @private */ + this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0)) + this.baseDecode = baseDecode } -} - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/name/publish.js + /** + * @param {string} text + */ + decode (text) { + if (typeof text === 'string') { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`) + } + return this.baseDecode(text.slice(this.prefix.length)) + } else { + throw Error('Can only multibase decode strings') + } + } + /** + * @template {string} OtherPrefix + * @param {API.UnibaseDecoder|ComposedDecoder} decoder + * @returns {ComposedDecoder} + */ + or (decoder) { + return peer_id_node_modules_multiformats_src_bases_base_or(this, decoder) + } +} +/** + * @template {string} Prefix + * @typedef {Record>} Decoders + */ /** - * @param {import('../types').Options} config - * @returns {import('../types').IPFS['publish']} + * @template {string} Prefix + * @implements {API.MultibaseDecoder} + * @implements {API.CombobaseDecoder} */ -const createPublish = configure(api => { +class peer_id_node_modules_multiformats_src_bases_base_ComposedDecoder { /** - * @type {import('../types.js').NameAPI["publish"]} + * @param {Decoders} decoders */ - async function publish (path, options = {}) { - const res = await api.post('name/publish', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: `${path}`, - ...options - }), - headers: options.headers - }) - - // @ts-expect-error server output is not typed - return objectToCamel(await res.json()) + constructor (decoders) { + this.decoders = decoders } - return publish -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/name/resolve.js - - -const resolve_createResolve = configure(api => { /** - * @type {import('../types').NameAPI["resolve"]} + * @template {string} OtherPrefix + * @param {API.UnibaseDecoder|ComposedDecoder} decoder + * @returns {ComposedDecoder} */ - async function * resolve (path, options = {}) { - const res = await api.post('name/resolve', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: path, - stream: true, - ...options - }), - headers: options.headers - }) + or (decoder) { + return peer_id_node_modules_multiformats_src_bases_base_or(this, decoder) + } - for await (const result of res.ndjson()) { - yield result.Path + /** + * @param {string} input + * @returns {Uint8Array} + */ + decode (input) { + const prefix = /** @type {Prefix} */ (input[0]) + const decoder = this.decoders[prefix] + if (decoder) { + return decoder.decode(input) + } else { + throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`) } } - return resolve -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/name/pubsub/cancel.js - - +} +/** + * @template {string} L + * @template {string} R + * @param {API.UnibaseDecoder|API.CombobaseDecoder} left + * @param {API.UnibaseDecoder|API.CombobaseDecoder} right + * @returns {ComposedDecoder} + */ +const peer_id_node_modules_multiformats_src_bases_base_or = (left, right) => new peer_id_node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({ + ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }), + ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right }) +})) /** - * @param {import('../../types').Options} config - * @returns {import('../../types').NamePubsubAPI["cancel"]} + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseCodec} + * @implements {API.MultibaseEncoder} + * @implements {API.MultibaseDecoder} + * @implements {API.BaseCodec} + * @implements {API.BaseEncoder} + * @implements {API.BaseDecoder} */ -const createCancel = configure(api => { +class peer_id_node_modules_multiformats_src_bases_base_Codec { /** - * @type {import('../../types').NamePubsubAPI["cancel"]} + * @param {Base} name + * @param {Prefix} prefix + * @param {(bytes:Uint8Array) => string} baseEncode + * @param {(text:string) => Uint8Array} baseDecode */ - async function cancel (name, options = {}) { - const res = await api.post('name/pubsub/cancel', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: name, - ...options - }), - headers: options.headers - }) - - // @ts-expect-error server output is not typed - return objectToCamel(await res.json()) + constructor (name, prefix, baseEncode, baseDecode) { + this.name = name + this.prefix = prefix + this.baseEncode = baseEncode + this.baseDecode = baseDecode + this.encoder = new peer_id_node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode) + this.decoder = new peer_id_node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode) } - return cancel -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/name/pubsub/state.js - - - -const createState = configure(api => { /** - * @type {import('../../types').NamePubsubAPI["state"]} + * @param {Uint8Array} input */ - async function state (options = {}) { - const res = await api.post('name/pubsub/state', { - signal: options.signal, - searchParams: toUrlSearchParams(options), - headers: options.headers - }) - - // @ts-expect-error server output is not typed - return objectToCamel(await res.json()) + encode (input) { + return this.encoder.encode(input) } - return state -}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/name/pubsub/subs.js + /** + * @param {string} input + */ + decode (input) { + return this.decoder.decode(input) + } +} +/** + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {(bytes:Uint8Array) => string} options.encode + * @param {(input:string) => Uint8Array} options.decode + * @returns {Codec} + */ +const peer_id_node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) => + new peer_id_node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode) +/** + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {string} options.alphabet + * @returns {Codec} + */ +const peer_id_node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => { + const { encode, decode } = peer_id_node_modules_multiformats_vendor_base_x(alphabet, name) + return peer_id_node_modules_multiformats_src_bases_base_from({ + prefix, + name, + encode, + /** + * @param {string} text + */ + decode: text => peer_id_node_modules_multiformats_src_bytes_coerce(decode(text)) + }) +} -const createSubs = configure(api => { - /** - * @type {import('../../types').NamePubsubAPI["subs"]} - */ - async function subs (options = {}) { - const res = await api.post('name/pubsub/subs', { - signal: options.signal, - searchParams: toUrlSearchParams(options), - headers: options.headers - }) - const data = await res.json() +/** + * @param {string} string + * @param {string} alphabet + * @param {number} bitsPerChar + * @param {string} name + * @returns {Uint8Array} + */ +const peer_id_node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { + // Build the character lookup table: + /** @type {Record} */ + const codes = {} + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i + } - return data.Strings || [] + // Count the padding bytes: + let end = string.length + while (string[end - 1] === '=') { + --end } - return subs -}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/name/pubsub/index.js + // Allocate the output: + const out = new Uint8Array((end * bitsPerChar / 8) | 0) + // Parse the data: + let bits = 0 // Number of bits currently in the buffer + let buffer = 0 // Bits waiting to be written out, MSB first + let written = 0 // Next byte to write + for (let i = 0; i < end; ++i) { + // Read one character from the string: + const value = codes[string[i]] + if (value === undefined) { + throw new SyntaxError(`Non-${name} character`) + } + + // Append the bits to the buffer: + buffer = (buffer << bitsPerChar) | value + bits += bitsPerChar + + // Write out some bits if the buffer has a byte's worth: + if (bits >= 8) { + bits -= 8 + out[written++] = 0xff & (buffer >> bits) + } + } + // Verify that we have received just enough bits: + if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) { + throw new SyntaxError('Unexpected end of data') + } + return out +} /** - * @param {import('../../types').Options} config - * @returns {import('../../types').NamePubsubAPI} + * @param {Uint8Array} data + * @param {string} alphabet + * @param {number} bitsPerChar + * @returns {string} */ -function createPubsub (config) { - return { - cancel: createCancel(config), - state: createState(config), - subs: createSubs(config) - } -} +const peer_id_node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => { + const pad = alphabet[alphabet.length - 1] === '=' + const mask = (1 << bitsPerChar) - 1 + let out = '' -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/name/index.js + let bits = 0 // Number of bits currently in the buffer + let buffer = 0 // Bits waiting to be written out, MSB first + for (let i = 0; i < data.length; ++i) { + // Slurp data into the buffer: + buffer = (buffer << 8) | data[i] + bits += 8 + + // Write out as much as we can: + while (bits > bitsPerChar) { + bits -= bitsPerChar + out += alphabet[mask & (buffer >> bits)] + } + } + // Partial character: + if (bits) { + out += alphabet[mask & (buffer << (bitsPerChar - bits))] + } + // Add padding characters until we hit a byte boundary: + if (pad) { + while ((out.length * bitsPerChar) & 7) { + out += '=' + } + } + return out +} /** - * @param {import('../types').Options} config - * @returns {import('../types').IPFS['name']} + * RFC4648 Factory + * + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {string} options.alphabet + * @param {number} options.bitsPerChar */ -function createName (config) { - return { - publish: createPublish(config), - resolve: resolve_createResolve(config), - pubsub: createPubsub(config) - } +const peer_id_node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { + return peer_id_node_modules_multiformats_src_bases_base_from({ + prefix, + name, + encode (input) { + return peer_id_node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar) + }, + decode (input) { + return peer_id_node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name) + } + }) } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/data.js - - +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base58.js -const createData = configure(api => { - /** - * @type {import('../types').ObjectAPI["data"]} - */ - async function data (cid, options = {}) { - const res = await api.post('object/data', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: `${cid instanceof Uint8Array ? node_modules_multiformats_src_cid_CID.decode(cid) : cid}`, - ...options - }), - headers: options.headers - }) - const data = await res.arrayBuffer() +const peer_id_node_modules_multiformats_src_bases_base58_base58btc = peer_id_node_modules_multiformats_src_bases_base_baseX({ + name: 'base58btc', + prefix: 'z', + alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +}) - return new Uint8Array(data, 0, data.byteLength) - } - return data +const peer_id_node_modules_multiformats_src_bases_base58_base58flickr = peer_id_node_modules_multiformats_src_bases_base_baseX({ + name: 'base58flickr', + prefix: 'Z', + alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' }) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/get.js +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/identity.js +// @ts-check +const peer_id_node_modules_multiformats_src_bases_identity_identity = peer_id_node_modules_multiformats_src_bases_base_from({ + prefix: '\x00', + name: 'identity', + encode: (buf) => peer_id_node_modules_multiformats_src_bytes_toString(buf), + decode: (str) => peer_id_node_modules_multiformats_src_bytes_fromString(str) +}) -const object_get_createGet = configure(api => { - /** - * @type {import('../types').ObjectAPI["get"]} - */ - async function get (cid, options = {}) { - const res = await api.post('object/get', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: `${cid instanceof Uint8Array ? node_modules_multiformats_src_cid_CID.decode(cid) : cid}`, - dataEncoding: 'base64', - ...options - }), - headers: options.headers - }) - const data = await res.json() +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base2.js +// @ts-check - return { - Data: dist_src_from_string_fromString(data.Data, 'base64pad'), - Links: (data.Links || []).map((/** @type {any} */ link) => ({ - Name: link.Name, - Hash: node_modules_multiformats_src_cid_CID.parse(link.Hash), - Tsize: link.Size - })) - } - } - return get -}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/links.js +const multiformats_src_bases_base2_base2 = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: '0', + name: 'base2', + alphabet: '01', + bitsPerChar: 1 +}) +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base8.js +// @ts-check -const createLinks = configure(api => { - /** - * @type {import('../types').ObjectAPI["links"]} - */ - async function links (cid, options = {}) { - const res = await api.post('object/links', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: `${cid instanceof Uint8Array ? node_modules_multiformats_src_cid_CID.decode(cid) : cid}`, - ...options - }), - headers: options.headers - }) - const data = await res.json() - return (data.Links || []).map((/** @type {any} */ l) => ({ - Name: l.Name, - Tsize: l.Size, - Hash: node_modules_multiformats_src_cid_CID.parse(l.Hash) - })) - } - return links +const multiformats_src_bases_base8_base8 = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: '7', + name: 'base8', + alphabet: '01234567', + bitsPerChar: 3 }) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/new.js +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base10.js +const multiformats_src_bases_base10_base10 = peer_id_node_modules_multiformats_src_bases_base_baseX({ + prefix: '9', + name: 'base10', + alphabet: '0123456789' +}) +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base16.js +// @ts-check -const createNew = configure(api => { - /** - * @type {import('../types').ObjectAPI["new"]} - */ - async function newObject (options = {}) { - const res = await api.post('object/new', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: options.template, - ...options - }), - headers: options.headers - }) - const { Hash } = await res.json() - return node_modules_multiformats_src_cid_CID.parse(Hash) - } - return newObject +const multiformats_src_bases_base16_base16 = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'f', + name: 'base16', + alphabet: '0123456789abcdef', + bitsPerChar: 4 }) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/put.js +const multiformats_src_bases_base16_base16upper = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'F', + name: 'base16upper', + alphabet: '0123456789ABCDEF', + bitsPerChar: 4 +}) +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base32.js -/** - * @param {import('../types').Multicodecs} codecs - * @param {import('../types').Options} options - */ -const object_put_createPut = (codecs, options) => { - const fn = configure((api) => { - const dagPut = put_createPut(codecs, options) +const peer_id_node_modules_multiformats_src_bases_base32_base32 = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'b', + name: 'base32', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567', + bitsPerChar: 5 +}) - /** - * @type {import('../types').ObjectAPI["put"]} - */ - async function put (obj, options = {}) { - return dagPut(obj, { - ...options, - storeCodec: 'dag-pb', - hashAlg: 'sha2-256', - version: 1 - }) - } - return put - }) +const peer_id_node_modules_multiformats_src_bases_base32_base32upper = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'B', + name: 'base32upper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', + bitsPerChar: 5 +}) - return fn(options) -} +const peer_id_node_modules_multiformats_src_bases_base32_base32pad = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'c', + name: 'base32pad', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', + bitsPerChar: 5 +}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/stat.js +const peer_id_node_modules_multiformats_src_bases_base32_base32padupper = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'C', + name: 'base32padupper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', + bitsPerChar: 5 +}) + +const peer_id_node_modules_multiformats_src_bases_base32_base32hex = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'v', + name: 'base32hex', + alphabet: '0123456789abcdefghijklmnopqrstuv', + bitsPerChar: 5 +}) + +const peer_id_node_modules_multiformats_src_bases_base32_base32hexupper = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'V', + name: 'base32hexupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', + bitsPerChar: 5 +}) +const peer_id_node_modules_multiformats_src_bases_base32_base32hexpad = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 't', + name: 'base32hexpad', + alphabet: '0123456789abcdefghijklmnopqrstuv=', + bitsPerChar: 5 +}) +const peer_id_node_modules_multiformats_src_bases_base32_base32hexpadupper = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'T', + name: 'base32hexpadupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', + bitsPerChar: 5 +}) +const peer_id_node_modules_multiformats_src_bases_base32_base32z = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'h', + name: 'base32z', + alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', + bitsPerChar: 5 +}) -const object_stat_createStat = configure(api => { - /** - * @type {import('../types.js').ObjectAPI["stat"]} - */ - async function stat (cid, options = {}) { - const res = await api.post('object/stat', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: `${cid}`, - ...options - }), - headers: options.headers - }) +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base36.js - const output = await res.json() - return { - ...output, - Hash: node_modules_multiformats_src_cid_CID.parse(output.Hash) - } - } - return stat +const multiformats_src_bases_base36_base36 = peer_id_node_modules_multiformats_src_bases_base_baseX({ + prefix: 'k', + name: 'base36', + alphabet: '0123456789abcdefghijklmnopqrstuvwxyz' }) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/patch/add-link.js +const multiformats_src_bases_base36_base36upper = peer_id_node_modules_multiformats_src_bases_base_baseX({ + prefix: 'K', + name: 'base36upper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' +}) +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base64.js +// @ts-check -const createAddLink = configure(api => { - /** - * @type {import('../../types').ObjectPatchAPI["addLink"]} - */ - async function addLink (cid, dLink, options = {}) { - const res = await api.post('object/patch/add-link', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: [ - `${cid}`, - // @ts-expect-error loose types - dLink.Name || dLink.name || '', - // @ts-expect-error loose types - (dLink.Hash || dLink.cid || '').toString() || null - ], - ...options - }), - headers: options.headers - }) +const peer_id_node_modules_multiformats_src_bases_base64_base64 = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'm', + name: 'base64', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + bitsPerChar: 6 +}) - const { Hash } = await res.json() +const peer_id_node_modules_multiformats_src_bases_base64_base64pad = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'M', + name: 'base64pad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', + bitsPerChar: 6 +}) - return node_modules_multiformats_src_cid_CID.parse(Hash) - } +const peer_id_node_modules_multiformats_src_bases_base64_base64url = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'u', + name: 'base64url', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', + bitsPerChar: 6 +}) - return addLink +const peer_id_node_modules_multiformats_src_bases_base64_base64urlpad = peer_id_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'U', + name: 'base64urlpad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', + bitsPerChar: 6 }) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/patch/append-data.js +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/bases/base256emoji.js +const multiformats_src_bases_base256emoji_alphabet = Array.from('🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂') +const multiformats_src_bases_base256emoji_alphabetBytesToChars = /** @type {string[]} */ (multiformats_src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[i] = c; return p }, /** @type {string[]} */([]))) +const multiformats_src_bases_base256emoji_alphabetCharsToBytes = /** @type {number[]} */ (multiformats_src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[/** @type {number} */ (c.codePointAt(0))] = i; return p }, /** @type {number[]} */([]))) +/** + * @param {Uint8Array} data + * @returns {string} + */ +function node_modules_multiformats_src_bases_base256emoji_encode (data) { + return data.reduce((p, c) => { + p += multiformats_src_bases_base256emoji_alphabetBytesToChars[c] + return p + }, '') +} +/** + * @param {string} str + * @returns {Uint8Array} + */ +function node_modules_multiformats_src_bases_base256emoji_decode (str) { + const byts = [] + for (const char of str) { + const byt = multiformats_src_bases_base256emoji_alphabetCharsToBytes[/** @type {number} */ (char.codePointAt(0))] + if (byt === undefined) { + throw new Error(`Non-base256emoji character: ${char}`) + } + byts.push(byt) + } + return new Uint8Array(byts) +} +const multiformats_src_bases_base256emoji_base256emoji = peer_id_node_modules_multiformats_src_bases_base_from({ + prefix: '🚀', + name: 'base256emoji', + encode: node_modules_multiformats_src_bases_base256emoji_encode, + decode: node_modules_multiformats_src_bases_base256emoji_decode +}) -const createAppendData = configure(api => { - /** - * @type {import('../../types').ObjectPatchAPI["appendData"]} - */ - async function appendData (cid, data, options = {}) { - // allow aborting requests on body errors - const controller = new AbortController() - const signal = abortSignal(controller.signal, options.signal) +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/vendor/varint.js +var peer_id_node_modules_multiformats_vendor_varint_encode_1 = peer_id_node_modules_multiformats_vendor_varint_encode; - const res = await api.post('object/patch/append-data', { - signal, - searchParams: toUrlSearchParams({ - arg: `${cid}`, - ...options - }), - ...( - await multipart_request_multipartRequest([data], controller, options.headers) - ) - }) +var peer_id_node_modules_multiformats_vendor_varint_MSB = 0x80 + , peer_id_node_modules_multiformats_vendor_varint_REST = 0x7F + , peer_id_node_modules_multiformats_vendor_varint_MSBALL = ~peer_id_node_modules_multiformats_vendor_varint_REST + , peer_id_node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31); - const { Hash } = await res.json() +function peer_id_node_modules_multiformats_vendor_varint_encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; - return node_modules_multiformats_src_cid_CID.parse(Hash) + while(num >= peer_id_node_modules_multiformats_vendor_varint_INT) { + out[offset++] = (num & 0xFF) | peer_id_node_modules_multiformats_vendor_varint_MSB; + num /= 128; } - return appendData -}) + while(num & peer_id_node_modules_multiformats_vendor_varint_MSBALL) { + out[offset++] = (num & 0xFF) | peer_id_node_modules_multiformats_vendor_varint_MSB; + num >>>= 7; + } + out[offset] = num | 0; + + peer_id_node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; + + return out +} -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/patch/rm-link.js +var peer_id_node_modules_multiformats_vendor_varint_decode = peer_id_node_modules_multiformats_vendor_varint_read; +var peer_id_node_modules_multiformats_vendor_varint_MSB$1 = 0x80 + , peer_id_node_modules_multiformats_vendor_varint_REST$1 = 0x7F; +function peer_id_node_modules_multiformats_vendor_varint_read(buf, offset) { + var res = 0 + , offset = offset || 0 + , shift = 0 + , counter = offset + , b + , l = buf.length; + do { + if (counter >= l) { + peer_id_node_modules_multiformats_vendor_varint_read.bytes = 0; + throw new RangeError('Could not decode varint') + } + b = buf[counter++]; + res += shift < 28 + ? (b & peer_id_node_modules_multiformats_vendor_varint_REST$1) << shift + : (b & peer_id_node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= peer_id_node_modules_multiformats_vendor_varint_MSB$1) -const createRmLink = configure(api => { - /** - * @type {import('../../types').ObjectPatchAPI["rmLink"]} - */ - async function rmLink (cid, dLink, options = {}) { - const res = await api.post('object/patch/rm-link', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: [ - `${cid}`, - // @ts-expect-error loose types - dLink.Name || dLink.name || null - ], - ...options - }), - headers: options.headers - }) + peer_id_node_modules_multiformats_vendor_varint_read.bytes = counter - offset; - const { Hash } = await res.json() + return res +} - return node_modules_multiformats_src_cid_CID.parse(Hash) - } - return rmLink -}) +var peer_id_node_modules_multiformats_vendor_varint_N1 = Math.pow(2, 7); +var peer_id_node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14); +var peer_id_node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21); +var peer_id_node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28); +var peer_id_node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35); +var peer_id_node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42); +var peer_id_node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49); +var peer_id_node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56); +var peer_id_node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63); -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/patch/set-data.js +var peer_id_node_modules_multiformats_vendor_varint_length = function (value) { + return ( + value < peer_id_node_modules_multiformats_vendor_varint_N1 ? 1 + : value < peer_id_node_modules_multiformats_vendor_varint_N2 ? 2 + : value < peer_id_node_modules_multiformats_vendor_varint_N3 ? 3 + : value < peer_id_node_modules_multiformats_vendor_varint_N4 ? 4 + : value < peer_id_node_modules_multiformats_vendor_varint_N5 ? 5 + : value < peer_id_node_modules_multiformats_vendor_varint_N6 ? 6 + : value < peer_id_node_modules_multiformats_vendor_varint_N7 ? 7 + : value < peer_id_node_modules_multiformats_vendor_varint_N8 ? 8 + : value < peer_id_node_modules_multiformats_vendor_varint_N9 ? 9 + : 10 + ) +}; +var peer_id_node_modules_multiformats_vendor_varint_varint = { + encode: peer_id_node_modules_multiformats_vendor_varint_encode_1 + , decode: peer_id_node_modules_multiformats_vendor_varint_decode + , encodingLength: peer_id_node_modules_multiformats_vendor_varint_length +}; +var peer_id_node_modules_multiformats_vendor_varint_brrp_varint = peer_id_node_modules_multiformats_vendor_varint_varint; +/* harmony default export */ const peer_id_node_modules_multiformats_vendor_varint = (peer_id_node_modules_multiformats_vendor_varint_brrp_varint); +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/varint.js -const createSetData = configure(api => { - /** - * @type {import('../../types').ObjectPatchAPI["setData"]} - */ - async function setData (cid, data, options = {}) { - // allow aborting requests on body errors - const controller = new AbortController() - const signal = abortSignal(controller.signal, options.signal) +/** + * @param {Uint8Array} data + * @param {number} [offset=0] + * @returns {[number, number]} + */ +const peer_id_node_modules_multiformats_src_varint_decode = (data, offset = 0) => { + const code = peer_id_node_modules_multiformats_vendor_varint.decode(data, offset) + return [code, peer_id_node_modules_multiformats_vendor_varint.decode.bytes] +} - const res = await api.post('object/patch/set-data', { - signal, - searchParams: toUrlSearchParams({ - arg: [ - `${cid}` - ], - ...options - }), - ...( - await multipart_request_multipartRequest([data], controller, options.headers) - ) - }) +/** + * @param {number} int + * @param {Uint8Array} target + * @param {number} [offset=0] + */ +const peer_id_node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => { + peer_id_node_modules_multiformats_vendor_varint.encode(int, target, offset) + return target +} - const { Hash } = await res.json() +/** + * @param {number} int + * @returns {number} + */ +const peer_id_node_modules_multiformats_src_varint_encodingLength = (int) => { + return peer_id_node_modules_multiformats_vendor_varint.encodingLength(int) +} - return node_modules_multiformats_src_cid_CID.parse(Hash) - } - return setData -}) +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/hashes/digest.js -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/patch/index.js +/** + * Creates a multihash digest. + * + * @template {number} Code + * @param {Code} code + * @param {Uint8Array} digest + */ +const peer_id_node_modules_multiformats_src_hashes_digest_create = (code, digest) => { + const size = digest.byteLength + const sizeOffset = peer_id_node_modules_multiformats_src_varint_encodingLength(code) + const digestOffset = sizeOffset + peer_id_node_modules_multiformats_src_varint_encodingLength(size) + const bytes = new Uint8Array(digestOffset + size) + peer_id_node_modules_multiformats_src_varint_encodeTo(code, bytes, 0) + peer_id_node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset) + bytes.set(digest, digestOffset) + return new peer_id_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) +} /** - * @param {import('../../types').Options} config + * Turns bytes representation of multihash digest into an instance. + * + * @param {Uint8Array} multihash + * @returns {MultihashDigest} */ -function createPatch (config) { - return { - addLink: createAddLink(config), - appendData: createAppendData(config), - rmLink: createRmLink(config), - setData: createSetData(config) - } -} - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/index.js - - +const peer_id_node_modules_multiformats_src_hashes_digest_decode = (multihash) => { + const bytes = peer_id_node_modules_multiformats_src_bytes_coerce(multihash) + const [code, sizeOffset] = peer_id_node_modules_multiformats_src_varint_decode(bytes) + const [size, digestOffset] = peer_id_node_modules_multiformats_src_varint_decode(bytes.subarray(sizeOffset)) + const digest = bytes.subarray(sizeOffset + digestOffset) + if (digest.byteLength !== size) { + throw new Error('Incorrect length') + } + return new peer_id_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) +} +/** + * @param {MultihashDigest} a + * @param {unknown} b + * @returns {b is MultihashDigest} + */ +const peer_id_node_modules_multiformats_src_hashes_digest_equals = (a, b) => { + if (a === b) { + return true + } else { + const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) + return ( + a.code === data.code && + a.size === data.size && + data.bytes instanceof Uint8Array && + peer_id_node_modules_multiformats_src_bytes_equals(a.bytes, data.bytes) + ) + } +} +/** + * @typedef {import('./interface.js').MultihashDigest} MultihashDigest + */ /** - * @param {import('../types').Multicodecs} codecs - * @param {import('../types').Options} config + * Represents a multihash digest which carries information about the + * hashing algorithm and an actual hash digest. + * + * @template {number} Code + * @template {number} Size + * @class + * @implements {MultihashDigest} */ -function createObject (codecs, config) { - return { - data: createData(config), - get: object_get_createGet(config), - links: createLinks(config), - new: createNew(config), - put: object_put_createPut(codecs, config), - stat: object_stat_createStat(config), - patch: createPatch(config) +class peer_id_node_modules_multiformats_src_hashes_digest_Digest { + /** + * Creates a multihash digest. + * + * @param {Code} code + * @param {Size} size + * @param {Uint8Array} digest + * @param {Uint8Array} bytes + */ + constructor (code, size, digest, bytes) { + this.code = code + this.size = size + this.digest = digest + this.bytes = bytes } } -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/pins/normalise-input.js - +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/hashes/hasher.js /** - * @typedef {object} Pinnable - * @property {string | InstanceType | CID} [path] - * @property {CID} [cid] - * @property {boolean} [recursive] - * @property {any} [metadata] - * - * @typedef {CID|string|InstanceType|Pinnable} ToPin - * @typedef {ToPin|Iterable|AsyncIterable} Source - * - * @typedef {object} Pin - * @property {string|CID} path - * @property {boolean} recursive - * @property {any} [metadata] + * @template {string} Name + * @template {number} Code + * @param {object} options + * @param {Name} options.name + * @param {Code} options.code + * @param {(input: Uint8Array) => Await} options.encode */ +const peer_id_node_modules_multiformats_src_hashes_hasher_from = ({ name, code, encode }) => new node_modules_multiformats_src_hashes_hasher_Hasher(name, code, encode) /** - * @param {any} thing - * @returns {thing is IterableIterator & Iterator} + * Hasher represents a hashing algorithm implementation that produces as + * `MultihashDigest`. + * + * @template {string} Name + * @template {number} Code + * @class + * @implements {MultihashHasher} */ -function isIterable (thing) { - return Symbol.iterator in thing -} +class node_modules_multiformats_src_hashes_hasher_Hasher { + /** + * + * @param {Name} name + * @param {Code} code + * @param {(input: Uint8Array) => Await} encode + */ + constructor (name, code, encode) { + this.name = name + this.code = code + this.encode = encode + } -/** - * @param {any} thing - * @returns {thing is AsyncIterableIterator & AsyncIterator} - */ -function isAsyncIterable (thing) { - return Symbol.asyncIterator in thing + /** + * @param {Uint8Array} input + * @returns {Await>} + */ + digest (input) { + if (input instanceof Uint8Array) { + const result = this.encode(input) + return result instanceof Uint8Array + ? peer_id_node_modules_multiformats_src_hashes_digest_create(this.code, result) + /* c8 ignore next 1 */ + : result.then(digest => peer_id_node_modules_multiformats_src_hashes_digest_create(this.code, digest)) + } else { + throw Error('Unknown type, must be binary type') + /* c8 ignore next 1 */ + } + } } /** - * @param {any} thing - * @returns {thing is CID} + * @template {number} Alg + * @typedef {import('./interface.js').MultihashHasher} MultihashHasher */ -function isCID (thing) { - return ipfs_core_utils_node_modules_multiformats_src_cid_CID.asCID(thing) != null -} /** - * Transform one of: - * - * ```ts - * CID - * String - * { cid: CID recursive, metadata } - * { path: String recursive, metadata } - * Iterable - * Iterable - * Iterable<{ cid: CID recursive, metadata }> - * Iterable<{ path: String recursive, metadata }> - * AsyncIterable - * AsyncIterable - * AsyncIterable<{ cid: CID recursive, metadata }> - * AsyncIterable<{ path: String recursive, metadata }> - * ``` - * Into: - * - * ```ts - * AsyncIterable<{ path: CID|String, recursive:boolean, metadata }> - * ``` - * - * @param {Source} input - * @returns {AsyncIterable} + * @template T + * @typedef {Promise|T} Await */ -// eslint-disable-next-line complexity -async function * normalise_input_normaliseInput (input) { - // must give us something - if (input === null || input === undefined) { - throw err_code(new Error(`Unexpected input: ${input}`), 'ERR_UNEXPECTED_INPUT') - } - // CID - const cid = ipfs_core_utils_node_modules_multiformats_src_cid_CID.asCID(input) +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/hashes/sha2.js +// @ts-check - if (cid) { - yield toPin({ cid }) - return - } - if (input instanceof String || typeof input === 'string') { - yield toPin({ path: input }) - return - } - // { cid: CID recursive, metadata } - // @ts-expect-error - it still could be iterable or async iterable - if (input.cid != null || input.path != null) { - // @ts-expect-error - return yield toPin(input) - } - // Iterable - if (isIterable(input)) { - const iterator = input[Symbol.iterator]() - const first = iterator.next() - if (first.done) { - return iterator - } +const node_modules_multiformats_src_hashes_sha2_sha256 = peer_id_node_modules_multiformats_src_hashes_hasher_from({ + name: 'sha2-256', + code: 0x12, + encode: (input) => peer_id_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha256').update(input).digest()) +}) - // Iterable - if (isCID(first.value)) { - yield toPin({ cid: first.value }) - for (const cid of iterator) { - yield toPin({ cid }) - } - return - } +const multiformats_src_hashes_sha2_sha512 = peer_id_node_modules_multiformats_src_hashes_hasher_from({ + name: 'sha2-512', + code: 0x13, + encode: input => peer_id_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha512').update(input).digest()) +}) - // Iterable - if (first.value instanceof String || typeof first.value === 'string') { - yield toPin({ path: first.value }) - for (const path of iterator) { - yield toPin({ path }) - } - return - } +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/hashes/identity.js - // Iterable - if (first.value.cid != null || first.value.path != null) { - yield toPin(first.value) - for (const obj of iterator) { - yield toPin(obj) - } - return - } - throw err_code(new Error('Unexpected input: ' + typeof input), 'ERR_UNEXPECTED_INPUT') - } - // AsyncIterable - if (isAsyncIterable(input)) { - const iterator = input[Symbol.asyncIterator]() - const first = await iterator.next() - if (first.done) return iterator +const node_modules_multiformats_src_hashes_identity_code = 0x0 +const node_modules_multiformats_src_hashes_identity_name = 'identity' - // AsyncIterable - if (isCID(first.value)) { - yield toPin({ cid: first.value }) - for await (const cid of iterator) { - yield toPin({ cid }) - } - return - } +/** @type {(input:Uint8Array) => Uint8Array} */ +const node_modules_multiformats_src_hashes_identity_encode = peer_id_node_modules_multiformats_src_bytes_coerce - // AsyncIterable - if (first.value instanceof String || typeof first.value === 'string') { - yield toPin({ path: first.value }) - for await (const path of iterator) { - yield toPin({ path }) - } - return - } +/** + * @param {Uint8Array} input + * @returns {Digest.Digest} + */ +const multiformats_src_hashes_identity_digest = (input) => peer_id_node_modules_multiformats_src_hashes_digest_create(node_modules_multiformats_src_hashes_identity_code, node_modules_multiformats_src_hashes_identity_encode(input)) - // AsyncIterable<{ cid: CID|String recursive, metadata }> - if (first.value.cid != null || first.value.path != null) { - yield toPin(first.value) - for await (const obj of iterator) { - yield toPin(obj) - } - return - } +const node_modules_multiformats_src_hashes_identity_identity = { code: node_modules_multiformats_src_hashes_identity_code, name: node_modules_multiformats_src_hashes_identity_name, encode: node_modules_multiformats_src_hashes_identity_encode, digest: multiformats_src_hashes_identity_digest } + +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/codecs/raw.js +// @ts-check - throw err_code(new Error('Unexpected input: ' + typeof input), 'ERR_UNEXPECTED_INPUT') - } - throw err_code(new Error('Unexpected input: ' + typeof input), 'ERR_UNEXPECTED_INPUT') -} /** - * @param {Pinnable} input + * @template T + * @typedef {import('./interface.js').ByteView} ByteView */ -function toPin (input) { - const path = input.cid || `${input.path}` - if (!path) { - throw err_code(new Error('Unexpected input: Please path either a CID or an IPFS path'), 'ERR_UNEXPECTED_INPUT') - } +const node_modules_multiformats_src_codecs_raw_name = 'raw' +const node_modules_multiformats_src_codecs_raw_code = 0x55 - /** @type {Pin} */ - const pin = { - path, - recursive: input.recursive !== false - } +/** + * @param {Uint8Array} node + * @returns {ByteView} + */ +const node_modules_multiformats_src_codecs_raw_encode = (node) => peer_id_node_modules_multiformats_src_bytes_coerce(node) - if (input.metadata != null) { - pin.metadata = input.metadata - } +/** + * @param {ByteView} data + * @returns {Uint8Array} + */ +const node_modules_multiformats_src_codecs_raw_decode = (data) => peer_id_node_modules_multiformats_src_bytes_coerce(data) - return pin -} +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/codecs/json.js +// @ts-check -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/add-all.js +/** + * @template T + * @typedef {import('./interface.js').ByteView} ByteView + */ +const node_modules_multiformats_src_codecs_json_textEncoder = new TextEncoder() +const node_modules_multiformats_src_codecs_json_textDecoder = new TextDecoder() +const node_modules_multiformats_src_codecs_json_name = 'json' +const node_modules_multiformats_src_codecs_json_code = 0x0200 +/** + * @template T + * @param {T} node + * @returns {ByteView} + */ +const node_modules_multiformats_src_codecs_json_encode = (node) => node_modules_multiformats_src_codecs_json_textEncoder.encode(JSON.stringify(node)) +/** + * @template T + * @param {ByteView} data + * @returns {T} + */ +const node_modules_multiformats_src_codecs_json_decode = (data) => JSON.parse(node_modules_multiformats_src_codecs_json_textDecoder.decode(data)) -const createAddAll = configure(api => { - /** - * @type {import('../types').PinAPI["addAll"]} - */ - async function * addAll (source, options = {}) { - for await (const { path, recursive, metadata } of normalise_input_normaliseInput(source)) { - const res = await api.post('pin/add', { - signal: options.signal, - searchParams: toUrlSearchParams({ - ...options, - arg: path, - recursive, - metadata: metadata ? JSON.stringify(metadata) : undefined, - stream: true - }), - headers: options.headers - }) +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/cid.js - for await (const pin of res.ndjson()) { - if (pin.Pins) { // non-streaming response - for (const cid of pin.Pins) { - yield node_modules_multiformats_src_cid_CID.parse(cid) - } - // eslint-disable-next-line no-continue - continue - } - yield node_modules_multiformats_src_cid_CID.parse(pin) - } - } - } - return addAll -}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/add.js +// Linter can see that API is used in types. +// eslint-disable-next-line + + +// This way TS will also expose all the types from module /** - * @param {import('../types').Options} config + * @template {API.Link} T + * @template {string} Prefix + * @param {T} link + * @param {API.MultibaseEncoder} [base] + * @returns {API.ToString} */ -function add_createAdd (config) { - const all = createAddAll(config) - - return configure(() => { - /** - * @type {import('../types').PinAPI["add"]} - */ - async function add (path, options = {}) { - // @ts-expect-error last can return undefined - return last(all([{ - path, - ...options - }], options)) - } - return add - })(config) +const peer_id_node_modules_multiformats_src_cid_format = (link, base) => { + const { bytes, version } = link + switch (version) { + case 0: + return peer_id_node_modules_multiformats_src_cid_toStringV0( + bytes, + peer_id_node_modules_multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder<"z">} */ (base) || peer_id_node_modules_multiformats_src_bases_base58_base58btc.encoder + ) + default: + return peer_id_node_modules_multiformats_src_cid_toStringV1( + bytes, + peer_id_node_modules_multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder} */ (base || peer_id_node_modules_multiformats_src_bases_base32_base32.encoder) + ) + } } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/ls.js - +/** + * @template {API.UnknownLink} Link + * @param {Link} link + * @returns {API.LinkJSON} + */ +const peer_id_node_modules_multiformats_src_cid_toJSON = (link) => ({ + '/': peer_id_node_modules_multiformats_src_cid_format(link) +}) +/** + * @template {API.UnknownLink} Link + * @param {API.LinkJSON} json + */ +const peer_id_node_modules_multiformats_src_cid_fromJSON = (json) => + peer_id_node_modules_multiformats_src_cid_CID.parse(json['/']) +/** @type {WeakMap>} */ +const peer_id_node_modules_multiformats_src_cid_cache = new WeakMap() /** - * @param {string} type - * @param {string} cid - * @param {Record} metadata + * @param {API.UnknownLink} cid + * @returns {Map} */ -function ls_toPin (type, cid, metadata) { - /** @type {import('../types').LsResult} */ - const pin = { - type, - cid: node_modules_multiformats_src_cid_CID.parse(cid) - } - - if (metadata) { - pin.metadata = metadata +const peer_id_node_modules_multiformats_src_cid_baseCache = cid => { + const baseCache = peer_id_node_modules_multiformats_src_cid_cache.get(cid) + if (baseCache == null) { + const baseCache = new Map() + peer_id_node_modules_multiformats_src_cid_cache.set(cid, baseCache) + return baseCache } - - return pin + return baseCache } -const pin_ls_createLs = configure(api => { +/** + * @template {unknown} [Data=unknown] + * @template {number} [Format=number] + * @template {number} [Alg=number] + * @template {API.Version} [Version=API.Version] + * @implements {API.Link} + */ + +class peer_id_node_modules_multiformats_src_cid_CID { /** - * @type {import('../types').PinAPI["ls"]} + * @param {Version} version - Version of the CID + * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content. + * @param {Uint8Array} bytes + * */ - async function * ls (options = {}) { - /** @type {any[]} */ - let paths = [] - - if (options.paths) { - paths = Array.isArray(options.paths) ? options.paths : [options.paths] - } - - const res = await api.post('pin/ls', { - signal: options.signal, - searchParams: toUrlSearchParams({ - ...options, - arg: paths.map(path => `${path}`), - stream: true - }), - headers: options.headers - }) - - for await (const pin of res.ndjson()) { - if (pin.Keys) { // non-streaming response - for (const cid of Object.keys(pin.Keys)) { - yield ls_toPin(pin.Keys[cid].Type, cid, pin.Keys[cid].Metadata) - } - return - } + constructor (version, code, multihash, bytes) { + /** @readonly */ + this.code = code + /** @readonly */ + this.version = version + /** @readonly */ + this.multihash = multihash + /** @readonly */ + this.bytes = bytes - yield ls_toPin(pin.Type, pin.Cid, pin.Metadata) - } + // flag to serializers that this is a CID and + // should be treated specially + /** @readonly */ + this['/'] = bytes } - return ls -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/rm-all.js - + /** + * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` + * please either use `CID.asCID(cid)` or switch to new signalling mechanism + * + * @deprecated + */ + get asCID () { + return this + } + // ArrayBufferView + get byteOffset () { + return this.bytes.byteOffset + } + // ArrayBufferView + get byteLength () { + return this.bytes.byteLength + } -const createRmAll = configure(api => { /** - * @type {import('../types').PinAPI["rmAll"]} + * @returns {CID} */ - async function * rmAll (source, options = {}) { - for await (const { path, recursive } of normalise_input_normaliseInput(source)) { - const searchParams = new URLSearchParams(options.searchParams) - searchParams.append('arg', `${path}`) - - if (recursive != null) searchParams.set('recursive', String(recursive)) + toV0 () { + switch (this.version) { + case 0: { + return /** @type {CID} */ (this) + } + case 1: { + const { code, multihash } = this - const res = await api.post('pin/rm', { - signal: options.signal, - headers: options.headers, - searchParams: toUrlSearchParams({ - ...options, - arg: `${path}`, - recursive - }) - }) + if (code !== peer_id_node_modules_multiformats_src_cid_DAG_PB_CODE) { + throw new Error('Cannot convert a non dag-pb CID to CIDv0') + } - for await (const pin of res.ndjson()) { - if (pin.Pins) { // non-streaming response - yield * pin.Pins.map((/** @type {string} */ cid) => node_modules_multiformats_src_cid_CID.parse(cid)) - // eslint-disable-next-line no-continue - continue + // sha2-256 + if (multihash.code !== peer_id_node_modules_multiformats_src_cid_SHA_256_CODE) { + throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') } - yield node_modules_multiformats_src_cid_CID.parse(pin) + + return /** @type {CID} */ ( + peer_id_node_modules_multiformats_src_cid_CID.createV0( + /** @type {API.MultihashDigest} */ (multihash) + ) + ) + } + default: { + throw Error( + `Can not convert CID version ${this.version} to version 0. This is a bug please report` + ) } } } - return rmAll -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/rm.js - - - -/** - * @param {import('../types').Options} config - */ -const pin_rm_createRm = (config) => { - const all = createRmAll(config) - - return configure(() => { - /** - * @type {import('../types').PinAPI["rm"]} - */ - async function rm (path, options = {}) { - // @ts-expect-error last can return undefined - return last(all([{ - path, - ...options - }], options)) + /** + * @returns {CID} + */ + toV1 () { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash + const multihash = peer_id_node_modules_multiformats_src_hashes_digest_create(code, digest) + return /** @type {CID} */ ( + peer_id_node_modules_multiformats_src_cid_CID.createV1(this.code, multihash) + ) + } + case 1: { + return /** @type {CID} */ (this) + } + default: { + throw Error( + `Can not convert CID version ${this.version} to version 1. This is a bug please report` + ) + } } - return rm - })(config) -} + } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/utils.js + /** + * @param {unknown} other + * @returns {other is CID} + */ + equals (other) { + return peer_id_node_modules_multiformats_src_cid_CID.equals(this, other) + } + /** + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @param {API.Link} self + * @param {unknown} other + * @returns {other is CID} + */ + static equals (self, other) { + const unknown = + /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ ( + other + ) + return ( + unknown && + self.code === unknown.code && + self.version === unknown.version && + peer_id_node_modules_multiformats_src_hashes_digest_equals(self.multihash, unknown.multihash) + ) + } + /** + * @param {API.MultibaseEncoder} [base] + * @returns {string} + */ + toString (base) { + return peer_id_node_modules_multiformats_src_cid_format(this, base) + } -/** - * @param {object} json - * @param {string} json.Name - * @param {string} json.Cid - * @param {import('../../types.js').Status} json.Status - * @returns {import('../../types.js').Pin} - */ -const decodePin = ({ Name: name, Status: status, Cid: cid }) => { - return { - cid: node_modules_multiformats_src_cid_CID.parse(cid), - name, - status + toJSON () { + return { '/': peer_id_node_modules_multiformats_src_cid_format(this) } } -} -/** - * @param {any} service - * @returns {string} - */ -const encodeService = (service) => { - if (typeof service === 'string' && service !== '') { - return service - } else { - throw new TypeError('service name must be passed') + link () { + return this } -} -/** - * @param {any} cid - * @returns {string} - */ -const utils_encodeCID = (cid) => { - if (node_modules_multiformats_src_cid_CID.asCID(cid)) { - return cid.toString() - } else { - throw new TypeError(`CID instance expected instead of ${typeof cid}`) + get [Symbol.toStringTag] () { + return 'CID' } -} -/** - * @param {import('../../types.js').Query & { all?: boolean }} query - * @returns {URLSearchParams} - */ -const encodeQuery = ({ service, cid, name, status, all }) => { - const query = toUrlSearchParams({ - service: encodeService(service), - name, - force: all ? true : undefined - }) + // Legacy - if (cid) { - for (const value of cid) { - query.append('cid', utils_encodeCID(value)) - } + [Symbol.for('nodejs.util.inspect.custom')] () { + return `CID(${this.toString()})` } - if (status) { - for (const value of status) { - query.append('status', value) + /** + * Takes any input `value` and returns a `CID` instance if it was + * a `CID` otherwise returns `null`. If `value` is instanceof `CID` + * it will return value back. If `value` is not instance of this CID + * class, but is compatible CID it will return new instance of this + * `CID` class. Otherwise returns null. + * + * This allows two different incompatible versions of CID library to + * co-exist and interop as long as binary interface is compatible. + * + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @template {unknown} U + * @param {API.Link|U} input + * @returns {CID|null} + */ + static asCID (input) { + if (input == null) { + return null } - } - - return query -} - -/** - * @param {import('../../types.js').AddOptions & {cid:CID}} options - * @returns {URLSearchParams} - */ -const encodeAddParams = ({ cid, service, background, name, origins }) => { - const params = toUrlSearchParams({ - arg: utils_encodeCID(cid), - service: encodeService(service), - name, - background: background ? true : undefined - }) - if (origins) { - for (const origin of origins) { - params.append('origin', origin.toString()) + const value = /** @type {any} */ (input) + if (value instanceof peer_id_node_modules_multiformats_src_cid_CID) { + // If value is instance of CID then we're all set. + return value + } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { + // If value isn't instance of this CID class but `this.asCID === this` or + // `value['/'] === value.bytes` is true it is CID instance coming from a + // different implementation (diff version or duplicate). In that case we + // rebase it to this `CID` implementation so caller is guaranteed to get + // instance with expected API. + const { version, code, multihash, bytes } = value + return new peer_id_node_modules_multiformats_src_cid_CID( + version, + code, + /** @type {API.MultihashDigest} */ (multihash), + bytes || peer_id_node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes) + ) + } else if (value[peer_id_node_modules_multiformats_src_cid_cidSymbol] === true) { + // If value is a CID from older implementation that used to be tagged via + // symbol we still rebase it to the this `CID` implementation by + // delegating that to a constructor. + const { version, multihash, code } = value + const digest = + /** @type {API.MultihashDigest} */ + (peer_id_node_modules_multiformats_src_hashes_digest_decode(multihash)) + return peer_id_node_modules_multiformats_src_cid_CID.create(version, code, digest) + } else { + // Otherwise value is not a CID (or an incompatible version of it) in + // which case we return `null`. + return null } } - return params -} + /** + * + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @param {Version} version - Version of the CID + * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param {API.MultihashDigest} digest - (Multi)hash of the of the content. + * @returns {CID} + */ + static create (version, code, digest) { + if (typeof code !== 'number') { + throw new Error('String codecs are no longer supported') + } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/add.js + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error('Invalid digest') + } + switch (version) { + case 0: { + if (code !== peer_id_node_modules_multiformats_src_cid_DAG_PB_CODE) { + throw new Error( + `Version 0 CID must use dag-pb (code: ${peer_id_node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding` + ) + } else { + return new peer_id_node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes) + } + } + case 1: { + const bytes = peer_id_node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes) + return new peer_id_node_modules_multiformats_src_cid_CID(version, code, digest, bytes) + } + default: { + throw new Error('Invalid version') + } + } + } -/** - * @param {import('../../lib/core').Client} client - */ -function remote_add_createAdd (client) { /** - * @type {import('../../types').RemotePiningAPI["add"]} + * Simplified version of `create` for CIDv0. + * + * @template {unknown} [T=unknown] + * @param {API.MultihashDigest} digest - Multihash. + * @returns {CID} */ - async function add (cid, { timeout, signal, headers, ...query }) { - const response = await client.post('pin/remote/add', { - timeout, - signal, - headers, - searchParams: encodeAddParams({ cid, ...query }) - }) - - return decodePin(await response.json()) + static createV0 (digest) { + return peer_id_node_modules_multiformats_src_cid_CID.create(0, peer_id_node_modules_multiformats_src_cid_DAG_PB_CODE, digest) } - return add -} - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/ls.js - - -/** - * @param {import('../../lib/core').Client} client - */ -function remote_ls_createLs (client) { /** - * @type {import('../../types.js').RemotePiningAPI["ls"]} + * Simplified version of `create` for CIDv1. + * + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @param {Code} code - Content encoding format code. + * @param {API.MultihashDigest} digest - Miltihash of the content. + * @returns {CID} */ - async function * ls ({ timeout, signal, headers, ...query }) { - const response = await client.post('pin/remote/ls', { - timeout, - signal, - headers, - searchParams: encodeQuery(query) - }) + static createV1 (code, digest) { + return peer_id_node_modules_multiformats_src_cid_CID.create(1, code, digest) + } - for await (const pin of response.ndjson()) { - yield decodePin(pin) + /** + * Decoded a CID from its binary representation. The byte array must contain + * only the CID with no additional bytes. + * + * An error will be thrown if the bytes provided do not contain a valid + * binary representation of a CID. + * + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ByteView>} bytes + * @returns {CID} + */ + static decode (bytes) { + const [cid, remainder] = peer_id_node_modules_multiformats_src_cid_CID.decodeFirst(bytes) + if (remainder.length) { + throw new Error('Incorrect length') } + return cid } - return ls -} - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/rm.js - - -/** - * @param {import('../../lib/core').Client} client - */ -function remote_rm_createRm (client) { /** - * @type {import('../../types').RemotePiningAPI["rm"]} + * Decoded a CID from its binary representation at the beginning of a byte + * array. + * + * Returns an array with the first element containing the CID and the second + * element containing the remainder of the original byte array. The remainder + * will be a zero-length byte array if the provided bytes only contained a + * binary CID representation. + * + * @template {unknown} T + * @template {number} C + * @template {number} A + * @template {API.Version} V + * @param {API.ByteView>} bytes + * @returns {[CID, Uint8Array]} */ - async function rm ({ timeout, signal, headers, ...query }) { - await client.post('pin/remote/rm', { - timeout, - signal, - headers, - searchParams: encodeQuery({ - ...query, - all: false - }) - }) + static decodeFirst (bytes) { + const specs = peer_id_node_modules_multiformats_src_cid_CID.inspectBytes(bytes) + const prefixSize = specs.size - specs.multihashSize + const multihashBytes = peer_id_node_modules_multiformats_src_bytes_coerce( + bytes.subarray(prefixSize, prefixSize + specs.multihashSize) + ) + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error('Incorrect length') + } + const digestBytes = multihashBytes.subarray( + specs.multihashSize - specs.digestSize + ) + const digest = new peer_id_node_modules_multiformats_src_hashes_digest_Digest( + specs.multihashCode, + specs.digestSize, + digestBytes, + multihashBytes + ) + const cid = + specs.version === 0 + ? peer_id_node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) + : peer_id_node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest) + return [/** @type {CID} */(cid), bytes.subarray(specs.size)] } - return rm -} + /** + * Inspect the initial bytes of a CID to determine its properties. + * + * Involves decoding up to 4 varints. Typically this will require only 4 to 6 + * bytes but for larger multicodec code values and larger multihash digest + * lengths these varints can be quite large. It is recommended that at least + * 10 bytes be made available in the `initialBytes` argument for a complete + * inspection. + * + * @template {unknown} T + * @template {number} C + * @template {number} A + * @template {API.Version} V + * @param {API.ByteView>} initialBytes + * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }} + */ + static inspectBytes (initialBytes) { + let offset = 0 + const next = () => { + const [i, length] = peer_id_node_modules_multiformats_src_varint_decode(initialBytes.subarray(offset)) + offset += length + return i + } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/rm-all.js + let version = /** @type {V} */ (next()) + let codec = /** @type {C} */ (peer_id_node_modules_multiformats_src_cid_DAG_PB_CODE) + if (/** @type {number} */(version) === 18) { + // CIDv0 + version = /** @type {V} */ (0) + offset = 0 + } else { + codec = /** @type {C} */ (next()) + } + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`) + } + + const prefixSize = offset + const multihashCode = /** @type {A} */ (next()) // multihash code + const digestSize = next() // multihash length + const size = offset + digestSize + const multihashSize = size - prefixSize + + return { version, codec, multihashCode, digestSize, multihashSize, size } + } -/** - * @param {import('../../lib/core').Client} client - */ -function rm_all_createRmAll (client) { /** - * @type {import('../../types').RemotePiningAPI["rmAll"]} + * Takes cid in a string representation and creates an instance. If `base` + * decoder is not provided will use a default from the configuration. It will + * throw an error if encoding of the CID is not compatible with supplied (or + * a default decoder). + * + * @template {string} Prefix + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ToString, Prefix>} source + * @param {API.MultibaseDecoder} [base] + * @returns {CID} */ - async function rmAll ({ timeout, signal, headers, ...query }) { - await client.post('pin/remote/rm', { - timeout, - signal, - headers, - searchParams: encodeQuery({ - ...query, - all: true - }) - }) - } + static parse (source, base) { + const [prefix, bytes] = peer_id_node_modules_multiformats_src_cid_parseCIDtoBytes(source, base) - return rmAll -} + const cid = peer_id_node_modules_multiformats_src_cid_CID.decode(bytes) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/service/utils.js + if (cid.version === 0 && source[0] !== 'Q') { + throw Error('Version 0 CID string must not include multibase prefix') + } -/** - * @param {URL} url - */ -function encodeEndpoint (url) { - const href = String(url) - if (href === 'undefined') { - throw Error('endpoint is required') - } - // Workaround trailing `/` issue in go-ipfs - // @see https://github.com/ipfs/go-ipfs/issues/7826 - return href[href.length - 1] === '/' ? href.slice(0, -1) : href -} + // Cache string representation to avoid computing it on `this.toString()` + peer_id_node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source) -/** - * @param {any} json - * @returns {import('../../../types').RemotePinServiceWithStat} - */ -function decodeRemoteService (json) { - return { - service: json.Service, - endpoint: new URL(json.ApiEndpoint), - ...(json.Stat && { stat: decodeStat(json.Stat) }) + return cid } } /** - * @param {any} json - * @returns {import('../../../types').Stat} + * @template {string} Prefix + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ToString, Prefix>} source + * @param {API.MultibaseDecoder} [base] + * @returns {[Prefix, API.ByteView>]} */ -function decodeStat (json) { - switch (json.Status) { - case 'valid': { - const { Pinning, Pinned, Queued, Failed } = json.PinCount - return { - status: 'valid', - pinCount: { - queued: Queued, - pinning: Pinning, - pinned: Pinned, - failed: Failed - } - } +const peer_id_node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => { + switch (source[0]) { + // CIDv0 is parsed differently + case 'Q': { + const decoder = base || peer_id_node_modules_multiformats_src_bases_base58_base58btc + return [ + /** @type {Prefix} */ (peer_id_node_modules_multiformats_src_bases_base58_base58btc.prefix), + decoder.decode(`${peer_id_node_modules_multiformats_src_bases_base58_base58btc.prefix}${source}`) + ] } - case 'invalid': { - return { status: 'invalid' } + case peer_id_node_modules_multiformats_src_bases_base58_base58btc.prefix: { + const decoder = base || peer_id_node_modules_multiformats_src_bases_base58_base58btc + return [/** @type {Prefix} */(peer_id_node_modules_multiformats_src_bases_base58_base58btc.prefix), decoder.decode(source)] + } + case peer_id_node_modules_multiformats_src_bases_base32_base32.prefix: { + const decoder = base || peer_id_node_modules_multiformats_src_bases_base32_base32 + return [/** @type {Prefix} */(peer_id_node_modules_multiformats_src_bases_base32_base32.prefix), decoder.decode(source)] } default: { - return { status: json.Status } + if (base == null) { + throw Error( + 'To parse non base32 or base58btc encoded CID multibase decoder must be provided' + ) + } + return [/** @type {Prefix} */(source[0]), base.decode(source)] } } } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/service/add.js - - - /** - * @param {import('../../../lib/core').Client} client + * + * @param {Uint8Array} bytes + * @param {Map} cache + * @param {API.MultibaseEncoder<'z'>} base */ -function service_add_createAdd (client) { - /** - * @type {import('../../../types').RemotePiningServiceAPI["add"]} - */ - async function add (name, options) { - const { endpoint, key, headers, timeout, signal } = options - - await client.post('pin/remote/service/add', { - timeout, - signal, - searchParams: toUrlSearchParams({ - arg: [name, encodeEndpoint(endpoint), key] - }), - headers - }) +const peer_id_node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => { + const { prefix } = base + if (prefix !== peer_id_node_modules_multiformats_src_bases_base58_base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base.name} encoding`) } - return add + const cid = cache.get(prefix) + if (cid == null) { + const cid = base.encode(bytes).slice(1) + cache.set(prefix, cid) + return cid + } else { + return cid + } } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/service/ls.js - - - /** - * @param {import('../../../lib/core').Client} client + * @template {string} Prefix + * @param {Uint8Array} bytes + * @param {Map} cache + * @param {API.MultibaseEncoder} base */ -function service_ls_createLs (client) { - /** - * @type {import('../../../types').RemotePiningServiceAPI["ls"]} - */ - async function ls (options = {}) { - // @ts-expect-error cannot derive option type from typedef - const { stat, headers, timeout, signal } = options - - const response = await client.post('pin/remote/service/ls', { - timeout, - signal, - headers, - searchParams: stat === true ? toUrlSearchParams({ stat }) : undefined - }) - - /** @type {{RemoteServices: object[]}} */ - const { RemoteServices } = await response.json() - - return RemoteServices.map(decodeRemoteService) +const peer_id_node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => { + const { prefix } = base + const cid = cache.get(prefix) + if (cid == null) { + const cid = base.encode(bytes) + cache.set(prefix, cid) + return cid + } else { + return cid } - - return ls } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/service/rm.js - +const peer_id_node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70 +const peer_id_node_modules_multiformats_src_cid_SHA_256_CODE = 0x12 /** - * @param {import('../../../lib/core').Client} client + * @param {API.Version} version + * @param {number} code + * @param {Uint8Array} multihash + * @returns {Uint8Array} */ -function service_rm_createRm (client) { - /** - * @type {import('../../../types').RemotePiningServiceAPI["rm"]} - */ - async function rm (name, options = {}) { - await client.post('pin/remote/service/rm', { - signal: options.signal, - headers: options.headers, - searchParams: toUrlSearchParams({ - arg: name - }) - }) - } - - return rm +const peer_id_node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => { + const codeOffset = peer_id_node_modules_multiformats_src_varint_encodingLength(version) + const hashOffset = codeOffset + peer_id_node_modules_multiformats_src_varint_encodingLength(code) + const bytes = new Uint8Array(hashOffset + multihash.byteLength) + peer_id_node_modules_multiformats_src_varint_encodeTo(version, bytes, 0) + peer_id_node_modules_multiformats_src_varint_encodeTo(code, bytes, codeOffset) + bytes.set(multihash, hashOffset) + return bytes } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/service/index.js +const peer_id_node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/index.js -/** - * @param {import('../../../types').Options} config - */ -function createService (config) { - const client = new Client(config) - return { - add: service_add_createAdd(client), - ls: service_ls_createLs(client), - rm: service_rm_createRm(client) - } -} +// This way TS will also expose all the types from module -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/index.js +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/multiformats/src/basics.js +// @ts-check -/** - * @param {import('../../types').Options} config - */ -function createRemote (config) { - const client = new Client(config) - return { - add: remote_add_createAdd(client), - ls: remote_ls_createLs(client), - rm: remote_rm_createRm(client), - rmAll: rm_all_createRmAll(client), - service: createService(config) - } -} -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/index.js @@ -237913,876 +160928,1666 @@ function createRemote (config) { -/** - * @param {import('../types').Options} config - */ -function createPin (config) { - return { - addAll: createAddAll(config), - add: add_createAdd(config), - ls: pin_ls_createLs(config), - rmAll: createRmAll(config), - rm: pin_rm_createRm(config), - remote: createRemote(config) - } -} -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/http-rpc-wire-format.js -/* HTTP RPC: - * - wraps binary data in multibase. base64url is used to avoid issues - * when a binary data is passed as search param in URL. - * Historical context: https://github.com/ipfs/go-ipfs/issues/7939 - * Multibase wrapping introduced in: https://github.com/ipfs/go-ipfs/pull/8183 - */ -/** - * @param {Array} strings - * @returns {Array} strings - */ -const rpcArrayToTextArray = strings => { - if (Array.isArray(strings)) { - return strings.map(rpcToText) - } - return strings -} +const node_modules_multiformats_src_basics_bases = { ...peer_id_node_modules_multiformats_src_bases_identity_namespaceObject, ...node_modules_multiformats_src_bases_base2_namespaceObject, ...node_modules_multiformats_src_bases_base8_namespaceObject, ...node_modules_multiformats_src_bases_base10_namespaceObject, ...node_modules_multiformats_src_bases_base16_namespaceObject, ...peer_id_node_modules_multiformats_src_bases_base32_namespaceObject, ...node_modules_multiformats_src_bases_base36_namespaceObject, ...peer_id_node_modules_multiformats_src_bases_base58_namespaceObject, ...peer_id_node_modules_multiformats_src_bases_base64_namespaceObject, ...node_modules_multiformats_src_bases_base256emoji_namespaceObject } +const node_modules_multiformats_src_basics_hashes = { ...node_modules_multiformats_src_hashes_sha2_namespaceObject, ...node_modules_multiformats_src_hashes_identity_namespaceObject } +const node_modules_multiformats_src_basics_codecs = { raw: node_modules_multiformats_src_codecs_raw_namespaceObject, json: peer_id_node_modules_multiformats_src_codecs_json_namespaceObject } -/** - * @param {string} mb - * @returns {string} - */ -const rpcToText = mb => dist_src_to_string_toString(rpcToBytes(mb)) -/** - * @param {string} mb - * @returns {Uint8Array} - */ -const rpcToBytes = mb => bases_base64_base64url.decode(mb) +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/node_modules/uint8arrays/dist/src/equals.js /** - * @param {string} mb - * @returns {bigint} + * Returns true if the two passed Uint8Arrays have the same content */ -const rpcToBigInt = mb => BigInt(`0x${dist_src_to_string_toString(bases_base64_base64url.decode(mb), 'base16')}`) +function dist_src_equals_equals(a, b) { + if (a === b) { + return true; + } + if (a.byteLength !== b.byteLength) { + return false; + } + for (let i = 0; i < a.byteLength; i++) { + if (a[i] !== b[i]) { + return false; + } + } + return true; +} +//# sourceMappingURL=equals.js.map +;// CONCATENATED MODULE: ./node_modules/@libp2p/peer-id/dist/src/index.js -/** - * @param {string} text - * @returns {string} - */ -const textToUrlSafeRpc = text => bases_base64_base64url.encode(dist_src_from_string_fromString(text)) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pubsub/ls.js -const pubsub_ls_createLs = configure(api => { - /** - * @type {import('../types').PubsubAPI["ls"]} - */ - async function ls (options = {}) { - const { Strings } = await (await api.post('pubsub/ls', { - signal: options.signal, - searchParams: toUrlSearchParams(options), - headers: options.headers - })).json() - return rpcArrayToTextArray(Strings) || [] - } - return ls -}) +const dist_src_inspect = Symbol.for('nodejs.util.inspect.custom'); +const baseDecoder = Object + .values(node_modules_multiformats_src_basics_bases) + .map(codec => codec.decoder) + // @ts-expect-error https://github.com/multiformats/js-multiformats/issues/141 + .reduce((acc, curr) => acc.or(curr), node_modules_multiformats_src_basics_bases.identity.decoder); +// these values are from https://github.com/multiformats/multicodec/blob/master/table.csv +const LIBP2P_KEY_CODE = 0x72; +const MARSHALLED_ED225519_PUBLIC_KEY_LENGTH = 36; +const MARSHALLED_SECP256K1_PUBLIC_KEY_LENGTH = 37; +class PeerIdImpl { + type; + multihash; + privateKey; + publicKey; + string; + constructor(init) { + this.type = init.type; + this.multihash = init.multihash; + this.privateKey = init.privateKey; + // mark string cache as non-enumerable + Object.defineProperty(this, 'string', { + enumerable: false, + writable: true + }); + } + get [Symbol.toStringTag]() { + return `PeerId(${this.toString()})`; + } + [dist_src_symbol] = true; + toString() { + if (this.string == null) { + this.string = peer_id_node_modules_multiformats_src_bases_base58_base58btc.encode(this.multihash.bytes).slice(1); + } + return this.string; + } + // return self-describing String representation + // in default format from RFC 0001: https://github.com/libp2p/specs/pull/209 + toCID() { + return peer_id_node_modules_multiformats_src_cid_CID.createV1(LIBP2P_KEY_CODE, this.multihash); + } + toBytes() { + return this.multihash.bytes; + } + /** + * Returns Multiaddr as a JSON string + */ + toJSON() { + return this.toString(); + } + /** + * Checks the equality of `this` peer against a given PeerId + */ + equals(id) { + if (id instanceof Uint8Array) { + return dist_src_equals_equals(this.multihash.bytes, id); + } + else if (typeof id === 'string') { + return peerIdFromString(id).equals(this); + } + else if (id?.multihash?.bytes != null) { + return dist_src_equals_equals(this.multihash.bytes, id.multihash.bytes); + } + else { + throw new Error('not valid Id'); + } + } + /** + * Returns PeerId as a human-readable string + * https://nodejs.org/api/util.html#utilinspectcustom + * + * @example + * ```js + * import { peerIdFromString } from '@libp2p/peer-id' + * + * console.info(peerIdFromString('QmFoo')) + * // 'PeerId(QmFoo)' + * ``` + */ + [dist_src_inspect]() { + return `PeerId(${this.toString()})`; + } +} +class RSAPeerIdImpl extends PeerIdImpl { + type = 'RSA'; + publicKey; + constructor(init) { + super({ ...init, type: 'RSA' }); + this.publicKey = init.publicKey; + } +} +class Ed25519PeerIdImpl extends PeerIdImpl { + type = 'Ed25519'; + publicKey; + constructor(init) { + super({ ...init, type: 'Ed25519' }); + this.publicKey = init.multihash.digest; + } +} +class Secp256k1PeerIdImpl extends PeerIdImpl { + type = 'secp256k1'; + publicKey; + constructor(init) { + super({ ...init, type: 'secp256k1' }); + this.publicKey = init.multihash.digest; + } +} +function createPeerId(init) { + if (init.type === 'RSA') { + return new RSAPeerIdImpl(init); + } + if (init.type === 'Ed25519') { + return new Ed25519PeerIdImpl(init); + } + if (init.type === 'secp256k1') { + return new Secp256k1PeerIdImpl(init); + } + throw new CodeError('Type must be "RSA", "Ed25519" or "secp256k1"', 'ERR_INVALID_PARAMETERS'); +} +function peerIdFromPeerId(other) { + if (other.type === 'RSA') { + return new RSAPeerIdImpl(other); + } + if (other.type === 'Ed25519') { + return new Ed25519PeerIdImpl(other); + } + if (other.type === 'secp256k1') { + return new Secp256k1PeerIdImpl(other); + } + throw new CodeError('Not a PeerId', 'ERR_INVALID_PARAMETERS'); +} +function peerIdFromString(str, decoder) { + decoder = decoder ?? baseDecoder; + if (str.charAt(0) === '1' || str.charAt(0) === 'Q') { + // identity hash ed25519/secp256k1 key or sha2-256 hash of + // rsa public key - base58btc encoded either way + const multihash = peer_id_node_modules_multiformats_src_hashes_digest_decode(peer_id_node_modules_multiformats_src_bases_base58_base58btc.decode(`z${str}`)); + if (str.startsWith('12D')) { + return new Ed25519PeerIdImpl({ multihash }); + } + else if (str.startsWith('16U')) { + return new Secp256k1PeerIdImpl({ multihash }); + } + else { + return new RSAPeerIdImpl({ multihash }); + } + } + return peerIdFromBytes(baseDecoder.decode(str)); +} +function peerIdFromBytes(buf) { + try { + const multihash = peer_id_node_modules_multiformats_src_hashes_digest_decode(buf); + if (multihash.code === node_modules_multiformats_src_hashes_identity_identity.code) { + if (multihash.digest.length === MARSHALLED_ED225519_PUBLIC_KEY_LENGTH) { + return new Ed25519PeerIdImpl({ multihash }); + } + else if (multihash.digest.length === MARSHALLED_SECP256K1_PUBLIC_KEY_LENGTH) { + return new Secp256k1PeerIdImpl({ multihash }); + } + } + if (multihash.code === node_modules_multiformats_src_hashes_sha2_sha256.code) { + return new RSAPeerIdImpl({ multihash }); + } + } + catch { + return peerIdFromCID(peer_id_node_modules_multiformats_src_cid_CID.decode(buf)); + } + throw new Error('Supplied PeerID CID is invalid'); +} +function peerIdFromCID(cid) { + if (cid == null || cid.multihash == null || cid.version == null || (cid.version === 1 && cid.code !== LIBP2P_KEY_CODE)) { + throw new Error('Supplied PeerID CID is invalid'); + } + const multihash = cid.multihash; + if (multihash.code === node_modules_multiformats_src_hashes_sha2_sha256.code) { + return new RSAPeerIdImpl({ multihash: cid.multihash }); + } + else if (multihash.code === node_modules_multiformats_src_hashes_identity_identity.code) { + if (multihash.digest.length === MARSHALLED_ED225519_PUBLIC_KEY_LENGTH) { + return new Ed25519PeerIdImpl({ multihash: cid.multihash }); + } + else if (multihash.digest.length === MARSHALLED_SECP256K1_PUBLIC_KEY_LENGTH) { + return new Secp256k1PeerIdImpl({ multihash: cid.multihash }); + } + } + throw new Error('Supplied PeerID CID is invalid'); +} +/** + * @param publicKey - A marshalled public key + * @param privateKey - A marshalled private key + */ +async function peerIdFromKeys(publicKey, privateKey) { + if (publicKey.length === MARSHALLED_ED225519_PUBLIC_KEY_LENGTH) { + return new Ed25519PeerIdImpl({ multihash: Digest.create(identity.code, publicKey), privateKey }); + } + if (publicKey.length === MARSHALLED_SECP256K1_PUBLIC_KEY_LENGTH) { + return new Secp256k1PeerIdImpl({ multihash: Digest.create(identity.code, publicKey), privateKey }); + } + return new RSAPeerIdImpl({ multihash: await sha256.digest(publicKey), publicKey, privateKey }); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/bitswap/stat.js -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pubsub/peers.js -const createPeers = configure(api => { +const createStat = configure(api => { /** - * @type {import('../types').PubsubAPI["peers"]} + * @type {import('../types').BitswapAPI["stat"]} */ - async function peers (topic, options = {}) { - const res = await api.post('pubsub/peers', { + async function stat (options = {}) { + const res = await api.post('bitswap/stat', { + searchParams: toUrlSearchParams(options), signal: options.signal, - searchParams: toUrlSearchParams({ - arg: textToUrlSafeRpc(topic), - ...options - }), headers: options.headers }) - const { Strings } = await res.json() - - return Strings || [] + return toCoreInterface(await res.json()) } - return peers + return stat }) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pubsub/publish.js - - - - - - -const publish_createPublish = configure(api => { - /** - * @type {import('../types').PubsubAPI["publish"]} - */ - async function publish (topic, data, options = {}) { - const searchParams = toUrlSearchParams({ - arg: textToUrlSafeRpc(topic), - ...options - }) - - // allow aborting requests on body errors - const controller = new AbortController() - const signal = abortSignal(controller.signal, options.signal) - - const res = await api.post('pubsub/pub', { - signal, - searchParams, - ...( - await multipart_request_multipartRequest([data], controller, options.headers) - ) - }) - - await res.text() +/** + * @param {any} res + */ +function toCoreInterface (res) { + return { + provideBufLen: res.ProvideBufLen, + wantlist: (res.Wantlist || []).map((/** @type {{ '/': string }} */ k) => node_modules_multiformats_src_cid_CID.parse(k['/'])), + peers: (res.Peers || []).map((/** @type {string} */ str) => peerIdFromString(str)), + blocksReceived: BigInt(res.BlocksReceived), + dataReceived: BigInt(res.DataReceived), + blocksSent: BigInt(res.BlocksSent), + dataSent: BigInt(res.DataSent), + dupBlksReceived: BigInt(res.DupBlksReceived), + dupDataReceived: BigInt(res.DupDataReceived) } - return publish -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pubsub/subscribe.js - +} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/bitswap/index.js -const subscribe_log = logger('js-kubo-rpc-client:pubsub:subscribe') /** - * @param {import('../types').Options} options - * @param {import('./subscription-tracker').SubscriptionTracker} subsTracker + * @param {import('../types').Options} config */ -const createSubscribe = (options, subsTracker) => { - return configure((api) => { +function createBitswap (config) { + return { /** - * @type {import('../types').PubsubAPI["subscribe"]} + * TODO: https://github.com/ipfs/js-kubo-rpc-client/issues/99 */ - async function subscribe (topic, handler, options = {}) { // eslint-disable-line require-await - options.signal = subsTracker.subscribe(topic, handler, options.signal) - - /** @type {(value?: any) => void} */ - let done - /** @type {(error: Error) => void} */ - let fail - - const result = new Promise((resolve, reject) => { - done = resolve - fail = reject - }) - - // In Firefox, the initial call to fetch does not resolve until some data - // is received. If this doesn't happen within 1 second assume success - const ffWorkaround = setTimeout(() => done(), 1000) - - // Do this async to not block Firefox - api.post('pubsub/sub', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: textToUrlSafeRpc(topic), - ...options - }), - headers: options.headers - }) - .catch((err) => { - // Initial subscribe fail, ensure we clean up - subsTracker.unsubscribe(topic, handler) - - fail(err) - }) - .then((response) => { - clearTimeout(ffWorkaround) + wantlist: createWantlist(config), + wantlistForPeer: createWantlistForPeer(config), + stat: createStat(config) + } +} - if (!response) { - // if there was no response, the subscribe failed - return - } +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/block/get.js - readMessages(response, { - onMessage: (message) => { - if (!handler) { - return - } - if (typeof handler === 'function') { - handler(message) - return - } - if (typeof handler.handleEvent === 'function') { - handler.handleEvent(message) - } - }, - onEnd: () => subsTracker.unsubscribe(topic, handler), - onError: options.onError - }) +const createGet = configure(api => { + /** + * @type {import('../types').BlockAPI["get"]} + */ + async function get (cid, options = {}) { + const res = await api.post('block/get', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: cid.toString(), + ...options + }), + headers: options.headers + }) - done() - }) + return new Uint8Array(await res.arrayBuffer()) + } + return get +}) - return result +;// CONCATENATED MODULE: ./node_modules/browser-readablestream-to-it/dist/src/index.js +/** + * @packageDocumentation + * + * Allows treating a browser readable stream as an async iterator. + * + * @example + * + * ```javascript + * import toIt from 'browser-readablestream-to-it' + * import all from 'it-all' + * + * const content = [0, 1, 2, 3, 4] + * + * const stream = new ReadableStream({ + * start(controller) { + * for (let i = 0; i < content.length; i++) { + * controller.enqueue(content[i]) + * } + * + * controller.close() + * } + * }) + * + * const arr = await all(toIt(stream)) + * + * console.info(arr) // 0, 1, 2, 3, 4 + * ``` + * + * ## preventCancel + * + * By default a readable stream will have [.cancel](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/cancel) called on it once it has ended or + * reading has stopped prematurely. + * + * To prevent this behaviour, pass `preventCancel: true` as an option: + * + * ```javascript + * const arr = await all(toIt(stream, { preventCancel: true })) + * + * console.info(arr) // 0, 1, 2, 3, 4 + * ``` + */ +/** + * Turns a browser readable stream into an async iterable. Async iteration over + * returned iterable will lock give stream, preventing any other consumer from + * acquiring a reader. The lock will be released if iteration loop is broken. To + * prevent stream cancelling optional `{ preventCancel: true }` could be passed + * as a second argument. + */ +async function* browserReadableStreamToIt(stream, options = {}) { + const reader = stream.getReader(); + try { + while (true) { + const result = await reader.read(); + if (result.done) { + return; + } + yield result.value; + } + } + finally { + if (options.preventCancel !== true) { + await reader.cancel(); + } + reader.releaseLock(); } - return subscribe - })(options) } - +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/blob-to-it/dist/src/index.js /** - * @param {import('../types').ExtendedResponse} response - * @param {object} options - * @param {(message: import('../types').Message) => void} options.onMessage - * @param {() => void} options.onEnd - * @param {import('../types').PubsubApiErrorHandlerFn} [options.onError] + * @packageDocumentation + * + * Allows reading Blob contents as an async iterator. + * + * @example + * + * ```javascript + * import toIt from 'blob-to-it' + * import all from 'it-all' + * + * const content = [ Uint8Array.from([0, 1, 2, 3, 4]) ] + * const blob = new Blob(content) + * const arr = await all(toIt(blob)) + * + * console.info(arr) // [ [ 0, 1, 2, 3, 4 ] ] + * ``` */ -async function readMessages (response, { onMessage, onEnd, onError }) { - onError = onError || subscribe_log - - try { - for await (const msg of response.ndjson()) { - try { - if (!msg.from) { - // eslint-disable-next-line no-continue - continue - } - if (msg.from != null && msg.seqno != null) { - onMessage({ - type: 'signed', - from: peerIdFromString(msg.from), - data: rpcToBytes(msg.data), - sequenceNumber: rpcToBigInt(msg.seqno), - topic: rpcToText(msg.topicIDs[0]), - key: rpcToBytes(msg.key ?? 'u'), - signature: rpcToBytes(msg.signature ?? 'u') - }) - } else { - onMessage({ - type: 'unsigned', - data: rpcToBytes(msg.data), - topic: rpcToText(msg.topicIDs[0]) - }) +function blobToIt(blob) { + if (typeof blob.stream === 'function') { + return browserReadableStreamToIt(blob.stream()); + } + // firefox < 69 does not support blob.stream() + // @ts-expect-error - response.body is optional, but in practice it's a stream. + return browserReadableStreamToIt(new Response(blob).body); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/it-peekable/dist/src/index.js +function peekableIterator(iterable) { + // @ts-expect-error + const [iterator, symbol] = iterable[Symbol.asyncIterator] != null + // @ts-expect-error + ? [iterable[Symbol.asyncIterator](), Symbol.asyncIterator] + // @ts-expect-error + : [iterable[Symbol.iterator](), Symbol.iterator]; + const queue = []; + // @ts-expect-error + return { + peek: () => { + return iterator.next(); + }, + push: (value) => { + queue.push(value); + }, + next: () => { + if (queue.length > 0) { + return { + done: false, + value: queue.shift() + }; + } + return iterator.next(); + }, + [symbol]() { + return this; } - } catch (/** @type {any} */ err) { - err.message = `Failed to parse pubsub message: ${err.message}` - onError(err, false, msg) // Not fatal - } + }; +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/it-all/dist/src/index.js +/** + * Collects all values from an (async) iterable and returns them as an array + */ +async function src_all(source) { + const arr = []; + for await (const entry of source) { + arr.push(entry); } - } catch (/** @type {any} */ err) { - if (!isAbortError(err)) { - onError(err, true) // Fatal + return arr; +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/it-map/dist/src/index.js +/** + * Takes an (async) iterable and returns one with each item mapped by the passed + * function + */ +async function* map(source, func) { + for await (const val of source) { + yield func(val); } - } finally { - onEnd() - } } - +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/files/utils.js /** - * @param {Error & {type?:string}} error - * @returns {boolean} + * @param {any} obj + * @returns {obj is ArrayBufferView|ArrayBuffer} */ -const isAbortError = error => { - switch (error.type) { - case 'aborted': - return true - // It is `abort` in Electron instead of `aborted` - case 'abort': - return true - default: - // FIXME: In testing with Chrome, err.type is undefined (should not be!) - // Temporarily use the name property instead. - return error.name === 'AbortError' - } +function isBytes (obj) { + return ArrayBuffer.isView(obj) || obj instanceof ArrayBuffer } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pubsub/unsubscribe.js +/** + * @param {any} obj + * @returns {obj is globalThis.Blob} + */ +function isBlob (obj) { + return obj.constructor && + (obj.constructor.name === 'Blob' || obj.constructor.name === 'File') && + typeof obj.stream === 'function' +} /** - * @param {import('..').Options} options - * @param {import('./subscription-tracker').SubscriptionTracker} subsTracker + * An object with a path or content property + * + * @param {any} obj + * @returns {obj is import('ipfs-core-types/src/utils').ImportCandidate} */ -const createUnsubscribe = (options, subsTracker) => { - /** - * @type {import('../types').PubsubAPI["unsubscribe"]} - */ - async function unsubscribe (topic, handler) { - subsTracker.unsubscribe(topic, handler) - } - return unsubscribe +function isFileObject (obj) { + return typeof obj === 'object' && (obj.path || obj.content) } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pubsub/subscription-tracker.js +/** + * @param {any} value + * @returns {value is ReadableStream} + */ +const isReadableStream = (value) => + value && typeof value.getReader === 'function' + +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/files/normalise-content.js + + + + + + + + /** - * - * @property {import('../types').MessageHandlerFn} handler - * @property {AbortController} controller + * @template T + * @param {T} thing */ +async function * toAsyncIterable (thing) { + yield thing +} -class SubscriptionTracker { - constructor () { - /** @type {Map} */ - this._subs = new Map() +/** + * @param {import('ipfs-core-types/src/utils').ToContent} input + */ +async function normaliseContent (input) { + // Bytes | String + if (isBytes(input)) { + return toAsyncIterable(normalise_content_toBytes(input)) } - /** - * @param {string} topic - * @param {import('../types').MessageHandlerFn} handler - * @param {AbortSignal} [signal] - * @returns {AbortSignal} - */ - subscribe (topic, handler, signal) { - const topicSubs = this._subs.get(topic) || [] + if (typeof input === 'string' || input instanceof String) { + return toAsyncIterable(normalise_content_toBytes(input.toString())) + } - if (topicSubs.find(s => s.handler === handler)) { - throw new Error(`Already subscribed to ${topic} with this handler`) - } + // Blob + if (isBlob(input)) { + return blobToIt(input) + } - // Create controller so a call to unsubscribe can cancel the request - const controller = new AbortController() + // Browser stream + if (isReadableStream(input)) { + input = browserReadableStreamToIt(input) + } - this._subs.set(topic, [{ handler, controller }].concat(topicSubs)) + // (Async)Iterator + if (Symbol.iterator in input || Symbol.asyncIterator in input) { + /** @type {any} peekable */ + const peekable = peekableIterator(input) - // If there is an external signal, forward the abort event - if (signal) { - signal.addEventListener('abort', () => this.unsubscribe(topic, handler)) + /** @type {any} value */ + const { value, done } = await peekable.peek() + + if (done) { + // make sure empty iterators result in empty files + return toAsyncIterable(new Uint8Array(0)) } - return controller.signal - } + peekable.push(value) - /** - * @param {string} topic - * @param {import('../types').MessageHandlerFn} [handler] - */ - unsubscribe (topic, handler) { - const subs = this._subs.get(topic) || [] - let unsubs + // (Async)Iterable + if (Number.isInteger(value)) { + return toAsyncIterable(Uint8Array.from(await src_all(peekable))) + } - if (handler) { - this._subs.set(topic, subs.filter(s => s.handler !== handler)) - unsubs = subs.filter(s => s.handler === handler) - } else { - this._subs.set(topic, []) - unsubs = subs + // (Async)Iterable + if (isBytes(value) || typeof value === 'string' || value instanceof String) { + return map(peekable, normalise_content_toBytes) } + } - if (!(this._subs.get(topic) || []).length) { - this._subs.delete(topic) - } + throw err_code(new Error(`Unexpected input: ${input}`), 'ERR_UNEXPECTED_INPUT') +} - unsubs.forEach(s => s.controller.abort()) +/** + * @param {ArrayBuffer | ArrayBufferView | string | InstanceType | number[]} chunk + */ +function normalise_content_toBytes (chunk) { + if (chunk instanceof Uint8Array) { + return chunk + } + + if (ArrayBuffer.isView(chunk)) { + return new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength) + } + + if (chunk instanceof ArrayBuffer) { + return new Uint8Array(chunk) + } + + if (Array.isArray(chunk)) { + return Uint8Array.from(chunk) } + + return src_from_string_fromString(chunk.toString()) } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pubsub/index.js +// EXTERNAL MODULE: ./node_modules/ipfs-core-utils/node_modules/protobufjs/minimal.js +var minimal = __nccwpck_require__(8227); +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/ipfs-unixfs/src/unixfs.js +/*eslint-disable*/ +// Common aliases +const $Reader = minimal.Reader, $Writer = minimal.Writer, $util = minimal.util; +// Exported root namespace +const $root = minimal.roots["ipfs-unixfs"] || (minimal.roots["ipfs-unixfs"] = {}); +const Data = $root.Data = (() => { + /** + * Properties of a Data. + * @exports IData + * @interface IData + * @property {Data.DataType} Type Data Type + * @property {Uint8Array|null} [Data] Data Data + * @property {number|null} [filesize] Data filesize + * @property {Array.|null} [blocksizes] Data blocksizes + * @property {number|null} [hashType] Data hashType + * @property {number|null} [fanout] Data fanout + * @property {number|null} [mode] Data mode + * @property {IUnixTime|null} [mtime] Data mtime + */ + /** + * Constructs a new Data. + * @exports Data + * @classdesc Represents a Data. + * @implements IData + * @constructor + * @param {IData=} [p] Properties to set + */ + function Data(p) { + this.blocksizes = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } -/** - * @param {import('../types').Options} config - */ -function pubsub_createPubsub (config) { - const subscriptionTracker = new SubscriptionTracker() + /** + * Data Type. + * @member {Data.DataType} Type + * @memberof Data + * @instance + */ + Data.prototype.Type = 0; - return { - ls: pubsub_ls_createLs(config), - peers: createPeers(config), - publish: publish_createPublish(config), - subscribe: createSubscribe(config, subscriptionTracker), - unsubscribe: createUnsubscribe(config, subscriptionTracker) - } -} + /** + * Data Data. + * @member {Uint8Array} Data + * @memberof Data + * @instance + */ + Data.prototype.Data = $util.newBuffer([]); -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/refs/local.js + /** + * Data filesize. + * @member {number} filesize + * @memberof Data + * @instance + */ + Data.prototype.filesize = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + /** + * Data blocksizes. + * @member {Array.} blocksizes + * @memberof Data + * @instance + */ + Data.prototype.blocksizes = $util.emptyArray; + /** + * Data hashType. + * @member {number} hashType + * @memberof Data + * @instance + */ + Data.prototype.hashType = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + /** + * Data fanout. + * @member {number} fanout + * @memberof Data + * @instance + */ + Data.prototype.fanout = $util.Long ? $util.Long.fromBits(0,0,true) : 0; -const createLocal = configure(api => { - /** - * @type {import('../types').RefsAPI["local"]} - */ - async function * refsLocal (options = {}) { - const res = await api.post('refs/local', { - signal: options.signal, - transform: objectToCamel, - searchParams: toUrlSearchParams(options), - headers: options.headers - }) + /** + * Data mode. + * @member {number} mode + * @memberof Data + * @instance + */ + Data.prototype.mode = 0; - yield * res.ndjson() - } - return refsLocal -}) + /** + * Data mtime. + * @member {IUnixTime|null|undefined} mtime + * @memberof Data + * @instance + */ + Data.prototype.mtime = null; -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/refs/index.js + /** + * Encodes the specified Data message. Does not implicitly {@link Data.verify|verify} messages. + * @function encode + * @memberof Data + * @static + * @param {IData} m Data message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Data.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + w.uint32(8).int32(m.Type); + if (m.Data != null && Object.hasOwnProperty.call(m, "Data")) + w.uint32(18).bytes(m.Data); + if (m.filesize != null && Object.hasOwnProperty.call(m, "filesize")) + w.uint32(24).uint64(m.filesize); + if (m.blocksizes != null && m.blocksizes.length) { + for (var i = 0; i < m.blocksizes.length; ++i) + w.uint32(32).uint64(m.blocksizes[i]); + } + if (m.hashType != null && Object.hasOwnProperty.call(m, "hashType")) + w.uint32(40).uint64(m.hashType); + if (m.fanout != null && Object.hasOwnProperty.call(m, "fanout")) + w.uint32(48).uint64(m.fanout); + if (m.mode != null && Object.hasOwnProperty.call(m, "mode")) + w.uint32(56).uint32(m.mode); + if (m.mtime != null && Object.hasOwnProperty.call(m, "mtime")) + $root.UnixTime.encode(m.mtime, w.uint32(66).fork()).ldelim(); + return w; + }; + /** + * Decodes a Data message from the specified reader or buffer. + * @function decode + * @memberof Data + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {Data} Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Data.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.Data(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.Type = r.int32(); + break; + case 2: + m.Data = r.bytes(); + break; + case 3: + m.filesize = r.uint64(); + break; + case 4: + if (!(m.blocksizes && m.blocksizes.length)) + m.blocksizes = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.blocksizes.push(r.uint64()); + } else + m.blocksizes.push(r.uint64()); + break; + case 5: + m.hashType = r.uint64(); + break; + case 6: + m.fanout = r.uint64(); + break; + case 7: + m.mode = r.uint32(); + break; + case 8: + m.mtime = $root.UnixTime.decode(r, r.uint32()); + break; + default: + r.skipType(t & 7); + break; + } + } + if (!m.hasOwnProperty("Type")) + throw $util.ProtocolError("missing required 'Type'", { instance: m }); + return m; + }; + /** + * Creates a Data message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof Data + * @static + * @param {Object.} d Plain object + * @returns {Data} Data + */ + Data.fromObject = function fromObject(d) { + if (d instanceof $root.Data) + return d; + var m = new $root.Data(); + switch (d.Type) { + case "Raw": + case 0: + m.Type = 0; + break; + case "Directory": + case 1: + m.Type = 1; + break; + case "File": + case 2: + m.Type = 2; + break; + case "Metadata": + case 3: + m.Type = 3; + break; + case "Symlink": + case 4: + m.Type = 4; + break; + case "HAMTShard": + case 5: + m.Type = 5; + break; + } + if (d.Data != null) { + if (typeof d.Data === "string") + $util.base64.decode(d.Data, m.Data = $util.newBuffer($util.base64.length(d.Data)), 0); + else if (d.Data.length) + m.Data = d.Data; + } + if (d.filesize != null) { + if ($util.Long) + (m.filesize = $util.Long.fromValue(d.filesize)).unsigned = true; + else if (typeof d.filesize === "string") + m.filesize = parseInt(d.filesize, 10); + else if (typeof d.filesize === "number") + m.filesize = d.filesize; + else if (typeof d.filesize === "object") + m.filesize = new $util.LongBits(d.filesize.low >>> 0, d.filesize.high >>> 0).toNumber(true); + } + if (d.blocksizes) { + if (!Array.isArray(d.blocksizes)) + throw TypeError(".Data.blocksizes: array expected"); + m.blocksizes = []; + for (var i = 0; i < d.blocksizes.length; ++i) { + if ($util.Long) + (m.blocksizes[i] = $util.Long.fromValue(d.blocksizes[i])).unsigned = true; + else if (typeof d.blocksizes[i] === "string") + m.blocksizes[i] = parseInt(d.blocksizes[i], 10); + else if (typeof d.blocksizes[i] === "number") + m.blocksizes[i] = d.blocksizes[i]; + else if (typeof d.blocksizes[i] === "object") + m.blocksizes[i] = new $util.LongBits(d.blocksizes[i].low >>> 0, d.blocksizes[i].high >>> 0).toNumber(true); + } + } + if (d.hashType != null) { + if ($util.Long) + (m.hashType = $util.Long.fromValue(d.hashType)).unsigned = true; + else if (typeof d.hashType === "string") + m.hashType = parseInt(d.hashType, 10); + else if (typeof d.hashType === "number") + m.hashType = d.hashType; + else if (typeof d.hashType === "object") + m.hashType = new $util.LongBits(d.hashType.low >>> 0, d.hashType.high >>> 0).toNumber(true); + } + if (d.fanout != null) { + if ($util.Long) + (m.fanout = $util.Long.fromValue(d.fanout)).unsigned = true; + else if (typeof d.fanout === "string") + m.fanout = parseInt(d.fanout, 10); + else if (typeof d.fanout === "number") + m.fanout = d.fanout; + else if (typeof d.fanout === "object") + m.fanout = new $util.LongBits(d.fanout.low >>> 0, d.fanout.high >>> 0).toNumber(true); + } + if (d.mode != null) { + m.mode = d.mode >>> 0; + } + if (d.mtime != null) { + if (typeof d.mtime !== "object") + throw TypeError(".Data.mtime: object expected"); + m.mtime = $root.UnixTime.fromObject(d.mtime); + } + return m; + }; + /** + * Creates a plain object from a Data message. Also converts values to other types if specified. + * @function toObject + * @memberof Data + * @static + * @param {Data} m Data + * @param {$protobuf.IConversionOptions} [o] Conversion options + * @returns {Object.} Plain object + */ + Data.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.arrays || o.defaults) { + d.blocksizes = []; + } + if (o.defaults) { + d.Type = o.enums === String ? "Raw" : 0; + if (o.bytes === String) + d.Data = ""; + else { + d.Data = []; + if (o.bytes !== Array) + d.Data = $util.newBuffer(d.Data); + } + if ($util.Long) { + var n = new $util.Long(0, 0, true); + d.filesize = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n; + } else + d.filesize = o.longs === String ? "0" : 0; + if ($util.Long) { + var n = new $util.Long(0, 0, true); + d.hashType = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n; + } else + d.hashType = o.longs === String ? "0" : 0; + if ($util.Long) { + var n = new $util.Long(0, 0, true); + d.fanout = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n; + } else + d.fanout = o.longs === String ? "0" : 0; + d.mode = 0; + d.mtime = null; + } + if (m.Type != null && m.hasOwnProperty("Type")) { + d.Type = o.enums === String ? $root.Data.DataType[m.Type] : m.Type; + } + if (m.Data != null && m.hasOwnProperty("Data")) { + 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; + } + if (m.filesize != null && m.hasOwnProperty("filesize")) { + if (typeof m.filesize === "number") + d.filesize = o.longs === String ? String(m.filesize) : m.filesize; + else + 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; + } + if (m.blocksizes && m.blocksizes.length) { + d.blocksizes = []; + for (var j = 0; j < m.blocksizes.length; ++j) { + if (typeof m.blocksizes[j] === "number") + d.blocksizes[j] = o.longs === String ? String(m.blocksizes[j]) : m.blocksizes[j]; + else + 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]; + } + } + if (m.hashType != null && m.hasOwnProperty("hashType")) { + if (typeof m.hashType === "number") + d.hashType = o.longs === String ? String(m.hashType) : m.hashType; + else + 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; + } + if (m.fanout != null && m.hasOwnProperty("fanout")) { + if (typeof m.fanout === "number") + d.fanout = o.longs === String ? String(m.fanout) : m.fanout; + else + 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; + } + if (m.mode != null && m.hasOwnProperty("mode")) { + d.mode = m.mode; + } + if (m.mtime != null && m.hasOwnProperty("mtime")) { + d.mtime = $root.UnixTime.toObject(m.mtime, o); + } + return d; + }; + /** + * Converts this Data to JSON. + * @function toJSON + * @memberof Data + * @instance + * @returns {Object.} JSON object + */ + Data.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, minimal.util.toJSONOptions); + }; + /** + * DataType enum. + * @name Data.DataType + * @enum {number} + * @property {number} Raw=0 Raw value + * @property {number} Directory=1 Directory value + * @property {number} File=2 File value + * @property {number} Metadata=3 Metadata value + * @property {number} Symlink=4 Symlink value + * @property {number} HAMTShard=5 HAMTShard value + */ + Data.DataType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "Raw"] = 0; + values[valuesById[1] = "Directory"] = 1; + values[valuesById[2] = "File"] = 2; + values[valuesById[3] = "Metadata"] = 3; + values[valuesById[4] = "Symlink"] = 4; + values[valuesById[5] = "HAMTShard"] = 5; + return values; + })(); -const createRefs = configure((api, opts) => { - /** - * @type {import('../types').RefsAPI["refs"]} - */ - const refs = async function * (args, options = {}) { - /** @type {import('../types').IPFSPath[]} */ - const argsArr = Array.isArray(args) ? args : [args] + return Data; +})(); - const res = await api.post('refs', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: argsArr.map(arg => `${arg instanceof Uint8Array ? node_modules_multiformats_src_cid_CID.decode(arg) : arg}`), - ...options - }), - headers: options.headers, - transform: objectToCamel - }) +const UnixTime = $root.UnixTime = (() => { - yield * res.ndjson() - } + /** + * Properties of an UnixTime. + * @exports IUnixTime + * @interface IUnixTime + * @property {number} Seconds UnixTime Seconds + * @property {number|null} [FractionalNanoseconds] UnixTime FractionalNanoseconds + */ - return Object.assign(refs, { - local: createLocal(opts) - }) -}) + /** + * Constructs a new UnixTime. + * @exports UnixTime + * @classdesc Represents an UnixTime. + * @implements IUnixTime + * @constructor + * @param {IUnixTime=} [p] Properties to set + */ + function UnixTime(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/repo/gc.js + /** + * UnixTime Seconds. + * @member {number} Seconds + * @memberof UnixTime + * @instance + */ + UnixTime.prototype.Seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * UnixTime FractionalNanoseconds. + * @member {number} FractionalNanoseconds + * @memberof UnixTime + * @instance + */ + UnixTime.prototype.FractionalNanoseconds = 0; + /** + * Encodes the specified UnixTime message. Does not implicitly {@link UnixTime.verify|verify} messages. + * @function encode + * @memberof UnixTime + * @static + * @param {IUnixTime} m UnixTime message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnixTime.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + w.uint32(8).int64(m.Seconds); + if (m.FractionalNanoseconds != null && Object.hasOwnProperty.call(m, "FractionalNanoseconds")) + w.uint32(21).fixed32(m.FractionalNanoseconds); + return w; + }; + /** + * Decodes an UnixTime message from the specified reader or buffer. + * @function decode + * @memberof UnixTime + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {UnixTime} UnixTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnixTime.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.UnixTime(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.Seconds = r.int64(); + break; + case 2: + m.FractionalNanoseconds = r.fixed32(); + break; + default: + r.skipType(t & 7); + break; + } + } + if (!m.hasOwnProperty("Seconds")) + throw $util.ProtocolError("missing required 'Seconds'", { instance: m }); + return m; + }; -const createGc = configure(api => { - /** - * @type {import('../types').RepoAPI["gc"]} - */ - async function * gc (options = {}) { - const res = await api.post('repo/gc', { - signal: options.signal, - searchParams: toUrlSearchParams(options), - headers: options.headers, - transform: (res) => { - return { - err: res.Error ? new Error(res.Error) : null, - cid: (res.Key || {})['/'] ? node_modules_multiformats_src_cid_CID.parse(res.Key['/']) : null + /** + * Creates an UnixTime message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof UnixTime + * @static + * @param {Object.} d Plain object + * @returns {UnixTime} UnixTime + */ + UnixTime.fromObject = function fromObject(d) { + if (d instanceof $root.UnixTime) + return d; + var m = new $root.UnixTime(); + if (d.Seconds != null) { + if ($util.Long) + (m.Seconds = $util.Long.fromValue(d.Seconds)).unsigned = false; + else if (typeof d.Seconds === "string") + m.Seconds = parseInt(d.Seconds, 10); + else if (typeof d.Seconds === "number") + m.Seconds = d.Seconds; + else if (typeof d.Seconds === "object") + m.Seconds = new $util.LongBits(d.Seconds.low >>> 0, d.Seconds.high >>> 0).toNumber(); } - } - }) + if (d.FractionalNanoseconds != null) { + m.FractionalNanoseconds = d.FractionalNanoseconds >>> 0; + } + return m; + }; - yield * res.ndjson() - } - return gc -}) + /** + * Creates a plain object from an UnixTime message. Also converts values to other types if specified. + * @function toObject + * @memberof UnixTime + * @static + * @param {UnixTime} m UnixTime + * @param {$protobuf.IConversionOptions} [o] Conversion options + * @returns {Object.} Plain object + */ + UnixTime.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.defaults) { + if ($util.Long) { + var n = new $util.Long(0, 0, false); + d.Seconds = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n; + } else + d.Seconds = o.longs === String ? "0" : 0; + d.FractionalNanoseconds = 0; + } + if (m.Seconds != null && m.hasOwnProperty("Seconds")) { + if (typeof m.Seconds === "number") + d.Seconds = o.longs === String ? String(m.Seconds) : m.Seconds; + else + 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; + } + if (m.FractionalNanoseconds != null && m.hasOwnProperty("FractionalNanoseconds")) { + d.FractionalNanoseconds = m.FractionalNanoseconds; + } + return d; + }; -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/repo/stat.js + /** + * Converts this UnixTime to JSON. + * @function toJSON + * @memberof UnixTime + * @instance + * @returns {Object.} JSON object + */ + UnixTime.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, minimal.util.toJSONOptions); + }; + return UnixTime; +})(); +const Metadata = $root.Metadata = (() => { -const repo_stat_createStat = configure(api => { - /** - * @type {import('../types').RepoAPI["stat"]} - */ - async function stat (options = {}) { - const res = await api.post('repo/stat', { - signal: options.signal, - searchParams: toUrlSearchParams(options), - headers: options.headers - }) - const data = await res.json() + /** + * Properties of a Metadata. + * @exports IMetadata + * @interface IMetadata + * @property {string|null} [MimeType] Metadata MimeType + */ - return { - numObjects: BigInt(data.NumObjects), - repoSize: BigInt(data.RepoSize), - repoPath: data.RepoPath, - version: data.Version, - storageMax: BigInt(data.StorageMax) + /** + * Constructs a new Metadata. + * @exports Metadata + * @classdesc Represents a Metadata. + * @implements IMetadata + * @constructor + * @param {IMetadata=} [p] Properties to set + */ + function Metadata(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; } - } - return stat -}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/repo/version.js + /** + * Metadata MimeType. + * @member {string} MimeType + * @memberof Metadata + * @instance + */ + Metadata.prototype.MimeType = ""; + /** + * Encodes the specified Metadata message. Does not implicitly {@link Metadata.verify|verify} messages. + * @function encode + * @memberof Metadata + * @static + * @param {IMetadata} m Metadata message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.MimeType != null && Object.hasOwnProperty.call(m, "MimeType")) + w.uint32(10).string(m.MimeType); + return w; + }; + /** + * Decodes a Metadata message from the specified reader or buffer. + * @function decode + * @memberof Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.Metadata(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: + m.MimeType = r.string(); + break; + default: + r.skipType(t & 7); + break; + } + } + return m; + }; -const createVersion = configure(api => { - /** - * @type {import('../types').RepoAPI["version"]} - */ - async function version (options = {}) { - const res = await (await api.post('repo/version', { - signal: options.signal, - searchParams: toUrlSearchParams(options), - headers: options.headers - })).json() + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof Metadata + * @static + * @param {Object.} d Plain object + * @returns {Metadata} Metadata + */ + Metadata.fromObject = function fromObject(d) { + if (d instanceof $root.Metadata) + return d; + var m = new $root.Metadata(); + if (d.MimeType != null) { + m.MimeType = String(d.MimeType); + } + return m; + }; - return res.Version - } - return version -}) + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @function toObject + * @memberof Metadata + * @static + * @param {Metadata} m Metadata + * @param {$protobuf.IConversionOptions} [o] Conversion options + * @returns {Object.} Plain object + */ + Metadata.toObject = function toObject(m, o) { + if (!o) + o = {}; + var d = {}; + if (o.defaults) { + d.MimeType = ""; + } + if (m.MimeType != null && m.hasOwnProperty("MimeType")) { + d.MimeType = m.MimeType; + } + return d; + }; + + /** + * Converts this Metadata to JSON. + * @function toJSON + * @memberof Metadata + * @instance + * @returns {Object.} JSON object + */ + Metadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, minimal.util.toJSONOptions); + }; + + return Metadata; +})(); -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/repo/index.js +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/ipfs-unixfs/src/index.js + +const PBData = Data /** - * @param {import('../types').Options} config + * @typedef {import('./types').Mtime} Mtime + * @typedef {import('./types').MtimeLike} MtimeLike */ -function createRepo (config) { - return { - gc: createGc(config), - stat: repo_stat_createStat(config), - version: createVersion(config) - } -} - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/stats/bw.js +const types = (/* unused pure expression or super */ null && ([ + 'raw', + 'directory', + 'file', + 'metadata', + 'symlink', + 'hamt-sharded-directory' +])) +const dirTypes = (/* unused pure expression or super */ null && ([ + 'directory', + 'hamt-sharded-directory' +])) -const createBw = configure(api => { - /** - * @type {import('../types').StatsAPI["bw"]} - */ - async function * bw (options = {}) { - const res = await api.post('stats/bw', { - signal: options.signal, - searchParams: toUrlSearchParams(options), - headers: options.headers, - transform: (stats) => ({ - totalIn: BigInt(stats.TotalIn), - totalOut: BigInt(stats.TotalOut), - rateIn: parseFloat(stats.RateIn), - rateOut: parseFloat(stats.RateOut) - }) - }) +const DEFAULT_FILE_MODE = parseInt('0644', 8) +const DEFAULT_DIRECTORY_MODE = parseInt('0755', 8) - yield * res.ndjson() +/** + * @param {string | number | undefined} [mode] + */ +function parseMode (mode) { + if (mode == null) { + return undefined } - return bw -}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/stats/index.js + if (typeof mode === 'number') { + return mode & 0xFFF + } + mode = mode.toString() + if (mode.substring(0, 1) === '0') { + // octal string + return parseInt(mode, 8) & 0xFFF + } + // decimal string + return parseInt(mode, 10) & 0xFFF +} /** - * @param {import('../types').Options} config + * @param {any} input */ -function createStats (config) { - return { - bitswap: createStat(config), - repo: repo_stat_createStat(config), - bw: createBw(config) +function src_parseMtime (input) { + if (input == null) { + return undefined } -} - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/swarm/addrs.js - - - + /** @type {Mtime | undefined} */ + let mtime -const createAddrs = configure(api => { - /** - * @type {import('../types.js').SwarmAPI["addrs"]} - */ - async function addrs (options = {}) { - const res = await api.post('swarm/addrs', { - signal: options.signal, - searchParams: toUrlSearchParams(options), - headers: options.headers - }) + // { secs, nsecs } + if (input.secs != null) { + mtime = { + secs: input.secs, + nsecs: input.nsecs + } + } - /** @type {{ Addrs: Record }} */ - const { Addrs } = await res.json() + // UnixFS TimeSpec + if (input.Seconds != null) { + mtime = { + secs: input.Seconds, + nsecs: input.FractionalNanoseconds + } + } - return Object.keys(Addrs).map(id => ({ - id: peerIdFromString(id), - addrs: (Addrs[id] || []).map(a => src_multiaddr(a)) - })) + // process.hrtime() + if (Array.isArray(input)) { + mtime = { + secs: input[0], + nsecs: input[1] + } } - return addrs -}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/swarm/connect.js + // Javascript Date + if (input instanceof Date) { + const ms = input.getTime() + const secs = Math.floor(ms / 1000) + mtime = { + secs: secs, + nsecs: (ms - (secs * 1000)) * 1000 + } + } + /* + TODO: https://github.com/ipfs/aegir/issues/487 -const createConnect = configure(api => { - /** - * @type {import('../types').SwarmAPI["connect"]} - */ - async function connect (addr, options = {}) { - const res = await api.post('swarm/connect', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: addr, - ...options - }), - headers: options.headers - }) - const { Strings } = await res.json() + // process.hrtime.bigint() + if (input instanceof BigInt) { + const secs = input / BigInt(1e9) + const nsecs = input - (secs * BigInt(1e9)) - return Strings || [] + mtime = { + secs: parseInt(secs.toString()), + nsecs: parseInt(nsecs.toString()) + } } - return connect -}) + */ -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/swarm/disconnect.js + if (!Object.prototype.hasOwnProperty.call(mtime, 'secs')) { + return undefined + } + if (mtime != null && mtime.nsecs != null && (mtime.nsecs < 0 || mtime.nsecs > 999999999)) { + throw err_code(new Error('mtime-nsecs must be within the range [0,999999999]'), 'ERR_INVALID_MTIME_NSECS') + } + return mtime +} -const createDisconnect = configure(api => { +class UnixFS { /** - * @type {import('../types').SwarmAPI["disconnect"]} + * Decode from protobuf https://github.com/ipfs/specs/blob/master/UNIXFS.md + * + * @param {Uint8Array} marshaled */ - async function disconnect (addr, options = {}) { - const res = await api.post('swarm/disconnect', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: addr, - ...options - }), - headers: options.headers + static unmarshal (marshaled) { + const message = PBData.decode(marshaled) + const decoded = PBData.toObject(message, { + defaults: false, + arrays: true, + longs: Number, + objects: false }) - const { Strings } = await res.json() - - return Strings || [] - } - return disconnect -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/swarm/local-addrs.js + const data = new UnixFS({ + type: types[decoded.Type], + data: decoded.Data, + blockSizes: decoded.blocksizes, + mode: decoded.mode, + mtime: decoded.mtime + ? { + secs: decoded.mtime.Seconds, + nsecs: decoded.mtime.FractionalNanoseconds + } + : undefined + }) + // make sure we honour the original mode + data._originalMode = decoded.mode || 0 + return data + } -const createLocalAddrs = configure(api => { /** - * @type {import('../types.js').SwarmAPI["localAddrs"]} + * @param {object} [options] + * @param {string} [options.type='file'] + * @param {Uint8Array} [options.data] + * @param {number[]} [options.blockSizes] + * @param {number} [options.hashType] + * @param {number} [options.fanout] + * @param {MtimeLike | null} [options.mtime] + * @param {number | string} [options.mode] */ - async function localAddrs (options = {}) { - const res = await api.post('swarm/addrs/local', { - signal: options.signal, - searchParams: toUrlSearchParams(options), - headers: options.headers - }) - - /** @type {{ Strings: string[] }} */ - const { Strings } = await res.json() - - return (Strings || []).map(a => src_multiaddr(a)) - } - return localAddrs -}) + constructor (options = { + type: 'file' + }) { + const { + type, + data, + blockSizes, + hashType, + fanout, + mtime, + mode + } = options -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/swarm/peers.js + if (type && !types.includes(type)) { + throw errcode(new Error('Type: ' + type + ' is not valid'), 'ERR_INVALID_TYPE') + } + this.type = type || 'file' + this.data = data + this.hashType = hashType + this.fanout = fanout + /** @type {number[]} */ + this.blockSizes = blockSizes || [] + this._originalMode = 0 + this.mode = parseMode(mode) + if (mtime) { + this.mtime = src_parseMtime(mtime) + if (this.mtime && !this.mtime.nsecs) { + this.mtime.nsecs = 0 + } + } + } -const peers_createPeers = configure(api => { /** - * @type {import('../types').SwarmAPI["peers"]} + * @param {number | undefined} mode */ - async function peers (options = {}) { - const res = await api.post('swarm/peers', { - signal: options.signal, - searchParams: toUrlSearchParams(options), - headers: options.headers - }) + set mode (mode) { + this._mode = this.isDirectory() ? DEFAULT_DIRECTORY_MODE : DEFAULT_FILE_MODE - /** @type {{ Peers: { Peer: string, Addr: string, Muxer?: string, Latency?: string, Streams?: string[], Direction?: 0 | 1 }[] }} */ - const { Peers } = await res.json() + const parsedMode = parseMode(mode) - return (Peers || []).map(peer => { - return { - addr: src_multiaddr(peer.Addr), - peer: peerIdFromString(peer.Peer), - muxer: peer.Muxer, - latency: peer.Latency, - streams: peer.Streams, - // eslint-disable-next-line no-nested-ternary - direction: peer.Direction == null ? undefined : peer.Direction === 0 ? 'inbound' : 'outbound' - } - }) + if (parsedMode !== undefined) { + this._mode = parsedMode + } } - return peers -}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/swarm/index.js + /** + * @returns {number | undefined} + */ + get mode () { + return this._mode + } + isDirectory () { + return Boolean(this.type && dirTypes.includes(this.type)) + } + /** + * @param {number} size + */ + addBlockSize (size) { + this.blockSizes.push(size) + } + /** + * @param {number} index + */ + removeBlockSize (index) { + this.blockSizes.splice(index, 1) + } + /** + * Returns `0` for directories or `data.length + sum(blockSizes)` for everything else + */ + fileSize () { + if (this.isDirectory()) { + // dirs don't have file size + return 0 + } + let sum = 0 + this.blockSizes.forEach((size) => { + sum += size + }) -/** - * @param {import('../types').Options} config - * @returns {import('../types').IPFS['swarm']} - */ -function createSwarm (config) { - return { - addrs: createAddrs(config), - connect: createConnect(config), - disconnect: createDisconnect(config), - localAddrs: createLocalAddrs(config), - peers: peers_createPeers(config) + if (this.data) { + sum += this.data.length + } + + return sum } -} -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/add-all.js + /** + * encode to protobuf Uint8Array + */ + marshal () { + let type + switch (this.type) { + case 'raw': type = PBData.DataType.Raw; break + case 'directory': type = PBData.DataType.Directory; break + case 'file': type = PBData.DataType.File; break + case 'metadata': type = PBData.DataType.Metadata; break + case 'symlink': type = PBData.DataType.Symlink; break + case 'hamt-sharded-directory': type = PBData.DataType.HAMTShard; break + default: + throw errcode(new Error('Type: ' + type + ' is not valid'), 'ERR_INVALID_TYPE') + } + let data = this.data + if (!this.data || !this.data.length) { + data = undefined + } + let mode + if (this.mode != null) { + mode = (this._originalMode & 0xFFFFF000) | (parseMode(this.mode) || 0) + if (mode === DEFAULT_FILE_MODE && !this.isDirectory()) { + mode = undefined + } -const add_all_createAddAll = configure((api) => { - /** - * @type {import('./types.js').RootAPI["addAll"]} - */ - async function * addAll (source, options = {}) { - // allow aborting requests on body errors - const controller = new AbortController() - const signal = abortSignal(controller.signal, options.signal) - const { headers, body, total, parts } = - await multipart_request_multipartRequest(source, controller, options.headers) + if (mode === DEFAULT_DIRECTORY_MODE && this.isDirectory()) { + mode = undefined + } + } - // In browser response body only starts streaming once upload is - // complete, at which point all the progress updates are invalid. If - // length of the content is computable we can interpret progress from - // `{ total, loaded}` passed to `onUploadProgress` and `multipart.total` - // in which case we disable progress updates to be written out. - const [progressFn, onUploadProgress] = typeof options.progress === 'function' - ? createProgressHandler(total, parts, options.progress) - : [undefined, undefined] + let mtime - const res = await api.post('add', { - searchParams: toUrlSearchParams({ - 'stream-channels': true, - ...options, - progress: Boolean(progressFn) - }), - onUploadProgress, - signal, - headers, - body - }) + if (this.mtime != null) { + const parsed = src_parseMtime(this.mtime) - for await (let file of res.ndjson()) { - file = objectToCamel(file) + if (parsed) { + mtime = { + Seconds: parsed.secs, + FractionalNanoseconds: parsed.nsecs + } - if (file.hash !== undefined) { - yield add_all_toCoreInterface(file) - } else if (progressFn) { - progressFn(file.bytes || 0, file.name) + if (mtime.FractionalNanoseconds === 0) { + delete mtime.FractionalNanoseconds + } } } - } - return addAll -}) - -/** - * Returns simple progress callback when content length isn't computable or a - * progress event handler that calculates progress from upload progress events. - * - * @param {number} total - * @param {{name:string, start:number, end:number}[]|null} parts - * @param {import('./types.js').IPFSCoreAddProgressFn} progress - * @returns {[import('./types.js').IPFSCoreAddProgressFn|undefined, import('./types.js').IPFSUtilsHttpUploadProgressFn|undefined]} - */ -const createProgressHandler = (total, parts, progress) => - parts ? [undefined, createOnUploadProgress(total, parts, progress)] : [progress, undefined] -/** - * Creates a progress handler that interpolates progress from upload progress - * events and total size of the content that is added. - * - * @param {number} size - actual content size - * @param {{name:string, start:number, end:number}[]} parts - * @param {import('./types.js').IPFSCoreAddProgressFn} progress - * @returns {import('./types.js').IPFSUtilsHttpUploadProgressFn} - */ -const createOnUploadProgress = (size, parts, progress) => { - let index = 0 - const count = parts.length - return ({ loaded, total }) => { - // Derive position from the current progress. - const position = Math.floor(loaded / total * size) - while (index < count) { - const { start, end, name } = parts[index] - // If within current part range report progress and break the loop - if (position < end) { - progress(position - start, name) - break - // If passed current part range report final byte for the chunk and - // move to next one. - } else { - progress(end - start, name) - index += 1 - } + const pbData = { + Type: type, + Data: data, + filesize: this.isDirectory() ? undefined : this.fileSize(), + blocksizes: this.blockSizes, + hashType: this.hashType, + fanout: this.fanout, + mode, + mtime } - } -} -/** - * @param {object} input - * @param {string} input.name - * @param {string} input.hash - * @param {string} input.size - * @param {string} [input.mode] - * @param {number} [input.mtime] - * @param {number} [input.mtimeNsecs] - */ -function add_all_toCoreInterface ({ name, hash, size, mode, mtime, mtimeNsecs }) { - /** @type {import('./types.js').AddResult} */ - const output = { - path: name, - cid: node_modules_multiformats_src_cid_CID.parse(hash), - size: parseInt(size) + return PBData.encode(pbData).finish() } +} - if (mode != null) { - output.mode = parseInt(mode, 8) - } - if (mtime != null) { - output.mtime = { - secs: mtime, - nsecs: mtimeNsecs || 0 - } - } - return output -} +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/files/normalise-candidate-multiple.js -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/files/normalise-candidate-single.js @@ -238790,33 +162595,25 @@ function add_all_toCoreInterface ({ name, hash, size, mode, mtime, mtimeNsecs }) /** + * @typedef {import('ipfs-core-types/src/utils').ImportCandidate} ImportCandidate * @typedef {import('ipfs-core-types/src/utils').ToContent} ToContent * @typedef {import('ipfs-unixfs-importer').ImportCandidate} ImporterImportCandidate - * @typedef {import('ipfs-core-types/src/utils').ImportCandidate} ImportCandidate * @typedef {import('ipfs-core-types/src/utils').ImportCandidateStream} ImportCandidateStream */ /** - * @param {ImportCandidate} input + * @param {ImportCandidateStream} input * @param {(content:ToContent) => Promise>} normaliseContent */ // eslint-disable-next-line complexity -async function * normaliseCandidateSingle (input, normaliseContent) { - if (input === null || input === undefined) { - throw err_code(new Error(`Unexpected input: ${input}`), 'ERR_UNEXPECTED_INPUT') - } - +async function * normaliseCandidateMultiple (input, normaliseContent) { // String - if (typeof input === 'string' || input instanceof String) { - yield normalise_candidate_single_toFileObject(input.toString(), normaliseContent) - return - } - // Uint8Array|ArrayBuffer|TypedArray // Blob|File - if (isBytes(input) || isBlob(input)) { - yield normalise_candidate_single_toFileObject(input, normaliseContent) - return + // fs.ReadStream + // @ts-expect-error _readableState is a property of a node fs.ReadStream + if (typeof input === 'string' || input instanceof String || isBytes(input) || isBlob(input) || input._readableState) { + throw err_code(new Error('Unexpected input: single item passed - if you are using ipfs.addAll, please use ipfs.add instead'), 'ERR_UNEXPECTED_INPUT') } // Browser ReadableStream @@ -238827,13 +162624,11 @@ async function * normaliseCandidateSingle (input, normaliseContent) { // Iterable if (Symbol.iterator in input || Symbol.asyncIterator in input) { const peekable = peekableIterator(input) - - /** @type {any} value **/ const { value, done } = await peekable.peek() if (done) { // make sure empty iterators result in empty files - yield { content: [] } + yield * [] return } @@ -238841,31 +162636,49 @@ async function * normaliseCandidateSingle (input, normaliseContent) { // (Async)Iterable // (Async)Iterable - // (Async)Iterable - if (Number.isInteger(value) || isBytes(value) || typeof value === 'string' || value instanceof String) { - yield normalise_candidate_single_toFileObject(peekable, normaliseContent) + if (Number.isInteger(value)) { + throw err_code(new Error('Unexpected input: single item passed - if you are using ipfs.addAll, please use ipfs.add instead'), 'ERR_UNEXPECTED_INPUT') + } + + // (Async)Iterable + // @ts-expect-error private field + if (value._readableState) { + // @ts-expect-error Node fs.ReadStreams have a `.path` property so we need to pass it as the content + yield * map(peekable, (/** @type {ImportCandidate} */ value) => toFileObject({ content: value }, normaliseContent)) return } - throw err_code(new Error('Unexpected input: multiple items passed - if you are using ipfs.add, please use ipfs.addAll instead'), 'ERR_UNEXPECTED_INPUT') + if (isBytes(value)) { + // @ts-expect-error peekable is still an iterable of ImportCandidates + yield toFileObject({ content: peekable }, normaliseContent) + return + } + + // (Async)Iterable<(Async)Iterable> + // (Async)Iterable> + // ReadableStream<(Async)Iterable> + // ReadableStream> + if (isFileObject(value) || value[Symbol.iterator] || value[Symbol.asyncIterator] || isReadableStream(value) || isBlob(value)) { + yield * map(peekable, (/** @type {ImportCandidate} */ value) => toFileObject(value, normaliseContent)) + return + } } // { path, content: ? } // Note: Detected _after_ (Async)Iterable because Node.js fs.ReadStreams have a // `path` property that passes this check. if (isFileObject(input)) { - yield normalise_candidate_single_toFileObject(input, normaliseContent) - return + throw err_code(new Error('Unexpected input: single item passed - if you are using ipfs.addAll, please use ipfs.add instead'), 'ERR_UNEXPECTED_INPUT') } - throw err_code(new Error('Unexpected input: cannot convert "' + typeof input + '" into ImportCandidate'), 'ERR_UNEXPECTED_INPUT') + throw err_code(new Error('Unexpected input: ' + typeof input), 'ERR_UNEXPECTED_INPUT') } /** * @param {ImportCandidate} input * @param {(content:ToContent) => Promise>} normaliseContent */ -async function normalise_candidate_single_toFileObject (input, normaliseContent) { +async function toFileObject (input, normaliseContent) { // @ts-expect-error - Those properties don't exist on most input types const { path, mode, mtime, content } = input @@ -238886,16 +162699,16 @@ async function normalise_candidate_single_toFileObject (input, normaliseContent) return file } -;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/files/normalise-input-single.js +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/files/normalise-input-multiple.js /** - * @typedef {import('ipfs-core-types/src/utils').ImportCandidate} ImportCandidate + * @typedef {import('ipfs-core-types/src/utils').ImportCandidateStream} ImportCandidateStream */ /** - * Transforms any of the `ipfs.add` input types into + * Transforms any of the `ipfs.addAll` input types into * * ``` * AsyncIterable<{ path, mode, mtime, content: AsyncIterable }> @@ -238903,3567 +162716,4060 @@ async function normalise_candidate_single_toFileObject (input, normaliseContent) * * See https://github.com/ipfs/js-ipfs/blob/master/docs/core-api/FILES.md#ipfsadddata-options * - * @param {ImportCandidate} input + * @param {ImportCandidateStream} input */ -function normalise_input_single_normaliseInput (input) { - return normaliseCandidateSingle(input, normaliseContent) +function normaliseInput (input) { + return normaliseCandidateMultiple(input, normaliseContent) } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/add.js +;// CONCATENATED MODULE: ./node_modules/nanoid/url-alphabet/index.js +const urlAlphabet = + 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' + +;// CONCATENATED MODULE: ./node_modules/nanoid/index.js +const POOL_SIZE_MULTIPLIER = 128 +let pool, poolOffset +let fillPool = bytes => { + if (!pool || pool.length < bytes) { + pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER) + ;(0,external_crypto_.randomFillSync)(pool) + poolOffset = 0 + } else if (poolOffset + bytes > pool.length) { + (0,external_crypto_.randomFillSync)(pool) + poolOffset = 0 + } + poolOffset += bytes +} +let random = bytes => { + fillPool((bytes -= 0)) + return pool.subarray(poolOffset - bytes, poolOffset) +} +let customRandom = (alphabet, defaultSize, getRandom) => { + let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1 + let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length) + return (size = defaultSize) => { + let id = '' + while (true) { + let bytes = getRandom(step) + let i = step + while (i--) { + id += alphabet[bytes[i] & mask] || '' + if (id.length === size) return id + } + } + } +} +let customAlphabet = (alphabet, size = 21) => + customRandom(alphabet, size, random) +let nanoid = (size = 21) => { + fillPool((size -= 0)) + let id = '' + for (let i = poolOffset - size; i < poolOffset; i++) { + id += urlAlphabet[pool[i] & 63] + } + return id +} +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/mode-to-string.js /** - * @param {import('./types').Options} options + * @param {number | string | undefined} mode */ -function src_add_createAdd (options) { - const all = add_all_createAddAll(options) - return configure(() => { - /** - * @type {import('./types').RootAPI["add"]} - */ - async function add (input, options = {}) { - const source = normalise_input_single_normaliseInput(input) - // @ts-expect-error - all may return undefined if source is empty - const addAllPromise = all(source, options) - // @ts-expect-error - last may return undefined if source is empty - return await last(addAllPromise) +function mode_to_string_modeToString (mode) { + if (mode == null) { + return undefined + } + + if (typeof mode === 'string') { + return mode + } + + return mode.toString(8).padStart(4, '0') +} + +// EXTERNAL MODULE: ./node_modules/it-to-stream/src/index.js +var it_to_stream_src = __nccwpck_require__(3547); +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/node_modules/@libp2p/logger/dist/src/index.js + + + + +// Add a formatter for converting to a base58 string +debug_src.formatters.b = (v) => { + return v == null ? 'undefined' : ipfs_core_utils_node_modules_multiformats_src_bases_base58_base58btc.baseEncode(v); +}; +// Add a formatter for converting to a base32 string +debug_src.formatters.t = (v) => { + return v == null ? 'undefined' : ipfs_core_utils_node_modules_multiformats_src_bases_base32_base32.baseEncode(v); +}; +// Add a formatter for converting to a base64 string +debug_src.formatters.m = (v) => { + return v == null ? 'undefined' : node_modules_multiformats_src_bases_base64_base64.baseEncode(v); +}; +// Add a formatter for stringifying peer ids +debug_src.formatters.p = (v) => { + return v == null ? 'undefined' : v.toString(); +}; +// Add a formatter for stringifying CIDs +debug_src.formatters.c = (v) => { + return v == null ? 'undefined' : v.toString(); +}; +// Add a formatter for stringifying Datastore keys +debug_src.formatters.k = (v) => { + return v == null ? 'undefined' : v.toString(); +}; +// Add a formatter for stringifying Multiaddrs +debug_src.formatters.a = (v) => { + return v == null ? 'undefined' : v.toString(); +}; +function src_createDisabledLogger(namespace) { + const logger = () => { }; + logger.enabled = false; + logger.color = ''; + logger.diff = 0; + logger.log = () => { }; + logger.namespace = namespace; + logger.destroy = () => true; + logger.extend = () => logger; + return logger; +} +function src_logger(name) { + // trace logging is a no-op by default + let trace = src_createDisabledLogger(`${name}:trace`); + // look at all the debug names and see if trace logging has explicitly been enabled + if (debug_src.enabled(`${name}:trace`) && debug_src.names.map(r => r.toString()).find(n => n.includes(':trace')) != null) { + trace = debug_src(`${name}:trace`); } - return add - })(options) + return Object.assign(debug_src(name), { + error: debug_src(`${name}:error`), + trace + }); +} +function src_disable() { + debug.disable(); +} +function src_enable(namespaces) { + debug.enable(namespaces); +} +function src_enabled(namespaces) { + return debug.enabled(namespaces); } +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/multipart-request.node.js -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/cat.js -const createCat = configure(api => { - /** - * @type {import('./types').RootAPI["cat"]} - */ - async function * cat (path, options = {}) { - const res = await api.post('cat', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: path.toString(), - ...options - }), - headers: options.headers - }) +// @ts-expect-error no types - yield * res.iterator() - } - return cat -}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/commands.js +const multipart_request_node_merge = node_modules_merge_options.bind({ ignoreUndefined: true }) +const multipart_request_node_log = src_logger('ipfs:core-utils:multipart-request') +/** + * @typedef {import('ipfs-core-types/src/utils').ImportCandidateStream} ImportCandidateStream + */ -const createCommands = configure(api => { +/** + * @param {ImportCandidateStream} source + * @param {AbortController} abortController + * @param {Headers|Record} [headers] + * @param {string} [boundary] + */ +async function multipartRequest (source, abortController, headers = {}, boundary = `-----------------------------${nanoid()}`) { /** - * @type {import('./types').RootAPI["commands"]} + * @param {ImportCandidateStream} source */ - const commands = async (options = {}) => { - const res = await api.post('commands', { - signal: options.signal, - searchParams: toUrlSearchParams(options), - headers: options.headers - }) + async function * streamFiles (source) { + try { + let index = 0 - return res.json() - } - return commands -}) + // @ts-expect-error + for await (const { content, path, mode, mtime } of source) { + let fileSuffix = '' + const type = content ? 'file' : 'dir' -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dns.js + if (index > 0) { + yield '\r\n' + fileSuffix = `-${index}` + } + let fieldName = type + fileSuffix + const qs = [] -const createDns = configure(api => { - /** - * @type {import('./types').RootAPI["dns"]} - */ - const dns = async (domain, options = {}) => { - const res = await api.post('dns', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: domain, - ...options - }), - headers: options.headers - }) - const data = await res.json() + if (mode !== null && mode !== undefined) { + qs.push(`mode=${mode_to_string_modeToString(mode)}`) + } - return data.Path - } + if (mtime != null) { + const { secs, nsecs } = mtime - return dns -}) + qs.push(`mtime=${secs}`) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/get-endpoint-config.js + if (nsecs != null) { + qs.push(`mtime-nsecs=${nsecs}`) + } + } + if (qs.length) { + fieldName = `${fieldName}?${qs.join('&')}` + } -const createGetEndpointConfig = configure(api => { - return () => { - const url = new URL(api.opts.base || '') - return { - host: url.hostname, - port: url.port, - protocol: url.protocol, - pathname: url.pathname, - 'api-path': url.pathname + yield `--${boundary}\r\n` + yield `Content-Disposition: form-data; name="${fieldName}"; filename="${encodeURIComponent(path || '')}"\r\n` + yield `Content-Type: ${content ? 'application/octet-stream' : 'application/x-directory'}\r\n` + yield '\r\n' + + if (content) { + yield * content + } + + index++ + } + } catch (/** @type {any} */ err) { + multipart_request_node_log(err) + // workaround for https://github.com/node-fetch/node-fetch/issues/753 + abortController.abort() + } finally { + yield `\r\n--${boundary}--\r\n` } } -}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/get.js + // peek at the first value in order to get the input stream moving + // and to validate its contents. + // We cannot do this in the `for await..of` in streamFiles due to + // https://github.com/node-fetch/node-fetch/issues/753 + const peekable = peekableIterator(normaliseInput(source)) + + /** @type {any} value **/ + const { value, done } = await peekable.peek() + if (!done) { + peekable.push(value) + } + return { + parts: null, + total: -1, + headers: multipart_request_node_merge(headers, { + 'Content-Type': `multipart/form-data; boundary=${boundary}` + }), + // @ts-expect-error normaliseInput returns unixfs importer import candidates + body: it_to_stream_src(streamFiles(peekable)) + } +} +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/files/normalise-content.browser.js -const src_get_createGet = configure(api => { - /** - * @type {import('./types').RootAPI["get"]} - */ - async function * get (path, options = {}) { - /** @type {Record} */ - const opts = { - arg: `${path instanceof Uint8Array ? node_modules_multiformats_src_cid_CID.decode(path) : path}`, - ...options + + + + + +/** + * @param {import('ipfs-core-types/src/utils').ToContent} input + */ +async function normalise_content_browser_normaliseContent (input) { + // Bytes + if (isBytes(input)) { + return new Blob([input]) + } + + // String + if (typeof input === 'string' || input instanceof String) { + return new Blob([input.toString()]) + } + + // Blob | File + if (isBlob(input)) { + return input + } + + // Browser stream + if (isReadableStream(input)) { + input = browserReadableStreamToIt(input) + } + + // (Async)Iterator + if (Symbol.iterator in input || Symbol.asyncIterator in input) { + /** @type {any} peekable */ + const peekable = peekableIterator(input) + + /** @type {any} value **/ + const { value, done } = await peekable.peek() + + if (done) { + // make sure empty iterators result in empty files + return itToBlob(peekable) } - if (opts.compressionLevel) { - opts['compression-level'] = opts.compressionLevel - delete opts.compressionLevel + peekable.push(value) + + // (Async)Iterable + if (Number.isInteger(value)) { + return new Blob([Uint8Array.from(await src_all(peekable))]) } - const res = await api.post('get', { - signal: options.signal, - searchParams: toUrlSearchParams(opts), - headers: options.headers - }) + // (Async)Iterable + if (isBytes(value) || typeof value === 'string' || value instanceof String) { + return itToBlob(peekable) + } + } - yield * res.iterator() + throw err_code(new Error(`Unexpected input: ${input}`), 'ERR_UNEXPECTED_INPUT') +} + +/** + * @param {AsyncIterable|Iterable} stream + */ +async function itToBlob (stream) { + const parts = [] + + for await (const chunk of stream) { + parts.push(chunk) } - return get -}) + return new Blob(parts) +} -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/id.js +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/files/normalise-input-multiple.browser.js +/** + * @typedef {import('ipfs-core-types/src/utils').ImportCandidateStream} ImportCandidateStream + * @typedef {import('ipfs-core-types/src/utils').BrowserImportCandidate} BrowserImportCandidate + */ +/** + * Transforms any of the `ipfs.addAll` input types into + * + * ``` + * AsyncIterable<{ path, mode, mtime, content: Blob }> + * ``` + * + * See https://github.com/ipfs/js-ipfs/blob/master/docs/core-api/FILES.md#ipfsadddata-options + * + * @param {ImportCandidateStream} input + * @returns {AsyncGenerator} + */ +function normalise_input_multiple_browser_normaliseInput (input) { + // @ts-expect-error browser normaliseContent returns a Blob not an AsyncIterable + return normaliseCandidateMultiple(input, normalise_content_browser_normaliseContent, true) +} +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/multipart-request.browser.js -const createId = configure(api => { - /** - * @type {import('./types').RootAPI["id"]} - */ - async function id (options = {}) { - const res = await api.post('id', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: options.peerId ? options.peerId.toString() : undefined, - ...options - }), - headers: options.headers - }) - const data = await res.json() +// Import browser version otherwise electron-renderer will end up with node +// version and fail. - const output = { - ...objectToCamel(data) + + +/** + * @typedef {import('ipfs-core-types/src/utils').ImportCandidateStream} ImportCandidateStream + */ + +/** + * @param {ImportCandidateStream} source + * @param {AbortController} abortController + * @param {Headers|Record} [headers] + */ +async function multipart_request_browser_multipartRequest (source, abortController, headers = {}) { + const parts = [] + const formData = new FormData() + let index = 0 + let total = 0 + + for await (const { content, path, mode, mtime } of normalise_input_multiple_browser_normaliseInput(source)) { + let fileSuffix = '' + const type = content ? 'file' : 'dir' + + if (index > 0) { + fileSuffix = `-${index}` } - output.id = peerIdFromString(output.id) + let fieldName = type + fileSuffix + const qs = [] - if (output.addresses) { - output.addresses = output.addresses.map((/** @type {string} */ ma) => src_multiaddr(ma)) + if (mode !== null && mode !== undefined) { + qs.push(`mode=${mode_to_string_modeToString(mode)}`) } - // @ts-expect-error server output is not typed - return output + if ((mtime) != null) { + const { secs, nsecs } = (mtime) + + qs.push(`mtime=${secs}`) + + if (nsecs != null) { + qs.push(`mtime-nsecs=${nsecs}`) + } + } + + if (qs.length) { + fieldName = `${fieldName}?${qs.join('&')}` + } + + if (content) { + formData.set(fieldName, content, path != null ? encodeURIComponent(path) : undefined) + const end = total + content.size + parts.push({ name: path, start: total, end }) + total = end + } else if (path != null) { + formData.set(fieldName, new File([''], encodeURIComponent(path), { type: 'application/x-directory' })) + } else { + throw new Error('path or content or both must be set') + } + + index++ } - return id -}) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/is-online.js + return { + total, + parts, + headers, + body: formData + } +} + +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/multipart-request.js + + + /** - * @param {import('./types').Options} options + * @typedef {import('ipfs-core-types/src/utils').ImportCandidateStream} ImportCandidateStream */ -const createIsOnline = options => { - const id = createId(options) - /** - * @type {import('./types').RootAPI["isOnline"]} - */ - async function isOnline (options = {}) { - const res = await id(options) +/** + * @param {ImportCandidateStream} source + * @param {AbortController} abortController + * @param {Headers|Record} [headers] + * @param {string} [boundary] + */ +async function multipart_request_multipartRequest (source, abortController, headers = {}, boundary = `-----------------------------${nanoid()}`) { + let req = multipartRequest - return Boolean(res && res.addresses && res.addresses.length) + // In electron-renderer we use native fetch and should encode body using native + // form data. + if (env.isElectronRenderer) { + // @ts-expect-error types are different + req = multipart_request_browser_multipartRequest } - return isOnline + + return req(source, abortController, headers, boundary) } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/ls.js +// EXTERNAL MODULE: ./node_modules/any-signal/index.js +var any_signal = __nccwpck_require__(14577); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/abort-signal.js +/** + * @param {any[]} signals + * @returns {AbortSignal[]} + */ +function abort_signal_filter (signals) { + return signals.filter(Boolean) +} +/** + * @param {...AbortSignal|undefined} signals + */ +function abortSignal (...signals) { + return (0,any_signal.anySignal)(abort_signal_filter(signals)) +} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/block/put.js -const src_ls_createLs = configure((api, opts) => { + + + + + +const createPut = configure((api, configOptions) => { /** - * @type {import('./types').RootAPI["ls"]} + * @type {import('../types').BlockAPI["put"]} + * @see https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-block-put */ - async function * ls (path, options = {}) { - const pathStr = `${path instanceof Uint8Array ? node_modules_multiformats_src_cid_CID.decode(path) : path}` + async function put (data, options = {}) { + // allow aborting requests on body errors + const controller = new AbortController() + const signal = abortSignal(controller.signal, options.signal) - /** - * @param {*} link - */ - async function mapLink (link) { - let hash = link.Hash + let res + try { + const response = await api.post('block/put', { + signal, + searchParams: toUrlSearchParams(options), + ...( + await multipart_request_multipartRequest([data], controller, options.headers) + ) + }) + res = await response.json() + } catch (/** @type {any} */ err) { + // Retry with "protobuf"/"cbor" format for go-ipfs + // TODO: remove when https://github.com/ipfs/go-cid/issues/75 resolved + if (options.format === 'dag-pb') { + return put(data, { ...options, format: 'protobuf' }) + } else if (options.format === 'dag-cbor') { + return put(data, { ...options, format: 'cbor' }) + } - if (hash.includes('/')) { - // the hash is a path, but we need the CID - const ipfsPath = hash.startsWith('/ipfs/') ? hash : `/ipfs/${hash}` - const stats = await files_stat_createStat(opts)(ipfsPath) + throw err + } - hash = stats.cid - } else { - hash = node_modules_multiformats_src_cid_CID.parse(hash) - } + return node_modules_multiformats_src_cid_CID.parse(res.Key) + } - /** @type {import('./types').IPFSEntry} */ - const entry = { - name: link.Name, - path: pathStr + (link.Name ? `/${link.Name}` : ''), - size: link.Size, - cid: hash, - type: typeOf(link) - } + return put +}) - if (link.Mode) { - entry.mode = parseInt(link.Mode, 8) - } +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/block/rm.js - if (link.Mtime !== undefined && link.Mtime !== null) { - entry.mtime = { - secs: link.Mtime - } - if (link.MtimeNsecs !== undefined && link.MtimeNsecs !== null) { - entry.mtime.nsecs = link.MtimeNsecs - } - } - return entry + +const createRm = configure(api => { + /** + * @type {import('../types').BlockAPI["rm"]} + */ + async function * rm (cid, options = {}) { + if (!Array.isArray(cid)) { + cid = [cid] } - const res = await api.post('ls', { + const res = await api.post('block/rm', { signal: options.signal, searchParams: toUrlSearchParams({ - arg: pathStr, + arg: cid.map(cid => cid.toString()), + 'stream-channels': true, ...options }), headers: options.headers }) - for await (let result of res.ndjson()) { - result = result.Objects - - if (!result) { - throw new Error('expected .Objects in results') - } - - result = result[0] - if (!result) { - throw new Error('expected one array in results.Objects') - } - - const links = result.Links - if (!Array.isArray(links)) { - throw new Error('expected one array in results.Objects[0].Links') - } - - if (!links.length) { - // no links, this is a file, yield a single result - yield mapLink(result) - - return - } - - yield * links.map(mapLink) + for await (const removed of res.ndjson()) { + yield rm_toCoreInterface(removed) } } - return ls + + return rm }) /** - * @param {any} link + * @param {*} removed */ -function typeOf (link) { - switch (link.Type) { - case 1: - case 5: - return 'dir' - case 2: - return 'file' - default: - return 'file' +function rm_toCoreInterface (removed) { + /** @type {import('../types').RmResult} */ + const out = { + cid: node_modules_multiformats_src_cid_CID.parse(removed.Hash) + } + + if (removed.Error) { + out.error = new Error(removed.Error) } + + return out } -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/mount.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/block/stat.js -const createMount = configure(api => { +const stat_createStat = configure(api => { /** - * @type {import('./types').RootAPI["mount"]} + * @type {import('../types').BlockAPI["stat"]} */ - async function mount (options = {}) { - const res = await api.post('dns', { + async function stat (cid, options = {}) { + const res = await api.post('block/stat', { signal: options.signal, - searchParams: toUrlSearchParams(options), + searchParams: toUrlSearchParams({ + arg: cid.toString(), + ...options + }), headers: options.headers }) + const data = await res.json() - return objectToCamel(await res.json()) + return { cid: node_modules_multiformats_src_cid_CID.parse(data.Key), size: data.Size } } - return mount + + return stat }) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/ping.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/block/index.js -const createPing = configure(api => { - /** - * @type {import('./types').RootAPI["ping"]} - */ - async function * ping (peerId, options = {}) { - const res = await api.post('ping', { - signal: options.signal, - searchParams: toUrlSearchParams({ - arg: `${peerId}`, - ...options - }), - headers: options.headers, - transform: objectToCamel - }) - yield * res.ndjson() +/** + * @param {import('../types').Options} config + */ +function createBlock (config) { + return { + get: createGet(config), + put: createPut(config), + rm: createRm(config), + stat: stat_createStat(config) } - return ping -}) +} -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/resolve.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/bootstrap/add.js -const src_resolve_createResolve = configure(api => { + +const createAdd = configure(api => { /** - * @type {import('./types').RootAPI["resolve"]} + * @type {import('../types').BootstrapAPI["add"]} */ - async function resolve (path, options = {}) { - const res = await api.post('resolve', { + async function add (addr, options = {}) { + const res = await api.post('bootstrap/add', { signal: options.signal, searchParams: toUrlSearchParams({ - arg: path, + arg: addr, ...options }), headers: options.headers }) - const { Path } = await res.json() - return Path - } - return resolve -}) - -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/start.js - + const { Peers } = await res.json() -const createStart = configure(api => { - /** - * @type {import('./types').RootAPI["start"]} - */ - const start = async (options = {}) => { - throw err_code(new Error('Not implemented'), 'ERR_NOT_IMPLEMENTED') + return { Peers: Peers.map((/** @type {string} */ ma) => src_multiaddr(ma)) } } - return start + return add }) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/stop.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/bootstrap/list.js -const createStop = configure(api => { + +const createList = configure(api => { /** - * @type {import('./types').RootAPI["stop"]} + * @type {import('../types').BootstrapAPI["list"]} */ - async function stop (options = {}) { - const res = await api.post('shutdown', { + async function list (options = {}) { + const res = await api.post('bootstrap/list', { signal: options.signal, searchParams: toUrlSearchParams(options), headers: options.headers }) - await res.text() + const { Peers } = await res.json() + + return { Peers: Peers.map((/** @type {string} */ ma) => src_multiaddr(ma)) } } - return stop + + return list }) -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/version.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/bootstrap/rm.js -const version_createVersion = configure(api => { +const rm_createRm = configure(api => { /** - * @type {import('./types').RootAPI["version"]} + * @type {import('../types').BootstrapAPI["rm"]} */ - async function version (options = {}) { - const res = await api.post('version', { + async function rm (addr, options = {}) { + const res = await api.post('bootstrap/rm', { signal: options.signal, - searchParams: toUrlSearchParams(options), + searchParams: toUrlSearchParams({ + arg: addr, + ...options + }), headers: options.headers }) - // @ts-expect-error server output is not typed - return { - ...objectToCamel(await res.json()), - 'ipfs-http-client': '1.0.0' - } + const { Peers } = await res.json() + + return { Peers: Peers.map((/** @type {string} */ ma) => src_multiaddr(ma)) } } - return version + return rm }) -// EXTERNAL MODULE: ./node_modules/ipfs-utils/src/files/glob-source.js -var glob_source = __nccwpck_require__(83447); -// EXTERNAL MODULE: ./node_modules/ipfs-utils/src/files/url-source.js -var url_source = __nccwpck_require__(6846); -;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/index.js -/* eslint-env browser */ +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/bootstrap/index.js +/** + * @param {import('../types').Options} config + */ +function createBootstrap (config) { + return { + add: createAdd(config), + list: createList(config), + rm: rm_createRm(config) + } +} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/config/profiles/apply.js +const createApply = configure(api => { + /** + * @type {import('../../types').ConfigProfilesAPI["apply"]} + */ + async function apply (profile, options = {}) { + const res = await api.post('config/profile/apply', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: profile, + ...options + }), + headers: options.headers + }) + const data = await res.json() + return { + original: data.OldCfg, updated: data.NewCfg + } + } + return apply +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/config/profiles/index.js +/** + * @param {import('../../types').Options} config + */ +function createProfiles (config) { + return { + apply: createApply(config) + } +} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/config/get.js +const get_createGet = configure(api => { + /** + * @type {import('../types.js').ConfigAPI["get"]} + */ + const get = async (key, options = {}) => { + if (!key) { + throw new Error('key argument is required') + } + const res = await api.post('config', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: key, + ...options + }), + headers: options.headers + }) + const data = await res.json() + return data.Value + } + return get +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/config/get-all.js +const createGetAll = configure(api => { + /** + * @type {import('../types.js').ConfigAPI["getAll"]} + */ + const getAll = async (options = {}) => { + const res = await api.post('config/show', { + signal: options.signal, + searchParams: toUrlSearchParams({ + ...options + }), + headers: options.headers + }) + const data = await res.json() + return data + } + return getAll +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/dist/src/util/as-uint8array.js +/** + * To guarantee Uint8Array semantics, convert nodejs Buffers + * into vanilla Uint8Arrays + */ +function dist_src_util_as_uint8array_asUint8Array(buf) { + if (globalThis.Buffer != null) { + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); + } + return buf; +} +//# sourceMappingURL=as-uint8array.js.map +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/vendor/base-x.js +// base-x encoding / decoding +// Copyright (c) 2018 base-x contributors +// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) +// Distributed under the MIT software license, see the accompanying +// file LICENSE or http://www.opensource.org/licenses/mit-license.php. +function node_modules_uint8arrays_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { + if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; + } + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') } + BASE_MAP[xc] = i; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up + var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up + function encode (source) { + if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } else if (Array.isArray(source)) { + source = Uint8Array.from(source); + } + if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') } + if (source.length === 0) { return '' } + // Skip & count leading zeroes. + var zeroes = 0; + var length = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } + // Allocate enough space in big-endian base58 representation. + var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; + var b58 = new Uint8Array(size); + // Process the bytes. + while (pbegin !== pend) { + var carry = source[pbegin]; + // Apply "b58 = b58 * 256 + ch". + var i = 0; + for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { + carry += (256 * b58[it1]) >>> 0; + b58[it1] = (carry % BASE) >>> 0; + carry = (carry / BASE) >>> 0; + } + if (carry !== 0) { throw new Error('Non-zero carry') } + length = i; + pbegin++; + } + // Skip leading zeroes in base58 result. + var it2 = size - length; + while (it2 !== size && b58[it2] === 0) { + it2++; + } + // Translate the result into a string. + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); } + return str + } + function decodeUnsafe (source) { + if (typeof source !== 'string') { throw new TypeError('Expected String') } + if (source.length === 0) { return new Uint8Array() } + var psz = 0; + // Skip leading spaces. + if (source[psz] === ' ') { return } + // Skip and count leading '1's. + var zeroes = 0; + var length = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; + } + // Allocate enough space in big-endian base256 representation. + var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. + var b256 = new Uint8Array(size); + // Process the characters. + while (source[psz]) { + // Decode character + var carry = BASE_MAP[source.charCodeAt(psz)]; + // Invalid character + if (carry === 255) { return } + var i = 0; + for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { + carry += (BASE * b256[it3]) >>> 0; + b256[it3] = (carry % 256) >>> 0; + carry = (carry / 256) >>> 0; + } + if (carry !== 0) { throw new Error('Non-zero carry') } + length = i; + psz++; + } + // Skip trailing spaces. + if (source[psz] === ' ') { return } + // Skip leading zeroes in b256. + var it4 = size - length; + while (it4 !== size && b256[it4] === 0) { + it4++; + } + var vch = new Uint8Array(zeroes + (size - it4)); + var j = zeroes; + while (it4 !== size) { + vch[j++] = b256[it4++]; + } + return vch + } + function decode (string) { + var buffer = decodeUnsafe(string); + if (buffer) { return buffer } + throw new Error(`Non-${name} character`) + } + return { + encode: encode, + decodeUnsafe: decodeUnsafe, + decode: decode + } +} +var node_modules_uint8arrays_node_modules_multiformats_vendor_base_x_src = node_modules_uint8arrays_node_modules_multiformats_vendor_base_x_base; +var node_modules_uint8arrays_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = node_modules_uint8arrays_node_modules_multiformats_vendor_base_x_src; +/* harmony default export */ const node_modules_uint8arrays_node_modules_multiformats_vendor_base_x = (node_modules_uint8arrays_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bytes.js +const node_modules_uint8arrays_node_modules_multiformats_src_bytes_empty = new Uint8Array(0) +/** + * @param {Uint8Array} d + */ +const node_modules_uint8arrays_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') +/** + * @param {string} hex + */ +const node_modules_uint8arrays_node_modules_multiformats_src_bytes_fromHex = hex => { + const hexes = hex.match(/../g) + return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : node_modules_uint8arrays_node_modules_multiformats_src_bytes_empty +} +/** + * @param {Uint8Array} aa + * @param {Uint8Array} bb + */ +const node_modules_uint8arrays_node_modules_multiformats_src_bytes_equals = (aa, bb) => { + if (aa === bb) return true + if (aa.byteLength !== bb.byteLength) { + return false + } + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false + } + } + return true +} +/** + * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o + * @returns {Uint8Array} + */ +const node_modules_uint8arrays_node_modules_multiformats_src_bytes_coerce = o => { + if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o + if (o instanceof ArrayBuffer) return new Uint8Array(o) + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) + } + throw new Error('Unknown type, must be binary type') +} +/** + * @param {any} o + * @returns {o is ArrayBuffer|ArrayBufferView} + */ +const node_modules_uint8arrays_node_modules_multiformats_src_bytes_isBinary = o => + o instanceof ArrayBuffer || ArrayBuffer.isView(o) +/** + * @param {string} str + * @returns {Uint8Array} + */ +const node_modules_uint8arrays_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) +/** + * @param {Uint8Array} b + * @returns {string} + */ +const node_modules_uint8arrays_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base.js +// Linter can't see that API is used in types. +// eslint-disable-next-line /** + * Class represents both BaseEncoder and MultibaseEncoder meaning it + * can be used to encode to multibase or base encode without multibase + * prefix. * - * @typedef {import('./types').Options} Options - * @typedef {import('./types').LoadBaseFn} LoadBaseFn - * @typedef {import('./types').LoadCodecFn} LoadCodecFn - * @typedef {import('./types').LoadHasherFn} LoadHasherFn - * @typedef {import('./types').IPLDOptions} IPLDOptions - * @typedef {import('./types').HTTPClientExtraOptions} HTTPClientExtraOptions - * @typedef {import('./types').EndpointConfig} EndpointConfig - * @typedef {import('./types').IPFSHTTPClient} IPFSHTTPClient + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseEncoder} + * @implements {API.BaseEncoder} */ +class uint8arrays_node_modules_multiformats_src_bases_base_Encoder { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(bytes:Uint8Array) => string} baseEncode + */ + constructor (name, prefix, baseEncode) { + this.name = name + this.prefix = prefix + this.baseEncode = baseEncode + } + + /** + * @param {Uint8Array} bytes + * @returns {API.Multibase} + */ + encode (bytes) { + if (bytes instanceof Uint8Array) { + return `${this.prefix}${this.baseEncode(bytes)}` + } else { + throw Error('Unknown type, must be binary type') + } + } +} /** - * @param {import('./types').Options} options + * @template {string} Prefix */ -function src_create (options = {}) { +/** + * Class represents both BaseDecoder and MultibaseDecoder so it could be used + * to decode multibases (with matching prefix) or just base decode strings + * with corresponding base encoding. + * + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseDecoder} + * @implements {API.UnibaseDecoder} + * @implements {API.BaseDecoder} + */ +class uint8arrays_node_modules_multiformats_src_bases_base_Decoder { /** - * @type {import('./types').BlockCodec} + * @param {Base} name + * @param {Prefix} prefix + * @param {(text:string) => Uint8Array} baseDecode */ - const id = { - name: identity_identity.name, - code: identity_identity.code, - encode: (id) => id, - decode: (id) => id + constructor (name, prefix, baseDecode) { + this.name = name + this.prefix = prefix + /* c8 ignore next 3 */ + if (prefix.codePointAt(0) === undefined) { + throw new Error('Invalid prefix character') + } + /** @private */ + this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0)) + this.baseDecode = baseDecode } - /** @type {import('./types').MultibaseCodec[]} */ - const multibaseCodecs = Object.values(bases); - - (options.ipld && options.ipld.bases ? options.ipld.bases : []).forEach(base => multibaseCodecs.push(base)) + /** + * @param {string} text + */ + decode (text) { + if (typeof text === 'string') { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`) + } + return this.baseDecode(text.slice(this.prefix.length)) + } else { + throw Error('Can only multibase decode strings') + } + } - const multibases = new Multibases({ - bases: multibaseCodecs, - loadBase: options.ipld && options.ipld.loadBase - }) + /** + * @template {string} OtherPrefix + * @param {API.UnibaseDecoder|ComposedDecoder} decoder + * @returns {ComposedDecoder} + */ + or (decoder) { + return uint8arrays_node_modules_multiformats_src_bases_base_or(this, decoder) + } +} - /** @type {import('./types').BlockCodec[]} */ - const blockCodecs = Object.values(codecs); +/** + * @template {string} Prefix + * @typedef {Record>} Decoders + */ - [src_namespaceObject, dag_cbor_src_namespaceObject, dag_json_src_namespaceObject, lib_namespaceObject, id].concat((options.ipld && options.ipld.codecs) || []).forEach(codec => blockCodecs.push(codec)) +/** + * @template {string} Prefix + * @implements {API.MultibaseDecoder} + * @implements {API.CombobaseDecoder} + */ +class uint8arrays_node_modules_multiformats_src_bases_base_ComposedDecoder { + /** + * @param {Decoders} decoders + */ + constructor (decoders) { + this.decoders = decoders + } - const multicodecs = new Multicodecs({ - codecs: blockCodecs, - loadCodec: options.ipld && options.ipld.loadCodec - }) + /** + * @template {string} OtherPrefix + * @param {API.UnibaseDecoder|ComposedDecoder} decoder + * @returns {ComposedDecoder} + */ + or (decoder) { + return uint8arrays_node_modules_multiformats_src_bases_base_or(this, decoder) + } - /** @type {import('./types').MultihashHasher[]} */ - const multihashHashers = Object.values(hashes); + /** + * @param {string} input + * @returns {Uint8Array} + */ + decode (input) { + const prefix = /** @type {Prefix} */ (input[0]) + const decoder = this.decoders[prefix] + if (decoder) { + return decoder.decode(input) + } else { + throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`) + } + } +} - (options.ipld && options.ipld.hashers ? options.ipld.hashers : []).forEach(hasher => multihashHashers.push(hasher)) +/** + * @template {string} L + * @template {string} R + * @param {API.UnibaseDecoder|API.CombobaseDecoder} left + * @param {API.UnibaseDecoder|API.CombobaseDecoder} right + * @returns {ComposedDecoder} + */ +const uint8arrays_node_modules_multiformats_src_bases_base_or = (left, right) => new uint8arrays_node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({ + ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }), + ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right }) +})) - const multihashes = new Multihashes({ - hashers: multihashHashers, - loadHasher: options.ipld && options.ipld.loadHasher - }) +/** + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseCodec} + * @implements {API.MultibaseEncoder} + * @implements {API.MultibaseDecoder} + * @implements {API.BaseCodec} + * @implements {API.BaseEncoder} + * @implements {API.BaseDecoder} + */ +class uint8arrays_node_modules_multiformats_src_bases_base_Codec { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(bytes:Uint8Array) => string} baseEncode + * @param {(text:string) => Uint8Array} baseDecode + */ + constructor (name, prefix, baseEncode, baseDecode) { + this.name = name + this.prefix = prefix + this.baseEncode = baseEncode + this.baseDecode = baseDecode + this.encoder = new uint8arrays_node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode) + this.decoder = new uint8arrays_node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode) + } - /** @type {IPFSHTTPClient} */ - const client = { - add: src_add_createAdd(options), - addAll: add_all_createAddAll(options), - bitswap: createBitswap(options), - block: createBlock(options), - bootstrap: createBootstrap(options), - cat: createCat(options), - commands: createCommands(options), - config: createConfig(options), - dag: createDag(multicodecs, options), - dht: createDht(options), - diag: createDiag(options), - dns: createDns(options), - files: createFiles(options), - get: src_get_createGet(options), - getEndpointConfig: createGetEndpointConfig(options), - id: createId(options), - isOnline: createIsOnline(options), - key: /** @type {import('./types').IPFS['key']} */(createKey(options)), - log: createLog(options), - ls: src_ls_createLs(options), - mount: createMount(options), - name: /** @type {import('./types').IPFS['name']} */(createName(options)), - object: createObject(multicodecs, options), - pin: /** @type {import('./types').IPFS['pin']} */(createPin(options)), - ping: createPing(options), - pubsub: pubsub_createPubsub(options), - refs: createRefs(options), - repo: createRepo(options), - resolve: src_resolve_createResolve(options), - start: createStart(options), - stats: createStats(options), - stop: createStop(options), - swarm: /** @type {import('./types').IPFS['swarm']} */(createSwarm(options)), - version: /** @type {import('./types').IPFS['version']} */(version_createVersion(options)), - bases: multibases, - codecs: multicodecs, - hashers: multihashes + /** + * @param {Uint8Array} input + */ + encode (input) { + return this.encoder.encode(input) } - return client + /** + * @param {string} input + */ + decode (input) { + return this.decoder.decode(input) + } } +/** + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {(bytes:Uint8Array) => string} options.encode + * @param {(input:string) => Uint8Array} options.decode + * @returns {Codec} + */ +const uint8arrays_node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) => + new uint8arrays_node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode) - - -const globSource = glob_source - -// EXTERNAL MODULE: ./node_modules/peer-id/src/index.js -var peer_id_src = __nccwpck_require__(65459); -;// CONCATENATED MODULE: ./node_modules/it-last/dist/src/index.js /** - * @packageDocumentation - * - * Return the last value from an (async)iterable. - * - * @example - * - * ```javascript - * import last from 'it-last' - * - * // This can also be an iterator, generator, etc - * const values = [0, 1, 2, 3, 4] - * - * const res = last(values) - * - * console.info(res) // 4 - * ``` - * - * Async sources must be awaited: - * - * ```javascript - * import last from 'it-last' - * - * const values = async function * () { - * yield * [0, 1, 2, 3, 4] - * } - * - * const res = await last(values()) - * - * console.info(res) // 4 - * ``` + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {string} options.alphabet + * @returns {Codec} */ -function src_isAsyncIterable(thing) { - return thing[Symbol.asyncIterator] != null; -} -function src_last(source) { - if (src_isAsyncIterable(source)) { - return (async () => { - let res; - for await (const entry of source) { - res = entry; - } - return res; - })(); - } - let res; - for (const entry of source) { - res = entry; - } - return res; +const uint8arrays_node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => { + const { encode, decode } = node_modules_uint8arrays_node_modules_multiformats_vendor_base_x(alphabet, name) + return uint8arrays_node_modules_multiformats_src_bases_base_from({ + prefix, + name, + encode, + /** + * @param {string} text + */ + decode: text => node_modules_uint8arrays_node_modules_multiformats_src_bytes_coerce(decode(text)) + }) } -/* harmony default export */ const dist_src = (src_last); -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: external "node:fs" -const external_node_fs_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs"); -;// CONCATENATED MODULE: external "node:path" -const external_node_path_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path"); -;// CONCATENATED MODULE: ./pinners/ipfs.js +/** + * @param {string} string + * @param {string} alphabet + * @param {number} bitsPerChar + * @param {string} name + * @returns {Uint8Array} + */ +const uint8arrays_node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { + // Build the character lookup table: + /** @type {Record} */ + const codes = {} + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i + } + // Count the padding bytes: + let end = string.length + while (string[end - 1] === '=') { + --end + } + // Allocate the output: + const out = new Uint8Array((end * bitsPerChar / 8) | 0) + // Parse the data: + let bits = 0 // Number of bits currently in the buffer + let buffer = 0 // Bits waiting to be written out, MSB first + let written = 0 // Next byte to write + for (let i = 0; i < end; ++i) { + // Read one character from the string: + const value = codes[string[i]] + if (value === undefined) { + throw new SyntaxError(`Non-${name} character`) + } + // Append the bits to the buffer: + buffer = (buffer << bitsPerChar) | value + bits += bitsPerChar -/* harmony default export */ const ipfs = ({ - name: "IPFS", - builder: async (options) => { - const { host, port, protocol, timeout, headers } = options; + // Write out some bits if the buffer has a byte's worth: + if (bits >= 8) { + bits -= 8 + out[written++] = 0xff & (buffer >> bits) + } + } - return src_create({ host, port, protocol, timeout, headers }); - }, - upload: async (api, options) => { -<<<<<<< HEAD - const { path: p, timeout, verbose, key } = options; + // Verify that we have received just enough bits: + if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) { + throw new SyntaxError('Unexpected end of data') + } - const pattern = external_node_fs_namespaceObject.lstatSync(p).isDirectory() ? `${external_node_path_namespaceObject.basename(p)}/**/*` : external_node_path_namespaceObject.basename(p); - const { cid } = await dist_src(api.addAll(globSource(external_node_path_namespaceObject.dirname(p), pattern), { pin: true, timeout })); -======= - const { path, pattern, pin, timeout, key, verbose } = options; - const { cid } = await last( - api.addAll(globSource(fsPath.dirname(path), pattern), { - pin, - timeout, - }) - ); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 + return out +} - if (!cid) throw new Error("Content hash is not found."); +/** + * @param {Uint8Array} data + * @param {string} alphabet + * @param {number} bitsPerChar + * @returns {string} + */ +const uint8arrays_node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => { + const pad = alphabet[alphabet.length - 1] === '=' + const mask = (1 << bitsPerChar) - 1 + let out = '' - let _key; - if (key) { - const keys = await api.key.list(); + let bits = 0 // Number of bits currently in the buffer + let buffer = 0 // Bits waiting to be written out, MSB first + for (let i = 0; i < data.length; ++i) { + // Slurp data into the buffer: + buffer = (buffer << 8) | data[i] + bits += 8 - _key = keys.find((k) => k.name === key); - if (!_key) { - _key = await api.key.gen(key, { - type: "rsa", - size: 2048, - }); + // Write out as much as we can: + while (bits > bitsPerChar) { + bits -= bitsPerChar + out += alphabet[mask & (buffer >> bits)] + } + } - if (verbose) console.log(`Created IPNS key ${JSON.stringify(_key)}`); - } + // Partial character: + if (bits) { + out += alphabet[mask & (buffer << (bitsPerChar - bits))] + } - await api.name.publish(cid, { key }); + // Add padding characters until we hit a byte boundary: + if (pad) { + while ((out.length * bitsPerChar) & 7) { + out += '=' } + } - return { - cid: cid.toString(), - ipfs: cid.toString(), - ipns: _key && peer_id_src.parse(_key.id).toB58String(), - }; - }, -}); - -// EXTERNAL MODULE: ./node_modules/@pinata/sdk/lib/pinata-sdk.js -var pinata_sdk = __nccwpck_require__(80590); -;// CONCATENATED MODULE: ./pinners/pinata.js + return out +} +/** + * RFC4648 Factory + * + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {string} options.alphabet + * @param {number} options.bitsPerChar + */ +const uint8arrays_node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { + return uint8arrays_node_modules_multiformats_src_bases_base_from({ + prefix, + name, + encode (input) { + return uint8arrays_node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar) + }, + decode (input) { + return uint8arrays_node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name) + } + }) +} -<<<<<<< HEAD -======= -/***/ }), +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base10.js -/***/ 76333: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const fs = __nccwpck_require__(57147); -const fsPath = __nccwpck_require__(71017); +const node_modules_multiformats_src_bases_base10_base10 = uint8arrays_node_modules_multiformats_src_bases_base_baseX({ + prefix: '9', + name: 'base10', + alphabet: '0123456789' +}) -module.exports = - ({ builder, upload }) => - async (options) => { - const api = await builder(options); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base16.js +// @ts-check - return { - upload: async (options) => { - const { path } = options; - if (!path) { - throw new Error("Path is empty"); - } - let source = path; - if (!fsPath.isAbsolute(source)) { - const dir = ( - process.env.GITHUB_WORKSPACE || process.cwd() - ).toString(); - source = fsPath.join(dir, source); - } - const pattern = fs.lstatSync(source).isDirectory() - ? `${fsPath.basename(source)}/**/*` - : fsPath.basename(source); +const node_modules_multiformats_src_bases_base16_base16 = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'f', + name: 'base16', + alphabet: '0123456789abcdef', + bitsPerChar: 4 +}) - return upload(api, { ...options, path: source, pattern }); - }, - }; - }; +const node_modules_multiformats_src_bases_base16_base16upper = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'F', + name: 'base16upper', + alphabet: '0123456789ABCDEF', + bitsPerChar: 4 +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base2.js +// @ts-check -/***/ }), -/***/ 95067: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const pinataSDK = __nccwpck_require__(44386); ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 +const node_modules_multiformats_src_bases_base2_base2 = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: '0', + name: 'base2', + alphabet: '01', + bitsPerChar: 1 +}) -let pinataOptions = { - pinataOptions: { - cidVersion: 0, - wrapWithDirectory: false, - }, -}; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base256emoji.js -/* harmony default export */ const pinata = ({ - name: "Pinata", - builder: async (options) => { - const { pinataKey, pinataSecret } = options; - if (!pinataKey) { - throw new Error("[pinata] Key is empty. (input `pinataKey`)"); - } - if (!pinataSecret) { - throw new Error("[pinata] Secret is empty. (input `pinataSecret`)"); - } +const node_modules_multiformats_src_bases_base256emoji_alphabet = Array.from('🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂') +const node_modules_multiformats_src_bases_base256emoji_alphabetBytesToChars = /** @type {string[]} */ (node_modules_multiformats_src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[i] = c; return p }, /** @type {string[]} */([]))) +const node_modules_multiformats_src_bases_base256emoji_alphabetCharsToBytes = /** @type {number[]} */ (node_modules_multiformats_src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[/** @type {number} */ (c.codePointAt(0))] = i; return p }, /** @type {number[]} */([]))) - return pinata_sdk(pinataKey, pinataSecret); - }, - upload: async (api, options) => { -<<<<<<< HEAD - const { path, pinataPinName, verbose } = options; +/** + * @param {Uint8Array} data + * @returns {string} + */ +function uint8arrays_node_modules_multiformats_src_bases_base256emoji_encode (data) { + return data.reduce((p, c) => { + p += node_modules_multiformats_src_bases_base256emoji_alphabetBytesToChars[c] + return p + }, '') +} - let source = path; - if (!external_node_path_namespaceObject.isAbsolute(source)) { - const dir = (process.env.GITHUB_WORKSPACE || process.cwd()).toString(); - source = external_node_path_namespaceObject.join(dir, source); +/** + * @param {string} str + * @returns {Uint8Array} + */ +function uint8arrays_node_modules_multiformats_src_bases_base256emoji_decode (str) { + const byts = [] + for (const char of str) { + const byt = node_modules_multiformats_src_bases_base256emoji_alphabetCharsToBytes[/** @type {number} */ (char.codePointAt(0))] + if (byt === undefined) { + throw new Error(`Non-base256emoji character: ${char}`) } + byts.push(byt) + } + return new Uint8Array(byts) +} - if (pinataPinName) { -======= - const { path, pinName, pinataPinName, verbose } = options; - const _pinName = pinName || pinataPinName; - if (_pinName) { ->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05 - pinataOptions = { - ...pinataOptions, - pinataMetadata: { - name: _pinName, - }, - }; - } +const node_modules_multiformats_src_bases_base256emoji_base256emoji = uint8arrays_node_modules_multiformats_src_bases_base_from({ + prefix: '🚀', + name: 'base256emoji', + encode: uint8arrays_node_modules_multiformats_src_bases_base256emoji_encode, + decode: uint8arrays_node_modules_multiformats_src_bases_base256emoji_decode +}) - return api.pinFromFS(path, pinataOptions).then((result) => { - if (verbose) { - console.log(result); - } +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base32.js - return { - cid: result.IpfsHash.toString(), - ipfs: result.IpfsHash.toString(), - }; - }); - }, -}); -;// CONCATENATED MODULE: ./pinners/infura.js +const node_modules_uint8arrays_node_modules_multiformats_src_bases_base32_base32 = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'b', + name: 'base32', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567', + bitsPerChar: 5 +}) +const node_modules_uint8arrays_node_modules_multiformats_src_bases_base32_base32upper = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'B', + name: 'base32upper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', + bitsPerChar: 5 +}) +const uint8arrays_node_modules_multiformats_src_bases_base32_base32pad = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'c', + name: 'base32pad', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', + bitsPerChar: 5 +}) +const uint8arrays_node_modules_multiformats_src_bases_base32_base32padupper = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'C', + name: 'base32padupper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', + bitsPerChar: 5 +}) +const uint8arrays_node_modules_multiformats_src_bases_base32_base32hex = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'v', + name: 'base32hex', + alphabet: '0123456789abcdefghijklmnopqrstuv', + bitsPerChar: 5 +}) -/* harmony default export */ const infura = ({ - name: "Infura", - builder: async (options) => { - const { infuraProjectId, infuraProjectSecret, headers, timeout } = options; - if (!infuraProjectId) { - throw new Error("[infura] ProjectId is empty"); - } +const uint8arrays_node_modules_multiformats_src_bases_base32_base32hexupper = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'V', + name: 'base32hexupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', + bitsPerChar: 5 +}) - if (!infuraProjectSecret) { - throw new Error("[infura] ProjectSecret is empty"); - } +const uint8arrays_node_modules_multiformats_src_bases_base32_base32hexpad = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 't', + name: 'base32hexpad', + alphabet: '0123456789abcdefghijklmnopqrstuv=', + bitsPerChar: 5 +}) - const token = Buffer.from( - `${infuraProjectId}:${infuraProjectSecret}` - ).toString("base64"); +const uint8arrays_node_modules_multiformats_src_bases_base32_base32hexpadupper = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'T', + name: 'base32hexpadupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', + bitsPerChar: 5 +}) - return src_create({ - host: "ipfs.infura.io", - port: "5001", - protocol: "https", - headers: { - ...headers, - authorization: `Basic ${token}`, - }, - timeout, - }); - }, - upload: async (api, options) => { - const { path: p, verbose } = options; - const pattern = external_node_fs_namespaceObject.lstatSync(p).isDirectory() - ? `${external_node_path_namespaceObject.basename(p)}/**/*` - : external_node_path_namespaceObject.basename(p); - const { cid } = await dist_src( - api.addAll(globSource(external_node_path_namespaceObject.dirname(p), pattern), { pin: true }) - ); +const uint8arrays_node_modules_multiformats_src_bases_base32_base32z = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'h', + name: 'base32z', + alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', + bitsPerChar: 5 +}) - if (!cid) throw new Error("Content hash is not found."); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base36.js - if (verbose) console.log(cid); - return { - cid: cid.toString(), - ipfs: cid.toString(), - }; - }, -}); +const node_modules_multiformats_src_bases_base36_base36 = uint8arrays_node_modules_multiformats_src_bases_base_baseX({ + prefix: 'k', + name: 'base36', + alphabet: '0123456789abcdefghijklmnopqrstuvwxyz' +}) -// EXTERNAL MODULE: ./node_modules/@aws-sdk/client-s3/dist-cjs/index.js -var dist_cjs = __nccwpck_require__(23371); -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/bind.js +const node_modules_multiformats_src_bases_base36_base36upper = uint8arrays_node_modules_multiformats_src_bases_base_baseX({ + prefix: 'K', + name: 'base36upper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base58.js -function bind(fn, thisArg) { - return function wrap() { - return fn.apply(thisArg, arguments); - }; -} -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/utils.js +const node_modules_uint8arrays_node_modules_multiformats_src_bases_base58_base58btc = uint8arrays_node_modules_multiformats_src_bases_base_baseX({ + name: 'base58btc', + prefix: 'z', + alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +}) +const uint8arrays_node_modules_multiformats_src_bases_base58_base58flickr = uint8arrays_node_modules_multiformats_src_bases_base_baseX({ + name: 'base58flickr', + prefix: 'Z', + alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base64.js +// @ts-check -// utils is a library of generic helper functions non-specific to axios -const {toString: utils_toString} = Object.prototype; -const {getPrototypeOf} = Object; +const uint8arrays_node_modules_multiformats_src_bases_base64_base64 = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'm', + name: 'base64', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + bitsPerChar: 6 +}) -const kindOf = (cache => thing => { - const str = utils_toString.call(thing); - return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); -})(Object.create(null)); +const uint8arrays_node_modules_multiformats_src_bases_base64_base64pad = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'M', + name: 'base64pad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', + bitsPerChar: 6 +}) -const kindOfTest = (type) => { - type = type.toLowerCase(); - return (thing) => kindOf(thing) === type -} +const uint8arrays_node_modules_multiformats_src_bases_base64_base64url = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'u', + name: 'base64url', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', + bitsPerChar: 6 +}) -const typeOfTest = type => thing => typeof thing === type; +const uint8arrays_node_modules_multiformats_src_bases_base64_base64urlpad = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'U', + name: 'base64urlpad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', + bitsPerChar: 6 +}) -/** - * Determine if a value is an Array - * - * @param {Object} val The value to test - * - * @returns {boolean} True if value is an Array, otherwise false - */ -const {isArray} = Array; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/base8.js +// @ts-check -/** - * Determine if a value is undefined - * - * @param {*} val The value to test - * - * @returns {boolean} True if the value is undefined, otherwise false - */ -const isUndefined = typeOfTest('undefined'); -/** - * Determine if a value is a Buffer - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Buffer, otherwise false - */ -function utils_isBuffer(val) { - return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) - && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); -} -/** - * Determine if a value is an ArrayBuffer - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is an ArrayBuffer, otherwise false - */ -const isArrayBuffer = kindOfTest('ArrayBuffer'); +const node_modules_multiformats_src_bases_base8_base8 = uint8arrays_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: '7', + name: 'base8', + alphabet: '01234567', + bitsPerChar: 3 +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/bases/identity.js +// @ts-check -/** - * Determine if a value is a view on an ArrayBuffer - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false - */ -function isArrayBufferView(val) { - let result; - if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { - result = ArrayBuffer.isView(val); - } else { - result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); - } - return result; -} -/** - * Determine if a value is a String - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a String, otherwise false - */ -const isString = typeOfTest('string'); -/** - * Determine if a value is a Function - * - * @param {*} val The value to test - * @returns {boolean} True if value is a Function, otherwise false - */ -const isFunction = typeOfTest('function'); -/** - * Determine if a value is a Number - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Number, otherwise false - */ -const isNumber = typeOfTest('number'); +const uint8arrays_node_modules_multiformats_src_bases_identity_identity = uint8arrays_node_modules_multiformats_src_bases_base_from({ + prefix: '\x00', + name: 'identity', + encode: (buf) => node_modules_uint8arrays_node_modules_multiformats_src_bytes_toString(buf), + decode: (str) => node_modules_uint8arrays_node_modules_multiformats_src_bytes_fromString(str) +}) -/** - * Determine if a value is an Object - * - * @param {*} thing The value to test - * - * @returns {boolean} True if value is an Object, otherwise false - */ -const isObject = (thing) => thing !== null && typeof thing === 'object'; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/codecs/json.js +// @ts-check /** - * Determine if a value is a Boolean - * - * @param {*} thing The value to test - * @returns {boolean} True if value is a Boolean, otherwise false + * @template T + * @typedef {import('./interface.js').ByteView} ByteView */ -const isBoolean = thing => thing === true || thing === false; -/** - * Determine if a value is a plain Object - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a plain Object, otherwise false - */ -const isPlainObject = (val) => { - if (kindOf(val) !== 'object') { - return false; - } +const uint8arrays_node_modules_multiformats_src_codecs_json_textEncoder = new TextEncoder() +const uint8arrays_node_modules_multiformats_src_codecs_json_textDecoder = new TextDecoder() - const prototype = getPrototypeOf(val); - return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); -} +const uint8arrays_node_modules_multiformats_src_codecs_json_name = 'json' +const uint8arrays_node_modules_multiformats_src_codecs_json_code = 0x0200 /** - * Determine if a value is a Date - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Date, otherwise false + * @template T + * @param {T} node + * @returns {ByteView} */ -const isDate = kindOfTest('Date'); +const uint8arrays_node_modules_multiformats_src_codecs_json_encode = (node) => uint8arrays_node_modules_multiformats_src_codecs_json_textEncoder.encode(JSON.stringify(node)) /** - * Determine if a value is a File - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a File, otherwise false + * @template T + * @param {ByteView} data + * @returns {T} */ -const isFile = kindOfTest('File'); +const uint8arrays_node_modules_multiformats_src_codecs_json_decode = (data) => JSON.parse(uint8arrays_node_modules_multiformats_src_codecs_json_textDecoder.decode(data)) -/** - * Determine if a value is a Blob - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Blob, otherwise false - */ -const utils_isBlob = kindOfTest('Blob'); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/codecs/raw.js +// @ts-check -/** - * Determine if a value is a FileList - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a File, otherwise false - */ -const isFileList = kindOfTest('FileList'); -/** - * Determine if a value is a Stream - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Stream, otherwise false - */ -const isStream = (val) => isObject(val) && isFunction(val.pipe); /** - * Determine if a value is a FormData - * - * @param {*} thing The value to test - * - * @returns {boolean} True if value is an FormData, otherwise false + * @template T + * @typedef {import('./interface.js').ByteView} ByteView */ -const isFormData = (thing) => { - let kind; - return thing && ( - (typeof FormData === 'function' && thing instanceof FormData) || ( - isFunction(thing.append) && ( - (kind = kindOf(thing)) === 'formdata' || - // detect form-data instance - (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]') - ) - ) - ) -} -/** - * Determine if a value is a URLSearchParams object - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a URLSearchParams object, otherwise false - */ -const isURLSearchParams = kindOfTest('URLSearchParams'); +const uint8arrays_node_modules_multiformats_src_codecs_raw_name = 'raw' +const uint8arrays_node_modules_multiformats_src_codecs_raw_code = 0x55 /** - * Trim excess whitespace off the beginning and end of a string - * - * @param {String} str The String to trim - * - * @returns {String} The String freed of excess whitespace + * @param {Uint8Array} node + * @returns {ByteView} */ -const trim = (str) => str.trim ? - str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); +const uint8arrays_node_modules_multiformats_src_codecs_raw_encode = (node) => node_modules_uint8arrays_node_modules_multiformats_src_bytes_coerce(node) /** - * Iterate over an Array or an Object invoking a function for each item. - * - * If `obj` is an Array callback will be called passing - * the value, index, and complete array for each item. - * - * If 'obj' is an Object callback will be called passing - * the value, key, and complete object for each property. - * - * @param {Object|Array} obj The object to iterate - * @param {Function} fn The callback to invoke for each item - * - * @param {Boolean} [allOwnKeys = false] - * @returns {any} + * @param {ByteView} data + * @returns {Uint8Array} */ -function forEach(obj, fn, {allOwnKeys = false} = {}) { - // Don't bother if no value provided - if (obj === null || typeof obj === 'undefined') { - return; - } +const uint8arrays_node_modules_multiformats_src_codecs_raw_decode = (data) => node_modules_uint8arrays_node_modules_multiformats_src_bytes_coerce(data) - let i; - let l; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/vendor/varint.js +var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_encode_1 = node_modules_uint8arrays_node_modules_multiformats_vendor_varint_encode; - // Force an array if not already something iterable - if (typeof obj !== 'object') { - /*eslint no-param-reassign:0*/ - obj = [obj]; - } +var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_MSB = 0x80 + , node_modules_uint8arrays_node_modules_multiformats_vendor_varint_REST = 0x7F + , node_modules_uint8arrays_node_modules_multiformats_vendor_varint_MSBALL = ~node_modules_uint8arrays_node_modules_multiformats_vendor_varint_REST + , node_modules_uint8arrays_node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31); - if (isArray(obj)) { - // Iterate over array values - for (i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - // Iterate over object keys - const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); - const len = keys.length; - let key; +function node_modules_uint8arrays_node_modules_multiformats_vendor_varint_encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; - for (i = 0; i < len; i++) { - key = keys[i]; - fn.call(null, obj[key], key, obj); - } + while(num >= node_modules_uint8arrays_node_modules_multiformats_vendor_varint_INT) { + out[offset++] = (num & 0xFF) | node_modules_uint8arrays_node_modules_multiformats_vendor_varint_MSB; + num /= 128; } -} - -function findKey(obj, key) { - key = key.toLowerCase(); - const keys = Object.keys(obj); - let i = keys.length; - let _key; - while (i-- > 0) { - _key = keys[i]; - if (key === _key.toLowerCase()) { - return _key; - } + while(num & node_modules_uint8arrays_node_modules_multiformats_vendor_varint_MSBALL) { + out[offset++] = (num & 0xFF) | node_modules_uint8arrays_node_modules_multiformats_vendor_varint_MSB; + num >>>= 7; } - return null; + out[offset] = num | 0; + + node_modules_uint8arrays_node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; + + return out } -const _global = (() => { - /*eslint no-undef:0*/ - if (typeof globalThis !== "undefined") return globalThis; - return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global) -})(); - -const isContextDefined = (context) => !isUndefined(context) && context !== _global; +var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_decode = node_modules_uint8arrays_node_modules_multiformats_vendor_varint_read; -/** - * Accepts varargs expecting each argument to be an object, then - * immutably merges the properties of each object and returns result. - * - * When multiple objects contain the same key the later object in - * the arguments list will take precedence. - * - * Example: - * - * ```js - * var result = merge({foo: 123}, {foo: 456}); - * console.log(result.foo); // outputs 456 - * ``` - * - * @param {Object} obj1 Object to merge - * - * @returns {Object} Result of all merge properties - */ -function utils_merge(/* obj1, obj2, obj3, ... */) { - const {caseless} = isContextDefined(this) && this || {}; - const result = {}; - const assignValue = (val, key) => { - const targetKey = caseless && findKey(result, key) || key; - if (isPlainObject(result[targetKey]) && isPlainObject(val)) { - result[targetKey] = utils_merge(result[targetKey], val); - } else if (isPlainObject(val)) { - result[targetKey] = utils_merge({}, val); - } else if (isArray(val)) { - result[targetKey] = val.slice(); - } else { - result[targetKey] = val; - } - } +var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_MSB$1 = 0x80 + , node_modules_uint8arrays_node_modules_multiformats_vendor_varint_REST$1 = 0x7F; - for (let i = 0, l = arguments.length; i < l; i++) { - arguments[i] && forEach(arguments[i], assignValue); - } - return result; -} +function node_modules_uint8arrays_node_modules_multiformats_vendor_varint_read(buf, offset) { + var res = 0 + , offset = offset || 0 + , shift = 0 + , counter = offset + , b + , l = buf.length; -/** - * Extends object a by mutably adding to it the properties of object b. - * - * @param {Object} a The object to be extended - * @param {Object} b The object to copy properties from - * @param {Object} thisArg The object to bind function to - * - * @param {Boolean} [allOwnKeys] - * @returns {Object} The resulting value of object a - */ -const extend = (a, b, thisArg, {allOwnKeys}= {}) => { - forEach(b, (val, key) => { - if (thisArg && isFunction(val)) { - a[key] = bind(val, thisArg); - } else { - a[key] = val; + do { + if (counter >= l) { + node_modules_uint8arrays_node_modules_multiformats_vendor_varint_read.bytes = 0; + throw new RangeError('Could not decode varint') } - }, {allOwnKeys}); - return a; -} + b = buf[counter++]; + res += shift < 28 + ? (b & node_modules_uint8arrays_node_modules_multiformats_vendor_varint_REST$1) << shift + : (b & node_modules_uint8arrays_node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= node_modules_uint8arrays_node_modules_multiformats_vendor_varint_MSB$1) -/** - * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) - * - * @param {string} content with BOM - * - * @returns {string} content value without BOM - */ -const stripBOM = (content) => { - if (content.charCodeAt(0) === 0xFEFF) { - content = content.slice(1); - } - return content; -} + node_modules_uint8arrays_node_modules_multiformats_vendor_varint_read.bytes = counter - offset; -/** - * Inherit the prototype methods from one constructor into another - * @param {function} constructor - * @param {function} superConstructor - * @param {object} [props] - * @param {object} [descriptors] - * - * @returns {void} - */ -const inherits = (constructor, superConstructor, props, descriptors) => { - constructor.prototype = Object.create(superConstructor.prototype, descriptors); - constructor.prototype.constructor = constructor; - Object.defineProperty(constructor, 'super', { - value: superConstructor.prototype - }); - props && Object.assign(constructor.prototype, props); + return res } -/** - * Resolve object with deep prototype chain to a flat object - * @param {Object} sourceObj source object - * @param {Object} [destObj] - * @param {Function|Boolean} [filter] - * @param {Function} [propFilter] - * - * @returns {Object} - */ -const toFlatObject = (sourceObj, destObj, filter, propFilter) => { - let props; - let i; - let prop; - const merged = {}; +var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N1 = Math.pow(2, 7); +var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14); +var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21); +var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28); +var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35); +var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42); +var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49); +var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56); +var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63); - destObj = destObj || {}; - // eslint-disable-next-line no-eq-null,eqeqeq - if (sourceObj == null) return destObj; +var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_length = function (value) { + return ( + value < node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N1 ? 1 + : value < node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N2 ? 2 + : value < node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N3 ? 3 + : value < node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N4 ? 4 + : value < node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N5 ? 5 + : value < node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N6 ? 6 + : value < node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N7 ? 7 + : value < node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N8 ? 8 + : value < node_modules_uint8arrays_node_modules_multiformats_vendor_varint_N9 ? 9 + : 10 + ) +}; - do { - props = Object.getOwnPropertyNames(sourceObj); - i = props.length; - while (i-- > 0) { - prop = props[i]; - if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { - destObj[prop] = sourceObj[prop]; - merged[prop] = true; - } - } - sourceObj = filter !== false && getPrototypeOf(sourceObj); - } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); +var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_varint = { + encode: node_modules_uint8arrays_node_modules_multiformats_vendor_varint_encode_1 + , decode: node_modules_uint8arrays_node_modules_multiformats_vendor_varint_decode + , encodingLength: node_modules_uint8arrays_node_modules_multiformats_vendor_varint_length +}; - return destObj; -} +var node_modules_uint8arrays_node_modules_multiformats_vendor_varint_brrp_varint = node_modules_uint8arrays_node_modules_multiformats_vendor_varint_varint; -/** - * Determines whether a string ends with the characters of a specified string - * - * @param {String} str - * @param {String} searchString - * @param {Number} [position= 0] - * - * @returns {boolean} - */ -const endsWith = (str, searchString, position) => { - str = String(str); - if (position === undefined || position > str.length) { - position = str.length; - } - position -= searchString.length; - const lastIndex = str.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; -} +/* harmony default export */ const node_modules_uint8arrays_node_modules_multiformats_vendor_varint = (node_modules_uint8arrays_node_modules_multiformats_vendor_varint_brrp_varint); + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/varint.js /** - * Returns new array from array like object or null if failed - * - * @param {*} [thing] - * - * @returns {?Array} + * @param {Uint8Array} data + * @param {number} [offset=0] + * @returns {[number, number]} */ -const toArray = (thing) => { - if (!thing) return null; - if (isArray(thing)) return thing; - let i = thing.length; - if (!isNumber(i)) return null; - const arr = new Array(i); - while (i-- > 0) { - arr[i] = thing[i]; - } - return arr; +const node_modules_uint8arrays_node_modules_multiformats_src_varint_decode = (data, offset = 0) => { + const code = varint.decode(data, offset) + return [code, varint.decode.bytes] } /** - * Checking if the Uint8Array exists and if it does, it returns a function that checks if the - * thing passed in is an instance of Uint8Array - * - * @param {TypedArray} - * - * @returns {Array} + * @param {number} int + * @param {Uint8Array} target + * @param {number} [offset=0] */ -// eslint-disable-next-line func-names -const isTypedArray = (TypedArray => { - // eslint-disable-next-line func-names - return thing => { - return TypedArray && thing instanceof TypedArray; - }; -})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); +const node_modules_uint8arrays_node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => { + node_modules_uint8arrays_node_modules_multiformats_vendor_varint.encode(int, target, offset) + return target +} /** - * For each entry in the object, call the function with the key and value. - * - * @param {Object} obj - The object to iterate over. - * @param {Function} fn - The function to call for each entry. - * - * @returns {void} + * @param {number} int + * @returns {number} */ -const forEachEntry = (obj, fn) => { - const generator = obj && obj[Symbol.iterator]; +const node_modules_uint8arrays_node_modules_multiformats_src_varint_encodingLength = (int) => { + return node_modules_uint8arrays_node_modules_multiformats_vendor_varint.encodingLength(int) +} - const iterator = generator.call(obj); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/hashes/digest.js - let result; - while ((result = iterator.next()) && !result.done) { - const pair = result.value; - fn.call(obj, pair[0], pair[1]); - } -} /** - * It takes a regular expression and a string, and returns an array of all the matches - * - * @param {string} regExp - The regular expression to match against. - * @param {string} str - The string to search. + * Creates a multihash digest. * - * @returns {Array} + * @template {number} Code + * @param {Code} code + * @param {Uint8Array} digest */ -const matchAll = (regExp, str) => { - let matches; - const arr = []; +const node_modules_uint8arrays_node_modules_multiformats_src_hashes_digest_create = (code, digest) => { + const size = digest.byteLength + const sizeOffset = node_modules_uint8arrays_node_modules_multiformats_src_varint_encodingLength(code) + const digestOffset = sizeOffset + node_modules_uint8arrays_node_modules_multiformats_src_varint_encodingLength(size) - while ((matches = regExp.exec(str)) !== null) { - arr.push(matches); - } + const bytes = new Uint8Array(digestOffset + size) + node_modules_uint8arrays_node_modules_multiformats_src_varint_encodeTo(code, bytes, 0) + node_modules_uint8arrays_node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset) + bytes.set(digest, digestOffset) - return arr; + return new node_modules_uint8arrays_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) } -/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ -const isHTMLForm = kindOfTest('HTMLFormElement'); - -const toCamelCase = str => { - return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, - function replacer(m, p1, p2) { - return p1.toUpperCase() + p2; - } - ); -}; - -/* Creating a function that will check if an object has a property. */ -const utils_hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); - /** - * Determine if a value is a RegExp object - * - * @param {*} val The value to test + * Turns bytes representation of multihash digest into an instance. * - * @returns {boolean} True if value is a RegExp object, otherwise false + * @param {Uint8Array} multihash + * @returns {MultihashDigest} */ -const isRegExp = kindOfTest('RegExp'); - -const reduceDescriptors = (obj, reducer) => { - const descriptors = Object.getOwnPropertyDescriptors(obj); - const reducedDescriptors = {}; +const node_modules_uint8arrays_node_modules_multiformats_src_hashes_digest_decode = (multihash) => { + const bytes = coerce(multihash) + const [code, sizeOffset] = varint.decode(bytes) + const [size, digestOffset] = varint.decode(bytes.subarray(sizeOffset)) + const digest = bytes.subarray(sizeOffset + digestOffset) - forEach(descriptors, (descriptor, name) => { - let ret; - if ((ret = reducer(descriptor, name, obj)) !== false) { - reducedDescriptors[name] = ret || descriptor; - } - }); + if (digest.byteLength !== size) { + throw new Error('Incorrect length') + } - Object.defineProperties(obj, reducedDescriptors); + return new node_modules_uint8arrays_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) } /** - * Makes all methods read-only - * @param {Object} obj + * @param {MultihashDigest} a + * @param {unknown} b + * @returns {b is MultihashDigest} */ +const node_modules_uint8arrays_node_modules_multiformats_src_hashes_digest_equals = (a, b) => { + if (a === b) { + return true + } else { + const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) -const freezeMethods = (obj) => { - reduceDescriptors(obj, (descriptor, name) => { - // skip restricted props in strict mode - if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { - return false; - } - - const value = obj[name]; - - if (!isFunction(value)) return; - - descriptor.enumerable = false; - - if ('writable' in descriptor) { - descriptor.writable = false; - return; - } - - if (!descriptor.set) { - descriptor.set = () => { - throw Error('Can not rewrite read-only method \'' + name + '\''); - }; - } - }); -} - -const toObjectSet = (arrayOrString, delimiter) => { - const obj = {}; - - const define = (arr) => { - arr.forEach(value => { - obj[value] = true; - }); + return ( + a.code === data.code && + a.size === data.size && + data.bytes instanceof Uint8Array && + equalBytes(a.bytes, data.bytes) + ) } - - isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); - - return obj; -} - -const noop = () => {} - -const toFiniteNumber = (value, defaultValue) => { - value = +value; - return Number.isFinite(value) ? value : defaultValue; -} - -const ALPHA = 'abcdefghijklmnopqrstuvwxyz' - -const DIGIT = '0123456789'; - -const ALPHABET = { - DIGIT, - ALPHA, - ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT } -const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { - let str = ''; - const {length} = alphabet; - while (size--) { - str += alphabet[Math.random() * length|0] - } - - return str; -} +/** + * @typedef {import('./interface.js').MultihashDigest} MultihashDigest + */ /** - * If the thing is a FormData object, return true, otherwise return false. - * - * @param {unknown} thing - The thing to check. + * Represents a multihash digest which carries information about the + * hashing algorithm and an actual hash digest. * - * @returns {boolean} + * @template {number} Code + * @template {number} Size + * @class + * @implements {MultihashDigest} */ -function isSpecCompliantForm(thing) { - return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); +class node_modules_uint8arrays_node_modules_multiformats_src_hashes_digest_Digest { + /** + * Creates a multihash digest. + * + * @param {Code} code + * @param {Size} size + * @param {Uint8Array} digest + * @param {Uint8Array} bytes + */ + constructor (code, size, digest, bytes) { + this.code = code + this.size = size + this.digest = digest + this.bytes = bytes + } } -const toJSONObject = (obj) => { - const stack = new Array(10); - - const visit = (source, i) => { - - if (isObject(source)) { - if (stack.indexOf(source) >= 0) { - return; - } - - if(!('toJSON' in source)) { - stack[i] = source; - const target = isArray(source) ? [] : {}; - - forEach(source, (value, key) => { - const reducedValue = visit(value, i + 1); - !isUndefined(reducedValue) && (target[key] = reducedValue); - }); - - stack[i] = undefined; - - return target; - } - } - - return source; - } +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/hashes/identity.js - return visit(obj, 0); -} -const isAsyncFn = kindOfTest('AsyncFunction'); -const isThenable = (thing) => - thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); +const uint8arrays_node_modules_multiformats_src_hashes_identity_code = 0x0 +const uint8arrays_node_modules_multiformats_src_hashes_identity_name = 'identity' -/* harmony default export */ const utils = ({ - isArray, - isArrayBuffer, - isBuffer: utils_isBuffer, - isFormData, - isArrayBufferView, - isString, - isNumber, - isBoolean, - isObject, - isPlainObject, - isUndefined, - isDate, - isFile, - isBlob: utils_isBlob, - isRegExp, - isFunction, - isStream, - isURLSearchParams, - isTypedArray, - isFileList, - forEach, - merge: utils_merge, - extend, - trim, - stripBOM, - inherits, - toFlatObject, - kindOf, - kindOfTest, - endsWith, - toArray, - forEachEntry, - matchAll, - isHTMLForm, - hasOwnProperty: utils_hasOwnProperty, - hasOwnProp: utils_hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection - reduceDescriptors, - freezeMethods, - toObjectSet, - toCamelCase, - noop, - toFiniteNumber, - findKey, - global: _global, - isContextDefined, - ALPHABET, - generateString, - isSpecCompliantForm, - toJSONObject, - isAsyncFn, - isThenable -}); +/** @type {(input:Uint8Array) => Uint8Array} */ +const uint8arrays_node_modules_multiformats_src_hashes_identity_encode = node_modules_uint8arrays_node_modules_multiformats_src_bytes_coerce -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/core/AxiosError.js +/** + * @param {Uint8Array} input + * @returns {Digest.Digest} + */ +const node_modules_multiformats_src_hashes_identity_digest = (input) => node_modules_uint8arrays_node_modules_multiformats_src_hashes_digest_create(uint8arrays_node_modules_multiformats_src_hashes_identity_code, uint8arrays_node_modules_multiformats_src_hashes_identity_encode(input)) +const uint8arrays_node_modules_multiformats_src_hashes_identity_identity = { code: uint8arrays_node_modules_multiformats_src_hashes_identity_code, name: uint8arrays_node_modules_multiformats_src_hashes_identity_name, encode: uint8arrays_node_modules_multiformats_src_hashes_identity_encode, digest: node_modules_multiformats_src_hashes_identity_digest } +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/hashes/hasher.js /** - * Create an Error with the specified message, config, error code, request and response. - * - * @param {string} message The error message. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [config] The config. - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * - * @returns {Error} The created error. + * @template {string} Name + * @template {number} Code + * @param {object} options + * @param {Name} options.name + * @param {Code} options.code + * @param {(input: Uint8Array) => Await} options.encode */ -function AxiosError(message, code, config, request, response) { - Error.call(this); - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } else { - this.stack = (new Error()).stack; - } - - this.message = message; - this.name = 'AxiosError'; - code && (this.code = code); - config && (this.config = config); - request && (this.request = request); - response && (this.response = response); -} +const uint8arrays_node_modules_multiformats_src_hashes_hasher_from = ({ name, code, encode }) => new uint8arrays_node_modules_multiformats_src_hashes_hasher_Hasher(name, code, encode) -utils.inherits(AxiosError, Error, { - toJSON: function toJSON() { - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: utils.toJSONObject(this.config), - code: this.code, - status: this.response && this.response.status ? this.response.status : null - }; +/** + * Hasher represents a hashing algorithm implementation that produces as + * `MultihashDigest`. + * + * @template {string} Name + * @template {number} Code + * @class + * @implements {MultihashHasher} + */ +class uint8arrays_node_modules_multiformats_src_hashes_hasher_Hasher { + /** + * + * @param {Name} name + * @param {Code} code + * @param {(input: Uint8Array) => Await} encode + */ + constructor (name, code, encode) { + this.name = name + this.code = code + this.encode = encode } -}); - -const AxiosError_prototype = AxiosError.prototype; -const descriptors = {}; -[ - 'ERR_BAD_OPTION_VALUE', - 'ERR_BAD_OPTION', - 'ECONNABORTED', - 'ETIMEDOUT', - 'ERR_NETWORK', - 'ERR_FR_TOO_MANY_REDIRECTS', - 'ERR_DEPRECATED', - 'ERR_BAD_RESPONSE', - 'ERR_BAD_REQUEST', - 'ERR_CANCELED', - 'ERR_NOT_SUPPORT', - 'ERR_INVALID_URL' -// eslint-disable-next-line func-names -].forEach(code => { - descriptors[code] = {value: code}; -}); + /** + * @param {Uint8Array} input + * @returns {Await>} + */ + digest (input) { + if (input instanceof Uint8Array) { + const result = this.encode(input) + return result instanceof Uint8Array + ? node_modules_uint8arrays_node_modules_multiformats_src_hashes_digest_create(this.code, result) + /* c8 ignore next 1 */ + : result.then(digest => node_modules_uint8arrays_node_modules_multiformats_src_hashes_digest_create(this.code, digest)) + } else { + throw Error('Unknown type, must be binary type') + /* c8 ignore next 1 */ + } + } +} -Object.defineProperties(AxiosError, descriptors); -Object.defineProperty(AxiosError_prototype, 'isAxiosError', {value: true}); +/** + * @template {number} Alg + * @typedef {import('./interface.js').MultihashHasher} MultihashHasher + */ -// eslint-disable-next-line func-names -AxiosError.from = (error, code, config, request, response, customProps) => { - const axiosError = Object.create(AxiosError_prototype); +/** + * @template T + * @typedef {Promise|T} Await + */ - utils.toFlatObject(error, axiosError, function filter(obj) { - return obj !== Error.prototype; - }, prop => { - return prop !== 'isAxiosError'; - }); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/hashes/sha2.js +// @ts-check - AxiosError.call(axiosError, error.message, code, config, request, response); - axiosError.cause = error; - axiosError.name = error.name; - customProps && Object.assign(axiosError, customProps); - return axiosError; -}; +const uint8arrays_node_modules_multiformats_src_hashes_sha2_sha256 = uint8arrays_node_modules_multiformats_src_hashes_hasher_from({ + name: 'sha2-256', + code: 0x12, + encode: (input) => node_modules_uint8arrays_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha256').update(input).digest()) +}) -/* harmony default export */ const core_AxiosError = (AxiosError); +const node_modules_multiformats_src_hashes_sha2_sha512 = uint8arrays_node_modules_multiformats_src_hashes_hasher_from({ + name: 'sha2-512', + code: 0x13, + encode: input => node_modules_uint8arrays_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha512').update(input).digest()) +}) -// EXTERNAL MODULE: ./node_modules/form-data/lib/form_data.js -var form_data = __nccwpck_require__(68111); -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/platform/node/classes/FormData.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/cid.js -/* harmony default export */ const classes_FormData = (form_data); -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/toFormData.js +// Linter can see that API is used in types. +// eslint-disable-next-line -// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored +// This way TS will also expose all the types from module /** - * Determines if the given thing is a array or js object. - * - * @param {string} thing - The object or array to be visited. - * - * @returns {boolean} + * @template {API.Link} T + * @template {string} Prefix + * @param {T} link + * @param {API.MultibaseEncoder} [base] + * @returns {API.ToString} */ -function isVisitable(thing) { - return utils.isPlainObject(thing) || utils.isArray(thing); +const node_modules_uint8arrays_node_modules_multiformats_src_cid_format = (link, base) => { + const { bytes, version } = link + switch (version) { + case 0: + return node_modules_uint8arrays_node_modules_multiformats_src_cid_toStringV0( + bytes, + node_modules_uint8arrays_node_modules_multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder<"z">} */ (base) || base58btc.encoder + ) + default: + return node_modules_uint8arrays_node_modules_multiformats_src_cid_toStringV1( + bytes, + node_modules_uint8arrays_node_modules_multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder} */ (base || base32.encoder) + ) + } } /** - * It removes the brackets from the end of a string - * - * @param {string} key - The key of the parameter. - * - * @returns {string} the key without the brackets. + * @template {API.UnknownLink} Link + * @param {Link} link + * @returns {API.LinkJSON} */ -function removeBrackets(key) { - return utils.endsWith(key, '[]') ? key.slice(0, -2) : key; -} +const node_modules_uint8arrays_node_modules_multiformats_src_cid_toJSON = (link) => ({ + '/': node_modules_uint8arrays_node_modules_multiformats_src_cid_format(link) +}) /** - * It takes a path, a key, and a boolean, and returns a string - * - * @param {string} path - The path to the current key. - * @param {string} key - The key of the current object being iterated over. - * @param {string} dots - If true, the key will be rendered with dots instead of brackets. - * - * @returns {string} The path to the current key. + * @template {API.UnknownLink} Link + * @param {API.LinkJSON} json */ -function renderKey(path, key, dots) { - if (!path) return key; - return path.concat(key).map(function each(token, i) { - // eslint-disable-next-line no-param-reassign - token = removeBrackets(token); - return !dots && i ? '[' + token + ']' : token; - }).join(dots ? '.' : ''); -} +const node_modules_uint8arrays_node_modules_multiformats_src_cid_fromJSON = (json) => + node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.parse(json['/']) + +/** @type {WeakMap>} */ +const node_modules_uint8arrays_node_modules_multiformats_src_cid_cache = new WeakMap() /** - * If the array is an array and none of its elements are visitable, then it's a flat array. - * - * @param {Array} arr - The array to check - * - * @returns {boolean} + * @param {API.UnknownLink} cid + * @returns {Map} */ -function isFlatArray(arr) { - return utils.isArray(arr) && !arr.some(isVisitable); +const node_modules_uint8arrays_node_modules_multiformats_src_cid_baseCache = cid => { + const baseCache = node_modules_uint8arrays_node_modules_multiformats_src_cid_cache.get(cid) + if (baseCache == null) { + const baseCache = new Map() + node_modules_uint8arrays_node_modules_multiformats_src_cid_cache.set(cid, baseCache) + return baseCache + } + return baseCache } -const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) { - return /^is[A-Z]/.test(prop); -}); - -/** - * Convert a data object to FormData - * - * @param {Object} obj - * @param {?Object} [formData] - * @param {?Object} [options] - * @param {Function} [options.visitor] - * @param {Boolean} [options.metaTokens = true] - * @param {Boolean} [options.dots = false] - * @param {?Boolean} [options.indexes = false] - * - * @returns {Object} - **/ - /** - * It converts an object into a FormData object - * - * @param {Object} obj - The object to convert to form data. - * @param {string} formData - The FormData object to append to. - * @param {Object} options - * - * @returns + * @template {unknown} [Data=unknown] + * @template {number} [Format=number] + * @template {number} [Alg=number] + * @template {API.Version} [Version=API.Version] + * @implements {API.Link} */ -function toFormData(obj, formData, options) { - if (!utils.isObject(obj)) { - throw new TypeError('target must be an object'); - } - // eslint-disable-next-line no-param-reassign - formData = formData || new (classes_FormData || FormData)(); +class node_modules_uint8arrays_node_modules_multiformats_src_cid_CID { + /** + * @param {Version} version - Version of the CID + * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content. + * @param {Uint8Array} bytes + */ + constructor (version, code, multihash, bytes) { + /** @readonly */ + this.code = code + /** @readonly */ + this.version = version + /** @readonly */ + this.multihash = multihash + /** @readonly */ + this.bytes = bytes - // eslint-disable-next-line no-param-reassign - options = utils.toFlatObject(options, { - metaTokens: true, - dots: false, - indexes: false - }, false, function defined(option, source) { - // eslint-disable-next-line no-eq-null,eqeqeq - return !utils.isUndefined(source[option]); - }); + // flag to serializers that this is a CID and + // should be treated specially + /** @readonly */ + this['/'] = bytes + } - const metaTokens = options.metaTokens; - // eslint-disable-next-line no-use-before-define - const visitor = options.visitor || defaultVisitor; - const dots = options.dots; - const indexes = options.indexes; - const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; - const useBlob = _Blob && utils.isSpecCompliantForm(formData); + /** + * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` + * please either use `CID.asCID(cid)` or switch to new signalling mechanism + * + * @deprecated + */ + get asCID () { + return this + } - if (!utils.isFunction(visitor)) { - throw new TypeError('visitor must be a function'); + // ArrayBufferView + get byteOffset () { + return this.bytes.byteOffset } - function convertValue(value) { - if (value === null) return ''; + // ArrayBufferView + get byteLength () { + return this.bytes.byteLength + } - if (utils.isDate(value)) { - return value.toISOString(); - } + /** + * @returns {CID} + */ + toV0 () { + switch (this.version) { + case 0: { + return /** @type {CID} */ (this) + } + case 1: { + const { code, multihash } = this - if (!useBlob && utils.isBlob(value)) { - throw new core_AxiosError('Blob is not supported. Use a Buffer instead.'); - } + if (code !== node_modules_uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE) { + throw new Error('Cannot convert a non dag-pb CID to CIDv0') + } - if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) { - return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + // sha2-256 + if (multihash.code !== node_modules_uint8arrays_node_modules_multiformats_src_cid_SHA_256_CODE) { + throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') + } + + return /** @type {CID} */ ( + node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.createV0( + /** @type {API.MultihashDigest} */ (multihash) + ) + ) + } + default: { + throw Error( + `Can not convert CID version ${this.version} to version 0. This is a bug please report` + ) + } } + } - return value; + /** + * @returns {CID} + */ + toV1 () { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash + const multihash = Digest.create(code, digest) + return /** @type {CID} */ ( + node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.createV1(this.code, multihash) + ) + } + case 1: { + return /** @type {CID} */ (this) + } + default: { + throw Error( + `Can not convert CID version ${this.version} to version 1. This is a bug please report` + ) + } + } } /** - * Default visitor. - * - * @param {*} value - * @param {String|Number} key - * @param {Array} path - * @this {FormData} - * - * @returns {boolean} return true to visit the each prop of the value recursively + * @param {unknown} other + * @returns {other is CID} */ - function defaultVisitor(value, key, path) { - let arr = value; + equals (other) { + return node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.equals(this, other) + } - if (value && !path && typeof value === 'object') { - if (utils.endsWith(key, '{}')) { - // eslint-disable-next-line no-param-reassign - key = metaTokens ? key : key.slice(0, -2); - // eslint-disable-next-line no-param-reassign - value = JSON.stringify(value); - } else if ( - (utils.isArray(value) && isFlatArray(value)) || - ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value)) - )) { - // eslint-disable-next-line no-param-reassign - key = removeBrackets(key); + /** + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @param {API.Link} self + * @param {unknown} other + * @returns {other is CID} + */ + static equals (self, other) { + const unknown = + /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ ( + other + ) + return ( + unknown && + self.code === unknown.code && + self.version === unknown.version && + Digest.equals(self.multihash, unknown.multihash) + ) + } - arr.forEach(function each(el, index) { - !(utils.isUndefined(el) || el === null) && formData.append( - // eslint-disable-next-line no-nested-ternary - indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), - convertValue(el) - ); - }); - return false; - } - } + /** + * @param {API.MultibaseEncoder} [base] + * @returns {string} + */ + toString (base) { + return node_modules_uint8arrays_node_modules_multiformats_src_cid_format(this, base) + } - if (isVisitable(value)) { - return true; - } + /** + * @returns {API.LinkJSON} + */ + toJSON () { + return { '/': node_modules_uint8arrays_node_modules_multiformats_src_cid_format(this) } + } - formData.append(renderKey(path, key, dots), convertValue(value)); + link () { + return this + } - return false; + get [Symbol.toStringTag] () { + return 'CID' } - const stack = []; + // Legacy - const exposedHelpers = Object.assign(predicates, { - defaultVisitor, - convertValue, - isVisitable - }); + [Symbol.for('nodejs.util.inspect.custom')] () { + return `CID(${this.toString()})` + } - function build(value, path) { - if (utils.isUndefined(value)) return; + /** + * Takes any input `value` and returns a `CID` instance if it was + * a `CID` otherwise returns `null`. If `value` is instanceof `CID` + * it will return value back. If `value` is not instance of this CID + * class, but is compatible CID it will return new instance of this + * `CID` class. Otherwise returns null. + * + * This allows two different incompatible versions of CID library to + * co-exist and interop as long as binary interface is compatible. + * + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @template {unknown} U + * @param {API.Link|U} input + * @returns {CID|null} + */ + static asCID (input) { + if (input == null) { + return null + } - if (stack.indexOf(value) !== -1) { - throw Error('Circular reference detected in ' + path.join('.')); + const value = /** @type {any} */ (input) + if (value instanceof node_modules_uint8arrays_node_modules_multiformats_src_cid_CID) { + // If value is instance of CID then we're all set. + return value + } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { + // If value isn't instance of this CID class but `this.asCID === this` or + // `value['/'] === value.bytes` is true it is CID instance coming from a + // different implementation (diff version or duplicate). In that case we + // rebase it to this `CID` implementation so caller is guaranteed to get + // instance with expected API. + const { version, code, multihash, bytes } = value + return new node_modules_uint8arrays_node_modules_multiformats_src_cid_CID( + version, + code, + /** @type {API.MultihashDigest} */ (multihash), + bytes || node_modules_uint8arrays_node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes) + ) + } else if (value[node_modules_uint8arrays_node_modules_multiformats_src_cid_cidSymbol] === true) { + // If value is a CID from older implementation that used to be tagged via + // symbol we still rebase it to the this `CID` implementation by + // delegating that to a constructor. + const { version, multihash, code } = value + const digest = + /** @type {API.MultihashDigest} */ + (Digest.decode(multihash)) + return node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.create(version, code, digest) + } else { + // Otherwise value is not a CID (or an incompatible version of it) in + // which case we return `null`. + return null } + } - stack.push(value); + /** + * + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @param {Version} version - Version of the CID + * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param {API.MultihashDigest} digest - (Multi)hash of the of the content. + * @returns {CID} + */ + static create (version, code, digest) { + if (typeof code !== 'number') { + throw new Error('String codecs are no longer supported') + } - utils.forEach(value, function each(el, key) { - const result = !(utils.isUndefined(el) || el === null) && visitor.call( - formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers - ); + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error('Invalid digest') + } - if (result === true) { - build(el, path ? path.concat(key) : [key]); + switch (version) { + case 0: { + if (code !== node_modules_uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE) { + throw new Error( + `Version 0 CID must use dag-pb (code: ${node_modules_uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding` + ) + } else { + return new node_modules_uint8arrays_node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes) + } } - }); + case 1: { + const bytes = node_modules_uint8arrays_node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes) + return new node_modules_uint8arrays_node_modules_multiformats_src_cid_CID(version, code, digest, bytes) + } + default: { + throw new Error('Invalid version') + } + } + } - stack.pop(); + /** + * Simplified version of `create` for CIDv0. + * + * @template {unknown} [T=unknown] + * @param {API.MultihashDigest} digest - Multihash. + * @returns {CID} + */ + static createV0 (digest) { + return node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.create(0, node_modules_uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE, digest) } - if (!utils.isObject(obj)) { - throw new TypeError('data must be an object'); + /** + * Simplified version of `create` for CIDv1. + * + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @param {Code} code - Content encoding format code. + * @param {API.MultihashDigest} digest - Miltihash of the content. + * @returns {CID} + */ + static createV1 (code, digest) { + return node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.create(1, code, digest) } - build(obj); + /** + * Decoded a CID from its binary representation. The byte array must contain + * only the CID with no additional bytes. + * + * An error will be thrown if the bytes provided do not contain a valid + * binary representation of a CID. + * + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ByteView>} bytes + * @returns {CID} + */ + static decode (bytes) { + const [cid, remainder] = node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.decodeFirst(bytes) + if (remainder.length) { + throw new Error('Incorrect length') + } + return cid + } - return formData; -} + /** + * Decoded a CID from its binary representation at the beginning of a byte + * array. + * + * Returns an array with the first element containing the CID and the second + * element containing the remainder of the original byte array. The remainder + * will be a zero-length byte array if the provided bytes only contained a + * binary CID representation. + * + * @template {unknown} T + * @template {number} C + * @template {number} A + * @template {API.Version} V + * @param {API.ByteView>} bytes + * @returns {[CID, Uint8Array]} + */ + static decodeFirst (bytes) { + const specs = node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.inspectBytes(bytes) + const prefixSize = specs.size - specs.multihashSize + const multihashBytes = coerce( + bytes.subarray(prefixSize, prefixSize + specs.multihashSize) + ) + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error('Incorrect length') + } + const digestBytes = multihashBytes.subarray( + specs.multihashSize - specs.digestSize + ) + const digest = new Digest.Digest( + specs.multihashCode, + specs.digestSize, + digestBytes, + multihashBytes + ) + const cid = + specs.version === 0 + ? node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) + : node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest) + return [/** @type {CID} */(cid), bytes.subarray(specs.size)] + } -/* harmony default export */ const helpers_toFormData = (toFormData); + /** + * Inspect the initial bytes of a CID to determine its properties. + * + * Involves decoding up to 4 varints. Typically this will require only 4 to 6 + * bytes but for larger multicodec code values and larger multihash digest + * lengths these varints can be quite large. It is recommended that at least + * 10 bytes be made available in the `initialBytes` argument for a complete + * inspection. + * + * @template {unknown} T + * @template {number} C + * @template {number} A + * @template {API.Version} V + * @param {API.ByteView>} initialBytes + * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }} + */ + static inspectBytes (initialBytes) { + let offset = 0 + const next = () => { + const [i, length] = varint.decode(initialBytes.subarray(offset)) + offset += length + return i + } -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/AxiosURLSearchParams.js + let version = /** @type {V} */ (next()) + let codec = /** @type {C} */ (node_modules_uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE) + if (/** @type {number} */(version) === 18) { + // CIDv0 + version = /** @type {V} */ (0) + offset = 0 + } else { + codec = /** @type {C} */ (next()) + } + + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`) + } + + const prefixSize = offset + const multihashCode = /** @type {A} */ (next()) // multihash code + const digestSize = next() // multihash length + const size = offset + digestSize + const multihashSize = size - prefixSize + + return { version, codec, multihashCode, digestSize, multihashSize, size } + } + + /** + * Takes cid in a string representation and creates an instance. If `base` + * decoder is not provided will use a default from the configuration. It will + * throw an error if encoding of the CID is not compatible with supplied (or + * a default decoder). + * + * @template {string} Prefix + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ToString, Prefix>} source + * @param {API.MultibaseDecoder} [base] + * @returns {CID} + */ + static parse (source, base) { + const [prefix, bytes] = node_modules_uint8arrays_node_modules_multiformats_src_cid_parseCIDtoBytes(source, base) + + const cid = node_modules_uint8arrays_node_modules_multiformats_src_cid_CID.decode(bytes) + if (cid.version === 0 && source[0] !== 'Q') { + throw Error('Version 0 CID string must not include multibase prefix') + } + // Cache string representation to avoid computing it on `this.toString()` + node_modules_uint8arrays_node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source) + return cid + } +} /** - * It encodes a string by replacing all characters that are not in the unreserved set with - * their percent-encoded equivalents - * - * @param {string} str - The string to encode. - * - * @returns {string} The encoded string. + * @template {string} Prefix + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ToString, Prefix>} source + * @param {API.MultibaseDecoder} [base] + * @returns {[Prefix, API.ByteView>]} */ -function AxiosURLSearchParams_encode(str) { - const charMap = { - '!': '%21', - "'": '%27', - '(': '%28', - ')': '%29', - '~': '%7E', - '%20': '+', - '%00': '\x00' - }; - return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { - return charMap[match]; - }); +const node_modules_uint8arrays_node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => { + switch (source[0]) { + // CIDv0 is parsed differently + case 'Q': { + const decoder = base || base58btc + return [ + /** @type {Prefix} */ (base58btc.prefix), + decoder.decode(`${base58btc.prefix}${source}`) + ] + } + case base58btc.prefix: { + const decoder = base || base58btc + return [/** @type {Prefix} */(base58btc.prefix), decoder.decode(source)] + } + case base32.prefix: { + const decoder = base || base32 + return [/** @type {Prefix} */(base32.prefix), decoder.decode(source)] + } + default: { + if (base == null) { + throw Error( + 'To parse non base32 or base58btc encoded CID multibase decoder must be provided' + ) + } + return [/** @type {Prefix} */(source[0]), base.decode(source)] + } + } } /** - * It takes a params object and converts it to a FormData object - * - * @param {Object} params - The parameters to be converted to a FormData object. - * @param {Object} options - The options object passed to the Axios constructor. * - * @returns {void} + * @param {Uint8Array} bytes + * @param {Map} cache + * @param {API.MultibaseEncoder<'z'>} base */ -function AxiosURLSearchParams(params, options) { - this._pairs = []; +const node_modules_uint8arrays_node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => { + const { prefix } = base + if (prefix !== base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base.name} encoding`) + } - params && helpers_toFormData(params, this, options); + const cid = cache.get(prefix) + if (cid == null) { + const cid = base.encode(bytes).slice(1) + cache.set(prefix, cid) + return cid + } else { + return cid + } } -const AxiosURLSearchParams_prototype = AxiosURLSearchParams.prototype; - -AxiosURLSearchParams_prototype.append = function append(name, value) { - this._pairs.push([name, value]); -}; +/** + * @template {string} Prefix + * @param {Uint8Array} bytes + * @param {Map} cache + * @param {API.MultibaseEncoder} base + */ +const node_modules_uint8arrays_node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => { + const { prefix } = base + const cid = cache.get(prefix) + if (cid == null) { + const cid = base.encode(bytes) + cache.set(prefix, cid) + return cid + } else { + return cid + } +} -AxiosURLSearchParams_prototype.toString = function toString(encoder) { - const _encode = encoder ? function(value) { - return encoder.call(this, value, AxiosURLSearchParams_encode); - } : AxiosURLSearchParams_encode; +const node_modules_uint8arrays_node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70 +const node_modules_uint8arrays_node_modules_multiformats_src_cid_SHA_256_CODE = 0x12 - return this._pairs.map(function each(pair) { - return _encode(pair[0]) + '=' + _encode(pair[1]); - }, '').join('&'); -}; +/** + * @param {API.Version} version + * @param {number} code + * @param {Uint8Array} multihash + * @returns {Uint8Array} + */ +const node_modules_uint8arrays_node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => { + const codeOffset = varint.encodingLength(version) + const hashOffset = codeOffset + varint.encodingLength(code) + const bytes = new Uint8Array(hashOffset + multihash.byteLength) + varint.encodeTo(version, bytes, 0) + varint.encodeTo(code, bytes, codeOffset) + bytes.set(multihash, hashOffset) + return bytes +} -/* harmony default export */ const helpers_AxiosURLSearchParams = (AxiosURLSearchParams); +const node_modules_uint8arrays_node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/buildURL.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/index.js -/** - * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their - * URI encoded counterparts - * - * @param {string} val The value to be encoded. - * - * @returns {string} The encoded value. - */ -function buildURL_encode(val) { - return encodeURIComponent(val). - replace(/%3A/gi, ':'). - replace(/%24/g, '$'). - replace(/%2C/gi, ','). - replace(/%20/g, '+'). - replace(/%5B/gi, '['). - replace(/%5D/gi, ']'); -} -/** - * Build a URL by appending params to the end - * - * @param {string} url The base of the url (e.g., http://www.google.com) - * @param {object} [params] The params to be appended - * @param {?object} options - * - * @returns {string} The formatted url - */ -function buildURL(url, params, options) { - /*eslint no-param-reassign:0*/ - if (!params) { - return url; - } - - const _encode = options && options.encode || buildURL_encode; +// This way TS will also expose all the types from module - const serializeFn = options && options.serialize; - let serializedParams; - if (serializeFn) { - serializedParams = serializeFn(params, options); - } else { - serializedParams = utils.isURLSearchParams(params) ? - params.toString() : - new helpers_AxiosURLSearchParams(params, options).toString(_encode); - } - if (serializedParams) { - const hashmarkIndex = url.indexOf("#"); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/node_modules/multiformats/src/basics.js +// @ts-check - if (hashmarkIndex !== -1) { - url = url.slice(0, hashmarkIndex); - } - url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; - } - return url; -} -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/core/InterceptorManager.js -class InterceptorManager { - constructor() { - this.handlers = []; - } - /** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * - * @return {Number} An ID used to remove interceptor later - */ - use(fulfilled, rejected, options) { - this.handlers.push({ - fulfilled, - rejected, - synchronous: options ? options.synchronous : false, - runWhen: options ? options.runWhen : null - }); - return this.handlers.length - 1; - } - /** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - * - * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise - */ - eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; - } - } - /** - * Clear all interceptors from the stack - * - * @returns {void} - */ - clear() { - if (this.handlers) { - this.handlers = []; - } - } - /** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - * - * @returns {void} - */ - forEach(fn) { - utils.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); - } - }); - } -} -/* harmony default export */ const core_InterceptorManager = (InterceptorManager); -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/defaults/transitional.js -/* harmony default export */ const defaults_transitional = ({ - silentJSONParsing: true, - forcedJSONParsing: true, - clarifyTimeoutError: false -}); -// EXTERNAL MODULE: external "url" -var external_url_ = __nccwpck_require__(57310); -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +const uint8arrays_node_modules_multiformats_src_basics_bases = { ...uint8arrays_node_modules_multiformats_src_bases_identity_namespaceObject, ...uint8arrays_node_modules_multiformats_src_bases_base2_namespaceObject, ...uint8arrays_node_modules_multiformats_src_bases_base8_namespaceObject, ...uint8arrays_node_modules_multiformats_src_bases_base10_namespaceObject, ...uint8arrays_node_modules_multiformats_src_bases_base16_namespaceObject, ...node_modules_uint8arrays_node_modules_multiformats_src_bases_base32_namespaceObject, ...uint8arrays_node_modules_multiformats_src_bases_base36_namespaceObject, ...node_modules_uint8arrays_node_modules_multiformats_src_bases_base58_namespaceObject, ...uint8arrays_node_modules_multiformats_src_bases_base64_namespaceObject, ...uint8arrays_node_modules_multiformats_src_bases_base256emoji_namespaceObject } +const uint8arrays_node_modules_multiformats_src_basics_hashes = { ...uint8arrays_node_modules_multiformats_src_hashes_sha2_namespaceObject, ...uint8arrays_node_modules_multiformats_src_hashes_identity_namespaceObject } +const uint8arrays_node_modules_multiformats_src_basics_codecs = { raw: uint8arrays_node_modules_multiformats_src_codecs_raw_namespaceObject, json: uint8arrays_node_modules_multiformats_src_codecs_json_namespaceObject } -/* harmony default export */ const classes_URLSearchParams = (external_url_.URLSearchParams); -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/platform/node/index.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/dist/src/alloc.js +/** + * Returns a `Uint8Array` of the requested size. Referenced memory will + * be initialized to 0. + */ +function uint8arrays_dist_src_alloc_alloc(size = 0) { + if (globalThis.Buffer?.alloc != null) { + return asUint8Array(globalThis.Buffer.alloc(size)); + } + return new Uint8Array(size); +} +/** + * Where possible returns a Uint8Array of the requested size that references + * uninitialized memory. Only use if you are certain you will immediately + * overwrite every value in the returned `Uint8Array`. + */ +function dist_src_alloc_allocUnsafe(size = 0) { + if (globalThis.Buffer?.allocUnsafe != null) { + return dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.allocUnsafe(size)); + } + return new Uint8Array(size); +} +//# sourceMappingURL=alloc.js.map +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/dist/src/util/bases.js -/* harmony default export */ const node = ({ - isNode: true, - classes: { - URLSearchParams: classes_URLSearchParams, - FormData: classes_FormData, - Blob: typeof Blob !== 'undefined' && Blob || null - }, - protocols: [ 'http', 'https', 'file', 'data' ] +function util_bases_createCodec(name, prefix, encode, decode) { + return { + name, + prefix, + encoder: { + name, + prefix, + encode + }, + decoder: { + decode + } + }; +} +const util_bases_string = util_bases_createCodec('utf8', 'u', (buf) => { + const decoder = new TextDecoder('utf8'); + return 'u' + decoder.decode(buf); +}, (str) => { + const encoder = new TextEncoder(); + return encoder.encode(str.substring(1)); +}); +const util_bases_ascii = util_bases_createCodec('ascii', 'a', (buf) => { + let string = 'a'; + for (let i = 0; i < buf.length; i++) { + string += String.fromCharCode(buf[i]); + } + return string; +}, (str) => { + str = str.substring(1); + const buf = dist_src_alloc_allocUnsafe(str.length); + for (let i = 0; i < str.length; i++) { + buf[i] = str.charCodeAt(i); + } + return buf; }); +const util_bases_BASES = { + utf8: util_bases_string, + 'utf-8': util_bases_string, + hex: uint8arrays_node_modules_multiformats_src_basics_bases.base16, + latin1: util_bases_ascii, + ascii: util_bases_ascii, + binary: util_bases_ascii, + ...uint8arrays_node_modules_multiformats_src_basics_bases +}; +/* harmony default export */ const dist_src_util_bases = (util_bases_BASES); +//# sourceMappingURL=bases.js.map +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/dist/src/from-string.js -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/platform/common/utils.js -const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; /** - * Determine if we're running in a standard browser environment - * - * This allows axios to run in a web worker, and react-native. - * Both environments support XMLHttpRequest, but not fully standard globals. - * - * web workers: - * typeof window -> undefined - * typeof document -> undefined - * - * react-native: - * navigator.product -> 'ReactNative' - * nativescript - * navigator.product -> 'NativeScript' or 'NS' + * Create a `Uint8Array` from the passed string * - * @returns {boolean} - */ -const hasStandardBrowserEnv = ( - (product) => { - return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0 - })(typeof navigator !== 'undefined' && navigator.product); - -/** - * Determine if we're running in a standard browser webWorker environment + * Supports `utf8`, `utf-8`, `hex`, and any encoding supported by the multiformats module. * - * Although the `isStandardBrowserEnv` method indicates that - * `allows axios to run in a web worker`, the WebWorker will still be - * filtered out due to its judgment standard - * `typeof window !== 'undefined' && typeof document !== 'undefined'`. - * This leads to a problem when axios post `FormData` in webWorker + * Also `ascii` which is similar to node's 'binary' encoding. */ -const hasStandardBrowserWebWorkerEnv = (() => { - return ( - typeof WorkerGlobalScope !== 'undefined' && - // eslint-disable-next-line no-undef - self instanceof WorkerGlobalScope && - typeof self.importScripts === 'function' - ); -})(); - +function dist_src_from_string_fromString(string, encoding = 'utf8') { + const base = dist_src_util_bases[encoding]; + if (base == null) { + throw new Error(`Unsupported encoding "${encoding}"`); + } + if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) { + return dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.from(string, 'utf-8')); + } + // add multibase prefix + return base.decoder.decode(`${base.prefix}${string}`); // eslint-disable-line @typescript-eslint/restrict-template-expressions +} +//# sourceMappingURL=from-string.js.map +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/config/replace.js -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/platform/index.js -/* harmony default export */ const platform = ({ - ...common_utils_namespaceObject, - ...node -}); -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/toURLEncodedForm.js +const createReplace = configure(api => { + /** + * @type {import('../types.js').ConfigAPI["replace"]} + */ + const replace = async (config, options = {}) => { + // allow aborting requests on body errors + const controller = new AbortController() + const signal = abortSignal(controller.signal, options.signal) + const res = await api.post('config/replace', { + signal, + searchParams: toUrlSearchParams(options), + ...( + await multipart_request_multipartRequest([dist_src_from_string_fromString(JSON.stringify(config))], controller, options.headers) + ) + }) + await res.text() + } + return replace +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/config/set.js -function toURLEncodedForm(data, options) { - return helpers_toFormData(data, new platform.classes.URLSearchParams(), Object.assign({ - visitor: function(value, key, path, helpers) { - if (platform.isNode && utils.isBuffer(value)) { - this.append(key, value.toString('base64')); - return false; - } - return helpers.defaultVisitor.apply(this, arguments); +const createSet = configure(api => { + /** + * @type {import('../types.js').ConfigAPI["set"]} + */ + const set = async (key, value, options = {}) => { + if (typeof key !== 'string') { + throw new Error('Invalid key type') } - }, options)); -} - -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/formDataToJSON.js + const params = { + ...options, + ...encodeParam(key, value) + } + const res = await api.post('config', { + signal: options.signal, + searchParams: toUrlSearchParams(params), + headers: options.headers + }) + await res.text() + } -/** - * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] - * - * @param {string} name - The name of the property to get. - * - * @returns An array of strings. - */ -function parsePropPath(name) { - // foo[x][y][z] - // foo.x.y.z - // foo-x-y-z - // foo x y z - return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => { - return match[0] === '[]' ? '' : match[1] || match[0]; - }); -} + return set +}) /** - * Convert an array to an object. - * - * @param {Array} arr - The array to convert to an object. - * - * @returns An object with the same keys and values as the array. + * @param {*} key + * @param {*} value */ -function arrayToObject(arr) { - const obj = {}; - const keys = Object.keys(arr); - let i; - const len = keys.length; - let key; - for (i = 0; i < len; i++) { - key = keys[i]; - obj[key] = arr[key]; +const encodeParam = (key, value) => { + switch (typeof value) { + case 'boolean': + return { arg: [key, value.toString()], bool: true } + case 'string': + return { arg: [key, value] } + default: + return { arg: [key, JSON.stringify(value)], json: true } } - return obj; } -/** - * It takes a FormData object and returns a JavaScript object - * - * @param {string} formData The FormData object to convert to JSON. - * - * @returns {Object | null} The converted object. - */ -function formDataToJSON(formData) { - function buildPath(path, value, target, index) { - let name = path[index++]; - const isNumericKey = Number.isFinite(+name); - const isLast = index >= path.length; - name = !name && utils.isArray(target) ? target.length : name; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/config/index.js - if (isLast) { - if (utils.hasOwnProp(target, name)) { - target[name] = [target[name], value]; - } else { - target[name] = value; - } - return !isNumericKey; - } - if (!target[name] || !utils.isObject(target[name])) { - target[name] = []; - } - const result = buildPath(path, value, target[name], index); - if (result && utils.isArray(target[name])) { - target[name] = arrayToObject(target[name]); - } - return !isNumericKey; +/** + * @param {import('../types').Options} config + */ +function createConfig (config) { + return { + getAll: createGetAll(config), + get: get_createGet(config), + set: createSet(config), + replace: createReplace(config), + profiles: createProfiles(config) } +} - if (utils.isFormData(formData) && utils.isFunction(formData.entries)) { - const obj = {}; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dag/export.js - utils.forEachEntry(formData, (name, value) => { - buildPath(parsePropPath(name), value, obj, 0); - }); - return obj; - } - return null; -} +const createExport = configure(api => { + /** + * @type {import('../types').DAGAPI["export"]} + */ + async function * dagExport (root, options = {}) { + const res = await api.post('dag/export', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: root.toString() + }), + headers: options.headers + }) -/* harmony default export */ const helpers_formDataToJSON = (formDataToJSON); + yield * res.iterator() + } -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/defaults/index.js + return dagExport +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/resolve.js +/** + * Retrieves IPLD Nodes along the `path` that is rooted at `cid`. + * + * @param {CID} cid - the CID where the resolving starts + * @param {string} path - the path that should be resolved + * @param {import('../types').Multicodecs} codecs + * @param {(cid: CID, options?: import('../types').AbortOptions) => Promise} getBlock + * @param {import('../types').AbortOptions} [options] + */ +async function * resolve (cid, path, codecs, getBlock, options) { + /** + * @param {CID} cid + */ + const load = async (cid) => { + const codec = await codecs.getCodec(cid.code) + const block = await getBlock(cid, options) + return codec.decode(block) + } + const parts = path.split('/').filter(Boolean) + let value = await load(cid) + let lastCid = cid + // End iteration if there isn't a CID to follow any more + while (parts.length) { + const key = parts.shift() + if (!key) { + throw err_code(new Error(`Could not resolve path "${path}"`), 'ERR_INVALID_PATH') + } + if (Object.prototype.hasOwnProperty.call(value, key)) { + value = value[key] -/** - * It takes a string, tries to parse it, and if it fails, it returns the stringified version - * of the input - * - * @param {any} rawValue - The value to be stringified. - * @param {Function} parser - A function that parses a string into a JavaScript object. - * @param {Function} encoder - A function that takes a value and returns a string. - * - * @returns {string} A stringified version of the rawValue. - */ -function stringifySafely(rawValue, parser, encoder) { - if (utils.isString(rawValue)) { - try { - (parser || JSON.parse)(rawValue); - return utils.trim(rawValue); - } catch (e) { - if (e.name !== 'SyntaxError') { - throw e; + yield { + value, + remainderPath: parts.join('/') } + } else { + throw err_code(new Error(`no link named "${key}" under ${lastCid}`), 'ERR_NO_LINK') + } + + const cid = node_modules_multiformats_src_cid_CID.asCID(value) + + if (cid) { + lastCid = cid + value = await load(value) } } - return (encoder || JSON.stringify)(rawValue); + yield { + value, + remainderPath: '' + } } -const defaults = { +;// CONCATENATED MODULE: ./node_modules/it-first/dist/src/index.js +/** + * Returns the first result from an (async) iterable, unless empty, in which + * case returns `undefined` + */ +async function first(source) { + for await (const entry of source) { // eslint-disable-line no-unreachable-loop + return entry; + } + return undefined; +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/it-last/dist/src/index.js +/** + * Returns the last item of an (async) iterable, unless empty, in which case + * return `undefined` + */ +async function last(source) { + let res; + for await (const entry of source) { + res = entry; + } + return res; +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dag/get.js - transitional: defaults_transitional, - adapter: ['xhr', 'http'], - transformRequest: [function transformRequest(data, headers) { - const contentType = headers.getContentType() || ''; - const hasJSONContentType = contentType.indexOf('application/json') > -1; - const isObjectPayload = utils.isObject(data); - if (isObjectPayload && utils.isHTMLForm(data)) { - data = new FormData(data); - } - const isFormData = utils.isFormData(data); - if (isFormData) { - if (!hasJSONContentType) { - return data; - } - return hasJSONContentType ? JSON.stringify(helpers_formDataToJSON(data)) : data; - } - if (utils.isArrayBuffer(data) || - utils.isBuffer(data) || - utils.isStream(data) || - utils.isFile(data) || - utils.isBlob(data) - ) { - return data; - } - if (utils.isArrayBufferView(data)) { - return data.buffer; - } - if (utils.isURLSearchParams(data)) { - headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); - return data.toString(); - } +/** + * @param {import('../types').Multicodecs} codecs + * @param {import('../types').Options} options + */ +const dag_get_createGet = (codecs, options) => { + const fn = configure((api, opts) => { + const getBlock = createGet(opts) - let isFileList; + /** + * @type {import('../types').DAGAPI["get"]} + */ + const get = async (cid, options = {}) => { + if (options.path) { + const entry = options.localResolve + ? await first(resolve(cid, options.path, codecs, getBlock, options)) + : await last(resolve(cid, options.path, codecs, getBlock, options)) + /** @type {import('../types').GetResult | undefined} - first and last will return undefined when empty */ + const result = (entry) - if (isObjectPayload) { - if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { - return toURLEncodedForm(data, this.formSerializer).toString(); + if (!result) { + throw err_code(new Error('Not found'), 'ERR_NOT_FOUND') + } + + return result } - if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { - const _FormData = this.env && this.env.FormData; + const codec = await codecs.getCodec(cid.code) + const block = await getBlock(cid, options) + const node = codec.decode(block) - return helpers_toFormData( - isFileList ? {'files[]': data} : data, - _FormData && new _FormData(), - this.formSerializer - ); + return { + value: node, + remainderPath: '' } } - if (isObjectPayload || hasJSONContentType ) { - headers.setContentType('application/json', false); - return stringifySafely(data); - } + return get + }) - return data; - }], + return fn(options) +} - transformResponse: [function transformResponse(data) { - const transitional = this.transitional || defaults.transitional; - const forcedJSONParsing = transitional && transitional.forcedJSONParsing; - const JSONRequested = this.responseType === 'json'; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dag/import.js - if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { - const silentJSONParsing = transitional && transitional.silentJSONParsing; - const strictJSONParsing = !silentJSONParsing && JSONRequested; - try { - return JSON.parse(data); - } catch (e) { - if (strictJSONParsing) { - if (e.name === 'SyntaxError') { - throw core_AxiosError.from(e, core_AxiosError.ERR_BAD_RESPONSE, this, null, this.response); - } - throw e; - } - } - } - return data; - }], - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', - maxContentLength: -1, - maxBodyLength: -1, +const createImport = configure(api => { + /** + * @type {import('../types.js').DAGAPI["import"]} + */ + async function * dagImport (source, options = {}) { + const controller = new AbortController() + const signal = abortSignal(controller.signal, options.signal) + const { headers, body } = await multipart_request_multipartRequest(source, controller, options.headers) - env: { - FormData: platform.classes.FormData, - Blob: platform.classes.Blob - }, + const res = await api.post('dag/import', { + signal, + headers, + body, + searchParams: toUrlSearchParams({ 'pin-roots': options.pinRoots }) + }) - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - }, + for await (const { Root } of res.ndjson()) { + if (Root !== undefined) { + const { Cid: { '/': Cid }, PinErrorMsg } = Root - headers: { - common: { - 'Accept': 'application/json, text/plain, */*', - 'Content-Type': undefined + yield { + root: { + cid: node_modules_multiformats_src_cid_CID.parse(Cid), + pinErrorMsg: PinErrorMsg + } + } + } } } -}; -utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => { - defaults.headers[method] = {}; -}); + return dagImport +}) -/* harmony default export */ const lib_defaults = (defaults); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dag/put.js -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/parseHeaders.js -// RawAxiosHeaders whose duplicates are ignored by node -// c.f. https://nodejs.org/api/http.html#http_message_headers -const ignoreDuplicateOf = utils.toObjectSet([ - 'age', 'authorization', 'content-length', 'content-type', 'etag', - 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', - 'last-modified', 'location', 'max-forwards', 'proxy-authorization', - 'referer', 'retry-after', 'user-agent' -]); /** - * Parse headers into an object - * - * ``` - * Date: Wed, 27 Aug 2014 08:58:49 GMT - * Content-Type: application/json - * Connection: keep-alive - * Transfer-Encoding: chunked - * ``` - * - * @param {String} rawHeaders Headers needing to be parsed - * - * @returns {Object} Headers parsed into an object + * @param {import('../types').Multicodecs} codecs + * @param {import('../types').Options} options */ -/* harmony default export */ const parseHeaders = (rawHeaders => { - const parsed = {}; - let key; - let val; - let i; - - rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { - i = line.indexOf(':'); - key = line.substring(0, i).trim().toLowerCase(); - val = line.substring(i + 1).trim(); +const put_createPut = (codecs, options) => { + const fn = configure((api) => { + /** + * @type {import('../types').DAGAPI["put"]} + */ + const put = async (dagNode, options = {}) => { + const settings = { + storeCodec: 'dag-cbor', + hashAlg: 'sha2-256', + ...options + } - if (!key || (parsed[key] && ignoreDuplicateOf[key])) { - return; - } + let serialized - if (key === 'set-cookie') { - if (parsed[key]) { - parsed[key].push(val); + if (settings.inputCodec) { + // if you supply an inputCodec, we assume you're passing in a raw, encoded + // block using that codec, so we'll just pass that on to the server and let + // it deal with the decode/encode/store cycle + if (!(dagNode instanceof Uint8Array)) { + throw new Error('Can only inputCodec on raw bytes that can be decoded') + } + serialized = dagNode } else { - parsed[key] = [val]; + // if you don't supply an inputCodec, we assume you've passed in a JavaScript + // object you want to have encoded using storeCodec, so we'll prepare it for + // you if we have the codec + const storeCodec = await codecs.getCodec(settings.storeCodec) + serialized = storeCodec.encode(dagNode) + // now we have a serialized form, the server should be told to receive it + // in that format + settings.inputCodec = settings.storeCodec } - } else { - parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; - } - }); - return parsed; -}); + // allow aborting requests on body errors + const controller = new AbortController() + const signal = abortSignal(controller.signal, settings.signal) -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/core/AxiosHeaders.js + const res = await api.post('dag/put', { + timeout: settings.timeout, + signal, + searchParams: toUrlSearchParams(settings), + ...( + await multipart_request_multipartRequest([serialized], controller, settings.headers) + ) + }) + const data = await res.json() + return node_modules_multiformats_src_cid_CID.parse(data.Cid['/']) + } + return put + }) + return fn(options) +} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dag/resolve.js -const $internals = Symbol('internals'); -function normalizeHeader(header) { - return header && String(header).trim().toLowerCase(); -} -function normalizeValue(value) { - if (value === false || value == null) { - return value; - } - return utils.isArray(value) ? value.map(normalizeValue) : String(value); -} +const createResolve = configure(api => { + /** + * @type {import('../types.js').DAGAPI["resolve"]} + */ + const resolve = async (ipfsPath, options = {}) => { + const res = await api.post('dag/resolve', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: `${ipfsPath}${options.path ? `/${options.path}`.replace(/\/[/]+/g, '/') : ''}`, + ...options + }), + headers: options.headers + }) -function parseTokens(str) { - const tokens = Object.create(null); - const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; - let match; + const data = await res.json() - while ((match = tokensRE.exec(str))) { - tokens[match[1]] = match[2]; + return { cid: node_modules_multiformats_src_cid_CID.parse(data.Cid['/']), remainderPath: data.RemPath } } - return tokens; -} + return resolve +}) -const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dag/index.js -function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { - if (utils.isFunction(filter)) { - return filter.call(this, value, header); - } - if (isHeaderNameFilter) { - value = header; - } - if (!utils.isString(value)) return; - if (utils.isString(filter)) { - return value.indexOf(filter) !== -1; - } - if (utils.isRegExp(filter)) { - return filter.test(value); + +/** + * @param {import('../types').Multicodecs} codecs + * @param {import('../types').Options} config + */ +function createDag (codecs, config) { + return { + export: createExport(config), + get: dag_get_createGet(codecs, config), + import: createImport(config), + put: put_createPut(codecs, config), + resolve: createResolve(config) } } -function formatHeader(header) { - return header.trim() - .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { - return char.toUpperCase() + str; - }); -} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dht/response-types.js -function buildAccessors(obj, header) { - const accessorName = utils.toCamelCase(' ' + header); +// Response types are defined here = +// https://github.com/libp2p/go-libp2p-core/blob/6e566d10f4a5447317a66d64c7459954b969bdab/routing/query.go#L15-L24 +const SendingQuery = 0 +const PeerResponse = 1 +const FinalPeer = 2 +const QueryError = 3 +const Provider = 4 +const Value = 5 +const AddingPeer = 6 +const DialingPeer = 7 - ['get', 'set', 'has'].forEach(methodName => { - Object.defineProperty(obj, methodName + accessorName, { - value: function(arg1, arg2, arg3) { - return this[methodName].call(this, header, arg1, arg2, arg3); - }, - configurable: true - }); - }); -} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dht/map-event.js -class AxiosHeaders { - constructor(headers) { - headers && this.set(headers); - } - set(header, valueOrRewrite, rewrite) { - const self = this; - function setHeader(_value, _header, _rewrite) { - const lHeader = normalizeHeader(_header); - if (!lHeader) { - throw new Error('header name must be a non-empty string'); - } - const key = utils.findKey(self, lHeader); +/** + * @typedef {ReturnType} Multiaddr + */ - if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { - self[key || _header] = normalizeValue(_value); - } +/** + * @param {import('../types').MapEvent} event + * @returns {import('../types').QueryEvent} + */ +const mapEvent = (event) => { + if (event.Type === SendingQuery) { + return { + name: 'SENDING_QUERY', + type: event.Type } + } - const setHeaders = (headers, _rewrite) => - utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); - - if (utils.isPlainObject(header) || header instanceof this.constructor) { - setHeaders(header, valueOrRewrite) - } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { - setHeaders(parseHeaders(header), valueOrRewrite); - } else { - header != null && setHeader(valueOrRewrite, header, rewrite); + if (event.Type === PeerResponse) { + return { + from: peerIdFromString(event.ID), + name: 'PEER_RESPONSE', + type: event.Type, + // TODO: how to infer this from the go-ipfs response + messageType: 0, + // TODO: how to infer this from the go-ipfs response + messageName: 'PUT_VALUE', + closer: (event.Responses || []).map(({ ID, Addrs }) => ({ id: peerIdFromString(ID), multiaddrs: Addrs.map(addr => src_multiaddr(addr)), protocols: [] })), + providers: (event.Responses || []).map(({ ID, Addrs }) => ({ id: peerIdFromString(ID), multiaddrs: Addrs.map(addr => src_multiaddr(addr)), protocols: [] })) + // TODO: how to infer this from the go-ipfs response + // record: ??? } - - return this; } - get(header, parser) { - header = normalizeHeader(header); - - if (header) { - const key = utils.findKey(this, header); - - if (key) { - const value = this[key]; - - if (!parser) { - return value; - } - - if (parser === true) { - return parseTokens(value); - } - - if (utils.isFunction(parser)) { - return parser.call(this, value, key); - } - - if (utils.isRegExp(parser)) { - return parser.exec(value); - } + if (event.Type === FinalPeer) { + // dht.query ends with a FinalPeer event with no Responses + /** @type {import('../types.js').PeerInfo} */ + let peer = { + // @ts-expect-error go-ipfs does not return this + id: event.ID ?? peerIdFromString(event.ID), + /** @type {Multiaddr[]} */ + multiaddrs: [], + protocols: [] + } - throw new TypeError('parser must be boolean|regexp|function'); + if (event.Responses && event.Responses.length) { + // dht.findPeer has the result in the Responses field + peer = { + id: peerIdFromString(event.Responses[0].ID), + multiaddrs: event.Responses[0].Addrs.map(addr => src_multiaddr(addr)), + protocols: [] } } - } - - has(header, matcher) { - header = normalizeHeader(header); - - if (header) { - const key = utils.findKey(this, header); - return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + return { + name: 'FINAL_PEER', + type: event.Type, + peer } - - return false; } - delete(header, matcher) { - const self = this; - let deleted = false; - - function deleteHeader(_header) { - _header = normalizeHeader(_header); - - if (_header) { - const key = utils.findKey(self, _header); - - if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { - delete self[key]; - - deleted = true; - } - } + if (event.Type === QueryError) { + return { + name: 'QUERY_ERROR', + type: event.Type, + error: new Error(event.Extra) } + } - if (utils.isArray(header)) { - header.forEach(deleteHeader); - } else { - deleteHeader(header); + if (event.Type === Provider) { + return { + name: 'PROVIDER', + type: event.Type, + providers: event.Responses.map(({ ID, Addrs }) => ({ id: peerIdFromString(ID), multiaddrs: Addrs.map(addr => src_multiaddr(addr)), protocols: [] })) } + } - return deleted; + if (event.Type === Value) { + return { + name: 'VALUE', + type: event.Type, + value: dist_src_from_string_fromString(event.Extra, 'base64pad') + } } - clear(matcher) { - const keys = Object.keys(this); - let i = keys.length; - let deleted = false; + if (event.Type === AddingPeer) { + const peers = event.Responses.map(({ ID }) => peerIdFromString(ID)) - while (i--) { - const key = keys[i]; - if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { - delete this[key]; - deleted = true; - } + if (!peers.length) { + throw new Error('No peer found') } - return deleted; + return { + name: 'ADDING_PEER', + type: event.Type, + peer: peers[0] + } } - normalize(format) { - const self = this; - const headers = {}; - - utils.forEach(this, (value, header) => { - const key = utils.findKey(headers, header); + if (event.Type === DialingPeer) { + return { + name: 'DIALING_PEER', + type: event.Type, + peer: peerIdFromString(event.ID) + } + } - if (key) { - self[key] = normalizeValue(value); - delete self[header]; - return; - } + throw new Error('Unknown DHT event type') +} - const normalized = format ? formatHeader(header) : String(header).trim(); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dht/find-peer.js - if (normalized !== header) { - delete self[header]; - } - self[normalized] = normalizeValue(value); - headers[normalized] = true; - }); - return this; - } +const createFindPeer = configure(api => { + /** + * @type {import('../types').DHTAPI["findPeer"]} + */ + async function * findPeer (peerId, options = {}) { + const res = await api.post('dht/findpeer', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: peerId, + ...options + }), + headers: options.headers + }) - concat(...targets) { - return this.constructor.concat(this, ...targets); + for await (const event of res.ndjson()) { + yield mapEvent(event) + } } - toJSON(asStrings) { - const obj = Object.create(null); + return findPeer +}) - utils.forEach(this, (value, header) => { - value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value); - }); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dht/find-provs.js - return obj; - } - [Symbol.iterator]() { - return Object.entries(this.toJSON())[Symbol.iterator](); - } - toString() { - return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); - } - get [Symbol.toStringTag]() { - return 'AxiosHeaders'; - } +const createFindProvs = configure(api => { + /** + * @type {import('../types.js').DHTAPI["findProvs"]} + */ + async function * findProvs (cid, options = {}) { + const res = await api.post('dht/findprovs', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: cid.toString(), + ...options + }), + headers: options.headers + }) - static from(thing) { - return thing instanceof this ? thing : new this(thing); + for await (const event of res.ndjson()) { + yield mapEvent(event) + } } - static concat(first, ...targets) { - const computed = new this(first); + return findProvs +}) - targets.forEach((target) => computed.set(target)); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/node_modules/uint8arrays/dist/src/to-string.js - return computed; - } +/** + * Turns a `Uint8Array` into a string. + * + * Supports `utf8`, `utf-8` and any encoding supported by the multibase module. + * + * Also `ascii` which is similar to node's 'binary' encoding. + */ +function dist_src_to_string_toString(array, encoding = 'utf8') { + const base = dist_src_util_bases[encoding]; + if (base == null) { + throw new Error(`Unsupported encoding "${encoding}"`); + } + if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) { + return globalThis.Buffer.from(array.buffer, array.byteOffset, array.byteLength).toString('utf8'); + } + // strip multibase prefix + return base.encoder.encode(array).substring(1); +} +//# sourceMappingURL=to-string.js.map +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dht/get.js - static accessor(header) { - const internals = this[$internals] = (this[$internals] = { - accessors: {} - }); - const accessors = internals.accessors; - const prototype = this.prototype; - function defineAccessor(_header) { - const lHeader = normalizeHeader(_header); - if (!accessors[lHeader]) { - buildAccessors(prototype, _header); - accessors[lHeader] = true; - } - } - utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); +const dht_get_createGet = configure(api => { + /** + * @type {import('../types').DHTAPI["get"]} + */ + async function * get (key, options = {}) { + const res = await api.post('dht/get', { + signal: options.signal, + searchParams: toUrlSearchParams({ + // arg: base36.encode(key), + arg: key instanceof Uint8Array ? dist_src_to_string_toString(key) : key.toString(), + ...options + }), + headers: options.headers + }) - return this; + for await (const event of res.ndjson()) { + yield mapEvent(event) + } } -} -AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); + return get +}) -// reserved names hotfix -utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => { - let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` - return { - get: () => value, - set(headerValue) { - this[mapped] = headerValue; - } - } -}); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dht/provide.js -utils.freezeMethods(AxiosHeaders); -/* harmony default export */ const core_AxiosHeaders = (AxiosHeaders); -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/core/transformData.js +const createProvide = configure(api => { + /** + * @type {import('../types').DHTAPI["provide"]} + */ + async function * provide (cids, options = { recursive: false }) { + /** @type {import('../types').CID[]} */ + const cidArr = Array.isArray(cids) ? cids : [cids] + + const res = await api.post('dht/provide', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: cidArr.map(cid => cid.toString()), + ...options + }), + headers: options.headers + }) + for await (const event of res.ndjson()) { + yield mapEvent(event) + } + } + return provide +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dht/put.js -/** - * Transform the data for a request or a response - * - * @param {Array|Function} fns A single function or Array of functions - * @param {?Object} response The response object - * - * @returns {*} The resulting transformed data - */ -function transformData(fns, response) { - const config = this || lib_defaults; - const context = response || config; - const headers = core_AxiosHeaders.from(context.headers); - let data = context.data; - utils.forEach(fns, function transform(fn) { - data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); - }); - headers.normalize(); - return data; -} -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/cancel/isCancel.js +const dht_put_createPut = configure(api => { + /** + * @type {import('../types.js').DHTAPI["put"]} + */ + async function * put (key, value, options = {}) { + // allow aborting requests on body errors + const controller = new AbortController() + const signal = abortSignal(controller.signal, options.signal) -function isCancel(value) { - return !!(value && value.__CANCEL__); -} + const res = await api.post('dht/put', { + signal, + searchParams: toUrlSearchParams({ + arg: key instanceof Uint8Array ? dist_src_to_string_toString(key) : key.toString(), + ...options + }), + ...( + await multipart_request_multipartRequest([value], controller, options.headers) + ) + }) -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/cancel/CanceledError.js + for await (const event of res.ndjson()) { + yield mapEvent(event) + } + } + return put +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dht/query.js -/** - * A `CanceledError` is an object that is thrown when an operation is canceled. - * - * @param {string=} message The message. - * @param {Object=} config The config. - * @param {Object=} request The request. - * - * @returns {CanceledError} The created error. - */ -function CanceledError(message, config, request) { - // eslint-disable-next-line no-eq-null,eqeqeq - core_AxiosError.call(this, message == null ? 'canceled' : message, core_AxiosError.ERR_CANCELED, config, request); - this.name = 'CanceledError'; -} -utils.inherits(CanceledError, core_AxiosError, { - __CANCEL__: true -}); +const createQuery = configure(api => { + /** + * @type {import('../types.js').DHTAPI["query"]} + */ + async function * query (peerId, options = {}) { + const res = await api.post('dht/query', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: peerId.toString(), + ...options + }), + headers: options.headers + }) -/* harmony default export */ const cancel_CanceledError = (CanceledError); + for await (const event of res.ndjson()) { + yield mapEvent(event) + } + } -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/core/settle.js + return query +}) + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dht/index.js -/** - * Resolve or reject a Promise based on response status. - * - * @param {Function} resolve A function that resolves the promise. - * @param {Function} reject A function that rejects the promise. - * @param {object} response The response. - * - * @returns {object} The response. - */ -function settle(resolve, reject, response) { - const validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve(response); - } else { - reject(new core_AxiosError( - 'Request failed with status code ' + response.status, - [core_AxiosError.ERR_BAD_REQUEST, core_AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], - response.config, - response.request, - response - )); - } -} -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/isAbsoluteURL.js /** - * Determines whether the specified URL is absolute - * - * @param {string} url The URL to test - * - * @returns {boolean} True if the specified URL is absolute, otherwise false + * @param {import('../types').Options} config */ -function isAbsoluteURL(url) { - // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). - // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed - // by any combination of letters, digits, plus, period, or hyphen. - return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +function createDht (config) { + return { + findPeer: createFindPeer(config), + findProvs: createFindProvs(config), + get: dht_get_createGet(config), + provide: createProvide(config), + put: dht_put_createPut(config), + query: createQuery(config) + } } -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/combineURLs.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/diag/cmds.js -/** - * Creates a new URL by combining the specified URLs - * - * @param {string} baseURL The base URL - * @param {string} relativeURL The relative URL - * - * @returns {string} The combined URL - */ -function combineURLs(baseURL, relativeURL) { - return relativeURL - ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') - : baseURL; -} -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/core/buildFullPath.js +const createCmds = configure(api => { + /** + * @type {import('../types').DiagAPI["cmds"]} + */ + async function cmds (options = {}) { + const res = await api.post('diag/cmds', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers + }) + return res.json() + } + return cmds +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/diag/net.js -/** - * Creates a new URL by combining the baseURL with the requestedURL, - * only when the requestedURL is not already an absolute URL. - * If the requestURL is absolute, this function returns the requestedURL untouched. - * - * @param {string} baseURL The base URL - * @param {string} requestedURL Absolute or relative URL to combine - * - * @returns {string} The combined full path - */ -function buildFullPath(baseURL, requestedURL) { - if (baseURL && !isAbsoluteURL(requestedURL)) { - return combineURLs(baseURL, requestedURL); +const createNet = configure(api => { + /** + * @type {import('../types').DiagAPI["net"]} + */ + async function net (options = {}) { + const res = await api.post('diag/net', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers + }) + return res.json() } - return requestedURL; -} - -// EXTERNAL MODULE: ./node_modules/proxy-from-env/index.js -var proxy_from_env = __nccwpck_require__(72946); -// EXTERNAL MODULE: external "util" -var external_util_ = __nccwpck_require__(73837); -// EXTERNAL MODULE: ./node_modules/follow-redirects/index.js -var follow_redirects = __nccwpck_require__(55213); -// EXTERNAL MODULE: external "zlib" -var external_zlib_ = __nccwpck_require__(59796); -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/env/data.js -const VERSION = "1.6.2"; -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/parseProtocol.js + return net +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/diag/sys.js -function parseProtocol(url) { - const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); - return match && match[1] || ''; -} -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/fromDataURI.js +const createSys = configure(api => { + /** + * @type {import('../types').DiagAPI["sys"]} + */ + async function sys (options = {}) { + const res = await api.post('diag/sys', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers + }) + return res.json() + } + return sys +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/diag/index.js -const DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/; /** - * Parse data uri to a Buffer or Blob - * - * @param {String} uri - * @param {?Boolean} asBlob - * @param {?Object} options - * @param {?Function} options.Blob - * - * @returns {Buffer|Blob} + * @param {import('../types').Options} config */ -function fromDataURI(uri, asBlob, options) { - const _Blob = options && options.Blob || platform.classes.Blob; - const protocol = parseProtocol(uri); - - if (asBlob === undefined && _Blob) { - asBlob = true; +function createDiag (config) { + return { + cmds: createCmds(config), + net: createNet(config), + sys: createSys(config) } +} - if (protocol === 'data') { - uri = protocol.length ? uri.slice(protocol.length + 1) : uri; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/cp.js - const match = DATA_URL_PATTERN.exec(uri); - if (!match) { - throw new core_AxiosError('Invalid URL', core_AxiosError.ERR_INVALID_URL); - } - const mime = match[1]; - const isBase64 = match[2]; - const body = match[3]; - const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8'); - if (asBlob) { - if (!_Blob) { - throw new core_AxiosError('Blob is not supported', core_AxiosError.ERR_NOT_SUPPORT); - } +const createCp = configure(api => { + /** + * @type {import('../types').FilesAPI["cp"]} + */ + async function cp (sources, destination, options = {}) { + /** @type {import('../types').IPFSPath[]} */ + const sourceArr = Array.isArray(sources) ? sources : [sources] - return new _Blob([buffer], {type: mime}); - } + const res = await api.post('files/cp', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: sourceArr.concat(destination).map(src => node_modules_multiformats_src_cid_CID.asCID(src) ? `/ipfs/${src}` : src), + ...options + }), + headers: options.headers + }) - return buffer; + await res.text() } + return cp +}) - throw new core_AxiosError('Unsupported protocol ' + protocol, core_AxiosError.ERR_NOT_SUPPORT); -} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/flush.js -// EXTERNAL MODULE: external "stream" -var external_stream_ = __nccwpck_require__(12781); -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/throttle.js -/** - * Throttle decorator - * @param {Function} fn - * @param {Number} freq - * @return {Function} - */ -function throttle(fn, freq) { - let timestamp = 0; - const threshold = 1000 / freq; - let timer = null; - return function throttled(force, args) { - const now = Date.now(); - if (force || now - timestamp > threshold) { - if (timer) { - clearTimeout(timer); - timer = null; - } - timestamp = now; - return fn.apply(null, args); - } - if (!timer) { - timer = setTimeout(() => { - timer = null; - timestamp = Date.now(); - return fn.apply(null, args); - }, threshold - (now - timestamp)); + +const createFlush = configure(api => { + /** + * @type {import('../types').FilesAPI["flush"]} + */ + async function flush (path, options = {}) { + if (!path || typeof path !== 'string') { + throw new Error('ipfs.files.flush requires a path') } - }; -} -/* harmony default export */ const helpers_throttle = (throttle); + const res = await api.post('files/flush', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: path, + ...options + }), + headers: options.headers + }) + const data = await res.json() -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/speedometer.js + return node_modules_multiformats_src_cid_CID.parse(data.Cid) + } + return flush +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/object-to-camel.js /** - * Calculate data maxRate - * @param {Number} [samplesCount= 10] - * @param {Number} [min= 1000] - * @returns {Function} + * Convert object properties to camel case. + * NOT recursive! + * e.g. + * AgentVersion => agentVersion + * ID => id + * + * @param {Record} obj */ -function speedometer(samplesCount, min) { - samplesCount = samplesCount || 10; - const bytes = new Array(samplesCount); - const timestamps = new Array(samplesCount); - let head = 0; - let tail = 0; - let firstSampleTS; - - min = min !== undefined ? min : 1000; +function objectToCamel (obj) { + if (obj == null) { + return obj + } - return function push(chunkLength) { - const now = Date.now(); + const caps = /^[A-Z]+$/ - const startedAt = timestamps[tail]; + /** @type {Record} */ + const output = {} - if (!firstSampleTS) { - firstSampleTS = now; + return Object.keys(obj).reduce((camelObj, k) => { + if (caps.test(k)) { // all caps + camelObj[k.toLowerCase()] = obj[k] + } else if (caps.test(k[0])) { // pascal + camelObj[k[0].toLowerCase() + k.slice(1)] = obj[k] + } else { + camelObj[k] = obj[k] } + return camelObj + }, output) +} - bytes[head] = chunkLength; - timestamps[head] = now; - - let i = tail; - let bytesCount = 0; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/object-to-camel-with-metadata.js - while (i !== head) { - bytesCount += bytes[i++]; - i = i % samplesCount; - } - head = (head + 1) % samplesCount; +/** + * @param {Record} entry + */ +function objectToCamelWithMetadata (entry) { + const file = objectToCamel(entry) - if (head === tail) { - tail = (tail + 1) % samplesCount; - } + if (Object.prototype.hasOwnProperty.call(file, 'mode')) { + file.mode = parseInt(file.mode, 8) + } - if (now - firstSampleTS < min) { - return; + if (Object.prototype.hasOwnProperty.call(file, 'mtime')) { + file.mtime = { + secs: file.mtime, + nsecs: file.mtimeNsecs || 0 } - const passed = startedAt && now - startedAt; + delete file.mtimeNsecs + } - return passed ? Math.round(bytesCount * 1000 / passed) : undefined; - }; + return file } -/* harmony default export */ const helpers_speedometer = (speedometer); - -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/AxiosTransformStream.js - - +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/ls.js -const kInternals = Symbol('internals'); +const createLs = configure(api => { + /** + * @type {import('../types').FilesAPI["ls"]} + */ + async function * ls (path, options = {}) { + if (!path) { + throw new Error('ipfs.files.ls requires a path') + } -class AxiosTransformStream extends external_stream_.Transform{ - constructor(options) { - options = utils.toFlatObject(options, { - maxRate: 0, - chunkSize: 64 * 1024, - minChunkSize: 100, - timeWindow: 500, - ticksRate: 2, - samplesCount: 15 - }, null, (prop, source) => { - return !utils.isUndefined(source[prop]); - }); + const res = await api.post('files/ls', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: node_modules_multiformats_src_cid_CID.asCID(path) ? `/ipfs/${path}` : path, + // default long to true, diverges from go-ipfs where its false by default + long: true, + ...options, + stream: true + }), + headers: options.headers + }) - super({ - readableHighWaterMark: options.chunkSize - }); + for await (const result of res.ndjson()) { + // go-ipfs does not yet support the "stream" option + if ('Entries' in result) { + for (const entry of result.Entries || []) { + yield ls_toCoreInterface(objectToCamelWithMetadata(entry)) + } + } else { + yield ls_toCoreInterface(objectToCamelWithMetadata(result)) + } + } + } + return ls +}) - const self = this; +/** + * @param {*} entry + */ +function ls_toCoreInterface (entry) { + if (entry.hash) { + entry.cid = node_modules_multiformats_src_cid_CID.parse(entry.hash) + } - const internals = this[kInternals] = { - length: options.length, - timeWindow: options.timeWindow, - ticksRate: options.ticksRate, - chunkSize: options.chunkSize, - maxRate: options.maxRate, - minChunkSize: options.minChunkSize, - bytesSeen: 0, - isCaptured: false, - notifiedBytesLoaded: 0, - ts: Date.now(), - bytes: 0, - onReadCallback: null - }; + delete entry.hash - const _speedometer = helpers_speedometer(internals.ticksRate * options.samplesCount, internals.timeWindow); + entry.type = entry.type === 1 ? 'directory' : 'file' - this.on('newListener', event => { - if (event === 'progress') { - if (!internals.isCaptured) { - internals.isCaptured = true; - } - } - }); + return entry +} - let bytesNotified = 0; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/mkdir.js - internals.updateProgress = helpers_throttle(function throttledHandler() { - const totalBytes = internals.length; - const bytesTransferred = internals.bytesSeen; - const progressBytes = bytesTransferred - bytesNotified; - if (!progressBytes || self.destroyed) return; - const rate = _speedometer(progressBytes); - bytesNotified = bytesTransferred; +const createMkdir = configure(api => { + /** + * @type {import('../types').FilesAPI["mkdir"]} + */ + async function mkdir (path, options = {}) { + const res = await api.post('files/mkdir', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: path, + ...options + }), + headers: options.headers + }) - process.nextTick(() => { - self.emit('progress', { - 'loaded': bytesTransferred, - 'total': totalBytes, - 'progress': totalBytes ? (bytesTransferred / totalBytes) : undefined, - 'bytes': progressBytes, - 'rate': rate ? rate : undefined, - 'estimated': rate && totalBytes && bytesTransferred <= totalBytes ? - (totalBytes - bytesTransferred) / rate : undefined - }); - }); - }, internals.ticksRate); + await res.text() + } + return mkdir +}) - const onFinish = () => { - internals.updateProgress(true); - }; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/mv.js - this.once('end', onFinish); - this.once('error', onFinish); - } - _read(size) { - const internals = this[kInternals]; - if (internals.onReadCallback) { - internals.onReadCallback(); +const createMv = configure(api => { + /** + * @type {import('../types').FilesAPI["mv"]} + */ + async function mv (sources, destination, options = {}) { + if (!Array.isArray(sources)) { + sources = [sources] } - return super._read(size); + const res = await api.post('files/mv', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: sources.concat(destination), + ...options + }), + headers: options.headers + }) + await res.text() } - _transform(chunk, encoding, callback) { - const self = this; - const internals = this[kInternals]; - const maxRate = internals.maxRate; - - const readableHighWaterMark = this.readableHighWaterMark; + return mv +}) - const timeWindow = internals.timeWindow; +// EXTERNAL MODULE: ./node_modules/stream-to-it/source.js +var source = __nccwpck_require__(76051); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/read.js - const divider = 1000 / timeWindow; - const bytesThreshold = (maxRate / divider); - const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0; - function pushChunk(_chunk, _callback) { - const bytes = Buffer.byteLength(_chunk); - internals.bytesSeen += bytes; - internals.bytes += bytes; +// @ts-expect-error no types - if (internals.isCaptured) { - internals.updateProgress(); - } - if (self.push(_chunk)) { - process.nextTick(_callback); - } else { - internals.onReadCallback = () => { - internals.onReadCallback = null; - process.nextTick(_callback); - }; - } - } +const createRead = configure(api => { + /** + * @type {import('../types').FilesAPI["read"]} + */ + async function * read (path, options = {}) { + const res = await api.post('files/read', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: path, + count: options.length, + ...options + }), + headers: options.headers + }) - const transformChunk = (_chunk, _callback) => { - const chunkSize = Buffer.byteLength(_chunk); - let chunkRemainder = null; - let maxChunkSize = readableHighWaterMark; - let bytesLeft; - let passed = 0; + yield * source(res.body) + } + return read +}) - if (maxRate) { - const now = Date.now(); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/rm.js - if (!internals.ts || (passed = (now - internals.ts)) >= timeWindow) { - internals.ts = now; - bytesLeft = bytesThreshold - internals.bytes; - internals.bytes = bytesLeft < 0 ? -bytesLeft : 0; - passed = 0; - } - bytesLeft = bytesThreshold - internals.bytes; - } - if (maxRate) { - if (bytesLeft <= 0) { - // next time window - return setTimeout(() => { - _callback(null, _chunk); - }, timeWindow - passed); - } - if (bytesLeft < maxChunkSize) { - maxChunkSize = bytesLeft; - } - } +const files_rm_createRm = configure(api => { + /** + * @type {import('../types').FilesAPI["rm"]} + */ + async function rm (path, options = {}) { + const res = await api.post('files/rm', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: path, + ...options + }), + headers: options.headers + }) - if (maxChunkSize && chunkSize > maxChunkSize && (chunkSize - maxChunkSize) > minChunkSize) { - chunkRemainder = _chunk.subarray(maxChunkSize); - _chunk = _chunk.subarray(0, maxChunkSize); - } + const body = await res.text() + // we don't expect text body to be ever present + // (if so, it means an error such as https://github.com/ipfs/go-ipfs/issues/8606) + if (body !== '') { + /** @type {Error} */ + const error = new http.HTTPError(res) + error.message = body + throw error + } + } + return rm +}) - pushChunk(_chunk, chunkRemainder ? () => { - process.nextTick(_callback, null, chunkRemainder); - } : _callback); - }; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/stat.js - transformChunk(chunk, function transformNextChunk(err, _chunk) { - if (err) { - return callback(err); - } - if (_chunk) { - transformChunk(_chunk, transformNextChunk); - } else { - callback(null); - } - }); - } - setLength(length) { - this[kInternals].length = +length; - return this; - } -} -/* harmony default export */ const helpers_AxiosTransformStream = (AxiosTransformStream); -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/readBlob.js -const {asyncIterator} = Symbol; +const files_stat_createStat = configure(api => { + /** + * @type {import('../types').FilesAPI["stat"]} + */ + async function stat (path, options = {}) { + const res = await api.post('files/stat', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: path, + ...options + }), + headers: options.headers + }) + const data = await res.json() -const readBlob = async function* (blob) { - if (blob.stream) { - yield* blob.stream() - } else if (blob.arrayBuffer) { - yield await blob.arrayBuffer() - } else if (blob[asyncIterator]) { - yield* blob[asyncIterator](); - } else { - yield blob; + data.WithLocality = data.WithLocality || false + return stat_toCoreInterface(objectToCamelWithMetadata(data)) } + return stat +}) + +/** + * @param {*} entry + */ +function stat_toCoreInterface (entry) { + entry.cid = node_modules_multiformats_src_cid_CID.parse(entry.hash) + delete entry.hash + return entry } -/* harmony default export */ const helpers_readBlob = (readBlob); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/write.js -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/formDataToStream.js -const BOUNDARY_ALPHABET = utils.ALPHABET.ALPHA_DIGIT + '-_'; -const formDataToStream_textEncoder = new external_util_.TextEncoder(); +const createWrite = configure(api => { + /** + * @type {import('../types').FilesAPI["write"]} + */ + async function write (path, input, options = {}) { + // allow aborting requests on body errors + const controller = new AbortController() + const signal = abortSignal(controller.signal, options.signal) -const CRLF = '\r\n'; -const CRLF_BYTES = formDataToStream_textEncoder.encode(CRLF); -const CRLF_BYTES_COUNT = 2; + const res = await api.post('files/write', { + signal, + searchParams: toUrlSearchParams({ + arg: path, + streamChannels: true, + count: options.length, + ...options + }), + ...( + await multipart_request_multipartRequest([{ + content: input, + path: 'arg', + mode: modeToString(options.mode), + mtime: parseMtime(options.mtime) + }], controller, options.headers) + ) + }) -class FormDataPart { - constructor(name, value) { - const {escapeName} = this.constructor; - const isStringValue = utils.isString(value); + await res.text() + } + return write +}) - let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${ - !isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : '' - }${CRLF}`; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/files/index.js - if (isStringValue) { - value = formDataToStream_textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF)); - } else { - headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}` - } - this.headers = formDataToStream_textEncoder.encode(headers + CRLF); - this.contentLength = isStringValue ? value.byteLength : value.size; - this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT; - this.name = name; - this.value = value; - } - async *encode(){ - yield this.headers; - const {value} = this; - if(utils.isTypedArray(value)) { - yield value; - } else { - yield* helpers_readBlob(value); - } - yield CRLF_BYTES; - } - static escapeName(name) { - return String(name).replace(/[\r\n"]/g, (match) => ({ - '\r' : '%0D', - '\n' : '%0A', - '"' : '%22', - }[match])); +/** + * @param {import('../types').Options} config + */ +function createFiles (config) { + return { + cp: createCp(config), + flush: createFlush(config), + ls: createLs(config), + mkdir: createMkdir(config), + mv: createMv(config), + read: createRead(config), + rm: files_rm_createRm(config), + stat: files_stat_createStat(config), + write: createWrite(config) } } -const formDataToStream = (form, headersHandler, options) => { - const { - tag = 'form-data-boundary', - size = 25, - boundary = tag + '-' + utils.generateString(size, BOUNDARY_ALPHABET) - } = options || {}; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/key/export.js - if(!utils.isFormData(form)) { - throw TypeError('FormData instance required'); - } - if (boundary.length < 1 || boundary.length > 70) { - throw Error('boundary must be 10-70 characters long') + +const export_createExport = configure(api => { + /** + * @type {import('./types.js').KeyAPI['export']} + */ + const exportKey = async (name, password, options = {}) => { + throw err_code(new Error('Not implemented'), 'ERR_NOT_IMPLEMENTED') } - const boundaryBytes = formDataToStream_textEncoder.encode('--' + boundary + CRLF); - const footerBytes = formDataToStream_textEncoder.encode('--' + boundary + '--' + CRLF + CRLF); - let contentLength = footerBytes.byteLength; + return exportKey +}) - const parts = Array.from(form.entries()).map(([name, value]) => { - const part = new FormDataPart(name, value); - contentLength += part.size; - return part; - }); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/key/gen.js - contentLength += boundaryBytes.byteLength * parts.length; - contentLength = utils.toFiniteNumber(contentLength); - const computedHeaders = { - 'Content-Type': `multipart/form-data; boundary=${boundary}` - } - if (Number.isFinite(contentLength)) { - computedHeaders['Content-Length'] = contentLength; +/** @type {import('./types.js').GenOptions} */ +const defaultOptions = { + type: 'ed25519' +} + +const createGen = configure(api => { + /** + * @type {import('./types.js').KeyAPI['gen']} + */ + async function gen (name, options = defaultOptions) { + const res = await api.post('key/gen', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: name, + ...options + }), + headers: options.headers + }) + const data = await res.json() + + // @ts-expect-error server output is not typed + return objectToCamel(data) } + return gen +}) - headersHandler && headersHandler(computedHeaders); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/key/import.js - return external_stream_.Readable.from((async function *() { - for(const part of parts) { - yield boundaryBytes; - yield* part.encode(); - } - yield footerBytes; - })()); -}; -/* harmony default export */ const helpers_formDataToStream = (formDataToStream); -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +const import_createImport = configure(api => { + /** + * @type {import('./types.js').KeyAPI['import']} + */ + async function importKey (name, pem, password, options = {}) { + const res = await api.post('key/import', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: name, + pem, + password, + ...options + }), + headers: options.headers + }) + const data = await res.json() + // @ts-expect-error server output is not typed + return objectToCamel(data) + } + return importKey +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/key/list.js -class ZlibHeaderTransformStream extends external_stream_.Transform { - __transform(chunk, encoding, callback) { - this.push(chunk); - callback(); - } - _transform(chunk, encoding, callback) { - if (chunk.length !== 0) { - this._transform = this.__transform; - // Add Default Compression headers if no zlib headers are present - if (chunk[0] !== 120) { // Hex: 78 - const header = Buffer.alloc(2); - header[0] = 120; // Hex: 78 - header[1] = 156; // Hex: 9C - this.push(header, encoding); - } - } +const list_createList = configure(api => { + /** + * @type {import('../types.js').KeyAPI["list"]} + */ + async function list (options = {}) { + const res = await api.post('key/list', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers + }) + const data = await res.json() - this.__transform(chunk, encoding, callback); + return (data.Keys || []).map((/** @type {any} **/ k) => objectToCamel(k)) } -} + return list +}) -/* harmony default export */ const helpers_ZlibHeaderTransformStream = (ZlibHeaderTransformStream); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/key/rename.js -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/callbackify.js -const callbackify = (fn, reducer) => { - return utils.isAsyncFn(fn) ? function (...args) { - const cb = args.pop(); - fn.apply(this, args).then((value) => { - try { - reducer ? cb(null, ...reducer(value)) : cb(null, value); - } catch (err) { - cb(err); - } - }, cb); - } : fn; -} -/* harmony default export */ const helpers_callbackify = (callbackify); +const createRename = configure(api => { + /** + * @type {import('./types.js').KeyAPI['rename']} + */ + async function rename (oldName, newName, options = {}) { + const res = await api.post('key/rename', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: [ + oldName, + newName + ], + ...options + }), + headers: options.headers + }) -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/adapters/http.js + // @ts-expect-error server output is not typed + return objectToCamel(await res.json()) + } + return rename +}) + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/key/rm.js +const key_rm_createRm = configure(api => { + /** + * @type {import('../types').KeyAPI["rm"]} + */ + async function rm (name, options = {}) { + const res = await api.post('key/rm', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: name, + ...options + }), + headers: options.headers + }) + const data = await res.json() + // @ts-expect-error server output is not typed + return objectToCamel(data.Keys[0]) + } + return rm +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/key/index.js @@ -242471,796 +166777,590 @@ const callbackify = (fn, reducer) => { +/** + * @param {import('../types.js').Options} config + * @returns {import('./types.js').KeyAPI} + */ +function createKey (config) { + return { + export: export_createExport(config), + gen: createGen(config), + import: import_createImport(config), + list: list_createList(config), + rename: createRename(config), + rm: key_rm_createRm(config) + } +} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/log/level.js +const createLevel = configure(api => { + /** + * @type {import('../types').LogAPI["level"]} + */ + async function level (subsystem, level, options = {}) { + const res = await api.post('log/level', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: [ + subsystem, + level + ], + ...options + }), + headers: options.headers + }) + return objectToCamel(await res.json()) + } + return level +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/log/ls.js +const ls_createLs = configure(api => { + /** + * @type {import('../types').LogAPI["ls"]} + */ + async function ls (options = {}) { + const res = await api.post('log/ls', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers + }) + const data = await res.json() + return data.Strings + } + return ls +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/log/tail.js -const zlibOptions = { - flush: external_zlib_.constants.Z_SYNC_FLUSH, - finishFlush: external_zlib_.constants.Z_SYNC_FLUSH -}; -const brotliOptions = { - flush: external_zlib_.constants.BROTLI_OPERATION_FLUSH, - finishFlush: external_zlib_.constants.BROTLI_OPERATION_FLUSH -} +const createTail = configure(api => { + /** + * @type {import('../types').LogAPI["tail"]} + */ + async function * tail (options = {}) { + const res = await api.post('log/tail', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers + }) -const isBrotliSupported = utils.isFunction(external_zlib_.createBrotliDecompress); + yield * res.ndjson() + } + return tail +}) -const {http: httpFollow, https: httpsFollow} = follow_redirects; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/log/index.js -const isHttps = /https:?/; -const supportedProtocols = platform.protocols.map(protocol => { - return protocol + ':'; -}); -/** - * If the proxy or config beforeRedirects functions are defined, call them with the options - * object. - * - * @param {Object} options - The options object that was passed to the request. - * - * @returns {Object} - */ -function dispatchBeforeRedirect(options) { - if (options.beforeRedirects.proxy) { - options.beforeRedirects.proxy(options); - } - if (options.beforeRedirects.config) { - options.beforeRedirects.config(options); - } -} /** - * If the proxy or config afterRedirects functions are defined, call them with the options - * - * @param {http.ClientRequestArgs} options - * @param {AxiosProxyConfig} configProxy configuration from Axios options object - * @param {string} location - * - * @returns {http.ClientRequestArgs} + * @param {import('../types').Options} config */ -function setProxy(options, configProxy, location) { - let proxy = configProxy; - if (!proxy && proxy !== false) { - const proxyUrl = (0,proxy_from_env/* getProxyForUrl */.j)(location); - if (proxyUrl) { - proxy = new URL(proxyUrl); - } - } - if (proxy) { - // Basic proxy authorization - if (proxy.username) { - proxy.auth = (proxy.username || '') + ':' + (proxy.password || ''); - } - - if (proxy.auth) { - // Support proxy auth object form - if (proxy.auth.username || proxy.auth.password) { - proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || ''); - } - const base64 = Buffer - .from(proxy.auth, 'utf8') - .toString('base64'); - options.headers['Proxy-Authorization'] = 'Basic ' + base64; - } - - options.headers.host = options.hostname + (options.port ? ':' + options.port : ''); - const proxyHost = proxy.hostname || proxy.host; - options.hostname = proxyHost; - // Replace 'host' since options is not a URL object - options.host = proxyHost; - options.port = proxy.port; - options.path = location; - if (proxy.protocol) { - options.protocol = proxy.protocol.includes(':') ? proxy.protocol : `${proxy.protocol}:`; - } +function createLog (config) { + return { + level: createLevel(config), + ls: ls_createLs(config), + tail: createTail(config) } - - options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) { - // Configure proxy for redirected request, passing the original config proxy to apply - // the exact same logic as if the redirected request was performed by axios directly. - setProxy(redirectOptions, configProxy, redirectOptions.href); - }; } -const isHttpAdapterSupported = typeof process !== 'undefined' && utils.kindOf(process) === 'process'; - -// temporary hotfix - -const wrapAsync = (asyncExecutor) => { - return new Promise((resolve, reject) => { - let onDone; - let isDone; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/name/publish.js - const done = (value, isRejected) => { - if (isDone) return; - isDone = true; - onDone && onDone(value, isRejected); - } - const _resolve = (value) => { - done(value); - resolve(value); - }; - const _reject = (reason) => { - done(reason, true); - reject(reason); - } - asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject); - }) -}; +/** + * @param {import('../types').Options} config + * @returns {import('../types').IPFS['publish']} + */ +const createPublish = configure(api => { + /** + * @type {import('../types.js').NameAPI["publish"]} + */ + async function publish (path, options = {}) { + const res = await api.post('name/publish', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: `${path}`, + ...options + }), + headers: options.headers + }) -const resolveFamily = ({address, family}) => { - if (!utils.isString(address)) { - throw TypeError('address must be a string'); + // @ts-expect-error server output is not typed + return objectToCamel(await res.json()) } - return ({ - address, - family: family || (address.indexOf('.') < 0 ? 6 : 4) - }); -} - -const buildAddressEntry = (address, family) => resolveFamily(utils.isObject(address) ? address : {address, family}); - -/*eslint consistent-return:0*/ -/* harmony default export */ const adapters_http = (isHttpAdapterSupported && function httpAdapter(config) { - return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) { - let {data, lookup, family} = config; - const {responseType, responseEncoding} = config; - const method = config.method.toUpperCase(); - let isDone; - let rejected = false; - let req; - - if (lookup) { - const _lookup = helpers_callbackify(lookup, (value) => utils.isArray(value) ? value : [value]); - // hotfix to support opt.all option which is required for node 20.x - lookup = (hostname, opt, cb) => { - _lookup(hostname, opt, (err, arg0, arg1) => { - const addresses = utils.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)]; - - opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family); - }); - } - } - - // temporary internal emitter until the AxiosRequest class will be implemented - const emitter = new external_events_(); + return publish +}) - const onFinished = () => { - if (config.cancelToken) { - config.cancelToken.unsubscribe(abort); - } +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/name/resolve.js - if (config.signal) { - config.signal.removeEventListener('abort', abort); - } - emitter.removeAllListeners(); - } - onDone((value, isRejected) => { - isDone = true; - if (isRejected) { - rejected = true; - onFinished(); - } - }); +const resolve_createResolve = configure(api => { + /** + * @type {import('../types').NameAPI["resolve"]} + */ + async function * resolve (path, options = {}) { + const res = await api.post('name/resolve', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: path, + stream: true, + ...options + }), + headers: options.headers + }) - function abort(reason) { - emitter.emit('abort', !reason || reason.type ? new cancel_CanceledError(null, config, req) : reason); + for await (const result of res.ndjson()) { + yield result.Path } + } + return resolve +}) - emitter.once('abort', reject); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/name/pubsub/cancel.js - if (config.cancelToken || config.signal) { - config.cancelToken && config.cancelToken.subscribe(abort); - if (config.signal) { - config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort); - } - } - // Parse url - const fullPath = buildFullPath(config.baseURL, config.url); - const parsed = new URL(fullPath, 'http://localhost'); - const protocol = parsed.protocol || supportedProtocols[0]; - if (protocol === 'data:') { - let convertedData; - if (method !== 'GET') { - return settle(resolve, reject, { - status: 405, - statusText: 'method not allowed', - headers: {}, - config - }); - } +/** + * @param {import('../../types').Options} config + * @returns {import('../../types').NamePubsubAPI["cancel"]} + */ +const createCancel = configure(api => { + /** + * @type {import('../../types').NamePubsubAPI["cancel"]} + */ + async function cancel (name, options = {}) { + const res = await api.post('name/pubsub/cancel', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: name, + ...options + }), + headers: options.headers + }) - try { - convertedData = fromDataURI(config.url, responseType === 'blob', { - Blob: config.env && config.env.Blob - }); - } catch (err) { - throw core_AxiosError.from(err, core_AxiosError.ERR_BAD_REQUEST, config); - } + // @ts-expect-error server output is not typed + return objectToCamel(await res.json()) + } + return cancel +}) - if (responseType === 'text') { - convertedData = convertedData.toString(responseEncoding); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/name/pubsub/state.js - if (!responseEncoding || responseEncoding === 'utf8') { - convertedData = utils.stripBOM(convertedData); - } - } else if (responseType === 'stream') { - convertedData = external_stream_.Readable.from(convertedData); - } - return settle(resolve, reject, { - data: convertedData, - status: 200, - statusText: 'OK', - headers: new core_AxiosHeaders(), - config - }); - } - if (supportedProtocols.indexOf(protocol) === -1) { - return reject(new core_AxiosError( - 'Unsupported protocol ' + protocol, - core_AxiosError.ERR_BAD_REQUEST, - config - )); - } - const headers = core_AxiosHeaders.from(config.headers).normalize(); +const createState = configure(api => { + /** + * @type {import('../../types').NamePubsubAPI["state"]} + */ + async function state (options = {}) { + const res = await api.post('name/pubsub/state', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers + }) - // Set User-Agent (required by some servers) - // See https://github.com/axios/axios/issues/69 - // User-Agent is specified; handle case where no UA header is desired - // Only set header if it hasn't been set in config - headers.set('User-Agent', 'axios/' + VERSION, false); + // @ts-expect-error server output is not typed + return objectToCamel(await res.json()) + } + return state +}) - const onDownloadProgress = config.onDownloadProgress; - const onUploadProgress = config.onUploadProgress; - const maxRate = config.maxRate; - let maxUploadRate = undefined; - let maxDownloadRate = undefined; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/name/pubsub/subs.js - // support for spec compliant FormData objects - if (utils.isSpecCompliantForm(data)) { - const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i); - data = helpers_formDataToStream(data, (formHeaders) => { - headers.set(formHeaders); - }, { - tag: `axios-${VERSION}-boundary`, - boundary: userBoundary && userBoundary[1] || undefined - }); - // support for https://www.npmjs.com/package/form-data api - } else if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) { - headers.set(data.getHeaders()); - if (!headers.hasContentLength()) { - try { - const knownLength = await external_util_.promisify(data.getLength).call(data); - Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength); - /*eslint no-empty:0*/ - } catch (e) { - } - } - } else if (utils.isBlob(data)) { - data.size && headers.setContentType(data.type || 'application/octet-stream'); - headers.setContentLength(data.size || 0); - data = external_stream_.Readable.from(helpers_readBlob(data)); - } else if (data && !utils.isStream(data)) { - if (Buffer.isBuffer(data)) { - // Nothing to do... - } else if (utils.isArrayBuffer(data)) { - data = Buffer.from(new Uint8Array(data)); - } else if (utils.isString(data)) { - data = Buffer.from(data, 'utf-8'); - } else { - return reject(new core_AxiosError( - 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', - core_AxiosError.ERR_BAD_REQUEST, - config - )); - } +const createSubs = configure(api => { + /** + * @type {import('../../types').NamePubsubAPI["subs"]} + */ + async function subs (options = {}) { + const res = await api.post('name/pubsub/subs', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers + }) + const data = await res.json() - // Add Content-Length header if data exists - headers.setContentLength(data.length, false); + return data.Strings || [] + } + return subs +}) - if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { - return reject(new core_AxiosError( - 'Request body larger than maxBodyLength limit', - core_AxiosError.ERR_BAD_REQUEST, - config - )); - } - } +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/name/pubsub/index.js - const contentLength = utils.toFiniteNumber(headers.getContentLength()); - if (utils.isArray(maxRate)) { - maxUploadRate = maxRate[0]; - maxDownloadRate = maxRate[1]; - } else { - maxUploadRate = maxDownloadRate = maxRate; - } - if (data && (onUploadProgress || maxUploadRate)) { - if (!utils.isStream(data)) { - data = external_stream_.Readable.from(data, {objectMode: false}); - } - data = external_stream_.pipeline([data, new helpers_AxiosTransformStream({ - length: contentLength, - maxRate: utils.toFiniteNumber(maxUploadRate) - })], utils.noop); +/** + * @param {import('../../types').Options} config + * @returns {import('../../types').NamePubsubAPI} + */ +function createPubsub (config) { + return { + cancel: createCancel(config), + state: createState(config), + subs: createSubs(config) + } +} - onUploadProgress && data.on('progress', progress => { - onUploadProgress(Object.assign(progress, { - upload: true - })); - }); - } +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/name/index.js - // HTTP basic authentication - let auth = undefined; - if (config.auth) { - const username = config.auth.username || ''; - const password = config.auth.password || ''; - auth = username + ':' + password; - } - if (!auth && parsed.username) { - const urlUsername = parsed.username; - const urlPassword = parsed.password; - auth = urlUsername + ':' + urlPassword; - } - auth && headers.delete('authorization'); - let path; +/** + * @param {import('../types').Options} config + * @returns {import('../types').IPFS['name']} + */ +function createName (config) { + return { + publish: createPublish(config), + resolve: resolve_createResolve(config), + pubsub: createPubsub(config) + } +} - try { - path = buildURL( - parsed.pathname + parsed.search, - config.params, - config.paramsSerializer - ).replace(/^\?/, ''); - } catch (err) { - const customErr = new Error(err.message); - customErr.config = config; - customErr.url = config.url; - customErr.exists = true; - return reject(customErr); - } +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/data.js - headers.set( - 'Accept-Encoding', - 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false - ); - const options = { - path, - method: method, - headers: headers.toJSON(), - agents: { http: config.httpAgent, https: config.httpsAgent }, - auth, - protocol, - family, - beforeRedirect: dispatchBeforeRedirect, - beforeRedirects: {} - }; - // cacheable-lookup integration hotfix - !utils.isUndefined(lookup) && (options.lookup = lookup); - if (config.socketPath) { - options.socketPath = config.socketPath; - } else { - options.hostname = parsed.hostname; - options.port = parsed.port; - setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); - } +const createData = configure(api => { + /** + * @type {import('../types').ObjectAPI["data"]} + */ + async function data (cid, options = {}) { + const res = await api.post('object/data', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: `${cid instanceof Uint8Array ? node_modules_multiformats_src_cid_CID.decode(cid) : cid}`, + ...options + }), + headers: options.headers + }) + const data = await res.arrayBuffer() - let transport; - const isHttpsRequest = isHttps.test(options.protocol); - options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; - if (config.transport) { - transport = config.transport; - } else if (config.maxRedirects === 0) { - transport = isHttpsRequest ? external_https_ : external_http_; - } else { - if (config.maxRedirects) { - options.maxRedirects = config.maxRedirects; - } - if (config.beforeRedirect) { - options.beforeRedirects.config = config.beforeRedirect; - } - transport = isHttpsRequest ? httpsFollow : httpFollow; - } + return new Uint8Array(data, 0, data.byteLength) + } + return data +}) - if (config.maxBodyLength > -1) { - options.maxBodyLength = config.maxBodyLength; - } else { - // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited - options.maxBodyLength = Infinity; - } +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/get.js - if (config.insecureHTTPParser) { - options.insecureHTTPParser = config.insecureHTTPParser; - } - // Create the request - req = transport.request(options, function handleResponse(res) { - if (req.destroyed) return; - const streams = [res]; - const responseLength = +res.headers['content-length']; - if (onDownloadProgress) { - const transformStream = new helpers_AxiosTransformStream({ - length: utils.toFiniteNumber(responseLength), - maxRate: utils.toFiniteNumber(maxDownloadRate) - }); +const object_get_createGet = configure(api => { + /** + * @type {import('../types').ObjectAPI["get"]} + */ + async function get (cid, options = {}) { + const res = await api.post('object/get', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: `${cid instanceof Uint8Array ? node_modules_multiformats_src_cid_CID.decode(cid) : cid}`, + dataEncoding: 'base64', + ...options + }), + headers: options.headers + }) + const data = await res.json() - onDownloadProgress && transformStream.on('progress', progress => { - onDownloadProgress(Object.assign(progress, { - download: true - })); - }); + return { + Data: dist_src_from_string_fromString(data.Data, 'base64pad'), + Links: (data.Links || []).map((/** @type {any} */ link) => ({ + Name: link.Name, + Hash: node_modules_multiformats_src_cid_CID.parse(link.Hash), + Tsize: link.Size + })) + } + } + return get +}) - streams.push(transformStream); - } +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/links.js - // decompress the response body transparently if required - let responseStream = res; - // return the last request in case of redirects - const lastRequest = res.req || req; - // if decompress disabled we should not decompress - if (config.decompress !== false && res.headers['content-encoding']) { - // if no content, but headers still say that it is encoded, - // remove the header not confuse downstream operations - if (method === 'HEAD' || res.statusCode === 204) { - delete res.headers['content-encoding']; - } - switch ((res.headers['content-encoding'] || '').toLowerCase()) { - /*eslint default-case:0*/ - case 'gzip': - case 'x-gzip': - case 'compress': - case 'x-compress': - // add the unzipper to the body stream processing pipeline - streams.push(external_zlib_.createUnzip(zlibOptions)); +const createLinks = configure(api => { + /** + * @type {import('../types').ObjectAPI["links"]} + */ + async function links (cid, options = {}) { + const res = await api.post('object/links', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: `${cid instanceof Uint8Array ? node_modules_multiformats_src_cid_CID.decode(cid) : cid}`, + ...options + }), + headers: options.headers + }) + const data = await res.json() - // remove the content-encoding in order to not confuse downstream operations - delete res.headers['content-encoding']; - break; - case 'deflate': - streams.push(new helpers_ZlibHeaderTransformStream()); + return (data.Links || []).map((/** @type {any} */ l) => ({ + Name: l.Name, + Tsize: l.Size, + Hash: node_modules_multiformats_src_cid_CID.parse(l.Hash) + })) + } + return links +}) - // add the unzipper to the body stream processing pipeline - streams.push(external_zlib_.createUnzip(zlibOptions)); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/new.js - // remove the content-encoding in order to not confuse downstream operations - delete res.headers['content-encoding']; - break; - case 'br': - if (isBrotliSupported) { - streams.push(external_zlib_.createBrotliDecompress(brotliOptions)); - delete res.headers['content-encoding']; - } - } - } - responseStream = streams.length > 1 ? external_stream_.pipeline(streams, utils.noop) : streams[0]; - const offListeners = external_stream_.finished(responseStream, () => { - offListeners(); - onFinished(); - }); - const response = { - status: res.statusCode, - statusText: res.statusMessage, - headers: new core_AxiosHeaders(res.headers), - config, - request: lastRequest - }; +const createNew = configure(api => { + /** + * @type {import('../types').ObjectAPI["new"]} + */ + async function newObject (options = {}) { + const res = await api.post('object/new', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: options.template, + ...options + }), + headers: options.headers + }) - if (responseType === 'stream') { - response.data = responseStream; - settle(resolve, reject, response); - } else { - const responseBuffer = []; - let totalResponseBytes = 0; + const { Hash } = await res.json() - responseStream.on('data', function handleStreamData(chunk) { - responseBuffer.push(chunk); - totalResponseBytes += chunk.length; + return node_modules_multiformats_src_cid_CID.parse(Hash) + } + return newObject +}) - // make sure the content length is not over the maxContentLength if specified - if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { - // stream.destroy() emit aborted event before calling reject() on Node.js v16 - rejected = true; - responseStream.destroy(); - reject(new core_AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', - core_AxiosError.ERR_BAD_RESPONSE, config, lastRequest)); - } - }); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/put.js - responseStream.on('aborted', function handlerStreamAborted() { - if (rejected) { - return; - } - const err = new core_AxiosError( - 'maxContentLength size of ' + config.maxContentLength + ' exceeded', - core_AxiosError.ERR_BAD_RESPONSE, - config, - lastRequest - ); - responseStream.destroy(err); - reject(err); - }); - responseStream.on('error', function handleStreamError(err) { - if (req.destroyed) return; - reject(core_AxiosError.from(err, null, config, lastRequest)); - }); +/** + * @param {import('../types').Multicodecs} codecs + * @param {import('../types').Options} options + */ +const object_put_createPut = (codecs, options) => { + const fn = configure((api) => { + const dagPut = put_createPut(codecs, options) - responseStream.on('end', function handleStreamEnd() { - try { - let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); - if (responseType !== 'arraybuffer') { - responseData = responseData.toString(responseEncoding); - if (!responseEncoding || responseEncoding === 'utf8') { - responseData = utils.stripBOM(responseData); - } - } - response.data = responseData; - } catch (err) { - return reject(core_AxiosError.from(err, null, config, response.request, response)); - } - settle(resolve, reject, response); - }); - } + /** + * @type {import('../types').ObjectAPI["put"]} + */ + async function put (obj, options = {}) { + return dagPut(obj, { + ...options, + storeCodec: 'dag-pb', + hashAlg: 'sha2-256', + version: 1 + }) + } + return put + }) - emitter.once('abort', err => { - if (!responseStream.destroyed) { - responseStream.emit('error', err); - responseStream.destroy(); - } - }); - }); + return fn(options) +} - emitter.once('abort', err => { - reject(err); - req.destroy(err); - }); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/stat.js - // Handle errors - req.on('error', function handleRequestError(err) { - // @todo remove - // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return; - reject(core_AxiosError.from(err, null, config, req)); - }); - // set tcp keep alive to prevent drop connection by peer - req.on('socket', function handleRequestSocket(socket) { - // default interval of sending ack packet is 1 minute - socket.setKeepAlive(true, 1000 * 60); - }); - // Handle request timeout - if (config.timeout) { - // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. - const timeout = parseInt(config.timeout, 10); - if (Number.isNaN(timeout)) { - reject(new core_AxiosError( - 'error trying to parse `config.timeout` to int', - core_AxiosError.ERR_BAD_OPTION_VALUE, - config, - req - )); +const object_stat_createStat = configure(api => { + /** + * @type {import('../types.js').ObjectAPI["stat"]} + */ + async function stat (cid, options = {}) { + const res = await api.post('object/stat', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: `${cid}`, + ...options + }), + headers: options.headers + }) - return; - } + const output = await res.json() - // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. - // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. - // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. - // And then these socket which be hang up will devouring CPU little by little. - // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. - req.setTimeout(timeout, function handleRequestTimeout() { - if (isDone) return; - let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; - const transitional = config.transitional || defaults_transitional; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; - } - reject(new core_AxiosError( - timeoutErrorMessage, - transitional.clarifyTimeoutError ? core_AxiosError.ETIMEDOUT : core_AxiosError.ECONNABORTED, - config, - req - )); - abort(); - }); + return { + ...output, + Hash: node_modules_multiformats_src_cid_CID.parse(output.Hash) } + } + return stat +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/patch/add-link.js - // Send the request - if (utils.isStream(data)) { - let ended = false; - let errored = false; - - data.on('end', () => { - ended = true; - }); - data.once('error', err => { - errored = true; - req.destroy(err); - }); - data.on('close', () => { - if (!ended && !errored) { - abort(new cancel_CanceledError('Request stream has been aborted', config, req)); - } - }); - data.pipe(req); - } else { - req.end(data); - } - }); -}); +const createAddLink = configure(api => { + /** + * @type {import('../../types').ObjectPatchAPI["addLink"]} + */ + async function addLink (cid, dLink, options = {}) { + const res = await api.post('object/patch/add-link', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: [ + `${cid}`, + // @ts-expect-error loose types + dLink.Name || dLink.name || '', + // @ts-expect-error loose types + (dLink.Hash || dLink.cid || '').toString() || null + ], + ...options + }), + headers: options.headers + }) -const __setProxy = (/* unused pure expression or super */ null && (setProxy)); + const { Hash } = await res.json() -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/cookies.js + return node_modules_multiformats_src_cid_CID.parse(Hash) + } + return addLink +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/patch/append-data.js -/* harmony default export */ const cookies = (platform.hasStandardBrowserEnv ? - // Standard browser envs support document.cookie - { - write(name, value, expires, path, domain, secure) { - const cookie = [name + '=' + encodeURIComponent(value)]; - utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString()); - utils.isString(path) && cookie.push('path=' + path); - utils.isString(domain) && cookie.push('domain=' + domain); - secure === true && cookie.push('secure'); +const createAppendData = configure(api => { + /** + * @type {import('../../types').ObjectPatchAPI["appendData"]} + */ + async function appendData (cid, data, options = {}) { + // allow aborting requests on body errors + const controller = new AbortController() + const signal = abortSignal(controller.signal, options.signal) - document.cookie = cookie.join('; '); - }, + const res = await api.post('object/patch/append-data', { + signal, + searchParams: toUrlSearchParams({ + arg: `${cid}`, + ...options + }), + ...( + await multipart_request_multipartRequest([data], controller, options.headers) + ) + }) - read(name) { - const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); - return (match ? decodeURIComponent(match[3]) : null); - }, + const { Hash } = await res.json() - remove(name) { - this.write(name, '', Date.now() - 86400000); - } + return node_modules_multiformats_src_cid_CID.parse(Hash) } + return appendData +}) - : - - // Non-standard browser env (web workers, react-native) lack needed support. - { - write() {}, - read() { - return null; - }, - remove() {} - }); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/patch/rm-link.js -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/isURLSameOrigin.js +const createRmLink = configure(api => { + /** + * @type {import('../../types').ObjectPatchAPI["rmLink"]} + */ + async function rmLink (cid, dLink, options = {}) { + const res = await api.post('object/patch/rm-link', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: [ + `${cid}`, + // @ts-expect-error loose types + dLink.Name || dLink.name || null + ], + ...options + }), + headers: options.headers + }) + const { Hash } = await res.json() + return node_modules_multiformats_src_cid_CID.parse(Hash) + } + return rmLink +}) -/* harmony default export */ const isURLSameOrigin = (platform.hasStandardBrowserEnv ? +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/patch/set-data.js -// Standard browser envs have full support of the APIs needed to test -// whether the request URL is of the same origin as current location. - (function standardBrowserEnv() { - const msie = /(msie|trident)/i.test(navigator.userAgent); - const urlParsingNode = document.createElement('a'); - let originURL; - /** - * Parse a URL to discover its components - * - * @param {String} url The URL to be parsed - * @returns {Object} - */ - function resolveURL(url) { - let href = url; - if (msie) { - // IE needs attribute set twice to normalize properties - urlParsingNode.setAttribute('href', href); - href = urlParsingNode.href; - } - urlParsingNode.setAttribute('href', href); - // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils - return { - href: urlParsingNode.href, - protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', - host: urlParsingNode.host, - search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', - hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', - hostname: urlParsingNode.hostname, - port: urlParsingNode.port, - pathname: (urlParsingNode.pathname.charAt(0) === '/') ? - urlParsingNode.pathname : - '/' + urlParsingNode.pathname - }; - } - originURL = resolveURL(window.location.href); +const createSetData = configure(api => { + /** + * @type {import('../../types').ObjectPatchAPI["setData"]} + */ + async function setData (cid, data, options = {}) { + // allow aborting requests on body errors + const controller = new AbortController() + const signal = abortSignal(controller.signal, options.signal) - /** - * Determine if a URL shares the same origin as the current location - * - * @param {String} requestURL The URL to test - * @returns {boolean} True if URL shares the same origin, otherwise false - */ - return function isURLSameOrigin(requestURL) { - const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; - return (parsed.protocol === originURL.protocol && - parsed.host === originURL.host); - }; - })() : + const res = await api.post('object/patch/set-data', { + signal, + searchParams: toUrlSearchParams({ + arg: [ + `${cid}` + ], + ...options + }), + ...( + await multipart_request_multipartRequest([data], controller, options.headers) + ) + }) - // Non standard browser envs (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return function isURLSameOrigin() { - return true; - }; - })()); + const { Hash } = await res.json() -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/adapters/xhr.js + return node_modules_multiformats_src_cid_CID.parse(Hash) + } + return setData +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/patch/index.js +/** + * @param {import('../../types').Options} config + */ +function createPatch (config) { + return { + addLink: createAddLink(config), + appendData: createAppendData(config), + rmLink: createRmLink(config), + setData: createSetData(config) + } +} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/object/index.js @@ -243269,1066 +167369,1164 @@ const __setProxy = (/* unused pure expression or super */ null && (setProxy)); +/** + * @param {import('../types').Multicodecs} codecs + * @param {import('../types').Options} config + */ +function createObject (codecs, config) { + return { + data: createData(config), + get: object_get_createGet(config), + links: createLinks(config), + new: createNew(config), + put: object_put_createPut(codecs, config), + stat: object_stat_createStat(config), + patch: createPatch(config) + } +} -function progressEventReducer(listener, isDownloadStream) { - let bytesNotified = 0; - const _speedometer = helpers_speedometer(50, 250); +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/pins/normalise-input.js - return e => { - const loaded = e.loaded; - const total = e.lengthComputable ? e.total : undefined; - const progressBytes = loaded - bytesNotified; - const rate = _speedometer(progressBytes); - const inRange = loaded <= total; - bytesNotified = loaded; - const data = { - loaded, - total, - progress: total ? (loaded / total) : undefined, - bytes: progressBytes, - rate: rate ? rate : undefined, - estimated: rate && total && inRange ? (total - loaded) / rate : undefined, - event: e - }; +/** + * @typedef {object} Pinnable + * @property {string | InstanceType | CID} [path] + * @property {CID} [cid] + * @property {boolean} [recursive] + * @property {any} [metadata] + * + * @typedef {CID|string|InstanceType|Pinnable} ToPin + * @typedef {ToPin|Iterable|AsyncIterable} Source + * + * @typedef {object} Pin + * @property {string|CID} path + * @property {boolean} recursive + * @property {any} [metadata] + */ - data[isDownloadStream ? 'download' : 'upload'] = true; +/** + * @param {any} thing + * @returns {thing is IterableIterator & Iterator} + */ +function isIterable (thing) { + return Symbol.iterator in thing +} - listener(data); - }; +/** + * @param {any} thing + * @returns {thing is AsyncIterableIterator & AsyncIterator} + */ +function isAsyncIterable (thing) { + return Symbol.asyncIterator in thing } -const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; +/** + * @param {any} thing + * @returns {thing is CID} + */ +function isCID (thing) { + return ipfs_core_utils_node_modules_multiformats_src_cid_CID.asCID(thing) != null +} -/* harmony default export */ const xhr = (isXHRAdapterSupported && function (config) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - let requestData = config.data; - const requestHeaders = core_AxiosHeaders.from(config.headers).normalize(); - let {responseType, withXSRFToken} = config; - let onCanceled; - function done() { - if (config.cancelToken) { - config.cancelToken.unsubscribe(onCanceled); - } +/** + * Transform one of: + * + * ```ts + * CID + * String + * { cid: CID recursive, metadata } + * { path: String recursive, metadata } + * Iterable + * Iterable + * Iterable<{ cid: CID recursive, metadata }> + * Iterable<{ path: String recursive, metadata }> + * AsyncIterable + * AsyncIterable + * AsyncIterable<{ cid: CID recursive, metadata }> + * AsyncIterable<{ path: String recursive, metadata }> + * ``` + * Into: + * + * ```ts + * AsyncIterable<{ path: CID|String, recursive:boolean, metadata }> + * ``` + * + * @param {Source} input + * @returns {AsyncIterable} + */ +// eslint-disable-next-line complexity +async function * normalise_input_normaliseInput (input) { + // must give us something + if (input === null || input === undefined) { + throw err_code(new Error(`Unexpected input: ${input}`), 'ERR_UNEXPECTED_INPUT') + } - if (config.signal) { - config.signal.removeEventListener('abort', onCanceled); - } - } + // CID + const cid = ipfs_core_utils_node_modules_multiformats_src_cid_CID.asCID(input) - let contentType; + if (cid) { + yield toPin({ cid }) + return + } - if (utils.isFormData(requestData)) { - if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { - requestHeaders.setContentType(false); // Let the browser set it - } else if ((contentType = requestHeaders.getContentType()) !== false) { - // fix semicolon duplication issue for ReactNative FormData implementation - const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : []; - requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; ')); - } + if (input instanceof String || typeof input === 'string') { + yield toPin({ path: input }) + return + } + + // { cid: CID recursive, metadata } + // @ts-expect-error - it still could be iterable or async iterable + if (input.cid != null || input.path != null) { + // @ts-expect-error + return yield toPin(input) + } + + // Iterable + if (isIterable(input)) { + const iterator = input[Symbol.iterator]() + const first = iterator.next() + + if (first.done) { + return iterator } - let request = new XMLHttpRequest(); + // Iterable + if (isCID(first.value)) { + yield toPin({ cid: first.value }) + for (const cid of iterator) { + yield toPin({ cid }) + } + return + } - // HTTP basic authentication - if (config.auth) { - const username = config.auth.username || ''; - const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; - requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password)); + // Iterable + if (first.value instanceof String || typeof first.value === 'string') { + yield toPin({ path: first.value }) + for (const path of iterator) { + yield toPin({ path }) + } + return } - const fullPath = buildFullPath(config.baseURL, config.url); + // Iterable + if (first.value.cid != null || first.value.path != null) { + yield toPin(first.value) + for (const obj of iterator) { + yield toPin(obj) + } + return + } - request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + throw err_code(new Error('Unexpected input: ' + typeof input), 'ERR_UNEXPECTED_INPUT') + } - // Set the request timeout in MS - request.timeout = config.timeout; + // AsyncIterable + if (isAsyncIterable(input)) { + const iterator = input[Symbol.asyncIterator]() + const first = await iterator.next() + if (first.done) return iterator - function onloadend() { - if (!request) { - return; + // AsyncIterable + if (isCID(first.value)) { + yield toPin({ cid: first.value }) + for await (const cid of iterator) { + yield toPin({ cid }) } - // Prepare the response - const responseHeaders = core_AxiosHeaders.from( - 'getAllResponseHeaders' in request && request.getAllResponseHeaders() - ); - const responseData = !responseType || responseType === 'text' || responseType === 'json' ? - request.responseText : request.response; - const response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config, - request - }; + return + } - settle(function _resolve(value) { - resolve(value); - done(); - }, function _reject(err) { - reject(err); - done(); - }, response); + // AsyncIterable + if (first.value instanceof String || typeof first.value === 'string') { + yield toPin({ path: first.value }) + for await (const path of iterator) { + yield toPin({ path }) + } + return + } - // Clean up request - request = null; + // AsyncIterable<{ cid: CID|String recursive, metadata }> + if (first.value.cid != null || first.value.path != null) { + yield toPin(first.value) + for await (const obj of iterator) { + yield toPin(obj) + } + return } - if ('onloadend' in request) { - // Use onloadend if available - request.onloadend = onloadend; - } else { - // Listen for ready state to emulate onloadend - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } + throw err_code(new Error('Unexpected input: ' + typeof input), 'ERR_UNEXPECTED_INPUT') + } - // The request errored out and we didn't get a response, this will be - // handled by onerror instead - // With one exception: request that using file: protocol, most browsers - // will return status as 0 even though it's a successful request - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { - return; - } - // readystate handler is calling before onerror or ontimeout handlers, - // so we should call onloadend on the next 'tick' - setTimeout(onloadend); - }; - } + throw err_code(new Error('Unexpected input: ' + typeof input), 'ERR_UNEXPECTED_INPUT') +} - // Handle browser request cancellation (as opposed to a manual cancellation) - request.onabort = function handleAbort() { - if (!request) { - return; - } +/** + * @param {Pinnable} input + */ +function toPin (input) { + const path = input.cid || `${input.path}` - reject(new core_AxiosError('Request aborted', core_AxiosError.ECONNABORTED, config, request)); + if (!path) { + throw err_code(new Error('Unexpected input: Please path either a CID or an IPFS path'), 'ERR_UNEXPECTED_INPUT') + } - // Clean up request - request = null; - }; + /** @type {Pin} */ + const pin = { + path, + recursive: input.recursive !== false + } - // Handle low level network errors - request.onerror = function handleError() { - // Real errors are hidden from us by the browser - // onerror should only fire if it's a network error - reject(new core_AxiosError('Network Error', core_AxiosError.ERR_NETWORK, config, request)); + if (input.metadata != null) { + pin.metadata = input.metadata + } - // Clean up request - request = null; - }; + return pin +} - // Handle timeout - request.ontimeout = function handleTimeout() { - let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; - const transitional = config.transitional || defaults_transitional; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; - } - reject(new core_AxiosError( - timeoutErrorMessage, - transitional.clarifyTimeoutError ? core_AxiosError.ETIMEDOUT : core_AxiosError.ECONNABORTED, - config, - request)); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/add-all.js - // Clean up request - request = null; - }; - // Add xsrf header - // This is only done if running in a standard browser environment. - // Specifically not if we're in a web worker, or react-native. - if(platform.hasStandardBrowserEnv) { - withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config)); - if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) { - // Add xsrf header - const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName); - if (xsrfValue) { - requestHeaders.set(config.xsrfHeaderName, xsrfValue); + +const createAddAll = configure(api => { + /** + * @type {import('../types').PinAPI["addAll"]} + */ + async function * addAll (source, options = {}) { + for await (const { path, recursive, metadata } of normalise_input_normaliseInput(source)) { + const res = await api.post('pin/add', { + signal: options.signal, + searchParams: toUrlSearchParams({ + ...options, + arg: path, + recursive, + metadata: metadata ? JSON.stringify(metadata) : undefined, + stream: true + }), + headers: options.headers + }) + + for await (const pin of res.ndjson()) { + if (pin.Pins) { // non-streaming response + for (const cid of pin.Pins) { + yield node_modules_multiformats_src_cid_CID.parse(cid) + } + // eslint-disable-next-line no-continue + continue } + + yield node_modules_multiformats_src_cid_CID.parse(pin) } } + } + return addAll +}) - // Remove Content-Type if data is undefined - requestData === undefined && requestHeaders.setContentType(null); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/add.js - // Add headers to the request - if ('setRequestHeader' in request) { - utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { - request.setRequestHeader(key, val); - }); - } - // Add withCredentials to request if needed - if (!utils.isUndefined(config.withCredentials)) { - request.withCredentials = !!config.withCredentials; - } - // Add responseType to request if needed - if (responseType && responseType !== 'json') { - request.responseType = config.responseType; - } - // Handle progress if needed - if (typeof config.onDownloadProgress === 'function') { - request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true)); - } +/** + * @param {import('../types').Options} config + */ +function add_createAdd (config) { + const all = createAddAll(config) - // Not all browsers support upload events - if (typeof config.onUploadProgress === 'function' && request.upload) { - request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress)); + return configure(() => { + /** + * @type {import('../types').PinAPI["add"]} + */ + async function add (path, options = {}) { + // @ts-expect-error last can return undefined + return last(all([{ + path, + ...options + }], options)) } + return add + })(config) +} - if (config.cancelToken || config.signal) { - // Handle cancellation - // eslint-disable-next-line func-names - onCanceled = cancel => { - if (!request) { - return; - } - reject(!cancel || cancel.type ? new cancel_CanceledError(null, config, request) : cancel); - request.abort(); - request = null; - }; - - config.cancelToken && config.cancelToken.subscribe(onCanceled); - if (config.signal) { - config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); - } - } +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/ls.js - const protocol = parseProtocol(fullPath); - if (protocol && platform.protocols.indexOf(protocol) === -1) { - reject(new core_AxiosError('Unsupported protocol ' + protocol + ':', core_AxiosError.ERR_BAD_REQUEST, config)); - return; - } - // Send the request - request.send(requestData || null); - }); -}); +/** + * @param {string} type + * @param {string} cid + * @param {Record} metadata + */ +function ls_toPin (type, cid, metadata) { + /** @type {import('../types').LsResult} */ + const pin = { + type, + cid: node_modules_multiformats_src_cid_CID.parse(cid) + } -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/adapters/adapters.js + if (metadata) { + pin.metadata = metadata + } + return pin +} +const pin_ls_createLs = configure(api => { + /** + * @type {import('../types').PinAPI["ls"]} + */ + async function * ls (options = {}) { + /** @type {any[]} */ + let paths = [] + if (options.paths) { + paths = Array.isArray(options.paths) ? options.paths : [options.paths] + } + const res = await api.post('pin/ls', { + signal: options.signal, + searchParams: toUrlSearchParams({ + ...options, + arg: paths.map(path => `${path}`), + stream: true + }), + headers: options.headers + }) -const knownAdapters = { - http: adapters_http, - xhr: xhr -} + for await (const pin of res.ndjson()) { + if (pin.Keys) { // non-streaming response + for (const cid of Object.keys(pin.Keys)) { + yield ls_toPin(pin.Keys[cid].Type, cid, pin.Keys[cid].Metadata) + } + return + } -utils.forEach(knownAdapters, (fn, value) => { - if (fn) { - try { - Object.defineProperty(fn, 'name', {value}); - } catch (e) { - // eslint-disable-next-line no-empty + yield ls_toPin(pin.Type, pin.Cid, pin.Metadata) } - Object.defineProperty(fn, 'adapterName', {value}); } -}); + return ls +}) -const renderReason = (reason) => `- ${reason}`; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/rm-all.js -const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false; -/* harmony default export */ const adapters = ({ - getAdapter: (adapters) => { - adapters = utils.isArray(adapters) ? adapters : [adapters]; - const {length} = adapters; - let nameOrAdapter; - let adapter; - const rejectedReasons = {}; - for (let i = 0; i < length; i++) { - nameOrAdapter = adapters[i]; - let id; +const createRmAll = configure(api => { + /** + * @type {import('../types').PinAPI["rmAll"]} + */ + async function * rmAll (source, options = {}) { + for await (const { path, recursive } of normalise_input_normaliseInput(source)) { + const searchParams = new URLSearchParams(options.searchParams) + searchParams.append('arg', `${path}`) - adapter = nameOrAdapter; + if (recursive != null) searchParams.set('recursive', String(recursive)) - if (!isResolvedHandle(nameOrAdapter)) { - adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; + const res = await api.post('pin/rm', { + signal: options.signal, + headers: options.headers, + searchParams: toUrlSearchParams({ + ...options, + arg: `${path}`, + recursive + }) + }) - if (adapter === undefined) { - throw new core_AxiosError(`Unknown adapter '${id}'`); + for await (const pin of res.ndjson()) { + if (pin.Pins) { // non-streaming response + yield * pin.Pins.map((/** @type {string} */ cid) => node_modules_multiformats_src_cid_CID.parse(cid)) + // eslint-disable-next-line no-continue + continue } + yield node_modules_multiformats_src_cid_CID.parse(pin) } + } + } + return rmAll +}) - if (adapter) { - break; - } +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/rm.js - rejectedReasons[id || '#' + i] = adapter; - } - if (!adapter) { - const reasons = Object.entries(rejectedReasons) - .map(([id, state]) => `adapter ${id} ` + - (state === false ? 'is not supported by the environment' : 'is not available in the build') - ); - let s = length ? - (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : - 'as no adapter specified'; +/** + * @param {import('../types').Options} config + */ +const pin_rm_createRm = (config) => { + const all = createRmAll(config) - throw new core_AxiosError( - `There is no suitable adapter to dispatch the request ` + s, - 'ERR_NOT_SUPPORT' - ); + return configure(() => { + /** + * @type {import('../types').PinAPI["rm"]} + */ + async function rm (path, options = {}) { + // @ts-expect-error last can return undefined + return last(all([{ + path, + ...options + }], options)) } + return rm + })(config) +} - return adapter; - }, - adapters: knownAdapters -}); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/utils.js -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/core/dispatchRequest.js +/** + * @param {object} json + * @param {string} json.Name + * @param {string} json.Cid + * @param {import('../../types.js').Status} json.Status + * @returns {import('../../types.js').Pin} + */ +const decodePin = ({ Name: name, Status: status, Cid: cid }) => { + return { + cid: node_modules_multiformats_src_cid_CID.parse(cid), + name, + status + } +} +/** + * @param {any} service + * @returns {string} + */ +const encodeService = (service) => { + if (typeof service === 'string' && service !== '') { + return service + } else { + throw new TypeError('service name must be passed') + } +} +/** + * @param {any} cid + * @returns {string} + */ +const utils_encodeCID = (cid) => { + if (node_modules_multiformats_src_cid_CID.asCID(cid)) { + return cid.toString() + } else { + throw new TypeError(`CID instance expected instead of ${typeof cid}`) + } +} +/** + * @param {import('../../types.js').Query & { all?: boolean }} query + * @returns {URLSearchParams} + */ +const encodeQuery = ({ service, cid, name, status, all }) => { + const query = toUrlSearchParams({ + service: encodeService(service), + name, + force: all ? true : undefined + }) + if (cid) { + for (const value of cid) { + query.append('cid', utils_encodeCID(value)) + } + } + if (status) { + for (const value of status) { + query.append('status', value) + } + } + return query +} /** - * Throws a `CanceledError` if cancellation has been requested. - * - * @param {Object} config The config that is to be used for the request - * - * @returns {void} + * @param {import('../../types.js').AddOptions & {cid:CID}} options + * @returns {URLSearchParams} */ -function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } +const encodeAddParams = ({ cid, service, background, name, origins }) => { + const params = toUrlSearchParams({ + arg: utils_encodeCID(cid), + service: encodeService(service), + name, + background: background ? true : undefined + }) - if (config.signal && config.signal.aborted) { - throw new cancel_CanceledError(null, config); + if (origins) { + for (const origin of origins) { + params.append('origin', origin.toString()) + } } + + return params } -/** - * Dispatch a request to the server using the configured adapter. - * - * @param {object} config The config that is to be used for the request - * - * @returns {Promise} The Promise to be fulfilled - */ -function dispatchRequest(config) { - throwIfCancellationRequested(config); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/add.js - config.headers = core_AxiosHeaders.from(config.headers); - // Transform request data - config.data = transformData.call( - config, - config.transformRequest - ); +/** + * @param {import('../../lib/core').Client} client + */ +function remote_add_createAdd (client) { + /** + * @type {import('../../types').RemotePiningAPI["add"]} + */ + async function add (cid, { timeout, signal, headers, ...query }) { + const response = await client.post('pin/remote/add', { + timeout, + signal, + headers, + searchParams: encodeAddParams({ cid, ...query }) + }) - if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { - config.headers.setContentType('application/x-www-form-urlencoded', false); + return decodePin(await response.json()) } - const adapter = adapters.getAdapter(config.adapter || lib_defaults.adapter); - - return adapter(config).then(function onAdapterResolution(response) { - throwIfCancellationRequested(config); + return add +} - // Transform response data - response.data = transformData.call( - config, - config.transformResponse, - response - ); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/ls.js - response.headers = core_AxiosHeaders.from(response.headers); - return response; - }, function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); +/** + * @param {import('../../lib/core').Client} client + */ +function remote_ls_createLs (client) { + /** + * @type {import('../../types.js').RemotePiningAPI["ls"]} + */ + async function * ls ({ timeout, signal, headers, ...query }) { + const response = await client.post('pin/remote/ls', { + timeout, + signal, + headers, + searchParams: encodeQuery(query) + }) - // Transform response data - if (reason && reason.response) { - reason.response.data = transformData.call( - config, - config.transformResponse, - reason.response - ); - reason.response.headers = core_AxiosHeaders.from(reason.response.headers); - } + for await (const pin of response.ndjson()) { + yield decodePin(pin) } + } - return Promise.reject(reason); - }); + return ls } -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/core/mergeConfig.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/rm.js +/** + * @param {import('../../lib/core').Client} client + */ +function remote_rm_createRm (client) { + /** + * @type {import('../../types').RemotePiningAPI["rm"]} + */ + async function rm ({ timeout, signal, headers, ...query }) { + await client.post('pin/remote/rm', { + timeout, + signal, + headers, + searchParams: encodeQuery({ + ...query, + all: false + }) + }) + } + return rm +} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/rm-all.js -const headersToObject = (thing) => thing instanceof core_AxiosHeaders ? thing.toJSON() : thing; /** - * Config-specific merge-function which creates a new config-object - * by merging two configuration objects together. - * - * @param {Object} config1 - * @param {Object} config2 - * - * @returns {Object} New object resulting from merging config2 to config1 + * @param {import('../../lib/core').Client} client */ -function mergeConfig(config1, config2) { - // eslint-disable-next-line no-param-reassign - config2 = config2 || {}; - const config = {}; +function rm_all_createRmAll (client) { + /** + * @type {import('../../types').RemotePiningAPI["rmAll"]} + */ + async function rmAll ({ timeout, signal, headers, ...query }) { + await client.post('pin/remote/rm', { + timeout, + signal, + headers, + searchParams: encodeQuery({ + ...query, + all: true + }) + }) + } - function getMergedValue(target, source, caseless) { - if (utils.isPlainObject(target) && utils.isPlainObject(source)) { - return utils.merge.call({caseless}, target, source); - } else if (utils.isPlainObject(source)) { - return utils.merge({}, source); - } else if (utils.isArray(source)) { - return source.slice(); - } - return source; + return rmAll +} + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/service/utils.js + +/** + * @param {URL} url + */ +function encodeEndpoint (url) { + const href = String(url) + if (href === 'undefined') { + throw Error('endpoint is required') } + // Workaround trailing `/` issue in go-ipfs + // @see https://github.com/ipfs/go-ipfs/issues/7826 + return href[href.length - 1] === '/' ? href.slice(0, -1) : href +} - // eslint-disable-next-line consistent-return - function mergeDeepProperties(a, b, caseless) { - if (!utils.isUndefined(b)) { - return getMergedValue(a, b, caseless); - } else if (!utils.isUndefined(a)) { - return getMergedValue(undefined, a, caseless); - } +/** + * @param {any} json + * @returns {import('../../../types').RemotePinServiceWithStat} + */ +function decodeRemoteService (json) { + return { + service: json.Service, + endpoint: new URL(json.ApiEndpoint), + ...(json.Stat && { stat: decodeStat(json.Stat) }) } +} - // eslint-disable-next-line consistent-return - function valueFromConfig2(a, b) { - if (!utils.isUndefined(b)) { - return getMergedValue(undefined, b); +/** + * @param {any} json + * @returns {import('../../../types').Stat} + */ +function decodeStat (json) { + switch (json.Status) { + case 'valid': { + const { Pinning, Pinned, Queued, Failed } = json.PinCount + return { + status: 'valid', + pinCount: { + queued: Queued, + pinning: Pinning, + pinned: Pinned, + failed: Failed + } + } + } + case 'invalid': { + return { status: 'invalid' } + } + default: { + return { status: json.Status } } } +} - // eslint-disable-next-line consistent-return - function defaultToConfig2(a, b) { - if (!utils.isUndefined(b)) { - return getMergedValue(undefined, b); - } else if (!utils.isUndefined(a)) { - return getMergedValue(undefined, a); - } +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/service/add.js + + + +/** + * @param {import('../../../lib/core').Client} client + */ +function service_add_createAdd (client) { + /** + * @type {import('../../../types').RemotePiningServiceAPI["add"]} + */ + async function add (name, options) { + const { endpoint, key, headers, timeout, signal } = options + + await client.post('pin/remote/service/add', { + timeout, + signal, + searchParams: toUrlSearchParams({ + arg: [name, encodeEndpoint(endpoint), key] + }), + headers + }) } - // eslint-disable-next-line consistent-return - function mergeDirectKeys(a, b, prop) { - if (prop in config2) { - return getMergedValue(a, b); - } else if (prop in config1) { - return getMergedValue(undefined, a); - } + return add +} + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/service/ls.js + + + +/** + * @param {import('../../../lib/core').Client} client + */ +function service_ls_createLs (client) { + /** + * @type {import('../../../types').RemotePiningServiceAPI["ls"]} + */ + async function ls (options = {}) { + // @ts-expect-error cannot derive option type from typedef + const { stat, headers, timeout, signal } = options + + const response = await client.post('pin/remote/service/ls', { + timeout, + signal, + headers, + searchParams: stat === true ? toUrlSearchParams({ stat }) : undefined + }) + + /** @type {{RemoteServices: object[]}} */ + const { RemoteServices } = await response.json() + + return RemoteServices.map(decodeRemoteService) } - const mergeMap = { - url: valueFromConfig2, - method: valueFromConfig2, - data: valueFromConfig2, - baseURL: defaultToConfig2, - transformRequest: defaultToConfig2, - transformResponse: defaultToConfig2, - paramsSerializer: defaultToConfig2, - timeout: defaultToConfig2, - timeoutMessage: defaultToConfig2, - withCredentials: defaultToConfig2, - withXSRFToken: defaultToConfig2, - adapter: defaultToConfig2, - responseType: defaultToConfig2, - xsrfCookieName: defaultToConfig2, - xsrfHeaderName: defaultToConfig2, - onUploadProgress: defaultToConfig2, - onDownloadProgress: defaultToConfig2, - decompress: defaultToConfig2, - maxContentLength: defaultToConfig2, - maxBodyLength: defaultToConfig2, - beforeRedirect: defaultToConfig2, - transport: defaultToConfig2, - httpAgent: defaultToConfig2, - httpsAgent: defaultToConfig2, - cancelToken: defaultToConfig2, - socketPath: defaultToConfig2, - responseEncoding: defaultToConfig2, - validateStatus: mergeDirectKeys, - headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) - }; + return ls +} - utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { - const merge = mergeMap[prop] || mergeDeepProperties; - const configValue = merge(config1[prop], config2[prop], prop); - (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); - }); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/service/rm.js - return config; + +/** + * @param {import('../../../lib/core').Client} client + */ +function service_rm_createRm (client) { + /** + * @type {import('../../../types').RemotePiningServiceAPI["rm"]} + */ + async function rm (name, options = {}) { + await client.post('pin/remote/service/rm', { + signal: options.signal, + headers: options.headers, + searchParams: toUrlSearchParams({ + arg: name + }) + }) + } + + return rm } -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/validator.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/service/index.js -const validators = {}; +/** + * @param {import('../../../types').Options} config + */ +function createService (config) { + const client = new Client(config) + + return { + add: service_add_createAdd(client), + ls: service_ls_createLs(client), + rm: service_rm_createRm(client) + } +} + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/remote/index.js -// eslint-disable-next-line func-names -['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { - validators[type] = function validator(thing) { - return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; - }; -}); -const deprecatedWarnings = {}; -/** - * Transitional option validator - * - * @param {function|boolean?} validator - set to false if the transitional option has been removed - * @param {string?} version - deprecated version / removed since version - * @param {string?} message - some message with additional info - * - * @returns {function} - */ -validators.transitional = function transitional(validator, version, message) { - function formatMessage(opt, desc) { - return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); - } - // eslint-disable-next-line func-names - return (value, opt, opts) => { - if (validator === false) { - throw new core_AxiosError( - formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), - core_AxiosError.ERR_DEPRECATED - ); - } - if (version && !deprecatedWarnings[opt]) { - deprecatedWarnings[opt] = true; - // eslint-disable-next-line no-console - console.warn( - formatMessage( - opt, - ' has been deprecated since v' + version + ' and will be removed in the near future' - ) - ); - } - return validator ? validator(value, opt, opts) : true; - }; -}; /** - * Assert object's properties type - * - * @param {object} options - * @param {object} schema - * @param {boolean?} allowUnknown - * - * @returns {object} + * @param {import('../../types').Options} config */ +function createRemote (config) { + const client = new Client(config) -function assertOptions(options, schema, allowUnknown) { - if (typeof options !== 'object') { - throw new core_AxiosError('options must be an object', core_AxiosError.ERR_BAD_OPTION_VALUE); - } - const keys = Object.keys(options); - let i = keys.length; - while (i-- > 0) { - const opt = keys[i]; - const validator = schema[opt]; - if (validator) { - const value = options[opt]; - const result = value === undefined || validator(value, opt, options); - if (result !== true) { - throw new core_AxiosError('option ' + opt + ' must be ' + result, core_AxiosError.ERR_BAD_OPTION_VALUE); - } - continue; - } - if (allowUnknown !== true) { - throw new core_AxiosError('Unknown option ' + opt, core_AxiosError.ERR_BAD_OPTION); - } + return { + add: remote_add_createAdd(client), + ls: remote_ls_createLs(client), + rm: remote_rm_createRm(client), + rmAll: rm_all_createRmAll(client), + service: createService(config) } } -/* harmony default export */ const validator = ({ - assertOptions, - validators -}); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pin/index.js -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/core/Axios.js +/** + * @param {import('../types').Options} config + */ +function createPin (config) { + return { + addAll: createAddAll(config), + add: add_createAdd(config), + ls: pin_ls_createLs(config), + rmAll: createRmAll(config), + rm: pin_rm_createRm(config), + remote: createRemote(config) + } +} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/lib/http-rpc-wire-format.js -const Axios_validators = validator.validators; +/* HTTP RPC: + * - wraps binary data in multibase. base64url is used to avoid issues + * when a binary data is passed as search param in URL. + * Historical context: https://github.com/ipfs/go-ipfs/issues/7939 + * Multibase wrapping introduced in: https://github.com/ipfs/go-ipfs/pull/8183 + */ /** - * Create a new instance of Axios - * - * @param {Object} instanceConfig The default config for the instance - * - * @return {Axios} A new instance of Axios + * @param {Array} strings + * @returns {Array} strings */ -class Axios { - constructor(instanceConfig) { - this.defaults = instanceConfig; - this.interceptors = { - request: new core_InterceptorManager(), - response: new core_InterceptorManager() - }; +const rpcArrayToTextArray = strings => { + if (Array.isArray(strings)) { + return strings.map(rpcToText) } + return strings +} - /** - * Dispatch a request - * - * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) - * @param {?Object} config - * - * @returns {Promise} The Promise to be fulfilled - */ - request(configOrUrl, config) { - /*eslint no-param-reassign:0*/ - // Allow for axios('example/url'[, config]) a la fetch API - if (typeof configOrUrl === 'string') { - config = config || {}; - config.url = configOrUrl; - } else { - config = configOrUrl || {}; - } - - config = mergeConfig(this.defaults, config); +/** + * @param {string} mb + * @returns {string} + */ +const rpcToText = mb => dist_src_to_string_toString(rpcToBytes(mb)) - const {transitional, paramsSerializer, headers} = config; +/** + * @param {string} mb + * @returns {Uint8Array} + */ +const rpcToBytes = mb => bases_base64_base64url.decode(mb) - if (transitional !== undefined) { - validator.assertOptions(transitional, { - silentJSONParsing: Axios_validators.transitional(Axios_validators.boolean), - forcedJSONParsing: Axios_validators.transitional(Axios_validators.boolean), - clarifyTimeoutError: Axios_validators.transitional(Axios_validators.boolean) - }, false); - } +/** + * @param {string} mb + * @returns {bigint} + */ +const rpcToBigInt = mb => BigInt(`0x${dist_src_to_string_toString(bases_base64_base64url.decode(mb), 'base16')}`) - if (paramsSerializer != null) { - if (utils.isFunction(paramsSerializer)) { - config.paramsSerializer = { - serialize: paramsSerializer - } - } else { - validator.assertOptions(paramsSerializer, { - encode: Axios_validators.function, - serialize: Axios_validators.function - }, true); - } - } +/** + * @param {string} text + * @returns {string} + */ +const textToUrlSafeRpc = text => bases_base64_base64url.encode(dist_src_from_string_fromString(text)) - // Set config.method - config.method = (config.method || this.defaults.method || 'get').toLowerCase(); - // Flatten headers - let contextHeaders = headers && utils.merge( - headers.common, - headers[config.method] - ); - headers && utils.forEach( - ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], - (method) => { - delete headers[method]; - } - ); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pubsub/ls.js - config.headers = core_AxiosHeaders.concat(contextHeaders, headers); - // filter out skipped interceptors - const requestInterceptorChain = []; - let synchronousRequestInterceptors = true; - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { - return; - } - synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; - requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); - }); +const pubsub_ls_createLs = configure(api => { + /** + * @type {import('../types').PubsubAPI["ls"]} + */ + async function ls (options = {}) { + const { Strings } = await (await api.post('pubsub/ls', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers + })).json() - const responseInterceptorChain = []; - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - }); + return rpcArrayToTextArray(Strings) || [] + } + return ls +}) - let promise; - let i = 0; - let len; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pubsub/peers.js - if (!synchronousRequestInterceptors) { - const chain = [dispatchRequest.bind(this), undefined]; - chain.unshift.apply(chain, requestInterceptorChain); - chain.push.apply(chain, responseInterceptorChain); - len = chain.length; - promise = Promise.resolve(config); - while (i < len) { - promise = promise.then(chain[i++], chain[i++]); - } - return promise; - } +const createPeers = configure(api => { + /** + * @type {import('../types').PubsubAPI["peers"]} + */ + async function peers (topic, options = {}) { + const res = await api.post('pubsub/peers', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: textToUrlSafeRpc(topic), + ...options + }), + headers: options.headers + }) - len = requestInterceptorChain.length; + const { Strings } = await res.json() - let newConfig = config; + return Strings || [] + } + return peers +}) - i = 0; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pubsub/publish.js - while (i < len) { - const onFulfilled = requestInterceptorChain[i++]; - const onRejected = requestInterceptorChain[i++]; - try { - newConfig = onFulfilled(newConfig); - } catch (error) { - onRejected.call(this, error); - break; - } - } - try { - promise = dispatchRequest.call(this, newConfig); - } catch (error) { - return Promise.reject(error); - } - i = 0; - len = responseInterceptorChain.length; - while (i < len) { - promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); - } - return promise; - } - getUri(config) { - config = mergeConfig(this.defaults, config); - const fullPath = buildFullPath(config.baseURL, config.url); - return buildURL(fullPath, config.params, config.paramsSerializer); - } -} +const publish_createPublish = configure(api => { + /** + * @type {import('../types').PubsubAPI["publish"]} + */ + async function publish (topic, data, options = {}) { + const searchParams = toUrlSearchParams({ + arg: textToUrlSafeRpc(topic), + ...options + }) -// Provide aliases for supported request methods -utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function(url, config) { - return this.request(mergeConfig(config || {}, { - method, - url, - data: (config || {}).data - })); - }; -}); + // allow aborting requests on body errors + const controller = new AbortController() + const signal = abortSignal(controller.signal, options.signal) -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - /*eslint func-names:0*/ + const res = await api.post('pubsub/pub', { + signal, + searchParams, + ...( + await multipart_request_multipartRequest([data], controller, options.headers) + ) + }) - function generateHTTPMethod(isForm) { - return function httpMethod(url, data, config) { - return this.request(mergeConfig(config || {}, { - method, - headers: isForm ? { - 'Content-Type': 'multipart/form-data' - } : {}, - url, - data - })); - }; + await res.text() } + return publish +}) - Axios.prototype[method] = generateHTTPMethod(); - - Axios.prototype[method + 'Form'] = generateHTTPMethod(true); -}); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pubsub/subscribe.js -/* harmony default export */ const core_Axios = (Axios); -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/cancel/CancelToken.js +const subscribe_log = logger('js-kubo-rpc-client:pubsub:subscribe') /** - * A `CancelToken` is an object that can be used to request cancellation of an operation. - * - * @param {Function} executor The executor function. - * - * @returns {CancelToken} + * @param {import('../types').Options} options + * @param {import('./subscription-tracker').SubscriptionTracker} subsTracker */ -class CancelToken { - constructor(executor) { - if (typeof executor !== 'function') { - throw new TypeError('executor must be a function.'); - } - - let resolvePromise; +const createSubscribe = (options, subsTracker) => { + return configure((api) => { + /** + * @type {import('../types').PubsubAPI["subscribe"]} + */ + async function subscribe (topic, handler, options = {}) { // eslint-disable-line require-await + options.signal = subsTracker.subscribe(topic, handler, options.signal) - this.promise = new Promise(function promiseExecutor(resolve) { - resolvePromise = resolve; - }); + /** @type {(value?: any) => void} */ + let done + /** @type {(error: Error) => void} */ + let fail - const token = this; + const result = new Promise((resolve, reject) => { + done = resolve + fail = reject + }) - // eslint-disable-next-line func-names - this.promise.then(cancel => { - if (!token._listeners) return; + // In Firefox, the initial call to fetch does not resolve until some data + // is received. If this doesn't happen within 1 second assume success + const ffWorkaround = setTimeout(() => done(), 1000) - let i = token._listeners.length; + // Do this async to not block Firefox + api.post('pubsub/sub', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: textToUrlSafeRpc(topic), + ...options + }), + headers: options.headers + }) + .catch((err) => { + // Initial subscribe fail, ensure we clean up + subsTracker.unsubscribe(topic, handler) - while (i-- > 0) { - token._listeners[i](cancel); - } - token._listeners = null; - }); + fail(err) + }) + .then((response) => { + clearTimeout(ffWorkaround) - // eslint-disable-next-line func-names - this.promise.then = onfulfilled => { - let _resolve; - // eslint-disable-next-line func-names - const promise = new Promise(resolve => { - token.subscribe(resolve); - _resolve = resolve; - }).then(onfulfilled); + if (!response) { + // if there was no response, the subscribe failed + return + } - promise.cancel = function reject() { - token.unsubscribe(_resolve); - }; + readMessages(response, { + onMessage: (message) => { + if (!handler) { + return + } - return promise; - }; + if (typeof handler === 'function') { + handler(message) + return + } - executor(function cancel(message, config, request) { - if (token.reason) { - // Cancellation has already been requested - return; - } + if (typeof handler.handleEvent === 'function') { + handler.handleEvent(message) + } + }, + onEnd: () => subsTracker.unsubscribe(topic, handler), + onError: options.onError + }) - token.reason = new cancel_CanceledError(message, config, request); - resolvePromise(token.reason); - }); - } + done() + }) - /** - * Throws a `CanceledError` if cancellation has been requested. - */ - throwIfRequested() { - if (this.reason) { - throw this.reason; + return result } - } + return subscribe + })(options) +} - /** - * Subscribe to the cancel signal - */ +/** + * @param {import('../types').ExtendedResponse} response + * @param {object} options + * @param {(message: import('../types').Message) => void} options.onMessage + * @param {() => void} options.onEnd + * @param {import('../types').PubsubApiErrorHandlerFn} [options.onError] + */ +async function readMessages (response, { onMessage, onEnd, onError }) { + onError = onError || subscribe_log - subscribe(listener) { - if (this.reason) { - listener(this.reason); - return; - } + try { + for await (const msg of response.ndjson()) { + try { + if (!msg.from) { + // eslint-disable-next-line no-continue + continue + } - if (this._listeners) { - this._listeners.push(listener); - } else { - this._listeners = [listener]; + if (msg.from != null && msg.seqno != null) { + onMessage({ + type: 'signed', + from: peerIdFromString(msg.from), + data: rpcToBytes(msg.data), + sequenceNumber: rpcToBigInt(msg.seqno), + topic: rpcToText(msg.topicIDs[0]), + key: rpcToBytes(msg.key ?? 'u'), + signature: rpcToBytes(msg.signature ?? 'u') + }) + } else { + onMessage({ + type: 'unsigned', + data: rpcToBytes(msg.data), + topic: rpcToText(msg.topicIDs[0]) + }) + } + } catch (/** @type {any} */ err) { + err.message = `Failed to parse pubsub message: ${err.message}` + onError(err, false, msg) // Not fatal + } + } + } catch (/** @type {any} */ err) { + if (!isAbortError(err)) { + onError(err, true) // Fatal } + } finally { + onEnd() } +} - /** - * Unsubscribe from the cancel signal - */ - - unsubscribe(listener) { - if (!this._listeners) { - return; - } - const index = this._listeners.indexOf(listener); - if (index !== -1) { - this._listeners.splice(index, 1); - } +/** + * @param {Error & {type?:string}} error + * @returns {boolean} + */ +const isAbortError = error => { + switch (error.type) { + case 'aborted': + return true + // It is `abort` in Electron instead of `aborted` + case 'abort': + return true + default: + // FIXME: In testing with Chrome, err.type is undefined (should not be!) + // Temporarily use the name property instead. + return error.name === 'AbortError' } +} + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pubsub/unsubscribe.js +/** + * @param {import('..').Options} options + * @param {import('./subscription-tracker').SubscriptionTracker} subsTracker + */ +const createUnsubscribe = (options, subsTracker) => { /** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. + * @type {import('../types').PubsubAPI["unsubscribe"]} */ - static source() { - let cancel; - const token = new CancelToken(function executor(c) { - cancel = c; - }); - return { - token, - cancel - }; + async function unsubscribe (topic, handler) { + subsTracker.unsubscribe(topic, handler) } + return unsubscribe } -/* harmony default export */ const cancel_CancelToken = (CancelToken); - -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/spread.js - +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pubsub/subscription-tracker.js /** - * Syntactic sugar for invoking a function and expanding an array for arguments. - * - * Common use case would be to use `Function.prototype.apply`. - * - * ```js - * function f(x, y, z) {} - * var args = [1, 2, 3]; - * f.apply(null, args); - * ``` - * - * With `spread` this example can be re-written. * - * ```js - * spread(function(x, y, z) {})([1, 2, 3]); - * ``` - * - * @param {Function} callback - * - * @returns {Function} + * @property {import('../types').MessageHandlerFn} handler + * @property {AbortController} controller */ -function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; -} - -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/isAxiosError.js - +class SubscriptionTracker { + constructor () { + /** @type {Map} */ + this._subs = new Map() + } + /** + * @param {string} topic + * @param {import('../types').MessageHandlerFn} handler + * @param {AbortSignal} [signal] + * @returns {AbortSignal} + */ + subscribe (topic, handler, signal) { + const topicSubs = this._subs.get(topic) || [] -/** - * Determines whether the payload is an error thrown by Axios - * - * @param {*} payload The value to test - * - * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false - */ -function isAxiosError(payload) { - return utils.isObject(payload) && (payload.isAxiosError === true); -} + if (topicSubs.find(s => s.handler === handler)) { + throw new Error(`Already subscribed to ${topic} with this handler`) + } -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/HttpStatusCode.js -const HttpStatusCode = { - Continue: 100, - SwitchingProtocols: 101, - Processing: 102, - EarlyHints: 103, - Ok: 200, - Created: 201, - Accepted: 202, - NonAuthoritativeInformation: 203, - NoContent: 204, - ResetContent: 205, - PartialContent: 206, - MultiStatus: 207, - AlreadyReported: 208, - ImUsed: 226, - MultipleChoices: 300, - MovedPermanently: 301, - Found: 302, - SeeOther: 303, - NotModified: 304, - UseProxy: 305, - Unused: 306, - TemporaryRedirect: 307, - PermanentRedirect: 308, - BadRequest: 400, - Unauthorized: 401, - PaymentRequired: 402, - Forbidden: 403, - NotFound: 404, - MethodNotAllowed: 405, - NotAcceptable: 406, - ProxyAuthenticationRequired: 407, - RequestTimeout: 408, - Conflict: 409, - Gone: 410, - LengthRequired: 411, - PreconditionFailed: 412, - PayloadTooLarge: 413, - UriTooLong: 414, - UnsupportedMediaType: 415, - RangeNotSatisfiable: 416, - ExpectationFailed: 417, - ImATeapot: 418, - MisdirectedRequest: 421, - UnprocessableEntity: 422, - Locked: 423, - FailedDependency: 424, - TooEarly: 425, - UpgradeRequired: 426, - PreconditionRequired: 428, - TooManyRequests: 429, - RequestHeaderFieldsTooLarge: 431, - UnavailableForLegalReasons: 451, - InternalServerError: 500, - NotImplemented: 501, - BadGateway: 502, - ServiceUnavailable: 503, - GatewayTimeout: 504, - HttpVersionNotSupported: 505, - VariantAlsoNegotiates: 506, - InsufficientStorage: 507, - LoopDetected: 508, - NotExtended: 510, - NetworkAuthenticationRequired: 511, -}; + // Create controller so a call to unsubscribe can cancel the request + const controller = new AbortController() -Object.entries(HttpStatusCode).forEach(([key, value]) => { - HttpStatusCode[value] = key; -}); + this._subs.set(topic, [{ handler, controller }].concat(topicSubs)) -/* harmony default export */ const helpers_HttpStatusCode = (HttpStatusCode); + // If there is an external signal, forward the abort event + if (signal) { + signal.addEventListener('abort', () => this.unsubscribe(topic, handler)) + } -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/axios.js + return controller.signal + } + /** + * @param {string} topic + * @param {import('../types').MessageHandlerFn} [handler] + */ + unsubscribe (topic, handler) { + const subs = this._subs.get(topic) || [] + let unsubs + if (handler) { + this._subs.set(topic, subs.filter(s => s.handler !== handler)) + unsubs = subs.filter(s => s.handler === handler) + } else { + this._subs.set(topic, []) + unsubs = subs + } + if (!(this._subs.get(topic) || []).length) { + this._subs.delete(topic) + } + unsubs.forEach(s => s.controller.abort()) + } +} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/pubsub/index.js @@ -244336,13396 +168534,14457 @@ Object.entries(HttpStatusCode).forEach(([key, value]) => { +/** + * @param {import('../types').Options} config + */ +function pubsub_createPubsub (config) { + const subscriptionTracker = new SubscriptionTracker() + return { + ls: pubsub_ls_createLs(config), + peers: createPeers(config), + publish: publish_createPublish(config), + subscribe: createSubscribe(config, subscriptionTracker), + unsubscribe: createUnsubscribe(config, subscriptionTracker) + } +} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/refs/local.js +const createLocal = configure(api => { + /** + * @type {import('../types').RefsAPI["local"]} + */ + async function * refsLocal (options = {}) { + const res = await api.post('refs/local', { + signal: options.signal, + transform: objectToCamel, + searchParams: toUrlSearchParams(options), + headers: options.headers + }) + yield * res.ndjson() + } + return refsLocal +}) -/** - * Create an instance of Axios - * - * @param {Object} defaultConfig The default config for the instance - * - * @returns {Axios} A new instance of Axios - */ -function createInstance(defaultConfig) { - const context = new core_Axios(defaultConfig); - const instance = bind(core_Axios.prototype.request, context); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/refs/index.js - // Copy axios.prototype to instance - utils.extend(instance, core_Axios.prototype, context, {allOwnKeys: true}); - // Copy context to instance - utils.extend(instance, context, null, {allOwnKeys: true}); - // Factory for creating new instances - instance.create = function create(instanceConfig) { - return createInstance(mergeConfig(defaultConfig, instanceConfig)); - }; - return instance; -} -// Create the default instance to be exported -const axios_axios = createInstance(lib_defaults); -// Expose Axios class to allow class inheritance -axios_axios.Axios = core_Axios; +const createRefs = configure((api, opts) => { + /** + * @type {import('../types').RefsAPI["refs"]} + */ + const refs = async function * (args, options = {}) { + /** @type {import('../types').IPFSPath[]} */ + const argsArr = Array.isArray(args) ? args : [args] -// Expose Cancel & CancelToken -axios_axios.CanceledError = cancel_CanceledError; -axios_axios.CancelToken = cancel_CancelToken; -axios_axios.isCancel = isCancel; -axios_axios.VERSION = VERSION; -axios_axios.toFormData = helpers_toFormData; + const res = await api.post('refs', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: argsArr.map(arg => `${arg instanceof Uint8Array ? node_modules_multiformats_src_cid_CID.decode(arg) : arg}`), + ...options + }), + headers: options.headers, + transform: objectToCamel + }) -// Expose AxiosError class -axios_axios.AxiosError = core_AxiosError; + yield * res.ndjson() + } -// alias for CanceledError for backward compatibility -axios_axios.Cancel = axios_axios.CanceledError; + return Object.assign(refs, { + local: createLocal(opts) + }) +}) -// Expose all/spread -axios_axios.all = function all(promises) { - return Promise.all(promises); -}; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/repo/gc.js -axios_axios.spread = spread; -// Expose isAxiosError -axios_axios.isAxiosError = isAxiosError; -// Expose mergeConfig -axios_axios.mergeConfig = mergeConfig; -axios_axios.AxiosHeaders = core_AxiosHeaders; +const createGc = configure(api => { + /** + * @type {import('../types').RepoAPI["gc"]} + */ + async function * gc (options = {}) { + const res = await api.post('repo/gc', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers, + transform: (res) => { + return { + err: res.Error ? new Error(res.Error) : null, + cid: (res.Key || {})['/'] ? node_modules_multiformats_src_cid_CID.parse(res.Key['/']) : null + } + } + }) -axios_axios.formToJSON = thing => helpers_formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing); + yield * res.ndjson() + } + return gc +}) -axios_axios.getAdapter = adapters.getAdapter; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/repo/stat.js -axios_axios.HttpStatusCode = helpers_HttpStatusCode; -axios_axios.default = axios_axios; -// this module should only have a default export -/* harmony default export */ const lib_axios = (axios_axios); +const repo_stat_createStat = configure(api => { + /** + * @type {import('../types').RepoAPI["stat"]} + */ + async function stat (options = {}) { + const res = await api.post('repo/stat', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers + }) + const data = await res.json() -// EXTERNAL MODULE: ./node_modules/@aws-sdk/lib-storage/dist-cjs/index.js -var lib_storage_dist_cjs = __nccwpck_require__(20488); -// EXTERNAL MODULE: external "fs" -var external_fs_ = __nccwpck_require__(57147); -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/multiformats/vendor/base-x.js -// base-x encoding / decoding -// Copyright (c) 2018 base-x contributors -// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) -// Distributed under the MIT software license, see the accompanying -// file LICENSE or http://www.opensource.org/licenses/mit-license.php. -function sdk_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { - if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } - var BASE_MAP = new Uint8Array(256); - for (var j = 0; j < BASE_MAP.length; j++) { - BASE_MAP[j] = 255; - } - for (var i = 0; i < ALPHABET.length; i++) { - var x = ALPHABET.charAt(i); - var xc = x.charCodeAt(0); - if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') } - BASE_MAP[xc] = i; - } - var BASE = ALPHABET.length; - var LEADER = ALPHABET.charAt(0); - var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up - var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up - function encode (source) { - if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) { - source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); - } else if (Array.isArray(source)) { - source = Uint8Array.from(source); - } - if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') } - if (source.length === 0) { return '' } - // Skip & count leading zeroes. - var zeroes = 0; - var length = 0; - var pbegin = 0; - var pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; - } - // Allocate enough space in big-endian base58 representation. - var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; - var b58 = new Uint8Array(size); - // Process the bytes. - while (pbegin !== pend) { - var carry = source[pbegin]; - // Apply "b58 = b58 * 256 + ch". - var i = 0; - for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { - carry += (256 * b58[it1]) >>> 0; - b58[it1] = (carry % BASE) >>> 0; - carry = (carry / BASE) >>> 0; - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - pbegin++; - } - // Skip leading zeroes in base58 result. - var it2 = size - length; - while (it2 !== size && b58[it2] === 0) { - it2++; - } - // Translate the result into a string. - var str = LEADER.repeat(zeroes); - for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); } - return str - } - function decodeUnsafe (source) { - if (typeof source !== 'string') { throw new TypeError('Expected String') } - if (source.length === 0) { return new Uint8Array() } - var psz = 0; - // Skip leading spaces. - if (source[psz] === ' ') { return } - // Skip and count leading '1's. - var zeroes = 0; - var length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; - } - // Allocate enough space in big-endian base256 representation. - var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. - var b256 = new Uint8Array(size); - // Process the characters. - while (source[psz]) { - // Decode character - var carry = BASE_MAP[source.charCodeAt(psz)]; - // Invalid character - if (carry === 255) { return } - var i = 0; - for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { - carry += (BASE * b256[it3]) >>> 0; - b256[it3] = (carry % 256) >>> 0; - carry = (carry / 256) >>> 0; - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - psz++; - } - // Skip trailing spaces. - if (source[psz] === ' ') { return } - // Skip leading zeroes in b256. - var it4 = size - length; - while (it4 !== size && b256[it4] === 0) { - it4++; - } - var vch = new Uint8Array(zeroes + (size - it4)); - var j = zeroes; - while (it4 !== size) { - vch[j++] = b256[it4++]; + return { + numObjects: BigInt(data.NumObjects), + repoSize: BigInt(data.RepoSize), + repoPath: data.RepoPath, + version: data.Version, + storageMax: BigInt(data.StorageMax) } - return vch - } - function decode (string) { - var buffer = decodeUnsafe(string); - if (buffer) { return buffer } - throw new Error(`Non-${name} character`) - } - return { - encode: encode, - decodeUnsafe: decodeUnsafe, - decode: decode } -} -var sdk_node_modules_multiformats_vendor_base_x_src = sdk_node_modules_multiformats_vendor_base_x_base; - -var sdk_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = sdk_node_modules_multiformats_vendor_base_x_src; - -/* harmony default export */ const sdk_node_modules_multiformats_vendor_base_x = (sdk_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX); + return stat +}) -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/multiformats/src/bytes.js -const sdk_node_modules_multiformats_src_bytes_empty = new Uint8Array(0) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/repo/version.js -/** - * @param {Uint8Array} d - */ -const sdk_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') -/** - * @param {string} hex - */ -const sdk_node_modules_multiformats_src_bytes_fromHex = hex => { - const hexes = hex.match(/../g) - return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : sdk_node_modules_multiformats_src_bytes_empty -} -/** - * @param {Uint8Array} aa - * @param {Uint8Array} bb - */ -const sdk_node_modules_multiformats_src_bytes_equals = (aa, bb) => { - if (aa === bb) return true - if (aa.byteLength !== bb.byteLength) { - return false - } +const createVersion = configure(api => { + /** + * @type {import('../types').RepoAPI["version"]} + */ + async function version (options = {}) { + const res = await (await api.post('repo/version', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers + })).json() - for (let ii = 0; ii < aa.byteLength; ii++) { - if (aa[ii] !== bb[ii]) { - return false - } + return res.Version } + return version +}) + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/repo/index.js + + - return true -} /** - * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o - * @returns {Uint8Array} + * @param {import('../types').Options} config */ -const sdk_node_modules_multiformats_src_bytes_coerce = o => { - if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o - if (o instanceof ArrayBuffer) return new Uint8Array(o) - if (ArrayBuffer.isView(o)) { - return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) +function createRepo (config) { + return { + gc: createGc(config), + stat: repo_stat_createStat(config), + version: createVersion(config) } - throw new Error('Unknown type, must be binary type') } -/** - * @param {any} o - * @returns {o is ArrayBuffer|ArrayBufferView} - */ -const sdk_node_modules_multiformats_src_bytes_isBinary = o => - o instanceof ArrayBuffer || ArrayBuffer.isView(o) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/stats/bw.js -/** - * @param {string} str - * @returns {Uint8Array} - */ -const sdk_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) -/** - * @param {Uint8Array} b - * @returns {string} - */ -const sdk_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) +const createBw = configure(api => { + /** + * @type {import('../types').StatsAPI["bw"]} + */ + async function * bw (options = {}) { + const res = await api.post('stats/bw', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers, + transform: (stats) => ({ + totalIn: BigInt(stats.TotalIn), + totalOut: BigInt(stats.TotalOut), + rateIn: parseFloat(stats.RateIn), + rateOut: parseFloat(stats.RateOut) + }) + }) + yield * res.ndjson() + } + return bw +}) -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/multiformats/src/bases/base.js +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/stats/index.js -// Linter can't see that API is used in types. -// eslint-disable-next-line /** - * Class represents both BaseEncoder and MultibaseEncoder meaning it - * can be used to encode to multibase or base encode without multibase - * prefix. - * - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseEncoder} - * @implements {API.BaseEncoder} + * @param {import('../types').Options} config */ -class sdk_node_modules_multiformats_src_bases_base_Encoder { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(bytes:Uint8Array) => string} baseEncode - */ - constructor (name, prefix, baseEncode) { - this.name = name - this.prefix = prefix - this.baseEncode = baseEncode - } - - /** - * @param {Uint8Array} bytes - * @returns {API.Multibase} - */ - encode (bytes) { - if (bytes instanceof Uint8Array) { - return `${this.prefix}${this.baseEncode(bytes)}` - } else { - throw Error('Unknown type, must be binary type') - } +function createStats (config) { + return { + bitswap: createStat(config), + repo: repo_stat_createStat(config), + bw: createBw(config) } } -/** - * @template {string} Prefix - */ -/** - * Class represents both BaseDecoder and MultibaseDecoder so it could be used - * to decode multibases (with matching prefix) or just base decode strings - * with corresponding base encoding. - * - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseDecoder} - * @implements {API.UnibaseDecoder} - * @implements {API.BaseDecoder} - */ -class sdk_node_modules_multiformats_src_bases_base_Decoder { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(text:string) => Uint8Array} baseDecode - */ - constructor (name, prefix, baseDecode) { - this.name = name - this.prefix = prefix - /* c8 ignore next 3 */ - if (prefix.codePointAt(0) === undefined) { - throw new Error('Invalid prefix character') - } - /** @private */ - this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0)) - this.baseDecode = baseDecode - } +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/swarm/addrs.js + + + + +const createAddrs = configure(api => { /** - * @param {string} text + * @type {import('../types.js').SwarmAPI["addrs"]} */ - decode (text) { - if (typeof text === 'string') { - if (text.codePointAt(0) !== this.prefixCodePoint) { - throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`) - } - return this.baseDecode(text.slice(this.prefix.length)) - } else { - throw Error('Can only multibase decode strings') - } + async function addrs (options = {}) { + const res = await api.post('swarm/addrs', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers + }) + + /** @type {{ Addrs: Record }} */ + const { Addrs } = await res.json() + + return Object.keys(Addrs).map(id => ({ + id: peerIdFromString(id), + addrs: (Addrs[id] || []).map(a => src_multiaddr(a)) + })) } + return addrs +}) + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/swarm/connect.js + + +const createConnect = configure(api => { /** - * @template {string} OtherPrefix - * @param {API.UnibaseDecoder|ComposedDecoder} decoder - * @returns {ComposedDecoder} + * @type {import('../types').SwarmAPI["connect"]} */ - or (decoder) { - return sdk_node_modules_multiformats_src_bases_base_or(this, decoder) + async function connect (addr, options = {}) { + const res = await api.post('swarm/connect', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: addr, + ...options + }), + headers: options.headers + }) + const { Strings } = await res.json() + + return Strings || [] } -} + return connect +}) -/** - * @template {string} Prefix - * @typedef {Record>} Decoders - */ +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/swarm/disconnect.js -/** - * @template {string} Prefix - * @implements {API.MultibaseDecoder} - * @implements {API.CombobaseDecoder} - */ -class sdk_node_modules_multiformats_src_bases_base_ComposedDecoder { + + +const createDisconnect = configure(api => { /** - * @param {Decoders} decoders + * @type {import('../types').SwarmAPI["disconnect"]} */ - constructor (decoders) { - this.decoders = decoders + async function disconnect (addr, options = {}) { + const res = await api.post('swarm/disconnect', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: addr, + ...options + }), + headers: options.headers + }) + const { Strings } = await res.json() + + return Strings || [] } + return disconnect +}) + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/swarm/local-addrs.js + + + +const createLocalAddrs = configure(api => { /** - * @template {string} OtherPrefix - * @param {API.UnibaseDecoder|ComposedDecoder} decoder - * @returns {ComposedDecoder} + * @type {import('../types.js').SwarmAPI["localAddrs"]} */ - or (decoder) { - return sdk_node_modules_multiformats_src_bases_base_or(this, decoder) + async function localAddrs (options = {}) { + const res = await api.post('swarm/addrs/local', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers + }) + + /** @type {{ Strings: string[] }} */ + const { Strings } = await res.json() + + return (Strings || []).map(a => src_multiaddr(a)) } + return localAddrs +}) + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/swarm/peers.js + + + + +const peers_createPeers = configure(api => { /** - * @param {string} input - * @returns {Uint8Array} + * @type {import('../types').SwarmAPI["peers"]} */ - decode (input) { - const prefix = /** @type {Prefix} */ (input[0]) - const decoder = this.decoders[prefix] - if (decoder) { - return decoder.decode(input) - } else { - throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`) - } + async function peers (options = {}) { + const res = await api.post('swarm/peers', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers + }) + + /** @type {{ Peers: { Peer: string, Addr: string, Muxer?: string, Latency?: string, Streams?: string[], Direction?: 0 | 1 }[] }} */ + const { Peers } = await res.json() + + return (Peers || []).map(peer => { + return { + addr: src_multiaddr(peer.Addr), + peer: peerIdFromString(peer.Peer), + muxer: peer.Muxer, + latency: peer.Latency, + streams: peer.Streams, + // eslint-disable-next-line no-nested-ternary + direction: peer.Direction == null ? undefined : peer.Direction === 0 ? 'inbound' : 'outbound' + } + }) } -} + return peers +}) + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/swarm/index.js + + + + -/** - * @template {string} L - * @template {string} R - * @param {API.UnibaseDecoder|API.CombobaseDecoder} left - * @param {API.UnibaseDecoder|API.CombobaseDecoder} right - * @returns {ComposedDecoder} - */ -const sdk_node_modules_multiformats_src_bases_base_or = (left, right) => new sdk_node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({ - ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }), - ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right }) -})) /** - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseCodec} - * @implements {API.MultibaseEncoder} - * @implements {API.MultibaseDecoder} - * @implements {API.BaseCodec} - * @implements {API.BaseEncoder} - * @implements {API.BaseDecoder} + * @param {import('../types').Options} config + * @returns {import('../types').IPFS['swarm']} */ -class sdk_node_modules_multiformats_src_bases_base_Codec { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(bytes:Uint8Array) => string} baseEncode - * @param {(text:string) => Uint8Array} baseDecode - */ - constructor (name, prefix, baseEncode, baseDecode) { - this.name = name - this.prefix = prefix - this.baseEncode = baseEncode - this.baseDecode = baseDecode - this.encoder = new sdk_node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode) - this.decoder = new sdk_node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode) +function createSwarm (config) { + return { + addrs: createAddrs(config), + connect: createConnect(config), + disconnect: createDisconnect(config), + localAddrs: createLocalAddrs(config), + peers: peers_createPeers(config) } +} + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/add-all.js + + - /** - * @param {Uint8Array} input - */ - encode (input) { - return this.encoder.encode(input) - } + + + +const add_all_createAddAll = configure((api) => { /** - * @param {string} input + * @type {import('./types.js').RootAPI["addAll"]} */ - decode (input) { - return this.decoder.decode(input) + async function * addAll (source, options = {}) { + // allow aborting requests on body errors + const controller = new AbortController() + const signal = abortSignal(controller.signal, options.signal) + const { headers, body, total, parts } = + await multipart_request_multipartRequest(source, controller, options.headers) + + // In browser response body only starts streaming once upload is + // complete, at which point all the progress updates are invalid. If + // length of the content is computable we can interpret progress from + // `{ total, loaded}` passed to `onUploadProgress` and `multipart.total` + // in which case we disable progress updates to be written out. + const [progressFn, onUploadProgress] = typeof options.progress === 'function' + ? createProgressHandler(total, parts, options.progress) + : [undefined, undefined] + + const res = await api.post('add', { + searchParams: toUrlSearchParams({ + 'stream-channels': true, + ...options, + progress: Boolean(progressFn) + }), + onUploadProgress, + signal, + headers, + body + }) + + for await (let file of res.ndjson()) { + file = objectToCamel(file) + + if (file.hash !== undefined) { + yield add_all_toCoreInterface(file) + } else if (progressFn) { + progressFn(file.bytes || 0, file.name) + } + } } -} + return addAll +}) /** - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {(bytes:Uint8Array) => string} options.encode - * @param {(input:string) => Uint8Array} options.decode - * @returns {Codec} + * Returns simple progress callback when content length isn't computable or a + * progress event handler that calculates progress from upload progress events. + * + * @param {number} total + * @param {{name:string, start:number, end:number}[]|null} parts + * @param {import('./types.js').IPFSCoreAddProgressFn} progress + * @returns {[import('./types.js').IPFSCoreAddProgressFn|undefined, import('./types.js').IPFSUtilsHttpUploadProgressFn|undefined]} */ -const sdk_node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) => - new sdk_node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode) +const createProgressHandler = (total, parts, progress) => + parts ? [undefined, createOnUploadProgress(total, parts, progress)] : [progress, undefined] /** - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {string} options.alphabet - * @returns {Codec} + * Creates a progress handler that interpolates progress from upload progress + * events and total size of the content that is added. + * + * @param {number} size - actual content size + * @param {{name:string, start:number, end:number}[]} parts + * @param {import('./types.js').IPFSCoreAddProgressFn} progress + * @returns {import('./types.js').IPFSUtilsHttpUploadProgressFn} */ -const sdk_node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => { - const { encode, decode } = sdk_node_modules_multiformats_vendor_base_x(alphabet, name) - return sdk_node_modules_multiformats_src_bases_base_from({ - prefix, - name, - encode, - /** - * @param {string} text - */ - decode: text => sdk_node_modules_multiformats_src_bytes_coerce(decode(text)) - }) +const createOnUploadProgress = (size, parts, progress) => { + let index = 0 + const count = parts.length + return ({ loaded, total }) => { + // Derive position from the current progress. + const position = Math.floor(loaded / total * size) + while (index < count) { + const { start, end, name } = parts[index] + // If within current part range report progress and break the loop + if (position < end) { + progress(position - start, name) + break + // If passed current part range report final byte for the chunk and + // move to next one. + } else { + progress(end - start, name) + index += 1 + } + } + } } /** - * @param {string} string - * @param {string} alphabet - * @param {number} bitsPerChar - * @param {string} name - * @returns {Uint8Array} + * @param {object} input + * @param {string} input.name + * @param {string} input.hash + * @param {string} input.size + * @param {string} [input.mode] + * @param {number} [input.mtime] + * @param {number} [input.mtimeNsecs] */ -const sdk_node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { - // Build the character lookup table: - /** @type {Record} */ - const codes = {} - for (let i = 0; i < alphabet.length; ++i) { - codes[alphabet[i]] = i +function add_all_toCoreInterface ({ name, hash, size, mode, mtime, mtimeNsecs }) { + /** @type {import('./types.js').AddResult} */ + const output = { + path: name, + cid: node_modules_multiformats_src_cid_CID.parse(hash), + size: parseInt(size) } - // Count the padding bytes: - let end = string.length - while (string[end - 1] === '=') { - --end + if (mode != null) { + output.mode = parseInt(mode, 8) } - // Allocate the output: - const out = new Uint8Array((end * bitsPerChar / 8) | 0) - - // Parse the data: - let bits = 0 // Number of bits currently in the buffer - let buffer = 0 // Bits waiting to be written out, MSB first - let written = 0 // Next byte to write - for (let i = 0; i < end; ++i) { - // Read one character from the string: - const value = codes[string[i]] - if (value === undefined) { - throw new SyntaxError(`Non-${name} character`) + if (mtime != null) { + output.mtime = { + secs: mtime, + nsecs: mtimeNsecs || 0 } + } + + return output +} + +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/files/normalise-candidate-single.js + - // Append the bits to the buffer: - buffer = (buffer << bitsPerChar) | value - bits += bitsPerChar - // Write out some bits if the buffer has a byte's worth: - if (bits >= 8) { - bits -= 8 - out[written++] = 0xff & (buffer >> bits) - } - } - // Verify that we have received just enough bits: - if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) { - throw new SyntaxError('Unexpected end of data') - } - return out -} /** - * @param {Uint8Array} data - * @param {string} alphabet - * @param {number} bitsPerChar - * @returns {string} + * @typedef {import('ipfs-core-types/src/utils').ToContent} ToContent + * @typedef {import('ipfs-unixfs-importer').ImportCandidate} ImporterImportCandidate + * @typedef {import('ipfs-core-types/src/utils').ImportCandidate} ImportCandidate + * @typedef {import('ipfs-core-types/src/utils').ImportCandidateStream} ImportCandidateStream */ -const sdk_node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => { - const pad = alphabet[alphabet.length - 1] === '=' - const mask = (1 << bitsPerChar) - 1 - let out = '' - - let bits = 0 // Number of bits currently in the buffer - let buffer = 0 // Bits waiting to be written out, MSB first - for (let i = 0; i < data.length; ++i) { - // Slurp data into the buffer: - buffer = (buffer << 8) | data[i] - bits += 8 - // Write out as much as we can: - while (bits > bitsPerChar) { - bits -= bitsPerChar - out += alphabet[mask & (buffer >> bits)] - } +/** + * @param {ImportCandidate} input + * @param {(content:ToContent) => Promise>} normaliseContent + */ +// eslint-disable-next-line complexity +async function * normaliseCandidateSingle (input, normaliseContent) { + if (input === null || input === undefined) { + throw err_code(new Error(`Unexpected input: ${input}`), 'ERR_UNEXPECTED_INPUT') } - // Partial character: - if (bits) { - out += alphabet[mask & (buffer << (bitsPerChar - bits))] + // String + if (typeof input === 'string' || input instanceof String) { + yield normalise_candidate_single_toFileObject(input.toString(), normaliseContent) + return } - // Add padding characters until we hit a byte boundary: - if (pad) { - while ((out.length * bitsPerChar) & 7) { - out += '=' - } + // Uint8Array|ArrayBuffer|TypedArray + // Blob|File + if (isBytes(input) || isBlob(input)) { + yield normalise_candidate_single_toFileObject(input, normaliseContent) + return } - return out -} - -/** - * RFC4648 Factory - * - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {string} options.alphabet - * @param {number} options.bitsPerChar - */ -const sdk_node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { - return sdk_node_modules_multiformats_src_bases_base_from({ - prefix, - name, - encode (input) { - return sdk_node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar) - }, - decode (input) { - return sdk_node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name) - } - }) -} + // Browser ReadableStream + if (isReadableStream(input)) { + input = browserReadableStreamToIt(input) + } -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/multiformats/src/bases/base32.js + // Iterable + if (Symbol.iterator in input || Symbol.asyncIterator in input) { + const peekable = peekableIterator(input) + /** @type {any} value **/ + const { value, done } = await peekable.peek() -const sdk_node_modules_multiformats_src_bases_base32_base32 = sdk_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'b', - name: 'base32', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567', - bitsPerChar: 5 -}) + if (done) { + // make sure empty iterators result in empty files + yield { content: [] } + return + } -const sdk_node_modules_multiformats_src_bases_base32_base32upper = sdk_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'B', - name: 'base32upper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', - bitsPerChar: 5 -}) + peekable.push(value) -const sdk_node_modules_multiformats_src_bases_base32_base32pad = sdk_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'c', - name: 'base32pad', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', - bitsPerChar: 5 -}) + // (Async)Iterable + // (Async)Iterable + // (Async)Iterable + if (Number.isInteger(value) || isBytes(value) || typeof value === 'string' || value instanceof String) { + yield normalise_candidate_single_toFileObject(peekable, normaliseContent) + return + } -const sdk_node_modules_multiformats_src_bases_base32_base32padupper = sdk_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'C', - name: 'base32padupper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', - bitsPerChar: 5 -}) + throw err_code(new Error('Unexpected input: multiple items passed - if you are using ipfs.add, please use ipfs.addAll instead'), 'ERR_UNEXPECTED_INPUT') + } -const sdk_node_modules_multiformats_src_bases_base32_base32hex = sdk_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'v', - name: 'base32hex', - alphabet: '0123456789abcdefghijklmnopqrstuv', - bitsPerChar: 5 -}) + // { path, content: ? } + // Note: Detected _after_ (Async)Iterable because Node.js fs.ReadStreams have a + // `path` property that passes this check. + if (isFileObject(input)) { + yield normalise_candidate_single_toFileObject(input, normaliseContent) + return + } -const sdk_node_modules_multiformats_src_bases_base32_base32hexupper = sdk_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'V', - name: 'base32hexupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', - bitsPerChar: 5 -}) + throw err_code(new Error('Unexpected input: cannot convert "' + typeof input + '" into ImportCandidate'), 'ERR_UNEXPECTED_INPUT') +} -const sdk_node_modules_multiformats_src_bases_base32_base32hexpad = sdk_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 't', - name: 'base32hexpad', - alphabet: '0123456789abcdefghijklmnopqrstuv=', - bitsPerChar: 5 -}) +/** + * @param {ImportCandidate} input + * @param {(content:ToContent) => Promise>} normaliseContent + */ +async function normalise_candidate_single_toFileObject (input, normaliseContent) { + // @ts-expect-error - Those properties don't exist on most input types + const { path, mode, mtime, content } = input -const sdk_node_modules_multiformats_src_bases_base32_base32hexpadupper = sdk_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'T', - name: 'base32hexpadupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', - bitsPerChar: 5 -}) + /** @type {ImporterImportCandidate} */ + const file = { + path: path || '', + mode: parseMode(mode), + mtime: src_parseMtime(mtime) + } -const sdk_node_modules_multiformats_src_bases_base32_base32z = sdk_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'h', - name: 'base32z', - alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', - bitsPerChar: 5 -}) + if (content) { + file.content = await normaliseContent(content) + } else if (!path) { // Not already a file object with path or content prop + // @ts-expect-error - input still can be different ToContent + file.content = await normaliseContent(input) + } -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/multiformats/src/bases/base58.js + return file +} +;// CONCATENATED MODULE: ./node_modules/ipfs-core-utils/src/files/normalise-input-single.js -const sdk_node_modules_multiformats_src_bases_base58_base58btc = sdk_node_modules_multiformats_src_bases_base_baseX({ - name: 'base58btc', - prefix: 'z', - alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -}) -const sdk_node_modules_multiformats_src_bases_base58_base58flickr = sdk_node_modules_multiformats_src_bases_base_baseX({ - name: 'base58flickr', - prefix: 'Z', - alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -}) -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/multiformats/vendor/varint.js -var sdk_node_modules_multiformats_vendor_varint_encode_1 = sdk_node_modules_multiformats_vendor_varint_encode; +/** + * @typedef {import('ipfs-core-types/src/utils').ImportCandidate} ImportCandidate + */ -var sdk_node_modules_multiformats_vendor_varint_MSB = 0x80 - , sdk_node_modules_multiformats_vendor_varint_REST = 0x7F - , sdk_node_modules_multiformats_vendor_varint_MSBALL = ~sdk_node_modules_multiformats_vendor_varint_REST - , sdk_node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31); +/** + * Transforms any of the `ipfs.add` input types into + * + * ``` + * AsyncIterable<{ path, mode, mtime, content: AsyncIterable }> + * ``` + * + * See https://github.com/ipfs/js-ipfs/blob/master/docs/core-api/FILES.md#ipfsadddata-options + * + * @param {ImportCandidate} input + */ +function normalise_input_single_normaliseInput (input) { + return normaliseCandidateSingle(input, normaliseContent) +} -function sdk_node_modules_multiformats_vendor_varint_encode(num, out, offset) { - out = out || []; - offset = offset || 0; - var oldOffset = offset; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/add.js - while(num >= sdk_node_modules_multiformats_vendor_varint_INT) { - out[offset++] = (num & 0xFF) | sdk_node_modules_multiformats_vendor_varint_MSB; - num /= 128; - } - while(num & sdk_node_modules_multiformats_vendor_varint_MSBALL) { - out[offset++] = (num & 0xFF) | sdk_node_modules_multiformats_vendor_varint_MSB; - num >>>= 7; - } - out[offset] = num | 0; - - sdk_node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; - - return out -} -var sdk_node_modules_multiformats_vendor_varint_decode = sdk_node_modules_multiformats_vendor_varint_read; -var sdk_node_modules_multiformats_vendor_varint_MSB$1 = 0x80 - , sdk_node_modules_multiformats_vendor_varint_REST$1 = 0x7F; -function sdk_node_modules_multiformats_vendor_varint_read(buf, offset) { - var res = 0 - , offset = offset || 0 - , shift = 0 - , counter = offset - , b - , l = buf.length; - do { - if (counter >= l) { - sdk_node_modules_multiformats_vendor_varint_read.bytes = 0; - throw new RangeError('Could not decode varint') +/** + * @param {import('./types').Options} options + */ +function src_add_createAdd (options) { + const all = add_all_createAddAll(options) + return configure(() => { + /** + * @type {import('./types').RootAPI["add"]} + */ + async function add (input, options = {}) { + const source = normalise_input_single_normaliseInput(input) + // @ts-expect-error - all may return undefined if source is empty + const addAllPromise = all(source, options) + // @ts-expect-error - last may return undefined if source is empty + return await last(addAllPromise) } - b = buf[counter++]; - res += shift < 28 - ? (b & sdk_node_modules_multiformats_vendor_varint_REST$1) << shift - : (b & sdk_node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift); - shift += 7; - } while (b >= sdk_node_modules_multiformats_vendor_varint_MSB$1) + return add + })(options) +} - sdk_node_modules_multiformats_vendor_varint_read.bytes = counter - offset; +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/cat.js - return res -} -var sdk_node_modules_multiformats_vendor_varint_N1 = Math.pow(2, 7); -var sdk_node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14); -var sdk_node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21); -var sdk_node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28); -var sdk_node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35); -var sdk_node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42); -var sdk_node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49); -var sdk_node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56); -var sdk_node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63); -var sdk_node_modules_multiformats_vendor_varint_length = function (value) { - return ( - value < sdk_node_modules_multiformats_vendor_varint_N1 ? 1 - : value < sdk_node_modules_multiformats_vendor_varint_N2 ? 2 - : value < sdk_node_modules_multiformats_vendor_varint_N3 ? 3 - : value < sdk_node_modules_multiformats_vendor_varint_N4 ? 4 - : value < sdk_node_modules_multiformats_vendor_varint_N5 ? 5 - : value < sdk_node_modules_multiformats_vendor_varint_N6 ? 6 - : value < sdk_node_modules_multiformats_vendor_varint_N7 ? 7 - : value < sdk_node_modules_multiformats_vendor_varint_N8 ? 8 - : value < sdk_node_modules_multiformats_vendor_varint_N9 ? 9 - : 10 - ) -}; +const createCat = configure(api => { + /** + * @type {import('./types').RootAPI["cat"]} + */ + async function * cat (path, options = {}) { + const res = await api.post('cat', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: path.toString(), + ...options + }), + headers: options.headers + }) -var sdk_node_modules_multiformats_vendor_varint_varint = { - encode: sdk_node_modules_multiformats_vendor_varint_encode_1 - , decode: sdk_node_modules_multiformats_vendor_varint_decode - , encodingLength: sdk_node_modules_multiformats_vendor_varint_length -}; + yield * res.iterator() + } -var sdk_node_modules_multiformats_vendor_varint_brrp_varint = sdk_node_modules_multiformats_vendor_varint_varint; + return cat +}) -/* harmony default export */ const sdk_node_modules_multiformats_vendor_varint = (sdk_node_modules_multiformats_vendor_varint_brrp_varint); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/commands.js -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/multiformats/src/varint.js -/** - * @param {Uint8Array} data - * @param {number} [offset=0] - * @returns {[number, number]} - */ -const sdk_node_modules_multiformats_src_varint_decode = (data, offset = 0) => { - const code = sdk_node_modules_multiformats_vendor_varint.decode(data, offset) - return [code, sdk_node_modules_multiformats_vendor_varint.decode.bytes] -} +const createCommands = configure(api => { + /** + * @type {import('./types').RootAPI["commands"]} + */ + const commands = async (options = {}) => { + const res = await api.post('commands', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers + }) -/** - * @param {number} int - * @param {Uint8Array} target - * @param {number} [offset=0] - */ -const sdk_node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => { - sdk_node_modules_multiformats_vendor_varint.encode(int, target, offset) - return target -} + return res.json() + } + return commands +}) -/** - * @param {number} int - * @returns {number} - */ -const sdk_node_modules_multiformats_src_varint_encodingLength = (int) => { - return sdk_node_modules_multiformats_vendor_varint.encodingLength(int) -} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/dns.js -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/multiformats/src/hashes/digest.js +const createDns = configure(api => { + /** + * @type {import('./types').RootAPI["dns"]} + */ + const dns = async (domain, options = {}) => { + const res = await api.post('dns', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: domain, + ...options + }), + headers: options.headers + }) + const data = await res.json() -/** - * Creates a multihash digest. - * - * @template {number} Code - * @param {Code} code - * @param {Uint8Array} digest - */ -const sdk_node_modules_multiformats_src_hashes_digest_create = (code, digest) => { - const size = digest.byteLength - const sizeOffset = sdk_node_modules_multiformats_src_varint_encodingLength(code) - const digestOffset = sizeOffset + sdk_node_modules_multiformats_src_varint_encodingLength(size) + return data.Path + } - const bytes = new Uint8Array(digestOffset + size) - sdk_node_modules_multiformats_src_varint_encodeTo(code, bytes, 0) - sdk_node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset) - bytes.set(digest, digestOffset) + return dns +}) - return new sdk_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) -} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/get-endpoint-config.js -/** - * Turns bytes representation of multihash digest into an instance. - * - * @param {Uint8Array} multihash - * @returns {MultihashDigest} - */ -const sdk_node_modules_multiformats_src_hashes_digest_decode = (multihash) => { - const bytes = sdk_node_modules_multiformats_src_bytes_coerce(multihash) - const [code, sizeOffset] = sdk_node_modules_multiformats_src_varint_decode(bytes) - const [size, digestOffset] = sdk_node_modules_multiformats_src_varint_decode(bytes.subarray(sizeOffset)) - const digest = bytes.subarray(sizeOffset + digestOffset) - if (digest.byteLength !== size) { - throw new Error('Incorrect length') +const createGetEndpointConfig = configure(api => { + return () => { + const url = new URL(api.opts.base || '') + return { + host: url.hostname, + port: url.port, + protocol: url.protocol, + pathname: url.pathname, + 'api-path': url.pathname + } } +}) - return new sdk_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) -} +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/get.js -/** - * @param {MultihashDigest} a - * @param {unknown} b - * @returns {b is MultihashDigest} - */ -const sdk_node_modules_multiformats_src_hashes_digest_equals = (a, b) => { - if (a === b) { - return true - } else { - const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) - return ( - a.code === data.code && - a.size === data.size && - data.bytes instanceof Uint8Array && - sdk_node_modules_multiformats_src_bytes_equals(a.bytes, data.bytes) - ) - } -} -/** - * @typedef {import('./interface.js').MultihashDigest} MultihashDigest - */ -/** - * Represents a multihash digest which carries information about the - * hashing algorithm and an actual hash digest. - * - * @template {number} Code - * @template {number} Size - * @class - * @implements {MultihashDigest} - */ -class sdk_node_modules_multiformats_src_hashes_digest_Digest { +const src_get_createGet = configure(api => { /** - * Creates a multihash digest. - * - * @param {Code} code - * @param {Size} size - * @param {Uint8Array} digest - * @param {Uint8Array} bytes + * @type {import('./types').RootAPI["get"]} */ - constructor (code, size, digest, bytes) { - this.code = code - this.size = size - this.digest = digest - this.bytes = bytes - } -} + async function * get (path, options = {}) { + /** @type {Record} */ + const opts = { + arg: `${path instanceof Uint8Array ? node_modules_multiformats_src_cid_CID.decode(path) : path}`, + ...options + } + + if (opts.compressionLevel) { + opts['compression-level'] = opts.compressionLevel + delete opts.compressionLevel + } -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/multiformats/src/cid.js + const res = await api.post('get', { + signal: options.signal, + searchParams: toUrlSearchParams(opts), + headers: options.headers + }) + yield * res.iterator() + } + return get +}) +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/id.js -// Linter can see that API is used in types. -// eslint-disable-next-line -// This way TS will also expose all the types from module -/** - * @template {API.Link} T - * @template {string} Prefix - * @param {T} link - * @param {API.MultibaseEncoder} [base] - * @returns {API.ToString} - */ -const sdk_node_modules_multiformats_src_cid_format = (link, base) => { - const { bytes, version } = link - switch (version) { - case 0: - return sdk_node_modules_multiformats_src_cid_toStringV0( - bytes, - sdk_node_modules_multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder<"z">} */ (base) || sdk_node_modules_multiformats_src_bases_base58_base58btc.encoder - ) - default: - return sdk_node_modules_multiformats_src_cid_toStringV1( - bytes, - sdk_node_modules_multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder} */ (base || sdk_node_modules_multiformats_src_bases_base32_base32.encoder) - ) - } -} +const createId = configure(api => { + /** + * @type {import('./types').RootAPI["id"]} + */ + async function id (options = {}) { + const res = await api.post('id', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: options.peerId ? options.peerId.toString() : undefined, + ...options + }), + headers: options.headers + }) + const data = await res.json() -/** - * @template {API.UnknownLink} Link - * @param {Link} link - * @returns {API.LinkJSON} - */ -const sdk_node_modules_multiformats_src_cid_toJSON = (link) => ({ - '/': sdk_node_modules_multiformats_src_cid_format(link) -}) + const output = { + ...objectToCamel(data) + } -/** - * @template {API.UnknownLink} Link - * @param {API.LinkJSON} json - */ -const sdk_node_modules_multiformats_src_cid_fromJSON = (json) => - sdk_node_modules_multiformats_src_cid_CID.parse(json['/']) + output.id = peerIdFromString(output.id) -/** @type {WeakMap>} */ -const sdk_node_modules_multiformats_src_cid_cache = new WeakMap() + if (output.addresses) { + output.addresses = output.addresses.map((/** @type {string} */ ma) => src_multiaddr(ma)) + } -/** - * @param {API.UnknownLink} cid - * @returns {Map} - */ -const sdk_node_modules_multiformats_src_cid_baseCache = cid => { - const baseCache = sdk_node_modules_multiformats_src_cid_cache.get(cid) - if (baseCache == null) { - const baseCache = new Map() - sdk_node_modules_multiformats_src_cid_cache.set(cid, baseCache) - return baseCache + // @ts-expect-error server output is not typed + return output } - return baseCache -} + return id +}) + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/is-online.js + /** - * @template {unknown} [Data=unknown] - * @template {number} [Format=number] - * @template {number} [Alg=number] - * @template {API.Version} [Version=API.Version] - * @implements {API.Link} + * @param {import('./types').Options} options */ +const createIsOnline = options => { + const id = createId(options) -class sdk_node_modules_multiformats_src_cid_CID { /** - * @param {Version} version - Version of the CID - * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content. - * @param {Uint8Array} bytes + * @type {import('./types').RootAPI["isOnline"]} */ - constructor (version, code, multihash, bytes) { - /** @readonly */ - this.code = code - /** @readonly */ - this.version = version - /** @readonly */ - this.multihash = multihash - /** @readonly */ - this.bytes = bytes + async function isOnline (options = {}) { + const res = await id(options) - // flag to serializers that this is a CID and - // should be treated specially - /** @readonly */ - this['/'] = bytes + return Boolean(res && res.addresses && res.addresses.length) } + return isOnline +} + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/ls.js + - /** - * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` - * please either use `CID.asCID(cid)` or switch to new signalling mechanism - * - * @deprecated - */ - get asCID () { - return this - } - // ArrayBufferView - get byteOffset () { - return this.bytes.byteOffset - } - // ArrayBufferView - get byteLength () { - return this.bytes.byteLength - } +const src_ls_createLs = configure((api, opts) => { /** - * @returns {CID} + * @type {import('./types').RootAPI["ls"]} */ - toV0 () { - switch (this.version) { - case 0: { - return /** @type {CID} */ (this) + async function * ls (path, options = {}) { + const pathStr = `${path instanceof Uint8Array ? node_modules_multiformats_src_cid_CID.decode(path) : path}` + + /** + * @param {*} link + */ + async function mapLink (link) { + let hash = link.Hash + + if (hash.includes('/')) { + // the hash is a path, but we need the CID + const ipfsPath = hash.startsWith('/ipfs/') ? hash : `/ipfs/${hash}` + const stats = await files_stat_createStat(opts)(ipfsPath) + + hash = stats.cid + } else { + hash = node_modules_multiformats_src_cid_CID.parse(hash) } - case 1: { - const { code, multihash } = this - if (code !== sdk_node_modules_multiformats_src_cid_DAG_PB_CODE) { - throw new Error('Cannot convert a non dag-pb CID to CIDv0') - } + /** @type {import('./types').IPFSEntry} */ + const entry = { + name: link.Name, + path: pathStr + (link.Name ? `/${link.Name}` : ''), + size: link.Size, + cid: hash, + type: typeOf(link) + } - // sha2-256 - if (multihash.code !== sdk_node_modules_multiformats_src_cid_SHA_256_CODE) { - throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') + if (link.Mode) { + entry.mode = parseInt(link.Mode, 8) + } + + if (link.Mtime !== undefined && link.Mtime !== null) { + entry.mtime = { + secs: link.Mtime } - return /** @type {CID} */ ( - sdk_node_modules_multiformats_src_cid_CID.createV0( - /** @type {API.MultihashDigest} */ (multihash) - ) - ) - } - default: { - throw Error( - `Can not convert CID version ${this.version} to version 0. This is a bug please report` - ) + if (link.MtimeNsecs !== undefined && link.MtimeNsecs !== null) { + entry.mtime.nsecs = link.MtimeNsecs + } } + + return entry } - } - /** - * @returns {CID} - */ - toV1 () { - switch (this.version) { - case 0: { - const { code, digest } = this.multihash - const multihash = sdk_node_modules_multiformats_src_hashes_digest_create(code, digest) - return /** @type {CID} */ ( - sdk_node_modules_multiformats_src_cid_CID.createV1(this.code, multihash) - ) + const res = await api.post('ls', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: pathStr, + ...options + }), + headers: options.headers + }) + + for await (let result of res.ndjson()) { + result = result.Objects + + if (!result) { + throw new Error('expected .Objects in results') } - case 1: { - return /** @type {CID} */ (this) + + result = result[0] + if (!result) { + throw new Error('expected one array in results.Objects') } - default: { - throw Error( - `Can not convert CID version ${this.version} to version 1. This is a bug please report` - ) + + const links = result.Links + if (!Array.isArray(links)) { + throw new Error('expected one array in results.Objects[0].Links') + } + + if (!links.length) { + // no links, this is a file, yield a single result + yield mapLink(result) + + return } + + yield * links.map(mapLink) } } + return ls +}) - /** - * @param {unknown} other - * @returns {other is CID} - */ - equals (other) { - return sdk_node_modules_multiformats_src_cid_CID.equals(this, other) +/** + * @param {any} link + */ +function typeOf (link) { + switch (link.Type) { + case 1: + case 5: + return 'dir' + case 2: + return 'file' + default: + return 'file' } +} + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/mount.js - /** - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @param {API.Link} self - * @param {unknown} other - * @returns {other is CID} - */ - static equals (self, other) { - const unknown = - /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ ( - other - ) - return ( - unknown && - self.code === unknown.code && - self.version === unknown.version && - sdk_node_modules_multiformats_src_hashes_digest_equals(self.multihash, unknown.multihash) - ) - } - /** - * @param {API.MultibaseEncoder} [base] - * @returns {string} - */ - toString (base) { - return sdk_node_modules_multiformats_src_cid_format(this, base) - } + +const createMount = configure(api => { /** - * @returns {API.LinkJSON} + * @type {import('./types').RootAPI["mount"]} */ - toJSON () { - return { '/': sdk_node_modules_multiformats_src_cid_format(this) } - } + async function mount (options = {}) { + const res = await api.post('dns', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers + }) - link () { - return this + return objectToCamel(await res.json()) } + return mount +}) - get [Symbol.toStringTag] () { - return 'CID' - } +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/ping.js - // Legacy - [Symbol.for('nodejs.util.inspect.custom')] () { - return `CID(${this.toString()})` - } + +const createPing = configure(api => { /** - * Takes any input `value` and returns a `CID` instance if it was - * a `CID` otherwise returns `null`. If `value` is instanceof `CID` - * it will return value back. If `value` is not instance of this CID - * class, but is compatible CID it will return new instance of this - * `CID` class. Otherwise returns null. - * - * This allows two different incompatible versions of CID library to - * co-exist and interop as long as binary interface is compatible. - * - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @template {unknown} U - * @param {API.Link|U} input - * @returns {CID|null} + * @type {import('./types').RootAPI["ping"]} */ - static asCID (input) { - if (input == null) { - return null - } + async function * ping (peerId, options = {}) { + const res = await api.post('ping', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: `${peerId}`, + ...options + }), + headers: options.headers, + transform: objectToCamel + }) - const value = /** @type {any} */ (input) - if (value instanceof sdk_node_modules_multiformats_src_cid_CID) { - // If value is instance of CID then we're all set. - return value - } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { - // If value isn't instance of this CID class but `this.asCID === this` or - // `value['/'] === value.bytes` is true it is CID instance coming from a - // different implementation (diff version or duplicate). In that case we - // rebase it to this `CID` implementation so caller is guaranteed to get - // instance with expected API. - const { version, code, multihash, bytes } = value - return new sdk_node_modules_multiformats_src_cid_CID( - version, - code, - /** @type {API.MultihashDigest} */ (multihash), - bytes || sdk_node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes) - ) - } else if (value[sdk_node_modules_multiformats_src_cid_cidSymbol] === true) { - // If value is a CID from older implementation that used to be tagged via - // symbol we still rebase it to the this `CID` implementation by - // delegating that to a constructor. - const { version, multihash, code } = value - const digest = - /** @type {API.MultihashDigest} */ - (sdk_node_modules_multiformats_src_hashes_digest_decode(multihash)) - return sdk_node_modules_multiformats_src_cid_CID.create(version, code, digest) - } else { - // Otherwise value is not a CID (or an incompatible version of it) in - // which case we return `null`. - return null - } + yield * res.ndjson() } + return ping +}) - /** - * - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @param {Version} version - Version of the CID - * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param {API.MultihashDigest} digest - (Multi)hash of the of the content. - * @returns {CID} - */ - static create (version, code, digest) { - if (typeof code !== 'number') { - throw new Error('String codecs are no longer supported') - } +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/resolve.js - if (!(digest.bytes instanceof Uint8Array)) { - throw new Error('Invalid digest') - } - switch (version) { - case 0: { - if (code !== sdk_node_modules_multiformats_src_cid_DAG_PB_CODE) { - throw new Error( - `Version 0 CID must use dag-pb (code: ${sdk_node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding` - ) - } else { - return new sdk_node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes) - } - } - case 1: { - const bytes = sdk_node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes) - return new sdk_node_modules_multiformats_src_cid_CID(version, code, digest, bytes) - } - default: { - throw new Error('Invalid version') - } - } - } +const src_resolve_createResolve = configure(api => { /** - * Simplified version of `create` for CIDv0. - * - * @template {unknown} [T=unknown] - * @param {API.MultihashDigest} digest - Multihash. - * @returns {CID} + * @type {import('./types').RootAPI["resolve"]} */ - static createV0 (digest) { - return sdk_node_modules_multiformats_src_cid_CID.create(0, sdk_node_modules_multiformats_src_cid_DAG_PB_CODE, digest) + async function resolve (path, options = {}) { + const res = await api.post('resolve', { + signal: options.signal, + searchParams: toUrlSearchParams({ + arg: path, + ...options + }), + headers: options.headers + }) + const { Path } = await res.json() + return Path } + return resolve +}) + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/start.js - /** - * Simplified version of `create` for CIDv1. - * - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @param {Code} code - Content encoding format code. - * @param {API.MultihashDigest} digest - Miltihash of the content. - * @returns {CID} - */ - static createV1 (code, digest) { - return sdk_node_modules_multiformats_src_cid_CID.create(1, code, digest) - } + +const createStart = configure(api => { /** - * Decoded a CID from its binary representation. The byte array must contain - * only the CID with no additional bytes. - * - * An error will be thrown if the bytes provided do not contain a valid - * binary representation of a CID. - * - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ByteView>} bytes - * @returns {CID} + * @type {import('./types').RootAPI["start"]} */ - static decode (bytes) { - const [cid, remainder] = sdk_node_modules_multiformats_src_cid_CID.decodeFirst(bytes) - if (remainder.length) { - throw new Error('Incorrect length') - } - return cid + const start = async (options = {}) => { + throw err_code(new Error('Not implemented'), 'ERR_NOT_IMPLEMENTED') } + return start +}) + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/stop.js + + + +const createStop = configure(api => { /** - * Decoded a CID from its binary representation at the beginning of a byte - * array. - * - * Returns an array with the first element containing the CID and the second - * element containing the remainder of the original byte array. The remainder - * will be a zero-length byte array if the provided bytes only contained a - * binary CID representation. - * - * @template {unknown} T - * @template {number} C - * @template {number} A - * @template {API.Version} V - * @param {API.ByteView>} bytes - * @returns {[CID, Uint8Array]} + * @type {import('./types').RootAPI["stop"]} */ - static decodeFirst (bytes) { - const specs = sdk_node_modules_multiformats_src_cid_CID.inspectBytes(bytes) - const prefixSize = specs.size - specs.multihashSize - const multihashBytes = sdk_node_modules_multiformats_src_bytes_coerce( - bytes.subarray(prefixSize, prefixSize + specs.multihashSize) - ) - if (multihashBytes.byteLength !== specs.multihashSize) { - throw new Error('Incorrect length') - } - const digestBytes = multihashBytes.subarray( - specs.multihashSize - specs.digestSize - ) - const digest = new sdk_node_modules_multiformats_src_hashes_digest_Digest( - specs.multihashCode, - specs.digestSize, - digestBytes, - multihashBytes - ) - const cid = - specs.version === 0 - ? sdk_node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) - : sdk_node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest) - return [/** @type {CID} */(cid), bytes.subarray(specs.size)] + async function stop (options = {}) { + const res = await api.post('shutdown', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers + }) + + await res.text() } + return stop +}) + +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/version.js + + + +const version_createVersion = configure(api => { /** - * Inspect the initial bytes of a CID to determine its properties. - * - * Involves decoding up to 4 varints. Typically this will require only 4 to 6 - * bytes but for larger multicodec code values and larger multihash digest - * lengths these varints can be quite large. It is recommended that at least - * 10 bytes be made available in the `initialBytes` argument for a complete - * inspection. - * - * @template {unknown} T - * @template {number} C - * @template {number} A - * @template {API.Version} V - * @param {API.ByteView>} initialBytes - * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }} + * @type {import('./types').RootAPI["version"]} */ - static inspectBytes (initialBytes) { - let offset = 0 - const next = () => { - const [i, length] = sdk_node_modules_multiformats_src_varint_decode(initialBytes.subarray(offset)) - offset += length - return i - } - - let version = /** @type {V} */ (next()) - let codec = /** @type {C} */ (sdk_node_modules_multiformats_src_cid_DAG_PB_CODE) - if (/** @type {number} */(version) === 18) { - // CIDv0 - version = /** @type {V} */ (0) - offset = 0 - } else { - codec = /** @type {C} */ (next()) - } + async function version (options = {}) { + const res = await api.post('version', { + signal: options.signal, + searchParams: toUrlSearchParams(options), + headers: options.headers + }) - if (version !== 0 && version !== 1) { - throw new RangeError(`Invalid CID version ${version}`) + // @ts-expect-error server output is not typed + return { + ...objectToCamel(await res.json()), + 'ipfs-http-client': '1.0.0' } + } + + return version +}) + +// EXTERNAL MODULE: ./node_modules/ipfs-utils/src/files/glob-source.js +var glob_source = __nccwpck_require__(5160); +// EXTERNAL MODULE: ./node_modules/ipfs-utils/src/files/url-source.js +var url_source = __nccwpck_require__(47598); +;// CONCATENATED MODULE: ./node_modules/kubo-rpc-client/src/index.js +/* eslint-env browser */ + + + + + + + + + + + - const prefixSize = offset - const multihashCode = /** @type {A} */ (next()) // multihash code - const digestSize = next() // multihash length - const size = offset + digestSize - const multihashSize = size - prefixSize - return { version, codec, multihashCode, digestSize, multihashSize, size } - } - /** - * Takes cid in a string representation and creates an instance. If `base` - * decoder is not provided will use a default from the configuration. It will - * throw an error if encoding of the CID is not compatible with supplied (or - * a default decoder). - * - * @template {string} Prefix - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ToString, Prefix>} source - * @param {API.MultibaseDecoder} [base] - * @returns {CID} - */ - static parse (source, base) { - const [prefix, bytes] = sdk_node_modules_multiformats_src_cid_parseCIDtoBytes(source, base) - const cid = sdk_node_modules_multiformats_src_cid_CID.decode(bytes) - if (cid.version === 0 && source[0] !== 'Q') { - throw Error('Version 0 CID string must not include multibase prefix') - } - // Cache string representation to avoid computing it on `this.toString()` - sdk_node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source) - return cid - } -} -/** - * @template {string} Prefix - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ToString, Prefix>} source - * @param {API.MultibaseDecoder} [base] - * @returns {[Prefix, API.ByteView>]} - */ -const sdk_node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => { - switch (source[0]) { - // CIDv0 is parsed differently - case 'Q': { - const decoder = base || sdk_node_modules_multiformats_src_bases_base58_base58btc - return [ - /** @type {Prefix} */ (sdk_node_modules_multiformats_src_bases_base58_base58btc.prefix), - decoder.decode(`${sdk_node_modules_multiformats_src_bases_base58_base58btc.prefix}${source}`) - ] - } - case sdk_node_modules_multiformats_src_bases_base58_base58btc.prefix: { - const decoder = base || sdk_node_modules_multiformats_src_bases_base58_base58btc - return [/** @type {Prefix} */(sdk_node_modules_multiformats_src_bases_base58_base58btc.prefix), decoder.decode(source)] - } - case sdk_node_modules_multiformats_src_bases_base32_base32.prefix: { - const decoder = base || sdk_node_modules_multiformats_src_bases_base32_base32 - return [/** @type {Prefix} */(sdk_node_modules_multiformats_src_bases_base32_base32.prefix), decoder.decode(source)] - } - default: { - if (base == null) { - throw Error( - 'To parse non base32 or base58btc encoded CID multibase decoder must be provided' - ) - } - return [/** @type {Prefix} */(source[0]), base.decode(source)] - } - } -} -/** - * - * @param {Uint8Array} bytes - * @param {Map} cache - * @param {API.MultibaseEncoder<'z'>} base - */ -const sdk_node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => { - const { prefix } = base - if (prefix !== sdk_node_modules_multiformats_src_bases_base58_base58btc.prefix) { - throw Error(`Cannot string encode V0 in ${base.name} encoding`) - } - const cid = cache.get(prefix) - if (cid == null) { - const cid = base.encode(bytes).slice(1) - cache.set(prefix, cid) - return cid - } else { - return cid - } -} -/** - * @template {string} Prefix - * @param {Uint8Array} bytes - * @param {Map} cache - * @param {API.MultibaseEncoder} base - */ -const sdk_node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => { - const { prefix } = base - const cid = cache.get(prefix) - if (cid == null) { - const cid = base.encode(bytes) - cache.set(prefix, cid) - return cid - } else { - return cid - } -} -const sdk_node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70 -const sdk_node_modules_multiformats_src_cid_SHA_256_CODE = 0x12 -/** - * @param {API.Version} version - * @param {number} code - * @param {Uint8Array} multihash - * @returns {Uint8Array} - */ -const sdk_node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => { - const codeOffset = sdk_node_modules_multiformats_src_varint_encodingLength(version) - const hashOffset = codeOffset + sdk_node_modules_multiformats_src_varint_encodingLength(code) - const bytes = new Uint8Array(hashOffset + multihash.byteLength) - sdk_node_modules_multiformats_src_varint_encodeTo(version, bytes, 0) - sdk_node_modules_multiformats_src_varint_encodeTo(code, bytes, codeOffset) - bytes.set(multihash, hashOffset) - return bytes -} -const sdk_node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') -// EXTERNAL MODULE: ./node_modules/@filebase/sdk/node_modules/varint/index.js -var sdk_node_modules_varint = __nccwpck_require__(59800); -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/decoder-common.js -const decoder_common_CIDV0_BYTES = { - SHA2_256: 0x12, - LENGTH: 0x20, - DAG_PB: 0x70 -} -const decoder_common_V2_HEADER_LENGTH = /* characteristics */ 16 /* v1 offset */ + 8 /* v1 size */ + 8 /* index offset */ + 8 -/** - * Decodes varint and seeks the buffer - * - * ```js - * // needs bytes to be read first - * const bytes = reader.upTo(8) // maybe async - * ``` - * - * @param {Uint8Array} bytes - * @param {import('./coding').Seekable} seeker - * @returns {number} - */ -function decoder_common_decodeVarint (bytes, seeker) { - if (!bytes.length) { - throw new Error('Unexpected end of data') - } - const i = sdk_node_modules_varint.decode(bytes) - seeker.seek(/** @type {number} */(sdk_node_modules_varint.decode.bytes)) - return i -} -/** - * Decode v2 header - * - * ```js - * // needs bytes to be read first - * const bytes = reader.exactly(V2_HEADER_LENGTH, true) // maybe async - * ``` - * - * @param {Uint8Array} bytes - * @returns {import('./coding').CarV2FixedHeader} - */ -function decoder_common_decodeV2Header (bytes) { - const dv = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength) - let offset = 0 - const header = { - version: 2, - /** @type {[bigint, bigint]} */ - characteristics: [ - dv.getBigUint64(offset, true), - dv.getBigUint64(offset += 8, true) - ], - dataOffset: Number(dv.getBigUint64(offset += 8, true)), - dataSize: Number(dv.getBigUint64(offset += 8, true)), - indexOffset: Number(dv.getBigUint64(offset += 8, true)) - } - return header -} -/** - * Checks the length of the multihash to be read afterwards - * - * ```js - * // needs bytes to be read first - * const bytes = reader.upTo(8) // maybe async - * ``` - * - * @param {Uint8Array} bytes - */ -function decoder_common_getMultihashLength (bytes) { - // | code | length | .... | - // where both code and length are varints, so we have to decode - // them first before we can know total length - varint.decode(bytes) // code - const codeLength = /** @type {number} */(varint.decode.bytes) - const length = varint.decode(bytes.subarray(varint.decode.bytes)) - const lengthLength = /** @type {number} */(varint.decode.bytes) - const mhLength = codeLength + lengthLength + length - return mhLength -} -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/header-validator.js -/** Auto-generated with @ipld/schema@v4.2.0 at Thu Sep 14 2023 from IPLD Schema: - * - * # CarV1HeaderOrV2Pragma is a more relaxed form, and can parse {version:x} where - * # roots are optional. This is typically useful for the {verison:2} CARv2 - * # pragma. - * - * type CarV1HeaderOrV2Pragma struct { - * roots optional [&Any] - * # roots is _not_ optional for CarV1 but we defer that check within code to - * # gracefully handle the V2 case where it's just {version:X} - * version Int - * } - * - * # CarV1Header is the strict form of the header, and requires roots to be - * # present. This is compatible with the CARv1 specification. - * - * # type CarV1Header struct { - * # roots [&Any] - * # version Int - * # } - * - */ -const Kinds = { - Null: /** @returns {undefined|null} */ (/** @type {any} */ obj) => obj === null ? obj : undefined, - Int: /** @returns {undefined|number} */ (/** @type {any} */ obj) => Number.isInteger(obj) ? obj : undefined, - Float: /** @returns {undefined|number} */ (/** @type {any} */ obj) => typeof obj === 'number' && Number.isFinite(obj) ? obj : undefined, - String: /** @returns {undefined|string} */ (/** @type {any} */ obj) => typeof obj === 'string' ? obj : undefined, - Bool: /** @returns {undefined|boolean} */ (/** @type {any} */ obj) => typeof obj === 'boolean' ? obj : undefined, - Bytes: /** @returns {undefined|Uint8Array} */ (/** @type {any} */ obj) => obj instanceof Uint8Array ? obj : undefined, - Link: /** @returns {undefined|object} */ (/** @type {any} */ obj) => obj !== null && typeof obj === 'object' && obj.asCID === obj ? obj : undefined, - List: /** @returns {undefined|Array} */ (/** @type {any} */ obj) => Array.isArray(obj) ? obj : undefined, - Map: /** @returns {undefined|object} */ (/** @type {any} */ obj) => obj !== null && typeof obj === 'object' && obj.asCID !== obj && !Array.isArray(obj) && !(obj instanceof Uint8Array) ? obj : undefined -} -/** @type {{ [k in string]: (obj:any)=>undefined|any}} */ -const Types = { - 'CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)': Kinds.Link, - 'CarV1HeaderOrV2Pragma > roots (anon)': /** @returns {undefined|any} */ (/** @type {any} */ obj) => { - if (Kinds.List(obj) === undefined) { - return undefined - } - for (let i = 0; i < obj.length; i++) { - let v = obj[i] - v = Types['CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)'](v) - if (v === undefined) { - return undefined - } - if (v !== obj[i]) { - const ret = obj.slice(0, i) - for (let j = i; j < obj.length; j++) { - let v = obj[j] - v = Types['CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)'](v) - if (v === undefined) { - return undefined - } - ret.push(v) - } - return ret - } - } - return obj - }, - Int: Kinds.Int, - CarV1HeaderOrV2Pragma: /** @returns {undefined|any} */ (/** @type {any} */ obj) => { - if (Kinds.Map(obj) === undefined) { - return undefined - } - const entries = Object.entries(obj) - /** @type {{[k in string]: any}} */ - let ret = obj - let requiredCount = 1 - for (let i = 0; i < entries.length; i++) { - const [key, value] = entries[i] - switch (key) { - case 'roots': - { - const v = Types['CarV1HeaderOrV2Pragma > roots (anon)'](obj[key]) - if (v === undefined) { - return undefined - } - if (v !== value || ret !== obj) { - if (ret === obj) { - /** @type {{[k in string]: any}} */ - ret = {} - for (let j = 0; j < i; j++) { - ret[entries[j][0]] = entries[j][1] - } - } - ret.roots = v - } - } - break - case 'version': - { - requiredCount-- - const v = Types.Int(obj[key]) - if (v === undefined) { - return undefined - } - if (v !== value || ret !== obj) { - if (ret === obj) { - /** @type {{[k in string]: any}} */ - ret = {} - for (let j = 0; j < i; j++) { - ret[entries[j][0]] = entries[j][1] - } - } - ret.version = v - } - } - break - default: - return undefined - } - } - if (requiredCount > 0) { - return undefined - } - return ret - } -} -/** @type {{ [k in string]: (obj:any)=>undefined|any}} */ -const Reprs = { - 'CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)': Kinds.Link, - 'CarV1HeaderOrV2Pragma > roots (anon)': /** @returns {undefined|any} */ (/** @type {any} */ obj) => { - if (Kinds.List(obj) === undefined) { - return undefined - } - for (let i = 0; i < obj.length; i++) { - let v = obj[i] - v = Reprs['CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)'](v) - if (v === undefined) { - return undefined - } - if (v !== obj[i]) { - const ret = obj.slice(0, i) - for (let j = i; j < obj.length; j++) { - let v = obj[j] - v = Reprs['CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)'](v) - if (v === undefined) { - return undefined - } - ret.push(v) - } - return ret - } - } - return obj - }, - Int: Kinds.Int, - CarV1HeaderOrV2Pragma: /** @returns {undefined|any} */ (/** @type {any} */ obj) => { - if (Kinds.Map(obj) === undefined) { - return undefined - } - const entries = Object.entries(obj) - /** @type {{[k in string]: any}} */ - let ret = obj - let requiredCount = 1 - for (let i = 0; i < entries.length; i++) { - const [key, value] = entries[i] - switch (key) { - case 'roots': - { - const v = Reprs['CarV1HeaderOrV2Pragma > roots (anon)'](value) - if (v === undefined) { - return undefined - } - if (v !== value || ret !== obj) { - if (ret === obj) { - /** @type {{[k in string]: any}} */ - ret = {} - for (let j = 0; j < i; j++) { - ret[entries[j][0]] = entries[j][1] - } - } - ret.roots = v - } - } - break - case 'version': - { - requiredCount-- - const v = Reprs.Int(value) - if (v === undefined) { - return undefined - } - if (v !== value || ret !== obj) { - if (ret === obj) { - /** @type {{[k in string]: any}} */ - ret = {} - for (let j = 0; j < i; j++) { - ret[entries[j][0]] = entries[j][1] - } - } - ret.version = v - } - } - break - default: - return undefined - } - } - if (requiredCount > 0) { - return undefined - } - return ret - } -} -const header_validator_CarV1HeaderOrV2Pragma = { - toTyped: Types.CarV1HeaderOrV2Pragma, - toRepresentation: Reprs.CarV1HeaderOrV2Pragma -} -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/buffer-decoder.js -/** - * @typedef {import('./api').Block} Block - * @typedef {import('./api').BlockHeader} BlockHeader - * @typedef {import('./api').BlockIndex} BlockIndex - * @typedef {import('./coding').BytesBufferReader} BytesBufferReader - * @typedef {import('./coding').CarHeader} CarHeader - * @typedef {import('./coding').CarV2Header} CarV2Header - * @typedef {import('./coding').CarV2FixedHeader} CarV2FixedHeader - */ /** - * Reads header data from a `BytesReader`. The header may either be in the form - * of a `CarHeader` or `CarV2Header` depending on the CAR being read. * - * @name decoder.readHeader(reader) - * @param {BytesBufferReader} reader - * @param {number} [strictVersion] - * @returns {CarHeader | CarV2Header} + * @typedef {import('./types').Options} Options + * @typedef {import('./types').LoadBaseFn} LoadBaseFn + * @typedef {import('./types').LoadCodecFn} LoadCodecFn + * @typedef {import('./types').LoadHasherFn} LoadHasherFn + * @typedef {import('./types').IPLDOptions} IPLDOptions + * @typedef {import('./types').HTTPClientExtraOptions} HTTPClientExtraOptions + * @typedef {import('./types').EndpointConfig} EndpointConfig + * @typedef {import('./types').IPFSHTTPClient} IPFSHTTPClient */ -function readHeader (reader, strictVersion) { - const length = decodeVarint(reader.upTo(8), reader) - if (length === 0) { - throw new Error('Invalid CAR header (zero length)') - } - const header = reader.exactly(length, true) - const block = decodeDagCbor(header) - if (CarV1HeaderOrV2Pragma.toTyped(block) === undefined) { - throw new Error('Invalid CAR header format') - } - if ((block.version !== 1 && block.version !== 2) || (strictVersion !== undefined && block.version !== strictVersion)) { - throw new Error(`Invalid CAR version: ${block.version}${strictVersion !== undefined ? ` (expected ${strictVersion})` : ''}`) - } - if (block.version === 1) { - // CarV1HeaderOrV2Pragma makes roots optional, let's make it mandatory - if (!Array.isArray(block.roots)) { - throw new Error('Invalid CAR header format') - } - return block - } - // version 2 - if (block.roots !== undefined) { - throw new Error('Invalid CAR header format') - } - const v2Header = decodeV2Header(reader.exactly(V2_HEADER_LENGTH, true)) - reader.seek(v2Header.dataOffset - reader.pos) - const v1Header = readHeader(reader, 1) - return Object.assign(v1Header, v2Header) -} /** - * Reads CID sync - * - * @param {BytesBufferReader} reader - * @returns {CID} + * @param {import('./types').Options} options */ -function readCid (reader) { - const first = reader.exactly(2, false) - if (first[0] === CIDV0_BYTES.SHA2_256 && first[1] === CIDV0_BYTES.LENGTH) { - // cidv0 32-byte sha2-256 - const bytes = reader.exactly(34, true) - const multihash = Digest.decode(bytes) - return CID.create(0, CIDV0_BYTES.DAG_PB, multihash) +function src_create (options = {}) { + /** + * @type {import('./types').BlockCodec} + */ + const id = { + name: identity_identity.name, + code: identity_identity.code, + encode: (id) => id, + decode: (id) => id } - const version = decodeVarint(reader.upTo(8), reader) - if (version !== 1) { - throw new Error(`Unexpected CID version (${version})`) - } - const codec = decodeVarint(reader.upTo(8), reader) - const bytes = reader.exactly(getMultihashLength(reader.upTo(8)), true) - const multihash = Digest.decode(bytes) - return CID.create(version, codec, multihash) -} + /** @type {import('./types').MultibaseCodec[]} */ + const multibaseCodecs = Object.values(bases); -/** - * Reads the leading data of an individual block from CAR data from a - * `BytesBufferReader`. Returns a `BlockHeader` object which contains - * `{ cid, length, blockLength }` which can be used to either index the block - * or read the block binary data. - * - * @name async decoder.readBlockHead(reader) - * @param {BytesBufferReader} reader - * @returns {BlockHeader} - */ -function readBlockHead (reader) { - // length includes a CID + Binary, where CID has a variable length - // we have to deal with - const start = reader.pos - let length = decodeVarint(reader.upTo(8), reader) - if (length === 0) { - throw new Error('Invalid CAR section (zero length)') - } - length += (reader.pos - start) - const cid = readCid(reader) - const blockLength = length - Number(reader.pos - start) // subtract CID length + (options.ipld && options.ipld.bases ? options.ipld.bases : []).forEach(base => multibaseCodecs.push(base)) - return { cid, length, blockLength } -} + const multibases = new Multibases({ + bases: multibaseCodecs, + loadBase: options.ipld && options.ipld.loadBase + }) -/** - * Returns Car header and blocks from a Uint8Array - * - * @param {Uint8Array} bytes - * @returns {{ header : CarHeader | CarV2Header , blocks: Block[]}} - */ -function buffer_decoder_fromBytes (bytes) { - let reader = buffer_decoder_bytesReader(bytes) - const header = readHeader(reader) - if (header.version === 2) { - const v1length = reader.pos - header.dataOffset - reader = limitReader(reader, header.dataSize - v1length) - } + /** @type {import('./types').BlockCodec[]} */ + const blockCodecs = Object.values(codecs); - const blocks = [] - while (reader.upTo(8).length > 0) { - const { cid, blockLength } = readBlockHead(reader) + [src_namespaceObject, dag_cbor_src_namespaceObject, dag_json_src_namespaceObject, lib_namespaceObject, id].concat((options.ipld && options.ipld.codecs) || []).forEach(codec => blockCodecs.push(codec)) - blocks.push({ cid, bytes: reader.exactly(blockLength, true) }) - } + const multicodecs = new Multicodecs({ + codecs: blockCodecs, + loadCodec: options.ipld && options.ipld.loadCodec + }) - return { - header, blocks + /** @type {import('./types').MultihashHasher[]} */ + const multihashHashers = Object.values(hashes); + + (options.ipld && options.ipld.hashers ? options.ipld.hashers : []).forEach(hasher => multihashHashers.push(hasher)) + + const multihashes = new Multihashes({ + hashers: multihashHashers, + loadHasher: options.ipld && options.ipld.loadHasher + }) + + /** @type {IPFSHTTPClient} */ + const client = { + add: src_add_createAdd(options), + addAll: add_all_createAddAll(options), + bitswap: createBitswap(options), + block: createBlock(options), + bootstrap: createBootstrap(options), + cat: createCat(options), + commands: createCommands(options), + config: createConfig(options), + dag: createDag(multicodecs, options), + dht: createDht(options), + diag: createDiag(options), + dns: createDns(options), + files: createFiles(options), + get: src_get_createGet(options), + getEndpointConfig: createGetEndpointConfig(options), + id: createId(options), + isOnline: createIsOnline(options), + key: /** @type {import('./types').IPFS['key']} */(createKey(options)), + log: createLog(options), + ls: src_ls_createLs(options), + mount: createMount(options), + name: /** @type {import('./types').IPFS['name']} */(createName(options)), + object: createObject(multicodecs, options), + pin: /** @type {import('./types').IPFS['pin']} */(createPin(options)), + ping: createPing(options), + pubsub: pubsub_createPubsub(options), + refs: createRefs(options), + repo: createRepo(options), + resolve: src_resolve_createResolve(options), + start: createStart(options), + stats: createStats(options), + stop: createStop(options), + swarm: /** @type {import('./types').IPFS['swarm']} */(createSwarm(options)), + version: /** @type {import('./types').IPFS['version']} */(version_createVersion(options)), + bases: multibases, + codecs: multicodecs, + hashers: multihashes } + + return client } + + + +const globSource = glob_source + +// EXTERNAL MODULE: ./node_modules/peer-id/src/index.js +var peer_id_src = __nccwpck_require__(31728); +;// CONCATENATED MODULE: ./node_modules/it-last/dist/src/index.js /** - * Creates a `BytesBufferReader` from a `Uint8Array`. + * @packageDocumentation * - * @name decoder.bytesReader(bytes) - * @param {Uint8Array} bytes - * @returns {BytesBufferReader} + * Return the last value from an (async)iterable. + * + * @example + * + * ```javascript + * import last from 'it-last' + * + * // This can also be an iterator, generator, etc + * const values = [0, 1, 2, 3, 4] + * + * const res = last(values) + * + * console.info(res) // 4 + * ``` + * + * Async sources must be awaited: + * + * ```javascript + * import last from 'it-last' + * + * const values = async function * () { + * yield * [0, 1, 2, 3, 4] + * } + * + * const res = await last(values()) + * + * console.info(res) // 4 + * ``` */ -function buffer_decoder_bytesReader (bytes) { - let pos = 0 +function src_isAsyncIterable(thing) { + return thing[Symbol.asyncIterator] != null; +} +function src_last(source) { + if (src_isAsyncIterable(source)) { + return (async () => { + let res; + for await (const entry of source) { + res = entry; + } + return res; + })(); + } + let res; + for (const entry of source) { + res = entry; + } + return res; +} +/* harmony default export */ const dist_src = (src_last); +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./pinners/ipfs.js - /** @type {BytesBufferReader} */ - return { - upTo (length) { - return bytes.subarray(pos, pos + Math.min(length, bytes.length - pos)) - }, - exactly (length, seek = false) { - if (length > bytes.length - pos) { - throw new Error('Unexpected end of data') - } - const out = bytes.subarray(pos, pos + length) - if (seek) { - pos += length - } - return out - }, - seek (length) { - pos += length - }, - get pos () { - return pos - } - } -} +/* harmony default export */ const ipfs = ({ + name: "IPFS", + builder: async (options) => { + const { host, port, protocol, timeout, headers } = options; -/** - * Wraps a `BytesBufferReader` in a limiting `BytesBufferReader` which limits maximum read - * to `byteLimit` bytes. It _does not_ update `pos` of the original - * `BytesBufferReader`. - * - * @name decoder.limitReader(reader, byteLimit) - * @param {BytesBufferReader} reader - * @param {number} byteLimit - * @returns {BytesBufferReader} - */ -function limitReader (reader, byteLimit) { - let bytesRead = 0 + return src_create({ host, port, protocol, timeout, headers }); + }, + upload: async (api, options) => { + const { path, pattern, pin, timeout, key, verbose } = options; + const { cid } = await dist_src( + api.addAll(globSource(external_node_path_namespaceObject.dirname(path), pattern), { + pin, + timeout, + }) + ); - /** @type {BytesBufferReader} */ - return { - upTo (length) { - let bytes = reader.upTo(length) - if (bytes.length + bytesRead > byteLimit) { - bytes = bytes.subarray(0, byteLimit - bytesRead) - } - return bytes - }, + if (!cid) throw new Error("Content hash is not found."); - exactly (length, seek = false) { - const bytes = reader.exactly(length, seek) - if (bytes.length + bytesRead > byteLimit) { - throw new Error('Unexpected end of data') - } - if (seek) { - bytesRead += length - } - return bytes - }, + let _key; + if (key) { + const keys = await api.key.list(); - seek (length) { - bytesRead += length - reader.seek(length) - }, + _key = keys.find((k) => k.name === key); + if (!_key) { + _key = await api.key.gen(key, { + type: "rsa", + size: 2048, + }); - get pos () { - return reader.pos + if (verbose) console.log(`Created IPNS key ${JSON.stringify(_key)}`); + } + + await api.name.publish(cid, { key }); } - } -} -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/buffer-reader-browser.js + return { + cid: cid.toString(), + ipfs: cid.toString(), + ipns: _key && peer_id_src.parse(_key.id).toB58String(), + }; + }, +}); +// EXTERNAL MODULE: ./node_modules/@pinata/sdk/lib/pinata-sdk.js +var pinata_sdk = __nccwpck_require__(56402); +;// CONCATENATED MODULE: ./pinners/pinata.js -/** - * @typedef {import('multiformats').CID} CID - * @typedef {import('./api').Block} Block - * @typedef {import('./api').CarBufferReader} ICarBufferReader - * @typedef {import('./coding').CarHeader} CarHeader - * @typedef {import('./coding').CarV2Header} CarV2Header - */ -/** - * Provides blockstore-like access to a CAR. - * - * Implements the `RootsBufferReader` interface: - * {@link ICarBufferReader.getRoots `getRoots()`}. And the `BlockBufferReader` interface: - * {@link ICarBufferReader.get `get()`}, {@link ICarBufferReader.has `has()`}, - * {@link ICarBufferReader.blocks `blocks()`} and - * {@link ICarBufferReader.cids `cids()`}. - * - * Load this class with either `import { CarBufferReader } from '@ipld/car/buffer-reader'` - * (`const { CarBufferReader } = require('@ipld/car/buffer-reader')`). Or - * `import { CarBufferReader } from '@ipld/car'` (`const { CarBufferReader } = require('@ipld/car')`). - * The former will likely result in smaller bundle sizes where this is - * important. - * - * @name CarBufferReader - * @class - * @implements {ICarBufferReader} - * @property {number} version The version number of the CAR referenced by this - * reader (should be `1` or `2`). - */ -class CarBufferReader { - /** - * @constructs CarBufferReader - * @param {CarHeader|CarV2Header} header - * @param {Block[]} blocks - */ - constructor (header, blocks) { - this._header = header - this._blocks = blocks - this._cids = undefined - } +let pinataOptions = { + pinataOptions: { + cidVersion: 0, + wrapWithDirectory: false, + }, +}; - /** - * @property version - * @memberof CarBufferReader - * @instance - */ - get version () { - return this._header.version - } +/* harmony default export */ const pinata = ({ + name: "Pinata", + builder: async (options) => { + const { pinataKey, pinataSecret } = options; + if (!pinataKey) { + throw new Error("[pinata] Key is empty. (input `pinataKey`)"); + } - /** - * Get the list of roots defined by the CAR referenced by this reader. May be - * zero or more `CID`s. - * - * @function - * @memberof CarBufferReader - * @instance - * @returns {CID[]} - */ - getRoots () { - return this._header.roots - } + if (!pinataSecret) { + throw new Error("[pinata] Secret is empty. (input `pinataSecret`)"); + } - /** - * Check whether a given `CID` exists within the CAR referenced by this - * reader. - * - * @function - * @memberof CarBufferReader - * @instance - * @param {CID} key - * @returns {boolean} - */ - has (key) { - return this._blocks.some(b => b.cid.equals(key)) - } + return pinata_sdk(pinataKey, pinataSecret); + }, + upload: async (api, options) => { + const { path, pinName, pinataPinName, verbose } = options; + const _pinName = pinName || pinataPinName; + if (_pinName) { + pinataOptions = { + ...pinataOptions, + pinataMetadata: { + name: _pinName, + }, + }; + } - /** - * Fetch a `Block` (a `{ cid:CID, bytes:Uint8Array }` pair) from the CAR - * referenced by this reader matching the provided `CID`. In the case where - * the provided `CID` doesn't exist within the CAR, `undefined` will be - * returned. - * - * @function - * @memberof CarBufferReader - * @instance - * @param {CID} key - * @returns {Block | undefined} - */ - get (key) { - return this._blocks.find(b => b.cid.equals(key)) - } + return api.pinFromFS(path, pinataOptions).then((result) => { + if (verbose) { + console.log(result); + } - /** - * Returns a `Block[]` of the `Block`s (`{ cid:CID, bytes:Uint8Array }` pairs) contained within - * the CAR referenced by this reader. - * - * @function - * @memberof CarBufferReader - * @instance - * @returns {Block[]} - */ - blocks () { - return this._blocks - } + return { + cid: result.IpfsHash.toString(), + ipfs: result.IpfsHash.toString(), + }; + }); + }, +}); - /** - * Returns a `CID[]` of the `CID`s contained within the CAR referenced by this reader. - * - * @function - * @memberof CarBufferReader - * @instance - * @returns {CID[]} - */ - cids () { - if (!this._cids) { - this._cids = this._blocks.map(b => b.cid) +;// CONCATENATED MODULE: ./pinners/infura.js + + + + +/* harmony default export */ const infura = ({ + name: "Infura", + builder: async (options) => { + const { infuraProjectId, infuraProjectSecret, headers, timeout } = options; + if (!infuraProjectId) { + throw new Error("[infura] ProjectId is empty. (input `infuraProjectId`)"); } - return this._cids - } - /** - * Instantiate a {@link CarBufferReader} from a `Uint8Array` blob. This performs a - * decode fully in memory and maintains the decoded state in memory for full - * access to the data via the `CarReader` API. - * - * @static - * @memberof CarBufferReader - * @param {Uint8Array} bytes - * @returns {CarBufferReader} - */ - static fromBytes (bytes) { - if (!(bytes instanceof Uint8Array)) { - throw new TypeError('fromBytes() requires a Uint8Array') + if (!infuraProjectSecret) { + throw new Error( + "[infura] ProjectSecret is empty. (input `infuraProjectSecret`)" + ); } - const { header, blocks } = BufferDecoder.fromBytes(bytes) - return new CarBufferReader(header, blocks) - } + const token = Buffer.from( + `${infuraProjectId}:${infuraProjectSecret}` + ).toString("base64"); + + return src_create({ + host: "ipfs.infura.io", + port: "5001", + protocol: "https", + headers: { + ...headers, + authorization: `Basic ${token}`, + }, + timeout, + }); + }, + upload: async (api, options) => { + const { path, pattern, pin } = options; + const { cid } = await dist_src( + api.addAll(globSource(external_node_path_namespaceObject.dirname(path), pattern), { pin }) + ); + + if (!cid) throw new Error("Content hash is not found."); + return { + cid: cid.toString(), + ipfs: cid.toString(), + }; + }, +}); + +// EXTERNAL MODULE: ./node_modules/@aws-sdk/client-s3/dist-cjs/index.js +var dist_cjs = __nccwpck_require__(63419); +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/bind.js + + +function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; } -const __browser = true +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/utils.js -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/buffer-reader.js +// utils is a library of generic helper functions non-specific to axios + +const {toString: utils_toString} = Object.prototype; +const {getPrototypeOf} = Object; + +const kindOf = (cache => thing => { + const str = utils_toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +})(Object.create(null)); + +const kindOfTest = (type) => { + type = type.toLowerCase(); + return (thing) => kindOf(thing) === type +} + +const typeOfTest = type => thing => typeof thing === type; + /** - * @typedef {import('./api').Block} Block - * @typedef {import('./api').BlockIndex} BlockIndex - * @typedef {import('./api').CarBufferReader} ICarBufferReader + * Determine if a value is an Array + * + * @param {Object} val The value to test + * + * @returns {boolean} True if value is an Array, otherwise false */ +const {isArray} = Array; -const fsread = external_fs_.readSync +/** + * Determine if a value is undefined + * + * @param {*} val The value to test + * + * @returns {boolean} True if the value is undefined, otherwise false + */ +const isUndefined = typeOfTest('undefined'); /** - * @class - * @implements {ICarBufferReader} + * Determine if a value is a Buffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Buffer, otherwise false */ -class buffer_reader_CarBufferReader extends (/* unused pure expression or super */ null && (BrowserCarBufferReader)) { - /** - * Reads a block directly from a file descriptor for an open CAR file. This - * function is **only available in Node.js** and not a browser environment. - * - * This function can be used in connection with {@link CarIndexer} which emits - * the `BlockIndex` objects that are required by this function. - * - * The user is responsible for opening and closing the file used in this call. - * - * @static - * @memberof CarBufferReader - * @param {number} fd - A file descriptor from the - * Node.js `fs` module. An integer, from `fs.open()`. - * @param {BlockIndex} blockIndex - An index pointing to the location of the - * Block required. This `BlockIndex` should take the form: - * `{cid:CID, blockLength:number, blockOffset:number}`. - * @returns {Block} A `{ cid:CID, bytes:Uint8Array }` pair. - */ - static readRaw (fd, blockIndex) { - const { cid, blockLength, blockOffset } = blockIndex - const bytes = new Uint8Array(blockLength) - let read - if (typeof fd === 'number') { - read = fsread(fd, bytes, 0, blockLength, blockOffset) - } else { - throw new TypeError('Bad fd') - } - if (read !== blockLength) { - throw new Error(`Failed to read entire block (${read} instead of ${blockLength})`) - } - return { cid, bytes } - } +function utils_isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); } -const buffer_reader_browser = false +/** + * Determine if a value is an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +const isArrayBuffer = kindOfTest('ArrayBuffer'); -;// CONCATENATED MODULE: ./node_modules/cborg/lib/length.js +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + let result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} +/** + * Determine if a value is a String + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a String, otherwise false + */ +const isString = typeOfTest('string'); /** - * @typedef {import('../interface').EncodeOptions} EncodeOptions - * @typedef {import('../interface').TokenTypeEncoder} TokenTypeEncoder - * @typedef {import('../interface').TokenOrNestedTokens} TokenOrNestedTokens + * Determine if a value is a Function + * + * @param {*} val The value to test + * @returns {boolean} True if value is a Function, otherwise false */ +const isFunction = typeOfTest('function'); -const length_cborEncoders = makeCborEncoders() +/** + * Determine if a value is a Number + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Number, otherwise false + */ +const isNumber = typeOfTest('number'); -/** @type {EncodeOptions} */ -const length_defaultEncodeOptions = { - float64: false, - quickEncodeToken: quickEncodeToken -} +/** + * Determine if a value is an Object + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an Object, otherwise false + */ +const isObject = (thing) => thing !== null && typeof thing === 'object'; /** - * Calculate the byte length of the given data when encoded as CBOR with the - * options provided. - * This calculation will be accurate if the same options are used as when - * performing a normal encode. Some encode options can change the encoding - * output length. + * Determine if a value is a Boolean * - * @param {any} data - * @param {EncodeOptions} [options] - * @returns {number} + * @param {*} thing The value to test + * @returns {boolean} True if value is a Boolean, otherwise false */ -function encodedLength (data, options) { - options = Object.assign({}, length_defaultEncodeOptions, options) - options.mapSorter = undefined // won't change the length - const tokens = objectToTokens(data, options) - return length_tokensToLength(tokens, length_cborEncoders, options) -} +const isBoolean = thing => thing === true || thing === false; /** - * Calculate the byte length of the data as represented by the given tokens when - * encoded as CBOR with the options provided. - * This function is for advanced users and would not normally be called - * directly. See `encodedLength()` for appropriate use. + * Determine if a value is a plain Object * - * @param {TokenOrNestedTokens} tokens - * @param {TokenTypeEncoder[]} [encoders] - * @param {EncodeOptions} [options] + * @param {*} val The value to test + * + * @returns {boolean} True if value is a plain Object, otherwise false */ -function length_tokensToLength (tokens, encoders = length_cborEncoders, options = length_defaultEncodeOptions) { - if (Array.isArray(tokens)) { - let len = 0 - for (const token of tokens) { - len += length_tokensToLength(token, encoders, options) - } - return len - } else { - const encoder = encoders[tokens.type.major] - /* c8 ignore next 3 */ - if (encoder.encodedSize === undefined || typeof encoder.encodedSize !== 'function') { - throw new Error(`Encoder for ${tokens.type.name} does not have an encodedSize()`) - } - return encoder.encodedSize(tokens, options) +const isPlainObject = (val) => { + if (kindOf(val) !== 'object') { + return false; } + + const prototype = getPrototypeOf(val); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); } -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/buffer-writer.js +/** + * Determine if a value is a Date + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Date, otherwise false + */ +const isDate = kindOfTest('Date'); +/** + * Determine if a value is a File + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFile = kindOfTest('File'); +/** + * Determine if a value is a Blob + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Blob, otherwise false + */ +const utils_isBlob = kindOfTest('Blob'); +/** + * Determine if a value is a FileList + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFileList = kindOfTest('FileList'); +/** + * Determine if a value is a Stream + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Stream, otherwise false + */ +const isStream = (val) => isObject(val) && isFunction(val.pipe); /** - * @typedef {import('./api').CID} CID - * @typedef {import('./api').Block} Block - * @typedef {import('./api').CarBufferWriter} Writer - * @typedef {import('./api').CarBufferWriterOptions} Options - * @typedef {import('./coding').CarEncoder} CarEncoder + * Determine if a value is a FormData + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an FormData, otherwise false */ +const isFormData = (thing) => { + let kind; + return thing && ( + (typeof FormData === 'function' && thing instanceof FormData) || ( + isFunction(thing.append) && ( + (kind = kindOf(thing)) === 'formdata' || + // detect form-data instance + (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]') + ) + ) + ) +} /** - * A simple CAR writer that writes to a pre-allocated buffer. + * Determine if a value is a URLSearchParams object * - * @class - * @name CarBufferWriter - * @implements {Writer} + * @param {*} val The value to test + * + * @returns {boolean} True if value is a URLSearchParams object, otherwise false */ -class CarBufferWriter { - /** - * @param {Uint8Array} bytes - * @param {number} headerSize - */ - constructor (bytes, headerSize) { - /** @readonly */ - this.bytes = bytes - this.byteOffset = headerSize +const isURLSearchParams = kindOfTest('URLSearchParams'); - /** - * @readonly - * @type {CID[]} - */ - this.roots = [] - this.headerSize = headerSize +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * + * @returns {String} The String freed of excess whitespace + */ +const trim = (str) => str.trim ? + str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + * + * @param {Boolean} [allOwnKeys = false] + * @returns {any} + */ +function forEach(obj, fn, {allOwnKeys = false} = {}) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; } - /** - * Add a root to this writer, to be used to create a header when the CAR is - * finalized with {@link CarBufferWriter.close `close()`} - * - * @param {CID} root - * @param {{resize?:boolean}} [options] - * @returns {CarBufferWriter} - */ - addRoot (root, options) { - addRoot(this, root, options) - return this + let i; + let l; + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; } - /** - * Write a `Block` (a `{ cid:CID, bytes:Uint8Array }` pair) to the archive. - * Throws if there is not enough capacity. - * - * @param {Block} block - A `{ cid:CID, bytes:Uint8Array }` pair. - * @returns {CarBufferWriter} - */ - write (block) { - addBlock(this, block) - return this + if (isArray(obj)) { + // Iterate over array values + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys.length; + let key; + + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } } +} - /** - * Finalize the CAR and return it as a `Uint8Array`. - * - * @param {object} [options] - * @param {boolean} [options.resize] - * @returns {Uint8Array} - */ - close (options) { - return buffer_writer_close(this, options) +function findKey(obj, key) { + key = key.toLowerCase(); + const keys = Object.keys(obj); + let i = keys.length; + let _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; + } } + return null; } +const _global = (() => { + /*eslint no-undef:0*/ + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global) +})(); + +const isContextDefined = (context) => !isUndefined(context) && context !== _global; + /** - * @param {CarBufferWriter} writer - * @param {CID} root - * @param {{resize?:boolean}} [options] + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * + * @returns {Object} Result of all merge properties */ -const addRoot = (writer, root, options = {}) => { - const { resize = false } = options - const { bytes, headerSize, byteOffset, roots } = writer - writer.roots.push(root) - const size = headerLength(writer) - // If there is not enough space for the new root - if (size > headerSize) { - // Check if we root would fit if we were to resize the head. - if (size - headerSize + byteOffset < bytes.byteLength) { - // If resize is enabled resize head - if (resize) { - resizeHeader(writer, size) - // otherwise remove head and throw an error suggesting to resize - } else { - roots.pop() - throw new RangeError(`Header of size ${headerSize} has no capacity for new root ${root}. - However there is a space in the buffer and you could call addRoot(root, { resize: root }) to resize header to make a space for this root.`) - } - // If head would not fit even with resize pop new root and throw error - } else { - roots.pop() - throw new RangeError(`Buffer has no capacity for a new root ${root}`) +function utils_merge(/* obj1, obj2, obj3, ... */) { + const {caseless} = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key) => { + const targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = utils_merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = utils_merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else { + result[targetKey] = val; } } + + for (let i = 0, l = arguments.length; i < l; i++) { + arguments[i] && forEach(arguments[i], assignValue); + } + return result; } /** - * Calculates number of bytes required for storing given block in CAR. Useful in - * estimating size of an `ArrayBuffer` for the `CarBufferWriter`. + * Extends object a by mutably adding to it the properties of object b. * - * @name CarBufferWriter.blockLength(Block) - * @param {Block} block - * @returns {number} + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * + * @param {Boolean} [allOwnKeys] + * @returns {Object} The resulting value of object a */ -const blockLength = ({ cid, bytes }) => { - const size = cid.bytes.byteLength + bytes.byteLength - return varint.encodingLength(size) + size +const extend = (a, b, thisArg, {allOwnKeys}= {}) => { + forEach(b, (val, key) => { + if (thisArg && isFunction(val)) { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }, {allOwnKeys}); + return a; } /** - * @param {CarBufferWriter} writer - * @param {Block} block + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * + * @returns {string} content value without BOM */ -const addBlock = (writer, { cid, bytes }) => { - const byteLength = cid.bytes.byteLength + bytes.byteLength - const size = varint.encode(byteLength) - if (writer.byteOffset + size.length + byteLength > writer.bytes.byteLength) { - throw new RangeError('Buffer has no capacity for this block') - } else { - writeBytes(writer, size) - writeBytes(writer, cid.bytes) - writeBytes(writer, bytes) +const stripBOM = (content) => { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); } + return content; } /** - * @param {CarBufferWriter} writer - * @param {object} [options] - * @param {boolean} [options.resize] + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + * + * @returns {void} */ -const buffer_writer_close = (writer, options = {}) => { - const { resize = false } = options - const { roots, bytes, byteOffset, headerSize } = writer - - const headerBytes = CBOR.encode({ version: 1, roots }) - const varintBytes = varint.encode(headerBytes.length) - - const size = varintBytes.length + headerBytes.byteLength - const offset = headerSize - size - - // If header size estimate was accurate we just write header and return - // view into buffer. - if (offset === 0) { - writeHeader(writer, varintBytes, headerBytes) - return bytes.subarray(0, byteOffset) - // If header was overestimated and `{resize: true}` is passed resize header - } else if (resize) { - resizeHeader(writer, size) - writeHeader(writer, varintBytes, headerBytes) - return bytes.subarray(0, writer.byteOffset) - } else { - throw new RangeError(`Header size was overestimated. -You can use close({ resize: true }) to resize header`) - } +const inherits = (constructor, superConstructor, props, descriptors) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, 'super', { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); } /** - * @param {CarBufferWriter} writer - * @param {number} byteLength + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function|Boolean} [filter] + * @param {Function} [propFilter] + * + * @returns {Object} */ -const resizeHeader = (writer, byteLength) => { - const { bytes, headerSize } = writer - // Move data section to a new offset - bytes.set(bytes.subarray(headerSize, writer.byteOffset), byteLength) - // Update header size & byteOffset - writer.byteOffset += byteLength - headerSize - writer.headerSize = byteLength -} +const toFlatObject = (sourceObj, destObj, filter, propFilter) => { + let props; + let i; + let prop; + const merged = {}; -/** - * @param {CarBufferWriter} writer - * @param {number[]|Uint8Array} bytes - */ + destObj = destObj || {}; + // eslint-disable-next-line no-eq-null,eqeqeq + if (sourceObj == null) return destObj; -const writeBytes = (writer, bytes) => { - writer.bytes.set(bytes, writer.byteOffset) - writer.byteOffset += bytes.length + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + + return destObj; } + /** - * @param {{bytes:Uint8Array}} writer - * @param {number[]} varint - * @param {Uint8Array} header + * Determines whether a string ends with the characters of a specified string + * + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * + * @returns {boolean} */ -const writeHeader = ({ bytes }, varint, header) => { - bytes.set(varint) - bytes.set(header, varint.length) +const endsWith = (str, searchString, position) => { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; } -const headerPreludeTokens = [ - new token_Token(token_Type.map, 2), - new token_Token(token_Type.string, 'version'), - new token_Token(token_Type.uint, 1), - new token_Token(token_Type.string, 'roots') -] - -const CID_TAG = new token_Token(token_Type.tag, 42) /** - * Calculates header size given the array of byteLength for roots. + * Returns new array from array like object or null if failed * - * @name CarBufferWriter.calculateHeaderLength(rootLengths) - * @param {number[]} rootLengths - * @returns {number} + * @param {*} [thing] + * + * @returns {?Array} */ -const calculateHeaderLength = (rootLengths) => { - const tokens = [...headerPreludeTokens] - tokens.push(new Token(Type.array, rootLengths.length)) - for (const rootLength of rootLengths) { - tokens.push(CID_TAG) - tokens.push(new Token(Type.bytes, { length: rootLength + 1 })) +const toArray = (thing) => { + if (!thing) return null; + if (isArray(thing)) return thing; + let i = thing.length; + if (!isNumber(i)) return null; + const arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; } - const length = tokensToLength(tokens) // no options needed here because we have simple tokens - return varint.encodingLength(length) + length + return arr; } /** - * Calculates header size given the array of roots. + * Checking if the Uint8Array exists and if it does, it returns a function that checks if the + * thing passed in is an instance of Uint8Array * - * @name CarBufferWriter.headerLength({ roots }) - * @param {object} options - * @param {CID[]} options.roots - * @returns {number} + * @param {TypedArray} + * + * @returns {Array} */ -const headerLength = ({ roots }) => - calculateHeaderLength(roots.map(cid => cid.bytes.byteLength)) +// eslint-disable-next-line func-names +const isTypedArray = (TypedArray => { + // eslint-disable-next-line func-names + return thing => { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); /** - * Estimates header size given a count of the roots and the expected byte length - * of the root CIDs. The default length works for a standard CIDv1 with a - * single-byte multihash code, such as SHA2-256 (i.e. the most common CIDv1). + * For each entry in the object, call the function with the key and value. * - * @name CarBufferWriter.estimateHeaderLength(rootCount[, rootByteLength]) - * @param {number} rootCount - * @param {number} [rootByteLength] - * @returns {number} + * @param {Object} obj - The object to iterate over. + * @param {Function} fn - The function to call for each entry. + * + * @returns {void} */ -const estimateHeaderLength = (rootCount, rootByteLength = 36) => - calculateHeaderLength(new Array(rootCount).fill(rootByteLength)) +const forEachEntry = (obj, fn) => { + const generator = obj && obj[Symbol.iterator]; + + const iterator = generator.call(obj); + + let result; + + while ((result = iterator.next()) && !result.done) { + const pair = result.value; + fn.call(obj, pair[0], pair[1]); + } +} /** - * Creates synchronous CAR writer that can be used to encode blocks into a given - * buffer. Optionally you could pass `byteOffset` and `byteLength` to specify a - * range inside buffer to write into. If car file is going to have `roots` you - * need to either pass them under `options.roots` (from which header size will - * be calculated) or provide `options.headerSize` to allocate required space - * in the buffer. You may also provide known `roots` and `headerSize` to - * allocate space for the roots that may not be known ahead of time. + * It takes a regular expression and a string, and returns an array of all the matches * - * Note: Incorrect `headerSize` may lead to copying bytes inside a buffer - * which will have a negative impact on performance. + * @param {string} regExp - The regular expression to match against. + * @param {string} str - The string to search. * - * @name CarBufferWriter.createWriter(buffer[, options]) - * @param {ArrayBuffer} buffer - * @param {object} [options] - * @param {CID[]} [options.roots] - * @param {number} [options.byteOffset] - * @param {number} [options.byteLength] - * @param {number} [options.headerSize] - * @returns {CarBufferWriter} + * @returns {Array} */ -const createWriter = (buffer, options = {}) => { - const { - roots = [], - byteOffset = 0, - byteLength = buffer.byteLength, - headerSize = headerLength({ roots }) - } = options - const bytes = new Uint8Array(buffer, byteOffset, byteLength) +const matchAll = (regExp, str) => { + let matches; + const arr = []; - const writer = new CarBufferWriter(bytes, headerSize) - for (const root of roots) { - writer.addRoot(root) + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); } - return writer + return arr; } -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/decoder.js +/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ +const isHTMLForm = kindOfTest('HTMLFormElement'); +const toCamelCase = str => { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, + function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + } + ); +}; +/* Creating a function that will check if an object has a property. */ +const utils_hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); +/** + * Determine if a value is a RegExp object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a RegExp object, otherwise false + */ +const isRegExp = kindOfTest('RegExp'); +const reduceDescriptors = (obj, reducer) => { + const descriptors = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; + forEach(descriptors, (descriptor, name) => { + let ret; + if ((ret = reducer(descriptor, name, obj)) !== false) { + reducedDescriptors[name] = ret || descriptor; + } + }); -/** - * @typedef {import('./api').Block} Block - * @typedef {import('./api').BlockHeader} BlockHeader - * @typedef {import('./api').BlockIndex} BlockIndex - * @typedef {import('./coding').BytesReader} BytesReader - * @typedef {import('./coding').CarHeader} CarHeader - * @typedef {import('./coding').CarV2Header} CarV2Header - * @typedef {import('./coding').CarV2FixedHeader} CarV2FixedHeader - * @typedef {import('./coding').CarDecoder} CarDecoder - */ + Object.defineProperties(obj, reducedDescriptors); +} /** - * Reads header data from a `BytesReader`. The header may either be in the form - * of a `CarHeader` or `CarV2Header` depending on the CAR being read. - * - * @name async decoder.readHeader(reader) - * @param {BytesReader} reader - * @param {number} [strictVersion] - * @returns {Promise} + * Makes all methods read-only + * @param {Object} obj */ -async function decoder_readHeader (reader, strictVersion) { - const length = decoder_common_decodeVarint(await reader.upTo(8), reader) - if (length === 0) { - throw new Error('Invalid CAR header (zero length)') - } - const header = await reader.exactly(length, true) - const block = dag_cbor_src_decode(header) - if (header_validator_CarV1HeaderOrV2Pragma.toTyped(block) === undefined) { - throw new Error('Invalid CAR header format') - } - if ((block.version !== 1 && block.version !== 2) || (strictVersion !== undefined && block.version !== strictVersion)) { - throw new Error(`Invalid CAR version: ${block.version}${strictVersion !== undefined ? ` (expected ${strictVersion})` : ''}`) - } - if (block.version === 1) { - // CarV1HeaderOrV2Pragma makes roots optional, let's make it mandatory - if (!Array.isArray(block.roots)) { - throw new Error('Invalid CAR header format') + +const freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name) => { + // skip restricted props in strict mode + if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { + return false; } - return block + + const value = obj[name]; + + if (!isFunction(value)) return; + + descriptor.enumerable = false; + + if ('writable' in descriptor) { + descriptor.writable = false; + return; + } + + if (!descriptor.set) { + descriptor.set = () => { + throw Error('Can not rewrite read-only method \'' + name + '\''); + }; + } + }); +} + +const toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + + const define = (arr) => { + arr.forEach(value => { + obj[value] = true; + }); } - // version 2 - if (block.roots !== undefined) { - throw new Error('Invalid CAR header format') + + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + + return obj; +} + +const noop = () => {} + +const toFiniteNumber = (value, defaultValue) => { + value = +value; + return Number.isFinite(value) ? value : defaultValue; +} + +const ALPHA = 'abcdefghijklmnopqrstuvwxyz' + +const DIGIT = '0123456789'; + +const ALPHABET = { + DIGIT, + ALPHA, + ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT +} + +const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { + let str = ''; + const {length} = alphabet; + while (size--) { + str += alphabet[Math.random() * length|0] } - const v2Header = decoder_common_decodeV2Header(await reader.exactly(decoder_common_V2_HEADER_LENGTH, true)) - reader.seek(v2Header.dataOffset - reader.pos) - const v1Header = await decoder_readHeader(reader, 1) - return Object.assign(v1Header, v2Header) + + return str; } /** - * @param {BytesReader} reader - * @returns {Promise} + * If the thing is a FormData object, return true, otherwise return false. + * + * @param {unknown} thing - The thing to check. + * + * @returns {boolean} */ -async function decoder_readCid (reader) { - const first = await reader.exactly(2, false) - if (first[0] === CIDV0_BYTES.SHA2_256 && first[1] === CIDV0_BYTES.LENGTH) { - // cidv0 32-byte sha2-256 - const bytes = await reader.exactly(34, true) - const multihash = Digest.decode(bytes) - return CID.create(0, CIDV0_BYTES.DAG_PB, multihash) - } +function isSpecCompliantForm(thing) { + return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); +} - const version = decodeVarint(await reader.upTo(8), reader) - if (version !== 1) { - throw new Error(`Unexpected CID version (${version})`) +const toJSONObject = (obj) => { + const stack = new Array(10); + + const visit = (source, i) => { + + if (isObject(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + + if(!('toJSON' in source)) { + stack[i] = source; + const target = isArray(source) ? [] : {}; + + forEach(source, (value, key) => { + const reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + + stack[i] = undefined; + + return target; + } + } + + return source; } - const codec = decodeVarint(await reader.upTo(8), reader) - const bytes = await reader.exactly(getMultihashLength(await reader.upTo(8)), true) - const multihash = Digest.decode(bytes) - return CID.create(version, codec, multihash) + + return visit(obj, 0); } +const isAsyncFn = kindOfTest('AsyncFunction'); + +const isThenable = (thing) => + thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); + +/* harmony default export */ const utils = ({ + isArray, + isArrayBuffer, + isBuffer: utils_isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject, + isPlainObject, + isUndefined, + isDate, + isFile, + isBlob: utils_isBlob, + isRegExp, + isFunction, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge: utils_merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty: utils_hasOwnProperty, + hasOwnProp: utils_hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + ALPHABET, + generateString, + isSpecCompliantForm, + toJSONObject, + isAsyncFn, + isThenable +}); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/core/AxiosError.js + + + + /** - * Reads the leading data of an individual block from CAR data from a - * `BytesReader`. Returns a `BlockHeader` object which contains - * `{ cid, length, blockLength }` which can be used to either index the block - * or read the block binary data. + * Create an Error with the specified message, config, error code, request and response. * - * @name async decoder.readBlockHead(reader) - * @param {BytesReader} reader - * @returns {Promise} + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. */ -async function decoder_readBlockHead (reader) { - // length includes a CID + Binary, where CID has a variable length - // we have to deal with - const start = reader.pos - let length = decodeVarint(await reader.upTo(8), reader) - if (length === 0) { - throw new Error('Invalid CAR section (zero length)') +function AxiosError(message, code, config, request, response) { + Error.call(this); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = (new Error()).stack; } - length += (reader.pos - start) - const cid = await decoder_readCid(reader) - const blockLength = length - Number(reader.pos - start) // subtract CID length - return { cid, length, blockLength } + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + response && (this.response = response); } +utils.inherits(AxiosError, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: utils.toJSONObject(this.config), + code: this.code, + status: this.response && this.response.status ? this.response.status : null + }; + } +}); + +const AxiosError_prototype = AxiosError.prototype; +const descriptors = {}; + +[ + 'ERR_BAD_OPTION_VALUE', + 'ERR_BAD_OPTION', + 'ECONNABORTED', + 'ETIMEDOUT', + 'ERR_NETWORK', + 'ERR_FR_TOO_MANY_REDIRECTS', + 'ERR_DEPRECATED', + 'ERR_BAD_RESPONSE', + 'ERR_BAD_REQUEST', + 'ERR_CANCELED', + 'ERR_NOT_SUPPORT', + 'ERR_INVALID_URL' +// eslint-disable-next-line func-names +].forEach(code => { + descriptors[code] = {value: code}; +}); + +Object.defineProperties(AxiosError, descriptors); +Object.defineProperty(AxiosError_prototype, 'isAxiosError', {value: true}); + +// eslint-disable-next-line func-names +AxiosError.from = (error, code, config, request, response, customProps) => { + const axiosError = Object.create(AxiosError_prototype); + + utils.toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }, prop => { + return prop !== 'isAxiosError'; + }); + + AxiosError.call(axiosError, error.message, code, config, request, response); + + axiosError.cause = error; + + axiosError.name = error.name; + + customProps && Object.assign(axiosError, customProps); + + return axiosError; +}; + +/* harmony default export */ const core_AxiosError = (AxiosError); + +// EXTERNAL MODULE: ./node_modules/form-data/lib/form_data.js +var form_data = __nccwpck_require__(76948); +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/platform/node/classes/FormData.js + + +/* harmony default export */ const classes_FormData = (form_data); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/toFormData.js + + + + +// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored + + /** - * @param {BytesReader} reader - * @returns {Promise} + * Determines if the given thing is a array or js object. + * + * @param {string} thing - The object or array to be visited. + * + * @returns {boolean} */ -async function readBlock (reader) { - const { cid, blockLength } = await decoder_readBlockHead(reader) - const bytes = await reader.exactly(blockLength, true) - return { bytes, cid } +function isVisitable(thing) { + return utils.isPlainObject(thing) || utils.isArray(thing); } /** - * @param {BytesReader} reader - * @returns {Promise} + * It removes the brackets from the end of a string + * + * @param {string} key - The key of the parameter. + * + * @returns {string} the key without the brackets. */ -async function readBlockIndex (reader) { - const offset = reader.pos - const { cid, length, blockLength } = await decoder_readBlockHead(reader) - const index = { cid, length, blockLength, offset, blockOffset: reader.pos } - reader.seek(index.blockLength) - return index +function removeBrackets(key) { + return utils.endsWith(key, '[]') ? key.slice(0, -2) : key; } /** - * Creates a `CarDecoder` from a `BytesReader`. The `CarDecoder` is as async - * interface that will consume the bytes from the `BytesReader` to yield a - * `header()` and either `blocks()` or `blocksIndex()` data. + * It takes a path, a key, and a boolean, and returns a string * - * @name decoder.createDecoder(reader) - * @param {BytesReader} reader - * @returns {CarDecoder} + * @param {string} path - The path to the current key. + * @param {string} key - The key of the current object being iterated over. + * @param {string} dots - If true, the key will be rendered with dots instead of brackets. + * + * @returns {string} The path to the current key. */ -function decoder_createDecoder (reader) { - const headerPromise = (async () => { - const header = await decoder_readHeader(reader) - if (header.version === 2) { - const v1length = reader.pos - header.dataOffset - reader = decoder_limitReader(reader, header.dataSize - v1length) - } - return header - })() +function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + // eslint-disable-next-line no-param-reassign + token = removeBrackets(token); + return !dots && i ? '[' + token + ']' : token; + }).join(dots ? '.' : ''); +} - return { - header: () => headerPromise, +/** + * If the array is an array and none of its elements are visitable, then it's a flat array. + * + * @param {Array} arr - The array to check + * + * @returns {boolean} + */ +function isFlatArray(arr) { + return utils.isArray(arr) && !arr.some(isVisitable); +} - async * blocks () { - await headerPromise - while ((await reader.upTo(8)).length > 0) { - yield await readBlock(reader) - } - }, +const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); - async * blocksIndex () { - await headerPromise - while ((await reader.upTo(8)).length > 0) { - yield await readBlockIndex(reader) - } - } - } -} +/** + * Convert a data object to FormData + * + * @param {Object} obj + * @param {?Object} [formData] + * @param {?Object} [options] + * @param {Function} [options.visitor] + * @param {Boolean} [options.metaTokens = true] + * @param {Boolean} [options.dots = false] + * @param {?Boolean} [options.indexes = false] + * + * @returns {Object} + **/ /** - * Creates a `BytesReader` from a `Uint8Array`. + * It converts an object into a FormData object * - * @name decoder.bytesReader(bytes) - * @param {Uint8Array} bytes - * @returns {BytesReader} + * @param {Object} obj - The object to convert to form data. + * @param {string} formData - The FormData object to append to. + * @param {Object} options + * + * @returns */ -function decoder_bytesReader (bytes) { - let pos = 0 +function toFormData(obj, formData, options) { + if (!utils.isObject(obj)) { + throw new TypeError('target must be an object'); + } - /** @type {BytesReader} */ - return { - async upTo (length) { - const out = bytes.subarray(pos, pos + Math.min(length, bytes.length - pos)) - return out - }, + // eslint-disable-next-line no-param-reassign + formData = formData || new (classes_FormData || FormData)(); - async exactly (length, seek = false) { - if (length > bytes.length - pos) { - throw new Error('Unexpected end of data') - } - const out = bytes.subarray(pos, pos + length) - if (seek) { - pos += length - } - return out - }, + // eslint-disable-next-line no-param-reassign + options = utils.toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + // eslint-disable-next-line no-eq-null,eqeqeq + return !utils.isUndefined(source[option]); + }); - seek (length) { - pos += length - }, + const metaTokens = options.metaTokens; + // eslint-disable-next-line no-use-before-define + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; + const useBlob = _Blob && utils.isSpecCompliantForm(formData); - get pos () { - return pos + if (!utils.isFunction(visitor)) { + throw new TypeError('visitor must be a function'); + } + + function convertValue(value) { + if (value === null) return ''; + + if (utils.isDate(value)) { + return value.toISOString(); + } + + if (!useBlob && utils.isBlob(value)) { + throw new core_AxiosError('Blob is not supported. Use a Buffer instead.'); + } + + if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) { + return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); } + + return value; } -} -/** - * @ignore - * reusable reader for streams and files, we just need a way to read an - * additional chunk (of some undetermined size) and a way to close the - * reader when finished - * @param {() => Promise} readChunk - * @returns {BytesReader} - */ -function chunkReader (readChunk /*, closer */) { - let pos = 0 - let have = 0 - let offset = 0 - let currentChunk = new Uint8Array(0) + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key + * @param {Array} path + * @this {FormData} + * + * @returns {boolean} return true to visit the each prop of the value recursively + */ + function defaultVisitor(value, key, path) { + let arr = value; - const read = async (/** @type {number} */ length) => { - have = currentChunk.length - offset - const bufa = [currentChunk.subarray(offset)] - while (have < length) { - const chunk = await readChunk() - if (chunk == null) { - break - } - /* c8 ignore next 8 */ - // undo this ignore ^ when we have a fd implementation that can seek() - if (have < 0) { // because of a seek() - /* c8 ignore next 4 */ - // toohard to test the else - if (chunk.length > have) { - bufa.push(chunk.subarray(-have)) - } // else discard - } else { - bufa.push(chunk) + if (value && !path && typeof value === 'object') { + if (utils.endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + key = metaTokens ? key : key.slice(0, -2); + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if ( + (utils.isArray(value) && isFlatArray(value)) || + ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value)) + )) { + // eslint-disable-next-line no-param-reassign + key = removeBrackets(key); + + arr.forEach(function each(el, index) { + !(utils.isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), + convertValue(el) + ); + }); + return false; } - have += chunk.length } - currentChunk = new Uint8Array(bufa.reduce((p, c) => p + c.length, 0)) - let off = 0 - for (const b of bufa) { - currentChunk.set(b, off) - off += b.length + + if (isVisitable(value)) { + return true; } - offset = 0 + + formData.append(renderKey(path, key, dots), convertValue(value)); + + return false; } - /** @type {BytesReader} */ - return { - async upTo (length) { - if (currentChunk.length - offset < length) { - await read(length) - } - return currentChunk.subarray(offset, offset + Math.min(currentChunk.length - offset, length)) - }, + const stack = []; - async exactly (length, seek = false) { - if (currentChunk.length - offset < length) { - await read(length) - } - if (currentChunk.length - offset < length) { - throw new Error('Unexpected end of data') - } - const out = currentChunk.subarray(offset, offset + length) - if (seek) { - pos += length - offset += length - } - return out - }, + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); - seek (length) { - pos += length - offset += length - }, + function build(value, path) { + if (utils.isUndefined(value)) return; - get pos () { - return pos + if (stack.indexOf(value) !== -1) { + throw Error('Circular reference detected in ' + path.join('.')); } + + stack.push(value); + + utils.forEach(value, function each(el, key) { + const result = !(utils.isUndefined(el) || el === null) && visitor.call( + formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers + ); + + if (result === true) { + build(el, path ? path.concat(key) : [key]); + } + }); + + stack.pop(); + } + + if (!utils.isObject(obj)) { + throw new TypeError('data must be an object'); } + + build(obj); + + return formData; } +/* harmony default export */ const helpers_toFormData = (toFormData); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/AxiosURLSearchParams.js + + + + /** - * Creates a `BytesReader` from an `AsyncIterable`, which allows for - * consumption of CAR data from a streaming source. + * It encodes a string by replacing all characters that are not in the unreserved set with + * their percent-encoded equivalents * - * @name decoder.asyncIterableReader(asyncIterable) - * @param {AsyncIterable} asyncIterable - * @returns {BytesReader} + * @param {string} str - The string to encode. + * + * @returns {string} The encoded string. */ -function decoder_asyncIterableReader (asyncIterable) { - const iterator = asyncIterable[Symbol.asyncIterator]() +function AxiosURLSearchParams_encode(str) { + const charMap = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+', + '%00': '\x00' + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); +} - async function readChunk () { - const next = await iterator.next() - if (next.done) { - return null - } - return next.value - } +/** + * It takes a params object and converts it to a FormData object + * + * @param {Object} params - The parameters to be converted to a FormData object. + * @param {Object} options - The options object passed to the Axios constructor. + * + * @returns {void} + */ +function AxiosURLSearchParams(params, options) { + this._pairs = []; + + params && helpers_toFormData(params, this, options); +} + +const AxiosURLSearchParams_prototype = AxiosURLSearchParams.prototype; + +AxiosURLSearchParams_prototype.append = function append(name, value) { + this._pairs.push([name, value]); +}; - return chunkReader(readChunk) -} +AxiosURLSearchParams_prototype.toString = function toString(encoder) { + const _encode = encoder ? function(value) { + return encoder.call(this, value, AxiosURLSearchParams_encode); + } : AxiosURLSearchParams_encode; -/** - * Wraps a `BytesReader` in a limiting `BytesReader` which limits maximum read - * to `byteLimit` bytes. It _does not_ update `pos` of the original - * `BytesReader`. - * - * @name decoder.limitReader(reader, byteLimit) - * @param {BytesReader} reader - * @param {number} byteLimit - * @returns {BytesReader} - */ -function decoder_limitReader (reader, byteLimit) { - let bytesRead = 0 + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + '=' + _encode(pair[1]); + }, '').join('&'); +}; - /** @type {BytesReader} */ - return { - async upTo (length) { - let bytes = await reader.upTo(length) - if (bytes.length + bytesRead > byteLimit) { - bytes = bytes.subarray(0, byteLimit - bytesRead) - } - return bytes - }, +/* harmony default export */ const helpers_AxiosURLSearchParams = (AxiosURLSearchParams); - async exactly (length, seek = false) { - const bytes = await reader.exactly(length, seek) - if (bytes.length + bytesRead > byteLimit) { - throw new Error('Unexpected end of data') - } - if (seek) { - bytesRead += length - } - return bytes - }, +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/buildURL.js - seek (length) { - bytesRead += length - reader.seek(length) - }, - get pos () { - return reader.pos - } - } -} -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/indexer.js /** - * @typedef {import('multiformats').CID} CID - * @typedef {import('./api').Block} Block - * @typedef {import('./api').RootsReader} RootsReader - * @typedef {import('./api').BlockIndex} BlockIndex - * @typedef {import('./coding').BytesReader} BytesReader + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their + * URI encoded counterparts + * + * @param {string} val The value to be encoded. + * + * @returns {string} The encoded value. */ +function buildURL_encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} /** - * Provides an iterator over all of the `Block`s in a CAR, returning their CIDs - * and byte-location information. Implements an `AsyncIterable`. - * Where a `BlockIndex` is a - * `{ cid:CID, length:number, offset:number, blockLength:number, blockOffset:number }`. - * - * As an implementer of `AsyncIterable`, this class can be used directly in a - * `for await (const blockIndex of iterator) {}` loop. Where the `iterator` is - * constructed using {@link CarIndexer.fromBytes} or - * {@link CarIndexer.fromIterable}. - * - * An iteration can only be performce _once_ per instantiation. - * - * `CarIndexer` also implements the `RootsReader` interface and provides - * the {@link CarIndexer.getRoots `getRoots()`} method. + * Build a URL by appending params to the end * - * Load this class with either - * `import { CarIndexer } from '@ipld/car/indexer'` - * (`const { CarIndexer } = require('@ipld/car/indexer')`). Or - * `import { CarIndexer } from '@ipld/car'` - * (`const { CarIndexer } = require('@ipld/car')`). The former will likely - * result in smaller bundle sizes where this is important. + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @param {?object} options * - * @name CarIndexer - * @class - * @implements {RootsReader} - * @implements {AsyncIterable} - * @property {number} version The version number of the CAR referenced by this - * reader (should be `1`). + * @returns {string} The formatted url */ -class indexer_CarIndexer { - /** - * @param {number} version - * @param {CID[]} roots - * @param {AsyncGenerator} iterator - */ - constructor (version, roots, iterator) { - this._version = version - this._roots = roots - this._iterator = iterator +function buildURL(url, params, options) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; } + + const _encode = options && options.encode || buildURL_encode; - get version () { - return this._version - } + const serializeFn = options && options.serialize; - /** - * Get the list of roots defined by the CAR referenced by this indexer. May be - * zero or more `CID`s. - * - * @function - * @memberof CarIndexer - * @instance - * @async - * @returns {Promise} - */ - async getRoots () { - return this._roots - } + let serializedParams; - /** - * @returns {AsyncIterator} - */ - [Symbol.asyncIterator] () { - return this._iterator + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = utils.isURLSearchParams(params) ? + params.toString() : + new helpers_AxiosURLSearchParams(params, options).toString(_encode); } - /** - * Instantiate a {@link CarIndexer} from a `Uint8Array` blob. Only the header - * is decoded initially, the remainder is processed and emitted via the - * iterator as it is consumed. - * - * @async - * @static - * @memberof CarIndexer - * @param {Uint8Array} bytes - * @returns {Promise} - */ - static async fromBytes (bytes) { - if (!(bytes instanceof Uint8Array)) { - throw new TypeError('fromBytes() requires a Uint8Array') - } - return decodeIndexerComplete(bytesReader(bytes)) - } + if (serializedParams) { + const hashmarkIndex = url.indexOf("#"); - /** - * Instantiate a {@link CarIndexer} from a `AsyncIterable`, - * such as a [modern Node.js stream](https://nodejs.org/api/stream.html#stream_streams_compatibility_with_async_generators_and_async_iterators). - * is decoded initially, the remainder is processed and emitted via the - * iterator as it is consumed. - * - * @async - * @static - * @memberof CarIndexer - * @param {AsyncIterable} asyncIterable - * @returns {Promise} - */ - static async fromIterable (asyncIterable) { - if (!asyncIterable || !(typeof asyncIterable[Symbol.asyncIterator] === 'function')) { - throw new TypeError('fromIterable() requires an async iterable') + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); } - return decodeIndexerComplete(asyncIterableReader(asyncIterable)) + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; } -} - -/** - * @private - * @param {BytesReader} reader - * @returns {Promise} - */ -async function decodeIndexerComplete (reader) { - const decoder = createDecoder(reader) - const { version, roots } = await decoder.header() - return new indexer_CarIndexer(version, roots, decoder.blocksIndex()) + return url; } -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/reader-browser.js +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/core/InterceptorManager.js -/** - * @typedef {import('multiformats').CID} CID - * @typedef {import('./api').Block} Block - * @typedef {import('./api').CarReader} CarReaderIface - * @typedef {import('./coding').BytesReader} BytesReader - * @typedef {import('./coding').CarHeader} CarHeader - * @typedef {import('./coding').CarV2Header} CarV2Header - */ -/** - * Provides blockstore-like access to a CAR. - * - * Implements the `RootsReader` interface: - * {@link CarReader.getRoots `getRoots()`}. And the `BlockReader` interface: - * {@link CarReader.get `get()`}, {@link CarReader.has `has()`}, - * {@link CarReader.blocks `blocks()`} (defined as a `BlockIterator`) and - * {@link CarReader.cids `cids()`} (defined as a `CIDIterator`). - * - * Load this class with either `import { CarReader } from '@ipld/car/reader'` - * (`const { CarReader } = require('@ipld/car/reader')`). Or - * `import { CarReader } from '@ipld/car'` (`const { CarReader } = require('@ipld/car')`). - * The former will likely result in smaller bundle sizes where this is - * important. - * - * @name CarReader - * @class - * @implements {CarReaderIface} - * @property {number} version The version number of the CAR referenced by this - * reader (should be `1` or `2`). - */ -class CarReader { - /** - * @constructs CarReader - * @param {CarHeader|CarV2Header} header - * @param {Block[]} blocks - */ - constructor (header, blocks) { - this._header = header - this._blocks = blocks - this._keys = blocks.map((b) => b.cid.toString()) - } - /** - * @property - * @memberof CarReader - * @instance - */ - get version () { - return this._header.version +class InterceptorManager { + constructor() { + this.handlers = []; } /** - * Get the list of roots defined by the CAR referenced by this reader. May be - * zero or more `CID`s. + * Add a new interceptor to the stack * - * @function - * @memberof CarReader - * @instance - * @async - * @returns {Promise} - */ - async getRoots () { - return this._header.roots - } - - /** - * Check whether a given `CID` exists within the CAR referenced by this - * reader. + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` * - * @function - * @memberof CarReader - * @instance - * @async - * @param {CID} key - * @returns {Promise} + * @return {Number} An ID used to remove interceptor later */ - async has (key) { - return this._keys.indexOf(key.toString()) > -1 + use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; } /** - * Fetch a `Block` (a `{ cid:CID, bytes:Uint8Array }` pair) from the CAR - * referenced by this reader matching the provided `CID`. In the case where - * the provided `CID` doesn't exist within the CAR, `undefined` will be - * returned. + * Remove an interceptor from the stack * - * @function - * @memberof CarReader - * @instance - * @async - * @param {CID} key - * @returns {Promise} - */ - async get (key) { - const index = this._keys.indexOf(key.toString()) - return index > -1 ? this._blocks[index] : undefined - } - - /** - * Returns a `BlockIterator` (`AsyncIterable`) that iterates over all - * of the `Block`s (`{ cid:CID, bytes:Uint8Array }` pairs) contained within - * the CAR referenced by this reader. + * @param {Number} id The ID that was returned by `use` * - * @function - * @memberof CarReader - * @instance - * @async - * @generator - * @returns {AsyncGenerator} + * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise */ - async * blocks () { - for (const block of this._blocks) { - yield block + eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; } } /** - * Returns a `CIDIterator` (`AsyncIterable`) that iterates over all of - * the `CID`s contained within the CAR referenced by this reader. + * Clear all interceptors from the stack * - * @function - * @memberof CarReader - * @instance - * @async - * @generator - * @returns {AsyncGenerator} + * @returns {void} */ - async * cids () { - for (const block of this._blocks) { - yield block.cid + clear() { + if (this.handlers) { + this.handlers = []; } } /** - * Instantiate a {@link CarReader} from a `Uint8Array` blob. This performs a - * decode fully in memory and maintains the decoded state in memory for full - * access to the data via the `CarReader` API. + * Iterate over all the registered interceptors * - * @async - * @static - * @memberof CarReader - * @param {Uint8Array} bytes - * @returns {Promise} - */ - static async fromBytes (bytes) { - if (!(bytes instanceof Uint8Array)) { - throw new TypeError('fromBytes() requires a Uint8Array') - } - return decodeReaderComplete(bytesReader(bytes)) - } - - /** - * Instantiate a {@link CarReader} from a `AsyncIterable`, such as - * a [modern Node.js stream](https://nodejs.org/api/stream.html#stream_streams_compatibility_with_async_generators_and_async_iterators). - * This performs a decode fully in memory and maintains the decoded state in - * memory for full access to the data via the `CarReader` API. + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. * - * Care should be taken for large archives; this API may not be appropriate - * where memory is a concern or the archive is potentially larger than the - * amount of memory that the runtime can handle. + * @param {Function} fn The function to call for each interceptor * - * @async - * @static - * @memberof CarReader - * @param {AsyncIterable} asyncIterable - * @returns {Promise} + * @returns {void} */ - static async fromIterable (asyncIterable) { - if (!asyncIterable || !(typeof asyncIterable[Symbol.asyncIterator] === 'function')) { - throw new TypeError('fromIterable() requires an async iterable') - } - return decodeReaderComplete(asyncIterableReader(asyncIterable)) + forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); } } -/** - * @private - * @param {BytesReader} reader - * @returns {Promise} - */ -async function decodeReaderComplete (reader) { - const decoder = createDecoder(reader) - const header = await decoder.header() - const blocks = [] - for await (const block of decoder.blocks()) { - blocks.push(block) - } +/* harmony default export */ const core_InterceptorManager = (InterceptorManager); - return new CarReader(header, blocks) -} +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/defaults/transitional.js -const reader_browser_browser = true -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/reader.js +/* harmony default export */ const defaults_transitional = ({ + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}); + +// EXTERNAL MODULE: external "url" +var external_url_ = __nccwpck_require__(57310); +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/platform/node/classes/URLSearchParams.js + + + +/* harmony default export */ const classes_URLSearchParams = (external_url_.URLSearchParams); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/platform/node/index.js +/* harmony default export */ const node = ({ + isNode: true, + classes: { + URLSearchParams: classes_URLSearchParams, + FormData: classes_FormData, + Blob: typeof Blob !== 'undefined' && Blob || null + }, + protocols: [ 'http', 'https', 'file', 'data' ] +}); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/platform/common/utils.js +const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; /** - * @typedef {import('./api').Block} Block - * @typedef {import('./api').BlockIndex} BlockIndex - * @typedef {import('./api').CarReader} CarReaderIface + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + * + * @returns {boolean} */ - -const reader_fsread = (0,external_util_.promisify)(external_fs_.read) +const hasStandardBrowserEnv = ( + (product) => { + return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0 + })(typeof navigator !== 'undefined' && navigator.product); /** - * @class - * @implements {CarReaderIface} + * Determine if we're running in a standard browser webWorker environment + * + * Although the `isStandardBrowserEnv` method indicates that + * `allows axios to run in a web worker`, the WebWorker will still be + * filtered out due to its judgment standard + * `typeof window !== 'undefined' && typeof document !== 'undefined'`. + * This leads to a problem when axios post `FormData` in webWorker */ -class reader_CarReader extends (/* unused pure expression or super */ null && (BrowserCarReader)) { - /** - * Reads a block directly from a file descriptor for an open CAR file. This - * function is **only available in Node.js** and not a browser environment. - * - * This function can be used in connection with {@link CarIndexer} which emits - * the `BlockIndex` objects that are required by this function. - * - * The user is responsible for opening and closing the file used in this call. - * - * @async - * @static - * @memberof CarReader - * @param {fs.promises.FileHandle | number} fd - A file descriptor from the - * Node.js `fs` module. Either an integer, from `fs.open()` or a `FileHandle` - * from `fs.promises.open()`. - * @param {BlockIndex} blockIndex - An index pointing to the location of the - * Block required. This `BlockIndex` should take the form: - * `{cid:CID, blockLength:number, blockOffset:number}`. - * @returns {Promise} A `{ cid:CID, bytes:Uint8Array }` pair. - */ - static async readRaw (fd, blockIndex) { - const { cid, blockLength, blockOffset } = blockIndex - const bytes = new Uint8Array(blockLength) - let read - if (typeof fd === 'number') { - read = (await reader_fsread(fd, bytes, 0, blockLength, blockOffset)).bytesRead - } else if (typeof fd === 'object' && typeof fd.read === 'function') { // FileDescriptor - read = (await fd.read(bytes, 0, blockLength, blockOffset)).bytesRead - } else { - throw new TypeError('Bad fd') - } - if (read !== blockLength) { - throw new Error(`Failed to read entire block (${read} instead of ${blockLength})`) - } - return { cid, bytes } - } -} +const hasStandardBrowserWebWorkerEnv = (() => { + return ( + typeof WorkerGlobalScope !== 'undefined' && + // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && + typeof self.importScripts === 'function' + ); +})(); -const reader_browser = false -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/indexed-reader.js + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/platform/index.js + +/* harmony default export */ const platform = ({ + ...common_utils_namespaceObject, + ...node +}); +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/toURLEncodedForm.js + + + + + + +function toURLEncodedForm(data, options) { + return helpers_toFormData(data, new platform.classes.URLSearchParams(), Object.assign({ + visitor: function(value, key, path, helpers) { + if (platform.isNode && utils.isBuffer(value)) { + this.append(key, value.toString('base64')); + return false; + } + + return helpers.defaultVisitor.apply(this, arguments); + } + }, options)); +} + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/formDataToJSON.js -/** - * @typedef {import('fs').promises.FileHandle} FileHandle - * @typedef {import('./api').Block} Block - * @typedef {import('./api').BlockIndex} BlockIndex - * @typedef {import('./api').CarReader} CarReaderIface - * @typedef {import('./reader-browser').CarReader} CarReader - * @typedef {{ blockLength:number, blockOffset:number }} RawLocation - */ /** - * A form of {@link CarReader} that pre-indexes a CAR archive from a file and - * provides random access to blocks within the file using the index data. This - * function is **only available in Node.js** and not a browser environment. + * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] * - * For large CAR files, using this form of `CarReader` can be singificantly more - * efficient in terms of memory. The index consists of a list of `CID`s and - * their location within the archive (see {@link CarIndexer}). For large numbers - * of blocks, this index can also occupy a significant amount of memory. In some - * cases it may be necessary to expand the memory capacity of a Node.js instance - * to allow this index to fit. (e.g. by running with - * `NODE_OPTIONS="--max-old-space-size=16384"`). + * @param {string} name - The name of the property to get. * - * As an `CarIndexedReader` instance maintains an open file descriptor for its - * CAR file, an additional {@link CarReader#close} method is attached. This - * _must_ be called to have full clean-up of resources after use. + * @returns An array of strings. + */ +function parsePropPath(name) { + // foo[x][y][z] + // foo.x.y.z + // foo-x-y-z + // foo x y z + return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => { + return match[0] === '[]' ? '' : match[1] || match[0]; + }); +} + +/** + * Convert an array to an object. * - * Load this class with either - * `import { CarIndexedReader } from '@ipld/car/indexed-reader'` - * (`const { CarIndexedReader } = require('@ipld/car/indexed-reader')`). Or - * `import { CarIndexedReader } from '@ipld/car'` - * (`const { CarIndexedReader } = require('@ipld/car')`). The former will likely - * result in smaller bundle sizes where this is important. + * @param {Array} arr - The array to convert to an object. * - * @name CarIndexedReader - * @class - * @implements {CarReaderIface} - * @extends {CarReader} - * @property {number} version The version number of the CAR referenced by this - * reader (should be `1`). + * @returns An object with the same keys and values as the array. */ -class CarIndexedReader { - /** - * @param {number} version - * @param {string} path - * @param {CID[]} roots - * @param {Map} index - * @param {string[]} order - */ - constructor (version, path, roots, index, order) { - this._version = version - this._path = path - this._roots = roots - this._index = index - this._order = order - this._fd = null - } - - get version () { - return this._version +function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; } + return obj; +} - /** - * See {@link CarReader#getRoots} - * - * @function - * @memberof CarIndexedReader - * @instance - * @async - * @returns {Promise} - */ - async getRoots () { - return this._roots - } +/** + * It takes a FormData object and returns a JavaScript object + * + * @param {string} formData The FormData object to convert to JSON. + * + * @returns {Object | null} The converted object. + */ +function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + let name = path[index++]; + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path.length; + name = !name && utils.isArray(target) ? target.length : name; - /** - * See {@link CarReader#has} - * - * @function - * @memberof CarIndexedReader - * @instance - * @async - * @param {CID} key - * @returns {Promise} - */ - async has (key) { - return this._index.has(key.toString()) - } + if (isLast) { + if (utils.hasOwnProp(target, name)) { + target[name] = [target[name], value]; + } else { + target[name] = value; + } - /** - * See {@link CarReader#get} - * - * @function - * @memberof CarIndexedReader - * @instance - * @async - * @param {CID} key - * @returns {Promise} - */ - async get (key) { - const blockIndex = this._index.get(key.toString()) - if (!blockIndex) { - return undefined - } - if (!this._fd) { - this._fd = await fs.promises.open(this._path, 'r') - } - const readIndex = { - cid: key, - length: 0, - offset: 0, - blockLength: blockIndex.blockLength, - blockOffset: blockIndex.blockOffset + return !isNumericKey; } - return NodeCarReader.readRaw(this._fd, readIndex) - } - /** - * See {@link CarReader#blocks} - * - * @function - * @memberof CarIndexedReader - * @instance - * @async - * @generator - * @returns {AsyncGenerator} - */ - async * blocks () { - for (const cidStr of this._order) { - const block = await this.get(CID.parse(cidStr)) - /* c8 ignore next 3 */ - if (!block) { - throw new Error('Unexpected internal error') - } - yield block + if (!target[name] || !utils.isObject(target[name])) { + target[name] = []; } - } - /** - * See {@link CarReader#cids} - * - * @function - * @memberof CarIndexedReader - * @instance - * @async - * @generator - * @returns {AsyncGenerator} - */ - async * cids () { - for (const cidStr of this._order) { - yield CID.parse(cidStr) - } - } + const result = buildPath(path, value, target[name], index); - /** - * Close the underlying file descriptor maintained by this `CarIndexedReader`. - * This must be called for proper resource clean-up to occur. - * - * @function - * @memberof CarIndexedReader - * @instance - * @async - * @returns {Promise} - */ - async close () { - if (this._fd) { - return this._fd.close() + if (result && utils.isArray(target[name])) { + target[name] = arrayToObject(target[name]); } + + return !isNumericKey; } - /** - * Instantiate an {@link CarIndexedReader} from a file with the provided - * `path`. The CAR file is first indexed with a full path that collects `CID`s - * and block locations. This index is maintained in memory. Subsequent reads - * operate on a read-only file descriptor, fetching the block from its in-file - * location. - * - * For large archives, the initial indexing may take some time. The returned - * `Promise` will resolve only after this is complete. - * - * @async - * @static - * @memberof CarIndexedReader - * @param {string} path - * @returns {Promise} - */ - static async fromFile (path) { - if (typeof path !== 'string') { - throw new TypeError('fromFile() requires a file path string') - } + if (utils.isFormData(formData) && utils.isFunction(formData.entries)) { + const obj = {}; - const iterable = await CarIndexer.fromIterable(Readable.from(fs.createReadStream(path))) - /** @type {Map} */ - const index = new Map() - /** @type {string[]} */ - const order = [] - for await (const { cid, blockLength, blockOffset } of iterable) { - const cidStr = cid.toString() - index.set(cidStr, { blockLength, blockOffset }) - order.push(cidStr) - } - return new CarIndexedReader(iterable.version, path, await iterable.getRoots(), index, order) + utils.forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); + }); + + return obj; } + + return null; } -const indexed_reader_browser = false +/* harmony default export */ const helpers_formDataToJSON = (formDataToJSON); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/defaults/index.js + + + -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/iterator.js -/** - * @typedef {import('multiformats').CID} CID - * @typedef {import('./api').Block} Block - * @typedef {import('./api').RootsReader} RootsReader - * @typedef {import('./coding').BytesReader} BytesReader - */ -/** - * @class - * @implements {RootsReader} - * @property {number} version The version number of the CAR referenced by this reader (should be `1`). - */ -class CarIteratorBase { - /** - * @param {number} version - * @param {CID[]} roots - * @param {AsyncIterable|void} iterable - */ - constructor (version, roots, iterable) { - this._version = version - this._roots = roots - this._iterable = iterable - this._decoded = false - } - get version () { - return this._version - } - /** - * @returns {Promise} - */ - async getRoots () { - return this._roots - } -} /** - * Provides an iterator over all of the `Block`s in a CAR. Implements a - * `BlockIterator` interface, or `AsyncIterable`. Where a `Block` is - * a `{ cid:CID, bytes:Uint8Array }` pair. - * - * As an implementer of `AsyncIterable`, this class can be used directly in a - * `for await (const block of iterator) {}` loop. Where the `iterator` is - * constructed using {@link CarBlockiterator.fromBytes} or - * {@link CarBlockiterator.fromIterable}. - * - * An iteration can only be performce _once_ per instantiation. - * - * `CarBlockIterator` also implements the `RootsReader` interface and provides - * the {@link CarBlockiterator.getRoots `getRoots()`} method. + * It takes a string, tries to parse it, and if it fails, it returns the stringified version + * of the input * - * Load this class with either - * `import { CarBlockIterator } from '@ipld/car/iterator'` - * (`const { CarBlockIterator } = require('@ipld/car/iterator')`). Or - * `import { CarBlockIterator } from '@ipld/car'` - * (`const { CarBlockIterator } = require('@ipld/car')`). + * @param {any} rawValue - The value to be stringified. + * @param {Function} parser - A function that parses a string into a JavaScript object. + * @param {Function} encoder - A function that takes a value and returns a string. * - * @name CarBlockIterator - * @class - * @implements {RootsReader} - * @implements {AsyncIterable} - * @property {number} version The version number of the CAR referenced by this - * iterator (should be `1`). + * @returns {string} A stringified version of the rawValue. */ -class CarBlockIterator extends (/* unused pure expression or super */ null && (CarIteratorBase)) { - // inherited method - /** - * Get the list of roots defined by the CAR referenced by this iterator. May be - * zero or more `CID`s. - * - * @function getRoots - * @memberof CarBlockIterator - * @instance - * @async - * @returns {Promise} - */ +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } - /** - * @returns {AsyncIterator} - */ - [Symbol.asyncIterator] () { - if (this._decoded) { - throw new Error('Cannot decode more than once') + return (encoder || JSON.stringify)(rawValue); +} + +const defaults = { + + transitional: defaults_transitional, + + adapter: ['xhr', 'http'], + + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ''; + const hasJSONContentType = contentType.indexOf('application/json') > -1; + const isObjectPayload = utils.isObject(data); + + if (isObjectPayload && utils.isHTMLForm(data)) { + data = new FormData(data); } - /* c8 ignore next 3 */ - if (!this._iterable) { - throw new Error('Block iterable not found') + + const isFormData = utils.isFormData(data); + + if (isFormData) { + if (!hasJSONContentType) { + return data; + } + return hasJSONContentType ? JSON.stringify(helpers_formDataToJSON(data)) : data; } - this._decoded = true - return this._iterable[Symbol.asyncIterator]() - } - /** - * Instantiate a {@link CarBlockIterator} from a `Uint8Array` blob. Rather - * than decoding the entire byte array prior to returning the iterator, as in - * {@link CarReader.fromBytes}, only the header is decoded and the remainder - * of the CAR is parsed as the `Block`s as yielded. - * - * @async - * @static - * @memberof CarBlockIterator - * @param {Uint8Array} bytes - * @returns {Promise} - */ - static async fromBytes (bytes) { - const { version, roots, iterator } = await iterator_fromBytes(bytes) - return new CarBlockIterator(version, roots, iterator) - } + if (utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); + return data.toString(); + } + + let isFileList; + + if (isObjectPayload) { + if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { + return toURLEncodedForm(data, this.formSerializer).toString(); + } + + if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { + const _FormData = this.env && this.env.FormData; + + return helpers_toFormData( + isFileList ? {'files[]': data} : data, + _FormData && new _FormData(), + this.formSerializer + ); + } + } + + if (isObjectPayload || hasJSONContentType ) { + headers.setContentType('application/json', false); + return stringifySafely(data); + } + + return data; + }], + + transformResponse: [function transformResponse(data) { + const transitional = this.transitional || defaults.transitional; + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; + const JSONRequested = this.responseType === 'json'; + + if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { + const silentJSONParsing = transitional && transitional.silentJSONParsing; + const strictJSONParsing = !silentJSONParsing && JSONRequested; + + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw core_AxiosError.from(e, core_AxiosError.ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } + + return data; + }], /** - * Instantiate a {@link CarBlockIterator} from a `AsyncIterable`, - * such as a [modern Node.js stream](https://nodejs.org/api/stream.html#stream_streams_compatibility_with_async_generators_and_async_iterators). - * Rather than decoding the entire byte array prior to returning the iterator, - * as in {@link CarReader.fromIterable}, only the header is decoded and the - * remainder of the CAR is parsed as the `Block`s as yielded. - * - * @async - * @static - * @param {AsyncIterable} asyncIterable - * @returns {Promise} + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. */ - static async fromIterable (asyncIterable) { - const { version, roots, iterator } = await fromIterable(asyncIterable) - return new CarBlockIterator(version, roots, iterator) + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + env: { + FormData: platform.classes.FormData, + Blob: platform.classes.Blob + }, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + + headers: { + common: { + 'Accept': 'application/json, text/plain, */*', + 'Content-Type': undefined + } } -} +}; + +utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => { + defaults.headers[method] = {}; +}); + +/* harmony default export */ const lib_defaults = (defaults); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/parseHeaders.js + + + + +// RawAxiosHeaders whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +const ignoreDuplicateOf = utils.toObjectSet([ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]); /** - * Provides an iterator over all of the `CID`s in a CAR. Implements a - * `CIDIterator` interface, or `AsyncIterable`. Similar to - * {@link CarBlockIterator} but only yields the CIDs in the CAR. - * - * As an implementer of `AsyncIterable`, this class can be used directly in a - * `for await (const cid of iterator) {}` loop. Where the `iterator` is - * constructed using {@link CarCIDiterator.fromBytes} or - * {@link CarCIDiterator.fromIterable}. - * - * An iteration can only be performce _once_ per instantiation. + * Parse headers into an object * - * `CarCIDIterator` also implements the `RootsReader` interface and provides - * the {@link CarCIDiterator.getRoots `getRoots()`} method. + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` * - * Load this class with either - * `import { CarCIDIterator } from '@ipld/car/iterator'` - * (`const { CarCIDIterator } = require('@ipld/car/iterator')`). Or - * `import { CarCIDIterator } from '@ipld/car'` - * (`const { CarCIDIterator } = require('@ipld/car')`). + * @param {String} rawHeaders Headers needing to be parsed * - * @name CarCIDIterator - * @class - * @implements {RootsReader} - * @implements {AsyncIterable} - * @property {number} version The version number of the CAR referenced by this - * iterator (should be `1`). + * @returns {Object} Headers parsed into an object */ -class CarCIDIterator extends (/* unused pure expression or super */ null && (CarIteratorBase)) { - // inherited method - /** - * Get the list of roots defined by the CAR referenced by this iterator. May be - * zero or more `CID`s. - * - * @function getRoots - * @memberof CarCIDIterator - * @instance - * @async - * @returns {Promise} - */ +/* harmony default export */ const parseHeaders = (rawHeaders => { + const parsed = {}; + let key; + let val; + let i; - /** - * @returns {AsyncIterator} - */ - [Symbol.asyncIterator] () { - if (this._decoded) { - throw new Error('Cannot decode more than once') - } - /* c8 ignore next 3 */ - if (!this._iterable) { - throw new Error('Block iterable not found') + rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { + i = line.indexOf(':'); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + + if (!key || (parsed[key] && ignoreDuplicateOf[key])) { + return; } - this._decoded = true - const iterable = this._iterable[Symbol.asyncIterator]() - return { - async next () { - const next = await iterable.next() - if (next.done) { - return next - } - return { done: false, value: next.value.cid } + + if (key === 'set-cookie') { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; } + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; } - } + }); - /** - * Instantiate a {@link CarCIDIterator} from a `Uint8Array` blob. Rather - * than decoding the entire byte array prior to returning the iterator, as in - * {@link CarReader.fromBytes}, only the header is decoded and the remainder - * of the CAR is parsed as the `CID`s as yielded. - * - * @async - * @static - * @memberof CarCIDIterator - * @param {Uint8Array} bytes - * @returns {Promise} - */ - static async fromBytes (bytes) { - const { version, roots, iterator } = await iterator_fromBytes(bytes) - return new CarCIDIterator(version, roots, iterator) - } + return parsed; +}); - /** - * Instantiate a {@link CarCIDIterator} from a `AsyncIterable`, - * such as a [modern Node.js stream](https://nodejs.org/api/stream.html#stream_streams_compatibility_with_async_generators_and_async_iterators). - * Rather than decoding the entire byte array prior to returning the iterator, - * as in {@link CarReader.fromIterable}, only the header is decoded and the - * remainder of the CAR is parsed as the `CID`s as yielded. - * - * @async - * @static - * @memberof CarCIDIterator - * @param {AsyncIterable} asyncIterable - * @returns {Promise} - */ - static async fromIterable (asyncIterable) { - const { version, roots, iterator } = await fromIterable(asyncIterable) - return new CarCIDIterator(version, roots, iterator) +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/core/AxiosHeaders.js + + + + + +const $internals = Symbol('internals'); + +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); +} + +function normalizeValue(value) { + if (value === false || value == null) { + return value; } + + return utils.isArray(value) ? value.map(normalizeValue) : String(value); } -/** - * @param {Uint8Array} bytes - * @returns {Promise<{ version:number, roots:CID[], iterator:AsyncIterable}>} - */ -async function iterator_fromBytes (bytes) { - if (!(bytes instanceof Uint8Array)) { - throw new TypeError('fromBytes() requires a Uint8Array') +function parseTokens(str) { + const tokens = Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + + while ((match = tokensRE.exec(str))) { + tokens[match[1]] = match[2]; } - return decodeIterator(bytesReader(bytes)) + + return tokens; } -/** - * @param {AsyncIterable} asyncIterable - * @returns {Promise<{ version:number, roots:CID[], iterator:AsyncIterable}>} - */ -async function fromIterable (asyncIterable) { - if (!asyncIterable || !(typeof asyncIterable[Symbol.asyncIterator] === 'function')) { - throw new TypeError('fromIterable() requires an async iterable') +const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); + +function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (utils.isFunction(filter)) { + return filter.call(this, value, header); + } + + if (isHeaderNameFilter) { + value = header; + } + + if (!utils.isString(value)) return; + + if (utils.isString(filter)) { + return value.indexOf(filter) !== -1; + } + + if (utils.isRegExp(filter)) { + return filter.test(value); } - return decodeIterator(asyncIterableReader(asyncIterable)) } -/** - * @private - * @param {BytesReader} reader - * @returns {Promise<{ version:number, roots:CID[], iterator:AsyncIterable}>} - */ -async function decodeIterator (reader) { - const decoder = createDecoder(reader) - const { version, roots } = await decoder.header() - return { version, roots, iterator: decoder.blocks() } +function formatHeader(header) { + return header.trim() + .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); } -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/encoder.js +function buildAccessors(obj, header) { + const accessorName = utils.toCamelCase(' ' + header); + ['get', 'set', 'has'].forEach(methodName => { + Object.defineProperty(obj, methodName + accessorName, { + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} +class AxiosHeaders { + constructor(headers) { + headers && this.set(headers); + } -/** - * @typedef {import('multiformats').CID} CID - * @typedef {import('./api').Block} Block - * @typedef {import('./coding').CarEncoder} CarEncoder - * @typedef {import('./coding').IteratorChannel_Writer} IteratorChannel_Writer - */ + set(header, valueOrRewrite, rewrite) { + const self = this; -/** - * Create a header from an array of roots. - * - * @param {CID[]} roots - * @returns {Uint8Array} - */ -function createHeader (roots) { - const headerBytes = dag_cbor_src_encode({ version: 1, roots }) - const varintBytes = sdk_node_modules_varint.encode(headerBytes.length) - const header = new Uint8Array(varintBytes.length + headerBytes.length) - header.set(varintBytes, 0) - header.set(headerBytes, varintBytes.length) - return header -} + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); -/** - * @param {IteratorChannel_Writer} writer - * @returns {CarEncoder} - */ -function createEncoder (writer) { - // none of this is wrapped in a mutex, that needs to happen above this to - // avoid overwrites + if (!lHeader) { + throw new Error('header name must be a non-empty string'); + } - return { - /** - * @param {CID[]} roots - * @returns {Promise} - */ - async setRoots (roots) { - const bytes = createHeader(roots) - await writer.write(bytes) - }, + const key = utils.findKey(self, lHeader); - /** - * @param {Block} block - * @returns {Promise} - */ - async writeBlock (block) { - const { cid, bytes } = block - await writer.write(new Uint8Array(sdk_node_modules_varint.encode(cid.bytes.length + bytes.length))) - await writer.write(cid.bytes) - if (bytes.length) { - // zero-length blocks are valid, but it'd be safer if we didn't write them - await writer.write(bytes) + if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { + self[key || _header] = normalizeValue(_value); } - }, + } - /** - * @returns {Promise} - */ - async close () { - await writer.end() + const setHeaders = (headers, _rewrite) => + utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + + if (utils.isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite) + } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders(parseHeaders(header), valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); } + + return this; } -} + get(header, parser) { + header = normalizeHeader(header); + if (header) { + const key = utils.findKey(this, header); -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/iterator-channel.js -/** - * @template {any} T - * @typedef {import('./coding').IteratorChannel} IteratorChannel - */ + if (key) { + const value = this[key]; -function iterator_channel_noop () {} + if (!parser) { + return value; + } -/** - * @template {any} T - * @returns {IteratorChannel} - */ -function iterator_channel_create () { - /** @type {T[]} */ - const chunkQueue = [] - /** @type {Promise | null} */ - let drainer = null - let drainerResolver = iterator_channel_noop - let ended = false - /** @type {Promise> | null} */ - let outWait = null - let outWaitResolver = iterator_channel_noop + if (parser === true) { + return parseTokens(value); + } - const makeDrainer = () => { - if (!drainer) { - drainer = new Promise((resolve) => { - drainerResolver = () => { - drainer = null - drainerResolver = iterator_channel_noop - resolve() + if (utils.isFunction(parser)) { + return parser.call(this, value, key); } - }) + + if (utils.isRegExp(parser)) { + return parser.exec(value); + } + + throw new TypeError('parser must be boolean|regexp|function'); + } } - return drainer } - /** - * @returns {IteratorChannel} - */ - const writer = { - /** - * @param {T} chunk - * @returns {Promise} - */ - write (chunk) { - chunkQueue.push(chunk) - const drainer = makeDrainer() - outWaitResolver() - return drainer - }, + has(header, matcher) { + header = normalizeHeader(header); - async end () { - ended = true - const drainer = makeDrainer() - outWaitResolver() - await drainer + if (header) { + const key = utils.findKey(this, header); + + return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); } + + return false; } - /** @type {AsyncIterator} */ - const iterator = { - /** @returns {Promise>} */ - async next () { - const chunk = chunkQueue.shift() - if (chunk) { - if (chunkQueue.length === 0) { - drainerResolver() + delete(header, matcher) { + const self = this; + let deleted = false; + + function deleteHeader(_header) { + _header = normalizeHeader(_header); + + if (_header) { + const key = utils.findKey(self, _header); + + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + + deleted = true; } - return { done: false, value: chunk } } + } - if (ended) { - drainerResolver() - return { done: true, value: undefined } - } + if (utils.isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } - if (!outWait) { - outWait = new Promise((resolve) => { - outWaitResolver = () => { - outWait = null - outWaitResolver = iterator_channel_noop - return resolve(iterator.next()) - } - }) - } + return deleted; + } - return outWait + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + + while (i--) { + const key = keys[i]; + if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } } + + return deleted; } - return { writer, iterator } -} + normalize(format) { + const self = this; + const headers = {}; -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/writer-browser.js + utils.forEach(this, (value, header) => { + const key = utils.findKey(headers, header); + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + const normalized = format ? formatHeader(header) : String(header).trim(); + if (normalized !== header) { + delete self[header]; + } + self[normalized] = normalizeValue(value); -/** - * @typedef {import('./api').Block} Block - * @typedef {import('./api').BlockWriter} BlockWriter - * @typedef {import('./api').WriterChannel} WriterChannel - * @typedef {import('./coding').CarEncoder} CarEncoder - * @typedef {import('./coding').IteratorChannel} IteratorChannel - */ + headers[normalized] = true; + }); -/** - * Provides a writer interface for the creation of CAR files. - * - * Creation of a `CarWriter` involves the instatiation of an input / output pair - * in the form of a `WriterChannel`, which is a - * `{ writer:CarWriter, out:AsyncIterable }` pair. These two - * components form what can be thought of as a stream-like interface. The - * `writer` component (an instantiated `CarWriter`), has methods to - * {@link CarWriter.put `put()`} new blocks and {@link CarWriter.put `close()`} - * the writing operation (finalising the CAR archive). The `out` component is - * an `AsyncIterable` that yields the bytes of the archive. This can be - * redirected to a file or other sink. In Node.js, you can use the - * [`Readable.from()`](https://nodejs.org/api/stream.html#stream_stream_readable_from_iterable_options) - * API to convert this to a standard Node.js stream, or it can be directly fed - * to a - * [`stream.pipeline()`](https://nodejs.org/api/stream.html#stream_stream_pipeline_source_transforms_destination_callback). - * - * The channel will provide a form of backpressure. The `Promise` from a - * `write()` won't resolve until the resulting data is drained from the `out` - * iterable. - * - * It is also possible to ignore the `Promise` from `write()` calls and allow - * the generated data to queue in memory. This should be avoided for large CAR - * archives of course due to the memory costs and potential for memory overflow. - * - * Load this class with either - * `import { CarWriter } from '@ipld/car/writer'` - * (`const { CarWriter } = require('@ipld/car/writer')`). Or - * `import { CarWriter } from '@ipld/car'` - * (`const { CarWriter } = require('@ipld/car')`). The former will likely - * result in smaller bundle sizes where this is important. - * - * @name CarWriter - * @class - * @implements {BlockWriter} - */ -class writer_browser_CarWriter { - /** - * @param {CID[]} roots - * @param {CarEncoder} encoder - */ - constructor (roots, encoder) { - this._encoder = encoder - /** @type {Promise} */ - this._mutex = encoder.setRoots(roots) - this._ended = false + return this; } - /** - * Write a `Block` (a `{ cid:CID, bytes:Uint8Array }` pair) to the archive. - * - * @function - * @memberof CarWriter - * @instance - * @async - * @param {Block} block - A `{ cid:CID, bytes:Uint8Array }` pair. - * @returns {Promise} The returned promise will only resolve once the - * bytes this block generates are written to the `out` iterable. - */ - async put (block) { - if (!(block.bytes instanceof Uint8Array) || !block.cid) { - throw new TypeError('Can only write {cid, bytes} objects') - } - if (this._ended) { - throw new Error('Already closed') - } - const cid = sdk_node_modules_multiformats_src_cid_CID.asCID(block.cid) - if (!cid) { - throw new TypeError('Can only write {cid, bytes} objects') - } - this._mutex = this._mutex.then(() => this._encoder.writeBlock({ cid, bytes: block.bytes })) - return this._mutex + concat(...targets) { + return this.constructor.concat(this, ...targets); } - /** - * Finalise the CAR archive and signal that the `out` iterable should end once - * any remaining bytes are written. - * - * @function - * @memberof CarWriter - * @instance - * @async - * @returns {Promise} - */ - async close () { - if (this._ended) { - throw new Error('Already closed') - } - await this._mutex - this._ended = true - return this._encoder.close() - } + toJSON(asStrings) { + const obj = Object.create(null); - /** - * Create a new CAR writer "channel" which consists of a - * `{ writer:CarWriter, out:AsyncIterable }` pair. - * - * @async - * @static - * @memberof CarWriter - * @param {CID[] | CID | void} roots - * @returns {WriterChannel} The channel takes the form of - * `{ writer:CarWriter, out:AsyncIterable }`. - */ - static create (roots) { - roots = toRoots(roots) - const { encoder, iterator } = encodeWriter() - const writer = new writer_browser_CarWriter(roots, encoder) - const out = new CarWriterOut(iterator) - return { writer, out } + utils.forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value); + }); + + return obj; } - /** - * Create a new CAR appender "channel" which consists of a - * `{ writer:CarWriter, out:AsyncIterable }` pair. - * This appender does not consider roots and does not produce a CAR header. - * It is designed to append blocks to an _existing_ CAR archive. It is - * expected that `out` will be concatenated onto the end of an existing - * archive that already has a properly formatted header. - * - * @async - * @static - * @memberof CarWriter - * @returns {WriterChannel} The channel takes the form of - * `{ writer:CarWriter, out:AsyncIterable }`. - */ - static createAppender () { - const { encoder, iterator } = encodeWriter() - encoder.setRoots = () => Promise.resolve() - const writer = new writer_browser_CarWriter([], encoder) - const out = new CarWriterOut(iterator) - return { writer, out } + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); } - /** - * Update the list of roots in the header of an existing CAR as represented - * in a Uint8Array. - * - * This operation is an _overwrite_, the total length of the CAR will not be - * modified. A rejection will occur if the new header will not be the same - * length as the existing header, in which case the CAR will not be modified. - * It is the responsibility of the user to ensure that the roots being - * replaced encode as the same length as the new roots. - * - * The byte array passed in an argument will be modified and also returned - * upon successful modification. - * - * @async - * @static - * @memberof CarWriter - * @param {Uint8Array} bytes - * @param {CID[]} roots - A new list of roots to replace the existing list in - * the CAR header. The new header must take up the same number of bytes as the - * existing header, so the roots should collectively be the same byte length - * as the existing roots. - * @returns {Promise} - */ - static async updateRootsInBytes (bytes, roots) { - const reader = decoder_bytesReader(bytes) - await decoder_readHeader(reader) - const newHeader = createHeader(roots) - if (Number(reader.pos) !== newHeader.length) { - 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)`) - } - bytes.set(newHeader, 0) - return bytes + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); } -} -/** - * @class - * @implements {AsyncIterable} - */ -class CarWriterOut { - /** - * @param {AsyncIterator} iterator - */ - constructor (iterator) { - this._iterator = iterator + get [Symbol.toStringTag]() { + return 'AxiosHeaders'; } - [Symbol.asyncIterator] () { - if (this._iterating) { - throw new Error('Multiple iterator not supported') - } - this._iterating = true - return this._iterator + static from(thing) { + return thing instanceof this ? thing : new this(thing); } -} -function encodeWriter () { - /** @type {IteratorChannel} */ - const iw = iterator_channel_create() - const { writer, iterator } = iw - const encoder = createEncoder(writer) - return { encoder, iterator } -} + static concat(first, ...targets) { + const computed = new this(first); -/** - * @private - * @param {CID[] | CID | void} roots - * @returns {CID[]} - */ -function toRoots (roots) { - if (roots === undefined) { - return [] + targets.forEach((target) => computed.set(target)); + + return computed; } - if (!Array.isArray(roots)) { - const cid = sdk_node_modules_multiformats_src_cid_CID.asCID(roots) - if (!cid) { - throw new TypeError('roots must be a single CID or an array of CIDs') + static accessor(header) { + const internals = this[$internals] = (this[$internals] = { + accessors: {} + }); + + const accessors = internals.accessors; + const prototype = this.prototype; + + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } } - return [cid] + + utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + + return this; } +} - const _roots = [] - for (const root of roots) { - const _root = sdk_node_modules_multiformats_src_cid_CID.asCID(root) - if (!_root) { - throw new TypeError('roots must be a single CID or an array of CIDs') +AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); + +// reserved names hotfix +utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => { + let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` + return { + get: () => value, + set(headerValue) { + this[mapped] = headerValue; } - _roots.push(_root) } - return _roots -} +}); -const writer_browser_browser = true +utils.freezeMethods(AxiosHeaders); -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/writer.js +/* harmony default export */ const core_AxiosHeaders = (AxiosHeaders); +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/core/transformData.js -const writer_fsread = (0,external_util_.promisify)(external_fs_.read) -const fswrite = (0,external_util_.promisify)(external_fs_.write) /** - * @typedef {import('multiformats/cid').CID} CID - * @typedef {import('./api').BlockWriter} BlockWriter + * Transform the data for a request or a response + * + * @param {Array|Function} fns A single function or Array of functions + * @param {?Object} response The response object + * + * @returns {*} The resulting transformed data */ +function transformData(fns, response) { + const config = this || lib_defaults; + const context = response || config; + const headers = core_AxiosHeaders.from(context.headers); + let data = context.data; -/** - * @class - * @implements {BlockWriter} - */ -class CarWriter extends writer_browser_CarWriter { - /** - * Update the list of roots in the header of an existing CAR file. The first - * argument must be a file descriptor for CAR file that is open in read and - * write mode (not append), e.g. `fs.open` or `fs.promises.open` with `'r+'` - * mode. - * - * This operation is an _overwrite_, the total length of the CAR will not be - * modified. A rejection will occur if the new header will not be the same - * length as the existing header, in which case the CAR will not be modified. - * It is the responsibility of the user to ensure that the roots being - * replaced encode as the same length as the new roots. - * - * This function is **only available in Node.js** and not a browser - * environment. - * - * @async - * @static - * @memberof CarWriter - * @param {fs.promises.FileHandle | number} fd - A file descriptor from the - * Node.js `fs` module. Either an integer, from `fs.open()` or a `FileHandle` - * from `fs.promises.open()`. - * @param {CID[]} roots - A new list of roots to replace the existing list in - * the CAR header. The new header must take up the same number of bytes as the - * existing header, so the roots should collectively be the same byte length - * as the existing roots. - * @returns {Promise} - */ - static async updateRootsInFile (fd, roots) { - const chunkSize = 256 - /** @type {Uint8Array} */ - let bytes - let offset = 0 + utils.forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); + }); - /** @type {() => Promise} */ - let readChunk - if (typeof fd === 'number') { - readChunk = async () => (await writer_fsread(fd, bytes, 0, chunkSize, offset)).bytesRead - } else if (typeof fd === 'object' && typeof fd.read === 'function') { // FileDescriptor - readChunk = async () => (await fd.read(bytes, 0, chunkSize, offset)).bytesRead - } else { - throw new TypeError('Bad fd') - } - const fdReader = chunkReader(async () => { - bytes = new Uint8Array(chunkSize) // need a new chunk each time, can't reuse old - const read = await readChunk() - offset += read - /* eslint no-warning-comments: 0 */ - // TODO: test header > 256 bytes - return read < chunkSize ? bytes.subarray(0, read) : bytes - }) + headers.normalize(); - await decoder_readHeader(fdReader) - const newHeader = createHeader(roots) - if (fdReader.pos !== newHeader.length) { - 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)`) - } - if (typeof fd === 'number') { - await fswrite(fd, newHeader, 0, newHeader.length, 0) - } else if (typeof fd === 'object' && typeof fd.read === 'function') { // FileDescriptor - await fd.write(newHeader, 0, newHeader.length, 0) - } - } + return data; } -const writer_browser = false - -;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/index.js - - - +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/cancel/isCancel.js +function isCancel(value) { + return !!(value && value.__CANCEL__); +} +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/cancel/CanceledError.js -// @see https://www.iana.org/assignments/media-types/application/vnd.ipld.car -const contentType = 'application/vnd.ipld.car' -;// CONCATENATED MODULE: ./node_modules/it-drain/dist/src/index.js /** - * @packageDocumentation - * - * Mostly useful for tests or when you want to be explicit about consuming an iterable without doing anything with any yielded values. - * - * @example - * - * ```javascript - * import drain from 'it-drain' - * - * // This can also be an iterator, generator, etc - * const values = [0, 1, 2, 3, 4] - * - * drain(values) - * ``` - * - * Async sources must be awaited: - * - * ```javascript - * import drain from 'it-drain' + * A `CanceledError` is an object that is thrown when an operation is canceled. * - * const values = async function * { - * yield * [0, 1, 2, 3, 4] - * } + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. * - * await drain(values()) - * ``` + * @returns {CanceledError} The created error. */ -function dist_src_isAsyncIterable(thing) { - return thing[Symbol.asyncIterator] != null; -} -function src_drain(source) { - if (dist_src_isAsyncIterable(source)) { - return (async () => { - for await (const _ of source) { } // eslint-disable-line no-unused-vars,no-empty,@typescript-eslint/no-unused-vars - })(); - } - else { - for (const _ of source) { } // eslint-disable-line no-unused-vars,no-empty,@typescript-eslint/no-unused-vars - } +function CanceledError(message, config, request) { + // eslint-disable-next-line no-eq-null,eqeqeq + core_AxiosError.call(this, message == null ? 'canceled' : message, core_AxiosError.ERR_CANCELED, config, request); + this.name = 'CanceledError'; } -/* harmony default export */ const it_drain_dist_src = (src_drain); -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/it-peekable/dist/src/index.js + +utils.inherits(CanceledError, core_AxiosError, { + __CANCEL__: true +}); + +/* harmony default export */ const cancel_CanceledError = (CanceledError); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/core/settle.js + + + + /** - * @packageDocumentation - * - * Lets you look at the contents of an async iterator and decide what to do - * - * @example - * - * ```javascript - * import peekable from 'it-peekable' - * - * // This can also be an iterator, generator, etc - * const values = [0, 1, 2, 3, 4] - * - * const it = peekable(value) - * - * const first = it.peek() - * - * console.info(first) // 0 - * - * it.push(first) - * - * console.info([...it]) - * // [ 0, 1, 2, 3, 4 ] - * ``` - * - * Async sources must be awaited: - * - * ```javascript - * import peekable from 'it-peekable' - * - * const values = async function * () { - * yield * [0, 1, 2, 3, 4] - * } - * - * const it = peekable(values()) - * - * const first = await it.peek() - * - * console.info(first) // 0 + * Resolve or reject a Promise based on response status. * - * it.push(first) + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. * - * console.info(await all(it)) - * // [ 0, 1, 2, 3, 4 ] - * ``` + * @returns {object} The response. */ -function peekable(iterable) { - // @ts-expect-error can't use Symbol.asyncIterator to index iterable since it might be Iterable - const [iterator, symbol] = iterable[Symbol.asyncIterator] != null - // @ts-expect-error can't use Symbol.asyncIterator to index iterable since it might be Iterable - ? [iterable[Symbol.asyncIterator](), Symbol.asyncIterator] - // @ts-expect-error can't use Symbol.iterator to index iterable since it might be AsyncIterable - : [iterable[Symbol.iterator](), Symbol.iterator]; - const queue = []; - // @ts-expect-error can't use symbol to index peekable - return { - peek: () => { - return iterator.next(); - }, - push: (value) => { - queue.push(value); - }, - next: () => { - if (queue.length > 0) { - return { - done: false, - value: queue.shift() - }; - } - return iterator.next(); - }, - [symbol]() { - return this; - } - }; +function settle(resolve, reject, response) { + const validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new core_AxiosError( + 'Request failed with status code ' + response.status, + [core_AxiosError.ERR_BAD_REQUEST, core_AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } } -/* harmony default export */ const it_peekable_dist_src = (peekable); -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/it-map/dist/src/index.js + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/isAbsoluteURL.js + + /** - * @packageDocumentation - * - * Convert one value from an (async)iterator into another. - * - * @example - * - * ```javascript - * import map from 'it-map' - * - * // This can also be an iterator, generator, etc - * const values = [0, 1, 2, 3, 4] - * - * const result = map(values, (val) => val++) - * - * console.info(result) // [1, 2, 3, 4, 5] - * ``` - * - * Async sources and transforms must be awaited: - * - * ```javascript - * import map from 'it-map' - * - * const values = async function * () { - * yield * [0, 1, 2, 3, 4] - * } - * - * const result = await map(values(), async (val) => val++) + * Determines whether the specified URL is absolute * - * console.info(result) // [1, 2, 3, 4, 5] - * ``` + * @param {string} url The URL to test + * + * @returns {boolean} True if the specified URL is absolute, otherwise false */ - -function it_map_dist_src_isAsyncIterable(thing) { - return thing[Symbol.asyncIterator] != null; -} -function src_map(source, func) { - if (it_map_dist_src_isAsyncIterable(source)) { - return (async function* () { - for await (const val of source) { - yield func(val); - } - })(); - } - // if mapping function returns a promise we have to return an async generator - const peekable = it_peekable_dist_src(source); - const { value, done } = peekable.next(); - if (done === true) { - return (function* () { }()); - } - const res = func(value); - // @ts-expect-error .then is not present on O - if (typeof res.then === 'function') { - return (async function* () { - yield await res; - for await (const val of peekable) { - yield func(val); - } - })(); - } - const fn = func; - return (function* () { - yield res; - for (const val of peekable) { - yield fn(val); - } - })(); +function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); } -/* harmony default export */ const it_map_dist_src = (src_map); -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/p-defer/index.js -function pDefer() { - const deferred = {}; - deferred.promise = new Promise((resolve, reject) => { - deferred.resolve = resolve; - deferred.reject = reject; - }); +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/combineURLs.js - return deferred; + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * + * @returns {string} The combined URL + */ +function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; } -// EXTERNAL MODULE: ./node_modules/eventemitter3/index.js -var eventemitter3 = __nccwpck_require__(27929); -;// CONCATENATED MODULE: ./node_modules/eventemitter3/index.mjs +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/core/buildFullPath.js -/* harmony default export */ const node_modules_eventemitter3 = ((/* unused pure expression or super */ null && (EventEmitter))); -;// CONCATENATED MODULE: ./node_modules/p-timeout/index.js -class TimeoutError extends Error { - constructor(message) { - super(message); - this.name = 'TimeoutError'; - } -} /** -An error to be thrown when the request is aborted by AbortController. -DOMException is thrown instead of this Error when DOMException is available. -*/ -class p_timeout_AbortError extends Error { - constructor(message) { - super(); - this.name = 'AbortError'; - this.message = message; - } + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * + * @returns {string} The combined full path + */ +function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; } -/** -TODO: Remove AbortError and just throw DOMException when targeting Node 18. -*/ -const getDOMException = errorMessage => globalThis.DOMException === undefined ? - new p_timeout_AbortError(errorMessage) : - new DOMException(errorMessage); +// EXTERNAL MODULE: ./node_modules/proxy-from-env/index.js +var proxy_from_env = __nccwpck_require__(24774); +// EXTERNAL MODULE: external "util" +var external_util_ = __nccwpck_require__(73837); +// EXTERNAL MODULE: ./node_modules/follow-redirects/index.js +var follow_redirects = __nccwpck_require__(14016); +// EXTERNAL MODULE: external "zlib" +var external_zlib_ = __nccwpck_require__(59796); +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/env/data.js +const VERSION = "1.6.2"; +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/parseProtocol.js -/** -TODO: Remove below function and just 'reject(signal.reason)' when targeting Node 18. -*/ -const getAbortedReason = signal => { - const reason = signal.reason === undefined ? - getDOMException('This operation was aborted.') : - signal.reason; - return reason instanceof Error ? reason : getDOMException(reason); -}; +function parseProtocol(url) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; +} -function pTimeout(promise, milliseconds, fallback, options) { - let timer; +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/fromDataURI.js - const cancelablePromise = new Promise((resolve, reject) => { - if (typeof milliseconds !== 'number' || Math.sign(milliseconds) !== 1) { - throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${milliseconds}\``); - } - if (milliseconds === Number.POSITIVE_INFINITY) { - resolve(promise); - return; - } - options = { - customTimers: {setTimeout, clearTimeout}, - ...options - }; - if (options.signal) { - const {signal} = options; - if (signal.aborted) { - reject(getAbortedReason(signal)); - } - signal.addEventListener('abort', () => { - reject(getAbortedReason(signal)); - }); - } - timer = options.customTimers.setTimeout.call(undefined, () => { - if (typeof fallback === 'function') { - try { - resolve(fallback()); - } catch (error) { - reject(error); - } +const DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/; - return; - } +/** + * Parse data uri to a Buffer or Blob + * + * @param {String} uri + * @param {?Boolean} asBlob + * @param {?Object} options + * @param {?Function} options.Blob + * + * @returns {Buffer|Blob} + */ +function fromDataURI(uri, asBlob, options) { + const _Blob = options && options.Blob || platform.classes.Blob; + const protocol = parseProtocol(uri); - const message = typeof fallback === 'string' ? fallback : `Promise timed out after ${milliseconds} milliseconds`; - const timeoutError = fallback instanceof Error ? fallback : new TimeoutError(message); + if (asBlob === undefined && _Blob) { + asBlob = true; + } - if (typeof promise.cancel === 'function') { - promise.cancel(); - } + if (protocol === 'data') { + uri = protocol.length ? uri.slice(protocol.length + 1) : uri; - reject(timeoutError); - }, milliseconds); + const match = DATA_URL_PATTERN.exec(uri); - (async () => { - try { - resolve(await promise); - } catch (error) { - reject(error); - } finally { - options.customTimers.clearTimeout.call(undefined, timer); - } - })(); - }); + if (!match) { + throw new core_AxiosError('Invalid URL', core_AxiosError.ERR_INVALID_URL); + } - cancelablePromise.clear = () => { - clearTimeout(timer); - timer = undefined; - }; + const mime = match[1]; + const isBase64 = match[2]; + const body = match[3]; + const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8'); - return cancelablePromise; -} + if (asBlob) { + if (!_Blob) { + throw new core_AxiosError('Blob is not supported', core_AxiosError.ERR_NOT_SUPPORT); + } -;// CONCATENATED MODULE: ./node_modules/p-queue/dist/lower-bound.js -// Port of lower_bound from https://en.cppreference.com/w/cpp/algorithm/lower_bound -// Used to compute insertion index to keep queue sorted after insertion -function lowerBound(array, value, comparator) { - let first = 0; - let count = array.length; - while (count > 0) { - const step = Math.trunc(count / 2); - let it = first + step; - if (comparator(array[it], value) <= 0) { - first = ++it; - count -= step + 1; - } - else { - count = step; - } + return new _Blob([buffer], {type: mime}); } - return first; + + return buffer; + } + + throw new core_AxiosError('Unsupported protocol ' + protocol, core_AxiosError.ERR_NOT_SUPPORT); } -;// CONCATENATED MODULE: ./node_modules/p-queue/dist/priority-queue.js -var priority_queue_classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -}; -var _PriorityQueue_queue; +// EXTERNAL MODULE: external "stream" +var external_stream_ = __nccwpck_require__(12781); +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/throttle.js -class PriorityQueue { - constructor() { - _PriorityQueue_queue.set(this, []); - } - enqueue(run, options) { - options = { - priority: 0, - ...options, - }; - const element = { - priority: options.priority, - run, - }; - if (this.size && priority_queue_classPrivateFieldGet(this, _PriorityQueue_queue, "f")[this.size - 1].priority >= options.priority) { - priority_queue_classPrivateFieldGet(this, _PriorityQueue_queue, "f").push(element); - return; - } - const index = lowerBound(priority_queue_classPrivateFieldGet(this, _PriorityQueue_queue, "f"), element, (a, b) => b.priority - a.priority); - priority_queue_classPrivateFieldGet(this, _PriorityQueue_queue, "f").splice(index, 0, element); - } - dequeue() { - const item = priority_queue_classPrivateFieldGet(this, _PriorityQueue_queue, "f").shift(); - return item === null || item === void 0 ? void 0 : item.run; - } - filter(options) { - return priority_queue_classPrivateFieldGet(this, _PriorityQueue_queue, "f").filter((element) => element.priority === options.priority).map((element) => element.run); + +/** + * Throttle decorator + * @param {Function} fn + * @param {Number} freq + * @return {Function} + */ +function throttle(fn, freq) { + let timestamp = 0; + const threshold = 1000 / freq; + let timer = null; + return function throttled(force, args) { + const now = Date.now(); + if (force || now - timestamp > threshold) { + if (timer) { + clearTimeout(timer); + timer = null; + } + timestamp = now; + return fn.apply(null, args); } - get size() { - return priority_queue_classPrivateFieldGet(this, _PriorityQueue_queue, "f").length; + if (!timer) { + timer = setTimeout(() => { + timer = null; + timestamp = Date.now(); + return fn.apply(null, args); + }, threshold - (now - timestamp)); } + }; } -_PriorityQueue_queue = new WeakMap(); -/* harmony default export */ const priority_queue = (PriorityQueue); -;// CONCATENATED MODULE: ./node_modules/p-queue/dist/index.js -var dist_classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -}; -var dist_classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -}; -var _PQueue_instances, _PQueue_carryoverConcurrencyCount, _PQueue_isIntervalIgnored, _PQueue_intervalCount, _PQueue_intervalCap, _PQueue_interval, _PQueue_intervalEnd, _PQueue_intervalId, _PQueue_timeoutId, _PQueue_queue, _PQueue_queueClass, _PQueue_pending, _PQueue_concurrency, _PQueue_isPaused, _PQueue_throwOnTimeout, _PQueue_doesIntervalAllowAnother_get, _PQueue_doesConcurrentAllowAnother_get, _PQueue_next, _PQueue_onResumeInterval, _PQueue_isIntervalPaused_get, _PQueue_tryToStartAnother, _PQueue_initializeIntervalIfNeeded, _PQueue_onInterval, _PQueue_processQueue, _PQueue_throwOnAbort, _PQueue_onEvent; +/* harmony default export */ const helpers_throttle = (throttle); +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/speedometer.js /** -The error thrown by `queue.add()` when a job is aborted before it is run. See `signal`. -*/ -class dist_AbortError extends Error { -} -/** -Promise queue with concurrency control. -*/ -class PQueue extends eventemitter3 { - // TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()` - constructor(options) { - var _a, _b, _c, _d; - super(); - _PQueue_instances.add(this); - _PQueue_carryoverConcurrencyCount.set(this, void 0); - _PQueue_isIntervalIgnored.set(this, void 0); - _PQueue_intervalCount.set(this, 0); - _PQueue_intervalCap.set(this, void 0); - _PQueue_interval.set(this, void 0); - _PQueue_intervalEnd.set(this, 0); - _PQueue_intervalId.set(this, void 0); - _PQueue_timeoutId.set(this, void 0); - _PQueue_queue.set(this, void 0); - _PQueue_queueClass.set(this, void 0); - _PQueue_pending.set(this, 0); - // The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194 - _PQueue_concurrency.set(this, void 0); - _PQueue_isPaused.set(this, void 0); - _PQueue_throwOnTimeout.set(this, void 0); - /** - Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already. - - Applies to each future operation. - */ - Object.defineProperty(this, "timeout", { - enumerable: true, - configurable: true, - writable: true, - value: void 0 - }); - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - options = { - carryoverConcurrencyCount: false, - intervalCap: Number.POSITIVE_INFINITY, - interval: 0, - concurrency: Number.POSITIVE_INFINITY, - autoStart: true, - queueClass: priority_queue, - ...options, - }; - if (!(typeof options.intervalCap === 'number' && options.intervalCap >= 1)) { - throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(_b = (_a = options.intervalCap) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : ''}\` (${typeof options.intervalCap})`); - } - if (options.interval === undefined || !(Number.isFinite(options.interval) && options.interval >= 0)) { - throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(_d = (_c = options.interval) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : ''}\` (${typeof options.interval})`); - } - dist_classPrivateFieldSet(this, _PQueue_carryoverConcurrencyCount, options.carryoverConcurrencyCount, "f"); - dist_classPrivateFieldSet(this, _PQueue_isIntervalIgnored, options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0, "f"); - dist_classPrivateFieldSet(this, _PQueue_intervalCap, options.intervalCap, "f"); - dist_classPrivateFieldSet(this, _PQueue_interval, options.interval, "f"); - dist_classPrivateFieldSet(this, _PQueue_queue, new options.queueClass(), "f"); - dist_classPrivateFieldSet(this, _PQueue_queueClass, options.queueClass, "f"); - this.concurrency = options.concurrency; - this.timeout = options.timeout; - dist_classPrivateFieldSet(this, _PQueue_throwOnTimeout, options.throwOnTimeout === true, "f"); - dist_classPrivateFieldSet(this, _PQueue_isPaused, options.autoStart === false, "f"); - } - get concurrency() { - return dist_classPrivateFieldGet(this, _PQueue_concurrency, "f"); - } - set concurrency(newConcurrency) { - if (!(typeof newConcurrency === 'number' && newConcurrency >= 1)) { - throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${newConcurrency}\` (${typeof newConcurrency})`); - } - dist_classPrivateFieldSet(this, _PQueue_concurrency, newConcurrency, "f"); - dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_processQueue).call(this); - } - async add(function_, options = {}) { - options = { - timeout: this.timeout, - throwOnTimeout: dist_classPrivateFieldGet(this, _PQueue_throwOnTimeout, "f"), - ...options, - }; - return new Promise((resolve, reject) => { - dist_classPrivateFieldGet(this, _PQueue_queue, "f").enqueue(async () => { - var _a; - var _b, _c; - dist_classPrivateFieldSet(this, _PQueue_pending, (_b = dist_classPrivateFieldGet(this, _PQueue_pending, "f"), _b++, _b), "f"); - dist_classPrivateFieldSet(this, _PQueue_intervalCount, (_c = dist_classPrivateFieldGet(this, _PQueue_intervalCount, "f"), _c++, _c), "f"); - try { - // TODO: Use options.signal?.throwIfAborted() when targeting Node.js 18 - if ((_a = options.signal) === null || _a === void 0 ? void 0 : _a.aborted) { - // TODO: Use ABORT_ERR code when targeting Node.js 16 (https://nodejs.org/docs/latest-v16.x/api/errors.html#abort_err) - throw new dist_AbortError('The task was aborted.'); - } - let operation = function_({ signal: options.signal }); - if (options.timeout) { - operation = pTimeout(Promise.resolve(operation), options.timeout); - } - if (options.signal) { - operation = Promise.race([operation, dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_throwOnAbort).call(this, options.signal)]); - } - const result = await operation; - resolve(result); - this.emit('completed', result); - } - catch (error) { - if (error instanceof TimeoutError && !options.throwOnTimeout) { - resolve(); - return; - } - reject(error); - this.emit('error', error); - } - finally { - dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_next).call(this); - } - }, options); - this.emit('add'); - dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_tryToStartAnother).call(this); - }); - } - async addAll(functions, options) { - return Promise.all(functions.map(async (function_) => this.add(function_, options))); - } - /** - Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.) - */ - start() { - if (!dist_classPrivateFieldGet(this, _PQueue_isPaused, "f")) { - return this; - } - dist_classPrivateFieldSet(this, _PQueue_isPaused, false, "f"); - dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_processQueue).call(this); - return this; - } - /** - Put queue execution on hold. - */ - pause() { - dist_classPrivateFieldSet(this, _PQueue_isPaused, true, "f"); - } - /** - Clear the queue. - */ - clear() { - dist_classPrivateFieldSet(this, _PQueue_queue, new (dist_classPrivateFieldGet(this, _PQueue_queueClass, "f"))(), "f"); - } - /** - Can be called multiple times. Useful if you for example add additional items at a later time. + * Calculate data maxRate + * @param {Number} [samplesCount= 10] + * @param {Number} [min= 1000] + * @returns {Function} + */ +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; - @returns A promise that settles when the queue becomes empty. - */ - async onEmpty() { - // Instantly resolve if the queue is empty - if (dist_classPrivateFieldGet(this, _PQueue_queue, "f").size === 0) { - return; - } - await dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_onEvent).call(this, 'empty'); - } - /** - @returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`. + min = min !== undefined ? min : 1000; - If you want to avoid having the queue grow beyond a certain size you can `await queue.onSizeLessThan()` before adding a new item. + return function push(chunkLength) { + const now = Date.now(); - Note that this only limits the number of items waiting to start. There could still be up to `concurrency` jobs already running that this call does not include in its calculation. - */ - async onSizeLessThan(limit) { - // Instantly resolve if the queue is empty. - if (dist_classPrivateFieldGet(this, _PQueue_queue, "f").size < limit) { - return; - } - await dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_onEvent).call(this, 'next', () => dist_classPrivateFieldGet(this, _PQueue_queue, "f").size < limit); - } - /** - The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet. + const startedAt = timestamps[tail]; - @returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`. - */ - async onIdle() { - // Instantly resolve if none pending and if nothing else is queued - if (dist_classPrivateFieldGet(this, _PQueue_pending, "f") === 0 && dist_classPrivateFieldGet(this, _PQueue_queue, "f").size === 0) { - return; - } - await dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_onEvent).call(this, 'idle'); - } - /** - Size of the queue, the number of queued items waiting to run. - */ - get size() { - return dist_classPrivateFieldGet(this, _PQueue_queue, "f").size; + if (!firstSampleTS) { + firstSampleTS = now; } - /** - Size of the queue, filtered by the given options. - For example, this can be used to find the number of items remaining in the queue with a specific priority level. - */ - sizeBy(options) { - // eslint-disable-next-line unicorn/no-array-callback-reference - return dist_classPrivateFieldGet(this, _PQueue_queue, "f").filter(options).length; + bytes[head] = chunkLength; + timestamps[head] = now; + + let i = tail; + let bytesCount = 0; + + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; } - /** - Number of running items (no longer in the queue). - */ - get pending() { - return dist_classPrivateFieldGet(this, _PQueue_pending, "f"); + + head = (head + 1) % samplesCount; + + if (head === tail) { + tail = (tail + 1) % samplesCount; } - /** - Whether the queue is currently paused. - */ - get isPaused() { - return dist_classPrivateFieldGet(this, _PQueue_isPaused, "f"); + + if (now - firstSampleTS < min) { + return; } + + const passed = startedAt && now - startedAt; + + return passed ? Math.round(bytesCount * 1000 / passed) : undefined; + }; } -_PQueue_carryoverConcurrencyCount = new WeakMap(), _PQueue_isIntervalIgnored = new WeakMap(), _PQueue_intervalCount = new WeakMap(), _PQueue_intervalCap = new WeakMap(), _PQueue_interval = new WeakMap(), _PQueue_intervalEnd = new WeakMap(), _PQueue_intervalId = new WeakMap(), _PQueue_timeoutId = new WeakMap(), _PQueue_queue = new WeakMap(), _PQueue_queueClass = new WeakMap(), _PQueue_pending = new WeakMap(), _PQueue_concurrency = new WeakMap(), _PQueue_isPaused = new WeakMap(), _PQueue_throwOnTimeout = new WeakMap(), _PQueue_instances = new WeakSet(), _PQueue_doesIntervalAllowAnother_get = function _PQueue_doesIntervalAllowAnother_get() { - return dist_classPrivateFieldGet(this, _PQueue_isIntervalIgnored, "f") || dist_classPrivateFieldGet(this, _PQueue_intervalCount, "f") < dist_classPrivateFieldGet(this, _PQueue_intervalCap, "f"); -}, _PQueue_doesConcurrentAllowAnother_get = function _PQueue_doesConcurrentAllowAnother_get() { - return dist_classPrivateFieldGet(this, _PQueue_pending, "f") < dist_classPrivateFieldGet(this, _PQueue_concurrency, "f"); -}, _PQueue_next = function _PQueue_next() { - var _a; - dist_classPrivateFieldSet(this, _PQueue_pending, (_a = dist_classPrivateFieldGet(this, _PQueue_pending, "f"), _a--, _a), "f"); - dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_tryToStartAnother).call(this); - this.emit('next'); -}, _PQueue_onResumeInterval = function _PQueue_onResumeInterval() { - dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_onInterval).call(this); - dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_initializeIntervalIfNeeded).call(this); - dist_classPrivateFieldSet(this, _PQueue_timeoutId, undefined, "f"); -}, _PQueue_isIntervalPaused_get = function _PQueue_isIntervalPaused_get() { - const now = Date.now(); - if (dist_classPrivateFieldGet(this, _PQueue_intervalId, "f") === undefined) { - const delay = dist_classPrivateFieldGet(this, _PQueue_intervalEnd, "f") - now; - if (delay < 0) { - // Act as the interval was done - // We don't need to resume it here because it will be resumed on line 160 - dist_classPrivateFieldSet(this, _PQueue_intervalCount, (dist_classPrivateFieldGet(this, _PQueue_carryoverConcurrencyCount, "f")) ? dist_classPrivateFieldGet(this, _PQueue_pending, "f") : 0, "f"); - } - else { - // Act as the interval is pending - if (dist_classPrivateFieldGet(this, _PQueue_timeoutId, "f") === undefined) { - dist_classPrivateFieldSet(this, _PQueue_timeoutId, setTimeout(() => { - dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_onResumeInterval).call(this); - }, delay), "f"); - } - return true; + +/* harmony default export */ const helpers_speedometer = (speedometer); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/AxiosTransformStream.js + + + + + + + +const kInternals = Symbol('internals'); + +class AxiosTransformStream extends external_stream_.Transform{ + constructor(options) { + options = utils.toFlatObject(options, { + maxRate: 0, + chunkSize: 64 * 1024, + minChunkSize: 100, + timeWindow: 500, + ticksRate: 2, + samplesCount: 15 + }, null, (prop, source) => { + return !utils.isUndefined(source[prop]); + }); + + super({ + readableHighWaterMark: options.chunkSize + }); + + const self = this; + + const internals = this[kInternals] = { + length: options.length, + timeWindow: options.timeWindow, + ticksRate: options.ticksRate, + chunkSize: options.chunkSize, + maxRate: options.maxRate, + minChunkSize: options.minChunkSize, + bytesSeen: 0, + isCaptured: false, + notifiedBytesLoaded: 0, + ts: Date.now(), + bytes: 0, + onReadCallback: null + }; + + const _speedometer = helpers_speedometer(internals.ticksRate * options.samplesCount, internals.timeWindow); + + this.on('newListener', event => { + if (event === 'progress') { + if (!internals.isCaptured) { + internals.isCaptured = true; } + } + }); + + let bytesNotified = 0; + + internals.updateProgress = helpers_throttle(function throttledHandler() { + const totalBytes = internals.length; + const bytesTransferred = internals.bytesSeen; + const progressBytes = bytesTransferred - bytesNotified; + if (!progressBytes || self.destroyed) return; + + const rate = _speedometer(progressBytes); + + bytesNotified = bytesTransferred; + + process.nextTick(() => { + self.emit('progress', { + 'loaded': bytesTransferred, + 'total': totalBytes, + 'progress': totalBytes ? (bytesTransferred / totalBytes) : undefined, + 'bytes': progressBytes, + 'rate': rate ? rate : undefined, + 'estimated': rate && totalBytes && bytesTransferred <= totalBytes ? + (totalBytes - bytesTransferred) / rate : undefined + }); + }); + }, internals.ticksRate); + + const onFinish = () => { + internals.updateProgress(true); + }; + + this.once('end', onFinish); + this.once('error', onFinish); + } + + _read(size) { + const internals = this[kInternals]; + + if (internals.onReadCallback) { + internals.onReadCallback(); } - return false; -}, _PQueue_tryToStartAnother = function _PQueue_tryToStartAnother() { - if (dist_classPrivateFieldGet(this, _PQueue_queue, "f").size === 0) { - // We can clear the interval ("pause") - // Because we can redo it later ("resume") - if (dist_classPrivateFieldGet(this, _PQueue_intervalId, "f")) { - clearInterval(dist_classPrivateFieldGet(this, _PQueue_intervalId, "f")); + + return super._read(size); + } + + _transform(chunk, encoding, callback) { + const self = this; + const internals = this[kInternals]; + const maxRate = internals.maxRate; + + const readableHighWaterMark = this.readableHighWaterMark; + + const timeWindow = internals.timeWindow; + + const divider = 1000 / timeWindow; + const bytesThreshold = (maxRate / divider); + const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0; + + function pushChunk(_chunk, _callback) { + const bytes = Buffer.byteLength(_chunk); + internals.bytesSeen += bytes; + internals.bytes += bytes; + + if (internals.isCaptured) { + internals.updateProgress(); + } + + if (self.push(_chunk)) { + process.nextTick(_callback); + } else { + internals.onReadCallback = () => { + internals.onReadCallback = null; + process.nextTick(_callback); + }; + } + } + + const transformChunk = (_chunk, _callback) => { + const chunkSize = Buffer.byteLength(_chunk); + let chunkRemainder = null; + let maxChunkSize = readableHighWaterMark; + let bytesLeft; + let passed = 0; + + if (maxRate) { + const now = Date.now(); + + if (!internals.ts || (passed = (now - internals.ts)) >= timeWindow) { + internals.ts = now; + bytesLeft = bytesThreshold - internals.bytes; + internals.bytes = bytesLeft < 0 ? -bytesLeft : 0; + passed = 0; } - dist_classPrivateFieldSet(this, _PQueue_intervalId, undefined, "f"); - this.emit('empty'); - if (dist_classPrivateFieldGet(this, _PQueue_pending, "f") === 0) { - this.emit('idle'); + + bytesLeft = bytesThreshold - internals.bytes; + } + + if (maxRate) { + if (bytesLeft <= 0) { + // next time window + return setTimeout(() => { + _callback(null, _chunk); + }, timeWindow - passed); } - return false; - } - if (!dist_classPrivateFieldGet(this, _PQueue_isPaused, "f")) { - const canInitializeInterval = !dist_classPrivateFieldGet(this, _PQueue_instances, "a", _PQueue_isIntervalPaused_get); - if (dist_classPrivateFieldGet(this, _PQueue_instances, "a", _PQueue_doesIntervalAllowAnother_get) && dist_classPrivateFieldGet(this, _PQueue_instances, "a", _PQueue_doesConcurrentAllowAnother_get)) { - const job = dist_classPrivateFieldGet(this, _PQueue_queue, "f").dequeue(); - if (!job) { - return false; - } - this.emit('active'); - job(); - if (canInitializeInterval) { - dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_initializeIntervalIfNeeded).call(this); - } - return true; + + if (bytesLeft < maxChunkSize) { + maxChunkSize = bytesLeft; } - } - return false; -}, _PQueue_initializeIntervalIfNeeded = function _PQueue_initializeIntervalIfNeeded() { - if (dist_classPrivateFieldGet(this, _PQueue_isIntervalIgnored, "f") || dist_classPrivateFieldGet(this, _PQueue_intervalId, "f") !== undefined) { - return; - } - dist_classPrivateFieldSet(this, _PQueue_intervalId, setInterval(() => { - dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_onInterval).call(this); - }, dist_classPrivateFieldGet(this, _PQueue_interval, "f")), "f"); - dist_classPrivateFieldSet(this, _PQueue_intervalEnd, Date.now() + dist_classPrivateFieldGet(this, _PQueue_interval, "f"), "f"); -}, _PQueue_onInterval = function _PQueue_onInterval() { - if (dist_classPrivateFieldGet(this, _PQueue_intervalCount, "f") === 0 && dist_classPrivateFieldGet(this, _PQueue_pending, "f") === 0 && dist_classPrivateFieldGet(this, _PQueue_intervalId, "f")) { - clearInterval(dist_classPrivateFieldGet(this, _PQueue_intervalId, "f")); - dist_classPrivateFieldSet(this, _PQueue_intervalId, undefined, "f"); - } - dist_classPrivateFieldSet(this, _PQueue_intervalCount, dist_classPrivateFieldGet(this, _PQueue_carryoverConcurrencyCount, "f") ? dist_classPrivateFieldGet(this, _PQueue_pending, "f") : 0, "f"); - dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_processQueue).call(this); -}, _PQueue_processQueue = function _PQueue_processQueue() { - // eslint-disable-next-line no-empty - while (dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_tryToStartAnother).call(this)) { } -}, _PQueue_throwOnAbort = async function _PQueue_throwOnAbort(signal) { - return new Promise((_resolve, reject) => { - signal.addEventListener('abort', () => { - // TODO: Reject with signal.throwIfAborted() when targeting Node.js 18 - // TODO: Use ABORT_ERR code when targeting Node.js 16 (https://nodejs.org/docs/latest-v16.x/api/errors.html#abort_err) - reject(new dist_AbortError('The task was aborted.')); - }, { once: true }); - }); -}, _PQueue_onEvent = async function _PQueue_onEvent(event, filter) { - return new Promise(resolve => { - const listener = () => { - if (filter && !filter()) { - return; - } - this.off(event, listener); - resolve(); - }; - this.on(event, listener); + } + + if (maxChunkSize && chunkSize > maxChunkSize && (chunkSize - maxChunkSize) > minChunkSize) { + chunkRemainder = _chunk.subarray(maxChunkSize); + _chunk = _chunk.subarray(0, maxChunkSize); + } + + pushChunk(_chunk, chunkRemainder ? () => { + process.nextTick(_callback, null, chunkRemainder); + } : _callback); + }; + + transformChunk(chunk, function transformNextChunk(err, _chunk) { + if (err) { + return callback(err); + } + + if (_chunk) { + transformChunk(_chunk, transformNextChunk); + } else { + callback(null); + } }); -}; -/* harmony default export */ const dist = (PQueue); + } -;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/vendor/base-x.js -// base-x encoding / decoding -// Copyright (c) 2018 base-x contributors -// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) -// Distributed under the MIT software license, see the accompanying -// file LICENSE or http://www.opensource.org/licenses/mit-license.php. -function car_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { - if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } - var BASE_MAP = new Uint8Array(256); - for (var j = 0; j < BASE_MAP.length; j++) { - BASE_MAP[j] = 255; + setLength(length) { + this[kInternals].length = +length; + return this; } - for (var i = 0; i < ALPHABET.length; i++) { - var x = ALPHABET.charAt(i); - var xc = x.charCodeAt(0); - if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') } - BASE_MAP[xc] = i; +} + +/* harmony default export */ const helpers_AxiosTransformStream = (AxiosTransformStream); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/readBlob.js +const {asyncIterator} = Symbol; + +const readBlob = async function* (blob) { + if (blob.stream) { + yield* blob.stream() + } else if (blob.arrayBuffer) { + yield await blob.arrayBuffer() + } else if (blob[asyncIterator]) { + yield* blob[asyncIterator](); + } else { + yield blob; } - var BASE = ALPHABET.length; - var LEADER = ALPHABET.charAt(0); - var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up - var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up - function encode (source) { - if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) { - source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); - } else if (Array.isArray(source)) { - source = Uint8Array.from(source); - } - if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') } - if (source.length === 0) { return '' } - // Skip & count leading zeroes. - var zeroes = 0; - var length = 0; - var pbegin = 0; - var pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; - } - // Allocate enough space in big-endian base58 representation. - var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; - var b58 = new Uint8Array(size); - // Process the bytes. - while (pbegin !== pend) { - var carry = source[pbegin]; - // Apply "b58 = b58 * 256 + ch". - var i = 0; - for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { - carry += (256 * b58[it1]) >>> 0; - b58[it1] = (carry % BASE) >>> 0; - carry = (carry / BASE) >>> 0; - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - pbegin++; - } - // Skip leading zeroes in base58 result. - var it2 = size - length; - while (it2 !== size && b58[it2] === 0) { - it2++; +} + +/* harmony default export */ const helpers_readBlob = (readBlob); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/formDataToStream.js + + + + + +const BOUNDARY_ALPHABET = utils.ALPHABET.ALPHA_DIGIT + '-_'; + +const formDataToStream_textEncoder = new external_util_.TextEncoder(); + +const CRLF = '\r\n'; +const CRLF_BYTES = formDataToStream_textEncoder.encode(CRLF); +const CRLF_BYTES_COUNT = 2; + +class FormDataPart { + constructor(name, value) { + const {escapeName} = this.constructor; + const isStringValue = utils.isString(value); + + let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${ + !isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : '' + }${CRLF}`; + + if (isStringValue) { + value = formDataToStream_textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF)); + } else { + headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}` } - // Translate the result into a string. - var str = LEADER.repeat(zeroes); - for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); } - return str + + this.headers = formDataToStream_textEncoder.encode(headers + CRLF); + + this.contentLength = isStringValue ? value.byteLength : value.size; + + this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT; + + this.name = name; + this.value = value; } - function decodeUnsafe (source) { - if (typeof source !== 'string') { throw new TypeError('Expected String') } - if (source.length === 0) { return new Uint8Array() } - var psz = 0; - // Skip leading spaces. - if (source[psz] === ' ') { return } - // Skip and count leading '1's. - var zeroes = 0; - var length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; - } - // Allocate enough space in big-endian base256 representation. - var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. - var b256 = new Uint8Array(size); - // Process the characters. - while (source[psz]) { - // Decode character - var carry = BASE_MAP[source.charCodeAt(psz)]; - // Invalid character - if (carry === 255) { return } - var i = 0; - for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { - carry += (BASE * b256[it3]) >>> 0; - b256[it3] = (carry % 256) >>> 0; - carry = (carry / 256) >>> 0; - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - psz++; - } - // Skip trailing spaces. - if (source[psz] === ' ') { return } - // Skip leading zeroes in b256. - var it4 = size - length; - while (it4 !== size && b256[it4] === 0) { - it4++; - } - var vch = new Uint8Array(zeroes + (size - it4)); - var j = zeroes; - while (it4 !== size) { - vch[j++] = b256[it4++]; + + async *encode(){ + yield this.headers; + + const {value} = this; + + if(utils.isTypedArray(value)) { + yield value; + } else { + yield* helpers_readBlob(value); } - return vch + + yield CRLF_BYTES; + } + + static escapeName(name) { + return String(name).replace(/[\r\n"]/g, (match) => ({ + '\r' : '%0D', + '\n' : '%0A', + '"' : '%22', + }[match])); } - function decode (string) { - var buffer = decodeUnsafe(string); - if (buffer) { return buffer } - throw new Error(`Non-${name} character`) +} + +const formDataToStream = (form, headersHandler, options) => { + const { + tag = 'form-data-boundary', + size = 25, + boundary = tag + '-' + utils.generateString(size, BOUNDARY_ALPHABET) + } = options || {}; + + if(!utils.isFormData(form)) { + throw TypeError('FormData instance required'); } - return { - encode: encode, - decodeUnsafe: decodeUnsafe, - decode: decode + + if (boundary.length < 1 || boundary.length > 70) { + throw Error('boundary must be 10-70 characters long') } -} -var car_node_modules_multiformats_vendor_base_x_src = car_node_modules_multiformats_vendor_base_x_base; -var car_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = car_node_modules_multiformats_vendor_base_x_src; + const boundaryBytes = formDataToStream_textEncoder.encode('--' + boundary + CRLF); + const footerBytes = formDataToStream_textEncoder.encode('--' + boundary + '--' + CRLF + CRLF); + let contentLength = footerBytes.byteLength; -/* harmony default export */ const car_node_modules_multiformats_vendor_base_x = (car_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX); + const parts = Array.from(form.entries()).map(([name, value]) => { + const part = new FormDataPart(name, value); + contentLength += part.size; + return part; + }); -;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/src/bytes.js -const car_node_modules_multiformats_src_bytes_empty = new Uint8Array(0) + contentLength += boundaryBytes.byteLength * parts.length; -/** - * @param {Uint8Array} d - */ -const car_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') + contentLength = utils.toFiniteNumber(contentLength); -/** - * @param {string} hex - */ -const car_node_modules_multiformats_src_bytes_fromHex = hex => { - const hexes = hex.match(/../g) - return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : car_node_modules_multiformats_src_bytes_empty -} + const computedHeaders = { + 'Content-Type': `multipart/form-data; boundary=${boundary}` + } -/** - * @param {Uint8Array} aa - * @param {Uint8Array} bb - */ -const car_node_modules_multiformats_src_bytes_equals = (aa, bb) => { - if (aa === bb) return true - if (aa.byteLength !== bb.byteLength) { - return false + if (Number.isFinite(contentLength)) { + computedHeaders['Content-Length'] = contentLength; } - for (let ii = 0; ii < aa.byteLength; ii++) { - if (aa[ii] !== bb[ii]) { - return false + headersHandler && headersHandler(computedHeaders); + + return external_stream_.Readable.from((async function *() { + for(const part of parts) { + yield boundaryBytes; + yield* part.encode(); } + + yield footerBytes; + })()); +}; + +/* harmony default export */ const helpers_formDataToStream = (formDataToStream); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js + + + + +class ZlibHeaderTransformStream extends external_stream_.Transform { + __transform(chunk, encoding, callback) { + this.push(chunk); + callback(); } - return true -} + _transform(chunk, encoding, callback) { + if (chunk.length !== 0) { + this._transform = this.__transform; -/** - * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o - * @returns {Uint8Array} - */ -const car_node_modules_multiformats_src_bytes_coerce = o => { - if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o - if (o instanceof ArrayBuffer) return new Uint8Array(o) - if (ArrayBuffer.isView(o)) { - return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) + // Add Default Compression headers if no zlib headers are present + if (chunk[0] !== 120) { // Hex: 78 + const header = Buffer.alloc(2); + header[0] = 120; // Hex: 78 + header[1] = 156; // Hex: 9C + this.push(header, encoding); + } + } + + this.__transform(chunk, encoding, callback); } - throw new Error('Unknown type, must be binary type') } -/** - * @param {any} o - * @returns {o is ArrayBuffer|ArrayBufferView} - */ -const car_node_modules_multiformats_src_bytes_isBinary = o => - o instanceof ArrayBuffer || ArrayBuffer.isView(o) +/* harmony default export */ const helpers_ZlibHeaderTransformStream = (ZlibHeaderTransformStream); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/callbackify.js + + +const callbackify = (fn, reducer) => { + return utils.isAsyncFn(fn) ? function (...args) { + const cb = args.pop(); + fn.apply(this, args).then((value) => { + try { + reducer ? cb(null, ...reducer(value)) : cb(null, value); + } catch (err) { + cb(err); + } + }, cb); + } : fn; +} + +/* harmony default export */ const helpers_callbackify = (callbackify); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/adapters/http.js + + + + + + + -/** - * @param {string} str - * @returns {Uint8Array} - */ -const car_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) -/** - * @param {Uint8Array} b - * @returns {string} - */ -const car_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) -;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/src/bases/base.js -// Linter can't see that API is used in types. -// eslint-disable-next-line + + + + + + + + + + + +const zlibOptions = { + flush: external_zlib_.constants.Z_SYNC_FLUSH, + finishFlush: external_zlib_.constants.Z_SYNC_FLUSH +}; + +const brotliOptions = { + flush: external_zlib_.constants.BROTLI_OPERATION_FLUSH, + finishFlush: external_zlib_.constants.BROTLI_OPERATION_FLUSH +} + +const isBrotliSupported = utils.isFunction(external_zlib_.createBrotliDecompress); + +const {http: httpFollow, https: httpsFollow} = follow_redirects; + +const isHttps = /https:?/; + +const supportedProtocols = platform.protocols.map(protocol => { + return protocol + ':'; +}); + /** - * Class represents both BaseEncoder and MultibaseEncoder meaning it - * can be used to encode to multibase or base encode without multibase - * prefix. + * If the proxy or config beforeRedirects functions are defined, call them with the options + * object. * - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseEncoder} - * @implements {API.BaseEncoder} + * @param {Object} options - The options object that was passed to the request. + * + * @returns {Object} */ -class car_node_modules_multiformats_src_bases_base_Encoder { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(bytes:Uint8Array) => string} baseEncode - */ - constructor (name, prefix, baseEncode) { - this.name = name - this.prefix = prefix - this.baseEncode = baseEncode +function dispatchBeforeRedirect(options) { + if (options.beforeRedirects.proxy) { + options.beforeRedirects.proxy(options); } - - /** - * @param {Uint8Array} bytes - * @returns {API.Multibase} - */ - encode (bytes) { - if (bytes instanceof Uint8Array) { - return `${this.prefix}${this.baseEncode(bytes)}` - } else { - throw Error('Unknown type, must be binary type') - } + if (options.beforeRedirects.config) { + options.beforeRedirects.config(options); } } /** - * @template {string} Prefix - */ -/** - * Class represents both BaseDecoder and MultibaseDecoder so it could be used - * to decode multibases (with matching prefix) or just base decode strings - * with corresponding base encoding. + * If the proxy or config afterRedirects functions are defined, call them with the options * - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseDecoder} - * @implements {API.UnibaseDecoder} - * @implements {API.BaseDecoder} + * @param {http.ClientRequestArgs} options + * @param {AxiosProxyConfig} configProxy configuration from Axios options object + * @param {string} location + * + * @returns {http.ClientRequestArgs} */ -class car_node_modules_multiformats_src_bases_base_Decoder { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(text:string) => Uint8Array} baseDecode - */ - constructor (name, prefix, baseDecode) { - this.name = name - this.prefix = prefix - /* c8 ignore next 3 */ - if (prefix.codePointAt(0) === undefined) { - throw new Error('Invalid prefix character') +function setProxy(options, configProxy, location) { + let proxy = configProxy; + if (!proxy && proxy !== false) { + const proxyUrl = (0,proxy_from_env/* getProxyForUrl */.j)(location); + if (proxyUrl) { + proxy = new URL(proxyUrl); } - /** @private */ - this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0)) - this.baseDecode = baseDecode } + if (proxy) { + // Basic proxy authorization + if (proxy.username) { + proxy.auth = (proxy.username || '') + ':' + (proxy.password || ''); + } - /** - * @param {string} text - */ - decode (text) { - if (typeof text === 'string') { - if (text.codePointAt(0) !== this.prefixCodePoint) { - throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`) + if (proxy.auth) { + // Support proxy auth object form + if (proxy.auth.username || proxy.auth.password) { + proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || ''); } - return this.baseDecode(text.slice(this.prefix.length)) - } else { - throw Error('Can only multibase decode strings') + const base64 = Buffer + .from(proxy.auth, 'utf8') + .toString('base64'); + options.headers['Proxy-Authorization'] = 'Basic ' + base64; } - } - /** - * @template {string} OtherPrefix - * @param {API.UnibaseDecoder|ComposedDecoder} decoder - * @returns {ComposedDecoder} - */ - or (decoder) { - return car_node_modules_multiformats_src_bases_base_or(this, decoder) + options.headers.host = options.hostname + (options.port ? ':' + options.port : ''); + const proxyHost = proxy.hostname || proxy.host; + options.hostname = proxyHost; + // Replace 'host' since options is not a URL object + options.host = proxyHost; + options.port = proxy.port; + options.path = location; + if (proxy.protocol) { + options.protocol = proxy.protocol.includes(':') ? proxy.protocol : `${proxy.protocol}:`; + } } + + options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) { + // Configure proxy for redirected request, passing the original config proxy to apply + // the exact same logic as if the redirected request was performed by axios directly. + setProxy(redirectOptions, configProxy, redirectOptions.href); + }; } -/** - * @template {string} Prefix - * @typedef {Record>} Decoders - */ +const isHttpAdapterSupported = typeof process !== 'undefined' && utils.kindOf(process) === 'process'; -/** - * @template {string} Prefix - * @implements {API.MultibaseDecoder} - * @implements {API.CombobaseDecoder} - */ -class car_node_modules_multiformats_src_bases_base_ComposedDecoder { - /** - * @param {Decoders} decoders - */ - constructor (decoders) { - this.decoders = decoders - } +// temporary hotfix - /** - * @template {string} OtherPrefix - * @param {API.UnibaseDecoder|ComposedDecoder} decoder - * @returns {ComposedDecoder} - */ - or (decoder) { - return car_node_modules_multiformats_src_bases_base_or(this, decoder) - } +const wrapAsync = (asyncExecutor) => { + return new Promise((resolve, reject) => { + let onDone; + let isDone; - /** - * @param {string} input - * @returns {Uint8Array} - */ - decode (input) { - const prefix = /** @type {Prefix} */ (input[0]) - const decoder = this.decoders[prefix] - if (decoder) { - return decoder.decode(input) - } else { - throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`) + const done = (value, isRejected) => { + if (isDone) return; + isDone = true; + onDone && onDone(value, isRejected); } - } -} -/** - * @template {string} L - * @template {string} R - * @param {API.UnibaseDecoder|API.CombobaseDecoder} left - * @param {API.UnibaseDecoder|API.CombobaseDecoder} right - * @returns {ComposedDecoder} - */ -const car_node_modules_multiformats_src_bases_base_or = (left, right) => new car_node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({ - ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }), - ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right }) -})) + const _resolve = (value) => { + done(value); + resolve(value); + }; -/** - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseCodec} - * @implements {API.MultibaseEncoder} - * @implements {API.MultibaseDecoder} - * @implements {API.BaseCodec} - * @implements {API.BaseEncoder} - * @implements {API.BaseDecoder} - */ -class car_node_modules_multiformats_src_bases_base_Codec { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(bytes:Uint8Array) => string} baseEncode - * @param {(text:string) => Uint8Array} baseDecode - */ - constructor (name, prefix, baseEncode, baseDecode) { - this.name = name - this.prefix = prefix - this.baseEncode = baseEncode - this.baseDecode = baseDecode - this.encoder = new car_node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode) - this.decoder = new car_node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode) - } + const _reject = (reason) => { + done(reason, true); + reject(reason); + } - /** - * @param {Uint8Array} input - */ - encode (input) { - return this.encoder.encode(input) - } + asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject); + }) +}; - /** - * @param {string} input - */ - decode (input) { - return this.decoder.decode(input) +const resolveFamily = ({address, family}) => { + if (!utils.isString(address)) { + throw TypeError('address must be a string'); } + return ({ + address, + family: family || (address.indexOf('.') < 0 ? 6 : 4) + }); } -/** - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {(bytes:Uint8Array) => string} options.encode - * @param {(input:string) => Uint8Array} options.decode - * @returns {Codec} - */ -const car_node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) => - new car_node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode) +const buildAddressEntry = (address, family) => resolveFamily(utils.isObject(address) ? address : {address, family}); -/** - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {string} options.alphabet - * @returns {Codec} - */ -const car_node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => { - const { encode, decode } = car_node_modules_multiformats_vendor_base_x(alphabet, name) - return car_node_modules_multiformats_src_bases_base_from({ - prefix, - name, - encode, - /** - * @param {string} text - */ - decode: text => car_node_modules_multiformats_src_bytes_coerce(decode(text)) - }) -} +/*eslint consistent-return:0*/ +/* harmony default export */ const adapters_http = (isHttpAdapterSupported && function httpAdapter(config) { + return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) { + let {data, lookup, family} = config; + const {responseType, responseEncoding} = config; + const method = config.method.toUpperCase(); + let isDone; + let rejected = false; + let req; -/** - * @param {string} string - * @param {string} alphabet - * @param {number} bitsPerChar - * @param {string} name - * @returns {Uint8Array} - */ -const car_node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { - // Build the character lookup table: - /** @type {Record} */ - const codes = {} - for (let i = 0; i < alphabet.length; ++i) { - codes[alphabet[i]] = i - } + if (lookup) { + const _lookup = helpers_callbackify(lookup, (value) => utils.isArray(value) ? value : [value]); + // hotfix to support opt.all option which is required for node 20.x + lookup = (hostname, opt, cb) => { + _lookup(hostname, opt, (err, arg0, arg1) => { + const addresses = utils.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)]; - // Count the padding bytes: - let end = string.length - while (string[end - 1] === '=') { - --end - } + opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family); + }); + } + } - // Allocate the output: - const out = new Uint8Array((end * bitsPerChar / 8) | 0) + // temporary internal emitter until the AxiosRequest class will be implemented + const emitter = new external_events_(); - // Parse the data: - let bits = 0 // Number of bits currently in the buffer - let buffer = 0 // Bits waiting to be written out, MSB first - let written = 0 // Next byte to write - for (let i = 0; i < end; ++i) { - // Read one character from the string: - const value = codes[string[i]] - if (value === undefined) { - throw new SyntaxError(`Non-${name} character`) + const onFinished = () => { + if (config.cancelToken) { + config.cancelToken.unsubscribe(abort); + } + + if (config.signal) { + config.signal.removeEventListener('abort', abort); + } + + emitter.removeAllListeners(); } - // Append the bits to the buffer: - buffer = (buffer << bitsPerChar) | value - bits += bitsPerChar + onDone((value, isRejected) => { + isDone = true; + if (isRejected) { + rejected = true; + onFinished(); + } + }); - // Write out some bits if the buffer has a byte's worth: - if (bits >= 8) { - bits -= 8 - out[written++] = 0xff & (buffer >> bits) + function abort(reason) { + emitter.emit('abort', !reason || reason.type ? new cancel_CanceledError(null, config, req) : reason); } - } - // Verify that we have received just enough bits: - if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) { - throw new SyntaxError('Unexpected end of data') - } + emitter.once('abort', reject); - return out -} + if (config.cancelToken || config.signal) { + config.cancelToken && config.cancelToken.subscribe(abort); + if (config.signal) { + config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort); + } + } -/** - * @param {Uint8Array} data - * @param {string} alphabet - * @param {number} bitsPerChar - * @returns {string} - */ -const car_node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => { - const pad = alphabet[alphabet.length - 1] === '=' - const mask = (1 << bitsPerChar) - 1 - let out = '' + // Parse url + const fullPath = buildFullPath(config.baseURL, config.url); + const parsed = new URL(fullPath, 'http://localhost'); + const protocol = parsed.protocol || supportedProtocols[0]; - let bits = 0 // Number of bits currently in the buffer - let buffer = 0 // Bits waiting to be written out, MSB first - for (let i = 0; i < data.length; ++i) { - // Slurp data into the buffer: - buffer = (buffer << 8) | data[i] - bits += 8 + if (protocol === 'data:') { + let convertedData; - // Write out as much as we can: - while (bits > bitsPerChar) { - bits -= bitsPerChar - out += alphabet[mask & (buffer >> bits)] + if (method !== 'GET') { + return settle(resolve, reject, { + status: 405, + statusText: 'method not allowed', + headers: {}, + config + }); + } + + try { + convertedData = fromDataURI(config.url, responseType === 'blob', { + Blob: config.env && config.env.Blob + }); + } catch (err) { + throw core_AxiosError.from(err, core_AxiosError.ERR_BAD_REQUEST, config); + } + + if (responseType === 'text') { + convertedData = convertedData.toString(responseEncoding); + + if (!responseEncoding || responseEncoding === 'utf8') { + convertedData = utils.stripBOM(convertedData); + } + } else if (responseType === 'stream') { + convertedData = external_stream_.Readable.from(convertedData); + } + + return settle(resolve, reject, { + data: convertedData, + status: 200, + statusText: 'OK', + headers: new core_AxiosHeaders(), + config + }); } - } - // Partial character: - if (bits) { - out += alphabet[mask & (buffer << (bitsPerChar - bits))] - } + if (supportedProtocols.indexOf(protocol) === -1) { + return reject(new core_AxiosError( + 'Unsupported protocol ' + protocol, + core_AxiosError.ERR_BAD_REQUEST, + config + )); + } - // Add padding characters until we hit a byte boundary: - if (pad) { - while ((out.length * bitsPerChar) & 7) { - out += '=' + const headers = core_AxiosHeaders.from(config.headers).normalize(); + + // Set User-Agent (required by some servers) + // See https://github.com/axios/axios/issues/69 + // User-Agent is specified; handle case where no UA header is desired + // Only set header if it hasn't been set in config + headers.set('User-Agent', 'axios/' + VERSION, false); + + const onDownloadProgress = config.onDownloadProgress; + const onUploadProgress = config.onUploadProgress; + const maxRate = config.maxRate; + let maxUploadRate = undefined; + let maxDownloadRate = undefined; + + // support for spec compliant FormData objects + if (utils.isSpecCompliantForm(data)) { + const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i); + + data = helpers_formDataToStream(data, (formHeaders) => { + headers.set(formHeaders); + }, { + tag: `axios-${VERSION}-boundary`, + boundary: userBoundary && userBoundary[1] || undefined + }); + // support for https://www.npmjs.com/package/form-data api + } else if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) { + headers.set(data.getHeaders()); + + if (!headers.hasContentLength()) { + try { + const knownLength = await external_util_.promisify(data.getLength).call(data); + Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength); + /*eslint no-empty:0*/ + } catch (e) { + } + } + } else if (utils.isBlob(data)) { + data.size && headers.setContentType(data.type || 'application/octet-stream'); + headers.setContentLength(data.size || 0); + data = external_stream_.Readable.from(helpers_readBlob(data)); + } else if (data && !utils.isStream(data)) { + if (Buffer.isBuffer(data)) { + // Nothing to do... + } else if (utils.isArrayBuffer(data)) { + data = Buffer.from(new Uint8Array(data)); + } else if (utils.isString(data)) { + data = Buffer.from(data, 'utf-8'); + } else { + return reject(new core_AxiosError( + 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', + core_AxiosError.ERR_BAD_REQUEST, + config + )); + } + + // Add Content-Length header if data exists + headers.setContentLength(data.length, false); + + if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { + return reject(new core_AxiosError( + 'Request body larger than maxBodyLength limit', + core_AxiosError.ERR_BAD_REQUEST, + config + )); + } } - } - return out -} + const contentLength = utils.toFiniteNumber(headers.getContentLength()); -/** - * RFC4648 Factory - * - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {string} options.alphabet - * @param {number} options.bitsPerChar - */ -const car_node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { - return car_node_modules_multiformats_src_bases_base_from({ - prefix, - name, - encode (input) { - return car_node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar) - }, - decode (input) { - return car_node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name) + if (utils.isArray(maxRate)) { + maxUploadRate = maxRate[0]; + maxDownloadRate = maxRate[1]; + } else { + maxUploadRate = maxDownloadRate = maxRate; } - }) -} -;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/src/bases/base64.js -// @ts-check + if (data && (onUploadProgress || maxUploadRate)) { + if (!utils.isStream(data)) { + data = external_stream_.Readable.from(data, {objectMode: false}); + } + data = external_stream_.pipeline([data, new helpers_AxiosTransformStream({ + length: contentLength, + maxRate: utils.toFiniteNumber(maxUploadRate) + })], utils.noop); + onUploadProgress && data.on('progress', progress => { + onUploadProgress(Object.assign(progress, { + upload: true + })); + }); + } -const car_node_modules_multiformats_src_bases_base64_base64 = car_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'm', - name: 'base64', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', - bitsPerChar: 6 -}) + // HTTP basic authentication + let auth = undefined; + if (config.auth) { + const username = config.auth.username || ''; + const password = config.auth.password || ''; + auth = username + ':' + password; + } -const car_node_modules_multiformats_src_bases_base64_base64pad = car_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'M', - name: 'base64pad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', - bitsPerChar: 6 -}) + if (!auth && parsed.username) { + const urlUsername = parsed.username; + const urlPassword = parsed.password; + auth = urlUsername + ':' + urlPassword; + } -const car_node_modules_multiformats_src_bases_base64_base64url = car_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'u', - name: 'base64url', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', - bitsPerChar: 6 -}) + auth && headers.delete('authorization'); + + let path; + + try { + path = buildURL( + parsed.pathname + parsed.search, + config.params, + config.paramsSerializer + ).replace(/^\?/, ''); + } catch (err) { + const customErr = new Error(err.message); + customErr.config = config; + customErr.url = config.url; + customErr.exists = true; + return reject(customErr); + } + + headers.set( + 'Accept-Encoding', + 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false + ); + + const options = { + path, + method: method, + headers: headers.toJSON(), + agents: { http: config.httpAgent, https: config.httpsAgent }, + auth, + protocol, + family, + beforeRedirect: dispatchBeforeRedirect, + beforeRedirects: {} + }; + + // cacheable-lookup integration hotfix + !utils.isUndefined(lookup) && (options.lookup = lookup); + + if (config.socketPath) { + options.socketPath = config.socketPath; + } else { + options.hostname = parsed.hostname; + options.port = parsed.port; + setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); + } + + let transport; + const isHttpsRequest = isHttps.test(options.protocol); + options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; + if (config.transport) { + transport = config.transport; + } else if (config.maxRedirects === 0) { + transport = isHttpsRequest ? external_https_ : external_http_; + } else { + if (config.maxRedirects) { + options.maxRedirects = config.maxRedirects; + } + if (config.beforeRedirect) { + options.beforeRedirects.config = config.beforeRedirect; + } + transport = isHttpsRequest ? httpsFollow : httpFollow; + } + + if (config.maxBodyLength > -1) { + options.maxBodyLength = config.maxBodyLength; + } else { + // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited + options.maxBodyLength = Infinity; + } + + if (config.insecureHTTPParser) { + options.insecureHTTPParser = config.insecureHTTPParser; + } + + // Create the request + req = transport.request(options, function handleResponse(res) { + if (req.destroyed) return; + + const streams = [res]; + + const responseLength = +res.headers['content-length']; + + if (onDownloadProgress) { + const transformStream = new helpers_AxiosTransformStream({ + length: utils.toFiniteNumber(responseLength), + maxRate: utils.toFiniteNumber(maxDownloadRate) + }); + + onDownloadProgress && transformStream.on('progress', progress => { + onDownloadProgress(Object.assign(progress, { + download: true + })); + }); + + streams.push(transformStream); + } + + // decompress the response body transparently if required + let responseStream = res; + + // return the last request in case of redirects + const lastRequest = res.req || req; + + // if decompress disabled we should not decompress + if (config.decompress !== false && res.headers['content-encoding']) { + // if no content, but headers still say that it is encoded, + // remove the header not confuse downstream operations + if (method === 'HEAD' || res.statusCode === 204) { + delete res.headers['content-encoding']; + } + + switch ((res.headers['content-encoding'] || '').toLowerCase()) { + /*eslint default-case:0*/ + case 'gzip': + case 'x-gzip': + case 'compress': + case 'x-compress': + // add the unzipper to the body stream processing pipeline + streams.push(external_zlib_.createUnzip(zlibOptions)); + + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + case 'deflate': + streams.push(new helpers_ZlibHeaderTransformStream()); + + // add the unzipper to the body stream processing pipeline + streams.push(external_zlib_.createUnzip(zlibOptions)); + + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + case 'br': + if (isBrotliSupported) { + streams.push(external_zlib_.createBrotliDecompress(brotliOptions)); + delete res.headers['content-encoding']; + } + } + } + + responseStream = streams.length > 1 ? external_stream_.pipeline(streams, utils.noop) : streams[0]; + + const offListeners = external_stream_.finished(responseStream, () => { + offListeners(); + onFinished(); + }); + + const response = { + status: res.statusCode, + statusText: res.statusMessage, + headers: new core_AxiosHeaders(res.headers), + config, + request: lastRequest + }; + + if (responseType === 'stream') { + response.data = responseStream; + settle(resolve, reject, response); + } else { + const responseBuffer = []; + let totalResponseBytes = 0; + + responseStream.on('data', function handleStreamData(chunk) { + responseBuffer.push(chunk); + totalResponseBytes += chunk.length; + + // make sure the content length is not over the maxContentLength if specified + if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { + // stream.destroy() emit aborted event before calling reject() on Node.js v16 + rejected = true; + responseStream.destroy(); + reject(new core_AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', + core_AxiosError.ERR_BAD_RESPONSE, config, lastRequest)); + } + }); + + responseStream.on('aborted', function handlerStreamAborted() { + if (rejected) { + return; + } + + const err = new core_AxiosError( + 'maxContentLength size of ' + config.maxContentLength + ' exceeded', + core_AxiosError.ERR_BAD_RESPONSE, + config, + lastRequest + ); + responseStream.destroy(err); + reject(err); + }); + + responseStream.on('error', function handleStreamError(err) { + if (req.destroyed) return; + reject(core_AxiosError.from(err, null, config, lastRequest)); + }); + + responseStream.on('end', function handleStreamEnd() { + try { + let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); + if (responseType !== 'arraybuffer') { + responseData = responseData.toString(responseEncoding); + if (!responseEncoding || responseEncoding === 'utf8') { + responseData = utils.stripBOM(responseData); + } + } + response.data = responseData; + } catch (err) { + return reject(core_AxiosError.from(err, null, config, response.request, response)); + } + settle(resolve, reject, response); + }); + } + + emitter.once('abort', err => { + if (!responseStream.destroyed) { + responseStream.emit('error', err); + responseStream.destroy(); + } + }); + }); + + emitter.once('abort', err => { + reject(err); + req.destroy(err); + }); + + // Handle errors + req.on('error', function handleRequestError(err) { + // @todo remove + // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return; + reject(core_AxiosError.from(err, null, config, req)); + }); + + // set tcp keep alive to prevent drop connection by peer + req.on('socket', function handleRequestSocket(socket) { + // default interval of sending ack packet is 1 minute + socket.setKeepAlive(true, 1000 * 60); + }); + + // Handle request timeout + if (config.timeout) { + // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. + const timeout = parseInt(config.timeout, 10); + + if (Number.isNaN(timeout)) { + reject(new core_AxiosError( + 'error trying to parse `config.timeout` to int', + core_AxiosError.ERR_BAD_OPTION_VALUE, + config, + req + )); + + return; + } -const car_node_modules_multiformats_src_bases_base64_base64urlpad = car_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'U', - name: 'base64urlpad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', - bitsPerChar: 6 -}) + // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. + // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. + // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. + // And then these socket which be hang up will devouring CPU little by little. + // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. + req.setTimeout(timeout, function handleRequestTimeout() { + if (isDone) return; + let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = config.transitional || defaults_transitional; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(new core_AxiosError( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? core_AxiosError.ETIMEDOUT : core_AxiosError.ECONNABORTED, + config, + req + )); + abort(); + }); + } -;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/src/bases/base32.js + // Send the request + if (utils.isStream(data)) { + let ended = false; + let errored = false; -const car_node_modules_multiformats_src_bases_base32_base32 = car_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'b', - name: 'base32', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567', - bitsPerChar: 5 -}) + data.on('end', () => { + ended = true; + }); -const car_node_modules_multiformats_src_bases_base32_base32upper = car_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'B', - name: 'base32upper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', - bitsPerChar: 5 -}) + data.once('error', err => { + errored = true; + req.destroy(err); + }); -const car_node_modules_multiformats_src_bases_base32_base32pad = car_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'c', - name: 'base32pad', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', - bitsPerChar: 5 -}) + data.on('close', () => { + if (!ended && !errored) { + abort(new cancel_CanceledError('Request stream has been aborted', config, req)); + } + }); -const car_node_modules_multiformats_src_bases_base32_base32padupper = car_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'C', - name: 'base32padupper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', - bitsPerChar: 5 -}) + data.pipe(req); + } else { + req.end(data); + } + }); +}); -const car_node_modules_multiformats_src_bases_base32_base32hex = car_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'v', - name: 'base32hex', - alphabet: '0123456789abcdefghijklmnopqrstuv', - bitsPerChar: 5 -}) +const __setProxy = (/* unused pure expression or super */ null && (setProxy)); -const car_node_modules_multiformats_src_bases_base32_base32hexupper = car_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'V', - name: 'base32hexupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', - bitsPerChar: 5 -}) +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/cookies.js -const car_node_modules_multiformats_src_bases_base32_base32hexpad = car_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 't', - name: 'base32hexpad', - alphabet: '0123456789abcdefghijklmnopqrstuv=', - bitsPerChar: 5 -}) -const car_node_modules_multiformats_src_bases_base32_base32hexpadupper = car_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'T', - name: 'base32hexpadupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', - bitsPerChar: 5 -}) -const car_node_modules_multiformats_src_bases_base32_base32z = car_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'h', - name: 'base32z', - alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', - bitsPerChar: 5 -}) +/* harmony default export */ const cookies = (platform.hasStandardBrowserEnv ? -;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/src/bases/base58.js + // Standard browser envs support document.cookie + { + write(name, value, expires, path, domain, secure) { + const cookie = [name + '=' + encodeURIComponent(value)]; + utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString()); -const car_node_modules_multiformats_src_bases_base58_base58btc = car_node_modules_multiformats_src_bases_base_baseX({ - name: 'base58btc', - prefix: 'z', - alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -}) + utils.isString(path) && cookie.push('path=' + path); -const car_node_modules_multiformats_src_bases_base58_base58flickr = car_node_modules_multiformats_src_bases_base_baseX({ - name: 'base58flickr', - prefix: 'Z', - alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -}) + utils.isString(domain) && cookie.push('domain=' + domain); -;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/vendor/varint.js -var car_node_modules_multiformats_vendor_varint_encode_1 = car_node_modules_multiformats_vendor_varint_encode; + secure === true && cookie.push('secure'); -var car_node_modules_multiformats_vendor_varint_MSB = 0x80 - , car_node_modules_multiformats_vendor_varint_REST = 0x7F - , car_node_modules_multiformats_vendor_varint_MSBALL = ~car_node_modules_multiformats_vendor_varint_REST - , car_node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31); + document.cookie = cookie.join('; '); + }, -function car_node_modules_multiformats_vendor_varint_encode(num, out, offset) { - out = out || []; - offset = offset || 0; - var oldOffset = offset; + read(name) { + const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, - while(num >= car_node_modules_multiformats_vendor_varint_INT) { - out[offset++] = (num & 0xFF) | car_node_modules_multiformats_vendor_varint_MSB; - num /= 128; - } - while(num & car_node_modules_multiformats_vendor_varint_MSBALL) { - out[offset++] = (num & 0xFF) | car_node_modules_multiformats_vendor_varint_MSB; - num >>>= 7; + remove(name) { + this.write(name, '', Date.now() - 86400000); + } } - out[offset] = num | 0; - - car_node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; - - return out -} -var car_node_modules_multiformats_vendor_varint_decode = car_node_modules_multiformats_vendor_varint_read; + : -var car_node_modules_multiformats_vendor_varint_MSB$1 = 0x80 - , car_node_modules_multiformats_vendor_varint_REST$1 = 0x7F; + // Non-standard browser env (web workers, react-native) lack needed support. + { + write() {}, + read() { + return null; + }, + remove() {} + }); -function car_node_modules_multiformats_vendor_varint_read(buf, offset) { - var res = 0 - , offset = offset || 0 - , shift = 0 - , counter = offset - , b - , l = buf.length; - do { - if (counter >= l) { - car_node_modules_multiformats_vendor_varint_read.bytes = 0; - throw new RangeError('Could not decode varint') - } - b = buf[counter++]; - res += shift < 28 - ? (b & car_node_modules_multiformats_vendor_varint_REST$1) << shift - : (b & car_node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift); - shift += 7; - } while (b >= car_node_modules_multiformats_vendor_varint_MSB$1) +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/isURLSameOrigin.js - car_node_modules_multiformats_vendor_varint_read.bytes = counter - offset; - return res -} -var car_node_modules_multiformats_vendor_varint_N1 = Math.pow(2, 7); -var car_node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14); -var car_node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21); -var car_node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28); -var car_node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35); -var car_node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42); -var car_node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49); -var car_node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56); -var car_node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63); -var car_node_modules_multiformats_vendor_varint_length = function (value) { - return ( - value < car_node_modules_multiformats_vendor_varint_N1 ? 1 - : value < car_node_modules_multiformats_vendor_varint_N2 ? 2 - : value < car_node_modules_multiformats_vendor_varint_N3 ? 3 - : value < car_node_modules_multiformats_vendor_varint_N4 ? 4 - : value < car_node_modules_multiformats_vendor_varint_N5 ? 5 - : value < car_node_modules_multiformats_vendor_varint_N6 ? 6 - : value < car_node_modules_multiformats_vendor_varint_N7 ? 7 - : value < car_node_modules_multiformats_vendor_varint_N8 ? 8 - : value < car_node_modules_multiformats_vendor_varint_N9 ? 9 - : 10 - ) -}; -var car_node_modules_multiformats_vendor_varint_varint = { - encode: car_node_modules_multiformats_vendor_varint_encode_1 - , decode: car_node_modules_multiformats_vendor_varint_decode - , encodingLength: car_node_modules_multiformats_vendor_varint_length -}; +/* harmony default export */ const isURLSameOrigin = (platform.hasStandardBrowserEnv ? -var car_node_modules_multiformats_vendor_varint_brrp_varint = car_node_modules_multiformats_vendor_varint_varint; +// Standard browser envs have full support of the APIs needed to test +// whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + const msie = /(msie|trident)/i.test(navigator.userAgent); + const urlParsingNode = document.createElement('a'); + let originURL; -/* harmony default export */ const car_node_modules_multiformats_vendor_varint = (car_node_modules_multiformats_vendor_varint_brrp_varint); + /** + * Parse a URL to discover its components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + let href = url; -;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/src/varint.js + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + urlParsingNode.setAttribute('href', href); -/** - * @param {Uint8Array} data - * @param {number} [offset=0] - * @returns {[number, number]} - */ -const car_node_modules_multiformats_src_varint_decode = (data, offset = 0) => { - const code = car_node_modules_multiformats_vendor_varint.decode(data, offset) - return [code, car_node_modules_multiformats_vendor_varint.decode.bytes] -} + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } -/** - * @param {number} int - * @param {Uint8Array} target - * @param {number} [offset=0] - */ -const car_node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => { - car_node_modules_multiformats_vendor_varint.encode(int, target, offset) - return target -} + originURL = resolveURL(window.location.href); -/** - * @param {number} int - * @returns {number} - */ -const car_node_modules_multiformats_src_varint_encodingLength = (int) => { - return car_node_modules_multiformats_vendor_varint.encodingLength(int) -} + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : -;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/src/hashes/digest.js + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })()); +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/adapters/xhr.js -/** - * Creates a multihash digest. - * - * @template {number} Code - * @param {Code} code - * @param {Uint8Array} digest - */ -const car_node_modules_multiformats_src_hashes_digest_create = (code, digest) => { - const size = digest.byteLength - const sizeOffset = car_node_modules_multiformats_src_varint_encodingLength(code) - const digestOffset = sizeOffset + car_node_modules_multiformats_src_varint_encodingLength(size) - const bytes = new Uint8Array(digestOffset + size) - car_node_modules_multiformats_src_varint_encodeTo(code, bytes, 0) - car_node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset) - bytes.set(digest, digestOffset) - return new car_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) -} -/** - * Turns bytes representation of multihash digest into an instance. - * - * @param {Uint8Array} multihash - * @returns {MultihashDigest} - */ -const car_node_modules_multiformats_src_hashes_digest_decode = (multihash) => { - const bytes = car_node_modules_multiformats_src_bytes_coerce(multihash) - const [code, sizeOffset] = car_node_modules_multiformats_src_varint_decode(bytes) - const [size, digestOffset] = car_node_modules_multiformats_src_varint_decode(bytes.subarray(sizeOffset)) - const digest = bytes.subarray(sizeOffset + digestOffset) - if (digest.byteLength !== size) { - throw new Error('Incorrect length') - } - return new car_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) -} -/** - * @param {MultihashDigest} a - * @param {unknown} b - * @returns {b is MultihashDigest} - */ -const car_node_modules_multiformats_src_hashes_digest_equals = (a, b) => { - if (a === b) { - return true - } else { - const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) - return ( - a.code === data.code && - a.size === data.size && - data.bytes instanceof Uint8Array && - car_node_modules_multiformats_src_bytes_equals(a.bytes, data.bytes) - ) - } -} -/** - * @typedef {import('./interface.js').MultihashDigest} MultihashDigest - */ -/** - * Represents a multihash digest which carries information about the - * hashing algorithm and an actual hash digest. - * - * @template {number} Code - * @template {number} Size - * @class - * @implements {MultihashDigest} - */ -class car_node_modules_multiformats_src_hashes_digest_Digest { - /** - * Creates a multihash digest. - * - * @param {Code} code - * @param {Size} size - * @param {Uint8Array} digest - * @param {Uint8Array} bytes - */ - constructor (code, size, digest, bytes) { - this.code = code - this.size = size - this.digest = digest - this.bytes = bytes - } -} -;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/src/cid.js -// Linter can see that API is used in types. -// eslint-disable-next-line +function progressEventReducer(listener, isDownloadStream) { + let bytesNotified = 0; + const _speedometer = helpers_speedometer(50, 250); + return e => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : undefined; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + bytesNotified = loaded; -// This way TS will also expose all the types from module + const data = { + loaded, + total, + progress: total ? (loaded / total) : undefined, + bytes: progressBytes, + rate: rate ? rate : undefined, + estimated: rate && total && inRange ? (total - loaded) / rate : undefined, + event: e + }; + data[isDownloadStream ? 'download' : 'upload'] = true; -/** - * @template {API.Link} T - * @template {string} Prefix - * @param {T} link - * @param {API.MultibaseEncoder} [base] - * @returns {API.ToString} - */ -const car_node_modules_multiformats_src_cid_format = (link, base) => { - const { bytes, version } = link - switch (version) { - case 0: - return car_node_modules_multiformats_src_cid_toStringV0( - bytes, - car_node_modules_multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder<"z">} */ (base) || car_node_modules_multiformats_src_bases_base58_base58btc.encoder - ) - default: - return car_node_modules_multiformats_src_cid_toStringV1( - bytes, - car_node_modules_multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder} */ (base || car_node_modules_multiformats_src_bases_base32_base32.encoder) - ) - } + listener(data); + }; } -/** - * @template {API.UnknownLink} Link - * @param {Link} link - * @returns {API.LinkJSON} - */ -const car_node_modules_multiformats_src_cid_toJSON = (link) => ({ - '/': car_node_modules_multiformats_src_cid_format(link) -}) +const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; -/** - * @template {API.UnknownLink} Link - * @param {API.LinkJSON} json - */ -const car_node_modules_multiformats_src_cid_fromJSON = (json) => - car_node_modules_multiformats_src_cid_CID.parse(json['/']) +/* harmony default export */ const xhr = (isXHRAdapterSupported && function (config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + let requestData = config.data; + const requestHeaders = core_AxiosHeaders.from(config.headers).normalize(); + let {responseType, withXSRFToken} = config; + let onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } -/** @type {WeakMap>} */ -const car_node_modules_multiformats_src_cid_cache = new WeakMap() + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } + } -/** - * @param {API.UnknownLink} cid - * @returns {Map} - */ -const car_node_modules_multiformats_src_cid_baseCache = cid => { - const baseCache = car_node_modules_multiformats_src_cid_cache.get(cid) - if (baseCache == null) { - const baseCache = new Map() - car_node_modules_multiformats_src_cid_cache.set(cid, baseCache) - return baseCache - } - return baseCache -} + let contentType; -/** - * @template {unknown} [Data=unknown] - * @template {number} [Format=number] - * @template {number} [Alg=number] - * @template {API.Version} [Version=API.Version] - * @implements {API.Link} - */ + if (utils.isFormData(requestData)) { + if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { + requestHeaders.setContentType(false); // Let the browser set it + } else if ((contentType = requestHeaders.getContentType()) !== false) { + // fix semicolon duplication issue for ReactNative FormData implementation + const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : []; + requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; ')); + } + } -class car_node_modules_multiformats_src_cid_CID { - /** - * @param {Version} version - Version of the CID - * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content. - * @param {Uint8Array} bytes - */ - constructor (version, code, multihash, bytes) { - /** @readonly */ - this.code = code - /** @readonly */ - this.version = version - /** @readonly */ - this.multihash = multihash - /** @readonly */ - this.bytes = bytes + let request = new XMLHttpRequest(); - // flag to serializers that this is a CID and - // should be treated specially - /** @readonly */ - this['/'] = bytes - } + // HTTP basic authentication + if (config.auth) { + const username = config.auth.username || ''; + const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password)); + } - /** - * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` - * please either use `CID.asCID(cid)` or switch to new signalling mechanism - * - * @deprecated - */ - get asCID () { - return this - } + const fullPath = buildFullPath(config.baseURL, config.url); - // ArrayBufferView - get byteOffset () { - return this.bytes.byteOffset - } + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); - // ArrayBufferView - get byteLength () { - return this.bytes.byteLength - } + // Set the request timeout in MS + request.timeout = config.timeout; - /** - * @returns {CID} - */ - toV0 () { - switch (this.version) { - case 0: { - return /** @type {CID} */ (this) + function onloadend() { + if (!request) { + return; } - case 1: { - const { code, multihash } = this + // Prepare the response + const responseHeaders = core_AxiosHeaders.from( + 'getAllResponseHeaders' in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; - if (code !== car_node_modules_multiformats_src_cid_DAG_PB_CODE) { - throw new Error('Cannot convert a non dag-pb CID to CIDv0') - } + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); - // sha2-256 - if (multihash.code !== car_node_modules_multiformats_src_cid_SHA_256_CODE) { - throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; } - return /** @type {CID} */ ( - car_node_modules_multiformats_src_cid_CID.createV0( - /** @type {API.MultihashDigest} */ (multihash) - ) - ) - } - default: { - throw Error( - `Can not convert CID version ${this.version} to version 0. This is a bug please report` - ) - } + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; } - } - /** - * @returns {CID} - */ - toV1 () { - switch (this.version) { - case 0: { - const { code, digest } = this.multihash - const multihash = car_node_modules_multiformats_src_hashes_digest_create(code, digest) - return /** @type {CID} */ ( - car_node_modules_multiformats_src_cid_CID.createV1(this.code, multihash) - ) - } - case 1: { - return /** @type {CID} */ (this) - } - default: { - throw Error( - `Can not convert CID version ${this.version} to version 1. This is a bug please report` - ) + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; } - } - } - /** - * @param {unknown} other - * @returns {other is CID} - */ - equals (other) { - return car_node_modules_multiformats_src_cid_CID.equals(this, other) - } + reject(new core_AxiosError('Request aborted', core_AxiosError.ECONNABORTED, config, request)); - /** - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @param {API.Link} self - * @param {unknown} other - * @returns {other is CID} - */ - static equals (self, other) { - const unknown = - /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ ( - other - ) - return ( - unknown && - self.code === unknown.code && - self.version === unknown.version && - car_node_modules_multiformats_src_hashes_digest_equals(self.multihash, unknown.multihash) - ) - } + // Clean up request + request = null; + }; - /** - * @param {API.MultibaseEncoder} [base] - * @returns {string} - */ - toString (base) { - return car_node_modules_multiformats_src_cid_format(this, base) - } + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(new core_AxiosError('Network Error', core_AxiosError.ERR_NETWORK, config, request)); - /** - * @returns {API.LinkJSON} - */ - toJSON () { - return { '/': car_node_modules_multiformats_src_cid_format(this) } - } + // Clean up request + request = null; + }; - link () { - return this - } + // Handle timeout + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = config.transitional || defaults_transitional; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(new core_AxiosError( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? core_AxiosError.ETIMEDOUT : core_AxiosError.ECONNABORTED, + config, + request)); - get [Symbol.toStringTag] () { - return 'CID' - } + // Clean up request + request = null; + }; - // Legacy + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if(platform.hasStandardBrowserEnv) { + withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config)); - [Symbol.for('nodejs.util.inspect.custom')] () { - return `CID(${this.toString()})` - } + if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) { + // Add xsrf header + const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName); - /** - * Takes any input `value` and returns a `CID` instance if it was - * a `CID` otherwise returns `null`. If `value` is instanceof `CID` - * it will return value back. If `value` is not instance of this CID - * class, but is compatible CID it will return new instance of this - * `CID` class. Otherwise returns null. - * - * This allows two different incompatible versions of CID library to - * co-exist and interop as long as binary interface is compatible. - * - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @template {unknown} U - * @param {API.Link|U} input - * @returns {CID|null} - */ - static asCID (input) { - if (input == null) { - return null + if (xsrfValue) { + requestHeaders.set(config.xsrfHeaderName, xsrfValue); + } + } } - const value = /** @type {any} */ (input) - if (value instanceof car_node_modules_multiformats_src_cid_CID) { - // If value is instance of CID then we're all set. - return value - } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { - // If value isn't instance of this CID class but `this.asCID === this` or - // `value['/'] === value.bytes` is true it is CID instance coming from a - // different implementation (diff version or duplicate). In that case we - // rebase it to this `CID` implementation so caller is guaranteed to get - // instance with expected API. - const { version, code, multihash, bytes } = value - return new car_node_modules_multiformats_src_cid_CID( - version, - code, - /** @type {API.MultihashDigest} */ (multihash), - bytes || car_node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes) - ) - } else if (value[car_node_modules_multiformats_src_cid_cidSymbol] === true) { - // If value is a CID from older implementation that used to be tagged via - // symbol we still rebase it to the this `CID` implementation by - // delegating that to a constructor. - const { version, multihash, code } = value - const digest = - /** @type {API.MultihashDigest} */ - (car_node_modules_multiformats_src_hashes_digest_decode(multihash)) - return car_node_modules_multiformats_src_cid_CID.create(version, code, digest) - } else { - // Otherwise value is not a CID (or an incompatible version of it) in - // which case we return `null`. - return null + // Remove Content-Type if data is undefined + requestData === undefined && requestHeaders.setContentType(null); + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); } - } - /** - * - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @param {Version} version - Version of the CID - * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param {API.MultihashDigest} digest - (Multi)hash of the of the content. - * @returns {CID} - */ - static create (version, code, digest) { - if (typeof code !== 'number') { - throw new Error('String codecs are no longer supported') + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; } - if (!(digest.bytes instanceof Uint8Array)) { - throw new Error('Invalid digest') + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; } - switch (version) { - case 0: { - if (code !== car_node_modules_multiformats_src_cid_DAG_PB_CODE) { - throw new Error( - `Version 0 CID must use dag-pb (code: ${car_node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding` - ) - } else { - return new car_node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes) + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true)); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress)); + } + + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = cancel => { + if (!request) { + return; } - } - case 1: { - const bytes = car_node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes) - return new car_node_modules_multiformats_src_cid_CID(version, code, digest, bytes) - } - default: { - throw new Error('Invalid version') + reject(!cancel || cancel.type ? new cancel_CanceledError(null, config, request) : cancel); + request.abort(); + request = null; + }; + + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); } } - } - - /** - * Simplified version of `create` for CIDv0. - * - * @template {unknown} [T=unknown] - * @param {API.MultihashDigest} digest - Multihash. - * @returns {CID} - */ - static createV0 (digest) { - return car_node_modules_multiformats_src_cid_CID.create(0, car_node_modules_multiformats_src_cid_DAG_PB_CODE, digest) - } - /** - * Simplified version of `create` for CIDv1. - * - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @param {Code} code - Content encoding format code. - * @param {API.MultihashDigest} digest - Miltihash of the content. - * @returns {CID} - */ - static createV1 (code, digest) { - return car_node_modules_multiformats_src_cid_CID.create(1, code, digest) - } + const protocol = parseProtocol(fullPath); - /** - * Decoded a CID from its binary representation. The byte array must contain - * only the CID with no additional bytes. - * - * An error will be thrown if the bytes provided do not contain a valid - * binary representation of a CID. - * - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ByteView>} bytes - * @returns {CID} - */ - static decode (bytes) { - const [cid, remainder] = car_node_modules_multiformats_src_cid_CID.decodeFirst(bytes) - if (remainder.length) { - throw new Error('Incorrect length') + if (protocol && platform.protocols.indexOf(protocol) === -1) { + reject(new core_AxiosError('Unsupported protocol ' + protocol + ':', core_AxiosError.ERR_BAD_REQUEST, config)); + return; } - return cid - } - /** - * Decoded a CID from its binary representation at the beginning of a byte - * array. - * - * Returns an array with the first element containing the CID and the second - * element containing the remainder of the original byte array. The remainder - * will be a zero-length byte array if the provided bytes only contained a - * binary CID representation. - * - * @template {unknown} T - * @template {number} C - * @template {number} A - * @template {API.Version} V - * @param {API.ByteView>} bytes - * @returns {[CID, Uint8Array]} - */ - static decodeFirst (bytes) { - const specs = car_node_modules_multiformats_src_cid_CID.inspectBytes(bytes) - const prefixSize = specs.size - specs.multihashSize - const multihashBytes = car_node_modules_multiformats_src_bytes_coerce( - bytes.subarray(prefixSize, prefixSize + specs.multihashSize) - ) - if (multihashBytes.byteLength !== specs.multihashSize) { - throw new Error('Incorrect length') + + // Send the request + request.send(requestData || null); + }); +}); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/adapters/adapters.js + + + + + +const knownAdapters = { + http: adapters_http, + xhr: xhr +} + +utils.forEach(knownAdapters, (fn, value) => { + if (fn) { + try { + Object.defineProperty(fn, 'name', {value}); + } catch (e) { + // eslint-disable-next-line no-empty } - const digestBytes = multihashBytes.subarray( - specs.multihashSize - specs.digestSize - ) - const digest = new car_node_modules_multiformats_src_hashes_digest_Digest( - specs.multihashCode, - specs.digestSize, - digestBytes, - multihashBytes - ) - const cid = - specs.version === 0 - ? car_node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) - : car_node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest) - return [/** @type {CID} */(cid), bytes.subarray(specs.size)] + Object.defineProperty(fn, 'adapterName', {value}); } +}); - /** - * Inspect the initial bytes of a CID to determine its properties. - * - * Involves decoding up to 4 varints. Typically this will require only 4 to 6 - * bytes but for larger multicodec code values and larger multihash digest - * lengths these varints can be quite large. It is recommended that at least - * 10 bytes be made available in the `initialBytes` argument for a complete - * inspection. - * - * @template {unknown} T - * @template {number} C - * @template {number} A - * @template {API.Version} V - * @param {API.ByteView>} initialBytes - * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }} - */ - static inspectBytes (initialBytes) { - let offset = 0 - const next = () => { - const [i, length] = car_node_modules_multiformats_src_varint_decode(initialBytes.subarray(offset)) - offset += length - return i - } +const renderReason = (reason) => `- ${reason}`; - let version = /** @type {V} */ (next()) - let codec = /** @type {C} */ (car_node_modules_multiformats_src_cid_DAG_PB_CODE) - if (/** @type {number} */(version) === 18) { - // CIDv0 - version = /** @type {V} */ (0) - offset = 0 - } else { - codec = /** @type {C} */ (next()) +const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false; + +/* harmony default export */ const adapters = ({ + getAdapter: (adapters) => { + adapters = utils.isArray(adapters) ? adapters : [adapters]; + + const {length} = adapters; + let nameOrAdapter; + let adapter; + + const rejectedReasons = {}; + + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + let id; + + adapter = nameOrAdapter; + + if (!isResolvedHandle(nameOrAdapter)) { + adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; + + if (adapter === undefined) { + throw new core_AxiosError(`Unknown adapter '${id}'`); + } + } + + if (adapter) { + break; + } + + rejectedReasons[id || '#' + i] = adapter; } - if (version !== 0 && version !== 1) { - throw new RangeError(`Invalid CID version ${version}`) + if (!adapter) { + + const reasons = Object.entries(rejectedReasons) + .map(([id, state]) => `adapter ${id} ` + + (state === false ? 'is not supported by the environment' : 'is not available in the build') + ); + + let s = length ? + (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : + 'as no adapter specified'; + + throw new core_AxiosError( + `There is no suitable adapter to dispatch the request ` + s, + 'ERR_NOT_SUPPORT' + ); } - const prefixSize = offset - const multihashCode = /** @type {A} */ (next()) // multihash code - const digestSize = next() // multihash length - const size = offset + digestSize - const multihashSize = size - prefixSize + return adapter; + }, + adapters: knownAdapters +}); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/core/dispatchRequest.js + - return { version, codec, multihashCode, digestSize, multihashSize, size } - } - /** - * Takes cid in a string representation and creates an instance. If `base` - * decoder is not provided will use a default from the configuration. It will - * throw an error if encoding of the CID is not compatible with supplied (or - * a default decoder). - * - * @template {string} Prefix - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ToString, Prefix>} source - * @param {API.MultibaseDecoder} [base] - * @returns {CID} - */ - static parse (source, base) { - const [prefix, bytes] = car_node_modules_multiformats_src_cid_parseCIDtoBytes(source, base) - const cid = car_node_modules_multiformats_src_cid_CID.decode(bytes) - if (cid.version === 0 && source[0] !== 'Q') { - throw Error('Version 0 CID string must not include multibase prefix') - } - // Cache string representation to avoid computing it on `this.toString()` - car_node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source) - return cid - } -} -/** - * @template {string} Prefix - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ToString, Prefix>} source - * @param {API.MultibaseDecoder} [base] - * @returns {[Prefix, API.ByteView>]} - */ -const car_node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => { - switch (source[0]) { - // CIDv0 is parsed differently - case 'Q': { - const decoder = base || car_node_modules_multiformats_src_bases_base58_base58btc - return [ - /** @type {Prefix} */ (car_node_modules_multiformats_src_bases_base58_base58btc.prefix), - decoder.decode(`${car_node_modules_multiformats_src_bases_base58_base58btc.prefix}${source}`) - ] - } - case car_node_modules_multiformats_src_bases_base58_base58btc.prefix: { - const decoder = base || car_node_modules_multiformats_src_bases_base58_base58btc - return [/** @type {Prefix} */(car_node_modules_multiformats_src_bases_base58_base58btc.prefix), decoder.decode(source)] - } - case car_node_modules_multiformats_src_bases_base32_base32.prefix: { - const decoder = base || car_node_modules_multiformats_src_bases_base32_base32 - return [/** @type {Prefix} */(car_node_modules_multiformats_src_bases_base32_base32.prefix), decoder.decode(source)] - } - default: { - if (base == null) { - throw Error( - 'To parse non base32 or base58btc encoded CID multibase decoder must be provided' - ) - } - return [/** @type {Prefix} */(source[0]), base.decode(source)] - } - } -} /** + * Throws a `CanceledError` if cancellation has been requested. * - * @param {Uint8Array} bytes - * @param {Map} cache - * @param {API.MultibaseEncoder<'z'>} base + * @param {Object} config The config that is to be used for the request + * + * @returns {void} */ -const car_node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => { - const { prefix } = base - if (prefix !== car_node_modules_multiformats_src_bases_base58_base58btc.prefix) { - throw Error(`Cannot string encode V0 in ${base.name} encoding`) +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); } - const cid = cache.get(prefix) - if (cid == null) { - const cid = base.encode(bytes).slice(1) - cache.set(prefix, cid) - return cid - } else { - return cid + if (config.signal && config.signal.aborted) { + throw new cancel_CanceledError(null, config); } } /** - * @template {string} Prefix - * @param {Uint8Array} bytes - * @param {Map} cache - * @param {API.MultibaseEncoder} base + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * + * @returns {Promise} The Promise to be fulfilled */ -const car_node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => { - const { prefix } = base - const cid = cache.get(prefix) - if (cid == null) { - const cid = base.encode(bytes) - cache.set(prefix, cid) - return cid - } else { - return cid - } -} - -const car_node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70 -const car_node_modules_multiformats_src_cid_SHA_256_CODE = 0x12 +function dispatchRequest(config) { + throwIfCancellationRequested(config); -/** - * @param {API.Version} version - * @param {number} code - * @param {Uint8Array} multihash - * @returns {Uint8Array} - */ -const car_node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => { - const codeOffset = car_node_modules_multiformats_src_varint_encodingLength(version) - const hashOffset = codeOffset + car_node_modules_multiformats_src_varint_encodingLength(code) - const bytes = new Uint8Array(hashOffset + multihash.byteLength) - car_node_modules_multiformats_src_varint_encodeTo(version, bytes, 0) - car_node_modules_multiformats_src_varint_encodeTo(code, bytes, codeOffset) - bytes.set(multihash, hashOffset) - return bytes -} + config.headers = core_AxiosHeaders.from(config.headers); -const car_node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') + // Transform request data + config.data = transformData.call( + config, + config.transformRequest + ); -;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/src/codecs/raw.js -// @ts-check + if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { + config.headers.setContentType('application/x-www-form-urlencoded', false); + } + const adapter = adapters.getAdapter(config.adapter || lib_defaults.adapter); + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); -/** - * @template T - * @typedef {import('./interface.js').ByteView} ByteView - */ + // Transform response data + response.data = transformData.call( + config, + config.transformResponse, + response + ); -const car_node_modules_multiformats_src_codecs_raw_name = 'raw' -const car_node_modules_multiformats_src_codecs_raw_code = 0x55 + response.headers = core_AxiosHeaders.from(response.headers); -/** - * @param {Uint8Array} node - * @returns {ByteView} - */ -const car_node_modules_multiformats_src_codecs_raw_encode = (node) => coerce(node) + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); -/** - * @param {ByteView} data - * @returns {Uint8Array} - */ -const car_node_modules_multiformats_src_codecs_raw_decode = (data) => coerce(data) + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + config.transformResponse, + reason.response + ); + reason.response.headers = core_AxiosHeaders.from(reason.response.headers); + } + } -;// CONCATENATED MODULE: ./node_modules/@helia/car/dist/src/utils/dag-walkers.js -/* eslint max-depth: ["error", 7] */ + return Promise.reject(reason); + }); +} +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/core/mergeConfig.js +const headersToObject = (thing) => thing instanceof core_AxiosHeaders ? thing.toJSON() : thing; /** - * Dag walker for dag-pb CIDs - */ -const dagPbWalker = { - codec: code, - async *walk(block) { - const node = src_decode(block); - yield* node.Links.map(l => l.Hash); - } -}; -/** - * Dag walker for raw CIDs - */ -const rawWalker = { - codec: car_node_modules_multiformats_src_codecs_raw_code, - async *walk() { - // no embedded CIDs in a raw block - } -}; -// https://github.com/ipfs/go-ipfs/issues/3570#issuecomment-273931692 -const dag_walkers_CID_TAG = 42; -/** - * Dag walker for dag-cbor CIDs. Does not actually use dag-cbor since - * all we are interested in is extracting the the CIDs from the block - * so we can just use cborg for that. + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * + * @returns {Object} New object resulting from merging config2 to config1 */ -const cborWalker = { - codec: 0x71, - async *walk(block) { - const cids = []; - const tags = []; - tags[dag_walkers_CID_TAG] = (bytes) => { - if (bytes[0] !== 0) { - throw new Error('Invalid CID for CBOR tag 42; expected leading 0x00'); - } - const cid = car_node_modules_multiformats_src_cid_CID.decode(bytes.subarray(1)); // ignore leading 0x00 - cids.push(cid); - return cid; - }; - decode_decode(block, { - tags - }); - yield* cids; +function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + const config = {}; + + function getMergedValue(target, source, caseless) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge.call({caseless}, target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); } -}; -/** - * Borrowed from @ipld/dag-json - */ -class dag_walkers_DagJsonTokenizer extends Tokenizer { - tokenBuffer; - constructor(data, options) { - super(data, options); - this.tokenBuffer = []; + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(a, b, caseless) { + if (!utils.isUndefined(b)) { + return getMergedValue(a, b, caseless); + } else if (!utils.isUndefined(a)) { + return getMergedValue(undefined, a, caseless); } - done() { - return this.tokenBuffer.length === 0 && super.done(); + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(a, b) { + if (!utils.isUndefined(b)) { + return getMergedValue(undefined, b); } - _next() { - if (this.tokenBuffer.length > 0) { - // @ts-expect-error https://github.com/Microsoft/TypeScript/issues/30406 - return this.tokenBuffer.pop(); - } - return super.next(); + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(a, b) { + if (!utils.isUndefined(b)) { + return getMergedValue(undefined, b); + } else if (!utils.isUndefined(a)) { + return getMergedValue(undefined, a); } - /** - * Implements rules outlined in https://github.com/ipld/specs/pull/356 - */ - next() { - const token = this._next(); - if (token.type === token_Type.map) { - const keyToken = this._next(); - if (keyToken.type === token_Type.string && keyToken.value === '/') { - const valueToken = this._next(); - if (valueToken.type === token_Type.string) { // *must* be a CID - const breakToken = this._next(); // swallow the end-of-map token - if (breakToken.type !== token_Type["break"]) { - throw new Error('Invalid encoded CID form'); - } - this.tokenBuffer.push(valueToken); // CID.parse will pick this up after our tag token - return new token_Token(token_Type.tag, 42, 0); - } - if (valueToken.type === token_Type.map) { - const innerKeyToken = this._next(); - if (innerKeyToken.type === token_Type.string && innerKeyToken.value === 'bytes') { - const innerValueToken = this._next(); - if (innerValueToken.type === token_Type.string) { // *must* be Bytes - for (let i = 0; i < 2; i++) { - const breakToken = this._next(); // swallow two end-of-map tokens - if (breakToken.type !== token_Type["break"]) { - throw new Error('Invalid encoded Bytes form'); - } - } - const bytes = car_node_modules_multiformats_src_bases_base64_base64.decode(`m${innerValueToken.value}`); - return new token_Token(token_Type.bytes, bytes, innerValueToken.value.length); - } - this.tokenBuffer.push(innerValueToken); // bail - } - this.tokenBuffer.push(innerKeyToken); // bail - } - this.tokenBuffer.push(valueToken); // bail - } - this.tokenBuffer.push(keyToken); // bail - } - return token; + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(undefined, a); } + } + + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + withXSRFToken: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) + }; + + utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { + const merge = mergeMap[prop] || mergeDeepProperties; + const configValue = merge(config1[prop], config2[prop], prop); + (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); + + return config; } -/** - * Dag walker for dag-json CIDs. Does not actually use dag-json since - * all we are interested in is extracting the the CIDs from the block - * so we can just use cborg/json for that. - */ -const jsonWalker = { - codec: 0x0129, - async *walk(block) { - const cids = []; - const tags = []; - tags[dag_walkers_CID_TAG] = (string) => { - const cid = car_node_modules_multiformats_src_cid_CID.parse(string); - cids.push(cid); - return cid; - }; - json_decode_decode(block, { - tags, - tokenizer: new dag_walkers_DagJsonTokenizer(block, { - tags, - allowIndefinite: true, - allowUndefined: true, - allowNaN: true, - allowInfinity: true, - allowBigInt: true, - strict: false, - rejectDuplicateMapKeys: false - }) - }); - yield* cids; - } -}; -//# sourceMappingURL=dag-walkers.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/car/dist/src/index.js -/** - * @packageDocumentation - * - * `@helia/car` provides `import` and `export` methods to read/write Car files to {@link https://github.com/ipfs/helia Helia}'s blockstore. - * - * See the {@link Car} interface for all available operations. - * - * By default it supports `dag-pb`, `dag-cbor`, `dag-json` and `raw` CIDs, more esoteric DAG walkers can be passed as an init option. - * - * @example - * - * ```typescript - * import { createHelia } from 'helia' - * import { unixfs } from '@helia/unixfs' - * import { car } from '@helia/car' - * import { CarWriter } from '@ipld/car' - * import { Readable } from 'node:stream' - * import nodeFs from 'node:fs' - * - * const helia = createHelia({ - * // ... helia config - * }) - * const fs = unixfs(helia) - * - * // add some UnixFS data - * const cid = await fs.addBytes(fileData1) - * - * // export it as a Car - * const c = car(helia) - * const { writer, out } = await CarWriter.create(cid) - * - * // `out` needs to be directed somewhere, see the @ipld/car docs for more information - * Readable.from(out).pipe(nodeFs.createWriteStream('example.car')) - * - * // write the DAG behind `cid` into the writer - * await c.export(cid, writer) - * ``` - * - * @example - * - * ```typescript - * import { createHelia } from 'helia' - * import { unixfs } from '@helia/unixfs' - * import { car } from '@helia/car' - * import { CarReader } from '@ipld/car' - * import { Readable } from 'node:stream' - * import nodeFs from 'node:fs' - * - * const helia = createHelia({ - * // ... helia config - * }) - * - * // import the car - * const inStream = nodeFs.createReadStream('example.car') - * const reader = await CarReader.fromIterable(inStream) - * - * await c.import(reader) - * ``` - */ +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/validator.js -const DEFAULT_DAG_WALKERS = [ - rawWalker, - dagPbWalker, - cborWalker, - jsonWalker -]; -const DAG_WALK_QUEUE_CONCURRENCY = 1; -class DefaultCar { - components; - dagWalkers; - constructor(components, init) { - this.components = components; - this.dagWalkers = {}; - [...DEFAULT_DAG_WALKERS, ...(init.dagWalkers ?? [])].forEach(dagWalker => { - this.dagWalkers[dagWalker.codec] = dagWalker; - }); - } - async import(reader, options) { - await it_drain_dist_src(this.components.blockstore.putMany(it_map_dist_src(reader.blocks(), ({ cid, bytes }) => ({ cid, block: bytes })), options)); - } - async export(root, writer, options) { - const deferred = pDefer(); - const roots = Array.isArray(root) ? root : [root]; - // use a queue to walk the DAG instead of recursion so we can traverse very large DAGs - const queue = new dist({ - concurrency: DAG_WALK_QUEUE_CONCURRENCY - }); - queue.on('idle', () => { - deferred.resolve(); - }); - queue.on('error', (err) => { - deferred.resolve(err); - }); - for (const root of roots) { - void queue.add(async () => { - await this.#walkDag(root, queue, async (cid, bytes) => { - await writer.put({ cid, bytes }); - }, options); - }); - } - // wait for the writer to end - try { - await deferred.promise; - } - finally { - await writer.close(); - } - } - /** - * Walk the DAG behind the passed CID, ensure all blocks are present in the blockstore - * and update the pin count for them - */ - async #walkDag(cid, queue, withBlock, options) { - const dagWalker = this.dagWalkers[cid.code]; - if (dagWalker == null) { - throw new Error(`No dag walker found for cid codec ${cid.code}`); - } - const block = await this.components.blockstore.get(cid, options); - await withBlock(cid, block); - // walk dag, ensure all blocks are present - for await (const cid of dagWalker.walk(block)) { - void queue.add(async () => { - await this.#walkDag(cid, queue, withBlock, options); - }); - } - } -} -/** - * Create a {@link Car} instance for use with {@link https://github.com/ipfs/helia Helia} - */ -function car(helia, init = {}) { - return new DefaultCar(helia, init); -} -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/it-first/dist/src/index.js + +const validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +const deprecatedWarnings = {}; + /** - * @packageDocumentation - * - * Return the first value in an (async)iterable - * - * @example - * - * ```javascript - * import first from 'it-first' - * - * // This can also be an iterator, generator, etc - * const values = [0, 1, 2, 3, 4] - * - * const res = first(values) - * - * console.info(res) // 0 - * ``` - * - * Async sources must be awaited: - * - * ```javascript - * import first from 'it-first' - * - * const values = async function * () { - * yield * [0, 1, 2, 3, 4] - * } + * Transitional option validator * - * const res = await first(values()) + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info * - * console.info(res) // 0 - * ``` + * @returns {function} */ -function it_first_dist_src_isAsyncIterable(thing) { - return thing[Symbol.asyncIterator] != null; -} -function src_first(source) { - if (it_first_dist_src_isAsyncIterable(source)) { - return (async () => { - for await (const entry of source) { // eslint-disable-line no-unreachable-loop - return entry; - } - return undefined; - })(); +validators.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return (value, opt, opts) => { + if (validator === false) { + throw new core_AxiosError( + formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), + core_AxiosError.ERR_DEPRECATED + ); } - for (const entry of source) { // eslint-disable-line no-unreachable-loop - return entry; + + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); } - return undefined; -} -/* harmony default export */ const it_first_dist_src = (src_first); -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/it-batch/dist/src/index.js + + return validator ? validator(value, opt, opts) : true; + }; +}; + /** - * @packageDocumentation - * - * The final batch may be smaller than the max. - * - * @example - * - * ```javascript - * import batch from 'it-batch' - * import all from 'it-all' - * - * // This can also be an iterator, generator, etc - * const values = [0, 1, 2, 3, 4] - * const batchSize = 2 - * - * const result = all(batch(values, batchSize)) - * - * console.info(result) // [0, 1], [2, 3], [4] - * ``` - * - * Async sources must be awaited: - * - * ```javascript - * import batch from 'it-batch' - * import all from 'it-all' - * - * const values = async function * () { - * yield * [0, 1, 2, 3, 4] - * } + * Assert object's properties type * - * const batchSize = 2 - * const result = await all(batch(values(), batchSize)) + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown * - * console.info(result) // [0, 1], [2, 3], [4] - * ``` + * @returns {object} */ -function it_batch_dist_src_isAsyncIterable(thing) { - return thing[Symbol.asyncIterator] != null; -} -function batch(source, size = 1) { - size = Number(size); - if (it_batch_dist_src_isAsyncIterable(source)) { - return (async function* () { - let things = []; - if (size < 1) { - size = 1; - } - if (size !== Math.round(size)) { - throw new Error('Batch size must be an integer'); - } - for await (const thing of source) { - things.push(thing); - while (things.length >= size) { - yield things.slice(0, size); - things = things.slice(size); - } - } - while (things.length > 0) { - yield things.slice(0, size); - things = things.slice(size); - } - }()); + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new core_AxiosError('options must be an object', core_AxiosError.ERR_BAD_OPTION_VALUE); + } + const keys = Object.keys(options); + let i = keys.length; + while (i-- > 0) { + const opt = keys[i]; + const validator = schema[opt]; + if (validator) { + const value = options[opt]; + const result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new core_AxiosError('option ' + opt + ' must be ' + result, core_AxiosError.ERR_BAD_OPTION_VALUE); + } + continue; } - return (function* () { - let things = []; - if (size < 1) { - size = 1; - } - if (size !== Math.round(size)) { - throw new Error('Batch size must be an integer'); - } - for (const thing of source) { - things.push(thing); - while (things.length >= size) { - yield things.slice(0, size); - things = things.slice(size); - } - } - while (things.length > 0) { - yield things.slice(0, size); - things = things.slice(size); - } - }()); + if (allowUnknown !== true) { + throw new core_AxiosError('Unknown option ' + opt, core_AxiosError.ERR_BAD_OPTION); + } + } } -/* harmony default export */ const it_batch_dist_src = (batch); -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/it-parallel-batch/dist/src/index.js + +/* harmony default export */ const validator = ({ + assertOptions, + validators +}); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/core/Axios.js + + + + + + + + + + + +const Axios_validators = validator.validators; + /** - * @packageDocumentation - * - * Takes an async iterator that emits promise-returning functions, invokes them in parallel and emits the results in the same order as the input. - * - * The final batch may be smaller than the batch size. - * - * @example - * - * ```javascript - * import parallelBatch from 'it-parallel-batch' - * import all from 'it-all' - * import delay from 'delay' - * - * // This can also be an iterator, async iterator, generator, etc - * const input = [ - * async () => { - * await delay(500) - * - * return 1 - * }, - * async () => { - * await delay(200) - * - * return 2 - * }, - * async () => { - * await delay(100) - * - * return 3 - * } - * ] - * - * const batchSize = 2 + * Create a new instance of Axios * - * const result = await all(parallelBatch(input, batchSize)) + * @param {Object} instanceConfig The default config for the instance * - * console.info(result) // [1, 2, 3] - * ``` + * @return {Axios} A new instance of Axios */ +class Axios { + constructor(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new core_InterceptorManager(), + response: new core_InterceptorManager() + }; + } -/** - * Takes an (async) iterator that emits promise-returning functions, - * invokes them in parallel and emits the results as they become available but - * in the same order as the input - */ -async function* parallelBatch(source, size = 1) { - for await (const tasks of it_batch_dist_src(source, size)) { - const things = tasks.map(async (p) => { - return p().then(value => ({ ok: true, value }), err => ({ ok: false, err })); - }); - for (let i = 0; i < things.length; i++) { - const result = await things[i]; - if (result.ok) { - yield result.value; - } - else { - throw result.err; - } + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + + config = mergeConfig(this.defaults, config); + + const {transitional, paramsSerializer, headers} = config; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: Axios_validators.transitional(Axios_validators.boolean), + forcedJSONParsing: Axios_validators.transitional(Axios_validators.boolean), + clarifyTimeoutError: Axios_validators.transitional(Axios_validators.boolean) + }, false); + } + + if (paramsSerializer != null) { + if (utils.isFunction(paramsSerializer)) { + config.paramsSerializer = { + serialize: paramsSerializer } + } else { + validator.assertOptions(paramsSerializer, { + encode: Axios_validators.function, + serialize: Axios_validators.function + }, true); + } } -} -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/uint8arraylist/node_modules/uint8arrays/dist/src/util/as-uint8array.js -/** - * To guarantee Uint8Array semantics, convert nodejs Buffers - * into vanilla Uint8Arrays - */ -function uint8arrays_dist_src_util_as_uint8array_asUint8Array(buf) { - if (globalThis.Buffer != null) { - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); + + // Set config.method + config.method = (config.method || this.defaults.method || 'get').toLowerCase(); + + // Flatten headers + let contextHeaders = headers && utils.merge( + headers.common, + headers[config.method] + ); + + headers && utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + (method) => { + delete headers[method]; + } + ); + + config.headers = core_AxiosHeaders.concat(contextHeaders, headers); + + // filter out skipped interceptors + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + let promise; + let i = 0; + let len; + + if (!synchronousRequestInterceptors) { + const chain = [dispatchRequest.bind(this), undefined]; + chain.unshift.apply(chain, requestInterceptorChain); + chain.push.apply(chain, responseInterceptorChain); + len = chain.length; + + promise = Promise.resolve(config); + + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + + return promise; } - return buf; + + len = requestInterceptorChain.length; + + let newConfig = config; + + i = 0; + + while (i < len) { + const onFulfilled = requestInterceptorChain[i++]; + const onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + + try { + promise = dispatchRequest.call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + + i = 0; + len = responseInterceptorChain.length; + + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + + return promise; + } + + getUri(config) { + config = mergeConfig(this.defaults, config); + const fullPath = buildFullPath(config.baseURL, config.url); + return buildURL(fullPath, config.params, config.paramsSerializer); + } } -//# sourceMappingURL=as-uint8array.js.map -;// CONCATENATED MODULE: ./node_modules/uint8arraylist/node_modules/uint8arrays/dist/src/alloc.js + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method, + url, + data: (config || {}).data + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request(mergeConfig(config || {}, { + method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url, + data + })); + }; + } + + Axios.prototype[method] = generateHTTPMethod(); + + Axios.prototype[method + 'Form'] = generateHTTPMethod(true); +}); + +/* harmony default export */ const core_Axios = (Axios); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/cancel/CancelToken.js + + + /** - * Returns a `Uint8Array` of the requested size. Referenced memory will - * be initialized to 0. - */ -function node_modules_uint8arrays_dist_src_alloc_alloc(size = 0) { - if (globalThis.Buffer?.alloc != null) { - return uint8arrays_dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.alloc(size)); - } - return new Uint8Array(size); -} -/** - * Where possible returns a Uint8Array of the requested size that references - * uninitialized memory. Only use if you are certain you will immediately - * overwrite every value in the returned `Uint8Array`. + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @param {Function} executor The executor function. + * + * @returns {CancelToken} */ -function uint8arrays_dist_src_alloc_allocUnsafe(size = 0) { - if (globalThis.Buffer?.allocUnsafe != null) { - return uint8arrays_dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.allocUnsafe(size)); +class CancelToken { + constructor(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); } - return new Uint8Array(size); -} -//# sourceMappingURL=alloc.js.map -;// CONCATENATED MODULE: ./node_modules/uint8arraylist/node_modules/uint8arrays/dist/src/concat.js + let resolvePromise; -/** - * Returns a new Uint8Array created by concatenating the passed ArrayLikes - */ -function dist_src_concat_concat(arrays, length) { - if (length == null) { - length = arrays.reduce((acc, curr) => acc + curr.length, 0); + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + const token = this; + + // eslint-disable-next-line func-names + this.promise.then(cancel => { + if (!token._listeners) return; + + let i = token._listeners.length; + + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = onfulfilled => { + let _resolve; + // eslint-disable-next-line func-names + const promise = new Promise(resolve => { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + + return promise; + }; + + executor(function cancel(message, config, request) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new cancel_CanceledError(message, config, request); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) { + throw this.reason; } - const output = uint8arrays_dist_src_alloc_allocUnsafe(length); - let offset = 0; - for (const arr of arrays) { - output.set(arr, offset); - offset += arr.length; + } + + /** + * Subscribe to the cancel signal + */ + + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; } - return uint8arrays_dist_src_util_as_uint8array_asUint8Array(output); -} -//# sourceMappingURL=concat.js.map -;// CONCATENATED MODULE: ./node_modules/uint8arraylist/node_modules/uint8arrays/dist/src/equals.js -/** - * Returns true if the two passed Uint8Arrays have the same content - */ -function uint8arrays_dist_src_equals_equals(a, b) { - if (a === b) { - return true; + + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; } - if (a.byteLength !== b.byteLength) { - return false; + } + + /** + * Unsubscribe from the cancel signal + */ + + unsubscribe(listener) { + if (!this._listeners) { + return; } - for (let i = 0; i < a.byteLength; i++) { - if (a[i] !== b[i]) { - return false; - } + const index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); } - return true; + } + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + const token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token, + cancel + }; + } } -//# sourceMappingURL=equals.js.map -;// CONCATENATED MODULE: ./node_modules/uint8arraylist/dist/src/index.js + +/* harmony default export */ const cancel_CancelToken = (CancelToken); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/spread.js + + /** - * @packageDocumentation - * - * A class that lets you do operations over a list of Uint8Arrays without - * copying them. - * - * ```js - * import { Uint8ArrayList } from 'uint8arraylist' - * - * const list = new Uint8ArrayList() - * list.append(Uint8Array.from([0, 1, 2])) - * list.append(Uint8Array.from([3, 4, 5])) - * - * list.subarray() - * // -> Uint8Array([0, 1, 2, 3, 4, 5]) - * - * list.consume(3) - * list.subarray() - * // -> Uint8Array([3, 4, 5]) - * - * // you can also iterate over the list - * for (const buf of list) { - * // ..do something with `buf` - * } - * - * list.subarray(0, 1) - * // -> Uint8Array([0]) - * ``` - * - * ## Converting Uint8ArrayLists to Uint8Arrays - * - * There are two ways to turn a `Uint8ArrayList` into a `Uint8Array` - `.slice` and `.subarray` and one way to turn a `Uint8ArrayList` into a `Uint8ArrayList` with different contents - `.sublist`. - * - * ### slice - * - * Slice follows the same semantics as [Uint8Array.slice](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) in that it creates a new `Uint8Array` and copies bytes into it using an optional offset & length. - * - * ```js - * const list = new Uint8ArrayList() - * list.append(Uint8Array.from([0, 1, 2])) - * list.append(Uint8Array.from([3, 4, 5])) - * - * list.slice(0, 1) - * // -> Uint8Array([0]) - * ``` - * - * ### subarray - * - * Subarray attempts to follow the same semantics as [Uint8Array.subarray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) with one important different - this is a no-copy operation, unless the requested bytes span two internal buffers in which case it is a copy operation. - * - * ```js - * const list = new Uint8ArrayList() - * list.append(Uint8Array.from([0, 1, 2])) - * list.append(Uint8Array.from([3, 4, 5])) - * - * list.subarray(0, 1) - * // -> Uint8Array([0]) - no-copy + * Syntactic sugar for invoking a function and expanding an array for arguments. * - * list.subarray(2, 5) - * // -> Uint8Array([2, 3, 4]) - copy - * ``` + * Common use case would be to use `Function.prototype.apply`. * - * ### sublist + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` * - * Sublist creates and returns a new `Uint8ArrayList` that shares the underlying buffers with the original so is always a no-copy operation. + * With `spread` this example can be re-written. * - * ```js - * const list = new Uint8ArrayList() - * list.append(Uint8Array.from([0, 1, 2])) - * list.append(Uint8Array.from([3, 4, 5])) + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` * - * list.sublist(0, 1) - * // -> Uint8ArrayList([0]) - no-copy + * @param {Function} callback * - * list.sublist(2, 5) - * // -> Uint8ArrayList([2], [3, 4]) - no-copy - * ``` + * @returns {Function} + */ +function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +} + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/isAxiosError.js + + + + +/** + * Determines whether the payload is an error thrown by Axios * - * ## Inspiration + * @param {*} payload The value to test * - * Borrows liberally from [bl](https://www.npmjs.com/package/bl) but only uses native JS types. + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false */ +function isAxiosError(payload) { + return utils.isObject(payload) && (payload.isAxiosError === true); +} + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/helpers/HttpStatusCode.js +const HttpStatusCode = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, +}; + +Object.entries(HttpStatusCode).forEach(([key, value]) => { + HttpStatusCode[value] = key; +}); + +/* harmony default export */ const helpers_HttpStatusCode = (HttpStatusCode); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/axios/lib/axios.js + + + + + + + + + + + + + + + + + -const uint8arraylist_dist_src_symbol = Symbol.for('@achingbrain/uint8arraylist'); -function findBufAndOffset(bufs, index) { - if (index == null || index < 0) { - throw new RangeError('index is out of bounds'); - } - let offset = 0; - for (const buf of bufs) { - const bufEnd = offset + buf.byteLength; - if (index < bufEnd) { - return { - buf, - index: index - offset - }; - } - offset = bufEnd; - } - throw new RangeError('index is out of bounds'); -} /** - * Check if object is a CID instance - * - * @example + * Create an instance of Axios * - * ```js - * import { isUint8ArrayList, Uint8ArrayList } from 'uint8arraylist' + * @param {Object} defaultConfig The default config for the instance * - * isUint8ArrayList(true) // false - * isUint8ArrayList([]) // false - * isUint8ArrayList(new Uint8ArrayList()) // true - * ``` + * @returns {Axios} A new instance of Axios */ -function isUint8ArrayList(value) { - return Boolean(value?.[uint8arraylist_dist_src_symbol]); +function createInstance(defaultConfig) { + const context = new core_Axios(defaultConfig); + const instance = bind(core_Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, core_Axios.prototype, context, {allOwnKeys: true}); + + // Copy context to instance + utils.extend(instance, context, null, {allOwnKeys: true}); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance(mergeConfig(defaultConfig, instanceConfig)); + }; + + return instance; } -class src_Uint8ArrayList { - bufs; - length; - [uint8arraylist_dist_src_symbol] = true; - constructor(...data) { - this.bufs = []; - this.length = 0; - if (data.length > 0) { - this.appendAll(data); - } - } - *[Symbol.iterator]() { - yield* this.bufs; - } - get byteLength() { - return this.length; - } - /** - * Add one or more `bufs` to the end of this Uint8ArrayList - */ - append(...bufs) { - this.appendAll(bufs); - } - /** - * Add all `bufs` to the end of this Uint8ArrayList - */ - appendAll(bufs) { - let length = 0; - for (const buf of bufs) { - if (buf instanceof Uint8Array) { - length += buf.byteLength; - this.bufs.push(buf); - } - else if (isUint8ArrayList(buf)) { - length += buf.byteLength; - this.bufs.push(...buf.bufs); - } - else { - throw new Error('Could not append value, must be an Uint8Array or a Uint8ArrayList'); - } - } - this.length += length; - } - /** - * Add one or more `bufs` to the start of this Uint8ArrayList - */ - prepend(...bufs) { - this.prependAll(bufs); - } - /** - * Add all `bufs` to the start of this Uint8ArrayList - */ - prependAll(bufs) { - let length = 0; - for (const buf of bufs.reverse()) { - if (buf instanceof Uint8Array) { - length += buf.byteLength; - this.bufs.unshift(buf); - } - else if (isUint8ArrayList(buf)) { - length += buf.byteLength; - this.bufs.unshift(...buf.bufs); - } - else { - throw new Error('Could not prepend value, must be an Uint8Array or a Uint8ArrayList'); - } - } - this.length += length; - } - /** - * Read the value at `index` - */ - get(index) { - const res = findBufAndOffset(this.bufs, index); - return res.buf[res.index]; - } - /** - * Set the value at `index` to `value` - */ - set(index, value) { - const res = findBufAndOffset(this.bufs, index); - res.buf[res.index] = value; - } - /** - * Copy bytes from `buf` to the index specified by `offset` - */ - write(buf, offset = 0) { - if (buf instanceof Uint8Array) { - for (let i = 0; i < buf.length; i++) { - this.set(offset + i, buf[i]); - } - } - else if (isUint8ArrayList(buf)) { - for (let i = 0; i < buf.length; i++) { - this.set(offset + i, buf.get(i)); - } - } - else { - throw new Error('Could not write value, must be an Uint8Array or a Uint8ArrayList'); - } - } - /** - * Remove bytes from the front of the pool - */ - consume(bytes) { - // first, normalize the argument, in accordance with how Buffer does it - bytes = Math.trunc(bytes); - // do nothing if not a positive number - if (Number.isNaN(bytes) || bytes <= 0) { - return; - } - // if consuming all bytes, skip iterating - if (bytes === this.byteLength) { - this.bufs = []; - this.length = 0; - return; - } - while (this.bufs.length > 0) { - if (bytes >= this.bufs[0].byteLength) { - bytes -= this.bufs[0].byteLength; - this.length -= this.bufs[0].byteLength; - this.bufs.shift(); - } - else { - this.bufs[0] = this.bufs[0].subarray(bytes); - this.length -= bytes; - break; - } - } - } - /** - * Extracts a section of an array and returns a new array. - * - * This is a copy operation as it is with Uint8Arrays and Arrays - * - note this is different to the behaviour of Node Buffers. - */ - slice(beginInclusive, endExclusive) { - const { bufs, length } = this._subList(beginInclusive, endExclusive); - return dist_src_concat_concat(bufs, length); - } - /** - * Returns a alloc from the given start and end element index. - * - * In the best case where the data extracted comes from a single Uint8Array - * internally this is a no-copy operation otherwise it is a copy operation. - */ - subarray(beginInclusive, endExclusive) { - const { bufs, length } = this._subList(beginInclusive, endExclusive); - if (bufs.length === 1) { - return bufs[0]; - } - return dist_src_concat_concat(bufs, length); - } - /** - * Returns a allocList from the given start and end element index. - * - * This is a no-copy operation. - */ - sublist(beginInclusive, endExclusive) { - const { bufs, length } = this._subList(beginInclusive, endExclusive); - const list = new src_Uint8ArrayList(); - list.length = length; - // don't loop, just set the bufs - list.bufs = [...bufs]; - return list; - } - _subList(beginInclusive, endExclusive) { - beginInclusive = beginInclusive ?? 0; - endExclusive = endExclusive ?? this.length; - if (beginInclusive < 0) { - beginInclusive = this.length + beginInclusive; - } - if (endExclusive < 0) { - endExclusive = this.length + endExclusive; - } - if (beginInclusive < 0 || endExclusive > this.length) { - throw new RangeError('index is out of bounds'); - } - if (beginInclusive === endExclusive) { - return { bufs: [], length: 0 }; - } - if (beginInclusive === 0 && endExclusive === this.length) { - return { bufs: this.bufs, length: this.length }; - } - const bufs = []; - let offset = 0; - for (let i = 0; i < this.bufs.length; i++) { - const buf = this.bufs[i]; - const bufStart = offset; - const bufEnd = bufStart + buf.byteLength; - // for next loop - offset = bufEnd; - if (beginInclusive >= bufEnd) { - // start after this buf - continue; - } - const sliceStartInBuf = beginInclusive >= bufStart && beginInclusive < bufEnd; - const sliceEndsInBuf = endExclusive > bufStart && endExclusive <= bufEnd; - if (sliceStartInBuf && sliceEndsInBuf) { - // slice is wholly contained within this buffer - if (beginInclusive === bufStart && endExclusive === bufEnd) { - // requested whole buffer - bufs.push(buf); - break; - } - // requested part of buffer - const start = beginInclusive - bufStart; - bufs.push(buf.subarray(start, start + (endExclusive - beginInclusive))); - break; - } - if (sliceStartInBuf) { - // slice starts in this buffer - if (beginInclusive === 0) { - // requested whole buffer - bufs.push(buf); - continue; - } - // requested part of buffer - bufs.push(buf.subarray(beginInclusive - bufStart)); - continue; - } - if (sliceEndsInBuf) { - if (endExclusive === bufEnd) { - // requested whole buffer - bufs.push(buf); - break; - } - // requested part of buffer - bufs.push(buf.subarray(0, endExclusive - bufStart)); - break; - } - // slice started before this buffer and ends after it - bufs.push(buf); - } - return { bufs, length: endExclusive - beginInclusive }; - } - indexOf(search, offset = 0) { - if (!isUint8ArrayList(search) && !(search instanceof Uint8Array)) { - throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array'); - } - const needle = search instanceof Uint8Array ? search : search.subarray(); - offset = Number(offset ?? 0); - if (isNaN(offset)) { - offset = 0; - } - if (offset < 0) { - offset = this.length + offset; - } - if (offset < 0) { - offset = 0; - } - if (search.length === 0) { - return offset > this.length ? this.length : offset; - } - // https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_string-search_algorithm - const M = needle.byteLength; - if (M === 0) { - throw new TypeError('search must be at least 1 byte long'); - } - // radix - const radix = 256; - const rightmostPositions = new Int32Array(radix); - // position of the rightmost occurrence of the byte c in the pattern - for (let c = 0; c < radix; c++) { - // -1 for bytes not in pattern - rightmostPositions[c] = -1; - } - for (let j = 0; j < M; j++) { - // rightmost position for bytes in pattern - rightmostPositions[needle[j]] = j; - } - // Return offset of first match, -1 if no match - const right = rightmostPositions; - const lastIndex = this.byteLength - needle.byteLength; - const lastPatIndex = needle.byteLength - 1; - let skip; - for (let i = offset; i <= lastIndex; i += skip) { - skip = 0; - for (let j = lastPatIndex; j >= 0; j--) { - const char = this.get(i + j); - if (needle[j] !== char) { - skip = Math.max(1, j - right[char]); - break; - } - } - if (skip === 0) { - return i; - } - } - return -1; - } - getInt8(byteOffset) { - const buf = this.subarray(byteOffset, byteOffset + 1); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - return view.getInt8(0); - } - setInt8(byteOffset, value) { - const buf = uint8arrays_dist_src_alloc_allocUnsafe(1); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - view.setInt8(0, value); - this.write(buf, byteOffset); - } - getInt16(byteOffset, littleEndian) { - const buf = this.subarray(byteOffset, byteOffset + 2); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - return view.getInt16(0, littleEndian); - } - setInt16(byteOffset, value, littleEndian) { - const buf = node_modules_uint8arrays_dist_src_alloc_alloc(2); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - view.setInt16(0, value, littleEndian); - this.write(buf, byteOffset); - } - getInt32(byteOffset, littleEndian) { - const buf = this.subarray(byteOffset, byteOffset + 4); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - return view.getInt32(0, littleEndian); - } - setInt32(byteOffset, value, littleEndian) { - const buf = node_modules_uint8arrays_dist_src_alloc_alloc(4); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - view.setInt32(0, value, littleEndian); - this.write(buf, byteOffset); - } - getBigInt64(byteOffset, littleEndian) { - const buf = this.subarray(byteOffset, byteOffset + 8); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - return view.getBigInt64(0, littleEndian); - } - setBigInt64(byteOffset, value, littleEndian) { - const buf = node_modules_uint8arrays_dist_src_alloc_alloc(8); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - view.setBigInt64(0, value, littleEndian); - this.write(buf, byteOffset); - } - getUint8(byteOffset) { - const buf = this.subarray(byteOffset, byteOffset + 1); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - return view.getUint8(0); - } - setUint8(byteOffset, value) { - const buf = uint8arrays_dist_src_alloc_allocUnsafe(1); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - view.setUint8(0, value); - this.write(buf, byteOffset); - } - getUint16(byteOffset, littleEndian) { - const buf = this.subarray(byteOffset, byteOffset + 2); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - return view.getUint16(0, littleEndian); - } - setUint16(byteOffset, value, littleEndian) { - const buf = node_modules_uint8arrays_dist_src_alloc_alloc(2); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - view.setUint16(0, value, littleEndian); - this.write(buf, byteOffset); - } - getUint32(byteOffset, littleEndian) { - const buf = this.subarray(byteOffset, byteOffset + 4); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - return view.getUint32(0, littleEndian); - } - setUint32(byteOffset, value, littleEndian) { - const buf = node_modules_uint8arrays_dist_src_alloc_alloc(4); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - view.setUint32(0, value, littleEndian); - this.write(buf, byteOffset); - } - getBigUint64(byteOffset, littleEndian) { - const buf = this.subarray(byteOffset, byteOffset + 8); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - return view.getBigUint64(0, littleEndian); + +// Create the default instance to be exported +const axios_axios = createInstance(lib_defaults); + +// Expose Axios class to allow class inheritance +axios_axios.Axios = core_Axios; + +// Expose Cancel & CancelToken +axios_axios.CanceledError = cancel_CanceledError; +axios_axios.CancelToken = cancel_CancelToken; +axios_axios.isCancel = isCancel; +axios_axios.VERSION = VERSION; +axios_axios.toFormData = helpers_toFormData; + +// Expose AxiosError class +axios_axios.AxiosError = core_AxiosError; + +// alias for CanceledError for backward compatibility +axios_axios.Cancel = axios_axios.CanceledError; + +// Expose all/spread +axios_axios.all = function all(promises) { + return Promise.all(promises); +}; + +axios_axios.spread = spread; + +// Expose isAxiosError +axios_axios.isAxiosError = isAxiosError; + +// Expose mergeConfig +axios_axios.mergeConfig = mergeConfig; + +axios_axios.AxiosHeaders = core_AxiosHeaders; + +axios_axios.formToJSON = thing => helpers_formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing); + +axios_axios.getAdapter = adapters.getAdapter; + +axios_axios.HttpStatusCode = helpers_HttpStatusCode; + +axios_axios.default = axios_axios; + +// this module should only have a default export +/* harmony default export */ const lib_axios = (axios_axios); + +// EXTERNAL MODULE: ./node_modules/@aws-sdk/lib-storage/dist-cjs/index.js +var lib_storage_dist_cjs = __nccwpck_require__(38957); +// EXTERNAL MODULE: external "fs" +var external_fs_ = __nccwpck_require__(57147); +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/multiformats/vendor/base-x.js +// base-x encoding / decoding +// Copyright (c) 2018 base-x contributors +// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) +// Distributed under the MIT software license, see the accompanying +// file LICENSE or http://www.opensource.org/licenses/mit-license.php. +function sdk_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { + if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; + } + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') } + BASE_MAP[xc] = i; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up + var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up + function encode (source) { + if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } else if (Array.isArray(source)) { + source = Uint8Array.from(source); } - setBigUint64(byteOffset, value, littleEndian) { - const buf = node_modules_uint8arrays_dist_src_alloc_alloc(8); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - view.setBigUint64(0, value, littleEndian); - this.write(buf, byteOffset); + if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') } + if (source.length === 0) { return '' } + // Skip & count leading zeroes. + var zeroes = 0; + var length = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; } - getFloat32(byteOffset, littleEndian) { - const buf = this.subarray(byteOffset, byteOffset + 4); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - return view.getFloat32(0, littleEndian); + // Allocate enough space in big-endian base58 representation. + var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; + var b58 = new Uint8Array(size); + // Process the bytes. + while (pbegin !== pend) { + var carry = source[pbegin]; + // Apply "b58 = b58 * 256 + ch". + var i = 0; + for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { + carry += (256 * b58[it1]) >>> 0; + b58[it1] = (carry % BASE) >>> 0; + carry = (carry / BASE) >>> 0; + } + if (carry !== 0) { throw new Error('Non-zero carry') } + length = i; + pbegin++; } - setFloat32(byteOffset, value, littleEndian) { - const buf = node_modules_uint8arrays_dist_src_alloc_alloc(4); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - view.setFloat32(0, value, littleEndian); - this.write(buf, byteOffset); + // Skip leading zeroes in base58 result. + var it2 = size - length; + while (it2 !== size && b58[it2] === 0) { + it2++; } - getFloat64(byteOffset, littleEndian) { - const buf = this.subarray(byteOffset, byteOffset + 8); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - return view.getFloat64(0, littleEndian); + // Translate the result into a string. + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); } + return str + } + function decodeUnsafe (source) { + if (typeof source !== 'string') { throw new TypeError('Expected String') } + if (source.length === 0) { return new Uint8Array() } + var psz = 0; + // Skip leading spaces. + if (source[psz] === ' ') { return } + // Skip and count leading '1's. + var zeroes = 0; + var length = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; } - setFloat64(byteOffset, value, littleEndian) { - const buf = node_modules_uint8arrays_dist_src_alloc_alloc(8); - const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); - view.setFloat64(0, value, littleEndian); - this.write(buf, byteOffset); + // Allocate enough space in big-endian base256 representation. + var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. + var b256 = new Uint8Array(size); + // Process the characters. + while (source[psz]) { + // Decode character + var carry = BASE_MAP[source.charCodeAt(psz)]; + // Invalid character + if (carry === 255) { return } + var i = 0; + for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { + carry += (BASE * b256[it3]) >>> 0; + b256[it3] = (carry % 256) >>> 0; + carry = (carry / 256) >>> 0; + } + if (carry !== 0) { throw new Error('Non-zero carry') } + length = i; + psz++; } - equals(other) { - if (other == null) { - return false; - } - if (!(other instanceof src_Uint8ArrayList)) { - return false; - } - if (other.bufs.length !== this.bufs.length) { - return false; - } - for (let i = 0; i < this.bufs.length; i++) { - if (!uint8arrays_dist_src_equals_equals(this.bufs[i], other.bufs[i])) { - return false; - } - } - return true; + // Skip trailing spaces. + if (source[psz] === ' ') { return } + // Skip leading zeroes in b256. + var it4 = size - length; + while (it4 !== size && b256[it4] === 0) { + it4++; } - /** - * Create a Uint8ArrayList from a pre-existing list of Uint8Arrays. Use this - * method if you know the total size of all the Uint8Arrays ahead of time. - */ - static fromUint8Arrays(bufs, length) { - const list = new src_Uint8ArrayList(); - list.bufs = bufs; - if (length == null) { - length = bufs.reduce((acc, curr) => acc + curr.byteLength, 0); - } - list.length = length; - return list; + var vch = new Uint8Array(zeroes + (size - it4)); + var j = zeroes; + while (it4 !== size) { + vch[j++] = b256[it4++]; } + return vch + } + function decode (string) { + var buffer = decodeUnsafe(string); + if (buffer) { return buffer } + throw new Error(`Non-${name} character`) + } + return { + encode: encode, + decodeUnsafe: decodeUnsafe, + decode: decode + } +} +var sdk_node_modules_multiformats_vendor_base_x_src = sdk_node_modules_multiformats_vendor_base_x_base; + +var sdk_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = sdk_node_modules_multiformats_vendor_base_x_src; + +/* harmony default export */ const sdk_node_modules_multiformats_vendor_base_x = (sdk_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/multiformats/src/bytes.js +const sdk_node_modules_multiformats_src_bytes_empty = new Uint8Array(0) + +/** + * @param {Uint8Array} d + */ +const sdk_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') + +/** + * @param {string} hex + */ +const sdk_node_modules_multiformats_src_bytes_fromHex = hex => { + const hexes = hex.match(/../g) + return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : sdk_node_modules_multiformats_src_bytes_empty } -/* -function indexOf (needle: Uint8Array, haystack: Uint8Array, offset = 0) { - for (let i = offset; i < haystack.byteLength; i++) { - for (let j = 0; j < needle.length; j++) { - if (haystack[i + j] !== needle[j]) { - break - } - if (j === needle.byteLength -1) { - return i - } - } +/** + * @param {Uint8Array} aa + * @param {Uint8Array} bb + */ +const sdk_node_modules_multiformats_src_bytes_equals = (aa, bb) => { + if (aa === bb) return true + if (aa.byteLength !== bb.byteLength) { + return false + } - if (haystack.byteLength - i < needle.byteLength) { - break + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false } } - return -1 + return true } -*/ -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/chunker/fixed-size.js -const DEFAULT_CHUNK_SIZE = 262144; -const fixedSize = (options = {}) => { - const chunkSize = options.chunkSize ?? DEFAULT_CHUNK_SIZE; - return async function* fixedSizeChunker(source) { - let list = new src_Uint8ArrayList(); - let currentLength = 0; - let emitted = false; - for await (const buffer of source) { - list.append(buffer); - currentLength += buffer.length; - while (currentLength >= chunkSize) { - yield list.slice(0, chunkSize); - emitted = true; - // throw away consumed bytes - if (chunkSize === list.length) { - list = new src_Uint8ArrayList(); - currentLength = 0; - } - else { - const newBl = new src_Uint8ArrayList(); - newBl.append(list.sublist(chunkSize)); - list = newBl; - // update our offset - currentLength -= chunkSize; - } - } - } - if (!emitted || currentLength > 0) { - // return any remaining bytes - yield list.subarray(0, currentLength); - } - }; -}; -//# sourceMappingURL=fixed-size.js.map -;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/utils/float.js -const f32 = new Float32Array([-0]); -const f8b = new Uint8Array(f32.buffer); /** - * Writes a 32 bit float to a buffer using little endian byte order + * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o + * @returns {Uint8Array} */ -function writeFloatLE(val, buf, pos) { - f32[0] = val; - buf[pos] = f8b[0]; - buf[pos + 1] = f8b[1]; - buf[pos + 2] = f8b[2]; - buf[pos + 3] = f8b[3]; +const sdk_node_modules_multiformats_src_bytes_coerce = o => { + if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o + if (o instanceof ArrayBuffer) return new Uint8Array(o) + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) + } + throw new Error('Unknown type, must be binary type') } + /** - * Writes a 32 bit float to a buffer using big endian byte order + * @param {any} o + * @returns {o is ArrayBuffer|ArrayBufferView} */ -function writeFloatBE(val, buf, pos) { - f32[0] = val; - buf[pos] = f8b[3]; - buf[pos + 1] = f8b[2]; - buf[pos + 2] = f8b[1]; - buf[pos + 3] = f8b[0]; -} +const sdk_node_modules_multiformats_src_bytes_isBinary = o => + o instanceof ArrayBuffer || ArrayBuffer.isView(o) + /** - * Reads a 32 bit float from a buffer using little endian byte order + * @param {string} str + * @returns {Uint8Array} */ -function readFloatLE(buf, pos) { - f8b[0] = buf[pos]; - f8b[1] = buf[pos + 1]; - f8b[2] = buf[pos + 2]; - f8b[3] = buf[pos + 3]; - return f32[0]; -} +const sdk_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) + /** - * Reads a 32 bit float from a buffer using big endian byte order + * @param {Uint8Array} b + * @returns {string} */ -function readFloatBE(buf, pos) { - f8b[3] = buf[pos]; - f8b[2] = buf[pos + 1]; - f8b[1] = buf[pos + 2]; - f8b[0] = buf[pos + 3]; - return f32[0]; -} -const f64 = new Float64Array([-0]); -const d8b = new Uint8Array(f64.buffer); +const sdk_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) + + + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/multiformats/src/bases/base.js + + +// Linter can't see that API is used in types. +// eslint-disable-next-line + + /** - * Writes a 64 bit double to a buffer using little endian byte order + * Class represents both BaseEncoder and MultibaseEncoder meaning it + * can be used to encode to multibase or base encode without multibase + * prefix. + * + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseEncoder} + * @implements {API.BaseEncoder} */ -function writeDoubleLE(val, buf, pos) { - f64[0] = val; - buf[pos] = d8b[0]; - buf[pos + 1] = d8b[1]; - buf[pos + 2] = d8b[2]; - buf[pos + 3] = d8b[3]; - buf[pos + 4] = d8b[4]; - buf[pos + 5] = d8b[5]; - buf[pos + 6] = d8b[6]; - buf[pos + 7] = d8b[7]; +class sdk_node_modules_multiformats_src_bases_base_Encoder { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(bytes:Uint8Array) => string} baseEncode + */ + constructor (name, prefix, baseEncode) { + this.name = name + this.prefix = prefix + this.baseEncode = baseEncode + } + + /** + * @param {Uint8Array} bytes + * @returns {API.Multibase} + */ + encode (bytes) { + if (bytes instanceof Uint8Array) { + return `${this.prefix}${this.baseEncode(bytes)}` + } else { + throw Error('Unknown type, must be binary type') + } + } } + /** - * Writes a 64 bit double to a buffer using big endian byte order + * @template {string} Prefix */ -function writeDoubleBE(val, buf, pos) { - f64[0] = val; - buf[pos] = d8b[7]; - buf[pos + 1] = d8b[6]; - buf[pos + 2] = d8b[5]; - buf[pos + 3] = d8b[4]; - buf[pos + 4] = d8b[3]; - buf[pos + 5] = d8b[2]; - buf[pos + 6] = d8b[1]; - buf[pos + 7] = d8b[0]; +/** + * Class represents both BaseDecoder and MultibaseDecoder so it could be used + * to decode multibases (with matching prefix) or just base decode strings + * with corresponding base encoding. + * + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseDecoder} + * @implements {API.UnibaseDecoder} + * @implements {API.BaseDecoder} + */ +class sdk_node_modules_multiformats_src_bases_base_Decoder { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(text:string) => Uint8Array} baseDecode + */ + constructor (name, prefix, baseDecode) { + this.name = name + this.prefix = prefix + /* c8 ignore next 3 */ + if (prefix.codePointAt(0) === undefined) { + throw new Error('Invalid prefix character') + } + /** @private */ + this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0)) + this.baseDecode = baseDecode + } + + /** + * @param {string} text + */ + decode (text) { + if (typeof text === 'string') { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`) + } + return this.baseDecode(text.slice(this.prefix.length)) + } else { + throw Error('Can only multibase decode strings') + } + } + + /** + * @template {string} OtherPrefix + * @param {API.UnibaseDecoder|ComposedDecoder} decoder + * @returns {ComposedDecoder} + */ + or (decoder) { + return sdk_node_modules_multiformats_src_bases_base_or(this, decoder) + } } + /** - * Reads a 64 bit double from a buffer using little endian byte order + * @template {string} Prefix + * @typedef {Record>} Decoders */ -function readDoubleLE(buf, pos) { - d8b[0] = buf[pos]; - d8b[1] = buf[pos + 1]; - d8b[2] = buf[pos + 2]; - d8b[3] = buf[pos + 3]; - d8b[4] = buf[pos + 4]; - d8b[5] = buf[pos + 5]; - d8b[6] = buf[pos + 6]; - d8b[7] = buf[pos + 7]; - return f64[0]; + +/** + * @template {string} Prefix + * @implements {API.MultibaseDecoder} + * @implements {API.CombobaseDecoder} + */ +class sdk_node_modules_multiformats_src_bases_base_ComposedDecoder { + /** + * @param {Decoders} decoders + */ + constructor (decoders) { + this.decoders = decoders + } + + /** + * @template {string} OtherPrefix + * @param {API.UnibaseDecoder|ComposedDecoder} decoder + * @returns {ComposedDecoder} + */ + or (decoder) { + return sdk_node_modules_multiformats_src_bases_base_or(this, decoder) + } + + /** + * @param {string} input + * @returns {Uint8Array} + */ + decode (input) { + const prefix = /** @type {Prefix} */ (input[0]) + const decoder = this.decoders[prefix] + if (decoder) { + return decoder.decode(input) + } else { + throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`) + } + } } + /** - * Reads a 64 bit double from a buffer using big endian byte order + * @template {string} L + * @template {string} R + * @param {API.UnibaseDecoder|API.CombobaseDecoder} left + * @param {API.UnibaseDecoder|API.CombobaseDecoder} right + * @returns {ComposedDecoder} */ -function readDoubleBE(buf, pos) { - d8b[7] = buf[pos]; - d8b[6] = buf[pos + 1]; - d8b[5] = buf[pos + 2]; - d8b[4] = buf[pos + 3]; - d8b[3] = buf[pos + 4]; - d8b[2] = buf[pos + 5]; - d8b[1] = buf[pos + 6]; - d8b[0] = buf[pos + 7]; - return f64[0]; +const sdk_node_modules_multiformats_src_bases_base_or = (left, right) => new sdk_node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({ + ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }), + ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right }) +})) + +/** + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseCodec} + * @implements {API.MultibaseEncoder} + * @implements {API.MultibaseDecoder} + * @implements {API.BaseCodec} + * @implements {API.BaseEncoder} + * @implements {API.BaseDecoder} + */ +class sdk_node_modules_multiformats_src_bases_base_Codec { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(bytes:Uint8Array) => string} baseEncode + * @param {(text:string) => Uint8Array} baseDecode + */ + constructor (name, prefix, baseEncode, baseDecode) { + this.name = name + this.prefix = prefix + this.baseEncode = baseEncode + this.baseDecode = baseDecode + this.encoder = new sdk_node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode) + this.decoder = new sdk_node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode) + } + + /** + * @param {Uint8Array} input + */ + encode (input) { + return this.encoder.encode(input) + } + + /** + * @param {string} input + */ + decode (input) { + return this.decoder.decode(input) + } } -//# sourceMappingURL=float.js.map -;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/utils/longbits.js -// the largest BigInt we can safely downcast to a Number -const MAX_SAFE_NUMBER_INTEGER = BigInt(Number.MAX_SAFE_INTEGER); -const MIN_SAFE_NUMBER_INTEGER = BigInt(Number.MIN_SAFE_INTEGER); + /** - * Constructs new long bits. - * - * @classdesc Helper class for working with the low and high bits of a 64 bit value. - * @memberof util - * @function Object() { [native code] } - * @param {number} lo - Low 32 bits, unsigned - * @param {number} hi - High 32 bits, unsigned + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {(bytes:Uint8Array) => string} options.encode + * @param {(input:string) => Uint8Array} options.decode + * @returns {Codec} */ -class LongBits { - lo; - hi; - constructor(lo, hi) { - // note that the casts below are theoretically unnecessary as of today, but older statically - // generated converter code might still call the ctor with signed 32bits. kept for compat. - /** - * Low bits - */ - this.lo = lo | 0; - /** - * High bits - */ - this.hi = hi | 0; - } - /** - * Converts this long bits to a possibly unsafe JavaScript number - */ - toNumber(unsigned = false) { - if (!unsigned && (this.hi >>> 31) > 0) { - const lo = ~this.lo + 1 >>> 0; - let hi = ~this.hi >>> 0; - if (lo === 0) { - hi = hi + 1 >>> 0; - } - return -(lo + hi * 4294967296); - } - return this.lo + this.hi * 4294967296; - } - /** - * Converts this long bits to a bigint - */ - toBigInt(unsigned = false) { - if (unsigned) { - return BigInt(this.lo >>> 0) + (BigInt(this.hi >>> 0) << 32n); - } - if ((this.hi >>> 31) !== 0) { - const lo = ~this.lo + 1 >>> 0; - let hi = ~this.hi >>> 0; - if (lo === 0) { - hi = hi + 1 >>> 0; - } - return -(BigInt(lo) + (BigInt(hi) << 32n)); - } - return BigInt(this.lo >>> 0) + (BigInt(this.hi >>> 0) << 32n); - } - /** - * Converts this long bits to a string - */ - toString(unsigned = false) { - return this.toBigInt(unsigned).toString(); - } +const sdk_node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) => + new sdk_node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode) + +/** + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {string} options.alphabet + * @returns {Codec} + */ +const sdk_node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => { + const { encode, decode } = sdk_node_modules_multiformats_vendor_base_x(alphabet, name) + return sdk_node_modules_multiformats_src_bases_base_from({ + prefix, + name, + encode, /** - * Zig-zag encodes this long bits + * @param {string} text */ - zzEncode() { - const mask = this.hi >> 31; - this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; - this.lo = (this.lo << 1 ^ mask) >>> 0; - return this; + decode: text => sdk_node_modules_multiformats_src_bytes_coerce(decode(text)) + }) +} + +/** + * @param {string} string + * @param {string} alphabet + * @param {number} bitsPerChar + * @param {string} name + * @returns {Uint8Array} + */ +const sdk_node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { + // Build the character lookup table: + /** @type {Record} */ + const codes = {} + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i + } + + // Count the padding bytes: + let end = string.length + while (string[end - 1] === '=') { + --end + } + + // Allocate the output: + const out = new Uint8Array((end * bitsPerChar / 8) | 0) + + // Parse the data: + let bits = 0 // Number of bits currently in the buffer + let buffer = 0 // Bits waiting to be written out, MSB first + let written = 0 // Next byte to write + for (let i = 0; i < end; ++i) { + // Read one character from the string: + const value = codes[string[i]] + if (value === undefined) { + throw new SyntaxError(`Non-${name} character`) } - /** - * Zig-zag decodes this long bits - */ - zzDecode() { - const mask = -(this.lo & 1); - this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; - this.hi = (this.hi >>> 1 ^ mask) >>> 0; - return this; + + // Append the bits to the buffer: + buffer = (buffer << bitsPerChar) | value + bits += bitsPerChar + + // Write out some bits if the buffer has a byte's worth: + if (bits >= 8) { + bits -= 8 + out[written++] = 0xff & (buffer >> bits) } - /** - * Calculates the length of this longbits when encoded as a varint. - */ - length() { - const part0 = this.lo; - const part1 = (this.lo >>> 28 | this.hi << 4) >>> 0; - const part2 = this.hi >>> 24; - return part2 === 0 - ? part1 === 0 - ? part0 < 16384 - ? part0 < 128 ? 1 : 2 - : part0 < 2097152 ? 3 : 4 - : part1 < 16384 - ? part1 < 128 ? 5 : 6 - : part1 < 2097152 ? 7 : 8 - : part2 < 128 ? 9 : 10; + } + + // Verify that we have received just enough bits: + if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) { + throw new SyntaxError('Unexpected end of data') + } + + return out +} + +/** + * @param {Uint8Array} data + * @param {string} alphabet + * @param {number} bitsPerChar + * @returns {string} + */ +const sdk_node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => { + const pad = alphabet[alphabet.length - 1] === '=' + const mask = (1 << bitsPerChar) - 1 + let out = '' + + let bits = 0 // Number of bits currently in the buffer + let buffer = 0 // Bits waiting to be written out, MSB first + for (let i = 0; i < data.length; ++i) { + // Slurp data into the buffer: + buffer = (buffer << 8) | data[i] + bits += 8 + + // Write out as much as we can: + while (bits > bitsPerChar) { + bits -= bitsPerChar + out += alphabet[mask & (buffer >> bits)] } - /** - * Constructs new long bits from the specified number - */ - static fromBigInt(value) { - if (value === 0n) { - return zero; - } - if (value < MAX_SAFE_NUMBER_INTEGER && value > MIN_SAFE_NUMBER_INTEGER) { - return this.fromNumber(Number(value)); - } - const negative = value < 0n; - if (negative) { - value = -value; - } - let hi = value >> 32n; - let lo = value - (hi << 32n); - if (negative) { - hi = ~hi | 0n; - lo = ~lo | 0n; - if (++lo > TWO_32) { - lo = 0n; - if (++hi > TWO_32) { - hi = 0n; - } - } - } - return new LongBits(Number(lo), Number(hi)); + } + + // Partial character: + if (bits) { + out += alphabet[mask & (buffer << (bitsPerChar - bits))] + } + + // Add padding characters until we hit a byte boundary: + if (pad) { + while ((out.length * bitsPerChar) & 7) { + out += '=' } - /** - * Constructs new long bits from the specified number - */ - static fromNumber(value) { - if (value === 0) { - return zero; - } - const sign = value < 0; - if (sign) { - value = -value; - } - let lo = value >>> 0; - let hi = (value - lo) / 4294967296 >>> 0; - if (sign) { - hi = ~hi >>> 0; - lo = ~lo >>> 0; - if (++lo > 4294967295) { - lo = 0; - if (++hi > 4294967295) { - hi = 0; - } - } - } - return new LongBits(lo, hi); + } + + return out +} + +/** + * RFC4648 Factory + * + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {string} options.alphabet + * @param {number} options.bitsPerChar + */ +const sdk_node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { + return sdk_node_modules_multiformats_src_bases_base_from({ + prefix, + name, + encode (input) { + return sdk_node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar) + }, + decode (input) { + return sdk_node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name) } - /** - * Constructs new long bits from a number, long or string - */ - static from(value) { - if (typeof value === 'number') { - return LongBits.fromNumber(value); - } - if (typeof value === 'bigint') { - return LongBits.fromBigInt(value); - } - if (typeof value === 'string') { - return LongBits.fromBigInt(BigInt(value)); - } - return value.low != null || value.high != null ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; + }) +} + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/multiformats/src/bases/base32.js + + +const sdk_node_modules_multiformats_src_bases_base32_base32 = sdk_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'b', + name: 'base32', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567', + bitsPerChar: 5 +}) + +const sdk_node_modules_multiformats_src_bases_base32_base32upper = sdk_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'B', + name: 'base32upper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', + bitsPerChar: 5 +}) + +const sdk_node_modules_multiformats_src_bases_base32_base32pad = sdk_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'c', + name: 'base32pad', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', + bitsPerChar: 5 +}) + +const sdk_node_modules_multiformats_src_bases_base32_base32padupper = sdk_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'C', + name: 'base32padupper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', + bitsPerChar: 5 +}) + +const sdk_node_modules_multiformats_src_bases_base32_base32hex = sdk_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'v', + name: 'base32hex', + alphabet: '0123456789abcdefghijklmnopqrstuv', + bitsPerChar: 5 +}) + +const sdk_node_modules_multiformats_src_bases_base32_base32hexupper = sdk_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'V', + name: 'base32hexupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', + bitsPerChar: 5 +}) + +const sdk_node_modules_multiformats_src_bases_base32_base32hexpad = sdk_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 't', + name: 'base32hexpad', + alphabet: '0123456789abcdefghijklmnopqrstuv=', + bitsPerChar: 5 +}) + +const sdk_node_modules_multiformats_src_bases_base32_base32hexpadupper = sdk_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'T', + name: 'base32hexpadupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', + bitsPerChar: 5 +}) + +const sdk_node_modules_multiformats_src_bases_base32_base32z = sdk_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'h', + name: 'base32z', + alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', + bitsPerChar: 5 +}) + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/multiformats/src/bases/base58.js + + +const sdk_node_modules_multiformats_src_bases_base58_base58btc = sdk_node_modules_multiformats_src_bases_base_baseX({ + name: 'base58btc', + prefix: 'z', + alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +}) + +const sdk_node_modules_multiformats_src_bases_base58_base58flickr = sdk_node_modules_multiformats_src_bases_base_baseX({ + name: 'base58flickr', + prefix: 'Z', + alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' +}) + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/multiformats/vendor/varint.js +var sdk_node_modules_multiformats_vendor_varint_encode_1 = sdk_node_modules_multiformats_vendor_varint_encode; + +var sdk_node_modules_multiformats_vendor_varint_MSB = 0x80 + , sdk_node_modules_multiformats_vendor_varint_REST = 0x7F + , sdk_node_modules_multiformats_vendor_varint_MSBALL = ~sdk_node_modules_multiformats_vendor_varint_REST + , sdk_node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31); + +function sdk_node_modules_multiformats_vendor_varint_encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; + + while(num >= sdk_node_modules_multiformats_vendor_varint_INT) { + out[offset++] = (num & 0xFF) | sdk_node_modules_multiformats_vendor_varint_MSB; + num /= 128; + } + while(num & sdk_node_modules_multiformats_vendor_varint_MSBALL) { + out[offset++] = (num & 0xFF) | sdk_node_modules_multiformats_vendor_varint_MSB; + num >>>= 7; + } + out[offset] = num | 0; + + sdk_node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; + + return out +} + +var sdk_node_modules_multiformats_vendor_varint_decode = sdk_node_modules_multiformats_vendor_varint_read; + +var sdk_node_modules_multiformats_vendor_varint_MSB$1 = 0x80 + , sdk_node_modules_multiformats_vendor_varint_REST$1 = 0x7F; + +function sdk_node_modules_multiformats_vendor_varint_read(buf, offset) { + var res = 0 + , offset = offset || 0 + , shift = 0 + , counter = offset + , b + , l = buf.length; + + do { + if (counter >= l) { + sdk_node_modules_multiformats_vendor_varint_read.bytes = 0; + throw new RangeError('Could not decode varint') } + b = buf[counter++]; + res += shift < 28 + ? (b & sdk_node_modules_multiformats_vendor_varint_REST$1) << shift + : (b & sdk_node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= sdk_node_modules_multiformats_vendor_varint_MSB$1) + + sdk_node_modules_multiformats_vendor_varint_read.bytes = counter - offset; + + return res } -const zero = new LongBits(0, 0); -zero.toBigInt = function () { return 0n; }; -zero.zzEncode = zero.zzDecode = function () { return this; }; -zero.length = function () { return 1; }; -const TWO_32 = 4294967296n; -//# sourceMappingURL=longbits.js.map -;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/utils/utf8.js + +var sdk_node_modules_multiformats_vendor_varint_N1 = Math.pow(2, 7); +var sdk_node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14); +var sdk_node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21); +var sdk_node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28); +var sdk_node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35); +var sdk_node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42); +var sdk_node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49); +var sdk_node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56); +var sdk_node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63); + +var sdk_node_modules_multiformats_vendor_varint_length = function (value) { + return ( + value < sdk_node_modules_multiformats_vendor_varint_N1 ? 1 + : value < sdk_node_modules_multiformats_vendor_varint_N2 ? 2 + : value < sdk_node_modules_multiformats_vendor_varint_N3 ? 3 + : value < sdk_node_modules_multiformats_vendor_varint_N4 ? 4 + : value < sdk_node_modules_multiformats_vendor_varint_N5 ? 5 + : value < sdk_node_modules_multiformats_vendor_varint_N6 ? 6 + : value < sdk_node_modules_multiformats_vendor_varint_N7 ? 7 + : value < sdk_node_modules_multiformats_vendor_varint_N8 ? 8 + : value < sdk_node_modules_multiformats_vendor_varint_N9 ? 9 + : 10 + ) +}; + +var sdk_node_modules_multiformats_vendor_varint_varint = { + encode: sdk_node_modules_multiformats_vendor_varint_encode_1 + , decode: sdk_node_modules_multiformats_vendor_varint_decode + , encodingLength: sdk_node_modules_multiformats_vendor_varint_length +}; + +var sdk_node_modules_multiformats_vendor_varint_brrp_varint = sdk_node_modules_multiformats_vendor_varint_varint; + +/* harmony default export */ const sdk_node_modules_multiformats_vendor_varint = (sdk_node_modules_multiformats_vendor_varint_brrp_varint); + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/multiformats/src/varint.js + + /** - * Calculates the UTF8 byte length of a string + * @param {Uint8Array} data + * @param {number} [offset=0] + * @returns {[number, number]} */ -function utf8_length(string) { - let len = 0; - let c = 0; - for (let i = 0; i < string.length; ++i) { - c = string.charCodeAt(i); - if (c < 128) { - len += 1; - } - else if (c < 2048) { - len += 2; - } - else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { - ++i; - len += 4; - } - else { - len += 3; - } - } - return len; +const sdk_node_modules_multiformats_src_varint_decode = (data, offset = 0) => { + const code = sdk_node_modules_multiformats_vendor_varint.decode(data, offset) + return [code, sdk_node_modules_multiformats_vendor_varint.decode.bytes] } + /** - * Reads UTF8 bytes as a string + * @param {number} int + * @param {Uint8Array} target + * @param {number} [offset=0] */ -function utf8_read(buffer, start, end) { - const len = end - start; - if (len < 1) { - return ''; - } - let parts; - const chunk = []; - let i = 0; // char offset - let t; // temporary - while (start < end) { - t = buffer[start++]; - if (t < 128) { - chunk[i++] = t; - } - else if (t > 191 && t < 224) { - chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; - } - else if (t > 239 && t < 365) { - t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; - chunk[i++] = 0xD800 + (t >> 10); - chunk[i++] = 0xDC00 + (t & 1023); - } - else { - chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; - } - if (i > 8191) { - (parts ?? (parts = [])).push(String.fromCharCode.apply(String, chunk)); - i = 0; - } - } - if (parts != null) { - if (i > 0) { - parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); - } - return parts.join(''); - } - return String.fromCharCode.apply(String, chunk.slice(0, i)); +const sdk_node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => { + sdk_node_modules_multiformats_vendor_varint.encode(int, target, offset) + return target +} + +/** + * @param {number} int + * @returns {number} + */ +const sdk_node_modules_multiformats_src_varint_encodingLength = (int) => { + return sdk_node_modules_multiformats_vendor_varint.encodingLength(int) +} + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/multiformats/src/hashes/digest.js + + + +/** + * Creates a multihash digest. + * + * @template {number} Code + * @param {Code} code + * @param {Uint8Array} digest + */ +const sdk_node_modules_multiformats_src_hashes_digest_create = (code, digest) => { + const size = digest.byteLength + const sizeOffset = sdk_node_modules_multiformats_src_varint_encodingLength(code) + const digestOffset = sizeOffset + sdk_node_modules_multiformats_src_varint_encodingLength(size) + + const bytes = new Uint8Array(digestOffset + size) + sdk_node_modules_multiformats_src_varint_encodeTo(code, bytes, 0) + sdk_node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset) + bytes.set(digest, digestOffset) + + return new sdk_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) +} + +/** + * Turns bytes representation of multihash digest into an instance. + * + * @param {Uint8Array} multihash + * @returns {MultihashDigest} + */ +const sdk_node_modules_multiformats_src_hashes_digest_decode = (multihash) => { + const bytes = sdk_node_modules_multiformats_src_bytes_coerce(multihash) + const [code, sizeOffset] = sdk_node_modules_multiformats_src_varint_decode(bytes) + const [size, digestOffset] = sdk_node_modules_multiformats_src_varint_decode(bytes.subarray(sizeOffset)) + const digest = bytes.subarray(sizeOffset + digestOffset) + + if (digest.byteLength !== size) { + throw new Error('Incorrect length') + } + + return new sdk_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) +} + +/** + * @param {MultihashDigest} a + * @param {unknown} b + * @returns {b is MultihashDigest} + */ +const sdk_node_modules_multiformats_src_hashes_digest_equals = (a, b) => { + if (a === b) { + return true + } else { + const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) + + return ( + a.code === data.code && + a.size === data.size && + data.bytes instanceof Uint8Array && + sdk_node_modules_multiformats_src_bytes_equals(a.bytes, data.bytes) + ) + } +} + +/** + * @typedef {import('./interface.js').MultihashDigest} MultihashDigest + */ + +/** + * Represents a multihash digest which carries information about the + * hashing algorithm and an actual hash digest. + * + * @template {number} Code + * @template {number} Size + * @class + * @implements {MultihashDigest} + */ +class sdk_node_modules_multiformats_src_hashes_digest_Digest { + /** + * Creates a multihash digest. + * + * @param {Code} code + * @param {Size} size + * @param {Uint8Array} digest + * @param {Uint8Array} bytes + */ + constructor (code, size, digest, bytes) { + this.code = code + this.size = size + this.digest = digest + this.bytes = bytes + } } + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/multiformats/src/cid.js + + + + +// Linter can see that API is used in types. +// eslint-disable-next-line + + + +// This way TS will also expose all the types from module + + /** - * Writes a string as UTF8 bytes + * @template {API.Link} T + * @template {string} Prefix + * @param {T} link + * @param {API.MultibaseEncoder} [base] + * @returns {API.ToString} */ -function write(string, buffer, offset) { - const start = offset; - let c1; // character 1 - let c2; // character 2 - for (let i = 0; i < string.length; ++i) { - c1 = string.charCodeAt(i); - if (c1 < 128) { - buffer[offset++] = c1; - } - else if (c1 < 2048) { - buffer[offset++] = c1 >> 6 | 192; - buffer[offset++] = c1 & 63 | 128; - } - else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { - c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); - ++i; - buffer[offset++] = c1 >> 18 | 240; - buffer[offset++] = c1 >> 12 & 63 | 128; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } - else { - buffer[offset++] = c1 >> 12 | 224; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } - } - return offset - start; +const sdk_node_modules_multiformats_src_cid_format = (link, base) => { + const { bytes, version } = link + switch (version) { + case 0: + return sdk_node_modules_multiformats_src_cid_toStringV0( + bytes, + sdk_node_modules_multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder<"z">} */ (base) || sdk_node_modules_multiformats_src_bases_base58_base58btc.encoder + ) + default: + return sdk_node_modules_multiformats_src_cid_toStringV1( + bytes, + sdk_node_modules_multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder} */ (base || sdk_node_modules_multiformats_src_bases_base32_base32.encoder) + ) + } } -//# sourceMappingURL=utf8.js.map -;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/utils/reader.js +/** + * @template {API.UnknownLink} Link + * @param {Link} link + * @returns {API.LinkJSON} + */ +const sdk_node_modules_multiformats_src_cid_toJSON = (link) => ({ + '/': sdk_node_modules_multiformats_src_cid_format(link) +}) + +/** + * @template {API.UnknownLink} Link + * @param {API.LinkJSON} json + */ +const sdk_node_modules_multiformats_src_cid_fromJSON = (json) => + sdk_node_modules_multiformats_src_cid_CID.parse(json['/']) +/** @type {WeakMap>} */ +const sdk_node_modules_multiformats_src_cid_cache = new WeakMap() -/* istanbul ignore next */ -function indexOutOfRange(reader, writeLength) { - return RangeError(`index out of range: ${reader.pos} + ${writeLength ?? 1} > ${reader.len}`); -} -function readFixed32End(buf, end) { - return (buf[end - 4] | - buf[end - 3] << 8 | - buf[end - 2] << 16 | - buf[end - 1] << 24) >>> 0; +/** + * @param {API.UnknownLink} cid + * @returns {Map} + */ +const sdk_node_modules_multiformats_src_cid_baseCache = cid => { + const baseCache = sdk_node_modules_multiformats_src_cid_cache.get(cid) + if (baseCache == null) { + const baseCache = new Map() + sdk_node_modules_multiformats_src_cid_cache.set(cid, baseCache) + return baseCache + } + return baseCache } + /** - * Constructs a new reader instance using the specified buffer. + * @template {unknown} [Data=unknown] + * @template {number} [Format=number] + * @template {number} [Alg=number] + * @template {API.Version} [Version=API.Version] + * @implements {API.Link} */ -class Uint8ArrayReader { - buf; - pos; - len; - _slice = Uint8Array.prototype.subarray; - constructor(buffer) { - /** - * Read buffer - */ - this.buf = buffer; - /** - * Read buffer position - */ - this.pos = 0; - /** - * Read buffer length - */ - this.len = buffer.length; - } - /** - * Reads a varint as an unsigned 32 bit value - */ - uint32() { - let value = 4294967295; - value = (this.buf[this.pos] & 127) >>> 0; - if (this.buf[this.pos++] < 128) - return value; - value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; - if (this.buf[this.pos++] < 128) - return value; - value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; - if (this.buf[this.pos++] < 128) - return value; - value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; - if (this.buf[this.pos++] < 128) - return value; - value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; - if (this.buf[this.pos++] < 128) - return value; - if ((this.pos += 5) > this.len) { - this.pos = this.len; - throw indexOutOfRange(this, 10); - } - return value; - } - /** - * Reads a varint as a signed 32 bit value - */ - int32() { - return this.uint32() | 0; - } - /** - * Reads a zig-zag encoded varint as a signed 32 bit value - */ - sint32() { - const value = this.uint32(); - return value >>> 1 ^ -(value & 1) | 0; - } - /** - * Reads a varint as a boolean - */ - bool() { - return this.uint32() !== 0; - } - /** - * Reads fixed 32 bits as an unsigned 32 bit integer - */ - fixed32() { - if (this.pos + 4 > this.len) { - throw indexOutOfRange(this, 4); - } - const res = readFixed32End(this.buf, this.pos += 4); - return res; - } - /** - * Reads fixed 32 bits as a signed 32 bit integer - */ - sfixed32() { - if (this.pos + 4 > this.len) { - throw indexOutOfRange(this, 4); - } - const res = readFixed32End(this.buf, this.pos += 4) | 0; - return res; - } - /** - * Reads a float (32 bit) as a number - */ - float() { - if (this.pos + 4 > this.len) { - throw indexOutOfRange(this, 4); + +class sdk_node_modules_multiformats_src_cid_CID { + /** + * @param {Version} version - Version of the CID + * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content. + * @param {Uint8Array} bytes + */ + constructor (version, code, multihash, bytes) { + /** @readonly */ + this.code = code + /** @readonly */ + this.version = version + /** @readonly */ + this.multihash = multihash + /** @readonly */ + this.bytes = bytes + + // flag to serializers that this is a CID and + // should be treated specially + /** @readonly */ + this['/'] = bytes + } + + /** + * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` + * please either use `CID.asCID(cid)` or switch to new signalling mechanism + * + * @deprecated + */ + get asCID () { + return this + } + + // ArrayBufferView + get byteOffset () { + return this.bytes.byteOffset + } + + // ArrayBufferView + get byteLength () { + return this.bytes.byteLength + } + + /** + * @returns {CID} + */ + toV0 () { + switch (this.version) { + case 0: { + return /** @type {CID} */ (this) + } + case 1: { + const { code, multihash } = this + + if (code !== sdk_node_modules_multiformats_src_cid_DAG_PB_CODE) { + throw new Error('Cannot convert a non dag-pb CID to CIDv0') } - const value = readFloatLE(this.buf, this.pos); - this.pos += 4; - return value; - } - /** - * Reads a double (64 bit float) as a number - */ - double() { - /* istanbul ignore if */ - if (this.pos + 8 > this.len) { - throw indexOutOfRange(this, 4); + + // sha2-256 + if (multihash.code !== sdk_node_modules_multiformats_src_cid_SHA_256_CODE) { + throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') } - const value = readDoubleLE(this.buf, this.pos); - this.pos += 8; - return value; + + return /** @type {CID} */ ( + sdk_node_modules_multiformats_src_cid_CID.createV0( + /** @type {API.MultihashDigest} */ (multihash) + ) + ) + } + default: { + throw Error( + `Can not convert CID version ${this.version} to version 0. This is a bug please report` + ) + } } - /** - * Reads a sequence of bytes preceded by its length as a varint - */ - bytes() { - const length = this.uint32(); - const start = this.pos; - const end = this.pos + length; - /* istanbul ignore if */ - if (end > this.len) { - throw indexOutOfRange(this, length); - } - this.pos += length; - return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 - ? new Uint8Array(0) - : this.buf.subarray(start, end); + } + + /** + * @returns {CID} + */ + toV1 () { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash + const multihash = sdk_node_modules_multiformats_src_hashes_digest_create(code, digest) + return /** @type {CID} */ ( + sdk_node_modules_multiformats_src_cid_CID.createV1(this.code, multihash) + ) + } + case 1: { + return /** @type {CID} */ (this) + } + default: { + throw Error( + `Can not convert CID version ${this.version} to version 1. This is a bug please report` + ) + } } - /** - * Reads a string preceded by its byte length as a varint - */ - string() { - const bytes = this.bytes(); - return utf8_read(bytes, 0, bytes.length); + } + + /** + * @param {unknown} other + * @returns {other is CID} + */ + equals (other) { + return sdk_node_modules_multiformats_src_cid_CID.equals(this, other) + } + + /** + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @param {API.Link} self + * @param {unknown} other + * @returns {other is CID} + */ + static equals (self, other) { + const unknown = + /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ ( + other + ) + return ( + unknown && + self.code === unknown.code && + self.version === unknown.version && + sdk_node_modules_multiformats_src_hashes_digest_equals(self.multihash, unknown.multihash) + ) + } + + /** + * @param {API.MultibaseEncoder} [base] + * @returns {string} + */ + toString (base) { + return sdk_node_modules_multiformats_src_cid_format(this, base) + } + + /** + * @returns {API.LinkJSON} + */ + toJSON () { + return { '/': sdk_node_modules_multiformats_src_cid_format(this) } + } + + link () { + return this + } + + get [Symbol.toStringTag] () { + return 'CID' + } + + // Legacy + + [Symbol.for('nodejs.util.inspect.custom')] () { + return `CID(${this.toString()})` + } + + /** + * Takes any input `value` and returns a `CID` instance if it was + * a `CID` otherwise returns `null`. If `value` is instanceof `CID` + * it will return value back. If `value` is not instance of this CID + * class, but is compatible CID it will return new instance of this + * `CID` class. Otherwise returns null. + * + * This allows two different incompatible versions of CID library to + * co-exist and interop as long as binary interface is compatible. + * + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @template {unknown} U + * @param {API.Link|U} input + * @returns {CID|null} + */ + static asCID (input) { + if (input == null) { + return null } - /** - * Skips the specified number of bytes if specified, otherwise skips a varint - */ - skip(length) { - if (typeof length === 'number') { - /* istanbul ignore if */ - if (this.pos + length > this.len) { - throw indexOutOfRange(this, length); - } - this.pos += length; - } - else { - do { - /* istanbul ignore if */ - if (this.pos >= this.len) { - throw indexOutOfRange(this); - } - } while ((this.buf[this.pos++] & 128) !== 0); - } - return this; + + const value = /** @type {any} */ (input) + if (value instanceof sdk_node_modules_multiformats_src_cid_CID) { + // If value is instance of CID then we're all set. + return value + } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { + // If value isn't instance of this CID class but `this.asCID === this` or + // `value['/'] === value.bytes` is true it is CID instance coming from a + // different implementation (diff version or duplicate). In that case we + // rebase it to this `CID` implementation so caller is guaranteed to get + // instance with expected API. + const { version, code, multihash, bytes } = value + return new sdk_node_modules_multiformats_src_cid_CID( + version, + code, + /** @type {API.MultihashDigest} */ (multihash), + bytes || sdk_node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes) + ) + } else if (value[sdk_node_modules_multiformats_src_cid_cidSymbol] === true) { + // If value is a CID from older implementation that used to be tagged via + // symbol we still rebase it to the this `CID` implementation by + // delegating that to a constructor. + const { version, multihash, code } = value + const digest = + /** @type {API.MultihashDigest} */ + (sdk_node_modules_multiformats_src_hashes_digest_decode(multihash)) + return sdk_node_modules_multiformats_src_cid_CID.create(version, code, digest) + } else { + // Otherwise value is not a CID (or an incompatible version of it) in + // which case we return `null`. + return null } - /** - * Skips the next element of the specified wire type - */ - skipType(wireType) { - switch (wireType) { - case 0: - this.skip(); - break; - case 1: - this.skip(8); - break; - case 2: - this.skip(this.uint32()); - break; - case 3: - while ((wireType = this.uint32() & 7) !== 4) { - this.skipType(wireType); - } - break; - case 5: - this.skip(4); - break; - /* istanbul ignore next */ - default: - throw Error(`invalid wire type ${wireType} at offset ${this.pos}`); - } - return this; + } + + /** + * + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @param {Version} version - Version of the CID + * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param {API.MultihashDigest} digest - (Multi)hash of the of the content. + * @returns {CID} + */ + static create (version, code, digest) { + if (typeof code !== 'number') { + throw new Error('String codecs are no longer supported') } - readLongVarint() { - // tends to deopt with local vars for octet etc. - const bits = new LongBits(0, 0); - let i = 0; - if (this.len - this.pos > 4) { // fast route (lo) - for (; i < 4; ++i) { - // 1st..4th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) { - return bits; - } - } - // 5th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; - bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; - if (this.buf[this.pos++] < 128) { - return bits; - } - i = 0; - } - else { - for (; i < 3; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) { - throw indexOutOfRange(this); - } - // 1st..3th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) { - return bits; - } - } - // 4th - bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; - return bits; - } - if (this.len - this.pos > 4) { // fast route (hi) - for (; i < 5; ++i) { - // 6th..10th - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) { - return bits; - } - } - } - else { - for (; i < 5; ++i) { - if (this.pos >= this.len) { - throw indexOutOfRange(this); - } - // 6th..10th - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) { - return bits; - } - } - } - throw Error('invalid varint encoding'); + + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error('Invalid digest') } - readFixed64() { - if (this.pos + 8 > this.len) { - throw indexOutOfRange(this, 8); + + switch (version) { + case 0: { + if (code !== sdk_node_modules_multiformats_src_cid_DAG_PB_CODE) { + throw new Error( + `Version 0 CID must use dag-pb (code: ${sdk_node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding` + ) + } else { + return new sdk_node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes) } - const lo = readFixed32End(this.buf, this.pos += 4); - const hi = readFixed32End(this.buf, this.pos += 4); - return new LongBits(lo, hi); - } - /** - * Reads a varint as a signed 64 bit value - */ - int64() { - return this.readLongVarint().toBigInt(); - } - /** - * Reads a varint as a signed 64 bit value returned as a possibly unsafe - * JavaScript number - */ - int64Number() { - return this.readLongVarint().toNumber(); - } - /** - * Reads a varint as a signed 64 bit value returned as a string - */ - int64String() { - return this.readLongVarint().toString(); - } - /** - * Reads a varint as an unsigned 64 bit value - */ - uint64() { - return this.readLongVarint().toBigInt(true); - } - /** - * Reads a varint as an unsigned 64 bit value returned as a possibly unsafe - * JavaScript number - */ - uint64Number() { - return this.readLongVarint().toNumber(true); - } - /** - * Reads a varint as an unsigned 64 bit value returned as a string - */ - uint64String() { - return this.readLongVarint().toString(true); - } - /** - * Reads a zig-zag encoded varint as a signed 64 bit value - */ - sint64() { - return this.readLongVarint().zzDecode().toBigInt(); - } - /** - * Reads a zig-zag encoded varint as a signed 64 bit value returned as a - * possibly unsafe JavaScript number - */ - sint64Number() { - return this.readLongVarint().zzDecode().toNumber(); - } - /** - * Reads a zig-zag encoded varint as a signed 64 bit value returned as a - * string - */ - sint64String() { - return this.readLongVarint().zzDecode().toString(); - } - /** - * Reads fixed 64 bits - */ - fixed64() { - return this.readFixed64().toBigInt(); - } - /** - * Reads fixed 64 bits returned as a possibly unsafe JavaScript number - */ - fixed64Number() { - return this.readFixed64().toNumber(); + } + case 1: { + const bytes = sdk_node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes) + return new sdk_node_modules_multiformats_src_cid_CID(version, code, digest, bytes) + } + default: { + throw new Error('Invalid version') + } } - /** - * Reads fixed 64 bits returned as a string - */ - fixed64String() { - return this.readFixed64().toString(); + } + + /** + * Simplified version of `create` for CIDv0. + * + * @template {unknown} [T=unknown] + * @param {API.MultihashDigest} digest - Multihash. + * @returns {CID} + */ + static createV0 (digest) { + return sdk_node_modules_multiformats_src_cid_CID.create(0, sdk_node_modules_multiformats_src_cid_DAG_PB_CODE, digest) + } + + /** + * Simplified version of `create` for CIDv1. + * + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @param {Code} code - Content encoding format code. + * @param {API.MultihashDigest} digest - Miltihash of the content. + * @returns {CID} + */ + static createV1 (code, digest) { + return sdk_node_modules_multiformats_src_cid_CID.create(1, code, digest) + } + + /** + * Decoded a CID from its binary representation. The byte array must contain + * only the CID with no additional bytes. + * + * An error will be thrown if the bytes provided do not contain a valid + * binary representation of a CID. + * + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ByteView>} bytes + * @returns {CID} + */ + static decode (bytes) { + const [cid, remainder] = sdk_node_modules_multiformats_src_cid_CID.decodeFirst(bytes) + if (remainder.length) { + throw new Error('Incorrect length') } - /** - * Reads zig-zag encoded fixed 64 bits - */ - sfixed64() { - return this.readFixed64().toBigInt(); + return cid + } + + /** + * Decoded a CID from its binary representation at the beginning of a byte + * array. + * + * Returns an array with the first element containing the CID and the second + * element containing the remainder of the original byte array. The remainder + * will be a zero-length byte array if the provided bytes only contained a + * binary CID representation. + * + * @template {unknown} T + * @template {number} C + * @template {number} A + * @template {API.Version} V + * @param {API.ByteView>} bytes + * @returns {[CID, Uint8Array]} + */ + static decodeFirst (bytes) { + const specs = sdk_node_modules_multiformats_src_cid_CID.inspectBytes(bytes) + const prefixSize = specs.size - specs.multihashSize + const multihashBytes = sdk_node_modules_multiformats_src_bytes_coerce( + bytes.subarray(prefixSize, prefixSize + specs.multihashSize) + ) + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error('Incorrect length') } - /** - * Reads zig-zag encoded fixed 64 bits returned as a possibly unsafe - * JavaScript number - */ - sfixed64Number() { - return this.readFixed64().toNumber(); + const digestBytes = multihashBytes.subarray( + specs.multihashSize - specs.digestSize + ) + const digest = new sdk_node_modules_multiformats_src_hashes_digest_Digest( + specs.multihashCode, + specs.digestSize, + digestBytes, + multihashBytes + ) + const cid = + specs.version === 0 + ? sdk_node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) + : sdk_node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest) + return [/** @type {CID} */(cid), bytes.subarray(specs.size)] + } + + /** + * Inspect the initial bytes of a CID to determine its properties. + * + * Involves decoding up to 4 varints. Typically this will require only 4 to 6 + * bytes but for larger multicodec code values and larger multihash digest + * lengths these varints can be quite large. It is recommended that at least + * 10 bytes be made available in the `initialBytes` argument for a complete + * inspection. + * + * @template {unknown} T + * @template {number} C + * @template {number} A + * @template {API.Version} V + * @param {API.ByteView>} initialBytes + * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }} + */ + static inspectBytes (initialBytes) { + let offset = 0 + const next = () => { + const [i, length] = sdk_node_modules_multiformats_src_varint_decode(initialBytes.subarray(offset)) + offset += length + return i } - /** - * Reads zig-zag encoded fixed 64 bits returned as a string - */ - sfixed64String() { - return this.readFixed64().toString(); + + let version = /** @type {V} */ (next()) + let codec = /** @type {C} */ (sdk_node_modules_multiformats_src_cid_DAG_PB_CODE) + if (/** @type {number} */(version) === 18) { + // CIDv0 + version = /** @type {V} */ (0) + offset = 0 + } else { + codec = /** @type {C} */ (next()) } -} -function createReader(buf) { - return new Uint8ArrayReader(buf instanceof Uint8Array ? buf : buf.subarray()); -} -//# sourceMappingURL=reader.js.map -;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/decode.js -function decodeMessage(buf, codec) { - const reader = createReader(buf); - return codec.decode(reader); -} -//# sourceMappingURL=decode.js.map -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/uint8arrays/dist/src/util/as-uint8array.js -/** - * To guarantee Uint8Array semantics, convert nodejs Buffers - * into vanilla Uint8Arrays - */ -function node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(buf) { - if (globalThis.Buffer != null) { - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`) } - return buf; -} -//# sourceMappingURL=as-uint8array.js.map -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/uint8arrays/dist/src/alloc.js -/** - * Returns a `Uint8Array` of the requested size. Referenced memory will - * be initialized to 0. - */ -function protons_runtime_node_modules_uint8arrays_dist_src_alloc_alloc(size = 0) { - if (globalThis.Buffer?.alloc != null) { - return asUint8Array(globalThis.Buffer.alloc(size)); + const prefixSize = offset + const multihashCode = /** @type {A} */ (next()) // multihash code + const digestSize = next() // multihash length + const size = offset + digestSize + const multihashSize = size - prefixSize + + return { version, codec, multihashCode, digestSize, multihashSize, size } + } + + /** + * Takes cid in a string representation and creates an instance. If `base` + * decoder is not provided will use a default from the configuration. It will + * throw an error if encoding of the CID is not compatible with supplied (or + * a default decoder). + * + * @template {string} Prefix + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ToString, Prefix>} source + * @param {API.MultibaseDecoder} [base] + * @returns {CID} + */ + static parse (source, base) { + const [prefix, bytes] = sdk_node_modules_multiformats_src_cid_parseCIDtoBytes(source, base) + + const cid = sdk_node_modules_multiformats_src_cid_CID.decode(bytes) + + if (cid.version === 0 && source[0] !== 'Q') { + throw Error('Version 0 CID string must not include multibase prefix') } - return new Uint8Array(size); + + // Cache string representation to avoid computing it on `this.toString()` + sdk_node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source) + + return cid + } } + /** - * Where possible returns a Uint8Array of the requested size that references - * uninitialized memory. Only use if you are certain you will immediately - * overwrite every value in the returned `Uint8Array`. + * @template {string} Prefix + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ToString, Prefix>} source + * @param {API.MultibaseDecoder} [base] + * @returns {[Prefix, API.ByteView>]} */ -function node_modules_uint8arrays_dist_src_alloc_allocUnsafe(size = 0) { - if (globalThis.Buffer?.allocUnsafe != null) { - return node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.allocUnsafe(size)); - } - return new Uint8Array(size); -} -//# sourceMappingURL=alloc.js.map -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/vendor/base-x.js -// base-x encoding / decoding -// Copyright (c) 2018 base-x contributors -// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) -// Distributed under the MIT software license, see the accompanying -// file LICENSE or http://www.opensource.org/licenses/mit-license.php. -function protons_runtime_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { - if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } - var BASE_MAP = new Uint8Array(256); - for (var j = 0; j < BASE_MAP.length; j++) { - BASE_MAP[j] = 255; - } - for (var i = 0; i < ALPHABET.length; i++) { - var x = ALPHABET.charAt(i); - var xc = x.charCodeAt(0); - if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') } - BASE_MAP[xc] = i; - } - var BASE = ALPHABET.length; - var LEADER = ALPHABET.charAt(0); - var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up - var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up - function encode (source) { - if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) { - source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); - } else if (Array.isArray(source)) { - source = Uint8Array.from(source); - } - if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') } - if (source.length === 0) { return '' } - // Skip & count leading zeroes. - var zeroes = 0; - var length = 0; - var pbegin = 0; - var pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; - } - // Allocate enough space in big-endian base58 representation. - var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; - var b58 = new Uint8Array(size); - // Process the bytes. - while (pbegin !== pend) { - var carry = source[pbegin]; - // Apply "b58 = b58 * 256 + ch". - var i = 0; - for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { - carry += (256 * b58[it1]) >>> 0; - b58[it1] = (carry % BASE) >>> 0; - carry = (carry / BASE) >>> 0; - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - pbegin++; +const sdk_node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => { + switch (source[0]) { + // CIDv0 is parsed differently + case 'Q': { + const decoder = base || sdk_node_modules_multiformats_src_bases_base58_base58btc + return [ + /** @type {Prefix} */ (sdk_node_modules_multiformats_src_bases_base58_base58btc.prefix), + decoder.decode(`${sdk_node_modules_multiformats_src_bases_base58_base58btc.prefix}${source}`) + ] } - // Skip leading zeroes in base58 result. - var it2 = size - length; - while (it2 !== size && b58[it2] === 0) { - it2++; + case sdk_node_modules_multiformats_src_bases_base58_base58btc.prefix: { + const decoder = base || sdk_node_modules_multiformats_src_bases_base58_base58btc + return [/** @type {Prefix} */(sdk_node_modules_multiformats_src_bases_base58_base58btc.prefix), decoder.decode(source)] } - // Translate the result into a string. - var str = LEADER.repeat(zeroes); - for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); } - return str - } - function decodeUnsafe (source) { - if (typeof source !== 'string') { throw new TypeError('Expected String') } - if (source.length === 0) { return new Uint8Array() } - var psz = 0; - // Skip leading spaces. - if (source[psz] === ' ') { return } - // Skip and count leading '1's. - var zeroes = 0; - var length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; + case sdk_node_modules_multiformats_src_bases_base32_base32.prefix: { + const decoder = base || sdk_node_modules_multiformats_src_bases_base32_base32 + return [/** @type {Prefix} */(sdk_node_modules_multiformats_src_bases_base32_base32.prefix), decoder.decode(source)] } - // Allocate enough space in big-endian base256 representation. - var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. - var b256 = new Uint8Array(size); - // Process the characters. - while (source[psz]) { - // Decode character - var carry = BASE_MAP[source.charCodeAt(psz)]; - // Invalid character - if (carry === 255) { return } - var i = 0; - for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { - carry += (BASE * b256[it3]) >>> 0; - b256[it3] = (carry % 256) >>> 0; - carry = (carry / 256) >>> 0; + default: { + if (base == null) { + throw Error( + 'To parse non base32 or base58btc encoded CID multibase decoder must be provided' + ) } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - psz++; - } - // Skip trailing spaces. - if (source[psz] === ' ') { return } - // Skip leading zeroes in b256. - var it4 = size - length; - while (it4 !== size && b256[it4] === 0) { - it4++; - } - var vch = new Uint8Array(zeroes + (size - it4)); - var j = zeroes; - while (it4 !== size) { - vch[j++] = b256[it4++]; + return [/** @type {Prefix} */(source[0]), base.decode(source)] } - return vch - } - function decode (string) { - var buffer = decodeUnsafe(string); - if (buffer) { return buffer } - throw new Error(`Non-${name} character`) - } - return { - encode: encode, - decodeUnsafe: decodeUnsafe, - decode: decode } } -var protons_runtime_node_modules_multiformats_vendor_base_x_src = protons_runtime_node_modules_multiformats_vendor_base_x_base; - -var protons_runtime_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = protons_runtime_node_modules_multiformats_vendor_base_x_src; - -/* harmony default export */ const protons_runtime_node_modules_multiformats_vendor_base_x = (protons_runtime_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX); - -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bytes.js -const protons_runtime_node_modules_multiformats_src_bytes_empty = new Uint8Array(0) - -/** - * @param {Uint8Array} d - */ -const protons_runtime_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') - -/** - * @param {string} hex - */ -const protons_runtime_node_modules_multiformats_src_bytes_fromHex = hex => { - const hexes = hex.match(/../g) - return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : protons_runtime_node_modules_multiformats_src_bytes_empty -} /** - * @param {Uint8Array} aa - * @param {Uint8Array} bb + * + * @param {Uint8Array} bytes + * @param {Map} cache + * @param {API.MultibaseEncoder<'z'>} base */ -const protons_runtime_node_modules_multiformats_src_bytes_equals = (aa, bb) => { - if (aa === bb) return true - if (aa.byteLength !== bb.byteLength) { - return false +const sdk_node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => { + const { prefix } = base + if (prefix !== sdk_node_modules_multiformats_src_bases_base58_base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base.name} encoding`) } - for (let ii = 0; ii < aa.byteLength; ii++) { - if (aa[ii] !== bb[ii]) { - return false - } + const cid = cache.get(prefix) + if (cid == null) { + const cid = base.encode(bytes).slice(1) + cache.set(prefix, cid) + return cid + } else { + return cid } - - return true } /** - * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o - * @returns {Uint8Array} + * @template {string} Prefix + * @param {Uint8Array} bytes + * @param {Map} cache + * @param {API.MultibaseEncoder} base */ -const protons_runtime_node_modules_multiformats_src_bytes_coerce = o => { - if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o - if (o instanceof ArrayBuffer) return new Uint8Array(o) - if (ArrayBuffer.isView(o)) { - return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) +const sdk_node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => { + const { prefix } = base + const cid = cache.get(prefix) + if (cid == null) { + const cid = base.encode(bytes) + cache.set(prefix, cid) + return cid + } else { + return cid } - throw new Error('Unknown type, must be binary type') } -/** - * @param {any} o - * @returns {o is ArrayBuffer|ArrayBufferView} - */ -const protons_runtime_node_modules_multiformats_src_bytes_isBinary = o => - o instanceof ArrayBuffer || ArrayBuffer.isView(o) +const sdk_node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70 +const sdk_node_modules_multiformats_src_cid_SHA_256_CODE = 0x12 /** - * @param {string} str + * @param {API.Version} version + * @param {number} code + * @param {Uint8Array} multihash * @returns {Uint8Array} */ -const protons_runtime_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) - -/** - * @param {Uint8Array} b - * @returns {string} - */ -const protons_runtime_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) - +const sdk_node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => { + const codeOffset = sdk_node_modules_multiformats_src_varint_encodingLength(version) + const hashOffset = codeOffset + sdk_node_modules_multiformats_src_varint_encodingLength(code) + const bytes = new Uint8Array(hashOffset + multihash.byteLength) + sdk_node_modules_multiformats_src_varint_encodeTo(version, bytes, 0) + sdk_node_modules_multiformats_src_varint_encodeTo(code, bytes, codeOffset) + bytes.set(multihash, hashOffset) + return bytes +} +const sdk_node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base.js +// EXTERNAL MODULE: ./node_modules/@filebase/sdk/node_modules/varint/index.js +var sdk_node_modules_varint = __nccwpck_require__(6668); +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/decoder-common.js -// Linter can't see that API is used in types. -// eslint-disable-next-line +const decoder_common_CIDV0_BYTES = { + SHA2_256: 0x12, + LENGTH: 0x20, + DAG_PB: 0x70 +} +const decoder_common_V2_HEADER_LENGTH = /* characteristics */ 16 /* v1 offset */ + 8 /* v1 size */ + 8 /* index offset */ + 8 /** - * Class represents both BaseEncoder and MultibaseEncoder meaning it - * can be used to encode to multibase or base encode without multibase - * prefix. + * Decodes varint and seeks the buffer * - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseEncoder} - * @implements {API.BaseEncoder} + * ```js + * // needs bytes to be read first + * const bytes = reader.upTo(8) // maybe async + * ``` + * + * @param {Uint8Array} bytes + * @param {import('./coding').Seekable} seeker + * @returns {number} */ -class protons_runtime_node_modules_multiformats_src_bases_base_Encoder { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(bytes:Uint8Array) => string} baseEncode - */ - constructor (name, prefix, baseEncode) { - this.name = name - this.prefix = prefix - this.baseEncode = baseEncode +function decoder_common_decodeVarint (bytes, seeker) { + if (!bytes.length) { + throw new Error('Unexpected end of data') } + const i = sdk_node_modules_varint.decode(bytes) + seeker.seek(/** @type {number} */(sdk_node_modules_varint.decode.bytes)) + return i +} - /** - * @param {Uint8Array} bytes - * @returns {API.Multibase} - */ - encode (bytes) { - if (bytes instanceof Uint8Array) { - return `${this.prefix}${this.baseEncode(bytes)}` - } else { - throw Error('Unknown type, must be binary type') - } +/** + * Decode v2 header + * + * ```js + * // needs bytes to be read first + * const bytes = reader.exactly(V2_HEADER_LENGTH, true) // maybe async + * ``` + * + * @param {Uint8Array} bytes + * @returns {import('./coding').CarV2FixedHeader} + */ +function decoder_common_decodeV2Header (bytes) { + const dv = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength) + let offset = 0 + const header = { + version: 2, + /** @type {[bigint, bigint]} */ + characteristics: [ + dv.getBigUint64(offset, true), + dv.getBigUint64(offset += 8, true) + ], + dataOffset: Number(dv.getBigUint64(offset += 8, true)), + dataSize: Number(dv.getBigUint64(offset += 8, true)), + indexOffset: Number(dv.getBigUint64(offset += 8, true)) } + return header } /** - * @template {string} Prefix + * Checks the length of the multihash to be read afterwards + * + * ```js + * // needs bytes to be read first + * const bytes = reader.upTo(8) // maybe async + * ``` + * + * @param {Uint8Array} bytes */ -/** - * Class represents both BaseDecoder and MultibaseDecoder so it could be used - * to decode multibases (with matching prefix) or just base decode strings - * with corresponding base encoding. +function decoder_common_getMultihashLength (bytes) { + // | code | length | .... | + // where both code and length are varints, so we have to decode + // them first before we can know total length + + varint.decode(bytes) // code + const codeLength = /** @type {number} */(varint.decode.bytes) + const length = varint.decode(bytes.subarray(varint.decode.bytes)) + const lengthLength = /** @type {number} */(varint.decode.bytes) + const mhLength = codeLength + lengthLength + length + + return mhLength +} + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/header-validator.js +/** Auto-generated with @ipld/schema@v4.2.0 at Thu Sep 14 2023 from IPLD Schema: + * + * # CarV1HeaderOrV2Pragma is a more relaxed form, and can parse {version:x} where + * # roots are optional. This is typically useful for the {verison:2} CARv2 + * # pragma. + * + * type CarV1HeaderOrV2Pragma struct { + * roots optional [&Any] + * # roots is _not_ optional for CarV1 but we defer that check within code to + * # gracefully handle the V2 case where it's just {version:X} + * version Int + * } + * + * # CarV1Header is the strict form of the header, and requires roots to be + * # present. This is compatible with the CARv1 specification. + * + * # type CarV1Header struct { + * # roots [&Any] + * # version Int + * # } * - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseDecoder} - * @implements {API.UnibaseDecoder} - * @implements {API.BaseDecoder} */ -class protons_runtime_node_modules_multiformats_src_bases_base_Decoder { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(text:string) => Uint8Array} baseDecode - */ - constructor (name, prefix, baseDecode) { - this.name = name - this.prefix = prefix - /* c8 ignore next 3 */ - if (prefix.codePointAt(0) === undefined) { - throw new Error('Invalid prefix character') + +const Kinds = { + Null: /** @returns {undefined|null} */ (/** @type {any} */ obj) => obj === null ? obj : undefined, + Int: /** @returns {undefined|number} */ (/** @type {any} */ obj) => Number.isInteger(obj) ? obj : undefined, + Float: /** @returns {undefined|number} */ (/** @type {any} */ obj) => typeof obj === 'number' && Number.isFinite(obj) ? obj : undefined, + String: /** @returns {undefined|string} */ (/** @type {any} */ obj) => typeof obj === 'string' ? obj : undefined, + Bool: /** @returns {undefined|boolean} */ (/** @type {any} */ obj) => typeof obj === 'boolean' ? obj : undefined, + Bytes: /** @returns {undefined|Uint8Array} */ (/** @type {any} */ obj) => obj instanceof Uint8Array ? obj : undefined, + Link: /** @returns {undefined|object} */ (/** @type {any} */ obj) => obj !== null && typeof obj === 'object' && obj.asCID === obj ? obj : undefined, + List: /** @returns {undefined|Array} */ (/** @type {any} */ obj) => Array.isArray(obj) ? obj : undefined, + Map: /** @returns {undefined|object} */ (/** @type {any} */ obj) => obj !== null && typeof obj === 'object' && obj.asCID !== obj && !Array.isArray(obj) && !(obj instanceof Uint8Array) ? obj : undefined +} +/** @type {{ [k in string]: (obj:any)=>undefined|any}} */ +const Types = { + 'CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)': Kinds.Link, + 'CarV1HeaderOrV2Pragma > roots (anon)': /** @returns {undefined|any} */ (/** @type {any} */ obj) => { + if (Kinds.List(obj) === undefined) { + return undefined + } + for (let i = 0; i < obj.length; i++) { + let v = obj[i] + v = Types['CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)'](v) + if (v === undefined) { + return undefined + } + if (v !== obj[i]) { + const ret = obj.slice(0, i) + for (let j = i; j < obj.length; j++) { + let v = obj[j] + v = Types['CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)'](v) + if (v === undefined) { + return undefined + } + ret.push(v) + } + return ret + } + } + return obj + }, + Int: Kinds.Int, + CarV1HeaderOrV2Pragma: /** @returns {undefined|any} */ (/** @type {any} */ obj) => { + if (Kinds.Map(obj) === undefined) { + return undefined + } + const entries = Object.entries(obj) + /** @type {{[k in string]: any}} */ + let ret = obj + let requiredCount = 1 + for (let i = 0; i < entries.length; i++) { + const [key, value] = entries[i] + switch (key) { + case 'roots': + { + const v = Types['CarV1HeaderOrV2Pragma > roots (anon)'](obj[key]) + if (v === undefined) { + return undefined + } + if (v !== value || ret !== obj) { + if (ret === obj) { + /** @type {{[k in string]: any}} */ + ret = {} + for (let j = 0; j < i; j++) { + ret[entries[j][0]] = entries[j][1] + } + } + ret.roots = v + } + } + break + case 'version': + { + requiredCount-- + const v = Types.Int(obj[key]) + if (v === undefined) { + return undefined + } + if (v !== value || ret !== obj) { + if (ret === obj) { + /** @type {{[k in string]: any}} */ + ret = {} + for (let j = 0; j < i; j++) { + ret[entries[j][0]] = entries[j][1] + } + } + ret.version = v + } + } + break + default: + return undefined + } } - /** @private */ - this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0)) - this.baseDecode = baseDecode - } - /** - * @param {string} text - */ - decode (text) { - if (typeof text === 'string') { - if (text.codePointAt(0) !== this.prefixCodePoint) { - throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`) + if (requiredCount > 0) { + return undefined + } + return ret + } +} +/** @type {{ [k in string]: (obj:any)=>undefined|any}} */ +const Reprs = { + 'CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)': Kinds.Link, + 'CarV1HeaderOrV2Pragma > roots (anon)': /** @returns {undefined|any} */ (/** @type {any} */ obj) => { + if (Kinds.List(obj) === undefined) { + return undefined + } + for (let i = 0; i < obj.length; i++) { + let v = obj[i] + v = Reprs['CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)'](v) + if (v === undefined) { + return undefined + } + if (v !== obj[i]) { + const ret = obj.slice(0, i) + for (let j = i; j < obj.length; j++) { + let v = obj[j] + v = Reprs['CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)'](v) + if (v === undefined) { + return undefined + } + ret.push(v) + } + return ret + } + } + return obj + }, + Int: Kinds.Int, + CarV1HeaderOrV2Pragma: /** @returns {undefined|any} */ (/** @type {any} */ obj) => { + if (Kinds.Map(obj) === undefined) { + return undefined + } + const entries = Object.entries(obj) + /** @type {{[k in string]: any}} */ + let ret = obj + let requiredCount = 1 + for (let i = 0; i < entries.length; i++) { + const [key, value] = entries[i] + switch (key) { + case 'roots': + { + const v = Reprs['CarV1HeaderOrV2Pragma > roots (anon)'](value) + if (v === undefined) { + return undefined + } + if (v !== value || ret !== obj) { + if (ret === obj) { + /** @type {{[k in string]: any}} */ + ret = {} + for (let j = 0; j < i; j++) { + ret[entries[j][0]] = entries[j][1] + } + } + ret.roots = v + } + } + break + case 'version': + { + requiredCount-- + const v = Reprs.Int(value) + if (v === undefined) { + return undefined + } + if (v !== value || ret !== obj) { + if (ret === obj) { + /** @type {{[k in string]: any}} */ + ret = {} + for (let j = 0; j < i; j++) { + ret[entries[j][0]] = entries[j][1] + } + } + ret.version = v + } + } + break + default: + return undefined } - return this.baseDecode(text.slice(this.prefix.length)) - } else { - throw Error('Can only multibase decode strings') } + if (requiredCount > 0) { + return undefined + } + return ret } +} - /** - * @template {string} OtherPrefix - * @param {API.UnibaseDecoder|ComposedDecoder} decoder - * @returns {ComposedDecoder} - */ - or (decoder) { - return protons_runtime_node_modules_multiformats_src_bases_base_or(this, decoder) - } +const header_validator_CarV1HeaderOrV2Pragma = { + toTyped: Types.CarV1HeaderOrV2Pragma, + toRepresentation: Reprs.CarV1HeaderOrV2Pragma } +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/buffer-decoder.js + + + + + + /** - * @template {string} Prefix - * @typedef {Record>} Decoders + * @typedef {import('./api').Block} Block + * @typedef {import('./api').BlockHeader} BlockHeader + * @typedef {import('./api').BlockIndex} BlockIndex + * @typedef {import('./coding').BytesBufferReader} BytesBufferReader + * @typedef {import('./coding').CarHeader} CarHeader + * @typedef {import('./coding').CarV2Header} CarV2Header + * @typedef {import('./coding').CarV2FixedHeader} CarV2FixedHeader */ /** - * @template {string} Prefix - * @implements {API.MultibaseDecoder} - * @implements {API.CombobaseDecoder} + * Reads header data from a `BytesReader`. The header may either be in the form + * of a `CarHeader` or `CarV2Header` depending on the CAR being read. + * + * @name decoder.readHeader(reader) + * @param {BytesBufferReader} reader + * @param {number} [strictVersion] + * @returns {CarHeader | CarV2Header} */ -class protons_runtime_node_modules_multiformats_src_bases_base_ComposedDecoder { - /** - * @param {Decoders} decoders - */ - constructor (decoders) { - this.decoders = decoders +function readHeader (reader, strictVersion) { + const length = decodeVarint(reader.upTo(8), reader) + if (length === 0) { + throw new Error('Invalid CAR header (zero length)') } - - /** - * @template {string} OtherPrefix - * @param {API.UnibaseDecoder|ComposedDecoder} decoder - * @returns {ComposedDecoder} - */ - or (decoder) { - return protons_runtime_node_modules_multiformats_src_bases_base_or(this, decoder) + const header = reader.exactly(length, true) + const block = decodeDagCbor(header) + if (CarV1HeaderOrV2Pragma.toTyped(block) === undefined) { + throw new Error('Invalid CAR header format') } - - /** - * @param {string} input - * @returns {Uint8Array} - */ - decode (input) { - const prefix = /** @type {Prefix} */ (input[0]) - const decoder = this.decoders[prefix] - if (decoder) { - return decoder.decode(input) - } else { - throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`) + if ((block.version !== 1 && block.version !== 2) || (strictVersion !== undefined && block.version !== strictVersion)) { + throw new Error(`Invalid CAR version: ${block.version}${strictVersion !== undefined ? ` (expected ${strictVersion})` : ''}`) + } + if (block.version === 1) { + // CarV1HeaderOrV2Pragma makes roots optional, let's make it mandatory + if (!Array.isArray(block.roots)) { + throw new Error('Invalid CAR header format') } + return block } + // version 2 + if (block.roots !== undefined) { + throw new Error('Invalid CAR header format') + } + const v2Header = decodeV2Header(reader.exactly(V2_HEADER_LENGTH, true)) + reader.seek(v2Header.dataOffset - reader.pos) + const v1Header = readHeader(reader, 1) + return Object.assign(v1Header, v2Header) } /** - * @template {string} L - * @template {string} R - * @param {API.UnibaseDecoder|API.CombobaseDecoder} left - * @param {API.UnibaseDecoder|API.CombobaseDecoder} right - * @returns {ComposedDecoder} - */ -const protons_runtime_node_modules_multiformats_src_bases_base_or = (left, right) => new protons_runtime_node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({ - ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }), - ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right }) -})) - -/** - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseCodec} - * @implements {API.MultibaseEncoder} - * @implements {API.MultibaseDecoder} - * @implements {API.BaseCodec} - * @implements {API.BaseEncoder} - * @implements {API.BaseDecoder} + * Reads CID sync + * + * @param {BytesBufferReader} reader + * @returns {CID} */ -class protons_runtime_node_modules_multiformats_src_bases_base_Codec { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(bytes:Uint8Array) => string} baseEncode - * @param {(text:string) => Uint8Array} baseDecode - */ - constructor (name, prefix, baseEncode, baseDecode) { - this.name = name - this.prefix = prefix - this.baseEncode = baseEncode - this.baseDecode = baseDecode - this.encoder = new protons_runtime_node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode) - this.decoder = new protons_runtime_node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode) - } - - /** - * @param {Uint8Array} input - */ - encode (input) { - return this.encoder.encode(input) +function readCid (reader) { + const first = reader.exactly(2, false) + if (first[0] === CIDV0_BYTES.SHA2_256 && first[1] === CIDV0_BYTES.LENGTH) { + // cidv0 32-byte sha2-256 + const bytes = reader.exactly(34, true) + const multihash = Digest.decode(bytes) + return CID.create(0, CIDV0_BYTES.DAG_PB, multihash) } - /** - * @param {string} input - */ - decode (input) { - return this.decoder.decode(input) + const version = decodeVarint(reader.upTo(8), reader) + if (version !== 1) { + throw new Error(`Unexpected CID version (${version})`) } + const codec = decodeVarint(reader.upTo(8), reader) + const bytes = reader.exactly(getMultihashLength(reader.upTo(8)), true) + const multihash = Digest.decode(bytes) + return CID.create(version, codec, multihash) } /** - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {(bytes:Uint8Array) => string} options.encode - * @param {(input:string) => Uint8Array} options.decode - * @returns {Codec} + * Reads the leading data of an individual block from CAR data from a + * `BytesBufferReader`. Returns a `BlockHeader` object which contains + * `{ cid, length, blockLength }` which can be used to either index the block + * or read the block binary data. + * + * @name async decoder.readBlockHead(reader) + * @param {BytesBufferReader} reader + * @returns {BlockHeader} */ -const protons_runtime_node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) => - new protons_runtime_node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode) +function readBlockHead (reader) { + // length includes a CID + Binary, where CID has a variable length + // we have to deal with + const start = reader.pos + let length = decodeVarint(reader.upTo(8), reader) + if (length === 0) { + throw new Error('Invalid CAR section (zero length)') + } + length += (reader.pos - start) + const cid = readCid(reader) + const blockLength = length - Number(reader.pos - start) // subtract CID length -/** - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {string} options.alphabet - * @returns {Codec} - */ -const protons_runtime_node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => { - const { encode, decode } = protons_runtime_node_modules_multiformats_vendor_base_x(alphabet, name) - return protons_runtime_node_modules_multiformats_src_bases_base_from({ - prefix, - name, - encode, - /** - * @param {string} text - */ - decode: text => protons_runtime_node_modules_multiformats_src_bytes_coerce(decode(text)) - }) + return { cid, length, blockLength } } /** - * @param {string} string - * @param {string} alphabet - * @param {number} bitsPerChar - * @param {string} name - * @returns {Uint8Array} + * Returns Car header and blocks from a Uint8Array + * + * @param {Uint8Array} bytes + * @returns {{ header : CarHeader | CarV2Header , blocks: Block[]}} */ -const protons_runtime_node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { - // Build the character lookup table: - /** @type {Record} */ - const codes = {} - for (let i = 0; i < alphabet.length; ++i) { - codes[alphabet[i]] = i - } - - // Count the padding bytes: - let end = string.length - while (string[end - 1] === '=') { - --end +function buffer_decoder_fromBytes (bytes) { + let reader = buffer_decoder_bytesReader(bytes) + const header = readHeader(reader) + if (header.version === 2) { + const v1length = reader.pos - header.dataOffset + reader = limitReader(reader, header.dataSize - v1length) } - // Allocate the output: - const out = new Uint8Array((end * bitsPerChar / 8) | 0) - - // Parse the data: - let bits = 0 // Number of bits currently in the buffer - let buffer = 0 // Bits waiting to be written out, MSB first - let written = 0 // Next byte to write - for (let i = 0; i < end; ++i) { - // Read one character from the string: - const value = codes[string[i]] - if (value === undefined) { - throw new SyntaxError(`Non-${name} character`) - } - - // Append the bits to the buffer: - buffer = (buffer << bitsPerChar) | value - bits += bitsPerChar + const blocks = [] + while (reader.upTo(8).length > 0) { + const { cid, blockLength } = readBlockHead(reader) - // Write out some bits if the buffer has a byte's worth: - if (bits >= 8) { - bits -= 8 - out[written++] = 0xff & (buffer >> bits) - } + blocks.push({ cid, bytes: reader.exactly(blockLength, true) }) } - // Verify that we have received just enough bits: - if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) { - throw new SyntaxError('Unexpected end of data') + return { + header, blocks } - - return out } /** - * @param {Uint8Array} data - * @param {string} alphabet - * @param {number} bitsPerChar - * @returns {string} + * Creates a `BytesBufferReader` from a `Uint8Array`. + * + * @name decoder.bytesReader(bytes) + * @param {Uint8Array} bytes + * @returns {BytesBufferReader} */ -const protons_runtime_node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => { - const pad = alphabet[alphabet.length - 1] === '=' - const mask = (1 << bitsPerChar) - 1 - let out = '' +function buffer_decoder_bytesReader (bytes) { + let pos = 0 - let bits = 0 // Number of bits currently in the buffer - let buffer = 0 // Bits waiting to be written out, MSB first - for (let i = 0; i < data.length; ++i) { - // Slurp data into the buffer: - buffer = (buffer << 8) | data[i] - bits += 8 + /** @type {BytesBufferReader} */ + return { + upTo (length) { + return bytes.subarray(pos, pos + Math.min(length, bytes.length - pos)) + }, - // Write out as much as we can: - while (bits > bitsPerChar) { - bits -= bitsPerChar - out += alphabet[mask & (buffer >> bits)] - } - } + exactly (length, seek = false) { + if (length > bytes.length - pos) { + throw new Error('Unexpected end of data') + } - // Partial character: - if (bits) { - out += alphabet[mask & (buffer << (bitsPerChar - bits))] - } + const out = bytes.subarray(pos, pos + length) + if (seek) { + pos += length + } + return out + }, - // Add padding characters until we hit a byte boundary: - if (pad) { - while ((out.length * bitsPerChar) & 7) { - out += '=' + seek (length) { + pos += length + }, + + get pos () { + return pos } } - - return out } /** - * RFC4648 Factory + * Wraps a `BytesBufferReader` in a limiting `BytesBufferReader` which limits maximum read + * to `byteLimit` bytes. It _does not_ update `pos` of the original + * `BytesBufferReader`. * - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {string} options.alphabet - * @param {number} options.bitsPerChar + * @name decoder.limitReader(reader, byteLimit) + * @param {BytesBufferReader} reader + * @param {number} byteLimit + * @returns {BytesBufferReader} */ -const protons_runtime_node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { - return protons_runtime_node_modules_multiformats_src_bases_base_from({ - prefix, - name, - encode (input) { - return protons_runtime_node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar) - }, - decode (input) { - return protons_runtime_node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name) - } - }) -} - -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base10.js - - -const protons_runtime_node_modules_multiformats_src_bases_base10_base10 = protons_runtime_node_modules_multiformats_src_bases_base_baseX({ - prefix: '9', - name: 'base10', - alphabet: '0123456789' -}) - -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base16.js -// @ts-check - - - -const protons_runtime_node_modules_multiformats_src_bases_base16_base16 = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'f', - name: 'base16', - alphabet: '0123456789abcdef', - bitsPerChar: 4 -}) - -const protons_runtime_node_modules_multiformats_src_bases_base16_base16upper = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'F', - name: 'base16upper', - alphabet: '0123456789ABCDEF', - bitsPerChar: 4 -}) - -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base2.js -// @ts-check +function limitReader (reader, byteLimit) { + let bytesRead = 0 + /** @type {BytesBufferReader} */ + return { + upTo (length) { + let bytes = reader.upTo(length) + if (bytes.length + bytesRead > byteLimit) { + bytes = bytes.subarray(0, byteLimit - bytesRead) + } + return bytes + }, + exactly (length, seek = false) { + const bytes = reader.exactly(length, seek) + if (bytes.length + bytesRead > byteLimit) { + throw new Error('Unexpected end of data') + } + if (seek) { + bytesRead += length + } + return bytes + }, -const protons_runtime_node_modules_multiformats_src_bases_base2_base2 = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: '0', - name: 'base2', - alphabet: '01', - bitsPerChar: 1 -}) + seek (length) { + bytesRead += length + reader.seek(length) + }, -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base256emoji.js + get pos () { + return reader.pos + } + } +} +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/buffer-reader-browser.js -const protons_runtime_node_modules_multiformats_src_bases_base256emoji_alphabet = Array.from('🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂') -const protons_runtime_node_modules_multiformats_src_bases_base256emoji_alphabetBytesToChars = /** @type {string[]} */ (protons_runtime_node_modules_multiformats_src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[i] = c; return p }, /** @type {string[]} */([]))) -const protons_runtime_node_modules_multiformats_src_bases_base256emoji_alphabetCharsToBytes = /** @type {number[]} */ (protons_runtime_node_modules_multiformats_src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[/** @type {number} */ (c.codePointAt(0))] = i; return p }, /** @type {number[]} */([]))) /** - * @param {Uint8Array} data - * @returns {string} + * @typedef {import('multiformats').CID} CID + * @typedef {import('./api').Block} Block + * @typedef {import('./api').CarBufferReader} ICarBufferReader + * @typedef {import('./coding').CarHeader} CarHeader + * @typedef {import('./coding').CarV2Header} CarV2Header */ -function protons_runtime_node_modules_multiformats_src_bases_base256emoji_encode (data) { - return data.reduce((p, c) => { - p += protons_runtime_node_modules_multiformats_src_bases_base256emoji_alphabetBytesToChars[c] - return p - }, '') -} /** - * @param {string} str - * @returns {Uint8Array} + * Provides blockstore-like access to a CAR. + * + * Implements the `RootsBufferReader` interface: + * {@link ICarBufferReader.getRoots `getRoots()`}. And the `BlockBufferReader` interface: + * {@link ICarBufferReader.get `get()`}, {@link ICarBufferReader.has `has()`}, + * {@link ICarBufferReader.blocks `blocks()`} and + * {@link ICarBufferReader.cids `cids()`}. + * + * Load this class with either `import { CarBufferReader } from '@ipld/car/buffer-reader'` + * (`const { CarBufferReader } = require('@ipld/car/buffer-reader')`). Or + * `import { CarBufferReader } from '@ipld/car'` (`const { CarBufferReader } = require('@ipld/car')`). + * The former will likely result in smaller bundle sizes where this is + * important. + * + * @name CarBufferReader + * @class + * @implements {ICarBufferReader} + * @property {number} version The version number of the CAR referenced by this + * reader (should be `1` or `2`). */ -function protons_runtime_node_modules_multiformats_src_bases_base256emoji_decode (str) { - const byts = [] - for (const char of str) { - const byt = protons_runtime_node_modules_multiformats_src_bases_base256emoji_alphabetCharsToBytes[/** @type {number} */ (char.codePointAt(0))] - if (byt === undefined) { - throw new Error(`Non-base256emoji character: ${char}`) - } - byts.push(byt) +class CarBufferReader { + /** + * @constructs CarBufferReader + * @param {CarHeader|CarV2Header} header + * @param {Block[]} blocks + */ + constructor (header, blocks) { + this._header = header + this._blocks = blocks + this._cids = undefined } - return new Uint8Array(byts) -} - -const protons_runtime_node_modules_multiformats_src_bases_base256emoji_base256emoji = protons_runtime_node_modules_multiformats_src_bases_base_from({ - prefix: '🚀', - name: 'base256emoji', - encode: protons_runtime_node_modules_multiformats_src_bases_base256emoji_encode, - decode: protons_runtime_node_modules_multiformats_src_bases_base256emoji_decode -}) - -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base32.js + /** + * @property version + * @memberof CarBufferReader + * @instance + */ + get version () { + return this._header.version + } -const protons_runtime_node_modules_multiformats_src_bases_base32_base32 = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'b', - name: 'base32', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567', - bitsPerChar: 5 -}) + /** + * Get the list of roots defined by the CAR referenced by this reader. May be + * zero or more `CID`s. + * + * @function + * @memberof CarBufferReader + * @instance + * @returns {CID[]} + */ + getRoots () { + return this._header.roots + } -const protons_runtime_node_modules_multiformats_src_bases_base32_base32upper = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'B', - name: 'base32upper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', - bitsPerChar: 5 -}) + /** + * Check whether a given `CID` exists within the CAR referenced by this + * reader. + * + * @function + * @memberof CarBufferReader + * @instance + * @param {CID} key + * @returns {boolean} + */ + has (key) { + return this._blocks.some(b => b.cid.equals(key)) + } -const protons_runtime_node_modules_multiformats_src_bases_base32_base32pad = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'c', - name: 'base32pad', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', - bitsPerChar: 5 -}) + /** + * Fetch a `Block` (a `{ cid:CID, bytes:Uint8Array }` pair) from the CAR + * referenced by this reader matching the provided `CID`. In the case where + * the provided `CID` doesn't exist within the CAR, `undefined` will be + * returned. + * + * @function + * @memberof CarBufferReader + * @instance + * @param {CID} key + * @returns {Block | undefined} + */ + get (key) { + return this._blocks.find(b => b.cid.equals(key)) + } -const protons_runtime_node_modules_multiformats_src_bases_base32_base32padupper = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'C', - name: 'base32padupper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', - bitsPerChar: 5 -}) + /** + * Returns a `Block[]` of the `Block`s (`{ cid:CID, bytes:Uint8Array }` pairs) contained within + * the CAR referenced by this reader. + * + * @function + * @memberof CarBufferReader + * @instance + * @returns {Block[]} + */ + blocks () { + return this._blocks + } -const protons_runtime_node_modules_multiformats_src_bases_base32_base32hex = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'v', - name: 'base32hex', - alphabet: '0123456789abcdefghijklmnopqrstuv', - bitsPerChar: 5 -}) + /** + * Returns a `CID[]` of the `CID`s contained within the CAR referenced by this reader. + * + * @function + * @memberof CarBufferReader + * @instance + * @returns {CID[]} + */ + cids () { + if (!this._cids) { + this._cids = this._blocks.map(b => b.cid) + } + return this._cids + } -const protons_runtime_node_modules_multiformats_src_bases_base32_base32hexupper = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'V', - name: 'base32hexupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', - bitsPerChar: 5 -}) + /** + * Instantiate a {@link CarBufferReader} from a `Uint8Array` blob. This performs a + * decode fully in memory and maintains the decoded state in memory for full + * access to the data via the `CarReader` API. + * + * @static + * @memberof CarBufferReader + * @param {Uint8Array} bytes + * @returns {CarBufferReader} + */ + static fromBytes (bytes) { + if (!(bytes instanceof Uint8Array)) { + throw new TypeError('fromBytes() requires a Uint8Array') + } -const protons_runtime_node_modules_multiformats_src_bases_base32_base32hexpad = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 't', - name: 'base32hexpad', - alphabet: '0123456789abcdefghijklmnopqrstuv=', - bitsPerChar: 5 -}) + const { header, blocks } = BufferDecoder.fromBytes(bytes) + return new CarBufferReader(header, blocks) + } +} -const protons_runtime_node_modules_multiformats_src_bases_base32_base32hexpadupper = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'T', - name: 'base32hexpadupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', - bitsPerChar: 5 -}) +const __browser = true -const protons_runtime_node_modules_multiformats_src_bases_base32_base32z = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'h', - name: 'base32z', - alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', - bitsPerChar: 5 -}) +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/buffer-reader.js -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base36.js -const protons_runtime_node_modules_multiformats_src_bases_base36_base36 = protons_runtime_node_modules_multiformats_src_bases_base_baseX({ - prefix: 'k', - name: 'base36', - alphabet: '0123456789abcdefghijklmnopqrstuvwxyz' -}) +/** + * @typedef {import('./api').Block} Block + * @typedef {import('./api').BlockIndex} BlockIndex + * @typedef {import('./api').CarBufferReader} ICarBufferReader + */ -const protons_runtime_node_modules_multiformats_src_bases_base36_base36upper = protons_runtime_node_modules_multiformats_src_bases_base_baseX({ - prefix: 'K', - name: 'base36upper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' -}) +const fsread = external_fs_.readSync -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base58.js +/** + * @class + * @implements {ICarBufferReader} + */ +class buffer_reader_CarBufferReader extends (/* unused pure expression or super */ null && (BrowserCarBufferReader)) { + /** + * Reads a block directly from a file descriptor for an open CAR file. This + * function is **only available in Node.js** and not a browser environment. + * + * This function can be used in connection with {@link CarIndexer} which emits + * the `BlockIndex` objects that are required by this function. + * + * The user is responsible for opening and closing the file used in this call. + * + * @static + * @memberof CarBufferReader + * @param {number} fd - A file descriptor from the + * Node.js `fs` module. An integer, from `fs.open()`. + * @param {BlockIndex} blockIndex - An index pointing to the location of the + * Block required. This `BlockIndex` should take the form: + * `{cid:CID, blockLength:number, blockOffset:number}`. + * @returns {Block} A `{ cid:CID, bytes:Uint8Array }` pair. + */ + static readRaw (fd, blockIndex) { + const { cid, blockLength, blockOffset } = blockIndex + const bytes = new Uint8Array(blockLength) + let read + if (typeof fd === 'number') { + read = fsread(fd, bytes, 0, blockLength, blockOffset) + } else { + throw new TypeError('Bad fd') + } + if (read !== blockLength) { + throw new Error(`Failed to read entire block (${read} instead of ${blockLength})`) + } + return { cid, bytes } + } +} +const buffer_reader_browser = false -const protons_runtime_node_modules_multiformats_src_bases_base58_base58btc = protons_runtime_node_modules_multiformats_src_bases_base_baseX({ - name: 'base58btc', - prefix: 'z', - alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -}) +;// CONCATENATED MODULE: ./node_modules/cborg/lib/length.js -const protons_runtime_node_modules_multiformats_src_bases_base58_base58flickr = protons_runtime_node_modules_multiformats_src_bases_base_baseX({ - name: 'base58flickr', - prefix: 'Z', - alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -}) -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base64.js -// @ts-check +/** + * @typedef {import('../interface').EncodeOptions} EncodeOptions + * @typedef {import('../interface').TokenTypeEncoder} TokenTypeEncoder + * @typedef {import('../interface').TokenOrNestedTokens} TokenOrNestedTokens + */ +const length_cborEncoders = makeCborEncoders() -const protons_runtime_node_modules_multiformats_src_bases_base64_base64 = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'm', - name: 'base64', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', - bitsPerChar: 6 -}) +/** @type {EncodeOptions} */ +const length_defaultEncodeOptions = { + float64: false, + quickEncodeToken: quickEncodeToken +} -const protons_runtime_node_modules_multiformats_src_bases_base64_base64pad = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'M', - name: 'base64pad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', - bitsPerChar: 6 -}) +/** + * Calculate the byte length of the given data when encoded as CBOR with the + * options provided. + * This calculation will be accurate if the same options are used as when + * performing a normal encode. Some encode options can change the encoding + * output length. + * + * @param {any} data + * @param {EncodeOptions} [options] + * @returns {number} + */ +function encodedLength (data, options) { + options = Object.assign({}, length_defaultEncodeOptions, options) + options.mapSorter = undefined // won't change the length + const tokens = objectToTokens(data, options) + return length_tokensToLength(tokens, length_cborEncoders, options) +} -const protons_runtime_node_modules_multiformats_src_bases_base64_base64url = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'u', - name: 'base64url', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', - bitsPerChar: 6 -}) +/** + * Calculate the byte length of the data as represented by the given tokens when + * encoded as CBOR with the options provided. + * This function is for advanced users and would not normally be called + * directly. See `encodedLength()` for appropriate use. + * + * @param {TokenOrNestedTokens} tokens + * @param {TokenTypeEncoder[]} [encoders] + * @param {EncodeOptions} [options] + */ +function length_tokensToLength (tokens, encoders = length_cborEncoders, options = length_defaultEncodeOptions) { + if (Array.isArray(tokens)) { + let len = 0 + for (const token of tokens) { + len += length_tokensToLength(token, encoders, options) + } + return len + } else { + const encoder = encoders[tokens.type.major] + /* c8 ignore next 3 */ + if (encoder.encodedSize === undefined || typeof encoder.encodedSize !== 'function') { + throw new Error(`Encoder for ${tokens.type.name} does not have an encodedSize()`) + } + return encoder.encodedSize(tokens, options) + } +} -const protons_runtime_node_modules_multiformats_src_bases_base64_base64urlpad = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'U', - name: 'base64urlpad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', - bitsPerChar: 6 -}) +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/buffer-writer.js -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base8.js -// @ts-check -const protons_runtime_node_modules_multiformats_src_bases_base8_base8 = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: '7', - name: 'base8', - alphabet: '01234567', - bitsPerChar: 3 -}) -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/identity.js -// @ts-check +/** + * @typedef {import('./api').CID} CID + * @typedef {import('./api').Block} Block + * @typedef {import('./api').CarBufferWriter} Writer + * @typedef {import('./api').CarBufferWriterOptions} Options + * @typedef {import('./coding').CarEncoder} CarEncoder + */ +/** + * A simple CAR writer that writes to a pre-allocated buffer. + * + * @class + * @name CarBufferWriter + * @implements {Writer} + */ +class CarBufferWriter { + /** + * @param {Uint8Array} bytes + * @param {number} headerSize + */ + constructor (bytes, headerSize) { + /** @readonly */ + this.bytes = bytes + this.byteOffset = headerSize + /** + * @readonly + * @type {CID[]} + */ + this.roots = [] + this.headerSize = headerSize + } + /** + * Add a root to this writer, to be used to create a header when the CAR is + * finalized with {@link CarBufferWriter.close `close()`} + * + * @param {CID} root + * @param {{resize?:boolean}} [options] + * @returns {CarBufferWriter} + */ + addRoot (root, options) { + addRoot(this, root, options) + return this + } -const protons_runtime_node_modules_multiformats_src_bases_identity_identity = protons_runtime_node_modules_multiformats_src_bases_base_from({ - prefix: '\x00', - name: 'identity', - encode: (buf) => protons_runtime_node_modules_multiformats_src_bytes_toString(buf), - decode: (str) => protons_runtime_node_modules_multiformats_src_bytes_fromString(str) -}) + /** + * Write a `Block` (a `{ cid:CID, bytes:Uint8Array }` pair) to the archive. + * Throws if there is not enough capacity. + * + * @param {Block} block - A `{ cid:CID, bytes:Uint8Array }` pair. + * @returns {CarBufferWriter} + */ + write (block) { + addBlock(this, block) + return this + } -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/codecs/json.js -// @ts-check + /** + * Finalize the CAR and return it as a `Uint8Array`. + * + * @param {object} [options] + * @param {boolean} [options.resize] + * @returns {Uint8Array} + */ + close (options) { + return buffer_writer_close(this, options) + } +} /** - * @template T - * @typedef {import('./interface.js').ByteView} ByteView + * @param {CarBufferWriter} writer + * @param {CID} root + * @param {{resize?:boolean}} [options] */ +const addRoot = (writer, root, options = {}) => { + const { resize = false } = options + const { bytes, headerSize, byteOffset, roots } = writer + writer.roots.push(root) + const size = headerLength(writer) + // If there is not enough space for the new root + if (size > headerSize) { + // Check if we root would fit if we were to resize the head. + if (size - headerSize + byteOffset < bytes.byteLength) { + // If resize is enabled resize head + if (resize) { + resizeHeader(writer, size) + // otherwise remove head and throw an error suggesting to resize + } else { + roots.pop() + throw new RangeError(`Header of size ${headerSize} has no capacity for new root ${root}. + However there is a space in the buffer and you could call addRoot(root, { resize: root }) to resize header to make a space for this root.`) + } + // If head would not fit even with resize pop new root and throw error + } else { + roots.pop() + throw new RangeError(`Buffer has no capacity for a new root ${root}`) + } + } +} -const protons_runtime_node_modules_multiformats_src_codecs_json_textEncoder = new TextEncoder() -const protons_runtime_node_modules_multiformats_src_codecs_json_textDecoder = new TextDecoder() - -const protons_runtime_node_modules_multiformats_src_codecs_json_name = 'json' -const protons_runtime_node_modules_multiformats_src_codecs_json_code = 0x0200 +/** + * Calculates number of bytes required for storing given block in CAR. Useful in + * estimating size of an `ArrayBuffer` for the `CarBufferWriter`. + * + * @name CarBufferWriter.blockLength(Block) + * @param {Block} block + * @returns {number} + */ +const blockLength = ({ cid, bytes }) => { + const size = cid.bytes.byteLength + bytes.byteLength + return varint.encodingLength(size) + size +} /** - * @template T - * @param {T} node - * @returns {ByteView} + * @param {CarBufferWriter} writer + * @param {Block} block */ -const protons_runtime_node_modules_multiformats_src_codecs_json_encode = (node) => protons_runtime_node_modules_multiformats_src_codecs_json_textEncoder.encode(JSON.stringify(node)) +const addBlock = (writer, { cid, bytes }) => { + const byteLength = cid.bytes.byteLength + bytes.byteLength + const size = varint.encode(byteLength) + if (writer.byteOffset + size.length + byteLength > writer.bytes.byteLength) { + throw new RangeError('Buffer has no capacity for this block') + } else { + writeBytes(writer, size) + writeBytes(writer, cid.bytes) + writeBytes(writer, bytes) + } +} /** - * @template T - * @param {ByteView} data - * @returns {T} + * @param {CarBufferWriter} writer + * @param {object} [options] + * @param {boolean} [options.resize] */ -const protons_runtime_node_modules_multiformats_src_codecs_json_decode = (data) => JSON.parse(protons_runtime_node_modules_multiformats_src_codecs_json_textDecoder.decode(data)) +const buffer_writer_close = (writer, options = {}) => { + const { resize = false } = options + const { roots, bytes, byteOffset, headerSize } = writer -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/codecs/raw.js -// @ts-check + const headerBytes = CBOR.encode({ version: 1, roots }) + const varintBytes = varint.encode(headerBytes.length) + const size = varintBytes.length + headerBytes.byteLength + const offset = headerSize - size + // If header size estimate was accurate we just write header and return + // view into buffer. + if (offset === 0) { + writeHeader(writer, varintBytes, headerBytes) + return bytes.subarray(0, byteOffset) + // If header was overestimated and `{resize: true}` is passed resize header + } else if (resize) { + resizeHeader(writer, size) + writeHeader(writer, varintBytes, headerBytes) + return bytes.subarray(0, writer.byteOffset) + } else { + throw new RangeError(`Header size was overestimated. +You can use close({ resize: true }) to resize header`) + } +} /** - * @template T - * @typedef {import('./interface.js').ByteView} ByteView + * @param {CarBufferWriter} writer + * @param {number} byteLength */ - -const protons_runtime_node_modules_multiformats_src_codecs_raw_name = 'raw' -const protons_runtime_node_modules_multiformats_src_codecs_raw_code = 0x55 +const resizeHeader = (writer, byteLength) => { + const { bytes, headerSize } = writer + // Move data section to a new offset + bytes.set(bytes.subarray(headerSize, writer.byteOffset), byteLength) + // Update header size & byteOffset + writer.byteOffset += byteLength - headerSize + writer.headerSize = byteLength +} /** - * @param {Uint8Array} node - * @returns {ByteView} + * @param {CarBufferWriter} writer + * @param {number[]|Uint8Array} bytes */ -const protons_runtime_node_modules_multiformats_src_codecs_raw_encode = (node) => protons_runtime_node_modules_multiformats_src_bytes_coerce(node) +const writeBytes = (writer, bytes) => { + writer.bytes.set(bytes, writer.byteOffset) + writer.byteOffset += bytes.length +} /** - * @param {ByteView} data - * @returns {Uint8Array} + * @param {{bytes:Uint8Array}} writer + * @param {number[]} varint + * @param {Uint8Array} header */ -const protons_runtime_node_modules_multiformats_src_codecs_raw_decode = (data) => protons_runtime_node_modules_multiformats_src_bytes_coerce(data) - -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/vendor/varint.js -var protons_runtime_node_modules_multiformats_vendor_varint_encode_1 = protons_runtime_node_modules_multiformats_vendor_varint_encode; +const writeHeader = ({ bytes }, varint, header) => { + bytes.set(varint) + bytes.set(header, varint.length) +} -var protons_runtime_node_modules_multiformats_vendor_varint_MSB = 0x80 - , protons_runtime_node_modules_multiformats_vendor_varint_REST = 0x7F - , protons_runtime_node_modules_multiformats_vendor_varint_MSBALL = ~protons_runtime_node_modules_multiformats_vendor_varint_REST - , protons_runtime_node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31); +const headerPreludeTokens = [ + new token_Token(token_Type.map, 2), + new token_Token(token_Type.string, 'version'), + new token_Token(token_Type.uint, 1), + new token_Token(token_Type.string, 'roots') +] -function protons_runtime_node_modules_multiformats_vendor_varint_encode(num, out, offset) { - out = out || []; - offset = offset || 0; - var oldOffset = offset; +const CID_TAG = new token_Token(token_Type.tag, 42) - while(num >= protons_runtime_node_modules_multiformats_vendor_varint_INT) { - out[offset++] = (num & 0xFF) | protons_runtime_node_modules_multiformats_vendor_varint_MSB; - num /= 128; - } - while(num & protons_runtime_node_modules_multiformats_vendor_varint_MSBALL) { - out[offset++] = (num & 0xFF) | protons_runtime_node_modules_multiformats_vendor_varint_MSB; - num >>>= 7; +/** + * Calculates header size given the array of byteLength for roots. + * + * @name CarBufferWriter.calculateHeaderLength(rootLengths) + * @param {number[]} rootLengths + * @returns {number} + */ +const calculateHeaderLength = (rootLengths) => { + const tokens = [...headerPreludeTokens] + tokens.push(new Token(Type.array, rootLengths.length)) + for (const rootLength of rootLengths) { + tokens.push(CID_TAG) + tokens.push(new Token(Type.bytes, { length: rootLength + 1 })) } - out[offset] = num | 0; - - protons_runtime_node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; - - return out + const length = tokensToLength(tokens) // no options needed here because we have simple tokens + return varint.encodingLength(length) + length } -var protons_runtime_node_modules_multiformats_vendor_varint_decode = protons_runtime_node_modules_multiformats_vendor_varint_read; - -var protons_runtime_node_modules_multiformats_vendor_varint_MSB$1 = 0x80 - , protons_runtime_node_modules_multiformats_vendor_varint_REST$1 = 0x7F; +/** + * Calculates header size given the array of roots. + * + * @name CarBufferWriter.headerLength({ roots }) + * @param {object} options + * @param {CID[]} options.roots + * @returns {number} + */ +const headerLength = ({ roots }) => + calculateHeaderLength(roots.map(cid => cid.bytes.byteLength)) -function protons_runtime_node_modules_multiformats_vendor_varint_read(buf, offset) { - var res = 0 - , offset = offset || 0 - , shift = 0 - , counter = offset - , b - , l = buf.length; +/** + * Estimates header size given a count of the roots and the expected byte length + * of the root CIDs. The default length works for a standard CIDv1 with a + * single-byte multihash code, such as SHA2-256 (i.e. the most common CIDv1). + * + * @name CarBufferWriter.estimateHeaderLength(rootCount[, rootByteLength]) + * @param {number} rootCount + * @param {number} [rootByteLength] + * @returns {number} + */ +const estimateHeaderLength = (rootCount, rootByteLength = 36) => + calculateHeaderLength(new Array(rootCount).fill(rootByteLength)) - do { - if (counter >= l) { - protons_runtime_node_modules_multiformats_vendor_varint_read.bytes = 0; - throw new RangeError('Could not decode varint') - } - b = buf[counter++]; - res += shift < 28 - ? (b & protons_runtime_node_modules_multiformats_vendor_varint_REST$1) << shift - : (b & protons_runtime_node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift); - shift += 7; - } while (b >= protons_runtime_node_modules_multiformats_vendor_varint_MSB$1) +/** + * Creates synchronous CAR writer that can be used to encode blocks into a given + * buffer. Optionally you could pass `byteOffset` and `byteLength` to specify a + * range inside buffer to write into. If car file is going to have `roots` you + * need to either pass them under `options.roots` (from which header size will + * be calculated) or provide `options.headerSize` to allocate required space + * in the buffer. You may also provide known `roots` and `headerSize` to + * allocate space for the roots that may not be known ahead of time. + * + * Note: Incorrect `headerSize` may lead to copying bytes inside a buffer + * which will have a negative impact on performance. + * + * @name CarBufferWriter.createWriter(buffer[, options]) + * @param {ArrayBuffer} buffer + * @param {object} [options] + * @param {CID[]} [options.roots] + * @param {number} [options.byteOffset] + * @param {number} [options.byteLength] + * @param {number} [options.headerSize] + * @returns {CarBufferWriter} + */ +const createWriter = (buffer, options = {}) => { + const { + roots = [], + byteOffset = 0, + byteLength = buffer.byteLength, + headerSize = headerLength({ roots }) + } = options + const bytes = new Uint8Array(buffer, byteOffset, byteLength) - protons_runtime_node_modules_multiformats_vendor_varint_read.bytes = counter - offset; + const writer = new CarBufferWriter(bytes, headerSize) + for (const root of roots) { + writer.addRoot(root) + } - return res + return writer } -var protons_runtime_node_modules_multiformats_vendor_varint_N1 = Math.pow(2, 7); -var protons_runtime_node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14); -var protons_runtime_node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21); -var protons_runtime_node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28); -var protons_runtime_node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35); -var protons_runtime_node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42); -var protons_runtime_node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49); -var protons_runtime_node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56); -var protons_runtime_node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63); +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/decoder.js -var protons_runtime_node_modules_multiformats_vendor_varint_length = function (value) { - return ( - value < protons_runtime_node_modules_multiformats_vendor_varint_N1 ? 1 - : value < protons_runtime_node_modules_multiformats_vendor_varint_N2 ? 2 - : value < protons_runtime_node_modules_multiformats_vendor_varint_N3 ? 3 - : value < protons_runtime_node_modules_multiformats_vendor_varint_N4 ? 4 - : value < protons_runtime_node_modules_multiformats_vendor_varint_N5 ? 5 - : value < protons_runtime_node_modules_multiformats_vendor_varint_N6 ? 6 - : value < protons_runtime_node_modules_multiformats_vendor_varint_N7 ? 7 - : value < protons_runtime_node_modules_multiformats_vendor_varint_N8 ? 8 - : value < protons_runtime_node_modules_multiformats_vendor_varint_N9 ? 9 - : 10 - ) -}; -var protons_runtime_node_modules_multiformats_vendor_varint_varint = { - encode: protons_runtime_node_modules_multiformats_vendor_varint_encode_1 - , decode: protons_runtime_node_modules_multiformats_vendor_varint_decode - , encodingLength: protons_runtime_node_modules_multiformats_vendor_varint_length -}; -var protons_runtime_node_modules_multiformats_vendor_varint_brrp_varint = protons_runtime_node_modules_multiformats_vendor_varint_varint; -/* harmony default export */ const protons_runtime_node_modules_multiformats_vendor_varint = (protons_runtime_node_modules_multiformats_vendor_varint_brrp_varint); -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/varint.js +/** + * @typedef {import('./api').Block} Block + * @typedef {import('./api').BlockHeader} BlockHeader + * @typedef {import('./api').BlockIndex} BlockIndex + * @typedef {import('./coding').BytesReader} BytesReader + * @typedef {import('./coding').CarHeader} CarHeader + * @typedef {import('./coding').CarV2Header} CarV2Header + * @typedef {import('./coding').CarV2FixedHeader} CarV2FixedHeader + * @typedef {import('./coding').CarDecoder} CarDecoder + */ /** - * @param {Uint8Array} data - * @param {number} [offset=0] - * @returns {[number, number]} + * Reads header data from a `BytesReader`. The header may either be in the form + * of a `CarHeader` or `CarV2Header` depending on the CAR being read. + * + * @name async decoder.readHeader(reader) + * @param {BytesReader} reader + * @param {number} [strictVersion] + * @returns {Promise} */ -const protons_runtime_node_modules_multiformats_src_varint_decode = (data, offset = 0) => { - const code = varint.decode(data, offset) - return [code, varint.decode.bytes] +async function decoder_readHeader (reader, strictVersion) { + const length = decoder_common_decodeVarint(await reader.upTo(8), reader) + if (length === 0) { + throw new Error('Invalid CAR header (zero length)') + } + const header = await reader.exactly(length, true) + const block = dag_cbor_src_decode(header) + if (header_validator_CarV1HeaderOrV2Pragma.toTyped(block) === undefined) { + throw new Error('Invalid CAR header format') + } + if ((block.version !== 1 && block.version !== 2) || (strictVersion !== undefined && block.version !== strictVersion)) { + throw new Error(`Invalid CAR version: ${block.version}${strictVersion !== undefined ? ` (expected ${strictVersion})` : ''}`) + } + if (block.version === 1) { + // CarV1HeaderOrV2Pragma makes roots optional, let's make it mandatory + if (!Array.isArray(block.roots)) { + throw new Error('Invalid CAR header format') + } + return block + } + // version 2 + if (block.roots !== undefined) { + throw new Error('Invalid CAR header format') + } + const v2Header = decoder_common_decodeV2Header(await reader.exactly(decoder_common_V2_HEADER_LENGTH, true)) + reader.seek(v2Header.dataOffset - reader.pos) + const v1Header = await decoder_readHeader(reader, 1) + return Object.assign(v1Header, v2Header) } /** - * @param {number} int - * @param {Uint8Array} target - * @param {number} [offset=0] + * @param {BytesReader} reader + * @returns {Promise} */ -const protons_runtime_node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => { - protons_runtime_node_modules_multiformats_vendor_varint.encode(int, target, offset) - return target +async function decoder_readCid (reader) { + const first = await reader.exactly(2, false) + if (first[0] === CIDV0_BYTES.SHA2_256 && first[1] === CIDV0_BYTES.LENGTH) { + // cidv0 32-byte sha2-256 + const bytes = await reader.exactly(34, true) + const multihash = Digest.decode(bytes) + return CID.create(0, CIDV0_BYTES.DAG_PB, multihash) + } + + const version = decodeVarint(await reader.upTo(8), reader) + if (version !== 1) { + throw new Error(`Unexpected CID version (${version})`) + } + const codec = decodeVarint(await reader.upTo(8), reader) + const bytes = await reader.exactly(getMultihashLength(await reader.upTo(8)), true) + const multihash = Digest.decode(bytes) + return CID.create(version, codec, multihash) } /** - * @param {number} int - * @returns {number} + * Reads the leading data of an individual block from CAR data from a + * `BytesReader`. Returns a `BlockHeader` object which contains + * `{ cid, length, blockLength }` which can be used to either index the block + * or read the block binary data. + * + * @name async decoder.readBlockHead(reader) + * @param {BytesReader} reader + * @returns {Promise} */ -const protons_runtime_node_modules_multiformats_src_varint_encodingLength = (int) => { - return protons_runtime_node_modules_multiformats_vendor_varint.encodingLength(int) +async function decoder_readBlockHead (reader) { + // length includes a CID + Binary, where CID has a variable length + // we have to deal with + const start = reader.pos + let length = decodeVarint(await reader.upTo(8), reader) + if (length === 0) { + throw new Error('Invalid CAR section (zero length)') + } + length += (reader.pos - start) + const cid = await decoder_readCid(reader) + const blockLength = length - Number(reader.pos - start) // subtract CID length + + return { cid, length, blockLength } } -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/hashes/digest.js +/** + * @param {BytesReader} reader + * @returns {Promise} + */ +async function readBlock (reader) { + const { cid, blockLength } = await decoder_readBlockHead(reader) + const bytes = await reader.exactly(blockLength, true) + return { bytes, cid } +} + +/** + * @param {BytesReader} reader + * @returns {Promise} + */ +async function readBlockIndex (reader) { + const offset = reader.pos + const { cid, length, blockLength } = await decoder_readBlockHead(reader) + const index = { cid, length, blockLength, offset, blockOffset: reader.pos } + reader.seek(index.blockLength) + return index +} + +/** + * Creates a `CarDecoder` from a `BytesReader`. The `CarDecoder` is as async + * interface that will consume the bytes from the `BytesReader` to yield a + * `header()` and either `blocks()` or `blocksIndex()` data. + * + * @name decoder.createDecoder(reader) + * @param {BytesReader} reader + * @returns {CarDecoder} + */ +function decoder_createDecoder (reader) { + const headerPromise = (async () => { + const header = await decoder_readHeader(reader) + if (header.version === 2) { + const v1length = reader.pos - header.dataOffset + reader = decoder_limitReader(reader, header.dataSize - v1length) + } + return header + })() + + return { + header: () => headerPromise, + async * blocks () { + await headerPromise + while ((await reader.upTo(8)).length > 0) { + yield await readBlock(reader) + } + }, + async * blocksIndex () { + await headerPromise + while ((await reader.upTo(8)).length > 0) { + yield await readBlockIndex(reader) + } + } + } +} /** - * Creates a multihash digest. + * Creates a `BytesReader` from a `Uint8Array`. * - * @template {number} Code - * @param {Code} code - * @param {Uint8Array} digest + * @name decoder.bytesReader(bytes) + * @param {Uint8Array} bytes + * @returns {BytesReader} */ -const protons_runtime_node_modules_multiformats_src_hashes_digest_create = (code, digest) => { - const size = digest.byteLength - const sizeOffset = protons_runtime_node_modules_multiformats_src_varint_encodingLength(code) - const digestOffset = sizeOffset + protons_runtime_node_modules_multiformats_src_varint_encodingLength(size) +function decoder_bytesReader (bytes) { + let pos = 0 - const bytes = new Uint8Array(digestOffset + size) - protons_runtime_node_modules_multiformats_src_varint_encodeTo(code, bytes, 0) - protons_runtime_node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset) - bytes.set(digest, digestOffset) + /** @type {BytesReader} */ + return { + async upTo (length) { + const out = bytes.subarray(pos, pos + Math.min(length, bytes.length - pos)) + return out + }, - return new protons_runtime_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) + async exactly (length, seek = false) { + if (length > bytes.length - pos) { + throw new Error('Unexpected end of data') + } + const out = bytes.subarray(pos, pos + length) + if (seek) { + pos += length + } + return out + }, + + seek (length) { + pos += length + }, + + get pos () { + return pos + } + } } /** - * Turns bytes representation of multihash digest into an instance. + * @ignore + * reusable reader for streams and files, we just need a way to read an + * additional chunk (of some undetermined size) and a way to close the + * reader when finished + * @param {() => Promise} readChunk + * @returns {BytesReader} + */ +function chunkReader (readChunk /*, closer */) { + let pos = 0 + let have = 0 + let offset = 0 + let currentChunk = new Uint8Array(0) + + const read = async (/** @type {number} */ length) => { + have = currentChunk.length - offset + const bufa = [currentChunk.subarray(offset)] + while (have < length) { + const chunk = await readChunk() + if (chunk == null) { + break + } + /* c8 ignore next 8 */ + // undo this ignore ^ when we have a fd implementation that can seek() + if (have < 0) { // because of a seek() + /* c8 ignore next 4 */ + // toohard to test the else + if (chunk.length > have) { + bufa.push(chunk.subarray(-have)) + } // else discard + } else { + bufa.push(chunk) + } + have += chunk.length + } + currentChunk = new Uint8Array(bufa.reduce((p, c) => p + c.length, 0)) + let off = 0 + for (const b of bufa) { + currentChunk.set(b, off) + off += b.length + } + offset = 0 + } + + /** @type {BytesReader} */ + return { + async upTo (length) { + if (currentChunk.length - offset < length) { + await read(length) + } + return currentChunk.subarray(offset, offset + Math.min(currentChunk.length - offset, length)) + }, + + async exactly (length, seek = false) { + if (currentChunk.length - offset < length) { + await read(length) + } + if (currentChunk.length - offset < length) { + throw new Error('Unexpected end of data') + } + const out = currentChunk.subarray(offset, offset + length) + if (seek) { + pos += length + offset += length + } + return out + }, + + seek (length) { + pos += length + offset += length + }, + + get pos () { + return pos + } + } +} + +/** + * Creates a `BytesReader` from an `AsyncIterable`, which allows for + * consumption of CAR data from a streaming source. * - * @param {Uint8Array} multihash - * @returns {MultihashDigest} + * @name decoder.asyncIterableReader(asyncIterable) + * @param {AsyncIterable} asyncIterable + * @returns {BytesReader} */ -const protons_runtime_node_modules_multiformats_src_hashes_digest_decode = (multihash) => { - const bytes = coerce(multihash) - const [code, sizeOffset] = varint.decode(bytes) - const [size, digestOffset] = varint.decode(bytes.subarray(sizeOffset)) - const digest = bytes.subarray(sizeOffset + digestOffset) +function decoder_asyncIterableReader (asyncIterable) { + const iterator = asyncIterable[Symbol.asyncIterator]() - if (digest.byteLength !== size) { - throw new Error('Incorrect length') + async function readChunk () { + const next = await iterator.next() + if (next.done) { + return null + } + return next.value } - return new protons_runtime_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) + return chunkReader(readChunk) } /** - * @param {MultihashDigest} a - * @param {unknown} b - * @returns {b is MultihashDigest} + * Wraps a `BytesReader` in a limiting `BytesReader` which limits maximum read + * to `byteLimit` bytes. It _does not_ update `pos` of the original + * `BytesReader`. + * + * @name decoder.limitReader(reader, byteLimit) + * @param {BytesReader} reader + * @param {number} byteLimit + * @returns {BytesReader} */ -const protons_runtime_node_modules_multiformats_src_hashes_digest_equals = (a, b) => { - if (a === b) { - return true - } else { - const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) +function decoder_limitReader (reader, byteLimit) { + let bytesRead = 0 - return ( - a.code === data.code && - a.size === data.size && - data.bytes instanceof Uint8Array && - equalBytes(a.bytes, data.bytes) - ) + /** @type {BytesReader} */ + return { + async upTo (length) { + let bytes = await reader.upTo(length) + if (bytes.length + bytesRead > byteLimit) { + bytes = bytes.subarray(0, byteLimit - bytesRead) + } + return bytes + }, + + async exactly (length, seek = false) { + const bytes = await reader.exactly(length, seek) + if (bytes.length + bytesRead > byteLimit) { + throw new Error('Unexpected end of data') + } + if (seek) { + bytesRead += length + } + return bytes + }, + + seek (length) { + bytesRead += length + reader.seek(length) + }, + + get pos () { + return reader.pos + } } } +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/indexer.js + + /** - * @typedef {import('./interface.js').MultihashDigest} MultihashDigest + * @typedef {import('multiformats').CID} CID + * @typedef {import('./api').Block} Block + * @typedef {import('./api').RootsReader} RootsReader + * @typedef {import('./api').BlockIndex} BlockIndex + * @typedef {import('./coding').BytesReader} BytesReader */ /** - * Represents a multihash digest which carries information about the - * hashing algorithm and an actual hash digest. + * Provides an iterator over all of the `Block`s in a CAR, returning their CIDs + * and byte-location information. Implements an `AsyncIterable`. + * Where a `BlockIndex` is a + * `{ cid:CID, length:number, offset:number, blockLength:number, blockOffset:number }`. * - * @template {number} Code - * @template {number} Size + * As an implementer of `AsyncIterable`, this class can be used directly in a + * `for await (const blockIndex of iterator) {}` loop. Where the `iterator` is + * constructed using {@link CarIndexer.fromBytes} or + * {@link CarIndexer.fromIterable}. + * + * An iteration can only be performce _once_ per instantiation. + * + * `CarIndexer` also implements the `RootsReader` interface and provides + * the {@link CarIndexer.getRoots `getRoots()`} method. + * + * Load this class with either + * `import { CarIndexer } from '@ipld/car/indexer'` + * (`const { CarIndexer } = require('@ipld/car/indexer')`). Or + * `import { CarIndexer } from '@ipld/car'` + * (`const { CarIndexer } = require('@ipld/car')`). The former will likely + * result in smaller bundle sizes where this is important. + * + * @name CarIndexer * @class - * @implements {MultihashDigest} + * @implements {RootsReader} + * @implements {AsyncIterable} + * @property {number} version The version number of the CAR referenced by this + * reader (should be `1`). */ -class protons_runtime_node_modules_multiformats_src_hashes_digest_Digest { +class indexer_CarIndexer { /** - * Creates a multihash digest. + * @param {number} version + * @param {CID[]} roots + * @param {AsyncGenerator} iterator + */ + constructor (version, roots, iterator) { + this._version = version + this._roots = roots + this._iterator = iterator + } + + get version () { + return this._version + } + + /** + * Get the list of roots defined by the CAR referenced by this indexer. May be + * zero or more `CID`s. + * + * @function + * @memberof CarIndexer + * @instance + * @async + * @returns {Promise} + */ + async getRoots () { + return this._roots + } + + /** + * @returns {AsyncIterator} + */ + [Symbol.asyncIterator] () { + return this._iterator + } + + /** + * Instantiate a {@link CarIndexer} from a `Uint8Array` blob. Only the header + * is decoded initially, the remainder is processed and emitted via the + * iterator as it is consumed. + * + * @async + * @static + * @memberof CarIndexer + * @param {Uint8Array} bytes + * @returns {Promise} + */ + static async fromBytes (bytes) { + if (!(bytes instanceof Uint8Array)) { + throw new TypeError('fromBytes() requires a Uint8Array') + } + return decodeIndexerComplete(bytesReader(bytes)) + } + + /** + * Instantiate a {@link CarIndexer} from a `AsyncIterable`, + * such as a [modern Node.js stream](https://nodejs.org/api/stream.html#stream_streams_compatibility_with_async_generators_and_async_iterators). + * is decoded initially, the remainder is processed and emitted via the + * iterator as it is consumed. * - * @param {Code} code - * @param {Size} size - * @param {Uint8Array} digest - * @param {Uint8Array} bytes + * @async + * @static + * @memberof CarIndexer + * @param {AsyncIterable} asyncIterable + * @returns {Promise} */ - constructor (code, size, digest, bytes) { - this.code = code - this.size = size - this.digest = digest - this.bytes = bytes + static async fromIterable (asyncIterable) { + if (!asyncIterable || !(typeof asyncIterable[Symbol.asyncIterator] === 'function')) { + throw new TypeError('fromIterable() requires an async iterable') + } + return decodeIndexerComplete(asyncIterableReader(asyncIterable)) } } -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/hashes/identity.js - - - -const protons_runtime_node_modules_multiformats_src_hashes_identity_code = 0x0 -const protons_runtime_node_modules_multiformats_src_hashes_identity_name = 'identity' - -/** @type {(input:Uint8Array) => Uint8Array} */ -const protons_runtime_node_modules_multiformats_src_hashes_identity_encode = protons_runtime_node_modules_multiformats_src_bytes_coerce - /** - * @param {Uint8Array} input - * @returns {Digest.Digest} + * @private + * @param {BytesReader} reader + * @returns {Promise} */ -const protons_runtime_node_modules_multiformats_src_hashes_identity_digest = (input) => protons_runtime_node_modules_multiformats_src_hashes_digest_create(protons_runtime_node_modules_multiformats_src_hashes_identity_code, protons_runtime_node_modules_multiformats_src_hashes_identity_encode(input)) +async function decodeIndexerComplete (reader) { + const decoder = createDecoder(reader) + const { version, roots } = await decoder.header() -const protons_runtime_node_modules_multiformats_src_hashes_identity_identity = { code: protons_runtime_node_modules_multiformats_src_hashes_identity_code, name: protons_runtime_node_modules_multiformats_src_hashes_identity_name, encode: protons_runtime_node_modules_multiformats_src_hashes_identity_encode, digest: protons_runtime_node_modules_multiformats_src_hashes_identity_digest } + return new indexer_CarIndexer(version, roots, decoder.blocksIndex()) +} -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/hashes/hasher.js +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/reader-browser.js /** - * @template {string} Name - * @template {number} Code - * @param {object} options - * @param {Name} options.name - * @param {Code} options.code - * @param {(input: Uint8Array) => Await} options.encode + * @typedef {import('multiformats').CID} CID + * @typedef {import('./api').Block} Block + * @typedef {import('./api').CarReader} CarReaderIface + * @typedef {import('./coding').BytesReader} BytesReader + * @typedef {import('./coding').CarHeader} CarHeader + * @typedef {import('./coding').CarV2Header} CarV2Header */ -const protons_runtime_node_modules_multiformats_src_hashes_hasher_from = ({ name, code, encode }) => new protons_runtime_node_modules_multiformats_src_hashes_hasher_Hasher(name, code, encode) /** - * Hasher represents a hashing algorithm implementation that produces as - * `MultihashDigest`. + * Provides blockstore-like access to a CAR. * - * @template {string} Name - * @template {number} Code + * Implements the `RootsReader` interface: + * {@link CarReader.getRoots `getRoots()`}. And the `BlockReader` interface: + * {@link CarReader.get `get()`}, {@link CarReader.has `has()`}, + * {@link CarReader.blocks `blocks()`} (defined as a `BlockIterator`) and + * {@link CarReader.cids `cids()`} (defined as a `CIDIterator`). + * + * Load this class with either `import { CarReader } from '@ipld/car/reader'` + * (`const { CarReader } = require('@ipld/car/reader')`). Or + * `import { CarReader } from '@ipld/car'` (`const { CarReader } = require('@ipld/car')`). + * The former will likely result in smaller bundle sizes where this is + * important. + * + * @name CarReader * @class - * @implements {MultihashHasher} + * @implements {CarReaderIface} + * @property {number} version The version number of the CAR referenced by this + * reader (should be `1` or `2`). */ -class protons_runtime_node_modules_multiformats_src_hashes_hasher_Hasher { +class CarReader { /** - * - * @param {Name} name - * @param {Code} code - * @param {(input: Uint8Array) => Await} encode + * @constructs CarReader + * @param {CarHeader|CarV2Header} header + * @param {Block[]} blocks */ - constructor (name, code, encode) { - this.name = name - this.code = code - this.encode = encode + constructor (header, blocks) { + this._header = header + this._blocks = blocks + this._keys = blocks.map((b) => b.cid.toString()) } /** - * @param {Uint8Array} input - * @returns {Await>} + * @property + * @memberof CarReader + * @instance */ - digest (input) { - if (input instanceof Uint8Array) { - const result = this.encode(input) - return result instanceof Uint8Array - ? protons_runtime_node_modules_multiformats_src_hashes_digest_create(this.code, result) - /* c8 ignore next 1 */ - : result.then(digest => protons_runtime_node_modules_multiformats_src_hashes_digest_create(this.code, digest)) - } else { - throw Error('Unknown type, must be binary type') - /* c8 ignore next 1 */ - } + get version () { + return this._header.version } -} - -/** - * @template {number} Alg - * @typedef {import('./interface.js').MultihashHasher} MultihashHasher - */ -/** - * @template T - * @typedef {Promise|T} Await - */ - -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/hashes/sha2.js -// @ts-check + /** + * Get the list of roots defined by the CAR referenced by this reader. May be + * zero or more `CID`s. + * + * @function + * @memberof CarReader + * @instance + * @async + * @returns {Promise} + */ + async getRoots () { + return this._header.roots + } + /** + * Check whether a given `CID` exists within the CAR referenced by this + * reader. + * + * @function + * @memberof CarReader + * @instance + * @async + * @param {CID} key + * @returns {Promise} + */ + async has (key) { + return this._keys.indexOf(key.toString()) > -1 + } + /** + * Fetch a `Block` (a `{ cid:CID, bytes:Uint8Array }` pair) from the CAR + * referenced by this reader matching the provided `CID`. In the case where + * the provided `CID` doesn't exist within the CAR, `undefined` will be + * returned. + * + * @function + * @memberof CarReader + * @instance + * @async + * @param {CID} key + * @returns {Promise} + */ + async get (key) { + const index = this._keys.indexOf(key.toString()) + return index > -1 ? this._blocks[index] : undefined + } + /** + * Returns a `BlockIterator` (`AsyncIterable`) that iterates over all + * of the `Block`s (`{ cid:CID, bytes:Uint8Array }` pairs) contained within + * the CAR referenced by this reader. + * + * @function + * @memberof CarReader + * @instance + * @async + * @generator + * @returns {AsyncGenerator} + */ + async * blocks () { + for (const block of this._blocks) { + yield block + } + } + /** + * Returns a `CIDIterator` (`AsyncIterable`) that iterates over all of + * the `CID`s contained within the CAR referenced by this reader. + * + * @function + * @memberof CarReader + * @instance + * @async + * @generator + * @returns {AsyncGenerator} + */ + async * cids () { + for (const block of this._blocks) { + yield block.cid + } + } -const protons_runtime_node_modules_multiformats_src_hashes_sha2_sha256 = protons_runtime_node_modules_multiformats_src_hashes_hasher_from({ - name: 'sha2-256', - code: 0x12, - encode: (input) => protons_runtime_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha256').update(input).digest()) -}) + /** + * Instantiate a {@link CarReader} from a `Uint8Array` blob. This performs a + * decode fully in memory and maintains the decoded state in memory for full + * access to the data via the `CarReader` API. + * + * @async + * @static + * @memberof CarReader + * @param {Uint8Array} bytes + * @returns {Promise} + */ + static async fromBytes (bytes) { + if (!(bytes instanceof Uint8Array)) { + throw new TypeError('fromBytes() requires a Uint8Array') + } + return decodeReaderComplete(bytesReader(bytes)) + } -const protons_runtime_node_modules_multiformats_src_hashes_sha2_sha512 = protons_runtime_node_modules_multiformats_src_hashes_hasher_from({ - name: 'sha2-512', - code: 0x13, - encode: input => protons_runtime_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha512').update(input).digest()) -}) + /** + * Instantiate a {@link CarReader} from a `AsyncIterable`, such as + * a [modern Node.js stream](https://nodejs.org/api/stream.html#stream_streams_compatibility_with_async_generators_and_async_iterators). + * This performs a decode fully in memory and maintains the decoded state in + * memory for full access to the data via the `CarReader` API. + * + * Care should be taken for large archives; this API may not be appropriate + * where memory is a concern or the archive is potentially larger than the + * amount of memory that the runtime can handle. + * + * @async + * @static + * @memberof CarReader + * @param {AsyncIterable} asyncIterable + * @returns {Promise} + */ + static async fromIterable (asyncIterable) { + if (!asyncIterable || !(typeof asyncIterable[Symbol.asyncIterator] === 'function')) { + throw new TypeError('fromIterable() requires an async iterable') + } + return decodeReaderComplete(asyncIterableReader(asyncIterable)) + } +} -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/cid.js +/** + * @private + * @param {BytesReader} reader + * @returns {Promise} + */ +async function decodeReaderComplete (reader) { + const decoder = createDecoder(reader) + const header = await decoder.header() + const blocks = [] + for await (const block of decoder.blocks()) { + blocks.push(block) + } + return new CarReader(header, blocks) +} +const reader_browser_browser = true +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/reader.js -// Linter can see that API is used in types. -// eslint-disable-next-line -// This way TS will also expose all the types from module +/** + * @typedef {import('./api').Block} Block + * @typedef {import('./api').BlockIndex} BlockIndex + * @typedef {import('./api').CarReader} CarReaderIface + */ +const reader_fsread = (0,external_util_.promisify)(external_fs_.read) /** - * @template {API.Link} T - * @template {string} Prefix - * @param {T} link - * @param {API.MultibaseEncoder} [base] - * @returns {API.ToString} + * @class + * @implements {CarReaderIface} */ -const protons_runtime_node_modules_multiformats_src_cid_format = (link, base) => { - const { bytes, version } = link - switch (version) { - case 0: - return protons_runtime_node_modules_multiformats_src_cid_toStringV0( - bytes, - protons_runtime_node_modules_multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder<"z">} */ (base) || base58btc.encoder - ) - default: - return protons_runtime_node_modules_multiformats_src_cid_toStringV1( - bytes, - protons_runtime_node_modules_multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder} */ (base || base32.encoder) - ) +class reader_CarReader extends (/* unused pure expression or super */ null && (BrowserCarReader)) { + /** + * Reads a block directly from a file descriptor for an open CAR file. This + * function is **only available in Node.js** and not a browser environment. + * + * This function can be used in connection with {@link CarIndexer} which emits + * the `BlockIndex` objects that are required by this function. + * + * The user is responsible for opening and closing the file used in this call. + * + * @async + * @static + * @memberof CarReader + * @param {fs.promises.FileHandle | number} fd - A file descriptor from the + * Node.js `fs` module. Either an integer, from `fs.open()` or a `FileHandle` + * from `fs.promises.open()`. + * @param {BlockIndex} blockIndex - An index pointing to the location of the + * Block required. This `BlockIndex` should take the form: + * `{cid:CID, blockLength:number, blockOffset:number}`. + * @returns {Promise} A `{ cid:CID, bytes:Uint8Array }` pair. + */ + static async readRaw (fd, blockIndex) { + const { cid, blockLength, blockOffset } = blockIndex + const bytes = new Uint8Array(blockLength) + let read + if (typeof fd === 'number') { + read = (await reader_fsread(fd, bytes, 0, blockLength, blockOffset)).bytesRead + } else if (typeof fd === 'object' && typeof fd.read === 'function') { // FileDescriptor + read = (await fd.read(bytes, 0, blockLength, blockOffset)).bytesRead + } else { + throw new TypeError('Bad fd') + } + if (read !== blockLength) { + throw new Error(`Failed to read entire block (${read} instead of ${blockLength})`) + } + return { cid, bytes } } } -/** - * @template {API.UnknownLink} Link - * @param {Link} link - * @returns {API.LinkJSON} - */ -const protons_runtime_node_modules_multiformats_src_cid_toJSON = (link) => ({ - '/': protons_runtime_node_modules_multiformats_src_cid_format(link) -}) +const reader_browser = false + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/indexed-reader.js + + + -/** - * @template {API.UnknownLink} Link - * @param {API.LinkJSON} json - */ -const protons_runtime_node_modules_multiformats_src_cid_fromJSON = (json) => - protons_runtime_node_modules_multiformats_src_cid_CID.parse(json['/']) -/** @type {WeakMap>} */ -const protons_runtime_node_modules_multiformats_src_cid_cache = new WeakMap() /** - * @param {API.UnknownLink} cid - * @returns {Map} + * @typedef {import('fs').promises.FileHandle} FileHandle + * @typedef {import('./api').Block} Block + * @typedef {import('./api').BlockIndex} BlockIndex + * @typedef {import('./api').CarReader} CarReaderIface + * @typedef {import('./reader-browser').CarReader} CarReader + * @typedef {{ blockLength:number, blockOffset:number }} RawLocation */ -const protons_runtime_node_modules_multiformats_src_cid_baseCache = cid => { - const baseCache = protons_runtime_node_modules_multiformats_src_cid_cache.get(cid) - if (baseCache == null) { - const baseCache = new Map() - protons_runtime_node_modules_multiformats_src_cid_cache.set(cid, baseCache) - return baseCache - } - return baseCache -} /** - * @template {unknown} [Data=unknown] - * @template {number} [Format=number] - * @template {number} [Alg=number] - * @template {API.Version} [Version=API.Version] - * @implements {API.Link} + * A form of {@link CarReader} that pre-indexes a CAR archive from a file and + * provides random access to blocks within the file using the index data. This + * function is **only available in Node.js** and not a browser environment. + * + * For large CAR files, using this form of `CarReader` can be singificantly more + * efficient in terms of memory. The index consists of a list of `CID`s and + * their location within the archive (see {@link CarIndexer}). For large numbers + * of blocks, this index can also occupy a significant amount of memory. In some + * cases it may be necessary to expand the memory capacity of a Node.js instance + * to allow this index to fit. (e.g. by running with + * `NODE_OPTIONS="--max-old-space-size=16384"`). + * + * As an `CarIndexedReader` instance maintains an open file descriptor for its + * CAR file, an additional {@link CarReader#close} method is attached. This + * _must_ be called to have full clean-up of resources after use. + * + * Load this class with either + * `import { CarIndexedReader } from '@ipld/car/indexed-reader'` + * (`const { CarIndexedReader } = require('@ipld/car/indexed-reader')`). Or + * `import { CarIndexedReader } from '@ipld/car'` + * (`const { CarIndexedReader } = require('@ipld/car')`). The former will likely + * result in smaller bundle sizes where this is important. + * + * @name CarIndexedReader + * @class + * @implements {CarReaderIface} + * @extends {CarReader} + * @property {number} version The version number of the CAR referenced by this + * reader (should be `1`). */ - -class protons_runtime_node_modules_multiformats_src_cid_CID { +class CarIndexedReader { /** - * @param {Version} version - Version of the CID - * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content. - * @param {Uint8Array} bytes + * @param {number} version + * @param {string} path + * @param {CID[]} roots + * @param {Map} index + * @param {string[]} order */ - constructor (version, code, multihash, bytes) { - /** @readonly */ - this.code = code - /** @readonly */ - this.version = version - /** @readonly */ - this.multihash = multihash - /** @readonly */ - this.bytes = bytes + constructor (version, path, roots, index, order) { + this._version = version + this._path = path + this._roots = roots + this._index = index + this._order = order + this._fd = null + } - // flag to serializers that this is a CID and - // should be treated specially - /** @readonly */ - this['/'] = bytes + get version () { + return this._version } /** - * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` - * please either use `CID.asCID(cid)` or switch to new signalling mechanism + * See {@link CarReader#getRoots} * - * @deprecated + * @function + * @memberof CarIndexedReader + * @instance + * @async + * @returns {Promise} */ - get asCID () { - return this - } - - // ArrayBufferView - get byteOffset () { - return this.bytes.byteOffset + async getRoots () { + return this._roots } - // ArrayBufferView - get byteLength () { - return this.bytes.byteLength + /** + * See {@link CarReader#has} + * + * @function + * @memberof CarIndexedReader + * @instance + * @async + * @param {CID} key + * @returns {Promise} + */ + async has (key) { + return this._index.has(key.toString()) } /** - * @returns {CID} + * See {@link CarReader#get} + * + * @function + * @memberof CarIndexedReader + * @instance + * @async + * @param {CID} key + * @returns {Promise} */ - toV0 () { - switch (this.version) { - case 0: { - return /** @type {CID} */ (this) - } - case 1: { - const { code, multihash } = this - - if (code !== protons_runtime_node_modules_multiformats_src_cid_DAG_PB_CODE) { - throw new Error('Cannot convert a non dag-pb CID to CIDv0') - } - - // sha2-256 - if (multihash.code !== protons_runtime_node_modules_multiformats_src_cid_SHA_256_CODE) { - throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') - } - - return /** @type {CID} */ ( - protons_runtime_node_modules_multiformats_src_cid_CID.createV0( - /** @type {API.MultihashDigest} */ (multihash) - ) - ) - } - default: { - throw Error( - `Can not convert CID version ${this.version} to version 0. This is a bug please report` - ) - } + async get (key) { + const blockIndex = this._index.get(key.toString()) + if (!blockIndex) { + return undefined + } + if (!this._fd) { + this._fd = await fs.promises.open(this._path, 'r') + } + const readIndex = { + cid: key, + length: 0, + offset: 0, + blockLength: blockIndex.blockLength, + blockOffset: blockIndex.blockOffset } + return NodeCarReader.readRaw(this._fd, readIndex) } /** - * @returns {CID} + * See {@link CarReader#blocks} + * + * @function + * @memberof CarIndexedReader + * @instance + * @async + * @generator + * @returns {AsyncGenerator} */ - toV1 () { - switch (this.version) { - case 0: { - const { code, digest } = this.multihash - const multihash = Digest.create(code, digest) - return /** @type {CID} */ ( - protons_runtime_node_modules_multiformats_src_cid_CID.createV1(this.code, multihash) - ) - } - case 1: { - return /** @type {CID} */ (this) - } - default: { - throw Error( - `Can not convert CID version ${this.version} to version 1. This is a bug please report` - ) + async * blocks () { + for (const cidStr of this._order) { + const block = await this.get(CID.parse(cidStr)) + /* c8 ignore next 3 */ + if (!block) { + throw new Error('Unexpected internal error') } + yield block } } /** - * @param {unknown} other - * @returns {other is CID} + * See {@link CarReader#cids} + * + * @function + * @memberof CarIndexedReader + * @instance + * @async + * @generator + * @returns {AsyncGenerator} */ - equals (other) { - return protons_runtime_node_modules_multiformats_src_cid_CID.equals(this, other) + async * cids () { + for (const cidStr of this._order) { + yield CID.parse(cidStr) + } } /** - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @param {API.Link} self - * @param {unknown} other - * @returns {other is CID} + * Close the underlying file descriptor maintained by this `CarIndexedReader`. + * This must be called for proper resource clean-up to occur. + * + * @function + * @memberof CarIndexedReader + * @instance + * @async + * @returns {Promise} */ - static equals (self, other) { - const unknown = - /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ ( - other - ) - return ( - unknown && - self.code === unknown.code && - self.version === unknown.version && - Digest.equals(self.multihash, unknown.multihash) - ) + async close () { + if (this._fd) { + return this._fd.close() + } } /** - * @param {API.MultibaseEncoder} [base] - * @returns {string} + * Instantiate an {@link CarIndexedReader} from a file with the provided + * `path`. The CAR file is first indexed with a full path that collects `CID`s + * and block locations. This index is maintained in memory. Subsequent reads + * operate on a read-only file descriptor, fetching the block from its in-file + * location. + * + * For large archives, the initial indexing may take some time. The returned + * `Promise` will resolve only after this is complete. + * + * @async + * @static + * @memberof CarIndexedReader + * @param {string} path + * @returns {Promise} */ - toString (base) { - return protons_runtime_node_modules_multiformats_src_cid_format(this, base) - } + static async fromFile (path) { + if (typeof path !== 'string') { + throw new TypeError('fromFile() requires a file path string') + } - /** - * @returns {API.LinkJSON} - */ - toJSON () { - return { '/': protons_runtime_node_modules_multiformats_src_cid_format(this) } + const iterable = await CarIndexer.fromIterable(Readable.from(fs.createReadStream(path))) + /** @type {Map} */ + const index = new Map() + /** @type {string[]} */ + const order = [] + for await (const { cid, blockLength, blockOffset } of iterable) { + const cidStr = cid.toString() + index.set(cidStr, { blockLength, blockOffset }) + order.push(cidStr) + } + return new CarIndexedReader(iterable.version, path, await iterable.getRoots(), index, order) } +} - link () { - return this - } +const indexed_reader_browser = false - get [Symbol.toStringTag] () { - return 'CID' - } +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/iterator.js - // Legacy - [Symbol.for('nodejs.util.inspect.custom')] () { - return `CID(${this.toString()})` - } +/** + * @typedef {import('multiformats').CID} CID + * @typedef {import('./api').Block} Block + * @typedef {import('./api').RootsReader} RootsReader + * @typedef {import('./coding').BytesReader} BytesReader + */ +/** + * @class + * @implements {RootsReader} + * @property {number} version The version number of the CAR referenced by this reader (should be `1`). + */ +class CarIteratorBase { /** - * Takes any input `value` and returns a `CID` instance if it was - * a `CID` otherwise returns `null`. If `value` is instanceof `CID` - * it will return value back. If `value` is not instance of this CID - * class, but is compatible CID it will return new instance of this - * `CID` class. Otherwise returns null. - * - * This allows two different incompatible versions of CID library to - * co-exist and interop as long as binary interface is compatible. - * - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @template {unknown} U - * @param {API.Link|U} input - * @returns {CID|null} + * @param {number} version + * @param {CID[]} roots + * @param {AsyncIterable|void} iterable */ - static asCID (input) { - if (input == null) { - return null - } + constructor (version, roots, iterable) { + this._version = version + this._roots = roots + this._iterable = iterable + this._decoded = false + } - const value = /** @type {any} */ (input) - if (value instanceof protons_runtime_node_modules_multiformats_src_cid_CID) { - // If value is instance of CID then we're all set. - return value - } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { - // If value isn't instance of this CID class but `this.asCID === this` or - // `value['/'] === value.bytes` is true it is CID instance coming from a - // different implementation (diff version or duplicate). In that case we - // rebase it to this `CID` implementation so caller is guaranteed to get - // instance with expected API. - const { version, code, multihash, bytes } = value - return new protons_runtime_node_modules_multiformats_src_cid_CID( - version, - code, - /** @type {API.MultihashDigest} */ (multihash), - bytes || protons_runtime_node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes) - ) - } else if (value[protons_runtime_node_modules_multiformats_src_cid_cidSymbol] === true) { - // If value is a CID from older implementation that used to be tagged via - // symbol we still rebase it to the this `CID` implementation by - // delegating that to a constructor. - const { version, multihash, code } = value - const digest = - /** @type {API.MultihashDigest} */ - (Digest.decode(multihash)) - return protons_runtime_node_modules_multiformats_src_cid_CID.create(version, code, digest) - } else { - // Otherwise value is not a CID (or an incompatible version of it) in - // which case we return `null`. - return null - } + get version () { + return this._version + } + + /** + * @returns {Promise} + */ + async getRoots () { + return this._roots } +} +/** + * Provides an iterator over all of the `Block`s in a CAR. Implements a + * `BlockIterator` interface, or `AsyncIterable`. Where a `Block` is + * a `{ cid:CID, bytes:Uint8Array }` pair. + * + * As an implementer of `AsyncIterable`, this class can be used directly in a + * `for await (const block of iterator) {}` loop. Where the `iterator` is + * constructed using {@link CarBlockiterator.fromBytes} or + * {@link CarBlockiterator.fromIterable}. + * + * An iteration can only be performce _once_ per instantiation. + * + * `CarBlockIterator` also implements the `RootsReader` interface and provides + * the {@link CarBlockiterator.getRoots `getRoots()`} method. + * + * Load this class with either + * `import { CarBlockIterator } from '@ipld/car/iterator'` + * (`const { CarBlockIterator } = require('@ipld/car/iterator')`). Or + * `import { CarBlockIterator } from '@ipld/car'` + * (`const { CarBlockIterator } = require('@ipld/car')`). + * + * @name CarBlockIterator + * @class + * @implements {RootsReader} + * @implements {AsyncIterable} + * @property {number} version The version number of the CAR referenced by this + * iterator (should be `1`). + */ +class CarBlockIterator extends (/* unused pure expression or super */ null && (CarIteratorBase)) { + // inherited method /** + * Get the list of roots defined by the CAR referenced by this iterator. May be + * zero or more `CID`s. * - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @param {Version} version - Version of the CID - * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param {API.MultihashDigest} digest - (Multi)hash of the of the content. - * @returns {CID} + * @function getRoots + * @memberof CarBlockIterator + * @instance + * @async + * @returns {Promise} */ - static create (version, code, digest) { - if (typeof code !== 'number') { - throw new Error('String codecs are no longer supported') - } - if (!(digest.bytes instanceof Uint8Array)) { - throw new Error('Invalid digest') + /** + * @returns {AsyncIterator} + */ + [Symbol.asyncIterator] () { + if (this._decoded) { + throw new Error('Cannot decode more than once') } - - switch (version) { - case 0: { - if (code !== protons_runtime_node_modules_multiformats_src_cid_DAG_PB_CODE) { - throw new Error( - `Version 0 CID must use dag-pb (code: ${protons_runtime_node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding` - ) - } else { - return new protons_runtime_node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes) - } - } - case 1: { - const bytes = protons_runtime_node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes) - return new protons_runtime_node_modules_multiformats_src_cid_CID(version, code, digest, bytes) - } - default: { - throw new Error('Invalid version') - } + /* c8 ignore next 3 */ + if (!this._iterable) { + throw new Error('Block iterable not found') } + this._decoded = true + return this._iterable[Symbol.asyncIterator]() } /** - * Simplified version of `create` for CIDv0. + * Instantiate a {@link CarBlockIterator} from a `Uint8Array` blob. Rather + * than decoding the entire byte array prior to returning the iterator, as in + * {@link CarReader.fromBytes}, only the header is decoded and the remainder + * of the CAR is parsed as the `Block`s as yielded. * - * @template {unknown} [T=unknown] - * @param {API.MultihashDigest} digest - Multihash. - * @returns {CID} + * @async + * @static + * @memberof CarBlockIterator + * @param {Uint8Array} bytes + * @returns {Promise} */ - static createV0 (digest) { - return protons_runtime_node_modules_multiformats_src_cid_CID.create(0, protons_runtime_node_modules_multiformats_src_cid_DAG_PB_CODE, digest) + static async fromBytes (bytes) { + const { version, roots, iterator } = await iterator_fromBytes(bytes) + return new CarBlockIterator(version, roots, iterator) } /** - * Simplified version of `create` for CIDv1. + * Instantiate a {@link CarBlockIterator} from a `AsyncIterable`, + * such as a [modern Node.js stream](https://nodejs.org/api/stream.html#stream_streams_compatibility_with_async_generators_and_async_iterators). + * Rather than decoding the entire byte array prior to returning the iterator, + * as in {@link CarReader.fromIterable}, only the header is decoded and the + * remainder of the CAR is parsed as the `Block`s as yielded. * - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @param {Code} code - Content encoding format code. - * @param {API.MultihashDigest} digest - Miltihash of the content. - * @returns {CID} + * @async + * @static + * @param {AsyncIterable} asyncIterable + * @returns {Promise} */ - static createV1 (code, digest) { - return protons_runtime_node_modules_multiformats_src_cid_CID.create(1, code, digest) + static async fromIterable (asyncIterable) { + const { version, roots, iterator } = await fromIterable(asyncIterable) + return new CarBlockIterator(version, roots, iterator) } +} +/** + * Provides an iterator over all of the `CID`s in a CAR. Implements a + * `CIDIterator` interface, or `AsyncIterable`. Similar to + * {@link CarBlockIterator} but only yields the CIDs in the CAR. + * + * As an implementer of `AsyncIterable`, this class can be used directly in a + * `for await (const cid of iterator) {}` loop. Where the `iterator` is + * constructed using {@link CarCIDiterator.fromBytes} or + * {@link CarCIDiterator.fromIterable}. + * + * An iteration can only be performce _once_ per instantiation. + * + * `CarCIDIterator` also implements the `RootsReader` interface and provides + * the {@link CarCIDiterator.getRoots `getRoots()`} method. + * + * Load this class with either + * `import { CarCIDIterator } from '@ipld/car/iterator'` + * (`const { CarCIDIterator } = require('@ipld/car/iterator')`). Or + * `import { CarCIDIterator } from '@ipld/car'` + * (`const { CarCIDIterator } = require('@ipld/car')`). + * + * @name CarCIDIterator + * @class + * @implements {RootsReader} + * @implements {AsyncIterable} + * @property {number} version The version number of the CAR referenced by this + * iterator (should be `1`). + */ +class CarCIDIterator extends (/* unused pure expression or super */ null && (CarIteratorBase)) { + // inherited method /** - * Decoded a CID from its binary representation. The byte array must contain - * only the CID with no additional bytes. - * - * An error will be thrown if the bytes provided do not contain a valid - * binary representation of a CID. + * Get the list of roots defined by the CAR referenced by this iterator. May be + * zero or more `CID`s. * - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ByteView>} bytes - * @returns {CID} + * @function getRoots + * @memberof CarCIDIterator + * @instance + * @async + * @returns {Promise} */ - static decode (bytes) { - const [cid, remainder] = protons_runtime_node_modules_multiformats_src_cid_CID.decodeFirst(bytes) - if (remainder.length) { - throw new Error('Incorrect length') - } - return cid - } /** - * Decoded a CID from its binary representation at the beginning of a byte - * array. - * - * Returns an array with the first element containing the CID and the second - * element containing the remainder of the original byte array. The remainder - * will be a zero-length byte array if the provided bytes only contained a - * binary CID representation. - * - * @template {unknown} T - * @template {number} C - * @template {number} A - * @template {API.Version} V - * @param {API.ByteView>} bytes - * @returns {[CID, Uint8Array]} + * @returns {AsyncIterator} */ - static decodeFirst (bytes) { - const specs = protons_runtime_node_modules_multiformats_src_cid_CID.inspectBytes(bytes) - const prefixSize = specs.size - specs.multihashSize - const multihashBytes = coerce( - bytes.subarray(prefixSize, prefixSize + specs.multihashSize) - ) - if (multihashBytes.byteLength !== specs.multihashSize) { - throw new Error('Incorrect length') + [Symbol.asyncIterator] () { + if (this._decoded) { + throw new Error('Cannot decode more than once') + } + /* c8 ignore next 3 */ + if (!this._iterable) { + throw new Error('Block iterable not found') + } + this._decoded = true + const iterable = this._iterable[Symbol.asyncIterator]() + return { + async next () { + const next = await iterable.next() + if (next.done) { + return next + } + return { done: false, value: next.value.cid } + } } - const digestBytes = multihashBytes.subarray( - specs.multihashSize - specs.digestSize - ) - const digest = new Digest.Digest( - specs.multihashCode, - specs.digestSize, - digestBytes, - multihashBytes - ) - const cid = - specs.version === 0 - ? protons_runtime_node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) - : protons_runtime_node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest) - return [/** @type {CID} */(cid), bytes.subarray(specs.size)] } /** - * Inspect the initial bytes of a CID to determine its properties. - * - * Involves decoding up to 4 varints. Typically this will require only 4 to 6 - * bytes but for larger multicodec code values and larger multihash digest - * lengths these varints can be quite large. It is recommended that at least - * 10 bytes be made available in the `initialBytes` argument for a complete - * inspection. + * Instantiate a {@link CarCIDIterator} from a `Uint8Array` blob. Rather + * than decoding the entire byte array prior to returning the iterator, as in + * {@link CarReader.fromBytes}, only the header is decoded and the remainder + * of the CAR is parsed as the `CID`s as yielded. * - * @template {unknown} T - * @template {number} C - * @template {number} A - * @template {API.Version} V - * @param {API.ByteView>} initialBytes - * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }} + * @async + * @static + * @memberof CarCIDIterator + * @param {Uint8Array} bytes + * @returns {Promise} */ - static inspectBytes (initialBytes) { - let offset = 0 - const next = () => { - const [i, length] = varint.decode(initialBytes.subarray(offset)) - offset += length - return i - } - - let version = /** @type {V} */ (next()) - let codec = /** @type {C} */ (protons_runtime_node_modules_multiformats_src_cid_DAG_PB_CODE) - if (/** @type {number} */(version) === 18) { - // CIDv0 - version = /** @type {V} */ (0) - offset = 0 - } else { - codec = /** @type {C} */ (next()) - } - - if (version !== 0 && version !== 1) { - throw new RangeError(`Invalid CID version ${version}`) - } - - const prefixSize = offset - const multihashCode = /** @type {A} */ (next()) // multihash code - const digestSize = next() // multihash length - const size = offset + digestSize - const multihashSize = size - prefixSize - - return { version, codec, multihashCode, digestSize, multihashSize, size } + static async fromBytes (bytes) { + const { version, roots, iterator } = await iterator_fromBytes(bytes) + return new CarCIDIterator(version, roots, iterator) } /** - * Takes cid in a string representation and creates an instance. If `base` - * decoder is not provided will use a default from the configuration. It will - * throw an error if encoding of the CID is not compatible with supplied (or - * a default decoder). + * Instantiate a {@link CarCIDIterator} from a `AsyncIterable`, + * such as a [modern Node.js stream](https://nodejs.org/api/stream.html#stream_streams_compatibility_with_async_generators_and_async_iterators). + * Rather than decoding the entire byte array prior to returning the iterator, + * as in {@link CarReader.fromIterable}, only the header is decoded and the + * remainder of the CAR is parsed as the `CID`s as yielded. * - * @template {string} Prefix - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ToString, Prefix>} source - * @param {API.MultibaseDecoder} [base] - * @returns {CID} + * @async + * @static + * @memberof CarCIDIterator + * @param {AsyncIterable} asyncIterable + * @returns {Promise} */ - static parse (source, base) { - const [prefix, bytes] = protons_runtime_node_modules_multiformats_src_cid_parseCIDtoBytes(source, base) - - const cid = protons_runtime_node_modules_multiformats_src_cid_CID.decode(bytes) - - if (cid.version === 0 && source[0] !== 'Q') { - throw Error('Version 0 CID string must not include multibase prefix') - } - - // Cache string representation to avoid computing it on `this.toString()` - protons_runtime_node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source) - - return cid + static async fromIterable (asyncIterable) { + const { version, roots, iterator } = await fromIterable(asyncIterable) + return new CarCIDIterator(version, roots, iterator) } } /** - * @template {string} Prefix - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ToString, Prefix>} source - * @param {API.MultibaseDecoder} [base] - * @returns {[Prefix, API.ByteView>]} + * @param {Uint8Array} bytes + * @returns {Promise<{ version:number, roots:CID[], iterator:AsyncIterable}>} */ -const protons_runtime_node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => { - switch (source[0]) { - // CIDv0 is parsed differently - case 'Q': { - const decoder = base || base58btc - return [ - /** @type {Prefix} */ (base58btc.prefix), - decoder.decode(`${base58btc.prefix}${source}`) - ] - } - case base58btc.prefix: { - const decoder = base || base58btc - return [/** @type {Prefix} */(base58btc.prefix), decoder.decode(source)] - } - case base32.prefix: { - const decoder = base || base32 - return [/** @type {Prefix} */(base32.prefix), decoder.decode(source)] - } - default: { - if (base == null) { - throw Error( - 'To parse non base32 or base58btc encoded CID multibase decoder must be provided' - ) - } - return [/** @type {Prefix} */(source[0]), base.decode(source)] - } +async function iterator_fromBytes (bytes) { + if (!(bytes instanceof Uint8Array)) { + throw new TypeError('fromBytes() requires a Uint8Array') } + return decodeIterator(bytesReader(bytes)) } /** - * - * @param {Uint8Array} bytes - * @param {Map} cache - * @param {API.MultibaseEncoder<'z'>} base + * @param {AsyncIterable} asyncIterable + * @returns {Promise<{ version:number, roots:CID[], iterator:AsyncIterable}>} */ -const protons_runtime_node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => { - const { prefix } = base - if (prefix !== base58btc.prefix) { - throw Error(`Cannot string encode V0 in ${base.name} encoding`) - } - - const cid = cache.get(prefix) - if (cid == null) { - const cid = base.encode(bytes).slice(1) - cache.set(prefix, cid) - return cid - } else { - return cid +async function fromIterable (asyncIterable) { + if (!asyncIterable || !(typeof asyncIterable[Symbol.asyncIterator] === 'function')) { + throw new TypeError('fromIterable() requires an async iterable') } + return decodeIterator(asyncIterableReader(asyncIterable)) } /** - * @template {string} Prefix - * @param {Uint8Array} bytes - * @param {Map} cache - * @param {API.MultibaseEncoder} base + * @private + * @param {BytesReader} reader + * @returns {Promise<{ version:number, roots:CID[], iterator:AsyncIterable}>} */ -const protons_runtime_node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => { - const { prefix } = base - const cid = cache.get(prefix) - if (cid == null) { - const cid = base.encode(bytes) - cache.set(prefix, cid) - return cid - } else { - return cid - } +async function decodeIterator (reader) { + const decoder = createDecoder(reader) + const { version, roots } = await decoder.header() + return { version, roots, iterator: decoder.blocks() } } -const protons_runtime_node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70 -const protons_runtime_node_modules_multiformats_src_cid_SHA_256_CODE = 0x12 +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/encoder.js + + /** - * @param {API.Version} version - * @param {number} code - * @param {Uint8Array} multihash + * @typedef {import('multiformats').CID} CID + * @typedef {import('./api').Block} Block + * @typedef {import('./coding').CarEncoder} CarEncoder + * @typedef {import('./coding').IteratorChannel_Writer} IteratorChannel_Writer + */ + +/** + * Create a header from an array of roots. + * + * @param {CID[]} roots * @returns {Uint8Array} */ -const protons_runtime_node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => { - const codeOffset = varint.encodingLength(version) - const hashOffset = codeOffset + varint.encodingLength(code) - const bytes = new Uint8Array(hashOffset + multihash.byteLength) - varint.encodeTo(version, bytes, 0) - varint.encodeTo(code, bytes, codeOffset) - bytes.set(multihash, hashOffset) - return bytes +function createHeader (roots) { + const headerBytes = dag_cbor_src_encode({ version: 1, roots }) + const varintBytes = sdk_node_modules_varint.encode(headerBytes.length) + const header = new Uint8Array(varintBytes.length + headerBytes.length) + header.set(varintBytes, 0) + header.set(headerBytes, varintBytes.length) + return header } -const protons_runtime_node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') - -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/index.js - - +/** + * @param {IteratorChannel_Writer} writer + * @returns {CarEncoder} + */ +function createEncoder (writer) { + // none of this is wrapped in a mutex, that needs to happen above this to + // avoid overwrites + return { + /** + * @param {CID[]} roots + * @returns {Promise} + */ + async setRoots (roots) { + const bytes = createHeader(roots) + await writer.write(bytes) + }, + /** + * @param {Block} block + * @returns {Promise} + */ + async writeBlock (block) { + const { cid, bytes } = block + await writer.write(new Uint8Array(sdk_node_modules_varint.encode(cid.bytes.length + bytes.length))) + await writer.write(cid.bytes) + if (bytes.length) { + // zero-length blocks are valid, but it'd be safer if we didn't write them + await writer.write(bytes) + } + }, + /** + * @returns {Promise} + */ + async close () { + await writer.end() + } + } +} -// This way TS will also expose all the types from module +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/iterator-channel.js +/** + * @template {any} T + * @typedef {import('./coding').IteratorChannel} IteratorChannel + */ +function iterator_channel_noop () {} -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/basics.js -// @ts-check +/** + * @template {any} T + * @returns {IteratorChannel} + */ +function iterator_channel_create () { + /** @type {T[]} */ + const chunkQueue = [] + /** @type {Promise | null} */ + let drainer = null + let drainerResolver = iterator_channel_noop + let ended = false + /** @type {Promise> | null} */ + let outWait = null + let outWaitResolver = iterator_channel_noop + const makeDrainer = () => { + if (!drainer) { + drainer = new Promise((resolve) => { + drainerResolver = () => { + drainer = null + drainerResolver = iterator_channel_noop + resolve() + } + }) + } + return drainer + } + /** + * @returns {IteratorChannel} + */ + const writer = { + /** + * @param {T} chunk + * @returns {Promise} + */ + write (chunk) { + chunkQueue.push(chunk) + const drainer = makeDrainer() + outWaitResolver() + return drainer + }, + async end () { + ended = true + const drainer = makeDrainer() + outWaitResolver() + await drainer + } + } + /** @type {AsyncIterator} */ + const iterator = { + /** @returns {Promise>} */ + async next () { + const chunk = chunkQueue.shift() + if (chunk) { + if (chunkQueue.length === 0) { + drainerResolver() + } + return { done: false, value: chunk } + } + if (ended) { + drainerResolver() + return { done: true, value: undefined } + } + if (!outWait) { + outWait = new Promise((resolve) => { + outWaitResolver = () => { + outWait = null + outWaitResolver = iterator_channel_noop + return resolve(iterator.next()) + } + }) + } + return outWait + } + } + return { writer, iterator } +} +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/writer-browser.js +/** + * @typedef {import('./api').Block} Block + * @typedef {import('./api').BlockWriter} BlockWriter + * @typedef {import('./api').WriterChannel} WriterChannel + * @typedef {import('./coding').CarEncoder} CarEncoder + * @typedef {import('./coding').IteratorChannel} IteratorChannel + */ +/** + * Provides a writer interface for the creation of CAR files. + * + * Creation of a `CarWriter` involves the instatiation of an input / output pair + * in the form of a `WriterChannel`, which is a + * `{ writer:CarWriter, out:AsyncIterable }` pair. These two + * components form what can be thought of as a stream-like interface. The + * `writer` component (an instantiated `CarWriter`), has methods to + * {@link CarWriter.put `put()`} new blocks and {@link CarWriter.put `close()`} + * the writing operation (finalising the CAR archive). The `out` component is + * an `AsyncIterable` that yields the bytes of the archive. This can be + * redirected to a file or other sink. In Node.js, you can use the + * [`Readable.from()`](https://nodejs.org/api/stream.html#stream_stream_readable_from_iterable_options) + * API to convert this to a standard Node.js stream, or it can be directly fed + * to a + * [`stream.pipeline()`](https://nodejs.org/api/stream.html#stream_stream_pipeline_source_transforms_destination_callback). + * + * The channel will provide a form of backpressure. The `Promise` from a + * `write()` won't resolve until the resulting data is drained from the `out` + * iterable. + * + * It is also possible to ignore the `Promise` from `write()` calls and allow + * the generated data to queue in memory. This should be avoided for large CAR + * archives of course due to the memory costs and potential for memory overflow. + * + * Load this class with either + * `import { CarWriter } from '@ipld/car/writer'` + * (`const { CarWriter } = require('@ipld/car/writer')`). Or + * `import { CarWriter } from '@ipld/car'` + * (`const { CarWriter } = require('@ipld/car')`). The former will likely + * result in smaller bundle sizes where this is important. + * + * @name CarWriter + * @class + * @implements {BlockWriter} + */ +class writer_browser_CarWriter { + /** + * @param {CID[]} roots + * @param {CarEncoder} encoder + */ + constructor (roots, encoder) { + this._encoder = encoder + /** @type {Promise} */ + this._mutex = encoder.setRoots(roots) + this._ended = false + } + /** + * Write a `Block` (a `{ cid:CID, bytes:Uint8Array }` pair) to the archive. + * + * @function + * @memberof CarWriter + * @instance + * @async + * @param {Block} block - A `{ cid:CID, bytes:Uint8Array }` pair. + * @returns {Promise} The returned promise will only resolve once the + * bytes this block generates are written to the `out` iterable. + */ + async put (block) { + if (!(block.bytes instanceof Uint8Array) || !block.cid) { + throw new TypeError('Can only write {cid, bytes} objects') + } + if (this._ended) { + throw new Error('Already closed') + } + const cid = sdk_node_modules_multiformats_src_cid_CID.asCID(block.cid) + if (!cid) { + throw new TypeError('Can only write {cid, bytes} objects') + } + this._mutex = this._mutex.then(() => this._encoder.writeBlock({ cid, bytes: block.bytes })) + return this._mutex + } -const protons_runtime_node_modules_multiformats_src_basics_bases = { ...protons_runtime_node_modules_multiformats_src_bases_identity_namespaceObject, ...protons_runtime_node_modules_multiformats_src_bases_base2_namespaceObject, ...protons_runtime_node_modules_multiformats_src_bases_base8_namespaceObject, ...protons_runtime_node_modules_multiformats_src_bases_base10_namespaceObject, ...protons_runtime_node_modules_multiformats_src_bases_base16_namespaceObject, ...protons_runtime_node_modules_multiformats_src_bases_base32_namespaceObject, ...protons_runtime_node_modules_multiformats_src_bases_base36_namespaceObject, ...protons_runtime_node_modules_multiformats_src_bases_base58_namespaceObject, ...protons_runtime_node_modules_multiformats_src_bases_base64_namespaceObject, ...protons_runtime_node_modules_multiformats_src_bases_base256emoji_namespaceObject } -const protons_runtime_node_modules_multiformats_src_basics_hashes = { ...protons_runtime_node_modules_multiformats_src_hashes_sha2_namespaceObject, ...protons_runtime_node_modules_multiformats_src_hashes_identity_namespaceObject } -const protons_runtime_node_modules_multiformats_src_basics_codecs = { raw: protons_runtime_node_modules_multiformats_src_codecs_raw_namespaceObject, json: protons_runtime_node_modules_multiformats_src_codecs_json_namespaceObject } + /** + * Finalise the CAR archive and signal that the `out` iterable should end once + * any remaining bytes are written. + * + * @function + * @memberof CarWriter + * @instance + * @async + * @returns {Promise} + */ + async close () { + if (this._ended) { + throw new Error('Already closed') + } + await this._mutex + this._ended = true + return this._encoder.close() + } + /** + * Create a new CAR writer "channel" which consists of a + * `{ writer:CarWriter, out:AsyncIterable }` pair. + * + * @async + * @static + * @memberof CarWriter + * @param {CID[] | CID | void} roots + * @returns {WriterChannel} The channel takes the form of + * `{ writer:CarWriter, out:AsyncIterable }`. + */ + static create (roots) { + roots = toRoots(roots) + const { encoder, iterator } = encodeWriter() + const writer = new writer_browser_CarWriter(roots, encoder) + const out = new CarWriterOut(iterator) + return { writer, out } + } + /** + * Create a new CAR appender "channel" which consists of a + * `{ writer:CarWriter, out:AsyncIterable }` pair. + * This appender does not consider roots and does not produce a CAR header. + * It is designed to append blocks to an _existing_ CAR archive. It is + * expected that `out` will be concatenated onto the end of an existing + * archive that already has a properly formatted header. + * + * @async + * @static + * @memberof CarWriter + * @returns {WriterChannel} The channel takes the form of + * `{ writer:CarWriter, out:AsyncIterable }`. + */ + static createAppender () { + const { encoder, iterator } = encodeWriter() + encoder.setRoots = () => Promise.resolve() + const writer = new writer_browser_CarWriter([], encoder) + const out = new CarWriterOut(iterator) + return { writer, out } + } -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/uint8arrays/dist/src/util/bases.js + /** + * Update the list of roots in the header of an existing CAR as represented + * in a Uint8Array. + * + * This operation is an _overwrite_, the total length of the CAR will not be + * modified. A rejection will occur if the new header will not be the same + * length as the existing header, in which case the CAR will not be modified. + * It is the responsibility of the user to ensure that the roots being + * replaced encode as the same length as the new roots. + * + * The byte array passed in an argument will be modified and also returned + * upon successful modification. + * + * @async + * @static + * @memberof CarWriter + * @param {Uint8Array} bytes + * @param {CID[]} roots - A new list of roots to replace the existing list in + * the CAR header. The new header must take up the same number of bytes as the + * existing header, so the roots should collectively be the same byte length + * as the existing roots. + * @returns {Promise} + */ + static async updateRootsInBytes (bytes, roots) { + const reader = decoder_bytesReader(bytes) + await decoder_readHeader(reader) + const newHeader = createHeader(roots) + if (Number(reader.pos) !== newHeader.length) { + 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)`) + } + bytes.set(newHeader, 0) + return bytes + } +} +/** + * @class + * @implements {AsyncIterable} + */ +class CarWriterOut { + /** + * @param {AsyncIterator} iterator + */ + constructor (iterator) { + this._iterator = iterator + } -function src_util_bases_createCodec(name, prefix, encode, decode) { - return { - name, - prefix, - encoder: { - name, - prefix, - encode - }, - decoder: { - decode - } - }; -} -const src_util_bases_string = src_util_bases_createCodec('utf8', 'u', (buf) => { - const decoder = new TextDecoder('utf8'); - return 'u' + decoder.decode(buf); -}, (str) => { - const encoder = new TextEncoder(); - return encoder.encode(str.substring(1)); -}); -const src_util_bases_ascii = src_util_bases_createCodec('ascii', 'a', (buf) => { - let string = 'a'; - for (let i = 0; i < buf.length; i++) { - string += String.fromCharCode(buf[i]); - } - return string; -}, (str) => { - str = str.substring(1); - const buf = node_modules_uint8arrays_dist_src_alloc_allocUnsafe(str.length); - for (let i = 0; i < str.length; i++) { - buf[i] = str.charCodeAt(i); + [Symbol.asyncIterator] () { + if (this._iterating) { + throw new Error('Multiple iterator not supported') } - return buf; -}); -const src_util_bases_BASES = { - utf8: src_util_bases_string, - 'utf-8': src_util_bases_string, - hex: protons_runtime_node_modules_multiformats_src_basics_bases.base16, - latin1: src_util_bases_ascii, - ascii: src_util_bases_ascii, - binary: src_util_bases_ascii, - ...protons_runtime_node_modules_multiformats_src_basics_bases -}; -/* harmony default export */ const uint8arrays_dist_src_util_bases = (src_util_bases_BASES); -//# sourceMappingURL=bases.js.map -;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/uint8arrays/dist/src/from-string.js + this._iterating = true + return this._iterator + } +} +function encodeWriter () { + /** @type {IteratorChannel} */ + const iw = iterator_channel_create() + const { writer, iterator } = iw + const encoder = createEncoder(writer) + return { encoder, iterator } +} /** - * Create a `Uint8Array` from the passed string - * - * Supports `utf8`, `utf-8`, `hex`, and any encoding supported by the multiformats module. - * - * Also `ascii` which is similar to node's 'binary' encoding. + * @private + * @param {CID[] | CID | void} roots + * @returns {CID[]} */ -function uint8arrays_dist_src_from_string_fromString(string, encoding = 'utf8') { - const base = uint8arrays_dist_src_util_bases[encoding]; - if (base == null) { - throw new Error(`Unsupported encoding "${encoding}"`); +function toRoots (roots) { + if (roots === undefined) { + return [] + } + + if (!Array.isArray(roots)) { + const cid = sdk_node_modules_multiformats_src_cid_CID.asCID(roots) + if (!cid) { + throw new TypeError('roots must be a single CID or an array of CIDs') } - if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) { - return node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.from(string, 'utf-8')); + return [cid] + } + + const _roots = [] + for (const root of roots) { + const _root = sdk_node_modules_multiformats_src_cid_CID.asCID(root) + if (!_root) { + throw new TypeError('roots must be a single CID or an array of CIDs') } - // add multibase prefix - return base.decoder.decode(`${base.prefix}${string}`); // eslint-disable-line @typescript-eslint/restrict-template-expressions + _roots.push(_root) + } + return _roots } -//# sourceMappingURL=from-string.js.map -;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/utils/pool.js -/** - * A general purpose buffer pool - */ -function pool_pool(size) { - const SIZE = size ?? 8192; - const MAX = SIZE >>> 1; - let slab; - let offset = SIZE; - return function poolAlloc(size) { - if (size < 1 || size > MAX) { - return node_modules_uint8arrays_dist_src_alloc_allocUnsafe(size); - } - if (offset + size > SIZE) { - slab = node_modules_uint8arrays_dist_src_alloc_allocUnsafe(SIZE); - offset = 0; - } - const buf = slab.subarray(offset, offset += size); - if ((offset & 7) !== 0) { - // align to 32 bit - offset = (offset | 7) + 1; - } - return buf; - }; -} -//# sourceMappingURL=pool.js.map -;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/utils/writer.js +const writer_browser_browser = true +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/writer.js + +const writer_fsread = (0,external_util_.promisify)(external_fs_.read) +const fswrite = (0,external_util_.promisify)(external_fs_.write) + /** - * Constructs a new writer operation instance. - * - * @classdesc Scheduled writer operation - */ -class Op { - /** - * Function to call - */ - fn; - /** - * Value byte length - */ - len; - /** - * Next operation - */ - next; - /** - * Value to write - */ - val; - constructor(fn, len, val) { - this.fn = fn; - this.len = len; - this.next = undefined; - this.val = val; // type varies - } -} -/* istanbul ignore next */ -function writer_noop() { } // eslint-disable-line no-empty-function -/** - * Constructs a new writer state instance - */ -class State { - /** - * Current head - */ - head; - /** - * Current tail - */ - tail; - /** - * Current buffer length - */ - len; - /** - * Next state - */ - next; - constructor(writer) { - this.head = writer.head; - this.tail = writer.tail; - this.len = writer.len; - this.next = writer.states; - } -} -const bufferPool = pool_pool(); -/** - * Allocates a buffer of the specified size + * @typedef {import('multiformats/cid').CID} CID + * @typedef {import('./api').BlockWriter} BlockWriter */ -function writer_alloc(size) { - if (globalThis.Buffer != null) { - return node_modules_uint8arrays_dist_src_alloc_allocUnsafe(size); - } - return bufferPool(size); -} + /** - * When a value is written, the writer calculates its byte length and puts it into a linked - * list of operations to perform when finish() is called. This both allows us to allocate - * buffers of the exact required size and reduces the amount of work we have to do compared - * to first calculating over objects and then encoding over objects. In our case, the encoding - * part is just a linked list walk calling operations with already prepared values. + * @class + * @implements {BlockWriter} */ -class Uint8ArrayWriter { - /** - * Current length - */ - len; - /** - * Operations head - */ - head; - /** - * Operations tail - */ - tail; - /** - * Linked forked states - */ - states; - constructor() { - this.len = 0; - this.head = new Op(writer_noop, 0, 0); - this.tail = this.head; - this.states = null; - } - /** - * Pushes a new operation to the queue - */ - _push(fn, len, val) { - this.tail = this.tail.next = new Op(fn, len, val); - this.len += len; - return this; - } - /** - * Writes an unsigned 32 bit value as a varint - */ - uint32(value) { - // here, the call to this.push has been inlined and a varint specific Op subclass is used. - // uint32 is by far the most frequently used operation and benefits significantly from this. - this.len += (this.tail = this.tail.next = new VarintOp((value = value >>> 0) < - 128 - ? 1 - : value < 16384 - ? 2 - : value < 2097152 - ? 3 - : value < 268435456 - ? 4 - : 5, value)).len; - return this; - } - /** - * Writes a signed 32 bit value as a varint` - */ - int32(value) { - return value < 0 - ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec - : this.uint32(value); - } - /** - * Writes a 32 bit value as a varint, zig-zag encoded - */ - sint32(value) { - return this.uint32((value << 1 ^ value >> 31) >>> 0); - } - /** - * Writes an unsigned 64 bit value as a varint - */ - uint64(value) { - const bits = LongBits.fromBigInt(value); - return this._push(writeVarint64, bits.length(), bits); - } - /** - * Writes an unsigned 64 bit value as a varint - */ - uint64Number(value) { - const bits = LongBits.fromNumber(value); - return this._push(writeVarint64, bits.length(), bits); - } - /** - * Writes an unsigned 64 bit value as a varint - */ - uint64String(value) { - return this.uint64(BigInt(value)); - } - /** - * Writes a signed 64 bit value as a varint - */ - int64(value) { - return this.uint64(value); - } - /** - * Writes a signed 64 bit value as a varint - */ - int64Number(value) { - return this.uint64Number(value); - } - /** - * Writes a signed 64 bit value as a varint - */ - int64String(value) { - return this.uint64String(value); - } - /** - * Writes a signed 64 bit value as a varint, zig-zag encoded - */ - sint64(value) { - const bits = LongBits.fromBigInt(value).zzEncode(); - return this._push(writeVarint64, bits.length(), bits); - } - /** - * Writes a signed 64 bit value as a varint, zig-zag encoded - */ - sint64Number(value) { - const bits = LongBits.fromNumber(value).zzEncode(); - return this._push(writeVarint64, bits.length(), bits); - } - /** - * Writes a signed 64 bit value as a varint, zig-zag encoded - */ - sint64String(value) { - return this.sint64(BigInt(value)); - } - /** - * Writes a boolish value as a varint - */ - bool(value) { - return this._push(writeByte, 1, value ? 1 : 0); - } - /** - * Writes an unsigned 32 bit value as fixed 32 bits - */ - fixed32(value) { - return this._push(writeFixed32, 4, value >>> 0); - } - /** - * Writes a signed 32 bit value as fixed 32 bits - */ - sfixed32(value) { - return this.fixed32(value); - } - /** - * Writes an unsigned 64 bit value as fixed 64 bits - */ - fixed64(value) { - const bits = LongBits.fromBigInt(value); - return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); - } - /** - * Writes an unsigned 64 bit value as fixed 64 bits - */ - fixed64Number(value) { - const bits = LongBits.fromNumber(value); - return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); - } - /** - * Writes an unsigned 64 bit value as fixed 64 bits - */ - fixed64String(value) { - return this.fixed64(BigInt(value)); - } - /** - * Writes a signed 64 bit value as fixed 64 bits - */ - sfixed64(value) { - return this.fixed64(value); - } - /** - * Writes a signed 64 bit value as fixed 64 bits - */ - sfixed64Number(value) { - return this.fixed64Number(value); - } - /** - * Writes a signed 64 bit value as fixed 64 bits - */ - sfixed64String(value) { - return this.fixed64String(value); - } - /** - * Writes a float (32 bit) - */ - float(value) { - return this._push(writeFloatLE, 4, value); - } - /** - * Writes a double (64 bit float). - * - * @function - * @param {number} value - Value to write - * @returns {Writer} `this` - */ - double(value) { - return this._push(writeDoubleLE, 8, value); - } - /** - * Writes a sequence of bytes - */ - bytes(value) { - const len = value.length >>> 0; - if (len === 0) { - return this._push(writeByte, 1, 0); - } - return this.uint32(len)._push(writer_writeBytes, len, value); - } - /** - * Writes a string - */ - string(value) { - const len = utf8_length(value); - return len !== 0 - ? this.uint32(len)._push(write, len, value) - : this._push(writeByte, 1, 0); - } - /** - * Forks this writer's state by pushing it to a stack. - * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. - */ - fork() { - this.states = new State(this); - this.head = this.tail = new Op(writer_noop, 0, 0); - this.len = 0; - return this; - } - /** - * Resets this instance to the last state - */ - reset() { - if (this.states != null) { - this.head = this.states.head; - this.tail = this.states.tail; - this.len = this.states.len; - this.states = this.states.next; - } - else { - this.head = this.tail = new Op(writer_noop, 0, 0); - this.len = 0; - } - return this; - } - /** - * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. - */ - ldelim() { - const head = this.head; - const tail = this.tail; - const len = this.len; - this.reset().uint32(len); - if (len !== 0) { - this.tail.next = head.next; // skip noop - this.tail = tail; - this.len += len; - } - return this; +class CarWriter extends writer_browser_CarWriter { + /** + * Update the list of roots in the header of an existing CAR file. The first + * argument must be a file descriptor for CAR file that is open in read and + * write mode (not append), e.g. `fs.open` or `fs.promises.open` with `'r+'` + * mode. + * + * This operation is an _overwrite_, the total length of the CAR will not be + * modified. A rejection will occur if the new header will not be the same + * length as the existing header, in which case the CAR will not be modified. + * It is the responsibility of the user to ensure that the roots being + * replaced encode as the same length as the new roots. + * + * This function is **only available in Node.js** and not a browser + * environment. + * + * @async + * @static + * @memberof CarWriter + * @param {fs.promises.FileHandle | number} fd - A file descriptor from the + * Node.js `fs` module. Either an integer, from `fs.open()` or a `FileHandle` + * from `fs.promises.open()`. + * @param {CID[]} roots - A new list of roots to replace the existing list in + * the CAR header. The new header must take up the same number of bytes as the + * existing header, so the roots should collectively be the same byte length + * as the existing roots. + * @returns {Promise} + */ + static async updateRootsInFile (fd, roots) { + const chunkSize = 256 + /** @type {Uint8Array} */ + let bytes + let offset = 0 + + /** @type {() => Promise} */ + let readChunk + if (typeof fd === 'number') { + readChunk = async () => (await writer_fsread(fd, bytes, 0, chunkSize, offset)).bytesRead + } else if (typeof fd === 'object' && typeof fd.read === 'function') { // FileDescriptor + readChunk = async () => (await fd.read(bytes, 0, chunkSize, offset)).bytesRead + } else { + throw new TypeError('Bad fd') } - /** - * Finishes the write operation - */ - finish() { - let head = this.head.next; // skip noop - const buf = writer_alloc(this.len); - let pos = 0; - while (head != null) { - head.fn(head.val, buf, pos); - pos += head.len; - head = head.next; - } - // this.head = this.tail = null; - return buf; + const fdReader = chunkReader(async () => { + bytes = new Uint8Array(chunkSize) // need a new chunk each time, can't reuse old + const read = await readChunk() + offset += read + /* eslint no-warning-comments: 0 */ + // TODO: test header > 256 bytes + return read < chunkSize ? bytes.subarray(0, read) : bytes + }) + + await decoder_readHeader(fdReader) + const newHeader = createHeader(roots) + if (fdReader.pos !== newHeader.length) { + 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)`) } -} -function writeByte(val, buf, pos) { - buf[pos] = val & 255; -} -function writeVarint32(val, buf, pos) { - while (val > 127) { - buf[pos++] = val & 127 | 128; - val >>>= 7; + if (typeof fd === 'number') { + await fswrite(fd, newHeader, 0, newHeader.length, 0) + } else if (typeof fd === 'object' && typeof fd.read === 'function') { // FileDescriptor + await fd.write(newHeader, 0, newHeader.length, 0) } - buf[pos] = val; + } } + +const writer_browser = false + +;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/@ipld/car/src/index.js + + + + + + + + +// @see https://www.iana.org/assignments/media-types/application/vnd.ipld.car +const contentType = 'application/vnd.ipld.car' + + + +;// CONCATENATED MODULE: ./node_modules/it-drain/dist/src/index.js /** - * Constructs a new varint writer operation instance. + * @packageDocumentation * - * @classdesc Scheduled varint writer operation + * Mostly useful for tests or when you want to be explicit about consuming an iterable without doing anything with any yielded values. + * + * @example + * + * ```javascript + * import drain from 'it-drain' + * + * // This can also be an iterator, generator, etc + * const values = [0, 1, 2, 3, 4] + * + * drain(values) + * ``` + * + * Async sources must be awaited: + * + * ```javascript + * import drain from 'it-drain' + * + * const values = async function * { + * yield * [0, 1, 2, 3, 4] + * } + * + * await drain(values()) + * ``` */ -class VarintOp extends Op { - next; - constructor(len, val) { - super(writeVarint32, len, val); - this.next = undefined; - } +function dist_src_isAsyncIterable(thing) { + return thing[Symbol.asyncIterator] != null; } -function writeVarint64(val, buf, pos) { - while (val.hi !== 0) { - buf[pos++] = val.lo & 127 | 128; - val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; - val.hi >>>= 7; +function src_drain(source) { + if (dist_src_isAsyncIterable(source)) { + return (async () => { + for await (const _ of source) { } // eslint-disable-line no-unused-vars,no-empty,@typescript-eslint/no-unused-vars + })(); } - while (val.lo > 127) { - buf[pos++] = val.lo & 127 | 128; - val.lo = val.lo >>> 7; + else { + for (const _ of source) { } // eslint-disable-line no-unused-vars,no-empty,@typescript-eslint/no-unused-vars } - buf[pos++] = val.lo; -} -function writeFixed32(val, buf, pos) { - buf[pos] = val & 255; - buf[pos + 1] = val >>> 8 & 255; - buf[pos + 2] = val >>> 16 & 255; - buf[pos + 3] = val >>> 24; -} -function writer_writeBytes(val, buf, pos) { - buf.set(val, pos); } -if (globalThis.Buffer != null) { - Uint8ArrayWriter.prototype.bytes = function (value) { - const len = value.length >>> 0; - this.uint32(len); - if (len > 0) { - this._push(writeBytesBuffer, len, value); - } - return this; - }; - Uint8ArrayWriter.prototype.string = function (value) { - const len = globalThis.Buffer.byteLength(value); - this.uint32(len); - if (len > 0) { - this._push(writeStringBuffer, len, value); +/* harmony default export */ const it_drain_dist_src = (src_drain); +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/it-peekable/dist/src/index.js +/** + * @packageDocumentation + * + * Lets you look at the contents of an async iterator and decide what to do + * + * @example + * + * ```javascript + * import peekable from 'it-peekable' + * + * // This can also be an iterator, generator, etc + * const values = [0, 1, 2, 3, 4] + * + * const it = peekable(value) + * + * const first = it.peek() + * + * console.info(first) // 0 + * + * it.push(first) + * + * console.info([...it]) + * // [ 0, 1, 2, 3, 4 ] + * ``` + * + * Async sources must be awaited: + * + * ```javascript + * import peekable from 'it-peekable' + * + * const values = async function * () { + * yield * [0, 1, 2, 3, 4] + * } + * + * const it = peekable(values()) + * + * const first = await it.peek() + * + * console.info(first) // 0 + * + * it.push(first) + * + * console.info(await all(it)) + * // [ 0, 1, 2, 3, 4 ] + * ``` + */ +function peekable(iterable) { + // @ts-expect-error can't use Symbol.asyncIterator to index iterable since it might be Iterable + const [iterator, symbol] = iterable[Symbol.asyncIterator] != null + // @ts-expect-error can't use Symbol.asyncIterator to index iterable since it might be Iterable + ? [iterable[Symbol.asyncIterator](), Symbol.asyncIterator] + // @ts-expect-error can't use Symbol.iterator to index iterable since it might be AsyncIterable + : [iterable[Symbol.iterator](), Symbol.iterator]; + const queue = []; + // @ts-expect-error can't use symbol to index peekable + return { + peek: () => { + return iterator.next(); + }, + push: (value) => { + queue.push(value); + }, + next: () => { + if (queue.length > 0) { + return { + done: false, + value: queue.shift() + }; + } + return iterator.next(); + }, + [symbol]() { + return this; } - return this; }; } -function writeBytesBuffer(val, buf, pos) { - buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) - // also works for plain array values +/* harmony default export */ const it_peekable_dist_src = (peekable); +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/it-map/dist/src/index.js +/** + * @packageDocumentation + * + * Convert one value from an (async)iterator into another. + * + * @example + * + * ```javascript + * import map from 'it-map' + * + * // This can also be an iterator, generator, etc + * const values = [0, 1, 2, 3, 4] + * + * const result = map(values, (val) => val++) + * + * console.info(result) // [1, 2, 3, 4, 5] + * ``` + * + * Async sources and transforms must be awaited: + * + * ```javascript + * import map from 'it-map' + * + * const values = async function * () { + * yield * [0, 1, 2, 3, 4] + * } + * + * const result = await map(values(), async (val) => val++) + * + * console.info(result) // [1, 2, 3, 4, 5] + * ``` + */ + +function it_map_dist_src_isAsyncIterable(thing) { + return thing[Symbol.asyncIterator] != null; } -function writeStringBuffer(val, buf, pos) { - if (val.length < 40) { - // plain js is faster for short strings (probably due to redundant assertions) - write(val, buf, pos); - // @ts-expect-error buf isn't a Uint8Array? +function src_map(source, func) { + if (it_map_dist_src_isAsyncIterable(source)) { + return (async function* () { + for await (const val of source) { + yield func(val); + } + })(); } - else if (buf.utf8Write != null) { - // @ts-expect-error buf isn't a Uint8Array? - buf.utf8Write(val, pos); + // if mapping function returns a promise we have to return an async generator + const peekable = it_peekable_dist_src(source); + const { value, done } = peekable.next(); + if (done === true) { + return (function* () { }()); } - else { - buf.set(uint8arrays_dist_src_from_string_fromString(val), pos); + const res = func(value); + // @ts-expect-error .then is not present on O + if (typeof res.then === 'function') { + return (async function* () { + yield await res; + for await (const val of peekable) { + yield func(val); + } + })(); } + const fn = func; + return (function* () { + yield res; + for (const val of peekable) { + yield fn(val); + } + })(); } -/** - * Creates a new writer - */ -function writer_createWriter() { - return new Uint8ArrayWriter(); -} -//# sourceMappingURL=writer.js.map -;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/encode.js +/* harmony default export */ const it_map_dist_src = (src_map); +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/p-defer/index.js +function pDefer() { + const deferred = {}; -function encodeMessage(message, codec) { - const w = writer_createWriter(); - codec.encode(message, w, { - lengthDelimited: false - }); - return w.finish(); -} -//# sourceMappingURL=encode.js.map -;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/codec.js -// https://developers.google.com/protocol-buffers/docs/encoding#structure -var CODEC_TYPES; -(function (CODEC_TYPES) { - CODEC_TYPES[CODEC_TYPES["VARINT"] = 0] = "VARINT"; - CODEC_TYPES[CODEC_TYPES["BIT64"] = 1] = "BIT64"; - CODEC_TYPES[CODEC_TYPES["LENGTH_DELIMITED"] = 2] = "LENGTH_DELIMITED"; - CODEC_TYPES[CODEC_TYPES["START_GROUP"] = 3] = "START_GROUP"; - CODEC_TYPES[CODEC_TYPES["END_GROUP"] = 4] = "END_GROUP"; - CODEC_TYPES[CODEC_TYPES["BIT32"] = 5] = "BIT32"; -})(CODEC_TYPES || (CODEC_TYPES = {})); -function codec_createCodec(name, type, encode, decode) { - return { - name, - type, - encode, - decode - }; + deferred.promise = new Promise((resolve, reject) => { + deferred.resolve = resolve; + deferred.reject = reject; + }); + + return deferred; } -//# sourceMappingURL=codec.js.map -;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/codecs/enum.js -function enumeration(v) { - function findValue(val) { - // Use the reverse mapping to look up the enum key for the stored value - // https://www.typescriptlang.org/docs/handbook/enums.html#reverse-mappings - if (v[val.toString()] == null) { - throw new Error('Invalid enum value'); - } - return v[val]; - } - const encode = function enumEncode(val, writer) { - const enumValue = findValue(val); - writer.int32(enumValue); - }; - const decode = function enumDecode(reader) { - const val = reader.int32(); - return findValue(val); - }; - // @ts-expect-error yeah yeah - return codec_createCodec('enum', CODEC_TYPES.VARINT, encode, decode); +// EXTERNAL MODULE: ./node_modules/eventemitter3/index.js +var eventemitter3 = __nccwpck_require__(80051); +;// CONCATENATED MODULE: ./node_modules/eventemitter3/index.mjs + + + +/* harmony default export */ const node_modules_eventemitter3 = ((/* unused pure expression or super */ null && (EventEmitter))); + +;// CONCATENATED MODULE: ./node_modules/p-timeout/index.js +class TimeoutError extends Error { + constructor(message) { + super(message); + this.name = 'TimeoutError'; + } } -//# sourceMappingURL=enum.js.map -;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/codecs/message.js -function message(encode, decode) { - return codec_createCodec('message', CODEC_TYPES.LENGTH_DELIMITED, encode, decode); +/** +An error to be thrown when the request is aborted by AbortController. +DOMException is thrown instead of this Error when DOMException is available. +*/ +class p_timeout_AbortError extends Error { + constructor(message) { + super(); + this.name = 'AbortError'; + this.message = message; + } } -//# sourceMappingURL=message.js.map -;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/index.js +/** +TODO: Remove AbortError and just throw DOMException when targeting Node 18. +*/ +const getDOMException = errorMessage => globalThis.DOMException === undefined ? + new p_timeout_AbortError(errorMessage) : + new DOMException(errorMessage); + +/** +TODO: Remove below function and just 'reject(signal.reason)' when targeting Node 18. +*/ +const getAbortedReason = signal => { + const reason = signal.reason === undefined ? + getDOMException('This operation was aborted.') : + signal.reason; + + return reason instanceof Error ? reason : getDOMException(reason); +}; + +function pTimeout(promise, milliseconds, fallback, options) { + let timer; + + const cancelablePromise = new Promise((resolve, reject) => { + if (typeof milliseconds !== 'number' || Math.sign(milliseconds) !== 1) { + throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${milliseconds}\``); + } + if (milliseconds === Number.POSITIVE_INFINITY) { + resolve(promise); + return; + } + options = { + customTimers: {setTimeout, clearTimeout}, + ...options + }; + if (options.signal) { + const {signal} = options; + if (signal.aborted) { + reject(getAbortedReason(signal)); + } + signal.addEventListener('abort', () => { + reject(getAbortedReason(signal)); + }); + } -class src_CodeError extends Error { - code; - constructor(message, code, options) { - super(message, options); - this.code = code; + timer = options.customTimers.setTimeout.call(undefined, () => { + if (typeof fallback === 'function') { + try { + resolve(fallback()); + } catch (error) { + reject(error); + } + + return; + } + + const message = typeof fallback === 'string' ? fallback : `Promise timed out after ${milliseconds} milliseconds`; + const timeoutError = fallback instanceof Error ? fallback : new TimeoutError(message); + + if (typeof promise.cancel === 'function') { + promise.cancel(); + } + + reject(timeoutError); + }, milliseconds); + + (async () => { + try { + resolve(await promise); + } catch (error) { + reject(error); + } finally { + options.customTimers.clearTimeout.call(undefined, timer); + } + })(); + }); + + cancelablePromise.clear = () => { + clearTimeout(timer); + timer = undefined; + }; + + return cancelablePromise; +} + +;// CONCATENATED MODULE: ./node_modules/p-queue/dist/lower-bound.js +// Port of lower_bound from https://en.cppreference.com/w/cpp/algorithm/lower_bound +// Used to compute insertion index to keep queue sorted after insertion +function lowerBound(array, value, comparator) { + let first = 0; + let count = array.length; + while (count > 0) { + const step = Math.trunc(count / 2); + let it = first + step; + if (comparator(array[it], value) <= 0) { + first = ++it; + count -= step + 1; + } + else { + count = step; + } } + return first; } -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs/dist/src/unixfs.js -/* eslint-disable import/export */ -/* eslint-disable complexity */ -/* eslint-disable @typescript-eslint/no-namespace */ -/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ -/* eslint-disable @typescript-eslint/no-empty-interface */ -var unixfs_Data; -(function (Data) { - let DataType; - (function (DataType) { - DataType["Raw"] = "Raw"; - DataType["Directory"] = "Directory"; - DataType["File"] = "File"; - DataType["Metadata"] = "Metadata"; - DataType["Symlink"] = "Symlink"; - DataType["HAMTShard"] = "HAMTShard"; - })(DataType = Data.DataType || (Data.DataType = {})); - let __DataTypeValues; - (function (__DataTypeValues) { - __DataTypeValues[__DataTypeValues["Raw"] = 0] = "Raw"; - __DataTypeValues[__DataTypeValues["Directory"] = 1] = "Directory"; - __DataTypeValues[__DataTypeValues["File"] = 2] = "File"; - __DataTypeValues[__DataTypeValues["Metadata"] = 3] = "Metadata"; - __DataTypeValues[__DataTypeValues["Symlink"] = 4] = "Symlink"; - __DataTypeValues[__DataTypeValues["HAMTShard"] = 5] = "HAMTShard"; - })(__DataTypeValues || (__DataTypeValues = {})); - (function (DataType) { - DataType.codec = () => { - return enumeration(__DataTypeValues); +;// CONCATENATED MODULE: ./node_modules/p-queue/dist/priority-queue.js +var priority_queue_classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +}; +var _PriorityQueue_queue; + +class PriorityQueue { + constructor() { + _PriorityQueue_queue.set(this, []); + } + enqueue(run, options) { + options = { + priority: 0, + ...options, }; - })(DataType = Data.DataType || (Data.DataType = {})); - let _codec; - Data.codec = () => { - if (_codec == null) { - _codec = message((obj, w, opts = {}) => { - if (opts.lengthDelimited !== false) { - w.fork(); - } - if (obj.Type != null) { - w.uint32(8); - Data.DataType.codec().encode(obj.Type, w); - } - if (obj.Data != null) { - w.uint32(18); - w.bytes(obj.Data); - } - if (obj.filesize != null) { - w.uint32(24); - w.uint64(obj.filesize); - } - if (obj.blocksizes != null) { - for (const value of obj.blocksizes) { - w.uint32(32); - w.uint64(value); + const element = { + priority: options.priority, + run, + }; + if (this.size && priority_queue_classPrivateFieldGet(this, _PriorityQueue_queue, "f")[this.size - 1].priority >= options.priority) { + priority_queue_classPrivateFieldGet(this, _PriorityQueue_queue, "f").push(element); + return; + } + const index = lowerBound(priority_queue_classPrivateFieldGet(this, _PriorityQueue_queue, "f"), element, (a, b) => b.priority - a.priority); + priority_queue_classPrivateFieldGet(this, _PriorityQueue_queue, "f").splice(index, 0, element); + } + dequeue() { + const item = priority_queue_classPrivateFieldGet(this, _PriorityQueue_queue, "f").shift(); + return item === null || item === void 0 ? void 0 : item.run; + } + filter(options) { + return priority_queue_classPrivateFieldGet(this, _PriorityQueue_queue, "f").filter((element) => element.priority === options.priority).map((element) => element.run); + } + get size() { + return priority_queue_classPrivateFieldGet(this, _PriorityQueue_queue, "f").length; + } +} +_PriorityQueue_queue = new WeakMap(); +/* harmony default export */ const priority_queue = (PriorityQueue); + +;// CONCATENATED MODULE: ./node_modules/p-queue/dist/index.js +var dist_classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +}; +var dist_classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +}; +var _PQueue_instances, _PQueue_carryoverConcurrencyCount, _PQueue_isIntervalIgnored, _PQueue_intervalCount, _PQueue_intervalCap, _PQueue_interval, _PQueue_intervalEnd, _PQueue_intervalId, _PQueue_timeoutId, _PQueue_queue, _PQueue_queueClass, _PQueue_pending, _PQueue_concurrency, _PQueue_isPaused, _PQueue_throwOnTimeout, _PQueue_doesIntervalAllowAnother_get, _PQueue_doesConcurrentAllowAnother_get, _PQueue_next, _PQueue_onResumeInterval, _PQueue_isIntervalPaused_get, _PQueue_tryToStartAnother, _PQueue_initializeIntervalIfNeeded, _PQueue_onInterval, _PQueue_processQueue, _PQueue_throwOnAbort, _PQueue_onEvent; + + + +/** +The error thrown by `queue.add()` when a job is aborted before it is run. See `signal`. +*/ +class dist_AbortError extends Error { +} +/** +Promise queue with concurrency control. +*/ +class PQueue extends eventemitter3 { + // TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()` + constructor(options) { + var _a, _b, _c, _d; + super(); + _PQueue_instances.add(this); + _PQueue_carryoverConcurrencyCount.set(this, void 0); + _PQueue_isIntervalIgnored.set(this, void 0); + _PQueue_intervalCount.set(this, 0); + _PQueue_intervalCap.set(this, void 0); + _PQueue_interval.set(this, void 0); + _PQueue_intervalEnd.set(this, 0); + _PQueue_intervalId.set(this, void 0); + _PQueue_timeoutId.set(this, void 0); + _PQueue_queue.set(this, void 0); + _PQueue_queueClass.set(this, void 0); + _PQueue_pending.set(this, 0); + // The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194 + _PQueue_concurrency.set(this, void 0); + _PQueue_isPaused.set(this, void 0); + _PQueue_throwOnTimeout.set(this, void 0); + /** + Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already. + + Applies to each future operation. + */ + Object.defineProperty(this, "timeout", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + options = { + carryoverConcurrencyCount: false, + intervalCap: Number.POSITIVE_INFINITY, + interval: 0, + concurrency: Number.POSITIVE_INFINITY, + autoStart: true, + queueClass: priority_queue, + ...options, + }; + if (!(typeof options.intervalCap === 'number' && options.intervalCap >= 1)) { + throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(_b = (_a = options.intervalCap) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : ''}\` (${typeof options.intervalCap})`); + } + if (options.interval === undefined || !(Number.isFinite(options.interval) && options.interval >= 0)) { + throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(_d = (_c = options.interval) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : ''}\` (${typeof options.interval})`); + } + dist_classPrivateFieldSet(this, _PQueue_carryoverConcurrencyCount, options.carryoverConcurrencyCount, "f"); + dist_classPrivateFieldSet(this, _PQueue_isIntervalIgnored, options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0, "f"); + dist_classPrivateFieldSet(this, _PQueue_intervalCap, options.intervalCap, "f"); + dist_classPrivateFieldSet(this, _PQueue_interval, options.interval, "f"); + dist_classPrivateFieldSet(this, _PQueue_queue, new options.queueClass(), "f"); + dist_classPrivateFieldSet(this, _PQueue_queueClass, options.queueClass, "f"); + this.concurrency = options.concurrency; + this.timeout = options.timeout; + dist_classPrivateFieldSet(this, _PQueue_throwOnTimeout, options.throwOnTimeout === true, "f"); + dist_classPrivateFieldSet(this, _PQueue_isPaused, options.autoStart === false, "f"); + } + get concurrency() { + return dist_classPrivateFieldGet(this, _PQueue_concurrency, "f"); + } + set concurrency(newConcurrency) { + if (!(typeof newConcurrency === 'number' && newConcurrency >= 1)) { + throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${newConcurrency}\` (${typeof newConcurrency})`); + } + dist_classPrivateFieldSet(this, _PQueue_concurrency, newConcurrency, "f"); + dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_processQueue).call(this); + } + async add(function_, options = {}) { + options = { + timeout: this.timeout, + throwOnTimeout: dist_classPrivateFieldGet(this, _PQueue_throwOnTimeout, "f"), + ...options, + }; + return new Promise((resolve, reject) => { + dist_classPrivateFieldGet(this, _PQueue_queue, "f").enqueue(async () => { + var _a; + var _b, _c; + dist_classPrivateFieldSet(this, _PQueue_pending, (_b = dist_classPrivateFieldGet(this, _PQueue_pending, "f"), _b++, _b), "f"); + dist_classPrivateFieldSet(this, _PQueue_intervalCount, (_c = dist_classPrivateFieldGet(this, _PQueue_intervalCount, "f"), _c++, _c), "f"); + try { + // TODO: Use options.signal?.throwIfAborted() when targeting Node.js 18 + if ((_a = options.signal) === null || _a === void 0 ? void 0 : _a.aborted) { + // TODO: Use ABORT_ERR code when targeting Node.js 16 (https://nodejs.org/docs/latest-v16.x/api/errors.html#abort_err) + throw new dist_AbortError('The task was aborted.'); } - } - if (obj.hashType != null) { - w.uint32(40); - w.uint64(obj.hashType); - } - if (obj.fanout != null) { - w.uint32(48); - w.uint64(obj.fanout); - } - if (obj.mode != null) { - w.uint32(56); - w.uint32(obj.mode); - } - if (obj.mtime != null) { - w.uint32(66); - unixfs_UnixTime.codec().encode(obj.mtime, w); - } - if (opts.lengthDelimited !== false) { - w.ldelim(); - } - }, (reader, length) => { - const obj = { - blocksizes: [] - }; - const end = length == null ? reader.len : reader.pos + length; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - obj.Type = Data.DataType.codec().decode(reader); - break; - case 2: - obj.Data = reader.bytes(); - break; - case 3: - obj.filesize = reader.uint64(); - break; - case 4: - obj.blocksizes.push(reader.uint64()); - break; - case 5: - obj.hashType = reader.uint64(); - break; - case 6: - obj.fanout = reader.uint64(); - break; - case 7: - obj.mode = reader.uint32(); - break; - case 8: - obj.mtime = unixfs_UnixTime.codec().decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; + let operation = function_({ signal: options.signal }); + if (options.timeout) { + operation = pTimeout(Promise.resolve(operation), options.timeout); } - } - return obj; - }); - } - return _codec; - }; - Data.encode = (obj) => { - return encodeMessage(obj, Data.codec()); - }; - Data.decode = (buf) => { - return decodeMessage(buf, Data.codec()); - }; -})(unixfs_Data || (unixfs_Data = {})); -var unixfs_UnixTime; -(function (UnixTime) { - let _codec; - UnixTime.codec = () => { - if (_codec == null) { - _codec = message((obj, w, opts = {}) => { - if (opts.lengthDelimited !== false) { - w.fork(); - } - if (obj.Seconds != null) { - w.uint32(8); - w.int64(obj.Seconds); - } - if (obj.FractionalNanoseconds != null) { - w.uint32(21); - w.fixed32(obj.FractionalNanoseconds); - } - if (opts.lengthDelimited !== false) { - w.ldelim(); - } - }, (reader, length) => { - const obj = {}; - const end = length == null ? reader.len : reader.pos + length; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - obj.Seconds = reader.int64(); - break; - case 2: - obj.FractionalNanoseconds = reader.fixed32(); - break; - default: - reader.skipType(tag & 7); - break; + if (options.signal) { + operation = Promise.race([operation, dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_throwOnAbort).call(this, options.signal)]); } + const result = await operation; + resolve(result); + this.emit('completed', result); } - return obj; - }); - } - return _codec; - }; - UnixTime.encode = (obj) => { - return encodeMessage(obj, UnixTime.codec()); - }; - UnixTime.decode = (buf) => { - return decodeMessage(buf, UnixTime.codec()); - }; -})(unixfs_UnixTime || (unixfs_UnixTime = {})); -var unixfs_Metadata; -(function (Metadata) { - let _codec; - Metadata.codec = () => { - if (_codec == null) { - _codec = message((obj, w, opts = {}) => { - if (opts.lengthDelimited !== false) { - w.fork(); - } - if (obj.MimeType != null) { - w.uint32(10); - w.string(obj.MimeType); - } - if (opts.lengthDelimited !== false) { - w.ldelim(); - } - }, (reader, length) => { - const obj = {}; - const end = length == null ? reader.len : reader.pos + length; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - obj.MimeType = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + catch (error) { + if (error instanceof TimeoutError && !options.throwOnTimeout) { + resolve(); + return; } + reject(error); + this.emit('error', error); } - return obj; - }); - } - return _codec; - }; - Metadata.encode = (obj) => { - return encodeMessage(obj, Metadata.codec()); - }; - Metadata.decode = (buf) => { - return decodeMessage(buf, Metadata.codec()); - }; -})(unixfs_Metadata || (unixfs_Metadata = {})); -//# sourceMappingURL=unixfs.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs/dist/src/index.js - - -const src_types = { - Raw: 'raw', - Directory: 'directory', - File: 'file', - Metadata: 'metadata', - Symlink: 'symlink', - HAMTShard: 'hamt-sharded-directory' -}; -const src_dirTypes = [ - 'directory', - 'hamt-sharded-directory' -]; -const src_DEFAULT_FILE_MODE = parseInt('0644', 8); -const src_DEFAULT_DIRECTORY_MODE = parseInt('0755', 8); -class src_UnixFS { - /** - * Decode from protobuf https://github.com/ipfs/specs/blob/master/UNIXFS.md - */ - static unmarshal(marshaled) { - const message = unixfs_Data.decode(marshaled); - const data = new src_UnixFS({ - type: src_types[message.Type != null ? message.Type.toString() : 'File'], - data: message.Data, - blockSizes: message.blocksizes, - mode: message.mode, - mtime: message.mtime != null - ? { - secs: message.mtime.Seconds ?? 0n, - nsecs: message.mtime.FractionalNanoseconds + finally { + dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_next).call(this); } - : undefined, - fanout: message.fanout + }, options); + this.emit('add'); + dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_tryToStartAnother).call(this); }); - // make sure we honour the original mode - data._originalMode = message.mode ?? 0; - return data; } - type; - data; - blockSizes; - hashType; - fanout; - mtime; - _mode; - _originalMode; - constructor(options = { - type: 'file' - }) { - const { type, data, blockSizes, hashType, fanout, mtime, mode } = options; - if (type != null && !Object.values(src_types).includes(type)) { - throw err_code(new Error('Type: ' + type + ' is not valid'), 'ERR_INVALID_TYPE'); - } - this.type = type ?? 'file'; - this.data = data; - this.hashType = hashType; - this.fanout = fanout; - this.blockSizes = blockSizes ?? []; - this._originalMode = 0; - this.mode = mode; - this.mtime = mtime; + async addAll(functions, options) { + return Promise.all(functions.map(async (function_) => this.add(function_, options))); } - set mode(mode) { - if (mode == null) { - this._mode = this.isDirectory() ? src_DEFAULT_DIRECTORY_MODE : src_DEFAULT_FILE_MODE; - } - else { - this._mode = (mode & 0xFFF); + /** + Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.) + */ + start() { + if (!dist_classPrivateFieldGet(this, _PQueue_isPaused, "f")) { + return this; } + dist_classPrivateFieldSet(this, _PQueue_isPaused, false, "f"); + dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_processQueue).call(this); + return this; } - get mode() { - return this._mode; - } - isDirectory() { - return src_dirTypes.includes(this.type); - } - addBlockSize(size) { - this.blockSizes.push(size); + /** + Put queue execution on hold. + */ + pause() { + dist_classPrivateFieldSet(this, _PQueue_isPaused, true, "f"); } - removeBlockSize(index) { - this.blockSizes.splice(index, 1); + /** + Clear the queue. + */ + clear() { + dist_classPrivateFieldSet(this, _PQueue_queue, new (dist_classPrivateFieldGet(this, _PQueue_queueClass, "f"))(), "f"); } /** - * Returns `0n` for directories or `data.length + sum(blockSizes)` for everything else - */ - fileSize() { - if (this.isDirectory()) { - // dirs don't have file size - return 0n; + Can be called multiple times. Useful if you for example add additional items at a later time. + + @returns A promise that settles when the queue becomes empty. + */ + async onEmpty() { + // Instantly resolve if the queue is empty + if (dist_classPrivateFieldGet(this, _PQueue_queue, "f").size === 0) { + return; } - let sum = 0n; - this.blockSizes.forEach((size) => { - sum += size; - }); - if (this.data != null) { - sum += BigInt(this.data.length); + await dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_onEvent).call(this, 'empty'); + } + /** + @returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`. + + If you want to avoid having the queue grow beyond a certain size you can `await queue.onSizeLessThan()` before adding a new item. + + Note that this only limits the number of items waiting to start. There could still be up to `concurrency` jobs already running that this call does not include in its calculation. + */ + async onSizeLessThan(limit) { + // Instantly resolve if the queue is empty. + if (dist_classPrivateFieldGet(this, _PQueue_queue, "f").size < limit) { + return; } - return sum; + await dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_onEvent).call(this, 'next', () => dist_classPrivateFieldGet(this, _PQueue_queue, "f").size < limit); } /** - * encode to protobuf Uint8Array - */ - marshal() { - let type; - switch (this.type) { - case 'raw': - type = unixfs_Data.DataType.Raw; - break; - case 'directory': - type = unixfs_Data.DataType.Directory; - break; - case 'file': - type = unixfs_Data.DataType.File; - break; - case 'metadata': - type = unixfs_Data.DataType.Metadata; - break; - case 'symlink': - type = unixfs_Data.DataType.Symlink; - break; - case 'hamt-sharded-directory': - type = unixfs_Data.DataType.HAMTShard; - break; - default: - throw err_code(new Error(`Type: ${type} is not valid`), 'ERR_INVALID_TYPE'); + The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet. + + @returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`. + */ + async onIdle() { + // Instantly resolve if none pending and if nothing else is queued + if (dist_classPrivateFieldGet(this, _PQueue_pending, "f") === 0 && dist_classPrivateFieldGet(this, _PQueue_queue, "f").size === 0) { + return; } - let data = this.data; - if (this.data == null || this.data.length === 0) { - data = undefined; + await dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_onEvent).call(this, 'idle'); + } + /** + Size of the queue, the number of queued items waiting to run. + */ + get size() { + return dist_classPrivateFieldGet(this, _PQueue_queue, "f").size; + } + /** + Size of the queue, filtered by the given options. + + For example, this can be used to find the number of items remaining in the queue with a specific priority level. + */ + sizeBy(options) { + // eslint-disable-next-line unicorn/no-array-callback-reference + return dist_classPrivateFieldGet(this, _PQueue_queue, "f").filter(options).length; + } + /** + Number of running items (no longer in the queue). + */ + get pending() { + return dist_classPrivateFieldGet(this, _PQueue_pending, "f"); + } + /** + Whether the queue is currently paused. + */ + get isPaused() { + return dist_classPrivateFieldGet(this, _PQueue_isPaused, "f"); + } +} +_PQueue_carryoverConcurrencyCount = new WeakMap(), _PQueue_isIntervalIgnored = new WeakMap(), _PQueue_intervalCount = new WeakMap(), _PQueue_intervalCap = new WeakMap(), _PQueue_interval = new WeakMap(), _PQueue_intervalEnd = new WeakMap(), _PQueue_intervalId = new WeakMap(), _PQueue_timeoutId = new WeakMap(), _PQueue_queue = new WeakMap(), _PQueue_queueClass = new WeakMap(), _PQueue_pending = new WeakMap(), _PQueue_concurrency = new WeakMap(), _PQueue_isPaused = new WeakMap(), _PQueue_throwOnTimeout = new WeakMap(), _PQueue_instances = new WeakSet(), _PQueue_doesIntervalAllowAnother_get = function _PQueue_doesIntervalAllowAnother_get() { + return dist_classPrivateFieldGet(this, _PQueue_isIntervalIgnored, "f") || dist_classPrivateFieldGet(this, _PQueue_intervalCount, "f") < dist_classPrivateFieldGet(this, _PQueue_intervalCap, "f"); +}, _PQueue_doesConcurrentAllowAnother_get = function _PQueue_doesConcurrentAllowAnother_get() { + return dist_classPrivateFieldGet(this, _PQueue_pending, "f") < dist_classPrivateFieldGet(this, _PQueue_concurrency, "f"); +}, _PQueue_next = function _PQueue_next() { + var _a; + dist_classPrivateFieldSet(this, _PQueue_pending, (_a = dist_classPrivateFieldGet(this, _PQueue_pending, "f"), _a--, _a), "f"); + dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_tryToStartAnother).call(this); + this.emit('next'); +}, _PQueue_onResumeInterval = function _PQueue_onResumeInterval() { + dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_onInterval).call(this); + dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_initializeIntervalIfNeeded).call(this); + dist_classPrivateFieldSet(this, _PQueue_timeoutId, undefined, "f"); +}, _PQueue_isIntervalPaused_get = function _PQueue_isIntervalPaused_get() { + const now = Date.now(); + if (dist_classPrivateFieldGet(this, _PQueue_intervalId, "f") === undefined) { + const delay = dist_classPrivateFieldGet(this, _PQueue_intervalEnd, "f") - now; + if (delay < 0) { + // Act as the interval was done + // We don't need to resume it here because it will be resumed on line 160 + dist_classPrivateFieldSet(this, _PQueue_intervalCount, (dist_classPrivateFieldGet(this, _PQueue_carryoverConcurrencyCount, "f")) ? dist_classPrivateFieldGet(this, _PQueue_pending, "f") : 0, "f"); } - let mode; - if (this.mode != null) { - mode = (this._originalMode & 0xFFFFF000) | (this.mode ?? 0); - if (mode === src_DEFAULT_FILE_MODE && !this.isDirectory()) { - mode = undefined; - } - if (mode === src_DEFAULT_DIRECTORY_MODE && this.isDirectory()) { - mode = undefined; + else { + // Act as the interval is pending + if (dist_classPrivateFieldGet(this, _PQueue_timeoutId, "f") === undefined) { + dist_classPrivateFieldSet(this, _PQueue_timeoutId, setTimeout(() => { + dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_onResumeInterval).call(this); + }, delay), "f"); } + return true; } - let mtime; - if (this.mtime != null) { - mtime = { - Seconds: this.mtime.secs, - FractionalNanoseconds: this.mtime.nsecs - }; - } - return unixfs_Data.encode({ - Type: type, - Data: data, - filesize: this.isDirectory() ? undefined : this.fileSize(), - blocksizes: this.blockSizes, - hashType: this.hashType, - fanout: this.fanout, - mode, - mtime - }); } -} - -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bytes.js -const multiformats_dist_src_bytes_empty = new Uint8Array(0); -function multiformats_dist_src_bytes_toHex(d) { - return d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), ''); -} -function multiformats_dist_src_bytes_fromHex(hex) { - const hexes = hex.match(/../g); - return hexes != null ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : multiformats_dist_src_bytes_empty; -} -function multiformats_dist_src_bytes_equals(aa, bb) { - if (aa === bb) - return true; - if (aa.byteLength !== bb.byteLength) { + return false; +}, _PQueue_tryToStartAnother = function _PQueue_tryToStartAnother() { + if (dist_classPrivateFieldGet(this, _PQueue_queue, "f").size === 0) { + // We can clear the interval ("pause") + // Because we can redo it later ("resume") + if (dist_classPrivateFieldGet(this, _PQueue_intervalId, "f")) { + clearInterval(dist_classPrivateFieldGet(this, _PQueue_intervalId, "f")); + } + dist_classPrivateFieldSet(this, _PQueue_intervalId, undefined, "f"); + this.emit('empty'); + if (dist_classPrivateFieldGet(this, _PQueue_pending, "f") === 0) { + this.emit('idle'); + } return false; } - for (let ii = 0; ii < aa.byteLength; ii++) { - if (aa[ii] !== bb[ii]) { - return false; + if (!dist_classPrivateFieldGet(this, _PQueue_isPaused, "f")) { + const canInitializeInterval = !dist_classPrivateFieldGet(this, _PQueue_instances, "a", _PQueue_isIntervalPaused_get); + if (dist_classPrivateFieldGet(this, _PQueue_instances, "a", _PQueue_doesIntervalAllowAnother_get) && dist_classPrivateFieldGet(this, _PQueue_instances, "a", _PQueue_doesConcurrentAllowAnother_get)) { + const job = dist_classPrivateFieldGet(this, _PQueue_queue, "f").dequeue(); + if (!job) { + return false; + } + this.emit('active'); + job(); + if (canInitializeInterval) { + dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_initializeIntervalIfNeeded).call(this); + } + return true; } } - return true; -} -function node_modules_multiformats_dist_src_bytes_coerce(o) { - if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') - return o; - if (o instanceof ArrayBuffer) - return new Uint8Array(o); - if (ArrayBuffer.isView(o)) { - return new Uint8Array(o.buffer, o.byteOffset, o.byteLength); + return false; +}, _PQueue_initializeIntervalIfNeeded = function _PQueue_initializeIntervalIfNeeded() { + if (dist_classPrivateFieldGet(this, _PQueue_isIntervalIgnored, "f") || dist_classPrivateFieldGet(this, _PQueue_intervalId, "f") !== undefined) { + return; } - throw new Error('Unknown type, must be binary type'); -} -function multiformats_dist_src_bytes_isBinary(o) { - return o instanceof ArrayBuffer || ArrayBuffer.isView(o); -} -function multiformats_dist_src_bytes_fromString(str) { - return new TextEncoder().encode(str); -} -function node_modules_multiformats_dist_src_bytes_toString(b) { - return new TextDecoder().decode(b); -} -//# sourceMappingURL=bytes.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/codecs/raw.js - -const dist_src_codecs_raw_name = 'raw'; -const dist_src_codecs_raw_code = 0x55; -function dist_src_codecs_raw_encode(node) { - return node_modules_multiformats_dist_src_bytes_coerce(node); -} -function dist_src_codecs_raw_decode(data) { - return node_modules_multiformats_dist_src_bytes_coerce(data); -} -//# sourceMappingURL=raw.js.map -;// CONCATENATED MODULE: ./node_modules/progress-events/dist/src/index.js -/** - * An implementation of the ProgressEvent interface, this is essentially - * a typed `CustomEvent` with a `type` property that lets us disambiguate - * events passed to `progress` callbacks. - */ -class CustomProgressEvent extends Event { - constructor(type, detail) { - super(type); - this.detail = detail; + dist_classPrivateFieldSet(this, _PQueue_intervalId, setInterval(() => { + dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_onInterval).call(this); + }, dist_classPrivateFieldGet(this, _PQueue_interval, "f")), "f"); + dist_classPrivateFieldSet(this, _PQueue_intervalEnd, Date.now() + dist_classPrivateFieldGet(this, _PQueue_interval, "f"), "f"); +}, _PQueue_onInterval = function _PQueue_onInterval() { + if (dist_classPrivateFieldGet(this, _PQueue_intervalCount, "f") === 0 && dist_classPrivateFieldGet(this, _PQueue_pending, "f") === 0 && dist_classPrivateFieldGet(this, _PQueue_intervalId, "f")) { + clearInterval(dist_classPrivateFieldGet(this, _PQueue_intervalId, "f")); + dist_classPrivateFieldSet(this, _PQueue_intervalId, undefined, "f"); } -} -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/vendor/base-x.js -/* eslint-disable */ + dist_classPrivateFieldSet(this, _PQueue_intervalCount, dist_classPrivateFieldGet(this, _PQueue_carryoverConcurrencyCount, "f") ? dist_classPrivateFieldGet(this, _PQueue_pending, "f") : 0, "f"); + dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_processQueue).call(this); +}, _PQueue_processQueue = function _PQueue_processQueue() { + // eslint-disable-next-line no-empty + while (dist_classPrivateFieldGet(this, _PQueue_instances, "m", _PQueue_tryToStartAnother).call(this)) { } +}, _PQueue_throwOnAbort = async function _PQueue_throwOnAbort(signal) { + return new Promise((_resolve, reject) => { + signal.addEventListener('abort', () => { + // TODO: Reject with signal.throwIfAborted() when targeting Node.js 18 + // TODO: Use ABORT_ERR code when targeting Node.js 16 (https://nodejs.org/docs/latest-v16.x/api/errors.html#abort_err) + reject(new dist_AbortError('The task was aborted.')); + }, { once: true }); + }); +}, _PQueue_onEvent = async function _PQueue_onEvent(event, filter) { + return new Promise(resolve => { + const listener = () => { + if (filter && !filter()) { + return; + } + this.off(event, listener); + resolve(); + }; + this.on(event, listener); + }); +}; +/* harmony default export */ const dist = (PQueue); + +;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/vendor/base-x.js // base-x encoding / decoding // Copyright (c) 2018 base-x contributors // Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) // Distributed under the MIT software license, see the accompanying // file LICENSE or http://www.opensource.org/licenses/mit-license.php. -/** - * @param {string} ALPHABET - * @param {any} name - */ -function dist_src_vendor_base_x_base(ALPHABET, name) { - if (ALPHABET.length >= 255) { - throw new TypeError('Alphabet too long'); - } - var BASE_MAP = new Uint8Array(256); - for (var j = 0; j < BASE_MAP.length; j++) { - BASE_MAP[j] = 255; - } - for (var i = 0; i < ALPHABET.length; i++) { - var x = ALPHABET.charAt(i); - var xc = x.charCodeAt(0); - if (BASE_MAP[xc] !== 255) { - throw new TypeError(x + ' is ambiguous'); - } - BASE_MAP[xc] = i; +function car_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { + if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; + } + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') } + BASE_MAP[xc] = i; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up + var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up + function encode (source) { + if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } else if (Array.isArray(source)) { + source = Uint8Array.from(source); } - var BASE = ALPHABET.length; - var LEADER = ALPHABET.charAt(0); - var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up - var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up - /** - * @param {any[] | Iterable} source - */ - function encode(source) { - // @ts-ignore - if (source instanceof Uint8Array) - ; - else if (ArrayBuffer.isView(source)) { - source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); - } - else if (Array.isArray(source)) { - source = Uint8Array.from(source); - } - if (!(source instanceof Uint8Array)) { - throw new TypeError('Expected Uint8Array'); - } - if (source.length === 0) { - return ''; - } + if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') } + if (source.length === 0) { return '' } // Skip & count leading zeroes. - var zeroes = 0; - var length = 0; - var pbegin = 0; - var pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; - } + var zeroes = 0; + var length = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } // Allocate enough space in big-endian base58 representation. - var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; - var b58 = new Uint8Array(size); + var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; + var b58 = new Uint8Array(size); // Process the bytes. - while (pbegin !== pend) { - var carry = source[pbegin]; + while (pbegin !== pend) { + var carry = source[pbegin]; // Apply "b58 = b58 * 256 + ch". - var i = 0; - for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { - carry += (256 * b58[it1]) >>> 0; - b58[it1] = (carry % BASE) >>> 0; - carry = (carry / BASE) >>> 0; - } - if (carry !== 0) { - throw new Error('Non-zero carry'); - } - length = i; - pbegin++; - } + var i = 0; + for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { + carry += (256 * b58[it1]) >>> 0; + b58[it1] = (carry % BASE) >>> 0; + carry = (carry / BASE) >>> 0; + } + if (carry !== 0) { throw new Error('Non-zero carry') } + length = i; + pbegin++; + } // Skip leading zeroes in base58 result. - var it2 = size - length; - while (it2 !== size && b58[it2] === 0) { - it2++; - } - // Translate the result into a string. - var str = LEADER.repeat(zeroes); - for (; it2 < size; ++it2) { - str += ALPHABET.charAt(b58[it2]); - } - return str; + var it2 = size - length; + while (it2 !== size && b58[it2] === 0) { + it2++; } - /** - * @param {string | string[]} source - */ - function decodeUnsafe(source) { - if (typeof source !== 'string') { - throw new TypeError('Expected String'); - } - if (source.length === 0) { - return new Uint8Array(); - } - var psz = 0; + // Translate the result into a string. + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); } + return str + } + function decodeUnsafe (source) { + if (typeof source !== 'string') { throw new TypeError('Expected String') } + if (source.length === 0) { return new Uint8Array() } + var psz = 0; // Skip leading spaces. - if (source[psz] === ' ') { - return; - } + if (source[psz] === ' ') { return } // Skip and count leading '1's. - var zeroes = 0; - var length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; - } + var zeroes = 0; + var length = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; + } // Allocate enough space in big-endian base256 representation. - var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. - var b256 = new Uint8Array(size); + var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. + var b256 = new Uint8Array(size); // Process the characters. - while (source[psz]) { + while (source[psz]) { // Decode character - var carry = BASE_MAP[source.charCodeAt(psz)]; + var carry = BASE_MAP[source.charCodeAt(psz)]; // Invalid character - if (carry === 255) { - return; - } - var i = 0; - for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { - carry += (BASE * b256[it3]) >>> 0; - b256[it3] = (carry % 256) >>> 0; - carry = (carry / 256) >>> 0; - } - if (carry !== 0) { - throw new Error('Non-zero carry'); - } - length = i; - psz++; - } + if (carry === 255) { return } + var i = 0; + for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { + carry += (BASE * b256[it3]) >>> 0; + b256[it3] = (carry % 256) >>> 0; + carry = (carry / 256) >>> 0; + } + if (carry !== 0) { throw new Error('Non-zero carry') } + length = i; + psz++; + } // Skip trailing spaces. - if (source[psz] === ' ') { - return; - } + if (source[psz] === ' ') { return } // Skip leading zeroes in b256. - var it4 = size - length; - while (it4 !== size && b256[it4] === 0) { - it4++; - } - var vch = new Uint8Array(zeroes + (size - it4)); - var j = zeroes; - while (it4 !== size) { - vch[j++] = b256[it4++]; - } - return vch; + var it4 = size - length; + while (it4 !== size && b256[it4] === 0) { + it4++; } - /** - * @param {string | string[]} string - */ - function decode(string) { - var buffer = decodeUnsafe(string); - if (buffer) { - return buffer; - } - throw new Error(`Non-${name} character`); + var vch = new Uint8Array(zeroes + (size - it4)); + var j = zeroes; + while (it4 !== size) { + vch[j++] = b256[it4++]; } - return { - encode: encode, - decodeUnsafe: decodeUnsafe, - decode: decode - }; + return vch + } + function decode (string) { + var buffer = decodeUnsafe(string); + if (buffer) { return buffer } + throw new Error(`Non-${name} character`) + } + return { + encode: encode, + decodeUnsafe: decodeUnsafe, + decode: decode + } } -var dist_src_vendor_base_x_src = dist_src_vendor_base_x_base; -var dist_src_vendor_base_x_brrp_multiformats_scope_baseX = dist_src_vendor_base_x_src; -/* harmony default export */ const multiformats_dist_src_vendor_base_x = (dist_src_vendor_base_x_brrp_multiformats_scope_baseX); -//# sourceMappingURL=base-x.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base.js +var car_node_modules_multiformats_vendor_base_x_src = car_node_modules_multiformats_vendor_base_x_base; + +var car_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = car_node_modules_multiformats_vendor_base_x_src; + +/* harmony default export */ const car_node_modules_multiformats_vendor_base_x = (car_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX); + +;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/src/bytes.js +const car_node_modules_multiformats_src_bytes_empty = new Uint8Array(0) + +/** + * @param {Uint8Array} d + */ +const car_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') + +/** + * @param {string} hex + */ +const car_node_modules_multiformats_src_bytes_fromHex = hex => { + const hexes = hex.match(/../g) + return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : car_node_modules_multiformats_src_bytes_empty +} + +/** + * @param {Uint8Array} aa + * @param {Uint8Array} bb + */ +const car_node_modules_multiformats_src_bytes_equals = (aa, bb) => { + if (aa === bb) return true + if (aa.byteLength !== bb.byteLength) { + return false + } + + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false + } + } + + return true +} + +/** + * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o + * @returns {Uint8Array} + */ +const car_node_modules_multiformats_src_bytes_coerce = o => { + if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o + if (o instanceof ArrayBuffer) return new Uint8Array(o) + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) + } + throw new Error('Unknown type, must be binary type') +} + +/** + * @param {any} o + * @returns {o is ArrayBuffer|ArrayBufferView} + */ +const car_node_modules_multiformats_src_bytes_isBinary = o => + o instanceof ArrayBuffer || ArrayBuffer.isView(o) + +/** + * @param {string} str + * @returns {Uint8Array} + */ +const car_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) + +/** + * @param {Uint8Array} b + * @returns {string} + */ +const car_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) + + + +;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/src/bases/base.js + + +// Linter can't see that API is used in types. +// eslint-disable-next-line /** * Class represents both BaseEncoder and MultibaseEncoder meaning it * can be used to encode to multibase or base encode without multibase * prefix. + * + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseEncoder} + * @implements {API.BaseEncoder} */ -class multiformats_dist_src_bases_base_Encoder { - name; - prefix; - baseEncode; - constructor(name, prefix, baseEncode) { - this.name = name; - this.prefix = prefix; - this.baseEncode = baseEncode; - } - encode(bytes) { - if (bytes instanceof Uint8Array) { - return `${this.prefix}${this.baseEncode(bytes)}`; - } - else { - throw Error('Unknown type, must be binary type'); - } +class car_node_modules_multiformats_src_bases_base_Encoder { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(bytes:Uint8Array) => string} baseEncode + */ + constructor (name, prefix, baseEncode) { + this.name = name + this.prefix = prefix + this.baseEncode = baseEncode + } + + /** + * @param {Uint8Array} bytes + * @returns {API.Multibase} + */ + encode (bytes) { + if (bytes instanceof Uint8Array) { + return `${this.prefix}${this.baseEncode(bytes)}` + } else { + throw Error('Unknown type, must be binary type') } + } } + +/** + * @template {string} Prefix + */ /** * Class represents both BaseDecoder and MultibaseDecoder so it could be used * to decode multibases (with matching prefix) or just base decode strings * with corresponding base encoding. + * + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseDecoder} + * @implements {API.UnibaseDecoder} + * @implements {API.BaseDecoder} */ -class multiformats_dist_src_bases_base_Decoder { - name; - prefix; - baseDecode; - prefixCodePoint; - constructor(name, prefix, baseDecode) { - this.name = name; - this.prefix = prefix; - /* c8 ignore next 3 */ - if (prefix.codePointAt(0) === undefined) { - throw new Error('Invalid prefix character'); - } - this.prefixCodePoint = prefix.codePointAt(0); - this.baseDecode = baseDecode; - } - decode(text) { - if (typeof text === 'string') { - if (text.codePointAt(0) !== this.prefixCodePoint) { - throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); - } - return this.baseDecode(text.slice(this.prefix.length)); - } - else { - throw Error('Can only multibase decode strings'); - } +class car_node_modules_multiformats_src_bases_base_Decoder { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(text:string) => Uint8Array} baseDecode + */ + constructor (name, prefix, baseDecode) { + this.name = name + this.prefix = prefix + /* c8 ignore next 3 */ + if (prefix.codePointAt(0) === undefined) { + throw new Error('Invalid prefix character') } - or(decoder) { - return multiformats_dist_src_bases_base_or(this, decoder); + /** @private */ + this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0)) + this.baseDecode = baseDecode + } + + /** + * @param {string} text + */ + decode (text) { + if (typeof text === 'string') { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`) + } + return this.baseDecode(text.slice(this.prefix.length)) + } else { + throw Error('Can only multibase decode strings') } + } + + /** + * @template {string} OtherPrefix + * @param {API.UnibaseDecoder|ComposedDecoder} decoder + * @returns {ComposedDecoder} + */ + or (decoder) { + return car_node_modules_multiformats_src_bases_base_or(this, decoder) + } } -class multiformats_dist_src_bases_base_ComposedDecoder { - decoders; - constructor(decoders) { - this.decoders = decoders; - } - or(decoder) { - return multiformats_dist_src_bases_base_or(this, decoder); - } - decode(input) { - const prefix = input[0]; - const decoder = this.decoders[prefix]; - if (decoder != null) { - return decoder.decode(input); - } - else { - throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); - } + +/** + * @template {string} Prefix + * @typedef {Record>} Decoders + */ + +/** + * @template {string} Prefix + * @implements {API.MultibaseDecoder} + * @implements {API.CombobaseDecoder} + */ +class car_node_modules_multiformats_src_bases_base_ComposedDecoder { + /** + * @param {Decoders} decoders + */ + constructor (decoders) { + this.decoders = decoders + } + + /** + * @template {string} OtherPrefix + * @param {API.UnibaseDecoder|ComposedDecoder} decoder + * @returns {ComposedDecoder} + */ + or (decoder) { + return car_node_modules_multiformats_src_bases_base_or(this, decoder) + } + + /** + * @param {string} input + * @returns {Uint8Array} + */ + decode (input) { + const prefix = /** @type {Prefix} */ (input[0]) + const decoder = this.decoders[prefix] + if (decoder) { + return decoder.decode(input) + } else { + throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`) } + } } -function multiformats_dist_src_bases_base_or(left, right) { - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - return new multiformats_dist_src_bases_base_ComposedDecoder({ - ...(left.decoders ?? { [left.prefix]: left }), - ...(right.decoders ?? { [right.prefix]: right }) - }); + +/** + * @template {string} L + * @template {string} R + * @param {API.UnibaseDecoder|API.CombobaseDecoder} left + * @param {API.UnibaseDecoder|API.CombobaseDecoder} right + * @returns {ComposedDecoder} + */ +const car_node_modules_multiformats_src_bases_base_or = (left, right) => new car_node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({ + ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }), + ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right }) +})) + +/** + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseCodec} + * @implements {API.MultibaseEncoder} + * @implements {API.MultibaseDecoder} + * @implements {API.BaseCodec} + * @implements {API.BaseEncoder} + * @implements {API.BaseDecoder} + */ +class car_node_modules_multiformats_src_bases_base_Codec { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(bytes:Uint8Array) => string} baseEncode + * @param {(text:string) => Uint8Array} baseDecode + */ + constructor (name, prefix, baseEncode, baseDecode) { + this.name = name + this.prefix = prefix + this.baseEncode = baseEncode + this.baseDecode = baseDecode + this.encoder = new car_node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode) + this.decoder = new car_node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode) + } + + /** + * @param {Uint8Array} input + */ + encode (input) { + return this.encoder.encode(input) + } + + /** + * @param {string} input + */ + decode (input) { + return this.decoder.decode(input) + } } -class multiformats_dist_src_bases_base_Codec { - name; - prefix; - baseEncode; - baseDecode; - encoder; - decoder; - constructor(name, prefix, baseEncode, baseDecode) { - this.name = name; - this.prefix = prefix; - this.baseEncode = baseEncode; - this.baseDecode = baseDecode; - this.encoder = new multiformats_dist_src_bases_base_Encoder(name, prefix, baseEncode); - this.decoder = new multiformats_dist_src_bases_base_Decoder(name, prefix, baseDecode); - } - encode(input) { - return this.encoder.encode(input); + +/** + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {(bytes:Uint8Array) => string} options.encode + * @param {(input:string) => Uint8Array} options.decode + * @returns {Codec} + */ +const car_node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) => + new car_node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode) + +/** + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {string} options.alphabet + * @returns {Codec} + */ +const car_node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => { + const { encode, decode } = car_node_modules_multiformats_vendor_base_x(alphabet, name) + return car_node_modules_multiformats_src_bases_base_from({ + prefix, + name, + encode, + /** + * @param {string} text + */ + decode: text => car_node_modules_multiformats_src_bytes_coerce(decode(text)) + }) +} + +/** + * @param {string} string + * @param {string} alphabet + * @param {number} bitsPerChar + * @param {string} name + * @returns {Uint8Array} + */ +const car_node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { + // Build the character lookup table: + /** @type {Record} */ + const codes = {} + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i + } + + // Count the padding bytes: + let end = string.length + while (string[end - 1] === '=') { + --end + } + + // Allocate the output: + const out = new Uint8Array((end * bitsPerChar / 8) | 0) + + // Parse the data: + let bits = 0 // Number of bits currently in the buffer + let buffer = 0 // Bits waiting to be written out, MSB first + let written = 0 // Next byte to write + for (let i = 0; i < end; ++i) { + // Read one character from the string: + const value = codes[string[i]] + if (value === undefined) { + throw new SyntaxError(`Non-${name} character`) } - decode(input) { - return this.decoder.decode(input); + + // Append the bits to the buffer: + buffer = (buffer << bitsPerChar) | value + bits += bitsPerChar + + // Write out some bits if the buffer has a byte's worth: + if (bits >= 8) { + bits -= 8 + out[written++] = 0xff & (buffer >> bits) } + } + + // Verify that we have received just enough bits: + if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) { + throw new SyntaxError('Unexpected end of data') + } + + return out } -function multiformats_dist_src_bases_base_from({ name, prefix, encode, decode }) { - return new multiformats_dist_src_bases_base_Codec(name, prefix, encode, decode); -} -function multiformats_dist_src_bases_base_baseX({ name, prefix, alphabet }) { - const { encode, decode } = multiformats_dist_src_vendor_base_x(alphabet, name); - return multiformats_dist_src_bases_base_from({ - prefix, - name, - encode, - decode: (text) => node_modules_multiformats_dist_src_bytes_coerce(decode(text)) - }); -} -function multiformats_dist_src_bases_base_decode(string, alphabet, bitsPerChar, name) { - // Build the character lookup table: - const codes = {}; - for (let i = 0; i < alphabet.length; ++i) { - codes[alphabet[i]] = i; - } - // Count the padding bytes: - let end = string.length; - while (string[end - 1] === '=') { - --end; + +/** + * @param {Uint8Array} data + * @param {string} alphabet + * @param {number} bitsPerChar + * @returns {string} + */ +const car_node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => { + const pad = alphabet[alphabet.length - 1] === '=' + const mask = (1 << bitsPerChar) - 1 + let out = '' + + let bits = 0 // Number of bits currently in the buffer + let buffer = 0 // Bits waiting to be written out, MSB first + for (let i = 0; i < data.length; ++i) { + // Slurp data into the buffer: + buffer = (buffer << 8) | data[i] + bits += 8 + + // Write out as much as we can: + while (bits > bitsPerChar) { + bits -= bitsPerChar + out += alphabet[mask & (buffer >> bits)] } - // Allocate the output: - const out = new Uint8Array((end * bitsPerChar / 8) | 0); - // Parse the data: - let bits = 0; // Number of bits currently in the buffer - let buffer = 0; // Bits waiting to be written out, MSB first - let written = 0; // Next byte to write - for (let i = 0; i < end; ++i) { - // Read one character from the string: - const value = codes[string[i]]; - if (value === undefined) { - throw new SyntaxError(`Non-${name} character`); - } - // Append the bits to the buffer: - buffer = (buffer << bitsPerChar) | value; - bits += bitsPerChar; - // Write out some bits if the buffer has a byte's worth: - if (bits >= 8) { - bits -= 8; - out[written++] = 0xff & (buffer >> bits); - } + } + + // Partial character: + if (bits) { + out += alphabet[mask & (buffer << (bitsPerChar - bits))] + } + + // Add padding characters until we hit a byte boundary: + if (pad) { + while ((out.length * bitsPerChar) & 7) { + out += '=' } - // Verify that we have received just enough bits: - if (bits >= bitsPerChar || (0xff & (buffer << (8 - bits))) !== 0) { - throw new SyntaxError('Unexpected end of data'); + } + + return out +} + +/** + * RFC4648 Factory + * + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {string} options.alphabet + * @param {number} options.bitsPerChar + */ +const car_node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { + return car_node_modules_multiformats_src_bases_base_from({ + prefix, + name, + encode (input) { + return car_node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar) + }, + decode (input) { + return car_node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name) } - return out; + }) +} + +;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/src/bases/base64.js +// @ts-check + + + +const car_node_modules_multiformats_src_bases_base64_base64 = car_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'm', + name: 'base64', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + bitsPerChar: 6 +}) + +const car_node_modules_multiformats_src_bases_base64_base64pad = car_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'M', + name: 'base64pad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', + bitsPerChar: 6 +}) + +const car_node_modules_multiformats_src_bases_base64_base64url = car_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'u', + name: 'base64url', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', + bitsPerChar: 6 +}) + +const car_node_modules_multiformats_src_bases_base64_base64urlpad = car_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'U', + name: 'base64urlpad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', + bitsPerChar: 6 +}) + +;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/src/bases/base32.js + + +const car_node_modules_multiformats_src_bases_base32_base32 = car_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'b', + name: 'base32', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567', + bitsPerChar: 5 +}) + +const car_node_modules_multiformats_src_bases_base32_base32upper = car_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'B', + name: 'base32upper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', + bitsPerChar: 5 +}) + +const car_node_modules_multiformats_src_bases_base32_base32pad = car_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'c', + name: 'base32pad', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', + bitsPerChar: 5 +}) + +const car_node_modules_multiformats_src_bases_base32_base32padupper = car_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'C', + name: 'base32padupper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', + bitsPerChar: 5 +}) + +const car_node_modules_multiformats_src_bases_base32_base32hex = car_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'v', + name: 'base32hex', + alphabet: '0123456789abcdefghijklmnopqrstuv', + bitsPerChar: 5 +}) + +const car_node_modules_multiformats_src_bases_base32_base32hexupper = car_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'V', + name: 'base32hexupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', + bitsPerChar: 5 +}) + +const car_node_modules_multiformats_src_bases_base32_base32hexpad = car_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 't', + name: 'base32hexpad', + alphabet: '0123456789abcdefghijklmnopqrstuv=', + bitsPerChar: 5 +}) + +const car_node_modules_multiformats_src_bases_base32_base32hexpadupper = car_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'T', + name: 'base32hexpadupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', + bitsPerChar: 5 +}) + +const car_node_modules_multiformats_src_bases_base32_base32z = car_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'h', + name: 'base32z', + alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', + bitsPerChar: 5 +}) + +;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/src/bases/base58.js + + +const car_node_modules_multiformats_src_bases_base58_base58btc = car_node_modules_multiformats_src_bases_base_baseX({ + name: 'base58btc', + prefix: 'z', + alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +}) + +const car_node_modules_multiformats_src_bases_base58_base58flickr = car_node_modules_multiformats_src_bases_base_baseX({ + name: 'base58flickr', + prefix: 'Z', + alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' +}) + +;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/vendor/varint.js +var car_node_modules_multiformats_vendor_varint_encode_1 = car_node_modules_multiformats_vendor_varint_encode; + +var car_node_modules_multiformats_vendor_varint_MSB = 0x80 + , car_node_modules_multiformats_vendor_varint_REST = 0x7F + , car_node_modules_multiformats_vendor_varint_MSBALL = ~car_node_modules_multiformats_vendor_varint_REST + , car_node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31); + +function car_node_modules_multiformats_vendor_varint_encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; + + while(num >= car_node_modules_multiformats_vendor_varint_INT) { + out[offset++] = (num & 0xFF) | car_node_modules_multiformats_vendor_varint_MSB; + num /= 128; + } + while(num & car_node_modules_multiformats_vendor_varint_MSBALL) { + out[offset++] = (num & 0xFF) | car_node_modules_multiformats_vendor_varint_MSB; + num >>>= 7; + } + out[offset] = num | 0; + + car_node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; + + return out } -function multiformats_dist_src_bases_base_encode(data, alphabet, bitsPerChar) { - const pad = alphabet[alphabet.length - 1] === '='; - const mask = (1 << bitsPerChar) - 1; - let out = ''; - let bits = 0; // Number of bits currently in the buffer - let buffer = 0; // Bits waiting to be written out, MSB first - for (let i = 0; i < data.length; ++i) { - // Slurp data into the buffer: - buffer = (buffer << 8) | data[i]; - bits += 8; - // Write out as much as we can: - while (bits > bitsPerChar) { - bits -= bitsPerChar; - out += alphabet[mask & (buffer >> bits)]; - } - } - // Partial character: - if (bits !== 0) { - out += alphabet[mask & (buffer << (bitsPerChar - bits))]; - } - // Add padding characters until we hit a byte boundary: - if (pad) { - while (((out.length * bitsPerChar) & 7) !== 0) { - out += '='; - } + +var car_node_modules_multiformats_vendor_varint_decode = car_node_modules_multiformats_vendor_varint_read; + +var car_node_modules_multiformats_vendor_varint_MSB$1 = 0x80 + , car_node_modules_multiformats_vendor_varint_REST$1 = 0x7F; + +function car_node_modules_multiformats_vendor_varint_read(buf, offset) { + var res = 0 + , offset = offset || 0 + , shift = 0 + , counter = offset + , b + , l = buf.length; + + do { + if (counter >= l) { + car_node_modules_multiformats_vendor_varint_read.bytes = 0; + throw new RangeError('Could not decode varint') } - return out; + b = buf[counter++]; + res += shift < 28 + ? (b & car_node_modules_multiformats_vendor_varint_REST$1) << shift + : (b & car_node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= car_node_modules_multiformats_vendor_varint_MSB$1) + + car_node_modules_multiformats_vendor_varint_read.bytes = counter - offset; + + return res } + +var car_node_modules_multiformats_vendor_varint_N1 = Math.pow(2, 7); +var car_node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14); +var car_node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21); +var car_node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28); +var car_node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35); +var car_node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42); +var car_node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49); +var car_node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56); +var car_node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63); + +var car_node_modules_multiformats_vendor_varint_length = function (value) { + return ( + value < car_node_modules_multiformats_vendor_varint_N1 ? 1 + : value < car_node_modules_multiformats_vendor_varint_N2 ? 2 + : value < car_node_modules_multiformats_vendor_varint_N3 ? 3 + : value < car_node_modules_multiformats_vendor_varint_N4 ? 4 + : value < car_node_modules_multiformats_vendor_varint_N5 ? 5 + : value < car_node_modules_multiformats_vendor_varint_N6 ? 6 + : value < car_node_modules_multiformats_vendor_varint_N7 ? 7 + : value < car_node_modules_multiformats_vendor_varint_N8 ? 8 + : value < car_node_modules_multiformats_vendor_varint_N9 ? 9 + : 10 + ) +}; + +var car_node_modules_multiformats_vendor_varint_varint = { + encode: car_node_modules_multiformats_vendor_varint_encode_1 + , decode: car_node_modules_multiformats_vendor_varint_decode + , encodingLength: car_node_modules_multiformats_vendor_varint_length +}; + +var car_node_modules_multiformats_vendor_varint_brrp_varint = car_node_modules_multiformats_vendor_varint_varint; + +/* harmony default export */ const car_node_modules_multiformats_vendor_varint = (car_node_modules_multiformats_vendor_varint_brrp_varint); + +;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/src/varint.js + + /** - * RFC4648 Factory + * @param {Uint8Array} data + * @param {number} [offset=0] + * @returns {[number, number]} */ -function multiformats_dist_src_bases_base_rfc4648({ name, prefix, bitsPerChar, alphabet }) { - return multiformats_dist_src_bases_base_from({ - prefix, - name, - encode(input) { - return multiformats_dist_src_bases_base_encode(input, alphabet, bitsPerChar); - }, - decode(input) { - return multiformats_dist_src_bases_base_decode(input, alphabet, bitsPerChar, name); - } - }); +const car_node_modules_multiformats_src_varint_decode = (data, offset = 0) => { + const code = car_node_modules_multiformats_vendor_varint.decode(data, offset) + return [code, car_node_modules_multiformats_vendor_varint.decode.bytes] } -//# sourceMappingURL=base.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base32.js - -const multiformats_dist_src_bases_base32_base32 = multiformats_dist_src_bases_base_rfc4648({ - prefix: 'b', - name: 'base32', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567', - bitsPerChar: 5 -}); -const multiformats_dist_src_bases_base32_base32upper = multiformats_dist_src_bases_base_rfc4648({ - prefix: 'B', - name: 'base32upper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', - bitsPerChar: 5 -}); -const multiformats_dist_src_bases_base32_base32pad = multiformats_dist_src_bases_base_rfc4648({ - prefix: 'c', - name: 'base32pad', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', - bitsPerChar: 5 -}); -const multiformats_dist_src_bases_base32_base32padupper = multiformats_dist_src_bases_base_rfc4648({ - prefix: 'C', - name: 'base32padupper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', - bitsPerChar: 5 -}); -const multiformats_dist_src_bases_base32_base32hex = multiformats_dist_src_bases_base_rfc4648({ - prefix: 'v', - name: 'base32hex', - alphabet: '0123456789abcdefghijklmnopqrstuv', - bitsPerChar: 5 -}); -const multiformats_dist_src_bases_base32_base32hexupper = multiformats_dist_src_bases_base_rfc4648({ - prefix: 'V', - name: 'base32hexupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', - bitsPerChar: 5 -}); -const multiformats_dist_src_bases_base32_base32hexpad = multiformats_dist_src_bases_base_rfc4648({ - prefix: 't', - name: 'base32hexpad', - alphabet: '0123456789abcdefghijklmnopqrstuv=', - bitsPerChar: 5 -}); -const multiformats_dist_src_bases_base32_base32hexpadupper = multiformats_dist_src_bases_base_rfc4648({ - prefix: 'T', - name: 'base32hexpadupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', - bitsPerChar: 5 -}); -const multiformats_dist_src_bases_base32_base32z = multiformats_dist_src_bases_base_rfc4648({ - prefix: 'h', - name: 'base32z', - alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', - bitsPerChar: 5 -}); -//# sourceMappingURL=base32.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base58.js -const multiformats_dist_src_bases_base58_base58btc = multiformats_dist_src_bases_base_baseX({ - name: 'base58btc', - prefix: 'z', - alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -}); -const multiformats_dist_src_bases_base58_base58flickr = multiformats_dist_src_bases_base_baseX({ - name: 'base58flickr', - prefix: 'Z', - alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -}); -//# sourceMappingURL=base58.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/vendor/varint.js -/* eslint-disable */ -var dist_src_vendor_varint_encode_1 = multiformats_dist_src_vendor_varint_encode; -var dist_src_vendor_varint_MSB = 0x80, dist_src_vendor_varint_REST = 0x7F, dist_src_vendor_varint_MSBALL = ~dist_src_vendor_varint_REST, dist_src_vendor_varint_INT = Math.pow(2, 31); /** - * @param {number} num - * @param {number[]} out - * @param {number} offset + * @param {number} int + * @param {Uint8Array} target + * @param {number} [offset=0] */ -function multiformats_dist_src_vendor_varint_encode(num, out, offset) { - out = out || []; - offset = offset || 0; - var oldOffset = offset; - while (num >= dist_src_vendor_varint_INT) { - out[offset++] = (num & 0xFF) | dist_src_vendor_varint_MSB; - num /= 128; - } - while (num & dist_src_vendor_varint_MSBALL) { - out[offset++] = (num & 0xFF) | dist_src_vendor_varint_MSB; - num >>>= 7; - } - out[offset] = num | 0; - // @ts-ignore - multiformats_dist_src_vendor_varint_encode.bytes = offset - oldOffset + 1; - return out; +const car_node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => { + car_node_modules_multiformats_vendor_varint.encode(int, target, offset) + return target } -var multiformats_dist_src_vendor_varint_decode = dist_src_vendor_varint_read; -var dist_src_vendor_varint_MSB$1 = 0x80, dist_src_vendor_varint_REST$1 = 0x7F; + /** - * @param {string | any[]} buf - * @param {number} offset + * @param {number} int + * @returns {number} */ -function dist_src_vendor_varint_read(buf, offset) { - var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length; - do { - if (counter >= l) { - // @ts-ignore - dist_src_vendor_varint_read.bytes = 0; - throw new RangeError('Could not decode varint'); - } - b = buf[counter++]; - res += shift < 28 - ? (b & dist_src_vendor_varint_REST$1) << shift - : (b & dist_src_vendor_varint_REST$1) * Math.pow(2, shift); - shift += 7; - } while (b >= dist_src_vendor_varint_MSB$1); - // @ts-ignore - dist_src_vendor_varint_read.bytes = counter - offset; - return res; +const car_node_modules_multiformats_src_varint_encodingLength = (int) => { + return car_node_modules_multiformats_vendor_varint.encodingLength(int) } -var dist_src_vendor_varint_N1 = Math.pow(2, 7); -var dist_src_vendor_varint_N2 = Math.pow(2, 14); -var dist_src_vendor_varint_N3 = Math.pow(2, 21); -var dist_src_vendor_varint_N4 = Math.pow(2, 28); -var dist_src_vendor_varint_N5 = Math.pow(2, 35); -var dist_src_vendor_varint_N6 = Math.pow(2, 42); -var dist_src_vendor_varint_N7 = Math.pow(2, 49); -var dist_src_vendor_varint_N8 = Math.pow(2, 56); -var dist_src_vendor_varint_N9 = Math.pow(2, 63); -var multiformats_dist_src_vendor_varint_length = function (/** @type {number} */ value) { - return (value < dist_src_vendor_varint_N1 ? 1 - : value < dist_src_vendor_varint_N2 ? 2 - : value < dist_src_vendor_varint_N3 ? 3 - : value < dist_src_vendor_varint_N4 ? 4 - : value < dist_src_vendor_varint_N5 ? 5 - : value < dist_src_vendor_varint_N6 ? 6 - : value < dist_src_vendor_varint_N7 ? 7 - : value < dist_src_vendor_varint_N8 ? 8 - : value < dist_src_vendor_varint_N9 ? 9 - : 10); -}; -var multiformats_dist_src_vendor_varint_varint = { - encode: dist_src_vendor_varint_encode_1, - decode: multiformats_dist_src_vendor_varint_decode, - encodingLength: multiformats_dist_src_vendor_varint_length -}; -var dist_src_vendor_varint_brrp_varint = multiformats_dist_src_vendor_varint_varint; -/* harmony default export */ const node_modules_multiformats_dist_src_vendor_varint = (dist_src_vendor_varint_brrp_varint); -//# sourceMappingURL=varint.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/varint.js -function ipfs_unixfs_importer_node_modules_multiformats_dist_src_varint_decode(data, offset = 0) { - const code = node_modules_multiformats_dist_src_vendor_varint.decode(data, offset); - return [code, node_modules_multiformats_dist_src_vendor_varint.decode.bytes]; -} -function multiformats_dist_src_varint_encodeTo(int, target, offset = 0) { - node_modules_multiformats_dist_src_vendor_varint.encode(int, target, offset); - return target; -} -function multiformats_dist_src_varint_encodingLength(int) { - return node_modules_multiformats_dist_src_vendor_varint.encodingLength(int); -} -//# sourceMappingURL=varint.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/hashes/digest.js +;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/src/hashes/digest.js + /** * Creates a multihash digest. + * + * @template {number} Code + * @param {Code} code + * @param {Uint8Array} digest */ -function multiformats_dist_src_hashes_digest_create(code, digest) { - const size = digest.byteLength; - const sizeOffset = multiformats_dist_src_varint_encodingLength(code); - const digestOffset = sizeOffset + multiformats_dist_src_varint_encodingLength(size); - const bytes = new Uint8Array(digestOffset + size); - multiformats_dist_src_varint_encodeTo(code, bytes, 0); - multiformats_dist_src_varint_encodeTo(size, bytes, sizeOffset); - bytes.set(digest, digestOffset); - return new multiformats_dist_src_hashes_digest_Digest(code, size, digest, bytes); +const car_node_modules_multiformats_src_hashes_digest_create = (code, digest) => { + const size = digest.byteLength + const sizeOffset = car_node_modules_multiformats_src_varint_encodingLength(code) + const digestOffset = sizeOffset + car_node_modules_multiformats_src_varint_encodingLength(size) + + const bytes = new Uint8Array(digestOffset + size) + car_node_modules_multiformats_src_varint_encodeTo(code, bytes, 0) + car_node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset) + bytes.set(digest, digestOffset) + + return new car_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) } + /** * Turns bytes representation of multihash digest into an instance. + * + * @param {Uint8Array} multihash + * @returns {MultihashDigest} */ -function multiformats_dist_src_hashes_digest_decode(multihash) { - const bytes = node_modules_multiformats_dist_src_bytes_coerce(multihash); - const [code, sizeOffset] = ipfs_unixfs_importer_node_modules_multiformats_dist_src_varint_decode(bytes); - const [size, digestOffset] = ipfs_unixfs_importer_node_modules_multiformats_dist_src_varint_decode(bytes.subarray(sizeOffset)); - const digest = bytes.subarray(sizeOffset + digestOffset); - if (digest.byteLength !== size) { - throw new Error('Incorrect length'); - } - return new multiformats_dist_src_hashes_digest_Digest(code, size, digest, bytes); +const car_node_modules_multiformats_src_hashes_digest_decode = (multihash) => { + const bytes = car_node_modules_multiformats_src_bytes_coerce(multihash) + const [code, sizeOffset] = car_node_modules_multiformats_src_varint_decode(bytes) + const [size, digestOffset] = car_node_modules_multiformats_src_varint_decode(bytes.subarray(sizeOffset)) + const digest = bytes.subarray(sizeOffset + digestOffset) + + if (digest.byteLength !== size) { + throw new Error('Incorrect length') + } + + return new car_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) } -function multiformats_dist_src_hashes_digest_equals(a, b) { - if (a === b) { - return true; - } - else { - const data = b; - return (a.code === data.code && - a.size === data.size && - data.bytes instanceof Uint8Array && - multiformats_dist_src_bytes_equals(a.bytes, data.bytes)); - } + +/** + * @param {MultihashDigest} a + * @param {unknown} b + * @returns {b is MultihashDigest} + */ +const car_node_modules_multiformats_src_hashes_digest_equals = (a, b) => { + if (a === b) { + return true + } else { + const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) + + return ( + a.code === data.code && + a.size === data.size && + data.bytes instanceof Uint8Array && + car_node_modules_multiformats_src_bytes_equals(a.bytes, data.bytes) + ) + } } + +/** + * @typedef {import('./interface.js').MultihashDigest} MultihashDigest + */ + /** * Represents a multihash digest which carries information about the * hashing algorithm and an actual hash digest. + * + * @template {number} Code + * @template {number} Size + * @class + * @implements {MultihashDigest} */ -class multiformats_dist_src_hashes_digest_Digest { - code; - size; - digest; - bytes; - /** - * Creates a multihash digest. - */ - constructor(code, size, digest, bytes) { - this.code = code; - this.size = size; - this.digest = digest; - this.bytes = bytes; - } +class car_node_modules_multiformats_src_hashes_digest_Digest { + /** + * Creates a multihash digest. + * + * @param {Code} code + * @param {Size} size + * @param {Uint8Array} digest + * @param {Uint8Array} bytes + */ + constructor (code, size, digest, bytes) { + this.code = code + this.size = size + this.digest = digest + this.bytes = bytes + } } -//# sourceMappingURL=digest.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/cid.js + +;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/src/cid.js + + +// Linter can see that API is used in types. +// eslint-disable-next-line // This way TS will also expose all the types from module -function multiformats_dist_src_cid_format(link, base) { - const { bytes, version } = link; - switch (version) { - case 0: - return multiformats_dist_src_cid_toStringV0(bytes, multiformats_dist_src_cid_baseCache(link), base ?? multiformats_dist_src_bases_base58_base58btc.encoder); - default: - return multiformats_dist_src_cid_toStringV1(bytes, multiformats_dist_src_cid_baseCache(link), (base ?? multiformats_dist_src_bases_base32_base32.encoder)); - } -} -function multiformats_dist_src_cid_toJSON(link) { - return { - '/': multiformats_dist_src_cid_format(link) - }; -} -function multiformats_dist_src_cid_fromJSON(json) { - return node_modules_multiformats_dist_src_cid_CID.parse(json['/']); + +/** + * @template {API.Link} T + * @template {string} Prefix + * @param {T} link + * @param {API.MultibaseEncoder} [base] + * @returns {API.ToString} + */ +const car_node_modules_multiformats_src_cid_format = (link, base) => { + const { bytes, version } = link + switch (version) { + case 0: + return car_node_modules_multiformats_src_cid_toStringV0( + bytes, + car_node_modules_multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder<"z">} */ (base) || car_node_modules_multiformats_src_bases_base58_base58btc.encoder + ) + default: + return car_node_modules_multiformats_src_cid_toStringV1( + bytes, + car_node_modules_multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder} */ (base || car_node_modules_multiformats_src_bases_base32_base32.encoder) + ) + } } -const multiformats_dist_src_cid_cache = new WeakMap(); -function multiformats_dist_src_cid_baseCache(cid) { - const baseCache = multiformats_dist_src_cid_cache.get(cid); - if (baseCache == null) { - const baseCache = new Map(); - multiformats_dist_src_cid_cache.set(cid, baseCache); - return baseCache; - } - return baseCache; + +/** + * @template {API.UnknownLink} Link + * @param {Link} link + * @returns {API.LinkJSON} + */ +const car_node_modules_multiformats_src_cid_toJSON = (link) => ({ + '/': car_node_modules_multiformats_src_cid_format(link) +}) + +/** + * @template {API.UnknownLink} Link + * @param {API.LinkJSON} json + */ +const car_node_modules_multiformats_src_cid_fromJSON = (json) => + car_node_modules_multiformats_src_cid_CID.parse(json['/']) + +/** @type {WeakMap>} */ +const car_node_modules_multiformats_src_cid_cache = new WeakMap() + +/** + * @param {API.UnknownLink} cid + * @returns {Map} + */ +const car_node_modules_multiformats_src_cid_baseCache = cid => { + const baseCache = car_node_modules_multiformats_src_cid_cache.get(cid) + if (baseCache == null) { + const baseCache = new Map() + car_node_modules_multiformats_src_cid_cache.set(cid, baseCache) + return baseCache + } + return baseCache } -class node_modules_multiformats_dist_src_cid_CID { - code; - version; - multihash; - bytes; - '/'; - /** - * @param version - Version of the CID - * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param multihash - (Multi)hash of the of the content. - */ - constructor(version, code, multihash, bytes) { - this.code = code; - this.version = version; - this.multihash = multihash; - this.bytes = bytes; - // flag to serializers that this is a CID and - // should be treated specially - this['/'] = bytes; - } - /** - * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` - * please either use `CID.asCID(cid)` or switch to new signalling mechanism - * - * @deprecated - */ - get asCID() { - return this; - } - // ArrayBufferView - get byteOffset() { - return this.bytes.byteOffset; - } - // ArrayBufferView - get byteLength() { - return this.bytes.byteLength; - } - toV0() { - switch (this.version) { - case 0: { - return this; - } - case 1: { - const { code, multihash } = this; - if (code !== multiformats_dist_src_cid_DAG_PB_CODE) { - throw new Error('Cannot convert a non dag-pb CID to CIDv0'); - } - // sha2-256 - if (multihash.code !== multiformats_dist_src_cid_SHA_256_CODE) { - throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0'); - } - return (node_modules_multiformats_dist_src_cid_CID.createV0(multihash)); - } - default: { - throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`); - } - } - } - toV1() { - switch (this.version) { - case 0: { - const { code, digest } = this.multihash; - const multihash = multiformats_dist_src_hashes_digest_create(code, digest); - return (node_modules_multiformats_dist_src_cid_CID.createV1(this.code, multihash)); - } - case 1: { - return this; - } - default: { - throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`); - } - } - } - equals(other) { - return node_modules_multiformats_dist_src_cid_CID.equals(this, other); - } - static equals(self, other) { - const unknown = other; - return (unknown != null && - self.code === unknown.code && - self.version === unknown.version && - multiformats_dist_src_hashes_digest_equals(self.multihash, unknown.multihash)); - } - toString(base) { - return multiformats_dist_src_cid_format(this, base); - } - toJSON() { - return { '/': multiformats_dist_src_cid_format(this) }; - } - link() { - return this; - } - [Symbol.toStringTag] = 'CID'; - // Legacy - [Symbol.for('nodejs.util.inspect.custom')]() { - return `CID(${this.toString()})`; - } - /** - * Takes any input `value` and returns a `CID` instance if it was - * a `CID` otherwise returns `null`. If `value` is instanceof `CID` - * it will return value back. If `value` is not instance of this CID - * class, but is compatible CID it will return new instance of this - * `CID` class. Otherwise returns null. - * - * This allows two different incompatible versions of CID library to - * co-exist and interop as long as binary interface is compatible. - */ - static asCID(input) { - if (input == null) { - return null; - } - const value = input; - if (value instanceof node_modules_multiformats_dist_src_cid_CID) { - // If value is instance of CID then we're all set. - return value; - } - else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { - // If value isn't instance of this CID class but `this.asCID === this` or - // `value['/'] === value.bytes` is true it is CID instance coming from a - // different implementation (diff version or duplicate). In that case we - // rebase it to this `CID` implementation so caller is guaranteed to get - // instance with expected API. - const { version, code, multihash, bytes } = value; - return new node_modules_multiformats_dist_src_cid_CID(version, code, multihash, bytes ?? multiformats_dist_src_cid_encodeCID(version, code, multihash.bytes)); - } - else if (value[multiformats_dist_src_cid_cidSymbol] === true) { - // If value is a CID from older implementation that used to be tagged via - // symbol we still rebase it to the this `CID` implementation by - // delegating that to a constructor. - const { version, multihash, code } = value; - const digest = multiformats_dist_src_hashes_digest_decode(multihash); - return node_modules_multiformats_dist_src_cid_CID.create(version, code, digest); - } - else { - // Otherwise value is not a CID (or an incompatible version of it) in - // which case we return `null`. - return null; - } - } - /** - * @param version - Version of the CID - * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param digest - (Multi)hash of the of the content. - */ - static create(version, code, digest) { - if (typeof code !== 'number') { - throw new Error('String codecs are no longer supported'); - } - if (!(digest.bytes instanceof Uint8Array)) { - throw new Error('Invalid digest'); + +/** + * @template {unknown} [Data=unknown] + * @template {number} [Format=number] + * @template {number} [Alg=number] + * @template {API.Version} [Version=API.Version] + * @implements {API.Link} + */ + +class car_node_modules_multiformats_src_cid_CID { + /** + * @param {Version} version - Version of the CID + * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content. + * @param {Uint8Array} bytes + */ + constructor (version, code, multihash, bytes) { + /** @readonly */ + this.code = code + /** @readonly */ + this.version = version + /** @readonly */ + this.multihash = multihash + /** @readonly */ + this.bytes = bytes + + // flag to serializers that this is a CID and + // should be treated specially + /** @readonly */ + this['/'] = bytes + } + + /** + * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` + * please either use `CID.asCID(cid)` or switch to new signalling mechanism + * + * @deprecated + */ + get asCID () { + return this + } + + // ArrayBufferView + get byteOffset () { + return this.bytes.byteOffset + } + + // ArrayBufferView + get byteLength () { + return this.bytes.byteLength + } + + /** + * @returns {CID} + */ + toV0 () { + switch (this.version) { + case 0: { + return /** @type {CID} */ (this) + } + case 1: { + const { code, multihash } = this + + if (code !== car_node_modules_multiformats_src_cid_DAG_PB_CODE) { + throw new Error('Cannot convert a non dag-pb CID to CIDv0') } - switch (version) { - case 0: { - if (code !== multiformats_dist_src_cid_DAG_PB_CODE) { - throw new Error(`Version 0 CID must use dag-pb (code: ${multiformats_dist_src_cid_DAG_PB_CODE}) block encoding`); - } - else { - return new node_modules_multiformats_dist_src_cid_CID(version, code, digest, digest.bytes); - } - } - case 1: { - const bytes = multiformats_dist_src_cid_encodeCID(version, code, digest.bytes); - return new node_modules_multiformats_dist_src_cid_CID(version, code, digest, bytes); - } - default: { - throw new Error('Invalid version'); - } + + // sha2-256 + if (multihash.code !== car_node_modules_multiformats_src_cid_SHA_256_CODE) { + throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') } + + return /** @type {CID} */ ( + car_node_modules_multiformats_src_cid_CID.createV0( + /** @type {API.MultihashDigest} */ (multihash) + ) + ) + } + default: { + throw Error( + `Can not convert CID version ${this.version} to version 0. This is a bug please report` + ) + } } - /** - * Simplified version of `create` for CIDv0. - */ - static createV0(digest) { - return node_modules_multiformats_dist_src_cid_CID.create(0, multiformats_dist_src_cid_DAG_PB_CODE, digest); - } - /** - * Simplified version of `create` for CIDv1. - * - * @param code - Content encoding format code. - * @param digest - Multihash of the content. - */ - static createV1(code, digest) { - return node_modules_multiformats_dist_src_cid_CID.create(1, code, digest); + } + + /** + * @returns {CID} + */ + toV1 () { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash + const multihash = car_node_modules_multiformats_src_hashes_digest_create(code, digest) + return /** @type {CID} */ ( + car_node_modules_multiformats_src_cid_CID.createV1(this.code, multihash) + ) + } + case 1: { + return /** @type {CID} */ (this) + } + default: { + throw Error( + `Can not convert CID version ${this.version} to version 1. This is a bug please report` + ) + } } - /** - * Decoded a CID from its binary representation. The byte array must contain - * only the CID with no additional bytes. - * - * An error will be thrown if the bytes provided do not contain a valid - * binary representation of a CID. - */ - static decode(bytes) { - const [cid, remainder] = node_modules_multiformats_dist_src_cid_CID.decodeFirst(bytes); - if (remainder.length !== 0) { - throw new Error('Incorrect length'); - } - return cid; + } + + /** + * @param {unknown} other + * @returns {other is CID} + */ + equals (other) { + return car_node_modules_multiformats_src_cid_CID.equals(this, other) + } + + /** + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @param {API.Link} self + * @param {unknown} other + * @returns {other is CID} + */ + static equals (self, other) { + const unknown = + /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ ( + other + ) + return ( + unknown && + self.code === unknown.code && + self.version === unknown.version && + car_node_modules_multiformats_src_hashes_digest_equals(self.multihash, unknown.multihash) + ) + } + + /** + * @param {API.MultibaseEncoder} [base] + * @returns {string} + */ + toString (base) { + return car_node_modules_multiformats_src_cid_format(this, base) + } + + /** + * @returns {API.LinkJSON} + */ + toJSON () { + return { '/': car_node_modules_multiformats_src_cid_format(this) } + } + + link () { + return this + } + + get [Symbol.toStringTag] () { + return 'CID' + } + + // Legacy + + [Symbol.for('nodejs.util.inspect.custom')] () { + return `CID(${this.toString()})` + } + + /** + * Takes any input `value` and returns a `CID` instance if it was + * a `CID` otherwise returns `null`. If `value` is instanceof `CID` + * it will return value back. If `value` is not instance of this CID + * class, but is compatible CID it will return new instance of this + * `CID` class. Otherwise returns null. + * + * This allows two different incompatible versions of CID library to + * co-exist and interop as long as binary interface is compatible. + * + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @template {unknown} U + * @param {API.Link|U} input + * @returns {CID|null} + */ + static asCID (input) { + if (input == null) { + return null } - /** - * Decoded a CID from its binary representation at the beginning of a byte - * array. - * - * Returns an array with the first element containing the CID and the second - * element containing the remainder of the original byte array. The remainder - * will be a zero-length byte array if the provided bytes only contained a - * binary CID representation. - */ - static decodeFirst(bytes) { - const specs = node_modules_multiformats_dist_src_cid_CID.inspectBytes(bytes); - const prefixSize = specs.size - specs.multihashSize; - const multihashBytes = node_modules_multiformats_dist_src_bytes_coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize)); - if (multihashBytes.byteLength !== specs.multihashSize) { - throw new Error('Incorrect length'); - } - const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize); - const digest = new multiformats_dist_src_hashes_digest_Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); - const cid = specs.version === 0 - ? node_modules_multiformats_dist_src_cid_CID.createV0(digest) - : node_modules_multiformats_dist_src_cid_CID.createV1(specs.codec, digest); - return [cid, bytes.subarray(specs.size)]; + + const value = /** @type {any} */ (input) + if (value instanceof car_node_modules_multiformats_src_cid_CID) { + // If value is instance of CID then we're all set. + return value + } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { + // If value isn't instance of this CID class but `this.asCID === this` or + // `value['/'] === value.bytes` is true it is CID instance coming from a + // different implementation (diff version or duplicate). In that case we + // rebase it to this `CID` implementation so caller is guaranteed to get + // instance with expected API. + const { version, code, multihash, bytes } = value + return new car_node_modules_multiformats_src_cid_CID( + version, + code, + /** @type {API.MultihashDigest} */ (multihash), + bytes || car_node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes) + ) + } else if (value[car_node_modules_multiformats_src_cid_cidSymbol] === true) { + // If value is a CID from older implementation that used to be tagged via + // symbol we still rebase it to the this `CID` implementation by + // delegating that to a constructor. + const { version, multihash, code } = value + const digest = + /** @type {API.MultihashDigest} */ + (car_node_modules_multiformats_src_hashes_digest_decode(multihash)) + return car_node_modules_multiformats_src_cid_CID.create(version, code, digest) + } else { + // Otherwise value is not a CID (or an incompatible version of it) in + // which case we return `null`. + return null } - /** - * Inspect the initial bytes of a CID to determine its properties. - * - * Involves decoding up to 4 varints. Typically this will require only 4 to 6 - * bytes but for larger multicodec code values and larger multihash digest - * lengths these varints can be quite large. It is recommended that at least - * 10 bytes be made available in the `initialBytes` argument for a complete - * inspection. - */ - static inspectBytes(initialBytes) { - let offset = 0; - const next = () => { - const [i, length] = ipfs_unixfs_importer_node_modules_multiformats_dist_src_varint_decode(initialBytes.subarray(offset)); - offset += length; - return i; - }; - let version = next(); - let codec = multiformats_dist_src_cid_DAG_PB_CODE; - if (version === 18) { - // CIDv0 - version = 0; - offset = 0; - } - else { - codec = next(); - } - if (version !== 0 && version !== 1) { - throw new RangeError(`Invalid CID version ${version}`); - } - const prefixSize = offset; - const multihashCode = next(); // multihash code - const digestSize = next(); // multihash length - const size = offset + digestSize; - const multihashSize = size - prefixSize; - return { version, codec, multihashCode, digestSize, multihashSize, size }; + } + + /** + * + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @param {Version} version - Version of the CID + * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param {API.MultihashDigest} digest - (Multi)hash of the of the content. + * @returns {CID} + */ + static create (version, code, digest) { + if (typeof code !== 'number') { + throw new Error('String codecs are no longer supported') } - /** - * Takes cid in a string representation and creates an instance. If `base` - * decoder is not provided will use a default from the configuration. It will - * throw an error if encoding of the CID is not compatible with supplied (or - * a default decoder). - */ - static parse(source, base) { - const [prefix, bytes] = multiformats_dist_src_cid_parseCIDtoBytes(source, base); - const cid = node_modules_multiformats_dist_src_cid_CID.decode(bytes); - if (cid.version === 0 && source[0] !== 'Q') { - throw Error('Version 0 CID string must not include multibase prefix'); - } - // Cache string representation to avoid computing it on `this.toString()` - multiformats_dist_src_cid_baseCache(cid).set(prefix, source); - return cid; + + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error('Invalid digest') } -} -function multiformats_dist_src_cid_parseCIDtoBytes(source, base) { - switch (source[0]) { - // CIDv0 is parsed differently - case 'Q': { - const decoder = base ?? multiformats_dist_src_bases_base58_base58btc; - return [ - multiformats_dist_src_bases_base58_base58btc.prefix, - decoder.decode(`${multiformats_dist_src_bases_base58_base58btc.prefix}${source}`) - ]; - } - case multiformats_dist_src_bases_base58_base58btc.prefix: { - const decoder = base ?? multiformats_dist_src_bases_base58_base58btc; - return [multiformats_dist_src_bases_base58_base58btc.prefix, decoder.decode(source)]; - } - case multiformats_dist_src_bases_base32_base32.prefix: { - const decoder = base ?? multiformats_dist_src_bases_base32_base32; - return [multiformats_dist_src_bases_base32_base32.prefix, decoder.decode(source)]; - } - default: { - if (base == null) { - throw Error('To parse non base32 or base58btc encoded CID multibase decoder must be provided'); - } - return [source[0], base.decode(source)]; + + switch (version) { + case 0: { + if (code !== car_node_modules_multiformats_src_cid_DAG_PB_CODE) { + throw new Error( + `Version 0 CID must use dag-pb (code: ${car_node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding` + ) + } else { + return new car_node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes) } + } + case 1: { + const bytes = car_node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes) + return new car_node_modules_multiformats_src_cid_CID(version, code, digest, bytes) + } + default: { + throw new Error('Invalid version') + } } -} -function multiformats_dist_src_cid_toStringV0(bytes, cache, base) { - const { prefix } = base; - if (prefix !== multiformats_dist_src_bases_base58_base58btc.prefix) { - throw Error(`Cannot string encode V0 in ${base.name} encoding`); + } + + /** + * Simplified version of `create` for CIDv0. + * + * @template {unknown} [T=unknown] + * @param {API.MultihashDigest} digest - Multihash. + * @returns {CID} + */ + static createV0 (digest) { + return car_node_modules_multiformats_src_cid_CID.create(0, car_node_modules_multiformats_src_cid_DAG_PB_CODE, digest) + } + + /** + * Simplified version of `create` for CIDv1. + * + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @param {Code} code - Content encoding format code. + * @param {API.MultihashDigest} digest - Miltihash of the content. + * @returns {CID} + */ + static createV1 (code, digest) { + return car_node_modules_multiformats_src_cid_CID.create(1, code, digest) + } + + /** + * Decoded a CID from its binary representation. The byte array must contain + * only the CID with no additional bytes. + * + * An error will be thrown if the bytes provided do not contain a valid + * binary representation of a CID. + * + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ByteView>} bytes + * @returns {CID} + */ + static decode (bytes) { + const [cid, remainder] = car_node_modules_multiformats_src_cid_CID.decodeFirst(bytes) + if (remainder.length) { + throw new Error('Incorrect length') } - const cid = cache.get(prefix); - if (cid == null) { - const cid = base.encode(bytes).slice(1); - cache.set(prefix, cid); - return cid; + return cid + } + + /** + * Decoded a CID from its binary representation at the beginning of a byte + * array. + * + * Returns an array with the first element containing the CID and the second + * element containing the remainder of the original byte array. The remainder + * will be a zero-length byte array if the provided bytes only contained a + * binary CID representation. + * + * @template {unknown} T + * @template {number} C + * @template {number} A + * @template {API.Version} V + * @param {API.ByteView>} bytes + * @returns {[CID, Uint8Array]} + */ + static decodeFirst (bytes) { + const specs = car_node_modules_multiformats_src_cid_CID.inspectBytes(bytes) + const prefixSize = specs.size - specs.multihashSize + const multihashBytes = car_node_modules_multiformats_src_bytes_coerce( + bytes.subarray(prefixSize, prefixSize + specs.multihashSize) + ) + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error('Incorrect length') } - else { - return cid; + const digestBytes = multihashBytes.subarray( + specs.multihashSize - specs.digestSize + ) + const digest = new car_node_modules_multiformats_src_hashes_digest_Digest( + specs.multihashCode, + specs.digestSize, + digestBytes, + multihashBytes + ) + const cid = + specs.version === 0 + ? car_node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) + : car_node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest) + return [/** @type {CID} */(cid), bytes.subarray(specs.size)] + } + + /** + * Inspect the initial bytes of a CID to determine its properties. + * + * Involves decoding up to 4 varints. Typically this will require only 4 to 6 + * bytes but for larger multicodec code values and larger multihash digest + * lengths these varints can be quite large. It is recommended that at least + * 10 bytes be made available in the `initialBytes` argument for a complete + * inspection. + * + * @template {unknown} T + * @template {number} C + * @template {number} A + * @template {API.Version} V + * @param {API.ByteView>} initialBytes + * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }} + */ + static inspectBytes (initialBytes) { + let offset = 0 + const next = () => { + const [i, length] = car_node_modules_multiformats_src_varint_decode(initialBytes.subarray(offset)) + offset += length + return i } -} -function multiformats_dist_src_cid_toStringV1(bytes, cache, base) { - const { prefix } = base; - const cid = cache.get(prefix); - if (cid == null) { - const cid = base.encode(bytes); - cache.set(prefix, cid); - return cid; + + let version = /** @type {V} */ (next()) + let codec = /** @type {C} */ (car_node_modules_multiformats_src_cid_DAG_PB_CODE) + if (/** @type {number} */(version) === 18) { + // CIDv0 + version = /** @type {V} */ (0) + offset = 0 + } else { + codec = /** @type {C} */ (next()) } - else { - return cid; + + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`) } -} -const multiformats_dist_src_cid_DAG_PB_CODE = 0x70; -const multiformats_dist_src_cid_SHA_256_CODE = 0x12; -function multiformats_dist_src_cid_encodeCID(version, code, multihash) { - const codeOffset = multiformats_dist_src_varint_encodingLength(version); - const hashOffset = codeOffset + multiformats_dist_src_varint_encodingLength(code); - const bytes = new Uint8Array(hashOffset + multihash.byteLength); - multiformats_dist_src_varint_encodeTo(version, bytes, 0); - multiformats_dist_src_varint_encodeTo(code, bytes, codeOffset); - bytes.set(multihash, hashOffset); - return bytes; -} -const multiformats_dist_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID'); -//# sourceMappingURL=cid.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/hashes/hasher.js -function dist_src_hashes_hasher_from({ name, code, encode }) { - return new dist_src_hashes_hasher_Hasher(name, code, encode); + const prefixSize = offset + const multihashCode = /** @type {A} */ (next()) // multihash code + const digestSize = next() // multihash length + const size = offset + digestSize + const multihashSize = size - prefixSize + + return { version, codec, multihashCode, digestSize, multihashSize, size } + } + + /** + * Takes cid in a string representation and creates an instance. If `base` + * decoder is not provided will use a default from the configuration. It will + * throw an error if encoding of the CID is not compatible with supplied (or + * a default decoder). + * + * @template {string} Prefix + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ToString, Prefix>} source + * @param {API.MultibaseDecoder} [base] + * @returns {CID} + */ + static parse (source, base) { + const [prefix, bytes] = car_node_modules_multiformats_src_cid_parseCIDtoBytes(source, base) + + const cid = car_node_modules_multiformats_src_cid_CID.decode(bytes) + + if (cid.version === 0 && source[0] !== 'Q') { + throw Error('Version 0 CID string must not include multibase prefix') + } + + // Cache string representation to avoid computing it on `this.toString()` + car_node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source) + + return cid + } } + /** - * Hasher represents a hashing algorithm implementation that produces as - * `MultihashDigest`. + * @template {string} Prefix + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ToString, Prefix>} source + * @param {API.MultibaseDecoder} [base] + * @returns {[Prefix, API.ByteView>]} */ -class dist_src_hashes_hasher_Hasher { - name; - code; - encode; - constructor(name, code, encode) { - this.name = name; - this.code = code; - this.encode = encode; +const car_node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => { + switch (source[0]) { + // CIDv0 is parsed differently + case 'Q': { + const decoder = base || car_node_modules_multiformats_src_bases_base58_base58btc + return [ + /** @type {Prefix} */ (car_node_modules_multiformats_src_bases_base58_base58btc.prefix), + decoder.decode(`${car_node_modules_multiformats_src_bases_base58_base58btc.prefix}${source}`) + ] } - digest(input) { - if (input instanceof Uint8Array) { - const result = this.encode(input); - return result instanceof Uint8Array - ? multiformats_dist_src_hashes_digest_create(this.code, result) - /* c8 ignore next 1 */ - : result.then(digest => multiformats_dist_src_hashes_digest_create(this.code, digest)); - } - else { - throw Error('Unknown type, must be binary type'); - /* c8 ignore next 1 */ - } + case car_node_modules_multiformats_src_bases_base58_base58btc.prefix: { + const decoder = base || car_node_modules_multiformats_src_bases_base58_base58btc + return [/** @type {Prefix} */(car_node_modules_multiformats_src_bases_base58_base58btc.prefix), decoder.decode(source)] + } + case car_node_modules_multiformats_src_bases_base32_base32.prefix: { + const decoder = base || car_node_modules_multiformats_src_bases_base32_base32 + return [/** @type {Prefix} */(car_node_modules_multiformats_src_bases_base32_base32.prefix), decoder.decode(source)] + } + default: { + if (base == null) { + throw Error( + 'To parse non base32 or base58btc encoded CID multibase decoder must be provided' + ) + } + return [/** @type {Prefix} */(source[0]), base.decode(source)] } + } } -//# sourceMappingURL=hasher.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/hashes/sha2.js +/** + * + * @param {Uint8Array} bytes + * @param {Map} cache + * @param {API.MultibaseEncoder<'z'>} base + */ +const car_node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => { + const { prefix } = base + if (prefix !== car_node_modules_multiformats_src_bases_base58_base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base.name} encoding`) + } + const cid = cache.get(prefix) + if (cid == null) { + const cid = base.encode(bytes).slice(1) + cache.set(prefix, cid) + return cid + } else { + return cid + } +} -const dist_src_hashes_sha2_sha256 = dist_src_hashes_hasher_from({ - name: 'sha2-256', - code: 0x12, - encode: (input) => node_modules_multiformats_dist_src_bytes_coerce(external_crypto_.createHash('sha256').update(input).digest()) -}); -const dist_src_hashes_sha2_sha512 = dist_src_hashes_hasher_from({ - name: 'sha2-512', - code: 0x13, - encode: input => node_modules_multiformats_dist_src_bytes_coerce(external_crypto_.createHash('sha512').update(input).digest()) -}); -//# sourceMappingURL=sha2.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/utils/persist.js +/** + * @template {string} Prefix + * @param {Uint8Array} bytes + * @param {Map} cache + * @param {API.MultibaseEncoder} base + */ +const car_node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => { + const { prefix } = base + const cid = cache.get(prefix) + if (cid == null) { + const cid = base.encode(bytes) + cache.set(prefix, cid) + return cid + } else { + return cid + } +} +const car_node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70 +const car_node_modules_multiformats_src_cid_SHA_256_CODE = 0x12 +/** + * @param {API.Version} version + * @param {number} code + * @param {Uint8Array} multihash + * @returns {Uint8Array} + */ +const car_node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => { + const codeOffset = car_node_modules_multiformats_src_varint_encodingLength(version) + const hashOffset = codeOffset + car_node_modules_multiformats_src_varint_encodingLength(code) + const bytes = new Uint8Array(hashOffset + multihash.byteLength) + car_node_modules_multiformats_src_varint_encodeTo(version, bytes, 0) + car_node_modules_multiformats_src_varint_encodeTo(code, bytes, codeOffset) + bytes.set(multihash, hashOffset) + return bytes +} -const persist = async (buffer, blockstore, options) => { - if (options.codec == null) { - options.codec = src_namespaceObject; - } - const multihash = await dist_src_hashes_sha2_sha256.digest(buffer); - const cid = node_modules_multiformats_dist_src_cid_CID.create(options.cidVersion, options.codec.code, multihash); - await blockstore.put(cid, buffer, options); - return cid; -}; -//# sourceMappingURL=persist.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/dag-builder/buffer-importer.js +const car_node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') +;// CONCATENATED MODULE: ./node_modules/@helia/car/node_modules/multiformats/src/codecs/raw.js +// @ts-check +/** + * @template T + * @typedef {import('./interface.js').ByteView} ByteView + */ -function defaultBufferImporter(options) { - return async function* bufferImporter(file, blockstore) { - let bytesWritten = 0n; - for await (let block of file.content) { - yield async () => { - let unixfs; - const opts = { - codec: src_namespaceObject, - cidVersion: options.cidVersion, - onProgress: options.onProgress - }; - if (options.rawLeaves) { - opts.codec = dist_src_codecs_raw_namespaceObject; - opts.cidVersion = 1; - } - else { - unixfs = new src_UnixFS({ - type: options.leafType, - data: block - }); - block = src_encode({ - Data: unixfs.marshal(), - Links: [] - }); - } - const cid = await persist(block, blockstore, opts); - bytesWritten += BigInt(block.byteLength); - options.onProgress?.(new CustomProgressEvent('unixfs:importer:progress:file:write', { - bytesWritten, - cid, - path: file.path - })); - return { - cid, - unixfs, - size: BigInt(block.length), - block - }; - }; - } - }; -} -//# sourceMappingURL=buffer-importer.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/dag-builder/dir.js +const car_node_modules_multiformats_src_codecs_raw_name = 'raw' +const car_node_modules_multiformats_src_codecs_raw_code = 0x55 +/** + * @param {Uint8Array} node + * @returns {ByteView} + */ +const car_node_modules_multiformats_src_codecs_raw_encode = (node) => coerce(node) +/** + * @param {ByteView} data + * @returns {Uint8Array} + */ +const car_node_modules_multiformats_src_codecs_raw_decode = (data) => coerce(data) -const dirBuilder = async (dir, blockstore, options) => { - const unixfs = new src_UnixFS({ - type: 'directory', - mtime: dir.mtime, - mode: dir.mode - }); - const block = src_encode(prepare({ Data: unixfs.marshal() })); - const cid = await persist(block, blockstore, options); - const path = dir.path; - return { - cid, - path, - unixfs, - size: BigInt(block.length), - originalPath: dir.originalPath, - block - }; -}; -//# sourceMappingURL=dir.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/dag-builder/file.js +;// CONCATENATED MODULE: ./node_modules/@helia/car/dist/src/utils/dag-walkers.js +/* eslint max-depth: ["error", 7] */ -async function* buildFileBatch(file, blockstore, options) { - let count = -1; - let previous; - for await (const entry of parallelBatch(options.bufferImporter(file, blockstore), options.blockWriteConcurrency)) { - count++; - if (count === 0) { - // cache the first entry if case there aren't any more - previous = { - ...entry, - single: true - }; - continue; - } - else if (count === 1 && (previous != null)) { - // we have the second block of a multiple block import so yield the first - yield { - ...previous, - block: undefined, - single: undefined - }; - previous = undefined; - } - // yield the second or later block of a multiple block import - yield { - ...entry, - block: undefined - }; + +/** + * Dag walker for dag-pb CIDs + */ +const dagPbWalker = { + codec: code, + async *walk(block) { + const node = src_decode(block); + yield* node.Links.map(l => l.Hash); } - if (previous != null) { - yield previous; +}; +/** + * Dag walker for raw CIDs + */ +const rawWalker = { + codec: car_node_modules_multiformats_src_codecs_raw_code, + async *walk() { + // no embedded CIDs in a raw block } -} -function isSingleBlockImport(result) { - return result.single === true; -} -const reduce = (file, blockstore, options) => { - const reducer = async function (leaves) { - if (leaves.length === 1 && isSingleBlockImport(leaves[0]) && options.reduceSingleLeafToSelf) { - const leaf = leaves[0]; - let node = leaf.block; - if (isSingleBlockImport(leaf) && (file.mtime !== undefined || file.mode !== undefined)) { - // only one leaf node which is a raw leaf - we have metadata so convert it into a - // UnixFS entry otherwise we'll have nowhere to store the metadata - leaf.unixfs = new src_UnixFS({ - type: 'file', - mtime: file.mtime, - mode: file.mode, - data: leaf.block - }); - node = { Data: leaf.unixfs.marshal(), Links: [] }; - leaf.block = src_encode(prepare(node)); - leaf.cid = await persist(leaf.block, blockstore, { - ...options, - cidVersion: options.cidVersion - }); - leaf.size = BigInt(leaf.block.length); - } - options.onProgress?.(new CustomProgressEvent('unixfs:importer:progress:file:layout', { - cid: leaf.cid, - path: leaf.originalPath - })); - return { - cid: leaf.cid, - path: file.path, - unixfs: leaf.unixfs, - size: leaf.size, - originalPath: leaf.originalPath - }; - } - // create a parent node and add all the leaves - const f = new src_UnixFS({ - type: 'file', - mtime: file.mtime, - mode: file.mode - }); - const links = leaves - .filter(leaf => { - if (leaf.cid.code === dist_src_codecs_raw_code && leaf.size > 0) { - return true; - } - if ((leaf.unixfs != null) && (leaf.unixfs.data == null) && leaf.unixfs.fileSize() > 0n) { - return true; - } - return Boolean(leaf.unixfs?.data?.length); - }) - .map((leaf) => { - if (leaf.cid.code === dist_src_codecs_raw_code) { - // node is a leaf buffer - f.addBlockSize(leaf.size); - return { - Name: '', - Tsize: Number(leaf.size), - Hash: leaf.cid - }; - } - if ((leaf.unixfs == null) || (leaf.unixfs.data == null)) { - // node is an intermediate node - f.addBlockSize(leaf.unixfs?.fileSize() ?? 0n); - } - else { - // node is a unixfs 'file' leaf node - f.addBlockSize(BigInt(leaf.unixfs.data.length)); +}; +// https://github.com/ipfs/go-ipfs/issues/3570#issuecomment-273931692 +const dag_walkers_CID_TAG = 42; +/** + * Dag walker for dag-cbor CIDs. Does not actually use dag-cbor since + * all we are interested in is extracting the the CIDs from the block + * so we can just use cborg for that. + */ +const cborWalker = { + codec: 0x71, + async *walk(block) { + const cids = []; + const tags = []; + tags[dag_walkers_CID_TAG] = (bytes) => { + if (bytes[0] !== 0) { + throw new Error('Invalid CID for CBOR tag 42; expected leading 0x00'); } - return { - Name: '', - Tsize: Number(leaf.size), - Hash: leaf.cid - }; - }); - const node = { - Data: f.marshal(), - Links: links - }; - const block = src_encode(prepare(node)); - const cid = await persist(block, blockstore, options); - options.onProgress?.(new CustomProgressEvent('unixfs:importer:progress:file:layout', { - cid, - path: file.originalPath - })); - return { - cid, - path: file.path, - unixfs: f, - size: BigInt(block.length + node.Links.reduce((acc, curr) => acc + (curr.Tsize ?? 0), 0)), - originalPath: file.originalPath, - block + const cid = car_node_modules_multiformats_src_cid_CID.decode(bytes.subarray(1)); // ignore leading 0x00 + cids.push(cid); + return cid; }; - }; - return reducer; -}; -const fileBuilder = async (file, block, options) => { - return options.layout(buildFileBatch(file, block, options), reduce(file, block, options)); + decode_decode(block, { + tags + }); + yield* cids; + } }; -//# sourceMappingURL=file.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/dag-builder/index.js - - - - -function dag_builder_isIterable(thing) { - return Symbol.iterator in thing; -} -function dag_builder_isAsyncIterable(thing) { - return Symbol.asyncIterator in thing; -} -function contentAsAsyncIterable(content) { - try { - if (content instanceof Uint8Array) { - return (async function* () { - yield content; - }()); - } - else if (dag_builder_isIterable(content)) { - return (async function* () { - yield* content; - }()); - } - else if (dag_builder_isAsyncIterable(content)) { - return content; - } +/** + * Borrowed from @ipld/dag-json + */ +class dag_walkers_DagJsonTokenizer extends Tokenizer { + tokenBuffer; + constructor(data, options) { + super(data, options); + this.tokenBuffer = []; } - catch { - throw err_code(new Error('Content was invalid'), 'ERR_INVALID_CONTENT'); + done() { + return this.tokenBuffer.length === 0 && super.done(); } - throw err_code(new Error('Content was invalid'), 'ERR_INVALID_CONTENT'); -} -function defaultDagBuilder(options) { - return async function* dagBuilder(source, blockstore) { - for await (const entry of source) { - let originalPath; - if (entry.path != null) { - originalPath = entry.path; - entry.path = entry.path - .split('/') - .filter(path => path != null && path !== '.') - .join('/'); - } - if (isFileCandidate(entry)) { - const file = { - path: entry.path, - mtime: entry.mtime, - mode: entry.mode, - content: (async function* () { - let bytesRead = 0n; - for await (const chunk of options.chunker(options.chunkValidator(contentAsAsyncIterable(entry.content)))) { - const currentChunkSize = BigInt(chunk.byteLength); - bytesRead += currentChunkSize; - options.onProgress?.(new CustomProgressEvent('unixfs:importer:progress:file:read', { - bytesRead, - chunkSize: currentChunkSize, - path: entry.path - })); - yield chunk; + _next() { + if (this.tokenBuffer.length > 0) { + // @ts-expect-error https://github.com/Microsoft/TypeScript/issues/30406 + return this.tokenBuffer.pop(); + } + return super.next(); + } + /** + * Implements rules outlined in https://github.com/ipld/specs/pull/356 + */ + next() { + const token = this._next(); + if (token.type === token_Type.map) { + const keyToken = this._next(); + if (keyToken.type === token_Type.string && keyToken.value === '/') { + const valueToken = this._next(); + if (valueToken.type === token_Type.string) { // *must* be a CID + const breakToken = this._next(); // swallow the end-of-map token + if (breakToken.type !== token_Type["break"]) { + throw new Error('Invalid encoded CID form'); + } + this.tokenBuffer.push(valueToken); // CID.parse will pick this up after our tag token + return new token_Token(token_Type.tag, 42, 0); + } + if (valueToken.type === token_Type.map) { + const innerKeyToken = this._next(); + if (innerKeyToken.type === token_Type.string && innerKeyToken.value === 'bytes') { + const innerValueToken = this._next(); + if (innerValueToken.type === token_Type.string) { // *must* be Bytes + for (let i = 0; i < 2; i++) { + const breakToken = this._next(); // swallow two end-of-map tokens + if (breakToken.type !== token_Type["break"]) { + throw new Error('Invalid encoded Bytes form'); + } + } + const bytes = car_node_modules_multiformats_src_bases_base64_base64.decode(`m${innerValueToken.value}`); + return new token_Token(token_Type.bytes, bytes, innerValueToken.value.length); } - })(), - originalPath - }; - yield async () => fileBuilder(file, blockstore, options); - } - else if (entry.path != null) { - const dir = { - path: entry.path, - mtime: entry.mtime, - mode: entry.mode, - originalPath - }; - yield async () => dirBuilder(dir, blockstore, options); - } - else { - throw new Error('Import candidate must have content or path or both'); + this.tokenBuffer.push(innerValueToken); // bail + } + this.tokenBuffer.push(innerKeyToken); // bail + } + this.tokenBuffer.push(valueToken); // bail } + this.tokenBuffer.push(keyToken); // bail } - }; -} -function isFileCandidate(entry) { - return entry.content != null; + return token; + } } -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/uint8arrays/dist/src/util/as-uint8array.js /** - * To guarantee Uint8Array semantics, convert nodejs Buffers - * into vanilla Uint8Arrays + * Dag walker for dag-json CIDs. Does not actually use dag-json since + * all we are interested in is extracting the the CIDs from the block + * so we can just use cborg/json for that. */ -function ipfs_unixfs_importer_node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(buf) { - if (globalThis.Buffer != null) { - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); - } - return buf; -} -//# sourceMappingURL=as-uint8array.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base10.js - -const dist_src_bases_base10_base10 = multiformats_dist_src_bases_base_baseX({ - prefix: '9', - name: 'base10', - alphabet: '0123456789' -}); -//# sourceMappingURL=base10.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base16.js - -const dist_src_bases_base16_base16 = multiformats_dist_src_bases_base_rfc4648({ - prefix: 'f', - name: 'base16', - alphabet: '0123456789abcdef', - bitsPerChar: 4 -}); -const dist_src_bases_base16_base16upper = multiformats_dist_src_bases_base_rfc4648({ - prefix: 'F', - name: 'base16upper', - alphabet: '0123456789ABCDEF', - bitsPerChar: 4 -}); -//# sourceMappingURL=base16.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base2.js - -const dist_src_bases_base2_base2 = multiformats_dist_src_bases_base_rfc4648({ - prefix: '0', - name: 'base2', - alphabet: '01', - bitsPerChar: 1 -}); -//# sourceMappingURL=base2.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base256emoji.js - -const dist_src_bases_base256emoji_alphabet = Array.from('🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂'); -const dist_src_bases_base256emoji_alphabetBytesToChars = (dist_src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[i] = c; return p; }, ([]))); -const dist_src_bases_base256emoji_alphabetCharsToBytes = (dist_src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[c.codePointAt(0)] = i; return p; }, ([]))); -function dist_src_bases_base256emoji_encode(data) { - return data.reduce((p, c) => { - p += dist_src_bases_base256emoji_alphabetBytesToChars[c]; - return p; - }, ''); -} -function dist_src_bases_base256emoji_decode(str) { - const byts = []; - for (const char of str) { - const byt = dist_src_bases_base256emoji_alphabetCharsToBytes[char.codePointAt(0)]; - if (byt === undefined) { - throw new Error(`Non-base256emoji character: ${char}`); - } - byts.push(byt); +const jsonWalker = { + codec: 0x0129, + async *walk(block) { + const cids = []; + const tags = []; + tags[dag_walkers_CID_TAG] = (string) => { + const cid = car_node_modules_multiformats_src_cid_CID.parse(string); + cids.push(cid); + return cid; + }; + json_decode_decode(block, { + tags, + tokenizer: new dag_walkers_DagJsonTokenizer(block, { + tags, + allowIndefinite: true, + allowUndefined: true, + allowNaN: true, + allowInfinity: true, + allowBigInt: true, + strict: false, + rejectDuplicateMapKeys: false + }) + }); + yield* cids; } - return new Uint8Array(byts); -} -const dist_src_bases_base256emoji_base256emoji = multiformats_dist_src_bases_base_from({ - prefix: '🚀', - name: 'base256emoji', - encode: dist_src_bases_base256emoji_encode, - decode: dist_src_bases_base256emoji_decode -}); -//# sourceMappingURL=base256emoji.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base36.js +}; +//# sourceMappingURL=dag-walkers.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/car/dist/src/index.js +/** + * @packageDocumentation + * + * `@helia/car` provides `import` and `export` methods to read/write Car files to {@link https://github.com/ipfs/helia Helia}'s blockstore. + * + * See the {@link Car} interface for all available operations. + * + * By default it supports `dag-pb`, `dag-cbor`, `dag-json` and `raw` CIDs, more esoteric DAG walkers can be passed as an init option. + * + * @example + * + * ```typescript + * import { createHelia } from 'helia' + * import { unixfs } from '@helia/unixfs' + * import { car } from '@helia/car' + * import { CarWriter } from '@ipld/car' + * import { Readable } from 'node:stream' + * import nodeFs from 'node:fs' + * + * const helia = createHelia({ + * // ... helia config + * }) + * const fs = unixfs(helia) + * + * // add some UnixFS data + * const cid = await fs.addBytes(fileData1) + * + * // export it as a Car + * const c = car(helia) + * const { writer, out } = await CarWriter.create(cid) + * + * // `out` needs to be directed somewhere, see the @ipld/car docs for more information + * Readable.from(out).pipe(nodeFs.createWriteStream('example.car')) + * + * // write the DAG behind `cid` into the writer + * await c.export(cid, writer) + * ``` + * + * @example + * + * ```typescript + * import { createHelia } from 'helia' + * import { unixfs } from '@helia/unixfs' + * import { car } from '@helia/car' + * import { CarReader } from '@ipld/car' + * import { Readable } from 'node:stream' + * import nodeFs from 'node:fs' + * + * const helia = createHelia({ + * // ... helia config + * }) + * + * // import the car + * const inStream = nodeFs.createReadStream('example.car') + * const reader = await CarReader.fromIterable(inStream) + * + * await c.import(reader) + * ``` + */ -const dist_src_bases_base36_base36 = multiformats_dist_src_bases_base_baseX({ - prefix: 'k', - name: 'base36', - alphabet: '0123456789abcdefghijklmnopqrstuvwxyz' -}); -const dist_src_bases_base36_base36upper = multiformats_dist_src_bases_base_baseX({ - prefix: 'K', - name: 'base36upper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' -}); -//# sourceMappingURL=base36.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base64.js -const dist_src_bases_base64_base64 = multiformats_dist_src_bases_base_rfc4648({ - prefix: 'm', - name: 'base64', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', - bitsPerChar: 6 -}); -const dist_src_bases_base64_base64pad = multiformats_dist_src_bases_base_rfc4648({ - prefix: 'M', - name: 'base64pad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', - bitsPerChar: 6 -}); -const dist_src_bases_base64_base64url = multiformats_dist_src_bases_base_rfc4648({ - prefix: 'u', - name: 'base64url', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', - bitsPerChar: 6 -}); -const dist_src_bases_base64_base64urlpad = multiformats_dist_src_bases_base_rfc4648({ - prefix: 'U', - name: 'base64urlpad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', - bitsPerChar: 6 -}); -//# sourceMappingURL=base64.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base8.js -const dist_src_bases_base8_base8 = multiformats_dist_src_bases_base_rfc4648({ - prefix: '7', - name: 'base8', - alphabet: '01234567', - bitsPerChar: 3 -}); -//# sourceMappingURL=base8.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/identity.js -const dist_src_bases_identity_identity = multiformats_dist_src_bases_base_from({ - prefix: '\x00', - name: 'identity', - encode: (buf) => node_modules_multiformats_dist_src_bytes_toString(buf), - decode: (str) => multiformats_dist_src_bytes_fromString(str) -}); -//# sourceMappingURL=identity.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/codecs/json.js -const dist_src_codecs_json_textEncoder = new TextEncoder(); -const dist_src_codecs_json_textDecoder = new TextDecoder(); -const dist_src_codecs_json_name = 'json'; -const dist_src_codecs_json_code = 0x0200; -function dist_src_codecs_json_encode(node) { - return dist_src_codecs_json_textEncoder.encode(JSON.stringify(node)); -} -function dist_src_codecs_json_decode(data) { - return JSON.parse(dist_src_codecs_json_textDecoder.decode(data)); +const DEFAULT_DAG_WALKERS = [ + rawWalker, + dagPbWalker, + cborWalker, + jsonWalker +]; +const DAG_WALK_QUEUE_CONCURRENCY = 1; +class DefaultCar { + components; + dagWalkers; + constructor(components, init) { + this.components = components; + this.dagWalkers = {}; + [...DEFAULT_DAG_WALKERS, ...(init.dagWalkers ?? [])].forEach(dagWalker => { + this.dagWalkers[dagWalker.codec] = dagWalker; + }); + } + async import(reader, options) { + await it_drain_dist_src(this.components.blockstore.putMany(it_map_dist_src(reader.blocks(), ({ cid, bytes }) => ({ cid, block: bytes })), options)); + } + async export(root, writer, options) { + const deferred = pDefer(); + const roots = Array.isArray(root) ? root : [root]; + // use a queue to walk the DAG instead of recursion so we can traverse very large DAGs + const queue = new dist({ + concurrency: DAG_WALK_QUEUE_CONCURRENCY + }); + queue.on('idle', () => { + deferred.resolve(); + }); + queue.on('error', (err) => { + deferred.resolve(err); + }); + for (const root of roots) { + void queue.add(async () => { + await this.#walkDag(root, queue, async (cid, bytes) => { + await writer.put({ cid, bytes }); + }, options); + }); + } + // wait for the writer to end + try { + await deferred.promise; + } + finally { + await writer.close(); + } + } + /** + * Walk the DAG behind the passed CID, ensure all blocks are present in the blockstore + * and update the pin count for them + */ + async #walkDag(cid, queue, withBlock, options) { + const dagWalker = this.dagWalkers[cid.code]; + if (dagWalker == null) { + throw new Error(`No dag walker found for cid codec ${cid.code}`); + } + const block = await this.components.blockstore.get(cid, options); + await withBlock(cid, block); + // walk dag, ensure all blocks are present + for await (const cid of dagWalker.walk(block)) { + void queue.add(async () => { + await this.#walkDag(cid, queue, withBlock, options); + }); + } + } } -//# sourceMappingURL=json.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/hashes/identity.js - - -const dist_src_hashes_identity_code = 0x0; -const dist_src_hashes_identity_name = 'identity'; -const dist_src_hashes_identity_encode = node_modules_multiformats_dist_src_bytes_coerce; -function dist_src_hashes_identity_digest(input) { - return multiformats_dist_src_hashes_digest_create(dist_src_hashes_identity_code, dist_src_hashes_identity_encode(input)); +/** + * Create a {@link Car} instance for use with {@link https://github.com/ipfs/helia Helia} + */ +function car(helia, init = {}) { + return new DefaultCar(helia, init); } -const dist_src_hashes_identity_identity = { code: dist_src_hashes_identity_code, name: dist_src_hashes_identity_name, encode: dist_src_hashes_identity_encode, digest: dist_src_hashes_identity_digest }; -//# sourceMappingURL=identity.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/index.js +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/it-first/dist/src/index.js /** * @packageDocumentation * - * This library defines common interfaces and low level building blocks for various interrelated multiformat technologies (multicodec, multihash, multibase, and CID). They can be used to implement custom base encoders / decoders / codecs, codec encoders /decoders and multihash hashers that comply to the interface that layers above assume. - * - * This library provides implementations for most basics and many others can be found in linked repositories. + * Return the first value in an (async)iterable * - * ```TypeScript - * import { CID } from 'multiformats/cid' - * import * as json from 'multiformats/codecs/json' - * import { sha256 } from 'multiformats/hashes/sha2' + * @example * - * const bytes = json.encode({ hello: 'world' }) + * ```javascript + * import first from 'it-first' * - * const hash = await sha256.digest(bytes) - * const cid = CID.create(1, json.code, hash) - * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) - * ``` + * // This can also be an iterator, generator, etc + * const values = [0, 1, 2, 3, 4] * - * ## Creating Blocks + * const res = first(values) * - * ```TypeScript - * import * as Block from 'multiformats/block' - * import * as codec from '@ipld/dag-cbor' - * import { sha256 as hasher } from 'multiformats/hashes/sha2' + * console.info(res) // 0 + * ``` * - * const value = { hello: 'world' } + * Async sources must be awaited: * - * // encode a block - * let block = await Block.encode({ value, codec, hasher }) + * ```javascript + * import first from 'it-first' * - * block.value // { hello: 'world' } - * block.bytes // Uint8Array - * block.cid // CID() w/ sha2-256 hash address and dag-cbor codec + * const values = async function * () { + * yield * [0, 1, 2, 3, 4] + * } * - * // you can also decode blocks from their binary state - * block = await Block.decode({ bytes: block.bytes, codec, hasher }) + * const res = await first(values()) * - * // if you have the cid you can also verify the hash on decode - * block = await Block.create({ bytes: block.bytes, cid: block.cid, codec, hasher }) + * console.info(res) // 0 * ``` + */ +function it_first_dist_src_isAsyncIterable(thing) { + return thing[Symbol.asyncIterator] != null; +} +function src_first(source) { + if (it_first_dist_src_isAsyncIterable(source)) { + return (async () => { + for await (const entry of source) { // eslint-disable-line no-unreachable-loop + return entry; + } + return undefined; + })(); + } + for (const entry of source) { // eslint-disable-line no-unreachable-loop + return entry; + } + return undefined; +} +/* harmony default export */ const it_first_dist_src = (src_first); +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/it-batch/dist/src/index.js +/** + * @packageDocumentation * - * ## Multibase Encoders / Decoders / Codecs + * The final batch may be smaller than the max. * - * CIDs can be serialized to string representation using multibase encoders that implement [`MultibaseEncoder`](https://github.com/multiformats/js-multiformats/blob/master/src/bases/interface.ts) interface. This library provides quite a few implementations that can be imported: + * @example * - * ```TypeScript - * import { base64 } from "multiformats/bases/base64" - * cid.toString(base64.encoder) - * //> 'mAYAEEiCTojlxqRTl6svwqNJRVM2jCcPBxy+7mRTUfGDzy2gViA' - * ``` + * ```javascript + * import batch from 'it-batch' + * import all from 'it-all' * - * Parsing CID string serialized CIDs requires multibase decoder that implements [`MultibaseDecoder`](https://github.com/multiformats/js-multiformats/blob/master/src/bases/interface.ts) interface. This library provides a decoder for every encoder it provides: + * // This can also be an iterator, generator, etc + * const values = [0, 1, 2, 3, 4] + * const batchSize = 2 * - * ```TypeScript - * CID.parse('mAYAEEiCTojlxqRTl6svwqNJRVM2jCcPBxy+7mRTUfGDzy2gViA', base64.decoder) - * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) + * const result = all(batch(values, batchSize)) + * + * console.info(result) // [0, 1], [2, 3], [4] * ``` * - * Dual of multibase encoder & decoder is defined as multibase codec and it exposes - * them as `encoder` and `decoder` properties. For added convenience codecs also - * implement `MultibaseEncoder` and `MultibaseDecoder` interfaces so they could be - * used as either or both: + * Async sources must be awaited: * - * ```TypeScript - * cid.toString(base64) - * CID.parse(cid.toString(base64), base64) - * ``` + * ```javascript + * import batch from 'it-batch' + * import all from 'it-all' * - * **Note:** CID implementation comes bundled with `base32` and `base58btc` - * multibase codecs so that CIDs can be base serialized to (version specific) - * default base encoding and parsed without having to supply base encoders/decoders: + * const values = async function * () { + * yield * [0, 1, 2, 3, 4] + * } * - * ```TypeScript - * const v1 = CID.parse('bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea') - * v1.toString() - * //> 'bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea' + * const batchSize = 2 + * const result = await all(batch(values(), batchSize)) * - * const v0 = CID.parse('QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n') - * v0.toString() - * //> 'QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n' - * v0.toV1().toString() - * //> 'bafybeihdwdcefgh4dqkjv67uzcmw7ojee6xedzdetojuzjevtenxquvyku' + * console.info(result) // [0, 1], [2, 3], [4] * ``` + */ +function it_batch_dist_src_isAsyncIterable(thing) { + return thing[Symbol.asyncIterator] != null; +} +function batch(source, size = 1) { + size = Number(size); + if (it_batch_dist_src_isAsyncIterable(source)) { + return (async function* () { + let things = []; + if (size < 1) { + size = 1; + } + if (size !== Math.round(size)) { + throw new Error('Batch size must be an integer'); + } + for await (const thing of source) { + things.push(thing); + while (things.length >= size) { + yield things.slice(0, size); + things = things.slice(size); + } + } + while (things.length > 0) { + yield things.slice(0, size); + things = things.slice(size); + } + }()); + } + return (function* () { + let things = []; + if (size < 1) { + size = 1; + } + if (size !== Math.round(size)) { + throw new Error('Batch size must be an integer'); + } + for (const thing of source) { + things.push(thing); + while (things.length >= size) { + yield things.slice(0, size); + things = things.slice(size); + } + } + while (things.length > 0) { + yield things.slice(0, size); + things = things.slice(size); + } + }()); +} +/* harmony default export */ const it_batch_dist_src = (batch); +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/it-parallel-batch/dist/src/index.js +/** + * @packageDocumentation * - * ## Multicodec Encoders / Decoders / Codecs + * Takes an async iterator that emits promise-returning functions, invokes them in parallel and emits the results in the same order as the input. * - * This library defines [`BlockEncoder`, `BlockDecoder` and `BlockCodec` interfaces](https://github.com/multiformats/js-multiformats/blob/master/src/codecs/interface.ts). - * Codec implementations should conform to the `BlockCodec` interface which implements both `BlockEncoder` and `BlockDecoder`. - * Here is an example implementation of JSON `BlockCodec`. + * The final batch may be smaller than the batch size. * - * ```TypeScript - * export const { name, code, encode, decode } = { - * name: 'json', - * code: 0x0200, - * encode: json => new TextEncoder().encode(JSON.stringify(json)), - * decode: bytes => JSON.parse(new TextDecoder().decode(bytes)) - * } - * ``` + * @example * - * ## Multihash Hashers + * ```javascript + * import parallelBatch from 'it-parallel-batch' + * import all from 'it-all' + * import delay from 'delay' * - * This library defines [`MultihashHasher` and `MultihashDigest` interfaces](https://github.com/multiformats/js-multiformats/blob/master/src/hashes/interface.ts) and convinient function for implementing them: + * // This can also be an iterator, async iterator, generator, etc + * const input = [ + * async () => { + * await delay(500) * - * ```TypeScript - * import * as hasher from 'multiformats/hashes/hasher' + * return 1 + * }, + * async () => { + * await delay(200) * - * const sha256 = hasher.from({ - * // As per multiformats table - * // https://github.com/multiformats/multicodec/blob/master/table.csv#L9 - * name: 'sha2-256', - * code: 0x12, + * return 2 + * }, + * async () => { + * await delay(100) * - * encode: (input) => new Uint8Array(crypto.createHash('sha256').update(input).digest()) - * }) + * return 3 + * } + * ] * - * const hash = await sha256.digest(json.encode({ hello: 'world' })) - * CID.create(1, json.code, hash) + * const batchSize = 2 * - * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) + * const result = await all(parallelBatch(input, batchSize)) + * + * console.info(result) // [1, 2, 3] * ``` + */ + +/** + * Takes an (async) iterator that emits promise-returning functions, + * invokes them in parallel and emits the results as they become available but + * in the same order as the input + */ +async function* parallelBatch(source, size = 1) { + for await (const tasks of it_batch_dist_src(source, size)) { + const things = tasks.map(async (p) => { + return p().then(value => ({ ok: true, value }), err => ({ ok: false, err })); + }); + for (let i = 0; i < things.length; i++) { + const result = await things[i]; + if (result.ok) { + yield result.value; + } + else { + throw result.err; + } + } + } +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/uint8arraylist/node_modules/uint8arrays/dist/src/util/as-uint8array.js +/** + * To guarantee Uint8Array semantics, convert nodejs Buffers + * into vanilla Uint8Arrays + */ +function uint8arrays_dist_src_util_as_uint8array_asUint8Array(buf) { + if (globalThis.Buffer != null) { + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); + } + return buf; +} +//# sourceMappingURL=as-uint8array.js.map +;// CONCATENATED MODULE: ./node_modules/uint8arraylist/node_modules/uint8arrays/dist/src/alloc.js + +/** + * Returns a `Uint8Array` of the requested size. Referenced memory will + * be initialized to 0. + */ +function node_modules_uint8arrays_dist_src_alloc_alloc(size = 0) { + if (globalThis.Buffer?.alloc != null) { + return uint8arrays_dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.alloc(size)); + } + return new Uint8Array(size); +} +/** + * Where possible returns a Uint8Array of the requested size that references + * uninitialized memory. Only use if you are certain you will immediately + * overwrite every value in the returned `Uint8Array`. + */ +function uint8arrays_dist_src_alloc_allocUnsafe(size = 0) { + if (globalThis.Buffer?.allocUnsafe != null) { + return uint8arrays_dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.allocUnsafe(size)); + } + return new Uint8Array(size); +} +//# sourceMappingURL=alloc.js.map +;// CONCATENATED MODULE: ./node_modules/uint8arraylist/node_modules/uint8arrays/dist/src/concat.js + + +/** + * Returns a new Uint8Array created by concatenating the passed ArrayLikes + */ +function dist_src_concat_concat(arrays, length) { + if (length == null) { + length = arrays.reduce((acc, curr) => acc + curr.length, 0); + } + const output = uint8arrays_dist_src_alloc_allocUnsafe(length); + let offset = 0; + for (const arr of arrays) { + output.set(arr, offset); + offset += arr.length; + } + return uint8arrays_dist_src_util_as_uint8array_asUint8Array(output); +} +//# sourceMappingURL=concat.js.map +;// CONCATENATED MODULE: ./node_modules/uint8arraylist/node_modules/uint8arrays/dist/src/equals.js +/** + * Returns true if the two passed Uint8Arrays have the same content + */ +function uint8arrays_dist_src_equals_equals(a, b) { + if (a === b) { + return true; + } + if (a.byteLength !== b.byteLength) { + return false; + } + for (let i = 0; i < a.byteLength; i++) { + if (a[i] !== b[i]) { + return false; + } + } + return true; +} +//# sourceMappingURL=equals.js.map +;// CONCATENATED MODULE: ./node_modules/uint8arraylist/dist/src/index.js +/** + * @packageDocumentation * - * ## Traversal + * A class that lets you do operations over a list of Uint8Arrays without + * copying them. * - * This library contains higher-order functions for traversing graphs of data easily. + * ```js + * import { Uint8ArrayList } from 'uint8arraylist' * - * `walk()` walks through the links in each block of a DAG calling a user-supplied loader function for each one, in depth-first order with no duplicate block visits. The loader should return a `Block` object and can be used to inspect and collect block ordering for a full DAG walk. The loader should `throw` on error, and return `null` if a block should be skipped by `walk()`. + * const list = new Uint8ArrayList() + * list.append(Uint8Array.from([0, 1, 2])) + * list.append(Uint8Array.from([3, 4, 5])) * - * ```TypeScript - * import { walk } from 'multiformats/traversal' - * import * as Block from 'multiformats/block' - * import * as codec from 'multiformats/codecs/json' - * import { sha256 as hasher } from 'multiformats/hashes/sha2' + * list.subarray() + * // -> Uint8Array([0, 1, 2, 3, 4, 5]) * - * // build a DAG (a single block for this simple example) - * const value = { hello: 'world' } - * const block = await Block.encode({ value, codec, hasher }) - * const { cid } = block - * console.log(cid) - * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) + * list.consume(3) + * list.subarray() + * // -> Uint8Array([3, 4, 5]) * - * // create a loader function that also collects CIDs of blocks in - * // their traversal order - * const load = (cid, blocks) => async (cid) => { - * // fetch a block using its cid - * // e.g.: const block = await fetchBlockByCID(cid) - * blocks.push(cid) - * return block + * // you can also iterate over the list + * for (const buf of list) { + * // ..do something with `buf` * } * - * // collect blocks in this DAG starting from the root `cid` - * const blocks = [] - * await walk({ cid, load: load(cid, blocks) }) + * list.subarray(0, 1) + * // -> Uint8Array([0]) + * ``` * - * console.log(blocks) - * //> [CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea)] + * ## Converting Uint8ArrayLists to Uint8Arrays + * + * There are two ways to turn a `Uint8ArrayList` into a `Uint8Array` - `.slice` and `.subarray` and one way to turn a `Uint8ArrayList` into a `Uint8ArrayList` with different contents - `.sublist`. + * + * ### slice + * + * Slice follows the same semantics as [Uint8Array.slice](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) in that it creates a new `Uint8Array` and copies bytes into it using an optional offset & length. + * + * ```js + * const list = new Uint8ArrayList() + * list.append(Uint8Array.from([0, 1, 2])) + * list.append(Uint8Array.from([3, 4, 5])) + * + * list.slice(0, 1) + * // -> Uint8Array([0]) * ``` * - * ## Legacy interface + * ### subarray * - * [`blockcodec-to-ipld-format`](https://github.com/ipld/js-blockcodec-to-ipld-format) converts a multiformats [`BlockCodec`](https://github.com/multiformats/js-multiformats/blob/master/src/codecs/interface.ts#L21) into an - * [`interface-ipld-format`](https://github.com/ipld/interface-ipld-format) for use with the [`ipld`](https://github.com/ipld/ipld) package. This can help bridge IPLD codecs implemented using the structure and interfaces defined here to existing code that assumes, or requires `interface-ipld-format`. This bridge also includes the relevant TypeScript definitions. + * Subarray attempts to follow the same semantics as [Uint8Array.subarray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) with one important different - this is a no-copy operation, unless the requested bytes span two internal buffers in which case it is a copy operation. * - * ## Implementations + * ```js + * const list = new Uint8ArrayList() + * list.append(Uint8Array.from([0, 1, 2])) + * list.append(Uint8Array.from([3, 4, 5])) * - * By default, no base encodings (other than base32 & base58btc), hash functions, - * or codec implementations are exposed by `multiformats`, you need to - * import the ones you need yourself. + * list.subarray(0, 1) + * // -> Uint8Array([0]) - no-copy * - * ### Multibase codecs + * list.subarray(2, 5) + * // -> Uint8Array([2, 3, 4]) - copy + * ``` * - * | bases | import | repo | - * | ------------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------- | - * | `base16` | `multiformats/bases/base16` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | - * | `base32`, `base32pad`, `base32hex`, `base32hexpad`, `base32z` | `multiformats/bases/base32` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | - * | `base64`, `base64pad`, `base64url`, `base64urlpad` | `multiformats/bases/base64` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | - * | `base58btc`, `base58flick4` | `multiformats/bases/base58` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | + * ### sublist * - * Other (less useful) bases implemented in [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) include: `base2`, `base8`, `base10`, `base36` and `base256emoji`. + * Sublist creates and returns a new `Uint8ArrayList` that shares the underlying buffers with the original so is always a no-copy operation. * - * ### Multihash hashers + * ```js + * const list = new Uint8ArrayList() + * list.append(Uint8Array.from([0, 1, 2])) + * list.append(Uint8Array.from([3, 4, 5])) * - * | hashes | import | repo | - * | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------ | - * | `sha2-256`, `sha2-512` | `multiformats/hashes/sha2` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/hashes) | - * | `sha3-224`, `sha3-256`, `sha3-384`,`sha3-512`, `shake-128`, `shake-256`, `keccak-224`, `keccak-256`, `keccak-384`, `keccak-512` | `@multiformats/sha3` | [multiformats/js-sha3](https://github.com/multiformats/js-sha3) | - * | `identity` | `multiformats/hashes/identity` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/hashes/identity.js) | - * | `murmur3-128`, `murmur3-32` | `@multiformats/murmur3` | [multiformats/js-murmur3](https://github.com/multiformats/js-murmur3) | - * | `blake2b-*`, `blake2s-*` | `@multiformats/blake2` | [multiformats/js-blake2](https://github.com/multiformats/js-blake2) | + * list.sublist(0, 1) + * // -> Uint8ArrayList([0]) - no-copy * - * ### IPLD codecs (multicodec) + * list.sublist(2, 5) + * // -> Uint8ArrayList([2], [3, 4]) - no-copy + * ``` * - * | codec | import | repo | - * | ---------- | -------------------------- | ------------------------------------------------------------------------------------------------------ | - * | `raw` | `multiformats/codecs/raw` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/codecs) | - * | `json` | `multiformats/codecs/json` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/codecs) | - * | `dag-cbor` | `@ipld/dag-cbor` | [ipld/js-dag-cbor](https://github.com/ipld/js-dag-cbor) | - * | `dag-json` | `@ipld/dag-json` | [ipld/js-dag-json](https://github.com/ipld/js-dag-json) | - * | `dag-pb` | `@ipld/dag-pb` | [ipld/js-dag-pb](https://github.com/ipld/js-dag-pb) | - * | `dag-jose` | `dag-jose` | [ceramicnetwork/js-dag-jose](https://github.com/ceramicnetwork/js-dag-jose) | + * ## Inspiration + * + * Borrows liberally from [bl](https://www.npmjs.com/package/bl) but only uses native JS types. */ +const uint8arraylist_dist_src_symbol = Symbol.for('@achingbrain/uint8arraylist'); +function findBufAndOffset(bufs, index) { + if (index == null || index < 0) { + throw new RangeError('index is out of bounds'); + } + let offset = 0; + for (const buf of bufs) { + const bufEnd = offset + buf.byteLength; + if (index < bufEnd) { + return { + buf, + index: index - offset + }; + } + offset = bufEnd; + } + throw new RangeError('index is out of bounds'); +} +/** + * Check if object is a CID instance + * + * @example + * + * ```js + * import { isUint8ArrayList, Uint8ArrayList } from 'uint8arraylist' + * + * isUint8ArrayList(true) // false + * isUint8ArrayList([]) // false + * isUint8ArrayList(new Uint8ArrayList()) // true + * ``` + */ +function isUint8ArrayList(value) { + return Boolean(value?.[uint8arraylist_dist_src_symbol]); +} +class src_Uint8ArrayList { + bufs; + length; + [uint8arraylist_dist_src_symbol] = true; + constructor(...data) { + this.bufs = []; + this.length = 0; + if (data.length > 0) { + this.appendAll(data); + } + } + *[Symbol.iterator]() { + yield* this.bufs; + } + get byteLength() { + return this.length; + } + /** + * Add one or more `bufs` to the end of this Uint8ArrayList + */ + append(...bufs) { + this.appendAll(bufs); + } + /** + * Add all `bufs` to the end of this Uint8ArrayList + */ + appendAll(bufs) { + let length = 0; + for (const buf of bufs) { + if (buf instanceof Uint8Array) { + length += buf.byteLength; + this.bufs.push(buf); + } + else if (isUint8ArrayList(buf)) { + length += buf.byteLength; + this.bufs.push(...buf.bufs); + } + else { + throw new Error('Could not append value, must be an Uint8Array or a Uint8ArrayList'); + } + } + this.length += length; + } + /** + * Add one or more `bufs` to the start of this Uint8ArrayList + */ + prepend(...bufs) { + this.prependAll(bufs); + } + /** + * Add all `bufs` to the start of this Uint8ArrayList + */ + prependAll(bufs) { + let length = 0; + for (const buf of bufs.reverse()) { + if (buf instanceof Uint8Array) { + length += buf.byteLength; + this.bufs.unshift(buf); + } + else if (isUint8ArrayList(buf)) { + length += buf.byteLength; + this.bufs.unshift(...buf.bufs); + } + else { + throw new Error('Could not prepend value, must be an Uint8Array or a Uint8ArrayList'); + } + } + this.length += length; + } + /** + * Read the value at `index` + */ + get(index) { + const res = findBufAndOffset(this.bufs, index); + return res.buf[res.index]; + } + /** + * Set the value at `index` to `value` + */ + set(index, value) { + const res = findBufAndOffset(this.bufs, index); + res.buf[res.index] = value; + } + /** + * Copy bytes from `buf` to the index specified by `offset` + */ + write(buf, offset = 0) { + if (buf instanceof Uint8Array) { + for (let i = 0; i < buf.length; i++) { + this.set(offset + i, buf[i]); + } + } + else if (isUint8ArrayList(buf)) { + for (let i = 0; i < buf.length; i++) { + this.set(offset + i, buf.get(i)); + } + } + else { + throw new Error('Could not write value, must be an Uint8Array or a Uint8ArrayList'); + } + } + /** + * Remove bytes from the front of the pool + */ + consume(bytes) { + // first, normalize the argument, in accordance with how Buffer does it + bytes = Math.trunc(bytes); + // do nothing if not a positive number + if (Number.isNaN(bytes) || bytes <= 0) { + return; + } + // if consuming all bytes, skip iterating + if (bytes === this.byteLength) { + this.bufs = []; + this.length = 0; + return; + } + while (this.bufs.length > 0) { + if (bytes >= this.bufs[0].byteLength) { + bytes -= this.bufs[0].byteLength; + this.length -= this.bufs[0].byteLength; + this.bufs.shift(); + } + else { + this.bufs[0] = this.bufs[0].subarray(bytes); + this.length -= bytes; + break; + } + } + } + /** + * Extracts a section of an array and returns a new array. + * + * This is a copy operation as it is with Uint8Arrays and Arrays + * - note this is different to the behaviour of Node Buffers. + */ + slice(beginInclusive, endExclusive) { + const { bufs, length } = this._subList(beginInclusive, endExclusive); + return dist_src_concat_concat(bufs, length); + } + /** + * Returns a alloc from the given start and end element index. + * + * In the best case where the data extracted comes from a single Uint8Array + * internally this is a no-copy operation otherwise it is a copy operation. + */ + subarray(beginInclusive, endExclusive) { + const { bufs, length } = this._subList(beginInclusive, endExclusive); + if (bufs.length === 1) { + return bufs[0]; + } + return dist_src_concat_concat(bufs, length); + } + /** + * Returns a allocList from the given start and end element index. + * + * This is a no-copy operation. + */ + sublist(beginInclusive, endExclusive) { + const { bufs, length } = this._subList(beginInclusive, endExclusive); + const list = new src_Uint8ArrayList(); + list.length = length; + // don't loop, just set the bufs + list.bufs = [...bufs]; + return list; + } + _subList(beginInclusive, endExclusive) { + beginInclusive = beginInclusive ?? 0; + endExclusive = endExclusive ?? this.length; + if (beginInclusive < 0) { + beginInclusive = this.length + beginInclusive; + } + if (endExclusive < 0) { + endExclusive = this.length + endExclusive; + } + if (beginInclusive < 0 || endExclusive > this.length) { + throw new RangeError('index is out of bounds'); + } + if (beginInclusive === endExclusive) { + return { bufs: [], length: 0 }; + } + if (beginInclusive === 0 && endExclusive === this.length) { + return { bufs: this.bufs, length: this.length }; + } + const bufs = []; + let offset = 0; + for (let i = 0; i < this.bufs.length; i++) { + const buf = this.bufs[i]; + const bufStart = offset; + const bufEnd = bufStart + buf.byteLength; + // for next loop + offset = bufEnd; + if (beginInclusive >= bufEnd) { + // start after this buf + continue; + } + const sliceStartInBuf = beginInclusive >= bufStart && beginInclusive < bufEnd; + const sliceEndsInBuf = endExclusive > bufStart && endExclusive <= bufEnd; + if (sliceStartInBuf && sliceEndsInBuf) { + // slice is wholly contained within this buffer + if (beginInclusive === bufStart && endExclusive === bufEnd) { + // requested whole buffer + bufs.push(buf); + break; + } + // requested part of buffer + const start = beginInclusive - bufStart; + bufs.push(buf.subarray(start, start + (endExclusive - beginInclusive))); + break; + } + if (sliceStartInBuf) { + // slice starts in this buffer + if (beginInclusive === 0) { + // requested whole buffer + bufs.push(buf); + continue; + } + // requested part of buffer + bufs.push(buf.subarray(beginInclusive - bufStart)); + continue; + } + if (sliceEndsInBuf) { + if (endExclusive === bufEnd) { + // requested whole buffer + bufs.push(buf); + break; + } + // requested part of buffer + bufs.push(buf.subarray(0, endExclusive - bufStart)); + break; + } + // slice started before this buffer and ends after it + bufs.push(buf); + } + return { bufs, length: endExclusive - beginInclusive }; + } + indexOf(search, offset = 0) { + if (!isUint8ArrayList(search) && !(search instanceof Uint8Array)) { + throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array'); + } + const needle = search instanceof Uint8Array ? search : search.subarray(); + offset = Number(offset ?? 0); + if (isNaN(offset)) { + offset = 0; + } + if (offset < 0) { + offset = this.length + offset; + } + if (offset < 0) { + offset = 0; + } + if (search.length === 0) { + return offset > this.length ? this.length : offset; + } + // https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_string-search_algorithm + const M = needle.byteLength; + if (M === 0) { + throw new TypeError('search must be at least 1 byte long'); + } + // radix + const radix = 256; + const rightmostPositions = new Int32Array(radix); + // position of the rightmost occurrence of the byte c in the pattern + for (let c = 0; c < radix; c++) { + // -1 for bytes not in pattern + rightmostPositions[c] = -1; + } + for (let j = 0; j < M; j++) { + // rightmost position for bytes in pattern + rightmostPositions[needle[j]] = j; + } + // Return offset of first match, -1 if no match + const right = rightmostPositions; + const lastIndex = this.byteLength - needle.byteLength; + const lastPatIndex = needle.byteLength - 1; + let skip; + for (let i = offset; i <= lastIndex; i += skip) { + skip = 0; + for (let j = lastPatIndex; j >= 0; j--) { + const char = this.get(i + j); + if (needle[j] !== char) { + skip = Math.max(1, j - right[char]); + break; + } + } + if (skip === 0) { + return i; + } + } + return -1; + } + getInt8(byteOffset) { + const buf = this.subarray(byteOffset, byteOffset + 1); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + return view.getInt8(0); + } + setInt8(byteOffset, value) { + const buf = uint8arrays_dist_src_alloc_allocUnsafe(1); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + view.setInt8(0, value); + this.write(buf, byteOffset); + } + getInt16(byteOffset, littleEndian) { + const buf = this.subarray(byteOffset, byteOffset + 2); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + return view.getInt16(0, littleEndian); + } + setInt16(byteOffset, value, littleEndian) { + const buf = node_modules_uint8arrays_dist_src_alloc_alloc(2); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + view.setInt16(0, value, littleEndian); + this.write(buf, byteOffset); + } + getInt32(byteOffset, littleEndian) { + const buf = this.subarray(byteOffset, byteOffset + 4); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + return view.getInt32(0, littleEndian); + } + setInt32(byteOffset, value, littleEndian) { + const buf = node_modules_uint8arrays_dist_src_alloc_alloc(4); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + view.setInt32(0, value, littleEndian); + this.write(buf, byteOffset); + } + getBigInt64(byteOffset, littleEndian) { + const buf = this.subarray(byteOffset, byteOffset + 8); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + return view.getBigInt64(0, littleEndian); + } + setBigInt64(byteOffset, value, littleEndian) { + const buf = node_modules_uint8arrays_dist_src_alloc_alloc(8); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + view.setBigInt64(0, value, littleEndian); + this.write(buf, byteOffset); + } + getUint8(byteOffset) { + const buf = this.subarray(byteOffset, byteOffset + 1); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + return view.getUint8(0); + } + setUint8(byteOffset, value) { + const buf = uint8arrays_dist_src_alloc_allocUnsafe(1); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + view.setUint8(0, value); + this.write(buf, byteOffset); + } + getUint16(byteOffset, littleEndian) { + const buf = this.subarray(byteOffset, byteOffset + 2); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + return view.getUint16(0, littleEndian); + } + setUint16(byteOffset, value, littleEndian) { + const buf = node_modules_uint8arrays_dist_src_alloc_alloc(2); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + view.setUint16(0, value, littleEndian); + this.write(buf, byteOffset); + } + getUint32(byteOffset, littleEndian) { + const buf = this.subarray(byteOffset, byteOffset + 4); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + return view.getUint32(0, littleEndian); + } + setUint32(byteOffset, value, littleEndian) { + const buf = node_modules_uint8arrays_dist_src_alloc_alloc(4); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + view.setUint32(0, value, littleEndian); + this.write(buf, byteOffset); + } + getBigUint64(byteOffset, littleEndian) { + const buf = this.subarray(byteOffset, byteOffset + 8); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + return view.getBigUint64(0, littleEndian); + } + setBigUint64(byteOffset, value, littleEndian) { + const buf = node_modules_uint8arrays_dist_src_alloc_alloc(8); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + view.setBigUint64(0, value, littleEndian); + this.write(buf, byteOffset); + } + getFloat32(byteOffset, littleEndian) { + const buf = this.subarray(byteOffset, byteOffset + 4); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + return view.getFloat32(0, littleEndian); + } + setFloat32(byteOffset, value, littleEndian) { + const buf = node_modules_uint8arrays_dist_src_alloc_alloc(4); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + view.setFloat32(0, value, littleEndian); + this.write(buf, byteOffset); + } + getFloat64(byteOffset, littleEndian) { + const buf = this.subarray(byteOffset, byteOffset + 8); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + return view.getFloat64(0, littleEndian); + } + setFloat64(byteOffset, value, littleEndian) { + const buf = node_modules_uint8arrays_dist_src_alloc_alloc(8); + const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength); + view.setFloat64(0, value, littleEndian); + this.write(buf, byteOffset); + } + equals(other) { + if (other == null) { + return false; + } + if (!(other instanceof src_Uint8ArrayList)) { + return false; + } + if (other.bufs.length !== this.bufs.length) { + return false; + } + for (let i = 0; i < this.bufs.length; i++) { + if (!uint8arrays_dist_src_equals_equals(this.bufs[i], other.bufs[i])) { + return false; + } + } + return true; + } + /** + * Create a Uint8ArrayList from a pre-existing list of Uint8Arrays. Use this + * method if you know the total size of all the Uint8Arrays ahead of time. + */ + static fromUint8Arrays(bufs, length) { + const list = new src_Uint8ArrayList(); + list.bufs = bufs; + if (length == null) { + length = bufs.reduce((acc, curr) => acc + curr.byteLength, 0); + } + list.length = length; + return list; + } +} +/* +function indexOf (needle: Uint8Array, haystack: Uint8Array, offset = 0) { + for (let i = offset; i < haystack.byteLength; i++) { + for (let j = 0; j < needle.length; j++) { + if (haystack[i + j] !== needle[j]) { + break + } + if (j === needle.byteLength -1) { + return i + } + } -// This way TS will also expose all the types from module - - -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/basics.js - - - - - - - - - - - - - - - -const dist_src_basics_bases = { ...dist_src_bases_identity_namespaceObject, ...dist_src_bases_base2_namespaceObject, ...dist_src_bases_base8_namespaceObject, ...dist_src_bases_base10_namespaceObject, ...dist_src_bases_base16_namespaceObject, ...multiformats_dist_src_bases_base32_namespaceObject, ...dist_src_bases_base36_namespaceObject, ...multiformats_dist_src_bases_base58_namespaceObject, ...multiformats_dist_src_bases_base64_namespaceObject, ...dist_src_bases_base256emoji_namespaceObject }; -const dist_src_basics_hashes = { ...dist_src_hashes_sha2_namespaceObject, ...dist_src_hashes_identity_namespaceObject }; -const dist_src_basics_codecs = { raw: dist_src_codecs_raw_namespaceObject, json: dist_src_codecs_json_namespaceObject }; + if (haystack.byteLength - i < needle.byteLength) { + break + } + } -//# sourceMappingURL=basics.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/uint8arrays/dist/src/alloc.js + return -1 +} +*/ +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/chunker/fixed-size.js +const DEFAULT_CHUNK_SIZE = 262144; +const fixedSize = (options = {}) => { + const chunkSize = options.chunkSize ?? DEFAULT_CHUNK_SIZE; + return async function* fixedSizeChunker(source) { + let list = new src_Uint8ArrayList(); + let currentLength = 0; + let emitted = false; + for await (const buffer of source) { + list.append(buffer); + currentLength += buffer.length; + while (currentLength >= chunkSize) { + yield list.slice(0, chunkSize); + emitted = true; + // throw away consumed bytes + if (chunkSize === list.length) { + list = new src_Uint8ArrayList(); + currentLength = 0; + } + else { + const newBl = new src_Uint8ArrayList(); + newBl.append(list.sublist(chunkSize)); + list = newBl; + // update our offset + currentLength -= chunkSize; + } + } + } + if (!emitted || currentLength > 0) { + // return any remaining bytes + yield list.subarray(0, currentLength); + } + }; +}; +//# sourceMappingURL=fixed-size.js.map +;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/utils/float.js +const f32 = new Float32Array([-0]); +const f8b = new Uint8Array(f32.buffer); /** - * Returns a `Uint8Array` of the requested size. Referenced memory will - * be initialized to 0. + * Writes a 32 bit float to a buffer using little endian byte order */ -function ipfs_unixfs_importer_node_modules_uint8arrays_dist_src_alloc_alloc(size = 0) { - if (globalThis.Buffer?.alloc != null) { - return asUint8Array(globalThis.Buffer.alloc(size)); - } - return new Uint8Array(size); +function writeFloatLE(val, buf, pos) { + f32[0] = val; + buf[pos] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; } /** - * Where possible returns a Uint8Array of the requested size that references - * uninitialized memory. Only use if you are certain you will immediately - * overwrite every value in the returned `Uint8Array`. + * Writes a 32 bit float to a buffer using big endian byte order */ -function ipfs_unixfs_importer_node_modules_uint8arrays_dist_src_alloc_allocUnsafe(size = 0) { - if (globalThis.Buffer?.allocUnsafe != null) { - return ipfs_unixfs_importer_node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.allocUnsafe(size)); - } - return new Uint8Array(size); +function writeFloatBE(val, buf, pos) { + f32[0] = val; + buf[pos] = f8b[3]; + buf[pos + 1] = f8b[2]; + buf[pos + 2] = f8b[1]; + buf[pos + 3] = f8b[0]; } -//# sourceMappingURL=alloc.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/uint8arrays/dist/src/util/bases.js - - -function dist_src_util_bases_createCodec(name, prefix, encode, decode) { - return { - name, - prefix, - encoder: { - name, - prefix, - encode - }, - decoder: { - decode - } - }; +/** + * Reads a 32 bit float from a buffer using little endian byte order + */ +function readFloatLE(buf, pos) { + f8b[0] = buf[pos]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + return f32[0]; } -const dist_src_util_bases_string = dist_src_util_bases_createCodec('utf8', 'u', (buf) => { - const decoder = new TextDecoder('utf8'); - return 'u' + decoder.decode(buf); -}, (str) => { - const encoder = new TextEncoder(); - return encoder.encode(str.substring(1)); -}); -const dist_src_util_bases_ascii = dist_src_util_bases_createCodec('ascii', 'a', (buf) => { - let string = 'a'; - for (let i = 0; i < buf.length; i++) { - string += String.fromCharCode(buf[i]); - } - return string; -}, (str) => { - str = str.substring(1); - const buf = ipfs_unixfs_importer_node_modules_uint8arrays_dist_src_alloc_allocUnsafe(str.length); - for (let i = 0; i < str.length; i++) { - buf[i] = str.charCodeAt(i); - } - return buf; -}); -const dist_src_util_bases_BASES = { - utf8: dist_src_util_bases_string, - 'utf-8': dist_src_util_bases_string, - hex: dist_src_basics_bases.base16, - latin1: dist_src_util_bases_ascii, - ascii: dist_src_util_bases_ascii, - binary: dist_src_util_bases_ascii, - ...dist_src_basics_bases -}; -/* harmony default export */ const node_modules_uint8arrays_dist_src_util_bases = (dist_src_util_bases_BASES); -//# sourceMappingURL=bases.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/uint8arrays/dist/src/from-string.js - - /** - * Create a `Uint8Array` from the passed string - * - * Supports `utf8`, `utf-8`, `hex`, and any encoding supported by the multiformats module. + * Reads a 32 bit float from a buffer using big endian byte order + */ +function readFloatBE(buf, pos) { + f8b[3] = buf[pos]; + f8b[2] = buf[pos + 1]; + f8b[1] = buf[pos + 2]; + f8b[0] = buf[pos + 3]; + return f32[0]; +} +const f64 = new Float64Array([-0]); +const d8b = new Uint8Array(f64.buffer); +/** + * Writes a 64 bit double to a buffer using little endian byte order + */ +function writeDoubleLE(val, buf, pos) { + f64[0] = val; + buf[pos] = d8b[0]; + buf[pos + 1] = d8b[1]; + buf[pos + 2] = d8b[2]; + buf[pos + 3] = d8b[3]; + buf[pos + 4] = d8b[4]; + buf[pos + 5] = d8b[5]; + buf[pos + 6] = d8b[6]; + buf[pos + 7] = d8b[7]; +} +/** + * Writes a 64 bit double to a buffer using big endian byte order + */ +function writeDoubleBE(val, buf, pos) { + f64[0] = val; + buf[pos] = d8b[7]; + buf[pos + 1] = d8b[6]; + buf[pos + 2] = d8b[5]; + buf[pos + 3] = d8b[4]; + buf[pos + 4] = d8b[3]; + buf[pos + 5] = d8b[2]; + buf[pos + 6] = d8b[1]; + buf[pos + 7] = d8b[0]; +} +/** + * Reads a 64 bit double from a buffer using little endian byte order + */ +function readDoubleLE(buf, pos) { + d8b[0] = buf[pos]; + d8b[1] = buf[pos + 1]; + d8b[2] = buf[pos + 2]; + d8b[3] = buf[pos + 3]; + d8b[4] = buf[pos + 4]; + d8b[5] = buf[pos + 5]; + d8b[6] = buf[pos + 6]; + d8b[7] = buf[pos + 7]; + return f64[0]; +} +/** + * Reads a 64 bit double from a buffer using big endian byte order + */ +function readDoubleBE(buf, pos) { + d8b[7] = buf[pos]; + d8b[6] = buf[pos + 1]; + d8b[5] = buf[pos + 2]; + d8b[4] = buf[pos + 3]; + d8b[3] = buf[pos + 4]; + d8b[2] = buf[pos + 5]; + d8b[1] = buf[pos + 6]; + d8b[0] = buf[pos + 7]; + return f64[0]; +} +//# sourceMappingURL=float.js.map +;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/utils/longbits.js +// the largest BigInt we can safely downcast to a Number +const MAX_SAFE_NUMBER_INTEGER = BigInt(Number.MAX_SAFE_INTEGER); +const MIN_SAFE_NUMBER_INTEGER = BigInt(Number.MIN_SAFE_INTEGER); +/** + * Constructs new long bits. * - * Also `ascii` which is similar to node's 'binary' encoding. + * @classdesc Helper class for working with the low and high bits of a 64 bit value. + * @memberof util + * @function Object() { [native code] } + * @param {number} lo - Low 32 bits, unsigned + * @param {number} hi - High 32 bits, unsigned */ -function node_modules_uint8arrays_dist_src_from_string_fromString(string, encoding = 'utf8') { - const base = node_modules_uint8arrays_dist_src_util_bases[encoding]; - if (base == null) { - throw new Error(`Unsupported encoding "${encoding}"`); - } - if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) { - return ipfs_unixfs_importer_node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.from(string, 'utf-8')); +class LongBits { + lo; + hi; + constructor(lo, hi) { + // note that the casts below are theoretically unnecessary as of today, but older statically + // generated converter code might still call the ctor with signed 32bits. kept for compat. + /** + * Low bits + */ + this.lo = lo | 0; + /** + * High bits + */ + this.hi = hi | 0; } - // add multibase prefix - return base.decoder.decode(`${base.prefix}${string}`); // eslint-disable-line @typescript-eslint/restrict-template-expressions -} -//# sourceMappingURL=from-string.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/dag-builder/validate-chunks.js - - -const defaultChunkValidator = () => { - return async function* validateChunks(source) { - for await (const content of source) { - if (content.length === undefined) { - throw err_code(new Error('Content was invalid'), 'ERR_INVALID_CONTENT'); - } - if (typeof content === 'string' || content instanceof String) { - yield node_modules_uint8arrays_dist_src_from_string_fromString(content.toString()); + /** + * Converts this long bits to a possibly unsafe JavaScript number + */ + toNumber(unsigned = false) { + if (!unsigned && (this.hi >>> 31) > 0) { + const lo = ~this.lo + 1 >>> 0; + let hi = ~this.hi >>> 0; + if (lo === 0) { + hi = hi + 1 >>> 0; } - else if (Array.isArray(content)) { - yield Uint8Array.from(content); + return -(lo + hi * 4294967296); + } + return this.lo + this.hi * 4294967296; + } + /** + * Converts this long bits to a bigint + */ + toBigInt(unsigned = false) { + if (unsigned) { + return BigInt(this.lo >>> 0) + (BigInt(this.hi >>> 0) << 32n); + } + if ((this.hi >>> 31) !== 0) { + const lo = ~this.lo + 1 >>> 0; + let hi = ~this.hi >>> 0; + if (lo === 0) { + hi = hi + 1 >>> 0; } - else if (content instanceof Uint8Array) { - yield content; + return -(BigInt(lo) + (BigInt(hi) << 32n)); + } + return BigInt(this.lo >>> 0) + (BigInt(this.hi >>> 0) << 32n); + } + /** + * Converts this long bits to a string + */ + toString(unsigned = false) { + return this.toBigInt(unsigned).toString(); + } + /** + * Zig-zag encodes this long bits + */ + zzEncode() { + const mask = this.hi >> 31; + this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; + this.lo = (this.lo << 1 ^ mask) >>> 0; + return this; + } + /** + * Zig-zag decodes this long bits + */ + zzDecode() { + const mask = -(this.lo & 1); + this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; + this.hi = (this.hi >>> 1 ^ mask) >>> 0; + return this; + } + /** + * Calculates the length of this longbits when encoded as a varint. + */ + length() { + const part0 = this.lo; + const part1 = (this.lo >>> 28 | this.hi << 4) >>> 0; + const part2 = this.hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 ? 1 : 2 + : part0 < 2097152 ? 3 : 4 + : part1 < 16384 + ? part1 < 128 ? 5 : 6 + : part1 < 2097152 ? 7 : 8 + : part2 < 128 ? 9 : 10; + } + /** + * Constructs new long bits from the specified number + */ + static fromBigInt(value) { + if (value === 0n) { + return zero; + } + if (value < MAX_SAFE_NUMBER_INTEGER && value > MIN_SAFE_NUMBER_INTEGER) { + return this.fromNumber(Number(value)); + } + const negative = value < 0n; + if (negative) { + value = -value; + } + let hi = value >> 32n; + let lo = value - (hi << 32n); + if (negative) { + hi = ~hi | 0n; + lo = ~lo | 0n; + if (++lo > TWO_32) { + lo = 0n; + if (++hi > TWO_32) { + hi = 0n; + } } - else { - throw err_code(new Error('Content was invalid'), 'ERR_INVALID_CONTENT'); + } + return new LongBits(Number(lo), Number(hi)); + } + /** + * Constructs new long bits from the specified number + */ + static fromNumber(value) { + if (value === 0) { + return zero; + } + const sign = value < 0; + if (sign) { + value = -value; + } + let lo = value >>> 0; + let hi = (value - lo) / 4294967296 >>> 0; + if (sign) { + hi = ~hi >>> 0; + lo = ~lo >>> 0; + if (++lo > 4294967295) { + lo = 0; + if (++hi > 4294967295) { + hi = 0; + } } } - }; -}; -//# sourceMappingURL=validate-chunks.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/layout/balanced.js - -const DEFAULT_MAX_CHILDREN_PER_NODE = 174; -function balanced(options) { - const maxChildrenPerNode = options?.maxChildrenPerNode ?? DEFAULT_MAX_CHILDREN_PER_NODE; - return async function balancedLayout(source, reduce) { - const roots = []; - for await (const chunked of it_batch_dist_src(source, maxChildrenPerNode)) { - roots.push(await reduce(chunked)); + return new LongBits(lo, hi); + } + /** + * Constructs new long bits from a number, long or string + */ + static from(value) { + if (typeof value === 'number') { + return LongBits.fromNumber(value); } - if (roots.length > 1) { - return balancedLayout(roots, reduce); + if (typeof value === 'bigint') { + return LongBits.fromBigInt(value); } - return roots[0]; - }; + if (typeof value === 'string') { + return LongBits.fromBigInt(BigInt(value)); + } + return value.low != null || value.high != null ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; + } } -//# sourceMappingURL=balanced.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/dir.js - -class Dir { - options; - root; - dir; - path; - dirty; - flat; - parent; - parentKey; - unixfs; - mode; - mtime; - cid; - size; - nodeSize; - constructor(props, options) { - this.options = options ?? {}; - this.root = props.root; - this.dir = props.dir; - this.path = props.path; - this.dirty = props.dirty; - this.flat = props.flat; - this.parent = props.parent; - this.parentKey = props.parentKey; - this.unixfs = props.unixfs; - this.mode = props.mode; - this.mtime = props.mtime; +const zero = new LongBits(0, 0); +zero.toBigInt = function () { return 0n; }; +zero.zzEncode = zero.zzDecode = function () { return this; }; +zero.length = function () { return 1; }; +const TWO_32 = 4294967296n; +//# sourceMappingURL=longbits.js.map +;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/utils/utf8.js +/** + * Calculates the UTF8 byte length of a string + */ +function utf8_length(string) { + let len = 0; + let c = 0; + for (let i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) { + len += 1; + } + else if (c < 2048) { + len += 2; + } + else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { + ++i; + len += 4; + } + else { + len += 3; + } } + return len; } -// we use these to calculate the node size to use as a check for whether a directory -// should be sharded or not. Since CIDs have a constant length and We're only -// interested in the data length and not the actual content identifier we can use -// any old CID instead of having to hash the data which is expensive. -const CID_V0 = node_modules_multiformats_dist_src_cid_CID.parse('QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn'); -const CID_V1 = node_modules_multiformats_dist_src_cid_CID.parse('zdj7WbTaiJT1fgatdet9Ei9iDB5hdCxkbVyhyh8YTUnXMiwYi'); -//# sourceMappingURL=dir.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/dir-flat.js - +/** + * Reads UTF8 bytes as a string + */ +function utf8_read(buffer, start, end) { + const len = end - start; + if (len < 1) { + return ''; + } + let parts; + const chunk = []; + let i = 0; // char offset + let t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) { + chunk[i++] = t; + } + else if (t > 191 && t < 224) { + chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; + } + else if (t > 239 && t < 365) { + t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; + chunk[i++] = 0xD800 + (t >> 10); + chunk[i++] = 0xDC00 + (t & 1023); + } + else { + chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; + } + if (i > 8191) { + (parts ?? (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (parts != null) { + if (i > 0) { + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + } + return parts.join(''); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); +} +/** + * Writes a string as UTF8 bytes + */ +function write(string, buffer, offset) { + const start = offset; + let c1; // character 1 + let c2; // character 2 + for (let i = 0; i < string.length; ++i) { + c1 = string.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } + else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } + else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { + c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); + ++i; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return offset - start; +} +//# sourceMappingURL=utf8.js.map +;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/utils/reader.js -class DirFlat extends Dir { - _children; - constructor(props, options) { - super(props, options); - this._children = new Map(); +/* istanbul ignore next */ +function indexOutOfRange(reader, writeLength) { + return RangeError(`index out of range: ${reader.pos} + ${writeLength ?? 1} > ${reader.len}`); +} +function readFixed32End(buf, end) { + return (buf[end - 4] | + buf[end - 3] << 8 | + buf[end - 2] << 16 | + buf[end - 1] << 24) >>> 0; +} +/** + * Constructs a new reader instance using the specified buffer. + */ +class Uint8ArrayReader { + buf; + pos; + len; + _slice = Uint8Array.prototype.subarray; + constructor(buffer) { + /** + * Read buffer + */ + this.buf = buffer; + /** + * Read buffer position + */ + this.pos = 0; + /** + * Read buffer length + */ + this.len = buffer.length; } - async put(name, value) { - this.cid = undefined; - this.size = undefined; - this.nodeSize = undefined; - this._children.set(name, value); + /** + * Reads a varint as an unsigned 32 bit value + */ + uint32() { + let value = 4294967295; + value = (this.buf[this.pos] & 127) >>> 0; + if (this.buf[this.pos++] < 128) + return value; + value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; + if (this.buf[this.pos++] < 128) + return value; + value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; + if (this.buf[this.pos++] < 128) + return value; + value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; + if (this.buf[this.pos++] < 128) + return value; + value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; + if (this.buf[this.pos++] < 128) + return value; + if ((this.pos += 5) > this.len) { + this.pos = this.len; + throw indexOutOfRange(this, 10); + } + return value; } - async get(name) { - return Promise.resolve(this._children.get(name)); + /** + * Reads a varint as a signed 32 bit value + */ + int32() { + return this.uint32() | 0; } - childCount() { - return this._children.size; + /** + * Reads a zig-zag encoded varint as a signed 32 bit value + */ + sint32() { + const value = this.uint32(); + return value >>> 1 ^ -(value & 1) | 0; } - directChildrenCount() { - return this.childCount(); + /** + * Reads a varint as a boolean + */ + bool() { + return this.uint32() !== 0; } - onlyChild() { - return this._children.values().next().value; + /** + * Reads fixed 32 bits as an unsigned 32 bit integer + */ + fixed32() { + if (this.pos + 4 > this.len) { + throw indexOutOfRange(this, 4); + } + const res = readFixed32End(this.buf, this.pos += 4); + return res; } - async *eachChildSeries() { - for (const [key, child] of this._children.entries()) { - yield { - key, - child - }; + /** + * Reads fixed 32 bits as a signed 32 bit integer + */ + sfixed32() { + if (this.pos + 4 > this.len) { + throw indexOutOfRange(this, 4); } + const res = readFixed32End(this.buf, this.pos += 4) | 0; + return res; } - estimateNodeSize() { - if (this.nodeSize !== undefined) { - return this.nodeSize; + /** + * Reads a float (32 bit) as a number + */ + float() { + if (this.pos + 4 > this.len) { + throw indexOutOfRange(this, 4); } - this.nodeSize = 0; - // estimate size only based on DAGLink name and CID byte lengths - // https://github.com/ipfs/go-unixfsnode/blob/37b47f1f917f1b2f54c207682f38886e49896ef9/data/builder/directory.go#L81-L96 - for (const [name, child] of this._children.entries()) { - if (child.size != null && (child.cid != null)) { - this.nodeSize += name.length + (this.options.cidVersion === 1 ? CID_V1.bytes.byteLength : CID_V0.bytes.byteLength); + const value = readFloatLE(this.buf, this.pos); + this.pos += 4; + return value; + } + /** + * Reads a double (64 bit float) as a number + */ + double() { + /* istanbul ignore if */ + if (this.pos + 8 > this.len) { + throw indexOutOfRange(this, 4); + } + const value = readDoubleLE(this.buf, this.pos); + this.pos += 8; + return value; + } + /** + * Reads a sequence of bytes preceded by its length as a varint + */ + bytes() { + const length = this.uint32(); + const start = this.pos; + const end = this.pos + length; + /* istanbul ignore if */ + if (end > this.len) { + throw indexOutOfRange(this, length); + } + this.pos += length; + return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 + ? new Uint8Array(0) + : this.buf.subarray(start, end); + } + /** + * Reads a string preceded by its byte length as a varint + */ + string() { + const bytes = this.bytes(); + return utf8_read(bytes, 0, bytes.length); + } + /** + * Skips the specified number of bytes if specified, otherwise skips a varint + */ + skip(length) { + if (typeof length === 'number') { + /* istanbul ignore if */ + if (this.pos + length > this.len) { + throw indexOutOfRange(this, length); } + this.pos += length; } - return this.nodeSize; + else { + do { + /* istanbul ignore if */ + if (this.pos >= this.len) { + throw indexOutOfRange(this); + } + } while ((this.buf[this.pos++] & 128) !== 0); + } + return this; } - async *flush(block) { - const links = []; - for (const [name, child] of this._children.entries()) { - let result = child; - if (child instanceof Dir) { - for await (const entry of child.flush(block)) { - result = entry; - yield entry; + /** + * Skips the next element of the specified wire type + */ + skipType(wireType) { + switch (wireType) { + case 0: + this.skip(); + break; + case 1: + this.skip(8); + break; + case 2: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case 5: + this.skip(4); + break; + /* istanbul ignore next */ + default: + throw Error(`invalid wire type ${wireType} at offset ${this.pos}`); + } + return this; + } + readLongVarint() { + // tends to deopt with local vars for octet etc. + const bits = new LongBits(0, 0); + let i = 0; + if (this.len - this.pos > 4) { // fast route (lo) + for (; i < 4; ++i) { + // 1st..4th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) { + return bits; } } - if (result.size != null && (result.cid != null)) { - links.push({ - Name: name, - Tsize: Number(result.size), - Hash: result.cid - }); + // 5th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + if (this.buf[this.pos++] < 128) { + return bits; } + i = 0; } - const unixfs = new src_UnixFS({ - type: 'directory', - mtime: this.mtime, - mode: this.mode - }); - const node = { Data: unixfs.marshal(), Links: links }; - const buffer = src_encode(prepare(node)); - const cid = await persist(buffer, block, this.options); - const size = buffer.length + node.Links.reduce( - /** - * @param {number} acc - * @param {PBLink} curr - */ - (acc, curr) => acc + (curr.Tsize == null ? 0 : curr.Tsize), 0); - this.cid = cid; - this.size = size; - yield { - cid, - unixfs, - path: this.path, - size: BigInt(size) - }; + else { + for (; i < 3; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) { + throw indexOutOfRange(this); + } + // 1st..3th + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) { + return bits; + } + } + // 4th + bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; + return bits; + } + if (this.len - this.pos > 4) { // fast route (hi) + for (; i < 5; ++i) { + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) { + return bits; + } + } + } + else { + for (; i < 5; ++i) { + if (this.pos >= this.len) { + throw indexOutOfRange(this); + } + // 6th..10th + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) { + return bits; + } + } + } + throw Error('invalid varint encoding'); + } + readFixed64() { + if (this.pos + 8 > this.len) { + throw indexOutOfRange(this, 8); + } + const lo = readFixed32End(this.buf, this.pos += 4); + const hi = readFixed32End(this.buf, this.pos += 4); + return new LongBits(lo, hi); + } + /** + * Reads a varint as a signed 64 bit value + */ + int64() { + return this.readLongVarint().toBigInt(); + } + /** + * Reads a varint as a signed 64 bit value returned as a possibly unsafe + * JavaScript number + */ + int64Number() { + return this.readLongVarint().toNumber(); + } + /** + * Reads a varint as a signed 64 bit value returned as a string + */ + int64String() { + return this.readLongVarint().toString(); + } + /** + * Reads a varint as an unsigned 64 bit value + */ + uint64() { + return this.readLongVarint().toBigInt(true); + } + /** + * Reads a varint as an unsigned 64 bit value returned as a possibly unsafe + * JavaScript number + */ + uint64Number() { + return this.readLongVarint().toNumber(true); + } + /** + * Reads a varint as an unsigned 64 bit value returned as a string + */ + uint64String() { + return this.readLongVarint().toString(true); + } + /** + * Reads a zig-zag encoded varint as a signed 64 bit value + */ + sint64() { + return this.readLongVarint().zzDecode().toBigInt(); + } + /** + * Reads a zig-zag encoded varint as a signed 64 bit value returned as a + * possibly unsafe JavaScript number + */ + sint64Number() { + return this.readLongVarint().zzDecode().toNumber(); + } + /** + * Reads a zig-zag encoded varint as a signed 64 bit value returned as a + * string + */ + sint64String() { + return this.readLongVarint().zzDecode().toString(); + } + /** + * Reads fixed 64 bits + */ + fixed64() { + return this.readFixed64().toBigInt(); + } + /** + * Reads fixed 64 bits returned as a possibly unsafe JavaScript number + */ + fixed64Number() { + return this.readFixed64().toNumber(); + } + /** + * Reads fixed 64 bits returned as a string + */ + fixed64String() { + return this.readFixed64().toString(); + } + /** + * Reads zig-zag encoded fixed 64 bits + */ + sfixed64() { + return this.readFixed64().toBigInt(); + } + /** + * Reads zig-zag encoded fixed 64 bits returned as a possibly unsafe + * JavaScript number + */ + sfixed64Number() { + return this.readFixed64().toNumber(); + } + /** + * Reads zig-zag encoded fixed 64 bits returned as a string + */ + sfixed64String() { + return this.readFixed64().toString(); } } -//# sourceMappingURL=dir-flat.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bytes.js -const unixfs_node_modules_multiformats_src_bytes_empty = new Uint8Array(0) - -/** - * @param {Uint8Array} d - */ -const unixfs_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') - -/** - * @param {string} hex - */ -const unixfs_node_modules_multiformats_src_bytes_fromHex = hex => { - const hexes = hex.match(/../g) - return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : unixfs_node_modules_multiformats_src_bytes_empty +function createReader(buf) { + return new Uint8ArrayReader(buf instanceof Uint8Array ? buf : buf.subarray()); } +//# sourceMappingURL=reader.js.map +;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/decode.js -/** - * @param {Uint8Array} aa - * @param {Uint8Array} bb - */ -const unixfs_node_modules_multiformats_src_bytes_equals = (aa, bb) => { - if (aa === bb) return true - if (aa.byteLength !== bb.byteLength) { - return false - } - - for (let ii = 0; ii < aa.byteLength; ii++) { - if (aa[ii] !== bb[ii]) { - return false - } - } - - return true +function decodeMessage(buf, codec) { + const reader = createReader(buf); + return codec.decode(reader); } - +//# sourceMappingURL=decode.js.map +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/uint8arrays/dist/src/util/as-uint8array.js /** - * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o - * @returns {Uint8Array} + * To guarantee Uint8Array semantics, convert nodejs Buffers + * into vanilla Uint8Arrays */ -const unixfs_node_modules_multiformats_src_bytes_coerce = o => { - if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o - if (o instanceof ArrayBuffer) return new Uint8Array(o) - if (ArrayBuffer.isView(o)) { - return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) - } - throw new Error('Unknown type, must be binary type') +function node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(buf) { + if (globalThis.Buffer != null) { + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); + } + return buf; } +//# sourceMappingURL=as-uint8array.js.map +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/uint8arrays/dist/src/alloc.js /** - * @param {any} o - * @returns {o is ArrayBuffer|ArrayBufferView} - */ -const unixfs_node_modules_multiformats_src_bytes_isBinary = o => - o instanceof ArrayBuffer || ArrayBuffer.isView(o) - -/** - * @param {string} str - * @returns {Uint8Array} + * Returns a `Uint8Array` of the requested size. Referenced memory will + * be initialized to 0. */ -const unixfs_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) - +function protons_runtime_node_modules_uint8arrays_dist_src_alloc_alloc(size = 0) { + if (globalThis.Buffer?.alloc != null) { + return asUint8Array(globalThis.Buffer.alloc(size)); + } + return new Uint8Array(size); +} /** - * @param {Uint8Array} b - * @returns {string} + * Where possible returns a Uint8Array of the requested size that references + * uninitialized memory. Only use if you are certain you will immediately + * overwrite every value in the returned `Uint8Array`. */ -const unixfs_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) - - - -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/vendor/base-x.js +function node_modules_uint8arrays_dist_src_alloc_allocUnsafe(size = 0) { + if (globalThis.Buffer?.allocUnsafe != null) { + return node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.allocUnsafe(size)); + } + return new Uint8Array(size); +} +//# sourceMappingURL=alloc.js.map +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/vendor/base-x.js // base-x encoding / decoding // Copyright (c) 2018 base-x contributors // Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) // Distributed under the MIT software license, see the accompanying // file LICENSE or http://www.opensource.org/licenses/mit-license.php. -function unixfs_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { +function protons_runtime_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } var BASE_MAP = new Uint8Array(256); for (var j = 0; j < BASE_MAP.length; j++) { @@ -257842,10496 +183101,11710 @@ function unixfs_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { decode: decode } } -var unixfs_node_modules_multiformats_vendor_base_x_src = unixfs_node_modules_multiformats_vendor_base_x_base; +var protons_runtime_node_modules_multiformats_vendor_base_x_src = protons_runtime_node_modules_multiformats_vendor_base_x_base; + +var protons_runtime_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = protons_runtime_node_modules_multiformats_vendor_base_x_src; + +/* harmony default export */ const protons_runtime_node_modules_multiformats_vendor_base_x = (protons_runtime_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX); + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bytes.js +const protons_runtime_node_modules_multiformats_src_bytes_empty = new Uint8Array(0) + +/** + * @param {Uint8Array} d + */ +const protons_runtime_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') + +/** + * @param {string} hex + */ +const protons_runtime_node_modules_multiformats_src_bytes_fromHex = hex => { + const hexes = hex.match(/../g) + return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : protons_runtime_node_modules_multiformats_src_bytes_empty +} + +/** + * @param {Uint8Array} aa + * @param {Uint8Array} bb + */ +const protons_runtime_node_modules_multiformats_src_bytes_equals = (aa, bb) => { + if (aa === bb) return true + if (aa.byteLength !== bb.byteLength) { + return false + } + + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false + } + } + + return true +} + +/** + * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o + * @returns {Uint8Array} + */ +const protons_runtime_node_modules_multiformats_src_bytes_coerce = o => { + if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o + if (o instanceof ArrayBuffer) return new Uint8Array(o) + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) + } + throw new Error('Unknown type, must be binary type') +} + +/** + * @param {any} o + * @returns {o is ArrayBuffer|ArrayBufferView} + */ +const protons_runtime_node_modules_multiformats_src_bytes_isBinary = o => + o instanceof ArrayBuffer || ArrayBuffer.isView(o) + +/** + * @param {string} str + * @returns {Uint8Array} + */ +const protons_runtime_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) + +/** + * @param {Uint8Array} b + * @returns {string} + */ +const protons_runtime_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) + + + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base.js + + +// Linter can't see that API is used in types. +// eslint-disable-next-line + + +/** + * Class represents both BaseEncoder and MultibaseEncoder meaning it + * can be used to encode to multibase or base encode without multibase + * prefix. + * + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseEncoder} + * @implements {API.BaseEncoder} + */ +class protons_runtime_node_modules_multiformats_src_bases_base_Encoder { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(bytes:Uint8Array) => string} baseEncode + */ + constructor (name, prefix, baseEncode) { + this.name = name + this.prefix = prefix + this.baseEncode = baseEncode + } + + /** + * @param {Uint8Array} bytes + * @returns {API.Multibase} + */ + encode (bytes) { + if (bytes instanceof Uint8Array) { + return `${this.prefix}${this.baseEncode(bytes)}` + } else { + throw Error('Unknown type, must be binary type') + } + } +} + +/** + * @template {string} Prefix + */ +/** + * Class represents both BaseDecoder and MultibaseDecoder so it could be used + * to decode multibases (with matching prefix) or just base decode strings + * with corresponding base encoding. + * + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseDecoder} + * @implements {API.UnibaseDecoder} + * @implements {API.BaseDecoder} + */ +class protons_runtime_node_modules_multiformats_src_bases_base_Decoder { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(text:string) => Uint8Array} baseDecode + */ + constructor (name, prefix, baseDecode) { + this.name = name + this.prefix = prefix + /* c8 ignore next 3 */ + if (prefix.codePointAt(0) === undefined) { + throw new Error('Invalid prefix character') + } + /** @private */ + this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0)) + this.baseDecode = baseDecode + } + + /** + * @param {string} text + */ + decode (text) { + if (typeof text === 'string') { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`) + } + return this.baseDecode(text.slice(this.prefix.length)) + } else { + throw Error('Can only multibase decode strings') + } + } + + /** + * @template {string} OtherPrefix + * @param {API.UnibaseDecoder|ComposedDecoder} decoder + * @returns {ComposedDecoder} + */ + or (decoder) { + return protons_runtime_node_modules_multiformats_src_bases_base_or(this, decoder) + } +} + +/** + * @template {string} Prefix + * @typedef {Record>} Decoders + */ + +/** + * @template {string} Prefix + * @implements {API.MultibaseDecoder} + * @implements {API.CombobaseDecoder} + */ +class protons_runtime_node_modules_multiformats_src_bases_base_ComposedDecoder { + /** + * @param {Decoders} decoders + */ + constructor (decoders) { + this.decoders = decoders + } + + /** + * @template {string} OtherPrefix + * @param {API.UnibaseDecoder|ComposedDecoder} decoder + * @returns {ComposedDecoder} + */ + or (decoder) { + return protons_runtime_node_modules_multiformats_src_bases_base_or(this, decoder) + } + + /** + * @param {string} input + * @returns {Uint8Array} + */ + decode (input) { + const prefix = /** @type {Prefix} */ (input[0]) + const decoder = this.decoders[prefix] + if (decoder) { + return decoder.decode(input) + } else { + throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`) + } + } +} + +/** + * @template {string} L + * @template {string} R + * @param {API.UnibaseDecoder|API.CombobaseDecoder} left + * @param {API.UnibaseDecoder|API.CombobaseDecoder} right + * @returns {ComposedDecoder} + */ +const protons_runtime_node_modules_multiformats_src_bases_base_or = (left, right) => new protons_runtime_node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({ + ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }), + ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right }) +})) + +/** + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseCodec} + * @implements {API.MultibaseEncoder} + * @implements {API.MultibaseDecoder} + * @implements {API.BaseCodec} + * @implements {API.BaseEncoder} + * @implements {API.BaseDecoder} + */ +class protons_runtime_node_modules_multiformats_src_bases_base_Codec { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(bytes:Uint8Array) => string} baseEncode + * @param {(text:string) => Uint8Array} baseDecode + */ + constructor (name, prefix, baseEncode, baseDecode) { + this.name = name + this.prefix = prefix + this.baseEncode = baseEncode + this.baseDecode = baseDecode + this.encoder = new protons_runtime_node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode) + this.decoder = new protons_runtime_node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode) + } + + /** + * @param {Uint8Array} input + */ + encode (input) { + return this.encoder.encode(input) + } + + /** + * @param {string} input + */ + decode (input) { + return this.decoder.decode(input) + } +} + +/** + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {(bytes:Uint8Array) => string} options.encode + * @param {(input:string) => Uint8Array} options.decode + * @returns {Codec} + */ +const protons_runtime_node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) => + new protons_runtime_node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode) + +/** + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {string} options.alphabet + * @returns {Codec} + */ +const protons_runtime_node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => { + const { encode, decode } = protons_runtime_node_modules_multiformats_vendor_base_x(alphabet, name) + return protons_runtime_node_modules_multiformats_src_bases_base_from({ + prefix, + name, + encode, + /** + * @param {string} text + */ + decode: text => protons_runtime_node_modules_multiformats_src_bytes_coerce(decode(text)) + }) +} + +/** + * @param {string} string + * @param {string} alphabet + * @param {number} bitsPerChar + * @param {string} name + * @returns {Uint8Array} + */ +const protons_runtime_node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { + // Build the character lookup table: + /** @type {Record} */ + const codes = {} + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i + } + + // Count the padding bytes: + let end = string.length + while (string[end - 1] === '=') { + --end + } + + // Allocate the output: + const out = new Uint8Array((end * bitsPerChar / 8) | 0) + + // Parse the data: + let bits = 0 // Number of bits currently in the buffer + let buffer = 0 // Bits waiting to be written out, MSB first + let written = 0 // Next byte to write + for (let i = 0; i < end; ++i) { + // Read one character from the string: + const value = codes[string[i]] + if (value === undefined) { + throw new SyntaxError(`Non-${name} character`) + } + + // Append the bits to the buffer: + buffer = (buffer << bitsPerChar) | value + bits += bitsPerChar + + // Write out some bits if the buffer has a byte's worth: + if (bits >= 8) { + bits -= 8 + out[written++] = 0xff & (buffer >> bits) + } + } + + // Verify that we have received just enough bits: + if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) { + throw new SyntaxError('Unexpected end of data') + } + + return out +} + +/** + * @param {Uint8Array} data + * @param {string} alphabet + * @param {number} bitsPerChar + * @returns {string} + */ +const protons_runtime_node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => { + const pad = alphabet[alphabet.length - 1] === '=' + const mask = (1 << bitsPerChar) - 1 + let out = '' + + let bits = 0 // Number of bits currently in the buffer + let buffer = 0 // Bits waiting to be written out, MSB first + for (let i = 0; i < data.length; ++i) { + // Slurp data into the buffer: + buffer = (buffer << 8) | data[i] + bits += 8 + + // Write out as much as we can: + while (bits > bitsPerChar) { + bits -= bitsPerChar + out += alphabet[mask & (buffer >> bits)] + } + } + + // Partial character: + if (bits) { + out += alphabet[mask & (buffer << (bitsPerChar - bits))] + } + + // Add padding characters until we hit a byte boundary: + if (pad) { + while ((out.length * bitsPerChar) & 7) { + out += '=' + } + } + + return out +} + +/** + * RFC4648 Factory + * + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {string} options.alphabet + * @param {number} options.bitsPerChar + */ +const protons_runtime_node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { + return protons_runtime_node_modules_multiformats_src_bases_base_from({ + prefix, + name, + encode (input) { + return protons_runtime_node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar) + }, + decode (input) { + return protons_runtime_node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name) + } + }) +} + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base10.js + + +const protons_runtime_node_modules_multiformats_src_bases_base10_base10 = protons_runtime_node_modules_multiformats_src_bases_base_baseX({ + prefix: '9', + name: 'base10', + alphabet: '0123456789' +}) + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base16.js +// @ts-check + + + +const protons_runtime_node_modules_multiformats_src_bases_base16_base16 = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'f', + name: 'base16', + alphabet: '0123456789abcdef', + bitsPerChar: 4 +}) + +const protons_runtime_node_modules_multiformats_src_bases_base16_base16upper = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'F', + name: 'base16upper', + alphabet: '0123456789ABCDEF', + bitsPerChar: 4 +}) + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base2.js +// @ts-check + + + +const protons_runtime_node_modules_multiformats_src_bases_base2_base2 = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: '0', + name: 'base2', + alphabet: '01', + bitsPerChar: 1 +}) + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base256emoji.js + + +const protons_runtime_node_modules_multiformats_src_bases_base256emoji_alphabet = Array.from('🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂') +const protons_runtime_node_modules_multiformats_src_bases_base256emoji_alphabetBytesToChars = /** @type {string[]} */ (protons_runtime_node_modules_multiformats_src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[i] = c; return p }, /** @type {string[]} */([]))) +const protons_runtime_node_modules_multiformats_src_bases_base256emoji_alphabetCharsToBytes = /** @type {number[]} */ (protons_runtime_node_modules_multiformats_src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[/** @type {number} */ (c.codePointAt(0))] = i; return p }, /** @type {number[]} */([]))) + +/** + * @param {Uint8Array} data + * @returns {string} + */ +function protons_runtime_node_modules_multiformats_src_bases_base256emoji_encode (data) { + return data.reduce((p, c) => { + p += protons_runtime_node_modules_multiformats_src_bases_base256emoji_alphabetBytesToChars[c] + return p + }, '') +} + +/** + * @param {string} str + * @returns {Uint8Array} + */ +function protons_runtime_node_modules_multiformats_src_bases_base256emoji_decode (str) { + const byts = [] + for (const char of str) { + const byt = protons_runtime_node_modules_multiformats_src_bases_base256emoji_alphabetCharsToBytes[/** @type {number} */ (char.codePointAt(0))] + if (byt === undefined) { + throw new Error(`Non-base256emoji character: ${char}`) + } + byts.push(byt) + } + return new Uint8Array(byts) +} + +const protons_runtime_node_modules_multiformats_src_bases_base256emoji_base256emoji = protons_runtime_node_modules_multiformats_src_bases_base_from({ + prefix: '🚀', + name: 'base256emoji', + encode: protons_runtime_node_modules_multiformats_src_bases_base256emoji_encode, + decode: protons_runtime_node_modules_multiformats_src_bases_base256emoji_decode +}) + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base32.js + + +const protons_runtime_node_modules_multiformats_src_bases_base32_base32 = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'b', + name: 'base32', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567', + bitsPerChar: 5 +}) + +const protons_runtime_node_modules_multiformats_src_bases_base32_base32upper = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'B', + name: 'base32upper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', + bitsPerChar: 5 +}) + +const protons_runtime_node_modules_multiformats_src_bases_base32_base32pad = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'c', + name: 'base32pad', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', + bitsPerChar: 5 +}) + +const protons_runtime_node_modules_multiformats_src_bases_base32_base32padupper = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'C', + name: 'base32padupper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', + bitsPerChar: 5 +}) + +const protons_runtime_node_modules_multiformats_src_bases_base32_base32hex = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'v', + name: 'base32hex', + alphabet: '0123456789abcdefghijklmnopqrstuv', + bitsPerChar: 5 +}) + +const protons_runtime_node_modules_multiformats_src_bases_base32_base32hexupper = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'V', + name: 'base32hexupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', + bitsPerChar: 5 +}) + +const protons_runtime_node_modules_multiformats_src_bases_base32_base32hexpad = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 't', + name: 'base32hexpad', + alphabet: '0123456789abcdefghijklmnopqrstuv=', + bitsPerChar: 5 +}) + +const protons_runtime_node_modules_multiformats_src_bases_base32_base32hexpadupper = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'T', + name: 'base32hexpadupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', + bitsPerChar: 5 +}) + +const protons_runtime_node_modules_multiformats_src_bases_base32_base32z = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'h', + name: 'base32z', + alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', + bitsPerChar: 5 +}) + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base36.js + + +const protons_runtime_node_modules_multiformats_src_bases_base36_base36 = protons_runtime_node_modules_multiformats_src_bases_base_baseX({ + prefix: 'k', + name: 'base36', + alphabet: '0123456789abcdefghijklmnopqrstuvwxyz' +}) + +const protons_runtime_node_modules_multiformats_src_bases_base36_base36upper = protons_runtime_node_modules_multiformats_src_bases_base_baseX({ + prefix: 'K', + name: 'base36upper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' +}) + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base58.js + + +const protons_runtime_node_modules_multiformats_src_bases_base58_base58btc = protons_runtime_node_modules_multiformats_src_bases_base_baseX({ + name: 'base58btc', + prefix: 'z', + alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +}) + +const protons_runtime_node_modules_multiformats_src_bases_base58_base58flickr = protons_runtime_node_modules_multiformats_src_bases_base_baseX({ + name: 'base58flickr', + prefix: 'Z', + alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' +}) + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base64.js +// @ts-check + + + +const protons_runtime_node_modules_multiformats_src_bases_base64_base64 = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'm', + name: 'base64', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + bitsPerChar: 6 +}) + +const protons_runtime_node_modules_multiformats_src_bases_base64_base64pad = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'M', + name: 'base64pad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', + bitsPerChar: 6 +}) + +const protons_runtime_node_modules_multiformats_src_bases_base64_base64url = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'u', + name: 'base64url', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', + bitsPerChar: 6 +}) + +const protons_runtime_node_modules_multiformats_src_bases_base64_base64urlpad = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'U', + name: 'base64urlpad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', + bitsPerChar: 6 +}) + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/base8.js +// @ts-check + + + +const protons_runtime_node_modules_multiformats_src_bases_base8_base8 = protons_runtime_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: '7', + name: 'base8', + alphabet: '01234567', + bitsPerChar: 3 +}) + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/bases/identity.js +// @ts-check + + + + +const protons_runtime_node_modules_multiformats_src_bases_identity_identity = protons_runtime_node_modules_multiformats_src_bases_base_from({ + prefix: '\x00', + name: 'identity', + encode: (buf) => protons_runtime_node_modules_multiformats_src_bytes_toString(buf), + decode: (str) => protons_runtime_node_modules_multiformats_src_bytes_fromString(str) +}) + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/codecs/json.js +// @ts-check + +/** + * @template T + * @typedef {import('./interface.js').ByteView} ByteView + */ + +const protons_runtime_node_modules_multiformats_src_codecs_json_textEncoder = new TextEncoder() +const protons_runtime_node_modules_multiformats_src_codecs_json_textDecoder = new TextDecoder() + +const protons_runtime_node_modules_multiformats_src_codecs_json_name = 'json' +const protons_runtime_node_modules_multiformats_src_codecs_json_code = 0x0200 + +/** + * @template T + * @param {T} node + * @returns {ByteView} + */ +const protons_runtime_node_modules_multiformats_src_codecs_json_encode = (node) => protons_runtime_node_modules_multiformats_src_codecs_json_textEncoder.encode(JSON.stringify(node)) + +/** + * @template T + * @param {ByteView} data + * @returns {T} + */ +const protons_runtime_node_modules_multiformats_src_codecs_json_decode = (data) => JSON.parse(protons_runtime_node_modules_multiformats_src_codecs_json_textDecoder.decode(data)) + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/codecs/raw.js +// @ts-check + + + +/** + * @template T + * @typedef {import('./interface.js').ByteView} ByteView + */ + +const protons_runtime_node_modules_multiformats_src_codecs_raw_name = 'raw' +const protons_runtime_node_modules_multiformats_src_codecs_raw_code = 0x55 + +/** + * @param {Uint8Array} node + * @returns {ByteView} + */ +const protons_runtime_node_modules_multiformats_src_codecs_raw_encode = (node) => protons_runtime_node_modules_multiformats_src_bytes_coerce(node) + +/** + * @param {ByteView} data + * @returns {Uint8Array} + */ +const protons_runtime_node_modules_multiformats_src_codecs_raw_decode = (data) => protons_runtime_node_modules_multiformats_src_bytes_coerce(data) + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/vendor/varint.js +var protons_runtime_node_modules_multiformats_vendor_varint_encode_1 = protons_runtime_node_modules_multiformats_vendor_varint_encode; + +var protons_runtime_node_modules_multiformats_vendor_varint_MSB = 0x80 + , protons_runtime_node_modules_multiformats_vendor_varint_REST = 0x7F + , protons_runtime_node_modules_multiformats_vendor_varint_MSBALL = ~protons_runtime_node_modules_multiformats_vendor_varint_REST + , protons_runtime_node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31); + +function protons_runtime_node_modules_multiformats_vendor_varint_encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; + + while(num >= protons_runtime_node_modules_multiformats_vendor_varint_INT) { + out[offset++] = (num & 0xFF) | protons_runtime_node_modules_multiformats_vendor_varint_MSB; + num /= 128; + } + while(num & protons_runtime_node_modules_multiformats_vendor_varint_MSBALL) { + out[offset++] = (num & 0xFF) | protons_runtime_node_modules_multiformats_vendor_varint_MSB; + num >>>= 7; + } + out[offset] = num | 0; + + protons_runtime_node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; + + return out +} + +var protons_runtime_node_modules_multiformats_vendor_varint_decode = protons_runtime_node_modules_multiformats_vendor_varint_read; + +var protons_runtime_node_modules_multiformats_vendor_varint_MSB$1 = 0x80 + , protons_runtime_node_modules_multiformats_vendor_varint_REST$1 = 0x7F; + +function protons_runtime_node_modules_multiformats_vendor_varint_read(buf, offset) { + var res = 0 + , offset = offset || 0 + , shift = 0 + , counter = offset + , b + , l = buf.length; + + do { + if (counter >= l) { + protons_runtime_node_modules_multiformats_vendor_varint_read.bytes = 0; + throw new RangeError('Could not decode varint') + } + b = buf[counter++]; + res += shift < 28 + ? (b & protons_runtime_node_modules_multiformats_vendor_varint_REST$1) << shift + : (b & protons_runtime_node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= protons_runtime_node_modules_multiformats_vendor_varint_MSB$1) + + protons_runtime_node_modules_multiformats_vendor_varint_read.bytes = counter - offset; + + return res +} + +var protons_runtime_node_modules_multiformats_vendor_varint_N1 = Math.pow(2, 7); +var protons_runtime_node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14); +var protons_runtime_node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21); +var protons_runtime_node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28); +var protons_runtime_node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35); +var protons_runtime_node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42); +var protons_runtime_node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49); +var protons_runtime_node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56); +var protons_runtime_node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63); + +var protons_runtime_node_modules_multiformats_vendor_varint_length = function (value) { + return ( + value < protons_runtime_node_modules_multiformats_vendor_varint_N1 ? 1 + : value < protons_runtime_node_modules_multiformats_vendor_varint_N2 ? 2 + : value < protons_runtime_node_modules_multiformats_vendor_varint_N3 ? 3 + : value < protons_runtime_node_modules_multiformats_vendor_varint_N4 ? 4 + : value < protons_runtime_node_modules_multiformats_vendor_varint_N5 ? 5 + : value < protons_runtime_node_modules_multiformats_vendor_varint_N6 ? 6 + : value < protons_runtime_node_modules_multiformats_vendor_varint_N7 ? 7 + : value < protons_runtime_node_modules_multiformats_vendor_varint_N8 ? 8 + : value < protons_runtime_node_modules_multiformats_vendor_varint_N9 ? 9 + : 10 + ) +}; + +var protons_runtime_node_modules_multiformats_vendor_varint_varint = { + encode: protons_runtime_node_modules_multiformats_vendor_varint_encode_1 + , decode: protons_runtime_node_modules_multiformats_vendor_varint_decode + , encodingLength: protons_runtime_node_modules_multiformats_vendor_varint_length +}; + +var protons_runtime_node_modules_multiformats_vendor_varint_brrp_varint = protons_runtime_node_modules_multiformats_vendor_varint_varint; + +/* harmony default export */ const protons_runtime_node_modules_multiformats_vendor_varint = (protons_runtime_node_modules_multiformats_vendor_varint_brrp_varint); + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/varint.js + + +/** + * @param {Uint8Array} data + * @param {number} [offset=0] + * @returns {[number, number]} + */ +const protons_runtime_node_modules_multiformats_src_varint_decode = (data, offset = 0) => { + const code = varint.decode(data, offset) + return [code, varint.decode.bytes] +} + +/** + * @param {number} int + * @param {Uint8Array} target + * @param {number} [offset=0] + */ +const protons_runtime_node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => { + protons_runtime_node_modules_multiformats_vendor_varint.encode(int, target, offset) + return target +} + +/** + * @param {number} int + * @returns {number} + */ +const protons_runtime_node_modules_multiformats_src_varint_encodingLength = (int) => { + return protons_runtime_node_modules_multiformats_vendor_varint.encodingLength(int) +} + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/hashes/digest.js + + + +/** + * Creates a multihash digest. + * + * @template {number} Code + * @param {Code} code + * @param {Uint8Array} digest + */ +const protons_runtime_node_modules_multiformats_src_hashes_digest_create = (code, digest) => { + const size = digest.byteLength + const sizeOffset = protons_runtime_node_modules_multiformats_src_varint_encodingLength(code) + const digestOffset = sizeOffset + protons_runtime_node_modules_multiformats_src_varint_encodingLength(size) + + const bytes = new Uint8Array(digestOffset + size) + protons_runtime_node_modules_multiformats_src_varint_encodeTo(code, bytes, 0) + protons_runtime_node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset) + bytes.set(digest, digestOffset) + + return new protons_runtime_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) +} + +/** + * Turns bytes representation of multihash digest into an instance. + * + * @param {Uint8Array} multihash + * @returns {MultihashDigest} + */ +const protons_runtime_node_modules_multiformats_src_hashes_digest_decode = (multihash) => { + const bytes = coerce(multihash) + const [code, sizeOffset] = varint.decode(bytes) + const [size, digestOffset] = varint.decode(bytes.subarray(sizeOffset)) + const digest = bytes.subarray(sizeOffset + digestOffset) + + if (digest.byteLength !== size) { + throw new Error('Incorrect length') + } + + return new protons_runtime_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) +} + +/** + * @param {MultihashDigest} a + * @param {unknown} b + * @returns {b is MultihashDigest} + */ +const protons_runtime_node_modules_multiformats_src_hashes_digest_equals = (a, b) => { + if (a === b) { + return true + } else { + const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) + + return ( + a.code === data.code && + a.size === data.size && + data.bytes instanceof Uint8Array && + equalBytes(a.bytes, data.bytes) + ) + } +} + +/** + * @typedef {import('./interface.js').MultihashDigest} MultihashDigest + */ + +/** + * Represents a multihash digest which carries information about the + * hashing algorithm and an actual hash digest. + * + * @template {number} Code + * @template {number} Size + * @class + * @implements {MultihashDigest} + */ +class protons_runtime_node_modules_multiformats_src_hashes_digest_Digest { + /** + * Creates a multihash digest. + * + * @param {Code} code + * @param {Size} size + * @param {Uint8Array} digest + * @param {Uint8Array} bytes + */ + constructor (code, size, digest, bytes) { + this.code = code + this.size = size + this.digest = digest + this.bytes = bytes + } +} + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/hashes/identity.js + + + +const protons_runtime_node_modules_multiformats_src_hashes_identity_code = 0x0 +const protons_runtime_node_modules_multiformats_src_hashes_identity_name = 'identity' + +/** @type {(input:Uint8Array) => Uint8Array} */ +const protons_runtime_node_modules_multiformats_src_hashes_identity_encode = protons_runtime_node_modules_multiformats_src_bytes_coerce + +/** + * @param {Uint8Array} input + * @returns {Digest.Digest} + */ +const protons_runtime_node_modules_multiformats_src_hashes_identity_digest = (input) => protons_runtime_node_modules_multiformats_src_hashes_digest_create(protons_runtime_node_modules_multiformats_src_hashes_identity_code, protons_runtime_node_modules_multiformats_src_hashes_identity_encode(input)) + +const protons_runtime_node_modules_multiformats_src_hashes_identity_identity = { code: protons_runtime_node_modules_multiformats_src_hashes_identity_code, name: protons_runtime_node_modules_multiformats_src_hashes_identity_name, encode: protons_runtime_node_modules_multiformats_src_hashes_identity_encode, digest: protons_runtime_node_modules_multiformats_src_hashes_identity_digest } + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/hashes/hasher.js + + +/** + * @template {string} Name + * @template {number} Code + * @param {object} options + * @param {Name} options.name + * @param {Code} options.code + * @param {(input: Uint8Array) => Await} options.encode + */ +const protons_runtime_node_modules_multiformats_src_hashes_hasher_from = ({ name, code, encode }) => new protons_runtime_node_modules_multiformats_src_hashes_hasher_Hasher(name, code, encode) + +/** + * Hasher represents a hashing algorithm implementation that produces as + * `MultihashDigest`. + * + * @template {string} Name + * @template {number} Code + * @class + * @implements {MultihashHasher} + */ +class protons_runtime_node_modules_multiformats_src_hashes_hasher_Hasher { + /** + * + * @param {Name} name + * @param {Code} code + * @param {(input: Uint8Array) => Await} encode + */ + constructor (name, code, encode) { + this.name = name + this.code = code + this.encode = encode + } + + /** + * @param {Uint8Array} input + * @returns {Await>} + */ + digest (input) { + if (input instanceof Uint8Array) { + const result = this.encode(input) + return result instanceof Uint8Array + ? protons_runtime_node_modules_multiformats_src_hashes_digest_create(this.code, result) + /* c8 ignore next 1 */ + : result.then(digest => protons_runtime_node_modules_multiformats_src_hashes_digest_create(this.code, digest)) + } else { + throw Error('Unknown type, must be binary type') + /* c8 ignore next 1 */ + } + } +} -var unixfs_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = unixfs_node_modules_multiformats_vendor_base_x_src; +/** + * @template {number} Alg + * @typedef {import('./interface.js').MultihashHasher} MultihashHasher + */ -/* harmony default export */ const unixfs_node_modules_multiformats_vendor_base_x = (unixfs_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX); +/** + * @template T + * @typedef {Promise|T} Await + */ -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base.js +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/hashes/sha2.js +// @ts-check -// Linter can't see that API is used in types. + + + +const protons_runtime_node_modules_multiformats_src_hashes_sha2_sha256 = protons_runtime_node_modules_multiformats_src_hashes_hasher_from({ + name: 'sha2-256', + code: 0x12, + encode: (input) => protons_runtime_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha256').update(input).digest()) +}) + +const protons_runtime_node_modules_multiformats_src_hashes_sha2_sha512 = protons_runtime_node_modules_multiformats_src_hashes_hasher_from({ + name: 'sha2-512', + code: 0x13, + encode: input => protons_runtime_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha512').update(input).digest()) +}) + +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/cid.js + + + + +// Linter can see that API is used in types. // eslint-disable-next-line + +// This way TS will also expose all the types from module + + /** - * Class represents both BaseEncoder and MultibaseEncoder meaning it - * can be used to encode to multibase or base encode without multibase - * prefix. - * - * @class - * @template {string} Base + * @template {API.Link} T * @template {string} Prefix - * @implements {API.MultibaseEncoder} - * @implements {API.BaseEncoder} + * @param {T} link + * @param {API.MultibaseEncoder} [base] + * @returns {API.ToString} */ -class unixfs_node_modules_multiformats_src_bases_base_Encoder { +const protons_runtime_node_modules_multiformats_src_cid_format = (link, base) => { + const { bytes, version } = link + switch (version) { + case 0: + return protons_runtime_node_modules_multiformats_src_cid_toStringV0( + bytes, + protons_runtime_node_modules_multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder<"z">} */ (base) || base58btc.encoder + ) + default: + return protons_runtime_node_modules_multiformats_src_cid_toStringV1( + bytes, + protons_runtime_node_modules_multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder} */ (base || base32.encoder) + ) + } +} + +/** + * @template {API.UnknownLink} Link + * @param {Link} link + * @returns {API.LinkJSON} + */ +const protons_runtime_node_modules_multiformats_src_cid_toJSON = (link) => ({ + '/': protons_runtime_node_modules_multiformats_src_cid_format(link) +}) + +/** + * @template {API.UnknownLink} Link + * @param {API.LinkJSON} json + */ +const protons_runtime_node_modules_multiformats_src_cid_fromJSON = (json) => + protons_runtime_node_modules_multiformats_src_cid_CID.parse(json['/']) + +/** @type {WeakMap>} */ +const protons_runtime_node_modules_multiformats_src_cid_cache = new WeakMap() + +/** + * @param {API.UnknownLink} cid + * @returns {Map} + */ +const protons_runtime_node_modules_multiformats_src_cid_baseCache = cid => { + const baseCache = protons_runtime_node_modules_multiformats_src_cid_cache.get(cid) + if (baseCache == null) { + const baseCache = new Map() + protons_runtime_node_modules_multiformats_src_cid_cache.set(cid, baseCache) + return baseCache + } + return baseCache +} + +/** + * @template {unknown} [Data=unknown] + * @template {number} [Format=number] + * @template {number} [Alg=number] + * @template {API.Version} [Version=API.Version] + * @implements {API.Link} + */ + +class protons_runtime_node_modules_multiformats_src_cid_CID { /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(bytes:Uint8Array) => string} baseEncode + * @param {Version} version - Version of the CID + * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content. + * @param {Uint8Array} bytes */ - constructor (name, prefix, baseEncode) { - this.name = name - this.prefix = prefix - this.baseEncode = baseEncode + constructor (version, code, multihash, bytes) { + /** @readonly */ + this.code = code + /** @readonly */ + this.version = version + /** @readonly */ + this.multihash = multihash + /** @readonly */ + this.bytes = bytes + + // flag to serializers that this is a CID and + // should be treated specially + /** @readonly */ + this['/'] = bytes } /** - * @param {Uint8Array} bytes - * @returns {API.Multibase} + * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` + * please either use `CID.asCID(cid)` or switch to new signalling mechanism + * + * @deprecated */ - encode (bytes) { - if (bytes instanceof Uint8Array) { - return `${this.prefix}${this.baseEncode(bytes)}` - } else { - throw Error('Unknown type, must be binary type') - } + get asCID () { + return this + } + + // ArrayBufferView + get byteOffset () { + return this.bytes.byteOffset + } + + // ArrayBufferView + get byteLength () { + return this.bytes.byteLength } -} -/** - * @template {string} Prefix - */ -/** - * Class represents both BaseDecoder and MultibaseDecoder so it could be used - * to decode multibases (with matching prefix) or just base decode strings - * with corresponding base encoding. - * - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseDecoder} - * @implements {API.UnibaseDecoder} - * @implements {API.BaseDecoder} - */ -class unixfs_node_modules_multiformats_src_bases_base_Decoder { /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(text:string) => Uint8Array} baseDecode + * @returns {CID} */ - constructor (name, prefix, baseDecode) { - this.name = name - this.prefix = prefix - /* c8 ignore next 3 */ - if (prefix.codePointAt(0) === undefined) { - throw new Error('Invalid prefix character') + toV0 () { + switch (this.version) { + case 0: { + return /** @type {CID} */ (this) + } + case 1: { + const { code, multihash } = this + + if (code !== protons_runtime_node_modules_multiformats_src_cid_DAG_PB_CODE) { + throw new Error('Cannot convert a non dag-pb CID to CIDv0') + } + + // sha2-256 + if (multihash.code !== protons_runtime_node_modules_multiformats_src_cid_SHA_256_CODE) { + throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') + } + + return /** @type {CID} */ ( + protons_runtime_node_modules_multiformats_src_cid_CID.createV0( + /** @type {API.MultihashDigest} */ (multihash) + ) + ) + } + default: { + throw Error( + `Can not convert CID version ${this.version} to version 0. This is a bug please report` + ) + } } - /** @private */ - this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0)) - this.baseDecode = baseDecode } /** - * @param {string} text + * @returns {CID} */ - decode (text) { - if (typeof text === 'string') { - if (text.codePointAt(0) !== this.prefixCodePoint) { - throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`) + toV1 () { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash + const multihash = Digest.create(code, digest) + return /** @type {CID} */ ( + protons_runtime_node_modules_multiformats_src_cid_CID.createV1(this.code, multihash) + ) + } + case 1: { + return /** @type {CID} */ (this) + } + default: { + throw Error( + `Can not convert CID version ${this.version} to version 1. This is a bug please report` + ) } - return this.baseDecode(text.slice(this.prefix.length)) - } else { - throw Error('Can only multibase decode strings') } } /** - * @template {string} OtherPrefix - * @param {API.UnibaseDecoder|ComposedDecoder} decoder - * @returns {ComposedDecoder} + * @param {unknown} other + * @returns {other is CID} */ - or (decoder) { - return unixfs_node_modules_multiformats_src_bases_base_or(this, decoder) + equals (other) { + return protons_runtime_node_modules_multiformats_src_cid_CID.equals(this, other) } -} -/** - * @template {string} Prefix - * @typedef {Record>} Decoders - */ + /** + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @param {API.Link} self + * @param {unknown} other + * @returns {other is CID} + */ + static equals (self, other) { + const unknown = + /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ ( + other + ) + return ( + unknown && + self.code === unknown.code && + self.version === unknown.version && + Digest.equals(self.multihash, unknown.multihash) + ) + } -/** - * @template {string} Prefix - * @implements {API.MultibaseDecoder} - * @implements {API.CombobaseDecoder} - */ -class unixfs_node_modules_multiformats_src_bases_base_ComposedDecoder { /** - * @param {Decoders} decoders + * @param {API.MultibaseEncoder} [base] + * @returns {string} */ - constructor (decoders) { - this.decoders = decoders + toString (base) { + return protons_runtime_node_modules_multiformats_src_cid_format(this, base) } /** - * @template {string} OtherPrefix - * @param {API.UnibaseDecoder|ComposedDecoder} decoder - * @returns {ComposedDecoder} + * @returns {API.LinkJSON} */ - or (decoder) { - return unixfs_node_modules_multiformats_src_bases_base_or(this, decoder) + toJSON () { + return { '/': protons_runtime_node_modules_multiformats_src_cid_format(this) } + } + + link () { + return this + } + + get [Symbol.toStringTag] () { + return 'CID' + } + + // Legacy + + [Symbol.for('nodejs.util.inspect.custom')] () { + return `CID(${this.toString()})` } /** - * @param {string} input - * @returns {Uint8Array} + * Takes any input `value` and returns a `CID` instance if it was + * a `CID` otherwise returns `null`. If `value` is instanceof `CID` + * it will return value back. If `value` is not instance of this CID + * class, but is compatible CID it will return new instance of this + * `CID` class. Otherwise returns null. + * + * This allows two different incompatible versions of CID library to + * co-exist and interop as long as binary interface is compatible. + * + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @template {unknown} U + * @param {API.Link|U} input + * @returns {CID|null} */ - decode (input) { - const prefix = /** @type {Prefix} */ (input[0]) - const decoder = this.decoders[prefix] - if (decoder) { - return decoder.decode(input) + static asCID (input) { + if (input == null) { + return null + } + + const value = /** @type {any} */ (input) + if (value instanceof protons_runtime_node_modules_multiformats_src_cid_CID) { + // If value is instance of CID then we're all set. + return value + } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { + // If value isn't instance of this CID class but `this.asCID === this` or + // `value['/'] === value.bytes` is true it is CID instance coming from a + // different implementation (diff version or duplicate). In that case we + // rebase it to this `CID` implementation so caller is guaranteed to get + // instance with expected API. + const { version, code, multihash, bytes } = value + return new protons_runtime_node_modules_multiformats_src_cid_CID( + version, + code, + /** @type {API.MultihashDigest} */ (multihash), + bytes || protons_runtime_node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes) + ) + } else if (value[protons_runtime_node_modules_multiformats_src_cid_cidSymbol] === true) { + // If value is a CID from older implementation that used to be tagged via + // symbol we still rebase it to the this `CID` implementation by + // delegating that to a constructor. + const { version, multihash, code } = value + const digest = + /** @type {API.MultihashDigest} */ + (Digest.decode(multihash)) + return protons_runtime_node_modules_multiformats_src_cid_CID.create(version, code, digest) } else { - throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`) + // Otherwise value is not a CID (or an incompatible version of it) in + // which case we return `null`. + return null } } -} - -/** - * @template {string} L - * @template {string} R - * @param {API.UnibaseDecoder|API.CombobaseDecoder} left - * @param {API.UnibaseDecoder|API.CombobaseDecoder} right - * @returns {ComposedDecoder} - */ -const unixfs_node_modules_multiformats_src_bases_base_or = (left, right) => new unixfs_node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({ - ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }), - ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right }) -})) -/** - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseCodec} - * @implements {API.MultibaseEncoder} - * @implements {API.MultibaseDecoder} - * @implements {API.BaseCodec} - * @implements {API.BaseEncoder} - * @implements {API.BaseDecoder} - */ -class unixfs_node_modules_multiformats_src_bases_base_Codec { /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(bytes:Uint8Array) => string} baseEncode - * @param {(text:string) => Uint8Array} baseDecode + * + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @param {Version} version - Version of the CID + * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param {API.MultihashDigest} digest - (Multi)hash of the of the content. + * @returns {CID} */ - constructor (name, prefix, baseEncode, baseDecode) { - this.name = name - this.prefix = prefix - this.baseEncode = baseEncode - this.baseDecode = baseDecode - this.encoder = new unixfs_node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode) - this.decoder = new unixfs_node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode) + static create (version, code, digest) { + if (typeof code !== 'number') { + throw new Error('String codecs are no longer supported') + } + + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error('Invalid digest') + } + + switch (version) { + case 0: { + if (code !== protons_runtime_node_modules_multiformats_src_cid_DAG_PB_CODE) { + throw new Error( + `Version 0 CID must use dag-pb (code: ${protons_runtime_node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding` + ) + } else { + return new protons_runtime_node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes) + } + } + case 1: { + const bytes = protons_runtime_node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes) + return new protons_runtime_node_modules_multiformats_src_cid_CID(version, code, digest, bytes) + } + default: { + throw new Error('Invalid version') + } + } } /** - * @param {Uint8Array} input + * Simplified version of `create` for CIDv0. + * + * @template {unknown} [T=unknown] + * @param {API.MultihashDigest} digest - Multihash. + * @returns {CID} */ - encode (input) { - return this.encoder.encode(input) + static createV0 (digest) { + return protons_runtime_node_modules_multiformats_src_cid_CID.create(0, protons_runtime_node_modules_multiformats_src_cid_DAG_PB_CODE, digest) } /** - * @param {string} input + * Simplified version of `create` for CIDv1. + * + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @param {Code} code - Content encoding format code. + * @param {API.MultihashDigest} digest - Miltihash of the content. + * @returns {CID} */ - decode (input) { - return this.decoder.decode(input) + static createV1 (code, digest) { + return protons_runtime_node_modules_multiformats_src_cid_CID.create(1, code, digest) } -} - -/** - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {(bytes:Uint8Array) => string} options.encode - * @param {(input:string) => Uint8Array} options.decode - * @returns {Codec} - */ -const unixfs_node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) => - new unixfs_node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode) - -/** - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {string} options.alphabet - * @returns {Codec} - */ -const unixfs_node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => { - const { encode, decode } = unixfs_node_modules_multiformats_vendor_base_x(alphabet, name) - return unixfs_node_modules_multiformats_src_bases_base_from({ - prefix, - name, - encode, - /** - * @param {string} text - */ - decode: text => unixfs_node_modules_multiformats_src_bytes_coerce(decode(text)) - }) -} -/** - * @param {string} string - * @param {string} alphabet - * @param {number} bitsPerChar - * @param {string} name - * @returns {Uint8Array} - */ -const unixfs_node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { - // Build the character lookup table: - /** @type {Record} */ - const codes = {} - for (let i = 0; i < alphabet.length; ++i) { - codes[alphabet[i]] = i + /** + * Decoded a CID from its binary representation. The byte array must contain + * only the CID with no additional bytes. + * + * An error will be thrown if the bytes provided do not contain a valid + * binary representation of a CID. + * + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ByteView>} bytes + * @returns {CID} + */ + static decode (bytes) { + const [cid, remainder] = protons_runtime_node_modules_multiformats_src_cid_CID.decodeFirst(bytes) + if (remainder.length) { + throw new Error('Incorrect length') + } + return cid } - // Count the padding bytes: - let end = string.length - while (string[end - 1] === '=') { - --end + /** + * Decoded a CID from its binary representation at the beginning of a byte + * array. + * + * Returns an array with the first element containing the CID and the second + * element containing the remainder of the original byte array. The remainder + * will be a zero-length byte array if the provided bytes only contained a + * binary CID representation. + * + * @template {unknown} T + * @template {number} C + * @template {number} A + * @template {API.Version} V + * @param {API.ByteView>} bytes + * @returns {[CID, Uint8Array]} + */ + static decodeFirst (bytes) { + const specs = protons_runtime_node_modules_multiformats_src_cid_CID.inspectBytes(bytes) + const prefixSize = specs.size - specs.multihashSize + const multihashBytes = coerce( + bytes.subarray(prefixSize, prefixSize + specs.multihashSize) + ) + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error('Incorrect length') + } + const digestBytes = multihashBytes.subarray( + specs.multihashSize - specs.digestSize + ) + const digest = new Digest.Digest( + specs.multihashCode, + specs.digestSize, + digestBytes, + multihashBytes + ) + const cid = + specs.version === 0 + ? protons_runtime_node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) + : protons_runtime_node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest) + return [/** @type {CID} */(cid), bytes.subarray(specs.size)] } - // Allocate the output: - const out = new Uint8Array((end * bitsPerChar / 8) | 0) - - // Parse the data: - let bits = 0 // Number of bits currently in the buffer - let buffer = 0 // Bits waiting to be written out, MSB first - let written = 0 // Next byte to write - for (let i = 0; i < end; ++i) { - // Read one character from the string: - const value = codes[string[i]] - if (value === undefined) { - throw new SyntaxError(`Non-${name} character`) + /** + * Inspect the initial bytes of a CID to determine its properties. + * + * Involves decoding up to 4 varints. Typically this will require only 4 to 6 + * bytes but for larger multicodec code values and larger multihash digest + * lengths these varints can be quite large. It is recommended that at least + * 10 bytes be made available in the `initialBytes` argument for a complete + * inspection. + * + * @template {unknown} T + * @template {number} C + * @template {number} A + * @template {API.Version} V + * @param {API.ByteView>} initialBytes + * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }} + */ + static inspectBytes (initialBytes) { + let offset = 0 + const next = () => { + const [i, length] = varint.decode(initialBytes.subarray(offset)) + offset += length + return i } - // Append the bits to the buffer: - buffer = (buffer << bitsPerChar) | value - bits += bitsPerChar + let version = /** @type {V} */ (next()) + let codec = /** @type {C} */ (protons_runtime_node_modules_multiformats_src_cid_DAG_PB_CODE) + if (/** @type {number} */(version) === 18) { + // CIDv0 + version = /** @type {V} */ (0) + offset = 0 + } else { + codec = /** @type {C} */ (next()) + } - // Write out some bits if the buffer has a byte's worth: - if (bits >= 8) { - bits -= 8 - out[written++] = 0xff & (buffer >> bits) + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`) } - } - // Verify that we have received just enough bits: - if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) { - throw new SyntaxError('Unexpected end of data') + const prefixSize = offset + const multihashCode = /** @type {A} */ (next()) // multihash code + const digestSize = next() // multihash length + const size = offset + digestSize + const multihashSize = size - prefixSize + + return { version, codec, multihashCode, digestSize, multihashSize, size } } - return out + /** + * Takes cid in a string representation and creates an instance. If `base` + * decoder is not provided will use a default from the configuration. It will + * throw an error if encoding of the CID is not compatible with supplied (or + * a default decoder). + * + * @template {string} Prefix + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ToString, Prefix>} source + * @param {API.MultibaseDecoder} [base] + * @returns {CID} + */ + static parse (source, base) { + const [prefix, bytes] = protons_runtime_node_modules_multiformats_src_cid_parseCIDtoBytes(source, base) + + const cid = protons_runtime_node_modules_multiformats_src_cid_CID.decode(bytes) + + if (cid.version === 0 && source[0] !== 'Q') { + throw Error('Version 0 CID string must not include multibase prefix') + } + + // Cache string representation to avoid computing it on `this.toString()` + protons_runtime_node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source) + + return cid + } } /** - * @param {Uint8Array} data - * @param {string} alphabet - * @param {number} bitsPerChar - * @returns {string} + * @template {string} Prefix + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ToString, Prefix>} source + * @param {API.MultibaseDecoder} [base] + * @returns {[Prefix, API.ByteView>]} */ -const unixfs_node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => { - const pad = alphabet[alphabet.length - 1] === '=' - const mask = (1 << bitsPerChar) - 1 - let out = '' - - let bits = 0 // Number of bits currently in the buffer - let buffer = 0 // Bits waiting to be written out, MSB first - for (let i = 0; i < data.length; ++i) { - // Slurp data into the buffer: - buffer = (buffer << 8) | data[i] - bits += 8 - - // Write out as much as we can: - while (bits > bitsPerChar) { - bits -= bitsPerChar - out += alphabet[mask & (buffer >> bits)] +const protons_runtime_node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => { + switch (source[0]) { + // CIDv0 is parsed differently + case 'Q': { + const decoder = base || base58btc + return [ + /** @type {Prefix} */ (base58btc.prefix), + decoder.decode(`${base58btc.prefix}${source}`) + ] + } + case base58btc.prefix: { + const decoder = base || base58btc + return [/** @type {Prefix} */(base58btc.prefix), decoder.decode(source)] + } + case base32.prefix: { + const decoder = base || base32 + return [/** @type {Prefix} */(base32.prefix), decoder.decode(source)] + } + default: { + if (base == null) { + throw Error( + 'To parse non base32 or base58btc encoded CID multibase decoder must be provided' + ) + } + return [/** @type {Prefix} */(source[0]), base.decode(source)] } } +} - // Partial character: - if (bits) { - out += alphabet[mask & (buffer << (bitsPerChar - bits))] +/** + * + * @param {Uint8Array} bytes + * @param {Map} cache + * @param {API.MultibaseEncoder<'z'>} base + */ +const protons_runtime_node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => { + const { prefix } = base + if (prefix !== base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base.name} encoding`) } - // Add padding characters until we hit a byte boundary: - if (pad) { - while ((out.length * bitsPerChar) & 7) { - out += '=' - } + const cid = cache.get(prefix) + if (cid == null) { + const cid = base.encode(bytes).slice(1) + cache.set(prefix, cid) + return cid + } else { + return cid } - - return out } /** - * RFC4648 Factory - * - * @template {string} Base * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {string} options.alphabet - * @param {number} options.bitsPerChar + * @param {Uint8Array} bytes + * @param {Map} cache + * @param {API.MultibaseEncoder} base */ -const unixfs_node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { - return unixfs_node_modules_multiformats_src_bases_base_from({ - prefix, - name, - encode (input) { - return unixfs_node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar) - }, - decode (input) { - return unixfs_node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name) - } - }) +const protons_runtime_node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => { + const { prefix } = base + const cid = cache.get(prefix) + if (cid == null) { + const cid = base.encode(bytes) + cache.set(prefix, cid) + return cid + } else { + return cid + } } -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base32.js - +const protons_runtime_node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70 +const protons_runtime_node_modules_multiformats_src_cid_SHA_256_CODE = 0x12 -const unixfs_node_modules_multiformats_src_bases_base32_base32 = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'b', - name: 'base32', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567', - bitsPerChar: 5 -}) +/** + * @param {API.Version} version + * @param {number} code + * @param {Uint8Array} multihash + * @returns {Uint8Array} + */ +const protons_runtime_node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => { + const codeOffset = varint.encodingLength(version) + const hashOffset = codeOffset + varint.encodingLength(code) + const bytes = new Uint8Array(hashOffset + multihash.byteLength) + varint.encodeTo(version, bytes, 0) + varint.encodeTo(code, bytes, codeOffset) + bytes.set(multihash, hashOffset) + return bytes +} -const unixfs_node_modules_multiformats_src_bases_base32_base32upper = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'B', - name: 'base32upper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', - bitsPerChar: 5 -}) +const protons_runtime_node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') -const unixfs_node_modules_multiformats_src_bases_base32_base32pad = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'c', - name: 'base32pad', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', - bitsPerChar: 5 -}) +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/index.js -const unixfs_node_modules_multiformats_src_bases_base32_base32padupper = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'C', - name: 'base32padupper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', - bitsPerChar: 5 -}) -const unixfs_node_modules_multiformats_src_bases_base32_base32hex = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'v', - name: 'base32hex', - alphabet: '0123456789abcdefghijklmnopqrstuv', - bitsPerChar: 5 -}) -const unixfs_node_modules_multiformats_src_bases_base32_base32hexupper = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'V', - name: 'base32hexupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', - bitsPerChar: 5 -}) -const unixfs_node_modules_multiformats_src_bases_base32_base32hexpad = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 't', - name: 'base32hexpad', - alphabet: '0123456789abcdefghijklmnopqrstuv=', - bitsPerChar: 5 -}) -const unixfs_node_modules_multiformats_src_bases_base32_base32hexpadupper = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'T', - name: 'base32hexpadupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', - bitsPerChar: 5 -}) -const unixfs_node_modules_multiformats_src_bases_base32_base32z = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'h', - name: 'base32z', - alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', - bitsPerChar: 5 -}) +// This way TS will also expose all the types from module -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base58.js -const unixfs_node_modules_multiformats_src_bases_base58_base58btc = unixfs_node_modules_multiformats_src_bases_base_baseX({ - name: 'base58btc', - prefix: 'z', - alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -}) -const unixfs_node_modules_multiformats_src_bases_base58_base58flickr = unixfs_node_modules_multiformats_src_bases_base_baseX({ - name: 'base58flickr', - prefix: 'Z', - alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -}) +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/multiformats/src/basics.js +// @ts-check -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/vendor/varint.js -var unixfs_node_modules_multiformats_vendor_varint_encode_1 = unixfs_node_modules_multiformats_vendor_varint_encode; -var unixfs_node_modules_multiformats_vendor_varint_MSB = 0x80 - , unixfs_node_modules_multiformats_vendor_varint_REST = 0x7F - , unixfs_node_modules_multiformats_vendor_varint_MSBALL = ~unixfs_node_modules_multiformats_vendor_varint_REST - , unixfs_node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31); -function unixfs_node_modules_multiformats_vendor_varint_encode(num, out, offset) { - out = out || []; - offset = offset || 0; - var oldOffset = offset; - while(num >= unixfs_node_modules_multiformats_vendor_varint_INT) { - out[offset++] = (num & 0xFF) | unixfs_node_modules_multiformats_vendor_varint_MSB; - num /= 128; - } - while(num & unixfs_node_modules_multiformats_vendor_varint_MSBALL) { - out[offset++] = (num & 0xFF) | unixfs_node_modules_multiformats_vendor_varint_MSB; - num >>>= 7; - } - out[offset] = num | 0; - - unixfs_node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; - - return out -} -var unixfs_node_modules_multiformats_vendor_varint_decode = unixfs_node_modules_multiformats_vendor_varint_read; -var unixfs_node_modules_multiformats_vendor_varint_MSB$1 = 0x80 - , unixfs_node_modules_multiformats_vendor_varint_REST$1 = 0x7F; -function unixfs_node_modules_multiformats_vendor_varint_read(buf, offset) { - var res = 0 - , offset = offset || 0 - , shift = 0 - , counter = offset - , b - , l = buf.length; - do { - if (counter >= l) { - unixfs_node_modules_multiformats_vendor_varint_read.bytes = 0; - throw new RangeError('Could not decode varint') - } - b = buf[counter++]; - res += shift < 28 - ? (b & unixfs_node_modules_multiformats_vendor_varint_REST$1) << shift - : (b & unixfs_node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift); - shift += 7; - } while (b >= unixfs_node_modules_multiformats_vendor_varint_MSB$1) - unixfs_node_modules_multiformats_vendor_varint_read.bytes = counter - offset; - return res -} -var unixfs_node_modules_multiformats_vendor_varint_N1 = Math.pow(2, 7); -var unixfs_node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14); -var unixfs_node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21); -var unixfs_node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28); -var unixfs_node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35); -var unixfs_node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42); -var unixfs_node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49); -var unixfs_node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56); -var unixfs_node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63); -var unixfs_node_modules_multiformats_vendor_varint_length = function (value) { - return ( - value < unixfs_node_modules_multiformats_vendor_varint_N1 ? 1 - : value < unixfs_node_modules_multiformats_vendor_varint_N2 ? 2 - : value < unixfs_node_modules_multiformats_vendor_varint_N3 ? 3 - : value < unixfs_node_modules_multiformats_vendor_varint_N4 ? 4 - : value < unixfs_node_modules_multiformats_vendor_varint_N5 ? 5 - : value < unixfs_node_modules_multiformats_vendor_varint_N6 ? 6 - : value < unixfs_node_modules_multiformats_vendor_varint_N7 ? 7 - : value < unixfs_node_modules_multiformats_vendor_varint_N8 ? 8 - : value < unixfs_node_modules_multiformats_vendor_varint_N9 ? 9 - : 10 - ) -}; -var unixfs_node_modules_multiformats_vendor_varint_varint = { - encode: unixfs_node_modules_multiformats_vendor_varint_encode_1 - , decode: unixfs_node_modules_multiformats_vendor_varint_decode - , encodingLength: unixfs_node_modules_multiformats_vendor_varint_length -}; -var unixfs_node_modules_multiformats_vendor_varint_brrp_varint = unixfs_node_modules_multiformats_vendor_varint_varint; -/* harmony default export */ const unixfs_node_modules_multiformats_vendor_varint = (unixfs_node_modules_multiformats_vendor_varint_brrp_varint); -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/varint.js +const protons_runtime_node_modules_multiformats_src_basics_bases = { ...protons_runtime_node_modules_multiformats_src_bases_identity_namespaceObject, ...protons_runtime_node_modules_multiformats_src_bases_base2_namespaceObject, ...protons_runtime_node_modules_multiformats_src_bases_base8_namespaceObject, ...protons_runtime_node_modules_multiformats_src_bases_base10_namespaceObject, ...protons_runtime_node_modules_multiformats_src_bases_base16_namespaceObject, ...protons_runtime_node_modules_multiformats_src_bases_base32_namespaceObject, ...protons_runtime_node_modules_multiformats_src_bases_base36_namespaceObject, ...protons_runtime_node_modules_multiformats_src_bases_base58_namespaceObject, ...protons_runtime_node_modules_multiformats_src_bases_base64_namespaceObject, ...protons_runtime_node_modules_multiformats_src_bases_base256emoji_namespaceObject } +const protons_runtime_node_modules_multiformats_src_basics_hashes = { ...protons_runtime_node_modules_multiformats_src_hashes_sha2_namespaceObject, ...protons_runtime_node_modules_multiformats_src_hashes_identity_namespaceObject } +const protons_runtime_node_modules_multiformats_src_basics_codecs = { raw: protons_runtime_node_modules_multiformats_src_codecs_raw_namespaceObject, json: protons_runtime_node_modules_multiformats_src_codecs_json_namespaceObject } -/** - * @param {Uint8Array} data - * @param {number} [offset=0] - * @returns {[number, number]} - */ -const unixfs_node_modules_multiformats_src_varint_decode = (data, offset = 0) => { - const code = unixfs_node_modules_multiformats_vendor_varint.decode(data, offset) - return [code, unixfs_node_modules_multiformats_vendor_varint.decode.bytes] -} -/** - * @param {number} int - * @param {Uint8Array} target - * @param {number} [offset=0] - */ -const unixfs_node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => { - unixfs_node_modules_multiformats_vendor_varint.encode(int, target, offset) - return target -} -/** - * @param {number} int - * @returns {number} - */ -const unixfs_node_modules_multiformats_src_varint_encodingLength = (int) => { - return unixfs_node_modules_multiformats_vendor_varint.encodingLength(int) -} +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/uint8arrays/dist/src/util/bases.js -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/hashes/digest.js +function src_util_bases_createCodec(name, prefix, encode, decode) { + return { + name, + prefix, + encoder: { + name, + prefix, + encode + }, + decoder: { + decode + } + }; +} +const src_util_bases_string = src_util_bases_createCodec('utf8', 'u', (buf) => { + const decoder = new TextDecoder('utf8'); + return 'u' + decoder.decode(buf); +}, (str) => { + const encoder = new TextEncoder(); + return encoder.encode(str.substring(1)); +}); +const src_util_bases_ascii = src_util_bases_createCodec('ascii', 'a', (buf) => { + let string = 'a'; + for (let i = 0; i < buf.length; i++) { + string += String.fromCharCode(buf[i]); + } + return string; +}, (str) => { + str = str.substring(1); + const buf = node_modules_uint8arrays_dist_src_alloc_allocUnsafe(str.length); + for (let i = 0; i < str.length; i++) { + buf[i] = str.charCodeAt(i); + } + return buf; +}); +const src_util_bases_BASES = { + utf8: src_util_bases_string, + 'utf-8': src_util_bases_string, + hex: protons_runtime_node_modules_multiformats_src_basics_bases.base16, + latin1: src_util_bases_ascii, + ascii: src_util_bases_ascii, + binary: src_util_bases_ascii, + ...protons_runtime_node_modules_multiformats_src_basics_bases +}; +/* harmony default export */ const uint8arrays_dist_src_util_bases = (src_util_bases_BASES); +//# sourceMappingURL=bases.js.map +;// CONCATENATED MODULE: ./node_modules/protons-runtime/node_modules/uint8arrays/dist/src/from-string.js /** - * Creates a multihash digest. + * Create a `Uint8Array` from the passed string * - * @template {number} Code - * @param {Code} code - * @param {Uint8Array} digest - */ -const unixfs_node_modules_multiformats_src_hashes_digest_create = (code, digest) => { - const size = digest.byteLength - const sizeOffset = unixfs_node_modules_multiformats_src_varint_encodingLength(code) - const digestOffset = sizeOffset + unixfs_node_modules_multiformats_src_varint_encodingLength(size) - - const bytes = new Uint8Array(digestOffset + size) - unixfs_node_modules_multiformats_src_varint_encodeTo(code, bytes, 0) - unixfs_node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset) - bytes.set(digest, digestOffset) - - return new unixfs_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) -} - -/** - * Turns bytes representation of multihash digest into an instance. + * Supports `utf8`, `utf-8`, `hex`, and any encoding supported by the multiformats module. * - * @param {Uint8Array} multihash - * @returns {MultihashDigest} - */ -const unixfs_node_modules_multiformats_src_hashes_digest_decode = (multihash) => { - const bytes = unixfs_node_modules_multiformats_src_bytes_coerce(multihash) - const [code, sizeOffset] = unixfs_node_modules_multiformats_src_varint_decode(bytes) - const [size, digestOffset] = unixfs_node_modules_multiformats_src_varint_decode(bytes.subarray(sizeOffset)) - const digest = bytes.subarray(sizeOffset + digestOffset) - - if (digest.byteLength !== size) { - throw new Error('Incorrect length') - } - - return new unixfs_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) -} - -/** - * @param {MultihashDigest} a - * @param {unknown} b - * @returns {b is MultihashDigest} + * Also `ascii` which is similar to node's 'binary' encoding. */ -const unixfs_node_modules_multiformats_src_hashes_digest_equals = (a, b) => { - if (a === b) { - return true - } else { - const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) - - return ( - a.code === data.code && - a.size === data.size && - data.bytes instanceof Uint8Array && - unixfs_node_modules_multiformats_src_bytes_equals(a.bytes, data.bytes) - ) - } +function uint8arrays_dist_src_from_string_fromString(string, encoding = 'utf8') { + const base = uint8arrays_dist_src_util_bases[encoding]; + if (base == null) { + throw new Error(`Unsupported encoding "${encoding}"`); + } + if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) { + return node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.from(string, 'utf-8')); + } + // add multibase prefix + return base.decoder.decode(`${base.prefix}${string}`); // eslint-disable-line @typescript-eslint/restrict-template-expressions } +//# sourceMappingURL=from-string.js.map +;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/utils/pool.js /** - * @typedef {import('./interface.js').MultihashDigest} MultihashDigest - */ - -/** - * Represents a multihash digest which carries information about the - * hashing algorithm and an actual hash digest. - * - * @template {number} Code - * @template {number} Size - * @class - * @implements {MultihashDigest} + * A general purpose buffer pool */ -class unixfs_node_modules_multiformats_src_hashes_digest_Digest { - /** - * Creates a multihash digest. - * - * @param {Code} code - * @param {Size} size - * @param {Uint8Array} digest - * @param {Uint8Array} bytes - */ - constructor (code, size, digest, bytes) { - this.code = code - this.size = size - this.digest = digest - this.bytes = bytes - } +function pool_pool(size) { + const SIZE = size ?? 8192; + const MAX = SIZE >>> 1; + let slab; + let offset = SIZE; + return function poolAlloc(size) { + if (size < 1 || size > MAX) { + return node_modules_uint8arrays_dist_src_alloc_allocUnsafe(size); + } + if (offset + size > SIZE) { + slab = node_modules_uint8arrays_dist_src_alloc_allocUnsafe(SIZE); + offset = 0; + } + const buf = slab.subarray(offset, offset += size); + if ((offset & 7) !== 0) { + // align to 32 bit + offset = (offset | 7) + 1; + } + return buf; + }; } +//# sourceMappingURL=pool.js.map +;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/utils/writer.js -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/cid.js - - - - -// Linter can see that API is used in types. -// eslint-disable-next-line -// This way TS will also expose all the types from module /** - * @template {API.Link} T - * @template {string} Prefix - * @param {T} link - * @param {API.MultibaseEncoder} [base] - * @returns {API.ToString} + * Constructs a new writer operation instance. + * + * @classdesc Scheduled writer operation */ -const unixfs_node_modules_multiformats_src_cid_format = (link, base) => { - const { bytes, version } = link - switch (version) { - case 0: - return unixfs_node_modules_multiformats_src_cid_toStringV0( - bytes, - unixfs_node_modules_multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder<"z">} */ (base) || unixfs_node_modules_multiformats_src_bases_base58_base58btc.encoder - ) - default: - return unixfs_node_modules_multiformats_src_cid_toStringV1( - bytes, - unixfs_node_modules_multiformats_src_cid_baseCache(link), - /** @type {API.MultibaseEncoder} */ (base || unixfs_node_modules_multiformats_src_bases_base32_base32.encoder) - ) - } +class Op { + /** + * Function to call + */ + fn; + /** + * Value byte length + */ + len; + /** + * Next operation + */ + next; + /** + * Value to write + */ + val; + constructor(fn, len, val) { + this.fn = fn; + this.len = len; + this.next = undefined; + this.val = val; // type varies + } } - +/* istanbul ignore next */ +function writer_noop() { } // eslint-disable-line no-empty-function /** - * @template {API.UnknownLink} Link - * @param {Link} link - * @returns {API.LinkJSON} + * Constructs a new writer state instance */ -const unixfs_node_modules_multiformats_src_cid_toJSON = (link) => ({ - '/': unixfs_node_modules_multiformats_src_cid_format(link) -}) - +class State { + /** + * Current head + */ + head; + /** + * Current tail + */ + tail; + /** + * Current buffer length + */ + len; + /** + * Next state + */ + next; + constructor(writer) { + this.head = writer.head; + this.tail = writer.tail; + this.len = writer.len; + this.next = writer.states; + } +} +const bufferPool = pool_pool(); /** - * @template {API.UnknownLink} Link - * @param {API.LinkJSON} json + * Allocates a buffer of the specified size */ -const unixfs_node_modules_multiformats_src_cid_fromJSON = (json) => - unixfs_node_modules_multiformats_src_cid_CID.parse(json['/']) - -/** @type {WeakMap>} */ -const unixfs_node_modules_multiformats_src_cid_cache = new WeakMap() - +function writer_alloc(size) { + if (globalThis.Buffer != null) { + return node_modules_uint8arrays_dist_src_alloc_allocUnsafe(size); + } + return bufferPool(size); +} /** - * @param {API.UnknownLink} cid - * @returns {Map} + * When a value is written, the writer calculates its byte length and puts it into a linked + * list of operations to perform when finish() is called. This both allows us to allocate + * buffers of the exact required size and reduces the amount of work we have to do compared + * to first calculating over objects and then encoding over objects. In our case, the encoding + * part is just a linked list walk calling operations with already prepared values. */ -const unixfs_node_modules_multiformats_src_cid_baseCache = cid => { - const baseCache = unixfs_node_modules_multiformats_src_cid_cache.get(cid) - if (baseCache == null) { - const baseCache = new Map() - unixfs_node_modules_multiformats_src_cid_cache.set(cid, baseCache) - return baseCache - } - return baseCache +class Uint8ArrayWriter { + /** + * Current length + */ + len; + /** + * Operations head + */ + head; + /** + * Operations tail + */ + tail; + /** + * Linked forked states + */ + states; + constructor() { + this.len = 0; + this.head = new Op(writer_noop, 0, 0); + this.tail = this.head; + this.states = null; + } + /** + * Pushes a new operation to the queue + */ + _push(fn, len, val) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; + } + /** + * Writes an unsigned 32 bit value as a varint + */ + uint32(value) { + // here, the call to this.push has been inlined and a varint specific Op subclass is used. + // uint32 is by far the most frequently used operation and benefits significantly from this. + this.len += (this.tail = this.tail.next = new VarintOp((value = value >>> 0) < + 128 + ? 1 + : value < 16384 + ? 2 + : value < 2097152 + ? 3 + : value < 268435456 + ? 4 + : 5, value)).len; + return this; + } + /** + * Writes a signed 32 bit value as a varint` + */ + int32(value) { + return value < 0 + ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec + : this.uint32(value); + } + /** + * Writes a 32 bit value as a varint, zig-zag encoded + */ + sint32(value) { + return this.uint32((value << 1 ^ value >> 31) >>> 0); + } + /** + * Writes an unsigned 64 bit value as a varint + */ + uint64(value) { + const bits = LongBits.fromBigInt(value); + return this._push(writeVarint64, bits.length(), bits); + } + /** + * Writes an unsigned 64 bit value as a varint + */ + uint64Number(value) { + const bits = LongBits.fromNumber(value); + return this._push(writeVarint64, bits.length(), bits); + } + /** + * Writes an unsigned 64 bit value as a varint + */ + uint64String(value) { + return this.uint64(BigInt(value)); + } + /** + * Writes a signed 64 bit value as a varint + */ + int64(value) { + return this.uint64(value); + } + /** + * Writes a signed 64 bit value as a varint + */ + int64Number(value) { + return this.uint64Number(value); + } + /** + * Writes a signed 64 bit value as a varint + */ + int64String(value) { + return this.uint64String(value); + } + /** + * Writes a signed 64 bit value as a varint, zig-zag encoded + */ + sint64(value) { + const bits = LongBits.fromBigInt(value).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); + } + /** + * Writes a signed 64 bit value as a varint, zig-zag encoded + */ + sint64Number(value) { + const bits = LongBits.fromNumber(value).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); + } + /** + * Writes a signed 64 bit value as a varint, zig-zag encoded + */ + sint64String(value) { + return this.sint64(BigInt(value)); + } + /** + * Writes a boolish value as a varint + */ + bool(value) { + return this._push(writeByte, 1, value ? 1 : 0); + } + /** + * Writes an unsigned 32 bit value as fixed 32 bits + */ + fixed32(value) { + return this._push(writeFixed32, 4, value >>> 0); + } + /** + * Writes a signed 32 bit value as fixed 32 bits + */ + sfixed32(value) { + return this.fixed32(value); + } + /** + * Writes an unsigned 64 bit value as fixed 64 bits + */ + fixed64(value) { + const bits = LongBits.fromBigInt(value); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); + } + /** + * Writes an unsigned 64 bit value as fixed 64 bits + */ + fixed64Number(value) { + const bits = LongBits.fromNumber(value); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); + } + /** + * Writes an unsigned 64 bit value as fixed 64 bits + */ + fixed64String(value) { + return this.fixed64(BigInt(value)); + } + /** + * Writes a signed 64 bit value as fixed 64 bits + */ + sfixed64(value) { + return this.fixed64(value); + } + /** + * Writes a signed 64 bit value as fixed 64 bits + */ + sfixed64Number(value) { + return this.fixed64Number(value); + } + /** + * Writes a signed 64 bit value as fixed 64 bits + */ + sfixed64String(value) { + return this.fixed64String(value); + } + /** + * Writes a float (32 bit) + */ + float(value) { + return this._push(writeFloatLE, 4, value); + } + /** + * Writes a double (64 bit float). + * + * @function + * @param {number} value - Value to write + * @returns {Writer} `this` + */ + double(value) { + return this._push(writeDoubleLE, 8, value); + } + /** + * Writes a sequence of bytes + */ + bytes(value) { + const len = value.length >>> 0; + if (len === 0) { + return this._push(writeByte, 1, 0); + } + return this.uint32(len)._push(writer_writeBytes, len, value); + } + /** + * Writes a string + */ + string(value) { + const len = utf8_length(value); + return len !== 0 + ? this.uint32(len)._push(write, len, value) + : this._push(writeByte, 1, 0); + } + /** + * Forks this writer's state by pushing it to a stack. + * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. + */ + fork() { + this.states = new State(this); + this.head = this.tail = new Op(writer_noop, 0, 0); + this.len = 0; + return this; + } + /** + * Resets this instance to the last state + */ + reset() { + if (this.states != null) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } + else { + this.head = this.tail = new Op(writer_noop, 0, 0); + this.len = 0; + } + return this; + } + /** + * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. + */ + ldelim() { + const head = this.head; + const tail = this.tail; + const len = this.len; + this.reset().uint32(len); + if (len !== 0) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; + } + /** + * Finishes the write operation + */ + finish() { + let head = this.head.next; // skip noop + const buf = writer_alloc(this.len); + let pos = 0; + while (head != null) { + head.fn(head.val, buf, pos); + pos += head.len; + head = head.next; + } + // this.head = this.tail = null; + return buf; + } +} +function writeByte(val, buf, pos) { + buf[pos] = val & 255; +} +function writeVarint32(val, buf, pos) { + while (val > 127) { + buf[pos++] = val & 127 | 128; + val >>>= 7; + } + buf[pos] = val; } - /** - * @template {unknown} [Data=unknown] - * @template {number} [Format=number] - * @template {number} [Alg=number] - * @template {API.Version} [Version=API.Version] - * @implements {API.Link} + * Constructs a new varint writer operation instance. + * + * @classdesc Scheduled varint writer operation */ - -class unixfs_node_modules_multiformats_src_cid_CID { - /** - * @param {Version} version - Version of the CID - * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content. - * @param {Uint8Array} bytes - */ - constructor (version, code, multihash, bytes) { - /** @readonly */ - this.code = code - /** @readonly */ - this.version = version - /** @readonly */ - this.multihash = multihash - /** @readonly */ - this.bytes = bytes - - // flag to serializers that this is a CID and - // should be treated specially - /** @readonly */ - this['/'] = bytes - } - - /** - * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` - * please either use `CID.asCID(cid)` or switch to new signalling mechanism - * - * @deprecated - */ - get asCID () { - return this - } - - // ArrayBufferView - get byteOffset () { - return this.bytes.byteOffset - } - - // ArrayBufferView - get byteLength () { - return this.bytes.byteLength - } - - /** - * @returns {CID} - */ - toV0 () { - switch (this.version) { - case 0: { - return /** @type {CID} */ (this) - } - case 1: { - const { code, multihash } = this - - if (code !== unixfs_node_modules_multiformats_src_cid_DAG_PB_CODE) { - throw new Error('Cannot convert a non dag-pb CID to CIDv0') +class VarintOp extends Op { + next; + constructor(len, val) { + super(writeVarint32, len, val); + this.next = undefined; + } +} +function writeVarint64(val, buf, pos) { + while (val.hi !== 0) { + buf[pos++] = val.lo & 127 | 128; + val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = val.lo & 127 | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; +} +function writeFixed32(val, buf, pos) { + buf[pos] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; +} +function writer_writeBytes(val, buf, pos) { + buf.set(val, pos); +} +if (globalThis.Buffer != null) { + Uint8ArrayWriter.prototype.bytes = function (value) { + const len = value.length >>> 0; + this.uint32(len); + if (len > 0) { + this._push(writeBytesBuffer, len, value); } - - // sha2-256 - if (multihash.code !== unixfs_node_modules_multiformats_src_cid_SHA_256_CODE) { - throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') + return this; + }; + Uint8ArrayWriter.prototype.string = function (value) { + const len = globalThis.Buffer.byteLength(value); + this.uint32(len); + if (len > 0) { + this._push(writeStringBuffer, len, value); } - - return /** @type {CID} */ ( - unixfs_node_modules_multiformats_src_cid_CID.createV0( - /** @type {API.MultihashDigest} */ (multihash) - ) - ) - } - default: { - throw Error( - `Can not convert CID version ${this.version} to version 0. This is a bug please report` - ) - } + return this; + }; +} +function writeBytesBuffer(val, buf, pos) { + buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) + // also works for plain array values +} +function writeStringBuffer(val, buf, pos) { + if (val.length < 40) { + // plain js is faster for short strings (probably due to redundant assertions) + write(val, buf, pos); + // @ts-expect-error buf isn't a Uint8Array? } - } - - /** - * @returns {CID} - */ - toV1 () { - switch (this.version) { - case 0: { - const { code, digest } = this.multihash - const multihash = unixfs_node_modules_multiformats_src_hashes_digest_create(code, digest) - return /** @type {CID} */ ( - unixfs_node_modules_multiformats_src_cid_CID.createV1(this.code, multihash) - ) - } - case 1: { - return /** @type {CID} */ (this) - } - default: { - throw Error( - `Can not convert CID version ${this.version} to version 1. This is a bug please report` - ) - } + else if (buf.utf8Write != null) { + // @ts-expect-error buf isn't a Uint8Array? + buf.utf8Write(val, pos); } - } + else { + buf.set(uint8arrays_dist_src_from_string_fromString(val), pos); + } +} +/** + * Creates a new writer + */ +function writer_createWriter() { + return new Uint8ArrayWriter(); +} +//# sourceMappingURL=writer.js.map +;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/encode.js - /** - * @param {unknown} other - * @returns {other is CID} - */ - equals (other) { - return unixfs_node_modules_multiformats_src_cid_CID.equals(this, other) - } +function encodeMessage(message, codec) { + const w = writer_createWriter(); + codec.encode(message, w, { + lengthDelimited: false + }); + return w.finish(); +} +//# sourceMappingURL=encode.js.map +;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/codec.js +// https://developers.google.com/protocol-buffers/docs/encoding#structure +var CODEC_TYPES; +(function (CODEC_TYPES) { + CODEC_TYPES[CODEC_TYPES["VARINT"] = 0] = "VARINT"; + CODEC_TYPES[CODEC_TYPES["BIT64"] = 1] = "BIT64"; + CODEC_TYPES[CODEC_TYPES["LENGTH_DELIMITED"] = 2] = "LENGTH_DELIMITED"; + CODEC_TYPES[CODEC_TYPES["START_GROUP"] = 3] = "START_GROUP"; + CODEC_TYPES[CODEC_TYPES["END_GROUP"] = 4] = "END_GROUP"; + CODEC_TYPES[CODEC_TYPES["BIT32"] = 5] = "BIT32"; +})(CODEC_TYPES || (CODEC_TYPES = {})); +function codec_createCodec(name, type, encode, decode) { + return { + name, + type, + encode, + decode + }; +} +//# sourceMappingURL=codec.js.map +;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/codecs/enum.js - /** - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @param {API.Link} self - * @param {unknown} other - * @returns {other is CID} - */ - static equals (self, other) { - const unknown = - /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ ( - other - ) - return ( - unknown && - self.code === unknown.code && - self.version === unknown.version && - unixfs_node_modules_multiformats_src_hashes_digest_equals(self.multihash, unknown.multihash) - ) - } +function enumeration(v) { + function findValue(val) { + // Use the reverse mapping to look up the enum key for the stored value + // https://www.typescriptlang.org/docs/handbook/enums.html#reverse-mappings + if (v[val.toString()] == null) { + throw new Error('Invalid enum value'); + } + return v[val]; + } + const encode = function enumEncode(val, writer) { + const enumValue = findValue(val); + writer.int32(enumValue); + }; + const decode = function enumDecode(reader) { + const val = reader.int32(); + return findValue(val); + }; + // @ts-expect-error yeah yeah + return codec_createCodec('enum', CODEC_TYPES.VARINT, encode, decode); +} +//# sourceMappingURL=enum.js.map +;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/codecs/message.js - /** - * @param {API.MultibaseEncoder} [base] - * @returns {string} - */ - toString (base) { - return unixfs_node_modules_multiformats_src_cid_format(this, base) - } +function message(encode, decode) { + return codec_createCodec('message', CODEC_TYPES.LENGTH_DELIMITED, encode, decode); +} +//# sourceMappingURL=message.js.map +;// CONCATENATED MODULE: ./node_modules/protons-runtime/dist/src/index.js - /** - * @returns {API.LinkJSON} - */ - toJSON () { - return { '/': unixfs_node_modules_multiformats_src_cid_format(this) } - } - link () { - return this - } - get [Symbol.toStringTag] () { - return 'CID' - } - // Legacy - [Symbol.for('nodejs.util.inspect.custom')] () { - return `CID(${this.toString()})` - } - /** - * Takes any input `value` and returns a `CID` instance if it was - * a `CID` otherwise returns `null`. If `value` is instanceof `CID` - * it will return value back. If `value` is not instance of this CID - * class, but is compatible CID it will return new instance of this - * `CID` class. Otherwise returns null. - * - * This allows two different incompatible versions of CID library to - * co-exist and interop as long as binary interface is compatible. - * - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @template {unknown} U - * @param {API.Link|U} input - * @returns {CID|null} - */ - static asCID (input) { - if (input == null) { - return null +class src_CodeError extends Error { + code; + constructor(message, code, options) { + super(message, options); + this.code = code; } +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs/dist/src/unixfs.js +/* eslint-disable import/export */ +/* eslint-disable complexity */ +/* eslint-disable @typescript-eslint/no-namespace */ +/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ +/* eslint-disable @typescript-eslint/no-empty-interface */ + +var unixfs_Data; +(function (Data) { + let DataType; + (function (DataType) { + DataType["Raw"] = "Raw"; + DataType["Directory"] = "Directory"; + DataType["File"] = "File"; + DataType["Metadata"] = "Metadata"; + DataType["Symlink"] = "Symlink"; + DataType["HAMTShard"] = "HAMTShard"; + })(DataType = Data.DataType || (Data.DataType = {})); + let __DataTypeValues; + (function (__DataTypeValues) { + __DataTypeValues[__DataTypeValues["Raw"] = 0] = "Raw"; + __DataTypeValues[__DataTypeValues["Directory"] = 1] = "Directory"; + __DataTypeValues[__DataTypeValues["File"] = 2] = "File"; + __DataTypeValues[__DataTypeValues["Metadata"] = 3] = "Metadata"; + __DataTypeValues[__DataTypeValues["Symlink"] = 4] = "Symlink"; + __DataTypeValues[__DataTypeValues["HAMTShard"] = 5] = "HAMTShard"; + })(__DataTypeValues || (__DataTypeValues = {})); + (function (DataType) { + DataType.codec = () => { + return enumeration(__DataTypeValues); + }; + })(DataType = Data.DataType || (Data.DataType = {})); + let _codec; + Data.codec = () => { + if (_codec == null) { + _codec = message((obj, w, opts = {}) => { + if (opts.lengthDelimited !== false) { + w.fork(); + } + if (obj.Type != null) { + w.uint32(8); + Data.DataType.codec().encode(obj.Type, w); + } + if (obj.Data != null) { + w.uint32(18); + w.bytes(obj.Data); + } + if (obj.filesize != null) { + w.uint32(24); + w.uint64(obj.filesize); + } + if (obj.blocksizes != null) { + for (const value of obj.blocksizes) { + w.uint32(32); + w.uint64(value); + } + } + if (obj.hashType != null) { + w.uint32(40); + w.uint64(obj.hashType); + } + if (obj.fanout != null) { + w.uint32(48); + w.uint64(obj.fanout); + } + if (obj.mode != null) { + w.uint32(56); + w.uint32(obj.mode); + } + if (obj.mtime != null) { + w.uint32(66); + unixfs_UnixTime.codec().encode(obj.mtime, w); + } + if (opts.lengthDelimited !== false) { + w.ldelim(); + } + }, (reader, length) => { + const obj = { + blocksizes: [] + }; + const end = length == null ? reader.len : reader.pos + length; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + obj.Type = Data.DataType.codec().decode(reader); + break; + case 2: + obj.Data = reader.bytes(); + break; + case 3: + obj.filesize = reader.uint64(); + break; + case 4: + obj.blocksizes.push(reader.uint64()); + break; + case 5: + obj.hashType = reader.uint64(); + break; + case 6: + obj.fanout = reader.uint64(); + break; + case 7: + obj.mode = reader.uint32(); + break; + case 8: + obj.mtime = unixfs_UnixTime.codec().decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return obj; + }); + } + return _codec; + }; + Data.encode = (obj) => { + return encodeMessage(obj, Data.codec()); + }; + Data.decode = (buf) => { + return decodeMessage(buf, Data.codec()); + }; +})(unixfs_Data || (unixfs_Data = {})); +var unixfs_UnixTime; +(function (UnixTime) { + let _codec; + UnixTime.codec = () => { + if (_codec == null) { + _codec = message((obj, w, opts = {}) => { + if (opts.lengthDelimited !== false) { + w.fork(); + } + if (obj.Seconds != null) { + w.uint32(8); + w.int64(obj.Seconds); + } + if (obj.FractionalNanoseconds != null) { + w.uint32(21); + w.fixed32(obj.FractionalNanoseconds); + } + if (opts.lengthDelimited !== false) { + w.ldelim(); + } + }, (reader, length) => { + const obj = {}; + const end = length == null ? reader.len : reader.pos + length; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + obj.Seconds = reader.int64(); + break; + case 2: + obj.FractionalNanoseconds = reader.fixed32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return obj; + }); + } + return _codec; + }; + UnixTime.encode = (obj) => { + return encodeMessage(obj, UnixTime.codec()); + }; + UnixTime.decode = (buf) => { + return decodeMessage(buf, UnixTime.codec()); + }; +})(unixfs_UnixTime || (unixfs_UnixTime = {})); +var unixfs_Metadata; +(function (Metadata) { + let _codec; + Metadata.codec = () => { + if (_codec == null) { + _codec = message((obj, w, opts = {}) => { + if (opts.lengthDelimited !== false) { + w.fork(); + } + if (obj.MimeType != null) { + w.uint32(10); + w.string(obj.MimeType); + } + if (opts.lengthDelimited !== false) { + w.ldelim(); + } + }, (reader, length) => { + const obj = {}; + const end = length == null ? reader.len : reader.pos + length; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + obj.MimeType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return obj; + }); + } + return _codec; + }; + Metadata.encode = (obj) => { + return encodeMessage(obj, Metadata.codec()); + }; + Metadata.decode = (buf) => { + return decodeMessage(buf, Metadata.codec()); + }; +})(unixfs_Metadata || (unixfs_Metadata = {})); +//# sourceMappingURL=unixfs.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs/dist/src/index.js - const value = /** @type {any} */ (input) - if (value instanceof unixfs_node_modules_multiformats_src_cid_CID) { - // If value is instance of CID then we're all set. - return value - } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { - // If value isn't instance of this CID class but `this.asCID === this` or - // `value['/'] === value.bytes` is true it is CID instance coming from a - // different implementation (diff version or duplicate). In that case we - // rebase it to this `CID` implementation so caller is guaranteed to get - // instance with expected API. - const { version, code, multihash, bytes } = value - return new unixfs_node_modules_multiformats_src_cid_CID( - version, - code, - /** @type {API.MultihashDigest} */ (multihash), - bytes || unixfs_node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes) - ) - } else if (value[unixfs_node_modules_multiformats_src_cid_cidSymbol] === true) { - // If value is a CID from older implementation that used to be tagged via - // symbol we still rebase it to the this `CID` implementation by - // delegating that to a constructor. - const { version, multihash, code } = value - const digest = - /** @type {API.MultihashDigest} */ - (unixfs_node_modules_multiformats_src_hashes_digest_decode(multihash)) - return unixfs_node_modules_multiformats_src_cid_CID.create(version, code, digest) - } else { - // Otherwise value is not a CID (or an incompatible version of it) in - // which case we return `null`. - return null - } - } - /** - * - * @template {unknown} Data - * @template {number} Format - * @template {number} Alg - * @template {API.Version} Version - * @param {Version} version - Version of the CID - * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param {API.MultihashDigest} digest - (Multi)hash of the of the content. - * @returns {CID} - */ - static create (version, code, digest) { - if (typeof code !== 'number') { - throw new Error('String codecs are no longer supported') +const src_types = { + Raw: 'raw', + Directory: 'directory', + File: 'file', + Metadata: 'metadata', + Symlink: 'symlink', + HAMTShard: 'hamt-sharded-directory' +}; +const src_dirTypes = [ + 'directory', + 'hamt-sharded-directory' +]; +const src_DEFAULT_FILE_MODE = parseInt('0644', 8); +const src_DEFAULT_DIRECTORY_MODE = parseInt('0755', 8); +class src_UnixFS { + /** + * Decode from protobuf https://github.com/ipfs/specs/blob/master/UNIXFS.md + */ + static unmarshal(marshaled) { + const message = unixfs_Data.decode(marshaled); + const data = new src_UnixFS({ + type: src_types[message.Type != null ? message.Type.toString() : 'File'], + data: message.Data, + blockSizes: message.blocksizes, + mode: message.mode, + mtime: message.mtime != null + ? { + secs: message.mtime.Seconds ?? 0n, + nsecs: message.mtime.FractionalNanoseconds + } + : undefined, + fanout: message.fanout + }); + // make sure we honour the original mode + data._originalMode = message.mode ?? 0; + return data; } - - if (!(digest.bytes instanceof Uint8Array)) { - throw new Error('Invalid digest') + type; + data; + blockSizes; + hashType; + fanout; + mtime; + _mode; + _originalMode; + constructor(options = { + type: 'file' + }) { + const { type, data, blockSizes, hashType, fanout, mtime, mode } = options; + if (type != null && !Object.values(src_types).includes(type)) { + throw err_code(new Error('Type: ' + type + ' is not valid'), 'ERR_INVALID_TYPE'); + } + this.type = type ?? 'file'; + this.data = data; + this.hashType = hashType; + this.fanout = fanout; + this.blockSizes = blockSizes ?? []; + this._originalMode = 0; + this.mode = mode; + this.mtime = mtime; } - - switch (version) { - case 0: { - if (code !== unixfs_node_modules_multiformats_src_cid_DAG_PB_CODE) { - throw new Error( - `Version 0 CID must use dag-pb (code: ${unixfs_node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding` - ) - } else { - return new unixfs_node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes) + set mode(mode) { + if (mode == null) { + this._mode = this.isDirectory() ? src_DEFAULT_DIRECTORY_MODE : src_DEFAULT_FILE_MODE; + } + else { + this._mode = (mode & 0xFFF); } - } - case 1: { - const bytes = unixfs_node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes) - return new unixfs_node_modules_multiformats_src_cid_CID(version, code, digest, bytes) - } - default: { - throw new Error('Invalid version') - } } - } - - /** - * Simplified version of `create` for CIDv0. - * - * @template {unknown} [T=unknown] - * @param {API.MultihashDigest} digest - Multihash. - * @returns {CID} - */ - static createV0 (digest) { - return unixfs_node_modules_multiformats_src_cid_CID.create(0, unixfs_node_modules_multiformats_src_cid_DAG_PB_CODE, digest) - } - - /** - * Simplified version of `create` for CIDv1. - * - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @param {Code} code - Content encoding format code. - * @param {API.MultihashDigest} digest - Miltihash of the content. - * @returns {CID} - */ - static createV1 (code, digest) { - return unixfs_node_modules_multiformats_src_cid_CID.create(1, code, digest) - } - - /** - * Decoded a CID from its binary representation. The byte array must contain - * only the CID with no additional bytes. - * - * An error will be thrown if the bytes provided do not contain a valid - * binary representation of a CID. - * - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ByteView>} bytes - * @returns {CID} - */ - static decode (bytes) { - const [cid, remainder] = unixfs_node_modules_multiformats_src_cid_CID.decodeFirst(bytes) - if (remainder.length) { - throw new Error('Incorrect length') + get mode() { + return this._mode; } - return cid - } - - /** - * Decoded a CID from its binary representation at the beginning of a byte - * array. - * - * Returns an array with the first element containing the CID and the second - * element containing the remainder of the original byte array. The remainder - * will be a zero-length byte array if the provided bytes only contained a - * binary CID representation. - * - * @template {unknown} T - * @template {number} C - * @template {number} A - * @template {API.Version} V - * @param {API.ByteView>} bytes - * @returns {[CID, Uint8Array]} - */ - static decodeFirst (bytes) { - const specs = unixfs_node_modules_multiformats_src_cid_CID.inspectBytes(bytes) - const prefixSize = specs.size - specs.multihashSize - const multihashBytes = unixfs_node_modules_multiformats_src_bytes_coerce( - bytes.subarray(prefixSize, prefixSize + specs.multihashSize) - ) - if (multihashBytes.byteLength !== specs.multihashSize) { - throw new Error('Incorrect length') + isDirectory() { + return src_dirTypes.includes(this.type); } - const digestBytes = multihashBytes.subarray( - specs.multihashSize - specs.digestSize - ) - const digest = new unixfs_node_modules_multiformats_src_hashes_digest_Digest( - specs.multihashCode, - specs.digestSize, - digestBytes, - multihashBytes - ) - const cid = - specs.version === 0 - ? unixfs_node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) - : unixfs_node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest) - return [/** @type {CID} */(cid), bytes.subarray(specs.size)] - } - - /** - * Inspect the initial bytes of a CID to determine its properties. - * - * Involves decoding up to 4 varints. Typically this will require only 4 to 6 - * bytes but for larger multicodec code values and larger multihash digest - * lengths these varints can be quite large. It is recommended that at least - * 10 bytes be made available in the `initialBytes` argument for a complete - * inspection. - * - * @template {unknown} T - * @template {number} C - * @template {number} A - * @template {API.Version} V - * @param {API.ByteView>} initialBytes - * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }} - */ - static inspectBytes (initialBytes) { - let offset = 0 - const next = () => { - const [i, length] = unixfs_node_modules_multiformats_src_varint_decode(initialBytes.subarray(offset)) - offset += length - return i + addBlockSize(size) { + this.blockSizes.push(size); } - - let version = /** @type {V} */ (next()) - let codec = /** @type {C} */ (unixfs_node_modules_multiformats_src_cid_DAG_PB_CODE) - if (/** @type {number} */(version) === 18) { - // CIDv0 - version = /** @type {V} */ (0) - offset = 0 - } else { - codec = /** @type {C} */ (next()) + removeBlockSize(index) { + this.blockSizes.splice(index, 1); } - - if (version !== 0 && version !== 1) { - throw new RangeError(`Invalid CID version ${version}`) + /** + * Returns `0n` for directories or `data.length + sum(blockSizes)` for everything else + */ + fileSize() { + if (this.isDirectory()) { + // dirs don't have file size + return 0n; + } + let sum = 0n; + this.blockSizes.forEach((size) => { + sum += size; + }); + if (this.data != null) { + sum += BigInt(this.data.length); + } + return sum; } - - const prefixSize = offset - const multihashCode = /** @type {A} */ (next()) // multihash code - const digestSize = next() // multihash length - const size = offset + digestSize - const multihashSize = size - prefixSize - - return { version, codec, multihashCode, digestSize, multihashSize, size } - } - - /** - * Takes cid in a string representation and creates an instance. If `base` - * decoder is not provided will use a default from the configuration. It will - * throw an error if encoding of the CID is not compatible with supplied (or - * a default decoder). - * - * @template {string} Prefix - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ToString, Prefix>} source - * @param {API.MultibaseDecoder} [base] - * @returns {CID} - */ - static parse (source, base) { - const [prefix, bytes] = unixfs_node_modules_multiformats_src_cid_parseCIDtoBytes(source, base) - - const cid = unixfs_node_modules_multiformats_src_cid_CID.decode(bytes) - - if (cid.version === 0 && source[0] !== 'Q') { - throw Error('Version 0 CID string must not include multibase prefix') + /** + * encode to protobuf Uint8Array + */ + marshal() { + let type; + switch (this.type) { + case 'raw': + type = unixfs_Data.DataType.Raw; + break; + case 'directory': + type = unixfs_Data.DataType.Directory; + break; + case 'file': + type = unixfs_Data.DataType.File; + break; + case 'metadata': + type = unixfs_Data.DataType.Metadata; + break; + case 'symlink': + type = unixfs_Data.DataType.Symlink; + break; + case 'hamt-sharded-directory': + type = unixfs_Data.DataType.HAMTShard; + break; + default: + throw err_code(new Error(`Type: ${type} is not valid`), 'ERR_INVALID_TYPE'); + } + let data = this.data; + if (this.data == null || this.data.length === 0) { + data = undefined; + } + let mode; + if (this.mode != null) { + mode = (this._originalMode & 0xFFFFF000) | (this.mode ?? 0); + if (mode === src_DEFAULT_FILE_MODE && !this.isDirectory()) { + mode = undefined; + } + if (mode === src_DEFAULT_DIRECTORY_MODE && this.isDirectory()) { + mode = undefined; + } + } + let mtime; + if (this.mtime != null) { + mtime = { + Seconds: this.mtime.secs, + FractionalNanoseconds: this.mtime.nsecs + }; + } + return unixfs_Data.encode({ + Type: type, + Data: data, + filesize: this.isDirectory() ? undefined : this.fileSize(), + blocksizes: this.blockSizes, + hashType: this.hashType, + fanout: this.fanout, + mode, + mtime + }); } - - // Cache string representation to avoid computing it on `this.toString()` - unixfs_node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source) - - return cid - } } -/** - * @template {string} Prefix - * @template {unknown} Data - * @template {number} Code - * @template {number} Alg - * @template {API.Version} Ver - * @param {API.ToString, Prefix>} source - * @param {API.MultibaseDecoder} [base] - * @returns {[Prefix, API.ByteView>]} - */ -const unixfs_node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => { - switch (source[0]) { - // CIDv0 is parsed differently - case 'Q': { - const decoder = base || unixfs_node_modules_multiformats_src_bases_base58_base58btc - return [ - /** @type {Prefix} */ (unixfs_node_modules_multiformats_src_bases_base58_base58btc.prefix), - decoder.decode(`${unixfs_node_modules_multiformats_src_bases_base58_base58btc.prefix}${source}`) - ] - } - case unixfs_node_modules_multiformats_src_bases_base58_base58btc.prefix: { - const decoder = base || unixfs_node_modules_multiformats_src_bases_base58_base58btc - return [/** @type {Prefix} */(unixfs_node_modules_multiformats_src_bases_base58_base58btc.prefix), decoder.decode(source)] +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bytes.js +const multiformats_dist_src_bytes_empty = new Uint8Array(0); +function multiformats_dist_src_bytes_toHex(d) { + return d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), ''); +} +function multiformats_dist_src_bytes_fromHex(hex) { + const hexes = hex.match(/../g); + return hexes != null ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : multiformats_dist_src_bytes_empty; +} +function multiformats_dist_src_bytes_equals(aa, bb) { + if (aa === bb) + return true; + if (aa.byteLength !== bb.byteLength) { + return false; } - case unixfs_node_modules_multiformats_src_bases_base32_base32.prefix: { - const decoder = base || unixfs_node_modules_multiformats_src_bases_base32_base32 - return [/** @type {Prefix} */(unixfs_node_modules_multiformats_src_bases_base32_base32.prefix), decoder.decode(source)] + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false; + } } - default: { - if (base == null) { - throw Error( - 'To parse non base32 or base58btc encoded CID multibase decoder must be provided' - ) - } - return [/** @type {Prefix} */(source[0]), base.decode(source)] + return true; +} +function node_modules_multiformats_dist_src_bytes_coerce(o) { + if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') + return o; + if (o instanceof ArrayBuffer) + return new Uint8Array(o); + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength); } - } + throw new Error('Unknown type, must be binary type'); } - -/** - * - * @param {Uint8Array} bytes - * @param {Map} cache - * @param {API.MultibaseEncoder<'z'>} base - */ -const unixfs_node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => { - const { prefix } = base - if (prefix !== unixfs_node_modules_multiformats_src_bases_base58_base58btc.prefix) { - throw Error(`Cannot string encode V0 in ${base.name} encoding`) - } - - const cid = cache.get(prefix) - if (cid == null) { - const cid = base.encode(bytes).slice(1) - cache.set(prefix, cid) - return cid - } else { - return cid - } +function multiformats_dist_src_bytes_isBinary(o) { + return o instanceof ArrayBuffer || ArrayBuffer.isView(o); } - -/** - * @template {string} Prefix - * @param {Uint8Array} bytes - * @param {Map} cache - * @param {API.MultibaseEncoder} base - */ -const unixfs_node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => { - const { prefix } = base - const cid = cache.get(prefix) - if (cid == null) { - const cid = base.encode(bytes) - cache.set(prefix, cid) - return cid - } else { - return cid - } +function multiformats_dist_src_bytes_fromString(str) { + return new TextEncoder().encode(str); } - -const unixfs_node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70 -const unixfs_node_modules_multiformats_src_cid_SHA_256_CODE = 0x12 - -/** - * @param {API.Version} version - * @param {number} code - * @param {Uint8Array} multihash - * @returns {Uint8Array} - */ -const unixfs_node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => { - const codeOffset = unixfs_node_modules_multiformats_src_varint_encodingLength(version) - const hashOffset = codeOffset + unixfs_node_modules_multiformats_src_varint_encodingLength(code) - const bytes = new Uint8Array(hashOffset + multihash.byteLength) - unixfs_node_modules_multiformats_src_varint_encodeTo(version, bytes, 0) - unixfs_node_modules_multiformats_src_varint_encodeTo(code, bytes, codeOffset) - bytes.set(multihash, hashOffset) - return bytes +function node_modules_multiformats_dist_src_bytes_toString(b) { + return new TextDecoder().decode(b); } +//# sourceMappingURL=bytes.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/codecs/raw.js -const unixfs_node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') - -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/hashes/hasher.js - - -/** - * @template {string} Name - * @template {number} Code - * @param {object} options - * @param {Name} options.name - * @param {Code} options.code - * @param {(input: Uint8Array) => Await} options.encode - */ -const unixfs_node_modules_multiformats_src_hashes_hasher_from = ({ name, code, encode }) => new unixfs_node_modules_multiformats_src_hashes_hasher_Hasher(name, code, encode) - +const dist_src_codecs_raw_name = 'raw'; +const dist_src_codecs_raw_code = 0x55; +function dist_src_codecs_raw_encode(node) { + return node_modules_multiformats_dist_src_bytes_coerce(node); +} +function dist_src_codecs_raw_decode(data) { + return node_modules_multiformats_dist_src_bytes_coerce(data); +} +//# sourceMappingURL=raw.js.map +;// CONCATENATED MODULE: ./node_modules/progress-events/dist/src/index.js /** - * Hasher represents a hashing algorithm implementation that produces as - * `MultihashDigest`. - * - * @template {string} Name - * @template {number} Code - * @class - * @implements {MultihashHasher} + * An implementation of the ProgressEvent interface, this is essentially + * a typed `CustomEvent` with a `type` property that lets us disambiguate + * events passed to `progress` callbacks. */ -class unixfs_node_modules_multiformats_src_hashes_hasher_Hasher { - /** - * - * @param {Name} name - * @param {Code} code - * @param {(input: Uint8Array) => Await} encode - */ - constructor (name, code, encode) { - this.name = name - this.code = code - this.encode = encode - } - - /** - * @param {Uint8Array} input - * @returns {Await>} - */ - digest (input) { - if (input instanceof Uint8Array) { - const result = this.encode(input) - return result instanceof Uint8Array - ? unixfs_node_modules_multiformats_src_hashes_digest_create(this.code, result) - /* c8 ignore next 1 */ - : result.then(digest => unixfs_node_modules_multiformats_src_hashes_digest_create(this.code, digest)) - } else { - throw Error('Unknown type, must be binary type') - /* c8 ignore next 1 */ +class CustomProgressEvent extends Event { + constructor(type, detail) { + super(type); + this.detail = detail; } - } } - -/** - * @template {number} Alg - * @typedef {import('./interface.js').MultihashHasher} MultihashHasher - */ - -/** - * @template T - * @typedef {Promise|T} Await - */ - -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/index.js - - - - - - -// This way TS will also expose all the types from module - - - - -// EXTERNAL MODULE: ./node_modules/murmurhash3js-revisited/index.js -var murmurhash3js_revisited = __nccwpck_require__(16665); -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/@multiformats/murmur3/src/index.js - - -// @ts-expect-error no types - - +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/vendor/base-x.js +/* eslint-disable */ +// base-x encoding / decoding +// Copyright (c) 2018 base-x contributors +// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) +// Distributed under the MIT software license, see the accompanying +// file LICENSE or http://www.opensource.org/licenses/mit-license.php. /** - * @param {number} number - * @returns {Uint8Array} + * @param {string} ALPHABET + * @param {any} name */ -function fromNumberTo32BitBuf (number) { - const bytes = new Array(4) - for (let i = 0; i < 4; i++) { - bytes[i] = number & 0xff - number = number >> 8 - } - return new Uint8Array(bytes) +function dist_src_vendor_base_x_base(ALPHABET, name) { + if (ALPHABET.length >= 255) { + throw new TypeError('Alphabet too long'); + } + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; + } + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { + throw new TypeError(x + ' is ambiguous'); + } + BASE_MAP[xc] = i; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up + var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up + /** + * @param {any[] | Iterable} source + */ + function encode(source) { + // @ts-ignore + if (source instanceof Uint8Array) + ; + else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } + else if (Array.isArray(source)) { + source = Uint8Array.from(source); + } + if (!(source instanceof Uint8Array)) { + throw new TypeError('Expected Uint8Array'); + } + if (source.length === 0) { + return ''; + } + // Skip & count leading zeroes. + var zeroes = 0; + var length = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } + // Allocate enough space in big-endian base58 representation. + var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; + var b58 = new Uint8Array(size); + // Process the bytes. + while (pbegin !== pend) { + var carry = source[pbegin]; + // Apply "b58 = b58 * 256 + ch". + var i = 0; + for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { + carry += (256 * b58[it1]) >>> 0; + b58[it1] = (carry % BASE) >>> 0; + carry = (carry / BASE) >>> 0; + } + if (carry !== 0) { + throw new Error('Non-zero carry'); + } + length = i; + pbegin++; + } + // Skip leading zeroes in base58 result. + var it2 = size - length; + while (it2 !== size && b58[it2] === 0) { + it2++; + } + // Translate the result into a string. + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { + str += ALPHABET.charAt(b58[it2]); + } + return str; + } + /** + * @param {string | string[]} source + */ + function decodeUnsafe(source) { + if (typeof source !== 'string') { + throw new TypeError('Expected String'); + } + if (source.length === 0) { + return new Uint8Array(); + } + var psz = 0; + // Skip leading spaces. + if (source[psz] === ' ') { + return; + } + // Skip and count leading '1's. + var zeroes = 0; + var length = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; + } + // Allocate enough space in big-endian base256 representation. + var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. + var b256 = new Uint8Array(size); + // Process the characters. + while (source[psz]) { + // Decode character + var carry = BASE_MAP[source.charCodeAt(psz)]; + // Invalid character + if (carry === 255) { + return; + } + var i = 0; + for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { + carry += (BASE * b256[it3]) >>> 0; + b256[it3] = (carry % 256) >>> 0; + carry = (carry / 256) >>> 0; + } + if (carry !== 0) { + throw new Error('Non-zero carry'); + } + length = i; + psz++; + } + // Skip trailing spaces. + if (source[psz] === ' ') { + return; + } + // Skip leading zeroes in b256. + var it4 = size - length; + while (it4 !== size && b256[it4] === 0) { + it4++; + } + var vch = new Uint8Array(zeroes + (size - it4)); + var j = zeroes; + while (it4 !== size) { + vch[j++] = b256[it4++]; + } + return vch; + } + /** + * @param {string | string[]} string + */ + function decode(string) { + var buffer = decodeUnsafe(string); + if (buffer) { + return buffer; + } + throw new Error(`Non-${name} character`); + } + return { + encode: encode, + decodeUnsafe: decodeUnsafe, + decode: decode + }; } +var dist_src_vendor_base_x_src = dist_src_vendor_base_x_base; +var dist_src_vendor_base_x_brrp_multiformats_scope_baseX = dist_src_vendor_base_x_src; +/* harmony default export */ const multiformats_dist_src_vendor_base_x = (dist_src_vendor_base_x_brrp_multiformats_scope_baseX); +//# sourceMappingURL=base-x.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base.js -const murmur332 = unixfs_node_modules_multiformats_src_hashes_hasher_from({ - name: 'murmur3-32', - code: 0x23, - encode: (input) => fromNumberTo32BitBuf(murmurhash3js_revisited.x86.hash32(input)) -}) - -const murmur3128 = unixfs_node_modules_multiformats_src_hashes_hasher_from({ - name: 'murmur3-128', - code: 0x22, - encode: (input) => unixfs_node_modules_multiformats_src_bytes_fromHex(murmurhash3js_revisited.x64.hash128(input)) -}) - -// A special-use 0x22 that truncates 64 bits, specifically for use in the UnixFS HAMT -const murmur364 = unixfs_node_modules_multiformats_src_hashes_hasher_from({ - name: 'murmur3-x64-64', - code: 0x22, - encode: (input) => unixfs_node_modules_multiformats_src_bytes_fromHex(murmurhash3js_revisited.x64.hash128(input)).subarray(0, 8) -}) -// EXTERNAL MODULE: ./node_modules/sparse-array/index.js -var sparse_array = __nccwpck_require__(59969); -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/uint8arrays/dist/src/util/as-uint8array.js /** - * To guarantee Uint8Array semantics, convert nodejs Buffers - * into vanilla Uint8Arrays + * Class represents both BaseEncoder and MultibaseEncoder meaning it + * can be used to encode to multibase or base encode without multibase + * prefix. */ -function unixfs_node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(buf) { - if (globalThis.Buffer != null) { - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); +class multiformats_dist_src_bases_base_Encoder { + name; + prefix; + baseEncode; + constructor(name, prefix, baseEncode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + } + encode(bytes) { + if (bytes instanceof Uint8Array) { + return `${this.prefix}${this.baseEncode(bytes)}`; + } + else { + throw Error('Unknown type, must be binary type'); + } } - return buf; } -//# sourceMappingURL=as-uint8array.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base10.js - - -const unixfs_node_modules_multiformats_src_bases_base10_base10 = unixfs_node_modules_multiformats_src_bases_base_baseX({ - prefix: '9', - name: 'base10', - alphabet: '0123456789' -}) - -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base16.js -// @ts-check - - - -const unixfs_node_modules_multiformats_src_bases_base16_base16 = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'f', - name: 'base16', - alphabet: '0123456789abcdef', - bitsPerChar: 4 -}) - -const unixfs_node_modules_multiformats_src_bases_base16_base16upper = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'F', - name: 'base16upper', - alphabet: '0123456789ABCDEF', - bitsPerChar: 4 -}) - -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base2.js -// @ts-check - - - -const unixfs_node_modules_multiformats_src_bases_base2_base2 = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: '0', - name: 'base2', - alphabet: '01', - bitsPerChar: 1 -}) - -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base256emoji.js - - -const unixfs_node_modules_multiformats_src_bases_base256emoji_alphabet = Array.from('🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂') -const unixfs_node_modules_multiformats_src_bases_base256emoji_alphabetBytesToChars = /** @type {string[]} */ (unixfs_node_modules_multiformats_src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[i] = c; return p }, /** @type {string[]} */([]))) -const unixfs_node_modules_multiformats_src_bases_base256emoji_alphabetCharsToBytes = /** @type {number[]} */ (unixfs_node_modules_multiformats_src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[/** @type {number} */ (c.codePointAt(0))] = i; return p }, /** @type {number[]} */([]))) - /** - * @param {Uint8Array} data - * @returns {string} + * Class represents both BaseDecoder and MultibaseDecoder so it could be used + * to decode multibases (with matching prefix) or just base decode strings + * with corresponding base encoding. */ -function unixfs_node_modules_multiformats_src_bases_base256emoji_encode (data) { - return data.reduce((p, c) => { - p += unixfs_node_modules_multiformats_src_bases_base256emoji_alphabetBytesToChars[c] - return p - }, '') +class multiformats_dist_src_bases_base_Decoder { + name; + prefix; + baseDecode; + prefixCodePoint; + constructor(name, prefix, baseDecode) { + this.name = name; + this.prefix = prefix; + /* c8 ignore next 3 */ + if (prefix.codePointAt(0) === undefined) { + throw new Error('Invalid prefix character'); + } + this.prefixCodePoint = prefix.codePointAt(0); + this.baseDecode = baseDecode; + } + decode(text) { + if (typeof text === 'string') { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); + } + return this.baseDecode(text.slice(this.prefix.length)); + } + else { + throw Error('Can only multibase decode strings'); + } + } + or(decoder) { + return multiformats_dist_src_bases_base_or(this, decoder); + } +} +class multiformats_dist_src_bases_base_ComposedDecoder { + decoders; + constructor(decoders) { + this.decoders = decoders; + } + or(decoder) { + return multiformats_dist_src_bases_base_or(this, decoder); + } + decode(input) { + const prefix = input[0]; + const decoder = this.decoders[prefix]; + if (decoder != null) { + return decoder.decode(input); + } + else { + throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); + } + } +} +function multiformats_dist_src_bases_base_or(left, right) { + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + return new multiformats_dist_src_bases_base_ComposedDecoder({ + ...(left.decoders ?? { [left.prefix]: left }), + ...(right.decoders ?? { [right.prefix]: right }) + }); +} +class multiformats_dist_src_bases_base_Codec { + name; + prefix; + baseEncode; + baseDecode; + encoder; + decoder; + constructor(name, prefix, baseEncode, baseDecode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + this.baseDecode = baseDecode; + this.encoder = new multiformats_dist_src_bases_base_Encoder(name, prefix, baseEncode); + this.decoder = new multiformats_dist_src_bases_base_Decoder(name, prefix, baseDecode); + } + encode(input) { + return this.encoder.encode(input); + } + decode(input) { + return this.decoder.decode(input); + } +} +function multiformats_dist_src_bases_base_from({ name, prefix, encode, decode }) { + return new multiformats_dist_src_bases_base_Codec(name, prefix, encode, decode); +} +function multiformats_dist_src_bases_base_baseX({ name, prefix, alphabet }) { + const { encode, decode } = multiformats_dist_src_vendor_base_x(alphabet, name); + return multiformats_dist_src_bases_base_from({ + prefix, + name, + encode, + decode: (text) => node_modules_multiformats_dist_src_bytes_coerce(decode(text)) + }); +} +function multiformats_dist_src_bases_base_decode(string, alphabet, bitsPerChar, name) { + // Build the character lookup table: + const codes = {}; + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i; + } + // Count the padding bytes: + let end = string.length; + while (string[end - 1] === '=') { + --end; + } + // Allocate the output: + const out = new Uint8Array((end * bitsPerChar / 8) | 0); + // Parse the data: + let bits = 0; // Number of bits currently in the buffer + let buffer = 0; // Bits waiting to be written out, MSB first + let written = 0; // Next byte to write + for (let i = 0; i < end; ++i) { + // Read one character from the string: + const value = codes[string[i]]; + if (value === undefined) { + throw new SyntaxError(`Non-${name} character`); + } + // Append the bits to the buffer: + buffer = (buffer << bitsPerChar) | value; + bits += bitsPerChar; + // Write out some bits if the buffer has a byte's worth: + if (bits >= 8) { + bits -= 8; + out[written++] = 0xff & (buffer >> bits); + } + } + // Verify that we have received just enough bits: + if (bits >= bitsPerChar || (0xff & (buffer << (8 - bits))) !== 0) { + throw new SyntaxError('Unexpected end of data'); + } + return out; } - -/** - * @param {string} str - * @returns {Uint8Array} - */ -function unixfs_node_modules_multiformats_src_bases_base256emoji_decode (str) { - const byts = [] - for (const char of str) { - const byt = unixfs_node_modules_multiformats_src_bases_base256emoji_alphabetCharsToBytes[/** @type {number} */ (char.codePointAt(0))] - if (byt === undefined) { - throw new Error(`Non-base256emoji character: ${char}`) +function multiformats_dist_src_bases_base_encode(data, alphabet, bitsPerChar) { + const pad = alphabet[alphabet.length - 1] === '='; + const mask = (1 << bitsPerChar) - 1; + let out = ''; + let bits = 0; // Number of bits currently in the buffer + let buffer = 0; // Bits waiting to be written out, MSB first + for (let i = 0; i < data.length; ++i) { + // Slurp data into the buffer: + buffer = (buffer << 8) | data[i]; + bits += 8; + // Write out as much as we can: + while (bits > bitsPerChar) { + bits -= bitsPerChar; + out += alphabet[mask & (buffer >> bits)]; + } } - byts.push(byt) - } - return new Uint8Array(byts) + // Partial character: + if (bits !== 0) { + out += alphabet[mask & (buffer << (bitsPerChar - bits))]; + } + // Add padding characters until we hit a byte boundary: + if (pad) { + while (((out.length * bitsPerChar) & 7) !== 0) { + out += '='; + } + } + return out; } - -const unixfs_node_modules_multiformats_src_bases_base256emoji_base256emoji = unixfs_node_modules_multiformats_src_bases_base_from({ - prefix: '🚀', - name: 'base256emoji', - encode: unixfs_node_modules_multiformats_src_bases_base256emoji_encode, - decode: unixfs_node_modules_multiformats_src_bases_base256emoji_decode -}) - -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base36.js - - -const unixfs_node_modules_multiformats_src_bases_base36_base36 = unixfs_node_modules_multiformats_src_bases_base_baseX({ - prefix: 'k', - name: 'base36', - alphabet: '0123456789abcdefghijklmnopqrstuvwxyz' -}) - -const unixfs_node_modules_multiformats_src_bases_base36_base36upper = unixfs_node_modules_multiformats_src_bases_base_baseX({ - prefix: 'K', - name: 'base36upper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' -}) - -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base64.js -// @ts-check - - - -const unixfs_node_modules_multiformats_src_bases_base64_base64 = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'm', - name: 'base64', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', - bitsPerChar: 6 -}) - -const unixfs_node_modules_multiformats_src_bases_base64_base64pad = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'M', - name: 'base64pad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', - bitsPerChar: 6 -}) - -const unixfs_node_modules_multiformats_src_bases_base64_base64url = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'u', - name: 'base64url', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', - bitsPerChar: 6 -}) - -const unixfs_node_modules_multiformats_src_bases_base64_base64urlpad = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'U', - name: 'base64urlpad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', - bitsPerChar: 6 -}) - -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base8.js -// @ts-check - - - -const unixfs_node_modules_multiformats_src_bases_base8_base8 = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: '7', - name: 'base8', - alphabet: '01234567', - bitsPerChar: 3 -}) - -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/identity.js -// @ts-check - - - - -const unixfs_node_modules_multiformats_src_bases_identity_identity = unixfs_node_modules_multiformats_src_bases_base_from({ - prefix: '\x00', - name: 'identity', - encode: (buf) => unixfs_node_modules_multiformats_src_bytes_toString(buf), - decode: (str) => unixfs_node_modules_multiformats_src_bytes_fromString(str) -}) - -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/codecs/json.js -// @ts-check - /** - * @template T - * @typedef {import('./interface.js').ByteView} ByteView + * RFC4648 Factory */ +function multiformats_dist_src_bases_base_rfc4648({ name, prefix, bitsPerChar, alphabet }) { + return multiformats_dist_src_bases_base_from({ + prefix, + name, + encode(input) { + return multiformats_dist_src_bases_base_encode(input, alphabet, bitsPerChar); + }, + decode(input) { + return multiformats_dist_src_bases_base_decode(input, alphabet, bitsPerChar, name); + } + }); +} +//# sourceMappingURL=base.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base32.js -const unixfs_node_modules_multiformats_src_codecs_json_textEncoder = new TextEncoder() -const unixfs_node_modules_multiformats_src_codecs_json_textDecoder = new TextDecoder() - -const unixfs_node_modules_multiformats_src_codecs_json_name = 'json' -const unixfs_node_modules_multiformats_src_codecs_json_code = 0x0200 +const multiformats_dist_src_bases_base32_base32 = multiformats_dist_src_bases_base_rfc4648({ + prefix: 'b', + name: 'base32', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567', + bitsPerChar: 5 +}); +const multiformats_dist_src_bases_base32_base32upper = multiformats_dist_src_bases_base_rfc4648({ + prefix: 'B', + name: 'base32upper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', + bitsPerChar: 5 +}); +const multiformats_dist_src_bases_base32_base32pad = multiformats_dist_src_bases_base_rfc4648({ + prefix: 'c', + name: 'base32pad', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', + bitsPerChar: 5 +}); +const multiformats_dist_src_bases_base32_base32padupper = multiformats_dist_src_bases_base_rfc4648({ + prefix: 'C', + name: 'base32padupper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', + bitsPerChar: 5 +}); +const multiformats_dist_src_bases_base32_base32hex = multiformats_dist_src_bases_base_rfc4648({ + prefix: 'v', + name: 'base32hex', + alphabet: '0123456789abcdefghijklmnopqrstuv', + bitsPerChar: 5 +}); +const multiformats_dist_src_bases_base32_base32hexupper = multiformats_dist_src_bases_base_rfc4648({ + prefix: 'V', + name: 'base32hexupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', + bitsPerChar: 5 +}); +const multiformats_dist_src_bases_base32_base32hexpad = multiformats_dist_src_bases_base_rfc4648({ + prefix: 't', + name: 'base32hexpad', + alphabet: '0123456789abcdefghijklmnopqrstuv=', + bitsPerChar: 5 +}); +const multiformats_dist_src_bases_base32_base32hexpadupper = multiformats_dist_src_bases_base_rfc4648({ + prefix: 'T', + name: 'base32hexpadupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', + bitsPerChar: 5 +}); +const multiformats_dist_src_bases_base32_base32z = multiformats_dist_src_bases_base_rfc4648({ + prefix: 'h', + name: 'base32z', + alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', + bitsPerChar: 5 +}); +//# sourceMappingURL=base32.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base58.js +const multiformats_dist_src_bases_base58_base58btc = multiformats_dist_src_bases_base_baseX({ + name: 'base58btc', + prefix: 'z', + alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +}); +const multiformats_dist_src_bases_base58_base58flickr = multiformats_dist_src_bases_base_baseX({ + name: 'base58flickr', + prefix: 'Z', + alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' +}); +//# sourceMappingURL=base58.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/vendor/varint.js +/* eslint-disable */ +var dist_src_vendor_varint_encode_1 = multiformats_dist_src_vendor_varint_encode; +var dist_src_vendor_varint_MSB = 0x80, dist_src_vendor_varint_REST = 0x7F, dist_src_vendor_varint_MSBALL = ~dist_src_vendor_varint_REST, dist_src_vendor_varint_INT = Math.pow(2, 31); /** - * @template T - * @param {T} node - * @returns {ByteView} + * @param {number} num + * @param {number[]} out + * @param {number} offset */ -const unixfs_node_modules_multiformats_src_codecs_json_encode = (node) => unixfs_node_modules_multiformats_src_codecs_json_textEncoder.encode(JSON.stringify(node)) - +function multiformats_dist_src_vendor_varint_encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; + while (num >= dist_src_vendor_varint_INT) { + out[offset++] = (num & 0xFF) | dist_src_vendor_varint_MSB; + num /= 128; + } + while (num & dist_src_vendor_varint_MSBALL) { + out[offset++] = (num & 0xFF) | dist_src_vendor_varint_MSB; + num >>>= 7; + } + out[offset] = num | 0; + // @ts-ignore + multiformats_dist_src_vendor_varint_encode.bytes = offset - oldOffset + 1; + return out; +} +var multiformats_dist_src_vendor_varint_decode = dist_src_vendor_varint_read; +var dist_src_vendor_varint_MSB$1 = 0x80, dist_src_vendor_varint_REST$1 = 0x7F; /** - * @template T - * @param {ByteView} data - * @returns {T} + * @param {string | any[]} buf + * @param {number} offset */ -const unixfs_node_modules_multiformats_src_codecs_json_decode = (data) => JSON.parse(unixfs_node_modules_multiformats_src_codecs_json_textDecoder.decode(data)) - -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/codecs/raw.js -// @ts-check - - +function dist_src_vendor_varint_read(buf, offset) { + var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length; + do { + if (counter >= l) { + // @ts-ignore + dist_src_vendor_varint_read.bytes = 0; + throw new RangeError('Could not decode varint'); + } + b = buf[counter++]; + res += shift < 28 + ? (b & dist_src_vendor_varint_REST$1) << shift + : (b & dist_src_vendor_varint_REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= dist_src_vendor_varint_MSB$1); + // @ts-ignore + dist_src_vendor_varint_read.bytes = counter - offset; + return res; +} +var dist_src_vendor_varint_N1 = Math.pow(2, 7); +var dist_src_vendor_varint_N2 = Math.pow(2, 14); +var dist_src_vendor_varint_N3 = Math.pow(2, 21); +var dist_src_vendor_varint_N4 = Math.pow(2, 28); +var dist_src_vendor_varint_N5 = Math.pow(2, 35); +var dist_src_vendor_varint_N6 = Math.pow(2, 42); +var dist_src_vendor_varint_N7 = Math.pow(2, 49); +var dist_src_vendor_varint_N8 = Math.pow(2, 56); +var dist_src_vendor_varint_N9 = Math.pow(2, 63); +var multiformats_dist_src_vendor_varint_length = function (/** @type {number} */ value) { + return (value < dist_src_vendor_varint_N1 ? 1 + : value < dist_src_vendor_varint_N2 ? 2 + : value < dist_src_vendor_varint_N3 ? 3 + : value < dist_src_vendor_varint_N4 ? 4 + : value < dist_src_vendor_varint_N5 ? 5 + : value < dist_src_vendor_varint_N6 ? 6 + : value < dist_src_vendor_varint_N7 ? 7 + : value < dist_src_vendor_varint_N8 ? 8 + : value < dist_src_vendor_varint_N9 ? 9 + : 10); +}; +var multiformats_dist_src_vendor_varint_varint = { + encode: dist_src_vendor_varint_encode_1, + decode: multiformats_dist_src_vendor_varint_decode, + encodingLength: multiformats_dist_src_vendor_varint_length +}; +var dist_src_vendor_varint_brrp_varint = multiformats_dist_src_vendor_varint_varint; +/* harmony default export */ const node_modules_multiformats_dist_src_vendor_varint = (dist_src_vendor_varint_brrp_varint); +//# sourceMappingURL=varint.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/varint.js -/** - * @template T - * @typedef {import('./interface.js').ByteView} ByteView - */ +function ipfs_unixfs_importer_node_modules_multiformats_dist_src_varint_decode(data, offset = 0) { + const code = node_modules_multiformats_dist_src_vendor_varint.decode(data, offset); + return [code, node_modules_multiformats_dist_src_vendor_varint.decode.bytes]; +} +function multiformats_dist_src_varint_encodeTo(int, target, offset = 0) { + node_modules_multiformats_dist_src_vendor_varint.encode(int, target, offset); + return target; +} +function multiformats_dist_src_varint_encodingLength(int) { + return node_modules_multiformats_dist_src_vendor_varint.encodingLength(int); +} +//# sourceMappingURL=varint.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/hashes/digest.js -const unixfs_node_modules_multiformats_src_codecs_raw_name = 'raw' -const unixfs_node_modules_multiformats_src_codecs_raw_code = 0x55 /** - * @param {Uint8Array} node - * @returns {ByteView} + * Creates a multihash digest. */ -const unixfs_node_modules_multiformats_src_codecs_raw_encode = (node) => unixfs_node_modules_multiformats_src_bytes_coerce(node) - +function multiformats_dist_src_hashes_digest_create(code, digest) { + const size = digest.byteLength; + const sizeOffset = multiformats_dist_src_varint_encodingLength(code); + const digestOffset = sizeOffset + multiformats_dist_src_varint_encodingLength(size); + const bytes = new Uint8Array(digestOffset + size); + multiformats_dist_src_varint_encodeTo(code, bytes, 0); + multiformats_dist_src_varint_encodeTo(size, bytes, sizeOffset); + bytes.set(digest, digestOffset); + return new multiformats_dist_src_hashes_digest_Digest(code, size, digest, bytes); +} /** - * @param {ByteView} data - * @returns {Uint8Array} + * Turns bytes representation of multihash digest into an instance. */ -const unixfs_node_modules_multiformats_src_codecs_raw_decode = (data) => unixfs_node_modules_multiformats_src_bytes_coerce(data) - -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/hashes/identity.js - - - -const unixfs_node_modules_multiformats_src_hashes_identity_code = 0x0 -const unixfs_node_modules_multiformats_src_hashes_identity_name = 'identity' - -/** @type {(input:Uint8Array) => Uint8Array} */ -const unixfs_node_modules_multiformats_src_hashes_identity_encode = unixfs_node_modules_multiformats_src_bytes_coerce - +function multiformats_dist_src_hashes_digest_decode(multihash) { + const bytes = node_modules_multiformats_dist_src_bytes_coerce(multihash); + const [code, sizeOffset] = ipfs_unixfs_importer_node_modules_multiformats_dist_src_varint_decode(bytes); + const [size, digestOffset] = ipfs_unixfs_importer_node_modules_multiformats_dist_src_varint_decode(bytes.subarray(sizeOffset)); + const digest = bytes.subarray(sizeOffset + digestOffset); + if (digest.byteLength !== size) { + throw new Error('Incorrect length'); + } + return new multiformats_dist_src_hashes_digest_Digest(code, size, digest, bytes); +} +function multiformats_dist_src_hashes_digest_equals(a, b) { + if (a === b) { + return true; + } + else { + const data = b; + return (a.code === data.code && + a.size === data.size && + data.bytes instanceof Uint8Array && + multiformats_dist_src_bytes_equals(a.bytes, data.bytes)); + } +} /** - * @param {Uint8Array} input - * @returns {Digest.Digest} + * Represents a multihash digest which carries information about the + * hashing algorithm and an actual hash digest. */ -const unixfs_node_modules_multiformats_src_hashes_identity_digest = (input) => unixfs_node_modules_multiformats_src_hashes_digest_create(unixfs_node_modules_multiformats_src_hashes_identity_code, unixfs_node_modules_multiformats_src_hashes_identity_encode(input)) - -const unixfs_node_modules_multiformats_src_hashes_identity_identity = { code: unixfs_node_modules_multiformats_src_hashes_identity_code, name: unixfs_node_modules_multiformats_src_hashes_identity_name, encode: unixfs_node_modules_multiformats_src_hashes_identity_encode, digest: unixfs_node_modules_multiformats_src_hashes_identity_digest } - -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/hashes/sha2.js -// @ts-check - - - - - -const unixfs_node_modules_multiformats_src_hashes_sha2_sha256 = unixfs_node_modules_multiformats_src_hashes_hasher_from({ - name: 'sha2-256', - code: 0x12, - encode: (input) => unixfs_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha256').update(input).digest()) -}) - -const unixfs_node_modules_multiformats_src_hashes_sha2_sha512 = unixfs_node_modules_multiformats_src_hashes_hasher_from({ - name: 'sha2-512', - code: 0x13, - encode: input => unixfs_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha512').update(input).digest()) -}) - -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/basics.js -// @ts-check - - - - - - - - - - - - - - - +class multiformats_dist_src_hashes_digest_Digest { + code; + size; + digest; + bytes; + /** + * Creates a multihash digest. + */ + constructor(code, size, digest, bytes) { + this.code = code; + this.size = size; + this.digest = digest; + this.bytes = bytes; + } +} +//# sourceMappingURL=digest.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/cid.js -const unixfs_node_modules_multiformats_src_basics_bases = { ...unixfs_node_modules_multiformats_src_bases_identity_namespaceObject, ...unixfs_node_modules_multiformats_src_bases_base2_namespaceObject, ...unixfs_node_modules_multiformats_src_bases_base8_namespaceObject, ...unixfs_node_modules_multiformats_src_bases_base10_namespaceObject, ...unixfs_node_modules_multiformats_src_bases_base16_namespaceObject, ...unixfs_node_modules_multiformats_src_bases_base32_namespaceObject, ...unixfs_node_modules_multiformats_src_bases_base36_namespaceObject, ...unixfs_node_modules_multiformats_src_bases_base58_namespaceObject, ...unixfs_node_modules_multiformats_src_bases_base64_namespaceObject, ...unixfs_node_modules_multiformats_src_bases_base256emoji_namespaceObject } -const unixfs_node_modules_multiformats_src_basics_hashes = { ...unixfs_node_modules_multiformats_src_hashes_sha2_namespaceObject, ...unixfs_node_modules_multiformats_src_hashes_identity_namespaceObject } -const unixfs_node_modules_multiformats_src_basics_codecs = { raw: unixfs_node_modules_multiformats_src_codecs_raw_namespaceObject, json: unixfs_node_modules_multiformats_src_codecs_json_namespaceObject } -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/uint8arrays/dist/src/alloc.js +// This way TS will also expose all the types from module -/** - * Returns a `Uint8Array` of the requested size. Referenced memory will - * be initialized to 0. - */ -function unixfs_node_modules_uint8arrays_dist_src_alloc_alloc(size = 0) { - if (globalThis.Buffer?.alloc != null) { - return asUint8Array(globalThis.Buffer.alloc(size)); - } - return new Uint8Array(size); -} -/** - * Where possible returns a Uint8Array of the requested size that references - * uninitialized memory. Only use if you are certain you will immediately - * overwrite every value in the returned `Uint8Array`. - */ -function unixfs_node_modules_uint8arrays_dist_src_alloc_allocUnsafe(size = 0) { - if (globalThis.Buffer?.allocUnsafe != null) { - return unixfs_node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.allocUnsafe(size)); +function multiformats_dist_src_cid_format(link, base) { + const { bytes, version } = link; + switch (version) { + case 0: + return multiformats_dist_src_cid_toStringV0(bytes, multiformats_dist_src_cid_baseCache(link), base ?? multiformats_dist_src_bases_base58_base58btc.encoder); + default: + return multiformats_dist_src_cid_toStringV1(bytes, multiformats_dist_src_cid_baseCache(link), (base ?? multiformats_dist_src_bases_base32_base32.encoder)); } - return new Uint8Array(size); } -//# sourceMappingURL=alloc.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/uint8arrays/dist/src/util/bases.js - - -function uint8arrays_dist_src_util_bases_createCodec(name, prefix, encode, decode) { +function multiformats_dist_src_cid_toJSON(link) { return { - name, - prefix, - encoder: { - name, - prefix, - encode - }, - decoder: { - decode - } + '/': multiformats_dist_src_cid_format(link) }; } -const uint8arrays_dist_src_util_bases_string = uint8arrays_dist_src_util_bases_createCodec('utf8', 'u', (buf) => { - const decoder = new TextDecoder('utf8'); - return 'u' + decoder.decode(buf); -}, (str) => { - const encoder = new TextEncoder(); - return encoder.encode(str.substring(1)); -}); -const uint8arrays_dist_src_util_bases_ascii = uint8arrays_dist_src_util_bases_createCodec('ascii', 'a', (buf) => { - let string = 'a'; - for (let i = 0; i < buf.length; i++) { - string += String.fromCharCode(buf[i]); - } - return string; -}, (str) => { - str = str.substring(1); - const buf = unixfs_node_modules_uint8arrays_dist_src_alloc_allocUnsafe(str.length); - for (let i = 0; i < str.length; i++) { - buf[i] = str.charCodeAt(i); - } - return buf; -}); -const uint8arrays_dist_src_util_bases_BASES = { - utf8: uint8arrays_dist_src_util_bases_string, - 'utf-8': uint8arrays_dist_src_util_bases_string, - hex: unixfs_node_modules_multiformats_src_basics_bases.base16, - latin1: uint8arrays_dist_src_util_bases_ascii, - ascii: uint8arrays_dist_src_util_bases_ascii, - binary: uint8arrays_dist_src_util_bases_ascii, - ...unixfs_node_modules_multiformats_src_basics_bases -}; -/* harmony default export */ const unixfs_node_modules_uint8arrays_dist_src_util_bases = (uint8arrays_dist_src_util_bases_BASES); -//# sourceMappingURL=bases.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/uint8arrays/dist/src/from-string.js - - -/** - * Create a `Uint8Array` from the passed string - * - * Supports `utf8`, `utf-8`, `hex`, and any encoding supported by the multiformats module. - * - * Also `ascii` which is similar to node's 'binary' encoding. - */ -function unixfs_node_modules_uint8arrays_dist_src_from_string_fromString(string, encoding = 'utf8') { - const base = unixfs_node_modules_uint8arrays_dist_src_util_bases[encoding]; - if (base == null) { - throw new Error(`Unsupported encoding "${encoding}"`); - } - if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) { - return unixfs_node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.from(string, 'utf-8')); +function multiformats_dist_src_cid_fromJSON(json) { + return node_modules_multiformats_dist_src_cid_CID.parse(json['/']); +} +const multiformats_dist_src_cid_cache = new WeakMap(); +function multiformats_dist_src_cid_baseCache(cid) { + const baseCache = multiformats_dist_src_cid_cache.get(cid); + if (baseCache == null) { + const baseCache = new Map(); + multiformats_dist_src_cid_cache.set(cid, baseCache); + return baseCache; } - // add multibase prefix - return base.decoder.decode(`${base.prefix}${string}`); // eslint-disable-line @typescript-eslint/restrict-template-expressions + return baseCache; } -//# sourceMappingURL=from-string.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/hamt-sharding/dist/src/bucket.js -// @ts-expect-error - - -class Bucket { - constructor(options, parent, posAtParent = 0) { - this._options = options; - this._popCount = 0; - this._parent = parent; - this._posAtParent = posAtParent; - this._children = new sparse_array(); - this.key = null; +class node_modules_multiformats_dist_src_cid_CID { + code; + version; + multihash; + bytes; + '/'; + /** + * @param version - Version of the CID + * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param multihash - (Multi)hash of the of the content. + */ + constructor(version, code, multihash, bytes) { + this.code = code; + this.version = version; + this.multihash = multihash; + this.bytes = bytes; + // flag to serializers that this is a CID and + // should be treated specially + this['/'] = bytes; } - async put(key, value) { - const place = await this._findNewBucketAndPos(key); - await place.bucket._putAt(place, key, value); + /** + * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` + * please either use `CID.asCID(cid)` or switch to new signalling mechanism + * + * @deprecated + */ + get asCID() { + return this; } - async get(key) { - const child = await this._findChild(key); - if (child != null) { - return child.value; - } + // ArrayBufferView + get byteOffset() { + return this.bytes.byteOffset; } - async del(key) { - const place = await this._findPlace(key); - const child = place.bucket._at(place.pos); - if (child != null && child.key === key) { - place.bucket._delAt(place.pos); - } + // ArrayBufferView + get byteLength() { + return this.bytes.byteLength; } - leafCount() { - const children = this._children.compactArray(); - return children.reduce((acc, child) => { - if (child instanceof Bucket) { - return acc + child.leafCount(); + toV0() { + switch (this.version) { + case 0: { + return this; } - return acc + 1; - }, 0); - } - childrenCount() { - return this._children.length; - } - onlyChild() { - return this._children.get(0); - } - *eachLeafSeries() { - const children = this._children.compactArray(); - for (const child of children) { - if (child instanceof Bucket) { - yield* child.eachLeafSeries(); + case 1: { + const { code, multihash } = this; + if (code !== multiformats_dist_src_cid_DAG_PB_CODE) { + throw new Error('Cannot convert a non dag-pb CID to CIDv0'); + } + // sha2-256 + if (multihash.code !== multiformats_dist_src_cid_SHA_256_CODE) { + throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0'); + } + return (node_modules_multiformats_dist_src_cid_CID.createV0(multihash)); } - else { - yield child; + default: { + throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`); } } } - serialize(map, reduce) { - const acc = []; - // serialize to a custom non-sparse representation - return reduce(this._children.reduce((acc, child, index) => { - if (child != null) { - if (child instanceof Bucket) { - acc.push(child.serialize(map, reduce)); - } - else { - acc.push(map(child, index)); - } + toV1() { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash; + const multihash = multiformats_dist_src_hashes_digest_create(code, digest); + return (node_modules_multiformats_dist_src_cid_CID.createV1(this.code, multihash)); } - return acc; - }, acc)); + case 1: { + return this; + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`); + } + } } - async asyncTransform(asyncMap, asyncReduce) { - return await asyncTransformBucket(this, asyncMap, asyncReduce); + equals(other) { + return node_modules_multiformats_dist_src_cid_CID.equals(this, other); + } + static equals(self, other) { + const unknown = other; + return (unknown != null && + self.code === unknown.code && + self.version === unknown.version && + multiformats_dist_src_hashes_digest_equals(self.multihash, unknown.multihash)); + } + toString(base) { + return multiformats_dist_src_cid_format(this, base); } toJSON() { - return this.serialize(mapNode, reduceNodes); + return { '/': multiformats_dist_src_cid_format(this) }; } - prettyPrint() { - return JSON.stringify(this.toJSON(), null, ' '); + link() { + return this; } - tableSize() { - return Math.pow(2, this._options.bits); + [Symbol.toStringTag] = 'CID'; + // Legacy + [Symbol.for('nodejs.util.inspect.custom')]() { + return `CID(${this.toString()})`; } - async _findChild(key) { - const result = await this._findPlace(key); - const child = result.bucket._at(result.pos); - if (child instanceof Bucket) { - // should not be possible, this._findPlace should always - // return a location for a child, not a bucket - return undefined; + /** + * Takes any input `value` and returns a `CID` instance if it was + * a `CID` otherwise returns `null`. If `value` is instanceof `CID` + * it will return value back. If `value` is not instance of this CID + * class, but is compatible CID it will return new instance of this + * `CID` class. Otherwise returns null. + * + * This allows two different incompatible versions of CID library to + * co-exist and interop as long as binary interface is compatible. + */ + static asCID(input) { + if (input == null) { + return null; } - if (child != null && child.key === key) { - return child; + const value = input; + if (value instanceof node_modules_multiformats_dist_src_cid_CID) { + // If value is instance of CID then we're all set. + return value; } - } - async _findPlace(key) { - const hashValue = this._options.hash(typeof key === 'string' ? unixfs_node_modules_uint8arrays_dist_src_from_string_fromString(key) : key); - const index = await hashValue.take(this._options.bits); - const child = this._children.get(index); - if (child instanceof Bucket) { - return await child._findPlace(hashValue); + else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { + // If value isn't instance of this CID class but `this.asCID === this` or + // `value['/'] === value.bytes` is true it is CID instance coming from a + // different implementation (diff version or duplicate). In that case we + // rebase it to this `CID` implementation so caller is guaranteed to get + // instance with expected API. + const { version, code, multihash, bytes } = value; + return new node_modules_multiformats_dist_src_cid_CID(version, code, multihash, bytes ?? multiformats_dist_src_cid_encodeCID(version, code, multihash.bytes)); } - return { - bucket: this, - pos: index, - hash: hashValue, - existingChild: child - }; - } - async _findNewBucketAndPos(key) { - const place = await this._findPlace(key); - if ((place.existingChild != null) && place.existingChild.key !== key) { - // conflict - const bucket = new Bucket(this._options, place.bucket, place.pos); - place.bucket._putObjectAt(place.pos, bucket); - // put the previous value - const newPlace = await bucket._findPlace(place.existingChild.hash); - newPlace.bucket._putAt(newPlace, place.existingChild.key, place.existingChild.value); - return await bucket._findNewBucketAndPos(place.hash); + else if (value[multiformats_dist_src_cid_cidSymbol] === true) { + // If value is a CID from older implementation that used to be tagged via + // symbol we still rebase it to the this `CID` implementation by + // delegating that to a constructor. + const { version, multihash, code } = value; + const digest = multiformats_dist_src_hashes_digest_decode(multihash); + return node_modules_multiformats_dist_src_cid_CID.create(version, code, digest); } - // no conflict, we found the place - return place; - } - _putAt(place, key, value) { - this._putObjectAt(place.pos, { - key: key, - value: value, - hash: place.hash - }); - } - _putObjectAt(pos, object) { - if (this._children.get(pos) == null) { - this._popCount++; + else { + // Otherwise value is not a CID (or an incompatible version of it) in + // which case we return `null`. + return null; } - this._children.set(pos, object); } - _delAt(pos) { - if (pos === -1) { - throw new Error('Invalid position'); + /** + * @param version - Version of the CID + * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param digest - (Multi)hash of the of the content. + */ + static create(version, code, digest) { + if (typeof code !== 'number') { + throw new Error('String codecs are no longer supported'); } - if (this._children.get(pos) != null) { - this._popCount--; + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error('Invalid digest'); } - this._children.unset(pos); - this._level(); - } - _level() { - if (this._parent != null && this._popCount <= 1) { - if (this._popCount === 1) { - // remove myself from parent, replacing me with my only child - const onlyChild = this._children.find(exists); - if ((onlyChild != null) && !(onlyChild instanceof Bucket)) { - const hash = onlyChild.hash; - hash.untake(this._options.bits); - const place = { - pos: this._posAtParent, - hash: hash, - bucket: this._parent - }; - this._parent._putAt(place, onlyChild.key, onlyChild.value); + switch (version) { + case 0: { + if (code !== multiformats_dist_src_cid_DAG_PB_CODE) { + throw new Error(`Version 0 CID must use dag-pb (code: ${multiformats_dist_src_cid_DAG_PB_CODE}) block encoding`); + } + else { + return new node_modules_multiformats_dist_src_cid_CID(version, code, digest, digest.bytes); } } - else { - this._parent._delAt(this._posAtParent); + case 1: { + const bytes = multiformats_dist_src_cid_encodeCID(version, code, digest.bytes); + return new node_modules_multiformats_dist_src_cid_CID(version, code, digest, bytes); + } + default: { + throw new Error('Invalid version'); } } } - _at(index) { - return this._children.get(index); + /** + * Simplified version of `create` for CIDv0. + */ + static createV0(digest) { + return node_modules_multiformats_dist_src_cid_CID.create(0, multiformats_dist_src_cid_DAG_PB_CODE, digest); } -} -function exists(o) { - return Boolean(o); -} -function mapNode(node, _) { - return node.key; -} -function reduceNodes(nodes) { - return nodes; -} -async function asyncTransformBucket(bucket, asyncMap, asyncReduce) { - const output = []; - for (const child of bucket._children.compactArray()) { - if (child instanceof Bucket) { - await asyncTransformBucket(child, asyncMap, asyncReduce); - } - else { - const mappedChildren = await asyncMap(child); - output.push({ - bitField: bucket._children.bitField(), - children: mappedChildren - }); + /** + * Simplified version of `create` for CIDv1. + * + * @param code - Content encoding format code. + * @param digest - Multihash of the content. + */ + static createV1(code, digest) { + return node_modules_multiformats_dist_src_cid_CID.create(1, code, digest); + } + /** + * Decoded a CID from its binary representation. The byte array must contain + * only the CID with no additional bytes. + * + * An error will be thrown if the bytes provided do not contain a valid + * binary representation of a CID. + */ + static decode(bytes) { + const [cid, remainder] = node_modules_multiformats_dist_src_cid_CID.decodeFirst(bytes); + if (remainder.length !== 0) { + throw new Error('Incorrect length'); } + return cid; } - return await asyncReduce(output); -} -//# sourceMappingURL=bucket.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/hamt-sharding/dist/src/consumable-buffer.js -const START_MASKS = [ - 0b11111111, - 0b11111110, - 0b11111100, - 0b11111000, - 0b11110000, - 0b11100000, - 0b11000000, - 0b10000000 -]; -const STOP_MASKS = [ - 0b00000001, - 0b00000011, - 0b00000111, - 0b00001111, - 0b00011111, - 0b00111111, - 0b01111111, - 0b11111111 -]; -class ConsumableBuffer { - constructor(value) { - this._value = value; - this._currentBytePos = value.length - 1; - this._currentBitPos = 7; + /** + * Decoded a CID from its binary representation at the beginning of a byte + * array. + * + * Returns an array with the first element containing the CID and the second + * element containing the remainder of the original byte array. The remainder + * will be a zero-length byte array if the provided bytes only contained a + * binary CID representation. + */ + static decodeFirst(bytes) { + const specs = node_modules_multiformats_dist_src_cid_CID.inspectBytes(bytes); + const prefixSize = specs.size - specs.multihashSize; + const multihashBytes = node_modules_multiformats_dist_src_bytes_coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize)); + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error('Incorrect length'); + } + const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize); + const digest = new multiformats_dist_src_hashes_digest_Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); + const cid = specs.version === 0 + ? node_modules_multiformats_dist_src_cid_CID.createV0(digest) + : node_modules_multiformats_dist_src_cid_CID.createV1(specs.codec, digest); + return [cid, bytes.subarray(specs.size)]; } - availableBits() { - return this._currentBitPos + 1 + this._currentBytePos * 8; + /** + * Inspect the initial bytes of a CID to determine its properties. + * + * Involves decoding up to 4 varints. Typically this will require only 4 to 6 + * bytes but for larger multicodec code values and larger multihash digest + * lengths these varints can be quite large. It is recommended that at least + * 10 bytes be made available in the `initialBytes` argument for a complete + * inspection. + */ + static inspectBytes(initialBytes) { + let offset = 0; + const next = () => { + const [i, length] = ipfs_unixfs_importer_node_modules_multiformats_dist_src_varint_decode(initialBytes.subarray(offset)); + offset += length; + return i; + }; + let version = next(); + let codec = multiformats_dist_src_cid_DAG_PB_CODE; + if (version === 18) { + // CIDv0 + version = 0; + offset = 0; + } + else { + codec = next(); + } + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`); + } + const prefixSize = offset; + const multihashCode = next(); // multihash code + const digestSize = next(); // multihash length + const size = offset + digestSize; + const multihashSize = size - prefixSize; + return { version, codec, multihashCode, digestSize, multihashSize, size }; } - totalBits() { - return this._value.length * 8; + /** + * Takes cid in a string representation and creates an instance. If `base` + * decoder is not provided will use a default from the configuration. It will + * throw an error if encoding of the CID is not compatible with supplied (or + * a default decoder). + */ + static parse(source, base) { + const [prefix, bytes] = multiformats_dist_src_cid_parseCIDtoBytes(source, base); + const cid = node_modules_multiformats_dist_src_cid_CID.decode(bytes); + if (cid.version === 0 && source[0] !== 'Q') { + throw Error('Version 0 CID string must not include multibase prefix'); + } + // Cache string representation to avoid computing it on `this.toString()` + multiformats_dist_src_cid_baseCache(cid).set(prefix, source); + return cid; } - take(bits) { - let pendingBits = bits; - let result = 0; - while (pendingBits > 0 && this._haveBits()) { - const byte = this._value[this._currentBytePos]; - const availableBits = this._currentBitPos + 1; - const taking = Math.min(availableBits, pendingBits); - const value = byteBitsToInt(byte, availableBits - taking, taking); - result = (result << taking) + value; - pendingBits -= taking; - this._currentBitPos -= taking; - if (this._currentBitPos < 0) { - this._currentBitPos = 7; - this._currentBytePos--; +} +function multiformats_dist_src_cid_parseCIDtoBytes(source, base) { + switch (source[0]) { + // CIDv0 is parsed differently + case 'Q': { + const decoder = base ?? multiformats_dist_src_bases_base58_base58btc; + return [ + multiformats_dist_src_bases_base58_base58btc.prefix, + decoder.decode(`${multiformats_dist_src_bases_base58_base58btc.prefix}${source}`) + ]; + } + case multiformats_dist_src_bases_base58_base58btc.prefix: { + const decoder = base ?? multiformats_dist_src_bases_base58_base58btc; + return [multiformats_dist_src_bases_base58_base58btc.prefix, decoder.decode(source)]; + } + case multiformats_dist_src_bases_base32_base32.prefix: { + const decoder = base ?? multiformats_dist_src_bases_base32_base32; + return [multiformats_dist_src_bases_base32_base32.prefix, decoder.decode(source)]; + } + default: { + if (base == null) { + throw Error('To parse non base32 or base58btc encoded CID multibase decoder must be provided'); } + return [source[0], base.decode(source)]; } - return result; } - untake(bits) { - this._currentBitPos += bits; - while (this._currentBitPos > 7) { - this._currentBitPos -= 8; - this._currentBytePos += 1; - } +} +function multiformats_dist_src_cid_toStringV0(bytes, cache, base) { + const { prefix } = base; + if (prefix !== multiformats_dist_src_bases_base58_base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base.name} encoding`); } - _haveBits() { - return this._currentBytePos >= 0; + const cid = cache.get(prefix); + if (cid == null) { + const cid = base.encode(bytes).slice(1); + cache.set(prefix, cid); + return cid; + } + else { + return cid; } } -function byteBitsToInt(byte, start, length) { - const mask = maskFor(start, length); - return (byte & mask) >>> start; +function multiformats_dist_src_cid_toStringV1(bytes, cache, base) { + const { prefix } = base; + const cid = cache.get(prefix); + if (cid == null) { + const cid = base.encode(bytes); + cache.set(prefix, cid); + return cid; + } + else { + return cid; + } } -function maskFor(start, length) { - return START_MASKS[start] & STOP_MASKS[Math.min(length + start - 1, 7)]; +const multiformats_dist_src_cid_DAG_PB_CODE = 0x70; +const multiformats_dist_src_cid_SHA_256_CODE = 0x12; +function multiformats_dist_src_cid_encodeCID(version, code, multihash) { + const codeOffset = multiformats_dist_src_varint_encodingLength(version); + const hashOffset = codeOffset + multiformats_dist_src_varint_encodingLength(code); + const bytes = new Uint8Array(hashOffset + multihash.byteLength); + multiformats_dist_src_varint_encodeTo(version, bytes, 0); + multiformats_dist_src_varint_encodeTo(code, bytes, codeOffset); + bytes.set(multihash, hashOffset); + return bytes; } -//# sourceMappingURL=consumable-buffer.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/uint8arrays/dist/src/concat.js - +const multiformats_dist_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID'); +//# sourceMappingURL=cid.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/hashes/hasher.js +function dist_src_hashes_hasher_from({ name, code, encode }) { + return new dist_src_hashes_hasher_Hasher(name, code, encode); +} /** - * Returns a new Uint8Array created by concatenating the passed ArrayLikes + * Hasher represents a hashing algorithm implementation that produces as + * `MultihashDigest`. */ -function uint8arrays_dist_src_concat_concat(arrays, length) { - if (length == null) { - length = arrays.reduce((acc, curr) => acc + curr.length, 0); - } - const output = unixfs_node_modules_uint8arrays_dist_src_alloc_allocUnsafe(length); - let offset = 0; - for (const arr of arrays) { - output.set(arr, offset); - offset += arr.length; +class dist_src_hashes_hasher_Hasher { + name; + code; + encode; + constructor(name, code, encode) { + this.name = name; + this.code = code; + this.encode = encode; } - return unixfs_node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(output); -} -//# sourceMappingURL=concat.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/hamt-sharding/dist/src/consumable-hash.js - - -function wrapHash(hashFn) { - function hashing(value) { - if (value instanceof InfiniteHash) { - // already a hash. return it - return value; + digest(input) { + if (input instanceof Uint8Array) { + const result = this.encode(input); + return result instanceof Uint8Array + ? multiformats_dist_src_hashes_digest_create(this.code, result) + /* c8 ignore next 1 */ + : result.then(digest => multiformats_dist_src_hashes_digest_create(this.code, digest)); } else { - return new InfiniteHash(value, hashFn); - } - } - return hashing; -} -class InfiniteHash { - constructor(value, hashFn) { - if (!(value instanceof Uint8Array)) { - throw new Error('can only hash Uint8Arrays'); - } - this._value = value; - this._hashFn = hashFn; - this._depth = -1; - this._availableBits = 0; - this._currentBufferIndex = 0; - this._buffers = []; - } - async take(bits) { - let pendingBits = bits; - while (this._availableBits < pendingBits) { - await this._produceMoreBits(); - } - let result = 0; - while (pendingBits > 0) { - const hash = this._buffers[this._currentBufferIndex]; - const available = Math.min(hash.availableBits(), pendingBits); - const took = hash.take(available); - result = (result << available) + took; - pendingBits -= available; - this._availableBits -= available; - if (hash.availableBits() === 0) { - this._currentBufferIndex++; - } - } - return result; - } - untake(bits) { - let pendingBits = bits; - while (pendingBits > 0) { - const hash = this._buffers[this._currentBufferIndex]; - const availableForUntake = Math.min(hash.totalBits() - hash.availableBits(), pendingBits); - hash.untake(availableForUntake); - pendingBits -= availableForUntake; - this._availableBits += availableForUntake; - if (this._currentBufferIndex > 0 && hash.totalBits() === hash.availableBits()) { - this._depth--; - this._currentBufferIndex--; - } + throw Error('Unknown type, must be binary type'); + /* c8 ignore next 1 */ } } - async _produceMoreBits() { - this._depth++; - const value = this._depth > 0 ? uint8arrays_dist_src_concat_concat([this._value, Uint8Array.from([this._depth])]) : this._value; - const hashValue = await this._hashFn(value); - const buffer = new ConsumableBuffer(hashValue); - this._buffers.push(buffer); - this._availableBits += buffer.availableBits(); - } } -//# sourceMappingURL=consumable-hash.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/hamt-sharding/dist/src/index.js +//# sourceMappingURL=hasher.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/hashes/sha2.js -function createHAMT(options) { - if (options == null || options.hashFn == null) { - throw new Error('please define an options.hashFn'); + +const dist_src_hashes_sha2_sha256 = dist_src_hashes_hasher_from({ + name: 'sha2-256', + code: 0x12, + encode: (input) => node_modules_multiformats_dist_src_bytes_coerce(external_crypto_.createHash('sha256').update(input).digest()) +}); +const dist_src_hashes_sha2_sha512 = dist_src_hashes_hasher_from({ + name: 'sha2-512', + code: 0x13, + encode: input => node_modules_multiformats_dist_src_bytes_coerce(external_crypto_.createHash('sha512').update(input).digest()) +}); +//# sourceMappingURL=sha2.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/utils/persist.js + + + +const persist = async (buffer, blockstore, options) => { + if (options.codec == null) { + options.codec = src_namespaceObject; } - const bucketOptions = { - bits: options.bits ?? 8, - hash: wrapHash(options.hashFn) + const multihash = await dist_src_hashes_sha2_sha256.digest(buffer); + const cid = node_modules_multiformats_dist_src_cid_CID.create(options.cidVersion, options.codec.code, multihash); + await blockstore.put(cid, buffer, options); + return cid; +}; +//# sourceMappingURL=persist.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/dag-builder/buffer-importer.js + + + + + +function defaultBufferImporter(options) { + return async function* bufferImporter(file, blockstore) { + let bytesWritten = 0n; + for await (let block of file.content) { + yield async () => { + let unixfs; + const opts = { + codec: src_namespaceObject, + cidVersion: options.cidVersion, + onProgress: options.onProgress + }; + if (options.rawLeaves) { + opts.codec = dist_src_codecs_raw_namespaceObject; + opts.cidVersion = 1; + } + else { + unixfs = new src_UnixFS({ + type: options.leafType, + data: block + }); + block = src_encode({ + Data: unixfs.marshal(), + Links: [] + }); + } + const cid = await persist(block, blockstore, opts); + bytesWritten += BigInt(block.byteLength); + options.onProgress?.(new CustomProgressEvent('unixfs:importer:progress:file:write', { + bytesWritten, + cid, + path: file.path + })); + return { + cid, + unixfs, + size: BigInt(block.length), + block + }; + }; + } }; - return new Bucket(bucketOptions); } +//# sourceMappingURL=buffer-importer.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/dag-builder/dir.js -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/dir-sharded.js + + +const dirBuilder = async (dir, blockstore, options) => { + const unixfs = new src_UnixFS({ + type: 'directory', + mtime: dir.mtime, + mode: dir.mode + }); + const block = src_encode(prepare({ Data: unixfs.marshal() })); + const cid = await persist(block, blockstore, options); + const path = dir.path; + return { + cid, + path, + unixfs, + size: BigInt(block.length), + originalPath: dir.originalPath, + block + }; +}; +//# sourceMappingURL=dir.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/dag-builder/file.js -async function hamtHashFn(buf) { - return (await murmur3128.encode(buf)) - // Murmur3 outputs 128 bit but, accidentally, IPFS Go's - // implementation only uses the first 64, so we must do the same - // for parity.. - .slice(0, 8) - // Invert buffer because that's how Go impl does it - .reverse(); -} -const HAMT_HASH_CODE = BigInt(0x22); -const DEFAULT_FANOUT_BITS = 8; -class DirSharded extends Dir { - _bucket; - constructor(props, options) { - super(props, options); - this._bucket = createHAMT({ - hashFn: hamtHashFn, - bits: options.shardFanoutBits ?? DEFAULT_FANOUT_BITS - }); - } - async put(name, value) { - this.cid = undefined; - this.size = undefined; - this.nodeSize = undefined; - await this._bucket.put(name, value); - } - async get(name) { - return this._bucket.get(name); - } - childCount() { - return this._bucket.leafCount(); - } - directChildrenCount() { - return this._bucket.childrenCount(); - } - onlyChild() { - return this._bucket.onlyChild(); - } - async *eachChildSeries() { - for await (const { key, value } of this._bucket.eachLeafSeries()) { - yield { - key, - child: value +async function* buildFileBatch(file, blockstore, options) { + let count = -1; + let previous; + for await (const entry of parallelBatch(options.bufferImporter(file, blockstore), options.blockWriteConcurrency)) { + count++; + if (count === 0) { + // cache the first entry if case there aren't any more + previous = { + ...entry, + single: true }; + continue; } - } - estimateNodeSize() { - if (this.nodeSize !== undefined) { - return this.nodeSize; - } - this.nodeSize = calculateSize(this._bucket, this, this.options); - return this.nodeSize; - } - async *flush(blockstore) { - for await (const entry of flush(this._bucket, blockstore, this, this.options)) { + else if (count === 1 && (previous != null)) { + // we have the second block of a multiple block import so yield the first yield { - ...entry, - path: this.path + ...previous, + block: undefined, + single: undefined }; + previous = undefined; } + // yield the second or later block of a multiple block import + yield { + ...entry, + block: undefined + }; + } + if (previous != null) { + yield previous; } } -/* harmony default export */ const dir_sharded = (DirSharded); -async function* flush(bucket, blockstore, shardRoot, options) { - const children = bucket._children; - const padLength = (bucket.tableSize() - 1).toString(16).length; - const links = []; - let childrenSize = 0n; - for (let i = 0; i < children.length; i++) { - const child = children.get(i); - if (child == null) { - continue; +function isSingleBlockImport(result) { + return result.single === true; +} +const reduce = (file, blockstore, options) => { + const reducer = async function (leaves) { + if (leaves.length === 1 && isSingleBlockImport(leaves[0]) && options.reduceSingleLeafToSelf) { + const leaf = leaves[0]; + let node = leaf.block; + if (isSingleBlockImport(leaf) && (file.mtime !== undefined || file.mode !== undefined)) { + // only one leaf node which is a raw leaf - we have metadata so convert it into a + // UnixFS entry otherwise we'll have nowhere to store the metadata + leaf.unixfs = new src_UnixFS({ + type: 'file', + mtime: file.mtime, + mode: file.mode, + data: leaf.block + }); + node = { Data: leaf.unixfs.marshal(), Links: [] }; + leaf.block = src_encode(prepare(node)); + leaf.cid = await persist(leaf.block, blockstore, { + ...options, + cidVersion: options.cidVersion + }); + leaf.size = BigInt(leaf.block.length); + } + options.onProgress?.(new CustomProgressEvent('unixfs:importer:progress:file:layout', { + cid: leaf.cid, + path: leaf.originalPath + })); + return { + cid: leaf.cid, + path: file.path, + unixfs: leaf.unixfs, + size: leaf.size, + originalPath: leaf.originalPath + }; } - const labelPrefix = i.toString(16).toUpperCase().padStart(padLength, '0'); - if (child instanceof Bucket) { - let shard; - for await (const subShard of flush(child, blockstore, null, options)) { - shard = subShard; + // create a parent node and add all the leaves + const f = new src_UnixFS({ + type: 'file', + mtime: file.mtime, + mode: file.mode + }); + const links = leaves + .filter(leaf => { + if (leaf.cid.code === dist_src_codecs_raw_code && leaf.size > 0) { + return true; } - if (shard == null) { - throw new Error('Could not flush sharded directory, no subshard found'); + if ((leaf.unixfs != null) && (leaf.unixfs.data == null) && leaf.unixfs.fileSize() > 0n) { + return true; } - links.push({ - Name: labelPrefix, - Tsize: Number(shard.size), - Hash: shard.cid - }); - childrenSize += shard.size; - } - else if (isDir(child.value)) { - const dir = child.value; - let flushedDir; - for await (const entry of dir.flush(blockstore)) { - flushedDir = entry; - yield flushedDir; + return Boolean(leaf.unixfs?.data?.length); + }) + .map((leaf) => { + if (leaf.cid.code === dist_src_codecs_raw_code) { + // node is a leaf buffer + f.addBlockSize(leaf.size); + return { + Name: '', + Tsize: Number(leaf.size), + Hash: leaf.cid + }; } - if (flushedDir == null) { - throw new Error('Did not flush dir'); + if ((leaf.unixfs == null) || (leaf.unixfs.data == null)) { + // node is an intermediate node + f.addBlockSize(leaf.unixfs?.fileSize() ?? 0n); } - const label = labelPrefix + child.key; - links.push({ - Name: label, - Tsize: Number(flushedDir.size), - Hash: flushedDir.cid - }); - childrenSize += flushedDir.size; - } - else { - const value = child.value; - if (value.cid == null) { - continue; + else { + // node is a unixfs 'file' leaf node + f.addBlockSize(BigInt(leaf.unixfs.data.length)); } - const label = labelPrefix + child.key; - const size = value.size; - links.push({ - Name: label, - Tsize: Number(size), - Hash: value.cid - }); - childrenSize += BigInt(size ?? 0); - } - } - // go-ipfs uses little endian, that's why we have to - // reverse the bit field before storing it - const data = Uint8Array.from(children.bitField().reverse()); - const dir = new src_UnixFS({ - type: 'hamt-sharded-directory', - data, - fanout: BigInt(bucket.tableSize()), - hashType: HAMT_HASH_CODE, - mtime: shardRoot?.mtime, - mode: shardRoot?.mode - }); - const node = { - Data: dir.marshal(), - Links: links - }; - const buffer = src_encode(prepare(node)); - const cid = await persist(buffer, blockstore, options); - const size = BigInt(buffer.byteLength) + childrenSize; - yield { - cid, - unixfs: dir, - size + return { + Name: '', + Tsize: Number(leaf.size), + Hash: leaf.cid + }; + }); + const node = { + Data: f.marshal(), + Links: links + }; + const block = src_encode(prepare(node)); + const cid = await persist(block, blockstore, options); + options.onProgress?.(new CustomProgressEvent('unixfs:importer:progress:file:layout', { + cid, + path: file.originalPath + })); + return { + cid, + path: file.path, + unixfs: f, + size: BigInt(block.length + node.Links.reduce((acc, curr) => acc + (curr.Tsize ?? 0), 0)), + originalPath: file.originalPath, + block + }; }; + return reducer; +}; +const fileBuilder = async (file, block, options) => { + return options.layout(buildFileBatch(file, block, options), reduce(file, block, options)); +}; +//# sourceMappingURL=file.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/dag-builder/index.js + + + + +function dag_builder_isIterable(thing) { + return Symbol.iterator in thing; } -function isDir(obj) { - return typeof obj.flush === 'function'; +function dag_builder_isAsyncIterable(thing) { + return Symbol.asyncIterator in thing; } -function calculateSize(bucket, shardRoot, options) { - const children = bucket._children; - const padLength = (bucket.tableSize() - 1).toString(16).length; - const links = []; - for (let i = 0; i < children.length; i++) { - const child = children.get(i); - if (child == null) { - continue; - } - const labelPrefix = i.toString(16).toUpperCase().padStart(padLength, '0'); - if (child instanceof Bucket) { - const size = calculateSize(child, null, options); - links.push({ - Name: labelPrefix, - Tsize: Number(size), - Hash: options.cidVersion === 0 ? CID_V0 : CID_V1 - }); +function contentAsAsyncIterable(content) { + try { + if (content instanceof Uint8Array) { + return (async function* () { + yield content; + }()); } - else if (typeof child.value.flush === 'function') { - const dir = child.value; - const size = dir.nodeSize(); - links.push({ - Name: labelPrefix + child.key, - Tsize: Number(size), - Hash: options.cidVersion === 0 ? CID_V0 : CID_V1 - }); + else if (dag_builder_isIterable(content)) { + return (async function* () { + yield* content; + }()); } - else { - const value = child.value; - if (value.cid == null) { - continue; - } - const label = labelPrefix + child.key; - const size = value.size; - links.push({ - Name: label, - Tsize: Number(size), - Hash: value.cid - }); + else if (dag_builder_isAsyncIterable(content)) { + return content; } } - // go-ipfs uses little endian, that's why we have to - // reverse the bit field before storing it - const data = Uint8Array.from(children.bitField().reverse()); - const dir = new src_UnixFS({ - type: 'hamt-sharded-directory', - data, - fanout: BigInt(bucket.tableSize()), - hashType: HAMT_HASH_CODE, - mtime: shardRoot?.mtime, - mode: shardRoot?.mode - }); - const buffer = src_encode(prepare({ - Data: dir.marshal(), - Links: links - })); - return buffer.length; -} -//# sourceMappingURL=dir-sharded.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/flat-to-shard.js - - -async function flatToShard(child, dir, threshold, options) { - let newDir = dir; - if (dir instanceof DirFlat && dir.estimateNodeSize() > threshold) { - newDir = await convertToShard(dir, options); + catch { + throw err_code(new Error('Content was invalid'), 'ERR_INVALID_CONTENT'); } - const parent = newDir.parent; - if (parent != null) { - if (newDir !== dir) { - if (child != null) { - child.parent = newDir; + throw err_code(new Error('Content was invalid'), 'ERR_INVALID_CONTENT'); +} +function defaultDagBuilder(options) { + return async function* dagBuilder(source, blockstore) { + for await (const entry of source) { + let originalPath; + if (entry.path != null) { + originalPath = entry.path; + entry.path = entry.path + .split('/') + .filter(path => path != null && path !== '.') + .join('/'); } - if (newDir.parentKey == null) { - throw new Error('No parent key found'); + if (isFileCandidate(entry)) { + const file = { + path: entry.path, + mtime: entry.mtime, + mode: entry.mode, + content: (async function* () { + let bytesRead = 0n; + for await (const chunk of options.chunker(options.chunkValidator(contentAsAsyncIterable(entry.content)))) { + const currentChunkSize = BigInt(chunk.byteLength); + bytesRead += currentChunkSize; + options.onProgress?.(new CustomProgressEvent('unixfs:importer:progress:file:read', { + bytesRead, + chunkSize: currentChunkSize, + path: entry.path + })); + yield chunk; + } + })(), + originalPath + }; + yield async () => fileBuilder(file, blockstore, options); + } + else if (entry.path != null) { + const dir = { + path: entry.path, + mtime: entry.mtime, + mode: entry.mode, + originalPath + }; + yield async () => dirBuilder(dir, blockstore, options); + } + else { + throw new Error('Import candidate must have content or path or both'); } - await parent.put(newDir.parentKey, newDir); } - return flatToShard(newDir, parent, threshold, options); - } - return newDir; + }; } -async function convertToShard(oldDir, options) { - const newDir = new dir_sharded({ - root: oldDir.root, - dir: true, - parent: oldDir.parent, - parentKey: oldDir.parentKey, - path: oldDir.path, - dirty: oldDir.dirty, - flat: false, - mtime: oldDir.mtime, - mode: oldDir.mode - }, options); - for await (const { key, child } of oldDir.eachChildSeries()) { - await newDir.put(key, child); +function isFileCandidate(entry) { + return entry.content != null; +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/uint8arrays/dist/src/util/as-uint8array.js +/** + * To guarantee Uint8Array semantics, convert nodejs Buffers + * into vanilla Uint8Arrays + */ +function ipfs_unixfs_importer_node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(buf) { + if (globalThis.Buffer != null) { + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); } - return newDir; + return buf; } -//# sourceMappingURL=flat-to-shard.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/utils/to-path-components.js -const toPathComponents = (path = '') => { - // split on / unless escaped with \ - return path.split(/(? { p[i] = c; return p; }, ([]))); +const dist_src_bases_base256emoji_alphabetCharsToBytes = (dist_src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[c.codePointAt(0)] = i; return p; }, ([]))); +function dist_src_bases_base256emoji_encode(data) { + return data.reduce((p, c) => { + p += dist_src_bases_base256emoji_alphabetBytesToChars[c]; + return p; + }, ''); } -async function* flushAndYield(tree, blockstore) { - if (!(tree instanceof Dir)) { - if (tree.unixfs?.isDirectory() === true) { - yield tree; +function dist_src_bases_base256emoji_decode(str) { + const byts = []; + for (const char of str) { + const byt = dist_src_bases_base256emoji_alphabetCharsToBytes[char.codePointAt(0)]; + if (byt === undefined) { + throw new Error(`Non-base256emoji character: ${char}`); } - return; + byts.push(byt); } - yield* tree.flush(blockstore); -} -function defaultTreeBuilder(options) { - return async function* treeBuilder(source, block) { - let tree = new DirFlat({ - root: true, - dir: true, - path: '', - dirty: true, - flat: true - }, options); - let rootDir; - let singleRoot = false; - for await (const entry of source) { - if (entry == null) { - continue; - } - // if all paths are from the same root directory, we should - // wrap them all in that root directory - const dir = `${entry.originalPath ?? ''}`.split('/')[0]; - if (dir != null && dir !== '') { - if (rootDir == null) { - rootDir = dir; - singleRoot = true; - } - else if (rootDir !== dir) { - singleRoot = false; - } - } - tree = await addToTree(entry, tree, options); - if (entry.unixfs == null || !entry.unixfs.isDirectory()) { - yield entry; - } - } - if (options.wrapWithDirectory || (singleRoot && tree.childCount() > 1)) { - yield* flushAndYield(tree, block); - } - else { - for await (const unwrapped of tree.eachChildSeries()) { - if (unwrapped == null) { - continue; - } - yield* flushAndYield(unwrapped.child, block); - } - } - }; + return new Uint8Array(byts); } -//# sourceMappingURL=tree-builder.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/index.js - - +const dist_src_bases_base256emoji_base256emoji = multiformats_dist_src_bases_base_from({ + prefix: '🚀', + name: 'base256emoji', + encode: dist_src_bases_base256emoji_encode, + decode: dist_src_bases_base256emoji_decode +}); +//# sourceMappingURL=base256emoji.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base36.js +const dist_src_bases_base36_base36 = multiformats_dist_src_bases_base_baseX({ + prefix: 'k', + name: 'base36', + alphabet: '0123456789abcdefghijklmnopqrstuvwxyz' +}); +const dist_src_bases_base36_base36upper = multiformats_dist_src_bases_base_baseX({ + prefix: 'K', + name: 'base36upper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' +}); +//# sourceMappingURL=base36.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base64.js +const dist_src_bases_base64_base64 = multiformats_dist_src_bases_base_rfc4648({ + prefix: 'm', + name: 'base64', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + bitsPerChar: 6 +}); +const dist_src_bases_base64_base64pad = multiformats_dist_src_bases_base_rfc4648({ + prefix: 'M', + name: 'base64pad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', + bitsPerChar: 6 +}); +const dist_src_bases_base64_base64url = multiformats_dist_src_bases_base_rfc4648({ + prefix: 'u', + name: 'base64url', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', + bitsPerChar: 6 +}); +const dist_src_bases_base64_base64urlpad = multiformats_dist_src_bases_base_rfc4648({ + prefix: 'U', + name: 'base64urlpad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', + bitsPerChar: 6 +}); +//# sourceMappingURL=base64.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/base8.js +const dist_src_bases_base8_base8 = multiformats_dist_src_bases_base_rfc4648({ + prefix: '7', + name: 'base8', + alphabet: '01234567', + bitsPerChar: 3 +}); +//# sourceMappingURL=base8.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/bases/identity.js +const dist_src_bases_identity_identity = multiformats_dist_src_bases_base_from({ + prefix: '\x00', + name: 'identity', + encode: (buf) => node_modules_multiformats_dist_src_bytes_toString(buf), + decode: (str) => multiformats_dist_src_bytes_fromString(str) +}); +//# sourceMappingURL=identity.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/codecs/json.js +const dist_src_codecs_json_textEncoder = new TextEncoder(); +const dist_src_codecs_json_textDecoder = new TextDecoder(); +const dist_src_codecs_json_name = 'json'; +const dist_src_codecs_json_code = 0x0200; +function dist_src_codecs_json_encode(node) { + return dist_src_codecs_json_textEncoder.encode(JSON.stringify(node)); +} +function dist_src_codecs_json_decode(data) { + return JSON.parse(dist_src_codecs_json_textDecoder.decode(data)); +} +//# sourceMappingURL=json.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/hashes/identity.js +const dist_src_hashes_identity_code = 0x0; +const dist_src_hashes_identity_name = 'identity'; +const dist_src_hashes_identity_encode = node_modules_multiformats_dist_src_bytes_coerce; +function dist_src_hashes_identity_digest(input) { + return multiformats_dist_src_hashes_digest_create(dist_src_hashes_identity_code, dist_src_hashes_identity_encode(input)); +} +const dist_src_hashes_identity_identity = { code: dist_src_hashes_identity_code, name: dist_src_hashes_identity_name, encode: dist_src_hashes_identity_encode, digest: dist_src_hashes_identity_digest }; +//# sourceMappingURL=identity.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/index.js /** - * The importer creates UnixFS DAGs and stores the blocks that make - * them up in the passed blockstore. + * @packageDocumentation * - * @example + * This library defines common interfaces and low level building blocks for various interrelated multiformat technologies (multicodec, multihash, multibase, and CID). They can be used to implement custom base encoders / decoders / codecs, codec encoders /decoders and multihash hashers that comply to the interface that layers above assume. * - * ```typescript - * import { importer } from 'ipfs-unixfs-importer' - * import { MemoryBlockstore } from 'blockstore-core' + * This library provides implementations for most basics and many others can be found in linked repositories. * - * // store blocks in memory, other blockstores are available - * const blockstore = new MemoryBlockstore() + * ```TypeScript + * import { CID } from 'multiformats/cid' + * import * as json from 'multiformats/codecs/json' + * import { sha256 } from 'multiformats/hashes/sha2' * - * const input = [{ - * path: './foo.txt', - * content: Uint8Array.from([0, 1, 2, 3, 4]) - * }, { - * path: './bar.txt', - * content: Uint8Array.from([0, 1, 2, 3, 4]) - * }] + * const bytes = json.encode({ hello: 'world' }) * - * for await (const entry of importer(input, blockstore)) { - * console.info(entry) - * // { cid: CID(), ... } + * const hash = await sha256.digest(bytes) + * const cid = CID.create(1, json.code, hash) + * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) + * ``` + * + * ## Creating Blocks + * + * ```TypeScript + * import * as Block from 'multiformats/block' + * import * as codec from '@ipld/dag-cbor' + * import { sha256 as hasher } from 'multiformats/hashes/sha2' + * + * const value = { hello: 'world' } + * + * // encode a block + * let block = await Block.encode({ value, codec, hasher }) + * + * block.value // { hello: 'world' } + * block.bytes // Uint8Array + * block.cid // CID() w/ sha2-256 hash address and dag-cbor codec + * + * // you can also decode blocks from their binary state + * block = await Block.decode({ bytes: block.bytes, codec, hasher }) + * + * // if you have the cid you can also verify the hash on decode + * block = await Block.create({ bytes: block.bytes, cid: block.cid, codec, hasher }) + * ``` + * + * ## Multibase Encoders / Decoders / Codecs + * + * CIDs can be serialized to string representation using multibase encoders that implement [`MultibaseEncoder`](https://github.com/multiformats/js-multiformats/blob/master/src/bases/interface.ts) interface. This library provides quite a few implementations that can be imported: + * + * ```TypeScript + * import { base64 } from "multiformats/bases/base64" + * cid.toString(base64.encoder) + * //> 'mAYAEEiCTojlxqRTl6svwqNJRVM2jCcPBxy+7mRTUfGDzy2gViA' + * ``` + * + * Parsing CID string serialized CIDs requires multibase decoder that implements [`MultibaseDecoder`](https://github.com/multiformats/js-multiformats/blob/master/src/bases/interface.ts) interface. This library provides a decoder for every encoder it provides: + * + * ```TypeScript + * CID.parse('mAYAEEiCTojlxqRTl6svwqNJRVM2jCcPBxy+7mRTUfGDzy2gViA', base64.decoder) + * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) + * ``` + * + * Dual of multibase encoder & decoder is defined as multibase codec and it exposes + * them as `encoder` and `decoder` properties. For added convenience codecs also + * implement `MultibaseEncoder` and `MultibaseDecoder` interfaces so they could be + * used as either or both: + * + * ```TypeScript + * cid.toString(base64) + * CID.parse(cid.toString(base64), base64) + * ``` + * + * **Note:** CID implementation comes bundled with `base32` and `base58btc` + * multibase codecs so that CIDs can be base serialized to (version specific) + * default base encoding and parsed without having to supply base encoders/decoders: + * + * ```TypeScript + * const v1 = CID.parse('bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea') + * v1.toString() + * //> 'bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea' + * + * const v0 = CID.parse('QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n') + * v0.toString() + * //> 'QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n' + * v0.toV1().toString() + * //> 'bafybeihdwdcefgh4dqkjv67uzcmw7ojee6xedzdetojuzjevtenxquvyku' + * ``` + * + * ## Multicodec Encoders / Decoders / Codecs + * + * This library defines [`BlockEncoder`, `BlockDecoder` and `BlockCodec` interfaces](https://github.com/multiformats/js-multiformats/blob/master/src/codecs/interface.ts). + * Codec implementations should conform to the `BlockCodec` interface which implements both `BlockEncoder` and `BlockDecoder`. + * Here is an example implementation of JSON `BlockCodec`. + * + * ```TypeScript + * export const { name, code, encode, decode } = { + * name: 'json', + * code: 0x0200, + * encode: json => new TextEncoder().encode(JSON.stringify(json)), + * decode: bytes => JSON.parse(new TextDecoder().decode(bytes)) * } * ``` - */ -async function* importer(source, blockstore, options = {}) { - let candidates; - if (Symbol.asyncIterator in source || Symbol.iterator in source) { - candidates = source; - } - else { - candidates = [source]; - } - const wrapWithDirectory = options.wrapWithDirectory ?? false; - const shardSplitThresholdBytes = options.shardSplitThresholdBytes ?? 262144; - const shardFanoutBits = options.shardFanoutBits ?? 8; - const cidVersion = options.cidVersion ?? 1; - const rawLeaves = options.rawLeaves ?? true; - const leafType = options.leafType ?? 'file'; - const fileImportConcurrency = options.fileImportConcurrency ?? 50; - const blockWriteConcurrency = options.blockWriteConcurrency ?? 10; - const reduceSingleLeafToSelf = options.reduceSingleLeafToSelf ?? true; - const chunker = options.chunker ?? fixedSize(); - const chunkValidator = options.chunkValidator ?? defaultChunkValidator(); - const buildDag = options.dagBuilder ?? defaultDagBuilder({ - chunker, - chunkValidator, - wrapWithDirectory, - layout: options.layout ?? balanced(), - bufferImporter: options.bufferImporter ?? defaultBufferImporter({ - cidVersion, - rawLeaves, - leafType, - onProgress: options.onProgress - }), - blockWriteConcurrency, - reduceSingleLeafToSelf, - cidVersion, - onProgress: options.onProgress - }); - const buildTree = options.treeBuilder ?? defaultTreeBuilder({ - wrapWithDirectory, - shardSplitThresholdBytes, - shardFanoutBits, - cidVersion, - onProgress: options.onProgress - }); - for await (const entry of buildTree(parallelBatch(buildDag(candidates, blockstore), fileImportConcurrency), blockstore)) { - yield { - cid: entry.cid, - path: entry.path, - unixfs: entry.unixfs, - size: entry.size - }; - } -} -/** - * `importFile` is similar to `importer` except it accepts a single - * `FileCandidate` and returns a promise of a single `ImportResult` - * instead of a stream of results. * - * @example + * ## Multihash Hashers * - * ```typescript - * import { importFile } from 'ipfs-unixfs-importer' - * import { MemoryBlockstore } from 'blockstore-core' + * This library defines [`MultihashHasher` and `MultihashDigest` interfaces](https://github.com/multiformats/js-multiformats/blob/master/src/hashes/interface.ts) and convinient function for implementing them: * - * // store blocks in memory, other blockstores are available - * const blockstore = new MemoryBlockstore() + * ```TypeScript + * import * as hasher from 'multiformats/hashes/hasher' * - * const input: FileCandidate = { - * path: './foo.txt', - * content: Uint8Array.from([0, 1, 2, 3, 4]) - * } + * const sha256 = hasher.from({ + * // As per multiformats table + * // https://github.com/multiformats/multicodec/blob/master/table.csv#L9 + * name: 'sha2-256', + * code: 0x12, * - * const entry = await importFile(input, blockstore) + * encode: (input) => new Uint8Array(crypto.createHash('sha256').update(input).digest()) + * }) + * + * const hash = await sha256.digest(json.encode({ hello: 'world' })) + * CID.create(1, json.code, hash) + * + * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) * ``` - */ -async function importFile(content, blockstore, options = {}) { - const result = await it_first_dist_src(importer([content], blockstore, options)); - if (result == null) { - throw err_code(new Error('Nothing imported'), 'ERR_INVALID_PARAMS'); - } - return result; -} -/** - * `importDir` is similar to `importer` except it accepts a single - * `DirectoryCandidate` and returns a promise of a single `ImportResult` - * instead of a stream of results. * - * @example + * ## Traversal * - * ```typescript - * import { importDirectory } from 'ipfs-unixfs-importer' - * import { MemoryBlockstore } from 'blockstore-core' + * This library contains higher-order functions for traversing graphs of data easily. * - * // store blocks in memory, other blockstores are available - * const blockstore = new MemoryBlockstore() + * `walk()` walks through the links in each block of a DAG calling a user-supplied loader function for each one, in depth-first order with no duplicate block visits. The loader should return a `Block` object and can be used to inspect and collect block ordering for a full DAG walk. The loader should `throw` on error, and return `null` if a block should be skipped by `walk()`. * - * const input: DirectoryCandidate = { - * path: './foo.txt' + * ```TypeScript + * import { walk } from 'multiformats/traversal' + * import * as Block from 'multiformats/block' + * import * as codec from 'multiformats/codecs/json' + * import { sha256 as hasher } from 'multiformats/hashes/sha2' + * + * // build a DAG (a single block for this simple example) + * const value = { hello: 'world' } + * const block = await Block.encode({ value, codec, hasher }) + * const { cid } = block + * console.log(cid) + * //> CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea) + * + * // create a loader function that also collects CIDs of blocks in + * // their traversal order + * const load = (cid, blocks) => async (cid) => { + * // fetch a block using its cid + * // e.g.: const block = await fetchBlockByCID(cid) + * blocks.push(cid) + * return block * } * - * const entry = await importDirectory(input, blockstore) + * // collect blocks in this DAG starting from the root `cid` + * const blocks = [] + * await walk({ cid, load: load(cid, blocks) }) + * + * console.log(blocks) + * //> [CID(bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea)] * ``` - */ -async function importDirectory(content, blockstore, options = {}) { - const result = await it_first_dist_src(importer([content], blockstore, options)); - if (result == null) { - throw err_code(new Error('Nothing imported'), 'ERR_INVALID_PARAMS'); - } - return result; -} -/** - * `importBytes` accepts a single Uint8Array and returns a promise - * of a single `ImportResult`. * - * @example + * ## Legacy interface * - * ```typescript - * import { importBytes } from 'ipfs-unixfs-importer' - * import { MemoryBlockstore } from 'blockstore-core' + * [`blockcodec-to-ipld-format`](https://github.com/ipld/js-blockcodec-to-ipld-format) converts a multiformats [`BlockCodec`](https://github.com/multiformats/js-multiformats/blob/master/src/codecs/interface.ts#L21) into an + * [`interface-ipld-format`](https://github.com/ipld/interface-ipld-format) for use with the [`ipld`](https://github.com/ipld/ipld) package. This can help bridge IPLD codecs implemented using the structure and interfaces defined here to existing code that assumes, or requires `interface-ipld-format`. This bridge also includes the relevant TypeScript definitions. * - * // store blocks in memory, other blockstores are available - * const blockstore = new MemoryBlockstore() + * ## Implementations * - * const input = Uint8Array.from([0, 1, 2, 3, 4]) + * By default, no base encodings (other than base32 & base58btc), hash functions, + * or codec implementations are exposed by `multiformats`, you need to + * import the ones you need yourself. * - * const entry = await importBytes(input, blockstore) - * ``` - */ -async function importBytes(buf, blockstore, options = {}) { - return importFile({ - content: buf - }, blockstore, options); -} -/** - * `importByteStream` accepts a single stream of Uint8Arrays and - * returns a promise of a single `ImportResult`. + * ### Multibase codecs * - * @example + * | bases | import | repo | + * | ------------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------- | + * | `base16` | `multiformats/bases/base16` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | + * | `base32`, `base32pad`, `base32hex`, `base32hexpad`, `base32z` | `multiformats/bases/base32` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | + * | `base64`, `base64pad`, `base64url`, `base64urlpad` | `multiformats/bases/base64` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | + * | `base58btc`, `base58flick4` | `multiformats/bases/base58` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) | * - * ```typescript - * import { importByteStream } from 'ipfs-unixfs-importer' - * import { MemoryBlockstore } from 'blockstore-core' + * Other (less useful) bases implemented in [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/bases) include: `base2`, `base8`, `base10`, `base36` and `base256emoji`. * - * // store blocks in memory, other blockstores are available - * const blockstore = new MemoryBlockstore() + * ### Multihash hashers * - * const input = [ - * Uint8Array.from([0, 1, 2, 3, 4]), - * Uint8Array.from([5, 6, 7, 8, 9]) - * ] + * | hashes | import | repo | + * | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------ | + * | `sha2-256`, `sha2-512` | `multiformats/hashes/sha2` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/hashes) | + * | `sha3-224`, `sha3-256`, `sha3-384`,`sha3-512`, `shake-128`, `shake-256`, `keccak-224`, `keccak-256`, `keccak-384`, `keccak-512` | `@multiformats/sha3` | [multiformats/js-sha3](https://github.com/multiformats/js-sha3) | + * | `identity` | `multiformats/hashes/identity` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/hashes/identity.js) | + * | `murmur3-128`, `murmur3-32` | `@multiformats/murmur3` | [multiformats/js-murmur3](https://github.com/multiformats/js-murmur3) | + * | `blake2b-*`, `blake2s-*` | `@multiformats/blake2` | [multiformats/js-blake2](https://github.com/multiformats/js-blake2) | * - * const entry = await importByteStream(input, blockstore) - * ``` + * ### IPLD codecs (multicodec) + * + * | codec | import | repo | + * | ---------- | -------------------------- | ------------------------------------------------------------------------------------------------------ | + * | `raw` | `multiformats/codecs/raw` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/codecs) | + * | `json` | `multiformats/codecs/json` | [multiformats/js-multiformats](https://github.com/multiformats/js-multiformats/tree/master/src/codecs) | + * | `dag-cbor` | `@ipld/dag-cbor` | [ipld/js-dag-cbor](https://github.com/ipld/js-dag-cbor) | + * | `dag-json` | `@ipld/dag-json` | [ipld/js-dag-json](https://github.com/ipld/js-dag-json) | + * | `dag-pb` | `@ipld/dag-pb` | [ipld/js-dag-pb](https://github.com/ipld/js-dag-pb) | + * | `dag-jose` | `dag-jose` | [ceramicnetwork/js-dag-jose](https://github.com/ceramicnetwork/js-dag-jose) | */ -async function importByteStream(bufs, blockstore, options = {}) { - return importFile({ - content: bufs - }, blockstore, options); -} -//# sourceMappingURL=index.js.map -// EXTERNAL MODULE: ./node_modules/rabin-wasm/src/index.js -var rabin_wasm_src = __nccwpck_require__(55340); -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/chunker/rabin.js -// @ts-expect-error no types -const DEFAULT_MIN_CHUNK_SIZE = 262144; -const DEFAULT_MAX_CHUNK_SIZE = 262144; -const DEFAULT_AVG_CHUNK_SIZE = 262144; -const DEFAULT_WINDOW = 16; -async function* chunker(source, r) { - const buffers = new Uint8ArrayList(); - for await (const chunk of source) { - buffers.append(chunk); - const sizes = r.fingerprint(chunk); - for (let i = 0; i < sizes.length; i++) { - const size = sizes[i]; - const buf = buffers.slice(0, size); - buffers.consume(size); - yield buf; - } - } - if (buffers.length > 0) { - yield buffers.subarray(0); - } -} -const rabin = (options = {}) => { - let min = options.minChunkSize ?? DEFAULT_MIN_CHUNK_SIZE; - let max = options.maxChunkSize ?? DEFAULT_MAX_CHUNK_SIZE; - let avg = options.avgChunkSize ?? DEFAULT_AVG_CHUNK_SIZE; - const window = options.window ?? DEFAULT_WINDOW; - // if only avg was passed, calculate min/max from that - if (options.avgChunkSize != null && options.minChunkSize == null && options.maxChunkSize == null) { - min = avg / 3; - max = avg + (avg / 2); - } - const isInvalidChunkSizes = [min, avg, max].some((size) => size == null || isNaN(size)); - if (isInvalidChunkSizes) { - if (options.avgChunkSize != null) { - throw errcode(new Error('please specify a valid average chunk size number'), 'ERR_INVALID_AVG_CHUNK_SIZE'); - } - throw errcode(new Error('please specify valid numbers for (min|max|avg)ChunkSize'), 'ERR_INVALID_CHUNK_SIZE'); - } - // validate min/max/avg in the same way as go - if (min < 16) { - throw errcode(new Error('rabin min must be greater than 16'), 'ERR_INVALID_MIN_CHUNK_SIZE'); - } - if (max < min) { - max = min; - } - if (avg < min) { - avg = min; - } - const sizepow = Math.floor(Math.log2(avg)); - return async function* rabinChunker(source) { - const r = await create(sizepow, min, max, window); - for await (const chunk of chunker(source, r)) { - yield chunk; - } - }; -}; -//# sourceMappingURL=rabin.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/chunker/index.js + + +// This way TS will also expose all the types from module //# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/add.js +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/multiformats/dist/src/basics.js -/** - * Default importer settings match Filecoin - */ -const defaultImporterSettings = { - cidVersion: 1, - rawLeaves: true, - layout: balanced({ - maxChildrenPerNode: 1024 - }), - chunker: fixedSize({ - chunkSize: 1048576 - }) -}; -async function* addAll(source, blockstore, options = {}) { - yield* importer(source, blockstore, { - ...defaultImporterSettings, - ...options - }); -} -async function addBytes(bytes, blockstore, options = {}) { - const { cid } = await importBytes(bytes, blockstore, { - ...defaultImporterSettings, - ...options - }); - return cid; -} -async function addByteStream(bytes, blockstore, options = {}) { - const { cid } = await importByteStream(bytes, blockstore, { - ...defaultImporterSettings, - ...options - }); - return cid; -} -async function addFile(file, blockstore, options = {}) { - const { cid } = await importFile(file, blockstore, { - ...defaultImporterSettings, - ...options - }); - return cid; -} -async function addDirectory(dir, blockstore, options = {}) { - const { cid } = await importDirectory({ - ...dir, - path: dir.path ?? '-' - }, blockstore, { - ...defaultImporterSettings, - ...options - }); - return cid; -} -//# sourceMappingURL=add.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/bytes.js -const node_modules_multiformats_dist_src_bytes_empty = new Uint8Array(0); -function node_modules_multiformats_dist_src_bytes_toHex(d) { - return d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), ''); -} -function node_modules_multiformats_dist_src_bytes_fromHex(hex) { - const hexes = hex.match(/../g); - return hexes != null ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : node_modules_multiformats_dist_src_bytes_empty; -} -function node_modules_multiformats_dist_src_bytes_equals(aa, bb) { - if (aa === bb) - return true; - if (aa.byteLength !== bb.byteLength) { - return false; - } - for (let ii = 0; ii < aa.byteLength; ii++) { - if (aa[ii] !== bb[ii]) { - return false; - } - } - return true; -} -function ipfs_unixfs_exporter_node_modules_multiformats_dist_src_bytes_coerce(o) { - if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') - return o; - if (o instanceof ArrayBuffer) - return new Uint8Array(o); - if (ArrayBuffer.isView(o)) { - return new Uint8Array(o.buffer, o.byteOffset, o.byteLength); - } - throw new Error('Unknown type, must be binary type'); -} -function node_modules_multiformats_dist_src_bytes_isBinary(o) { - return o instanceof ArrayBuffer || ArrayBuffer.isView(o); -} -function node_modules_multiformats_dist_src_bytes_fromString(str) { - return new TextEncoder().encode(str); -} -function ipfs_unixfs_exporter_node_modules_multiformats_dist_src_bytes_toString(b) { - return new TextDecoder().decode(b); -} -//# sourceMappingURL=bytes.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/vendor/base-x.js -/* eslint-disable */ -// base-x encoding / decoding -// Copyright (c) 2018 base-x contributors -// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) -// Distributed under the MIT software license, see the accompanying -// file LICENSE or http://www.opensource.org/licenses/mit-license.php. -/** - * @param {string} ALPHABET - * @param {any} name - */ -function multiformats_dist_src_vendor_base_x_base(ALPHABET, name) { - if (ALPHABET.length >= 255) { - throw new TypeError('Alphabet too long'); - } - var BASE_MAP = new Uint8Array(256); - for (var j = 0; j < BASE_MAP.length; j++) { - BASE_MAP[j] = 255; - } - for (var i = 0; i < ALPHABET.length; i++) { - var x = ALPHABET.charAt(i); - var xc = x.charCodeAt(0); - if (BASE_MAP[xc] !== 255) { - throw new TypeError(x + ' is ambiguous'); - } - BASE_MAP[xc] = i; - } - var BASE = ALPHABET.length; - var LEADER = ALPHABET.charAt(0); - var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up - var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up - /** - * @param {any[] | Iterable} source - */ - function encode(source) { - // @ts-ignore - if (source instanceof Uint8Array) - ; - else if (ArrayBuffer.isView(source)) { - source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); - } - else if (Array.isArray(source)) { - source = Uint8Array.from(source); - } - if (!(source instanceof Uint8Array)) { - throw new TypeError('Expected Uint8Array'); - } - if (source.length === 0) { - return ''; - } - // Skip & count leading zeroes. - var zeroes = 0; - var length = 0; - var pbegin = 0; - var pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; - } - // Allocate enough space in big-endian base58 representation. - var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; - var b58 = new Uint8Array(size); - // Process the bytes. - while (pbegin !== pend) { - var carry = source[pbegin]; - // Apply "b58 = b58 * 256 + ch". - var i = 0; - for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { - carry += (256 * b58[it1]) >>> 0; - b58[it1] = (carry % BASE) >>> 0; - carry = (carry / BASE) >>> 0; - } - if (carry !== 0) { - throw new Error('Non-zero carry'); - } - length = i; - pbegin++; - } - // Skip leading zeroes in base58 result. - var it2 = size - length; - while (it2 !== size && b58[it2] === 0) { - it2++; - } - // Translate the result into a string. - var str = LEADER.repeat(zeroes); - for (; it2 < size; ++it2) { - str += ALPHABET.charAt(b58[it2]); - } - return str; - } - /** - * @param {string | string[]} source - */ - function decodeUnsafe(source) { - if (typeof source !== 'string') { - throw new TypeError('Expected String'); - } - if (source.length === 0) { - return new Uint8Array(); - } - var psz = 0; - // Skip leading spaces. - if (source[psz] === ' ') { - return; - } - // Skip and count leading '1's. - var zeroes = 0; - var length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; - } - // Allocate enough space in big-endian base256 representation. - var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. - var b256 = new Uint8Array(size); - // Process the characters. - while (source[psz]) { - // Decode character - var carry = BASE_MAP[source.charCodeAt(psz)]; - // Invalid character - if (carry === 255) { - return; - } - var i = 0; - for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { - carry += (BASE * b256[it3]) >>> 0; - b256[it3] = (carry % 256) >>> 0; - carry = (carry / 256) >>> 0; - } - if (carry !== 0) { - throw new Error('Non-zero carry'); - } - length = i; - psz++; - } - // Skip trailing spaces. - if (source[psz] === ' ') { - return; - } - // Skip leading zeroes in b256. - var it4 = size - length; - while (it4 !== size && b256[it4] === 0) { - it4++; - } - var vch = new Uint8Array(zeroes + (size - it4)); - var j = zeroes; - while (it4 !== size) { - vch[j++] = b256[it4++]; - } - return vch; - } - /** - * @param {string | string[]} string - */ - function decode(string) { - var buffer = decodeUnsafe(string); - if (buffer) { - return buffer; - } - throw new Error(`Non-${name} character`); - } - return { - encode: encode, - decodeUnsafe: decodeUnsafe, - decode: decode - }; -} -var multiformats_dist_src_vendor_base_x_src = multiformats_dist_src_vendor_base_x_base; -var multiformats_dist_src_vendor_base_x_brrp_multiformats_scope_baseX = multiformats_dist_src_vendor_base_x_src; -/* harmony default export */ const node_modules_multiformats_dist_src_vendor_base_x = (multiformats_dist_src_vendor_base_x_brrp_multiformats_scope_baseX); -//# sourceMappingURL=base-x.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/bases/base.js -/** - * Class represents both BaseEncoder and MultibaseEncoder meaning it - * can be used to encode to multibase or base encode without multibase - * prefix. - */ -class node_modules_multiformats_dist_src_bases_base_Encoder { - name; - prefix; - baseEncode; - constructor(name, prefix, baseEncode) { - this.name = name; - this.prefix = prefix; - this.baseEncode = baseEncode; - } - encode(bytes) { - if (bytes instanceof Uint8Array) { - return `${this.prefix}${this.baseEncode(bytes)}`; - } - else { - throw Error('Unknown type, must be binary type'); - } - } -} -/** - * Class represents both BaseDecoder and MultibaseDecoder so it could be used - * to decode multibases (with matching prefix) or just base decode strings - * with corresponding base encoding. - */ -class node_modules_multiformats_dist_src_bases_base_Decoder { - name; - prefix; - baseDecode; - prefixCodePoint; - constructor(name, prefix, baseDecode) { - this.name = name; - this.prefix = prefix; - /* c8 ignore next 3 */ - if (prefix.codePointAt(0) === undefined) { - throw new Error('Invalid prefix character'); - } - this.prefixCodePoint = prefix.codePointAt(0); - this.baseDecode = baseDecode; - } - decode(text) { - if (typeof text === 'string') { - if (text.codePointAt(0) !== this.prefixCodePoint) { - throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); - } - return this.baseDecode(text.slice(this.prefix.length)); - } - else { - throw Error('Can only multibase decode strings'); - } - } - or(decoder) { - return node_modules_multiformats_dist_src_bases_base_or(this, decoder); - } -} -class node_modules_multiformats_dist_src_bases_base_ComposedDecoder { - decoders; - constructor(decoders) { - this.decoders = decoders; - } - or(decoder) { - return node_modules_multiformats_dist_src_bases_base_or(this, decoder); - } - decode(input) { - const prefix = input[0]; - const decoder = this.decoders[prefix]; - if (decoder != null) { - return decoder.decode(input); - } - else { - throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); - } - } -} -function node_modules_multiformats_dist_src_bases_base_or(left, right) { - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - return new node_modules_multiformats_dist_src_bases_base_ComposedDecoder({ - ...(left.decoders ?? { [left.prefix]: left }), - ...(right.decoders ?? { [right.prefix]: right }) - }); -} -class node_modules_multiformats_dist_src_bases_base_Codec { - name; - prefix; - baseEncode; - baseDecode; - encoder; - decoder; - constructor(name, prefix, baseEncode, baseDecode) { - this.name = name; - this.prefix = prefix; - this.baseEncode = baseEncode; - this.baseDecode = baseDecode; - this.encoder = new node_modules_multiformats_dist_src_bases_base_Encoder(name, prefix, baseEncode); - this.decoder = new node_modules_multiformats_dist_src_bases_base_Decoder(name, prefix, baseDecode); - } - encode(input) { - return this.encoder.encode(input); - } - decode(input) { - return this.decoder.decode(input); - } -} -function node_modules_multiformats_dist_src_bases_base_from({ name, prefix, encode, decode }) { - return new node_modules_multiformats_dist_src_bases_base_Codec(name, prefix, encode, decode); -} -function node_modules_multiformats_dist_src_bases_base_baseX({ name, prefix, alphabet }) { - const { encode, decode } = node_modules_multiformats_dist_src_vendor_base_x(alphabet, name); - return node_modules_multiformats_dist_src_bases_base_from({ - prefix, - name, - encode, - decode: (text) => ipfs_unixfs_exporter_node_modules_multiformats_dist_src_bytes_coerce(decode(text)) - }); -} -function node_modules_multiformats_dist_src_bases_base_decode(string, alphabet, bitsPerChar, name) { - // Build the character lookup table: - const codes = {}; - for (let i = 0; i < alphabet.length; ++i) { - codes[alphabet[i]] = i; - } - // Count the padding bytes: - let end = string.length; - while (string[end - 1] === '=') { - --end; - } - // Allocate the output: - const out = new Uint8Array((end * bitsPerChar / 8) | 0); - // Parse the data: - let bits = 0; // Number of bits currently in the buffer - let buffer = 0; // Bits waiting to be written out, MSB first - let written = 0; // Next byte to write - for (let i = 0; i < end; ++i) { - // Read one character from the string: - const value = codes[string[i]]; - if (value === undefined) { - throw new SyntaxError(`Non-${name} character`); - } - // Append the bits to the buffer: - buffer = (buffer << bitsPerChar) | value; - bits += bitsPerChar; - // Write out some bits if the buffer has a byte's worth: - if (bits >= 8) { - bits -= 8; - out[written++] = 0xff & (buffer >> bits); - } - } - // Verify that we have received just enough bits: - if (bits >= bitsPerChar || (0xff & (buffer << (8 - bits))) !== 0) { - throw new SyntaxError('Unexpected end of data'); - } - return out; -} -function node_modules_multiformats_dist_src_bases_base_encode(data, alphabet, bitsPerChar) { - const pad = alphabet[alphabet.length - 1] === '='; - const mask = (1 << bitsPerChar) - 1; - let out = ''; - let bits = 0; // Number of bits currently in the buffer - let buffer = 0; // Bits waiting to be written out, MSB first - for (let i = 0; i < data.length; ++i) { - // Slurp data into the buffer: - buffer = (buffer << 8) | data[i]; - bits += 8; - // Write out as much as we can: - while (bits > bitsPerChar) { - bits -= bitsPerChar; - out += alphabet[mask & (buffer >> bits)]; - } - } - // Partial character: - if (bits !== 0) { - out += alphabet[mask & (buffer << (bitsPerChar - bits))]; - } - // Add padding characters until we hit a byte boundary: - if (pad) { - while (((out.length * bitsPerChar) & 7) !== 0) { - out += '='; - } - } - return out; -} -/** - * RFC4648 Factory - */ -function node_modules_multiformats_dist_src_bases_base_rfc4648({ name, prefix, bitsPerChar, alphabet }) { - return node_modules_multiformats_dist_src_bases_base_from({ - prefix, - name, - encode(input) { - return node_modules_multiformats_dist_src_bases_base_encode(input, alphabet, bitsPerChar); - }, - decode(input) { - return node_modules_multiformats_dist_src_bases_base_decode(input, alphabet, bitsPerChar, name); - } - }); -} -//# sourceMappingURL=base.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/bases/base32.js -const node_modules_multiformats_dist_src_bases_base32_base32 = node_modules_multiformats_dist_src_bases_base_rfc4648({ - prefix: 'b', - name: 'base32', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567', - bitsPerChar: 5 -}); -const node_modules_multiformats_dist_src_bases_base32_base32upper = node_modules_multiformats_dist_src_bases_base_rfc4648({ - prefix: 'B', - name: 'base32upper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', - bitsPerChar: 5 -}); -const node_modules_multiformats_dist_src_bases_base32_base32pad = node_modules_multiformats_dist_src_bases_base_rfc4648({ - prefix: 'c', - name: 'base32pad', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', - bitsPerChar: 5 -}); -const node_modules_multiformats_dist_src_bases_base32_base32padupper = node_modules_multiformats_dist_src_bases_base_rfc4648({ - prefix: 'C', - name: 'base32padupper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', - bitsPerChar: 5 -}); -const node_modules_multiformats_dist_src_bases_base32_base32hex = node_modules_multiformats_dist_src_bases_base_rfc4648({ - prefix: 'v', - name: 'base32hex', - alphabet: '0123456789abcdefghijklmnopqrstuv', - bitsPerChar: 5 -}); -const node_modules_multiformats_dist_src_bases_base32_base32hexupper = node_modules_multiformats_dist_src_bases_base_rfc4648({ - prefix: 'V', - name: 'base32hexupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', - bitsPerChar: 5 -}); -const node_modules_multiformats_dist_src_bases_base32_base32hexpad = node_modules_multiformats_dist_src_bases_base_rfc4648({ - prefix: 't', - name: 'base32hexpad', - alphabet: '0123456789abcdefghijklmnopqrstuv=', - bitsPerChar: 5 -}); -const node_modules_multiformats_dist_src_bases_base32_base32hexpadupper = node_modules_multiformats_dist_src_bases_base_rfc4648({ - prefix: 'T', - name: 'base32hexpadupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', - bitsPerChar: 5 -}); -const node_modules_multiformats_dist_src_bases_base32_base32z = node_modules_multiformats_dist_src_bases_base_rfc4648({ - prefix: 'h', - name: 'base32z', - alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', - bitsPerChar: 5 -}); -//# sourceMappingURL=base32.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/bases/base58.js -const node_modules_multiformats_dist_src_bases_base58_base58btc = node_modules_multiformats_dist_src_bases_base_baseX({ - name: 'base58btc', - prefix: 'z', - alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -}); -const node_modules_multiformats_dist_src_bases_base58_base58flickr = node_modules_multiformats_dist_src_bases_base_baseX({ - name: 'base58flickr', - prefix: 'Z', - alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -}); -//# sourceMappingURL=base58.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/vendor/varint.js -/* eslint-disable */ -var multiformats_dist_src_vendor_varint_encode_1 = node_modules_multiformats_dist_src_vendor_varint_encode; -var multiformats_dist_src_vendor_varint_MSB = 0x80, multiformats_dist_src_vendor_varint_REST = 0x7F, multiformats_dist_src_vendor_varint_MSBALL = ~multiformats_dist_src_vendor_varint_REST, multiformats_dist_src_vendor_varint_INT = Math.pow(2, 31); -/** - * @param {number} num - * @param {number[]} out - * @param {number} offset - */ -function node_modules_multiformats_dist_src_vendor_varint_encode(num, out, offset) { - out = out || []; - offset = offset || 0; - var oldOffset = offset; - while (num >= multiformats_dist_src_vendor_varint_INT) { - out[offset++] = (num & 0xFF) | multiformats_dist_src_vendor_varint_MSB; - num /= 128; - } - while (num & multiformats_dist_src_vendor_varint_MSBALL) { - out[offset++] = (num & 0xFF) | multiformats_dist_src_vendor_varint_MSB; - num >>>= 7; - } - out[offset] = num | 0; - // @ts-ignore - node_modules_multiformats_dist_src_vendor_varint_encode.bytes = offset - oldOffset + 1; - return out; -} -var node_modules_multiformats_dist_src_vendor_varint_decode = multiformats_dist_src_vendor_varint_read; -var multiformats_dist_src_vendor_varint_MSB$1 = 0x80, multiformats_dist_src_vendor_varint_REST$1 = 0x7F; -/** - * @param {string | any[]} buf - * @param {number} offset - */ -function multiformats_dist_src_vendor_varint_read(buf, offset) { - var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length; - do { - if (counter >= l) { - // @ts-ignore - multiformats_dist_src_vendor_varint_read.bytes = 0; - throw new RangeError('Could not decode varint'); - } - b = buf[counter++]; - res += shift < 28 - ? (b & multiformats_dist_src_vendor_varint_REST$1) << shift - : (b & multiformats_dist_src_vendor_varint_REST$1) * Math.pow(2, shift); - shift += 7; - } while (b >= multiformats_dist_src_vendor_varint_MSB$1); - // @ts-ignore - multiformats_dist_src_vendor_varint_read.bytes = counter - offset; - return res; -} -var multiformats_dist_src_vendor_varint_N1 = Math.pow(2, 7); -var multiformats_dist_src_vendor_varint_N2 = Math.pow(2, 14); -var multiformats_dist_src_vendor_varint_N3 = Math.pow(2, 21); -var multiformats_dist_src_vendor_varint_N4 = Math.pow(2, 28); -var multiformats_dist_src_vendor_varint_N5 = Math.pow(2, 35); -var multiformats_dist_src_vendor_varint_N6 = Math.pow(2, 42); -var multiformats_dist_src_vendor_varint_N7 = Math.pow(2, 49); -var multiformats_dist_src_vendor_varint_N8 = Math.pow(2, 56); -var multiformats_dist_src_vendor_varint_N9 = Math.pow(2, 63); -var node_modules_multiformats_dist_src_vendor_varint_length = function (/** @type {number} */ value) { - return (value < multiformats_dist_src_vendor_varint_N1 ? 1 - : value < multiformats_dist_src_vendor_varint_N2 ? 2 - : value < multiformats_dist_src_vendor_varint_N3 ? 3 - : value < multiformats_dist_src_vendor_varint_N4 ? 4 - : value < multiformats_dist_src_vendor_varint_N5 ? 5 - : value < multiformats_dist_src_vendor_varint_N6 ? 6 - : value < multiformats_dist_src_vendor_varint_N7 ? 7 - : value < multiformats_dist_src_vendor_varint_N8 ? 8 - : value < multiformats_dist_src_vendor_varint_N9 ? 9 - : 10); -}; -var node_modules_multiformats_dist_src_vendor_varint_varint = { - encode: multiformats_dist_src_vendor_varint_encode_1, - decode: node_modules_multiformats_dist_src_vendor_varint_decode, - encodingLength: node_modules_multiformats_dist_src_vendor_varint_length -}; -var multiformats_dist_src_vendor_varint_brrp_varint = node_modules_multiformats_dist_src_vendor_varint_varint; -/* harmony default export */ const ipfs_unixfs_exporter_node_modules_multiformats_dist_src_vendor_varint = (multiformats_dist_src_vendor_varint_brrp_varint); -//# sourceMappingURL=varint.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/varint.js -function ipfs_unixfs_exporter_node_modules_multiformats_dist_src_varint_decode(data, offset = 0) { - const code = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_vendor_varint.decode(data, offset); - return [code, ipfs_unixfs_exporter_node_modules_multiformats_dist_src_vendor_varint.decode.bytes]; -} -function node_modules_multiformats_dist_src_varint_encodeTo(int, target, offset = 0) { - ipfs_unixfs_exporter_node_modules_multiformats_dist_src_vendor_varint.encode(int, target, offset); - return target; -} -function node_modules_multiformats_dist_src_varint_encodingLength(int) { - return ipfs_unixfs_exporter_node_modules_multiformats_dist_src_vendor_varint.encodingLength(int); -} -//# sourceMappingURL=varint.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/hashes/digest.js + + + + + +const dist_src_basics_bases = { ...dist_src_bases_identity_namespaceObject, ...dist_src_bases_base2_namespaceObject, ...dist_src_bases_base8_namespaceObject, ...dist_src_bases_base10_namespaceObject, ...dist_src_bases_base16_namespaceObject, ...multiformats_dist_src_bases_base32_namespaceObject, ...dist_src_bases_base36_namespaceObject, ...multiformats_dist_src_bases_base58_namespaceObject, ...multiformats_dist_src_bases_base64_namespaceObject, ...dist_src_bases_base256emoji_namespaceObject }; +const dist_src_basics_hashes = { ...dist_src_hashes_sha2_namespaceObject, ...dist_src_hashes_identity_namespaceObject }; +const dist_src_basics_codecs = { raw: dist_src_codecs_raw_namespaceObject, json: dist_src_codecs_json_namespaceObject }; + +//# sourceMappingURL=basics.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/uint8arrays/dist/src/alloc.js + /** - * Creates a multihash digest. - */ -function node_modules_multiformats_dist_src_hashes_digest_create(code, digest) { - const size = digest.byteLength; - const sizeOffset = node_modules_multiformats_dist_src_varint_encodingLength(code); - const digestOffset = sizeOffset + node_modules_multiformats_dist_src_varint_encodingLength(size); - const bytes = new Uint8Array(digestOffset + size); - node_modules_multiformats_dist_src_varint_encodeTo(code, bytes, 0); - node_modules_multiformats_dist_src_varint_encodeTo(size, bytes, sizeOffset); - bytes.set(digest, digestOffset); - return new node_modules_multiformats_dist_src_hashes_digest_Digest(code, size, digest, bytes); -} -/** - * Turns bytes representation of multihash digest into an instance. + * Returns a `Uint8Array` of the requested size. Referenced memory will + * be initialized to 0. */ -function node_modules_multiformats_dist_src_hashes_digest_decode(multihash) { - const bytes = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_bytes_coerce(multihash); - const [code, sizeOffset] = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_varint_decode(bytes); - const [size, digestOffset] = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_varint_decode(bytes.subarray(sizeOffset)); - const digest = bytes.subarray(sizeOffset + digestOffset); - if (digest.byteLength !== size) { - throw new Error('Incorrect length'); - } - return new node_modules_multiformats_dist_src_hashes_digest_Digest(code, size, digest, bytes); -} -function node_modules_multiformats_dist_src_hashes_digest_equals(a, b) { - if (a === b) { - return true; - } - else { - const data = b; - return (a.code === data.code && - a.size === data.size && - data.bytes instanceof Uint8Array && - node_modules_multiformats_dist_src_bytes_equals(a.bytes, data.bytes)); +function ipfs_unixfs_importer_node_modules_uint8arrays_dist_src_alloc_alloc(size = 0) { + if (globalThis.Buffer?.alloc != null) { + return asUint8Array(globalThis.Buffer.alloc(size)); } + return new Uint8Array(size); } /** - * Represents a multihash digest which carries information about the - * hashing algorithm and an actual hash digest. + * Where possible returns a Uint8Array of the requested size that references + * uninitialized memory. Only use if you are certain you will immediately + * overwrite every value in the returned `Uint8Array`. */ -class node_modules_multiformats_dist_src_hashes_digest_Digest { - code; - size; - digest; - bytes; - /** - * Creates a multihash digest. - */ - constructor(code, size, digest, bytes) { - this.code = code; - this.size = size; - this.digest = digest; - this.bytes = bytes; +function ipfs_unixfs_importer_node_modules_uint8arrays_dist_src_alloc_allocUnsafe(size = 0) { + if (globalThis.Buffer?.allocUnsafe != null) { + return ipfs_unixfs_importer_node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.allocUnsafe(size)); } + return new Uint8Array(size); } -//# sourceMappingURL=digest.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/cid.js - - - - +//# sourceMappingURL=alloc.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/uint8arrays/dist/src/util/bases.js -// This way TS will also expose all the types from module -function node_modules_multiformats_dist_src_cid_format(link, base) { - const { bytes, version } = link; - switch (version) { - case 0: - return node_modules_multiformats_dist_src_cid_toStringV0(bytes, node_modules_multiformats_dist_src_cid_baseCache(link), base ?? node_modules_multiformats_dist_src_bases_base58_base58btc.encoder); - default: - return node_modules_multiformats_dist_src_cid_toStringV1(bytes, node_modules_multiformats_dist_src_cid_baseCache(link), (base ?? node_modules_multiformats_dist_src_bases_base32_base32.encoder)); - } -} -function node_modules_multiformats_dist_src_cid_toJSON(link) { +function dist_src_util_bases_createCodec(name, prefix, encode, decode) { return { - '/': node_modules_multiformats_dist_src_cid_format(link) - }; -} -function node_modules_multiformats_dist_src_cid_fromJSON(json) { - return ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.parse(json['/']); -} -const node_modules_multiformats_dist_src_cid_cache = new WeakMap(); -function node_modules_multiformats_dist_src_cid_baseCache(cid) { - const baseCache = node_modules_multiformats_dist_src_cid_cache.get(cid); - if (baseCache == null) { - const baseCache = new Map(); - node_modules_multiformats_dist_src_cid_cache.set(cid, baseCache); - return baseCache; - } - return baseCache; + name, + prefix, + encoder: { + name, + prefix, + encode + }, + decoder: { + decode + } + }; } -class ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID { - code; - version; - multihash; - bytes; - '/'; - /** - * @param version - Version of the CID - * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param multihash - (Multi)hash of the of the content. - */ - constructor(version, code, multihash, bytes) { - this.code = code; - this.version = version; - this.multihash = multihash; - this.bytes = bytes; - // flag to serializers that this is a CID and - // should be treated specially - this['/'] = bytes; +const dist_src_util_bases_string = dist_src_util_bases_createCodec('utf8', 'u', (buf) => { + const decoder = new TextDecoder('utf8'); + return 'u' + decoder.decode(buf); +}, (str) => { + const encoder = new TextEncoder(); + return encoder.encode(str.substring(1)); +}); +const dist_src_util_bases_ascii = dist_src_util_bases_createCodec('ascii', 'a', (buf) => { + let string = 'a'; + for (let i = 0; i < buf.length; i++) { + string += String.fromCharCode(buf[i]); } - /** - * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` - * please either use `CID.asCID(cid)` or switch to new signalling mechanism - * - * @deprecated - */ - get asCID() { - return this; + return string; +}, (str) => { + str = str.substring(1); + const buf = ipfs_unixfs_importer_node_modules_uint8arrays_dist_src_alloc_allocUnsafe(str.length); + for (let i = 0; i < str.length; i++) { + buf[i] = str.charCodeAt(i); } - // ArrayBufferView - get byteOffset() { - return this.bytes.byteOffset; + return buf; +}); +const dist_src_util_bases_BASES = { + utf8: dist_src_util_bases_string, + 'utf-8': dist_src_util_bases_string, + hex: dist_src_basics_bases.base16, + latin1: dist_src_util_bases_ascii, + ascii: dist_src_util_bases_ascii, + binary: dist_src_util_bases_ascii, + ...dist_src_basics_bases +}; +/* harmony default export */ const node_modules_uint8arrays_dist_src_util_bases = (dist_src_util_bases_BASES); +//# sourceMappingURL=bases.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/node_modules/uint8arrays/dist/src/from-string.js + + +/** + * Create a `Uint8Array` from the passed string + * + * Supports `utf8`, `utf-8`, `hex`, and any encoding supported by the multiformats module. + * + * Also `ascii` which is similar to node's 'binary' encoding. + */ +function node_modules_uint8arrays_dist_src_from_string_fromString(string, encoding = 'utf8') { + const base = node_modules_uint8arrays_dist_src_util_bases[encoding]; + if (base == null) { + throw new Error(`Unsupported encoding "${encoding}"`); } - // ArrayBufferView - get byteLength() { - return this.bytes.byteLength; + if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) { + return ipfs_unixfs_importer_node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.from(string, 'utf-8')); } - toV0() { - switch (this.version) { - case 0: { - return this; - } - case 1: { - const { code, multihash } = this; - if (code !== node_modules_multiformats_dist_src_cid_DAG_PB_CODE) { - throw new Error('Cannot convert a non dag-pb CID to CIDv0'); - } - // sha2-256 - if (multihash.code !== node_modules_multiformats_dist_src_cid_SHA_256_CODE) { - throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0'); - } - return (ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.createV0(multihash)); + // add multibase prefix + return base.decoder.decode(`${base.prefix}${string}`); // eslint-disable-line @typescript-eslint/restrict-template-expressions +} +//# sourceMappingURL=from-string.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/dag-builder/validate-chunks.js + + +const defaultChunkValidator = () => { + return async function* validateChunks(source) { + for await (const content of source) { + if (content.length === undefined) { + throw err_code(new Error('Content was invalid'), 'ERR_INVALID_CONTENT'); } - default: { - throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`); + if (typeof content === 'string' || content instanceof String) { + yield node_modules_uint8arrays_dist_src_from_string_fromString(content.toString()); } - } - } - toV1() { - switch (this.version) { - case 0: { - const { code, digest } = this.multihash; - const multihash = node_modules_multiformats_dist_src_hashes_digest_create(code, digest); - return (ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.createV1(this.code, multihash)); + else if (Array.isArray(content)) { + yield Uint8Array.from(content); } - case 1: { - return this; + else if (content instanceof Uint8Array) { + yield content; } - default: { - throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`); + else { + throw err_code(new Error('Content was invalid'), 'ERR_INVALID_CONTENT'); } } + }; +}; +//# sourceMappingURL=validate-chunks.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/layout/balanced.js + +const DEFAULT_MAX_CHILDREN_PER_NODE = 174; +function balanced(options) { + const maxChildrenPerNode = options?.maxChildrenPerNode ?? DEFAULT_MAX_CHILDREN_PER_NODE; + return async function balancedLayout(source, reduce) { + const roots = []; + for await (const chunked of it_batch_dist_src(source, maxChildrenPerNode)) { + roots.push(await reduce(chunked)); + } + if (roots.length > 1) { + return balancedLayout(roots, reduce); + } + return roots[0]; + }; +} +//# sourceMappingURL=balanced.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/dir.js + +class Dir { + options; + root; + dir; + path; + dirty; + flat; + parent; + parentKey; + unixfs; + mode; + mtime; + cid; + size; + nodeSize; + constructor(props, options) { + this.options = options ?? {}; + this.root = props.root; + this.dir = props.dir; + this.path = props.path; + this.dirty = props.dirty; + this.flat = props.flat; + this.parent = props.parent; + this.parentKey = props.parentKey; + this.unixfs = props.unixfs; + this.mode = props.mode; + this.mtime = props.mtime; } - equals(other) { - return ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.equals(this, other); +} +// we use these to calculate the node size to use as a check for whether a directory +// should be sharded or not. Since CIDs have a constant length and We're only +// interested in the data length and not the actual content identifier we can use +// any old CID instead of having to hash the data which is expensive. +const CID_V0 = node_modules_multiformats_dist_src_cid_CID.parse('QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn'); +const CID_V1 = node_modules_multiformats_dist_src_cid_CID.parse('zdj7WbTaiJT1fgatdet9Ei9iDB5hdCxkbVyhyh8YTUnXMiwYi'); +//# sourceMappingURL=dir.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/dir-flat.js + + + + +class DirFlat extends Dir { + _children; + constructor(props, options) { + super(props, options); + this._children = new Map(); } - static equals(self, other) { - const unknown = other; - return (unknown != null && - self.code === unknown.code && - self.version === unknown.version && - node_modules_multiformats_dist_src_hashes_digest_equals(self.multihash, unknown.multihash)); + async put(name, value) { + this.cid = undefined; + this.size = undefined; + this.nodeSize = undefined; + this._children.set(name, value); } - toString(base) { - return node_modules_multiformats_dist_src_cid_format(this, base); + async get(name) { + return Promise.resolve(this._children.get(name)); } - toJSON() { - return { '/': node_modules_multiformats_dist_src_cid_format(this) }; + childCount() { + return this._children.size; } - link() { - return this; + directChildrenCount() { + return this.childCount(); } - [Symbol.toStringTag] = 'CID'; - // Legacy - [Symbol.for('nodejs.util.inspect.custom')]() { - return `CID(${this.toString()})`; + onlyChild() { + return this._children.values().next().value; } - /** - * Takes any input `value` and returns a `CID` instance if it was - * a `CID` otherwise returns `null`. If `value` is instanceof `CID` - * it will return value back. If `value` is not instance of this CID - * class, but is compatible CID it will return new instance of this - * `CID` class. Otherwise returns null. - * - * This allows two different incompatible versions of CID library to - * co-exist and interop as long as binary interface is compatible. - */ - static asCID(input) { - if (input == null) { - return null; - } - const value = input; - if (value instanceof ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID) { - // If value is instance of CID then we're all set. - return value; - } - else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { - // If value isn't instance of this CID class but `this.asCID === this` or - // `value['/'] === value.bytes` is true it is CID instance coming from a - // different implementation (diff version or duplicate). In that case we - // rebase it to this `CID` implementation so caller is guaranteed to get - // instance with expected API. - const { version, code, multihash, bytes } = value; - return new ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID(version, code, multihash, bytes ?? node_modules_multiformats_dist_src_cid_encodeCID(version, code, multihash.bytes)); - } - else if (value[node_modules_multiformats_dist_src_cid_cidSymbol] === true) { - // If value is a CID from older implementation that used to be tagged via - // symbol we still rebase it to the this `CID` implementation by - // delegating that to a constructor. - const { version, multihash, code } = value; - const digest = node_modules_multiformats_dist_src_hashes_digest_decode(multihash); - return ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.create(version, code, digest); - } - else { - // Otherwise value is not a CID (or an incompatible version of it) in - // which case we return `null`. - return null; + async *eachChildSeries() { + for (const [key, child] of this._children.entries()) { + yield { + key, + child + }; } } - /** - * @param version - Version of the CID - * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv - * @param digest - (Multi)hash of the of the content. - */ - static create(version, code, digest) { - if (typeof code !== 'number') { - throw new Error('String codecs are no longer supported'); + estimateNodeSize() { + if (this.nodeSize !== undefined) { + return this.nodeSize; } - if (!(digest.bytes instanceof Uint8Array)) { - throw new Error('Invalid digest'); + this.nodeSize = 0; + // estimate size only based on DAGLink name and CID byte lengths + // https://github.com/ipfs/go-unixfsnode/blob/37b47f1f917f1b2f54c207682f38886e49896ef9/data/builder/directory.go#L81-L96 + for (const [name, child] of this._children.entries()) { + if (child.size != null && (child.cid != null)) { + this.nodeSize += name.length + (this.options.cidVersion === 1 ? CID_V1.bytes.byteLength : CID_V0.bytes.byteLength); + } } - switch (version) { - case 0: { - if (code !== node_modules_multiformats_dist_src_cid_DAG_PB_CODE) { - throw new Error(`Version 0 CID must use dag-pb (code: ${node_modules_multiformats_dist_src_cid_DAG_PB_CODE}) block encoding`); - } - else { - return new ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID(version, code, digest, digest.bytes); + return this.nodeSize; + } + async *flush(block) { + const links = []; + for (const [name, child] of this._children.entries()) { + let result = child; + if (child instanceof Dir) { + for await (const entry of child.flush(block)) { + result = entry; + yield entry; } } - case 1: { - const bytes = node_modules_multiformats_dist_src_cid_encodeCID(version, code, digest.bytes); - return new ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID(version, code, digest, bytes); - } - default: { - throw new Error('Invalid version'); + if (result.size != null && (result.cid != null)) { + links.push({ + Name: name, + Tsize: Number(result.size), + Hash: result.cid + }); } } + const unixfs = new src_UnixFS({ + type: 'directory', + mtime: this.mtime, + mode: this.mode + }); + const node = { Data: unixfs.marshal(), Links: links }; + const buffer = src_encode(prepare(node)); + const cid = await persist(buffer, block, this.options); + const size = buffer.length + node.Links.reduce( + /** + * @param {number} acc + * @param {PBLink} curr + */ + (acc, curr) => acc + (curr.Tsize == null ? 0 : curr.Tsize), 0); + this.cid = cid; + this.size = size; + yield { + cid, + unixfs, + path: this.path, + size: BigInt(size) + }; } - /** - * Simplified version of `create` for CIDv0. - */ - static createV0(digest) { - return ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.create(0, node_modules_multiformats_dist_src_cid_DAG_PB_CODE, digest); +} +//# sourceMappingURL=dir-flat.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bytes.js +const unixfs_node_modules_multiformats_src_bytes_empty = new Uint8Array(0) + +/** + * @param {Uint8Array} d + */ +const unixfs_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') + +/** + * @param {string} hex + */ +const unixfs_node_modules_multiformats_src_bytes_fromHex = hex => { + const hexes = hex.match(/../g) + return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : unixfs_node_modules_multiformats_src_bytes_empty +} + +/** + * @param {Uint8Array} aa + * @param {Uint8Array} bb + */ +const unixfs_node_modules_multiformats_src_bytes_equals = (aa, bb) => { + if (aa === bb) return true + if (aa.byteLength !== bb.byteLength) { + return false + } + + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false } - /** - * Simplified version of `create` for CIDv1. - * - * @param code - Content encoding format code. - * @param digest - Multihash of the content. - */ - static createV1(code, digest) { - return ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.create(1, code, digest); + } + + return true +} + +/** + * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o + * @returns {Uint8Array} + */ +const unixfs_node_modules_multiformats_src_bytes_coerce = o => { + if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o + if (o instanceof ArrayBuffer) return new Uint8Array(o) + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) + } + throw new Error('Unknown type, must be binary type') +} + +/** + * @param {any} o + * @returns {o is ArrayBuffer|ArrayBufferView} + */ +const unixfs_node_modules_multiformats_src_bytes_isBinary = o => + o instanceof ArrayBuffer || ArrayBuffer.isView(o) + +/** + * @param {string} str + * @returns {Uint8Array} + */ +const unixfs_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) + +/** + * @param {Uint8Array} b + * @returns {string} + */ +const unixfs_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) + + + +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/vendor/base-x.js +// base-x encoding / decoding +// Copyright (c) 2018 base-x contributors +// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) +// Distributed under the MIT software license, see the accompanying +// file LICENSE or http://www.opensource.org/licenses/mit-license.php. +function unixfs_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { + if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; + } + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') } + BASE_MAP[xc] = i; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up + var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up + function encode (source) { + if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } else if (Array.isArray(source)) { + source = Uint8Array.from(source); } - /** - * Decoded a CID from its binary representation. The byte array must contain - * only the CID with no additional bytes. - * - * An error will be thrown if the bytes provided do not contain a valid - * binary representation of a CID. - */ - static decode(bytes) { - const [cid, remainder] = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.decodeFirst(bytes); - if (remainder.length !== 0) { - throw new Error('Incorrect length'); - } - return cid; + if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') } + if (source.length === 0) { return '' } + // Skip & count leading zeroes. + var zeroes = 0; + var length = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; } - /** - * Decoded a CID from its binary representation at the beginning of a byte - * array. - * - * Returns an array with the first element containing the CID and the second - * element containing the remainder of the original byte array. The remainder - * will be a zero-length byte array if the provided bytes only contained a - * binary CID representation. - */ - static decodeFirst(bytes) { - const specs = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.inspectBytes(bytes); - const prefixSize = specs.size - specs.multihashSize; - const multihashBytes = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_bytes_coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize)); - if (multihashBytes.byteLength !== specs.multihashSize) { - throw new Error('Incorrect length'); - } - const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize); - const digest = new node_modules_multiformats_dist_src_hashes_digest_Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); - const cid = specs.version === 0 - ? ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.createV0(digest) - : ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.createV1(specs.codec, digest); - return [cid, bytes.subarray(specs.size)]; + // Allocate enough space in big-endian base58 representation. + var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; + var b58 = new Uint8Array(size); + // Process the bytes. + while (pbegin !== pend) { + var carry = source[pbegin]; + // Apply "b58 = b58 * 256 + ch". + var i = 0; + for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { + carry += (256 * b58[it1]) >>> 0; + b58[it1] = (carry % BASE) >>> 0; + carry = (carry / BASE) >>> 0; + } + if (carry !== 0) { throw new Error('Non-zero carry') } + length = i; + pbegin++; } - /** - * Inspect the initial bytes of a CID to determine its properties. - * - * Involves decoding up to 4 varints. Typically this will require only 4 to 6 - * bytes but for larger multicodec code values and larger multihash digest - * lengths these varints can be quite large. It is recommended that at least - * 10 bytes be made available in the `initialBytes` argument for a complete - * inspection. - */ - static inspectBytes(initialBytes) { - let offset = 0; - const next = () => { - const [i, length] = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_varint_decode(initialBytes.subarray(offset)); - offset += length; - return i; - }; - let version = next(); - let codec = node_modules_multiformats_dist_src_cid_DAG_PB_CODE; - if (version === 18) { - // CIDv0 - version = 0; - offset = 0; - } - else { - codec = next(); - } - if (version !== 0 && version !== 1) { - throw new RangeError(`Invalid CID version ${version}`); - } - const prefixSize = offset; - const multihashCode = next(); // multihash code - const digestSize = next(); // multihash length - const size = offset + digestSize; - const multihashSize = size - prefixSize; - return { version, codec, multihashCode, digestSize, multihashSize, size }; + // Skip leading zeroes in base58 result. + var it2 = size - length; + while (it2 !== size && b58[it2] === 0) { + it2++; } - /** - * Takes cid in a string representation and creates an instance. If `base` - * decoder is not provided will use a default from the configuration. It will - * throw an error if encoding of the CID is not compatible with supplied (or - * a default decoder). - */ - static parse(source, base) { - const [prefix, bytes] = node_modules_multiformats_dist_src_cid_parseCIDtoBytes(source, base); - const cid = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.decode(bytes); - if (cid.version === 0 && source[0] !== 'Q') { - throw Error('Version 0 CID string must not include multibase prefix'); - } - // Cache string representation to avoid computing it on `this.toString()` - node_modules_multiformats_dist_src_cid_baseCache(cid).set(prefix, source); - return cid; + // Translate the result into a string. + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); } + return str + } + function decodeUnsafe (source) { + if (typeof source !== 'string') { throw new TypeError('Expected String') } + if (source.length === 0) { return new Uint8Array() } + var psz = 0; + // Skip leading spaces. + if (source[psz] === ' ') { return } + // Skip and count leading '1's. + var zeroes = 0; + var length = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; } -} -function node_modules_multiformats_dist_src_cid_parseCIDtoBytes(source, base) { - switch (source[0]) { - // CIDv0 is parsed differently - case 'Q': { - const decoder = base ?? node_modules_multiformats_dist_src_bases_base58_base58btc; - return [ - node_modules_multiformats_dist_src_bases_base58_base58btc.prefix, - decoder.decode(`${node_modules_multiformats_dist_src_bases_base58_base58btc.prefix}${source}`) - ]; - } - case node_modules_multiformats_dist_src_bases_base58_base58btc.prefix: { - const decoder = base ?? node_modules_multiformats_dist_src_bases_base58_base58btc; - return [node_modules_multiformats_dist_src_bases_base58_base58btc.prefix, decoder.decode(source)]; - } - case node_modules_multiformats_dist_src_bases_base32_base32.prefix: { - const decoder = base ?? node_modules_multiformats_dist_src_bases_base32_base32; - return [node_modules_multiformats_dist_src_bases_base32_base32.prefix, decoder.decode(source)]; - } - default: { - if (base == null) { - throw Error('To parse non base32 or base58btc encoded CID multibase decoder must be provided'); - } - return [source[0], base.decode(source)]; - } + // Allocate enough space in big-endian base256 representation. + var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. + var b256 = new Uint8Array(size); + // Process the characters. + while (source[psz]) { + // Decode character + var carry = BASE_MAP[source.charCodeAt(psz)]; + // Invalid character + if (carry === 255) { return } + var i = 0; + for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { + carry += (BASE * b256[it3]) >>> 0; + b256[it3] = (carry % 256) >>> 0; + carry = (carry / 256) >>> 0; + } + if (carry !== 0) { throw new Error('Non-zero carry') } + length = i; + psz++; } -} -function node_modules_multiformats_dist_src_cid_toStringV0(bytes, cache, base) { - const { prefix } = base; - if (prefix !== node_modules_multiformats_dist_src_bases_base58_base58btc.prefix) { - throw Error(`Cannot string encode V0 in ${base.name} encoding`); + // Skip trailing spaces. + if (source[psz] === ' ') { return } + // Skip leading zeroes in b256. + var it4 = size - length; + while (it4 !== size && b256[it4] === 0) { + it4++; } - const cid = cache.get(prefix); - if (cid == null) { - const cid = base.encode(bytes).slice(1); - cache.set(prefix, cid); - return cid; + var vch = new Uint8Array(zeroes + (size - it4)); + var j = zeroes; + while (it4 !== size) { + vch[j++] = b256[it4++]; } - else { - return cid; + return vch + } + function decode (string) { + var buffer = decodeUnsafe(string); + if (buffer) { return buffer } + throw new Error(`Non-${name} character`) + } + return { + encode: encode, + decodeUnsafe: decodeUnsafe, + decode: decode + } +} +var unixfs_node_modules_multiformats_vendor_base_x_src = unixfs_node_modules_multiformats_vendor_base_x_base; + +var unixfs_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = unixfs_node_modules_multiformats_vendor_base_x_src; + +/* harmony default export */ const unixfs_node_modules_multiformats_vendor_base_x = (unixfs_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX); + +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base.js + + +// Linter can't see that API is used in types. +// eslint-disable-next-line + + +/** + * Class represents both BaseEncoder and MultibaseEncoder meaning it + * can be used to encode to multibase or base encode without multibase + * prefix. + * + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseEncoder} + * @implements {API.BaseEncoder} + */ +class unixfs_node_modules_multiformats_src_bases_base_Encoder { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(bytes:Uint8Array) => string} baseEncode + */ + constructor (name, prefix, baseEncode) { + this.name = name + this.prefix = prefix + this.baseEncode = baseEncode + } + + /** + * @param {Uint8Array} bytes + * @returns {API.Multibase} + */ + encode (bytes) { + if (bytes instanceof Uint8Array) { + return `${this.prefix}${this.baseEncode(bytes)}` + } else { + throw Error('Unknown type, must be binary type') } + } } -function node_modules_multiformats_dist_src_cid_toStringV1(bytes, cache, base) { - const { prefix } = base; - const cid = cache.get(prefix); - if (cid == null) { - const cid = base.encode(bytes); - cache.set(prefix, cid); - return cid; + +/** + * @template {string} Prefix + */ +/** + * Class represents both BaseDecoder and MultibaseDecoder so it could be used + * to decode multibases (with matching prefix) or just base decode strings + * with corresponding base encoding. + * + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseDecoder} + * @implements {API.UnibaseDecoder} + * @implements {API.BaseDecoder} + */ +class unixfs_node_modules_multiformats_src_bases_base_Decoder { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(text:string) => Uint8Array} baseDecode + */ + constructor (name, prefix, baseDecode) { + this.name = name + this.prefix = prefix + /* c8 ignore next 3 */ + if (prefix.codePointAt(0) === undefined) { + throw new Error('Invalid prefix character') } - else { - return cid; + /** @private */ + this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0)) + this.baseDecode = baseDecode + } + + /** + * @param {string} text + */ + decode (text) { + if (typeof text === 'string') { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`) + } + return this.baseDecode(text.slice(this.prefix.length)) + } else { + throw Error('Can only multibase decode strings') } + } + + /** + * @template {string} OtherPrefix + * @param {API.UnibaseDecoder|ComposedDecoder} decoder + * @returns {ComposedDecoder} + */ + or (decoder) { + return unixfs_node_modules_multiformats_src_bases_base_or(this, decoder) + } } -const node_modules_multiformats_dist_src_cid_DAG_PB_CODE = 0x70; -const node_modules_multiformats_dist_src_cid_SHA_256_CODE = 0x12; -function node_modules_multiformats_dist_src_cid_encodeCID(version, code, multihash) { - const codeOffset = node_modules_multiformats_dist_src_varint_encodingLength(version); - const hashOffset = codeOffset + node_modules_multiformats_dist_src_varint_encodingLength(code); - const bytes = new Uint8Array(hashOffset + multihash.byteLength); - node_modules_multiformats_dist_src_varint_encodeTo(version, bytes, 0); - node_modules_multiformats_dist_src_varint_encodeTo(code, bytes, codeOffset); - bytes.set(multihash, hashOffset); - return bytes; -} -const node_modules_multiformats_dist_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID'); -//# sourceMappingURL=cid.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/codecs/raw.js -const multiformats_dist_src_codecs_raw_name = 'raw'; -const multiformats_dist_src_codecs_raw_code = 0x55; -function multiformats_dist_src_codecs_raw_encode(node) { - return coerce(node); +/** + * @template {string} Prefix + * @typedef {Record>} Decoders + */ + +/** + * @template {string} Prefix + * @implements {API.MultibaseDecoder} + * @implements {API.CombobaseDecoder} + */ +class unixfs_node_modules_multiformats_src_bases_base_ComposedDecoder { + /** + * @param {Decoders} decoders + */ + constructor (decoders) { + this.decoders = decoders + } + + /** + * @template {string} OtherPrefix + * @param {API.UnibaseDecoder|ComposedDecoder} decoder + * @returns {ComposedDecoder} + */ + or (decoder) { + return unixfs_node_modules_multiformats_src_bases_base_or(this, decoder) + } + + /** + * @param {string} input + * @returns {Uint8Array} + */ + decode (input) { + const prefix = /** @type {Prefix} */ (input[0]) + const decoder = this.decoders[prefix] + if (decoder) { + return decoder.decode(input) + } else { + throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`) + } + } } -function multiformats_dist_src_codecs_raw_decode(data) { - return coerce(data); + +/** + * @template {string} L + * @template {string} R + * @param {API.UnibaseDecoder|API.CombobaseDecoder} left + * @param {API.UnibaseDecoder|API.CombobaseDecoder} right + * @returns {ComposedDecoder} + */ +const unixfs_node_modules_multiformats_src_bases_base_or = (left, right) => new unixfs_node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({ + ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }), + ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right }) +})) + +/** + * @class + * @template {string} Base + * @template {string} Prefix + * @implements {API.MultibaseCodec} + * @implements {API.MultibaseEncoder} + * @implements {API.MultibaseDecoder} + * @implements {API.BaseCodec} + * @implements {API.BaseEncoder} + * @implements {API.BaseDecoder} + */ +class unixfs_node_modules_multiformats_src_bases_base_Codec { + /** + * @param {Base} name + * @param {Prefix} prefix + * @param {(bytes:Uint8Array) => string} baseEncode + * @param {(text:string) => Uint8Array} baseDecode + */ + constructor (name, prefix, baseEncode, baseDecode) { + this.name = name + this.prefix = prefix + this.baseEncode = baseEncode + this.baseDecode = baseDecode + this.encoder = new unixfs_node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode) + this.decoder = new unixfs_node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode) + } + + /** + * @param {Uint8Array} input + */ + encode (input) { + return this.encoder.encode(input) + } + + /** + * @param {string} input + */ + decode (input) { + return this.decoder.decode(input) + } } -//# sourceMappingURL=raw.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/hashes/identity.js +/** + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {(bytes:Uint8Array) => string} options.encode + * @param {(input:string) => Uint8Array} options.decode + * @returns {Codec} + */ +const unixfs_node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) => + new unixfs_node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode) -const multiformats_dist_src_hashes_identity_code = 0x0; -const multiformats_dist_src_hashes_identity_name = 'identity'; -const multiformats_dist_src_hashes_identity_encode = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_bytes_coerce; -function multiformats_dist_src_hashes_identity_digest(input) { - return node_modules_multiformats_dist_src_hashes_digest_create(multiformats_dist_src_hashes_identity_code, multiformats_dist_src_hashes_identity_encode(input)); +/** + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {string} options.alphabet + * @returns {Codec} + */ +const unixfs_node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => { + const { encode, decode } = unixfs_node_modules_multiformats_vendor_base_x(alphabet, name) + return unixfs_node_modules_multiformats_src_bases_base_from({ + prefix, + name, + encode, + /** + * @param {string} text + */ + decode: text => unixfs_node_modules_multiformats_src_bytes_coerce(decode(text)) + }) } -const multiformats_dist_src_hashes_identity_identity = { code: multiformats_dist_src_hashes_identity_code, name: multiformats_dist_src_hashes_identity_name, encode: multiformats_dist_src_hashes_identity_encode, digest: multiformats_dist_src_hashes_identity_digest }; -//# sourceMappingURL=identity.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.js +/** + * @param {string} string + * @param {string} alphabet + * @param {number} bitsPerChar + * @param {string} name + * @returns {Uint8Array} + */ +const unixfs_node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { + // Build the character lookup table: + /** @type {Record} */ + const codes = {} + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i + } + // Count the padding bytes: + let end = string.length + while (string[end - 1] === '=') { + --end + } -const dag_cbor_resolve = async (cid, name, path, toResolve, resolve, depth, blockstore, options) => { - const block = await blockstore.get(cid, options); - const object = dag_cbor_src_decode(block); - let subObject = object; - let subPath = path; - while (toResolve.length > 0) { - const prop = toResolve[0]; - if (prop in subObject) { - // remove the bit of the path we have resolved - toResolve.shift(); - subPath = `${subPath}/${prop}`; - const subObjectCid = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.asCID(subObject[prop]); - if (subObjectCid != null) { - return { - entry: { - type: 'object', - name, - path, - cid, - node: block, - depth, - size: BigInt(block.length), - content: async function* () { - yield object; - } - }, - next: { - cid: subObjectCid, - name: prop, - path: subPath, - toResolve - } - }; - } - subObject = subObject[prop]; - } - else { - // cannot resolve further - throw err_code(new Error(`No property named ${prop} found in cbor node ${cid}`), 'ERR_NO_PROP'); - } - } - return { - entry: { - type: 'object', - name, - path, - cid, - node: block, - depth, - size: BigInt(block.length), - content: async function* () { - yield object; - } - } - }; -}; -/* harmony default export */ const dag_cbor = (dag_cbor_resolve); -//# sourceMappingURL=dag-cbor.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.js -function extractDataFromBlock(block, blockStart, requestedStart, requestedEnd) { - const blockLength = BigInt(block.length); - const blockEnd = BigInt(blockStart + blockLength); - if (requestedStart >= blockEnd || requestedEnd < blockStart) { - // If we are looking for a byte range that is starts after the start of the block, - // return an empty block. This can happen when internal nodes contain data - return new Uint8Array(0); - } - if (requestedEnd >= blockStart && requestedEnd < blockEnd) { - // If the end byte is in the current block, truncate the block to the end byte - block = block.subarray(0, Number(requestedEnd - blockStart)); + // Allocate the output: + const out = new Uint8Array((end * bitsPerChar / 8) | 0) + + // Parse the data: + let bits = 0 // Number of bits currently in the buffer + let buffer = 0 // Bits waiting to be written out, MSB first + let written = 0 // Next byte to write + for (let i = 0; i < end; ++i) { + // Read one character from the string: + const value = codes[string[i]] + if (value === undefined) { + throw new SyntaxError(`Non-${name} character`) } - if (requestedStart >= blockStart && requestedStart < blockEnd) { - // If the start byte is in the current block, skip to the start byte - block = block.subarray(Number(requestedStart - blockStart)); + + // Append the bits to the buffer: + buffer = (buffer << bitsPerChar) | value + bits += bitsPerChar + + // Write out some bits if the buffer has a byte's worth: + if (bits >= 8) { + bits -= 8 + out[written++] = 0xff & (buffer >> bits) } - return block; + } + + // Verify that we have received just enough bits: + if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) { + throw new SyntaxError('Unexpected end of data') + } + + return out } -/* harmony default export */ const extract_data_from_block = (extractDataFromBlock); -//# sourceMappingURL=extract-data-from-block.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.js -const validateOffsetAndLength = (size, offset = 0, length = size) => { - const fileSize = BigInt(size); - const start = BigInt(offset ?? 0); - let end = BigInt(length); - if (end !== fileSize) { - end = start + end; - } - if (end > fileSize) { - end = fileSize; - } - if (start < 0n) { - throw err_code(new Error('Offset must be greater than or equal to 0'), 'ERR_INVALID_PARAMS'); - } - if (start > fileSize) { - throw err_code(new Error('Offset must be less than the file size'), 'ERR_INVALID_PARAMS'); +/** + * @param {Uint8Array} data + * @param {string} alphabet + * @param {number} bitsPerChar + * @returns {string} + */ +const unixfs_node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => { + const pad = alphabet[alphabet.length - 1] === '=' + const mask = (1 << bitsPerChar) - 1 + let out = '' + + let bits = 0 // Number of bits currently in the buffer + let buffer = 0 // Bits waiting to be written out, MSB first + for (let i = 0; i < data.length; ++i) { + // Slurp data into the buffer: + buffer = (buffer << 8) | data[i] + bits += 8 + + // Write out as much as we can: + while (bits > bitsPerChar) { + bits -= bitsPerChar + out += alphabet[mask & (buffer >> bits)] } - if (end < 0n) { - throw err_code(new Error('Length must be greater than or equal to 0'), 'ERR_INVALID_PARAMS'); + } + + // Partial character: + if (bits) { + out += alphabet[mask & (buffer << (bitsPerChar - bits))] + } + + // Add padding characters until we hit a byte boundary: + if (pad) { + while ((out.length * bitsPerChar) & 7) { + out += '=' } - if (end > fileSize) { - throw err_code(new Error('Length must be less than the file size'), 'ERR_INVALID_PARAMS'); + } + + return out +} + +/** + * RFC4648 Factory + * + * @template {string} Base + * @template {string} Prefix + * @param {object} options + * @param {Base} options.name + * @param {Prefix} options.prefix + * @param {string} options.alphabet + * @param {number} options.bitsPerChar + */ +const unixfs_node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { + return unixfs_node_modules_multiformats_src_bases_base_from({ + prefix, + name, + encode (input) { + return unixfs_node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar) + }, + decode (input) { + return unixfs_node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name) } - return { - start, - end - }; -}; -/* harmony default export */ const validate_offset_and_length = (validateOffsetAndLength); -//# sourceMappingURL=validate-offset-and-length.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/resolvers/identity.js + }) +} +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base32.js +const unixfs_node_modules_multiformats_src_bases_base32_base32 = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'b', + name: 'base32', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567', + bitsPerChar: 5 +}) +const unixfs_node_modules_multiformats_src_bases_base32_base32upper = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'B', + name: 'base32upper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', + bitsPerChar: 5 +}) -const rawContent = (node) => { - async function* contentGenerator(options = {}) { - const { start, end } = validate_offset_and_length(node.length, options.offset, options.length); - const buf = extract_data_from_block(node, 0n, start, end); - options.onProgress?.(new CustomProgressEvent('unixfs:exporter:progress:identity', { - bytesRead: BigInt(buf.byteLength), - totalBytes: end - start, - fileSize: BigInt(node.byteLength) - })); - yield buf; - } - return contentGenerator; -}; -const identity_resolve = async (cid, name, path, toResolve, resolve, depth, blockstore, options) => { - if (toResolve.length > 0) { - throw err_code(new Error(`No link named ${path} found in raw node ${cid}`), 'ERR_NOT_FOUND'); - } - const buf = node_modules_multiformats_dist_src_hashes_digest_decode(cid.multihash.bytes); - return { - entry: { - type: 'identity', - name, - path, - cid, - content: rawContent(buf.digest), - depth, - size: BigInt(buf.digest.length), - node: buf.digest - } - }; -}; -/* harmony default export */ const resolvers_identity = (identity_resolve); -//# sourceMappingURL=identity.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/resolvers/raw.js +const unixfs_node_modules_multiformats_src_bases_base32_base32pad = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'c', + name: 'base32pad', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', + bitsPerChar: 5 +}) +const unixfs_node_modules_multiformats_src_bases_base32_base32padupper = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'C', + name: 'base32padupper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', + bitsPerChar: 5 +}) +const unixfs_node_modules_multiformats_src_bases_base32_base32hex = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'v', + name: 'base32hex', + alphabet: '0123456789abcdefghijklmnopqrstuv', + bitsPerChar: 5 +}) +const unixfs_node_modules_multiformats_src_bases_base32_base32hexupper = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'V', + name: 'base32hexupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', + bitsPerChar: 5 +}) -const raw_rawContent = (node) => { - async function* contentGenerator(options = {}) { - const { start, end } = validate_offset_and_length(node.length, options.offset, options.length); - const buf = extract_data_from_block(node, 0n, start, end); - options.onProgress?.(new CustomProgressEvent('unixfs:exporter:progress:raw', { - bytesRead: BigInt(buf.byteLength), - totalBytes: end - start, - fileSize: BigInt(node.byteLength) - })); - yield buf; - } - return contentGenerator; -}; -const raw_resolve = async (cid, name, path, toResolve, resolve, depth, blockstore, options) => { - if (toResolve.length > 0) { - throw err_code(new Error(`No link named ${path} found in raw node ${cid}`), 'ERR_NOT_FOUND'); - } - const block = await blockstore.get(cid, options); - return { - entry: { - type: 'raw', - name, - path, - cid, - content: raw_rawContent(block), - depth, - size: BigInt(block.length), - node: block - } - }; -}; -/* harmony default export */ const resolvers_raw = (raw_resolve); -//# sourceMappingURL=raw.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.js +const unixfs_node_modules_multiformats_src_bases_base32_base32hexpad = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 't', + name: 'base32hexpad', + alphabet: '0123456789abcdefghijklmnopqrstuv=', + bitsPerChar: 5 +}) +const unixfs_node_modules_multiformats_src_bases_base32_base32hexpadupper = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'T', + name: 'base32hexpadupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', + bitsPerChar: 5 +}) +const unixfs_node_modules_multiformats_src_bases_base32_base32z = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'h', + name: 'base32z', + alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', + bitsPerChar: 5 +}) +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base58.js -// FIXME: this is copy/pasted from ipfs-unixfs-importer/src/options.js -const hashFn = async function (buf) { - return (await murmur3128.encode(buf)) - // Murmur3 outputs 128 bit but, accidentally, IPFS Go's - // implementation only uses the first 64, so we must do the same - // for parity.. - .slice(0, 8) - // Invert buffer because that's how Go impl does it - .reverse(); -}; -const addLinksToHamtBucket = async (links, bucket, rootBucket) => { - const padLength = (bucket.tableSize() - 1).toString(16).length; - await Promise.all(links.map(async (link) => { - if (link.Name == null) { - // TODO(@rvagg): what do? this is technically possible - throw new Error('Unexpected Link without a Name'); - } - if (link.Name.length === padLength) { - const pos = parseInt(link.Name, 16); - bucket._putObjectAt(pos, new Bucket({ - hash: rootBucket._options.hash, - bits: rootBucket._options.bits - }, bucket, pos)); - return; - } - await rootBucket.put(link.Name.substring(2), true); - })); -}; -const toPrefix = (position, padLength) => { - return position - .toString(16) - .toUpperCase() - .padStart(padLength, '0') - .substring(0, padLength); -}; -const toBucketPath = (position) => { - let bucket = position.bucket; - const path = []; - while (bucket._parent != null) { - path.push(bucket); - bucket = bucket._parent; +const unixfs_node_modules_multiformats_src_bases_base58_base58btc = unixfs_node_modules_multiformats_src_bases_base_baseX({ + name: 'base58btc', + prefix: 'z', + alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +}) + +const unixfs_node_modules_multiformats_src_bases_base58_base58flickr = unixfs_node_modules_multiformats_src_bases_base_baseX({ + name: 'base58flickr', + prefix: 'Z', + alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' +}) + +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/vendor/varint.js +var unixfs_node_modules_multiformats_vendor_varint_encode_1 = unixfs_node_modules_multiformats_vendor_varint_encode; + +var unixfs_node_modules_multiformats_vendor_varint_MSB = 0x80 + , unixfs_node_modules_multiformats_vendor_varint_REST = 0x7F + , unixfs_node_modules_multiformats_vendor_varint_MSBALL = ~unixfs_node_modules_multiformats_vendor_varint_REST + , unixfs_node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31); + +function unixfs_node_modules_multiformats_vendor_varint_encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; + + while(num >= unixfs_node_modules_multiformats_vendor_varint_INT) { + out[offset++] = (num & 0xFF) | unixfs_node_modules_multiformats_vendor_varint_MSB; + num /= 128; + } + while(num & unixfs_node_modules_multiformats_vendor_varint_MSBALL) { + out[offset++] = (num & 0xFF) | unixfs_node_modules_multiformats_vendor_varint_MSB; + num >>>= 7; + } + out[offset] = num | 0; + + unixfs_node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1; + + return out +} + +var unixfs_node_modules_multiformats_vendor_varint_decode = unixfs_node_modules_multiformats_vendor_varint_read; + +var unixfs_node_modules_multiformats_vendor_varint_MSB$1 = 0x80 + , unixfs_node_modules_multiformats_vendor_varint_REST$1 = 0x7F; + +function unixfs_node_modules_multiformats_vendor_varint_read(buf, offset) { + var res = 0 + , offset = offset || 0 + , shift = 0 + , counter = offset + , b + , l = buf.length; + + do { + if (counter >= l) { + unixfs_node_modules_multiformats_vendor_varint_read.bytes = 0; + throw new RangeError('Could not decode varint') } - path.push(bucket); - return path.reverse(); + b = buf[counter++]; + res += shift < 28 + ? (b & unixfs_node_modules_multiformats_vendor_varint_REST$1) << shift + : (b & unixfs_node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= unixfs_node_modules_multiformats_vendor_varint_MSB$1) + + unixfs_node_modules_multiformats_vendor_varint_read.bytes = counter - offset; + + return res +} + +var unixfs_node_modules_multiformats_vendor_varint_N1 = Math.pow(2, 7); +var unixfs_node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14); +var unixfs_node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21); +var unixfs_node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28); +var unixfs_node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35); +var unixfs_node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42); +var unixfs_node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49); +var unixfs_node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56); +var unixfs_node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63); + +var unixfs_node_modules_multiformats_vendor_varint_length = function (value) { + return ( + value < unixfs_node_modules_multiformats_vendor_varint_N1 ? 1 + : value < unixfs_node_modules_multiformats_vendor_varint_N2 ? 2 + : value < unixfs_node_modules_multiformats_vendor_varint_N3 ? 3 + : value < unixfs_node_modules_multiformats_vendor_varint_N4 ? 4 + : value < unixfs_node_modules_multiformats_vendor_varint_N5 ? 5 + : value < unixfs_node_modules_multiformats_vendor_varint_N6 ? 6 + : value < unixfs_node_modules_multiformats_vendor_varint_N7 ? 7 + : value < unixfs_node_modules_multiformats_vendor_varint_N8 ? 8 + : value < unixfs_node_modules_multiformats_vendor_varint_N9 ? 9 + : 10 + ) }; -const findShardCid = async (node, name, blockstore, context, options) => { - if (context == null) { - if (node.Data == null) { - throw err_code(new Error('no data in PBNode'), 'ERR_NOT_UNIXFS'); - } - let dir; - try { - dir = src_UnixFS.unmarshal(node.Data); - } - catch (err) { - throw err_code(err, 'ERR_NOT_UNIXFS'); - } - if (dir.type !== 'hamt-sharded-directory') { - throw err_code(new Error('not a HAMT'), 'ERR_NOT_UNIXFS'); - } - if (dir.fanout == null) { - throw err_code(new Error('missing fanout'), 'ERR_NOT_UNIXFS'); - } - const rootBucket = createHAMT({ - hashFn, - bits: Math.log2(Number(dir.fanout)) - }); - context = { - rootBucket, - hamtDepth: 1, - lastBucket: rootBucket - }; - } - const padLength = (context.lastBucket.tableSize() - 1).toString(16).length; - await addLinksToHamtBucket(node.Links, context.lastBucket, context.rootBucket); - const position = await context.rootBucket._findNewBucketAndPos(name); - let prefix = toPrefix(position.pos, padLength); - const bucketPath = toBucketPath(position); - if (bucketPath.length > context.hamtDepth) { - context.lastBucket = bucketPath[context.hamtDepth]; - prefix = toPrefix(context.lastBucket._posAtParent, padLength); - } - const link = node.Links.find(link => { - if (link.Name == null) { - return false; - } - const entryPrefix = link.Name.substring(0, padLength); - const entryName = link.Name.substring(padLength); - if (entryPrefix !== prefix) { - // not the entry or subshard we're looking for - return false; - } - if (entryName !== '' && entryName !== name) { - // not the entry we're looking for - return false; - } - return true; - }); - if (link == null) { - return; - } - if (link.Name != null && link.Name.substring(padLength) === name) { - return link.Hash; - } - context.hamtDepth++; - const block = await blockstore.get(link.Hash, options); - node = src_decode(block); - return findShardCid(node, name, blockstore, context, options); + +var unixfs_node_modules_multiformats_vendor_varint_varint = { + encode: unixfs_node_modules_multiformats_vendor_varint_encode_1 + , decode: unixfs_node_modules_multiformats_vendor_varint_decode + , encodingLength: unixfs_node_modules_multiformats_vendor_varint_length }; -/* harmony default export */ const find_cid_in_shard = (findShardCid); -//# sourceMappingURL=find-cid-in-shard.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/it-peekable/dist/src/index.js + +var unixfs_node_modules_multiformats_vendor_varint_brrp_varint = unixfs_node_modules_multiformats_vendor_varint_varint; + +/* harmony default export */ const unixfs_node_modules_multiformats_vendor_varint = (unixfs_node_modules_multiformats_vendor_varint_brrp_varint); + +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/varint.js + + /** - * @packageDocumentation - * - * Lets you look at the contents of an async iterator and decide what to do - * - * @example - * - * ```javascript - * import peekable from 'it-peekable' - * - * // This can also be an iterator, generator, etc - * const values = [0, 1, 2, 3, 4] - * - * const it = peekable(value) - * - * const first = it.peek() - * - * console.info(first) // 0 - * - * it.push(first) - * - * console.info([...it]) - * // [ 0, 1, 2, 3, 4 ] - * ``` - * - * Async sources must be awaited: - * - * ```javascript - * import peekable from 'it-peekable' - * - * const values = async function * () { - * yield * [0, 1, 2, 3, 4] - * } - * - * const it = peekable(values()) - * - * const first = await it.peek() - * - * console.info(first) // 0 - * - * it.push(first) - * - * console.info(await all(it)) - * // [ 0, 1, 2, 3, 4 ] - * ``` + * @param {Uint8Array} data + * @param {number} [offset=0] + * @returns {[number, number]} */ -function src_peekable(iterable) { - // @ts-expect-error can't use Symbol.asyncIterator to index iterable since it might be Iterable - const [iterator, symbol] = iterable[Symbol.asyncIterator] != null - // @ts-expect-error can't use Symbol.asyncIterator to index iterable since it might be Iterable - ? [iterable[Symbol.asyncIterator](), Symbol.asyncIterator] - // @ts-expect-error can't use Symbol.iterator to index iterable since it might be AsyncIterable - : [iterable[Symbol.iterator](), Symbol.iterator]; - const queue = []; - // @ts-expect-error can't use symbol to index peekable - return { - peek: () => { - return iterator.next(); - }, - push: (value) => { - queue.push(value); - }, - next: () => { - if (queue.length > 0) { - return { - done: false, - value: queue.shift() - }; - } - return iterator.next(); - }, - [symbol]() { - return this; - } - }; +const unixfs_node_modules_multiformats_src_varint_decode = (data, offset = 0) => { + const code = unixfs_node_modules_multiformats_vendor_varint.decode(data, offset) + return [code, unixfs_node_modules_multiformats_vendor_varint.decode.bytes] } -/* harmony default export */ const node_modules_it_peekable_dist_src = (src_peekable); -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/it-filter/dist/src/index.js + /** - * @packageDocumentation - * - * Filter values out of an (async)iterable - * - * @example - * - * ```javascript - * import all from 'it-all' - * import filter from 'it-filter' - * - * // This can also be an iterator, generator, etc - * const values = [0, 1, 2, 3, 4] - * - * const fn = val => val > 2 // Return boolean to keep item - * - * const arr = all(filter(values, fn)) - * - * console.info(arr) // 3, 4 - * ``` - * - * Async sources and filter functions must be awaited: - * - * ```javascript - * import all from 'it-all' - * import filter from 'it-filter' - * - * const values = async function * () { - * yield * [0, 1, 2, 3, 4] - * } - * - * const fn = async val => val > 2 // Return boolean or promise of boolean to keep item + * @param {number} int + * @param {Uint8Array} target + * @param {number} [offset=0] + */ +const unixfs_node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => { + unixfs_node_modules_multiformats_vendor_varint.encode(int, target, offset) + return target +} + +/** + * @param {number} int + * @returns {number} + */ +const unixfs_node_modules_multiformats_src_varint_encodingLength = (int) => { + return unixfs_node_modules_multiformats_vendor_varint.encodingLength(int) +} + +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/hashes/digest.js + + + +/** + * Creates a multihash digest. * - * const arr = await all(filter(values, fn)) + * @template {number} Code + * @param {Code} code + * @param {Uint8Array} digest + */ +const unixfs_node_modules_multiformats_src_hashes_digest_create = (code, digest) => { + const size = digest.byteLength + const sizeOffset = unixfs_node_modules_multiformats_src_varint_encodingLength(code) + const digestOffset = sizeOffset + unixfs_node_modules_multiformats_src_varint_encodingLength(size) + + const bytes = new Uint8Array(digestOffset + size) + unixfs_node_modules_multiformats_src_varint_encodeTo(code, bytes, 0) + unixfs_node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset) + bytes.set(digest, digestOffset) + + return new unixfs_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) +} + +/** + * Turns bytes representation of multihash digest into an instance. * - * console.info(arr) // 3, 4 - * ``` + * @param {Uint8Array} multihash + * @returns {MultihashDigest} */ +const unixfs_node_modules_multiformats_src_hashes_digest_decode = (multihash) => { + const bytes = unixfs_node_modules_multiformats_src_bytes_coerce(multihash) + const [code, sizeOffset] = unixfs_node_modules_multiformats_src_varint_decode(bytes) + const [size, digestOffset] = unixfs_node_modules_multiformats_src_varint_decode(bytes.subarray(sizeOffset)) + const digest = bytes.subarray(sizeOffset + digestOffset) -function it_filter_dist_src_isAsyncIterable(thing) { - return thing[Symbol.asyncIterator] != null; + if (digest.byteLength !== size) { + throw new Error('Incorrect length') + } + + return new unixfs_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes) } -function src_filter(source, fn) { - if (it_filter_dist_src_isAsyncIterable(source)) { - return (async function* () { - for await (const entry of source) { - if (await fn(entry)) { - yield entry; - } - } - })(); - } - // if mapping function returns a promise we have to return an async generator - const peekable = node_modules_it_peekable_dist_src(source); - const { value, done } = peekable.next(); - if (done === true) { - return (function* () { }()); - } - const res = fn(value); - // @ts-expect-error .then is not present on O - if (typeof res.then === 'function') { - return (async function* () { - if (await res) { - yield value; - } - for await (const entry of peekable) { - if (await fn(entry)) { - yield entry; - } - } - })(); - } - const func = fn; - return (function* () { - if (res === true) { - yield value; - } - for (const entry of peekable) { - if (func(entry)) { - yield entry; - } - } - })(); + +/** + * @param {MultihashDigest} a + * @param {unknown} b + * @returns {b is MultihashDigest} + */ +const unixfs_node_modules_multiformats_src_hashes_digest_equals = (a, b) => { + if (a === b) { + return true + } else { + const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b) + + return ( + a.code === data.code && + a.size === data.size && + data.bytes instanceof Uint8Array && + unixfs_node_modules_multiformats_src_bytes_equals(a.bytes, data.bytes) + ) + } } -/* harmony default export */ const it_filter_dist_src = (src_filter); -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/it-map/dist/src/index.js + /** - * @packageDocumentation - * - * Convert one value from an (async)iterator into another. - * - * @example - * - * ```javascript - * import map from 'it-map' - * - * // This can also be an iterator, generator, etc - * const values = [0, 1, 2, 3, 4] - * - * const result = map(values, (val) => val++) - * - * console.info(result) // [1, 2, 3, 4, 5] - * ``` - * - * Async sources and transforms must be awaited: - * - * ```javascript - * import map from 'it-map' - * - * const values = async function * () { - * yield * [0, 1, 2, 3, 4] - * } - * - * const result = await map(values(), async (val) => val++) + * @typedef {import('./interface.js').MultihashDigest} MultihashDigest + */ + +/** + * Represents a multihash digest which carries information about the + * hashing algorithm and an actual hash digest. * - * console.info(result) // [1, 2, 3, 4, 5] - * ``` + * @template {number} Code + * @template {number} Size + * @class + * @implements {MultihashDigest} */ +class unixfs_node_modules_multiformats_src_hashes_digest_Digest { + /** + * Creates a multihash digest. + * + * @param {Code} code + * @param {Size} size + * @param {Uint8Array} digest + * @param {Uint8Array} bytes + */ + constructor (code, size, digest, bytes) { + this.code = code + this.size = size + this.digest = digest + this.bytes = bytes + } +} -function node_modules_it_map_dist_src_isAsyncIterable(thing) { - return thing[Symbol.asyncIterator] != null; +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/cid.js + + + + +// Linter can see that API is used in types. +// eslint-disable-next-line + + + +// This way TS will also expose all the types from module + + +/** + * @template {API.Link} T + * @template {string} Prefix + * @param {T} link + * @param {API.MultibaseEncoder} [base] + * @returns {API.ToString} + */ +const unixfs_node_modules_multiformats_src_cid_format = (link, base) => { + const { bytes, version } = link + switch (version) { + case 0: + return unixfs_node_modules_multiformats_src_cid_toStringV0( + bytes, + unixfs_node_modules_multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder<"z">} */ (base) || unixfs_node_modules_multiformats_src_bases_base58_base58btc.encoder + ) + default: + return unixfs_node_modules_multiformats_src_cid_toStringV1( + bytes, + unixfs_node_modules_multiformats_src_cid_baseCache(link), + /** @type {API.MultibaseEncoder} */ (base || unixfs_node_modules_multiformats_src_bases_base32_base32.encoder) + ) + } } -function dist_src_map(source, func) { - if (node_modules_it_map_dist_src_isAsyncIterable(source)) { - return (async function* () { - for await (const val of source) { - yield func(val); - } - })(); + +/** + * @template {API.UnknownLink} Link + * @param {Link} link + * @returns {API.LinkJSON} + */ +const unixfs_node_modules_multiformats_src_cid_toJSON = (link) => ({ + '/': unixfs_node_modules_multiformats_src_cid_format(link) +}) + +/** + * @template {API.UnknownLink} Link + * @param {API.LinkJSON} json + */ +const unixfs_node_modules_multiformats_src_cid_fromJSON = (json) => + unixfs_node_modules_multiformats_src_cid_CID.parse(json['/']) + +/** @type {WeakMap>} */ +const unixfs_node_modules_multiformats_src_cid_cache = new WeakMap() + +/** + * @param {API.UnknownLink} cid + * @returns {Map} + */ +const unixfs_node_modules_multiformats_src_cid_baseCache = cid => { + const baseCache = unixfs_node_modules_multiformats_src_cid_cache.get(cid) + if (baseCache == null) { + const baseCache = new Map() + unixfs_node_modules_multiformats_src_cid_cache.set(cid, baseCache) + return baseCache + } + return baseCache +} + +/** + * @template {unknown} [Data=unknown] + * @template {number} [Format=number] + * @template {number} [Alg=number] + * @template {API.Version} [Version=API.Version] + * @implements {API.Link} + */ + +class unixfs_node_modules_multiformats_src_cid_CID { + /** + * @param {Version} version - Version of the CID + * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content. + * @param {Uint8Array} bytes + */ + constructor (version, code, multihash, bytes) { + /** @readonly */ + this.code = code + /** @readonly */ + this.version = version + /** @readonly */ + this.multihash = multihash + /** @readonly */ + this.bytes = bytes + + // flag to serializers that this is a CID and + // should be treated specially + /** @readonly */ + this['/'] = bytes + } + + /** + * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` + * please either use `CID.asCID(cid)` or switch to new signalling mechanism + * + * @deprecated + */ + get asCID () { + return this + } + + // ArrayBufferView + get byteOffset () { + return this.bytes.byteOffset + } + + // ArrayBufferView + get byteLength () { + return this.bytes.byteLength + } + + /** + * @returns {CID} + */ + toV0 () { + switch (this.version) { + case 0: { + return /** @type {CID} */ (this) + } + case 1: { + const { code, multihash } = this + + if (code !== unixfs_node_modules_multiformats_src_cid_DAG_PB_CODE) { + throw new Error('Cannot convert a non dag-pb CID to CIDv0') + } + + // sha2-256 + if (multihash.code !== unixfs_node_modules_multiformats_src_cid_SHA_256_CODE) { + throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') + } + + return /** @type {CID} */ ( + unixfs_node_modules_multiformats_src_cid_CID.createV0( + /** @type {API.MultihashDigest} */ (multihash) + ) + ) + } + default: { + throw Error( + `Can not convert CID version ${this.version} to version 0. This is a bug please report` + ) + } + } + } + + /** + * @returns {CID} + */ + toV1 () { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash + const multihash = unixfs_node_modules_multiformats_src_hashes_digest_create(code, digest) + return /** @type {CID} */ ( + unixfs_node_modules_multiformats_src_cid_CID.createV1(this.code, multihash) + ) + } + case 1: { + return /** @type {CID} */ (this) + } + default: { + throw Error( + `Can not convert CID version ${this.version} to version 1. This is a bug please report` + ) + } + } + } + + /** + * @param {unknown} other + * @returns {other is CID} + */ + equals (other) { + return unixfs_node_modules_multiformats_src_cid_CID.equals(this, other) + } + + /** + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @param {API.Link} self + * @param {unknown} other + * @returns {other is CID} + */ + static equals (self, other) { + const unknown = + /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ ( + other + ) + return ( + unknown && + self.code === unknown.code && + self.version === unknown.version && + unixfs_node_modules_multiformats_src_hashes_digest_equals(self.multihash, unknown.multihash) + ) + } + + /** + * @param {API.MultibaseEncoder} [base] + * @returns {string} + */ + toString (base) { + return unixfs_node_modules_multiformats_src_cid_format(this, base) + } + + /** + * @returns {API.LinkJSON} + */ + toJSON () { + return { '/': unixfs_node_modules_multiformats_src_cid_format(this) } + } + + link () { + return this + } + + get [Symbol.toStringTag] () { + return 'CID' + } + + // Legacy + + [Symbol.for('nodejs.util.inspect.custom')] () { + return `CID(${this.toString()})` + } + + /** + * Takes any input `value` and returns a `CID` instance if it was + * a `CID` otherwise returns `null`. If `value` is instanceof `CID` + * it will return value back. If `value` is not instance of this CID + * class, but is compatible CID it will return new instance of this + * `CID` class. Otherwise returns null. + * + * This allows two different incompatible versions of CID library to + * co-exist and interop as long as binary interface is compatible. + * + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @template {unknown} U + * @param {API.Link|U} input + * @returns {CID|null} + */ + static asCID (input) { + if (input == null) { + return null + } + + const value = /** @type {any} */ (input) + if (value instanceof unixfs_node_modules_multiformats_src_cid_CID) { + // If value is instance of CID then we're all set. + return value + } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { + // If value isn't instance of this CID class but `this.asCID === this` or + // `value['/'] === value.bytes` is true it is CID instance coming from a + // different implementation (diff version or duplicate). In that case we + // rebase it to this `CID` implementation so caller is guaranteed to get + // instance with expected API. + const { version, code, multihash, bytes } = value + return new unixfs_node_modules_multiformats_src_cid_CID( + version, + code, + /** @type {API.MultihashDigest} */ (multihash), + bytes || unixfs_node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes) + ) + } else if (value[unixfs_node_modules_multiformats_src_cid_cidSymbol] === true) { + // If value is a CID from older implementation that used to be tagged via + // symbol we still rebase it to the this `CID` implementation by + // delegating that to a constructor. + const { version, multihash, code } = value + const digest = + /** @type {API.MultihashDigest} */ + (unixfs_node_modules_multiformats_src_hashes_digest_decode(multihash)) + return unixfs_node_modules_multiformats_src_cid_CID.create(version, code, digest) + } else { + // Otherwise value is not a CID (or an incompatible version of it) in + // which case we return `null`. + return null } - // if mapping function returns a promise we have to return an async generator - const peekable = node_modules_it_peekable_dist_src(source); - const { value, done } = peekable.next(); - if (done === true) { - return (function* () { }()); + } + + /** + * + * @template {unknown} Data + * @template {number} Format + * @template {number} Alg + * @template {API.Version} Version + * @param {Version} version - Version of the CID + * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param {API.MultihashDigest} digest - (Multi)hash of the of the content. + * @returns {CID} + */ + static create (version, code, digest) { + if (typeof code !== 'number') { + throw new Error('String codecs are no longer supported') } - const res = func(value); - // @ts-expect-error .then is not present on O - if (typeof res.then === 'function') { - return (async function* () { - yield await res; - for await (const val of peekable) { - yield func(val); - } - })(); + + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error('Invalid digest') } - const fn = func; - return (function* () { - yield res; - for (const val of peekable) { - yield fn(val); - } - })(); -} -/* harmony default export */ const node_modules_it_map_dist_src = (dist_src_map); -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/it-parallel/node_modules/p-defer/index.js -function p_defer_pDefer() { - const deferred = {}; - deferred.promise = new Promise((resolve, reject) => { - deferred.resolve = resolve; - deferred.reject = reject; - }); + switch (version) { + case 0: { + if (code !== unixfs_node_modules_multiformats_src_cid_DAG_PB_CODE) { + throw new Error( + `Version 0 CID must use dag-pb (code: ${unixfs_node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding` + ) + } else { + return new unixfs_node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes) + } + } + case 1: { + const bytes = unixfs_node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes) + return new unixfs_node_modules_multiformats_src_cid_CID(version, code, digest, bytes) + } + default: { + throw new Error('Invalid version') + } + } + } - return deferred; -} + /** + * Simplified version of `create` for CIDv0. + * + * @template {unknown} [T=unknown] + * @param {API.MultihashDigest} digest - Multihash. + * @returns {CID} + */ + static createV0 (digest) { + return unixfs_node_modules_multiformats_src_cid_CID.create(0, unixfs_node_modules_multiformats_src_cid_DAG_PB_CODE, digest) + } -;// CONCATENATED MODULE: ./node_modules/it-parallel/dist/src/index.js -/** - * @packageDocumentation - * - * Takes an (async) iterable that emits promise-returning functions, invokes them in parallel up to the concurrency limit and emits the results as they become available, optionally in the same order as the input - * - * @example - * - * ```javascript - * import parallel from 'it-parallel' - * import all from 'it-all' - * import delay from 'delay' - * - * // This can also be an iterator, async iterator, generator, etc - * const input = [ - * async () => { - * console.info('start 1') - * await delay(500) - * - * console.info('end 1') - * return 1 - * }, - * async () => { - * console.info('start 2') - * await delay(200) - * - * console.info('end 2') - * return 2 - * }, - * async () => { - * console.info('start 3') - * await delay(100) - * - * console.info('end 3') - * return 3 - * } - * ] - * - * const result = await all(parallel(input, { - * concurrency: 2 - * })) - * - * // output: - * // start 1 - * // start 2 - * // end 2 - * // start 3 - * // end 3 - * // end 1 - * - * console.info(result) // [2, 3, 1] - * ``` - * - * If order is important, pass `ordered: true` as an option: - * - * ```javascript - * const result = await all(parallel(input, { - * concurrency: 2, - * ordered: true - * })) - * - * // output: - * // start 1 - * // start 2 - * // end 2 - * // start 3 - * // end 3 - * // end 1 - * - * console.info(result) // [1, 2, 3] - * ``` - */ + /** + * Simplified version of `create` for CIDv1. + * + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @param {Code} code - Content encoding format code. + * @param {API.MultihashDigest} digest - Miltihash of the content. + * @returns {CID} + */ + static createV1 (code, digest) { + return unixfs_node_modules_multiformats_src_cid_CID.create(1, code, digest) + } -const src_CustomEvent = globalThis.CustomEvent ?? Event; -/** - * Takes an (async) iterator that emits promise-returning functions, - * invokes them in parallel and emits the results as they become available but - * in the same order as the input - */ -async function* parallel(source, options = {}) { - let concurrency = options.concurrency ?? Infinity; - if (concurrency < 1) { - concurrency = Infinity; + /** + * Decoded a CID from its binary representation. The byte array must contain + * only the CID with no additional bytes. + * + * An error will be thrown if the bytes provided do not contain a valid + * binary representation of a CID. + * + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ByteView>} bytes + * @returns {CID} + */ + static decode (bytes) { + const [cid, remainder] = unixfs_node_modules_multiformats_src_cid_CID.decodeFirst(bytes) + if (remainder.length) { + throw new Error('Incorrect length') } - const ordered = options.ordered == null ? false : options.ordered; - const emitter = new EventTarget(); - const ops = []; - let slotAvailable = p_defer_pDefer(); - let resultAvailable = p_defer_pDefer(); - let sourceFinished = false; - let sourceErr; - let opErred = false; - emitter.addEventListener('task-complete', () => { - resultAvailable.resolve(); - }); - void Promise.resolve().then(async () => { - try { - for await (const task of source) { - if (ops.length === concurrency) { - slotAvailable = p_defer_pDefer(); - await slotAvailable.promise; - } - if (opErred) { - break; - } - const op = { - done: false - }; - ops.push(op); - task() - .then(result => { - op.done = true; - op.ok = true; - op.value = result; - emitter.dispatchEvent(new src_CustomEvent('task-complete')); - }, err => { - op.done = true; - op.err = err; - emitter.dispatchEvent(new src_CustomEvent('task-complete')); - }); - } - sourceFinished = true; - emitter.dispatchEvent(new src_CustomEvent('task-complete')); - } - catch (err) { - sourceErr = err; - emitter.dispatchEvent(new src_CustomEvent('task-complete')); - } - }); - function valuesAvailable() { - if (ordered) { - return ops[0]?.done; - } - return Boolean(ops.find(op => op.done)); + return cid + } + + /** + * Decoded a CID from its binary representation at the beginning of a byte + * array. + * + * Returns an array with the first element containing the CID and the second + * element containing the remainder of the original byte array. The remainder + * will be a zero-length byte array if the provided bytes only contained a + * binary CID representation. + * + * @template {unknown} T + * @template {number} C + * @template {number} A + * @template {API.Version} V + * @param {API.ByteView>} bytes + * @returns {[CID, Uint8Array]} + */ + static decodeFirst (bytes) { + const specs = unixfs_node_modules_multiformats_src_cid_CID.inspectBytes(bytes) + const prefixSize = specs.size - specs.multihashSize + const multihashBytes = unixfs_node_modules_multiformats_src_bytes_coerce( + bytes.subarray(prefixSize, prefixSize + specs.multihashSize) + ) + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error('Incorrect length') } - function* yieldOrderedValues() { - while ((ops.length > 0) && ops[0].done) { - const op = ops[0]; - ops.shift(); - if (op.ok) { - yield op.value; - } - else { - // allow the source to exit - opErred = true; - slotAvailable.resolve(); - throw op.err; - } - slotAvailable.resolve(); - } + const digestBytes = multihashBytes.subarray( + specs.multihashSize - specs.digestSize + ) + const digest = new unixfs_node_modules_multiformats_src_hashes_digest_Digest( + specs.multihashCode, + specs.digestSize, + digestBytes, + multihashBytes + ) + const cid = + specs.version === 0 + ? unixfs_node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest)) + : unixfs_node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest) + return [/** @type {CID} */(cid), bytes.subarray(specs.size)] + } + + /** + * Inspect the initial bytes of a CID to determine its properties. + * + * Involves decoding up to 4 varints. Typically this will require only 4 to 6 + * bytes but for larger multicodec code values and larger multihash digest + * lengths these varints can be quite large. It is recommended that at least + * 10 bytes be made available in the `initialBytes` argument for a complete + * inspection. + * + * @template {unknown} T + * @template {number} C + * @template {number} A + * @template {API.Version} V + * @param {API.ByteView>} initialBytes + * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }} + */ + static inspectBytes (initialBytes) { + let offset = 0 + const next = () => { + const [i, length] = unixfs_node_modules_multiformats_src_varint_decode(initialBytes.subarray(offset)) + offset += length + return i } - function* yieldUnOrderedValues() { - // more values can become available while we wait for `yield` - // to return control to this function - while (valuesAvailable()) { - for (let i = 0; i < ops.length; i++) { - if (ops[i].done) { - const op = ops[i]; - ops.splice(i, 1); - i--; - if (op.ok) { - yield op.value; - } - else { - opErred = true; - slotAvailable.resolve(); - throw op.err; - } - slotAvailable.resolve(); - } - } - } + + let version = /** @type {V} */ (next()) + let codec = /** @type {C} */ (unixfs_node_modules_multiformats_src_cid_DAG_PB_CODE) + if (/** @type {number} */(version) === 18) { + // CIDv0 + version = /** @type {V} */ (0) + offset = 0 + } else { + codec = /** @type {C} */ (next()) } - while (true) { - if (!valuesAvailable()) { - resultAvailable = p_defer_pDefer(); - await resultAvailable.promise; - } - if (sourceErr != null) { - // the source threw an error, propagate it - throw sourceErr; - } - if (ordered) { - yield* yieldOrderedValues(); - } - else { - yield* yieldUnOrderedValues(); - } - if (sourceFinished && ops.length === 0) { - // not waiting for any results and no more tasks so we are done - break; - } + + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`) } -} -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/it-pushable/node_modules/p-defer/index.js -function node_modules_p_defer_pDefer() { - const deferred = {}; - deferred.promise = new Promise((resolve, reject) => { - deferred.resolve = resolve; - deferred.reject = reject; - }); + const prefixSize = offset + const multihashCode = /** @type {A} */ (next()) // multihash code + const digestSize = next() // multihash length + const size = offset + digestSize + const multihashSize = size - prefixSize - return deferred; -} + return { version, codec, multihashCode, digestSize, multihashSize, size } + } -;// CONCATENATED MODULE: ./node_modules/it-pushable/dist/src/fifo.js -// ported from https://www.npmjs.com/package/fast-fifo -class FixedFIFO { - buffer; - mask; - top; - btm; - next; - constructor(hwm) { - if (!(hwm > 0) || ((hwm - 1) & hwm) !== 0) { - throw new Error('Max size for a FixedFIFO should be a power of two'); - } - this.buffer = new Array(hwm); - this.mask = hwm - 1; - this.top = 0; - this.btm = 0; - this.next = null; - } - push(data) { - if (this.buffer[this.top] !== undefined) { - return false; - } - this.buffer[this.top] = data; - this.top = (this.top + 1) & this.mask; - return true; - } - shift() { - const last = this.buffer[this.btm]; - if (last === undefined) { - return undefined; - } - this.buffer[this.btm] = undefined; - this.btm = (this.btm + 1) & this.mask; - return last; - } - isEmpty() { - return this.buffer[this.btm] === undefined; + /** + * Takes cid in a string representation and creates an instance. If `base` + * decoder is not provided will use a default from the configuration. It will + * throw an error if encoding of the CID is not compatible with supplied (or + * a default decoder). + * + * @template {string} Prefix + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ToString, Prefix>} source + * @param {API.MultibaseDecoder} [base] + * @returns {CID} + */ + static parse (source, base) { + const [prefix, bytes] = unixfs_node_modules_multiformats_src_cid_parseCIDtoBytes(source, base) + + const cid = unixfs_node_modules_multiformats_src_cid_CID.decode(bytes) + + if (cid.version === 0 && source[0] !== 'Q') { + throw Error('Version 0 CID string must not include multibase prefix') } + + // Cache string representation to avoid computing it on `this.toString()` + unixfs_node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source) + + return cid + } } -class FIFO { - size; - hwm; - head; - tail; - constructor(options = {}) { - this.hwm = options.splitLimit ?? 16; - this.head = new FixedFIFO(this.hwm); - this.tail = this.head; - this.size = 0; - } - calculateSize(obj) { - if (obj?.byteLength != null) { - return obj.byteLength; - } - return 1; + +/** + * @template {string} Prefix + * @template {unknown} Data + * @template {number} Code + * @template {number} Alg + * @template {API.Version} Ver + * @param {API.ToString, Prefix>} source + * @param {API.MultibaseDecoder} [base] + * @returns {[Prefix, API.ByteView>]} + */ +const unixfs_node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => { + switch (source[0]) { + // CIDv0 is parsed differently + case 'Q': { + const decoder = base || unixfs_node_modules_multiformats_src_bases_base58_base58btc + return [ + /** @type {Prefix} */ (unixfs_node_modules_multiformats_src_bases_base58_base58btc.prefix), + decoder.decode(`${unixfs_node_modules_multiformats_src_bases_base58_base58btc.prefix}${source}`) + ] } - push(val) { - if (val?.value != null) { - this.size += this.calculateSize(val.value); - } - if (!this.head.push(val)) { - const prev = this.head; - this.head = prev.next = new FixedFIFO(2 * this.head.buffer.length); - this.head.push(val); - } + case unixfs_node_modules_multiformats_src_bases_base58_base58btc.prefix: { + const decoder = base || unixfs_node_modules_multiformats_src_bases_base58_base58btc + return [/** @type {Prefix} */(unixfs_node_modules_multiformats_src_bases_base58_base58btc.prefix), decoder.decode(source)] } - shift() { - let val = this.tail.shift(); - if (val === undefined && (this.tail.next != null)) { - const next = this.tail.next; - this.tail.next = null; - this.tail = next; - val = this.tail.shift(); - } - if (val?.value != null) { - this.size -= this.calculateSize(val.value); - } - return val; + case unixfs_node_modules_multiformats_src_bases_base32_base32.prefix: { + const decoder = base || unixfs_node_modules_multiformats_src_bases_base32_base32 + return [/** @type {Prefix} */(unixfs_node_modules_multiformats_src_bases_base32_base32.prefix), decoder.decode(source)] } - isEmpty() { - return this.head.isEmpty(); + default: { + if (base == null) { + throw Error( + 'To parse non base32 or base58btc encoded CID multibase decoder must be provided' + ) + } + return [/** @type {Prefix} */(source[0]), base.decode(source)] } + } } -//# sourceMappingURL=fifo.js.map -;// CONCATENATED MODULE: ./node_modules/it-pushable/dist/src/index.js + /** - * @packageDocumentation - * - * An iterable that you can push values into. - * - * @example - * - * ```js - * import { pushable } from 'it-pushable' - * - * const source = pushable() - * - * setTimeout(() => source.push('hello'), 100) - * setTimeout(() => source.push('world'), 200) - * setTimeout(() => source.end(), 300) - * - * const start = Date.now() - * - * for await (const value of source) { - * console.log(`got "${value}" after ${Date.now() - start}ms`) - * } - * console.log(`done after ${Date.now() - start}ms`) - * - * // Output: - * // got "hello" after 105ms - * // got "world" after 207ms - * // done after 309ms - * ``` - * - * @example - * - * ```js - * import { pushableV } from 'it-pushable' - * import all from 'it-all' - * - * const source = pushableV() - * - * source.push(1) - * source.push(2) - * source.push(3) - * source.end() * - * console.info(await all(source)) - * - * // Output: - * // [ [1, 2, 3] ] - * ``` + * @param {Uint8Array} bytes + * @param {Map} cache + * @param {API.MultibaseEncoder<'z'>} base */ +const unixfs_node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => { + const { prefix } = base + if (prefix !== unixfs_node_modules_multiformats_src_bases_base58_base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base.name} encoding`) + } - -class src_AbortError extends Error { - type; - code; - constructor(message, code) { - super(message ?? 'The operation was aborted'); - this.type = 'aborted'; - this.code = code ?? 'ABORT_ERR'; - } -} -function src_pushable(options = {}) { - const getNext = (buffer) => { - const next = buffer.shift(); - if (next == null) { - return { done: true }; - } - if (next.error != null) { - throw next.error; - } - return { - done: next.done === true, - // @ts-expect-error if done is false, value will be present - value: next.value - }; - }; - return _pushable(getNext, options); -} -function pushableV(options = {}) { - const getNext = (buffer) => { - let next; - const values = []; - while (!buffer.isEmpty()) { - next = buffer.shift(); - if (next == null) { - break; - } - if (next.error != null) { - throw next.error; - } - if (next.done === false) { - // @ts-expect-error if done is false value should be pushed - values.push(next.value); - } - } - if (next == null) { - return { done: true }; - } - return { - done: next.done === true, - value: values - }; - }; - return _pushable(getNext, options); -} -function _pushable(getNext, options) { - options = options ?? {}; - let onEnd = options.onEnd; - let buffer = new FIFO(); - let pushable; - let onNext; - let ended; - let drain = node_modules_p_defer_pDefer(); - const waitNext = async () => { - try { - if (!buffer.isEmpty()) { - return getNext(buffer); - } - if (ended) { - return { done: true }; - } - return await new Promise((resolve, reject) => { - onNext = (next) => { - onNext = null; - buffer.push(next); - try { - resolve(getNext(buffer)); - } - catch (err) { - reject(err); - } - return pushable; - }; - }); - } - finally { - if (buffer.isEmpty()) { - // settle promise in the microtask queue to give consumers a chance to - // await after calling .push - queueMicrotask(() => { - drain.resolve(); - drain = node_modules_p_defer_pDefer(); - }); - } - } - }; - const bufferNext = (next) => { - if (onNext != null) { - return onNext(next); - } - buffer.push(next); - return pushable; - }; - const bufferError = (err) => { - buffer = new FIFO(); - if (onNext != null) { - return onNext({ error: err }); - } - buffer.push({ error: err }); - return pushable; - }; - const push = (value) => { - if (ended) { - return pushable; - } - // @ts-expect-error `byteLength` is not declared on PushType - if (options?.objectMode !== true && value?.byteLength == null) { - throw new Error('objectMode was not true but tried to push non-Uint8Array value'); - } - return bufferNext({ done: false, value }); - }; - const end = (err) => { - if (ended) - return pushable; - ended = true; - return (err != null) ? bufferError(err) : bufferNext({ done: true }); - }; - const _return = () => { - buffer = new FIFO(); - end(); - return { done: true }; - }; - const _throw = (err) => { - end(err); - return { done: true }; - }; - pushable = { - [Symbol.asyncIterator]() { return this; }, - next: waitNext, - return: _return, - throw: _throw, - push, - end, - get readableLength() { - return buffer.size; - }, - onEmpty: async (options) => { - const signal = options?.signal; - signal?.throwIfAborted(); - if (buffer.isEmpty()) { - return; - } - let cancel; - let listener; - if (signal != null) { - cancel = new Promise((resolve, reject) => { - listener = () => { - reject(new src_AbortError()); - }; - signal.addEventListener('abort', listener); - }); - } - try { - await Promise.race([ - drain.promise, - cancel - ]); - } - finally { - if (listener != null && signal != null) { - signal?.removeEventListener('abort', listener); - } - } - } - }; - if (onEnd == null) { - return pushable; - } - const _pushable = pushable; - pushable = { - [Symbol.asyncIterator]() { return this; }, - next() { - return _pushable.next(); - }, - throw(err) { - _pushable.throw(err); - if (onEnd != null) { - onEnd(err); - onEnd = undefined; - } - return { done: true }; - }, - return() { - _pushable.return(); - if (onEnd != null) { - onEnd(); - onEnd = undefined; - } - return { done: true }; - }, - push, - end(err) { - _pushable.end(err); - if (onEnd != null) { - onEnd(err); - onEnd = undefined; - } - return pushable; - }, - get readableLength() { - return _pushable.readableLength; - }, - onEmpty: (opts) => { - return _pushable.onEmpty(opts); - } - }; - return pushable; + const cid = cache.get(prefix) + if (cid == null) { + const cid = base.encode(bytes).slice(1) + cache.set(prefix, cid) + return cid + } else { + return cid + } } -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/it-merge/dist/src/index.js + /** - * @packageDocumentation - * - * Merge several (async)iterables into one, yield values as they arrive. - * - * Nb. sources are iterated over in parallel so the order of emitted items is not guaranteed. - * - * @example - * - * ```javascript - * import merge from 'it-merge' - * import all from 'it-all' - * - * // This can also be an iterator, generator, etc - * const values1 = [0, 1, 2, 3, 4] - * const values2 = [5, 6, 7, 8, 9] - * - * const arr = all(merge(values1, values2)) - * - * console.info(arr) // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 - * ``` - * - * Async sources must be awaited: - * - * ```javascript - * import merge from 'it-merge' - * import all from 'it-all' - * - * // This can also be an iterator, async iterator, generator, etc - * const values1 = async function * () { - * yield * [0, 1, 2, 3, 4] - * } - * const values2 = async function * () { - * yield * [5, 6, 7, 8, 9] - * } - * - * const arr = await all(merge(values1(), values2())) - * - * console.info(arr) // 0, 1, 5, 6, 2, 3, 4, 7, 8, 9 <- nb. order is not guaranteed - * ``` + * @template {string} Prefix + * @param {Uint8Array} bytes + * @param {Map} cache + * @param {API.MultibaseEncoder} base */ - -function it_merge_dist_src_isAsyncIterable(thing) { - return thing[Symbol.asyncIterator] != null; -} -function src_merge(...sources) { - const syncSources = []; - for (const source of sources) { - if (!it_merge_dist_src_isAsyncIterable(source)) { - syncSources.push(source); - } - } - if (syncSources.length === sources.length) { - // all sources are synchronous - return (function* () { - for (const source of syncSources) { - yield* source; - } - })(); - } - return (async function* () { - const output = src_pushable({ - objectMode: true - }); - void Promise.resolve().then(async () => { - try { - await Promise.all(sources.map(async (source) => { - for await (const item of source) { - output.push(item); - } - })); - output.end(); - } - catch (err) { - output.end(err); - } - }); - yield* output; - })(); +const unixfs_node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => { + const { prefix } = base + const cid = cache.get(prefix) + if (cid == null) { + const cid = base.encode(bytes) + cache.set(prefix, cid) + return cid + } else { + return cid + } } -/* harmony default export */ const it_merge_dist_src = (src_merge); -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/it-pipe/dist/src/index.js +const unixfs_node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70 +const unixfs_node_modules_multiformats_src_cid_SHA_256_CODE = 0x12 -function pipe(first, ...rest) { - if (first == null) { - throw new Error('Empty pipeline'); - } - // Duplex at start: wrap in function and return duplex source - if (isDuplex(first)) { - const duplex = first; - first = () => duplex.source; - // Iterable at start: wrap in function - } - else if (src_isIterable(first) || it_pipe_dist_src_isAsyncIterable(first)) { - const source = first; - first = () => source; - } - const fns = [first, ...rest]; - if (fns.length > 1) { - // Duplex at end: use duplex sink - if (isDuplex(fns[fns.length - 1])) { - fns[fns.length - 1] = fns[fns.length - 1].sink; - } - } - if (fns.length > 2) { - // Duplex in the middle, consume source with duplex sink and return duplex source - for (let i = 1; i < fns.length - 1; i++) { - if (isDuplex(fns[i])) { - fns[i] = duplexPipelineFn(fns[i]); - } - } - } - return rawPipe(...fns); -} -const rawPipe = (...fns) => { - let res; - while (fns.length > 0) { - res = fns.shift()(res); - } - return res; -}; -const it_pipe_dist_src_isAsyncIterable = (obj) => { - return obj?.[Symbol.asyncIterator] != null; -}; -const src_isIterable = (obj) => { - return obj?.[Symbol.iterator] != null; -}; -const isDuplex = (obj) => { - if (obj == null) { - return false; - } - return obj.sink != null && obj.source != null; -}; -const duplexPipelineFn = (duplex) => { - return (source) => { - const p = duplex.sink(source); - if (p?.then != null) { - const stream = src_pushable({ - objectMode: true - }); - p.then(() => { - stream.end(); - }, (err) => { - stream.end(err); - }); - let sourceWrap; - const source = duplex.source; - if (it_pipe_dist_src_isAsyncIterable(source)) { - sourceWrap = async function* () { - yield* source; - stream.end(); - }; - } - else if (src_isIterable(source)) { - sourceWrap = function* () { - yield* source; - stream.end(); - }; - } - else { - throw new Error('Unknown duplex source type - must be Iterable or AsyncIterable'); - } - return it_merge_dist_src(stream, sourceWrap()); - } - return duplex.source; - }; -}; -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.js +/** + * @param {API.Version} version + * @param {number} code + * @param {Uint8Array} multihash + * @returns {Uint8Array} + */ +const unixfs_node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => { + const codeOffset = unixfs_node_modules_multiformats_src_varint_encodingLength(version) + const hashOffset = codeOffset + unixfs_node_modules_multiformats_src_varint_encodingLength(code) + const bytes = new Uint8Array(hashOffset + multihash.byteLength) + unixfs_node_modules_multiformats_src_varint_encodeTo(version, bytes, 0) + unixfs_node_modules_multiformats_src_varint_encodeTo(code, bytes, codeOffset) + bytes.set(multihash, hashOffset) + return bytes +} +const unixfs_node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID') +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/hashes/hasher.js +/** + * @template {string} Name + * @template {number} Code + * @param {object} options + * @param {Name} options.name + * @param {Code} options.code + * @param {(input: Uint8Array) => Await} options.encode + */ +const unixfs_node_modules_multiformats_src_hashes_hasher_from = ({ name, code, encode }) => new unixfs_node_modules_multiformats_src_hashes_hasher_Hasher(name, code, encode) -const directoryContent = (cid, node, unixfs, path, resolve, depth, blockstore) => { - async function* yieldDirectoryContent(options = {}) { - const offset = options.offset ?? 0; - const length = options.length ?? node.Links.length; - const links = node.Links.slice(offset, length); - options.onProgress?.(new CustomProgressEvent('unixfs:exporter:walk:directory', { - cid - })); - yield* pipe(links, source => node_modules_it_map_dist_src(source, link => { - return async () => { - const linkName = link.Name ?? ''; - const linkPath = `${path}/${linkName}`; - const result = await resolve(link.Hash, linkName, linkPath, [], depth + 1, blockstore, options); - return result.entry; - }; - }), source => parallel(source, { ordered: true }), source => it_filter_dist_src(source, entry => entry != null)); +/** + * Hasher represents a hashing algorithm implementation that produces as + * `MultihashDigest`. + * + * @template {string} Name + * @template {number} Code + * @class + * @implements {MultihashHasher} + */ +class unixfs_node_modules_multiformats_src_hashes_hasher_Hasher { + /** + * + * @param {Name} name + * @param {Code} code + * @param {(input: Uint8Array) => Await} encode + */ + constructor (name, code, encode) { + this.name = name + this.code = code + this.encode = encode + } + + /** + * @param {Uint8Array} input + * @returns {Await>} + */ + digest (input) { + if (input instanceof Uint8Array) { + const result = this.encode(input) + return result instanceof Uint8Array + ? unixfs_node_modules_multiformats_src_hashes_digest_create(this.code, result) + /* c8 ignore next 1 */ + : result.then(digest => unixfs_node_modules_multiformats_src_hashes_digest_create(this.code, digest)) + } else { + throw Error('Unknown type, must be binary type') + /* c8 ignore next 1 */ } - return yieldDirectoryContent; -}; -/* harmony default export */ const directory = (directoryContent); -//# sourceMappingURL=directory.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/p-timeout/index.js -class p_timeout_TimeoutError extends Error { - constructor(message) { - super(message); - this.name = 'TimeoutError'; - } + } } /** -An error to be thrown when the request is aborted by AbortController. -DOMException is thrown instead of this Error when DOMException is available. -*/ -class node_modules_p_timeout_AbortError extends Error { - constructor(message) { - super(); - this.name = 'AbortError'; - this.message = message; - } -} + * @template {number} Alg + * @typedef {import('./interface.js').MultihashHasher} MultihashHasher + */ /** -TODO: Remove AbortError and just throw DOMException when targeting Node 18. -*/ -const p_timeout_getDOMException = errorMessage => globalThis.DOMException === undefined - ? new node_modules_p_timeout_AbortError(errorMessage) - : new DOMException(errorMessage); + * @template T + * @typedef {Promise|T} Await + */ -/** -TODO: Remove below function and just 'reject(signal.reason)' when targeting Node 18. -*/ -const p_timeout_getAbortedReason = signal => { - const reason = signal.reason === undefined - ? p_timeout_getDOMException('This operation was aborted.') - : signal.reason; +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/index.js - return reason instanceof Error ? reason : p_timeout_getDOMException(reason); -}; -function p_timeout_pTimeout(promise, options) { - const { - milliseconds, - fallback, - message, - customTimers = {setTimeout, clearTimeout}, - } = options; - let timer; - const wrappedPromise = new Promise((resolve, reject) => { - if (typeof milliseconds !== 'number' || Math.sign(milliseconds) !== 1) { - throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${milliseconds}\``); - } - if (options.signal) { - const {signal} = options; - if (signal.aborted) { - reject(p_timeout_getAbortedReason(signal)); - } - signal.addEventListener('abort', () => { - reject(p_timeout_getAbortedReason(signal)); - }); - } +// This way TS will also expose all the types from module - if (milliseconds === Number.POSITIVE_INFINITY) { - promise.then(resolve, reject); - return; - } - // We create the error outside of `setTimeout` to preserve the stack trace. - const timeoutError = new p_timeout_TimeoutError(); - timer = customTimers.setTimeout.call(undefined, () => { - if (fallback) { - try { - resolve(fallback()); - } catch (error) { - reject(error); - } - return; - } +// EXTERNAL MODULE: ./node_modules/murmurhash3js-revisited/index.js +var murmurhash3js_revisited = __nccwpck_require__(76456); +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/@multiformats/murmur3/src/index.js - if (typeof promise.cancel === 'function') { - promise.cancel(); - } - if (message === false) { - resolve(); - } else if (message instanceof Error) { - reject(message); - } else { - timeoutError.message = message ?? `Promise timed out after ${milliseconds} milliseconds`; - reject(timeoutError); - } - }, milliseconds); +// @ts-expect-error no types - (async () => { - try { - resolve(await promise); - } catch (error) { - reject(error); - } - })(); - }); - const cancelablePromise = wrappedPromise.finally(() => { - cancelablePromise.clear(); - }); +/** + * @param {number} number + * @returns {Uint8Array} + */ +function fromNumberTo32BitBuf (number) { + const bytes = new Array(4) + for (let i = 0; i < 4; i++) { + bytes[i] = number & 0xff + number = number >> 8 + } + return new Uint8Array(bytes) +} - cancelablePromise.clear = () => { - customTimers.clearTimeout.call(undefined, timer); - timer = undefined; - }; +const murmur332 = unixfs_node_modules_multiformats_src_hashes_hasher_from({ + name: 'murmur3-32', + code: 0x23, + encode: (input) => fromNumberTo32BitBuf(murmurhash3js_revisited.x86.hash32(input)) +}) - return cancelablePromise; -} +const murmur3128 = unixfs_node_modules_multiformats_src_hashes_hasher_from({ + name: 'murmur3-128', + code: 0x22, + encode: (input) => unixfs_node_modules_multiformats_src_bytes_fromHex(murmurhash3js_revisited.x64.hash128(input)) +}) -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/p-queue/dist/lower-bound.js -// Port of lower_bound from https://en.cppreference.com/w/cpp/algorithm/lower_bound -// Used to compute insertion index to keep queue sorted after insertion -function lower_bound_lowerBound(array, value, comparator) { - let first = 0; - let count = array.length; - while (count > 0) { - const step = Math.trunc(count / 2); - let it = first + step; - if (comparator(array[it], value) <= 0) { - first = ++it; - count -= step + 1; - } - else { - count = step; - } +// A special-use 0x22 that truncates 64 bits, specifically for use in the UnixFS HAMT +const murmur364 = unixfs_node_modules_multiformats_src_hashes_hasher_from({ + name: 'murmur3-x64-64', + code: 0x22, + encode: (input) => unixfs_node_modules_multiformats_src_bytes_fromHex(murmurhash3js_revisited.x64.hash128(input)).subarray(0, 8) +}) + +// EXTERNAL MODULE: ./node_modules/sparse-array/index.js +var sparse_array = __nccwpck_require__(20028); +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/uint8arrays/dist/src/util/as-uint8array.js +/** + * To guarantee Uint8Array semantics, convert nodejs Buffers + * into vanilla Uint8Arrays + */ +function unixfs_node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(buf) { + if (globalThis.Buffer != null) { + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); } - return first; + return buf; } +//# sourceMappingURL=as-uint8array.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base10.js -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/p-queue/dist/priority-queue.js -class priority_queue_PriorityQueue { - #queue = []; - enqueue(run, options) { - options = { - priority: 0, - ...options, - }; - const element = { - priority: options.priority, - run, - }; - if (this.size && this.#queue[this.size - 1].priority >= options.priority) { - this.#queue.push(element); - return; - } - const index = lower_bound_lowerBound(this.#queue, element, (a, b) => b.priority - a.priority); - this.#queue.splice(index, 0, element); - } - dequeue() { - const item = this.#queue.shift(); - return item?.run; - } - filter(options) { - return this.#queue.filter((element) => element.priority === options.priority).map((element) => element.run); - } - get size() { - return this.#queue.length; - } -} +const unixfs_node_modules_multiformats_src_bases_base10_base10 = unixfs_node_modules_multiformats_src_bases_base_baseX({ + prefix: '9', + name: 'base10', + alphabet: '0123456789' +}) -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/p-queue/dist/index.js +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base16.js +// @ts-check -/** -Promise queue with concurrency control. -*/ -class dist_PQueue extends eventemitter3 { - #carryoverConcurrencyCount; - #isIntervalIgnored; - #intervalCount = 0; - #intervalCap; - #interval; - #intervalEnd = 0; - #intervalId; - #timeoutId; - #queue; - #queueClass; - #pending = 0; - // The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194 - #concurrency; - #isPaused; - #throwOnTimeout; - /** - Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already. +const unixfs_node_modules_multiformats_src_bases_base16_base16 = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'f', + name: 'base16', + alphabet: '0123456789abcdef', + bitsPerChar: 4 +}) - Applies to each future operation. - */ - timeout; - // TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()` - constructor(options) { - super(); - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - options = { - carryoverConcurrencyCount: false, - intervalCap: Number.POSITIVE_INFINITY, - interval: 0, - concurrency: Number.POSITIVE_INFINITY, - autoStart: true, - queueClass: priority_queue_PriorityQueue, - ...options, - }; - if (!(typeof options.intervalCap === 'number' && options.intervalCap >= 1)) { - throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${options.intervalCap?.toString() ?? ''}\` (${typeof options.intervalCap})`); - } - if (options.interval === undefined || !(Number.isFinite(options.interval) && options.interval >= 0)) { - throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${options.interval?.toString() ?? ''}\` (${typeof options.interval})`); - } - this.#carryoverConcurrencyCount = options.carryoverConcurrencyCount; - this.#isIntervalIgnored = options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0; - this.#intervalCap = options.intervalCap; - this.#interval = options.interval; - this.#queue = new options.queueClass(); - this.#queueClass = options.queueClass; - this.concurrency = options.concurrency; - this.timeout = options.timeout; - this.#throwOnTimeout = options.throwOnTimeout === true; - this.#isPaused = options.autoStart === false; - } - get #doesIntervalAllowAnother() { - return this.#isIntervalIgnored || this.#intervalCount < this.#intervalCap; - } - get #doesConcurrentAllowAnother() { - return this.#pending < this.#concurrency; - } - #next() { - this.#pending--; - this.#tryToStartAnother(); - this.emit('next'); - } - #onResumeInterval() { - this.#onInterval(); - this.#initializeIntervalIfNeeded(); - this.#timeoutId = undefined; - } - get #isIntervalPaused() { - const now = Date.now(); - if (this.#intervalId === undefined) { - const delay = this.#intervalEnd - now; - if (delay < 0) { - // Act as the interval was done - // We don't need to resume it here because it will be resumed on line 160 - this.#intervalCount = (this.#carryoverConcurrencyCount) ? this.#pending : 0; - } - else { - // Act as the interval is pending - if (this.#timeoutId === undefined) { - this.#timeoutId = setTimeout(() => { - this.#onResumeInterval(); - }, delay); - } - return true; - } - } - return false; - } - #tryToStartAnother() { - if (this.#queue.size === 0) { - // We can clear the interval ("pause") - // Because we can redo it later ("resume") - if (this.#intervalId) { - clearInterval(this.#intervalId); - } - this.#intervalId = undefined; - this.emit('empty'); - if (this.#pending === 0) { - this.emit('idle'); - } - return false; - } - if (!this.#isPaused) { - const canInitializeInterval = !this.#isIntervalPaused; - if (this.#doesIntervalAllowAnother && this.#doesConcurrentAllowAnother) { - const job = this.#queue.dequeue(); - if (!job) { - return false; - } - this.emit('active'); - job(); - if (canInitializeInterval) { - this.#initializeIntervalIfNeeded(); - } - return true; - } - } - return false; - } - #initializeIntervalIfNeeded() { - if (this.#isIntervalIgnored || this.#intervalId !== undefined) { - return; - } - this.#intervalId = setInterval(() => { - this.#onInterval(); - }, this.#interval); - this.#intervalEnd = Date.now() + this.#interval; - } - #onInterval() { - if (this.#intervalCount === 0 && this.#pending === 0 && this.#intervalId) { - clearInterval(this.#intervalId); - this.#intervalId = undefined; - } - this.#intervalCount = this.#carryoverConcurrencyCount ? this.#pending : 0; - this.#processQueue(); - } - /** - Executes all queued functions until it reaches the limit. - */ - #processQueue() { - // eslint-disable-next-line no-empty - while (this.#tryToStartAnother()) { } - } - get concurrency() { - return this.#concurrency; - } - set concurrency(newConcurrency) { - if (!(typeof newConcurrency === 'number' && newConcurrency >= 1)) { - throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${newConcurrency}\` (${typeof newConcurrency})`); - } - this.#concurrency = newConcurrency; - this.#processQueue(); - } - async #throwOnAbort(signal) { - return new Promise((_resolve, reject) => { - signal.addEventListener('abort', () => { - reject(signal.reason); - }, { once: true }); - }); - } - async add(function_, options = {}) { - options = { - timeout: this.timeout, - throwOnTimeout: this.#throwOnTimeout, - ...options, - }; - return new Promise((resolve, reject) => { - this.#queue.enqueue(async () => { - this.#pending++; - this.#intervalCount++; - try { - options.signal?.throwIfAborted(); - let operation = function_({ signal: options.signal }); - if (options.timeout) { - operation = p_timeout_pTimeout(Promise.resolve(operation), { milliseconds: options.timeout }); - } - if (options.signal) { - operation = Promise.race([operation, this.#throwOnAbort(options.signal)]); - } - const result = await operation; - resolve(result); - this.emit('completed', result); - } - catch (error) { - if (error instanceof p_timeout_TimeoutError && !options.throwOnTimeout) { - resolve(); - return; - } - reject(error); - this.emit('error', error); - } - finally { - this.#next(); - } - }, options); - this.emit('add'); - this.#tryToStartAnother(); - }); - } - async addAll(functions, options) { - return Promise.all(functions.map(async (function_) => this.add(function_, options))); - } - /** - Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.) - */ - start() { - if (!this.#isPaused) { - return this; - } - this.#isPaused = false; - this.#processQueue(); - return this; - } - /** - Put queue execution on hold. - */ - pause() { - this.#isPaused = true; - } - /** - Clear the queue. - */ - clear() { - this.#queue = new this.#queueClass(); - } - /** - Can be called multiple times. Useful if you for example add additional items at a later time. +const unixfs_node_modules_multiformats_src_bases_base16_base16upper = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'F', + name: 'base16upper', + alphabet: '0123456789ABCDEF', + bitsPerChar: 4 +}) - @returns A promise that settles when the queue becomes empty. - */ - async onEmpty() { - // Instantly resolve if the queue is empty - if (this.#queue.size === 0) { - return; - } - await this.#onEvent('empty'); - } - /** - @returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`. +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base2.js +// @ts-check - If you want to avoid having the queue grow beyond a certain size you can `await queue.onSizeLessThan()` before adding a new item. - Note that this only limits the number of items waiting to start. There could still be up to `concurrency` jobs already running that this call does not include in its calculation. - */ - async onSizeLessThan(limit) { - // Instantly resolve if the queue is empty. - if (this.#queue.size < limit) { - return; - } - await this.#onEvent('next', () => this.#queue.size < limit); - } - /** - The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet. - @returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`. - */ - async onIdle() { - // Instantly resolve if none pending and if nothing else is queued - if (this.#pending === 0 && this.#queue.size === 0) { - return; - } - await this.#onEvent('idle'); - } - async #onEvent(event, filter) { - return new Promise(resolve => { - const listener = () => { - if (filter && !filter()) { - return; - } - this.off(event, listener); - resolve(); - }; - this.on(event, listener); - }); - } - /** - Size of the queue, the number of queued items waiting to run. - */ - get size() { - return this.#queue.size; - } - /** - Size of the queue, filtered by the given options. +const unixfs_node_modules_multiformats_src_bases_base2_base2 = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: '0', + name: 'base2', + alphabet: '01', + bitsPerChar: 1 +}) - For example, this can be used to find the number of items remaining in the queue with a specific priority level. - */ - sizeBy(options) { - // eslint-disable-next-line unicorn/no-array-callback-reference - return this.#queue.filter(options).length; - } - /** - Number of running items (no longer in the queue). - */ - get pending() { - return this.#pending; - } - /** - Whether the queue is currently paused. - */ - get isPaused() { - return this.#isPaused; +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base256emoji.js + + +const unixfs_node_modules_multiformats_src_bases_base256emoji_alphabet = Array.from('🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂') +const unixfs_node_modules_multiformats_src_bases_base256emoji_alphabetBytesToChars = /** @type {string[]} */ (unixfs_node_modules_multiformats_src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[i] = c; return p }, /** @type {string[]} */([]))) +const unixfs_node_modules_multiformats_src_bases_base256emoji_alphabetCharsToBytes = /** @type {number[]} */ (unixfs_node_modules_multiformats_src_bases_base256emoji_alphabet.reduce((p, c, i) => { p[/** @type {number} */ (c.codePointAt(0))] = i; return p }, /** @type {number[]} */([]))) + +/** + * @param {Uint8Array} data + * @returns {string} + */ +function unixfs_node_modules_multiformats_src_bases_base256emoji_encode (data) { + return data.reduce((p, c) => { + p += unixfs_node_modules_multiformats_src_bases_base256emoji_alphabetBytesToChars[c] + return p + }, '') +} + +/** + * @param {string} str + * @returns {Uint8Array} + */ +function unixfs_node_modules_multiformats_src_bases_base256emoji_decode (str) { + const byts = [] + for (const char of str) { + const byt = unixfs_node_modules_multiformats_src_bases_base256emoji_alphabetCharsToBytes[/** @type {number} */ (char.codePointAt(0))] + if (byt === undefined) { + throw new Error(`Non-base256emoji character: ${char}`) } + byts.push(byt) + } + return new Uint8Array(byts) } -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.js +const unixfs_node_modules_multiformats_src_bases_base256emoji_base256emoji = unixfs_node_modules_multiformats_src_bases_base_from({ + prefix: '🚀', + name: 'base256emoji', + encode: unixfs_node_modules_multiformats_src_bases_base256emoji_encode, + decode: unixfs_node_modules_multiformats_src_bases_base256emoji_decode +}) +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base36.js +const unixfs_node_modules_multiformats_src_bases_base36_base36 = unixfs_node_modules_multiformats_src_bases_base_baseX({ + prefix: 'k', + name: 'base36', + alphabet: '0123456789abcdefghijklmnopqrstuvwxyz' +}) +const unixfs_node_modules_multiformats_src_bases_base36_base36upper = unixfs_node_modules_multiformats_src_bases_base_baseX({ + prefix: 'K', + name: 'base36upper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' +}) +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base64.js +// @ts-check +const unixfs_node_modules_multiformats_src_bases_base64_base64 = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'm', + name: 'base64', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + bitsPerChar: 6 +}) +const unixfs_node_modules_multiformats_src_bases_base64_base64pad = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'M', + name: 'base64pad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', + bitsPerChar: 6 +}) +const unixfs_node_modules_multiformats_src_bases_base64_base64url = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'u', + name: 'base64url', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', + bitsPerChar: 6 +}) +const unixfs_node_modules_multiformats_src_bases_base64_base64urlpad = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: 'U', + name: 'base64urlpad', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', + bitsPerChar: 6 +}) -async function walkDAG(blockstore, node, queue, streamPosition, start, end, options) { - // a `raw` node - if (node instanceof Uint8Array) { - const buf = extract_data_from_block(node, streamPosition, start, end); - queue.push(buf); - return; - } - if (node.Data == null) { - throw err_code(new Error('no data in PBNode'), 'ERR_NOT_UNIXFS'); - } - let file; - try { - file = src_UnixFS.unmarshal(node.Data); - } - catch (err) { - throw err_code(err, 'ERR_NOT_UNIXFS'); - } - // might be a unixfs `raw` node or have data on intermediate nodes - if (file.data != null) { - const data = file.data; - const buf = extract_data_from_block(data, streamPosition, start, end); - queue.push(buf); - streamPosition += BigInt(buf.byteLength); - } - const childOps = []; - if (node.Links.length !== file.blockSizes.length) { - throw err_code(new Error('Inconsistent block sizes and dag links'), 'ERR_NOT_UNIXFS'); - } - for (let i = 0; i < node.Links.length; i++) { - const childLink = node.Links[i]; - const childStart = streamPosition; // inclusive - const childEnd = childStart + file.blockSizes[i]; // exclusive - if ((start >= childStart && start < childEnd) || // child has offset byte - (end >= childStart && end <= childEnd) || // child has end byte - (start < childStart && end > childEnd)) { // child is between offset and end bytes - childOps.push({ - link: childLink, - blockStart: streamPosition - }); - } - streamPosition = childEnd; - if (streamPosition > end) { - break; - } - } - await pipe(childOps, (source) => node_modules_it_map_dist_src(source, (op) => { - return async () => { - const block = await blockstore.get(op.link.Hash, options); - return { - ...op, - block - }; - }; - }), (source) => parallel(source, { - ordered: true - }), async (source) => { - for await (const { link, block, blockStart } of source) { - let child; - switch (link.Hash.code) { - case code: - child = src_decode(block); - break; - case multiformats_dist_src_codecs_raw_code: - child = block; - break; - default: - queue.end(err_code(new Error(`Unsupported codec: ${link.Hash.code}`), 'ERR_NOT_UNIXFS')); - return; - } - // create a queue for this child - we use a queue instead of recursion - // to avoid overflowing the stack - const childQueue = new dist_PQueue({ - concurrency: 1 - }); - // if any of the child jobs error, end the read queue with the error - childQueue.on('error', error => { - queue.end(error); - }); - // if the job rejects the 'error' event will be emitted on the child queue - void childQueue.add(async () => { - options.onProgress?.(new CustomProgressEvent('unixfs:exporter:walk:file', { - cid: link.Hash - })); - await walkDAG(blockstore, child, queue, blockStart, start, end, options); - }); - // wait for this child to complete before moving on to the next - await childQueue.onIdle(); - } - }); - if (streamPosition >= end) { - queue.end(); - } -} -const fileContent = (cid, node, unixfs, path, resolve, depth, blockstore) => { - async function* yieldFileContent(options = {}) { - const fileSize = unixfs.fileSize(); - if (fileSize === undefined) { - throw new Error('File was a directory'); - } - const { start, end } = validate_offset_and_length(fileSize, options.offset, options.length); - if (end === 0n) { - return; - } - let read = 0n; - const wanted = end - start; - const queue = src_pushable(); - options.onProgress?.(new CustomProgressEvent('unixfs:exporter:walk:file', { - cid - })); - void walkDAG(blockstore, node, queue, 0n, start, end, options) - .catch(err => { - queue.end(err); - }); - for await (const buf of queue) { - if (buf == null) { - continue; - } - read += BigInt(buf.byteLength); - if (read > wanted) { - queue.end(); - throw err_code(new Error('Read too many bytes - the file size reported by the UnixFS data in the root node may be incorrect'), 'ERR_OVER_READ'); - } - if (read === wanted) { - queue.end(); - } - options.onProgress?.(new CustomProgressEvent('unixfs:exporter:progress:unixfs:file', { - bytesRead: read, - totalBytes: wanted, - fileSize - })); - yield buf; - } - if (read < wanted) { - throw err_code(new Error('Traversed entire DAG but did not read enough bytes'), 'ERR_UNDER_READ'); - } - } - return yieldFileContent; -}; -/* harmony default export */ const file = (fileContent); -//# sourceMappingURL=file.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.js +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/base8.js +// @ts-check +const unixfs_node_modules_multiformats_src_bases_base8_base8 = unixfs_node_modules_multiformats_src_bases_base_rfc4648({ + prefix: '7', + name: 'base8', + alphabet: '01234567', + bitsPerChar: 3 +}) +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/bases/identity.js +// @ts-check -const hamtShardedDirectoryContent = (cid, node, unixfs, path, resolve, depth, blockstore) => { - function yieldHamtDirectoryContent(options = {}) { - options.onProgress?.(new CustomProgressEvent('unixfs:exporter:walk:hamt-sharded-directory', { - cid - })); - return listDirectory(node, path, resolve, depth, blockstore, options); - } - return yieldHamtDirectoryContent; -}; -async function* listDirectory(node, path, resolve, depth, blockstore, options) { - const links = node.Links; - if (node.Data == null) { - throw err_code(new Error('no data in PBNode'), 'ERR_NOT_UNIXFS'); - } - let dir; - try { - dir = src_UnixFS.unmarshal(node.Data); - } - catch (err) { - throw err_code(err, 'ERR_NOT_UNIXFS'); - } - if (dir.fanout == null) { - throw err_code(new Error('missing fanout'), 'ERR_NOT_UNIXFS'); - } - const padLength = (dir.fanout - 1n).toString(16).length; - const results = pipe(links, source => node_modules_it_map_dist_src(source, link => { - return async () => { - const name = link.Name != null ? link.Name.substring(padLength) : null; - if (name != null && name !== '') { - const result = await resolve(link.Hash, name, `${path}/${name}`, [], depth + 1, blockstore, options); - return { entries: result.entry == null ? [] : [result.entry] }; - } - else { - // descend into subshard - const block = await blockstore.get(link.Hash, options); - node = src_decode(block); - options.onProgress?.(new CustomProgressEvent('unixfs:exporter:walk:hamt-sharded-directory', { - cid: link.Hash - })); - return { entries: listDirectory(node, path, resolve, depth, blockstore, options) }; - } - }; - }), source => parallel(source, { ordered: true })); - for await (const { entries } of results) { - yield* entries; - } -} -/* harmony default export */ const hamt_sharded_directory = (hamtShardedDirectoryContent); -//# sourceMappingURL=hamt-sharded-directory.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.js +const unixfs_node_modules_multiformats_src_bases_identity_identity = unixfs_node_modules_multiformats_src_bases_base_from({ + prefix: '\x00', + name: 'identity', + encode: (buf) => unixfs_node_modules_multiformats_src_bytes_toString(buf), + decode: (str) => unixfs_node_modules_multiformats_src_bytes_fromString(str) +}) + +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/codecs/json.js +// @ts-check + +/** + * @template T + * @typedef {import('./interface.js').ByteView} ByteView + */ + +const unixfs_node_modules_multiformats_src_codecs_json_textEncoder = new TextEncoder() +const unixfs_node_modules_multiformats_src_codecs_json_textDecoder = new TextDecoder() + +const unixfs_node_modules_multiformats_src_codecs_json_name = 'json' +const unixfs_node_modules_multiformats_src_codecs_json_code = 0x0200 + +/** + * @template T + * @param {T} node + * @returns {ByteView} + */ +const unixfs_node_modules_multiformats_src_codecs_json_encode = (node) => unixfs_node_modules_multiformats_src_codecs_json_textEncoder.encode(JSON.stringify(node)) + +/** + * @template T + * @param {ByteView} data + * @returns {T} + */ +const unixfs_node_modules_multiformats_src_codecs_json_decode = (data) => JSON.parse(unixfs_node_modules_multiformats_src_codecs_json_textDecoder.decode(data)) +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/codecs/raw.js +// @ts-check +/** + * @template T + * @typedef {import('./interface.js').ByteView} ByteView + */ +const unixfs_node_modules_multiformats_src_codecs_raw_name = 'raw' +const unixfs_node_modules_multiformats_src_codecs_raw_code = 0x55 -const findLinkCid = (node, name) => { - const link = node.Links.find(link => link.Name === name); - return link?.Hash; -}; -const contentExporters = { - raw: file, - file: file, - directory: directory, - 'hamt-sharded-directory': hamt_sharded_directory, - metadata: (cid, node, unixfs, path, resolve, depth, blockstore) => { - return () => []; - }, - symlink: (cid, node, unixfs, path, resolve, depth, blockstore) => { - return () => []; - } -}; -// @ts-expect-error types are wrong -const unixFsResolver = async (cid, name, path, toResolve, resolve, depth, blockstore, options) => { - const block = await blockstore.get(cid, options); - const node = src_decode(block); - let unixfs; - let next; - if (name == null) { - name = cid.toString(); - } - if (node.Data == null) { - throw err_code(new Error('no data in PBNode'), 'ERR_NOT_UNIXFS'); - } - try { - unixfs = src_UnixFS.unmarshal(node.Data); - } - catch (err) { - // non-UnixFS dag-pb node? It could happen. - throw err_code(err, 'ERR_NOT_UNIXFS'); - } - if (path == null) { - path = name; - } - if (toResolve.length > 0) { - let linkCid; - if (unixfs?.type === 'hamt-sharded-directory') { - // special case - unixfs v1 hamt shards - linkCid = await find_cid_in_shard(node, toResolve[0], blockstore); - } - else { - linkCid = findLinkCid(node, toResolve[0]); - } - if (linkCid == null) { - throw err_code(new Error('file does not exist'), 'ERR_NOT_FOUND'); - } - // remove the path component we have resolved - const nextName = toResolve.shift(); - const nextPath = `${path}/${nextName}`; - next = { - cid: linkCid, - toResolve, - name: nextName ?? '', - path: nextPath - }; - } - const content = contentExporters[unixfs.type](cid, node, unixfs, path, resolve, depth, blockstore); - if (content == null) { - throw err_code(new Error('could not find content exporter'), 'ERR_NOT_FOUND'); - } - if (unixfs.isDirectory()) { - return { - entry: { - type: 'directory', - name, - path, - cid, - content, - unixfs, - depth, - node, - size: unixfs.fileSize() - }, - next - }; - } - return { - entry: { - type: 'file', - name, - path, - cid, - content, - unixfs, - depth, - node, - size: unixfs.fileSize() - }, - next - }; -}; -/* harmony default export */ const unixfs_v1 = (unixFsResolver); -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/resolvers/index.js +/** + * @param {Uint8Array} node + * @returns {ByteView} + */ +const unixfs_node_modules_multiformats_src_codecs_raw_encode = (node) => unixfs_node_modules_multiformats_src_bytes_coerce(node) + +/** + * @param {ByteView} data + * @returns {Uint8Array} + */ +const unixfs_node_modules_multiformats_src_codecs_raw_decode = (data) => unixfs_node_modules_multiformats_src_bytes_coerce(data) +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/hashes/identity.js +const unixfs_node_modules_multiformats_src_hashes_identity_code = 0x0 +const unixfs_node_modules_multiformats_src_hashes_identity_name = 'identity' +/** @type {(input:Uint8Array) => Uint8Array} */ +const unixfs_node_modules_multiformats_src_hashes_identity_encode = unixfs_node_modules_multiformats_src_bytes_coerce +/** + * @param {Uint8Array} input + * @returns {Digest.Digest} + */ +const unixfs_node_modules_multiformats_src_hashes_identity_digest = (input) => unixfs_node_modules_multiformats_src_hashes_digest_create(unixfs_node_modules_multiformats_src_hashes_identity_code, unixfs_node_modules_multiformats_src_hashes_identity_encode(input)) +const unixfs_node_modules_multiformats_src_hashes_identity_identity = { code: unixfs_node_modules_multiformats_src_hashes_identity_code, name: unixfs_node_modules_multiformats_src_hashes_identity_name, encode: unixfs_node_modules_multiformats_src_hashes_identity_encode, digest: unixfs_node_modules_multiformats_src_hashes_identity_digest } +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/hashes/sha2.js +// @ts-check -const resolvers_resolvers = { - [code]: unixfs_v1, - [multiformats_dist_src_codecs_raw_code]: resolvers_raw, - [src_code]: dag_cbor, - [multiformats_dist_src_hashes_identity_identity.code]: resolvers_identity -}; -const resolvers_resolve = async (cid, name, path, toResolve, depth, blockstore, options) => { - const resolver = resolvers_resolvers[cid.code]; - if (resolver == null) { - throw err_code(new Error(`No resolver for code ${cid.code}`), 'ERR_NO_RESOLVER'); - } - return resolver(cid, name, path, toResolve, resolvers_resolve, depth, blockstore, options); -}; -/* harmony default export */ const dist_src_resolvers = (resolvers_resolve); -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/index.js -const src_toPathComponents = (path = '') => { - // split on / unless escaped with \ - return (path - .trim() - .match(/([^\\^/]|\\\/)+/g) ?? []) - .filter(Boolean); -}; -const cidAndRest = (path) => { - if (path instanceof Uint8Array) { - return { - cid: ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.decode(path), - toResolve: [] - }; +const unixfs_node_modules_multiformats_src_hashes_sha2_sha256 = unixfs_node_modules_multiformats_src_hashes_hasher_from({ + name: 'sha2-256', + code: 0x12, + encode: (input) => unixfs_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha256').update(input).digest()) +}) + +const unixfs_node_modules_multiformats_src_hashes_sha2_sha512 = unixfs_node_modules_multiformats_src_hashes_hasher_from({ + name: 'sha2-512', + code: 0x13, + encode: input => unixfs_node_modules_multiformats_src_bytes_coerce(external_crypto_.createHash('sha512').update(input).digest()) +}) + +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/multiformats/src/basics.js +// @ts-check + + + + + + + + + + + + + + + + + +const unixfs_node_modules_multiformats_src_basics_bases = { ...unixfs_node_modules_multiformats_src_bases_identity_namespaceObject, ...unixfs_node_modules_multiformats_src_bases_base2_namespaceObject, ...unixfs_node_modules_multiformats_src_bases_base8_namespaceObject, ...unixfs_node_modules_multiformats_src_bases_base10_namespaceObject, ...unixfs_node_modules_multiformats_src_bases_base16_namespaceObject, ...unixfs_node_modules_multiformats_src_bases_base32_namespaceObject, ...unixfs_node_modules_multiformats_src_bases_base36_namespaceObject, ...unixfs_node_modules_multiformats_src_bases_base58_namespaceObject, ...unixfs_node_modules_multiformats_src_bases_base64_namespaceObject, ...unixfs_node_modules_multiformats_src_bases_base256emoji_namespaceObject } +const unixfs_node_modules_multiformats_src_basics_hashes = { ...unixfs_node_modules_multiformats_src_hashes_sha2_namespaceObject, ...unixfs_node_modules_multiformats_src_hashes_identity_namespaceObject } +const unixfs_node_modules_multiformats_src_basics_codecs = { raw: unixfs_node_modules_multiformats_src_codecs_raw_namespaceObject, json: unixfs_node_modules_multiformats_src_codecs_json_namespaceObject } + + + +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/uint8arrays/dist/src/alloc.js + +/** + * Returns a `Uint8Array` of the requested size. Referenced memory will + * be initialized to 0. + */ +function unixfs_node_modules_uint8arrays_dist_src_alloc_alloc(size = 0) { + if (globalThis.Buffer?.alloc != null) { + return asUint8Array(globalThis.Buffer.alloc(size)); } - const cid = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.asCID(path); - if (cid != null) { - return { - cid, - toResolve: [] - }; + return new Uint8Array(size); +} +/** + * Where possible returns a Uint8Array of the requested size that references + * uninitialized memory. Only use if you are certain you will immediately + * overwrite every value in the returned `Uint8Array`. + */ +function unixfs_node_modules_uint8arrays_dist_src_alloc_allocUnsafe(size = 0) { + if (globalThis.Buffer?.allocUnsafe != null) { + return unixfs_node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.allocUnsafe(size)); } - if (typeof path === 'string') { - if (path.indexOf('/ipfs/') === 0) { - path = path.substring(6); + return new Uint8Array(size); +} +//# sourceMappingURL=alloc.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/uint8arrays/dist/src/util/bases.js + + +function uint8arrays_dist_src_util_bases_createCodec(name, prefix, encode, decode) { + return { + name, + prefix, + encoder: { + name, + prefix, + encode + }, + decoder: { + decode } - const output = src_toPathComponents(path); - return { - cid: ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.parse(output[0]), - toResolve: output.slice(1) - }; + }; +} +const uint8arrays_dist_src_util_bases_string = uint8arrays_dist_src_util_bases_createCodec('utf8', 'u', (buf) => { + const decoder = new TextDecoder('utf8'); + return 'u' + decoder.decode(buf); +}, (str) => { + const encoder = new TextEncoder(); + return encoder.encode(str.substring(1)); +}); +const uint8arrays_dist_src_util_bases_ascii = uint8arrays_dist_src_util_bases_createCodec('ascii', 'a', (buf) => { + let string = 'a'; + for (let i = 0; i < buf.length; i++) { + string += String.fromCharCode(buf[i]); } - throw err_code(new Error(`Unknown path type ${path}`), 'ERR_BAD_PATH'); + return string; +}, (str) => { + str = str.substring(1); + const buf = unixfs_node_modules_uint8arrays_dist_src_alloc_allocUnsafe(str.length); + for (let i = 0; i < str.length; i++) { + buf[i] = str.charCodeAt(i); + } + return buf; +}); +const uint8arrays_dist_src_util_bases_BASES = { + utf8: uint8arrays_dist_src_util_bases_string, + 'utf-8': uint8arrays_dist_src_util_bases_string, + hex: unixfs_node_modules_multiformats_src_basics_bases.base16, + latin1: uint8arrays_dist_src_util_bases_ascii, + ascii: uint8arrays_dist_src_util_bases_ascii, + binary: uint8arrays_dist_src_util_bases_ascii, + ...unixfs_node_modules_multiformats_src_basics_bases }; -async function* walkPath(path, blockstore, options = {}) { - let { cid, toResolve } = cidAndRest(path); - let name = cid.toString(); - let entryPath = name; - const startingDepth = toResolve.length; - while (true) { - const result = await dist_src_resolvers(cid, name, entryPath, toResolve, startingDepth, blockstore, options); - if (result.entry == null && result.next == null) { - throw err_code(new Error(`Could not resolve ${path}`), 'ERR_NOT_FOUND'); - } - if (result.entry != null) { - yield result.entry; - } - if (result.next == null) { - return; - } - // resolve further parts - toResolve = result.next.toResolve; - cid = result.next.cid; - name = result.next.name; - entryPath = result.next.path; +/* harmony default export */ const unixfs_node_modules_uint8arrays_dist_src_util_bases = (uint8arrays_dist_src_util_bases_BASES); +//# sourceMappingURL=bases.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/uint8arrays/dist/src/from-string.js + + +/** + * Create a `Uint8Array` from the passed string + * + * Supports `utf8`, `utf-8`, `hex`, and any encoding supported by the multiformats module. + * + * Also `ascii` which is similar to node's 'binary' encoding. + */ +function unixfs_node_modules_uint8arrays_dist_src_from_string_fromString(string, encoding = 'utf8') { + const base = unixfs_node_modules_uint8arrays_dist_src_util_bases[encoding]; + if (base == null) { + throw new Error(`Unsupported encoding "${encoding}"`); } -} -async function exporter(path, blockstore, options = {}) { - const result = await dist_src(walkPath(path, blockstore, options)); - if (result == null) { - throw err_code(new Error(`Could not resolve ${path}`), 'ERR_NOT_FOUND'); + if ((encoding === 'utf8' || encoding === 'utf-8') && globalThis.Buffer != null && globalThis.Buffer.from != null) { + return unixfs_node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(globalThis.Buffer.from(string, 'utf-8')); } - return result; + // add multibase prefix + return base.decoder.decode(`${base.prefix}${string}`); // eslint-disable-line @typescript-eslint/restrict-template-expressions } -async function* recursive(path, blockstore, options = {}) { - const node = await exporter(path, blockstore, options); - if (node == null) { - return; +//# sourceMappingURL=from-string.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/hamt-sharding/dist/src/bucket.js +// @ts-expect-error + + +class Bucket { + constructor(options, parent, posAtParent = 0) { + this._options = options; + this._popCount = 0; + this._parent = parent; + this._posAtParent = posAtParent; + this._children = new sparse_array(); + this.key = null; } - yield node; - if (node.type === 'directory') { - for await (const child of recurse(node, options)) { - yield child; + async put(key, value) { + const place = await this._findNewBucketAndPos(key); + await place.bucket._putAt(place, key, value); + } + async get(key) { + const child = await this._findChild(key); + if (child != null) { + return child.value; } } - async function* recurse(node, options) { - for await (const file of node.content(options)) { - yield file; - if (file instanceof Uint8Array) { - continue; + async del(key) { + const place = await this._findPlace(key); + const child = place.bucket._at(place.pos); + if (child != null && child.key === key) { + place.bucket._delAt(place.pos); + } + } + leafCount() { + const children = this._children.compactArray(); + return children.reduce((acc, child) => { + if (child instanceof Bucket) { + return acc + child.leafCount(); } - if (file.type === 'directory') { - yield* recurse(file, options); + return acc + 1; + }, 0); + } + childrenCount() { + return this._children.length; + } + onlyChild() { + return this._children.get(0); + } + *eachLeafSeries() { + const children = this._children.compactArray(); + for (const child of children) { + if (child instanceof Bucket) { + yield* child.eachLeafSeries(); + } + else { + yield child; } } } -} -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/errors.js -class UnixFSError extends Error { - name; - code; - constructor(message, name, code) { - super(message); - this.name = name; - this.code = code; + serialize(map, reduce) { + const acc = []; + // serialize to a custom non-sparse representation + return reduce(this._children.reduce((acc, child, index) => { + if (child != null) { + if (child instanceof Bucket) { + acc.push(child.serialize(map, reduce)); + } + else { + acc.push(map(child, index)); + } + } + return acc; + }, acc)); } -} -class NotUnixFSError extends UnixFSError { - constructor(message = 'not a Unixfs node') { - super(message, 'NotUnixFSError', 'ERR_NOT_UNIXFS'); + async asyncTransform(asyncMap, asyncReduce) { + return await asyncTransformBucket(this, asyncMap, asyncReduce); } -} -class InvalidPBNodeError extends UnixFSError { - constructor(message = 'invalid PBNode') { - super(message, 'InvalidPBNodeError', 'ERR_INVALID_PBNODE'); + toJSON() { + return this.serialize(mapNode, reduceNodes); } -} -class errors_UnknownError extends UnixFSError { - constructor(message = 'unknown error') { - super(message, 'InvalidPBNodeError', 'ERR_UNKNOWN_ERROR'); + prettyPrint() { + return JSON.stringify(this.toJSON(), null, ' '); } -} -class AlreadyExistsError extends UnixFSError { - constructor(message = 'path already exists') { - super(message, 'AlreadyExistsError', 'ERR_ALREADY_EXISTS'); + tableSize() { + return Math.pow(2, this._options.bits); } -} -class DoesNotExistError extends UnixFSError { - constructor(message = 'path does not exist') { - super(message, 'DoesNotExistError', 'ERR_DOES_NOT_EXIST'); + async _findChild(key) { + const result = await this._findPlace(key); + const child = result.bucket._at(result.pos); + if (child instanceof Bucket) { + // should not be possible, this._findPlace should always + // return a location for a child, not a bucket + return undefined; + } + if (child != null && child.key === key) { + return child; + } } -} -class NoContentError extends UnixFSError { - constructor(message = 'no content') { - super(message, 'NoContentError', 'ERR_NO_CONTENT'); + async _findPlace(key) { + const hashValue = this._options.hash(typeof key === 'string' ? unixfs_node_modules_uint8arrays_dist_src_from_string_fromString(key) : key); + const index = await hashValue.take(this._options.bits); + const child = this._children.get(index); + if (child instanceof Bucket) { + return await child._findPlace(hashValue); + } + return { + bucket: this, + pos: index, + hash: hashValue, + existingChild: child + }; } -} -class NotAFileError extends UnixFSError { - constructor(message = 'not a file') { - super(message, 'NotAFileError', 'ERR_NOT_A_FILE'); + async _findNewBucketAndPos(key) { + const place = await this._findPlace(key); + if ((place.existingChild != null) && place.existingChild.key !== key) { + // conflict + const bucket = new Bucket(this._options, place.bucket, place.pos); + place.bucket._putObjectAt(place.pos, bucket); + // put the previous value + const newPlace = await bucket._findPlace(place.existingChild.hash); + newPlace.bucket._putAt(newPlace, place.existingChild.key, place.existingChild.value); + return await bucket._findNewBucketAndPos(place.hash); + } + // no conflict, we found the place + return place; } -} -class NotADirectoryError extends UnixFSError { - constructor(message = 'not a directory') { - super(message, 'NotADirectoryError', 'ERR_NOT_A_DIRECTORY'); + _putAt(place, key, value) { + this._putObjectAt(place.pos, { + key: key, + value: value, + hash: place.hash + }); } -} -class errors_InvalidParametersError extends UnixFSError { - constructor(message = 'invalid parameters') { - super(message, 'InvalidParametersError', 'ERR_INVALID_PARAMETERS'); + _putObjectAt(pos, object) { + if (this._children.get(pos) == null) { + this._popCount++; + } + this._children.set(pos, object); } -} -//# sourceMappingURL=errors.js.map -;// CONCATENATED MODULE: ./node_modules/@libp2p/logger/node_modules/multiformats/vendor/base-x.js -// base-x encoding / decoding -// Copyright (c) 2018 base-x contributors -// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) -// Distributed under the MIT software license, see the accompanying -// file LICENSE or http://www.opensource.org/licenses/mit-license.php. -function logger_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) { - if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } - var BASE_MAP = new Uint8Array(256); - for (var j = 0; j < BASE_MAP.length; j++) { - BASE_MAP[j] = 255; - } - for (var i = 0; i < ALPHABET.length; i++) { - var x = ALPHABET.charAt(i); - var xc = x.charCodeAt(0); - if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') } - BASE_MAP[xc] = i; - } - var BASE = ALPHABET.length; - var LEADER = ALPHABET.charAt(0); - var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up - var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up - function encode (source) { - if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) { - source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); - } else if (Array.isArray(source)) { - source = Uint8Array.from(source); + _delAt(pos) { + if (pos === -1) { + throw new Error('Invalid position'); + } + if (this._children.get(pos) != null) { + this._popCount--; + } + this._children.unset(pos); + this._level(); } - if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') } - if (source.length === 0) { return '' } - // Skip & count leading zeroes. - var zeroes = 0; - var length = 0; - var pbegin = 0; - var pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; + _level() { + if (this._parent != null && this._popCount <= 1) { + if (this._popCount === 1) { + // remove myself from parent, replacing me with my only child + const onlyChild = this._children.find(exists); + if ((onlyChild != null) && !(onlyChild instanceof Bucket)) { + const hash = onlyChild.hash; + hash.untake(this._options.bits); + const place = { + pos: this._posAtParent, + hash: hash, + bucket: this._parent + }; + this._parent._putAt(place, onlyChild.key, onlyChild.value); + } + } + else { + this._parent._delAt(this._posAtParent); + } + } } - // Allocate enough space in big-endian base58 representation. - var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; - var b58 = new Uint8Array(size); - // Process the bytes. - while (pbegin !== pend) { - var carry = source[pbegin]; - // Apply "b58 = b58 * 256 + ch". - var i = 0; - for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { - carry += (256 * b58[it1]) >>> 0; - b58[it1] = (carry % BASE) >>> 0; - carry = (carry / BASE) >>> 0; - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - pbegin++; + _at(index) { + return this._children.get(index); } - // Skip leading zeroes in base58 result. - var it2 = size - length; - while (it2 !== size && b58[it2] === 0) { - it2++; +} +function exists(o) { + return Boolean(o); +} +function mapNode(node, _) { + return node.key; +} +function reduceNodes(nodes) { + return nodes; +} +async function asyncTransformBucket(bucket, asyncMap, asyncReduce) { + const output = []; + for (const child of bucket._children.compactArray()) { + if (child instanceof Bucket) { + await asyncTransformBucket(child, asyncMap, asyncReduce); + } + else { + const mappedChildren = await asyncMap(child); + output.push({ + bitField: bucket._children.bitField(), + children: mappedChildren + }); + } } - // Translate the result into a string. - var str = LEADER.repeat(zeroes); - for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); } - return str - } - function decodeUnsafe (source) { - if (typeof source !== 'string') { throw new TypeError('Expected String') } - if (source.length === 0) { return new Uint8Array() } - var psz = 0; - // Skip leading spaces. - if (source[psz] === ' ') { return } - // Skip and count leading '1's. - var zeroes = 0; - var length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; + return await asyncReduce(output); +} +//# sourceMappingURL=bucket.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/hamt-sharding/dist/src/consumable-buffer.js +const START_MASKS = [ + 0b11111111, + 0b11111110, + 0b11111100, + 0b11111000, + 0b11110000, + 0b11100000, + 0b11000000, + 0b10000000 +]; +const STOP_MASKS = [ + 0b00000001, + 0b00000011, + 0b00000111, + 0b00001111, + 0b00011111, + 0b00111111, + 0b01111111, + 0b11111111 +]; +class ConsumableBuffer { + constructor(value) { + this._value = value; + this._currentBytePos = value.length - 1; + this._currentBitPos = 7; } - // Allocate enough space in big-endian base256 representation. - var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. - var b256 = new Uint8Array(size); - // Process the characters. - while (source[psz]) { - // Decode character - var carry = BASE_MAP[source.charCodeAt(psz)]; - // Invalid character - if (carry === 255) { return } - var i = 0; - for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { - carry += (BASE * b256[it3]) >>> 0; - b256[it3] = (carry % 256) >>> 0; - carry = (carry / 256) >>> 0; - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - psz++; + availableBits() { + return this._currentBitPos + 1 + this._currentBytePos * 8; } - // Skip trailing spaces. - if (source[psz] === ' ') { return } - // Skip leading zeroes in b256. - var it4 = size - length; - while (it4 !== size && b256[it4] === 0) { - it4++; + totalBits() { + return this._value.length * 8; } - var vch = new Uint8Array(zeroes + (size - it4)); - var j = zeroes; - while (it4 !== size) { - vch[j++] = b256[it4++]; + take(bits) { + let pendingBits = bits; + let result = 0; + while (pendingBits > 0 && this._haveBits()) { + const byte = this._value[this._currentBytePos]; + const availableBits = this._currentBitPos + 1; + const taking = Math.min(availableBits, pendingBits); + const value = byteBitsToInt(byte, availableBits - taking, taking); + result = (result << taking) + value; + pendingBits -= taking; + this._currentBitPos -= taking; + if (this._currentBitPos < 0) { + this._currentBitPos = 7; + this._currentBytePos--; + } + } + return result; + } + untake(bits) { + this._currentBitPos += bits; + while (this._currentBitPos > 7) { + this._currentBitPos -= 8; + this._currentBytePos += 1; + } + } + _haveBits() { + return this._currentBytePos >= 0; } - return vch - } - function decode (string) { - var buffer = decodeUnsafe(string); - if (buffer) { return buffer } - throw new Error(`Non-${name} character`) - } - return { - encode: encode, - decodeUnsafe: decodeUnsafe, - decode: decode - } } -var logger_node_modules_multiformats_vendor_base_x_src = logger_node_modules_multiformats_vendor_base_x_base; - -var logger_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = logger_node_modules_multiformats_vendor_base_x_src; - -/* harmony default export */ const logger_node_modules_multiformats_vendor_base_x = (logger_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX); - -;// CONCATENATED MODULE: ./node_modules/@libp2p/logger/node_modules/multiformats/src/bytes.js -const logger_node_modules_multiformats_src_bytes_empty = new Uint8Array(0) +function byteBitsToInt(byte, start, length) { + const mask = maskFor(start, length); + return (byte & mask) >>> start; +} +function maskFor(start, length) { + return START_MASKS[start] & STOP_MASKS[Math.min(length + start - 1, 7)]; +} +//# sourceMappingURL=consumable-buffer.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/uint8arrays/dist/src/concat.js -/** - * @param {Uint8Array} d - */ -const logger_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '') /** - * @param {string} hex + * Returns a new Uint8Array created by concatenating the passed ArrayLikes */ -const logger_node_modules_multiformats_src_bytes_fromHex = hex => { - const hexes = hex.match(/../g) - return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : logger_node_modules_multiformats_src_bytes_empty +function uint8arrays_dist_src_concat_concat(arrays, length) { + if (length == null) { + length = arrays.reduce((acc, curr) => acc + curr.length, 0); + } + const output = unixfs_node_modules_uint8arrays_dist_src_alloc_allocUnsafe(length); + let offset = 0; + for (const arr of arrays) { + output.set(arr, offset); + offset += arr.length; + } + return unixfs_node_modules_uint8arrays_dist_src_util_as_uint8array_asUint8Array(output); } +//# sourceMappingURL=concat.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/hamt-sharding/dist/src/consumable-hash.js -/** - * @param {Uint8Array} aa - * @param {Uint8Array} bb - */ -const logger_node_modules_multiformats_src_bytes_equals = (aa, bb) => { - if (aa === bb) return true - if (aa.byteLength !== bb.byteLength) { - return false - } - for (let ii = 0; ii < aa.byteLength; ii++) { - if (aa[ii] !== bb[ii]) { - return false +function wrapHash(hashFn) { + function hashing(value) { + if (value instanceof InfiniteHash) { + // already a hash. return it + return value; + } + else { + return new InfiniteHash(value, hashFn); + } } - } - - return true + return hashing; } - -/** - * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o - * @returns {Uint8Array} - */ -const logger_node_modules_multiformats_src_bytes_coerce = o => { - if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o - if (o instanceof ArrayBuffer) return new Uint8Array(o) - if (ArrayBuffer.isView(o)) { - return new Uint8Array(o.buffer, o.byteOffset, o.byteLength) - } - throw new Error('Unknown type, must be binary type') +class InfiniteHash { + constructor(value, hashFn) { + if (!(value instanceof Uint8Array)) { + throw new Error('can only hash Uint8Arrays'); + } + this._value = value; + this._hashFn = hashFn; + this._depth = -1; + this._availableBits = 0; + this._currentBufferIndex = 0; + this._buffers = []; + } + async take(bits) { + let pendingBits = bits; + while (this._availableBits < pendingBits) { + await this._produceMoreBits(); + } + let result = 0; + while (pendingBits > 0) { + const hash = this._buffers[this._currentBufferIndex]; + const available = Math.min(hash.availableBits(), pendingBits); + const took = hash.take(available); + result = (result << available) + took; + pendingBits -= available; + this._availableBits -= available; + if (hash.availableBits() === 0) { + this._currentBufferIndex++; + } + } + return result; + } + untake(bits) { + let pendingBits = bits; + while (pendingBits > 0) { + const hash = this._buffers[this._currentBufferIndex]; + const availableForUntake = Math.min(hash.totalBits() - hash.availableBits(), pendingBits); + hash.untake(availableForUntake); + pendingBits -= availableForUntake; + this._availableBits += availableForUntake; + if (this._currentBufferIndex > 0 && hash.totalBits() === hash.availableBits()) { + this._depth--; + this._currentBufferIndex--; + } + } + } + async _produceMoreBits() { + this._depth++; + const value = this._depth > 0 ? uint8arrays_dist_src_concat_concat([this._value, Uint8Array.from([this._depth])]) : this._value; + const hashValue = await this._hashFn(value); + const buffer = new ConsumableBuffer(hashValue); + this._buffers.push(buffer); + this._availableBits += buffer.availableBits(); + } } +//# sourceMappingURL=consumable-hash.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/hamt-sharding/dist/src/index.js -/** - * @param {any} o - * @returns {o is ArrayBuffer|ArrayBufferView} - */ -const logger_node_modules_multiformats_src_bytes_isBinary = o => - o instanceof ArrayBuffer || ArrayBuffer.isView(o) - -/** - * @param {string} str - * @returns {Uint8Array} - */ -const logger_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str) - -/** - * @param {Uint8Array} b - * @returns {string} - */ -const logger_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b) +function createHAMT(options) { + if (options == null || options.hashFn == null) { + throw new Error('please define an options.hashFn'); + } + const bucketOptions = { + bits: options.bits ?? 8, + hash: wrapHash(options.hashFn) + }; + return new Bucket(bucketOptions); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/dir-sharded.js -;// CONCATENATED MODULE: ./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base.js -// Linter can't see that API is used in types. -// eslint-disable-next-line -/** - * Class represents both BaseEncoder and MultibaseEncoder meaning it - * can be used to encode to multibase or base encode without multibase - * prefix. - * - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseEncoder} - * @implements {API.BaseEncoder} - */ -class logger_node_modules_multiformats_src_bases_base_Encoder { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(bytes:Uint8Array) => string} baseEncode - */ - constructor (name, prefix, baseEncode) { - this.name = name - this.prefix = prefix - this.baseEncode = baseEncode - } - /** - * @param {Uint8Array} bytes - * @returns {API.Multibase} - */ - encode (bytes) { - if (bytes instanceof Uint8Array) { - return `${this.prefix}${this.baseEncode(bytes)}` - } else { - throw Error('Unknown type, must be binary type') +async function hamtHashFn(buf) { + return (await murmur3128.encode(buf)) + // Murmur3 outputs 128 bit but, accidentally, IPFS Go's + // implementation only uses the first 64, so we must do the same + // for parity.. + .slice(0, 8) + // Invert buffer because that's how Go impl does it + .reverse(); +} +const HAMT_HASH_CODE = BigInt(0x22); +const DEFAULT_FANOUT_BITS = 8; +class DirSharded extends Dir { + _bucket; + constructor(props, options) { + super(props, options); + this._bucket = createHAMT({ + hashFn: hamtHashFn, + bits: options.shardFanoutBits ?? DEFAULT_FANOUT_BITS + }); + } + async put(name, value) { + this.cid = undefined; + this.size = undefined; + this.nodeSize = undefined; + await this._bucket.put(name, value); + } + async get(name) { + return this._bucket.get(name); + } + childCount() { + return this._bucket.leafCount(); + } + directChildrenCount() { + return this._bucket.childrenCount(); + } + onlyChild() { + return this._bucket.onlyChild(); + } + async *eachChildSeries() { + for await (const { key, value } of this._bucket.eachLeafSeries()) { + yield { + key, + child: value + }; + } + } + estimateNodeSize() { + if (this.nodeSize !== undefined) { + return this.nodeSize; + } + this.nodeSize = calculateSize(this._bucket, this, this.options); + return this.nodeSize; + } + async *flush(blockstore) { + for await (const entry of flush(this._bucket, blockstore, this, this.options)) { + yield { + ...entry, + path: this.path + }; + } } - } } - -/** - * @template {string} Prefix - */ -/** - * Class represents both BaseDecoder and MultibaseDecoder so it could be used - * to decode multibases (with matching prefix) or just base decode strings - * with corresponding base encoding. - * - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseDecoder} - * @implements {API.UnibaseDecoder} - * @implements {API.BaseDecoder} - */ -class logger_node_modules_multiformats_src_bases_base_Decoder { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(text:string) => Uint8Array} baseDecode - */ - constructor (name, prefix, baseDecode) { - this.name = name - this.prefix = prefix - /* c8 ignore next 3 */ - if (prefix.codePointAt(0) === undefined) { - throw new Error('Invalid prefix character') +/* harmony default export */ const dir_sharded = (DirSharded); +async function* flush(bucket, blockstore, shardRoot, options) { + const children = bucket._children; + const padLength = (bucket.tableSize() - 1).toString(16).length; + const links = []; + let childrenSize = 0n; + for (let i = 0; i < children.length; i++) { + const child = children.get(i); + if (child == null) { + continue; + } + const labelPrefix = i.toString(16).toUpperCase().padStart(padLength, '0'); + if (child instanceof Bucket) { + let shard; + for await (const subShard of flush(child, blockstore, null, options)) { + shard = subShard; + } + if (shard == null) { + throw new Error('Could not flush sharded directory, no subshard found'); + } + links.push({ + Name: labelPrefix, + Tsize: Number(shard.size), + Hash: shard.cid + }); + childrenSize += shard.size; + } + else if (isDir(child.value)) { + const dir = child.value; + let flushedDir; + for await (const entry of dir.flush(blockstore)) { + flushedDir = entry; + yield flushedDir; + } + if (flushedDir == null) { + throw new Error('Did not flush dir'); + } + const label = labelPrefix + child.key; + links.push({ + Name: label, + Tsize: Number(flushedDir.size), + Hash: flushedDir.cid + }); + childrenSize += flushedDir.size; + } + else { + const value = child.value; + if (value.cid == null) { + continue; + } + const label = labelPrefix + child.key; + const size = value.size; + links.push({ + Name: label, + Tsize: Number(size), + Hash: value.cid + }); + childrenSize += BigInt(size ?? 0); + } } - /** @private */ - this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0)) - this.baseDecode = baseDecode - } - - /** - * @param {string} text - */ - decode (text) { - if (typeof text === 'string') { - if (text.codePointAt(0) !== this.prefixCodePoint) { - throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`) - } - return this.baseDecode(text.slice(this.prefix.length)) - } else { - throw Error('Can only multibase decode strings') + // go-ipfs uses little endian, that's why we have to + // reverse the bit field before storing it + const data = Uint8Array.from(children.bitField().reverse()); + const dir = new src_UnixFS({ + type: 'hamt-sharded-directory', + data, + fanout: BigInt(bucket.tableSize()), + hashType: HAMT_HASH_CODE, + mtime: shardRoot?.mtime, + mode: shardRoot?.mode + }); + const node = { + Data: dir.marshal(), + Links: links + }; + const buffer = src_encode(prepare(node)); + const cid = await persist(buffer, blockstore, options); + const size = BigInt(buffer.byteLength) + childrenSize; + yield { + cid, + unixfs: dir, + size + }; +} +function isDir(obj) { + return typeof obj.flush === 'function'; +} +function calculateSize(bucket, shardRoot, options) { + const children = bucket._children; + const padLength = (bucket.tableSize() - 1).toString(16).length; + const links = []; + for (let i = 0; i < children.length; i++) { + const child = children.get(i); + if (child == null) { + continue; + } + const labelPrefix = i.toString(16).toUpperCase().padStart(padLength, '0'); + if (child instanceof Bucket) { + const size = calculateSize(child, null, options); + links.push({ + Name: labelPrefix, + Tsize: Number(size), + Hash: options.cidVersion === 0 ? CID_V0 : CID_V1 + }); + } + else if (typeof child.value.flush === 'function') { + const dir = child.value; + const size = dir.nodeSize(); + links.push({ + Name: labelPrefix + child.key, + Tsize: Number(size), + Hash: options.cidVersion === 0 ? CID_V0 : CID_V1 + }); + } + else { + const value = child.value; + if (value.cid == null) { + continue; + } + const label = labelPrefix + child.key; + const size = value.size; + links.push({ + Name: label, + Tsize: Number(size), + Hash: value.cid + }); + } } - } - - /** - * @template {string} OtherPrefix - * @param {API.UnibaseDecoder|ComposedDecoder} decoder - * @returns {ComposedDecoder} - */ - or (decoder) { - return logger_node_modules_multiformats_src_bases_base_or(this, decoder) - } + // go-ipfs uses little endian, that's why we have to + // reverse the bit field before storing it + const data = Uint8Array.from(children.bitField().reverse()); + const dir = new src_UnixFS({ + type: 'hamt-sharded-directory', + data, + fanout: BigInt(bucket.tableSize()), + hashType: HAMT_HASH_CODE, + mtime: shardRoot?.mtime, + mode: shardRoot?.mode + }); + const buffer = src_encode(prepare({ + Data: dir.marshal(), + Links: links + })); + return buffer.length; } +//# sourceMappingURL=dir-sharded.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/flat-to-shard.js -/** - * @template {string} Prefix - * @typedef {Record>} Decoders - */ - -/** - * @template {string} Prefix - * @implements {API.MultibaseDecoder} - * @implements {API.CombobaseDecoder} - */ -class logger_node_modules_multiformats_src_bases_base_ComposedDecoder { - /** - * @param {Decoders} decoders - */ - constructor (decoders) { - this.decoders = decoders - } - - /** - * @template {string} OtherPrefix - * @param {API.UnibaseDecoder|ComposedDecoder} decoder - * @returns {ComposedDecoder} - */ - or (decoder) { - return logger_node_modules_multiformats_src_bases_base_or(this, decoder) - } - /** - * @param {string} input - * @returns {Uint8Array} - */ - decode (input) { - const prefix = /** @type {Prefix} */ (input[0]) - const decoder = this.decoders[prefix] - if (decoder) { - return decoder.decode(input) - } else { - throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`) +async function flatToShard(child, dir, threshold, options) { + let newDir = dir; + if (dir instanceof DirFlat && dir.estimateNodeSize() > threshold) { + newDir = await convertToShard(dir, options); } - } + const parent = newDir.parent; + if (parent != null) { + if (newDir !== dir) { + if (child != null) { + child.parent = newDir; + } + if (newDir.parentKey == null) { + throw new Error('No parent key found'); + } + await parent.put(newDir.parentKey, newDir); + } + return flatToShard(newDir, parent, threshold, options); + } + return newDir; +} +async function convertToShard(oldDir, options) { + const newDir = new dir_sharded({ + root: oldDir.root, + dir: true, + parent: oldDir.parent, + parentKey: oldDir.parentKey, + path: oldDir.path, + dirty: oldDir.dirty, + flat: false, + mtime: oldDir.mtime, + mode: oldDir.mode + }, options); + for await (const { key, child } of oldDir.eachChildSeries()) { + await newDir.put(key, child); + } + return newDir; } +//# sourceMappingURL=flat-to-shard.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/utils/to-path-components.js +const toPathComponents = (path = '') => { + // split on / unless escaped with \ + return path.split(/(?|API.CombobaseDecoder} left - * @param {API.UnibaseDecoder|API.CombobaseDecoder} right - * @returns {ComposedDecoder} - */ -const logger_node_modules_multiformats_src_bases_base_or = (left, right) => new logger_node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({ - ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }), - ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right }) -})) -/** - * @class - * @template {string} Base - * @template {string} Prefix - * @implements {API.MultibaseCodec} - * @implements {API.MultibaseEncoder} - * @implements {API.MultibaseDecoder} - * @implements {API.BaseCodec} - * @implements {API.BaseEncoder} - * @implements {API.BaseDecoder} - */ -class logger_node_modules_multiformats_src_bases_base_Codec { - /** - * @param {Base} name - * @param {Prefix} prefix - * @param {(bytes:Uint8Array) => string} baseEncode - * @param {(text:string) => Uint8Array} baseDecode - */ - constructor (name, prefix, baseEncode, baseDecode) { - this.name = name - this.prefix = prefix - this.baseEncode = baseEncode - this.baseDecode = baseDecode - this.encoder = new logger_node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode) - this.decoder = new logger_node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode) - } - /** - * @param {Uint8Array} input - */ - encode (input) { - return this.encoder.encode(input) - } - /** - * @param {string} input - */ - decode (input) { - return this.decoder.decode(input) - } +async function addToTree(elem, tree, options) { + const pathElems = toPathComponents(elem.path ?? ''); + const lastIndex = pathElems.length - 1; + let parent = tree; + let currentPath = ''; + for (let i = 0; i < pathElems.length; i++) { + const pathElem = pathElems[i]; + currentPath += `${currentPath !== '' ? '/' : ''}${pathElem}`; + const last = (i === lastIndex); + parent.dirty = true; + parent.cid = undefined; + parent.size = undefined; + if (last) { + await parent.put(pathElem, elem); + tree = await flatToShard(null, parent, options.shardSplitThresholdBytes, options); + } + else { + let dir = await parent.get(pathElem); + if ((dir == null) || !(dir instanceof Dir)) { + dir = new DirFlat({ + root: false, + dir: true, + parent, + parentKey: pathElem, + path: currentPath, + dirty: true, + flat: true, + mtime: dir?.unixfs?.mtime, + mode: dir?.unixfs?.mode + }, options); + } + await parent.put(pathElem, dir); + parent = dir; + } + } + return tree; } - -/** - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {(bytes:Uint8Array) => string} options.encode - * @param {(input:string) => Uint8Array} options.decode - * @returns {Codec} - */ -const logger_node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) => - new logger_node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode) - -/** - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {string} options.alphabet - * @returns {Codec} - */ -const logger_node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => { - const { encode, decode } = logger_node_modules_multiformats_vendor_base_x(alphabet, name) - return logger_node_modules_multiformats_src_bases_base_from({ - prefix, - name, - encode, - /** - * @param {string} text - */ - decode: text => logger_node_modules_multiformats_src_bytes_coerce(decode(text)) - }) +async function* flushAndYield(tree, blockstore) { + if (!(tree instanceof Dir)) { + if (tree.unixfs?.isDirectory() === true) { + yield tree; + } + return; + } + yield* tree.flush(blockstore); +} +function defaultTreeBuilder(options) { + return async function* treeBuilder(source, block) { + let tree = new DirFlat({ + root: true, + dir: true, + path: '', + dirty: true, + flat: true + }, options); + let rootDir; + let singleRoot = false; + for await (const entry of source) { + if (entry == null) { + continue; + } + // if all paths are from the same root directory, we should + // wrap them all in that root directory + const dir = `${entry.originalPath ?? ''}`.split('/')[0]; + if (dir != null && dir !== '') { + if (rootDir == null) { + rootDir = dir; + singleRoot = true; + } + else if (rootDir !== dir) { + singleRoot = false; + } + } + tree = await addToTree(entry, tree, options); + if (entry.unixfs == null || !entry.unixfs.isDirectory()) { + yield entry; + } + } + if (options.wrapWithDirectory || (singleRoot && tree.childCount() > 1)) { + yield* flushAndYield(tree, block); + } + else { + for await (const unwrapped of tree.eachChildSeries()) { + if (unwrapped == null) { + continue; + } + yield* flushAndYield(unwrapped.child, block); + } + } + }; } +//# sourceMappingURL=tree-builder.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/index.js -/** - * @param {string} string - * @param {string} alphabet - * @param {number} bitsPerChar - * @param {string} name - * @returns {Uint8Array} - */ -const logger_node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => { - // Build the character lookup table: - /** @type {Record} */ - const codes = {} - for (let i = 0; i < alphabet.length; ++i) { - codes[alphabet[i]] = i - } - // Count the padding bytes: - let end = string.length - while (string[end - 1] === '=') { - --end - } - // Allocate the output: - const out = new Uint8Array((end * bitsPerChar / 8) | 0) - // Parse the data: - let bits = 0 // Number of bits currently in the buffer - let buffer = 0 // Bits waiting to be written out, MSB first - let written = 0 // Next byte to write - for (let i = 0; i < end; ++i) { - // Read one character from the string: - const value = codes[string[i]] - if (value === undefined) { - throw new SyntaxError(`Non-${name} character`) - } - // Append the bits to the buffer: - buffer = (buffer << bitsPerChar) | value - bits += bitsPerChar - // Write out some bits if the buffer has a byte's worth: - if (bits >= 8) { - bits -= 8 - out[written++] = 0xff & (buffer >> bits) - } - } - // Verify that we have received just enough bits: - if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) { - throw new SyntaxError('Unexpected end of data') - } - return out -} /** - * @param {Uint8Array} data - * @param {string} alphabet - * @param {number} bitsPerChar - * @returns {string} + * The importer creates UnixFS DAGs and stores the blocks that make + * them up in the passed blockstore. + * + * @example + * + * ```typescript + * import { importer } from 'ipfs-unixfs-importer' + * import { MemoryBlockstore } from 'blockstore-core' + * + * // store blocks in memory, other blockstores are available + * const blockstore = new MemoryBlockstore() + * + * const input = [{ + * path: './foo.txt', + * content: Uint8Array.from([0, 1, 2, 3, 4]) + * }, { + * path: './bar.txt', + * content: Uint8Array.from([0, 1, 2, 3, 4]) + * }] + * + * for await (const entry of importer(input, blockstore)) { + * console.info(entry) + * // { cid: CID(), ... } + * } + * ``` */ -const logger_node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => { - const pad = alphabet[alphabet.length - 1] === '=' - const mask = (1 << bitsPerChar) - 1 - let out = '' - - let bits = 0 // Number of bits currently in the buffer - let buffer = 0 // Bits waiting to be written out, MSB first - for (let i = 0; i < data.length; ++i) { - // Slurp data into the buffer: - buffer = (buffer << 8) | data[i] - bits += 8 - - // Write out as much as we can: - while (bits > bitsPerChar) { - bits -= bitsPerChar - out += alphabet[mask & (buffer >> bits)] +async function* importer(source, blockstore, options = {}) { + let candidates; + if (Symbol.asyncIterator in source || Symbol.iterator in source) { + candidates = source; } - } - - // Partial character: - if (bits) { - out += alphabet[mask & (buffer << (bitsPerChar - bits))] - } - - // Add padding characters until we hit a byte boundary: - if (pad) { - while ((out.length * bitsPerChar) & 7) { - out += '=' + else { + candidates = [source]; + } + const wrapWithDirectory = options.wrapWithDirectory ?? false; + const shardSplitThresholdBytes = options.shardSplitThresholdBytes ?? 262144; + const shardFanoutBits = options.shardFanoutBits ?? 8; + const cidVersion = options.cidVersion ?? 1; + const rawLeaves = options.rawLeaves ?? true; + const leafType = options.leafType ?? 'file'; + const fileImportConcurrency = options.fileImportConcurrency ?? 50; + const blockWriteConcurrency = options.blockWriteConcurrency ?? 10; + const reduceSingleLeafToSelf = options.reduceSingleLeafToSelf ?? true; + const chunker = options.chunker ?? fixedSize(); + const chunkValidator = options.chunkValidator ?? defaultChunkValidator(); + const buildDag = options.dagBuilder ?? defaultDagBuilder({ + chunker, + chunkValidator, + wrapWithDirectory, + layout: options.layout ?? balanced(), + bufferImporter: options.bufferImporter ?? defaultBufferImporter({ + cidVersion, + rawLeaves, + leafType, + onProgress: options.onProgress + }), + blockWriteConcurrency, + reduceSingleLeafToSelf, + cidVersion, + onProgress: options.onProgress + }); + const buildTree = options.treeBuilder ?? defaultTreeBuilder({ + wrapWithDirectory, + shardSplitThresholdBytes, + shardFanoutBits, + cidVersion, + onProgress: options.onProgress + }); + for await (const entry of buildTree(parallelBatch(buildDag(candidates, blockstore), fileImportConcurrency), blockstore)) { + yield { + cid: entry.cid, + path: entry.path, + unixfs: entry.unixfs, + size: entry.size + }; } - } - - return out } - /** - * RFC4648 Factory + * `importFile` is similar to `importer` except it accepts a single + * `FileCandidate` and returns a promise of a single `ImportResult` + * instead of a stream of results. * - * @template {string} Base - * @template {string} Prefix - * @param {object} options - * @param {Base} options.name - * @param {Prefix} options.prefix - * @param {string} options.alphabet - * @param {number} options.bitsPerChar + * @example + * + * ```typescript + * import { importFile } from 'ipfs-unixfs-importer' + * import { MemoryBlockstore } from 'blockstore-core' + * + * // store blocks in memory, other blockstores are available + * const blockstore = new MemoryBlockstore() + * + * const input: FileCandidate = { + * path: './foo.txt', + * content: Uint8Array.from([0, 1, 2, 3, 4]) + * } + * + * const entry = await importFile(input, blockstore) + * ``` */ -const logger_node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => { - return logger_node_modules_multiformats_src_bases_base_from({ - prefix, - name, - encode (input) { - return logger_node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar) - }, - decode (input) { - return logger_node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name) +async function importFile(content, blockstore, options = {}) { + const result = await it_first_dist_src(importer([content], blockstore, options)); + if (result == null) { + throw err_code(new Error('Nothing imported'), 'ERR_INVALID_PARAMS'); } - }) + return result; } - -;// CONCATENATED MODULE: ./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base32.js - - -const logger_node_modules_multiformats_src_bases_base32_base32 = logger_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'b', - name: 'base32', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567', - bitsPerChar: 5 -}) - -const logger_node_modules_multiformats_src_bases_base32_base32upper = logger_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'B', - name: 'base32upper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', - bitsPerChar: 5 -}) - -const logger_node_modules_multiformats_src_bases_base32_base32pad = logger_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'c', - name: 'base32pad', - alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', - bitsPerChar: 5 -}) - -const logger_node_modules_multiformats_src_bases_base32_base32padupper = logger_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'C', - name: 'base32padupper', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', - bitsPerChar: 5 -}) - -const logger_node_modules_multiformats_src_bases_base32_base32hex = logger_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'v', - name: 'base32hex', - alphabet: '0123456789abcdefghijklmnopqrstuv', - bitsPerChar: 5 -}) - -const logger_node_modules_multiformats_src_bases_base32_base32hexupper = logger_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'V', - name: 'base32hexupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', - bitsPerChar: 5 -}) - -const logger_node_modules_multiformats_src_bases_base32_base32hexpad = logger_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 't', - name: 'base32hexpad', - alphabet: '0123456789abcdefghijklmnopqrstuv=', - bitsPerChar: 5 -}) - -const logger_node_modules_multiformats_src_bases_base32_base32hexpadupper = logger_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'T', - name: 'base32hexpadupper', - alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', - bitsPerChar: 5 -}) - -const logger_node_modules_multiformats_src_bases_base32_base32z = logger_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'h', - name: 'base32z', - alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', - bitsPerChar: 5 -}) - -;// CONCATENATED MODULE: ./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base58.js - - -const logger_node_modules_multiformats_src_bases_base58_base58btc = logger_node_modules_multiformats_src_bases_base_baseX({ - name: 'base58btc', - prefix: 'z', - alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' -}) - -const logger_node_modules_multiformats_src_bases_base58_base58flickr = logger_node_modules_multiformats_src_bases_base_baseX({ - name: 'base58flickr', - prefix: 'Z', - alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' -}) - -;// CONCATENATED MODULE: ./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base64.js -// @ts-check - - - -const logger_node_modules_multiformats_src_bases_base64_base64 = logger_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'm', - name: 'base64', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', - bitsPerChar: 6 -}) - -const logger_node_modules_multiformats_src_bases_base64_base64pad = logger_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'M', - name: 'base64pad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', - bitsPerChar: 6 -}) - -const logger_node_modules_multiformats_src_bases_base64_base64url = logger_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'u', - name: 'base64url', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', - bitsPerChar: 6 -}) - -const logger_node_modules_multiformats_src_bases_base64_base64urlpad = logger_node_modules_multiformats_src_bases_base_rfc4648({ - prefix: 'U', - name: 'base64urlpad', - alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=', - bitsPerChar: 6 -}) - -;// CONCATENATED MODULE: ./node_modules/@libp2p/logger/dist/src/index.js /** - * @packageDocumentation - * - * A logger for libp2p based on the venerable [debug](https://www.npmjs.com/package/debug) - * module. + * `importDir` is similar to `importer` except it accepts a single + * `DirectoryCandidate` and returns a promise of a single `ImportResult` + * instead of a stream of results. * * @example * - * ```JavaScript - * import { logger } from '@libp2p/logger' + * ```typescript + * import { importDirectory } from 'ipfs-unixfs-importer' + * import { MemoryBlockstore } from 'blockstore-core' * - * const log = logger('libp2p:my:component:name') + * // store blocks in memory, other blockstores are available + * const blockstore = new MemoryBlockstore() * - * log('something happened: %s', 'it was ok') - * log.error('something bad happened: %o', err) + * const input: DirectoryCandidate = { + * path: './foo.txt' + * } * - * log('with this peer: %p', aPeerId) - * log('and this base58btc: %b', aUint8Array) - * log('and this base32: %t', aUint8Array) - * ``` - * ```console - * $ DEBUG=libp2p:* node index.js - * something happened: it was ok - * something bad happened: - * with this peer: 12D3Foo - * with this base58btc: Qmfoo - * with this base32: bafyfoo + * const entry = await importDirectory(input, blockstore) * ``` */ - - - - - -// Add a formatter for converting to a base58 string -debug_src.formatters.b = (v) => { - return v == null ? 'undefined' : logger_node_modules_multiformats_src_bases_base58_base58btc.baseEncode(v); -}; -// Add a formatter for converting to a base32 string -debug_src.formatters.t = (v) => { - return v == null ? 'undefined' : logger_node_modules_multiformats_src_bases_base32_base32.baseEncode(v); -}; -// Add a formatter for converting to a base64 string -debug_src.formatters.m = (v) => { - return v == null ? 'undefined' : logger_node_modules_multiformats_src_bases_base64_base64.baseEncode(v); -}; -// Add a formatter for stringifying peer ids -debug_src.formatters.p = (v) => { - return v == null ? 'undefined' : v.toString(); -}; -// Add a formatter for stringifying CIDs -debug_src.formatters.c = (v) => { - return v == null ? 'undefined' : v.toString(); -}; -// Add a formatter for stringifying Datastore keys -debug_src.formatters.k = (v) => { - return v == null ? 'undefined' : v.toString(); -}; -// Add a formatter for stringifying Multiaddrs -debug_src.formatters.a = (v) => { - return v == null ? 'undefined' : v.toString(); -}; -function dist_src_createDisabledLogger(namespace) { - const logger = () => { }; - logger.enabled = false; - logger.color = ''; - logger.diff = 0; - logger.log = () => { }; - logger.namespace = namespace; - logger.destroy = () => true; - logger.extend = () => logger; - return logger; +async function importDirectory(content, blockstore, options = {}) { + const result = await it_first_dist_src(importer([content], blockstore, options)); + if (result == null) { + throw err_code(new Error('Nothing imported'), 'ERR_INVALID_PARAMS'); + } + return result; } /** - * Create a component logger that will prefix any log messages with a truncated - * peer id. + * `importBytes` accepts a single Uint8Array and returns a promise + * of a single `ImportResult`. * * @example * - * ```TypeScript - * import { peerLogger } from '@libp2p/logger' - * import { peerIdFromString } from '@libp2p/peer-id' + * ```typescript + * import { importBytes } from 'ipfs-unixfs-importer' + * import { MemoryBlockstore } from 'blockstore-core' * - * const peerId = peerIdFromString('12D3FooBar') - * const logger = peerLogger(peerId) + * // store blocks in memory, other blockstores are available + * const blockstore = new MemoryBlockstore() * - * const log = logger.forComponent('my-component') - * log.info('hello world') - * // logs "12…oBar:my-component hello world" + * const input = Uint8Array.from([0, 1, 2, 3, 4]) + * + * const entry = await importBytes(input, blockstore) * ``` */ -function peerLogger(peerId, options = {}) { - return prefixLogger(truncatePeerId(peerId, options)); +async function importBytes(buf, blockstore, options = {}) { + return importFile({ + content: buf + }, blockstore, options); } /** - * Create a component logger that will prefix any log messages with the passed - * string. + * `importByteStream` accepts a single stream of Uint8Arrays and + * returns a promise of a single `ImportResult`. * * @example * - * ```TypeScript - * import { prefixLogger } from '@libp2p/logger' + * ```typescript + * import { importByteStream } from 'ipfs-unixfs-importer' + * import { MemoryBlockstore } from 'blockstore-core' * - * const logger = prefixLogger('my-node') + * // store blocks in memory, other blockstores are available + * const blockstore = new MemoryBlockstore() * - * const log = logger.forComponent('my-component') - * log.info('hello world') - * // logs "my-node:my-component hello world" + * const input = [ + * Uint8Array.from([0, 1, 2, 3, 4]), + * Uint8Array.from([5, 6, 7, 8, 9]) + * ] + * + * const entry = await importByteStream(input, blockstore) * ``` */ -function prefixLogger(prefix) { - return { - forComponent(name) { - return dist_src_logger(`${prefix}:${name}`); +async function importByteStream(bufs, blockstore, options = {}) { + return importFile({ + content: bufs + }, blockstore, options); +} +//# sourceMappingURL=index.js.map +// EXTERNAL MODULE: ./node_modules/rabin-wasm/src/index.js +var rabin_wasm_src = __nccwpck_require__(92477); +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/chunker/rabin.js + +// @ts-expect-error no types + + +const DEFAULT_MIN_CHUNK_SIZE = 262144; +const DEFAULT_MAX_CHUNK_SIZE = 262144; +const DEFAULT_AVG_CHUNK_SIZE = 262144; +const DEFAULT_WINDOW = 16; +async function* chunker(source, r) { + const buffers = new Uint8ArrayList(); + for await (const chunk of source) { + buffers.append(chunk); + const sizes = r.fingerprint(chunk); + for (let i = 0; i < sizes.length; i++) { + const size = sizes[i]; + const buf = buffers.slice(0, size); + buffers.consume(size); + yield buf; + } + } + if (buffers.length > 0) { + yield buffers.subarray(0); + } +} +const rabin = (options = {}) => { + let min = options.minChunkSize ?? DEFAULT_MIN_CHUNK_SIZE; + let max = options.maxChunkSize ?? DEFAULT_MAX_CHUNK_SIZE; + let avg = options.avgChunkSize ?? DEFAULT_AVG_CHUNK_SIZE; + const window = options.window ?? DEFAULT_WINDOW; + // if only avg was passed, calculate min/max from that + if (options.avgChunkSize != null && options.minChunkSize == null && options.maxChunkSize == null) { + min = avg / 3; + max = avg + (avg / 2); + } + const isInvalidChunkSizes = [min, avg, max].some((size) => size == null || isNaN(size)); + if (isInvalidChunkSizes) { + if (options.avgChunkSize != null) { + throw errcode(new Error('please specify a valid average chunk size number'), 'ERR_INVALID_AVG_CHUNK_SIZE'); + } + throw errcode(new Error('please specify valid numbers for (min|max|avg)ChunkSize'), 'ERR_INVALID_CHUNK_SIZE'); + } + // validate min/max/avg in the same way as go + if (min < 16) { + throw errcode(new Error('rabin min must be greater than 16'), 'ERR_INVALID_MIN_CHUNK_SIZE'); + } + if (max < min) { + max = min; + } + if (avg < min) { + avg = min; + } + const sizepow = Math.floor(Math.log2(avg)); + return async function* rabinChunker(source) { + const r = await create(sizepow, min, max, window); + for await (const chunk of chunker(source, r)) { + yield chunk; + } + }; +}; +//# sourceMappingURL=rabin.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-importer/dist/src/chunker/index.js + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/add.js + + + +/** + * Default importer settings match Filecoin + */ +const defaultImporterSettings = { + cidVersion: 1, + rawLeaves: true, + layout: balanced({ + maxChildrenPerNode: 1024 + }), + chunker: fixedSize({ + chunkSize: 1048576 + }) +}; +async function* addAll(source, blockstore, options = {}) { + yield* importer(source, blockstore, { + ...defaultImporterSettings, + ...options + }); +} +async function addBytes(bytes, blockstore, options = {}) { + const { cid } = await importBytes(bytes, blockstore, { + ...defaultImporterSettings, + ...options + }); + return cid; +} +async function addByteStream(bytes, blockstore, options = {}) { + const { cid } = await importByteStream(bytes, blockstore, { + ...defaultImporterSettings, + ...options + }); + return cid; +} +async function addFile(file, blockstore, options = {}) { + const { cid } = await importFile(file, blockstore, { + ...defaultImporterSettings, + ...options + }); + return cid; +} +async function addDirectory(dir, blockstore, options = {}) { + const { cid } = await importDirectory({ + ...dir, + path: dir.path ?? '-' + }, blockstore, { + ...defaultImporterSettings, + ...options + }); + return cid; +} +//# sourceMappingURL=add.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/bytes.js +const node_modules_multiformats_dist_src_bytes_empty = new Uint8Array(0); +function node_modules_multiformats_dist_src_bytes_toHex(d) { + return d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), ''); +} +function node_modules_multiformats_dist_src_bytes_fromHex(hex) { + const hexes = hex.match(/../g); + return hexes != null ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : node_modules_multiformats_dist_src_bytes_empty; +} +function node_modules_multiformats_dist_src_bytes_equals(aa, bb) { + if (aa === bb) + return true; + if (aa.byteLength !== bb.byteLength) { + return false; + } + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false; + } + } + return true; +} +function ipfs_unixfs_exporter_node_modules_multiformats_dist_src_bytes_coerce(o) { + if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') + return o; + if (o instanceof ArrayBuffer) + return new Uint8Array(o); + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength); + } + throw new Error('Unknown type, must be binary type'); +} +function node_modules_multiformats_dist_src_bytes_isBinary(o) { + return o instanceof ArrayBuffer || ArrayBuffer.isView(o); +} +function node_modules_multiformats_dist_src_bytes_fromString(str) { + return new TextEncoder().encode(str); +} +function ipfs_unixfs_exporter_node_modules_multiformats_dist_src_bytes_toString(b) { + return new TextDecoder().decode(b); +} +//# sourceMappingURL=bytes.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/vendor/base-x.js +/* eslint-disable */ +// base-x encoding / decoding +// Copyright (c) 2018 base-x contributors +// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) +// Distributed under the MIT software license, see the accompanying +// file LICENSE or http://www.opensource.org/licenses/mit-license.php. +/** + * @param {string} ALPHABET + * @param {any} name + */ +function multiformats_dist_src_vendor_base_x_base(ALPHABET, name) { + if (ALPHABET.length >= 255) { + throw new TypeError('Alphabet too long'); + } + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; + } + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { + throw new TypeError(x + ' is ambiguous'); + } + BASE_MAP[xc] = i; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up + var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up + /** + * @param {any[] | Iterable} source + */ + function encode(source) { + // @ts-ignore + if (source instanceof Uint8Array) + ; + else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } + else if (Array.isArray(source)) { + source = Uint8Array.from(source); + } + if (!(source instanceof Uint8Array)) { + throw new TypeError('Expected Uint8Array'); + } + if (source.length === 0) { + return ''; + } + // Skip & count leading zeroes. + var zeroes = 0; + var length = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } + // Allocate enough space in big-endian base58 representation. + var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; + var b58 = new Uint8Array(size); + // Process the bytes. + while (pbegin !== pend) { + var carry = source[pbegin]; + // Apply "b58 = b58 * 256 + ch". + var i = 0; + for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { + carry += (256 * b58[it1]) >>> 0; + b58[it1] = (carry % BASE) >>> 0; + carry = (carry / BASE) >>> 0; + } + if (carry !== 0) { + throw new Error('Non-zero carry'); + } + length = i; + pbegin++; + } + // Skip leading zeroes in base58 result. + var it2 = size - length; + while (it2 !== size && b58[it2] === 0) { + it2++; + } + // Translate the result into a string. + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { + str += ALPHABET.charAt(b58[it2]); + } + return str; + } + /** + * @param {string | string[]} source + */ + function decodeUnsafe(source) { + if (typeof source !== 'string') { + throw new TypeError('Expected String'); + } + if (source.length === 0) { + return new Uint8Array(); + } + var psz = 0; + // Skip leading spaces. + if (source[psz] === ' ') { + return; + } + // Skip and count leading '1's. + var zeroes = 0; + var length = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; } - }; -} -/** - * Create a component logger - * - * @example - * - * ```TypeScript - * import { defaultLogger } from '@libp2p/logger' - * import { peerIdFromString } from '@libp2p/peer-id' - * - * const logger = defaultLogger() - * - * const log = logger.forComponent('my-component') - * log.info('hello world') - * // logs "my-component hello world" - * ``` - */ -function defaultLogger() { - return { - forComponent(name) { - return dist_src_logger(name); + // Allocate enough space in big-endian base256 representation. + var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. + var b256 = new Uint8Array(size); + // Process the characters. + while (source[psz]) { + // Decode character + var carry = BASE_MAP[source.charCodeAt(psz)]; + // Invalid character + if (carry === 255) { + return; + } + var i = 0; + for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { + carry += (BASE * b256[it3]) >>> 0; + b256[it3] = (carry % 256) >>> 0; + carry = (carry / 256) >>> 0; + } + if (carry !== 0) { + throw new Error('Non-zero carry'); + } + length = i; + psz++; + } + // Skip trailing spaces. + if (source[psz] === ' ') { + return; + } + // Skip leading zeroes in b256. + var it4 = size - length; + while (it4 !== size && b256[it4] === 0) { + it4++; + } + var vch = new Uint8Array(zeroes + (size - it4)); + var j = zeroes; + while (it4 !== size) { + vch[j++] = b256[it4++]; + } + return vch; + } + /** + * @param {string | string[]} string + */ + function decode(string) { + var buffer = decodeUnsafe(string); + if (buffer) { + return buffer; } + throw new Error(`Non-${name} character`); + } + return { + encode: encode, + decodeUnsafe: decodeUnsafe, + decode: decode }; } +var multiformats_dist_src_vendor_base_x_src = multiformats_dist_src_vendor_base_x_base; +var multiformats_dist_src_vendor_base_x_brrp_multiformats_scope_baseX = multiformats_dist_src_vendor_base_x_src; +/* harmony default export */ const node_modules_multiformats_dist_src_vendor_base_x = (multiformats_dist_src_vendor_base_x_brrp_multiformats_scope_baseX); +//# sourceMappingURL=base-x.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/bases/base.js + + /** - * Creates a logger for the passed component name. - * - * @example - * - * ```TypeScript - * import { logger } from '@libp2p/logger' - * - * const log = logger('my-component') - * log.info('hello world') - * // logs "my-component hello world" - * ``` + * Class represents both BaseEncoder and MultibaseEncoder meaning it + * can be used to encode to multibase or base encode without multibase + * prefix. */ -function dist_src_logger(name) { - // trace logging is a no-op by default - let trace = dist_src_createDisabledLogger(`${name}:trace`); - // look at all the debug names and see if trace logging has explicitly been enabled - if (debug_src.enabled(`${name}:trace`) && debug_src.names.map(r => r.toString()).find(n => n.includes(':trace')) != null) { - trace = debug_src(`${name}:trace`); +class node_modules_multiformats_dist_src_bases_base_Encoder { + name; + prefix; + baseEncode; + constructor(name, prefix, baseEncode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; } - return Object.assign(debug_src(name), { - error: debug_src(`${name}:error`), - trace - }); -} -function dist_src_disable() { - debug.disable(); -} -function dist_src_enable(namespaces) { - debug.enable(namespaces); -} -function dist_src_enabled(namespaces) { - return debug.enabled(namespaces); -} -//# sourceMappingURL=index.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/consumable-hash.js - -function consumable_hash_wrapHash(hashFn) { - function hashing(value) { - if (value instanceof consumable_hash_InfiniteHash) { - // already a hash. return it - return value; + encode(bytes) { + if (bytes instanceof Uint8Array) { + return `${this.prefix}${this.baseEncode(bytes)}`; } else { - return new consumable_hash_InfiniteHash(value, hashFn); + throw Error('Unknown type, must be binary type'); } } - return hashing; } -class consumable_hash_InfiniteHash { - _value; - _hashFn; - _depth; - _availableBits; - _currentBufferIndex; - _buffers; - constructor(value, hashFn) { - if (!(value instanceof Uint8Array)) { - throw new Error('can only hash Uint8Arrays'); +/** + * Class represents both BaseDecoder and MultibaseDecoder so it could be used + * to decode multibases (with matching prefix) or just base decode strings + * with corresponding base encoding. + */ +class node_modules_multiformats_dist_src_bases_base_Decoder { + name; + prefix; + baseDecode; + prefixCodePoint; + constructor(name, prefix, baseDecode) { + this.name = name; + this.prefix = prefix; + /* c8 ignore next 3 */ + if (prefix.codePointAt(0) === undefined) { + throw new Error('Invalid prefix character'); } - this._value = value; - this._hashFn = hashFn; - this._depth = -1; - this._availableBits = 0; - this._currentBufferIndex = 0; - this._buffers = []; + this.prefixCodePoint = prefix.codePointAt(0); + this.baseDecode = baseDecode; } - async take(bits) { - let pendingBits = bits; - while (this._availableBits < pendingBits) { - await this._produceMoreBits(); - } - let result = 0; - while (pendingBits > 0) { - const hash = this._buffers[this._currentBufferIndex]; - const available = Math.min(hash.availableBits(), pendingBits); - const took = hash.take(available); - result = (result << available) + took; - pendingBits -= available; - this._availableBits -= available; - if (hash.availableBits() === 0) { - this._currentBufferIndex++; + decode(text) { + if (typeof text === 'string') { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); } + return this.baseDecode(text.slice(this.prefix.length)); } - return result; - } - untake(bits) { - let pendingBits = bits; - while (pendingBits > 0) { - const hash = this._buffers[this._currentBufferIndex]; - const availableForUntake = Math.min(hash.totalBits() - hash.availableBits(), pendingBits); - hash.untake(availableForUntake); - pendingBits -= availableForUntake; - this._availableBits += availableForUntake; - if (this._currentBufferIndex > 0 && hash.totalBits() === hash.availableBits()) { - this._depth--; - this._currentBufferIndex--; - } + else { + throw Error('Can only multibase decode strings'); } } - async _produceMoreBits() { - this._depth++; - const value = this._depth > 0 ? uint8arrays_dist_src_concat_concat([this._value, Uint8Array.from([this._depth])]) : this._value; - const hashValue = await this._hashFn(value); - const buffer = new consumable_hash_ConsumableBuffer(hashValue); - this._buffers.push(buffer); - this._availableBits += buffer.availableBits(); + or(decoder) { + return node_modules_multiformats_dist_src_bases_base_or(this, decoder); } } -const consumable_hash_START_MASKS = [ - 0b11111111, - 0b11111110, - 0b11111100, - 0b11111000, - 0b11110000, - 0b11100000, - 0b11000000, - 0b10000000 -]; -const consumable_hash_STOP_MASKS = [ - 0b00000001, - 0b00000011, - 0b00000111, - 0b00001111, - 0b00011111, - 0b00111111, - 0b01111111, - 0b11111111 -]; -class consumable_hash_ConsumableBuffer { - _value; - _currentBytePos; - _currentBitPos; - constructor(value) { - this._value = value; - this._currentBytePos = value.length - 1; - this._currentBitPos = 7; - } - availableBits() { - return this._currentBitPos + 1 + this._currentBytePos * 8; +class node_modules_multiformats_dist_src_bases_base_ComposedDecoder { + decoders; + constructor(decoders) { + this.decoders = decoders; } - totalBits() { - return this._value.length * 8; + or(decoder) { + return node_modules_multiformats_dist_src_bases_base_or(this, decoder); } - take(bits) { - let pendingBits = bits; - let result = 0; - while (pendingBits > 0 && this._haveBits()) { - const byte = this._value[this._currentBytePos]; - const availableBits = this._currentBitPos + 1; - const taking = Math.min(availableBits, pendingBits); - const value = consumable_hash_byteBitsToInt(byte, availableBits - taking, taking); - result = (result << taking) + value; - pendingBits -= taking; - this._currentBitPos -= taking; - if (this._currentBitPos < 0) { - this._currentBitPos = 7; - this._currentBytePos--; - } + decode(input) { + const prefix = input[0]; + const decoder = this.decoders[prefix]; + if (decoder != null) { + return decoder.decode(input); } - return result; - } - untake(bits) { - this._currentBitPos += bits; - while (this._currentBitPos > 7) { - this._currentBitPos -= 8; - this._currentBytePos += 1; + else { + throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); } } - _haveBits() { - return this._currentBytePos >= 0; - } -} -function consumable_hash_byteBitsToInt(byte, start, length) { - const mask = consumable_hash_maskFor(start, length); - return (byte & mask) >>> start; -} -function consumable_hash_maskFor(start, length) { - return consumable_hash_START_MASKS[start] & consumable_hash_STOP_MASKS[Math.min(length + start - 1, 7)]; -} -//# sourceMappingURL=consumable-hash.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/hamt-constants.js - -const hamtHashCode = BigInt(murmur3128.code); -const hamtBucketBits = 8; -async function hamt_constants_hamtHashFn(buf) { - return (await murmur3128.encode(buf)) - // Murmur3 outputs 128 bit but, accidentally, IPFS Go's - // implementation only uses the first 64, so we must do the same - // for parity.. - .subarray(0, 8) - // Invert buffer because that's how Go impl does it - .reverse(); } -//# sourceMappingURL=hamt-constants.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/persist.js - - - -const persist_persist = async (buffer, blockstore, options) => { - if (options.codec == null) { - options.codec = src_namespaceObject; - } - const multihash = await unixfs_node_modules_multiformats_src_hashes_sha2_sha256.digest(buffer); - const cid = unixfs_node_modules_multiformats_src_cid_CID.create(options.cidVersion, options.codec.code, multihash); - await blockstore.put(cid, buffer, { - ...options, - signal: options.signal +function node_modules_multiformats_dist_src_bases_base_or(left, right) { + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + return new node_modules_multiformats_dist_src_bases_base_ComposedDecoder({ + ...(left.decoders ?? { [left.prefix]: left }), + ...(right.decoders ?? { [right.prefix]: right }) }); - return cid; -}; -//# sourceMappingURL=persist.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/dir-sharded.js - - - - - - -class dir_sharded_Dir { - options; - root; - dir; - path; - dirty; - flat; - parent; - parentKey; - unixfs; - mode; - mtime; - cid; - size; - nodeSize; - constructor(props, options) { - this.options = options ?? {}; - this.root = props.root; - this.dir = props.dir; - this.path = props.path; - this.dirty = props.dirty; - this.flat = props.flat; - this.parent = props.parent; - this.parentKey = props.parentKey; - this.unixfs = props.unixfs; - this.mode = props.mode; - this.mtime = props.mtime; - } } -class dir_sharded_DirSharded extends dir_sharded_Dir { - _bucket; - constructor(props, options) { - super(props, options); - this._bucket = createHAMT({ - hashFn: hamt_constants_hamtHashFn, - bits: 8 - }); - } - async put(name, value) { - this.cid = undefined; - this.size = undefined; - this.nodeSize = undefined; - await this._bucket.put(name, value); +class node_modules_multiformats_dist_src_bases_base_Codec { + name; + prefix; + baseEncode; + baseDecode; + encoder; + decoder; + constructor(name, prefix, baseEncode, baseDecode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + this.baseDecode = baseDecode; + this.encoder = new node_modules_multiformats_dist_src_bases_base_Encoder(name, prefix, baseEncode); + this.decoder = new node_modules_multiformats_dist_src_bases_base_Decoder(name, prefix, baseDecode); } - async get(name) { - return this._bucket.get(name); + encode(input) { + return this.encoder.encode(input); } - childCount() { - return this._bucket.leafCount(); + decode(input) { + return this.decoder.decode(input); } - directChildrenCount() { - return this._bucket.childrenCount(); +} +function node_modules_multiformats_dist_src_bases_base_from({ name, prefix, encode, decode }) { + return new node_modules_multiformats_dist_src_bases_base_Codec(name, prefix, encode, decode); +} +function node_modules_multiformats_dist_src_bases_base_baseX({ name, prefix, alphabet }) { + const { encode, decode } = node_modules_multiformats_dist_src_vendor_base_x(alphabet, name); + return node_modules_multiformats_dist_src_bases_base_from({ + prefix, + name, + encode, + decode: (text) => ipfs_unixfs_exporter_node_modules_multiformats_dist_src_bytes_coerce(decode(text)) + }); +} +function node_modules_multiformats_dist_src_bases_base_decode(string, alphabet, bitsPerChar, name) { + // Build the character lookup table: + const codes = {}; + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i; } - onlyChild() { - return this._bucket.onlyChild(); + // Count the padding bytes: + let end = string.length; + while (string[end - 1] === '=') { + --end; } - async *eachChildSeries() { - for await (const { key, value } of this._bucket.eachLeafSeries()) { - yield { - key, - child: value - }; + // Allocate the output: + const out = new Uint8Array((end * bitsPerChar / 8) | 0); + // Parse the data: + let bits = 0; // Number of bits currently in the buffer + let buffer = 0; // Bits waiting to be written out, MSB first + let written = 0; // Next byte to write + for (let i = 0; i < end; ++i) { + // Read one character from the string: + const value = codes[string[i]]; + if (value === undefined) { + throw new SyntaxError(`Non-${name} character`); } - } - estimateNodeSize() { - if (this.nodeSize !== undefined) { - return this.nodeSize; + // Append the bits to the buffer: + buffer = (buffer << bitsPerChar) | value; + bits += bitsPerChar; + // Write out some bits if the buffer has a byte's worth: + if (bits >= 8) { + bits -= 8; + out[written++] = 0xff & (buffer >> bits); } - this.nodeSize = dir_sharded_calculateSize(this._bucket, this, this.options); - return this.nodeSize; } - async *flush(blockstore) { - for await (const entry of dir_sharded_flush(this._bucket, blockstore, this, this.options)) { - yield { - ...entry, - path: this.path - }; - } + // Verify that we have received just enough bits: + if (bits >= bitsPerChar || (0xff & (buffer << (8 - bits))) !== 0) { + throw new SyntaxError('Unexpected end of data'); } + return out; } -async function* dir_sharded_flush(bucket, blockstore, shardRoot, options) { - const children = bucket._children; - const links = []; - let childrenSize = 0n; - for (let i = 0; i < children.length; i++) { - const child = children.get(i); - if (child == null) { - continue; - } - const labelPrefix = i.toString(16).toUpperCase().padStart(2, '0'); - if (child instanceof Bucket) { - let shard; - for await (const subShard of dir_sharded_flush(child, blockstore, null, options)) { - shard = subShard; - } - if (shard == null) { - throw new Error('Could not flush sharded directory, no subshard found'); - } - links.push({ - Name: labelPrefix, - Tsize: Number(shard.size), - Hash: shard.cid - }); - childrenSize += shard.size; - } - else if (dir_sharded_isDir(child.value)) { - const dir = child.value; - let flushedDir; - for await (const entry of dir.flush(blockstore)) { - flushedDir = entry; - yield flushedDir; - } - if (flushedDir == null) { - throw new Error('Did not flush dir'); - } - const label = labelPrefix + child.key; - links.push({ - Name: label, - Tsize: Number(flushedDir.size), - Hash: flushedDir.cid - }); - childrenSize += flushedDir.size; +function node_modules_multiformats_dist_src_bases_base_encode(data, alphabet, bitsPerChar) { + const pad = alphabet[alphabet.length - 1] === '='; + const mask = (1 << bitsPerChar) - 1; + let out = ''; + let bits = 0; // Number of bits currently in the buffer + let buffer = 0; // Bits waiting to be written out, MSB first + for (let i = 0; i < data.length; ++i) { + // Slurp data into the buffer: + buffer = (buffer << 8) | data[i]; + bits += 8; + // Write out as much as we can: + while (bits > bitsPerChar) { + bits -= bitsPerChar; + out += alphabet[mask & (buffer >> bits)]; } - else { - const value = child.value; - if (value.cid == null) { - continue; - } - const label = labelPrefix + child.key; - const size = value.size; - links.push({ - Name: label, - Tsize: Number(size), - Hash: value.cid - }); - childrenSize += BigInt(size ?? 0); + } + // Partial character: + if (bits !== 0) { + out += alphabet[mask & (buffer << (bitsPerChar - bits))]; + } + // Add padding characters until we hit a byte boundary: + if (pad) { + while (((out.length * bitsPerChar) & 7) !== 0) { + out += '='; } } - // go-ipfs uses little endian, that's why we have to - // reverse the bit field before storing it - const data = Uint8Array.from(children.bitField().reverse()); - const dir = new src_UnixFS({ - type: 'hamt-sharded-directory', - data, - fanout: BigInt(bucket.tableSize()), - hashType: hamtHashCode, - mtime: shardRoot?.mtime, - mode: shardRoot?.mode - }); - const node = { - Data: dir.marshal(), - Links: links - }; - const buffer = src_encode(prepare(node)); - const cid = await persist_persist(buffer, blockstore, options); - const size = BigInt(buffer.byteLength) + childrenSize; - yield { - cid, - unixfs: dir, - size - }; -} -function dir_sharded_isDir(obj) { - return typeof obj.flush === 'function'; + return out; } -function dir_sharded_calculateSize(bucket, shardRoot, options) { - const children = bucket._children; - const links = []; - for (let i = 0; i < children.length; i++) { - const child = children.get(i); - if (child == null) { - continue; - } - const labelPrefix = i.toString(16).toUpperCase().padStart(2, '0'); - if (child instanceof Bucket) { - const size = dir_sharded_calculateSize(child, null, options); - links.push({ - Name: labelPrefix, - Tsize: Number(size), - Hash: options.cidVersion === 0 ? dir_sharded_CID_V0 : dir_sharded_CID_V1 - }); - } - else if (typeof child.value.flush === 'function') { - const dir = child.value; - const size = dir.nodeSize(); - links.push({ - Name: labelPrefix + child.key, - Tsize: Number(size), - Hash: options.cidVersion === 0 ? dir_sharded_CID_V0 : dir_sharded_CID_V1 - }); - } - else { - const value = child.value; - if (value.cid == null) { - continue; - } - const label = labelPrefix + child.key; - const size = value.size; - links.push({ - Name: label, - Tsize: Number(size), - Hash: value.cid - }); +/** + * RFC4648 Factory + */ +function node_modules_multiformats_dist_src_bases_base_rfc4648({ name, prefix, bitsPerChar, alphabet }) { + return node_modules_multiformats_dist_src_bases_base_from({ + prefix, + name, + encode(input) { + return node_modules_multiformats_dist_src_bases_base_encode(input, alphabet, bitsPerChar); + }, + decode(input) { + return node_modules_multiformats_dist_src_bases_base_decode(input, alphabet, bitsPerChar, name); } - } - // go-ipfs uses little endian, that's why we have to - // reverse the bit field before storing it - const data = Uint8Array.from(children.bitField().reverse()); - const dir = new src_UnixFS({ - type: 'hamt-sharded-directory', - data, - fanout: BigInt(bucket.tableSize()), - hashType: hamtHashCode, - mtime: shardRoot?.mtime, - mode: shardRoot?.mode }); - const buffer = src_encode(prepare({ - Data: dir.marshal(), - Links: links - })); - return buffer.length; } -// we use these to calculate the node size to use as a check for whether a directory -// should be sharded or not. Since CIDs have a constant length and We're only -// interested in the data length and not the actual content identifier we can use -// any old CID instead of having to hash the data which is expensive. -const dir_sharded_CID_V0 = unixfs_node_modules_multiformats_src_cid_CID.parse('QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn'); -const dir_sharded_CID_V1 = unixfs_node_modules_multiformats_src_cid_CID.parse('zdj7WbTaiJT1fgatdet9Ei9iDB5hdCxkbVyhyh8YTUnXMiwYi'); -//# sourceMappingURL=dir-sharded.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/hamt-utils.js - - - - -// @ts-expect-error no types - - - - +//# sourceMappingURL=base.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/bases/base32.js +const node_modules_multiformats_dist_src_bases_base32_base32 = node_modules_multiformats_dist_src_bases_base_rfc4648({ + prefix: 'b', + name: 'base32', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567', + bitsPerChar: 5 +}); +const node_modules_multiformats_dist_src_bases_base32_base32upper = node_modules_multiformats_dist_src_bases_base_rfc4648({ + prefix: 'B', + name: 'base32upper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', + bitsPerChar: 5 +}); +const node_modules_multiformats_dist_src_bases_base32_base32pad = node_modules_multiformats_dist_src_bases_base_rfc4648({ + prefix: 'c', + name: 'base32pad', + alphabet: 'abcdefghijklmnopqrstuvwxyz234567=', + bitsPerChar: 5 +}); +const node_modules_multiformats_dist_src_bases_base32_base32padupper = node_modules_multiformats_dist_src_bases_base_rfc4648({ + prefix: 'C', + name: 'base32padupper', + alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=', + bitsPerChar: 5 +}); +const node_modules_multiformats_dist_src_bases_base32_base32hex = node_modules_multiformats_dist_src_bases_base_rfc4648({ + prefix: 'v', + name: 'base32hex', + alphabet: '0123456789abcdefghijklmnopqrstuv', + bitsPerChar: 5 +}); +const node_modules_multiformats_dist_src_bases_base32_base32hexupper = node_modules_multiformats_dist_src_bases_base_rfc4648({ + prefix: 'V', + name: 'base32hexupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV', + bitsPerChar: 5 +}); +const node_modules_multiformats_dist_src_bases_base32_base32hexpad = node_modules_multiformats_dist_src_bases_base_rfc4648({ + prefix: 't', + name: 'base32hexpad', + alphabet: '0123456789abcdefghijklmnopqrstuv=', + bitsPerChar: 5 +}); +const node_modules_multiformats_dist_src_bases_base32_base32hexpadupper = node_modules_multiformats_dist_src_bases_base_rfc4648({ + prefix: 'T', + name: 'base32hexpadupper', + alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=', + bitsPerChar: 5 +}); +const node_modules_multiformats_dist_src_bases_base32_base32z = node_modules_multiformats_dist_src_bases_base_rfc4648({ + prefix: 'h', + name: 'base32z', + alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769', + bitsPerChar: 5 +}); +//# sourceMappingURL=base32.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/bases/base58.js -const hamt_utils_log = dist_src_logger('helia:unixfs:commands:utils:hamt-utils'); -const hamt_utils_toPrefix = (position) => { - return position - .toString(16) - .toUpperCase() - .padStart(2, '0') - .substring(0, 2); -}; -const createShard = async (blockstore, contents, options) => { - const shard = new dir_sharded_DirSharded({ - root: true, - dir: true, - parent: undefined, - parentKey: undefined, - path: '', - dirty: true, - flat: false, - mtime: options.mtime, - mode: options.mode - }, options); - for (let i = 0; i < contents.length; i++) { - await shard._bucket.put(contents[i].name, { - size: contents[i].size, - cid: contents[i].cid - }); +const node_modules_multiformats_dist_src_bases_base58_base58btc = node_modules_multiformats_dist_src_bases_base_baseX({ + name: 'base58btc', + prefix: 'z', + alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +}); +const node_modules_multiformats_dist_src_bases_base58_base58flickr = node_modules_multiformats_dist_src_bases_base_baseX({ + name: 'base58flickr', + prefix: 'Z', + alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' +}); +//# sourceMappingURL=base58.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/vendor/varint.js +/* eslint-disable */ +var multiformats_dist_src_vendor_varint_encode_1 = node_modules_multiformats_dist_src_vendor_varint_encode; +var multiformats_dist_src_vendor_varint_MSB = 0x80, multiformats_dist_src_vendor_varint_REST = 0x7F, multiformats_dist_src_vendor_varint_MSBALL = ~multiformats_dist_src_vendor_varint_REST, multiformats_dist_src_vendor_varint_INT = Math.pow(2, 31); +/** + * @param {number} num + * @param {number[]} out + * @param {number} offset + */ +function node_modules_multiformats_dist_src_vendor_varint_encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; + while (num >= multiformats_dist_src_vendor_varint_INT) { + out[offset++] = (num & 0xFF) | multiformats_dist_src_vendor_varint_MSB; + num /= 128; } - const res = await dist_src(shard.flush(blockstore)); - if (res == null) { - throw new Error('Flushing shard yielded no result'); + while (num & multiformats_dist_src_vendor_varint_MSBALL) { + out[offset++] = (num & 0xFF) | multiformats_dist_src_vendor_varint_MSB; + num >>>= 7; } - return res; -}; -const updateShardedDirectory = async (path, blockstore, options) => { - // persist any metadata on the shard root - const shardRoot = src_UnixFS.unmarshal(path[0].node.Data ?? new Uint8Array(0)); - // this is always the same - const fanout = BigInt(Math.pow(2, hamtBucketBits)); - // start from the leaf and ascend to the root - path.reverse(); - let cid; - let node; - for (let i = 0; i < path.length; i++) { - const isRoot = i === path.length - 1; - const segment = path[i]; - // go-ipfs uses little endian, that's why we have to - // reverse the bit field before storing it - const data = Uint8Array.from(segment.children.bitField().reverse()); - const dir = new src_UnixFS({ - type: 'hamt-sharded-directory', - data, - fanout, - hashType: hamtHashCode - }); - if (isRoot) { - dir.mtime = shardRoot.mtime; - dir.mode = shardRoot.mode; - } - node = { - Data: dir.marshal(), - Links: segment.node.Links - }; - const block = src_encode(prepare(node)); - cid = await persist_persist(block, blockstore, options); - if (!isRoot) { - // update link in parent sub-shard - const nextSegment = path[i + 1]; - if (nextSegment == null) { - throw new Error('Was not operating on shard root but also had no parent?'); - } - hamt_utils_log('updating link in parent sub-shard with prefix %s', nextSegment.prefix); - nextSegment.node.Links = nextSegment.node.Links.filter(l => l.Name !== nextSegment.prefix); - nextSegment.node.Links.push({ - Name: nextSegment.prefix, - Hash: cid, - Tsize: segment.node.Links.reduce((acc, curr) => acc + (curr.Tsize ?? 0), block.byteLength) - }); + out[offset] = num | 0; + // @ts-ignore + node_modules_multiformats_dist_src_vendor_varint_encode.bytes = offset - oldOffset + 1; + return out; +} +var node_modules_multiformats_dist_src_vendor_varint_decode = multiformats_dist_src_vendor_varint_read; +var multiformats_dist_src_vendor_varint_MSB$1 = 0x80, multiformats_dist_src_vendor_varint_REST$1 = 0x7F; +/** + * @param {string | any[]} buf + * @param {number} offset + */ +function multiformats_dist_src_vendor_varint_read(buf, offset) { + var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length; + do { + if (counter >= l) { + // @ts-ignore + multiformats_dist_src_vendor_varint_read.bytes = 0; + throw new RangeError('Could not decode varint'); } - } - if (cid == null || node == null) { - throw new Error('Noting persisted'); - } - return { cid, node }; + b = buf[counter++]; + res += shift < 28 + ? (b & multiformats_dist_src_vendor_varint_REST$1) << shift + : (b & multiformats_dist_src_vendor_varint_REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= multiformats_dist_src_vendor_varint_MSB$1); + // @ts-ignore + multiformats_dist_src_vendor_varint_read.bytes = counter - offset; + return res; +} +var multiformats_dist_src_vendor_varint_N1 = Math.pow(2, 7); +var multiformats_dist_src_vendor_varint_N2 = Math.pow(2, 14); +var multiformats_dist_src_vendor_varint_N3 = Math.pow(2, 21); +var multiformats_dist_src_vendor_varint_N4 = Math.pow(2, 28); +var multiformats_dist_src_vendor_varint_N5 = Math.pow(2, 35); +var multiformats_dist_src_vendor_varint_N6 = Math.pow(2, 42); +var multiformats_dist_src_vendor_varint_N7 = Math.pow(2, 49); +var multiformats_dist_src_vendor_varint_N8 = Math.pow(2, 56); +var multiformats_dist_src_vendor_varint_N9 = Math.pow(2, 63); +var node_modules_multiformats_dist_src_vendor_varint_length = function (/** @type {number} */ value) { + return (value < multiformats_dist_src_vendor_varint_N1 ? 1 + : value < multiformats_dist_src_vendor_varint_N2 ? 2 + : value < multiformats_dist_src_vendor_varint_N3 ? 3 + : value < multiformats_dist_src_vendor_varint_N4 ? 4 + : value < multiformats_dist_src_vendor_varint_N5 ? 5 + : value < multiformats_dist_src_vendor_varint_N6 ? 6 + : value < multiformats_dist_src_vendor_varint_N7 ? 7 + : value < multiformats_dist_src_vendor_varint_N8 ? 8 + : value < multiformats_dist_src_vendor_varint_N9 ? 9 + : 10); }; -const recreateShardedDirectory = async (cid, fileName, blockstore, options) => { - const wrapped = consumable_hash_wrapHash(hamt_constants_hamtHashFn); - const hash = wrapped(unixfs_node_modules_uint8arrays_dist_src_from_string_fromString(fileName)); - const path = []; - // descend the HAMT, loading each layer as we head towards the target child - while (true) { - const block = await blockstore.get(cid, options); - const node = src_decode(block); - const children = new sparse_array(); - const index = await hash.take(hamtBucketBits); - const prefix = hamt_utils_toPrefix(index); - path.push({ - prefix, - children, - node - }); - let childLink; - // update sparsearray child layout - the bitfield is used as the data field for the - // intermediate DAG node so this is required to generate consistent hashes - for (const link of node.Links) { - const linkName = link.Name ?? ''; - if (linkName.length < 2) { - throw new Error('Invalid HAMT - link name was too short'); - } - const position = parseInt(linkName.substring(0, 2), 16); - children.set(position, true); - // we found the child we are looking for - if (linkName.startsWith(prefix)) { - childLink = link; - } - } - if (childLink == null) { - hamt_utils_log('no link found with prefix %s for %s', prefix, fileName); - // hash.untake(hamtBucketBits) - break; - } - const linkName = childLink.Name ?? ''; - if (linkName.length < 2) { - throw new Error('Invalid HAMT - link name was too short'); - } - if (linkName.length === 2) { - // found sub-shard - cid = childLink.Hash; - hamt_utils_log('descend into sub-shard with prefix %s', linkName); - continue; - } - break; - } - return { path, hash }; +var node_modules_multiformats_dist_src_vendor_varint_varint = { + encode: multiformats_dist_src_vendor_varint_encode_1, + decode: node_modules_multiformats_dist_src_vendor_varint_decode, + encodingLength: node_modules_multiformats_dist_src_vendor_varint_length }; -//# sourceMappingURL=hamt-utils.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/is-over-shard-threshold.js +var multiformats_dist_src_vendor_varint_brrp_varint = node_modules_multiformats_dist_src_vendor_varint_varint; +/* harmony default export */ const ipfs_unixfs_exporter_node_modules_multiformats_dist_src_vendor_varint = (multiformats_dist_src_vendor_varint_brrp_varint); +//# sourceMappingURL=varint.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/varint.js +function ipfs_unixfs_exporter_node_modules_multiformats_dist_src_varint_decode(data, offset = 0) { + const code = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_vendor_varint.decode(data, offset); + return [code, ipfs_unixfs_exporter_node_modules_multiformats_dist_src_vendor_varint.decode.bytes]; +} +function node_modules_multiformats_dist_src_varint_encodeTo(int, target, offset = 0) { + ipfs_unixfs_exporter_node_modules_multiformats_dist_src_vendor_varint.encode(int, target, offset); + return target; +} +function node_modules_multiformats_dist_src_varint_encodingLength(int) { + return ipfs_unixfs_exporter_node_modules_multiformats_dist_src_vendor_varint.encodingLength(int); +} +//# sourceMappingURL=varint.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/hashes/digest.js /** - * Estimate node size only based on DAGLink name and CID byte lengths - * https://github.com/ipfs/go-unixfsnode/blob/37b47f1f917f1b2f54c207682f38886e49896ef9/data/builder/directory.go#L81-L96 - * - * If the node is a hamt sharded directory the calculation is based on if it was a regular directory. + * Creates a multihash digest. */ -async function isOverShardThreshold(node, blockstore, threshold, options) { - if (node.Data == null) { - throw new Error('DagPB node had no data'); - } - const unixfs = src_UnixFS.unmarshal(node.Data); - let size; - if (unixfs.type === 'directory') { - size = estimateNodeSize(node); - } - else if (unixfs.type === 'hamt-sharded-directory') { - size = await estimateShardSize(node, 0, threshold, blockstore, options); - } - else { - throw new Error('Can only estimate the size of directories or shards'); - } - return size > threshold; +function node_modules_multiformats_dist_src_hashes_digest_create(code, digest) { + const size = digest.byteLength; + const sizeOffset = node_modules_multiformats_dist_src_varint_encodingLength(code); + const digestOffset = sizeOffset + node_modules_multiformats_dist_src_varint_encodingLength(size); + const bytes = new Uint8Array(digestOffset + size); + node_modules_multiformats_dist_src_varint_encodeTo(code, bytes, 0); + node_modules_multiformats_dist_src_varint_encodeTo(size, bytes, sizeOffset); + bytes.set(digest, digestOffset); + return new node_modules_multiformats_dist_src_hashes_digest_Digest(code, size, digest, bytes); } -function estimateNodeSize(node) { - let size = 0; - // estimate size only based on DAGLink name and CID byte lengths - // https://github.com/ipfs/go-unixfsnode/blob/37b47f1f917f1b2f54c207682f38886e49896ef9/data/builder/directory.go#L81-L96 - for (const link of node.Links) { - size += (link.Name ?? '').length; - size += link.Hash.version === 1 ? dir_sharded_CID_V1.bytes.byteLength : dir_sharded_CID_V0.bytes.byteLength; +/** + * Turns bytes representation of multihash digest into an instance. + */ +function node_modules_multiformats_dist_src_hashes_digest_decode(multihash) { + const bytes = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_bytes_coerce(multihash); + const [code, sizeOffset] = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_varint_decode(bytes); + const [size, digestOffset] = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_varint_decode(bytes.subarray(sizeOffset)); + const digest = bytes.subarray(sizeOffset + digestOffset); + if (digest.byteLength !== size) { + throw new Error('Incorrect length'); } - return size; + return new node_modules_multiformats_dist_src_hashes_digest_Digest(code, size, digest, bytes); } -async function estimateShardSize(node, current, max, blockstore, options) { - if (current > max) { - return max; - } - if (node.Data == null) { - return current; - } - const unixfs = src_UnixFS.unmarshal(node.Data); - if (!unixfs.isDirectory()) { - return current; +function node_modules_multiformats_dist_src_hashes_digest_equals(a, b) { + if (a === b) { + return true; } - for (const link of node.Links) { - let name = link.Name ?? ''; - // remove hamt hash prefix from name - name = name.substring(2); - current += name.length; - current += link.Hash.bytes.byteLength; - if (link.Hash.code === code) { - const block = await blockstore.get(link.Hash, options); - const node = src_decode(block); - current += await estimateShardSize(node, current, max, blockstore, options); - } + else { + const data = b; + return (a.code === data.code && + a.size === data.size && + data.bytes instanceof Uint8Array && + node_modules_multiformats_dist_src_bytes_equals(a.bytes, data.bytes)); } - return current; } -//# sourceMappingURL=is-over-shard-threshold.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/add-link.js - - - - - -// @ts-expect-error no types - +/** + * Represents a multihash digest which carries information about the + * hashing algorithm and an actual hash digest. + */ +class node_modules_multiformats_dist_src_hashes_digest_Digest { + code; + size; + digest; + bytes; + /** + * Creates a multihash digest. + */ + constructor(code, size, digest, bytes) { + this.code = code; + this.size = size; + this.digest = digest; + this.bytes = bytes; + } +} +//# sourceMappingURL=digest.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/cid.js +// This way TS will also expose all the types from module -const add_link_log = dist_src_logger('helia:unixfs:components:utils:add-link'); -async function addLink(parent, child, blockstore, options) { - if (parent.node.Data == null) { - throw new errors_InvalidParametersError('Invalid parent passed to addLink'); - } - const meta = src_UnixFS.unmarshal(parent.node.Data); - if (meta.type === 'hamt-sharded-directory') { - add_link_log('adding link to sharded directory'); - return addToShardedDirectory(parent, child, blockstore, options); - } - add_link_log(`adding ${child.Name} (${child.Hash}) to regular directory`); - const result = await addToDirectory(parent, child, blockstore, options); - if (await isOverShardThreshold(result.node, blockstore, options.shardSplitThresholdBytes, options)) { - add_link_log('converting directory to sharded directory'); - const converted = await convertToShardedDirectory(result, blockstore); - result.cid = converted.cid; - result.node = src_decode(await blockstore.get(converted.cid, options)); +function node_modules_multiformats_dist_src_cid_format(link, base) { + const { bytes, version } = link; + switch (version) { + case 0: + return node_modules_multiformats_dist_src_cid_toStringV0(bytes, node_modules_multiformats_dist_src_cid_baseCache(link), base ?? node_modules_multiformats_dist_src_bases_base58_base58btc.encoder); + default: + return node_modules_multiformats_dist_src_cid_toStringV1(bytes, node_modules_multiformats_dist_src_cid_baseCache(link), (base ?? node_modules_multiformats_dist_src_bases_base32_base32.encoder)); } - return result; } -const convertToShardedDirectory = async (parent, blockstore) => { - if (parent.node.Data == null) { - throw new errors_InvalidParametersError('Invalid parent passed to convertToShardedDirectory'); +function node_modules_multiformats_dist_src_cid_toJSON(link) { + return { + '/': node_modules_multiformats_dist_src_cid_format(link) + }; +} +function node_modules_multiformats_dist_src_cid_fromJSON(json) { + return ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.parse(json['/']); +} +const node_modules_multiformats_dist_src_cid_cache = new WeakMap(); +function node_modules_multiformats_dist_src_cid_baseCache(cid) { + const baseCache = node_modules_multiformats_dist_src_cid_cache.get(cid); + if (baseCache == null) { + const baseCache = new Map(); + node_modules_multiformats_dist_src_cid_cache.set(cid, baseCache); + return baseCache; } - const unixfs = src_UnixFS.unmarshal(parent.node.Data); - const result = await createShard(blockstore, parent.node.Links.map(link => ({ - name: (link.Name ?? ''), - size: BigInt(link.Tsize ?? 0), - cid: link.Hash - })), { - mode: unixfs.mode, - mtime: unixfs.mtime, - cidVersion: parent.cid.version - }); - add_link_log(`converted directory to sharded directory ${result.cid}`); - return result; -}; -const addToDirectory = async (parent, child, blockstore, options) => { - // Remove existing link if it exists - const parentLinks = parent.node.Links.filter((link) => { - const matches = link.Name === child.Name; - if (matches && !options.allowOverwriting) { - throw new AlreadyExistsError(); - } - return !matches; - }); - parentLinks.push(child); - if (parent.node.Data == null) { - throw new InvalidPBNodeError('Parent node with no data passed to addToDirectory'); + return baseCache; +} +class ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID { + code; + version; + multihash; + bytes; + '/'; + /** + * @param version - Version of the CID + * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param multihash - (Multi)hash of the of the content. + */ + constructor(version, code, multihash, bytes) { + this.code = code; + this.version = version; + this.multihash = multihash; + this.bytes = bytes; + // flag to serializers that this is a CID and + // should be treated specially + this['/'] = bytes; } - const node = src_UnixFS.unmarshal(parent.node.Data); - let data; - if (node.mtime != null) { - // Update mtime if previously set - const ms = Date.now(); - const secs = Math.floor(ms / 1000); - node.mtime = { - secs: BigInt(secs), - nsecs: (ms - (secs * 1000)) * 1000 - }; - data = node.marshal(); + /** + * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes` + * please either use `CID.asCID(cid)` or switch to new signalling mechanism + * + * @deprecated + */ + get asCID() { + return this; } - else { - data = parent.node.Data; + // ArrayBufferView + get byteOffset() { + return this.bytes.byteOffset; } - parent.node = prepare({ - Data: data, - Links: parentLinks - }); - // Persist the new parent PbNode - const buf = src_encode(parent.node); - const hash = await unixfs_node_modules_multiformats_src_hashes_sha2_sha256.digest(buf); - const cid = unixfs_node_modules_multiformats_src_cid_CID.create(parent.cid.version, code, hash); - await blockstore.put(cid, buf); - return { - node: parent.node, - cid - }; -}; -const addToShardedDirectory = async (parent, child, blockstore, options) => { - const { path, hash } = await recreateShardedDirectory(parent.cid, child.Name, blockstore, options); - const finalSegment = path[path.length - 1]; - if (finalSegment == null) { - throw new Error('Invalid HAMT, could not generate path'); + // ArrayBufferView + get byteLength() { + return this.bytes.byteLength; } - // find the next prefix - // const index = await hash.take(hamtBucketBits) - const prefix = finalSegment.prefix; - const index = parseInt(prefix, 16); - add_link_log('next prefix for %s is %s', child.Name, prefix); - const linkName = `${prefix}${child.Name}`; - const existingLink = finalSegment.node.Links.find(l => (l.Name ?? '').startsWith(prefix)); - if (existingLink != null) { - add_link_log('link %s was present in shard', linkName); - // link is already present in shard - if (existingLink.Name === linkName) { - // file with same name is already present in shard - if (!options.allowOverwriting) { - throw new AlreadyExistsError(); - } - add_link_log('overwriting %s in subshard', child.Name); - finalSegment.node.Links = finalSegment.node.Links.filter(l => l.Name !== linkName); - finalSegment.node.Links.push({ - Name: linkName, - Hash: child.Hash, - Tsize: child.Tsize - }); - } - else if (existingLink.Name?.length === 2) { - throw new Error('Existing link was subshard?!'); - } - else { - // conflict, add a new HAMT segment - add_link_log('prefix %s already exists, creating new subshard', prefix); - // find the sibling we are going to replace - const index = finalSegment.node.Links.findIndex(l => l.Name?.startsWith(prefix)); - const sibling = finalSegment.node.Links.splice(index, 1)[0]; - // give the sibling a new HAMT prefix - const siblingName = (sibling.Name ?? '').substring(2); - const wrapped = consumable_hash_wrapHash(hamt_constants_hamtHashFn); - const siblingHash = wrapped(unixfs_node_modules_uint8arrays_dist_src_from_string_fromString(siblingName)); - // discard hash bits until we reach the subshard depth - for (let i = 0; i < path.length; i++) { - await siblingHash.take(hamtBucketBits); + toV0() { + switch (this.version) { + case 0: { + return this; } - while (true) { - const siblingIndex = await siblingHash.take(hamtBucketBits); - const siblingPrefix = hamt_utils_toPrefix(siblingIndex); - sibling.Name = `${siblingPrefix}${siblingName}`; - // calculate the target file's HAMT prefix in the new sub-shard - const newIndex = await hash.take(hamtBucketBits); - const newPrefix = hamt_utils_toPrefix(newIndex); - if (siblingPrefix === newPrefix) { - // the two sibling names have caused another conflict - add an intermediate node to - // the HAMT and try again - // create the child locations - const children = new sparse_array(); - children.set(newIndex, true); - path.push({ - prefix: newPrefix, - children, - node: { - Links: [] - } - }); - continue; + case 1: { + const { code, multihash } = this; + if (code !== node_modules_multiformats_dist_src_cid_DAG_PB_CODE) { + throw new Error('Cannot convert a non dag-pb CID to CIDv0'); } - // create the child locations - const children = new sparse_array(); - children.set(newIndex, true); - children.set(siblingIndex, true); - // add our new segment - path.push({ - prefix, - children, - node: { - Links: [ - sibling, { - Name: `${newPrefix}${child.Name}`, - Hash: child.Hash, - Tsize: child.Tsize - } - ] - } - }); - break; + // sha2-256 + if (multihash.code !== node_modules_multiformats_dist_src_cid_SHA_256_CODE) { + throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0'); + } + return (ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.createV0(multihash)); + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`); } } } - else { - add_link_log('link %s was not present in sub-shard', linkName); - // add new link to shard - child.Name = linkName; - finalSegment.node.Links.push(child); - finalSegment.children.set(index, true); - add_link_log('adding %s to existing sub-shard', linkName); - } - return updateShardedDirectory(path, blockstore, options); -}; -//# sourceMappingURL=add-link.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/cid-to-directory.js - - -async function cidToDirectory(cid, blockstore, options = {}) { - const entry = await exporter(cid, blockstore, options); - if (entry.type !== 'directory') { - throw new NotADirectoryError(`${cid.toString()} was not a UnixFS directory`); - } - return { - cid, - node: entry.node - }; -} -//# sourceMappingURL=cid-to-directory.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/cid-to-pblink.js - - - -async function cidToPBLink(cid, name, blockstore, options) { - const sourceEntry = await exporter(cid, blockstore, options); - if (sourceEntry.type !== 'directory' && sourceEntry.type !== 'file' && sourceEntry.type !== 'raw') { - throw new NotUnixFSError(`${cid.toString()} was not a UnixFS node`); - } - return { - Name: name, - Tsize: sourceEntry.node instanceof Uint8Array ? sourceEntry.node.byteLength : dagNodeTsize(sourceEntry.node), - Hash: cid - }; -} -function dagNodeTsize(node) { - const linkSizes = node.Links.reduce((acc, curr) => acc + (curr.Tsize ?? 0), 0); - return src_encode(node).byteLength + linkSizes; -} -//# sourceMappingURL=cid-to-pblink.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/resolve.js - - - - - - -const resolve_log = dist_src_logger('helia:unixfs:components:utils:resolve'); -async function resolve_resolve(cid, path, blockstore, options) { - if (path == null || path === '') { - return { cid }; - } - resolve_log('resolve "%s" under %c', path, cid); - const parts = path.split('/').filter(Boolean); - const segments = [{ - name: '', - cid, - size: 0n - }]; - for (let i = 0; i < parts.length; i++) { - const part = parts[i]; - const result = await exporter(cid, blockstore, options); - resolve_log('resolving "%s"', part, result); - if (result.type === 'file') { - if (i < parts.length - 1) { - throw new errors_InvalidParametersError('Path was invalid'); + toV1() { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash; + const multihash = node_modules_multiformats_dist_src_hashes_digest_create(code, digest); + return (ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.createV1(this.code, multihash)); } - cid = result.cid; - } - else if (result.type === 'directory') { - let dirCid; - for await (const entry of result.content()) { - if (entry.name === part) { - dirCid = entry.cid; - break; - } + case 1: { + return this; } - if (dirCid == null) { - throw new DoesNotExistError('Could not find path in directory'); + default: { + throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`); } - cid = dirCid; - segments.push({ - name: part, - cid, - size: result.size - }); - } - else { - throw new errors_InvalidParametersError('Could not resolve path'); } } - resolve_log('resolved %s to %c', path, cid); - return { - cid, - path, - segments - }; -} -/** - * Where we have descended into a DAG to update a child node, ascend up the DAG creating - * new hashes and blocks for the changed content - */ -async function updatePathCids(cid, result, blockstore, options) { - if (result.segments == null || result.segments.length === 0) { - return cid; + equals(other) { + return ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.equals(this, other); } - let child = result.segments.pop(); - if (child == null) { - throw new Error('Insufficient segments'); + static equals(self, other) { + const unknown = other; + return (unknown != null && + self.code === unknown.code && + self.version === unknown.version && + node_modules_multiformats_dist_src_hashes_digest_equals(self.multihash, unknown.multihash)); } - child.cid = cid; - result.segments.reverse(); - for (const parent of result.segments) { - const [directory, pblink] = await Promise.all([ - cidToDirectory(parent.cid, blockstore, options), - cidToPBLink(child.cid, child.name, blockstore, options) - ]); - const result = await addLink(directory, pblink, blockstore, { - ...options, - allowOverwriting: true, - cidVersion: cid.version - }); - cid = result.cid; - parent.cid = cid; - child = parent; + toString(base) { + return node_modules_multiformats_dist_src_cid_format(this, base); } - return cid; -} -//# sourceMappingURL=resolve.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/cat.js - - - - -const mergeOptions = node_modules_merge_options.bind({ ignoreUndefined: true }); -const cat_defaultOptions = {}; -async function* cat(cid, blockstore, options = {}) { - const opts = mergeOptions(cat_defaultOptions, options); - const resolved = await resolve_resolve(cid, opts.path, blockstore, opts); - const result = await exporter(resolved.cid, blockstore, opts); - if (result.type !== 'file' && result.type !== 'raw') { - throw new NotAFileError(); + toJSON() { + return { '/': node_modules_multiformats_dist_src_cid_format(this) }; } - if (result.content == null) { - throw new NoContentError(); + link() { + return this; } - yield* result.content(opts); -} -//# sourceMappingURL=cat.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/constants.js -const SHARD_SPLIT_THRESHOLD_BYTES = 262144; -//# sourceMappingURL=constants.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/chmod.js - - - - - - - - - - - - - - - -const chmod_mergeOptions = node_modules_merge_options.bind({ ignoreUndefined: true }); -const chmod_log = dist_src_logger('helia:unixfs:chmod'); -const chmod_defaultOptions = { - recursive: false, - shardSplitThresholdBytes: SHARD_SPLIT_THRESHOLD_BYTES -}; -async function chmod(cid, mode, blockstore, options = {}) { - const opts = chmod_mergeOptions(chmod_defaultOptions, options); - const resolved = await resolve_resolve(cid, opts.path, blockstore, options); - chmod_log('chmod %c %d', resolved.cid, mode); - if (opts.recursive) { - // recursively export from root CID, change perms of each entry then reimport - // but do not reimport files, only manipulate dag-pb nodes - const root = await pipe(async function* () { - for await (const entry of recursive(resolved.cid, blockstore, options)) { - let metadata; - let links = []; - if (entry.type === 'raw') { - // convert to UnixFS - metadata = new src_UnixFS({ type: 'file', data: entry.node }); - } - else if (entry.type === 'file' || entry.type === 'directory') { - metadata = entry.unixfs; - links = entry.node.Links; + [Symbol.toStringTag] = 'CID'; + // Legacy + [Symbol.for('nodejs.util.inspect.custom')]() { + return `CID(${this.toString()})`; + } + /** + * Takes any input `value` and returns a `CID` instance if it was + * a `CID` otherwise returns `null`. If `value` is instanceof `CID` + * it will return value back. If `value` is not instance of this CID + * class, but is compatible CID it will return new instance of this + * `CID` class. Otherwise returns null. + * + * This allows two different incompatible versions of CID library to + * co-exist and interop as long as binary interface is compatible. + */ + static asCID(input) { + if (input == null) { + return null; + } + const value = input; + if (value instanceof ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID) { + // If value is instance of CID then we're all set. + return value; + } + else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) { + // If value isn't instance of this CID class but `this.asCID === this` or + // `value['/'] === value.bytes` is true it is CID instance coming from a + // different implementation (diff version or duplicate). In that case we + // rebase it to this `CID` implementation so caller is guaranteed to get + // instance with expected API. + const { version, code, multihash, bytes } = value; + return new ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID(version, code, multihash, bytes ?? node_modules_multiformats_dist_src_cid_encodeCID(version, code, multihash.bytes)); + } + else if (value[node_modules_multiformats_dist_src_cid_cidSymbol] === true) { + // If value is a CID from older implementation that used to be tagged via + // symbol we still rebase it to the this `CID` implementation by + // delegating that to a constructor. + const { version, multihash, code } = value; + const digest = node_modules_multiformats_dist_src_hashes_digest_decode(multihash); + return ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.create(version, code, digest); + } + else { + // Otherwise value is not a CID (or an incompatible version of it) in + // which case we return `null`. + return null; + } + } + /** + * @param version - Version of the CID + * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv + * @param digest - (Multi)hash of the of the content. + */ + static create(version, code, digest) { + if (typeof code !== 'number') { + throw new Error('String codecs are no longer supported'); + } + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error('Invalid digest'); + } + switch (version) { + case 0: { + if (code !== node_modules_multiformats_dist_src_cid_DAG_PB_CODE) { + throw new Error(`Version 0 CID must use dag-pb (code: ${node_modules_multiformats_dist_src_cid_DAG_PB_CODE}) block encoding`); } else { - throw new NotUnixFSError(); + return new ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID(version, code, digest, digest.bytes); } - metadata.mode = mode; - const node = { - Data: metadata.marshal(), - Links: links - }; - yield { - path: entry.path, - content: node - }; } - }, - // @ts-expect-error cannot combine progress types - (source) => importer(source, blockstore, { - ...opts, - dagBuilder: async function* (source, block) { - for await (const entry of source) { - yield async function () { - // @ts-expect-error cannot derive type - const node = entry.content; - const buf = src_encode(node); - const updatedCid = await persist_persist(buf, block, { - ...opts, - cidVersion: cid.version - }); - if (node.Data == null) { - throw new InvalidPBNodeError(`${updatedCid} had no data`); - } - const unixfs = src_UnixFS.unmarshal(node.Data); - return { - cid: updatedCid, - size: BigInt(buf.length), - path: entry.path, - unixfs - }; - }; - } + case 1: { + const bytes = node_modules_multiformats_dist_src_cid_encodeCID(version, code, digest.bytes); + return new ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID(version, code, digest, bytes); + } + default: { + throw new Error('Invalid version'); } - }), async (nodes) => dist_src(nodes)); - if (root == null) { - throw new errors_UnknownError(`Could not chmod ${resolved.cid.toString()}`); } - return updatePathCids(root.cid, resolved, blockstore, opts); } - const block = await blockstore.get(resolved.cid, options); - let metadata; - let links = []; - if (resolved.cid.code === unixfs_node_modules_multiformats_src_codecs_raw_code) { - // convert to UnixFS - metadata = new src_UnixFS({ type: 'file', data: block }); + /** + * Simplified version of `create` for CIDv0. + */ + static createV0(digest) { + return ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.create(0, node_modules_multiformats_dist_src_cid_DAG_PB_CODE, digest); } - else { - const node = src_decode(block); - if (node.Data == null) { - throw new InvalidPBNodeError(`${resolved.cid.toString()} had no data`); + /** + * Simplified version of `create` for CIDv1. + * + * @param code - Content encoding format code. + * @param digest - Multihash of the content. + */ + static createV1(code, digest) { + return ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.create(1, code, digest); + } + /** + * Decoded a CID from its binary representation. The byte array must contain + * only the CID with no additional bytes. + * + * An error will be thrown if the bytes provided do not contain a valid + * binary representation of a CID. + */ + static decode(bytes) { + const [cid, remainder] = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.decodeFirst(bytes); + if (remainder.length !== 0) { + throw new Error('Incorrect length'); } - links = node.Links; - metadata = src_UnixFS.unmarshal(node.Data); + return cid; + } + /** + * Decoded a CID from its binary representation at the beginning of a byte + * array. + * + * Returns an array with the first element containing the CID and the second + * element containing the remainder of the original byte array. The remainder + * will be a zero-length byte array if the provided bytes only contained a + * binary CID representation. + */ + static decodeFirst(bytes) { + const specs = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.inspectBytes(bytes); + const prefixSize = specs.size - specs.multihashSize; + const multihashBytes = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_bytes_coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize)); + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error('Incorrect length'); + } + const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize); + const digest = new node_modules_multiformats_dist_src_hashes_digest_Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); + const cid = specs.version === 0 + ? ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.createV0(digest) + : ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.createV1(specs.codec, digest); + return [cid, bytes.subarray(specs.size)]; + } + /** + * Inspect the initial bytes of a CID to determine its properties. + * + * Involves decoding up to 4 varints. Typically this will require only 4 to 6 + * bytes but for larger multicodec code values and larger multihash digest + * lengths these varints can be quite large. It is recommended that at least + * 10 bytes be made available in the `initialBytes` argument for a complete + * inspection. + */ + static inspectBytes(initialBytes) { + let offset = 0; + const next = () => { + const [i, length] = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_varint_decode(initialBytes.subarray(offset)); + offset += length; + return i; + }; + let version = next(); + let codec = node_modules_multiformats_dist_src_cid_DAG_PB_CODE; + if (version === 18) { + // CIDv0 + version = 0; + offset = 0; + } + else { + codec = next(); + } + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`); + } + const prefixSize = offset; + const multihashCode = next(); // multihash code + const digestSize = next(); // multihash length + const size = offset + digestSize; + const multihashSize = size - prefixSize; + return { version, codec, multihashCode, digestSize, multihashSize, size }; + } + /** + * Takes cid in a string representation and creates an instance. If `base` + * decoder is not provided will use a default from the configuration. It will + * throw an error if encoding of the CID is not compatible with supplied (or + * a default decoder). + */ + static parse(source, base) { + const [prefix, bytes] = node_modules_multiformats_dist_src_cid_parseCIDtoBytes(source, base); + const cid = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.decode(bytes); + if (cid.version === 0 && source[0] !== 'Q') { + throw Error('Version 0 CID string must not include multibase prefix'); + } + // Cache string representation to avoid computing it on `this.toString()` + node_modules_multiformats_dist_src_cid_baseCache(cid).set(prefix, source); + return cid; } - metadata.mode = mode; - const updatedBlock = src_encode({ - Data: metadata.marshal(), - Links: links - }); - const hash = await unixfs_node_modules_multiformats_src_hashes_sha2_sha256.digest(updatedBlock); - const updatedCid = unixfs_node_modules_multiformats_src_cid_CID.create(resolved.cid.version, code, hash); - await blockstore.put(updatedCid, updatedBlock); - return updatePathCids(updatedCid, resolved, blockstore, opts); } -//# sourceMappingURL=chmod.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/cp.js - - - - - - - -const cp_mergeOptions = node_modules_merge_options.bind({ ignoreUndefined: true }); -const cp_log = dist_src_logger('helia:unixfs:cp'); -const cp_defaultOptions = { - force: false, - shardSplitThresholdBytes: SHARD_SPLIT_THRESHOLD_BYTES -}; -async function cp(source, target, name, blockstore, options = {}) { - const opts = cp_mergeOptions(cp_defaultOptions, options); - if (name.includes('/')) { - throw new errors_InvalidParametersError('Name must not have slashes'); +function node_modules_multiformats_dist_src_cid_parseCIDtoBytes(source, base) { + switch (source[0]) { + // CIDv0 is parsed differently + case 'Q': { + const decoder = base ?? node_modules_multiformats_dist_src_bases_base58_base58btc; + return [ + node_modules_multiformats_dist_src_bases_base58_base58btc.prefix, + decoder.decode(`${node_modules_multiformats_dist_src_bases_base58_base58btc.prefix}${source}`) + ]; + } + case node_modules_multiformats_dist_src_bases_base58_base58btc.prefix: { + const decoder = base ?? node_modules_multiformats_dist_src_bases_base58_base58btc; + return [node_modules_multiformats_dist_src_bases_base58_base58btc.prefix, decoder.decode(source)]; + } + case node_modules_multiformats_dist_src_bases_base32_base32.prefix: { + const decoder = base ?? node_modules_multiformats_dist_src_bases_base32_base32; + return [node_modules_multiformats_dist_src_bases_base32_base32.prefix, decoder.decode(source)]; + } + default: { + if (base == null) { + throw Error('To parse non base32 or base58btc encoded CID multibase decoder must be provided'); + } + return [source[0], base.decode(source)]; + } } - const [directory, pblink] = await Promise.all([ - cidToDirectory(target, blockstore, opts), - cidToPBLink(source, name, blockstore, opts) - ]); - cp_log('Adding %c as "%s" to %c', source, name, target); - const result = await addLink(directory, pblink, blockstore, { - allowOverwriting: opts.force, - cidVersion: target.version, - ...opts - }); - return result.cid; } -//# sourceMappingURL=cp.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/ls.js - - - - -const ls_mergeOptions = node_modules_merge_options.bind({ ignoreUndefined: true }); -const ls_defaultOptions = {}; -async function* ls(cid, blockstore, options = {}) { - const opts = ls_mergeOptions(ls_defaultOptions, options); - const resolved = await resolve_resolve(cid, opts.path, blockstore, opts); - const result = await exporter(resolved.cid, blockstore); - if (result.type === 'file' || result.type === 'raw') { - yield result; - return; +function node_modules_multiformats_dist_src_cid_toStringV0(bytes, cache, base) { + const { prefix } = base; + if (prefix !== node_modules_multiformats_dist_src_bases_base58_base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base.name} encoding`); } - if (result.content == null) { - throw new NoContentError(); + const cid = cache.get(prefix); + if (cid == null) { + const cid = base.encode(bytes).slice(1); + cache.set(prefix, cid); + return cid; } - if (result.type !== 'directory') { - throw new NotADirectoryError(); + else { + return cid; } - yield* result.content({ - offset: options.offset, - length: options.length - }); } -//# sourceMappingURL=ls.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/mkdir.js - - - - - - - - - - - - -const mkdir_mergeOptions = node_modules_merge_options.bind({ ignoreUndefined: true }); -const mkdir_log = dist_src_logger('helia:unixfs:mkdir'); -const mkdir_defaultOptions = { - cidVersion: 1, - force: false, - shardSplitThresholdBytes: SHARD_SPLIT_THRESHOLD_BYTES -}; -async function mkdir(parentCid, dirname, blockstore, options = {}) { - const opts = mkdir_mergeOptions(mkdir_defaultOptions, options); - if (dirname.includes('/')) { - throw new errors_InvalidParametersError('Path must not have slashes'); +function node_modules_multiformats_dist_src_cid_toStringV1(bytes, cache, base) { + const { prefix } = base; + const cid = cache.get(prefix); + if (cid == null) { + const cid = base.encode(bytes); + cache.set(prefix, cid); + return cid; } - const entry = await exporter(parentCid, blockstore, options); - if (entry.type !== 'directory') { - throw new NotADirectoryError(`${parentCid.toString()} was not a UnixFS directory`); + else { + return cid; } - mkdir_log('creating %s', dirname); - const metadata = new src_UnixFS({ - type: 'directory', - mode: opts.mode, - mtime: opts.mtime - }); - // Persist the new parent PBNode - const node = { - Data: metadata.marshal(), - Links: [] - }; - const buf = src_encode(node); - const hash = await unixfs_node_modules_multiformats_src_hashes_sha2_sha256.digest(buf); - const emptyDirCid = unixfs_node_modules_multiformats_src_cid_CID.create(opts.cidVersion, code, hash); - await blockstore.put(emptyDirCid, buf); - const [directory, pblink] = await Promise.all([ - cidToDirectory(parentCid, blockstore, opts), - cidToPBLink(emptyDirCid, dirname, blockstore, opts) - ]); - mkdir_log('adding empty dir called %s to %c', dirname, parentCid); - const result = await addLink(directory, pblink, blockstore, { - ...opts, - allowOverwriting: opts.force - }); - return result.cid; } -//# sourceMappingURL=mkdir.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/remove-link.js - - +const node_modules_multiformats_dist_src_cid_DAG_PB_CODE = 0x70; +const node_modules_multiformats_dist_src_cid_SHA_256_CODE = 0x12; +function node_modules_multiformats_dist_src_cid_encodeCID(version, code, multihash) { + const codeOffset = node_modules_multiformats_dist_src_varint_encodingLength(version); + const hashOffset = codeOffset + node_modules_multiformats_dist_src_varint_encodingLength(code); + const bytes = new Uint8Array(hashOffset + multihash.byteLength); + node_modules_multiformats_dist_src_varint_encodeTo(version, bytes, 0); + node_modules_multiformats_dist_src_varint_encodeTo(code, bytes, codeOffset); + bytes.set(multihash, hashOffset); + return bytes; +} +const node_modules_multiformats_dist_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID'); +//# sourceMappingURL=cid.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/codecs/raw.js +const multiformats_dist_src_codecs_raw_name = 'raw'; +const multiformats_dist_src_codecs_raw_code = 0x55; +function multiformats_dist_src_codecs_raw_encode(node) { + return coerce(node); +} +function multiformats_dist_src_codecs_raw_decode(data) { + return coerce(data); +} +//# sourceMappingURL=raw.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/node_modules/multiformats/dist/src/hashes/identity.js +const multiformats_dist_src_hashes_identity_code = 0x0; +const multiformats_dist_src_hashes_identity_name = 'identity'; +const multiformats_dist_src_hashes_identity_encode = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_bytes_coerce; +function multiformats_dist_src_hashes_identity_digest(input) { + return node_modules_multiformats_dist_src_hashes_digest_create(multiformats_dist_src_hashes_identity_code, multiformats_dist_src_hashes_identity_encode(input)); +} +const multiformats_dist_src_hashes_identity_identity = { code: multiformats_dist_src_hashes_identity_code, name: multiformats_dist_src_hashes_identity_name, encode: multiformats_dist_src_hashes_identity_encode, digest: multiformats_dist_src_hashes_identity_digest }; +//# sourceMappingURL=identity.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/resolvers/dag-cbor.js -const remove_link_log = dist_src_logger('helia:unixfs:utils:remove-link'); -async function removeLink(parent, name, blockstore, options) { - if (parent.node.Data == null) { - throw new InvalidPBNodeError('Parent node had no data'); - } - const meta = src_UnixFS.unmarshal(parent.node.Data); - if (meta.type === 'hamt-sharded-directory') { - remove_link_log(`removing ${name} from sharded directory`); - const result = await removeFromShardedDirectory(parent, name, blockstore, options); - if (!(await isOverShardThreshold(result.node, blockstore, options.shardSplitThresholdBytes, options))) { - remove_link_log('converting shard to flat directory %c', parent.cid); - return convertToFlatDirectory(result, blockstore, options); +const dag_cbor_resolve = async (cid, name, path, toResolve, resolve, depth, blockstore, options) => { + const block = await blockstore.get(cid, options); + const object = dag_cbor_src_decode(block); + let subObject = object; + let subPath = path; + while (toResolve.length > 0) { + const prop = toResolve[0]; + if (prop in subObject) { + // remove the bit of the path we have resolved + toResolve.shift(); + subPath = `${subPath}/${prop}`; + const subObjectCid = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.asCID(subObject[prop]); + if (subObjectCid != null) { + return { + entry: { + type: 'object', + name, + path, + cid, + node: block, + depth, + size: BigInt(block.length), + content: async function* () { + yield object; + } + }, + next: { + cid: subObjectCid, + name: prop, + path: subPath, + toResolve + } + }; + } + subObject = subObject[prop]; + } + else { + // cannot resolve further + throw err_code(new Error(`No property named ${prop} found in cbor node ${cid}`), 'ERR_NO_PROP'); } - return result; } - remove_link_log(`removing link ${name} regular directory`); - return removeFromDirectory(parent, name, blockstore, options); -} -const removeFromDirectory = async (parent, name, blockstore, options) => { - // Remove existing link if it exists - parent.node.Links = parent.node.Links.filter((link) => { - return link.Name !== name; - }); - const parentBlock = src_encode(parent.node); - const parentCid = await persist_persist(parentBlock, blockstore, { - ...options, - cidVersion: parent.cid.version - }); - remove_link_log(`Updated regular directory ${parentCid}`); return { - node: parent.node, - cid: parentCid + entry: { + type: 'object', + name, + path, + cid, + node: block, + depth, + size: BigInt(block.length), + content: async function* () { + yield object; + } + } }; }; -const removeFromShardedDirectory = async (parent, name, blockstore, options) => { - const { path } = await recreateShardedDirectory(parent.cid, name, blockstore, options); - const finalSegment = path[path.length - 1]; - if (finalSegment == null) { - throw new Error('Invalid HAMT, could not generate path'); +/* harmony default export */ const dag_cbor = (dag_cbor_resolve); +//# sourceMappingURL=dag-cbor.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/utils/extract-data-from-block.js +function extractDataFromBlock(block, blockStart, requestedStart, requestedEnd) { + const blockLength = BigInt(block.length); + const blockEnd = BigInt(blockStart + blockLength); + if (requestedStart >= blockEnd || requestedEnd < blockStart) { + // If we are looking for a byte range that is starts after the start of the block, + // return an empty block. This can happen when internal nodes contain data + return new Uint8Array(0); } - const linkName = finalSegment.node.Links.filter(l => (l.Name ?? '').substring(2) === name).map(l => l.Name).pop(); - if (linkName == null) { - throw new Error('File not found'); + if (requestedEnd >= blockStart && requestedEnd < blockEnd) { + // If the end byte is in the current block, truncate the block to the end byte + block = block.subarray(0, Number(requestedEnd - blockStart)); } - const prefix = linkName.substring(0, 2); - const index = parseInt(prefix, 16); - // remove the file from the shard - finalSegment.node.Links = finalSegment.node.Links.filter(link => link.Name !== linkName); - finalSegment.children.unset(index); - if (finalSegment.node.Links.length === 1) { - // replace the subshard with the last remaining file in the parent - while (true) { - if (path.length === 1) { - break; - } - const segment = path[path.length - 1]; - if (segment == null || segment.node.Links.length > 1) { - break; - } - // remove final segment - path.pop(); - const nextSegment = path[path.length - 1]; - if (nextSegment == null) { - break; - } - const link = segment.node.Links[0]; - nextSegment.node.Links = nextSegment.node.Links.filter(l => !(l.Name ?? '').startsWith(nextSegment.prefix)); - nextSegment.node.Links.push({ - Hash: link.Hash, - Name: `${nextSegment.prefix}${(link.Name ?? '').substring(2)}`, - Tsize: link.Tsize - }); - } + if (requestedStart >= blockStart && requestedStart < blockEnd) { + // If the start byte is in the current block, skip to the start byte + block = block.subarray(Number(requestedStart - blockStart)); } - return updateShardedDirectory(path, blockstore, options); -}; -const convertToFlatDirectory = async (parent, blockstore, options) => { - if (parent.node.Data == null) { - throw new errors_InvalidParametersError('Invalid parent passed to convertToFlatDirectory'); + return block; +} +/* harmony default export */ const extract_data_from_block = (extractDataFromBlock); +//# sourceMappingURL=extract-data-from-block.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/utils/validate-offset-and-length.js + +const validateOffsetAndLength = (size, offset = 0, length = size) => { + const fileSize = BigInt(size); + const start = BigInt(offset ?? 0); + let end = BigInt(length); + if (end !== fileSize) { + end = start + end; } - const rootNode = { - Links: [] - }; - const dir = await exporter(parent.cid, blockstore); - if (dir.type !== 'directory') { - throw new Error('Unexpected node type'); + if (end > fileSize) { + end = fileSize; } - for await (const entry of dir.content()) { - let tsize = 0; - if (entry.node instanceof Uint8Array) { - tsize = entry.node.byteLength; - } - else { - tsize = src_encode(entry.node).length; - } - rootNode.Links.push({ - Hash: entry.cid, - Name: entry.name, - Tsize: tsize - }); + if (start < 0n) { + throw err_code(new Error('Offset must be greater than or equal to 0'), 'ERR_INVALID_PARAMS'); + } + if (start > fileSize) { + throw err_code(new Error('Offset must be less than the file size'), 'ERR_INVALID_PARAMS'); + } + if (end < 0n) { + throw err_code(new Error('Length must be greater than or equal to 0'), 'ERR_INVALID_PARAMS'); + } + if (end > fileSize) { + throw err_code(new Error('Length must be less than the file size'), 'ERR_INVALID_PARAMS'); } - // copy mode/mtime over if set - const oldUnixfs = src_UnixFS.unmarshal(parent.node.Data); - rootNode.Data = new src_UnixFS({ type: 'directory', mode: oldUnixfs.mode, mtime: oldUnixfs.mtime }).marshal(); - const block = src_encode(prepare(rootNode)); - const cid = await persist_persist(block, blockstore, { - codec: src_namespaceObject, - cidVersion: parent.cid.version, - signal: options.signal - }); return { - cid, - node: rootNode + start, + end }; }; -//# sourceMappingURL=remove-link.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/rm.js - +/* harmony default export */ const validate_offset_and_length = (validateOffsetAndLength); +//# sourceMappingURL=validate-offset-and-length.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/resolvers/identity.js -const rm_mergeOptions = node_modules_merge_options.bind({ ignoreUndefined: true }); -const rm_log = dist_src_logger('helia:unixfs:rm'); -const rm_defaultOptions = { - shardSplitThresholdBytes: SHARD_SPLIT_THRESHOLD_BYTES +const rawContent = (node) => { + async function* contentGenerator(options = {}) { + const { start, end } = validate_offset_and_length(node.length, options.offset, options.length); + const buf = extract_data_from_block(node, 0n, start, end); + options.onProgress?.(new CustomProgressEvent('unixfs:exporter:progress:identity', { + bytesRead: BigInt(buf.byteLength), + totalBytes: end - start, + fileSize: BigInt(node.byteLength) + })); + yield buf; + } + return contentGenerator; }; -async function rm(target, name, blockstore, options = {}) { - const opts = rm_mergeOptions(rm_defaultOptions, options); - if (name.includes('/')) { - throw new errors_InvalidParametersError('Name must not have slashes'); +const identity_resolve = async (cid, name, path, toResolve, resolve, depth, blockstore, options) => { + if (toResolve.length > 0) { + throw err_code(new Error(`No link named ${path} found in raw node ${cid}`), 'ERR_NOT_FOUND'); } - const directory = await cidToDirectory(target, blockstore, opts); - rm_log('Removing %s from %c', name, target); - const result = await removeLink(directory, name, blockstore, { - ...opts, - cidVersion: target.version - }); - return result.cid; -} -//# sourceMappingURL=rm.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/stat.js - - - - + const buf = node_modules_multiformats_dist_src_hashes_digest_decode(cid.multihash.bytes); + return { + entry: { + type: 'identity', + name, + path, + cid, + content: rawContent(buf.digest), + depth, + size: BigInt(buf.digest.length), + node: buf.digest + } + }; +}; +/* harmony default export */ const resolvers_identity = (identity_resolve); +//# sourceMappingURL=identity.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/resolvers/raw.js -const stat_mergeOptions = node_modules_merge_options.bind({ ignoreUndefined: true }); -const stat_log = dist_src_logger('helia:unixfs:stat'); -const stat_defaultOptions = {}; -async function stat(cid, blockstore, options = {}) { - const opts = stat_mergeOptions(stat_defaultOptions, options); - const resolved = await resolve_resolve(cid, options.path, blockstore, opts); - stat_log('stat %c', resolved.cid); - const result = await exporter(resolved.cid, blockstore, opts); - if (result.type !== 'file' && result.type !== 'directory' && result.type !== 'raw') { - throw new NotUnixFSError(); - } - let fileSize = 0n; - let dagSize = 0n; - let localFileSize = 0n; - let localDagSize = 0n; - let blocks = 0; - let mode; - let mtime; - const type = result.type; - let unixfs; - if (result.type === 'raw') { - fileSize = BigInt(result.node.byteLength); - dagSize = BigInt(result.node.byteLength); - localFileSize = BigInt(result.node.byteLength); - localDagSize = BigInt(result.node.byteLength); - blocks = 1; - } - if (result.type === 'directory') { - fileSize = 0n; - dagSize = BigInt(result.unixfs.marshal().byteLength); - localFileSize = 0n; - localDagSize = dagSize; - blocks = 1; - mode = result.unixfs.mode; - mtime = result.unixfs.mtime; - unixfs = result.unixfs; +const raw_rawContent = (node) => { + async function* contentGenerator(options = {}) { + const { start, end } = validate_offset_and_length(node.length, options.offset, options.length); + const buf = extract_data_from_block(node, 0n, start, end); + options.onProgress?.(new CustomProgressEvent('unixfs:exporter:progress:raw', { + bytesRead: BigInt(buf.byteLength), + totalBytes: end - start, + fileSize: BigInt(node.byteLength) + })); + yield buf; } - if (result.type === 'file') { - const results = await inspectDag(resolved.cid, blockstore, opts); - fileSize = result.unixfs.fileSize(); - dagSize = BigInt((result.node.Data?.byteLength ?? 0) + result.node.Links.reduce((acc, curr) => acc + (curr.Tsize ?? 0), 0)); - localFileSize = BigInt(results.localFileSize); - localDagSize = BigInt(results.localDagSize); - blocks = results.blocks; - mode = result.unixfs.mode; - mtime = result.unixfs.mtime; - unixfs = result.unixfs; + return contentGenerator; +}; +const raw_resolve = async (cid, name, path, toResolve, resolve, depth, blockstore, options) => { + if (toResolve.length > 0) { + throw err_code(new Error(`No link named ${path} found in raw node ${cid}`), 'ERR_NOT_FOUND'); } + const block = await blockstore.get(cid, options); return { - cid: resolved.cid, - mode, - mtime, - fileSize, - dagSize, - localFileSize, - localDagSize, - blocks, - type, - unixfs - }; -} -async function inspectDag(cid, blockstore, options) { - const results = { - localFileSize: 0, - localDagSize: 0, - blocks: 0 - }; - if (await blockstore.has(cid, options)) { - const block = await blockstore.get(cid, options); - results.blocks++; - results.localDagSize += block.byteLength; - if (cid.code === unixfs_node_modules_multiformats_src_codecs_raw_code) { - results.localFileSize += block.byteLength; - } - else if (cid.code === code) { - const pbNode = src_decode(block); - if (pbNode.Links.length > 0) { - // intermediate node - for (const link of pbNode.Links) { - const linkResult = await inspectDag(link.Hash, blockstore, options); - results.localFileSize += linkResult.localFileSize; - results.localDagSize += linkResult.localDagSize; - results.blocks += linkResult.blocks; - } - } - else { - // leaf node - if (pbNode.Data == null) { - throw new InvalidPBNodeError(`PBNode ${cid.toString()} had no data`); - } - const unixfs = src_UnixFS.unmarshal(pbNode.Data); - if (unixfs.data == null) { - throw new InvalidPBNodeError(`UnixFS node ${cid.toString()} had no data`); - } - results.localFileSize += unixfs.data.byteLength ?? 0; - } - } - else { - throw new errors_UnknownError(`${cid.toString()} was neither DAG_PB nor RAW`); + entry: { + type: 'raw', + name, + path, + cid, + content: raw_rawContent(block), + depth, + size: BigInt(block.length), + node: block } - } - return results; -} -//# sourceMappingURL=stat.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/touch.js - - - - - - - - - - + }; +}; +/* harmony default export */ const resolvers_raw = (raw_resolve); +//# sourceMappingURL=raw.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/utils/find-cid-in-shard.js -const touch_mergeOptions = node_modules_merge_options.bind({ ignoreUndefined: true }); -const touch_log = dist_src_logger('helia:unixfs:touch'); -const touch_defaultOptions = { - recursive: false, - shardSplitThresholdBytes: SHARD_SPLIT_THRESHOLD_BYTES +// FIXME: this is copy/pasted from ipfs-unixfs-importer/src/options.js +const hashFn = async function (buf) { + return (await murmur3128.encode(buf)) + // Murmur3 outputs 128 bit but, accidentally, IPFS Go's + // implementation only uses the first 64, so we must do the same + // for parity.. + .slice(0, 8) + // Invert buffer because that's how Go impl does it + .reverse(); }; -async function touch(cid, blockstore, options = {}) { - const opts = touch_mergeOptions(touch_defaultOptions, options); - const resolved = await resolve_resolve(cid, opts.path, blockstore, opts); - const mtime = opts.mtime ?? { - secs: BigInt(Math.round(Date.now() / 1000)), - nsecs: 0 - }; - touch_log('touch %c %o', resolved.cid, mtime); - if (opts.recursive) { - // recursively export from root CID, change perms of each entry then reimport - // but do not reimport files, only manipulate dag-pb nodes - const root = await pipe(async function* () { - for await (const entry of recursive(resolved.cid, blockstore)) { - let metadata; - let links; - if (entry.type === 'raw') { - metadata = new src_UnixFS({ data: entry.node }); - links = []; - } - else if (entry.type === 'file' || entry.type === 'directory') { - metadata = entry.unixfs; - links = entry.node.Links; - } - else { - throw new NotUnixFSError(); - } - metadata.mtime = mtime; - const node = { - Data: metadata.marshal(), - Links: links - }; - yield { - path: entry.path, - content: node - }; - } - }, - // @ts-expect-error blockstore types are incompatible - (source) => importer(source, blockstore, { - ...opts, - dagBuilder: async function* (source, block) { - for await (const entry of source) { - yield async function () { - // @ts-expect-error cannot derive type - const node = entry.content; - const buf = src_encode(node); - const updatedCid = await persist_persist(buf, block, { - ...opts, - cidVersion: cid.version - }); - if (node.Data == null) { - throw new InvalidPBNodeError(`${updatedCid} had no data`); - } - const unixfs = src_UnixFS.unmarshal(node.Data); - return { - cid: updatedCid, - size: BigInt(buf.length), - path: entry.path, - unixfs - }; - }; - } - } - }), async (nodes) => dist_src(nodes)); - if (root == null) { - throw new errors_UnknownError(`Could not chmod ${resolved.cid.toString()}`); +const addLinksToHamtBucket = async (links, bucket, rootBucket) => { + const padLength = (bucket.tableSize() - 1).toString(16).length; + await Promise.all(links.map(async (link) => { + if (link.Name == null) { + // TODO(@rvagg): what do? this is technically possible + throw new Error('Unexpected Link without a Name'); } - return updatePathCids(root.cid, resolved, blockstore, opts); - } - const block = await blockstore.get(resolved.cid, options); - let metadata; - let links = []; - if (resolved.cid.code === unixfs_node_modules_multiformats_src_codecs_raw_code) { - metadata = new src_UnixFS({ data: block }); + if (link.Name.length === padLength) { + const pos = parseInt(link.Name, 16); + bucket._putObjectAt(pos, new Bucket({ + hash: rootBucket._options.hash, + bits: rootBucket._options.bits + }, bucket, pos)); + return; + } + await rootBucket.put(link.Name.substring(2), true); + })); +}; +const toPrefix = (position, padLength) => { + return position + .toString(16) + .toUpperCase() + .padStart(padLength, '0') + .substring(0, padLength); +}; +const toBucketPath = (position) => { + let bucket = position.bucket; + const path = []; + while (bucket._parent != null) { + path.push(bucket); + bucket = bucket._parent; } - else { - const node = src_decode(block); - links = node.Links; + path.push(bucket); + return path.reverse(); +}; +const findShardCid = async (node, name, blockstore, context, options) => { + if (context == null) { if (node.Data == null) { - throw new InvalidPBNodeError(`${resolved.cid.toString()} had no data`); + throw err_code(new Error('no data in PBNode'), 'ERR_NOT_UNIXFS'); } - metadata = src_UnixFS.unmarshal(node.Data); + let dir; + try { + dir = src_UnixFS.unmarshal(node.Data); + } + catch (err) { + throw err_code(err, 'ERR_NOT_UNIXFS'); + } + if (dir.type !== 'hamt-sharded-directory') { + throw err_code(new Error('not a HAMT'), 'ERR_NOT_UNIXFS'); + } + if (dir.fanout == null) { + throw err_code(new Error('missing fanout'), 'ERR_NOT_UNIXFS'); + } + const rootBucket = createHAMT({ + hashFn, + bits: Math.log2(Number(dir.fanout)) + }); + context = { + rootBucket, + hamtDepth: 1, + lastBucket: rootBucket + }; } - metadata.mtime = mtime; - const updatedBlock = src_encode({ - Data: metadata.marshal(), - Links: links + const padLength = (context.lastBucket.tableSize() - 1).toString(16).length; + await addLinksToHamtBucket(node.Links, context.lastBucket, context.rootBucket); + const position = await context.rootBucket._findNewBucketAndPos(name); + let prefix = toPrefix(position.pos, padLength); + const bucketPath = toBucketPath(position); + if (bucketPath.length > context.hamtDepth) { + context.lastBucket = bucketPath[context.hamtDepth]; + prefix = toPrefix(context.lastBucket._posAtParent, padLength); + } + const link = node.Links.find(link => { + if (link.Name == null) { + return false; + } + const entryPrefix = link.Name.substring(0, padLength); + const entryName = link.Name.substring(padLength); + if (entryPrefix !== prefix) { + // not the entry or subshard we're looking for + return false; + } + if (entryName !== '' && entryName !== name) { + // not the entry we're looking for + return false; + } + return true; }); - const hash = await unixfs_node_modules_multiformats_src_hashes_sha2_sha256.digest(updatedBlock); - const updatedCid = unixfs_node_modules_multiformats_src_cid_CID.create(resolved.cid.version, code, hash); - await blockstore.put(updatedCid, updatedBlock); - return updatePathCids(updatedCid, resolved, blockstore, opts); -} -//# sourceMappingURL=touch.js.map -;// CONCATENATED MODULE: external "fs/promises" -const promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs/promises"); -// EXTERNAL MODULE: external "path" -var external_path_ = __nccwpck_require__(71017); -// EXTERNAL MODULE: ./node_modules/@helia/unixfs/node_modules/brace-expansion/index.js -var brace_expansion = __nccwpck_require__(74405); -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/minimatch/dist/mjs/assert-valid-pattern.js -const MAX_PATTERN_LENGTH = 1024 * 64; -const assertValidPattern = (pattern) => { - if (typeof pattern !== 'string') { - throw new TypeError('invalid pattern'); + if (link == null) { + return; } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError('pattern is too long'); + if (link.Name != null && link.Name.substring(padLength) === name) { + return link.Hash; } + context.hamtDepth++; + const block = await blockstore.get(link.Hash, options); + node = src_decode(block); + return findShardCid(node, name, blockstore, context, options); }; -//# sourceMappingURL=assert-valid-pattern.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/minimatch/dist/mjs/brace-expressions.js -// translate the various posix character classes into unicode properties -// this works across all unicode locales -// { : [, /u flag required, negated] -const posixClasses = { - '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true], - '[:alpha:]': ['\\p{L}\\p{Nl}', true], - '[:ascii:]': ['\\x' + '00-\\x' + '7f', false], - '[:blank:]': ['\\p{Zs}\\t', true], - '[:cntrl:]': ['\\p{Cc}', true], - '[:digit:]': ['\\p{Nd}', true], - '[:graph:]': ['\\p{Z}\\p{C}', true, true], - '[:lower:]': ['\\p{Ll}', true], - '[:print:]': ['\\p{C}', true], - '[:punct:]': ['\\p{P}', true], - '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true], - '[:upper:]': ['\\p{Lu}', true], - '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true], - '[:xdigit:]': ['A-Fa-f0-9', false], -}; -// only need to escape a few things inside of brace expressions -// escapes: [ \ ] - -const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&'); -// escape all regexp magic characters -const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); -// everything has already been escaped, we just have to join -const rangesToString = (ranges) => ranges.join(''); -// takes a glob string at a posix brace expression, and returns -// an equivalent regular expression source, and boolean indicating -// whether the /u flag needs to be applied, and the number of chars -// consumed to parse the character class. -// This also removes out of order ranges, and returns ($.) if the -// entire class just no good. -const parseClass = (glob, position) => { - const pos = position; - /* c8 ignore start */ - if (glob.charAt(pos) !== '[') { - throw new Error('not in a brace expression'); - } - /* c8 ignore stop */ - const ranges = []; - const negs = []; - let i = pos + 1; - let sawStart = false; - let uflag = false; - let escaping = false; - let negate = false; - let endPos = pos; - let rangeStart = ''; - WHILE: while (i < glob.length) { - const c = glob.charAt(i); - if ((c === '!' || c === '^') && i === pos + 1) { - negate = true; - i++; - continue; - } - if (c === ']' && sawStart && !escaping) { - endPos = i + 1; - break; - } - sawStart = true; - if (c === '\\') { - if (!escaping) { - escaping = true; - i++; - continue; +/* harmony default export */ const find_cid_in_shard = (findShardCid); +//# sourceMappingURL=find-cid-in-shard.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/it-peekable/dist/src/index.js +/** + * @packageDocumentation + * + * Lets you look at the contents of an async iterator and decide what to do + * + * @example + * + * ```javascript + * import peekable from 'it-peekable' + * + * // This can also be an iterator, generator, etc + * const values = [0, 1, 2, 3, 4] + * + * const it = peekable(value) + * + * const first = it.peek() + * + * console.info(first) // 0 + * + * it.push(first) + * + * console.info([...it]) + * // [ 0, 1, 2, 3, 4 ] + * ``` + * + * Async sources must be awaited: + * + * ```javascript + * import peekable from 'it-peekable' + * + * const values = async function * () { + * yield * [0, 1, 2, 3, 4] + * } + * + * const it = peekable(values()) + * + * const first = await it.peek() + * + * console.info(first) // 0 + * + * it.push(first) + * + * console.info(await all(it)) + * // [ 0, 1, 2, 3, 4 ] + * ``` + */ +function src_peekable(iterable) { + // @ts-expect-error can't use Symbol.asyncIterator to index iterable since it might be Iterable + const [iterator, symbol] = iterable[Symbol.asyncIterator] != null + // @ts-expect-error can't use Symbol.asyncIterator to index iterable since it might be Iterable + ? [iterable[Symbol.asyncIterator](), Symbol.asyncIterator] + // @ts-expect-error can't use Symbol.iterator to index iterable since it might be AsyncIterable + : [iterable[Symbol.iterator](), Symbol.iterator]; + const queue = []; + // @ts-expect-error can't use symbol to index peekable + return { + peek: () => { + return iterator.next(); + }, + push: (value) => { + queue.push(value); + }, + next: () => { + if (queue.length > 0) { + return { + done: false, + value: queue.shift() + }; } - // escaped \ char, fall through and treat like normal char + return iterator.next(); + }, + [symbol]() { + return this; } - if (c === '[' && !escaping) { - // either a posix class, a collation equivalent, or just a [ - for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) { - if (glob.startsWith(cls, i)) { - // invalid, [a-[] is fine, but not [a-[:alpha]] - if (rangeStart) { - return ['$.', false, glob.length - pos, true]; - } - i += cls.length; - if (neg) - negs.push(unip); - else - ranges.push(unip); - uflag = uflag || u; - continue WHILE; + }; +} +/* harmony default export */ const node_modules_it_peekable_dist_src = (src_peekable); +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/it-filter/dist/src/index.js +/** + * @packageDocumentation + * + * Filter values out of an (async)iterable + * + * @example + * + * ```javascript + * import all from 'it-all' + * import filter from 'it-filter' + * + * // This can also be an iterator, generator, etc + * const values = [0, 1, 2, 3, 4] + * + * const fn = val => val > 2 // Return boolean to keep item + * + * const arr = all(filter(values, fn)) + * + * console.info(arr) // 3, 4 + * ``` + * + * Async sources and filter functions must be awaited: + * + * ```javascript + * import all from 'it-all' + * import filter from 'it-filter' + * + * const values = async function * () { + * yield * [0, 1, 2, 3, 4] + * } + * + * const fn = async val => val > 2 // Return boolean or promise of boolean to keep item + * + * const arr = await all(filter(values, fn)) + * + * console.info(arr) // 3, 4 + * ``` + */ + +function it_filter_dist_src_isAsyncIterable(thing) { + return thing[Symbol.asyncIterator] != null; +} +function src_filter(source, fn) { + if (it_filter_dist_src_isAsyncIterable(source)) { + return (async function* () { + for await (const entry of source) { + if (await fn(entry)) { + yield entry; } } - } - // now it's just a normal character, effectively - escaping = false; - if (rangeStart) { - // throw this range away if it's not valid, but others - // can still match. - if (c > rangeStart) { - ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c)); + })(); + } + // if mapping function returns a promise we have to return an async generator + const peekable = node_modules_it_peekable_dist_src(source); + const { value, done } = peekable.next(); + if (done === true) { + return (function* () { }()); + } + const res = fn(value); + // @ts-expect-error .then is not present on O + if (typeof res.then === 'function') { + return (async function* () { + if (await res) { + yield value; } - else if (c === rangeStart) { - ranges.push(braceEscape(c)); + for await (const entry of peekable) { + if (await fn(entry)) { + yield entry; + } } - rangeStart = ''; - i++; - continue; - } - // now might be the start of a range. - // can be either c-d or c-] or c] or c] at this point - if (glob.startsWith('-]', i + 1)) { - ranges.push(braceEscape(c + '-')); - i += 2; - continue; + })(); + } + const func = fn; + return (function* () { + if (res === true) { + yield value; } - if (glob.startsWith('-', i + 1)) { - rangeStart = c; - i += 2; - continue; + for (const entry of peekable) { + if (func(entry)) { + yield entry; + } } - // not the start of a range, just a single character - ranges.push(braceEscape(c)); - i++; - } - if (endPos < i) { - // didn't see the end of the class, not a valid class, - // but might still be valid as a literal match. - return ['', false, 0, false]; + })(); +} +/* harmony default export */ const it_filter_dist_src = (src_filter); +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/it-map/dist/src/index.js +/** + * @packageDocumentation + * + * Convert one value from an (async)iterator into another. + * + * @example + * + * ```javascript + * import map from 'it-map' + * + * // This can also be an iterator, generator, etc + * const values = [0, 1, 2, 3, 4] + * + * const result = map(values, (val) => val++) + * + * console.info(result) // [1, 2, 3, 4, 5] + * ``` + * + * Async sources and transforms must be awaited: + * + * ```javascript + * import map from 'it-map' + * + * const values = async function * () { + * yield * [0, 1, 2, 3, 4] + * } + * + * const result = await map(values(), async (val) => val++) + * + * console.info(result) // [1, 2, 3, 4, 5] + * ``` + */ + +function node_modules_it_map_dist_src_isAsyncIterable(thing) { + return thing[Symbol.asyncIterator] != null; +} +function dist_src_map(source, func) { + if (node_modules_it_map_dist_src_isAsyncIterable(source)) { + return (async function* () { + for await (const val of source) { + yield func(val); + } + })(); } - // if we got no ranges and no negates, then we have a range that - // cannot possibly match anything, and that poisons the whole glob - if (!ranges.length && !negs.length) { - return ['$.', false, glob.length - pos, true]; + // if mapping function returns a promise we have to return an async generator + const peekable = node_modules_it_peekable_dist_src(source); + const { value, done } = peekable.next(); + if (done === true) { + return (function* () { }()); } - // if we got one positive range, and it's a single character, then that's - // not actually a magic pattern, it's just that one literal character. - // we should not treat that as "magic", we should just return the literal - // character. [_] is a perfectly valid way to escape glob magic chars. - if (negs.length === 0 && - ranges.length === 1 && - /^\\?.$/.test(ranges[0]) && - !negate) { - const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]; - return [regexpEscape(r), false, endPos - pos, false]; + const res = func(value); + // @ts-expect-error .then is not present on O + if (typeof res.then === 'function') { + return (async function* () { + yield await res; + for await (const val of peekable) { + yield func(val); + } + })(); } - const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'; - const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'; - const comb = ranges.length && negs.length - ? '(' + sranges + '|' + snegs + ')' - : ranges.length - ? sranges - : snegs; - return [comb, uflag, endPos - pos, true]; -}; -//# sourceMappingURL=brace-expressions.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/minimatch/dist/mjs/unescape.js + const fn = func; + return (function* () { + yield res; + for (const val of peekable) { + yield fn(val); + } + })(); +} +/* harmony default export */ const node_modules_it_map_dist_src = (dist_src_map); +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/it-parallel/node_modules/p-defer/index.js +function p_defer_pDefer() { + const deferred = {}; + + deferred.promise = new Promise((resolve, reject) => { + deferred.resolve = resolve; + deferred.reject = reject; + }); + + return deferred; +} + +;// CONCATENATED MODULE: ./node_modules/it-parallel/dist/src/index.js /** - * Un-escape a string that has been escaped with {@link escape}. + * @packageDocumentation * - * If the {@link windowsPathsNoEscape} option is used, then square-brace - * escapes are removed, but not backslash escapes. For example, it will turn - * the string `'[*]'` into `*`, but it will not turn `'\\*'` into `'*'`, - * becuase `\` is a path separator in `windowsPathsNoEscape` mode. + * Takes an (async) iterable that emits promise-returning functions, invokes them in parallel up to the concurrency limit and emits the results as they become available, optionally in the same order as the input * - * When `windowsPathsNoEscape` is not set, then both brace escapes and - * backslash escapes are removed. + * @example * - * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped - * or unescaped. + * ```javascript + * import parallel from 'it-parallel' + * import all from 'it-all' + * import delay from 'delay' + * + * // This can also be an iterator, async iterator, generator, etc + * const input = [ + * async () => { + * console.info('start 1') + * await delay(500) + * + * console.info('end 1') + * return 1 + * }, + * async () => { + * console.info('start 2') + * await delay(200) + * + * console.info('end 2') + * return 2 + * }, + * async () => { + * console.info('start 3') + * await delay(100) + * + * console.info('end 3') + * return 3 + * } + * ] + * + * const result = await all(parallel(input, { + * concurrency: 2 + * })) + * + * // output: + * // start 1 + * // start 2 + * // end 2 + * // start 3 + * // end 3 + * // end 1 + * + * console.info(result) // [2, 3, 1] + * ``` + * + * If order is important, pass `ordered: true` as an option: + * + * ```javascript + * const result = await all(parallel(input, { + * concurrency: 2, + * ordered: true + * })) + * + * // output: + * // start 1 + * // start 2 + * // end 2 + * // start 3 + * // end 3 + * // end 1 + * + * console.info(result) // [1, 2, 3] + * ``` */ -const unescape_unescape = (s, { windowsPathsNoEscape = false, } = {}) => { - return windowsPathsNoEscape - ? s.replace(/\[([^\/\\])\]/g, '$1') - : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1'); -}; -//# sourceMappingURL=unescape.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/minimatch/dist/mjs/ast.js -// parse a single path portion - -const ast_types = new Set(['!', '?', '+', '*', '@']); -const isExtglobType = (c) => ast_types.has(c); -// Patterns that get prepended to bind to the start of either the -// entire string, or just a single path portion, to prevent dots -// and/or traversal patterns, when needed. -// Exts don't need the ^ or / bit, because the root binds that already. -const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))'; -const startNoDot = '(?!\\.)'; -// characters that indicate a start of pattern needs the "no dots" bit, -// because a dot *might* be matched. ( is not in the list, because in -// the case of a child extglob, it will handle the prevention itself. -const addPatternStart = new Set(['[', '.']); -// cases where traversal is A-OK, no dot prevention needed -const justDots = new Set(['..', '.']); -const reSpecials = new Set('().*{}+?[]^$\\!'); -const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); -// any single thing other than / -const qmark = '[^/]'; -// * => any number of characters -const star = qmark + '*?'; -// use + when we need to ensure that *something* matches, because the * is -// the only thing in the path portion. -const starNoEmpty = qmark + '+?'; -// remove the \ chars that we added if we end up doing a nonmagic compare -// const deslash = (s: string) => s.replace(/\\(.)/g, '$1') -class AST { - type; - #root; - #hasMagic; - #uflag = false; - #parts = []; - #parent; - #parentIndex; - #negs; - #filledNegs = false; - #options; - #toString; - // set to true if it's an extglob with no children - // (which really means one child of '') - #emptyExt = false; - constructor(type, parent, options = {}) { - this.type = type; - // extglobs are inherently magical - if (type) - this.#hasMagic = true; - this.#parent = parent; - this.#root = this.#parent ? this.#parent.#root : this; - this.#options = this.#root === this ? options : this.#root.#options; - this.#negs = this.#root === this ? [] : this.#root.#negs; - if (type === '!' && !this.#root.#filledNegs) - this.#negs.push(this); - this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0; +const src_CustomEvent = globalThis.CustomEvent ?? Event; +/** + * Takes an (async) iterator that emits promise-returning functions, + * invokes them in parallel and emits the results as they become available but + * in the same order as the input + */ +async function* parallel(source, options = {}) { + let concurrency = options.concurrency ?? Infinity; + if (concurrency < 1) { + concurrency = Infinity; } - get hasMagic() { - /* c8 ignore start */ - if (this.#hasMagic !== undefined) - return this.#hasMagic; - /* c8 ignore stop */ - for (const p of this.#parts) { - if (typeof p === 'string') - continue; - if (p.type || p.hasMagic) - return (this.#hasMagic = true); + const ordered = options.ordered == null ? false : options.ordered; + const emitter = new EventTarget(); + const ops = []; + let slotAvailable = p_defer_pDefer(); + let resultAvailable = p_defer_pDefer(); + let sourceFinished = false; + let sourceErr; + let opErred = false; + emitter.addEventListener('task-complete', () => { + resultAvailable.resolve(); + }); + void Promise.resolve().then(async () => { + try { + for await (const task of source) { + if (ops.length === concurrency) { + slotAvailable = p_defer_pDefer(); + await slotAvailable.promise; + } + if (opErred) { + break; + } + const op = { + done: false + }; + ops.push(op); + task() + .then(result => { + op.done = true; + op.ok = true; + op.value = result; + emitter.dispatchEvent(new src_CustomEvent('task-complete')); + }, err => { + op.done = true; + op.err = err; + emitter.dispatchEvent(new src_CustomEvent('task-complete')); + }); + } + sourceFinished = true; + emitter.dispatchEvent(new src_CustomEvent('task-complete')); } - // note: will be undefined until we generate the regexp src and find out - return this.#hasMagic; - } - // reconstructs the pattern - toString() { - if (this.#toString !== undefined) - return this.#toString; - if (!this.type) { - return (this.#toString = this.#parts.map(p => String(p)).join('')); + catch (err) { + sourceErr = err; + emitter.dispatchEvent(new src_CustomEvent('task-complete')); } - else { - return (this.#toString = - this.type + '(' + this.#parts.map(p => String(p)).join('|') + ')'); + }); + function valuesAvailable() { + if (ordered) { + return ops[0]?.done; } + return Boolean(ops.find(op => op.done)); } - #fillNegs() { - /* c8 ignore start */ - if (this !== this.#root) - throw new Error('should only call on root'); - if (this.#filledNegs) - return this; - /* c8 ignore stop */ - // call toString() once to fill this out - this.toString(); - this.#filledNegs = true; - let n; - while ((n = this.#negs.pop())) { - if (n.type !== '!') - continue; - // walk up the tree, appending everthing that comes AFTER parentIndex - let p = n; - let pp = p.#parent; - while (pp) { - for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) { - for (const part of n.#parts) { - /* c8 ignore start */ - if (typeof part === 'string') { - throw new Error('string part in extglob AST??'); - } - /* c8 ignore stop */ - part.copyIn(pp.#parts[i]); + function* yieldOrderedValues() { + while ((ops.length > 0) && ops[0].done) { + const op = ops[0]; + ops.shift(); + if (op.ok) { + yield op.value; + } + else { + // allow the source to exit + opErred = true; + slotAvailable.resolve(); + throw op.err; + } + slotAvailable.resolve(); + } + } + function* yieldUnOrderedValues() { + // more values can become available while we wait for `yield` + // to return control to this function + while (valuesAvailable()) { + for (let i = 0; i < ops.length; i++) { + if (ops[i].done) { + const op = ops[i]; + ops.splice(i, 1); + i--; + if (op.ok) { + yield op.value; + } + else { + opErred = true; + slotAvailable.resolve(); + throw op.err; } + slotAvailable.resolve(); } - p = pp; - pp = p.#parent; } } - return this; } - push(...parts) { - for (const p of parts) { - if (p === '') - continue; - /* c8 ignore start */ - if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) { - throw new Error('invalid part: ' + p); - } - /* c8 ignore stop */ - this.#parts.push(p); + while (true) { + if (!valuesAvailable()) { + resultAvailable = p_defer_pDefer(); + await resultAvailable.promise; + } + if (sourceErr != null) { + // the source threw an error, propagate it + throw sourceErr; + } + if (ordered) { + yield* yieldOrderedValues(); + } + else { + yield* yieldUnOrderedValues(); + } + if (sourceFinished && ops.length === 0) { + // not waiting for any results and no more tasks so we are done + break; } } - toJSON() { - const ret = this.type === null - ? this.#parts.slice().map(p => (typeof p === 'string' ? p : p.toJSON())) - : [this.type, ...this.#parts.map(p => p.toJSON())]; - if (this.isStart() && !this.type) - ret.unshift([]); - if (this.isEnd() && - (this === this.#root || - (this.#root.#filledNegs && this.#parent?.type === '!'))) { - ret.push({}); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/it-pushable/node_modules/p-defer/index.js +function node_modules_p_defer_pDefer() { + const deferred = {}; + + deferred.promise = new Promise((resolve, reject) => { + deferred.resolve = resolve; + deferred.reject = reject; + }); + + return deferred; +} + +;// CONCATENATED MODULE: ./node_modules/it-pushable/dist/src/fifo.js +// ported from https://www.npmjs.com/package/fast-fifo +class FixedFIFO { + buffer; + mask; + top; + btm; + next; + constructor(hwm) { + if (!(hwm > 0) || ((hwm - 1) & hwm) !== 0) { + throw new Error('Max size for a FixedFIFO should be a power of two'); } - return ret; + this.buffer = new Array(hwm); + this.mask = hwm - 1; + this.top = 0; + this.btm = 0; + this.next = null; } - isStart() { - if (this.#root === this) - return true; - // if (this.type) return !!this.#parent?.isStart() - if (!this.#parent?.isStart()) + push(data) { + if (this.buffer[this.top] !== undefined) { return false; - if (this.#parentIndex === 0) - return true; - // if everything AHEAD of this is a negation, then it's still the "start" - const p = this.#parent; - for (let i = 0; i < this.#parentIndex; i++) { - const pp = p.#parts[i]; - if (!(pp instanceof AST && pp.type === '!')) { - return false; - } } + this.buffer[this.top] = data; + this.top = (this.top + 1) & this.mask; return true; } - isEnd() { - if (this.#root === this) - return true; - if (this.#parent?.type === '!') - return true; - if (!this.#parent?.isEnd()) - return false; - if (!this.type) - return this.#parent?.isEnd(); - // if not root, it'll always have a parent - /* c8 ignore start */ - const pl = this.#parent ? this.#parent.#parts.length : 0; - /* c8 ignore stop */ - return this.#parentIndex === pl - 1; - } - copyIn(part) { - if (typeof part === 'string') - this.push(part); - else - this.push(part.clone(this)); - } - clone(parent) { - const c = new AST(this.type, parent); - for (const p of this.#parts) { - c.copyIn(p); + shift() { + const last = this.buffer[this.btm]; + if (last === undefined) { + return undefined; } - return c; + this.buffer[this.btm] = undefined; + this.btm = (this.btm + 1) & this.mask; + return last; } - static #parseAST(str, ast, pos, opt) { - let escaping = false; - let inBrace = false; - let braceStart = -1; - let braceNeg = false; - if (ast.type === null) { - // outside of a extglob, append until we find a start - let i = pos; - let acc = ''; - while (i < str.length) { - const c = str.charAt(i++); - // still accumulate escapes at this point, but we do ignore - // starts that are escaped - if (escaping || c === '\\') { - escaping = !escaping; - acc += c; - continue; - } - if (inBrace) { - if (i === braceStart + 1) { - if (c === '^' || c === '!') { - braceNeg = true; - } - } - else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { - inBrace = false; - } - acc += c; - continue; - } - else if (c === '[') { - inBrace = true; - braceStart = i; - braceNeg = false; - acc += c; - continue; - } - if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') { - ast.push(acc); - acc = ''; - const ext = new AST(c, ast); - i = AST.#parseAST(str, ext, i, opt); - ast.push(ext); - continue; - } - acc += c; - } - ast.push(acc); - return i; - } - // some kind of extglob, pos is at the ( - // find the next | or ) - let i = pos + 1; - let part = new AST(null, ast); - const parts = []; - let acc = ''; - while (i < str.length) { - const c = str.charAt(i++); - // still accumulate escapes at this point, but we do ignore - // starts that are escaped - if (escaping || c === '\\') { - escaping = !escaping; - acc += c; - continue; - } - if (inBrace) { - if (i === braceStart + 1) { - if (c === '^' || c === '!') { - braceNeg = true; - } - } - else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { - inBrace = false; - } - acc += c; - continue; - } - else if (c === '[') { - inBrace = true; - braceStart = i; - braceNeg = false; - acc += c; - continue; - } - if (isExtglobType(c) && str.charAt(i) === '(') { - part.push(acc); - acc = ''; - const ext = new AST(c, part); - part.push(ext); - i = AST.#parseAST(str, ext, i, opt); - continue; - } - if (c === '|') { - part.push(acc); - acc = ''; - parts.push(part); - part = new AST(null, ast); - continue; - } - if (c === ')') { - if (acc === '' && ast.#parts.length === 0) { - ast.#emptyExt = true; - } - part.push(acc); - acc = ''; - ast.push(...parts, part); - return i; - } - acc += c; - } - // unfinished extglob - // if we got here, it was a malformed extglob! not an extglob, but - // maybe something else in there. - ast.type = null; - ast.#hasMagic = undefined; - ast.#parts = [str.substring(pos - 1)]; - return i; + isEmpty() { + return this.buffer[this.btm] === undefined; } - static fromGlob(pattern, options = {}) { - const ast = new AST(null, undefined, options); - AST.#parseAST(pattern, ast, 0, options); - return ast; +} +class FIFO { + size; + hwm; + head; + tail; + constructor(options = {}) { + this.hwm = options.splitLimit ?? 16; + this.head = new FixedFIFO(this.hwm); + this.tail = this.head; + this.size = 0; } - // returns the regular expression if there's magic, or the unescaped - // string if not. - toMMPattern() { - // should only be called on root - /* c8 ignore start */ - if (this !== this.#root) - return this.#root.toMMPattern(); - /* c8 ignore stop */ - const glob = this.toString(); - const [re, body, hasMagic, uflag] = this.toRegExpSource(); - // if we're in nocase mode, and not nocaseMagicOnly, then we do - // still need a regular expression if we have to case-insensitively - // match capital/lowercase characters. - const anyMagic = hasMagic || - this.#hasMagic || - (this.#options.nocase && - !this.#options.nocaseMagicOnly && - glob.toUpperCase() !== glob.toLowerCase()); - if (!anyMagic) { - return body; + calculateSize(obj) { + if (obj?.byteLength != null) { + return obj.byteLength; } - const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : ''); - return Object.assign(new RegExp(`^${re}$`, flags), { - _src: re, - _glob: glob, - }); + return 1; } - // returns the string match, the regexp source, whether there's magic - // in the regexp (so a regular expression is required) and whether or - // not the uflag is needed for the regular expression (for posix classes) - // TODO: instead of injecting the start/end at this point, just return - // the BODY of the regexp, along with the start/end portions suitable - // for binding the start/end in either a joined full-path makeRe context - // (where we bind to (^|/), or a standalone matchPart context (where - // we bind to ^, and not /). Otherwise slashes get duped! - // - // In part-matching mode, the start is: - // - if not isStart: nothing - // - if traversal possible, but not allowed: ^(?!\.\.?$) - // - if dots allowed or not possible: ^ - // - if dots possible and not allowed: ^(?!\.) - // end is: - // - if not isEnd(): nothing - // - else: $ - // - // In full-path matching mode, we put the slash at the START of the - // pattern, so start is: - // - if first pattern: same as part-matching mode - // - if not isStart(): nothing - // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/)) - // - if dots allowed or not possible: / - // - if dots possible and not allowed: /(?!\.) - // end is: - // - if last pattern, same as part-matching mode - // - else nothing - // - // Always put the (?:$|/) on negated tails, though, because that has to be - // there to bind the end of the negated pattern portion, and it's easier to - // just stick it in now rather than try to inject it later in the middle of - // the pattern. - // - // We can just always return the same end, and leave it up to the caller - // to know whether it's going to be used joined or in parts. - // And, if the start is adjusted slightly, can do the same there: - // - if not isStart: nothing - // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$) - // - if dots allowed or not possible: (?:/|^) - // - if dots possible and not allowed: (?:/|^)(?!\.) - // - // But it's better to have a simpler binding without a conditional, for - // performance, so probably better to return both start options. - // - // Then the caller just ignores the end if it's not the first pattern, - // and the start always gets applied. - // - // But that's always going to be $ if it's the ending pattern, or nothing, - // so the caller can just attach $ at the end of the pattern when building. - // - // So the todo is: - // - better detect what kind of start is needed - // - return both flavors of starting pattern - // - attach $ at the end of the pattern when creating the actual RegExp - // - // Ah, but wait, no, that all only applies to the root when the first pattern - // is not an extglob. If the first pattern IS an extglob, then we need all - // that dot prevention biz to live in the extglob portions, because eg - // +(*|.x*) can match .xy but not .yx. - // - // So, return the two flavors if it's #root and the first child is not an - // AST, otherwise leave it to the child AST to handle it, and there, - // use the (?:^|/) style of start binding. - // - // Even simplified further: - // - Since the start for a join is eg /(?!\.) and the start for a part - // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root - // or start or whatever) and prepend ^ or / at the Regexp construction. - toRegExpSource(allowDot) { - const dot = allowDot ?? !!this.#options.dot; - if (this.#root === this) - this.#fillNegs(); - if (!this.type) { - const noEmpty = this.isStart() && this.isEnd(); - const src = this.#parts - .map(p => { - const [re, _, hasMagic, uflag] = typeof p === 'string' - ? AST.#parseGlob(p, this.#hasMagic, noEmpty) - : p.toRegExpSource(allowDot); - this.#hasMagic = this.#hasMagic || hasMagic; - this.#uflag = this.#uflag || uflag; - return re; - }) - .join(''); - let start = ''; - if (this.isStart()) { - if (typeof this.#parts[0] === 'string') { - // this is the string that will match the start of the pattern, - // so we need to protect against dots and such. - // '.' and '..' cannot match unless the pattern is that exactly, - // even if it starts with . or dot:true is set. - const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]); - if (!dotTravAllowed) { - const aps = addPatternStart; - // check if we have a possibility of matching . or .., - // and prevent that. - const needNoTrav = - // dots are allowed, and the pattern starts with [ or . - (dot && aps.has(src.charAt(0))) || - // the pattern starts with \., and then [ or . - (src.startsWith('\\.') && aps.has(src.charAt(2))) || - // the pattern starts with \.\., and then [ or . - (src.startsWith('\\.\\.') && aps.has(src.charAt(4))); - // no need to prevent dots if it can't match a dot, or if a - // sub-pattern will be preventing it anyway. - const needNoDot = !dot && !allowDot && aps.has(src.charAt(0)); - start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : ''; - } - } - } - // append the "end of path portion" pattern to negation tails - let end = ''; - if (this.isEnd() && - this.#root.#filledNegs && - this.#parent?.type === '!') { - end = '(?:$|\\/)'; - } - const final = start + src + end; - return [ - final, - unescape_unescape(src), - (this.#hasMagic = !!this.#hasMagic), - this.#uflag, - ]; - } - // We need to calculate the body *twice* if it's a repeat pattern - // at the start, once in nodot mode, then again in dot mode, so a - // pattern like *(?) can match 'x.y' - const repeated = this.type === '*' || this.type === '+'; - // some kind of extglob - const start = this.type === '!' ? '(?:(?!(?:' : '(?:'; - let body = this.#partsToRegExp(dot); - if (this.isStart() && this.isEnd() && !body && this.type !== '!') { - // invalid extglob, has to at least be *something* present, if it's - // the entire path portion. - const s = this.toString(); - this.#parts = [s]; - this.type = null; - this.#hasMagic = undefined; - return [s, unescape_unescape(this.toString()), false, false]; - } - // XXX abstract out this map method - let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot - ? '' - : this.#partsToRegExp(true); - if (bodyDotAllowed === body) { - bodyDotAllowed = ''; + push(val) { + if (val?.value != null) { + this.size += this.calculateSize(val.value); } - if (bodyDotAllowed) { - body = `(?:${body})(?:${bodyDotAllowed})*?`; + if (!this.head.push(val)) { + const prev = this.head; + this.head = prev.next = new FixedFIFO(2 * this.head.buffer.length); + this.head.push(val); } - // an empty !() is exactly equivalent to a starNoEmpty - let final = ''; - if (this.type === '!' && this.#emptyExt) { - final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty; + } + shift() { + let val = this.tail.shift(); + if (val === undefined && (this.tail.next != null)) { + const next = this.tail.next; + this.tail.next = null; + this.tail = next; + val = this.tail.shift(); } - else { - const close = this.type === '!' - ? // !() must match something,but !(x) can match '' - '))' + - (this.isStart() && !dot && !allowDot ? startNoDot : '') + - star + - ')' - : this.type === '@' - ? ')' - : this.type === '?' - ? ')?' - : this.type === '+' && bodyDotAllowed - ? ')' - : this.type === '*' && bodyDotAllowed - ? `)?` - : `)${this.type}`; - final = start + body + close; + if (val?.value != null) { + this.size -= this.calculateSize(val.value); } - return [ - final, - unescape_unescape(body), - (this.#hasMagic = !!this.#hasMagic), - this.#uflag, - ]; - } - #partsToRegExp(dot) { - return this.#parts - .map(p => { - // extglob ASTs should only contain parent ASTs - /* c8 ignore start */ - if (typeof p === 'string') { - throw new Error('string type in extglob ast??'); - } - /* c8 ignore stop */ - // can ignore hasMagic, because extglobs are already always magic - const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot); - this.#uflag = this.#uflag || uflag; - return re; - }) - .filter(p => !(this.isStart() && this.isEnd()) || !!p) - .join('|'); + return val; } - static #parseGlob(glob, hasMagic, noEmpty = false) { - let escaping = false; - let re = ''; - let uflag = false; - for (let i = 0; i < glob.length; i++) { - const c = glob.charAt(i); - if (escaping) { - escaping = false; - re += (reSpecials.has(c) ? '\\' : '') + c; - continue; - } - if (c === '\\') { - if (i === glob.length - 1) { - re += '\\\\'; - } - else { - escaping = true; - } - continue; - } - if (c === '[') { - const [src, needUflag, consumed, magic] = parseClass(glob, i); - if (consumed) { - re += src; - uflag = uflag || needUflag; - i += consumed - 1; - hasMagic = hasMagic || magic; - continue; - } - } - if (c === '*') { - if (noEmpty && glob === '*') - re += starNoEmpty; - else - re += star; - hasMagic = true; - continue; - } - if (c === '?') { - re += qmark; - hasMagic = true; - continue; - } - re += regExpEscape(c); - } - return [re, unescape_unescape(glob), !!hasMagic, uflag]; + isEmpty() { + return this.head.isEmpty(); } } -//# sourceMappingURL=ast.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/minimatch/dist/mjs/escape.js +//# sourceMappingURL=fifo.js.map +;// CONCATENATED MODULE: ./node_modules/it-pushable/dist/src/index.js /** - * Escape all magic characters in a glob pattern. + * @packageDocumentation * - * If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape} - * option is used, then characters are escaped by wrapping in `[]`, because - * a magic character wrapped in a character class can only be satisfied by - * that exact character. In this mode, `\` is _not_ escaped, because it is - * not interpreted as a magic character, but instead as a path separator. + * An iterable that you can push values into. + * + * @example + * + * ```js + * import { pushable } from 'it-pushable' + * + * const source = pushable() + * + * setTimeout(() => source.push('hello'), 100) + * setTimeout(() => source.push('world'), 200) + * setTimeout(() => source.end(), 300) + * + * const start = Date.now() + * + * for await (const value of source) { + * console.log(`got "${value}" after ${Date.now() - start}ms`) + * } + * console.log(`done after ${Date.now() - start}ms`) + * + * // Output: + * // got "hello" after 105ms + * // got "world" after 207ms + * // done after 309ms + * ``` + * + * @example + * + * ```js + * import { pushableV } from 'it-pushable' + * import all from 'it-all' + * + * const source = pushableV() + * + * source.push(1) + * source.push(2) + * source.push(3) + * source.end() + * + * console.info(await all(source)) + * + * // Output: + * // [ [1, 2, 3] ] + * ``` */ -const escape_escape = (s, { windowsPathsNoEscape = false, } = {}) => { - // don't need to escape +@! because we escape the parens - // that make those magic, and escaping ! as [!] isn't valid, - // because [!]] is a valid glob class meaning not ']'. - return windowsPathsNoEscape - ? s.replace(/[?*()[\]]/g, '[$&]') - : s.replace(/[?*()[\]\\]/g, '\\$&'); -}; -//# sourceMappingURL=escape.js.map -;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/minimatch/dist/mjs/index.js - - - -const mjs_minimatch = (p, pattern, options = {}) => { - assertValidPattern(pattern); - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false; - } - return new Minimatch(pattern, options).match(p); -}; -// Optimized checking for the most common glob patterns. -const starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/; -const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext); -const starDotExtTestDot = (ext) => (f) => f.endsWith(ext); -const starDotExtTestNocase = (ext) => { - ext = ext.toLowerCase(); - return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext); -}; -const starDotExtTestNocaseDot = (ext) => { - ext = ext.toLowerCase(); - return (f) => f.toLowerCase().endsWith(ext); -}; -const starDotStarRE = /^\*+\.\*+$/; -const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.'); -const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.'); -const dotStarRE = /^\.\*+$/; -const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.'); -const starRE = /^\*+$/; -const starTest = (f) => f.length !== 0 && !f.startsWith('.'); -const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..'; -const qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/; -const qmarksTestNocase = ([$0, ext = '']) => { - const noext = qmarksTestNoExt([$0]); - if (!ext) - return noext; - ext = ext.toLowerCase(); - return (f) => noext(f) && f.toLowerCase().endsWith(ext); -}; -const qmarksTestNocaseDot = ([$0, ext = '']) => { - const noext = qmarksTestNoExtDot([$0]); - if (!ext) - return noext; - ext = ext.toLowerCase(); - return (f) => noext(f) && f.toLowerCase().endsWith(ext); -}; -const qmarksTestDot = ([$0, ext = '']) => { - const noext = qmarksTestNoExtDot([$0]); - return !ext ? noext : (f) => noext(f) && f.endsWith(ext); -}; -const qmarksTest = ([$0, ext = '']) => { - const noext = qmarksTestNoExt([$0]); - return !ext ? noext : (f) => noext(f) && f.endsWith(ext); -}; -const qmarksTestNoExt = ([$0]) => { - const len = $0.length; - return (f) => f.length === len && !f.startsWith('.'); -}; -const qmarksTestNoExtDot = ([$0]) => { - const len = $0.length; - return (f) => f.length === len && f !== '.' && f !== '..'; -}; -/* c8 ignore start */ -const defaultPlatform = (typeof process === 'object' && process - ? (typeof process.env === 'object' && - process.env && - process.env.__MINIMATCH_TESTING_PLATFORM__) || - process.platform - : 'posix'); -const mjs_path = { - win32: { sep: '\\' }, - posix: { sep: '/' }, -}; -/* c8 ignore stop */ -const sep = defaultPlatform === 'win32' ? mjs_path.win32.sep : mjs_path.posix.sep; -mjs_minimatch.sep = sep; -const GLOBSTAR = Symbol('globstar **'); -mjs_minimatch.GLOBSTAR = GLOBSTAR; -// any single thing other than / -// don't need to escape / when using new RegExp() -const mjs_qmark = '[^/]'; -// * => any number of characters -const mjs_star = mjs_qmark + '*?'; -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?'; -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?'; -const mjs_filter = (pattern, options = {}) => (p) => mjs_minimatch(p, pattern, options); -mjs_minimatch.filter = mjs_filter; -const ext = (a, b = {}) => Object.assign({}, a, b); -const mjs_defaults = (def) => { - if (!def || typeof def !== 'object' || !Object.keys(def).length) { - return mjs_minimatch; +class src_AbortError extends Error { + type; + code; + constructor(message, code) { + super(message ?? 'The operation was aborted'); + this.type = 'aborted'; + this.code = code ?? 'ABORT_ERR'; } - const orig = mjs_minimatch; - const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options)); - return Object.assign(m, { - Minimatch: class Minimatch extends orig.Minimatch { - constructor(pattern, options = {}) { - super(pattern, ext(def, options)); - } - static defaults(options) { - return orig.defaults(ext(def, options)).Minimatch; +} +function src_pushable(options = {}) { + const getNext = (buffer) => { + const next = buffer.shift(); + if (next == null) { + return { done: true }; + } + if (next.error != null) { + throw next.error; + } + return { + done: next.done === true, + // @ts-expect-error if done is false, value will be present + value: next.value + }; + }; + return _pushable(getNext, options); +} +function pushableV(options = {}) { + const getNext = (buffer) => { + let next; + const values = []; + while (!buffer.isEmpty()) { + next = buffer.shift(); + if (next == null) { + break; } - }, - AST: class AST extends orig.AST { - /* c8 ignore start */ - constructor(type, parent, options = {}) { - super(type, parent, ext(def, options)); + if (next.error != null) { + throw next.error; } - /* c8 ignore stop */ - static fromGlob(pattern, options = {}) { - return orig.AST.fromGlob(pattern, ext(def, options)); + if (next.done === false) { + // @ts-expect-error if done is false value should be pushed + values.push(next.value); } - }, - unescape: (s, options = {}) => orig.unescape(s, ext(def, options)), - escape: (s, options = {}) => orig.escape(s, ext(def, options)), - filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)), - defaults: (options) => orig.defaults(ext(def, options)), - makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)), - braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)), - match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)), - sep: orig.sep, - GLOBSTAR: GLOBSTAR, - }); -}; -mjs_minimatch.defaults = mjs_defaults; -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -const braceExpand = (pattern, options = {}) => { - assertValidPattern(pattern); - // Thanks to Yeting Li for - // improving this regexp to avoid a ReDOS vulnerability. - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - // shortcut. no need to expand. - return [pattern]; - } - return brace_expansion(pattern); -}; -mjs_minimatch.braceExpand = braceExpand; -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe(); -mjs_minimatch.makeRe = makeRe; -const match = (list, pattern, options = {}) => { - const mm = new Minimatch(pattern, options); - list = list.filter(f => mm.match(f)); - if (mm.options.nonull && !list.length) { - list.push(pattern); - } - return list; -}; -mjs_minimatch.match = match; -// replace stuff like \* with * -const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/; -const mjs_regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); -class Minimatch { - options; - set; - pattern; - windowsPathsNoEscape; - nonegate; - negate; - comment; - empty; - preserveMultipleSlashes; - partial; - globSet; - globParts; - nocase; - isWindows; - platform; - windowsNoMagicRoot; - regexp; - constructor(pattern, options = {}) { - assertValidPattern(pattern); - options = options || {}; - this.options = options; - this.pattern = pattern; - this.platform = options.platform || defaultPlatform; - this.isWindows = this.platform === 'win32'; - this.windowsPathsNoEscape = - !!options.windowsPathsNoEscape || options.allowWindowsEscape === false; - if (this.windowsPathsNoEscape) { - this.pattern = this.pattern.replace(/\\/g, '/'); } - this.preserveMultipleSlashes = !!options.preserveMultipleSlashes; - this.regexp = null; - this.negate = false; - this.nonegate = !!options.nonegate; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.nocase = !!this.options.nocase; - this.windowsNoMagicRoot = - options.windowsNoMagicRoot !== undefined - ? options.windowsNoMagicRoot - : !!(this.isWindows && this.nocase); - this.globSet = []; - this.globParts = []; - this.set = []; - // make the set of regexps etc. - this.make(); - } - hasMagic() { - if (this.options.magicalBraces && this.set.length > 1) { - return true; + if (next == null) { + return { done: true }; } - for (const pattern of this.set) { - for (const part of pattern) { - if (typeof part !== 'string') - return true; + return { + done: next.done === true, + value: values + }; + }; + return _pushable(getNext, options); +} +function _pushable(getNext, options) { + options = options ?? {}; + let onEnd = options.onEnd; + let buffer = new FIFO(); + let pushable; + let onNext; + let ended; + let drain = node_modules_p_defer_pDefer(); + const waitNext = async () => { + try { + if (!buffer.isEmpty()) { + return getNext(buffer); + } + if (ended) { + return { done: true }; + } + return await new Promise((resolve, reject) => { + onNext = (next) => { + onNext = null; + buffer.push(next); + try { + resolve(getNext(buffer)); + } + catch (err) { + reject(err); + } + return pushable; + }; + }); + } + finally { + if (buffer.isEmpty()) { + // settle promise in the microtask queue to give consumers a chance to + // await after calling .push + queueMicrotask(() => { + drain.resolve(); + drain = node_modules_p_defer_pDefer(); + }); } } - return false; - } - debug(..._) { } - make() { - const pattern = this.pattern; - const options = this.options; - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true; - return; + }; + const bufferNext = (next) => { + if (onNext != null) { + return onNext(next); + } + buffer.push(next); + return pushable; + }; + const bufferError = (err) => { + buffer = new FIFO(); + if (onNext != null) { + return onNext({ error: err }); } - if (!pattern) { - this.empty = true; - return; + buffer.push({ error: err }); + return pushable; + }; + const push = (value) => { + if (ended) { + return pushable; } - // step 1: figure out negation, etc. - this.parseNegate(); - // step 2: expand braces - this.globSet = [...new Set(this.braceExpand())]; - if (options.debug) { - this.debug = (...args) => console.error(...args); + // @ts-expect-error `byteLength` is not declared on PushType + if (options?.objectMode !== true && value?.byteLength == null) { + throw new Error('objectMode was not true but tried to push non-Uint8Array value'); } - this.debug(this.pattern, this.globSet); - // step 3: now we have a set, so turn each one into a series of - // path-portion matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - // - // First, we preprocess to make the glob pattern sets a bit simpler - // and deduped. There are some perf-killing patterns that can cause - // problems with a glob walk, but we can simplify them down a bit. - const rawGlobParts = this.globSet.map(s => this.slashSplit(s)); - this.globParts = this.preprocess(rawGlobParts); - this.debug(this.pattern, this.globParts); - // glob --> regexps - let set = this.globParts.map((s, _, __) => { - if (this.isWindows && this.windowsNoMagicRoot) { - // check if it's a drive or unc path. - const isUNC = s[0] === '' && - s[1] === '' && - (s[2] === '?' || !globMagic.test(s[2])) && - !globMagic.test(s[3]); - const isDrive = /^[a-z]:/i.test(s[0]); - if (isUNC) { - return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))]; - } - else if (isDrive) { - return [s[0], ...s.slice(1).map(ss => this.parse(ss))]; - } + return bufferNext({ done: false, value }); + }; + const end = (err) => { + if (ended) + return pushable; + ended = true; + return (err != null) ? bufferError(err) : bufferNext({ done: true }); + }; + const _return = () => { + buffer = new FIFO(); + end(); + return { done: true }; + }; + const _throw = (err) => { + end(err); + return { done: true }; + }; + pushable = { + [Symbol.asyncIterator]() { return this; }, + next: waitNext, + return: _return, + throw: _throw, + push, + end, + get readableLength() { + return buffer.size; + }, + onEmpty: async (options) => { + const signal = options?.signal; + signal?.throwIfAborted(); + if (buffer.isEmpty()) { + return; } - return s.map(ss => this.parse(ss)); - }); - this.debug(this.pattern, set); - // filter out everything that didn't compile properly. - this.set = set.filter(s => s.indexOf(false) === -1); - // do not treat the ? in UNC paths as magic - if (this.isWindows) { - for (let i = 0; i < this.set.length; i++) { - const p = this.set[i]; - if (p[0] === '' && - p[1] === '' && - this.globParts[i][2] === '?' && - typeof p[3] === 'string' && - /^[a-z]:$/i.test(p[3])) { - p[2] = '?'; + let cancel; + let listener; + if (signal != null) { + cancel = new Promise((resolve, reject) => { + listener = () => { + reject(new src_AbortError()); + }; + signal.addEventListener('abort', listener); + }); + } + try { + await Promise.race([ + drain.promise, + cancel + ]); + } + finally { + if (listener != null && signal != null) { + signal?.removeEventListener('abort', listener); } } } - this.debug(this.pattern, this.set); + }; + if (onEnd == null) { + return pushable; } - // various transforms to equivalent pattern sets that are - // faster to process in a filesystem walk. The goal is to - // eliminate what we can, and push all ** patterns as far - // to the right as possible, even if it increases the number - // of patterns that we have to process. - preprocess(globParts) { - // if we're not in globstar mode, then turn all ** into * - if (this.options.noglobstar) { - for (let i = 0; i < globParts.length; i++) { - for (let j = 0; j < globParts[i].length; j++) { - if (globParts[i][j] === '**') { - globParts[i][j] = '*'; - } - } + const _pushable = pushable; + pushable = { + [Symbol.asyncIterator]() { return this; }, + next() { + return _pushable.next(); + }, + throw(err) { + _pushable.throw(err); + if (onEnd != null) { + onEnd(err); + onEnd = undefined; } + return { done: true }; + }, + return() { + _pushable.return(); + if (onEnd != null) { + onEnd(); + onEnd = undefined; + } + return { done: true }; + }, + push, + end(err) { + _pushable.end(err); + if (onEnd != null) { + onEnd(err); + onEnd = undefined; + } + return pushable; + }, + get readableLength() { + return _pushable.readableLength; + }, + onEmpty: (opts) => { + return _pushable.onEmpty(opts); } - const { optimizationLevel = 1 } = this.options; - if (optimizationLevel >= 2) { - // aggressive optimization for the purpose of fs walking - globParts = this.firstPhasePreProcess(globParts); - globParts = this.secondPhasePreProcess(globParts); - } - else if (optimizationLevel >= 1) { - // just basic optimizations to remove some .. parts - globParts = this.levelOneOptimize(globParts); - } - else { - globParts = this.adjascentGlobstarOptimize(globParts); + }; + return pushable; +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/it-merge/dist/src/index.js +/** + * @packageDocumentation + * + * Merge several (async)iterables into one, yield values as they arrive. + * + * Nb. sources are iterated over in parallel so the order of emitted items is not guaranteed. + * + * @example + * + * ```javascript + * import merge from 'it-merge' + * import all from 'it-all' + * + * // This can also be an iterator, generator, etc + * const values1 = [0, 1, 2, 3, 4] + * const values2 = [5, 6, 7, 8, 9] + * + * const arr = all(merge(values1, values2)) + * + * console.info(arr) // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 + * ``` + * + * Async sources must be awaited: + * + * ```javascript + * import merge from 'it-merge' + * import all from 'it-all' + * + * // This can also be an iterator, async iterator, generator, etc + * const values1 = async function * () { + * yield * [0, 1, 2, 3, 4] + * } + * const values2 = async function * () { + * yield * [5, 6, 7, 8, 9] + * } + * + * const arr = await all(merge(values1(), values2())) + * + * console.info(arr) // 0, 1, 5, 6, 2, 3, 4, 7, 8, 9 <- nb. order is not guaranteed + * ``` + */ + +function it_merge_dist_src_isAsyncIterable(thing) { + return thing[Symbol.asyncIterator] != null; +} +function src_merge(...sources) { + const syncSources = []; + for (const source of sources) { + if (!it_merge_dist_src_isAsyncIterable(source)) { + syncSources.push(source); } - return globParts; } - // just get rid of adjascent ** portions - adjascentGlobstarOptimize(globParts) { - return globParts.map(parts => { - let gs = -1; - while (-1 !== (gs = parts.indexOf('**', gs + 1))) { - let i = gs; - while (parts[i + 1] === '**') { - i++; - } - if (i !== gs) { - parts.splice(gs, i - gs); - } + if (syncSources.length === sources.length) { + // all sources are synchronous + return (function* () { + for (const source of syncSources) { + yield* source; } - return parts; - }); + })(); } - // get rid of adjascent ** and resolve .. portions - levelOneOptimize(globParts) { - return globParts.map(parts => { - parts = parts.reduce((set, part) => { - const prev = set[set.length - 1]; - if (part === '**' && prev === '**') { - return set; - } - if (part === '..') { - if (prev && prev !== '..' && prev !== '.' && prev !== '**') { - set.pop(); - return set; - } - } - set.push(part); - return set; - }, []); - return parts.length === 0 ? [''] : parts; + return (async function* () { + const output = src_pushable({ + objectMode: true }); - } - levelTwoFileOptimize(parts) { - if (!Array.isArray(parts)) { - parts = this.slashSplit(parts); - } - let didSomething = false; - do { - didSomething = false; - //
// -> 
/
-            if (!this.preserveMultipleSlashes) {
-                for (let i = 1; i < parts.length - 1; i++) {
-                    const p = parts[i];
-                    // don't squeeze out UNC patterns
-                    if (i === 1 && p === '' && parts[0] === '')
-                        continue;
-                    if (p === '.' || p === '') {
-                        didSomething = true;
-                        parts.splice(i, 1);
-                        i--;
+        void Promise.resolve().then(async () => {
+            try {
+                await Promise.all(sources.map(async (source) => {
+                    for await (const item of source) {
+                        output.push(item);
                     }
-                }
-                if (parts[0] === '.' &&
-                    parts.length === 2 &&
-                    (parts[1] === '.' || parts[1] === '')) {
-                    didSomething = true;
-                    parts.pop();
-                }
+                }));
+                output.end();
             }
-            // 
/

/../ ->

/
-            let dd = 0;
-            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
-                const p = parts[dd - 1];
-                if (p && p !== '.' && p !== '..' && p !== '**') {
-                    didSomething = true;
-                    parts.splice(dd - 1, 2);
-                    dd -= 2;
-                }
+            catch (err) {
+                output.end(err);
             }
-        } while (didSomething);
-        return parts.length === 0 ? [''] : parts;
+        });
+        yield* output;
+    })();
+}
+/* harmony default export */ const it_merge_dist_src = (src_merge);
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/it-pipe/dist/src/index.js
+
+
+function pipe(first, ...rest) {
+    if (first == null) {
+        throw new Error('Empty pipeline');
     }
-    // First phase: single-pattern processing
-    // 
 is 1 or more portions
-    //  is 1 or more portions
-    // 

is any portion other than ., .., '', or ** - // is . or '' - // - // **/.. is *brutal* for filesystem walking performance, because - // it effectively resets the recursive walk each time it occurs, - // and ** cannot be reduced out by a .. pattern part like a regexp - // or most strings (other than .., ., and '') can be. - // - //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} - //

// -> 
/
-    // 
/

/../ ->

/
-    // **/**/ -> **/
-    //
-    // **/*/ -> */**/ <== not valid because ** doesn't follow
-    // this WOULD be allowed if ** did follow symlinks, or * didn't
-    firstPhasePreProcess(globParts) {
-        let didSomething = false;
-        do {
-            didSomething = false;
-            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} - for (let parts of globParts) { - let gs = -1; - while (-1 !== (gs = parts.indexOf('**', gs + 1))) { - let gss = gs; - while (parts[gss + 1] === '**') { - //

/**/**/ -> 
/**/
-                        gss++;
-                    }
-                    // eg, if gs is 2 and gss is 4, that means we have 3 **
-                    // parts, and can remove 2 of them.
-                    if (gss > gs) {
-                        parts.splice(gs + 1, gss - gs);
-                    }
-                    let next = parts[gs + 1];
-                    const p = parts[gs + 2];
-                    const p2 = parts[gs + 3];
-                    if (next !== '..')
-                        continue;
-                    if (!p ||
-                        p === '.' ||
-                        p === '..' ||
-                        !p2 ||
-                        p2 === '.' ||
-                        p2 === '..') {
-                        continue;
-                    }
-                    didSomething = true;
-                    // edit parts in place, and push the new one
-                    parts.splice(gs, 1);
-                    const other = parts.slice(0);
-                    other[gs] = '**';
-                    globParts.push(other);
-                    gs--;
-                }
-                // 
// -> 
/
-                if (!this.preserveMultipleSlashes) {
-                    for (let i = 1; i < parts.length - 1; i++) {
-                        const p = parts[i];
-                        // don't squeeze out UNC patterns
-                        if (i === 1 && p === '' && parts[0] === '')
-                            continue;
-                        if (p === '.' || p === '') {
-                            didSomething = true;
-                            parts.splice(i, 1);
-                            i--;
-                        }
-                    }
-                    if (parts[0] === '.' &&
-                        parts.length === 2 &&
-                        (parts[1] === '.' || parts[1] === '')) {
-                        didSomething = true;
-                        parts.pop();
-                    }
-                }
-                // 
/

/../ ->

/
-                let dd = 0;
-                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
-                    const p = parts[dd - 1];
-                    if (p && p !== '.' && p !== '..' && p !== '**') {
-                        didSomething = true;
-                        const needDot = dd === 1 && parts[dd + 1] === '**';
-                        const splin = needDot ? ['.'] : [];
-                        parts.splice(dd - 1, 2, ...splin);
-                        if (parts.length === 0)
-                            parts.push('');
-                        dd -= 2;
-                    }
-                }
-            }
-        } while (didSomething);
-        return globParts;
+    // Duplex at start: wrap in function and return duplex source
+    if (isDuplex(first)) {
+        const duplex = first;
+        first = () => duplex.source;
+        // Iterable at start: wrap in function
     }
-    // second phase: multi-pattern dedupes
-    // {
/*/,
/

/} ->

/*/
-    // {
/,
/} -> 
/
-    // {
/**/,
/} -> 
/**/
-    //
-    // {
/**/,
/**/

/} ->

/**/
-    // ^-- not valid because ** doens't follow symlinks
-    secondPhasePreProcess(globParts) {
-        for (let i = 0; i < globParts.length - 1; i++) {
-            for (let j = i + 1; j < globParts.length; j++) {
-                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
-                if (!matched)
-                    continue;
-                globParts[i] = matched;
-                globParts[j] = [];
-            }
+    else if (src_isIterable(first) || it_pipe_dist_src_isAsyncIterable(first)) {
+        const source = first;
+        first = () => source;
+    }
+    const fns = [first, ...rest];
+    if (fns.length > 1) {
+        // Duplex at end: use duplex sink
+        if (isDuplex(fns[fns.length - 1])) {
+            fns[fns.length - 1] = fns[fns.length - 1].sink;
         }
-        return globParts.filter(gs => gs.length);
     }
-    partsMatch(a, b, emptyGSMatch = false) {
-        let ai = 0;
-        let bi = 0;
-        let result = [];
-        let which = '';
-        while (ai < a.length && bi < b.length) {
-            if (a[ai] === b[bi]) {
-                result.push(which === 'b' ? b[bi] : a[ai]);
-                ai++;
-                bi++;
-            }
-            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
-                result.push(a[ai]);
-                ai++;
-            }
-            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
-                result.push(b[bi]);
-                bi++;
+    if (fns.length > 2) {
+        // Duplex in the middle, consume source with duplex sink and return duplex source
+        for (let i = 1; i < fns.length - 1; i++) {
+            if (isDuplex(fns[i])) {
+                fns[i] = duplexPipelineFn(fns[i]);
             }
-            else if (a[ai] === '*' &&
-                b[bi] &&
-                (this.options.dot || !b[bi].startsWith('.')) &&
-                b[bi] !== '**') {
-                if (which === 'b')
-                    return false;
-                which = 'a';
-                result.push(a[ai]);
-                ai++;
-                bi++;
+        }
+    }
+    return rawPipe(...fns);
+}
+const rawPipe = (...fns) => {
+    let res;
+    while (fns.length > 0) {
+        res = fns.shift()(res);
+    }
+    return res;
+};
+const it_pipe_dist_src_isAsyncIterable = (obj) => {
+    return obj?.[Symbol.asyncIterator] != null;
+};
+const src_isIterable = (obj) => {
+    return obj?.[Symbol.iterator] != null;
+};
+const isDuplex = (obj) => {
+    if (obj == null) {
+        return false;
+    }
+    return obj.sink != null && obj.source != null;
+};
+const duplexPipelineFn = (duplex) => {
+    return (source) => {
+        const p = duplex.sink(source);
+        if (p?.then != null) {
+            const stream = src_pushable({
+                objectMode: true
+            });
+            p.then(() => {
+                stream.end();
+            }, (err) => {
+                stream.end(err);
+            });
+            let sourceWrap;
+            const source = duplex.source;
+            if (it_pipe_dist_src_isAsyncIterable(source)) {
+                sourceWrap = async function* () {
+                    yield* source;
+                    stream.end();
+                };
             }
-            else if (b[bi] === '*' &&
-                a[ai] &&
-                (this.options.dot || !a[ai].startsWith('.')) &&
-                a[ai] !== '**') {
-                if (which === 'a')
-                    return false;
-                which = 'b';
-                result.push(b[bi]);
-                ai++;
-                bi++;
+            else if (src_isIterable(source)) {
+                sourceWrap = function* () {
+                    yield* source;
+                    stream.end();
+                };
             }
             else {
-                return false;
+                throw new Error('Unknown duplex source type - must be Iterable or AsyncIterable');
             }
+            return it_merge_dist_src(stream, sourceWrap());
         }
-        // if we fall out of the loop, it means they two are identical
-        // as long as their lengths match
-        return a.length === b.length && result;
+        return duplex.source;
+    };
+};
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/directory.js
+
+
+
+
+
+const directoryContent = (cid, node, unixfs, path, resolve, depth, blockstore) => {
+    async function* yieldDirectoryContent(options = {}) {
+        const offset = options.offset ?? 0;
+        const length = options.length ?? node.Links.length;
+        const links = node.Links.slice(offset, length);
+        options.onProgress?.(new CustomProgressEvent('unixfs:exporter:walk:directory', {
+            cid
+        }));
+        yield* pipe(links, source => node_modules_it_map_dist_src(source, link => {
+            return async () => {
+                const linkName = link.Name ?? '';
+                const linkPath = `${path}/${linkName}`;
+                const result = await resolve(link.Hash, linkName, linkPath, [], depth + 1, blockstore, options);
+                return result.entry;
+            };
+        }), source => parallel(source, { ordered: true }), source => it_filter_dist_src(source, entry => entry != null));
     }
-    parseNegate() {
-        if (this.nonegate)
+    return yieldDirectoryContent;
+};
+/* harmony default export */ const directory = (directoryContent);
+//# sourceMappingURL=directory.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/p-timeout/index.js
+class p_timeout_TimeoutError extends Error {
+	constructor(message) {
+		super(message);
+		this.name = 'TimeoutError';
+	}
+}
+
+/**
+An error to be thrown when the request is aborted by AbortController.
+DOMException is thrown instead of this Error when DOMException is available.
+*/
+class node_modules_p_timeout_AbortError extends Error {
+	constructor(message) {
+		super();
+		this.name = 'AbortError';
+		this.message = message;
+	}
+}
+
+/**
+TODO: Remove AbortError and just throw DOMException when targeting Node 18.
+*/
+const p_timeout_getDOMException = errorMessage => globalThis.DOMException === undefined
+	? new node_modules_p_timeout_AbortError(errorMessage)
+	: new DOMException(errorMessage);
+
+/**
+TODO: Remove below function and just 'reject(signal.reason)' when targeting Node 18.
+*/
+const p_timeout_getAbortedReason = signal => {
+	const reason = signal.reason === undefined
+		? p_timeout_getDOMException('This operation was aborted.')
+		: signal.reason;
+
+	return reason instanceof Error ? reason : p_timeout_getDOMException(reason);
+};
+
+function p_timeout_pTimeout(promise, options) {
+	const {
+		milliseconds,
+		fallback,
+		message,
+		customTimers = {setTimeout, clearTimeout},
+	} = options;
+
+	let timer;
+
+	const wrappedPromise = new Promise((resolve, reject) => {
+		if (typeof milliseconds !== 'number' || Math.sign(milliseconds) !== 1) {
+			throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${milliseconds}\``);
+		}
+
+		if (options.signal) {
+			const {signal} = options;
+			if (signal.aborted) {
+				reject(p_timeout_getAbortedReason(signal));
+			}
+
+			signal.addEventListener('abort', () => {
+				reject(p_timeout_getAbortedReason(signal));
+			});
+		}
+
+		if (milliseconds === Number.POSITIVE_INFINITY) {
+			promise.then(resolve, reject);
+			return;
+		}
+
+		// We create the error outside of `setTimeout` to preserve the stack trace.
+		const timeoutError = new p_timeout_TimeoutError();
+
+		timer = customTimers.setTimeout.call(undefined, () => {
+			if (fallback) {
+				try {
+					resolve(fallback());
+				} catch (error) {
+					reject(error);
+				}
+
+				return;
+			}
+
+			if (typeof promise.cancel === 'function') {
+				promise.cancel();
+			}
+
+			if (message === false) {
+				resolve();
+			} else if (message instanceof Error) {
+				reject(message);
+			} else {
+				timeoutError.message = message ?? `Promise timed out after ${milliseconds} milliseconds`;
+				reject(timeoutError);
+			}
+		}, milliseconds);
+
+		(async () => {
+			try {
+				resolve(await promise);
+			} catch (error) {
+				reject(error);
+			}
+		})();
+	});
+
+	const cancelablePromise = wrappedPromise.finally(() => {
+		cancelablePromise.clear();
+	});
+
+	cancelablePromise.clear = () => {
+		customTimers.clearTimeout.call(undefined, timer);
+		timer = undefined;
+	};
+
+	return cancelablePromise;
+}
+
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/p-queue/dist/lower-bound.js
+// Port of lower_bound from https://en.cppreference.com/w/cpp/algorithm/lower_bound
+// Used to compute insertion index to keep queue sorted after insertion
+function lower_bound_lowerBound(array, value, comparator) {
+    let first = 0;
+    let count = array.length;
+    while (count > 0) {
+        const step = Math.trunc(count / 2);
+        let it = first + step;
+        if (comparator(array[it], value) <= 0) {
+            first = ++it;
+            count -= step + 1;
+        }
+        else {
+            count = step;
+        }
+    }
+    return first;
+}
+
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/p-queue/dist/priority-queue.js
+
+class priority_queue_PriorityQueue {
+    #queue = [];
+    enqueue(run, options) {
+        options = {
+            priority: 0,
+            ...options,
+        };
+        const element = {
+            priority: options.priority,
+            run,
+        };
+        if (this.size && this.#queue[this.size - 1].priority >= options.priority) {
+            this.#queue.push(element);
             return;
-        const pattern = this.pattern;
-        let negate = false;
-        let negateOffset = 0;
-        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
-            negate = !negate;
-            negateOffset++;
         }
-        if (negateOffset)
-            this.pattern = pattern.slice(negateOffset);
-        this.negate = negate;
+        const index = lower_bound_lowerBound(this.#queue, element, (a, b) => b.priority - a.priority);
+        this.#queue.splice(index, 0, element);
     }
-    // set partial to true to test if, for example,
-    // "/a/b" matches the start of "/*/b/*/d"
-    // Partial means, if you run out of file before you run
-    // out of pattern, then that's fine, as long as all
-    // the parts match.
-    matchOne(file, pattern, partial = false) {
-        const options = this.options;
-        // UNC paths like //?/X:/... can match X:/... and vice versa
-        // Drive letters in absolute drive or unc paths are always compared
-        // case-insensitively.
-        if (this.isWindows) {
-            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
-            const fileUNC = !fileDrive &&
-                file[0] === '' &&
-                file[1] === '' &&
-                file[2] === '?' &&
-                /^[a-z]:$/i.test(file[3]);
-            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
-            const patternUNC = !patternDrive &&
-                pattern[0] === '' &&
-                pattern[1] === '' &&
-                pattern[2] === '?' &&
-                typeof pattern[3] === 'string' &&
-                /^[a-z]:$/i.test(pattern[3]);
-            const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined;
-            const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined;
-            if (typeof fdi === 'number' && typeof pdi === 'number') {
-                const [fd, pd] = [file[fdi], pattern[pdi]];
-                if (fd.toLowerCase() === pd.toLowerCase()) {
-                    pattern[pdi] = fd;
-                    if (pdi > fdi) {
-                        pattern = pattern.slice(pdi);
-                    }
-                    else if (fdi > pdi) {
-                        file = file.slice(fdi);
-                    }
-                }
-            }
+    dequeue() {
+        const item = this.#queue.shift();
+        return item?.run;
+    }
+    filter(options) {
+        return this.#queue.filter((element) => element.priority === options.priority).map((element) => element.run);
+    }
+    get size() {
+        return this.#queue.length;
+    }
+}
+
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/p-queue/dist/index.js
+
+
+
+/**
+Promise queue with concurrency control.
+*/
+class dist_PQueue extends eventemitter3 {
+    #carryoverConcurrencyCount;
+    #isIntervalIgnored;
+    #intervalCount = 0;
+    #intervalCap;
+    #interval;
+    #intervalEnd = 0;
+    #intervalId;
+    #timeoutId;
+    #queue;
+    #queueClass;
+    #pending = 0;
+    // The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194
+    #concurrency;
+    #isPaused;
+    #throwOnTimeout;
+    /**
+    Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already.
+
+    Applies to each future operation.
+    */
+    timeout;
+    // TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`
+    constructor(options) {
+        super();
+        // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
+        options = {
+            carryoverConcurrencyCount: false,
+            intervalCap: Number.POSITIVE_INFINITY,
+            interval: 0,
+            concurrency: Number.POSITIVE_INFINITY,
+            autoStart: true,
+            queueClass: priority_queue_PriorityQueue,
+            ...options,
+        };
+        if (!(typeof options.intervalCap === 'number' && options.intervalCap >= 1)) {
+            throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${options.intervalCap?.toString() ?? ''}\` (${typeof options.intervalCap})`);
         }
-        // resolve and reduce . and .. portions in the file as well.
-        // dont' need to do the second phase, because it's only one string[]
-        const { optimizationLevel = 1 } = this.options;
-        if (optimizationLevel >= 2) {
-            file = this.levelTwoFileOptimize(file);
+        if (options.interval === undefined || !(Number.isFinite(options.interval) && options.interval >= 0)) {
+            throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${options.interval?.toString() ?? ''}\` (${typeof options.interval})`);
         }
-        this.debug('matchOne', this, { file, pattern });
-        this.debug('matchOne', file.length, pattern.length);
-        for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
-            this.debug('matchOne loop');
-            var p = pattern[pi];
-            var f = file[fi];
-            this.debug(pattern, p, f);
-            // should be impossible.
-            // some invalid regexp stuff in the set.
-            /* c8 ignore start */
-            if (p === false) {
-                return false;
+        this.#carryoverConcurrencyCount = options.carryoverConcurrencyCount;
+        this.#isIntervalIgnored = options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0;
+        this.#intervalCap = options.intervalCap;
+        this.#interval = options.interval;
+        this.#queue = new options.queueClass();
+        this.#queueClass = options.queueClass;
+        this.concurrency = options.concurrency;
+        this.timeout = options.timeout;
+        this.#throwOnTimeout = options.throwOnTimeout === true;
+        this.#isPaused = options.autoStart === false;
+    }
+    get #doesIntervalAllowAnother() {
+        return this.#isIntervalIgnored || this.#intervalCount < this.#intervalCap;
+    }
+    get #doesConcurrentAllowAnother() {
+        return this.#pending < this.#concurrency;
+    }
+    #next() {
+        this.#pending--;
+        this.#tryToStartAnother();
+        this.emit('next');
+    }
+    #onResumeInterval() {
+        this.#onInterval();
+        this.#initializeIntervalIfNeeded();
+        this.#timeoutId = undefined;
+    }
+    get #isIntervalPaused() {
+        const now = Date.now();
+        if (this.#intervalId === undefined) {
+            const delay = this.#intervalEnd - now;
+            if (delay < 0) {
+                // Act as the interval was done
+                // We don't need to resume it here because it will be resumed on line 160
+                this.#intervalCount = (this.#carryoverConcurrencyCount) ? this.#pending : 0;
             }
-            /* c8 ignore stop */
-            if (p === GLOBSTAR) {
-                this.debug('GLOBSTAR', [pattern, p, f]);
-                // "**"
-                // a/**/b/**/c would match the following:
-                // a/b/x/y/z/c
-                // a/x/y/z/b/c
-                // a/b/x/b/x/c
-                // a/b/c
-                // To do this, take the rest of the pattern after
-                // the **, and see if it would match the file remainder.
-                // If so, return success.
-                // If not, the ** "swallows" a segment, and try again.
-                // This is recursively awful.
-                //
-                // a/**/b/**/c matching a/b/x/y/z/c
-                // - a matches a
-                // - doublestar
-                //   - matchOne(b/x/y/z/c, b/**/c)
-                //     - b matches b
-                //     - doublestar
-                //       - matchOne(x/y/z/c, c) -> no
-                //       - matchOne(y/z/c, c) -> no
-                //       - matchOne(z/c, c) -> no
-                //       - matchOne(c, c) yes, hit
-                var fr = fi;
-                var pr = pi + 1;
-                if (pr === pl) {
-                    this.debug('** at the end');
-                    // a ** at the end will just swallow the rest.
-                    // We have found a match.
-                    // however, it will not swallow /.x, unless
-                    // options.dot is set.
-                    // . and .. are *never* matched by **, for explosively
-                    // exponential reasons.
-                    for (; fi < fl; fi++) {
-                        if (file[fi] === '.' ||
-                            file[fi] === '..' ||
-                            (!options.dot && file[fi].charAt(0) === '.'))
-                            return false;
-                    }
-                    return true;
-                }
-                // ok, let's see if we can swallow whatever we can.
-                while (fr < fl) {
-                    var swallowee = file[fr];
-                    this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);
-                    // XXX remove this slice.  Just pass the start index.
-                    if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
-                        this.debug('globstar found match!', fr, fl, swallowee);
-                        // found a match.
-                        return true;
-                    }
-                    else {
-                        // can't swallow "." or ".." ever.
-                        // can only swallow ".foo" when explicitly asked.
-                        if (swallowee === '.' ||
-                            swallowee === '..' ||
-                            (!options.dot && swallowee.charAt(0) === '.')) {
-                            this.debug('dot detected!', file, fr, pattern, pr);
-                            break;
-                        }
-                        // ** swallows a segment, and continue.
-                        this.debug('globstar swallow a segment, and continue');
-                        fr++;
-                    }
-                }
-                // no match was found.
-                // However, in partial mode, we can't say this is necessarily over.
-                /* c8 ignore start */
-                if (partial) {
-                    // ran out of file
-                    this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
-                    if (fr === fl) {
-                        return true;
-                    }
+            else {
+                // Act as the interval is pending
+                if (this.#timeoutId === undefined) {
+                    this.#timeoutId = setTimeout(() => {
+                        this.#onResumeInterval();
+                    }, delay);
                 }
-                /* c8 ignore stop */
-                return false;
+                return true;
             }
-            // something other than **
-            // non-magic patterns just have to match exactly
-            // patterns with magic have been turned into regexps.
-            let hit;
-            if (typeof p === 'string') {
-                hit = f === p;
-                this.debug('string match', p, f, hit);
+        }
+        return false;
+    }
+    #tryToStartAnother() {
+        if (this.#queue.size === 0) {
+            // We can clear the interval ("pause")
+            // Because we can redo it later ("resume")
+            if (this.#intervalId) {
+                clearInterval(this.#intervalId);
             }
-            else {
-                hit = p.test(f);
-                this.debug('pattern match', p, f, hit);
+            this.#intervalId = undefined;
+            this.emit('empty');
+            if (this.#pending === 0) {
+                this.emit('idle');
             }
-            if (!hit)
-                return false;
-        }
-        // Note: ending in / means that we'll get a final ""
-        // at the end of the pattern.  This can only match a
-        // corresponding "" at the end of the file.
-        // If the file ends in /, then it can only match a
-        // a pattern that ends in /, unless the pattern just
-        // doesn't have any more for it. But, a/b/ should *not*
-        // match "a/b/*", even though "" matches against the
-        // [^/]*? pattern, except in partial mode, where it might
-        // simply not be reached yet.
-        // However, a/b/ should still satisfy a/*
-        // now either we fell off the end of the pattern, or we're done.
-        if (fi === fl && pi === pl) {
-            // ran out of pattern and filename at the same time.
-            // an exact hit!
-            return true;
+            return false;
         }
-        else if (fi === fl) {
-            // ran out of file, but still had pattern left.
-            // this is ok if we're doing the match as part of
-            // a glob fs traversal.
-            return partial;
+        if (!this.#isPaused) {
+            const canInitializeInterval = !this.#isIntervalPaused;
+            if (this.#doesIntervalAllowAnother && this.#doesConcurrentAllowAnother) {
+                const job = this.#queue.dequeue();
+                if (!job) {
+                    return false;
+                }
+                this.emit('active');
+                job();
+                if (canInitializeInterval) {
+                    this.#initializeIntervalIfNeeded();
+                }
+                return true;
+            }
         }
-        else if (pi === pl) {
-            // ran out of pattern, still have file left.
-            // this is only acceptable if we're on the very last
-            // empty segment of a file with a trailing slash.
-            // a/* should match a/b/
-            return fi === fl - 1 && file[fi] === '';
-            /* c8 ignore start */
+        return false;
+    }
+    #initializeIntervalIfNeeded() {
+        if (this.#isIntervalIgnored || this.#intervalId !== undefined) {
+            return;
         }
-        else {
-            // should be unreachable.
-            throw new Error('wtf?');
+        this.#intervalId = setInterval(() => {
+            this.#onInterval();
+        }, this.#interval);
+        this.#intervalEnd = Date.now() + this.#interval;
+    }
+    #onInterval() {
+        if (this.#intervalCount === 0 && this.#pending === 0 && this.#intervalId) {
+            clearInterval(this.#intervalId);
+            this.#intervalId = undefined;
         }
-        /* c8 ignore stop */
+        this.#intervalCount = this.#carryoverConcurrencyCount ? this.#pending : 0;
+        this.#processQueue();
     }
-    braceExpand() {
-        return braceExpand(this.pattern, this.options);
+    /**
+    Executes all queued functions until it reaches the limit.
+    */
+    #processQueue() {
+        // eslint-disable-next-line no-empty
+        while (this.#tryToStartAnother()) { }
     }
-    parse(pattern) {
-        assertValidPattern(pattern);
-        const options = this.options;
-        // shortcuts
-        if (pattern === '**')
-            return GLOBSTAR;
-        if (pattern === '')
-            return '';
-        // far and away, the most common glob pattern parts are
-        // *, *.*, and *.  Add a fast check method for those.
-        let m;
-        let fastTest = null;
-        if ((m = pattern.match(starRE))) {
-            fastTest = options.dot ? starTestDot : starTest;
-        }
-        else if ((m = pattern.match(starDotExtRE))) {
-            fastTest = (options.nocase
-                ? options.dot
-                    ? starDotExtTestNocaseDot
-                    : starDotExtTestNocase
-                : options.dot
-                    ? starDotExtTestDot
-                    : starDotExtTest)(m[1]);
+    get concurrency() {
+        return this.#concurrency;
+    }
+    set concurrency(newConcurrency) {
+        if (!(typeof newConcurrency === 'number' && newConcurrency >= 1)) {
+            throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${newConcurrency}\` (${typeof newConcurrency})`);
         }
-        else if ((m = pattern.match(qmarksRE))) {
-            fastTest = (options.nocase
-                ? options.dot
-                    ? qmarksTestNocaseDot
-                    : qmarksTestNocase
-                : options.dot
-                    ? qmarksTestDot
-                    : qmarksTest)(m);
+        this.#concurrency = newConcurrency;
+        this.#processQueue();
+    }
+    async #throwOnAbort(signal) {
+        return new Promise((_resolve, reject) => {
+            signal.addEventListener('abort', () => {
+                reject(signal.reason);
+            }, { once: true });
+        });
+    }
+    async add(function_, options = {}) {
+        options = {
+            timeout: this.timeout,
+            throwOnTimeout: this.#throwOnTimeout,
+            ...options,
+        };
+        return new Promise((resolve, reject) => {
+            this.#queue.enqueue(async () => {
+                this.#pending++;
+                this.#intervalCount++;
+                try {
+                    options.signal?.throwIfAborted();
+                    let operation = function_({ signal: options.signal });
+                    if (options.timeout) {
+                        operation = p_timeout_pTimeout(Promise.resolve(operation), { milliseconds: options.timeout });
+                    }
+                    if (options.signal) {
+                        operation = Promise.race([operation, this.#throwOnAbort(options.signal)]);
+                    }
+                    const result = await operation;
+                    resolve(result);
+                    this.emit('completed', result);
+                }
+                catch (error) {
+                    if (error instanceof p_timeout_TimeoutError && !options.throwOnTimeout) {
+                        resolve();
+                        return;
+                    }
+                    reject(error);
+                    this.emit('error', error);
+                }
+                finally {
+                    this.#next();
+                }
+            }, options);
+            this.emit('add');
+            this.#tryToStartAnother();
+        });
+    }
+    async addAll(functions, options) {
+        return Promise.all(functions.map(async (function_) => this.add(function_, options)));
+    }
+    /**
+    Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.)
+    */
+    start() {
+        if (!this.#isPaused) {
+            return this;
         }
-        else if ((m = pattern.match(starDotStarRE))) {
-            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
+        this.#isPaused = false;
+        this.#processQueue();
+        return this;
+    }
+    /**
+    Put queue execution on hold.
+    */
+    pause() {
+        this.#isPaused = true;
+    }
+    /**
+    Clear the queue.
+    */
+    clear() {
+        this.#queue = new this.#queueClass();
+    }
+    /**
+    Can be called multiple times. Useful if you for example add additional items at a later time.
+
+    @returns A promise that settles when the queue becomes empty.
+    */
+    async onEmpty() {
+        // Instantly resolve if the queue is empty
+        if (this.#queue.size === 0) {
+            return;
         }
-        else if ((m = pattern.match(dotStarRE))) {
-            fastTest = dotStarTest;
+        await this.#onEvent('empty');
+    }
+    /**
+    @returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
+
+    If you want to avoid having the queue grow beyond a certain size you can `await queue.onSizeLessThan()` before adding a new item.
+
+    Note that this only limits the number of items waiting to start. There could still be up to `concurrency` jobs already running that this call does not include in its calculation.
+    */
+    async onSizeLessThan(limit) {
+        // Instantly resolve if the queue is empty.
+        if (this.#queue.size < limit) {
+            return;
         }
-        const re = AST.fromGlob(pattern, this.options).toMMPattern();
-        return fastTest ? Object.assign(re, { test: fastTest }) : re;
+        await this.#onEvent('next', () => this.#queue.size < limit);
     }
-    makeRe() {
-        if (this.regexp || this.regexp === false)
-            return this.regexp;
-        // at this point, this.set is a 2d array of partial
-        // pattern strings, or "**".
-        //
-        // It's better to use .match().  This function shouldn't
-        // be used, really, but it's pretty convenient sometimes,
-        // when you just want to work with a regex.
-        const set = this.set;
-        if (!set.length) {
-            this.regexp = false;
-            return this.regexp;
+    /**
+    The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet.
+
+    @returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
+    */
+    async onIdle() {
+        // Instantly resolve if none pending and if nothing else is queued
+        if (this.#pending === 0 && this.#queue.size === 0) {
+            return;
         }
-        const options = this.options;
-        const twoStar = options.noglobstar
-            ? mjs_star
-            : options.dot
-                ? twoStarDot
-                : twoStarNoDot;
-        const flags = new Set(options.nocase ? ['i'] : []);
-        // regexpify non-globstar patterns
-        // if ** is only item, then we just do one twoStar
-        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
-        // if ** is last, append (\/twoStar|) to previous
-        // if ** is in the middle, append (\/|\/twoStar\/) to previous
-        // then filter out GLOBSTAR symbols
-        let re = set
-            .map(pattern => {
-            const pp = pattern.map(p => {
-                if (p instanceof RegExp) {
-                    for (const f of p.flags.split(''))
-                        flags.add(f);
-                }
-                return typeof p === 'string'
-                    ? mjs_regExpEscape(p)
-                    : p === GLOBSTAR
-                        ? GLOBSTAR
-                        : p._src;
-            });
-            pp.forEach((p, i) => {
-                const next = pp[i + 1];
-                const prev = pp[i - 1];
-                if (p !== GLOBSTAR || prev === GLOBSTAR) {
+        await this.#onEvent('idle');
+    }
+    async #onEvent(event, filter) {
+        return new Promise(resolve => {
+            const listener = () => {
+                if (filter && !filter()) {
                     return;
                 }
-                if (prev === undefined) {
-                    if (next !== undefined && next !== GLOBSTAR) {
-                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
-                    }
-                    else {
-                        pp[i] = twoStar;
-                    }
-                }
-                else if (next === undefined) {
-                    pp[i - 1] = prev + '(?:\\/|' + twoStar + ')?';
-                }
-                else if (next !== GLOBSTAR) {
-                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
-                    pp[i + 1] = GLOBSTAR;
-                }
+                this.off(event, listener);
+                resolve();
+            };
+            this.on(event, listener);
+        });
+    }
+    /**
+    Size of the queue, the number of queued items waiting to run.
+    */
+    get size() {
+        return this.#queue.size;
+    }
+    /**
+    Size of the queue, filtered by the given options.
+
+    For example, this can be used to find the number of items remaining in the queue with a specific priority level.
+    */
+    sizeBy(options) {
+        // eslint-disable-next-line unicorn/no-array-callback-reference
+        return this.#queue.filter(options).length;
+    }
+    /**
+    Number of running items (no longer in the queue).
+    */
+    get pending() {
+        return this.#pending;
+    }
+    /**
+    Whether the queue is currently paused.
+    */
+    get isPaused() {
+        return this.#isPaused;
+    }
+}
+
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/file.js
+
+
+
+
+
+
+
+
+
+
+
+
+async function walkDAG(blockstore, node, queue, streamPosition, start, end, options) {
+    // a `raw` node
+    if (node instanceof Uint8Array) {
+        const buf = extract_data_from_block(node, streamPosition, start, end);
+        queue.push(buf);
+        return;
+    }
+    if (node.Data == null) {
+        throw err_code(new Error('no data in PBNode'), 'ERR_NOT_UNIXFS');
+    }
+    let file;
+    try {
+        file = src_UnixFS.unmarshal(node.Data);
+    }
+    catch (err) {
+        throw err_code(err, 'ERR_NOT_UNIXFS');
+    }
+    // might be a unixfs `raw` node or have data on intermediate nodes
+    if (file.data != null) {
+        const data = file.data;
+        const buf = extract_data_from_block(data, streamPosition, start, end);
+        queue.push(buf);
+        streamPosition += BigInt(buf.byteLength);
+    }
+    const childOps = [];
+    if (node.Links.length !== file.blockSizes.length) {
+        throw err_code(new Error('Inconsistent block sizes and dag links'), 'ERR_NOT_UNIXFS');
+    }
+    for (let i = 0; i < node.Links.length; i++) {
+        const childLink = node.Links[i];
+        const childStart = streamPosition; // inclusive
+        const childEnd = childStart + file.blockSizes[i]; // exclusive
+        if ((start >= childStart && start < childEnd) || // child has offset byte
+            (end >= childStart && end <= childEnd) || // child has end byte
+            (start < childStart && end > childEnd)) { // child is between offset and end bytes
+            childOps.push({
+                link: childLink,
+                blockStart: streamPosition
             });
-            return pp.filter(p => p !== GLOBSTAR).join('/');
-        })
-            .join('|');
-        // need to wrap in parens if we had more than one thing with |,
-        // otherwise only the first will be anchored to ^ and the last to $
-        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
-        // must match entire pattern
-        // ending in a * or ** will make it less strict.
-        re = '^' + open + re + close + '$';
-        // can match anything, as long as it's not this.
-        if (this.negate)
-            re = '^(?!' + re + ').+$';
-        try {
-            this.regexp = new RegExp(re, [...flags].join(''));
-            /* c8 ignore start */
         }
-        catch (ex) {
-            // should be impossible
-            this.regexp = false;
+        streamPosition = childEnd;
+        if (streamPosition > end) {
+            break;
         }
-        /* c8 ignore stop */
-        return this.regexp;
     }
-    slashSplit(p) {
-        // if p starts with // on windows, we preserve that
-        // so that UNC paths aren't broken.  Otherwise, any number of
-        // / characters are coalesced into one, unless
-        // preserveMultipleSlashes is set to true.
-        if (this.preserveMultipleSlashes) {
-            return p.split('/');
+    await pipe(childOps, (source) => node_modules_it_map_dist_src(source, (op) => {
+        return async () => {
+            const block = await blockstore.get(op.link.Hash, options);
+            return {
+                ...op,
+                block
+            };
+        };
+    }), (source) => parallel(source, {
+        ordered: true
+    }), async (source) => {
+        for await (const { link, block, blockStart } of source) {
+            let child;
+            switch (link.Hash.code) {
+                case code:
+                    child = src_decode(block);
+                    break;
+                case multiformats_dist_src_codecs_raw_code:
+                    child = block;
+                    break;
+                default:
+                    queue.end(err_code(new Error(`Unsupported codec: ${link.Hash.code}`), 'ERR_NOT_UNIXFS'));
+                    return;
+            }
+            // create a queue for this child - we use a queue instead of recursion
+            // to avoid overflowing the stack
+            const childQueue = new dist_PQueue({
+                concurrency: 1
+            });
+            // if any of the child jobs error, end the read queue with the error
+            childQueue.on('error', error => {
+                queue.end(error);
+            });
+            // if the job rejects the 'error' event will be emitted on the child queue
+            void childQueue.add(async () => {
+                options.onProgress?.(new CustomProgressEvent('unixfs:exporter:walk:file', {
+                    cid: link.Hash
+                }));
+                await walkDAG(blockstore, child, queue, blockStart, start, end, options);
+            });
+            // wait for this child to complete before moving on to the next
+            await childQueue.onIdle();
         }
-        else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
-            // add an extra '' for the one we lose
-            return ['', ...p.split(/\/+/)];
+    });
+    if (streamPosition >= end) {
+        queue.end();
+    }
+}
+const fileContent = (cid, node, unixfs, path, resolve, depth, blockstore) => {
+    async function* yieldFileContent(options = {}) {
+        const fileSize = unixfs.fileSize();
+        if (fileSize === undefined) {
+            throw new Error('File was a directory');
+        }
+        const { start, end } = validate_offset_and_length(fileSize, options.offset, options.length);
+        if (end === 0n) {
+            return;
+        }
+        let read = 0n;
+        const wanted = end - start;
+        const queue = src_pushable();
+        options.onProgress?.(new CustomProgressEvent('unixfs:exporter:walk:file', {
+            cid
+        }));
+        void walkDAG(blockstore, node, queue, 0n, start, end, options)
+            .catch(err => {
+            queue.end(err);
+        });
+        for await (const buf of queue) {
+            if (buf == null) {
+                continue;
+            }
+            read += BigInt(buf.byteLength);
+            if (read > wanted) {
+                queue.end();
+                throw err_code(new Error('Read too many bytes - the file size reported by the UnixFS data in the root node may be incorrect'), 'ERR_OVER_READ');
+            }
+            if (read === wanted) {
+                queue.end();
+            }
+            options.onProgress?.(new CustomProgressEvent('unixfs:exporter:progress:unixfs:file', {
+                bytesRead: read,
+                totalBytes: wanted,
+                fileSize
+            }));
+            yield buf;
+        }
+        if (read < wanted) {
+            throw err_code(new Error('Traversed entire DAG but did not read enough bytes'), 'ERR_UNDER_READ');
+        }
+    }
+    return yieldFileContent;
+};
+/* harmony default export */ const file = (fileContent);
+//# sourceMappingURL=file.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/content/hamt-sharded-directory.js
+
+
+
+
+
+
+
+const hamtShardedDirectoryContent = (cid, node, unixfs, path, resolve, depth, blockstore) => {
+    function yieldHamtDirectoryContent(options = {}) {
+        options.onProgress?.(new CustomProgressEvent('unixfs:exporter:walk:hamt-sharded-directory', {
+            cid
+        }));
+        return listDirectory(node, path, resolve, depth, blockstore, options);
+    }
+    return yieldHamtDirectoryContent;
+};
+async function* listDirectory(node, path, resolve, depth, blockstore, options) {
+    const links = node.Links;
+    if (node.Data == null) {
+        throw err_code(new Error('no data in PBNode'), 'ERR_NOT_UNIXFS');
+    }
+    let dir;
+    try {
+        dir = src_UnixFS.unmarshal(node.Data);
+    }
+    catch (err) {
+        throw err_code(err, 'ERR_NOT_UNIXFS');
+    }
+    if (dir.fanout == null) {
+        throw err_code(new Error('missing fanout'), 'ERR_NOT_UNIXFS');
+    }
+    const padLength = (dir.fanout - 1n).toString(16).length;
+    const results = pipe(links, source => node_modules_it_map_dist_src(source, link => {
+        return async () => {
+            const name = link.Name != null ? link.Name.substring(padLength) : null;
+            if (name != null && name !== '') {
+                const result = await resolve(link.Hash, name, `${path}/${name}`, [], depth + 1, blockstore, options);
+                return { entries: result.entry == null ? [] : [result.entry] };
+            }
+            else {
+                // descend into subshard
+                const block = await blockstore.get(link.Hash, options);
+                node = src_decode(block);
+                options.onProgress?.(new CustomProgressEvent('unixfs:exporter:walk:hamt-sharded-directory', {
+                    cid: link.Hash
+                }));
+                return { entries: listDirectory(node, path, resolve, depth, blockstore, options) };
+            }
+        };
+    }), source => parallel(source, { ordered: true }));
+    for await (const { entries } of results) {
+        yield* entries;
+    }
+}
+/* harmony default export */ const hamt_sharded_directory = (hamtShardedDirectoryContent);
+//# sourceMappingURL=hamt-sharded-directory.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/resolvers/unixfs-v1/index.js
+
+
+
+
+
+
+
+const findLinkCid = (node, name) => {
+    const link = node.Links.find(link => link.Name === name);
+    return link?.Hash;
+};
+const contentExporters = {
+    raw: file,
+    file: file,
+    directory: directory,
+    'hamt-sharded-directory': hamt_sharded_directory,
+    metadata: (cid, node, unixfs, path, resolve, depth, blockstore) => {
+        return () => [];
+    },
+    symlink: (cid, node, unixfs, path, resolve, depth, blockstore) => {
+        return () => [];
+    }
+};
+// @ts-expect-error types are wrong
+const unixFsResolver = async (cid, name, path, toResolve, resolve, depth, blockstore, options) => {
+    const block = await blockstore.get(cid, options);
+    const node = src_decode(block);
+    let unixfs;
+    let next;
+    if (name == null) {
+        name = cid.toString();
+    }
+    if (node.Data == null) {
+        throw err_code(new Error('no data in PBNode'), 'ERR_NOT_UNIXFS');
+    }
+    try {
+        unixfs = src_UnixFS.unmarshal(node.Data);
+    }
+    catch (err) {
+        // non-UnixFS dag-pb node? It could happen.
+        throw err_code(err, 'ERR_NOT_UNIXFS');
+    }
+    if (path == null) {
+        path = name;
+    }
+    if (toResolve.length > 0) {
+        let linkCid;
+        if (unixfs?.type === 'hamt-sharded-directory') {
+            // special case - unixfs v1 hamt shards
+            linkCid = await find_cid_in_shard(node, toResolve[0], blockstore);
         }
         else {
-            return p.split(/\/+/);
+            linkCid = findLinkCid(node, toResolve[0]);
+        }
+        if (linkCid == null) {
+            throw err_code(new Error('file does not exist'), 'ERR_NOT_FOUND');
         }
+        // remove the path component we have resolved
+        const nextName = toResolve.shift();
+        const nextPath = `${path}/${nextName}`;
+        next = {
+            cid: linkCid,
+            toResolve,
+            name: nextName ?? '',
+            path: nextPath
+        };
     }
-    match(f, partial = this.partial) {
-        this.debug('match', f, this.pattern);
-        // short-circuit in the case of busted things.
-        // comments, etc.
-        if (this.comment) {
-            return false;
+    const content = contentExporters[unixfs.type](cid, node, unixfs, path, resolve, depth, blockstore);
+    if (content == null) {
+        throw err_code(new Error('could not find content exporter'), 'ERR_NOT_FOUND');
+    }
+    if (unixfs.isDirectory()) {
+        return {
+            entry: {
+                type: 'directory',
+                name,
+                path,
+                cid,
+                content,
+                unixfs,
+                depth,
+                node,
+                size: unixfs.fileSize()
+            },
+            next
+        };
+    }
+    return {
+        entry: {
+            type: 'file',
+            name,
+            path,
+            cid,
+            content,
+            unixfs,
+            depth,
+            node,
+            size: unixfs.fileSize()
+        },
+        next
+    };
+};
+/* harmony default export */ const unixfs_v1 = (unixFsResolver);
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/resolvers/index.js
+
+
+
+
+
+
+
+
+
+const resolvers_resolvers = {
+    [code]: unixfs_v1,
+    [multiformats_dist_src_codecs_raw_code]: resolvers_raw,
+    [src_code]: dag_cbor,
+    [multiformats_dist_src_hashes_identity_identity.code]: resolvers_identity
+};
+const resolvers_resolve = async (cid, name, path, toResolve, depth, blockstore, options) => {
+    const resolver = resolvers_resolvers[cid.code];
+    if (resolver == null) {
+        throw err_code(new Error(`No resolver for code ${cid.code}`), 'ERR_NO_RESOLVER');
+    }
+    return resolver(cid, name, path, toResolve, resolvers_resolve, depth, blockstore, options);
+};
+/* harmony default export */ const dist_src_resolvers = (resolvers_resolve);
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/ipfs-unixfs-exporter/dist/src/index.js
+
+
+
+
+const src_toPathComponents = (path = '') => {
+    // split on / unless escaped with \
+    return (path
+        .trim()
+        .match(/([^\\^/]|\\\/)+/g) ?? [])
+        .filter(Boolean);
+};
+const cidAndRest = (path) => {
+    if (path instanceof Uint8Array) {
+        return {
+            cid: ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.decode(path),
+            toResolve: []
+        };
+    }
+    const cid = ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.asCID(path);
+    if (cid != null) {
+        return {
+            cid,
+            toResolve: []
+        };
+    }
+    if (typeof path === 'string') {
+        if (path.indexOf('/ipfs/') === 0) {
+            path = path.substring(6);
         }
-        if (this.empty) {
-            return f === '';
+        const output = src_toPathComponents(path);
+        return {
+            cid: ipfs_unixfs_exporter_node_modules_multiformats_dist_src_cid_CID.parse(output[0]),
+            toResolve: output.slice(1)
+        };
+    }
+    throw err_code(new Error(`Unknown path type ${path}`), 'ERR_BAD_PATH');
+};
+async function* walkPath(path, blockstore, options = {}) {
+    let { cid, toResolve } = cidAndRest(path);
+    let name = cid.toString();
+    let entryPath = name;
+    const startingDepth = toResolve.length;
+    while (true) {
+        const result = await dist_src_resolvers(cid, name, entryPath, toResolve, startingDepth, blockstore, options);
+        if (result.entry == null && result.next == null) {
+            throw err_code(new Error(`Could not resolve ${path}`), 'ERR_NOT_FOUND');
         }
-        if (f === '/' && partial) {
-            return true;
+        if (result.entry != null) {
+            yield result.entry;
         }
-        const options = this.options;
-        // windows: need to use /, not \
-        if (this.isWindows) {
-            f = f.split('\\').join('/');
+        if (result.next == null) {
+            return;
         }
-        // treat the test path as a set of pathparts.
-        const ff = this.slashSplit(f);
-        this.debug(this.pattern, 'split', ff);
-        // just ONE of the pattern sets in this.set needs to match
-        // in order for it to be valid.  If negating, then just one
-        // match means that we have failed.
-        // Either way, return on the first hit.
-        const set = this.set;
-        this.debug(this.pattern, 'set', set);
-        // Find the basename of the path by looking for the last non-empty segment
-        let filename = ff[ff.length - 1];
-        if (!filename) {
-            for (let i = ff.length - 2; !filename && i >= 0; i--) {
-                filename = ff[i];
-            }
+        // resolve further parts
+        toResolve = result.next.toResolve;
+        cid = result.next.cid;
+        name = result.next.name;
+        entryPath = result.next.path;
+    }
+}
+async function exporter(path, blockstore, options = {}) {
+    const result = await dist_src(walkPath(path, blockstore, options));
+    if (result == null) {
+        throw err_code(new Error(`Could not resolve ${path}`), 'ERR_NOT_FOUND');
+    }
+    return result;
+}
+async function* recursive(path, blockstore, options = {}) {
+    const node = await exporter(path, blockstore, options);
+    if (node == null) {
+        return;
+    }
+    yield node;
+    if (node.type === 'directory') {
+        for await (const child of recurse(node, options)) {
+            yield child;
         }
-        for (let i = 0; i < set.length; i++) {
-            const pattern = set[i];
-            let file = ff;
-            if (options.matchBase && pattern.length === 1) {
-                file = [filename];
+    }
+    async function* recurse(node, options) {
+        for await (const file of node.content(options)) {
+            yield file;
+            if (file instanceof Uint8Array) {
+                continue;
             }
-            const hit = this.matchOne(file, pattern, partial);
-            if (hit) {
-                if (options.flipNegate) {
-                    return true;
-                }
-                return !this.negate;
+            if (file.type === 'directory') {
+                yield* recurse(file, options);
             }
         }
-        // didn't get any hits.  this is success if it's a negative
-        // pattern, failure otherwise.
-        if (options.flipNegate) {
-            return false;
-        }
-        return this.negate;
     }
-    static defaults(def) {
-        return mjs_minimatch.defaults(def).Minimatch;
+}
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/errors.js
+class UnixFSError extends Error {
+    name;
+    code;
+    constructor(message, name, code) {
+        super(message);
+        this.name = name;
+        this.code = code;
+    }
+}
+class NotUnixFSError extends UnixFSError {
+    constructor(message = 'not a Unixfs node') {
+        super(message, 'NotUnixFSError', 'ERR_NOT_UNIXFS');
+    }
+}
+class InvalidPBNodeError extends UnixFSError {
+    constructor(message = 'invalid PBNode') {
+        super(message, 'InvalidPBNodeError', 'ERR_INVALID_PBNODE');
+    }
+}
+class errors_UnknownError extends UnixFSError {
+    constructor(message = 'unknown error') {
+        super(message, 'InvalidPBNodeError', 'ERR_UNKNOWN_ERROR');
+    }
+}
+class AlreadyExistsError extends UnixFSError {
+    constructor(message = 'path already exists') {
+        super(message, 'AlreadyExistsError', 'ERR_ALREADY_EXISTS');
+    }
+}
+class DoesNotExistError extends UnixFSError {
+    constructor(message = 'path does not exist') {
+        super(message, 'DoesNotExistError', 'ERR_DOES_NOT_EXIST');
+    }
+}
+class NoContentError extends UnixFSError {
+    constructor(message = 'no content') {
+        super(message, 'NoContentError', 'ERR_NO_CONTENT');
+    }
+}
+class NotAFileError extends UnixFSError {
+    constructor(message = 'not a file') {
+        super(message, 'NotAFileError', 'ERR_NOT_A_FILE');
+    }
+}
+class NotADirectoryError extends UnixFSError {
+    constructor(message = 'not a directory') {
+        super(message, 'NotADirectoryError', 'ERR_NOT_A_DIRECTORY');
+    }
+}
+class errors_InvalidParametersError extends UnixFSError {
+    constructor(message = 'invalid parameters') {
+        super(message, 'InvalidParametersError', 'ERR_INVALID_PARAMETERS');
+    }
+}
+//# sourceMappingURL=errors.js.map
+;// CONCATENATED MODULE: ./node_modules/@libp2p/logger/node_modules/multiformats/vendor/base-x.js
+// base-x encoding / decoding
+// Copyright (c) 2018 base-x contributors
+// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
+// Distributed under the MIT software license, see the accompanying
+// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
+function logger_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) {
+  if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
+  var BASE_MAP = new Uint8Array(256);
+  for (var j = 0; j < BASE_MAP.length; j++) {
+    BASE_MAP[j] = 255;
+  }
+  for (var i = 0; i < ALPHABET.length; i++) {
+    var x = ALPHABET.charAt(i);
+    var xc = x.charCodeAt(0);
+    if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }
+    BASE_MAP[xc] = i;
+  }
+  var BASE = ALPHABET.length;
+  var LEADER = ALPHABET.charAt(0);
+  var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up
+  var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up
+  function encode (source) {
+    if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) {
+      source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
+    } else if (Array.isArray(source)) {
+      source = Uint8Array.from(source);
+    }
+    if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }
+    if (source.length === 0) { return '' }
+        // Skip & count leading zeroes.
+    var zeroes = 0;
+    var length = 0;
+    var pbegin = 0;
+    var pend = source.length;
+    while (pbegin !== pend && source[pbegin] === 0) {
+      pbegin++;
+      zeroes++;
+    }
+        // Allocate enough space in big-endian base58 representation.
+    var size = ((pend - pbegin) * iFACTOR + 1) >>> 0;
+    var b58 = new Uint8Array(size);
+        // Process the bytes.
+    while (pbegin !== pend) {
+      var carry = source[pbegin];
+            // Apply "b58 = b58 * 256 + ch".
+      var i = 0;
+      for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
+        carry += (256 * b58[it1]) >>> 0;
+        b58[it1] = (carry % BASE) >>> 0;
+        carry = (carry / BASE) >>> 0;
+      }
+      if (carry !== 0) { throw new Error('Non-zero carry') }
+      length = i;
+      pbegin++;
+    }
+        // Skip leading zeroes in base58 result.
+    var it2 = size - length;
+    while (it2 !== size && b58[it2] === 0) {
+      it2++;
+    }
+        // Translate the result into a string.
+    var str = LEADER.repeat(zeroes);
+    for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }
+    return str
+  }
+  function decodeUnsafe (source) {
+    if (typeof source !== 'string') { throw new TypeError('Expected String') }
+    if (source.length === 0) { return new Uint8Array() }
+    var psz = 0;
+        // Skip leading spaces.
+    if (source[psz] === ' ') { return }
+        // Skip and count leading '1's.
+    var zeroes = 0;
+    var length = 0;
+    while (source[psz] === LEADER) {
+      zeroes++;
+      psz++;
+    }
+        // Allocate enough space in big-endian base256 representation.
+    var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.
+    var b256 = new Uint8Array(size);
+        // Process the characters.
+    while (source[psz]) {
+            // Decode character
+      var carry = BASE_MAP[source.charCodeAt(psz)];
+            // Invalid character
+      if (carry === 255) { return }
+      var i = 0;
+      for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
+        carry += (BASE * b256[it3]) >>> 0;
+        b256[it3] = (carry % 256) >>> 0;
+        carry = (carry / 256) >>> 0;
+      }
+      if (carry !== 0) { throw new Error('Non-zero carry') }
+      length = i;
+      psz++;
+    }
+        // Skip trailing spaces.
+    if (source[psz] === ' ') { return }
+        // Skip leading zeroes in b256.
+    var it4 = size - length;
+    while (it4 !== size && b256[it4] === 0) {
+      it4++;
+    }
+    var vch = new Uint8Array(zeroes + (size - it4));
+    var j = zeroes;
+    while (it4 !== size) {
+      vch[j++] = b256[it4++];
+    }
+    return vch
+  }
+  function decode (string) {
+    var buffer = decodeUnsafe(string);
+    if (buffer) { return buffer }
+    throw new Error(`Non-${name} character`)
+  }
+  return {
+    encode: encode,
+    decodeUnsafe: decodeUnsafe,
+    decode: decode
+  }
+}
+var logger_node_modules_multiformats_vendor_base_x_src = logger_node_modules_multiformats_vendor_base_x_base;
+
+var logger_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = logger_node_modules_multiformats_vendor_base_x_src;
+
+/* harmony default export */ const logger_node_modules_multiformats_vendor_base_x = (logger_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX);
+
+;// CONCATENATED MODULE: ./node_modules/@libp2p/logger/node_modules/multiformats/src/bytes.js
+const logger_node_modules_multiformats_src_bytes_empty = new Uint8Array(0)
+
+/**
+ * @param {Uint8Array} d
+ */
+const logger_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '')
+
+/**
+ * @param {string} hex
+ */
+const logger_node_modules_multiformats_src_bytes_fromHex = hex => {
+  const hexes = hex.match(/../g)
+  return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : logger_node_modules_multiformats_src_bytes_empty
+}
+
+/**
+ * @param {Uint8Array} aa
+ * @param {Uint8Array} bb
+ */
+const logger_node_modules_multiformats_src_bytes_equals = (aa, bb) => {
+  if (aa === bb) return true
+  if (aa.byteLength !== bb.byteLength) {
+    return false
+  }
+
+  for (let ii = 0; ii < aa.byteLength; ii++) {
+    if (aa[ii] !== bb[ii]) {
+      return false
     }
+  }
+
+  return true
 }
-/* c8 ignore start */
 
+/**
+ * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o
+ * @returns {Uint8Array}
+ */
+const logger_node_modules_multiformats_src_bytes_coerce = o => {
+  if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o
+  if (o instanceof ArrayBuffer) return new Uint8Array(o)
+  if (ArrayBuffer.isView(o)) {
+    return new Uint8Array(o.buffer, o.byteOffset, o.byteLength)
+  }
+  throw new Error('Unknown type, must be binary type')
+}
 
+/**
+ * @param {any} o
+ * @returns {o is ArrayBuffer|ArrayBufferView}
+ */
+const logger_node_modules_multiformats_src_bytes_isBinary = o =>
+  o instanceof ArrayBuffer || ArrayBuffer.isView(o)
 
-/* c8 ignore stop */
-mjs_minimatch.AST = AST;
-mjs_minimatch.Minimatch = Minimatch;
-mjs_minimatch.escape = escape_escape;
-mjs_minimatch.unescape = unescape_unescape;
-//# sourceMappingURL=index.js.map
-;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/it-glob/dist/src/index.js
 /**
- * @packageDocumentation
- *
- * Like [`glob`](https://npmjs.com/package/glob) but async iterable.
- *
- * @example
- *
- * ```javascript
- * import glob from 'it-glob'
- *
- * const options = {
- *   cwd // defaults to process.cwd
- *   absolute // return absolute paths, defaults to false
- *   nodir // only yield file paths, skip directories
- *
- *   // all other options are passed to minimatch
- * }
- *
- * for await (const path of glob('/path/to/file', '**\/*', options)) {
- *  console.info(path)
- * }
- * ```
- *
- * See the [minimatch docs](https://www.npmjs.com/package/minimatch#options) for the full list of options.
+ * @param {string} str
+ * @returns {Uint8Array}
+ */
+const logger_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str)
+
+/**
+ * @param {Uint8Array} b
+ * @returns {string}
  */
+const logger_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b)
+
+
+
+;// CONCATENATED MODULE: ./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base.js
+
 
+// Linter can't see that API is used in types.
+// eslint-disable-next-line
 
 
 /**
- * Async iterable filename pattern matcher
+ * Class represents both BaseEncoder and MultibaseEncoder meaning it
+ * can be used to encode to multibase or base encode without multibase
+ * prefix.
+ *
+ * @class
+ * @template {string} Base
+ * @template {string} Prefix
+ * @implements {API.MultibaseEncoder}
+ * @implements {API.BaseEncoder}
  */
-async function* src_glob(dir, pattern, options = {}) {
-    const absoluteDir = path.resolve(dir);
-    const relativeDir = path.relative(options.cwd ?? process.cwd(), dir);
-    const stats = await fs.stat(absoluteDir);
-    if (stats.isDirectory()) {
-        for await (const entry of _glob(absoluteDir, '', pattern, options)) {
-            yield entry;
-        }
-        return;
+class logger_node_modules_multiformats_src_bases_base_Encoder {
+  /**
+   * @param {Base} name
+   * @param {Prefix} prefix
+   * @param {(bytes:Uint8Array) => string} baseEncode
+   */
+  constructor (name, prefix, baseEncode) {
+    this.name = name
+    this.prefix = prefix
+    this.baseEncode = baseEncode
+  }
+
+  /**
+   * @param {Uint8Array} bytes
+   * @returns {API.Multibase}
+   */
+  encode (bytes) {
+    if (bytes instanceof Uint8Array) {
+      return `${this.prefix}${this.baseEncode(bytes)}`
+    } else {
+      throw Error('Unknown type, must be binary type')
     }
-    if (minimatch(relativeDir, pattern, options)) {
-        yield options.absolute === true ? absoluteDir : relativeDir;
+  }
+}
+
+/**
+ * @template {string} Prefix
+ */
+/**
+ * Class represents both BaseDecoder and MultibaseDecoder so it could be used
+ * to decode multibases (with matching prefix) or just base decode strings
+ * with corresponding base encoding.
+ *
+ * @class
+ * @template {string} Base
+ * @template {string} Prefix
+ * @implements {API.MultibaseDecoder}
+ * @implements {API.UnibaseDecoder}
+ * @implements {API.BaseDecoder}
+ */
+class logger_node_modules_multiformats_src_bases_base_Decoder {
+  /**
+   * @param {Base} name
+   * @param {Prefix} prefix
+   * @param {(text:string) => Uint8Array} baseDecode
+   */
+  constructor (name, prefix, baseDecode) {
+    this.name = name
+    this.prefix = prefix
+    /* c8 ignore next 3 */
+    if (prefix.codePointAt(0) === undefined) {
+      throw new Error('Invalid prefix character')
+    }
+    /** @private */
+    this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0))
+    this.baseDecode = baseDecode
+  }
+
+  /**
+   * @param {string} text
+   */
+  decode (text) {
+    if (typeof text === 'string') {
+      if (text.codePointAt(0) !== this.prefixCodePoint) {
+        throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`)
+      }
+      return this.baseDecode(text.slice(this.prefix.length))
+    } else {
+      throw Error('Can only multibase decode strings')
     }
+  }
+
+  /**
+   * @template {string} OtherPrefix
+   * @param {API.UnibaseDecoder|ComposedDecoder} decoder
+   * @returns {ComposedDecoder}
+   */
+  or (decoder) {
+    return logger_node_modules_multiformats_src_bases_base_or(this, decoder)
+  }
 }
-async function* _glob(base, dir, pattern, options) {
-    for await (const entry of await fs.opendir(path.join(base, dir))) {
-        const relativeEntryPath = path.join(dir, entry.name);
-        const absoluteEntryPath = path.join(base, dir, entry.name);
-        let match = minimatch(relativeEntryPath, pattern, options);
-        const isDirectory = entry.isDirectory();
-        if (isDirectory && options.nodir === true) {
-            match = false;
-        }
-        if (match) {
-            yield options.absolute === true ? absoluteEntryPath : relativeEntryPath;
-        }
-        if (isDirectory) {
-            yield* _glob(base, relativeEntryPath, pattern, options);
-        }
+
+/**
+ * @template {string} Prefix
+ * @typedef {Record>} Decoders
+ */
+
+/**
+ * @template {string} Prefix
+ * @implements {API.MultibaseDecoder}
+ * @implements {API.CombobaseDecoder}
+ */
+class logger_node_modules_multiformats_src_bases_base_ComposedDecoder {
+  /**
+   * @param {Decoders} decoders
+   */
+  constructor (decoders) {
+    this.decoders = decoders
+  }
+
+  /**
+   * @template {string} OtherPrefix
+   * @param {API.UnibaseDecoder|ComposedDecoder} decoder
+   * @returns {ComposedDecoder}
+   */
+  or (decoder) {
+    return logger_node_modules_multiformats_src_bases_base_or(this, decoder)
+  }
+
+  /**
+   * @param {string} input
+   * @returns {Uint8Array}
+   */
+  decode (input) {
+    const prefix = /** @type {Prefix} */ (input[0])
+    const decoder = this.decoders[prefix]
+    if (decoder) {
+      return decoder.decode(input)
+    } else {
+      throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)
     }
+  }
 }
-//# sourceMappingURL=index.js.map
-;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/utils/glob-source.js
 
+/**
+ * @template {string} L
+ * @template {string} R
+ * @param {API.UnibaseDecoder|API.CombobaseDecoder} left
+ * @param {API.UnibaseDecoder|API.CombobaseDecoder} right
+ * @returns {ComposedDecoder}
+ */
+const logger_node_modules_multiformats_src_bases_base_or = (left, right) => new logger_node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({
+  ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }),
+  ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right })
+}))
+
+/**
+ * @class
+ * @template {string} Base
+ * @template {string} Prefix
+ * @implements {API.MultibaseCodec}
+ * @implements {API.MultibaseEncoder}
+ * @implements {API.MultibaseDecoder}
+ * @implements {API.BaseCodec}
+ * @implements {API.BaseEncoder}
+ * @implements {API.BaseDecoder}
+ */
+class logger_node_modules_multiformats_src_bases_base_Codec {
+  /**
+   * @param {Base} name
+   * @param {Prefix} prefix
+   * @param {(bytes:Uint8Array) => string} baseEncode
+   * @param {(text:string) => Uint8Array} baseDecode
+   */
+  constructor (name, prefix, baseEncode, baseDecode) {
+    this.name = name
+    this.prefix = prefix
+    this.baseEncode = baseEncode
+    this.baseDecode = baseDecode
+    this.encoder = new logger_node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode)
+    this.decoder = new logger_node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode)
+  }
 
+  /**
+   * @param {Uint8Array} input
+   */
+  encode (input) {
+    return this.encoder.encode(input)
+  }
 
+  /**
+   * @param {string} input
+   */
+  decode (input) {
+    return this.decoder.decode(input)
+  }
+}
 
+/**
+ * @template {string} Base
+ * @template {string} Prefix
+ * @param {object} options
+ * @param {Base} options.name
+ * @param {Prefix} options.prefix
+ * @param {(bytes:Uint8Array) => string} options.encode
+ * @param {(input:string) => Uint8Array} options.decode
+ * @returns {Codec}
+ */
+const logger_node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) =>
+  new logger_node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode)
 
+/**
+ * @template {string} Base
+ * @template {string} Prefix
+ * @param {object} options
+ * @param {Base} options.name
+ * @param {Prefix} options.prefix
+ * @param {string} options.alphabet
+ * @returns {Codec}
+ */
+const logger_node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => {
+  const { encode, decode } = logger_node_modules_multiformats_vendor_base_x(alphabet, name)
+  return logger_node_modules_multiformats_src_bases_base_from({
+    prefix,
+    name,
+    encode,
+    /**
+     * @param {string} text
+     */
+    decode: text => logger_node_modules_multiformats_src_bytes_coerce(decode(text))
+  })
+}
 
 /**
- * Create an async iterator that yields paths that match requested glob pattern
+ * @param {string} string
+ * @param {string} alphabet
+ * @param {number} bitsPerChar
+ * @param {string} name
+ * @returns {Uint8Array}
  */
-async function* glob_source_globSource(cwd, pattern, options = {}) {
-    if (typeof pattern !== 'string') {
-        throw new InvalidParametersError('Pattern must be a string');
-    }
-    if (!Path.isAbsolute(cwd)) {
-        cwd = Path.resolve(process.cwd(), cwd);
+const logger_node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => {
+  // Build the character lookup table:
+  /** @type {Record} */
+  const codes = {}
+  for (let i = 0; i < alphabet.length; ++i) {
+    codes[alphabet[i]] = i
+  }
+
+  // Count the padding bytes:
+  let end = string.length
+  while (string[end - 1] === '=') {
+    --end
+  }
+
+  // Allocate the output:
+  const out = new Uint8Array((end * bitsPerChar / 8) | 0)
+
+  // Parse the data:
+  let bits = 0 // Number of bits currently in the buffer
+  let buffer = 0 // Bits waiting to be written out, MSB first
+  let written = 0 // Next byte to write
+  for (let i = 0; i < end; ++i) {
+    // Read one character from the string:
+    const value = codes[string[i]]
+    if (value === undefined) {
+      throw new SyntaxError(`Non-${name} character`)
     }
-    const globOptions = Object.assign({}, {
-        nodir: false,
-        realpath: false,
-        absolute: true,
-        dot: Boolean(options.hidden),
-        follow: options.followSymlinks != null ? options.followSymlinks : true
-    });
-    for await (const p of glob(cwd, pattern, globOptions)) {
-        const stat = await fsp.stat(p);
-        let mode = options.mode;
-        if (options.preserveMode === true) {
-            mode = stat.mode;
-        }
-        let mtime = options.mtime;
-        if (options.preserveMtime === true) {
-            mtime = stat.mtime;
-        }
-        yield {
-            path: toPosix(p.replace(cwd, '')),
-            content: stat.isFile() ? fs.createReadStream(p) : undefined,
-            mode,
-            mtime: toMtime(mtime)
-        };
+
+    // Append the bits to the buffer:
+    buffer = (buffer << bitsPerChar) | value
+    bits += bitsPerChar
+
+    // Write out some bits if the buffer has a byte's worth:
+    if (bits >= 8) {
+      bits -= 8
+      out[written++] = 0xff & (buffer >> bits)
     }
-}
-const toPosix = (path) => path.replace(/\\/g, '/');
-//# sourceMappingURL=glob-source.js.map
-;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/utils/url-source.js
+  }
 
-function urlSource(url, options) {
-    return {
-        path: decodeURIComponent(new URL(url).pathname.split('/').pop() ?? ''),
-        content: readURLContent(url, options)
-    };
+  // Verify that we have received just enough bits:
+  if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) {
+    throw new SyntaxError('Unexpected end of data')
+  }
+
+  return out
 }
-async function* readURLContent(url, options) {
-    const response = await globalThis.fetch(url, options);
-    if (response.body == null) {
-        throw new UnknownError('HTTP response did not have a body');
+
+/**
+ * @param {Uint8Array} data
+ * @param {string} alphabet
+ * @param {number} bitsPerChar
+ * @returns {string}
+ */
+const logger_node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => {
+  const pad = alphabet[alphabet.length - 1] === '='
+  const mask = (1 << bitsPerChar) - 1
+  let out = ''
+
+  let bits = 0 // Number of bits currently in the buffer
+  let buffer = 0 // Bits waiting to be written out, MSB first
+  for (let i = 0; i < data.length; ++i) {
+    // Slurp data into the buffer:
+    buffer = (buffer << 8) | data[i]
+    bits += 8
+
+    // Write out as much as we can:
+    while (bits > bitsPerChar) {
+      bits -= bitsPerChar
+      out += alphabet[mask & (buffer >> bits)]
     }
-    const reader = response.body.getReader();
-    try {
-        while (true) {
-            const { done, value } = await reader.read();
-            if (done) {
-                return;
-            }
-            if (value != null) {
-                yield value;
-            }
-        }
+  }
+
+  // Partial character:
+  if (bits) {
+    out += alphabet[mask & (buffer << (bitsPerChar - bits))]
+  }
+
+  // Add padding characters until we hit a byte boundary:
+  if (pad) {
+    while ((out.length * bitsPerChar) & 7) {
+      out += '='
     }
-    finally {
-        reader.releaseLock();
+  }
+
+  return out
+}
+
+/**
+ * RFC4648 Factory
+ *
+ * @template {string} Base
+ * @template {string} Prefix
+ * @param {object} options
+ * @param {Base} options.name
+ * @param {Prefix} options.prefix
+ * @param {string} options.alphabet
+ * @param {number} options.bitsPerChar
+ */
+const logger_node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => {
+  return logger_node_modules_multiformats_src_bases_base_from({
+    prefix,
+    name,
+    encode (input) {
+      return logger_node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar)
+    },
+    decode (input) {
+      return logger_node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name)
     }
+  })
 }
-//# sourceMappingURL=url-source.js.map
-;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/index.js
+
+;// CONCATENATED MODULE: ./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base32.js
+
+
+const logger_node_modules_multiformats_src_bases_base32_base32 = logger_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'b',
+  name: 'base32',
+  alphabet: 'abcdefghijklmnopqrstuvwxyz234567',
+  bitsPerChar: 5
+})
+
+const logger_node_modules_multiformats_src_bases_base32_base32upper = logger_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'B',
+  name: 'base32upper',
+  alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567',
+  bitsPerChar: 5
+})
+
+const logger_node_modules_multiformats_src_bases_base32_base32pad = logger_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'c',
+  name: 'base32pad',
+  alphabet: 'abcdefghijklmnopqrstuvwxyz234567=',
+  bitsPerChar: 5
+})
+
+const logger_node_modules_multiformats_src_bases_base32_base32padupper = logger_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'C',
+  name: 'base32padupper',
+  alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=',
+  bitsPerChar: 5
+})
+
+const logger_node_modules_multiformats_src_bases_base32_base32hex = logger_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'v',
+  name: 'base32hex',
+  alphabet: '0123456789abcdefghijklmnopqrstuv',
+  bitsPerChar: 5
+})
+
+const logger_node_modules_multiformats_src_bases_base32_base32hexupper = logger_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'V',
+  name: 'base32hexupper',
+  alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV',
+  bitsPerChar: 5
+})
+
+const logger_node_modules_multiformats_src_bases_base32_base32hexpad = logger_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 't',
+  name: 'base32hexpad',
+  alphabet: '0123456789abcdefghijklmnopqrstuv=',
+  bitsPerChar: 5
+})
+
+const logger_node_modules_multiformats_src_bases_base32_base32hexpadupper = logger_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'T',
+  name: 'base32hexpadupper',
+  alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=',
+  bitsPerChar: 5
+})
+
+const logger_node_modules_multiformats_src_bases_base32_base32z = logger_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'h',
+  name: 'base32z',
+  alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769',
+  bitsPerChar: 5
+})
+
+;// CONCATENATED MODULE: ./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base58.js
+
+
+const logger_node_modules_multiformats_src_bases_base58_base58btc = logger_node_modules_multiformats_src_bases_base_baseX({
+  name: 'base58btc',
+  prefix: 'z',
+  alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
+})
+
+const logger_node_modules_multiformats_src_bases_base58_base58flickr = logger_node_modules_multiformats_src_bases_base_baseX({
+  name: 'base58flickr',
+  prefix: 'Z',
+  alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'
+})
+
+;// CONCATENATED MODULE: ./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base64.js
+// @ts-check
+
+
+
+const logger_node_modules_multiformats_src_bases_base64_base64 = logger_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'm',
+  name: 'base64',
+  alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
+  bitsPerChar: 6
+})
+
+const logger_node_modules_multiformats_src_bases_base64_base64pad = logger_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'M',
+  name: 'base64pad',
+  alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
+  bitsPerChar: 6
+})
+
+const logger_node_modules_multiformats_src_bases_base64_base64url = logger_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'u',
+  name: 'base64url',
+  alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',
+  bitsPerChar: 6
+})
+
+const logger_node_modules_multiformats_src_bases_base64_base64urlpad = logger_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'U',
+  name: 'base64urlpad',
+  alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=',
+  bitsPerChar: 6
+})
+
+;// CONCATENATED MODULE: ./node_modules/@libp2p/logger/dist/src/index.js
 /**
  * @packageDocumentation
  *
- * `@helia/unixfs` is an implementation of a {@link https://github.com/ipfs/specs/blob/main/UNIXFS.md UnixFS filesystem} compatible with {@link https://github.com/ipfs/helia Helia}.
- *
- * See the {@link UnixFS UnixFS interface} for all available operations.
+ * A logger for libp2p based on the venerable [debug](https://www.npmjs.com/package/debug)
+ * module.
  *
  * @example
  *
- * ```typescript
- * import { createHelia } from 'helia'
- * import { unixfs } from '@helia/unixfs'
- *
- * const helia = createHelia({
- *   // ... helia config
- * })
- * const fs = unixfs(helia)
- *
- * // create an empty dir and a file, then add the file to the dir
- * const emptyDirCid = await fs.addDirectory()
- * const fileCid = await fs.addBytes(Uint8Array.from([0, 1, 2, 3]))
- * const updateDirCid = await fs.cp(fileCid, emptyDirCid, 'foo.txt')
- *
- * // or doing the same thing as a stream
- * for await (const entry of fs.addAll([{
- *   path: 'foo.txt',
- *   content: Uint8Array.from([0, 1, 2, 3])
- * }])) {
- *   console.info(entry)
- * }
- * ```
- *
- * @example
+ * ```JavaScript
+ * import { logger } from '@libp2p/logger'
  *
- * Recursively adding a directory (Node.js-compatibly environments only):
+ * const log = logger('libp2p:my:component:name')
  *
- * ```typescript
- * import { globSource } from '@helia/unixfs'
+ * log('something happened: %s', 'it was ok')
+ * log.error('something bad happened: %o', err)
  *
- * for await (const entry of fs.addAll(globSource('path/to/containing/dir', 'glob-pattern'))) {
- *   console.info(entry)
- * }
+ * log('with this peer: %p', aPeerId)
+ * log('and this base58btc: %b', aUint8Array)
+ * log('and this base32: %t', aUint8Array)
+ *  ```
+ * ```console
+ * $ DEBUG=libp2p:* node index.js
+ * something happened: it was ok
+ * something bad happened: 
+ * with this peer: 12D3Foo
+ * with this base58btc: Qmfoo
+ * with this base32: bafyfoo
  * ```
  */
 
@@ -268339,2025 +194812,1489 @@ async function* readURLContent(url, options) {
 
 
 
-
-
-
-
-class DefaultUnixFS {
-    components;
-    constructor(components) {
-        this.components = components;
-    }
-    async *addAll(source, options = {}) {
-        yield* addAll(source, this.components.blockstore, options);
-    }
-    async addBytes(bytes, options = {}) {
-        return addBytes(bytes, this.components.blockstore, options);
-    }
-    async addByteStream(bytes, options = {}) {
-        return addByteStream(bytes, this.components.blockstore, options);
-    }
-    async addFile(file, options = {}) {
-        return addFile(file, this.components.blockstore, options);
-    }
-    async addDirectory(dir = {}, options = {}) {
-        return addDirectory(dir, this.components.blockstore, options);
-    }
-    async *cat(cid, options = {}) {
-        yield* cat(cid, this.components.blockstore, options);
-    }
-    async chmod(cid, mode, options = {}) {
-        return chmod(cid, mode, this.components.blockstore, options);
-    }
-    async cp(source, target, name, options = {}) {
-        return cp(source, target, name, this.components.blockstore, options);
-    }
-    async *ls(cid, options = {}) {
-        yield* ls(cid, this.components.blockstore, options);
-    }
-    async mkdir(cid, dirname, options = {}) {
-        return mkdir(cid, dirname, this.components.blockstore, options);
-    }
-    async rm(cid, path, options = {}) {
-        return rm(cid, path, this.components.blockstore, options);
-    }
-    async stat(cid, options = {}) {
-        return stat(cid, this.components.blockstore, options);
-    }
-    async touch(cid, options = {}) {
-        return touch(cid, this.components.blockstore, options);
-    }
+// Add a formatter for converting to a base58 string
+debug_src.formatters.b = (v) => {
+    return v == null ? 'undefined' : logger_node_modules_multiformats_src_bases_base58_base58btc.baseEncode(v);
+};
+// Add a formatter for converting to a base32 string
+debug_src.formatters.t = (v) => {
+    return v == null ? 'undefined' : logger_node_modules_multiformats_src_bases_base32_base32.baseEncode(v);
+};
+// Add a formatter for converting to a base64 string
+debug_src.formatters.m = (v) => {
+    return v == null ? 'undefined' : logger_node_modules_multiformats_src_bases_base64_base64.baseEncode(v);
+};
+// Add a formatter for stringifying peer ids
+debug_src.formatters.p = (v) => {
+    return v == null ? 'undefined' : v.toString();
+};
+// Add a formatter for stringifying CIDs
+debug_src.formatters.c = (v) => {
+    return v == null ? 'undefined' : v.toString();
+};
+// Add a formatter for stringifying Datastore keys
+debug_src.formatters.k = (v) => {
+    return v == null ? 'undefined' : v.toString();
+};
+// Add a formatter for stringifying Multiaddrs
+debug_src.formatters.a = (v) => {
+    return v == null ? 'undefined' : v.toString();
+};
+function dist_src_createDisabledLogger(namespace) {
+    const logger = () => { };
+    logger.enabled = false;
+    logger.color = '';
+    logger.diff = 0;
+    logger.log = () => { };
+    logger.namespace = namespace;
+    logger.destroy = () => true;
+    logger.extend = () => logger;
+    return logger;
 }
 /**
- * Create a {@link UnixFS} instance for use with {@link https://github.com/ipfs/helia Helia}
+ * Create a component logger that will prefix any log messages with a truncated
+ * peer id.
+ *
+ * @example
+ *
+ * ```TypeScript
+ * import { peerLogger } from '@libp2p/logger'
+ * import { peerIdFromString } from '@libp2p/peer-id'
+ *
+ * const peerId = peerIdFromString('12D3FooBar')
+ * const logger = peerLogger(peerId)
+ *
+ * const log = logger.forComponent('my-component')
+ * log.info('hello world')
+ * // logs "12…oBar:my-component hello world"
+ * ```
  */
-function unixfs(helia) {
-    return new DefaultUnixFS(helia);
-}
-
-
-//# sourceMappingURL=index.js.map
-;// CONCATENATED MODULE: external "node:fs/promises"
-const external_node_fs_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs/promises");
-// EXTERNAL MODULE: external "node:util"
-var external_node_util_ = __nccwpck_require__(47261);
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/dist/src/errors.js
-
-function openFailedError(err) {
-    err = err ?? new Error('Open failed');
-    return err_code(err, 'ERR_OPEN_FAILED');
-}
-function closeFailedError(err) {
-    err = err ?? new Error('Close failed');
-    return err_code(err, 'ERR_CLOSE_FAILED');
-}
-function putFailedError(err) {
-    err = err ?? new Error('Put failed');
-    return err_code(err, 'ERR_PUT_FAILED');
-}
-function getFailedError(err) {
-    err = err ?? new Error('Get failed');
-    return err_code(err, 'ERR_GET_FAILED');
-}
-function deleteFailedError(err) {
-    err = err ?? new Error('Delete failed');
-    return err_code(err, 'ERR_DELETE_FAILED');
-}
-function hasFailedError(err) {
-    err = err ?? new Error('Has failed');
-    return err_code(err, 'ERR_HAS_FAILED');
-}
-function notFoundError(err) {
-    err = err ?? new Error('Not Found');
-    return err_code(err, 'ERR_NOT_FOUND');
-}
-function abortedError(err) {
-    err = err ?? new Error('Aborted');
-    return err_code(err, 'ERR_ABORTED');
-}
-//# sourceMappingURL=errors.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/bytes.js
-const blockstore_core_node_modules_multiformats_dist_src_bytes_empty = new Uint8Array(0);
-function blockstore_core_node_modules_multiformats_dist_src_bytes_toHex(d) {
-    return d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '');
-}
-function blockstore_core_node_modules_multiformats_dist_src_bytes_fromHex(hex) {
-    const hexes = hex.match(/../g);
-    return hexes != null ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : blockstore_core_node_modules_multiformats_dist_src_bytes_empty;
-}
-function blockstore_core_node_modules_multiformats_dist_src_bytes_equals(aa, bb) {
-    if (aa === bb)
-        return true;
-    if (aa.byteLength !== bb.byteLength) {
-        return false;
-    }
-    for (let ii = 0; ii < aa.byteLength; ii++) {
-        if (aa[ii] !== bb[ii]) {
-            return false;
-        }
-    }
-    return true;
-}
-function blockstore_core_node_modules_multiformats_dist_src_bytes_coerce(o) {
-    if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array')
-        return o;
-    if (o instanceof ArrayBuffer)
-        return new Uint8Array(o);
-    if (ArrayBuffer.isView(o)) {
-        return new Uint8Array(o.buffer, o.byteOffset, o.byteLength);
-    }
-    throw new Error('Unknown type, must be binary type');
-}
-function blockstore_core_node_modules_multiformats_dist_src_bytes_isBinary(o) {
-    return o instanceof ArrayBuffer || ArrayBuffer.isView(o);
-}
-function blockstore_core_node_modules_multiformats_dist_src_bytes_fromString(str) {
-    return new TextEncoder().encode(str);
-}
-function blockstore_core_node_modules_multiformats_dist_src_bytes_toString(b) {
-    return new TextDecoder().decode(b);
+function peerLogger(peerId, options = {}) {
+    return prefixLogger(truncatePeerId(peerId, options));
 }
-//# sourceMappingURL=bytes.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/vendor/base-x.js
-/* eslint-disable */
-// base-x encoding / decoding
-// Copyright (c) 2018 base-x contributors
-// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
-// Distributed under the MIT software license, see the accompanying
-// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
 /**
- * @param {string} ALPHABET
- * @param {any} name
+ * Create a component logger that will prefix any log messages with the passed
+ * string.
+ *
+ * @example
+ *
+ * ```TypeScript
+ * import { prefixLogger } from '@libp2p/logger'
+ *
+ * const logger = prefixLogger('my-node')
+ *
+ * const log = logger.forComponent('my-component')
+ * log.info('hello world')
+ * // logs "my-node:my-component hello world"
+ * ```
  */
-function node_modules_multiformats_dist_src_vendor_base_x_base(ALPHABET, name) {
-    if (ALPHABET.length >= 255) {
-        throw new TypeError('Alphabet too long');
-    }
-    var BASE_MAP = new Uint8Array(256);
-    for (var j = 0; j < BASE_MAP.length; j++) {
-        BASE_MAP[j] = 255;
-    }
-    for (var i = 0; i < ALPHABET.length; i++) {
-        var x = ALPHABET.charAt(i);
-        var xc = x.charCodeAt(0);
-        if (BASE_MAP[xc] !== 255) {
-            throw new TypeError(x + ' is ambiguous');
-        }
-        BASE_MAP[xc] = i;
-    }
-    var BASE = ALPHABET.length;
-    var LEADER = ALPHABET.charAt(0);
-    var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up
-    var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up
-    /**
-     * @param {any[] | Iterable} source
-     */
-    function encode(source) {
-        // @ts-ignore
-        if (source instanceof Uint8Array)
-            ;
-        else if (ArrayBuffer.isView(source)) {
-            source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
-        }
-        else if (Array.isArray(source)) {
-            source = Uint8Array.from(source);
-        }
-        if (!(source instanceof Uint8Array)) {
-            throw new TypeError('Expected Uint8Array');
-        }
-        if (source.length === 0) {
-            return '';
-        }
-        // Skip & count leading zeroes.
-        var zeroes = 0;
-        var length = 0;
-        var pbegin = 0;
-        var pend = source.length;
-        while (pbegin !== pend && source[pbegin] === 0) {
-            pbegin++;
-            zeroes++;
-        }
-        // Allocate enough space in big-endian base58 representation.
-        var size = ((pend - pbegin) * iFACTOR + 1) >>> 0;
-        var b58 = new Uint8Array(size);
-        // Process the bytes.
-        while (pbegin !== pend) {
-            var carry = source[pbegin];
-            // Apply "b58 = b58 * 256 + ch".
-            var i = 0;
-            for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
-                carry += (256 * b58[it1]) >>> 0;
-                b58[it1] = (carry % BASE) >>> 0;
-                carry = (carry / BASE) >>> 0;
-            }
-            if (carry !== 0) {
-                throw new Error('Non-zero carry');
-            }
-            length = i;
-            pbegin++;
-        }
-        // Skip leading zeroes in base58 result.
-        var it2 = size - length;
-        while (it2 !== size && b58[it2] === 0) {
-            it2++;
-        }
-        // Translate the result into a string.
-        var str = LEADER.repeat(zeroes);
-        for (; it2 < size; ++it2) {
-            str += ALPHABET.charAt(b58[it2]);
-        }
-        return str;
-    }
-    /**
-     * @param {string | string[]} source
-     */
-    function decodeUnsafe(source) {
-        if (typeof source !== 'string') {
-            throw new TypeError('Expected String');
-        }
-        if (source.length === 0) {
-            return new Uint8Array();
-        }
-        var psz = 0;
-        // Skip leading spaces.
-        if (source[psz] === ' ') {
-            return;
-        }
-        // Skip and count leading '1's.
-        var zeroes = 0;
-        var length = 0;
-        while (source[psz] === LEADER) {
-            zeroes++;
-            psz++;
-        }
-        // Allocate enough space in big-endian base256 representation.
-        var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.
-        var b256 = new Uint8Array(size);
-        // Process the characters.
-        while (source[psz]) {
-            // Decode character
-            var carry = BASE_MAP[source.charCodeAt(psz)];
-            // Invalid character
-            if (carry === 255) {
-                return;
-            }
-            var i = 0;
-            for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
-                carry += (BASE * b256[it3]) >>> 0;
-                b256[it3] = (carry % 256) >>> 0;
-                carry = (carry / 256) >>> 0;
-            }
-            if (carry !== 0) {
-                throw new Error('Non-zero carry');
-            }
-            length = i;
-            psz++;
-        }
-        // Skip trailing spaces.
-        if (source[psz] === ' ') {
-            return;
-        }
-        // Skip leading zeroes in b256.
-        var it4 = size - length;
-        while (it4 !== size && b256[it4] === 0) {
-            it4++;
-        }
-        var vch = new Uint8Array(zeroes + (size - it4));
-        var j = zeroes;
-        while (it4 !== size) {
-            vch[j++] = b256[it4++];
-        }
-        return vch;
-    }
-    /**
-     * @param {string | string[]} string
-     */
-    function decode(string) {
-        var buffer = decodeUnsafe(string);
-        if (buffer) {
-            return buffer;
+function prefixLogger(prefix) {
+    return {
+        forComponent(name) {
+            return dist_src_logger(`${prefix}:${name}`);
         }
-        throw new Error(`Non-${name} character`);
-    }
+    };
+}
+/**
+ * Create a component logger
+ *
+ * @example
+ *
+ * ```TypeScript
+ * import { defaultLogger } from '@libp2p/logger'
+ * import { peerIdFromString } from '@libp2p/peer-id'
+ *
+ * const logger = defaultLogger()
+ *
+ * const log = logger.forComponent('my-component')
+ * log.info('hello world')
+ * // logs "my-component hello world"
+ * ```
+ */
+function defaultLogger() {
     return {
-        encode: encode,
-        decodeUnsafe: decodeUnsafe,
-        decode: decode
+        forComponent(name) {
+            return dist_src_logger(name);
+        }
     };
 }
-var node_modules_multiformats_dist_src_vendor_base_x_src = node_modules_multiformats_dist_src_vendor_base_x_base;
-var node_modules_multiformats_dist_src_vendor_base_x_brrp_multiformats_scope_baseX = node_modules_multiformats_dist_src_vendor_base_x_src;
-/* harmony default export */ const blockstore_core_node_modules_multiformats_dist_src_vendor_base_x = (node_modules_multiformats_dist_src_vendor_base_x_brrp_multiformats_scope_baseX);
-//# sourceMappingURL=base-x.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/bases/base.js
-
-
 /**
- * Class represents both BaseEncoder and MultibaseEncoder meaning it
- * can be used to encode to multibase or base encode without multibase
- * prefix.
+ * Creates a logger for the passed component name.
+ *
+ * @example
+ *
+ * ```TypeScript
+ * import { logger } from '@libp2p/logger'
+ *
+ * const log = logger('my-component')
+ * log.info('hello world')
+ * // logs "my-component hello world"
+ * ```
  */
-class blockstore_core_node_modules_multiformats_dist_src_bases_base_Encoder {
-    name;
-    prefix;
-    baseEncode;
-    constructor(name, prefix, baseEncode) {
-        this.name = name;
-        this.prefix = prefix;
-        this.baseEncode = baseEncode;
+function dist_src_logger(name) {
+    // trace logging is a no-op by default
+    let trace = dist_src_createDisabledLogger(`${name}:trace`);
+    // look at all the debug names and see if trace logging has explicitly been enabled
+    if (debug_src.enabled(`${name}:trace`) && debug_src.names.map(r => r.toString()).find(n => n.includes(':trace')) != null) {
+        trace = debug_src(`${name}:trace`);
     }
-    encode(bytes) {
-        if (bytes instanceof Uint8Array) {
-            return `${this.prefix}${this.baseEncode(bytes)}`;
+    return Object.assign(debug_src(name), {
+        error: debug_src(`${name}:error`),
+        trace
+    });
+}
+function dist_src_disable() {
+    debug.disable();
+}
+function dist_src_enable(namespaces) {
+    debug.enable(namespaces);
+}
+function dist_src_enabled(namespaces) {
+    return debug.enabled(namespaces);
+}
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/consumable-hash.js
+
+function consumable_hash_wrapHash(hashFn) {
+    function hashing(value) {
+        if (value instanceof consumable_hash_InfiniteHash) {
+            // already a hash. return it
+            return value;
         }
         else {
-            throw Error('Unknown type, must be binary type');
+            return new consumable_hash_InfiniteHash(value, hashFn);
         }
     }
+    return hashing;
 }
-/**
- * Class represents both BaseDecoder and MultibaseDecoder so it could be used
- * to decode multibases (with matching prefix) or just base decode strings
- * with corresponding base encoding.
- */
-class blockstore_core_node_modules_multiformats_dist_src_bases_base_Decoder {
-    name;
-    prefix;
-    baseDecode;
-    prefixCodePoint;
-    constructor(name, prefix, baseDecode) {
-        this.name = name;
-        this.prefix = prefix;
-        /* c8 ignore next 3 */
-        if (prefix.codePointAt(0) === undefined) {
-            throw new Error('Invalid prefix character');
+class consumable_hash_InfiniteHash {
+    _value;
+    _hashFn;
+    _depth;
+    _availableBits;
+    _currentBufferIndex;
+    _buffers;
+    constructor(value, hashFn) {
+        if (!(value instanceof Uint8Array)) {
+            throw new Error('can only hash Uint8Arrays');
         }
-        this.prefixCodePoint = prefix.codePointAt(0);
-        this.baseDecode = baseDecode;
+        this._value = value;
+        this._hashFn = hashFn;
+        this._depth = -1;
+        this._availableBits = 0;
+        this._currentBufferIndex = 0;
+        this._buffers = [];
     }
-    decode(text) {
-        if (typeof text === 'string') {
-            if (text.codePointAt(0) !== this.prefixCodePoint) {
-                throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);
-            }
-            return this.baseDecode(text.slice(this.prefix.length));
+    async take(bits) {
+        let pendingBits = bits;
+        while (this._availableBits < pendingBits) {
+            await this._produceMoreBits();
         }
-        else {
-            throw Error('Can only multibase decode strings');
+        let result = 0;
+        while (pendingBits > 0) {
+            const hash = this._buffers[this._currentBufferIndex];
+            const available = Math.min(hash.availableBits(), pendingBits);
+            const took = hash.take(available);
+            result = (result << available) + took;
+            pendingBits -= available;
+            this._availableBits -= available;
+            if (hash.availableBits() === 0) {
+                this._currentBufferIndex++;
+            }
         }
+        return result;
     }
-    or(decoder) {
-        return blockstore_core_node_modules_multiformats_dist_src_bases_base_or(this, decoder);
-    }
-}
-class blockstore_core_node_modules_multiformats_dist_src_bases_base_ComposedDecoder {
-    decoders;
-    constructor(decoders) {
-        this.decoders = decoders;
-    }
-    or(decoder) {
-        return blockstore_core_node_modules_multiformats_dist_src_bases_base_or(this, decoder);
-    }
-    decode(input) {
-        const prefix = input[0];
-        const decoder = this.decoders[prefix];
-        if (decoder != null) {
-            return decoder.decode(input);
-        }
-        else {
-            throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`);
+    untake(bits) {
+        let pendingBits = bits;
+        while (pendingBits > 0) {
+            const hash = this._buffers[this._currentBufferIndex];
+            const availableForUntake = Math.min(hash.totalBits() - hash.availableBits(), pendingBits);
+            hash.untake(availableForUntake);
+            pendingBits -= availableForUntake;
+            this._availableBits += availableForUntake;
+            if (this._currentBufferIndex > 0 && hash.totalBits() === hash.availableBits()) {
+                this._depth--;
+                this._currentBufferIndex--;
+            }
         }
     }
-}
-function blockstore_core_node_modules_multiformats_dist_src_bases_base_or(left, right) {
-    // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
-    return new blockstore_core_node_modules_multiformats_dist_src_bases_base_ComposedDecoder({
-        ...(left.decoders ?? { [left.prefix]: left }),
-        ...(right.decoders ?? { [right.prefix]: right })
-    });
-}
-class blockstore_core_node_modules_multiformats_dist_src_bases_base_Codec {
-    name;
-    prefix;
-    baseEncode;
-    baseDecode;
-    encoder;
-    decoder;
-    constructor(name, prefix, baseEncode, baseDecode) {
-        this.name = name;
-        this.prefix = prefix;
-        this.baseEncode = baseEncode;
-        this.baseDecode = baseDecode;
-        this.encoder = new blockstore_core_node_modules_multiformats_dist_src_bases_base_Encoder(name, prefix, baseEncode);
-        this.decoder = new blockstore_core_node_modules_multiformats_dist_src_bases_base_Decoder(name, prefix, baseDecode);
-    }
-    encode(input) {
-        return this.encoder.encode(input);
-    }
-    decode(input) {
-        return this.decoder.decode(input);
+    async _produceMoreBits() {
+        this._depth++;
+        const value = this._depth > 0 ? uint8arrays_dist_src_concat_concat([this._value, Uint8Array.from([this._depth])]) : this._value;
+        const hashValue = await this._hashFn(value);
+        const buffer = new consumable_hash_ConsumableBuffer(hashValue);
+        this._buffers.push(buffer);
+        this._availableBits += buffer.availableBits();
     }
 }
-function blockstore_core_node_modules_multiformats_dist_src_bases_base_from({ name, prefix, encode, decode }) {
-    return new blockstore_core_node_modules_multiformats_dist_src_bases_base_Codec(name, prefix, encode, decode);
-}
-function blockstore_core_node_modules_multiformats_dist_src_bases_base_baseX({ name, prefix, alphabet }) {
-    const { encode, decode } = blockstore_core_node_modules_multiformats_dist_src_vendor_base_x(alphabet, name);
-    return blockstore_core_node_modules_multiformats_dist_src_bases_base_from({
-        prefix,
-        name,
-        encode,
-        decode: (text) => blockstore_core_node_modules_multiformats_dist_src_bytes_coerce(decode(text))
-    });
-}
-function blockstore_core_node_modules_multiformats_dist_src_bases_base_decode(string, alphabet, bitsPerChar, name) {
-    // Build the character lookup table:
-    const codes = {};
-    for (let i = 0; i < alphabet.length; ++i) {
-        codes[alphabet[i]] = i;
-    }
-    // Count the padding bytes:
-    let end = string.length;
-    while (string[end - 1] === '=') {
-        --end;
-    }
-    // Allocate the output:
-    const out = new Uint8Array((end * bitsPerChar / 8) | 0);
-    // Parse the data:
-    let bits = 0; // Number of bits currently in the buffer
-    let buffer = 0; // Bits waiting to be written out, MSB first
-    let written = 0; // Next byte to write
-    for (let i = 0; i < end; ++i) {
-        // Read one character from the string:
-        const value = codes[string[i]];
-        if (value === undefined) {
-            throw new SyntaxError(`Non-${name} character`);
-        }
-        // Append the bits to the buffer:
-        buffer = (buffer << bitsPerChar) | value;
-        bits += bitsPerChar;
-        // Write out some bits if the buffer has a byte's worth:
-        if (bits >= 8) {
-            bits -= 8;
-            out[written++] = 0xff & (buffer >> bits);
-        }
-    }
-    // Verify that we have received just enough bits:
-    if (bits >= bitsPerChar || (0xff & (buffer << (8 - bits))) !== 0) {
-        throw new SyntaxError('Unexpected end of data');
+const consumable_hash_START_MASKS = [
+    0b11111111,
+    0b11111110,
+    0b11111100,
+    0b11111000,
+    0b11110000,
+    0b11100000,
+    0b11000000,
+    0b10000000
+];
+const consumable_hash_STOP_MASKS = [
+    0b00000001,
+    0b00000011,
+    0b00000111,
+    0b00001111,
+    0b00011111,
+    0b00111111,
+    0b01111111,
+    0b11111111
+];
+class consumable_hash_ConsumableBuffer {
+    _value;
+    _currentBytePos;
+    _currentBitPos;
+    constructor(value) {
+        this._value = value;
+        this._currentBytePos = value.length - 1;
+        this._currentBitPos = 7;
     }
-    return out;
-}
-function blockstore_core_node_modules_multiformats_dist_src_bases_base_encode(data, alphabet, bitsPerChar) {
-    const pad = alphabet[alphabet.length - 1] === '=';
-    const mask = (1 << bitsPerChar) - 1;
-    let out = '';
-    let bits = 0; // Number of bits currently in the buffer
-    let buffer = 0; // Bits waiting to be written out, MSB first
-    for (let i = 0; i < data.length; ++i) {
-        // Slurp data into the buffer:
-        buffer = (buffer << 8) | data[i];
-        bits += 8;
-        // Write out as much as we can:
-        while (bits > bitsPerChar) {
-            bits -= bitsPerChar;
-            out += alphabet[mask & (buffer >> bits)];
-        }
+    availableBits() {
+        return this._currentBitPos + 1 + this._currentBytePos * 8;
     }
-    // Partial character:
-    if (bits !== 0) {
-        out += alphabet[mask & (buffer << (bitsPerChar - bits))];
+    totalBits() {
+        return this._value.length * 8;
     }
-    // Add padding characters until we hit a byte boundary:
-    if (pad) {
-        while (((out.length * bitsPerChar) & 7) !== 0) {
-            out += '=';
+    take(bits) {
+        let pendingBits = bits;
+        let result = 0;
+        while (pendingBits > 0 && this._haveBits()) {
+            const byte = this._value[this._currentBytePos];
+            const availableBits = this._currentBitPos + 1;
+            const taking = Math.min(availableBits, pendingBits);
+            const value = consumable_hash_byteBitsToInt(byte, availableBits - taking, taking);
+            result = (result << taking) + value;
+            pendingBits -= taking;
+            this._currentBitPos -= taking;
+            if (this._currentBitPos < 0) {
+                this._currentBitPos = 7;
+                this._currentBytePos--;
+            }
         }
+        return result;
     }
-    return out;
-}
-/**
- * RFC4648 Factory
- */
-function blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({ name, prefix, bitsPerChar, alphabet }) {
-    return blockstore_core_node_modules_multiformats_dist_src_bases_base_from({
-        prefix,
-        name,
-        encode(input) {
-            return blockstore_core_node_modules_multiformats_dist_src_bases_base_encode(input, alphabet, bitsPerChar);
-        },
-        decode(input) {
-            return blockstore_core_node_modules_multiformats_dist_src_bases_base_decode(input, alphabet, bitsPerChar, name);
+    untake(bits) {
+        this._currentBitPos += bits;
+        while (this._currentBitPos > 7) {
+            this._currentBitPos -= 8;
+            this._currentBytePos += 1;
         }
-    });
-}
-//# sourceMappingURL=base.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/bases/base32.js
-
-const blockstore_core_node_modules_multiformats_dist_src_bases_base32_base32 = blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({
-    prefix: 'b',
-    name: 'base32',
-    alphabet: 'abcdefghijklmnopqrstuvwxyz234567',
-    bitsPerChar: 5
-});
-const blockstore_core_node_modules_multiformats_dist_src_bases_base32_base32upper = blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({
-    prefix: 'B',
-    name: 'base32upper',
-    alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567',
-    bitsPerChar: 5
-});
-const blockstore_core_node_modules_multiformats_dist_src_bases_base32_base32pad = blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({
-    prefix: 'c',
-    name: 'base32pad',
-    alphabet: 'abcdefghijklmnopqrstuvwxyz234567=',
-    bitsPerChar: 5
-});
-const blockstore_core_node_modules_multiformats_dist_src_bases_base32_base32padupper = blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({
-    prefix: 'C',
-    name: 'base32padupper',
-    alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=',
-    bitsPerChar: 5
-});
-const blockstore_core_node_modules_multiformats_dist_src_bases_base32_base32hex = blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({
-    prefix: 'v',
-    name: 'base32hex',
-    alphabet: '0123456789abcdefghijklmnopqrstuv',
-    bitsPerChar: 5
-});
-const blockstore_core_node_modules_multiformats_dist_src_bases_base32_base32hexupper = blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({
-    prefix: 'V',
-    name: 'base32hexupper',
-    alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV',
-    bitsPerChar: 5
-});
-const blockstore_core_node_modules_multiformats_dist_src_bases_base32_base32hexpad = blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({
-    prefix: 't',
-    name: 'base32hexpad',
-    alphabet: '0123456789abcdefghijklmnopqrstuv=',
-    bitsPerChar: 5
-});
-const blockstore_core_node_modules_multiformats_dist_src_bases_base32_base32hexpadupper = blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({
-    prefix: 'T',
-    name: 'base32hexpadupper',
-    alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=',
-    bitsPerChar: 5
-});
-const blockstore_core_node_modules_multiformats_dist_src_bases_base32_base32z = blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({
-    prefix: 'h',
-    name: 'base32z',
-    alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769',
-    bitsPerChar: 5
-});
-//# sourceMappingURL=base32.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/bases/base58.js
-
-const blockstore_core_node_modules_multiformats_dist_src_bases_base58_base58btc = blockstore_core_node_modules_multiformats_dist_src_bases_base_baseX({
-    name: 'base58btc',
-    prefix: 'z',
-    alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
-});
-const blockstore_core_node_modules_multiformats_dist_src_bases_base58_base58flickr = blockstore_core_node_modules_multiformats_dist_src_bases_base_baseX({
-    name: 'base58flickr',
-    prefix: 'Z',
-    alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'
-});
-//# sourceMappingURL=base58.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/vendor/varint.js
-/* eslint-disable */
-var node_modules_multiformats_dist_src_vendor_varint_encode_1 = blockstore_core_node_modules_multiformats_dist_src_vendor_varint_encode;
-var node_modules_multiformats_dist_src_vendor_varint_MSB = 0x80, node_modules_multiformats_dist_src_vendor_varint_REST = 0x7F, node_modules_multiformats_dist_src_vendor_varint_MSBALL = ~node_modules_multiformats_dist_src_vendor_varint_REST, node_modules_multiformats_dist_src_vendor_varint_INT = Math.pow(2, 31);
-/**
- * @param {number} num
- * @param {number[]} out
- * @param {number} offset
- */
-function blockstore_core_node_modules_multiformats_dist_src_vendor_varint_encode(num, out, offset) {
-    out = out || [];
-    offset = offset || 0;
-    var oldOffset = offset;
-    while (num >= node_modules_multiformats_dist_src_vendor_varint_INT) {
-        out[offset++] = (num & 0xFF) | node_modules_multiformats_dist_src_vendor_varint_MSB;
-        num /= 128;
     }
-    while (num & node_modules_multiformats_dist_src_vendor_varint_MSBALL) {
-        out[offset++] = (num & 0xFF) | node_modules_multiformats_dist_src_vendor_varint_MSB;
-        num >>>= 7;
+    _haveBits() {
+        return this._currentBytePos >= 0;
     }
-    out[offset] = num | 0;
-    // @ts-ignore
-    blockstore_core_node_modules_multiformats_dist_src_vendor_varint_encode.bytes = offset - oldOffset + 1;
-    return out;
-}
-var blockstore_core_node_modules_multiformats_dist_src_vendor_varint_decode = node_modules_multiformats_dist_src_vendor_varint_read;
-var node_modules_multiformats_dist_src_vendor_varint_MSB$1 = 0x80, node_modules_multiformats_dist_src_vendor_varint_REST$1 = 0x7F;
-/**
- * @param {string | any[]} buf
- * @param {number} offset
- */
-function node_modules_multiformats_dist_src_vendor_varint_read(buf, offset) {
-    var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length;
-    do {
-        if (counter >= l) {
-            // @ts-ignore
-            node_modules_multiformats_dist_src_vendor_varint_read.bytes = 0;
-            throw new RangeError('Could not decode varint');
-        }
-        b = buf[counter++];
-        res += shift < 28
-            ? (b & node_modules_multiformats_dist_src_vendor_varint_REST$1) << shift
-            : (b & node_modules_multiformats_dist_src_vendor_varint_REST$1) * Math.pow(2, shift);
-        shift += 7;
-    } while (b >= node_modules_multiformats_dist_src_vendor_varint_MSB$1);
-    // @ts-ignore
-    node_modules_multiformats_dist_src_vendor_varint_read.bytes = counter - offset;
-    return res;
 }
-var node_modules_multiformats_dist_src_vendor_varint_N1 = Math.pow(2, 7);
-var node_modules_multiformats_dist_src_vendor_varint_N2 = Math.pow(2, 14);
-var node_modules_multiformats_dist_src_vendor_varint_N3 = Math.pow(2, 21);
-var node_modules_multiformats_dist_src_vendor_varint_N4 = Math.pow(2, 28);
-var node_modules_multiformats_dist_src_vendor_varint_N5 = Math.pow(2, 35);
-var node_modules_multiformats_dist_src_vendor_varint_N6 = Math.pow(2, 42);
-var node_modules_multiformats_dist_src_vendor_varint_N7 = Math.pow(2, 49);
-var node_modules_multiformats_dist_src_vendor_varint_N8 = Math.pow(2, 56);
-var node_modules_multiformats_dist_src_vendor_varint_N9 = Math.pow(2, 63);
-var blockstore_core_node_modules_multiformats_dist_src_vendor_varint_length = function (/** @type {number} */ value) {
-    return (value < node_modules_multiformats_dist_src_vendor_varint_N1 ? 1
-        : value < node_modules_multiformats_dist_src_vendor_varint_N2 ? 2
-            : value < node_modules_multiformats_dist_src_vendor_varint_N3 ? 3
-                : value < node_modules_multiformats_dist_src_vendor_varint_N4 ? 4
-                    : value < node_modules_multiformats_dist_src_vendor_varint_N5 ? 5
-                        : value < node_modules_multiformats_dist_src_vendor_varint_N6 ? 6
-                            : value < node_modules_multiformats_dist_src_vendor_varint_N7 ? 7
-                                : value < node_modules_multiformats_dist_src_vendor_varint_N8 ? 8
-                                    : value < node_modules_multiformats_dist_src_vendor_varint_N9 ? 9
-                                        : 10);
-};
-var blockstore_core_node_modules_multiformats_dist_src_vendor_varint_varint = {
-    encode: node_modules_multiformats_dist_src_vendor_varint_encode_1,
-    decode: blockstore_core_node_modules_multiformats_dist_src_vendor_varint_decode,
-    encodingLength: blockstore_core_node_modules_multiformats_dist_src_vendor_varint_length
-};
-var node_modules_multiformats_dist_src_vendor_varint_brrp_varint = (/* unused pure expression or super */ null && (blockstore_core_node_modules_multiformats_dist_src_vendor_varint_varint));
-/* harmony default export */ const blockstore_core_node_modules_multiformats_dist_src_vendor_varint = ((/* unused pure expression or super */ null && (node_modules_multiformats_dist_src_vendor_varint_brrp_varint)));
-//# sourceMappingURL=varint.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/varint.js
-
-function blockstore_core_node_modules_multiformats_dist_src_varint_decode(data, offset = 0) {
-    const code = varint.decode(data, offset);
-    return [code, varint.decode.bytes];
+function consumable_hash_byteBitsToInt(byte, start, length) {
+    const mask = consumable_hash_maskFor(start, length);
+    return (byte & mask) >>> start;
 }
-function blockstore_core_node_modules_multiformats_dist_src_varint_encodeTo(int, target, offset = 0) {
-    varint.encode(int, target, offset);
-    return target;
+function consumable_hash_maskFor(start, length) {
+    return consumable_hash_START_MASKS[start] & consumable_hash_STOP_MASKS[Math.min(length + start - 1, 7)];
 }
-function blockstore_core_node_modules_multiformats_dist_src_varint_encodingLength(int) {
-    return varint.encodingLength(int);
+//# sourceMappingURL=consumable-hash.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/hamt-constants.js
+
+const hamtHashCode = BigInt(murmur3128.code);
+const hamtBucketBits = 8;
+async function hamt_constants_hamtHashFn(buf) {
+    return (await murmur3128.encode(buf))
+        // Murmur3 outputs 128 bit but, accidentally, IPFS Go's
+        // implementation only uses the first 64, so we must do the same
+        // for parity..
+        .subarray(0, 8)
+        // Invert buffer because that's how Go impl does it
+        .reverse();
 }
-//# sourceMappingURL=varint.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/hashes/digest.js
+//# sourceMappingURL=hamt-constants.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/persist.js
 
 
-/**
- * Creates a multihash digest.
- */
-function blockstore_core_node_modules_multiformats_dist_src_hashes_digest_create(code, digest) {
-    const size = digest.byteLength;
-    const sizeOffset = varint.encodingLength(code);
-    const digestOffset = sizeOffset + varint.encodingLength(size);
-    const bytes = new Uint8Array(digestOffset + size);
-    varint.encodeTo(code, bytes, 0);
-    varint.encodeTo(size, bytes, sizeOffset);
-    bytes.set(digest, digestOffset);
-    return new blockstore_core_node_modules_multiformats_dist_src_hashes_digest_Digest(code, size, digest, bytes);
-}
-/**
- * Turns bytes representation of multihash digest into an instance.
- */
-function blockstore_core_node_modules_multiformats_dist_src_hashes_digest_decode(multihash) {
-    const bytes = coerce(multihash);
-    const [code, sizeOffset] = varint.decode(bytes);
-    const [size, digestOffset] = varint.decode(bytes.subarray(sizeOffset));
-    const digest = bytes.subarray(sizeOffset + digestOffset);
-    if (digest.byteLength !== size) {
-        throw new Error('Incorrect length');
-    }
-    return new blockstore_core_node_modules_multiformats_dist_src_hashes_digest_Digest(code, size, digest, bytes);
-}
-function blockstore_core_node_modules_multiformats_dist_src_hashes_digest_equals(a, b) {
-    if (a === b) {
-        return true;
-    }
-    else {
-        const data = b;
-        return (a.code === data.code &&
-            a.size === data.size &&
-            data.bytes instanceof Uint8Array &&
-            equalBytes(a.bytes, data.bytes));
-    }
-}
-/**
- * Represents a multihash digest which carries information about the
- * hashing algorithm and an actual hash digest.
- */
-class blockstore_core_node_modules_multiformats_dist_src_hashes_digest_Digest {
-    code;
-    size;
-    digest;
-    bytes;
-    /**
-     * Creates a multihash digest.
-     */
-    constructor(code, size, digest, bytes) {
-        this.code = code;
-        this.size = size;
-        this.digest = digest;
-        this.bytes = bytes;
+
+const persist_persist = async (buffer, blockstore, options) => {
+    if (options.codec == null) {
+        options.codec = src_namespaceObject;
     }
-}
-//# sourceMappingURL=digest.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/cid.js
+    const multihash = await unixfs_node_modules_multiformats_src_hashes_sha2_sha256.digest(buffer);
+    const cid = unixfs_node_modules_multiformats_src_cid_CID.create(options.cidVersion, options.codec.code, multihash);
+    await blockstore.put(cid, buffer, {
+        ...options,
+        signal: options.signal
+    });
+    return cid;
+};
+//# sourceMappingURL=persist.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/dir-sharded.js
 
 
 
 
 
-// This way TS will also expose all the types from module
 
-function blockstore_core_node_modules_multiformats_dist_src_cid_format(link, base) {
-    const { bytes, version } = link;
-    switch (version) {
-        case 0:
-            return blockstore_core_node_modules_multiformats_dist_src_cid_toStringV0(bytes, blockstore_core_node_modules_multiformats_dist_src_cid_baseCache(link), base ?? base58btc.encoder);
-        default:
-            return blockstore_core_node_modules_multiformats_dist_src_cid_toStringV1(bytes, blockstore_core_node_modules_multiformats_dist_src_cid_baseCache(link), (base ?? base32.encoder));
+class dir_sharded_Dir {
+    options;
+    root;
+    dir;
+    path;
+    dirty;
+    flat;
+    parent;
+    parentKey;
+    unixfs;
+    mode;
+    mtime;
+    cid;
+    size;
+    nodeSize;
+    constructor(props, options) {
+        this.options = options ?? {};
+        this.root = props.root;
+        this.dir = props.dir;
+        this.path = props.path;
+        this.dirty = props.dirty;
+        this.flat = props.flat;
+        this.parent = props.parent;
+        this.parentKey = props.parentKey;
+        this.unixfs = props.unixfs;
+        this.mode = props.mode;
+        this.mtime = props.mtime;
     }
 }
-function blockstore_core_node_modules_multiformats_dist_src_cid_toJSON(link) {
-    return {
-        '/': blockstore_core_node_modules_multiformats_dist_src_cid_format(link)
-    };
-}
-function blockstore_core_node_modules_multiformats_dist_src_cid_fromJSON(json) {
-    return blockstore_core_node_modules_multiformats_dist_src_cid_CID.parse(json['/']);
-}
-const blockstore_core_node_modules_multiformats_dist_src_cid_cache = new WeakMap();
-function blockstore_core_node_modules_multiformats_dist_src_cid_baseCache(cid) {
-    const baseCache = blockstore_core_node_modules_multiformats_dist_src_cid_cache.get(cid);
-    if (baseCache == null) {
-        const baseCache = new Map();
-        blockstore_core_node_modules_multiformats_dist_src_cid_cache.set(cid, baseCache);
-        return baseCache;
+class dir_sharded_DirSharded extends dir_sharded_Dir {
+    _bucket;
+    constructor(props, options) {
+        super(props, options);
+        this._bucket = createHAMT({
+            hashFn: hamt_constants_hamtHashFn,
+            bits: 8
+        });
     }
-    return baseCache;
-}
-class blockstore_core_node_modules_multiformats_dist_src_cid_CID {
-    code;
-    version;
-    multihash;
-    bytes;
-    '/';
-    /**
-     * @param version - Version of the CID
-     * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv
-     * @param multihash - (Multi)hash of the of the content.
-     */
-    constructor(version, code, multihash, bytes) {
-        this.code = code;
-        this.version = version;
-        this.multihash = multihash;
-        this.bytes = bytes;
-        // flag to serializers that this is a CID and
-        // should be treated specially
-        this['/'] = bytes;
+    async put(name, value) {
+        this.cid = undefined;
+        this.size = undefined;
+        this.nodeSize = undefined;
+        await this._bucket.put(name, value);
     }
-    /**
-     * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes`
-     * please either use `CID.asCID(cid)` or switch to new signalling mechanism
-     *
-     * @deprecated
-     */
-    get asCID() {
-        return this;
+    async get(name) {
+        return this._bucket.get(name);
     }
-    // ArrayBufferView
-    get byteOffset() {
-        return this.bytes.byteOffset;
+    childCount() {
+        return this._bucket.leafCount();
     }
-    // ArrayBufferView
-    get byteLength() {
-        return this.bytes.byteLength;
+    directChildrenCount() {
+        return this._bucket.childrenCount();
     }
-    toV0() {
-        switch (this.version) {
-            case 0: {
-                return this;
-            }
-            case 1: {
-                const { code, multihash } = this;
-                if (code !== blockstore_core_node_modules_multiformats_dist_src_cid_DAG_PB_CODE) {
-                    throw new Error('Cannot convert a non dag-pb CID to CIDv0');
-                }
-                // sha2-256
-                if (multihash.code !== blockstore_core_node_modules_multiformats_dist_src_cid_SHA_256_CODE) {
-                    throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0');
-                }
-                return (blockstore_core_node_modules_multiformats_dist_src_cid_CID.createV0(multihash));
-            }
-            default: {
-                throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`);
-            }
-        }
+    onlyChild() {
+        return this._bucket.onlyChild();
     }
-    toV1() {
-        switch (this.version) {
-            case 0: {
-                const { code, digest } = this.multihash;
-                const multihash = Digest.create(code, digest);
-                return (blockstore_core_node_modules_multiformats_dist_src_cid_CID.createV1(this.code, multihash));
-            }
-            case 1: {
-                return this;
-            }
-            default: {
-                throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`);
-            }
+    async *eachChildSeries() {
+        for await (const { key, value } of this._bucket.eachLeafSeries()) {
+            yield {
+                key,
+                child: value
+            };
         }
     }
-    equals(other) {
-        return blockstore_core_node_modules_multiformats_dist_src_cid_CID.equals(this, other);
-    }
-    static equals(self, other) {
-        const unknown = other;
-        return (unknown != null &&
-            self.code === unknown.code &&
-            self.version === unknown.version &&
-            Digest.equals(self.multihash, unknown.multihash));
-    }
-    toString(base) {
-        return blockstore_core_node_modules_multiformats_dist_src_cid_format(this, base);
-    }
-    toJSON() {
-        return { '/': blockstore_core_node_modules_multiformats_dist_src_cid_format(this) };
-    }
-    link() {
-        return this;
-    }
-    [Symbol.toStringTag] = 'CID';
-    // Legacy
-    [Symbol.for('nodejs.util.inspect.custom')]() {
-        return `CID(${this.toString()})`;
-    }
-    /**
-     * Takes any input `value` and returns a `CID` instance if it was
-     * a `CID` otherwise returns `null`. If `value` is instanceof `CID`
-     * it will return value back. If `value` is not instance of this CID
-     * class, but is compatible CID it will return new instance of this
-     * `CID` class. Otherwise returns null.
-     *
-     * This allows two different incompatible versions of CID library to
-     * co-exist and interop as long as binary interface is compatible.
-     */
-    static asCID(input) {
-        if (input == null) {
-            return null;
-        }
-        const value = input;
-        if (value instanceof blockstore_core_node_modules_multiformats_dist_src_cid_CID) {
-            // If value is instance of CID then we're all set.
-            return value;
-        }
-        else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) {
-            // If value isn't instance of this CID class but `this.asCID === this` or
-            // `value['/'] === value.bytes` is true it is CID instance coming from a
-            // different implementation (diff version or duplicate). In that case we
-            // rebase it to this `CID` implementation so caller is guaranteed to get
-            // instance with expected API.
-            const { version, code, multihash, bytes } = value;
-            return new blockstore_core_node_modules_multiformats_dist_src_cid_CID(version, code, multihash, bytes ?? blockstore_core_node_modules_multiformats_dist_src_cid_encodeCID(version, code, multihash.bytes));
-        }
-        else if (value[blockstore_core_node_modules_multiformats_dist_src_cid_cidSymbol] === true) {
-            // If value is a CID from older implementation that used to be tagged via
-            // symbol we still rebase it to the this `CID` implementation by
-            // delegating that to a constructor.
-            const { version, multihash, code } = value;
-            const digest = Digest.decode(multihash);
-            return blockstore_core_node_modules_multiformats_dist_src_cid_CID.create(version, code, digest);
-        }
-        else {
-            // Otherwise value is not a CID (or an incompatible version of it) in
-            // which case we return `null`.
-            return null;
+    estimateNodeSize() {
+        if (this.nodeSize !== undefined) {
+            return this.nodeSize;
         }
+        this.nodeSize = dir_sharded_calculateSize(this._bucket, this, this.options);
+        return this.nodeSize;
     }
-    /**
-     * @param version - Version of the CID
-     * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv
-     * @param digest - (Multi)hash of the of the content.
-     */
-    static create(version, code, digest) {
-        if (typeof code !== 'number') {
-            throw new Error('String codecs are no longer supported');
+    async *flush(blockstore) {
+        for await (const entry of dir_sharded_flush(this._bucket, blockstore, this, this.options)) {
+            yield {
+                ...entry,
+                path: this.path
+            };
         }
-        if (!(digest.bytes instanceof Uint8Array)) {
-            throw new Error('Invalid digest');
+    }
+}
+async function* dir_sharded_flush(bucket, blockstore, shardRoot, options) {
+    const children = bucket._children;
+    const links = [];
+    let childrenSize = 0n;
+    for (let i = 0; i < children.length; i++) {
+        const child = children.get(i);
+        if (child == null) {
+            continue;
         }
-        switch (version) {
-            case 0: {
-                if (code !== blockstore_core_node_modules_multiformats_dist_src_cid_DAG_PB_CODE) {
-                    throw new Error(`Version 0 CID must use dag-pb (code: ${blockstore_core_node_modules_multiformats_dist_src_cid_DAG_PB_CODE}) block encoding`);
-                }
-                else {
-                    return new blockstore_core_node_modules_multiformats_dist_src_cid_CID(version, code, digest, digest.bytes);
-                }
-            }
-            case 1: {
-                const bytes = blockstore_core_node_modules_multiformats_dist_src_cid_encodeCID(version, code, digest.bytes);
-                return new blockstore_core_node_modules_multiformats_dist_src_cid_CID(version, code, digest, bytes);
+        const labelPrefix = i.toString(16).toUpperCase().padStart(2, '0');
+        if (child instanceof Bucket) {
+            let shard;
+            for await (const subShard of dir_sharded_flush(child, blockstore, null, options)) {
+                shard = subShard;
             }
-            default: {
-                throw new Error('Invalid version');
+            if (shard == null) {
+                throw new Error('Could not flush sharded directory, no subshard found');
             }
+            links.push({
+                Name: labelPrefix,
+                Tsize: Number(shard.size),
+                Hash: shard.cid
+            });
+            childrenSize += shard.size;
         }
-    }
-    /**
-     * Simplified version of `create` for CIDv0.
-     */
-    static createV0(digest) {
-        return blockstore_core_node_modules_multiformats_dist_src_cid_CID.create(0, blockstore_core_node_modules_multiformats_dist_src_cid_DAG_PB_CODE, digest);
-    }
-    /**
-     * Simplified version of `create` for CIDv1.
-     *
-     * @param code - Content encoding format code.
-     * @param digest - Multihash of the content.
-     */
-    static createV1(code, digest) {
-        return blockstore_core_node_modules_multiformats_dist_src_cid_CID.create(1, code, digest);
-    }
-    /**
-     * Decoded a CID from its binary representation. The byte array must contain
-     * only the CID with no additional bytes.
-     *
-     * An error will be thrown if the bytes provided do not contain a valid
-     * binary representation of a CID.
-     */
-    static decode(bytes) {
-        const [cid, remainder] = blockstore_core_node_modules_multiformats_dist_src_cid_CID.decodeFirst(bytes);
-        if (remainder.length !== 0) {
-            throw new Error('Incorrect length');
-        }
-        return cid;
-    }
-    /**
-     * Decoded a CID from its binary representation at the beginning of a byte
-     * array.
-     *
-     * Returns an array with the first element containing the CID and the second
-     * element containing the remainder of the original byte array. The remainder
-     * will be a zero-length byte array if the provided bytes only contained a
-     * binary CID representation.
-     */
-    static decodeFirst(bytes) {
-        const specs = blockstore_core_node_modules_multiformats_dist_src_cid_CID.inspectBytes(bytes);
-        const prefixSize = specs.size - specs.multihashSize;
-        const multihashBytes = coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize));
-        if (multihashBytes.byteLength !== specs.multihashSize) {
-            throw new Error('Incorrect length');
-        }
-        const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize);
-        const digest = new Digest.Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes);
-        const cid = specs.version === 0
-            ? blockstore_core_node_modules_multiformats_dist_src_cid_CID.createV0(digest)
-            : blockstore_core_node_modules_multiformats_dist_src_cid_CID.createV1(specs.codec, digest);
-        return [cid, bytes.subarray(specs.size)];
-    }
-    /**
-     * Inspect the initial bytes of a CID to determine its properties.
-     *
-     * Involves decoding up to 4 varints. Typically this will require only 4 to 6
-     * bytes but for larger multicodec code values and larger multihash digest
-     * lengths these varints can be quite large. It is recommended that at least
-     * 10 bytes be made available in the `initialBytes` argument for a complete
-     * inspection.
-     */
-    static inspectBytes(initialBytes) {
-        let offset = 0;
-        const next = () => {
-            const [i, length] = varint.decode(initialBytes.subarray(offset));
-            offset += length;
-            return i;
-        };
-        let version = next();
-        let codec = blockstore_core_node_modules_multiformats_dist_src_cid_DAG_PB_CODE;
-        if (version === 18) {
-            // CIDv0
-            version = 0;
-            offset = 0;
+        else if (dir_sharded_isDir(child.value)) {
+            const dir = child.value;
+            let flushedDir;
+            for await (const entry of dir.flush(blockstore)) {
+                flushedDir = entry;
+                yield flushedDir;
+            }
+            if (flushedDir == null) {
+                throw new Error('Did not flush dir');
+            }
+            const label = labelPrefix + child.key;
+            links.push({
+                Name: label,
+                Tsize: Number(flushedDir.size),
+                Hash: flushedDir.cid
+            });
+            childrenSize += flushedDir.size;
         }
         else {
-            codec = next();
-        }
-        if (version !== 0 && version !== 1) {
-            throw new RangeError(`Invalid CID version ${version}`);
-        }
-        const prefixSize = offset;
-        const multihashCode = next(); // multihash code
-        const digestSize = next(); // multihash length
-        const size = offset + digestSize;
-        const multihashSize = size - prefixSize;
-        return { version, codec, multihashCode, digestSize, multihashSize, size };
-    }
-    /**
-     * Takes cid in a string representation and creates an instance. If `base`
-     * decoder is not provided will use a default from the configuration. It will
-     * throw an error if encoding of the CID is not compatible with supplied (or
-     * a default decoder).
-     */
-    static parse(source, base) {
-        const [prefix, bytes] = blockstore_core_node_modules_multiformats_dist_src_cid_parseCIDtoBytes(source, base);
-        const cid = blockstore_core_node_modules_multiformats_dist_src_cid_CID.decode(bytes);
-        if (cid.version === 0 && source[0] !== 'Q') {
-            throw Error('Version 0 CID string must not include multibase prefix');
+            const value = child.value;
+            if (value.cid == null) {
+                continue;
+            }
+            const label = labelPrefix + child.key;
+            const size = value.size;
+            links.push({
+                Name: label,
+                Tsize: Number(size),
+                Hash: value.cid
+            });
+            childrenSize += BigInt(size ?? 0);
         }
-        // Cache string representation to avoid computing it on `this.toString()`
-        blockstore_core_node_modules_multiformats_dist_src_cid_baseCache(cid).set(prefix, source);
-        return cid;
     }
-}
-function blockstore_core_node_modules_multiformats_dist_src_cid_parseCIDtoBytes(source, base) {
-    switch (source[0]) {
-        // CIDv0 is parsed differently
-        case 'Q': {
-            const decoder = base ?? base58btc;
-            return [
-                base58btc.prefix,
-                decoder.decode(`${base58btc.prefix}${source}`)
-            ];
+    // go-ipfs uses little endian, that's why we have to
+    // reverse the bit field before storing it
+    const data = Uint8Array.from(children.bitField().reverse());
+    const dir = new src_UnixFS({
+        type: 'hamt-sharded-directory',
+        data,
+        fanout: BigInt(bucket.tableSize()),
+        hashType: hamtHashCode,
+        mtime: shardRoot?.mtime,
+        mode: shardRoot?.mode
+    });
+    const node = {
+        Data: dir.marshal(),
+        Links: links
+    };
+    const buffer = src_encode(prepare(node));
+    const cid = await persist_persist(buffer, blockstore, options);
+    const size = BigInt(buffer.byteLength) + childrenSize;
+    yield {
+        cid,
+        unixfs: dir,
+        size
+    };
+}
+function dir_sharded_isDir(obj) {
+    return typeof obj.flush === 'function';
+}
+function dir_sharded_calculateSize(bucket, shardRoot, options) {
+    const children = bucket._children;
+    const links = [];
+    for (let i = 0; i < children.length; i++) {
+        const child = children.get(i);
+        if (child == null) {
+            continue;
         }
-        case base58btc.prefix: {
-            const decoder = base ?? base58btc;
-            return [base58btc.prefix, decoder.decode(source)];
+        const labelPrefix = i.toString(16).toUpperCase().padStart(2, '0');
+        if (child instanceof Bucket) {
+            const size = dir_sharded_calculateSize(child, null, options);
+            links.push({
+                Name: labelPrefix,
+                Tsize: Number(size),
+                Hash: options.cidVersion === 0 ? dir_sharded_CID_V0 : dir_sharded_CID_V1
+            });
         }
-        case base32.prefix: {
-            const decoder = base ?? base32;
-            return [base32.prefix, decoder.decode(source)];
+        else if (typeof child.value.flush === 'function') {
+            const dir = child.value;
+            const size = dir.nodeSize();
+            links.push({
+                Name: labelPrefix + child.key,
+                Tsize: Number(size),
+                Hash: options.cidVersion === 0 ? dir_sharded_CID_V0 : dir_sharded_CID_V1
+            });
         }
-        default: {
-            if (base == null) {
-                throw Error('To parse non base32 or base58btc encoded CID multibase decoder must be provided');
+        else {
+            const value = child.value;
+            if (value.cid == null) {
+                continue;
             }
-            return [source[0], base.decode(source)];
+            const label = labelPrefix + child.key;
+            const size = value.size;
+            links.push({
+                Name: label,
+                Tsize: Number(size),
+                Hash: value.cid
+            });
         }
     }
+    // go-ipfs uses little endian, that's why we have to
+    // reverse the bit field before storing it
+    const data = Uint8Array.from(children.bitField().reverse());
+    const dir = new src_UnixFS({
+        type: 'hamt-sharded-directory',
+        data,
+        fanout: BigInt(bucket.tableSize()),
+        hashType: hamtHashCode,
+        mtime: shardRoot?.mtime,
+        mode: shardRoot?.mode
+    });
+    const buffer = src_encode(prepare({
+        Data: dir.marshal(),
+        Links: links
+    }));
+    return buffer.length;
 }
-function blockstore_core_node_modules_multiformats_dist_src_cid_toStringV0(bytes, cache, base) {
-    const { prefix } = base;
-    if (prefix !== base58btc.prefix) {
-        throw Error(`Cannot string encode V0 in ${base.name} encoding`);
-    }
-    const cid = cache.get(prefix);
-    if (cid == null) {
-        const cid = base.encode(bytes).slice(1);
-        cache.set(prefix, cid);
-        return cid;
-    }
-    else {
-        return cid;
-    }
-}
-function blockstore_core_node_modules_multiformats_dist_src_cid_toStringV1(bytes, cache, base) {
-    const { prefix } = base;
-    const cid = cache.get(prefix);
-    if (cid == null) {
-        const cid = base.encode(bytes);
-        cache.set(prefix, cid);
-        return cid;
-    }
-    else {
-        return cid;
-    }
-}
-const blockstore_core_node_modules_multiformats_dist_src_cid_DAG_PB_CODE = 0x70;
-const blockstore_core_node_modules_multiformats_dist_src_cid_SHA_256_CODE = 0x12;
-function blockstore_core_node_modules_multiformats_dist_src_cid_encodeCID(version, code, multihash) {
-    const codeOffset = varint.encodingLength(version);
-    const hashOffset = codeOffset + varint.encodingLength(code);
-    const bytes = new Uint8Array(hashOffset + multihash.byteLength);
-    varint.encodeTo(version, bytes, 0);
-    varint.encodeTo(code, bytes, codeOffset);
-    bytes.set(multihash, hashOffset);
-    return bytes;
-}
-const blockstore_core_node_modules_multiformats_dist_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID');
-//# sourceMappingURL=cid.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/codecs/raw.js
+// we use these to calculate the node size to use as a check for whether a directory
+// should be sharded or not. Since CIDs have a constant length and We're only
+// interested in the data length and not the actual content identifier we can use
+// any old CID instead of having to hash the data which is expensive.
+const dir_sharded_CID_V0 = unixfs_node_modules_multiformats_src_cid_CID.parse('QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn');
+const dir_sharded_CID_V1 = unixfs_node_modules_multiformats_src_cid_CID.parse('zdj7WbTaiJT1fgatdet9Ei9iDB5hdCxkbVyhyh8YTUnXMiwYi');
+//# sourceMappingURL=dir-sharded.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/hamt-utils.js
 
-const node_modules_multiformats_dist_src_codecs_raw_name = 'raw';
-const node_modules_multiformats_dist_src_codecs_raw_code = 0x55;
-function node_modules_multiformats_dist_src_codecs_raw_encode(node) {
-    return coerce(node);
-}
-function node_modules_multiformats_dist_src_codecs_raw_decode(data) {
-    return coerce(data);
-}
-//# sourceMappingURL=raw.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/dist/src/memory.js
 
 
 
+// @ts-expect-error no types
 
 
 
-class MemoryBlockstore extends (/* unused pure expression or super */ null && (BaseBlockstore)) {
-    data;
-    constructor() {
-        super();
-        this.data = new Map();
+
+
+
+const hamt_utils_log = dist_src_logger('helia:unixfs:commands:utils:hamt-utils');
+const hamt_utils_toPrefix = (position) => {
+    return position
+        .toString(16)
+        .toUpperCase()
+        .padStart(2, '0')
+        .substring(0, 2);
+};
+const createShard = async (blockstore, contents, options) => {
+    const shard = new dir_sharded_DirSharded({
+        root: true,
+        dir: true,
+        parent: undefined,
+        parentKey: undefined,
+        path: '',
+        dirty: true,
+        flat: false,
+        mtime: options.mtime,
+        mode: options.mode
+    }, options);
+    for (let i = 0; i < contents.length; i++) {
+        await shard._bucket.put(contents[i].name, {
+            size: contents[i].size,
+            cid: contents[i].cid
+        });
     }
-    put(key, val) {
-        this.data.set(base32.encode(key.multihash.bytes), val);
-        return key;
+    const res = await dist_src(shard.flush(blockstore));
+    if (res == null) {
+        throw new Error('Flushing shard yielded no result');
     }
-    get(key) {
-        const buf = this.data.get(base32.encode(key.multihash.bytes));
-        if (buf == null) {
-            throw Errors.notFoundError();
+    return res;
+};
+const updateShardedDirectory = async (path, blockstore, options) => {
+    // persist any metadata on the shard root
+    const shardRoot = src_UnixFS.unmarshal(path[0].node.Data ?? new Uint8Array(0));
+    // this is always the same
+    const fanout = BigInt(Math.pow(2, hamtBucketBits));
+    // start from the leaf and ascend to the root
+    path.reverse();
+    let cid;
+    let node;
+    for (let i = 0; i < path.length; i++) {
+        const isRoot = i === path.length - 1;
+        const segment = path[i];
+        // go-ipfs uses little endian, that's why we have to
+        // reverse the bit field before storing it
+        const data = Uint8Array.from(segment.children.bitField().reverse());
+        const dir = new src_UnixFS({
+            type: 'hamt-sharded-directory',
+            data,
+            fanout,
+            hashType: hamtHashCode
+        });
+        if (isRoot) {
+            dir.mtime = shardRoot.mtime;
+            dir.mode = shardRoot.mode;
+        }
+        node = {
+            Data: dir.marshal(),
+            Links: segment.node.Links
+        };
+        const block = src_encode(prepare(node));
+        cid = await persist_persist(block, blockstore, options);
+        if (!isRoot) {
+            // update link in parent sub-shard
+            const nextSegment = path[i + 1];
+            if (nextSegment == null) {
+                throw new Error('Was not operating on shard root but also had no parent?');
+            }
+            hamt_utils_log('updating link in parent sub-shard with prefix %s', nextSegment.prefix);
+            nextSegment.node.Links = nextSegment.node.Links.filter(l => l.Name !== nextSegment.prefix);
+            nextSegment.node.Links.push({
+                Name: nextSegment.prefix,
+                Hash: cid,
+                Tsize: segment.node.Links.reduce((acc, curr) => acc + (curr.Tsize ?? 0), block.byteLength)
+            });
         }
-        return buf;
-    }
-    has(key) {
-        return this.data.has(base32.encode(key.multihash.bytes));
     }
-    async delete(key) {
-        this.data.delete(base32.encode(key.multihash.bytes));
+    if (cid == null || node == null) {
+        throw new Error('Noting persisted');
     }
-    async *getAll() {
-        for (const [key, value] of this.data.entries()) {
-            yield {
-                cid: CID.createV1(raw.code, Digest.decode(base32.decode(key))),
-                block: value
-            };
+    return { cid, node };
+};
+const recreateShardedDirectory = async (cid, fileName, blockstore, options) => {
+    const wrapped = consumable_hash_wrapHash(hamt_constants_hamtHashFn);
+    const hash = wrapped(unixfs_node_modules_uint8arrays_dist_src_from_string_fromString(fileName));
+    const path = [];
+    // descend the HAMT, loading each layer as we head towards the target child
+    while (true) {
+        const block = await blockstore.get(cid, options);
+        const node = src_decode(block);
+        const children = new sparse_array();
+        const index = await hash.take(hamtBucketBits);
+        const prefix = hamt_utils_toPrefix(index);
+        path.push({
+            prefix,
+            children,
+            node
+        });
+        let childLink;
+        // update sparsearray child layout - the bitfield is used as the data field for the
+        // intermediate DAG node so this is required to generate consistent hashes
+        for (const link of node.Links) {
+            const linkName = link.Name ?? '';
+            if (linkName.length < 2) {
+                throw new Error('Invalid HAMT - link name was too short');
+            }
+            const position = parseInt(linkName.substring(0, 2), 16);
+            children.set(position, true);
+            // we found the child we are looking for
+            if (linkName.startsWith(prefix)) {
+                childLink = link;
+            }
+        }
+        if (childLink == null) {
+            hamt_utils_log('no link found with prefix %s for %s', prefix, fileName);
+            // hash.untake(hamtBucketBits)
+            break;
+        }
+        const linkName = childLink.Name ?? '';
+        if (linkName.length < 2) {
+            throw new Error('Invalid HAMT - link name was too short');
+        }
+        if (linkName.length === 2) {
+            // found sub-shard
+            cid = childLink.Hash;
+            hamt_utils_log('descend into sub-shard with prefix %s', linkName);
+            continue;
         }
+        break;
     }
-}
-//# sourceMappingURL=memory.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/dist/src/black-hole.js
+    return { path, hash };
+};
+//# sourceMappingURL=hamt-utils.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/is-over-shard-threshold.js
 
 
-class BlackHoleBlockstore extends (/* unused pure expression or super */ null && (BaseBlockstore)) {
-    put(key) {
-        return key;
-    }
-    get() {
-        throw Errors.notFoundError();
+
+/**
+ * Estimate node size only based on DAGLink name and CID byte lengths
+ * https://github.com/ipfs/go-unixfsnode/blob/37b47f1f917f1b2f54c207682f38886e49896ef9/data/builder/directory.go#L81-L96
+ *
+ * If the node is a hamt sharded directory the calculation is based on if it was a regular directory.
+ */
+async function isOverShardThreshold(node, blockstore, threshold, options) {
+    if (node.Data == null) {
+        throw new Error('DagPB node had no data');
     }
-    has() {
-        return false;
+    const unixfs = src_UnixFS.unmarshal(node.Data);
+    let size;
+    if (unixfs.type === 'directory') {
+        size = estimateNodeSize(node);
     }
-    async delete() {
+    else if (unixfs.type === 'hamt-sharded-directory') {
+        size = await estimateShardSize(node, 0, threshold, blockstore, options);
     }
-    async *getAll() {
+    else {
+        throw new Error('Can only estimate the size of directories or shards');
     }
+    return size > threshold;
 }
-//# sourceMappingURL=black-hole.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/vendor/base-x.js
-// base-x encoding / decoding
-// Copyright (c) 2018 base-x contributors
-// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
-// Distributed under the MIT software license, see the accompanying
-// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
-function blockstore_fs_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) {
-  if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
-  var BASE_MAP = new Uint8Array(256);
-  for (var j = 0; j < BASE_MAP.length; j++) {
-    BASE_MAP[j] = 255;
-  }
-  for (var i = 0; i < ALPHABET.length; i++) {
-    var x = ALPHABET.charAt(i);
-    var xc = x.charCodeAt(0);
-    if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }
-    BASE_MAP[xc] = i;
-  }
-  var BASE = ALPHABET.length;
-  var LEADER = ALPHABET.charAt(0);
-  var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up
-  var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up
-  function encode (source) {
-    if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) {
-      source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
-    } else if (Array.isArray(source)) {
-      source = Uint8Array.from(source);
-    }
-    if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }
-    if (source.length === 0) { return '' }
-        // Skip & count leading zeroes.
-    var zeroes = 0;
-    var length = 0;
-    var pbegin = 0;
-    var pend = source.length;
-    while (pbegin !== pend && source[pbegin] === 0) {
-      pbegin++;
-      zeroes++;
-    }
-        // Allocate enough space in big-endian base58 representation.
-    var size = ((pend - pbegin) * iFACTOR + 1) >>> 0;
-    var b58 = new Uint8Array(size);
-        // Process the bytes.
-    while (pbegin !== pend) {
-      var carry = source[pbegin];
-            // Apply "b58 = b58 * 256 + ch".
-      var i = 0;
-      for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
-        carry += (256 * b58[it1]) >>> 0;
-        b58[it1] = (carry % BASE) >>> 0;
-        carry = (carry / BASE) >>> 0;
-      }
-      if (carry !== 0) { throw new Error('Non-zero carry') }
-      length = i;
-      pbegin++;
-    }
-        // Skip leading zeroes in base58 result.
-    var it2 = size - length;
-    while (it2 !== size && b58[it2] === 0) {
-      it2++;
+function estimateNodeSize(node) {
+    let size = 0;
+    // estimate size only based on DAGLink name and CID byte lengths
+    // https://github.com/ipfs/go-unixfsnode/blob/37b47f1f917f1b2f54c207682f38886e49896ef9/data/builder/directory.go#L81-L96
+    for (const link of node.Links) {
+        size += (link.Name ?? '').length;
+        size += link.Hash.version === 1 ? dir_sharded_CID_V1.bytes.byteLength : dir_sharded_CID_V0.bytes.byteLength;
     }
-        // Translate the result into a string.
-    var str = LEADER.repeat(zeroes);
-    for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }
-    return str
-  }
-  function decodeUnsafe (source) {
-    if (typeof source !== 'string') { throw new TypeError('Expected String') }
-    if (source.length === 0) { return new Uint8Array() }
-    var psz = 0;
-        // Skip leading spaces.
-    if (source[psz] === ' ') { return }
-        // Skip and count leading '1's.
-    var zeroes = 0;
-    var length = 0;
-    while (source[psz] === LEADER) {
-      zeroes++;
-      psz++;
+    return size;
+}
+async function estimateShardSize(node, current, max, blockstore, options) {
+    if (current > max) {
+        return max;
     }
-        // Allocate enough space in big-endian base256 representation.
-    var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.
-    var b256 = new Uint8Array(size);
-        // Process the characters.
-    while (source[psz]) {
-            // Decode character
-      var carry = BASE_MAP[source.charCodeAt(psz)];
-            // Invalid character
-      if (carry === 255) { return }
-      var i = 0;
-      for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
-        carry += (BASE * b256[it3]) >>> 0;
-        b256[it3] = (carry % 256) >>> 0;
-        carry = (carry / 256) >>> 0;
-      }
-      if (carry !== 0) { throw new Error('Non-zero carry') }
-      length = i;
-      psz++;
+    if (node.Data == null) {
+        return current;
     }
-        // Skip trailing spaces.
-    if (source[psz] === ' ') { return }
-        // Skip leading zeroes in b256.
-    var it4 = size - length;
-    while (it4 !== size && b256[it4] === 0) {
-      it4++;
+    const unixfs = src_UnixFS.unmarshal(node.Data);
+    if (!unixfs.isDirectory()) {
+        return current;
     }
-    var vch = new Uint8Array(zeroes + (size - it4));
-    var j = zeroes;
-    while (it4 !== size) {
-      vch[j++] = b256[it4++];
+    for (const link of node.Links) {
+        let name = link.Name ?? '';
+        // remove hamt hash prefix from name
+        name = name.substring(2);
+        current += name.length;
+        current += link.Hash.bytes.byteLength;
+        if (link.Hash.code === code) {
+            const block = await blockstore.get(link.Hash, options);
+            const node = src_decode(block);
+            current += await estimateShardSize(node, current, max, blockstore, options);
+        }
     }
-    return vch
-  }
-  function decode (string) {
-    var buffer = decodeUnsafe(string);
-    if (buffer) { return buffer }
-    throw new Error(`Non-${name} character`)
-  }
-  return {
-    encode: encode,
-    decodeUnsafe: decodeUnsafe,
-    decode: decode
-  }
+    return current;
 }
-var blockstore_fs_node_modules_multiformats_vendor_base_x_src = blockstore_fs_node_modules_multiformats_vendor_base_x_base;
-
-var blockstore_fs_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = blockstore_fs_node_modules_multiformats_vendor_base_x_src;
-
-/* harmony default export */ const blockstore_fs_node_modules_multiformats_vendor_base_x = (blockstore_fs_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX);
-
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/src/bytes.js
-const blockstore_fs_node_modules_multiformats_src_bytes_empty = new Uint8Array(0)
+//# sourceMappingURL=is-over-shard-threshold.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/add-link.js
 
-/**
- * @param {Uint8Array} d
- */
-const blockstore_fs_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '')
 
-/**
- * @param {string} hex
- */
-const blockstore_fs_node_modules_multiformats_src_bytes_fromHex = hex => {
-  const hexes = hex.match(/../g)
-  return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : blockstore_fs_node_modules_multiformats_src_bytes_empty
-}
 
-/**
- * @param {Uint8Array} aa
- * @param {Uint8Array} bb
- */
-const blockstore_fs_node_modules_multiformats_src_bytes_equals = (aa, bb) => {
-  if (aa === bb) return true
-  if (aa.byteLength !== bb.byteLength) {
-    return false
-  }
 
-  for (let ii = 0; ii < aa.byteLength; ii++) {
-    if (aa[ii] !== bb[ii]) {
-      return false
-    }
-  }
 
-  return true
-}
+// @ts-expect-error no types
 
-/**
- * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o
- * @returns {Uint8Array}
- */
-const blockstore_fs_node_modules_multiformats_src_bytes_coerce = o => {
-  if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o
-  if (o instanceof ArrayBuffer) return new Uint8Array(o)
-  if (ArrayBuffer.isView(o)) {
-    return new Uint8Array(o.buffer, o.byteOffset, o.byteLength)
-  }
-  throw new Error('Unknown type, must be binary type')
-}
 
-/**
- * @param {any} o
- * @returns {o is ArrayBuffer|ArrayBufferView}
- */
-const blockstore_fs_node_modules_multiformats_src_bytes_isBinary = o =>
-  o instanceof ArrayBuffer || ArrayBuffer.isView(o)
 
-/**
- * @param {string} str
- * @returns {Uint8Array}
- */
-const blockstore_fs_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str)
 
-/**
- * @param {Uint8Array} b
- * @returns {string}
- */
-const blockstore_fs_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b)
 
 
 
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/src/bases/base.js
+const add_link_log = dist_src_logger('helia:unixfs:components:utils:add-link');
+async function addLink(parent, child, blockstore, options) {
+    if (parent.node.Data == null) {
+        throw new errors_InvalidParametersError('Invalid parent passed to addLink');
+    }
+    const meta = src_UnixFS.unmarshal(parent.node.Data);
+    if (meta.type === 'hamt-sharded-directory') {
+        add_link_log('adding link to sharded directory');
+        return addToShardedDirectory(parent, child, blockstore, options);
+    }
+    add_link_log(`adding ${child.Name} (${child.Hash}) to regular directory`);
+    const result = await addToDirectory(parent, child, blockstore, options);
+    if (await isOverShardThreshold(result.node, blockstore, options.shardSplitThresholdBytes, options)) {
+        add_link_log('converting directory to sharded directory');
+        const converted = await convertToShardedDirectory(result, blockstore);
+        result.cid = converted.cid;
+        result.node = src_decode(await blockstore.get(converted.cid, options));
+    }
+    return result;
+}
+const convertToShardedDirectory = async (parent, blockstore) => {
+    if (parent.node.Data == null) {
+        throw new errors_InvalidParametersError('Invalid parent passed to convertToShardedDirectory');
+    }
+    const unixfs = src_UnixFS.unmarshal(parent.node.Data);
+    const result = await createShard(blockstore, parent.node.Links.map(link => ({
+        name: (link.Name ?? ''),
+        size: BigInt(link.Tsize ?? 0),
+        cid: link.Hash
+    })), {
+        mode: unixfs.mode,
+        mtime: unixfs.mtime,
+        cidVersion: parent.cid.version
+    });
+    add_link_log(`converted directory to sharded directory ${result.cid}`);
+    return result;
+};
+const addToDirectory = async (parent, child, blockstore, options) => {
+    // Remove existing link if it exists
+    const parentLinks = parent.node.Links.filter((link) => {
+        const matches = link.Name === child.Name;
+        if (matches && !options.allowOverwriting) {
+            throw new AlreadyExistsError();
+        }
+        return !matches;
+    });
+    parentLinks.push(child);
+    if (parent.node.Data == null) {
+        throw new InvalidPBNodeError('Parent node with no data passed to addToDirectory');
+    }
+    const node = src_UnixFS.unmarshal(parent.node.Data);
+    let data;
+    if (node.mtime != null) {
+        // Update mtime if previously set
+        const ms = Date.now();
+        const secs = Math.floor(ms / 1000);
+        node.mtime = {
+            secs: BigInt(secs),
+            nsecs: (ms - (secs * 1000)) * 1000
+        };
+        data = node.marshal();
+    }
+    else {
+        data = parent.node.Data;
+    }
+    parent.node = prepare({
+        Data: data,
+        Links: parentLinks
+    });
+    // Persist the new parent PbNode
+    const buf = src_encode(parent.node);
+    const hash = await unixfs_node_modules_multiformats_src_hashes_sha2_sha256.digest(buf);
+    const cid = unixfs_node_modules_multiformats_src_cid_CID.create(parent.cid.version, code, hash);
+    await blockstore.put(cid, buf);
+    return {
+        node: parent.node,
+        cid
+    };
+};
+const addToShardedDirectory = async (parent, child, blockstore, options) => {
+    const { path, hash } = await recreateShardedDirectory(parent.cid, child.Name, blockstore, options);
+    const finalSegment = path[path.length - 1];
+    if (finalSegment == null) {
+        throw new Error('Invalid HAMT, could not generate path');
+    }
+    // find the next prefix
+    // const index = await hash.take(hamtBucketBits)
+    const prefix = finalSegment.prefix;
+    const index = parseInt(prefix, 16);
+    add_link_log('next prefix for %s is %s', child.Name, prefix);
+    const linkName = `${prefix}${child.Name}`;
+    const existingLink = finalSegment.node.Links.find(l => (l.Name ?? '').startsWith(prefix));
+    if (existingLink != null) {
+        add_link_log('link %s was present in shard', linkName);
+        // link is already present in shard
+        if (existingLink.Name === linkName) {
+            // file with same name is already present in shard
+            if (!options.allowOverwriting) {
+                throw new AlreadyExistsError();
+            }
+            add_link_log('overwriting %s in subshard', child.Name);
+            finalSegment.node.Links = finalSegment.node.Links.filter(l => l.Name !== linkName);
+            finalSegment.node.Links.push({
+                Name: linkName,
+                Hash: child.Hash,
+                Tsize: child.Tsize
+            });
+        }
+        else if (existingLink.Name?.length === 2) {
+            throw new Error('Existing link was subshard?!');
+        }
+        else {
+            // conflict, add a new HAMT segment
+            add_link_log('prefix %s already exists, creating new subshard', prefix);
+            // find the sibling we are going to replace
+            const index = finalSegment.node.Links.findIndex(l => l.Name?.startsWith(prefix));
+            const sibling = finalSegment.node.Links.splice(index, 1)[0];
+            // give the sibling a new HAMT prefix
+            const siblingName = (sibling.Name ?? '').substring(2);
+            const wrapped = consumable_hash_wrapHash(hamt_constants_hamtHashFn);
+            const siblingHash = wrapped(unixfs_node_modules_uint8arrays_dist_src_from_string_fromString(siblingName));
+            // discard hash bits until we reach the subshard depth
+            for (let i = 0; i < path.length; i++) {
+                await siblingHash.take(hamtBucketBits);
+            }
+            while (true) {
+                const siblingIndex = await siblingHash.take(hamtBucketBits);
+                const siblingPrefix = hamt_utils_toPrefix(siblingIndex);
+                sibling.Name = `${siblingPrefix}${siblingName}`;
+                // calculate the target file's HAMT prefix in the new sub-shard
+                const newIndex = await hash.take(hamtBucketBits);
+                const newPrefix = hamt_utils_toPrefix(newIndex);
+                if (siblingPrefix === newPrefix) {
+                    // the two sibling names have caused another conflict - add an intermediate node to
+                    // the HAMT and try again
+                    // create the child locations
+                    const children = new sparse_array();
+                    children.set(newIndex, true);
+                    path.push({
+                        prefix: newPrefix,
+                        children,
+                        node: {
+                            Links: []
+                        }
+                    });
+                    continue;
+                }
+                // create the child locations
+                const children = new sparse_array();
+                children.set(newIndex, true);
+                children.set(siblingIndex, true);
+                // add our new segment
+                path.push({
+                    prefix,
+                    children,
+                    node: {
+                        Links: [
+                            sibling, {
+                                Name: `${newPrefix}${child.Name}`,
+                                Hash: child.Hash,
+                                Tsize: child.Tsize
+                            }
+                        ]
+                    }
+                });
+                break;
+            }
+        }
+    }
+    else {
+        add_link_log('link %s was not present in sub-shard', linkName);
+        // add new link to shard
+        child.Name = linkName;
+        finalSegment.node.Links.push(child);
+        finalSegment.children.set(index, true);
+        add_link_log('adding %s to existing sub-shard', linkName);
+    }
+    return updateShardedDirectory(path, blockstore, options);
+};
+//# sourceMappingURL=add-link.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/cid-to-directory.js
 
 
-// Linter can't see that API is used in types.
-// eslint-disable-next-line
+async function cidToDirectory(cid, blockstore, options = {}) {
+    const entry = await exporter(cid, blockstore, options);
+    if (entry.type !== 'directory') {
+        throw new NotADirectoryError(`${cid.toString()} was not a UnixFS directory`);
+    }
+    return {
+        cid,
+        node: entry.node
+    };
+}
+//# sourceMappingURL=cid-to-directory.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/cid-to-pblink.js
 
 
-/**
- * Class represents both BaseEncoder and MultibaseEncoder meaning it
- * can be used to encode to multibase or base encode without multibase
- * prefix.
- *
- * @class
- * @template {string} Base
- * @template {string} Prefix
- * @implements {API.MultibaseEncoder}
- * @implements {API.BaseEncoder}
- */
-class blockstore_fs_node_modules_multiformats_src_bases_base_Encoder {
-  /**
-   * @param {Base} name
-   * @param {Prefix} prefix
-   * @param {(bytes:Uint8Array) => string} baseEncode
-   */
-  constructor (name, prefix, baseEncode) {
-    this.name = name
-    this.prefix = prefix
-    this.baseEncode = baseEncode
-  }
 
-  /**
-   * @param {Uint8Array} bytes
-   * @returns {API.Multibase}
-   */
-  encode (bytes) {
-    if (bytes instanceof Uint8Array) {
-      return `${this.prefix}${this.baseEncode(bytes)}`
-    } else {
-      throw Error('Unknown type, must be binary type')
+async function cidToPBLink(cid, name, blockstore, options) {
+    const sourceEntry = await exporter(cid, blockstore, options);
+    if (sourceEntry.type !== 'directory' && sourceEntry.type !== 'file' && sourceEntry.type !== 'raw') {
+        throw new NotUnixFSError(`${cid.toString()} was not a UnixFS node`);
     }
-  }
+    return {
+        Name: name,
+        Tsize: sourceEntry.node instanceof Uint8Array ? sourceEntry.node.byteLength : dagNodeTsize(sourceEntry.node),
+        Hash: cid
+    };
 }
+function dagNodeTsize(node) {
+    const linkSizes = node.Links.reduce((acc, curr) => acc + (curr.Tsize ?? 0), 0);
+    return src_encode(node).byteLength + linkSizes;
+}
+//# sourceMappingURL=cid-to-pblink.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/resolve.js
 
-/**
- * @template {string} Prefix
- */
-/**
- * Class represents both BaseDecoder and MultibaseDecoder so it could be used
- * to decode multibases (with matching prefix) or just base decode strings
- * with corresponding base encoding.
- *
- * @class
- * @template {string} Base
- * @template {string} Prefix
- * @implements {API.MultibaseDecoder}
- * @implements {API.UnibaseDecoder}
- * @implements {API.BaseDecoder}
- */
-class blockstore_fs_node_modules_multiformats_src_bases_base_Decoder {
-  /**
-   * @param {Base} name
-   * @param {Prefix} prefix
-   * @param {(text:string) => Uint8Array} baseDecode
-   */
-  constructor (name, prefix, baseDecode) {
-    this.name = name
-    this.prefix = prefix
-    /* c8 ignore next 3 */
-    if (prefix.codePointAt(0) === undefined) {
-      throw new Error('Invalid prefix character')
-    }
-    /** @private */
-    this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0))
-    this.baseDecode = baseDecode
-  }
-
-  /**
-   * @param {string} text
-   */
-  decode (text) {
-    if (typeof text === 'string') {
-      if (text.codePointAt(0) !== this.prefixCodePoint) {
-        throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`)
-      }
-      return this.baseDecode(text.slice(this.prefix.length))
-    } else {
-      throw Error('Can only multibase decode strings')
-    }
-  }
 
-  /**
-   * @template {string} OtherPrefix
-   * @param {API.UnibaseDecoder|ComposedDecoder} decoder
-   * @returns {ComposedDecoder}
-   */
-  or (decoder) {
-    return blockstore_fs_node_modules_multiformats_src_bases_base_or(this, decoder)
-  }
-}
 
-/**
- * @template {string} Prefix
- * @typedef {Record>} Decoders
- */
 
-/**
- * @template {string} Prefix
- * @implements {API.MultibaseDecoder}
- * @implements {API.CombobaseDecoder}
- */
-class blockstore_fs_node_modules_multiformats_src_bases_base_ComposedDecoder {
-  /**
-   * @param {Decoders} decoders
-   */
-  constructor (decoders) {
-    this.decoders = decoders
-  }
 
-  /**
-   * @template {string} OtherPrefix
-   * @param {API.UnibaseDecoder|ComposedDecoder} decoder
-   * @returns {ComposedDecoder}
-   */
-  or (decoder) {
-    return blockstore_fs_node_modules_multiformats_src_bases_base_or(this, decoder)
-  }
 
-  /**
-   * @param {string} input
-   * @returns {Uint8Array}
-   */
-  decode (input) {
-    const prefix = /** @type {Prefix} */ (input[0])
-    const decoder = this.decoders[prefix]
-    if (decoder) {
-      return decoder.decode(input)
-    } else {
-      throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)
+const resolve_log = dist_src_logger('helia:unixfs:components:utils:resolve');
+async function resolve_resolve(cid, path, blockstore, options) {
+    if (path == null || path === '') {
+        return { cid };
     }
-  }
+    resolve_log('resolve "%s" under %c', path, cid);
+    const parts = path.split('/').filter(Boolean);
+    const segments = [{
+            name: '',
+            cid,
+            size: 0n
+        }];
+    for (let i = 0; i < parts.length; i++) {
+        const part = parts[i];
+        const result = await exporter(cid, blockstore, options);
+        resolve_log('resolving "%s"', part, result);
+        if (result.type === 'file') {
+            if (i < parts.length - 1) {
+                throw new errors_InvalidParametersError('Path was invalid');
+            }
+            cid = result.cid;
+        }
+        else if (result.type === 'directory') {
+            let dirCid;
+            for await (const entry of result.content()) {
+                if (entry.name === part) {
+                    dirCid = entry.cid;
+                    break;
+                }
+            }
+            if (dirCid == null) {
+                throw new DoesNotExistError('Could not find path in directory');
+            }
+            cid = dirCid;
+            segments.push({
+                name: part,
+                cid,
+                size: result.size
+            });
+        }
+        else {
+            throw new errors_InvalidParametersError('Could not resolve path');
+        }
+    }
+    resolve_log('resolved %s to %c', path, cid);
+    return {
+        cid,
+        path,
+        segments
+    };
 }
-
-/**
- * @template {string} L
- * @template {string} R
- * @param {API.UnibaseDecoder|API.CombobaseDecoder} left
- * @param {API.UnibaseDecoder|API.CombobaseDecoder} right
- * @returns {ComposedDecoder}
- */
-const blockstore_fs_node_modules_multiformats_src_bases_base_or = (left, right) => new blockstore_fs_node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({
-  ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }),
-  ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right })
-}))
-
 /**
- * @class
- * @template {string} Base
- * @template {string} Prefix
- * @implements {API.MultibaseCodec}
- * @implements {API.MultibaseEncoder}
- * @implements {API.MultibaseDecoder}
- * @implements {API.BaseCodec}
- * @implements {API.BaseEncoder}
- * @implements {API.BaseDecoder}
+ * Where we have descended into a DAG to update a child node, ascend up the DAG creating
+ * new hashes and blocks for the changed content
  */
-class blockstore_fs_node_modules_multiformats_src_bases_base_Codec {
-  /**
-   * @param {Base} name
-   * @param {Prefix} prefix
-   * @param {(bytes:Uint8Array) => string} baseEncode
-   * @param {(text:string) => Uint8Array} baseDecode
-   */
-  constructor (name, prefix, baseEncode, baseDecode) {
-    this.name = name
-    this.prefix = prefix
-    this.baseEncode = baseEncode
-    this.baseDecode = baseDecode
-    this.encoder = new blockstore_fs_node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode)
-    this.decoder = new blockstore_fs_node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode)
-  }
+async function updatePathCids(cid, result, blockstore, options) {
+    if (result.segments == null || result.segments.length === 0) {
+        return cid;
+    }
+    let child = result.segments.pop();
+    if (child == null) {
+        throw new Error('Insufficient segments');
+    }
+    child.cid = cid;
+    result.segments.reverse();
+    for (const parent of result.segments) {
+        const [directory, pblink] = await Promise.all([
+            cidToDirectory(parent.cid, blockstore, options),
+            cidToPBLink(child.cid, child.name, blockstore, options)
+        ]);
+        const result = await addLink(directory, pblink, blockstore, {
+            ...options,
+            allowOverwriting: true,
+            cidVersion: cid.version
+        });
+        cid = result.cid;
+        parent.cid = cid;
+        child = parent;
+    }
+    return cid;
+}
+//# sourceMappingURL=resolve.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/cat.js
 
-  /**
-   * @param {Uint8Array} input
-   */
-  encode (input) {
-    return this.encoder.encode(input)
-  }
 
-  /**
-   * @param {string} input
-   */
-  decode (input) {
-    return this.decoder.decode(input)
-  }
-}
 
-/**
- * @template {string} Base
- * @template {string} Prefix
- * @param {object} options
- * @param {Base} options.name
- * @param {Prefix} options.prefix
- * @param {(bytes:Uint8Array) => string} options.encode
- * @param {(input:string) => Uint8Array} options.decode
- * @returns {Codec}
- */
-const blockstore_fs_node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) =>
-  new blockstore_fs_node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode)
 
-/**
- * @template {string} Base
- * @template {string} Prefix
- * @param {object} options
- * @param {Base} options.name
- * @param {Prefix} options.prefix
- * @param {string} options.alphabet
- * @returns {Codec}
- */
-const blockstore_fs_node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => {
-  const { encode, decode } = blockstore_fs_node_modules_multiformats_vendor_base_x(alphabet, name)
-  return blockstore_fs_node_modules_multiformats_src_bases_base_from({
-    prefix,
-    name,
-    encode,
-    /**
-     * @param {string} text
-     */
-    decode: text => blockstore_fs_node_modules_multiformats_src_bytes_coerce(decode(text))
-  })
+const mergeOptions = node_modules_merge_options.bind({ ignoreUndefined: true });
+const cat_defaultOptions = {};
+async function* cat(cid, blockstore, options = {}) {
+    const opts = mergeOptions(cat_defaultOptions, options);
+    const resolved = await resolve_resolve(cid, opts.path, blockstore, opts);
+    const result = await exporter(resolved.cid, blockstore, opts);
+    if (result.type !== 'file' && result.type !== 'raw') {
+        throw new NotAFileError();
+    }
+    if (result.content == null) {
+        throw new NoContentError();
+    }
+    yield* result.content(opts);
 }
+//# sourceMappingURL=cat.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/constants.js
+const SHARD_SPLIT_THRESHOLD_BYTES = 262144;
+//# sourceMappingURL=constants.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/chmod.js
 
-/**
- * @param {string} string
- * @param {string} alphabet
- * @param {number} bitsPerChar
- * @param {string} name
- * @returns {Uint8Array}
- */
-const blockstore_fs_node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => {
-  // Build the character lookup table:
-  /** @type {Record} */
-  const codes = {}
-  for (let i = 0; i < alphabet.length; ++i) {
-    codes[alphabet[i]] = i
-  }
 
-  // Count the padding bytes:
-  let end = string.length
-  while (string[end - 1] === '=') {
-    --end
-  }
 
-  // Allocate the output:
-  const out = new Uint8Array((end * bitsPerChar / 8) | 0)
 
-  // Parse the data:
-  let bits = 0 // Number of bits currently in the buffer
-  let buffer = 0 // Bits waiting to be written out, MSB first
-  let written = 0 // Next byte to write
-  for (let i = 0; i < end; ++i) {
-    // Read one character from the string:
-    const value = codes[string[i]]
-    if (value === undefined) {
-      throw new SyntaxError(`Non-${name} character`)
-    }
 
-    // Append the bits to the buffer:
-    buffer = (buffer << bitsPerChar) | value
-    bits += bitsPerChar
 
-    // Write out some bits if the buffer has a byte's worth:
-    if (bits >= 8) {
-      bits -= 8
-      out[written++] = 0xff & (buffer >> bits)
-    }
-  }
 
-  // Verify that we have received just enough bits:
-  if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) {
-    throw new SyntaxError('Unexpected end of data')
-  }
 
-  return out
-}
 
-/**
- * @param {Uint8Array} data
- * @param {string} alphabet
- * @param {number} bitsPerChar
- * @returns {string}
- */
-const blockstore_fs_node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => {
-  const pad = alphabet[alphabet.length - 1] === '='
-  const mask = (1 << bitsPerChar) - 1
-  let out = ''
 
-  let bits = 0 // Number of bits currently in the buffer
-  let buffer = 0 // Bits waiting to be written out, MSB first
-  for (let i = 0; i < data.length; ++i) {
-    // Slurp data into the buffer:
-    buffer = (buffer << 8) | data[i]
-    bits += 8
 
-    // Write out as much as we can:
-    while (bits > bitsPerChar) {
-      bits -= bitsPerChar
-      out += alphabet[mask & (buffer >> bits)]
-    }
-  }
 
-  // Partial character:
-  if (bits) {
-    out += alphabet[mask & (buffer << (bitsPerChar - bits))]
-  }
 
-  // Add padding characters until we hit a byte boundary:
-  if (pad) {
-    while ((out.length * bitsPerChar) & 7) {
-      out += '='
-    }
-  }
 
-  return out
-}
 
-/**
- * RFC4648 Factory
- *
- * @template {string} Base
- * @template {string} Prefix
- * @param {object} options
- * @param {Base} options.name
- * @param {Prefix} options.prefix
- * @param {string} options.alphabet
- * @param {number} options.bitsPerChar
- */
-const blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => {
-  return blockstore_fs_node_modules_multiformats_src_bases_base_from({
-    prefix,
-    name,
-    encode (input) {
-      return blockstore_fs_node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar)
-    },
-    decode (input) {
-      return blockstore_fs_node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name)
+const chmod_mergeOptions = node_modules_merge_options.bind({ ignoreUndefined: true });
+const chmod_log = dist_src_logger('helia:unixfs:chmod');
+const chmod_defaultOptions = {
+    recursive: false,
+    shardSplitThresholdBytes: SHARD_SPLIT_THRESHOLD_BYTES
+};
+async function chmod(cid, mode, blockstore, options = {}) {
+    const opts = chmod_mergeOptions(chmod_defaultOptions, options);
+    const resolved = await resolve_resolve(cid, opts.path, blockstore, options);
+    chmod_log('chmod %c %d', resolved.cid, mode);
+    if (opts.recursive) {
+        // recursively export from root CID, change perms of each entry then reimport
+        // but do not reimport files, only manipulate dag-pb nodes
+        const root = await pipe(async function* () {
+            for await (const entry of recursive(resolved.cid, blockstore, options)) {
+                let metadata;
+                let links = [];
+                if (entry.type === 'raw') {
+                    // convert to UnixFS
+                    metadata = new src_UnixFS({ type: 'file', data: entry.node });
+                }
+                else if (entry.type === 'file' || entry.type === 'directory') {
+                    metadata = entry.unixfs;
+                    links = entry.node.Links;
+                }
+                else {
+                    throw new NotUnixFSError();
+                }
+                metadata.mode = mode;
+                const node = {
+                    Data: metadata.marshal(),
+                    Links: links
+                };
+                yield {
+                    path: entry.path,
+                    content: node
+                };
+            }
+        }, 
+        // @ts-expect-error cannot combine progress types
+        (source) => importer(source, blockstore, {
+            ...opts,
+            dagBuilder: async function* (source, block) {
+                for await (const entry of source) {
+                    yield async function () {
+                        // @ts-expect-error cannot derive type
+                        const node = entry.content;
+                        const buf = src_encode(node);
+                        const updatedCid = await persist_persist(buf, block, {
+                            ...opts,
+                            cidVersion: cid.version
+                        });
+                        if (node.Data == null) {
+                            throw new InvalidPBNodeError(`${updatedCid} had no data`);
+                        }
+                        const unixfs = src_UnixFS.unmarshal(node.Data);
+                        return {
+                            cid: updatedCid,
+                            size: BigInt(buf.length),
+                            path: entry.path,
+                            unixfs
+                        };
+                    };
+                }
+            }
+        }), async (nodes) => dist_src(nodes));
+        if (root == null) {
+            throw new errors_UnknownError(`Could not chmod ${resolved.cid.toString()}`);
+        }
+        return updatePathCids(root.cid, resolved, blockstore, opts);
     }
-  })
+    const block = await blockstore.get(resolved.cid, options);
+    let metadata;
+    let links = [];
+    if (resolved.cid.code === unixfs_node_modules_multiformats_src_codecs_raw_code) {
+        // convert to UnixFS
+        metadata = new src_UnixFS({ type: 'file', data: block });
+    }
+    else {
+        const node = src_decode(block);
+        if (node.Data == null) {
+            throw new InvalidPBNodeError(`${resolved.cid.toString()} had no data`);
+        }
+        links = node.Links;
+        metadata = src_UnixFS.unmarshal(node.Data);
+    }
+    metadata.mode = mode;
+    const updatedBlock = src_encode({
+        Data: metadata.marshal(),
+        Links: links
+    });
+    const hash = await unixfs_node_modules_multiformats_src_hashes_sha2_sha256.digest(updatedBlock);
+    const updatedCid = unixfs_node_modules_multiformats_src_cid_CID.create(resolved.cid.version, code, hash);
+    await blockstore.put(updatedCid, updatedBlock);
+    return updatePathCids(updatedCid, resolved, blockstore, opts);
 }
+//# sourceMappingURL=chmod.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/cp.js
 
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/src/bases/base32.js
 
 
-const blockstore_fs_node_modules_multiformats_src_bases_base32_base32 = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
-  prefix: 'b',
-  name: 'base32',
-  alphabet: 'abcdefghijklmnopqrstuvwxyz234567',
-  bitsPerChar: 5
-})
 
-const blockstore_fs_node_modules_multiformats_src_bases_base32_base32upper = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
-  prefix: 'B',
-  name: 'base32upper',
-  alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567',
-  bitsPerChar: 5
-})
 
-const blockstore_fs_node_modules_multiformats_src_bases_base32_base32pad = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
-  prefix: 'c',
-  name: 'base32pad',
-  alphabet: 'abcdefghijklmnopqrstuvwxyz234567=',
-  bitsPerChar: 5
-})
 
-const blockstore_fs_node_modules_multiformats_src_bases_base32_base32padupper = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
-  prefix: 'C',
-  name: 'base32padupper',
-  alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=',
-  bitsPerChar: 5
-})
 
-const blockstore_fs_node_modules_multiformats_src_bases_base32_base32hex = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
-  prefix: 'v',
-  name: 'base32hex',
-  alphabet: '0123456789abcdefghijklmnopqrstuv',
-  bitsPerChar: 5
-})
+const cp_mergeOptions = node_modules_merge_options.bind({ ignoreUndefined: true });
+const cp_log = dist_src_logger('helia:unixfs:cp');
+const cp_defaultOptions = {
+    force: false,
+    shardSplitThresholdBytes: SHARD_SPLIT_THRESHOLD_BYTES
+};
+async function cp(source, target, name, blockstore, options = {}) {
+    const opts = cp_mergeOptions(cp_defaultOptions, options);
+    if (name.includes('/')) {
+        throw new errors_InvalidParametersError('Name must not have slashes');
+    }
+    const [directory, pblink] = await Promise.all([
+        cidToDirectory(target, blockstore, opts),
+        cidToPBLink(source, name, blockstore, opts)
+    ]);
+    cp_log('Adding %c as "%s" to %c', source, name, target);
+    const result = await addLink(directory, pblink, blockstore, {
+        allowOverwriting: opts.force,
+        cidVersion: target.version,
+        ...opts
+    });
+    return result.cid;
+}
+//# sourceMappingURL=cp.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/ls.js
 
-const blockstore_fs_node_modules_multiformats_src_bases_base32_base32hexupper = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
-  prefix: 'V',
-  name: 'base32hexupper',
-  alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV',
-  bitsPerChar: 5
-})
 
-const blockstore_fs_node_modules_multiformats_src_bases_base32_base32hexpad = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
-  prefix: 't',
-  name: 'base32hexpad',
-  alphabet: '0123456789abcdefghijklmnopqrstuv=',
-  bitsPerChar: 5
-})
 
-const blockstore_fs_node_modules_multiformats_src_bases_base32_base32hexpadupper = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
-  prefix: 'T',
-  name: 'base32hexpadupper',
-  alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=',
-  bitsPerChar: 5
-})
 
-const blockstore_fs_node_modules_multiformats_src_bases_base32_base32z = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
-  prefix: 'h',
-  name: 'base32z',
-  alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769',
-  bitsPerChar: 5
-})
+const ls_mergeOptions = node_modules_merge_options.bind({ ignoreUndefined: true });
+const ls_defaultOptions = {};
+async function* ls(cid, blockstore, options = {}) {
+    const opts = ls_mergeOptions(ls_defaultOptions, options);
+    const resolved = await resolve_resolve(cid, opts.path, blockstore, opts);
+    const result = await exporter(resolved.cid, blockstore);
+    if (result.type === 'file' || result.type === 'raw') {
+        yield result;
+        return;
+    }
+    if (result.content == null) {
+        throw new NoContentError();
+    }
+    if (result.type !== 'directory') {
+        throw new NotADirectoryError();
+    }
+    yield* result.content({
+        offset: options.offset,
+        length: options.length
+    });
+}
+//# sourceMappingURL=ls.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/mkdir.js
 
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/src/bases/base58.js
 
 
-const blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc = blockstore_fs_node_modules_multiformats_src_bases_base_baseX({
-  name: 'base58btc',
-  prefix: 'z',
-  alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
-})
 
-const blockstore_fs_node_modules_multiformats_src_bases_base58_base58flickr = blockstore_fs_node_modules_multiformats_src_bases_base_baseX({
-  name: 'base58flickr',
-  prefix: 'Z',
-  alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'
-})
 
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/src/bases/base64.js
-// @ts-check
 
 
 
-const blockstore_fs_node_modules_multiformats_src_bases_base64_base64 = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
-  prefix: 'm',
-  name: 'base64',
-  alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
-  bitsPerChar: 6
-})
 
-const blockstore_fs_node_modules_multiformats_src_bases_base64_base64pad = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
-  prefix: 'M',
-  name: 'base64pad',
-  alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
-  bitsPerChar: 6
-})
 
-const blockstore_fs_node_modules_multiformats_src_bases_base64_base64url = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
-  prefix: 'u',
-  name: 'base64url',
-  alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',
-  bitsPerChar: 6
-})
 
-const blockstore_fs_node_modules_multiformats_src_bases_base64_base64urlpad = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
-  prefix: 'U',
-  name: 'base64urlpad',
-  alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=',
-  bitsPerChar: 6
-})
 
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/@libp2p/logger/dist/src/index.js
-/**
- * @packageDocumentation
- *
- * A logger for libp2p based on the venerable [debug](https://www.npmjs.com/package/debug) module.
- *
- * @example
- *
- * ```JavaScript
- * import { logger } from '@libp2p/logger'
- *
- * const log = logger('libp2p:my:component:name')
- *
- * log('something happened: %s', 'it was ok')
- * log.error('something bad happened: %o', err)
- *
- * log('with this peer: %p', aPeerId)
- * log('and this base58btc: %b', aUint8Array)
- * log('and this base32: %t', aUint8Array)
- *  ```
- * ```console
- * $ DEBUG=libp2p:* node index.js
- * something happened: it was ok
- * something bad happened: 
- * with this peer: 12D3Foo
- * with this base58btc: Qmfoo
- * with this base32: bafyfoo
- * ```
- */
+const mkdir_mergeOptions = node_modules_merge_options.bind({ ignoreUndefined: true });
+const mkdir_log = dist_src_logger('helia:unixfs:mkdir');
+const mkdir_defaultOptions = {
+    cidVersion: 1,
+    force: false,
+    shardSplitThresholdBytes: SHARD_SPLIT_THRESHOLD_BYTES
+};
+async function mkdir(parentCid, dirname, blockstore, options = {}) {
+    const opts = mkdir_mergeOptions(mkdir_defaultOptions, options);
+    if (dirname.includes('/')) {
+        throw new errors_InvalidParametersError('Path must not have slashes');
+    }
+    const entry = await exporter(parentCid, blockstore, options);
+    if (entry.type !== 'directory') {
+        throw new NotADirectoryError(`${parentCid.toString()} was not a UnixFS directory`);
+    }
+    mkdir_log('creating %s', dirname);
+    const metadata = new src_UnixFS({
+        type: 'directory',
+        mode: opts.mode,
+        mtime: opts.mtime
+    });
+    // Persist the new parent PBNode
+    const node = {
+        Data: metadata.marshal(),
+        Links: []
+    };
+    const buf = src_encode(node);
+    const hash = await unixfs_node_modules_multiformats_src_hashes_sha2_sha256.digest(buf);
+    const emptyDirCid = unixfs_node_modules_multiformats_src_cid_CID.create(opts.cidVersion, code, hash);
+    await blockstore.put(emptyDirCid, buf);
+    const [directory, pblink] = await Promise.all([
+        cidToDirectory(parentCid, blockstore, opts),
+        cidToPBLink(emptyDirCid, dirname, blockstore, opts)
+    ]);
+    mkdir_log('adding empty dir called %s to %c', dirname, parentCid);
+    const result = await addLink(directory, pblink, blockstore, {
+        ...opts,
+        allowOverwriting: opts.force
+    });
+    return result.cid;
+}
+//# sourceMappingURL=mkdir.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/utils/remove-link.js
 
 
 
 
 
-// Add a formatter for converting to a base58 string
-debug_src.formatters.b = (v) => {
-    return v == null ? 'undefined' : blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc.baseEncode(v);
-};
-// Add a formatter for converting to a base32 string
-debug_src.formatters.t = (v) => {
-    return v == null ? 'undefined' : blockstore_fs_node_modules_multiformats_src_bases_base32_base32.baseEncode(v);
-};
-// Add a formatter for converting to a base64 string
-debug_src.formatters.m = (v) => {
-    return v == null ? 'undefined' : blockstore_fs_node_modules_multiformats_src_bases_base64_base64.baseEncode(v);
-};
-// Add a formatter for stringifying peer ids
-debug_src.formatters.p = (v) => {
-    return v == null ? 'undefined' : v.toString();
-};
-// Add a formatter for stringifying CIDs
-debug_src.formatters.c = (v) => {
-    return v == null ? 'undefined' : v.toString();
-};
-// Add a formatter for stringifying Datastore keys
-debug_src.formatters.k = (v) => {
-    return v == null ? 'undefined' : v.toString();
-};
-// Add a formatter for stringifying Multiaddrs
-debug_src.formatters.a = (v) => {
-    return v == null ? 'undefined' : v.toString();
-};
-function logger_dist_src_createDisabledLogger(namespace) {
-    const logger = () => { };
-    logger.enabled = false;
-    logger.color = '';
-    logger.diff = 0;
-    logger.log = () => { };
-    logger.namespace = namespace;
-    logger.destroy = () => true;
-    logger.extend = () => logger;
-    return logger;
-}
-/**
- * Create a component logger that will prefix any log messages with a truncated
- * peer id.
- *
- * @example
- *
- * ```TypeScript
- * import { peerLogger } from '@libp2p/logger'
- * import { peerIdFromString } from '@libp2p/peer-id'
- *
- * const peerId = peerIdFromString('12D3FooBar')
- * const logger = peerLogger(peerId)
- *
- * const log = logger.forComponent('my-component')
- * log.info('hello world')
- * // logs "12…oBar:my-component hello world"
- * ```
- */
-function src_peerLogger(peerId, options = {}) {
-    return src_prefixLogger(truncatePeerId(peerId, options));
+
+
+
+const remove_link_log = dist_src_logger('helia:unixfs:utils:remove-link');
+async function removeLink(parent, name, blockstore, options) {
+    if (parent.node.Data == null) {
+        throw new InvalidPBNodeError('Parent node had no data');
+    }
+    const meta = src_UnixFS.unmarshal(parent.node.Data);
+    if (meta.type === 'hamt-sharded-directory') {
+        remove_link_log(`removing ${name} from sharded directory`);
+        const result = await removeFromShardedDirectory(parent, name, blockstore, options);
+        if (!(await isOverShardThreshold(result.node, blockstore, options.shardSplitThresholdBytes, options))) {
+            remove_link_log('converting shard to flat directory %c', parent.cid);
+            return convertToFlatDirectory(result, blockstore, options);
+        }
+        return result;
+    }
+    remove_link_log(`removing link ${name} regular directory`);
+    return removeFromDirectory(parent, name, blockstore, options);
 }
-/**
- * Create a component logger that will prefix any log messages with the passed
- * string.
- *
- * @example
- *
- * ```TypeScript
- * import { prefixLogger } from '@libp2p/logger'
- *
- * const logger = prefixLogger('my-node')
- *
- * const log = logger.forComponent('my-component')
- * log.info('hello world')
- * // logs "my-node:my-component hello world"
- * ```
- */
-function src_prefixLogger(prefix) {
+const removeFromDirectory = async (parent, name, blockstore, options) => {
+    // Remove existing link if it exists
+    parent.node.Links = parent.node.Links.filter((link) => {
+        return link.Name !== name;
+    });
+    const parentBlock = src_encode(parent.node);
+    const parentCid = await persist_persist(parentBlock, blockstore, {
+        ...options,
+        cidVersion: parent.cid.version
+    });
+    remove_link_log(`Updated regular directory ${parentCid}`);
     return {
-        forComponent(name) {
-            return logger_dist_src_logger(`${prefix}:${name}`);
+        node: parent.node,
+        cid: parentCid
+    };
+};
+const removeFromShardedDirectory = async (parent, name, blockstore, options) => {
+    const { path } = await recreateShardedDirectory(parent.cid, name, blockstore, options);
+    const finalSegment = path[path.length - 1];
+    if (finalSegment == null) {
+        throw new Error('Invalid HAMT, could not generate path');
+    }
+    const linkName = finalSegment.node.Links.filter(l => (l.Name ?? '').substring(2) === name).map(l => l.Name).pop();
+    if (linkName == null) {
+        throw new Error('File not found');
+    }
+    const prefix = linkName.substring(0, 2);
+    const index = parseInt(prefix, 16);
+    // remove the file from the shard
+    finalSegment.node.Links = finalSegment.node.Links.filter(link => link.Name !== linkName);
+    finalSegment.children.unset(index);
+    if (finalSegment.node.Links.length === 1) {
+        // replace the subshard with the last remaining file in the parent
+        while (true) {
+            if (path.length === 1) {
+                break;
+            }
+            const segment = path[path.length - 1];
+            if (segment == null || segment.node.Links.length > 1) {
+                break;
+            }
+            // remove final segment
+            path.pop();
+            const nextSegment = path[path.length - 1];
+            if (nextSegment == null) {
+                break;
+            }
+            const link = segment.node.Links[0];
+            nextSegment.node.Links = nextSegment.node.Links.filter(l => !(l.Name ?? '').startsWith(nextSegment.prefix));
+            nextSegment.node.Links.push({
+                Hash: link.Hash,
+                Name: `${nextSegment.prefix}${(link.Name ?? '').substring(2)}`,
+                Tsize: link.Tsize
+            });
         }
+    }
+    return updateShardedDirectory(path, blockstore, options);
+};
+const convertToFlatDirectory = async (parent, blockstore, options) => {
+    if (parent.node.Data == null) {
+        throw new errors_InvalidParametersError('Invalid parent passed to convertToFlatDirectory');
+    }
+    const rootNode = {
+        Links: []
     };
-}
-/**
- * Create a component logger
- *
- * @example
- *
- * ```TypeScript
- * import { defaultLogger } from '@libp2p/logger'
- * import { peerIdFromString } from '@libp2p/peer-id'
- *
- * const logger = defaultLogger()
- *
- * const log = logger.forComponent('my-component')
- * log.info('hello world')
- * // logs "my-component hello world"
- * ```
- */
-function src_defaultLogger() {
-    return {
-        forComponent(name) {
-            return logger_dist_src_logger(name);
+    const dir = await exporter(parent.cid, blockstore);
+    if (dir.type !== 'directory') {
+        throw new Error('Unexpected node type');
+    }
+    for await (const entry of dir.content()) {
+        let tsize = 0;
+        if (entry.node instanceof Uint8Array) {
+            tsize = entry.node.byteLength;
+        }
+        else {
+            tsize = src_encode(entry.node).length;
         }
+        rootNode.Links.push({
+            Hash: entry.cid,
+            Name: entry.name,
+            Tsize: tsize
+        });
+    }
+    // copy mode/mtime over if set
+    const oldUnixfs = src_UnixFS.unmarshal(parent.node.Data);
+    rootNode.Data = new src_UnixFS({ type: 'directory', mode: oldUnixfs.mode, mtime: oldUnixfs.mtime }).marshal();
+    const block = src_encode(prepare(rootNode));
+    const cid = await persist_persist(block, blockstore, {
+        codec: src_namespaceObject,
+        cidVersion: parent.cid.version,
+        signal: options.signal
+    });
+    return {
+        cid,
+        node: rootNode
     };
-}
-/**
- * Creates a logger for the passed component name.
- *
- * @example
- *
- * ```TypeScript
- * import { logger } from '@libp2p/logger'
- *
- * const log = logger('my-component')
- * log.info('hello world')
- * // logs "my-component hello world"
- * ```
- */
-function logger_dist_src_logger(name) {
-    // trace logging is a no-op by default
-    let trace = logger_dist_src_createDisabledLogger(`${name}:trace`);
-    // look at all the debug names and see if trace logging has explicitly been enabled
-    if (debug_src.enabled(`${name}:trace`) && debug_src.names.map(r => r.toString()).find(n => n.includes(':trace')) != null) {
-        trace = debug_src(`${name}:trace`);
+};
+//# sourceMappingURL=remove-link.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/rm.js
+
+
+
+
+
+
+const rm_mergeOptions = node_modules_merge_options.bind({ ignoreUndefined: true });
+const rm_log = dist_src_logger('helia:unixfs:rm');
+const rm_defaultOptions = {
+    shardSplitThresholdBytes: SHARD_SPLIT_THRESHOLD_BYTES
+};
+async function rm(target, name, blockstore, options = {}) {
+    const opts = rm_mergeOptions(rm_defaultOptions, options);
+    if (name.includes('/')) {
+        throw new errors_InvalidParametersError('Name must not have slashes');
     }
-    return Object.assign(debug_src(name), {
-        error: debug_src(`${name}:error`),
-        trace
+    const directory = await cidToDirectory(target, blockstore, opts);
+    rm_log('Removing %s from %c', name, target);
+    const result = await removeLink(directory, name, blockstore, {
+        ...opts,
+        cidVersion: target.version
     });
+    return result.cid;
 }
-function logger_dist_src_disable() {
-    debug.disable();
-}
-function logger_dist_src_enable(namespaces) {
-    debug.enable(namespaces);
-}
-function logger_dist_src_enabled(namespaces) {
-    return debug.enabled(namespaces);
-}
-//# sourceMappingURL=index.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/dist/src/tiered.js
+//# sourceMappingURL=rm.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/stat.js
 
 
 
@@ -270365,221 +196302,249 @@ function logger_dist_src_enabled(namespaces) {
 
 
 
-const tiered_log = logger_dist_src_logger('blockstore:core:tiered');
-/**
- * A blockstore that can combine multiple stores. Puts and deletes
- * will write through to all blockstores. Has and get will
- * try each store sequentially. getAll will use every store but also
- * deduplicate any yielded pairs.
- */
-class TieredBlockstore extends (/* unused pure expression or super */ null && (BaseBlockstore)) {
-    stores;
-    constructor(stores) {
-        super();
-        this.stores = stores.slice();
+
+const stat_mergeOptions = node_modules_merge_options.bind({ ignoreUndefined: true });
+const stat_log = dist_src_logger('helia:unixfs:stat');
+const stat_defaultOptions = {};
+async function stat(cid, blockstore, options = {}) {
+    const opts = stat_mergeOptions(stat_defaultOptions, options);
+    const resolved = await resolve_resolve(cid, options.path, blockstore, opts);
+    stat_log('stat %c', resolved.cid);
+    const result = await exporter(resolved.cid, blockstore, opts);
+    if (result.type !== 'file' && result.type !== 'directory' && result.type !== 'raw') {
+        throw new NotUnixFSError();
     }
-    async put(key, value, options) {
-        try {
-            await Promise.all(this.stores.map(async (store) => { await store.put(key, value, options); }));
-            return key;
-        }
-        catch (err) {
-            throw Errors.putFailedError(err);
-        }
+    let fileSize = 0n;
+    let dagSize = 0n;
+    let localFileSize = 0n;
+    let localDagSize = 0n;
+    let blocks = 0;
+    let mode;
+    let mtime;
+    const type = result.type;
+    let unixfs;
+    if (result.type === 'raw') {
+        fileSize = BigInt(result.node.byteLength);
+        dagSize = BigInt(result.node.byteLength);
+        localFileSize = BigInt(result.node.byteLength);
+        localDagSize = BigInt(result.node.byteLength);
+        blocks = 1;
     }
-    async get(key, options) {
-        for (const store of this.stores) {
-            try {
-                const res = await store.get(key, options);
-                if (res != null)
-                    return res;
-            }
-            catch (err) {
-                tiered_log.error(err);
-            }
-        }
-        throw Errors.notFoundError();
+    if (result.type === 'directory') {
+        fileSize = 0n;
+        dagSize = BigInt(result.unixfs.marshal().byteLength);
+        localFileSize = 0n;
+        localDagSize = dagSize;
+        blocks = 1;
+        mode = result.unixfs.mode;
+        mtime = result.unixfs.mtime;
+        unixfs = result.unixfs;
     }
-    async has(key, options) {
-        for (const s of this.stores) {
-            if (await s.has(key, options)) {
-                return true;
-            }
-        }
-        return false;
+    if (result.type === 'file') {
+        const results = await inspectDag(resolved.cid, blockstore, opts);
+        fileSize = result.unixfs.fileSize();
+        dagSize = BigInt((result.node.Data?.byteLength ?? 0) + result.node.Links.reduce((acc, curr) => acc + (curr.Tsize ?? 0), 0));
+        localFileSize = BigInt(results.localFileSize);
+        localDagSize = BigInt(results.localDagSize);
+        blocks = results.blocks;
+        mode = result.unixfs.mode;
+        mtime = result.unixfs.mtime;
+        unixfs = result.unixfs;
     }
-    async delete(key, options) {
-        try {
-            await Promise.all(this.stores.map(async (store) => { await store.delete(key, options); }));
-        }
-        catch (err) {
-            throw Errors.deleteFailedError(err);
+    return {
+        cid: resolved.cid,
+        mode,
+        mtime,
+        fileSize,
+        dagSize,
+        localFileSize,
+        localDagSize,
+        blocks,
+        type,
+        unixfs
+    };
+}
+async function inspectDag(cid, blockstore, options) {
+    const results = {
+        localFileSize: 0,
+        localDagSize: 0,
+        blocks: 0
+    };
+    if (await blockstore.has(cid, options)) {
+        const block = await blockstore.get(cid, options);
+        results.blocks++;
+        results.localDagSize += block.byteLength;
+        if (cid.code === unixfs_node_modules_multiformats_src_codecs_raw_code) {
+            results.localFileSize += block.byteLength;
         }
-    }
-    async *putMany(source, options = {}) {
-        let error;
-        const pushables = this.stores.map(store => {
-            const source = pushable({
-                objectMode: true
-            });
-            drain(store.putMany(source, options))
-                .catch(err => {
-                // store threw while putting, make sure we bubble the error up
-                error = err;
-            });
-            return source;
-        });
-        try {
-            for await (const pair of source) {
-                if (error != null) {
-                    throw error;
+        else if (cid.code === code) {
+            const pbNode = src_decode(block);
+            if (pbNode.Links.length > 0) {
+                // intermediate node
+                for (const link of pbNode.Links) {
+                    const linkResult = await inspectDag(link.Hash, blockstore, options);
+                    results.localFileSize += linkResult.localFileSize;
+                    results.localDagSize += linkResult.localDagSize;
+                    results.blocks += linkResult.blocks;
                 }
-                pushables.forEach(p => p.push(pair));
-                yield pair.cid;
             }
-        }
-        finally {
-            pushables.forEach(p => p.end());
-        }
-    }
-    async *deleteMany(source, options = {}) {
-        let error;
-        const pushables = this.stores.map(store => {
-            const source = pushable({
-                objectMode: true
-            });
-            drain(store.deleteMany(source, options))
-                .catch(err => {
-                // store threw while deleting, make sure we bubble the error up
-                error = err;
-            });
-            return source;
-        });
-        try {
-            for await (const key of source) {
-                if (error != null) {
-                    throw error;
+            else {
+                // leaf node
+                if (pbNode.Data == null) {
+                    throw new InvalidPBNodeError(`PBNode ${cid.toString()} had no data`);
                 }
-                pushables.forEach(p => p.push(key));
-                yield key;
+                const unixfs = src_UnixFS.unmarshal(pbNode.Data);
+                if (unixfs.data == null) {
+                    throw new InvalidPBNodeError(`UnixFS node ${cid.toString()} had no data`);
+                }
+                results.localFileSize += unixfs.data.byteLength ?? 0;
             }
         }
-        finally {
-            pushables.forEach(p => p.end());
+        else {
+            throw new errors_UnknownError(`${cid.toString()} was neither DAG_PB nor RAW`);
         }
     }
-    async *getAll(options) {
-        // deduplicate yielded pairs
-        const seen = new Set();
-        yield* filter(merge(...this.stores.map(s => s.getAll(options))), (pair) => {
-            const cidStr = pair.cid.toString();
-            if (seen.has(cidStr)) {
-                return false;
-            }
-            seen.add(cidStr);
-            return true;
-        });
-    }
+    return results;
 }
-//# sourceMappingURL=tiered.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/dist/src/index.js
-/**
- * @packageDocumentation
- *
- * Various Blockstore implementations are available.
- *
- * ## Implementations
- *
- * - Base: [`src/base`](src/base.ts)
- * - Memory: [`src/memory`](src/memory.ts)
- * - BlackHole: ['src/black-hole](src/black-hole.ts)
- * - Tiered: ['src/tiered](src/tiered.ts)
- *
- * @example BaseBlockstore
- *
- * Provides a complete implementation of the Blockstore interface.  You must implement `.get`, `.put`, etc.
- *
- * ```js
- * import { BaseBlockstore } from 'blockstore-core/base'
- *
- * class MyCustomBlockstore extends BaseBlockstore {
- *   put (key, val, options) {
- *     // store a block
- *   }
- *
- *   get (key, options) {
- *     // retrieve a block
- *   }
- *
- *   // ...etc
- * }
- * ```
- *
- * @example MemoryBlockstore
- *
- * A simple Blockstore that stores blocks in memory.
- *
- * ```js
- * import { MemoryBlockstore } from 'blockstore-core/memory'
- *
- * const store = new MemoryBlockstore()
- * ```
- *
- * @example BlackHoleBlockstore
- *
- * A Blockstore that does not store any blocks.
- *
- * ```js
- * import { BlackHoleBlockstore } from 'blockstore-core/black-hole'
- *
- * const store = new BlackHoleBlockstore()
- * ```
- *
- * @example TieredBlockstore
- *
- * A tiered blockstore wraps one or more blockstores and will query each in parallel to retrieve a block - the operation will succeed if any wrapped store has the block.
- *
- * Writes are invoked on all wrapped blockstores.
- *
- * ```js
- * import { TieredBlockstore } from 'blockstore-core/tiered'
- *
- * const store = new TieredBlockstore([
- *   store1,
- *   store2,
- *   // ...etc
- * ])
- * ```
- */
+//# sourceMappingURL=stat.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/commands/touch.js
 
 
 
 
 
-const src_Errors = {
-    ...blockstore_core_dist_src_errors_namespaceObject
+
+
+
+
+
+
+
+
+
+
+const touch_mergeOptions = node_modules_merge_options.bind({ ignoreUndefined: true });
+const touch_log = dist_src_logger('helia:unixfs:touch');
+const touch_defaultOptions = {
+    recursive: false,
+    shardSplitThresholdBytes: SHARD_SPLIT_THRESHOLD_BYTES
 };
-//# sourceMappingURL=index.js.map
-// EXTERNAL MODULE: ./node_modules/fast-write-atomic/index.js
-var fast_write_atomic = __nccwpck_require__(27865);
-// EXTERNAL MODULE: ./node_modules/blockstore-fs/node_modules/brace-expansion/index.js
-var node_modules_brace_expansion = __nccwpck_require__(11401);
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/minimatch/dist/mjs/assert-valid-pattern.js
-const assert_valid_pattern_MAX_PATTERN_LENGTH = 1024 * 64;
-const assert_valid_pattern_assertValidPattern = (pattern) => {
+async function touch(cid, blockstore, options = {}) {
+    const opts = touch_mergeOptions(touch_defaultOptions, options);
+    const resolved = await resolve_resolve(cid, opts.path, blockstore, opts);
+    const mtime = opts.mtime ?? {
+        secs: BigInt(Math.round(Date.now() / 1000)),
+        nsecs: 0
+    };
+    touch_log('touch %c %o', resolved.cid, mtime);
+    if (opts.recursive) {
+        // recursively export from root CID, change perms of each entry then reimport
+        // but do not reimport files, only manipulate dag-pb nodes
+        const root = await pipe(async function* () {
+            for await (const entry of recursive(resolved.cid, blockstore)) {
+                let metadata;
+                let links;
+                if (entry.type === 'raw') {
+                    metadata = new src_UnixFS({ data: entry.node });
+                    links = [];
+                }
+                else if (entry.type === 'file' || entry.type === 'directory') {
+                    metadata = entry.unixfs;
+                    links = entry.node.Links;
+                }
+                else {
+                    throw new NotUnixFSError();
+                }
+                metadata.mtime = mtime;
+                const node = {
+                    Data: metadata.marshal(),
+                    Links: links
+                };
+                yield {
+                    path: entry.path,
+                    content: node
+                };
+            }
+        }, 
+        // @ts-expect-error blockstore types are incompatible
+        (source) => importer(source, blockstore, {
+            ...opts,
+            dagBuilder: async function* (source, block) {
+                for await (const entry of source) {
+                    yield async function () {
+                        // @ts-expect-error cannot derive type
+                        const node = entry.content;
+                        const buf = src_encode(node);
+                        const updatedCid = await persist_persist(buf, block, {
+                            ...opts,
+                            cidVersion: cid.version
+                        });
+                        if (node.Data == null) {
+                            throw new InvalidPBNodeError(`${updatedCid} had no data`);
+                        }
+                        const unixfs = src_UnixFS.unmarshal(node.Data);
+                        return {
+                            cid: updatedCid,
+                            size: BigInt(buf.length),
+                            path: entry.path,
+                            unixfs
+                        };
+                    };
+                }
+            }
+        }), async (nodes) => dist_src(nodes));
+        if (root == null) {
+            throw new errors_UnknownError(`Could not chmod ${resolved.cid.toString()}`);
+        }
+        return updatePathCids(root.cid, resolved, blockstore, opts);
+    }
+    const block = await blockstore.get(resolved.cid, options);
+    let metadata;
+    let links = [];
+    if (resolved.cid.code === unixfs_node_modules_multiformats_src_codecs_raw_code) {
+        metadata = new src_UnixFS({ data: block });
+    }
+    else {
+        const node = src_decode(block);
+        links = node.Links;
+        if (node.Data == null) {
+            throw new InvalidPBNodeError(`${resolved.cid.toString()} had no data`);
+        }
+        metadata = src_UnixFS.unmarshal(node.Data);
+    }
+    metadata.mtime = mtime;
+    const updatedBlock = src_encode({
+        Data: metadata.marshal(),
+        Links: links
+    });
+    const hash = await unixfs_node_modules_multiformats_src_hashes_sha2_sha256.digest(updatedBlock);
+    const updatedCid = unixfs_node_modules_multiformats_src_cid_CID.create(resolved.cid.version, code, hash);
+    await blockstore.put(updatedCid, updatedBlock);
+    return updatePathCids(updatedCid, resolved, blockstore, opts);
+}
+//# sourceMappingURL=touch.js.map
+;// CONCATENATED MODULE: external "fs/promises"
+const promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs/promises");
+// EXTERNAL MODULE: external "path"
+var external_path_ = __nccwpck_require__(71017);
+// EXTERNAL MODULE: ./node_modules/@helia/unixfs/node_modules/brace-expansion/index.js
+var brace_expansion = __nccwpck_require__(22422);
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/minimatch/dist/mjs/assert-valid-pattern.js
+const MAX_PATTERN_LENGTH = 1024 * 64;
+const assertValidPattern = (pattern) => {
     if (typeof pattern !== 'string') {
         throw new TypeError('invalid pattern');
     }
-    if (pattern.length > assert_valid_pattern_MAX_PATTERN_LENGTH) {
+    if (pattern.length > MAX_PATTERN_LENGTH) {
         throw new TypeError('pattern is too long');
     }
 };
 //# sourceMappingURL=assert-valid-pattern.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/minimatch/dist/mjs/brace-expressions.js
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/minimatch/dist/mjs/brace-expressions.js
 // translate the various posix character classes into unicode properties
 // this works across all unicode locales
 // { : [, /u flag required, negated]
-const brace_expressions_posixClasses = {
+const posixClasses = {
     '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true],
     '[:alpha:]': ['\\p{L}\\p{Nl}', true],
     '[:ascii:]': ['\\x' + '00-\\x' + '7f', false],
@@ -270597,18 +196562,18 @@ const brace_expressions_posixClasses = {
 };
 // only need to escape a few things inside of brace expressions
 // escapes: [ \ ] -
-const brace_expressions_braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&');
+const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&');
 // escape all regexp magic characters
-const brace_expressions_regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
 // everything has already been escaped, we just have to join
-const brace_expressions_rangesToString = (ranges) => ranges.join('');
+const rangesToString = (ranges) => ranges.join('');
 // takes a glob string at a posix brace expression, and returns
 // an equivalent regular expression source, and boolean indicating
 // whether the /u flag needs to be applied, and the number of chars
 // consumed to parse the character class.
 // This also removes out of order ranges, and returns ($.) if the
 // entire class just no good.
-const brace_expressions_parseClass = (glob, position) => {
+const parseClass = (glob, position) => {
     const pos = position;
     /* c8 ignore start */
     if (glob.charAt(pos) !== '[') {
@@ -270646,7 +196611,7 @@ const brace_expressions_parseClass = (glob, position) => {
         }
         if (c === '[' && !escaping) {
             // either a posix class, a collation equivalent, or just a [
-            for (const [cls, [unip, u, neg]] of Object.entries(brace_expressions_posixClasses)) {
+            for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
                 if (glob.startsWith(cls, i)) {
                     // invalid, [a-[] is fine, but not [a-[:alpha]]
                     if (rangeStart) {
@@ -270668,10 +196633,10 @@ const brace_expressions_parseClass = (glob, position) => {
             // throw this range away if it's not valid, but others
             // can still match.
             if (c > rangeStart) {
-                ranges.push(brace_expressions_braceEscape(rangeStart) + '-' + brace_expressions_braceEscape(c));
+                ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c));
             }
             else if (c === rangeStart) {
-                ranges.push(brace_expressions_braceEscape(c));
+                ranges.push(braceEscape(c));
             }
             rangeStart = '';
             i++;
@@ -270680,7 +196645,7 @@ const brace_expressions_parseClass = (glob, position) => {
         // now might be the start of a range.
         // can be either c-d or c-] or c] or c] at this point
         if (glob.startsWith('-]', i + 1)) {
-            ranges.push(brace_expressions_braceEscape(c + '-'));
+            ranges.push(braceEscape(c + '-'));
             i += 2;
             continue;
         }
@@ -270690,7 +196655,7 @@ const brace_expressions_parseClass = (glob, position) => {
             continue;
         }
         // not the start of a range, just a single character
-        ranges.push(brace_expressions_braceEscape(c));
+        ranges.push(braceEscape(c));
         i++;
     }
     if (endPos < i) {
@@ -270712,10 +196677,10 @@ const brace_expressions_parseClass = (glob, position) => {
         /^\\?.$/.test(ranges[0]) &&
         !negate) {
         const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
-        return [brace_expressions_regexpEscape(r), false, endPos - pos, false];
+        return [regexpEscape(r), false, endPos - pos, false];
     }
-    const sranges = '[' + (negate ? '^' : '') + brace_expressions_rangesToString(ranges) + ']';
-    const snegs = '[' + (negate ? '' : '^') + brace_expressions_rangesToString(negs) + ']';
+    const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';
+    const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';
     const comb = ranges.length && negs.length
         ? '(' + sranges + '|' + snegs + ')'
         : ranges.length
@@ -270724,7 +196689,7 @@ const brace_expressions_parseClass = (glob, position) => {
     return [comb, uflag, endPos - pos, true];
 };
 //# sourceMappingURL=brace-expressions.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/minimatch/dist/mjs/unescape.js
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/minimatch/dist/mjs/unescape.js
 /**
  * Un-escape a string that has been escaped with {@link escape}.
  *
@@ -270739,42 +196704,42 @@ const brace_expressions_parseClass = (glob, position) => {
  * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
  * or unescaped.
  */
-const mjs_unescape_unescape = (s, { windowsPathsNoEscape = false, } = {}) => {
+const unescape_unescape = (s, { windowsPathsNoEscape = false, } = {}) => {
     return windowsPathsNoEscape
         ? s.replace(/\[([^\/\\])\]/g, '$1')
         : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1');
 };
 //# sourceMappingURL=unescape.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/minimatch/dist/mjs/ast.js
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/minimatch/dist/mjs/ast.js
 // parse a single path portion
 
 
-const mjs_ast_types = new Set(['!', '?', '+', '*', '@']);
-const ast_isExtglobType = (c) => mjs_ast_types.has(c);
+const ast_types = new Set(['!', '?', '+', '*', '@']);
+const isExtglobType = (c) => ast_types.has(c);
 // Patterns that get prepended to bind to the start of either the
 // entire string, or just a single path portion, to prevent dots
 // and/or traversal patterns, when needed.
 // Exts don't need the ^ or / bit, because the root binds that already.
-const ast_startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))';
-const ast_startNoDot = '(?!\\.)';
+const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))';
+const startNoDot = '(?!\\.)';
 // characters that indicate a start of pattern needs the "no dots" bit,
 // because a dot *might* be matched. ( is not in the list, because in
 // the case of a child extglob, it will handle the prevention itself.
-const ast_addPatternStart = new Set(['[', '.']);
+const addPatternStart = new Set(['[', '.']);
 // cases where traversal is A-OK, no dot prevention needed
-const ast_justDots = new Set(['..', '.']);
-const ast_reSpecials = new Set('().*{}+?[]^$\\!');
-const ast_regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+const justDots = new Set(['..', '.']);
+const reSpecials = new Set('().*{}+?[]^$\\!');
+const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
 // any single thing other than /
-const ast_qmark = '[^/]';
+const qmark = '[^/]';
 // * => any number of characters
-const ast_star = ast_qmark + '*?';
+const star = qmark + '*?';
 // use + when we need to ensure that *something* matches, because the * is
 // the only thing in the path portion.
-const ast_starNoEmpty = ast_qmark + '+?';
+const starNoEmpty = qmark + '+?';
 // remove the \ chars that we added if we end up doing a nonmagic compare
 // const deslash = (s: string) => s.replace(/\\(.)/g, '$1')
-class ast_AST {
+class AST {
     type;
     #root;
     #hasMagic;
@@ -270867,7 +196832,7 @@ class ast_AST {
             if (p === '')
                 continue;
             /* c8 ignore start */
-            if (typeof p !== 'string' && !(p instanceof ast_AST && p.#parent === this)) {
+            if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) {
                 throw new Error('invalid part: ' + p);
             }
             /* c8 ignore stop */
@@ -270899,7 +196864,7 @@ class ast_AST {
         const p = this.#parent;
         for (let i = 0; i < this.#parentIndex; i++) {
             const pp = p.#parts[i];
-            if (!(pp instanceof ast_AST && pp.type === '!')) {
+            if (!(pp instanceof AST && pp.type === '!')) {
                 return false;
             }
         }
@@ -270927,7 +196892,7 @@ class ast_AST {
             this.push(part.clone(this));
     }
     clone(parent) {
-        const c = new ast_AST(this.type, parent);
+        const c = new AST(this.type, parent);
         for (const p of this.#parts) {
             c.copyIn(p);
         }
@@ -270970,11 +196935,11 @@ class ast_AST {
                     acc += c;
                     continue;
                 }
-                if (!opt.noext && ast_isExtglobType(c) && str.charAt(i) === '(') {
+                if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') {
                     ast.push(acc);
                     acc = '';
-                    const ext = new ast_AST(c, ast);
-                    i = ast_AST.#parseAST(str, ext, i, opt);
+                    const ext = new AST(c, ast);
+                    i = AST.#parseAST(str, ext, i, opt);
                     ast.push(ext);
                     continue;
                 }
@@ -270986,7 +196951,7 @@ class ast_AST {
         // some kind of extglob, pos is at the (
         // find the next | or )
         let i = pos + 1;
-        let part = new ast_AST(null, ast);
+        let part = new AST(null, ast);
         const parts = [];
         let acc = '';
         while (i < str.length) {
@@ -271017,19 +196982,19 @@ class ast_AST {
                 acc += c;
                 continue;
             }
-            if (ast_isExtglobType(c) && str.charAt(i) === '(') {
+            if (isExtglobType(c) && str.charAt(i) === '(') {
                 part.push(acc);
                 acc = '';
-                const ext = new ast_AST(c, part);
+                const ext = new AST(c, part);
                 part.push(ext);
-                i = ast_AST.#parseAST(str, ext, i, opt);
+                i = AST.#parseAST(str, ext, i, opt);
                 continue;
             }
             if (c === '|') {
                 part.push(acc);
                 acc = '';
                 parts.push(part);
-                part = new ast_AST(null, ast);
+                part = new AST(null, ast);
                 continue;
             }
             if (c === ')') {
@@ -271052,8 +197017,8 @@ class ast_AST {
         return i;
     }
     static fromGlob(pattern, options = {}) {
-        const ast = new ast_AST(null, undefined, options);
-        ast_AST.#parseAST(pattern, ast, 0, options);
+        const ast = new AST(null, undefined, options);
+        AST.#parseAST(pattern, ast, 0, options);
         return ast;
     }
     // returns the regular expression if there's magic, or the unescaped
@@ -271161,7 +197126,7 @@ class ast_AST {
             const src = this.#parts
                 .map(p => {
                 const [re, _, hasMagic, uflag] = typeof p === 'string'
-                    ? ast_AST.#parseGlob(p, this.#hasMagic, noEmpty)
+                    ? AST.#parseGlob(p, this.#hasMagic, noEmpty)
                     : p.toRegExpSource(allowDot);
                 this.#hasMagic = this.#hasMagic || hasMagic;
                 this.#uflag = this.#uflag || uflag;
@@ -271175,9 +197140,9 @@ class ast_AST {
                     // so we need to protect against dots and such.
                     // '.' and '..' cannot match unless the pattern is that exactly,
                     // even if it starts with . or dot:true is set.
-                    const dotTravAllowed = this.#parts.length === 1 && ast_justDots.has(this.#parts[0]);
+                    const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
                     if (!dotTravAllowed) {
-                        const aps = ast_addPatternStart;
+                        const aps = addPatternStart;
                         // check if we have a possibility of matching . or ..,
                         // and prevent that.
                         const needNoTrav = 
@@ -271190,8771 +197155,8400 @@ class ast_AST {
                         // no need to prevent dots if it can't match a dot, or if a
                         // sub-pattern will be preventing it anyway.
                         const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
-                        start = needNoTrav ? ast_startNoTraversal : needNoDot ? ast_startNoDot : '';
+                        start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : '';
+                    }
+                }
+            }
+            // append the "end of path portion" pattern to negation tails
+            let end = '';
+            if (this.isEnd() &&
+                this.#root.#filledNegs &&
+                this.#parent?.type === '!') {
+                end = '(?:$|\\/)';
+            }
+            const final = start + src + end;
+            return [
+                final,
+                unescape_unescape(src),
+                (this.#hasMagic = !!this.#hasMagic),
+                this.#uflag,
+            ];
+        }
+        // We need to calculate the body *twice* if it's a repeat pattern
+        // at the start, once in nodot mode, then again in dot mode, so a
+        // pattern like *(?) can match 'x.y'
+        const repeated = this.type === '*' || this.type === '+';
+        // some kind of extglob
+        const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
+        let body = this.#partsToRegExp(dot);
+        if (this.isStart() && this.isEnd() && !body && this.type !== '!') {
+            // invalid extglob, has to at least be *something* present, if it's
+            // the entire path portion.
+            const s = this.toString();
+            this.#parts = [s];
+            this.type = null;
+            this.#hasMagic = undefined;
+            return [s, unescape_unescape(this.toString()), false, false];
+        }
+        // XXX abstract out this map method
+        let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot
+            ? ''
+            : this.#partsToRegExp(true);
+        if (bodyDotAllowed === body) {
+            bodyDotAllowed = '';
+        }
+        if (bodyDotAllowed) {
+            body = `(?:${body})(?:${bodyDotAllowed})*?`;
+        }
+        // an empty !() is exactly equivalent to a starNoEmpty
+        let final = '';
+        if (this.type === '!' && this.#emptyExt) {
+            final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;
+        }
+        else {
+            const close = this.type === '!'
+                ? // !() must match something,but !(x) can match ''
+                    '))' +
+                        (this.isStart() && !dot && !allowDot ? startNoDot : '') +
+                        star +
+                        ')'
+                : this.type === '@'
+                    ? ')'
+                    : this.type === '?'
+                        ? ')?'
+                        : this.type === '+' && bodyDotAllowed
+                            ? ')'
+                            : this.type === '*' && bodyDotAllowed
+                                ? `)?`
+                                : `)${this.type}`;
+            final = start + body + close;
+        }
+        return [
+            final,
+            unescape_unescape(body),
+            (this.#hasMagic = !!this.#hasMagic),
+            this.#uflag,
+        ];
+    }
+    #partsToRegExp(dot) {
+        return this.#parts
+            .map(p => {
+            // extglob ASTs should only contain parent ASTs
+            /* c8 ignore start */
+            if (typeof p === 'string') {
+                throw new Error('string type in extglob ast??');
+            }
+            /* c8 ignore stop */
+            // can ignore hasMagic, because extglobs are already always magic
+            const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
+            this.#uflag = this.#uflag || uflag;
+            return re;
+        })
+            .filter(p => !(this.isStart() && this.isEnd()) || !!p)
+            .join('|');
+    }
+    static #parseGlob(glob, hasMagic, noEmpty = false) {
+        let escaping = false;
+        let re = '';
+        let uflag = false;
+        for (let i = 0; i < glob.length; i++) {
+            const c = glob.charAt(i);
+            if (escaping) {
+                escaping = false;
+                re += (reSpecials.has(c) ? '\\' : '') + c;
+                continue;
+            }
+            if (c === '\\') {
+                if (i === glob.length - 1) {
+                    re += '\\\\';
+                }
+                else {
+                    escaping = true;
+                }
+                continue;
+            }
+            if (c === '[') {
+                const [src, needUflag, consumed, magic] = parseClass(glob, i);
+                if (consumed) {
+                    re += src;
+                    uflag = uflag || needUflag;
+                    i += consumed - 1;
+                    hasMagic = hasMagic || magic;
+                    continue;
+                }
+            }
+            if (c === '*') {
+                if (noEmpty && glob === '*')
+                    re += starNoEmpty;
+                else
+                    re += star;
+                hasMagic = true;
+                continue;
+            }
+            if (c === '?') {
+                re += qmark;
+                hasMagic = true;
+                continue;
+            }
+            re += regExpEscape(c);
+        }
+        return [re, unescape_unescape(glob), !!hasMagic, uflag];
+    }
+}
+//# sourceMappingURL=ast.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/minimatch/dist/mjs/escape.js
+/**
+ * Escape all magic characters in a glob pattern.
+ *
+ * If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape}
+ * option is used, then characters are escaped by wrapping in `[]`, because
+ * a magic character wrapped in a character class can only be satisfied by
+ * that exact character.  In this mode, `\` is _not_ escaped, because it is
+ * not interpreted as a magic character, but instead as a path separator.
+ */
+const escape_escape = (s, { windowsPathsNoEscape = false, } = {}) => {
+    // don't need to escape +@! because we escape the parens
+    // that make those magic, and escaping ! as [!] isn't valid,
+    // because [!]] is a valid glob class meaning not ']'.
+    return windowsPathsNoEscape
+        ? s.replace(/[?*()[\]]/g, '[$&]')
+        : s.replace(/[?*()[\]\\]/g, '\\$&');
+};
+//# sourceMappingURL=escape.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/minimatch/dist/mjs/index.js
+
+
+
+
+
+const mjs_minimatch = (p, pattern, options = {}) => {
+    assertValidPattern(pattern);
+    // shortcut: comments match nothing.
+    if (!options.nocomment && pattern.charAt(0) === '#') {
+        return false;
+    }
+    return new Minimatch(pattern, options).match(p);
+};
+// Optimized checking for the most common glob patterns.
+const starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
+const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);
+const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
+const starDotExtTestNocase = (ext) => {
+    ext = ext.toLowerCase();
+    return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);
+};
+const starDotExtTestNocaseDot = (ext) => {
+    ext = ext.toLowerCase();
+    return (f) => f.toLowerCase().endsWith(ext);
+};
+const starDotStarRE = /^\*+\.\*+$/;
+const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');
+const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');
+const dotStarRE = /^\.\*+$/;
+const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');
+const starRE = /^\*+$/;
+const starTest = (f) => f.length !== 0 && !f.startsWith('.');
+const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';
+const qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
+const qmarksTestNocase = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExt([$0]);
+    if (!ext)
+        return noext;
+    ext = ext.toLowerCase();
+    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
+};
+const qmarksTestNocaseDot = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExtDot([$0]);
+    if (!ext)
+        return noext;
+    ext = ext.toLowerCase();
+    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
+};
+const qmarksTestDot = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExtDot([$0]);
+    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
+};
+const qmarksTest = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExt([$0]);
+    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
+};
+const qmarksTestNoExt = ([$0]) => {
+    const len = $0.length;
+    return (f) => f.length === len && !f.startsWith('.');
+};
+const qmarksTestNoExtDot = ([$0]) => {
+    const len = $0.length;
+    return (f) => f.length === len && f !== '.' && f !== '..';
+};
+/* c8 ignore start */
+const defaultPlatform = (typeof process === 'object' && process
+    ? (typeof process.env === 'object' &&
+        process.env &&
+        process.env.__MINIMATCH_TESTING_PLATFORM__) ||
+        process.platform
+    : 'posix');
+const mjs_path = {
+    win32: { sep: '\\' },
+    posix: { sep: '/' },
+};
+/* c8 ignore stop */
+const sep = defaultPlatform === 'win32' ? mjs_path.win32.sep : mjs_path.posix.sep;
+mjs_minimatch.sep = sep;
+const GLOBSTAR = Symbol('globstar **');
+mjs_minimatch.GLOBSTAR = GLOBSTAR;
+// any single thing other than /
+// don't need to escape / when using new RegExp()
+const mjs_qmark = '[^/]';
+// * => any number of characters
+const mjs_star = mjs_qmark + '*?';
+// ** when dots are allowed.  Anything goes, except .. and .
+// not (^ or / followed by one or two dots followed by $ or /),
+// followed by anything, any number of times.
+const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?';
+// not a ^ or / followed by a dot,
+// followed by anything, any number of times.
+const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?';
+const mjs_filter = (pattern, options = {}) => (p) => mjs_minimatch(p, pattern, options);
+mjs_minimatch.filter = mjs_filter;
+const ext = (a, b = {}) => Object.assign({}, a, b);
+const mjs_defaults = (def) => {
+    if (!def || typeof def !== 'object' || !Object.keys(def).length) {
+        return mjs_minimatch;
+    }
+    const orig = mjs_minimatch;
+    const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
+    return Object.assign(m, {
+        Minimatch: class Minimatch extends orig.Minimatch {
+            constructor(pattern, options = {}) {
+                super(pattern, ext(def, options));
+            }
+            static defaults(options) {
+                return orig.defaults(ext(def, options)).Minimatch;
+            }
+        },
+        AST: class AST extends orig.AST {
+            /* c8 ignore start */
+            constructor(type, parent, options = {}) {
+                super(type, parent, ext(def, options));
+            }
+            /* c8 ignore stop */
+            static fromGlob(pattern, options = {}) {
+                return orig.AST.fromGlob(pattern, ext(def, options));
+            }
+        },
+        unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
+        escape: (s, options = {}) => orig.escape(s, ext(def, options)),
+        filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
+        defaults: (options) => orig.defaults(ext(def, options)),
+        makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
+        braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
+        match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
+        sep: orig.sep,
+        GLOBSTAR: GLOBSTAR,
+    });
+};
+mjs_minimatch.defaults = mjs_defaults;
+// Brace expansion:
+// a{b,c}d -> abd acd
+// a{b,}c -> abc ac
+// a{0..3}d -> a0d a1d a2d a3d
+// a{b,c{d,e}f}g -> abg acdfg acefg
+// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
+//
+// Invalid sets are not expanded.
+// a{2..}b -> a{2..}b
+// a{b}c -> a{b}c
+const braceExpand = (pattern, options = {}) => {
+    assertValidPattern(pattern);
+    // Thanks to Yeting Li  for
+    // improving this regexp to avoid a ReDOS vulnerability.
+    if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
+        // shortcut. no need to expand.
+        return [pattern];
+    }
+    return brace_expansion(pattern);
+};
+mjs_minimatch.braceExpand = braceExpand;
+// parse a component of the expanded set.
+// At this point, no pattern may contain "/" in it
+// so we're going to return a 2d array, where each entry is the full
+// pattern, split on '/', and then turned into a regular expression.
+// A regexp is made at the end which joins each array with an
+// escaped /, and another full one which joins each regexp with |.
+//
+// Following the lead of Bash 4.1, note that "**" only has special meaning
+// when it is the *only* thing in a path portion.  Otherwise, any series
+// of * is equivalent to a single *.  Globstar behavior is enabled by
+// default, and can be disabled by setting options.noglobstar.
+const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
+mjs_minimatch.makeRe = makeRe;
+const match = (list, pattern, options = {}) => {
+    const mm = new Minimatch(pattern, options);
+    list = list.filter(f => mm.match(f));
+    if (mm.options.nonull && !list.length) {
+        list.push(pattern);
+    }
+    return list;
+};
+mjs_minimatch.match = match;
+// replace stuff like \* with *
+const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
+const mjs_regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+class Minimatch {
+    options;
+    set;
+    pattern;
+    windowsPathsNoEscape;
+    nonegate;
+    negate;
+    comment;
+    empty;
+    preserveMultipleSlashes;
+    partial;
+    globSet;
+    globParts;
+    nocase;
+    isWindows;
+    platform;
+    windowsNoMagicRoot;
+    regexp;
+    constructor(pattern, options = {}) {
+        assertValidPattern(pattern);
+        options = options || {};
+        this.options = options;
+        this.pattern = pattern;
+        this.platform = options.platform || defaultPlatform;
+        this.isWindows = this.platform === 'win32';
+        this.windowsPathsNoEscape =
+            !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
+        if (this.windowsPathsNoEscape) {
+            this.pattern = this.pattern.replace(/\\/g, '/');
+        }
+        this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
+        this.regexp = null;
+        this.negate = false;
+        this.nonegate = !!options.nonegate;
+        this.comment = false;
+        this.empty = false;
+        this.partial = !!options.partial;
+        this.nocase = !!this.options.nocase;
+        this.windowsNoMagicRoot =
+            options.windowsNoMagicRoot !== undefined
+                ? options.windowsNoMagicRoot
+                : !!(this.isWindows && this.nocase);
+        this.globSet = [];
+        this.globParts = [];
+        this.set = [];
+        // make the set of regexps etc.
+        this.make();
+    }
+    hasMagic() {
+        if (this.options.magicalBraces && this.set.length > 1) {
+            return true;
+        }
+        for (const pattern of this.set) {
+            for (const part of pattern) {
+                if (typeof part !== 'string')
+                    return true;
+            }
+        }
+        return false;
+    }
+    debug(..._) { }
+    make() {
+        const pattern = this.pattern;
+        const options = this.options;
+        // empty patterns and comments match nothing.
+        if (!options.nocomment && pattern.charAt(0) === '#') {
+            this.comment = true;
+            return;
+        }
+        if (!pattern) {
+            this.empty = true;
+            return;
+        }
+        // step 1: figure out negation, etc.
+        this.parseNegate();
+        // step 2: expand braces
+        this.globSet = [...new Set(this.braceExpand())];
+        if (options.debug) {
+            this.debug = (...args) => console.error(...args);
+        }
+        this.debug(this.pattern, this.globSet);
+        // step 3: now we have a set, so turn each one into a series of
+        // path-portion matching patterns.
+        // These will be regexps, except in the case of "**", which is
+        // set to the GLOBSTAR object for globstar behavior,
+        // and will not contain any / characters
+        //
+        // First, we preprocess to make the glob pattern sets a bit simpler
+        // and deduped.  There are some perf-killing patterns that can cause
+        // problems with a glob walk, but we can simplify them down a bit.
+        const rawGlobParts = this.globSet.map(s => this.slashSplit(s));
+        this.globParts = this.preprocess(rawGlobParts);
+        this.debug(this.pattern, this.globParts);
+        // glob --> regexps
+        let set = this.globParts.map((s, _, __) => {
+            if (this.isWindows && this.windowsNoMagicRoot) {
+                // check if it's a drive or unc path.
+                const isUNC = s[0] === '' &&
+                    s[1] === '' &&
+                    (s[2] === '?' || !globMagic.test(s[2])) &&
+                    !globMagic.test(s[3]);
+                const isDrive = /^[a-z]:/i.test(s[0]);
+                if (isUNC) {
+                    return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))];
+                }
+                else if (isDrive) {
+                    return [s[0], ...s.slice(1).map(ss => this.parse(ss))];
+                }
+            }
+            return s.map(ss => this.parse(ss));
+        });
+        this.debug(this.pattern, set);
+        // filter out everything that didn't compile properly.
+        this.set = set.filter(s => s.indexOf(false) === -1);
+        // do not treat the ? in UNC paths as magic
+        if (this.isWindows) {
+            for (let i = 0; i < this.set.length; i++) {
+                const p = this.set[i];
+                if (p[0] === '' &&
+                    p[1] === '' &&
+                    this.globParts[i][2] === '?' &&
+                    typeof p[3] === 'string' &&
+                    /^[a-z]:$/i.test(p[3])) {
+                    p[2] = '?';
+                }
+            }
+        }
+        this.debug(this.pattern, this.set);
+    }
+    // various transforms to equivalent pattern sets that are
+    // faster to process in a filesystem walk.  The goal is to
+    // eliminate what we can, and push all ** patterns as far
+    // to the right as possible, even if it increases the number
+    // of patterns that we have to process.
+    preprocess(globParts) {
+        // if we're not in globstar mode, then turn all ** into *
+        if (this.options.noglobstar) {
+            for (let i = 0; i < globParts.length; i++) {
+                for (let j = 0; j < globParts[i].length; j++) {
+                    if (globParts[i][j] === '**') {
+                        globParts[i][j] = '*';
+                    }
+                }
+            }
+        }
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            // aggressive optimization for the purpose of fs walking
+            globParts = this.firstPhasePreProcess(globParts);
+            globParts = this.secondPhasePreProcess(globParts);
+        }
+        else if (optimizationLevel >= 1) {
+            // just basic optimizations to remove some .. parts
+            globParts = this.levelOneOptimize(globParts);
+        }
+        else {
+            globParts = this.adjascentGlobstarOptimize(globParts);
+        }
+        return globParts;
+    }
+    // just get rid of adjascent ** portions
+    adjascentGlobstarOptimize(globParts) {
+        return globParts.map(parts => {
+            let gs = -1;
+            while (-1 !== (gs = parts.indexOf('**', gs + 1))) {
+                let i = gs;
+                while (parts[i + 1] === '**') {
+                    i++;
+                }
+                if (i !== gs) {
+                    parts.splice(gs, i - gs);
+                }
+            }
+            return parts;
+        });
+    }
+    // get rid of adjascent ** and resolve .. portions
+    levelOneOptimize(globParts) {
+        return globParts.map(parts => {
+            parts = parts.reduce((set, part) => {
+                const prev = set[set.length - 1];
+                if (part === '**' && prev === '**') {
+                    return set;
+                }
+                if (part === '..') {
+                    if (prev && prev !== '..' && prev !== '.' && prev !== '**') {
+                        set.pop();
+                        return set;
+                    }
+                }
+                set.push(part);
+                return set;
+            }, []);
+            return parts.length === 0 ? [''] : parts;
+        });
+    }
+    levelTwoFileOptimize(parts) {
+        if (!Array.isArray(parts)) {
+            parts = this.slashSplit(parts);
+        }
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
// -> 
/
+            if (!this.preserveMultipleSlashes) {
+                for (let i = 1; i < parts.length - 1; i++) {
+                    const p = parts[i];
+                    // don't squeeze out UNC patterns
+                    if (i === 1 && p === '' && parts[0] === '')
+                        continue;
+                    if (p === '.' || p === '') {
+                        didSomething = true;
+                        parts.splice(i, 1);
+                        i--;
+                    }
+                }
+                if (parts[0] === '.' &&
+                    parts.length === 2 &&
+                    (parts[1] === '.' || parts[1] === '')) {
+                    didSomething = true;
+                    parts.pop();
+                }
+            }
+            // 
/

/../ ->

/
+            let dd = 0;
+            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                const p = parts[dd - 1];
+                if (p && p !== '.' && p !== '..' && p !== '**') {
+                    didSomething = true;
+                    parts.splice(dd - 1, 2);
+                    dd -= 2;
+                }
+            }
+        } while (didSomething);
+        return parts.length === 0 ? [''] : parts;
+    }
+    // First phase: single-pattern processing
+    // 
 is 1 or more portions
+    //  is 1 or more portions
+    // 

is any portion other than ., .., '', or ** + // is . or '' + // + // **/.. is *brutal* for filesystem walking performance, because + // it effectively resets the recursive walk each time it occurs, + // and ** cannot be reduced out by a .. pattern part like a regexp + // or most strings (other than .., ., and '') can be. + // + //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + //

// -> 
/
+    // 
/

/../ ->

/
+    // **/**/ -> **/
+    //
+    // **/*/ -> */**/ <== not valid because ** doesn't follow
+    // this WOULD be allowed if ** did follow symlinks, or * didn't
+    firstPhasePreProcess(globParts) {
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + for (let parts of globParts) { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let gss = gs; + while (parts[gss + 1] === '**') { + //

/**/**/ -> 
/**/
+                        gss++;
+                    }
+                    // eg, if gs is 2 and gss is 4, that means we have 3 **
+                    // parts, and can remove 2 of them.
+                    if (gss > gs) {
+                        parts.splice(gs + 1, gss - gs);
+                    }
+                    let next = parts[gs + 1];
+                    const p = parts[gs + 2];
+                    const p2 = parts[gs + 3];
+                    if (next !== '..')
+                        continue;
+                    if (!p ||
+                        p === '.' ||
+                        p === '..' ||
+                        !p2 ||
+                        p2 === '.' ||
+                        p2 === '..') {
+                        continue;
+                    }
+                    didSomething = true;
+                    // edit parts in place, and push the new one
+                    parts.splice(gs, 1);
+                    const other = parts.slice(0);
+                    other[gs] = '**';
+                    globParts.push(other);
+                    gs--;
+                }
+                // 
// -> 
/
+                if (!this.preserveMultipleSlashes) {
+                    for (let i = 1; i < parts.length - 1; i++) {
+                        const p = parts[i];
+                        // don't squeeze out UNC patterns
+                        if (i === 1 && p === '' && parts[0] === '')
+                            continue;
+                        if (p === '.' || p === '') {
+                            didSomething = true;
+                            parts.splice(i, 1);
+                            i--;
+                        }
+                    }
+                    if (parts[0] === '.' &&
+                        parts.length === 2 &&
+                        (parts[1] === '.' || parts[1] === '')) {
+                        didSomething = true;
+                        parts.pop();
+                    }
+                }
+                // 
/

/../ ->

/
+                let dd = 0;
+                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                    const p = parts[dd - 1];
+                    if (p && p !== '.' && p !== '..' && p !== '**') {
+                        didSomething = true;
+                        const needDot = dd === 1 && parts[dd + 1] === '**';
+                        const splin = needDot ? ['.'] : [];
+                        parts.splice(dd - 1, 2, ...splin);
+                        if (parts.length === 0)
+                            parts.push('');
+                        dd -= 2;
+                    }
+                }
+            }
+        } while (didSomething);
+        return globParts;
+    }
+    // second phase: multi-pattern dedupes
+    // {
/*/,
/

/} ->

/*/
+    // {
/,
/} -> 
/
+    // {
/**/,
/} -> 
/**/
+    //
+    // {
/**/,
/**/

/} ->

/**/
+    // ^-- not valid because ** doens't follow symlinks
+    secondPhasePreProcess(globParts) {
+        for (let i = 0; i < globParts.length - 1; i++) {
+            for (let j = i + 1; j < globParts.length; j++) {
+                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
+                if (!matched)
+                    continue;
+                globParts[i] = matched;
+                globParts[j] = [];
+            }
+        }
+        return globParts.filter(gs => gs.length);
+    }
+    partsMatch(a, b, emptyGSMatch = false) {
+        let ai = 0;
+        let bi = 0;
+        let result = [];
+        let which = '';
+        while (ai < a.length && bi < b.length) {
+            if (a[ai] === b[bi]) {
+                result.push(which === 'b' ? b[bi] : a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
+                result.push(a[ai]);
+                ai++;
+            }
+            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
+                result.push(b[bi]);
+                bi++;
+            }
+            else if (a[ai] === '*' &&
+                b[bi] &&
+                (this.options.dot || !b[bi].startsWith('.')) &&
+                b[bi] !== '**') {
+                if (which === 'b')
+                    return false;
+                which = 'a';
+                result.push(a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (b[bi] === '*' &&
+                a[ai] &&
+                (this.options.dot || !a[ai].startsWith('.')) &&
+                a[ai] !== '**') {
+                if (which === 'a')
+                    return false;
+                which = 'b';
+                result.push(b[bi]);
+                ai++;
+                bi++;
+            }
+            else {
+                return false;
+            }
+        }
+        // if we fall out of the loop, it means they two are identical
+        // as long as their lengths match
+        return a.length === b.length && result;
+    }
+    parseNegate() {
+        if (this.nonegate)
+            return;
+        const pattern = this.pattern;
+        let negate = false;
+        let negateOffset = 0;
+        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
+            negate = !negate;
+            negateOffset++;
+        }
+        if (negateOffset)
+            this.pattern = pattern.slice(negateOffset);
+        this.negate = negate;
+    }
+    // set partial to true to test if, for example,
+    // "/a/b" matches the start of "/*/b/*/d"
+    // Partial means, if you run out of file before you run
+    // out of pattern, then that's fine, as long as all
+    // the parts match.
+    matchOne(file, pattern, partial = false) {
+        const options = this.options;
+        // UNC paths like //?/X:/... can match X:/... and vice versa
+        // Drive letters in absolute drive or unc paths are always compared
+        // case-insensitively.
+        if (this.isWindows) {
+            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
+            const fileUNC = !fileDrive &&
+                file[0] === '' &&
+                file[1] === '' &&
+                file[2] === '?' &&
+                /^[a-z]:$/i.test(file[3]);
+            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
+            const patternUNC = !patternDrive &&
+                pattern[0] === '' &&
+                pattern[1] === '' &&
+                pattern[2] === '?' &&
+                typeof pattern[3] === 'string' &&
+                /^[a-z]:$/i.test(pattern[3]);
+            const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined;
+            const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined;
+            if (typeof fdi === 'number' && typeof pdi === 'number') {
+                const [fd, pd] = [file[fdi], pattern[pdi]];
+                if (fd.toLowerCase() === pd.toLowerCase()) {
+                    pattern[pdi] = fd;
+                    if (pdi > fdi) {
+                        pattern = pattern.slice(pdi);
+                    }
+                    else if (fdi > pdi) {
+                        file = file.slice(fdi);
+                    }
+                }
+            }
+        }
+        // resolve and reduce . and .. portions in the file as well.
+        // dont' need to do the second phase, because it's only one string[]
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            file = this.levelTwoFileOptimize(file);
+        }
+        this.debug('matchOne', this, { file, pattern });
+        this.debug('matchOne', file.length, pattern.length);
+        for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
+            this.debug('matchOne loop');
+            var p = pattern[pi];
+            var f = file[fi];
+            this.debug(pattern, p, f);
+            // should be impossible.
+            // some invalid regexp stuff in the set.
+            /* c8 ignore start */
+            if (p === false) {
+                return false;
+            }
+            /* c8 ignore stop */
+            if (p === GLOBSTAR) {
+                this.debug('GLOBSTAR', [pattern, p, f]);
+                // "**"
+                // a/**/b/**/c would match the following:
+                // a/b/x/y/z/c
+                // a/x/y/z/b/c
+                // a/b/x/b/x/c
+                // a/b/c
+                // To do this, take the rest of the pattern after
+                // the **, and see if it would match the file remainder.
+                // If so, return success.
+                // If not, the ** "swallows" a segment, and try again.
+                // This is recursively awful.
+                //
+                // a/**/b/**/c matching a/b/x/y/z/c
+                // - a matches a
+                // - doublestar
+                //   - matchOne(b/x/y/z/c, b/**/c)
+                //     - b matches b
+                //     - doublestar
+                //       - matchOne(x/y/z/c, c) -> no
+                //       - matchOne(y/z/c, c) -> no
+                //       - matchOne(z/c, c) -> no
+                //       - matchOne(c, c) yes, hit
+                var fr = fi;
+                var pr = pi + 1;
+                if (pr === pl) {
+                    this.debug('** at the end');
+                    // a ** at the end will just swallow the rest.
+                    // We have found a match.
+                    // however, it will not swallow /.x, unless
+                    // options.dot is set.
+                    // . and .. are *never* matched by **, for explosively
+                    // exponential reasons.
+                    for (; fi < fl; fi++) {
+                        if (file[fi] === '.' ||
+                            file[fi] === '..' ||
+                            (!options.dot && file[fi].charAt(0) === '.'))
+                            return false;
+                    }
+                    return true;
+                }
+                // ok, let's see if we can swallow whatever we can.
+                while (fr < fl) {
+                    var swallowee = file[fr];
+                    this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);
+                    // XXX remove this slice.  Just pass the start index.
+                    if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
+                        this.debug('globstar found match!', fr, fl, swallowee);
+                        // found a match.
+                        return true;
+                    }
+                    else {
+                        // can't swallow "." or ".." ever.
+                        // can only swallow ".foo" when explicitly asked.
+                        if (swallowee === '.' ||
+                            swallowee === '..' ||
+                            (!options.dot && swallowee.charAt(0) === '.')) {
+                            this.debug('dot detected!', file, fr, pattern, pr);
+                            break;
+                        }
+                        // ** swallows a segment, and continue.
+                        this.debug('globstar swallow a segment, and continue');
+                        fr++;
+                    }
+                }
+                // no match was found.
+                // However, in partial mode, we can't say this is necessarily over.
+                /* c8 ignore start */
+                if (partial) {
+                    // ran out of file
+                    this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
+                    if (fr === fl) {
+                        return true;
                     }
                 }
+                /* c8 ignore stop */
+                return false;
             }
-            // append the "end of path portion" pattern to negation tails
-            let end = '';
-            if (this.isEnd() &&
-                this.#root.#filledNegs &&
-                this.#parent?.type === '!') {
-                end = '(?:$|\\/)';
+            // something other than **
+            // non-magic patterns just have to match exactly
+            // patterns with magic have been turned into regexps.
+            let hit;
+            if (typeof p === 'string') {
+                hit = f === p;
+                this.debug('string match', p, f, hit);
             }
-            const final = start + src + end;
-            return [
-                final,
-                mjs_unescape_unescape(src),
-                (this.#hasMagic = !!this.#hasMagic),
-                this.#uflag,
-            ];
-        }
-        // We need to calculate the body *twice* if it's a repeat pattern
-        // at the start, once in nodot mode, then again in dot mode, so a
-        // pattern like *(?) can match 'x.y'
-        const repeated = this.type === '*' || this.type === '+';
-        // some kind of extglob
-        const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
-        let body = this.#partsToRegExp(dot);
-        if (this.isStart() && this.isEnd() && !body && this.type !== '!') {
-            // invalid extglob, has to at least be *something* present, if it's
-            // the entire path portion.
-            const s = this.toString();
-            this.#parts = [s];
-            this.type = null;
-            this.#hasMagic = undefined;
-            return [s, mjs_unescape_unescape(this.toString()), false, false];
+            else {
+                hit = p.test(f);
+                this.debug('pattern match', p, f, hit);
+            }
+            if (!hit)
+                return false;
         }
-        // XXX abstract out this map method
-        let bodyDotAllowed = !repeated || allowDot || dot || !ast_startNoDot
-            ? ''
-            : this.#partsToRegExp(true);
-        if (bodyDotAllowed === body) {
-            bodyDotAllowed = '';
+        // Note: ending in / means that we'll get a final ""
+        // at the end of the pattern.  This can only match a
+        // corresponding "" at the end of the file.
+        // If the file ends in /, then it can only match a
+        // a pattern that ends in /, unless the pattern just
+        // doesn't have any more for it. But, a/b/ should *not*
+        // match "a/b/*", even though "" matches against the
+        // [^/]*? pattern, except in partial mode, where it might
+        // simply not be reached yet.
+        // However, a/b/ should still satisfy a/*
+        // now either we fell off the end of the pattern, or we're done.
+        if (fi === fl && pi === pl) {
+            // ran out of pattern and filename at the same time.
+            // an exact hit!
+            return true;
         }
-        if (bodyDotAllowed) {
-            body = `(?:${body})(?:${bodyDotAllowed})*?`;
+        else if (fi === fl) {
+            // ran out of file, but still had pattern left.
+            // this is ok if we're doing the match as part of
+            // a glob fs traversal.
+            return partial;
         }
-        // an empty !() is exactly equivalent to a starNoEmpty
-        let final = '';
-        if (this.type === '!' && this.#emptyExt) {
-            final = (this.isStart() && !dot ? ast_startNoDot : '') + ast_starNoEmpty;
+        else if (pi === pl) {
+            // ran out of pattern, still have file left.
+            // this is only acceptable if we're on the very last
+            // empty segment of a file with a trailing slash.
+            // a/* should match a/b/
+            return fi === fl - 1 && file[fi] === '';
+            /* c8 ignore start */
         }
         else {
-            const close = this.type === '!'
-                ? // !() must match something,but !(x) can match ''
-                    '))' +
-                        (this.isStart() && !dot && !allowDot ? ast_startNoDot : '') +
-                        ast_star +
-                        ')'
-                : this.type === '@'
-                    ? ')'
-                    : this.type === '?'
-                        ? ')?'
-                        : this.type === '+' && bodyDotAllowed
-                            ? ')'
-                            : this.type === '*' && bodyDotAllowed
-                                ? `)?`
-                                : `)${this.type}`;
-            final = start + body + close;
+            // should be unreachable.
+            throw new Error('wtf?');
         }
-        return [
-            final,
-            mjs_unescape_unescape(body),
-            (this.#hasMagic = !!this.#hasMagic),
-            this.#uflag,
-        ];
+        /* c8 ignore stop */
     }
-    #partsToRegExp(dot) {
-        return this.#parts
-            .map(p => {
-            // extglob ASTs should only contain parent ASTs
-            /* c8 ignore start */
-            if (typeof p === 'string') {
-                throw new Error('string type in extglob ast??');
-            }
-            /* c8 ignore stop */
-            // can ignore hasMagic, because extglobs are already always magic
-            const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
-            this.#uflag = this.#uflag || uflag;
-            return re;
+    braceExpand() {
+        return braceExpand(this.pattern, this.options);
+    }
+    parse(pattern) {
+        assertValidPattern(pattern);
+        const options = this.options;
+        // shortcuts
+        if (pattern === '**')
+            return GLOBSTAR;
+        if (pattern === '')
+            return '';
+        // far and away, the most common glob pattern parts are
+        // *, *.*, and *.  Add a fast check method for those.
+        let m;
+        let fastTest = null;
+        if ((m = pattern.match(starRE))) {
+            fastTest = options.dot ? starTestDot : starTest;
+        }
+        else if ((m = pattern.match(starDotExtRE))) {
+            fastTest = (options.nocase
+                ? options.dot
+                    ? starDotExtTestNocaseDot
+                    : starDotExtTestNocase
+                : options.dot
+                    ? starDotExtTestDot
+                    : starDotExtTest)(m[1]);
+        }
+        else if ((m = pattern.match(qmarksRE))) {
+            fastTest = (options.nocase
+                ? options.dot
+                    ? qmarksTestNocaseDot
+                    : qmarksTestNocase
+                : options.dot
+                    ? qmarksTestDot
+                    : qmarksTest)(m);
+        }
+        else if ((m = pattern.match(starDotStarRE))) {
+            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
+        }
+        else if ((m = pattern.match(dotStarRE))) {
+            fastTest = dotStarTest;
+        }
+        const re = AST.fromGlob(pattern, this.options).toMMPattern();
+        return fastTest ? Object.assign(re, { test: fastTest }) : re;
+    }
+    makeRe() {
+        if (this.regexp || this.regexp === false)
+            return this.regexp;
+        // at this point, this.set is a 2d array of partial
+        // pattern strings, or "**".
+        //
+        // It's better to use .match().  This function shouldn't
+        // be used, really, but it's pretty convenient sometimes,
+        // when you just want to work with a regex.
+        const set = this.set;
+        if (!set.length) {
+            this.regexp = false;
+            return this.regexp;
+        }
+        const options = this.options;
+        const twoStar = options.noglobstar
+            ? mjs_star
+            : options.dot
+                ? twoStarDot
+                : twoStarNoDot;
+        const flags = new Set(options.nocase ? ['i'] : []);
+        // regexpify non-globstar patterns
+        // if ** is only item, then we just do one twoStar
+        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
+        // if ** is last, append (\/twoStar|) to previous
+        // if ** is in the middle, append (\/|\/twoStar\/) to previous
+        // then filter out GLOBSTAR symbols
+        let re = set
+            .map(pattern => {
+            const pp = pattern.map(p => {
+                if (p instanceof RegExp) {
+                    for (const f of p.flags.split(''))
+                        flags.add(f);
+                }
+                return typeof p === 'string'
+                    ? mjs_regExpEscape(p)
+                    : p === GLOBSTAR
+                        ? GLOBSTAR
+                        : p._src;
+            });
+            pp.forEach((p, i) => {
+                const next = pp[i + 1];
+                const prev = pp[i - 1];
+                if (p !== GLOBSTAR || prev === GLOBSTAR) {
+                    return;
+                }
+                if (prev === undefined) {
+                    if (next !== undefined && next !== GLOBSTAR) {
+                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
+                    }
+                    else {
+                        pp[i] = twoStar;
+                    }
+                }
+                else if (next === undefined) {
+                    pp[i - 1] = prev + '(?:\\/|' + twoStar + ')?';
+                }
+                else if (next !== GLOBSTAR) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
+                    pp[i + 1] = GLOBSTAR;
+                }
+            });
+            return pp.filter(p => p !== GLOBSTAR).join('/');
         })
-            .filter(p => !(this.isStart() && this.isEnd()) || !!p)
             .join('|');
+        // need to wrap in parens if we had more than one thing with |,
+        // otherwise only the first will be anchored to ^ and the last to $
+        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
+        // must match entire pattern
+        // ending in a * or ** will make it less strict.
+        re = '^' + open + re + close + '$';
+        // can match anything, as long as it's not this.
+        if (this.negate)
+            re = '^(?!' + re + ').+$';
+        try {
+            this.regexp = new RegExp(re, [...flags].join(''));
+            /* c8 ignore start */
+        }
+        catch (ex) {
+            // should be impossible
+            this.regexp = false;
+        }
+        /* c8 ignore stop */
+        return this.regexp;
     }
-    static #parseGlob(glob, hasMagic, noEmpty = false) {
-        let escaping = false;
-        let re = '';
-        let uflag = false;
-        for (let i = 0; i < glob.length; i++) {
-            const c = glob.charAt(i);
-            if (escaping) {
-                escaping = false;
-                re += (ast_reSpecials.has(c) ? '\\' : '') + c;
-                continue;
+    slashSplit(p) {
+        // if p starts with // on windows, we preserve that
+        // so that UNC paths aren't broken.  Otherwise, any number of
+        // / characters are coalesced into one, unless
+        // preserveMultipleSlashes is set to true.
+        if (this.preserveMultipleSlashes) {
+            return p.split('/');
+        }
+        else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
+            // add an extra '' for the one we lose
+            return ['', ...p.split(/\/+/)];
+        }
+        else {
+            return p.split(/\/+/);
+        }
+    }
+    match(f, partial = this.partial) {
+        this.debug('match', f, this.pattern);
+        // short-circuit in the case of busted things.
+        // comments, etc.
+        if (this.comment) {
+            return false;
+        }
+        if (this.empty) {
+            return f === '';
+        }
+        if (f === '/' && partial) {
+            return true;
+        }
+        const options = this.options;
+        // windows: need to use /, not \
+        if (this.isWindows) {
+            f = f.split('\\').join('/');
+        }
+        // treat the test path as a set of pathparts.
+        const ff = this.slashSplit(f);
+        this.debug(this.pattern, 'split', ff);
+        // just ONE of the pattern sets in this.set needs to match
+        // in order for it to be valid.  If negating, then just one
+        // match means that we have failed.
+        // Either way, return on the first hit.
+        const set = this.set;
+        this.debug(this.pattern, 'set', set);
+        // Find the basename of the path by looking for the last non-empty segment
+        let filename = ff[ff.length - 1];
+        if (!filename) {
+            for (let i = ff.length - 2; !filename && i >= 0; i--) {
+                filename = ff[i];
             }
-            if (c === '\\') {
-                if (i === glob.length - 1) {
-                    re += '\\\\';
-                }
-                else {
-                    escaping = true;
-                }
-                continue;
+        }
+        for (let i = 0; i < set.length; i++) {
+            const pattern = set[i];
+            let file = ff;
+            if (options.matchBase && pattern.length === 1) {
+                file = [filename];
             }
-            if (c === '[') {
-                const [src, needUflag, consumed, magic] = brace_expressions_parseClass(glob, i);
-                if (consumed) {
-                    re += src;
-                    uflag = uflag || needUflag;
-                    i += consumed - 1;
-                    hasMagic = hasMagic || magic;
-                    continue;
+            const hit = this.matchOne(file, pattern, partial);
+            if (hit) {
+                if (options.flipNegate) {
+                    return true;
                 }
+                return !this.negate;
             }
-            if (c === '*') {
-                if (noEmpty && glob === '*')
-                    re += ast_starNoEmpty;
-                else
-                    re += ast_star;
-                hasMagic = true;
-                continue;
+        }
+        // didn't get any hits.  this is success if it's a negative
+        // pattern, failure otherwise.
+        if (options.flipNegate) {
+            return false;
+        }
+        return this.negate;
+    }
+    static defaults(def) {
+        return mjs_minimatch.defaults(def).Minimatch;
+    }
+}
+/* c8 ignore start */
+
+
+
+/* c8 ignore stop */
+mjs_minimatch.AST = AST;
+mjs_minimatch.Minimatch = Minimatch;
+mjs_minimatch.escape = escape_escape;
+mjs_minimatch.unescape = unescape_unescape;
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/node_modules/it-glob/dist/src/index.js
+/**
+ * @packageDocumentation
+ *
+ * Like [`glob`](https://npmjs.com/package/glob) but async iterable.
+ *
+ * @example
+ *
+ * ```javascript
+ * import glob from 'it-glob'
+ *
+ * const options = {
+ *   cwd // defaults to process.cwd
+ *   absolute // return absolute paths, defaults to false
+ *   nodir // only yield file paths, skip directories
+ *
+ *   // all other options are passed to minimatch
+ * }
+ *
+ * for await (const path of glob('/path/to/file', '**\/*', options)) {
+ *  console.info(path)
+ * }
+ * ```
+ *
+ * See the [minimatch docs](https://www.npmjs.com/package/minimatch#options) for the full list of options.
+ */
+
+
+
+/**
+ * Async iterable filename pattern matcher
+ */
+async function* src_glob(dir, pattern, options = {}) {
+    const absoluteDir = path.resolve(dir);
+    const relativeDir = path.relative(options.cwd ?? process.cwd(), dir);
+    const stats = await fs.stat(absoluteDir);
+    if (stats.isDirectory()) {
+        for await (const entry of _glob(absoluteDir, '', pattern, options)) {
+            yield entry;
+        }
+        return;
+    }
+    if (minimatch(relativeDir, pattern, options)) {
+        yield options.absolute === true ? absoluteDir : relativeDir;
+    }
+}
+async function* _glob(base, dir, pattern, options) {
+    for await (const entry of await fs.opendir(path.join(base, dir))) {
+        const relativeEntryPath = path.join(dir, entry.name);
+        const absoluteEntryPath = path.join(base, dir, entry.name);
+        let match = minimatch(relativeEntryPath, pattern, options);
+        const isDirectory = entry.isDirectory();
+        if (isDirectory && options.nodir === true) {
+            match = false;
+        }
+        if (match) {
+            yield options.absolute === true ? absoluteEntryPath : relativeEntryPath;
+        }
+        if (isDirectory) {
+            yield* _glob(base, relativeEntryPath, pattern, options);
+        }
+    }
+}
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/utils/glob-source.js
+
+
+
+
+
+
+/**
+ * Create an async iterator that yields paths that match requested glob pattern
+ */
+async function* glob_source_globSource(cwd, pattern, options = {}) {
+    if (typeof pattern !== 'string') {
+        throw new InvalidParametersError('Pattern must be a string');
+    }
+    if (!Path.isAbsolute(cwd)) {
+        cwd = Path.resolve(process.cwd(), cwd);
+    }
+    const globOptions = Object.assign({}, {
+        nodir: false,
+        realpath: false,
+        absolute: true,
+        dot: Boolean(options.hidden),
+        follow: options.followSymlinks != null ? options.followSymlinks : true
+    });
+    for await (const p of glob(cwd, pattern, globOptions)) {
+        const stat = await fsp.stat(p);
+        let mode = options.mode;
+        if (options.preserveMode === true) {
+            mode = stat.mode;
+        }
+        let mtime = options.mtime;
+        if (options.preserveMtime === true) {
+            mtime = stat.mtime;
+        }
+        yield {
+            path: toPosix(p.replace(cwd, '')),
+            content: stat.isFile() ? fs.createReadStream(p) : undefined,
+            mode,
+            mtime: toMtime(mtime)
+        };
+    }
+}
+const toPosix = (path) => path.replace(/\\/g, '/');
+//# sourceMappingURL=glob-source.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/utils/url-source.js
+
+function urlSource(url, options) {
+    return {
+        path: decodeURIComponent(new URL(url).pathname.split('/').pop() ?? ''),
+        content: readURLContent(url, options)
+    };
+}
+async function* readURLContent(url, options) {
+    const response = await globalThis.fetch(url, options);
+    if (response.body == null) {
+        throw new UnknownError('HTTP response did not have a body');
+    }
+    const reader = response.body.getReader();
+    try {
+        while (true) {
+            const { done, value } = await reader.read();
+            if (done) {
+                return;
             }
-            if (c === '?') {
-                re += ast_qmark;
-                hasMagic = true;
-                continue;
+            if (value != null) {
+                yield value;
             }
-            re += ast_regExpEscape(c);
         }
-        return [re, mjs_unescape_unescape(glob), !!hasMagic, uflag];
+    }
+    finally {
+        reader.releaseLock();
     }
 }
-//# sourceMappingURL=ast.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/minimatch/dist/mjs/escape.js
+//# sourceMappingURL=url-source.js.map
+;// CONCATENATED MODULE: ./node_modules/@helia/unixfs/dist/src/index.js
 /**
- * Escape all magic characters in a glob pattern.
+ * @packageDocumentation
  *
- * If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape}
- * option is used, then characters are escaped by wrapping in `[]`, because
- * a magic character wrapped in a character class can only be satisfied by
- * that exact character.  In this mode, `\` is _not_ escaped, because it is
- * not interpreted as a magic character, but instead as a path separator.
+ * `@helia/unixfs` is an implementation of a {@link https://github.com/ipfs/specs/blob/main/UNIXFS.md UnixFS filesystem} compatible with {@link https://github.com/ipfs/helia Helia}.
+ *
+ * See the {@link UnixFS UnixFS interface} for all available operations.
+ *
+ * @example
+ *
+ * ```typescript
+ * import { createHelia } from 'helia'
+ * import { unixfs } from '@helia/unixfs'
+ *
+ * const helia = createHelia({
+ *   // ... helia config
+ * })
+ * const fs = unixfs(helia)
+ *
+ * // create an empty dir and a file, then add the file to the dir
+ * const emptyDirCid = await fs.addDirectory()
+ * const fileCid = await fs.addBytes(Uint8Array.from([0, 1, 2, 3]))
+ * const updateDirCid = await fs.cp(fileCid, emptyDirCid, 'foo.txt')
+ *
+ * // or doing the same thing as a stream
+ * for await (const entry of fs.addAll([{
+ *   path: 'foo.txt',
+ *   content: Uint8Array.from([0, 1, 2, 3])
+ * }])) {
+ *   console.info(entry)
+ * }
+ * ```
+ *
+ * @example
+ *
+ * Recursively adding a directory (Node.js-compatibly environments only):
+ *
+ * ```typescript
+ * import { globSource } from '@helia/unixfs'
+ *
+ * for await (const entry of fs.addAll(globSource('path/to/containing/dir', 'glob-pattern'))) {
+ *   console.info(entry)
+ * }
+ * ```
  */
-const mjs_escape_escape = (s, { windowsPathsNoEscape = false, } = {}) => {
-    // don't need to escape +@! because we escape the parens
-    // that make those magic, and escaping ! as [!] isn't valid,
-    // because [!]] is a valid glob class meaning not ']'.
-    return windowsPathsNoEscape
-        ? s.replace(/[?*()[\]]/g, '[$&]')
-        : s.replace(/[?*()[\]\\]/g, '\\$&');
-};
-//# sourceMappingURL=escape.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/minimatch/dist/mjs/index.js
 
 
 
 
 
-const dist_mjs_minimatch = (p, pattern, options = {}) => {
-    assert_valid_pattern_assertValidPattern(pattern);
-    // shortcut: comments match nothing.
-    if (!options.nocomment && pattern.charAt(0) === '#') {
+
+
+
+
+class DefaultUnixFS {
+    components;
+    constructor(components) {
+        this.components = components;
+    }
+    async *addAll(source, options = {}) {
+        yield* addAll(source, this.components.blockstore, options);
+    }
+    async addBytes(bytes, options = {}) {
+        return addBytes(bytes, this.components.blockstore, options);
+    }
+    async addByteStream(bytes, options = {}) {
+        return addByteStream(bytes, this.components.blockstore, options);
+    }
+    async addFile(file, options = {}) {
+        return addFile(file, this.components.blockstore, options);
+    }
+    async addDirectory(dir = {}, options = {}) {
+        return addDirectory(dir, this.components.blockstore, options);
+    }
+    async *cat(cid, options = {}) {
+        yield* cat(cid, this.components.blockstore, options);
+    }
+    async chmod(cid, mode, options = {}) {
+        return chmod(cid, mode, this.components.blockstore, options);
+    }
+    async cp(source, target, name, options = {}) {
+        return cp(source, target, name, this.components.blockstore, options);
+    }
+    async *ls(cid, options = {}) {
+        yield* ls(cid, this.components.blockstore, options);
+    }
+    async mkdir(cid, dirname, options = {}) {
+        return mkdir(cid, dirname, this.components.blockstore, options);
+    }
+    async rm(cid, path, options = {}) {
+        return rm(cid, path, this.components.blockstore, options);
+    }
+    async stat(cid, options = {}) {
+        return stat(cid, this.components.blockstore, options);
+    }
+    async touch(cid, options = {}) {
+        return touch(cid, this.components.blockstore, options);
+    }
+}
+/**
+ * Create a {@link UnixFS} instance for use with {@link https://github.com/ipfs/helia Helia}
+ */
+function unixfs(helia) {
+    return new DefaultUnixFS(helia);
+}
+
+
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: external "node:fs/promises"
+const external_node_fs_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs/promises");
+// EXTERNAL MODULE: external "node:util"
+var external_node_util_ = __nccwpck_require__(47261);
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/dist/src/errors.js
+
+function openFailedError(err) {
+    err = err ?? new Error('Open failed');
+    return err_code(err, 'ERR_OPEN_FAILED');
+}
+function closeFailedError(err) {
+    err = err ?? new Error('Close failed');
+    return err_code(err, 'ERR_CLOSE_FAILED');
+}
+function putFailedError(err) {
+    err = err ?? new Error('Put failed');
+    return err_code(err, 'ERR_PUT_FAILED');
+}
+function getFailedError(err) {
+    err = err ?? new Error('Get failed');
+    return err_code(err, 'ERR_GET_FAILED');
+}
+function deleteFailedError(err) {
+    err = err ?? new Error('Delete failed');
+    return err_code(err, 'ERR_DELETE_FAILED');
+}
+function hasFailedError(err) {
+    err = err ?? new Error('Has failed');
+    return err_code(err, 'ERR_HAS_FAILED');
+}
+function notFoundError(err) {
+    err = err ?? new Error('Not Found');
+    return err_code(err, 'ERR_NOT_FOUND');
+}
+function abortedError(err) {
+    err = err ?? new Error('Aborted');
+    return err_code(err, 'ERR_ABORTED');
+}
+//# sourceMappingURL=errors.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/bytes.js
+const blockstore_core_node_modules_multiformats_dist_src_bytes_empty = new Uint8Array(0);
+function blockstore_core_node_modules_multiformats_dist_src_bytes_toHex(d) {
+    return d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '');
+}
+function blockstore_core_node_modules_multiformats_dist_src_bytes_fromHex(hex) {
+    const hexes = hex.match(/../g);
+    return hexes != null ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : blockstore_core_node_modules_multiformats_dist_src_bytes_empty;
+}
+function blockstore_core_node_modules_multiformats_dist_src_bytes_equals(aa, bb) {
+    if (aa === bb)
+        return true;
+    if (aa.byteLength !== bb.byteLength) {
         return false;
     }
-    return new mjs_Minimatch(pattern, options).match(p);
-};
-// Optimized checking for the most common glob patterns.
-const mjs_starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
-const mjs_starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);
-const mjs_starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
-const mjs_starDotExtTestNocase = (ext) => {
-    ext = ext.toLowerCase();
-    return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);
-};
-const mjs_starDotExtTestNocaseDot = (ext) => {
-    ext = ext.toLowerCase();
-    return (f) => f.toLowerCase().endsWith(ext);
-};
-const mjs_starDotStarRE = /^\*+\.\*+$/;
-const mjs_starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');
-const mjs_starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');
-const mjs_dotStarRE = /^\.\*+$/;
-const mjs_dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');
-const mjs_starRE = /^\*+$/;
-const mjs_starTest = (f) => f.length !== 0 && !f.startsWith('.');
-const mjs_starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';
-const mjs_qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
-const mjs_qmarksTestNocase = ([$0, ext = '']) => {
-    const noext = mjs_qmarksTestNoExt([$0]);
-    if (!ext)
-        return noext;
-    ext = ext.toLowerCase();
-    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
-};
-const mjs_qmarksTestNocaseDot = ([$0, ext = '']) => {
-    const noext = mjs_qmarksTestNoExtDot([$0]);
-    if (!ext)
-        return noext;
-    ext = ext.toLowerCase();
-    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
-};
-const mjs_qmarksTestDot = ([$0, ext = '']) => {
-    const noext = mjs_qmarksTestNoExtDot([$0]);
-    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
-};
-const mjs_qmarksTest = ([$0, ext = '']) => {
-    const noext = mjs_qmarksTestNoExt([$0]);
-    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
-};
-const mjs_qmarksTestNoExt = ([$0]) => {
-    const len = $0.length;
-    return (f) => f.length === len && !f.startsWith('.');
-};
-const mjs_qmarksTestNoExtDot = ([$0]) => {
-    const len = $0.length;
-    return (f) => f.length === len && f !== '.' && f !== '..';
-};
-/* c8 ignore start */
-const mjs_defaultPlatform = (typeof process === 'object' && process
-    ? (typeof process.env === 'object' &&
-        process.env &&
-        process.env.__MINIMATCH_TESTING_PLATFORM__) ||
-        process.platform
-    : 'posix');
-const dist_mjs_path = {
-    win32: { sep: '\\' },
-    posix: { sep: '/' },
-};
-/* c8 ignore stop */
-const mjs_sep = mjs_defaultPlatform === 'win32' ? dist_mjs_path.win32.sep : dist_mjs_path.posix.sep;
-dist_mjs_minimatch.sep = mjs_sep;
-const mjs_GLOBSTAR = Symbol('globstar **');
-dist_mjs_minimatch.GLOBSTAR = mjs_GLOBSTAR;
-// any single thing other than /
-// don't need to escape / when using new RegExp()
-const dist_mjs_qmark = '[^/]';
-// * => any number of characters
-const dist_mjs_star = dist_mjs_qmark + '*?';
-// ** when dots are allowed.  Anything goes, except .. and .
-// not (^ or / followed by one or two dots followed by $ or /),
-// followed by anything, any number of times.
-const mjs_twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?';
-// not a ^ or / followed by a dot,
-// followed by anything, any number of times.
-const mjs_twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?';
-const dist_mjs_filter = (pattern, options = {}) => (p) => dist_mjs_minimatch(p, pattern, options);
-dist_mjs_minimatch.filter = dist_mjs_filter;
-const mjs_ext = (a, b = {}) => Object.assign({}, a, b);
-const dist_mjs_defaults = (def) => {
-    if (!def || typeof def !== 'object' || !Object.keys(def).length) {
-        return dist_mjs_minimatch;
+    for (let ii = 0; ii < aa.byteLength; ii++) {
+        if (aa[ii] !== bb[ii]) {
+            return false;
+        }
     }
-    const orig = dist_mjs_minimatch;
-    const m = (p, pattern, options = {}) => orig(p, pattern, mjs_ext(def, options));
-    return Object.assign(m, {
-        Minimatch: class Minimatch extends orig.Minimatch {
-            constructor(pattern, options = {}) {
-                super(pattern, mjs_ext(def, options));
-            }
-            static defaults(options) {
-                return orig.defaults(mjs_ext(def, options)).Minimatch;
-            }
-        },
-        AST: class AST extends orig.AST {
-            /* c8 ignore start */
-            constructor(type, parent, options = {}) {
-                super(type, parent, mjs_ext(def, options));
-            }
-            /* c8 ignore stop */
-            static fromGlob(pattern, options = {}) {
-                return orig.AST.fromGlob(pattern, mjs_ext(def, options));
-            }
-        },
-        unescape: (s, options = {}) => orig.unescape(s, mjs_ext(def, options)),
-        escape: (s, options = {}) => orig.escape(s, mjs_ext(def, options)),
-        filter: (pattern, options = {}) => orig.filter(pattern, mjs_ext(def, options)),
-        defaults: (options) => orig.defaults(mjs_ext(def, options)),
-        makeRe: (pattern, options = {}) => orig.makeRe(pattern, mjs_ext(def, options)),
-        braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, mjs_ext(def, options)),
-        match: (list, pattern, options = {}) => orig.match(list, pattern, mjs_ext(def, options)),
-        sep: orig.sep,
-        GLOBSTAR: mjs_GLOBSTAR,
-    });
-};
-dist_mjs_minimatch.defaults = dist_mjs_defaults;
-// Brace expansion:
-// a{b,c}d -> abd acd
-// a{b,}c -> abc ac
-// a{0..3}d -> a0d a1d a2d a3d
-// a{b,c{d,e}f}g -> abg acdfg acefg
-// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
-//
-// Invalid sets are not expanded.
-// a{2..}b -> a{2..}b
-// a{b}c -> a{b}c
-const mjs_braceExpand = (pattern, options = {}) => {
-    assert_valid_pattern_assertValidPattern(pattern);
-    // Thanks to Yeting Li  for
-    // improving this regexp to avoid a ReDOS vulnerability.
-    if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
-        // shortcut. no need to expand.
-        return [pattern];
+    return true;
+}
+function blockstore_core_node_modules_multiformats_dist_src_bytes_coerce(o) {
+    if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array')
+        return o;
+    if (o instanceof ArrayBuffer)
+        return new Uint8Array(o);
+    if (ArrayBuffer.isView(o)) {
+        return new Uint8Array(o.buffer, o.byteOffset, o.byteLength);
     }
-    return node_modules_brace_expansion(pattern);
-};
-dist_mjs_minimatch.braceExpand = mjs_braceExpand;
-// parse a component of the expanded set.
-// At this point, no pattern may contain "/" in it
-// so we're going to return a 2d array, where each entry is the full
-// pattern, split on '/', and then turned into a regular expression.
-// A regexp is made at the end which joins each array with an
-// escaped /, and another full one which joins each regexp with |.
-//
-// Following the lead of Bash 4.1, note that "**" only has special meaning
-// when it is the *only* thing in a path portion.  Otherwise, any series
-// of * is equivalent to a single *.  Globstar behavior is enabled by
-// default, and can be disabled by setting options.noglobstar.
-const mjs_makeRe = (pattern, options = {}) => new mjs_Minimatch(pattern, options).makeRe();
-dist_mjs_minimatch.makeRe = mjs_makeRe;
-const mjs_match = (list, pattern, options = {}) => {
-    const mm = new mjs_Minimatch(pattern, options);
-    list = list.filter(f => mm.match(f));
-    if (mm.options.nonull && !list.length) {
-        list.push(pattern);
+    throw new Error('Unknown type, must be binary type');
+}
+function blockstore_core_node_modules_multiformats_dist_src_bytes_isBinary(o) {
+    return o instanceof ArrayBuffer || ArrayBuffer.isView(o);
+}
+function blockstore_core_node_modules_multiformats_dist_src_bytes_fromString(str) {
+    return new TextEncoder().encode(str);
+}
+function blockstore_core_node_modules_multiformats_dist_src_bytes_toString(b) {
+    return new TextDecoder().decode(b);
+}
+//# sourceMappingURL=bytes.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/vendor/base-x.js
+/* eslint-disable */
+// base-x encoding / decoding
+// Copyright (c) 2018 base-x contributors
+// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
+// Distributed under the MIT software license, see the accompanying
+// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
+/**
+ * @param {string} ALPHABET
+ * @param {any} name
+ */
+function node_modules_multiformats_dist_src_vendor_base_x_base(ALPHABET, name) {
+    if (ALPHABET.length >= 255) {
+        throw new TypeError('Alphabet too long');
     }
-    return list;
-};
-dist_mjs_minimatch.match = mjs_match;
-// replace stuff like \* with *
-const mjs_globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
-const dist_mjs_regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
-class mjs_Minimatch {
-    options;
-    set;
-    pattern;
-    windowsPathsNoEscape;
-    nonegate;
-    negate;
-    comment;
-    empty;
-    preserveMultipleSlashes;
-    partial;
-    globSet;
-    globParts;
-    nocase;
-    isWindows;
-    platform;
-    windowsNoMagicRoot;
-    regexp;
-    constructor(pattern, options = {}) {
-        assert_valid_pattern_assertValidPattern(pattern);
-        options = options || {};
-        this.options = options;
-        this.pattern = pattern;
-        this.platform = options.platform || mjs_defaultPlatform;
-        this.isWindows = this.platform === 'win32';
-        this.windowsPathsNoEscape =
-            !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
-        if (this.windowsPathsNoEscape) {
-            this.pattern = this.pattern.replace(/\\/g, '/');
+    var BASE_MAP = new Uint8Array(256);
+    for (var j = 0; j < BASE_MAP.length; j++) {
+        BASE_MAP[j] = 255;
+    }
+    for (var i = 0; i < ALPHABET.length; i++) {
+        var x = ALPHABET.charAt(i);
+        var xc = x.charCodeAt(0);
+        if (BASE_MAP[xc] !== 255) {
+            throw new TypeError(x + ' is ambiguous');
         }
-        this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
-        this.regexp = null;
-        this.negate = false;
-        this.nonegate = !!options.nonegate;
-        this.comment = false;
-        this.empty = false;
-        this.partial = !!options.partial;
-        this.nocase = !!this.options.nocase;
-        this.windowsNoMagicRoot =
-            options.windowsNoMagicRoot !== undefined
-                ? options.windowsNoMagicRoot
-                : !!(this.isWindows && this.nocase);
-        this.globSet = [];
-        this.globParts = [];
-        this.set = [];
-        // make the set of regexps etc.
-        this.make();
+        BASE_MAP[xc] = i;
     }
-    hasMagic() {
-        if (this.options.magicalBraces && this.set.length > 1) {
-            return true;
+    var BASE = ALPHABET.length;
+    var LEADER = ALPHABET.charAt(0);
+    var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up
+    var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up
+    /**
+     * @param {any[] | Iterable} source
+     */
+    function encode(source) {
+        // @ts-ignore
+        if (source instanceof Uint8Array)
+            ;
+        else if (ArrayBuffer.isView(source)) {
+            source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
         }
-        for (const pattern of this.set) {
-            for (const part of pattern) {
-                if (typeof part !== 'string')
-                    return true;
+        else if (Array.isArray(source)) {
+            source = Uint8Array.from(source);
+        }
+        if (!(source instanceof Uint8Array)) {
+            throw new TypeError('Expected Uint8Array');
+        }
+        if (source.length === 0) {
+            return '';
+        }
+        // Skip & count leading zeroes.
+        var zeroes = 0;
+        var length = 0;
+        var pbegin = 0;
+        var pend = source.length;
+        while (pbegin !== pend && source[pbegin] === 0) {
+            pbegin++;
+            zeroes++;
+        }
+        // Allocate enough space in big-endian base58 representation.
+        var size = ((pend - pbegin) * iFACTOR + 1) >>> 0;
+        var b58 = new Uint8Array(size);
+        // Process the bytes.
+        while (pbegin !== pend) {
+            var carry = source[pbegin];
+            // Apply "b58 = b58 * 256 + ch".
+            var i = 0;
+            for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
+                carry += (256 * b58[it1]) >>> 0;
+                b58[it1] = (carry % BASE) >>> 0;
+                carry = (carry / BASE) >>> 0;
             }
+            if (carry !== 0) {
+                throw new Error('Non-zero carry');
+            }
+            length = i;
+            pbegin++;
+        }
+        // Skip leading zeroes in base58 result.
+        var it2 = size - length;
+        while (it2 !== size && b58[it2] === 0) {
+            it2++;
+        }
+        // Translate the result into a string.
+        var str = LEADER.repeat(zeroes);
+        for (; it2 < size; ++it2) {
+            str += ALPHABET.charAt(b58[it2]);
+        }
+        return str;
+    }
+    /**
+     * @param {string | string[]} source
+     */
+    function decodeUnsafe(source) {
+        if (typeof source !== 'string') {
+            throw new TypeError('Expected String');
         }
-        return false;
-    }
-    debug(..._) { }
-    make() {
-        const pattern = this.pattern;
-        const options = this.options;
-        // empty patterns and comments match nothing.
-        if (!options.nocomment && pattern.charAt(0) === '#') {
-            this.comment = true;
-            return;
+        if (source.length === 0) {
+            return new Uint8Array();
         }
-        if (!pattern) {
-            this.empty = true;
+        var psz = 0;
+        // Skip leading spaces.
+        if (source[psz] === ' ') {
             return;
         }
-        // step 1: figure out negation, etc.
-        this.parseNegate();
-        // step 2: expand braces
-        this.globSet = [...new Set(this.braceExpand())];
-        if (options.debug) {
-            this.debug = (...args) => console.error(...args);
+        // Skip and count leading '1's.
+        var zeroes = 0;
+        var length = 0;
+        while (source[psz] === LEADER) {
+            zeroes++;
+            psz++;
         }
-        this.debug(this.pattern, this.globSet);
-        // step 3: now we have a set, so turn each one into a series of
-        // path-portion matching patterns.
-        // These will be regexps, except in the case of "**", which is
-        // set to the GLOBSTAR object for globstar behavior,
-        // and will not contain any / characters
-        //
-        // First, we preprocess to make the glob pattern sets a bit simpler
-        // and deduped.  There are some perf-killing patterns that can cause
-        // problems with a glob walk, but we can simplify them down a bit.
-        const rawGlobParts = this.globSet.map(s => this.slashSplit(s));
-        this.globParts = this.preprocess(rawGlobParts);
-        this.debug(this.pattern, this.globParts);
-        // glob --> regexps
-        let set = this.globParts.map((s, _, __) => {
-            if (this.isWindows && this.windowsNoMagicRoot) {
-                // check if it's a drive or unc path.
-                const isUNC = s[0] === '' &&
-                    s[1] === '' &&
-                    (s[2] === '?' || !mjs_globMagic.test(s[2])) &&
-                    !mjs_globMagic.test(s[3]);
-                const isDrive = /^[a-z]:/i.test(s[0]);
-                if (isUNC) {
-                    return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))];
-                }
-                else if (isDrive) {
-                    return [s[0], ...s.slice(1).map(ss => this.parse(ss))];
-                }
+        // Allocate enough space in big-endian base256 representation.
+        var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.
+        var b256 = new Uint8Array(size);
+        // Process the characters.
+        while (source[psz]) {
+            // Decode character
+            var carry = BASE_MAP[source.charCodeAt(psz)];
+            // Invalid character
+            if (carry === 255) {
+                return;
             }
-            return s.map(ss => this.parse(ss));
-        });
-        this.debug(this.pattern, set);
-        // filter out everything that didn't compile properly.
-        this.set = set.filter(s => s.indexOf(false) === -1);
-        // do not treat the ? in UNC paths as magic
-        if (this.isWindows) {
-            for (let i = 0; i < this.set.length; i++) {
-                const p = this.set[i];
-                if (p[0] === '' &&
-                    p[1] === '' &&
-                    this.globParts[i][2] === '?' &&
-                    typeof p[3] === 'string' &&
-                    /^[a-z]:$/i.test(p[3])) {
-                    p[2] = '?';
-                }
+            var i = 0;
+            for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
+                carry += (BASE * b256[it3]) >>> 0;
+                b256[it3] = (carry % 256) >>> 0;
+                carry = (carry / 256) >>> 0;
             }
-        }
-        this.debug(this.pattern, this.set);
-    }
-    // various transforms to equivalent pattern sets that are
-    // faster to process in a filesystem walk.  The goal is to
-    // eliminate what we can, and push all ** patterns as far
-    // to the right as possible, even if it increases the number
-    // of patterns that we have to process.
-    preprocess(globParts) {
-        // if we're not in globstar mode, then turn all ** into *
-        if (this.options.noglobstar) {
-            for (let i = 0; i < globParts.length; i++) {
-                for (let j = 0; j < globParts[i].length; j++) {
-                    if (globParts[i][j] === '**') {
-                        globParts[i][j] = '*';
-                    }
-                }
+            if (carry !== 0) {
+                throw new Error('Non-zero carry');
             }
+            length = i;
+            psz++;
         }
-        const { optimizationLevel = 1 } = this.options;
-        if (optimizationLevel >= 2) {
-            // aggressive optimization for the purpose of fs walking
-            globParts = this.firstPhasePreProcess(globParts);
-            globParts = this.secondPhasePreProcess(globParts);
+        // Skip trailing spaces.
+        if (source[psz] === ' ') {
+            return;
         }
-        else if (optimizationLevel >= 1) {
-            // just basic optimizations to remove some .. parts
-            globParts = this.levelOneOptimize(globParts);
+        // Skip leading zeroes in b256.
+        var it4 = size - length;
+        while (it4 !== size && b256[it4] === 0) {
+            it4++;
+        }
+        var vch = new Uint8Array(zeroes + (size - it4));
+        var j = zeroes;
+        while (it4 !== size) {
+            vch[j++] = b256[it4++];
+        }
+        return vch;
+    }
+    /**
+     * @param {string | string[]} string
+     */
+    function decode(string) {
+        var buffer = decodeUnsafe(string);
+        if (buffer) {
+            return buffer;
+        }
+        throw new Error(`Non-${name} character`);
+    }
+    return {
+        encode: encode,
+        decodeUnsafe: decodeUnsafe,
+        decode: decode
+    };
+}
+var node_modules_multiformats_dist_src_vendor_base_x_src = node_modules_multiformats_dist_src_vendor_base_x_base;
+var node_modules_multiformats_dist_src_vendor_base_x_brrp_multiformats_scope_baseX = node_modules_multiformats_dist_src_vendor_base_x_src;
+/* harmony default export */ const blockstore_core_node_modules_multiformats_dist_src_vendor_base_x = (node_modules_multiformats_dist_src_vendor_base_x_brrp_multiformats_scope_baseX);
+//# sourceMappingURL=base-x.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/bases/base.js
+
+
+/**
+ * Class represents both BaseEncoder and MultibaseEncoder meaning it
+ * can be used to encode to multibase or base encode without multibase
+ * prefix.
+ */
+class blockstore_core_node_modules_multiformats_dist_src_bases_base_Encoder {
+    name;
+    prefix;
+    baseEncode;
+    constructor(name, prefix, baseEncode) {
+        this.name = name;
+        this.prefix = prefix;
+        this.baseEncode = baseEncode;
+    }
+    encode(bytes) {
+        if (bytes instanceof Uint8Array) {
+            return `${this.prefix}${this.baseEncode(bytes)}`;
         }
         else {
-            globParts = this.adjascentGlobstarOptimize(globParts);
+            throw Error('Unknown type, must be binary type');
         }
-        return globParts;
     }
-    // just get rid of adjascent ** portions
-    adjascentGlobstarOptimize(globParts) {
-        return globParts.map(parts => {
-            let gs = -1;
-            while (-1 !== (gs = parts.indexOf('**', gs + 1))) {
-                let i = gs;
-                while (parts[i + 1] === '**') {
-                    i++;
-                }
-                if (i !== gs) {
-                    parts.splice(gs, i - gs);
-                }
+}
+/**
+ * Class represents both BaseDecoder and MultibaseDecoder so it could be used
+ * to decode multibases (with matching prefix) or just base decode strings
+ * with corresponding base encoding.
+ */
+class blockstore_core_node_modules_multiformats_dist_src_bases_base_Decoder {
+    name;
+    prefix;
+    baseDecode;
+    prefixCodePoint;
+    constructor(name, prefix, baseDecode) {
+        this.name = name;
+        this.prefix = prefix;
+        /* c8 ignore next 3 */
+        if (prefix.codePointAt(0) === undefined) {
+            throw new Error('Invalid prefix character');
+        }
+        this.prefixCodePoint = prefix.codePointAt(0);
+        this.baseDecode = baseDecode;
+    }
+    decode(text) {
+        if (typeof text === 'string') {
+            if (text.codePointAt(0) !== this.prefixCodePoint) {
+                throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);
             }
-            return parts;
-        });
+            return this.baseDecode(text.slice(this.prefix.length));
+        }
+        else {
+            throw Error('Can only multibase decode strings');
+        }
     }
-    // get rid of adjascent ** and resolve .. portions
-    levelOneOptimize(globParts) {
-        return globParts.map(parts => {
-            parts = parts.reduce((set, part) => {
-                const prev = set[set.length - 1];
-                if (part === '**' && prev === '**') {
-                    return set;
-                }
-                if (part === '..') {
-                    if (prev && prev !== '..' && prev !== '.' && prev !== '**') {
-                        set.pop();
-                        return set;
-                    }
-                }
-                set.push(part);
-                return set;
-            }, []);
-            return parts.length === 0 ? [''] : parts;
-        });
+    or(decoder) {
+        return blockstore_core_node_modules_multiformats_dist_src_bases_base_or(this, decoder);
     }
-    levelTwoFileOptimize(parts) {
-        if (!Array.isArray(parts)) {
-            parts = this.slashSplit(parts);
+}
+class blockstore_core_node_modules_multiformats_dist_src_bases_base_ComposedDecoder {
+    decoders;
+    constructor(decoders) {
+        this.decoders = decoders;
+    }
+    or(decoder) {
+        return blockstore_core_node_modules_multiformats_dist_src_bases_base_or(this, decoder);
+    }
+    decode(input) {
+        const prefix = input[0];
+        const decoder = this.decoders[prefix];
+        if (decoder != null) {
+            return decoder.decode(input);
+        }
+        else {
+            throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`);
         }
-        let didSomething = false;
-        do {
-            didSomething = false;
-            // 
// -> 
/
-            if (!this.preserveMultipleSlashes) {
-                for (let i = 1; i < parts.length - 1; i++) {
-                    const p = parts[i];
-                    // don't squeeze out UNC patterns
-                    if (i === 1 && p === '' && parts[0] === '')
-                        continue;
-                    if (p === '.' || p === '') {
-                        didSomething = true;
-                        parts.splice(i, 1);
-                        i--;
-                    }
-                }
-                if (parts[0] === '.' &&
-                    parts.length === 2 &&
-                    (parts[1] === '.' || parts[1] === '')) {
-                    didSomething = true;
-                    parts.pop();
-                }
-            }
-            // 
/

/../ ->

/
-            let dd = 0;
-            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
-                const p = parts[dd - 1];
-                if (p && p !== '.' && p !== '..' && p !== '**') {
-                    didSomething = true;
-                    parts.splice(dd - 1, 2);
-                    dd -= 2;
-                }
-            }
-        } while (didSomething);
-        return parts.length === 0 ? [''] : parts;
     }
-    // First phase: single-pattern processing
-    // 
 is 1 or more portions
-    //  is 1 or more portions
-    // 

is any portion other than ., .., '', or ** - // is . or '' - // - // **/.. is *brutal* for filesystem walking performance, because - // it effectively resets the recursive walk each time it occurs, - // and ** cannot be reduced out by a .. pattern part like a regexp - // or most strings (other than .., ., and '') can be. - // - //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} - //

// -> 
/
-    // 
/

/../ ->

/
-    // **/**/ -> **/
-    //
-    // **/*/ -> */**/ <== not valid because ** doesn't follow
-    // this WOULD be allowed if ** did follow symlinks, or * didn't
-    firstPhasePreProcess(globParts) {
-        let didSomething = false;
-        do {
-            didSomething = false;
-            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} - for (let parts of globParts) { - let gs = -1; - while (-1 !== (gs = parts.indexOf('**', gs + 1))) { - let gss = gs; - while (parts[gss + 1] === '**') { - //

/**/**/ -> 
/**/
-                        gss++;
-                    }
-                    // eg, if gs is 2 and gss is 4, that means we have 3 **
-                    // parts, and can remove 2 of them.
-                    if (gss > gs) {
-                        parts.splice(gs + 1, gss - gs);
-                    }
-                    let next = parts[gs + 1];
-                    const p = parts[gs + 2];
-                    const p2 = parts[gs + 3];
-                    if (next !== '..')
-                        continue;
-                    if (!p ||
-                        p === '.' ||
-                        p === '..' ||
-                        !p2 ||
-                        p2 === '.' ||
-                        p2 === '..') {
-                        continue;
-                    }
-                    didSomething = true;
-                    // edit parts in place, and push the new one
-                    parts.splice(gs, 1);
-                    const other = parts.slice(0);
-                    other[gs] = '**';
-                    globParts.push(other);
-                    gs--;
-                }
-                // 
// -> 
/
-                if (!this.preserveMultipleSlashes) {
-                    for (let i = 1; i < parts.length - 1; i++) {
-                        const p = parts[i];
-                        // don't squeeze out UNC patterns
-                        if (i === 1 && p === '' && parts[0] === '')
-                            continue;
-                        if (p === '.' || p === '') {
-                            didSomething = true;
-                            parts.splice(i, 1);
-                            i--;
-                        }
-                    }
-                    if (parts[0] === '.' &&
-                        parts.length === 2 &&
-                        (parts[1] === '.' || parts[1] === '')) {
-                        didSomething = true;
-                        parts.pop();
-                    }
-                }
-                // 
/

/../ ->

/
-                let dd = 0;
-                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
-                    const p = parts[dd - 1];
-                    if (p && p !== '.' && p !== '..' && p !== '**') {
-                        didSomething = true;
-                        const needDot = dd === 1 && parts[dd + 1] === '**';
-                        const splin = needDot ? ['.'] : [];
-                        parts.splice(dd - 1, 2, ...splin);
-                        if (parts.length === 0)
-                            parts.push('');
-                        dd -= 2;
-                    }
-                }
-            }
-        } while (didSomething);
-        return globParts;
+}
+function blockstore_core_node_modules_multiformats_dist_src_bases_base_or(left, right) {
+    // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
+    return new blockstore_core_node_modules_multiformats_dist_src_bases_base_ComposedDecoder({
+        ...(left.decoders ?? { [left.prefix]: left }),
+        ...(right.decoders ?? { [right.prefix]: right })
+    });
+}
+class blockstore_core_node_modules_multiformats_dist_src_bases_base_Codec {
+    name;
+    prefix;
+    baseEncode;
+    baseDecode;
+    encoder;
+    decoder;
+    constructor(name, prefix, baseEncode, baseDecode) {
+        this.name = name;
+        this.prefix = prefix;
+        this.baseEncode = baseEncode;
+        this.baseDecode = baseDecode;
+        this.encoder = new blockstore_core_node_modules_multiformats_dist_src_bases_base_Encoder(name, prefix, baseEncode);
+        this.decoder = new blockstore_core_node_modules_multiformats_dist_src_bases_base_Decoder(name, prefix, baseDecode);
     }
-    // second phase: multi-pattern dedupes
-    // {
/*/,
/

/} ->

/*/
-    // {
/,
/} -> 
/
-    // {
/**/,
/} -> 
/**/
-    //
-    // {
/**/,
/**/

/} ->

/**/
-    // ^-- not valid because ** doens't follow symlinks
-    secondPhasePreProcess(globParts) {
-        for (let i = 0; i < globParts.length - 1; i++) {
-            for (let j = i + 1; j < globParts.length; j++) {
-                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
-                if (!matched)
-                    continue;
-                globParts[i] = matched;
-                globParts[j] = [];
-            }
+    encode(input) {
+        return this.encoder.encode(input);
+    }
+    decode(input) {
+        return this.decoder.decode(input);
+    }
+}
+function blockstore_core_node_modules_multiformats_dist_src_bases_base_from({ name, prefix, encode, decode }) {
+    return new blockstore_core_node_modules_multiformats_dist_src_bases_base_Codec(name, prefix, encode, decode);
+}
+function blockstore_core_node_modules_multiformats_dist_src_bases_base_baseX({ name, prefix, alphabet }) {
+    const { encode, decode } = blockstore_core_node_modules_multiformats_dist_src_vendor_base_x(alphabet, name);
+    return blockstore_core_node_modules_multiformats_dist_src_bases_base_from({
+        prefix,
+        name,
+        encode,
+        decode: (text) => blockstore_core_node_modules_multiformats_dist_src_bytes_coerce(decode(text))
+    });
+}
+function blockstore_core_node_modules_multiformats_dist_src_bases_base_decode(string, alphabet, bitsPerChar, name) {
+    // Build the character lookup table:
+    const codes = {};
+    for (let i = 0; i < alphabet.length; ++i) {
+        codes[alphabet[i]] = i;
+    }
+    // Count the padding bytes:
+    let end = string.length;
+    while (string[end - 1] === '=') {
+        --end;
+    }
+    // Allocate the output:
+    const out = new Uint8Array((end * bitsPerChar / 8) | 0);
+    // Parse the data:
+    let bits = 0; // Number of bits currently in the buffer
+    let buffer = 0; // Bits waiting to be written out, MSB first
+    let written = 0; // Next byte to write
+    for (let i = 0; i < end; ++i) {
+        // Read one character from the string:
+        const value = codes[string[i]];
+        if (value === undefined) {
+            throw new SyntaxError(`Non-${name} character`);
+        }
+        // Append the bits to the buffer:
+        buffer = (buffer << bitsPerChar) | value;
+        bits += bitsPerChar;
+        // Write out some bits if the buffer has a byte's worth:
+        if (bits >= 8) {
+            bits -= 8;
+            out[written++] = 0xff & (buffer >> bits);
         }
-        return globParts.filter(gs => gs.length);
     }
-    partsMatch(a, b, emptyGSMatch = false) {
-        let ai = 0;
-        let bi = 0;
-        let result = [];
-        let which = '';
-        while (ai < a.length && bi < b.length) {
-            if (a[ai] === b[bi]) {
-                result.push(which === 'b' ? b[bi] : a[ai]);
-                ai++;
-                bi++;
-            }
-            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
-                result.push(a[ai]);
-                ai++;
-            }
-            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
-                result.push(b[bi]);
-                bi++;
-            }
-            else if (a[ai] === '*' &&
-                b[bi] &&
-                (this.options.dot || !b[bi].startsWith('.')) &&
-                b[bi] !== '**') {
-                if (which === 'b')
-                    return false;
-                which = 'a';
-                result.push(a[ai]);
-                ai++;
-                bi++;
-            }
-            else if (b[bi] === '*' &&
-                a[ai] &&
-                (this.options.dot || !a[ai].startsWith('.')) &&
-                a[ai] !== '**') {
-                if (which === 'a')
-                    return false;
-                which = 'b';
-                result.push(b[bi]);
-                ai++;
-                bi++;
-            }
-            else {
-                return false;
-            }
+    // Verify that we have received just enough bits:
+    if (bits >= bitsPerChar || (0xff & (buffer << (8 - bits))) !== 0) {
+        throw new SyntaxError('Unexpected end of data');
+    }
+    return out;
+}
+function blockstore_core_node_modules_multiformats_dist_src_bases_base_encode(data, alphabet, bitsPerChar) {
+    const pad = alphabet[alphabet.length - 1] === '=';
+    const mask = (1 << bitsPerChar) - 1;
+    let out = '';
+    let bits = 0; // Number of bits currently in the buffer
+    let buffer = 0; // Bits waiting to be written out, MSB first
+    for (let i = 0; i < data.length; ++i) {
+        // Slurp data into the buffer:
+        buffer = (buffer << 8) | data[i];
+        bits += 8;
+        // Write out as much as we can:
+        while (bits > bitsPerChar) {
+            bits -= bitsPerChar;
+            out += alphabet[mask & (buffer >> bits)];
         }
-        // if we fall out of the loop, it means they two are identical
-        // as long as their lengths match
-        return a.length === b.length && result;
     }
-    parseNegate() {
-        if (this.nonegate)
-            return;
-        const pattern = this.pattern;
-        let negate = false;
-        let negateOffset = 0;
-        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
-            negate = !negate;
-            negateOffset++;
+    // Partial character:
+    if (bits !== 0) {
+        out += alphabet[mask & (buffer << (bitsPerChar - bits))];
+    }
+    // Add padding characters until we hit a byte boundary:
+    if (pad) {
+        while (((out.length * bitsPerChar) & 7) !== 0) {
+            out += '=';
         }
-        if (negateOffset)
-            this.pattern = pattern.slice(negateOffset);
-        this.negate = negate;
     }
-    // set partial to true to test if, for example,
-    // "/a/b" matches the start of "/*/b/*/d"
-    // Partial means, if you run out of file before you run
-    // out of pattern, then that's fine, as long as all
-    // the parts match.
-    matchOne(file, pattern, partial = false) {
-        const options = this.options;
-        // UNC paths like //?/X:/... can match X:/... and vice versa
-        // Drive letters in absolute drive or unc paths are always compared
-        // case-insensitively.
-        if (this.isWindows) {
-            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
-            const fileUNC = !fileDrive &&
-                file[0] === '' &&
-                file[1] === '' &&
-                file[2] === '?' &&
-                /^[a-z]:$/i.test(file[3]);
-            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
-            const patternUNC = !patternDrive &&
-                pattern[0] === '' &&
-                pattern[1] === '' &&
-                pattern[2] === '?' &&
-                typeof pattern[3] === 'string' &&
-                /^[a-z]:$/i.test(pattern[3]);
-            const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined;
-            const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined;
-            if (typeof fdi === 'number' && typeof pdi === 'number') {
-                const [fd, pd] = [file[fdi], pattern[pdi]];
-                if (fd.toLowerCase() === pd.toLowerCase()) {
-                    pattern[pdi] = fd;
-                    if (pdi > fdi) {
-                        pattern = pattern.slice(pdi);
-                    }
-                    else if (fdi > pdi) {
-                        file = file.slice(fdi);
-                    }
-                }
-            }
+    return out;
+}
+/**
+ * RFC4648 Factory
+ */
+function blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({ name, prefix, bitsPerChar, alphabet }) {
+    return blockstore_core_node_modules_multiformats_dist_src_bases_base_from({
+        prefix,
+        name,
+        encode(input) {
+            return blockstore_core_node_modules_multiformats_dist_src_bases_base_encode(input, alphabet, bitsPerChar);
+        },
+        decode(input) {
+            return blockstore_core_node_modules_multiformats_dist_src_bases_base_decode(input, alphabet, bitsPerChar, name);
         }
-        // resolve and reduce . and .. portions in the file as well.
-        // dont' need to do the second phase, because it's only one string[]
-        const { optimizationLevel = 1 } = this.options;
-        if (optimizationLevel >= 2) {
-            file = this.levelTwoFileOptimize(file);
+    });
+}
+//# sourceMappingURL=base.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/bases/base32.js
+
+const blockstore_core_node_modules_multiformats_dist_src_bases_base32_base32 = blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({
+    prefix: 'b',
+    name: 'base32',
+    alphabet: 'abcdefghijklmnopqrstuvwxyz234567',
+    bitsPerChar: 5
+});
+const blockstore_core_node_modules_multiformats_dist_src_bases_base32_base32upper = blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({
+    prefix: 'B',
+    name: 'base32upper',
+    alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567',
+    bitsPerChar: 5
+});
+const blockstore_core_node_modules_multiformats_dist_src_bases_base32_base32pad = blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({
+    prefix: 'c',
+    name: 'base32pad',
+    alphabet: 'abcdefghijklmnopqrstuvwxyz234567=',
+    bitsPerChar: 5
+});
+const blockstore_core_node_modules_multiformats_dist_src_bases_base32_base32padupper = blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({
+    prefix: 'C',
+    name: 'base32padupper',
+    alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=',
+    bitsPerChar: 5
+});
+const blockstore_core_node_modules_multiformats_dist_src_bases_base32_base32hex = blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({
+    prefix: 'v',
+    name: 'base32hex',
+    alphabet: '0123456789abcdefghijklmnopqrstuv',
+    bitsPerChar: 5
+});
+const blockstore_core_node_modules_multiformats_dist_src_bases_base32_base32hexupper = blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({
+    prefix: 'V',
+    name: 'base32hexupper',
+    alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV',
+    bitsPerChar: 5
+});
+const blockstore_core_node_modules_multiformats_dist_src_bases_base32_base32hexpad = blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({
+    prefix: 't',
+    name: 'base32hexpad',
+    alphabet: '0123456789abcdefghijklmnopqrstuv=',
+    bitsPerChar: 5
+});
+const blockstore_core_node_modules_multiformats_dist_src_bases_base32_base32hexpadupper = blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({
+    prefix: 'T',
+    name: 'base32hexpadupper',
+    alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=',
+    bitsPerChar: 5
+});
+const blockstore_core_node_modules_multiformats_dist_src_bases_base32_base32z = blockstore_core_node_modules_multiformats_dist_src_bases_base_rfc4648({
+    prefix: 'h',
+    name: 'base32z',
+    alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769',
+    bitsPerChar: 5
+});
+//# sourceMappingURL=base32.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/bases/base58.js
+
+const blockstore_core_node_modules_multiformats_dist_src_bases_base58_base58btc = blockstore_core_node_modules_multiformats_dist_src_bases_base_baseX({
+    name: 'base58btc',
+    prefix: 'z',
+    alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
+});
+const blockstore_core_node_modules_multiformats_dist_src_bases_base58_base58flickr = blockstore_core_node_modules_multiformats_dist_src_bases_base_baseX({
+    name: 'base58flickr',
+    prefix: 'Z',
+    alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'
+});
+//# sourceMappingURL=base58.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/vendor/varint.js
+/* eslint-disable */
+var node_modules_multiformats_dist_src_vendor_varint_encode_1 = blockstore_core_node_modules_multiformats_dist_src_vendor_varint_encode;
+var node_modules_multiformats_dist_src_vendor_varint_MSB = 0x80, node_modules_multiformats_dist_src_vendor_varint_REST = 0x7F, node_modules_multiformats_dist_src_vendor_varint_MSBALL = ~node_modules_multiformats_dist_src_vendor_varint_REST, node_modules_multiformats_dist_src_vendor_varint_INT = Math.pow(2, 31);
+/**
+ * @param {number} num
+ * @param {number[]} out
+ * @param {number} offset
+ */
+function blockstore_core_node_modules_multiformats_dist_src_vendor_varint_encode(num, out, offset) {
+    out = out || [];
+    offset = offset || 0;
+    var oldOffset = offset;
+    while (num >= node_modules_multiformats_dist_src_vendor_varint_INT) {
+        out[offset++] = (num & 0xFF) | node_modules_multiformats_dist_src_vendor_varint_MSB;
+        num /= 128;
+    }
+    while (num & node_modules_multiformats_dist_src_vendor_varint_MSBALL) {
+        out[offset++] = (num & 0xFF) | node_modules_multiformats_dist_src_vendor_varint_MSB;
+        num >>>= 7;
+    }
+    out[offset] = num | 0;
+    // @ts-ignore
+    blockstore_core_node_modules_multiformats_dist_src_vendor_varint_encode.bytes = offset - oldOffset + 1;
+    return out;
+}
+var blockstore_core_node_modules_multiformats_dist_src_vendor_varint_decode = node_modules_multiformats_dist_src_vendor_varint_read;
+var node_modules_multiformats_dist_src_vendor_varint_MSB$1 = 0x80, node_modules_multiformats_dist_src_vendor_varint_REST$1 = 0x7F;
+/**
+ * @param {string | any[]} buf
+ * @param {number} offset
+ */
+function node_modules_multiformats_dist_src_vendor_varint_read(buf, offset) {
+    var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length;
+    do {
+        if (counter >= l) {
+            // @ts-ignore
+            node_modules_multiformats_dist_src_vendor_varint_read.bytes = 0;
+            throw new RangeError('Could not decode varint');
         }
-        this.debug('matchOne', this, { file, pattern });
-        this.debug('matchOne', file.length, pattern.length);
-        for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
-            this.debug('matchOne loop');
-            var p = pattern[pi];
-            var f = file[fi];
-            this.debug(pattern, p, f);
-            // should be impossible.
-            // some invalid regexp stuff in the set.
-            /* c8 ignore start */
-            if (p === false) {
-                return false;
-            }
-            /* c8 ignore stop */
-            if (p === mjs_GLOBSTAR) {
-                this.debug('GLOBSTAR', [pattern, p, f]);
-                // "**"
-                // a/**/b/**/c would match the following:
-                // a/b/x/y/z/c
-                // a/x/y/z/b/c
-                // a/b/x/b/x/c
-                // a/b/c
-                // To do this, take the rest of the pattern after
-                // the **, and see if it would match the file remainder.
-                // If so, return success.
-                // If not, the ** "swallows" a segment, and try again.
-                // This is recursively awful.
-                //
-                // a/**/b/**/c matching a/b/x/y/z/c
-                // - a matches a
-                // - doublestar
-                //   - matchOne(b/x/y/z/c, b/**/c)
-                //     - b matches b
-                //     - doublestar
-                //       - matchOne(x/y/z/c, c) -> no
-                //       - matchOne(y/z/c, c) -> no
-                //       - matchOne(z/c, c) -> no
-                //       - matchOne(c, c) yes, hit
-                var fr = fi;
-                var pr = pi + 1;
-                if (pr === pl) {
-                    this.debug('** at the end');
-                    // a ** at the end will just swallow the rest.
-                    // We have found a match.
-                    // however, it will not swallow /.x, unless
-                    // options.dot is set.
-                    // . and .. are *never* matched by **, for explosively
-                    // exponential reasons.
-                    for (; fi < fl; fi++) {
-                        if (file[fi] === '.' ||
-                            file[fi] === '..' ||
-                            (!options.dot && file[fi].charAt(0) === '.'))
-                            return false;
-                    }
-                    return true;
-                }
-                // ok, let's see if we can swallow whatever we can.
-                while (fr < fl) {
-                    var swallowee = file[fr];
-                    this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);
-                    // XXX remove this slice.  Just pass the start index.
-                    if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
-                        this.debug('globstar found match!', fr, fl, swallowee);
-                        // found a match.
-                        return true;
-                    }
-                    else {
-                        // can't swallow "." or ".." ever.
-                        // can only swallow ".foo" when explicitly asked.
-                        if (swallowee === '.' ||
-                            swallowee === '..' ||
-                            (!options.dot && swallowee.charAt(0) === '.')) {
-                            this.debug('dot detected!', file, fr, pattern, pr);
-                            break;
-                        }
-                        // ** swallows a segment, and continue.
-                        this.debug('globstar swallow a segment, and continue');
-                        fr++;
-                    }
-                }
-                // no match was found.
-                // However, in partial mode, we can't say this is necessarily over.
-                /* c8 ignore start */
-                if (partial) {
-                    // ran out of file
-                    this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
-                    if (fr === fl) {
-                        return true;
-                    }
-                }
-                /* c8 ignore stop */
-                return false;
+        b = buf[counter++];
+        res += shift < 28
+            ? (b & node_modules_multiformats_dist_src_vendor_varint_REST$1) << shift
+            : (b & node_modules_multiformats_dist_src_vendor_varint_REST$1) * Math.pow(2, shift);
+        shift += 7;
+    } while (b >= node_modules_multiformats_dist_src_vendor_varint_MSB$1);
+    // @ts-ignore
+    node_modules_multiformats_dist_src_vendor_varint_read.bytes = counter - offset;
+    return res;
+}
+var node_modules_multiformats_dist_src_vendor_varint_N1 = Math.pow(2, 7);
+var node_modules_multiformats_dist_src_vendor_varint_N2 = Math.pow(2, 14);
+var node_modules_multiformats_dist_src_vendor_varint_N3 = Math.pow(2, 21);
+var node_modules_multiformats_dist_src_vendor_varint_N4 = Math.pow(2, 28);
+var node_modules_multiformats_dist_src_vendor_varint_N5 = Math.pow(2, 35);
+var node_modules_multiformats_dist_src_vendor_varint_N6 = Math.pow(2, 42);
+var node_modules_multiformats_dist_src_vendor_varint_N7 = Math.pow(2, 49);
+var node_modules_multiformats_dist_src_vendor_varint_N8 = Math.pow(2, 56);
+var node_modules_multiformats_dist_src_vendor_varint_N9 = Math.pow(2, 63);
+var blockstore_core_node_modules_multiformats_dist_src_vendor_varint_length = function (/** @type {number} */ value) {
+    return (value < node_modules_multiformats_dist_src_vendor_varint_N1 ? 1
+        : value < node_modules_multiformats_dist_src_vendor_varint_N2 ? 2
+            : value < node_modules_multiformats_dist_src_vendor_varint_N3 ? 3
+                : value < node_modules_multiformats_dist_src_vendor_varint_N4 ? 4
+                    : value < node_modules_multiformats_dist_src_vendor_varint_N5 ? 5
+                        : value < node_modules_multiformats_dist_src_vendor_varint_N6 ? 6
+                            : value < node_modules_multiformats_dist_src_vendor_varint_N7 ? 7
+                                : value < node_modules_multiformats_dist_src_vendor_varint_N8 ? 8
+                                    : value < node_modules_multiformats_dist_src_vendor_varint_N9 ? 9
+                                        : 10);
+};
+var blockstore_core_node_modules_multiformats_dist_src_vendor_varint_varint = {
+    encode: node_modules_multiformats_dist_src_vendor_varint_encode_1,
+    decode: blockstore_core_node_modules_multiformats_dist_src_vendor_varint_decode,
+    encodingLength: blockstore_core_node_modules_multiformats_dist_src_vendor_varint_length
+};
+var node_modules_multiformats_dist_src_vendor_varint_brrp_varint = (/* unused pure expression or super */ null && (blockstore_core_node_modules_multiformats_dist_src_vendor_varint_varint));
+/* harmony default export */ const blockstore_core_node_modules_multiformats_dist_src_vendor_varint = ((/* unused pure expression or super */ null && (node_modules_multiformats_dist_src_vendor_varint_brrp_varint)));
+//# sourceMappingURL=varint.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/varint.js
+
+function blockstore_core_node_modules_multiformats_dist_src_varint_decode(data, offset = 0) {
+    const code = varint.decode(data, offset);
+    return [code, varint.decode.bytes];
+}
+function blockstore_core_node_modules_multiformats_dist_src_varint_encodeTo(int, target, offset = 0) {
+    varint.encode(int, target, offset);
+    return target;
+}
+function blockstore_core_node_modules_multiformats_dist_src_varint_encodingLength(int) {
+    return varint.encodingLength(int);
+}
+//# sourceMappingURL=varint.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/hashes/digest.js
+
+
+/**
+ * Creates a multihash digest.
+ */
+function blockstore_core_node_modules_multiformats_dist_src_hashes_digest_create(code, digest) {
+    const size = digest.byteLength;
+    const sizeOffset = varint.encodingLength(code);
+    const digestOffset = sizeOffset + varint.encodingLength(size);
+    const bytes = new Uint8Array(digestOffset + size);
+    varint.encodeTo(code, bytes, 0);
+    varint.encodeTo(size, bytes, sizeOffset);
+    bytes.set(digest, digestOffset);
+    return new blockstore_core_node_modules_multiformats_dist_src_hashes_digest_Digest(code, size, digest, bytes);
+}
+/**
+ * Turns bytes representation of multihash digest into an instance.
+ */
+function blockstore_core_node_modules_multiformats_dist_src_hashes_digest_decode(multihash) {
+    const bytes = coerce(multihash);
+    const [code, sizeOffset] = varint.decode(bytes);
+    const [size, digestOffset] = varint.decode(bytes.subarray(sizeOffset));
+    const digest = bytes.subarray(sizeOffset + digestOffset);
+    if (digest.byteLength !== size) {
+        throw new Error('Incorrect length');
+    }
+    return new blockstore_core_node_modules_multiformats_dist_src_hashes_digest_Digest(code, size, digest, bytes);
+}
+function blockstore_core_node_modules_multiformats_dist_src_hashes_digest_equals(a, b) {
+    if (a === b) {
+        return true;
+    }
+    else {
+        const data = b;
+        return (a.code === data.code &&
+            a.size === data.size &&
+            data.bytes instanceof Uint8Array &&
+            equalBytes(a.bytes, data.bytes));
+    }
+}
+/**
+ * Represents a multihash digest which carries information about the
+ * hashing algorithm and an actual hash digest.
+ */
+class blockstore_core_node_modules_multiformats_dist_src_hashes_digest_Digest {
+    code;
+    size;
+    digest;
+    bytes;
+    /**
+     * Creates a multihash digest.
+     */
+    constructor(code, size, digest, bytes) {
+        this.code = code;
+        this.size = size;
+        this.digest = digest;
+        this.bytes = bytes;
+    }
+}
+//# sourceMappingURL=digest.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/cid.js
+
+
+
+
+
+// This way TS will also expose all the types from module
+
+function blockstore_core_node_modules_multiformats_dist_src_cid_format(link, base) {
+    const { bytes, version } = link;
+    switch (version) {
+        case 0:
+            return blockstore_core_node_modules_multiformats_dist_src_cid_toStringV0(bytes, blockstore_core_node_modules_multiformats_dist_src_cid_baseCache(link), base ?? base58btc.encoder);
+        default:
+            return blockstore_core_node_modules_multiformats_dist_src_cid_toStringV1(bytes, blockstore_core_node_modules_multiformats_dist_src_cid_baseCache(link), (base ?? base32.encoder));
+    }
+}
+function blockstore_core_node_modules_multiformats_dist_src_cid_toJSON(link) {
+    return {
+        '/': blockstore_core_node_modules_multiformats_dist_src_cid_format(link)
+    };
+}
+function blockstore_core_node_modules_multiformats_dist_src_cid_fromJSON(json) {
+    return blockstore_core_node_modules_multiformats_dist_src_cid_CID.parse(json['/']);
+}
+const blockstore_core_node_modules_multiformats_dist_src_cid_cache = new WeakMap();
+function blockstore_core_node_modules_multiformats_dist_src_cid_baseCache(cid) {
+    const baseCache = blockstore_core_node_modules_multiformats_dist_src_cid_cache.get(cid);
+    if (baseCache == null) {
+        const baseCache = new Map();
+        blockstore_core_node_modules_multiformats_dist_src_cid_cache.set(cid, baseCache);
+        return baseCache;
+    }
+    return baseCache;
+}
+class blockstore_core_node_modules_multiformats_dist_src_cid_CID {
+    code;
+    version;
+    multihash;
+    bytes;
+    '/';
+    /**
+     * @param version - Version of the CID
+     * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv
+     * @param multihash - (Multi)hash of the of the content.
+     */
+    constructor(version, code, multihash, bytes) {
+        this.code = code;
+        this.version = version;
+        this.multihash = multihash;
+        this.bytes = bytes;
+        // flag to serializers that this is a CID and
+        // should be treated specially
+        this['/'] = bytes;
+    }
+    /**
+     * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes`
+     * please either use `CID.asCID(cid)` or switch to new signalling mechanism
+     *
+     * @deprecated
+     */
+    get asCID() {
+        return this;
+    }
+    // ArrayBufferView
+    get byteOffset() {
+        return this.bytes.byteOffset;
+    }
+    // ArrayBufferView
+    get byteLength() {
+        return this.bytes.byteLength;
+    }
+    toV0() {
+        switch (this.version) {
+            case 0: {
+                return this;
             }
-            // something other than **
-            // non-magic patterns just have to match exactly
-            // patterns with magic have been turned into regexps.
-            let hit;
-            if (typeof p === 'string') {
-                hit = f === p;
-                this.debug('string match', p, f, hit);
+            case 1: {
+                const { code, multihash } = this;
+                if (code !== blockstore_core_node_modules_multiformats_dist_src_cid_DAG_PB_CODE) {
+                    throw new Error('Cannot convert a non dag-pb CID to CIDv0');
+                }
+                // sha2-256
+                if (multihash.code !== blockstore_core_node_modules_multiformats_dist_src_cid_SHA_256_CODE) {
+                    throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0');
+                }
+                return (blockstore_core_node_modules_multiformats_dist_src_cid_CID.createV0(multihash));
             }
-            else {
-                hit = p.test(f);
-                this.debug('pattern match', p, f, hit);
+            default: {
+                throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`);
             }
-            if (!hit)
-                return false;
-        }
-        // Note: ending in / means that we'll get a final ""
-        // at the end of the pattern.  This can only match a
-        // corresponding "" at the end of the file.
-        // If the file ends in /, then it can only match a
-        // a pattern that ends in /, unless the pattern just
-        // doesn't have any more for it. But, a/b/ should *not*
-        // match "a/b/*", even though "" matches against the
-        // [^/]*? pattern, except in partial mode, where it might
-        // simply not be reached yet.
-        // However, a/b/ should still satisfy a/*
-        // now either we fell off the end of the pattern, or we're done.
-        if (fi === fl && pi === pl) {
-            // ran out of pattern and filename at the same time.
-            // an exact hit!
-            return true;
-        }
-        else if (fi === fl) {
-            // ran out of file, but still had pattern left.
-            // this is ok if we're doing the match as part of
-            // a glob fs traversal.
-            return partial;
-        }
-        else if (pi === pl) {
-            // ran out of pattern, still have file left.
-            // this is only acceptable if we're on the very last
-            // empty segment of a file with a trailing slash.
-            // a/* should match a/b/
-            return fi === fl - 1 && file[fi] === '';
-            /* c8 ignore start */
         }
-        else {
-            // should be unreachable.
-            throw new Error('wtf?');
+    }
+    toV1() {
+        switch (this.version) {
+            case 0: {
+                const { code, digest } = this.multihash;
+                const multihash = Digest.create(code, digest);
+                return (blockstore_core_node_modules_multiformats_dist_src_cid_CID.createV1(this.code, multihash));
+            }
+            case 1: {
+                return this;
+            }
+            default: {
+                throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`);
+            }
         }
-        /* c8 ignore stop */
     }
-    braceExpand() {
-        return mjs_braceExpand(this.pattern, this.options);
+    equals(other) {
+        return blockstore_core_node_modules_multiformats_dist_src_cid_CID.equals(this, other);
     }
-    parse(pattern) {
-        assert_valid_pattern_assertValidPattern(pattern);
-        const options = this.options;
-        // shortcuts
-        if (pattern === '**')
-            return mjs_GLOBSTAR;
-        if (pattern === '')
-            return '';
-        // far and away, the most common glob pattern parts are
-        // *, *.*, and *.  Add a fast check method for those.
-        let m;
-        let fastTest = null;
-        if ((m = pattern.match(mjs_starRE))) {
-            fastTest = options.dot ? mjs_starTestDot : mjs_starTest;
+    static equals(self, other) {
+        const unknown = other;
+        return (unknown != null &&
+            self.code === unknown.code &&
+            self.version === unknown.version &&
+            Digest.equals(self.multihash, unknown.multihash));
+    }
+    toString(base) {
+        return blockstore_core_node_modules_multiformats_dist_src_cid_format(this, base);
+    }
+    toJSON() {
+        return { '/': blockstore_core_node_modules_multiformats_dist_src_cid_format(this) };
+    }
+    link() {
+        return this;
+    }
+    [Symbol.toStringTag] = 'CID';
+    // Legacy
+    [Symbol.for('nodejs.util.inspect.custom')]() {
+        return `CID(${this.toString()})`;
+    }
+    /**
+     * Takes any input `value` and returns a `CID` instance if it was
+     * a `CID` otherwise returns `null`. If `value` is instanceof `CID`
+     * it will return value back. If `value` is not instance of this CID
+     * class, but is compatible CID it will return new instance of this
+     * `CID` class. Otherwise returns null.
+     *
+     * This allows two different incompatible versions of CID library to
+     * co-exist and interop as long as binary interface is compatible.
+     */
+    static asCID(input) {
+        if (input == null) {
+            return null;
         }
-        else if ((m = pattern.match(mjs_starDotExtRE))) {
-            fastTest = (options.nocase
-                ? options.dot
-                    ? mjs_starDotExtTestNocaseDot
-                    : mjs_starDotExtTestNocase
-                : options.dot
-                    ? mjs_starDotExtTestDot
-                    : mjs_starDotExtTest)(m[1]);
+        const value = input;
+        if (value instanceof blockstore_core_node_modules_multiformats_dist_src_cid_CID) {
+            // If value is instance of CID then we're all set.
+            return value;
         }
-        else if ((m = pattern.match(mjs_qmarksRE))) {
-            fastTest = (options.nocase
-                ? options.dot
-                    ? mjs_qmarksTestNocaseDot
-                    : mjs_qmarksTestNocase
-                : options.dot
-                    ? mjs_qmarksTestDot
-                    : mjs_qmarksTest)(m);
+        else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) {
+            // If value isn't instance of this CID class but `this.asCID === this` or
+            // `value['/'] === value.bytes` is true it is CID instance coming from a
+            // different implementation (diff version or duplicate). In that case we
+            // rebase it to this `CID` implementation so caller is guaranteed to get
+            // instance with expected API.
+            const { version, code, multihash, bytes } = value;
+            return new blockstore_core_node_modules_multiformats_dist_src_cid_CID(version, code, multihash, bytes ?? blockstore_core_node_modules_multiformats_dist_src_cid_encodeCID(version, code, multihash.bytes));
         }
-        else if ((m = pattern.match(mjs_starDotStarRE))) {
-            fastTest = options.dot ? mjs_starDotStarTestDot : mjs_starDotStarTest;
+        else if (value[blockstore_core_node_modules_multiformats_dist_src_cid_cidSymbol] === true) {
+            // If value is a CID from older implementation that used to be tagged via
+            // symbol we still rebase it to the this `CID` implementation by
+            // delegating that to a constructor.
+            const { version, multihash, code } = value;
+            const digest = Digest.decode(multihash);
+            return blockstore_core_node_modules_multiformats_dist_src_cid_CID.create(version, code, digest);
         }
-        else if ((m = pattern.match(mjs_dotStarRE))) {
-            fastTest = mjs_dotStarTest;
+        else {
+            // Otherwise value is not a CID (or an incompatible version of it) in
+            // which case we return `null`.
+            return null;
         }
-        const re = ast_AST.fromGlob(pattern, this.options).toMMPattern();
-        return fastTest ? Object.assign(re, { test: fastTest }) : re;
     }
-    makeRe() {
-        if (this.regexp || this.regexp === false)
-            return this.regexp;
-        // at this point, this.set is a 2d array of partial
-        // pattern strings, or "**".
-        //
-        // It's better to use .match().  This function shouldn't
-        // be used, really, but it's pretty convenient sometimes,
-        // when you just want to work with a regex.
-        const set = this.set;
-        if (!set.length) {
-            this.regexp = false;
-            return this.regexp;
+    /**
+     * @param version - Version of the CID
+     * @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv
+     * @param digest - (Multi)hash of the of the content.
+     */
+    static create(version, code, digest) {
+        if (typeof code !== 'number') {
+            throw new Error('String codecs are no longer supported');
         }
-        const options = this.options;
-        const twoStar = options.noglobstar
-            ? dist_mjs_star
-            : options.dot
-                ? mjs_twoStarDot
-                : mjs_twoStarNoDot;
-        const flags = new Set(options.nocase ? ['i'] : []);
-        // regexpify non-globstar patterns
-        // if ** is only item, then we just do one twoStar
-        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
-        // if ** is last, append (\/twoStar|) to previous
-        // if ** is in the middle, append (\/|\/twoStar\/) to previous
-        // then filter out GLOBSTAR symbols
-        let re = set
-            .map(pattern => {
-            const pp = pattern.map(p => {
-                if (p instanceof RegExp) {
-                    for (const f of p.flags.split(''))
-                        flags.add(f);
-                }
-                return typeof p === 'string'
-                    ? dist_mjs_regExpEscape(p)
-                    : p === mjs_GLOBSTAR
-                        ? mjs_GLOBSTAR
-                        : p._src;
-            });
-            pp.forEach((p, i) => {
-                const next = pp[i + 1];
-                const prev = pp[i - 1];
-                if (p !== mjs_GLOBSTAR || prev === mjs_GLOBSTAR) {
-                    return;
-                }
-                if (prev === undefined) {
-                    if (next !== undefined && next !== mjs_GLOBSTAR) {
-                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
-                    }
-                    else {
-                        pp[i] = twoStar;
-                    }
-                }
-                else if (next === undefined) {
-                    pp[i - 1] = prev + '(?:\\/|' + twoStar + ')?';
+        if (!(digest.bytes instanceof Uint8Array)) {
+            throw new Error('Invalid digest');
+        }
+        switch (version) {
+            case 0: {
+                if (code !== blockstore_core_node_modules_multiformats_dist_src_cid_DAG_PB_CODE) {
+                    throw new Error(`Version 0 CID must use dag-pb (code: ${blockstore_core_node_modules_multiformats_dist_src_cid_DAG_PB_CODE}) block encoding`);
                 }
-                else if (next !== mjs_GLOBSTAR) {
-                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
-                    pp[i + 1] = mjs_GLOBSTAR;
+                else {
+                    return new blockstore_core_node_modules_multiformats_dist_src_cid_CID(version, code, digest, digest.bytes);
                 }
-            });
-            return pp.filter(p => p !== mjs_GLOBSTAR).join('/');
-        })
-            .join('|');
-        // need to wrap in parens if we had more than one thing with |,
-        // otherwise only the first will be anchored to ^ and the last to $
-        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
-        // must match entire pattern
-        // ending in a * or ** will make it less strict.
-        re = '^' + open + re + close + '$';
-        // can match anything, as long as it's not this.
-        if (this.negate)
-            re = '^(?!' + re + ').+$';
-        try {
-            this.regexp = new RegExp(re, [...flags].join(''));
-            /* c8 ignore start */
+            }
+            case 1: {
+                const bytes = blockstore_core_node_modules_multiformats_dist_src_cid_encodeCID(version, code, digest.bytes);
+                return new blockstore_core_node_modules_multiformats_dist_src_cid_CID(version, code, digest, bytes);
+            }
+            default: {
+                throw new Error('Invalid version');
+            }
         }
-        catch (ex) {
-            // should be impossible
-            this.regexp = false;
+    }
+    /**
+     * Simplified version of `create` for CIDv0.
+     */
+    static createV0(digest) {
+        return blockstore_core_node_modules_multiformats_dist_src_cid_CID.create(0, blockstore_core_node_modules_multiformats_dist_src_cid_DAG_PB_CODE, digest);
+    }
+    /**
+     * Simplified version of `create` for CIDv1.
+     *
+     * @param code - Content encoding format code.
+     * @param digest - Multihash of the content.
+     */
+    static createV1(code, digest) {
+        return blockstore_core_node_modules_multiformats_dist_src_cid_CID.create(1, code, digest);
+    }
+    /**
+     * Decoded a CID from its binary representation. The byte array must contain
+     * only the CID with no additional bytes.
+     *
+     * An error will be thrown if the bytes provided do not contain a valid
+     * binary representation of a CID.
+     */
+    static decode(bytes) {
+        const [cid, remainder] = blockstore_core_node_modules_multiformats_dist_src_cid_CID.decodeFirst(bytes);
+        if (remainder.length !== 0) {
+            throw new Error('Incorrect length');
         }
-        /* c8 ignore stop */
-        return this.regexp;
+        return cid;
     }
-    slashSplit(p) {
-        // if p starts with // on windows, we preserve that
-        // so that UNC paths aren't broken.  Otherwise, any number of
-        // / characters are coalesced into one, unless
-        // preserveMultipleSlashes is set to true.
-        if (this.preserveMultipleSlashes) {
-            return p.split('/');
+    /**
+     * Decoded a CID from its binary representation at the beginning of a byte
+     * array.
+     *
+     * Returns an array with the first element containing the CID and the second
+     * element containing the remainder of the original byte array. The remainder
+     * will be a zero-length byte array if the provided bytes only contained a
+     * binary CID representation.
+     */
+    static decodeFirst(bytes) {
+        const specs = blockstore_core_node_modules_multiformats_dist_src_cid_CID.inspectBytes(bytes);
+        const prefixSize = specs.size - specs.multihashSize;
+        const multihashBytes = coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize));
+        if (multihashBytes.byteLength !== specs.multihashSize) {
+            throw new Error('Incorrect length');
         }
-        else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
-            // add an extra '' for the one we lose
-            return ['', ...p.split(/\/+/)];
+        const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize);
+        const digest = new Digest.Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes);
+        const cid = specs.version === 0
+            ? blockstore_core_node_modules_multiformats_dist_src_cid_CID.createV0(digest)
+            : blockstore_core_node_modules_multiformats_dist_src_cid_CID.createV1(specs.codec, digest);
+        return [cid, bytes.subarray(specs.size)];
+    }
+    /**
+     * Inspect the initial bytes of a CID to determine its properties.
+     *
+     * Involves decoding up to 4 varints. Typically this will require only 4 to 6
+     * bytes but for larger multicodec code values and larger multihash digest
+     * lengths these varints can be quite large. It is recommended that at least
+     * 10 bytes be made available in the `initialBytes` argument for a complete
+     * inspection.
+     */
+    static inspectBytes(initialBytes) {
+        let offset = 0;
+        const next = () => {
+            const [i, length] = varint.decode(initialBytes.subarray(offset));
+            offset += length;
+            return i;
+        };
+        let version = next();
+        let codec = blockstore_core_node_modules_multiformats_dist_src_cid_DAG_PB_CODE;
+        if (version === 18) {
+            // CIDv0
+            version = 0;
+            offset = 0;
         }
         else {
-            return p.split(/\/+/);
+            codec = next();
         }
-    }
-    match(f, partial = this.partial) {
-        this.debug('match', f, this.pattern);
-        // short-circuit in the case of busted things.
-        // comments, etc.
-        if (this.comment) {
-            return false;
+        if (version !== 0 && version !== 1) {
+            throw new RangeError(`Invalid CID version ${version}`);
         }
-        if (this.empty) {
-            return f === '';
+        const prefixSize = offset;
+        const multihashCode = next(); // multihash code
+        const digestSize = next(); // multihash length
+        const size = offset + digestSize;
+        const multihashSize = size - prefixSize;
+        return { version, codec, multihashCode, digestSize, multihashSize, size };
+    }
+    /**
+     * Takes cid in a string representation and creates an instance. If `base`
+     * decoder is not provided will use a default from the configuration. It will
+     * throw an error if encoding of the CID is not compatible with supplied (or
+     * a default decoder).
+     */
+    static parse(source, base) {
+        const [prefix, bytes] = blockstore_core_node_modules_multiformats_dist_src_cid_parseCIDtoBytes(source, base);
+        const cid = blockstore_core_node_modules_multiformats_dist_src_cid_CID.decode(bytes);
+        if (cid.version === 0 && source[0] !== 'Q') {
+            throw Error('Version 0 CID string must not include multibase prefix');
         }
-        if (f === '/' && partial) {
-            return true;
+        // Cache string representation to avoid computing it on `this.toString()`
+        blockstore_core_node_modules_multiformats_dist_src_cid_baseCache(cid).set(prefix, source);
+        return cid;
+    }
+}
+function blockstore_core_node_modules_multiformats_dist_src_cid_parseCIDtoBytes(source, base) {
+    switch (source[0]) {
+        // CIDv0 is parsed differently
+        case 'Q': {
+            const decoder = base ?? base58btc;
+            return [
+                base58btc.prefix,
+                decoder.decode(`${base58btc.prefix}${source}`)
+            ];
         }
-        const options = this.options;
-        // windows: need to use /, not \
-        if (this.isWindows) {
-            f = f.split('\\').join('/');
+        case base58btc.prefix: {
+            const decoder = base ?? base58btc;
+            return [base58btc.prefix, decoder.decode(source)];
         }
-        // treat the test path as a set of pathparts.
-        const ff = this.slashSplit(f);
-        this.debug(this.pattern, 'split', ff);
-        // just ONE of the pattern sets in this.set needs to match
-        // in order for it to be valid.  If negating, then just one
-        // match means that we have failed.
-        // Either way, return on the first hit.
-        const set = this.set;
-        this.debug(this.pattern, 'set', set);
-        // Find the basename of the path by looking for the last non-empty segment
-        let filename = ff[ff.length - 1];
-        if (!filename) {
-            for (let i = ff.length - 2; !filename && i >= 0; i--) {
-                filename = ff[i];
-            }
+        case base32.prefix: {
+            const decoder = base ?? base32;
+            return [base32.prefix, decoder.decode(source)];
         }
-        for (let i = 0; i < set.length; i++) {
-            const pattern = set[i];
-            let file = ff;
-            if (options.matchBase && pattern.length === 1) {
-                file = [filename];
-            }
-            const hit = this.matchOne(file, pattern, partial);
-            if (hit) {
-                if (options.flipNegate) {
-                    return true;
-                }
-                return !this.negate;
+        default: {
+            if (base == null) {
+                throw Error('To parse non base32 or base58btc encoded CID multibase decoder must be provided');
             }
+            return [source[0], base.decode(source)];
         }
-        // didn't get any hits.  this is success if it's a negative
-        // pattern, failure otherwise.
-        if (options.flipNegate) {
-            return false;
-        }
-        return this.negate;
     }
-    static defaults(def) {
-        return dist_mjs_minimatch.defaults(def).Minimatch;
+}
+function blockstore_core_node_modules_multiformats_dist_src_cid_toStringV0(bytes, cache, base) {
+    const { prefix } = base;
+    if (prefix !== base58btc.prefix) {
+        throw Error(`Cannot string encode V0 in ${base.name} encoding`);
+    }
+    const cid = cache.get(prefix);
+    if (cid == null) {
+        const cid = base.encode(bytes).slice(1);
+        cache.set(prefix, cid);
+        return cid;
+    }
+    else {
+        return cid;
     }
 }
-/* c8 ignore start */
+function blockstore_core_node_modules_multiformats_dist_src_cid_toStringV1(bytes, cache, base) {
+    const { prefix } = base;
+    const cid = cache.get(prefix);
+    if (cid == null) {
+        const cid = base.encode(bytes);
+        cache.set(prefix, cid);
+        return cid;
+    }
+    else {
+        return cid;
+    }
+}
+const blockstore_core_node_modules_multiformats_dist_src_cid_DAG_PB_CODE = 0x70;
+const blockstore_core_node_modules_multiformats_dist_src_cid_SHA_256_CODE = 0x12;
+function blockstore_core_node_modules_multiformats_dist_src_cid_encodeCID(version, code, multihash) {
+    const codeOffset = varint.encodingLength(version);
+    const hashOffset = codeOffset + varint.encodingLength(code);
+    const bytes = new Uint8Array(hashOffset + multihash.byteLength);
+    varint.encodeTo(version, bytes, 0);
+    varint.encodeTo(code, bytes, codeOffset);
+    bytes.set(multihash, hashOffset);
+    return bytes;
+}
+const blockstore_core_node_modules_multiformats_dist_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID');
+//# sourceMappingURL=cid.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/node_modules/multiformats/dist/src/codecs/raw.js
 
+const node_modules_multiformats_dist_src_codecs_raw_name = 'raw';
+const node_modules_multiformats_dist_src_codecs_raw_code = 0x55;
+function node_modules_multiformats_dist_src_codecs_raw_encode(node) {
+    return coerce(node);
+}
+function node_modules_multiformats_dist_src_codecs_raw_decode(data) {
+    return coerce(data);
+}
+//# sourceMappingURL=raw.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/dist/src/memory.js
 
 
-/* c8 ignore stop */
-dist_mjs_minimatch.AST = ast_AST;
-dist_mjs_minimatch.Minimatch = mjs_Minimatch;
-dist_mjs_minimatch.escape = mjs_escape_escape;
-dist_mjs_minimatch.unescape = mjs_unescape_unescape;
-//# sourceMappingURL=index.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/it-glob/dist/src/index.js
-/**
- * @packageDocumentation
- *
- * Like [`glob`](https://npmjs.com/package/glob) but async iterable.
- *
- * @example
- *
- * ```javascript
- * import glob from 'it-glob'
- *
- * const options = {
- *   cwd // defaults to process.cwd
- *   absolute // return absolute paths, defaults to false
- *   nodir // only yield file paths, skip directories
- *
- *   // all other options are passed to minimatch
- * }
- *
- * for await (const path of glob('/path/to/file', '**\/*', options)) {
- *  console.info(path)
- * }
- * ```
- *
- * See the [minimatch docs](https://www.npmjs.com/package/minimatch#options) for the full list of options.
- */
 
 
 
-/**
- * Async iterable filename pattern matcher
- */
-async function* dist_src_glob(dir, pattern, options = {}) {
-    const absoluteDir = external_path_.resolve(dir);
-    const relativeDir = external_path_.relative(options.cwd ?? process.cwd(), dir);
-    const stats = await promises_namespaceObject.stat(absoluteDir);
-    if (stats.isDirectory()) {
-        for await (const entry of it_glob_dist_src_glob(absoluteDir, '', pattern, options)) {
-            yield entry;
-        }
-        return;
+
+class MemoryBlockstore extends (/* unused pure expression or super */ null && (BaseBlockstore)) {
+    data;
+    constructor() {
+        super();
+        this.data = new Map();
     }
-    if (dist_mjs_minimatch(relativeDir, pattern, options)) {
-        yield options.absolute === true ? absoluteDir : relativeDir;
+    put(key, val) {
+        this.data.set(base32.encode(key.multihash.bytes), val);
+        return key;
     }
-}
-async function* it_glob_dist_src_glob(base, dir, pattern, options) {
-    for await (const entry of await promises_namespaceObject.opendir(external_path_.join(base, dir))) {
-        const relativeEntryPath = external_path_.join(dir, entry.name);
-        const absoluteEntryPath = external_path_.join(base, dir, entry.name);
-        let match = dist_mjs_minimatch(relativeEntryPath, pattern, options);
-        const isDirectory = entry.isDirectory();
-        if (isDirectory && options.nodir === true) {
-            match = false;
-        }
-        if (match) {
-            yield options.absolute === true ? absoluteEntryPath : relativeEntryPath;
-        }
-        if (isDirectory) {
-            yield* it_glob_dist_src_glob(base, relativeEntryPath, pattern, options);
+    get(key) {
+        const buf = this.data.get(base32.encode(key.multihash.bytes));
+        if (buf == null) {
+            throw Errors.notFoundError();
         }
+        return buf;
     }
-}
-//# sourceMappingURL=index.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/it-peekable/dist/src/index.js
-/**
- * @packageDocumentation
- *
- * Lets you look at the contents of an async iterator and decide what to do
- *
- * @example
- *
- * ```javascript
- * import peekable from 'it-peekable'
- *
- * // This can also be an iterator, generator, etc
- * const values = [0, 1, 2, 3, 4]
- *
- * const it = peekable(value)
- *
- * const first = it.peek()
- *
- * console.info(first) // 0
- *
- * it.push(first)
- *
- * console.info([...it])
- * // [ 0, 1, 2, 3, 4 ]
- * ```
- *
- * Async sources must be awaited:
- *
- * ```javascript
- * import peekable from 'it-peekable'
- *
- * const values = async function * () {
- *   yield * [0, 1, 2, 3, 4]
- * }
- *
- * const it = peekable(values())
- *
- * const first = await it.peek()
- *
- * console.info(first) // 0
- *
- * it.push(first)
- *
- * console.info(await all(it))
- * // [ 0, 1, 2, 3, 4 ]
- * ```
- */
-function dist_src_peekable(iterable) {
-    // @ts-expect-error can't use Symbol.asyncIterator to index iterable since it might be Iterable
-    const [iterator, symbol] = iterable[Symbol.asyncIterator] != null
-        // @ts-expect-error can't use Symbol.asyncIterator to index iterable since it might be Iterable
-        ? [iterable[Symbol.asyncIterator](), Symbol.asyncIterator]
-        // @ts-expect-error can't use Symbol.iterator to index iterable since it might be AsyncIterable
-        : [iterable[Symbol.iterator](), Symbol.iterator];
-    const queue = [];
-    // @ts-expect-error can't use symbol to index peekable
-    return {
-        peek: () => {
-            return iterator.next();
-        },
-        push: (value) => {
-            queue.push(value);
-        },
-        next: () => {
-            if (queue.length > 0) {
-                return {
-                    done: false,
-                    value: queue.shift()
-                };
-            }
-            return iterator.next();
-        },
-        [symbol]() {
-            return this;
+    has(key) {
+        return this.data.has(base32.encode(key.multihash.bytes));
+    }
+    async delete(key) {
+        this.data.delete(base32.encode(key.multihash.bytes));
+    }
+    async *getAll() {
+        for (const [key, value] of this.data.entries()) {
+            yield {
+                cid: CID.createV1(raw.code, Digest.decode(base32.decode(key))),
+                block: value
+            };
         }
-    };
+    }
 }
-/* harmony default export */ const blockstore_fs_node_modules_it_peekable_dist_src = (dist_src_peekable);
-//# sourceMappingURL=index.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/it-map/dist/src/index.js
-/**
- * @packageDocumentation
- *
- * Convert one value from an (async)iterator into another.
- *
- * @example
- *
- * ```javascript
- * import map from 'it-map'
- *
- * // This can also be an iterator, generator, etc
- * const values = [0, 1, 2, 3, 4]
- *
- * const result = map(values, (val) => val++)
- *
- * console.info(result) // [1, 2, 3, 4, 5]
- * ```
- *
- * Async sources and transforms must be awaited:
- *
- * ```javascript
- * import map from 'it-map'
- *
- * const values = async function * () {
- *   yield * [0, 1, 2, 3, 4]
- * }
- *
- * const result = await map(values(), async (val) => val++)
- *
- * console.info(result) // [1, 2, 3, 4, 5]
- * ```
- */
+//# sourceMappingURL=memory.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/dist/src/black-hole.js
 
-function blockstore_fs_node_modules_it_map_dist_src_isAsyncIterable(thing) {
-    return thing[Symbol.asyncIterator] != null;
-}
-function it_map_dist_src_map(source, func) {
-    if (blockstore_fs_node_modules_it_map_dist_src_isAsyncIterable(source)) {
-        return (async function* () {
-            for await (const val of source) {
-                yield func(val);
-            }
-        })();
+
+class BlackHoleBlockstore extends (/* unused pure expression or super */ null && (BaseBlockstore)) {
+    put(key) {
+        return key;
     }
-    // if mapping function returns a promise we have to return an async generator
-    const peekable = blockstore_fs_node_modules_it_peekable_dist_src(source);
-    const { value, done } = peekable.next();
-    if (done === true) {
-        return (function* () { }());
+    get() {
+        throw Errors.notFoundError();
     }
-    const res = func(value);
-    // @ts-expect-error .then is not present on O
-    if (typeof res.then === 'function') {
-        return (async function* () {
-            yield await res;
-            for await (const val of peekable) {
-                yield func(val);
-            }
-        })();
+    has() {
+        return false;
     }
-    const fn = func;
-    return (function* () {
-        yield res;
-        for (const val of peekable) {
-            yield fn(val);
-        }
-    })();
-}
-/* harmony default export */ const blockstore_fs_node_modules_it_map_dist_src = (it_map_dist_src_map);
-//# sourceMappingURL=index.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/it-batch/dist/src/index.js
-/**
- * @packageDocumentation
- *
- * The final batch may be smaller than the max.
- *
- * @example
- *
- * ```javascript
- * import batch from 'it-batch'
- * import all from 'it-all'
- *
- * // This can also be an iterator, generator, etc
- * const values = [0, 1, 2, 3, 4]
- * const batchSize = 2
- *
- * const result = all(batch(values, batchSize))
- *
- * console.info(result) // [0, 1], [2, 3], [4]
- * ```
- *
- * Async sources must be awaited:
- *
- * ```javascript
- * import batch from 'it-batch'
- * import all from 'it-all'
- *
- * const values = async function * () {
- *   yield * [0, 1, 2, 3, 4]
- * }
- *
- * const batchSize = 2
- * const result = await all(batch(values(), batchSize))
- *
- * console.info(result) // [0, 1], [2, 3], [4]
- * ```
- */
-function node_modules_it_batch_dist_src_isAsyncIterable(thing) {
-    return thing[Symbol.asyncIterator] != null;
-}
-function src_batch(source, size = 1) {
-    size = Number(size);
-    if (node_modules_it_batch_dist_src_isAsyncIterable(source)) {
-        return (async function* () {
-            let things = [];
-            if (size < 1) {
-                size = 1;
-            }
-            if (size !== Math.round(size)) {
-                throw new Error('Batch size must be an integer');
-            }
-            for await (const thing of source) {
-                things.push(thing);
-                while (things.length >= size) {
-                    yield things.slice(0, size);
-                    things = things.slice(size);
-                }
-            }
-            while (things.length > 0) {
-                yield things.slice(0, size);
-                things = things.slice(size);
-            }
-        }());
+    async delete() {
     }
-    return (function* () {
-        let things = [];
-        if (size < 1) {
-            size = 1;
-        }
-        if (size !== Math.round(size)) {
-            throw new Error('Batch size must be an integer');
-        }
-        for (const thing of source) {
-            things.push(thing);
-            while (things.length >= size) {
-                yield things.slice(0, size);
-                things = things.slice(size);
-            }
-        }
-        while (things.length > 0) {
-            yield things.slice(0, size);
-            things = things.slice(size);
-        }
-    }());
-}
-/* harmony default export */ const node_modules_it_batch_dist_src = (src_batch);
-//# sourceMappingURL=index.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/it-parallel-batch/dist/src/index.js
-/**
- * @packageDocumentation
- *
- * Takes an async iterator that emits promise-returning functions, invokes them in parallel and emits the results in the same order as the input.
- *
- * The final batch may be smaller than the batch size.
- *
- * @example
- *
- * ```javascript
- * import parallelBatch from 'it-parallel-batch'
- * import all from 'it-all'
- * import delay from 'delay'
- *
- * // This can also be an iterator, async iterator, generator, etc
- * const input = [
- *   async () => {
- *     await delay(500)
- *
- *     return 1
- *   },
- *   async () => {
- *     await delay(200)
- *
- *     return 2
- *   },
- *   async () => {
- *     await delay(100)
- *
- *     return 3
- *   }
- * ]
- *
- * const batchSize = 2
- *
- * const result = await all(parallelBatch(input, batchSize))
- *
- * console.info(result) // [1, 2, 3]
- * ```
- */
-
-/**
- * Takes an (async) iterator that emits promise-returning functions,
- * invokes them in parallel and emits the results as they become available but
- * in the same order as the input
- */
-async function* src_parallelBatch(source, size = 1) {
-    for await (const tasks of node_modules_it_batch_dist_src(source, size)) {
-        const things = tasks.map(async (p) => {
-            return p().then(value => ({ ok: true, value }), err => ({ ok: false, err }));
-        });
-        for (let i = 0; i < things.length; i++) {
-            const result = await things[i];
-            if (result.ok) {
-                yield result.value;
-            }
-            else {
-                throw result.err;
-            }
-        }
+    async *getAll() {
     }
 }
-//# sourceMappingURL=index.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/vendor/varint.js
-var blockstore_fs_node_modules_multiformats_vendor_varint_encode_1 = blockstore_fs_node_modules_multiformats_vendor_varint_encode;
-
-var blockstore_fs_node_modules_multiformats_vendor_varint_MSB = 0x80
-  , blockstore_fs_node_modules_multiformats_vendor_varint_REST = 0x7F
-  , blockstore_fs_node_modules_multiformats_vendor_varint_MSBALL = ~blockstore_fs_node_modules_multiformats_vendor_varint_REST
-  , blockstore_fs_node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31);
-
-function blockstore_fs_node_modules_multiformats_vendor_varint_encode(num, out, offset) {
-  out = out || [];
-  offset = offset || 0;
-  var oldOffset = offset;
-
-  while(num >= blockstore_fs_node_modules_multiformats_vendor_varint_INT) {
-    out[offset++] = (num & 0xFF) | blockstore_fs_node_modules_multiformats_vendor_varint_MSB;
-    num /= 128;
+//# sourceMappingURL=black-hole.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/vendor/base-x.js
+// base-x encoding / decoding
+// Copyright (c) 2018 base-x contributors
+// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
+// Distributed under the MIT software license, see the accompanying
+// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
+function blockstore_fs_node_modules_multiformats_vendor_base_x_base (ALPHABET, name) {
+  if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
+  var BASE_MAP = new Uint8Array(256);
+  for (var j = 0; j < BASE_MAP.length; j++) {
+    BASE_MAP[j] = 255;
   }
-  while(num & blockstore_fs_node_modules_multiformats_vendor_varint_MSBALL) {
-    out[offset++] = (num & 0xFF) | blockstore_fs_node_modules_multiformats_vendor_varint_MSB;
-    num >>>= 7;
+  for (var i = 0; i < ALPHABET.length; i++) {
+    var x = ALPHABET.charAt(i);
+    var xc = x.charCodeAt(0);
+    if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }
+    BASE_MAP[xc] = i;
   }
-  out[offset] = num | 0;
-  
-  blockstore_fs_node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1;
-  
-  return out
-}
-
-var blockstore_fs_node_modules_multiformats_vendor_varint_decode = blockstore_fs_node_modules_multiformats_vendor_varint_read;
-
-var blockstore_fs_node_modules_multiformats_vendor_varint_MSB$1 = 0x80
-  , blockstore_fs_node_modules_multiformats_vendor_varint_REST$1 = 0x7F;
-
-function blockstore_fs_node_modules_multiformats_vendor_varint_read(buf, offset) {
-  var res    = 0
-    , offset = offset || 0
-    , shift  = 0
-    , counter = offset
-    , b
-    , l = buf.length;
-
-  do {
-    if (counter >= l) {
-      blockstore_fs_node_modules_multiformats_vendor_varint_read.bytes = 0;
-      throw new RangeError('Could not decode varint')
+  var BASE = ALPHABET.length;
+  var LEADER = ALPHABET.charAt(0);
+  var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up
+  var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up
+  function encode (source) {
+    if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) {
+      source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
+    } else if (Array.isArray(source)) {
+      source = Uint8Array.from(source);
+    }
+    if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }
+    if (source.length === 0) { return '' }
+        // Skip & count leading zeroes.
+    var zeroes = 0;
+    var length = 0;
+    var pbegin = 0;
+    var pend = source.length;
+    while (pbegin !== pend && source[pbegin] === 0) {
+      pbegin++;
+      zeroes++;
+    }
+        // Allocate enough space in big-endian base58 representation.
+    var size = ((pend - pbegin) * iFACTOR + 1) >>> 0;
+    var b58 = new Uint8Array(size);
+        // Process the bytes.
+    while (pbegin !== pend) {
+      var carry = source[pbegin];
+            // Apply "b58 = b58 * 256 + ch".
+      var i = 0;
+      for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
+        carry += (256 * b58[it1]) >>> 0;
+        b58[it1] = (carry % BASE) >>> 0;
+        carry = (carry / BASE) >>> 0;
+      }
+      if (carry !== 0) { throw new Error('Non-zero carry') }
+      length = i;
+      pbegin++;
+    }
+        // Skip leading zeroes in base58 result.
+    var it2 = size - length;
+    while (it2 !== size && b58[it2] === 0) {
+      it2++;
+    }
+        // Translate the result into a string.
+    var str = LEADER.repeat(zeroes);
+    for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }
+    return str
+  }
+  function decodeUnsafe (source) {
+    if (typeof source !== 'string') { throw new TypeError('Expected String') }
+    if (source.length === 0) { return new Uint8Array() }
+    var psz = 0;
+        // Skip leading spaces.
+    if (source[psz] === ' ') { return }
+        // Skip and count leading '1's.
+    var zeroes = 0;
+    var length = 0;
+    while (source[psz] === LEADER) {
+      zeroes++;
+      psz++;
+    }
+        // Allocate enough space in big-endian base256 representation.
+    var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.
+    var b256 = new Uint8Array(size);
+        // Process the characters.
+    while (source[psz]) {
+            // Decode character
+      var carry = BASE_MAP[source.charCodeAt(psz)];
+            // Invalid character
+      if (carry === 255) { return }
+      var i = 0;
+      for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
+        carry += (BASE * b256[it3]) >>> 0;
+        b256[it3] = (carry % 256) >>> 0;
+        carry = (carry / 256) >>> 0;
+      }
+      if (carry !== 0) { throw new Error('Non-zero carry') }
+      length = i;
+      psz++;
     }
-    b = buf[counter++];
-    res += shift < 28
-      ? (b & blockstore_fs_node_modules_multiformats_vendor_varint_REST$1) << shift
-      : (b & blockstore_fs_node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift);
-    shift += 7;
-  } while (b >= blockstore_fs_node_modules_multiformats_vendor_varint_MSB$1)
-
-  blockstore_fs_node_modules_multiformats_vendor_varint_read.bytes = counter - offset;
-
-  return res
+        // Skip trailing spaces.
+    if (source[psz] === ' ') { return }
+        // Skip leading zeroes in b256.
+    var it4 = size - length;
+    while (it4 !== size && b256[it4] === 0) {
+      it4++;
+    }
+    var vch = new Uint8Array(zeroes + (size - it4));
+    var j = zeroes;
+    while (it4 !== size) {
+      vch[j++] = b256[it4++];
+    }
+    return vch
+  }
+  function decode (string) {
+    var buffer = decodeUnsafe(string);
+    if (buffer) { return buffer }
+    throw new Error(`Non-${name} character`)
+  }
+  return {
+    encode: encode,
+    decodeUnsafe: decodeUnsafe,
+    decode: decode
+  }
 }
+var blockstore_fs_node_modules_multiformats_vendor_base_x_src = blockstore_fs_node_modules_multiformats_vendor_base_x_base;
 
-var blockstore_fs_node_modules_multiformats_vendor_varint_N1 = Math.pow(2,  7);
-var blockstore_fs_node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14);
-var blockstore_fs_node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21);
-var blockstore_fs_node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28);
-var blockstore_fs_node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35);
-var blockstore_fs_node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42);
-var blockstore_fs_node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49);
-var blockstore_fs_node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56);
-var blockstore_fs_node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63);
-
-var blockstore_fs_node_modules_multiformats_vendor_varint_length = function (value) {
-  return (
-    value < blockstore_fs_node_modules_multiformats_vendor_varint_N1 ? 1
-  : value < blockstore_fs_node_modules_multiformats_vendor_varint_N2 ? 2
-  : value < blockstore_fs_node_modules_multiformats_vendor_varint_N3 ? 3
-  : value < blockstore_fs_node_modules_multiformats_vendor_varint_N4 ? 4
-  : value < blockstore_fs_node_modules_multiformats_vendor_varint_N5 ? 5
-  : value < blockstore_fs_node_modules_multiformats_vendor_varint_N6 ? 6
-  : value < blockstore_fs_node_modules_multiformats_vendor_varint_N7 ? 7
-  : value < blockstore_fs_node_modules_multiformats_vendor_varint_N8 ? 8
-  : value < blockstore_fs_node_modules_multiformats_vendor_varint_N9 ? 9
-  :              10
-  )
-};
-
-var blockstore_fs_node_modules_multiformats_vendor_varint_varint = {
-    encode: blockstore_fs_node_modules_multiformats_vendor_varint_encode_1
-  , decode: blockstore_fs_node_modules_multiformats_vendor_varint_decode
-  , encodingLength: blockstore_fs_node_modules_multiformats_vendor_varint_length
-};
-
-var blockstore_fs_node_modules_multiformats_vendor_varint_brrp_varint = blockstore_fs_node_modules_multiformats_vendor_varint_varint;
-
-/* harmony default export */ const blockstore_fs_node_modules_multiformats_vendor_varint = (blockstore_fs_node_modules_multiformats_vendor_varint_brrp_varint);
-
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/src/varint.js
+var blockstore_fs_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX = blockstore_fs_node_modules_multiformats_vendor_base_x_src;
 
+/* harmony default export */ const blockstore_fs_node_modules_multiformats_vendor_base_x = (blockstore_fs_node_modules_multiformats_vendor_base_x_brrp_multiformats_scope_baseX);
 
-/**
- * @param {Uint8Array} data
- * @param {number} [offset=0]
- * @returns {[number, number]}
- */
-const blockstore_fs_node_modules_multiformats_src_varint_decode = (data, offset = 0) => {
-  const code = blockstore_fs_node_modules_multiformats_vendor_varint.decode(data, offset)
-  return [code, blockstore_fs_node_modules_multiformats_vendor_varint.decode.bytes]
-}
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/src/bytes.js
+const blockstore_fs_node_modules_multiformats_src_bytes_empty = new Uint8Array(0)
 
 /**
- * @param {number} int
- * @param {Uint8Array} target
- * @param {number} [offset=0]
+ * @param {Uint8Array} d
  */
-const blockstore_fs_node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => {
-  blockstore_fs_node_modules_multiformats_vendor_varint.encode(int, target, offset)
-  return target
-}
+const blockstore_fs_node_modules_multiformats_src_bytes_toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '')
 
 /**
- * @param {number} int
- * @returns {number}
+ * @param {string} hex
  */
-const blockstore_fs_node_modules_multiformats_src_varint_encodingLength = (int) => {
-  return blockstore_fs_node_modules_multiformats_vendor_varint.encodingLength(int)
+const blockstore_fs_node_modules_multiformats_src_bytes_fromHex = hex => {
+  const hexes = hex.match(/../g)
+  return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : blockstore_fs_node_modules_multiformats_src_bytes_empty
 }
 
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/src/hashes/digest.js
-
-
-
 /**
- * Creates a multihash digest.
- *
- * @template {number} Code
- * @param {Code} code
- * @param {Uint8Array} digest
+ * @param {Uint8Array} aa
+ * @param {Uint8Array} bb
  */
-const blockstore_fs_node_modules_multiformats_src_hashes_digest_create = (code, digest) => {
-  const size = digest.byteLength
-  const sizeOffset = blockstore_fs_node_modules_multiformats_src_varint_encodingLength(code)
-  const digestOffset = sizeOffset + blockstore_fs_node_modules_multiformats_src_varint_encodingLength(size)
+const blockstore_fs_node_modules_multiformats_src_bytes_equals = (aa, bb) => {
+  if (aa === bb) return true
+  if (aa.byteLength !== bb.byteLength) {
+    return false
+  }
 
-  const bytes = new Uint8Array(digestOffset + size)
-  blockstore_fs_node_modules_multiformats_src_varint_encodeTo(code, bytes, 0)
-  blockstore_fs_node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset)
-  bytes.set(digest, digestOffset)
+  for (let ii = 0; ii < aa.byteLength; ii++) {
+    if (aa[ii] !== bb[ii]) {
+      return false
+    }
+  }
 
-  return new blockstore_fs_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes)
+  return true
 }
 
 /**
- * Turns bytes representation of multihash digest into an instance.
- *
- * @param {Uint8Array} multihash
- * @returns {MultihashDigest}
+ * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o
+ * @returns {Uint8Array}
  */
-const blockstore_fs_node_modules_multiformats_src_hashes_digest_decode = (multihash) => {
-  const bytes = blockstore_fs_node_modules_multiformats_src_bytes_coerce(multihash)
-  const [code, sizeOffset] = blockstore_fs_node_modules_multiformats_src_varint_decode(bytes)
-  const [size, digestOffset] = blockstore_fs_node_modules_multiformats_src_varint_decode(bytes.subarray(sizeOffset))
-  const digest = bytes.subarray(sizeOffset + digestOffset)
-
-  if (digest.byteLength !== size) {
-    throw new Error('Incorrect length')
+const blockstore_fs_node_modules_multiformats_src_bytes_coerce = o => {
+  if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o
+  if (o instanceof ArrayBuffer) return new Uint8Array(o)
+  if (ArrayBuffer.isView(o)) {
+    return new Uint8Array(o.buffer, o.byteOffset, o.byteLength)
   }
-
-  return new blockstore_fs_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes)
+  throw new Error('Unknown type, must be binary type')
 }
 
 /**
- * @param {MultihashDigest} a
- * @param {unknown} b
- * @returns {b is MultihashDigest}
+ * @param {any} o
+ * @returns {o is ArrayBuffer|ArrayBufferView}
  */
-const blockstore_fs_node_modules_multiformats_src_hashes_digest_equals = (a, b) => {
-  if (a === b) {
-    return true
-  } else {
-    const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b)
-
-    return (
-      a.code === data.code &&
-      a.size === data.size &&
-      data.bytes instanceof Uint8Array &&
-      blockstore_fs_node_modules_multiformats_src_bytes_equals(a.bytes, data.bytes)
-    )
-  }
-}
+const blockstore_fs_node_modules_multiformats_src_bytes_isBinary = o =>
+  o instanceof ArrayBuffer || ArrayBuffer.isView(o)
 
 /**
- * @typedef {import('./interface.js').MultihashDigest} MultihashDigest
+ * @param {string} str
+ * @returns {Uint8Array}
  */
+const blockstore_fs_node_modules_multiformats_src_bytes_fromString = str => (new TextEncoder()).encode(str)
 
 /**
- * Represents a multihash digest which carries information about the
- * hashing algorithm and an actual hash digest.
- *
- * @template {number} Code
- * @template {number} Size
- * @class
- * @implements {MultihashDigest}
+ * @param {Uint8Array} b
+ * @returns {string}
  */
-class blockstore_fs_node_modules_multiformats_src_hashes_digest_Digest {
-  /**
-   * Creates a multihash digest.
-   *
-   * @param {Code} code
-   * @param {Size} size
-   * @param {Uint8Array} digest
-   * @param {Uint8Array} bytes
-   */
-  constructor (code, size, digest, bytes) {
-    this.code = code
-    this.size = size
-    this.digest = digest
-    this.bytes = bytes
-  }
-}
+const blockstore_fs_node_modules_multiformats_src_bytes_toString = b => (new TextDecoder()).decode(b)
 
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/src/cid.js
 
 
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/src/bases/base.js
 
 
-// Linter can see that API is used in types.
+// Linter can't see that API is used in types.
 // eslint-disable-next-line
 
 
-
-// This way TS will also expose all the types from module
-
-
 /**
- * @template {API.Link} T
+ * Class represents both BaseEncoder and MultibaseEncoder meaning it
+ * can be used to encode to multibase or base encode without multibase
+ * prefix.
+ *
+ * @class
+ * @template {string} Base
  * @template {string} Prefix
- * @param {T} link
- * @param {API.MultibaseEncoder} [base]
- * @returns {API.ToString}
- */
-const blockstore_fs_node_modules_multiformats_src_cid_format = (link, base) => {
-  const { bytes, version } = link
-  switch (version) {
-    case 0:
-      return blockstore_fs_node_modules_multiformats_src_cid_toStringV0(
-        bytes,
-        blockstore_fs_node_modules_multiformats_src_cid_baseCache(link),
-        /** @type {API.MultibaseEncoder<"z">} */ (base) || blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc.encoder
-      )
-    default:
-      return blockstore_fs_node_modules_multiformats_src_cid_toStringV1(
-        bytes,
-        blockstore_fs_node_modules_multiformats_src_cid_baseCache(link),
-        /** @type {API.MultibaseEncoder} */ (base || blockstore_fs_node_modules_multiformats_src_bases_base32_base32.encoder)
-      )
-  }
-}
-
-/**
- * @template {API.UnknownLink} Link
- * @param {Link} link
- * @returns {API.LinkJSON}
- */
-const blockstore_fs_node_modules_multiformats_src_cid_toJSON = (link) => ({
-  '/': blockstore_fs_node_modules_multiformats_src_cid_format(link)
-})
-
-/**
- * @template {API.UnknownLink} Link
- * @param {API.LinkJSON} json
- */
-const blockstore_fs_node_modules_multiformats_src_cid_fromJSON = (json) =>
-  blockstore_fs_node_modules_multiformats_src_cid_CID.parse(json['/'])
-
-/** @type {WeakMap>} */
-const blockstore_fs_node_modules_multiformats_src_cid_cache = new WeakMap()
-
-/**
- * @param {API.UnknownLink} cid
- * @returns {Map}
- */
-const blockstore_fs_node_modules_multiformats_src_cid_baseCache = cid => {
-  const baseCache = blockstore_fs_node_modules_multiformats_src_cid_cache.get(cid)
-  if (baseCache == null) {
-    const baseCache = new Map()
-    blockstore_fs_node_modules_multiformats_src_cid_cache.set(cid, baseCache)
-    return baseCache
-  }
-  return baseCache
-}
-
-/**
- * @template {unknown} [Data=unknown]
- * @template {number} [Format=number]
- * @template {number} [Alg=number]
- * @template {API.Version} [Version=API.Version]
- * @implements {API.Link}
+ * @implements {API.MultibaseEncoder}
+ * @implements {API.BaseEncoder}
  */
-
-class blockstore_fs_node_modules_multiformats_src_cid_CID {
+class blockstore_fs_node_modules_multiformats_src_bases_base_Encoder {
   /**
-   * @param {Version} version - Version of the CID
-   * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv
-   * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content.
-   * @param {Uint8Array} bytes
+   * @param {Base} name
+   * @param {Prefix} prefix
+   * @param {(bytes:Uint8Array) => string} baseEncode
    */
-  constructor (version, code, multihash, bytes) {
-    /** @readonly */
-    this.code = code
-    /** @readonly */
-    this.version = version
-    /** @readonly */
-    this.multihash = multihash
-    /** @readonly */
-    this.bytes = bytes
-
-    // flag to serializers that this is a CID and
-    // should be treated specially
-    /** @readonly */
-    this['/'] = bytes
+  constructor (name, prefix, baseEncode) {
+    this.name = name
+    this.prefix = prefix
+    this.baseEncode = baseEncode
   }
 
   /**
-   * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes`
-   * please either use `CID.asCID(cid)` or switch to new signalling mechanism
-   *
-   * @deprecated
+   * @param {Uint8Array} bytes
+   * @returns {API.Multibase}
    */
-  get asCID () {
-    return this
-  }
-
-  // ArrayBufferView
-  get byteOffset () {
-    return this.bytes.byteOffset
-  }
-
-  // ArrayBufferView
-  get byteLength () {
-    return this.bytes.byteLength
+  encode (bytes) {
+    if (bytes instanceof Uint8Array) {
+      return `${this.prefix}${this.baseEncode(bytes)}`
+    } else {
+      throw Error('Unknown type, must be binary type')
+    }
   }
+}
 
+/**
+ * @template {string} Prefix
+ */
+/**
+ * Class represents both BaseDecoder and MultibaseDecoder so it could be used
+ * to decode multibases (with matching prefix) or just base decode strings
+ * with corresponding base encoding.
+ *
+ * @class
+ * @template {string} Base
+ * @template {string} Prefix
+ * @implements {API.MultibaseDecoder}
+ * @implements {API.UnibaseDecoder}
+ * @implements {API.BaseDecoder}
+ */
+class blockstore_fs_node_modules_multiformats_src_bases_base_Decoder {
   /**
-   * @returns {CID}
+   * @param {Base} name
+   * @param {Prefix} prefix
+   * @param {(text:string) => Uint8Array} baseDecode
    */
-  toV0 () {
-    switch (this.version) {
-      case 0: {
-        return /** @type {CID} */ (this)
-      }
-      case 1: {
-        const { code, multihash } = this
-
-        if (code !== blockstore_fs_node_modules_multiformats_src_cid_DAG_PB_CODE) {
-          throw new Error('Cannot convert a non dag-pb CID to CIDv0')
-        }
-
-        // sha2-256
-        if (multihash.code !== blockstore_fs_node_modules_multiformats_src_cid_SHA_256_CODE) {
-          throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0')
-        }
-
-        return /** @type {CID} */ (
-          blockstore_fs_node_modules_multiformats_src_cid_CID.createV0(
-            /** @type {API.MultihashDigest} */ (multihash)
-          )
-        )
-      }
-      default: {
-        throw Error(
-          `Can not convert CID version ${this.version} to version 0. This is a bug please report`
-        )
-      }
+  constructor (name, prefix, baseDecode) {
+    this.name = name
+    this.prefix = prefix
+    /* c8 ignore next 3 */
+    if (prefix.codePointAt(0) === undefined) {
+      throw new Error('Invalid prefix character')
     }
+    /** @private */
+    this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0))
+    this.baseDecode = baseDecode
   }
 
   /**
-   * @returns {CID}
+   * @param {string} text
    */
-  toV1 () {
-    switch (this.version) {
-      case 0: {
-        const { code, digest } = this.multihash
-        const multihash = blockstore_fs_node_modules_multiformats_src_hashes_digest_create(code, digest)
-        return /** @type {CID} */ (
-          blockstore_fs_node_modules_multiformats_src_cid_CID.createV1(this.code, multihash)
-        )
-      }
-      case 1: {
-        return /** @type {CID} */ (this)
-      }
-      default: {
-        throw Error(
-          `Can not convert CID version ${this.version} to version 1. This is a bug please report`
-        )
+  decode (text) {
+    if (typeof text === 'string') {
+      if (text.codePointAt(0) !== this.prefixCodePoint) {
+        throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`)
       }
+      return this.baseDecode(text.slice(this.prefix.length))
+    } else {
+      throw Error('Can only multibase decode strings')
     }
   }
 
   /**
-   * @param {unknown} other
-   * @returns {other is CID}
+   * @template {string} OtherPrefix
+   * @param {API.UnibaseDecoder|ComposedDecoder} decoder
+   * @returns {ComposedDecoder}
    */
-  equals (other) {
-    return blockstore_fs_node_modules_multiformats_src_cid_CID.equals(this, other)
+  or (decoder) {
+    return blockstore_fs_node_modules_multiformats_src_bases_base_or(this, decoder)
   }
+}
 
-  /**
-   * @template {unknown} Data
-   * @template {number} Format
-   * @template {number} Alg
-   * @template {API.Version} Version
-   * @param {API.Link} self
-   * @param {unknown} other
-   * @returns {other is CID}
-   */
-  static equals (self, other) {
-    const unknown =
-      /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ (
-        other
-      )
-    return (
-      unknown &&
-      self.code === unknown.code &&
-      self.version === unknown.version &&
-      blockstore_fs_node_modules_multiformats_src_hashes_digest_equals(self.multihash, unknown.multihash)
-    )
-  }
+/**
+ * @template {string} Prefix
+ * @typedef {Record>} Decoders
+ */
 
+/**
+ * @template {string} Prefix
+ * @implements {API.MultibaseDecoder}
+ * @implements {API.CombobaseDecoder}
+ */
+class blockstore_fs_node_modules_multiformats_src_bases_base_ComposedDecoder {
   /**
-   * @param {API.MultibaseEncoder} [base]
-   * @returns {string}
+   * @param {Decoders} decoders
    */
-  toString (base) {
-    return blockstore_fs_node_modules_multiformats_src_cid_format(this, base)
+  constructor (decoders) {
+    this.decoders = decoders
   }
 
   /**
-   * @returns {API.LinkJSON}
+   * @template {string} OtherPrefix
+   * @param {API.UnibaseDecoder|ComposedDecoder} decoder
+   * @returns {ComposedDecoder}
    */
-  toJSON () {
-    return { '/': blockstore_fs_node_modules_multiformats_src_cid_format(this) }
-  }
-
-  link () {
-    return this
-  }
-
-  get [Symbol.toStringTag] () {
-    return 'CID'
-  }
-
-  // Legacy
-
-  [Symbol.for('nodejs.util.inspect.custom')] () {
-    return `CID(${this.toString()})`
+  or (decoder) {
+    return blockstore_fs_node_modules_multiformats_src_bases_base_or(this, decoder)
   }
 
   /**
-   * Takes any input `value` and returns a `CID` instance if it was
-   * a `CID` otherwise returns `null`. If `value` is instanceof `CID`
-   * it will return value back. If `value` is not instance of this CID
-   * class, but is compatible CID it will return new instance of this
-   * `CID` class. Otherwise returns null.
-   *
-   * This allows two different incompatible versions of CID library to
-   * co-exist and interop as long as binary interface is compatible.
-   *
-   * @template {unknown} Data
-   * @template {number} Format
-   * @template {number} Alg
-   * @template {API.Version} Version
-   * @template {unknown} U
-   * @param {API.Link|U} input
-   * @returns {CID|null}
+   * @param {string} input
+   * @returns {Uint8Array}
    */
-  static asCID (input) {
-    if (input == null) {
-      return null
-    }
-
-    const value = /** @type {any} */ (input)
-    if (value instanceof blockstore_fs_node_modules_multiformats_src_cid_CID) {
-      // If value is instance of CID then we're all set.
-      return value
-    } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) {
-      // If value isn't instance of this CID class but `this.asCID === this` or
-      // `value['/'] === value.bytes` is true it is CID instance coming from a
-      // different implementation (diff version or duplicate). In that case we
-      // rebase it to this `CID` implementation so caller is guaranteed to get
-      // instance with expected API.
-      const { version, code, multihash, bytes } = value
-      return new blockstore_fs_node_modules_multiformats_src_cid_CID(
-        version,
-        code,
-        /** @type {API.MultihashDigest} */ (multihash),
-        bytes || blockstore_fs_node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes)
-      )
-    } else if (value[blockstore_fs_node_modules_multiformats_src_cid_cidSymbol] === true) {
-      // If value is a CID from older implementation that used to be tagged via
-      // symbol we still rebase it to the this `CID` implementation by
-      // delegating that to a constructor.
-      const { version, multihash, code } = value
-      const digest =
-        /** @type {API.MultihashDigest} */
-        (blockstore_fs_node_modules_multiformats_src_hashes_digest_decode(multihash))
-      return blockstore_fs_node_modules_multiformats_src_cid_CID.create(version, code, digest)
+  decode (input) {
+    const prefix = /** @type {Prefix} */ (input[0])
+    const decoder = this.decoders[prefix]
+    if (decoder) {
+      return decoder.decode(input)
     } else {
-      // Otherwise value is not a CID (or an incompatible version of it) in
-      // which case we return `null`.
-      return null
+      throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)
     }
   }
+}
+
+/**
+ * @template {string} L
+ * @template {string} R
+ * @param {API.UnibaseDecoder|API.CombobaseDecoder} left
+ * @param {API.UnibaseDecoder|API.CombobaseDecoder} right
+ * @returns {ComposedDecoder}
+ */
+const blockstore_fs_node_modules_multiformats_src_bases_base_or = (left, right) => new blockstore_fs_node_modules_multiformats_src_bases_base_ComposedDecoder(/** @type {Decoders} */({
+  ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }),
+  ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right })
+}))
 
+/**
+ * @class
+ * @template {string} Base
+ * @template {string} Prefix
+ * @implements {API.MultibaseCodec}
+ * @implements {API.MultibaseEncoder}
+ * @implements {API.MultibaseDecoder}
+ * @implements {API.BaseCodec}
+ * @implements {API.BaseEncoder}
+ * @implements {API.BaseDecoder}
+ */
+class blockstore_fs_node_modules_multiformats_src_bases_base_Codec {
   /**
-   *
-   * @template {unknown} Data
-   * @template {number} Format
-   * @template {number} Alg
-   * @template {API.Version} Version
-   * @param {Version} version - Version of the CID
-   * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv
-   * @param {API.MultihashDigest} digest - (Multi)hash of the of the content.
-   * @returns {CID}
+   * @param {Base} name
+   * @param {Prefix} prefix
+   * @param {(bytes:Uint8Array) => string} baseEncode
+   * @param {(text:string) => Uint8Array} baseDecode
    */
-  static create (version, code, digest) {
-    if (typeof code !== 'number') {
-      throw new Error('String codecs are no longer supported')
-    }
-
-    if (!(digest.bytes instanceof Uint8Array)) {
-      throw new Error('Invalid digest')
-    }
-
-    switch (version) {
-      case 0: {
-        if (code !== blockstore_fs_node_modules_multiformats_src_cid_DAG_PB_CODE) {
-          throw new Error(
-            `Version 0 CID must use dag-pb (code: ${blockstore_fs_node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding`
-          )
-        } else {
-          return new blockstore_fs_node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes)
-        }
-      }
-      case 1: {
-        const bytes = blockstore_fs_node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes)
-        return new blockstore_fs_node_modules_multiformats_src_cid_CID(version, code, digest, bytes)
-      }
-      default: {
-        throw new Error('Invalid version')
-      }
-    }
+  constructor (name, prefix, baseEncode, baseDecode) {
+    this.name = name
+    this.prefix = prefix
+    this.baseEncode = baseEncode
+    this.baseDecode = baseDecode
+    this.encoder = new blockstore_fs_node_modules_multiformats_src_bases_base_Encoder(name, prefix, baseEncode)
+    this.decoder = new blockstore_fs_node_modules_multiformats_src_bases_base_Decoder(name, prefix, baseDecode)
   }
 
   /**
-   * Simplified version of `create` for CIDv0.
-   *
-   * @template {unknown} [T=unknown]
-   * @param {API.MultihashDigest} digest - Multihash.
-   * @returns {CID}
+   * @param {Uint8Array} input
    */
-  static createV0 (digest) {
-    return blockstore_fs_node_modules_multiformats_src_cid_CID.create(0, blockstore_fs_node_modules_multiformats_src_cid_DAG_PB_CODE, digest)
+  encode (input) {
+    return this.encoder.encode(input)
   }
 
   /**
-   * Simplified version of `create` for CIDv1.
-   *
-   * @template {unknown} Data
-   * @template {number} Code
-   * @template {number} Alg
-   * @param {Code} code - Content encoding format code.
-   * @param {API.MultihashDigest} digest - Miltihash of the content.
-   * @returns {CID}
+   * @param {string} input
    */
-  static createV1 (code, digest) {
-    return blockstore_fs_node_modules_multiformats_src_cid_CID.create(1, code, digest)
+  decode (input) {
+    return this.decoder.decode(input)
   }
+}
 
-  /**
-   * Decoded a CID from its binary representation. The byte array must contain
-   * only the CID with no additional bytes.
-   *
-   * An error will be thrown if the bytes provided do not contain a valid
-   * binary representation of a CID.
-   *
-   * @template {unknown} Data
-   * @template {number} Code
-   * @template {number} Alg
-   * @template {API.Version} Ver
-   * @param {API.ByteView>} bytes
-   * @returns {CID}
-   */
-  static decode (bytes) {
-    const [cid, remainder] = blockstore_fs_node_modules_multiformats_src_cid_CID.decodeFirst(bytes)
-    if (remainder.length) {
-      throw new Error('Incorrect length')
-    }
-    return cid
+/**
+ * @template {string} Base
+ * @template {string} Prefix
+ * @param {object} options
+ * @param {Base} options.name
+ * @param {Prefix} options.prefix
+ * @param {(bytes:Uint8Array) => string} options.encode
+ * @param {(input:string) => Uint8Array} options.decode
+ * @returns {Codec}
+ */
+const blockstore_fs_node_modules_multiformats_src_bases_base_from = ({ name, prefix, encode, decode }) =>
+  new blockstore_fs_node_modules_multiformats_src_bases_base_Codec(name, prefix, encode, decode)
+
+/**
+ * @template {string} Base
+ * @template {string} Prefix
+ * @param {object} options
+ * @param {Base} options.name
+ * @param {Prefix} options.prefix
+ * @param {string} options.alphabet
+ * @returns {Codec}
+ */
+const blockstore_fs_node_modules_multiformats_src_bases_base_baseX = ({ prefix, name, alphabet }) => {
+  const { encode, decode } = blockstore_fs_node_modules_multiformats_vendor_base_x(alphabet, name)
+  return blockstore_fs_node_modules_multiformats_src_bases_base_from({
+    prefix,
+    name,
+    encode,
+    /**
+     * @param {string} text
+     */
+    decode: text => blockstore_fs_node_modules_multiformats_src_bytes_coerce(decode(text))
+  })
+}
+
+/**
+ * @param {string} string
+ * @param {string} alphabet
+ * @param {number} bitsPerChar
+ * @param {string} name
+ * @returns {Uint8Array}
+ */
+const blockstore_fs_node_modules_multiformats_src_bases_base_decode = (string, alphabet, bitsPerChar, name) => {
+  // Build the character lookup table:
+  /** @type {Record} */
+  const codes = {}
+  for (let i = 0; i < alphabet.length; ++i) {
+    codes[alphabet[i]] = i
   }
 
-  /**
-   * Decoded a CID from its binary representation at the beginning of a byte
-   * array.
-   *
-   * Returns an array with the first element containing the CID and the second
-   * element containing the remainder of the original byte array. The remainder
-   * will be a zero-length byte array if the provided bytes only contained a
-   * binary CID representation.
-   *
-   * @template {unknown} T
-   * @template {number} C
-   * @template {number} A
-   * @template {API.Version} V
-   * @param {API.ByteView>} bytes
-   * @returns {[CID, Uint8Array]}
-   */
-  static decodeFirst (bytes) {
-    const specs = blockstore_fs_node_modules_multiformats_src_cid_CID.inspectBytes(bytes)
-    const prefixSize = specs.size - specs.multihashSize
-    const multihashBytes = blockstore_fs_node_modules_multiformats_src_bytes_coerce(
-      bytes.subarray(prefixSize, prefixSize + specs.multihashSize)
-    )
-    if (multihashBytes.byteLength !== specs.multihashSize) {
-      throw new Error('Incorrect length')
-    }
-    const digestBytes = multihashBytes.subarray(
-      specs.multihashSize - specs.digestSize
-    )
-    const digest = new blockstore_fs_node_modules_multiformats_src_hashes_digest_Digest(
-      specs.multihashCode,
-      specs.digestSize,
-      digestBytes,
-      multihashBytes
-    )
-    const cid =
-      specs.version === 0
-        ? blockstore_fs_node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest))
-        : blockstore_fs_node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest)
-    return [/** @type {CID} */(cid), bytes.subarray(specs.size)]
+  // Count the padding bytes:
+  let end = string.length
+  while (string[end - 1] === '=') {
+    --end
   }
 
-  /**
-   * Inspect the initial bytes of a CID to determine its properties.
-   *
-   * Involves decoding up to 4 varints. Typically this will require only 4 to 6
-   * bytes but for larger multicodec code values and larger multihash digest
-   * lengths these varints can be quite large. It is recommended that at least
-   * 10 bytes be made available in the `initialBytes` argument for a complete
-   * inspection.
-   *
-   * @template {unknown} T
-   * @template {number} C
-   * @template {number} A
-   * @template {API.Version} V
-   * @param {API.ByteView>} initialBytes
-   * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }}
-   */
-  static inspectBytes (initialBytes) {
-    let offset = 0
-    const next = () => {
-      const [i, length] = blockstore_fs_node_modules_multiformats_src_varint_decode(initialBytes.subarray(offset))
-      offset += length
-      return i
-    }
+  // Allocate the output:
+  const out = new Uint8Array((end * bitsPerChar / 8) | 0)
 
-    let version = /** @type {V} */ (next())
-    let codec = /** @type {C} */ (blockstore_fs_node_modules_multiformats_src_cid_DAG_PB_CODE)
-    if (/** @type {number} */(version) === 18) {
-      // CIDv0
-      version = /** @type {V} */ (0)
-      offset = 0
-    } else {
-      codec = /** @type {C} */ (next())
+  // Parse the data:
+  let bits = 0 // Number of bits currently in the buffer
+  let buffer = 0 // Bits waiting to be written out, MSB first
+  let written = 0 // Next byte to write
+  for (let i = 0; i < end; ++i) {
+    // Read one character from the string:
+    const value = codes[string[i]]
+    if (value === undefined) {
+      throw new SyntaxError(`Non-${name} character`)
     }
 
-    if (version !== 0 && version !== 1) {
-      throw new RangeError(`Invalid CID version ${version}`)
-    }
+    // Append the bits to the buffer:
+    buffer = (buffer << bitsPerChar) | value
+    bits += bitsPerChar
 
-    const prefixSize = offset
-    const multihashCode = /** @type {A} */ (next()) // multihash code
-    const digestSize = next() // multihash length
-    const size = offset + digestSize
-    const multihashSize = size - prefixSize
+    // Write out some bits if the buffer has a byte's worth:
+    if (bits >= 8) {
+      bits -= 8
+      out[written++] = 0xff & (buffer >> bits)
+    }
+  }
 
-    return { version, codec, multihashCode, digestSize, multihashSize, size }
+  // Verify that we have received just enough bits:
+  if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) {
+    throw new SyntaxError('Unexpected end of data')
   }
 
-  /**
-   * Takes cid in a string representation and creates an instance. If `base`
-   * decoder is not provided will use a default from the configuration. It will
-   * throw an error if encoding of the CID is not compatible with supplied (or
-   * a default decoder).
-   *
-   * @template {string} Prefix
-   * @template {unknown} Data
-   * @template {number} Code
-   * @template {number} Alg
-   * @template {API.Version} Ver
-   * @param {API.ToString, Prefix>} source
-   * @param {API.MultibaseDecoder} [base]
-   * @returns {CID}
-   */
-  static parse (source, base) {
-    const [prefix, bytes] = blockstore_fs_node_modules_multiformats_src_cid_parseCIDtoBytes(source, base)
+  return out
+}
 
-    const cid = blockstore_fs_node_modules_multiformats_src_cid_CID.decode(bytes)
+/**
+ * @param {Uint8Array} data
+ * @param {string} alphabet
+ * @param {number} bitsPerChar
+ * @returns {string}
+ */
+const blockstore_fs_node_modules_multiformats_src_bases_base_encode = (data, alphabet, bitsPerChar) => {
+  const pad = alphabet[alphabet.length - 1] === '='
+  const mask = (1 << bitsPerChar) - 1
+  let out = ''
 
-    if (cid.version === 0 && source[0] !== 'Q') {
-      throw Error('Version 0 CID string must not include multibase prefix')
+  let bits = 0 // Number of bits currently in the buffer
+  let buffer = 0 // Bits waiting to be written out, MSB first
+  for (let i = 0; i < data.length; ++i) {
+    // Slurp data into the buffer:
+    buffer = (buffer << 8) | data[i]
+    bits += 8
+
+    // Write out as much as we can:
+    while (bits > bitsPerChar) {
+      bits -= bitsPerChar
+      out += alphabet[mask & (buffer >> bits)]
     }
+  }
 
-    // Cache string representation to avoid computing it on `this.toString()`
-    blockstore_fs_node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source)
+  // Partial character:
+  if (bits) {
+    out += alphabet[mask & (buffer << (bitsPerChar - bits))]
+  }
 
-    return cid
+  // Add padding characters until we hit a byte boundary:
+  if (pad) {
+    while ((out.length * bitsPerChar) & 7) {
+      out += '='
+    }
   }
+
+  return out
 }
 
 /**
+ * RFC4648 Factory
+ *
+ * @template {string} Base
  * @template {string} Prefix
- * @template {unknown} Data
- * @template {number} Code
- * @template {number} Alg
- * @template {API.Version} Ver
- * @param {API.ToString, Prefix>} source
- * @param {API.MultibaseDecoder} [base]
- * @returns {[Prefix, API.ByteView>]}
+ * @param {object} options
+ * @param {Base} options.name
+ * @param {Prefix} options.prefix
+ * @param {string} options.alphabet
+ * @param {number} options.bitsPerChar
  */
-const blockstore_fs_node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => {
-  switch (source[0]) {
-    // CIDv0 is parsed differently
-    case 'Q': {
-      const decoder = base || blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc
-      return [
-        /** @type {Prefix} */ (blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc.prefix),
-        decoder.decode(`${blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc.prefix}${source}`)
-      ]
-    }
-    case blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc.prefix: {
-      const decoder = base || blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc
-      return [/** @type {Prefix} */(blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc.prefix), decoder.decode(source)]
-    }
-    case blockstore_fs_node_modules_multiformats_src_bases_base32_base32.prefix: {
-      const decoder = base || blockstore_fs_node_modules_multiformats_src_bases_base32_base32
-      return [/** @type {Prefix} */(blockstore_fs_node_modules_multiformats_src_bases_base32_base32.prefix), decoder.decode(source)]
-    }
-    default: {
-      if (base == null) {
-        throw Error(
-          'To parse non base32 or base58btc encoded CID multibase decoder must be provided'
-        )
-      }
-      return [/** @type {Prefix} */(source[0]), base.decode(source)]
+const blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => {
+  return blockstore_fs_node_modules_multiformats_src_bases_base_from({
+    prefix,
+    name,
+    encode (input) {
+      return blockstore_fs_node_modules_multiformats_src_bases_base_encode(input, alphabet, bitsPerChar)
+    },
+    decode (input) {
+      return blockstore_fs_node_modules_multiformats_src_bases_base_decode(input, alphabet, bitsPerChar, name)
     }
-  }
+  })
 }
 
-/**
- *
- * @param {Uint8Array} bytes
- * @param {Map} cache
- * @param {API.MultibaseEncoder<'z'>} base
- */
-const blockstore_fs_node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => {
-  const { prefix } = base
-  if (prefix !== blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc.prefix) {
-    throw Error(`Cannot string encode V0 in ${base.name} encoding`)
-  }
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/src/bases/base32.js
+
+
+const blockstore_fs_node_modules_multiformats_src_bases_base32_base32 = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'b',
+  name: 'base32',
+  alphabet: 'abcdefghijklmnopqrstuvwxyz234567',
+  bitsPerChar: 5
+})
+
+const blockstore_fs_node_modules_multiformats_src_bases_base32_base32upper = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'B',
+  name: 'base32upper',
+  alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567',
+  bitsPerChar: 5
+})
+
+const blockstore_fs_node_modules_multiformats_src_bases_base32_base32pad = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'c',
+  name: 'base32pad',
+  alphabet: 'abcdefghijklmnopqrstuvwxyz234567=',
+  bitsPerChar: 5
+})
+
+const blockstore_fs_node_modules_multiformats_src_bases_base32_base32padupper = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'C',
+  name: 'base32padupper',
+  alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=',
+  bitsPerChar: 5
+})
+
+const blockstore_fs_node_modules_multiformats_src_bases_base32_base32hex = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'v',
+  name: 'base32hex',
+  alphabet: '0123456789abcdefghijklmnopqrstuv',
+  bitsPerChar: 5
+})
+
+const blockstore_fs_node_modules_multiformats_src_bases_base32_base32hexupper = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'V',
+  name: 'base32hexupper',
+  alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV',
+  bitsPerChar: 5
+})
+
+const blockstore_fs_node_modules_multiformats_src_bases_base32_base32hexpad = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 't',
+  name: 'base32hexpad',
+  alphabet: '0123456789abcdefghijklmnopqrstuv=',
+  bitsPerChar: 5
+})
+
+const blockstore_fs_node_modules_multiformats_src_bases_base32_base32hexpadupper = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'T',
+  name: 'base32hexpadupper',
+  alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=',
+  bitsPerChar: 5
+})
+
+const blockstore_fs_node_modules_multiformats_src_bases_base32_base32z = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'h',
+  name: 'base32z',
+  alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769',
+  bitsPerChar: 5
+})
+
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/src/bases/base58.js
+
+
+const blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc = blockstore_fs_node_modules_multiformats_src_bases_base_baseX({
+  name: 'base58btc',
+  prefix: 'z',
+  alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
+})
+
+const blockstore_fs_node_modules_multiformats_src_bases_base58_base58flickr = blockstore_fs_node_modules_multiformats_src_bases_base_baseX({
+  name: 'base58flickr',
+  prefix: 'Z',
+  alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'
+})
+
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/src/bases/base64.js
+// @ts-check
+
+
+
+const blockstore_fs_node_modules_multiformats_src_bases_base64_base64 = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'm',
+  name: 'base64',
+  alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
+  bitsPerChar: 6
+})
 
-  const cid = cache.get(prefix)
-  if (cid == null) {
-    const cid = base.encode(bytes).slice(1)
-    cache.set(prefix, cid)
-    return cid
-  } else {
-    return cid
-  }
-}
+const blockstore_fs_node_modules_multiformats_src_bases_base64_base64pad = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'M',
+  name: 'base64pad',
+  alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
+  bitsPerChar: 6
+})
 
-/**
- * @template {string} Prefix
- * @param {Uint8Array} bytes
- * @param {Map} cache
- * @param {API.MultibaseEncoder} base
- */
-const blockstore_fs_node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => {
-  const { prefix } = base
-  const cid = cache.get(prefix)
-  if (cid == null) {
-    const cid = base.encode(bytes)
-    cache.set(prefix, cid)
-    return cid
-  } else {
-    return cid
-  }
-}
+const blockstore_fs_node_modules_multiformats_src_bases_base64_base64url = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'u',
+  name: 'base64url',
+  alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',
+  bitsPerChar: 6
+})
 
-const blockstore_fs_node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70
-const blockstore_fs_node_modules_multiformats_src_cid_SHA_256_CODE = 0x12
+const blockstore_fs_node_modules_multiformats_src_bases_base64_base64urlpad = blockstore_fs_node_modules_multiformats_src_bases_base_rfc4648({
+  prefix: 'U',
+  name: 'base64urlpad',
+  alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=',
+  bitsPerChar: 6
+})
 
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/@libp2p/logger/dist/src/index.js
 /**
- * @param {API.Version} version
- * @param {number} code
- * @param {Uint8Array} multihash
- * @returns {Uint8Array}
+ * @packageDocumentation
+ *
+ * A logger for libp2p based on the venerable [debug](https://www.npmjs.com/package/debug) module.
+ *
+ * @example
+ *
+ * ```JavaScript
+ * import { logger } from '@libp2p/logger'
+ *
+ * const log = logger('libp2p:my:component:name')
+ *
+ * log('something happened: %s', 'it was ok')
+ * log.error('something bad happened: %o', err)
+ *
+ * log('with this peer: %p', aPeerId)
+ * log('and this base58btc: %b', aUint8Array)
+ * log('and this base32: %t', aUint8Array)
+ *  ```
+ * ```console
+ * $ DEBUG=libp2p:* node index.js
+ * something happened: it was ok
+ * something bad happened: 
+ * with this peer: 12D3Foo
+ * with this base58btc: Qmfoo
+ * with this base32: bafyfoo
+ * ```
  */
-const blockstore_fs_node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => {
-  const codeOffset = blockstore_fs_node_modules_multiformats_src_varint_encodingLength(version)
-  const hashOffset = codeOffset + blockstore_fs_node_modules_multiformats_src_varint_encodingLength(code)
-  const bytes = new Uint8Array(hashOffset + multihash.byteLength)
-  blockstore_fs_node_modules_multiformats_src_varint_encodeTo(version, bytes, 0)
-  blockstore_fs_node_modules_multiformats_src_varint_encodeTo(code, bytes, codeOffset)
-  bytes.set(multihash, hashOffset)
-  return bytes
-}
 
-const blockstore_fs_node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID')
 
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/dist/src/sharding.js
 
 
 
+// Add a formatter for converting to a base58 string
+debug_src.formatters.b = (v) => {
+    return v == null ? 'undefined' : blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc.baseEncode(v);
+};
+// Add a formatter for converting to a base32 string
+debug_src.formatters.t = (v) => {
+    return v == null ? 'undefined' : blockstore_fs_node_modules_multiformats_src_bases_base32_base32.baseEncode(v);
+};
+// Add a formatter for converting to a base64 string
+debug_src.formatters.m = (v) => {
+    return v == null ? 'undefined' : blockstore_fs_node_modules_multiformats_src_bases_base64_base64.baseEncode(v);
+};
+// Add a formatter for stringifying peer ids
+debug_src.formatters.p = (v) => {
+    return v == null ? 'undefined' : v.toString();
+};
+// Add a formatter for stringifying CIDs
+debug_src.formatters.c = (v) => {
+    return v == null ? 'undefined' : v.toString();
+};
+// Add a formatter for stringifying Datastore keys
+debug_src.formatters.k = (v) => {
+    return v == null ? 'undefined' : v.toString();
+};
+// Add a formatter for stringifying Multiaddrs
+debug_src.formatters.a = (v) => {
+    return v == null ? 'undefined' : v.toString();
+};
+function logger_dist_src_createDisabledLogger(namespace) {
+    const logger = () => { };
+    logger.enabled = false;
+    logger.color = '';
+    logger.diff = 0;
+    logger.log = () => { };
+    logger.namespace = namespace;
+    logger.destroy = () => true;
+    logger.extend = () => logger;
+    return logger;
+}
 /**
- * A sharding strategy that takes the last few characters of a multibase encoded
- * CID and uses them as the directory to store the block in. This prevents
- * storing all blocks in a single directory which would overwhelm most
- * filesystems.
+ * Create a component logger that will prefix any log messages with a truncated
+ * peer id.
+ *
+ * @example
+ *
+ * ```TypeScript
+ * import { peerLogger } from '@libp2p/logger'
+ * import { peerIdFromString } from '@libp2p/peer-id'
+ *
+ * const peerId = peerIdFromString('12D3FooBar')
+ * const logger = peerLogger(peerId)
+ *
+ * const log = logger.forComponent('my-component')
+ * log.info('hello world')
+ * // logs "12…oBar:my-component hello world"
+ * ```
  */
-class NextToLast {
-    extension;
-    prefixLength;
-    base;
-    constructor(init = {}) {
-        this.extension = init.extension ?? '.data';
-        this.prefixLength = init.prefixLength ?? 2;
-        this.base = init.base ?? blockstore_fs_node_modules_multiformats_src_bases_base32_base32upper;
-    }
-    encode(cid) {
-        const str = this.base.encoder.encode(cid.multihash.bytes);
-        const prefix = str.substring(str.length - this.prefixLength);
-        return {
-            dir: prefix,
-            file: `${str}${this.extension}`
-        };
-    }
-    decode(str) {
-        let fileName = external_node_path_namespaceObject.basename(str);
-        if (fileName.endsWith(this.extension)) {
-            fileName = fileName.substring(0, fileName.length - this.extension.length);
-        }
-        return blockstore_fs_node_modules_multiformats_src_cid_CID.decode(this.base.decoder.decode(fileName));
-    }
+function src_peerLogger(peerId, options = {}) {
+    return src_prefixLogger(truncatePeerId(peerId, options));
 }
 /**
- * A sharding strategy that does not do any sharding and stores all files
- * in one directory. Only for testing, do not use in production.
+ * Create a component logger that will prefix any log messages with the passed
+ * string.
+ *
+ * @example
+ *
+ * ```TypeScript
+ * import { prefixLogger } from '@libp2p/logger'
+ *
+ * const logger = prefixLogger('my-node')
+ *
+ * const log = logger.forComponent('my-component')
+ * log.info('hello world')
+ * // logs "my-node:my-component hello world"
+ * ```
  */
-class FlatDirectory {
-    extension;
-    base;
-    constructor(init = {}) {
-        this.extension = init.extension ?? '.data';
-        this.base = init.base ?? base32upper;
-    }
-    encode(cid) {
-        const str = this.base.encoder.encode(cid.multihash.bytes);
-        return {
-            dir: '',
-            file: `${str}${this.extension}`
-        };
-    }
-    decode(str) {
-        let fileName = path.basename(str);
-        if (fileName.endsWith(this.extension)) {
-            fileName = fileName.substring(0, fileName.length - this.extension.length);
+function src_prefixLogger(prefix) {
+    return {
+        forComponent(name) {
+            return logger_dist_src_logger(`${prefix}:${name}`);
         }
-        return CID.decode(this.base.decoder.decode(fileName));
-    }
+    };
 }
-//# sourceMappingURL=sharding.js.map
-;// CONCATENATED MODULE: ./node_modules/blockstore-fs/dist/src/index.js
 /**
- * @packageDocumentation
+ * Create a component logger
  *
- * A Blockstore implementation that stores blocks in the local filesystem.
+ * @example
+ *
+ * ```TypeScript
+ * import { defaultLogger } from '@libp2p/logger'
+ * import { peerIdFromString } from '@libp2p/peer-id'
+ *
+ * const logger = defaultLogger()
+ *
+ * const log = logger.forComponent('my-component')
+ * log.info('hello world')
+ * // logs "my-component hello world"
+ * ```
+ */
+function src_defaultLogger() {
+    return {
+        forComponent(name) {
+            return logger_dist_src_logger(name);
+        }
+    };
+}
+/**
+ * Creates a logger for the passed component name.
  *
  * @example
  *
- * ```js
- * import { FsBlockstore } from 'blockstore-fs'
+ * ```TypeScript
+ * import { logger } from '@libp2p/logger'
  *
- * const store = new FsBlockstore('path/to/store')
+ * const log = logger('my-component')
+ * log.info('hello world')
+ * // logs "my-component hello world"
  * ```
  */
+function logger_dist_src_logger(name) {
+    // trace logging is a no-op by default
+    let trace = logger_dist_src_createDisabledLogger(`${name}:trace`);
+    // look at all the debug names and see if trace logging has explicitly been enabled
+    if (debug_src.enabled(`${name}:trace`) && debug_src.names.map(r => r.toString()).find(n => n.includes(':trace')) != null) {
+        trace = debug_src(`${name}:trace`);
+    }
+    return Object.assign(debug_src(name), {
+        error: debug_src(`${name}:error`),
+        trace
+    });
+}
+function logger_dist_src_disable() {
+    debug.disable();
+}
+function logger_dist_src_enable(namespaces) {
+    debug.enable(namespaces);
+}
+function logger_dist_src_enabled(namespaces) {
+    return debug.enabled(namespaces);
+}
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/dist/src/tiered.js
 
 
 
 
-// @ts-expect-error no types
-
-
 
 
 
-const writeAtomic = (0,external_node_util_.promisify)(fast_write_atomic);
-/**
- * Write a file atomically
- */
-async function writeFile(file, contents) {
-    try {
-        await writeAtomic(file, contents);
-    }
-    catch (err) {
-        if (err.code === 'EPERM' && err.syscall === 'rename') {
-            // fast-write-atomic writes a file to a temp location before renaming it.
-            // On Windows, if the final file already exists this error is thrown.
-            // No such error is thrown on Linux/Mac
-            // Make sure we can read & write to this file
-            await external_node_fs_promises_namespaceObject.access(file, external_node_fs_promises_namespaceObject.constants.F_OK | external_node_fs_promises_namespaceObject.constants.W_OK);
-            // The file was created by another context - this means there were
-            // attempts to write the same block by two different function calls
-            return;
-        }
-        throw err;
-    }
-}
+const tiered_log = logger_dist_src_logger('blockstore:core:tiered');
 /**
- * A blockstore backed by the file system
+ * A blockstore that can combine multiple stores. Puts and deletes
+ * will write through to all blockstores. Has and get will
+ * try each store sequentially. getAll will use every store but also
+ * deduplicate any yielded pairs.
  */
-class FsBlockstore {
-    path;
-    createIfMissing;
-    errorIfExists;
-    putManyConcurrency;
-    getManyConcurrency;
-    deleteManyConcurrency;
-    shardingStrategy;
-    constructor(location, init = {}) {
-        this.path = external_node_path_namespaceObject.resolve(location);
-        this.createIfMissing = init.createIfMissing ?? true;
-        this.errorIfExists = init.errorIfExists ?? false;
-        this.deleteManyConcurrency = init.deleteManyConcurrency ?? 50;
-        this.getManyConcurrency = init.getManyConcurrency ?? 50;
-        this.putManyConcurrency = init.putManyConcurrency ?? 50;
-        this.shardingStrategy = init.shardingStrategy ?? new NextToLast();
+class TieredBlockstore extends (/* unused pure expression or super */ null && (BaseBlockstore)) {
+    stores;
+    constructor(stores) {
+        super();
+        this.stores = stores.slice();
     }
-    async open() {
+    async put(key, value, options) {
         try {
-            await external_node_fs_promises_namespaceObject.access(this.path, external_node_fs_promises_namespaceObject.constants.F_OK | external_node_fs_promises_namespaceObject.constants.W_OK);
-            if (this.errorIfExists) {
-                throw src_Errors.openFailedError(new Error(`Blockstore directory: ${this.path} already exists`));
-            }
+            await Promise.all(this.stores.map(async (store) => { await store.put(key, value, options); }));
+            return key;
         }
         catch (err) {
-            if (err.code === 'ENOENT') {
-                if (this.createIfMissing) {
-                    await external_node_fs_promises_namespaceObject.mkdir(this.path, { recursive: true });
-                    return;
-                }
-                else {
-                    throw src_Errors.openFailedError(new Error(`Blockstore directory: ${this.path} does not exist`));
-                }
-            }
-            throw err;
+            throw Errors.putFailedError(err);
         }
     }
-    async close() {
-        await Promise.resolve();
-    }
-    async put(key, val) {
-        const { dir, file } = this.shardingStrategy.encode(key);
-        try {
-            if (dir != null && dir !== '') {
-                await external_node_fs_promises_namespaceObject.mkdir(external_node_path_namespaceObject.join(this.path, dir), {
-                    recursive: true
-                });
+    async get(key, options) {
+        for (const store of this.stores) {
+            try {
+                const res = await store.get(key, options);
+                if (res != null)
+                    return res;
+            }
+            catch (err) {
+                tiered_log.error(err);
             }
-            await writeFile(external_node_path_namespaceObject.join(this.path, dir, file), val);
-            return key;
-        }
-        catch (err) {
-            throw src_Errors.putFailedError(err);
         }
+        throw Errors.notFoundError();
     }
-    async *putMany(source) {
-        yield* src_parallelBatch(blockstore_fs_node_modules_it_map_dist_src(source, ({ cid, block }) => {
-            return async () => {
-                await this.put(cid, block);
-                return cid;
-            };
-        }), this.putManyConcurrency);
-    }
-    async get(key) {
-        const { dir, file } = this.shardingStrategy.encode(key);
-        try {
-            return await external_node_fs_promises_namespaceObject.readFile(external_node_path_namespaceObject.join(this.path, dir, file));
-        }
-        catch (err) {
-            throw src_Errors.notFoundError(err);
+    async has(key, options) {
+        for (const s of this.stores) {
+            if (await s.has(key, options)) {
+                return true;
+            }
         }
+        return false;
     }
-    async *getMany(source) {
-        yield* src_parallelBatch(blockstore_fs_node_modules_it_map_dist_src(source, key => {
-            return async () => {
-                return {
-                    cid: key,
-                    block: await this.get(key)
-                };
-            };
-        }), this.getManyConcurrency);
-    }
-    async delete(key) {
-        const { dir, file } = this.shardingStrategy.encode(key);
+    async delete(key, options) {
         try {
-            await external_node_fs_promises_namespaceObject.unlink(external_node_path_namespaceObject.join(this.path, dir, file));
+            await Promise.all(this.stores.map(async (store) => { await store.delete(key, options); }));
         }
         catch (err) {
-            if (err.code === 'ENOENT') {
-                return;
-            }
-            throw src_Errors.deleteFailedError(err);
+            throw Errors.deleteFailedError(err);
         }
     }
-    async *deleteMany(source) {
-        yield* src_parallelBatch(blockstore_fs_node_modules_it_map_dist_src(source, key => {
-            return async () => {
-                await this.delete(key);
-                return key;
-            };
-        }), this.deleteManyConcurrency);
-    }
-    /**
-     * Check for the existence of the given key
-     */
-    async has(key) {
-        const { dir, file } = this.shardingStrategy.encode(key);
+    async *putMany(source, options = {}) {
+        let error;
+        const pushables = this.stores.map(store => {
+            const source = pushable({
+                objectMode: true
+            });
+            drain(store.putMany(source, options))
+                .catch(err => {
+                // store threw while putting, make sure we bubble the error up
+                error = err;
+            });
+            return source;
+        });
         try {
-            await external_node_fs_promises_namespaceObject.access(external_node_path_namespaceObject.join(this.path, dir, file));
+            for await (const pair of source) {
+                if (error != null) {
+                    throw error;
+                }
+                pushables.forEach(p => p.push(pair));
+                yield pair.cid;
+            }
         }
-        catch (err) {
-            return false;
+        finally {
+            pushables.forEach(p => p.end());
         }
-        return true;
     }
-    async *getAll() {
-        const pattern = `**/*${this.shardingStrategy.extension}`
-            .split(external_node_path_namespaceObject.sep)
-            .join('/');
-        const files = dist_src_glob(this.path, pattern, {
-            absolute: true
+    async *deleteMany(source, options = {}) {
+        let error;
+        const pushables = this.stores.map(store => {
+            const source = pushable({
+                objectMode: true
+            });
+            drain(store.deleteMany(source, options))
+                .catch(err => {
+                // store threw while deleting, make sure we bubble the error up
+                error = err;
+            });
+            return source;
         });
-        for await (const file of files) {
-            try {
-                const buf = await external_node_fs_promises_namespaceObject.readFile(file);
-                const pair = {
-                    cid: this.shardingStrategy.decode(file),
-                    block: buf
-                };
-                yield pair;
-            }
-            catch (err) {
-                // if keys are removed from the blockstore while the query is
-                // running, we may encounter missing files.
-                if (err.code !== 'ENOENT') {
-                    throw err;
+        try {
+            for await (const key of source) {
+                if (error != null) {
+                    throw error;
                 }
+                pushables.forEach(p => p.push(key));
+                yield key;
             }
         }
+        finally {
+            pushables.forEach(p => p.end());
+        }
+    }
+    async *getAll(options) {
+        // deduplicate yielded pairs
+        const seen = new Set();
+        yield* filter(merge(...this.stores.map(s => s.getAll(options))), (pair) => {
+            const cidStr = pair.cid.toString();
+            if (seen.has(cidStr)) {
+                return false;
+            }
+            seen.add(cidStr);
+            return true;
+        });
     }
 }
-//# sourceMappingURL=index.js.map
-;// CONCATENATED MODULE: external "node:os"
-const external_node_os_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:os");
-// EXTERNAL MODULE: external "node:stream"
-var external_node_stream_ = __nccwpck_require__(84492);
-// EXTERNAL MODULE: ./node_modules/@filebase/sdk/node_modules/uuid/dist/index.js
-var uuid_dist = __nccwpck_require__(74700);
-;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/uuid/wrapper.mjs
-
-const v1 = uuid_dist.v1;
-const v3 = uuid_dist.v3;
-const v4 = uuid_dist.v4;
-const v5 = uuid_dist.v5;
-const NIL = uuid_dist/* NIL */.zR;
-const version = uuid_dist/* version */.i8;
-const wrapper_validate = uuid_dist/* validate */.Gu;
-const stringify = uuid_dist/* stringify */.Pz;
-const wrapper_parse = uuid_dist/* parse */.Qc;
-
-;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/dist/index.mjs
-
-
-
-
-
-
-
-
-
-
-
+//# sourceMappingURL=tiered.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/blockstore-core/dist/src/index.js
+/**
+ * @packageDocumentation
+ *
+ * Various Blockstore implementations are available.
+ *
+ * ## Implementations
+ *
+ * - Base: [`src/base`](src/base.ts)
+ * - Memory: [`src/memory`](src/memory.ts)
+ * - BlackHole: ['src/black-hole](src/black-hole.ts)
+ * - Tiered: ['src/tiered](src/tiered.ts)
+ *
+ * @example BaseBlockstore
+ *
+ * Provides a complete implementation of the Blockstore interface.  You must implement `.get`, `.put`, etc.
+ *
+ * ```js
+ * import { BaseBlockstore } from 'blockstore-core/base'
+ *
+ * class MyCustomBlockstore extends BaseBlockstore {
+ *   put (key, val, options) {
+ *     // store a block
+ *   }
+ *
+ *   get (key, options) {
+ *     // retrieve a block
+ *   }
+ *
+ *   // ...etc
+ * }
+ * ```
+ *
+ * @example MemoryBlockstore
+ *
+ * A simple Blockstore that stores blocks in memory.
+ *
+ * ```js
+ * import { MemoryBlockstore } from 'blockstore-core/memory'
+ *
+ * const store = new MemoryBlockstore()
+ * ```
+ *
+ * @example BlackHoleBlockstore
+ *
+ * A Blockstore that does not store any blocks.
+ *
+ * ```js
+ * import { BlackHoleBlockstore } from 'blockstore-core/black-hole'
+ *
+ * const store = new BlackHoleBlockstore()
+ * ```
+ *
+ * @example TieredBlockstore
+ *
+ * A tiered blockstore wraps one or more blockstores and will query each in parallel to retrieve a block - the operation will succeed if any wrapped store has the block.
+ *
+ * Writes are invoked on all wrapped blockstores.
+ *
+ * ```js
+ * import { TieredBlockstore } from 'blockstore-core/tiered'
+ *
+ * const store = new TieredBlockstore([
+ *   store1,
+ *   store2,
+ *   // ...etc
+ * ])
+ * ```
+ */
 
 
 
-var __accessCheck$4 = (obj, member, msg) => {
-  if (!member.has(obj))
-    throw TypeError("Cannot " + msg);
-};
-var __privateGet$4 = (obj, member, getter) => {
-  __accessCheck$4(obj, member, "read from private field");
-  return getter ? getter.call(obj) : member.get(obj);
-};
-var __privateAdd$4 = (obj, member, value) => {
-  if (member.has(obj))
-    throw TypeError("Cannot add the same private member more than once");
-  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
-};
-var __privateSet$4 = (obj, member, value, setter) => {
-  __accessCheck$4(obj, member, "write to private field");
-  setter ? setter.call(obj, value) : member.set(obj, value);
-  return value;
-};
-var _DEFAULT_ENDPOINT$4, _DEFAULT_REGION$1, _client$4;
-class BucketManager {
-  /**
-   * @summary Creates a new instance of the constructor.
-   * @param {string} clientKey - The access key ID for authentication.
-   * @param {string} clientSecret - The secret access key for authentication.
-   * @tutorial quickstart-bucket
-   * @example
-   * import { BucketManager } from "@filebase/sdk";
-   * const bucketManager = new BucketManager("KEY_FROM_DASHBOARD", "SECRET_FROM_DASHBOARD");
-   */
-  constructor(clientKey, clientSecret) {
-    __privateAdd$4(this, _DEFAULT_ENDPOINT$4, "https://s3.filebase.com");
-    __privateAdd$4(this, _DEFAULT_REGION$1, "us-east-1");
-    __privateAdd$4(this, _client$4, void 0);
-    const clientEndpoint = process.env.NODE_ENV === "test" ? process.env.TEST_S3_ENDPOINT || __privateGet$4(this, _DEFAULT_ENDPOINT$4) : __privateGet$4(this, _DEFAULT_ENDPOINT$4), clientConfiguration = {
-      credentials: {
-        accessKeyId: clientKey,
-        secretAccessKey: clientSecret
-      },
-      endpoint: clientEndpoint,
-      region: __privateGet$4(this, _DEFAULT_REGION$1),
-      forcePathStyle: true
-    };
-    __privateSet$4(this, _client$4, new S3Client(clientConfiguration));
-  }
-  /**
-   * @typedef {Object} bucket
-   * @property {string} Name The name of the bucket
-   * @property {date} Date the bucket was created
-   */
-  /**
-   * @summary Creates a new bucket with the specified name.
-   * @param {string} name - The name of the bucket to create.
-   * @returns {Promise} - A promise that resolves when the bucket is created.
-   * @example
-   * // Create bucket with name of `create-bucket-example`
-   * await bucketManager.create(`create-bucket-example`);
-   */
-  async create(name) {
-    const command = new CreateBucketCommand({
-      Bucket: name
-    });
-    return await __privateGet$4(this, _client$4).send(command);
-  }
-  /**
-   * @summary Lists the buckets in the client.
-   * @returns {Promise>} - A promise that resolves with an array of objects representing the buckets in the client.
-   * @example
-   * // List all buckets
-   * await bucketManager.list();
-   */
-  async list() {
-    const command = new ListBucketsCommand({}), { Buckets } = await __privateGet$4(this, _client$4).send(command);
-    return Buckets;
-  }
-  /**
-   * @summary Deletes the specified bucket.
-   * @param {string} name - The name of the bucket to delete.
-   * @returns {Promise} - A promise that resolves when the bucket is deleted.
-   * @example
-   * // Delete bucket with name of `bucket-name-to-delete`
-   * await bucketManager.delete(`bucket-name-to-delete`);
-   */
-  async delete(name) {
-    const command = new DeleteBucketCommand({
-      Bucket: name
-    });
-    await __privateGet$4(this, _client$4).send(command);
-    return true;
-  }
-  /**
-   * @summary Sets the privacy of a given bucket.
-   * @param {string} name - The name of the bucket to toggle.
-   * @param {boolean} targetState - The new target state. [true=private,false=public]
-   * @returns {Promise} A promise that resolves to true if the bucket was successfully toggled.
-   * @example
-   * // Toggle bucket with label of `toggle-bucket-example`
-   * await bucketManager.setPrivacy(`toggle-bucket-example`, true);  // Enabled
-   * await bucketManager.setPrivacy(`toggle-bucket-example`, false); // Disabled
-   */
-  async setPrivacy(name, targetState) {
-    const command = new PutBucketAclCommand({
-      Bucket: name,
-      ACL: targetState ? "private" : "public-read"
-    });
-    await __privateGet$4(this, _client$4).send(command);
-    return true;
-  }
-  /**
-   * @summary Gets the privacy of a given bucket
-   * @param {string} name - The name of the bucket to query.
-   * @returns {Promise} A promise that resolves to true if the bucket is private.
-   */
-  async getPrivacy(name) {
-    const command = new GetBucketAclCommand({
-      Bucket: name
-    });
-    const response = await __privateGet$4(this, _client$4).send(command), readPermission = response.Grants.find((grant) => {
-      return grant.Grantee.Type === "Group" && grant.Permission === "READ";
-    });
-    return !(typeof readPermission !== "undefined");
-  }
-}
-_DEFAULT_ENDPOINT$4 = new WeakMap();
-_DEFAULT_REGION$1 = new WeakMap();
-_client$4 = new WeakMap();
 
-const GATEWAY_DEFAULT_TIMEOUT = 6e4;
-async function downloadFromGateway(cid, options) {
-  if (typeof options.endpoint !== "string") {
-    throw new Error(`Default Gateway must be set`);
-  }
-  const downloadHeaders = {};
-  if (options.token) {
-    downloadHeaders["x-filebase-gateway-token"] = options.token;
-  }
-  const downloadResponse = await lib_axios.request({
-    method: "GET",
-    baseURL: options.endpoint,
-    url: `/ipfs/${cid}`,
-    headers: downloadHeaders,
-    type: "stream",
-    timeout: options?.timeout || GATEWAY_DEFAULT_TIMEOUT
-  });
-  return downloadResponse.data;
-}
-function apiErrorHandler(err) {
-  if (err?.response && err?.response?.status && (err.response.status.toString()[0] === "4" || err.response.status.toString()[0] === "5")) {
-    throw new Error(
-      err.response.data.error?.details || err.response.data.error?.reason || err
-    );
-  }
-  throw err;
-}
 
-var __accessCheck$3 = (obj, member, msg) => {
-  if (!member.has(obj))
-    throw TypeError("Cannot " + msg);
+const src_Errors = {
+    ...blockstore_core_dist_src_errors_namespaceObject
 };
-var __privateGet$3 = (obj, member, getter) => {
-  __accessCheck$3(obj, member, "read from private field");
-  return getter ? getter.call(obj) : member.get(obj);
+//# sourceMappingURL=index.js.map
+// EXTERNAL MODULE: ./node_modules/fast-write-atomic/index.js
+var fast_write_atomic = __nccwpck_require__(90078);
+// EXTERNAL MODULE: ./node_modules/blockstore-fs/node_modules/brace-expansion/index.js
+var node_modules_brace_expansion = __nccwpck_require__(71610);
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/minimatch/dist/mjs/assert-valid-pattern.js
+const assert_valid_pattern_MAX_PATTERN_LENGTH = 1024 * 64;
+const assert_valid_pattern_assertValidPattern = (pattern) => {
+    if (typeof pattern !== 'string') {
+        throw new TypeError('invalid pattern');
+    }
+    if (pattern.length > assert_valid_pattern_MAX_PATTERN_LENGTH) {
+        throw new TypeError('pattern is too long');
+    }
 };
-var __privateAdd$3 = (obj, member, value) => {
-  if (member.has(obj))
-    throw TypeError("Cannot add the same private member more than once");
-  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
+//# sourceMappingURL=assert-valid-pattern.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/minimatch/dist/mjs/brace-expressions.js
+// translate the various posix character classes into unicode properties
+// this works across all unicode locales
+// { : [, /u flag required, negated]
+const brace_expressions_posixClasses = {
+    '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true],
+    '[:alpha:]': ['\\p{L}\\p{Nl}', true],
+    '[:ascii:]': ['\\x' + '00-\\x' + '7f', false],
+    '[:blank:]': ['\\p{Zs}\\t', true],
+    '[:cntrl:]': ['\\p{Cc}', true],
+    '[:digit:]': ['\\p{Nd}', true],
+    '[:graph:]': ['\\p{Z}\\p{C}', true, true],
+    '[:lower:]': ['\\p{Ll}', true],
+    '[:print:]': ['\\p{C}', true],
+    '[:punct:]': ['\\p{P}', true],
+    '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true],
+    '[:upper:]': ['\\p{Lu}', true],
+    '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true],
+    '[:xdigit:]': ['A-Fa-f0-9', false],
 };
-var __privateSet$3 = (obj, member, value, setter) => {
-  __accessCheck$3(obj, member, "write to private field");
-  setter ? setter.call(obj, value) : member.set(obj, value);
-  return value;
+// only need to escape a few things inside of brace expressions
+// escapes: [ \ ] -
+const brace_expressions_braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&');
+// escape all regexp magic characters
+const brace_expressions_regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+// everything has already been escaped, we just have to join
+const brace_expressions_rangesToString = (ranges) => ranges.join('');
+// takes a glob string at a posix brace expression, and returns
+// an equivalent regular expression source, and boolean indicating
+// whether the /u flag needs to be applied, and the number of chars
+// consumed to parse the character class.
+// This also removes out of order ranges, and returns ($.) if the
+// entire class just no good.
+const brace_expressions_parseClass = (glob, position) => {
+    const pos = position;
+    /* c8 ignore start */
+    if (glob.charAt(pos) !== '[') {
+        throw new Error('not in a brace expression');
+    }
+    /* c8 ignore stop */
+    const ranges = [];
+    const negs = [];
+    let i = pos + 1;
+    let sawStart = false;
+    let uflag = false;
+    let escaping = false;
+    let negate = false;
+    let endPos = pos;
+    let rangeStart = '';
+    WHILE: while (i < glob.length) {
+        const c = glob.charAt(i);
+        if ((c === '!' || c === '^') && i === pos + 1) {
+            negate = true;
+            i++;
+            continue;
+        }
+        if (c === ']' && sawStart && !escaping) {
+            endPos = i + 1;
+            break;
+        }
+        sawStart = true;
+        if (c === '\\') {
+            if (!escaping) {
+                escaping = true;
+                i++;
+                continue;
+            }
+            // escaped \ char, fall through and treat like normal char
+        }
+        if (c === '[' && !escaping) {
+            // either a posix class, a collation equivalent, or just a [
+            for (const [cls, [unip, u, neg]] of Object.entries(brace_expressions_posixClasses)) {
+                if (glob.startsWith(cls, i)) {
+                    // invalid, [a-[] is fine, but not [a-[:alpha]]
+                    if (rangeStart) {
+                        return ['$.', false, glob.length - pos, true];
+                    }
+                    i += cls.length;
+                    if (neg)
+                        negs.push(unip);
+                    else
+                        ranges.push(unip);
+                    uflag = uflag || u;
+                    continue WHILE;
+                }
+            }
+        }
+        // now it's just a normal character, effectively
+        escaping = false;
+        if (rangeStart) {
+            // throw this range away if it's not valid, but others
+            // can still match.
+            if (c > rangeStart) {
+                ranges.push(brace_expressions_braceEscape(rangeStart) + '-' + brace_expressions_braceEscape(c));
+            }
+            else if (c === rangeStart) {
+                ranges.push(brace_expressions_braceEscape(c));
+            }
+            rangeStart = '';
+            i++;
+            continue;
+        }
+        // now might be the start of a range.
+        // can be either c-d or c-] or c] or c] at this point
+        if (glob.startsWith('-]', i + 1)) {
+            ranges.push(brace_expressions_braceEscape(c + '-'));
+            i += 2;
+            continue;
+        }
+        if (glob.startsWith('-', i + 1)) {
+            rangeStart = c;
+            i += 2;
+            continue;
+        }
+        // not the start of a range, just a single character
+        ranges.push(brace_expressions_braceEscape(c));
+        i++;
+    }
+    if (endPos < i) {
+        // didn't see the end of the class, not a valid class,
+        // but might still be valid as a literal match.
+        return ['', false, 0, false];
+    }
+    // if we got no ranges and no negates, then we have a range that
+    // cannot possibly match anything, and that poisons the whole glob
+    if (!ranges.length && !negs.length) {
+        return ['$.', false, glob.length - pos, true];
+    }
+    // if we got one positive range, and it's a single character, then that's
+    // not actually a magic pattern, it's just that one literal character.
+    // we should not treat that as "magic", we should just return the literal
+    // character. [_] is a perfectly valid way to escape glob magic chars.
+    if (negs.length === 0 &&
+        ranges.length === 1 &&
+        /^\\?.$/.test(ranges[0]) &&
+        !negate) {
+        const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
+        return [brace_expressions_regexpEscape(r), false, endPos - pos, false];
+    }
+    const sranges = '[' + (negate ? '^' : '') + brace_expressions_rangesToString(ranges) + ']';
+    const snegs = '[' + (negate ? '' : '^') + brace_expressions_rangesToString(negs) + ']';
+    const comb = ranges.length && negs.length
+        ? '(' + sranges + '|' + snegs + ')'
+        : ranges.length
+            ? sranges
+            : snegs;
+    return [comb, uflag, endPos - pos, true];
 };
-var _DEFAULT_ENDPOINT$3, _DEFAULT_TIMEOUT$2, _client$3;
-class GatewayManager {
-  /**
-   * @summary Creates a new instance of the constructor.
-   * @param {string} clientKey - The access key ID for authentication.
-   * @param {string} clientSecret - The secret access key for authentication.
-   * @tutorial quickstart-gateway
-   * @example
-   * import { GatewayManager } from "@filebase/sdk";
-   * const gatewayManager = new GatewayManager("KEY_FROM_DASHBOARD", "SECRET_FROM_DASHBOARD");
-   */
-  constructor(clientKey, clientSecret) {
-    __privateAdd$3(this, _DEFAULT_ENDPOINT$3, "https://api.filebase.io");
-    __privateAdd$3(this, _DEFAULT_TIMEOUT$2, 6e4);
-    __privateAdd$3(this, _client$3, void 0);
-    const clientEndpoint = process.env.NODE_ENV === "test" ? process.env.TEST_GW_ENDPOINT || __privateGet$3(this, _DEFAULT_ENDPOINT$3) : __privateGet$3(this, _DEFAULT_ENDPOINT$3), encodedToken = Buffer.from(`${clientKey}:${clientSecret}`).toString(
-      "base64"
-    ), baseURL = `${clientEndpoint}/v1/gateways`;
-    __privateSet$3(this, _client$3, axios.create({
-      baseURL,
-      timeout: __privateGet$3(this, _DEFAULT_TIMEOUT$2),
-      headers: { Authorization: `Bearer ${encodedToken}` }
-    }));
-  }
-  /**
-   * @typedef {Object} gateway
-   * @property {string} name Name for the gateway
-   * @property {string} domain Custom Domain for the gateway
-   * @property {boolean} enabled Whether the gateway is enabled or not
-   * @property {string} private Whether the gateway is scoped to users content
-   * @property {date} created_at Date the gateway was created
-   * @property {date} updated_at Date the gateway was last updated
-   */
-  /**
-   * @typedef {Object} gatewayOptions
-   * @property {boolean} [domain] Optional Domain to allow for using a Custom Domain
-   * @property {string} [enabled] Optional Toggle to use for enabling the gateway
-   * @property {boolean} [private] Optional Boolean determining if gateway is Public or Private
-   */
-  /**
-   * @summary Creates a gateway with the given name and options
-   * @param {string} name Unique name across entire platform for the gateway.  Must be a valid subdomain name.
-   * @param {gatewayOptions} [options]
-   * @returns {Promise} - A promise that resolves to the value of a gateway.
-   * @example
-   * // Create gateway with name of `create-gateway-example` and a custom domain of `cname.mycustomdomain.com`.
-   * // The custom domain must already exist and have a CNAME record pointed at `create-gateway-example.myfilebase.com`.
-   * await gatewayManager.create(`create-gateway-example`, {
-   *   domain: `cname.mycustomdomain.com`
-   * });
-   */
-  async create(name, options = {}) {
-    try {
-      let createOptions = {
-        name
-      };
-      if (typeof options.domain === "string") {
-        createOptions.domain = options.domain;
-      }
-      if (typeof options.enabled === "boolean") {
-        createOptions.enabled = options.enabled;
-      }
-      if (typeof options.private === "boolean") {
-        createOptions.private = options.private;
-      }
-      const createResponse = await __privateGet$3(this, _client$3).request({
-        method: "POST",
-        data: createOptions
-      });
-      return createResponse.data;
-    } catch (err) {
-      apiErrorHandler(err);
+//# sourceMappingURL=brace-expressions.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/minimatch/dist/mjs/unescape.js
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link windowsPathsNoEscape} option is used, then square-brace
+ * escapes are removed, but not backslash escapes.  For example, it will turn
+ * the string `'[*]'` into `*`, but it will not turn `'\\*'` into `'*'`,
+ * becuase `\` is a path separator in `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both brace escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ */
+const mjs_unescape_unescape = (s, { windowsPathsNoEscape = false, } = {}) => {
+    return windowsPathsNoEscape
+        ? s.replace(/\[([^\/\\])\]/g, '$1')
+        : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1');
+};
+//# sourceMappingURL=unescape.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/minimatch/dist/mjs/ast.js
+// parse a single path portion
+
+
+const mjs_ast_types = new Set(['!', '?', '+', '*', '@']);
+const ast_isExtglobType = (c) => mjs_ast_types.has(c);
+// Patterns that get prepended to bind to the start of either the
+// entire string, or just a single path portion, to prevent dots
+// and/or traversal patterns, when needed.
+// Exts don't need the ^ or / bit, because the root binds that already.
+const ast_startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))';
+const ast_startNoDot = '(?!\\.)';
+// characters that indicate a start of pattern needs the "no dots" bit,
+// because a dot *might* be matched. ( is not in the list, because in
+// the case of a child extglob, it will handle the prevention itself.
+const ast_addPatternStart = new Set(['[', '.']);
+// cases where traversal is A-OK, no dot prevention needed
+const ast_justDots = new Set(['..', '.']);
+const ast_reSpecials = new Set('().*{}+?[]^$\\!');
+const ast_regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+// any single thing other than /
+const ast_qmark = '[^/]';
+// * => any number of characters
+const ast_star = ast_qmark + '*?';
+// use + when we need to ensure that *something* matches, because the * is
+// the only thing in the path portion.
+const ast_starNoEmpty = ast_qmark + '+?';
+// remove the \ chars that we added if we end up doing a nonmagic compare
+// const deslash = (s: string) => s.replace(/\\(.)/g, '$1')
+class ast_AST {
+    type;
+    #root;
+    #hasMagic;
+    #uflag = false;
+    #parts = [];
+    #parent;
+    #parentIndex;
+    #negs;
+    #filledNegs = false;
+    #options;
+    #toString;
+    // set to true if it's an extglob with no children
+    // (which really means one child of '')
+    #emptyExt = false;
+    constructor(type, parent, options = {}) {
+        this.type = type;
+        // extglobs are inherently magical
+        if (type)
+            this.#hasMagic = true;
+        this.#parent = parent;
+        this.#root = this.#parent ? this.#parent.#root : this;
+        this.#options = this.#root === this ? options : this.#root.#options;
+        this.#negs = this.#root === this ? [] : this.#root.#negs;
+        if (type === '!' && !this.#root.#filledNegs)
+            this.#negs.push(this);
+        this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
     }
-  }
-  /**
-   * @summary Deletes a gateway with the given name.
-   * @param {string} name - The name of the gateway to delete.
-   * @returns {Promise} - A promise that resolves to true if the gateway was successfully deleted.
-   * @example
-   * // Delete gateway with name of `delete-gateway-example`
-   * await gatewayManager.delete(`delete-name-example`);
-   */
-  async delete(name) {
-    try {
-      await __privateGet$3(this, _client$3).request({
-        method: "DELETE",
-        url: `/${name}`,
-        validateStatus: (status) => {
-          return status === 204;
+    get hasMagic() {
+        /* c8 ignore start */
+        if (this.#hasMagic !== undefined)
+            return this.#hasMagic;
+        /* c8 ignore stop */
+        for (const p of this.#parts) {
+            if (typeof p === 'string')
+                continue;
+            if (p.type || p.hasMagic)
+                return (this.#hasMagic = true);
         }
-      });
-      return true;
-    } catch (err) {
-      apiErrorHandler(err);
+        // note: will be undefined until we generate the regexp src and find out
+        return this.#hasMagic;
     }
-  }
-  /**
-   * @summary Returns the value of a gateway
-   * @param {string} name - Parameter representing the name to get.
-   * @returns {Promise} - A promise that resolves to the value of a gateway.
-   * @example
-   * // Get gateway with name of `gateway-get-example`
-   * await gatewayManager.get(`gateway-get-example`);
-   */
-  async get(name) {
-    try {
-      const getResponse = await __privateGet$3(this, _client$3).request({
-        method: "GET",
-        url: `/${name}`,
-        validateStatus: (status) => {
-          return status === 200 || status === 404;
+    // reconstructs the pattern
+    toString() {
+        if (this.#toString !== undefined)
+            return this.#toString;
+        if (!this.type) {
+            return (this.#toString = this.#parts.map(p => String(p)).join(''));
         }
-      });
-      return getResponse.status === 200 ? getResponse.data : false;
-    } catch (err) {
-      apiErrorHandler(err);
-    }
-  }
-  /**
-   * @summary Returns a list of gateways
-   * @returns {Promise>} - A promise that resolves to an array of gateways.
-   * @example
-   * // List all gateways
-   * await gatewayManager.list();
-   */
-  async list() {
-    try {
-      const getResponse = await __privateGet$3(this, _client$3).request({
-        method: "GET"
-      });
-      return getResponse.data;
-    } catch (err) {
-      apiErrorHandler(err);
-    }
-  }
-  /**
-   * @summary Updates the specified gateway.
-   * @param {string} name - The name of the gateway to update.
-   * @param {gatewayOptions} options - The options for the update operation.
-   *
-   * @returns {Promise} - A Promise that resolves to true if the gateway was updated.
-   * @example
-   * // Update gateway with name of `update-gateway-example` and set the gateway to only serve CIDs pinned by user.
-   * await gatewayManager.update(`update-gateway-example`, {
-   *   private: true
-   * });
-   */
-  async update(name, options) {
-    try {
-      const updateOptions = {
-        name
-      };
-      if (options?.domain) {
-        updateOptions.domain = String(options.private);
-      }
-      if (options?.enabled) {
-        updateOptions.enabled = Boolean(options.enabled);
-      }
-      if (options?.private) {
-        updateOptions.private = Boolean(options.private);
-      }
-      await __privateGet$3(this, _client$3).request({
-        method: "PUT",
-        url: `/${name}`,
-        data: updateOptions,
-        validateStatus: (status) => {
-          return status === 200;
+        else {
+            return (this.#toString =
+                this.type + '(' + this.#parts.map(p => String(p)).join('|') + ')');
         }
-      });
-      return true;
-    } catch (err) {
-      apiErrorHandler(err);
     }
-  }
-  /**
-   * @summary Toggles the enabled state of a given gateway.
-   * @param {string} name - The name of the gateway to toggle.
-   * @param {boolean} targetState - The new target state.
-   * @returns {Promise} A promise that resolves to true if the gateway was successfully toggled.
-   * @example
-   * // Toggle gateway with label of `toggle-gateway-example`
-   * await gatewayManager.toggle(`toggle-gateway-example`, true);  // Enabled
-   * await gatewayManager.toggle(`toggle-gateway-example`, false); // Disabled
-   */
-  async toggle(name, targetState) {
-    try {
-      await __privateGet$3(this, _client$3).request({
-        method: "PUT",
-        url: `/${name}`,
-        data: {
-          enabled: Boolean(targetState)
-        },
-        validateStatus: (status) => {
-          return status === 200;
+    #fillNegs() {
+        /* c8 ignore start */
+        if (this !== this.#root)
+            throw new Error('should only call on root');
+        if (this.#filledNegs)
+            return this;
+        /* c8 ignore stop */
+        // call toString() once to fill this out
+        this.toString();
+        this.#filledNegs = true;
+        let n;
+        while ((n = this.#negs.pop())) {
+            if (n.type !== '!')
+                continue;
+            // walk up the tree, appending everthing that comes AFTER parentIndex
+            let p = n;
+            let pp = p.#parent;
+            while (pp) {
+                for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
+                    for (const part of n.#parts) {
+                        /* c8 ignore start */
+                        if (typeof part === 'string') {
+                            throw new Error('string part in extglob AST??');
+                        }
+                        /* c8 ignore stop */
+                        part.copyIn(pp.#parts[i]);
+                    }
+                }
+                p = pp;
+                pp = p.#parent;
+            }
         }
-      });
-      return true;
-    } catch (err) {
-      apiErrorHandler(err);
+        return this;
     }
-  }
-}
-_DEFAULT_ENDPOINT$3 = new WeakMap();
-_DEFAULT_TIMEOUT$2 = new WeakMap();
-_client$3 = new WeakMap();
-
-var __accessCheck$2 = (obj, member, msg) => {
-  if (!member.has(obj))
-    throw TypeError("Cannot " + msg);
-};
-var __privateGet$2 = (obj, member, getter) => {
-  __accessCheck$2(obj, member, "read from private field");
-  return getter ? getter.call(obj) : member.get(obj);
-};
-var __privateAdd$2 = (obj, member, value) => {
-  if (member.has(obj))
-    throw TypeError("Cannot add the same private member more than once");
-  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
-};
-var __privateSet$2 = (obj, member, value, setter) => {
-  __accessCheck$2(obj, member, "write to private field");
-  setter ? setter.call(obj, value) : member.set(obj, value);
-  return value;
-};
-var _DEFAULT_ENDPOINT$2, _DEFAULT_TIMEOUT$1, _client$2;
-class NameManager {
-  /**
-   * @summary Creates a new instance of the constructor.
-   * @param {string} clientKey - The access key ID for authentication.
-   * @param {string} clientSecret - The secret access key for authentication.
-   * @tutorial quickstart-name
-   * @example
-   * import { NameManager } from "@filebase/sdk";
-   * const nameManager = new NameManager("KEY_FROM_DASHBOARD", "SECRET_FROM_DASHBOARD");
-   */
-  constructor(clientKey, clientSecret) {
-    __privateAdd$2(this, _DEFAULT_ENDPOINT$2, "https://api.filebase.io");
-    __privateAdd$2(this, _DEFAULT_TIMEOUT$1, 6e4);
-    __privateAdd$2(this, _client$2, void 0);
-    const clientEndpoint = process.env.NODE_ENV === "test" ? process.env.TEST_NAME_ENDPOINT || __privateGet$2(this, _DEFAULT_ENDPOINT$2) : __privateGet$2(this, _DEFAULT_ENDPOINT$2), encodedToken = Buffer.from(`${clientKey}:${clientSecret}`).toString(
-      "base64"
-    ), baseURL = `${clientEndpoint}/v1/names`;
-    __privateSet$2(this, _client$2, lib_axios.create({
-      baseURL,
-      timeout: __privateGet$2(this, _DEFAULT_TIMEOUT$1),
-      headers: { Authorization: `Bearer ${encodedToken}` }
-    }));
-  }
-  /**
-   * @typedef {Object} name
-   * @property {string} label Descriptive label for the Key
-   * @property {string} network_key IPNS Key CID
-   * @property {string} cid Value that name Publishes
-   * @property {number} sequence Version Number for the name
-   * @property {boolean} enabled Whether the name is being Published or not
-   * @property {date} published_at Date the name was last published to the DHT
-   * @property {date} created_at Date the name was created
-   * @property {date} updated_at Date the name was last updated
-   */
-  /**
-   * @typedef {Object} nameOptions
-   * @property {boolean} [enabled] Whether the name is enabled or not.
-   */
-  /**
-   * @summary Creates a new IPNS name with the given name as the label and CID.
-   * @param {string} label - The label of the new IPNS name.
-   * @param {string} cid - The CID of the IPNS name.
-   * @param {nameOptions} [options] - Additional options for the IPNS name.
-   * @returns {Promise} - A Promise that resolves with the response JSON.
-   * @example
-   * // Create IPNS name with label of `create-name-example` and CID of `QmdmQXB2mzChmMeKY47C43LxUdg1NDJ5MWcKMKxDu7RgQm`
-   * await nameManager.create(`create-name-example`, `QmdmQXB2mzChmMeKY47C43LxUdg1NDJ5MWcKMKxDu7RgQm`);
-   */
-  async create(label, cid, options = {
-    enabled: true
-  }) {
-    try {
-      const createResponse = await __privateGet$2(this, _client$2).request({
-        method: "POST",
-        data: {
-          label,
-          cid,
-          enabled: options?.enabled !== false
+    push(...parts) {
+        for (const p of parts) {
+            if (p === '')
+                continue;
+            /* c8 ignore start */
+            if (typeof p !== 'string' && !(p instanceof ast_AST && p.#parent === this)) {
+                throw new Error('invalid part: ' + p);
+            }
+            /* c8 ignore stop */
+            this.#parts.push(p);
         }
-      });
-      return createResponse.data;
-    } catch (err) {
-      apiErrorHandler(err);
     }
-  }
-  /**
-   * @summary Imports a user's IPNS private key.
-   * @param {string} label - The label for the IPNS name.
-   * @param {string} cid - The CID (Content Identifier) of the data.
-   * @param {string} privateKey - The existing private key encoded in Base64.
-   * @param {nameOptions} [options] - Additional options for the IPNS name.
-   * @returns {Promise} - A Promise that resolves to the server response.
-   * @example
-   * // Import IPNS private key with label of `create-name-example`, CID of `QmdmQXB2mzChmMeKY47C43LxUdg1NDJ5MWcKMKxDu7RgQm`
-   * // and a private key encoded with base64
-   * await nameManager.import(
-   *  `create-name-example`,
-   *  `QmdmQXB2mzChmMeKY47C43LxUdg1NDJ5MWcKMKxDu7RgQm`
-   *  `BASE64_ENCODED_PRIVATEKEY`
-   * );
-   */
-  async import(label, cid, privateKey, options = {
-    enabled: true
-  }) {
-    try {
-      const importResponse = await __privateGet$2(this, _client$2).request({
-        method: "POST",
-        data: {
-          label,
-          cid,
-          network_private_key: privateKey,
-          enabled: options?.enabled !== false
+    toJSON() {
+        const ret = this.type === null
+            ? this.#parts.slice().map(p => (typeof p === 'string' ? p : p.toJSON()))
+            : [this.type, ...this.#parts.map(p => p.toJSON())];
+        if (this.isStart() && !this.type)
+            ret.unshift([]);
+        if (this.isEnd() &&
+            (this === this.#root ||
+                (this.#root.#filledNegs && this.#parent?.type === '!'))) {
+            ret.push({});
         }
-      });
-      return importResponse.data;
-    } catch (err) {
-      apiErrorHandler(err);
+        return ret;
     }
-  }
-  /**
-   * @summary Updates the specified name with the given CID.
-   * @param {string} label - The label of the name to update.
-   * @param {string} cid - The cid to associate with the name.
-   * @param {nameOptions} options - The options for the set operation.
-   *
-   * @returns {Promise} - A Promise that resolves to true if the IPNS name was updated.
-   * @example
-   * // Update name with label of `update-name-example` and set the value of the IPNS name.
-   * await nameManager.update(`update-name-example`, `bafybeidt4nmaci476lyon2mvgfmwyzysdazienhxs2bqnfpdainzjuwjom`);
-   */
-  async update(label, cid, options = {}) {
-    try {
-      const updateOptions = {
-        cid
-      };
-      if (options?.enabled) {
-        updateOptions.enabled = Boolean(options.enabled);
-      }
-      await __privateGet$2(this, _client$2).request({
-        method: "PUT",
-        url: `/${label}`,
-        data: updateOptions,
-        validateStatus: (status) => {
-          return status === 200;
+    isStart() {
+        if (this.#root === this)
+            return true;
+        // if (this.type) return !!this.#parent?.isStart()
+        if (!this.#parent?.isStart())
+            return false;
+        if (this.#parentIndex === 0)
+            return true;
+        // if everything AHEAD of this is a negation, then it's still the "start"
+        const p = this.#parent;
+        for (let i = 0; i < this.#parentIndex; i++) {
+            const pp = p.#parts[i];
+            if (!(pp instanceof ast_AST && pp.type === '!')) {
+                return false;
+            }
         }
-      });
-      return true;
-    } catch (err) {
-      apiErrorHandler(err);
+        return true;
     }
-  }
-  /**
-   * @summary Returns the value of an IPNS name
-   * @param {string} label - Parameter representing the label of the name to resolve.
-   * @returns {Promise} - A promise that resolves to the value of a name.
-   * @example
-   * // Get IPNS name with label of `list-name-example`
-   * await nameManager.get(`list-name-example`);
-   */
-  async get(label) {
-    try {
-      const getResponse = await __privateGet$2(this, _client$2).request({
-        method: "GET",
-        url: `/${label}`,
-        validateStatus: (status) => {
-          return status === 200 || status === 404;
-        }
-      });
-      return getResponse.status === 200 ? getResponse.data : false;
-    } catch (err) {
-      apiErrorHandler(err);
+    isEnd() {
+        if (this.#root === this)
+            return true;
+        if (this.#parent?.type === '!')
+            return true;
+        if (!this.#parent?.isEnd())
+            return false;
+        if (!this.type)
+            return this.#parent?.isEnd();
+        // if not root, it'll always have a parent
+        /* c8 ignore start */
+        const pl = this.#parent ? this.#parent.#parts.length : 0;
+        /* c8 ignore stop */
+        return this.#parentIndex === pl - 1;
     }
-  }
-  /**
-   * @summary Returns a list of IPNS names
-   * @returns {Promise>} - A promise that resolves to an array of names.
-   * @example
-   * // List all IPNS names
-   * await nameManager.list();
-   */
-  async list() {
-    try {
-      const listResponse = await __privateGet$2(this, _client$2).request({
-        method: "GET"
-      });
-      return listResponse.data;
-    } catch (err) {
-      apiErrorHandler(err);
+    copyIn(part) {
+        if (typeof part === 'string')
+            this.push(part);
+        else
+            this.push(part.clone(this));
     }
-  }
-  /**
-   * @summary Deletes an IPNS name with the given label.
-   * @param {string} label - The label of the IPNS name to delete.
-   * @returns {Promise} - A promise that resolves to true if the IPNS name was successfully deleted.
-   * @example
-   * // List IPNS name with label of `delete-name-example`
-   * await nameManager.delete(`delete-name-example`);
-   */
-  async delete(label) {
-    try {
-      await __privateGet$2(this, _client$2).request({
-        method: "DELETE",
-        url: `/${label}`,
-        validateStatus: (status) => {
-          return status === 204;
+    clone(parent) {
+        const c = new ast_AST(this.type, parent);
+        for (const p of this.#parts) {
+            c.copyIn(p);
         }
-      });
-      return true;
-    } catch (err) {
-      apiErrorHandler(err);
+        return c;
     }
-  }
-  /**
-   * @summary Toggles the enabled state of a given IPNS name.
-   * @param {string} label - The label of the IPNS name to toggle.
-   * @param {boolean} targetState - The new target state.
-   * @returns {Promise} A promise that resolves to true if the IPNS name was successfully toggled.
-   * @example
-   * // Toggle IPNS name with label of `toggle-name-example`
-   * await nameManager.toggle(`toggle-name-example`, true);  // Enabled
-   * await nameManager.toggle(`toggle-name-example`, false); // Disabled
-   */
-  async toggle(label, targetState) {
-    try {
-      await __privateGet$2(this, _client$2).request({
-        method: "PUT",
-        url: `/${label}`,
-        data: {
-          enabled: targetState
-        },
-        validateStatus: (status) => {
-          return status === 200;
+    static #parseAST(str, ast, pos, opt) {
+        let escaping = false;
+        let inBrace = false;
+        let braceStart = -1;
+        let braceNeg = false;
+        if (ast.type === null) {
+            // outside of a extglob, append until we find a start
+            let i = pos;
+            let acc = '';
+            while (i < str.length) {
+                const c = str.charAt(i++);
+                // still accumulate escapes at this point, but we do ignore
+                // starts that are escaped
+                if (escaping || c === '\\') {
+                    escaping = !escaping;
+                    acc += c;
+                    continue;
+                }
+                if (inBrace) {
+                    if (i === braceStart + 1) {
+                        if (c === '^' || c === '!') {
+                            braceNeg = true;
+                        }
+                    }
+                    else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
+                        inBrace = false;
+                    }
+                    acc += c;
+                    continue;
+                }
+                else if (c === '[') {
+                    inBrace = true;
+                    braceStart = i;
+                    braceNeg = false;
+                    acc += c;
+                    continue;
+                }
+                if (!opt.noext && ast_isExtglobType(c) && str.charAt(i) === '(') {
+                    ast.push(acc);
+                    acc = '';
+                    const ext = new ast_AST(c, ast);
+                    i = ast_AST.#parseAST(str, ext, i, opt);
+                    ast.push(ext);
+                    continue;
+                }
+                acc += c;
+            }
+            ast.push(acc);
+            return i;
         }
-      });
-      return true;
-    } catch (err) {
-      apiErrorHandler(err);
+        // some kind of extglob, pos is at the (
+        // find the next | or )
+        let i = pos + 1;
+        let part = new ast_AST(null, ast);
+        const parts = [];
+        let acc = '';
+        while (i < str.length) {
+            const c = str.charAt(i++);
+            // still accumulate escapes at this point, but we do ignore
+            // starts that are escaped
+            if (escaping || c === '\\') {
+                escaping = !escaping;
+                acc += c;
+                continue;
+            }
+            if (inBrace) {
+                if (i === braceStart + 1) {
+                    if (c === '^' || c === '!') {
+                        braceNeg = true;
+                    }
+                }
+                else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
+                    inBrace = false;
+                }
+                acc += c;
+                continue;
+            }
+            else if (c === '[') {
+                inBrace = true;
+                braceStart = i;
+                braceNeg = false;
+                acc += c;
+                continue;
+            }
+            if (ast_isExtglobType(c) && str.charAt(i) === '(') {
+                part.push(acc);
+                acc = '';
+                const ext = new ast_AST(c, part);
+                part.push(ext);
+                i = ast_AST.#parseAST(str, ext, i, opt);
+                continue;
+            }
+            if (c === '|') {
+                part.push(acc);
+                acc = '';
+                parts.push(part);
+                part = new ast_AST(null, ast);
+                continue;
+            }
+            if (c === ')') {
+                if (acc === '' && ast.#parts.length === 0) {
+                    ast.#emptyExt = true;
+                }
+                part.push(acc);
+                acc = '';
+                ast.push(...parts, part);
+                return i;
+            }
+            acc += c;
+        }
+        // unfinished extglob
+        // if we got here, it was a malformed extglob! not an extglob, but
+        // maybe something else in there.
+        ast.type = null;
+        ast.#hasMagic = undefined;
+        ast.#parts = [str.substring(pos - 1)];
+        return i;
     }
-  }
-}
-_DEFAULT_ENDPOINT$2 = new WeakMap();
-_DEFAULT_TIMEOUT$1 = new WeakMap();
-_client$2 = new WeakMap();
-
-var __accessCheck$1 = (obj, member, msg) => {
-  if (!member.has(obj))
-    throw TypeError("Cannot " + msg);
-};
-var __privateGet$1 = (obj, member, getter) => {
-  __accessCheck$1(obj, member, "read from private field");
-  return getter ? getter.call(obj) : member.get(obj);
-};
-var __privateAdd$1 = (obj, member, value) => {
-  if (member.has(obj))
-    throw TypeError("Cannot add the same private member more than once");
-  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
-};
-var __privateSet$1 = (obj, member, value, setter) => {
-  __accessCheck$1(obj, member, "write to private field");
-  setter ? setter.call(obj, value) : member.set(obj, value);
-  return value;
-};
-var __privateMethod$1 = (obj, member, method) => {
-  __accessCheck$1(obj, member, "access private method");
-  return method;
-};
-var _DEFAULT_ENDPOINT$1, _DEFAULT_REGION, _DEFAULT_MAX_CONCURRENT_UPLOADS, _client$1, _credentials$1, _defaultBucket$1, _gatewayConfiguration$1, _maxConcurrentUploads, _routeDownload, routeDownload_fn;
-class ObjectManager {
-  /**
-   * @typedef {Object} objectManagerOptions Optional settings for the constructor.
-   * @property {string} [bucket] Default bucket to use.
-   * @property {objectDownloadOptions} [gateway] Default gateway to use.
-   * @property {number} [maxConcurrentUploads] The maximum number of concurrent uploads.
-   */
-  /**
-   * @typedef {Object} objectDownloadOptions Optional settings for downloading objects
-   * @property {string} endpoint Default gateway to use.
-   * @property {string} [token] Token for the default gateway.
-   * @property {number} [timeout=60000] Timeout for the default gateway
-   */
-  /**
-   * @summary Creates a new instance of the constructor.
-   * @param {string} clientKey - The access key ID for authentication.
-   * @param {string} clientSecret - The secret access key for authentication.
-   * @param {objectManagerOptions} options - Optional settings for the constructor.
-   * @tutorial quickstart-object
-   * @example
-   * import { ObjectManager } from "@filebase/sdk";
-   * const objectManager = new ObjectManager("KEY_FROM_DASHBOARD", "SECRET_FROM_DASHBOARD", {
-   *   bucket: "my-default-bucket",
-   *   maxConcurrentUploads: 4,
-   *   gateway: {
-   *     endpoint: "https://my-default-gateway.mydomain.com
-   *     token: SUPER_SECRET_GATEWAY_TOKEN
-   *   }
-   * });
-   */
-  constructor(clientKey, clientSecret, options) {
-    __privateAdd$1(this, _routeDownload);
-    __privateAdd$1(this, _DEFAULT_ENDPOINT$1, "https://s3.filebase.com");
-    __privateAdd$1(this, _DEFAULT_REGION, "us-east-1");
-    __privateAdd$1(this, _DEFAULT_MAX_CONCURRENT_UPLOADS, 4);
-    __privateAdd$1(this, _client$1, void 0);
-    __privateAdd$1(this, _credentials$1, void 0);
-    __privateAdd$1(this, _defaultBucket$1, void 0);
-    __privateAdd$1(this, _gatewayConfiguration$1, void 0);
-    __privateAdd$1(this, _maxConcurrentUploads, void 0);
-    const clientEndpoint = process.env.NODE_ENV === "test" ? process.env.TEST_S3_ENDPOINT || __privateGet$1(this, _DEFAULT_ENDPOINT$1) : __privateGet$1(this, _DEFAULT_ENDPOINT$1), clientConfiguration = {
-      credentials: {
-        accessKeyId: clientKey,
-        secretAccessKey: clientSecret
-      },
-      endpoint: clientEndpoint,
-      region: __privateGet$1(this, _DEFAULT_REGION),
-      forcePathStyle: true
-    };
-    __privateSet$1(this, _defaultBucket$1, options?.bucket);
-    __privateSet$1(this, _maxConcurrentUploads, options?.maxConcurrentUploads || __privateGet$1(this, _DEFAULT_MAX_CONCURRENT_UPLOADS));
-    __privateSet$1(this, _credentials$1, {
-      key: clientKey,
-      secret: clientSecret
-    });
-    __privateSet$1(this, _client$1, new dist_cjs.S3Client(clientConfiguration));
-    __privateSet$1(this, _gatewayConfiguration$1, {
-      endpoint: options?.gateway?.endpoint,
-      token: options?.gateway?.token,
-      timeout: options?.gateway?.timeout
-    });
-  }
-  /**
-   * @typedef {Object} objectOptions
-   * @property {string} [bucket] - The bucket to pin the IPFS CID into.
-   */
-  /**
-   * @typedef {Object} objectHeadResult
-   * @property {string} cid The CID of the uploaded object
-   * @property {function} download Convenience function to download the object via S3 or the selected gateway
-   * @property {array} [entries] If a directory then returns an array of the containing objects
-   * @property {string} entries.cid The CID of the uploaded object
-   * @property {string} entries.path The path of the object
-   */
-  /**
-   * If the source parameter is an array of objects, it will pack multiple files into a CAR file for upload.
-   * The method returns a Promise that resolves to an object containing the CID (Content Identifier) of the uploaded file
-   * and an optional entries object when uploading a CAR file.
-   *
-   * @summary Uploads a file or a CAR file to the specified bucket.
-   * @param {string} key - The key or path of the file in the bucket.
-   * @param {Buffer|ReadableStream|Array} source - The content of the object to be uploaded.
-   *    If an array of files is provided, each file should have a 'path' property specifying the path of the file
-   *    and a 'content' property specifying the content of the file.  The SDK will then construct a CAR file locally
-   *    and use that as the content of the object to be uploaded.
-   * @param {Object} [metadata] Optional metadata for pin object
-   * @param {objectOptions} [options] - The options for uploading the object.
-   * @returns {Promise}
-   * @example
-   * // Upload Object
-   * await objectManager.upload("my-object", Buffer.from("Hello World!"));
-   * // Upload Object with Metadata
-   * await objectManager.upload("my-custom-object", Buffer.from("Hello Big World!"), {
-   *   "application": "my-filebase-app"
-   * });
-   * // Upload Directory
-   * await objectManager.upload("my-first-directory", [
-   *  {
-   *   path: "/testObjects/1.txt",
-   *   content: Buffer.from("upload test object", "utf-8"),
-   *  },
-   *  {
-   *   path: "/testObjects/deep/1.txt",
-   *   content: Buffer.from("upload deep test object", "utf-8"),
-   *  },
-   *  {
-   *   path: "/topLevel.txt",
-   *   content: Buffer.from("upload top level test object", "utf-8"),
-   *  },
-   * ]);
-   */
-  async upload(key, source, metadata, options) {
-    const uploadUUID = v4();
-    const bucket = options?.bucket || __privateGet$1(this, _defaultBucket$1), uploadOptions = {
-      client: __privateGet$1(this, _client$1),
-      params: {
-        Bucket: bucket,
-        Key: key,
-        Body: source,
-        Metadata: metadata || {}
-      },
-      queueSize: __privateGet$1(this, _maxConcurrentUploads),
-      partSize: 26843546
-      //25.6Mb || 250Gb Max File Size
-    };
-    let parsedEntries = {};
-    if (Array.isArray(source)) {
-      uploadOptions.params.Metadata = {
-        ...uploadOptions.params.Metadata,
-        import: "car"
-      };
-      let temporaryCarFilePath, temporaryBlockstoreDir;
-      try {
-        temporaryBlockstoreDir = external_node_path_namespaceObject.resolve(
-          external_node_os_namespaceObject.tmpdir(),
-          "filebase-sdk",
-          "uploads",
-          uploadUUID
-        );
-        temporaryCarFilePath = `${temporaryBlockstoreDir}/main.car`;
-        await (0,external_node_fs_promises_namespaceObject.mkdir)(temporaryBlockstoreDir, { recursive: true });
-        const temporaryBlockstore = new FsBlockstore(temporaryBlockstoreDir);
-        const heliaFs = unixfs({
-          blockstore: temporaryBlockstore
+    static fromGlob(pattern, options = {}) {
+        const ast = new ast_AST(null, undefined, options);
+        ast_AST.#parseAST(pattern, ast, 0, options);
+        return ast;
+    }
+    // returns the regular expression if there's magic, or the unescaped
+    // string if not.
+    toMMPattern() {
+        // should only be called on root
+        /* c8 ignore start */
+        if (this !== this.#root)
+            return this.#root.toMMPattern();
+        /* c8 ignore stop */
+        const glob = this.toString();
+        const [re, body, hasMagic, uflag] = this.toRegExpSource();
+        // if we're in nocase mode, and not nocaseMagicOnly, then we do
+        // still need a regular expression if we have to case-insensitively
+        // match capital/lowercase characters.
+        const anyMagic = hasMagic ||
+            this.#hasMagic ||
+            (this.#options.nocase &&
+                !this.#options.nocaseMagicOnly &&
+                glob.toUpperCase() !== glob.toLowerCase());
+        if (!anyMagic) {
+            return body;
+        }
+        const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');
+        return Object.assign(new RegExp(`^${re}$`, flags), {
+            _src: re,
+            _glob: glob,
         });
-        for (let sourceEntry of source) {
-          sourceEntry.path = sourceEntry.path[0] === "/" ? `/${uploadUUID}${sourceEntry.path}` : `/${uploadUUID}/${sourceEntry.path}`;
+    }
+    // returns the string match, the regexp source, whether there's magic
+    // in the regexp (so a regular expression is required) and whether or
+    // not the uflag is needed for the regular expression (for posix classes)
+    // TODO: instead of injecting the start/end at this point, just return
+    // the BODY of the regexp, along with the start/end portions suitable
+    // for binding the start/end in either a joined full-path makeRe context
+    // (where we bind to (^|/), or a standalone matchPart context (where
+    // we bind to ^, and not /).  Otherwise slashes get duped!
+    //
+    // In part-matching mode, the start is:
+    // - if not isStart: nothing
+    // - if traversal possible, but not allowed: ^(?!\.\.?$)
+    // - if dots allowed or not possible: ^
+    // - if dots possible and not allowed: ^(?!\.)
+    // end is:
+    // - if not isEnd(): nothing
+    // - else: $
+    //
+    // In full-path matching mode, we put the slash at the START of the
+    // pattern, so start is:
+    // - if first pattern: same as part-matching mode
+    // - if not isStart(): nothing
+    // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
+    // - if dots allowed or not possible: /
+    // - if dots possible and not allowed: /(?!\.)
+    // end is:
+    // - if last pattern, same as part-matching mode
+    // - else nothing
+    //
+    // Always put the (?:$|/) on negated tails, though, because that has to be
+    // there to bind the end of the negated pattern portion, and it's easier to
+    // just stick it in now rather than try to inject it later in the middle of
+    // the pattern.
+    //
+    // We can just always return the same end, and leave it up to the caller
+    // to know whether it's going to be used joined or in parts.
+    // And, if the start is adjusted slightly, can do the same there:
+    // - if not isStart: nothing
+    // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
+    // - if dots allowed or not possible: (?:/|^)
+    // - if dots possible and not allowed: (?:/|^)(?!\.)
+    //
+    // But it's better to have a simpler binding without a conditional, for
+    // performance, so probably better to return both start options.
+    //
+    // Then the caller just ignores the end if it's not the first pattern,
+    // and the start always gets applied.
+    //
+    // But that's always going to be $ if it's the ending pattern, or nothing,
+    // so the caller can just attach $ at the end of the pattern when building.
+    //
+    // So the todo is:
+    // - better detect what kind of start is needed
+    // - return both flavors of starting pattern
+    // - attach $ at the end of the pattern when creating the actual RegExp
+    //
+    // Ah, but wait, no, that all only applies to the root when the first pattern
+    // is not an extglob. If the first pattern IS an extglob, then we need all
+    // that dot prevention biz to live in the extglob portions, because eg
+    // +(*|.x*) can match .xy but not .yx.
+    //
+    // So, return the two flavors if it's #root and the first child is not an
+    // AST, otherwise leave it to the child AST to handle it, and there,
+    // use the (?:^|/) style of start binding.
+    //
+    // Even simplified further:
+    // - Since the start for a join is eg /(?!\.) and the start for a part
+    // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
+    // or start or whatever) and prepend ^ or / at the Regexp construction.
+    toRegExpSource(allowDot) {
+        const dot = allowDot ?? !!this.#options.dot;
+        if (this.#root === this)
+            this.#fillNegs();
+        if (!this.type) {
+            const noEmpty = this.isStart() && this.isEnd();
+            const src = this.#parts
+                .map(p => {
+                const [re, _, hasMagic, uflag] = typeof p === 'string'
+                    ? ast_AST.#parseGlob(p, this.#hasMagic, noEmpty)
+                    : p.toRegExpSource(allowDot);
+                this.#hasMagic = this.#hasMagic || hasMagic;
+                this.#uflag = this.#uflag || uflag;
+                return re;
+            })
+                .join('');
+            let start = '';
+            if (this.isStart()) {
+                if (typeof this.#parts[0] === 'string') {
+                    // this is the string that will match the start of the pattern,
+                    // so we need to protect against dots and such.
+                    // '.' and '..' cannot match unless the pattern is that exactly,
+                    // even if it starts with . or dot:true is set.
+                    const dotTravAllowed = this.#parts.length === 1 && ast_justDots.has(this.#parts[0]);
+                    if (!dotTravAllowed) {
+                        const aps = ast_addPatternStart;
+                        // check if we have a possibility of matching . or ..,
+                        // and prevent that.
+                        const needNoTrav = 
+                        // dots are allowed, and the pattern starts with [ or .
+                        (dot && aps.has(src.charAt(0))) ||
+                            // the pattern starts with \., and then [ or .
+                            (src.startsWith('\\.') && aps.has(src.charAt(2))) ||
+                            // the pattern starts with \.\., and then [ or .
+                            (src.startsWith('\\.\\.') && aps.has(src.charAt(4)));
+                        // no need to prevent dots if it can't match a dot, or if a
+                        // sub-pattern will be preventing it anyway.
+                        const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
+                        start = needNoTrav ? ast_startNoTraversal : needNoDot ? ast_startNoDot : '';
+                    }
+                }
+            }
+            // append the "end of path portion" pattern to negation tails
+            let end = '';
+            if (this.isEnd() &&
+                this.#root.#filledNegs &&
+                this.#parent?.type === '!') {
+                end = '(?:$|\\/)';
+            }
+            const final = start + src + end;
+            return [
+                final,
+                mjs_unescape_unescape(src),
+                (this.#hasMagic = !!this.#hasMagic),
+                this.#uflag,
+            ];
         }
-        for await (const entry of heliaFs.addAll(source)) {
-          parsedEntries[entry.path] = entry;
+        // We need to calculate the body *twice* if it's a repeat pattern
+        // at the start, once in nodot mode, then again in dot mode, so a
+        // pattern like *(?) can match 'x.y'
+        const repeated = this.type === '*' || this.type === '+';
+        // some kind of extglob
+        const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
+        let body = this.#partsToRegExp(dot);
+        if (this.isStart() && this.isEnd() && !body && this.type !== '!') {
+            // invalid extglob, has to at least be *something* present, if it's
+            // the entire path portion.
+            const s = this.toString();
+            this.#parts = [s];
+            this.type = null;
+            this.#hasMagic = undefined;
+            return [s, mjs_unescape_unescape(this.toString()), false, false];
         }
-        const rootEntry = parsedEntries[uploadUUID];
-        const carExporter = car({ blockstore: temporaryBlockstore }), { writer, out } = CarWriter.create([rootEntry.cid]);
-        const output = (0,external_node_fs_namespaceObject.createWriteStream)(temporaryCarFilePath);
-        external_node_stream_.Readable.from(out).pipe(output);
-        await carExporter.export(rootEntry.cid, writer);
-        uploadOptions.params.Body = (0,external_node_fs_namespaceObject.createReadStream)(temporaryCarFilePath);
-        const parallelUploads3 = new lib_storage_dist_cjs.Upload(uploadOptions);
-        await parallelUploads3.done();
-        await temporaryBlockstore.close();
-      } finally {
-        if (typeof temporaryBlockstoreDir !== "undefined") {
-          await (0,external_node_fs_promises_namespaceObject.rm)(temporaryBlockstoreDir, { recursive: true, force: true });
+        // XXX abstract out this map method
+        let bodyDotAllowed = !repeated || allowDot || dot || !ast_startNoDot
+            ? ''
+            : this.#partsToRegExp(true);
+        if (bodyDotAllowed === body) {
+            bodyDotAllowed = '';
         }
-      }
-    } else {
-      const parallelUploads3 = new lib_storage_dist_cjs.Upload(uploadOptions);
-      await parallelUploads3.done();
-    }
-    const command = new dist_cjs.HeadObjectCommand({
-      Bucket: bucket,
-      Key: key,
-      Body: source
-    }), headResult = await __privateGet$1(this, _client$1).send(command), responseCid = headResult.Metadata.cid;
-    if (Object.keys(parsedEntries).length === 0) {
-      return {
-        cid: responseCid,
-        download: () => {
-          return __privateMethod$1(this, _routeDownload, routeDownload_fn).call(this, responseCid, key, options);
+        if (bodyDotAllowed) {
+            body = `(?:${body})(?:${bodyDotAllowed})*?`;
         }
-      };
-    }
-    return {
-      cid: responseCid,
-      download: () => {
-        return __privateMethod$1(this, _routeDownload, routeDownload_fn).call(this, responseCid, key, options);
-      },
-      entries: parsedEntries
-    };
-  }
-  /**
-   * @summary Gets an objects info and metadata using the S3 API.
-   * @param {string} key - The key of the object to be inspected.
-   * @param {objectOptions} [options] - The options for inspecting the object.
-   * @returns {Promise}
-   */
-  async get(key, options) {
-    const bucket = options?.bucket || __privateGet$1(this, _defaultBucket$1);
-    try {
-      const command = new dist_cjs.HeadObjectCommand({
-        Bucket: bucket,
-        Key: key
-      }), response = await __privateGet$1(this, _client$1).send(command);
-      response.download = () => {
-        return __privateMethod$1(this, _routeDownload, routeDownload_fn).call(this, response.Metadata.cid, key, options);
-      };
-      return response;
-    } catch (err) {
-      if (err.name === "NotFound") {
-        return false;
-      }
-      throw err;
+        // an empty !() is exactly equivalent to a starNoEmpty
+        let final = '';
+        if (this.type === '!' && this.#emptyExt) {
+            final = (this.isStart() && !dot ? ast_startNoDot : '') + ast_starNoEmpty;
+        }
+        else {
+            const close = this.type === '!'
+                ? // !() must match something,but !(x) can match ''
+                    '))' +
+                        (this.isStart() && !dot && !allowDot ? ast_startNoDot : '') +
+                        ast_star +
+                        ')'
+                : this.type === '@'
+                    ? ')'
+                    : this.type === '?'
+                        ? ')?'
+                        : this.type === '+' && bodyDotAllowed
+                            ? ')'
+                            : this.type === '*' && bodyDotAllowed
+                                ? `)?`
+                                : `)${this.type}`;
+            final = start + body + close;
+        }
+        return [
+            final,
+            mjs_unescape_unescape(body),
+            (this.#hasMagic = !!this.#hasMagic),
+            this.#uflag,
+        ];
     }
-  }
-  /**
-   * @summary Downloads an object from the specified bucket using the provided key.
-   * @param {string} key - The key of the object to be downloaded.
-   * @param {objectOptions} [options] - The options for downloading the object..
-   * @returns {Promise} - A promise that resolves with the contents of the downloaded object as a Stream.
-   * @example
-   * // Download object with name of `download-object-example`
-   * await objectManager.download(`download-object-example`);
-   */
-  async download(key, options) {
-    if (typeof __privateGet$1(this, _gatewayConfiguration$1).endpoint === "string") {
-      const objectToFetch = await this.get(key, options);
-      return objectToFetch.download();
-    } else {
-      const command = new dist_cjs.GetObjectCommand({
-        Bucket: options?.bucket || __privateGet$1(this, _defaultBucket$1),
-        Key: key
-      }), response = await __privateGet$1(this, _client$1).send(command);
-      return response.Body;
+    #partsToRegExp(dot) {
+        return this.#parts
+            .map(p => {
+            // extglob ASTs should only contain parent ASTs
+            /* c8 ignore start */
+            if (typeof p === 'string') {
+                throw new Error('string type in extglob ast??');
+            }
+            /* c8 ignore stop */
+            // can ignore hasMagic, because extglobs are already always magic
+            const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
+            this.#uflag = this.#uflag || uflag;
+            return re;
+        })
+            .filter(p => !(this.isStart() && this.isEnd()) || !!p)
+            .join('|');
     }
-  }
-  /**
-   * @typedef {Object} listObjectsResult
-   * @property {boolean} IsTruncated Indicates if more results exist on the server
-   * @property {string} NextContinuationToken ContinuationToken used to paginate list requests
-   * @property {Array} Contents List of Keys stored in the S3 Bucket
-   * @property {string} Contents.Key Key of the Object
-   * @property {string} Contents.LastModified Date Last Modified of the Object
-   * @property {string} Contents.CID CID of the Object
-   * @property {string} Contents.ETag ETag of the Object
-   * @property {number} Contents.Size Size in Bytes of the Object
-   * @property {string} Contents.StorageClass Class of Storage of the Object
-   * @property {function} Contents.download Convenience function to download the item using the S3 gateway
-   */
-  /**
-   * @typedef {Object} listObjectOptions
-   * @property {string} [Bucket] The name of the bucket. If not provided, the default bucket will be used.
-   * @property {string} [ContinuationToken=null] Continues listing from this objects name.
-   * @property {string} [Delimiter=null] Character used to group keys
-   * @property {number} [MaxKeys=1000] The maximum number of objects to retrieve. Defaults to 1000.
-   */
-  /**
-   * Retrieves a list of objects from a specified bucket.
-   *
-   * @param {listObjectOptions} options - The options for listing objects.
-   * @returns {Promise} - A promise that resolves to an array of objects.
-   * @example
-   * // List objects in bucket with a limit of 1000
-   * await objectManager.list({
-   *   MaxKeys: 1000
-   * });
-   */
-  async list(options = {
-    Bucket: __privateGet$1(this, _defaultBucket$1),
-    ContinuationToken: null,
-    Delimiter: null,
-    MaxKeys: 1e3
-  }) {
-    if (options?.MaxKeys && options.MaxKeys > 1e5) {
-      throw new Error(`MaxKeys Maximum value is 100000`);
+    static #parseGlob(glob, hasMagic, noEmpty = false) {
+        let escaping = false;
+        let re = '';
+        let uflag = false;
+        for (let i = 0; i < glob.length; i++) {
+            const c = glob.charAt(i);
+            if (escaping) {
+                escaping = false;
+                re += (ast_reSpecials.has(c) ? '\\' : '') + c;
+                continue;
+            }
+            if (c === '\\') {
+                if (i === glob.length - 1) {
+                    re += '\\\\';
+                }
+                else {
+                    escaping = true;
+                }
+                continue;
+            }
+            if (c === '[') {
+                const [src, needUflag, consumed, magic] = brace_expressions_parseClass(glob, i);
+                if (consumed) {
+                    re += src;
+                    uflag = uflag || needUflag;
+                    i += consumed - 1;
+                    hasMagic = hasMagic || magic;
+                    continue;
+                }
+            }
+            if (c === '*') {
+                if (noEmpty && glob === '*')
+                    re += ast_starNoEmpty;
+                else
+                    re += ast_star;
+                hasMagic = true;
+                continue;
+            }
+            if (c === '?') {
+                re += ast_qmark;
+                hasMagic = true;
+                continue;
+            }
+            re += ast_regExpEscape(c);
+        }
+        return [re, mjs_unescape_unescape(glob), !!hasMagic, uflag];
     }
-    const bucket = options?.Bucket || __privateGet$1(this, _defaultBucket$1), limit = options?.MaxKeys || 1e3, commandOptions = {
-      Bucket: bucket,
-      MaxKeys: limit
-    }, command = new dist_cjs.ListObjectsV2Command({
-      ...options,
-      ...commandOptions
-    });
-    const { Contents, IsTruncated, NextContinuationToken } = await __privateGet$1(this, _client$1).send(command);
-    return { Contents, IsTruncated, NextContinuationToken };
-  }
-  /**
-   * @summary Deletes an object from the specified bucket using the provided key.
-   * @param {string} key - The key of the object to be deleted.
-   * @param {objectOptions} [options] - The options for deleting the file.
-   * @returns {Promise} - A Promise that resolves with the result of the delete operation.
-   * @example
-   * // Delete object with name of `delete-object-example`
-   * await objectManager.delete(`delete-object-example`);
-   */
-  async delete(key, options) {
-    const command = new dist_cjs.DeleteObjectCommand({
-      Bucket: options?.bucket || __privateGet$1(this, _defaultBucket$1),
-      Key: key
-    });
-    await __privateGet$1(this, _client$1).send(command);
-    return true;
-  }
-  /**
-   * @typedef {Object} copyObjectOptions
-   * @property {string} [sourceBucket] The source bucket from where the object is to be copied.
-   * @property {string} [destinationKey] The key of the object in the destination bucket. By default, it is the same as the sourceKey.
-   */
-  /**
-   * If the destinationKey is not provided, the object will be copied with the same key as the sourceKey.
-   *
-   * @summary Copy the object from sourceKey in the sourceBucket to destinationKey in the destinationBucket.
-   * @param {string} sourceKey - The key of the object to be copied from the sourceBucket.
-   * @param {string} destinationBucket - The bucket where the object will be copied to.
-   * @param {copyObjectOptions} [options] - Additional options for the copy operation.
-   *
-   * @returns {Promise} - A Promise that resolves with the result of the copy operation.
-   * @example
-   * // Copy object `copy-object-test` from `copy-object-test-pass-src` to `copy-object-test-pass-dest`
-   * // TIP: Set bucket on constructor and it will be used as the default source for copying objects.
-   * await objectManager.copy(`copy-object-test`, `copy-object-dest`, {
-   *   sourceBucket: `copy-object-src`
-   * });
-   */
-  async copy(sourceKey, destinationBucket, options = {
-    sourceBucket: __privateGet$1(this, _defaultBucket$1),
-    destinationKey: void 0
-  }) {
-    const copySource = `${options?.sourceBucket || __privateGet$1(this, _defaultBucket$1)}/${sourceKey}`, command = new dist_cjs.CopyObjectCommand({
-      CopySource: copySource,
-      Bucket: destinationBucket,
-      Key: options?.destinationKey || sourceKey
-    });
-    await __privateGet$1(this, _client$1).send(command);
-    return true;
-  }
 }
-_DEFAULT_ENDPOINT$1 = new WeakMap();
-_DEFAULT_REGION = new WeakMap();
-_DEFAULT_MAX_CONCURRENT_UPLOADS = new WeakMap();
-_client$1 = new WeakMap();
-_credentials$1 = new WeakMap();
-_defaultBucket$1 = new WeakMap();
-_gatewayConfiguration$1 = new WeakMap();
-_maxConcurrentUploads = new WeakMap();
-_routeDownload = new WeakSet();
-routeDownload_fn = async function(cid, key, options) {
-  return typeof __privateGet$1(this, _gatewayConfiguration$1).endpoint !== "undefined" ? downloadFromGateway(cid, __privateGet$1(this, _gatewayConfiguration$1)) : this.download(key, options);
+//# sourceMappingURL=ast.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/minimatch/dist/mjs/escape.js
+/**
+ * Escape all magic characters in a glob pattern.
+ *
+ * If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape}
+ * option is used, then characters are escaped by wrapping in `[]`, because
+ * a magic character wrapped in a character class can only be satisfied by
+ * that exact character.  In this mode, `\` is _not_ escaped, because it is
+ * not interpreted as a magic character, but instead as a path separator.
+ */
+const mjs_escape_escape = (s, { windowsPathsNoEscape = false, } = {}) => {
+    // don't need to escape +@! because we escape the parens
+    // that make those magic, and escaping ! as [!] isn't valid,
+    // because [!]] is a valid glob class meaning not ']'.
+    return windowsPathsNoEscape
+        ? s.replace(/[?*()[\]]/g, '[$&]')
+        : s.replace(/[?*()[\]\\]/g, '\\$&');
 };
+//# sourceMappingURL=escape.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/minimatch/dist/mjs/index.js
 
-var __accessCheck = (obj, member, msg) => {
-  if (!member.has(obj))
-    throw TypeError("Cannot " + msg);
+
+
+
+
+const dist_mjs_minimatch = (p, pattern, options = {}) => {
+    assert_valid_pattern_assertValidPattern(pattern);
+    // shortcut: comments match nothing.
+    if (!options.nocomment && pattern.charAt(0) === '#') {
+        return false;
+    }
+    return new mjs_Minimatch(pattern, options).match(p);
 };
-var __privateGet = (obj, member, getter) => {
-  __accessCheck(obj, member, "read from private field");
-  return getter ? getter.call(obj) : member.get(obj);
+// Optimized checking for the most common glob patterns.
+const mjs_starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
+const mjs_starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);
+const mjs_starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
+const mjs_starDotExtTestNocase = (ext) => {
+    ext = ext.toLowerCase();
+    return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);
 };
-var __privateAdd = (obj, member, value) => {
-  if (member.has(obj))
-    throw TypeError("Cannot add the same private member more than once");
-  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
+const mjs_starDotExtTestNocaseDot = (ext) => {
+    ext = ext.toLowerCase();
+    return (f) => f.toLowerCase().endsWith(ext);
 };
-var __privateSet = (obj, member, value, setter) => {
-  __accessCheck(obj, member, "write to private field");
-  setter ? setter.call(obj, value) : member.set(obj, value);
-  return value;
+const mjs_starDotStarRE = /^\*+\.\*+$/;
+const mjs_starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');
+const mjs_starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');
+const mjs_dotStarRE = /^\.\*+$/;
+const mjs_dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');
+const mjs_starRE = /^\*+$/;
+const mjs_starTest = (f) => f.length !== 0 && !f.startsWith('.');
+const mjs_starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';
+const mjs_qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
+const mjs_qmarksTestNocase = ([$0, ext = '']) => {
+    const noext = mjs_qmarksTestNoExt([$0]);
+    if (!ext)
+        return noext;
+    ext = ext.toLowerCase();
+    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
 };
-var __privateMethod = (obj, member, method) => {
-  __accessCheck(obj, member, "access private method");
-  return method;
+const mjs_qmarksTestNocaseDot = ([$0, ext = '']) => {
+    const noext = mjs_qmarksTestNoExtDot([$0]);
+    if (!ext)
+        return noext;
+    ext = ext.toLowerCase();
+    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
 };
-var _DEFAULT_ENDPOINT, _DEFAULT_TIMEOUT, _client, _credentials, _gatewayConfiguration, _defaultBucket, _getEncodedToken, getEncodedToken_fn;
-class PinManager {
-  /**
-   * @typedef {Object} pinManagerOptions Optional settings for the constructor.
-   * @property {string} [bucket] Default bucket to use.
-   * @property {pinDownloadOptions} [gateway] Default gateway to use.
-   */
-  /**
-   * @typedef {Object} pinDownloadOptions Optional settings for downloading pins
-   * @property {string} endpoint Default gateway to use.
-   * @property {string} [token] Token for the default gateway.
-   * @property {number} [timeout=60000] Timeout for the default gateway
-   */
-  /**
-   * @summary Creates a new instance of the constructor.
-   * @param {string} clientKey - The access key ID for authentication.
-   * @param {string} clientSecret - The secret access key for authentication.
-   * @param {pinManagerOptions} [options] - Optional settings for the constructor.
-   * @tutorial quickstart-pin
-   * @example
-   * import { PinManager } from "@filebase/sdk";
-   * const pinManager = new PinManager("KEY_FROM_DASHBOARD", "SECRET_FROM_DASHBOARD", {
-   *   bucket: "my-default-bucket",
-   *   gateway: {
-   *     endpoint: "https://my-default-gateway.mydomain.com
-   *     token: SUPER_SECRET_GATEWAY_TOKEN
-   *   }
-   * });
-   */
-  constructor(clientKey, clientSecret, options) {
-    __privateAdd(this, _getEncodedToken);
-    __privateAdd(this, _DEFAULT_ENDPOINT, "https://api.filebase.io");
-    __privateAdd(this, _DEFAULT_TIMEOUT, 6e4);
-    __privateAdd(this, _client, void 0);
-    __privateAdd(this, _credentials, void 0);
-    __privateAdd(this, _gatewayConfiguration, void 0);
-    __privateAdd(this, _defaultBucket, void 0);
-    __privateSet(this, _defaultBucket, options?.bucket);
-    const PSAClientEndpoint = process.env.NODE_ENV === "test" ? process.env.TEST_NAME_ENDPOINT || __privateGet(this, _DEFAULT_ENDPOINT) : __privateGet(this, _DEFAULT_ENDPOINT), baseURL = `${PSAClientEndpoint}/v1/ipfs/pins`;
-    __privateSet(this, _credentials, {
-      key: clientKey,
-      secret: clientSecret
-    });
-    __privateSet(this, _client, axios.create({
-      baseURL,
-      timeout: __privateGet(this, _DEFAULT_TIMEOUT)
-    }));
-    __privateSet(this, _gatewayConfiguration, {
-      endpoint: options?.gateway?.endpoint,
-      token: options?.gateway?.token,
-      timeout: options?.gateway?.timeout || __privateGet(this, _DEFAULT_TIMEOUT)
-    });
-  }
-  /**
-   * @typedef {Object} pinStatus
-   * @property {string} requestid Globally unique identifier of the pin request; can be used to check the status of ongoing pinning, or pin removal
-   * @property {string} status Status a pin object can have at a pinning service. ("queued","pinning","pinned","failed")
-   * @property {string} created Immutable timestamp indicating when a pin request entered a pinning service; can be used for filtering results and pagination
-   * @property {Object} pin Pin object
-   * @property {string} pin.cid Content Identifier (CID) pinned recursively
-   * @property {string} pin.name Name for pinned data; can be used for lookups later
-   * @property {Array} pin.origins Optional list of multiaddrs known to provide the data
-   * @property {Object} pin.meta Optional metadata for pin object
-   * @property {Array} delegates List of multiaddrs designated by pinning service that will receive the pin data
-   * @property {object} [info] Optional info for PinStatus response
-   * @property {function} download Convenience function to download pin
-   */
-  /**
-   * @typedef {Object} pinOptions
-   * @property {string} [bucket] - The bucket to pin the IPFS CID into.
-   */
-  /**
-   * @typedef {Object} listPinOptions
-   * @property {Array} [cid] Return pin objects responsible for pinning the specified CID(s); be aware that using longer hash functions introduces further constraints on the number of CIDs that will fit under the limit of 2000 characters per URL in browser contexts
-   * @property {string} [name] Return pin objects with specified name (by default a case-sensitive, exact match)
-   * @property {string} [match] Customize the text matching strategy applied when the name filter is present; exact (the default) is a case-sensitive exact match, partial matches anywhere in the name, iexact and ipartial are case-insensitive versions of the exact and partial strategies
-   * @property {Array} [status] Return pin objects for pins with the specified status (when missing, service defaults to pinned only)
-   * @property {string} [before] Return results created (queued) before provided timestamp
-   * @property {string} [after] Return results created (queued) after provided timestamp
-   * @property {number} [limit] Max records to return
-   * @property {Object} [meta] Return pin objects that match specified metadata keys passed as a string representation of a JSON object; when implementing a client library, make sure the parameter is URL-encoded to ensure safe transport
-   */
-  /**
-   * @typedef {Object} listPinResults
-   * @property {number} count Total number of pin objects that exist for passed query filters
-   * @property {Array} Array of PinStatus results
-   */
-  /**
-   * @summary List the pins in a given bucket
-   * @param {listPinOptions} [listOptions]
-   * @param {pinOptions} [options]
-   * @returns {Promise}
-   * @example
-   * // List pins in bucket with a limit of 1000
-   * await pinManager.list({
-   *   limit: 1000
-   * });
-   */
-  async list(listOptions, options) {
-    try {
-      const encodedToken = __privateMethod(this, _getEncodedToken, getEncodedToken_fn).call(this, options?.bucket), getResponse = await __privateGet(this, _client).request({
-        method: "GET",
-        params: listOptions,
-        headers: { Authorization: `Bearer ${encodedToken}` }
-      });
-      for (let pinStatus of getResponse.data.results) {
-        pinStatus.download = () => {
-          return this.download(pinStatus.pin.cid);
-        };
-      }
-      return getResponse.data;
-    } catch (err) {
-      apiErrorHandler(err);
+const mjs_qmarksTestDot = ([$0, ext = '']) => {
+    const noext = mjs_qmarksTestNoExtDot([$0]);
+    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
+};
+const mjs_qmarksTest = ([$0, ext = '']) => {
+    const noext = mjs_qmarksTestNoExt([$0]);
+    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
+};
+const mjs_qmarksTestNoExt = ([$0]) => {
+    const len = $0.length;
+    return (f) => f.length === len && !f.startsWith('.');
+};
+const mjs_qmarksTestNoExtDot = ([$0]) => {
+    const len = $0.length;
+    return (f) => f.length === len && f !== '.' && f !== '..';
+};
+/* c8 ignore start */
+const mjs_defaultPlatform = (typeof process === 'object' && process
+    ? (typeof process.env === 'object' &&
+        process.env &&
+        process.env.__MINIMATCH_TESTING_PLATFORM__) ||
+        process.platform
+    : 'posix');
+const dist_mjs_path = {
+    win32: { sep: '\\' },
+    posix: { sep: '/' },
+};
+/* c8 ignore stop */
+const mjs_sep = mjs_defaultPlatform === 'win32' ? dist_mjs_path.win32.sep : dist_mjs_path.posix.sep;
+dist_mjs_minimatch.sep = mjs_sep;
+const mjs_GLOBSTAR = Symbol('globstar **');
+dist_mjs_minimatch.GLOBSTAR = mjs_GLOBSTAR;
+// any single thing other than /
+// don't need to escape / when using new RegExp()
+const dist_mjs_qmark = '[^/]';
+// * => any number of characters
+const dist_mjs_star = dist_mjs_qmark + '*?';
+// ** when dots are allowed.  Anything goes, except .. and .
+// not (^ or / followed by one or two dots followed by $ or /),
+// followed by anything, any number of times.
+const mjs_twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?';
+// not a ^ or / followed by a dot,
+// followed by anything, any number of times.
+const mjs_twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?';
+const dist_mjs_filter = (pattern, options = {}) => (p) => dist_mjs_minimatch(p, pattern, options);
+dist_mjs_minimatch.filter = dist_mjs_filter;
+const mjs_ext = (a, b = {}) => Object.assign({}, a, b);
+const dist_mjs_defaults = (def) => {
+    if (!def || typeof def !== 'object' || !Object.keys(def).length) {
+        return dist_mjs_minimatch;
     }
-  }
-  /**
-   * @summary Create a pin in the selected bucket
-   * @param {string} key Key or path of the file in the bucket
-   * @param {string} cid Content Identifier (CID) to be pinned recursively
-   * @param {Object} [metadata] Optional metadata for pin object
-   * @param {pinOptions} [options] Options for pinning the object
-   * @returns {Promise}
-   * @example
-   * // Create Pin with Metadata
-   * await pinManager.create("my-pin", "QmTJkc7crTuPG7xRmCQSz1yioBpCW3juFBtJPXhQfdCqGF", {
-   *   "application": "my-custom-app-on-filebase"
-   * });
-   */
-  async create(key, cid, metadata, options) {
-    try {
-      const encodedToken = __privateMethod(this, _getEncodedToken, getEncodedToken_fn).call(this, options?.bucket), pinStatus = await __privateGet(this, _client).request({
-        method: "POST",
-        data: {
-          cid,
-          name: key,
-          meta: metadata
+    const orig = dist_mjs_minimatch;
+    const m = (p, pattern, options = {}) => orig(p, pattern, mjs_ext(def, options));
+    return Object.assign(m, {
+        Minimatch: class Minimatch extends orig.Minimatch {
+            constructor(pattern, options = {}) {
+                super(pattern, mjs_ext(def, options));
+            }
+            static defaults(options) {
+                return orig.defaults(mjs_ext(def, options)).Minimatch;
+            }
         },
-        headers: { Authorization: `Bearer ${encodedToken}` }
-      });
-      pinStatus.data.download = () => {
-        return this.download(pinStatus.data.pin.cid);
-      };
-      return pinStatus.data;
-    } catch (err) {
-      apiErrorHandler(err);
-    }
-  }
-  /**
-   * @typedef {Object} replacePinOptions
-   * @augments pinOptions
-   * @property {Object} [metadata] Optional metadata to set on pin during replacement
-   * @property {string} [name] Optional name for pin to set during replacement
-   */
-  /**
-   * @summary Replace a pinned object in the selected bucket
-   * @param {string} requestid Unique ID for the pinned object
-   * @param {string} cid Content Identifier (CID) to be pinned recursively
-   * @param {replacePinOptions} [options] Options for pinning the object
-   * @returns {Promise}
-   * @example
-   * // Replace Pin with Metadata
-   * await pinManager.create("qr4231213", "QmTJkc7crTuPG7xRmCQSz1yioBpCW3juFBtJPXhQfdCqGF", {
-   *   "revision": Date.now()
-   * }
-   */
-  async replace(requestid, cid, options) {
-    try {
-      let replaceData = {
-        cid,
-        meta: options?.metadata || {}
-      };
-      if (options?.name) {
-        replaceData.name = options.name;
-      }
-      const encodedToken = __privateMethod(this, _getEncodedToken, getEncodedToken_fn).call(this, options?.bucket), pinStatusResult = await __privateGet(this, _client).request({
-        method: "POST",
-        url: `/${requestid}`,
-        data: replaceData,
-        validateStatus: (status) => {
-          return status === 200;
+        AST: class AST extends orig.AST {
+            /* c8 ignore start */
+            constructor(type, parent, options = {}) {
+                super(type, parent, mjs_ext(def, options));
+            }
+            /* c8 ignore stop */
+            static fromGlob(pattern, options = {}) {
+                return orig.AST.fromGlob(pattern, mjs_ext(def, options));
+            }
         },
-        headers: { Authorization: `Bearer ${encodedToken}` }
-      });
-      const pinStatus = pinStatusResult.data;
-      pinStatus.download = () => {
-        return this.download(pinStatus.pin.cid);
-      };
-      return pinStatus;
-    } catch (err) {
-      apiErrorHandler(err);
+        unescape: (s, options = {}) => orig.unescape(s, mjs_ext(def, options)),
+        escape: (s, options = {}) => orig.escape(s, mjs_ext(def, options)),
+        filter: (pattern, options = {}) => orig.filter(pattern, mjs_ext(def, options)),
+        defaults: (options) => orig.defaults(mjs_ext(def, options)),
+        makeRe: (pattern, options = {}) => orig.makeRe(pattern, mjs_ext(def, options)),
+        braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, mjs_ext(def, options)),
+        match: (list, pattern, options = {}) => orig.match(list, pattern, mjs_ext(def, options)),
+        sep: orig.sep,
+        GLOBSTAR: mjs_GLOBSTAR,
+    });
+};
+dist_mjs_minimatch.defaults = dist_mjs_defaults;
+// Brace expansion:
+// a{b,c}d -> abd acd
+// a{b,}c -> abc ac
+// a{0..3}d -> a0d a1d a2d a3d
+// a{b,c{d,e}f}g -> abg acdfg acefg
+// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
+//
+// Invalid sets are not expanded.
+// a{2..}b -> a{2..}b
+// a{b}c -> a{b}c
+const mjs_braceExpand = (pattern, options = {}) => {
+    assert_valid_pattern_assertValidPattern(pattern);
+    // Thanks to Yeting Li  for
+    // improving this regexp to avoid a ReDOS vulnerability.
+    if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
+        // shortcut. no need to expand.
+        return [pattern];
     }
-  }
-  /**
-   * @summary Download a pin from the selected IPFS gateway
-   * @param {string} cid
-   * @param {pinDownloadOptions} [options]
-   * @returns {Promise}
-   * @example
-   * // Download Pin by CID
-   * await pinManager.download("QmTJkc7crTuPG7xRmCQSz1yioBpCW3juFBtJPXhQfdCqGF");
-   */
-  async download(cid, options) {
-    const downloadOptions = Object.assign(__privateGet(this, _gatewayConfiguration), options);
-    return downloadFromGateway(cid, downloadOptions);
-  }
-  /**
-   * @summary Get details about a pinned object
-   * @param {string} requestid Globally unique identifier of the pin request
-   * @param {pinOptions} [options] Options for getting the pin
-   * @returns {Promise}
-   * @example
-   * // Get Pin Info by RequestId
-   * await pinManager.get("qr4231214");
-   */
-  async get(requestid, options) {
-    try {
-      const encodedToken = __privateMethod(this, _getEncodedToken, getEncodedToken_fn).call(this, options?.bucket), getResponseResult = await __privateGet(this, _client).request({
-        method: "GET",
-        url: `/${requestid}`,
-        headers: { Authorization: `Bearer ${encodedToken}` },
-        validateStatus: (status) => {
-          return status === 200 || status === 404;
+    return node_modules_brace_expansion(pattern);
+};
+dist_mjs_minimatch.braceExpand = mjs_braceExpand;
+// parse a component of the expanded set.
+// At this point, no pattern may contain "/" in it
+// so we're going to return a 2d array, where each entry is the full
+// pattern, split on '/', and then turned into a regular expression.
+// A regexp is made at the end which joins each array with an
+// escaped /, and another full one which joins each regexp with |.
+//
+// Following the lead of Bash 4.1, note that "**" only has special meaning
+// when it is the *only* thing in a path portion.  Otherwise, any series
+// of * is equivalent to a single *.  Globstar behavior is enabled by
+// default, and can be disabled by setting options.noglobstar.
+const mjs_makeRe = (pattern, options = {}) => new mjs_Minimatch(pattern, options).makeRe();
+dist_mjs_minimatch.makeRe = mjs_makeRe;
+const mjs_match = (list, pattern, options = {}) => {
+    const mm = new mjs_Minimatch(pattern, options);
+    list = list.filter(f => mm.match(f));
+    if (mm.options.nonull && !list.length) {
+        list.push(pattern);
+    }
+    return list;
+};
+dist_mjs_minimatch.match = mjs_match;
+// replace stuff like \* with *
+const mjs_globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
+const dist_mjs_regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+class mjs_Minimatch {
+    options;
+    set;
+    pattern;
+    windowsPathsNoEscape;
+    nonegate;
+    negate;
+    comment;
+    empty;
+    preserveMultipleSlashes;
+    partial;
+    globSet;
+    globParts;
+    nocase;
+    isWindows;
+    platform;
+    windowsNoMagicRoot;
+    regexp;
+    constructor(pattern, options = {}) {
+        assert_valid_pattern_assertValidPattern(pattern);
+        options = options || {};
+        this.options = options;
+        this.pattern = pattern;
+        this.platform = options.platform || mjs_defaultPlatform;
+        this.isWindows = this.platform === 'win32';
+        this.windowsPathsNoEscape =
+            !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
+        if (this.windowsPathsNoEscape) {
+            this.pattern = this.pattern.replace(/\\/g, '/');
         }
-      });
-      if (getResponseResult.status === 404) {
-        return false;
-      }
-      const pinStatus = getResponseResult.data;
-      pinStatus.download = () => {
-        return this.download(pinStatus.pin.cid);
-      };
-      return pinStatus;
-    } catch (err) {
-      apiErrorHandler(err);
+        this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
+        this.regexp = null;
+        this.negate = false;
+        this.nonegate = !!options.nonegate;
+        this.comment = false;
+        this.empty = false;
+        this.partial = !!options.partial;
+        this.nocase = !!this.options.nocase;
+        this.windowsNoMagicRoot =
+            options.windowsNoMagicRoot !== undefined
+                ? options.windowsNoMagicRoot
+                : !!(this.isWindows && this.nocase);
+        this.globSet = [];
+        this.globParts = [];
+        this.set = [];
+        // make the set of regexps etc.
+        this.make();
     }
-  }
-  /**
-   * @summary Delete a pinned object from the selected bucket
-   * @param requestid Globally unique identifier of the pin request
-   * @param {pinOptions} [options] Options for deleting the pin
-   * @returns {Promise}
-   * @example
-   * // Delete Pin by RequestId
-   * await pinManager.delete("qr4231213");
-   */
-  async delete(requestid, options) {
-    try {
-      const encodedToken = __privateMethod(this, _getEncodedToken, getEncodedToken_fn).call(this, options?.bucket);
-      await __privateGet(this, _client).request({
-        method: "DELETE",
-        url: `/${requestid}`,
-        headers: { Authorization: `Bearer ${encodedToken}` },
-        validateStatus: (status) => {
-          return status === 202;
+    hasMagic() {
+        if (this.options.magicalBraces && this.set.length > 1) {
+            return true;
         }
-      });
-      return true;
-    } catch (err) {
-      apiErrorHandler(err);
+        for (const pattern of this.set) {
+            for (const part of pattern) {
+                if (typeof part !== 'string')
+                    return true;
+            }
+        }
+        return false;
     }
-  }
-}
-_DEFAULT_ENDPOINT = new WeakMap();
-_DEFAULT_TIMEOUT = new WeakMap();
-_client = new WeakMap();
-_credentials = new WeakMap();
-_gatewayConfiguration = new WeakMap();
-_defaultBucket = new WeakMap();
-_getEncodedToken = new WeakSet();
-getEncodedToken_fn = function(bucket) {
-  bucket = bucket || __privateGet(this, _defaultBucket);
-  return Buffer.from(
-    `${__privateGet(this, _credentials).key}:${__privateGet(this, _credentials).secret}:${bucket}`
-  ).toString("base64");
-};
-
-
-
-<<<<<<< HEAD
-// EXTERNAL MODULE: ./node_modules/graceful-fs/graceful-fs.js
-var graceful_fs = __nccwpck_require__(20846);
-;// CONCATENATED MODULE: ./node_modules/files-from-path/esm/src/index.js
-
-
-
-
-const defaultfs = {
-  createReadStream: graceful_fs.createReadStream,
-  promises: {
-    stat: (0,external_util_.promisify)(graceful_fs.stat),
-    readdir: (0,external_util_.promisify)(graceful_fs.readdir)
-  }
-};
-async function filesFromPaths(paths, options) {
-  if (typeof paths === 'string') {
-    paths = [paths];
-  }
-  let commonParts;
-  const files = [];
-  for (const p of paths) {
-    for await (const file of filesFromPath(p, options)) {
-      files.push(file);
-      const nameParts = file.name.split(external_path_.sep);
-      if (commonParts == null) {
-        commonParts = nameParts.slice(0, -1);
-        continue;
-      }
-      for (let i = 0; i < commonParts.length; i++) {
-        if (commonParts[i] !== nameParts[i]) {
-          commonParts = commonParts.slice(0, i);
-          break;
+    debug(..._) { }
+    make() {
+        const pattern = this.pattern;
+        const options = this.options;
+        // empty patterns and comments match nothing.
+        if (!options.nocomment && pattern.charAt(0) === '#') {
+            this.comment = true;
+            return;
         }
-      }
+        if (!pattern) {
+            this.empty = true;
+            return;
+        }
+        // step 1: figure out negation, etc.
+        this.parseNegate();
+        // step 2: expand braces
+        this.globSet = [...new Set(this.braceExpand())];
+        if (options.debug) {
+            this.debug = (...args) => console.error(...args);
+        }
+        this.debug(this.pattern, this.globSet);
+        // step 3: now we have a set, so turn each one into a series of
+        // path-portion matching patterns.
+        // These will be regexps, except in the case of "**", which is
+        // set to the GLOBSTAR object for globstar behavior,
+        // and will not contain any / characters
+        //
+        // First, we preprocess to make the glob pattern sets a bit simpler
+        // and deduped.  There are some perf-killing patterns that can cause
+        // problems with a glob walk, but we can simplify them down a bit.
+        const rawGlobParts = this.globSet.map(s => this.slashSplit(s));
+        this.globParts = this.preprocess(rawGlobParts);
+        this.debug(this.pattern, this.globParts);
+        // glob --> regexps
+        let set = this.globParts.map((s, _, __) => {
+            if (this.isWindows && this.windowsNoMagicRoot) {
+                // check if it's a drive or unc path.
+                const isUNC = s[0] === '' &&
+                    s[1] === '' &&
+                    (s[2] === '?' || !mjs_globMagic.test(s[2])) &&
+                    !mjs_globMagic.test(s[3]);
+                const isDrive = /^[a-z]:/i.test(s[0]);
+                if (isUNC) {
+                    return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))];
+                }
+                else if (isDrive) {
+                    return [s[0], ...s.slice(1).map(ss => this.parse(ss))];
+                }
+            }
+            return s.map(ss => this.parse(ss));
+        });
+        this.debug(this.pattern, set);
+        // filter out everything that didn't compile properly.
+        this.set = set.filter(s => s.indexOf(false) === -1);
+        // do not treat the ? in UNC paths as magic
+        if (this.isWindows) {
+            for (let i = 0; i < this.set.length; i++) {
+                const p = this.set[i];
+                if (p[0] === '' &&
+                    p[1] === '' &&
+                    this.globParts[i][2] === '?' &&
+                    typeof p[3] === 'string' &&
+                    /^[a-z]:$/i.test(p[3])) {
+                    p[2] = '?';
+                }
+            }
+        }
+        this.debug(this.pattern, this.set);
     }
-  }
-  const commonPath = `${ commonParts ?? [].join('/') }/`;
-  const commonPathFiles = files.map(f => ({
-    ...f,
-    name: f.name.slice(commonPath.length)
-  }));
-  return options?.sort == null || options?.sort === true ? commonPathFiles.sort((a, b) => a.name === b.name ? 0 : a.name > b.name ? 1 : -1) : commonPathFiles;
-}
-async function* filesFromPath(filepath, options) {
-  filepath = external_path_.resolve(filepath);
-  const fs = options?.fs ?? defaultfs;
-  const hidden = options?.hidden ?? false;
-  const filter = filepath => {
-    if (!hidden && external_path_.basename(filepath).startsWith('.'))
-      return false;
-    return true;
-  };
-  const name = filepath;
-  const stat = await fs.promises.stat(name);
-  if (!filter(name)) {
-    return;
-  }
-  if (stat.isFile()) {
-    yield {
-      name,
-      stream: () => external_stream_.Readable.toWeb(fs.createReadStream(name)),
-      size: stat.size
-    };
-  } else if (stat.isDirectory()) {
-    yield* filesFromDir(name, filter, options);
-  }
-}
-async function* filesFromDir(dir, filter, options) {
-  const fs = options?.fs ?? defaultfs;
-  const entries = await fs.promises.readdir(external_path_.join(dir), { withFileTypes: true });
-  for (const entry of entries) {
-    if (!filter(entry.name)) {
-      continue;
+    // various transforms to equivalent pattern sets that are
+    // faster to process in a filesystem walk.  The goal is to
+    // eliminate what we can, and push all ** patterns as far
+    // to the right as possible, even if it increases the number
+    // of patterns that we have to process.
+    preprocess(globParts) {
+        // if we're not in globstar mode, then turn all ** into *
+        if (this.options.noglobstar) {
+            for (let i = 0; i < globParts.length; i++) {
+                for (let j = 0; j < globParts[i].length; j++) {
+                    if (globParts[i][j] === '**') {
+                        globParts[i][j] = '*';
+                    }
+                }
+            }
+        }
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            // aggressive optimization for the purpose of fs walking
+            globParts = this.firstPhasePreProcess(globParts);
+            globParts = this.secondPhasePreProcess(globParts);
+        }
+        else if (optimizationLevel >= 1) {
+            // just basic optimizations to remove some .. parts
+            globParts = this.levelOneOptimize(globParts);
+        }
+        else {
+            globParts = this.adjascentGlobstarOptimize(globParts);
+        }
+        return globParts;
     }
-    if (entry.isFile()) {
-      const name = external_path_.join(dir, entry.name);
-      const {size} = await fs.promises.stat(name);
-      yield {
-        name,
-        stream: () => external_stream_.Readable.toWeb(fs.createReadStream(name)),
-        size
-      };
-    } else if (entry.isDirectory()) {
-      yield* filesFromDir(external_path_.join(dir, entry.name), filter);
+    // just get rid of adjascent ** portions
+    adjascentGlobstarOptimize(globParts) {
+        return globParts.map(parts => {
+            let gs = -1;
+            while (-1 !== (gs = parts.indexOf('**', gs + 1))) {
+                let i = gs;
+                while (parts[i + 1] === '**') {
+                    i++;
+                }
+                if (i !== gs) {
+                    parts.splice(gs, i - gs);
+                }
+            }
+            return parts;
+        });
     }
-  }
-}
-;// CONCATENATED MODULE: ./pinners/filebase.js
-
-
-
-
-/* harmony default export */ const filebase = ({
-  name: "Filebase",
-  builder: async (options) => {
-    const { filebaseKey, filebaseSecret, filebaseBucket } = options;
-
-    if (!filebaseKey) {
-      throw new Error("filebaseKey is empty");
+    // get rid of adjascent ** and resolve .. portions
+    levelOneOptimize(globParts) {
+        return globParts.map(parts => {
+            parts = parts.reduce((set, part) => {
+                const prev = set[set.length - 1];
+                if (part === '**' && prev === '**') {
+                    return set;
+                }
+                if (part === '..') {
+                    if (prev && prev !== '..' && prev !== '.' && prev !== '**') {
+                        set.pop();
+                        return set;
+                    }
+                }
+                set.push(part);
+                return set;
+            }, []);
+            return parts.length === 0 ? [''] : parts;
+        });
     }
-
-    if (!filebaseSecret) {
-      throw new Error("filebaseSecret is empty");
+    levelTwoFileOptimize(parts) {
+        if (!Array.isArray(parts)) {
+            parts = this.slashSplit(parts);
+        }
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
// -> 
/
+            if (!this.preserveMultipleSlashes) {
+                for (let i = 1; i < parts.length - 1; i++) {
+                    const p = parts[i];
+                    // don't squeeze out UNC patterns
+                    if (i === 1 && p === '' && parts[0] === '')
+                        continue;
+                    if (p === '.' || p === '') {
+                        didSomething = true;
+                        parts.splice(i, 1);
+                        i--;
+                    }
+                }
+                if (parts[0] === '.' &&
+                    parts.length === 2 &&
+                    (parts[1] === '.' || parts[1] === '')) {
+                    didSomething = true;
+                    parts.pop();
+                }
+            }
+            // 
/

/../ ->

/
+            let dd = 0;
+            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                const p = parts[dd - 1];
+                if (p && p !== '.' && p !== '..' && p !== '**') {
+                    didSomething = true;
+                    parts.splice(dd - 1, 2);
+                    dd -= 2;
+                }
+            }
+        } while (didSomething);
+        return parts.length === 0 ? [''] : parts;
     }
-
-    if (!filebaseBucket) {
-      throw new Error("filebaseBucket is empty");
+    // First phase: single-pattern processing
+    // 
 is 1 or more portions
+    //  is 1 or more portions
+    // 

is any portion other than ., .., '', or ** + // is . or '' + // + // **/.. is *brutal* for filesystem walking performance, because + // it effectively resets the recursive walk each time it occurs, + // and ** cannot be reduced out by a .. pattern part like a regexp + // or most strings (other than .., ., and '') can be. + // + //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + //

// -> 
/
+    // 
/

/../ ->

/
+    // **/**/ -> **/
+    //
+    // **/*/ -> */**/ <== not valid because ** doesn't follow
+    // this WOULD be allowed if ** did follow symlinks, or * didn't
+    firstPhasePreProcess(globParts) {
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + for (let parts of globParts) { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let gss = gs; + while (parts[gss + 1] === '**') { + //

/**/**/ -> 
/**/
+                        gss++;
+                    }
+                    // eg, if gs is 2 and gss is 4, that means we have 3 **
+                    // parts, and can remove 2 of them.
+                    if (gss > gs) {
+                        parts.splice(gs + 1, gss - gs);
+                    }
+                    let next = parts[gs + 1];
+                    const p = parts[gs + 2];
+                    const p2 = parts[gs + 3];
+                    if (next !== '..')
+                        continue;
+                    if (!p ||
+                        p === '.' ||
+                        p === '..' ||
+                        !p2 ||
+                        p2 === '.' ||
+                        p2 === '..') {
+                        continue;
+                    }
+                    didSomething = true;
+                    // edit parts in place, and push the new one
+                    parts.splice(gs, 1);
+                    const other = parts.slice(0);
+                    other[gs] = '**';
+                    globParts.push(other);
+                    gs--;
+                }
+                // 
// -> 
/
+                if (!this.preserveMultipleSlashes) {
+                    for (let i = 1; i < parts.length - 1; i++) {
+                        const p = parts[i];
+                        // don't squeeze out UNC patterns
+                        if (i === 1 && p === '' && parts[0] === '')
+                            continue;
+                        if (p === '.' || p === '') {
+                            didSomething = true;
+                            parts.splice(i, 1);
+                            i--;
+                        }
+                    }
+                    if (parts[0] === '.' &&
+                        parts.length === 2 &&
+                        (parts[1] === '.' || parts[1] === '')) {
+                        didSomething = true;
+                        parts.pop();
+                    }
+                }
+                // 
/

/../ ->

/
+                let dd = 0;
+                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                    const p = parts[dd - 1];
+                    if (p && p !== '.' && p !== '..' && p !== '**') {
+                        didSomething = true;
+                        const needDot = dd === 1 && parts[dd + 1] === '**';
+                        const splin = needDot ? ['.'] : [];
+                        parts.splice(dd - 1, 2, ...splin);
+                        if (parts.length === 0)
+                            parts.push('');
+                        dd -= 2;
+                    }
+                }
+            }
+        } while (didSomething);
+        return globParts;
     }
-
-    return {
-      key: filebaseKey,
-      secret: filebaseSecret,
-      bucket: filebaseBucket,
-    };
-  },
-  upload: async (api, options) => {
-    console.log(`Parsing options...`);
-    const { path, pinName, verbose, key } = options;
-    console.log(`Parsed Options: ${JSON.stringify(options)}`);
-
-    let source = path;
-    if (!external_node_path_namespaceObject.isAbsolute(source)) {
-      const dir = (process.env.GITHUB_WORKSPACE || process.cwd()).toString();
-      source = external_node_path_namespaceObject.join(dir, source);
+    // second phase: multi-pattern dedupes
+    // {
/*/,
/

/} ->

/*/
+    // {
/,
/} -> 
/
+    // {
/**/,
/} -> 
/**/
+    //
+    // {
/**/,
/**/

/} ->

/**/
+    // ^-- not valid because ** doens't follow symlinks
+    secondPhasePreProcess(globParts) {
+        for (let i = 0; i < globParts.length - 1; i++) {
+            for (let j = i + 1; j < globParts.length; j++) {
+                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
+                if (!matched)
+                    continue;
+                globParts[i] = matched;
+                globParts[j] = [];
+            }
+        }
+        return globParts.filter(gs => gs.length);
     }
-
-    console.log(`Adding files...`);
-    const filesFromPath = await filesFromPaths(source);
-    const files = [];
-    for await (const file of filesFromPath) {
-      files.push({ path: file.name, content: file.stream() });
-      if (verbose) {
-        console.log(`Added File: ${JSON.stringify(file)}`);
-      }
+    partsMatch(a, b, emptyGSMatch = false) {
+        let ai = 0;
+        let bi = 0;
+        let result = [];
+        let which = '';
+        while (ai < a.length && bi < b.length) {
+            if (a[ai] === b[bi]) {
+                result.push(which === 'b' ? b[bi] : a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
+                result.push(a[ai]);
+                ai++;
+            }
+            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
+                result.push(b[bi]);
+                bi++;
+            }
+            else if (a[ai] === '*' &&
+                b[bi] &&
+                (this.options.dot || !b[bi].startsWith('.')) &&
+                b[bi] !== '**') {
+                if (which === 'b')
+                    return false;
+                which = 'a';
+                result.push(a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (b[bi] === '*' &&
+                a[ai] &&
+                (this.options.dot || !a[ai].startsWith('.')) &&
+                a[ai] !== '**') {
+                if (which === 'a')
+                    return false;
+                which = 'b';
+                result.push(b[bi]);
+                ai++;
+                bi++;
+            }
+            else {
+                return false;
+            }
+        }
+        // if we fall out of the loop, it means they two are identical
+        // as long as their lengths match
+        return a.length === b.length && result;
     }
-
-    console.log(`Starting filebase client`);
-    const objectManager = new ObjectManager(api.key, api.secret, {
-      bucket: api.bucket,
-    });
-    console.log(`Started filebase client`);
-
-    console.log(`Storing files...`);
-    const uploadResult = await objectManager.upload(pinName, files),
-      cid = uploadResult.cid;
-    console.log(`Stored files...`);
-    console.log(`CID: ${cid}`);
-
-    // Set IPNS name
-    let ipnsKey = null;
-    if (key) {
-      const nameManager = new NameManager(api.key, api.secret),
-        existingName = await nameManager.get(key);
-      ipnsKey = existingName.network_key;
-
-      if (existingName === false) {
-        console.log(`Creating name...`);
-        await nameManager.create(key, cid);
-        console.log(`Created name...`);
-      } else {
-        console.log(`Updating name...`);
-        await nameManager.update(key, cid);
-        console.log(`Updated name...`);
-      }
+    parseNegate() {
+        if (this.nonegate)
+            return;
+        const pattern = this.pattern;
+        let negate = false;
+        let negateOffset = 0;
+        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
+            negate = !negate;
+            negateOffset++;
+        }
+        if (negateOffset)
+            this.pattern = pattern.slice(negateOffset);
+        this.negate = negate;
     }
-
-    console.log(`Done`);
-
-    if (ipnsKey) {
-      return {
-        cid: cid,
-        ipfs: cid,
-        ipns: ipnsKey,
-      };
+    // set partial to true to test if, for example,
+    // "/a/b" matches the start of "/*/b/*/d"
+    // Partial means, if you run out of file before you run
+    // out of pattern, then that's fine, as long as all
+    // the parts match.
+    matchOne(file, pattern, partial = false) {
+        const options = this.options;
+        // UNC paths like //?/X:/... can match X:/... and vice versa
+        // Drive letters in absolute drive or unc paths are always compared
+        // case-insensitively.
+        if (this.isWindows) {
+            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
+            const fileUNC = !fileDrive &&
+                file[0] === '' &&
+                file[1] === '' &&
+                file[2] === '?' &&
+                /^[a-z]:$/i.test(file[3]);
+            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
+            const patternUNC = !patternDrive &&
+                pattern[0] === '' &&
+                pattern[1] === '' &&
+                pattern[2] === '?' &&
+                typeof pattern[3] === 'string' &&
+                /^[a-z]:$/i.test(pattern[3]);
+            const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined;
+            const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined;
+            if (typeof fdi === 'number' && typeof pdi === 'number') {
+                const [fd, pd] = [file[fdi], pattern[pdi]];
+                if (fd.toLowerCase() === pd.toLowerCase()) {
+                    pattern[pdi] = fd;
+                    if (pdi > fdi) {
+                        pattern = pattern.slice(pdi);
+                    }
+                    else if (fdi > pdi) {
+                        file = file.slice(fdi);
+                    }
+                }
+            }
+        }
+        // resolve and reduce . and .. portions in the file as well.
+        // dont' need to do the second phase, because it's only one string[]
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            file = this.levelTwoFileOptimize(file);
+        }
+        this.debug('matchOne', this, { file, pattern });
+        this.debug('matchOne', file.length, pattern.length);
+        for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
+            this.debug('matchOne loop');
+            var p = pattern[pi];
+            var f = file[fi];
+            this.debug(pattern, p, f);
+            // should be impossible.
+            // some invalid regexp stuff in the set.
+            /* c8 ignore start */
+            if (p === false) {
+                return false;
+            }
+            /* c8 ignore stop */
+            if (p === mjs_GLOBSTAR) {
+                this.debug('GLOBSTAR', [pattern, p, f]);
+                // "**"
+                // a/**/b/**/c would match the following:
+                // a/b/x/y/z/c
+                // a/x/y/z/b/c
+                // a/b/x/b/x/c
+                // a/b/c
+                // To do this, take the rest of the pattern after
+                // the **, and see if it would match the file remainder.
+                // If so, return success.
+                // If not, the ** "swallows" a segment, and try again.
+                // This is recursively awful.
+                //
+                // a/**/b/**/c matching a/b/x/y/z/c
+                // - a matches a
+                // - doublestar
+                //   - matchOne(b/x/y/z/c, b/**/c)
+                //     - b matches b
+                //     - doublestar
+                //       - matchOne(x/y/z/c, c) -> no
+                //       - matchOne(y/z/c, c) -> no
+                //       - matchOne(z/c, c) -> no
+                //       - matchOne(c, c) yes, hit
+                var fr = fi;
+                var pr = pi + 1;
+                if (pr === pl) {
+                    this.debug('** at the end');
+                    // a ** at the end will just swallow the rest.
+                    // We have found a match.
+                    // however, it will not swallow /.x, unless
+                    // options.dot is set.
+                    // . and .. are *never* matched by **, for explosively
+                    // exponential reasons.
+                    for (; fi < fl; fi++) {
+                        if (file[fi] === '.' ||
+                            file[fi] === '..' ||
+                            (!options.dot && file[fi].charAt(0) === '.'))
+                            return false;
+                    }
+                    return true;
+                }
+                // ok, let's see if we can swallow whatever we can.
+                while (fr < fl) {
+                    var swallowee = file[fr];
+                    this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);
+                    // XXX remove this slice.  Just pass the start index.
+                    if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
+                        this.debug('globstar found match!', fr, fl, swallowee);
+                        // found a match.
+                        return true;
+                    }
+                    else {
+                        // can't swallow "." or ".." ever.
+                        // can only swallow ".foo" when explicitly asked.
+                        if (swallowee === '.' ||
+                            swallowee === '..' ||
+                            (!options.dot && swallowee.charAt(0) === '.')) {
+                            this.debug('dot detected!', file, fr, pattern, pr);
+                            break;
+                        }
+                        // ** swallows a segment, and continue.
+                        this.debug('globstar swallow a segment, and continue');
+                        fr++;
+                    }
+                }
+                // no match was found.
+                // However, in partial mode, we can't say this is necessarily over.
+                /* c8 ignore start */
+                if (partial) {
+                    // ran out of file
+                    this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
+                    if (fr === fl) {
+                        return true;
+                    }
+                }
+                /* c8 ignore stop */
+                return false;
+            }
+            // something other than **
+            // non-magic patterns just have to match exactly
+            // patterns with magic have been turned into regexps.
+            let hit;
+            if (typeof p === 'string') {
+                hit = f === p;
+                this.debug('string match', p, f, hit);
+            }
+            else {
+                hit = p.test(f);
+                this.debug('pattern match', p, f, hit);
+            }
+            if (!hit)
+                return false;
+        }
+        // Note: ending in / means that we'll get a final ""
+        // at the end of the pattern.  This can only match a
+        // corresponding "" at the end of the file.
+        // If the file ends in /, then it can only match a
+        // a pattern that ends in /, unless the pattern just
+        // doesn't have any more for it. But, a/b/ should *not*
+        // match "a/b/*", even though "" matches against the
+        // [^/]*? pattern, except in partial mode, where it might
+        // simply not be reached yet.
+        // However, a/b/ should still satisfy a/*
+        // now either we fell off the end of the pattern, or we're done.
+        if (fi === fl && pi === pl) {
+            // ran out of pattern and filename at the same time.
+            // an exact hit!
+            return true;
+        }
+        else if (fi === fl) {
+            // ran out of file, but still had pattern left.
+            // this is ok if we're doing the match as part of
+            // a glob fs traversal.
+            return partial;
+        }
+        else if (pi === pl) {
+            // ran out of pattern, still have file left.
+            // this is only acceptable if we're on the very last
+            // empty segment of a file with a trailing slash.
+            // a/* should match a/b/
+            return fi === fl - 1 && file[fi] === '';
+            /* c8 ignore start */
+        }
+        else {
+            // should be unreachable.
+            throw new Error('wtf?');
+        }
+        /* c8 ignore stop */
     }
-    return {
-      cid: cid,
-      ipfs: cid,
-    };
-  },
-});
-
-;// CONCATENATED MODULE: ./pinners/index.js
-
-
-
-
-
-
-
-/* harmony default export */ const pinners = ({
-  ipfs: maker(ipfs),
-  pinata: maker(pinata),
-  infura: maker(infura),
-  filebase: maker(filebase)
-});
-
-;// CONCATENATED MODULE: ./uploader.js
-
-
-/* harmony default export */ const uploader = ({
-  upload: async (options) => {
-    const { service } = options;
-
-    if (!Object.keys(pinners).find((key) => key === service)) {
-      throw new Error("Pinning service is not supported");
+    braceExpand() {
+        return mjs_braceExpand(this.pattern, this.options);
     }
-
-    const svc = await pinners[service](options);
-    return svc.upload(options);
-  },
-});
-
-;// CONCATENATED MODULE: ./runner.js
-
-
-
-
-=======
-/***/ 35806:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-const core = __nccwpck_require__(69902);
-const github = __nccwpck_require__(91890);
-
-const uploader = __nccwpck_require__(95130);
->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05
-
-async function run() {
-  try {
-    const path = core.getInput("path");
-    const pin = core.getInput("pin");
-    const pinName = core.getInput("pinName");
-    const service = core.getInput("service");
-    const host = core.getInput("host");
-    const port = core.getInput("port");
-    const protocol = core.getInput("protocol");
-    const headers = core.getInput("headers");
-    const key = core.getInput("key");
-    const pinataKey = core.getInput("pinataKey");
-    const pinataSecret = core.getInput("pinataSecret");
-    const pinataPinName = core.getInput("pinataPinName");
-    const filebaseBucket = core.getInput("filebaseBucket")
-    const filebaseKey = core.getInput("filebaseKey")
-    const filebaseSecret = core.getInput("filebaseSecret")
-    const infuraProjectId = core.getInput("infuraProjectId");
-    const infuraProjectSecret = core.getInput("infuraProjectSecret");
-    const timeout = core.getInput("timeout");
-    const verbose = core.getInput("verbose") === "true";
-
-    const options = {
-      path,
-      pin,
-      pinName,
-      service,
-      host,
-      port,
-      protocol,
-      headers: JSON.parse(headers || "{}"),
-      key,
-      pinataKey,
-      pinataSecret,
-      pinataPinName,
-      filebaseBucket,
-      filebaseKey,
-      filebaseSecret,
-      infuraProjectId,
-      infuraProjectSecret,
-      timeout,
-      verbose,
-    };
-    const result = await uploader.upload(options).catch((err) => {
-      throw err;
-    });
-    core.setOutput("hash", result.ipfs);
-    core.setOutput("cid", result.cid);
-    core.setOutput("ipfs", result.ipfs);
-    core.setOutput("ipns", result.ipns);
-
-    if (verbose) {
-      // Get the JSON webhook payload for the event that triggered the workflow
-      const payload = JSON.stringify(github.context.payload, undefined, 2);
-      console.log(`The event payload: ${payload}`);
+    parse(pattern) {
+        assert_valid_pattern_assertValidPattern(pattern);
+        const options = this.options;
+        // shortcuts
+        if (pattern === '**')
+            return mjs_GLOBSTAR;
+        if (pattern === '')
+            return '';
+        // far and away, the most common glob pattern parts are
+        // *, *.*, and *.  Add a fast check method for those.
+        let m;
+        let fastTest = null;
+        if ((m = pattern.match(mjs_starRE))) {
+            fastTest = options.dot ? mjs_starTestDot : mjs_starTest;
+        }
+        else if ((m = pattern.match(mjs_starDotExtRE))) {
+            fastTest = (options.nocase
+                ? options.dot
+                    ? mjs_starDotExtTestNocaseDot
+                    : mjs_starDotExtTestNocase
+                : options.dot
+                    ? mjs_starDotExtTestDot
+                    : mjs_starDotExtTest)(m[1]);
+        }
+        else if ((m = pattern.match(mjs_qmarksRE))) {
+            fastTest = (options.nocase
+                ? options.dot
+                    ? mjs_qmarksTestNocaseDot
+                    : mjs_qmarksTestNocase
+                : options.dot
+                    ? mjs_qmarksTestDot
+                    : mjs_qmarksTest)(m);
+        }
+        else if ((m = pattern.match(mjs_starDotStarRE))) {
+            fastTest = options.dot ? mjs_starDotStarTestDot : mjs_starDotStarTest;
+        }
+        else if ((m = pattern.match(mjs_dotStarRE))) {
+            fastTest = mjs_dotStarTest;
+        }
+        const re = ast_AST.fromGlob(pattern, this.options).toMMPattern();
+        return fastTest ? Object.assign(re, { test: fastTest }) : re;
     }
-
-    console.log("Upload to IPFS finished successfully", result);
-  } catch (error) {
-    core.setFailed(error.message);
-    throw error;
-  }
-}
-
-<<<<<<< HEAD
-/* harmony default export */ const runner = (run);
-=======
-module.exports = run;
-
-
-/***/ }),
-
-/***/ 95130:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-const pinners = __nccwpck_require__(78700);
-
-module.exports = {
-  upload: async (options) => {
-    const { service } = options;
-
-    if (!Object.keys(pinners).find((key) => key === service)) {
-      throw new Error("Pinning service is not supported");
+    makeRe() {
+        if (this.regexp || this.regexp === false)
+            return this.regexp;
+        // at this point, this.set is a 2d array of partial
+        // pattern strings, or "**".
+        //
+        // It's better to use .match().  This function shouldn't
+        // be used, really, but it's pretty convenient sometimes,
+        // when you just want to work with a regex.
+        const set = this.set;
+        if (!set.length) {
+            this.regexp = false;
+            return this.regexp;
+        }
+        const options = this.options;
+        const twoStar = options.noglobstar
+            ? dist_mjs_star
+            : options.dot
+                ? mjs_twoStarDot
+                : mjs_twoStarNoDot;
+        const flags = new Set(options.nocase ? ['i'] : []);
+        // regexpify non-globstar patterns
+        // if ** is only item, then we just do one twoStar
+        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
+        // if ** is last, append (\/twoStar|) to previous
+        // if ** is in the middle, append (\/|\/twoStar\/) to previous
+        // then filter out GLOBSTAR symbols
+        let re = set
+            .map(pattern => {
+            const pp = pattern.map(p => {
+                if (p instanceof RegExp) {
+                    for (const f of p.flags.split(''))
+                        flags.add(f);
+                }
+                return typeof p === 'string'
+                    ? dist_mjs_regExpEscape(p)
+                    : p === mjs_GLOBSTAR
+                        ? mjs_GLOBSTAR
+                        : p._src;
+            });
+            pp.forEach((p, i) => {
+                const next = pp[i + 1];
+                const prev = pp[i - 1];
+                if (p !== mjs_GLOBSTAR || prev === mjs_GLOBSTAR) {
+                    return;
+                }
+                if (prev === undefined) {
+                    if (next !== undefined && next !== mjs_GLOBSTAR) {
+                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
+                    }
+                    else {
+                        pp[i] = twoStar;
+                    }
+                }
+                else if (next === undefined) {
+                    pp[i - 1] = prev + '(?:\\/|' + twoStar + ')?';
+                }
+                else if (next !== mjs_GLOBSTAR) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
+                    pp[i + 1] = mjs_GLOBSTAR;
+                }
+            });
+            return pp.filter(p => p !== mjs_GLOBSTAR).join('/');
+        })
+            .join('|');
+        // need to wrap in parens if we had more than one thing with |,
+        // otherwise only the first will be anchored to ^ and the last to $
+        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
+        // must match entire pattern
+        // ending in a * or ** will make it less strict.
+        re = '^' + open + re + close + '$';
+        // can match anything, as long as it's not this.
+        if (this.negate)
+            re = '^(?!' + re + ').+$';
+        try {
+            this.regexp = new RegExp(re, [...flags].join(''));
+            /* c8 ignore start */
+        }
+        catch (ex) {
+            // should be impossible
+            this.regexp = false;
+        }
+        /* c8 ignore stop */
+        return this.regexp;
     }
-
-    const svc = await pinners[service](options);
-    return svc.upload(options);
-  },
-};
-
-
-/***/ }),
-
-/***/ 35949:
-/***/ ((module) => {
-
-module.exports = eval("require")("@aws-sdk/signature-v4-crt");
-
-
-/***/ }),
-
-/***/ 84332:
-/***/ ((module) => {
-
-module.exports = eval("require")("aws-crt");
-
-
-/***/ }),
-
-/***/ 66477:
-/***/ ((module) => {
-
-module.exports = eval("require")("electron");
-
-
-/***/ }),
-
-/***/ 39491:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("assert");
-
-/***/ }),
-
-/***/ 14300:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("buffer");
-
-/***/ }),
-
-/***/ 32081:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("child_process");
-
-/***/ }),
-
-/***/ 22057:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("constants");
-
-/***/ }),
-
-/***/ 6113:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("crypto");
-
-/***/ }),
-
-/***/ 82361:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("events");
-
-/***/ }),
-
-/***/ 57147:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("fs");
-
-/***/ }),
-
-/***/ 13685:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("http");
-
-/***/ }),
-
-/***/ 85158:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("http2");
-
-/***/ }),
-
-/***/ 95687:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("https");
-
-/***/ }),
-
-/***/ 41808:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("net");
-
-/***/ }),
-
-/***/ 84492:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("node:stream");
-
-/***/ }),
-
-/***/ 22037:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("os");
-
-/***/ }),
-
-/***/ 71017:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("path");
-
-/***/ }),
-
-/***/ 77282:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("process");
-
-/***/ }),
-
-/***/ 85477:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("punycode");
-
-/***/ }),
-
-/***/ 12781:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("stream");
-
-/***/ }),
-
-/***/ 35356:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("stream/web");
-
-/***/ }),
-
-/***/ 71576:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("string_decoder");
-
-/***/ }),
-
-/***/ 24404:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("tls");
-
-/***/ }),
-
-/***/ 76224:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("tty");
-
-/***/ }),
-
-/***/ 57310:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("url");
-
-/***/ }),
-
-/***/ 73837:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("util");
-
-/***/ }),
-
-/***/ 59796:
-/***/ ((module) => {
-
-"use strict";
-module.exports = require("zlib");
-
-/***/ }),
-
-/***/ 66497:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-
-/**
- * An implementation of the CAR reader interface that is backed by a blockstore.
- *
- * @typedef {import('multiformats').CID} CID
- * @typedef {import('@ipld/car/api').CarReader} CarReader
- * @implements {CarReader}
- */
-class BlockstoreCarReader {
-  /**
-   * @param {number} version
-   * @param {CID[]} roots
-   * @param {import('ipfs-car/blockstore').Blockstore} blockstore
-   */
-  constructor(version, roots, blockstore) {
-    /**
-     * @private
-     */
-    this._version = version;
-    /**
-     * @private
-     */
-    this._roots = roots;
-    /**
-     * @private
-     */
-    this._blockstore = blockstore;
-  }
-
-  get version() {
-    return this._version
-  }
-
-  get blockstore() {
-    return this._blockstore
-  }
-
-  async getRoots() {
-    return this._roots
-  }
-
-  /**
-   * @param {CID} cid
-   */
-  has(cid) {
-    return this._blockstore.has(cid)
-  }
-
-  /**
-   * @param {CID} cid
-   */
-  async get(cid) {
-    const bytes = await this._blockstore.get(cid);
-    return { cid, bytes }
-  }
-
-  blocks() {
-    return this._blockstore.blocks()
-  }
-
-  async *cids() {
-    for await (const b of this.blocks()) {
-      yield b.cid;
+    slashSplit(p) {
+        // if p starts with // on windows, we preserve that
+        // so that UNC paths aren't broken.  Otherwise, any number of
+        // / characters are coalesced into one, unless
+        // preserveMultipleSlashes is set to true.
+        if (this.preserveMultipleSlashes) {
+            return p.split('/');
+        }
+        else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
+            // add an extra '' for the one we lose
+            return ['', ...p.split(/\/+/)];
+        }
+        else {
+            return p.split(/\/+/);
+        }
     }
-  }
-}
-
-exports.BlockstoreCarReader = BlockstoreCarReader;
-//# sourceMappingURL=bs-car-reader.cjs.map
-
-
-/***/ }),
-
-/***/ 36865:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
+    match(f, partial = this.partial) {
+        this.debug('match', f, this.pattern);
+        // short-circuit in the case of busted things.
+        // comments, etc.
+        if (this.comment) {
+            return false;
+        }
+        if (this.empty) {
+            return f === '';
+        }
+        if (f === '/' && partial) {
+            return true;
+        }
+        const options = this.options;
+        // windows: need to use /, not \
+        if (this.isWindows) {
+            f = f.split('\\').join('/');
+        }
+        // treat the test path as a set of pathparts.
+        const ff = this.slashSplit(f);
+        this.debug(this.pattern, 'split', ff);
+        // just ONE of the pattern sets in this.set needs to match
+        // in order for it to be valid.  If negating, then just one
+        // match means that we have failed.
+        // Either way, return on the first hit.
+        const set = this.set;
+        this.debug(this.pattern, 'set', set);
+        // Find the basename of the path by looking for the last non-empty segment
+        let filename = ff[ff.length - 1];
+        if (!filename) {
+            for (let i = ff.length - 2; !filename && i >= 0; i--) {
+                filename = ff[i];
+            }
+        }
+        for (let i = 0; i < set.length; i++) {
+            const pattern = set[i];
+            let file = ff;
+            if (options.matchBase && pattern.length === 1) {
+                file = [filename];
+            }
+            const hit = this.matchOne(file, pattern, partial);
+            if (hit) {
+                if (options.flipNegate) {
+                    return true;
+                }
+                return !this.negate;
+            }
+        }
+        // didn't get any hits.  this is success if it's a negative
+        // pattern, failure otherwise.
+        if (options.flipNegate) {
+            return false;
+        }
+        return this.negate;
+    }
+    static defaults(def) {
+        return dist_mjs_minimatch.defaults(def).Minimatch;
+    }
+}
+/* c8 ignore start */
 
-const GATEWAY = new URL('https://nftstorage.link/');
 
-/**
- * @typedef {string|URL} GatewayURL Base URL of an IPFS Gateway e.g. https://dweb.link/ or https://ipfs.io/
- * @typedef {{ gateway?: GatewayURL }} GatewayURLOptions
- */
 
+/* c8 ignore stop */
+dist_mjs_minimatch.AST = ast_AST;
+dist_mjs_minimatch.Minimatch = mjs_Minimatch;
+dist_mjs_minimatch.escape = mjs_escape_escape;
+dist_mjs_minimatch.unescape = mjs_unescape_unescape;
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/it-glob/dist/src/index.js
 /**
- * Convert an IPFS URL (starting ipfs://) to a gateway URL (starting https://)
- * that can be used in a webpage. If the passed URL is not an IPFS URL it is
- * returned as a new URL object with no further changes.
+ * @packageDocumentation
  *
- * @param {string|URL} url An IPFS URL e.g. ipfs://bafy.../path
- * @param {GatewayURLOptions} [options] Options that allow customization of the gateway used.
- * @returns {URL} An IPFS gateway URL e.g. https://nftstorage.link/ipfs/bafy.../path
- */
-const toGatewayURL = (url, options = {}) => {
-  const gateway = options.gateway || GATEWAY;
-  url = new URL(String(url));
-  return url.protocol === 'ipfs:'
-    ? new URL(`/ipfs/${url.href.slice('ipfs://'.length)}`, gateway)
-    : url
-};
-
-exports.GATEWAY = GATEWAY;
-exports.toGatewayURL = toGatewayURL;
-//# sourceMappingURL=gateway.cjs.map
-
-
-/***/ }),
-
-/***/ 5369:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-
-var pack = __nccwpck_require__(47859);
-__nccwpck_require__(24247);
-var token = __nccwpck_require__(65726);
-__nccwpck_require__(12830);
-var formData = __nccwpck_require__(53077);
-__nccwpck_require__(44883);
-var file = __nccwpck_require__(96614);
-var fs = __nccwpck_require__(75433);
-var gateway = __nccwpck_require__(36865);
-var bsCarReader = __nccwpck_require__(66497);
-var pipe = __nccwpck_require__(74824);
-var libStorage = __nccwpck_require__(13436);
-var clientS3 = __nccwpck_require__(60382);
-var stream = __nccwpck_require__(84492);
-
-function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
-
-var pipe__default = /*#__PURE__*/_interopDefaultLegacy(pipe);
-var stream__default = /*#__PURE__*/_interopDefaultLegacy(stream);
-
-/**
- * A client library for the https://filebase.storage/ service. It provides a convenient
- * interface for working with the [Raw HTTP API](https://filebase.storage/#api-docs)
- * from a web browser or [Node.js](https://nodejs.org/) and comes bundled with
- * TS for out-of-the box type inference and better IntelliSense.
+ * Like [`glob`](https://npmjs.com/package/glob) but async iterable.
  *
  * @example
- * ```js
- * import { FilebaseClient, File, Blob } from "filebase.storage"
- * const client = new FilebaseClient({ token: API_TOKEN })
  *
- * const cid = await client.storeBlob(new Blob(['hello world']))
+ * ```javascript
+ * import glob from 'it-glob'
+ *
+ * const options = {
+ *   cwd // defaults to process.cwd
+ *   absolute // return absolute paths, defaults to false
+ *   nodir // only yield file paths, skip directories
+ *
+ *   // all other options are passed to minimatch
+ * }
+ *
+ * for await (const path of glob('/path/to/file', '**\/*', options)) {
+ *  console.info(path)
+ * }
  * ```
- * @module
- */
-
-const MAX_STORE_RETRIES = 5;
-const MAX_CONCURRENT_UPLOADS = 4;
-const DEFAULT_ENDPOINT = 'https://s3.filebase.com';
-
-/**
- * @typedef {import('./lib/interface.js').Service} Service
- * @typedef {import('./lib/interface.js').CIDString} CIDString
- * @typedef {import('./lib/interface.js').Deal} Deal
- * @typedef {import('./lib/interface.js').FileObject} FileObject
- * @typedef {import('./lib/interface.js').FilesSource} FilesSource
- * @typedef {import('./lib/interface.js').Pin} Pin
- * @typedef {import('./lib/interface.js').CarReader} CarReader
- * @typedef {import('./lib/interface.js').S3ClientConfig} S3ClientConfig
- * @typedef {import('ipfs-car/blockstore').Blockstore} BlockstoreI
- * @typedef {import('./lib/interface.js').RateLimiter} RateLimiter
- */
-
-/**
- * @template {import('./lib/interface.js').TokenInput} T
- * @typedef {import('./lib/interface.js').Token} TokenType
- */
-
-/**
- * Parses Authentication Token
  *
- * @param {string | string[]} tokenToParse
- * @returns {import('./lib/interface.js').ParseTokenResult}
+ * See the [minimatch docs](https://www.npmjs.com/package/minimatch#options) for the full list of options.
  */
-function parseToken(tokenToParse) {
-  if (Array.isArray(tokenToParse)) {
-    if (typeof tokenToParse[2] === "undefined") {
-      throw new Error(`No Bucket Found`);
-    }
-    return {
-      credentials: tokenToParse,
-      bucket: tokenToParse[2]
-    }
-  }
-
-  const token = atob(tokenToParse).split(':');
-  const bucket = token[2];
-
-  if (typeof token === "undefined" || !Array.isArray(token)) {
-    throw new Error(`Token Not Found`)
-  }
 
-  if (typeof token[0] !== "string") {
-    throw new Error(`Invalid Access Key`)
-  }
-
-  if (typeof token[1] !== "string") {
-    throw new Error(`Invalid Secret Key`)
-  }
-
-  if (typeof bucket === "undefined") {
-    throw new Error(`No Bucket Found`);
-  }
 
-  return {
-    credentials: token,
-    bucket: bucket
-  }
-}
 
 /**
+ * Async iterable filename pattern matcher
  */
-class FilebaseClient {
-  /**
-   * Constructs a client bound to the given `options.token` and
-   * `options.endpoint`.
-   *
-   * @example
-   * ```js
-   * import { FilebaseClient, File, Blob } from "filebase.storage"
-   * const client = new FilebaseClient({ token: API_TOKEN })
-   *
-   * const cid = await client.storeBlob(new Blob(['hello world']))
-   * ```
-   * Optionally you could pass an alternative API endpoint (e.g. for testing)
-   * @example
-   * ```js
-   * import { FilebaseClient } from "filebase.storage"
-   * const client = new FilebaseClient({
-   *   token: API_TOKEN
-   *   endpoint: new URL('http://localhost:8080/')
-   * })
-   * ```
-   *
-   * @param {{token: string, endpoint?: string, s3config?: S3ClientConfig, bucket?: string}} options
-   */
-  constructor({
-    endpoint = DEFAULT_ENDPOINT,
-    token,
-    s3config,
-    bucket
-  }) {
-    this.endpoint = endpoint;
-
-    if (typeof token === "undefined" && s3config) {
-      this.s3config = s3config;
-      if (typeof this.s3config.credentials === "undefined") {
-        throw new Error(`Must pass credentials`)
-      }
-    } else {
-      const parsedToken = parseToken(token);
-      this.token = parsedToken.credentials;
-      this.bucket = bucket || parsedToken.bucket;
-
-      this.s3config = {
-        credentials: {
-          accessKeyId: this.token[0] || "",
-          secretAccessKey: this.token[1] || ""
-        },
-        endpoint: endpoint,
-        maxAttempts: MAX_STORE_RETRIES,
-        region: "us-east-1",
-        forcePathStyle: true,
-      };
-    }
-  }
-
-  /**
-   * Stores a single file and returns its CID.
-   *
-   * @param {Service} service
-   * @param {Blob} blob
-   * @param {string | null} objectName
-   * @returns {Promise}
-   */
-  static async storeBlob(service, blob, objectName = null) {
-    const blockstore = new fs.FsBlockStore();
-
-    try {
-      const { cid, car } = await FilebaseClient.encodeBlob(blob, { blockstore });
-      await FilebaseClient.storeCar(service, car, objectName || cid.toString());
-
-      return cid.toString();
-    } finally {
-      await blockstore.close();
-    }
-  }
-
-  /**
-   * Stores a CAR file and returns its root CID.
-   *
-   * @param {Service} service
-   * @param {AsyncIterable} car
-   * @param {string} objectName
-   * @param {import('./lib/interface.js').CarStorerOptions} [options]
-   * @returns {Promise}
-   */
-  static async storeCar(
-    { endpoint, token, s3config, bucket },
-    car,
-    objectName ,
-    { onStoredChunk, onComplete, maxRetries} = {}
-  ) {
-    const selectedEndpoint = endpoint || DEFAULT_ENDPOINT;
-
-    if (typeof s3config === "undefined" && typeof token !== "undefined") {
-      const parsedToken = await parseToken(token);
-      this.token = parsedToken.credentials;
-      this.bucket = bucket || parsedToken.bucket;
-
-      s3config = {
-        credentials: {
-          accessKeyId: this.token[0] || "",
-          secretAccessKey: this.token[1] || ""
-        },
-        endpoint: selectedEndpoint,
-        maxAttempts: maxRetries || MAX_STORE_RETRIES,
-        region: "us-east-1",
-        forcePathStyle: true,
-      };
-    } else {
-      this.bucket = bucket;
-    }
-
-    if (typeof s3config === "undefined") {
-      throw new Error(`s3config not defined`)
-    }
-
-    const s3client = new clientS3.S3Client(s3config);
-
-    // Convert to an S3 upload of the full car
-    const readableStream = stream__default['default'].Readable.from(car);
-    onComplete && readableStream.on('finish', onComplete);
-    const parallelUploads3 = new libStorage.Upload({
-      client: s3client,
-      params: {
-        Bucket: this.bucket,
-        Key: objectName,
-        Body: readableStream,
-        Metadata: {
-          import: 'car'
-        },
-      },
-      queueSize: MAX_CONCURRENT_UPLOADS,
-      leavePartsOnError: false, // optional manually handle dropped parts
-    });
-
-    let storedBytes = 0.01;
-    let progressBytes = storedBytes;
-    parallelUploads3.on("httpUploadProgress", (progress) => {
-      if (typeof progress.loaded !== "number") {
-        throw new Error(`Expected Number for Loaded Progress`);
-      }
-      progressBytes = progress.loaded - storedBytes;
-      storedBytes = progress.loaded;
-      onStoredChunk && onStoredChunk(progressBytes);
-    });
-
-    const uploadResult = await parallelUploads3.done();
-    console.dir(uploadResult);
-
-    const headCommand = new clientS3.HeadObjectCommand({
-      Bucket: this.bucket,
-      Key: objectName,
-    });
-    const carHeader = await s3client.send(headCommand);
-
-    if (typeof carHeader.Metadata === "undefined" || typeof carHeader.Metadata['cid'] === "undefined") {
-      throw new Error(`No CID Returned from Remote`)
-    }
-
-    return carHeader.Metadata['cid'];
-  }
-
-  /**
-   * Stores a directory of files and returns a CID. Provided files **MUST**
-   * be within the same directory, otherwise error is raised e.g. `foo/bar.png`,
-   * `foo/bla/baz.json` is ok but `foo/bar.png`, `bla/baz.json` is not.
-   *
-   * @param {Service} service
-   * @param {FilesSource} filesSource
-   * @param {string | null} objectName
-   * @returns {Promise}
-   */
-  static async storeDirectory(service, filesSource, objectName = null) {
-    const blockstore = new fs.FsBlockStore();
-    let cidString;
-    try {
-      const { cid, car } = await FilebaseClient.encodeDirectory(filesSource, {
-        blockstore,
-      });
-      cidString = cid.toString();
-      await FilebaseClient.storeCar(service, car, objectName || cid.toString());
-    } finally {
-      await blockstore.close();
-    }
-
-    return cidString
-  }
-
-  /**
-   * Stores the given token and all resources it references (in the form of a
-   * File or a Blob) along with a metadata JSON as specificed in ERC-1155. The
-   * `token.image` must be either a `File` or a `Blob` instance, which will be
-   * stored and the corresponding content address URL will be saved in the
-   * metadata JSON file under `image` field.
-   *
-   * If `token.properties` contains properties with `File` or `Blob` values,
-   * those also get stored and their URLs will be saved in the metadata JSON
-   * file in their place.
-   *
-   * Note: URLs for `File` objects will retain file names e.g. in case of
-   * `new File([bytes], 'cat.png', { type: 'image/png' })` will be transformed
-   * into a URL that looks like `ipfs://bafy...hash/image/cat.png`. For `Blob`
-   * objects, the URL will not have a file name name or mime type, instead it
-   * will be transformed into a URL that looks like
-   * `ipfs://bafy...hash/image/blob`.
-   *
-   * @template {import('./lib/interface.js').TokenInput} T
-   * @param {Service} service
-   * @param {T} metadata
-   * @param {string | null} objectName
-   * @returns {Promise>}
-   */
-  static async store(service, metadata, objectName = null) {
-    const { token, car, cid } = await FilebaseClient.encodeNFT(metadata);
-    await FilebaseClient.storeCar(service, car, objectName || cid.toString());
-    return token
-  }
-
-  /**
-   * Returns current status of the stored NFT by its CID. Note the NFT must
-   * have previously been stored by this account.
-   *
-   * @param {Service} service
-   * @param {string} cid
-   * @param {string | null} objectName
-   * @returns {Promise}
-   */
-  static async status(
-    { endpoint, token, s3config, bucket },
-    cid,
-    objectName
-  ) {
-    const selectedEndpoint = endpoint || DEFAULT_ENDPOINT;
-
-    if (typeof s3config === "undefined" && typeof token !== "undefined") {
-      const parsedToken = parseToken(token);
-      this.token = parsedToken.credentials;
-      this.bucket = bucket || parsedToken.bucket;
-
-      s3config = {
-        credentials: {
-          accessKeyId: this.token[0] || "",
-          secretAccessKey: this.token[1] || ""
-        },
-        endpoint: selectedEndpoint,
-        maxAttempts: MAX_STORE_RETRIES,
-        region: "us-east-1",
-        forcePathStyle: true,
-      };
-    } else {
-      this.bucket = bucket;
-    }
-
-    if (typeof s3config === "undefined") {
-      throw new Error(`s3config not defined`)
-    }
-
-    const s3client = new clientS3.S3Client(s3config);
-
-    const headCommand = new clientS3.HeadObjectCommand({
-      Bucket: this.bucket,
-      Key: objectName || cid,
-    });
-    const carHeader = await s3client.send(headCommand);
-
-    if (typeof carHeader.Metadata === "undefined" || typeof carHeader.Metadata['cid'] === "undefined") {
-      throw new Error(`No CID Returned from Remote`)
-    }
-
-    if (typeof carHeader['ContentLength'] !== "number") {
-      throw new Error(`Invalid Content Length`)
-    }
-
-    const displayDate = carHeader.LastModified;
-
-    if (typeof displayDate === "undefined") {
-      throw new Error('Invalid Date')
-    }
-
-    return {
-      cid: carHeader.Metadata['cid'],
-      size: carHeader['ContentLength'],
-      deals: [],
-      pin: {
-        cid: carHeader.Metadata['cid'],
-        name: carHeader.Metadata['cid'],
-        status: 'pinned',
-        created: displayDate,
-      },
-      created: displayDate,
-    }
-  }
-
-
-  /**
-   * Removes stored content by its CID from this account. Please note that
-   * even if content is removed from the service other nodes that have
-   * replicated it might still continue providing it.
-   *
-   * @param {Service} service
-   * @param {string} cid
-   * @param {string | null} objectName
-   * @returns {Promise}
-   */
-  static async delete(
-    { endpoint, token, s3config, bucket },
-    cid,
-    objectName = null
-  ) {
-    const selectedEndpoint = endpoint || DEFAULT_ENDPOINT;
-
-    if (typeof s3config === "undefined" && typeof token !== "undefined") {
-      const parsedToken = parseToken(token);
-      this.token = parsedToken.credentials;
-      this.bucket = bucket || parsedToken.bucket;
-
-      s3config = {
-        credentials: {
-          accessKeyId: this.token[0] || "",
-          secretAccessKey: this.token[1] || ""
-        },
-        endpoint: selectedEndpoint,
-        region: "us-east-1",
-        forcePathStyle: true,
-      };
-    } else {
-      this.bucket = bucket;
-    }
-
-    if (typeof s3config === "undefined") {
-      throw new Error(`s3config not defined`)
-    }
-
-    const s3client = new clientS3.S3Client(s3config);
-
-    const deleteCommand = new clientS3.DeleteObjectCommand({
-      Bucket: this.bucket,
-      Key: objectName || cid,
-    });
-
-    await s3client.send(deleteCommand);
-  }
-
-  /**
-   * Encodes the given token and all resources it references (in the form of a
-   * File or a Blob) along with a metadata JSON as specificed in ERC-1155 to a
-   * CAR file. The `token.image` must be either a `File` or a `Blob` instance,
-   * which will be stored and the corresponding content address URL will be
-   * saved in the metadata JSON file under `image` field.
-   *
-   * If `token.properties` contains properties with `File` or `Blob` values,
-   * those also get stored and their URLs will be saved in the metadata JSON
-   * file in their place.
-   *
-   * Note: URLs for `File` objects will retain file names e.g. in case of
-   * `new File([bytes], 'cat.png', { type: 'image/png' })` will be transformed
-   * into a URL that looks like `ipfs://bafy...hash/image/cat.png`. For `Blob`
-   * objects, the URL will not have a file name name or mime type, instead it
-   * will be transformed into a URL that looks like
-   * `ipfs://bafy...hash/image/blob`.
-   *
-   * @example
-   * ```js
-   * const { token, car } = await FilebaseClient.encodeNFT({
-   *   name: 'filebase.storage store test',
-   *   description: 'Test ERC-1155 compatible metadata.',
-   *   image: new File([''], 'pinpie.jpg', { type: 'image/jpg' }),
-   *   properties: {
-   *     custom: 'Custom data can appear here, files are auto uploaded.',
-   *     file: new File([''], 'README.md', { type: 'text/plain' }),
-   *   }
-   * })
-   *
-   * console.log('IPFS URL for the metadata:', token.url)
-   * console.log('metadata.json contents:\n', token.data)
-   * console.log('metadata.json with IPFS gateway URLs:\n', token.embed())
-   *
-   * // Now store the CAR file on filebase.storage
-   * await client.storeCar(car)
-   * ```
-   *
-   * @template {import('./lib/interface.js').TokenInput} T
-   * @param {T} input
-   * @returns {Promise<{ cid: CID, token: TokenType, car: AsyncIterable }>}
-   */
-  static async encodeNFT(input) {
-    validateERC1155(input);
-    return token.Token.encode(input)
-  }
-
-  /**
-   * Encodes a single file to a CAR file and also returns its root CID.
-   *
-   * @example
-   * ```js
-   * const content = new Blob(['hello world'])
-   * const { cid, car } = await FilebaseClient.encodeBlob(content)
-   *
-   * // Root CID of the file
-   * console.log(cid.toString())
-   *
-   * // Now store the CAR file on filebase.storage
-   * await client.storeCar(car)
-   * ```
-   *
-   * @param {Blob} blob
-   * @param {object} [options]
-   * @param {BlockstoreI} [options.blockstore]
-   * @returns {Promise<{ cid: CID, car: AsyncIterable }>}
-   */
-  static async encodeBlob(blob, { blockstore } = {}) {
-    if (blob.size === 0) {
-      throw new Error('Content size is 0, make sure to provide some content')
+async function* dist_src_glob(dir, pattern, options = {}) {
+    const absoluteDir = external_path_.resolve(dir);
+    const relativeDir = external_path_.relative(options.cwd ?? process.cwd(), dir);
+    const stats = await promises_namespaceObject.stat(absoluteDir);
+    if (stats.isDirectory()) {
+        for await (const entry of it_glob_dist_src_glob(absoluteDir, '', pattern, options)) {
+            yield entry;
+        }
+        return;
     }
-    return packCar([toImportCandidate('blob', blob)], {
-      blockstore,
-      wrapWithDirectory: false,
-    })
-  }
-
-  /**
-   * Encodes a directory of files to a CAR file and also returns the root CID.
-   * Provided files **MUST** be within the same directory, otherwise error is
-   * raised e.g. `foo/bar.png`, `foo/bla/baz.json` is ok but `foo/bar.png`,
-   * `bla/baz.json` is not.
-   *
-   * @example
-   * ```js
-   * const { cid, car } = await FilebaseClient.encodeDirectory([
-   *   new File(['hello world'], 'hello.txt'),
-   *   new File([JSON.stringify({'from': 'incognito'}, null, 2)], 'metadata.json')
-   * ])
-   *
-   * // Root CID of the directory
-   * console.log(cid.toString())
-   *
-   * // Now store the CAR file on filebase.storage
-   * await client.storeCar(car)
-   * ```
-   *
-   * @param {FilesSource} files
-   * @param {object} [options]
-   * @param {BlockstoreI} [options.blockstore]
-   * @returns {Promise<{ cid: CID, car: AsyncIterable }>}
-   */
-  static async encodeDirectory(files, { blockstore } = {}) {
-    let size = 0;
-    const input = pipe__default['default'](files, async function* (files) {
-      for await (const file of files) {
-        yield toImportCandidate(file.name, file);
-        size += file.size;
-      }
-    });
-    const packed = await packCar(input, {
-      blockstore,
-      wrapWithDirectory: true,
-    });
-    if (size === 0) {
-      throw new Error(
-        'Total size of files should exceed 0, make sure to provide some content'
-      )
+    if (dist_mjs_minimatch(relativeDir, pattern, options)) {
+        yield options.absolute === true ? absoluteDir : relativeDir;
     }
-    return packed
-  }
-
-  /**
-   * Stores a single file and returns the corresponding Content Identifier (CID).
-   * Takes a [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)
-   * or a [File](https://developer.mozilla.org/en-US/docs/Web/API/File). Note
-   * that no file name or file metadata is retained.
-   *
-   * @example
-   * ```js
-   * const content = new Blob(['hello world'])
-   * const cid = await client.storeBlob(content)
-   * cid //> 'zdj7Wn9FQAURCP6MbwcWuzi7u65kAsXCdjNTkhbJcoaXBusq9'
-   * ```
-   *
-   * @param {Blob} blob
-   * @param {string | null} objectName
-   */
-  storeBlob(blob, objectName = null) {
-    return FilebaseClient.storeBlob(this, blob, objectName)
-  }
-
-  /**
-   * Stores files encoded as a single [Content Addressed Archive
-   * (CAR)](https://github.com/ipld/specs/blob/master/block-layer/content-addressable-archives.md).
-   *
-   * Takes a [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)
-   * or a [File](https://developer.mozilla.org/en-US/docs/Web/API/File).
-   *
-   * Returns the corresponding Content Identifier (CID).
-   *
-   * See the [`ipfs-car` docs](https://www.npmjs.com/package/ipfs-car) for more
-   * details on packing a CAR file.
-   *
-   * @example
-   * ```js
-   * import { pack } from 'ipfs-car/pack'
-   * import { CarReader } from '@ipld/car'
-   * const { out, root } = await pack({
-   *  input: fs.createReadStream('pinpie.pdf')
-   * })
-   * const expectedCid = root.toString()
-   * const carReader = await CarReader.fromIterable(out)
-   * const cid = await storage.storeCar(carReader)
-   * console.assert(cid === expectedCid)
-   * ```
-   *
-   * @example
-   * ```
-   * import { packToBlob } from 'ipfs-car/pack/blob'
-   * const data = 'Hello world'
-   * const { root, car } = await packToBlob({ input: [new TextEncoder().encode(data)] })
-   * const expectedCid = root.toString()
-   * const cid = await client.storeCar(car)
-   * console.assert(cid === expectedCid)
-   * ```
-   * @param {AsyncIterable} car
-   * @param {string} objectName
-   * @param {import('./lib/interface.js').CarStorerOptions} [options]
-   */
-  storeCar(car, objectName, options) {
-    return FilebaseClient.storeCar(this, car, objectName, options)
-  }
-
-  /**
-   * Stores a directory of files and returns a CID for the directory.
-   *
-   * @example
-   * ```js
-   * const cid = await client.storeDirectory([
-   *   new File(['hello world'], 'hello.txt'),
-   *   new File([JSON.stringify({'from': 'incognito'}, null, 2)], 'metadata.json')
-   * ])
-   * cid //>
-   * ```
-   *
-   * Argument can be a [FileList](https://developer.mozilla.org/en-US/docs/Web/API/FileList)
-   * instance as well, in which case directory structure will be retained.
-   *
-   * @param {FilesSource} files
-   * @param {string | null} objectName
-   */
-  storeDirectory(files, objectName = null) {
-    return FilebaseClient.storeDirectory(this, files, objectName)
-  }
-
-  /**
-   * Returns current status of the stored NFT by its CID. Note the NFT must
-   * have previously been stored by this account.
-   *
-   * @example
-   * ```js
-   * const status = await client.status('zdj7Wn9FQAURCP6MbwcWuzi7u65kAsXCdjNTkhbJcoaXBusq9')
-   * ```
-   *
-   * @param {string} cid
-   * @param {string | null} objectName
-   */
-  status(cid, objectName = null) {
-    return FilebaseClient.status(this, cid, objectName)
-  }
-
-  /**
-   * Removes stored content by its CID from the service.
-   *
-   * > Please note that even if content is removed from the service other nodes
-   * that have replicated it might still continue providing it.
-   *
-   * @example
-   * ```js
-   * await client.delete('zdj7Wn9FQAURCP6MbwcWuzi7u65kAsXCdjNTkhbJcoaXBusq9')
-   * ```
-   *
-   * @param {string} cid
-   * @param {string | null} objectName
-   */
-  delete(cid, objectName = null) {
-    return FilebaseClient.delete(this, cid, objectName)
-  }
-
-  /**
-   * Stores the given token and all resources it references (in the form of a
-   * File or a Blob) along with a metadata JSON as specificed in
-   * [ERC-1155](https://eips.ethereum.org/EIPS/eip-1155#metadata). The
-   * `token.image` must be either a `File` or a `Blob` instance, which will be
-   * stored and the corresponding content address URL will be saved in the
-   * metadata JSON file under `image` field.
-   *
-   * If `token.properties` contains properties with `File` or `Blob` values,
-   * those also get stored and their URLs will be saved in the metadata JSON
-   * file in their place.
-   *
-   * Note: URLs for `File` objects will retain file names e.g. in case of
-   * `new File([bytes], 'cat.png', { type: 'image/png' })` will be transformed
-   * into a URL that looks like `ipfs://bafy...hash/image/cat.png`. For `Blob`
-   * objects, the URL will not have a file name name or mime type, instead it
-   * will be transformed into a URL that looks like
-   * `ipfs://bafy...hash/image/blob`.
-   *
-   * @example
-   * ```js
-   * const metadata = await client.store({
-   *   name: 'filebase.storage store test',
-   *   description: 'Test ERC-1155 compatible metadata.',
-   *   image: new File([''], 'pinpie.jpg', { type: 'image/jpg' }),
-   *   properties: {
-   *     custom: 'Custom data can appear here, files are auto uploaded.',
-   *     file: new File([''], 'README.md', { type: 'text/plain' }),
-   *   }
-   * })
-   *
-   * console.log('IPFS URL for the metadata:', metadata.url)
-   * console.log('metadata.json contents:\n', metadata.data)
-   * console.log('metadata.json with IPFS gateway URLs:\n', metadata.embed())
-   * ```
-   *
-   * @template {import('./lib/interface.js').TokenInput} T
-   * @param {T} token
-   * @param {string | null} objectName
-   */
-  store(token, objectName = null) {
-    return FilebaseClient.store(this, token, objectName)
-  }
 }
-
-/**
- * Cast an iterable to an asyncIterable
- * @template T
- * @param {Iterable} iterable
- * @returns {AsyncIterable}
- */
-function toAsyncIterable(iterable) {
-  return (async function* () {
-    for (const item of iterable) {
-      yield item;
+async function* it_glob_dist_src_glob(base, dir, pattern, options) {
+    for await (const entry of await promises_namespaceObject.opendir(external_path_.join(base, dir))) {
+        const relativeEntryPath = external_path_.join(dir, entry.name);
+        const absoluteEntryPath = external_path_.join(base, dir, entry.name);
+        let match = dist_mjs_minimatch(relativeEntryPath, pattern, options);
+        const isDirectory = entry.isDirectory();
+        if (isDirectory && options.nodir === true) {
+            match = false;
+        }
+        if (match) {
+            yield options.absolute === true ? absoluteEntryPath : relativeEntryPath;
+        }
+        if (isDirectory) {
+            yield* it_glob_dist_src_glob(base, relativeEntryPath, pattern, options);
+        }
     }
-  })()
 }
-
-/**
- * @template {import('./lib/interface.js').TokenInput} T
- * @param {T} metadata
- */
-const validateERC1155 = ({ name, description, image, decimals }) => {
-  // Just validate that expected fields are present
-  if (typeof name !== 'string') {
-    throw new TypeError(
-      'string property `name` identifying the asset is required'
-    )
-  }
-  if (typeof description !== 'string') {
-    throw new TypeError(
-      'string property `description` describing asset is required'
-    )
-  }
-  if (!(image instanceof file.Blob)) {
-    throw new TypeError('property `image` must be a Blob or File object')
-  } else if (!image.type.startsWith('image/')) {
-    console.warn(`According to ERC721 Metadata JSON Schema 'image' must have 'image/*' mime type.
-
-For better interoperability we would highly recommend storing content with different mime type under 'properties' namespace e.g. \`properties: { video: file }\` and using 'image' field for storing a preview image for it instead.
-
-For more context please see ERC-721 specification https://eips.ethereum.org/EIPS/eip-721`);
-  }
-
-  if (typeof decimals !== 'undefined' && typeof decimals !== 'number') {
-    throw new TypeError('property `decimals` must be an integer value')
-  }
-};
-
-/**
- * @param {import('ipfs-car/pack').ImportCandidateStream|Array<{ path: string, content: import('./platform.js').ReadableStream }>} input
- * @param {object} [options]
- * @param {BlockstoreI} [options.blockstore]
- * @param {boolean} [options.wrapWithDirectory]
- */
-const packCar = async (input, { blockstore, wrapWithDirectory } = {}) => {
-  /* c8 ignore next 1 */
-  blockstore = blockstore || new fs.FsBlockStore();
-  const { root: cid, out } = await pack.pack({ input, blockstore, wrapWithDirectory, rawLeaves: false, cidVersion: 0 });
-  const car = new bsCarReader.BlockstoreCarReader(1, [cid], blockstore);
-  return { cid, carReader: car, car: out }
-};
-
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/it-peekable/dist/src/index.js
 /**
- * Convert the passed blob to an "import candidate" - an object suitable for
- * passing to the ipfs-unixfs-importer. Note: content is an accessor so that
- * the stream is created only when needed.
+ * @packageDocumentation
  *
- * @param {string} path
- * @param {Pick|{ stream: () => AsyncIterable }} blob
- * @returns {import('ipfs-core-types/src/utils.js').ImportCandidate}
- */
-function toImportCandidate(path, blob) {
-  /** @type {AsyncIterable} */
-  let stream;
-  return {
-    path,
-    get content() {
-      stream = stream || blob.stream();
-      return stream
-    },
-  }
-}
-
-exports.Token = token;
-Object.defineProperty(exports, "FormData", ({
-  enumerable: true,
-  get: function () {
-    return formData.FormData;
-  }
-}));
-Object.defineProperty(exports, "Blob", ({
-  enumerable: true,
-  get: function () {
-    return file.Blob;
-  }
-}));
-Object.defineProperty(exports, "File", ({
-  enumerable: true,
-  get: function () {
-    return file.File;
-  }
-}));
-exports.toGatewayURL = gateway.toGatewayURL;
-exports.FilebaseClient = FilebaseClient;
-exports.toAsyncIterable = toAsyncIterable;
-//# sourceMappingURL=lib.cjs.map
-
-
-/***/ }),
-
-/***/ 65726:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-
-var pack = __nccwpck_require__(47859);
-__nccwpck_require__(24247);
-var Block = __nccwpck_require__(44748);
-var sha2 = __nccwpck_require__(80960);
-var dagCbor = __nccwpck_require__(30158);
-__nccwpck_require__(12830);
-var formData = __nccwpck_require__(53077);
-__nccwpck_require__(44883);
-var file = __nccwpck_require__(96614);
-var fs = __nccwpck_require__(75433);
-var gateway = __nccwpck_require__(36865);
-
-function _interopNamespace(e) {
-  if (e && e.__esModule) return e;
-  var n = Object.create(null);
-  if (e) {
-    Object.keys(e).forEach(function (k) {
-      if (k !== 'default') {
-        var d = Object.getOwnPropertyDescriptor(e, k);
-        Object.defineProperty(n, k, d.get ? d : {
-          enumerable: true,
-          get: function () {
-            return e[k];
-          }
-        });
-      }
-    });
-  }
-  n['default'] = e;
-  return Object.freeze(n);
-}
-
-var Block__namespace = /*#__PURE__*/_interopNamespace(Block);
-var dagCbor__namespace = /*#__PURE__*/_interopNamespace(dagCbor);
-
-/**
- * @typedef {import('./gateway.js').GatewayURLOptions} EmbedOptions
- * @typedef {import('./lib/interface.js').TokenInput} TokenInput
- * @typedef {import('ipfs-car/blockstore').Blockstore} Blockstore
- */
-
-/**
- * @template T
- * @typedef {import('./lib/interface.js').Encoded} EncodedBlobUrl
- */
-
-/**
- * @template G
- * @typedef {import('./lib/interface.js').Encoded} EncodedBlobBlob
- */
-
-/**
- * @template {import('./lib/interface.js').TokenInput} T
- * @typedef {import('./lib/interface.js').Token} TokenType
- */
-
-/**
- * @template {TokenInput} T
- * @implements {TokenType}
- */
-class Token {
-  /**
-   * @param {import('./lib/interface.js').CIDString} ipnft
-   * @param {import('./lib/interface.js').EncodedURL} url
-   * @param {import('./lib/interface.js').Encoded} data
-   */
-  constructor(ipnft, url, data) {
-    /** @readonly */
-    this.ipnft = ipnft;
-    /** @readonly */
-    this.url = url;
-    /** @readonly */
-    this.data = data;
-
-    Object.defineProperties(this, {
-      ipnft: { enumerable: true, writable: false },
-      url: { enumerable: true, writable: false },
-      data: { enumerable: false, writable: false },
-    });
-  }
-  /**
-   * @returns {import('./lib/interface.js').Encoded}
-   */
-  embed() {
-    return Token.embed(this)
-  }
-
-  /**
-   * @template {TokenInput} T
-   * @param {{data: import('./lib/interface.js').Encoded}} token
-   * @returns {import('./lib/interface.js').Encoded}
-   */
-  static embed({ data }) {
-    return embed(data, { gateway: gateway.GATEWAY })
-  }
-
-  /**
-   * Takes token input, encodes it as a DAG, wraps it in a CAR and creates a new
-   * Token instance from it. Where values are discovered `Blob` (or `File`)
-   * objects in the given input, they are replaced with IPFS URLs (an `ipfs://`
-   * prefixed CID with an optional path).
-   *
-   * @example
-   * ```js
-   * const cat = new File(['...'], 'cat.png')
-   * const kitty = new File(['...'], 'kitty.png')
-   * const { token, car } = await Token.encode({
-   *   name: 'hello'
-   *   image: cat
-   *   properties: {
-   *     extra: {
-   *       image: kitty
-   *     }
-   *   }
-   * })
-   * ```
-   *
-   * @template {TokenInput} T
-   * @param {T} input
-   * @returns {Promise<{ cid: CID, token: TokenType, car: AsyncIterable }>}
-   */
-  static async encode(input) {
-    const blockstore = new fs.FsBlockStore();
-    const [blobs, meta] = mapTokenInputBlobs(input);
-    /** @type {EncodedBlobUrl} */
-    const data = JSON.parse(JSON.stringify(meta));
-    /** @type {import('./lib/interface.js').Encoded} */
-    const dag = JSON.parse(JSON.stringify(meta));
-
-    for (const [dotPath, blob] of blobs.entries()) {
-      /** @type {string|undefined} */
-      // @ts-ignore blob may be a File!
-      const name = blob.name || 'blob';
-      /** @type {import('./platform.js').ReadableStream} */
-      const content = blob.stream();
-      const { root: cid } = await pack.pack({
-        input: [{ path: name, content }],
-        blockstore,
-        wrapWithDirectory: true,
-      });
-
-      const href = new URL(`ipfs://${cid}/${name}`);
-      const path = dotPath.split('.');
-      setIn(data, path, href);
-      setIn(dag, path, cid);
-    }
-
-    const { root: metadataJsonCid, out } = await pack.pack({
-      input: [{ path: 'metadata.json', content: JSON.stringify(data) }],
-      blockstore,
-      wrapWithDirectory: false,
-    });
-
-    const block = await Block__namespace.encode({
-      value: {
-        ...dag,
-        'metadata.json': metadataJsonCid,
-        type: 'nft',
-      },
-      codec: dagCbor__namespace,
-      hasher: sha2.sha256,
-    });
-    await blockstore.put(block.cid, block.bytes);
-
-    return {
-      cid: block.cid,
-      token: new Token(
-        block.cid.toString(),
-        `ipfs://${block.cid}/metadata.json`,
-        data
-      ),
-      car: out
-    }
-  }
-}
-
-/**
- * @template T
- * @param {EncodedBlobUrl} input
- * @param {EmbedOptions} options
- * @returns {EncodedBlobUrl}
- */
-const embed = (input, options) =>
-  mapWith(input, isURL, embedURL, options);
-
-/**
- * @template {TokenInput} T
- * @param {import('./lib/interface.js').EncodedToken} value
- * @param {Set} paths - Paths were to expect EncodedURLs
- * @returns {Token}
- */
-const decode = ({ ipnft, url, data }, paths) =>
-  new Token(ipnft, url, mapWith(data, isEncodedURL, decodeURL, paths));
-
-/**
- * @param {any} value
- * @returns {value is URL}
- */
-const isURL = (value) => value instanceof URL;
-
-/**
- * @template State
- * @param {State} state
- * @param {import('./lib/interface.js').EncodedURL} url
- * @returns {[State, URL]}
- */
-const decodeURL = (state, url) => [state, new URL(url)];
-
-/**
- * @param {EmbedOptions} context
- * @param {URL} url
- * @returns {[EmbedOptions, URL]}
- */
-const embedURL = (context, url) => [context, gateway.toGatewayURL(url, context)];
-
-/**
- * @param {any} value
- * @returns {value is object}
- */
-const isObject = (value) => typeof value === 'object' && value != null;
-
-/**
- * @param {any} value
- * @param {Set} assetPaths
- * @param {PropertyKey[]} path
- * @returns {value is import('./lib/interface.js').EncodedURL}
- */
-const isEncodedURL = (value, assetPaths, path) =>
-  typeof value === 'string' && assetPaths.has(path.join('.'));
-
-/**
- * Takes token input and encodes it into
- * [FormData](https://developer.mozilla.org/en-US/docs/Web/API/FormData)
- * object where form field values are discovered `Blob` (or `File`) objects in
- * the given token and field keys are `.` joined paths where they were discoverd
- * in the token. Additionally encoded `FormData` will also have a field
- * named `meta` containing JSON serialized token with blobs and file values
- * `null` set to null (this allows backend to injest all of the files from
- * `multipart/form-data` request and update provided "meta" data with
- * corresponding file ipfs:// URLs)
+ * Lets you look at the contents of an async iterator and decide what to do
  *
  * @example
- * ```js
- * const cat = new File([], 'cat.png')
- * const kitty = new File([], 'kitty.png')
- * const form = encode({
- *   name: 'hello'
- *   image: cat
- *   properties: {
- *     extra: {
- *       image: kitty
- *     }
- *   }
- * })
- * [...form.entries()] //>
- * // [
- * //   ['image', cat],
- * //   ['properties.extra.image', kitty],
- * //   ['meta', '{"name":"hello",image:null,"properties":{"extra":{"kitty": null}}}']
- * // ]
+ *
+ * ```javascript
+ * import peekable from 'it-peekable'
+ *
+ * // This can also be an iterator, generator, etc
+ * const values = [0, 1, 2, 3, 4]
+ *
+ * const it = peekable(value)
+ *
+ * const first = it.peek()
+ *
+ * console.info(first) // 0
+ *
+ * it.push(first)
+ *
+ * console.info([...it])
+ * // [ 0, 1, 2, 3, 4 ]
  * ```
  *
- * @template {TokenInput} T
- * @param {EncodedBlobBlob} input
- * @returns {FormData}
- */
-const encode = (input) => {
-  const [map, meta] = mapValueWith(input, isBlob, encodeBlob, new Map(), []);
-  const form = new formData.FormData();
-  for (const [k, v] of map.entries()) {
-    form.set(k, v);
-  }
-  form.set('meta', JSON.stringify(meta));
-  return form
-};
-
-/**
- * @param {Map} data
- * @param {Blob} blob
- * @param {PropertyKey[]} path
- * @returns {[Map, void]}
- */
-const encodeBlob = (data, blob, path) => {
-  data.set(path.join('.'), blob);
-  return [data, undefined]
-};
-
-/**
- * @param {any} value
- * @returns {value is Blob}
- */
-const isBlob = (value) => value instanceof file.Blob;
-
-/**
- * @template {TokenInput} T
- * @param {EncodedBlobBlob} input
- */
-const mapTokenInputBlobs = (input) => {
-  return mapValueWith(input, isBlob, encodeBlob, new Map(), [])
-};
-
-/**
- * Substitues values in the given `input` that match `p(value) == true` with
- * `f(value, context, path)` where `context` is whatever you pass (usually
- * a mutable state) and `path` is a array of keys / indexes where the value
- * was encountered.
+ * Async sources must be awaited:
  *
- * @template T, I, X, O, State
- * @param {import('./lib/interface.js').Encoded} input - Arbitrary input.
- * @param {(input:any, state:State, path:PropertyKey[]) => input is X} p - Predicate function to determine
- * which values to swap.
- * @param {(state:State, input:X, path:PropertyKey[]) => [State, O]} f - Function
- * that swaps matching values.
- * @param {State} state - Some additional context you need in the process.
- * likey you'll start with `[]`.
- * @returns {import('./lib/interface.js').Encoded}
- */
-const mapWith = (input, p, f, state) => {
-  const [, output] = mapValueWith(input, p, f, state, []);
-  return output
-};
-
-/**
- * @template T, I, X, O, State
- * @param {import('./lib/interface.js').Encoded} input - Arbitrary input.
- * @param {(input:any, state:State, path:PropertyKey[]) => input is X} p - Predicate function to determine
- * which values to swap.
- * @param {(state:State, input:X, path:PropertyKey[]) => [State, O]} f - Function
- * that swaps matching values.
- * @param {State} state - Some additional context you need in the process.
- * @param {PropertyKey[]} path - Path where the value was encountered. Most
- * likey you'll start with `[]`.
- * @returns {[State, import('./lib/interface.js').Encoded]}
- */
-const mapValueWith = (input, p, f, state, path) =>
-  p(input, state, path)
-    ? f(state, input, path)
-    : Array.isArray(input)
-    ? mapArrayWith(input, p, f, state, path)
-    : isObject(input)
-    ? mapObjectWith(input, p, f, state, path)
-    : [state, /** @type {any} */ (input)];
-
-/**
- * Just like `mapWith` except
- *
- * @template State, T, I, X, O
- * @param {import('./lib/interface.js').Encoded} input
- * @param {(input:any, state:State, path:PropertyKey[]) => input is X} p
- * @param {(state: State, input:X, path:PropertyKey[]) => [State, O]} f
- * @param {State} init
- * @param {PropertyKey[]} path
- * @returns {[State, import('./lib/interface.js').Encoded]}
- */
-const mapObjectWith = (input, p, f, init, path) => {
-  let state = init;
-  const output =
-    /** @type {import('./lib/interface.js').Encoded} */ ({});
-  for (const [key, value] of Object.entries(input)) {
-    const [next, out] = mapValueWith(value, p, f, state, [...path, key]);
-    // @ts-ignore
-    output[key] = out;
-    state = next;
-  }
-  return [state, output]
-};
-
-/**
- * Just like `mapWith` except for Arrays.
+ * ```javascript
+ * import peekable from 'it-peekable'
+ *
+ * const values = async function * () {
+ *   yield * [0, 1, 2, 3, 4]
+ * }
+ *
+ * const it = peekable(values())
+ *
+ * const first = await it.peek()
  *
- * @template I, X, O, State
- * @template {any[]} T
- * @param {T} input
- * @param {(input:any, state:State, path:PropertyKey[]) => input is X} p
- * @param {(state: State, input:X, path:PropertyKey[]) => [State, O]} f
- * @param {State} init
- * @param {PropertyKey[]} path
- * @returns {[State, import('./lib/interface.js').Encoded]}
+ * console.info(first) // 0
+ *
+ * it.push(first)
+ *
+ * console.info(await all(it))
+ * // [ 0, 1, 2, 3, 4 ]
+ * ```
  */
-const mapArrayWith = (input, p, f, init, path) => {
-  const output = /** @type {unknown[]} */ ([]);
-
-  let state = init;
-  for (const [index, element] of input.entries()) {
-    const [next, out] = mapValueWith(element, p, f, state, [...path, index]);
-    output[index] = out;
-    state = next;
-  }
-
-  return [
-    state,
-    /** @type {import('./lib/interface.js').Encoded} */ (output),
-  ]
-};
-
+function dist_src_peekable(iterable) {
+    // @ts-expect-error can't use Symbol.asyncIterator to index iterable since it might be Iterable
+    const [iterator, symbol] = iterable[Symbol.asyncIterator] != null
+        // @ts-expect-error can't use Symbol.asyncIterator to index iterable since it might be Iterable
+        ? [iterable[Symbol.asyncIterator](), Symbol.asyncIterator]
+        // @ts-expect-error can't use Symbol.iterator to index iterable since it might be AsyncIterable
+        : [iterable[Symbol.iterator](), Symbol.iterator];
+    const queue = [];
+    // @ts-expect-error can't use symbol to index peekable
+    return {
+        peek: () => {
+            return iterator.next();
+        },
+        push: (value) => {
+            queue.push(value);
+        },
+        next: () => {
+            if (queue.length > 0) {
+                return {
+                    done: false,
+                    value: queue.shift()
+                };
+            }
+            return iterator.next();
+        },
+        [symbol]() {
+            return this;
+        }
+    };
+}
+/* harmony default export */ const blockstore_fs_node_modules_it_peekable_dist_src = (dist_src_peekable);
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/it-map/dist/src/index.js
 /**
- * Sets a given `value` at the given `path` on a passed `object`.
+ * @packageDocumentation
+ *
+ * Convert one value from an (async)iterator into another.
  *
  * @example
- * ```js
- * const obj = { a: { b: { c: 1 }}}
- * setIn(obj, ['a', 'b', 'c'], 5)
- * obj.a.b.c //> 5
+ *
+ * ```javascript
+ * import map from 'it-map'
+ *
+ * // This can also be an iterator, generator, etc
+ * const values = [0, 1, 2, 3, 4]
+ *
+ * const result = map(values, (val) => val++)
+ *
+ * console.info(result) // [1, 2, 3, 4, 5]
  * ```
  *
- * @template V
- * @param {any} object
- * @param {string[]} path
- * @param {V} value
- */
-const setIn = (object, path, value) => {
-  const n = path.length - 1;
-  let target = object;
-  for (let [index, key] of path.entries()) {
-    if (index === n) {
-      target[key] = value;
-    } else {
-      target = target[key];
-    }
-  }
-};
-
-exports.Token = Token;
-exports.decode = decode;
-exports.embed = embed;
-exports.encode = encode;
-exports.mapWith = mapWith;
-//# sourceMappingURL=token.cjs.map
-
-
-/***/ }),
-
-/***/ 53208:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-
-var webEncoding = __nccwpck_require__(21628);
-var stream = __nccwpck_require__(75224);
-
-/**
- * @implements {globalThis.Blob}
+ * Async sources and transforms must be awaited:
+ *
+ * ```javascript
+ * import map from 'it-map'
+ *
+ * const values = async function * () {
+ *   yield * [0, 1, 2, 3, 4]
+ * }
+ *
+ * const result = await map(values(), async (val) => val++)
+ *
+ * console.info(result) // [1, 2, 3, 4, 5]
+ * ```
  */
-const WebBlob = class Blob {
-  /**
-   * @param {BlobPart[]} [init]
-   * @param {BlobPropertyBag} [options]
-   */
-  constructor(init = [], options = {}) {
-    /** @type {Uint8Array[]} */
-    const parts = [];
-
-    let size = 0;
-    for (const part of init) {
-      if (typeof part === "string") {
-        const bytes = new webEncoding.TextEncoder().encode(part);
-        parts.push(bytes);
-        size += bytes.byteLength;
-      } else if (part instanceof WebBlob) {
-        size += part.size;
-        // @ts-ignore - `_parts` is marked private so TS will complain about
-        // accessing it.
-        parts.push(...part._parts);
-      } else if (part instanceof ArrayBuffer) {
-        parts.push(new Uint8Array(part));
-        size += part.byteLength;
-      } else if (part instanceof Uint8Array) {
-        parts.push(part);
-        size += part.byteLength;
-      } else if (ArrayBuffer.isView(part)) {
-        const { buffer, byteOffset, byteLength } = part;
-        parts.push(new Uint8Array(buffer, byteOffset, byteLength));
-        size += byteLength;
-      } else {
-        const bytes = new webEncoding.TextEncoder().encode(String(part));
-        parts.push(bytes);
-        size += bytes.byteLength;
-      }
-    }
-
-    /** @private */
-    this._size = size;
-    /** @private */
-    this._type = readType(options.type);
-    /** @private */
-    this._parts = parts;
-
-    Object.defineProperties(this, {
-      _size: { enumerable: false },
-      _type: { enumerable: false },
-      _parts: { enumerable: false },
-    });
-  }
-
-  /**
-   * A string indicating the MIME type of the data contained in the Blob.
-   * If the type is unknown, this string is empty.
-   * @type {string}
-   */
-  get type() {
-    return this._type
-  }
-  /**
-   * The size, in bytes, of the data contained in the Blob object.
-   * @type {number}
-   */
-  get size() {
-    return this._size
-  }
-
-  /**
-   * Returns a new Blob object containing the data in the specified range of
-   * bytes of the blob on which it's called.
-   * @param {number} [start=0] - An index into the Blob indicating the first
-   * byte to include in the new Blob. If you specify a negative value, it's
-   * treated as an offset from the end of the Blob toward the beginning. For
-   * example, `-10` would be the 10th from last byte in the Blob. The default
-   * value is `0`. If you specify a value for start that is larger than the
-   * size of the source Blob, the returned Blob has size 0 and contains no
-   * data.
-   * @param {number} [end] - An index into the `Blob` indicating the first byte
-   *  that will *not* be included in the new `Blob` (i.e. the byte exactly at
-   * this index is not included). If you specify a negative value, it's treated
-   * as an offset from the end of the Blob toward the beginning. For example,
-   * `-10` would be the 10th from last byte in the `Blob`. The default value is
-   * size.
-   * @param {string} [type] - The content type to assign to the new Blob;
-   * this will be the value of its type property. The default value is an empty
-   * string.
-   * @returns {Blob}
-   */
-  slice(start = 0, end = this.size, type = "") {
-    const { size, _parts } = this;
-    let offset = start < 0 ? Math.max(size + start, 0) : Math.min(start, size);
-
-    let limit = end < 0 ? Math.max(size + end, 0) : Math.min(end, size);
-    const span = Math.max(limit - offset, 0);
-    const blob = new Blob([], { type });
-
-    if (span === 0) {
-      return blob
-    }
 
-    let blobSize = 0;
-    const blobParts = [];
-    for (const part of _parts) {
-      const { byteLength } = part;
-      if (offset > 0 && byteLength <= offset) {
-        offset -= byteLength;
-        limit -= byteLength;
-      } else {
-        const chunk = part.subarray(offset, Math.min(byteLength, limit));
-        blobParts.push(chunk);
-        blobSize += chunk.byteLength;
-        // no longer need to take that into account
-        offset = 0;
-
-        // don't add the overflow to new blobParts
-        if (blobSize >= span) {
-          break
-        }
-      }
+function blockstore_fs_node_modules_it_map_dist_src_isAsyncIterable(thing) {
+    return thing[Symbol.asyncIterator] != null;
+}
+function it_map_dist_src_map(source, func) {
+    if (blockstore_fs_node_modules_it_map_dist_src_isAsyncIterable(source)) {
+        return (async function* () {
+            for await (const val of source) {
+                yield func(val);
+            }
+        })();
     }
-
-    blob._parts = blobParts;
-    blob._size = blobSize;
-
-    return blob
-  }
-
-  /**
-   * Returns a promise that resolves with an ArrayBuffer containing the entire
-   * contents of the Blob as binary data.
-   * @returns {Promise}
-   */
-  // eslint-disable-next-line require-await
-  async arrayBuffer() {
-    const buffer = new ArrayBuffer(this.size);
-    const bytes = new Uint8Array(buffer);
-    let offset = 0;
-    for (const part of this._parts) {
-      bytes.set(part, offset);
-      offset += part.byteLength;
+    // if mapping function returns a promise we have to return an async generator
+    const peekable = blockstore_fs_node_modules_it_peekable_dist_src(source);
+    const { value, done } = peekable.next();
+    if (done === true) {
+        return (function* () { }());
     }
-    return buffer
-  }
-
-  /**
-   * Returns a promise that resolves with a USVString containing the entire
-   * contents of the Blob interpreted as UTF-8 text.
-   * @returns {Promise}
-   */
-  // eslint-disable-next-line require-await
-  async text() {
-    const decoder = new webEncoding.TextDecoder();
-    let text = "";
-    for (const part of this._parts) {
-      text += decoder.decode(part);
+    const res = func(value);
+    // @ts-expect-error .then is not present on O
+    if (typeof res.then === 'function') {
+        return (async function* () {
+            yield await res;
+            for await (const val of peekable) {
+                yield func(val);
+            }
+        })();
     }
-    return text
-  }
-
-  /**
-   * @returns {BlobStream}
-   */
-  stream() {
-    return new BlobStream(this._parts)
-  }
-
-  /**
-   * @returns {string}
-   */
-  toString() {
-    return "[object Blob]"
-  }
-
-  get [Symbol.toStringTag]() {
-    return "Blob"
-  }
-};
-
-// Marking export as a DOM File object instead of custom class.
-/** @type {typeof globalThis.Blob} */
-const Blob = WebBlob;
-
-/**
- * Blob stream is a `ReadableStream` extension optimized to have minimal
- * overhead when consumed as `AsyncIterable`.
- * @extends {ReadableStream}
- * @implements {AsyncIterable}
- */
-class BlobStream extends stream.ReadableStream {
-  /**
-   * @param {Uint8Array[]} chunks
-   */
-  constructor(chunks) {
-    // @ts-ignore
-    super(new BlobStreamController(chunks.values()), { type: "bytes" });
-    /** @private */
-    this._chunks = chunks;
-  }
-
-  /**
-   * @param {Object} [_options]
-   * @property {boolean} [_options.preventCancel]
-   * @returns {AsyncIterator}
-   */
-  async *[Symbol.asyncIterator](_options) {
-    const reader = this.getReader();
-    yield* this._chunks;
-    reader.releaseLock();
-  }
-}
-
-class BlobStreamController {
-  /**
-   * @param {Iterator} chunks
-   */
-  constructor(chunks) {
-    this.chunks = chunks;
-  }
-
-  /**
-   * @param {ReadableStreamDefaultController} controller
-   */
-  start(controller) {
-    this.work(controller);
-    this.isWorking = false;
-    this.isCancelled = false;
-  }
-  /**
-   *
-   * @param {ReadableStreamDefaultController} controller
-   */
-  async work(controller) {
-    const { chunks } = this;
-
-    this.isWorking = true;
-    while (!this.isCancelled && (controller.desiredSize || 0) > 0) {
-      let next = null;
-      try {
-        next = chunks.next();
-      } catch (error) {
-        controller.error(error);
-        break
-      }
-
-      if (next) {
-        if (!next.done && !this.isCancelled) {
-          controller.enqueue(next.value);
-        } else {
-          controller.close();
+    const fn = func;
+    return (function* () {
+        yield res;
+        for (const val of peekable) {
+            yield fn(val);
         }
-      }
-    }
-
-    this.isWorking = false;
-  }
-
-  /**
-   * @param {ReadableStreamDefaultController} controller
-   */
-  pull(controller) {
-    if (!this.isWorking) {
-      this.work(controller);
-    }
-  }
-  cancel() {
-    this.isCancelled = true;
-  }
+    })();
 }
-
+/* harmony default export */ const blockstore_fs_node_modules_it_map_dist_src = (it_map_dist_src_map);
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/it-batch/dist/src/index.js
 /**
- * @param {string} [input]
- * @returns {string}
+ * @packageDocumentation
+ *
+ * The final batch may be smaller than the max.
+ *
+ * @example
+ *
+ * ```javascript
+ * import batch from 'it-batch'
+ * import all from 'it-all'
+ *
+ * // This can also be an iterator, generator, etc
+ * const values = [0, 1, 2, 3, 4]
+ * const batchSize = 2
+ *
+ * const result = all(batch(values, batchSize))
+ *
+ * console.info(result) // [0, 1], [2, 3], [4]
+ * ```
+ *
+ * Async sources must be awaited:
+ *
+ * ```javascript
+ * import batch from 'it-batch'
+ * import all from 'it-all'
+ *
+ * const values = async function * () {
+ *   yield * [0, 1, 2, 3, 4]
+ * }
+ *
+ * const batchSize = 2
+ * const result = await all(batch(values(), batchSize))
+ *
+ * console.info(result) // [0, 1], [2, 3], [4]
+ * ```
  */
-const readType = (input = "") => {
-  const type = String(input).toLowerCase();
-  return /[^\u0020-\u007E]/.test(type) ? "" : type
-};
-
-Object.defineProperty(exports, "TextDecoder", ({
-  enumerable: true,
-  get: function () {
-    return webEncoding.TextDecoder;
-  }
-}));
-Object.defineProperty(exports, "TextEncoder", ({
-  enumerable: true,
-  get: function () {
-    return webEncoding.TextEncoder;
-  }
-}));
-Object.defineProperty(exports, "ReadableStream", ({
-  enumerable: true,
-  get: function () {
-    return stream.ReadableStream;
-  }
-}));
-exports.Blob = Blob;
-//# sourceMappingURL=blob.cjs.map
-
-
-/***/ }),
-
-/***/ 44883:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-
-var webEncoding = __nccwpck_require__(21628);
-var stream = __nccwpck_require__(75224);
-var blob = __nccwpck_require__(53208);
-
-/** @type {typeof globalThis.Blob} */
-// Our first choise is to use global `Blob` because it may be available e.g. in
-// electron renderrer process. If not available fall back to node native
-// implementation, if also not available use our implementation.
-const Blob =
-  globalThis.Blob || 
-  // Disable node native blob until impractical perf issue is fixed
-  // @see https://github.com/nodejs/node/issues/42108
-  // NodeBlob ||
-  blob.Blob;
-
-Object.defineProperty(exports, "TextDecoder", ({
-  enumerable: true,
-  get: function () {
-    return webEncoding.TextDecoder;
-  }
-}));
-Object.defineProperty(exports, "TextEncoder", ({
-  enumerable: true,
-  get: function () {
-    return webEncoding.TextEncoder;
-  }
-}));
-Object.defineProperty(exports, "ReadableStream", ({
-  enumerable: true,
-  get: function () {
-    return stream.ReadableStream;
-  }
-}));
-exports.Blob = Blob;
-//# sourceMappingURL=lib.node.cjs.map
-
-
-/***/ }),
-
-/***/ 12830:
-/***/ ((module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-exports = module.exports = fetch;
-
-const http = __nccwpck_require__(13685);
-const https = __nccwpck_require__(95687);
-const zlib = __nccwpck_require__(59796);
-const dataUriToBuffer = __nccwpck_require__(43102);
-const Stream = __nccwpck_require__(12781);
-const util = __nccwpck_require__(73837);
-const blob = __nccwpck_require__(44883);
-const formData = __nccwpck_require__(53077);
-const crypto = __nccwpck_require__(6113);
-const multipartParser = __nccwpck_require__(21280);
-const url = __nccwpck_require__(57310);
-
-class FetchBaseError extends Error {
-	/**
-	 * @param {string} message 
-	 * @param {string} type 
-	 */
-	constructor(message, type) {
-		super(message);
-		// Hide custom error implementation details from end-users
-		Error.captureStackTrace(this, this.constructor);
-
-		this.type = type;
-	}
-
-	get name() {
-		return this.constructor.name;
-	}
-
-	get [Symbol.toStringTag]() {
-		return this.constructor.name;
-	}
+function node_modules_it_batch_dist_src_isAsyncIterable(thing) {
+    return thing[Symbol.asyncIterator] != null;
 }
-
-/**
- * @typedef {{
- * address?: string
- * code: string
- * dest?: string
- * errno: number
- * info?: object
- * message: string
- * path?: string
- * port?: number
- * syscall: string
- * }} SystemError
-*/
-
-/**
- * FetchError interface for operational errors
- */
-class FetchError extends FetchBaseError {
-	/**
-	 * @param  {string} message -      Error message for human
-	 * @param  {string} type -        Error type for machine
-	 * @param  {SystemError} [systemError] - For Node.js system error
-	 */
-	constructor(message, type, systemError) {
-		super(message, type);
-		// When err.type is `system`, err.erroredSysCall contains system error and err.code contains system error code
-		if (systemError) {
-			// eslint-disable-next-line no-multi-assign
-			this.code = this.errno = systemError.code;
-			this.erroredSysCall = systemError.syscall;
-		}
-	}
+function src_batch(source, size = 1) {
+    size = Number(size);
+    if (node_modules_it_batch_dist_src_isAsyncIterable(source)) {
+        return (async function* () {
+            let things = [];
+            if (size < 1) {
+                size = 1;
+            }
+            if (size !== Math.round(size)) {
+                throw new Error('Batch size must be an integer');
+            }
+            for await (const thing of source) {
+                things.push(thing);
+                while (things.length >= size) {
+                    yield things.slice(0, size);
+                    things = things.slice(size);
+                }
+            }
+            while (things.length > 0) {
+                yield things.slice(0, size);
+                things = things.slice(size);
+            }
+        }());
+    }
+    return (function* () {
+        let things = [];
+        if (size < 1) {
+            size = 1;
+        }
+        if (size !== Math.round(size)) {
+            throw new Error('Batch size must be an integer');
+        }
+        for (const thing of source) {
+            things.push(thing);
+            while (things.length >= size) {
+                yield things.slice(0, size);
+                things = things.slice(size);
+            }
+        }
+        while (things.length > 0) {
+            yield things.slice(0, size);
+            things = things.slice(size);
+        }
+    }());
 }
-
+/* harmony default export */ const node_modules_it_batch_dist_src = (src_batch);
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/it-parallel-batch/dist/src/index.js
 /**
- * Is.js
+ * @packageDocumentation
  *
- * Object type checks.
- */
-
-const NAME = Symbol.toStringTag;
-
-/**
- * Check if `obj` is a URLSearchParams object
- * ref: https://github.com/node-fetch/node-fetch/issues/296#issuecomment-307598143
+ * Takes an async iterator that emits promise-returning functions, invokes them in parallel and emits the results in the same order as the input.
  *
- * @param  {any} object
- * @return {obj is URLSearchParams}
- */
-const isURLSearchParameters = (object) => {
-	return (
-		typeof object === "object" &&
-		typeof object.append === "function" &&
-		typeof object.delete === "function" &&
-		typeof object.get === "function" &&
-		typeof object.getAll === "function" &&
-		typeof object.has === "function" &&
-		typeof object.set === "function" &&
-		typeof object.sort === "function" &&
-		object[NAME] === "URLSearchParams"
-	);
-};
-
-/**
- * Check if `object` is a W3C `Blob` object (which `File` inherits from)
+ * The final batch may be smaller than the batch size.
  *
- * @param  {*} object
- * @return {object is Blob}
- */
-const isBlob = (object) => {
-	return (
-		typeof object === "object" &&
-		typeof object.arrayBuffer === "function" &&
-		typeof object.type === "string" &&
-		typeof object.stream === "function" &&
-		typeof object.constructor === "function" &&
-		/^(Blob|File)$/.test(object[NAME])
-	);
-};
-
-/**
- * Check if `obj` is a spec-compliant `FormData` object
+ * @example
  *
- * @param {*} object
- * @return {object is FormData}
- */
-function isFormData(object) {
-	return (
-		typeof object === "object" &&
-		typeof object.append === "function" &&
-		typeof object.set === "function" &&
-		typeof object.get === "function" &&
-		typeof object.getAll === "function" &&
-		typeof object.delete === "function" &&
-		typeof object.keys === "function" &&
-		typeof object.values === "function" &&
-		typeof object.entries === "function" &&
-		typeof object.constructor === "function" &&
-		object[NAME] === "FormData"
-	);
-}
-
-/**
- * Detect form data input from form-data module
+ * ```javascript
+ * import parallelBatch from 'it-parallel-batch'
+ * import all from 'it-all'
+ * import delay from 'delay'
  *
- * @param {any} value
- * @returns {value is Stream & {getBoundary():string, hasKnownLength():boolean, getLengthSync():number|null}}
- */
-const isMultipartFormDataStream = (value) => {
-	return (
-		value instanceof Stream === true &&
-		typeof value.getBoundary === "function" &&
-		typeof value.hasKnownLength === "function" &&
-		typeof value.getLengthSync === "function"
-	);
-};
-
-/**
- * Check if `obj` is an instance of AbortSignal.
+ * // This can also be an iterator, async iterator, generator, etc
+ * const input = [
+ *   async () => {
+ *     await delay(500)
  *
- * @param  {any} object
- * @return {obj is AbortSignal}
- */
-const isAbortSignal = (object) => {
-	return (
-		typeof object === "object" &&
-		(object[NAME] === "AbortSignal" || object[NAME] === "EventTarget")
-	);
-};
-
-/**
- * Check if `value` is a ReadableStream.
+ *     return 1
+ *   },
+ *   async () => {
+ *     await delay(200)
  *
- * @param {*} value
- * @returns {value is ReadableStream}
- */
-const isReadableStream = (value) => {
-	return (
-		typeof value === "object" &&
-		typeof value.getReader === "function" &&
-		typeof value.cancel === "function" &&
-		typeof value.tee === "function"
-	);
-};
-
-/**
+ *     return 2
+ *   },
+ *   async () => {
+ *     await delay(100)
  *
- * @param {any} value
- * @returns {value is Iterable}
- */
-const isIterable = (value) => value && Symbol.iterator in value;
-
-const carriage = '\r\n';
-const dashes = '-'.repeat(2);
-const carriageLength = Buffer.byteLength(carriage);
-
-/**
- * @param {string} boundary
+ *     return 3
+ *   }
+ * ]
+ *
+ * const batchSize = 2
+ *
+ * const result = await all(parallelBatch(input, batchSize))
+ *
+ * console.info(result) // [1, 2, 3]
+ * ```
  */
-const getFooter = boundary => `${dashes}${boundary}${dashes}${carriage.repeat(2)}`;
 
 /**
- * @param {string} boundary
- * @param {string} name
- * @param {*} field
- *
- * @return {string}
+ * Takes an (async) iterator that emits promise-returning functions,
+ * invokes them in parallel and emits the results as they become available but
+ * in the same order as the input
  */
-function getHeader(boundary, name, field) {
-	let header = '';
+async function* src_parallelBatch(source, size = 1) {
+    for await (const tasks of node_modules_it_batch_dist_src(source, size)) {
+        const things = tasks.map(async (p) => {
+            return p().then(value => ({ ok: true, value }), err => ({ ok: false, err }));
+        });
+        for (let i = 0; i < things.length; i++) {
+            const result = await things[i];
+            if (result.ok) {
+                yield result.value;
+            }
+            else {
+                throw result.err;
+            }
+        }
+    }
+}
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/vendor/varint.js
+var blockstore_fs_node_modules_multiformats_vendor_varint_encode_1 = blockstore_fs_node_modules_multiformats_vendor_varint_encode;
 
-	header += `${dashes}${boundary}${carriage}`;
-	header += `Content-Disposition: form-data; name="${name}"`;
+var blockstore_fs_node_modules_multiformats_vendor_varint_MSB = 0x80
+  , blockstore_fs_node_modules_multiformats_vendor_varint_REST = 0x7F
+  , blockstore_fs_node_modules_multiformats_vendor_varint_MSBALL = ~blockstore_fs_node_modules_multiformats_vendor_varint_REST
+  , blockstore_fs_node_modules_multiformats_vendor_varint_INT = Math.pow(2, 31);
 
-	if (isBlob(field)) {
-		const { name = 'blob', type } = /** @type {Blob & {name?:string}} */ (field);
-		header += `; filename="${name}"${carriage}`;
-		header += `Content-Type: ${type || 'application/octet-stream'}`;
-	}
+function blockstore_fs_node_modules_multiformats_vendor_varint_encode(num, out, offset) {
+  out = out || [];
+  offset = offset || 0;
+  var oldOffset = offset;
 
-	return `${header}${carriage.repeat(2)}`;
+  while(num >= blockstore_fs_node_modules_multiformats_vendor_varint_INT) {
+    out[offset++] = (num & 0xFF) | blockstore_fs_node_modules_multiformats_vendor_varint_MSB;
+    num /= 128;
+  }
+  while(num & blockstore_fs_node_modules_multiformats_vendor_varint_MSBALL) {
+    out[offset++] = (num & 0xFF) | blockstore_fs_node_modules_multiformats_vendor_varint_MSB;
+    num >>>= 7;
+  }
+  out[offset] = num | 0;
+  
+  blockstore_fs_node_modules_multiformats_vendor_varint_encode.bytes = offset - oldOffset + 1;
+  
+  return out
 }
 
-/**
- * @return {string}
- */
-const getBoundary = () => crypto.randomBytes(8).toString('hex');
+var blockstore_fs_node_modules_multiformats_vendor_varint_decode = blockstore_fs_node_modules_multiformats_vendor_varint_read;
 
-/**
- * @param {FormData} form
- * @param {string} boundary
- */
-async function * formDataIterator(form, boundary) {
-	for (const [name, value] of form) {
-		yield getHeader(boundary, name, value);
+var blockstore_fs_node_modules_multiformats_vendor_varint_MSB$1 = 0x80
+  , blockstore_fs_node_modules_multiformats_vendor_varint_REST$1 = 0x7F;
 
-		if (isBlob(value)) {
-			// @ts-ignore - we know our streams implement aysnc iteration
-			yield * value.stream();
-		} else {
-			yield value;
-		}
+function blockstore_fs_node_modules_multiformats_vendor_varint_read(buf, offset) {
+  var res    = 0
+    , offset = offset || 0
+    , shift  = 0
+    , counter = offset
+    , b
+    , l = buf.length;
 
-		yield carriage;
-	}
+  do {
+    if (counter >= l) {
+      blockstore_fs_node_modules_multiformats_vendor_varint_read.bytes = 0;
+      throw new RangeError('Could not decode varint')
+    }
+    b = buf[counter++];
+    res += shift < 28
+      ? (b & blockstore_fs_node_modules_multiformats_vendor_varint_REST$1) << shift
+      : (b & blockstore_fs_node_modules_multiformats_vendor_varint_REST$1) * Math.pow(2, shift);
+    shift += 7;
+  } while (b >= blockstore_fs_node_modules_multiformats_vendor_varint_MSB$1)
 
-	yield getFooter(boundary);
-}
+  blockstore_fs_node_modules_multiformats_vendor_varint_read.bytes = counter - offset;
 
-/**
- * @param {FormData} form
- * @param {string} boundary
- */
-function getFormDataLength(form, boundary) {
-	let length = 0;
+  return res
+}
 
-	for (const [name, value] of form) {
-		length += Buffer.byteLength(getHeader(boundary, name, value));
+var blockstore_fs_node_modules_multiformats_vendor_varint_N1 = Math.pow(2,  7);
+var blockstore_fs_node_modules_multiformats_vendor_varint_N2 = Math.pow(2, 14);
+var blockstore_fs_node_modules_multiformats_vendor_varint_N3 = Math.pow(2, 21);
+var blockstore_fs_node_modules_multiformats_vendor_varint_N4 = Math.pow(2, 28);
+var blockstore_fs_node_modules_multiformats_vendor_varint_N5 = Math.pow(2, 35);
+var blockstore_fs_node_modules_multiformats_vendor_varint_N6 = Math.pow(2, 42);
+var blockstore_fs_node_modules_multiformats_vendor_varint_N7 = Math.pow(2, 49);
+var blockstore_fs_node_modules_multiformats_vendor_varint_N8 = Math.pow(2, 56);
+var blockstore_fs_node_modules_multiformats_vendor_varint_N9 = Math.pow(2, 63);
 
-		if (isBlob(value)) {
-			length += value.size;
-		} else {
-			length += Buffer.byteLength(String(value));
-		}
+var blockstore_fs_node_modules_multiformats_vendor_varint_length = function (value) {
+  return (
+    value < blockstore_fs_node_modules_multiformats_vendor_varint_N1 ? 1
+  : value < blockstore_fs_node_modules_multiformats_vendor_varint_N2 ? 2
+  : value < blockstore_fs_node_modules_multiformats_vendor_varint_N3 ? 3
+  : value < blockstore_fs_node_modules_multiformats_vendor_varint_N4 ? 4
+  : value < blockstore_fs_node_modules_multiformats_vendor_varint_N5 ? 5
+  : value < blockstore_fs_node_modules_multiformats_vendor_varint_N6 ? 6
+  : value < blockstore_fs_node_modules_multiformats_vendor_varint_N7 ? 7
+  : value < blockstore_fs_node_modules_multiformats_vendor_varint_N8 ? 8
+  : value < blockstore_fs_node_modules_multiformats_vendor_varint_N9 ? 9
+  :              10
+  )
+};
 
-		length += carriageLength;
-	}
+var blockstore_fs_node_modules_multiformats_vendor_varint_varint = {
+    encode: blockstore_fs_node_modules_multiformats_vendor_varint_encode_1
+  , decode: blockstore_fs_node_modules_multiformats_vendor_varint_decode
+  , encodingLength: blockstore_fs_node_modules_multiformats_vendor_varint_length
+};
 
-	length += Buffer.byteLength(getFooter(boundary));
+var blockstore_fs_node_modules_multiformats_vendor_varint_brrp_varint = blockstore_fs_node_modules_multiformats_vendor_varint_varint;
 
-	return length;
-}
+/* harmony default export */ const blockstore_fs_node_modules_multiformats_vendor_varint = (blockstore_fs_node_modules_multiformats_vendor_varint_brrp_varint);
 
-/**
- * @param {Body & {headers?:Headers}} source
- */
-const toFormData = async ({ body, headers }) => {
-  const contentType = headers?.get('Content-Type') || '';
-  const [type, boundary] = contentType.split(/\s*;\s*boundary=/);
-  if (type === 'multipart/form-data' && boundary != null && body != null) {
-    const form = new FormData();
-    const parts = multipartParser.iterateMultipart(body, boundary);
-    for await (const { name, data, filename, contentType } of parts) {
-      if (filename) {
-        form.append(name, new File([data], filename, { type: contentType }));
-      } else {
-        form.append(name, new TextDecoder().decode(data), filename);
-      }
-    }
-    return form
-  } else {
-    throw new TypeError('Could not parse content as FormData.')
-  }
-};
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/src/varint.js
 
-const encoder = new util.TextEncoder();
-const decoder = new util.TextDecoder();
 
 /**
- * @param {string} text
+ * @param {Uint8Array} data
+ * @param {number} [offset=0]
+ * @returns {[number, number]}
  */
-const encode = text => encoder.encode(text);
+const blockstore_fs_node_modules_multiformats_src_varint_decode = (data, offset = 0) => {
+  const code = blockstore_fs_node_modules_multiformats_vendor_varint.decode(data, offset)
+  return [code, blockstore_fs_node_modules_multiformats_vendor_varint.decode.bytes]
+}
 
 /**
- * @param {Uint8Array} bytes
+ * @param {number} int
+ * @param {Uint8Array} target
+ * @param {number} [offset=0]
  */
-const decode = bytes => decoder.decode(bytes);
-
-// @ts-check
-const {readableHighWaterMark} = new Stream.Readable();
-
-const INTERNALS$2 = Symbol('Body internals');
+const blockstore_fs_node_modules_multiformats_src_varint_encodeTo = (int, target, offset = 0) => {
+  blockstore_fs_node_modules_multiformats_vendor_varint.encode(int, target, offset)
+  return target
+}
 
 /**
- * Body mixin
- *
- * Ref: https://fetch.spec.whatwg.org/#body
- * @implements {globalThis.Body}
+ * @param {number} int
+ * @returns {number}
  */
+const blockstore_fs_node_modules_multiformats_src_varint_encodingLength = (int) => {
+  return blockstore_fs_node_modules_multiformats_vendor_varint.encodingLength(int)
+}
 
-class Body {
-	/**
-	 * @param {BodyInit|Stream|null} body
-	 * @param {{size?:number}} options
-	 */
-	constructor(body, {
-		size = 0
-	} = {}) {
-		const state = {
-			/** @type {null|ReadableStream} */
-			body: null,
-			/** @type {string|null} */
-			type: null,
-			/** @type {number|null} */
-			size: null,
-			/** @type {null|string} */
-			boundary: null,
-			disturbed: false,
-			/** @type {null|Error} */
-			error: null
-		};
-		/** @private */
-		this[INTERNALS$2] = state;
-
-		if (body === null) {
-			// Body is undefined or null
-			state.body = null;
-			state.size = 0;
-		} else if (isURLSearchParameters(body)) {
-		// Body is a URLSearchParams
-			const bytes = encode(body.toString());
-			state.body = fromBytes(bytes);
-			state.size = bytes.byteLength;
-			state.type = 'application/x-www-form-urlencoded;charset=UTF-8';
-		} else if (isBlob(body)) {
-			// Body is blob
-			state.size = body.size;
-			state.type = body.type || null;
-			state.body = body.stream();
-		} else if (body instanceof Uint8Array) {
-			// Body is Buffer
-			state.body = fromBytes(body);
-			state.size = body.byteLength;
-		} else if (util.types.isAnyArrayBuffer(body)) {
-			// Body is ArrayBuffer
-			const bytes = new Uint8Array(body);
-			state.body = fromBytes(bytes);
-			state.size = bytes.byteLength;
-		} else if (ArrayBuffer.isView(body)) {
-			// Body is ArrayBufferView
-			const bytes = new Uint8Array(body.buffer, body.byteOffset, body.byteLength);
-			state.body = fromBytes(bytes);
-			state.size = bytes.byteLength;
-		} else if (isReadableStream(body)) {
-			// Body is stream
-			state.body = body;
-		} else if (isFormData(body)) {
-			// Body is an instance of formdata-node
-			const boundary = `NodeFetchFormDataBoundary${getBoundary()}`;
-			state.type = `multipart/form-data; boundary=${boundary}`;
-			state.size = getFormDataLength(body, boundary);
-			state.body = fromAsyncIterable(formDataIterator(body, boundary));
-		} else if (isMultipartFormDataStream(body)) {
-			state.type = `multipart/form-data; boundary=${body.getBoundary()}`;
-			state.size = body.hasKnownLength() ? body.getLengthSync() : null;
-			state.body = fromStream(body);
-		} else if (body instanceof Stream) {
-			state.body = fromStream(body);
-		} else {
-			// None of the above
-			// coerce to string then buffer
-			const bytes = encode(String(body));
-			state.type = 'text/plain;charset=UTF-8';
-			state.size = bytes.byteLength;
-			state.body = fromBytes(bytes);
-		}
-
-		this.size = size;
-
-		// if (body instanceof Stream) {
-		// 	body.on('error', err => {
-		// 		const error = err instanceof FetchBaseError ?
-		// 			err :
-		// 			new FetchError(`Invalid response body while trying to fetch ${this.url}: ${err.message}`, 'system', err);
-		// 		this[INTERNALS].error = error;
-		// 	});
-		// }
-	}
-
-	/** @type {Headers} */
-	/* c8 ignore next 3 */
-	get headers() {
-		throw new TypeError(`'get headers' called on an object that does not implements interface.`)
-	}
-
-	get body() {
-		return this[INTERNALS$2].body;
-	}
-
-	get bodyUsed() {
-		return this[INTERNALS$2].disturbed;
-	}
-
-	/**
-	 * Decode response as ArrayBuffer
-	 *
-	 * @return {Promise}
-	 */
-	async arrayBuffer() {
-		const {buffer, byteOffset, byteLength} = await consumeBody(this);
-		return buffer.slice(byteOffset, byteOffset + byteLength);
-	}
-
-	/**
-	 * Return raw response as Blob
-	 *
-	 * @return Promise
-	 */
-	async blob() {
-		const ct = (this.headers && this.headers.get('content-type')) || (this[INTERNALS$2].body && this[INTERNALS$2].type) || '';
-		const buf = await consumeBody(this);
-
-		return new blob.Blob([buf], {
-			type: ct
-		});
-	}
-
-	/**
-	 * Decode response as json
-	 *
-	 * @return  Promise
-	 */
-	async json() {
-		return JSON.parse(await this.text());
-	}
-
-	/**
-	 * Decode response as text
-	 *
-	 * @return  Promise
-	 */
-	async text() {
-		const buffer = await consumeBody(this);
-		return decode(buffer);
-	}
-
-	/**
-	 * @returns {Promise}
-	 */
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/src/hashes/digest.js
 
-	async formData() {
-		return toFormData(this)
-	}
-}
 
-// In browsers, all properties are enumerable.
-Object.defineProperties(Body.prototype, {
-	body: {enumerable: true},
-	bodyUsed: {enumerable: true},
-	arrayBuffer: {enumerable: true},
-	blob: {enumerable: true},
-	json: {enumerable: true},
-	text: {enumerable: true},
-	formData: {enumerable: true}
-});
 
 /**
- * Consume and convert an entire Body to a Buffer.
- *
- * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
+ * Creates a multihash digest.
  *
- * @param {Body & {url?:string}} data
- * @return {Promise}
+ * @template {number} Code
+ * @param {Code} code
+ * @param {Uint8Array} digest
  */
-async function consumeBody(data) {
-	const state = data[INTERNALS$2];
-	if (state.disturbed) {
-		throw new TypeError(`body used already for: ${data.url}`);
-	}
-
-	state.disturbed = true;
-
-	if (state.error) {
-		throw state.error;
-	}
-
-	const {body} = state;
-
-	// Body is null
-	if (body === null) {
-		return new Uint8Array(0);
-	}
-
-	// Body is stream
-	// get ready to actually consume the body
-	/** @type {[Uint8Array|null, Uint8Array[], number]} */
-	const [buffer, chunks, limit] = data.size > 0 ?
-		[new Uint8Array(data.size), [], data.size] :
-		[null, [], Infinity];
-	let offset = 0;
-
-	const source = streamIterator(body);
-	try {
-		for await (const chunk of source) {
-			const bytes = chunk instanceof Uint8Array ?
-				chunk :
-				Buffer.from(chunk);
-
-			if (offset + bytes.byteLength > limit) {
-				const error = new FetchError(`content size at ${data.url} over limit: ${limit}`, 'max-size');
-				source.throw(error);
-				throw error;
-			} else if (buffer) {
-				buffer.set(bytes, offset);
-			} else {
-				chunks.push(bytes);
-			}
+const blockstore_fs_node_modules_multiformats_src_hashes_digest_create = (code, digest) => {
+  const size = digest.byteLength
+  const sizeOffset = blockstore_fs_node_modules_multiformats_src_varint_encodingLength(code)
+  const digestOffset = sizeOffset + blockstore_fs_node_modules_multiformats_src_varint_encodingLength(size)
 
-			offset += bytes.byteLength;
-		}
+  const bytes = new Uint8Array(digestOffset + size)
+  blockstore_fs_node_modules_multiformats_src_varint_encodeTo(code, bytes, 0)
+  blockstore_fs_node_modules_multiformats_src_varint_encodeTo(size, bytes, sizeOffset)
+  bytes.set(digest, digestOffset)
 
-		if (buffer) {
-			if (offset < buffer.byteLength) {
-				throw new FetchError(`Premature close of server response while trying to fetch ${data.url}`, 'premature-close');
-			} else {
-				return buffer;
-			}
-		} else {
-			return writeBytes(new Uint8Array(offset), chunks);
-		}
-	} catch (error) {
-		if (error instanceof FetchBaseError) {
-			throw error;
-		// @ts-expect-error - we know it will have a name
-		} else if (error && error.name === 'AbortError') {
-			throw error;
-		} else {
-			const e = /** @type {import('./errors/fetch-error').SystemError} */(error);
-			// Other errors, such as incorrect content-encoding
-			throw new FetchError(`Invalid response body while trying to fetch ${data.url}: ${e.message}`, 'system', e);
-		}
-	}
+  return new blockstore_fs_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes)
 }
 
 /**
- * Clone body given Res/Req instance
+ * Turns bytes representation of multihash digest into an instance.
  *
- * @param {Body} instance       Response or Request instance
- * @return {ReadableStream}
+ * @param {Uint8Array} multihash
+ * @returns {MultihashDigest}
  */
-const clone = instance => {
-	const {body} = instance;
+const blockstore_fs_node_modules_multiformats_src_hashes_digest_decode = (multihash) => {
+  const bytes = blockstore_fs_node_modules_multiformats_src_bytes_coerce(multihash)
+  const [code, sizeOffset] = blockstore_fs_node_modules_multiformats_src_varint_decode(bytes)
+  const [size, digestOffset] = blockstore_fs_node_modules_multiformats_src_varint_decode(bytes.subarray(sizeOffset))
+  const digest = bytes.subarray(sizeOffset + digestOffset)
 
-	// Don't allow cloning a used body
-	if (instance.bodyUsed) {
-		throw new Error('cannot clone body after it is used');
-	}
+  if (digest.byteLength !== size) {
+    throw new Error('Incorrect length')
+  }
 
-	// @ts-expect-error - could be null
-	const [left, right] = body.tee();
-	instance[INTERNALS$2].body = left;
-	return right;
-};
+  return new blockstore_fs_node_modules_multiformats_src_hashes_digest_Digest(code, size, digest, bytes)
+}
 
 /**
- * Performs the operation "extract a `Content-Type` value from |object|" as
- * specified in the specification:
- * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
- *
- * This function assumes that instance.body is present.
- *
- * @param {Body} source Any options.body input
- * @returns {string | null}
+ * @param {MultihashDigest} a
+ * @param {unknown} b
+ * @returns {b is MultihashDigest}
  */
-const extractContentType = source => source[INTERNALS$2].type;
+const blockstore_fs_node_modules_multiformats_src_hashes_digest_equals = (a, b) => {
+  if (a === b) {
+    return true
+  } else {
+    const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b)
 
-/**
- * The Fetch Standard treats this as if "total bytes" is a property on the body.
- * For us, we have to explicitly get it with a function.
- *
- * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
- *
- * @param {Body} source - Body object from the Body instance.
- * @returns {number | null}
- */
-const getTotalBytes = source => source[INTERNALS$2].size;
+    return (
+      a.code === data.code &&
+      a.size === data.size &&
+      data.bytes instanceof Uint8Array &&
+      blockstore_fs_node_modules_multiformats_src_bytes_equals(a.bytes, data.bytes)
+    )
+  }
+}
 
 /**
- * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
- *
- * @param {Stream.Writable} dest - The stream to write to.
- * @param {Body} source - Body object from the Body instance.
- * @returns {void}
+ * @typedef {import('./interface.js').MultihashDigest} MultihashDigest
  */
-const writeToStream = (dest, {body}) => {
-	if (body === null) {
-		// Body is null
-		dest.end();
-	} else {
-		Stream.Readable.from(streamIterator(body)).pipe(dest);
-	}
-};
 
 /**
- * @template T
- * @implements {AsyncGenerator}
+ * Represents a multihash digest which carries information about the
+ * hashing algorithm and an actual hash digest.
+ *
+ * @template {number} Code
+ * @template {number} Size
+ * @class
+ * @implements {MultihashDigest}
  */
-class StreamIterableIterator {
-	/**
-	 * @param {ReadableStream} stream
-	 */
-	constructor(stream) {
-		this.stream = stream;
-		this.reader = null;
-	}
-
-	/**
-	 * @returns {AsyncGenerator}
-	 */
-	[Symbol.asyncIterator]() {
-		return this;
-	}
+class blockstore_fs_node_modules_multiformats_src_hashes_digest_Digest {
+  /**
+   * Creates a multihash digest.
+   *
+   * @param {Code} code
+   * @param {Size} size
+   * @param {Uint8Array} digest
+   * @param {Uint8Array} bytes
+   */
+  constructor (code, size, digest, bytes) {
+    this.code = code
+    this.size = size
+    this.digest = digest
+    this.bytes = bytes
+  }
+}
 
-	getReader() {
-		if (this.reader) {
-			return this.reader;
-		}
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/node_modules/multiformats/src/cid.js
 
-		const reader = this.stream.getReader();
-		this.reader = reader;
-		return reader;
-	}
 
-	/**
-	 * @returns {Promise>}
-	 */
-	next() {
-		return /** @type {Promise>} */ (this.getReader().read());
-	}
 
-	/**
-	 * @returns {Promise>}
-	 */
-	async return() {
-		if (this.reader) {
-			await this.reader.cancel();
-		}
 
-		return {done: true, value: undefined};
-	}
+// Linter can see that API is used in types.
+// eslint-disable-next-line
 
-	/**
-	 * 
-	 * @param {any} error 
-	 * @returns {Promise>}
-	 */
-	async throw(error) {
-		await this.getReader().cancel(error);
-		return {done: true, value: undefined};
-	}
-}
 
-/**
- * @template T
- * @param {ReadableStream} stream
- */
-const streamIterator = stream => new StreamIterableIterator(stream);
 
-/**
- * @param {Uint8Array} buffer
- * @param {Uint8Array[]} chunks
- */
-const writeBytes = (buffer, chunks) => {
-	let offset = 0;
-	for (const chunk of chunks) {
-		buffer.set(chunk, offset);
-		offset += chunk.byteLength;
-	}
+// This way TS will also expose all the types from module
 
-	return buffer;
-};
 
 /**
- * @param {Uint8Array} bytes
- * @returns {ReadableStream}
+ * @template {API.Link} T
+ * @template {string} Prefix
+ * @param {T} link
+ * @param {API.MultibaseEncoder} [base]
+ * @returns {API.ToString}
  */
-// @ts-ignore
-const fromBytes = bytes => new blob.ReadableStream({
-	start(controller) {
-		controller.enqueue(bytes);
-		controller.close();
-	}
-});
+const blockstore_fs_node_modules_multiformats_src_cid_format = (link, base) => {
+  const { bytes, version } = link
+  switch (version) {
+    case 0:
+      return blockstore_fs_node_modules_multiformats_src_cid_toStringV0(
+        bytes,
+        blockstore_fs_node_modules_multiformats_src_cid_baseCache(link),
+        /** @type {API.MultibaseEncoder<"z">} */ (base) || blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc.encoder
+      )
+    default:
+      return blockstore_fs_node_modules_multiformats_src_cid_toStringV1(
+        bytes,
+        blockstore_fs_node_modules_multiformats_src_cid_baseCache(link),
+        /** @type {API.MultibaseEncoder} */ (base || blockstore_fs_node_modules_multiformats_src_bases_base32_base32.encoder)
+      )
+  }
+}
 
 /**
- * @param {AsyncIterable} content
- * @returns {ReadableStream}
+ * @template {API.UnknownLink} Link
+ * @param {Link} link
+ * @returns {API.LinkJSON}
  */
-const fromAsyncIterable = content =>
-	// @ts-ignore
-	new blob.ReadableStream(new AsyncIterablePump(content));
+const blockstore_fs_node_modules_multiformats_src_cid_toJSON = (link) => ({
+  '/': blockstore_fs_node_modules_multiformats_src_cid_format(link)
+})
 
 /**
- * @implements {UnderlyingSource}
+ * @template {API.UnknownLink} Link
+ * @param {API.LinkJSON} json
  */
-class AsyncIterablePump {
-	/**
-	 * @param {AsyncIterable} source
-	 */
-	constructor(source) {
-		this.source = source[Symbol.asyncIterator]();
-	}
-
-	/**
-	 * @param {ReadableStreamController} controller
-	 */
-	async pull(controller) {
-		try {
-			while (controller.desiredSize || 0 > 0) {
-				// eslint-disable-next-line no-await-in-loop
-				const next = await this.source.next();
-				if (next.done) {
-					controller.close();
-					break;
-				} else {
-					controller.enqueue(next.value);
-				}
-			}
-		} catch (error) {
-			controller.error(error);
-		}
-	}
-
-	/**
-	 * @param {any} [reason]
-	 */
-	cancel(reason) {
-		if (reason) {
-			if (typeof this.source.throw === 'function') {
-				this.source.throw(reason);
-			} else if (typeof this.source.return === 'function') {
-				this.source.return();
-			}
-		} else if (typeof this.source.return === 'function') {
-			this.source.return();
-		}
-	}
-}
+const blockstore_fs_node_modules_multiformats_src_cid_fromJSON = (json) =>
+  blockstore_fs_node_modules_multiformats_src_cid_CID.parse(json['/'])
 
-/**
- * @param {Stream & {readableHighWaterMark?:number}} source
- * @returns {ReadableStream}
- */
-const fromStream = source => {
-	const pump = new StreamPump(source);
-	const stream = new blob.ReadableStream(pump, pump);
-	return stream;
-};
+/** @type {WeakMap>} */
+const blockstore_fs_node_modules_multiformats_src_cid_cache = new WeakMap()
 
 /**
- * @implements {UnderlyingSource}
- * @implements {QueuingStrategy}
+ * @param {API.UnknownLink} cid
+ * @returns {Map}
  */
-class StreamPump {
-	/**
-	 * @param {Stream & {
-	 * 	readableHighWaterMark?: number
-	 * 	readable?:boolean,
-	 * 	resume?: () => void,
-	 * 	pause?: () => void
-	 * 	destroy?: (error?:Error) => void
-	 * }} stream
-	 */
-	constructor(stream) {
-		this.highWaterMark = stream.readableHighWaterMark || readableHighWaterMark;
-		this.accumalatedSize = 0;
-		this.stream = stream;
-		this.enqueue = this.enqueue.bind(this);
-		this.error = this.error.bind(this);
-		this.close = this.close.bind(this);
-	}
-
-	/**
-	 * @param {Uint8Array} [chunk]
-	 */
-	size(chunk) {
-		return chunk?.byteLength || 0;
-	}
-
-	/**
-	 * @param {ReadableStreamController} controller
-	 */
-	start(controller) {
-		this.controller = controller;
-		this.stream.on('data', this.enqueue);
-		this.stream.once('error', this.error);
-		this.stream.once('end', this.close);
-		this.stream.once('close', this.close);
-	}
-
-	pull() {
-		this.resume();
-	}
-
-	/**
-	 * @param {any} [reason]
-	 */
-	cancel(reason) {
-		if (this.stream.destroy) {
-			this.stream.destroy(reason);
-		}
-
-		this.stream.off('data', this.enqueue);
-		this.stream.off('error', this.error);
-		this.stream.off('end', this.close);
-		this.stream.off('close', this.close);
-	}
-
-	/**
-	 * @param {Uint8Array|string} chunk
-	 */
-	enqueue(chunk) {
-		if (this.controller) {
-			try {
-				const bytes = chunk instanceof Uint8Array ?
-					chunk :
-					Buffer.from(chunk);
-
-				const available = (this.controller.desiredSize || 0) - bytes.byteLength;
-				this.controller.enqueue(bytes);
-				if (available <= 0) {
-					this.pause();
-				}
-			} catch {
-				this.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'));
-				this.cancel();
-			}
-		}
-	}
-
-	pause() {
-		if (this.stream.pause) {
-			this.stream.pause();
-		}
-	}
-
-	resume() {
-		if (this.stream.readable && this.stream.resume) {
-			this.stream.resume();
-		}
-	}
-
-	close() {
-		if (this.controller) {
-			this.controller.close();
-			delete this.controller;
-		}
-	}
-
-	/**
-	 * @param {Error} error 
-	 */
-	error(error) {
-		if (this.controller) {
-			this.controller.error(error);
-			delete this.controller;
-		}
-	}
+const blockstore_fs_node_modules_multiformats_src_cid_baseCache = cid => {
+  const baseCache = blockstore_fs_node_modules_multiformats_src_cid_cache.get(cid)
+  if (baseCache == null) {
+    const baseCache = new Map()
+    blockstore_fs_node_modules_multiformats_src_cid_cache.set(cid, baseCache)
+    return baseCache
+  }
+  return baseCache
 }
 
 /**
- * Headers.js
- *
- * Headers class offers convenient helpers
+ * @template {unknown} [Data=unknown]
+ * @template {number} [Format=number]
+ * @template {number} [Alg=number]
+ * @template {API.Version} [Version=API.Version]
+ * @implements {API.Link}
  */
 
-const validators = /** @type {{validateHeaderName?:(name:string) => any, validateHeaderValue?:(name:string, value:string) => any}} */
-(http);
-
-const validateHeaderName = typeof validators.validateHeaderName === 'function' ?
-	validators.validateHeaderName :
-	/**
-	 * @param {string} name 
-	 */
-	name => {
-		if (!/^[\^`\-\w!#$%&'*+.|~]+$/.test(name)) {
-			const err = new TypeError(`Header name must be a valid HTTP token [${name}]`);
-			Object.defineProperty(err, 'code', {value: 'ERR_INVALID_HTTP_TOKEN'});
-			throw err;
-		}
-	};
-
-const validateHeaderValue = typeof validators.validateHeaderValue === 'function' ?
-	validators.validateHeaderValue :
-	/**
-	 * @param {string} name 
-	 * @param {string} value 
-	 */
-	(name, value) => {
-		if (/[^\t\u0020-\u007E\u0080-\u00FF]/.test(value)) {
-			const err = new TypeError(`Invalid character in header content ["${name}"]`);
-			Object.defineProperty(err, 'code', {value: 'ERR_INVALID_CHAR'});
-			throw err;
-		}
-	};
-
-/**
- * @typedef {Headers | Record | Iterable | Iterable>} HeadersInit
- */
+class blockstore_fs_node_modules_multiformats_src_cid_CID {
+  /**
+   * @param {Version} version - Version of the CID
+   * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv
+   * @param {API.MultihashDigest} multihash - (Multi)hash of the of the content.
+   * @param {Uint8Array} bytes
+   */
+  constructor (version, code, multihash, bytes) {
+    /** @readonly */
+    this.code = code
+    /** @readonly */
+    this.version = version
+    /** @readonly */
+    this.multihash = multihash
+    /** @readonly */
+    this.bytes = bytes
 
-/**
- * This Fetch API interface allows you to perform various actions on HTTP request and response headers.
- * These actions include retrieving, setting, adding to, and removing.
- * A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.
- * You can add to this using methods like append() (see Examples.)
- * In all methods of this interface, header names are matched by case-insensitive byte sequence.
- *
- * @implements {globalThis.Headers}
- */
-class Headers extends URLSearchParams {
-	/**
-	 * Headers class
-	 *
-	 * @constructor
-	 * @param {HeadersInit} [init] - Response headers
-	 */
-	constructor(init) {
-		// Validate and normalize init object in [name, value(s)][]
-		/** @type {string[][]} */
-		let result = [];
-		if (init instanceof Headers) {
-			const raw = init.raw();
-			for (const [name, values] of Object.entries(raw)) {
-				result.push(...values.map(value => [name, value]));
-			}
-		} else if (init == null) ; else if (isIterable(init)) {
-			// Sequence>
-			// Note: per spec we have to first exhaust the lists then process them
-			result = [...init]
-				.map(pair => {
-					if (
-						typeof pair !== 'object' || util.types.isBoxedPrimitive(pair)
-					) {
-						throw new TypeError('Each header pair must be an iterable object');
-					}
-
-					return [...pair];
-				}).map(pair => {
-					if (pair.length !== 2) {
-						throw new TypeError('Each header pair must be a name/value tuple');
-					}
-
-					return [...pair];
-				});
-		} else if (typeof init === "object" && init !== null) {
-			// Record
-			result.push(...Object.entries(init));
-		} else {
-			throw new TypeError('Failed to construct \'Headers\': The provided value is not of type \'(sequence> or record)');
-		}
+    // flag to serializers that this is a CID and
+    // should be treated specially
+    /** @readonly */
+    this['/'] = bytes
+  }
 
-		// Validate and lowercase
-		result =
-			result.length > 0 ?
-				result.map(([name, value]) => {
-					validateHeaderName(name);
-					validateHeaderValue(name, String(value));
-					return [String(name).toLowerCase(), String(value)];
-				}) :
-				[];
-
-		super(result);
-
-		// Returning a Proxy that will lowercase key names, validate parameters and sort keys
-		// eslint-disable-next-line no-constructor-return
-		return new Proxy(this, {
-			get(target, p, receiver) {
-				switch (p) {
-					case 'append':
-					case 'set':
-						/**
-						 * @param {string} name
-						 * @param {string} value
-						 */
-						return (name, value) => {
-							validateHeaderName(name);
-							validateHeaderValue(name, String(value));
-							return URLSearchParams.prototype[p].call(
-								receiver,
-								String(name).toLowerCase(),
-								String(value)
-							);
-						};
-
-					case 'delete':
-					case 'has':
-					case 'getAll':
-						/**
-						 * @param {string} name
-						 */
-						return name => {
-							validateHeaderName(name);
-							// @ts-ignore
-							return URLSearchParams.prototype[p].call(
-								receiver,
-								String(name).toLowerCase()
-							);
-						};
-
-					case 'keys':
-						return () => {
-							target.sort();
-							return new Set(URLSearchParams.prototype.keys.call(target)).keys();
-						};
-
-					default:
-						return Reflect.get(target, p, receiver);
-				}
-			}
-			/* c8 ignore next */
-		});
-	}
+  /**
+   * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes`
+   * please either use `CID.asCID(cid)` or switch to new signalling mechanism
+   *
+   * @deprecated
+   */
+  get asCID () {
+    return this
+  }
 
-	get [Symbol.toStringTag]() {
-		return this.constructor.name;
-	}
+  // ArrayBufferView
+  get byteOffset () {
+    return this.bytes.byteOffset
+  }
 
-	toString() {
-		return Object.prototype.toString.call(this);
-	}
+  // ArrayBufferView
+  get byteLength () {
+    return this.bytes.byteLength
+  }
 
-	/**
-	 * 
-	 * @param {string} name 
-	 */
-	get(name) {
-		const values = this.getAll(name);
-		if (values.length === 0) {
-			return null;
-		}
+  /**
+   * @returns {CID}
+   */
+  toV0 () {
+    switch (this.version) {
+      case 0: {
+        return /** @type {CID} */ (this)
+      }
+      case 1: {
+        const { code, multihash } = this
 
-		let value = values.join(', ');
-		if (/^content-encoding$/i.test(name)) {
-			value = value.toLowerCase();
-		}
+        if (code !== blockstore_fs_node_modules_multiformats_src_cid_DAG_PB_CODE) {
+          throw new Error('Cannot convert a non dag-pb CID to CIDv0')
+        }
 
-		return value;
-	}
+        // sha2-256
+        if (multihash.code !== blockstore_fs_node_modules_multiformats_src_cid_SHA_256_CODE) {
+          throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0')
+        }
 
-	/**
-	 * @param {(value: string, key: string, parent: this) => void} callback 
-	 * @param {any} thisArg 
-	 * @returns {void}
-	 */
-	forEach(callback, thisArg = undefined) {
-		for (const name of this.keys()) {
-			Reflect.apply(callback, thisArg, [this.get(name), name, this]);
-		}
-	}
+        return /** @type {CID} */ (
+          blockstore_fs_node_modules_multiformats_src_cid_CID.createV0(
+            /** @type {API.MultihashDigest} */ (multihash)
+          )
+        )
+      }
+      default: {
+        throw Error(
+          `Can not convert CID version ${this.version} to version 0. This is a bug please report`
+        )
+      }
+    }
+  }
 
-	/**
-	 * @returns {IterableIterator}
-	 */
-	* values() {
-		for (const name of this.keys()) {
-			yield /** @type {string} */(this.get(name));
-		}
-	}
+  /**
+   * @returns {CID}
+   */
+  toV1 () {
+    switch (this.version) {
+      case 0: {
+        const { code, digest } = this.multihash
+        const multihash = blockstore_fs_node_modules_multiformats_src_hashes_digest_create(code, digest)
+        return /** @type {CID} */ (
+          blockstore_fs_node_modules_multiformats_src_cid_CID.createV1(this.code, multihash)
+        )
+      }
+      case 1: {
+        return /** @type {CID} */ (this)
+      }
+      default: {
+        throw Error(
+          `Can not convert CID version ${this.version} to version 1. This is a bug please report`
+        )
+      }
+    }
+  }
 
-	/**
-	 * @returns {IterableIterator<[string, string]>}
-	 */
-	* entries() {
-		for (const name of this.keys()) {
-			yield [name, /** @type {string} */(this.get(name))];
-		}
-	}
+  /**
+   * @param {unknown} other
+   * @returns {other is CID}
+   */
+  equals (other) {
+    return blockstore_fs_node_modules_multiformats_src_cid_CID.equals(this, other)
+  }
 
-	[Symbol.iterator]() {
-		return this.entries();
-	}
+  /**
+   * @template {unknown} Data
+   * @template {number} Format
+   * @template {number} Alg
+   * @template {API.Version} Version
+   * @param {API.Link} self
+   * @param {unknown} other
+   * @returns {other is CID}
+   */
+  static equals (self, other) {
+    const unknown =
+      /** @type {{code?:unknown, version?:unknown, multihash?:unknown}} */ (
+        other
+      )
+    return (
+      unknown &&
+      self.code === unknown.code &&
+      self.version === unknown.version &&
+      blockstore_fs_node_modules_multiformats_src_hashes_digest_equals(self.multihash, unknown.multihash)
+    )
+  }
 
-	/**
-	 * Node-fetch non-spec method
-	 * returning all headers and their values as array
-	 * @returns {Record}
-	 */
-	raw() {
-		return [...this.keys()].reduce((result, key) => {
-			result[key] = this.getAll(key);
-			return result;
-		}, /** @type {Record} */({}));
-	}
+  /**
+   * @param {API.MultibaseEncoder} [base]
+   * @returns {string}
+   */
+  toString (base) {
+    return blockstore_fs_node_modules_multiformats_src_cid_format(this, base)
+  }
 
-	/**
-	 * For better console.log(headers) and also to convert Headers into Node.js Request compatible format
-	 */
-	[Symbol.for('nodejs.util.inspect.custom')]() {
-		return [...this.keys()].reduce((result, key) => {
-			const values = this.getAll(key);
-			// Http.request() only supports string as Host header.
-			// This hack makes specifying custom Host header possible.
-			if (key === 'host') {
-				result[key] = values[0];
-			} else {
-				result[key] = values.length > 1 ? values : values[0];
-			}
+  /**
+   * @returns {API.LinkJSON}
+   */
+  toJSON () {
+    return { '/': blockstore_fs_node_modules_multiformats_src_cid_format(this) }
+  }
 
-			return result;
-		}, /** @type {Record} */({}));
-	}
-}
+  link () {
+    return this
+  }
 
-/**
- * Re-shaping object for Web IDL tests
- * Only need to do it for overridden methods
- */
-Object.defineProperties(
-	Headers.prototype,
-	['get', 'entries', 'forEach', 'values'].reduce((result, property) => {
-		result[property] = {enumerable: true};
-		return result;
-	}, /** @type {Record} */ ({}))
-);
+  get [Symbol.toStringTag] () {
+    return 'CID'
+  }
 
-/**
- * Create a Headers object from an http.IncomingMessage.rawHeaders, ignoring those that do
- * not conform to HTTP grammar productions.
- * @param {import('http').IncomingMessage['rawHeaders']} headers
- */
-function fromRawHeaders(headers = []) {
-	return new Headers(
-		headers
-			// Split into pairs
-			.reduce((result, value, index, array) => {
-				if (index % 2 === 0) {
-					result.push(array.slice(index, index + 2));
-				}
+  // Legacy
 
-				return result;
-			}, /** @type {string[][]} */([]))
-			.filter(([name, value]) => {
-				try {
-					validateHeaderName(name);
-					validateHeaderValue(name, String(value));
-					return true;
-				} catch {
-					return false;
-				}
-			})
+  [Symbol.for('nodejs.util.inspect.custom')] () {
+    return `CID(${this.toString()})`
+  }
 
-	);
-}
+  /**
+   * Takes any input `value` and returns a `CID` instance if it was
+   * a `CID` otherwise returns `null`. If `value` is instanceof `CID`
+   * it will return value back. If `value` is not instance of this CID
+   * class, but is compatible CID it will return new instance of this
+   * `CID` class. Otherwise returns null.
+   *
+   * This allows two different incompatible versions of CID library to
+   * co-exist and interop as long as binary interface is compatible.
+   *
+   * @template {unknown} Data
+   * @template {number} Format
+   * @template {number} Alg
+   * @template {API.Version} Version
+   * @template {unknown} U
+   * @param {API.Link|U} input
+   * @returns {CID|null}
+   */
+  static asCID (input) {
+    if (input == null) {
+      return null
+    }
 
-const redirectStatus = new Set([301, 302, 303, 307, 308]);
+    const value = /** @type {any} */ (input)
+    if (value instanceof blockstore_fs_node_modules_multiformats_src_cid_CID) {
+      // If value is instance of CID then we're all set.
+      return value
+    } else if ((value['/'] != null && value['/'] === value.bytes) || value.asCID === value) {
+      // If value isn't instance of this CID class but `this.asCID === this` or
+      // `value['/'] === value.bytes` is true it is CID instance coming from a
+      // different implementation (diff version or duplicate). In that case we
+      // rebase it to this `CID` implementation so caller is guaranteed to get
+      // instance with expected API.
+      const { version, code, multihash, bytes } = value
+      return new blockstore_fs_node_modules_multiformats_src_cid_CID(
+        version,
+        code,
+        /** @type {API.MultihashDigest} */ (multihash),
+        bytes || blockstore_fs_node_modules_multiformats_src_cid_encodeCID(version, code, multihash.bytes)
+      )
+    } else if (value[blockstore_fs_node_modules_multiformats_src_cid_cidSymbol] === true) {
+      // If value is a CID from older implementation that used to be tagged via
+      // symbol we still rebase it to the this `CID` implementation by
+      // delegating that to a constructor.
+      const { version, multihash, code } = value
+      const digest =
+        /** @type {API.MultihashDigest} */
+        (blockstore_fs_node_modules_multiformats_src_hashes_digest_decode(multihash))
+      return blockstore_fs_node_modules_multiformats_src_cid_CID.create(version, code, digest)
+    } else {
+      // Otherwise value is not a CID (or an incompatible version of it) in
+      // which case we return `null`.
+      return null
+    }
+  }
 
-/**
- * Redirect code matching
- *
- * @param {number} code - Status code
- * @return {boolean}
- */
-const isRedirect = code => {
-	return redirectStatus.has(code);
-};
+  /**
+   *
+   * @template {unknown} Data
+   * @template {number} Format
+   * @template {number} Alg
+   * @template {API.Version} Version
+   * @param {Version} version - Version of the CID
+   * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv
+   * @param {API.MultihashDigest} digest - (Multi)hash of the of the content.
+   * @returns {CID}
+   */
+  static create (version, code, digest) {
+    if (typeof code !== 'number') {
+      throw new Error('String codecs are no longer supported')
+    }
 
-/**
- * Response.js
- *
- * Response class provides content decoding
- */
+    if (!(digest.bytes instanceof Uint8Array)) {
+      throw new Error('Invalid digest')
+    }
 
-const INTERNALS$1 = Symbol('Response internals');
+    switch (version) {
+      case 0: {
+        if (code !== blockstore_fs_node_modules_multiformats_src_cid_DAG_PB_CODE) {
+          throw new Error(
+            `Version 0 CID must use dag-pb (code: ${blockstore_fs_node_modules_multiformats_src_cid_DAG_PB_CODE}) block encoding`
+          )
+        } else {
+          return new blockstore_fs_node_modules_multiformats_src_cid_CID(version, code, digest, digest.bytes)
+        }
+      }
+      case 1: {
+        const bytes = blockstore_fs_node_modules_multiformats_src_cid_encodeCID(version, code, digest.bytes)
+        return new blockstore_fs_node_modules_multiformats_src_cid_CID(version, code, digest, bytes)
+      }
+      default: {
+        throw new Error('Invalid version')
+      }
+    }
+  }
 
-/**
- * Response class
- * 
- * @typedef {Object} Ext
- * @property {number} [size]
- * @property {string} [url]
- * @property {number} [counter]
- * @property {number} [highWaterMark]
- * 
- * @implements {globalThis.Response}
- */
-class Response extends Body {
-	/**
-	 * @param {BodyInit|import('stream').Stream|null} [body] - Readable stream
-	 * @param {ResponseInit & Ext} [options] - Response options
-	 */
-	constructor(body = null, options = {}) {
-		super(body, options);
-
-		const status = options.status || 200;
-		const headers = new Headers(options.headers);
-
-		if (body !== null && !headers.has('Content-Type')) {
-			const contentType = extractContentType(this);
-			if (contentType) {
-				headers.append('Content-Type', contentType);
-			}
-		}
+  /**
+   * Simplified version of `create` for CIDv0.
+   *
+   * @template {unknown} [T=unknown]
+   * @param {API.MultihashDigest} digest - Multihash.
+   * @returns {CID}
+   */
+  static createV0 (digest) {
+    return blockstore_fs_node_modules_multiformats_src_cid_CID.create(0, blockstore_fs_node_modules_multiformats_src_cid_DAG_PB_CODE, digest)
+  }
 
-		/**
-		 * @private
-		*/
-		this[INTERNALS$1] = {
-			url: options.url,
-			status,
-			statusText: options.statusText || '',
-			headers,
-			counter: options.counter || 0,
-			highWaterMark: options.highWaterMark
-		};
-	}
+  /**
+   * Simplified version of `create` for CIDv1.
+   *
+   * @template {unknown} Data
+   * @template {number} Code
+   * @template {number} Alg
+   * @param {Code} code - Content encoding format code.
+   * @param {API.MultihashDigest} digest - Miltihash of the content.
+   * @returns {CID}
+   */
+  static createV1 (code, digest) {
+    return blockstore_fs_node_modules_multiformats_src_cid_CID.create(1, code, digest)
+  }
 
-	/**
-	 * @type {ResponseType}
-	 */
-	get type() {
-		return "default"
-	}
+  /**
+   * Decoded a CID from its binary representation. The byte array must contain
+   * only the CID with no additional bytes.
+   *
+   * An error will be thrown if the bytes provided do not contain a valid
+   * binary representation of a CID.
+   *
+   * @template {unknown} Data
+   * @template {number} Code
+   * @template {number} Alg
+   * @template {API.Version} Ver
+   * @param {API.ByteView>} bytes
+   * @returns {CID}
+   */
+  static decode (bytes) {
+    const [cid, remainder] = blockstore_fs_node_modules_multiformats_src_cid_CID.decodeFirst(bytes)
+    if (remainder.length) {
+      throw new Error('Incorrect length')
+    }
+    return cid
+  }
 
-	get url() {
-		return this[INTERNALS$1].url || '';
-	}
+  /**
+   * Decoded a CID from its binary representation at the beginning of a byte
+   * array.
+   *
+   * Returns an array with the first element containing the CID and the second
+   * element containing the remainder of the original byte array. The remainder
+   * will be a zero-length byte array if the provided bytes only contained a
+   * binary CID representation.
+   *
+   * @template {unknown} T
+   * @template {number} C
+   * @template {number} A
+   * @template {API.Version} V
+   * @param {API.ByteView>} bytes
+   * @returns {[CID, Uint8Array]}
+   */
+  static decodeFirst (bytes) {
+    const specs = blockstore_fs_node_modules_multiformats_src_cid_CID.inspectBytes(bytes)
+    const prefixSize = specs.size - specs.multihashSize
+    const multihashBytes = blockstore_fs_node_modules_multiformats_src_bytes_coerce(
+      bytes.subarray(prefixSize, prefixSize + specs.multihashSize)
+    )
+    if (multihashBytes.byteLength !== specs.multihashSize) {
+      throw new Error('Incorrect length')
+    }
+    const digestBytes = multihashBytes.subarray(
+      specs.multihashSize - specs.digestSize
+    )
+    const digest = new blockstore_fs_node_modules_multiformats_src_hashes_digest_Digest(
+      specs.multihashCode,
+      specs.digestSize,
+      digestBytes,
+      multihashBytes
+    )
+    const cid =
+      specs.version === 0
+        ? blockstore_fs_node_modules_multiformats_src_cid_CID.createV0(/** @type {API.MultihashDigest} */ (digest))
+        : blockstore_fs_node_modules_multiformats_src_cid_CID.createV1(specs.codec, digest)
+    return [/** @type {CID} */(cid), bytes.subarray(specs.size)]
+  }
 
-	get status() {
-		return this[INTERNALS$1].status;
-	}
+  /**
+   * Inspect the initial bytes of a CID to determine its properties.
+   *
+   * Involves decoding up to 4 varints. Typically this will require only 4 to 6
+   * bytes but for larger multicodec code values and larger multihash digest
+   * lengths these varints can be quite large. It is recommended that at least
+   * 10 bytes be made available in the `initialBytes` argument for a complete
+   * inspection.
+   *
+   * @template {unknown} T
+   * @template {number} C
+   * @template {number} A
+   * @template {API.Version} V
+   * @param {API.ByteView>} initialBytes
+   * @returns {{ version:V, codec:C, multihashCode:A, digestSize:number, multihashSize:number, size:number }}
+   */
+  static inspectBytes (initialBytes) {
+    let offset = 0
+    const next = () => {
+      const [i, length] = blockstore_fs_node_modules_multiformats_src_varint_decode(initialBytes.subarray(offset))
+      offset += length
+      return i
+    }
 
-	/**
-	 * Convenience property representing if the request ended normally
-	 */
-	get ok() {
-		return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
-	}
+    let version = /** @type {V} */ (next())
+    let codec = /** @type {C} */ (blockstore_fs_node_modules_multiformats_src_cid_DAG_PB_CODE)
+    if (/** @type {number} */(version) === 18) {
+      // CIDv0
+      version = /** @type {V} */ (0)
+      offset = 0
+    } else {
+      codec = /** @type {C} */ (next())
+    }
 
-	get redirected() {
-		return this[INTERNALS$1].counter > 0;
-	}
+    if (version !== 0 && version !== 1) {
+      throw new RangeError(`Invalid CID version ${version}`)
+    }
 
-	get statusText() {
-		return this[INTERNALS$1].statusText;
-	}
+    const prefixSize = offset
+    const multihashCode = /** @type {A} */ (next()) // multihash code
+    const digestSize = next() // multihash length
+    const size = offset + digestSize
+    const multihashSize = size - prefixSize
 
-	/**
-	 * @type {Headers}
-	 */
-	get headers() {
-		return this[INTERNALS$1].headers;
-	}
+    return { version, codec, multihashCode, digestSize, multihashSize, size }
+  }
 
-	get highWaterMark() {
-		return this[INTERNALS$1].highWaterMark;
-	}
+  /**
+   * Takes cid in a string representation and creates an instance. If `base`
+   * decoder is not provided will use a default from the configuration. It will
+   * throw an error if encoding of the CID is not compatible with supplied (or
+   * a default decoder).
+   *
+   * @template {string} Prefix
+   * @template {unknown} Data
+   * @template {number} Code
+   * @template {number} Alg
+   * @template {API.Version} Ver
+   * @param {API.ToString, Prefix>} source
+   * @param {API.MultibaseDecoder} [base]
+   * @returns {CID}
+   */
+  static parse (source, base) {
+    const [prefix, bytes] = blockstore_fs_node_modules_multiformats_src_cid_parseCIDtoBytes(source, base)
 
-	/**
-	 * Clone this response
-	 *
-	 * @returns {Response}
-	 */
-	clone() {
-		return new Response(clone(this), {
-			url: this.url,
-			status: this.status,
-			statusText: this.statusText,
-			headers: this.headers,
-			size: this.size
-		});
-	}
+    const cid = blockstore_fs_node_modules_multiformats_src_cid_CID.decode(bytes)
 
-	/**
-	 * @param {string} url    The URL that the new response is to originate from.
-	 * @param {number} status An optional status code for the response (e.g., 302.)
-	 * @returns {Response}    A Response object.
-	 */
-	static redirect(url, status = 302) {
-		if (!isRedirect(status)) {
-			throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');
-		}
+    if (cid.version === 0 && source[0] !== 'Q') {
+      throw Error('Version 0 CID string must not include multibase prefix')
+    }
 
-		return new Response(null, {
-			headers: {
-				location: new URL(url).toString()
-			},
-			status
-		});
-	}
+    // Cache string representation to avoid computing it on `this.toString()`
+    blockstore_fs_node_modules_multiformats_src_cid_baseCache(cid).set(prefix, source)
 
-	get [Symbol.toStringTag]() {
-		return 'Response';
-	}
+    return cid
+  }
 }
 
-Object.defineProperties(Response.prototype, {
-	url: {enumerable: true},
-	status: {enumerable: true},
-	ok: {enumerable: true},
-	redirected: {enumerable: true},
-	statusText: {enumerable: true},
-	headers: {enumerable: true},
-	clone: {enumerable: true}
-});
-
 /**
- * @param {URL} parsedURL 
- * @returns {string}
+ * @template {string} Prefix
+ * @template {unknown} Data
+ * @template {number} Code
+ * @template {number} Alg
+ * @template {API.Version} Ver
+ * @param {API.ToString, Prefix>} source
+ * @param {API.MultibaseDecoder} [base]
+ * @returns {[Prefix, API.ByteView>]}
  */
-const getSearch = parsedURL => {
-	if (parsedURL.search) {
-		return parsedURL.search;
-	}
-
-	const lastOffset = parsedURL.href.length - 1;
-	const hash = parsedURL.hash || (parsedURL.href[lastOffset] === '#' ? '#' : '');
-	return parsedURL.href[lastOffset - hash.length] === '?' ? '?' : '';
-};
-
-const INTERNALS = Symbol('Request internals');
+const blockstore_fs_node_modules_multiformats_src_cid_parseCIDtoBytes = (source, base) => {
+  switch (source[0]) {
+    // CIDv0 is parsed differently
+    case 'Q': {
+      const decoder = base || blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc
+      return [
+        /** @type {Prefix} */ (blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc.prefix),
+        decoder.decode(`${blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc.prefix}${source}`)
+      ]
+    }
+    case blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc.prefix: {
+      const decoder = base || blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc
+      return [/** @type {Prefix} */(blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc.prefix), decoder.decode(source)]
+    }
+    case blockstore_fs_node_modules_multiformats_src_bases_base32_base32.prefix: {
+      const decoder = base || blockstore_fs_node_modules_multiformats_src_bases_base32_base32
+      return [/** @type {Prefix} */(blockstore_fs_node_modules_multiformats_src_bases_base32_base32.prefix), decoder.decode(source)]
+    }
+    default: {
+      if (base == null) {
+        throw Error(
+          'To parse non base32 or base58btc encoded CID multibase decoder must be provided'
+        )
+      }
+      return [/** @type {Prefix} */(source[0]), base.decode(source)]
+    }
+  }
+}
 
 /**
- * Check if `obj` is an instance of Request.
  *
- * @param  {any} object
- * @return {object is Request}
+ * @param {Uint8Array} bytes
+ * @param {Map} cache
+ * @param {API.MultibaseEncoder<'z'>} base
  */
-const isRequest = object => {
-	return (
-		typeof object === 'object' &&
-		typeof object[INTERNALS] === 'object'
-	);
-};
+const blockstore_fs_node_modules_multiformats_src_cid_toStringV0 = (bytes, cache, base) => {
+  const { prefix } = base
+  if (prefix !== blockstore_fs_node_modules_multiformats_src_bases_base58_base58btc.prefix) {
+    throw Error(`Cannot string encode V0 in ${base.name} encoding`)
+  }
 
+  const cid = cache.get(prefix)
+  if (cid == null) {
+    const cid = base.encode(bytes).slice(1)
+    cache.set(prefix, cid)
+    return cid
+  } else {
+    return cid
+  }
+}
 
 /**
- * Request class
- * @implements {globalThis.Request}
- * 
- * @typedef {Object} RequestState
- * @property {string} method
- * @property {RequestRedirect} redirect
- * @property {globalThis.Headers} headers
- * @property {URL} parsedURL
- * @property {AbortSignal|null} signal
- * 
- * @typedef {Object} RequestExtraOptions
- * @property {number} [follow]
- * @property {boolean} [compress]
- * @property {number} [size]
- * @property {number} [counter]
- * @property {Agent} [agent]
- * @property {number} [highWaterMark]
- * @property {boolean} [insecureHTTPParser]
- * 
- * @typedef {((url:URL) => import('http').Agent) | import('http').Agent} Agent
- * 
- * @typedef {Object} RequestOptions
- * @property {string} [method]
- * @property {ReadableStream|null} [body]
- * @property {globalThis.Headers} [headers]
- * @property {RequestRedirect} [redirect]
- * 
+ * @template {string} Prefix
+ * @param {Uint8Array} bytes
+ * @param {Map} cache
+ * @param {API.MultibaseEncoder} base
  */
-class Request extends Body {
-	/**
-	 * @param {string|Request|URL} info  Url or Request instance
-	 * @param {RequestInit & RequestExtraOptions} init   Custom options
-	 */
-	constructor(info, init = {}) {
-		let parsedURL;
-		/** @type {RequestOptions & RequestExtraOptions} */
-		let settings;
-
-		// Normalize input and force URL to be encoded as UTF-8 (https://github.com/node-fetch/node-fetch/issues/245)
-		if (isRequest(info)) {
-			parsedURL = new URL(info.url);
-			settings = (info);
-		} else {
-			parsedURL = new URL(info);
-			settings = {};
-		}
-
-
-
-		let method = init.method || settings.method || 'GET';
-		method = method.toUpperCase();
-
-		const inputBody = init.body != null
-			? init.body
-			: (isRequest(info) && info.body !== null)
-			? clone(info)
-			: null;
-
-		// eslint-disable-next-line no-eq-null, eqeqeq
-		if (inputBody != null && (method === 'GET' || method === 'HEAD')) {
-			throw new TypeError('Request with GET/HEAD method cannot have body');
-		}
-
-		super(inputBody, {
-			size: init.size || settings.size || 0
-		});
-		const input = settings;
-
-		
-		const headers = /** @type {globalThis.Headers} */
-			(new Headers(init.headers || input.headers || {}));
-
-		if (inputBody !== null && !headers.has('Content-Type')) {
-			const contentType = extractContentType(this);
-			if (contentType) {
-				headers.append('Content-Type', contentType);
-			}
-		}
-
-		let signal = 'signal' in init
-			? init.signal
-			: isRequest(input)
-			? input.signal
-			: null;
-
-		// eslint-disable-next-line no-eq-null, eqeqeq
-		if (signal != null && !isAbortSignal(signal)) {
-			throw new TypeError('Expected signal to be an instanceof AbortSignal or EventTarget');
-		}
-
-		/** @type {RequestState} */
-		this[INTERNALS] = {
-			method,
-			redirect: init.redirect || input.redirect || 'follow',
-			headers,
-			parsedURL,
-			signal: signal || null
-		};
-
-		/** @type {boolean} */
-		this.keepalive;
-
-		// Node-fetch-only options
-		/** @type {number} */
-		this.follow = init.follow === undefined ? (input.follow === undefined ? 20 : input.follow) : init.follow;
-		/** @type {boolean} */
-		this.compress = init.compress === undefined ? (input.compress === undefined ? true : input.compress) : init.compress;
-		/** @type {number} */
-		this.counter = init.counter || input.counter || 0;
-		/** @type {Agent|undefined} */
-		this.agent = init.agent || input.agent;
-		/** @type {number} */
-		this.highWaterMark = init.highWaterMark || input.highWaterMark || 16384;
-		/** @type {boolean} */
-		this.insecureHTTPParser = init.insecureHTTPParser || input.insecureHTTPParser || false;
-	}
-
-	/**
-	 * @type {RequestCache}
-	 */
-	get cache() {
-		return "default"
-	}
-
-	/**
-	 * @type {RequestCredentials}
-	 */
-
-	get credentials() {
-		return "same-origin"
-	}
-
-	/**
-	 * @type {RequestDestination}
-	 */
-	get destination() {
-		return ""
-	}
-	
-	get integrity() {
-		return ""
-	}
-	
-	/** @type {RequestMode} */
-	get mode() {
-		return "cors"
-	}
-
-	/** @type {string} */
-	get referrer() {
-		return  ""
-	}
-	
-	/** @type {ReferrerPolicy} */
-	get referrerPolicy() {
-		return ""
-	}
-	get method() {
-		return this[INTERNALS].method;
-	}
-
-	/**
-	 * @type {string}
-	 */
-	get url() {
-		return url.format(this[INTERNALS].parsedURL);
-	}
-
-	/**
-	 * @type {globalThis.Headers}
-	 */
-	get headers() {
-		return this[INTERNALS].headers;
-	}
-
-	get redirect() {
-		return this[INTERNALS].redirect;
-	}
-
-	/**
-	 * @returns {AbortSignal}
-	 */
-	get signal() {
-		// @ts-ignore
-		return this[INTERNALS].signal;
-	}
-
-	/**
-	 * Clone this request
-	 *
-	 * @return  {globalThis.Request}
-	 */
-	clone() {
-		return new Request(this);
-	}
-
-	get [Symbol.toStringTag]() {
-		return 'Request';
-	}
+const blockstore_fs_node_modules_multiformats_src_cid_toStringV1 = (bytes, cache, base) => {
+  const { prefix } = base
+  const cid = cache.get(prefix)
+  if (cid == null) {
+    const cid = base.encode(bytes)
+    cache.set(prefix, cid)
+    return cid
+  } else {
+    return cid
+  }
 }
 
-Object.defineProperties(Request.prototype, {
-	method: {enumerable: true},
-	url: {enumerable: true},
-	headers: {enumerable: true},
-	redirect: {enumerable: true},
-	clone: {enumerable: true},
-	signal: {enumerable: true}
-});
+const blockstore_fs_node_modules_multiformats_src_cid_DAG_PB_CODE = 0x70
+const blockstore_fs_node_modules_multiformats_src_cid_SHA_256_CODE = 0x12
 
 /**
- * Convert a Request to Node.js http request options.
- * The options object to be passed to http.request
- *
- * @param {Request & Record} request -  A Request instance
+ * @param {API.Version} version
+ * @param {number} code
+ * @param {Uint8Array} multihash
+ * @returns {Uint8Array}
  */
-const getNodeRequestOptions = request => {
-	const {parsedURL} = request[INTERNALS];
-	const headers = new Headers(request[INTERNALS].headers);
-
-	// Fetch step 1.3
-	if (!headers.has('Accept')) {
-		headers.set('Accept', '*/*');
-	}
-
-	// HTTP-network-or-cache fetch steps 2.4-2.7
-	let contentLengthValue = null;
-	if (request.body === null && /^(post|put)$/i.test(request.method)) {
-		contentLengthValue = '0';
-	}
-
-	if (request.body !== null) {
-		const totalBytes = getTotalBytes(request);
-		// Set Content-Length if totalBytes is a number (that is not NaN)
-		if (typeof totalBytes === 'number' && !Number.isNaN(totalBytes)) {
-			contentLengthValue = String(totalBytes);
-		}
-	}
-
-	if (contentLengthValue) {
-		headers.set('Content-Length', contentLengthValue);
-	}
-
-	// HTTP-network-or-cache fetch step 2.11
-	if (!headers.has('User-Agent')) {
-		headers.set('User-Agent', 'node-fetch');
-	}
-
-	// HTTP-network-or-cache fetch step 2.15
-	if (request.compress && !headers.has('Accept-Encoding')) {
-		headers.set('Accept-Encoding', 'gzip,deflate,br');
-	}
+const blockstore_fs_node_modules_multiformats_src_cid_encodeCID = (version, code, multihash) => {
+  const codeOffset = blockstore_fs_node_modules_multiformats_src_varint_encodingLength(version)
+  const hashOffset = codeOffset + blockstore_fs_node_modules_multiformats_src_varint_encodingLength(code)
+  const bytes = new Uint8Array(hashOffset + multihash.byteLength)
+  blockstore_fs_node_modules_multiformats_src_varint_encodeTo(version, bytes, 0)
+  blockstore_fs_node_modules_multiformats_src_varint_encodeTo(code, bytes, codeOffset)
+  bytes.set(multihash, hashOffset)
+  return bytes
+}
 
-	let {agent} = request;
-	if (typeof agent === 'function') {
-		agent = agent(parsedURL);
-	}
+const blockstore_fs_node_modules_multiformats_src_cid_cidSymbol = Symbol.for('@ipld/js-cid/CID')
 
-	if (!headers.has('Connection') && !agent) {
-		headers.set('Connection', 'close');
-	}
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/dist/src/sharding.js
 
-	// HTTP-network fetch step 4.2
-	// chunked encoding is handled by Node.js
-
-	const search = getSearch(parsedURL);
-
-	// Manually spread the URL object instead of spread syntax
-	const requestOptions = {
-		path: parsedURL.pathname + search,
-		pathname: parsedURL.pathname,
-		hostname: parsedURL.hostname,
-		protocol: parsedURL.protocol,
-		port: parsedURL.port,
-		hash: parsedURL.hash,
-		search: parsedURL.search,
-		// @ts-ignore - it does not has a query 
-		query: parsedURL.query,
-		href: parsedURL.href,
-		method: request.method,
-		// @ts-ignore - not sure what this supposed to do
-		headers: headers[Symbol.for('nodejs.util.inspect.custom')](),
-		insecureHTTPParser: request.insecureHTTPParser,
-		agent
-	};
 
-	return requestOptions;
-};
 
 /**
- * AbortError interface for cancelled requests
+ * A sharding strategy that takes the last few characters of a multibase encoded
+ * CID and uses them as the directory to store the block in. This prevents
+ * storing all blocks in a single directory which would overwhelm most
+ * filesystems.
  */
-class AbortError extends FetchBaseError {
-	/**
-	 * @param {string} message 
-	 * @param {string} [type]
-	 */
-	constructor(message, type = 'aborted') {
-		super(message, type);
-	}
+class NextToLast {
+    extension;
+    prefixLength;
+    base;
+    constructor(init = {}) {
+        this.extension = init.extension ?? '.data';
+        this.prefixLength = init.prefixLength ?? 2;
+        this.base = init.base ?? blockstore_fs_node_modules_multiformats_src_bases_base32_base32upper;
+    }
+    encode(cid) {
+        const str = this.base.encoder.encode(cid.multihash.bytes);
+        const prefix = str.substring(str.length - this.prefixLength);
+        return {
+            dir: prefix,
+            file: `${str}${this.extension}`
+        };
+    }
+    decode(str) {
+        let fileName = external_node_path_namespaceObject.basename(str);
+        if (fileName.endsWith(this.extension)) {
+            fileName = fileName.substring(0, fileName.length - this.extension.length);
+        }
+        return blockstore_fs_node_modules_multiformats_src_cid_CID.decode(this.base.decoder.decode(fileName));
+    }
 }
-
 /**
- * Index.js
- *
- * a request API compatible with window.fetch
- *
- * All spec algorithm step numbers are based on https://fetch.spec.whatwg.org/commit-snapshots/ae716822cb3a61843226cd090eefc6589446c1d2/.
+ * A sharding strategy that does not do any sharding and stores all files
+ * in one directory. Only for testing, do not use in production.
  */
-
-const supportedSchemas = new Set(['data:', 'http:', 'https:']);
-
+class FlatDirectory {
+    extension;
+    base;
+    constructor(init = {}) {
+        this.extension = init.extension ?? '.data';
+        this.base = init.base ?? base32upper;
+    }
+    encode(cid) {
+        const str = this.base.encoder.encode(cid.multihash.bytes);
+        return {
+            dir: '',
+            file: `${str}${this.extension}`
+        };
+    }
+    decode(str) {
+        let fileName = path.basename(str);
+        if (fileName.endsWith(this.extension)) {
+            fileName = fileName.substring(0, fileName.length - this.extension.length);
+        }
+        return CID.decode(this.base.decoder.decode(fileName));
+    }
+}
+//# sourceMappingURL=sharding.js.map
+;// CONCATENATED MODULE: ./node_modules/blockstore-fs/dist/src/index.js
 /**
- * Fetch function
+ * @packageDocumentation
  *
- * @param   {string | URL | import('./request').default} url - Absolute url or Request instance
- * @param   {RequestInit} [options_] - Fetch options
- * @return  {Promise}
- */
-async function fetch(url, options_ = {}) {
-	return new Promise((resolve, reject) => {
-		// Build request object
-		const request = new Request(url, options_);
-		const options = getNodeRequestOptions(request);
-		if (!supportedSchemas.has(options.protocol)) {
-			throw new TypeError(`node-fetch cannot load ${url}. URL scheme "${options.protocol.replace(/:$/, '')}" is not supported.`);
-		}
-
-		if (options.protocol === 'data:') {
-			const data = dataUriToBuffer(request.url.toString());
-			const response = new Response(data, {headers: {'Content-Type': data.typeFull}});
-			resolve(response);
-			return;
-		}
-
-		// Wrap http.request into fetch
-		const send = (options.protocol === 'https:' ? https : http).request;
-		const {signal} = request;
-		/** @type {Response|null} */
-		let response = null;
-		/** @type {import('http').IncomingMessage|null} */
-		let response_ = null;
-
-		const abort = () => {
-			const error = new AbortError('The operation was aborted.');
-			reject(error);
-			if (request.body) {
-				request.body.cancel(error);
-			}
+ * A Blockstore implementation that stores blocks in the local filesystem.
+ *
+ * @example
+ *
+ * ```js
+ * import { FsBlockstore } from 'blockstore-fs'
+ *
+ * const store = new FsBlockstore('path/to/store')
+ * ```
+ */
 
-			if (!response_) {
-				return;
-			}
 
-			response_.emit('error', error);
-		};
 
-		if (signal && signal.aborted) {
-			abort();
-			return;
-		}
 
-		const abortAndFinalize = () => {
-			abort();
-			finalize();
-		};
+// @ts-expect-error no types
 
-		// Send request
-		const request_ = send(options);
 
-		if (signal) {
-			signal.addEventListener('abort', abortAndFinalize);
-		}
 
-		const finalize = () => {
-			request_.abort();
-			if (signal) {
-				signal.removeEventListener('abort', abortAndFinalize);
-			}
-		};
 
-		request_.on('error', err => {
-			// @ts-expect-error - err may not be SystemError
-			reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
-			finalize();
-		});
 
-		fixResponseChunkedTransferBadEnding(request_, err => {
-			if (signal && signal.aborted) {
-				return
-			}
+const writeAtomic = (0,external_node_util_.promisify)(fast_write_atomic);
+/**
+ * Write a file atomically
+ */
+async function writeFile(file, contents) {
+    try {
+        await writeAtomic(file, contents);
+    }
+    catch (err) {
+        if (err.code === 'EPERM' && err.syscall === 'rename') {
+            // fast-write-atomic writes a file to a temp location before renaming it.
+            // On Windows, if the final file already exists this error is thrown.
+            // No such error is thrown on Linux/Mac
+            // Make sure we can read & write to this file
+            await external_node_fs_promises_namespaceObject.access(file, external_node_fs_promises_namespaceObject.constants.F_OK | external_node_fs_promises_namespaceObject.constants.W_OK);
+            // The file was created by another context - this means there were
+            // attempts to write the same block by two different function calls
+            return;
+        }
+        throw err;
+    }
+}
+/**
+ * A blockstore backed by the file system
+ */
+class FsBlockstore {
+    path;
+    createIfMissing;
+    errorIfExists;
+    putManyConcurrency;
+    getManyConcurrency;
+    deleteManyConcurrency;
+    shardingStrategy;
+    constructor(location, init = {}) {
+        this.path = external_node_path_namespaceObject.resolve(location);
+        this.createIfMissing = init.createIfMissing ?? true;
+        this.errorIfExists = init.errorIfExists ?? false;
+        this.deleteManyConcurrency = init.deleteManyConcurrency ?? 50;
+        this.getManyConcurrency = init.getManyConcurrency ?? 50;
+        this.putManyConcurrency = init.putManyConcurrency ?? 50;
+        this.shardingStrategy = init.shardingStrategy ?? new NextToLast();
+    }
+    async open() {
+        try {
+            await external_node_fs_promises_namespaceObject.access(this.path, external_node_fs_promises_namespaceObject.constants.F_OK | external_node_fs_promises_namespaceObject.constants.W_OK);
+            if (this.errorIfExists) {
+                throw src_Errors.openFailedError(new Error(`Blockstore directory: ${this.path} already exists`));
+            }
+        }
+        catch (err) {
+            if (err.code === 'ENOENT') {
+                if (this.createIfMissing) {
+                    await external_node_fs_promises_namespaceObject.mkdir(this.path, { recursive: true });
+                    return;
+                }
+                else {
+                    throw src_Errors.openFailedError(new Error(`Blockstore directory: ${this.path} does not exist`));
+                }
+            }
+            throw err;
+        }
+    }
+    async close() {
+        await Promise.resolve();
+    }
+    async put(key, val) {
+        const { dir, file } = this.shardingStrategy.encode(key);
+        try {
+            if (dir != null && dir !== '') {
+                await external_node_fs_promises_namespaceObject.mkdir(external_node_path_namespaceObject.join(this.path, dir), {
+                    recursive: true
+                });
+            }
+            await writeFile(external_node_path_namespaceObject.join(this.path, dir, file), val);
+            return key;
+        }
+        catch (err) {
+            throw src_Errors.putFailedError(err);
+        }
+    }
+    async *putMany(source) {
+        yield* src_parallelBatch(blockstore_fs_node_modules_it_map_dist_src(source, ({ cid, block }) => {
+            return async () => {
+                await this.put(cid, block);
+                return cid;
+            };
+        }), this.putManyConcurrency);
+    }
+    async get(key) {
+        const { dir, file } = this.shardingStrategy.encode(key);
+        try {
+            return await external_node_fs_promises_namespaceObject.readFile(external_node_path_namespaceObject.join(this.path, dir, file));
+        }
+        catch (err) {
+            throw src_Errors.notFoundError(err);
+        }
+    }
+    async *getMany(source) {
+        yield* src_parallelBatch(blockstore_fs_node_modules_it_map_dist_src(source, key => {
+            return async () => {
+                return {
+                    cid: key,
+                    block: await this.get(key)
+                };
+            };
+        }), this.getManyConcurrency);
+    }
+    async delete(key) {
+        const { dir, file } = this.shardingStrategy.encode(key);
+        try {
+            await external_node_fs_promises_namespaceObject.unlink(external_node_path_namespaceObject.join(this.path, dir, file));
+        }
+        catch (err) {
+            if (err.code === 'ENOENT') {
+                return;
+            }
+            throw src_Errors.deleteFailedError(err);
+        }
+    }
+    async *deleteMany(source) {
+        yield* src_parallelBatch(blockstore_fs_node_modules_it_map_dist_src(source, key => {
+            return async () => {
+                await this.delete(key);
+                return key;
+            };
+        }), this.deleteManyConcurrency);
+    }
+    /**
+     * Check for the existence of the given key
+     */
+    async has(key) {
+        const { dir, file } = this.shardingStrategy.encode(key);
+        try {
+            await external_node_fs_promises_namespaceObject.access(external_node_path_namespaceObject.join(this.path, dir, file));
+        }
+        catch (err) {
+            return false;
+        }
+        return true;
+    }
+    async *getAll() {
+        const pattern = `**/*${this.shardingStrategy.extension}`
+            .split(external_node_path_namespaceObject.sep)
+            .join('/');
+        const files = dist_src_glob(this.path, pattern, {
+            absolute: true
+        });
+        for await (const file of files) {
+            try {
+                const buf = await external_node_fs_promises_namespaceObject.readFile(file);
+                const pair = {
+                    cid: this.shardingStrategy.decode(file),
+                    block: buf
+                };
+                yield pair;
+            }
+            catch (err) {
+                // if keys are removed from the blockstore while the query is
+                // running, we may encounter missing files.
+                if (err.code !== 'ENOENT') {
+                    throw err;
+                }
+            }
+        }
+    }
+}
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: external "node:os"
+const external_node_os_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:os");
+// EXTERNAL MODULE: external "node:stream"
+var external_node_stream_ = __nccwpck_require__(84492);
+// EXTERNAL MODULE: ./node_modules/@filebase/sdk/node_modules/uuid/dist/index.js
+var uuid_dist = __nccwpck_require__(62888);
+;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/node_modules/uuid/wrapper.mjs
 
-			response_?.emit("error", err);
-		});
+const v1 = uuid_dist.v1;
+const v3 = uuid_dist.v3;
+const v4 = uuid_dist.v4;
+const v5 = uuid_dist.v5;
+const NIL = uuid_dist/* NIL */.zR;
+const version = uuid_dist/* version */.i8;
+const wrapper_validate = uuid_dist/* validate */.Gu;
+const stringify = uuid_dist/* stringify */.Pz;
+const wrapper_parse = uuid_dist/* parse */.Qc;
 
-		/* c8 ignore next 18 */
-		if (parseInt(process.version.substring(1)) < 14) {
-			// Before Node.js 14, pipeline() does not fully support async iterators and does not always
-			// properly handle when the socket close/end events are out of order.
-			request_.on('socket', s => {
-				s.prependListener('close', hadError => {
-					// if a data listener is still present we didn't end cleanly
-					const hasDataListener = s.listenerCount('data') > 0;
-
-					// if end happened before close but the socket didn't emit an error, do it now
-					if (response && hasDataListener && !hadError && !(signal && signal.aborted)) {
-						const err = Object.assign(new Error('Premature close'), {
-							code: 'ERR_STREAM_PREMATURE_CLOSE'
-						});
-						response_?.emit('error', err);
-					}
-				});
-			});
-		}
+;// CONCATENATED MODULE: ./node_modules/@filebase/sdk/dist/index.mjs
 
-		request_.on('response', incoming => {
-			response_ = incoming;
-			request_.setTimeout(0);
-			const headers = fromRawHeaders(response_.rawHeaders);
-
-			// HTTP fetch step 5
-			if (isRedirect(Number(response_.statusCode))) {
-				// HTTP fetch step 5.2
-				const location = headers.get('Location');
-
-				// HTTP fetch step 5.3
-				const locationURL = location === null ? null : new URL(location, request.url);
-
-				// HTTP fetch step 5.5
-				switch (request.redirect) {
-					case 'error':
-						reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));
-						finalize();
-						return;
-					case 'manual':
-						// Node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
-						if (locationURL !== null) {
-							headers.set('Location', locationURL.toString());
-						}
-
-						break;
-					case 'follow': {
-						// HTTP-redirect fetch step 2
-						if (locationURL === null) {
-							break;
-						}
-
-						// HTTP-redirect fetch step 5
-						if (request.counter >= request.follow) {
-							reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
-							finalize();
-							return;
-						}
-
-						// HTTP-redirect fetch step 6 (counter increment)
-						// Create a new Request object.
-						const requestOptions = {
-							headers: new Headers(request.headers),
-							follow: request.follow,
-							counter: request.counter + 1,
-							agent: request.agent,
-							compress: request.compress,
-							method: request.method,
-							// Note: We can not use `request.body` because send would have
-							// consumed it already.
-							body: options_.body,
-							signal: request.signal,
-							size: request.size
-						};
-
-						// HTTP-redirect fetch step 9
-						const isStreamBody =
-							requestOptions.body instanceof blob.ReadableStream ||
-							requestOptions.body instanceof Stream.Readable;
-						if (response_.statusCode !== 303 && isStreamBody) {
-							reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
-							finalize();
-							return;
-						}
-
-						// HTTP-redirect fetch step 11
-						if (response_.statusCode === 303 || ((response_.statusCode === 301 || response_.statusCode === 302) && request.method === 'POST')) {
-							requestOptions.method = 'GET';
-							requestOptions.body = undefined;
-							requestOptions.headers.delete('content-length');
-						}
-
-						// HTTP-redirect fetch step 15
-						fetch(new Request(locationURL.href, requestOptions)).then(resolve, reject);
-						finalize();
-						return;
-					}
-
-					default:
-						return reject(new TypeError(`Redirect option '${request.redirect}' is not a valid value of RequestRedirect`));
-				}
-			}
 
-			// Prepare response
-			if (signal) {
-				response_.once('end', () => {
-					signal.removeEventListener('abort', abortAndFinalize);
-				});
-			}
 
-			let body = Stream.pipeline(response_, new Stream.PassThrough(), reject);
-			// see https://github.com/nodejs/node/pull/29376
-			/* c8 ignore next 3 */
-			if (process.version < 'v12.10') {
-				response_.on('aborted', abortAndFinalize);
-			}
 
-			const responseOptions = {
-				url: request.url,
-				status: response_.statusCode,
-				statusText: response_.statusMessage,
-				headers,
-				size: request.size,
-				counter: request.counter,
-				highWaterMark: request.highWaterMark
-			};
-
-			// HTTP-network fetch step 12.1.1.3
-			const codings = headers.get('Content-Encoding');
-
-			// HTTP-network fetch step 12.1.1.4: handle content codings
-
-			// in following scenarios we ignore compression support
-			// 1. compression support is disabled
-			// 2. HEAD request
-			// 3. no Content-Encoding header
-			// 4. no content response (204)
-			// 5. content not modified response (304)
-			if (!request.compress || request.method === 'HEAD' || codings === null || response_.statusCode === 204 || response_.statusCode === 304) {
-				response = new Response(body, responseOptions);
-				resolve(response);
-				return;
-			}
 
-			// For Node v6+
-			// Be less strict when decoding compressed responses, since sometimes
-			// servers send slightly invalid responses that are still accepted
-			// by common browsers.
-			// Always using Z_SYNC_FLUSH is what cURL does.
-			const zlibOptions = {
-				flush: zlib.Z_SYNC_FLUSH,
-				finishFlush: zlib.Z_SYNC_FLUSH
-			};
-
-			// For gzip
-			if (codings === 'gzip' || codings === 'x-gzip') {
-				body = Stream.pipeline(body, zlib.createGunzip(zlibOptions), reject);
-				response = new Response(fromAsyncIterable(body), responseOptions);
-				resolve(response);
-				return;
-			}
 
-			// For deflate
-			if (codings === 'deflate' || codings === 'x-deflate') {
-				// Handle the infamous raw deflate response from old servers
-				// a hack for old IIS and Apache servers
-				const raw = Stream.pipeline(response_, new Stream.PassThrough(), reject);
-				raw.once('data', chunk => {
-					// See http://stackoverflow.com/questions/37519828
-					if ((chunk[0] & 0x0F) === 0x08) {
-						body = Stream.pipeline(body, zlib.createInflate(), reject);
-					} else {
-						body = Stream.pipeline(body, zlib.createInflateRaw(), reject);
-					}
-
-					response = new Response(fromAsyncIterable(body), responseOptions);
-					resolve(response);
-				});
-				return;
-			}
 
-			// For br
-			if (codings === 'br') {
-				body = Stream.pipeline(body, zlib.createBrotliDecompress(), reject);
-				response = new Response(fromAsyncIterable(body), responseOptions);
-				resolve(response);
-				return;
-			}
 
-			// Otherwise, use response as-is
-			response = new Response(fromAsyncIterable(body), responseOptions);
-			resolve(response);
-		});
 
-		writeToStream(request_, request);
-	});
-}
 
-/**
- * 
- * @param {import('http').ClientRequest} request 
- * @param {(error:Error) => void} errorCallback 
- */
-function fixResponseChunkedTransferBadEnding(request, errorCallback) {
-	/** @type {import('net').Socket} */
-	let socket;
 
-	request.on('socket', s => {
-		socket = s;
-	});
 
-	request.on('response', response => {
 
-		const {headers} = response;
 
-		if (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) {
-			socket.prependListener('close', hadError => {
-				// if a data listener is still present we didn't end cleanly
-				const hasDataListener = socket.listenerCount('data') > 0;
-				if (hasDataListener && !hadError) {
-					const err = Object.assign(new Error('Premature close'), {
-						code: 'ERR_STREAM_PREMATURE_CLOSE'
-					});
-					errorCallback(err);
-				}
-			});
-		}
-	});
+var __accessCheck$4 = (obj, member, msg) => {
+  if (!member.has(obj))
+    throw TypeError("Cannot " + msg);
+};
+var __privateGet$4 = (obj, member, getter) => {
+  __accessCheck$4(obj, member, "read from private field");
+  return getter ? getter.call(obj) : member.get(obj);
+};
+var __privateAdd$4 = (obj, member, value) => {
+  if (member.has(obj))
+    throw TypeError("Cannot add the same private member more than once");
+  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
+};
+var __privateSet$4 = (obj, member, value, setter) => {
+  __accessCheck$4(obj, member, "write to private field");
+  setter ? setter.call(obj, value) : member.set(obj, value);
+  return value;
+};
+var _DEFAULT_ENDPOINT$4, _DEFAULT_REGION$1, _client$4;
+class BucketManager {
+  /**
+   * @summary Creates a new instance of the constructor.
+   * @param {string} clientKey - The access key ID for authentication.
+   * @param {string} clientSecret - The secret access key for authentication.
+   * @tutorial quickstart-bucket
+   * @example
+   * import { BucketManager } from "@filebase/sdk";
+   * const bucketManager = new BucketManager("KEY_FROM_DASHBOARD", "SECRET_FROM_DASHBOARD");
+   */
+  constructor(clientKey, clientSecret) {
+    __privateAdd$4(this, _DEFAULT_ENDPOINT$4, "https://s3.filebase.com");
+    __privateAdd$4(this, _DEFAULT_REGION$1, "us-east-1");
+    __privateAdd$4(this, _client$4, void 0);
+    const clientEndpoint = process.env.NODE_ENV === "test" ? process.env.TEST_S3_ENDPOINT || __privateGet$4(this, _DEFAULT_ENDPOINT$4) : __privateGet$4(this, _DEFAULT_ENDPOINT$4), clientConfiguration = {
+      credentials: {
+        accessKeyId: clientKey,
+        secretAccessKey: clientSecret
+      },
+      endpoint: clientEndpoint,
+      region: __privateGet$4(this, _DEFAULT_REGION$1),
+      forcePathStyle: true
+    };
+    __privateSet$4(this, _client$4, new S3Client(clientConfiguration));
+  }
+  /**
+   * @typedef {Object} bucket
+   * @property {string} Name The name of the bucket
+   * @property {date} Date the bucket was created
+   */
+  /**
+   * @summary Creates a new bucket with the specified name.
+   * @param {string} name - The name of the bucket to create.
+   * @returns {Promise} - A promise that resolves when the bucket is created.
+   * @example
+   * // Create bucket with name of `create-bucket-example`
+   * await bucketManager.create(`create-bucket-example`);
+   */
+  async create(name) {
+    const command = new CreateBucketCommand({
+      Bucket: name
+    });
+    return await __privateGet$4(this, _client$4).send(command);
+  }
+  /**
+   * @summary Lists the buckets in the client.
+   * @returns {Promise>} - A promise that resolves with an array of objects representing the buckets in the client.
+   * @example
+   * // List all buckets
+   * await bucketManager.list();
+   */
+  async list() {
+    const command = new ListBucketsCommand({}), { Buckets } = await __privateGet$4(this, _client$4).send(command);
+    return Buckets;
+  }
+  /**
+   * @summary Deletes the specified bucket.
+   * @param {string} name - The name of the bucket to delete.
+   * @returns {Promise} - A promise that resolves when the bucket is deleted.
+   * @example
+   * // Delete bucket with name of `bucket-name-to-delete`
+   * await bucketManager.delete(`bucket-name-to-delete`);
+   */
+  async delete(name) {
+    const command = new DeleteBucketCommand({
+      Bucket: name
+    });
+    await __privateGet$4(this, _client$4).send(command);
+    return true;
+  }
+  /**
+   * @summary Sets the privacy of a given bucket.
+   * @param {string} name - The name of the bucket to toggle.
+   * @param {boolean} targetState - The new target state. [true=private,false=public]
+   * @returns {Promise} A promise that resolves to true if the bucket was successfully toggled.
+   * @example
+   * // Toggle bucket with label of `toggle-bucket-example`
+   * await bucketManager.setPrivacy(`toggle-bucket-example`, true);  // Enabled
+   * await bucketManager.setPrivacy(`toggle-bucket-example`, false); // Disabled
+   */
+  async setPrivacy(name, targetState) {
+    const command = new PutBucketAclCommand({
+      Bucket: name,
+      ACL: targetState ? "private" : "public-read"
+    });
+    await __privateGet$4(this, _client$4).send(command);
+    return true;
+  }
+  /**
+   * @summary Gets the privacy of a given bucket
+   * @param {string} name - The name of the bucket to query.
+   * @returns {Promise} A promise that resolves to true if the bucket is private.
+   */
+  async getPrivacy(name) {
+    const command = new GetBucketAclCommand({
+      Bucket: name
+    });
+    const response = await __privateGet$4(this, _client$4).send(command), readPermission = response.Grants.find((grant) => {
+      return grant.Grantee.Type === "Group" && grant.Permission === "READ";
+    });
+    return !(typeof readPermission !== "undefined");
+  }
 }
+_DEFAULT_ENDPOINT$4 = new WeakMap();
+_DEFAULT_REGION$1 = new WeakMap();
+_client$4 = new WeakMap();
 
-Object.defineProperty(exports, "Blob", ({
-	enumerable: true,
-	get: function () { return blob.Blob; }
-}));
-Object.defineProperty(exports, "ReadableStream", ({
-	enumerable: true,
-	get: function () { return blob.ReadableStream; }
-}));
-Object.defineProperty(exports, "FormData", ({
-	enumerable: true,
-	get: function () { return formData.FormData; }
-}));
-exports.AbortError = AbortError;
-exports.FetchError = FetchError;
-exports.Headers = Headers;
-exports.Request = Request;
-exports.Response = Response;
-exports["default"] = fetch;
-exports.isRedirect = isRedirect;
-//# sourceMappingURL=index.cjs.map
-
-
-/***/ }),
-
-/***/ 73057:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
+const GATEWAY_DEFAULT_TIMEOUT = 6e4;
+async function downloadFromGateway(cid, options) {
+  if (typeof options.endpoint !== "string") {
+    throw new Error(`Default Gateway must be set`);
+  }
+  const downloadHeaders = {};
+  if (options.token) {
+    downloadHeaders["x-filebase-gateway-token"] = options.token;
+  }
+  const downloadResponse = await lib_axios.request({
+    method: "GET",
+    baseURL: options.endpoint,
+    url: `/ipfs/${cid}`,
+    headers: downloadHeaders,
+    type: "stream",
+    timeout: options?.timeout || GATEWAY_DEFAULT_TIMEOUT
+  });
+  return downloadResponse.data;
+}
+function apiErrorHandler(err) {
+  if (err?.response && err?.response?.status && (err.response.status.toString()[0] === "4" || err.response.status.toString()[0] === "5")) {
+    throw new Error(
+      err.response.data.error?.details || err.response.data.error?.reason || err
+    );
+  }
+  throw err;
+}
 
-Object.defineProperty(exports, "__esModule", ({ value: true }));
+var __accessCheck$3 = (obj, member, msg) => {
+  if (!member.has(obj))
+    throw TypeError("Cannot " + msg);
+};
+var __privateGet$3 = (obj, member, getter) => {
+  __accessCheck$3(obj, member, "read from private field");
+  return getter ? getter.call(obj) : member.get(obj);
+};
+var __privateAdd$3 = (obj, member, value) => {
+  if (member.has(obj))
+    throw TypeError("Cannot add the same private member more than once");
+  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
+};
+var __privateSet$3 = (obj, member, value, setter) => {
+  __accessCheck$3(obj, member, "write to private field");
+  setter ? setter.call(obj, value) : member.set(obj, value);
+  return value;
+};
+var _DEFAULT_ENDPOINT$3, _DEFAULT_TIMEOUT$2, _client$3;
+class GatewayManager {
+  /**
+   * @summary Creates a new instance of the constructor.
+   * @param {string} clientKey - The access key ID for authentication.
+   * @param {string} clientSecret - The secret access key for authentication.
+   * @tutorial quickstart-gateway
+   * @example
+   * import { GatewayManager } from "@filebase/sdk";
+   * const gatewayManager = new GatewayManager("KEY_FROM_DASHBOARD", "SECRET_FROM_DASHBOARD");
+   */
+  constructor(clientKey, clientSecret) {
+    __privateAdd$3(this, _DEFAULT_ENDPOINT$3, "https://api.filebase.io");
+    __privateAdd$3(this, _DEFAULT_TIMEOUT$2, 6e4);
+    __privateAdd$3(this, _client$3, void 0);
+    const clientEndpoint = process.env.NODE_ENV === "test" ? process.env.TEST_GW_ENDPOINT || __privateGet$3(this, _DEFAULT_ENDPOINT$3) : __privateGet$3(this, _DEFAULT_ENDPOINT$3), encodedToken = Buffer.from(`${clientKey}:${clientSecret}`).toString(
+      "base64"
+    ), baseURL = `${clientEndpoint}/v1/gateways`;
+    __privateSet$3(this, _client$3, axios.create({
+      baseURL,
+      timeout: __privateGet$3(this, _DEFAULT_TIMEOUT$2),
+      headers: { Authorization: `Bearer ${encodedToken}` }
+    }));
+  }
+  /**
+   * @typedef {Object} gateway
+   * @property {string} name Name for the gateway
+   * @property {string} domain Custom Domain for the gateway
+   * @property {boolean} enabled Whether the gateway is enabled or not
+   * @property {string} private Whether the gateway is scoped to users content
+   * @property {date} created_at Date the gateway was created
+   * @property {date} updated_at Date the gateway was last updated
+   */
+  /**
+   * @typedef {Object} gatewayOptions
+   * @property {boolean} [domain] Optional Domain to allow for using a Custom Domain
+   * @property {string} [enabled] Optional Toggle to use for enabling the gateway
+   * @property {boolean} [private] Optional Boolean determining if gateway is Public or Private
+   */
+  /**
+   * @summary Creates a gateway with the given name and options
+   * @param {string} name Unique name across entire platform for the gateway.  Must be a valid subdomain name.
+   * @param {gatewayOptions} [options]
+   * @returns {Promise} - A promise that resolves to the value of a gateway.
+   * @example
+   * // Create gateway with name of `create-gateway-example` and a custom domain of `cname.mycustomdomain.com`.
+   * // The custom domain must already exist and have a CNAME record pointed at `create-gateway-example.myfilebase.com`.
+   * await gatewayManager.create(`create-gateway-example`, {
+   *   domain: `cname.mycustomdomain.com`
+   * });
+   */
+  async create(name, options = {}) {
+    try {
+      let createOptions = {
+        name
+      };
+      if (typeof options.domain === "string") {
+        createOptions.domain = options.domain;
+      }
+      if (typeof options.enabled === "boolean") {
+        createOptions.enabled = options.enabled;
+      }
+      if (typeof options.private === "boolean") {
+        createOptions.private = options.private;
+      }
+      const createResponse = await __privateGet$3(this, _client$3).request({
+        method: "POST",
+        data: createOptions
+      });
+      return createResponse.data;
+    } catch (err) {
+      apiErrorHandler(err);
+    }
+  }
+  /**
+   * @summary Deletes a gateway with the given name.
+   * @param {string} name - The name of the gateway to delete.
+   * @returns {Promise} - A promise that resolves to true if the gateway was successfully deleted.
+   * @example
+   * // Delete gateway with name of `delete-gateway-example`
+   * await gatewayManager.delete(`delete-name-example`);
+   */
+  async delete(name) {
+    try {
+      await __privateGet$3(this, _client$3).request({
+        method: "DELETE",
+        url: `/${name}`,
+        validateStatus: (status) => {
+          return status === 204;
+        }
+      });
+      return true;
+    } catch (err) {
+      apiErrorHandler(err);
+    }
+  }
+  /**
+   * @summary Returns the value of a gateway
+   * @param {string} name - Parameter representing the name to get.
+   * @returns {Promise} - A promise that resolves to the value of a gateway.
+   * @example
+   * // Get gateway with name of `gateway-get-example`
+   * await gatewayManager.get(`gateway-get-example`);
+   */
+  async get(name) {
+    try {
+      const getResponse = await __privateGet$3(this, _client$3).request({
+        method: "GET",
+        url: `/${name}`,
+        validateStatus: (status) => {
+          return status === 200 || status === 404;
+        }
+      });
+      return getResponse.status === 200 ? getResponse.data : false;
+    } catch (err) {
+      apiErrorHandler(err);
+    }
+  }
+  /**
+   * @summary Returns a list of gateways
+   * @returns {Promise>} - A promise that resolves to an array of gateways.
+   * @example
+   * // List all gateways
+   * await gatewayManager.list();
+   */
+  async list() {
+    try {
+      const getResponse = await __privateGet$3(this, _client$3).request({
+        method: "GET"
+      });
+      return getResponse.data;
+    } catch (err) {
+      apiErrorHandler(err);
+    }
+  }
+  /**
+   * @summary Updates the specified gateway.
+   * @param {string} name - The name of the gateway to update.
+   * @param {gatewayOptions} options - The options for the update operation.
+   *
+   * @returns {Promise} - A Promise that resolves to true if the gateway was updated.
+   * @example
+   * // Update gateway with name of `update-gateway-example` and set the gateway to only serve CIDs pinned by user.
+   * await gatewayManager.update(`update-gateway-example`, {
+   *   private: true
+   * });
+   */
+  async update(name, options) {
+    try {
+      const updateOptions = {
+        name
+      };
+      if (options?.domain) {
+        updateOptions.domain = String(options.private);
+      }
+      if (options?.enabled) {
+        updateOptions.enabled = Boolean(options.enabled);
+      }
+      if (options?.private) {
+        updateOptions.private = Boolean(options.private);
+      }
+      await __privateGet$3(this, _client$3).request({
+        method: "PUT",
+        url: `/${name}`,
+        data: updateOptions,
+        validateStatus: (status) => {
+          return status === 200;
+        }
+      });
+      return true;
+    } catch (err) {
+      apiErrorHandler(err);
+    }
+  }
+  /**
+   * @summary Toggles the enabled state of a given gateway.
+   * @param {string} name - The name of the gateway to toggle.
+   * @param {boolean} targetState - The new target state.
+   * @returns {Promise} A promise that resolves to true if the gateway was successfully toggled.
+   * @example
+   * // Toggle gateway with label of `toggle-gateway-example`
+   * await gatewayManager.toggle(`toggle-gateway-example`, true);  // Enabled
+   * await gatewayManager.toggle(`toggle-gateway-example`, false); // Disabled
+   */
+  async toggle(name, targetState) {
+    try {
+      await __privateGet$3(this, _client$3).request({
+        method: "PUT",
+        url: `/${name}`,
+        data: {
+          enabled: Boolean(targetState)
+        },
+        validateStatus: (status) => {
+          return status === 200;
+        }
+      });
+      return true;
+    } catch (err) {
+      apiErrorHandler(err);
+    }
+  }
+}
+_DEFAULT_ENDPOINT$3 = new WeakMap();
+_DEFAULT_TIMEOUT$2 = new WeakMap();
+_client$3 = new WeakMap();
 
-var blob = __nccwpck_require__(44883);
+var __accessCheck$2 = (obj, member, msg) => {
+  if (!member.has(obj))
+    throw TypeError("Cannot " + msg);
+};
+var __privateGet$2 = (obj, member, getter) => {
+  __accessCheck$2(obj, member, "read from private field");
+  return getter ? getter.call(obj) : member.get(obj);
+};
+var __privateAdd$2 = (obj, member, value) => {
+  if (member.has(obj))
+    throw TypeError("Cannot add the same private member more than once");
+  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
+};
+var __privateSet$2 = (obj, member, value, setter) => {
+  __accessCheck$2(obj, member, "write to private field");
+  setter ? setter.call(obj, value) : member.set(obj, value);
+  return value;
+};
+var _DEFAULT_ENDPOINT$2, _DEFAULT_TIMEOUT$1, _client$2;
+class NameManager {
+  /**
+   * @summary Creates a new instance of the constructor.
+   * @param {string} clientKey - The access key ID for authentication.
+   * @param {string} clientSecret - The secret access key for authentication.
+   * @tutorial quickstart-name
+   * @example
+   * import { NameManager } from "@filebase/sdk";
+   * const nameManager = new NameManager("KEY_FROM_DASHBOARD", "SECRET_FROM_DASHBOARD");
+   */
+  constructor(clientKey, clientSecret) {
+    __privateAdd$2(this, _DEFAULT_ENDPOINT$2, "https://api.filebase.io");
+    __privateAdd$2(this, _DEFAULT_TIMEOUT$1, 6e4);
+    __privateAdd$2(this, _client$2, void 0);
+    const clientEndpoint = process.env.NODE_ENV === "test" ? process.env.TEST_NAME_ENDPOINT || __privateGet$2(this, _DEFAULT_ENDPOINT$2) : __privateGet$2(this, _DEFAULT_ENDPOINT$2), encodedToken = Buffer.from(`${clientKey}:${clientSecret}`).toString(
+      "base64"
+    ), baseURL = `${clientEndpoint}/v1/names`;
+    __privateSet$2(this, _client$2, lib_axios.create({
+      baseURL,
+      timeout: __privateGet$2(this, _DEFAULT_TIMEOUT$1),
+      headers: { Authorization: `Bearer ${encodedToken}` }
+    }));
+  }
+  /**
+   * @typedef {Object} name
+   * @property {string} label Descriptive label for the Key
+   * @property {string} network_key IPNS Key CID
+   * @property {string} cid Value that name Publishes
+   * @property {number} sequence Version Number for the name
+   * @property {boolean} enabled Whether the name is being Published or not
+   * @property {date} published_at Date the name was last published to the DHT
+   * @property {date} created_at Date the name was created
+   * @property {date} updated_at Date the name was last updated
+   */
+  /**
+   * @typedef {Object} nameOptions
+   * @property {boolean} [enabled] Whether the name is enabled or not.
+   */
+  /**
+   * @summary Creates a new IPNS name with the given name as the label and CID.
+   * @param {string} label - The label of the new IPNS name.
+   * @param {string} cid - The CID of the IPNS name.
+   * @param {nameOptions} [options] - Additional options for the IPNS name.
+   * @returns {Promise} - A Promise that resolves with the response JSON.
+   * @example
+   * // Create IPNS name with label of `create-name-example` and CID of `QmdmQXB2mzChmMeKY47C43LxUdg1NDJ5MWcKMKxDu7RgQm`
+   * await nameManager.create(`create-name-example`, `QmdmQXB2mzChmMeKY47C43LxUdg1NDJ5MWcKMKxDu7RgQm`);
+   */
+  async create(label, cid, options = {
+    enabled: true
+  }) {
+    try {
+      const createResponse = await __privateGet$2(this, _client$2).request({
+        method: "POST",
+        data: {
+          label,
+          cid,
+          enabled: options?.enabled !== false
+        }
+      });
+      return createResponse.data;
+    } catch (err) {
+      apiErrorHandler(err);
+    }
+  }
+  /**
+   * @summary Imports a user's IPNS private key.
+   * @param {string} label - The label for the IPNS name.
+   * @param {string} cid - The CID (Content Identifier) of the data.
+   * @param {string} privateKey - The existing private key encoded in Base64.
+   * @param {nameOptions} [options] - Additional options for the IPNS name.
+   * @returns {Promise} - A Promise that resolves to the server response.
+   * @example
+   * // Import IPNS private key with label of `create-name-example`, CID of `QmdmQXB2mzChmMeKY47C43LxUdg1NDJ5MWcKMKxDu7RgQm`
+   * // and a private key encoded with base64
+   * await nameManager.import(
+   *  `create-name-example`,
+   *  `QmdmQXB2mzChmMeKY47C43LxUdg1NDJ5MWcKMKxDu7RgQm`
+   *  `BASE64_ENCODED_PRIVATEKEY`
+   * );
+   */
+  async import(label, cid, privateKey, options = {
+    enabled: true
+  }) {
+    try {
+      const importResponse = await __privateGet$2(this, _client$2).request({
+        method: "POST",
+        data: {
+          label,
+          cid,
+          network_private_key: privateKey,
+          enabled: options?.enabled !== false
+        }
+      });
+      return importResponse.data;
+    } catch (err) {
+      apiErrorHandler(err);
+    }
+  }
+  /**
+   * @summary Updates the specified name with the given CID.
+   * @param {string} label - The label of the name to update.
+   * @param {string} cid - The cid to associate with the name.
+   * @param {nameOptions} options - The options for the set operation.
+   *
+   * @returns {Promise} - A Promise that resolves to true if the IPNS name was updated.
+   * @example
+   * // Update name with label of `update-name-example` and set the value of the IPNS name.
+   * await nameManager.update(`update-name-example`, `bafybeidt4nmaci476lyon2mvgfmwyzysdazienhxs2bqnfpdainzjuwjom`);
+   */
+  async update(label, cid, options = {}) {
+    try {
+      const updateOptions = {
+        cid
+      };
+      if (options?.enabled) {
+        updateOptions.enabled = Boolean(options.enabled);
+      }
+      await __privateGet$2(this, _client$2).request({
+        method: "PUT",
+        url: `/${label}`,
+        data: updateOptions,
+        validateStatus: (status) => {
+          return status === 200;
+        }
+      });
+      return true;
+    } catch (err) {
+      apiErrorHandler(err);
+    }
+  }
+  /**
+   * @summary Returns the value of an IPNS name
+   * @param {string} label - Parameter representing the label of the name to resolve.
+   * @returns {Promise} - A promise that resolves to the value of a name.
+   * @example
+   * // Get IPNS name with label of `list-name-example`
+   * await nameManager.get(`list-name-example`);
+   */
+  async get(label) {
+    try {
+      const getResponse = await __privateGet$2(this, _client$2).request({
+        method: "GET",
+        url: `/${label}`,
+        validateStatus: (status) => {
+          return status === 200 || status === 404;
+        }
+      });
+      return getResponse.status === 200 ? getResponse.data : false;
+    } catch (err) {
+      apiErrorHandler(err);
+    }
+  }
+  /**
+   * @summary Returns a list of IPNS names
+   * @returns {Promise>} - A promise that resolves to an array of names.
+   * @example
+   * // List all IPNS names
+   * await nameManager.list();
+   */
+  async list() {
+    try {
+      const listResponse = await __privateGet$2(this, _client$2).request({
+        method: "GET"
+      });
+      return listResponse.data;
+    } catch (err) {
+      apiErrorHandler(err);
+    }
+  }
+  /**
+   * @summary Deletes an IPNS name with the given label.
+   * @param {string} label - The label of the IPNS name to delete.
+   * @returns {Promise} - A promise that resolves to true if the IPNS name was successfully deleted.
+   * @example
+   * // List IPNS name with label of `delete-name-example`
+   * await nameManager.delete(`delete-name-example`);
+   */
+  async delete(label) {
+    try {
+      await __privateGet$2(this, _client$2).request({
+        method: "DELETE",
+        url: `/${label}`,
+        validateStatus: (status) => {
+          return status === 204;
+        }
+      });
+      return true;
+    } catch (err) {
+      apiErrorHandler(err);
+    }
+  }
+  /**
+   * @summary Toggles the enabled state of a given IPNS name.
+   * @param {string} label - The label of the IPNS name to toggle.
+   * @param {boolean} targetState - The new target state.
+   * @returns {Promise} A promise that resolves to true if the IPNS name was successfully toggled.
+   * @example
+   * // Toggle IPNS name with label of `toggle-name-example`
+   * await nameManager.toggle(`toggle-name-example`, true);  // Enabled
+   * await nameManager.toggle(`toggle-name-example`, false); // Disabled
+   */
+  async toggle(label, targetState) {
+    try {
+      await __privateGet$2(this, _client$2).request({
+        method: "PUT",
+        url: `/${label}`,
+        data: {
+          enabled: targetState
+        },
+        validateStatus: (status) => {
+          return status === 200;
+        }
+      });
+      return true;
+    } catch (err) {
+      apiErrorHandler(err);
+    }
+  }
+}
+_DEFAULT_ENDPOINT$2 = new WeakMap();
+_DEFAULT_TIMEOUT$1 = new WeakMap();
+_client$2 = new WeakMap();
 
-/**
- * @implements {globalThis.File}
- */
-class File extends blob.Blob {
+var __accessCheck$1 = (obj, member, msg) => {
+  if (!member.has(obj))
+    throw TypeError("Cannot " + msg);
+};
+var __privateGet$1 = (obj, member, getter) => {
+  __accessCheck$1(obj, member, "read from private field");
+  return getter ? getter.call(obj) : member.get(obj);
+};
+var __privateAdd$1 = (obj, member, value) => {
+  if (member.has(obj))
+    throw TypeError("Cannot add the same private member more than once");
+  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
+};
+var __privateSet$1 = (obj, member, value, setter) => {
+  __accessCheck$1(obj, member, "write to private field");
+  setter ? setter.call(obj, value) : member.set(obj, value);
+  return value;
+};
+var __privateMethod$1 = (obj, member, method) => {
+  __accessCheck$1(obj, member, "access private method");
+  return method;
+};
+var _DEFAULT_ENDPOINT$1, _DEFAULT_REGION, _DEFAULT_MAX_CONCURRENT_UPLOADS, _client$1, _credentials$1, _defaultBucket$1, _gatewayConfiguration$1, _maxConcurrentUploads, _routeDownload, routeDownload_fn;
+class ObjectManager {
+  /**
+   * @typedef {Object} objectManagerOptions Optional settings for the constructor.
+   * @property {string} [bucket] Default bucket to use.
+   * @property {objectDownloadOptions} [gateway] Default gateway to use.
+   * @property {number} [maxConcurrentUploads] The maximum number of concurrent uploads.
+   */
+  /**
+   * @typedef {Object} objectDownloadOptions Optional settings for downloading objects
+   * @property {string} endpoint Default gateway to use.
+   * @property {string} [token] Token for the default gateway.
+   * @property {number} [timeout=60000] Timeout for the default gateway
+   */
+  /**
+   * @summary Creates a new instance of the constructor.
+   * @param {string} clientKey - The access key ID for authentication.
+   * @param {string} clientSecret - The secret access key for authentication.
+   * @param {objectManagerOptions} options - Optional settings for the constructor.
+   * @tutorial quickstart-object
+   * @example
+   * import { ObjectManager } from "@filebase/sdk";
+   * const objectManager = new ObjectManager("KEY_FROM_DASHBOARD", "SECRET_FROM_DASHBOARD", {
+   *   bucket: "my-default-bucket",
+   *   maxConcurrentUploads: 4,
+   *   gateway: {
+   *     endpoint: "https://my-default-gateway.mydomain.com
+   *     token: SUPER_SECRET_GATEWAY_TOKEN
+   *   }
+   * });
+   */
+  constructor(clientKey, clientSecret, options) {
+    __privateAdd$1(this, _routeDownload);
+    __privateAdd$1(this, _DEFAULT_ENDPOINT$1, "https://s3.filebase.com");
+    __privateAdd$1(this, _DEFAULT_REGION, "us-east-1");
+    __privateAdd$1(this, _DEFAULT_MAX_CONCURRENT_UPLOADS, 4);
+    __privateAdd$1(this, _client$1, void 0);
+    __privateAdd$1(this, _credentials$1, void 0);
+    __privateAdd$1(this, _defaultBucket$1, void 0);
+    __privateAdd$1(this, _gatewayConfiguration$1, void 0);
+    __privateAdd$1(this, _maxConcurrentUploads, void 0);
+    const clientEndpoint = process.env.NODE_ENV === "test" ? process.env.TEST_S3_ENDPOINT || __privateGet$1(this, _DEFAULT_ENDPOINT$1) : __privateGet$1(this, _DEFAULT_ENDPOINT$1), clientConfiguration = {
+      credentials: {
+        accessKeyId: clientKey,
+        secretAccessKey: clientSecret
+      },
+      endpoint: clientEndpoint,
+      region: __privateGet$1(this, _DEFAULT_REGION),
+      forcePathStyle: true
+    };
+    __privateSet$1(this, _defaultBucket$1, options?.bucket);
+    __privateSet$1(this, _maxConcurrentUploads, options?.maxConcurrentUploads || __privateGet$1(this, _DEFAULT_MAX_CONCURRENT_UPLOADS));
+    __privateSet$1(this, _credentials$1, {
+      key: clientKey,
+      secret: clientSecret
+    });
+    __privateSet$1(this, _client$1, new dist_cjs.S3Client(clientConfiguration));
+    __privateSet$1(this, _gatewayConfiguration$1, {
+      endpoint: options?.gateway?.endpoint,
+      token: options?.gateway?.token,
+      timeout: options?.gateway?.timeout
+    });
+  }
+  /**
+   * @typedef {Object} objectOptions
+   * @property {string} [bucket] - The bucket to pin the IPFS CID into.
+   */
+  /**
+   * @typedef {Object} objectHeadResult
+   * @property {string} cid The CID of the uploaded object
+   * @property {function} download Convenience function to download the object via S3 or the selected gateway
+   * @property {array} [entries] If a directory then returns an array of the containing objects
+   * @property {string} entries.cid The CID of the uploaded object
+   * @property {string} entries.path The path of the object
+   */
   /**
+   * If the source parameter is an array of objects, it will pack multiple files into a CAR file for upload.
+   * The method returns a Promise that resolves to an object containing the CID (Content Identifier) of the uploaded file
+   * and an optional entries object when uploading a CAR file.
    *
-   * @param {BlobPart[]} init
-   * @param {string} name - A USVString representing the file name or the path
-   * to the file.
-   * @param {FilePropertyBag} [options]
+   * @summary Uploads a file or a CAR file to the specified bucket.
+   * @param {string} key - The key or path of the file in the bucket.
+   * @param {Buffer|ReadableStream|Array} source - The content of the object to be uploaded.
+   *    If an array of files is provided, each file should have a 'path' property specifying the path of the file
+   *    and a 'content' property specifying the content of the file.  The SDK will then construct a CAR file locally
+   *    and use that as the content of the object to be uploaded.
+   * @param {Object} [metadata] Optional metadata for pin object
+   * @param {objectOptions} [options] - The options for uploading the object.
+   * @returns {Promise}
+   * @example
+   * // Upload Object
+   * await objectManager.upload("my-object", Buffer.from("Hello World!"));
+   * // Upload Object with Metadata
+   * await objectManager.upload("my-custom-object", Buffer.from("Hello Big World!"), {
+   *   "application": "my-filebase-app"
+   * });
+   * // Upload Directory
+   * await objectManager.upload("my-first-directory", [
+   *  {
+   *   path: "/testObjects/1.txt",
+   *   content: Buffer.from("upload test object", "utf-8"),
+   *  },
+   *  {
+   *   path: "/testObjects/deep/1.txt",
+   *   content: Buffer.from("upload deep test object", "utf-8"),
+   *  },
+   *  {
+   *   path: "/topLevel.txt",
+   *   content: Buffer.from("upload top level test object", "utf-8"),
+   *  },
+   * ]);
    */
-  constructor(
-    init,
-    name = panic(new TypeError("File constructor requires name argument")),
-    options = {}
-  ) {
-    super(init, options);
-    // Per File API spec https://w3c.github.io/FileAPI/#file-constructor
-    // Every "/" character of file name must be replaced with a ":".
-    /** @private */
-    this._name = name;
-    // It appears that browser do not follow the spec here.
-    // String(name).replace(/\//g, ":")
-    /** @private */
-    this._lastModified = options.lastModified || Date.now();
+  async upload(key, source, metadata, options) {
+    const uploadUUID = v4();
+    const bucket = options?.bucket || __privateGet$1(this, _defaultBucket$1), uploadOptions = {
+      client: __privateGet$1(this, _client$1),
+      params: {
+        Bucket: bucket,
+        Key: key,
+        Body: source,
+        Metadata: metadata || {}
+      },
+      queueSize: __privateGet$1(this, _maxConcurrentUploads),
+      partSize: 26843546
+      //25.6Mb || 250Gb Max File Size
+    };
+    let parsedEntries = {};
+    if (Array.isArray(source)) {
+      uploadOptions.params.Metadata = {
+        ...uploadOptions.params.Metadata,
+        import: "car"
+      };
+      let temporaryCarFilePath, temporaryBlockstoreDir;
+      try {
+        temporaryBlockstoreDir = external_node_path_namespaceObject.resolve(
+          external_node_os_namespaceObject.tmpdir(),
+          "filebase-sdk",
+          "uploads",
+          uploadUUID
+        );
+        temporaryCarFilePath = `${temporaryBlockstoreDir}/main.car`;
+        await (0,external_node_fs_promises_namespaceObject.mkdir)(temporaryBlockstoreDir, { recursive: true });
+        const temporaryBlockstore = new FsBlockstore(temporaryBlockstoreDir);
+        const heliaFs = unixfs({
+          blockstore: temporaryBlockstore
+        });
+        for (let sourceEntry of source) {
+          sourceEntry.path = sourceEntry.path[0] === "/" ? `/${uploadUUID}${sourceEntry.path}` : `/${uploadUUID}/${sourceEntry.path}`;
+        }
+        for await (const entry of heliaFs.addAll(source)) {
+          parsedEntries[entry.path] = entry;
+        }
+        const rootEntry = parsedEntries[uploadUUID];
+        const carExporter = car({ blockstore: temporaryBlockstore }), { writer, out } = CarWriter.create([rootEntry.cid]);
+        const output = (0,external_node_fs_namespaceObject.createWriteStream)(temporaryCarFilePath);
+        external_node_stream_.Readable.from(out).pipe(output);
+        await carExporter.export(rootEntry.cid, writer);
+        uploadOptions.params.Body = (0,external_node_fs_namespaceObject.createReadStream)(temporaryCarFilePath);
+        const parallelUploads3 = new lib_storage_dist_cjs.Upload(uploadOptions);
+        await parallelUploads3.done();
+        await temporaryBlockstore.close();
+      } finally {
+        if (typeof temporaryBlockstoreDir !== "undefined") {
+          await (0,external_node_fs_promises_namespaceObject.rm)(temporaryBlockstoreDir, { recursive: true, force: true });
+        }
+      }
+    } else {
+      const parallelUploads3 = new lib_storage_dist_cjs.Upload(uploadOptions);
+      await parallelUploads3.done();
+    }
+    const command = new dist_cjs.HeadObjectCommand({
+      Bucket: bucket,
+      Key: key,
+      Body: source
+    }), headResult = await __privateGet$1(this, _client$1).send(command), responseCid = headResult.Metadata.cid;
+    if (Object.keys(parsedEntries).length === 0) {
+      return {
+        cid: responseCid,
+        download: () => {
+          return __privateMethod$1(this, _routeDownload, routeDownload_fn).call(this, responseCid, key, options);
+        }
+      };
+    }
+    return {
+      cid: responseCid,
+      download: () => {
+        return __privateMethod$1(this, _routeDownload, routeDownload_fn).call(this, responseCid, key, options);
+      },
+      entries: parsedEntries
+    };
   }
-
   /**
-   * The name of the file referenced by the File object.
-   * @type {string}
+   * @summary Gets an objects info and metadata using the S3 API.
+   * @param {string} key - The key of the object to be inspected.
+   * @param {objectOptions} [options] - The options for inspecting the object.
+   * @returns {Promise}
    */
-  get name() {
-    return this._name
+  async get(key, options) {
+    const bucket = options?.bucket || __privateGet$1(this, _defaultBucket$1);
+    try {
+      const command = new dist_cjs.HeadObjectCommand({
+        Bucket: bucket,
+        Key: key
+      }), response = await __privateGet$1(this, _client$1).send(command);
+      response.download = () => {
+        return __privateMethod$1(this, _routeDownload, routeDownload_fn).call(this, response.Metadata.cid, key, options);
+      };
+      return response;
+    } catch (err) {
+      if (err.name === "NotFound") {
+        return false;
+      }
+      throw err;
+    }
   }
-
   /**
-   * The path the URL of the File is relative to.
-   * @type {string}
+   * @summary Downloads an object from the specified bucket using the provided key.
+   * @param {string} key - The key of the object to be downloaded.
+   * @param {objectOptions} [options] - The options for downloading the object..
+   * @returns {Promise} - A promise that resolves with the contents of the downloaded object as a Stream.
+   * @example
+   * // Download object with name of `download-object-example`
+   * await objectManager.download(`download-object-example`);
    */
-  get webkitRelativePath() {
-    return ""
+  async download(key, options) {
+    if (typeof __privateGet$1(this, _gatewayConfiguration$1).endpoint === "string") {
+      const objectToFetch = await this.get(key, options);
+      return objectToFetch.download();
+    } else {
+      const command = new dist_cjs.GetObjectCommand({
+        Bucket: options?.bucket || __privateGet$1(this, _defaultBucket$1),
+        Key: key
+      }), response = await __privateGet$1(this, _client$1).send(command);
+      return response.Body;
+    }
   }
-
   /**
-   * Returns the last modified time of the file, in millisecond since the UNIX
-   * epoch (January 1st, 1970 at Midnight).
-   * @returns {number}
+   * @typedef {Object} listObjectsResult
+   * @property {boolean} IsTruncated Indicates if more results exist on the server
+   * @property {string} NextContinuationToken ContinuationToken used to paginate list requests
+   * @property {Array} Contents List of Keys stored in the S3 Bucket
+   * @property {string} Contents.Key Key of the Object
+   * @property {string} Contents.LastModified Date Last Modified of the Object
+   * @property {string} Contents.CID CID of the Object
+   * @property {string} Contents.ETag ETag of the Object
+   * @property {number} Contents.Size Size in Bytes of the Object
+   * @property {string} Contents.StorageClass Class of Storage of the Object
+   * @property {function} Contents.download Convenience function to download the item using the S3 gateway
    */
-  get lastModified() {
-    return this._lastModified
-  }
-
-  get [Symbol.toStringTag]() {
-    return "File"
-  }
-}
-
-/**
- * @param {*} error
- * @returns {never}
- */
-const panic = error => {
-  throw error
-};
-
-exports.File = File;
-//# sourceMappingURL=file.cjs.map
-
-
-/***/ }),
-
-/***/ 96614:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-
-var blob = __nccwpck_require__(44883);
-var file = __nccwpck_require__(73057);
-
-// Electron-renderer should get the browser implementation instead of node
-// Browser configuration is not enough
-
-// Marking export as a DOM File object instead of custom class.
-/** @type {typeof globalThis.File} */
-const File = typeof globalThis.File === "function" ? globalThis.File : file.File;
-
-Object.defineProperty(exports, "Blob", ({
-	enumerable: true,
-	get: function () {
-		return blob.Blob;
-	}
-}));
-exports.File = File;
-//# sourceMappingURL=lib.node.cjs.map
-
-
-/***/ }),
-
-/***/ 49215:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-
-/**
- * @implements {globalThis.FormData}
- */
-class FormData {
   /**
-   * @param {HTMLFormElement} [form]
+   * @typedef {Object} listObjectOptions
+   * @property {string} [Bucket] The name of the bucket. If not provided, the default bucket will be used.
+   * @property {string} [ContinuationToken=null] Continues listing from this objects name.
+   * @property {string} [Delimiter=null] Character used to group keys
+   * @property {number} [MaxKeys=1000] The maximum number of objects to retrieve. Defaults to 1000.
    */
-  constructor(form) {
-    if (form !== undefined) {
-      const error = isHTMLFormElement(form)
-        ? new TypeError(
-            "FormData constructor: HTMLFormElement parameter is not supported, if you need it submit an issue"
-          )
-        : new TypeError(
-            "FormData constructor: Argument 1 does not implement interface HTMLFormElement."
-          );
-
-      throw error
+  /**
+   * Retrieves a list of objects from a specified bucket.
+   *
+   * @param {listObjectOptions} options - The options for listing objects.
+   * @returns {Promise} - A promise that resolves to an array of objects.
+   * @example
+   * // List objects in bucket with a limit of 1000
+   * await objectManager.list({
+   *   MaxKeys: 1000
+   * });
+   */
+  async list(options = {
+    Bucket: __privateGet$1(this, _defaultBucket$1),
+    ContinuationToken: null,
+    Delimiter: null,
+    MaxKeys: 1e3
+  }) {
+    if (options?.MaxKeys && options.MaxKeys > 1e5) {
+      throw new Error(`MaxKeys Maximum value is 100000`);
     }
-
-    /**
-     * @private
-     * @readonly
-     * @type {Array<[string, FormDataEntryValue]>}
-     */
-    this._entries = [];
-
-    Object.defineProperty(this, "_entries", { enumerable: false });
+    const bucket = options?.Bucket || __privateGet$1(this, _defaultBucket$1), limit = options?.MaxKeys || 1e3, commandOptions = {
+      Bucket: bucket,
+      MaxKeys: limit
+    }, command = new dist_cjs.ListObjectsV2Command({
+      ...options,
+      ...commandOptions
+    });
+    const { Contents, IsTruncated, NextContinuationToken } = await __privateGet$1(this, _client$1).send(command);
+    return { Contents, IsTruncated, NextContinuationToken };
   }
-  get [Symbol.toStringTag]() {
-    return "FormData"
+  /**
+   * @summary Deletes an object from the specified bucket using the provided key.
+   * @param {string} key - The key of the object to be deleted.
+   * @param {objectOptions} [options] - The options for deleting the file.
+   * @returns {Promise} - A Promise that resolves with the result of the delete operation.
+   * @example
+   * // Delete object with name of `delete-object-example`
+   * await objectManager.delete(`delete-object-example`);
+   */
+  async delete(key, options) {
+    const command = new dist_cjs.DeleteObjectCommand({
+      Bucket: options?.bucket || __privateGet$1(this, _defaultBucket$1),
+      Key: key
+    });
+    await __privateGet$1(this, _client$1).send(command);
+    return true;
   }
-
   /**
-   * Appends a new value onto an existing key inside a FormData object, or adds
-   * the key if it does not already exist.
+   * @typedef {Object} copyObjectOptions
+   * @property {string} [sourceBucket] The source bucket from where the object is to be copied.
+   * @property {string} [destinationKey] The key of the object in the destination bucket. By default, it is the same as the sourceKey.
+   */
+  /**
+   * If the destinationKey is not provided, the object will be copied with the same key as the sourceKey.
    *
-   * The difference between `set` and `append` is that if the specified key
-   * already exists, `set` will overwrite all existing values with the new one,
-   * whereas `append` will append the new value onto the end of the existing
-   * set of values.
+   * @summary Copy the object from sourceKey in the sourceBucket to destinationKey in the destinationBucket.
+   * @param {string} sourceKey - The key of the object to be copied from the sourceBucket.
+   * @param {string} destinationBucket - The bucket where the object will be copied to.
+   * @param {copyObjectOptions} [options] - Additional options for the copy operation.
    *
-   * @param {string} name
-   * @param {string|Blob|File} value - The name of the field whose data is
-   * contained in value.
-   * @param {string} [filename] - The filename reported to the server, when a
-   * value is a `Blob` or a `File`. The default filename for a `Blob` objects is
-   * `"blob"`. The default filename for a `File` is the it's name.
+   * @returns {Promise} - A Promise that resolves with the result of the copy operation.
+   * @example
+   * // Copy object `copy-object-test` from `copy-object-test-pass-src` to `copy-object-test-pass-dest`
+   * // TIP: Set bucket on constructor and it will be used as the default source for copying objects.
+   * await objectManager.copy(`copy-object-test`, `copy-object-dest`, {
+   *   sourceBucket: `copy-object-src`
+   * });
    */
-  append(
-    name,
-    value = panic(
-      new TypeError("FormData.append: requires at least 2 arguments")
-    ),
-    filename
-  ) {
-    this._entries.push([name, toEntryValue(value, filename)]);
+  async copy(sourceKey, destinationBucket, options = {
+    sourceBucket: __privateGet$1(this, _defaultBucket$1),
+    destinationKey: void 0
+  }) {
+    const copySource = `${options?.sourceBucket || __privateGet$1(this, _defaultBucket$1)}/${sourceKey}`, command = new dist_cjs.CopyObjectCommand({
+      CopySource: copySource,
+      Bucket: destinationBucket,
+      Key: options?.destinationKey || sourceKey
+    });
+    await __privateGet$1(this, _client$1).send(command);
+    return true;
   }
+}
+_DEFAULT_ENDPOINT$1 = new WeakMap();
+_DEFAULT_REGION = new WeakMap();
+_DEFAULT_MAX_CONCURRENT_UPLOADS = new WeakMap();
+_client$1 = new WeakMap();
+_credentials$1 = new WeakMap();
+_defaultBucket$1 = new WeakMap();
+_gatewayConfiguration$1 = new WeakMap();
+_maxConcurrentUploads = new WeakMap();
+_routeDownload = new WeakSet();
+routeDownload_fn = async function(cid, key, options) {
+  return typeof __privateGet$1(this, _gatewayConfiguration$1).endpoint !== "undefined" ? downloadFromGateway(cid, __privateGet$1(this, _gatewayConfiguration$1)) : this.download(key, options);
+};
 
+var __accessCheck = (obj, member, msg) => {
+  if (!member.has(obj))
+    throw TypeError("Cannot " + msg);
+};
+var __privateGet = (obj, member, getter) => {
+  __accessCheck(obj, member, "read from private field");
+  return getter ? getter.call(obj) : member.get(obj);
+};
+var __privateAdd = (obj, member, value) => {
+  if (member.has(obj))
+    throw TypeError("Cannot add the same private member more than once");
+  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
+};
+var __privateSet = (obj, member, value, setter) => {
+  __accessCheck(obj, member, "write to private field");
+  setter ? setter.call(obj, value) : member.set(obj, value);
+  return value;
+};
+var __privateMethod = (obj, member, method) => {
+  __accessCheck(obj, member, "access private method");
+  return method;
+};
+var _DEFAULT_ENDPOINT, _DEFAULT_TIMEOUT, _client, _credentials, _gatewayConfiguration, _defaultBucket, _getEncodedToken, getEncodedToken_fn;
+class PinManager {
   /**
-   * Deletes a key and all its values from a FormData object.
-   *
-   * @param {string} name
+   * @typedef {Object} pinManagerOptions Optional settings for the constructor.
+   * @property {string} [bucket] Default bucket to use.
+   * @property {pinDownloadOptions} [gateway] Default gateway to use.
    */
-  delete(
-    name = panic(new TypeError("FormData.delete: requires string argument"))
-  ) {
-    const entries = this._entries;
-    let index = 0;
-    while (index < entries.length) {
-      const [entryName] = /** @type {[string, FormDataEntryValue]}*/ (
-        entries[index]
-      );
-      if (entryName === name) {
-        entries.splice(index, 1);
-      } else {
-        index++;
-      }
-    }
-  }
-
   /**
-   * Returns the first value associated with a given key from within a
-   * FormData object.
-   *
-   * @param {string} name
-   * @returns {FormDataEntryValue|null}
+   * @typedef {Object} pinDownloadOptions Optional settings for downloading pins
+   * @property {string} endpoint Default gateway to use.
+   * @property {string} [token] Token for the default gateway.
+   * @property {number} [timeout=60000] Timeout for the default gateway
    */
-
-  get(name = panic(new TypeError("FormData.get: requires string argument"))) {
-    for (const [entryName, value] of this._entries) {
-      if (entryName === name) {
-        return value
-      }
-    }
-    return null
+  /**
+   * @summary Creates a new instance of the constructor.
+   * @param {string} clientKey - The access key ID for authentication.
+   * @param {string} clientSecret - The secret access key for authentication.
+   * @param {pinManagerOptions} [options] - Optional settings for the constructor.
+   * @tutorial quickstart-pin
+   * @example
+   * import { PinManager } from "@filebase/sdk";
+   * const pinManager = new PinManager("KEY_FROM_DASHBOARD", "SECRET_FROM_DASHBOARD", {
+   *   bucket: "my-default-bucket",
+   *   gateway: {
+   *     endpoint: "https://my-default-gateway.mydomain.com
+   *     token: SUPER_SECRET_GATEWAY_TOKEN
+   *   }
+   * });
+   */
+  constructor(clientKey, clientSecret, options) {
+    __privateAdd(this, _getEncodedToken);
+    __privateAdd(this, _DEFAULT_ENDPOINT, "https://api.filebase.io");
+    __privateAdd(this, _DEFAULT_TIMEOUT, 6e4);
+    __privateAdd(this, _client, void 0);
+    __privateAdd(this, _credentials, void 0);
+    __privateAdd(this, _gatewayConfiguration, void 0);
+    __privateAdd(this, _defaultBucket, void 0);
+    __privateSet(this, _defaultBucket, options?.bucket);
+    const PSAClientEndpoint = process.env.NODE_ENV === "test" ? process.env.TEST_NAME_ENDPOINT || __privateGet(this, _DEFAULT_ENDPOINT) : __privateGet(this, _DEFAULT_ENDPOINT), baseURL = `${PSAClientEndpoint}/v1/ipfs/pins`;
+    __privateSet(this, _credentials, {
+      key: clientKey,
+      secret: clientSecret
+    });
+    __privateSet(this, _client, axios.create({
+      baseURL,
+      timeout: __privateGet(this, _DEFAULT_TIMEOUT)
+    }));
+    __privateSet(this, _gatewayConfiguration, {
+      endpoint: options?.gateway?.endpoint,
+      token: options?.gateway?.token,
+      timeout: options?.gateway?.timeout || __privateGet(this, _DEFAULT_TIMEOUT)
+    });
   }
-
   /**
-   * Returns an array of all the values associated with a given key from within
-   * a FormData.
-   *
-   * @param {string} name
-   * @returns {FormDataEntryValue[]}
+   * @typedef {Object} pinStatus
+   * @property {string} requestid Globally unique identifier of the pin request; can be used to check the status of ongoing pinning, or pin removal
+   * @property {string} status Status a pin object can have at a pinning service. ("queued","pinning","pinned","failed")
+   * @property {string} created Immutable timestamp indicating when a pin request entered a pinning service; can be used for filtering results and pagination
+   * @property {Object} pin Pin object
+   * @property {string} pin.cid Content Identifier (CID) pinned recursively
+   * @property {string} pin.name Name for pinned data; can be used for lookups later
+   * @property {Array} pin.origins Optional list of multiaddrs known to provide the data
+   * @property {Object} pin.meta Optional metadata for pin object
+   * @property {Array} delegates List of multiaddrs designated by pinning service that will receive the pin data
+   * @property {object} [info] Optional info for PinStatus response
+   * @property {function} download Convenience function to download pin
    */
-  getAll(
-    name = panic(new TypeError("FormData.getAll: requires string argument"))
-  ) {
-    const values = [];
-    for (const [entryName, value] of this._entries) {
-      if (entryName === name) {
-        values.push(value);
+  /**
+   * @typedef {Object} pinOptions
+   * @property {string} [bucket] - The bucket to pin the IPFS CID into.
+   */
+  /**
+   * @typedef {Object} listPinOptions
+   * @property {Array} [cid] Return pin objects responsible for pinning the specified CID(s); be aware that using longer hash functions introduces further constraints on the number of CIDs that will fit under the limit of 2000 characters per URL in browser contexts
+   * @property {string} [name] Return pin objects with specified name (by default a case-sensitive, exact match)
+   * @property {string} [match] Customize the text matching strategy applied when the name filter is present; exact (the default) is a case-sensitive exact match, partial matches anywhere in the name, iexact and ipartial are case-insensitive versions of the exact and partial strategies
+   * @property {Array} [status] Return pin objects for pins with the specified status (when missing, service defaults to pinned only)
+   * @property {string} [before] Return results created (queued) before provided timestamp
+   * @property {string} [after] Return results created (queued) after provided timestamp
+   * @property {number} [limit] Max records to return
+   * @property {Object} [meta] Return pin objects that match specified metadata keys passed as a string representation of a JSON object; when implementing a client library, make sure the parameter is URL-encoded to ensure safe transport
+   */
+  /**
+   * @typedef {Object} listPinResults
+   * @property {number} count Total number of pin objects that exist for passed query filters
+   * @property {Array} Array of PinStatus results
+   */
+  /**
+   * @summary List the pins in a given bucket
+   * @param {listPinOptions} [listOptions]
+   * @param {pinOptions} [options]
+   * @returns {Promise}
+   * @example
+   * // List pins in bucket with a limit of 1000
+   * await pinManager.list({
+   *   limit: 1000
+   * });
+   */
+  async list(listOptions, options) {
+    try {
+      const encodedToken = __privateMethod(this, _getEncodedToken, getEncodedToken_fn).call(this, options?.bucket), getResponse = await __privateGet(this, _client).request({
+        method: "GET",
+        params: listOptions,
+        headers: { Authorization: `Bearer ${encodedToken}` }
+      });
+      for (let pinStatus of getResponse.data.results) {
+        pinStatus.download = () => {
+          return this.download(pinStatus.pin.cid);
+        };
       }
+      return getResponse.data;
+    } catch (err) {
+      apiErrorHandler(err);
     }
-    return values
   }
-
   /**
-   * Returns a boolean stating whether a FormData object contains a certain key.
-   *
-   * @param {string} name
+   * @summary Create a pin in the selected bucket
+   * @param {string} key Key or path of the file in the bucket
+   * @param {string} cid Content Identifier (CID) to be pinned recursively
+   * @param {Object} [metadata] Optional metadata for pin object
+   * @param {pinOptions} [options] Options for pinning the object
+   * @returns {Promise}
+   * @example
+   * // Create Pin with Metadata
+   * await pinManager.create("my-pin", "QmTJkc7crTuPG7xRmCQSz1yioBpCW3juFBtJPXhQfdCqGF", {
+   *   "application": "my-custom-app-on-filebase"
+   * });
    */
-
-  has(name = panic(new TypeError("FormData.has: requires string argument"))) {
-    for (const [entryName] of this._entries) {
-      if (entryName === name) {
-        return true
-      }
+  async create(key, cid, metadata, options) {
+    try {
+      const encodedToken = __privateMethod(this, _getEncodedToken, getEncodedToken_fn).call(this, options?.bucket), pinStatus = await __privateGet(this, _client).request({
+        method: "POST",
+        data: {
+          cid,
+          name: key,
+          meta: metadata
+        },
+        headers: { Authorization: `Bearer ${encodedToken}` }
+      });
+      pinStatus.data.download = () => {
+        return this.download(pinStatus.data.pin.cid);
+      };
+      return pinStatus.data;
+    } catch (err) {
+      apiErrorHandler(err);
     }
-    return false
   }
-
   /**
-   * Sets a new value for an existing key inside a FormData object, or adds the
-   * key/value if it does not already exist.
-   *
-   * @param {string} name
-   * @param {string|Blob|File} value
-   * @param {string} [filename]
+   * @typedef {Object} replacePinOptions
+   * @augments pinOptions
+   * @property {Object} [metadata] Optional metadata to set on pin during replacement
+   * @property {string} [name] Optional name for pin to set during replacement
    */
-
-  set(
-    name,
-    value = panic(new TypeError("FormData.set: requires at least 2 arguments")),
-    filename
-  ) {
-    let index = 0;
-    const { _entries: entries } = this;
-    const entryValue = toEntryValue(value, filename);
-    let wasSet = false;
-    while (index < entries.length) {
-      const entry = /** @type {[string, FormDataEntryValue]}*/ (entries[index]);
-      if (entry[0] === name) {
-        if (wasSet) {
-          entries.splice(index, 1);
-        } else {
-          wasSet = true;
-          entry[1] = entryValue;
-          index++;
-        }
-      } else {
-        index++;
+  /**
+   * @summary Replace a pinned object in the selected bucket
+   * @param {string} requestid Unique ID for the pinned object
+   * @param {string} cid Content Identifier (CID) to be pinned recursively
+   * @param {replacePinOptions} [options] Options for pinning the object
+   * @returns {Promise}
+   * @example
+   * // Replace Pin with Metadata
+   * await pinManager.create("qr4231213", "QmTJkc7crTuPG7xRmCQSz1yioBpCW3juFBtJPXhQfdCqGF", {
+   *   "revision": Date.now()
+   * }
+   */
+  async replace(requestid, cid, options) {
+    try {
+      let replaceData = {
+        cid,
+        meta: options?.metadata || {}
+      };
+      if (options?.name) {
+        replaceData.name = options.name;
       }
-    }
-
-    if (!wasSet) {
-      entries.push([name, entryValue]);
+      const encodedToken = __privateMethod(this, _getEncodedToken, getEncodedToken_fn).call(this, options?.bucket), pinStatusResult = await __privateGet(this, _client).request({
+        method: "POST",
+        url: `/${requestid}`,
+        data: replaceData,
+        validateStatus: (status) => {
+          return status === 200;
+        },
+        headers: { Authorization: `Bearer ${encodedToken}` }
+      });
+      const pinStatus = pinStatusResult.data;
+      pinStatus.download = () => {
+        return this.download(pinStatus.pin.cid);
+      };
+      return pinStatus;
+    } catch (err) {
+      apiErrorHandler(err);
     }
   }
-
   /**
-   * Method returns an iterator allowing to go through all key/value pairs
-   * contained in this object.
+   * @summary Download a pin from the selected IPFS gateway
+   * @param {string} cid
+   * @param {pinDownloadOptions} [options]
+   * @returns {Promise}
+   * @example
+   * // Download Pin by CID
+   * await pinManager.download("QmTJkc7crTuPG7xRmCQSz1yioBpCW3juFBtJPXhQfdCqGF");
    */
-  entries() {
-    return this._entries.values()
+  async download(cid, options) {
+    const downloadOptions = Object.assign(__privateGet(this, _gatewayConfiguration), options);
+    return downloadFromGateway(cid, downloadOptions);
   }
-
   /**
-   * Returns an iterator allowing to go through all keys of the key/value pairs
-   * contained in this object.
-   *
-   * @returns {IterableIterator}
+   * @summary Get details about a pinned object
+   * @param {string} requestid Globally unique identifier of the pin request
+   * @param {pinOptions} [options] Options for getting the pin
+   * @returns {Promise}
+   * @example
+   * // Get Pin Info by RequestId
+   * await pinManager.get("qr4231214");
    */
-  *keys() {
-    for (const [name] of this._entries) {
-      yield name;
+  async get(requestid, options) {
+    try {
+      const encodedToken = __privateMethod(this, _getEncodedToken, getEncodedToken_fn).call(this, options?.bucket), getResponseResult = await __privateGet(this, _client).request({
+        method: "GET",
+        url: `/${requestid}`,
+        headers: { Authorization: `Bearer ${encodedToken}` },
+        validateStatus: (status) => {
+          return status === 200 || status === 404;
+        }
+      });
+      if (getResponseResult.status === 404) {
+        return false;
+      }
+      const pinStatus = getResponseResult.data;
+      pinStatus.download = () => {
+        return this.download(pinStatus.pin.cid);
+      };
+      return pinStatus;
+    } catch (err) {
+      apiErrorHandler(err);
     }
   }
-
   /**
-   * Returns an iterator allowing to go through all values contained in this
-   * object.
-   *
-   * @returns {IterableIterator}
+   * @summary Delete a pinned object from the selected bucket
+   * @param requestid Globally unique identifier of the pin request
+   * @param {pinOptions} [options] Options for deleting the pin
+   * @returns {Promise}
+   * @example
+   * // Delete Pin by RequestId
+   * await pinManager.delete("qr4231213");
    */
-  *values() {
-    for (const [_, value] of this._entries) {
-      yield value;
+  async delete(requestid, options) {
+    try {
+      const encodedToken = __privateMethod(this, _getEncodedToken, getEncodedToken_fn).call(this, options?.bucket);
+      await __privateGet(this, _client).request({
+        method: "DELETE",
+        url: `/${requestid}`,
+        headers: { Authorization: `Bearer ${encodedToken}` },
+        validateStatus: (status) => {
+          return status === 202;
+        }
+      });
+      return true;
+    } catch (err) {
+      apiErrorHandler(err);
     }
   }
+}
+_DEFAULT_ENDPOINT = new WeakMap();
+_DEFAULT_TIMEOUT = new WeakMap();
+_client = new WeakMap();
+_credentials = new WeakMap();
+_gatewayConfiguration = new WeakMap();
+_defaultBucket = new WeakMap();
+_getEncodedToken = new WeakSet();
+getEncodedToken_fn = function(bucket) {
+  bucket = bucket || __privateGet(this, _defaultBucket);
+  return Buffer.from(
+    `${__privateGet(this, _credentials).key}:${__privateGet(this, _credentials).secret}:${bucket}`
+  ).toString("base64");
+};
 
-  [Symbol.iterator]() {
-    return this._entries.values()
-  }
 
-  /**
-   * @param {(value: FormDataEntryValue, key: string, parent: globalThis.FormData) => void} fn
-   * @param {any} [thisArg]
-   * @returns {void}
-   */
-  forEach(fn, thisArg) {
-    for (const [key, value] of this._entries) {
-      fn.call(thisArg, value, key, this);
-    }
-  }
-}
 
-/**
- * @param {any} value
- * @returns {value is HTMLFormElement}
- */
-const isHTMLFormElement = value =>
-  Object.prototype.toString.call(value) === "[object HTMLFormElement]";
+// EXTERNAL MODULE: ./node_modules/graceful-fs/graceful-fs.js
+var graceful_fs = __nccwpck_require__(7261);
+;// CONCATENATED MODULE: ./node_modules/files-from-path/esm/src/index.js
 
-/**
- * @param {string|Blob|File} value
- * @param {string} [filename]
- * @returns {FormDataEntryValue}
- */
-const toEntryValue = (value, filename) => {
-  if (isFile(value)) {
-    return filename != null ? new BlobFile([value], filename, value) : value
-  } else if (isBlob(value)) {
-    return new BlobFile([value], filename != null ? filename : "blob")
-  } else {
-    if (filename != null) {
-      throw new TypeError(
-        "filename is only supported when value is Blob or File"
-      )
-    }
-    return `${value}`
-  }
-};
 
-/**
- * @param {any} value
- * @returns {value is File}
- */
-const isFile = value =>
-  Object.prototype.toString.call(value) === "[object File]" &&
-  typeof value.name === "string";
 
-/**
- * @param {any} value
- * @returns {value is Blob}
- */
-const isBlob = value =>
-  Object.prototype.toString.call(value) === "[object Blob]";
 
-/**
- * Simple `File` implementation that just wraps a given blob.
- * @implements {globalThis.File}
- */
-const BlobFile = class File {
-  /**
-   * @param {[Blob]} parts
-   * @param {string} name
-   * @param {FilePropertyBag} [options]
-   */
-  constructor([blob], name, { lastModified = Date.now() } = {}) {
-    this.blob = blob;
-    this.name = name;
-    this.lastModified = lastModified;
-  }
-  get webkitRelativePath() {
-    return ""
-  }
-  get size() {
-    return this.blob.size
-  }
-  get type() {
-    return this.blob.type
+const defaultfs = {
+  createReadStream: graceful_fs.createReadStream,
+  promises: {
+    stat: (0,external_util_.promisify)(graceful_fs.stat),
+    readdir: (0,external_util_.promisify)(graceful_fs.readdir)
   }
-  /**
-   *
-   * @param {number} [start]
-   * @param {number} [end]
-   * @param {string} [contentType]
-   */
-  slice(start, end, contentType) {
-    return this.blob.slice(start, end, contentType)
+};
+async function filesFromPaths(paths, options) {
+  if (typeof paths === 'string') {
+    paths = [paths];
   }
-  stream() {
-    return this.blob.stream()
+  let commonParts;
+  const files = [];
+  for (const p of paths) {
+    for await (const file of filesFromPath(p, options)) {
+      files.push(file);
+      const nameParts = file.name.split(external_path_.sep);
+      if (commonParts == null) {
+        commonParts = nameParts.slice(0, -1);
+        continue;
+      }
+      for (let i = 0; i < commonParts.length; i++) {
+        if (commonParts[i] !== nameParts[i]) {
+          commonParts = commonParts.slice(0, i);
+          break;
+        }
+      }
+    }
   }
-  text() {
-    return this.blob.text()
+  const commonPath = `${ commonParts ?? [].join('/') }/`;
+  const commonPathFiles = files.map(f => ({
+    ...f,
+    name: f.name.slice(commonPath.length)
+  }));
+  return options?.sort == null || options?.sort === true ? commonPathFiles.sort((a, b) => a.name === b.name ? 0 : a.name > b.name ? 1 : -1) : commonPathFiles;
+}
+async function* filesFromPath(filepath, options) {
+  filepath = external_path_.resolve(filepath);
+  const fs = options?.fs ?? defaultfs;
+  const hidden = options?.hidden ?? false;
+  const filter = filepath => {
+    if (!hidden && external_path_.basename(filepath).startsWith('.'))
+      return false;
+    return true;
+  };
+  const name = filepath;
+  const stat = await fs.promises.stat(name);
+  if (!filter(name)) {
+    return;
   }
-  arrayBuffer() {
-    return this.blob.arrayBuffer()
+  if (stat.isFile()) {
+    yield {
+      name,
+      stream: () => external_stream_.Readable.toWeb(fs.createReadStream(name)),
+      size: stat.size
+    };
+  } else if (stat.isDirectory()) {
+    yield* filesFromDir(name, filter, options);
   }
-  get [Symbol.toStringTag]() {
-    return "File"
+}
+async function* filesFromDir(dir, filter, options) {
+  const fs = options?.fs ?? defaultfs;
+  const entries = await fs.promises.readdir(external_path_.join(dir), { withFileTypes: true });
+  for (const entry of entries) {
+    if (!filter(entry.name)) {
+      continue;
+    }
+    if (entry.isFile()) {
+      const name = external_path_.join(dir, entry.name);
+      const {size} = await fs.promises.stat(name);
+      yield {
+        name,
+        stream: () => external_stream_.Readable.toWeb(fs.createReadStream(name)),
+        size
+      };
+    } else if (entry.isDirectory()) {
+      yield* filesFromDir(external_path_.join(dir, entry.name), filter);
+    }
   }
-};
+}
+;// CONCATENATED MODULE: ./pinners/filebase.js
 
-/**
- * @param {*} error
- * @returns {never}
- */
-const panic = error => {
-  throw error
-};
 
-exports.FormData = FormData;
-//# sourceMappingURL=form-data.cjs.map
 
 
-/***/ }),
+/* harmony default export */ const filebase = ({
+  name: "Filebase",
+  builder: async (options) => {
+    const { filebaseKey, filebaseSecret, filebaseBucket } = options;
 
-/***/ 53077:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+    if (!filebaseKey) {
+      throw new Error("filebaseKey is empty");
+    }
 
-"use strict";
+    if (!filebaseSecret) {
+      throw new Error("filebaseSecret is empty");
+    }
 
+    if (!filebaseBucket) {
+      throw new Error("filebaseBucket is empty");
+    }
 
-Object.defineProperty(exports, "__esModule", ({ value: true }));
+    return {
+      key: filebaseKey,
+      secret: filebaseSecret,
+      bucket: filebaseBucket,
+    };
+  },
+  upload: async (api, options) => {
+    console.log(`Parsing options...`);
+    const { path, pinName, verbose, key } = options;
+    console.log(`Parsed Options: ${JSON.stringify(options)}`);
 
-var formData = __nccwpck_require__(49215);
+    let source = path;
+    if (!external_node_path_namespaceObject.isAbsolute(source)) {
+      const dir = (process.env.GITHUB_WORKSPACE || process.cwd()).toString();
+      source = external_node_path_namespaceObject.join(dir, source);
+    }
 
-// @ts-check
+    console.log(`Adding files...`);
+    const filesFromPath = await filesFromPaths(source);
+    const files = [];
+    for await (const file of filesFromPath) {
+      files.push({ path: file.name, content: file.stream() });
+      if (verbose) {
+        console.log(`Added File: ${JSON.stringify(file)}`);
+      }
+    }
 
-// Electron-renderer should get the browser implementation instead of node
-// which is why we check global first.
-const FormData =
-  typeof globalThis.FormData === "function"
-    ? globalThis.FormData
-    : formData.FormData;
+    console.log(`Starting filebase client`);
+    const objectManager = new ObjectManager(api.key, api.secret, {
+      bucket: api.bucket,
+    });
+    console.log(`Started filebase client`);
 
-exports.FormData = FormData;
-//# sourceMappingURL=lib.node.cjs.map
+    console.log(`Storing files...`);
+    const uploadResult = await objectManager.upload(pinName, files),
+      cid = uploadResult.cid;
+    console.log(`Stored files...`);
+    console.log(`CID: ${cid}`);
 
+    // Set IPNS name
+    let ipnsKey = null;
+    if (key) {
+      const nameManager = new NameManager(api.key, api.secret),
+        existingName = await nameManager.get(key);
+      ipnsKey = existingName.network_key;
 
-/***/ }),
+      if (existingName === false) {
+        console.log(`Creating name...`);
+        await nameManager.create(key, cid);
+        console.log(`Created name...`);
+      } else {
+        console.log(`Updating name...`);
+        await nameManager.update(key, cid);
+        console.log(`Updated name...`);
+      }
+    }
 
-/***/ 75224:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+    console.log(`Done`);
 
-try {
-  module.exports = __nccwpck_require__(35356)
-} catch (error) {
-  module.exports = __nccwpck_require__(10078)
-}
+    if (ipnsKey) {
+      return {
+        cid: cid,
+        ipfs: cid,
+        ipns: ipnsKey,
+      };
+    }
+    return {
+      cid: cid,
+      ipfs: cid,
+    };
+  },
+});
 
+;// CONCATENATED MODULE: ./pinners/index.js
 
-/***/ }),
 
-/***/ 45835:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
 
-let crypto = __nccwpck_require__(6113)
-let { urlAlphabet } = __nccwpck_require__(92975)
-const POOL_SIZE_MULTIPLIER = 128
-let pool, poolOffset
-let fillPool = bytes => {
-  if (!pool || pool.length < bytes) {
-    pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER)
-    crypto.randomFillSync(pool)
-    poolOffset = 0
-  } else if (poolOffset + bytes > pool.length) {
-    crypto.randomFillSync(pool)
-    poolOffset = 0
-  }
-  poolOffset += bytes
-}
-let random = bytes => {
-  fillPool((bytes -= 0))
-  return pool.subarray(poolOffset - bytes, poolOffset)
-}
-let customRandom = (alphabet, defaultSize, getRandom) => {
-  let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1
-  let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length)
-  return (size = defaultSize) => {
-    let id = ''
-    while (true) {
-      let bytes = getRandom(step)
-      let i = step
-      while (i--) {
-        id += alphabet[bytes[i] & mask] || ''
-        if (id.length === size) return id
-      }
+
+
+
+
+/* harmony default export */ const pinners = ({
+  ipfs: maker(ipfs),
+  pinata: maker(pinata),
+  infura: maker(infura),
+  filebase: maker(filebase)
+});
+
+;// CONCATENATED MODULE: ./uploader.js
+
+
+/* harmony default export */ const uploader = ({
+  upload: async (options) => {
+    const { service } = options;
+
+    if (!Object.keys(pinners).find((key) => key === service)) {
+      throw new Error("Pinning service is not supported");
     }
-  }
-}
-let customAlphabet = (alphabet, size = 21) =>
-  customRandom(alphabet, size, random)
-let nanoid = (size = 21) => {
-  fillPool((size -= 0))
-  let id = ''
-  for (let i = poolOffset - size; i < poolOffset; i++) {
-    id += urlAlphabet[pool[i] & 63]
-  }
-  return id
-}
-module.exports = { nanoid, customAlphabet, customRandom, urlAlphabet, random }
 
+    const svc = await pinners[service](options);
+    return svc.upload(options);
+  },
+});
 
-/***/ }),
+;// CONCATENATED MODULE: ./runner.js
 
-/***/ 92975:
-/***/ ((module) => {
 
-let urlAlphabet =
-  'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
-module.exports = { urlAlphabet }
->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05
+
+
+
+async function run() {
+  try {
+    const path = core.getInput("path");
+    const service = core.getInput("service");
+    const host = core.getInput("host");
+    const port = core.getInput("port");
+    const protocol = core.getInput("protocol");
+    const headers = core.getInput("headers");
+    const key = core.getInput("key");
+    const pinName = core.getInput("pinName");
+    const pinataKey = core.getInput("pinataKey");
+    const pinataSecret = core.getInput("pinataSecret");
+    const pinataPinName = core.getInput("pinataPinName");
+    const filebaseBucket = core.getInput("filebaseBucket")
+    const filebaseKey = core.getInput("filebaseKey")
+    const filebaseSecret = core.getInput("filebaseSecret")
+    const infuraProjectId = core.getInput("infuraProjectId");
+    const infuraProjectSecret = core.getInput("infuraProjectSecret");
+    const timeout = core.getInput("timeout");
+    const verbose = core.getInput("verbose") === "true";
+
+    const options = {
+      path,
+      service,
+      host,
+      port,
+      protocol,
+      headers: JSON.parse(headers || "{}"),
+      key,
+      pinName,
+      pinataKey,
+      pinataSecret,
+      pinataPinName,
+      filebaseBucket,
+      filebaseKey,
+      filebaseSecret,
+      infuraProjectId,
+      infuraProjectSecret,
+      timeout,
+      verbose,
+    };
+    const result = await uploader.upload(options).catch((err) => {
+      throw err;
+    });
+    core.setOutput("hash", result.ipfs);
+    core.setOutput("cid", result.cid);
+    core.setOutput("ipfs", result.ipfs);
+    core.setOutput("ipns", result.ipns);
+
+    if (verbose) {
+      // Get the JSON webhook payload for the event that triggered the workflow
+      const payload = JSON.stringify(github.context.payload, undefined, 2);
+      console.log(`The event payload: ${payload}`);
+    }
+
+    console.log("Upload to IPFS finished successfully", result);
+  } catch (error) {
+    core.setFailed(error.message);
+    throw error;
+  }
+}
+
+/* harmony default export */ const runner = (run);
 
 
 /***/ }),
@@ -280046,7 +205640,7 @@ module.exports = JSON.parse('[["0","\\u0000",128],["a1","。",62],["8140"," 
 /***/ 53765:
 /***/ ((module) => {
 
-module.exports = JSON.parse('{"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true,"extensions":["atomdeleted"]},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atsc-dwd+xml":{"source":"iana","compressible":true,"extensions":["dwd"]},"application/atsc-held+xml":{"source":"iana","compressible":true,"extensions":["held"]},"application/atsc-rdt+json":{"source":"iana","compressible":true},"application/atsc-rsat+xml":{"source":"iana","compressible":true,"extensions":["rsat"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true,"extensions":["xcs"]},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/cbor":{"source":"iana"},"application/cbor-seq":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true,"extensions":["cdfx"]},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/clue+xml":{"source":"iana","compressible":true},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana"},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/dns-message":{"source":"iana"},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["ecma","es"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true,"extensions":["emotionml"]},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/expect-ct-report+json":{"source":"iana","compressible":true},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true,"extensions":["fdt"]},"application/fhir+json":{"source":"iana","compressible":true},"application/fhir+xml":{"source":"iana","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/flexfec":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geopackage+sqlite3":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true,"extensions":["its"]},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true,"extensions":["lgr"]},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mipc":{"source":"iana"},"application/mmt-aei+xml":{"source":"iana","compressible":true,"extensions":["maei"]},"application/mmt-usd+xml":{"source":"iana","compressible":true,"extensions":["musd"]},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/mrb-publish+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/msc-ivr+xml":{"source":"iana","compressible":true},"application/msc-mixer+xml":{"source":"iana","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/multipart-core":{"source":"iana"},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana","extensions":["nq"]},"application/n-triples":{"source":"iana","extensions":["nt"]},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana"},"application/news-groupinfo":{"source":"iana"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana"},"application/nss":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odm+xml":{"source":"iana","compressible":true},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/oscore":{"source":"iana"},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p2p-overlay+xml":{"source":"iana","compressible":true,"extensions":["relo"]},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pem-certificate-chain":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana"},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","compressible":true},"application/pidf-diff+xml":{"source":"iana","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true,"extensions":["provx"]},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true,"extensions":["rapd"]},"application/route-s-tsid+xml":{"source":"iana","compressible":true,"extensions":["sls"]},"application/route-usd+xml":{"source":"iana","compressible":true,"extensions":["rusd"]},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true,"extensions":["senmlx"]},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true,"extensions":["sensmlx"]},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana","extensions":["siv","sieve"]},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/sipc":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/swid+xml":{"source":"iana","compressible":true,"extensions":["swidtag"]},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/tetra_isi":{"source":"iana"},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/toml":{"compressible":true,"extensions":["toml"]},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana"},"application/ttml+xml":{"source":"iana","compressible":true,"extensions":["ttml"]},"application/tve-trigger":{"source":"iana"},"application/tzif":{"source":"iana"},"application/tzif-leap":{"source":"iana"},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true,"extensions":["rsheet"]},"application/urc-targetdesc+xml":{"source":"iana","compressible":true},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true,"extensions":["1km"]},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mc-signalling-ear":{"source":"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.afplinedata-pagedef":{"source":"iana"},"application/vnd.afpc.foca-charset":{"source":"iana"},"application/vnd.afpc.foca-codedfont":{"source":"iana"},"application/vnd.afpc.foca-codepage":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.afpc.modca-formdef":{"source":"iana"},"application/vnd.afpc.modca-mediummap":{"source":"iana"},"application/vnd.afpc.modca-objectcontainer":{"source":"iana"},"application/vnd.afpc.modca-overlay":{"source":"iana"},"application/vnd.afpc.modca-pagesegment":{"source":"iana"},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.ota":{"source":"iana"},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.aplextor.warrp+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.keynote":{"source":"iana","extensions":["keynote"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.numbers":{"source":"iana","extensions":["numbers"]},"application/vnd.apple.pages":{"source":"iana","extensions":["pages"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true,"extensions":["bmml"]},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.error":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.bpf":{"source":"iana"},"application/vnd.bpf3":{"source":"iana"},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.ciedi":{"source":"iana"},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.cryptii.pipe+json":{"source":"iana","compressible":true},"application/vnd.crypto-shade-file":{"source":"iana"},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume.movie":{"source":"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.exstream-empower+zip":{"source":"iana","compressible":false},"application/vnd.exstream-package":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.ficlab.flb+zip":{"source":"iana","compressible":false},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.futoin+cbor":{"source":"iana"},"application/vnd.futoin+json":{"source":"iana","compressible":true},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.gentics.grd+json":{"source":"iana","compressible":true},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.iso11783-10+zip":{"source":"iana","compressible":false},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las":{"source":"iana"},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.laszip":{"source":"iana"},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.logipipe.circuit+zip":{"source":"iana","compressible":false},"application/vnd.loom":{"source":"iana"},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana"},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true,"extensions":["ac"]},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true,"extensions":["obgx"]},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true,"extensions":["osm"]},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos.xml":{"source":"iana"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.patientecommsdoc":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana"},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shade-save-file":{"source":"iana"},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.shopkick+json":{"source":"iana","compressible":true},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true,"extensions":["fo"]},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","compressible":true,"extensions":["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.veryant.thin":{"source":"iana"},"application/vnd.ves.encrypted":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-keepass2":{"extensions":["kdbx"]},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"apache","extensions":["der","crt","pem"]},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true,"extensions":["xav"]},"application/xcap-caps+xml":{"source":"iana","compressible":true,"extensions":["xca"]},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true,"extensions":["xel"]},"application/xcap-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/xcap-ns+xml":{"source":"iana","compressible":true,"extensions":["xns"]},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true,"extensions":["xlf"]},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"application/zstd":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana"},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/flexfec":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana","extensions":["mxmf"]},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tetra_acelp":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dts.uhd":{"source":"iana"},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","compressible":true,"extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana","extensions":["exr"]},"image/apng":{"compressible":false,"extensions":["apng"]},"image/avci":{"source":"iana"},"image/avcs":{"source":"iana"},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana","extensions":["drle"]},"image/emf":{"source":"iana","extensions":["emf"]},"image/fits":{"source":"iana","extensions":["fits"]},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/heic":{"source":"iana","extensions":["heic"]},"image/heic-sequence":{"source":"iana","extensions":["heics"]},"image/heif":{"source":"iana","extensions":["heif"]},"image/heif-sequence":{"source":"iana","extensions":["heifs"]},"image/hej2k":{"source":"iana","extensions":["hej2"]},"image/hsj2":{"source":"iana","extensions":["hsj2"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana","extensions":["jls"]},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jph":{"source":"iana","extensions":["jph"]},"image/jphc":{"source":"iana","extensions":["jhc"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/jxr":{"source":"iana","extensions":["jxr"]},"image/jxra":{"source":"iana","extensions":["jxra"]},"image/jxrs":{"source":"iana","extensions":["jxrs"]},"image/jxs":{"source":"iana","extensions":["jxs"]},"image/jxsc":{"source":"iana","extensions":["jxsc"]},"image/jxsi":{"source":"iana","extensions":["jxsi"]},"image/jxss":{"source":"iana","extensions":["jxss"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana","extensions":["pti"]},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana","extensions":["t38"]},"image/tiff":{"source":"iana","compressible":false,"extensions":["tif","tiff"]},"image/tiff-fx":{"source":"iana","extensions":["tfx"]},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana","extensions":["azv"]},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana","extensions":["ico"]},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-dds":{"extensions":["dds"]},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana","extensions":["tap"]},"image/vnd.valve.source.texture":{"source":"iana","extensions":["vtf"]},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana","extensions":["pcx"]},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana","extensions":["wmf"]},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana","extensions":["3mf"]},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/stl":{"source":"iana","extensions":["stl"]},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana","extensions":["ogex"]},"model/vnd.parasolid.transmit.binary":{"source":"iana","extensions":["x_b"]},"model/vnd.parasolid.transmit.text":{"source":"iana","extensions":["x_t"]},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.usdz+zip":{"source":"iana","compressible":false,"extensions":["usdz"]},"model/vnd.valve.source.compiled-map":{"source":"iana","extensions":["bsp"]},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana","extensions":["x3db"]},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana","extensions":["x3dv"]},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana"},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/flexfec":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"compressible":true,"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mdx":{"compressible":true,"extensions":["mdx"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shex":{"extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana"},"text/vnd.ficlab.flt":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.senx.warpscript":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sosi":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/flexfec":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana"},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vc2":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vnd.youtube.yt":{"source":"iana"},"video/vp8":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}}');
+module.exports = JSON.parse('{"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/3gpphal+json":{"source":"iana","compressible":true},"application/3gpphalforms+json":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/ace+cbor":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/alto-updatestreamcontrol+json":{"source":"iana","compressible":true},"application/alto-updatestreamparams+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/at+jwt":{"source":"iana"},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true,"extensions":["atomdeleted"]},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atsc-dwd+xml":{"source":"iana","compressible":true,"extensions":["dwd"]},"application/atsc-dynamic-event-message":{"source":"iana"},"application/atsc-held+xml":{"source":"iana","compressible":true,"extensions":["held"]},"application/atsc-rdt+json":{"source":"iana","compressible":true},"application/atsc-rsat+xml":{"source":"iana","compressible":true,"extensions":["rsat"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true,"extensions":["xcs"]},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/captive+json":{"source":"iana","compressible":true},"application/cbor":{"source":"iana"},"application/cbor-seq":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true,"extensions":["cdfx"]},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/city+json":{"source":"iana","compressible":true},"application/clr":{"source":"iana"},"application/clue+xml":{"source":"iana","compressible":true},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true,"extensions":["cpl"]},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dash-patch+xml":{"source":"iana","compressible":true,"extensions":["mpp"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana"},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/dns-message":{"source":"iana"},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dots+cbor":{"source":"iana"},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["es","ecma"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/elm+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/elm+xml":{"source":"iana","compressible":true},"application/emergencycalldata.cap+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true,"extensions":["emotionml"]},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/expect-ct-report+json":{"source":"iana","compressible":true},"application/express":{"source":"iana","extensions":["exp"]},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true,"extensions":["fdt"]},"application/fhir+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/fhir+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/flexfec":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geopackage+sqlite3":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true,"extensions":["its"]},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/jscalendar+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true,"extensions":["lgr"]},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lpf+zip":{"source":"iana","compressible":false},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true,"extensions":["mpf"]},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mipc":{"source":"iana"},"application/missing-blocks+cbor-seq":{"source":"iana"},"application/mmt-aei+xml":{"source":"iana","compressible":true,"extensions":["maei"]},"application/mmt-usd+xml":{"source":"iana","compressible":true,"extensions":["musd"]},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true},"application/mrb-publish+xml":{"source":"iana","compressible":true},"application/msc-ivr+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msc-mixer+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/multipart-core":{"source":"iana"},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana","extensions":["nq"]},"application/n-triples":{"source":"iana","extensions":["nt"]},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana","charset":"US-ASCII"},"application/news-groupinfo":{"source":"iana","charset":"US-ASCII"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana","extensions":["cjs"]},"application/nss":{"source":"iana"},"application/oauth-authz-req+jwt":{"source":"iana"},"application/oblivious-dns-message":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odm+xml":{"source":"iana","compressible":true},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{"source":"iana","compressible":true},"application/oscore":{"source":"iana"},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p21":{"source":"iana"},"application/p21+zip":{"source":"iana","compressible":false},"application/p2p-overlay+xml":{"source":"iana","compressible":true,"extensions":["relo"]},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pem-certificate-chain":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana","extensions":["asc"]},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pidf-diff+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true,"extensions":["provx"]},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.cyn":{"source":"iana","charset":"7-BIT"},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/pvd+json":{"source":"iana","compressible":true},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true,"extensions":["rapd"]},"application/route-s-tsid+xml":{"source":"iana","compressible":true,"extensions":["sls"]},"application/route-usd+xml":{"source":"iana","compressible":true,"extensions":["rusd"]},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sarif+json":{"source":"iana","compressible":true},"application/sarif-external-properties+json":{"source":"iana","compressible":true},"application/sbe":{"source":"iana"},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true,"extensions":["senmlx"]},"application/senml-etch+cbor":{"source":"iana"},"application/senml-etch+json":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true,"extensions":["sensmlx"]},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana","extensions":["siv","sieve"]},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/sipc":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spdx+json":{"source":"iana","compressible":true},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/swid+xml":{"source":"iana","compressible":true,"extensions":["swidtag"]},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/td+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/tetra_isi":{"source":"iana"},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/token-introspection+jwt":{"source":"iana"},"application/toml":{"compressible":true,"extensions":["toml"]},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana","extensions":["trig"]},"application/ttml+xml":{"source":"iana","compressible":true,"extensions":["ttml"]},"application/tve-trigger":{"source":"iana"},"application/tzif":{"source":"iana"},"application/tzif-leap":{"source":"iana"},"application/ubjson":{"compressible":false,"extensions":["ubj"]},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true,"extensions":["rsheet"]},"application/urc-targetdesc+xml":{"source":"iana","compressible":true,"extensions":["td"]},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true,"extensions":["1km"]},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.5gnas":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gtpc":{"source":"iana"},"application/vnd.3gpp.interworking-data":{"source":"iana"},"application/vnd.3gpp.lpp":{"source":"iana"},"application/vnd.3gpp.mc-signalling-ear":{"source":"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ngap":{"source":"iana"},"application/vnd.3gpp.pfcp":{"source":"iana"},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.s1ap":{"source":"iana"},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.afplinedata-pagedef":{"source":"iana"},"application/vnd.afpc.cmoca-cmresource":{"source":"iana"},"application/vnd.afpc.foca-charset":{"source":"iana"},"application/vnd.afpc.foca-codedfont":{"source":"iana"},"application/vnd.afpc.foca-codepage":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.afpc.modca-cmtable":{"source":"iana"},"application/vnd.afpc.modca-formdef":{"source":"iana"},"application/vnd.afpc.modca-mediummap":{"source":"iana"},"application/vnd.afpc.modca-objectcontainer":{"source":"iana"},"application/vnd.afpc.modca-overlay":{"source":"iana"},"application/vnd.afpc.modca-pagesegment":{"source":"iana"},"application/vnd.age":{"source":"iana","extensions":["age"]},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.ota":{"source":"iana"},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.arrow.file":{"source":"iana"},"application/vnd.apache.arrow.stream":{"source":"iana"},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.aplextor.warrp+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.keynote":{"source":"iana","extensions":["key"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.numbers":{"source":"iana","extensions":["numbers"]},"application/vnd.apple.pages":{"source":"iana","extensions":["pages"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true,"extensions":["bmml"]},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.error":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.bpf":{"source":"iana"},"application/vnd.bpf3":{"source":"iana"},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.ciedi":{"source":"iana"},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.cryptii.pipe+json":{"source":"iana","compressible":true},"application/vnd.crypto-shade-file":{"source":"iana"},"application/vnd.cryptomator.encrypted":{"source":"iana"},"application/vnd.cryptomator.vault":{"source":"iana"},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.cyclonedx+json":{"source":"iana","compressible":true},"application/vnd.cyclonedx+xml":{"source":"iana","compressible":true},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.d3m-dataset":{"source":"iana"},"application/vnd.d3m-problem":{"source":"iana"},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.dbf":{"source":"iana","extensions":["dbf"]},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume.movie":{"source":"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbisl+xml":{"source":"iana","compressible":true},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.eclipse.ditto+json":{"source":"iana","compressible":true},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eu.kasparian.car+json":{"source":"iana","compressible":true},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.exstream-empower+zip":{"source":"iana","compressible":false},"application/vnd.exstream-package":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.familysearch.gedcom+zip":{"source":"iana","compressible":false},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.ficlab.flb+zip":{"source":"iana","compressible":false},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujifilm.fb.docuworks":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.container":{"source":"iana"},"application/vnd.fujifilm.fb.jfi+xml":{"source":"iana","compressible":true},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.futoin+cbor":{"source":"iana"},"application/vnd.futoin+json":{"source":"iana","compressible":true},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.gentics.grd+json":{"source":"iana","compressible":true},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.slides":{"source":"iana"},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hl7cda+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.hl7v2+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.iso11783-10+zip":{"source":"iana","compressible":false},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las":{"source":"iana"},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.laszip":{"source":"iana"},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.logipipe.circuit+zip":{"source":"iana","compressible":false},"application/vnd.loom":{"source":"iana"},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana","extensions":["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxar.archive.3tz+zip":{"source":"iana","compressible":false},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.nacamar.ybrid+json":{"source":"iana","compressible":true},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nebumind.line":{"source":"iana"},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true,"extensions":["ac"]},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oci.image.manifest.v1+json":{"source":"iana","compressible":true},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+cbor":{"source":"iana"},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true,"extensions":["obgx"]},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true,"extensions":["osm"]},"application/vnd.opentimestamps.ots":{"source":"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos.xml":{"source":"iana"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.patientecommsdoc":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana","extensions":["rar"]},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.resilient.logic":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sar":{"source":"iana"},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.seis+json":{"source":"iana","compressible":true},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shade-save-file":{"source":"iana"},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.shopkick+json":{"source":"iana","compressible":true},"application/vnd.shp":{"source":"iana"},"application/vnd.shx":{"source":"iana"},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.snesdev-page-table":{"source":"iana"},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true,"extensions":["fo"]},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.sycle+xml":{"source":"iana","compressible":true},"application/vnd.syft+json":{"source":"iana","compressible":true},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","charset":"UTF-8","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.veritone.aion+json":{"source":"iana","compressible":true},"application/vnd.veryant.thin":{"source":"iana"},"application/vnd.ves.encrypted":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","charset":"UTF-8","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.dpp":{"source":"iana"},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"source":"iana","compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true,"extensions":["wif"]},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-iwork-keynote-sffkey":{"extensions":["key"]},"application/x-iwork-numbers-sffnumbers":{"extensions":["numbers"]},"application/x-iwork-pages-sffpages":{"extensions":["pages"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-keepass2":{"extensions":["kdbx"]},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-pki-message":{"source":"iana"},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"iana","extensions":["der","crt","pem"]},"application/x-x509-ca-ra-cert":{"source":"iana"},"application/x-x509-next-ca-cert":{"source":"iana"},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true,"extensions":["xav"]},"application/xcap-caps+xml":{"source":"iana","compressible":true,"extensions":["xca"]},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true,"extensions":["xel"]},"application/xcap-error+xml":{"source":"iana","compressible":true},"application/xcap-ns+xml":{"source":"iana","compressible":true,"extensions":["xns"]},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true,"extensions":["xlf"]},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xsl","xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"application/zstd":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana","extensions":["amr"]},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/flexfec":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/mhas":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana","extensions":["mxmf"]},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx","opus"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/scip":{"source":"iana"},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sofa":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tetra_acelp":{"source":"iana"},"audio/tetra_acelp_bb":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/tsvcis":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dts.uhd":{"source":"iana"},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","compressible":true,"extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana","extensions":["exr"]},"image/apng":{"compressible":false,"extensions":["apng"]},"image/avci":{"source":"iana","extensions":["avci"]},"image/avcs":{"source":"iana","extensions":["avcs"]},"image/avif":{"source":"iana","compressible":false,"extensions":["avif"]},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana","extensions":["drle"]},"image/emf":{"source":"iana","extensions":["emf"]},"image/fits":{"source":"iana","extensions":["fits"]},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/heic":{"source":"iana","extensions":["heic"]},"image/heic-sequence":{"source":"iana","extensions":["heics"]},"image/heif":{"source":"iana","extensions":["heif"]},"image/heif-sequence":{"source":"iana","extensions":["heifs"]},"image/hej2k":{"source":"iana","extensions":["hej2"]},"image/hsj2":{"source":"iana","extensions":["hsj2"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana","extensions":["jls"]},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jph":{"source":"iana","extensions":["jph"]},"image/jphc":{"source":"iana","extensions":["jhc"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/jxr":{"source":"iana","extensions":["jxr"]},"image/jxra":{"source":"iana","extensions":["jxra"]},"image/jxrs":{"source":"iana","extensions":["jxrs"]},"image/jxs":{"source":"iana","extensions":["jxs"]},"image/jxsc":{"source":"iana","extensions":["jxsc"]},"image/jxsi":{"source":"iana","extensions":["jxsi"]},"image/jxss":{"source":"iana","extensions":["jxss"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/ktx2":{"source":"iana","extensions":["ktx2"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana","extensions":["pti"]},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana","extensions":["t38"]},"image/tiff":{"source":"iana","compressible":false,"extensions":["tif","tiff"]},"image/tiff-fx":{"source":"iana","extensions":["tfx"]},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana","extensions":["azv"]},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana","compressible":true,"extensions":["ico"]},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-dds":{"compressible":true,"extensions":["dds"]},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.pco.b16":{"source":"iana","extensions":["b16"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana","extensions":["tap"]},"image/vnd.valve.source.texture":{"source":"iana","extensions":["vtf"]},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana","extensions":["pcx"]},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana","extensions":["wmf"]},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana","extensions":["3mf"]},"model/e57":{"source":"iana"},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/mtl":{"source":"iana","extensions":["mtl"]},"model/obj":{"source":"iana","extensions":["obj"]},"model/step":{"source":"iana"},"model/step+xml":{"source":"iana","compressible":true,"extensions":["stpx"]},"model/step+zip":{"source":"iana","compressible":false,"extensions":["stpz"]},"model/step-xml+zip":{"source":"iana","compressible":false,"extensions":["stpxz"]},"model/stl":{"source":"iana","extensions":["stl"]},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana","extensions":["ogex"]},"model/vnd.parasolid.transmit.binary":{"source":"iana","extensions":["x_b"]},"model/vnd.parasolid.transmit.text":{"source":"iana","extensions":["x_t"]},"model/vnd.pytha.pyox":{"source":"iana"},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.sap.vds":{"source":"iana","extensions":["vds"]},"model/vnd.usdz+zip":{"source":"iana","compressible":false,"extensions":["usdz"]},"model/vnd.valve.source.compiled-map":{"source":"iana","extensions":["bsp"]},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana","extensions":["x3db"]},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana","extensions":["x3dv"]},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana"},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/cql":{"source":"iana"},"text/cql-expression":{"source":"iana"},"text/cql-identifier":{"source":"iana"},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/fhirpath":{"source":"iana"},"text/flexfec":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/gff3":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"compressible":true,"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mdx":{"compressible":true,"extensions":["mdx"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana","charset":"UTF-8"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana","charset":"UTF-8"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shaclc":{"source":"iana"},"text/shex":{"source":"iana","extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/spdx":{"source":"iana","extensions":["spdx"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana","charset":"UTF-8"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana","charset":"UTF-8"},"text/vnd.familysearch.gedcom":{"source":"iana","extensions":["ged"]},"text/vnd.ficlab.flt":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hans":{"source":"iana"},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.senx.warpscript":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sosi":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","charset":"UTF-8","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana","charset":"UTF-8"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"compressible":true,"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/av1":{"source":"iana"},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/ffv1":{"source":"iana"},"video/flexfec":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana","extensions":["m4s"]},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/jxsv":{"source":"iana"},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/scip":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vc2":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vnd.youtube.yt":{"source":"iana"},"video/vp8":{"source":"iana"},"video/vp9":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}}');
 
 /***/ })
 
@@ -280185,24 +205779,10 @@ module.exports = JSON.parse('{"application/1d-interleaved-parityfec":{"source":"
 /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
 /******/ 
 /************************************************************************/
-<<<<<<< HEAD
 /******/ 
 /******/ // startup
 /******/ // Load entry module and return exports
 /******/ // This entry module used 'module' so it can't be inlined
-/******/ var __webpack_exports__ = __nccwpck_require__(58686);
+/******/ var __webpack_exports__ = __nccwpck_require__(5393);
 /******/ __webpack_exports__ = await __webpack_exports__;
 /******/ 
-=======
-var __webpack_exports__ = {};
-// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
-(() => {
-const run = __nccwpck_require__(35806);
-
-run();
-})();
-
-module.exports = __webpack_exports__;
-/******/ })()
-;
->>>>>>> 1ef4ad5f220f2d3170a3249c7c9fa12bf9fefa05